summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-02-14 22:40:55 +0000
committerDavid Robillard <d@drobilla.net>2009-02-14 22:40:55 +0000
commitf8d171d297cebc92e844502ad43713b1076017c9 (patch)
tree69b30dea041ededaa2ad5f1e3c72d6dc772cc2e7
parent3d4d0477f6dd74af2490451c8cc7eef57868bff4 (diff)
Remove unused (and timestamp type nasty) last_event_time() from SMF.
I swear I already did this. git-svn-id: svn://localhost/ardour2/branches/3.0@4564 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r--libs/ardour/ardour/smf_source.h3
-rw-r--r--libs/ardour/smf_source.cc4
-rw-r--r--libs/evoral/evoral/SMF.hpp9
-rw-r--r--libs/evoral/src/SMF.cpp3
4 files changed, 10 insertions, 9 deletions
diff --git a/libs/ardour/ardour/smf_source.h b/libs/ardour/ardour/smf_source.h
index 470e84b0cc..9981408abc 100644
--- a/libs/ardour/ardour/smf_source.h
+++ b/libs/ardour/ardour/smf_source.h
@@ -93,6 +93,8 @@ class SMFSource : public MidiSource, public Evoral::SMF<double> {
void load_model(bool lock=true, bool force_reload=false);
void destroy_model();
+ double last_event_time() const { return _last_ev_time; }
+
void flush_midi();
private:
@@ -120,6 +122,7 @@ class SMFSource : public MidiSource, public Evoral::SMF<double> {
Flag _flags;
string _take_id;
bool _allow_remove_if_empty;
+ double _last_ev_time;
static string _search_path;
};
diff --git a/libs/ardour/smf_source.cc b/libs/ardour/smf_source.cc
index e160d7e277..64bd687418 100644
--- a/libs/ardour/smf_source.cc
+++ b/libs/ardour/smf_source.cc
@@ -58,6 +58,7 @@ SMFSource::SMFSource (Session& s, std::string path, Flag flags)
, Evoral::SMF<double> ()
, _flags (Flag(flags | Writable)) // FIXME: this needs to be writable for now
, _allow_remove_if_empty(true)
+ , _last_ev_time(0)
{
/* constructor used for new internal-to-session files. file cannot exist */
@@ -76,6 +77,7 @@ SMFSource::SMFSource (Session& s, const XMLNode& node)
: MidiSource (s, node)
, _flags (Flag (Writable|CanRename))
, _allow_remove_if_empty(true)
+ , _last_ev_time(0)
{
/* constructor used for existing internal-to-session files. file must exist */
@@ -302,6 +304,7 @@ SMFSource::append_event_unlocked(EventTimeUnit unit, const Evoral::Event<double>
}
Evoral::SMF<double>::append_event_delta(delta_time, ev);
+ _last_ev_time = ev.time();
_write_data_count += ev.size();
}
@@ -357,6 +360,7 @@ SMFSource::mark_streaming_midi_write_started (NoteMode mode, nframes_t start_fra
{
MidiSource::mark_streaming_midi_write_started (mode, start_frame);
Evoral::SMF<double>::begin_write ();
+ _last_ev_time = 0;
}
void
diff --git a/libs/evoral/evoral/SMF.hpp b/libs/evoral/evoral/SMF.hpp
index 59f9448b4e..cdf3170d52 100644
--- a/libs/evoral/evoral/SMF.hpp
+++ b/libs/evoral/evoral/SMF.hpp
@@ -34,7 +34,8 @@ template<typename Time> class EventRingBuffer;
#define THROW_FILE_ERROR throw(typename SMF<Time>::FileError)
-/** Standard Midi File (Type 0)
+/** Standard Midi File.
+ * Currently only tempo-based time of a given PPQN is supported.
*/
template<typename Time>
class SMF {
@@ -43,7 +44,7 @@ public:
const char* what() const throw() { return "Unknown SMF error"; }
};
- SMF() : _last_ev_time(0), _smf(0), _smf_track(0), _empty(true) {};
+ SMF() : _smf(0), _smf_track(0), _empty(true) {};
virtual ~SMF();
int open(const std::string& path, int track=1) THROW_FILE_ERROR;
@@ -62,8 +63,6 @@ public:
bool is_empty() const { return _empty; }
bool eof() const { assert(false); return true; }
- Time last_event_time() const { return _last_ev_time; }
-
void begin_write();
void append_event_delta(uint32_t delta_t, const Event<Time>& ev);
void end_write() THROW_FILE_ERROR;
@@ -73,8 +72,6 @@ public:
private:
static const uint16_t _ppqn = 19200;
- Time _last_ev_time; ///< last frame time written, relative to source start
-
std::string _path;
smf_t* _smf;
smf_track_t* _smf_track;
diff --git a/libs/evoral/src/SMF.cpp b/libs/evoral/src/SMF.cpp
index 2b47cbfe4b..7e5e5935ce 100644
--- a/libs/evoral/src/SMF.cpp
+++ b/libs/evoral/src/SMF.cpp
@@ -241,7 +241,6 @@ SMF<Time>::append_event_delta(uint32_t delta_t, const Event<Time>& ev)
assert(_smf_track);
smf_track_add_event_delta_pulses(_smf_track, event, int(delta_t));
- _last_ev_time = ev.time();
if (ev.size() > 0) {
_empty = false;
@@ -260,8 +259,6 @@ SMF<Time>::begin_write()
smf_add_track(_smf, _smf_track);
assert(_smf->number_of_tracks == 1);
-
- _last_ev_time = 0;
}
template<typename Time>