mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 08:36:32 +01:00
* completed MIDI::Name::MIDINameDocument and implemented its set_state-Method, added constructor
git-svn-id: svn://localhost/ardour2/branches/3.0@4295 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
c61283d35e
commit
72f55cd8b6
2 changed files with 21 additions and 1 deletions
|
|
@ -185,14 +185,19 @@ public:
|
|||
typedef std::list<MasterDeviceNames> MasterDeviceNamesList;
|
||||
|
||||
MIDINameDocument() {};
|
||||
MIDINameDocument(const string &filename) : _document(XMLTree(filename)) { set_state(*_document.root()); };
|
||||
virtual ~MIDINameDocument() {};
|
||||
|
||||
const string& author() const { return _author; }
|
||||
void set_author(const string an_author) { _author = an_author; }
|
||||
|
||||
XMLNode& get_state (void);
|
||||
int set_state (const XMLNode& a_node);
|
||||
|
||||
private:
|
||||
string _author;
|
||||
MasterDeviceNamesList _master_device_names_list;
|
||||
XMLTree _document;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -272,6 +272,21 @@ MasterDeviceNames::get_state(void)
|
|||
int
|
||||
MIDINameDocument::set_state(const XMLNode& a_node)
|
||||
{
|
||||
// Author
|
||||
boost::shared_ptr<XMLSharedNodeList> author = a_node.find("//Author");
|
||||
assert(author->size() == 1);
|
||||
_author = author->front()->content();
|
||||
|
||||
// MasterDeviceNames
|
||||
boost::shared_ptr<XMLSharedNodeList> master_device_names_list = a_node.find("//MasterDeviceNames");
|
||||
for (XMLSharedNodeList::iterator i = master_device_names_list->begin();
|
||||
i != master_device_names_list->end();
|
||||
++i) {
|
||||
MasterDeviceNames master_device_names;
|
||||
master_device_names.set_state(*(*i));
|
||||
_master_device_names_list.push_back(master_device_names);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue