summaryrefslogtreecommitdiff
path: root/libs/ardour/source.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2006-08-14 08:44:14 +0000
committerDavid Robillard <d@drobilla.net>2006-08-14 08:44:14 +0000
commitd752986314eb37151983393c1d62efefe503e47c (patch)
treea98e98b047fd81664e6d3148f4fff65bf86a1e20 /libs/ardour/source.cc
parent0b572cdd84151335594965a3f0ed16f1665dfa56 (diff)
- MIDI "recording" - rec region creation/drawing, actual MIDI region creation/view/pretty pictures/etc
- MIDI containing session saving and restoring (ie XML - Source, Region, Playlist; all but the actual .mid files) - Numerous little fixes for audio specific stuff to accomplish the above - Dirty hacks to accomplish the above - Profit!!! git-svn-id: svn://localhost/ardour2/branches/midi@821 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/source.cc')
-rw-r--r--libs/ardour/source.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/libs/ardour/source.cc b/libs/ardour/source.cc
index e5aba19d2c..1506983e18 100644
--- a/libs/ardour/source.cc
+++ b/libs/ardour/source.cc
@@ -42,7 +42,11 @@ using std::max;
using namespace ARDOUR;
-Source::Source (string name)
+sigc::signal<void,Source*> Source::SourceCreated;
+
+
+Source::Source (string name, DataType type)
+ : _type(type)
{
_name = name;
_use_cnt = 0;
@@ -50,11 +54,12 @@ Source::Source (string name)
}
Source::Source (const XMLNode& node)
+ : _type(DataType::AUDIO)
{
_use_cnt = 0;
_timestamp = 0;
- if (set_state (node)) {
+ if (set_state (node) || _type == DataType::NIL) {
throw failed_constructor();
}
}
@@ -70,6 +75,7 @@ Source::get_state ()
char buf[64];
node->add_property ("name", _name);
+ node->add_property ("type", _type.to_string());
_id.print (buf);
node->add_property ("id", buf);
@@ -98,6 +104,10 @@ Source::set_state (const XMLNode& node)
return -1;
}
+ if ((prop = node.property ("type")) != 0) {
+ _type = DataType(prop->value());
+ }
+
if ((prop = node.property ("timestamp")) != 0) {
sscanf (prop->value().c_str(), "%ld", &_timestamp);
}