2008-06-02 17:41:35 -04:00
|
|
|
#ifndef MIDNAM_PATCH_H_
|
|
|
|
#define MIDNAM_PATCH_H_
|
|
|
|
|
|
|
|
#include "pbd/stateful.h"
|
|
|
|
#include "midi++/event.h"
|
|
|
|
#include "pbd/xml++.h"
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <list>
|
|
|
|
#include <set>
|
|
|
|
|
|
|
|
namespace MIDI
|
|
|
|
{
|
|
|
|
|
|
|
|
namespace Name
|
|
|
|
{
|
|
|
|
|
|
|
|
class Patch : public PBD::Stateful
|
|
|
|
{
|
|
|
|
public:
|
2008-09-18 20:47:49 -04:00
|
|
|
typedef std::list<Evoral::Event> PatchMidiCommands;
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
Patch() {};
|
|
|
|
Patch(string a_number, string a_name) : _number(a_number), _name(a_name) {};
|
|
|
|
~Patch() {};
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
const string& name() const { return _name; }
|
|
|
|
void set_name(const string a_name) { _name = a_name; }
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
const string& number() const { return _number; }
|
|
|
|
void set_number(const string a_number) { _number = a_number; }
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
const PatchMidiCommands& patch_midi_commands() const { return _patch_midi_commands; }
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
XMLNode& get_state (void);
|
|
|
|
int set_state (const XMLNode& a_node);
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
private:
|
|
|
|
string _number;
|
|
|
|
string _name;
|
|
|
|
PatchMidiCommands _patch_midi_commands;
|
|
|
|
};
|
|
|
|
|
|
|
|
class PatchBank : public PBD::Stateful
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef std::list<Patch> PatchNameList;
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
PatchBank() {};
|
|
|
|
virtual ~PatchBank() {};
|
|
|
|
PatchBank(string a_name) : _name(a_name) {};
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
const string& name() const { return _name; }
|
2008-08-04 18:37:24 -04:00
|
|
|
void set_name(const string a_name) { _name = a_name; }
|
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
const PatchNameList& patch_name_list() const { return _patch_name_list; }
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
XMLNode& get_state (void);
|
|
|
|
int set_state (const XMLNode& a_node);
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
private:
|
|
|
|
string _name;
|
|
|
|
PatchNameList _patch_name_list;
|
|
|
|
};
|
|
|
|
|
|
|
|
class ChannelNameSet : public PBD::Stateful
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef std::set<uint8_t> AvailableForChannels;
|
|
|
|
typedef std::list<PatchBank> PatchBanks;
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
ChannelNameSet() {};
|
|
|
|
virtual ~ChannelNameSet() {};
|
|
|
|
ChannelNameSet(string a_name) : _name(a_name) {};
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
const string& name() const { return _name; }
|
2008-08-04 18:37:24 -04:00
|
|
|
void set_name(const string a_name) { _name = a_name; }
|
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
const AvailableForChannels& available_for_channels() const { return _available_for_channels; }
|
|
|
|
const PatchBanks& patch_banks() const { return _patch_banks; }
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
XMLNode& get_state (void);
|
|
|
|
int set_state (const XMLNode& a_node);
|
2008-08-04 18:37:24 -04:00
|
|
|
|
2008-06-02 17:41:35 -04:00
|
|
|
private:
|
|
|
|
string _name;
|
|
|
|
AvailableForChannels _available_for_channels;
|
|
|
|
PatchBanks _patch_banks;
|
|
|
|
};
|
|
|
|
|
2008-11-23 14:42:09 -05:00
|
|
|
class CustomDeviceMode : public PBD::Stateful
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CustomDeviceMode() {};
|
|
|
|
virtual ~CustomDeviceMode() {};
|
|
|
|
|
|
|
|
const string& name() const { return _name; }
|
|
|
|
void set_name(const string a_name) { _name = a_name; }
|
|
|
|
|
|
|
|
|
|
|
|
XMLNode& get_state (void);
|
|
|
|
int set_state (const XMLNode& a_node);
|
|
|
|
|
|
|
|
private:
|
|
|
|
/// array index = channel number
|
|
|
|
/// string contents = name of channel name set
|
|
|
|
string _name;
|
|
|
|
string _channel_name_set_assignments[16];
|
|
|
|
};
|
|
|
|
|
|
|
|
class MasterDeviceNames : public PBD::Stateful
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
typedef std::list<ChannelNameSet> ChannelNameSets;
|
|
|
|
typedef std::list<std::string> Models;
|
|
|
|
|
|
|
|
MasterDeviceNames() {};
|
|
|
|
virtual ~MasterDeviceNames() {};
|
|
|
|
|
|
|
|
const string& manufacturer() const { return _manufacturer; }
|
|
|
|
void set_manufacturer(const string a_manufacturer) { _manufacturer = a_manufacturer; }
|
|
|
|
|
|
|
|
const Models& models() const { return _models; }
|
|
|
|
void set_models(const Models some_models) { _models = some_models; }
|
|
|
|
|
|
|
|
XMLNode& get_state (void);
|
|
|
|
int set_state (const XMLNode& a_node);
|
|
|
|
|
|
|
|
private:
|
|
|
|
string _manufacturer;
|
|
|
|
Models _models;
|
|
|
|
ChannelNameSets _channel_name_sets;
|
|
|
|
};
|
|
|
|
|
2008-08-04 18:37:24 -04:00
|
|
|
class MIDINameDocument : public PBD::Stateful
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MIDINameDocument() {};
|
|
|
|
virtual ~MIDINameDocument() {};
|
2008-06-02 17:41:35 -04:00
|
|
|
|
2008-08-04 18:37:24 -04:00
|
|
|
XMLNode& get_state (void);
|
|
|
|
int set_state (const XMLNode& a_node);
|
|
|
|
|
|
|
|
private:
|
|
|
|
string _author;
|
|
|
|
|
|
|
|
};
|
2008-06-02 17:41:35 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-08-04 18:37:24 -04:00
|
|
|
}
|
2008-06-02 17:41:35 -04:00
|
|
|
#endif /*MIDNAM_PATCH_H_*/
|