8#include "utils/types.h"
10#include "juce_wrapper.h"
161 using UserDirProvider = std::function<fs::path ()>;
162 using DefaultUserDirProvider = std::function<fs::path ()>;
163 using ApplicationDirPathProvider = std::function<fs::path ()>;
167 UserDirProvider user_dir_provider,
168 DefaultUserDirProvider default_user_dir_provider,
169 ApplicationDirPathProvider application_dir_path_provider)
170 : user_dir_provider_ (std::move (user_dir_provider)),
171 default_user_dir_provider_ (std::move (default_user_dir_provider)),
172 application_dir_path_provider_ (std::move (application_dir_path_provider))
175 ~DirectoryManager ()
override =
default;
182 UserDirProvider user_dir_provider_;
183 DefaultUserDirProvider default_user_dir_provider_;
184 ApplicationDirPathProvider application_dir_path_provider_;
189 TestingDirectoryManager () =
default;
190 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_BUNDLED_VST3_PLUGINSDIR
libdir/vst3 (bundled VST3 plugins)
@ 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.