00001 /*************************************************************************** 00002 * * 00003 * LinuxSampler - modular, streaming capable sampler * 00004 * * 00005 * Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck * 00006 * Copyright (C) 2005-2008 Christian Schoenebeck * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This program is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this program; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * 00021 * MA 02111-1307 USA * 00022 ***************************************************************************/ 00023 00024 #ifndef __LS_ENGINE_H__ 00025 #define __LS_ENGINE_H__ 00026 00027 #include "../common/global.h" 00028 #include "InstrumentManager.h" 00029 00030 namespace LinuxSampler { 00031 00032 // just symbol prototyping 00033 class MidiInputPort; 00034 00041 class Engine { 00042 public: 00043 00045 // abstract methods 00046 // (these have to be implemented by the descendant) 00047 00048 virtual int RenderAudio(uint Samples) = 0; 00049 virtual void SendSysex(void* pData, uint Size, MidiInputPort* pSender) = 0; 00050 virtual void Reset() = 0; 00051 virtual void Enable() = 0; 00052 virtual void Disable() = 0; 00053 virtual uint VoiceCount() = 0; 00054 virtual uint VoiceCountMax() = 0; 00055 virtual int MaxVoices() = 0; 00056 virtual void SetMaxVoices(int iVoices) throw (Exception) = 0; 00057 virtual bool DiskStreamSupported() = 0; 00058 virtual uint DiskStreamCount() = 0; 00059 virtual uint DiskStreamCountMax() = 0; 00060 virtual int MaxDiskStreams() = 0; 00061 virtual void SetMaxDiskStreams(int iStreams) throw (Exception) = 0; 00062 virtual String DiskStreamBufferFillBytes() = 0; 00063 virtual String DiskStreamBufferFillPercentage() = 0; 00064 virtual String Description() = 0; 00065 virtual String Version() = 0; 00066 virtual String EngineName() = 0; 00067 00077 virtual InstrumentManager* GetInstrumentManager() = 0; 00078 00079 protected: 00080 virtual ~Engine() {}; // MUST only be destroyed by EngineFactory 00081 void Unregister(); // Remove self from EngineFactory. 00082 friend class EngineFactory; 00083 }; 00084 00085 } // namespace LinuxSampler 00086 00087 #endif // __LS_ENGINE_H__