4
4
// $Id: audio.h,v 1.25.2.13 2009/12/20 05:00:35 terminator356 Exp $
6
6
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
7
// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
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.
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.
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.
7
23
//=========================================================
58
75
SEQM_SCAN_ALSA_MIDI_PORTS,
60
77
SEQM_UPDATE_SOLO_STATES,
62
MIDI_SHOW_INSTR_NATIVE_GUI,
78
//MIDI_SHOW_INSTR_GUI,
79
//MIDI_SHOW_INSTR_NATIVE_GUI,
64
81
AUDIO_ROUTEADD, AUDIO_ROUTEREMOVE, AUDIO_REMOVEROUTES,
82
//AUDIO_VOL, AUDIO_PAN,
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,
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);
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; }
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*);
305
extern AudioDevice* audioDevice; // current audio device in use
318
} // namespace MusECore
320
namespace MusEGlobal {
321
extern MusECore::Audio* audio;
322
extern MusECore::AudioDevice* audioDevice; // current audio device in use