2009-12-28 15:52:13 -05:00
|
|
|
/*
|
2019-08-03 08:34:29 -04:00
|
|
|
* Copyright (C) 2009-2015 Paul Davis <paul@linuxaudiosystems.com>
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along
|
|
|
|
* with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
*/
|
2009-12-28 15:52:13 -05:00
|
|
|
|
|
|
|
#ifndef __gm_midifunction_h__
|
|
|
|
#define __gm_midifunction_h__
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "midi++/types.h"
|
|
|
|
|
|
|
|
#include "pbd/signals.h"
|
|
|
|
#include "pbd/stateful.h"
|
|
|
|
|
|
|
|
#include "ardour/types.h"
|
|
|
|
|
2010-04-08 17:05:55 -04:00
|
|
|
#include "midiinvokable.h"
|
|
|
|
|
2009-12-28 15:52:13 -05:00
|
|
|
namespace MIDI {
|
|
|
|
class Channel;
|
|
|
|
class Parser;
|
|
|
|
}
|
|
|
|
|
2009-12-29 16:31:14 -05:00
|
|
|
class GenericMidiControlProtocol;
|
2009-12-28 15:52:13 -05:00
|
|
|
|
2010-04-08 17:05:55 -04:00
|
|
|
class MIDIFunction : public MIDIInvokable
|
2009-12-28 15:52:13 -05:00
|
|
|
{
|
|
|
|
public:
|
2015-10-04 14:51:05 -04:00
|
|
|
enum Function {
|
2009-12-29 16:31:14 -05:00
|
|
|
NextBank,
|
|
|
|
PrevBank,
|
2009-12-28 15:52:13 -05:00
|
|
|
TransportRoll,
|
|
|
|
TransportStop,
|
|
|
|
TransportZero,
|
|
|
|
TransportStart,
|
2009-12-28 18:55:33 -05:00
|
|
|
TransportEnd,
|
|
|
|
TransportLoopToggle,
|
2016-01-14 17:37:47 -05:00
|
|
|
TransportRecordToggle,
|
2009-12-28 18:55:33 -05:00
|
|
|
TransportRecordEnable,
|
2011-08-13 12:27:29 -04:00
|
|
|
TransportRecordDisable,
|
2011-08-14 13:11:33 -04:00
|
|
|
/* 1 argument functions: RID */
|
2011-08-13 12:27:29 -04:00
|
|
|
Select,
|
2012-06-25 15:26:00 -04:00
|
|
|
SetBank,
|
2011-08-14 13:11:33 -04:00
|
|
|
/* 2 argument functions: RID, value */
|
2015-10-04 14:51:05 -04:00
|
|
|
TrackSetSolo,
|
2011-08-14 13:11:33 -04:00
|
|
|
TrackSetMute,
|
|
|
|
TrackSetGain,
|
|
|
|
TrackSetRecordEnable,
|
|
|
|
TrackSetSoloIsolate,
|
2009-12-28 15:52:13 -05:00
|
|
|
};
|
|
|
|
|
2013-08-07 22:22:11 -04:00
|
|
|
MIDIFunction (MIDI::Parser&);
|
2009-12-28 15:52:13 -05:00
|
|
|
virtual ~MIDIFunction ();
|
|
|
|
|
2011-08-13 12:27:29 -04:00
|
|
|
int setup (GenericMidiControlProtocol&, const std::string& function_name, const std::string& argument, MIDI::byte* sysex = 0, size_t ssize = 0);
|
2009-12-28 15:52:13 -05:00
|
|
|
|
2010-04-08 17:05:55 -04:00
|
|
|
const std::string& function_name() const { return _invokable_name; }
|
2009-12-28 15:52:13 -05:00
|
|
|
|
|
|
|
XMLNode& get_state (void);
|
|
|
|
int set_state (const XMLNode&, int version);
|
|
|
|
|
|
|
|
private:
|
|
|
|
Function _function;
|
2011-08-13 12:27:29 -04:00
|
|
|
std::string _argument;
|
2009-12-28 15:52:13 -05:00
|
|
|
void execute ();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __gm_midicontrollable_h__
|
|
|
|
|