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

Contents of /linuxsampler/trunk/src/engines/sf2/SF2SignalUnitRack.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2217 - (show annotations) (download) (as text)
Tue Jul 26 15:51:30 2011 UTC (12 years, 9 months ago) by iliev
File MIME type: text/x-c++hdr
File size: 4808 byte(s)
* removed helper classes SignalUnitBase,
  EndpointSignalUnitBase, SignalUnitRackBase
* clean up sf2::Voice
* bumped version to 1.0.0.cvs12

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2011 Grigor Iliev *
6 * *
7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. *
11 * *
12 * This program is distributed in the hope that it will be useful, *
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15 * GNU General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU General Public License *
18 * along with this program; if not, write to the Free Software *
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
20 * MA 02111-1307 USA *
21 ***************************************************************************/
22
23 #ifndef __LS_SF2SIGNALUNITRACK_H__
24 #define __LS_SF2SIGNALUNITRACK_H__
25
26 #include "../common/SignalUnitRack.h"
27 #include "../sfz/EGADSR.h"
28 #include "../common/AbstractVoice.h"
29
30 namespace LinuxSampler { namespace sf2 {
31
32 class Voice;
33 class SF2SignalUnitRack;
34
35 class SFSignalUnit: public SignalUnit {
36 public:
37 Voice* pVoice;
38
39 SFSignalUnit(SF2SignalUnitRack* rack);
40 };
41
42 class EGUnit : public SFSignalUnit, public ::LinuxSampler::sfz::EGADSR {
43 public:
44 EGUnit(SF2SignalUnitRack* rack): SFSignalUnit(rack) { }
45
46 virtual bool Active() { return active(); }
47 virtual float GetLevel() { return getLevel(); }
48 virtual void EnterReleaseStage();
49 virtual void CancelRelease();
50 };
51
52 class VolEGUnit : public EGUnit {
53 public:
54 VolEGUnit(SF2SignalUnitRack* rack): EGUnit(rack) { }
55
56 virtual void Trigger();
57 virtual void Increment();
58 };
59
60 class ModEGUnit : public EGUnit {
61 public:
62 ModEGUnit(SF2SignalUnitRack* rack): EGUnit(rack) { }
63
64 virtual void Trigger();
65 virtual void Increment();
66 };
67
68 class ModLfoUnit : public SFSignalUnit, public LFOSigned {
69 public:
70 ModLfoUnit(SF2SignalUnitRack* rack): SFSignalUnit(rack), LFOSigned(1200.0f) { }
71 virtual bool Active() { return true; }
72 virtual void Trigger();
73 virtual void Increment();
74 virtual float GetLevel() { return Level; }
75 };
76
77 class VibLfoUnit : public SFSignalUnit, public LFOSigned {
78 public:
79 VibLfoUnit(SF2SignalUnitRack* rack): SFSignalUnit(rack), LFOSigned(1200.0f) { }
80 virtual bool Active() { return true; }
81 virtual void Trigger();
82 virtual void Increment();
83 virtual float GetLevel() { return Level; }
84 };
85
86 class EndpointUnit : public EndpointSignalUnit {
87 public:
88 Voice* pVoice;
89
90 Parameter *prmVolEg, *prmModEgPitch, *prmModEgCutoff, *prmModLfoVol,
91 *prmModLfoPitch, *prmModLfoCutoff, *prmVibLfo;
92
93 EndpointUnit(SF2SignalUnitRack* rack);
94
95 virtual void Trigger();
96
97 /** The endpoint should be active until the volume EG is active. */
98 virtual bool Active();
99
100 virtual float GetVolume();
101 virtual float GetFilterCutoff();
102 virtual float GetPitch();
103 virtual float GetResonance();
104 };
105
106 class SF2SignalUnitRack : public SignalUnitRack {
107 private:
108 VolEGUnit suVolEG;
109 ModEGUnit suModEG;
110 ModLfoUnit suModLfo;
111 VibLfoUnit suVibLfo;
112 EndpointUnit suEndpoint;
113
114
115 public:
116 Voice* const pVoice;
117
118 /**
119 * @param Voice The voice to which this rack belongs.
120 */
121 SF2SignalUnitRack(Voice* Voice);
122
123 virtual EndpointSignalUnit* GetEndpointUnit();
124 };
125
126 }} // namespace LinuxSampler::sf2
127
128 #endif /* __LS_SF2SIGNALUNITRACK_H__ */

  ViewVC Help
Powered by ViewVC