~ubuntu-branches/ubuntu/wily/muse/wily-proposed

« back to all changes in this revision

Viewing changes to muse/audio.h

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2011-12-03 17:12:54 UTC
  • mfrom: (1.1.8)
  • Revision ID: package-import@ubuntu.com-20111203171254-28b1j4lpb46r5jtl
Tags: 2.0~rc1-1
* New upstream RC release.
* Refresh patches, remove those patches not needed anymore.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
//  $Id: audio.h,v 1.25.2.13 2009/12/20 05:00:35 terminator356 Exp $
5
5
//
6
6
//  (C) Copyright 2001 Werner Schweer (ws@seh.de)
 
7
//  (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
 
8
//
 
9
//  This program is free software; you can redistribute it and/or
 
10
//  modify it under the terms of the GNU General Public License
 
11
//  as published by the Free Software Foundation; version 2 of
 
12
//  the License, or (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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
22
//
7
23
//=========================================================
8
24
 
9
25
#ifndef __AUDIO_H__
15
31
#include "route.h"
16
32
#include "event.h"
17
33
 
18
 
class SndFile;
19
 
class PluginI;
20
 
class SynthI;
21
 
class MidiDevice;
 
34
namespace MusECore {
22
35
class AudioDevice;
23
 
class Track;
24
36
class AudioTrack;
25
 
class Part;
26
 
class Event;
 
37
class Event;
 
38
class Event;
 
39
class EventList;
 
40
class MidiDevice;
 
41
class MidiInstrument;
27
42
class MidiPlayEvent;
28
 
class Event;
29
43
class MidiPort;
30
 
class EventList;
31
 
class MidiInstrument;
32
44
class MidiTrack;
 
45
class Part;
 
46
class PluginI;
 
47
class SndFile;
 
48
class SynthI;
 
49
class Track;
33
50
 
34
51
//---------------------------------------------------------
35
52
//   AudioMsgId
58
75
      SEQM_SCAN_ALSA_MIDI_PORTS,
59
76
      SEQM_SET_AUX,
60
77
      SEQM_UPDATE_SOLO_STATES,
61
 
      MIDI_SHOW_INSTR_GUI,
62
 
      MIDI_SHOW_INSTR_NATIVE_GUI,
 
78
      //MIDI_SHOW_INSTR_GUI,
 
79
      //MIDI_SHOW_INSTR_NATIVE_GUI,
63
80
      AUDIO_RECORD,
64
81
      AUDIO_ROUTEADD, AUDIO_ROUTEREMOVE, AUDIO_REMOVEROUTES,
65
 
      AUDIO_VOL, AUDIO_PAN,
 
82
      //AUDIO_VOL, AUDIO_PAN,
66
83
      AUDIO_ADDPLUGIN,
67
84
      AUDIO_SET_SEG_SIZE,
68
85
      AUDIO_SET_PREFADER, AUDIO_SET_CHANNELS,
69
 
      AUDIO_SET_PLUGIN_CTRL_VAL,
 
86
      //AUDIO_SET_PLUGIN_CTRL_VAL,
70
87
      AUDIO_SWAP_CONTROLLER_IDX,
71
88
      AUDIO_CLEAR_CONTROLLER_EVENTS,
72
89
      AUDIO_SEEK_PREV_AC_EVENT,
74
91
      AUDIO_ERASE_AC_EVENT,
75
92
      AUDIO_ERASE_RANGE_AC_EVENTS,
76
93
      AUDIO_ADD_AC_EVENT,
 
94
      AUDIO_CHANGE_AC_EVENT,
77
95
      AUDIO_SET_SOLO, AUDIO_SET_SEND_METRONOME, 
78
96
      MS_PROCESS, MS_STOP, MS_SET_RTC, MS_UPDATE_POLL_FD,
79
97
      SEQM_IDLE, SEQM_SEEK,
124
142
      bool idle;              // do nothing in idle mode
125
143
      bool _freewheel;
126
144
      bool _bounce;
127
 
      //bool loopPassed;
128
145
      unsigned _loopFrame;     // Startframe of loop if in LOOP mode. Not quite the same as left marker !
129
146
      int _loopCount;         // Number of times we have looped so far
130
147
 
202
219
      void msgMoveTrack(int idx1, int dx2, bool u = true);
203
220
      void msgAddPart(Part*, bool u = true);
204
221
      void msgRemovePart(Part*, bool u = true);
205
 
      //void msgChangePart(Part* oldPart, Part* newPart, bool u = true);
206
222
      void msgChangePart(Part* oldPart, Part* newPart, bool u = true, bool doCtrls = true, bool doClones = false);
207
 
      //void msgAddEvent(Event&, Part*, bool u = true);
208
223
      void msgAddEvent(Event&, Part*, bool u = true, bool doCtrls = true, bool doClones = false);
209
 
