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
This commit is contained in:
parent
3d4d0477f6
commit
f8d171d297
@ -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;
|
||||
};
|
||||
|
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user