3 |
* LinuxSampler - modular, streaming capable sampler * |
* LinuxSampler - modular, streaming capable sampler * |
4 |
* * |
* * |
5 |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
* Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck * |
6 |
|
* Copyright (C) 2005 Christian Schoenebeck * |
7 |
* * |
* * |
8 |
* This program is free software; you can redistribute it and/or modify * |
* This program is free software; you can redistribute it and/or modify * |
9 |
* 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 * |
25 |
#define __LS_ENGINE_H__ |
#define __LS_ENGINE_H__ |
26 |
|
|
27 |
#include "../../common/global.h" |
#include "../../common/global.h" |
|
#include "../../drivers/audio/AudioOutputDevice.h" |
|
28 |
|
|
29 |
namespace LinuxSampler { |
namespace LinuxSampler { |
30 |
|
|
31 |
// just symbol prototyping |
/** @brief LinuxSampler Sampler Engine Interface |
|
class AudioOutputDevice; |
|
|
|
|
|
/** LinuxSampler Sampler Engine |
|
32 |
* |
* |
33 |
* Abstract base class for all LinuxSampler engines. |
* Abstract base interface class for all LinuxSampler engines which |
34 |
|
* defines all mandatory methods which have to be implemented by all |
35 |
|
* sampler engine implementations. |
36 |
*/ |
*/ |
37 |
class Engine { |
class Engine { |
38 |
public: |
public: |
|
|
|
|
virtual ~Engine() {}; |
|
|
|
|
|
///////////////////////////////////////////////////////////////// |
|
|
// type definitions |
|
|
|
|
|
/** |
|
|
* List with all currently implemented sampler engines. |
|
|
*/ |
|
|
enum type_t { |
|
|
type_gig |
|
|
}; |
|
|
|
|
|
|
|
39 |
|
|
40 |
///////////////////////////////////////////////////////////////// |
///////////////////////////////////////////////////////////////// |
41 |
// abstract methods |
// abstract methods |
42 |
// (these have to be implemented by the descendant) |
// (these have to be implemented by the descendant) |
43 |
|
|
44 |
virtual void PrepareLoadInstrument(const char* FileName, uint Instrument) = 0; |
virtual void SendSysex(void* pData, uint Size) = 0; |
|
virtual void LoadInstrument() = 0; |
|
45 |
virtual void Reset() = 0; |
virtual void Reset() = 0; |
46 |
virtual void Enable() = 0; |
virtual void Enable() = 0; |
47 |
virtual void Disable() = 0; |
virtual void Disable() = 0; |
|
virtual void SendNoteOn(uint8_t Key, uint8_t Velocity) = 0; |
|
|
virtual void SendNoteOff(uint8_t Key, uint8_t Velocity) = 0; |
|
|
virtual void SendPitchbend(int Pitch) = 0; |
|
|
virtual void SendControlChange(uint8_t Controller, uint8_t Value) = 0; |
|
|
virtual void SendSysex(void* pData, uint Size) = 0; |
|
|
virtual float Volume() = 0; |
|
|
virtual void Volume(float f) = 0; |
|
|
virtual uint Channels() = 0; |
|
|
virtual void Connect(AudioOutputDevice* pAudioOut) = 0; |
|
|
virtual void DisconnectAudioOutputDevice() = 0; |
|
|
virtual void SetOutputChannel(uint EngineAudioChannel, uint AudioDeviceChannel) = 0; |
|
|
virtual int OutputChannel(uint EngineAudioChannel) = 0; |
|
|
virtual int RenderAudio(uint Samples) = 0; |
|
48 |
virtual uint VoiceCount() = 0; |
virtual uint VoiceCount() = 0; |
49 |
virtual uint VoiceCountMax() = 0; |
virtual uint VoiceCountMax() = 0; |
50 |
virtual bool DiskStreamSupported() = 0; |
virtual bool DiskStreamSupported() = 0; |
55 |
virtual String Description() = 0; |
virtual String Description() = 0; |
56 |
virtual String Version() = 0; |
virtual String Version() = 0; |
57 |
virtual String EngineName() = 0; |
virtual String EngineName() = 0; |
58 |
virtual String InstrumentFileName() = 0; |
|
59 |
virtual String InstrumentName() = 0; |
virtual ~Engine() {}; |
|
virtual int InstrumentIndex() = 0; |
|
|
virtual int InstrumentStatus() = 0; |
|
60 |
}; |
}; |
61 |
} |
|
62 |
|
} // namespace LinuxSampler |
63 |
|
|
64 |
#endif // __LS_ENGINE_H__ |
#endif // __LS_ENGINE_H__ |