fix audio clock restore, provide XMLNode::property (string) and speed up the property methods by not scanning the map twice. sorry about the recompile

git-svn-id: svn://localhost/ardour2/trunk@1286 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2007-01-08 20:51:26 +00:00
parent 57bafcd1f4
commit ca49f7cba7
6 changed files with 31 additions and 9 deletions

View file

@ -248,9 +248,10 @@ ARDOUR_UI::set_engine (AudioEngine& e)
throw failed_constructor();
}
/* listen to clock mode changes */
/* set default clock modes */
AudioClock::ModeChanged.connect (mem_fun (*this, &ARDOUR_UI::store_clock_modes));
primary_clock.set_mode (AudioClock::SMPTE);
secondary_clock.set_mode (AudioClock::BBT);
/* start the time-of-day-clock */

View file

@ -325,9 +325,6 @@ ARDOUR_UI::setup_transport ()
ARDOUR_UI::Clock.connect (bind (mem_fun (primary_clock, &AudioClock::set), false));
ARDOUR_UI::Clock.connect (bind (mem_fun (secondary_clock, &AudioClock::set), false));
primary_clock.set_mode (AudioClock::SMPTE);
secondary_clock.set_mode (AudioClock::BBT);
primary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::primary_clock_value_changed));
secondary_clock.ValueChanged.connect (mem_fun(*this, &ARDOUR_UI::secondary_clock_value_changed));

View file

@ -125,6 +125,13 @@ ARDOUR_UI::connect_to_session (Session *s)
connect_dependents_to_session (s);
/* listen to clock mode changes. don't do this earlier because otherwise as the clocks
restore their modes or are explicitly set, we will cause the "new" mode to be saved
back to the session XML ("extra") state.
*/
AudioClock::ModeChanged.connect (mem_fun (*this, &ARDOUR_UI::store_clock_modes));
start_clocking ();
start_blinking ();

View file

@ -599,7 +599,7 @@ AudioClock::set_session (Session *s)
AudioClock::Mode amode;
if (node) {
if ((prop = node->property (_name.c_str())) != 0) {
if ((prop = node->property (_name)) != 0) {
amode = AudioClock::Mode (string_2_enum (prop->value(), amode));
set_mode (amode);
}

View file

@ -95,8 +95,11 @@ public:
const XMLPropertyList & properties() const { return _proplist; };
XMLProperty *property(const char * );
XMLProperty *property(const std::string&);
const XMLProperty *property(const char * n) const
{ return ((XMLNode *) this)->property(n); };
const XMLProperty *property(const std::string& ns) const
{ return ((XMLNode *) this)->property(ns); };
XMLProperty *add_property(const char *, const string &);
XMLProperty *add_property(const char *, const char * = "");

View file

@ -289,11 +289,25 @@ XMLProperty *
XMLNode::property(const char * n)
{
string ns(n);
if (_propmap.find(ns) == _propmap.end()) {
return 0;
map<string,XMLProperty*>::iterator iter;
if ((iter = _propmap.find(ns)) != _propmap.end()) {
return iter->second;
}
return 0;
}
XMLProperty *
XMLNode::property(const string & ns)
{
map<string,XMLProperty*>::iterator iter;
if ((iter = _propmap.find(ns)) != _propmap.end()) {
return iter->second;
}
return _propmap[ns];
return 0;
}
XMLProperty *