From 08c1300718157d08aed265c11c21d22719008aa2 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 18 Aug 2017 21:12:45 +0200 Subject: Remove old destructive API (non layered is a dynamic mode) 2/2 --- libs/ardour/ardour/audio_diskstream.h | 5 -- libs/ardour/ardour/audio_track.h | 5 -- libs/ardour/ardour/diskstream.h | 5 -- libs/ardour/ardour/midi_diskstream.h | 4 -- libs/ardour/ardour/sndfilesource.h | 4 -- libs/ardour/ardour/source.h | 4 +- libs/ardour/ardour/track.h | 5 -- libs/ardour/audio_diskstream.cc | 120 ---------------------------------- libs/ardour/audio_track.cc | 50 -------------- libs/ardour/auditioner.cc | 8 --- libs/ardour/midi_diskstream.cc | 10 --- libs/ardour/midi_track.cc | 7 -- libs/ardour/sndfilesource.cc | 21 ------ 13 files changed, 1 insertion(+), 247 deletions(-) diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h index a0799aabde..21541c6fb8 100644 --- a/libs/ardour/ardour/audio_diskstream.h +++ b/libs/ardour/ardour/audio_diskstream.h @@ -74,11 +74,6 @@ class LIBARDOUR_API AudioDiskstream : public Diskstream void set_record_enabled (bool yn); void set_record_safe (bool yn); -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - int set_destructive (bool yn); - int set_non_layered (bool yn); - bool can_become_destructive (bool& requires_bounce) const; -#endif boost::shared_ptr audio_playlist () { return boost::dynamic_pointer_cast(_playlist); } diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index 28e42cd4f3..7103825daf 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -37,11 +37,6 @@ class LIBARDOUR_API AudioTrack : public Track AudioTrack (Session&, std::string name, TrackMode m = Normal); ~AudioTrack (); -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - int set_mode (TrackMode m); - bool can_use_mode (TrackMode m, bool& bounce_required); -#endif - int roll (pframes_t nframes, framepos_t start_frame, framepos_t end_frame, int declick, bool& need_butler); diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index 404aceec5e..ea8e44a0ad 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -109,11 +109,6 @@ class LIBARDOUR_API Diskstream : public SessionObject, public PublicDiskstream virtual void set_record_safe (bool yn) = 0; bool destructive() const { return _flags & Destructive; } -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - virtual int set_destructive (bool /*yn*/) { return -1; } - virtual int set_non_layered (bool /*yn*/) { return -1; } - virtual bool can_become_destructive (bool& /*requires_bounce*/) const { return false; } -#endif bool hidden() const { return _flags & Hidden; } bool recordable() const { return _flags & Recordable; } diff --git a/libs/ardour/ardour/midi_diskstream.h b/libs/ardour/ardour/midi_diskstream.h index 4f91a30ca9..ff66222d02 100644 --- a/libs/ardour/ardour/midi_diskstream.h +++ b/libs/ardour/ardour/midi_diskstream.h @@ -91,10 +91,6 @@ class LIBARDOUR_API MidiDiskstream : public Diskstream boost::shared_ptr write_source () { return _write_source; } -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - int set_destructive (bool yn); // doom! -#endif - void set_note_mode (NoteMode m); /** Emitted when some MIDI data has been received for recording. diff --git a/libs/ardour/ardour/sndfilesource.h b/libs/ardour/ardour/sndfilesource.h index 850a32a557..0130765123 100644 --- a/libs/ardour/ardour/sndfilesource.h +++ b/libs/ardour/ardour/sndfilesource.h @@ -67,10 +67,6 @@ class LIBARDOUR_API SndFileSource : public AudioFileSource { void mark_capture_end (); void clear_capture_marks(); -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - bool set_destructive (bool yn); -#endif - bool one_of_several_channels () const; uint32_t channel_count () const { return _info.channels; } diff --git a/libs/ardour/ardour/source.h b/libs/ardour/ardour/source.h index 71595592fb..275fe7c11a 100644 --- a/libs/ardour/ardour/source.h +++ b/libs/ardour/ardour/source.h @@ -82,9 +82,7 @@ class LIBARDOUR_API Source : public SessionObject bool destructive() const { return (_flags & Destructive); } bool writable () const; -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - virtual bool set_destructive (bool /*yn*/) { return false; } -#endif + virtual bool length_mutable() const { return false; } static PBD::Signal1 SourceCreated; diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index a347bdf887..b67e9d970a 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -58,11 +58,6 @@ class LIBARDOUR_API Track : public Route, public Recordable, public PublicDiskst void resync_track_name (); TrackMode mode () const { return _mode; } -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - virtual int set_mode (TrackMode /*m*/) { return false; } - virtual bool can_use_mode (TrackMode /*m*/, bool& /*bounce_required*/) { return false; } - PBD::Signal0 TrackModeChanged; -#endif boost::shared_ptr monitoring_control() const { return _monitoring_control; } diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 40195e58a1..3e50b17573 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -394,12 +394,8 @@ AudioDiskstream::use_destructive_playlist () /* this might be false if we switched modes, so force it */ -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - (*chan)->write_source->set_destructive (true); -#else // should be set when creating the source or loading the state assert ((*chan)->write_source->destructive()); -#endif } /* the source list will never be reset for a destructive track */ @@ -2387,122 +2383,6 @@ AudioDiskstream::use_pending_capture_data (XMLNode& node) return 0; } -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX -int -AudioDiskstream::set_non_layered (bool yn) -{ - if (yn != non_layered()) { - - if (yn) { - _flags = Flag (_flags | NonLayered); - } else { - _flags = Flag (_flags & ~NonLayered); - } - } - - return 0; -} - -int -AudioDiskstream::set_destructive (bool yn) -{ - if (yn != destructive()) { - - if (yn) { - bool bounce_ignored; - /* requestor should already have checked this and - bounced if necessary and desired - */ - if (!can_become_destructive (bounce_ignored)) { - return -1; - } - _flags = Flag (_flags | Destructive); - use_destructive_playlist (); - } else { - _flags = Flag (_flags & ~Destructive); - reset_write_sources (true, true); - } - } - - return 0; -} - -bool -AudioDiskstream::can_become_destructive (bool& requires_bounce) const -{ - if (Profile->get_trx()) { - return false; - } - - if (!_playlist) { - requires_bounce = false; - return false; - } - - /* if no regions are present: easy */ - - if (_playlist->n_regions() == 0) { - requires_bounce = false; - return true; - } - - /* is there only one region ? */ - - if (_playlist->n_regions() != 1) { - requires_bounce = true; - return false; - } - - boost::shared_ptr first; - { - const RegionList& rl (_playlist->region_list_property().rlist()); - assert((rl.size() == 1)); - first = rl.front(); - - } - - if (!first) { - requires_bounce = false; - return true; - } - - /* do the source(s) for the region cover the session start position ? */ - - if (first->position() != _session.current_start_frame()) { - // what is the idea here? why start() ?? - if (first->start() > _session.current_start_frame()) { - requires_bounce = true; - return false; - } - } - - /* currently RouteTimeAxisView::set_track_mode does not - * implement bounce. Existing regions cannot be converted. - * - * so let's make sure this region is already set up - * as tape-track (spanning the complete range) - */ - if (first->length() != max_framepos - first->position()) { - requires_bounce = true; - return false; - } - - /* is the source used by only 1 playlist ? */ - - boost::shared_ptr afirst = boost::dynamic_pointer_cast (first); - - assert (afirst); - - if (_session.playlists->source_use_count (afirst->source()) > 1) { - requires_bounce = true; - return false; - } - - requires_bounce = false; - return true; -} -#endif - void AudioDiskstream::adjust_playback_buffering () { diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 5a51a77ebc..ef0f3f0dab 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -83,14 +83,6 @@ AudioTrack::set_diskstream (boost::shared_ptr ds) Track::set_diskstream (ds); _diskstream->set_track (this); -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - if (Profile->get_trx()) { - _diskstream->set_destructive (false); - } else { - _diskstream->set_destructive (_mode == Destructive); - } - _diskstream->set_non_layered (_mode == NonLayered); -#endif if (audio_diskstream()->deprecated_io_node) { @@ -113,48 +105,6 @@ AudioTrack::audio_diskstream() const return boost::dynamic_pointer_cast(_diskstream); } -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX -int -AudioTrack::set_mode (TrackMode m) -{ - if (m != _mode) { - - if (!Profile->get_trx() && _diskstream->set_destructive (m == Destructive)) { - return -1; - } - - _diskstream->set_non_layered (m == NonLayered); - _mode = m; - - TrackModeChanged (); /* EMIT SIGNAL */ - } - - return 0; -} - -bool -AudioTrack::can_use_mode (TrackMode m, bool& bounce_required) -{ - switch (m) { - case NonLayered: - case Normal: - bounce_required = false; - return true; - - case Destructive: - if (Profile->get_trx()) { - return false; - } else { - return _diskstream->can_become_destructive (bounce_required); - } - break; - - default: - return false; - } -} -#endif - int AudioTrack::deprecated_use_diskstream_connections () { diff --git a/libs/ardour/auditioner.cc b/libs/ardour/auditioner.cc index f2122cef27..85fa4cce31 100644 --- a/libs/ardour/auditioner.cc +++ b/libs/ardour/auditioner.cc @@ -337,14 +337,6 @@ Auditioner::set_diskstream (boost::shared_ptr ds) Track::set_diskstream (ds); _diskstream->set_track (this); -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - if (Profile->get_trx()) { - _diskstream->set_destructive (false); - } else { - _diskstream->set_destructive (_mode == Destructive); - } - _diskstream->set_non_layered (_mode == NonLayered); -#endif _diskstream->set_record_enabled (false); _diskstream->request_input_monitoring (false); diff --git a/libs/ardour/midi_diskstream.cc b/libs/ardour/midi_diskstream.cc index 148881bc70..3263fb02db 100644 --- a/libs/ardour/midi_diskstream.cc +++ b/libs/ardour/midi_diskstream.cc @@ -289,16 +289,6 @@ MidiDiskstream::use_copy_playlist () } } -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX -/** Overloaded from parent to die horribly - */ -int -MidiDiskstream::set_destructive (bool yn) -{ - return yn ? -1 : 0; -} -#endif - void MidiDiskstream::set_note_mode (NoteMode m) { diff --git a/libs/ardour/midi_track.cc b/libs/ardour/midi_track.cc index a24015735b..2c588e973c 100644 --- a/libs/ardour/midi_track.cc +++ b/libs/ardour/midi_track.cc @@ -140,13 +140,6 @@ MidiTrack::set_diskstream (boost::shared_ptr ds) mds->reset_tracker (); _diskstream->set_track (this); -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX - if (Profile->get_trx()) { - _diskstream->set_destructive (false); - } else { - _diskstream->set_destructive (_mode == Destructive); - } -#endif _diskstream->set_record_enabled (false); _diskstream_data_recorded_connection.disconnect (); diff --git a/libs/ardour/sndfilesource.cc b/libs/ardour/sndfilesource.cc index 89b497a248..7436263cc3 100644 --- a/libs/ardour/sndfilesource.cc +++ b/libs/ardour/sndfilesource.cc @@ -837,27 +837,6 @@ SndFileSource::natural_position() const return _timeline_position; } -#ifdef XXX_OLD_DESTRUCTIVE_API_XXX -bool -SndFileSource::set_destructive (bool yn) -{ - if (yn) { - _flags = Flag (_flags | Writable | Destructive); - if (!xfade_buf) { - xfade_buf = new Sample[xfade_frames]; - } - clear_capture_marks (); - _timeline_position = header_position_offset; - } else { - _flags = Flag (_flags & ~Destructive); - _timeline_position = 0; - /* leave xfade buf alone in case we need it again later */ - } - - return true; -} -#endif - void SndFileSource::clear_capture_marks () { -- cgit v1.2.3