X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=libs%2Fmidi%2B%2B2%2Fmidi%2B%2B%2Fparser.h;h=7040e9b522a6c613350d27c31f1ca12759117dec;hb=d3b341d5c242755d4fa69463d36c78f861856045;hp=44897f9d8e1a9046ef62eb8a9497c67e274ef16b;hpb=d074bc586e494d7dd83d415a487195a477095a4f;p=ardour.git diff --git a/libs/midi++2/midi++/parser.h b/libs/midi++2/midi++/parser.h index 44897f9d8e..7040e9b522 100644 --- a/libs/midi++2/midi++/parser.h +++ b/libs/midi++2/midi++/parser.h @@ -1,6 +1,6 @@ /* Copyright (C) 1998 Paul Barton-Davis - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or @@ -25,6 +25,7 @@ #include "pbd/signals.h" +#include "midi++/libmidi_visibility.h" #include "midi++/types.h" namespace MIDI { @@ -33,13 +34,16 @@ class Port; class Parser; typedef PBD::Signal1 ZeroByteSignal; +typedef PBD::Signal2 BankSignal; typedef PBD::Signal2 TimestampedSignal; typedef PBD::Signal2 OneByteSignal; typedef PBD::Signal2 TwoByteSignal; typedef PBD::Signal2 PitchBendSignal; +typedef PBD::Signal3 RPNSignal; +typedef PBD::Signal3 RPNValueSignal; typedef PBD::Signal3 Signal; -class Parser { +class LIBMIDIPP_API Parser { public: Parser (); ~Parser (); @@ -48,13 +52,13 @@ class Parser { message the next time ::scanner() parses such a message. It should 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; } + void set_timestamp (const framecnt_t timestamp) { _timestamp = timestamp; } /* signals that anyone can connect to */ - - OneByteSignal bank_change; + + BankSignal bank_change; TwoByteSignal note_on; TwoByteSignal note_off; TwoByteSignal poly_pressure; @@ -63,7 +67,7 @@ class Parser { PitchBendSignal pitchbend; TwoByteSignal controller; - OneByteSignal channel_bank_change[16]; + BankSignal channel_bank_change[16]; TwoByteSignal channel_note_on[16]; TwoByteSignal channel_note_off[16]; TwoByteSignal channel_poly_pressure[16]; @@ -73,6 +77,10 @@ class Parser { TwoByteSignal channel_controller[16]; ZeroByteSignal channel_active_preparse[16]; ZeroByteSignal channel_active_postparse[16]; + RPNValueSignal channel_rpn[16]; + RPNValueSignal channel_nrpn[16]; + RPNSignal channel_rpn_change[16]; + RPNSignal channel_nrpn_change[16]; OneByteSignal mtc_quarter_frame; /* see below for more useful signals */ Signal mtc; @@ -122,7 +130,7 @@ class Parser { MTC_Status mtc_running() const { return _mtc_running; } const byte *mtc_current() const { return _mtc_time; } bool mtc_locked() const { return _mtc_locked; } - + PBD::Signal3 mtc_qtr; PBD::Signal3 mtc_time; PBD::Signal1 mtc_status; @@ -133,10 +141,10 @@ class Parser { } void reset_mtc_state (); - + private: /* tracing */ - + std::ostream *trace_stream; std::string trace_prefix; void trace_event (Parser &p, byte *msg, size_t len); @@ -144,7 +152,7 @@ class Parser { size_t message_counter[256]; - enum ParseState { + enum ParseState { NEEDSTATUS, NEEDONEBYTE, NEEDTWOBYTES, @@ -169,7 +177,7 @@ class Parser { MTC_Status _mtc_running; bool _mtc_locked; byte last_qtr_frame; - + framecnt_t _timestamp; ParseState pre_variable_state;