/[svn]/linuxsampler/trunk/src/engines/EngineChannel.h
ViewVC logotype

Diff of /linuxsampler/trunk/src/engines/EngineChannel.h

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

revision 2121 by schoenebeck, Tue Sep 14 17:09:08 2010 UTC revision 3697 by schoenebeck, Sat Jan 4 12:09:45 2020 UTC
# Line 1  Line 1 
1  /***************************************************************************  /***************************************************************************
2   *                                                                         *   *                                                                         *
3   *   Copyright (C) 2005 - 2010 Christian Schoenebeck                       *   *   Copyright (C) 2005 - 2020 Christian Schoenebeck                       *
4   *                                                                         *   *                                                                         *
5   *   This program is free software; you can redistribute it and/or modify  *   *   This program is free software; you can redistribute it and/or modify  *
6   *   it under the terms of the GNU General Public License as published by  *   *   it under the terms of the GNU General Public License as published by  *
# Line 58  namespace LinuxSampler { Line 58  namespace LinuxSampler {
58              // abstract methods              // abstract methods
59              //     (these have to be implemented by the descendant)              //     (these have to be implemented by the descendant)
60    
61              virtual void    PrepareLoadInstrument(const char* FileName, uint Instrument) = 0;              // general sampler part management
             virtual void    LoadInstrument() = 0;  
62              virtual void    Reset() = 0;              virtual void    Reset() = 0;
63              virtual void    SendNoteOn(uint8_t Key, uint8_t Velocity) = 0;              virtual void    SendNoteOn(uint8_t Key, uint8_t Velocity, uint8_t MidiChannel) = 0;
64              virtual void    SendNoteOn(uint8_t Key, uint8_t Velocity, int32_t FragmentPos) = 0;              virtual void    SendNoteOn(uint8_t Key, uint8_t Velocity, uint8_t MidiChannel, int32_t FragmentPos) = 0;
65              virtual void    SendNoteOff(uint8_t Key, uint8_t Velocity) = 0;              virtual void    SendNoteOff(uint8_t Key, uint8_t Velocity, uint8_t MidiChannel) = 0;
66              virtual void    SendNoteOff(uint8_t Key, uint8_t Velocity, int32_t FragmentPos) = 0;              virtual void    SendNoteOff(uint8_t Key, uint8_t Velocity, uint8_t MidiChannel, int32_t FragmentPos) = 0;
67              virtual void    SendPitchbend(int Pitch) = 0;              virtual void    SendPitchbend(int Pitch, uint8_t MidiChannel) = 0;
68              virtual void    SendPitchbend(int Pitch, int32_t FragmentPos) = 0;              virtual void    SendPitchbend(int Pitch, uint8_t MidiChannel, int32_t FragmentPos) = 0;
69              virtual void    SendControlChange(uint8_t Controller, uint8_t Value) = 0;              virtual void    SendControlChange(uint8_t Controller, uint8_t Value, uint8_t MidiChannel) = 0;
70              virtual void    SendControlChange(uint8_t Controller, uint8_t Value, int32_t FragmentPos) = 0;              virtual void    SendControlChange(uint8_t Controller, uint8_t Value, uint8_t MidiChannel, int32_t FragmentPos) = 0;
71              virtual void    SendProgramChange(uint8_t Program) = 0;              virtual void    SendProgramChange(uint8_t Program) = 0;
72                virtual void    SendChannelPressure(uint8_t Value, uint8_t MidiChannel) = 0;
73                virtual void    SendChannelPressure(uint8_t Value, uint8_t MidiChannel, int32_t FragmentPos) = 0;
74                virtual void    SendPolyphonicKeyPressure(uint8_t Key, uint8_t Value, uint8_t MidiChannel) = 0;
75                virtual void    SendPolyphonicKeyPressure(uint8_t Key, uint8_t Value, uint8_t MidiChannel, int32_t FragmentPos) = 0;
76              virtual bool    StatusChanged(bool bNewStatus = false) = 0;              virtual bool    StatusChanged(bool bNewStatus = false) = 0;
77              virtual float   Volume() = 0;              virtual float   Volume() = 0;
78              virtual void    Volume(float f) = 0;              virtual void    Volume(float f) = 0;
79              virtual float   Pan() = 0;              virtual float   Pan() = 0;
80              virtual void    Pan(float f) = 0;              virtual void    Pan(float f) = 0;
81              virtual uint    Channels() = 0;              virtual uint    Channels() = 0;
82    
83                // audio driver management
84              virtual void    Connect(AudioOutputDevice* pAudioOut) = 0;              virtual void    Connect(AudioOutputDevice* pAudioOut) = 0;
85              virtual void    DisconnectAudioOutputDevice() = 0;              virtual void    DisconnectAudioOutputDevice() = 0;
86              virtual AudioOutputDevice* GetAudioOutputDevice() = 0;              virtual AudioOutputDevice* GetAudioOutputDevice() = 0;
87              virtual void    SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) = 0;              virtual void    SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) = 0;
88              virtual int     OutputChannel(uint EngineAudioChannel) = 0;              virtual int     OutputChannel(uint EngineAudioChannel) = 0;
89              virtual void    Connect(MidiInputPort* pMidiPort, midi_chan_t MidiChannel) = 0;  
90              virtual void    DisconnectMidiInputPort() = 0;              // MIDI driver management
91              virtual MidiInputPort* GetMidiInputPort() = 0;              virtual void    Connect(MidiInputPort* pMidiPort) = 0;
92                virtual void    Disconnect(MidiInputPort* pMidiPort) = 0;
93                virtual void    DisconnectAllMidiInputPorts() = 0;
94                virtual uint    GetMidiInputPortCount() = 0;
95                virtual MidiInputPort* GetMidiInputPort(uint index) = 0;
96              virtual midi_chan_t MidiChannel() = 0;              virtual midi_chan_t MidiChannel() = 0;
97              virtual String  InstrumentFileName() = 0;              virtual void    SetMidiChannel(midi_chan_t MidiChannel) = 0;
98                // (deprecated MIDI driver management methods)
99                virtual void    Connect(MidiInputPort* pMidiPort, midi_chan_t MidiChannel) DEPRECATED_API = 0;
100                virtual void    DisconnectMidiInputPort() DEPRECATED_API = 0;
101                virtual MidiInputPort* GetMidiInputPort() DEPRECATED_API = 0;
102    
103                // virtual MIDI driver management (i.e. virtual on-screen MIDI keyboards)
104                virtual void    Connect(VirtualMidiDevice* pDevice) = 0;
105                virtual void    Disconnect(VirtualMidiDevice* pDevice) = 0;
106    
107                // instrument (sound file) management
108                virtual void    PrepareLoadInstrument(const char* FileName, uint Instrument) = 0;
109                virtual void    LoadInstrument() = 0;
110                virtual String  InstrumentFileName() = 0; ///< Returns the file name of the currently loaded instrument. Equivalent as calling InstrumentFileName(0).
111                virtual String  InstrumentFileName(int index);
112              virtual String  InstrumentName() = 0;              virtual String  InstrumentName() = 0;
113              virtual int     InstrumentIndex() = 0;              virtual int     InstrumentIndex() = 0;
114              virtual int     InstrumentStatus() = 0;              virtual int     InstrumentStatus() = 0;
115    
116                // sampler format / sampler engine implementation details
117              virtual Engine* GetEngine() = 0;              virtual Engine* GetEngine() = 0;
118              virtual String  EngineName() = 0;              virtual String  EngineName() = 0;
119    
120                // effect routing
121              virtual FxSend* AddFxSend(uint8_t MidiCtrl, String Name = "") throw (Exception) = 0;              virtual FxSend* AddFxSend(uint8_t MidiCtrl, String Name = "") throw (Exception) = 0;
122              virtual FxSend* GetFxSend(uint FxSendIndex) = 0;              virtual FxSend* GetFxSend(uint FxSendIndex) = 0;
123              virtual uint    GetFxSendCount() = 0;              virtual uint    GetFxSendCount() = 0;
124              virtual void    RemoveFxSend(FxSend* pFxSend) = 0;              virtual void    RemoveFxSend(FxSend* pFxSend) = 0;
             virtual void    Connect(VirtualMidiDevice* pDevice) = 0;  
             virtual void    Disconnect(VirtualMidiDevice* pDevice) = 0;  
125    
126    
127              /////////////////////////////////////////////////////////////////              /////////////////////////////////////////////////////////////////
# Line 235  namespace LinuxSampler { Line 260  namespace LinuxSampler {
260              void SetMidiInstrumentMap(int MidiMap) throw (Exception);              void SetMidiInstrumentMap(int MidiMap) throw (Exception);
261    
262              /**              /**
263               * Set MIDI Registered Parameter Number (RPN) Controller               * Set MIDI Registered Parameter Number (RPN)
264               * (upper 8 bits / coarse).               * (upper 7 bits / coarse).
265               */               */
266              void SetMidiRpnControllerMsb(uint8_t CtrlMSB);              void SetMidiRpnParameterMsb(uint8_t ParamMSB);
267    
268              /**              /**
269               * Set MIDI Registered Parameter Number (RPN) Controller               * Set MIDI Registered Parameter Number (RPN)
270               * (lower 8 bits / fine).               * (lower 7 bits / fine).
271               */               */
272              void SetMidiRpnControllerLsb(uint8_t CtrlLSB);              void SetMidiRpnParameterLsb(uint8_t ParamLSB);
273    
274              /**              /**
275               * Reset to no RPN controller currently selected.               * Set new MSB data value (upper 7 bits / coarse) for currently
276                 * selected MIDI Registered Parameter Number (RPN).
277               */               */
278              void ResetMidiRpnController();              void SetMidiRpnDataMsb(uint8_t DataMSB);
279    
280              /**              /**
281               * Set MIDI Non-Registered Parameter Number (NRPN) Controller               * Set new LSB data value (lower 7 bits / fine) for currently
282               * (upper 8 bits / coarse).               * selected MIDI Registered Parameter Number (RPN).
283               */               */
284              void SetMidiNrpnControllerMsb(uint8_t CtrlMSB);              void SetMidiRpnDataLsb(uint8_t DataLSB);
285    
286              /**              /**
287               * Set MIDI Non-Registered Parameter Number (NRPN) Controller               * Reset to no RPN parameter currently selected.
              * (lower 8 bits / fine).  
288               */               */
289              void SetMidiNrpnControllerLsb(uint8_t CtrlLSB);              void ResetMidiRpnParameter();
290    
291              /**              /**
292               * Reset to no NRPN controller currently selected.               * Set MIDI Non-Registered Parameter Number (NRPN)
293                 * (upper 7 bits / coarse).
294               */               */
295              void ResetMidiNrpnController();              void SetMidiNrpnParameterMsb(uint8_t ParamMSB);
296    
297               /**              /**
298               * Registers the specified listener to be notified when the number               * Set MIDI Non-Registered Parameter Number (NRPN)
299               * of effect sends on this channel is changed.               * (lower 7 bits / fine).
300               */               */
301              void AddFxSendCountListener(FxSendCountListener* l);              void SetMidiNrpnParameterLsb(uint8_t ParamLSB);
302    
303              /**              /**
304               * Removes the specified listener.               * Set new MSB data value (upper 7 bits / coarse) for currently
305                 * selected MIDI Non-Registered Parameter Number (NRPN).
306               */               */
307              void RemoveFxSendCountListener(FxSendCountListener* l);              void SetMidiNrpnDataMsb(uint8_t DataMSB);
308    
309              /**              /**
310               * Removes all listeners.               * Set new LSB data value (lower 7 bits / fine) for currently
311                 * selected MIDI Non-Registered Parameter Number (NRPN).
312               */               */
313              void RemoveAllFxSendCountListeners();              void SetMidiNrpnDataLsb(uint8_t DataLSB);
314    
315                /**
316                 * Reset to no NRPN parameter currently selected.
317                 */
318                void ResetMidiNrpnParameter();
319    
320              /**              /**
321               * Get currently selected MIDI Registered Parameter Number               * Get currently selected MIDI Registered Parameter Number
322               * (RPN) Controller, this method will return the already merged               * (RPN), this method will return the already merged 14 bit
323               * value (MSB and LSB value).               * parameter number (MSB and LSB value combined).
324               *               *
325               * @e WARNING: you have to call @c ResetMidiRpnController()               * @e WARNING: you have to call @c ResetMidiRpnParameter()
326               * after using this value, otherwise all subsequent MIDI CC #6               * after using this value, otherwise all subsequent MIDI CC #6
327               * (Data) messages are interpreted as RPN controller value               * (Data) messages are interpreted as RPN value messages.
              * messages.  
328               *               *
329               * @returns currently selected RPN controller number, a negative               * @returns currently selected (14 bit) RPN number, a negative
330               *          value if no RPN controller currently selected               *          value if no RPN parameter currently selected
331                 */
332                int GetMidiRpnParameter();
333    
334                /**
335                 * Get current data value of currently selected MIDI Registered
336                 * Parameter Number (RPN), this method will return the already
337                 * merged 14 bit data value (MSB and LSB data values combined).
338                 *
339                 * @returns latest data value (14 bits) of currently selected RPN
340                 *          parameter, zero otherwise
341               */               */
342              int GetMidiRpnController();              int GetMidiRpnData();
343    
344              /**              /**
345               * Get currently selected MIDI Non-Registered Parameter Number               * Get currently selected MIDI Non-Registered Parameter Number
346               * (NRPN) Controller, this method will return the already merged               * (NRPN), this method will return the already merged 14 bit
347               * value (MSB and LSB value).               * value (MSB and LSB value combined).
348               *               *
349               * @e WARNING: you have to call @c ResetMidiNrpnController()               * @e WARNING: you have to call @c ResetMidiNrpnParameter()
350               * after using this value, otherwise all subsequent MIDI CC #6               * after using this value, otherwise all subsequent MIDI CC #6
351               * (Data) messages are interpreted as NRPN controller value               * (Data) messages are interpreted as NRPN value messages.
              * messages.  
352               *               *
353               * @returns currently selected NRPN controller number, a negative               * @returns currently selected (14 bit) NRPN number, a negative
354               *          value if no NRPN controller currently selected               *          value if no NRPN parameter currently selected
355                 */
356                int GetMidiNrpnParameter();
357    
358                /**
359                 * Get current data value of currently selected MIDI Non-Registered
360                 * Parameter Number (NRPN), this method will return the already
361                 * merged 14 bit data value (MSB and LSB data values combined).
362                 *
363                 * @returns latest data value (14 bits) of currently selected NRPN
364                 *          parameter, zero otherwise
365                 */
366                int GetMidiNrpnData();
367    
368                 /**
369                 * Registers the specified listener to be notified when the number
370                 * of effect sends on this channel is changed.
371                 */
372                void AddFxSendCountListener(FxSendCountListener* l);
373    
374                /**
375                 * Removes the specified listener.
376                 */
377                void RemoveFxSendCountListener(FxSendCountListener* l);
378    
379                /**
380                 * Removes all listeners.
381               */               */
382              int GetMidiNrpnController();              void RemoveAllFxSendCountListeners();
383    
384              /**              /**
385               * Gets the current number of active voices.               * Gets the current number of active voices.
# Line 346  namespace LinuxSampler { Line 413  namespace LinuxSampler {
413               *               *
414               * This method is not real-time safe.               * This method is not real-time safe.
415               */               */
416              void ExecuteProgramChange(uint8_t Program);              void ExecuteProgramChange(uint32_t Program);
417    
418    
419                // Deprecated APIs
420                // (these public methods might be removed in future) ...
421    
422                /**
423                 * Set MIDI Registered Parameter Number (RPN) Controller
424                 * (upper 8 bits / coarse).
425                 *
426                 * @deprecated Use SetMidiRpnParameterMsb() instead.
427                 */
428                void SetMidiRpnControllerMsb(uint8_t CtrlMSB) DEPRECATED_API;
429    
430                /**
431                 * Set MIDI Registered Parameter Number (RPN) Controller
432                 * (lower 8 bits / fine).
433                 *
434                 * @deprecated Use SetMidiRpnParameterLsb() instead.
435                 */
436                void SetMidiRpnControllerLsb(uint8_t CtrlLSB) DEPRECATED_API;
437    
438                /**
439                 * Reset to no RPN controller currently selected.
440                 *
441                 * @deprecated Use ResetMidiRpnParameter() instead.
442                 */
443                void ResetMidiRpnController() DEPRECATED_API;
444    
445                /**
446                 * Set MIDI Non-Registered Parameter Number (NRPN) Controller
447                 * (upper 8 bits / coarse).
448                 *
449                 * @deprecated Use SetMidiNrpnParameterMsb() instead.
450                 */
451                void SetMidiNrpnControllerMsb(uint8_t CtrlMSB) DEPRECATED_API;
452    
453                /**
454                 * Set MIDI Non-Registered Parameter Number (NRPN) Controller
455                 * (lower 8 bits / fine).
456                 *
457                 * @deprecated Use SetMidiNrpnParameterLsb() instead.
458                 */
459                void SetMidiNrpnControllerLsb(uint8_t CtrlLSB) DEPRECATED_API;
460    
461                /**
462                 * Reset to no NRPN controller currently selected.
463                 *
464                 * @deprecated Use ResetMidiNrpnParameter() instead.
465                 */
466                void ResetMidiNrpnController() DEPRECATED_API;
467    
468                /**
469                 * Get currently selected MIDI Registered Parameter Number
470                 * (RPN) Controller, this method will return the already merged
471                 * value (MSB and LSB value).
472                 *
473                 * @e WARNING: you have to call @c ResetMidiRpnController()
474                 * after using this value, otherwise all subsequent MIDI CC #6
475                 * (Data) messages are interpreted as RPN controller value
476                 * messages.
477                 *
478                 * @returns currently selected RPN controller number, a negative
479                 *          value if no RPN controller currently selected
480                 *
481                 * @deprecated Use GetMidiRpnParameter() instead.
482                 */
483                int GetMidiRpnController() DEPRECATED_API;
484    
485                /**
486                 * Get currently selected MIDI Non-Registered Parameter Number
487                 * (NRPN) Controller, this method will return the already merged
488                 * value (MSB and LSB value).
489                 *
490                 * @e WARNING: you have to call @c ResetMidiNrpnController()
491                 * after using this value, otherwise all subsequent MIDI CC #6
492                 * (Data) messages are interpreted as NRPN controller value
493                 * messages.
494                 *
495                 * @returns currently selected NRPN controller number, a negative
496                 *          value if no NRPN controller currently selected
497                 *
498                 * @deprecated Use GetMidiNrpnParameter() instead.
499                 */
500                int GetMidiNrpnController() DEPRECATED_API;
501    
502          protected:          protected:
503              EngineChannel();              EngineChannel();

Legend:
Removed from v.2121  
changed lines
  Added in v.3697

  ViewVC Help
Powered by ViewVC