8#include "utils/types.h"
10#include "juce_wrapper.h"
158 using UserDirProvider = std::function<fs::path ()>;
159 using DefaultUserDirProvider = std::function<fs::path ()>;
160 using ApplicationDirPathProvider = std::function<fs::path ()>;
164 UserDirProvider user_dir_provider,
165 DefaultUserDirProvider default_user_dir_provider,
166 ApplicationDirPathProvider application_dir_path_provider)
167 : user_dir_provider_ (std::move (user_dir_provider)),
168 default_user_dir_provider_ (std::move (default_user_dir_provider)),
169 application_dir_path_provider_ (std::move (application_dir_path_provider))
172 ~DirectoryManager ()
override =
default;
179 UserDirProvider user_dir_provider_;
180 DefaultUserDirProvider default_user_dir_provider_;
181 ApplicationDirPathProvider application_dir_path_provider_;
186 TestingDirectoryManager () =
default;
187 Q_DISABLE_COPY_MOVE (TestingDirectoryManager)
fs::path get_user_dir(bool force_default) override
Gets the zrythm directory, either from the settings if non-empty, or the default ($XDG_DATA_DIR/zryth...
fs::path get_prefix() const override
Returns the prefix or in the case of Windows the root dir (C/program files/zrythm) or in the case of ...
fs::path get_default_user_dir() override
Returns the default user "zrythm" dir.
virtual fs::path get_user_dir(bool force_default)=0
Gets the zrythm directory, either from the settings if non-empty, or the default ($XDG_DATA_DIR/zryth...
virtual fs::path get_default_user_dir()=0
Returns the default user "zrythm" dir.
virtual fs::path get_prefix() const =0
Returns the prefix or in the case of Windows the root dir (C/program files/zrythm) or in the case of ...
virtual fs::path get_dir(DirectoryType type)
Returns a Zrythm directory specified by type.
DirectoryType
Type of directory.
@ SYSTEM_THEMES_ICONS_DIR
Icon themes.
@ SYSTEM_LOCALEDIR
Localization under "share".
@ SYSTEM_ZRYTHM_DATADIR
share/zrythm
@ SYSTEM_PARENT_DATADIR
"share" under SYSTEM_PREFIX.
@ SYSTEM_BINDIR
"bin" under SYSTEM_PREFIX.
@ SYSTEM_ZRYTHM_LIBDIR
libdir/zrythm
@ SYSTEM_TEMPLATES
Project templates.
@ SYSTEM_THEMES_CSS_DIR
CSS themes.
@ SYSTEM_SCRIPTSDIR
Scripts.
@ SYSTEM_SAMPLESDIR
Samples.
@ USER_TOP
Main zrythm directory from gsettings.
@ SYSTEM_PARENT_LIBDIR
libdir name under SYSTEM_PREFIX.
@ USER_THEMES_ICONS
User icon themes.
@ SYSTEM_BUNDLED_PLUGINSDIR
libdir/zrythm/lv2
@ USER_THEMES_CSS
User CSS themes.
@ SYSTEM_SPECIAL_LV2_PLUGINS_DIR
Special external Zrythm plugins path (not part of the Zrythm source code).
@ USER_GDB
Gdb backtrace files.
@ SYSTEM_PREFIX
The prefix, or in the case of windows installer the root dir (C/program files/zrythm),...
@ USER_PROJECTS
Subdirs of USER_TOP.
@ USER_SCRIPTS
User scripts.
@ USER_PROFILING
Profiling files.
@ USER_BACKTRACE
Backtraces.
@ SYSTEM_THEMESDIR
Themes.
fs::path get_user_dir(bool force_default) override
Gets the zrythm directory, either from the settings if non-empty, or the default ($XDG_DATA_DIR/zryth...
fs::path testing_dir_
Zrythm directory used during unit tests.
fs::path get_default_user_dir() override
Returns the default user "zrythm" dir.
fs::path get_prefix() const override
Returns the prefix or in the case of Windows the root dir (C/program files/zrythm) or in the case of ...
void remove_testing_dir()
Clears testing_dir and removes the testing dir from the disk.
const fs::path & get_testing_dir()
Returns the current testing dir.