add and use Source::empty() since it can be done more efficiently than length(pos) == 0

git-svn-id: svn://localhost/ardour2/branches/3.0@7300 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2010-06-24 18:04:38 +00:00
parent e72d710734
commit de24d4f8b1
7 changed files with 28 additions and 13 deletions

View file

@ -112,9 +112,19 @@ MidiSource::set_state (const XMLNode& node, int /*version*/)
return 0;
}
sframes_t
MidiSource::length (sframes_t pos) const
bool
MidiSource::empty () const
{
return _length_beats == 0;
}
framecnt_t
MidiSource::length (framepos_t pos) const
{
if (_length_beats == 0) {
return 0;
}
BeatsFramesConverter converter(_session.tempo_map(), pos);
return converter.to(_length_beats);
}