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