summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2006-05-19 19:13:26 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2006-05-19 19:13:26 +0000
commit50ee09e80ff91bf0146e89728578d5e31aba23b7 (patch)
treeaf666ac1260e18e2a15465e89b1d23424673e525 /libs
parentc33d0ad760e311c37cfcb99e48948cc92472ad55 (diff)
fix naming of destructive track audio files
git-svn-id: svn://localhost/trunk/ardour2@515 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs')
-rw-r--r--libs/ardour/ardour/automation_event.h1
-rw-r--r--libs/ardour/automation_event.cc36
-rw-r--r--libs/ardour/session.cc9
3 files changed, 39 insertions, 7 deletions
diff --git a/libs/ardour/ardour/automation_event.h b/libs/ardour/ardour/automation_event.h
index 562a424cc7..f26828a114 100644
--- a/libs/ardour/ardour/automation_event.h
+++ b/libs/ardour/ardour/automation_event.h
@@ -85,6 +85,7 @@ class AutomationList : public StateManager
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);
diff --git a/libs/ardour/automation_event.cc b/libs/ardour/automation_event.cc
index ea7e0e1b71..88932009bf 100644
--- a/libs/ardour/automation_event.cc
+++ b/libs/ardour/automation_event.cc
@@ -440,6 +440,42 @@ AutomationList::erase (AutomationList::iterator start, AutomationList::iterator
}
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)
{
bool erased = false;
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 4a0d119afa..a8ab2204dc 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -1887,11 +1887,6 @@ Session::add_route (Route* route)
_control_out = route;
}
- AudioTrack* at = dynamic_cast<AudioTrack*>(route);
- if (at && at->mode() == Destructive) {
- destructive_index++;
- }
-
set_dirty();
save_state (_current_snapshot_name);
@@ -2801,8 +2796,8 @@ Session::audio_path_from_name (string name, uint32_t nchan, uint32_t chan, bool
/* 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;