summaryrefslogtreecommitdiff
path: root/libs/ardour/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2020-05-04 18:48:01 -0600
committerPaul Davis <paul@linuxaudiosystems.com>2020-05-04 18:48:17 -0600
commit9b070eefb106c25032d6e077090d9f8a959aefc4 (patch)
tree689ea306607f0f2461d0940c7ad560a81439c18e /libs/ardour/ardour
parent7644168536a37b79eb13f598ca884e0fb7209a3a (diff)
fix note-tracking in Editor::write_one_track()
We need a MidiStateTracker to determine notes whose end is not reached during the call to ::write_one_track(), so that we can resolve them in the output (SMF) source. This required some changes to the ::export_stuff() API for tracks. In addition, we now take the source "lock" just once during ::write_one_track() rather than every time we write. This isn't an integral part of the note tracking, but fell out along the way. Finally, note that although we use a vector to handle MIDI "sources" here, it is expected that there is only 1 MIDI source at present. Leave vectors in place since it is possible that ::write_one_track() could be modified in the future to change that.
Diffstat (limited to 'libs/ardour/ardour')
-rw-r--r--libs/ardour/ardour/audio_track.h3
-rw-r--r--libs/ardour/ardour/auditioner.h6
-rw-r--r--libs/ardour/ardour/midi_track.h3
-rw-r--r--libs/ardour/ardour/track.h4
4 files changed, 10 insertions, 6 deletions
diff --git a/libs/ardour/ardour/audio_track.h b/libs/ardour/ardour/audio_track.h
index 55def29b99..6b8f01986c 100644
--- a/libs/ardour/ardour/audio_track.h
+++ b/libs/ardour/ardour/audio_track.h
@@ -48,7 +48,8 @@ class LIBARDOUR_API AudioTrack : public Track
boost::shared_ptr<Region> bounce_range (samplepos_t start, samplepos_t end, InterThreadInfo&,
boost::shared_ptr<Processor> endpoint, bool include_endpoint);
int export_stuff (BufferSet& bufs, samplepos_t start_sample, samplecnt_t nframes,
- boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze);
+ boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze,
+ MidiStateTracker&);
int set_state (const XMLNode&, int version);
diff --git a/libs/ardour/ardour/auditioner.h b/libs/ardour/ardour/auditioner.h
index 6ca51fc0d6..2ad2fba96d 100644
--- a/libs/ardour/ardour/auditioner.h
+++ b/libs/ardour/ardour/auditioner.h
@@ -87,16 +87,16 @@ public:
return boost::shared_ptr<Region> ();
}
- int export_stuff (BufferSet&, samplepos_t, samplecnt_t, boost::shared_ptr<Processor>, bool, bool, bool) { return -1; }
+ int export_stuff (BufferSet&, samplepos_t, samplecnt_t, boost::shared_ptr<Processor>, bool, bool, bool, MidiStateTracker&) { return -1; }
void set_audition_synth_info(PluginInfoPtr in) { audition_synth_info = in; }
samplecnt_t output_latency () const { return 0; }
private:
-
+
PluginInfoPtr audition_synth_info; //we will use this to create a new synth on-the-fly each time an audition is requested
-
+
boost::shared_ptr<AudioRegion> the_region;
boost::shared_ptr<MidiRegion> midi_region;
samplepos_t current_sample;
diff --git a/libs/ardour/ardour/midi_track.h b/libs/ardour/ardour/midi_track.h
index 5a1c1aadc4..6e98267b26 100644
--- a/libs/ardour/ardour/midi_track.h
+++ b/libs/ardour/ardour/midi_track.h
@@ -66,7 +66,8 @@ public:
boost::shared_ptr<Processor> endpoint,
bool include_endpoint,
bool for_export,
- bool for_freeze);
+ bool for_freeze,
+ MidiStateTracker& tracker);
int set_state (const XMLNode&, int version);
diff --git a/libs/ardour/ardour/track.h b/libs/ardour/ardour/track.h
index bb6b0dca37..3da9902c13 100644
--- a/libs/ardour/ardour/track.h
+++ b/libs/ardour/ardour/track.h
@@ -42,6 +42,7 @@ class DiskWriter;
class IO;
class RecordEnableControl;
class RecordSafeControl;
+class MidiStateTracker;
/** A track is an route (bus) with a recordable diskstream and
* related objects relevant to recording, playback and editing.
@@ -110,7 +111,8 @@ public:
virtual boost::shared_ptr<Region> bounce_range (samplepos_t start, samplepos_t end, InterThreadInfo& itt,
boost::shared_ptr<Processor> endpoint, bool include_endpoint) = 0;
virtual int export_stuff (BufferSet& bufs, samplepos_t start_sample, samplecnt_t nframes,
- boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze) = 0;
+ boost::shared_ptr<Processor> endpoint, bool include_endpoint, bool for_export, bool for_freeze,
+ MidiStateTracker&) = 0;
virtual int set_state (const XMLNode&, int version);
static void zero_diskstream_id_in_xml (XMLNode&);