Undo more incorrect sample/frame replacements
authorRobin Gareus <robin@gareus.org>
Mon, 8 Apr 2019 01:46:02 +0000 (03:46 +0200)
committerRobin Gareus <robin@gareus.org>
Mon, 8 Apr 2019 02:10:04 +0000 (04:10 +0200)
libs/ardour/ardour/uri_map.h
libs/ardour/lv2_plugin.cc
libs/ardour/mididm.cc
libs/ardour/session_midi.cc
libs/ardour/uri_map.cc
libs/backends/dummy/dummy_midi_seq.h
libs/canvas/framed_curve.cc
libs/midi++2/mtc.cc
libs/plugins/a-fluidsynth.lv2/a-fluidsynth.cc

index 9c1aee30e9185b231c7fc4615adcac739a376fcb..de0999d94f008ebcd2e1373aae67fda0045697a9 100644 (file)
@@ -78,7 +78,7 @@ public:
                uint32_t time_beatUnit;
                uint32_t time_beatsPerBar;
                uint32_t time_beatsPerMinute;
-               uint32_t time_sample;
+               uint32_t time_frame;
                uint32_t time_speed;
                uint32_t patch_Get;
                uint32_t patch_Set;
index 2b45e9e28ab08c841fbcd2262059c5e754620dfc..974ed87c2d9f7bd925d028fed43d39d6bd077088 100644 (file)
@@ -2553,7 +2553,7 @@ write_position(LV2_Atom_Forge*     forge,
        LV2_Atom_Forge_Frame sample;
 #ifdef HAVE_LV2_1_10_0
        lv2_atom_forge_object(forge, &sample, 0, urids.time_Position);
-       lv2_atom_forge_key(forge, urids.time_sample);
+       lv2_atom_forge_key(forge, urids.time_frame);
        lv2_atom_forge_long(forge, position);
        lv2_atom_forge_key(forge, urids.time_speed);
        lv2_atom_forge_float(forge, speed);
@@ -2570,7 +2570,7 @@ write_position(LV2_Atom_Forge*     forge,
        lv2_atom_forge_float(forge, bpm);
 #else
        lv2_atom_forge_blank(forge, &sample, 1, urids.time_Position);
-       lv2_atom_forge_property_head(forge, urids.time_sample, 0);
+       lv2_atom_forge_property_head(forge, urids.time_frame, 0);
        lv2_atom_forge_long(forge, position);
        lv2_atom_forge_property_head(forge, urids.time_speed, 0);
        lv2_atom_forge_float(forge, speed);
index 14684792fddbff117bfc9cc830aa94bb42f6ca40..b70fb7e10a99dece991da8af442a889cbcb76f9a 100644 (file)
@@ -78,7 +78,7 @@ int MIDIDM::process (pframes_t nframes, PortEngine &pe, void *midi_in, void *mid
        obuf[1] = (_monotonic_cnt)      & 0x7f;
        obuf[2] = (_monotonic_cnt >> 7) & 0x7f;
        pe.midi_event_put (midi_out, 0, obuf, 3);
-#else // sysex MTC sample
+#else // sysex MTC frame
        uint8_t obuf[10];
        obuf[0] = 0xf0;
        obuf[1] = 0x7f;
index cc12b959d5e9302d5f674f529248f5929d5a884c..93981a9d68e55b6a950e57d0c34108ef5bc2cc9c 100644 (file)
@@ -77,7 +77,7 @@ Session::setup_midi_control ()
        outbound_mtc_timecode_frame = 0;
        next_quarter_frame_to_send = 0;
 
-       /* Set up the qtr sample message */
+       /* Set up the qtr frame message */
 
        mtc_msg[0] = 0xf1;
        mtc_msg[2] = 0xf1;
@@ -300,7 +300,7 @@ Session::mmc_locate (MIDI::MachineControl &/*mmc*/, const MIDI::byte* mmc_tc)
                target_sample = max_samplepos;
        }
 
-       /* Some (all?) MTC/MMC devices do not send a full MTC sample
+       /* Some (all?) MTC/MMC devices do not send a full MTC frame
           at the end of a locate, instead sending only an MMC
           locate command. This causes the current position
           of an MTC slave to become out of date. Catch this.
@@ -438,11 +438,9 @@ Session::send_full_time_code (samplepos_t const t, MIDI::pframes_t nframes)
 
        DEBUG_TRACE (DEBUG::MTC, string_compose ("Full MTC TC %1 (off %2)\n", outbound_mtc_timecode_frame, mtc_offset));
 
-       // I don't understand this bit yet.. [DR]
-       // I do [rg]:
-       // according to MTC spec 24, 30 drop and 30 non-drop TC, the sample-number represented by 8 quarter frames must be even.
+       /* according to MTC spec 24, 30 drop and 30 non-drop TC, the frame-number represented by 8 quarter frames must be even. */
        if (((mtc_timecode_bits >> 5) != MIDI::MTC_25_FPS) && (transmitting_timecode_time.frames % 2)) {
-               // start MTC quarter frame transmission on an even sample
+               /* start MTC quarter frame transmission on an even frame */
                Timecode::increment (transmitting_timecode_time, config.get_subframes_per_frame());
                outbound_mtc_timecode_frame += _samples_per_timecode_frame;
        }
@@ -474,7 +472,7 @@ Session::send_full_time_code (samplepos_t const t, MIDI::pframes_t nframes)
 /** Send MTC (quarter-frame) messages for this cycle.
  * Must be called exactly once per cycle from the process thread.  Realtime safe.
  * This function assumes the state of full Timecode is sane, eg. the slave is
- * expecting quarter frame messages and has the right sample of reference (any
+ * expecting quarter frame messages and has the right frame of reference (any
  * full MTC Timecode time messages that needed to be sent should have been sent
  * earlier already this cycle by send_full_time_code)
  */
@@ -575,8 +573,8 @@ Session::send_midi_time_code_for_cycle (samplepos_t start_sample, samplepos_t en
 
 #ifndef NDEBUG
                if (DEBUG_ENABLED(DEBUG::MTC)) {
-                       DEBUG_STR_DECL(foo)
-                               DEBUG_STR_APPEND(foo,"sending ");
+                       DEBUG_STR_DECL(foo);
+                       DEBUG_STR_APPEND(foo,"sending ");
                        DEBUG_STR_APPEND(foo, transmitting_timecode_time);
                        DEBUG_TRACE (DEBUG::MTC, string_compose ("%1 qfm = %2, stamp = %3\n", DEBUG_STR(foo).str(), next_quarter_frame_to_send,
                                                                 out_stamp));
index cdbdbd564c2ad360aed60e6fa603834919289494..2732d6bb066bcd30cb306ffc44264d97cfd53d87 100644 (file)
@@ -56,7 +56,7 @@ URIMap::URIDs::init(URIMap& uri_map)
        time_beatUnit       = uri_map.uri_to_id("http://lv2plug.in/ns/ext/time#beatUnit");
        time_beatsPerBar    = uri_map.uri_to_id("http://lv2plug.in/ns/ext/time#beatsPerBar");
        time_beatsPerMinute = uri_map.uri_to_id("http://lv2plug.in/ns/ext/time#beatsPerMinute");
-       time_sample          = uri_map.uri_to_id("http://lv2plug.in/ns/ext/time#frame");
+       time_frame           = uri_map.uri_to_id("http://lv2plug.in/ns/ext/time#frame");
        time_speed          = uri_map.uri_to_id("http://lv2plug.in/ns/ext/time#speed");
        patch_Get           = uri_map.uri_to_id("http://lv2plug.in/ns/ext/patch#Get");
        patch_Set           = uri_map.uri_to_id("http://lv2plug.in/ns/ext/patch#Set");
index 8dbfb660cccdb3109ba930dcd7951bc7d31314eb..e809a47371242a2e1c8b72b6d506279b8921b959 100644 (file)
@@ -780,7 +780,7 @@ static const MIDISequence s7[] = { // channel1, nonsense
 };
 
 static const MIDISequence s8[] = { // sysex
-       { 0.00, 10, {0xf0, 0x7f, 0x7f, 0x01, 0x01, /*hour + tc */ 0x20, /*min*/ 0x00, /*sec*/ 0x00, /*sample*/ 0x00, 0xf7} },  // 25fps, 00:00:00:00
+       { 0.00, 10, {0xf0, 0x7f, 0x7f, 0x01, 0x01, /*hour + tc */ 0x20, /*min*/ 0x00, /*sec*/ 0x00, /*frame*/ 0x00, 0xf7} },  // 25fps, 00:00:00:00
        // quarter frames spacing (in samples) at 25fps: SR / (25 * 4)
        // DummyMidiPort::setup_generator uses 120bpm ie (SR / 2)
        // hence the spacing is: SR / (25 * 4) / (SR / 2) = 0.2
index 2d22387fa4b506d9410c28eed0012fd80036ee70..66145f718323b691c856e2e39dc9f31fc249c6fe 100644 (file)
@@ -255,7 +255,7 @@ FramedCurve::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) c
                                break;
                        case Inside:
                                context->stroke_preserve ();
-                               /* close the sample, possibly using the last _point's x rather than samples[right].x */
+                               /* close the frame, possibly using the last _point's x rather than samples[right].x */
                                window_space = item_to_window (Duple (last_sample.x, draw.height()));
                                context->line_to (window_space.x, window_space.y);
                                window_space = item_to_window (Duple (first_sample.x, draw.height()));
index f6ad97d4e2ef8a39f960792d309de2f0039965b9..dbe63f7c26e8940987942b5e45ef77c01b4c4ab0 100644 (file)
@@ -189,7 +189,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
 
                        if (res.get_value_or (false)) {
 
-                               /* no error, reset next expected sample */
+                               /* no error, reset next expected frame */
 
                                switch (_mtc_running) {
                                case MTC_Forward:
@@ -222,7 +222,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
                        /* skip counts as an error ... go back to waiting for the first sample */
 
 #ifdef DEBUG_MTC
-                       cerr << "Skipped MTC qtr sample, return to stopped state" << endl;
+                       cerr << "Skipped MTC qtr frame, return to stopped state" << endl;
 #endif
                        reset_mtc_state ();
                        mtc_status (MTC_Stopped);
@@ -231,7 +231,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg)
 
                } else {
 
-                       /* received qtr sample matched expected */
+                       /* received qtr frame matched expected */
                        consecutive_qtr_frame_cnt++;
 
                }
index e25dd52c13d12cebec4645a73b81fb8a7e9f1250..3c585f2cbfec8a8e53f66470293fa50212767afa 100644 (file)
@@ -133,7 +133,7 @@ typedef struct {
        LV2_Log_Logger       logger;
   LV2_Worker_Schedule* schedule;
        LV2_Atom_Forge       forge;
-       LV2_Atom_Forge_Frame sample;
+       LV2_Atom_Forge_Frame frame;
 
 #ifdef LV2_EXTENDED
        LV2_Midnam*          midnam;
@@ -243,15 +243,15 @@ inform_ui (AFluidSynth* self)
                return;
        }
 
-       LV2_Atom_Forge_Frame sample;
+       LV2_Atom_Forge_Frame frame;
        lv2_atom_forge_frame_time (&self->forge, 0);
-       x_forge_object (&self->forge, &sample, 1, self->patch_Set);
+       x_forge_object (&self->forge, &frame, 1, self->patch_Set);
        lv2_atom_forge_property_head (&self->forge, self->patch_property, 0);
        lv2_atom_forge_urid (&self->forge, self->afs_sf2file);
        lv2_atom_forge_property_head (&self->forge, self->patch_value, 0);
        lv2_atom_forge_path (&self->forge, self->current_sf2_file_path, strlen (self->current_sf2_file_path));
 
-       lv2_atom_forge_pop (&self->forge, &sample);
+       lv2_atom_forge_pop (&self->forge, &frame);
 }
 
 static float
@@ -420,7 +420,7 @@ run (LV2_Handle instance, uint32_t n_samples)
 
        const uint32_t capacity = self->notify->atom.size;
        lv2_atom_forge_set_buffer (&self->forge, (uint8_t*)self->notify, capacity);
-       lv2_atom_forge_sequence_head (&self->forge, &self->sample, 0);
+       lv2_atom_forge_sequence_head (&self->forge, &self->frame, 0);
 
        if (!self->initialized || self->reinit_in_progress) {
                memset (self->p_ports[FS_PORT_OUT_L], 0, n_samples * sizeof (float));
@@ -569,10 +569,10 @@ run (LV2_Handle instance, uint32_t n_samples)
                self->inform_ui = false;
 
                /* emit stateChanged */
-               LV2_Atom_Forge_Frame sample;
+               LV2_Atom_Forge_Frame frame;
                lv2_atom_forge_frame_time(&self->forge, 0);
-               x_forge_object(&self->forge, &sample, 1, self->state_Changed);
-               lv2_atom_forge_pop(&self->forge, &sample);
+               x_forge_object(&self->forge, &frame, 1, self->state_Changed);
+               lv2_atom_forge_pop(&self->forge, &frame);
 
                /* send .sf2 filename */
                inform_ui (self);