iterator add (double when, double value, iterator, bool ignore_mode = false);
void add (double when, double value, bool for_loading = false);
+ void reset_range (double start, double end);
void erase_range (double start, double end);
void erase (iterator);
void erase (iterator, iterator);
maybe_signal_changed ();
}
+void
+AutomationList::reset_range (double start, double endt)
+{
+ bool reset = false;
+
+ {
+ LockMonitor lm (lock, __LINE__, __FILE__);
+ TimeComparator cmp;
+ ControlEvent cp (start, 0.0f);
+ iterator s;
+ iterator e;
+
+ if ((s = lower_bound (events.begin(), events.end(), &cp, cmp)) != events.end()) {
+
+ cp.when = endt;
+ e = upper_bound (events.begin(), events.end(), &cp, cmp);
+
+ for (iterator i = s; i != e; ++i) {
+ (*i)->value = default_value;
+ }
+
+ reset = true;
+
+ if (!no_state) {
+ save_state (_("removed range"));
+ }
+
+ mark_dirty ();
+ }
+ }
+
+ if (reset) {
+ maybe_signal_changed ();
+ }
+}
+
void
AutomationList::erase_range (double start, double endt)
{
_control_out = route;
}
- AudioTrack* at = dynamic_cast<AudioTrack*>(route);
- if (at && at->mode() == Destructive) {
- destructive_index++;
- }
-
set_dirty();
save_state (_current_snapshot_name);
/* find a "version" of the file name that doesn't exist in
any of the possible directories.
*/
-
- for (cnt = (destructive ? destructive_index + 1 : 1); cnt <= limit; ++cnt) {
+
+ for (cnt = (destructive ? ++destructive_index : 1); cnt <= limit; ++cnt) {
vector<space_and_path>::iterator i;
uint32_t existing = 0;