summaryrefslogtreecommitdiff
path: root/libs/ardour/audio_diskstream.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-06-26 19:04:06 +0200
committerRobin Gareus <robin@gareus.org>2014-06-26 19:15:39 +0200
commit7cb6e9065a577adaecf3d52e8fc472f671b558d6 (patch)
tree2a19ce087ef41bf61e28bbcdc15fcb11cbf49454 /libs/ardour/audio_diskstream.cc
parentc596e8dd87bbad9599e2c8619f03dcdb25564b69 (diff)
allow to set custom file name for each diststream
Diffstat (limited to 'libs/ardour/audio_diskstream.cc')
-rw-r--r--libs/ardour/audio_diskstream.cc26
1 files changed, 25 insertions, 1 deletions
diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc
index 095bbf075a..0d2c664e48 100644
--- a/libs/ardour/audio_diskstream.cc
+++ b/libs/ardour/audio_diskstream.cc
@@ -1908,7 +1908,7 @@ AudioDiskstream::use_new_write_source (uint32_t n)
try {
if ((chan->write_source = _session.create_audio_source_for_session (
- n_channels().n_audio(), name(), n, destructive())) == 0) {
+ n_channels().n_audio(), write_source_name(), n, destructive())) == 0) {
throw failed_constructor();
}
}
@@ -2451,6 +2451,9 @@ AudioDiskstream::ChannelInfo::~ChannelInfo ()
bool
AudioDiskstream::set_name (string const & name)
{
+ if (_name == name) {
+ return true;
+ }
Diskstream::set_name (name);
/* get a new write source so that its name reflects the new diskstream name */
@@ -2465,3 +2468,24 @@ AudioDiskstream::set_name (string const & name)
return true;
}
+
+bool
+AudioDiskstream::set_write_source_name (const std::string& str) {
+ if (_write_source_name == str) {
+ return true;
+ }
+
+ Diskstream::set_write_source_name (str);
+
+ if (_write_source_name == name()) {
+ return true;
+ }
+ boost::shared_ptr<ChannelList> c = channels.reader();
+ ChannelList::iterator i;
+ int n = 0;
+
+ for (n = 0, i = c->begin(); i != c->end(); ++i, ++n) {
+ use_new_write_source (n);
+ }
+ return true;
+}