sfdb paths are saved and restored.
git-svn-id: svn://localhost/ardour2/trunk@700 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
@@ -42,6 +42,8 @@ class AudioLibrary : public Stateful
|
||||
AudioLibrary ();
|
||||
~AudioLibrary ();
|
||||
|
||||
static string state_node_name;
|
||||
|
||||
XMLNode& get_state (void);
|
||||
int set_state (const XMLNode&);
|
||||
|
||||
|
||||
@@ -46,6 +46,8 @@ using namespace PBD;
|
||||
|
||||
static char* SOUNDFILE = "http://ardour.org/ontology/Soundfile";
|
||||
|
||||
string AudioLibrary::state_node_name = "AudioLibrary";
|
||||
|
||||
AudioLibrary::AudioLibrary ()
|
||||
{
|
||||
// sfdb_paths.push_back("/Users/taybin/sounds");
|
||||
@@ -74,12 +76,6 @@ AudioLibrary::AudioLibrary ()
|
||||
}
|
||||
|
||||
lrdf_free_statements(matches);
|
||||
|
||||
XMLNode* state = instant_xml(X_("AudioLibrary"), get_user_ardour_path());
|
||||
if (state) {
|
||||
set_state(*state);
|
||||
}
|
||||
scan_paths();
|
||||
}
|
||||
|
||||
AudioLibrary::~AudioLibrary ()
|
||||
@@ -361,7 +357,7 @@ AudioLibrary::set_paths (vector<string> paths)
|
||||
{
|
||||
sfdb_paths = paths;
|
||||
|
||||
add_instant_xml(get_state(), get_user_ardour_path());
|
||||
scan_paths ();
|
||||
}
|
||||
|
||||
vector<string>
|
||||
@@ -478,7 +474,7 @@ AudioLibrary::set_state (const XMLNode& node)
|
||||
}
|
||||
}
|
||||
|
||||
sfdb_paths = paths;
|
||||
set_paths (paths);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <pbd/xml++.h>
|
||||
|
||||
#include <ardour/ardour.h>
|
||||
#include <ardour/audio_library.h>
|
||||
#include <ardour/configuration.h>
|
||||
#include <ardour/audio_diskstream.h>
|
||||
#include <ardour/destructive_filesource.h>
|
||||
@@ -178,6 +179,7 @@ Configuration::state (bool user_only)
|
||||
}
|
||||
|
||||
root->add_child_nocopy (ControlProtocolManager::instance().get_state());
|
||||
root->add_child_nocopy (Library->get_state());
|
||||
|
||||
return *root;
|
||||
}
|
||||
@@ -229,6 +231,8 @@ Configuration::set_state (const XMLNode& root)
|
||||
|
||||
} else if (node->name() == ControlProtocolManager::state_node_name) {
|
||||
_control_protocol_state = new XMLNode (*node);
|
||||
} else if (node->name() == AudioLibrary::state_node_name) {
|
||||
Library->set_state (*node);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -198,6 +198,9 @@ ARDOUR::init (AudioEngine& engine, bool use_vst, bool try_optimization)
|
||||
|
||||
PBD::ID::init ();
|
||||
|
||||
lrdf_init();
|
||||
Library = new AudioLibrary;
|
||||
|
||||
Config = new Configuration;
|
||||
|
||||
if (Config->load_state ()) {
|
||||
@@ -296,9 +299,6 @@ ARDOUR::init (AudioEngine& engine, bool use_vst, bool try_optimization)
|
||||
info << "No H/W specific optimizations in use" << endmsg;
|
||||
}
|
||||
|
||||
lrdf_init();
|
||||
Library = new AudioLibrary;
|
||||
|
||||
/* singleton - first object is "it" */
|
||||
new PluginManager (engine);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user