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

Contents of /linuxsampler/trunk/src/engines/Engine.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1751 - (show annotations) (download) (as text)
Mon Jul 28 07:36:35 2008 UTC (15 years, 8 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 3928 byte(s)
* bugfix: process chromatic / drumkit mode sysex message only for
  the respective engine channels that are connected to the MIDI
  input port on which the message was received

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck *
6 * Copyright (C) 2005-2008 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
30 namespace LinuxSampler {
31
32 // just symbol prototyping
33 class MidiInputPort;
34
35 /** @brief LinuxSampler Sampler Engine Interface
36 *
37 * Abstract base interface class for all LinuxSampler engines which
38 * defines all mandatory methods which have to be implemented by all
39 * sampler engine implementations.
40 */
41 class Engine {
42 public:
43
44 /////////////////////////////////////////////////////////////////
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 bool DiskStreamSupported() = 0;
56 virtual uint DiskStreamCount() = 0;
57 virtual uint DiskStreamCountMax() = 0;
58 virtual String DiskStreamBufferFillBytes() = 0;
59 virtual String DiskStreamBufferFillPercentage() = 0;
60 virtual String Description() = 0;
61 virtual String Version() = 0;
62 virtual String EngineName() = 0;
63
64 /**
65 * Returns pointer to the Engine's InstrumentManager or NULL if
66 * the Engine does not provide an InstrumentManager.
67 *
68 * <b>Important:</b> All engine instances of the same engine
69 * type have to return the same InstrumentManager, that is all
70 * instances of the same engine type have to share one and
71 * the same InstrumentManager object.
72 */
73 virtual InstrumentManager* GetInstrumentManager() = 0;
74
75 protected:
76 virtual ~Engine() {}; // MUST only be destroyed by EngineFactory
77 void Unregister(); // Remove self from EngineFactory.
78 friend class EngineFactory;
79 };
80
81 } // namespace LinuxSampler
82
83 #endif // __LS_ENGINE_H__

  ViewVC Help
Powered by ViewVC