1 |
iliev |
2012 |
/*************************************************************************** |
2 |
|
|
* * |
3 |
|
|
* LinuxSampler - modular, streaming capable sampler * |
4 |
|
|
* * |
5 |
|
|
* Copyright (C) 2003,2004 by Benno Senoner and Christian Schoenebeck * |
6 |
|
|
* Copyright (C) 2005-2009 Christian Schoenebeck * |
7 |
persson |
2072 |
* Copyright (C) 2009-2010 Grigor Iliev * |
8 |
iliev |
2012 |
* * |
9 |
|
|
* This program is free software; you can redistribute it and/or modify * |
10 |
|
|
* it under the terms of the GNU General Public License as published by * |
11 |
|
|
* the Free Software Foundation; either version 2 of the License, or * |
12 |
|
|
* (at your option) any later version. * |
13 |
|
|
* * |
14 |
|
|
* This program is distributed in the hope that it will be useful, * |
15 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
16 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
17 |
|
|
* GNU General Public License for more details. * |
18 |
|
|
* * |
19 |
|
|
* You should have received a copy of the GNU General Public License * |
20 |
|
|
* along with this program; if not, write to the Free Software * |
21 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * |
22 |
|
|
* MA 02111-1307 USA * |
23 |
|
|
***************************************************************************/ |
24 |
|
|
|
25 |
|
|
#ifndef __LS_SFZ_ENGINE_H__ |
26 |
|
|
#define __LS_SFZ_ENGINE_H__ |
27 |
|
|
|
28 |
|
|
#include "DiskThread.h" |
29 |
|
|
#include "../EngineBase.h" |
30 |
|
|
#include "Voice.h" |
31 |
|
|
#include "sfz.h" |
32 |
schoenebeck |
2500 |
#include "EngineChannel.h" // prevents compile errors with clang 2.x |
33 |
iliev |
2012 |
|
34 |
|
|
namespace LinuxSampler { namespace sfz { |
35 |
iliev |
2244 |
const int MaxCCPerVoice = 128; // FIXME: too much? |
36 |
|
|
|
37 |
iliev |
2012 |
class Engine: public LinuxSampler::EngineBase<Voice, ::sfz::Region, ::sfz::Region, DiskThread, InstrumentResourceManager, ::sfz::Instrument> { |
38 |
|
|
public: |
39 |
iliev |
2244 |
Engine(); |
40 |
|
|
virtual ~Engine(); |
41 |
iliev |
2012 |
// implementation of abstract methods derived from class 'LinuxSampler::Engine' |
42 |
schoenebeck |
3054 |
virtual bool DiskStreamSupported() OVERRIDE; |
43 |
|
|
virtual String Description() OVERRIDE; |
44 |
|
|
virtual String Version() OVERRIDE; |
45 |
iliev |
2012 |
|
46 |
schoenebeck |
3054 |
virtual Format GetEngineFormat() OVERRIDE; |
47 |
iliev |
2012 |
|
48 |
|
|
virtual void ProcessControlChange ( |
49 |
|
|
LinuxSampler::EngineChannel* pEngineChannel, |
50 |
|
|
Pool<Event>::Iterator& itControlChangeEvent |
51 |
schoenebeck |
2559 |
) OVERRIDE; |
52 |
|
|
virtual void ProcessChannelPressure(LinuxSampler::EngineChannel* pEngineChannel, Pool<Event>::Iterator& itChannelPressureEvent) OVERRIDE; |
53 |
|
|
virtual void ProcessPolyphonicKeyPressure(LinuxSampler::EngineChannel* pEngineChannel, Pool<Event>::Iterator& itNotePressureEvent) OVERRIDE; |
54 |
schoenebeck |
3082 |
virtual void CreateInstrumentScriptVM() OVERRIDE; |
55 |
|
|
|
56 |
schoenebeck |
3054 |
virtual void PostSetMaxVoices(int iVoices) OVERRIDE; |
57 |
iliev |
2012 |
|
58 |
|
|
friend class Voice; |
59 |
iliev |
2244 |
friend class SfzSignalUnitRack; |
60 |
iliev |
2012 |
|
61 |
|
|
protected: |
62 |
iliev |
2244 |
Pool<CCSignalUnit::CC>* pCCPool; |
63 |
|
|
Pool<Smoother>* pSmootherPool; |
64 |
|
|
|
65 |
schoenebeck |
3054 |
virtual DiskThread* CreateDiskThread() OVERRIDE; |
66 |
iliev |
2012 |
|
67 |
|
|
virtual Pool<Voice>::Iterator LaunchVoice ( |
68 |
|
|
LinuxSampler::EngineChannel* pEngineChannel, |
69 |
|
|
Pool<Event>::Iterator& itNoteOnEvent, |
70 |
|
|
int iLayer, |
71 |
|
|
bool ReleaseTriggerVoice, |
72 |
|
|
bool VoiceStealing, |
73 |
|
|
bool HandleKeyGroupConflicts |
74 |
schoenebeck |
3054 |
) OVERRIDE; |
75 |
iliev |
2012 |
|
76 |
|
|
virtual void TriggerNewVoices ( |
77 |
|
|
LinuxSampler::EngineChannel* pEngineChannel, |
78 |
|
|
RTList<Event>::Iterator& itNoteOnEvent, |
79 |
|
|
bool HandleKeyGroupConflicts |
80 |
schoenebeck |
3054 |
) OVERRIDE; |
81 |
iliev |
2012 |
|
82 |
|
|
void TriggerReleaseVoices ( |
83 |
|
|
LinuxSampler::EngineChannel* pEngineChannel, |
84 |
|
|
RTList<Event>::Iterator& itNoteOffEvent |
85 |
schoenebeck |
3054 |
) OVERRIDE; |
86 |
iliev |
2012 |
}; |
87 |
|
|
|
88 |
|
|
}} // namespace LinuxSampler::sfz |
89 |
|
|
|
90 |
|
|
#endif /* __LS_SFZ_ENGINE_H__ */ |
91 |
|
|
|