Ardour  9.0-pre0-582-g084a23a80d
midiinvokable.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2010-2015 Paul Davis <paul@linuxaudiosystems.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #ifndef __gm_midiinvokable_h__
20 #define __gm_midiinvokable_h__
21 
22 #include <string>
23 
24 #include "midi++/types.h"
25 
26 #include "pbd/signals.h"
27 #include "pbd/stateful.h"
28 
29 #include "ardour/types.h"
30 
31 namespace MIDI {
32  class Channel;
33  class Parser;
34 }
35 
37 
39 {
40  public:
42  virtual ~MIDIInvokable ();
43 
44  virtual int init (GenericMidiControlProtocol&, const std::string&, MIDI::byte* data = 0, size_t dsize = 0);
45 
47 
52 
53  protected:
55  std::string _invokable_name;
62  size_t data_size;
64 
72 
73  virtual void execute () = 0;
74 };
75 
76 #endif // __gm_midicontrollable_h__
77 
void midi_sense_any(MIDI::Parser &, MIDI::byte *, size_t)
size_t data_size
Definition: midiinvokable.h:62
MIDI::byte control_additional
Definition: midiinvokable.h:59
virtual int init(GenericMidiControlProtocol &, const std::string &, MIDI::byte *data=0, size_t dsize=0)
MIDI::Parser & _parser
Definition: midiinvokable.h:56
MIDI::channel_t get_control_channel()
Definition: midiinvokable.h:49
MIDI::byte * data
Definition: midiinvokable.h:61
virtual ~MIDIInvokable()
void midi_sense_program_change(MIDI::Parser &, MIDI::byte)
MIDI::channel_t control_channel
Definition: midiinvokable.h:60
void midi_sense_controller(MIDI::Parser &, MIDI::EventTwoBytes *)
GenericMidiControlProtocol * _ui
Definition: midiinvokable.h:54
void midi_sense_note_on(MIDI::Parser &p, MIDI::EventTwoBytes *tb)
void midi_sense_sysex(MIDI::Parser &, MIDI::byte *, size_t)
virtual void execute()=0
std::string _invokable_name
Definition: midiinvokable.h:55
MIDI::Parser & get_parser()
Definition: midiinvokable.h:46
MIDIInvokable(MIDI::Parser &)
MIDI::eventType control_type
Definition: midiinvokable.h:58
void midi_sense_note_off(MIDI::Parser &p, MIDI::EventTwoBytes *tb)
MIDI::eventType get_control_type()
Definition: midiinvokable.h:50
void midi_sense_note(MIDI::Parser &, MIDI::EventTwoBytes *, bool is_on)
void bind_midi(MIDI::channel_t, MIDI::eventType, MIDI::byte)
PBD::ScopedConnection midi_sense_connection[2]
Definition: midiinvokable.h:57
MIDI::byte get_control_additional()
Definition: midiinvokable.h:51