summaryrefslogtreecommitdiff
path: root/libs/ardour/filter.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2007-11-08 01:40:25 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2007-11-08 01:40:25 +0000
commitbadc087263990ecf360792c10e4d9f2d60828d43 (patch)
tree7e4b7e0afea47be51cbad48f06bb1779f483f56f /libs/ardour/filter.cc
parentdf20e5935fbdaf7d27f924e4e2ea87707d8a2314 (diff)
merged with 2.0-ongoing changes 2582-2605 (not thoroughly tested but it compiles, start up, and creates a new session)
git-svn-id: svn://localhost/ardour2/trunk@2606 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'libs/ardour/filter.cc')
-rw-r--r--libs/ardour/filter.cc23
1 files changed, 18 insertions, 5 deletions
diff --git a/libs/ardour/filter.cc b/libs/ardour/filter.cc
index 208377cc4a..dc8185db95 100644
--- a/libs/ardour/filter.cc
+++ b/libs/ardour/filter.cc
@@ -35,12 +35,25 @@ using namespace ARDOUR;
using namespace PBD;
int
-Filter::make_new_sources (boost::shared_ptr<Region> region, SourceList& nsrcs)
+Filter::make_new_sources (boost::shared_ptr<Region> region, SourceList& nsrcs, string suffix)
{
vector<string> names = region->master_source_names();
for (uint32_t i = 0; i < region->n_channels(); ++i) {
+ string name = PBD::basename_nosuffix (names[i]);
+
+ /* remove any existing version of suffix by assuming it starts
+ with some kind of "special" character.
+ */
+
+ if (!suffix.empty()) {
+ string::size_type pos = name.find (suffix[0]);
+ if (pos != string::npos && pos > 2) {
+ name = name.substr (0, pos - 1);
+ }
+ }
+
string path = session.path_from_region_name (region->data_type(),
PBD::basename_nosuffix (names[i]), string (""));
@@ -65,10 +78,8 @@ Filter::make_new_sources (boost::shared_ptr<Region> region, SourceList& nsrcs)
}
int
-Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs)
+Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs, string region_name)
{
- string region_name;
-
/* update headers on new sources */
time_t xnow;
@@ -94,7 +105,9 @@ Filter::finish (boost::shared_ptr<Region> region, SourceList& nsrcs)
/* create a new region */
- region_name = session.new_region_name (region->name());
+ if (region_name.empty()) {
+ region_name = session.new_region_name (region->name());
+ }
results.clear ();
results.push_back (RegionFactory::create (nsrcs, 0, region->length(), region_name, 0,
Region::Flag (Region::WholeFile|Region::DefaultFlags)));