|
hydrogen 1.2.6
|
Filesystem is a thin layer over QDir, QFile and QFileInfo. More...
#include <Filesystem.h>
Public Types | |
| enum class | AudioFormat { Aif , Aifc , Aiff , Au , Caf , Flac , Mp3 , Ogg , Opus , Unknown , Voc , W64 , Wav } |
| All audio file formats supported by Hydrogen. More... | |
| enum class | DrumkitType { System = 0 , User = 1 , SessionReadOnly = 2 , SessionReadWrite = 3 } |
| Determines were to find a kit and whether it is writable by the current user. More... | |
| enum | file_perms { is_dir =0x01 , is_file =0x02 , is_readable =0x04 , is_writable =0x08 , is_executable =0x10 } |
| flags available for check_permissions() More... | |
| enum class | Lookup { stacked = 0 , user = 1 , system = 2 } |
| Whenever a drumkit is loaded by name a collision between a user and a system drumkit carrying the same name can occur. More... | |
Static Public Member Functions | |
| static QString | absolute_path (const QString &sFilename, bool bSilent=false) |
| Convert a direct to an absolute path. | |
| static AudioFormat | AudioFormatFromSuffix (const QString &sFile, bool bSilent=false) |
| Determines the audio format of the provided filename or path based on its suffix. | |
| static QString | AudioFormatToSuffix (const AudioFormat &format, bool bSilent=false) |
| Converts format to the default lower case suffix of the format. | |
| static bool | bootstrap (Logger *logger, const QString &sSysDataPath="", const QString &sUsrDataPath="", const QString &sUserConfigFile="", const QString &sLogFile="") |
| check user and system filesystem usability | |
| static QString | cache_dir () |
| returns user cache path | |
| static QString | click_file_path () |
| Returns a string containing the path to the click.wav file used in the metronome. | |
| static QString | default_song_name () |
| Default option to offer the user when saving an empty song to disk. | |
| static QString | demos_dir () |
| returns system demos path | |
| static DrumkitType | determineDrumkitType (const QString &sPath) |
| static bool | dir_exists (const QString &path, bool silent=false) |
| returns true if the given path is a regular directory | |
| static bool | dir_readable (const QString &path, bool silent=false) |
| returns true if the given path is a readable regular directory | |
| static bool | dir_writable (const QString &path, bool silent=false) |
| returns true if the given path is a writable regular directory | |
| static QString | doc_dir () |
| returns documentation path | |
| static QString | drumkit_backup_path (const QString &dk_path) |
| Create a backup path from a drumkit path. | |
| static QString | drumkit_default_kit () |
| static QString | drumkit_dir_search (const QString &dk_name, Lookup lookup) |
| returns the directory holding the named drumkit searching within user then system drumkits | |
| static bool | drumkit_exists (const QString &dk_name) |
| returns true if the drumkit exists within usable system or user drumkits | |
| static QString | drumkit_file (const QString &dk_path) |
| returns the path to the xml file within a supposed drumkit path | |
| static QString | drumkit_path_search (const QString &dk_name, Lookup lookup=Lookup::stacked, bool bSilent=false) |
| Returns the path to a H2Core::Drumkit folder. | |
| static QString | drumkit_usr_path (const QString &dk_name) |
| returns path for a drumkit within user drumkit path | |
| static bool | drumkit_valid (const QString &dk_path) |
| returns true if the path contains a usable drumkit | |
| static QString | drumkit_xml () |
| Returns filename and extension of the expected drumkit file. | |
| static QString | drumkit_xsd () |
| returns the drumkit XSD (xml schema definition) name | |
| static QStringList | drumkit_xsd_legacy_paths () |
| static QString | drumkit_xsd_path () |
| returns the path to the drumkit XSD (xml schema definition) file | |
| static QString | empty_sample_path () |
| returns system empty sample file path | |
| static QString | empty_song_path () |
| Provides the full path to the current empty song. | |
| static QString | ensure_session_compatibility (const QString &sPath) |
| If Hydrogen is under session management, we support for paths relative to the session folder. | |
| static bool | file_copy (const QString &src, const QString &dst, bool overwrite=false, bool bSilent=false) |
| copy a source file to a destination | |
| static bool | file_executable (const QString &path, bool silent=false) |
| returns true if the given path is an existing executable regular file | |
| static bool | file_exists (const QString &path, bool silent=false) |
| returns true if the given path is an existing regular file | |
| static bool | file_readable (const QString &path, bool silent=false) |
| returns true if the given path is an existing readable regular file | |
| static bool | file_writable (const QString &path, bool silent=false) |
| returns true if the given path is a possibly writable file (may exist or not) | |
| static const QString & | getPreferencesOverwritePath () |
| static QString | i18n_dir () |
| returns internationalization path | |
| static QString | img_dir () |
| returns gui image path | |
| static void | info () |
| send current settings information to logger with INFO severity | |
| static bool | isSongPathValid (const QString &sSongPath, bool bCheckExistance=false) |
| Checks the path pointing to a .h2song. | |
| static QStringList | ladspa_paths () |
| returns user ladspa paths | |
| static QString | log_file_path () |
| returns the full path (including filename) of the logfile | |
| static bool | mkdir (const QString &path) |
| create a path | |
| static bool | path_usable (const QString &path, bool create=true, bool silent=false) |
| returns true if the path is a readable and writable regular directory, create if it not exists | |
| static QStringList | pattern_drumkits () |
| returns a list of existing drumkit sub dir into the patterns directory | |
| static QStringList | pattern_list () |
| returns a list of existing patterns | |
| static QStringList | pattern_list (const QString &path) |
| returns a list of existing patterns | |
| static QString | pattern_path (const QString &dk_name, const QString &p_name) |
| returns user patterns path, add file extension | |
| static QString | pattern_xsd_path () |
| returns the path to the pattern XSD (xml schema definition) file | |
| static QString | patterns_dir () |
| returns user patterns path | |
| static QString | patterns_dir (const QString &dk_name) |
| returns user patterns path for a specific drumkit | |
| static QStringList | playlist_list () |
| returns a list of existing playlists | |
| static QString | playlist_path (const QString &pl_name) |
| returns user playlist path, add file extension | |
| static QString | playlist_xsd_path () |
| returns the path to the playlist pattern XSD (xml schema definition) file | |
| static QString | playlists_dir () |
| returns user playlist path | |
| static QString | plugins_dir () |
| returns user plugins path | |
| static QString | prepare_sample_path (const QString &sFilePath) |
| Returns the basename if the given path is under an existing user or system drumkit path, otherwise the given fname. | |
| static QString | removeUtf8Characters (const QString &sEncodedString) |
| Removes all characters not within the Latin-1 range of sEncodedString. | |
| static QString | repositories_cache_dir () |
| returns user repository cache path | |
| static QString | rerouteDrumkitPath (const QString &sDrumkitPath) |
| Reroutes stored drumkit paths pointing to a temporary AppImage system data folder to the current AppImage one. | |
| static bool | rm (const QString &path, bool recursive=false, bool bSilent=false) |
| remove a path | |
| static QString | scripts_dir () |
| returns user scripts path | |
| static void | setPreferencesOverwritePath (const QString &sPath) |
| static bool | song_exists (const QString &sg_name) |
| returns true if the song file exists | |
| static QStringList | song_list () |
| returns a list of existing songs | |
| static QStringList | song_list_cleared () |
| returns a list of existing songs, excluding the autosaved one | |
| static QString | song_path (const QString &sg_name) |
| returns user song path, add file extension | |
| static QString | songs_dir () |
| returns user songs path | |
| static const std::vector< AudioFormat > & | supportedAudioFormats () |
Which format is supported is determined by the libsndfile version Hydrogen is linked against during compile time (see https://libsndfile.github.io/libsndfile/api.html#open). | |
| static QString | sys_config_path () |
| returns system config path | |
| static QString | sys_data_path () |
| returns system data path | |
| static QStringList | sys_drumkit_list () |
| returns list of usable system drumkits ( see Filesystem::drumkit_list ) | |
| static QString | sys_drumkits_dir () |
| returns system drumkits path | |
| static QString | sys_theme_dir () |
| static QStringList | theme_list () |
| static QString | tmp_dir () |
| returns temp path | |
| static QString | tmp_file_path (const QString &base) |
| touch a temporary file under tmp_dir() and return it's path. | |
| static QString | untitled_playlist_file_name () |
| returns untitled playlist file name | |
| static QString | untitled_song_name () |
| returns untitled song name | |
| static QString | usr_click_file_path () |
| returns click file path from user directory if exists, otherwise from system | |
| static QString | usr_config_path () |
| static QString | usr_data_path () |
| returns user data path | |
| static QStringList | usr_drumkit_list () |
| returns list of usable user drumkits ( see Filesystem::drumkit_list ) | |
| static QString | usr_drumkits_dir () |
| returns user drumkits path | |
| static QString | usr_theme_dir () |
| static QString | validateFilePath (const QString &sPath) |
| Takes an arbitrary path, replaces white spaces by underscores and removes all characters apart from latin characters, arabic numbers, underscores and dashes. | |
| static bool | write_to_file (const QString &dst, const QString &content) |
| writes to a file | |
| static QString | xsd_dir () |
| returns system xsd path | |
| static QString | xsd_legacy_dir () |
Static Public Member Functions inherited from Base | |
| static const char * | _class_name () |
| return the class name | |
| static QString | base_clock (const QString &sMsg) |
| Measures the current time and stores it in __last_clock. | |
| static QString | base_clock_in (const QString &sMsg) |
| static int | bootstrap (Logger *logger, bool count=false) |
| must be called before any Object instantiation ! | |
| static bool | count_active () |
| static int | getAliveObjectCount () |
| static object_map_t | getObjectMap () |
| static Logger * | logger () |
| return the logger instance | |
| static int | objects_count () |
| static void | printObjectMapDiff (object_map_t map) |
| Creates the difference between a snapshot of the object map and its current state and prints it to std::cout. | |
| static void | set_count (bool flag) |
| enable/disable class instances counting | |
| static void | write_objects_map_to (std::ostream &out, object_map_t *map=nullptr) |
| output the full objects map to a given ostream | |
| static void | write_objects_map_to_cerr () |
| output objects map to stderr | |
Static Public Attributes | |
| static const QString | drumkit_ext = ".h2drumkit" |
| static const QString | patterns_ext = ".h2pattern" |
| static const QString | patterns_filter_name = "Hydrogen Patterns (*.h2pattern)" |
| static const QString | playlist_ext = ".h2playlist" |
| static const QString | playlists_filter_name = "Hydrogen Playlists (*.h2playlist)" |
| static const QString | scripts_ext = ".sh" |
| static const QString | scripts_filter_name = "Hydrogen Scripts (*.sh)" |
| static const QString | songs_ext = ".h2song" |
| static const QString | songs_filter_name = "Hydrogen Songs (*.h2song)" |
| static const QString | themes_ext = ".h2theme" |
| static const QString | themes_filter_name = "Hydrogen Theme (*.h2theme)" |
Static Public Attributes inherited from Base | |
| static QString | sPrintIndention = " " |
| String used to format the debugging string output of some core classes. | |
Static Private Member Functions | |
| static bool | check_permissions (const QString &path, const int perms, bool silent) |
| static bool | check_sys_paths () |
| returns true if the system path is consistent | |
| static bool | check_usr_paths () |
| returns true if the user path is consistent | |
| static QStringList | drumkit_list (const QString &path) |
| static bool | rm_fr (const QString &path, bool bSilent=false) |
| recursively remove a path | |
Static Private Attributes | |
| static QStringList | __ladspa_paths |
| paths to laspa plugins | |
| static Logger * | __logger = nullptr |
| a pointer to the logger | |
| static QString | __sys_data_path |
| Path to the system files set in Filesystem::bootstrap(). | |
| static QString | __usr_cfg_path |
| the path to the user config file | |
| static QString | __usr_data_path |
| the path to the user files | |
| static QString | __usr_log_path = QDir::homePath().append( "/" H2_USR_PATH "/" LOG_FILE) |
| the path to the log file | |
| static QString | m_sPreferencesOverwritePath = "" |
| If this variable is non-empty, its content will be used as an alternative to store and load the preferences. | |
| static std::vector< AudioFormat > | m_supportedAudioFormats |
Additional Inherited Members | |
Public Member Functions inherited from Object< Filesystem > | |
| Object () | |
| Object (const Object< Filesystem > &other) | |
Public Member Functions inherited from Base | |
| Base () | |
| Base (const Base &other) | |
| virtual const char * | class_name () const |
| void | logBacktrace () const |
| Print the current stack at point into the debug log. | |
| void | Print (bool bShort=true) const |
| Prints content of toQString() via DEBUGLOG. | |
| virtual QString | toQString (const QString &sPrefix="", bool bShort=true) const |
| Formatted string version for debugging purposes. | |
Protected Member Functions inherited from Object< Filesystem > | |
| ~Object () | |
Protected Member Functions inherited from Base | |
| ~Base () | |
Static Protected Member Functions inherited from Base | |
| static void | registerClass (const char *name, const atomic_obj_cpt_t *counters) |
Static Protected Attributes inherited from Base | |
| static bool | __count = false |
| should we count class instances | |
| static timeval | __last_clock = { 0, 0 } |
| static Logger * | __logger = nullptr |
| static bool | bLogColors = true |
Filesystem is a thin layer over QDir, QFile and QFileInfo.
Definition at line 38 of file Filesystem.h.
|
strong |
All audio file formats supported by Hydrogen.
| Enumerator | |
|---|---|
| Aif | synonym for Aiff |
| Aifc | synonym for Aiff |
| Aiff | |
| Au | |
| Caf | |
| Flac | |
| Mp3 | |
| Ogg | |
| Opus | |
| Unknown | |
| Voc | |
| W64 | |
| Wav | |
Definition at line 90 of file Filesystem.h.
|
strong |
Determines were to find a kit and whether it is writable by the current user.
| Enumerator | |
|---|---|
| System | Kit was installed with Hydrogen, is automatically loaded, and most probably readonly. |
| User | Kit was installed by the user, is automatically loaded, and most probably writable. |
| SessionReadOnly | Kit was loaded via a NSM session, OSC command, or CLI option, only persist for the current Hydrogen session, and is readonly. |
| SessionReadWrite | Kit was loaded via a NSM session, OSC command, or CLI option, only persist for the current Hydrogen session, and is writable. |
Definition at line 72 of file Filesystem.h.
| enum file_perms |
flags available for check_permissions()
| Enumerator | |
|---|---|
| is_dir | |
| is_file | |
| is_readable | |
| is_writable | |
| is_executable | |
Definition at line 43 of file Filesystem.h.
|
strong |
Whenever a drumkit is loaded by name a collision between a user and a system drumkit carrying the same name can occur.
| Enumerator | |
|---|---|
| stacked | First, looks in the system drumkits and, afterwards, in the user drumkits. In case both sets contain a member sharing the requested name, the user one will override the system one. This is the way Hydrogen <= 1.1 were handling all look ups. |
| user | Only search the user drumkits. |
| system | Only search the system drumkits. |
Definition at line 55 of file Filesystem.h.
|
static |
Convert a direct to an absolute path.
Definition at line 1145 of file Filesystem.cpp.
|
static |
Determines the audio format of the provided filename or path based on its suffix.
Definition at line 174 of file Filesystem.cpp.
|
static |
Converts format to the default lower case suffix of the format.
Definition at line 141 of file Filesystem.cpp.
|
static |
check user and system filesystem usability
If any argument is not provided or empty, the corresponding default values will be used.
| logger | is a pointer to the logger instance which will be used |
| sSysDataPath | path to an alternate system data folder |
| sUsrDataPath | path to an alternate user data folder |
| sUserConfigFile | path to an alternate hydrogen.conf config file |
| sLogFile | path to alternate log file |
Definition at line 214 of file Filesystem.cpp.
|
static |
returns user cache path
Definition at line 739 of file Filesystem.cpp.
|
staticprivate |
| path | the path to the file to check |
| perms | bit mask of file_perms |
| silent | output not messages if set to true |
Definition at line 325 of file Filesystem.cpp.
|
staticprivate |
returns true if the system path is consistent
Definition at line 527 of file Filesystem.cpp.
|
staticprivate |
returns true if the user path is consistent
Definition at line 553 of file Filesystem.cpp.
|
static |
Returns a string containing the path to the click.wav file used in the metronome.
It is a concatenation of #__sys_data_path and #CLICK_SAMPLE.
Definition at line 640 of file Filesystem.cpp.
|
static |
Default option to offer the user when saving an empty song to disk.
Definition at line 609 of file Filesystem.cpp.
|
static |
returns system demos path
Definition at line 747 of file Filesystem.cpp.
|
static |
| sPath | Absolute path to the drumkit folder containing a drumkit.xml file. |
Definition at line 1175 of file Filesystem.cpp.
|
static |
returns true if the given path is a regular directory
| path | the path to the file to check |
| silent | output not messages if set to true |
Definition at line 393 of file Filesystem.cpp.
|
static |
returns true if the given path is a readable regular directory
| path | the path to the file to check |
| silent | output not messages if set to true |
Definition at line 397 of file Filesystem.cpp.
|
static |
returns true if the given path is a writable regular directory
| path | the path to the file to check |
| silent | output not messages if set to true |
Definition at line 401 of file Filesystem.cpp.
|
static |
returns documentation path
Definition at line 675 of file Filesystem.cpp.
|
static |
Create a backup path from a drumkit path.
It will contain the current datetime to both make individual backup names unique and to make it more easy to handle them.
Definition at line 1013 of file Filesystem.cpp.
|
static |
Definition at line 798 of file Filesystem.cpp.
|
static |
returns the directory holding the named drumkit searching within user then system drumkits
| dk_name | the drumkit name |
| lookup | Where to search (system/user folder or both) for the drumkit. |
Definition at line 959 of file Filesystem.cpp.
|
static |
returns true if the drumkit exists within usable system or user drumkits
| dk_name | the drumkit name |
Definition at line 880 of file Filesystem.cpp.
|
static |
returns the path to the xml file within a supposed drumkit path
| dk_path | the path to the drumkit |
Definition at line 1004 of file Filesystem.cpp.
|
staticprivate |
| path | the path to search in for drumkits |
Definition at line 785 of file Filesystem.cpp.
|
static |
Returns the path to a H2Core::Drumkit folder.
The search will first be performed within user-level drumkits system drumkits using usr_drumkit_list() and usr_drumkits_dir() and later, in case the H2Core::Drumkit could not be found, within the system-level drumkits using sys_drumkit_list() and sys_drumkits_dir().
When under session management (see NsmClient::m_bUnderSessionManagement) the function will first look for a "drumkit" symlink or folder within NsmClient::m_sSessionFolderPath. If it either is not a valid H2Core::Drumkit or the not the one corresponding to dk_name, the user- and system-level drumkits will be searched instead.
| dk_name | Name of the H2Core::Drumkit. In the user-level and system-level lookup it has to correspond to the name of the folder holding the samples and the DRUMKIT_XML file. For the usage of a local H2Core::Drumkit under session management it has to match the second-level "name" node within the DRUMKIT_XML file. |
| lookup | Where to search (system/user folder or both) for the drumkit. |
| bSilent | whether the function should trigger log messages. If set to true, the calling function is expected to handle the log messages instead. |
Definition at line 889 of file Filesystem.cpp.
|
static |
returns path for a drumkit within user drumkit path
| dk_name | the drumkit name |
Definition at line 885 of file Filesystem.cpp.
|
static |
returns true if the path contains a usable drumkit
| dk_path | the root drumkit location |
Definition at line 975 of file Filesystem.cpp.
|
static |
Returns filename and extension of the expected drumkit file.
Definition at line 1009 of file Filesystem.cpp.
|
static |
returns the drumkit XSD (xml schema definition) name
Definition at line 649 of file Filesystem.cpp.
|
static |
Definition at line 1192 of file Filesystem.cpp.
|
static |
returns the path to the drumkit XSD (xml schema definition) file
Definition at line 653 of file Filesystem.cpp.
|
static |
returns system empty sample file path
Definition at line 604 of file Filesystem.cpp.
|
static |
Provides the full path to the current empty song.
The basename consists of a fixed expression and an optional suffix ensuring the path does not point to an existing file.
Empty songs are handled in Hydrogen as follows: Upon creation, the empty song will be assigned a Song::m_sFilename identical to the return value of this function. This triggers autosave files to be generated corresponding to empty song path. If the user attempts to save the song from within the GUI, she will be prompted a "Save As" dialog and is asked to provide a new name. This way a file using the empty song path does normally not exists. But since the return value of this function is reproducible, Hydrogen is able to recover unsaved modifications applied to an empty song. If the user - by design or coincidence - picks the empty song path to save a file or if the OSC API is used to save the empty song, empty_song_path() will use a suffix to return yet again a path to a non-existing file and allow for the behavior described above.
Definition at line 613 of file Filesystem.cpp.
|
static |
If Hydrogen is under session management, we support for paths relative to the session folder.
This is required to allow for sessions being renamed or duplicated.
Definition at line 1156 of file Filesystem.cpp.
|
static |
copy a source file to a destination
| src | source file path |
| dst | destination file path |
| overwrite | allow to overwrite an existing file if set to true |
| bSilent | Whether debug and info messages should be logged. |
Definition at line 447 of file Filesystem.cpp.
|
static |
returns true if the given path is an existing executable regular file
| path | the path to the file to check |
| silent | output not messages if set to true |
Definition at line 389 of file Filesystem.cpp.
|
static |
returns true if the given path is an existing regular file
| path | the path to the file to check |
| silent | output not messages if set to true |
Definition at line 377 of file Filesystem.cpp.
|
static |
returns true if the given path is an existing readable regular file
| path | the path to the file to check |
| silent | output not messages if set to true |
Definition at line 381 of file Filesystem.cpp.
|
static |
returns true if the given path is a possibly writable file (may exist or not)
| path | the path to the file to check |
| silent | output not messages if set to true |
Definition at line 385 of file Filesystem.cpp.
|
inlinestatic |
Definition at line 590 of file Filesystem.h.
|
static |
returns internationalization path
Definition at line 679 of file Filesystem.cpp.
|
static |
returns gui image path
Definition at line 671 of file Filesystem.cpp.
|
static |
send current settings information to logger with INFO severity
Definition at line 1114 of file Filesystem.cpp.
|
static |
Checks the path pointing to a .h2song.
It will be checked whether songPath
| sSongPath | Absolute path to an .h2song file. |
| bCheckExistance | Whether the existence of the file is checked (should be true for opening and false for creating a new song) |
Definition at line 1056 of file Filesystem.cpp.
|
static |
returns user ladspa paths
Definition at line 586 of file Filesystem.cpp.
|
static |
returns the full path (including filename) of the logfile
Definition at line 665 of file Filesystem.cpp.
|
static |
create a path
| path | the path to the directory to be created |
Definition at line 406 of file Filesystem.cpp.
|
static |
returns true if the path is a readable and writable regular directory, create if it not exists
| path | the path to the file to check |
| create | will try to create path if not exists and set to true |
| silent | output not messages if set to true |
Definition at line 415 of file Filesystem.cpp.
|
static |
returns a list of existing drumkit sub dir into the patterns directory
Definition at line 1019 of file Filesystem.cpp.
|
static |
returns a list of existing patterns
Definition at line 1024 of file Filesystem.cpp.
|
static |
returns a list of existing patterns
| path | the path to look for patterns in |
Definition at line 1029 of file Filesystem.cpp.
|
static |
returns user patterns path, add file extension
Definition at line 711 of file Filesystem.cpp.
|
static |
returns the path to the pattern XSD (xml schema definition) file
Definition at line 657 of file Filesystem.cpp.
|
static |
returns user patterns path
Definition at line 703 of file Filesystem.cpp.
|
static |
returns user patterns path for a specific drumkit
Definition at line 707 of file Filesystem.cpp.
|
static |
returns a list of existing playlists
Definition at line 1109 of file Filesystem.cpp.
|
static |
returns user playlist path, add file extension
Definition at line 735 of file Filesystem.cpp.
|
static |
returns the path to the playlist pattern XSD (xml schema definition) file
Definition at line 661 of file Filesystem.cpp.
|
static |
returns user playlist path
Definition at line 731 of file Filesystem.cpp.
|
static |
returns user plugins path
Definition at line 719 of file Filesystem.cpp.
|
static |
Returns the basename if the given path is under an existing user or system drumkit path, otherwise the given fname.
Definition at line 834 of file Filesystem.cpp.
|
static |
Removes all characters not within the Latin-1 range of sEncodedString.
Definition at line 1265 of file Filesystem.cpp.
|
static |
returns user repository cache path
Definition at line 743 of file Filesystem.cpp.
|
static |
Reroutes stored drumkit paths pointing to a temporary AppImage system data folder to the current AppImage one.
Since AppImages are mounted at a random point each time they are started the absolute path of their system data folder changes every time. To nevertheless support using system drumkits consistently, we try to determine whether the stored kit is a system one and tweak its path. (Without replacing the random part of the path the lookup would fall back to a name-based one which always checks user-level kits first. Having a GMRockKit in ~/.hydrogen/data/drumkits too, would make the system's one inaccessible).
| sDrumkitPath | Absolute path that need rerouting. |
Definition at line 1211 of file Filesystem.cpp.
|
static |
remove a path
| path | the path to be removed |
| recursive | perform recursive removal if set to true |
| bSilent | Whether debug and info messages should be logged. |
Definition at line 474 of file Filesystem.cpp.
|
staticprivate |
recursively remove a path
Definition at line 499 of file Filesystem.cpp.
|
static |
returns user scripts path
Definition at line 683 of file Filesystem.cpp.
|
inlinestatic |
| sPath | Sets m_sPreferencesOverwritePath |
Definition at line 593 of file Filesystem.h.
|
static |
returns true if the song file exists
| sg_name | the song name |
Definition at line 1051 of file Filesystem.cpp.
|
static |
returns a list of existing songs
Definition at line 1035 of file Filesystem.cpp.
|
static |
returns a list of existing songs, excluding the autosaved one
Definition at line 1040 of file Filesystem.cpp.
|
static |
returns user song path, add file extension
Definition at line 699 of file Filesystem.cpp.
|
static |
returns user songs path
Definition at line 687 of file Filesystem.cpp.
|
static |
Which format is supported is determined by the libsndfile version Hydrogen is linked against during compile time (see https://libsndfile.github.io/libsndfile/api.html#open).
Definition at line 1270 of file Filesystem.cpp.
|
static |
returns system config path
Definition at line 592 of file Filesystem.cpp.
|
static |
returns system data path
Definition at line 577 of file Filesystem.cpp.
|
static |
returns list of usable system drumkits ( see Filesystem::drumkit_list )
Definition at line 825 of file Filesystem.cpp.
|
static |
returns system drumkits path
Definition at line 723 of file Filesystem.cpp.
|
static |
Definition at line 695 of file Filesystem.cpp.
|
static |
Definition at line 1102 of file Filesystem.cpp.
|
static |
returns temp path
Definition at line 759 of file Filesystem.cpp.
|
static |
touch a temporary file under tmp_dir() and return it's path.
if base has a suffix it will be preserved, spaces will be replaced by underscores.
| base | part of the path |
Definition at line 763 of file Filesystem.cpp.
|
static |
returns untitled playlist file name
Definition at line 636 of file Filesystem.cpp.
|
static |
returns untitled song name
Definition at line 632 of file Filesystem.cpp.
|
static |
returns click file path from user directory if exists, otherwise from system
Definition at line 644 of file Filesystem.cpp.
|
static |
Definition at line 596 of file Filesystem.cpp.
|
static |
returns user data path
Definition at line 581 of file Filesystem.cpp.
|
static |
returns list of usable user drumkits ( see Filesystem::drumkit_list )
Definition at line 829 of file Filesystem.cpp.
|
static |
returns user drumkits path
Definition at line 727 of file Filesystem.cpp.
|
static |
Definition at line 691 of file Filesystem.cpp.
|
static |
Takes an arbitrary path, replaces white spaces by underscores and removes all characters apart from latin characters, arabic numbers, underscores and dashes.
Definition at line 1091 of file Filesystem.cpp.
|
static |
writes to a file
| dst | the destination path |
| content | then string to write |
Definition at line 429 of file Filesystem.cpp.
|
static |
returns system xsd path
Definition at line 751 of file Filesystem.cpp.
|
static |
Definition at line 755 of file Filesystem.cpp.
|
staticprivate |
paths to laspa plugins
Definition at line 586 of file Filesystem.h.
|
staticprivate |
a pointer to the logger
Definition at line 537 of file Filesystem.h.
|
staticprivate |
Path to the system files set in Filesystem::bootstrap().
If Q_OSMACX is set, it will be a concatenation of QCoreApplication::applicationDirPath() and "/../Resources/data/" (H2CORE_HAVE_BUNDLE defined) or "/data/" (else). If, instead, WIN32 is set, it is a concatenation of QCoreApplication::applicationDirPath() and "/data/". In case the application is neither run on Mac or Windows, it is set to a concatenation of H2_SYS_PATH and "/data/".
If Filesystem::bootstrap() was called with the sys_path argument preset, it will overwrite all the choices above.
Finally, if the variable doesn't point to a readable directory afterwards, it is set to a concatenation of QCoreApplication::applicationDirPath(), "/", and LOCAL_DATA_PATH. the path to the system files
Definition at line 582 of file Filesystem.h.
|
staticprivate |
the path to the user config file
Definition at line 584 of file Filesystem.h.
|
staticprivate |
the path to the user files
Definition at line 583 of file Filesystem.h.
|
staticprivate |
the path to the log file
Definition at line 585 of file Filesystem.h.
|
static |
Definition at line 121 of file Filesystem.h.
|
staticprivate |
If this variable is non-empty, its content will be used as an alternative to store and load the preferences.
Definition at line 545 of file Filesystem.h.
|
staticprivate |
Definition at line 587 of file Filesystem.h.
|
static |
Definition at line 119 of file Filesystem.h.
|
static |
Definition at line 126 of file Filesystem.h.
|
static |
Definition at line 120 of file Filesystem.h.
|
static |
Definition at line 127 of file Filesystem.h.
|
static |
Definition at line 118 of file Filesystem.h.
|
static |
Definition at line 125 of file Filesystem.h.
|
static |
Definition at line 117 of file Filesystem.h.
|
static |
Definition at line 123 of file Filesystem.h.
|
static |
Definition at line 122 of file Filesystem.h.
|
static |
Definition at line 124 of file Filesystem.h.