newly created files for use in recording appear in a .stubs folder, and are moved...
[ardour2.git] / libs / pbd / property_list.cc
blobffe1170dd5b858660ff6303dc122837e5b5710b2
1 /*
2 Copyright (C) 2010 Paul Davis
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "pbd/debug.h"
21 #include "pbd/compose.h"
22 #include "pbd/property_list.h"
23 #include "pbd/xml++.h"
25 using namespace PBD;
27 PropertyList::PropertyList()
28 : _property_owner (true)
32 PropertyList::~PropertyList ()
34 if (_property_owner) {
35 for (iterator i = begin (); i != end (); ++i) {
36 delete i->second;
41 void
42 PropertyList::add_history_state (XMLNode* history_node)
44 for (const_iterator i = begin(); i != end(); ++i) {
45 DEBUG_TRACE (DEBUG::Properties, string_compose ("Add before/after to %1 for %2\n",
46 history_node->name(),
47 i->second->property_name()));
48 i->second->add_history_state (history_node);
52 bool
53 PropertyList::add (PropertyBase* prop)
55 return insert (value_type (prop->property_id(), prop)).second;
58 OwnedPropertyList::OwnedPropertyList ()
60 _property_owner = false;
63 bool
64 OwnedPropertyList::add (PropertyBase& p)
66 return insert (value_type (p.property_id (), &p)).second;