linuxsampler 2.3.1
EngineChannel.h
Go to the documentation of this file.
1/***************************************************************************
2 * *
3 * Copyright (C) 2005 - 2020 Christian Schoenebeck *
4 * *
5 * 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 *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
18 * MA 02111-1307 USA *
19 ***************************************************************************/
20
21#ifndef __LS_ENGINECHANNEL_H__
22#define __LS_ENGINECHANNEL_H__
23
24#include "../EventListeners.h"
25#include "../drivers/audio/AudioOutputDevice.h"
26#include "../drivers/midi/midi.h"
27#include "../drivers/midi/MidiInputDevice.h"
28#include "../drivers/midi/MidiInputPort.h"
29#include "../drivers/midi/VirtualMidiDevice.h"
30#include "Engine.h"
31#include "FxSend.h"
32
33namespace LinuxSampler {
34
35 // just symbol prototyping
36 class Sampler;
37 class SamplerChannel;
38 class AudioOutputDevice;
39 class MidiInputPort;
40 class FxSend;
41
42
55 public:
56
58 // abstract methods
59 // (these have to be implemented by the descendant)
60
61 // general sampler part management
62 virtual void Reset() = 0;
67 virtual void SendPitchbend(int Pitch, uint8_t MidiChannel) = 0;
76 virtual bool StatusChanged(bool bNewStatus = false) = 0;
77 virtual float Volume() = 0;
78 virtual void Volume(float f) = 0;
79 virtual float Pan() = 0;
80 virtual void Pan(float f) = 0;
81 virtual uint Channels() = 0;
82
83 // audio driver management
85 virtual void DisconnectAudioOutputDevice() = 0;
89
90 // MIDI driver management
91 virtual void Connect(MidiInputPort* pMidiPort) = 0;
93 virtual void DisconnectAllMidiInputPorts() = 0;
96 virtual midi_chan_t MidiChannel() = 0;
98 // (deprecated MIDI driver management methods)
102
103 // virtual MIDI driver management (i.e. virtual on-screen MIDI keyboards)
106
107 // instrument (sound file) management
115
116 // sampler format / sampler engine implementation details
119
120 // effect routing
125
126
128 // normal methods
129 // (usually not to be overridden by descendant)
130
138 void SetMute(int state) throw (Exception);
139
147 int GetMute();
148
154 void SetSolo(bool solo);
155
161 bool GetSolo();
162
168
173
179
185
191
197
207
216
232
241
250
261
267
273
279
285
291
296
302
308
314
320
326
331
345
355
369
379
385
390
395
400
405
410
415
417
419
422
429
430
431 // Deprecated APIs
432 // (these public methods might be removed in future) ...
433
441
449
456
464
472
479
496
513
514 protected:
516 virtual ~EngineChannel(); // MUST only be destroyed by EngineChannelFactory
517
525
527
528 private:
531 };
532
533} // namespace LinuxSampler
534
535#endif // __LS_ENGINECHANNEL_H__
Abstract base class for audio output drivers in LinuxSampler.
Channel Interface for LinuxSampler Sampler Engines.
uint8_t GetMidiBankMsb()
Returns current MIDI bank MSB (coarse) number of this EngineChannel.
uint GetDiskStreamCount()
Gets the current number of active disk streams.
void SetMidiRpnParameterMsb(uint8_t ParamMSB)
Set MIDI Registered Parameter Number (RPN) (upper 7 bits / coarse).
virtual void SendControlChange(uint8_t Controller, uint8_t Value, uint8_t MidiChannel, int32_t FragmentPos)=0
void SetMidiNrpnControllerMsb(uint8_t CtrlMSB) DEPRECATED_API
Set MIDI Non-Registered Parameter Number (NRPN) Controller (upper 8 bits / coarse).
void fireFxSendCountChanged(int ChannelId, int NewCount)
Notifies listeners that the number of effect sends on a this channel is changed.
virtual FxSend * AddFxSend(uint8_t MidiCtrl, String Name="")=0
Sampler * GetSampler()
Returns the sampler to which this channel belongs.
virtual void SendNoteOff(uint8_t Key, uint8_t Velocity, uint8_t MidiChannel)=0
virtual void Pan(float f)=0
virtual void Connect(AudioOutputDevice *pAudioOut)=0
int GetMidiRpnParameter()
Get currently selected MIDI Registered Parameter Number (RPN), this method will return the already me...
virtual void LoadInstrument()=0
virtual MidiInputPort * GetMidiInputPort(uint index)=0
virtual void DisconnectAudioOutputDevice()=0
virtual String EngineName()=0
int GetMidiInstrumentMap()
Returns ID of the MIDI instrument map currently used by this EngineChannel to handle MIDI program cha...
SamplerChannel * GetSamplerChannel()
virtual void RemoveFxSend(FxSend *pFxSend)=0
void ResetMidiRpnParameter()
Reset to no RPN parameter currently selected.
virtual String InstrumentFileName()=0
Returns the file name of the currently loaded instrument. Equivalent as calling InstrumentFileName(0)...
void SetMidiRpnData(int Data)
Set new data value (14 bits, MSB and LSB data combined) for currently selected MIDI Registered Parame...
uint GetVoiceCount()
Gets the current number of active voices.
virtual uint GetMidiInputPortCount()=0
virtual void SendPitchbend(int Pitch, uint8_t MidiChannel, int32_t FragmentPos)=0
void SetMidiRpnParameterLsb(uint8_t ParamLSB)
Set MIDI Registered Parameter Number (RPN) (lower 7 bits / fine).
void SetSamplerChannel(SamplerChannel *pChannel)
void SetMidiBankMsb(uint8_t BankMSB)
Change current MIDI bank MSB (coarse) number of this EngineChannel.
void SetMidiNrpnDataMsb(uint8_t DataMSB)
Set new MSB data value (upper 7 bits / coarse) for currently selected MIDI Non-Registered Parameter N...
void ResetMidiNrpnController() DEPRECATED_API
Reset to no NRPN controller currently selected.
virtual FxSend * GetFxSend(uint FxSendIndex)=0
virtual AudioOutputDevice * GetAudioOutputDevice()=0
int GetMute()
Determines whether this channel is muted.
virtual void Volume(float f)=0
void SetMidiNrpnData(int Data)
Set new data value (14 bits, MSB and LSB data combined) for currently selected MIDI Non-Registered Pa...
void SetMidiRpnDataLsb(uint8_t DataLSB)
Set new LSB data value (lower 7 bits / fine) for currently selected MIDI Registered Parameter Number ...
void SetMidiInstrumentMap(int MidiMap)
Set a specific MIDI instrument map this EngineChannel should use to handle MIDI program changes.
void AddFxSendCountListener(FxSendCountListener *l)
Registers the specified listener to be notified when the number of effect sends on this channel is ch...
void SetMidiRpnDataMsb(uint8_t DataMSB)
Set new MSB data value (upper 7 bits / coarse) for currently selected MIDI Registered Parameter Numbe...
void SetMidiNrpnDataLsb(uint8_t DataLSB)
Set new LSB data value (lower 7 bits / fine) for currently selected MIDI Non-Registered Parameter Num...
virtual void SendPitchbend(int Pitch, uint8_t MidiChannel)=0
virtual void SendChannelPressure(uint8_t Value, uint8_t MidiChannel)=0
virtual void SendProgramChange(uint8_t Program)=0
virtual String InstrumentName()=0
virtual void SendNoteOn(uint8_t Key, uint8_t Velocity, uint8_t MidiChannel)=0
void SetSolo(bool solo)
Sets the solo state of this channel.
void SetMute(int state)
Sets the mute state of this channel.
void SetMidiBankLsb(uint8_t BankLSB)
Change current MIDI bank LSB (fine) number of this EngineChannel.
int GetMidiNrpnParameter()
Get currently selected MIDI Non-Registered Parameter Number (NRPN), this method will return the alrea...
int GetMidiNrpnData()
Get current data value of currently selected MIDI Non-Registered Parameter Number (NRPN),...
virtual void SendNoteOff(uint8_t Key, uint8_t Velocity, uint8_t MidiChannel, int32_t FragmentPos)=0
virtual void SendNoteOn(uint8_t Key, uint8_t Velocity, uint8_t MidiChannel, int32_t FragmentPos)=0
void RemoveFxSendCountListener(FxSendCountListener *l)
Removes the specified listener.
virtual void SendChannelPressure(uint8_t Value, uint8_t MidiChannel, int32_t FragmentPos)=0
void SetMidiNrpnParameterLsb(uint8_t ParamLSB)
Set MIDI Non-Registered Parameter Number (NRPN) (lower 7 bits / fine).
void SetMidiInstrumentMapToNone()
Let this EngineChannel use no MIDI instrument map at all, that is to let it ignore all MIDI program c...
virtual void Connect(MidiInputPort *pMidiPort)=0
void SetMidiRpnControllerMsb(uint8_t CtrlMSB) DEPRECATED_API
Set MIDI Registered Parameter Number (RPN) Controller (upper 8 bits / coarse).
bool GetSolo()
Determines whether this is a solo channel.
void ResetMidiNrpnParameter()
Reset to no NRPN parameter currently selected.
virtual float Volume()=0
int GetMidiNrpnController() DEPRECATED_API
Get currently selected MIDI Non-Registered Parameter Number (NRPN) Controller, this method will retur...
void ExecuteProgramChange(uint32_t Program)
Performs a program change on the channel.
void SetMidiProgram(uint8_t Program)
Change EngineChannel's MIDI program.
void ResetMidiRpnController() DEPRECATED_API
Reset to no RPN controller currently selected.
virtual void Connect(MidiInputPort *pMidiPort, midi_chan_t MidiChannel) DEPRECATED_API=0
void RemoveAllFxSendCountListeners()
Removes all listeners.
virtual Engine * GetEngine()=0
uint8_t GetMidiBankLsb()
Returns current MIDI bank LSB (fine) number of this EngineChannel.
void SetMidiInstrumentMapToDefault()
Let this EngineChannel use the default MIDI instrument map to handle MIDI program changes.
bool UsesNoMidiInstrumentMap()
Returns true if this EngineChannel is using no MIDI instrument map at all, that is if it will ignore ...
virtual int OutputChannel(uint EngineAudioChannel)=0
virtual void DisconnectMidiInputPort() DEPRECATED_API=0
virtual void SendPolyphonicKeyPressure(uint8_t Key, uint8_t Value, uint8_t MidiChannel, int32_t FragmentPos)=0
void SetVoiceCount(uint Voices)
Sets the current number of active voices.
virtual void DisconnectAllMidiInputPorts()=0
virtual void PrepareLoadInstrument(const char *FileName, uint Instrument)=0
virtual bool StatusChanged(bool bNewStatus=false)=0
virtual void SendControlChange(uint8_t Controller, uint8_t Value, uint8_t MidiChannel)=0
virtual MidiInputPort * GetMidiInputPort() DEPRECATED_API=0
virtual void Disconnect(MidiInputPort *pMidiPort)=0
virtual int InstrumentIndex()=0
bool UsesDefaultMidiInstrumentMap()
Returns true if this EngineChannel is using the default MIDI instrument map for handling MIDI program...
void SetMidiNrpnParameterMsb(uint8_t ParamMSB)
Set MIDI Non-Registered Parameter Number (NRPN) (upper 7 bits / coarse).
virtual uint GetFxSendCount()=0
void SetDiskStreamCount(uint Streams)
Sets the current number of active disk streams.
int GetMidiRpnData()
Get current data value of currently selected MIDI Registered Parameter Number (RPN),...
virtual uint Channels()=0
virtual void SendPolyphonicKeyPressure(uint8_t Key, uint8_t Value, uint8_t MidiChannel)=0
virtual void SetMidiChannel(midi_chan_t MidiChannel)=0
void SetMidiNrpnControllerLsb(uint8_t CtrlLSB) DEPRECATED_API
Set MIDI Non-Registered Parameter Number (NRPN) Controller (lower 8 bits / fine).
virtual midi_chan_t MidiChannel()=0
void SetMidiRpnControllerLsb(uint8_t CtrlLSB) DEPRECATED_API
Set MIDI Registered Parameter Number (RPN) Controller (lower 8 bits / fine).
virtual void SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel)=0
uint8_t GetMidiProgram()
Returns current MIDI program (change) number of this EngineChannel.
int GetMidiRpnController() DEPRECATED_API
Get currently selected MIDI Registered Parameter Number (RPN) Controller, this method will return the...
virtual int InstrumentStatus()=0
LinuxSampler Sampler Engine Interface.
Definition Engine.h:41
Exception that will be thrown in NON REAL TIME PARTS of the LinuxSampler application.
Definition Exception.h:37
This class is used as a listener, which is notified when the number of effect sends on a particular s...
Engine Channel Effect Send.
Definition FxSend.h:56
LinuxSampler sampler channel (a.k.a.
Definition Sampler.h:49
LinuxSampler main class.
Definition Sampler.h:389
Wraps as a kind of pointer class some data object shared with other threads, to protect / synchronize...
Light-weight MIDI interface (for MIDI in & out) intended to be used by pure software MIDI "devices",...
#define DEPRECATED_API
Definition global.h:71
std::string String
Definition global.h:44
midi_chan_t
MIDI channels.
Definition midi.h:34