21#ifndef __LS_MIDIINSTRUMENTMAPPER_H__
22#define __LS_MIDIINSTRUMENTMAPPER_H__
26#include "../../EventListeners.h"
27#include "../../common/global.h"
28#include "../../common/optional.h"
29#include "../../engines/InstrumentManager.h"
Channel Interface for LinuxSampler Sampler Engines.
Exception that will be thrown in NON REAL TIME PARTS of the LinuxSampler application.
This class is used as a listener, which is notified when the number of MIDI instruments on a particul...
This class is used as a listener, which is notified when a MIDI instrument in a MIDI instrument map i...
This class is used as a listener, which is notified when the number of MIDI instrument maps is change...
This class is used as a listener, which is notified when the settings of a MIDI instrument map are ch...
Mapping MIDI bank/program numbers with real instruments.
static int GetDefaultMap()
Gets the ID of the default map.
static void fireMidiInstrumentMapCountChanged(int NewCount)
Notifies listeners that the number of MIDI instrument maps has been changed.
static void RemoveMidiInstrumentCountListener(MidiInstrumentCountListener *l)
Removes the specified listener.
static void AddMidiInstrumentMapCountListener(MidiInstrumentMapCountListener *l)
Registers the specified listener to be notified when the number of MIDI instrument maps is changed.
static int GetMapCount()
Returns amount of currently available MIDI instrument maps.
static void AddMidiInstrumentInfoListener(MidiInstrumentInfoListener *l)
Registers the specified listener to be notified when a MIDI instrument in a MIDI instrument map is ch...
static void RemoveMap(int Map)
Delete the given map.
static entry_t GetEntry(int Map, uint MidiBank, uint MidiProg)
Gets an entry from the MIDI instrument map.
static void RemoveAllMaps()
Completely delete all existing maps.
static int GetInstrumentCount()
Returns the amount of currently available MIDI instruments in all maps.
static void AddOrReplaceEntry(int Map, midi_prog_index_t Index, entry_t Entry, bool bInBackground=false)
Adds a new entry to the given MIDI instrument map in case an entry with Index does not exist yet,...
static String MapName(int Map)
Returns the custom name of the given map.
static void fireMidiInstrumentInfoChanged(int MapId, int Bank, int Program)
Notifies listeners that a MIDI instrument in a MIDI instrument map is changed.
static void AddMidiInstrumentCountListener(MidiInstrumentCountListener *l)
Registers the specified listener to be notified when the number of MIDI instruments on a particular M...
static void RemoveAllEntries(int Map)
Clear the whole given MIDI instrument map, that is delete all its entries.
static void AddMidiInstrumentMapInfoListener(MidiInstrumentMapInfoListener *l)
Registers the specified listener to be notified when the settings of a MIDI instrument map are change...
static void RemoveMidiInstrumentMapInfoListener(MidiInstrumentMapInfoListener *l)
Removes the specified listener.
static void RemoveMidiInstrumentMapCountListener(MidiInstrumentMapCountListener *l)
Removes the specified listener.
static void RemoveMidiInstrumentInfoListener(MidiInstrumentInfoListener *l)
Removes the specified listener.
static void SetDefaultMap(int MapId)
Sets the default map.
static void fireMidiInstrumentMapInfoChanged(int MapId)
Notifies listeners that the settings of a MIDI instrument map are changed.
static void fireMidiInstrumentCountChanged(int MapId, int NewCount)
Notifies listeners that the number of MIDI instruments on the specified MIDI instrument map has been ...
static int AddMap(String MapName="")
Create a new MIDI instrument map.
static std::map< midi_prog_index_t, entry_t > Entries(int Map)
Returns the currently existing MIDI instrument map entries of the given map with their current settin...
static void RenameMap(int Map, String NewName)
Rename the given, already existing map.
static std::vector< int > Maps()
Returns the IDs of all currently existing MIDI instrument maps.
static void RemoveEntry(int Map, midi_prog_index_t Index)
Remove an existing entry from the MIDI instrument map.
mode_t
Defines the life-time strategy for an instrument.
@ ON_DEMAND
Instrument will be loaded when needed, freed once not needed anymore.
@ DONTCARE
Don't care, let it up to the InstrumentManager to decide for an appropriate LoadMode.
@ ON_DEMAND_HOLD
Instrument will be loaded when needed and kept even if not needed anymore.
@ PERSISTENT
Instrument will immediately be loaded and kept all the time.
Wraps as a kind of pointer class some data object shared with other threads, to protect / synchronize...
Defines the instrument and settings a MIDI bank MSB, LSB, program triple ought to be mapped to.
uint InstrumentIndex
Index of the instrument within its file.
String EngineName
The sampler engine to be used.
String Name
Display name that should be associated with this mapping entry.
float Volume
Global volume factor for this instrument.
String InstrumentFile
File name of the instrument to be loaded.
mode_t LoadMode
Life-time strategy of instrument.