mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-07 23:35:03 +01:00
Use XMLNode::get_property in AudioClock class
This commit is contained in:
parent
1534a2a4d1
commit
a6d71df0d0
1 changed files with 8 additions and 7 deletions
|
|
@ -39,6 +39,7 @@
|
|||
|
||||
#include "ardour_ui.h"
|
||||
#include "audio_clock.h"
|
||||
#include "enums_convert.h"
|
||||
#include "gui_thread.h"
|
||||
#include "keyboard.h"
|
||||
#include "tooltips.h"
|
||||
|
|
@ -1191,20 +1192,20 @@ AudioClock::set_session (Session *s)
|
|||
_session->tempo_map().PropertyChanged.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::session_property_changed, this, _1), gui_context());
|
||||
_session->tempo_map().MetricPositionChanged.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::session_property_changed, this, _1), gui_context());
|
||||
|
||||
XMLProperty const * prop;
|
||||
XMLNode* node = _session->extra_xml (X_("ClockModes"));
|
||||
AudioClock::Mode amode;
|
||||
|
||||
if (node) {
|
||||
for (XMLNodeList::const_iterator i = node->children().begin(); i != node->children().end(); ++i) {
|
||||
if ((prop = (*i)->property (X_("name"))) && prop->value() == _name) {
|
||||
std::string name;
|
||||
if ((*i)->get_property (X_("name"), name) && name == _name) {
|
||||
|
||||
if ((prop = (*i)->property (X_("mode"))) != 0) {
|
||||
amode = AudioClock::Mode (string_2_enum (prop->value(), amode));
|
||||
AudioClock::Mode amode;
|
||||
if ((*i)->get_property (X_("mode"), amode)) {
|
||||
set_mode (amode, true);
|
||||
}
|
||||
if ((prop = (*i)->property (X_("on"))) != 0) {
|
||||
set_off (!string_is_affirmative (prop->value()));
|
||||
bool on;
|
||||
if ((*i)->get_property (X_("on"), on)) {
|
||||
set_off (!on);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue