diff options
author | Hans Baier <hansfbaier@googlemail.com> | 2009-02-12 23:28:32 +0000 |
---|---|---|
committer | Hans Baier <hansfbaier@googlemail.com> | 2009-02-12 23:28:32 +0000 |
commit | 9d33176b4950e981f83ffb186f2ff91c5d05ced2 (patch) | |
tree | f68c976c9f2e96b82d4b86f7383e80fb90c74822 /libs/ardour/smf_source.cc | |
parent | b1cd1835113a21670efc0ad1264c7df160a93147 (diff) |
* Swapped MidiSource to LibSMF
* integrated libsmf into scons
git-svn-id: svn://localhost/ardour2/branches/3.0@4539 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/smf_source.cc')
-rw-r--r-- | libs/ardour/smf_source.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc index 92ef0b89aa..50bfa22f47 100644 --- a/libs/ardour/smf_source.cc +++ b/libs/ardour/smf_source.cc @@ -55,7 +55,7 @@ uint64_t SMFSource::header_position_offset; SMFSource::SMFSource (Session& s, std::string path, Flag flags) : MidiSource (s, region_name_from_path(path, false)) - , Evoral::SMF<double> () + , Evoral::LibSMF<double> () , _flags (Flag(flags | Writable)) // FIXME: this needs to be writable for now , _allow_remove_if_empty(true) { @@ -146,7 +146,7 @@ SMFSource::read_unlocked (MidiRingBuffer<double>& dst, nframes_t start, nframes_ size_t scratch_size = 0; // keep track of scratch to minimize reallocs // FIXME: don't seek to start and search every read (brutal!) - Evoral::SMF<double>::seek_to_start(); + Evoral::LibSMF<double>::seek_to_start(); // FIXME: assumes tempo never changes after start const double frames_per_beat = _session.tempo_map().tempo_at(_timeline_position).frames_per_beat( @@ -155,7 +155,7 @@ SMFSource::read_unlocked (MidiRingBuffer<double>& dst, nframes_t start, nframes_ const uint64_t start_ticks = (uint64_t)((start / frames_per_beat) * ppqn()); - while (!Evoral::SMF<double>::eof()) { + while (!Evoral::LibSMF<double>::eof()) { int ret = read_event(&ev_delta_t, &ev_size, &ev_buffer); if (ret == -1) { // EOF //cerr << "SMF - EOF\n"; @@ -251,7 +251,7 @@ SMFSource::write_unlocked (MidiRingBuffer<double>& src, nframes_t cnt) make_sure_controls_have_the_right_interpolation(); } - Evoral::SMF<double>::flush(); + Evoral::LibSMF<double>::flush(); free(buf); const nframes_t oldlen = _length; @@ -271,12 +271,12 @@ SMFSource::append_event_unlocked(EventTimeUnit unit, const Evoral::Event<double> return; } - /*printf("SMFSource: %s - append_event_unlocked time = %lf, size = %u, data = ", + printf("SMFSource: %s - append_event_unlocked time = %lf, size = %u, data = ", name().c_str(), ev.time(), ev.size()); for (size_t i=0; i < ev.size(); ++i) { printf("%X ", ev.buffer()[i]); } - printf("\n");*/ + printf("\n"); assert(ev.time() >= 0); @@ -299,7 +299,7 @@ SMFSource::append_event_unlocked(EventTimeUnit unit, const Evoral::Event<double> delta_time = (uint32_t)((ev.time() - last_event_time()) * ppqn()); } - Evoral::SMF<double>::append_event_delta(delta_time, ev); + Evoral::LibSMF<double>::append_event_delta(delta_time, ev); _write_data_count += ev.size(); } @@ -354,7 +354,7 @@ void SMFSource::mark_streaming_midi_write_started (NoteMode mode, nframes_t start_frame) { MidiSource::mark_streaming_midi_write_started (mode, start_frame); - Evoral::SMF<double>::begin_write (); + Evoral::LibSMF<double>::begin_write (); } void @@ -367,7 +367,7 @@ SMFSource::mark_streaming_write_completed () } _model->set_edited(false); - Evoral::SMF<double>::end_write (); + Evoral::LibSMF<double>::end_write (); } void @@ -632,7 +632,7 @@ SMFSource::load_model(bool lock, bool force_reload) } _model->start_write(); - Evoral::SMF<double>::seek_to_start(); + Evoral::LibSMF<double>::seek_to_start(); uint64_t time = 0; /* in SMF ticks */ Evoral::Event<double> ev; @@ -704,6 +704,6 @@ SMFSource::destroy_model() void SMFSource::flush_midi() { - Evoral::SMF<double>::end_write(); + Evoral::LibSMF<double>::end_write(); } |