summaryrefslogtreecommitdiff
path: root/libs/ardour/midi_source.cc
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-02-17 02:11:49 +0000
committerDavid Robillard <d@drobilla.net>2009-02-17 02:11:49 +0000
commit022818b4a796f52c0a91eea42e65aec0bc7bed43 (patch)
treef82bde33d44c7b3e16af7e837536665e17fe0189 /libs/ardour/midi_source.cc
parent4565b73a3993b0cb5ccb9170e276180f2b5c1372 (diff)
Fix the horrible mess that was anything related to sources and paths.
Most significant changes: - Factor out FileSource from AudioFileSource, use for SMFSource too - Explicitly pass embedded rather than mysterious name mangling or whatever - Destroy a ton of duplicated or very-nearly-duplicated code - Clean up and document all that weird source stuff in session.cc git-svn-id: svn://localhost/ardour2/branches/3.0@4609 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/midi_source.cc')
-rw-r--r--libs/ardour/midi_source.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/libs/ardour/midi_source.cc b/libs/ardour/midi_source.cc
index 03208eda02..b539d5b9d3 100644
--- a/libs/ardour/midi_source.cc
+++ b/libs/ardour/midi_source.cc
@@ -50,8 +50,7 @@ using namespace PBD;
sigc::signal<void,MidiSource *> MidiSource::MidiSourceCreated;
MidiSource::MidiSource (Session& s, string name, Source::Flag flags)
- : Source (s, name, DataType::MIDI, flags)
- , _timeline_position(0)
+ : Source (s, DataType::MIDI, name, flags)
, _read_data_count(0)
, _write_data_count(0)
, _converter(s, _timeline_position)
@@ -62,7 +61,6 @@ MidiSource::MidiSource (Session& s, string name, Source::Flag flags)
MidiSource::MidiSource (Session& s, const XMLNode& node)
: Source (s, node)
- , _timeline_position(0)
, _read_data_count(0)
, _write_data_count(0)
, _converter(s, _timeline_position)
@@ -98,8 +96,6 @@ MidiSource::set_state (const XMLNode& node)
{
const XMLProperty* prop;
- Source::set_state (node);
-
if ((prop = node.property ("captured-for")) != 0) {
_captured_for = prop->value();
}
@@ -161,10 +157,10 @@ MidiSource::file_changed (string path)
}
void
-MidiSource::set_timeline_position (nframes_t when)
+MidiSource::set_timeline_position (int64_t pos)
{
- _timeline_position = when;
- _converter.set_origin(when);
+ Source::set_timeline_position(pos);
+ _converter.set_origin(pos);
}
void
@@ -225,7 +221,8 @@ MidiSource::session_saved()
string newpath = _session.session_directory().midi_path().to_string() +"/"+ newname + ".mid";
boost::shared_ptr<MidiSource> newsrc = boost::dynamic_pointer_cast<MidiSource>(
- SourceFactory::createWritable(DataType::MIDI, _session, newpath, 1, 0, true));
+ SourceFactory::createWritable(DataType::MIDI, _session,
+ newpath, true, false, _session.frame_rate()));
newsrc->set_timeline_position(_timeline_position);
_model->write_to(newsrc);