diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2017-09-18 12:39:17 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2017-09-18 12:39:17 -0400 |
commit | 30b087ab3d28f1585987fa3f6ae006562ae192e3 (patch) | |
tree | 620ae0250b5d77f90a18f8c2b83be61e4fe7b0b5 /libs/midi++2 | |
parent | cb956e3e480716a3efd280a5287bdd7bee1cedc5 (diff) |
globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
Diffstat (limited to 'libs/midi++2')
-rw-r--r-- | libs/midi++2/channel.cc | 2 | ||||
-rw-r--r-- | libs/midi++2/ipmidi_port.cc | 2 | ||||
-rw-r--r-- | libs/midi++2/midi++/channel.h | 2 | ||||
-rw-r--r-- | libs/midi++2/midi++/ipmidi_port.h | 2 | ||||
-rw-r--r-- | libs/midi++2/midi++/mmc.h | 2 | ||||
-rw-r--r-- | libs/midi++2/midi++/parser.h | 16 | ||||
-rw-r--r-- | libs/midi++2/midi++/port.h | 4 | ||||
-rw-r--r-- | libs/midi++2/midi++/types.h | 2 | ||||
-rw-r--r-- | libs/midi++2/mtc.cc | 48 |
9 files changed, 40 insertions, 40 deletions
diff --git a/libs/midi++2/channel.cc b/libs/midi++2/channel.cc index f29673722d..551fbfd9a3 100644 --- a/libs/midi++2/channel.cc +++ b/libs/midi++2/channel.cc @@ -53,7 +53,7 @@ Channel::connect_signals () } void -Channel::reset (timestamp_t timestamp, framecnt_t /*nframes*/, bool notes_off) +Channel::reset (timestamp_t timestamp, samplecnt_t /*nframes*/, bool notes_off) { _program_number = _channel_number; _bank_number = 0; diff --git a/libs/midi++2/ipmidi_port.cc b/libs/midi++2/ipmidi_port.cc index fd5cb9a239..26bc0a324e 100644 --- a/libs/midi++2/ipmidi_port.cc +++ b/libs/midi++2/ipmidi_port.cc @@ -319,7 +319,7 @@ IPMIDIPort::read (MIDI::byte* /*buf*/, size_t /*bufsize*/) } void -IPMIDIPort::parse (framecnt_t timestamp) +IPMIDIPort::parse (samplecnt_t timestamp) { /* input was detected on the socket, so go get it and hand it to the * parser. This will emit appropriate signals that will be handled diff --git a/libs/midi++2/midi++/channel.h b/libs/midi++2/midi++/channel.h index 6bd08073b3..ba95958d26 100644 --- a/libs/midi++2/midi++/channel.h +++ b/libs/midi++2/midi++/channel.h @@ -165,7 +165,7 @@ class LIBMIDIPP_API Channel : public PBD::ScopedConnectionList { RPNList rpns; RPNList nrpns; - void reset (timestamp_t timestamp, framecnt_t nframes, bool notes_off = true); + void reset (timestamp_t timestamp, samplecnt_t nframes, bool notes_off = true); void process_note_off (Parser &, EventTwoBytes *); void process_note_on (Parser &, EventTwoBytes *); diff --git a/libs/midi++2/midi++/ipmidi_port.h b/libs/midi++2/midi++/ipmidi_port.h index 8cefe09a40..d5a740f5a4 100644 --- a/libs/midi++2/midi++/ipmidi_port.h +++ b/libs/midi++2/midi++/ipmidi_port.h @@ -66,7 +66,7 @@ class LIBMIDIPP_API IPMIDIPort : public Port { int write (const byte *msg, size_t msglen, timestamp_t timestamp); int read (byte *buf, size_t bufsize); - void parse (framecnt_t timestamp); + void parse (samplecnt_t timestamp); int selectable () const; static const int lowest_ipmidi_port_default = 21928; diff --git a/libs/midi++2/midi++/mmc.h b/libs/midi++2/midi++/mmc.h index caf1605c29..bd8c19b6f9 100644 --- a/libs/midi++2/midi++/mmc.h +++ b/libs/midi++2/midi++/mmc.h @@ -178,7 +178,7 @@ class LIBMIDIPP_API MachineControl /* The second argument points to a byte array containing the locate target value in MMC Standard Time Code - format (5 bytes, roughly: hrs/mins/secs/frames/subframes) + format (5 bytes, roughly: hrs/mins/secs/samples/subframes) */ PBD::Signal2<void,MachineControl &, const byte *> Locate; diff --git a/libs/midi++2/midi++/parser.h b/libs/midi++2/midi++/parser.h index 7040e9b522..3b1dd47052 100644 --- a/libs/midi++2/midi++/parser.h +++ b/libs/midi++2/midi++/parser.h @@ -35,7 +35,7 @@ class Parser; typedef PBD::Signal1<void,Parser&> ZeroByteSignal; typedef PBD::Signal2<void,Parser&,unsigned short> BankSignal; -typedef PBD::Signal2<void,Parser&,framecnt_t> TimestampedSignal; +typedef PBD::Signal2<void,Parser&,samplecnt_t> TimestampedSignal; typedef PBD::Signal2<void,Parser&, byte> OneByteSignal; typedef PBD::Signal2<void,Parser &, EventTwoBytes *> TwoByteSignal; typedef PBD::Signal2<void,Parser &, pitchbend_t> PitchBendSignal; @@ -53,8 +53,8 @@ class LIBMIDIPP_API Parser { therefore be set before every byte passed into ::scanner(). */ - framecnt_t get_timestamp() const { return _timestamp; } - void set_timestamp (const framecnt_t timestamp) { _timestamp = timestamp; } + samplecnt_t get_timestamp() const { return _timestamp; } + void set_timestamp (const samplecnt_t timestamp) { _timestamp = timestamp; } /* signals that anyone can connect to */ @@ -131,8 +131,8 @@ class LIBMIDIPP_API Parser { const byte *mtc_current() const { return _mtc_time; } bool mtc_locked() const { return _mtc_locked; } - PBD::Signal3<void, Parser &, int, framecnt_t> mtc_qtr; - PBD::Signal3<void, const byte *, bool, framecnt_t> mtc_time; + PBD::Signal3<void, Parser &, int, samplecnt_t> mtc_qtr; + PBD::Signal3<void, const byte *, bool, samplecnt_t> mtc_time; PBD::Signal1<void, MTC_Status> mtc_status; PBD::Signal0<bool> mtc_skipped; @@ -172,13 +172,13 @@ class LIBMIDIPP_API Parser { int expected_mtc_quarter_frame_code; byte _mtc_time[5]; byte _qtr_mtc_time[5]; - unsigned long consecutive_qtr_frame_cnt; + unsigned long consecutive_qtr_sample_cnt; MTC_FPS _mtc_fps; MTC_Status _mtc_running; bool _mtc_locked; - byte last_qtr_frame; + byte last_qtr_sample; - framecnt_t _timestamp; + samplecnt_t _timestamp; ParseState pre_variable_state; MIDI::eventType pre_variable_msgtype; diff --git a/libs/midi++2/midi++/port.h b/libs/midi++2/midi++/port.h index 02cc340194..049d3a0a92 100644 --- a/libs/midi++2/midi++/port.h +++ b/libs/midi++2/midi++/port.h @@ -57,7 +57,7 @@ class LIBMIDIPP_API Port { /** Write a message to port. * @param msg Raw MIDI message to send * @param msglen Size of @a msg - * @param timestamp Time stamp in frames of this message (relative to cycle start) + * @param timestamp Time stamp in samples of this message (relative to cycle start) * @return number of bytes successfully written */ virtual int write (const byte *msg, size_t msglen, timestamp_t timestamp) = 0; @@ -85,7 +85,7 @@ class LIBMIDIPP_API Port { return !(write (msg, len, timestamp) == (int) len); } - virtual void parse (framecnt_t timestamp) = 0; + virtual void parse (samplecnt_t timestamp) = 0; bool clock (timestamp_t timestamp); diff --git a/libs/midi++2/midi++/types.h b/libs/midi++2/midi++/types.h index c29ce1c767..8bcf36946f 100644 --- a/libs/midi++2/midi++/types.h +++ b/libs/midi++2/midi++/types.h @@ -33,7 +33,7 @@ namespace MIDI { typedef uint32_t timestamp_t; /** XXX: dupes from libardour */ - typedef int64_t framecnt_t; + typedef int64_t samplecnt_t; typedef uint32_t pframes_t; enum eventType { diff --git a/libs/midi++2/mtc.cc b/libs/midi++2/mtc.cc index 7f7506c344..8aa7556e46 100644 --- a/libs/midi++2/mtc.cc +++ b/libs/midi++2/mtc.cc @@ -46,7 +46,7 @@ Parser::possible_mtc (MIDI::byte *sysex_buf, size_t msglen) /* full MTC */ - fake_mtc_time[0] = sysex_buf[8]; // frames + fake_mtc_time[0] = sysex_buf[8]; // samples fake_mtc_time[1] = sysex_buf[7]; // minutes fake_mtc_time[2] = sysex_buf[6]; // seconds fake_mtc_time[3] = (sysex_buf[5] & 0x1f); // hours @@ -86,8 +86,8 @@ Parser::reset_mtc_state () expected_mtc_quarter_frame_code = 0; memset (_mtc_time, 0, sizeof (_mtc_time)); memset (_qtr_mtc_time, 0, sizeof (_mtc_time)); - consecutive_qtr_frame_cnt = 0; - last_qtr_frame = 0; + consecutive_qtr_sample_cnt = 0; + last_qtr_sample = 0; } void @@ -95,46 +95,46 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg) { int which_quarter_frame = (msg[1] & 0xf0) >> 4; - /* Is it an expected frame? - Remember, the first can be frame 7 or frame 0, + /* Is it an expected sample? + Remember, the first can be sample 7 or sample 0, depending on the direction of the MTC generator ... */ #ifdef DEBUG_MTC cerr << "MTC: (state = " << _mtc_running << ") " << which_quarter_frame << " vs. " << expected_mtc_quarter_frame_code - << " consecutive ? " << consecutive_qtr_frame_cnt + << " consecutive ? " << consecutive_qtr_sample_cnt << endl; #endif if (_mtc_running == MTC_Stopped) { - /* we are stopped but are seeing qtr frame messages */ + /* we are stopped but are seeing qtr sample messages */ - if (consecutive_qtr_frame_cnt == 0) { + if (consecutive_qtr_sample_cnt == 0) { /* first quarter frame */ if (which_quarter_frame != 0 && which_quarter_frame != 7) { - last_qtr_frame = which_quarter_frame; - consecutive_qtr_frame_cnt++; + last_qtr_sample = which_quarter_frame; + consecutive_qtr_sample_cnt++; } - // cerr << "first seen qframe = " << (int) last_qtr_frame << endl; + // cerr << "first seen qframe = " << (int) last_qtr_sample << endl; return; - } else if (consecutive_qtr_frame_cnt == 1) { + } else if (consecutive_qtr_sample_cnt == 1) { /* third quarter frame */ #ifdef DEBUG_MTC cerr << "second seen qframe = " << (int) which_quarter_frame << endl; #endif - if (last_qtr_frame < which_quarter_frame) { + if (last_qtr_sample < which_quarter_frame) { _mtc_running = MTC_Forward; - } else if (last_qtr_frame > which_quarter_frame) { + } else if (last_qtr_sample > which_quarter_frame) { _mtc_running = MTC_Backward; } #ifdef DEBUG_MTC @@ -174,7 +174,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg) if (which_quarter_frame != expected_mtc_quarter_frame_code) { - consecutive_qtr_frame_cnt = 0; + consecutive_qtr_sample_cnt = 0; #ifdef DEBUG_MTC cerr << "MTC: (state = " << _mtc_running << ") " @@ -189,7 +189,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg) if (res.get_value_or (false)) { - /* no error, reset next expected frame */ + /* no error, reset next expected sample */ switch (_mtc_running) { case MTC_Forward: @@ -219,10 +219,10 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg) return; } - /* skip counts as an error ... go back to waiting for the first frame */ + /* skip counts as an error ... go back to waiting for the first sample */ #ifdef DEBUG_MTC - cerr << "Skipped MTC qtr frame, return to stopped state" << endl; + cerr << "Skipped MTC qtr sample, return to stopped state" << endl; #endif reset_mtc_state (); mtc_status (MTC_Stopped); @@ -231,8 +231,8 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg) } else { - /* received qtr frame matched expected */ - consecutive_qtr_frame_cnt++; + /* received qtr sample matched expected */ + consecutive_qtr_sample_cnt++; } } @@ -244,11 +244,11 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg) #endif switch (which_quarter_frame) { - case 0: // frames LS nibble + case 0: // samples LS nibble _qtr_mtc_time[0] |= msg[1] & 0xf; break; - case 1: // frames MS nibble + case 1: // samples MS nibble _qtr_mtc_time[0] |= (msg[1] & 0xf)<<4; break; @@ -307,7 +307,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg) and signal anyone who wants to know the time. */ - if (consecutive_qtr_frame_cnt >= 8) { + if (consecutive_qtr_sample_cnt >= 8) { memcpy (_mtc_time, _qtr_mtc_time, sizeof (_mtc_time)); memset (_qtr_mtc_time, 0, sizeof (_qtr_mtc_time)); if (!_mtc_locked) { @@ -331,7 +331,7 @@ Parser::process_mtc_quarter_frame (MIDI::byte *msg) and signal anyone who wants to know the time. */ - if (consecutive_qtr_frame_cnt >= 8) { + if (consecutive_qtr_sample_cnt >= 8) { memcpy (_mtc_time, _qtr_mtc_time, sizeof (_mtc_time)); memset (_qtr_mtc_time, 0, sizeof (_qtr_mtc_time)); if (!_mtc_locked) { |