      //void msgDeleteEvent(Event&, Part*, bool u = true);
210
224
      void msgDeleteEvent(Event&, Part*, bool u = true, bool doCtrls = true, bool doClones = false);
211
 
      //void msgChangeEvent(Event&, Event&, Part*, bool u = true);
212
225
      void msgChangeEvent(Event&, Event&, Part*, bool u = true, bool doCtrls = true, bool doClones = false);
213
226
      void msgScanAlsaMidiPorts();
214
227
      void msgAddTempo(int tick, int tempo, bool doUndoFlag = true);
221
234
      void msgRemoveSig(int tick, int z, int n, bool doUndoFlag = true);
222
235
      void msgAddKey(int tick, int key, bool doUndoFlag = true);
223
236
      void msgRemoveKey(int tick, int key, bool doUndoFlag = true);
224
 
      void msgShowInstrumentGui(MidiInstrument*, bool);
225
 
      void msgShowInstrumentNativeGui(MidiInstrument*, bool);
 
237
      //void msgShowInstrumentGui(MidiInstrument*, bool);
 
238
      //void msgShowInstrumentNativeGui(MidiInstrument*, bool);
226
239
      void msgPanic();
227
240
      void sendMsg(AudioMsg*);
228
241
      bool sendMessage(AudioMsg* m, bool doUndo);
229
242
      void msgRemoveRoute(Route, Route);
230
243
      void msgRemoveRoute1(Route, Route);
231
 
      void msgRemoveRoutes(Route, Route);  // p3.3.55
232
 
      void msgRemoveRoutes1(Route, Route);  // p3.3.55
 
244
      void msgRemoveRoutes(Route, Route);  
 
245
      void msgRemoveRoutes1(Route, Route);  
233
246
      void msgAddRoute(Route, Route);
234
247
      void msgAddRoute1(Route, Route);
235
248
      void msgAddPlugin(AudioTrack*, int idx, PluginI* plugin);
236
249
      void msgSetMute(AudioTrack*, bool val);
237
 
      void msgSetVolume(AudioTrack*, double val);
238
 
      void msgSetPan(AudioTrack*, double val);
 
250
      //void msgSetVolume(AudioTrack*, double val);
 
251
      //void msgSetPan(AudioTrack*, double val);
239
252
      void msgAddSynthI(SynthI* synth);
240
253
      void msgRemoveSynthI(SynthI* synth);
241
254
      void msgSetSegSize(int, int);
250
263
      void msgResetMidiDevices();
251
264
      void msgIdle(bool);
252
265
      void msgBounce();
253
 
      //void msgSetPluginCtrlVal(PluginI* /*plugin*/, int /*param*/, double /*val*/);
254
 
      void msgSetPluginCtrlVal(AudioTrack*, int /*param*/, double /*val*/);
 
266
      //void msgSetPluginCtrlVal(AudioTrack*, int /*param*/, double /*val*/);
255
267
      void msgSwapControllerIDX(AudioTrack*, int, int);
256
268
      void msgClearControllerEvents(AudioTrack*, int);
257
269
      void msgSeekPrevACEvent(AudioTrack*, int);
259
271
      void msgEraseACEvent(AudioTrack*, int, int);
260
272
      void msgEraseRangeACEvents(AudioTrack*, int, int, int);
261
273
      void msgAddACEvent(AudioTrack*, int, int, double);
 
274
      void msgChangeACEvent(AudioTrack* node, int acid, int frame, int newFrame, double val);
262
275
      void msgSetSolo(Track*, bool);
263
276
      void msgSetHwCtrlState(MidiPort*, int, int, int);
264
277
      void msgSetHwCtrlStates(MidiPort*, int, int, int, int);
279
292
      int loopCount() { return _loopCount; }         // Number of times we have looped so far
280
293
      unsigned loopFrame() { return _loopFrame; }          
281
294
 
282
 
      int tickPos() const         { return curTickPos; }
 
295
      unsigned tickPos() const    { return curTickPos; }
 
296
      unsigned nextTick() const   { return nextTickPos; }
283
297
      int timestamp() const;
284
298
      void processMidi();
285
299
      unsigned curFrame() const;
301
315
extern int processAudio(unsigned long, void*);
302
316
extern void processAudio1(void*, void*);
303
317
 
304
 
extern Audio* audio;
305
 
extern AudioDevice* audioDevice;   // current audio device in use
 
318
} // namespace MusECore
 
319
 
 
320
namespace MusEGlobal {
 
321
extern MusECore::Audio* audio;
 
322
extern MusECore::AudioDevice* audioDevice;   // current audio device in use
 
323
}
 
324
 
306
325
#endif
307
326