Add UI config-option for freesound download cache
This also invalidates any prior libardour rc-config (which was not previously exposed as config). Note: old existing cache is not moved or invalidated when the path changes.
This commit is contained in:
parent
f925dd675e
commit
7fa207d9ee
@ -2430,6 +2430,15 @@ RCOptionEditor::RCOptionEditor ()
|
|||||||
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_only_copy_imported_files)
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_only_copy_imported_files)
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
add_option (_("General"),
|
||||||
|
new DirectoryOption (
|
||||||
|
X_("freesound-dir"),
|
||||||
|
_("Cache Folder for downloaded Freesound clips:"),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_freesound_dir),
|
||||||
|
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_freesound_dir)
|
||||||
|
));
|
||||||
|
|
||||||
add_option (_("General"), new OptionEditorHeading (_("Export")));
|
add_option (_("General"), new OptionEditorHeading (_("Export")));
|
||||||
|
|
||||||
add_option (_("General"),
|
add_option (_("General"),
|
||||||
|
@ -106,7 +106,7 @@ Mootcher:: ~Mootcher()
|
|||||||
|
|
||||||
void Mootcher::ensureWorkingDir ()
|
void Mootcher::ensureWorkingDir ()
|
||||||
{
|
{
|
||||||
std::string p = ARDOUR::Config->get_freesound_download_dir();
|
std::string const& p = UIConfiguration::instance ().get_freesound_dir ();
|
||||||
|
|
||||||
DEBUG_TRACE(PBD::DEBUG::Freesound, "ensureWorkingDir() - " + p + "\n");
|
DEBUG_TRACE(PBD::DEBUG::Freesound, "ensureWorkingDir() - " + p + "\n");
|
||||||
if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) {
|
if (!Glib::file_test (p, Glib::FILE_TEST_IS_DIR)) {
|
||||||
|
@ -94,6 +94,15 @@ UIConfiguration::UIConfiguration ()
|
|||||||
{
|
{
|
||||||
load_state();
|
load_state();
|
||||||
|
|
||||||
|
/* Setup defaults */
|
||||||
|
if (get_freesound_dir ().empty ()) {
|
||||||
|
std::string const& d (Glib::build_filename (ARDOUR::user_cache_directory (), "freesound"));
|
||||||
|
set_freesound_dir (d);
|
||||||
|
if (!Glib::file_test (d, Glib::FILE_TEST_EXISTS)) {
|
||||||
|
g_mkdir_with_parents (d.c_str (), 0755);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ColorsChanged.connect (boost::bind (&UIConfiguration::colors_changed, this));
|
ColorsChanged.connect (boost::bind (&UIConfiguration::colors_changed, this));
|
||||||
|
|
||||||
ParameterChanged.connect (sigc::mem_fun (*this, &UIConfiguration::parameter_changed));
|
ParameterChanged.connect (sigc::mem_fun (*this, &UIConfiguration::parameter_changed));
|
||||||
|
@ -139,6 +139,7 @@ UI_CONFIG_VARIABLE (bool, one_plugin_window_only, "one-plugin-window-only", fals
|
|||||||
UI_CONFIG_VARIABLE (int, default_lower_midi_note, "default-lower-midi-note", 60)
|
UI_CONFIG_VARIABLE (int, default_lower_midi_note, "default-lower-midi-note", 60)
|
||||||
UI_CONFIG_VARIABLE (int, default_upper_midi_note, "default-upper-midi-note", 71)
|
UI_CONFIG_VARIABLE (int, default_upper_midi_note, "default-upper-midi-note", 71)
|
||||||
UI_CONFIG_VARIABLE (bool, ask_before_closing_last_window, "ask-before-closing-last-window", true)
|
UI_CONFIG_VARIABLE (bool, ask_before_closing_last_window, "ask-before-closing-last-window", true)
|
||||||
|
UI_CONFIG_VARIABLE (std::string, freesound_dir, "freesound-dir", "")
|
||||||
|
|
||||||
/* these are visibility-type selections in the New Track dialog that we should make persistent for the user's choices */
|
/* these are visibility-type selections in the New Track dialog that we should make persistent for the user's choices */
|
||||||
UI_CONFIG_VARIABLE (bool, show_on_cue_page, "show-on-cue-page", true)
|
UI_CONFIG_VARIABLE (bool, show_on_cue_page, "show-on-cue-page", true)
|
||||||
|
Loading…
Reference in New Issue
Block a user