/[svn]/linuxsampler/trunk/src/drivers/midi/MidiInstrumentMapper.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/drivers/midi/MidiInstrumentMapper.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 973 by schoenebeck, Fri Dec 15 21:40:27 2006 UTC revision 1135 by iliev, Thu Mar 29 09:40:45 2007 UTC
# Line 21  Line 21 
21  #ifndef __LS_MIDIINSTRUMENTMAPPER_H__  #ifndef __LS_MIDIINSTRUMENTMAPPER_H__
22  #define __LS_MIDIINSTRUMENTMAPPER_H__  #define __LS_MIDIINSTRUMENTMAPPER_H__
23    
24    #include <map>
25    
26    #include "midi.h"
27    #include "../../EventListeners.h"
28  #include "../../common/global.h"  #include "../../common/global.h"
29  #include "../../common/optional.h"  #include "../../common/optional.h"
 #include "midi.h"  
30  #include "../../engines/InstrumentManager.h"  #include "../../engines/InstrumentManager.h"
31    
 #include <map>  
   
32  namespace LinuxSampler {  namespace LinuxSampler {
33    
34      // just symbol prototyping      // just symbol prototyping
# Line 72  namespace LinuxSampler { Line 73  namespace LinuxSampler {
73              };              };
74    
75              /**              /**
76                 * Registers the specified listener to be notified when the number
77                 * of MIDI instruments on a particular MIDI instrument map is changed.
78                 */
79                static void AddMidiInstrumentCountListener(MidiInstrumentCountListener* l);
80    
81                /**
82                 * Removes the specified listener.
83                 */
84                static void RemoveMidiInstrumentCountListener(MidiInstrumentCountListener* l);
85    
86                /**
87                 * Registers the specified listener to be notified when
88                 * a MIDI instrument in a MIDI instrument map is changed.
89                 */
90                static void AddMidiInstrumentInfoListener(MidiInstrumentInfoListener* l);
91    
92                /**
93                 * Removes the specified listener.
94                 */
95                static void RemoveMidiInstrumentInfoListener(MidiInstrumentInfoListener* l);
96    
97                /**
98                 * Registers the specified listener to be notified
99                 * when the number of MIDI instrument maps is changed.
100                 */
101                static void AddMidiInstrumentMapCountListener(MidiInstrumentMapCountListener* l);
102    
103                /**
104                 * Removes the specified listener.
105                 */
106                static void RemoveMidiInstrumentMapCountListener(MidiInstrumentMapCountListener* l);
107    
108                /**
109                 * Registers the specified listener to be notified when
110                 * the settings of a MIDI instrument map are changed.
111                 */
112                static void AddMidiInstrumentMapInfoListener(MidiInstrumentMapInfoListener* l);
113    
114                /**
115                 * Removes the specified listener.
116                 */
117                static void RemoveMidiInstrumentMapInfoListener(MidiInstrumentMapInfoListener* l);
118    
119                /**
120               * Adds a new entry to the given MIDI instrument map in case               * Adds a new entry to the given MIDI instrument map in case
121               * an entry with \a Index does not exist yet, otherwise it will               * an entry with \a Index does not exist yet, otherwise it will
122               * replace the existing entry. Note that some given settings               * replace the existing entry. Note that some given settings
# Line 168  namespace LinuxSampler { Line 213  namespace LinuxSampler {
213               */               */
214              static void RemoveAllMaps();              static void RemoveAllMaps();
215    
216                static int GetMapCount();
217    
218                /**
219                 * Gets the ID of the default map.
220                 * For now, the default map is the first available map. When
221                 * the default map is removed, the default map becomes the next available map.
222                 * @return The ID of the default map or -1 if the there are no maps added.
223                 */
224                static int GetDefaultMap();
225    
226                /**
227                 * Sets the default map.
228                 * @param MapId The ID of the new default map.
229                 */
230                static void SetDefaultMap(int MapId);
231    
232          protected:          protected:
233                /**
234                 * Notifies listeners that the number of MIDI instruments
235                 * on the specified MIDI instrument map has been changed.
236                 * @param MapId The numerical ID of the MIDI instrument map.
237                 * @param NewCount The new number of MIDI instruments.
238                 */
239                static void fireMidiInstrumentCountChanged(int MapId, int NewCount);
240    
241                /**
242                 * Notifies listeners that a MIDI instrument
243                 * in a MIDI instrument map is changed.
244                 * @param MapId The numerical ID of the MIDI instrument map.
245                 * @param Bank The index of the MIDI bank, containing the instrument.
246                 * @param Program The MIDI program number of the instrument.
247                 */
248                static void fireMidiInstrumentInfoChanged(int MapId, int Bank, int Program);
249    
250                 /**
251                 * Notifies listeners that the number of MIDI instrument maps has been changed.
252                 * @param NewCount The new number of MIDI instrument maps.
253                 */
254                static void fireMidiInstrumentMapCountChanged(int NewCount);
255    
256                /**
257                 * Notifies listeners that the settings of a MIDI instrument map are changed.
258                 */
259                static void fireMidiInstrumentMapInfoChanged(int MapId);
260    
261              static optional<entry_t> GetEntry(int Map, midi_prog_index_t Index); // shall only be used by MidiInputPort ATM (see source comment)              static optional<entry_t> GetEntry(int Map, midi_prog_index_t Index); // shall only be used by MidiInputPort ATM (see source comment)
262              friend class MidiInputPort; // allow MidiInputPort to access GetEntry()              friend class MidiInputPort; // allow MidiInputPort to access GetEntry()
263    
264            private:
265                static ListenerList<MidiInstrumentCountListener*> llMidiInstrumentCountListeners;
266                static ListenerList<MidiInstrumentInfoListener*> llMidiInstrumentInfoListeners;
267                static ListenerList<MidiInstrumentMapCountListener*> llMidiInstrumentMapCountListeners;
268                static ListenerList<MidiInstrumentMapInfoListener*> llMidiInstrumentMapInfoListeners;
269                
270                static int DefaultMap;
271      };      };
272    
273  } // namespace LinuxSampler  } // namespace LinuxSampler

Legend:
Removed from v.973  
changed lines
  Added in v.1135

  ViewVC Help
Powered by ViewVC