Ardour  9.0-pre0-384-ga76afae0e9
midifunction.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2009-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_midifunction_h__
20 #define __gm_midifunction_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 #include "midiinvokable.h"
32 
33 namespace MIDI {
34  class Channel;
35  class Parser;
36 }
37 
39 
41 {
42  public:
43  enum Function {
55  /* 1 argument functions: RID, bank relative */
61  /* 2 argument functions: RID, value */
67  };
68 
70  virtual ~MIDIFunction ();
71 
72  int setup (GenericMidiControlProtocol&, const std::string& function_name, const std::string& argument, MIDI::byte* sysex = 0, size_t ssize = 0);
73 
74  const std::string& function_name() const { return _invokable_name; }
75 
76  XMLNode& get_state () const;
77  int set_state (const XMLNode&, int version);
78 
79  private:
81  std::string _argument;
82  void execute ();
83 };
84 
85 #endif // __gm_midicontrollable_h__
86 
int setup(GenericMidiControlProtocol &, const std::string &function_name, const std::string &argument, MIDI::byte *sysex=0, size_t ssize=0)
Function _function
Definition: midifunction.h:80
int set_state(const XMLNode &, int version)
MIDIFunction(MIDI::Parser &)
@ TrackSetRecordEnable
Definition: midifunction.h:65
@ TransportRecordToggle
Definition: midifunction.h:52
@ TransportRecordDisable
Definition: midifunction.h:54
@ TransportRecordEnable
Definition: midifunction.h:53
XMLNode & get_state() const
void execute()
std::string _argument
Definition: midifunction.h:81
const std::string & function_name() const
Definition: midifunction.h:74
virtual ~MIDIFunction()
std::string _invokable_name
Definition: midiinvokable.h:55
Definition: xml++.h:114