mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-19 13:16:27 +01:00
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:
parent
e72d710734
commit
de24d4f8b1
7 changed files with 28 additions and 13 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue