mirror of
https://github.com/Ardour/ardour.git
synced 2026-01-02 03:47:42 +01:00
Tracks does not (want to) support destructive tracks
This commit is contained in:
parent
d75ca2cf5d
commit
e56484d586
7 changed files with 54 additions and 7 deletions
|
|
@ -46,6 +46,7 @@
|
|||
#include "ardour/debug.h"
|
||||
#include "ardour/io.h"
|
||||
#include "ardour/playlist_factory.h"
|
||||
#include "ardour/profile.h"
|
||||
#include "ardour/region_factory.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/session_playlists.h"
|
||||
|
|
@ -2362,6 +2363,10 @@ AudioDiskstream::set_destructive (bool yn)
|
|||
bool
|
||||
AudioDiskstream::can_become_destructive (bool& requires_bounce) const
|
||||
{
|
||||
if (Profile->get_trx()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!_playlist) {
|
||||
requires_bounce = false;
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "ardour/meter.h"
|
||||
#include "ardour/playlist_factory.h"
|
||||
#include "ardour/processor.h"
|
||||
#include "ardour/profile.h"
|
||||
#include "ardour/region.h"
|
||||
#include "ardour/region_factory.h"
|
||||
#include "ardour/session.h"
|
||||
|
|
@ -62,7 +63,7 @@ AudioTrack::create_diskstream ()
|
|||
{
|
||||
AudioDiskstream::Flag dflags = AudioDiskstream::Flag (AudioDiskstream::Recordable);
|
||||
|
||||
if (_mode == Destructive) {
|
||||
if (_mode == Destructive && !Profile->get_trx()) {
|
||||
dflags = AudioDiskstream::Flag (dflags | AudioDiskstream::Destructive);
|
||||
} else if (_mode == NonLayered){
|
||||
dflags = AudioDiskstream::Flag(dflags | AudioDiskstream::NonLayered);
|
||||
|
|
@ -77,7 +78,11 @@ AudioTrack::set_diskstream (boost::shared_ptr<Diskstream> ds)
|
|||
Track::set_diskstream (ds);
|
||||
|
||||
_diskstream->set_track (this);
|
||||
_diskstream->set_destructive (_mode == Destructive);
|
||||
if (Profile->get_trx()) {
|
||||
_diskstream->set_destructive (false);
|
||||
} else {
|
||||
_diskstream->set_destructive (_mode == Destructive);
|
||||
}
|
||||
_diskstream->set_non_layered (_mode == NonLayered);
|
||||
|
||||
if (audio_diskstream()->deprecated_io_node) {
|
||||
|
|
@ -106,7 +111,7 @@ AudioTrack::set_mode (TrackMode m)
|
|||
{
|
||||
if (m != _mode) {
|
||||
|
||||
if (_diskstream->set_destructive (m == Destructive)) {
|
||||
if (!Profile->get_trx() && _diskstream->set_destructive (m == Destructive)) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -129,8 +134,15 @@ AudioTrack::can_use_mode (TrackMode m, bool& bounce_required)
|
|||
return true;
|
||||
|
||||
case Destructive:
|
||||
if (Profile->get_trx()) {
|
||||
return false;
|
||||
} else {
|
||||
return _diskstream->can_become_destructive (bounce_required);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
return _diskstream->can_become_destructive (bounce_required);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -193,6 +205,14 @@ AudioTrack::set_state (const XMLNode& node, int version)
|
|||
_mode = Normal;
|
||||
}
|
||||
|
||||
if (Profile->get_trx() && _mode == Destructive) {
|
||||
/* Tracks does not support destructive tracks and trying to
|
||||
handle it as a normal track would be wrong.
|
||||
*/
|
||||
error << string_compose (_("%1: this session uses destructive tracks, which are not supported"), PROGRAM_NAME) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (Track::set_state (node, version)) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "ardour/midi_region.h"
|
||||
#include "ardour/plugin.h"
|
||||
#include "ardour/plugin_insert.h"
|
||||
#include "ardour/profile.h"
|
||||
#include "ardour/region_factory.h"
|
||||
#include "ardour/route.h"
|
||||
#include "ardour/session.h"
|
||||
|
|
@ -327,7 +328,11 @@ Auditioner::set_diskstream (boost::shared_ptr<Diskstream> ds)
|
|||
Track::set_diskstream (ds);
|
||||
|
||||
_diskstream->set_track (this);
|
||||
_diskstream->set_destructive (_mode == Destructive);
|
||||
if (Profile->get_trx()) {
|
||||
_diskstream->set_destructive (false);
|
||||
} else {
|
||||
_diskstream->set_destructive (_mode == Destructive);
|
||||
}
|
||||
_diskstream->set_non_layered (_mode == NonLayered);
|
||||
_diskstream->set_record_enabled (false);
|
||||
_diskstream->request_input_monitoring (false);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "ardour/diskstream.h"
|
||||
#include "ardour/io.h"
|
||||
#include "ardour/pannable.h"
|
||||
#include "ardour/profile.h"
|
||||
#include "ardour/playlist.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/track.h"
|
||||
|
|
@ -498,6 +499,11 @@ Diskstream::set_state (const XMLNode& node, int /*version*/)
|
|||
_flags = Flag (string_2_enum (prop->value(), _flags));
|
||||
}
|
||||
|
||||
if (Profile->get_trx() && (_flags & Destructive)) {
|
||||
error << string_compose (_("%1: this session uses destructive tracks, which are not supported"), PROGRAM_NAME) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ((prop = node.property (X_("capture-alignment"))) != 0) {
|
||||
set_align_choice (AlignChoice (string_2_enum (prop->value(), _alignment_choice)), true);
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -47,6 +47,7 @@
|
|||
#include "ardour/parameter_types.h"
|
||||
#include "ardour/port.h"
|
||||
#include "ardour/processor.h"
|
||||
#include "ardour/profile.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/session_playlists.h"
|
||||
#include "ardour/utils.h"
|
||||
|
|
@ -135,7 +136,11 @@ MidiTrack::set_diskstream (boost::shared_ptr<Diskstream> ds)
|
|||
mds->reset_tracker ();
|
||||
|
||||
_diskstream->set_track (this);
|
||||
_diskstream->set_destructive (_mode == Destructive);
|
||||
if (Profile->get_trx()) {
|
||||
_diskstream->set_destructive (false);
|
||||
} else {
|
||||
_diskstream->set_destructive (_mode == Destructive);
|
||||
}
|
||||
_diskstream->set_record_enabled (false);
|
||||
|
||||
_diskstream_data_recorded_connection.disconnect ();
|
||||
|
|
|
|||
|
|
@ -4359,7 +4359,7 @@ Session::format_audio_source_name (const string& legalized_base, uint32_t nchan,
|
|||
ostringstream sstr;
|
||||
const string ext = native_header_format_extension (config.get_native_file_header_format(), DataType::AUDIO);
|
||||
|
||||
if (destructive) {
|
||||
if (Profile->get_trx() && destructive) {
|
||||
sstr << 'T';
|
||||
sstr << setfill ('0') << setw (4) << cnt;
|
||||
sstr << legalized_base;
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#include "pbd/enumwriter.h"
|
||||
|
||||
#include "ardour/debug.h"
|
||||
#include "ardour/profile.h"
|
||||
#include "ardour/session.h"
|
||||
#include "ardour/source.h"
|
||||
#include "ardour/transient_detector.h"
|
||||
|
|
@ -144,6 +145,11 @@ Source::set_state (const XMLNode& node, int version)
|
|||
_flags = Flag (_flags | Destructive);
|
||||
}
|
||||
|
||||
if (Profile->get_trx() && (_flags & Destructive)) {
|
||||
error << string_compose (_("%1: this session uses destructive tracks, which are not supported"), PROGRAM_NAME) << endmsg;
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (version < 3000) {
|
||||
/* a source with an XML node must necessarily already exist,
|
||||
and therefore cannot be removable/writable etc. etc.; 2.X
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue