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

Contents of /linuxsampler/trunk/src/engines/common/EngineChannel.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 675 - (show annotations) (download) (as text)
Wed Jun 22 22:09:28 2005 UTC (18 years, 10 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 4608 byte(s)
* update MIDI channel info on program change

1 /***************************************************************************
2 * *
3 * Copyright (C) 2005 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 "../../drivers/audio/AudioOutputDevice.h"
25 #include "../../drivers/midi/midi.h"
26 #include "../../drivers/midi/MidiInputDevice.h"
27 #include "../../drivers/midi/MidiInputPort.h"
28 #include "Engine.h"
29
30 namespace LinuxSampler {
31
32 // just symbol prototyping
33 class AudioOutputDevice;
34 class MidiInputPort;
35
36 /** @brief Channel Interface for LinuxSampler Sampler Engines
37 *
38 * Every sampler engine can be used on several sampler channels and
39 * usually the same Engine instance is used on multiple sampler
40 * channels. For this every sampler engine must also implement a class
41 * which handles all channel dependant parameters and channel
42 * dependant execution code.
43 *
44 * This abstract base interface class defines all mandatory methods
45 * which have to be implemented by all engine channel implementations.
46 */
47 class EngineChannel {
48 public:
49
50 /////////////////////////////////////////////////////////////////
51 // abstract methods
52 // (these have to be implemented by the descendant)
53
54 virtual void PrepareLoadInstrument(const char* FileName, uint Instrument) = 0;
55 virtual void LoadInstrument() = 0;
56 virtual void Reset() = 0;
57 virtual void SendNoteOn(uint8_t Key, uint8_t Velocity) = 0;
58 virtual void SendNoteOff(uint8_t Key, uint8_t Velocity) = 0;
59 virtual void SendPitchbend(int Pitch) = 0;
60 virtual void SendControlChange(uint8_t Controller, uint8_t Value) = 0;
61 virtual bool StatusChanged(bool bNewStatus = false) = 0;
62 virtual float Volume() = 0;
63 virtual void Volume(float f) = 0;
64 virtual uint Channels() = 0;
65 virtual void Connect(AudioOutputDevice* pAudioOut) = 0;
66 virtual void DisconnectAudioOutputDevice() = 0;
67 virtual void SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) = 0;
68 virtual int OutputChannel(uint EngineAudioChannel) = 0;
69 virtual void Connect(MidiInputPort* pMidiPort, midi_chan_t MidiChannel) = 0;
70 virtual void DisconnectMidiInputPort() = 0;
71 virtual MidiInputPort* GetMidiInputPort() = 0;
72 virtual midi_chan_t MidiChannel() = 0;
73 virtual String InstrumentFileName() = 0;
74 virtual String InstrumentName() = 0;
75 virtual int InstrumentIndex() = 0;
76 virtual int InstrumentStatus() = 0;
77 virtual Engine* GetEngine() = 0;
78 virtual String EngineName() = 0;
79
80 int iSamplerChannelIndex; ///< FIXME: nasty hack, might be removed (should be 'virtual EngineChannel* EngineChannel() = 0;', but due to cyclic dependencies only a void* solution would be possible ATM)
81
82 protected:
83 virtual ~EngineChannel() {}; // MUST only be destroyed by EngineChannelFactory
84 friend class EngineChannelFactory;
85 };
86
87 } // namespace LinuxSampler
88
89 #endif // __LS_ENGINECHANNEL_H__

  ViewVC Help
Powered by ViewVC