Allow const operatons on time-selection
This commit is contained in:
parent
ba0dac92f2
commit
666cb250df
@ -70,7 +70,7 @@ TimeSelection::consolidate ()
|
||||
}
|
||||
|
||||
samplepos_t
|
||||
TimeSelection::start ()
|
||||
TimeSelection::start () const
|
||||
{
|
||||
if (empty()) {
|
||||
return 0;
|
||||
@ -78,7 +78,7 @@ TimeSelection::start ()
|
||||
|
||||
samplepos_t first = max_samplepos;
|
||||
|
||||
for (std::list<AudioRange>::iterator i = begin(); i != end(); ++i) {
|
||||
for (std::list<AudioRange>::const_iterator i = begin(); i != end(); ++i) {
|
||||
if ((*i).start < first) {
|
||||
first = (*i).start;
|
||||
}
|
||||
@ -87,13 +87,13 @@ TimeSelection::start ()
|
||||
}
|
||||
|
||||
samplepos_t
|
||||
TimeSelection::end_sample ()
|
||||
TimeSelection::end_sample () const
|
||||
{
|
||||
samplepos_t last = 0;
|
||||
|
||||
/* XXX make this work like RegionSelection: no linear search needed */
|
||||
|
||||
for (std::list<AudioRange>::iterator i = begin(); i != end(); ++i) {
|
||||
for (std::list<AudioRange>::const_iterator i = begin(); i != end(); ++i) {
|
||||
if ((*i).end > last) {
|
||||
last = (*i).end;
|
||||
}
|
||||
@ -102,7 +102,7 @@ TimeSelection::end_sample ()
|
||||
}
|
||||
|
||||
samplecnt_t
|
||||
TimeSelection::length()
|
||||
TimeSelection::length() const
|
||||
{
|
||||
if (empty()) {
|
||||
return 0;
|
||||
|
@ -33,9 +33,9 @@ class TimeSelection : public std::list<ARDOUR::AudioRange>
|
||||
public:
|
||||
ARDOUR::AudioRange& operator[](uint32_t);
|
||||
|
||||
ARDOUR::samplepos_t start();
|
||||
ARDOUR::samplepos_t end_sample();
|
||||
ARDOUR::samplepos_t length();
|
||||
ARDOUR::samplepos_t start() const;
|
||||
ARDOUR::samplepos_t end_sample() const;
|
||||
ARDOUR::samplepos_t length() const;
|
||||
|
||||
bool consolidate ();
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user