diff options
Diffstat (limited to 'libs/ardour')
-rw-r--r-- | libs/ardour/ardour/audio_diskstream.h | 3 | ||||
-rw-r--r-- | libs/ardour/ardour/audio_track.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/diskstream.h | 1 | ||||
-rw-r--r-- | libs/ardour/ardour/track.h | 1 | ||||
-rw-r--r-- | libs/ardour/audio_diskstream.cc | 14 | ||||
-rw-r--r-- | libs/ardour/audio_track.cc | 20 | ||||
-rw-r--r-- | libs/ardour/automation_event.cc | 6 |
7 files changed, 37 insertions, 9 deletions
diff --git a/libs/ardour/ardour/audio_diskstream.h b/libs/ardour/ardour/audio_diskstream.h index 74c804e5bb..5c24697972 100644 --- a/libs/ardour/ardour/audio_diskstream.h +++ b/libs/ardour/ardour/audio_diskstream.h @@ -78,6 +78,7 @@ class AudioDiskstream : public Diskstream void set_record_enabled (bool yn); int set_destructive (bool yn); + bool can_become_destructive (bool& requires_bounce) const; float peak_power(uint32_t n=0) { float x = channels[n].peak_power; @@ -252,8 +253,6 @@ class AudioDiskstream : public Diskstream typedef vector<ChannelInfo> ChannelList; ChannelList channels; - - bool can_become_destructive () const; }; } // namespace ARDOUR diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h index ae299dae4a..f35bdd44be 100644 --- a/libs/ardour/ardour/audio_track.h +++ b/libs/ardour/ardour/audio_track.h @@ -38,6 +38,7 @@ class AudioTrack : public Track ~AudioTrack (); int set_mode (TrackMode m); + bool can_use_mode (TrackMode m, bool& bounce_required); int roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, nframes_t offset, int declick, bool can_record, bool rec_monitors_input); diff --git a/libs/ardour/ardour/diskstream.h b/libs/ardour/ardour/diskstream.h index 4cee6d1268..6e0725033a 100644 --- a/libs/ardour/ardour/diskstream.h +++ b/libs/ardour/ardour/diskstream.h @@ -91,6 +91,7 @@ class IO; bool destructive() const { return _flags & Destructive; } virtual int set_destructive (bool yn) { return -1; } + virtual bool can_become_destructive (bool& requires_bounce) const { return false; } bool hidden() const { return _flags & Hidden; } bool recordable() const { return _flags & Recordable; } diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h index a24b614157..a2b0b9b90e 100644 --- a/libs/ardour/ardour/track.h +++ b/libs/ardour/ardour/track.h @@ -41,6 +41,7 @@ class Track : public Route TrackMode mode () const { return _mode; } virtual int set_mode (TrackMode m) { return false; } + virtual bool can_use_mode (TrackMode m, bool& bounce_required) { return false; } sigc::signal<void> TrackModeChanged; virtual int roll (nframes_t nframes, nframes_t start_frame, nframes_t end_frame, diff --git a/libs/ardour/audio_diskstream.cc b/libs/ardour/audio_diskstream.cc index 7e753fa601..5f682789ef 100644 --- a/libs/ardour/audio_diskstream.cc +++ b/libs/ardour/audio_diskstream.cc @@ -2240,10 +2240,15 @@ AudioDiskstream::use_pending_capture_data (XMLNode& node) int AudioDiskstream::set_destructive (bool yn) { + bool bounce_ignored; + if (yn != destructive()) { if (yn) { - if (!can_become_destructive ()) { + /* requestor should already have checked this and + bounced if necessary and desired + */ + if (!can_become_destructive (bounce_ignored)) { return -1; } _flags |= Destructive; @@ -2258,15 +2263,17 @@ AudioDiskstream::set_destructive (bool yn) } bool -AudioDiskstream::can_become_destructive () const +AudioDiskstream::can_become_destructive (bool& requires_bounce) const { if (!_playlist) { + requires_bounce = false; return false; } /* is there only one region ? */ if (_playlist->n_regions() != 1) { + requires_bounce = true; return false; } @@ -2277,6 +2284,7 @@ AudioDiskstream::can_become_destructive () const if (first->position() != _session.current_start_frame()) { if (first->start() > _session.current_start_frame()) { + requires_bounce = true; return false; } } @@ -2288,8 +2296,10 @@ AudioDiskstream::can_become_destructive () const assert (afirst); if (afirst->source()->used() > 1) { + requires_bounce = true; return false; } + requires_bounce = false; return true; } diff --git a/libs/ardour/audio_track.cc b/libs/ardour/audio_track.cc index 9c5020e9aa..46a843784c 100644 --- a/libs/ardour/audio_track.cc +++ b/libs/ardour/audio_track.cc @@ -89,6 +89,19 @@ AudioTrack::set_mode (TrackMode m) return 0; } +bool +AudioTrack::can_use_mode (TrackMode m, bool& bounce_required) +{ + switch (m) { + case Normal: + bounce_required = false; + return true; + + case Destructive: + return _diskstream->can_become_destructive (bounce_required); + } +} + int AudioTrack::deprecated_use_diskstream_connections () { @@ -810,7 +823,7 @@ AudioTrack::freeze (InterThreadInfo& itt) return; } - if (_session.write_one_audio_track (*this, 0, _session.current_end_frame(), true, srcs, itt)) { + if (_session.write_one_audio_track (*this, _session.current_start_frame(), _session.current_end_frame(), true, srcs, itt)) { return; } @@ -830,9 +843,6 @@ AudioTrack::freeze (InterThreadInfo& itt) frii->id = insert->id(); -#ifdef FIX_ME_TO_WORK_WITHOUT_STATE_MANAGER - frii->memento = (*r)->get_memento(); -#endif _freeze_record.insert_info.push_back (frii); /* now deactivate the insert */ @@ -853,7 +863,7 @@ AudioTrack::freeze (InterThreadInfo& itt) false)); new_playlist->set_orig_diskstream_id (diskstream->id()); - new_playlist->add_region (region, 0); + new_playlist->add_region (region, _session.current_start_frame()); new_playlist->set_frozen (true); region->set_locked (true); diff --git a/libs/ardour/automation_event.cc b/libs/ardour/automation_event.cc index a2eeebed56..cc2554a704 100644 --- a/libs/ardour/automation_event.cc +++ b/libs/ardour/automation_event.cc @@ -1246,6 +1246,7 @@ int AutomationList::set_state (const XMLNode& node) { XMLNodeList nlist = node.children(); + XMLNode* nsos; XMLNodeIterator niter; const XMLProperty* prop; @@ -1254,6 +1255,11 @@ AutomationList::set_state (const XMLNode& node) return deserialize_events (node); } + if (node.name() == X_("Envelope") && (nsos = node.child (X_("AutomationList")))) { + /* new school in old school clothing */ + return set_state (*nsos); + } + if (node.name() == X_("Envelope") || node.name() == X_("FadeOut") || node.name() == X_("FadeIn")) { /* old school */ |