linuxsampler 2.3.1
Engine.h
Go to the documentation of this file.
1/***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck *
6 * Copyright (C) 2005-2013 Christian Schoenebeck *
7 * *
8 * 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 *
10 * the Free Software Foundation; either version 2 of the License, or *
11 * (at your option) any later version. *
12 * *
13 * This program is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16 * GNU General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU General Public License *
19 * along with this program; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
21 * MA 02111-1307 USA *
22 ***************************************************************************/
23
24#ifndef __LS_ENGINE_H__
25#define __LS_ENGINE_H__
26
27#include "../common/global.h"
28#include "InstrumentManager.h"
29
30namespace LinuxSampler {
31
32 // just symbol prototyping
33 class MidiInputPort;
34
41 class Engine {
42 public:
43
45 // abstract methods
46 // (these have to be implemented by the descendant)
47
48 virtual int RenderAudio(uint Samples) = 0;
49 virtual void SendSysex(void* pData, uint Size, MidiInputPort* pSender) = 0;
50 virtual void Reset() = 0;
51 virtual void Enable() = 0;
52 virtual void Disable() = 0;
53 virtual uint VoiceCount() = 0;
54 virtual uint VoiceCountMax() = 0;
55 virtual int MaxVoices() = 0;
56 virtual void SetMaxVoices(int iVoices) throw (Exception) = 0;
57 virtual bool DiskStreamSupported() = 0;
58 virtual uint DiskStreamCount() = 0;
59 virtual uint DiskStreamCountMax() = 0;
60 virtual int MaxDiskStreams() = 0;
61 virtual void SetMaxDiskStreams(int iStreams) throw (Exception) = 0;
64 virtual String Description() = 0;
65 virtual String Version() = 0;
66 virtual String EngineName() = 0;
67
78
84 virtual void ReconnectAudioOutputDevice() = 0;
85
93 virtual void AdjustScaleTuning(const int8_t ScaleTunes[12]) = 0;
94
103
109 virtual void ResetScaleTuning() = 0;
110
111 protected:
112 virtual ~Engine() {}; // MUST only be destroyed by EngineFactory
113 void Unregister(); // Remove self from EngineFactory.
114 friend class EngineFactory;
115 };
116
117} // namespace LinuxSampler
118
119#endif // __LS_ENGINE_H__
LinuxSampler Sampler Engine Interface.
Definition Engine.h:41
friend class EngineFactory
Definition Engine.h:114
virtual uint VoiceCountMax()=0
virtual String DiskStreamBufferFillBytes()=0
virtual void Enable()=0
virtual InstrumentManager * GetInstrumentManager()=0
Returns pointer to the Engine's InstrumentManager or NULL if the Engine does not provide an Instrumen...
virtual int MaxVoices()=0
virtual int MaxDiskStreams()=0
virtual String EngineName()=0
virtual ~Engine()
Definition Engine.h:112
virtual void SendSysex(void *pData, uint Size, MidiInputPort *pSender)=0
virtual void AdjustScaleTuning(const int8_t ScaleTunes[12])=0
Modifies the scale tuning from standard well tempered chromatic scaling to any other kind of scaling.
virtual uint VoiceCount()=0
virtual bool DiskStreamSupported()=0
virtual void SetMaxVoices(int iVoices)=0
virtual void GetScaleTuning(int8_t *pScaleTunes)=0
Expects a byte array with 12 elements as argument pScaleTunes, where the currently effectve scale tun...
virtual String Version()=0
virtual uint DiskStreamCountMax()=0
virtual uint DiskStreamCount()=0
virtual void Disable()=0
virtual String Description()=0
virtual void SetMaxDiskStreams(int iStreams)=0
virtual int RenderAudio(uint Samples)=0
virtual void Reset()=0
virtual String DiskStreamBufferFillPercentage()=0
virtual void ResetScaleTuning()=0
Reset to standard well tempered chromatic scaling, i.e.
virtual void ReconnectAudioOutputDevice()=0
Will be called by audio output drivers in case some fundamental audio driver parameter like sample ra...
Exception that will be thrown in NON REAL TIME PARTS of the LinuxSampler application.
Definition Exception.h:37
Abstract interface class for InstrumentManagers.
Wraps as a kind of pointer class some data object shared with other threads, to protect / synchronize...
std::string String
Definition global.h:44