libs/ardour: allow creating region source markers while recording

Add a list of marker locations to the session, for the the UI to add the
current location to when "add-region-cue-marker" happens whilst recording.
On record-stop, create source markers at the locations in that list in all
newly-recorded audio regions.
This commit is contained in:
Colin Fletcher 2022-04-18 16:55:54 +01:00 committed by Paul Davis
parent f96946d566
commit cef86efe1b
5 changed files with 14 additions and 1 deletions

View File

@ -1994,6 +1994,7 @@ public:
}
bool playlist_is_active( boost::shared_ptr<Playlist>);
ARDOUR::CueMarkers pending_source_markers; // source markers created while recording
private:
void reset_write_sources (bool mark_write_complete, bool force = false);

View File

@ -114,6 +114,7 @@ public:
size_t n_captured_xruns () const { return _xruns.size (); }
XrunPositions const& captured_xruns () const { return _xruns; }
void set_captured_xruns (XrunPositions const& xruns) { _xruns = xruns; }
void set_captured_marks (CueMarkers const& marks);
CueMarkers const & cue_markers() const { return _cue_markers; }
bool add_cue_marker (CueMarker const &);

View File

@ -1244,9 +1244,9 @@ DiskWriter::transport_stopped_wallclock (struct tm& when, time_t twhen, bool abo
(*chan)->write_source->stamp (twhen);
(*chan)->write_source->set_captured_xruns (capture_info.front()->xruns);
(*chan)->write_source->set_captured_marks (_session.pending_source_markers);
}
/* MIDI */
if (_midi_write_source) {

View File

@ -1384,6 +1384,8 @@ Session::non_realtime_stop (bool abort, int on_entry, bool& finished, bool will_
}
}
pending_source_markers.clear();
if (abort && did_record) {
_state_of_the_state = StateOfTheState (_state_of_the_state & ~InCleanup);
}

View File

@ -468,6 +468,15 @@ Source::writable () const
return (_flags & Writable) && _session.writable();
}
void
Source::set_captured_marks (CueMarkers const &marks)
{
for (auto mark : marks) {
std::cerr << "adding " << mark.text() << " at " << mark.position() << "\n";
add_cue_marker(mark);
}
}
bool
Source::add_cue_marker (CueMarker const & cm)
{