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 |
schoenebeck |
2871 |
* Copyright (C) 2009 - 2012 Christian Schoenebeck and Grigor Iliev * |
8 |
|
|
* Copyright (C) 2012 - 2016 Christian Schoenebeck and Andreas Persson * |
9 |
iliev |
2012 |
* * |
10 |
|
|
* This program is free software; you can redistribute it and/or modify * |
11 |
|
|
* it under the terms of the GNU General Public License as published by * |
12 |
|
|
* the Free Software Foundation; either version 2 of the License, or * |
13 |
|
|
* (at your option) any later version. * |
14 |
|
|
* * |
15 |
|
|
* This program is distributed in the hope that it will be useful, * |
16 |
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of * |
17 |
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
18 |
|
|
* GNU General Public License for more details. * |
19 |
|
|
* * |
20 |
|
|
* You should have received a copy of the GNU General Public License * |
21 |
|
|
* along with this program; if not, write to the Free Software * |
22 |
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, * |
23 |
|
|
* MA 02111-1307 USA * |
24 |
|
|
***************************************************************************/ |
25 |
|
|
|
26 |
|
|
#ifndef __LS_SFZ_ENGINECHANNEL_H__ |
27 |
|
|
#define __LS_SFZ_ENGINECHANNEL_H__ |
28 |
|
|
|
29 |
|
|
#include "../AbstractEngine.h" |
30 |
|
|
#include "../EngineChannelBase.h" |
31 |
|
|
#include "../EngineChannelFactory.h" |
32 |
|
|
#include "Voice.h" |
33 |
|
|
#include "sfz.h" |
34 |
|
|
|
35 |
|
|
namespace LinuxSampler { namespace sfz { |
36 |
|
|
class EngineChannel: public LinuxSampler::EngineChannelBase<Voice, ::sfz::Region, ::sfz::Instrument>, public MidiKeyboardAdapter { |
37 |
|
|
public: |
38 |
schoenebeck |
3054 |
virtual void SendProgramChange(uint8_t Program) OVERRIDE; |
39 |
|
|
virtual void LoadInstrument() OVERRIDE; |
40 |
schoenebeck |
2871 |
virtual void ResetInternal(bool bResetEngine) OVERRIDE; |
41 |
iliev |
2012 |
|
42 |
schoenebeck |
3054 |
virtual AbstractEngine::Format GetEngineFormat() OVERRIDE; |
43 |
iliev |
2012 |
|
44 |
|
|
// methods derived from MidiKeyboardListener |
45 |
schoenebeck |
3054 |
virtual void PreProcessNoteOn(uint8_t key, uint8_t velocity) OVERRIDE; |
46 |
|
|
virtual void PostProcessNoteOn(uint8_t key, uint8_t velocity) OVERRIDE; |
47 |
|
|
virtual void PreProcessNoteOff(uint8_t key, uint8_t velocity) OVERRIDE; |
48 |
iliev |
2012 |
|
49 |
|
|
friend class Voice; |
50 |
|
|
friend class Engine; |
51 |
|
|
friend class LinuxSampler::EngineChannelFactory; |
52 |
|
|
|
53 |
|
|
protected: |
54 |
|
|
EngineChannel(); |
55 |
|
|
virtual ~EngineChannel(); |
56 |
|
|
|
57 |
schoenebeck |
3054 |
virtual void ProcessKeySwitchChange(int key) OVERRIDE; |
58 |
iliev |
2012 |
|
59 |
|
|
private: |
60 |
|
|
bool PressedKeys[128]; |
61 |
|
|
int LastKeySwitch; |
62 |
|
|
int LastKey; |
63 |
|
|
}; |
64 |
|
|
|
65 |
|
|
}} // namespace LinuxSampler::sfz |
66 |
|
|
|
67 |
|
|
#endif /* __LS_SFZ_ENGINECHANNEL_H__ */ |