void
ARDOUR_UI::set_transport_controllable_state (const XMLNode& node)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property ("roll")) != 0) {
roll_controllable->set_id (prop->value());
const XMLNode* mnode = main_window_settings ();
if (mnode) {
- const XMLProperty* prop;
+ XMLProperty const * prop;
gint x = -1;
gint y = -1;
gint w = -1;
_session->config.ParameterChanged.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::session_configuration_changed, this, _1), gui_context());
_session->tempo_map().PropertyChanged.connect (_session_connections, invalidator (*this), boost::bind (&AudioClock::session_property_changed, this, _1), gui_context());
- const XMLProperty* prop;
+ XMLProperty const * prop;
XMLNode* node = _session->extra_xml (X_("ClockModes"));
AudioClock::Mode amode;
const XMLNode* gui_node = ac->extra_xml ("GUI");
if (gui_node) {
- const XMLProperty* prop = gui_node->property ("shown");
+ XMLProperty const * prop = gui_node->property ("shown");
if (prop) {
if (string_is_affirmative (prop->value())) {
visible.insert (i->first);
int
Editor::set_state (const XMLNode& node, int version)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
set_id (node);
Tabbable::set_state (node, version);
*/
int pos;
- XMLProperty* prop;
+ XMLProperty const * prop;
char buf[32];
XMLNode* node = ARDOUR_UI::instance()->editor_settings();
void
Editor::restore_ruler_visibility ()
{
- XMLProperty* prop;
+ XMLProperty const * prop;
XMLNode * node = _session->extra_xml (X_("RulerVisibility"));
no_ruler_shown_update = true;
{
XMLNodeList clist, cclist;
XMLNodeConstIterator citer, cciter;
- XMLNode* child;
- XMLNode* grandchild;
- XMLProperty* prop = NULL;
+ XMLNode const * child;
+ XMLNode const * grandchild;
+ XMLProperty const * prop = NULL;
fprintf (stderr, "EngineControl::set_state\n");
node = _session->extra_xml (X_("Videoexport"));
if (node) {
- const XMLProperty* prop;
+ XMLProperty const * prop;
prop = node->property (X_("ChangeGeometry"));
if (prop) { scale_checkbox.set_active(atoi(prop->value())?true:false); }
prop = node->property (X_("KeepAspect"));
return string ();
}
- const XMLProperty* p (i->second->property (prop_name));
+ XMLProperty const * p (i->second->property (prop_name));
if (!p) {
if (empty) {
*empty = true;
if ((*i)->name() != X_("Object")) {
continue;
}
- const XMLProperty* prop = (*i)->property (X_("id"));
+ XMLProperty const * prop = (*i)->property (X_("id"));
if (!prop) {
continue;
}
int
ArdourKeyboard::set_state (const XMLNode& node, int version)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property ("constraint-modifier")) != 0) {
sscanf (prop->value().c_str(), "%d", &constraint_mod);
return AudioClock::Frames;
}
- XMLProperty* p = node->property (X_("clock-mode"));
+ XMLProperty const * p = node->property (X_("clock-mode"));
if (!p) {
return ARDOUR_UI::instance()->secondary_clock->mode();
}
int
Meterbridge::set_state (const XMLNode& node)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
XMLNode* geometry;
m_width = default_width;
if ((geometry = find_named_node (node, "geometry")) != 0) {
- XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = geometry->property("x_size")) == 0) {
prop = geometry->property ("x-size");
int
Mixer_UI::set_state (const XMLNode& node, int version)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
Tabbable::set_state (node, version);
Mixer_UI::pane_allocation_handler (Allocation&, Gtk::Paned* which)
{
int pos;
- XMLProperty* prop = 0;
+ XMLProperty const * prop = 0;
XMLNode* node = ARDOUR_UI::instance()->mixer_settings();
XMLNode* geometry;
int height;
if (_plugin_display) {
XMLNode* n = GUIObjectState::get_node (node, X_("InlineDisplay"));
- XMLProperty* p = n ? n->property (X_("visible")) : NULL;
+ XMLProperty const * p = n ? n->property (X_("visible")) : NULL;
if (p) {
if (string_is_affirmative (p->value ())) {
_plugin_display->show();
{
XMLNode* n = GUIObjectState::get_node (node, state_id ());
if (n) {
- XMLProperty* p = n->property (X_("visible"));
+ XMLProperty const * p = n->property (X_("visible"));
set_visible (p && string_is_affirmative (p->value ()));
} else {
set_visible (false);
XMLNodeList children = node.children ();
XMLNodeList::const_iterator i = children.begin ();
while (i != children.end()) {
- XMLProperty* prop = (*i)->property (X_("name"));
+ XMLProperty const * prop = (*i)->property (X_("name"));
if ((*i)->name() == X_("Window") && prop && prop->value() == _name) {
break;
}
}
if (i != children.end()) {
- XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = (*i)->property (X_("custom-ui"))) != 0) {
want_custom = PBD::string_is_affirmative (prop->value ());
}
continue;
}
- XMLProperty* prop = child_node->property ("id");
+ XMLProperty const * prop = child_node->property ("id");
if (prop) {
PBD::ID id (prop->value());
}
XMLNode* node = underlay_xml_node->add_child("Underlay");
- XMLProperty* prop = node->add_property("id");
+ XMLProperty const * prop = node->add_property("id");
prop->set_value(v->trackview().route()->id().to_s());
}
#endif
for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
if ((*i)->name() == X_("RouteView")) {
- XMLProperty* prop_id = (*i)->property (X_("id"));
+ XMLProperty const * prop_id = (*i)->property (X_("id"));
assert (prop_id);
PBD::ID id (prop_id->value ());
RouteTimeAxisView* rtv = editor->get_route_view_by_route_id (id);
}
} else if ((*i)->name() == X_("Region")) {
- XMLProperty* prop_id = (*i)->property (X_("id"));
+ XMLProperty const * prop_id = (*i)->property (X_("id"));
assert (prop_id);
PBD::ID id (prop_id->value ());
}
} else if ((*i)->name() == X_("MIDINote")) {
- XMLProperty* prop_region_id = (*i)->property (X_("region-id"));
+ XMLProperty const * prop_region_id = (*i)->property (X_("region-id"));
assert (prop_region_id);
XMLNodeList children = (*i)->children ();
for (XMLNodeList::const_iterator ci = children.begin(); ci != children.end(); ++ci) {
- XMLProperty* prop_channel = (*ci)->property (X_("channel"));
- XMLProperty* prop_time = (*ci)->property (X_("time"));
- XMLProperty* prop_note = (*ci)->property (X_("note"));
- XMLProperty* prop_length = (*ci)->property (X_("length"));
- XMLProperty* prop_velocity = (*ci)->property (X_("velocity"));
- XMLProperty* prop_off_velocity = (*ci)->property (X_("off-velocity"));
+ XMLProperty const * prop_channel = (*ci)->property (X_("channel"));
+ XMLProperty const * prop_time = (*ci)->property (X_("time"));
+ XMLProperty const * prop_note = (*ci)->property (X_("note"));
+ XMLProperty const * prop_length = (*ci)->property (X_("length"));
+ XMLProperty const * prop_velocity = (*ci)->property (X_("velocity"));
+ XMLProperty const * prop_off_velocity = (*ci)->property (X_("off-velocity"));
assert (prop_channel);
assert (prop_time);
}
} else if ((*i)->name() == X_("ControlPoint")) {
- XMLProperty* prop_type = (*i)->property (X_("type"));
+ XMLProperty const * prop_type = (*i)->property (X_("type"));
assert(prop_type);
if (prop_type->value () == "track") {
- XMLProperty* prop_route_id = (*i)->property (X_("route-id"));
- XMLProperty* prop_alist_id = (*i)->property (X_("automation-list-id"));
- XMLProperty* prop_parameter = (*i)->property (X_("parameter"));
- XMLProperty* prop_view_index = (*i)->property (X_("view-index"));
+ XMLProperty const * prop_route_id = (*i)->property (X_("route-id"));
+ XMLProperty const * prop_alist_id = (*i)->property (X_("automation-list-id"));
+ XMLProperty const * prop_parameter = (*i)->property (X_("parameter"));
+ XMLProperty const * prop_view_index = (*i)->property (X_("view-index"));
assert (prop_route_id);
assert (prop_alist_id);
add (cps);
}
} else if (prop_type->value () == "region") {
- XMLProperty* prop_region_id = (*i)->property (X_("region-id"));
- XMLProperty* prop_view_index = (*i)->property (X_("view-index"));
+ XMLProperty const * prop_region_id = (*i)->property (X_("region-id"));
+ XMLProperty const * prop_view_index = (*i)->property (X_("view-index"));
if (!prop_region_id || !prop_view_index) {
continue;
}
} else if ((*i)->name() == X_("AudioRange")) {
- XMLProperty* prop_start = (*i)->property (X_("start"));
- XMLProperty* prop_end = (*i)->property (X_("end"));
+ XMLProperty const * prop_start = (*i)->property (X_("start"));
+ XMLProperty const * prop_end = (*i)->property (X_("end"));
assert (prop_start);
assert (prop_end);
} else if ((*i)->name() == X_("AutomationView")) {
- XMLProperty* prop_id = (*i)->property (X_("id"));
- XMLProperty* prop_parameter = (*i)->property (X_("parameter"));
+ XMLProperty const * prop_id = (*i)->property (X_("id"));
+ XMLProperty const * prop_parameter = (*i)->property (X_("parameter"));
assert (prop_id);
assert (prop_parameter);
} else if ((*i)->name() == X_("Marker")) {
- XMLProperty* prop_id = (*i)->property (X_("id"));
- XMLProperty* prop_start = (*i)->property (X_("start"));
+ XMLProperty const * prop_id = (*i)->property (X_("id"));
+ XMLProperty const * prop_start = (*i)->property (X_("start"));
assert (prop_id);
assert (prop_start);
int
SelectionMemento::set_state (const XMLNode& node, int /*version*/) {
- const XMLProperty* prop;
+ XMLProperty const * prop;
PublicEditor& editor = PublicEditor::instance();
if (node.name() != X_("SelectionMemento")) {
return -1;
color_aliases.clear ();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
- if ((*niter)->name() != X_("ColorAlias")) {
+ XMLNode const * child = *niter;
+ if (child->name() != X_("ColorAlias")) {
continue;
}
- name = (*niter)->property (X_("name"));
- alias = (*niter)->property (X_("alias"));
+ name = child->property (X_("name"));
+ alias = child->property (X_("alias"));
if (name && alias) {
color_aliases.insert (make_pair (name->value(), alias->value()));
colors.clear ();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
- if ((*niter)->name() != X_("Color")) {
+ XMLNode const * child = *niter;
+ if (child->name() != X_("Color")) {
continue;
}
- name = (*niter)->property (X_("name"));
- color = (*niter)->property (X_("value"));
+ name = child->property (X_("name"));
+ color = child->property (X_("value"));
if (name && color) {
ArdourCanvas::Color c;
modifiers.clear ();
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
- if ((*niter)->name() != X_("Modifier")) {
+ XMLNode const * child = *niter;
+ if (child->name() != X_("Modifier")) {
continue;
}
- name = (*niter)->property (X_("name"));
- mod = (*niter)->property (X_("modifier"));
+ name = child->property (X_("name"));
+ mod = child->property (X_("modifier"));
if (name && mod) {
SVAModifier svam (mod->value());
set_id(*node);
- const XMLProperty* proph = node->property (X_("Height"));
+ XMLProperty const * proph = node->property (X_("Height"));
if (proph) {
editor->set_video_timeline_height(atoi(proph->value()));
}
#if 0 /* TODO THINK: set FPS first time only ?! */
- const XMLProperty* propasfps = node->property (X_("AutoFPS"));
+ XMLProperty const * propasfps = node->property (X_("AutoFPS"));
if (propasfps) {
auto_set_session_fps = atoi(propasfps->value())?true:false;
}
#endif
- const XMLProperty* propoffset = node->property (X_("VideoOffset"));
+ XMLProperty const * propoffset = node->property (X_("VideoOffset"));
if (propoffset) {
video_offset = atoll(propoffset->value());
video_offset_p = video_offset;
}
- const XMLProperty* proplock = node->property (X_("VideoOffsetLock"));
+ XMLProperty const * proplock = node->property (X_("VideoOffsetLock"));
if (proplock) {
video_offset_lock = atoi(proplock->value())?true:false;
}
- const XMLProperty* localfile = node->property (X_("LocalFile"));
+ XMLProperty const * localfile = node->property (X_("LocalFile"));
if (localfile) {
local_file = atoi(localfile->value())?true:false;
}
- const XMLProperty* propf = node->property (X_("Filename"));
+ XMLProperty const * propf = node->property (X_("Filename"));
video_file_info(propf->value(), local_file);
if ((node = _session->extra_xml (X_("Videomonitor")))) {
- const XMLProperty* prop = node->property (X_("active"));
+ XMLProperty const * prop = node->property (X_("active"));
if (prop && prop->value() == "yes" && found_xjadeo() && !video_filename.empty() && local_file) {
open_video_monitor();
}
VideoTimeLine::set_state (const XMLNode& node, int /*version*/)
{
LocaleGuard lg (X_("C"));
- const XMLProperty* propoffset = node.property (X_("VideoOffset"));
+ XMLProperty const * propoffset = node.property (X_("VideoOffset"));
if (propoffset) {
video_offset = atoll(propoffset->value());
}
/* load mask from Session */
XMLNode* node = _session->extra_xml (X_("XJRestoreSettings"));
if (node) {
- const XMLProperty* prop = node->property (X_("mask"));
+ XMLProperty const * prop = node->property (X_("mask"));
if (prop) {
xj_settings_mask = atoi(prop->value());
}
if (_session) {
XMLNode* node = _session->extra_xml (X_("Videomonitor"));
if (node) {
- const XMLProperty* prop = node->property (X_("active"));
+ XMLProperty const * prop = node->property (X_("active"));
if (prop && prop->value() != "yes") _session->set_dirty ();
} else {
_session->set_dirty ();
int
AudioDiskstream::set_state (const XMLNode& node, int version)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
uint32_t nchans = 1;
int
AudioDiskstream::use_pending_capture_data (XMLNode& node)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
boost::shared_ptr<AudioFileSource> fs;
: Playlist (session, node, DataType::AUDIO, hidden)
{
#ifndef NDEBUG
- const XMLProperty* prop = node.property("type");
+ XMLProperty const * prop = node.property("type");
assert(!prop || DataType(prop->value()) == DataType::AUDIO);
#endif
for (XMLNodeConstIterator i = children.begin(); i != children.end(); ++i) {
if ((*i)->name() == X_("Crossfade")) {
- XMLProperty* p = (*i)->property (X_("active"));
+ XMLProperty const * p = (*i)->property (X_("active"));
assert (p);
if (!string_is_affirmative (p->value())) {
XMLNodeList const & pl_children = playlists->children();
for (XMLNodeList::const_iterator it = pl_children.begin(); it != pl_children.end(); ++it) {
- const XMLProperty* type = (*it)->property("type");
+ XMLProperty const * type = (*it)->property("type");
if ( !type || type->value() == "audio" ) {
try {
elements.push_back (ElementPtr ( new AudioPlaylistImporter (source, session, *this, **it)));
}
void
-AudioPlaylistImportHandler::update_region_id (XMLProperty* id_prop)
+AudioPlaylistImportHandler::update_region_id (XMLProperty * id_prop)
{
PBD::ID old_id (id_prop->value());
PBD::ID new_id (region_handler.get_new_id (old_id));
name = rename_pair.second;
}
- XMLProperty* p = xml_playlist.property ("name");
+ XMLProperty * p = xml_playlist.property ("name");
if (!p) {
error << _("badly-formed XML in imported playlist") << endmsg;
return false;
// Update region ids in crossfades
XMLNodeList crossfades = xml_playlist.children("Crossfade");
for (XMLNodeIterator it = crossfades.begin(); it != crossfades.end(); ++it) {
- XMLProperty* in = (*it)->property("in");
- XMLProperty* out = (*it)->property("out");
+ XMLProperty * in = (*it)->property("in");
+ XMLProperty * out = (*it)->property("out");
if (!in || !out) {
error << string_compose (X_("AudioPlaylistImporter (%1): did not find the \"in\" or \"out\" property from a crossfade"), name) << endmsg;
continue; // or fatal?
handler.update_region_id (out);
// rate convert length and position
- XMLProperty* length = (*it)->property("length");
+ XMLProperty * length = (*it)->property("length");
if (length) {
length->set_value (rate_convert_samples (length->value()));
}
- XMLProperty* position = (*it)->property("position");
+ XMLProperty * position = (*it)->property("position");
if (position) {
position->set_value (rate_convert_samples (position->value()));
}
}
}
- const XMLProperty* prop;
+ XMLProperty const * prop;
pair<framepos_t,framepos_t> extent = _playlist->get_extent();
AudioSource::_length = extent.second - extent.first;
char buf[128];
std::string source_dir(get_sound_dir (source));
XMLNode * source_node;
- XMLProperty *prop;
+ XMLProperty const * prop;
// Get XML for sources
if (!(source_node = source.root()->child (X_("Sources")))) {
return 0;
}
- const XMLProperty* prop;
+ XMLProperty const * prop;
XMLNode& node (*diskstream->deprecated_io_node);
/* don't do this more than once. */
int
AudioTrack::set_state (const XMLNode& node, int version)
{
- const XMLProperty *prop;
+ XMLProperty const * prop;
if ((prop = node.property (X_("mode"))) != 0) {
_mode = TrackMode (string_2_enum (prop->value(), _mode));
AudioTrack::set_state_part_two ()
{
XMLNode* fnode;
- XMLProperty* prop;
+ XMLProperty const * prop;
LocaleGuard lg (X_("C"));
/* This is called after all session state has been restored but before
XMLNodeList const & route_list = routes->children();
for (XMLNodeList::const_iterator it = route_list.begin(); it != route_list.end(); ++it) {
- const XMLProperty* type = (*it)->property("default-type");
+ XMLProperty const * type = (*it)->property("default-type");
if ( (!type || type->value() == "audio") && ((*it)->property ("diskstream") != 0 || (*it)->property ("diskstream-id") != 0)) {
try {
elements.push_back (ElementPtr ( new AudioTrackImporter (source, session, *this, **it, pl_handler)));
return false;
}
- XMLProperty* p = c->property ("name");
+ XMLProperty * p = c->property ("name");
if (!p) {
error << _("badly-formed XML in imported track") << endmsg;
return false;
}
boost::shared_ptr<XMLNode> ds_node = ds_node_list->front();
- XMLProperty* p = ds_node->property (X_("id"));
+ XMLProperty * p = ds_node->property (X_("id"));
assert (p);
p->set_value (new_ds_id.to_s());
}
//initial version has incorrectly stored i/o info, and/or garbage chars.
- const XMLProperty* version = root->property(X_("version"));
+ XMLProperty const * version = root->property(X_("version"));
if (! ((version != NULL) && (version->value() == X_(AU_CACHE_VERSION)))) {
error << "au_cache is not correct version. AU plugins will be re-scanned" << endmsg;
return -1;
const XMLNode* gchild;
const XMLNodeList gchildren = child->children();
- const XMLProperty* prop = child->property (X_("id"));
+ XMLProperty const * prop = child->property (X_("id"));
if (!prop) {
continue;
int in;
int out;
- const XMLProperty* iprop;
- const XMLProperty* oprop;
+ XMLProperty const * iprop;
+ XMLProperty const * oprop;
if (((iprop = gchild->property (X_("in"))) != 0) &&
((oprop = gchild->property (X_("out"))) != 0)) {
AudioRegion::_set_state (const XMLNode& node, int version, PropertyChange& what_changed, bool send)
{
const XMLNodeList& nlist = node.children();
- const XMLProperty *prop;
+ XMLProperty const * prop;
LocaleGuard lg (X_("C"));
boost::shared_ptr<Playlist> the_playlist (_playlist.lock());
for (XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
XMLNode *child;
- XMLProperty *prop;
+ XMLProperty const * prop;
child = (*niter);
int
AudioSource::set_state (const XMLNode& node, int /*version*/)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property ("captured-for")) != 0) {
_captured_for = prop->value();
int
Automatable::old_set_automation_state (const XMLNode& node)
{
- const XMLProperty *prop;
+ XMLProperty const * prop;
if ((prop = node.property ("path")) != 0) {
load_automation (prop->value());
if ((*niter)->name() == "AutomationList") {
- const XMLProperty* id_prop = (*niter)->property("automation-id");
+ XMLProperty const * id_prop = (*niter)->property("automation-id");
Evoral::Parameter param = (id_prop
? EventTypeMap::instance().from_symbol(id_prop->value())
XMLNodeList nlist = node.children();
XMLNode* nsos;
XMLNodeIterator niter;
- const XMLProperty* prop;
+ XMLProperty const * prop;
if (node.name() == X_("events")) {
/* partial state setting*/
const XMLNodeList& elist = node.children();
XMLNodeConstIterator i;
- XMLProperty* prop;
+ XMLProperty const * prop;
pframes_t x;
double y;
cpi.descriptor = get_descriptor (cpi.path);
- DEBUG_TRACE (DEBUG::ControlProtocols, string_compose ("instantiating %1\n", cpi.name));
+ DEBUG_TRACE (DEBUG::ControlProtocols, string_compose ("instantiating %1\n", cpi.name));
if (cpi.descriptor == 0) {
error << string_compose (_("control protocol name \"%1\" has no descriptor"), cpi.name) << endmsg;
{
XMLNodeList clist;
XMLNodeConstIterator citer;
- XMLProperty* prop;
+ XMLProperty const * prop;
Glib::Threads::Mutex::Lock lm (protocols_lock);
clist = node.children();
for (citer = clist.begin(); citer != clist.end(); ++citer) {
- if ((*citer)->name() == X_("Protocol")) {
+ XMLNode const * child = *citer;
- if ((prop = (*citer)->property (X_("active"))) == 0) {
+ if (child->name() == X_("Protocol")) {
+
+ if ((prop = child->property (X_("active"))) == 0) {
continue;
}
bool active = string_is_affirmative (prop->value());
- if ((prop = (*citer)->property (X_("name"))) == 0) {
+ if ((prop = child->property (X_("name"))) == 0) {
continue;
}
int
Delivery::set_state (const XMLNode& node, int version)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if (IOProcessor::set_state (node, version)) {
return -1;
int
Diskstream::set_state (const XMLNode& node, int /*version*/)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property ("name")) != 0) {
_name = prop->value();
_broken (false)
{
// Get samplerate
- XMLProperty *prop;
+ XMLProperty const * prop;
prop = source.root()->property ("sample-rate");
if (prop) {
std::istringstream iss (prop->value());
XMLNode* state_node = *state_node_iter;
StatePtr engine_state (new State);
- XMLProperty* prop = NULL;
+ XMLProperty const * prop = NULL;
if ((prop = state_node->property ("backend-name")) == 0) {
continue;
for (; input_state_node_iter != input_state_nodes.end (); ++input_state_node_iter) {
XMLNode* input_state_node = *input_state_node_iter;
- XMLProperty* prop = NULL;
+ XMLProperty const * prop = NULL;
if (input_state_node->name () != "input") {
continue;
for (; output_state_node_iter != output_state_nodes.end (); ++output_state_node_iter) {
XMLNode* output_state_node = *output_state_node_iter;
- XMLProperty* prop = NULL;
+ XMLProperty const * prop = NULL;
if (output_state_node->name () != "output") {
continue;
void
PortExportChannel::set_state (XMLNode * node, Session & session)
{
- XMLProperty * prop;
+ XMLProperty const * prop;
XMLNodeList xml_ports = node->children ("Port");
for (XMLNodeList::iterator it = xml_ports.begin(); it != xml_ports.end(); ++it) {
if ((prop = (*it)->property ("name"))) {
ExportFilename::set_state (const XMLNode & node)
{
XMLNode * child;
- XMLProperty * prop;
+ XMLProperty const * prop;
FieldPair pair;
child = node.child ("Folder");
XMLNodeList children = node.children();
for (XMLNodeList::iterator it = children.begin(); it != children.end(); ++it) {
- XMLProperty * prop = (*it)->property ("name");
+ XMLProperty const * prop = (*it)->property ("name");
if (prop && !prop->value().compare (name)) {
prop = (*it)->property ("enabled");
XMLNodeList list (node->children ("Option"));
for (XMLNodeList::iterator it = list.begin(); it != list.end(); ++it) {
- XMLProperty * prop = (*it)->property ("name");
+ XMLProperty const * prop = (*it)->property ("name");
if (prop && !name.compare (prop->value())) {
prop = (*it)->property ("value");
if (prop) {
{
XMLNode * root;
if ((root = global.root())) {
- XMLProperty * prop;
+ XMLProperty const * prop;
if ((prop = root->property ("id"))) {
set_id (prop->value());
}
if ((instant_xml = session.instant_xml ("ExportPresets"))) {
XMLNodeList children = instant_xml->children ("ExportPreset");
for (XMLNodeList::iterator it = children.begin(); it != children.end(); ++it) {
- XMLProperty * prop;
+ XMLProperty const * prop;
if ((prop = (*it)->property ("id")) && _id == PBD::UUID(prop->value())) {
return *it;
}
ExportProfileManager::FormatStatePtr
ExportProfileManager::deserialize_format (XMLNode & root)
{
- XMLProperty * prop;
+ XMLProperty const * prop;
PBD::UUID id;
if ((prop = root.property ("id"))) {
int
FileSource::set_state (const XMLNode& node, int /*version*/)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property (X_("channel"))) != 0) {
_channel = atoi (prop->value());
int
InternalSend::set_state (const XMLNode& node, int version)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
init_gain ();
*/
assert (version >= 3000);
- const XMLProperty* prop;
+ XMLProperty const * prop;
XMLNodeConstIterator iter;
LocaleGuard lg (X_("C"));
int
IO::set_state_2X (const XMLNode& node, int version, bool in)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
XMLNodeConstIterator iter;
LocaleGuard lg (X_("C"));
return make_connections_2X (node, version, in);
}
- const XMLProperty* prop;
+ XMLProperty const * prop;
for (XMLNodeConstIterator i = node.children().begin(); i != node.children().end(); ++i) {
the name of the thing we're applying it to.
*/
- XMLProperty* prop;
+ XMLProperty * prop;
XMLNodeList children = node.children();
for (XMLNodeIterator i = children.begin(); i != children.end(); ++i) {
int
IO::make_connections_2X (const XMLNode& node, int /*version*/, bool in)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
/* XXX: bundles ("connections" as was) */
string
IO::name_from_state (const XMLNode& node)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property ("name")) != 0) {
return prop->value();
return set_state_2X (node, version);
}
- const XMLProperty *prop;
+ XMLProperty const * prop;
const XMLNode *io_node = 0;
Processor::set_state(node, version);
if (_own_input && _input) {
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = (*niter)->property ("name")) != 0) {
if (_name == prop->value()) {
if ((prop = (*niter)->property ("direction")) != 0) {
if (_own_output && _output) {
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == "IO") {
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = (*niter)->property ("name")) != 0) {
if (_name == prop->value()) {
if ((prop = (*niter)->property ("direction")) != 0) {
#ifndef NO_PLUGIN_STATE
XMLNodeList nodes;
- XMLProperty *prop;
+ XMLProperty const * prop;
XMLNodeConstIterator iter;
XMLNode *child;
const char *port;
{
#ifndef NO_PLUGIN_STATE
XMLNodeList nodes;
- XMLProperty *prop;
+ XMLProperty const * prop;
XMLNodeConstIterator iter;
XMLNode *child;
const char *port;
int
Location::set_state (const XMLNode& node, int version)
{
- const XMLProperty *prop;
+ XMLProperty const * prop;
XMLNodeList cd_list = node.children();
XMLNodeConstIterator cd_iter;
{
#ifndef NO_PLUGIN_STATE
XMLNodeList nodes;
- XMLProperty *prop;
+ XMLProperty const * prop;
XMLNodeConstIterator iter;
XMLNode *child;
const char *value;
XMLNode* root = t->root ();
for (XMLNodeList::const_iterator i = root->children().begin(); i != root->children().end(); ++i) {
- XMLProperty* label = (*i)->property (X_("label"));
+ XMLProperty const * label = (*i)->property (X_("label"));
assert (label);
if (label->value() != r.label) {
continue;
for (XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) {
if ((*j)->name() == X_("Parameter")) {
- XMLProperty* index = (*j)->property (X_("index"));
- XMLProperty* value = (*j)->property (X_("value"));
+ XMLProperty const * index = (*j)->property (X_("index"));
+ XMLProperty const * value = (*j)->property (X_("value"));
assert (index);
assert (value);
set_parameter (atoi (index->value().c_str()), atof (value->value().c_str ()));
XMLNode* root = t->root ();
for (XMLNodeList::const_iterator i = root->children().begin(); i != root->children().end(); ++i) {
- XMLProperty* uri = (*i)->property (X_("uri"));
- XMLProperty* label = (*i)->property (X_("label"));
+ XMLProperty const * uri = (*i)->property (X_("uri"));
+ XMLProperty const * label = (*i)->property (X_("label"));
assert (uri);
assert (label);
if (t->read ()) {
XMLNode* root = t->root ();
for (XMLNodeList::const_iterator i = root->children().begin(); i != root->children().end(); ++i) {
- XMLProperty* uri = (*i)->property (X_("uri"));
- XMLProperty* label = (*i)->property (X_("label"));
+ XMLProperty const * uri = (*i)->property (X_("uri"));
+ XMLProperty const * label = (*i)->property (X_("label"));
p.push_back (Plugin::PresetRecord (uri->value(), label->value(), true));
}
}
LV2Plugin::set_state(const XMLNode& node, int version)
{
XMLNodeList nodes;
- const XMLProperty* prop;
+ XMLProperty const * prop;
XMLNodeConstIterator iter;
XMLNode* child;
const char* sym;
if (t->read ()) { // TODO read names only. skip parsing the actual data
XMLNode* root = t->root ();
for (XMLNodeList::const_iterator i = root->children().begin(); i != root->children().end(); ++i) {
- XMLProperty* uri = (*i)->property (X_("uri"));
- XMLProperty* label = (*i)->property (X_("label"));
+ XMLProperty const * uri = (*i)->property (X_("uri"));
+ XMLProperty const * label = (*i)->property (X_("label"));
p.push_back (Plugin::PresetRecord (uri->value(), label->value(), true));
}
}
MidiAutomationListBinder::MidiAutomationListBinder (XMLNode* node, Session::SourceMap const & sources)
: _parameter (0, 0, 0)
{
- XMLProperty* source = node->property ("source-id");
+ XMLProperty const * source = node->property ("source-id");
assert (source);
- XMLProperty* parameter = node->property ("parameter");
+ XMLProperty const * parameter = node->property ("parameter");
assert (parameter);
Session::SourceMap::const_iterator i = sources.find (PBD::ID (source->value()));
MidiModel::NoteDiffCommand::unmarshal_note (XMLNode *xml_note)
{
unsigned int note;
- XMLProperty* prop;
+ XMLProperty const * prop;
unsigned int channel;
MidiModel::TimeType time;
MidiModel::TimeType length;
MidiModel::NoteDiffCommand::NoteChange
MidiModel::NoteDiffCommand::unmarshal_change (XMLNode *xml_change)
{
- XMLProperty* prop;
+ XMLProperty const * prop;
NoteChange change;
change.note_id = 0;
MidiModel::SysExDiffCommand::Change
MidiModel::SysExDiffCommand::unmarshal_change (XMLNode *xml_change)
{
- XMLProperty* prop;
+ XMLProperty const * prop;
Change change;
if ((prop = xml_change->property ("property")) != 0) {
MidiModel::PatchChangePtr
MidiModel::PatchChangeDiffCommand::unmarshal_patch_change (XMLNode* n)
{
- XMLProperty* prop;
- XMLProperty* prop_id;
+ XMLProperty const * prop;
+ XMLProperty const * prop_id;
Evoral::event_id_t id = 0;
Evoral::Beats time = Evoral::Beats();
int channel = 0;
MidiModel::PatchChangeDiffCommand::Change
MidiModel::PatchChangeDiffCommand::unmarshal_change (XMLNode* n)
{
- XMLProperty* prop;
+ XMLProperty const * prop;
Change c;
int an_int;
, _read_end(0)
{
#ifndef NDEBUG
- const XMLProperty* prop = node.property("type");
+ XMLProperty const * prop = node.property("type");
assert(prop && DataType(prop->value()) == DataType::MIDI);
#endif
return -1;
}
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property (X_("program"))) == 0) {
return -1;
int
MidiSource::set_state (const XMLNode& node, int /*version*/)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property ("captured-for")) != 0) {
_captured_for = prop->value();
}
int
MidiTrack::set_state (const XMLNode& node, int version)
{
- const XMLProperty *prop;
+ XMLProperty const * prop;
/* This must happen before Track::set_state(), as there will be a buffer
fill during that call, and we must fill buffers using the correct
MidiTrack::set_state_part_two ()
{
XMLNode* fnode;
- XMLProperty* prop;
+ XMLProperty const * prop;
LocaleGuard lg (X_("C"));
/* This is called after all session state has been restored but before
void
MidiPortManager::set_midi_port_states (const XMLNodeList&nodes)
{
- XMLProperty* prop;
+ XMLProperty const * prop;
typedef map<std::string,boost::shared_ptr<Port> > PortMap;
PortMap ports;
const int version = 0;
return ret;
}
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property (X_("type"))) == 0) {
error << string_compose (X_("programming error: %1"), X_("MonitorProcessor XML settings have no type information"))
int
MuteMaster::set_state (const XMLNode& node, int /*version*/)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property ("mute-point")) != 0) {
_mute_point = (MutePoint) string_2_enum (prop->value(), _mute_point);
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((*niter)->name() == Controllable::xml_node_name) {
- const XMLProperty* prop = (*niter)->property (X_("name"));
+ XMLProperty const * prop = (*niter)->property (X_("name"));
if (!prop) {
continue;
set_automation_xml_state (**niter, PanAzimuthAutomation);
} else {
- const XMLProperty* prop;
+ XMLProperty const * prop;
/* old school (alpha1-6) XML info */
{
XMLNodeList nlist = node.children ();
XMLNodeConstIterator niter;
- const XMLProperty *prop;
+ XMLProperty const * prop;
LocaleGuard lg (X_("C"));
if ((prop = node.property (X_("bypassed"))) != 0) {
, _type(type)
{
#ifndef NDEBUG
- const XMLProperty* prop = node.property("type");
+ XMLProperty const * prop = node.property("type");
assert(!prop || DataType(prop->value()) == _type);
#endif
XMLNodeConstIterator niter;
XMLPropertyList plist;
XMLPropertyConstIterator piter;
- XMLProperty *prop;
+ XMLProperty const * prop;
boost::shared_ptr<Region> region;
string region_name;
bool seen_region_nodes = false;
boost::shared_ptr<Playlist>
PlaylistFactory::create (Session& s, const XMLNode& node, bool hidden, bool unused)
{
- const XMLProperty* type = node.property("type");
+ XMLProperty const * type = node.property("type");
boost::shared_ptr<Playlist> pl;
{
/* check that we have a playlist ID */
- const XMLProperty *prop = node.property (X_("playlist"));
+ XMLProperty const * prop = node.property (X_("playlist"));
if (!prop) {
error << _("No playlist ID in PlaylistSource XML!") << endmsg;
for (iter = nlist.begin(); iter != nlist.end(); ++iter) {
if ((*iter)->name() == Controllable::xml_node_name) {
- const XMLProperty* prop;
+ XMLProperty const * prop;
uint32_t p = (uint32_t)-1;
#ifdef LV2_SUPPORT
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
XMLPropertyList plist;
- const XMLProperty *prop;
+ XMLProperty const * prop;
ARDOUR::PluginType type;
if ((prop = node.property ("type")) == 0) {
}
XMLNodeList cnodes;
- XMLProperty *cprop;
+ XMLProperty const * cprop;
XMLNodeConstIterator iter;
XMLNode *child;
const char *port;
int
Port::set_state (const XMLNode& node, int)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if (node.name() != state_node_name) {
return -1;
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
XMLPropertyList plist;
- const XMLProperty *prop;
+ XMLProperty const * prop;
const XMLNode* insert_node = &node;
return set_state_2X (node, version);
}
- const XMLProperty *prop;
- const XMLProperty *legacy_active = 0;
+ XMLProperty const * prop;
+ XMLProperty const * legacy_active = 0;
bool leave_name_alone = (node.property ("ignore-name") != 0);
if (!leave_name_alone) {
if ((*niter)->name() == X_("Automation")) {
- XMLProperty *prop;
+ XMLProperty const * prop;
if ((prop = (*niter)->property ("path")) != 0) {
old_set_automation_state (*(*niter));
int
Region::_set_state (const XMLNode& node, int /*version*/, PropertyChange& what_changed, bool send)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
Stateful::save_extra_xml (node);
{
XMLNodeList nlist = node.children();
XMLNodeIterator niter;
- const XMLProperty* prop;
+ XMLProperty const * prop;
const XMLNode* insert_node = &node;
/* Return has regular IO automation (gain, pan) */
bool
Route::add_processor_from_xml_2X (const XMLNode& node, int version)
{
- const XMLProperty *prop;
+ XMLProperty const * prop;
try {
boost::shared_ptr<Processor> processor;
XMLNodeList nlist;
XMLNodeConstIterator niter;
XMLNode *child;
- const XMLProperty *prop;
+ XMLProperty const * prop;
if (node.name() != "Route"){
error << string_compose(_("Bad node sent to Route::set_state() [%1]"), node.name()) << endmsg;
XMLNodeList nlist;
XMLNodeConstIterator niter;
XMLNode *child;
- const XMLProperty *prop;
+ XMLProperty const * prop;
/* 2X things which still remain to be handled:
* default-type
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
- XMLProperty* prop = (*niter)->property ("type");
+ XMLProperty const * prop = (*niter)->property ("type");
if (prop->value() == "amp") {
_amp->set_state (**niter, Stateful::current_state_version);
ProcessorList::iterator o;
for (o = _processors.begin(); o != _processors.end(); ++o) {
- XMLProperty* id_prop = (*niter)->property(X_("id"));
+ XMLProperty const * id_prop = (*niter)->property(X_("id"));
if (id_prop && (*o)->id() == id_prop->value()) {
(*o)->set_state (**niter, Stateful::current_state_version);
new_order.push_back (*o);
} else if ((*i)->name() == X_("Processor")) {
- XMLProperty* role = (*i)->property (X_("role"));
+ XMLProperty const * role = (*i)->property (X_("role"));
if (role && role->value() == X_("Main")) {
(*i)->add_property (X_("name"), name);
}
return set_state_2X (node, version);
}
- const XMLProperty *prop;
+ XMLProperty const * prop;
set_id (node);
set_values (node);
boost::shared_ptr<SceneChange>
SceneChange::factory (const XMLNode& node, int version)
{
- const XMLProperty* prop = node.property (X_("type"));
+ XMLProperty const * prop = node.property (X_("type"));
if (prop->value() == X_("MIDI")) {
return boost::shared_ptr<SceneChange> (new MIDISceneChange (node, version));
return set_state_2X (node, version);
}
- const XMLProperty* prop;
+ XMLProperty const * prop;
Delivery::set_state (node, version);
*/
if (state_tree) {
- const XMLProperty* prop;
- if ((prop = state_tree->root()->property (X_("sample-rate"))) != 0) {
+ XMLProperty const * prop;
+ XMLNode const * root (state_tree->root());
+ if ((prop = root->property (X_("sample-rate"))) != 0) {
sr = atoi (prop->value());
}
}
for (XMLNodeList::iterator i = children.begin(); i != children.end(); ++i) {
if ((*i)->name() == X_("Processor")) {
/* ForceIDRegeneration does not catch the following */
- XMLProperty* role = (*i)->property (X_("role"));
- XMLProperty* type = (*i)->property (X_("type"));
+ XMLProperty const * role = (*i)->property (X_("role"));
+ XMLProperty const * type = (*i)->property (X_("type"));
if (role && role->value() == X_("Aux")) {
/* check if the target bus exists.
* we should not save aux-sends in templates.
*/
- XMLProperty* target = (*i)->property (X_("target"));
+ XMLProperty const * target = (*i)->property (X_("target"));
if (!target) {
(*i)->add_property ("type", "dangling-aux-send");
continue;
return -1;
}
- XMLNode& root (*state_tree->root());
+ XMLNode const & root (*state_tree->root());
if (root.name() != X_("Session")) {
error << string_compose (_("Session file %1 is not a session"), xmlpath) << endmsg;
return -1;
}
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = root.property ("version")) == 0) {
/* no version implies very old version of Ardour */
{
XMLNodeList nlist;
XMLNode* child;
- const XMLProperty* prop;
+ XMLProperty const * prop;
int ret = -1;
_state_of_the_state = StateOfTheState (_state_of_the_state|CannotSave);
XMLNode* ds_child = find_named_node (node, X_("Diskstream"));
DataType type = DataType::AUDIO;
- const XMLProperty* prop = node.property("default-type");
+ XMLProperty const * prop = node.property("default-type");
if (prop) {
type = DataType (prop->value());
} else {
enum Route::Flag flags = Route::Flag(0);
- const XMLProperty* prop = node.property("flags");
+ XMLProperty const * prop = node.property("flags");
if (prop) {
flags = Route::Flag (string_2_enum (prop->value(), flags));
}
}
DataType type = DataType::AUDIO;
- const XMLProperty* prop = node.property("default-type");
+ XMLProperty const * prop = node.property("default-type");
if (prop) {
type = DataType (prop->value());
} else {
enum Route::Flag flags = Route::Flag(0);
- const XMLProperty* prop = node.property("flags");
+ XMLProperty const * prop = node.property("flags");
if (prop) {
flags = Route::Flag (string_2_enum (prop->value(), flags));
}
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
if ((region = XMLRegionFactory (**niter, false)) == 0) {
error << _("Session: cannot create Region from XML description.");
- const XMLProperty *name = (**niter).property("name");
+ XMLProperty const * name = (**niter).property("name");
if (name) {
error << " " << string_compose (_("Can not load state for region '%1'"), name->value());
{
XMLNodeList calist = node.children();
XMLNodeConstIterator caiter;
- XMLProperty *caprop;
+ XMLProperty const * caprop;
for (caiter = calist.begin(); caiter != calist.end(); ++caiter) {
XMLNode* ca = *caiter;
/* it may already exist, so don't recreate it unnecessarily
*/
- XMLProperty* prop = (*niter)->property (X_("id"));
+ XMLProperty const * prop = (*niter)->property (X_("id"));
if (!prop) {
error << _("Nested source has no ID info in session file! (ignored)") << endmsg;
continue;
boost::shared_ptr<Region>
Session::XMLRegionFactory (const XMLNode& node, bool full)
{
- const XMLProperty* type = node.property("type");
+ XMLProperty const * type = node.property("type");
try {
boost::shared_ptr<AudioRegion>
Session::XMLAudioRegionFactory (const XMLNode& node, bool /*full*/)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
boost::shared_ptr<Source> source;
boost::shared_ptr<AudioSource> as;
SourceList sources;
boost::shared_ptr<MidiRegion>
Session::XMLMidiRegionFactory (const XMLNode& node, bool /*full*/)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
boost::shared_ptr<Source> source;
boost::shared_ptr<MidiSource> ms;
SourceList sources;
for (niter = nlist.begin(); niter != nlist.end(); ++niter) {
- XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = (*niter)->property (X_("type"))) == 0) {
continue;
/* sample rate */
- const XMLProperty* prop;
- if ((prop = tree.root()->property (X_("sample-rate"))) != 0) {
+ XMLProperty const * prop;
+ XMLNode const * root (tree.root());
+
+ if ((prop = root->property (X_("sample-rate"))) != 0) {
sample_rate = atoi (prop->value());
found_sr = true;
}
- const XMLNodeList& children (tree.root()->children());
+ const XMLNodeList& children (root->children());
for (XMLNodeList::const_iterator c = children.begin(); c != children.end(); ++c) {
const XMLNode* child = *c;
if (child->name() == "Config") {
const XMLNodeList& options (child->children());
for (XMLNodeList::const_iterator oc = options.begin(); oc != options.end(); ++oc) {
- const XMLNode* option = *oc;
- const XMLProperty* name = option->property("name");
+ XMLNode const * option = *oc;
+ XMLProperty const * name = option->property("name");
if (!name) {
continue;
}
if (name->value() == "native-file-data-format") {
- const XMLProperty* value = option->property ("value");
+ XMLProperty const * value = option->property ("value");
if (value) {
SampleFormat fmt = (SampleFormat) string_2_enum (option->property ("value")->value(), fmt);
data_format = fmt;
return "";
}
- const XMLProperty* prop;
+ XMLProperty const * prop;
XMLNode *last_used_snapshot = tree.root()->child("LastUsedSnapshot");
if (last_used_snapshot && (prop = last_used_snapshot->property ("name")) != 0) {
return prop->value();
int
Source::set_state (const XMLNode& node, int version)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property ("name")) != 0) {
_name = prop->value();
SourceFactory::create (Session& s, const XMLNode& node, bool defer_peaks)
{
DataType type = DataType::AUDIO;
- const XMLProperty* prop = node.property("type");
+ XMLProperty const * prop = node.property("type");
if (prop) {
type = DataType (prop->value());
Speakers::set_state (const XMLNode& node, int /*version*/)
{
XMLNodeConstIterator i;
- const XMLProperty* prop;
+ XMLProperty const * prop;
double a, e, d;
LocaleGuard lg (X_("C"));
int n = 0;
TempoSection::TempoSection (const XMLNode& node)
: MetricSection (BBT_Time()), Tempo (TempoMap::default_tempo())
{
- const XMLProperty *prop;
+ XMLProperty const * prop;
BBT_Time start;
LocaleGuard lg (X_("C"));
MeterSection::MeterSection (const XMLNode& node)
: MetricSection (BBT_Time()), Meter (TempoMap::default_meter())
{
- const XMLProperty *prop;
+ XMLProperty const * prop;
BBT_Time start;
LocaleGuard lg (X_("C"));
for (XMLNodeConstIterator niter = nlist.begin(); niter != nlist.end(); ++niter) {
child = *niter;
- XMLProperty* prop;
+ XMLProperty const * prop;
if (child->name() == Controllable::xml_node_name && (prop = child->property ("name")) != 0) {
if (prop->value() == X_("recenable")) {
_rec_enable_control->set_state (*child, version);
}
}
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property (X_("monitoring"))) != 0) {
_monitoring = MonitorChoice (string_2_enum (prop->value(), _monitoring));
XMLNode* root = t->root ();
for (XMLNodeList::const_iterator i = root->children().begin(); i != root->children().end(); ++i) {
- XMLProperty* label = (*i)->property (X_("label"));
+ XMLProperty const * label = (*i)->property (X_("label"));
assert (label);
for (XMLNodeList::const_iterator j = (*i)->children().begin(); j != (*i)->children().end(); ++j) {
if ((*j)->name() == X_("Parameter")) {
- XMLProperty* index = (*j)->property (X_("index"));
- XMLProperty* value = (*j)->property (X_("value"));
+ XMLProperty const * index = (*j)->property (X_("index"));
+ XMLProperty const * value = (*j)->property (X_("value"));
assert (index);
assert (value);
XMLNode* root = t->root ();
for (XMLNodeList::const_iterator i = root->children().begin(); i != root->children().end(); ++i) {
- XMLProperty* uri = (*i)->property (X_("uri"));
- XMLProperty* label = (*i)->property (X_("label"));
+ XMLProperty const * uri = (*i)->property (X_("uri"));
+ XMLProperty const * label = (*i)->property (X_("label"));
assert (uri);
assert (label);
if (t->read ()) {
XMLNode* root = t->root ();
for (XMLNodeList::const_iterator i = root->children().begin(); i != root->children().end(); ++i) {
- XMLProperty* uri = (*i)->property (X_("uri"));
- XMLProperty* label = (*i)->property (X_("label"));
+ XMLProperty const * uri = (*i)->property (X_("uri"));
+ XMLProperty const * label = (*i)->property (X_("label"));
p.push_back (Plugin::PresetRecord (uri->value(), label->value(), true));
}
}
for (XMLNodeList::const_iterator p = children.begin(); p != children.end(); ++p) {
- XMLProperty* ap;
- XMLProperty* kp;
- XMLProperty* bp;
-
- ap = (*p)->property ("action");
- kp = (*p)->property ("key");
- bp = (*p)->property ("button");
+ XMLProperty const * ap;
+ XMLProperty const * kp;
+ XMLProperty const * bp;
+ XMLNode const * child = *p;
+
+ ap = child->property ("action");
+ kp = child->property ("key");
+ bp = child->property ("button");
if (!ap || (!kp && !bp)) {
continue;
int
Keyboard::set_state (const XMLNode& node, int /*version*/)
{
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property ("copy-modifier")) != 0) {
sscanf (prop->value().c_str(), "%d", &CopyModifier);
XMLNodeList const& children = tree.root()->children();
for (XMLNodeList::const_iterator i = children.begin(); i != children.end(); ++i) {
- if ((*i)->name() == X_("Bindings")) {
- XMLProperty const* name = (*i)->property (X_("name"));
+ XMLNode const * child = *i;
+ if (child->name() == X_("Bindings")) {
+ XMLProperty const* name = child->property (X_("name"));
if (!name) {
warning << _("Keyboard binding found without a name") << endmsg;
continue;
XMLNode* window_node = node.child ("Window");
if (window_node) {
- const XMLProperty* prop = window_node->property (X_("tabbed"));
+ XMLProperty const * prop = window_node->property (X_("tabbed"));
if (prop) {
tab_requested_by_state = PBD::string_is_affirmative (prop->value());
}
TearOff::set_state (const XMLNode& node)
{
Glib::RefPtr<Gdk::Window> win;
- const XMLProperty* prop;
+ XMLProperty const * prop;
if ((prop = node.property (X_("tornoff"))) == 0) {
return;
WindowProxy::set_state (const XMLNode& node, int /* version */)
{
XMLNodeList children = node.children ();
-
+ XMLNode const * child;
XMLNodeList::const_iterator i = children.begin ();
while (i != children.end()) {
- XMLProperty* prop = (*i)->property (X_("name"));
- if ((*i)->name() == X_("Window") && prop && prop->value() == _name) {
+ child = *i;
+ XMLProperty const * prop = child->property (X_("name"));
+ if (child->name() == X_("Window") && prop && prop->value() == _name) {
break;
}
if (i != children.end()) {
- XMLProperty* prop;
+ XMLProperty const * prop;
+ child = *i;
- if ((prop = (*i)->property (X_("visible"))) != 0) {
+ if ((prop = child->property (X_("visible"))) != 0) {
_visible = PBD::string_is_affirmative (prop->value ());
}
- if ((prop = (*i)->property (X_("x-off"))) != 0) {
+ if ((prop = child->property (X_("x-off"))) != 0) {
_x_off = atoi (prop->value());
}
- if ((prop = (*i)->property (X_("y-off"))) != 0) {
+ if ((prop = child->property (X_("y-off"))) != 0) {
_y_off = atoi (prop->value());
}
- if ((prop = (*i)->property (X_("x-size"))) != 0) {
+ if ((prop = child->property (X_("x-size"))) != 0) {
_width = atoi (prop->value());
}
- if ((prop = (*i)->property (X_("y-size"))) != 0) {
+ if ((prop = child->property (X_("y-size"))) != 0) {
_height = atoi (prop->value());
}
}
const XMLProperty* prop;
XMLNodeList nlist;
XMLNodeConstIterator niter;
- XMLNode* child;
+ XMLNode const * child;
nlist = node.children();
if (i == children.end()) {
return 0;
}
- XMLProperty* from = (*i)->property ("from");
- XMLProperty* to = (*i)->property ("to");
+ XMLProperty const * from = (*i)->property ("from");
+ XMLProperty const * to = (*i)->property ("to");
if (!from || !to) {
return 0;
std::string attribute_value();
const XMLPropertyList& properties() const { return _proplist; }
- XMLProperty* property(const char*);
- XMLProperty* property(const std::string&);
- const XMLProperty* property(const char* n) const { return const_cast<XMLNode*>(this)->property(n); }
- const XMLProperty* property(const std::string& n) const { return const_cast<XMLNode*>(this)->property(n); }
+ XMLProperty const * property(const char*) const;
+ XMLProperty const * property(const std::string&) const;
+ XMLProperty * property(const char*);
+ XMLProperty * property(const std::string&);
bool has_property_with_value (const std::string&, const std::string&) const;
*/
#include <iostream>
+
+#include "pbd/stacktrace.h"
#include "pbd/xml++.h"
+
#include <libxml/debugXML.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
return add_child_copy(XMLNode (string(), c));
}
-XMLProperty*
+XMLProperty const *
+XMLNode::property(const char* n) const
+{
+ string ns(n);
+ map<string,XMLProperty*>::const_iterator iter;
+
+ if ((iter = _propmap.find(ns)) != _propmap.end()) {
+ return iter->second;
+ }
+
+ return 0;
+}
+
+XMLProperty const *
+XMLNode::property(const string& ns) const
+{
+ map<string,XMLProperty*>::const_iterator iter;
+
+ if ((iter = _propmap.find(ns)) != _propmap.end()) {
+ return iter->second;
+ }
+
+ return 0;
+}
+
+XMLProperty *
XMLNode::property(const char* n)
{
string ns(n);
return 0;
}
-XMLProperty*
+XMLProperty *
XMLNode::property(const string& ns)
{
map<string,XMLProperty*>::iterator iter;
XMLNode::remove_nodes_and_delete(const string& propname, const string& val)
{
XMLNodeIterator i = _children.begin();
- XMLProperty* prop;
+ XMLProperty const * prop;
while (i != _children.end()) {
prop = (*i)->property(propname);
MapInfo mi;
- XMLProperty* prop = tree.root()->property ("name");
+ XMLProperty const * prop = tree.root()->property ("name");
if (!prop) {
continue;
XMLNode* this_device = 0;
XMLNodeList const& devices = configuration_state->children();
for (XMLNodeList::const_iterator d = devices.begin(); d != devices.end(); ++d) {
- XMLProperty* prop = (*d)->property (X_("name"));
+ XMLProperty const * prop = (*d)->property (X_("name"));
if (prop && prop->value() == _device_info.name()) {
this_device = *d;
break;