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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1017 - (show annotations) (download) (as text)
Tue Jan 9 23:51:32 2007 UTC (17 years, 3 months ago) by schoenebeck
File MIME type: text/x-c++hdr
File size: 6299 byte(s)
* create IDs for FX Send entities in a logical sequence on a per sampler
  channel basis

1 /***************************************************************************
2 * *
3 * LinuxSampler - modular, streaming capable sampler *
4 * *
5 * Copyright (C) 2003, 2004 by Benno Senoner and Christian Schoenebeck *
6 * Copyright (C) 2005 - 2007 Christian Schoenebeck *
7 * *
8 * This library 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 library 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 library; 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_FXSEND_H
25 #define LS_FXSEND_H
26
27 #include "../common/global.h"
28 #include "../drivers/audio/AudioChannel.h"
29 #include "EngineChannel.h"
30
31 #include <vector>
32
33 namespace LinuxSampler {
34
35 // just symbol prototyping
36 class EngineChannel;
37
38 /** @brief Engine Channel Effect Send
39 *
40 * This class is used to manage effect sends on Engine Channels. An effect
41 * send is used to route sampler channel's audio signals to sampler
42 * external effect processors. Each effect send entity can define an
43 * arbitrary MIDI controller number which can alter the effect send's
44 * send level.
45 *
46 * Note: effect sends cannot be routed to a different AudioOutputDevice
47 * than assigned to the FxSend's EngineChannel. Also note that an effect
48 * send always has as much audio channels as its EngineChannel.
49 */
50 class FxSend {
51 public:
52 /**
53 * Constructor. By default all effect send channels are routed to
54 * the @e last available audio channels on the EngineChannel's
55 * AudioOutputDevice.
56 *
57 * @param pEngineChannel - engine channel on which the effect send
58 * is added to
59 * @param MidiCtrl - MIDI controller number which can alter the
60 * effect send level
61 * @param Name - (optional) name for the effect send entity
62 *
63 * @throws Exception - in case no free ID could be found on given EngineChannel
64 */
65 FxSend(EngineChannel* pEngineChannel, uint8_t MidiCtrl, String Name = "") throw (Exception);
66
67 /**
68 * Returns the audio output device's audio channel to which effect
69 * send's channel \a SrcChan is currently routed to.
70 */
71 int DestinationChannel(int SrcChan);
72
73 /**
74 * Alters the routing of an audio channel.
75 *
76 * @param SrcChan - the effect send's source channel
77 * @param DstChan - the audio output device's destination channel
78 * @throws Exception - in case arguments out of range
79 */
80 void SetDestinationChannel(int SrcChan, int DstChan) throw (Exception);
81
82 /**
83 * Should be called by the engine channel whenever the amount of
84 * audio channel has changed, so the FxSend object can adjust the
85 * amount of channels to that new number and establish default
86 * routings for new channels if needed.
87 */
88 void UpdateChannels();
89
90 /**
91 * The effect send's current send level ( usually a value between
92 * @c 0.0f and @c 1.0f ).
93 */
94 float Level();
95
96 /**
97 * Alter the effect send's send level ( usually a value between
98 * @c 0.0f and @c 1.0f ).
99 */
100 void SetLevel(float f);
101
102 /**
103 * Alter the effect send's send level by supplying the MIDI
104 * controller's MIDI value. This method is usually only called
105 * by the engine channel.
106 */
107 void SetLevel(uint8_t iMidiValue);
108
109 /**
110 * Returns the MIDI controller number which can alter the effect
111 * send's send level.
112 */
113 uint8_t MidiController();
114
115 /**
116 * Alter the MIDI controller number which should alter the effect
117 * send's send level.
118 *
119 * @param MidiCtrl - MIDI controller number
120 * @throws Exception - if MIDI controller number is invalid
121 */
122 void SetMidiController(uint8_t MidiCtrl) throw (Exception);
123
124 /**
125 * Returns the (optional) name of this effect send entity.
126 */
127 String Name();
128
129 /**
130 * Returns the (at least sampler-channel-) unique ID of the
131 * effect send instance. This is actually not used by the engine
132 * at all. It is at the moment only used by the LSCP server to
133 * associate an unique numerical ID with each effect send entity.
134 */
135 uint Id();
136
137 protected:
138 EngineChannel* pEngineChannel;
139 std::vector<int> Routing;
140 uint8_t MidiFxSendController;
141 String sName;
142 uint iId;
143 float fLevel;
144 };
145
146 } // namespace LinuxSampler
147
148 #endif // LS_FXSEND_H

  ViewVC Help
Powered by ViewVC