summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJaromír Mikeš <mira.mikes@seznam.cz>2015-09-03 03:47:59 +0200
committerJaromír Mikeš <mira.mikes@seznam.cz>2015-09-03 03:47:59 +0200
commit3e72421251cef1f9a4239ed179d557f7e0ae62c5 (patch)
treee886fa6f045b9e9c021c7a2595d21a06fbf5e38a /src
parent02f23ec68556cc8931df796955875f44ab332184 (diff)
Imported Upstream version 0.10.1~dfsg1
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am116
-rw-r--r--[-rwxr-xr-x]src/core/.dirstamp (renamed from src/rtaudio-mod/config/install.sh)0
-rw-r--r--src/core/channel.cpp (renamed from src/channel.cpp)4
-rw-r--r--src/core/channel.h (renamed from src/channel.h)4
-rw-r--r--src/core/conf.cpp (renamed from src/conf.cpp)8
-rw-r--r--src/core/conf.h (renamed from src/conf.h)0
-rw-r--r--src/core/const.h (renamed from src/const.h)4
-rw-r--r--src/core/dataStorage.cpp (renamed from src/dataStorage.cpp)2
-rw-r--r--src/core/dataStorage.h (renamed from src/dataStorage.h)0
-rw-r--r--src/core/graphics.cpp (renamed from src/graphics.cpp)61
-rw-r--r--src/core/graphics.h (renamed from src/graphics.h)3
-rw-r--r--src/core/init.cpp (renamed from src/init.cpp)10
-rw-r--r--src/core/init.h (renamed from src/init.h)0
-rw-r--r--src/core/kernelAudio.cpp (renamed from src/kernelAudio.cpp)5
-rw-r--r--src/core/kernelAudio.h (renamed from src/kernelAudio.h)2
-rw-r--r--src/core/kernelMidi.cpp (renamed from src/kernelMidi.cpp)4
-rw-r--r--src/core/kernelMidi.h (renamed from src/kernelMidi.h)0
-rw-r--r--src/core/midiChannel.cpp (renamed from src/midiChannel.cpp)4
-rw-r--r--src/core/midiChannel.h (renamed from src/midiChannel.h)5
-rw-r--r--src/core/midiMapConf.cpp (renamed from src/midiMapConf.cpp)8
-rw-r--r--src/core/midiMapConf.h (renamed from src/midiMapConf.h)2
-rw-r--r--src/core/mixer.cpp (renamed from src/mixer.cpp)4
-rw-r--r--src/core/mixer.h (renamed from src/mixer.h)2
-rw-r--r--src/core/mixerHandler.cpp (renamed from src/mixerHandler.cpp)16
-rw-r--r--src/core/mixerHandler.h (renamed from src/mixerHandler.h)0
-rw-r--r--src/core/patch.cpp (renamed from src/patch.cpp)25
-rw-r--r--src/core/patch.h (renamed from src/patch.h)0
-rw-r--r--src/core/plugin.cpp (renamed from src/plugin.cpp)2
-rw-r--r--src/core/plugin.h (renamed from src/plugin.h)2
-rw-r--r--src/core/pluginHost.cpp (renamed from src/pluginHost.cpp)4
-rw-r--r--src/core/pluginHost.h (renamed from src/pluginHost.h)4
-rw-r--r--src/core/recorder.cpp (renamed from src/recorder.cpp)5
-rw-r--r--src/core/recorder.h (renamed from src/recorder.h)4
-rw-r--r--src/core/sampleChannel.cpp (renamed from src/sampleChannel.cpp)2
-rw-r--r--src/core/sampleChannel.h (renamed from src/sampleChannel.h)0
-rw-r--r--src/core/wave.cpp (renamed from src/wave.cpp)4
-rw-r--r--src/core/wave.h (renamed from src/wave.h)0
-rw-r--r--src/core/waveFx.cpp (renamed from src/waveFx.cpp)2
-rw-r--r--src/core/waveFx.h (renamed from src/waveFx.h)0
-rw-r--r--src/deps/rtaudio-mod/Makefile.in (renamed from src/rtaudio-mod/Makefile.in)0
-rw-r--r--src/deps/rtaudio-mod/RtAudio.cpp (renamed from src/rtaudio-mod/RtAudio.cpp)0
-rw-r--r--src/deps/rtaudio-mod/RtAudio.h (renamed from src/rtaudio-mod/RtAudio.h)0
-rw-r--r--src/deps/rtaudio-mod/config/config.guess (renamed from src/rtaudio-mod/config/config.guess)0
-rwxr-xr-xsrc/deps/rtaudio-mod/config/config.sub (renamed from src/rtaudio-mod/config/config.sub)0
-rwxr-xr-xsrc/deps/rtaudio-mod/config/install.sh0
-rwxr-xr-xsrc/deps/rtaudio-mod/configure (renamed from src/rtaudio-mod/configure)0
-rw-r--r--src/deps/rtaudio-mod/configure.ac (renamed from src/rtaudio-mod/configure.ac)0
-rw-r--r--src/deps/rtaudio-mod/include/FunctionDiscoveryKeys_devpkey.h212
-rw-r--r--src/deps/rtaudio-mod/include/asio.cpp257
-rw-r--r--src/deps/rtaudio-mod/include/asio.h1054
-rw-r--r--src/deps/rtaudio-mod/include/asiodrivers.cpp186
-rw-r--r--src/deps/rtaudio-mod/include/asiodrivers.h41
-rw-r--r--src/deps/rtaudio-mod/include/asiodrvr.h76
-rw-r--r--src/deps/rtaudio-mod/include/asiolist.cpp308
-rw-r--r--src/deps/rtaudio-mod/include/asiolist.h46
-rw-r--r--src/deps/rtaudio-mod/include/asiosys.h82
-rw-r--r--src/deps/rtaudio-mod/include/dsound.h2369
-rw-r--r--src/deps/rtaudio-mod/include/ginclude.h38
-rw-r--r--src/deps/rtaudio-mod/include/iasiodrv.h37
-rw-r--r--src/deps/rtaudio-mod/include/iasiothiscallresolver.cpp572
-rw-r--r--src/deps/rtaudio-mod/include/iasiothiscallresolver.h202
-rw-r--r--src/deps/rtaudio-mod/include/soundcard.h1878
-rw-r--r--src/deps/rtaudio-mod/librtaudio.pc12
-rw-r--r--src/deps/rtaudio-mod/librtaudio.pc.in (renamed from src/rtaudio-mod/librtaudio.pc.in)0
-rwxr-xr-xsrc/deps/rtaudio-mod/rtaudio-config19
-rw-r--r--src/deps/rtaudio-mod/rtaudio-config.in (renamed from src/rtaudio-mod/rtaudio-config.in)0
-rw-r--r--src/deps/rtaudio-mod/tests/Makefile.in58
-rw-r--r--src/deps/vst/aeffect.h351
-rw-r--r--src/deps/vst/aeffectx.h1143
-rw-r--r--src/deps/vst/vstfxstore.h106
-rw-r--r--src/ext/giada.ico (renamed from src/giada.ico)bin9662 -> 9662 bytes
-rw-r--r--src/ext/resource.h (renamed from src/resource.h)0
-rw-r--r--src/ext/resource.rc (renamed from src/resource.rc)0
-rw-r--r--src/ge_channel.cpp287
-rw-r--r--src/glue/glue.cpp (renamed from src/glue.cpp)46
-rw-r--r--src/glue/glue.h (renamed from src/glue.h)0
-rw-r--r--src/gui/dialogs/gd_about.cpp (renamed from src/gd_about.cpp)14
-rw-r--r--src/gui/dialogs/gd_about.h (renamed from src/gd_about.h)2
-rw-r--r--src/gui/dialogs/gd_actionEditor.cpp (renamed from src/gd_actionEditor.cpp)24
-rw-r--r--src/gui/dialogs/gd_actionEditor.h (renamed from src/gd_actionEditor.h)2
-rw-r--r--src/gui/dialogs/gd_beatsInput.cpp (renamed from src/gd_beatsInput.cpp)10
-rw-r--r--src/gui/dialogs/gd_beatsInput.h (renamed from src/gd_beatsInput.h)2
-rw-r--r--src/gui/dialogs/gd_bpmInput.cpp (renamed from src/gd_bpmInput.cpp)10
-rw-r--r--src/gui/dialogs/gd_bpmInput.h (renamed from src/gd_bpmInput.h)2
-rw-r--r--src/gui/dialogs/gd_browser.cpp (renamed from src/gd_browser.cpp)24
-rw-r--r--src/gui/dialogs/gd_browser.h (renamed from src/gd_browser.h)2
-rw-r--r--src/gui/dialogs/gd_config.cpp (renamed from src/gd_config.cpp)16
-rw-r--r--src/gui/dialogs/gd_config.h (renamed from src/gd_config.h)2
-rw-r--r--src/gui/dialogs/gd_devInfo.cpp (renamed from src/gd_devInfo.cpp)6
-rw-r--r--src/gui/dialogs/gd_devInfo.h (renamed from src/gd_devInfo.h)0
-rw-r--r--src/gui/dialogs/gd_editor.cpp (renamed from src/gd_editor.cpp)30
-rw-r--r--src/gui/dialogs/gd_editor.h (renamed from src/gd_editor.h)2
-rw-r--r--src/gui/dialogs/gd_keyGrabber.cpp (renamed from src/gd_keyGrabber.cpp)21
-rw-r--r--src/gui/dialogs/gd_keyGrabber.h (renamed from src/gd_keyGrabber.h)2
-rw-r--r--src/gui/dialogs/gd_mainWindow.cpp (renamed from src/gd_mainWindow.cpp)159
-rw-r--r--src/gui/dialogs/gd_mainWindow.h (renamed from src/gd_mainWindow.h)41
-rw-r--r--src/gui/dialogs/gd_midiInput.cpp (renamed from src/gd_midiInput.cpp)14
-rw-r--r--src/gui/dialogs/gd_midiInput.h (renamed from src/gd_midiInput.h)8
-rw-r--r--src/gui/dialogs/gd_midiOutput.cpp (renamed from src/gd_midiOutput.cpp)18
-rw-r--r--src/gui/dialogs/gd_midiOutput.h (renamed from src/gd_midiOutput.h)2
-rw-r--r--src/gui/dialogs/gd_pluginList.cpp (renamed from src/gd_pluginList.cpp)19
-rw-r--r--src/gui/dialogs/gd_pluginList.h (renamed from src/gd_pluginList.h)2
-rw-r--r--src/gui/dialogs/gd_pluginWindow.cpp (renamed from src/gd_pluginWindow.cpp)8
-rw-r--r--src/gui/dialogs/gd_pluginWindow.h (renamed from src/gd_pluginWindow.h)2
-rw-r--r--src/gui/dialogs/gd_pluginWindowGUI.cpp (renamed from src/gd_pluginWindowGUI.cpp)11
-rw-r--r--src/gui/dialogs/gd_pluginWindowGUI.h (renamed from src/gd_pluginWindowGUI.h)2
-rw-r--r--src/gui/dialogs/gd_warnings.cpp (renamed from src/gd_warnings.cpp)0
-rw-r--r--src/gui/dialogs/gd_warnings.h (renamed from src/gd_warnings.h)4
-rw-r--r--src/gui/elems/ge_actionChannel.cpp (renamed from src/ge_actionChannel.cpp)16
-rw-r--r--src/gui/elems/ge_actionChannel.h (renamed from src/ge_actionChannel.h)6
-rw-r--r--src/gui/elems/ge_actionWidget.cpp (renamed from src/ge_actionWidget.cpp)4
-rw-r--r--src/gui/elems/ge_actionWidget.h (renamed from src/ge_actionWidget.h)2
-rw-r--r--src/gui/elems/ge_browser.cpp (renamed from src/ge_browser.cpp)6
-rw-r--r--src/gui/elems/ge_browser.h (renamed from src/ge_browser.h)0
-rw-r--r--src/gui/elems/ge_channel.cpp148
-rw-r--r--src/gui/elems/ge_channel.h (renamed from src/ge_channel.h)57
-rw-r--r--src/gui/elems/ge_channelButton.cpp118
-rw-r--r--src/gui/elems/ge_channelButton.h59
-rw-r--r--src/gui/elems/ge_column.cpp (renamed from src/ge_column.cpp)24
-rw-r--r--src/gui/elems/ge_column.h (renamed from src/ge_column.h)0
-rw-r--r--src/gui/elems/ge_controller.cpp158
-rw-r--r--src/gui/elems/ge_controller.h68
-rw-r--r--src/gui/elems/ge_envelopeChannel.cpp (renamed from src/ge_envelopeChannel.cpp)12
-rw-r--r--src/gui/elems/ge_envelopeChannel.h (renamed from src/ge_envelopeChannel.h)2
-rw-r--r--src/gui/elems/ge_keyboard.cpp (renamed from src/gg_keyboard.cpp)26
-rw-r--r--src/gui/elems/ge_keyboard.h (renamed from src/gg_keyboard.h)8
-rw-r--r--src/gui/elems/ge_midiChannel.cpp (renamed from src/ge_midiChannel.cpp)59
-rw-r--r--src/gui/elems/ge_midiChannel.h (renamed from src/ge_midiChannel.h)5
-rw-r--r--src/gui/elems/ge_midiIoTools.cpp (renamed from src/ge_midiIoTools.cpp)0
-rw-r--r--src/gui/elems/ge_midiIoTools.h (renamed from src/ge_midiIoTools.h)4
-rw-r--r--src/gui/elems/ge_mixed.cpp (renamed from src/ge_mixed.cpp)18
-rw-r--r--src/gui/elems/ge_mixed.h (renamed from src/ge_mixed.h)0
-rw-r--r--src/gui/elems/ge_modeBox.cpp109
-rw-r--r--src/gui/elems/ge_modeBox.h53
-rw-r--r--src/gui/elems/ge_muteChannel.cpp (renamed from src/ge_muteChannel.cpp)18
-rw-r--r--src/gui/elems/ge_muteChannel.h (renamed from src/ge_muteChannel.h)2
-rw-r--r--src/gui/elems/ge_pianoRoll.cpp (renamed from src/ge_pianoRoll.cpp)16
-rw-r--r--src/gui/elems/ge_pianoRoll.h (renamed from src/ge_pianoRoll.h)2
-rw-r--r--src/gui/elems/ge_sampleChannel.cpp (renamed from src/ge_sampleChannel.cpp)76
-rw-r--r--src/gui/elems/ge_sampleChannel.h (renamed from src/ge_sampleChannel.h)5
-rw-r--r--src/gui/elems/ge_status.cpp78
-rw-r--r--src/gui/elems/ge_status.h48
-rw-r--r--src/gui/elems/ge_waveTools.cpp (renamed from src/gg_waveTools.cpp)10
-rw-r--r--src/gui/elems/ge_waveTools.h (renamed from src/gg_waveTools.h)4
-rw-r--r--src/gui/elems/ge_waveform.cpp (renamed from src/ge_waveform.cpp)20
-rw-r--r--src/gui/elems/ge_waveform.h (renamed from src/ge_waveform.h)3
-rw-r--r--src/gui/elems/ge_window.cpp (renamed from src/ge_window.cpp)2
-rw-r--r--src/gui/elems/ge_window.h (renamed from src/ge_window.h)2
-rw-r--r--src/main.cpp24
-rw-r--r--src/utils/gui_utils.cpp (renamed from src/gui_utils.cpp)28
-rw-r--r--src/utils/gui_utils.h (renamed from src/gui_utils.h)4
-rw-r--r--src/utils/log.cpp (renamed from src/log.cpp)4
-rw-r--r--src/utils/log.h (renamed from src/log.h)0
-rw-r--r--src/utils/utils.cpp (renamed from src/utils.cpp)0
-rw-r--r--src/utils/utils.h (renamed from src/utils.h)0
155 files changed, 10396 insertions, 1071 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
deleted file mode 100644
index a717df4..0000000
--- a/src/Makefile.am
+++ /dev/null
@@ -1,116 +0,0 @@
-AUTOMAKE_OPTIONS = foreign
-
-
-
-# aeffect.h (header from VST SDK) uses 'long long' which is not supported
-# in ISO C++ 1998 and -Werror flag breaks the compilation.
-# This is a workaround, fixes needed.
-
-if WINDOWS
-AM_CXXFLAGS = -Wall -pedantic
-else
-AM_CXXFLAGS = -Wall -pedantic -Werror
-endif
-
-bin_PROGRAMS = giada
-
-giada_SOURCES = \
-const.h gd_keyGrabber.h glue.h mixerHandler.cpp \
-gd_about.cpp gd_mainWindow.cpp graphics.cpp mixerHandler.h \
-gd_about.h gd_mainWindow.h graphics.h patch.cpp \
-gd_beatsInput.cpp gd_warnings.cpp ge_mixed.cpp patch.h \
-gd_beatsInput.h gd_warnings.h ge_mixed.h recorder.cpp \
-gd_bpmInput.cpp ge_waveform.cpp gui_utils.cpp recorder.h \
-gd_bpmInput.h ge_waveform.h gui_utils.h utils.cpp \
-gd_browser.cpp init.cpp channel.h utils.h \
-gd_browser.h init.h gd_config.cpp channel.cpp \
-gg_keyboard.cpp kernelAudio.cpp wave.cpp gd_config.h \
-gg_keyboard.h kernelAudio.h waveFx.cpp gd_editor.cpp \
-gg_waveTools.cpp main.cpp waveFx.h gd_editor.h \
-gg_waveTools.h mixer.cpp wave.h gd_keyGrabber.cpp \
-glue.cpp mixer.h ge_browser.h ge_browser.cpp \
-gd_devInfo.cpp gd_devInfo.h plugin.h plugin.cpp \
-pluginHost.h pluginHost.cpp gd_pluginList.h gd_pluginList.cpp \
-gd_pluginWindow.h gd_pluginWindow.cpp ge_window.h ge_window.cpp \
-dataStorage.h dataStorage.cpp conf.h conf.cpp \
-gd_actionEditor.h gd_actionEditor.cpp ge_muteChannel.h ge_muteChannel.cpp \
-ge_actionChannel.h ge_actionChannel.cpp gd_pluginWindowGUI.h gd_pluginWindowGUI.cpp \
-ge_actionWidget.h ge_actionWidget.cpp ge_envelopeChannel.h ge_envelopeChannel.cpp \
-ge_pianoRoll.h ge_pianoRoll.cpp kernelMidi.h kernelMidi.cpp \
-gd_midiOutput.h gd_midiOutput.cpp gd_midiInput.h gd_midiInput.cpp \
-sampleChannel.h sampleChannel.cpp midiChannel.cpp midiChannel.h \
-midiMapConf.cpp midiMapConf.h ge_channel.h ge_channel.cpp \
-log.h log.cpp ge_column.h ge_column.cpp \
-ge_sampleChannel.h ge_sampleChannel.cpp ge_midiChannel.h ge_midiChannel.cpp \
-ge_midiIoTools.h ge_midiIoTools.cpp
-
-
-
-# Check for environment: these vars are defined via AM_CONDITIONAL
-# inside configure.ac
-
-if LINUX
-giada_LDADD = -lsndfile -lfltk -lXext -lX11 -lXft -lXpm -lm \
- rtaudio-mod/librtaudio.a -ljack -lasound -lpthread -ldl \
- -lpulse-simple -lpulse -lsamplerate -lrtmidi
-endif
-if WINDOWS
-giada_LDADD = -lrtaudio -ldsound -lwsock32 -lm -lpthread \
- -lfltk -lwininet -lgdi32 -lshell32 -lvfw32 -lrpcrt4 \
- -luuid -lcomctl32 -lole32 -lws2_32 -lsndfile \
- -lsamplerate -lrtmidi -lwinmm -lsetupapi -lksuser
-giada_LDFLAGS = -mwindows -mno-cygwin -static
-giada_SOURCES += resource.rc
-endif
-if OSX
-giada_LDADD = -lsndfile -lm -lpthread -lfltk -lrtmidi -lrtaudio \
- -lsamplerate
-giada_LDFLAGS = -framework CoreAudio -framework Cocoa -framework Carbon \
- -framework CoreMIDI -framework CoreFoundation
-endif
-
-
-# used only under MinGW to compile the resource.rc file (program icon)
-
-.rc.o:
- windres $^ -o $@
-%.o : %.rc
- windres $^ -o $@
-
-
-
-#compile libraries
-
-libs:
-if LINUX
- @cd rtaudio-mod; echo "Building RtAudio for Linux..."; \
- ./configure --with-jack --with-alsa --with-pulse; \
- make;
-endif
-if WINDOWS
- @cd rtaudio-mod; echo "Building RtAudio for Windows..."; \
- ./configure --with-asio --with-ds; \
- make;
-endif
-if OSX
- @cd rtaudio-mod; echo "Building RtAudio for OS X..."; \
- ./configure --with-core; \
- make;
-endif
-
-
-
-# rename the binaries
-
-if LINUX
-rename:
- mv giada giada_lin
-endif
-if WINDOWS
-rename:
- mv giada giada_win.exe
-endif
-if OSX
-rename:
- mv giada giada_osx
-endif
diff --git a/src/rtaudio-mod/config/install.sh b/src/core/.dirstamp
index e69de29..e69de29 100755..100644
--- a/src/rtaudio-mod/config/install.sh
+++ b/src/core/.dirstamp
diff --git a/src/channel.cpp b/src/core/channel.cpp
index 6c4c48e..85ee975 100644
--- a/src/channel.cpp
+++ b/src/core/channel.cpp
@@ -27,6 +27,8 @@
* -------------------------------------------------------------------------- */
+#include "../utils/log.h"
+#include "../gui/elems/ge_channel.h"
#include "channel.h"
#include "pluginHost.h"
#include "kernelMidi.h"
@@ -36,9 +38,7 @@
#include "mixerHandler.h"
#include "conf.h"
#include "waveFx.h"
-#include "log.h"
#include "midiMapConf.h"
-#include "ge_channel.h"
extern Patch G_Patch;
diff --git a/src/channel.h b/src/core/channel.h
index fa34eac..e346280 100644
--- a/src/channel.h
+++ b/src/core/channel.h
@@ -31,7 +31,7 @@
#define CHANNEL_H
-#include "utils.h"
+#include "../utils/utils.h"
#include "const.h"
#include "recorder.h"
@@ -47,7 +47,7 @@
#define __cdecl
#endif
#endif
- #include "vst/aeffectx.h"
+ #include "../deps/vst/aeffectx.h"
#endif
diff --git a/src/conf.cpp b/src/core/conf.cpp
index fd6720e..0dd258e 100644
--- a/src/conf.cpp
+++ b/src/core/conf.cpp
@@ -28,10 +28,10 @@
#include <stdlib.h>
-#include "const.h"
#include "conf.h"
-#include "utils.h"
-#include "log.h"
+#include "const.h"
+#include "../utils/utils.h"
+#include "../utils/log.h"
int Conf::openFileForReading()
@@ -191,7 +191,7 @@ int Conf::read()
logMode = atoi(getValue("logMode").c_str());
soundSystem = atoi(getValue("soundSystem").c_str());
- if (!soundSystem & (SYS_API_ANY)) soundSystem = DEFAULT_SOUNDSYS;
+ if (!(soundSystem & SYS_API_ANY)) soundSystem = DEFAULT_SOUNDSYS;
soundDeviceOut = atoi(getValue("soundDeviceOut").c_str());
if (soundDeviceOut < 0) soundDeviceOut = DEFAULT_SOUNDDEV_OUT;
diff --git a/src/conf.h b/src/core/conf.h
index 9120f2e..9120f2e 100644
--- a/src/conf.h
+++ b/src/core/conf.h
diff --git a/src/const.h b/src/core/const.h
index 9ada42e..0b34668 100644
--- a/src/const.h
+++ b/src/core/const.h
@@ -31,9 +31,9 @@
/* -- version --------------------------------------------------------------- */
-#define VERSIONE "0.10.0"
+#define VERSIONE "0.10.1"
#define VERSIONE_STR "Giada"
-#define VERSIONE_FLOAT 1.0f
+#define VERSIONE_FLOAT 1.01f
#define CONF_FILENAME "giada.conf"
diff --git a/src/dataStorage.cpp b/src/core/dataStorage.cpp
index 43729e8..0cea01f 100644
--- a/src/dataStorage.cpp
+++ b/src/core/dataStorage.cpp
@@ -29,9 +29,9 @@
#include <stdlib.h>
#include <limits.h>
+#include "../utils/log.h"
#include "dataStorage.h"
#include "const.h"
-#include "log.h"
std::string DataStorage::getValue(const char *in) {
diff --git a/src/dataStorage.h b/src/core/dataStorage.h
index 9d54ddf..9d54ddf 100644
--- a/src/dataStorage.h
+++ b/src/core/dataStorage.h
diff --git a/src/graphics.cpp b/src/core/graphics.cpp
index 82ca2bc..7bed054 100644
--- a/src/graphics.cpp
+++ b/src/core/graphics.cpp
@@ -1629,3 +1629,64 @@ const char *beatsMultiplyOff_xpm[] = {
" ",
" ",
" "};
+
+
+const char *channelStop_xpm[] = {
+"18 18 8 1",
+" c #242523",
+". c #312D2C",
+"+ c #413A3A",
+"@ c #615253",
+"# c #73605F",
+"$ c #7A6663",
+"% c #9C7E7D",
+"& c #B08D8E",
+" ",
+" ",
+" ",
+" ",
+" ##. ",
+" $&%@ ",
+" $&&&%+ ",
+" $&&&&&$. ",
+" $&&&&&&&@ ",
+" $&&&&&&&@. ",
+" $&&&&&$. ",
+" $&&&%+ ",
+" $&&@ ",
+" $#. ",
+" . ",
+" ",
+" ",
+" "};
+
+
+
+const char *channelPlay_xpm[] = {
+"18 18 8 1",
+" c #4D4F4C",
+". c #554E56",
+"+ c #5A4D59",
+"@ c #605068",
+"# c #775086",
+"$ c #8A509C",
+"% c #9E50B5",
+"& c #AD52D0",
+" ",
+" ",
+" ",
+" . ",
+" $$. ",
+" $&%# ",
+" $&&&%@ ",
+" $&&&&&$. ",
+" $&&&&&&&#. ",
+" $&&&&&&&#. ",
+" $&&&&&$+ ",
+" $&&&%@ ",
+" $&&# ",
+" $$. ",
+" . ",
+" ",
+" ",
+" "};
diff --git a/src/graphics.h b/src/core/graphics.h
index c76da0f..c8d9073 100644
--- a/src/graphics.h
+++ b/src/core/graphics.h
@@ -82,6 +82,9 @@ extern const char *soloOn_xpm[];
extern const char *readActionOn_xpm[];
extern const char *readActionOff_xpm[];
+extern const char *channelStop_xpm[];
+extern const char *channelPlay_xpm[];
+
#ifdef WITH_VST
extern const char *fxOff_xpm[];
extern const char *fxOn_xpm[];
diff --git a/src/init.cpp b/src/core/init.cpp
index beeab04..1ecbb2d 100644
--- a/src/init.cpp
+++ b/src/core/init.cpp
@@ -28,21 +28,21 @@
#include <ctime>
+#include "../utils/log.h"
+#include "../utils/utils.h"
+#include "../utils/gui_utils.h"
+#include "../gui/dialogs/gd_mainWindow.h"
+#include "../gui/dialogs/gd_warnings.h"
#include "init.h"
-#include "log.h"
#include "mixer.h"
#include "wave.h"
#include "const.h"
-#include "utils.h"
#include "mixerHandler.h"
#include "patch.h"
#include "conf.h"
#include "pluginHost.h"
#include "recorder.h"
#include "midiMapConf.h"
-#include "gd_mainWindow.h"
-#include "gui_utils.h"
-#include "gd_warnings.h"
#include "kernelMidi.h"
diff --git a/src/init.h b/src/core/init.h
index 0824f65..0824f65 100644
--- a/src/init.h
+++ b/src/core/init.h
diff --git a/src/kernelAudio.cpp b/src/core/kernelAudio.cpp
index 094422c..c31d507 100644
--- a/src/kernelAudio.cpp
+++ b/src/core/kernelAudio.cpp
@@ -28,11 +28,12 @@
#include <vector>
+#include "../utils/log.h"
+#include "../glue/glue.h"
#include "kernelAudio.h"
#include "mixer.h"
-#include "glue.h"
+
#include "conf.h"
-#include "log.h"
extern Mixer G_Mixer;
diff --git a/src/kernelAudio.h b/src/core/kernelAudio.h
index 0d566e8..a4673f2 100644
--- a/src/kernelAudio.h
+++ b/src/core/kernelAudio.h
@@ -31,7 +31,7 @@
#define KERNELAUDIO_H
-#include "rtaudio-mod/RtAudio.h"
+#include "../deps/rtaudio-mod/RtAudio.h"
#if defined(__linux__)
#include <jack/jack.h>
#include <jack/intclient.h>
diff --git a/src/kernelMidi.cpp b/src/core/kernelMidi.cpp
index 1d4f99b..d695ef8 100644
--- a/src/kernelMidi.cpp
+++ b/src/core/kernelMidi.cpp
@@ -28,15 +28,15 @@
#include <stdio.h>
+#include "../utils/log.h"
+#include "../glue/glue.h"
#include "kernelMidi.h"
-#include "glue.h"
#include "mixer.h"
#include "channel.h"
#include "sampleChannel.h"
#include "pluginHost.h"
#include "conf.h"
#include "midiMapConf.h"
-#include "log.h"
extern bool G_midiStatus;
diff --git a/src/kernelMidi.h b/src/core/kernelMidi.h
index d446995..d446995 100644
--- a/src/kernelMidi.h
+++ b/src/core/kernelMidi.h
diff --git a/src/midiChannel.cpp b/src/core/midiChannel.cpp
index 6f38684..dfb95f8 100644
--- a/src/midiChannel.cpp
+++ b/src/core/midiChannel.cpp
@@ -27,13 +27,13 @@
* -------------------------------------------------------------------------- */
-#include "channel.h"
+#include "../utils/log.h"
#include "midiChannel.h"
+#include "channel.h"
#include "pluginHost.h"
#include "patch.h"
#include "conf.h"
#include "kernelMidi.h"
-#include "log.h"
extern Patch G_Patch;
diff --git a/src/midiChannel.h b/src/core/midiChannel.h
index e6e1a09..275081c 100644
--- a/src/midiChannel.h
+++ b/src/core/midiChannel.h
@@ -31,6 +31,9 @@
#define MIDI_CHANNEL_H
+#include "channel.h"
+
+
#ifdef WITH_VST
/* before including aeffetx(x).h we must define __cdecl, otherwise VST
@@ -42,7 +45,7 @@
#define __cdecl
#endif
#endif
- #include "vst/aeffectx.h"
+ #include "../deps/vst/aeffectx.h"
#endif
diff --git a/src/midiMapConf.cpp b/src/core/midiMapConf.cpp
index 7fa8268..9a0dfc5 100644
--- a/src/midiMapConf.cpp
+++ b/src/core/midiMapConf.cpp
@@ -34,8 +34,8 @@
#include <dirent.h>
#include "midiMapConf.h"
#include "const.h"
-#include "utils.h"
-#include "log.h"
+#include "../utils/utils.h"
+#include "../utils/log.h"
using std::string;
@@ -149,7 +149,7 @@ int MidiMapConf::readMap(string file)
gVector<string> ic;
gSplit(getValue("init_commands"), ";", &ic);
- for (unsigned i=0; i<MAX_INIT_COMMANDS && i<ic.size; i++) {
+ for (unsigned i=0; i<(unsigned)MAX_INIT_COMMANDS && i<ic.size; i++) {
sscanf(ic.at(i).c_str(), "%d:%x", &init_channels[i], &init_messages[i]);
gLog("[MidiMapConf::readFromFile] init command %d - channel %d - message 0x%X\n",
i, init_channels[i], init_messages[i]);
@@ -207,7 +207,7 @@ void MidiMapConf::parse(string key, int *chan, uint32_t *msg, int *offset)
/* build the message as a string, for each char (i.e. nibble) in the
* original string. Substitute 'n' with zeros. */
- for (unsigned i=0, p=24; i<MAX_MIDI_NIBBLES; i++, p-=4) {
+ for (unsigned i=0, p=24; i<(unsigned)MAX_MIDI_NIBBLES; i++, p-=4) {
if (midiParts[i] == 'n') {
strmsg[i] = '0';
if (*offset == 0)
diff --git a/src/midiMapConf.h b/src/core/midiMapConf.h
index 3ff65fa..d56795a 100644
--- a/src/midiMapConf.h
+++ b/src/core/midiMapConf.h
@@ -34,7 +34,7 @@
#include <limits.h>
#include <stdint.h>
#include "dataStorage.h"
-#include "utils.h"
+#include "../utils/utils.h"
#if defined(__APPLE__)
#include <pwd.h>
#endif
diff --git a/src/mixer.cpp b/src/core/mixer.cpp
index 4c25065..2930f81 100644
--- a/src/mixer.cpp
+++ b/src/core/mixer.cpp
@@ -28,10 +28,11 @@
#include <math.h>
+#include "../utils/log.h"
+#include "../utils/gui_utils.h"
#include "mixer.h"
#include "init.h"
#include "wave.h"
-#include "gui_utils.h"
#include "recorder.h"
#include "pluginHost.h"
#include "patch.h"
@@ -41,7 +42,6 @@
#include "sampleChannel.h"
#include "midiChannel.h"
#include "kernelMidi.h"
-#include "log.h"
extern Mixer G_Mixer;
diff --git a/src/mixer.h b/src/core/mixer.h
index 586bacc..02eafd4 100644
--- a/src/mixer.h
+++ b/src/core/mixer.h
@@ -34,7 +34,7 @@
#include <pthread.h>
#include "const.h"
#include "kernelAudio.h"
-#include "utils.h"
+#include "../utils/utils.h"
class Mixer {
diff --git a/src/mixerHandler.cpp b/src/core/mixerHandler.cpp
index 4bd520f..427808b 100644
--- a/src/mixerHandler.cpp
+++ b/src/core/mixerHandler.cpp
@@ -33,23 +33,23 @@
#include <jack/transport.h>
#endif
+#include "../utils/utils.h"
+#include "../utils/log.h"
+#include "../glue/glue.h"
#include "mixerHandler.h"
#include "kernelMidi.h"
#include "mixer.h"
#include "const.h"
-#include "utils.h"
#include "init.h"
#include "pluginHost.h"
#include "plugin.h"
#include "waveFx.h"
-#include "glue.h"
#include "conf.h"
#include "patch.h"
#include "recorder.h"
#include "channel.h"
#include "sampleChannel.h"
#include "wave.h"
-#include "log.h"
extern Mixer G_Mixer;
@@ -111,15 +111,7 @@ void mh_loadPatch(bool isProject, const char *projPath)
Channel *ch = glue_addChannel(G_Patch.getColumn(i), G_Patch.getType(i));
char smpPath[PATH_MAX];
-
- /* projects < 0.6.3 version are not portable. Just use the regular
- * samplePath */
- /* TODO version >= 0.10.0 - old stuff, remove backward compatibility */
-
- if (isProject && G_Patch.version >= 0.63f)
- sprintf(smpPath, "%s%s%s", gDirname(projPath).c_str(), gGetSlash().c_str(), G_Patch.getSamplePath(i).c_str());
- else
- sprintf(smpPath, "%s", G_Patch.getSamplePath(i).c_str());
+ sprintf(smpPath, "%s%s%s", gDirname(projPath).c_str(), gGetSlash().c_str(), G_Patch.getSamplePath(i).c_str());
ch->loadByPatch(smpPath, i);
}
diff --git a/src/mixerHandler.h b/src/core/mixerHandler.h
index f842004..f842004 100644
--- a/src/mixerHandler.h
+++ b/src/core/mixerHandler.h
diff --git a/src/patch.cpp b/src/core/patch.cpp
index 005c691..3613070 100644
--- a/src/patch.cpp
+++ b/src/core/patch.cpp
@@ -28,18 +28,18 @@
#include <stdint.h>
+#include "../utils/log.h"
+#include "../utils/utils.h"
+#include "../gui/dialogs/gd_mainWindow.h"
+#include "../gui/elems/ge_keyboard.h"
#include "patch.h"
#include "init.h"
#include "recorder.h"
-#include "utils.h"
#include "conf.h"
#include "pluginHost.h"
#include "wave.h"
#include "mixer.h"
#include "channel.h"
-#include "log.h"
-#include "gd_mainWindow.h"
-#include "gg_keyboard.h"
extern Mixer G_Mixer;
@@ -60,9 +60,7 @@ int Patch::open(const char *file)
return PATCH_INVALID;
version = atof(getValue("versionf").c_str());
- gLog("[PATCH] open patch version %f\n", version);
- if (version == 0.0)
- gLog("[PATCH] patch < 0.6.1, backward compatibility mode\n");
+ gLog("[patch] open patch version %f\n", version);
return PATCH_OPEN_OK;
}
@@ -429,10 +427,7 @@ int Patch::getQuantize()
bool Patch::getMetronome()
{
- bool out = atoi(getValue("metronome").c_str());
- if (out != true || out != false)
- return false;
- return out;
+ return atoi(getValue("metronome").c_str());
}
@@ -473,7 +468,7 @@ uint32_t Patch::getMidiValue(int i, const char *c)
int Patch::readRecs()
{
- gLog("[PATCH] Reading recs...\n");
+ gLog("[patch] Reading recs...\n");
unsigned numrecs = atoi(getValue("numrecs").c_str());
@@ -530,7 +525,7 @@ int Patch::readRecs()
#ifdef WITH_VST
int Patch::readPlugins()
{
- gLog("[PATCH] Reading plugins...\n");
+ gLog("[patch] Reading plugins...\n");
int globalOut = 1;
@@ -642,7 +637,7 @@ int Patch::write(const char *file, const char *name, bool project)
for (int j=0; j<numPlugs; j++) {
pPlugin = G_PluginHost.getPluginByIndex(j, PluginHost::CHANNEL, ch);
if (!pPlugin->status) {
- gLog("[PATCH] Plugin %d is in a bad status, skip writing params\n", i);
+ gLog("[patch] Plugin %d is in a bad status, skip writing params\n", i);
continue;
}
fprintf(fp, "chan%d_p%dpathfile=%s\n", ch->index, j, pPlugin->pathfile);
@@ -727,7 +722,7 @@ void Patch::writeMasterPlugins(int type)
Plugin *pPlugin = G_PluginHost.getPluginByIndex(i, type);
if (!pPlugin->status) {
- gLog("[PATCH] Plugin %d is in a bad status, skip writing params\n", i);
+ gLog("[patch] Plugin %d is in a bad status, skip writing params\n", i);
continue;
}
diff --git a/src/patch.h b/src/core/patch.h
index e431b85..e431b85 100644
--- a/src/patch.h
+++ b/src/core/patch.h
diff --git a/src/plugin.cpp b/src/core/plugin.cpp
index 17cace3..d54c7df 100644
--- a/src/plugin.cpp
+++ b/src/core/plugin.cpp
@@ -28,8 +28,8 @@
#ifdef WITH_VST
+#include "../utils/log.h"
#include "plugin.h"
-#include "log.h"
int Plugin::id_generator = 0;
diff --git a/src/plugin.h b/src/core/plugin.h
index 0dbaef7..b03c343 100644
--- a/src/plugin.h
+++ b/src/core/plugin.h
@@ -43,7 +43,7 @@
#endif
#endif
-#include "vst/aeffectx.h"
+#include "../deps/vst/aeffectx.h"
#if defined(_WIN32)
#include <windows.h>
diff --git a/src/pluginHost.cpp b/src/core/pluginHost.cpp
index f28f5aa..6202050 100644
--- a/src/pluginHost.cpp
+++ b/src/core/pluginHost.cpp
@@ -30,16 +30,16 @@
#ifdef WITH_VST
+#include "../gui/dialogs/gd_mainWindow.h"
+#include "../utils/log.h"
#include "pluginHost.h"
#include "conf.h"
#include "const.h"
#include "mixer.h"
-#include "gd_mainWindow.h"
#include "channel.h"
#include "sampleChannel.h"
#include "midiChannel.h"
#include "kernelMidi.h"
-#include "log.h"
extern Conf G_Conf;
diff --git a/src/pluginHost.h b/src/core/pluginHost.h
index 9b4db08..58907ad 100644
--- a/src/pluginHost.h
+++ b/src/core/pluginHost.h
@@ -31,9 +31,9 @@
#ifndef __PLUGIN_HOST_
#define __PLUGIN_HOST_
-#include "ge_window.h"
+#include "../utils/utils.h"
+#include "../gui/elems/ge_window.h"
#include "plugin.h"
-#include "utils.h"
#include "init.h"
#include "const.h"
diff --git a/src/recorder.cpp b/src/core/recorder.cpp
index a0c8f0d..73d9b38 100644
--- a/src/recorder.cpp
+++ b/src/core/recorder.cpp
@@ -31,18 +31,17 @@
#include <math.h>
#include "recorder.h"
#include "const.h"
-#include "utils.h"
#include "mixer.h"
#include "mixerHandler.h"
#include "kernelAudio.h"
#include "pluginHost.h"
#include "kernelMidi.h"
-#include "utils.h"
#include "patch.h"
#include "conf.h"
#include "channel.h"
#include "sampleChannel.h"
-#include "log.h"
+#include "../utils/log.h"
+#include "../utils/utils.h"
#ifdef WITH_VST
diff --git a/src/recorder.h b/src/core/recorder.h
index 0fd378d..6c9c65e 100644
--- a/src/recorder.h
+++ b/src/core/recorder.h
@@ -31,7 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "utils.h"
+#include "../utils/utils.h"
#include "const.h"
#include "mixer.h"
@@ -46,7 +46,7 @@
#define __cdecl
#endif
#endif
- #include "vst/aeffectx.h"
+ #include "../deps/vst/aeffectx.h"
#endif
/*
diff --git a/src/sampleChannel.cpp b/src/core/sampleChannel.cpp
index 1b9cb29..81ba29f 100644
--- a/src/sampleChannel.cpp
+++ b/src/core/sampleChannel.cpp
@@ -28,6 +28,7 @@
#include <math.h>
+#include "../utils/log.h"
#include "sampleChannel.h"
#include "patch.h"
#include "conf.h"
@@ -36,7 +37,6 @@
#include "waveFx.h"
#include "mixerHandler.h"
#include "kernelMidi.h"
-#include "log.h"
extern Patch G_Patch;
diff --git a/src/sampleChannel.h b/src/core/sampleChannel.h
index 736063a..736063a 100644
--- a/src/sampleChannel.h
+++ b/src/core/sampleChannel.h
diff --git a/src/wave.cpp b/src/core/wave.cpp
index edaef7b..ee81c6d 100644
--- a/src/wave.cpp
+++ b/src/core/wave.cpp
@@ -31,11 +31,11 @@
#include <stdlib.h>
#include <string.h> // memcpy
#include <math.h>
+#include "../utils/utils.h"
+#include "../utils/log.h"
#include "wave.h"
-#include "utils.h"
#include "conf.h"
#include "init.h"
-#include "log.h"
extern Conf G_Conf;
diff --git a/src/wave.h b/src/core/wave.h
index 9ce81df..9ce81df 100644
--- a/src/wave.h
+++ b/src/core/wave.h
diff --git a/src/waveFx.cpp b/src/core/waveFx.cpp
index 25e0812..368bd79 100644
--- a/src/waveFx.cpp
+++ b/src/core/waveFx.cpp
@@ -28,11 +28,11 @@
#include <math.h>
+#include "../utils/log.h"
#include "waveFx.h"
#include "channel.h"
#include "mixer.h"
#include "wave.h"
-#include "log.h"
extern Mixer G_Mixer;
diff --git a/src/waveFx.h b/src/core/waveFx.h
index ebdef4a..ebdef4a 100644
--- a/src/waveFx.h
+++ b/src/core/waveFx.h
diff --git a/src/rtaudio-mod/Makefile.in b/src/deps/rtaudio-mod/Makefile.in
index 89cacdc..89cacdc 100644
--- a/src/rtaudio-mod/Makefile.in
+++ b/src/deps/rtaudio-mod/Makefile.in
diff --git a/src/rtaudio-mod/RtAudio.cpp b/src/deps/rtaudio-mod/RtAudio.cpp
index 5716c59..5716c59 100644
--- a/src/rtaudio-mod/RtAudio.cpp
+++ b/src/deps/rtaudio-mod/RtAudio.cpp
diff --git a/src/rtaudio-mod/RtAudio.h b/src/deps/rtaudio-mod/RtAudio.h
index a3534ad..a3534ad 100644
--- a/src/rtaudio-mod/RtAudio.h
+++ b/src/deps/rtaudio-mod/RtAudio.h
diff --git a/src/rtaudio-mod/config/config.guess b/src/deps/rtaudio-mod/config/config.guess
index 313be34..313be34 100644
--- a/src/rtaudio-mod/config/config.guess
+++ b/src/deps/rtaudio-mod/config/config.guess
diff --git a/src/rtaudio-mod/config/config.sub b/src/deps/rtaudio-mod/config/config.sub
index 9a7d59a..9a7d59a 100755
--- a/src/rtaudio-mod/config/config.sub
+++ b/src/deps/rtaudio-mod/config/config.sub
diff --git a/src/deps/rtaudio-mod/config/install.sh b/src/deps/rtaudio-mod/config/install.sh
new file mode 100755
index 0000000..e69de29
--- /dev/null
+++ b/src/deps/rtaudio-mod/config/install.sh
diff --git a/src/rtaudio-mod/configure b/src/deps/rtaudio-mod/configure
index 9f3d3f8..9f3d3f8 100755
--- a/src/rtaudio-mod/configure
+++ b/src/deps/rtaudio-mod/configure
diff --git a/src/rtaudio-mod/configure.ac b/src/deps/rtaudio-mod/configure.ac
index fa45967..fa45967 100644
--- a/src/rtaudio-mod/configure.ac
+++ b/src/deps/rtaudio-mod/configure.ac
diff --git a/src/deps/rtaudio-mod/include/FunctionDiscoveryKeys_devpkey.h b/src/deps/rtaudio-mod/include/FunctionDiscoveryKeys_devpkey.h
new file mode 100644
index 0000000..854244d
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/FunctionDiscoveryKeys_devpkey.h
@@ -0,0 +1,212 @@
+#pragma once
+
+/*++
+
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Module Name:
+
+ devpkey.h
+
+Abstract:
+
+ Defines property keys for the Plug and Play Device Property API.
+
+Author:
+
+ Jim Cavalaris (jamesca) 10-14-2003
+
+Environment:
+
+ User-mode only.
+
+Revision History:
+
+ 14-October-2003 jamesca
+
+ Creation and initial implementation.
+
+ 20-June-2006 dougb
+
+ Copied Jim's version replaced "DEFINE_DEVPROPKEY(DEVPKEY_" with "DEFINE_PROPERTYKEY(PKEY_"
+
+--*/
+
+//#include <devpropdef.h>
+
+//
+// _NAME
+//
+
+DEFINE_PROPERTYKEY(PKEY_NAME, 0xb725f130, 0x47ef, 0x101a, 0xa5, 0xf1, 0x02, 0x60, 0x8c, 0x9e, 0xeb, 0xac, 10); // DEVPROP_TYPE_STRING
+
+//
+// Device properties
+// These PKEYs correspond to the old setupapi SPDRP_XXX properties
+//
+DEFINE_PROPERTYKEY(PKEY_Device_DeviceDesc, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 2); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_HardwareIds, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 3); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_CompatibleIds, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 4); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_Service, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 6); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_Class, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 9); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_ClassGuid, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 10); // DEVPROP_TYPE_GUID
+DEFINE_PROPERTYKEY(PKEY_Device_Driver, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 11); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_ConfigFlags, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 12); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_Manufacturer, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 13); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_LocationInfo, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 15); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_PDOName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 16); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_Capabilities, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 17); // DEVPROP_TYPE_UNINT32
+DEFINE_PROPERTYKEY(PKEY_Device_UINumber, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 18); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_UpperFilters, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 19); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_LowerFilters, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 20); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_BusTypeGuid, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 21); // DEVPROP_TYPE_GUID
+DEFINE_PROPERTYKEY(PKEY_Device_LegacyBusType, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 22); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_BusNumber, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 23); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_EnumeratorName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 24); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_Security, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 25); // DEVPROP_TYPE_SECURITY_DESCRIPTOR
+DEFINE_PROPERTYKEY(PKEY_Device_SecuritySDS, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 26); // DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_DevType, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 27); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_Exclusive, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 28); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_Characteristics, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 29); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_Address, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 30); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_UINumberDescFormat, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 31); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_PowerData, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 32); // DEVPROP_TYPE_BINARY
+DEFINE_PROPERTYKEY(PKEY_Device_RemovalPolicy, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 33); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_RemovalPolicyDefault, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 34); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_RemovalPolicyOverride, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 35); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_InstallState, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 36); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_LocationPaths, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 37); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_BaseContainerId, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 38); // DEVPROP_TYPE_GUID
+
+//
+// Device properties
+// These PKEYs correspond to a device's status and problem code
+//
+DEFINE_PROPERTYKEY(PKEY_Device_DevNodeStatus, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 2); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_ProblemCode, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 3); // DEVPROP_TYPE_UINT32
+
+//
+// Device properties
+// These PKEYs correspond to device relations
+//
+DEFINE_PROPERTYKEY(PKEY_Device_EjectionRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 4); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_RemovalRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 5); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_PowerRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 6); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_BusRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 7); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_Parent, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 8); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_Children, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 9); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_Siblings, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 10); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_TransportRelations, 0x4340a6c5, 0x93fa, 0x4706, 0x97, 0x2c, 0x7b, 0x64, 0x80, 0x08, 0xa5, 0xa7, 11); // DEVPROP_TYPE_STRING_LIST
+
+//
+// Other Device properties
+//
+DEFINE_PROPERTYKEY(PKEY_Device_Reported, 0x80497100, 0x8c73, 0x48b9, 0xaa, 0xd9, 0xce, 0x38, 0x7e, 0x19, 0xc5, 0x6e, 2); // DEVPROP_TYPE_BOOLEAN
+DEFINE_PROPERTYKEY(PKEY_Device_Legacy, 0x80497100, 0x8c73, 0x48b9, 0xaa, 0xd9, 0xce, 0x38, 0x7e, 0x19, 0xc5, 0x6e, 3); // DEVPROP_TYPE_BOOLEAN
+DEFINE_PROPERTYKEY(PKEY_Device_InstanceId, 0x78c34fc8, 0x104a, 0x4aca, 0x9e, 0xa4, 0x52, 0x4d, 0x52, 0x99, 0x6e, 0x57, 256); // DEVPROP_TYPE_STRING
+
+DEFINE_PROPERTYKEY(PKEY_Device_ContainerId, 0x8c7ed206, 0x3f8a, 0x4827, 0xb3, 0xab, 0xae, 0x9e, 0x1f, 0xae, 0xfc, 0x6c, 2); // DEVPROP_TYPE_GUID
+
+DEFINE_PROPERTYKEY(PKEY_Device_ModelId, 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 2); // DEVPROP_TYPE_GUID
+
+DEFINE_PROPERTYKEY(PKEY_Device_FriendlyNameAttributes, 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 3); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_ManufacturerAttributes, 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 4); // DEVPROP_TYPE_UINT32
+
+DEFINE_PROPERTYKEY(PKEY_Device_PresenceNotForDevice, 0x80d81ea6, 0x7473, 0x4b0c, 0x82, 0x16, 0xef, 0xc1, 0x1a, 0x2c, 0x4c, 0x8b, 5); // DEVPROP_TYPE_BOOLEAN
+
+
+DEFINE_PROPERTYKEY(PKEY_Numa_Proximity_Domain, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 1); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_DHP_Rebalance_Policy, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 2); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_Numa_Node, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 3); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_BusReportedDeviceDesc, 0x540b947e, 0x8b40, 0x45bc, 0xa8, 0xa2, 0x6a, 0x0b, 0x89, 0x4c, 0xbd, 0xa2, 4); // DEVPROP_TYPE_STRING
+
+DEFINE_PROPERTYKEY(PKEY_Device_InstallInProgress, 0x83da6326, 0x97a6, 0x4088, 0x94, 0x53, 0xa1, 0x92, 0x3f, 0x57, 0x3b, 0x29, 9); // DEVPROP_TYPE_BOOLEAN
+
+//
+// Device driver properties
+//
+DEFINE_PROPERTYKEY(PKEY_Device_DriverDate, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 2); // DEVPROP_TYPE_FILETIME
+DEFINE_PROPERTYKEY(PKEY_Device_DriverVersion, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 3); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_DriverDesc, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 4); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_DriverInfPath, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 5); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_DriverInfSection, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 6); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_DriverInfSectionExt, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 7); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_MatchingDeviceId, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 8); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_DriverProvider, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 9); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_DriverPropPageProvider, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 10); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_DriverCoInstallers, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 11); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_Device_ResourcePickerTags, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 12); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_ResourcePickerExceptions, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 13); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_Device_DriverRank, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 14); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_DriverLogoLevel, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 15); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_Device_NoConnectSound, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 17); // DEVPROP_TYPE_BOOLEAN
+DEFINE_PROPERTYKEY(PKEY_Device_GenericDriverInstalled, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 18); // DEVPROP_TYPE_BOOLEAN
+DEFINE_PROPERTYKEY(PKEY_Device_AdditionalSoftwareRequested, 0xa8b865dd, 0x2e3d, 0x4094, 0xad, 0x97, 0xe5, 0x93, 0xa7, 0xc, 0x75, 0xd6, 19);// DEVPROP_TYPE_BOOLEAN
+
+//
+// Device safe-removal properties
+//
+DEFINE_PROPERTYKEY(PKEY_Device_SafeRemovalRequired, 0xafd97640, 0x86a3, 0x4210, 0xb6, 0x7c, 0x28, 0x9c, 0x41, 0xaa, 0xbe, 0x55, 2); // DEVPROP_TYPE_BOOLEAN
+DEFINE_PROPERTYKEY(PKEY_Device_SafeRemovalRequiredOverride, 0xafd97640, 0x86a3, 0x4210, 0xb6, 0x7c, 0x28, 0x9c, 0x41, 0xaa, 0xbe, 0x55, 3);// DEVPROP_TYPE_BOOLEAN
+
+
+//
+// Device properties that were set by the driver package that was installed
+// on the device.
+//
+DEFINE_PROPERTYKEY(PKEY_DrvPkg_Model, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 2); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_DrvPkg_VendorWebSite, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 3); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_DrvPkg_DetailedDescription, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 4); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_DrvPkg_DocumentationLink, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 5); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_DrvPkg_Icon, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 6); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_DrvPkg_BrandingIcon, 0xcf73bb51, 0x3abf, 0x44a2, 0x85, 0xe0, 0x9a, 0x3d, 0xc7, 0xa1, 0x21, 0x32, 7); // DEVPROP_TYPE_STRING_LIST
+
+//
+// Device setup class properties
+// These PKEYs correspond to the old setupapi SPCRP_XXX properties
+//
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_UpperFilters, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 19); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_LowerFilters, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 20); // DEVPROP_TYPE_STRING_LIST
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_Security, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 25); // DEVPROP_TYPE_SECURITY_DESCRIPTOR
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_SecuritySDS, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 26); // DEVPROP_TYPE_SECURITY_DESCRIPTOR_STRING
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_DevType, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 27); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_Exclusive, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 28); // DEVPROP_TYPE_UINT32
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_Characteristics, 0x4321918b, 0xf69e, 0x470d, 0xa5, 0xde, 0x4d, 0x88, 0xc7, 0x5a, 0xd2, 0x4b, 29); // DEVPROP_TYPE_UINT32
+
+//
+// Device setup class properties
+// These PKEYs correspond to registry values under the device class GUID key
+//
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_Name, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 2); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_ClassName, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 3); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_Icon, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 4); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_ClassInstaller, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 5); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_PropPageProvider, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 6); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_NoInstallClass, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 7); // DEVPROP_TYPE_BOOLEAN
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_NoDisplayClass, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 8); // DEVPROP_TYPE_BOOLEAN
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_SilentInstall, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 9); // DEVPROP_TYPE_BOOLEAN
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_NoUseClass, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 10); // DEVPROP_TYPE_BOOLEAN
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_DefaultService, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 11); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_IconPath, 0x259abffc, 0x50a7, 0x47ce, 0xaf, 0x8, 0x68, 0xc9, 0xa7, 0xd7, 0x33, 0x66, 12); // DEVPROP_TYPE_STRING_LIST
+
+//
+// Other Device setup class properties
+//
+DEFINE_PROPERTYKEY(PKEY_DeviceClass_ClassCoInstallers, 0x713d1703, 0xa2e2, 0x49f5, 0x92, 0x14, 0x56, 0x47, 0x2e, 0xf3, 0xda, 0x5c, 2); // DEVPROP_TYPE_STRING_LIST
+
+//
+// Device interface properties
+//
+DEFINE_PROPERTYKEY(PKEY_DeviceInterface_FriendlyName, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 2); // DEVPROP_TYPE_STRING
+DEFINE_PROPERTYKEY(PKEY_DeviceInterface_Enabled, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 3); // DEVPROP_TYPE_BOOLEAN
+DEFINE_PROPERTYKEY(PKEY_DeviceInterface_ClassGuid, 0x026e516e, 0xb814, 0x414b, 0x83, 0xcd, 0x85, 0x6d, 0x6f, 0xef, 0x48, 0x22, 4); // DEVPROP_TYPE_GUID
+
+//
+// Device interface class properties
+//
+DEFINE_PROPERTYKEY(PKEY_DeviceInterfaceClass_DefaultInterface, 0x14c83a99, 0x0b3f, 0x44b7, 0xbe, 0x4c, 0xa1, 0x78, 0xd3, 0x99, 0x05, 0x64, 2); // DEVPROP_TYPE_STRING
+
+
+
+
diff --git a/src/deps/rtaudio-mod/include/asio.cpp b/src/deps/rtaudio-mod/include/asio.cpp
new file mode 100644
index 0000000..b241663
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/asio.cpp
@@ -0,0 +1,257 @@
+/*
+ Steinberg Audio Stream I/O API
+ (c) 1996, Steinberg Soft- und Hardware GmbH
+
+ asio.cpp
+
+ asio functions entries which translate the
+ asio interface to the asiodrvr class methods
+*/
+
+#include <string.h>
+#include "asiosys.h" // platform definition
+#include "asio.h"
+
+#if MAC
+#include "asiodrvr.h"
+
+#pragma export on
+
+AsioDriver *theAsioDriver = 0;
+
+extern "C"
+{
+
+long main()
+{
+ return 'ASIO';
+}
+
+#elif WINDOWS
+
+#include "windows.h"
+#include "iasiodrv.h"
+#include "asiodrivers.h"
+
+IASIO *theAsioDriver = 0;
+extern AsioDrivers *asioDrivers;
+
+#elif SGI || SUN || BEOS || LINUX
+#include "asiodrvr.h"
+static AsioDriver *theAsioDriver = 0;
+#endif
+
+//-----------------------------------------------------------------------------------------------------
+ASIOError ASIOInit(ASIODriverInfo *info)
+{
+#if MAC || SGI || SUN || BEOS || LINUX
+ if(theAsioDriver)
+ {
+ delete theAsioDriver;
+ theAsioDriver = 0;
+ }
+ info->driverVersion = 0;
+ strcpy(info->name, "No ASIO Driver");
+ theAsioDriver = getDriver();
+ if(!theAsioDriver)
+ {
+ strcpy(info->errorMessage, "Not enough memory for the ASIO driver!");
+ return ASE_NotPresent;
+ }
+ if(!theAsioDriver->init(info->sysRef))
+ {
+ theAsioDriver->getErrorMessage(info->errorMessage);
+ delete theAsioDriver;
+ theAsioDriver = 0;
+ return ASE_NotPresent;
+ }
+ strcpy(info->errorMessage, "No ASIO Driver Error");
+ theAsioDriver->getDriverName(info->name);
+ info->driverVersion = theAsioDriver->getDriverVersion();
+ return ASE_OK;
+
+#else
+
+ info->driverVersion = 0;
+ strcpy(info->name, "No ASIO Driver");
+ if(theAsioDriver) // must be loaded!
+ {
+ if(!theAsioDriver->init(info->sysRef))
+ {
+ theAsioDriver->getErrorMessage(info->errorMessage);
+ theAsioDriver = 0;
+ return ASE_NotPresent;
+ }
+
+ strcpy(info->errorMessage, "No ASIO Driver Error");
+ theAsioDriver->getDriverName(info->name);
+ info->driverVersion = theAsioDriver->getDriverVersion();
+ return ASE_OK;
+ }
+ return ASE_NotPresent;
+
+#endif // !MAC
+}
+
+ASIOError ASIOExit(void)
+{
+ if(theAsioDriver)
+ {
+#if WINDOWS
+ asioDrivers->removeCurrentDriver();
+#else
+ delete theAsioDriver;
+#endif
+ }
+ theAsioDriver = 0;
+ return ASE_OK;
+}
+
+ASIOError ASIOStart(void)
+{
+ if(!theAsioDriver)
+ return ASE_NotPresent;
+ return theAsioDriver->start();
+}
+
+ASIOError ASIOStop(void)
+{
+ if(!theAsioDriver)
+ return ASE_NotPresent;
+ return theAsioDriver->stop();
+}
+
+ASIOError ASIOGetChannels(long *numInputChannels, long *numOutputChannels)
+{
+ if(!theAsioDriver)
+ {
+ *numInputChannels = *numOutputChannels = 0;
+ return ASE_NotPresent;
+ }
+ return theAsioDriver->getChannels(numInputChannels, numOutputChannels);
+}
+
+ASIOError ASIOGetLatencies(long *inputLatency, long *outputLatency)
+{
+ if(!theAsioDriver)
+ {
+ *inputLatency = *outputLatency = 0;
+ return ASE_NotPresent;
+ }
+ return theAsioDriver->getLatencies(inputLatency, outputLatency);
+}
+
+ASIOError ASIOGetBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity)
+{
+ if(!theAsioDriver)
+ {
+ *minSize = *maxSize = *preferredSize = *granularity = 0;
+ return ASE_NotPresent;
+ }
+ return theAsioDriver->getBufferSize(minSize, maxSize, preferredSize, granularity);
+}
+
+ASIOError ASIOCanSampleRate(ASIOSampleRate sampleRate)
+{
+ if(!theAsioDriver)
+ return ASE_NotPresent;
+ return theAsioDriver->canSampleRate(sampleRate);
+}
+
+ASIOError ASIOGetSampleRate(ASIOSampleRate *currentRate)
+{
+ if(!theAsioDriver)
+ return ASE_NotPresent;
+ return theAsioDriver->getSampleRate(currentRate);
+}
+
+ASIOError ASIOSetSampleRate(ASIOSampleRate sampleRate)
+{
+ if(!theAsioDriver)
+ return ASE_NotPresent;
+ return theAsioDriver->setSampleRate(sampleRate);
+}
+
+ASIOError ASIOGetClockSources(ASIOClockSource *clocks, long *numSources)
+{
+ if(!theAsioDriver)
+ {
+ *numSources = 0;
+ return ASE_NotPresent;
+ }
+ return theAsioDriver->getClockSources(clocks, numSources);
+}
+
+ASIOError ASIOSetClockSource(long reference)
+{
+ if(!theAsioDriver)
+ return ASE_NotPresent;
+ return theAsioDriver->setClockSource(reference);
+}
+
+ASIOError ASIOGetSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp)
+{
+ if(!theAsioDriver)
+ return ASE_NotPresent;
+ return theAsioDriver->getSamplePosition(sPos, tStamp);
+}
+
+ASIOError ASIOGetChannelInfo(ASIOChannelInfo *info)
+{
+ if(!theAsioDriver)
+ {
+ info->channelGroup = -1;
+ info->type = ASIOSTInt16MSB;
+ strcpy(info->name, "None");
+ return ASE_NotPresent;
+ }
+ return theAsioDriver->getChannelInfo(info);
+}
+
+ASIOError ASIOCreateBuffers(ASIOBufferInfo *bufferInfos, long numChannels,
+ long bufferSize, ASIOCallbacks *callbacks)
+{
+ if(!theAsioDriver)
+ {
+ ASIOBufferInfo *info = bufferInfos;
+ for(long i = 0; i < numChannels; i++, info++)
+ info->buffers[0] = info->buffers[1] = 0;
+ return ASE_NotPresent;
+ }
+ return theAsioDriver->createBuffers(bufferInfos, numChannels, bufferSize, callbacks);
+}
+
+ASIOError ASIODisposeBuffers(void)
+{
+ if(!theAsioDriver)
+ return ASE_NotPresent;
+ return theAsioDriver->disposeBuffers();
+}
+
+ASIOError ASIOControlPanel(void)
+{
+ if(!theAsioDriver)
+ return ASE_NotPresent;
+ return theAsioDriver->controlPanel();
+}
+
+ASIOError ASIOFuture(long selector, void *opt)
+{
+ if(!theAsioDriver)
+ return ASE_NotPresent;
+ return theAsioDriver->future(selector, opt);
+}
+
+ASIOError ASIOOutputReady(void)
+{
+ if(!theAsioDriver)
+ return ASE_NotPresent;
+ return theAsioDriver->outputReady();
+}
+
+#if MAC
+} // extern "C"
+#pragma export off
+#endif
+
+
diff --git a/src/deps/rtaudio-mod/include/asio.h b/src/deps/rtaudio-mod/include/asio.h
new file mode 100644
index 0000000..8ec811f
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/asio.h
@@ -0,0 +1,1054 @@
+//---------------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------------
+
+/*
+ Steinberg Audio Stream I/O API
+ (c) 1997 - 2005, Steinberg Media Technologies GmbH
+
+ ASIO Interface Specification v 2.1
+
+ 2005 - Added support for DSD sample data (in cooperation with Sony)
+
+
+ basic concept is an i/o synchronous double-buffer scheme:
+
+ on bufferSwitch(index == 0), host will read/write:
+
+ after ASIOStart(), the
+ read first input buffer A (index 0)
+ | will be invalid (empty)
+ * ------------------------
+ |------------------------|-----------------------|
+ | | |
+ | Input Buffer A (0) | Input Buffer B (1) |
+ | | |
+ |------------------------|-----------------------|
+ | | |
+ | Output Buffer A (0) | Output Buffer B (1) |
+ | | |
+ |------------------------|-----------------------|
+ * -------------------------
+ | before calling ASIOStart(),
+ write host will have filled output
+ buffer B (index 1) already
+
+ *please* take special care of proper statement of input
+ and output latencies (see ASIOGetLatencies()), these
+ control sequencer sync accuracy
+
+*/
+
+//---------------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------------
+
+/*
+
+prototypes summary:
+
+ASIOError ASIOInit(ASIODriverInfo *info);
+ASIOError ASIOExit(void);
+ASIOError ASIOStart(void);
+ASIOError ASIOStop(void);
+ASIOError ASIOGetChannels(long *numInputChannels, long *numOutputChannels);
+ASIOError ASIOGetLatencies(long *inputLatency, long *outputLatency);
+ASIOError ASIOGetBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity);
+ASIOError ASIOCanSampleRate(ASIOSampleRate sampleRate);
+ASIOError ASIOGetSampleRate(ASIOSampleRate *currentRate);
+ASIOError ASIOSetSampleRate(ASIOSampleRate sampleRate);
+ASIOError ASIOGetClockSources(ASIOClockSource *clocks, long *numSources);
+ASIOError ASIOSetClockSource(long reference);
+ASIOError ASIOGetSamplePosition (ASIOSamples *sPos, ASIOTimeStamp *tStamp);
+ASIOError ASIOGetChannelInfo(ASIOChannelInfo *info);
+ASIOError ASIOCreateBuffers(ASIOBufferInfo *bufferInfos, long numChannels,
+ long bufferSize, ASIOCallbacks *callbacks);
+ASIOError ASIODisposeBuffers(void);
+ASIOError ASIOControlPanel(void);
+void *ASIOFuture(long selector, void *params);
+ASIOError ASIOOutputReady(void);
+
+*/
+
+//---------------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------------
+
+#ifndef __ASIO_H
+#define __ASIO_H
+
+// force 4 byte alignment
+#if defined(_MSC_VER) && !defined(__MWERKS__)
+#pragma pack(push,4)
+#elif PRAGMA_ALIGN_SUPPORTED
+#pragma options align = native
+#endif
+
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+// Type definitions
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+
+// number of samples data type is 64 bit integer
+#if NATIVE_INT64
+ typedef long long int ASIOSamples;
+#else
+ typedef struct ASIOSamples {
+ unsigned long hi;
+ unsigned long lo;
+ } ASIOSamples;
+#endif
+
+// Timestamp data type is 64 bit integer,
+// Time format is Nanoseconds.
+#if NATIVE_INT64
+ typedef long long int ASIOTimeStamp ;
+#else
+ typedef struct ASIOTimeStamp {
+ unsigned long hi;
+ unsigned long lo;
+ } ASIOTimeStamp;
+#endif
+
+// Samplerates are expressed in IEEE 754 64 bit double float,
+// native format as host computer
+#if IEEE754_64FLOAT
+ typedef double ASIOSampleRate;
+#else
+ typedef struct ASIOSampleRate {
+ char ieee[8];
+ } ASIOSampleRate;
+#endif
+
+// Boolean values are expressed as long
+typedef long ASIOBool;
+enum {
+ ASIOFalse = 0,
+ ASIOTrue = 1
+};
+
+// Sample Types are expressed as long
+typedef long ASIOSampleType;
+enum {
+ ASIOSTInt16MSB = 0,
+ ASIOSTInt24MSB = 1, // used for 20 bits as well
+ ASIOSTInt32MSB = 2,
+ ASIOSTFloat32MSB = 3, // IEEE 754 32 bit float
+ ASIOSTFloat64MSB = 4, // IEEE 754 64 bit double float
+
+ // these are used for 32 bit data buffer, with different alignment of the data inside
+ // 32 bit PCI bus systems can be more easily used with these
+ ASIOSTInt32MSB16 = 8, // 32 bit data with 16 bit alignment
+ ASIOSTInt32MSB18 = 9, // 32 bit data with 18 bit alignment
+ ASIOSTInt32MSB20 = 10, // 32 bit data with 20 bit alignment
+ ASIOSTInt32MSB24 = 11, // 32 bit data with 24 bit alignment
+
+ ASIOSTInt16LSB = 16,
+ ASIOSTInt24LSB = 17, // used for 20 bits as well
+ ASIOSTInt32LSB = 18,
+ ASIOSTFloat32LSB = 19, // IEEE 754 32 bit float, as found on Intel x86 architecture
+ ASIOSTFloat64LSB = 20, // IEEE 754 64 bit double float, as found on Intel x86 architecture
+
+ // these are used for 32 bit data buffer, with different alignment of the data inside
+ // 32 bit PCI bus systems can more easily used with these
+ ASIOSTInt32LSB16 = 24, // 32 bit data with 18 bit alignment
+ ASIOSTInt32LSB18 = 25, // 32 bit data with 18 bit alignment
+ ASIOSTInt32LSB20 = 26, // 32 bit data with 20 bit alignment
+ ASIOSTInt32LSB24 = 27, // 32 bit data with 24 bit alignment
+
+ // ASIO DSD format.
+ ASIOSTDSDInt8LSB1 = 32, // DSD 1 bit data, 8 samples per byte. First sample in Least significant bit.
+ ASIOSTDSDInt8MSB1 = 33, // DSD 1 bit data, 8 samples per byte. First sample in Most significant bit.
+ ASIOSTDSDInt8NER8 = 40, // DSD 8 bit data, 1 sample per byte. No Endianness required.
+
+ ASIOSTLastEntry
+};
+
+/*-----------------------------------------------------------------------------
+// DSD operation and buffer layout
+// Definition by Steinberg/Sony Oxford.
+//
+// We have tried to treat DSD as PCM and so keep a consistant structure across
+// the ASIO interface.
+//
+// DSD's sample rate is normally referenced as a multiple of 44.1Khz, so
+// the standard sample rate is refered to as 64Fs (or 2.8224Mhz). We looked
+// at making a special case for DSD and adding a field to the ASIOFuture that
+// would allow the user to select the Over Sampleing Rate (OSR) as a seperate
+// entity but decided in the end just to treat it as a simple value of
+// 2.8224Mhz and use the standard interface to set it.
+//
+// The second problem was the "word" size, in PCM the word size is always a
+// greater than or equal to 8 bits (a byte). This makes life easy as we can
+// then pack the samples into the "natural" size for the machine.
+// In DSD the "word" size is 1 bit. This is not a major problem and can easily
+// be dealt with if we ensure that we always deal with a multiple of 8 samples.
+//
+// DSD brings with it another twist to the Endianness religion. How are the
+// samples packed into the byte. It would be nice to just say the most significant
+// bit is always the first sample, however there would then be a performance hit
+// on little endian machines. Looking at how some of the processing goes...
+// Little endian machines like the first sample to be in the Least Significant Bit,
+// this is because when you write it to memory the data is in the correct format
+// to be shifted in and out of the words.
+// Big endian machine prefer the first sample to be in the Most Significant Bit,
+// again for the same reasion.
+//
+// And just when things were looking really muddy there is a proposed extension to
+// DSD that uses 8 bit word sizes. It does not care what endianness you use.
+//
+// Switching the driver between DSD and PCM mode
+// ASIOFuture allows for extending the ASIO API quite transparently.
+// See kAsioSetIoFormat, kAsioGetIoFormat, kAsioCanDoIoFormat
+//
+//-----------------------------------------------------------------------------*/
+
+
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+// Error codes
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+
+typedef long ASIOError;
+enum {
+ ASE_OK = 0, // This value will be returned whenever the call succeeded
+ ASE_SUCCESS = 0x3f4847a0, // unique success return value for ASIOFuture calls
+ ASE_NotPresent = -1000, // hardware input or output is not present or available
+ ASE_HWMalfunction, // hardware is malfunctioning (can be returned by any ASIO function)
+ ASE_InvalidParameter, // input parameter invalid
+ ASE_InvalidMode, // hardware is in a bad mode or used in a bad mode
+ ASE_SPNotAdvancing, // hardware is not running when sample position is inquired
+ ASE_NoClock, // sample clock or rate cannot be determined or is not present
+ ASE_NoMemory // not enough memory for completing the request
+};
+
+//---------------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------------
+
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+// Time Info support
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+
+typedef struct ASIOTimeCode
+{
+ double speed; // speed relation (fraction of nominal speed)
+ // optional; set to 0. or 1. if not supported
+ ASIOSamples timeCodeSamples; // time in samples
+ unsigned long flags; // some information flags (see below)
+ char future[64];
+} ASIOTimeCode;
+
+typedef enum ASIOTimeCodeFlags
+{
+ kTcValid = 1,
+ kTcRunning = 1 << 1,
+ kTcReverse = 1 << 2,
+ kTcOnspeed = 1 << 3,
+ kTcStill = 1 << 4,
+
+ kTcSpeedValid = 1 << 8
+} ASIOTimeCodeFlags;
+
+typedef struct AsioTimeInfo
+{
+ double speed; // absolute speed (1. = nominal)
+ ASIOTimeStamp systemTime; // system time related to samplePosition, in nanoseconds
+ // on mac, must be derived from Microseconds() (not UpTime()!)
+ // on windows, must be derived from timeGetTime()
+ ASIOSamples samplePosition;
+ ASIOSampleRate sampleRate; // current rate
+ unsigned long flags; // (see below)
+ char reserved[12];
+} AsioTimeInfo;
+
+typedef enum AsioTimeInfoFlags
+{
+ kSystemTimeValid = 1, // must always be valid
+ kSamplePositionValid = 1 << 1, // must always be valid
+ kSampleRateValid = 1 << 2,
+ kSpeedValid = 1 << 3,
+
+ kSampleRateChanged = 1 << 4,
+ kClockSourceChanged = 1 << 5
+} AsioTimeInfoFlags;
+
+typedef struct ASIOTime // both input/output
+{
+ long reserved[4]; // must be 0
+ struct AsioTimeInfo timeInfo; // required
+ struct ASIOTimeCode timeCode; // optional, evaluated if (timeCode.flags & kTcValid)
+} ASIOTime;
+
+/*
+
+using time info:
+it is recommended to use the new method with time info even if the asio
+device does not support timecode; continuous calls to ASIOGetSamplePosition
+and ASIOGetSampleRate are avoided, and there is a more defined relationship
+between callback time and the time info.
+
+see the example below.
+to initiate time info mode, after you have received the callbacks pointer in
+ASIOCreateBuffers, you will call the asioMessage callback with kAsioSupportsTimeInfo
+as the argument. if this returns 1, host has accepted time info mode.
+now host expects the new callback bufferSwitchTimeInfo to be used instead
+of the old bufferSwitch method. the ASIOTime structure is assumed to be valid
+and accessible until the callback returns.
+
+using time code:
+if the device supports reading time code, it will call host's asioMessage callback
+with kAsioSupportsTimeCode as the selector. it may then fill the according
+fields and set the kTcValid flag.
+host will call the future method with the kAsioEnableTimeCodeRead selector when
+it wants to enable or disable tc reading by the device. you should also support
+the kAsioCanTimeInfo and kAsioCanTimeCode selectors in ASIOFuture (see example).
+
+note:
+the AsioTimeInfo/ASIOTimeCode pair is supposed to work in both directions.
+as a matter of convention, the relationship between the sample
+position counter and the time code at buffer switch time is
+(ignoring offset between tc and sample pos when tc is running):
+
+on input: sample 0 -> input buffer sample 0 -> time code 0
+on output: sample 0 -> output buffer sample 0 -> time code 0
+
+this means that for 'real' calculations, one has to take into account
+the according latencies.
+
+example:
+
+ASIOTime asioTime;
+
+in createBuffers()
+{
+ memset(&asioTime, 0, sizeof(ASIOTime));
+ AsioTimeInfo* ti = &asioTime.timeInfo;
+ ti->sampleRate = theSampleRate;
+ ASIOTimeCode* tc = &asioTime.timeCode;
+ tc->speed = 1.;
+ timeInfoMode = false;
+ canTimeCode = false;
+ if(callbacks->asioMessage(kAsioSupportsTimeInfo, 0, 0, 0) == 1)
+ {
+ timeInfoMode = true;
+#if kCanTimeCode
+ if(callbacks->asioMessage(kAsioSupportsTimeCode, 0, 0, 0) == 1)
+ canTimeCode = true;
+#endif
+ }
+}
+
+void switchBuffers(long doubleBufferIndex, bool processNow)
+{
+ if(timeInfoMode)
+ {
+ AsioTimeInfo* ti = &asioTime.timeInfo;
+ ti->flags = kSystemTimeValid | kSamplePositionValid | kSampleRateValid;
+ ti->systemTime = theNanoSeconds;
+ ti->samplePosition = theSamplePosition;
+ if(ti->sampleRate != theSampleRate)
+ ti->flags |= kSampleRateChanged;
+ ti->sampleRate = theSampleRate;
+
+#if kCanTimeCode
+ if(canTimeCode && timeCodeEnabled)
+ {
+ ASIOTimeCode* tc = &asioTime.timeCode;
+ tc->timeCodeSamples = tcSamples; // tc in samples
+ tc->flags = kTcValid | kTcRunning | kTcOnspeed; // if so...
+ }
+ ASIOTime* bb = callbacks->bufferSwitchTimeInfo(&asioTime, doubleBufferIndex, processNow ? ASIOTrue : ASIOFalse);
+#else
+ callbacks->bufferSwitchTimeInfo(&asioTime, doubleBufferIndex, processNow ? ASIOTrue : ASIOFalse);
+#endif
+ }
+ else
+ callbacks->bufferSwitch(doubleBufferIndex, ASIOFalse);
+}
+
+ASIOError ASIOFuture(long selector, void *params)
+{
+ switch(selector)
+ {
+ case kAsioEnableTimeCodeRead:
+ timeCodeEnabled = true;
+ return ASE_SUCCESS;
+ case kAsioDisableTimeCodeRead:
+ timeCodeEnabled = false;
+ return ASE_SUCCESS;
+ case kAsioCanTimeInfo:
+ return ASE_SUCCESS;
+ #if kCanTimeCode
+ case kAsioCanTimeCode:
+ return ASE_SUCCESS;
+ #endif
+ }
+ return ASE_NotPresent;
+};
+
+*/
+
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+// application's audio stream handler callbacks
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+
+typedef struct ASIOCallbacks
+{
+ void (*bufferSwitch) (long doubleBufferIndex, ASIOBool directProcess);
+ // bufferSwitch indicates that both input and output are to be processed.
+ // the current buffer half index (0 for A, 1 for B) determines
+ // - the output buffer that the host should start to fill. the other buffer
+ // will be passed to output hardware regardless of whether it got filled
+ // in time or not.
+ // - the input buffer that is now filled with incoming data. Note that
+ // because of the synchronicity of i/o, the input always has at
+ // least one buffer latency in relation to the output.
+ // directProcess suggests to the host whether it should immedeately
+ // start processing (directProcess == ASIOTrue), or whether its process
+ // should be deferred because the call comes from a very low level
+ // (for instance, a high level priority interrupt), and direct processing
+ // would cause timing instabilities for the rest of the system. If in doubt,
+ // directProcess should be set to ASIOFalse.
+ // Note: bufferSwitch may be called at interrupt time for highest efficiency.
+
+ void (*sampleRateDidChange) (ASIOSampleRate sRate);
+ // gets called when the AudioStreamIO detects a sample rate change
+ // If sample rate is unknown, 0 is passed (for instance, clock loss
+ // when externally synchronized).
+
+ long (*asioMessage) (long selector, long value, void* message, double* opt);
+ // generic callback for various purposes, see selectors below.
+ // note this is only present if the asio version is 2 or higher
+
+ ASIOTime* (*bufferSwitchTimeInfo) (ASIOTime* params, long doubleBufferIndex, ASIOBool directProcess);
+ // new callback with time info. makes ASIOGetSamplePosition() and various
+ // calls to ASIOGetSampleRate obsolete,
+ // and allows for timecode sync etc. to be preferred; will be used if
+ // the driver calls asioMessage with selector kAsioSupportsTimeInfo.
+} ASIOCallbacks;
+
+// asioMessage selectors
+enum
+{
+ kAsioSelectorSupported = 1, // selector in <value>, returns 1L if supported,
+ // 0 otherwise
+ kAsioEngineVersion, // returns engine (host) asio implementation version,
+ // 2 or higher
+ kAsioResetRequest, // request driver reset. if accepted, this
+ // will close the driver (ASIO_Exit() ) and
+ // re-open it again (ASIO_Init() etc). some
+ // drivers need to reconfigure for instance
+ // when the sample rate changes, or some basic
+ // changes have been made in ASIO_ControlPanel().
+ // returns 1L; note the request is merely passed
+ // to the application, there is no way to determine
+ // if it gets accepted at this time (but it usually
+ // will be).
+ kAsioBufferSizeChange, // not yet supported, will currently always return 0L.
+ // for now, use kAsioResetRequest instead.
+ // once implemented, the new buffer size is expected
+ // in <value>, and on success returns 1L
+ kAsioResyncRequest, // the driver went out of sync, such that
+ // the timestamp is no longer valid. this
+ // is a request to re-start the engine and
+ // slave devices (sequencer). returns 1 for ok,
+ // 0 if not supported.
+ kAsioLatenciesChanged, // the drivers latencies have changed. The engine
+ // will refetch the latencies.
+ kAsioSupportsTimeInfo, // if host returns true here, it will expect the
+ // callback bufferSwitchTimeInfo to be called instead
+ // of bufferSwitch
+ kAsioSupportsTimeCode, //
+ kAsioMMCCommand, // unused - value: number of commands, message points to mmc commands
+ kAsioSupportsInputMonitor, // kAsioSupportsXXX return 1 if host supports this
+ kAsioSupportsInputGain, // unused and undefined
+ kAsioSupportsInputMeter, // unused and undefined
+ kAsioSupportsOutputGain, // unused and undefined
+ kAsioSupportsOutputMeter, // unused and undefined
+ kAsioOverload, // driver detected an overload
+
+ kAsioNumMessageSelectors
+};
+
+//---------------------------------------------------------------------------------------------------
+//---------------------------------------------------------------------------------------------------
+
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+// (De-)Construction
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+
+typedef struct ASIODriverInfo
+{
+ long asioVersion; // currently, 2
+ long driverVersion; // driver specific
+ char name[32];
+ char errorMessage[124];
+ void *sysRef; // on input: system reference
+ // (Windows: application main window handle, Mac & SGI: 0)
+} ASIODriverInfo;
+
+ASIOError ASIOInit(ASIODriverInfo *info);
+/* Purpose:
+ Initialize the AudioStreamIO.
+ Parameter:
+ info: pointer to an ASIODriver structure:
+ - asioVersion:
+ - on input, the host version. *** Note *** this is 0 for earlier asio
+ implementations, and the asioMessage callback is implemeted
+ only if asioVersion is 2 or greater. sorry but due to a design fault
+ the driver doesn't have access to the host version in ASIOInit :-(
+ added selector for host (engine) version in the asioMessage callback
+ so we're ok from now on.
+ - on return, asio implementation version.
+ older versions are 1
+ if you support this version (namely, ASIO_outputReady() )
+ this should be 2 or higher. also see the note in
+ ASIO_getTimeStamp() !
+ - version: on return, the driver version (format is driver specific)
+ - name: on return, a null-terminated string containing the driver's name
+ - error message: on return, should contain a user message describing
+ the type of error that occured during ASIOInit(), if any.
+ - sysRef: platform specific
+ Returns:
+ If neither input nor output is present ASE_NotPresent
+ will be returned.
+ ASE_NoMemory, ASE_HWMalfunction are other possible error conditions
+*/
+
+ASIOError ASIOExit(void);
+/* Purpose:
+ Terminates the AudioStreamIO.
+ Parameter:
+ None.
+ Returns:
+ If neither input nor output is present ASE_NotPresent
+ will be returned.
+ Notes: this implies ASIOStop() and ASIODisposeBuffers(),
+ meaning that no host callbacks must be accessed after ASIOExit().
+*/
+
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+// Start/Stop
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+
+ASIOError ASIOStart(void);
+/* Purpose:
+ Start input and output processing synchronously.
+ This will
+ - reset the sample counter to zero
+ - start the hardware (both input and output)
+ The first call to the hosts' bufferSwitch(index == 0) then tells
+ the host to read from input buffer A (index 0), and start
+ processing to output buffer A while output buffer B (which
+ has been filled by the host prior to calling ASIOStart())
+ is possibly sounding (see also ASIOGetLatencies())
+ Parameter:
+ None.
+ Returns:
+ If neither input nor output is present, ASE_NotPresent
+ will be returned.
+ If the hardware fails to start, ASE_HWMalfunction will be returned.
+ Notes:
+ There is no restriction on the time that ASIOStart() takes
+ to perform (that is, it is not considered a realtime trigger).
+*/
+
+ASIOError ASIOStop(void);
+/* Purpose:
+ Stops input and output processing altogether.
+ Parameter:
+ None.
+ Returns:
+ If neither input nor output is present ASE_NotPresent
+ will be returned.
+ Notes:
+ On return from ASIOStop(), the driver must in no
+ case call the hosts' bufferSwitch() routine.
+*/
+
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+// Inquiry methods and sample rate
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+
+ASIOError ASIOGetChannels(long *numInputChannels, long *numOutputChannels);
+/* Purpose:
+ Returns number of individual input/output channels.
+ Parameter:
+ numInputChannels will hold the number of available input channels
+ numOutputChannels will hold the number of available output channels
+ Returns:
+ If no input/output is present ASE_NotPresent will be returned.
+ If only inputs, or only outputs are available, the according
+ other parameter will be zero, and ASE_OK is returned.
+*/
+
+ASIOError ASIOGetLatencies(long *inputLatency, long *outputLatency);
+/* Purpose:
+ Returns the input and output latencies. This includes
+ device specific delays, like FIFOs etc.
+ Parameter:
+ inputLatency will hold the 'age' of the first sample frame
+ in the input buffer when the hosts reads it in bufferSwitch()
+ (this is theoretical, meaning it does not include the overhead
+ and delay between the actual physical switch, and the time
+ when bufferSitch() enters).
+ This will usually be the size of one block in sample frames, plus
+ device specific latencies.
+
+ outputLatency will specify the time between the buffer switch,
+ and the time when the next play buffer will start to sound.
+ The next play buffer is defined as the one the host starts
+ processing after (or at) bufferSwitch(), indicated by the
+ index parameter (0 for buffer A, 1 for buffer B).
+ It will usually be either one block, if the host writes directly
+ to a dma buffer, or two or more blocks if the buffer is 'latched' by
+ the driver. As an example, on ASIOStart(), the host will have filled
+ the play buffer at index 1 already; when it gets the callback (with
+ the parameter index == 0), this tells it to read from the input
+ buffer 0, and start to fill the play buffer 0 (assuming that now
+ play buffer 1 is already sounding). In this case, the output
+ latency is one block. If the driver decides to copy buffer 1
+ at that time, and pass it to the hardware at the next slot (which
+ is most commonly done, but should be avoided), the output latency
+ becomes two blocks instead, resulting in a total i/o latency of at least
+ 3 blocks. As memory access is the main bottleneck in native dsp processing,
+ and to acheive less latency, it is highly recommended to try to avoid
+ copying (this is also why the driver is the owner of the buffers). To
+ summarize, the minimum i/o latency can be acheived if the input buffer
+ is processed by the host into the output buffer which will physically
+ start to sound on the next time slice. Also note that the host expects
+ the bufferSwitch() callback to be accessed for each time slice in order
+ to retain sync, possibly recursively; if it fails to process a block in
+ time, it will suspend its operation for some time in order to recover.
+ Returns:
+ If no input/output is present ASE_NotPresent will be returned.
+*/
+
+ASIOError ASIOGetBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity);
+/* Purpose:
+ Returns min, max, and preferred buffer sizes for input/output
+ Parameter:
+ minSize will hold the minimum buffer size
+ maxSize will hold the maxium possible buffer size
+ preferredSize will hold the preferred buffer size (a size which
+ best fits performance and hardware requirements)
+ granularity will hold the granularity at which buffer sizes
+ may differ. Usually, the buffer size will be a power of 2;
+ in this case, granularity will hold -1 on return, signalling
+ possible buffer sizes starting from minSize, increased in
+ powers of 2 up to maxSize.
+ Returns:
+ If no input/output is present ASE_NotPresent will be returned.
+ Notes:
+ When minimum and maximum buffer size are equal,
+ the preferred buffer size has to be the same value as well; granularity
+ should be 0 in this case.
+*/
+
+ASIOError ASIOCanSampleRate(ASIOSampleRate sampleRate);
+/* Purpose:
+ Inquires the hardware for the available sample rates.
+ Parameter:
+ sampleRate is the rate in question.
+ Returns:
+ If the inquired sample rate is not supported, ASE_NoClock will be returned.
+ If no input/output is present ASE_NotPresent will be returned.
+*/
+ASIOError ASIOGetSampleRate(ASIOSampleRate *currentRate);
+/* Purpose:
+ Get the current sample Rate.
+ Parameter:
+ currentRate will hold the current sample rate on return.
+ Returns:
+ If sample rate is unknown, sampleRate will be 0 and ASE_NoClock will be returned.
+ If no input/output is present ASE_NotPresent will be returned.
+ Notes:
+*/
+
+ASIOError ASIOSetSampleRate(ASIOSampleRate sampleRate);
+/* Purpose:
+ Set the hardware to the requested sample Rate. If sampleRate == 0,
+ enable external sync.
+ Parameter:
+ sampleRate: on input, the requested rate
+ Returns:
+ If sampleRate is unknown ASE_NoClock will be returned.
+ If the current clock is external, and sampleRate is != 0,
+ ASE_InvalidMode will be returned
+ If no input/output is present ASE_NotPresent will be returned.
+ Notes:
+*/
+
+typedef struct ASIOClockSource
+{
+ long index; // as used for ASIOSetClockSource()
+ long associatedChannel; // for instance, S/PDIF or AES/EBU
+ long associatedGroup; // see channel groups (ASIOGetChannelInfo())
+ ASIOBool isCurrentSource; // ASIOTrue if this is the current clock source
+ char name[32]; // for user selection
+} ASIOClockSource;
+
+ASIOError ASIOGetClockSources(ASIOClockSource *clocks, long *numSources);
+/* Purpose:
+ Get the available external audio clock sources
+ Parameter:
+ clocks points to an array of ASIOClockSource structures:
+ - index: this is used to identify the clock source
+ when ASIOSetClockSource() is accessed, should be
+ an index counting from zero
+ - associatedInputChannel: the first channel of an associated
+ input group, if any.
+ - associatedGroup: the group index of that channel.
+ groups of channels are defined to seperate for
+ instance analog, S/PDIF, AES/EBU, ADAT connectors etc,
+ when present simultaniously. Note that associated channel
+ is enumerated according to numInputs/numOutputs, means it
+ is independant from a group (see also ASIOGetChannelInfo())
+ inputs are associated to a clock if the physical connection
+ transfers both data and clock (like S/PDIF, AES/EBU, or
+ ADAT inputs). if there is no input channel associated with
+ the clock source (like Word Clock, or internal oscillator), both
+ associatedChannel and associatedGroup should be set to -1.
+ - isCurrentSource: on exit, ASIOTrue if this is the current clock
+ source, ASIOFalse else
+ - name: a null-terminated string for user selection of the available sources.
+ numSources:
+ on input: the number of allocated array members
+ on output: the number of available clock sources, at least
+ 1 (internal clock generator).
+ Returns:
+ If no input/output is present ASE_NotPresent will be returned.
+ Notes:
+*/
+
+ASIOError ASIOSetClockSource(long index);
+/* Purpose:
+ Set the audio clock source
+ Parameter:
+ index as obtained from an inquiry to ASIOGetClockSources()
+ Returns:
+ If no input/output is present ASE_NotPresent will be returned.
+ If the clock can not be selected because an input channel which
+ carries the current clock source is active, ASE_InvalidMode
+ *may* be returned (this depends on the properties of the driver
+ and/or hardware).
+ Notes:
+ Should *not* return ASE_NoClock if there is no clock signal present
+ at the selected source; this will be inquired via ASIOGetSampleRate().
+ It should call the host callback procedure sampleRateHasChanged(),
+ if the switch causes a sample rate change, or if no external clock
+ is present at the selected source.
+*/
+
+ASIOError ASIOGetSamplePosition (ASIOSamples *sPos, ASIOTimeStamp *tStamp);
+/* Purpose:
+ Inquires the sample position/time stamp pair.
+ Parameter:
+ sPos will hold the sample position on return. The sample
+ position is reset to zero when ASIOStart() gets called.
+ tStamp will hold the system time when the sample position
+ was latched.
+ Returns:
+ If no input/output is present, ASE_NotPresent will be returned.
+ If there is no clock, ASE_SPNotAdvancing will be returned.
+ Notes:
+
+ in order to be able to synchronise properly,
+ the sample position / time stamp pair must refer to the current block,
+ that is, the engine will call ASIOGetSamplePosition() in its bufferSwitch()
+ callback and expect the time for the current block. thus, when requested
+ in the very first bufferSwitch after ASIO_Start(), the sample position
+ should be zero, and the time stamp should refer to the very time where
+ the stream was started. it also means that the sample position must be
+ block aligned. the driver must ensure proper interpolation if the system
+ time can not be determined for the block position. the driver is responsible
+ for precise time stamps as it usually has most direct access to lower
+ level resources. proper behaviour of ASIO_GetSamplePosition() and ASIO_GetLatencies()
+ are essential for precise media synchronization!
+*/
+
+typedef struct ASIOChannelInfo
+{
+ long channel; // on input, channel index
+ ASIOBool isInput; // on input
+ ASIOBool isActive; // on exit
+ long channelGroup; // dto
+ ASIOSampleType type; // dto
+ char name[32]; // dto
+} ASIOChannelInfo;
+
+ASIOError ASIOGetChannelInfo(ASIOChannelInfo *info);
+/* Purpose:
+ retreive information about the nature of a channel
+ Parameter:
+ info: pointer to a ASIOChannelInfo structure with
+ - channel: on input, the channel index of the channel in question.
+ - isInput: on input, ASIOTrue if info for an input channel is
+ requested, else output
+ - channelGroup: on return, the channel group that the channel
+ belongs to. For drivers which support different types of
+ channels, like analog, S/PDIF, AES/EBU, ADAT etc interfaces,
+ there should be a reasonable grouping of these types. Groups
+ are always independant form a channel index, that is, a channel
+ index always counts from 0 to numInputs/numOutputs regardless
+ of the group it may belong to.
+ There will always be at least one group (group 0). Please
+ also note that by default, the host may decide to activate
+ channels 0 and 1; thus, these should belong to the most
+ useful type (analog i/o, if present).
+ - type: on return, contains the sample type of the channel
+ - isActive: on return, ASIOTrue if channel is active as it was
+ installed by ASIOCreateBuffers(), ASIOFalse else
+ - name: describing the type of channel in question. Used to allow
+ for user selection, and enabling of specific channels. examples:
+ "Analog In", "SPDIF Out" etc
+ Returns:
+ If no input/output is present ASE_NotPresent will be returned.
+ Notes:
+ If possible, the string should be organised such that the first
+ characters are most significantly describing the nature of the
+ port, to allow for identification even if the view showing the
+ port name is too small to display more than 8 characters, for
+ instance.
+*/
+
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+// Buffer preparation
+//- - - - - - - - - - - - - - - - - - - - - - - - -
+
+typedef struct ASIOBufferInfo
+{
+ ASIOBool isInput; // on input: ASIOTrue: input, else output
+ long channelNum; // on input: channel index
+ void *buffers[2]; // on output: double buffer addresses
+} ASIOBufferInfo;
+
+ASIOError ASIOCreateBuffers(ASIOBufferInfo *bufferInfos, long numChannels,
+ long bufferSize, ASIOCallbacks *callbacks);
+
+/* Purpose:
+ Allocates input/output buffers for all input and output channels to be activated.
+ Parameter:
+ bufferInfos is a pointer to an array of ASIOBufferInfo structures:
+ - isInput: on input, ASIOTrue if the buffer is to be allocated
+ for an input, output buffer else
+ - channelNum: on input, the index of the channel in question
+ (counting from 0)
+ - buffers: on exit, 2 pointers to the halves of the channels' double-buffer.
+ the size of the buffer(s) of course depend on both the ASIOSampleType
+ as obtained from ASIOGetChannelInfo(), and bufferSize
+ numChannels is the sum of all input and output channels to be created;
+ thus bufferInfos is a pointer to an array of numChannels ASIOBufferInfo
+ structures.
+ bufferSize selects one of the possible buffer sizes as obtained from
+ ASIOGetBufferSizes().
+ callbacks is a pointer to an ASIOCallbacks structure.
+ Returns:
+ If not enough memory is available ASE_NoMemory will be returned.
+ If no input/output is present ASE_NotPresent will be returned.
+ If bufferSize is not supported, or one or more of the bufferInfos elements
+ contain invalid settings, ASE_InvalidMode will be returned.
+ Notes:
+ If individual channel selection is not possible but requested,
+ the driver has to handle this. namely, bufferSwitch() will only
+ have filled buffers of enabled outputs. If possible, processing
+ and buss activities overhead should be avoided for channels which
+ were not enabled here.
+*/
+
+ASIOError ASIODisposeBuffers(void);
+/* Purpose:
+ Releases all buffers for the device.
+ Parameter:
+ None.
+ Returns:
+ If no buffer were ever prepared, ASE_InvalidMode will be returned.
+ If no input/output is present ASE_NotPresent will be returned.
+ Notes:
+ This implies ASIOStop().
+*/
+
+ASIOError ASIOControlPanel(void);
+/* Purpose:
+ request the driver to start a control panel component
+ for device specific user settings. This will not be
+ accessed on some platforms (where the component is accessed
+ instead).
+ Parameter:
+ None.
+ Returns:
+ If no panel is available ASE_NotPresent will be returned.
+ Actually, the return code is ignored.
+ Notes:
+ if the user applied settings which require a re-configuration
+ of parts or all of the enigine and/or driver (such as a change of
+ the block size), the asioMessage callback can be used (see
+ ASIO_Callbacks).
+*/
+
+ASIOError ASIOFuture(long selector, void *params);
+/* Purpose:
+ various
+ Parameter:
+ selector: operation Code as to be defined. zero is reserved for
+ testing purposes.
+ params: depends on the selector; usually pointer to a structure
+ for passing and retreiving any type and amount of parameters.
+ Returns:
+ the return value is also selector dependant. if the selector
+ is unknown, ASE_InvalidParameter should be returned to prevent
+ further calls with this selector. on success, ASE_SUCCESS
+ must be returned (note: ASE_OK is *not* sufficient!)
+ Notes:
+ see selectors defined below.
+*/
+
+enum
+{
+ kAsioEnableTimeCodeRead = 1, // no arguments
+ kAsioDisableTimeCodeRead, // no arguments
+ kAsioSetInputMonitor, // ASIOInputMonitor* in params
+ kAsioTransport, // ASIOTransportParameters* in params
+ kAsioSetInputGain, // ASIOChannelControls* in params, apply gain
+ kAsioGetInputMeter, // ASIOChannelControls* in params, fill meter
+ kAsioSetOutputGain, // ASIOChannelControls* in params, apply gain
+ kAsioGetOutputMeter, // ASIOChannelControls* in params, fill meter
+ kAsioCanInputMonitor, // no arguments for kAsioCanXXX selectors
+ kAsioCanTimeInfo,
+ kAsioCanTimeCode,
+ kAsioCanTransport,
+ kAsioCanInputGain,
+ kAsioCanInputMeter,
+ kAsioCanOutputGain,
+ kAsioCanOutputMeter,
+
+ // DSD support
+ // The following extensions are required to allow switching
+ // and control of the DSD subsystem.
+ kAsioSetIoFormat = 0x23111961, /* ASIOIoFormat * in params. */
+ kAsioGetIoFormat = 0x23111983, /* ASIOIoFormat * in params. */
+ kAsioCanDoIoFormat = 0x23112004, /* ASIOIoFormat * in params. */
+};
+
+typedef struct ASIOInputMonitor
+{
+ long input; // this input was set to monitor (or off), -1: all
+ long output; // suggested output for monitoring the input (if so)
+ long gain; // suggested gain, ranging 0 - 0x7fffffffL (-inf to +12 dB)
+ ASIOBool state; // ASIOTrue => on, ASIOFalse => off
+ long pan; // suggested pan, 0 => all left, 0x7fffffff => right
+} ASIOInputMonitor;
+
+typedef struct ASIOChannelControls
+{
+ long channel; // on input, channel index
+ ASIOBool isInput; // on input
+ long gain; // on input, ranges 0 thru 0x7fffffff
+ long meter; // on return, ranges 0 thru 0x7fffffff
+ char future[32];
+} ASIOChannelControls;
+
+typedef struct ASIOTransportParameters
+{
+ long command; // see enum below
+ ASIOSamples samplePosition;
+ long track;
+ long trackSwitches[16]; // 512 tracks on/off
+ char future[64];
+} ASIOTransportParameters;
+
+enum
+{
+ kTransStart = 1,
+ kTransStop,
+ kTransLocate, // to samplePosition
+ kTransPunchIn,
+ kTransPunchOut,
+ kTransArmOn, // track
+ kTransArmOff, // track
+ kTransMonitorOn, // track
+ kTransMonitorOff, // track
+ kTransArm, // trackSwitches
+ kTransMonitor // trackSwitches
+};
+
+/*
+// DSD support
+// Some notes on how to use ASIOIoFormatType.
+//
+// The caller will fill the format with the request types.
+// If the board can do the request then it will leave the
+// values unchanged. If the board does not support the
+// request then it will change that entry to Invalid (-1)
+//
+// So to request DSD then
+//
+// ASIOIoFormat NeedThis={kASIODSDFormat};
+//
+// if(ASE_SUCCESS != ASIOFuture(kAsioSetIoFormat,&NeedThis) ){
+// // If the board did not accept one of the parameters then the
+// // whole call will fail and the failing parameter will
+// // have had its value changes to -1.
+// }
+//
+// Note: Switching between the formats need to be done before the "prepared"
+// state (see ASIO 2 documentation) is entered.
+*/
+typedef long int ASIOIoFormatType;
+enum ASIOIoFormatType_e
+{
+ kASIOFormatInvalid = -1,
+ kASIOPCMFormat = 0,
+ kASIODSDFormat = 1,
+};
+
+typedef struct ASIOIoFormat_s
+{
+ ASIOIoFormatType FormatType;
+ char future[512-sizeof(ASIOIoFormatType)];
+} ASIOIoFormat;
+
+
+ASIOError ASIOOutputReady(void);
+/* Purpose:
+ this tells the driver that the host has completed processing
+ the output buffers. if the data format required by the hardware
+ differs from the supported asio formats, but the hardware
+ buffers are DMA buffers, the driver will have to convert
+ the audio stream data; as the bufferSwitch callback is
+ usually issued at dma block switch time, the driver will
+ have to convert the *previous* host buffer, which increases
+ the output latency by one block.
+ when the host finds out that ASIOOutputReady() returns
+ true, it will issue this call whenever it completed
+ output processing. then the driver can convert the
+ host data directly to the dma buffer to be played next,
+ reducing output latency by one block.
+ another way to look at it is, that the buffer switch is called
+ in order to pass the *input* stream to the host, so that it can
+ process the input into the output, and the output stream is passed
+ to the driver when the host has completed its process.
+ Parameter:
+ None
+ Returns:
+ only if the above mentioned scenario is given, and a reduction
+ of output latency can be acheived by this mechanism, should
+ ASE_OK be returned. otherwise (and usually), ASE_NotPresent
+ should be returned in order to prevent further calls to this
+ function. note that the host may want to determine if it is
+ to use this when the system is not yet fully initialized, so
+ ASE_OK should always be returned if the mechanism makes sense.
+ Notes:
+ please remeber to adjust ASIOGetLatencies() according to
+ whether ASIOOutputReady() was ever called or not, if your
+ driver supports this scenario.
+ also note that the engine may fail to call ASIO_OutputReady()
+ in time in overload cases. as already mentioned, bufferSwitch
+ should be called for every block regardless of whether a block
+ could be processed in time.
+*/
+
+// restore old alignment
+#if defined(_MSC_VER) && !defined(__MWERKS__)
+#pragma pack(pop)
+#elif PRAGMA_ALIGN_SUPPORTED
+#pragma options align = reset
+#endif
+
+#endif
+
diff --git a/src/deps/rtaudio-mod/include/asiodrivers.cpp b/src/deps/rtaudio-mod/include/asiodrivers.cpp
new file mode 100644
index 0000000..5f56454
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/asiodrivers.cpp
@@ -0,0 +1,186 @@
+#include <string.h>
+#include "asiodrivers.h"
+
+AsioDrivers* asioDrivers = 0;
+
+bool loadAsioDriver(char *name);
+
+bool loadAsioDriver(char *name)
+{
+ if(!asioDrivers)
+ asioDrivers = new AsioDrivers();
+ if(asioDrivers)
+ return asioDrivers->loadDriver(name);
+ return false;
+}
+
+//------------------------------------------------------------------------------------
+
+#if MAC
+
+bool resolveASIO(unsigned long aconnID);
+
+AsioDrivers::AsioDrivers() : CodeFragments("ASIO Drivers", 'AsDr', 'Asio')
+{
+ connID = -1;
+ curIndex = -1;
+}
+
+AsioDrivers::~AsioDrivers()
+{
+ removeCurrentDriver();
+}
+
+bool AsioDrivers::getCurrentDriverName(char *name)
+{
+ if(curIndex >= 0)
+ return getName(curIndex, name);
+ return false;
+}
+
+long AsioDrivers::getDriverNames(char **names, long maxDrivers)
+{
+ for(long i = 0; i < getNumFragments() && i < maxDrivers; i++)
+ getName(i, names[i]);
+ return getNumFragments() < maxDrivers ? getNumFragments() : maxDrivers;
+}
+
+bool AsioDrivers::loadDriver(char *name)
+{
+ char dname[64];
+ unsigned long newID;
+
+ for(long i = 0; i < getNumFragments(); i++)
+ {
+ if(getName(i, dname) && !strcmp(name, dname))
+ {
+ if(newInstance(i, &newID))
+ {
+ if(resolveASIO(newID))
+ {
+ if(connID != -1)
+ removeInstance(curIndex, connID);
+ curIndex = i;
+ connID = newID;
+ return true;
+ }
+ }
+ break;
+ }
+ }
+ return false;
+}
+
+void AsioDrivers::removeCurrentDriver()
+{
+ if(connID != -1)
+ removeInstance(curIndex, connID);
+ connID = -1;
+ curIndex = -1;
+}
+
+//------------------------------------------------------------------------------------
+
+#elif WINDOWS
+
+#include "iasiodrv.h"
+
+extern IASIO* theAsioDriver;
+
+AsioDrivers::AsioDrivers() : AsioDriverList()
+{
+ curIndex = -1;
+}
+
+AsioDrivers::~AsioDrivers()
+{
+}
+
+bool AsioDrivers::getCurrentDriverName(char *name)
+{
+ if(curIndex >= 0)
+ return asioGetDriverName(curIndex, name, 32) == 0 ? true : false;
+ name[0] = 0;
+ return false;
+}
+
+long AsioDrivers::getDriverNames(char **names, long maxDrivers)
+{
+ for(long i = 0; i < asioGetNumDev() && i < maxDrivers; i++)
+ asioGetDriverName(i, names[i], 32);
+ return asioGetNumDev() < maxDrivers ? asioGetNumDev() : maxDrivers;
+}
+
+bool AsioDrivers::loadDriver(char *name)
+{
+ char dname[64];
+ char curName[64];
+
+ for(long i = 0; i < asioGetNumDev(); i++)
+ {
+ if(!asioGetDriverName(i, dname, 32) && !strcmp(name, dname))
+ {
+ curName[0] = 0;
+ getCurrentDriverName(curName); // in case we fail...
+ removeCurrentDriver();
+
+ if(!asioOpenDriver(i, (void **)&theAsioDriver))
+ {
+ curIndex = i;
+ return true;
+ }
+ else
+ {
+ theAsioDriver = 0;
+ if(curName[0] && strcmp(dname, curName))
+ loadDriver(curName); // try restore
+ }
+ break;
+ }
+ }
+ return false;
+}
+
+void AsioDrivers::removeCurrentDriver()
+{
+ if(curIndex != -1)
+ asioCloseDriver(curIndex);
+ curIndex = -1;
+}
+
+#elif SGI || BEOS
+
+#include "asiolist.h"
+
+AsioDrivers::AsioDrivers()
+ : AsioDriverList()
+{
+ curIndex = -1;
+}
+
+AsioDrivers::~AsioDrivers()
+{
+}
+
+bool AsioDrivers::getCurrentDriverName(char *name)
+{
+ return false;
+}
+
+long AsioDrivers::getDriverNames(char **names, long maxDrivers)
+{
+ return 0;
+}
+
+bool AsioDrivers::loadDriver(char *name)
+{
+ return false;
+}
+
+void AsioDrivers::removeCurrentDriver()
+{
+}
+
+#else
+#error implement me
+#endif
diff --git a/src/deps/rtaudio-mod/include/asiodrivers.h b/src/deps/rtaudio-mod/include/asiodrivers.h
new file mode 100644
index 0000000..2ddf7ad
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/asiodrivers.h
@@ -0,0 +1,41 @@
+#ifndef __AsioDrivers__
+#define __AsioDrivers__
+
+#include "ginclude.h"
+
+#if MAC
+#include "CodeFragments.hpp"
+
+class AsioDrivers : public CodeFragments
+
+#elif WINDOWS
+#include <windows.h>
+#include "asiolist.h"
+
+class AsioDrivers : public AsioDriverList
+
+#elif SGI || BEOS
+#include "asiolist.h"
+
+class AsioDrivers : public AsioDriverList
+
+#else
+#error implement me
+#endif
+
+{
+public:
+ AsioDrivers();
+ ~AsioDrivers();
+
+ bool getCurrentDriverName(char *name);
+ long getDriverNames(char **names, long maxDrivers);
+ bool loadDriver(char *name);
+ void removeCurrentDriver();
+ long getCurrentDriverIndex() {return curIndex;}
+protected:
+ unsigned long connID;
+ long curIndex;
+};
+
+#endif
diff --git a/src/deps/rtaudio-mod/include/asiodrvr.h b/src/deps/rtaudio-mod/include/asiodrvr.h
new file mode 100644
index 0000000..663f75a
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/asiodrvr.h
@@ -0,0 +1,76 @@
+/*
+ Steinberg Audio Stream I/O API
+ (c) 1996, Steinberg Soft- und Hardware GmbH
+ charlie (May 1996)
+
+ asiodrvr.h
+ c++ superclass to implement asio functionality. from this,
+ you can derive whatever required
+*/
+
+#ifndef _asiodrvr_
+#define _asiodrvr_
+
+// cpu and os system we are running on
+#include "asiosys.h"
+// basic "C" interface
+#include "asio.h"
+
+class AsioDriver;
+extern AsioDriver *getDriver(); // for generic constructor
+
+#if WINDOWS
+#include <windows.h>
+#include "combase.h"
+#include "iasiodrv.h"
+class AsioDriver : public IASIO ,public CUnknown
+{
+public:
+ AsioDriver(LPUNKNOWN pUnk, HRESULT *phr);
+
+ DECLARE_IUNKNOWN
+ // Factory method
+ static CUnknown *CreateInstance(LPUNKNOWN pUnk, HRESULT *phr);
+ // IUnknown
+ virtual HRESULT STDMETHODCALLTYPE NonDelegatingQueryInterface(REFIID riid,void **ppvObject);
+
+#else
+
+class AsioDriver
+{
+public:
+ AsioDriver();
+#endif
+ virtual ~AsioDriver();
+
+ virtual ASIOBool init(void* sysRef);
+ virtual void getDriverName(char *name); // max 32 bytes incl. terminating zero
+ virtual long getDriverVersion();
+ virtual void getErrorMessage(char *string); // max 124 bytes incl.
+
+ virtual ASIOError start();
+ virtual ASIOError stop();
+
+ virtual ASIOError getChannels(long *numInputChannels, long *numOutputChannels);
+ virtual ASIOError getLatencies(long *inputLatency, long *outputLatency);
+ virtual ASIOError getBufferSize(long *minSize, long *maxSize,
+ long *preferredSize, long *granularity);
+
+ virtual ASIOError canSampleRate(ASIOSampleRate sampleRate);
+ virtual ASIOError getSampleRate(ASIOSampleRate *sampleRate);
+ virtual ASIOError setSampleRate(ASIOSampleRate sampleRate);
+ virtual ASIOError getClockSources(ASIOClockSource *clocks, long *numSources);
+ virtual ASIOError setClockSource(long reference);
+
+ virtual ASIOError getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp);
+ virtual ASIOError getChannelInfo(ASIOChannelInfo *info);
+
+ virtual ASIOError createBuffers(ASIOBufferInfo *bufferInfos, long numChannels,
+ long bufferSize, ASIOCallbacks *callbacks);
+ virtual ASIOError disposeBuffers();
+
+ virtual ASIOError controlPanel();
+ virtual ASIOError future(long selector, void *opt);
+ virtual ASIOError outputReady();
+};
+#endif
diff --git a/src/deps/rtaudio-mod/include/asiolist.cpp b/src/deps/rtaudio-mod/include/asiolist.cpp
new file mode 100644
index 0000000..e4c73c2
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/asiolist.cpp
@@ -0,0 +1,308 @@
+#include <windows.h>
+#include "iasiodrv.h"
+#include "asiolist.h"
+
+#define ASIODRV_DESC "description"
+#define INPROC_SERVER "InprocServer32"
+#define ASIO_PATH "software\\asio"
+#define COM_CLSID "clsid"
+
+// ******************************************************************
+// Local Functions
+// ******************************************************************
+static LONG findDrvPath (char *clsidstr,char *dllpath,int dllpathsize)
+{
+ HKEY hkEnum,hksub,hkpath;
+ char databuf[512];
+ LONG cr,rc = -1;
+ DWORD datatype,datasize;
+ DWORD index;
+ OFSTRUCT ofs;
+ HFILE hfile;
+ BOOL found = FALSE;
+
+#ifdef UNICODE
+ CharLowerBuffA(clsidstr,strlen(clsidstr));
+ if ((cr = RegOpenKeyA(HKEY_CLASSES_ROOT,COM_CLSID,&hkEnum)) == ERROR_SUCCESS) {
+
+ index = 0;
+ while (cr == ERROR_SUCCESS && !found) {
+ cr = RegEnumKeyA(hkEnum,index++,databuf,512);
+ if (cr == ERROR_SUCCESS) {
+ CharLowerBuffA(databuf,strlen(databuf));
+ if (!(strcmp(databuf,clsidstr))) {
+ if ((cr = RegOpenKeyExA(hkEnum,databuf,0,KEY_READ,&hksub)) == ERROR_SUCCESS) {
+ if ((cr = RegOpenKeyExA(hksub,INPROC_SERVER,0,KEY_READ,&hkpath)) == ERROR_SUCCESS) {
+ datatype = REG_SZ; datasize = (DWORD)dllpathsize;
+ cr = RegQueryValueEx(hkpath,0,0,&datatype,(LPBYTE)dllpath,&datasize);
+ if (cr == ERROR_SUCCESS) {
+ memset(&ofs,0,sizeof(OFSTRUCT));
+ ofs.cBytes = sizeof(OFSTRUCT);
+ hfile = OpenFile(dllpath,&ofs,OF_EXIST);
+ if (hfile) rc = 0;
+ }
+ RegCloseKey(hkpath);
+ }
+ RegCloseKey(hksub);
+ }
+ found = TRUE; // break out
+ }
+ }
+ }
+ RegCloseKey(hkEnum);
+ }
+#else
+ CharLowerBuff(clsidstr,strlen(clsidstr));
+ if ((cr = RegOpenKey(HKEY_CLASSES_ROOT,COM_CLSID,&hkEnum)) == ERROR_SUCCESS) {
+
+ index = 0;
+ while (cr == ERROR_SUCCESS && !found) {
+ cr = RegEnumKey(hkEnum,index++,databuf,512);
+ if (cr == ERROR_SUCCESS) {
+ CharLowerBuff(databuf,strlen(databuf));
+ if (!(strcmp(databuf,clsidstr))) {
+ if ((cr = RegOpenKeyEx(hkEnum,databuf,0,KEY_READ,&hksub)) == ERROR_SUCCESS) {
+ if ((cr = RegOpenKeyEx(hksub,INPROC_SERVER,0,KEY_READ,&hkpath)) == ERROR_SUCCESS) {
+ datatype = REG_SZ; datasize = (DWORD)dllpathsize;
+ cr = RegQueryValueEx(hkpath,0,0,&datatype,(LPBYTE)dllpath,&datasize);
+ if (cr == ERROR_SUCCESS) {
+ memset(&ofs,0,sizeof(OFSTRUCT));
+ ofs.cBytes = sizeof(OFSTRUCT);
+ hfile = OpenFile(dllpath,&ofs,OF_EXIST);
+ if (hfile) rc = 0;
+ }
+ RegCloseKey(hkpath);
+ }
+ RegCloseKey(hksub);
+ }
+ found = TRUE; // break out
+ }
+ }
+ }
+ RegCloseKey(hkEnum);
+ }
+#endif
+ return rc;
+}
+
+
+static LPASIODRVSTRUCT newDrvStruct (HKEY hkey,char *keyname,int drvID,LPASIODRVSTRUCT lpdrv)
+{
+ HKEY hksub;
+ char databuf[256];
+ char dllpath[MAXPATHLEN];
+ WORD wData[100];
+ CLSID clsid;
+ DWORD datatype,datasize;
+ LONG cr,rc;
+
+ if (!lpdrv) {
+ if ((cr = RegOpenKeyExA(hkey,keyname,0,KEY_READ,&hksub)) == ERROR_SUCCESS) {
+
+ datatype = REG_SZ; datasize = 256;
+ cr = RegQueryValueExA(hksub,COM_CLSID,0,&datatype,(LPBYTE)databuf,&datasize);
+ if (cr == ERROR_SUCCESS) {
+ rc = findDrvPath (databuf,dllpath,MAXPATHLEN);
+ if (rc == 0) {
+ lpdrv = new ASIODRVSTRUCT[1];
+ if (lpdrv) {
+ memset(lpdrv,0,sizeof(ASIODRVSTRUCT));
+ lpdrv->drvID = drvID;
+ MultiByteToWideChar(CP_ACP,0,(LPCSTR)databuf,-1,(LPWSTR)wData,100);
+ if ((cr = CLSIDFromString((LPOLESTR)wData,(LPCLSID)&clsid)) == S_OK) {
+ memcpy(&lpdrv->clsid,&clsid,sizeof(CLSID));
+ }
+
+ datatype = REG_SZ; datasize = 256;
+ cr = RegQueryValueExA(hksub,ASIODRV_DESC,0,&datatype,(LPBYTE)databuf,&datasize);
+ if (cr == ERROR_SUCCESS) {
+ strcpy(lpdrv->drvname,databuf);
+ }
+ else strcpy(lpdrv->drvname,keyname);
+ }
+ }
+ }
+ RegCloseKey(hksub);
+ }
+ }
+ else lpdrv->next = newDrvStruct(hkey,keyname,drvID+1,lpdrv->next);
+
+ return lpdrv;
+}
+
+static void deleteDrvStruct (LPASIODRVSTRUCT lpdrv)
+{
+ IASIO *iasio;
+
+ if (lpdrv != 0) {
+ deleteDrvStruct(lpdrv->next);
+ if (lpdrv->asiodrv) {
+ iasio = (IASIO *)lpdrv->asiodrv;
+ iasio->Release();
+ }
+ delete lpdrv;
+ }
+}
+
+
+static LPASIODRVSTRUCT getDrvStruct (int drvID,LPASIODRVSTRUCT lpdrv)
+{
+ while (lpdrv) {
+ if (lpdrv->drvID == drvID) return lpdrv;
+ lpdrv = lpdrv->next;
+ }
+ return 0;
+}
+// ******************************************************************
+
+
+// ******************************************************************
+// AsioDriverList
+// ******************************************************************
+AsioDriverList::AsioDriverList ()
+{
+ HKEY hkEnum = 0;
+ char keyname[MAXDRVNAMELEN];
+ LPASIODRVSTRUCT pdl;
+ LONG cr;
+ DWORD index = 0;
+ BOOL fin = FALSE;
+
+ numdrv = 0;
+ lpdrvlist = 0;
+
+#ifdef UNICODE
+ cr = RegOpenKeyA(HKEY_LOCAL_MACHINE,ASIO_PATH,&hkEnum);
+#else
+ cr = RegOpenKey(HKEY_LOCAL_MACHINE,ASIO_PATH,&hkEnum);
+#endif
+ while (cr == ERROR_SUCCESS) {
+#ifdef UNICODE
+ if ((cr = RegEnumKeyA(hkEnum,index++,keyname,MAXDRVNAMELEN))== ERROR_SUCCESS) {
+#else
+ if ((cr = RegEnumKey(hkEnum,index++,keyname,MAXDRVNAMELEN))== ERROR_SUCCESS) {
+#endif
+ lpdrvlist = newDrvStruct (hkEnum,keyname,0,lpdrvlist);
+ }
+ else fin = TRUE;
+ }
+ if (hkEnum) RegCloseKey(hkEnum);
+
+ pdl = lpdrvlist;
+ while (pdl) {
+ numdrv++;
+ pdl = pdl->next;
+ }
+
+ if (numdrv) CoInitialize(0); // initialize COM
+}
+
+AsioDriverList::~AsioDriverList ()
+{
+ if (numdrv) {
+ deleteDrvStruct(lpdrvlist);
+ CoUninitialize();
+ }
+}
+
+
+LONG AsioDriverList::asioGetNumDev (VOID)
+{
+ return (LONG)numdrv;
+}
+
+
+LONG AsioDriverList::asioOpenDriver (int drvID,LPVOID *asiodrv)
+{
+ LPASIODRVSTRUCT lpdrv = 0;
+ long rc;
+
+ if (!asiodrv) return DRVERR_INVALID_PARAM;
+
+ if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
+ if (!lpdrv->asiodrv) {
+ rc = CoCreateInstance(lpdrv->clsid,0,CLSCTX_INPROC_SERVER,lpdrv->clsid,asiodrv);
+ if (rc == S_OK) {
+ lpdrv->asiodrv = *asiodrv;
+ return 0;
+ }
+ // else if (rc == REGDB_E_CLASSNOTREG)
+ // strcpy (info->messageText, "Driver not registered in the Registration Database!");
+ }
+ else rc = DRVERR_DEVICE_ALREADY_OPEN;
+ }
+ else rc = DRVERR_DEVICE_NOT_FOUND;
+
+ return rc;
+}
+
+
+LONG AsioDriverList::asioCloseDriver (int drvID)
+{
+ LPASIODRVSTRUCT lpdrv = 0;
+ IASIO *iasio;
+
+ if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
+ if (lpdrv->asiodrv) {
+ iasio = (IASIO *)lpdrv->asiodrv;
+ iasio->Release();
+ lpdrv->asiodrv = 0;
+ }
+ }
+
+ return 0;
+}
+
+LONG AsioDriverList::asioGetDriverName (int drvID,char *drvname,int drvnamesize)
+{
+ LPASIODRVSTRUCT lpdrv = 0;
+
+ if (!drvname) return DRVERR_INVALID_PARAM;
+
+ if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
+ if (strlen(lpdrv->drvname) < (unsigned int)drvnamesize) {
+ strcpy(drvname,lpdrv->drvname);
+ }
+ else {
+ memcpy(drvname,lpdrv->drvname,drvnamesize-4);
+ drvname[drvnamesize-4] = '.';
+ drvname[drvnamesize-3] = '.';
+ drvname[drvnamesize-2] = '.';
+ drvname[drvnamesize-1] = 0;
+ }
+ return 0;
+ }
+ return DRVERR_DEVICE_NOT_FOUND;
+}
+
+LONG AsioDriverList::asioGetDriverPath (int drvID,char *dllpath,int dllpathsize)
+{
+ LPASIODRVSTRUCT lpdrv = 0;
+
+ if (!dllpath) return DRVERR_INVALID_PARAM;
+
+ if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
+ if (strlen(lpdrv->dllpath) < (unsigned int)dllpathsize) {
+ strcpy(dllpath,lpdrv->dllpath);
+ return 0;
+ }
+ dllpath[0] = 0;
+ return DRVERR_INVALID_PARAM;
+ }
+ return DRVERR_DEVICE_NOT_FOUND;
+}
+
+LONG AsioDriverList::asioGetDriverCLSID (int drvID,CLSID *clsid)
+{
+ LPASIODRVSTRUCT lpdrv = 0;
+
+ if (!clsid) return DRVERR_INVALID_PARAM;
+
+ if ((lpdrv = getDrvStruct(drvID,lpdrvlist)) != 0) {
+ memcpy(clsid,&lpdrv->clsid,sizeof(CLSID));
+ return 0;
+ }
+ return DRVERR_DEVICE_NOT_FOUND;
+}
+
+
diff --git a/src/deps/rtaudio-mod/include/asiolist.h b/src/deps/rtaudio-mod/include/asiolist.h
new file mode 100644
index 0000000..01c64f0
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/asiolist.h
@@ -0,0 +1,46 @@
+#ifndef __asiolist__
+#define __asiolist__
+
+#define DRVERR -5000
+#define DRVERR_INVALID_PARAM DRVERR-1
+#define DRVERR_DEVICE_ALREADY_OPEN DRVERR-2
+#define DRVERR_DEVICE_NOT_FOUND DRVERR-3
+
+#define MAXPATHLEN 512
+#define MAXDRVNAMELEN 128
+
+struct asiodrvstruct
+{
+ int drvID;
+ CLSID clsid;
+ char dllpath[MAXPATHLEN];
+ char drvname[MAXDRVNAMELEN];
+ LPVOID asiodrv;
+ struct asiodrvstruct *next;
+};
+
+typedef struct asiodrvstruct ASIODRVSTRUCT;
+typedef ASIODRVSTRUCT *LPASIODRVSTRUCT;
+
+class AsioDriverList {
+public:
+ AsioDriverList();
+ ~AsioDriverList();
+
+ LONG asioOpenDriver (int,VOID **);
+ LONG asioCloseDriver (int);
+
+ // nice to have
+ LONG asioGetNumDev (VOID);
+ LONG asioGetDriverName (int,char *,int);
+ LONG asioGetDriverPath (int,char *,int);
+ LONG asioGetDriverCLSID (int,CLSID *);
+
+ // or use directly access
+ LPASIODRVSTRUCT lpdrvlist;
+ int numdrv;
+};
+
+typedef class AsioDriverList *LPASIODRIVERLIST;
+
+#endif
diff --git a/src/deps/rtaudio-mod/include/asiosys.h b/src/deps/rtaudio-mod/include/asiosys.h
new file mode 100644
index 0000000..37f7a48
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/asiosys.h
@@ -0,0 +1,82 @@
+#ifndef __asiosys__
+ #define __asiosys__
+
+ #ifdef WIN32
+ #undef MAC
+ #define PPC 0
+ #define WINDOWS 1
+ #define SGI 0
+ #define SUN 0
+ #define LINUX 0
+ #define BEOS 0
+
+ #define NATIVE_INT64 0
+ #define IEEE754_64FLOAT 1
+
+ #elif BEOS
+ #define MAC 0
+ #define PPC 0
+ #define WINDOWS 0
+ #define PC 0
+ #define SGI 0
+ #define SUN 0
+ #define LINUX 0
+
+ #define NATIVE_INT64 0
+ #define IEEE754_64FLOAT 1
+
+ #ifndef DEBUG
+ #define DEBUG 0
+ #if DEBUG
+ void DEBUGGERMESSAGE(char *string);
+ #else
+ #define DEBUGGERMESSAGE(a)
+ #endif
+ #endif
+
+ #elif SGI
+ #define MAC 0
+ #define PPC 0
+ #define WINDOWS 0
+ #define PC 0
+ #define SUN 0
+ #define LINUX 0
+ #define BEOS 0
+
+ #define NATIVE_INT64 0
+ #define IEEE754_64FLOAT 1
+
+ #ifndef DEBUG
+ #define DEBUG 0
+ #if DEBUG
+ void DEBUGGERMESSAGE(char *string);
+ #else
+ #define DEBUGGERMESSAGE(a)
+ #endif
+ #endif
+
+ #else // MAC
+
+ #define MAC 1
+ #define PPC 1
+ #define WINDOWS 0
+ #define PC 0
+ #define SGI 0
+ #define SUN 0
+ #define LINUX 0
+ #define BEOS 0
+
+ #define NATIVE_INT64 0
+ #define IEEE754_64FLOAT 1
+
+ #ifndef DEBUG
+ #define DEBUG 0
+ #if DEBUG
+ void DEBUGGERMESSAGE(char *string);
+ #else
+ #define DEBUGGERMESSAGE(a)
+ #endif
+ #endif
+ #endif
+
+#endif
diff --git a/src/deps/rtaudio-mod/include/dsound.h b/src/deps/rtaudio-mod/include/dsound.h
new file mode 100644
index 0000000..cb19cca
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/dsound.h
@@ -0,0 +1,2369 @@
+/*==========================================================================;
+ *
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ *
+ * File: dsound.h
+ * Content: DirectSound include file
+ *
+ **************************************************************************/
+
+#define COM_NO_WINDOWS_H
+#include <objbase.h>
+#include <float.h>
+
+#ifndef DIRECTSOUND_VERSION
+#define DIRECTSOUND_VERSION 0x0900 /* Version 9.0 */
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+#ifndef __DSOUND_INCLUDED__
+#define __DSOUND_INCLUDED__
+
+/* Type definitions shared with Direct3D */
+
+#ifndef DX_SHARED_DEFINES
+
+typedef float D3DVALUE, *LPD3DVALUE;
+
+#ifndef D3DCOLOR_DEFINED
+typedef DWORD D3DCOLOR;
+#define D3DCOLOR_DEFINED
+#endif
+
+#ifndef LPD3DCOLOR_DEFINED
+typedef DWORD *LPD3DCOLOR;
+#define LPD3DCOLOR_DEFINED
+#endif
+
+#ifndef D3DVECTOR_DEFINED
+typedef struct _D3DVECTOR {
+ float x;
+ float y;
+ float z;
+} D3DVECTOR;
+#define D3DVECTOR_DEFINED
+#endif
+
+#ifndef LPD3DVECTOR_DEFINED
+typedef D3DVECTOR *LPD3DVECTOR;
+#define LPD3DVECTOR_DEFINED
+#endif
+
+#define DX_SHARED_DEFINES
+#endif // DX_SHARED_DEFINES
+
+#define _FACDS 0x878 /* DirectSound's facility code */
+#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code)
+
+// DirectSound Component GUID {47D4D946-62E8-11CF-93BC-444553540000}
+DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
+
+// DirectSound 8.0 Component GUID {3901CC3F-84B5-4FA4-BA35-AA8172B8A09B}
+DEFINE_GUID(CLSID_DirectSound8, 0x3901cc3f, 0x84b5, 0x4fa4, 0xba, 0x35, 0xaa, 0x81, 0x72, 0xb8, 0xa0, 0x9b);
+
+// DirectSound Capture Component GUID {B0210780-89CD-11D0-AF08-00A0C925CD16}
+DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+
+// DirectSound 8.0 Capture Component GUID {E4BCAC13-7F99-4908-9A8E-74E3BF24B6E1}
+DEFINE_GUID(CLSID_DirectSoundCapture8, 0xe4bcac13, 0x7f99, 0x4908, 0x9a, 0x8e, 0x74, 0xe3, 0xbf, 0x24, 0xb6, 0xe1);
+
+// DirectSound Full Duplex Component GUID {FEA4300C-7959-4147-B26A-2377B9E7A91D}
+DEFINE_GUID(CLSID_DirectSoundFullDuplex, 0xfea4300c, 0x7959, 0x4147, 0xb2, 0x6a, 0x23, 0x77, 0xb9, 0xe7, 0xa9, 0x1d);
+
+
+// DirectSound default playback device GUID {DEF00000-9C6D-47ED-AAF1-4DDA8F2B5C03}
+DEFINE_GUID(DSDEVID_DefaultPlayback, 0xdef00000, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
+
+// DirectSound default capture device GUID {DEF00001-9C6D-47ED-AAF1-4DDA8F2B5C03}
+DEFINE_GUID(DSDEVID_DefaultCapture, 0xdef00001, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
+
+// DirectSound default device for voice playback {DEF00002-9C6D-47ED-AAF1-4DDA8F2B5C03}
+DEFINE_GUID(DSDEVID_DefaultVoicePlayback, 0xdef00002, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
+
+// DirectSound default device for voice capture {DEF00003-9C6D-47ED-AAF1-4DDA8F2B5C03}
+DEFINE_GUID(DSDEVID_DefaultVoiceCapture, 0xdef00003, 0x9c6d, 0x47ed, 0xaa, 0xf1, 0x4d, 0xda, 0x8f, 0x2b, 0x5c, 0x03);
+
+
+//
+// Forward declarations for interfaces.
+// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
+//
+
+#ifdef __cplusplus
+struct IDirectSound;
+struct IDirectSoundBuffer;
+struct IDirectSound3DListener;
+struct IDirectSound3DBuffer;
+struct IDirectSoundCapture;
+struct IDirectSoundCaptureBuffer;
+struct IDirectSoundNotify;
+#endif // __cplusplus
+
+
+//
+// DirectSound 8.0 interfaces.
+//
+
+#if DIRECTSOUND_VERSION >= 0x0800
+
+#ifdef __cplusplus
+struct IDirectSound8;
+struct IDirectSoundBuffer8;
+struct IDirectSoundCaptureBuffer8;
+struct IDirectSoundFXGargle;
+struct IDirectSoundFXChorus;
+struct IDirectSoundFXFlanger;
+struct IDirectSoundFXEcho;
+struct IDirectSoundFXDistortion;
+struct IDirectSoundFXCompressor;
+struct IDirectSoundFXParamEq;
+struct IDirectSoundFXWavesReverb;
+struct IDirectSoundFXI3DL2Reverb;
+struct IDirectSoundCaptureFXAec;
+struct IDirectSoundCaptureFXNoiseSuppress;
+struct IDirectSoundFullDuplex;
+#endif // __cplusplus
+
+// IDirectSound8, IDirectSoundBuffer8 and IDirectSoundCaptureBuffer8 are the
+// only DirectSound 7.0 interfaces with changed functionality in version 8.0.
+// The other level 8 interfaces as equivalent to their level 7 counterparts:
+
+#define IDirectSoundCapture8 IDirectSoundCapture
+#define IDirectSound3DListener8 IDirectSound3DListener
+#define IDirectSound3DBuffer8 IDirectSound3DBuffer
+#define IDirectSoundNotify8 IDirectSoundNotify
+#define IDirectSoundFXGargle8 IDirectSoundFXGargle
+#define IDirectSoundFXChorus8 IDirectSoundFXChorus
+#define IDirectSoundFXFlanger8 IDirectSoundFXFlanger
+#define IDirectSoundFXEcho8 IDirectSoundFXEcho
+#define IDirectSoundFXDistortion8 IDirectSoundFXDistortion
+#define IDirectSoundFXCompressor8 IDirectSoundFXCompressor
+#define IDirectSoundFXParamEq8 IDirectSoundFXParamEq
+#define IDirectSoundFXWavesReverb8 IDirectSoundFXWavesReverb
+#define IDirectSoundFXI3DL2Reverb8 IDirectSoundFXI3DL2Reverb
+#define IDirectSoundCaptureFXAec8 IDirectSoundCaptureFXAec
+#define IDirectSoundCaptureFXNoiseSuppress8 IDirectSoundCaptureFXNoiseSuppress
+#define IDirectSoundFullDuplex8 IDirectSoundFullDuplex
+
+#endif // DIRECTSOUND_VERSION >= 0x0800
+
+typedef struct IDirectSound *LPDIRECTSOUND;
+typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
+typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
+typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
+typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
+typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
+typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
+
+
+#if DIRECTSOUND_VERSION >= 0x0800
+
+typedef struct IDirectSoundFXGargle *LPDIRECTSOUNDFXGARGLE;
+typedef struct IDirectSoundFXChorus *LPDIRECTSOUNDFXCHORUS;
+typedef struct IDirectSoundFXFlanger *LPDIRECTSOUNDFXFLANGER;
+typedef struct IDirectSoundFXEcho *LPDIRECTSOUNDFXECHO;
+typedef struct IDirectSoundFXDistortion *LPDIRECTSOUNDFXDISTORTION;
+typedef struct IDirectSoundFXCompressor *LPDIRECTSOUNDFXCOMPRESSOR;
+typedef struct IDirectSoundFXParamEq *LPDIRECTSOUNDFXPARAMEQ;
+typedef struct IDirectSoundFXWavesReverb *LPDIRECTSOUNDFXWAVESREVERB;
+typedef struct IDirectSoundFXI3DL2Reverb *LPDIRECTSOUNDFXI3DL2REVERB;
+typedef struct IDirectSoundCaptureFXAec *LPDIRECTSOUNDCAPTUREFXAEC;
+typedef struct IDirectSoundCaptureFXNoiseSuppress *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS;
+typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX;
+
+typedef struct IDirectSound8 *LPDIRECTSOUND8;
+typedef struct IDirectSoundBuffer8 *LPDIRECTSOUNDBUFFER8;
+typedef struct IDirectSound3DListener8 *LPDIRECTSOUND3DLISTENER8;
+typedef struct IDirectSound3DBuffer8 *LPDIRECTSOUND3DBUFFER8;
+typedef struct IDirectSoundCapture8 *LPDIRECTSOUNDCAPTURE8;
+typedef struct IDirectSoundCaptureBuffer8 *LPDIRECTSOUNDCAPTUREBUFFER8;
+typedef struct IDirectSoundNotify8 *LPDIRECTSOUNDNOTIFY8;
+typedef struct IDirectSoundFXGargle8 *LPDIRECTSOUNDFXGARGLE8;
+typedef struct IDirectSoundFXChorus8 *LPDIRECTSOUNDFXCHORUS8;
+typedef struct IDirectSoundFXFlanger8 *LPDIRECTSOUNDFXFLANGER8;
+typedef struct IDirectSoundFXEcho8 *LPDIRECTSOUNDFXECHO8;
+typedef struct IDirectSoundFXDistortion8 *LPDIRECTSOUNDFXDISTORTION8;
+typedef struct IDirectSoundFXCompressor8 *LPDIRECTSOUNDFXCOMPRESSOR8;
+typedef struct IDirectSoundFXParamEq8 *LPDIRECTSOUNDFXPARAMEQ8;
+typedef struct IDirectSoundFXWavesReverb8 *LPDIRECTSOUNDFXWAVESREVERB8;
+typedef struct IDirectSoundFXI3DL2Reverb8 *LPDIRECTSOUNDFXI3DL2REVERB8;
+typedef struct IDirectSoundCaptureFXAec8 *LPDIRECTSOUNDCAPTUREFXAEC8;
+typedef struct IDirectSoundCaptureFXNoiseSuppress8 *LPDIRECTSOUNDCAPTUREFXNOISESUPPRESS8;
+typedef struct IDirectSoundFullDuplex8 *LPDIRECTSOUNDFULLDUPLEX8;
+
+#endif // DIRECTSOUND_VERSION >= 0x0800
+
+//
+// IID definitions for the unchanged DirectSound 8.0 interfaces
+//
+
+#if DIRECTSOUND_VERSION >= 0x0800
+
+#define IID_IDirectSoundCapture8 IID_IDirectSoundCapture
+#define IID_IDirectSound3DListener8 IID_IDirectSound3DListener
+#define IID_IDirectSound3DBuffer8 IID_IDirectSound3DBuffer
+#define IID_IDirectSoundNotify8 IID_IDirectSoundNotify
+#define IID_IDirectSoundFXGargle8 IID_IDirectSoundFXGargle
+#define IID_IDirectSoundFXChorus8 IID_IDirectSoundFXChorus
+#define IID_IDirectSoundFXFlanger8 IID_IDirectSoundFXFlanger
+#define IID_IDirectSoundFXEcho8 IID_IDirectSoundFXEcho
+#define IID_IDirectSoundFXDistortion8 IID_IDirectSoundFXDistortion
+#define IID_IDirectSoundFXCompressor8 IID_IDirectSoundFXCompressor
+#define IID_IDirectSoundFXParamEq8 IID_IDirectSoundFXParamEq
+#define IID_IDirectSoundFXWavesReverb8 IID_IDirectSoundFXWavesReverb
+#define IID_IDirectSoundFXI3DL2Reverb8 IID_IDirectSoundFXI3DL2Reverb
+#define IID_IDirectSoundCaptureFXAec8 IID_IDirectSoundCaptureFXAec
+#define IID_IDirectSoundCaptureFXNoiseSuppress8 IID_IDirectSoundCaptureFXNoiseSuppress
+#define IID_IDirectSoundFullDuplex8 IID_IDirectSoundFullDuplex
+
+#endif // DIRECTSOUND_VERSION >= 0x0800
+
+//
+// Compatibility typedefs
+//
+
+#ifndef _LPCWAVEFORMATEX_DEFINED
+#define _LPCWAVEFORMATEX_DEFINED
+typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
+#endif // _LPCWAVEFORMATEX_DEFINED
+
+#ifndef __LPCGUID_DEFINED__
+#define __LPCGUID_DEFINED__
+typedef const GUID *LPCGUID;
+#endif // __LPCGUID_DEFINED__
+
+typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
+typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
+typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
+typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
+typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
+typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
+typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
+
+#if DIRECTSOUND_VERSION >= 0x0800
+typedef LPDIRECTSOUND8 *LPLPDIRECTSOUND8;
+typedef LPDIRECTSOUNDBUFFER8 *LPLPDIRECTSOUNDBUFFER8;
+typedef LPDIRECTSOUNDCAPTURE8 *LPLPDIRECTSOUNDCAPTURE8;
+typedef LPDIRECTSOUNDCAPTUREBUFFER8 *LPLPDIRECTSOUNDCAPTUREBUFFER8;
+#endif // DIRECTSOUND_VERSION >= 0x0800
+
+//
+// Structures
+//
+
+typedef struct _DSCAPS
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwMinSecondarySampleRate;
+ DWORD dwMaxSecondarySampleRate;
+ DWORD dwPrimaryBuffers;
+ DWORD dwMaxHwMixingAllBuffers;
+ DWORD dwMaxHwMixingStaticBuffers;
+ DWORD dwMaxHwMixingStreamingBuffers;
+ DWORD dwFreeHwMixingAllBuffers;
+ DWORD dwFreeHwMixingStaticBuffers;
+ DWORD dwFreeHwMixingStreamingBuffers;
+ DWORD dwMaxHw3DAllBuffers;
+ DWORD dwMaxHw3DStaticBuffers;
+ DWORD dwMaxHw3DStreamingBuffers;
+ DWORD dwFreeHw3DAllBuffers;
+ DWORD dwFreeHw3DStaticBuffers;
+ DWORD dwFreeHw3DStreamingBuffers;
+ DWORD dwTotalHwMemBytes;
+ DWORD dwFreeHwMemBytes;
+ DWORD dwMaxContigFreeHwMemBytes;
+ DWORD dwUnlockTransferRateHwBuffers;
+ DWORD dwPlayCpuOverheadSwBuffers;
+ DWORD dwReserved1;
+ DWORD dwReserved2;
+} DSCAPS, *LPDSCAPS;
+
+typedef const DSCAPS *LPCDSCAPS;
+
+typedef struct _DSBCAPS
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwUnlockTransferRate;
+ DWORD dwPlayCpuOverhead;
+} DSBCAPS, *LPDSBCAPS;
+
+typedef const DSBCAPS *LPCDSBCAPS;
+
+#if DIRECTSOUND_VERSION >= 0x0800
+
+ typedef struct _DSEFFECTDESC
+ {
+ DWORD dwSize;
+ DWORD dwFlags;
+ GUID guidDSFXClass;
+ DWORD_PTR dwReserved1;
+ DWORD_PTR dwReserved2;
+ } DSEFFECTDESC, *LPDSEFFECTDESC;
+ typedef const DSEFFECTDESC *LPCDSEFFECTDESC;
+
+ #define DSFX_LOCHARDWARE 0x00000001
+ #define DSFX_LOCSOFTWARE 0x00000002
+
+ enum
+ {
+ DSFXR_PRESENT, // 0
+ DSFXR_LOCHARDWARE, // 1
+ DSFXR_LOCSOFTWARE, // 2
+ DSFXR_UNALLOCATED, // 3
+ DSFXR_FAILED, // 4
+ DSFXR_UNKNOWN, // 5
+ DSFXR_SENDLOOP // 6
+ };
+
+ typedef struct _DSCEFFECTDESC
+ {
+ DWORD dwSize;
+ DWORD dwFlags;
+ GUID guidDSCFXClass;
+ GUID guidDSCFXInstance;
+ DWORD dwReserved1;
+ DWORD dwReserved2;
+ } DSCEFFECTDESC, *LPDSCEFFECTDESC;
+ typedef const DSCEFFECTDESC *LPCDSCEFFECTDESC;
+
+ #define DSCFX_LOCHARDWARE 0x00000001
+ #define DSCFX_LOCSOFTWARE 0x00000002
+
+ #define DSCFXR_LOCHARDWARE 0x00000010
+ #define DSCFXR_LOCSOFTWARE 0x00000020
+
+#endif // DIRECTSOUND_VERSION >= 0x0800
+
+typedef struct _DSBUFFERDESC
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwReserved;
+ LPWAVEFORMATEX lpwfxFormat;
+#if DIRECTSOUND_VERSION >= 0x0700
+ GUID guid3DAlgorithm;
+#endif
+} DSBUFFERDESC, *LPDSBUFFERDESC;
+
+typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
+
+// Older version of this structure:
+
+typedef struct _DSBUFFERDESC1
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwReserved;
+ LPWAVEFORMATEX lpwfxFormat;
+} DSBUFFERDESC1, *LPDSBUFFERDESC1;
+
+typedef const DSBUFFERDESC1 *LPCDSBUFFERDESC1;
+
+typedef struct _DS3DBUFFER
+{
+ DWORD dwSize;
+ D3DVECTOR vPosition;
+ D3DVECTOR vVelocity;
+ DWORD dwInsideConeAngle;
+ DWORD dwOutsideConeAngle;
+ D3DVECTOR vConeOrientation;
+ LONG lConeOutsideVolume;
+ D3DVALUE flMinDistance;
+ D3DVALUE flMaxDistance;
+ DWORD dwMode;
+} DS3DBUFFER, *LPDS3DBUFFER;
+
+typedef const DS3DBUFFER *LPCDS3DBUFFER;
+
+typedef struct _DS3DLISTENER
+{
+ DWORD dwSize;
+ D3DVECTOR vPosition;
+ D3DVECTOR vVelocity;
+ D3DVECTOR vOrientFront;
+ D3DVECTOR vOrientTop;
+ D3DVALUE flDistanceFactor;
+ D3DVALUE flRolloffFactor;
+ D3DVALUE flDopplerFactor;
+} DS3DLISTENER, *LPDS3DLISTENER;
+
+typedef const DS3DLISTENER *LPCDS3DLISTENER;
+
+typedef struct _DSCCAPS
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwFormats;
+ DWORD dwChannels;
+} DSCCAPS, *LPDSCCAPS;
+
+typedef const DSCCAPS *LPCDSCCAPS;
+
+typedef struct _DSCBUFFERDESC1
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwReserved;
+ LPWAVEFORMATEX lpwfxFormat;
+} DSCBUFFERDESC1, *LPDSCBUFFERDESC1;
+
+typedef struct _DSCBUFFERDESC
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwReserved;
+ LPWAVEFORMATEX lpwfxFormat;
+#if DIRECTSOUND_VERSION >= 0x0800
+ DWORD dwFXCount;
+ LPDSCEFFECTDESC lpDSCFXDesc;
+#endif
+} DSCBUFFERDESC, *LPDSCBUFFERDESC;
+
+typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
+
+typedef struct _DSCBCAPS
+{
+ DWORD dwSize;
+ DWORD dwFlags;
+ DWORD dwBufferBytes;
+ DWORD dwReserved;
+} DSCBCAPS, *LPDSCBCAPS;
+
+typedef const DSCBCAPS *LPCDSCBCAPS;
+
+typedef struct _DSBPOSITIONNOTIFY
+{
+ DWORD dwOffset;
+ HANDLE hEventNotify;
+} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
+
+typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
+
+//
+// DirectSound API
+//
+
+typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
+typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
+
+extern HRESULT WINAPI DirectSoundCreate(LPCGUID pcGuidDevice, LPDIRECTSOUND *ppDS, LPUNKNOWN pUnkOuter);
+extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA pDSEnumCallback, LPVOID pContext);
+extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW pDSEnumCallback, LPVOID pContext);
+
+extern HRESULT WINAPI DirectSoundCaptureCreate(LPCGUID pcGuidDevice, LPDIRECTSOUNDCAPTURE *ppDSC, LPUNKNOWN pUnkOuter);
+extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA pDSEnumCallback, LPVOID pContext);
+extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW pDSEnumCallback, LPVOID pContext);
+
+#if DIRECTSOUND_VERSION >= 0x0800
+extern HRESULT WINAPI DirectSoundCreate8(LPCGUID pcGuidDevice, LPDIRECTSOUND8 *ppDS8, LPUNKNOWN pUnkOuter);
+extern HRESULT WINAPI DirectSoundCaptureCreate8(LPCGUID pcGuidDevice, LPDIRECTSOUNDCAPTURE8 *ppDSC8, LPUNKNOWN pUnkOuter);
+extern HRESULT WINAPI DirectSoundFullDuplexCreate(LPCGUID pcGuidCaptureDevice, LPCGUID pcGuidRenderDevice,
+ LPCDSCBUFFERDESC pcDSCBufferDesc, LPCDSBUFFERDESC pcDSBufferDesc, HWND hWnd,
+ DWORD dwLevel, LPDIRECTSOUNDFULLDUPLEX* ppDSFD, LPDIRECTSOUNDCAPTUREBUFFER8 *ppDSCBuffer8,
+ LPDIRECTSOUNDBUFFER8 *ppDSBuffer8, LPUNKNOWN pUnkOuter);
+#define DirectSoundFullDuplexCreate8 DirectSoundFullDuplexCreate
+
+extern HRESULT WINAPI GetDeviceID(LPCGUID pGuidSrc, LPGUID pGuidDest);
+#endif // DIRECTSOUND_VERSION >= 0x0800
+
+#ifdef UNICODE
+#define LPDSENUMCALLBACK LPDSENUMCALLBACKW
+#define DirectSoundEnumerate DirectSoundEnumerateW
+#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
+#else // UNICODE
+#define LPDSENUMCALLBACK LPDSENUMCALLBACKA
+#define DirectSoundEnumerate DirectSoundEnumerateA
+#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
+#endif // UNICODE
+
+//
+// IUnknown
+//
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#ifndef IUnknown_QueryInterface
+#define IUnknown_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
+#endif // IUnknown_QueryInterface
+#ifndef IUnknown_AddRef
+#define IUnknown_AddRef(p) (p)->lpVtbl->AddRef(p)
+#endif // IUnknown_AddRef
+#ifndef IUnknown_Release
+#define IUnknown_Release(p) (p)->lpVtbl->Release(p)
+#endif // IUnknown_Release
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#ifndef IUnknown_QueryInterface
+#define IUnknown_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
+#endif // IUnknown_QueryInterface
+#ifndef IUnknown_AddRef
+#define IUnknown_AddRef(p) (p)->AddRef()
+#endif // IUnknown_AddRef
+#ifndef IUnknown_Release
+#define IUnknown_Release(p) (p)->Release()
+#endif // IUnknown_Release
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+#ifndef __IReferenceClock_INTERFACE_DEFINED__
+#define __IReferenceClock_INTERFACE_DEFINED__
+
+typedef LONGLONG REFERENCE_TIME;
+typedef REFERENCE_TIME *LPREFERENCE_TIME;
+
+DEFINE_GUID(IID_IReferenceClock, 0x56a86897, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70);
+
+#undef INTERFACE
+#define INTERFACE IReferenceClock
+
+DECLARE_INTERFACE_(IReferenceClock, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IReferenceClock methods
+ STDMETHOD(GetTime) (THIS_ REFERENCE_TIME *pTime) PURE;
+ STDMETHOD(AdviseTime) (THIS_ REFERENCE_TIME rtBaseTime, REFERENCE_TIME rtStreamTime,
+ HANDLE hEvent, LPDWORD pdwAdviseCookie) PURE;
+ STDMETHOD(AdvisePeriodic) (THIS_ REFERENCE_TIME rtStartTime, REFERENCE_TIME rtPeriodTime,
+ HANDLE hSemaphore, LPDWORD pdwAdviseCookie) PURE;
+ STDMETHOD(Unadvise) (THIS_ DWORD dwAdviseCookie) PURE;
+};
+
+#endif // __IReferenceClock_INTERFACE_DEFINED__
+
+#ifndef IReferenceClock_QueryInterface
+
+#define IReferenceClock_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IReferenceClock_AddRef(p) IUnknown_AddRef(p)
+#define IReferenceClock_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IReferenceClock_GetTime(p,a) (p)->lpVtbl->GetTime(p,a)
+#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->lpVtbl->AdviseTime(p,a,b,c,d)
+#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->lpVtbl->AdvisePeriodic(p,a,b,c,d)
+#define IReferenceClock_Unadvise(p,a) (p)->lpVtbl->Unadvise(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IReferenceClock_GetTime(p,a) (p)->GetTime(a)
+#define IReferenceClock_AdviseTime(p,a,b,c,d) (p)->AdviseTime(a,b,c,d)
+#define IReferenceClock_AdvisePeriodic(p,a,b,c,d) (p)->AdvisePeriodic(a,b,c,d)
+#define IReferenceClock_Unadvise(p,a) (p)->Unadvise(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+#endif // IReferenceClock_QueryInterface
+
+//
+// IDirectSound
+//
+
+DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+
+#undef INTERFACE
+#define INTERFACE IDirectSound
+
+DECLARE_INTERFACE_(IDirectSound, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSound methods
+ STDMETHOD(CreateSoundBuffer) (THIS_ LPCDSBUFFERDESC pcDSBufferDesc, LPDIRECTSOUNDBUFFER *ppDSBuffer, LPUNKNOWN pUnkOuter) PURE;
+ STDMETHOD(GetCaps) (THIS_ LPDSCAPS pDSCaps) PURE;
+ STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER pDSBufferOriginal, LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE;
+ STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE;
+ STDMETHOD(Compact) (THIS) PURE;
+ STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD pdwSpeakerConfig) PURE;
+ STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE;
+ STDMETHOD(Initialize) (THIS_ LPCGUID pcGuidDevice) PURE;
+};
+
+#define IDirectSound_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSound_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSound_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
+#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
+#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
+#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p)
+#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a)
+#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b)
+#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c)
+#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
+#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
+#define IDirectSound_Compact(p) (p)->Compact()
+#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a)
+#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b)
+#define IDirectSound_Initialize(p,a) (p)->Initialize(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+#if DIRECTSOUND_VERSION >= 0x0800
+
+//
+// IDirectSound8
+//
+
+DEFINE_GUID(IID_IDirectSound8, 0xC50A7E93, 0xF395, 0x4834, 0x9E, 0xF6, 0x7F, 0xA9, 0x9D, 0xE5, 0x09, 0x66);
+
+#undef INTERFACE
+#define INTERFACE IDirectSound8
+
+DECLARE_INTERFACE_(IDirectSound8, IDirectSound)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSound methods
+ STDMETHOD(CreateSoundBuffer) (THIS_ LPCDSBUFFERDESC pcDSBufferDesc, LPDIRECTSOUNDBUFFER *ppDSBuffer, LPUNKNOWN pUnkOuter) PURE;
+ STDMETHOD(GetCaps) (THIS_ LPDSCAPS pDSCaps) PURE;
+ STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER pDSBufferOriginal, LPDIRECTSOUNDBUFFER *ppDSBufferDuplicate) PURE;
+ STDMETHOD(SetCooperativeLevel) (THIS_ HWND hwnd, DWORD dwLevel) PURE;
+ STDMETHOD(Compact) (THIS) PURE;
+ STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD pdwSpeakerConfig) PURE;
+ STDMETHOD(SetSpeakerConfig) (THIS_ DWORD dwSpeakerConfig) PURE;
+ STDMETHOD(Initialize) (THIS_ LPCGUID pcGuidDevice) PURE;
+
+ // IDirectSound8 methods
+ STDMETHOD(VerifyCertification) (THIS_ LPDWORD pdwCertified) PURE;
+};
+
+#define IDirectSound8_QueryInterface(p,a,b) IDirectSound_QueryInterface(p,a,b)
+#define IDirectSound8_AddRef(p) IDirectSound_AddRef(p)
+#define IDirectSound8_Release(p) IDirectSound_Release(p)
+#define IDirectSound8_CreateSoundBuffer(p,a,b,c) IDirectSound_CreateSoundBuffer(p,a,b,c)
+#define IDirectSound8_GetCaps(p,a) IDirectSound_GetCaps(p,a)
+#define IDirectSound8_DuplicateSoundBuffer(p,a,b) IDirectSound_DuplicateSoundBuffer(p,a,b)
+#define IDirectSound8_SetCooperativeLevel(p,a,b) IDirectSound_SetCooperativeLevel(p,a,b)
+#define IDirectSound8_Compact(p) IDirectSound_Compact(p)
+#define IDirectSound8_GetSpeakerConfig(p,a) IDirectSound_GetSpeakerConfig(p,a)
+#define IDirectSound8_SetSpeakerConfig(p,a) IDirectSound_SetSpeakerConfig(p,a)
+#define IDirectSound8_Initialize(p,a) IDirectSound_Initialize(p,a)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound8_VerifyCertification(p,a) (p)->lpVtbl->VerifyCertification(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound8_VerifyCertification(p,a) (p)->VerifyCertification(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+#endif // DIRECTSOUND_VERSION >= 0x0800
+
+//
+// IDirectSoundBuffer
+//
+
+DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundBuffer
+
+DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundBuffer methods
+ STDMETHOD(GetCaps) (THIS_ LPDSBCAPS pDSBufferCaps) PURE;
+ STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor) PURE;
+ STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
+ STDMETHOD(GetVolume) (THIS_ LPLONG plVolume) PURE;
+ STDMETHOD(GetPan) (THIS_ LPLONG plPan) PURE;
+ STDMETHOD(GetFrequency) (THIS_ LPDWORD pdwFrequency) PURE;
+ STDMETHOD(GetStatus) (THIS_ LPDWORD pdwStatus) PURE;
+ STDMETHOD(Initialize) (THIS_ LPDIRECTSOUND pDirectSound, LPCDSBUFFERDESC pcDSBufferDesc) PURE;
+ STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
+ LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
+ STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE;
+ STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE;
+ STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX pcfxFormat) PURE;
+ STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE;
+ STDMETHOD(SetPan) (THIS_ LONG lPan) PURE;
+ STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE;
+ STDMETHOD(Stop) (THIS) PURE;
+ STDMETHOD(Unlock) (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
+ STDMETHOD(Restore) (THIS) PURE;
+};
+
+#define IDirectSoundBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundBuffer_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundBuffer_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a)
+#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a)
+#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a)
+#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
+#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a)
+#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
+#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a)
+#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a)
+#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
+#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p)
+#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
+#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
+#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
+#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a)
+#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a)
+#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a)
+#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a)
+#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
+#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c)
+#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a)
+#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a)
+#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a)
+#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a)
+#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a)
+#define IDirectSoundBuffer_Stop(p) (p)->Stop()
+#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
+#define IDirectSoundBuffer_Restore(p) (p)->Restore()
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+#if DIRECTSOUND_VERSION >= 0x0800
+
+//
+// IDirectSoundBuffer8
+//
+
+DEFINE_GUID(IID_IDirectSoundBuffer8, 0x6825a449, 0x7524, 0x4d82, 0x92, 0x0f, 0x50, 0xe3, 0x6a, 0xb3, 0xab, 0x1e);
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundBuffer8
+
+DECLARE_INTERFACE_(IDirectSoundBuffer8, IDirectSoundBuffer)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundBuffer methods
+ STDMETHOD(GetCaps) (THIS_ LPDSBCAPS pDSBufferCaps) PURE;
+ STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD pdwCurrentPlayCursor, LPDWORD pdwCurrentWriteCursor) PURE;
+ STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
+ STDMETHOD(GetVolume) (THIS_ LPLONG plVolume) PURE;
+ STDMETHOD(GetPan) (THIS_ LPLONG plPan) PURE;
+ STDMETHOD(GetFrequency) (THIS_ LPDWORD pdwFrequency) PURE;
+ STDMETHOD(GetStatus) (THIS_ LPDWORD pdwStatus) PURE;
+ STDMETHOD(Initialize) (THIS_ LPDIRECTSOUND pDirectSound, LPCDSBUFFERDESC pcDSBufferDesc) PURE;
+ STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
+ LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
+ STDMETHOD(Play) (THIS_ DWORD dwReserved1, DWORD dwPriority, DWORD dwFlags) PURE;
+ STDMETHOD(SetCurrentPosition) (THIS_ DWORD dwNewPosition) PURE;
+ STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX pcfxFormat) PURE;
+ STDMETHOD(SetVolume) (THIS_ LONG lVolume) PURE;
+ STDMETHOD(SetPan) (THIS_ LONG lPan) PURE;
+ STDMETHOD(SetFrequency) (THIS_ DWORD dwFrequency) PURE;
+ STDMETHOD(Stop) (THIS) PURE;
+ STDMETHOD(Unlock) (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
+ STDMETHOD(Restore) (THIS) PURE;
+
+ // IDirectSoundBuffer8 methods
+ STDMETHOD(SetFX) (THIS_ DWORD dwEffectsCount, LPDSEFFECTDESC pDSFXDesc, LPDWORD pdwResultCodes) PURE;
+ STDMETHOD(AcquireResources) (THIS_ DWORD dwFlags, DWORD dwEffectsCount, LPDWORD pdwResultCodes) PURE;
+ STDMETHOD(GetObjectInPath) (THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
+};
+
+// Special GUID meaning "select all objects" for use in GetObjectInPath()
+DEFINE_GUID(GUID_All_Objects, 0xaa114de5, 0xc262, 0x4169, 0xa1, 0xc8, 0x23, 0xd6, 0x98, 0xcc, 0x73, 0xb5);
+
+#define IDirectSoundBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundBuffer8_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundBuffer8_Release(p) IUnknown_Release(p)
+
+#define IDirectSoundBuffer8_GetCaps(p,a) IDirectSoundBuffer_GetCaps(p,a)
+#define IDirectSoundBuffer8_GetCurrentPosition(p,a,b) IDirectSoundBuffer_GetCurrentPosition(p,a,b)
+#define IDirectSoundBuffer8_GetFormat(p,a,b,c) IDirectSoundBuffer_GetFormat(p,a,b,c)
+#define IDirectSoundBuffer8_GetVolume(p,a) IDirectSoundBuffer_GetVolume(p,a)
+#define IDirectSoundBuffer8_GetPan(p,a) IDirectSoundBuffer_GetPan(p,a)
+#define IDirectSoundBuffer8_GetFrequency(p,a) IDirectSoundBuffer_GetFrequency(p,a)
+#define IDirectSoundBuffer8_GetStatus(p,a) IDirectSoundBuffer_GetStatus(p,a)
+#define IDirectSoundBuffer8_Initialize(p,a,b) IDirectSoundBuffer_Initialize(p,a,b)
+#define IDirectSoundBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundBuffer8_Play(p,a,b,c) IDirectSoundBuffer_Play(p,a,b,c)
+#define IDirectSoundBuffer8_SetCurrentPosition(p,a) IDirectSoundBuffer_SetCurrentPosition(p,a)
+#define IDirectSoundBuffer8_SetFormat(p,a) IDirectSoundBuffer_SetFormat(p,a)
+#define IDirectSoundBuffer8_SetVolume(p,a) IDirectSoundBuffer_SetVolume(p,a)
+#define IDirectSoundBuffer8_SetPan(p,a) IDirectSoundBuffer_SetPan(p,a)
+#define IDirectSoundBuffer8_SetFrequency(p,a) IDirectSoundBuffer_SetFrequency(p,a)
+#define IDirectSoundBuffer8_Stop(p) IDirectSoundBuffer_Stop(p)
+#define IDirectSoundBuffer8_Unlock(p,a,b,c,d) IDirectSoundBuffer_Unlock(p,a,b,c,d)
+#define IDirectSoundBuffer8_Restore(p) IDirectSoundBuffer_Restore(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->lpVtbl->SetFX(p,a,b,c)
+#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->lpVtbl->AcquireResources(p,a,b,c)
+#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundBuffer8_SetFX(p,a,b,c) (p)->SetFX(a,b,c)
+#define IDirectSoundBuffer8_AcquireResources(p,a,b,c) (p)->AcquireResources(a,b,c)
+#define IDirectSoundBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+#endif // DIRECTSOUND_VERSION >= 0x0800
+
+//
+// IDirectSound3DListener
+//
+
+DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+
+#undef INTERFACE
+#define INTERFACE IDirectSound3DListener
+
+DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSound3DListener methods
+ STDMETHOD(GetAllParameters) (THIS_ LPDS3DLISTENER pListener) PURE;
+ STDMETHOD(GetDistanceFactor) (THIS_ D3DVALUE* pflDistanceFactor) PURE;
+ STDMETHOD(GetDopplerFactor) (THIS_ D3DVALUE* pflDopplerFactor) PURE;
+ STDMETHOD(GetOrientation) (THIS_ D3DVECTOR* pvOrientFront, D3DVECTOR* pvOrientTop) PURE;
+ STDMETHOD(GetPosition) (THIS_ D3DVECTOR* pvPosition) PURE;
+ STDMETHOD(GetRolloffFactor) (THIS_ D3DVALUE* pflRolloffFactor) PURE;
+ STDMETHOD(GetVelocity) (THIS_ D3DVECTOR* pvVelocity) PURE;
+ STDMETHOD(SetAllParameters) (THIS_ LPCDS3DLISTENER pcListener, DWORD dwApply) PURE;
+ STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE flDistanceFactor, DWORD dwApply) PURE;
+ STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE flDopplerFactor, DWORD dwApply) PURE;
+ STDMETHOD(SetOrientation) (THIS_ D3DVALUE xFront, D3DVALUE yFront, D3DVALUE zFront,
+ D3DVALUE xTop, D3DVALUE yTop, D3DVALUE zTop, DWORD dwApply) PURE;
+ STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+ STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE flRolloffFactor, DWORD dwApply) PURE;
+ STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+ STDMETHOD(CommitDeferredSettings) (THIS) PURE;
+};
+
+#define IDirectSound3DListener_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSound3DListener_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSound3DListener_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a)
+#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a)
+#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b)
+#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
+#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a)
+#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
+#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
+#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b)
+#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b)
+#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
+#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
+#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b)
+#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
+#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a)
+#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a)
+#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b)
+#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a)
+#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a)
+#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a)
+#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
+#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b)
+#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b)
+#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g)
+#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
+#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b)
+#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
+#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings()
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSound3DBuffer
+//
+
+DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
+
+#undef INTERFACE
+#define INTERFACE IDirectSound3DBuffer
+
+DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSound3DBuffer methods
+ STDMETHOD(GetAllParameters) (THIS_ LPDS3DBUFFER pDs3dBuffer) PURE;
+ STDMETHOD(GetConeAngles) (THIS_ LPDWORD pdwInsideConeAngle, LPDWORD pdwOutsideConeAngle) PURE;
+ STDMETHOD(GetConeOrientation) (THIS_ D3DVECTOR* pvOrientation) PURE;
+ STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG plConeOutsideVolume) PURE;
+ STDMETHOD(GetMaxDistance) (THIS_ D3DVALUE* pflMaxDistance) PURE;
+ STDMETHOD(GetMinDistance) (THIS_ D3DVALUE* pflMinDistance) PURE;
+ STDMETHOD(GetMode) (THIS_ LPDWORD pdwMode) PURE;
+ STDMETHOD(GetPosition) (THIS_ D3DVECTOR* pvPosition) PURE;
+ STDMETHOD(GetVelocity) (THIS_ D3DVECTOR* pvVelocity) PURE;
+ STDMETHOD(SetAllParameters) (THIS_ LPCDS3DBUFFER pcDs3dBuffer, DWORD dwApply) PURE;
+ STDMETHOD(SetConeAngles) (THIS_ DWORD dwInsideConeAngle, DWORD dwOutsideConeAngle, DWORD dwApply) PURE;
+ STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+ STDMETHOD(SetConeOutsideVolume) (THIS_ LONG lConeOutsideVolume, DWORD dwApply) PURE;
+ STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE flMaxDistance, DWORD dwApply) PURE;
+ STDMETHOD(SetMinDistance) (THIS_ D3DVALUE flMinDistance, DWORD dwApply) PURE;
+ STDMETHOD(SetMode) (THIS_ DWORD dwMode, DWORD dwApply) PURE;
+ STDMETHOD(SetPosition) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+ STDMETHOD(SetVelocity) (THIS_ D3DVALUE x, D3DVALUE y, D3DVALUE z, DWORD dwApply) PURE;
+};
+
+#define IDirectSound3DBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSound3DBuffer_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSound3DBuffer_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b)
+#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a)
+#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a)
+#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
+#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a)
+#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a)
+#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a)
+#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
+#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
+#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c)
+#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
+#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->lpVtbl->SetConeOutsideVolume(p,a,b)
+#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
+#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b)
+#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b)
+#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b)
+#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b)
+#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a)
+#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a)
+#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a)
+#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a)
+#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a)
+#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a)
+#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a)
+#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
+#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c)
+#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
+#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b) (p)->SetConeOutsideVolume(a,b)
+#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
+#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b)
+#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b)
+#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b)
+#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundCapture
+//
+
+DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundCapture
+
+DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundCapture methods
+ STDMETHOD(CreateCaptureBuffer) (THIS_ LPCDSCBUFFERDESC pcDSCBufferDesc, LPDIRECTSOUNDCAPTUREBUFFER *ppDSCBuffer, LPUNKNOWN pUnkOuter) PURE;
+ STDMETHOD(GetCaps) (THIS_ LPDSCCAPS pDSCCaps) PURE;
+ STDMETHOD(Initialize) (THIS_ LPCGUID pcGuidDevice) PURE;
+};
+
+#define IDirectSoundCapture_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundCapture_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundCapture_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
+#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c)
+#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundCaptureBuffer
+//
+
+DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundCaptureBuffer
+
+DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundCaptureBuffer methods
+ STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS pDSCBCaps) PURE;
+ STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD pdwCapturePosition, LPDWORD pdwReadPosition) PURE;
+ STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
+ STDMETHOD(GetStatus) (THIS_ LPDWORD pdwStatus) PURE;
+ STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE pDirectSoundCapture, LPCDSCBUFFERDESC pcDSCBufferDesc) PURE;
+ STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
+ LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
+ STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE;
+ STDMETHOD(Stop) (THIS) PURE;
+ STDMETHOD(Unlock) (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
+};
+
+#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundCaptureBuffer_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundCaptureBuffer_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
+#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
+#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
+#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
+#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
+#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
+#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p)
+#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a)
+#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
+#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
+#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a)
+#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
+#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a)
+#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop()
+#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+
+#if DIRECTSOUND_VERSION >= 0x0800
+
+//
+// IDirectSoundCaptureBuffer8
+//
+
+DEFINE_GUID(IID_IDirectSoundCaptureBuffer8, 0x990df4, 0xdbb, 0x4872, 0x83, 0x3e, 0x6d, 0x30, 0x3e, 0x80, 0xae, 0xb6);
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundCaptureBuffer8
+
+DECLARE_INTERFACE_(IDirectSoundCaptureBuffer8, IDirectSoundCaptureBuffer)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundCaptureBuffer methods
+ STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS pDSCBCaps) PURE;
+ STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD pdwCapturePosition, LPDWORD pdwReadPosition) PURE;
+ STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX pwfxFormat, DWORD dwSizeAllocated, LPDWORD pdwSizeWritten) PURE;
+ STDMETHOD(GetStatus) (THIS_ LPDWORD pdwStatus) PURE;
+ STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE pDirectSoundCapture, LPCDSCBUFFERDESC pcDSCBufferDesc) PURE;
+ STDMETHOD(Lock) (THIS_ DWORD dwOffset, DWORD dwBytes, LPVOID *ppvAudioPtr1, LPDWORD pdwAudioBytes1,
+ LPVOID *ppvAudioPtr2, LPDWORD pdwAudioBytes2, DWORD dwFlags) PURE;
+ STDMETHOD(Start) (THIS_ DWORD dwFlags) PURE;
+ STDMETHOD(Stop) (THIS) PURE;
+ STDMETHOD(Unlock) (THIS_ LPVOID pvAudioPtr1, DWORD dwAudioBytes1, LPVOID pvAudioPtr2, DWORD dwAudioBytes2) PURE;
+
+ // IDirectSoundCaptureBuffer8 methods
+ STDMETHOD(GetObjectInPath) (THIS_ REFGUID rguidObject, DWORD dwIndex, REFGUID rguidInterface, LPVOID *ppObject) PURE;
+ STDMETHOD(GetFXStatus) (DWORD dwFXCount, LPDWORD pdwFXStatus) PURE;
+};
+
+#define IDirectSoundCaptureBuffer8_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundCaptureBuffer8_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundCaptureBuffer8_Release(p) IUnknown_Release(p)
+
+#define IDirectSoundCaptureBuffer8_GetCaps(p,a) IDirectSoundCaptureBuffer_GetCaps(p,a)
+#define IDirectSoundCaptureBuffer8_GetCurrentPosition(p,a,b) IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b)
+#define IDirectSoundCaptureBuffer8_GetFormat(p,a,b,c) IDirectSoundCaptureBuffer_GetFormat(p,a,b,c)
+#define IDirectSoundCaptureBuffer8_GetStatus(p,a) IDirectSoundCaptureBuffer_GetStatus(p,a)
+#define IDirectSoundCaptureBuffer8_Initialize(p,a,b) IDirectSoundCaptureBuffer_Initialize(p,a,b)
+#define IDirectSoundCaptureBuffer8_Lock(p,a,b,c,d,e,f,g) IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g)
+#define IDirectSoundCaptureBuffer8_Start(p,a) IDirectSoundCaptureBuffer_Start(p,a)
+#define IDirectSoundCaptureBuffer8_Stop(p) IDirectSoundCaptureBuffer_Stop(p))
+#define IDirectSoundCaptureBuffer8_Unlock(p,a,b,c,d) IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->lpVtbl->GetObjectInPath(p,a,b,c,d)
+#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->lpVtbl->GetFXStatus(p,a,b)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCaptureBuffer8_GetObjectInPath(p,a,b,c,d) (p)->GetObjectInPath(a,b,c,d)
+#define IDirectSoundCaptureBuffer8_GetFXStatus(p,a,b) (p)->GetFXStatus(a,b)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+#endif // DIRECTSOUND_VERSION >= 0x0800
+
+//
+// IDirectSoundNotify
+//
+
+DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundNotify
+
+DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundNotify methods
+ STDMETHOD(SetNotificationPositions) (THIS_ DWORD dwPositionNotifies, LPCDSBPOSITIONNOTIFY pcPositionNotifies) PURE;
+};
+
+#define IDirectSoundNotify_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundNotify_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundNotify_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IKsPropertySet
+//
+
+#ifndef _IKsPropertySet_
+#define _IKsPropertySet_
+
+#ifdef __cplusplus
+// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
+struct IKsPropertySet;
+#endif // __cplusplus
+
+typedef struct IKsPropertySet *LPKSPROPERTYSET;
+
+#define KSPROPERTY_SUPPORT_GET 0x00000001
+#define KSPROPERTY_SUPPORT_SET 0x00000002
+
+DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
+
+#undef INTERFACE
+#define INTERFACE IKsPropertySet
+
+DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IKsPropertySet methods
+ STDMETHOD(Get) (THIS_ REFGUID rguidPropSet, ULONG ulId, LPVOID pInstanceData, ULONG ulInstanceLength,
+ LPVOID pPropertyData, ULONG ulDataLength, PULONG pulBytesReturned) PURE;
+ STDMETHOD(Set) (THIS_ REFGUID rguidPropSet, ULONG ulId, LPVOID pInstanceData, ULONG ulInstanceLength,
+ LPVOID pPropertyData, ULONG ulDataLength) PURE;
+ STDMETHOD(QuerySupport) (THIS_ REFGUID rguidPropSet, ULONG ulId, PULONG pulTypeSupport) PURE;
+};
+
+#define IKsPropertySet_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IKsPropertySet_AddRef(p) IUnknown_AddRef(p)
+#define IKsPropertySet_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
+#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f)
+#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g)
+#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f)
+#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+#endif // _IKsPropertySet_
+
+#if DIRECTSOUND_VERSION >= 0x0800
+
+//
+// IDirectSoundFXGargle
+//
+
+DEFINE_GUID(IID_IDirectSoundFXGargle, 0xd616f352, 0xd622, 0x11ce, 0xaa, 0xc5, 0x00, 0x20, 0xaf, 0x0b, 0x99, 0xa3);
+
+typedef struct _DSFXGargle
+{
+ DWORD dwRateHz; // Rate of modulation in hz
+ DWORD dwWaveShape; // DSFXGARGLE_WAVE_xxx
+} DSFXGargle, *LPDSFXGargle;
+
+#define DSFXGARGLE_WAVE_TRIANGLE 0
+#define DSFXGARGLE_WAVE_SQUARE 1
+
+typedef const DSFXGargle *LPCDSFXGargle;
+
+#define DSFXGARGLE_RATEHZ_MIN 1
+#define DSFXGARGLE_RATEHZ_MAX 1000
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundFXGargle
+
+DECLARE_INTERFACE_(IDirectSoundFXGargle, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundFXGargle methods
+ STDMETHOD(SetAllParameters) (THIS_ LPCDSFXGargle pcDsFxGargle) PURE;
+ STDMETHOD(GetAllParameters) (THIS_ LPDSFXGargle pDsFxGargle) PURE;
+};
+
+#define IDirectSoundFXGargle_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundFXGargle_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundFXGargle_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
+#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXGargle_SetAllParameters(p,a) (p)->SetAllParameters(a)
+#define IDirectSoundFXGargle_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundFXChorus
+//
+
+DEFINE_GUID(IID_IDirectSoundFXChorus, 0x880842e3, 0x145f, 0x43e6, 0xa9, 0x34, 0xa7, 0x18, 0x06, 0xe5, 0x05, 0x47);
+
+typedef struct _DSFXChorus
+{
+ FLOAT fWetDryMix;
+ FLOAT fDepth;
+ FLOAT fFeedback;
+ FLOAT fFrequency;
+ LONG lWaveform; // LFO shape; DSFXCHORUS_WAVE_xxx
+ FLOAT fDelay;
+ LONG lPhase;
+} DSFXChorus, *LPDSFXChorus;
+
+typedef const DSFXChorus *LPCDSFXChorus;
+
+#define DSFXCHORUS_WAVE_TRIANGLE 0
+#define DSFXCHORUS_WAVE_SIN 1
+
+#define DSFXCHORUS_WETDRYMIX_MIN 0.0f
+#define DSFXCHORUS_WETDRYMIX_MAX 100.0f
+#define DSFXCHORUS_DEPTH_MIN 0.0f
+#define DSFXCHORUS_DEPTH_MAX 100.0f
+#define DSFXCHORUS_FEEDBACK_MIN -99.0f
+#define DSFXCHORUS_FEEDBACK_MAX 99.0f
+#define DSFXCHORUS_FREQUENCY_MIN 0.0f
+#define DSFXCHORUS_FREQUENCY_MAX 10.0f
+#define DSFXCHORUS_DELAY_MIN 0.0f
+#define DSFXCHORUS_DELAY_MAX 20.0f
+#define DSFXCHORUS_PHASE_MIN 0
+#define DSFXCHORUS_PHASE_MAX 4
+
+#define DSFXCHORUS_PHASE_NEG_180 0
+#define DSFXCHORUS_PHASE_NEG_90 1
+#define DSFXCHORUS_PHASE_ZERO 2
+#define DSFXCHORUS_PHASE_90 3
+#define DSFXCHORUS_PHASE_180 4
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundFXChorus
+
+DECLARE_INTERFACE_(IDirectSoundFXChorus, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundFXChorus methods
+ STDMETHOD(SetAllParameters) (THIS_ LPCDSFXChorus pcDsFxChorus) PURE;
+ STDMETHOD(GetAllParameters) (THIS_ LPDSFXChorus pDsFxChorus) PURE;
+};
+
+#define IDirectSoundFXChorus_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundFXChorus_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundFXChorus_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
+#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXChorus_SetAllParameters(p,a) (p)->SetAllParameters(a)
+#define IDirectSoundFXChorus_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundFXFlanger
+//
+
+DEFINE_GUID(IID_IDirectSoundFXFlanger, 0x903e9878, 0x2c92, 0x4072, 0x9b, 0x2c, 0xea, 0x68, 0xf5, 0x39, 0x67, 0x83);
+
+typedef struct _DSFXFlanger
+{
+ FLOAT fWetDryMix;
+ FLOAT fDepth;
+ FLOAT fFeedback;
+ FLOAT fFrequency;
+ LONG lWaveform;
+ FLOAT fDelay;
+ LONG lPhase;
+} DSFXFlanger, *LPDSFXFlanger;
+
+typedef const DSFXFlanger *LPCDSFXFlanger;
+
+#define DSFXFLANGER_WAVE_TRIANGLE 0
+#define DSFXFLANGER_WAVE_SIN 1
+
+#define DSFXFLANGER_WETDRYMIX_MIN 0.0f
+#define DSFXFLANGER_WETDRYMIX_MAX 100.0f
+#define DSFXFLANGER_FREQUENCY_MIN 0.0f
+#define DSFXFLANGER_FREQUENCY_MAX 10.0f
+#define DSFXFLANGER_DEPTH_MIN 0.0f
+#define DSFXFLANGER_DEPTH_MAX 100.0f
+#define DSFXFLANGER_PHASE_MIN 0
+#define DSFXFLANGER_PHASE_MAX 4
+#define DSFXFLANGER_FEEDBACK_MIN -99.0f
+#define DSFXFLANGER_FEEDBACK_MAX 99.0f
+#define DSFXFLANGER_DELAY_MIN 0.0f
+#define DSFXFLANGER_DELAY_MAX 4.0f
+
+#define DSFXFLANGER_PHASE_NEG_180 0
+#define DSFXFLANGER_PHASE_NEG_90 1
+#define DSFXFLANGER_PHASE_ZERO 2
+#define DSFXFLANGER_PHASE_90 3
+#define DSFXFLANGER_PHASE_180 4
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundFXFlanger
+
+DECLARE_INTERFACE_(IDirectSoundFXFlanger, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundFXFlanger methods
+ STDMETHOD(SetAllParameters) (THIS_ LPCDSFXFlanger pcDsFxFlanger) PURE;
+ STDMETHOD(GetAllParameters) (THIS_ LPDSFXFlanger pDsFxFlanger) PURE;
+};
+
+#define IDirectSoundFXFlanger_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundFXFlanger_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundFXFlanger_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
+#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXFlanger_SetAllParameters(p,a) (p)->SetAllParameters(a)
+#define IDirectSoundFXFlanger_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundFXEcho
+//
+
+DEFINE_GUID(IID_IDirectSoundFXEcho, 0x8bd28edf, 0x50db, 0x4e92, 0xa2, 0xbd, 0x44, 0x54, 0x88, 0xd1, 0xed, 0x42);
+
+typedef struct _DSFXEcho
+{
+ FLOAT fWetDryMix;
+ FLOAT fFeedback;
+ FLOAT fLeftDelay;
+ FLOAT fRightDelay;
+ LONG lPanDelay;
+} DSFXEcho, *LPDSFXEcho;
+
+typedef const DSFXEcho *LPCDSFXEcho;
+
+#define DSFXECHO_WETDRYMIX_MIN 0.0f
+#define DSFXECHO_WETDRYMIX_MAX 100.0f
+#define DSFXECHO_FEEDBACK_MIN 0.0f
+#define DSFXECHO_FEEDBACK_MAX 100.0f
+#define DSFXECHO_LEFTDELAY_MIN 1.0f
+#define DSFXECHO_LEFTDELAY_MAX 2000.0f
+#define DSFXECHO_RIGHTDELAY_MIN 1.0f
+#define DSFXECHO_RIGHTDELAY_MAX 2000.0f
+#define DSFXECHO_PANDELAY_MIN 0
+#define DSFXECHO_PANDELAY_MAX 1
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundFXEcho
+
+DECLARE_INTERFACE_(IDirectSoundFXEcho, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundFXEcho methods
+ STDMETHOD(SetAllParameters) (THIS_ LPCDSFXEcho pcDsFxEcho) PURE;
+ STDMETHOD(GetAllParameters) (THIS_ LPDSFXEcho pDsFxEcho) PURE;
+};
+
+#define IDirectSoundFXEcho_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundFXEcho_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundFXEcho_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
+#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXEcho_SetAllParameters(p,a) (p)->SetAllParameters(a)
+#define IDirectSoundFXEcho_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundFXDistortion
+//
+
+DEFINE_GUID(IID_IDirectSoundFXDistortion, 0x8ecf4326, 0x455f, 0x4d8b, 0xbd, 0xa9, 0x8d, 0x5d, 0x3e, 0x9e, 0x3e, 0x0b);
+
+typedef struct _DSFXDistortion
+{
+ FLOAT fGain;
+ FLOAT fEdge;
+ FLOAT fPostEQCenterFrequency;
+ FLOAT fPostEQBandwidth;
+ FLOAT fPreLowpassCutoff;
+} DSFXDistortion, *LPDSFXDistortion;
+
+typedef const DSFXDistortion *LPCDSFXDistortion;
+
+#define DSFXDISTORTION_GAIN_MIN -60.0f
+#define DSFXDISTORTION_GAIN_MAX 0.0f
+#define DSFXDISTORTION_EDGE_MIN 0.0f
+#define DSFXDISTORTION_EDGE_MAX 100.0f
+#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MIN 100.0f
+#define DSFXDISTORTION_POSTEQCENTERFREQUENCY_MAX 8000.0f
+#define DSFXDISTORTION_POSTEQBANDWIDTH_MIN 100.0f
+#define DSFXDISTORTION_POSTEQBANDWIDTH_MAX 8000.0f
+#define DSFXDISTORTION_PRELOWPASSCUTOFF_MIN 100.0f
+#define DSFXDISTORTION_PRELOWPASSCUTOFF_MAX 8000.0f
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundFXDistortion
+
+DECLARE_INTERFACE_(IDirectSoundFXDistortion, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundFXDistortion methods
+ STDMETHOD(SetAllParameters) (THIS_ LPCDSFXDistortion pcDsFxDistortion) PURE;
+ STDMETHOD(GetAllParameters) (THIS_ LPDSFXDistortion pDsFxDistortion) PURE;
+};
+
+#define IDirectSoundFXDistortion_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundFXDistortion_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundFXDistortion_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
+#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXDistortion_SetAllParameters(p,a) (p)->SetAllParameters(a)
+#define IDirectSoundFXDistortion_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundFXCompressor
+//
+
+DEFINE_GUID(IID_IDirectSoundFXCompressor, 0x4bbd1154, 0x62f6, 0x4e2c, 0xa1, 0x5c, 0xd3, 0xb6, 0xc4, 0x17, 0xf7, 0xa0);
+
+typedef struct _DSFXCompressor
+{
+ FLOAT fGain;
+ FLOAT fAttack;
+ FLOAT fRelease;
+ FLOAT fThreshold;
+ FLOAT fRatio;
+ FLOAT fPredelay;
+} DSFXCompressor, *LPDSFXCompressor;
+
+typedef const DSFXCompressor *LPCDSFXCompressor;
+
+#define DSFXCOMPRESSOR_GAIN_MIN -60.0f
+#define DSFXCOMPRESSOR_GAIN_MAX 60.0f
+#define DSFXCOMPRESSOR_ATTACK_MIN 0.01f
+#define DSFXCOMPRESSOR_ATTACK_MAX 500.0f
+#define DSFXCOMPRESSOR_RELEASE_MIN 50.0f
+#define DSFXCOMPRESSOR_RELEASE_MAX 3000.0f
+#define DSFXCOMPRESSOR_THRESHOLD_MIN -60.0f
+#define DSFXCOMPRESSOR_THRESHOLD_MAX 0.0f
+#define DSFXCOMPRESSOR_RATIO_MIN 1.0f
+#define DSFXCOMPRESSOR_RATIO_MAX 100.0f
+#define DSFXCOMPRESSOR_PREDELAY_MIN 0.0f
+#define DSFXCOMPRESSOR_PREDELAY_MAX 4.0f
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundFXCompressor
+
+DECLARE_INTERFACE_(IDirectSoundFXCompressor, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundFXCompressor methods
+ STDMETHOD(SetAllParameters) (THIS_ LPCDSFXCompressor pcDsFxCompressor) PURE;
+ STDMETHOD(GetAllParameters) (THIS_ LPDSFXCompressor pDsFxCompressor) PURE;
+};
+
+#define IDirectSoundFXCompressor_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundFXCompressor_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundFXCompressor_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
+#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXCompressor_SetAllParameters(p,a) (p)->SetAllParameters(a)
+#define IDirectSoundFXCompressor_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundFXParamEq
+//
+
+DEFINE_GUID(IID_IDirectSoundFXParamEq, 0xc03ca9fe, 0xfe90, 0x4204, 0x80, 0x78, 0x82, 0x33, 0x4c, 0xd1, 0x77, 0xda);
+
+typedef struct _DSFXParamEq
+{
+ FLOAT fCenter;
+ FLOAT fBandwidth;
+ FLOAT fGain;
+} DSFXParamEq, *LPDSFXParamEq;
+
+typedef const DSFXParamEq *LPCDSFXParamEq;
+
+#define DSFXPARAMEQ_CENTER_MIN 80.0f
+#define DSFXPARAMEQ_CENTER_MAX 16000.0f
+#define DSFXPARAMEQ_BANDWIDTH_MIN 1.0f
+#define DSFXPARAMEQ_BANDWIDTH_MAX 36.0f
+#define DSFXPARAMEQ_GAIN_MIN -15.0f
+#define DSFXPARAMEQ_GAIN_MAX 15.0f
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundFXParamEq
+
+DECLARE_INTERFACE_(IDirectSoundFXParamEq, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundFXParamEq methods
+ STDMETHOD(SetAllParameters) (THIS_ LPCDSFXParamEq pcDsFxParamEq) PURE;
+ STDMETHOD(GetAllParameters) (THIS_ LPDSFXParamEq pDsFxParamEq) PURE;
+};
+
+#define IDirectSoundFXParamEq_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundFXParamEq_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundFXParamEq_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
+#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXParamEq_SetAllParameters(p,a) (p)->SetAllParameters(a)
+#define IDirectSoundFXParamEq_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundFXI3DL2Reverb
+//
+
+DEFINE_GUID(IID_IDirectSoundFXI3DL2Reverb, 0x4b166a6a, 0x0d66, 0x43f3, 0x80, 0xe3, 0xee, 0x62, 0x80, 0xde, 0xe1, 0xa4);
+
+typedef struct _DSFXI3DL2Reverb
+{
+ LONG lRoom; // [-10000, 0] default: -1000 mB
+ LONG lRoomHF; // [-10000, 0] default: 0 mB
+ FLOAT flRoomRolloffFactor; // [0.0, 10.0] default: 0.0
+ FLOAT flDecayTime; // [0.1, 20.0] default: 1.49s
+ FLOAT flDecayHFRatio; // [0.1, 2.0] default: 0.83
+ LONG lReflections; // [-10000, 1000] default: -2602 mB
+ FLOAT flReflectionsDelay; // [0.0, 0.3] default: 0.007 s
+ LONG lReverb; // [-10000, 2000] default: 200 mB
+ FLOAT flReverbDelay; // [0.0, 0.1] default: 0.011 s
+ FLOAT flDiffusion; // [0.0, 100.0] default: 100.0 %
+ FLOAT flDensity; // [0.0, 100.0] default: 100.0 %
+ FLOAT flHFReference; // [20.0, 20000.0] default: 5000.0 Hz
+} DSFXI3DL2Reverb, *LPDSFXI3DL2Reverb;
+
+typedef const DSFXI3DL2Reverb *LPCDSFXI3DL2Reverb;
+
+#define DSFX_I3DL2REVERB_ROOM_MIN (-10000)
+#define DSFX_I3DL2REVERB_ROOM_MAX 0
+#define DSFX_I3DL2REVERB_ROOM_DEFAULT (-1000)
+
+#define DSFX_I3DL2REVERB_ROOMHF_MIN (-10000)
+#define DSFX_I3DL2REVERB_ROOMHF_MAX 0
+#define DSFX_I3DL2REVERB_ROOMHF_DEFAULT (-100)
+
+#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MIN 0.0f
+#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_MAX 10.0f
+#define DSFX_I3DL2REVERB_ROOMROLLOFFFACTOR_DEFAULT 0.0f
+
+#define DSFX_I3DL2REVERB_DECAYTIME_MIN 0.1f
+#define DSFX_I3DL2REVERB_DECAYTIME_MAX 20.0f
+#define DSFX_I3DL2REVERB_DECAYTIME_DEFAULT 1.49f
+
+#define DSFX_I3DL2REVERB_DECAYHFRATIO_MIN 0.1f
+#define DSFX_I3DL2REVERB_DECAYHFRATIO_MAX 2.0f
+#define DSFX_I3DL2REVERB_DECAYHFRATIO_DEFAULT 0.83f
+
+#define DSFX_I3DL2REVERB_REFLECTIONS_MIN (-10000)
+#define DSFX_I3DL2REVERB_REFLECTIONS_MAX 1000
+#define DSFX_I3DL2REVERB_REFLECTIONS_DEFAULT (-2602)
+
+#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MIN 0.0f
+#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_MAX 0.3f
+#define DSFX_I3DL2REVERB_REFLECTIONSDELAY_DEFAULT 0.007f
+
+#define DSFX_I3DL2REVERB_REVERB_MIN (-10000)
+#define DSFX_I3DL2REVERB_REVERB_MAX 2000
+#define DSFX_I3DL2REVERB_REVERB_DEFAULT (200)
+
+#define DSFX_I3DL2REVERB_REVERBDELAY_MIN 0.0f
+#define DSFX_I3DL2REVERB_REVERBDELAY_MAX 0.1f
+#define DSFX_I3DL2REVERB_REVERBDELAY_DEFAULT 0.011f
+
+#define DSFX_I3DL2REVERB_DIFFUSION_MIN 0.0f
+#define DSFX_I3DL2REVERB_DIFFUSION_MAX 100.0f
+#define DSFX_I3DL2REVERB_DIFFUSION_DEFAULT 100.0f
+
+#define DSFX_I3DL2REVERB_DENSITY_MIN 0.0f
+#define DSFX_I3DL2REVERB_DENSITY_MAX 100.0f
+#define DSFX_I3DL2REVERB_DENSITY_DEFAULT 100.0f
+
+#define DSFX_I3DL2REVERB_HFREFERENCE_MIN 20.0f
+#define DSFX_I3DL2REVERB_HFREFERENCE_MAX 20000.0f
+#define DSFX_I3DL2REVERB_HFREFERENCE_DEFAULT 5000.0f
+
+#define DSFX_I3DL2REVERB_QUALITY_MIN 0
+#define DSFX_I3DL2REVERB_QUALITY_MAX 3
+#define DSFX_I3DL2REVERB_QUALITY_DEFAULT 2
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundFXI3DL2Reverb
+
+DECLARE_INTERFACE_(IDirectSoundFXI3DL2Reverb, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundFXI3DL2Reverb methods
+ STDMETHOD(SetAllParameters) (THIS_ LPCDSFXI3DL2Reverb pcDsFxI3DL2Reverb) PURE;
+ STDMETHOD(GetAllParameters) (THIS_ LPDSFXI3DL2Reverb pDsFxI3DL2Reverb) PURE;
+ STDMETHOD(SetPreset) (THIS_ DWORD dwPreset) PURE;
+ STDMETHOD(GetPreset) (THIS_ LPDWORD pdwPreset) PURE;
+ STDMETHOD(SetQuality) (THIS_ LONG lQuality) PURE;
+ STDMETHOD(GetQuality) (THIS_ LONG *plQuality) PURE;
+};
+
+#define IDirectSoundFXI3DL2Reverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundFXI3DL2Reverb_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundFXI3DL2Reverb_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
+#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->lpVtbl->SetPreset(p,a)
+#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->lpVtbl->GetPreset(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXI3DL2Reverb_SetAllParameters(p,a) (p)->SetAllParameters(a)
+#define IDirectSoundFXI3DL2Reverb_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#define IDirectSoundFXI3DL2Reverb_SetPreset(p,a) (p)->SetPreset(a)
+#define IDirectSoundFXI3DL2Reverb_GetPreset(p,a) (p)->GetPreset(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundFXWavesReverb
+//
+
+DEFINE_GUID(IID_IDirectSoundFXWavesReverb,0x46858c3a,0x0dc6,0x45e3,0xb7,0x60,0xd4,0xee,0xf1,0x6c,0xb3,0x25);
+
+typedef struct _DSFXWavesReverb
+{
+ FLOAT fInGain; // [-96.0,0.0] default: 0.0 dB
+ FLOAT fReverbMix; // [-96.0,0.0] default: 0.0 db
+ FLOAT fReverbTime; // [0.001,3000.0] default: 1000.0 ms
+ FLOAT fHighFreqRTRatio; // [0.001,0.999] default: 0.001
+} DSFXWavesReverb, *LPDSFXWavesReverb;
+
+typedef const DSFXWavesReverb *LPCDSFXWavesReverb;
+
+#define DSFX_WAVESREVERB_INGAIN_MIN -96.0f
+#define DSFX_WAVESREVERB_INGAIN_MAX 0.0f
+#define DSFX_WAVESREVERB_INGAIN_DEFAULT 0.0f
+#define DSFX_WAVESREVERB_REVERBMIX_MIN -96.0f
+#define DSFX_WAVESREVERB_REVERBMIX_MAX 0.0f
+#define DSFX_WAVESREVERB_REVERBMIX_DEFAULT 0.0f
+#define DSFX_WAVESREVERB_REVERBTIME_MIN 0.001f
+#define DSFX_WAVESREVERB_REVERBTIME_MAX 3000.0f
+#define DSFX_WAVESREVERB_REVERBTIME_DEFAULT 1000.0f
+#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MIN 0.001f
+#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_MAX 0.999f
+#define DSFX_WAVESREVERB_HIGHFREQRTRATIO_DEFAULT 0.001f
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundFXWavesReverb
+
+DECLARE_INTERFACE_(IDirectSoundFXWavesReverb, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundFXWavesReverb methods
+ STDMETHOD(SetAllParameters) (THIS_ LPCDSFXWavesReverb pcDsFxWavesReverb) PURE;
+ STDMETHOD(GetAllParameters) (THIS_ LPDSFXWavesReverb pDsFxWavesReverb) PURE;
+};
+
+#define IDirectSoundFXWavesReverb_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundFXWavesReverb_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundFXWavesReverb_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
+#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFXWavesReverb_SetAllParameters(p,a) (p)->SetAllParameters(a)
+#define IDirectSoundFXWavesReverb_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+//
+// IDirectSoundCaptureFXAec
+//
+
+DEFINE_GUID(IID_IDirectSoundCaptureFXAec, 0xad74143d, 0x903d, 0x4ab7, 0x80, 0x66, 0x28, 0xd3, 0x63, 0x03, 0x6d, 0x65);
+
+typedef struct _DSCFXAec
+{
+ BOOL fEnable;
+ BOOL fNoiseFill;
+ DWORD dwMode;
+} DSCFXAec, *LPDSCFXAec;
+
+typedef const DSCFXAec *LPCDSCFXAec;
+
+// These match the AEC_MODE_* constants in the DDK's ksmedia.h file
+#define DSCFX_AEC_MODE_PASS_THROUGH 0x0
+#define DSCFX_AEC_MODE_HALF_DUPLEX 0x1
+#define DSCFX_AEC_MODE_FULL_DUPLEX 0x2
+
+// These match the AEC_STATUS_* constants in ksmedia.h
+#define DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED 0x0
+#define DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED 0x1
+#define DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED 0x2
+#define DSCFX_AEC_STATUS_CURRENTLY_CONVERGED 0x8
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundCaptureFXAec
+
+DECLARE_INTERFACE_(IDirectSoundCaptureFXAec, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundCaptureFXAec methods
+ STDMETHOD(SetAllParameters) (THIS_ LPCDSCFXAec pDscFxAec) PURE;
+ STDMETHOD(GetAllParameters) (THIS_ LPDSCFXAec pDscFxAec) PURE;
+ STDMETHOD(GetStatus) (THIS_ PDWORD pdwStatus) PURE;
+ STDMETHOD(Reset) (THIS) PURE;
+};
+
+#define IDirectSoundCaptureFXAec_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundCaptureFXAec_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundCaptureFXAec_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
+#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCaptureFXAec_SetAllParameters(p,a) (p)->SetAllParameters(a)
+#define IDirectSoundCaptureFXAec_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+
+//
+// IDirectSoundCaptureFXNoiseSuppress
+//
+
+DEFINE_GUID(IID_IDirectSoundCaptureFXNoiseSuppress, 0xed311e41, 0xfbae, 0x4175, 0x96, 0x25, 0xcd, 0x8, 0x54, 0xf6, 0x93, 0xca);
+
+typedef struct _DSCFXNoiseSuppress
+{
+ BOOL fEnable;
+} DSCFXNoiseSuppress, *LPDSCFXNoiseSuppress;
+
+typedef const DSCFXNoiseSuppress *LPCDSCFXNoiseSuppress;
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundCaptureFXNoiseSuppress
+
+DECLARE_INTERFACE_(IDirectSoundCaptureFXNoiseSuppress, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundCaptureFXNoiseSuppress methods
+ STDMETHOD(SetAllParameters) (THIS_ LPCDSCFXNoiseSuppress pcDscFxNoiseSuppress) PURE;
+ STDMETHOD(GetAllParameters) (THIS_ LPDSCFXNoiseSuppress pDscFxNoiseSuppress) PURE;
+ STDMETHOD(Reset) (THIS) PURE;
+};
+
+#define IDirectSoundCaptureFXNoiseSuppress_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundCaptureFXNoiseSuppress_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundCaptureFXNoiseSuppress_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->lpVtbl->SetAllParameters(p,a)
+#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundCaptureFXNoiseSuppress_SetAllParameters(p,a) (p)->SetAllParameters(a)
+#define IDirectSoundCaptureFXNoiseSuppress_GetAllParameters(p,a) (p)->GetAllParameters(a)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+
+//
+// IDirectSoundFullDuplex
+//
+
+#ifndef _IDirectSoundFullDuplex_
+#define _IDirectSoundFullDuplex_
+
+#ifdef __cplusplus
+// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
+struct IDirectSoundFullDuplex;
+#endif // __cplusplus
+
+typedef struct IDirectSoundFullDuplex *LPDIRECTSOUNDFULLDUPLEX;
+
+DEFINE_GUID(IID_IDirectSoundFullDuplex, 0xedcb4c7a, 0xdaab, 0x4216, 0xa4, 0x2e, 0x6c, 0x50, 0x59, 0x6d, 0xdc, 0x1d);
+
+#undef INTERFACE
+#define INTERFACE IDirectSoundFullDuplex
+
+DECLARE_INTERFACE_(IDirectSoundFullDuplex, IUnknown)
+{
+ // IUnknown methods
+ STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
+ STDMETHOD_(ULONG,AddRef) (THIS) PURE;
+ STDMETHOD_(ULONG,Release) (THIS) PURE;
+
+ // IDirectSoundFullDuplex methods
+ STDMETHOD(Initialize) (THIS_ LPCGUID pCaptureGuid, LPCGUID pRenderGuid, LPCDSCBUFFERDESC lpDscBufferDesc, LPCDSBUFFERDESC lpDsBufferDesc, HWND hWnd, DWORD dwLevel, LPLPDIRECTSOUNDCAPTUREBUFFER8 lplpDirectSoundCaptureBuffer8, LPLPDIRECTSOUNDBUFFER8 lplpDirectSoundBuffer8) PURE;
+};
+
+#define IDirectSoundFullDuplex_QueryInterface(p,a,b) IUnknown_QueryInterface(p,a,b)
+#define IDirectSoundFullDuplex_AddRef(p) IUnknown_AddRef(p)
+#define IDirectSoundFullDuplex_Release(p) IUnknown_Release(p)
+
+#if !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->lpVtbl->Initialize(p,a,b,c,d,e,f,g,h)
+#else // !defined(__cplusplus) || defined(CINTERFACE)
+#define IDirectSoundFullDuplex_Initialize(p,a,b,c,d,e,f,g,h) (p)->Initialize(a,b,c,d,e,f,g,h)
+#endif // !defined(__cplusplus) || defined(CINTERFACE)
+
+#endif // _IDirectSoundFullDuplex_
+
+#endif // DIRECTSOUND_VERSION >= 0x0800
+
+//
+// Return Codes
+//
+
+// The function completed successfully
+#define DS_OK S_OK
+
+// The call succeeded, but we had to substitute the 3D algorithm
+#define DS_NO_VIRTUALIZATION MAKE_HRESULT(0, _FACDS, 10)
+
+// The call failed because resources (such as a priority level)
+// were already being used by another caller
+#define DSERR_ALLOCATED MAKE_DSHRESULT(10)
+
+// The control (vol, pan, etc.) requested by the caller is not available
+#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
+
+// An invalid parameter was passed to the returning function
+#define DSERR_INVALIDPARAM E_INVALIDARG
+
+// This call is not valid for the current state of this object
+#define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
+
+// An undetermined error occurred inside the DirectSound subsystem
+#define DSERR_GENERIC E_FAIL
+
+// The caller does not have the priority level required for the function to
+// succeed
+#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
+
+// Not enough free memory is available to complete the operation
+#define DSERR_OUTOFMEMORY E_OUTOFMEMORY
+
+// The specified WAVE format is not supported
+#define DSERR_BADFORMAT MAKE_DSHRESULT(100)
+
+// The function called is not supported at this time
+#define DSERR_UNSUPPORTED E_NOTIMPL
+
+// No sound driver is available for use
+#define DSERR_NODRIVER MAKE_DSHRESULT(120)
+// This object is already initialized
+#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
+
+// This object does not support aggregation
+#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
+
+// The buffer memory has been lost, and must be restored
+#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
+
+// Another app has a higher priority level, preventing this call from
+// succeeding
+#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
+
+// This object has not been initialized
+#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
+
+// The requested COM interface is not available
+#define DSERR_NOINTERFACE E_NOINTERFACE
+
+// Access is denied
+#define DSERR_ACCESSDENIED E_ACCESSDENIED
+
+// Tried to create a DSBCAPS_CTRLFX buffer shorter than DSBSIZE_FX_MIN milliseconds
+#define DSERR_BUFFERTOOSMALL MAKE_DSHRESULT(180)
+
+// Attempt to use DirectSound 8 functionality on an older DirectSound object
+#define DSERR_DS8_REQUIRED MAKE_DSHRESULT(190)
+
+// A circular loop of send effects was detected
+#define DSERR_SENDLOOP MAKE_DSHRESULT(200)
+
+// The GUID specified in an audiopath file does not match a valid MIXIN buffer
+#define DSERR_BADSENDBUFFERGUID MAKE_DSHRESULT(210)
+
+// The object requested was not found (numerically equal to DMUS_E_NOT_FOUND)
+#define DSERR_OBJECTNOTFOUND MAKE_DSHRESULT(4449)
+
+// The effects requested could not be found on the system, or they were found
+// but in the wrong order, or in the wrong hardware/software locations.
+#define DSERR_FXUNAVAILABLE MAKE_DSHRESULT(220)
+
+//
+// Flags
+//
+
+#define DSCAPS_PRIMARYMONO 0x00000001
+#define DSCAPS_PRIMARYSTEREO 0x00000002
+#define DSCAPS_PRIMARY8BIT 0x00000004
+#define DSCAPS_PRIMARY16BIT 0x00000008
+#define DSCAPS_CONTINUOUSRATE 0x00000010
+#define DSCAPS_EMULDRIVER 0x00000020
+#define DSCAPS_CERTIFIED 0x00000040
+#define DSCAPS_SECONDARYMONO 0x00000100
+#define DSCAPS_SECONDARYSTEREO 0x00000200
+#define DSCAPS_SECONDARY8BIT 0x00000400
+#define DSCAPS_SECONDARY16BIT 0x00000800
+
+#define DSSCL_NORMAL 0x00000001
+#define DSSCL_PRIORITY 0x00000002
+#define DSSCL_EXCLUSIVE 0x00000003
+#define DSSCL_WRITEPRIMARY 0x00000004
+
+#define DSSPEAKER_DIRECTOUT 0x00000000
+#define DSSPEAKER_HEADPHONE 0x00000001
+#define DSSPEAKER_MONO 0x00000002
+#define DSSPEAKER_QUAD 0x00000003
+#define DSSPEAKER_STEREO 0x00000004
+#define DSSPEAKER_SURROUND 0x00000005
+#define DSSPEAKER_5POINT1 0x00000006 // obsolete 5.1 setting
+#define DSSPEAKER_7POINT1 0x00000007 // obsolete 7.1 setting
+#define DSSPEAKER_7POINT1_SURROUND 0x00000008 // correct 7.1 Home Theater setting
+#define DSSPEAKER_7POINT1_WIDE DSSPEAKER_7POINT1
+#if (DIRECTSOUND_VERSION >= 0x1000)
+ #define DSSPEAKER_5POINT1_SURROUND 0x00000009 // correct 5.1 setting
+ #define DSSPEAKER_5POINT1_BACK DSSPEAKER_5POINT1
+#endif
+
+#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees
+#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees
+#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees
+#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees
+
+#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
+#define DSSPEAKER_CONFIG(a) ((BYTE)(a))
+#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
+
+#define DSBCAPS_PRIMARYBUFFER 0x00000001
+#define DSBCAPS_STATIC 0x00000002
+#define DSBCAPS_LOCHARDWARE 0x00000004
+#define DSBCAPS_LOCSOFTWARE 0x00000008
+#define DSBCAPS_CTRL3D 0x00000010
+#define DSBCAPS_CTRLFREQUENCY 0x00000020
+#define DSBCAPS_CTRLPAN 0x00000040
+#define DSBCAPS_CTRLVOLUME 0x00000080
+#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100
+#define DSBCAPS_CTRLFX 0x00000200
+#define DSBCAPS_STICKYFOCUS 0x00004000
+#define DSBCAPS_GLOBALFOCUS 0x00008000
+#define DSBCAPS_GETCURRENTPOSITION2 0x00010000
+#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
+#define DSBCAPS_LOCDEFER 0x00040000
+#if (DIRECTSOUND_VERSION >= 0x1000)
+ // Force GetCurrentPosition() to return a buffer's true play position;
+ // unmodified by aids to enhance backward compatibility.
+ #define DSBCAPS_TRUEPLAYPOSITION 0x00080000
+#endif
+
+#define DSBPLAY_LOOPING 0x00000001
+#define DSBPLAY_LOCHARDWARE 0x00000002
+#define DSBPLAY_LOCSOFTWARE 0x00000004
+#define DSBPLAY_TERMINATEBY_TIME 0x00000008
+#define DSBPLAY_TERMINATEBY_DISTANCE 0x000000010
+#define DSBPLAY_TERMINATEBY_PRIORITY 0x000000020
+
+#define DSBSTATUS_PLAYING 0x00000001
+#define DSBSTATUS_BUFFERLOST 0x00000002
+#define DSBSTATUS_LOOPING 0x00000004
+#define DSBSTATUS_LOCHARDWARE 0x00000008
+#define DSBSTATUS_LOCSOFTWARE 0x00000010
+#define DSBSTATUS_TERMINATED 0x00000020
+
+#define DSBLOCK_FROMWRITECURSOR 0x00000001
+#define DSBLOCK_ENTIREBUFFER 0x00000002
+
+#define DSBFREQUENCY_ORIGINAL 0
+#define DSBFREQUENCY_MIN 100
+#if DIRECTSOUND_VERSION >= 0x0900
+#define DSBFREQUENCY_MAX 200000
+#else
+#define DSBFREQUENCY_MAX 100000
+#endif
+
+#define DSBPAN_LEFT -10000
+#define DSBPAN_CENTER 0
+#define DSBPAN_RIGHT 10000
+
+#define DSBVOLUME_MIN -10000
+#define DSBVOLUME_MAX 0
+
+#define DSBSIZE_MIN 4
+#define DSBSIZE_MAX 0x0FFFFFFF
+#define DSBSIZE_FX_MIN 150 // NOTE: Milliseconds, not bytes
+
+#define DSBNOTIFICATIONS_MAX 100000UL
+
+#define DS3DMODE_NORMAL 0x00000000
+#define DS3DMODE_HEADRELATIVE 0x00000001
+#define DS3DMODE_DISABLE 0x00000002
+
+#define DS3D_IMMEDIATE 0x00000000
+#define DS3D_DEFERRED 0x00000001
+
+#define DS3D_MINDISTANCEFACTOR FLT_MIN
+#define DS3D_MAXDISTANCEFACTOR FLT_MAX
+#define DS3D_DEFAULTDISTANCEFACTOR 1.0f
+
+#define DS3D_MINROLLOFFFACTOR 0.0f
+#define DS3D_MAXROLLOFFFACTOR 10.0f
+#define DS3D_DEFAULTROLLOFFFACTOR 1.0f
+
+#define DS3D_MINDOPPLERFACTOR 0.0f
+#define DS3D_MAXDOPPLERFACTOR 10.0f
+#define DS3D_DEFAULTDOPPLERFACTOR 1.0f
+
+#define DS3D_DEFAULTMINDISTANCE 1.0f
+#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f
+
+#define DS3D_MINCONEANGLE 0
+#define DS3D_MAXCONEANGLE 360
+#define DS3D_DEFAULTCONEANGLE 360
+
+#define DS3D_DEFAULTCONEOUTSIDEVOLUME DSBVOLUME_MAX
+
+// IDirectSoundCapture attributes
+
+#define DSCCAPS_EMULDRIVER DSCAPS_EMULDRIVER
+#define DSCCAPS_CERTIFIED DSCAPS_CERTIFIED
+#define DSCCAPS_MULTIPLECAPTURE 0x00000001
+
+// IDirectSoundCaptureBuffer attributes
+
+#define DSCBCAPS_WAVEMAPPED 0x80000000
+
+#if DIRECTSOUND_VERSION >= 0x0800
+#define DSCBCAPS_CTRLFX 0x00000200
+#endif
+
+
+#define DSCBLOCK_ENTIREBUFFER 0x00000001
+
+#define DSCBSTATUS_CAPTURING 0x00000001
+#define DSCBSTATUS_LOOPING 0x00000002
+
+#define DSCBSTART_LOOPING 0x00000001
+
+#define DSBPN_OFFSETSTOP 0xFFFFFFFF
+
+#define DS_CERTIFIED 0x00000000
+#define DS_UNCERTIFIED 0x00000001
+
+
+//
+// Flags for the I3DL2 effects
+//
+
+//
+// I3DL2 Material Presets
+//
+
+enum
+{
+ DSFX_I3DL2_MATERIAL_PRESET_SINGLEWINDOW,
+ DSFX_I3DL2_MATERIAL_PRESET_DOUBLEWINDOW,
+ DSFX_I3DL2_MATERIAL_PRESET_THINDOOR,
+ DSFX_I3DL2_MATERIAL_PRESET_THICKDOOR,
+ DSFX_I3DL2_MATERIAL_PRESET_WOODWALL,
+ DSFX_I3DL2_MATERIAL_PRESET_BRICKWALL,
+ DSFX_I3DL2_MATERIAL_PRESET_STONEWALL,
+ DSFX_I3DL2_MATERIAL_PRESET_CURTAIN
+};
+
+#define I3DL2_MATERIAL_PRESET_SINGLEWINDOW -2800,0.71f
+#define I3DL2_MATERIAL_PRESET_DOUBLEWINDOW -5000,0.40f
+#define I3DL2_MATERIAL_PRESET_THINDOOR -1800,0.66f
+#define I3DL2_MATERIAL_PRESET_THICKDOOR -4400,0.64f
+#define I3DL2_MATERIAL_PRESET_WOODWALL -4000,0.50f
+#define I3DL2_MATERIAL_PRESET_BRICKWALL -5000,0.60f
+#define I3DL2_MATERIAL_PRESET_STONEWALL -6000,0.68f
+#define I3DL2_MATERIAL_PRESET_CURTAIN -1200,0.15f
+
+enum
+{
+ DSFX_I3DL2_ENVIRONMENT_PRESET_DEFAULT,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_GENERIC,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_PADDEDCELL,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_ROOM,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_BATHROOM,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_LIVINGROOM,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_STONEROOM,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_AUDITORIUM,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_CONCERTHALL,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_CAVE,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_ARENA,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_HANGAR,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_HALLWAY,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_ALLEY,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_FOREST,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_CITY,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_MOUNTAINS,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_QUARRY,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_PLAIN,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_PARKINGLOT,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_SEWERPIPE,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_UNDERWATER,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_SMALLROOM,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEROOM,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_LARGEHALL,
+ DSFX_I3DL2_ENVIRONMENT_PRESET_PLATE
+};
+
+//
+// I3DL2 Reverberation Presets Values
+//
+
+#define I3DL2_ENVIRONMENT_PRESET_DEFAULT -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_GENERIC -1000, -100, 0.0f, 1.49f, 0.83f, -2602, 0.007f, 200, 0.011f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_PADDEDCELL -1000,-6000, 0.0f, 0.17f, 0.10f, -1204, 0.001f, 207, 0.002f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_ROOM -1000, -454, 0.0f, 0.40f, 0.83f, -1646, 0.002f, 53, 0.003f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_BATHROOM -1000,-1200, 0.0f, 1.49f, 0.54f, -370, 0.007f, 1030, 0.011f, 100.0f, 60.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_LIVINGROOM -1000,-6000, 0.0f, 0.50f, 0.10f, -1376, 0.003f, -1104, 0.004f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_STONEROOM -1000, -300, 0.0f, 2.31f, 0.64f, -711, 0.012f, 83, 0.017f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_AUDITORIUM -1000, -476, 0.0f, 4.32f, 0.59f, -789, 0.020f, -289, 0.030f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_CONCERTHALL -1000, -500, 0.0f, 3.92f, 0.70f, -1230, 0.020f, -2, 0.029f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_CAVE -1000, 0, 0.0f, 2.91f, 1.30f, -602, 0.015f, -302, 0.022f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_ARENA -1000, -698, 0.0f, 7.24f, 0.33f, -1166, 0.020f, 16, 0.030f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_HANGAR -1000,-1000, 0.0f,10.05f, 0.23f, -602, 0.020f, 198, 0.030f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_CARPETEDHALLWAY -1000,-4000, 0.0f, 0.30f, 0.10f, -1831, 0.002f, -1630, 0.030f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_HALLWAY -1000, -300, 0.0f, 1.49f, 0.59f, -1219, 0.007f, 441, 0.011f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_STONECORRIDOR -1000, -237, 0.0f, 2.70f, 0.79f, -1214, 0.013f, 395, 0.020f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_ALLEY -1000, -270, 0.0f, 1.49f, 0.86f, -1204, 0.007f, -4, 0.011f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_FOREST -1000,-3300, 0.0f, 1.49f, 0.54f, -2560, 0.162f, -613, 0.088f, 79.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_CITY -1000, -800, 0.0f, 1.49f, 0.67f, -2273, 0.007f, -2217, 0.011f, 50.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_MOUNTAINS -1000,-2500, 0.0f, 1.49f, 0.21f, -2780, 0.300f, -2014, 0.100f, 27.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_QUARRY -1000,-1000, 0.0f, 1.49f, 0.83f,-10000, 0.061f, 500, 0.025f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_PLAIN -1000,-2000, 0.0f, 1.49f, 0.50f, -2466, 0.179f, -2514, 0.100f, 21.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_PARKINGLOT -1000, 0, 0.0f, 1.65f, 1.50f, -1363, 0.008f, -1153, 0.012f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_SEWERPIPE -1000,-1000, 0.0f, 2.81f, 0.14f, 429, 0.014f, 648, 0.021f, 80.0f, 60.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_UNDERWATER -1000,-4000, 0.0f, 1.49f, 0.10f, -449, 0.007f, 1700, 0.011f, 100.0f, 100.0f, 5000.0f
+
+//
+// Examples simulating 'musical' reverb presets
+//
+// Name Decay time Description
+// Small Room 1.1s A small size room with a length of 5m or so.
+// Medium Room 1.3s A medium size room with a length of 10m or so.
+// Large Room 1.5s A large size room suitable for live performances.
+// Medium Hall 1.8s A medium size concert hall.
+// Large Hall 1.8s A large size concert hall suitable for a full orchestra.
+// Plate 1.3s A plate reverb simulation.
+//
+
+#define I3DL2_ENVIRONMENT_PRESET_SMALLROOM -1000, -600, 0.0f, 1.10f, 0.83f, -400, 0.005f, 500, 0.010f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_MEDIUMROOM -1000, -600, 0.0f, 1.30f, 0.83f, -1000, 0.010f, -200, 0.020f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_LARGEROOM -1000, -600, 0.0f, 1.50f, 0.83f, -1600, 0.020f, -1000, 0.040f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_MEDIUMHALL -1000, -600, 0.0f, 1.80f, 0.70f, -1300, 0.015f, -800, 0.030f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_LARGEHALL -1000, -600, 0.0f, 1.80f, 0.70f, -2000, 0.030f, -1400, 0.060f, 100.0f, 100.0f, 5000.0f
+#define I3DL2_ENVIRONMENT_PRESET_PLATE -1000, -200, 0.0f, 1.30f, 0.90f, 0, 0.002f, 0, 0.010f, 100.0f, 75.0f, 5000.0f
+
+//
+// DirectSound3D Algorithms
+//
+
+// Default DirectSound3D algorithm {00000000-0000-0000-0000-000000000000}
+#define DS3DALG_DEFAULT GUID_NULL
+
+// No virtualization (Pan3D) {C241333F-1C1B-11d2-94F5-00C04FC28ACA}
+DEFINE_GUID(DS3DALG_NO_VIRTUALIZATION, 0xc241333f, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
+
+// High-quality HRTF algorithm {C2413340-1C1B-11d2-94F5-00C04FC28ACA}
+DEFINE_GUID(DS3DALG_HRTF_FULL, 0xc2413340, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
+
+// Lower-quality HRTF algorithm {C2413342-1C1B-11d2-94F5-00C04FC28ACA}
+DEFINE_GUID(DS3DALG_HRTF_LIGHT, 0xc2413342, 0x1c1b, 0x11d2, 0x94, 0xf5, 0x0, 0xc0, 0x4f, 0xc2, 0x8a, 0xca);
+
+
+#if DIRECTSOUND_VERSION >= 0x0800
+
+//
+// DirectSound Internal Effect Algorithms
+//
+
+
+// Gargle {DAFD8210-5711-4B91-9FE3-F75B7AE279BF}
+DEFINE_GUID(GUID_DSFX_STANDARD_GARGLE, 0xdafd8210, 0x5711, 0x4b91, 0x9f, 0xe3, 0xf7, 0x5b, 0x7a, 0xe2, 0x79, 0xbf);
+
+// Chorus {EFE6629C-81F7-4281-BD91-C9D604A95AF6}
+DEFINE_GUID(GUID_DSFX_STANDARD_CHORUS, 0xefe6629c, 0x81f7, 0x4281, 0xbd, 0x91, 0xc9, 0xd6, 0x04, 0xa9, 0x5a, 0xf6);
+
+// Flanger {EFCA3D92-DFD8-4672-A603-7420894BAD98}
+DEFINE_GUID(GUID_DSFX_STANDARD_FLANGER, 0xefca3d92, 0xdfd8, 0x4672, 0xa6, 0x03, 0x74, 0x20, 0x89, 0x4b, 0xad, 0x98);
+
+// Echo/Delay {EF3E932C-D40B-4F51-8CCF-3F98F1B29D5D}
+DEFINE_GUID(GUID_DSFX_STANDARD_ECHO, 0xef3e932c, 0xd40b, 0x4f51, 0x8c, 0xcf, 0x3f, 0x98, 0xf1, 0xb2, 0x9d, 0x5d);
+
+// Distortion {EF114C90-CD1D-484E-96E5-09CFAF912A21}
+DEFINE_GUID(GUID_DSFX_STANDARD_DISTORTION, 0xef114c90, 0xcd1d, 0x484e, 0x96, 0xe5, 0x09, 0xcf, 0xaf, 0x91, 0x2a, 0x21);
+
+// Compressor/Limiter {EF011F79-4000-406D-87AF-BFFB3FC39D57}
+DEFINE_GUID(GUID_DSFX_STANDARD_COMPRESSOR, 0xef011f79, 0x4000, 0x406d, 0x87, 0xaf, 0xbf, 0xfb, 0x3f, 0xc3, 0x9d, 0x57);
+
+// Parametric Equalization {120CED89-3BF4-4173-A132-3CB406CF3231}
+DEFINE_GUID(GUID_DSFX_STANDARD_PARAMEQ, 0x120ced89, 0x3bf4, 0x4173, 0xa1, 0x32, 0x3c, 0xb4, 0x06, 0xcf, 0x32, 0x31);
+
+// I3DL2 Environmental Reverberation: Reverb (Listener) Effect {EF985E71-D5C7-42D4-BA4D-2D073E2E96F4}
+DEFINE_GUID(GUID_DSFX_STANDARD_I3DL2REVERB, 0xef985e71, 0xd5c7, 0x42d4, 0xba, 0x4d, 0x2d, 0x07, 0x3e, 0x2e, 0x96, 0xf4);
+
+// Waves Reverberation {87FC0268-9A55-4360-95AA-004A1D9DE26C}
+DEFINE_GUID(GUID_DSFX_WAVES_REVERB, 0x87fc0268, 0x9a55, 0x4360, 0x95, 0xaa, 0x00, 0x4a, 0x1d, 0x9d, 0xe2, 0x6c);
+
+//
+// DirectSound Capture Effect Algorithms
+//
+
+
+// Acoustic Echo Canceller {BF963D80-C559-11D0-8A2B-00A0C9255AC1}
+// Matches KSNODETYPE_ACOUSTIC_ECHO_CANCEL in ksmedia.h
+DEFINE_GUID(GUID_DSCFX_CLASS_AEC, 0xBF963D80L, 0xC559, 0x11D0, 0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1);
+
+// Microsoft AEC {CDEBB919-379A-488a-8765-F53CFD36DE40}
+DEFINE_GUID(GUID_DSCFX_MS_AEC, 0xcdebb919, 0x379a, 0x488a, 0x87, 0x65, 0xf5, 0x3c, 0xfd, 0x36, 0xde, 0x40);
+
+// System AEC {1C22C56D-9879-4f5b-A389-27996DDC2810}
+DEFINE_GUID(GUID_DSCFX_SYSTEM_AEC, 0x1c22c56d, 0x9879, 0x4f5b, 0xa3, 0x89, 0x27, 0x99, 0x6d, 0xdc, 0x28, 0x10);
+
+// Noise Supression {E07F903F-62FD-4e60-8CDD-DEA7236665B5}
+// Matches KSNODETYPE_NOISE_SUPPRESS in post Windows ME DDK's ksmedia.h
+DEFINE_GUID(GUID_DSCFX_CLASS_NS, 0xe07f903f, 0x62fd, 0x4e60, 0x8c, 0xdd, 0xde, 0xa7, 0x23, 0x66, 0x65, 0xb5);
+
+// Microsoft Noise Suppresion {11C5C73B-66E9-4ba1-A0BA-E814C6EED92D}
+DEFINE_GUID(GUID_DSCFX_MS_NS, 0x11c5c73b, 0x66e9, 0x4ba1, 0xa0, 0xba, 0xe8, 0x14, 0xc6, 0xee, 0xd9, 0x2d);
+
+// System Noise Suppresion {5AB0882E-7274-4516-877D-4EEE99BA4FD0}
+DEFINE_GUID(GUID_DSCFX_SYSTEM_NS, 0x5ab0882e, 0x7274, 0x4516, 0x87, 0x7d, 0x4e, 0xee, 0x99, 0xba, 0x4f, 0xd0);
+
+#endif // DIRECTSOUND_VERSION >= 0x0800
+
+#endif // __DSOUND_INCLUDED__
+
+
+
+#ifdef __cplusplus
+};
+#endif // __cplusplus
+
diff --git a/src/deps/rtaudio-mod/include/ginclude.h b/src/deps/rtaudio-mod/include/ginclude.h
new file mode 100644
index 0000000..b627dc2
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/ginclude.h
@@ -0,0 +1,38 @@
+#ifndef __gInclude__
+#define __gInclude__
+
+#if SGI
+ #undef BEOS
+ #undef MAC
+ #undef WINDOWS
+ //
+ #define ASIO_BIG_ENDIAN 1
+ #define ASIO_CPU_MIPS 1
+#elif defined WIN32
+ #undef BEOS
+ #undef MAC
+ #undef SGI
+ #define WINDOWS 1
+ #define ASIO_LITTLE_ENDIAN 1
+ #define ASIO_CPU_X86 1
+#elif BEOS
+ #undef MAC
+ #undef SGI
+ #undef WINDOWS
+ #define ASIO_LITTLE_ENDIAN 1
+ #define ASIO_CPU_X86 1
+ //
+#else
+ #define MAC 1
+ #undef BEOS
+ #undef WINDOWS
+ #undef SGI
+ #define ASIO_BIG_ENDIAN 1
+ #define ASIO_CPU_PPC 1
+#endif
+
+// always
+#define NATIVE_INT64 0
+#define IEEE754_64FLOAT 1
+
+#endif // __gInclude__
diff --git a/src/deps/rtaudio-mod/include/iasiodrv.h b/src/deps/rtaudio-mod/include/iasiodrv.h
new file mode 100644
index 0000000..64d2dbb
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/iasiodrv.h
@@ -0,0 +1,37 @@
+#include "asiosys.h"
+#include "asio.h"
+
+/* Forward Declarations */
+
+#ifndef __ASIODRIVER_FWD_DEFINED__
+#define __ASIODRIVER_FWD_DEFINED__
+typedef interface IASIO IASIO;
+#endif /* __ASIODRIVER_FWD_DEFINED__ */
+
+interface IASIO : public IUnknown
+{
+
+ virtual ASIOBool init(void *sysHandle) = 0;
+ virtual void getDriverName(char *name) = 0;
+ virtual long getDriverVersion() = 0;
+ virtual void getErrorMessage(char *string) = 0;
+ virtual ASIOError start() = 0;
+ virtual ASIOError stop() = 0;
+ virtual ASIOError getChannels(long *numInputChannels, long *numOutputChannels) = 0;
+ virtual ASIOError getLatencies(long *inputLatency, long *outputLatency) = 0;
+ virtual ASIOError getBufferSize(long *minSize, long *maxSize,
+ long *preferredSize, long *granularity) = 0;
+ virtual ASIOError canSampleRate(ASIOSampleRate sampleRate) = 0;
+ virtual ASIOError getSampleRate(ASIOSampleRate *sampleRate) = 0;
+ virtual ASIOError setSampleRate(ASIOSampleRate sampleRate) = 0;
+ virtual ASIOError getClockSources(ASIOClockSource *clocks, long *numSources) = 0;
+ virtual ASIOError setClockSource(long reference) = 0;
+ virtual ASIOError getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp) = 0;
+ virtual ASIOError getChannelInfo(ASIOChannelInfo *info) = 0;
+ virtual ASIOError createBuffers(ASIOBufferInfo *bufferInfos, long numChannels,
+ long bufferSize, ASIOCallbacks *callbacks) = 0;
+ virtual ASIOError disposeBuffers() = 0;
+ virtual ASIOError controlPanel() = 0;
+ virtual ASIOError future(long selector,void *opt) = 0;
+ virtual ASIOError outputReady() = 0;
+};
diff --git a/src/deps/rtaudio-mod/include/iasiothiscallresolver.cpp b/src/deps/rtaudio-mod/include/iasiothiscallresolver.cpp
new file mode 100644
index 0000000..08c55ea
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/iasiothiscallresolver.cpp
@@ -0,0 +1,572 @@
+/*
+ IASIOThiscallResolver.cpp see the comments in iasiothiscallresolver.h for
+ the top level description - this comment describes the technical details of
+ the implementation.
+
+ The latest version of this file is available from:
+ http://www.audiomulch.com/~rossb/code/calliasio
+
+ please email comments to Ross Bencina <rossb@audiomulch.com>
+
+ BACKGROUND
+
+ The IASIO interface declared in the Steinberg ASIO 2 SDK declares
+ functions with no explicit calling convention. This causes MSVC++ to default
+ to using the thiscall convention, which is a proprietary convention not
+ implemented by some non-microsoft compilers - notably borland BCC,
+ C++Builder, and gcc. MSVC++ is the defacto standard compiler used by
+ Steinberg. As a result of this situation, the ASIO sdk will compile with
+ any compiler, however attempting to execute the compiled code will cause a
+ crash due to different default calling conventions on non-Microsoft
+ compilers.
+
+ IASIOThiscallResolver solves the problem by providing an adapter class that
+ delegates to the IASIO interface using the correct calling convention
+ (thiscall). Due to the lack of support for thiscall in the Borland and GCC
+ compilers, the calls have been implemented in assembly language.
+
+ A number of macros are defined for thiscall function calls with different
+ numbers of parameters, with and without return values - it may be possible
+ to modify the format of these macros to make them work with other inline
+ assemblers.
+
+
+ THISCALL DEFINITION
+
+ A number of definitions of the thiscall calling convention are floating
+ around the internet. The following definition has been validated against
+ output from the MSVC++ compiler:
+
+ For non-vararg functions, thiscall works as follows: the object (this)
+ pointer is passed in ECX. All arguments are passed on the stack in
+ right to left order. The return value is placed in EAX. The callee
+ clears the passed arguments from the stack.
+
+
+ FINDING FUNCTION POINTERS FROM AN IASIO POINTER
+
+ The first field of a COM object is a pointer to its vtble. Thus a pointer
+ to an object implementing the IASIO interface also points to a pointer to
+ that object's vtbl. The vtble is a table of function pointers for all of
+ the virtual functions exposed by the implemented interfaces.
+
+ If we consider a variable declared as a pointer to IASO:
+
+ IASIO *theAsioDriver
+
+ theAsioDriver points to:
+
+ object implementing IASIO
+ {
+ IASIOvtbl *vtbl
+ other data
+ }
+
+ in other words, theAsioDriver points to a pointer to an IASIOvtbl
+
+ vtbl points to a table of function pointers:
+
+ IASIOvtbl ( interface IASIO : public IUnknown )
+ {
+ (IUnknown functions)
+ 0 virtual HRESULT STDMETHODCALLTYPE (*QueryInterface)(REFIID riid, void **ppv) = 0;
+ 4 virtual ULONG STDMETHODCALLTYPE (*AddRef)() = 0;
+ 8 virtual ULONG STDMETHODCALLTYPE (*Release)() = 0;
+
+ (IASIO functions)
+ 12 virtual ASIOBool (*init)(void *sysHandle) = 0;
+ 16 virtual void (*getDriverName)(char *name) = 0;
+ 20 virtual long (*getDriverVersion)() = 0;
+ 24 virtual void (*getErrorMessage)(char *string) = 0;
+ 28 virtual ASIOError (*start)() = 0;
+ 32 virtual ASIOError (*stop)() = 0;
+ 36 virtual ASIOError (*getChannels)(long *numInputChannels, long *numOutputChannels) = 0;
+ 40 virtual ASIOError (*getLatencies)(long *inputLatency, long *outputLatency) = 0;
+ 44 virtual ASIOError (*getBufferSize)(long *minSize, long *maxSize,
+ long *preferredSize, long *granularity) = 0;
+ 48 virtual ASIOError (*canSampleRate)(ASIOSampleRate sampleRate) = 0;
+ 52 virtual ASIOError (*getSampleRate)(ASIOSampleRate *sampleRate) = 0;
+ 56 virtual ASIOError (*setSampleRate)(ASIOSampleRate sampleRate) = 0;
+ 60 virtual ASIOError (*getClockSources)(ASIOClockSource *clocks, long *numSources) = 0;
+ 64 virtual ASIOError (*setClockSource)(long reference) = 0;
+ 68 virtual ASIOError (*getSamplePosition)(ASIOSamples *sPos, ASIOTimeStamp *tStamp) = 0;
+ 72 virtual ASIOError (*getChannelInfo)(ASIOChannelInfo *info) = 0;
+ 76 virtual ASIOError (*createBuffers)(ASIOBufferInfo *bufferInfos, long numChannels,
+ long bufferSize, ASIOCallbacks *callbacks) = 0;
+ 80 virtual ASIOError (*disposeBuffers)() = 0;
+ 84 virtual ASIOError (*controlPanel)() = 0;
+ 88 virtual ASIOError (*future)(long selector,void *opt) = 0;
+ 92 virtual ASIOError (*outputReady)() = 0;
+ };
+
+ The numbers in the left column show the byte offset of each function ptr
+ from the beginning of the vtbl. These numbers are used in the code below
+ to select different functions.
+
+ In order to find the address of a particular function, theAsioDriver
+ must first be dereferenced to find the value of the vtbl pointer:
+
+ mov eax, theAsioDriver
+ mov edx, [theAsioDriver] // edx now points to vtbl[0]
+
+ Then an offset must be added to the vtbl pointer to select a
+ particular function, for example vtbl+44 points to the slot containing
+ a pointer to the getBufferSize function.
+
+ Finally vtbl+x must be dereferenced to obtain the value of the function
+ pointer stored in that address:
+
+ call [edx+44] // call the function pointed to by
+ // the value in the getBufferSize field of the vtbl
+
+
+ SEE ALSO
+
+ Martin Fay's OpenASIO DLL at http://www.martinfay.com solves the same
+ problem by providing a new COM interface which wraps IASIO with an
+ interface that uses portable calling conventions. OpenASIO must be compiled
+ with MSVC, and requires that you ship the OpenASIO DLL with your
+ application.
+
+
+ ACKNOWLEDGEMENTS
+
+ Ross Bencina: worked out the thiscall details above, wrote the original
+ Borland asm macros, and a patch for asio.cpp (which is no longer needed).
+ Thanks to Martin Fay for introducing me to the issues discussed here,
+ and to Rene G. Ceballos for assisting with asm dumps from MSVC++.
+
+ Antti Silvast: converted the original calliasio to work with gcc and NASM
+ by implementing the asm code in a separate file.
+
+ Fraser Adams: modified the original calliasio containing the Borland inline
+ asm to add inline asm for gcc i.e. Intel syntax for Borland and AT&T syntax
+ for gcc. This seems a neater approach for gcc than to have a separate .asm
+ file and it means that we only need one version of the thiscall patch.
+
+ Fraser Adams: rewrote the original calliasio patch in the form of the
+ IASIOThiscallResolver class in order to avoid modifications to files from
+ the Steinberg SDK, which may have had potential licence issues.
+
+ Andrew Baldwin: contributed fixes for compatibility problems with more
+ recent versions of the gcc assembler.
+*/
+
+
+// We only need IASIOThiscallResolver at all if we are on Win32. For other
+// platforms we simply bypass the IASIOThiscallResolver definition to allow us
+// to be safely #include'd whatever the platform to keep client code portable
+#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) && !defined(_WIN64)
+
+
+// If microsoft compiler we can call IASIO directly so IASIOThiscallResolver
+// is not used.
+#if !defined(_MSC_VER)
+
+
+#include <new>
+#include <assert.h>
+
+// We have a mechanism in iasiothiscallresolver.h to ensure that asio.h is
+// #include'd before it in client code, we do NOT want to do this test here.
+#define iasiothiscallresolver_sourcefile 1
+#include "iasiothiscallresolver.h"
+#undef iasiothiscallresolver_sourcefile
+
+// iasiothiscallresolver.h redefines ASIOInit for clients, but we don't want
+// this macro defined in this translation unit.
+#undef ASIOInit
+
+
+// theAsioDriver is a global pointer to the current IASIO instance which the
+// ASIO SDK uses to perform all actions on the IASIO interface. We substitute
+// our own forwarding interface into this pointer.
+extern IASIO* theAsioDriver;
+
+
+// The following macros define the inline assembler for BORLAND first then gcc
+
+#if defined(__BCPLUSPLUS__) || defined(__BORLANDC__)
+
+
+#define CALL_THISCALL_0( resultName, thisPtr, funcOffset )\
+ void *this_ = (thisPtr); \
+ __asm { \
+ mov ecx, this_ ; \
+ mov eax, [ecx] ; \
+ call [eax+funcOffset] ; \
+ mov resultName, eax ; \
+ }
+
+
+#define CALL_VOID_THISCALL_1( thisPtr, funcOffset, param1 )\
+ void *this_ = (thisPtr); \
+ __asm { \
+ mov eax, param1 ; \
+ push eax ; \
+ mov ecx, this_ ; \
+ mov eax, [ecx] ; \
+ call [eax+funcOffset] ; \
+ }
+
+
+#define CALL_THISCALL_1( resultName, thisPtr, funcOffset, param1 )\
+ void *this_ = (thisPtr); \
+ __asm { \
+ mov eax, param1 ; \
+ push eax ; \
+ mov ecx, this_ ; \
+ mov eax, [ecx] ; \
+ call [eax+funcOffset] ; \
+ mov resultName, eax ; \
+ }
+
+
+#define CALL_THISCALL_1_DOUBLE( resultName, thisPtr, funcOffset, param1 )\
+ void *this_ = (thisPtr); \
+ void *doubleParamPtr_ (&param1); \
+ __asm { \
+ mov eax, doubleParamPtr_ ; \
+ push [eax+4] ; \
+ push [eax] ; \
+ mov ecx, this_ ; \
+ mov eax, [ecx] ; \
+ call [eax+funcOffset] ; \
+ mov resultName, eax ; \
+ }
+
+
+#define CALL_THISCALL_2( resultName, thisPtr, funcOffset, param1, param2 )\
+ void *this_ = (thisPtr); \
+ __asm { \
+ mov eax, param2 ; \
+ push eax ; \
+ mov eax, param1 ; \
+ push eax ; \
+ mov ecx, this_ ; \
+ mov eax, [ecx] ; \
+ call [eax+funcOffset] ; \
+ mov resultName, eax ; \
+ }
+
+
+#define CALL_THISCALL_4( resultName, thisPtr, funcOffset, param1, param2, param3, param4 )\
+ void *this_ = (thisPtr); \
+ __asm { \
+ mov eax, param4 ; \
+ push eax ; \
+ mov eax, param3 ; \
+ push eax ; \
+ mov eax, param2 ; \
+ push eax ; \
+ mov eax, param1 ; \
+ push eax ; \
+ mov ecx, this_ ; \
+ mov eax, [ecx] ; \
+ call [eax+funcOffset] ; \
+ mov resultName, eax ; \
+ }
+
+
+#elif defined(__GNUC__)
+
+
+#define CALL_THISCALL_0( resultName, thisPtr, funcOffset ) \
+ __asm__ __volatile__ ("movl (%1), %%edx\n\t" \
+ "call *"#funcOffset"(%%edx)\n\t" \
+ :"=a"(resultName) /* Output Operands */ \
+ :"c"(thisPtr) /* Input Operands */ \
+ : "%edx" /* Clobbered Registers */ \
+ ); \
+
+
+#define CALL_VOID_THISCALL_1( thisPtr, funcOffset, param1 ) \
+ __asm__ __volatile__ ("pushl %0\n\t" \
+ "movl (%1), %%edx\n\t" \
+ "call *"#funcOffset"(%%edx)\n\t" \
+ : /* Output Operands */ \
+ :"r"(param1), /* Input Operands */ \
+ "c"(thisPtr) \
+ : "%edx" /* Clobbered Registers */ \
+ ); \
+
+
+#define CALL_THISCALL_1( resultName, thisPtr, funcOffset, param1 ) \
+ __asm__ __volatile__ ("pushl %1\n\t" \
+ "movl (%2), %%edx\n\t" \
+ "call *"#funcOffset"(%%edx)\n\t" \
+ :"=a"(resultName) /* Output Operands */ \
+ :"r"(param1), /* Input Operands */ \
+ "c"(thisPtr) \
+ : "%edx" /* Clobbered Registers */ \
+ ); \
+
+
+#define CALL_THISCALL_1_DOUBLE( resultName, thisPtr, funcOffset, param1 ) \
+ do { \
+ double param1f64 = param1; /* Cast explicitly to double */ \
+ double *param1f64Ptr = &param1f64; /* Make pointer to address */ \
+ __asm__ __volatile__ ("pushl 4(%1)\n\t" \
+ "pushl (%1)\n\t" \
+ "movl (%2), %%edx\n\t" \
+ "call *"#funcOffset"(%%edx);\n\t" \
+ : "=a"(resultName) /* Output Operands */ \
+ : "r"(param1f64Ptr), /* Input Operands */ \
+ "c"(thisPtr), \
+ "m"(*param1f64Ptr) /* Using address */ \
+ : "%edx" /* Clobbered Registers */ \
+ ); \
+ } while (0); \
+
+
+#define CALL_THISCALL_2( resultName, thisPtr, funcOffset, param1, param2 ) \
+ __asm__ __volatile__ ("pushl %1\n\t" \
+ "pushl %2\n\t" \
+ "movl (%3), %%edx\n\t" \
+ "call *"#funcOffset"(%%edx)\n\t" \
+ :"=a"(resultName) /* Output Operands */ \
+ :"r"(param2), /* Input Operands */ \
+ "r"(param1), \
+ "c"(thisPtr) \
+ : "%edx" /* Clobbered Registers */ \
+ ); \
+
+
+#define CALL_THISCALL_4( resultName, thisPtr, funcOffset, param1, param2, param3, param4 )\
+ __asm__ __volatile__ ("pushl %1\n\t" \
+ "pushl %2\n\t" \
+ "pushl %3\n\t" \
+ "pushl %4\n\t" \
+ "movl (%5), %%edx\n\t" \
+ "call *"#funcOffset"(%%edx)\n\t" \
+ :"=a"(resultName) /* Output Operands */ \
+ :"r"(param4), /* Input Operands */ \
+ "r"(param3), \
+ "r"(param2), \
+ "r"(param1), \
+ "c"(thisPtr) \
+ : "%edx" /* Clobbered Registers */ \
+ ); \
+
+#endif
+
+
+
+// Our static singleton instance.
+IASIOThiscallResolver IASIOThiscallResolver::instance;
+
+// Constructor called to initialize static Singleton instance above. Note that
+// it is important not to clear that_ incase it has already been set by the call
+// to placement new in ASIOInit().
+IASIOThiscallResolver::IASIOThiscallResolver()
+{
+}
+
+// Constructor called from ASIOInit() below
+IASIOThiscallResolver::IASIOThiscallResolver(IASIO* that)
+: that_( that )
+{
+}
+
+// Implement IUnknown methods as assert(false). IASIOThiscallResolver is not
+// really a COM object, just a wrapper which will work with the ASIO SDK.
+// If you wanted to use ASIO without the SDK you might want to implement COM
+// aggregation in these methods.
+HRESULT STDMETHODCALLTYPE IASIOThiscallResolver::QueryInterface(REFIID riid, void **ppv)
+{
+ (void)riid; // suppress unused variable warning
+
+ assert( false ); // this function should never be called by the ASIO SDK.
+
+ *ppv = NULL;
+ return E_NOINTERFACE;
+}
+
+ULONG STDMETHODCALLTYPE IASIOThiscallResolver::AddRef()
+{
+ assert( false ); // this function should never be called by the ASIO SDK.
+
+ return 1;
+}
+
+ULONG STDMETHODCALLTYPE IASIOThiscallResolver::Release()
+{
+ assert( false ); // this function should never be called by the ASIO SDK.
+
+ return 1;
+}
+
+
+// Implement the IASIO interface methods by performing the vptr manipulation
+// described above then delegating to the real implementation.
+ASIOBool IASIOThiscallResolver::init(void *sysHandle)
+{
+ ASIOBool result;
+ CALL_THISCALL_1( result, that_, 12, sysHandle );
+ return result;
+}
+
+void IASIOThiscallResolver::getDriverName(char *name)
+{
+ CALL_VOID_THISCALL_1( that_, 16, name );
+}
+
+long IASIOThiscallResolver::getDriverVersion()
+{
+ ASIOBool result;
+ CALL_THISCALL_0( result, that_, 20 );
+ return result;
+}
+
+void IASIOThiscallResolver::getErrorMessage(char *string)
+{
+ CALL_VOID_THISCALL_1( that_, 24, string );
+}
+
+ASIOError IASIOThiscallResolver::start()
+{
+ ASIOBool result;
+ CALL_THISCALL_0( result, that_, 28 );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::stop()
+{
+ ASIOBool result;
+ CALL_THISCALL_0( result, that_, 32 );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::getChannels(long *numInputChannels, long *numOutputChannels)
+{
+ ASIOBool result;
+ CALL_THISCALL_2( result, that_, 36, numInputChannels, numOutputChannels );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::getLatencies(long *inputLatency, long *outputLatency)
+{
+ ASIOBool result;
+ CALL_THISCALL_2( result, that_, 40, inputLatency, outputLatency );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::getBufferSize(long *minSize, long *maxSize,
+ long *preferredSize, long *granularity)
+{
+ ASIOBool result;
+ CALL_THISCALL_4( result, that_, 44, minSize, maxSize, preferredSize, granularity );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::canSampleRate(ASIOSampleRate sampleRate)
+{
+ ASIOBool result;
+ CALL_THISCALL_1_DOUBLE( result, that_, 48, sampleRate );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::getSampleRate(ASIOSampleRate *sampleRate)
+{
+ ASIOBool result;
+ CALL_THISCALL_1( result, that_, 52, sampleRate );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::setSampleRate(ASIOSampleRate sampleRate)
+{
+ ASIOBool result;
+ CALL_THISCALL_1_DOUBLE( result, that_, 56, sampleRate );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::getClockSources(ASIOClockSource *clocks, long *numSources)
+{
+ ASIOBool result;
+ CALL_THISCALL_2( result, that_, 60, clocks, numSources );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::setClockSource(long reference)
+{
+ ASIOBool result;
+ CALL_THISCALL_1( result, that_, 64, reference );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp)
+{
+ ASIOBool result;
+ CALL_THISCALL_2( result, that_, 68, sPos, tStamp );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::getChannelInfo(ASIOChannelInfo *info)
+{
+ ASIOBool result;
+ CALL_THISCALL_1( result, that_, 72, info );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::createBuffers(ASIOBufferInfo *bufferInfos,
+ long numChannels, long bufferSize, ASIOCallbacks *callbacks)
+{
+ ASIOBool result;
+ CALL_THISCALL_4( result, that_, 76, bufferInfos, numChannels, bufferSize, callbacks );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::disposeBuffers()
+{
+ ASIOBool result;
+ CALL_THISCALL_0( result, that_, 80 );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::controlPanel()
+{
+ ASIOBool result;
+ CALL_THISCALL_0( result, that_, 84 );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::future(long selector,void *opt)
+{
+ ASIOBool result;
+ CALL_THISCALL_2( result, that_, 88, selector, opt );
+ return result;
+}
+
+ASIOError IASIOThiscallResolver::outputReady()
+{
+ ASIOBool result;
+ CALL_THISCALL_0( result, that_, 92 );
+ return result;
+}
+
+
+// Implement our substitute ASIOInit() method
+ASIOError IASIOThiscallResolver::ASIOInit(ASIODriverInfo *info)
+{
+ // To ensure that our instance's vptr is correctly constructed, even if
+ // ASIOInit is called prior to main(), we explicitly call its constructor
+ // (potentially over the top of an existing instance). Note that this is
+ // pretty ugly, and is only safe because IASIOThiscallResolver has no
+ // destructor and contains no objects with destructors.
+ new((void*)&instance) IASIOThiscallResolver( theAsioDriver );
+
+ // Interpose between ASIO client code and the real driver.
+ theAsioDriver = &instance;
+
+ // Note that we never need to switch theAsioDriver back to point to the
+ // real driver because theAsioDriver is reset to zero in ASIOExit().
+
+ // Delegate to the real ASIOInit
+ return ::ASIOInit(info);
+}
+
+
+#endif /* !defined(_MSC_VER) */
+
+#endif /* Win32 */
+
diff --git a/src/deps/rtaudio-mod/include/iasiothiscallresolver.h b/src/deps/rtaudio-mod/include/iasiothiscallresolver.h
new file mode 100644
index 0000000..63e91ca
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/iasiothiscallresolver.h
@@ -0,0 +1,202 @@
+// ****************************************************************************
+//
+// Changed: I have modified this file slightly (includes) to work with
+// RtAudio. RtAudio.cpp must include this file after asio.h.
+//
+// File: IASIOThiscallResolver.h
+// Description: The IASIOThiscallResolver class implements the IASIO
+// interface and acts as a proxy to the real IASIO interface by
+// calling through its vptr table using the thiscall calling
+// convention. To put it another way, we interpose
+// IASIOThiscallResolver between ASIO SDK code and the driver.
+// This is necessary because most non-Microsoft compilers don't
+// implement the thiscall calling convention used by IASIO.
+//
+// iasiothiscallresolver.cpp contains the background of this
+// problem plus a technical description of the vptr
+// manipulations.
+//
+// In order to use this mechanism one simply has to add
+// iasiothiscallresolver.cpp to the list of files to compile
+// and #include <iasiothiscallresolver.h>
+//
+// Note that this #include must come after the other ASIO SDK
+// #includes, for example:
+//
+// #include <windows.h>
+// #include <asiosys.h>
+// #include <asio.h>
+// #include <asiodrivers.h>
+// #include <iasiothiscallresolver.h>
+//
+// Actually the important thing is to #include
+// <iasiothiscallresolver.h> after <asio.h>. We have
+// incorporated a test to enforce this ordering.
+//
+// The code transparently takes care of the interposition by
+// using macro substitution to intercept calls to ASIOInit()
+// and ASIOExit(). We save the original ASIO global
+// "theAsioDriver" in our "that" variable, and then set
+// "theAsioDriver" to equal our IASIOThiscallResolver instance.
+//
+// Whilst this method of resolving the thiscall problem requires
+// the addition of #include <iasiothiscallresolver.h> to client
+// code it has the advantage that it does not break the terms
+// of the ASIO licence by publishing it. We are NOT modifying
+// any Steinberg code here, we are merely implementing the IASIO
+// interface in the same way that we would need to do if we
+// wished to provide an open source ASIO driver.
+//
+// For compilation with MinGW -lole32 needs to be added to the
+// linker options. For BORLAND, linking with Import32.lib is
+// sufficient.
+//
+// The dependencies are with: CoInitialize, CoUninitialize,
+// CoCreateInstance, CLSIDFromString - used by asiolist.cpp
+// and are required on Windows whether ThiscallResolver is used
+// or not.
+//
+// Searching for the above strings in the root library path
+// of your compiler should enable the correct libraries to be
+// identified if they aren't immediately obvious.
+//
+// Note that the current implementation of IASIOThiscallResolver
+// is not COM compliant - it does not correctly implement the
+// IUnknown interface. Implementing it is not necessary because
+// it is not called by parts of the ASIO SDK which call through
+// theAsioDriver ptr. The IUnknown methods are implemented as
+// assert(false) to ensure that the code fails if they are
+// ever called.
+// Restrictions: None. Public Domain & Open Source distribute freely
+// You may use IASIOThiscallResolver commercially as well as
+// privately.
+// You the user assume the responsibility for the use of the
+// files, binary or text, and there is no guarantee or warranty,
+// expressed or implied, including but not limited to the
+// implied warranties of merchantability and fitness for a
+// particular purpose. You assume all responsibility and agree
+// to hold no entity, copyright holder or distributors liable
+// for any loss of data or inaccurate representations of data
+// as a result of using IASIOThiscallResolver.
+// Version: 1.4 Added separate macro CALL_THISCALL_1_DOUBLE from
+// Andrew Baldwin, and volatile for whole gcc asm blocks,
+// both for compatibility with newer gcc versions. Cleaned up
+// Borland asm to use one less register.
+// 1.3 Switched to including assert.h for better compatibility.
+// Wrapped entire .h and .cpp contents with a check for
+// _MSC_VER to provide better compatibility with MS compilers.
+// Changed Singleton implementation to use static instance
+// instead of freestore allocated instance. Removed ASIOExit
+// macro as it is no longer needed.
+// 1.2 Removed semicolons from ASIOInit and ASIOExit macros to
+// allow them to be embedded in expressions (if statements).
+// Cleaned up some comments. Removed combase.c dependency (it
+// doesn't compile with BCB anyway) by stubbing IUnknown.
+// 1.1 Incorporated comments from Ross Bencina including things
+// such as changing name from ThiscallResolver to
+// IASIOThiscallResolver, tidying up the constructor, fixing
+// a bug in IASIOThiscallResolver::ASIOExit() and improving
+// portability through the use of conditional compilation
+// 1.0 Initial working version.
+// Created: 6/09/2003
+// Authors: Fraser Adams
+// Ross Bencina
+// Rene G. Ceballos
+// Martin Fay
+// Antti Silvast
+// Andrew Baldwin
+//
+// ****************************************************************************
+
+
+#ifndef included_iasiothiscallresolver_h
+#define included_iasiothiscallresolver_h
+
+// We only need IASIOThiscallResolver at all if we are on Win32. For other
+// platforms we simply bypass the IASIOThiscallResolver definition to allow us
+// to be safely #include'd whatever the platform to keep client code portable
+//#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
+#if (defined(WIN32) || defined(_WIN32) || defined(__WIN32__)) && !defined(_WIN64)
+
+
+// If microsoft compiler we can call IASIO directly so IASIOThiscallResolver
+// is not used.
+#if !defined(_MSC_VER)
+
+
+// The following is in order to ensure that this header is only included after
+// the other ASIO headers (except for the case of iasiothiscallresolver.cpp).
+// We need to do this because IASIOThiscallResolver works by eclipsing the
+// original definition of ASIOInit() with a macro (see below).
+#if !defined(iasiothiscallresolver_sourcefile)
+ #if !defined(__ASIO_H)
+ #error iasiothiscallresolver.h must be included AFTER asio.h
+ #endif
+#endif
+
+#include <windows.h>
+#include "iasiodrv.h" /* From ASIO SDK */
+
+
+class IASIOThiscallResolver : public IASIO {
+private:
+ IASIO* that_; // Points to the real IASIO
+
+ static IASIOThiscallResolver instance; // Singleton instance
+
+ // Constructors - declared private so construction is limited to
+ // our Singleton instance
+ IASIOThiscallResolver();
+ IASIOThiscallResolver(IASIO* that);
+public:
+
+ // Methods from the IUnknown interface. We don't fully implement IUnknown
+ // because the ASIO SDK never calls these methods through theAsioDriver ptr.
+ // These methods are implemented as assert(false).
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void **ppv);
+ virtual ULONG STDMETHODCALLTYPE AddRef();
+ virtual ULONG STDMETHODCALLTYPE Release();
+
+ // Methods from the IASIO interface, implemented as forwarning calls to that.
+ virtual ASIOBool init(void *sysHandle);
+ virtual void getDriverName(char *name);
+ virtual long getDriverVersion();
+ virtual void getErrorMessage(char *string);
+ virtual ASIOError start();
+ virtual ASIOError stop();
+ virtual ASIOError getChannels(long *numInputChannels, long *numOutputChannels);
+ virtual ASIOError getLatencies(long *inputLatency, long *outputLatency);
+ virtual ASIOError getBufferSize(long *minSize, long *maxSize, long *preferredSize, long *granularity);
+ virtual ASIOError canSampleRate(ASIOSampleRate sampleRate);
+ virtual ASIOError getSampleRate(ASIOSampleRate *sampleRate);
+ virtual ASIOError setSampleRate(ASIOSampleRate sampleRate);
+ virtual ASIOError getClockSources(ASIOClockSource *clocks, long *numSources);
+ virtual ASIOError setClockSource(long reference);
+ virtual ASIOError getSamplePosition(ASIOSamples *sPos, ASIOTimeStamp *tStamp);
+ virtual ASIOError getChannelInfo(ASIOChannelInfo *info);
+ virtual ASIOError createBuffers(ASIOBufferInfo *bufferInfos, long numChannels, long bufferSize, ASIOCallbacks *callbacks);
+ virtual ASIOError disposeBuffers();
+ virtual ASIOError controlPanel();
+ virtual ASIOError future(long selector,void *opt);
+ virtual ASIOError outputReady();
+
+ // Class method, see ASIOInit() macro below.
+ static ASIOError ASIOInit(ASIODriverInfo *info); // Delegates to ::ASIOInit
+};
+
+
+// Replace calls to ASIOInit with our interposing version.
+// This macro enables us to perform thiscall resolution simply by #including
+// <iasiothiscallresolver.h> after the asio #includes (this file _must_ be
+// included _after_ the asio #includes)
+
+#define ASIOInit(name) IASIOThiscallResolver::ASIOInit((name))
+
+
+#endif /* !defined(_MSC_VER) */
+
+#endif /* Win32 */
+
+#endif /* included_iasiothiscallresolver_h */
+
+
diff --git a/src/deps/rtaudio-mod/include/soundcard.h b/src/deps/rtaudio-mod/include/soundcard.h
new file mode 100644
index 0000000..2cf3a2c
--- /dev/null
+++ b/src/deps/rtaudio-mod/include/soundcard.h
@@ -0,0 +1,1878 @@
+/*
+ * soundcard.h
+ */
+
+/*-
+ * Copyright by Hannu Savolainen 1993 / 4Front Technologies 1993-2006
+ * Modified for the new FreeBSD sound driver by Luigi Rizzo, 1997
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
+ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
+ * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD: src/sys/sys/soundcard.h,v 1.48 2006/11/26 11:55:48 netchild Exp $
+ */
+
+/*
+ * Unless coordinating changes with 4Front Technologies, do NOT make any
+ * modifications to ioctl commands, types, etc. that would break
+ * compatibility with the OSS API.
+ */
+
+#ifndef _SYS_SOUNDCARD_H_
+#define _SYS_SOUNDCARD_H_
+ /*
+ * If you make modifications to this file, please contact me before
+ * distributing the modified version. There is already enough
+ * diversity in the world.
+ *
+ * Regards,
+ * Hannu Savolainen
+ * hannu@voxware.pp.fi
+ *
+ **********************************************************************
+ * PS. The Hacker's Guide to VoxWare available from
+ * nic.funet.fi:pub/Linux/ALPHA/sound. The file is
+ * snd-sdk-doc-0.1.ps.gz (gzipped postscript). It contains
+ * some useful information about programming with VoxWare.
+ * (NOTE! The pub/Linux/ALPHA/ directories are hidden. You have
+ * to cd inside them before the files are accessible.)
+ **********************************************************************
+ */
+
+/*
+ * SOUND_VERSION is only used by the voxware driver. Hopefully apps
+ * should not depend on it, but rather look at the capabilities
+ * of the driver in the kernel!
+ */
+#define SOUND_VERSION 301
+#define VOXWARE /* does this have any use ? */
+
+/*
+ * Supported card ID numbers (Should be somewhere else? We keep
+ * them here just for compativility with the old driver, but these
+ * constants are of little or no use).
+ */
+
+#define SNDCARD_ADLIB 1
+#define SNDCARD_SB 2
+#define SNDCARD_PAS 3
+#define SNDCARD_GUS 4
+#define SNDCARD_MPU401 5
+#define SNDCARD_SB16 6
+#define SNDCARD_SB16MIDI 7
+#define SNDCARD_UART6850 8
+#define SNDCARD_GUS16 9
+#define SNDCARD_MSS 10
+#define SNDCARD_PSS 11
+#define SNDCARD_SSCAPE 12
+#define SNDCARD_PSS_MPU 13
+#define SNDCARD_PSS_MSS 14
+#define SNDCARD_SSCAPE_MSS 15
+#define SNDCARD_TRXPRO 16
+#define SNDCARD_TRXPRO_SB 17
+#define SNDCARD_TRXPRO_MPU 18
+#define SNDCARD_MAD16 19
+#define SNDCARD_MAD16_MPU 20
+#define SNDCARD_CS4232 21
+#define SNDCARD_CS4232_MPU 22
+#define SNDCARD_MAUI 23
+#define SNDCARD_PSEUDO_MSS 24
+#define SNDCARD_AWE32 25
+#define SNDCARD_NSS 26
+#define SNDCARD_UART16550 27
+#define SNDCARD_OPL 28
+
+#include <sys/types.h>
+#include <machine/endian.h>
+#ifndef _IOWR
+#include <sys/ioccom.h>
+#endif /* !_IOWR */
+
+/*
+ * The first part of this file contains the new FreeBSD sound ioctl
+ * interface. Tries to minimize the number of different ioctls, and
+ * to be reasonably general.
+ *
+ * 970821: some of the new calls have not been implemented yet.
+ */
+
+/*
+ * the following three calls extend the generic file descriptor
+ * interface. AIONWRITE is the dual of FIONREAD, i.e. returns the max
+ * number of bytes for a write operation to be non-blocking.
+ *
+ * AIOGSIZE/AIOSSIZE are used to change the behaviour of the device,
+ * from a character device (default) to a block device. In block mode,
+ * (not to be confused with blocking mode) the main difference for the
+ * application is that select() will return only when a complete
+ * block can be read/written to the device, whereas in character mode
+ * select will return true when one byte can be exchanged. For audio
+ * devices, character mode makes select almost useless since one byte
+ * will always be ready by the next sample time (which is often only a
+ * handful of microseconds away).
+ * Use a size of 0 or 1 to return to character mode.
+ */
+#define AIONWRITE _IOR('A', 10, int) /* get # bytes to write */
+struct snd_size {
+ int play_size;
+ int rec_size;
+};
+#define AIOGSIZE _IOR('A', 11, struct snd_size)/* read current blocksize */
+#define AIOSSIZE _IOWR('A', 11, struct snd_size) /* sets blocksize */
+
+/*
+ * The following constants define supported audio formats. The
+ * encoding follows voxware conventions, i.e. 1 bit for each supported
+ * format. We extend it by using bit 31 (RO) to indicate full-duplex
+ * capability, and bit 29 (RO) to indicate that the card supports/
+ * needs different formats on capture & playback channels.
+ * Bit 29 (RW) is used to indicate/ask stereo.
+ *
+ * The number of bits required to store the sample is:
+ * o 4 bits for the IDA ADPCM format,
+ * o 8 bits for 8-bit formats, mu-law and A-law,
+ * o 16 bits for the 16-bit formats, and
+ * o 32 bits for the 24/32-bit formats.
+ * o undefined for the MPEG audio format.
+ */
+
+#define AFMT_QUERY 0x00000000 /* Return current format */
+#define AFMT_MU_LAW 0x00000001 /* Logarithmic mu-law */
+#define AFMT_A_LAW 0x00000002 /* Logarithmic A-law */
+#define AFMT_IMA_ADPCM 0x00000004 /* A 4:1 compressed format where 16-bit
+ * squence represented using the
+ * the average 4 bits per sample */
+#define AFMT_U8 0x00000008 /* Unsigned 8-bit */
+#define AFMT_S16_LE 0x00000010 /* Little endian signed 16-bit */
+#define AFMT_S16_BE 0x00000020 /* Big endian signed 16-bit */
+#define AFMT_S8 0x00000040 /* Signed 8-bit */
+#define AFMT_U16_LE 0x00000080 /* Little endian unsigned 16-bit */
+#define AFMT_U16_BE 0x00000100 /* Big endian unsigned 16-bit */
+#define AFMT_MPEG 0x00000200 /* MPEG MP2/MP3 audio */
+#define AFMT_AC3 0x00000400 /* Dolby Digital AC3 */
+
+#if _BYTE_ORDER == _LITTLE_ENDIAN
+#define AFMT_S16_NE AFMT_S16_LE /* native endian signed 16 */
+#else
+#define AFMT_S16_NE AFMT_S16_BE
+#endif
+
+/*
+ * 32-bit formats below used for 24-bit audio data where the data is stored
+ * in the 24 most significant bits and the least significant bits are not used
+ * (should be set to 0).
+ */
+#define AFMT_S32_LE 0x00001000 /* Little endian signed 32-bit */
+#define AFMT_S32_BE 0x00002000 /* Big endian signed 32-bit */
+#define AFMT_U32_LE 0x00004000 /* Little endian unsigned 32-bit */
+#define AFMT_U32_BE 0x00008000 /* Big endian unsigned 32-bit */
+#define AFMT_S24_LE 0x00010000 /* Little endian signed 24-bit */
+#define AFMT_S24_BE 0x00020000 /* Big endian signed 24-bit */
+#define AFMT_U24_LE 0x00040000 /* Little endian unsigned 24-bit */
+#define AFMT_U24_BE 0x00080000 /* Big endian unsigned 24-bit */
+
+#define AFMT_STEREO 0x10000000 /* can do/want stereo */
+
+/*
+ * the following are really capabilities
+ */
+#define AFMT_WEIRD 0x20000000 /* weird hardware... */
+ /*
+ * AFMT_WEIRD reports that the hardware might need to operate
+ * with different formats in the playback and capture
+ * channels when operating in full duplex.
+ * As an example, SoundBlaster16 cards only support U8 in one
+ * direction and S16 in the other one, and applications should
+ * be aware of this limitation.
+ */
+#define AFMT_FULLDUPLEX 0x80000000 /* can do full duplex */
+
+/*
+ * The following structure is used to get/set format and sampling rate.
+ * While it would be better to have things such as stereo, bits per
+ * sample, endiannes, etc split in different variables, it turns out
+ * that formats are not that many, and not all combinations are possible.
+ * So we followed the Voxware approach of associating one bit to each
+ * format.
+ */
+
+typedef struct _snd_chan_param {
+ u_long play_rate; /* sampling rate */
+ u_long rec_rate; /* sampling rate */
+ u_long play_format; /* everything describing the format */
+ u_long rec_format; /* everything describing the format */
+} snd_chan_param;
+#define AIOGFMT _IOR('f', 12, snd_chan_param) /* get format */
+#define AIOSFMT _IOWR('f', 12, snd_chan_param) /* sets format */
+
+/*
+ * The following structure is used to get/set the mixer setting.
+ * Up to 32 mixers are supported, each one with up to 32 channels.
+ */
+typedef struct _snd_mix_param {
+ u_char subdev; /* which output */
+ u_char line; /* which input */
+ u_char left,right; /* volumes, 0..255, 0 = mute */
+} snd_mix_param ;
+
+/* XXX AIOGMIX, AIOSMIX not implemented yet */
+#define AIOGMIX _IOWR('A', 13, snd_mix_param) /* return mixer status */
+#define AIOSMIX _IOWR('A', 14, snd_mix_param) /* sets mixer status */
+
+/*
+ * channel specifiers used in AIOSTOP and AIOSYNC
+ */
+#define AIOSYNC_PLAY 0x1 /* play chan */
+#define AIOSYNC_CAPTURE 0x2 /* capture chan */
+/* AIOSTOP stop & flush a channel, returns the residual count */
+#define AIOSTOP _IOWR ('A', 15, int)
+
+/* alternate method used to notify the sync condition */
+#define AIOSYNC_SIGNAL 0x100
+#define AIOSYNC_SELECT 0x200
+
+/* what the 'pos' field refers to */
+#define AIOSYNC_READY 0x400
+#define AIOSYNC_FREE 0x800
+
+typedef struct _snd_sync_parm {
+ long chan ; /* play or capture channel, plus modifier */
+ long pos;
+} snd_sync_parm;
+#define AIOSYNC _IOWR ('A', 15, snd_sync_parm) /* misc. synchronization */
+
+/*
+ * The following is used to return device capabilities. If the structure
+ * passed to the ioctl is zeroed, default values are returned for rate
+ * and formats, a bitmap of available mixers is returned, and values
+ * (inputs, different levels) for the first one are returned.
+ *
+ * If formats, mixers, inputs are instantiated, then detailed info
+ * are returned depending on the call.
+ */
+typedef struct _snd_capabilities {
+ u_long rate_min, rate_max; /* min-max sampling rate */
+ u_long formats;
+ u_long bufsize; /* DMA buffer size */
+ u_long mixers; /* bitmap of available mixers */
+ u_long inputs; /* bitmap of available inputs (per mixer) */
+ u_short left, right; /* how many levels are supported */
+} snd_capabilities;
+#define AIOGCAP _IOWR('A', 15, snd_capabilities) /* get capabilities */
+
+/*
+ * here is the old (Voxware) ioctl interface
+ */
+
+/*
+ * IOCTL Commands for /dev/sequencer
+ */
+
+#define SNDCTL_SEQ_RESET _IO ('Q', 0)
+#define SNDCTL_SEQ_SYNC _IO ('Q', 1)
+#define SNDCTL_SYNTH_INFO _IOWR('Q', 2, struct synth_info)
+#define SNDCTL_SEQ_CTRLRATE _IOWR('Q', 3, int) /* Set/get timer res.(hz) */
+#define SNDCTL_SEQ_GETOUTCOUNT _IOR ('Q', 4, int)
+#define SNDCTL_SEQ_GETINCOUNT _IOR ('Q', 5, int)
+#define SNDCTL_SEQ_PERCMODE _IOW ('Q', 6, int)
+#define SNDCTL_FM_LOAD_INSTR _IOW ('Q', 7, struct sbi_instrument) /* Valid for FM only */
+#define SNDCTL_SEQ_TESTMIDI _IOW ('Q', 8, int)
+#define SNDCTL_SEQ_RESETSAMPLES _IOW ('Q', 9, int)
+#define SNDCTL_SEQ_NRSYNTHS _IOR ('Q',10, int)
+#define SNDCTL_SEQ_NRMIDIS _IOR ('Q',11, int)
+#define SNDCTL_MIDI_INFO _IOWR('Q',12, struct midi_info)
+#define SNDCTL_SEQ_THRESHOLD _IOW ('Q',13, int)
+#define SNDCTL_SEQ_TRESHOLD SNDCTL_SEQ_THRESHOLD /* there was once a typo */
+#define SNDCTL_SYNTH_MEMAVL _IOWR('Q',14, int) /* in=dev#, out=memsize */
+#define SNDCTL_FM_4OP_ENABLE _IOW ('Q',15, int) /* in=dev# */
+#define SNDCTL_PMGR_ACCESS _IOWR('Q',16, struct patmgr_info)
+#define SNDCTL_SEQ_PANIC _IO ('Q',17)
+#define SNDCTL_SEQ_OUTOFBAND _IOW ('Q',18, struct seq_event_rec)
+#define SNDCTL_SEQ_GETTIME _IOR ('Q',19, int)
+
+struct seq_event_rec {
+ u_char arr[8];
+};
+
+#define SNDCTL_TMR_TIMEBASE _IOWR('T', 1, int)
+#define SNDCTL_TMR_START _IO ('T', 2)
+#define SNDCTL_TMR_STOP _IO ('T', 3)
+#define SNDCTL_TMR_CONTINUE _IO ('T', 4)
+#define SNDCTL_TMR_TEMPO _IOWR('T', 5, int)
+#define SNDCTL_TMR_SOURCE _IOWR('T', 6, int)
+# define TMR_INTERNAL 0x00000001
+# define TMR_EXTERNAL 0x00000002
+# define TMR_MODE_MIDI 0x00000010
+# define TMR_MODE_FSK 0x00000020
+# define TMR_MODE_CLS 0x00000040
+# define TMR_MODE_SMPTE 0x00000080
+#define SNDCTL_TMR_METRONOME _IOW ('T', 7, int)
+#define SNDCTL_TMR_SELECT _IOW ('T', 8, int)
+
+/*
+ * Endian aware patch key generation algorithm.
+ */
+
+#if defined(_AIX) || defined(AIX)
+# define _PATCHKEY(id) (0xfd00|id)
+#else
+# define _PATCHKEY(id) ((id<<8)|0xfd)
+#endif
+
+/*
+ * Sample loading mechanism for internal synthesizers (/dev/sequencer)
+ * The following patch_info structure has been designed to support
+ * Gravis UltraSound. It tries to be universal format for uploading
+ * sample based patches but is probably too limited.
+ */
+
+struct patch_info {
+/* u_short key; Use GUS_PATCH here */
+ short key; /* Use GUS_PATCH here */
+#define GUS_PATCH _PATCHKEY(0x04)
+#define OBSOLETE_GUS_PATCH _PATCHKEY(0x02)
+
+ short device_no; /* Synthesizer number */
+ short instr_no; /* Midi pgm# */
+
+ u_long mode;
+/*
+ * The least significant byte has the same format than the GUS .PAT
+ * files
+ */
+#define WAVE_16_BITS 0x01 /* bit 0 = 8 or 16 bit wave data. */
+#define WAVE_UNSIGNED 0x02 /* bit 1 = Signed - Unsigned data. */
+#define WAVE_LOOPING 0x04 /* bit 2 = looping enabled-1. */
+#define WAVE_BIDIR_LOOP 0x08 /* bit 3 = Set is bidirectional looping. */
+#define WAVE_LOOP_BACK 0x10 /* bit 4 = Set is looping backward. */
+#define WAVE_SUSTAIN_ON 0x20 /* bit 5 = Turn sustaining on. (Env. pts. 3)*/
+#define WAVE_ENVELOPES 0x40 /* bit 6 = Enable envelopes - 1 */
+ /* (use the env_rate/env_offs fields). */
+/* Linux specific bits */
+#define WAVE_VIBRATO 0x00010000 /* The vibrato info is valid */
+#define WAVE_TREMOLO 0x00020000 /* The tremolo info is valid */
+#define WAVE_SCALE 0x00040000 /* The scaling info is valid */
+/* Other bits must be zeroed */
+
+ long len; /* Size of the wave data in bytes */
+ long loop_start, loop_end; /* Byte offsets from the beginning */
+
+/*
+ * The base_freq and base_note fields are used when computing the
+ * playback speed for a note. The base_note defines the tone frequency
+ * which is heard if the sample is played using the base_freq as the
+ * playback speed.
+ *
+ * The low_note and high_note fields define the minimum and maximum note
+ * frequencies for which this sample is valid. It is possible to define
+ * more than one samples for an instrument number at the same time. The
+ * low_note and high_note fields are used to select the most suitable one.
+ *
+ * The fields base_note, high_note and low_note should contain
+ * the note frequency multiplied by 1000. For example value for the
+ * middle A is 440*1000.
+ */
+
+ u_int base_freq;
+ u_long base_note;
+ u_long high_note;
+ u_long low_note;
+ int panning; /* -128=left, 127=right */
+ int detuning;
+
+/* New fields introduced in version 1.99.5 */
+
+ /* Envelope. Enabled by mode bit WAVE_ENVELOPES */
+ u_char env_rate[ 6 ]; /* GUS HW ramping rate */
+ u_char env_offset[ 6 ]; /* 255 == 100% */
+
+ /*
+ * The tremolo, vibrato and scale info are not supported yet.
+ * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
+ * WAVE_SCALE
+ */
+
+ u_char tremolo_sweep;
+ u_char tremolo_rate;
+ u_char tremolo_depth;
+
+ u_char vibrato_sweep;
+ u_char vibrato_rate;
+ u_char vibrato_depth;
+
+ int scale_frequency;
+ u_int scale_factor; /* from 0 to 2048 or 0 to 2 */
+
+ int volume;
+ int spare[4];
+ char data[1]; /* The waveform data starts here */
+};
+
+struct sysex_info {
+ short key; /* Use GUS_PATCH here */
+#define SYSEX_PATCH _PATCHKEY(0x05)
+#define MAUI_PATCH _PATCHKEY(0x06)
+ short device_no; /* Synthesizer number */
+ long len; /* Size of the sysex data in bytes */
+ u_char data[1]; /* Sysex data starts here */
+};
+
+/*
+ * Patch management interface (/dev/sequencer, /dev/patmgr#)
+ * Don't use these calls if you want to maintain compatibility with
+ * the future versions of the driver.
+ */
+
+#define PS_NO_PATCHES 0 /* No patch support on device */
+#define PS_MGR_NOT_OK 1 /* Plain patch support (no mgr) */
+#define PS_MGR_OK 2 /* Patch manager supported */
+#define PS_MANAGED 3 /* Patch manager running */
+
+#define SNDCTL_PMGR_IFACE _IOWR('P', 1, struct patmgr_info)
+
+/*
+ * The patmgr_info is a fixed size structure which is used for two
+ * different purposes. The intended use is for communication between
+ * the application using /dev/sequencer and the patch manager daemon
+ * associated with a synthesizer device (ioctl(SNDCTL_PMGR_ACCESS)).
+ *
+ * This structure is also used with ioctl(SNDCTL_PGMR_IFACE) which allows
+ * a patch manager daemon to read and write device parameters. This
+ * ioctl available through /dev/sequencer also. Avoid using it since it's
+ * extremely hardware dependent. In addition access trough /dev/sequencer
+ * may confuse the patch manager daemon.
+ */
+
+struct patmgr_info { /* Note! size must be < 4k since kmalloc() is used */
+ u_long key; /* Don't worry. Reserved for communication
+ between the patch manager and the driver. */
+#define PM_K_EVENT 1 /* Event from the /dev/sequencer driver */
+#define PM_K_COMMAND 2 /* Request from an application */
+#define PM_K_RESPONSE 3 /* From patmgr to application */
+#define PM_ERROR 4 /* Error returned by the patmgr */
+ int device;
+ int command;
+
+/*
+ * Commands 0x000 to 0xfff reserved for patch manager programs
+ */
+#define PM_GET_DEVTYPE 1 /* Returns type of the patch mgr interface of dev */
+#define PMTYPE_FM2 1 /* 2 OP fm */
+#define PMTYPE_FM4 2 /* Mixed 4 or 2 op FM (OPL-3) */
+#define PMTYPE_WAVE 3 /* Wave table synthesizer (GUS) */
+#define PM_GET_NRPGM 2 /* Returns max # of midi programs in parm1 */
+#define PM_GET_PGMMAP 3 /* Returns map of loaded midi programs in data8 */
+#define PM_GET_PGM_PATCHES 4 /* Return list of patches of a program (parm1) */
+#define PM_GET_PATCH 5 /* Return patch header of patch parm1 */
+#define PM_SET_PATCH 6 /* Set patch header of patch parm1 */
+#define PM_READ_PATCH 7 /* Read patch (wave) data */
+#define PM_WRITE_PATCH 8 /* Write patch (wave) data */
+
+/*
+ * Commands 0x1000 to 0xffff are for communication between the patch manager
+ * and the client
+ */
+#define _PM_LOAD_PATCH 0x100
+
+/*
+ * Commands above 0xffff reserved for device specific use
+ */
+
+ long parm1;
+ long parm2;
+ long parm3;
+
+ union {
+ u_char data8[4000];
+ u_short data16[2000];
+ u_long data32[1000];
+ struct patch_info patch;
+ } data;
+};
+
+/*
+ * When a patch manager daemon is present, it will be informed by the
+ * driver when something important happens. For example when the
+ * /dev/sequencer is opened or closed. A record with key == PM_K_EVENT is
+ * returned. The command field contains the event type:
+ */
+#define PM_E_OPENED 1 /* /dev/sequencer opened */
+#define PM_E_CLOSED 2 /* /dev/sequencer closed */
+#define PM_E_PATCH_RESET 3 /* SNDCTL_RESETSAMPLES called */
+#define PM_E_PATCH_LOADED 4 /* A patch has been loaded by appl */
+
+/*
+ * /dev/sequencer input events.
+ *
+ * The data written to the /dev/sequencer is a stream of events. Events
+ * are records of 4 or 8 bytes. The first byte defines the size.
+ * Any number of events can be written with a write call. There
+ * is a set of macros for sending these events. Use these macros if you
+ * want to maximize portability of your program.
+ *
+ * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
+ * (All input events are currently 4 bytes long. Be prepared to support
+ * 8 byte events also. If you receive any event having first byte >= 128,
+ * it's a 8 byte event.
+ *
+ * The events are documented at the end of this file.
+ *
+ * Normal events (4 bytes)
+ * There is also a 8 byte version of most of the 4 byte events. The
+ * 8 byte one is recommended.
+ */
+#define SEQ_NOTEOFF 0
+#define SEQ_FMNOTEOFF SEQ_NOTEOFF /* Just old name */
+#define SEQ_NOTEON 1
+#define SEQ_FMNOTEON SEQ_NOTEON
+#define SEQ_WAIT TMR_WAIT_ABS
+#define SEQ_PGMCHANGE 3
+#define SEQ_FMPGMCHANGE SEQ_PGMCHANGE
+#define SEQ_SYNCTIMER TMR_START
+#define SEQ_MIDIPUTC 5
+#define SEQ_DRUMON 6 /*** OBSOLETE ***/
+#define SEQ_DRUMOFF 7 /*** OBSOLETE ***/
+#define SEQ_ECHO TMR_ECHO /* For synching programs with output */
+#define SEQ_AFTERTOUCH 9
+#define SEQ_CONTROLLER 10
+
+/*
+ * Midi controller numbers
+ *
+ * Controllers 0 to 31 (0x00 to 0x1f) and 32 to 63 (0x20 to 0x3f)
+ * are continuous controllers.
+ * In the MIDI 1.0 these controllers are sent using two messages.
+ * Controller numbers 0 to 31 are used to send the MSB and the
+ * controller numbers 32 to 63 are for the LSB. Note that just 7 bits
+ * are used in MIDI bytes.
+ */
+
+#define CTL_BANK_SELECT 0x00
+#define CTL_MODWHEEL 0x01
+#define CTL_BREATH 0x02
+/* undefined 0x03 */
+#define CTL_FOOT 0x04
+#define CTL_PORTAMENTO_TIME 0x05
+#define CTL_DATA_ENTRY 0x06
+#define CTL_MAIN_VOLUME 0x07
+#define CTL_BALANCE 0x08
+/* undefined 0x09 */
+#define CTL_PAN 0x0a
+#define CTL_EXPRESSION 0x0b
+/* undefined 0x0c - 0x0f */
+#define CTL_GENERAL_PURPOSE1 0x10
+#define CTL_GENERAL_PURPOSE2 0x11
+#define CTL_GENERAL_PURPOSE3 0x12
+#define CTL_GENERAL_PURPOSE4 0x13
+/* undefined 0x14 - 0x1f */
+
+/* undefined 0x20 */
+
+/*
+ * The controller numbers 0x21 to 0x3f are reserved for the
+ * least significant bytes of the controllers 0x00 to 0x1f.
+ * These controllers are not recognised by the driver.
+ *
+ * Controllers 64 to 69 (0x40 to 0x45) are on/off switches.
+ * 0=OFF and 127=ON (intermediate values are possible)
+ */
+#define CTL_DAMPER_PEDAL 0x40
+#define CTL_SUSTAIN CTL_DAMPER_PEDAL /* Alias */
+#define CTL_HOLD CTL_DAMPER_PEDAL /* Alias */
+#define CTL_PORTAMENTO 0x41
+#define CTL_SOSTENUTO 0x42
+#define CTL_SOFT_PEDAL 0x43
+/* undefined 0x44 */
+#define CTL_HOLD2 0x45
+/* undefined 0x46 - 0x4f */
+
+#define CTL_GENERAL_PURPOSE5 0x50
+#define CTL_GENERAL_PURPOSE6 0x51
+#define CTL_GENERAL_PURPOSE7 0x52
+#define CTL_GENERAL_PURPOSE8 0x53
+/* undefined 0x54 - 0x5a */
+#define CTL_EXT_EFF_DEPTH 0x5b
+#define CTL_TREMOLO_DEPTH 0x5c
+#define CTL_CHORUS_DEPTH 0x5d
+#define CTL_DETUNE_DEPTH 0x5e
+#define CTL_CELESTE_DEPTH CTL_DETUNE_DEPTH /* Alias for the above one */
+#define CTL_PHASER_DEPTH 0x5f
+#define CTL_DATA_INCREMENT 0x60
+#define CTL_DATA_DECREMENT 0x61
+#define CTL_NONREG_PARM_NUM_LSB 0x62
+#define CTL_NONREG_PARM_NUM_MSB 0x63
+#define CTL_REGIST_PARM_NUM_LSB 0x64
+#define CTL_REGIST_PARM_NUM_MSB 0x65
+/* undefined 0x66 - 0x78 */
+/* reserved 0x79 - 0x7f */
+
+/* Pseudo controllers (not midi compatible) */
+#define CTRL_PITCH_BENDER 255
+#define CTRL_PITCH_BENDER_RANGE 254
+#define CTRL_EXPRESSION 253 /* Obsolete */
+#define CTRL_MAIN_VOLUME 252 /* Obsolete */
+
+#define SEQ_BALANCE 11
+#define SEQ_VOLMODE 12
+
+/*
+ * Volume mode decides how volumes are used
+ */
+
+#define VOL_METHOD_ADAGIO 1
+#define VOL_METHOD_LINEAR 2
+
+/*
+ * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
+ * input events.
+ */
+
+/*
+ * Event codes 0xf0 to 0xfc are reserved for future extensions.
+ */
+
+#define SEQ_FULLSIZE 0xfd /* Long events */
+/*
+ * SEQ_FULLSIZE events are used for loading patches/samples to the
+ * synthesizer devices. These events are passed directly to the driver
+ * of the associated synthesizer device. There is no limit to the size
+ * of the extended events. These events are not queued but executed
+ * immediately when the write() is called (execution can take several
+ * seconds of time).
+ *
+ * When a SEQ_FULLSIZE message is written to the device, it must
+ * be written using exactly one write() call. Other events cannot
+ * be mixed to the same write.
+ *
+ * For FM synths (YM3812/OPL3) use struct sbi_instrument and write
+ * it to the /dev/sequencer. Don't write other data together with
+ * the instrument structure Set the key field of the structure to
+ * FM_PATCH. The device field is used to route the patch to the
+ * corresponding device.
+ *
+ * For Gravis UltraSound use struct patch_info. Initialize the key field
+ * to GUS_PATCH.
+ */
+#define SEQ_PRIVATE 0xfe /* Low level HW dependent events (8 bytes) */
+#define SEQ_EXTENDED 0xff /* Extended events (8 bytes) OBSOLETE */
+
+/*
+ * Record for FM patches
+ */
+
+typedef u_char sbi_instr_data[32];
+
+struct sbi_instrument {
+ u_short key; /* FM_PATCH or OPL3_PATCH */
+#define FM_PATCH _PATCHKEY(0x01)
+#define OPL3_PATCH _PATCHKEY(0x03)
+ short device; /* Synth# (0-4) */
+ int channel; /* Program# to be initialized */
+ sbi_instr_data operators; /* Reg. settings for operator cells
+ * (.SBI format) */
+};
+
+struct synth_info { /* Read only */
+ char name[30];
+ int device; /* 0-N. INITIALIZE BEFORE CALLING */
+ int synth_type;
+#define SYNTH_TYPE_FM 0
+#define SYNTH_TYPE_SAMPLE 1
+#define SYNTH_TYPE_MIDI 2 /* Midi interface */
+
+ int synth_subtype;
+#define FM_TYPE_ADLIB 0x00
+#define FM_TYPE_OPL3 0x01
+#define MIDI_TYPE_MPU401 0x401
+
+#define SAMPLE_TYPE_BASIC 0x10
+#define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC
+#define SAMPLE_TYPE_AWE32 0x20
+
+ int perc_mode; /* No longer supported */
+ int nr_voices;
+ int nr_drums; /* Obsolete field */
+ int instr_bank_size;
+ u_long capabilities;
+#define SYNTH_CAP_PERCMODE 0x00000001 /* No longer used */
+#define SYNTH_CAP_OPL3 0x00000002 /* Set if OPL3 supported */
+#define SYNTH_CAP_INPUT 0x00000004 /* Input (MIDI) device */
+ int dummies[19]; /* Reserve space */
+};
+
+struct sound_timer_info {
+ char name[32];
+ int caps;
+};
+
+struct midi_info {
+ char name[30];
+ int device; /* 0-N. INITIALIZE BEFORE CALLING */
+ u_long capabilities; /* To be defined later */
+ int dev_type;
+ int dummies[18]; /* Reserve space */
+};
+
+/*
+ * ioctl commands for the /dev/midi##
+ */
+typedef struct {
+ u_char cmd;
+ char nr_args, nr_returns;
+ u_char data[30];
+} mpu_command_rec;
+
+#define SNDCTL_MIDI_PRETIME _IOWR('m', 0, int)
+#define SNDCTL_MIDI_MPUMODE _IOWR('m', 1, int)
+#define SNDCTL_MIDI_MPUCMD _IOWR('m', 2, mpu_command_rec)
+#define MIOSPASSTHRU _IOWR('m', 3, int)
+#define MIOGPASSTHRU _IOWR('m', 4, int)
+
+/*
+ * IOCTL commands for /dev/dsp and /dev/audio
+ */
+
+#define SNDCTL_DSP_RESET _IO ('P', 0)
+#define SNDCTL_DSP_SYNC _IO ('P', 1)
+#define SNDCTL_DSP_SPEED _IOWR('P', 2, int)
+#define SNDCTL_DSP_STEREO _IOWR('P', 3, int)
+#define SNDCTL_DSP_GETBLKSIZE _IOR('P', 4, int)
+#define SNDCTL_DSP_SETBLKSIZE _IOW('P', 4, int)
+#define SNDCTL_DSP_SETFMT _IOWR('P',5, int) /* Selects ONE fmt*/
+
+/*
+ * SOUND_PCM_WRITE_CHANNELS is not that different
+ * from SNDCTL_DSP_STEREO
+ */
+#define SOUND_PCM_WRITE_CHANNELS _IOWR('P', 6, int)
+#define SNDCTL_DSP_CHANNELS SOUND_PCM_WRITE_CHANNELS
+#define SOUND_PCM_WRITE_FILTER _IOWR('P', 7, int)
+#define SNDCTL_DSP_POST _IO ('P', 8)
+
+/*
+ * SNDCTL_DSP_SETBLKSIZE and the following two calls mostly do
+ * the same thing, i.e. set the block size used in DMA transfers.
+ */
+#define SNDCTL_DSP_SUBDIVIDE _IOWR('P', 9, int)
+#define SNDCTL_DSP_SETFRAGMENT _IOWR('P',10, int)
+
+
+#define SNDCTL_DSP_GETFMTS _IOR ('P',11, int) /* Returns a mask */
+/*
+ * Buffer status queries.
+ */
+typedef struct audio_buf_info {
+ int fragments; /* # of avail. frags (partly used ones not counted) */
+ int fragstotal; /* Total # of fragments allocated */
+ int fragsize; /* Size of a fragment in bytes */
+
+ int bytes; /* Avail. space in bytes (includes partly used fragments) */
+ /* Note! 'bytes' could be more than fragments*fragsize */
+} audio_buf_info;
+
+#define SNDCTL_DSP_GETOSPACE _IOR ('P',12, audio_buf_info)
+#define SNDCTL_DSP_GETISPACE _IOR ('P',13, audio_buf_info)
+
+/*
+ * SNDCTL_DSP_NONBLOCK is the same (but less powerful, since the
+ * action cannot be undone) of FIONBIO. The same can be achieved
+ * by opening the device with O_NDELAY
+ */
+#define SNDCTL_DSP_NONBLOCK _IO ('P',14)
+
+#define SNDCTL_DSP_GETCAPS _IOR ('P',15, int)
+#define DSP_CAP_REVISION 0x000000ff /* revision level (0 to 255) */
+#define DSP_CAP_DUPLEX 0x00000100 /* Full duplex record/playback */
+#define DSP_CAP_REALTIME 0x00000200 /* Real time capability */
+#define DSP_CAP_BATCH 0x00000400
+ /*
+ * Device has some kind of internal buffers which may
+ * cause some delays and decrease precision of timing
+ */
+#define DSP_CAP_COPROC 0x00000800
+ /* Has a coprocessor, sometimes it's a DSP but usually not */
+#define DSP_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */
+#define DSP_CAP_MMAP 0x00002000 /* Supports mmap() */
+
+/*
+ * What do these function do ?
+ */
+#define SNDCTL_DSP_GETTRIGGER _IOR ('P',16, int)
+#define SNDCTL_DSP_SETTRIGGER _IOW ('P',16, int)
+#define PCM_ENABLE_INPUT 0x00000001
+#define PCM_ENABLE_OUTPUT 0x00000002
+
+typedef struct count_info {
+ int bytes; /* Total # of bytes processed */
+ int blocks; /* # of fragment transitions since last time */
+ int ptr; /* Current DMA pointer value */
+} count_info;
+
+/*
+ * GETIPTR and GETISPACE are not that different... same for out.
+ */
+#define SNDCTL_DSP_GETIPTR _IOR ('P',17, count_info)
+#define SNDCTL_DSP_GETOPTR _IOR ('P',18, count_info)
+
+typedef struct buffmem_desc {
+ caddr_t buffer;
+ int size;
+} buffmem_desc;
+
+#define SNDCTL_DSP_MAPINBUF _IOR ('P', 19, buffmem_desc)
+#define SNDCTL_DSP_MAPOUTBUF _IOR ('P', 20, buffmem_desc)
+#define SNDCTL_DSP_SETSYNCRO _IO ('P', 21)
+#define SNDCTL_DSP_SETDUPLEX _IO ('P', 22)
+#define SNDCTL_DSP_GETODELAY _IOR ('P', 23, int)
+
+/*
+ * I guess these are the readonly version of the same
+ * functions that exist above as SNDCTL_DSP_...
+ */
+#define SOUND_PCM_READ_RATE _IOR ('P', 2, int)
+#define SOUND_PCM_READ_CHANNELS _IOR ('P', 6, int)
+#define SOUND_PCM_READ_BITS _IOR ('P', 5, int)
+#define SOUND_PCM_READ_FILTER _IOR ('P', 7, int)
+
+/*
+ * ioctl calls to be used in communication with coprocessors and
+ * DSP chips.
+ */
+
+typedef struct copr_buffer {
+ int command; /* Set to 0 if not used */
+ int flags;
+#define CPF_NONE 0x0000
+#define CPF_FIRST 0x0001 /* First block */
+#define CPF_LAST 0x0002 /* Last block */
+ int len;
+ int offs; /* If required by the device (0 if not used) */
+
+ u_char data[4000]; /* NOTE! 4000 is not 4k */
+} copr_buffer;
+
+typedef struct copr_debug_buf {
+ int command; /* Used internally. Set to 0 */
+ int parm1;
+ int parm2;
+ int flags;
+ int len; /* Length of data in bytes */
+} copr_debug_buf;
+
+typedef struct copr_msg {
+ int len;
+ u_char data[4000];
+} copr_msg;
+
+#define SNDCTL_COPR_RESET _IO ('C', 0)
+#define SNDCTL_COPR_LOAD _IOWR('C', 1, copr_buffer)
+#define SNDCTL_COPR_RDATA _IOWR('C', 2, copr_debug_buf)
+#define SNDCTL_COPR_RCODE _IOWR('C', 3, copr_debug_buf)
+#define SNDCTL_COPR_WDATA _IOW ('C', 4, copr_debug_buf)
+#define SNDCTL_COPR_WCODE _IOW ('C', 5, copr_debug_buf)
+#define SNDCTL_COPR_RUN _IOWR('C', 6, copr_debug_buf)
+#define SNDCTL_COPR_HALT _IOWR('C', 7, copr_debug_buf)
+#define SNDCTL_COPR_SENDMSG _IOW ('C', 8, copr_msg)
+#define SNDCTL_COPR_RCVMSG _IOR ('C', 9, copr_msg)
+
+/*
+ * IOCTL commands for /dev/mixer
+ */
+
+/*
+ * Mixer devices
+ *
+ * There can be up to 20 different analog mixer channels. The
+ * SOUND_MIXER_NRDEVICES gives the currently supported maximum.
+ * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
+ * the devices supported by the particular mixer.
+ */
+
+#define SOUND_MIXER_NRDEVICES 25
+#define SOUND_MIXER_VOLUME 0 /* Master output level */
+#define SOUND_MIXER_BASS 1 /* Treble level of all output channels */
+#define SOUND_MIXER_TREBLE 2 /* Bass level of all output channels */
+#define SOUND_MIXER_SYNTH 3 /* Volume of synthesier input */
+#define SOUND_MIXER_PCM 4 /* Output level for the audio device */
+#define SOUND_MIXER_SPEAKER 5 /* Output level for the PC speaker
+ * signals */
+#define SOUND_MIXER_LINE 6 /* Volume level for the line in jack */
+#define SOUND_MIXER_MIC 7 /* Volume for the signal coming from
+ * the microphone jack */
+#define SOUND_MIXER_CD 8 /* Volume level for the input signal
+ * connected to the CD audio input */
+#define SOUND_MIXER_IMIX 9 /* Recording monitor. It controls the
+ * output volume of the selected
+ * recording sources while recording */
+#define SOUND_MIXER_ALTPCM 10 /* Volume of the alternative codec
+ * device */
+#define SOUND_MIXER_RECLEV 11 /* Global recording level */
+#define SOUND_MIXER_IGAIN 12 /* Input gain */
+#define SOUND_MIXER_OGAIN 13 /* Output gain */
+/*
+ * The AD1848 codec and compatibles have three line level inputs
+ * (line, aux1 and aux2). Since each card manufacturer have assigned
+ * different meanings to these inputs, it's inpractical to assign
+ * specific meanings (line, cd, synth etc.) to them.
+ */
+#define SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */
+#define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */
+#define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */
+#define SOUND_MIXER_DIGITAL1 17 /* Digital (input) 1 */
+#define SOUND_MIXER_DIGITAL2 18 /* Digital (input) 2 */
+#define SOUND_MIXER_DIGITAL3 19 /* Digital (input) 3 */
+#define SOUND_MIXER_PHONEIN 20 /* Phone input */
+#define SOUND_MIXER_PHONEOUT 21 /* Phone output */
+#define SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */
+#define SOUND_MIXER_RADIO 23 /* Radio in */
+#define SOUND_MIXER_MONITOR 24 /* Monitor (usually mic) volume */
+
+
+/*
+ * Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX)
+ * Not counted to SOUND_MIXER_NRDEVICES, but use the same number space
+ */
+#define SOUND_ONOFF_MIN 28
+#define SOUND_ONOFF_MAX 30
+#define SOUND_MIXER_MUTE 28 /* 0 or 1 */
+#define SOUND_MIXER_ENHANCE 29 /* Enhanced stereo (0, 40, 60 or 80) */
+#define SOUND_MIXER_LOUD 30 /* 0 or 1 */
+
+/* Note! Number 31 cannot be used since the sign bit is reserved */
+#define SOUND_MIXER_NONE 31
+
+#define SOUND_DEVICE_LABELS { \
+ "Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \
+ "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \
+ "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \
+ "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor"}
+
+#define SOUND_DEVICE_NAMES { \
+ "vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
+ "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
+ "line1", "line2", "line3", "dig1", "dig2", "dig3", \
+ "phin", "phout", "video", "radio", "monitor"}
+
+/* Device bitmask identifiers */
+
+#define SOUND_MIXER_RECSRC 0xff /* 1 bit per recording source */
+#define SOUND_MIXER_DEVMASK 0xfe /* 1 bit per supported device */
+#define SOUND_MIXER_RECMASK 0xfd /* 1 bit per supp. recording source */
+#define SOUND_MIXER_CAPS 0xfc
+#define SOUND_CAP_EXCL_INPUT 0x00000001 /* Only 1 rec. src at a time */
+#define SOUND_MIXER_STEREODEVS 0xfb /* Mixer channels supporting stereo */
+
+/* Device mask bits */
+
+#define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME)
+#define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS)
+#define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE)
+#define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH)
+#define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM)
+#define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER)
+#define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE)
+#define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC)
+#define SOUND_MASK_CD (1 << SOUND_MIXER_CD)
+#define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX)
+#define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM)
+#define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV)
+#define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN)
+#define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN)
+#define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1)
+#define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2)
+#define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3)
+#define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1)
+#define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2)
+#define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3)
+#define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN)
+#define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT)
+#define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO)
+#define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO)
+#define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR)
+
+/* Obsolete macros */
+#define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE)
+#define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE)
+#define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD)
+
+#define MIXER_READ(dev) _IOR('M', dev, int)
+#define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS)
+#define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM)
+#define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE)
+#define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC)
+#define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD)
+#define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3)
+#define SOUND_MIXER_READ_DIGITAL1 MIXER_READ(SOUND_MIXER_DIGITAL1)
+#define SOUND_MIXER_READ_DIGITAL2 MIXER_READ(SOUND_MIXER_DIGITAL2)
+#define SOUND_MIXER_READ_DIGITAL3 MIXER_READ(SOUND_MIXER_DIGITAL3)
+#define SOUND_MIXER_READ_PHONEIN MIXER_READ(SOUND_MIXER_PHONEIN)
+#define SOUND_MIXER_READ_PHONEOUT MIXER_READ(SOUND_MIXER_PHONEOUT)
+#define SOUND_MIXER_READ_RADIO MIXER_READ(SOUND_MIXER_RADIO)
+#define SOUND_MIXER_READ_VIDEO MIXER_READ(SOUND_MIXER_VIDEO)
+#define SOUND_MIXER_READ_MONITOR MIXER_READ(SOUND_MIXER_MONITOR)
+
+/* Obsolete macros */
+#define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC)
+#define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK)
+#define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK)
+#define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS)
+#define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS)
+
+#define MIXER_WRITE(dev) _IOWR('M', dev, int)
+#define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME)
+#define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS)
+#define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE)
+#define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH)
+#define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM)
+#define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER)
+#define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE)
+#define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC)
+#define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD)
+#define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX)
+#define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM)
+#define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV)
+#define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN)
+#define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN)
+#define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1)
+#define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2)
+#define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3)
+#define SOUND_MIXER_WRITE_DIGITAL1 MIXER_WRITE(SOUND_MIXER_DIGITAL1)
+#define SOUND_MIXER_WRITE_DIGITAL2 MIXER_WRITE(SOUND_MIXER_DIGITAL2)
+#define SOUND_MIXER_WRITE_DIGITAL3 MIXER_WRITE(SOUND_MIXER_DIGITAL3)
+#define SOUND_MIXER_WRITE_PHONEIN MIXER_WRITE(SOUND_MIXER_PHONEIN)
+#define SOUND_MIXER_WRITE_PHONEOUT MIXER_WRITE(SOUND_MIXER_PHONEOUT)
+#define SOUND_MIXER_WRITE_RADIO MIXER_WRITE(SOUND_MIXER_RADIO)
+#define SOUND_MIXER_WRITE_VIDEO MIXER_WRITE(SOUND_MIXER_VIDEO)
+#define SOUND_MIXER_WRITE_MONITOR MIXER_WRITE(SOUND_MIXER_MONITOR)
+
+#define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE)
+#define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE)
+#define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD)
+
+#define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC)
+
+typedef struct mixer_info {
+ char id[16];
+ char name[32];
+ int modify_counter;
+ int fillers[10];
+} mixer_info;
+
+#define SOUND_MIXER_INFO _IOR('M', 101, mixer_info)
+
+#define LEFT_CHN 0
+#define RIGHT_CHN 1
+
+/*
+ * Level 2 event types for /dev/sequencer
+ */
+
+/*
+ * The 4 most significant bits of byte 0 specify the class of
+ * the event:
+ *
+ * 0x8X = system level events,
+ * 0x9X = device/port specific events, event[1] = device/port,
+ * The last 4 bits give the subtype:
+ * 0x02 = Channel event (event[3] = chn).
+ * 0x01 = note event (event[4] = note).
+ * (0x01 is not used alone but always with bit 0x02).
+ * event[2] = MIDI message code (0x80=note off etc.)
+ *
+ */
+
+#define EV_SEQ_LOCAL 0x80
+#define EV_TIMING 0x81
+#define EV_CHN_COMMON 0x92
+#define EV_CHN_VOICE 0x93
+#define EV_SYSEX 0x94
+/*
+ * Event types 200 to 220 are reserved for application use.
+ * These numbers will not be used by the driver.
+ */
+
+/*
+ * Events for event type EV_CHN_VOICE
+ */
+
+#define MIDI_NOTEOFF 0x80
+#define MIDI_NOTEON 0x90
+#define MIDI_KEY_PRESSURE 0xA0
+
+/*
+ * Events for event type EV_CHN_COMMON
+ */
+
+#define MIDI_CTL_CHANGE 0xB0
+#define MIDI_PGM_CHANGE 0xC0
+#define MIDI_CHN_PRESSURE 0xD0
+#define MIDI_PITCH_BEND 0xE0
+
+#define MIDI_SYSTEM_PREFIX 0xF0
+
+/*
+ * Timer event types
+ */
+#define TMR_WAIT_REL 1 /* Time relative to the prev time */
+#define TMR_WAIT_ABS 2 /* Absolute time since TMR_START */
+#define TMR_STOP 3
+#define TMR_START 4
+#define TMR_CONTINUE 5
+#define TMR_TEMPO 6
+#define TMR_ECHO 8
+#define TMR_CLOCK 9 /* MIDI clock */
+#define TMR_SPP 10 /* Song position pointer */
+#define TMR_TIMESIG 11 /* Time signature */
+
+/*
+ * Local event types
+ */
+#define LOCL_STARTAUDIO 1
+
+#if (!defined(_KERNEL) && !defined(INKERNEL)) || defined(USE_SEQ_MACROS)
+/*
+ * Some convenience macros to simplify programming of the
+ * /dev/sequencer interface
+ *
+ * These macros define the API which should be used when possible.
+ */
+
+#ifndef USE_SIMPLE_MACROS
+void seqbuf_dump(void); /* This function must be provided by programs */
+
+/* Sample seqbuf_dump() implementation:
+ *
+ * SEQ_DEFINEBUF (2048); -- Defines a buffer for 2048 bytes
+ *
+ * int seqfd; -- The file descriptor for /dev/sequencer.
+ *
+ * void
+ * seqbuf_dump ()
+ * {
+ * if (_seqbufptr)
+ * if (write (seqfd, _seqbuf, _seqbufptr) == -1)
+ * {
+ * perror ("write /dev/sequencer");
+ * exit (-1);
+ * }
+ * _seqbufptr = 0;
+ * }
+ */
+
+#define SEQ_DEFINEBUF(len) \
+ u_char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
+#define SEQ_USE_EXTBUF() \
+ extern u_char _seqbuf[]; \
+ extern int _seqbuflen;extern int _seqbufptr
+#define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
+#define SEQ_PM_DEFINES struct patmgr_info _pm_info
+#define _SEQ_NEEDBUF(len) \
+ if ((_seqbufptr+(len)) > _seqbuflen) \
+ seqbuf_dump()
+#define _SEQ_ADVBUF(len) _seqbufptr += len
+#define SEQ_DUMPBUF seqbuf_dump
+#else
+/*
+ * This variation of the sequencer macros is used just to format one event
+ * using fixed buffer.
+ *
+ * The program using the macro library must define the following macros before
+ * using this library.
+ *
+ * #define _seqbuf name of the buffer (u_char[])
+ * #define _SEQ_ADVBUF(len) If the applic needs to know the exact
+ * size of the event, this macro can be used.
+ * Otherwise this must be defined as empty.
+ * #define _seqbufptr Define the name of index variable or 0 if
+ * not required.
+ */
+#define _SEQ_NEEDBUF(len) /* empty */
+#endif
+
+#define PM_LOAD_PATCH(dev, bank, pgm) \
+ (SEQ_DUMPBUF(), _pm_info.command = _PM_LOAD_PATCH, \
+ _pm_info.device=dev, _pm_info.data.data8[0]=pgm, \
+ _pm_info.parm1 = bank, _pm_info.parm2 = 1, \
+ ioctl(seqfd, SNDCTL_PMGR_ACCESS, &_pm_info))
+#define PM_LOAD_PATCHES(dev, bank, pgm) \
+ (SEQ_DUMPBUF(), _pm_info.command = _PM_LOAD_PATCH, \
+ _pm_info.device=dev, bcopy( pgm, _pm_info.data.data8, 128), \
+ _pm_info.parm1 = bank, _pm_info.parm2 = 128, \
+ ioctl(seqfd, SNDCTL_PMGR_ACCESS, &_pm_info))
+
+#define SEQ_VOLUME_MODE(dev, mode) { \
+ _SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
+ _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
+ _seqbuf[_seqbufptr+2] = (dev);\
+ _seqbuf[_seqbufptr+3] = (mode);\
+ _seqbuf[_seqbufptr+4] = 0;\
+ _seqbuf[_seqbufptr+5] = 0;\
+ _seqbuf[_seqbufptr+6] = 0;\
+ _seqbuf[_seqbufptr+7] = 0;\
+ _SEQ_ADVBUF(8);}
+
+/*
+ * Midi voice messages
+ */
+
+#define _CHN_VOICE(dev, event, chn, note, parm) { \
+ _SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
+ _seqbuf[_seqbufptr+1] = (dev);\
+ _seqbuf[_seqbufptr+2] = (event);\
+ _seqbuf[_seqbufptr+3] = (chn);\
+ _seqbuf[_seqbufptr+4] = (note);\
+ _seqbuf[_seqbufptr+5] = (parm);\
+ _seqbuf[_seqbufptr+6] = (0);\
+ _seqbuf[_seqbufptr+7] = 0;\
+ _SEQ_ADVBUF(8);}
+
+#define SEQ_START_NOTE(dev, chn, note, vol) \
+ _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
+
+#define SEQ_STOP_NOTE(dev, chn, note, vol) \
+ _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
+
+#define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
+ _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
+
+/*
+ * Midi channel messages
+ */
+
+#define _CHN_COMMON(dev, event, chn, p1, p2, w14) { \
+ _SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
+ _seqbuf[_seqbufptr+1] = (dev);\
+ _seqbuf[_seqbufptr+2] = (event);\
+ _seqbuf[_seqbufptr+3] = (chn);\
+ _seqbuf[_seqbufptr+4] = (p1);\
+ _seqbuf[_seqbufptr+5] = (p2);\
+ *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
+ _SEQ_ADVBUF(8);}
+/*
+ * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
+ * sending any MIDI bytes but it's absolutely not possible. Trying to do
+ * so _will_ cause problems with MPU401 intelligent mode).
+ *
+ * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be
+ * sent by calling SEQ_SYSEX() several times (there must be no other events
+ * between them). First sysex fragment must have 0xf0 in the first byte
+ * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
+ * between these sysex start and end markers cannot be larger than 0x7f. Also
+ * lengths of each fragments (except the last one) must be 6.
+ *
+ * Breaking the above rules may work with some MIDI ports but is likely to
+ * cause fatal problems with some other devices (such as MPU401).
+ */
+#define SEQ_SYSEX(dev, buf, len) { \
+ int i, l=(len); if (l>6)l=6;\
+ _SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = EV_SYSEX;\
+ for(i=0;i<l;i++)_seqbuf[_seqbufptr+i+1] = (buf)[i];\
+ for(i=l;i<6;i++)_seqbuf[_seqbufptr+i+1] = 0xff;\
+ _SEQ_ADVBUF(8);}
+
+#define SEQ_CHN_PRESSURE(dev, chn, pressure) \
+ _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
+
+#define SEQ_SET_PATCH(dev, chn, patch) \
+ _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
+
+#define SEQ_CONTROL(dev, chn, controller, value) \
+ _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
+
+#define SEQ_BENDER(dev, chn, value) \
+ _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
+
+
+#define SEQ_V2_X_CONTROL(dev, voice, controller, value) { \
+ _SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
+ _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
+ _seqbuf[_seqbufptr+2] = (dev);\
+ _seqbuf[_seqbufptr+3] = (voice);\
+ _seqbuf[_seqbufptr+4] = (controller);\
+ *(short *)&_seqbuf[_seqbufptr+5] = (value);\
+ _seqbuf[_seqbufptr+7] = 0;\
+ _SEQ_ADVBUF(8);}
+
+/*
+ * The following 5 macros are incorrectly implemented and obsolete.
+ * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
+ */
+
+#define SEQ_PITCHBEND(dev, voice, value) \
+ SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
+#define SEQ_BENDER_RANGE(dev, voice, value) \
+ SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
+#define SEQ_EXPRESSION(dev, voice, value) \
+ SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
+#define SEQ_MAIN_VOLUME(dev, voice, value) \
+ SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
+#define SEQ_PANNING(dev, voice, pos) \
+ SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
+
+/*
+ * Timing and syncronization macros
+ */
+
+#define _TIMER_EVENT(ev, parm) { \
+ _SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr+0] = EV_TIMING; \
+ _seqbuf[_seqbufptr+1] = (ev); \
+ _seqbuf[_seqbufptr+2] = 0;\
+ _seqbuf[_seqbufptr+3] = 0;\
+ *(u_int *)&_seqbuf[_seqbufptr+4] = (parm); \
+ _SEQ_ADVBUF(8); \
+ }
+
+#define SEQ_START_TIMER() _TIMER_EVENT(TMR_START, 0)
+#define SEQ_STOP_TIMER() _TIMER_EVENT(TMR_STOP, 0)
+#define SEQ_CONTINUE_TIMER() _TIMER_EVENT(TMR_CONTINUE, 0)
+#define SEQ_WAIT_TIME(ticks) _TIMER_EVENT(TMR_WAIT_ABS, ticks)
+#define SEQ_DELTA_TIME(ticks) _TIMER_EVENT(TMR_WAIT_REL, ticks)
+#define SEQ_ECHO_BACK(key) _TIMER_EVENT(TMR_ECHO, key)
+#define SEQ_SET_TEMPO(value) _TIMER_EVENT(TMR_TEMPO, value)
+#define SEQ_SONGPOS(pos) _TIMER_EVENT(TMR_SPP, pos)
+#define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig)
+
+/*
+ * Local control events
+ */
+
+#define _LOCAL_EVENT(ev, parm) { \
+ _SEQ_NEEDBUF(8);\
+ _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
+ _seqbuf[_seqbufptr+1] = (ev); \
+ _seqbuf[_seqbufptr+2] = 0;\
+ _seqbuf[_seqbufptr+3] = 0;\
+ *(u_int *)&_seqbuf[_seqbufptr+4] = (parm); \
+ _SEQ_ADVBUF(8); \
+ }
+
+#define SEQ_PLAYAUDIO(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
+/*
+ * Events for the level 1 interface only
+ */
+
+#define SEQ_MIDIOUT(device, byte) { \
+ _SEQ_NEEDBUF(4);\
+ _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
+ _seqbuf[_seqbufptr+1] = (byte);\
+ _seqbuf[_seqbufptr+2] = (device);\
+ _seqbuf[_seqbufptr+3] = 0;\
+ _SEQ_ADVBUF(4);}
+
+/*
+ * Patch loading.
+ */
+#define SEQ_WRPATCH(patchx, len) { \
+ if (_seqbufptr) seqbuf_dump(); \
+ if (write(seqfd, (char*)(patchx), len)==-1) \
+ perror("Write patch: /dev/sequencer"); \
+ }
+
+#define SEQ_WRPATCH2(patchx, len) \
+ ( seqbuf_dump(), write(seqfd, (char*)(patchx), len) )
+
+#endif
+
+/*
+ * Here I have moved all the aliases for ioctl names.
+ */
+
+#define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT
+#define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT
+#define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT
+
+#define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED
+#define SOUND_PCM_POST SNDCTL_DSP_POST
+#define SOUND_PCM_RESET SNDCTL_DSP_RESET
+#define SOUND_PCM_SYNC SNDCTL_DSP_SYNC
+#define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE
+#define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT
+#define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS
+#define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE
+#define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE
+#define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK
+#define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS
+#define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER
+#define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER
+#define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO
+#define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR
+#define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR
+#define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF
+#define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF
+
+/***********************************************************************/
+
+/**
+ * XXX OSSv4 defines -- some bits taken straight out of the new
+ * sys/soundcard.h bundled with recent OSS releases.
+ *
+ * NB: These macros and structures will be reorganized and inserted
+ * in appropriate places throughout this file once the code begins
+ * to take shape.
+ *
+ * @todo reorganize layout more like the 4Front version
+ * @todo ask about maintaining __SIOWR vs. _IOWR ioctl cmd defines
+ */
+
+/**
+ * @note The @c OSSV4_EXPERIMENT macro is meant to wrap new development code
+ * in the sound system relevant to adopting 4Front's OSSv4 specification.
+ * Users should not enable this! Really!
+ */
+#if 0
+# define OSSV4_EXPERIMENT 1
+#else
+# undef OSSV4_EXPERIMENT
+#endif
+
+#ifdef SOUND_VERSION
+# undef SOUND_VERSION
+# define SOUND_VERSION 0x040000
+#endif /* !SOUND_VERSION */
+
+#define OSS_LONGNAME_SIZE 64
+#define OSS_LABEL_SIZE 16
+#define OSS_DEVNODE_SIZE 32
+typedef char oss_longname_t[OSS_LONGNAME_SIZE];
+typedef char oss_label_t[OSS_LABEL_SIZE];
+typedef char oss_devnode_t[OSS_DEVNODE_SIZE];
+
+typedef struct audio_errinfo
+{
+ int play_underruns;
+ int rec_overruns;
+ unsigned int play_ptradjust;
+ unsigned int rec_ptradjust;
+ int play_errorcount;
+ int rec_errorcount;
+ int play_lasterror;
+ int rec_lasterror;
+ long play_errorparm;
+ long rec_errorparm;
+ int filler[16];
+} audio_errinfo;
+
+#define SNDCTL_DSP_GETPLAYVOL _IOR ('P', 24, int)
+#define SNDCTL_DSP_SETPLAYVOL _IOWR('P', 24, int)
+#define SNDCTL_DSP_GETERROR _IOR ('P', 25, audio_errinfo)
+
+
+/*
+ ****************************************************************************
+ * Sync groups for audio devices
+ */
+typedef struct oss_syncgroup
+{
+ int id;
+ int mode;
+ int filler[16];
+} oss_syncgroup;
+
+#define SNDCTL_DSP_SYNCGROUP _IOWR('P', 28, oss_syncgroup)
+#define SNDCTL_DSP_SYNCSTART _IOW ('P', 29, int)
+
+/*
+ **************************************************************************
+ * "cooked" mode enables software based conversions for sample rate, sample
+ * format (bits) and number of channels (mono/stereo). These conversions are
+ * required with some devices that support only one sample rate or just stereo
+ * to let the applications to use other formats. The cooked mode is enabled by
+ * default. However it's necessary to disable this mode when mmap() is used or
+ * when very deterministic timing is required. SNDCTL_DSP_COOKEDMODE is an
+ * optional call introduced in OSS 3.9.6f. It's _error return must be ignored_
+ * since normally this call will return erno=EINVAL.
+ *
+ * SNDCTL_DSP_COOKEDMODE must be called immediately after open before doing
+ * anything else. Otherwise the call will not have any effect.
+ */
+#define SNDCTL_DSP_COOKEDMODE _IOW ('P', 30, int)
+
+/*
+ **************************************************************************
+ * SNDCTL_DSP_SILENCE and SNDCTL_DSP_SKIP are new calls in OSS 3.99.0
+ * that can be used to implement pause/continue during playback (no effect
+ * on recording).
+ */
+#define SNDCTL_DSP_SILENCE _IO ('P', 31)
+#define SNDCTL_DSP_SKIP _IO ('P', 32)
+
+/*
+ ****************************************************************************
+ * Abort transfer (reset) functions for input and output
+ */
+#define SNDCTL_DSP_HALT_INPUT _IO ('P', 33)
+#define SNDCTL_DSP_RESET_INPUT SNDCTL_DSP_HALT_INPUT /* Old name */
+#define SNDCTL_DSP_HALT_OUTPUT _IO ('P', 34)
+#define SNDCTL_DSP_RESET_OUTPUT SNDCTL_DSP_HALT_OUTPUT /* Old name */
+
+/*
+ ****************************************************************************
+ * Low water level control
+ */
+#define SNDCTL_DSP_LOW_WATER _IOW ('P', 34, int)
+
+/** @todo Get rid of OSS_NO_LONG_LONG references? */
+
+/*
+ ****************************************************************************
+ * 64 bit pointer support. Only available in environments that support
+ * the 64 bit (long long) integer type.
+ */
+#ifndef OSS_NO_LONG_LONG
+typedef struct
+{
+ long long samples;
+ int fifo_samples;
+ int filler[32]; /* For future use */
+} oss_count_t;
+
+#define SNDCTL_DSP_CURRENT_IPTR _IOR ('P', 35, oss_count_t)
+#define SNDCTL_DSP_CURRENT_OPTR _IOR ('P', 36, oss_count_t)
+#endif
+
+/*
+ ****************************************************************************
+ * Interface for selecting recording sources and playback output routings.
+ */
+#define SNDCTL_DSP_GET_RECSRC_NAMES _IOR ('P', 37, oss_mixer_enuminfo)
+#define SNDCTL_DSP_GET_RECSRC _IOR ('P', 38, int)
+#define SNDCTL_DSP_SET_RECSRC _IOWR('P', 38, int)
+
+#define SNDCTL_DSP_GET_PLAYTGT_NAMES _IOR ('P', 39, oss_mixer_enuminfo)
+#define SNDCTL_DSP_GET_PLAYTGT _IOR ('P', 40, int)
+#define SNDCTL_DSP_SET_PLAYTGT _IOWR('P', 40, int)
+#define SNDCTL_DSP_GETRECVOL _IOR ('P', 41, int)
+#define SNDCTL_DSP_SETRECVOL _IOWR('P', 41, int)
+
+/*
+ ***************************************************************************
+ * Some calls for setting the channel assignment with multi channel devices
+ * (see the manual for details). */
+#define SNDCTL_DSP_GET_CHNORDER _IOR ('P', 42, unsigned long long)
+#define SNDCTL_DSP_SET_CHNORDER _IOWR('P', 42, unsigned long long)
+# define CHID_UNDEF 0
+# define CHID_L 1 # define CHID_R 2
+# define CHID_C 3
+# define CHID_LFE 4
+# define CHID_LS 5
+# define CHID_RS 6
+# define CHID_LR 7
+# define CHID_RR 8
+#define CHNORDER_UNDEF 0x0000000000000000ULL
+#define CHNORDER_NORMAL 0x0000000087654321ULL
+
+#define MAX_PEAK_CHANNELS 128
+typedef unsigned short oss_peaks_t[MAX_PEAK_CHANNELS];
+#define SNDCTL_DSP_GETIPEAKS _IOR('P', 43, oss_peaks_t)
+#define SNDCTL_DSP_GETOPEAKS _IOR('P', 44, oss_peaks_t)
+#define SNDCTL_DSP_POLICY _IOW('P', 45, int) /* See the manual */
+
+/*
+ * OSS_SYSIFO is obsolete. Use SNDCTL_SYSINFO insteads.
+ */
+#define OSS_GETVERSION _IOR ('M', 118, int)
+
+/**
+ * @brief Argument for SNDCTL_SYSINFO ioctl.
+ *
+ * For use w/ the SNDCTL_SYSINFO ioctl available on audio (/dev/dsp*),
+ * mixer, and MIDI devices.
+ */
+typedef struct oss_sysinfo
+{
+ char product[32]; /* For example OSS/Free, OSS/Linux or
+ OSS/Solaris */
+ char version[32]; /* For example 4.0a */
+ int versionnum; /* See OSS_GETVERSION */
+ char options[128]; /* Reserved */
+
+ int numaudios; /* # of audio/dsp devices */
+ int openedaudio[8]; /* Bit mask telling which audio devices
+ are busy */
+
+ int numsynths; /* # of availavle synth devices */
+ int nummidis; /* # of available MIDI ports */
+ int numtimers; /* # of available timer devices */
+ int nummixers; /* # of mixer devices */
+
+ int openedmidi[8]; /* Bit mask telling which midi devices
+ are busy */
+ int numcards; /* Number of sound cards in the system */
+ int filler[241]; /* For future expansion (set to -1) */
+} oss_sysinfo;
+
+typedef struct oss_mixext
+{
+ int dev; /* Mixer device number */
+ int ctrl; /* Controller number */
+ int type; /* Entry type */
+# define MIXT_DEVROOT 0 /* Device root entry */
+# define MIXT_GROUP 1 /* Controller group */
+# define MIXT_ONOFF 2 /* OFF (0) or ON (1) */
+# define MIXT_ENUM 3 /* Enumerated (0 to maxvalue) */
+# define MIXT_MONOSLIDER 4 /* Mono slider (0 to 100) */
+# define MIXT_STEREOSLIDER 5 /* Stereo slider (dual 0 to 100) */
+# define MIXT_MESSAGE 6 /* (Readable) textual message */
+# define MIXT_MONOVU 7 /* VU meter value (mono) */
+# define MIXT_STEREOVU 8 /* VU meter value (stereo) */
+# define MIXT_MONOPEAK 9 /* VU meter peak value (mono) */
+# define MIXT_STEREOPEAK 10 /* VU meter peak value (stereo) */
+# define MIXT_RADIOGROUP 11 /* Radio button group */
+# define MIXT_MARKER 12 /* Separator between normal and extension entries */
+# define MIXT_VALUE 13 /* Decimal value entry */
+# define MIXT_HEXVALUE 14 /* Hexadecimal value entry */
+# define MIXT_MONODB 15 /* Mono atten. slider (0 to -144) */
+# define MIXT_STEREODB 16 /* Stereo atten. slider (dual 0 to -144) */
+# define MIXT_SLIDER 17 /* Slider (mono) with full integer range */
+# define MIXT_3D 18
+
+ /* Possible value range (minvalue to maxvalue) */
+ /* Note that maxvalue may also be smaller than minvalue */
+ int maxvalue;
+ int minvalue;
+
+ int flags;
+# define MIXF_READABLE 0x00000001 /* Has readable value */
+# define MIXF_WRITEABLE 0x00000002 /* Has writeable value */
+# define MIXF_POLL 0x00000004 /* May change itself */
+# define MIXF_HZ 0x00000008 /* Herz scale */
+# define MIXF_STRING 0x00000010 /* Use dynamic extensions for value */
+# define MIXF_DYNAMIC 0x00000010 /* Supports dynamic extensions */
+# define MIXF_OKFAIL 0x00000020 /* Interpret value as 1=OK, 0=FAIL */
+# define MIXF_FLAT 0x00000040 /* Flat vertical space requirements */
+# define MIXF_LEGACY 0x00000080 /* Legacy mixer control group */
+ char id[16]; /* Mnemonic ID (mainly for internal use) */
+ int parent; /* Entry# of parent (group) node (-1 if root) */
+
+ int dummy; /* Internal use */
+
+ int timestamp;
+
+ char data[64]; /* Misc data (entry type dependent) */
+ unsigned char enum_present[32]; /* Mask of allowed enum values */
+ int control_no; /* SOUND_MIXER_VOLUME..SOUND_MIXER_MIDI */
+ /* (-1 means not indicated) */
+
+/*
+ * The desc field is reserved for internal purposes of OSS. It should not be
+ * used by applications.
+ */
+ unsigned int desc;
+#define MIXEXT_SCOPE_MASK 0x0000003f
+#define MIXEXT_SCOPE_OTHER 0x00000000
+#define MIXEXT_SCOPE_INPUT 0x00000001
+#define MIXEXT_SCOPE_OUTPUT 0x00000002
+#define MIXEXT_SCOPE_MONITOR 0x00000003
+#define MIXEXT_SCOPE_RECSWITCH 0x00000004
+
+ char extname[32];
+ int update_counter;
+ int filler[7];
+} oss_mixext;
+
+typedef struct oss_mixext_root
+{
+ char id[16];
+ char name[48];
+} oss_mixext_root;
+
+typedef struct oss_mixer_value
+{
+ int dev;
+ int ctrl;
+ int value;
+ int flags; /* Reserved for future use. Initialize to 0 */
+ int timestamp; /* Must be set to oss_mixext.timestamp */
+ int filler[8]; /* Reserved for future use. Initialize to 0 */
+} oss_mixer_value;
+
+#define OSS_ENUM_MAXVALUE 255
+typedef struct oss_mixer_enuminfo
+{
+ int dev;
+ int ctrl;
+ int nvalues;
+ int version; /* Read the manual */
+ short strindex[OSS_ENUM_MAXVALUE];
+ char strings[3000];
+} oss_mixer_enuminfo;
+
+#define OPEN_READ PCM_ENABLE_INPUT
+#define OPEN_WRITE PCM_ENABLE_OUTPUT
+#define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
+
+/**
+ * @brief Argument for SNDCTL_AUDIOINFO ioctl.
+ *
+ * For use w/ the SNDCTL_AUDIOINFO ioctl available on audio (/dev/dsp*)
+ * devices.
+ */
+typedef struct oss_audioinfo
+{
+ int dev; /* Audio device number */
+ char name[64];
+ int busy; /* 0, OPEN_READ, OPEN_WRITE or OPEN_READWRITE */
+ int pid;
+ int caps; /* DSP_CAP_INPUT, DSP_CAP_OUTPUT */
+ int iformats;
+ int oformats;
+ int magic; /* Reserved for internal use */
+ char cmd[64]; /* Command using the device (if known) */
+ int card_number;
+ int port_number;
+ int mixer_dev;
+ int real_device; /* Obsolete field. Replaced by devnode */
+ int enabled; /* 1=enabled, 0=device not ready at this
+ moment */
+ int flags; /* For internal use only - no practical
+ meaning */
+ int min_rate; /* Sample rate limits */
+ int max_rate;
+ int min_channels; /* Number of channels supported */
+ int max_channels;
+ int binding; /* DSP_BIND_FRONT, etc. 0 means undefined */
+ int rate_source;
+ char handle[32];
+ #define OSS_MAX_SAMPLE_RATES 20 /* Cannot be changed */
+ unsigned int nrates;
+ unsigned int rates[OSS_MAX_SAMPLE_RATES]; /* Please read the manual before using these */
+ oss_longname_t song_name; /* Song name (if given) */
+ oss_label_t label; /* Device label (if given) */
+ int latency; /* In usecs, -1=unknown */
+ oss_devnode_t devnode; /* Device special file name (inside
+ /dev) */
+ int filler[186];
+} oss_audioinfo;
+
+typedef struct oss_mixerinfo
+{
+ int dev;
+ char id[16];
+ char name[32];
+ int modify_counter;
+ int card_number;
+ int port_number;
+ char handle[32];
+ int magic; /* Reserved */
+ int enabled; /* Reserved */
+ int caps;
+#define MIXER_CAP_VIRTUAL 0x00000001
+ int flags; /* Reserved */
+ int nrext;
+ /*
+ * The priority field can be used to select the default (motherboard)
+ * mixer device. The mixer with the highest priority is the
+ * most preferred one. -2 or less means that this device cannot be used
+ * as the default mixer.
+ */
+ int priority;
+ int filler[254]; /* Reserved */
+} oss_mixerinfo;
+
+typedef struct oss_midi_info
+{
+ int dev; /* Midi device number */
+ char name[64];
+ int busy; /* 0, OPEN_READ, OPEN_WRITE or OPEN_READWRITE */
+ int pid;
+ char cmd[64]; /* Command using the device (if known) */
+ int caps;
+#define MIDI_CAP_MPU401 0x00000001 /**** OBSOLETE ****/
+#define MIDI_CAP_INPUT 0x00000002
+#define MIDI_CAP_OUTPUT 0x00000004
+#define MIDI_CAP_INOUT (MIDI_CAP_INPUT|MIDI_CAP_OUTPUT)
+#define MIDI_CAP_VIRTUAL 0x00000008 /* Pseudo device */
+#define MIDI_CAP_MTCINPUT 0x00000010 /* Supports SNDCTL_MIDI_MTCINPUT */
+#define MIDI_CAP_CLIENT 0x00000020 /* Virtual client side device */
+#define MIDI_CAP_SERVER 0x00000040 /* Virtual server side device */
+#define MIDI_CAP_INTERNAL 0x00000080 /* Internal (synth) device */
+#define MIDI_CAP_EXTERNAL 0x00000100 /* external (MIDI port) device */
+#define MIDI_CAP_PTOP 0x00000200 /* Point to point link to one device */
+#define MIDI_CAP_MTC 0x00000400 /* MTC/SMPTE (control) device */
+ int magic; /* Reserved for internal use */
+ int card_number;
+ int port_number;
+ int enabled; /* 1=enabled, 0=device not ready at this moment */
+ int flags; /* For internal use only - no practical meaning */
+ char handle[32];
+ oss_longname_t song_name; /* Song name (if known) */
+ oss_label_t label; /* Device label (if given) */
+ int latency; /* In usecs, -1=unknown */
+ int filler[244];
+} oss_midi_info;
+
+typedef struct oss_card_info
+{
+ int card;
+ char shortname[16];
+ char longname[128];
+ int flags;
+ int filler[256];
+} oss_card_info;
+
+#define SNDCTL_SYSINFO _IOR ('X', 1, oss_sysinfo)
+#define OSS_SYSINFO SNDCTL_SYSINFO /* Old name */
+
+#define SNDCTL_MIX_NRMIX _IOR ('X', 2, int)
+#define SNDCTL_MIX_NREXT _IOWR('X', 3, int)
+#define SNDCTL_MIX_EXTINFO _IOWR('X', 4, oss_mixext)
+#define SNDCTL_MIX_READ _IOWR('X', 5, oss_mixer_value)
+#define SNDCTL_MIX_WRITE _IOWR('X', 6, oss_mixer_value)
+
+#define SNDCTL_AUDIOINFO _IOWR('X', 7, oss_audioinfo)
+#define SNDCTL_MIX_ENUMINFO _IOWR('X', 8, oss_mixer_enuminfo)
+#define SNDCTL_MIDIINFO _IOWR('X', 9, oss_midi_info)
+#define SNDCTL_MIXERINFO _IOWR('X',10, oss_mixerinfo)
+#define SNDCTL_CARDINFO _IOWR('X',11, oss_card_info)
+
+/*
+ * Few more "globally" available ioctl calls.
+ */
+#define SNDCTL_SETSONG _IOW ('Y', 2, oss_longname_t)
+#define SNDCTL_GETSONG _IOR ('Y', 2, oss_longname_t)
+#define SNDCTL_SETNAME _IOW ('Y', 3, oss_longname_t)
+#define SNDCTL_SETLABEL _IOW ('Y', 4, oss_label_t)
+#define SNDCTL_GETLABEL _IOR ('Y', 4, oss_label_t)
+
+#endif /* !_SYS_SOUNDCARD_H_ */
diff --git a/src/deps/rtaudio-mod/librtaudio.pc b/src/deps/rtaudio-mod/librtaudio.pc
new file mode 100644
index 0000000..3adc679
--- /dev/null
+++ b/src/deps/rtaudio-mod/librtaudio.pc
@@ -0,0 +1,12 @@
+prefix=/usr/local
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: librtaudio
+Description: RtAudio - a set of C++ classes that provide a common API for realtime audio input/output
+Version: 4.1.1
+Requires: alsa libpulse-simple
+Libs: -L${libdir} -lrtaudio
+Libs.private: -lpthread
+Cflags: -pthread -I${includedir} -DHAVE_GETTIMEOFDAY -D__UNIX_JACK__ -D__LINUX_ALSA__ -D__LINUX_PULSE__
diff --git a/src/rtaudio-mod/librtaudio.pc.in b/src/deps/rtaudio-mod/librtaudio.pc.in
index 45c3f4e..45c3f4e 100644
--- a/src/rtaudio-mod/librtaudio.pc.in
+++ b/src/deps/rtaudio-mod/librtaudio.pc.in
diff --git a/src/deps/rtaudio-mod/rtaudio-config b/src/deps/rtaudio-mod/rtaudio-config
new file mode 100755
index 0000000..dbd3a39
--- /dev/null
+++ b/src/deps/rtaudio-mod/rtaudio-config
@@ -0,0 +1,19 @@
+#! /bin/sh
+if (test "x$#" != "x1") ; then
+ echo "Usage: $0 [--libs | --cxxflags | --cppflags]"
+ exit;
+fi
+
+LIBRARY="-lpthread -lasound -lasound -ljack -lpulse-simple -lpulse "
+CXXFLAGS="-O2 -Wall -Wextra"
+CPPFLAGS=" -DHAVE_GETTIMEOFDAY -D__UNIX_JACK__ -D__LINUX_ALSA__ -D__LINUX_PULSE__"
+
+if (test "x$1" = "x--libs") ; then
+ echo "$LIBRARY -lrtaudio"
+elif (test "x$1" = "x--cxxflags") ; then
+ echo "$CXXFLAGS"
+elif (test "x$1" = "x--cppflags") ; then
+ echo "$CPPFLAGS"
+else
+ echo "Unknown option: $1"
+fi
diff --git a/src/rtaudio-mod/rtaudio-config.in b/src/deps/rtaudio-mod/rtaudio-config.in
index 5f83d51..5f83d51 100644
--- a/src/rtaudio-mod/rtaudio-config.in
+++ b/src/deps/rtaudio-mod/rtaudio-config.in
diff --git a/src/deps/rtaudio-mod/tests/Makefile.in b/src/deps/rtaudio-mod/tests/Makefile.in
new file mode 100644
index 0000000..fbca16b
--- /dev/null
+++ b/src/deps/rtaudio-mod/tests/Makefile.in
@@ -0,0 +1,58 @@
+### Do not edit -- Generated by 'configure --with-whatever' from Makefile.in
+### RtAudio tests Makefile - for various flavors of unix and MinGW
+
+PROGRAMS = audioprobe playsaw playraw record duplex testall teststops
+RM = /bin/rm
+SRC_PATH = ..
+INCLUDE = ..
+OBJECT_PATH = @object_path@
+vpath %.o $(OBJECT_PATH)
+
+OBJECTS = RtAudio.o @objects@
+
+CC = @CXX@
+DEFS = @CPPFLAGS@
+CFLAGS = @CXXFLAGS@
+CFLAGS += -I$(INCLUDE) -I../include
+LIBRARY = @LIBS@
+
+%.o : $(SRC_PATH)/%.cpp
+ $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@
+
+%.o : ../include/%.cpp
+ $(CC) $(CFLAGS) $(DEFS) -c $(<) -o $(OBJECT_PATH)/$@
+
+all : $(PROGRAMS)
+
+audioprobe : audioprobe.cpp $(OBJECTS)
+ $(CC) $(CFLAGS) $(DEFS) -o audioprobe audioprobe.cpp $(OBJECT_PATH)/*.o $(LIBRARY)
+
+playsaw : playsaw.cpp $(OBJECTS)
+ $(CC) $(CFLAGS) $(DEFS) -o playsaw playsaw.cpp $(OBJECT_PATH)/*.o $(LIBRARY)
+
+playraw : playraw.cpp $(OBJECTS)
+ $(CC) $(CFLAGS) $(DEFS) -o playraw playraw.cpp $(OBJECT_PATH)/*.o $(LIBRARY)
+
+record : record.cpp $(OBJECTS)
+ $(CC) $(CFLAGS) $(DEFS) -o record record.cpp $(OBJECT_PATH)/*.o $(LIBRARY)
+
+duplex : duplex.cpp $(OBJECTS)
+ $(CC) $(CFLAGS) $(DEFS) -o duplex duplex.cpp $(OBJECT_PATH)/*.o $(LIBRARY)
+
+testall : testall.cpp $(OBJECTS)
+ $(CC) $(CFLAGS) $(DEFS) -o testall testall.cpp $(OBJECT_PATH)/*.o $(LIBRARY)
+
+teststops : teststops.cpp $(OBJECTS)
+ $(CC) $(CFLAGS) $(DEFS) -o teststops teststops.cpp $(OBJECT_PATH)/*.o $(LIBRARY)
+
+clean :
+ $(RM) -f $(OBJECT_PATH)/*.o
+ $(RM) -f $(PROGRAMS)
+ $(RM) -f *.raw *~ *.exe
+ $(RM) -fR *.dSYM
+
+distclean: clean
+ $(RM) -f Makefile
+
+strip :
+ strip $(PROGRAMS)
diff --git a/src/deps/vst/aeffect.h b/src/deps/vst/aeffect.h
new file mode 100644
index 0000000..f5f01c8
--- /dev/null
+++ b/src/deps/vst/aeffect.h
@@ -0,0 +1,351 @@
+//-------------------------------------------------------------------------------------------------------
+// VST Plug-Ins SDK
+// Version 2.4 $Date: 2006/06/20 17:22:55 $
+//
+// Category : VST 2.x Interfaces
+// Filename : aeffect.h
+// Created by : Steinberg Media Technologies
+// Description : Definition of AEffect structure
+//
+// © 2006, Steinberg Media Technologies, All Rights Reserved
+//-------------------------------------------------------------------------------------------------------
+
+#ifndef __aeffect__
+#define __aeffect__
+
+// gcc based compiler, or CodeWarrior on Mac OS X
+#if ((defined(__GNUC__) && (defined(__APPLE_CPP__) || defined(__APPLE_CC__))) || (defined (__MWERKS__) && defined (__MACH__)))
+ #ifndef TARGET_API_MAC_CARBON
+ #define TARGET_API_MAC_CARBON 1
+ #endif
+ #if __ppc__
+ #ifndef VST_FORCE_DEPRECATED
+ #define VST_FORCE_DEPRECATED 0
+ #endif
+ #endif
+#endif
+
+#if TARGET_API_MAC_CARBON
+ #ifdef __LP64__
+ #pragma options align=power
+ #else
+ #pragma options align=mac68k
+ #endif
+ #define VSTCALLBACK
+#elif defined __BORLANDC__
+ #pragma -a8
+#elif defined(__GNUC__)
+ #pragma pack(push,8)
+ #define VSTCALLBACK __cdecl
+#elif defined(WIN32) || defined(__FLAT__) || defined CBUILDER
+ #pragma pack(push)
+ #pragma pack(8)
+ #define VSTCALLBACK __cdecl
+#else
+ #define VSTCALLBACK
+#endif
+//-------------------------------------------------------------------------------------------------------
+
+#include <string.h> // for strncpy
+
+//-------------------------------------------------------------------------------------------------------
+// VST Version
+//-------------------------------------------------------------------------------------------------------
+
+/** Define SDK Version (you can generate different versions (from 2.0 to 2.4) of this SDK by setting the unwanted extensions to 0). */
+#define VST_2_1_EXTENSIONS 1 ///< Version 2.1 extensions (08-06-2000)
+#define VST_2_2_EXTENSIONS 1 ///< Version 2.2 extensions (08-06-2001)
+#define VST_2_3_EXTENSIONS 1 ///< Version 2.3 extensions (20-05-2003)
+#ifndef VST_2_4_EXTENSIONS
+#define VST_2_4_EXTENSIONS 1 ///< Version 2.4 extensions (01-01-2006)
+#endif
+
+/** Current VST Version */
+#if VST_2_4_EXTENSIONS
+ #define kVstVersion 2400
+#elif VST_2_3_EXTENSIONS
+ #define kVstVersion 2300
+#elif VST_2_2_EXTENSIONS
+ #define kVstVersion 2200
+#elif VST_2_1_EXTENSIONS
+ #define kVstVersion 2100
+#else
+ #define kVstVersion 2
+#endif
+
+/** Disable for Hosts to serve Plug-ins below VST 2.4 */
+#ifndef VST_FORCE_DEPRECATED
+#define VST_FORCE_DEPRECATED VST_2_4_EXTENSIONS
+#endif
+
+/** Declares identifier as deprecated. */
+#if VST_FORCE_DEPRECATED
+#define DECLARE_VST_DEPRECATED(identifier) __##identifier##Deprecated
+#else
+#define DECLARE_VST_DEPRECATED(identifier) identifier
+#endif
+
+/** Define for 64 Bit Platform. */
+#ifndef VST_64BIT_PLATFORM
+#define VST_64BIT_PLATFORM _WIN64 || __LP64__
+#endif
+
+//-------------------------------------------------------------------------------------------------------
+// Integral Types
+//-------------------------------------------------------------------------------------------------------
+
+#ifdef WIN32
+typedef short VstInt16; ///< 16 bit integer type
+typedef int VstInt32; ///< 32 bit integer type
+typedef __int64 VstInt64; ///< 64 bit integer type
+#else
+#include <stdint.h>
+typedef int16_t VstInt16; ///< 16 bit integer type
+typedef int32_t VstInt32; ///< 32 bit integer type
+typedef int64_t VstInt64; ///< 64 bit integer type
+#endif
+
+//-------------------------------------------------------------------------------------------------------
+// Generic Types
+//-------------------------------------------------------------------------------------------------------
+
+#if VST_64BIT_PLATFORM
+typedef VstInt64 VstIntPtr; ///< platform-dependent integer type, same size as pointer
+#else
+typedef VstInt32 VstIntPtr; ///< platform-dependent integer type, same size as pointer
+#endif
+
+//-------------------------------------------------------------------------------------------------------
+// Misc. Definition
+//-------------------------------------------------------------------------------------------------------
+#undef CCONST
+struct AEffect;
+
+/// @cond ignore
+typedef VstIntPtr (VSTCALLBACK *audioMasterCallback) (AEffect* effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt);
+typedef VstIntPtr (VSTCALLBACK *AEffectDispatcherProc) (AEffect* effect, VstInt32 opcode, VstInt32 index, VstIntPtr value, void* ptr, float opt);
+typedef void (VSTCALLBACK *AEffectProcessProc) (AEffect* effect, float** inputs, float** outputs, VstInt32 sampleFrames);
+typedef void (VSTCALLBACK *AEffectProcessDoubleProc) (AEffect* effect, double** inputs, double** outputs, VstInt32 sampleFrames);
+typedef void (VSTCALLBACK *AEffectSetParameterProc) (AEffect* effect, VstInt32 index, float parameter);
+typedef float (VSTCALLBACK *AEffectGetParameterProc) (AEffect* effect, VstInt32 index);
+/// @endcond
+
+/** Four Character Constant (for AEffect->uniqueID) */
+#define CCONST(a, b, c, d) \
+ ((((VstInt32)a) << 24) | (((VstInt32)b) << 16) | (((VstInt32)c) << 8) | (((VstInt32)d) << 0))
+
+/** AEffect magic number */
+#define kEffectMagic CCONST ('V', 's', 't', 'P')
+
+//-------------------------------------------------------------------------------------------------------
+/** Basic VST Effect "C" Interface. */
+//-------------------------------------------------------------------------------------------------------
+struct AEffect
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 magic; ///< must be #kEffectMagic ('VstP')
+
+ /** Host to Plug-in dispatcher @see AudioEffect::dispatcher */
+ AEffectDispatcherProc dispatcher;
+
+ /** \deprecated Accumulating process mode is deprecated in VST 2.4! Use AEffect::processReplacing instead! */
+ AEffectProcessProc DECLARE_VST_DEPRECATED (process);
+
+ /** Set new value of automatable parameter @see AudioEffect::setParameter */
+ AEffectSetParameterProc setParameter;
+
+ /** Returns current value of automatable parameter @see AudioEffect::getParameter*/
+ AEffectGetParameterProc getParameter;
+
+ VstInt32 numPrograms; ///< number of programs
+ VstInt32 numParams; ///< all programs are assumed to have numParams parameters
+ VstInt32 numInputs; ///< number of audio inputs
+ VstInt32 numOutputs; ///< number of audio outputs
+
+ VstInt32 flags; ///< @see VstAEffectFlags
+
+ VstIntPtr resvd1; ///< reserved for Host, must be 0
+ VstIntPtr resvd2; ///< reserved for Host, must be 0
+
+ VstInt32 initialDelay; ///< for algorithms which need input in the first place (Group delay or latency in Samples). This value should be initialized in a resume state.
+
+ VstInt32 DECLARE_VST_DEPRECATED (realQualities); ///< \deprecated unused member
+ VstInt32 DECLARE_VST_DEPRECATED (offQualities); ///< \deprecated unused member
+ float DECLARE_VST_DEPRECATED (ioRatio); ///< \deprecated unused member
+
+ void* object; ///< #AudioEffect class pointer
+ void* user; ///< user-defined pointer
+
+ VstInt32 uniqueID; ///< registered unique identifier (register it at Steinberg 3rd party support Web). This is used to identify a plug-in during save+load of preset and project.
+ VstInt32 version; ///< plug-in version (example 1100 for version 1.1.0.0)
+
+ /** Process audio samples in replacing mode @see AudioEffect::processReplacing */
+ AEffectProcessProc processReplacing;
+
+#if VST_2_4_EXTENSIONS
+ /** Process double-precision audio samples in replacing mode @see AudioEffect::processDoubleReplacing */
+ AEffectProcessDoubleProc processDoubleReplacing;
+
+ char future[56]; ///< reserved for future use (please zero)
+#else
+ char future[60]; ///< reserved for future use (please zero)
+#endif
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** AEffect flags */
+//-------------------------------------------------------------------------------------------------------
+enum VstAEffectFlags
+{
+//-------------------------------------------------------------------------------------------------------
+ effFlagsHasEditor = 1 << 0, ///< set if the plug-in provides a custom editor
+ effFlagsCanReplacing = 1 << 4, ///< supports replacing process mode (which should the default mode in VST 2.4)
+ effFlagsProgramChunks = 1 << 5, ///< program data is handled in formatless chunks
+ effFlagsIsSynth = 1 << 8, ///< plug-in is a synth (VSTi), Host may assign mixer channels for its outputs
+ effFlagsNoSoundInStop = 1 << 9, ///< plug-in does not produce sound when input is all silence
+
+#if VST_2_4_EXTENSIONS
+ effFlagsCanDoubleReplacing = 1 << 12, ///< plug-in supports double precision processing
+#endif
+
+ DECLARE_VST_DEPRECATED (effFlagsHasClip) = 1 << 1, ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (effFlagsHasVu) = 1 << 2, ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (effFlagsCanMono) = 1 << 3, ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (effFlagsExtIsAsync) = 1 << 10, ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (effFlagsExtHasBuffer) = 1 << 11 ///< \deprecated deprecated in VST 2.4
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Basic dispatcher Opcodes (Host to Plug-in) */
+//-------------------------------------------------------------------------------------------------------
+enum AEffectOpcodes
+{
+ effOpen = 0, ///< no arguments @see AudioEffect::open
+ effClose, ///< no arguments @see AudioEffect::close
+
+ effSetProgram, ///< [value]: new program number @see AudioEffect::setProgram
+ effGetProgram, ///< [return value]: current program number @see AudioEffect::getProgram
+ effSetProgramName, ///< [ptr]: char* with new program name, limited to #kVstMaxProgNameLen @see AudioEffect::setProgramName
+ effGetProgramName, ///< [ptr]: char buffer for current program name, limited to #kVstMaxProgNameLen @see AudioEffect::getProgramName
+
+ effGetParamLabel, ///< [ptr]: char buffer for parameter label, limited to #kVstMaxParamStrLen @see AudioEffect::getParameterLabel
+ effGetParamDisplay, ///< [ptr]: char buffer for parameter display, limited to #kVstMaxParamStrLen @see AudioEffect::getParameterDisplay
+ effGetParamName, ///< [ptr]: char buffer for parameter name, limited to #kVstMaxParamStrLen @see AudioEffect::getParameterName
+
+ DECLARE_VST_DEPRECATED (effGetVu), ///< \deprecated deprecated in VST 2.4
+
+ effSetSampleRate, ///< [opt]: new sample rate for audio processing @see AudioEffect::setSampleRate
+ effSetBlockSize, ///< [value]: new maximum block size for audio processing @see AudioEffect::setBlockSize
+ effMainsChanged, ///< [value]: 0 means "turn off", 1 means "turn on" @see AudioEffect::suspend @see AudioEffect::resume
+
+ effEditGetRect, ///< [ptr]: #ERect** receiving pointer to editor size @see ERect @see AEffEditor::getRect
+ effEditOpen, ///< [ptr]: system dependent Window pointer, e.g. HWND on Windows @see AEffEditor::open
+ effEditClose, ///< no arguments @see AEffEditor::close
+
+ DECLARE_VST_DEPRECATED (effEditDraw), ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (effEditMouse), ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (effEditKey), ///< \deprecated deprecated in VST 2.4
+
+ effEditIdle, ///< no arguments @see AEffEditor::idle
+
+ DECLARE_VST_DEPRECATED (effEditTop), ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (effEditSleep), ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (effIdentify), ///< \deprecated deprecated in VST 2.4
+
+ effGetChunk, ///< [ptr]: void** for chunk data address [index]: 0 for bank, 1 for program @see AudioEffect::getChunk
+ effSetChunk, ///< [ptr]: chunk data [value]: byte size [index]: 0 for bank, 1 for program @see AudioEffect::setChunk
+
+ effNumOpcodes
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Basic dispatcher Opcodes (Plug-in to Host) */
+//-------------------------------------------------------------------------------------------------------
+enum AudioMasterOpcodes
+{
+//-------------------------------------------------------------------------------------------------------
+ audioMasterAutomate = 0, ///< [index]: parameter index [opt]: parameter value @see AudioEffect::setParameterAutomated
+ audioMasterVersion, ///< [return value]: Host VST version (for example 2400 for VST 2.4) @see AudioEffect::getMasterVersion
+ audioMasterCurrentId, ///< [return value]: current unique identifier on shell plug-in @see AudioEffect::getCurrentUniqueId
+ audioMasterIdle, ///< no arguments @see AudioEffect::masterIdle
+ DECLARE_VST_DEPRECATED (audioMasterPinConnected) ///< \deprecated deprecated in VST 2.4 r2
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** String length limits (in characters excl. 0 byte) */
+//-------------------------------------------------------------------------------------------------------
+enum VstStringConstants
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstMaxProgNameLen = 24, ///< used for #effGetProgramName, #effSetProgramName, #effGetProgramNameIndexed
+ kVstMaxParamStrLen = 8, ///< used for #effGetParamLabel, #effGetParamDisplay, #effGetParamName
+ kVstMaxVendorStrLen = 64, ///< used for #effGetVendorString, #audioMasterGetVendorString
+ kVstMaxProductStrLen = 64, ///< used for #effGetProductString, #audioMasterGetProductString
+ kVstMaxEffectNameLen = 32 ///< used for #effGetEffectName
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** String copy taking care of null terminator. */
+//-------------------------------------------------------------------------------------------------------
+inline char* vst_strncpy (char* dst, const char* src, size_t maxLen)
+{
+ char* result = strncpy (dst, src, maxLen);
+ dst[maxLen] = 0;
+ return result;
+}
+
+//-------------------------------------------------------------------------------------------------------
+/** String concatenation taking care of null terminator. */
+//-------------------------------------------------------------------------------------------------------
+inline char* vst_strncat (char* dst, const char* src, size_t maxLen)
+{
+ char* result = strncat (dst, src, maxLen);
+ dst[maxLen] = 0;
+ return result;
+}
+
+//-------------------------------------------------------------------------------------------------------
+/** Cast #VstIntPtr to pointer. */
+//-------------------------------------------------------------------------------------------------------
+template <class T> inline T* FromVstPtr (VstIntPtr& arg)
+{
+ T** address = (T**)&arg;
+ return *address;
+}
+
+//-------------------------------------------------------------------------------------------------------
+/** Cast pointer to #VstIntPtr. */
+//-------------------------------------------------------------------------------------------------------
+template <class T> inline VstIntPtr ToVstPtr (T* ptr)
+{
+ VstIntPtr* address = (VstIntPtr*)&ptr;
+ return *address;
+}
+
+//-------------------------------------------------------------------------------------------------------
+/** Structure used for #effEditGetRect. */
+//-------------------------------------------------------------------------------------------------------
+struct ERect
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt16 top; ///< top coordinate
+ VstInt16 left; ///< left coordinate
+ VstInt16 bottom; ///< bottom coordinate
+ VstInt16 right; ///< right coordinate
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+#if TARGET_API_MAC_CARBON
+ #pragma options align=reset
+#elif defined(WIN32) || defined(__FLAT__) || defined(__GNUC__)
+ #pragma pack(pop)
+#elif defined __BORLANDC__
+ #pragma -a-
+#endif
+
+#endif // __aeffect__
diff --git a/src/deps/vst/aeffectx.h b/src/deps/vst/aeffectx.h
new file mode 100644
index 0000000..8bf7043
--- /dev/null
+++ b/src/deps/vst/aeffectx.h
@@ -0,0 +1,1143 @@
+//-------------------------------------------------------------------------------------------------------
+// VST Plug-Ins SDK
+// Version 2.4 $Date: 2006/06/20 12:43:42 $
+//
+// Category : VST 2.x Interfaces
+// Filename : aeffectx.h
+// Created by : Steinberg Media Technologies
+// Description : Definition of auxiliary structures, extensions from VST 1.0 to VST 2.4
+//
+// © 2006, Steinberg Media Technologies, All Rights Reserved
+//-------------------------------------------------------------------------------------------------------
+
+#ifndef __aeffectx__
+#define __aeffectx__
+
+#ifndef __aeffect__
+#include "aeffect.h"
+#endif
+
+//-------------------------------------------------------------------------------------------------------
+#if TARGET_API_MAC_CARBON
+ #ifdef __LP64__
+ #pragma options align=power
+ #else
+ #pragma options align=mac68k
+ #endif
+#elif defined __BORLANDC__
+ #pragma -a8
+#elif defined(__GNUC__)
+ #pragma pack(push,8)
+#elif defined(WIN32) || defined(__FLAT__)
+ #pragma pack(push)
+ #pragma pack(8)
+#endif
+//-------------------------------------------------------------------------------------------------------
+
+//-------------------------------------------------------------------------------------------------------
+/** String length limits (in characters excl. 0 byte). */
+//-------------------------------------------------------------------------------------------------------
+enum Vst2StringConstants
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstMaxNameLen = 64, ///< used for #MidiProgramName, #MidiProgramCategory, #MidiKeyName, #VstSpeakerProperties, #VstPinProperties
+ kVstMaxLabelLen = 64, ///< used for #VstParameterProperties->label, #VstPinProperties->label
+ kVstMaxShortLabelLen = 8, ///< used for #VstParameterProperties->shortLabel, #VstPinProperties->shortLabel
+ kVstMaxCategLabelLen = 24, ///< used for #VstParameterProperties->label
+ kVstMaxFileNameLen = 100 ///< used for #VstAudioFile->name
+//-------------------------------------------------------------------------------------------------------
+};
+//-------------------------------------------------------------------------------------------------------
+// VstEvent
+//-------------------------------------------------------------------------------------------------------
+//-------------------------------------------------------------------------------------------------------
+/** A generic timestamped event. */
+//-------------------------------------------------------------------------------------------------------
+struct VstEvent
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 type; ///< @see VstEventTypes
+ VstInt32 byteSize; ///< size of this event, excl. type and byteSize
+ VstInt32 deltaFrames; ///< sample frames related to the current block start sample position
+ VstInt32 flags; ///< generic flags, none defined yet
+
+ char data[16]; ///< data size may vary, depending on event type
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** VstEvent Types used by #VstEvent. */
+//-------------------------------------------------------------------------------------------------------
+enum VstEventTypes
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstMidiType = 1, ///< MIDI event @see VstMidiEvent
+ DECLARE_VST_DEPRECATED (kVstAudioType), ///< \deprecated unused event type
+ DECLARE_VST_DEPRECATED (kVstVideoType), ///< \deprecated unused event type
+ DECLARE_VST_DEPRECATED (kVstParameterType), ///< \deprecated unused event type
+ DECLARE_VST_DEPRECATED (kVstTriggerType), ///< \deprecated unused event type
+ kVstSysExType ///< MIDI system exclusive @see VstMidiSysexEvent
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** A block of events for the current processed audio block. */
+//-------------------------------------------------------------------------------------------------------
+struct VstEvents
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 numEvents; ///< number of Events in array
+ VstIntPtr reserved; ///< zero (Reserved for future use)
+ VstEvent* events[2]; ///< event pointer array, variable size
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** MIDI Event (to be casted from VstEvent). */
+//-------------------------------------------------------------------------------------------------------
+struct VstMidiEvent
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 type; ///< #kVstMidiType
+ VstInt32 byteSize; ///< sizeof (VstMidiEvent)
+ VstInt32 deltaFrames; ///< sample frames related to the current block start sample position
+ VstInt32 flags; ///< @see VstMidiEventFlags
+ VstInt32 noteLength; ///< (in sample frames) of entire note, if available, else 0
+ VstInt32 noteOffset; ///< offset (in sample frames) into note from note start if available, else 0
+ char midiData[4]; ///< 1 to 3 MIDI bytes; midiData[3] is reserved (zero)
+ char detune; ///< -64 to +63 cents; for scales other than 'well-tempered' ('microtuning')
+ char noteOffVelocity; ///< Note Off Velocity [0, 127]
+ char reserved1; ///< zero (Reserved for future use)
+ char reserved2; ///< zero (Reserved for future use)
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Flags used in #VstMidiEvent. */
+//-------------------------------------------------------------------------------------------------------
+enum VstMidiEventFlags
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstMidiEventIsRealtime = 1 << 0 ///< means that this event is played life (not in playback from a sequencer track).\n This allows the Plug-In to handle these flagged events with higher priority, especially when the Plug-In has a big latency (AEffect::initialDelay)
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** MIDI Sysex Event (to be casted from #VstEvent). */
+//-------------------------------------------------------------------------------------------------------
+struct VstMidiSysexEvent
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 type; ///< #kVstSysexType
+ VstInt32 byteSize; ///< sizeof (VstMidiSysexEvent)
+ VstInt32 deltaFrames; ///< sample frames related to the current block start sample position
+ VstInt32 flags; ///< none defined yet (should be zero)
+ VstInt32 dumpBytes; ///< byte size of sysexDump
+ VstIntPtr resvd1; ///< zero (Reserved for future use)
+ char* sysexDump; ///< sysex dump
+ VstIntPtr resvd2; ///< zero (Reserved for future use)
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+// VstTimeInfo
+//-------------------------------------------------------------------------------------------------------
+//-------------------------------------------------------------------------------------------------------
+/** VstTimeInfo requested via #audioMasterGetTime. @see AudioEffectX::getTimeInfo
+
+\note VstTimeInfo::samplePos :Current Position. It must always be valid, and should not cost a lot to ask for. The sample position is ahead of the time displayed to the user. In sequencer stop mode, its value does not change. A 32 bit integer is too small for sample positions, and it's a double to make it easier to convert between ppq and samples.
+\note VstTimeInfo::ppqPos : At tempo 120, 1 quarter makes 1/2 second, so 2.0 ppq translates to 48000 samples at 48kHz sample rate.
+.25 ppq is one sixteenth note then. if you need something like 480ppq, you simply multiply ppq by that scaler.
+\note VstTimeInfo::barStartPos : Say we're at bars/beats readout 3.3.3. That's 2 bars + 2 q + 2 sixteenth, makes 2 * 4 + 2 + .25 = 10.25 ppq. at tempo 120, that's 10.25 * .5 = 5.125 seconds, times 48000 = 246000 samples (if my calculator servers me well :-).
+\note VstTimeInfo::samplesToNextClock : MIDI Clock Resolution (24 per Quarter Note), can be negative the distance to the next midi clock (24 ppq, pulses per quarter) in samples. unless samplePos falls precicely on a midi clock, this will either be negative such that the previous MIDI clock is addressed, or positive when referencing the following (future) MIDI clock.
+*/
+//-------------------------------------------------------------------------------------------------------
+struct VstTimeInfo
+{
+//-------------------------------------------------------------------------------------------------------
+ double samplePos; ///< current Position in audio samples (always valid)
+ double sampleRate; ///< current Sample Rate in Herz (always valid)
+ double nanoSeconds; ///< System Time in nanoseconds (10^-9 second)
+ double ppqPos; ///< Musical Position, in Quarter Note (1.0 equals 1 Quarter Note)
+ double tempo; ///< current Tempo in BPM (Beats Per Minute)
+ double barStartPos; ///< last Bar Start Position, in Quarter Note
+ double cycleStartPos; ///< Cycle Start (left locator), in Quarter Note
+ double cycleEndPos; ///< Cycle End (right locator), in Quarter Note
+ VstInt32 timeSigNumerator; ///< Time Signature Numerator (e.g. 3 for 3/4)
+ VstInt32 timeSigDenominator; ///< Time Signature Denominator (e.g. 4 for 3/4)
+ VstInt32 smpteOffset; ///< SMPTE offset (in SMPTE subframes (bits; 1/80 of a frame)). The current SMPTE position can be calculated using #samplePos, #sampleRate, and #smpteFrameRate.
+ VstInt32 smpteFrameRate; ///< @see VstSmpteFrameRate
+ VstInt32 samplesToNextClock; ///< MIDI Clock Resolution (24 Per Quarter Note), can be negative (nearest clock)
+ VstInt32 flags; ///< @see VstTimeInfoFlags
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Flags used in #VstTimeInfo. */
+//-------------------------------------------------------------------------------------------------------
+enum VstTimeInfoFlags
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstTransportChanged = 1, ///< indicates that play, cycle or record state has changed
+ kVstTransportPlaying = 1 << 1, ///< set if Host sequencer is currently playing
+ kVstTransportCycleActive = 1 << 2, ///< set if Host sequencer is in cycle mode
+ kVstTransportRecording = 1 << 3, ///< set if Host sequencer is in record mode
+ kVstAutomationWriting = 1 << 6, ///< set if automation write mode active (record parameter changes)
+ kVstAutomationReading = 1 << 7, ///< set if automation read mode active (play parameter changes)
+ kVstNanosValid = 1 << 8, ///< VstTimeInfo::nanoSeconds valid
+ kVstPpqPosValid = 1 << 9, ///< VstTimeInfo::ppqPos valid
+ kVstTempoValid = 1 << 10, ///< VstTimeInfo::tempo valid
+ kVstBarsValid = 1 << 11, ///< VstTimeInfo::barStartPos valid
+ kVstCyclePosValid = 1 << 12, ///< VstTimeInfo::cycleStartPos and VstTimeInfo::cycleEndPos valid
+ kVstTimeSigValid = 1 << 13, ///< VstTimeInfo::timeSigNumerator and VstTimeInfo::timeSigDenominator valid
+ kVstSmpteValid = 1 << 14, ///< VstTimeInfo::smpteOffset and VstTimeInfo::smpteFrameRate valid
+ kVstClockValid = 1 << 15 ///< VstTimeInfo::samplesToNextClock valid
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** SMPTE Frame Rates. */
+//-------------------------------------------------------------------------------------------------------
+enum VstSmpteFrameRate
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstSmpte24fps = 0, ///< 24 fps
+ kVstSmpte25fps = 1, ///< 25 fps
+ kVstSmpte2997fps = 2, ///< 29.97 fps
+ kVstSmpte30fps = 3, ///< 30 fps
+ kVstSmpte2997dfps = 4, ///< 29.97 drop
+ kVstSmpte30dfps = 5, ///< 30 drop
+
+ kVstSmpteFilm16mm = 6, ///< Film 16mm
+ kVstSmpteFilm35mm = 7, ///< Film 35mm
+ kVstSmpte239fps = 10, ///< HDTV: 23.976 fps
+ kVstSmpte249fps = 11, ///< HDTV: 24.976 fps
+ kVstSmpte599fps = 12, ///< HDTV: 59.94 fps
+ kVstSmpte60fps = 13 ///< HDTV: 60 fps
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Variable IO for Offline Processing. */
+//-------------------------------------------------------------------------------------------------------
+struct VstVariableIo
+{
+//-------------------------------------------------------------------------------------------------------
+ float** inputs; ///< input audio buffers
+ float** outputs; ///< output audio buffers
+ VstInt32 numSamplesInput; ///< number of incoming samples
+ VstInt32 numSamplesOutput; ///< number of outgoing samples
+ VstInt32* numSamplesInputProcessed; ///< number of samples actually processed of input
+ VstInt32* numSamplesOutputProcessed; ///< number of samples actually processed of output
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Language code returned by audioMasterGetLanguage. */
+//-------------------------------------------------------------------------------------------------------
+enum VstHostLanguage
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstLangEnglish = 1, ///< English
+ kVstLangGerman, ///< German
+ kVstLangFrench, ///< French
+ kVstLangItalian, ///< Italian
+ kVstLangSpanish, ///< Spanish
+ kVstLangJapanese ///< Japanese
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** VST 2.x dispatcher Opcodes (Plug-in to Host). Extension of #AudioMasterOpcodes */
+//-------------------------------------------------------------------------------------------------------
+enum AudioMasterOpcodesX
+{
+//-------------------------------------------------------------------------------------------------------
+ DECLARE_VST_DEPRECATED (audioMasterWantMidi) = DECLARE_VST_DEPRECATED (audioMasterPinConnected) + 2, ///< \deprecated deprecated in VST 2.4
+
+ audioMasterGetTime, ///< [return value]: #VstTimeInfo* or null if not supported [value]: request mask @see VstTimeInfoFlags @see AudioEffectX::getTimeInfo
+ audioMasterProcessEvents, ///< [ptr]: pointer to #VstEvents @see VstEvents @see AudioEffectX::sendVstEventsToHost
+
+ DECLARE_VST_DEPRECATED (audioMasterSetTime), ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (audioMasterTempoAt), ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (audioMasterGetNumAutomatableParameters), ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (audioMasterGetParameterQuantization), ///< \deprecated deprecated in VST 2.4
+
+ audioMasterIOChanged, ///< [return value]: 1 if supported @see AudioEffectX::ioChanged
+
+ DECLARE_VST_DEPRECATED (audioMasterNeedIdle), ///< \deprecated deprecated in VST 2.4
+
+ audioMasterSizeWindow, ///< [index]: new width [value]: new height [return value]: 1 if supported @see AudioEffectX::sizeWindow
+ audioMasterGetSampleRate, ///< [return value]: current sample rate @see AudioEffectX::updateSampleRate
+ audioMasterGetBlockSize, ///< [return value]: current block size @see AudioEffectX::updateBlockSize
+ audioMasterGetInputLatency, ///< [return value]: input latency in audio samples @see AudioEffectX::getInputLatency
+ audioMasterGetOutputLatency, ///< [return value]: output latency in audio samples @see AudioEffectX::getOutputLatency
+
+ DECLARE_VST_DEPRECATED (audioMasterGetPreviousPlug), ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (audioMasterGetNextPlug), ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (audioMasterWillReplaceOrAccumulate), ///< \deprecated deprecated in VST 2.4
+
+ audioMasterGetCurrentProcessLevel, ///< [return value]: current process level @see VstProcessLevels
+ audioMasterGetAutomationState, ///< [return value]: current automation state @see VstAutomationStates
+
+ audioMasterOfflineStart, ///< [index]: numNewAudioFiles [value]: numAudioFiles [ptr]: #VstAudioFile* @see AudioEffectX::offlineStart
+ audioMasterOfflineRead, ///< [index]: bool readSource [value]: #VstOfflineOption* @see VstOfflineOption [ptr]: #VstOfflineTask* @see VstOfflineTask @see AudioEffectX::offlineRead
+ audioMasterOfflineWrite, ///< @see audioMasterOfflineRead @see AudioEffectX::offlineRead
+ audioMasterOfflineGetCurrentPass, ///< @see AudioEffectX::offlineGetCurrentPass
+ audioMasterOfflineGetCurrentMetaPass, ///< @see AudioEffectX::offlineGetCurrentMetaPass
+
+ DECLARE_VST_DEPRECATED (audioMasterSetOutputSampleRate), ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (audioMasterGetOutputSpeakerArrangement), ///< \deprecated deprecated in VST 2.4
+
+ audioMasterGetVendorString, ///< [ptr]: char buffer for vendor string, limited to #kVstMaxVendorStrLen @see AudioEffectX::getHostVendorString
+ audioMasterGetProductString, ///< [ptr]: char buffer for vendor string, limited to #kVstMaxProductStrLen @see AudioEffectX::getHostProductString
+ audioMasterGetVendorVersion, ///< [return value]: vendor-specific version @see AudioEffectX::getHostVendorVersion
+ audioMasterVendorSpecific, ///< no definition, vendor specific handling @see AudioEffectX::hostVendorSpecific
+
+ DECLARE_VST_DEPRECATED (audioMasterSetIcon), ///< \deprecated deprecated in VST 2.4
+
+ audioMasterCanDo, ///< [ptr]: "can do" string [return value]: 1 for supported
+ audioMasterGetLanguage, ///< [return value]: language code @see VstHostLanguage
+
+ DECLARE_VST_DEPRECATED (audioMasterOpenWindow), ///< \deprecated deprecated in VST 2.4
+ DECLARE_VST_DEPRECATED (audioMasterCloseWindow), ///< \deprecated deprecated in VST 2.4
+
+ audioMasterGetDirectory, ///< [return value]: FSSpec on MAC, else char* @see AudioEffectX::getDirectory
+ audioMasterUpdateDisplay, ///< no arguments
+ audioMasterBeginEdit, ///< [index]: parameter index @see AudioEffectX::beginEdit
+ audioMasterEndEdit, ///< [index]: parameter index @see AudioEffectX::endEdit
+ audioMasterOpenFileSelector, ///< [ptr]: VstFileSelect* [return value]: 1 if supported @see AudioEffectX::openFileSelector
+ audioMasterCloseFileSelector, ///< [ptr]: VstFileSelect* @see AudioEffectX::closeFileSelector
+
+ DECLARE_VST_DEPRECATED (audioMasterEditFile), ///< \deprecated deprecated in VST 2.4
+
+ DECLARE_VST_DEPRECATED (audioMasterGetChunkFile), ///< \deprecated deprecated in VST 2.4 [ptr]: char[2048] or sizeof (FSSpec) [return value]: 1 if supported @see AudioEffectX::getChunkFile
+
+ DECLARE_VST_DEPRECATED (audioMasterGetInputSpeakerArrangement) ///< \deprecated deprecated in VST 2.4
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** VST 2.x dispatcher Opcodes (Host to Plug-in). Extension of #AEffectOpcodes */
+//-------------------------------------------------------------------------------------------------------
+enum AEffectXOpcodes
+{
+//-------------------------------------------------------------------------------------------------------
+ effProcessEvents = effSetChunk + 1 ///< [ptr]: #VstEvents* @see AudioEffectX::processEvents
+
+ , effCanBeAutomated ///< [index]: parameter index [return value]: 1=true, 0=false @see AudioEffectX::canParameterBeAutomated
+ , effString2Parameter ///< [index]: parameter index [ptr]: parameter string [return value]: true for success @see AudioEffectX::string2parameter
+
+ , DECLARE_VST_DEPRECATED (effGetNumProgramCategories) ///< \deprecated deprecated in VST 2.4
+
+ , effGetProgramNameIndexed ///< [index]: program index [ptr]: buffer for program name, limited to #kVstMaxProgNameLen [return value]: true for success @see AudioEffectX::getProgramNameIndexed
+
+ , DECLARE_VST_DEPRECATED (effCopyProgram) ///< \deprecated deprecated in VST 2.4
+ , DECLARE_VST_DEPRECATED (effConnectInput) ///< \deprecated deprecated in VST 2.4
+ , DECLARE_VST_DEPRECATED (effConnectOutput) ///< \deprecated deprecated in VST 2.4
+
+ , effGetInputProperties ///< [index]: input index [ptr]: #VstPinProperties* [return value]: 1 if supported @see AudioEffectX::getInputProperties
+ , effGetOutputProperties ///< [index]: output index [ptr]: #VstPinProperties* [return value]: 1 if supported @see AudioEffectX::getOutputProperties
+ , effGetPlugCategory ///< [return value]: category @see VstPlugCategory @see AudioEffectX::getPlugCategory
+
+ , DECLARE_VST_DEPRECATED (effGetCurrentPosition) ///< \deprecated deprecated in VST 2.4
+ , DECLARE_VST_DEPRECATED (effGetDestinationBuffer) ///< \deprecated deprecated in VST 2.4
+
+ , effOfflineNotify ///< [ptr]: #VstAudioFile array [value]: count [index]: start flag @see AudioEffectX::offlineNotify
+ , effOfflinePrepare ///< [ptr]: #VstOfflineTask array [value]: count @see AudioEffectX::offlinePrepare
+ , effOfflineRun ///< [ptr]: #VstOfflineTask array [value]: count @see AudioEffectX::offlineRun
+
+ , effProcessVarIo ///< [ptr]: #VstVariableIo* @see AudioEffectX::processVariableIo
+ , effSetSpeakerArrangement ///< [value]: input #VstSpeakerArrangement* [ptr]: output #VstSpeakerArrangement* @see AudioEffectX::setSpeakerArrangement
+
+ , DECLARE_VST_DEPRECATED (effSetBlockSizeAndSampleRate) ///< \deprecated deprecated in VST 2.4
+
+ , effSetBypass ///< [value]: 1 = bypass, 0 = no bypass @see AudioEffectX::setBypass
+ , effGetEffectName ///< [ptr]: buffer for effect name, limited to #kVstMaxEffectNameLen @see AudioEffectX::getEffectName
+
+ , DECLARE_VST_DEPRECATED (effGetErrorText) ///< \deprecated deprecated in VST 2.4
+
+ , effGetVendorString ///< [ptr]: buffer for effect vendor string, limited to #kVstMaxVendorStrLen @see AudioEffectX::getVendorString
+ , effGetProductString ///< [ptr]: buffer for effect vendor string, limited to #kVstMaxProductStrLen @see AudioEffectX::getProductString
+ , effGetVendorVersion ///< [return value]: vendor-specific version @see AudioEffectX::getVendorVersion
+ , effVendorSpecific ///< no definition, vendor specific handling @see AudioEffectX::vendorSpecific
+ , effCanDo ///< [ptr]: "can do" string [return value]: 0: "don't know" -1: "no" 1: "yes" @see AudioEffectX::canDo
+ , effGetTailSize ///< [return value]: tail size (for example the reverb time of a reverb plug-in); 0 is default (return 1 for 'no tail')
+
+ , DECLARE_VST_DEPRECATED (effIdle) ///< \deprecated deprecated in VST 2.4
+ , DECLARE_VST_DEPRECATED (effGetIcon) ///< \deprecated deprecated in VST 2.4
+ , DECLARE_VST_DEPRECATED (effSetViewPosition) ///< \deprecated deprecated in VST 2.4
+
+ , effGetParameterProperties ///< [index]: parameter index [ptr]: #VstParameterProperties* [return value]: 1 if supported @see AudioEffectX::getParameterProperties
+
+ , DECLARE_VST_DEPRECATED (effKeysRequired) ///< \deprecated deprecated in VST 2.4
+
+ , effGetVstVersion ///< [return value]: VST version @see AudioEffectX::getVstVersion
+
+#if VST_2_1_EXTENSIONS
+ , effEditKeyDown ///< [index]: ASCII character [value]: virtual key [opt]: modifiers [return value]: 1 if key used @see AEffEditor::onKeyDown
+ , effEditKeyUp ///< [index]: ASCII character [value]: virtual key [opt]: modifiers [return value]: 1 if key used @see AEffEditor::onKeyUp
+ , effSetEditKnobMode ///< [value]: knob mode 0: circular, 1: circular relativ, 2: linear (CKnobMode in VSTGUI) @see AEffEditor::setKnobMode
+
+ , effGetMidiProgramName ///< [index]: MIDI channel [ptr]: #MidiProgramName* [return value]: number of used programs, 0 if unsupported @see AudioEffectX::getMidiProgramName
+ , effGetCurrentMidiProgram ///< [index]: MIDI channel [ptr]: #MidiProgramName* [return value]: index of current program @see AudioEffectX::getCurrentMidiProgram
+ , effGetMidiProgramCategory ///< [index]: MIDI channel [ptr]: #MidiProgramCategory* [return value]: number of used categories, 0 if unsupported @see AudioEffectX::getMidiProgramCategory
+ , effHasMidiProgramsChanged ///< [index]: MIDI channel [return value]: 1 if the #MidiProgramName(s) or #MidiKeyName(s) have changed @see AudioEffectX::hasMidiProgramsChanged
+ , effGetMidiKeyName ///< [index]: MIDI channel [ptr]: #MidiKeyName* [return value]: true if supported, false otherwise @see AudioEffectX::getMidiKeyName
+
+ , effBeginSetProgram ///< no arguments @see AudioEffectX::beginSetProgram
+ , effEndSetProgram ///< no arguments @see AudioEffectX::endSetProgram
+#endif // VST_2_1_EXTENSIONS
+
+#if VST_2_3_EXTENSIONS
+ , effGetSpeakerArrangement ///< [value]: input #VstSpeakerArrangement* [ptr]: output #VstSpeakerArrangement* @see AudioEffectX::getSpeakerArrangement
+ , effShellGetNextPlugin ///< [ptr]: buffer for plug-in name, limited to #kVstMaxProductStrLen [return value]: next plugin's uniqueID @see AudioEffectX::getNextShellPlugin
+
+ , effStartProcess ///< no arguments @see AudioEffectX::startProcess
+ , effStopProcess ///< no arguments @see AudioEffectX::stopProcess
+ , effSetTotalSampleToProcess ///< [value]: number of samples to process, offline only! @see AudioEffectX::setTotalSampleToProcess
+ , effSetPanLaw ///< [value]: pan law [opt]: gain @see VstPanLawType @see AudioEffectX::setPanLaw
+
+ , effBeginLoadBank ///< [ptr]: #VstPatchChunkInfo* [return value]: -1: bank can't be loaded, 1: bank can be loaded, 0: unsupported @see AudioEffectX::beginLoadBank
+ , effBeginLoadProgram ///< [ptr]: #VstPatchChunkInfo* [return value]: -1: prog can't be loaded, 1: prog can be loaded, 0: unsupported @see AudioEffectX::beginLoadProgram
+#endif // VST_2_3_EXTENSIONS
+
+#if VST_2_4_EXTENSIONS
+ , effSetProcessPrecision ///< [value]: @see VstProcessPrecision @see AudioEffectX::setProcessPrecision
+ , effGetNumMidiInputChannels ///< [return value]: number of used MIDI input channels (1-15) @see AudioEffectX::getNumMidiInputChannels
+ , effGetNumMidiOutputChannels ///< [return value]: number of used MIDI output channels (1-15) @see AudioEffectX::getNumMidiOutputChannels
+#endif // VST_2_4_EXTENSIONS
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Symbolic precision constants used for effSetProcessPrecision. */
+//-------------------------------------------------------------------------------------------------------
+enum VstProcessPrecision
+{
+ kVstProcessPrecision32 = 0, ///< single precision float (32bits)
+ kVstProcessPrecision64 ///< double precision (64bits)
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Parameter Properties used in #effGetParameterProperties. */
+//-------------------------------------------------------------------------------------------------------
+struct VstParameterProperties
+{
+//-------------------------------------------------------------------------------------------------------
+ float stepFloat; ///< float step
+ float smallStepFloat; ///< small float step
+ float largeStepFloat; ///< large float step
+ char label[kVstMaxLabelLen];///< parameter label
+ VstInt32 flags; ///< @see VstParameterFlags
+ VstInt32 minInteger; ///< integer minimum
+ VstInt32 maxInteger; ///< integer maximum
+ VstInt32 stepInteger; ///< integer step
+ VstInt32 largeStepInteger; ///< large integer step
+ char shortLabel[kVstMaxShortLabelLen]; ///< short label, recommended: 6 + delimiter
+
+ // The following are for remote controller display purposes.
+ // Note that the kVstParameterSupportsDisplayIndex flag must be set.
+ // Host can scan all parameters, and find out in what order
+ // to display them:
+
+ VstInt16 displayIndex; ///< index where this parameter should be displayed (starting with 0)
+
+ // Host can also possibly display the parameter group (category), such as...
+ // ---------------------------
+ // Osc 1
+ // Wave Detune Octave Mod
+ // ---------------------------
+ // ...if the plug-in supports it (flag #kVstParameterSupportsDisplayCategory)
+
+ VstInt16 category; ///< 0: no category, else group index + 1
+ VstInt16 numParametersInCategory; ///< number of parameters in category
+ VstInt16 reserved; ///< zero
+ char categoryLabel[kVstMaxCategLabelLen]; ///< category label, e.g. "Osc 1"
+
+ char future[16]; ///< reserved for future use
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Flags used in #VstParameterProperties. */
+//-------------------------------------------------------------------------------------------------------
+enum VstParameterFlags
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstParameterIsSwitch = 1 << 0, ///< parameter is a switch (on/off)
+ kVstParameterUsesIntegerMinMax = 1 << 1, ///< minInteger, maxInteger valid
+ kVstParameterUsesFloatStep = 1 << 2, ///< stepFloat, smallStepFloat, largeStepFloat valid
+ kVstParameterUsesIntStep = 1 << 3, ///< stepInteger, largeStepInteger valid
+ kVstParameterSupportsDisplayIndex = 1 << 4, ///< displayIndex valid
+ kVstParameterSupportsDisplayCategory = 1 << 5, ///< category, etc. valid
+ kVstParameterCanRamp = 1 << 6 ///< set if parameter value can ramp up/down
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Pin Properties used in #effGetInputProperties and #effGetOutputProperties. */
+//-------------------------------------------------------------------------------------------------------
+struct VstPinProperties
+{
+//-------------------------------------------------------------------------------------------------------
+ char label[kVstMaxLabelLen]; ///< pin name
+ VstInt32 flags; ///< @see VstPinPropertiesFlags
+ VstInt32 arrangementType; ///< @see VstSpeakerArrangementType
+ char shortLabel[kVstMaxShortLabelLen]; ///< short name (recommended: 6 + delimiter)
+
+ char future[48]; ///< reserved for future use
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Flags used in #VstPinProperties. */
+//-------------------------------------------------------------------------------------------------------
+enum VstPinPropertiesFlags
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstPinIsActive = 1 << 0, ///< pin is active, ignored by Host
+ kVstPinIsStereo = 1 << 1, ///< pin is first of a stereo pair
+ kVstPinUseSpeaker = 1 << 2 ///< #VstPinProperties::arrangementType is valid and can be used to get the wanted arrangement
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Plug-in Categories. */
+//-------------------------------------------------------------------------------------------------------
+enum VstPlugCategory
+{
+//-------------------------------------------------------------------------------------------------------
+ kPlugCategUnknown = 0, ///< Unknown, category not implemented
+ kPlugCategEffect, ///< Simple Effect
+ kPlugCategSynth, ///< VST Instrument (Synths, samplers,...)
+ kPlugCategAnalysis, ///< Scope, Tuner, ...
+ kPlugCategMastering, ///< Dynamics, ...
+ kPlugCategSpacializer, ///< Panners, ...
+ kPlugCategRoomFx, ///< Delays and Reverbs
+ kPlugSurroundFx, ///< Dedicated surround processor
+ kPlugCategRestoration, ///< Denoiser, ...
+ kPlugCategOfflineProcess, ///< Offline Process
+ kPlugCategShell, ///< Plug-in is container of other plug-ins @see effShellGetNextPlugin
+ kPlugCategGenerator, ///< ToneGenerator, ...
+
+ kPlugCategMaxCount ///< Marker to count the categories
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+// MIDI Programs
+//-------------------------------------------------------------------------------------------------------
+//-------------------------------------------------------------------------------------------------------
+/** MIDI Program Description. */
+//-------------------------------------------------------------------------------------------------------
+struct MidiProgramName
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 thisProgramIndex; ///< 0 or greater: fill struct for this program index
+ char name[kVstMaxNameLen]; ///< program name
+ char midiProgram; ///< -1:off, 0-127
+ char midiBankMsb; ///< -1:off, 0-127
+ char midiBankLsb; ///< -1:off, 0-127
+ char reserved; ///< zero
+ VstInt32 parentCategoryIndex; ///< -1:no parent category
+ VstInt32 flags; ///< omni etc. @see VstMidiProgramNameFlags
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Flags used in MidiProgramName. */
+//-------------------------------------------------------------------------------------------------------
+enum VstMidiProgramNameFlags
+{
+//-------------------------------------------------------------------------------------------------------
+ kMidiIsOmni = 1 ///< default is multi. for omni mode, channel 0 is used for inquiries and program changes
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** MIDI Program Category. */
+//-------------------------------------------------------------------------------------------------------
+struct MidiProgramCategory
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 thisCategoryIndex; ///< 0 or greater: fill struct for this category index.
+ char name[kVstMaxNameLen]; ///< name
+ VstInt32 parentCategoryIndex; ///< -1:no parent category
+ VstInt32 flags; ///< reserved, none defined yet, zero.
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** MIDI Key Description. */
+//-------------------------------------------------------------------------------------------------------
+struct MidiKeyName
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 thisProgramIndex; ///< 0 or greater: fill struct for this program index.
+ VstInt32 thisKeyNumber; ///< 0 - 127. fill struct for this key number.
+ char keyName[kVstMaxNameLen]; ///< key name, empty means regular key names
+ VstInt32 reserved; ///< zero
+ VstInt32 flags; ///< reserved, none defined yet, zero.
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+// Surround Setup
+//-------------------------------------------------------------------------------------------------------
+//-------------------------------------------------------------------------------------------------------
+/** Speaker Properties.
+ The origin for azimuth is right (as by math conventions dealing with radians).
+ The elevation origin is also right, visualizing a rotation of a circle across the
+ -pi/pi axis of the horizontal circle. Thus, an elevation of -pi/2 corresponds
+ to bottom, and a speaker standing on the left, and 'beaming' upwards would have
+ an azimuth of -pi, and an elevation of pi/2.
+ For user interface representation, grads are more likely to be used, and the
+ origins will obviously 'shift' accordingly. */
+//-------------------------------------------------------------------------------------------------------
+struct VstSpeakerProperties
+{
+//-------------------------------------------------------------------------------------------------------
+ float azimuth; ///< unit: rad, range: -PI...PI, exception: 10.f for LFE channel
+ float elevation; ///< unit: rad, range: -PI/2...PI/2, exception: 10.f for LFE channel
+ float radius; ///< unit: meter, exception: 0.f for LFE channel
+ float reserved; ///< zero (reserved for future use)
+ char name[kVstMaxNameLen]; ///< for new setups, new names should be given (L/R/C... won't do)
+ VstInt32 type; ///< @see VstSpeakerType
+
+ char future[28]; ///< reserved for future use
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Speaker Arrangement. */
+//-------------------------------------------------------------------------------------------------------
+struct VstSpeakerArrangement
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 type; ///< e.g. #kSpeakerArr51 for 5.1 @see VstSpeakerArrangementType
+ VstInt32 numChannels; ///< number of channels in this speaker arrangement
+ VstSpeakerProperties speakers[8]; ///< variable sized speaker array
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Speaker Types. */
+//-------------------------------------------------------------------------------------------------------
+enum VstSpeakerType
+{
+//-------------------------------------------------------------------------------------------------------
+ kSpeakerUndefined = 0x7fffffff, ///< Undefined
+ kSpeakerM = 0, ///< Mono (M)
+ kSpeakerL, ///< Left (L)
+ kSpeakerR, ///< Right (R)
+ kSpeakerC, ///< Center (C)
+ kSpeakerLfe, ///< Subbass (Lfe)
+ kSpeakerLs, ///< Left Surround (Ls)
+ kSpeakerRs, ///< Right Surround (Rs)
+ kSpeakerLc, ///< Left of Center (Lc)
+ kSpeakerRc, ///< Right of Center (Rc)
+ kSpeakerS, ///< Surround (S)
+ kSpeakerCs = kSpeakerS, ///< Center of Surround (Cs) = Surround (S)
+ kSpeakerSl, ///< Side Left (Sl)
+ kSpeakerSr, ///< Side Right (Sr)
+ kSpeakerTm, ///< Top Middle (Tm)
+ kSpeakerTfl, ///< Top Front Left (Tfl)
+ kSpeakerTfc, ///< Top Front Center (Tfc)
+ kSpeakerTfr, ///< Top Front Right (Tfr)
+ kSpeakerTrl, ///< Top Rear Left (Trl)
+ kSpeakerTrc, ///< Top Rear Center (Trc)
+ kSpeakerTrr, ///< Top Rear Right (Trr)
+ kSpeakerLfe2 ///< Subbass 2 (Lfe2)
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** User-defined speaker types, to be extended in the negative range.
+ Will be handled as their corresponding speaker types with abs values:
+ e.g abs(#kSpeakerU1) == #kSpeakerL, abs(#kSpeakerU2) == #kSpeakerR) */
+//-------------------------------------------------------------------------------------------------------
+enum VstUserSpeakerType
+{
+//-------------------------------------------------------------------------------------------------------
+ kSpeakerU32 = -32,
+ kSpeakerU31,
+ kSpeakerU30,
+ kSpeakerU29,
+ kSpeakerU28,
+ kSpeakerU27,
+ kSpeakerU26,
+ kSpeakerU25,
+ kSpeakerU24,
+ kSpeakerU23,
+ kSpeakerU22,
+ kSpeakerU21,
+ kSpeakerU20, ///< == #kSpeakerLfe2
+ kSpeakerU19, ///< == #kSpeakerTrr
+ kSpeakerU18, ///< == #kSpeakerTrc
+ kSpeakerU17, ///< == #kSpeakerTrl
+ kSpeakerU16, ///< == #kSpeakerTfr
+ kSpeakerU15, ///< == #kSpeakerTfc
+ kSpeakerU14, ///< == #kSpeakerTfl
+ kSpeakerU13, ///< == #kSpeakerTm
+ kSpeakerU12, ///< == #kSpeakerSr
+ kSpeakerU11, ///< == #kSpeakerSl
+ kSpeakerU10, ///< == #kSpeakerCs
+ kSpeakerU9, ///< == #kSpeakerS
+ kSpeakerU8, ///< == #kSpeakerRc
+ kSpeakerU7, ///< == #kSpeakerLc
+ kSpeakerU6, ///< == #kSpeakerRs
+ kSpeakerU5, ///< == #kSpeakerLs
+ kSpeakerU4, ///< == #kSpeakerLfe
+ kSpeakerU3, ///< == #kSpeakerC
+ kSpeakerU2, ///< == #kSpeakerR
+ kSpeakerU1 ///< == #kSpeakerL
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Speaker Arrangement Types*/
+//-------------------------------------------------------------------------------------------------------
+enum VstSpeakerArrangementType
+{
+//-------------------------------------------------------------------------------------------------------
+ kSpeakerArrUserDefined = -2,///< user defined
+ kSpeakerArrEmpty = -1, ///< empty arrangement
+ kSpeakerArrMono = 0, ///< M
+ kSpeakerArrStereo, ///< L R
+ kSpeakerArrStereoSurround, ///< Ls Rs
+ kSpeakerArrStereoCenter, ///< Lc Rc
+ kSpeakerArrStereoSide, ///< Sl Sr
+ kSpeakerArrStereoCLfe, ///< C Lfe
+ kSpeakerArr30Cine, ///< L R C
+ kSpeakerArr30Music, ///< L R S
+ kSpeakerArr31Cine, ///< L R C Lfe
+ kSpeakerArr31Music, ///< L R Lfe S
+ kSpeakerArr40Cine, ///< L R C S (LCRS)
+ kSpeakerArr40Music, ///< L R Ls Rs (Quadro)
+ kSpeakerArr41Cine, ///< L R C Lfe S (LCRS+Lfe)
+ kSpeakerArr41Music, ///< L R Lfe Ls Rs (Quadro+Lfe)
+ kSpeakerArr50, ///< L R C Ls Rs
+ kSpeakerArr51, ///< L R C Lfe Ls Rs
+ kSpeakerArr60Cine, ///< L R C Ls Rs Cs
+ kSpeakerArr60Music, ///< L R Ls Rs Sl Sr
+ kSpeakerArr61Cine, ///< L R C Lfe Ls Rs Cs
+ kSpeakerArr61Music, ///< L R Lfe Ls Rs Sl Sr
+ kSpeakerArr70Cine, ///< L R C Ls Rs Lc Rc
+ kSpeakerArr70Music, ///< L R C Ls Rs Sl Sr
+ kSpeakerArr71Cine, ///< L R C Lfe Ls Rs Lc Rc
+ kSpeakerArr71Music, ///< L R C Lfe Ls Rs Sl Sr
+ kSpeakerArr80Cine, ///< L R C Ls Rs Lc Rc Cs
+ kSpeakerArr80Music, ///< L R C Ls Rs Cs Sl Sr
+ kSpeakerArr81Cine, ///< L R C Lfe Ls Rs Lc Rc Cs
+ kSpeakerArr81Music, ///< L R C Lfe Ls Rs Cs Sl Sr
+ kSpeakerArr102, ///< L R C Lfe Ls Rs Tfl Tfc Tfr Trl Trr Lfe2
+ kNumSpeakerArr
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+// Offline Processing
+//-------------------------------------------------------------------------------------------------------
+//-------------------------------------------------------------------------------------------------------
+/** Offline Task Description. */
+//-------------------------------------------------------------------------------------------------------
+struct VstOfflineTask
+{
+//-------------------------------------------------------------------------------------------------------
+ char processName[96]; ///< set by plug-in
+
+ // audio access
+ double readPosition; ///< set by plug-in/Host
+ double writePosition; ///< set by plug-in/Host
+ VstInt32 readCount; ///< set by plug-in/Host
+ VstInt32 writeCount; ///< set by plug-in
+ VstInt32 sizeInputBuffer; ///< set by Host
+ VstInt32 sizeOutputBuffer; ///< set by Host
+ void* inputBuffer; ///< set by Host
+ void* outputBuffer; ///< set by Host
+ double positionToProcessFrom; ///< set by Host
+ double numFramesToProcess; ///< set by Host
+ double maxFramesToWrite; ///< set by plug-in
+
+ // other data access
+ void* extraBuffer; ///< set by plug-in
+ VstInt32 value; ///< set by Host or plug-in
+ VstInt32 index; ///< set by Host or plug-in
+
+ // file attributes
+ double numFramesInSourceFile; ///< set by Host
+ double sourceSampleRate; ///< set by Host or plug-in
+ double destinationSampleRate; ///< set by Host or plug-in
+ VstInt32 numSourceChannels; ///< set by Host or plug-in
+ VstInt32 numDestinationChannels;///< set by Host or plug-in
+ VstInt32 sourceFormat; ///< set by Host
+ VstInt32 destinationFormat; ///< set by plug-in
+ char outputText[512]; ///< set by plug-in or Host
+
+ // progress notification
+ double progress; ///< set by plug-in
+ VstInt32 progressMode; ///< Reserved for future use
+ char progressText[100]; ///< set by plug-in
+
+ VstInt32 flags; ///< set by Host and plug-in; see enum #VstOfflineTaskFlags
+ VstInt32 returnValue; ///< Reserved for future use
+ void* hostOwned; ///< set by Host
+ void* plugOwned; ///< set by plug-in
+
+ char future[1024]; ///< Reserved for future use
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Flags used in #VstOfflineTask. */
+//-------------------------------------------------------------------------------------------------------
+enum VstOfflineTaskFlags
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstOfflineUnvalidParameter = 1 << 0, ///< set by Host
+ kVstOfflineNewFile = 1 << 1, ///< set by Host
+
+ kVstOfflinePlugError = 1 << 10, ///< set by plug-in
+ kVstOfflineInterleavedAudio = 1 << 11, ///< set by plug-in
+ kVstOfflineTempOutputFile = 1 << 12, ///< set by plug-in
+ kVstOfflineFloatOutputFile = 1 << 13, ///< set by plug-in
+ kVstOfflineRandomWrite = 1 << 14, ///< set by plug-in
+ kVstOfflineStretch = 1 << 15, ///< set by plug-in
+ kVstOfflineNoThread = 1 << 16 ///< set by plug-in
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Option passed to #offlineRead/#offlineWrite. */
+//-------------------------------------------------------------------------------------------------------
+enum VstOfflineOption
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstOfflineAudio, ///< reading/writing audio samples
+ kVstOfflinePeaks, ///< reading graphic representation
+ kVstOfflineParameter, ///< reading/writing parameters
+ kVstOfflineMarker, ///< reading/writing marker
+ kVstOfflineCursor, ///< reading/moving edit cursor
+ kVstOfflineSelection, ///< reading/changing selection
+ kVstOfflineQueryFiles ///< to request the Host to call asynchronously #offlineNotify
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Structure passed to #offlineNotify and #offlineStart */
+//-------------------------------------------------------------------------------------------------------
+struct VstAudioFile
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 flags; ///< see enum #VstAudioFileFlags
+ void* hostOwned; ///< any data private to Host
+ void* plugOwned; ///< any data private to plug-in
+ char name[kVstMaxFileNameLen]; ///< file title
+ VstInt32 uniqueId; ///< uniquely identify a file during a session
+ double sampleRate; ///< file sample rate
+ VstInt32 numChannels; ///< number of channels (1 for mono, 2 for stereo...)
+ double numFrames; ///< number of frames in the audio file
+ VstInt32 format; ///< Reserved for future use
+ double editCursorPosition; ///< -1 if no such cursor
+ double selectionStart; ///< frame index of first selected frame, or -1
+ double selectionSize; ///< number of frames in selection, or 0
+ VstInt32 selectedChannelsMask; ///< 1 bit per channel
+ VstInt32 numMarkers; ///< number of markers in the file
+ VstInt32 timeRulerUnit; ///< see doc for possible values
+ double timeRulerOffset; ///< offset in time ruler (positive or negative)
+ double tempo; ///< as BPM (Beats Per Minute)
+ VstInt32 timeSigNumerator; ///< time signature numerator
+ VstInt32 timeSigDenominator; ///< time signature denominator
+ VstInt32 ticksPerBlackNote; ///< resolution
+ VstInt32 smpteFrameRate; ///< SMPTE rate (set as in #VstTimeInfo)
+
+ char future[64]; ///< Reserved for future use
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Flags used in #VstAudioFile. */
+//-------------------------------------------------------------------------------------------------------
+enum VstAudioFileFlags
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstOfflineReadOnly = 1 << 0, ///< set by Host (in call #offlineNotify)
+ kVstOfflineNoRateConversion = 1 << 1, ///< set by Host (in call #offlineNotify)
+ kVstOfflineNoChannelChange = 1 << 2, ///< set by Host (in call #offlineNotify)
+
+ kVstOfflineCanProcessSelection = 1 << 10, ///< set by plug-in (in call #offlineStart)
+ kVstOfflineNoCrossfade = 1 << 11, ///< set by plug-in (in call #offlineStart)
+ kVstOfflineWantRead = 1 << 12, ///< set by plug-in (in call #offlineStart)
+ kVstOfflineWantWrite = 1 << 13, ///< set by plug-in (in call #offlineStart)
+ kVstOfflineWantWriteMarker = 1 << 14, ///< set by plug-in (in call #offlineStart)
+ kVstOfflineWantMoveCursor = 1 << 15, ///< set by plug-in (in call #offlineStart)
+ kVstOfflineWantSelect = 1 << 16 ///< set by plug-in (in call #offlineStart)
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Audio file marker. */
+//-------------------------------------------------------------------------------------------------------
+struct VstAudioFileMarker
+{
+//-------------------------------------------------------------------------------------------------------
+ double position; ///< marker position
+ char name[32]; ///< marker name
+ VstInt32 type; ///< marker type
+ VstInt32 id; ///< marker identifier
+ VstInt32 reserved; ///< reserved for future use
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+// Others
+//-------------------------------------------------------------------------------------------------------
+
+//-------------------------------------------------------------------------------------------------------
+/** \deprecated Structure used for #openWindow and #closeWindow (deprecated in VST 2.4). */
+//-------------------------------------------------------------------------------------------------------
+struct DECLARE_VST_DEPRECATED (VstWindow)
+{
+//-------------------------------------------------------------------------------------------------------
+ char title[128];
+ VstInt16 xPos;
+ VstInt16 yPos;
+ VstInt16 width;
+ VstInt16 height;
+ VstInt32 style;
+ void* parent;
+ void* userHandle;
+ void* winHandle;
+
+ char future[104];
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Structure used for keyUp/keyDown. */
+//-------------------------------------------------------------------------------------------------------
+struct VstKeyCode
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 character; ///< ASCII character
+ unsigned char virt; ///< @see VstVirtualKey
+ unsigned char modifier; ///< @see VstModifierKey
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Platform-independent definition of Virtual Keys (used in #VstKeyCode). */
+//-------------------------------------------------------------------------------------------------------
+enum VstVirtualKey
+{
+//-------------------------------------------------------------------------------------------------------
+ VKEY_BACK = 1,
+ VKEY_TAB,
+ VKEY_CLEAR,
+ VKEY_RETURN,
+ VKEY_PAUSE,
+ VKEY_ESCAPE,
+ VKEY_SPACE,
+ VKEY_NEXT,
+ VKEY_END,
+ VKEY_HOME,
+ VKEY_LEFT,
+ VKEY_UP,
+ VKEY_RIGHT,
+ VKEY_DOWN,
+ VKEY_PAGEUP,
+ VKEY_PAGEDOWN,
+ VKEY_SELECT,
+ VKEY_PRINT,
+ VKEY_ENTER,
+ VKEY_SNAPSHOT,
+ VKEY_INSERT,
+ VKEY_DELETE,
+ VKEY_HELP,
+ VKEY_NUMPAD0,
+ VKEY_NUMPAD1,
+ VKEY_NUMPAD2,
+ VKEY_NUMPAD3,
+ VKEY_NUMPAD4,
+ VKEY_NUMPAD5,
+ VKEY_NUMPAD6,
+ VKEY_NUMPAD7,
+ VKEY_NUMPAD8,
+ VKEY_NUMPAD9,
+ VKEY_MULTIPLY,
+ VKEY_ADD,
+ VKEY_SEPARATOR,
+ VKEY_SUBTRACT,
+ VKEY_DECIMAL,
+ VKEY_DIVIDE,
+ VKEY_F1,
+ VKEY_F2,
+ VKEY_F3,
+ VKEY_F4,
+ VKEY_F5,
+ VKEY_F6,
+ VKEY_F7,
+ VKEY_F8,
+ VKEY_F9,
+ VKEY_F10,
+ VKEY_F11,
+ VKEY_F12,
+ VKEY_NUMLOCK,
+ VKEY_SCROLL,
+ VKEY_SHIFT,
+ VKEY_CONTROL,
+ VKEY_ALT,
+ VKEY_EQUALS
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Modifier flags used in #VstKeyCode. */
+//-------------------------------------------------------------------------------------------------------
+enum VstModifierKey
+{
+//-------------------------------------------------------------------------------------------------------
+ MODIFIER_SHIFT = 1<<0, ///< Shift
+ MODIFIER_ALTERNATE = 1<<1, ///< Alt
+ MODIFIER_COMMAND = 1<<2, ///< Control on Mac
+ MODIFIER_CONTROL = 1<<3 ///< Ctrl on PC, Apple on Mac
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** File filter used in #VstFileSelect. */
+//-------------------------------------------------------------------------------------------------------
+struct VstFileType
+{
+//-------------------------------------------------------------------------------------------------------
+ char name[128]; ///< display name
+ char macType[8]; ///< MacOS type
+ char dosType[8]; ///< Windows file extension
+ char unixType[8]; ///< Unix file extension
+ char mimeType1[128]; ///< MIME type
+ char mimeType2[128]; ///< additional MIME type
+
+ VstFileType (const char* _name = 0, const char* _macType = 0, const char* _dosType = 0,
+ const char* _unixType = 0, const char* _mimeType1 = 0, const char* _mimeType2 = 0)
+ {
+ vst_strncpy (name, _name ? _name : "", 127);
+ vst_strncpy (macType, _macType ? _macType : "", 7);
+ vst_strncpy (dosType, _dosType ? _dosType : "", 7);
+ vst_strncpy (unixType, _unixType ? _unixType : "", 7);
+ vst_strncpy (mimeType1, _mimeType1 ? _mimeType1 : "", 127);
+ vst_strncpy (mimeType2, _mimeType2 ? _mimeType2 : "", 127);
+ }
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** File Selector Description used in #audioMasterOpenFileSelector. */
+//-------------------------------------------------------------------------------------------------------
+struct VstFileSelect
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 command; ///< @see VstFileSelectCommand
+ VstInt32 type; ///< @see VstFileSelectType
+ VstInt32 macCreator; ///< optional: 0 = no creator
+ VstInt32 nbFileTypes; ///< number of fileTypes
+ VstFileType* fileTypes; ///< list of fileTypes @see VstFileType
+ char title[1024]; ///< text to display in file selector's title
+ char* initialPath; ///< initial path
+ char* returnPath; ///< use with #kVstFileLoad and #kVstDirectorySelect. null: Host allocates memory, plug-in must call #closeOpenFileSelector!
+ VstInt32 sizeReturnPath; ///< size of allocated memory for return paths
+ char** returnMultiplePaths; ///< use with kVstMultipleFilesLoad. Host allocates memory, plug-in must call #closeOpenFileSelector!
+ VstInt32 nbReturnPath; ///< number of selected paths
+ VstIntPtr reserved; ///< reserved for Host application
+
+ char future[116]; ///< reserved for future use
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Command constants used in #VstFileSelect structure. */
+//-------------------------------------------------------------------------------------------------------
+enum VstFileSelectCommand
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstFileLoad = 0, ///< for loading a file
+ kVstFileSave, ///< for saving a file
+ kVstMultipleFilesLoad, ///< for loading multiple files
+ kVstDirectorySelect ///< for selecting a directory/folder
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Types used in #VstFileSelect structure. */
+//-------------------------------------------------------------------------------------------------------
+enum VstFileSelectType
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstFileType = 0 ///< regular file selector
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Structure used for #effBeginLoadBank/#effBeginLoadProgram. */
+//-------------------------------------------------------------------------------------------------------
+struct VstPatchChunkInfo
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 version; ///< Format Version (should be 1)
+ VstInt32 pluginUniqueID; ///< UniqueID of the plug-in
+ VstInt32 pluginVersion; ///< Plug-in Version
+ VstInt32 numElements; ///< Number of Programs (Bank) or Parameters (Program)
+
+ char future[48]; ///< Reserved for future use
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** PanLaw Type. */
+//-------------------------------------------------------------------------------------------------------
+enum VstPanLawType
+{
+//-------------------------------------------------------------------------------------------------------
+ kLinearPanLaw = 0, ///< L = pan * M; R = (1 - pan) * M;
+ kEqualPowerPanLaw ///< L = pow (pan, 0.5) * M; R = pow ((1 - pan), 0.5) * M;
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Process Levels returned by #audioMasterGetCurrentProcessLevel. */
+//-------------------------------------------------------------------------------------------------------
+enum VstProcessLevels
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstProcessLevelUnknown = 0, ///< not supported by Host
+ kVstProcessLevelUser, ///< 1: currently in user thread (GUI)
+ kVstProcessLevelRealtime, ///< 2: currently in audio thread (where process is called)
+ kVstProcessLevelPrefetch, ///< 3: currently in 'sequencer' thread (MIDI, timer etc)
+ kVstProcessLevelOffline ///< 4: currently offline processing and thus in user thread
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Automation States returned by #audioMasterGetAutomationState. */
+//-------------------------------------------------------------------------------------------------------
+enum VstAutomationStates
+{
+//-------------------------------------------------------------------------------------------------------
+ kVstAutomationUnsupported = 0, ///< not supported by Host
+ kVstAutomationOff, ///< off
+ kVstAutomationRead, ///< read
+ kVstAutomationWrite, ///< write
+ kVstAutomationReadWrite ///< read and write
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+#if TARGET_API_MAC_CARBON
+ #pragma options align=reset
+#elif defined(WIN32) || defined(__FLAT__) || defined(__GNUC__)
+ #pragma pack(pop)
+#elif defined __BORLANDC__
+ #pragma -a-
+#endif
+//-------------------------------------------------------------------------------------------------------
+
+#endif //__aeffectx__
diff --git a/src/deps/vst/vstfxstore.h b/src/deps/vst/vstfxstore.h
new file mode 100644
index 0000000..d7d60f4
--- /dev/null
+++ b/src/deps/vst/vstfxstore.h
@@ -0,0 +1,106 @@
+//-------------------------------------------------------------------------------------------------------
+// VST Plug-Ins SDK
+// Version 2.4 $Date: 2006/02/09 11:05:51 $
+//
+// Category : VST 2.x Interfaces
+// Filename : vstfxstore.h
+// Created by : Steinberg Media Technologies
+// Description : Definition of Program (fxp) and Bank (fxb) structures
+//
+// © 2006, Steinberg Media Technologies, All Rights Reserved
+//-------------------------------------------------------------------------------------------------------
+
+#ifndef __vstfxstore__
+#define __vstfxstore__
+
+#ifndef __aeffect__
+#include "aeffect.h"
+#endif
+
+//-------------------------------------------------------------------------------------------------------
+/** Root chunk identifier for Programs (fxp) and Banks (fxb). */
+#define cMagic 'CcnK'
+
+/** Regular Program (fxp) identifier. */
+#define fMagic 'FxCk'
+
+/** Regular Bank (fxb) identifier. */
+#define bankMagic 'FxBk'
+
+/** Program (fxp) identifier for opaque chunk data. */
+#define chunkPresetMagic 'FPCh'
+
+/** Bank (fxb) identifier for opaque chunk data. */
+#define chunkBankMagic 'FBCh'
+
+/*
+ Note: The C data structures below are for illustration only. You can not read/write them directly.
+ The byte order on disk of fxp and fxb files is Big Endian. You have to swap integer
+ and floating-point values on Little Endian platforms (Windows, MacIntel)!
+*/
+
+//-------------------------------------------------------------------------------------------------------
+/** Program (fxp) structure. */
+//-------------------------------------------------------------------------------------------------------
+struct fxProgram
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 chunkMagic; ///< 'CcnK'
+ VstInt32 byteSize; ///< size of this chunk, excl. magic + byteSize
+
+ VstInt32 fxMagic; ///< 'FxCk' (regular) or 'FPCh' (opaque chunk)
+ VstInt32 version; ///< format version (currently 1)
+ VstInt32 fxID; ///< fx unique ID
+ VstInt32 fxVersion; ///< fx version
+
+ VstInt32 numParams; ///< number of parameters
+ char prgName[28]; ///< program name (null-terminated ASCII string)
+
+ union
+ {
+ float params[1]; ///< variable sized array with parameter values
+ struct
+ {
+ VstInt32 size; ///< size of program data
+ char chunk[1]; ///< variable sized array with opaque program data
+ } data; ///< program chunk data
+ } content; ///< program content depending on fxMagic
+//-------------------------------------------------------------------------------------------------------
+};
+
+//-------------------------------------------------------------------------------------------------------
+/** Bank (fxb) structure. */
+//-------------------------------------------------------------------------------------------------------
+struct fxBank
+{
+//-------------------------------------------------------------------------------------------------------
+ VstInt32 chunkMagic; ///< 'CcnK'
+ VstInt32 byteSize; ///< size of this chunk, excl. magic + byteSize
+
+ VstInt32 fxMagic; ///< 'FxBk' (regular) or 'FBCh' (opaque chunk)
+ VstInt32 version; ///< format version (1 or 2)
+ VstInt32 fxID; ///< fx unique ID
+ VstInt32 fxVersion; ///< fx version
+
+ VstInt32 numPrograms; ///< number of programs
+
+#if VST_2_4_EXTENSIONS
+ VstInt32 currentProgram; ///< version 2: current program number
+ char future[124]; ///< reserved, should be zero
+#else
+ char future[128]; ///< reserved, should be zero
+#endif
+
+ union
+ {
+ fxProgram programs[1]; ///< variable number of programs
+ struct
+ {
+ VstInt32 size; ///< size of bank data
+ char chunk[1]; ///< variable sized array with opaque bank data
+ } data; ///< bank chunk data
+ } content; ///< bank content depending on fxMagic
+//-------------------------------------------------------------------------------------------------------
+};
+
+#endif // __vstfxstore__
diff --git a/src/giada.ico b/src/ext/giada.ico
index e0a90bd..e0a90bd 100644
--- a/src/giada.ico
+++ b/src/ext/giada.ico
Binary files differ
diff --git a/src/resource.h b/src/ext/resource.h
index d771ba8..d771ba8 100644
--- a/src/resource.h
+++ b/src/ext/resource.h
diff --git a/src/resource.rc b/src/ext/resource.rc
index fb0be40..fb0be40 100644
--- a/src/resource.rc
+++ b/src/ext/resource.rc
diff --git a/src/ge_channel.cpp b/src/ge_channel.cpp
deleted file mode 100644
index 71cfb38..0000000
--- a/src/ge_channel.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-/* ---------------------------------------------------------------------
- *
- * Giada - Your Hardcore Loopmachine
- *
- * ge_channel
- *
- * ---------------------------------------------------------------------
- *
- * Copyright (C) 2010-2015 Giovanni A. Zuliani | Monocasual
- *
- * This file is part of Giada - Your Hardcore Loopmachine.
- *
- * Giada - Your Hardcore Loopmachine is free software: you can
- * redistribute it and/or modify it under the terms of the GNU General
- * Public License as published by the Free Software Foundation, either
- * version 3 of the License, or (at your option) any later version.
- *
- * Giada - Your Hardcore Loopmachine is distributed in the hope that it
- * will be useful, but WITHOUT ANY WARRANTY; without even the implied
- * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- * See the GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Giada - Your Hardcore Loopmachine. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- * ------------------------------------------------------------------ */
-
-
-#include "ge_channel.h"
-#include "ge_sampleChannel.h"
-#include "gd_mainWindow.h"
-#include "gd_keyGrabber.h"
-#include "gd_midiInput.h"
-#include "gd_editor.h"
-#include "gd_actionEditor.h"
-#include "gd_warnings.h"
-#include "gd_browser.h"
-#include "gd_midiOutput.h"
-#include "gg_keyboard.h"
-#include "pluginHost.h"
-#include "mixer.h"
-#include "conf.h"
-#include "patch.h"
-#include "graphics.h"
-#include "channel.h"
-#include "wave.h"
-#include "sampleChannel.h"
-#include "midiChannel.h"
-#include "glue.h"
-#include "gui_utils.h"
-
-#ifdef WITH_VST
-#include "gd_pluginList.h"
-#endif
-
-
-extern Mixer G_Mixer;
-extern Conf G_Conf;
-extern Patch G_Patch;
-extern gdMainWindow *mainWin;
-
-
-gChannel::gChannel(int X, int Y, int W, int H, int type)
- : Fl_Group(X, Y, W, H, NULL), type(type) {}
-
-
-/* -------------------------------------------------------------------------- */
-
-
-int gChannel::getColumnIndex()
-{
- return ((gColumn*)parent())->getIndex();
-}
-
-
-/* -------------------------------------------------------------------------- */
-
-
-void gChannel::blink()
-{
- if (gu_getBlinker() > 6) {
- mainButton->bgColor0 = COLOR_BG_2;
- mainButton->bdColor = COLOR_BD_1;
- mainButton->txtColor = COLOR_TEXT_1;
- }
- else {
- mainButton->bgColor0 = COLOR_BG_0;
- mainButton->bdColor = COLOR_BD_0;
- mainButton->txtColor = COLOR_TEXT_0;
- }
-}
-
-
-/* -------------------------------------------------------------------------- */
-
-
-void gChannel::setColorsByStatus(int playStatus, int recStatus)
-{
- switch (playStatus) {
- case STATUS_OFF:
- mainButton->bgColor0 = COLOR_BG_0;
- mainButton->bdColor = COLOR_BD_0;
- mainButton->txtColor = COLOR_TEXT_0;
- break;
- case STATUS_PLAY:
- mainButton->bgColor0 = COLOR_BG_2;
- mainButton->bdColor = COLOR_BD_1;
- mainButton->txtColor = COLOR_TEXT_1;
- break;
- case STATUS_WAIT:
- blink();
- break;
- case STATUS_ENDING:
- mainButton->bgColor0 = COLOR_BD_0;
- break;
- }
-
- switch (recStatus) {
- case REC_WAITING:
- blink();
- break;
- case REC_ENDING:
- mainButton->bgColor0 = COLOR_BD_0;
- break;
- }
-}
-
-
-/* -------------------------------------------------------------------------- */
-
-
-int gChannel::handleKey(int e, int key)
-{
- int ret;
- if (e == FL_KEYDOWN && button->value()) // key already pressed! skip it
- ret = 1;
- else
- if (Fl::event_key() == key && !button->value()) {
- button->take_focus(); // move focus to this button
- button->value((e == FL_KEYDOWN || e == FL_SHORTCUT) ? 1 : 0); // change the button's state
- button->do_callback(); // invoke the button's callback
- ret = 1;
- }
- else
- ret = 0;
-
- if (Fl::event_key() == key)
- button->value((e == FL_KEYDOWN || e == FL_SHORTCUT) ? 1 : 0); // change the button's state
-
- return ret;
-}
-
-
-
-
-/* -------------------------------------------------------------------------- */
-/* -------------------------------------------------------------------------- */
-/* -------------------------------------------------------------------------- */
-
-
-gStatus::gStatus(int x, int y, int w, int h, SampleChannel *ch, const char *L)
-: Fl_Box(x, y, w, h, L), ch(ch) {}
-
-void gStatus::draw()
-{
- fl_rect(x(), y(), w(), h(), COLOR_BD_0); // reset border
- fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_0); // reset background
-
- if (ch != NULL) {
- if (ch->status & (STATUS_WAIT | STATUS_ENDING | REC_ENDING | REC_WAITING) ||
- ch->recStatus & (REC_WAITING | REC_ENDING))
- {
- fl_rect(x(), y(), w(), h(), COLOR_BD_1);
- }
- else
- if (ch->status == STATUS_PLAY)
- fl_rect(x(), y(), w(), h(), COLOR_BD_1);
- else
- fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_0); // status empty
-
-
- if (G_Mixer.chanInput == ch)
- fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_3); // take in progress
- else
- if (recorder::active && recorder::canRec(ch))
- fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_4); // action record
-
- /* equation for the progress bar:
- * ((chanTracker - chanStart) * w()) / (chanEnd - chanStart). */
-
- int pos = ch->getPosition();
- if (pos == -1)
- pos = 0;
- else
- pos = (pos * (w()-1)) / (ch->end - ch->begin);
- fl_rectf(x()+1, y()+1, pos, h()-2, COLOR_BG_2);
- }
-}
-
-
-/* -------------------------------------------------------------------------- */
-/* -------------------------------------------------------------------------- */
-/* -------------------------------------------------------------------------- */
-
-
-gModeBox::gModeBox(int x, int y, int w, int h, SampleChannel *ch, const char *L)
- : Fl_Menu_Button(x, y, w, h, L), ch(ch)
-{
- box(G_BOX);
- textsize(11);
- textcolor(COLOR_TEXT_0);
- color(COLOR_BG_0);
-
- add("Loop . basic", 0, cb_change_chanmode, (void *)LOOP_BASIC);
- add("Loop . once", 0, cb_change_chanmode, (void *)LOOP_ONCE);
- add("Loop . once . bar", 0, cb_change_chanmode, (void *)LOOP_ONCE_BAR);
- add("Loop . repeat", 0, cb_change_chanmode, (void *)LOOP_REPEAT);
- add("Oneshot . basic", 0, cb_change_chanmode, (void *)SINGLE_BASIC);
- add("Oneshot . press", 0, cb_change_chanmode, (void *)SINGLE_PRESS);
- add("Oneshot . retrig", 0, cb_change_chanmode, (void *)SINGLE_RETRIG);
- add("Oneshot . endless", 0, cb_change_chanmode, (void *)SINGLE_ENDLESS);
-}
-
-
-/* -------------------------------------------------------------------------- */
-
-
-void gModeBox::draw() {
- fl_rect(x(), y(), w(), h(), COLOR_BD_0); // border
- switch (ch->mode) {
- case LOOP_BASIC:
- fl_draw_pixmap(loopBasic_xpm, x()+1, y()+1);
- break;
- case LOOP_ONCE:
- fl_draw_pixmap(loopOnce_xpm, x()+1, y()+1);
- break;
- case LOOP_ONCE_BAR:
- fl_draw_pixmap(loopOnceBar_xpm, x()+1, y()+1);
- break;
- case LOOP_REPEAT:
- fl_draw_pixmap(loopRepeat_xpm, x()+1, y()+1);
- break;
- case SINGLE_BASIC:
- fl_draw_pixmap(oneshotBasic_xpm, x()+1, y()+1);
- break;
- case SINGLE_PRESS:
- fl_draw_pixmap(oneshotPress_xpm, x()+1, y()+1);
- break;
- case SINGLE_RETRIG:
- fl_draw_pixmap(oneshotRetrig_xpm, x()+1, y()+1);
- break;
- case SINGLE_ENDLESS:
- fl_draw_pixmap(oneshotEndless_xpm, x()+1, y()+1);
- break;
- }
-}
-
-
-/* -------------------------------------------------------------------------- */
-
-
-void gModeBox::cb_change_chanmode(Fl_Widget *v, void *p) { ((gModeBox*)v)->__cb_change_chanmode((intptr_t)p); }
-
-
-/* -------------------------------------------------------------------------- */
-
-
-void gModeBox::__cb_change_chanmode(int mode)
-{
- ch->mode = mode;
-
- /* what to do when the channel is playing and you change the mode?
- * Nothing, since v0.5.3. Just refresh the action editor window, in
- * case it's open */
-
- gu_refreshActionEditor();
-}
-
-
-/* -------------------------------------------------------------------------- */
-/* -------------------------------------------------------------------------- */
-/* -------------------------------------------------------------------------- */
-
-
-gMainButton::gMainButton(int x, int y, int w, int h, const char *l)
- : gClick(x, y, w, h, l) {}
diff --git a/src/glue.cpp b/src/glue/glue.cpp
index 60d0a17..c2ec2c5 100644
--- a/src/glue.cpp
+++ b/src/glue/glue.cpp
@@ -32,30 +32,30 @@
* -------------------------------------------------------------------------- */
+#include "../gui/elems/ge_waveform.h"
+#include "../gui/elems/ge_mixed.h"
+#include "../gui/elems/ge_channel.h"
+#include "../gui/elems/ge_sampleChannel.h"
+#include "../gui/elems/ge_waveTools.h"
+#include "../gui/elems/ge_keyboard.h"
+#include "../gui/dialogs/gd_mainWindow.h"
+#include "../gui/dialogs/gd_editor.h"
+#include "../gui/dialogs/gd_warnings.h"
+#include "../utils/gui_utils.h"
+#include "../utils/utils.h"
+#include "../utils/log.h"
+#include "../core/mixerHandler.h"
+#include "../core/mixer.h"
+#include "../core/recorder.h"
+#include "../core/wave.h"
+#include "../core/pluginHost.h"
+#include "../core/channel.h"
+#include "../core/sampleChannel.h"
+#include "../core/midiChannel.h"
+#include "../core/kernelMidi.h"
+#include "../core/patch.h"
+#include "../core/conf.h"
#include "glue.h"
-#include "ge_waveform.h"
-#include "gd_mainWindow.h"
-#include "gd_editor.h"
-#include "gd_warnings.h"
-#include "gg_waveTools.h"
-#include "ge_mixed.h"
-#include "gg_keyboard.h"
-#include "ge_channel.h"
-#include "ge_sampleChannel.h"
-#include "gui_utils.h"
-#include "mixerHandler.h"
-#include "mixer.h"
-#include "recorder.h"
-#include "wave.h"
-#include "pluginHost.h"
-#include "channel.h"
-#include "sampleChannel.h"
-#include "midiChannel.h"
-#include "utils.h"
-#include "kernelMidi.h"
-#include "log.h"
-#include "patch.h"
-#include "conf.h"
extern gdMainWindow *mainWin;
diff --git a/src/glue.h b/src/glue/glue.h
index d018a6c..d018a6c 100644
--- a/src/glue.h
+++ b/src/glue/glue.h
diff --git a/src/gd_about.cpp b/src/gui/dialogs/gd_about.cpp
index 8caa7a0..e790253 100644
--- a/src/gd_about.cpp
+++ b/src/gui/dialogs/gd_about.cpp
@@ -27,14 +27,14 @@
* ------------------------------------------------------------------ */
+#include "../../core/conf.h"
+#include "../../core/const.h"
+#include "../../core/kernelAudio.h"
+#include "../../core/kernelMidi.h"
+#include "../../core/graphics.h"
+#include "../../utils/gui_utils.h"
+#include "../elems/ge_mixed.h"
#include "gd_about.h"
-#include "conf.h"
-#include "const.h"
-#include "kernelAudio.h"
-#include "kernelMidi.h"
-#include "ge_mixed.h"
-#include "graphics.h"
-#include "gui_utils.h"
extern Conf G_Conf;
diff --git a/src/gd_about.h b/src/gui/dialogs/gd_about.h
index 695a91e..91f5065 100644
--- a/src/gd_about.h
+++ b/src/gui/dialogs/gd_about.h
@@ -32,7 +32,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
class gdAbout : public gWindow {
diff --git a/src/gd_actionEditor.cpp b/src/gui/dialogs/gd_actionEditor.cpp
index 9737e9a..5d5edc2 100644
--- a/src/gd_actionEditor.cpp
+++ b/src/gui/dialogs/gd_actionEditor.cpp
@@ -28,19 +28,19 @@
#include <math.h>
+#include "../../utils/gui_utils.h"
+#include "../../core/graphics.h"
+#include "../../core/mixer.h"
+#include "../../core/recorder.h"
+#include "../../core/conf.h"
+#include "../../core/channel.h"
+#include "../../core/sampleChannel.h"
+#include "../elems/ge_actionChannel.h"
+#include "../elems/ge_muteChannel.h"
+#include "../elems/ge_envelopeChannel.h"
+#include "../elems/ge_pianoRoll.h"
+#include "../elems/ge_mixed.h"
#include "gd_actionEditor.h"
-#include "ge_actionChannel.h"
-#include "ge_muteChannel.h"
-#include "ge_envelopeChannel.h"
-#include "ge_pianoRoll.h"
-#include "gui_utils.h"
-#include "graphics.h"
-#include "mixer.h"
-#include "recorder.h"
-#include "conf.h"
-#include "ge_mixed.h"
-#include "channel.h"
-#include "sampleChannel.h"
extern Mixer G_Mixer;
diff --git a/src/gd_actionEditor.h b/src/gui/dialogs/gd_actionEditor.h
index 71c37fd..1c38e7e 100644
--- a/src/gd_actionEditor.h
+++ b/src/gui/dialogs/gd_actionEditor.h
@@ -33,7 +33,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Scroll.H>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
/* gActionEditor
diff --git a/src/gd_beatsInput.cpp b/src/gui/dialogs/gd_beatsInput.cpp
index 0c381c9..bf7455f 100644
--- a/src/gd_beatsInput.cpp
+++ b/src/gui/dialogs/gd_beatsInput.cpp
@@ -27,13 +27,13 @@
* ------------------------------------------------------------------ */
+#include "../../utils/gui_utils.h"
+#include "../../core/patch.h"
+#include "../../core/mixer.h"
+#include "../../core/conf.h"
+#include "../../glue/glue.h"
#include "gd_beatsInput.h"
#include "gd_mainWindow.h"
-#include "gui_utils.h"
-#include "patch.h"
-#include "glue.h"
-#include "mixer.h"
-#include "conf.h"
extern Mixer G_Mixer;
diff --git a/src/gd_beatsInput.h b/src/gui/dialogs/gd_beatsInput.h
index 8a5ccca..2818c72 100644
--- a/src/gd_beatsInput.h
+++ b/src/gui/dialogs/gd_beatsInput.h
@@ -31,7 +31,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
class gdBeatsInput : public gWindow
diff --git a/src/gd_bpmInput.cpp b/src/gui/dialogs/gd_bpmInput.cpp
index 048fe0a..a10e35c 100644
--- a/src/gd_bpmInput.cpp
+++ b/src/gui/dialogs/gd_bpmInput.cpp
@@ -27,13 +27,13 @@
* ------------------------------------------------------------------ */
+#include "../../core/conf.h"
+#include "../../core/mixer.h"
+#include "../../glue/glue.h"
+#include "../../utils/gui_utils.h"
+#include "../elems/ge_mixed.h"
#include "gd_bpmInput.h"
#include "gd_mainWindow.h"
-#include "conf.h"
-#include "ge_mixed.h"
-#include "mixer.h"
-#include "gui_utils.h"
-#include "glue.h"
extern Mixer G_Mixer;
diff --git a/src/gd_bpmInput.h b/src/gui/dialogs/gd_bpmInput.h
index e3bc211..8a6a945 100644
--- a/src/gd_bpmInput.h
+++ b/src/gui/dialogs/gd_bpmInput.h
@@ -31,7 +31,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
class gdBpmInput : public gWindow {
diff --git a/src/gd_browser.cpp b/src/gui/dialogs/gd_browser.cpp
index 188a6c0..d415ae0 100644
--- a/src/gd_browser.cpp
+++ b/src/gui/dialogs/gd_browser.cpp
@@ -27,22 +27,22 @@
* -------------------------------------------------------------------------- */
+#include "../../core/mixer.h"
+#include "../../core/graphics.h"
+#include "../../core/wave.h"
+#include "../../core/pluginHost.h"
+#include "../../core/channel.h"
+#include "../../core/sampleChannel.h"
+#include "../../core/patch.h"
+#include "../../core/conf.h"
+#include "../../glue/glue.h"
+#include "../elems/ge_browser.h"
+#include "../elems/ge_channel.h"
+#include "../elems/ge_keyboard.h"
#include "gd_browser.h"
-#include "ge_browser.h"
#include "gd_pluginList.h"
#include "gd_mainWindow.h"
-#include "gg_keyboard.h"
#include "gd_warnings.h"
-#include "ge_channel.h"
-#include "mixer.h"
-#include "graphics.h"
-#include "wave.h"
-#include "glue.h"
-#include "pluginHost.h"
-#include "channel.h"
-#include "sampleChannel.h"
-#include "patch.h"
-#include "conf.h"
extern Patch G_Patch;
diff --git a/src/gd_browser.h b/src/gui/dialogs/gd_browser.h
index 61f482d..51bd0c5 100644
--- a/src/gd_browser.h
+++ b/src/gui/dialogs/gd_browser.h
@@ -33,7 +33,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
/* TODO - this class must be subclassed into gdPluginBrowser, gdFileBrowser,
diff --git a/src/gd_config.cpp b/src/gui/dialogs/gd_config.cpp
index ab34fc6..45f8b15 100644
--- a/src/gd_config.cpp
+++ b/src/gui/dialogs/gd_config.cpp
@@ -27,18 +27,18 @@
* -------------------------------------------------------------------------- */
+#include "../../core/conf.h"
+#include "../../core/midiMapConf.h"
+#include "../../core/patch.h"
+#include "../../core/kernelAudio.h"
+#include "../../core/kernelMidi.h"
+#include "../../utils/gui_utils.h"
+#include "../../utils/log.h"
+#include "../elems/ge_mixed.h"
#include "gd_config.h"
#include "gd_keyGrabber.h"
#include "gd_devInfo.h"
#include "gd_browser.h"
-#include "ge_mixed.h"
-#include "conf.h"
-#include "midiMapConf.h"
-#include "log.h"
-#include "gui_utils.h"
-#include "patch.h"
-#include "kernelAudio.h"
-#include "kernelMidi.h"
extern Patch G_Patch;
diff --git a/src/gd_config.h b/src/gui/dialogs/gd_config.h
index fa28b80..64d06d4 100644
--- a/src/gd_config.h
+++ b/src/gui/dialogs/gd_config.h
@@ -32,7 +32,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <FL/Fl_Tabs.H>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
class gdConfig : public gWindow
diff --git a/src/gd_devInfo.cpp b/src/gui/dialogs/gd_devInfo.cpp
index b7c5e40..efdc064 100644
--- a/src/gd_devInfo.cpp
+++ b/src/gui/dialogs/gd_devInfo.cpp
@@ -27,10 +27,10 @@
* ------------------------------------------------------------------ */
+#include "../../core/kernelAudio.h"
+#include "../../utils/gui_utils.h"
+#include "../elems/ge_mixed.h"
#include "gd_devInfo.h"
-#include "ge_mixed.h"
-#include "kernelAudio.h"
-#include "gui_utils.h"
gdDevInfo::gdDevInfo(unsigned dev)
diff --git a/src/gd_devInfo.h b/src/gui/dialogs/gd_devInfo.h
index c5a06ca..c5a06ca 100644
--- a/src/gd_devInfo.h
+++ b/src/gui/dialogs/gd_devInfo.h
diff --git a/src/gd_editor.cpp b/src/gui/dialogs/gd_editor.cpp
index 3e96a1b..231bdec 100644
--- a/src/gd_editor.cpp
+++ b/src/gui/dialogs/gd_editor.cpp
@@ -27,24 +27,24 @@
* ------------------------------------------------------------------ */
+#include "../../utils/gui_utils.h"
+#include "../../glue/glue.h"
+#include "../../core/waveFx.h"
+#include "../../core/conf.h"
+#include "../../core/graphics.h"
+#include "../../core/mixerHandler.h"
+#include "../../core/channel.h"
+#include "../../core/sampleChannel.h"
+#include "../../core/mixer.h"
+#include "../../core/wave.h"
+#include "../elems/ge_waveform.h"
+#include "../elems/ge_mixed.h"
+#include "../elems/ge_channel.h"
+#include "../elems/ge_waveTools.h"
+#include "../elems/ge_keyboard.h"
#include "gd_editor.h"
#include "gd_mainWindow.h"
-#include "ge_waveform.h"
#include "gd_warnings.h"
-#include "gg_waveTools.h"
-#include "ge_mixed.h"
-#include "gg_keyboard.h"
-#include "ge_channel.h"
-#include "waveFx.h"
-#include "conf.h"
-#include "graphics.h"
-#include "gui_utils.h"
-#include "glue.h"
-#include "mixerHandler.h"
-#include "channel.h"
-#include "sampleChannel.h"
-#include "mixer.h"
-#include "wave.h"
extern Mixer G_Mixer;
diff --git a/src/gd_editor.h b/src/gui/dialogs/gd_editor.h
index 9ae3266..54a8f79 100644
--- a/src/gd_editor.h
+++ b/src/gui/dialogs/gd_editor.h
@@ -32,7 +32,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Double_Window.H>
#include <math.h>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
class gdEditor : public gWindow {
diff --git a/src/gd_keyGrabber.cpp b/src/gui/dialogs/gd_keyGrabber.cpp
index 469adf0..6b4527f 100644
--- a/src/gd_keyGrabber.cpp
+++ b/src/gui/dialogs/gd_keyGrabber.cpp
@@ -27,18 +27,19 @@
* -------------------------------------------------------------------------- */
+#include "../../utils/gui_utils.h"
+#include "../../core/conf.h"
+#include "../../core/channel.h"
+#include "../../core/sampleChannel.h"
+#include "../../core/midiChannel.h"
+#include "../../utils/log.h"
+#include "../elems/ge_keyboard.h"
+#include "../elems/ge_mixed.h"
+#include "../elems/ge_channel.h"
+#include "../elems/ge_channelButton.h"
#include "gd_keyGrabber.h"
-#include "gg_keyboard.h"
-#include "ge_mixed.h"
#include "gd_config.h"
-#include "ge_channel.h"
#include "gd_mainWindow.h"
-#include "gui_utils.h"
-#include "conf.h"
-#include "channel.h"
-#include "sampleChannel.h"
-#include "midiChannel.h"
-#include "log.h"
extern Conf G_Conf;
@@ -96,7 +97,7 @@ void gdKeyGrabber::__cb_clear()
void gdKeyGrabber::setButtonLabel(int key)
{
char tmp[2]; sprintf(tmp, "%c", key);
- ch->guiChannel->button->copy_label(tmp);
+ ch->guiChannel->mainButton->setKey(tmp);
ch->key = key;
}
diff --git a/src/gd_keyGrabber.h b/src/gui/dialogs/gd_keyGrabber.h
index 4e4b2a3..02bbe85 100644
--- a/src/gd_keyGrabber.h
+++ b/src/gui/dialogs/gd_keyGrabber.h
@@ -32,7 +32,7 @@
#include <FL/Fl.H>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
class gdKeyGrabber : public gWindow
diff --git a/src/gd_mainWindow.cpp b/src/gui/dialogs/gd_mainWindow.cpp
index b8fc2df..0289763 100644
--- a/src/gd_mainWindow.cpp
+++ b/src/gui/dialogs/gd_mainWindow.cpp
@@ -31,26 +31,28 @@
#include <sys/stat.h> // for mkdir
#endif
-#include "gd_mainWindow.h"
+
+#include "../../core/graphics.h"
+#include "../../core/mixer.h"
+#include "../../core/recorder.h"
+#include "../../core/mixerHandler.h"
+#include "../../core/pluginHost.h"
+#include "../../core/channel.h"
+#include "../../core/sampleChannel.h"
+#include "../../core/init.h"
+#include "../../core/patch.h"
+#include "../../core/conf.h"
+#include "../../glue/glue.h"
+#include "../elems/ge_keyboard.h"
#include "gd_warnings.h"
#include "gd_bpmInput.h"
#include "gd_beatsInput.h"
#include "gd_midiInput.h"
-#include "gg_keyboard.h"
#include "gd_about.h"
#include "gd_config.h"
#include "gd_browser.h"
-#include "graphics.h"
-#include "glue.h"
-#include "mixer.h"
-#include "recorder.h"
-#include "mixerHandler.h"
-#include "pluginHost.h"
-#include "channel.h"
-#include "sampleChannel.h"
-#include "init.h"
-#include "patch.h"
-#include "conf.h"
+#include "gd_mainWindow.h"
+
#ifdef WITH_VST
#include "gd_pluginList.h"
@@ -424,137 +426,6 @@ void gMenu::__cb_edit()
/* ------------------------------------------------------------------ */
-gController::gController(int x, int y)
- : Fl_Group(x, y, 131, 25)
-{
- begin();
-
- rewind = new gClick(x, y, 25, 25, "", rewindOff_xpm, rewindOn_xpm);
- play = new gClick(rewind->x()+rewind->w()+4, y, 25, 25, "", play_xpm, pause_xpm);
- recAction = new gClick(play->x()+play->w()+4, y, 25, 25, "", recOff_xpm, recOn_xpm);
- recInput = new gClick(recAction->x()+recAction->w()+4, y, 25, 25, "", inputRecOff_xpm, inputRecOn_xpm);
- metronome = new gClick(recInput->x()+recInput->w()+4, y+10, 15, 15, "", metronomeOff_xpm, metronomeOn_xpm);
-
- end();
-
- resizable(NULL); // don't resize any widget
-
- rewind->callback(cb_rewind, (void*)this);
-
- play->callback(cb_play);
- play->type(FL_TOGGLE_BUTTON);
-
- recAction->callback(cb_recAction, (void*)this);
- recAction->type(FL_TOGGLE_BUTTON);
-
- recInput->callback(cb_recInput, (void*)this);
- recInput->type(FL_TOGGLE_BUTTON);
-
- metronome->callback(cb_metronome);
- metronome->type(FL_TOGGLE_BUTTON);
-}
-
-
-/* ------------------------------------------------------------------ */
-
-
-void gController::cb_rewind (Fl_Widget *v, void *p) { ((gController*)p)->__cb_rewind(); }
-void gController::cb_play (Fl_Widget *v, void *p) { ((gController*)p)->__cb_play(); }
-void gController::cb_recAction(Fl_Widget *v, void *p) { ((gController*)p)->__cb_recAction(); }
-void gController::cb_recInput (Fl_Widget *v, void *p) { ((gController*)p)->__cb_recInput(); }
-void gController::cb_metronome(Fl_Widget *v, void *p) { ((gController*)p)->__cb_metronome(); }
-
-
-/* ------------------------------------------------------------------ */
-
-
-void gController::__cb_rewind()
-{
- glue_rewindSeq();
-}
-
-
-/* ------------------------------------------------------------------ */
-
-
-void gController::__cb_play()
-{
- glue_startStopSeq();
-}
-
-
-/* ------------------------------------------------------------------ */
-
-
-void gController::__cb_recAction()
-{
- glue_startStopActionRec();
-}
-
-
-/* ------------------------------------------------------------------ */
-
-
-void gController::__cb_recInput()
-{
- glue_startStopInputRec();
-}
-
-
-/* ------------------------------------------------------------------ */
-
-
-void gController::__cb_metronome()
-{
- glue_startStopMetronome();
-}
-
-
-/* ------------------------------------------------------------------ */
-
-
-void gController::updatePlay(int v)
-{
- play->value(v);
- play->redraw();
-}
-
-
-/* ------------------------------------------------------------------ */
-
-
-void gController::updateMetronome(int v)
-{
- metronome->value(v);
- metronome->redraw();
-}
-
-
-/* ------------------------------------------------------------------ */
-
-
-void gController::updateRecInput(int v)
-{
- recInput->value(v);
- recInput->redraw();
-}
-
-
-/* ------------------------------------------------------------------ */
-
-
-void gController::updateRecAction(int v)
-{
- recAction->value(v);
- recAction->redraw();
-}
-
-
-/* ------------------------------------------------------------------ */
-/* ------------------------------------------------------------------ */
-/* ------------------------------------------------------------------ */
-
-
gTiming::gTiming(int x, int y)
: Fl_Group(x, y, 170, 15)
{
diff --git a/src/gd_mainWindow.h b/src/gui/dialogs/gd_mainWindow.h
index 0361d5d..df2c911 100644
--- a/src/gd_mainWindow.h
+++ b/src/gui/dialogs/gd_mainWindow.h
@@ -32,8 +32,9 @@
#include <FL/Fl.H>
#include <FL/x.H>
-#include "ge_mixed.h"
-#include "ge_window.h"
+#include "../elems/ge_mixed.h"
+#include "../elems/ge_window.h"
+#include "../elems/ge_controller.h"
/* ------------------------------------------------------------------ */
@@ -139,42 +140,6 @@ public:
/* ------------------------------------------------------------------ */
-class gController : public Fl_Group
-{
-private:
-
- class gClick *rewind;
- class gClick *play;
- class gClick *recAction;
- class gClick *recInput;
- class gClick *metronome;
-
- static void cb_rewind (Fl_Widget *v, void *p);
- static void cb_play (Fl_Widget *v, void *p);
- static void cb_recAction(Fl_Widget *v, void *p);
- static void cb_recInput (Fl_Widget *v, void *p);
- static void cb_metronome(Fl_Widget *v, void *p);
-
- inline void __cb_rewind ();
- inline void __cb_play ();
- inline void __cb_recAction();
- inline void __cb_recInput ();
- inline void __cb_metronome();
-
-public:
-
- gController(int x, int y);
-
- void updatePlay (int v);
- void updateMetronome(int v);
- void updateRecInput (int v);
- void updateRecAction(int v);
-};
-
-
-/* ------------------------------------------------------------------ */
-
-
class gTiming : public Fl_Group
{
private:
diff --git a/src/gd_midiInput.cpp b/src/gui/dialogs/gd_midiInput.cpp
index 5d41ae1..27a7d67 100644
--- a/src/gd_midiInput.cpp
+++ b/src/gui/dialogs/gd_midiInput.cpp
@@ -27,14 +27,14 @@
* -------------------------------------------------------------------------- */
+#include "../../utils/gui_utils.h"
+#include "../../core/kernelMidi.h"
+#include "../../core/conf.h"
+#include "../../core/sampleChannel.h"
+#include "../../utils/log.h"
+#include "../elems/ge_mixed.h"
+#include "../elems/ge_midiIoTools.h"
#include "gd_midiInput.h"
-#include "ge_mixed.h"
-#include "ge_midiIoTools.h"
-#include "gui_utils.h"
-#include "kernelMidi.h"
-#include "conf.h"
-#include "sampleChannel.h"
-#include "log.h"
extern Conf G_Conf;
diff --git a/src/gd_midiInput.h b/src/gui/dialogs/gd_midiInput.h
index 91bdea1..e5d31f5 100644
--- a/src/gd_midiInput.h
+++ b/src/gui/dialogs/gd_midiInput.h
@@ -31,10 +31,10 @@
#define GD_MIDI_INPUT_H
-#include "ge_window.h"
-#include "kernelMidi.h"
-#include "utils.h"
-#include "ge_mixed.h"
+#include "../../core/kernelMidi.h"
+#include "../../utils/utils.h"
+#include "../elems/ge_window.h"
+#include "../elems/ge_mixed.h"
class gdMidiInput : public gWindow
diff --git a/src/gd_midiOutput.cpp b/src/gui/dialogs/gd_midiOutput.cpp
index b01f6f6..991b68a 100644
--- a/src/gd_midiOutput.cpp
+++ b/src/gui/dialogs/gd_midiOutput.cpp
@@ -27,16 +27,16 @@
* -------------------------------------------------------------------------- */
+#include "../../core/channel.h"
+#include "../../core/sampleChannel.h"
+#include "../../core/conf.h"
+#include "../../core/midiChannel.h"
+#include "../../utils/gui_utils.h"
+#include "../elems/ge_mixed.h"
+#include "../elems/ge_channel.h"
+#include "../elems/ge_midiIoTools.h"
+#include "../elems/ge_keyboard.h"
#include "gd_midiOutput.h"
-#include "ge_mixed.h"
-#include "ge_channel.h"
-#include "ge_midiIoTools.h"
-#include "gg_keyboard.h"
-#include "channel.h"
-#include "sampleChannel.h"
-#include "conf.h"
-#include "midiChannel.h"
-#include "gui_utils.h"
extern Conf G_Conf;
diff --git a/src/gd_midiOutput.h b/src/gui/dialogs/gd_midiOutput.h
index 8dd2fd6..911a253 100644
--- a/src/gd_midiOutput.h
+++ b/src/gui/dialogs/gd_midiOutput.h
@@ -33,7 +33,7 @@
#include <FL/Fl.H>
#include <stdint.h>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
/* There's no such thing as a gdMidiOutputMaster vs gdMidiOutputChannel. MIDI
diff --git a/src/gd_pluginList.cpp b/src/gui/dialogs/gd_pluginList.cpp
index ade532d..6ef967d 100644
--- a/src/gd_pluginList.cpp
+++ b/src/gui/dialogs/gd_pluginList.cpp
@@ -29,20 +29,21 @@
#ifdef WITH_VST
+
+#include "../../utils/gui_utils.h"
+#include "../../utils/utils.h"
+#include "../../core/conf.h"
+#include "../../core/graphics.h"
+#include "../../core/pluginHost.h"
+#include "../../core/mixer.h"
+#include "../../core/channel.h"
+#include "../elems/ge_mixed.h"
+#include "../elems/ge_channel.h"
#include "gd_pluginList.h"
#include "gd_pluginWindow.h"
#include "gd_pluginWindowGUI.h"
#include "gd_browser.h"
#include "gd_mainWindow.h"
-#include "ge_mixed.h"
-#include "gui_utils.h"
-#include "utils.h"
-#include "conf.h"
-#include "graphics.h"
-#include "pluginHost.h"
-#include "mixer.h"
-#include "channel.h"
-#include "ge_channel.h"
extern Conf G_Conf;
diff --git a/src/gd_pluginList.h b/src/gui/dialogs/gd_pluginList.h
index 33ac4a1..5f96e89 100644
--- a/src/gd_pluginList.h
+++ b/src/gui/dialogs/gd_pluginList.h
@@ -34,7 +34,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Scroll.H>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
class gdPluginList : public gWindow {
diff --git a/src/gd_pluginWindow.cpp b/src/gui/dialogs/gd_pluginWindow.cpp
index f9119c0..a60ebe5 100644
--- a/src/gd_pluginWindow.cpp
+++ b/src/gui/dialogs/gd_pluginWindow.cpp
@@ -29,11 +29,13 @@
#ifdef WITH_VST
+
#include <FL/Fl_Scroll.H>
+#include "../../utils/gui_utils.h"
+#include "../../core/pluginHost.h"
+#include "../elems/ge_mixed.h"
#include "gd_pluginWindow.h"
-#include "pluginHost.h"
-#include "ge_mixed.h"
-#include "gui_utils.h"
+
extern PluginHost G_PluginHost;
diff --git a/src/gd_pluginWindow.h b/src/gui/dialogs/gd_pluginWindow.h
index 03d49bf..0f50529 100644
--- a/src/gd_pluginWindow.h
+++ b/src/gui/dialogs/gd_pluginWindow.h
@@ -34,7 +34,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
class gdPluginWindow : public gWindow {
diff --git a/src/gd_pluginWindowGUI.cpp b/src/gui/dialogs/gd_pluginWindowGUI.cpp
index 6fd0a07..7b6ff31 100644
--- a/src/gd_pluginWindowGUI.cpp
+++ b/src/gui/dialogs/gd_pluginWindowGUI.cpp
@@ -30,11 +30,11 @@
#ifdef WITH_VST
+#include "../../utils/log.h"
+#include "../../utils/gui_utils.h"
+#include "../../core/pluginHost.h"
+#include "../elems/ge_mixed.h"
#include "gd_pluginWindowGUI.h"
-#include "pluginHost.h"
-#include "ge_mixed.h"
-#include "gui_utils.h"
-#include "log.h"
extern PluginHost G_PluginHost;
@@ -60,7 +60,10 @@ gdPluginWindowGUI::gdPluginWindowGUI(Plugin *pPlugin)
/* Fl::check(): Waits until "something happens" and then returns. It's
* mandatory on linux, otherwise X can't find 'this' window. */
+#ifndef __APPLE__
Fl::check();
+#endif
+
pPlugin->openGui((void*)fl_xid(this));
char name[256];
diff --git a/src/gd_pluginWindowGUI.h b/src/gui/dialogs/gd_pluginWindowGUI.h
index 1675e73..516b879 100644
--- a/src/gd_pluginWindowGUI.h
+++ b/src/gui/dialogs/gd_pluginWindowGUI.h
@@ -37,7 +37,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
-#include "ge_window.h"
+#include "../elems/ge_window.h"
#if defined(__APPLE__)
#include <Carbon/Carbon.h>
#endif
diff --git a/src/gd_warnings.cpp b/src/gui/dialogs/gd_warnings.cpp
index 31a5dbc..31a5dbc 100644
--- a/src/gd_warnings.cpp
+++ b/src/gui/dialogs/gd_warnings.cpp
diff --git a/src/gd_warnings.h b/src/gui/dialogs/gd_warnings.h
index ca9c633..791d236 100644
--- a/src/gd_warnings.h
+++ b/src/gui/dialogs/gd_warnings.h
@@ -32,8 +32,8 @@
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
-#include "ge_mixed.h"
-#include "gui_utils.h"
+#include "../elems/ge_mixed.h"
+#include "../../utils/gui_utils.h"
void gdAlert(const char *c);
diff --git a/src/ge_actionChannel.cpp b/src/gui/elems/ge_actionChannel.cpp
index a98d394..b744ac3 100644
--- a/src/ge_actionChannel.cpp
+++ b/src/gui/elems/ge_actionChannel.cpp
@@ -28,15 +28,15 @@
#include <FL/fl_draw.H>
-#include "glue.h"
+#include "../../core/conf.h"
+#include "../../core/channel.h"
+#include "../../core/sampleChannel.h"
+#include "../../glue/glue.h"
+#include "../../utils/log.h"
+#include "../dialogs/gd_mainWindow.h"
+#include "../dialogs/gd_actionEditor.h"
+#include "ge_keyboard.h"
#include "ge_actionChannel.h"
-#include "gd_mainWindow.h"
-#include "gd_actionEditor.h"
-#include "gg_keyboard.h"
-#include "conf.h"
-#include "channel.h"
-#include "sampleChannel.h"
-#include "log.h"
extern gdMainWindow *mainWin;
diff --git a/src/ge_actionChannel.h b/src/gui/elems/ge_actionChannel.h
index bd0fe24..67413fd 100644
--- a/src/ge_actionChannel.h
+++ b/src/gui/elems/ge_actionChannel.h
@@ -31,10 +31,10 @@
#include <FL/Fl.H>
#include <FL/Fl_Box.H>
+#include "../../utils/gui_utils.h"
+#include "../../core/mixer.h"
+#include "../../core/recorder.h"
#include "ge_actionWidget.h"
-#include "gui_utils.h"
-#include "mixer.h"
-#include "recorder.h"
class gAction : public Fl_Box {
diff --git a/src/ge_actionWidget.cpp b/src/gui/elems/ge_actionWidget.cpp
index a06eab9..05b4db0 100644
--- a/src/ge_actionWidget.cpp
+++ b/src/gui/elems/ge_actionWidget.cpp
@@ -30,9 +30,9 @@
#include <FL/fl_draw.H>
+#include "../../core/mixer.h"
+#include "../dialogs/gd_actionEditor.h"
#include "ge_actionWidget.h"
-#include "gd_actionEditor.h"
-#include "mixer.h"
#include "ge_mixed.h"
diff --git a/src/ge_actionWidget.h b/src/gui/elems/ge_actionWidget.h
index 554f569..b02f8d7 100644
--- a/src/ge_actionWidget.h
+++ b/src/gui/elems/ge_actionWidget.h
@@ -34,7 +34,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Group.H>
-#include "const.h"
+#include "../../core/const.h"
class gActionWidget : public Fl_Group {
diff --git a/src/ge_browser.cpp b/src/gui/elems/ge_browser.cpp
index 15f6836..fd70dcc 100644
--- a/src/ge_browser.cpp
+++ b/src/gui/elems/ge_browser.cpp
@@ -28,10 +28,10 @@
#include <limits.h>
+#include "../../core/const.h"
+#include "../../utils/utils.h"
+#include "../../utils/log.h"
#include "ge_browser.h"
-#include "const.h"
-#include "utils.h"
-#include "log.h"
gBrowser::gBrowser(int x, int y, int w, int h, const char *L)
diff --git a/src/ge_browser.h b/src/gui/elems/ge_browser.h
index 8445319..8445319 100644
--- a/src/ge_browser.h
+++ b/src/gui/elems/ge_browser.h
diff --git a/src/gui/elems/ge_channel.cpp b/src/gui/elems/ge_channel.cpp
new file mode 100644
index 0000000..945ece4
--- /dev/null
+++ b/src/gui/elems/ge_channel.cpp
@@ -0,0 +1,148 @@
+/* -----------------------------------------------------------------------------
+ *
+ * Giada - Your Hardcore Loopmachine
+ *
+ * ge_channel
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2015 Giovanni A. Zuliani | Monocasual
+ *
+ * This file is part of Giada - Your Hardcore Loopmachine.
+ *
+ * Giada - Your Hardcore Loopmachine is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Giada - Your Hardcore Loopmachine is distributed in the hope that it
+ * will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Giada - Your Hardcore Loopmachine. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------- */
+
+
+#include "../../core/pluginHost.h"
+#include "../../core/mixer.h"
+#include "../../core/conf.h"
+#include "../../core/patch.h"
+#include "../../core/graphics.h"
+#include "../../core/channel.h"
+#include "../../core/wave.h"
+#include "../../core/sampleChannel.h"
+#include "../../core/midiChannel.h"
+#include "../../glue/glue.h"
+#include "../../utils/gui_utils.h"
+#include "../dialogs/gd_mainWindow.h"
+#include "../dialogs/gd_keyGrabber.h"
+#include "../dialogs/gd_midiInput.h"
+#include "../dialogs/gd_editor.h"
+#include "../dialogs/gd_actionEditor.h"
+#include "../dialogs/gd_warnings.h"
+#include "../dialogs/gd_browser.h"
+#include "../dialogs/gd_midiOutput.h"
+#include "ge_keyboard.h"
+#include "ge_channel.h"
+#include "ge_sampleChannel.h"
+
+#ifdef WITH_VST
+#include "../dialogs/gd_pluginList.h"
+#endif
+
+
+extern Mixer G_Mixer;
+extern Conf G_Conf;
+extern Patch G_Patch;
+extern gdMainWindow *mainWin;
+
+
+gChannel::gChannel(int X, int Y, int W, int H, int type)
+ : Fl_Group(X, Y, W, H, NULL), type(type) {}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+int gChannel::getColumnIndex()
+{
+ return ((gColumn*)parent())->getIndex();
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gChannel::blink()
+{
+ if (gu_getBlinker() > 6)
+ mainButton->setPlayMode();
+ else
+ mainButton->setDefaultMode();
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gChannel::setColorsByStatus(int playStatus, int recStatus)
+{
+ switch (playStatus) {
+ case STATUS_OFF:
+ mainButton->setDefaultMode();
+ button->imgOn = channelPlay_xpm;
+ button->imgOff = channelStop_xpm;
+ button->redraw();
+ break;
+ case STATUS_PLAY:
+ mainButton->setPlayMode();
+ button->imgOn = channelStop_xpm;
+ button->imgOff = channelPlay_xpm;
+ button->redraw();
+ break;
+ case STATUS_WAIT:
+ blink();
+ break;
+ case STATUS_ENDING:
+ mainButton->setEndingMode();
+ break;
+ }
+
+ switch (recStatus) {
+ case REC_WAITING:
+ blink();
+ break;
+ case REC_ENDING:
+ mainButton->setEndingMode();
+ break;
+ }
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+int gChannel::handleKey(int e, int key)
+{
+ int ret;
+ if (e == FL_KEYDOWN && button->value()) // key already pressed! skip it
+ ret = 1;
+ else
+ if (Fl::event_key() == key && !button->value()) {
+ button->take_focus(); // move focus to this button
+ button->value((e == FL_KEYDOWN || e == FL_SHORTCUT) ? 1 : 0); // change the button's state
+ button->do_callback(); // invoke the button's callback
+ ret = 1;
+ }
+ else
+ ret = 0;
+
+ if (Fl::event_key() == key)
+ button->value((e == FL_KEYDOWN || e == FL_SHORTCUT) ? 1 : 0); // change the button's state
+
+ return ret;
+}
diff --git a/src/ge_channel.h b/src/gui/elems/ge_channel.h
index 113f537..5af2d64 100644
--- a/src/ge_channel.h
+++ b/src/gui/elems/ge_channel.h
@@ -102,61 +102,18 @@ public:
int getColumnIndex();
- class gButton *button;
- class gStatus *status;
- class gMainButton *mainButton;
- class gDial *vol;
- class gClick *mute;
- class gClick *solo;
+ class gButton *button;
+ class gStatus *status;
+ class gChannelButton *mainButton;
+ class gDial *vol;
+ class gClick *mute;
+ class gClick *solo;
#ifdef WITH_VST
- class gFxButton *fx;
+ class gFxButton *fx;
#endif
int type;
};
-/* -------------------------------------------------------------------------- */
-
-
-class gStatus : public Fl_Box
-{
-public:
- gStatus(int X, int Y, int W, int H, class SampleChannel *ch, const char *L=0);
- void draw();
- class SampleChannel *ch;
-};
-
-
-/* -------------------------------------------------------------------------- */
-
-
-class gModeBox : public Fl_Menu_Button
-{
-private:
- static void cb_change_chanmode(Fl_Widget *v, void *p);
- inline void __cb_change_chanmode(int mode);
-
- class SampleChannel *ch;
-
-public:
- gModeBox(int x, int y, int w, int h, class SampleChannel *ch, const char *l=0);
- void draw();
-};
-
-
-/* -------------------------------------------------------------------------- */
-
-
-/* gMainButton
- * base main button for MIDI and Sample Channels. */
-
-class gMainButton : public gClick
-{
-public:
- gMainButton(int x, int y, int w, int h, const char *l=0);
- virtual int handle(int e) = 0;
-};
-
-
#endif
diff --git a/src/gui/elems/ge_channelButton.cpp b/src/gui/elems/ge_channelButton.cpp
new file mode 100644
index 0000000..4eef502
--- /dev/null
+++ b/src/gui/elems/ge_channelButton.cpp
@@ -0,0 +1,118 @@
+/* -----------------------------------------------------------------------------
+ *
+ * Giada - Your Hardcore Loopmachine
+ *
+ * ge_channelButton
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2015 Giovanni A. Zuliani | Monocasual
+ *
+ * This file is part of Giada - Your Hardcore Loopmachine.
+ *
+ * Giada - Your Hardcore Loopmachine is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Giada - Your Hardcore Loopmachine is distributed in the hope that it
+ * will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Giada - Your Hardcore Loopmachine. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------- */
+
+
+#include "../../core/const.h"
+#include "ge_channelButton.h"
+
+
+gChannelButton::gChannelButton(int x, int y, int w, int h, const char *l)
+ : gClick(x, y, w, h, l), key("") {}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gChannelButton::setKey(const char *k)
+{
+ key = k;
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gChannelButton::draw()
+{
+ gClick::draw();
+
+ if (key == "")
+ return;
+
+ /* draw background */
+
+ fl_rectf(x()+1, y()+1, 18, h()-2, bgColor0);
+
+ /* draw key */
+
+ fl_color(COLOR_TEXT_0);
+ fl_font(FL_HELVETICA, 11);
+ fl_draw(key.c_str(), x(), y(), 18, h(), FL_ALIGN_CENTER);
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gChannelButton::setInputRecordMode()
+{
+ bgColor0 = COLOR_BG_3;
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gChannelButton::setActionRecordMode()
+{
+ bgColor0 = COLOR_BG_4;
+ txtColor = COLOR_TEXT_0;
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gChannelButton::setDefaultMode(const char *l)
+{
+ bgColor0 = COLOR_BG_0;
+ bdColor = COLOR_BD_0;
+ txtColor = COLOR_TEXT_0;
+ if (l)
+ label(l);
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gChannelButton::setPlayMode()
+{
+ bgColor0 = COLOR_BG_2;
+ bdColor = COLOR_BD_1;
+ txtColor = COLOR_TEXT_1;
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gChannelButton::setEndingMode()
+{
+ bgColor0 = COLOR_BD_0;
+}
diff --git a/src/gui/elems/ge_channelButton.h b/src/gui/elems/ge_channelButton.h
new file mode 100644
index 0000000..a3bb22b
--- /dev/null
+++ b/src/gui/elems/ge_channelButton.h
@@ -0,0 +1,59 @@
+/* -----------------------------------------------------------------------------
+ *
+ * Giada - Your Hardcore Loopmachine
+ *
+ * ge_channelButton
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2015 Giovanni A. Zuliani | Monocasual
+ *
+ * This file is part of Giada - Your Hardcore Loopmachine.
+ *
+ * Giada - Your Hardcore Loopmachine is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Giada - Your Hardcore Loopmachine is distributed in the hope that it
+ * will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Giada - Your Hardcore Loopmachine. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------- */
+
+
+#ifndef GE_CHANNEL_BUTTON_H
+#define GE_CHANNEL_BUTTON_H
+
+
+#include "ge_mixed.h"
+
+
+class gChannelButton : public gClick
+{
+private:
+
+ std::string key;
+
+public:
+
+ gChannelButton(int x, int y, int w, int h, const char *l=0);
+
+ virtual int handle(int e) = 0;
+
+ void draw();
+ void setKey(const char *k);
+ void setPlayMode();
+ void setEndingMode();
+ void setDefaultMode(const char *l=0);
+ void setInputRecordMode();
+ void setActionRecordMode();
+};
+
+
+#endif
diff --git a/src/ge_column.cpp b/src/gui/elems/ge_column.cpp
index 9acabd6..12c479c 100644
--- a/src/ge_column.cpp
+++ b/src/gui/elems/ge_column.cpp
@@ -27,24 +27,24 @@
* -------------------------------------------------------------------------- */
+#include "../../core/mixer.h"
+#include "../../core/conf.h"
+#include "../../core/patch.h"
+#include "../../core/channel.h"
+#include "../../core/sampleChannel.h"
+#include "../../core/midiChannel.h"
+#include "../../glue/glue.h"
+#include "../../utils/log.h"
+#include "../dialogs/gd_mainWindow.h"
+#include "../dialogs/gd_warnings.h"
+#include "../elems/ge_keyboard.h"
#include "ge_column.h"
-#include "gd_mainWindow.h"
-#include "gd_warnings.h"
-#include "gg_keyboard.h"
#include "ge_channel.h"
#include "ge_sampleChannel.h"
#include "ge_midiChannel.h"
-#include "mixer.h"
-#include "conf.h"
-#include "log.h"
-#include "patch.h"
-#include "glue.h"
-#include "channel.h"
-#include "sampleChannel.h"
-#include "midiChannel.h"
#ifdef WITH_VST
- #include "gd_pluginList.h"
+ #include "../dialogs/gd_pluginList.h"
#endif
diff --git a/src/ge_column.h b/src/gui/elems/ge_column.h
index 84ebc8a..84ebc8a 100644
--- a/src/ge_column.h
+++ b/src/gui/elems/ge_column.h
diff --git a/src/gui/elems/ge_controller.cpp b/src/gui/elems/ge_controller.cpp
new file mode 100644
index 0000000..2557ae6
--- /dev/null
+++ b/src/gui/elems/ge_controller.cpp
@@ -0,0 +1,158 @@
+/* -----------------------------------------------------------------------------
+ *
+ * Giada - Your Hardcore Loopmachine
+ * ge_controller
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2015 Giovanni A. Zuliani | Monocasual
+ *
+ * This file is part of Giada - Your Hardcore Loopmachine.
+ *
+ * Giada - Your Hardcore Loopmachine is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Giada - Your Hardcore Loopmachine is distributed in the hope that it
+ * will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Giada - Your Hardcore Loopmachine. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------- */
+
+
+#include "../../core/graphics.h"
+#include "../../glue/glue.h"
+#include "ge_mixed.h"
+#include "ge_controller.h"
+
+
+gController::gController(int x, int y)
+ : Fl_Group(x, y, 131, 25)
+{
+ begin();
+
+ rewind = new gClick(x, y, 25, 25, "", rewindOff_xpm, rewindOn_xpm);
+ play = new gClick(rewind->x()+rewind->w()+4, y, 25, 25, "", play_xpm, pause_xpm);
+ recAction = new gClick(play->x()+play->w()+4, y, 25, 25, "", recOff_xpm, recOn_xpm);
+ recInput = new gClick(recAction->x()+recAction->w()+4, y, 25, 25, "", inputRecOff_xpm, inputRecOn_xpm);
+ metronome = new gClick(recInput->x()+recInput->w()+4, y+10, 15, 15, "", metronomeOff_xpm, metronomeOn_xpm);
+
+ end();
+
+ resizable(NULL); // don't resize any widget
+
+ rewind->callback(cb_rewind, (void*)this);
+
+ play->callback(cb_play);
+ play->type(FL_TOGGLE_BUTTON);
+
+ recAction->callback(cb_recAction, (void*)this);
+ recAction->type(FL_TOGGLE_BUTTON);
+
+ recInput->callback(cb_recInput, (void*)this);
+ recInput->type(FL_TOGGLE_BUTTON);
+
+ metronome->callback(cb_metronome);
+ metronome->type(FL_TOGGLE_BUTTON);
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gController::cb_rewind (Fl_Widget *v, void *p) { ((gController*)p)->__cb_rewind(); }
+void gController::cb_play (Fl_Widget *v, void *p) { ((gController*)p)->__cb_play(); }
+void gController::cb_recAction(Fl_Widget *v, void *p) { ((gController*)p)->__cb_recAction(); }
+void gController::cb_recInput (Fl_Widget *v, void *p) { ((gController*)p)->__cb_recInput(); }
+void gController::cb_metronome(Fl_Widget *v, void *p) { ((gController*)p)->__cb_metronome(); }
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gController::__cb_rewind()
+{
+ glue_rewindSeq();
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gController::__cb_play()
+{
+ glue_startStopSeq();
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gController::__cb_recAction()
+{
+ glue_startStopActionRec();
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gController::__cb_recInput()
+{
+ glue_startStopInputRec();
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gController::__cb_metronome()
+{
+ glue_startStopMetronome();
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gController::updatePlay(int v)
+{
+ play->value(v);
+ play->redraw();
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gController::updateMetronome(int v)
+{
+ metronome->value(v);
+ metronome->redraw();
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gController::updateRecInput(int v)
+{
+ recInput->value(v);
+ recInput->redraw();
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gController::updateRecAction(int v)
+{
+ recAction->value(v);
+ recAction->redraw();
+}
diff --git a/src/gui/elems/ge_controller.h b/src/gui/elems/ge_controller.h
new file mode 100644
index 0000000..7056948
--- /dev/null
+++ b/src/gui/elems/ge_controller.h
@@ -0,0 +1,68 @@
+/* -----------------------------------------------------------------------------
+ *
+ * Giada - Your Hardcore Loopmachine
+ * ge_controller
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2015 Giovanni A. Zuliani | Monocasual
+ *
+ * This file is part of Giada - Your Hardcore Loopmachine.
+ *
+ * Giada - Your Hardcore Loopmachine is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Giada - Your Hardcore Loopmachine is distributed in the hope that it
+ * will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Giada - Your Hardcore Loopmachine. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------- */
+
+
+#ifndef GE_CONTROLLER_H
+#define GE_CONTROLLER_H
+
+
+#include <FL/Fl_Group.H>
+
+
+class gController : public Fl_Group
+{
+private:
+
+ class gClick *rewind;
+ class gClick *play;
+ class gClick *recAction;
+ class gClick *recInput;
+ class gClick *metronome;
+
+ static void cb_rewind (Fl_Widget *v, void *p);
+ static void cb_play (Fl_Widget *v, void *p);
+ static void cb_recAction(Fl_Widget *v, void *p);
+ static void cb_recInput (Fl_Widget *v, void *p);
+ static void cb_metronome(Fl_Widget *v, void *p);
+
+ inline void __cb_rewind ();
+ inline void __cb_play ();
+ inline void __cb_recAction();
+ inline void __cb_recInput ();
+ inline void __cb_metronome();
+
+public:
+
+ gController(int x, int y);
+
+ void updatePlay (int v);
+ void updateMetronome(int v);
+ void updateRecInput (int v);
+ void updateRecAction(int v);
+};
+
+#endif
diff --git a/src/ge_envelopeChannel.cpp b/src/gui/elems/ge_envelopeChannel.cpp
index 442f6ba..d340375 100644
--- a/src/ge_envelopeChannel.cpp
+++ b/src/gui/elems/ge_envelopeChannel.cpp
@@ -31,13 +31,13 @@
#include <FL/fl_draw.H>
+#include "../../core/channel.h"
+#include "../../core/recorder.h"
+#include "../../core/mixer.h"
+#include "../dialogs/gd_actionEditor.h"
+#include "../dialogs/gd_mainWindow.h"
+#include "ge_keyboard.h"
#include "ge_envelopeChannel.h"
-#include "gd_actionEditor.h"
-#include "gd_mainWindow.h"
-#include "gg_keyboard.h"
-#include "channel.h"
-#include "recorder.h"
-#include "mixer.h"
extern Mixer G_Mixer;
diff --git a/src/ge_envelopeChannel.h b/src/gui/elems/ge_envelopeChannel.h
index 7a1aa24..0bb7039 100644
--- a/src/ge_envelopeChannel.h
+++ b/src/gui/elems/ge_envelopeChannel.h
@@ -34,8 +34,8 @@
#include <FL/Fl.H>
#include <FL/Fl_Group.H>
+#include "../../utils/utils.h"
#include "ge_actionWidget.h"
-#include "utils.h"
class gEnvelopeChannel : public gActionWidget {
diff --git a/src/gg_keyboard.cpp b/src/gui/elems/ge_keyboard.cpp
index 8ea9be8..24d47bd 100644
--- a/src/gg_keyboard.cpp
+++ b/src/gui/elems/ge_keyboard.cpp
@@ -27,21 +27,21 @@
* -------------------------------------------------------------------------- */
-#include "gg_keyboard.h"
-#include "gd_browser.h"
-#include "gd_mainWindow.h"
-#include "gd_editor.h"
-#include "gd_warnings.h"
+#include "../../core/mixer.h"
+#include "../../core/conf.h"
+#include "../../core/const.h"
+#include "../../core/patch.h"
+#include "../../core/channel.h"
+#include "../../core/sampleChannel.h"
+#include "../../glue/glue.h"
+#include "../../utils/log.h"
+#include "../dialogs/gd_browser.h"
+#include "../dialogs/gd_mainWindow.h"
+#include "../dialogs/gd_editor.h"
+#include "../dialogs/gd_warnings.h"
#include "ge_channel.h"
#include "ge_sampleChannel.h"
-#include "mixer.h"
-#include "conf.h"
-#include "const.h"
-#include "glue.h"
-#include "patch.h"
-#include "channel.h"
-#include "sampleChannel.h"
-#include "log.h"
+#include "ge_keyboard.h"
extern Mixer G_Mixer;
diff --git a/src/gg_keyboard.h b/src/gui/elems/ge_keyboard.h
index 6059824..be79c39 100644
--- a/src/gg_keyboard.h
+++ b/src/gui/elems/ge_keyboard.h
@@ -27,8 +27,8 @@
* -------------------------------------------------------------------------- */
-#ifndef GG_KEYBOARD_H
-#define GG_KEYBOARD_H
+#ifndef GE_KEYBOARD_H
+#define GE_KEYBOARD_H
#include <FL/Fl.H>
@@ -36,8 +36,8 @@
#include <FL/Fl_Group.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Menu_Button.H>
-#include "ge_column.h"
-#include "utils.h"
+#include "../elems/ge_column.h"
+#include "../../utils/utils.h"
class gKeyboard : public Fl_Scroll
diff --git a/src/ge_midiChannel.cpp b/src/gui/elems/ge_midiChannel.cpp
index 33cd991..68ba4e7 100644
--- a/src/ge_midiChannel.cpp
+++ b/src/gui/elems/ge_midiChannel.cpp
@@ -27,33 +27,33 @@
* -------------------------------------------------------------------------- */
+#include "../../core/pluginHost.h"
+#include "../../core/mixer.h"
+#include "../../core/conf.h"
+#include "../../core/patch.h"
+#include "../../core/graphics.h"
+#include "../../core/channel.h"
+#include "../../core/wave.h"
+#include "../../core/sampleChannel.h"
+#include "../../core/midiChannel.h"
+#include "../../glue/glue.h"
+#include "../../utils/gui_utils.h"
+#include "../dialogs/gd_mainWindow.h"
+#include "../dialogs/gd_keyGrabber.h"
+#include "../dialogs/gd_midiInput.h"
+#include "../dialogs/gd_editor.h"
+#include "../dialogs/gd_actionEditor.h"
+#include "../dialogs/gd_warnings.h"
+#include "../dialogs/gd_browser.h"
+#include "../dialogs/gd_keyGrabber.h"
+#include "../dialogs/gd_midiOutput.h"
+#include "ge_keyboard.h"
#include "ge_midiChannel.h"
#include "ge_channel.h"
#include "ge_sampleChannel.h"
-#include "gd_mainWindow.h"
-#include "gd_keyGrabber.h"
-#include "gd_midiInput.h"
-#include "gd_editor.h"
-#include "gd_actionEditor.h"
-#include "gd_warnings.h"
-#include "gd_browser.h"
-#include "gd_keyGrabber.h"
-#include "gd_midiOutput.h"
-#include "gg_keyboard.h"
-#include "pluginHost.h"
-#include "mixer.h"
-#include "conf.h"
-#include "patch.h"
-#include "graphics.h"
-#include "channel.h"
-#include "wave.h"
-#include "sampleChannel.h"
-#include "midiChannel.h"
-#include "glue.h"
-#include "gui_utils.h"
#ifdef WITH_VST
-#include "gd_pluginList.h"
+#include "../dialogs/gd_pluginList.h"
#endif
@@ -74,8 +74,8 @@ gMidiChannel::gMidiChannel(int X, int Y, int W, int H, class MidiChannel *ch)
int delta = 96; // (4 widgets * 20) + (4 paddings * 4)
#endif
- button = new gButton(x(), y(), 20, 20);
- mainButton = new gMidiMainButton(button->x()+button->w()+4, y(), w() - delta, 20, "-- MIDI --");
+ button = new gButton(x(), y(), 20, 20, "", channelStop_xpm, channelPlay_xpm);
+ mainButton = new gMidiChannelButton(button->x()+button->w()+4, y(), w() - delta, 20, "-- MIDI --");
mute = new gClick(mainButton->x()+mainButton->w()+4, y(), 20, 20, "", muteOff_xpm, muteOn_xpm);
solo = new gClick(mute->x()+mute->w()+4, y(), 20, 20, "", soloOff_xpm, soloOn_xpm);
#if defined(WITH_VST)
@@ -256,10 +256,7 @@ void gMidiChannel::refresh()
void gMidiChannel::reset()
{
- mainButton->bgColor0 = COLOR_BG_0;
- mainButton->bdColor = COLOR_BD_0;
- mainButton->txtColor = COLOR_TEXT_0;
- mainButton->label("-- MIDI --");
+ mainButton->setDefaultMode("-- MIDI --");
mainButton->redraw();
}
@@ -329,14 +326,14 @@ int gMidiChannel::keyPress(int e)
/* -------------------------------------------------------------------------- */
-gMidiMainButton::gMidiMainButton(int x, int y, int w, int h, const char *l)
- : gMainButton(x, y, w, h, l) {}
+gMidiChannelButton::gMidiChannelButton(int x, int y, int w, int h, const char *l)
+ : gChannelButton(x, y, w, h, l) {}
/* -------------------------------------------------------------------------- */
-int gMidiMainButton::handle(int e)
+int gMidiChannelButton::handle(int e)
{
// MIDI drag-n-drop does nothing so far.
return gClick::handle(e);
diff --git a/src/ge_midiChannel.h b/src/gui/elems/ge_midiChannel.h
index af07fb3..d08669d 100644
--- a/src/ge_midiChannel.h
+++ b/src/gui/elems/ge_midiChannel.h
@@ -35,6 +35,7 @@
#include <FL/Fl_Box.H>
#include <FL/Fl_Menu_Button.H>
#include "ge_channel.h"
+#include "ge_channelButton.h"
#include "ge_mixed.h"
@@ -78,10 +79,10 @@ public:
/* -------------------------------------------------------------------------- */
-class gMidiMainButton : public gMainButton
+class gMidiChannelButton : public gChannelButton
{
public:
- gMidiMainButton(int x, int y, int w, int h, const char *l=0);
+ gMidiChannelButton(int x, int y, int w, int h, const char *l=0);
int handle(int e);
};
diff --git a/src/ge_midiIoTools.cpp b/src/gui/elems/ge_midiIoTools.cpp
index da9b873..da9b873 100644
--- a/src/ge_midiIoTools.cpp
+++ b/src/gui/elems/ge_midiIoTools.cpp
diff --git a/src/ge_midiIoTools.h b/src/gui/elems/ge_midiIoTools.h
index bd52756..abec2df 100644
--- a/src/ge_midiIoTools.h
+++ b/src/gui/elems/ge_midiIoTools.h
@@ -33,8 +33,8 @@
#include <FL/Fl.H>
#include <FL/Fl_Group.H>
-#include "gd_midiInput.h"
-#include "kernelMidi.h"
+#include "../../core/kernelMidi.h"
+#include "../dialogs/gd_midiInput.h"
class gLearner : public Fl_Group
diff --git a/src/ge_mixed.cpp b/src/gui/elems/ge_mixed.cpp
index 81200c8..ef166a6 100644
--- a/src/ge_mixed.cpp
+++ b/src/gui/elems/ge_mixed.cpp
@@ -28,15 +28,15 @@
#include <math.h>
+#include "../../core/const.h"
+#include "../../core/mixer.h"
+#include "../../core/graphics.h"
+#include "../../core/recorder.h"
+#include "../../core/channel.h"
+#include "../../core/sampleChannel.h"
+#include "../../utils/gui_utils.h"
+#include "../dialogs/gd_mainWindow.h"
#include "ge_mixed.h"
-#include "gd_mainWindow.h"
-#include "const.h"
-#include "mixer.h"
-#include "graphics.h"
-#include "recorder.h"
-#include "gui_utils.h"
-#include "channel.h"
-#include "sampleChannel.h"
extern Mixer G_Mixer;
@@ -92,7 +92,7 @@ void gClick::draw()
fl_color(txtColor);
fl_font(FL_HELVETICA, 11);
- fl_draw(label(), x(), y(), w(), h(), FL_ALIGN_CENTER);
+ fl_draw(label(), x()+2, y(), w()-2, h(), FL_ALIGN_CENTER);
}
diff --git a/src/ge_mixed.h b/src/gui/elems/ge_mixed.h
index 26942d5..26942d5 100644
--- a/src/ge_mixed.h
+++ b/src/gui/elems/ge_mixed.h
diff --git a/src/gui/elems/ge_modeBox.cpp b/src/gui/elems/ge_modeBox.cpp
new file mode 100644
index 0000000..a4c13f5
--- /dev/null
+++ b/src/gui/elems/ge_modeBox.cpp
@@ -0,0 +1,109 @@
+/* -----------------------------------------------------------------------------
+ *
+ * Giada - Your Hardcore Loopmachine
+ *
+ * ge_modeBox
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2015 Giovanni A. Zuliani | Monocasual
+ *
+ * This file is part of Giada - Your Hardcore Loopmachine.
+ *
+ * Giada - Your Hardcore Loopmachine is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Giada - Your Hardcore Loopmachine is distributed in the hope that it
+ * will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Giada - Your Hardcore Loopmachine. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------- */
+
+
+#include "../../utils/gui_utils.h"
+#include "../../core/graphics.h"
+#include "../../core/sampleChannel.h"
+#include "../../core/const.h"
+#include "../dialogs/gd_mainWindow.h"
+#include "ge_modeBox.h"
+
+
+gModeBox::gModeBox(int x, int y, int w, int h, SampleChannel *ch, const char *L)
+ : Fl_Menu_Button(x, y, w, h, L), ch(ch)
+{
+ box(G_BOX);
+ textsize(11);
+ textcolor(COLOR_TEXT_0);
+ color(COLOR_BG_0);
+
+ add("Loop . basic", 0, cb_changeMode, (void *)LOOP_BASIC);
+ add("Loop . once", 0, cb_changeMode, (void *)LOOP_ONCE);
+ add("Loop . once . bar", 0, cb_changeMode, (void *)LOOP_ONCE_BAR);
+ add("Loop . repeat", 0, cb_changeMode, (void *)LOOP_REPEAT);
+ add("Oneshot . basic", 0, cb_changeMode, (void *)SINGLE_BASIC);
+ add("Oneshot . press", 0, cb_changeMode, (void *)SINGLE_PRESS);
+ add("Oneshot . retrig", 0, cb_changeMode, (void *)SINGLE_RETRIG);
+ add("Oneshot . endless", 0, cb_changeMode, (void *)SINGLE_ENDLESS);
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gModeBox::draw() {
+ fl_rect(x(), y(), w(), h(), COLOR_BD_0); // border
+ switch (ch->mode) {
+ case LOOP_BASIC:
+ fl_draw_pixmap(loopBasic_xpm, x()+1, y()+1);
+ break;
+ case LOOP_ONCE:
+ fl_draw_pixmap(loopOnce_xpm, x()+1, y()+1);
+ break;
+ case LOOP_ONCE_BAR:
+ fl_draw_pixmap(loopOnceBar_xpm, x()+1, y()+1);
+ break;
+ case LOOP_REPEAT:
+ fl_draw_pixmap(loopRepeat_xpm, x()+1, y()+1);
+ break;
+ case SINGLE_BASIC:
+ fl_draw_pixmap(oneshotBasic_xpm, x()+1, y()+1);
+ break;
+ case SINGLE_PRESS:
+ fl_draw_pixmap(oneshotPress_xpm, x()+1, y()+1);
+ break;
+ case SINGLE_RETRIG:
+ fl_draw_pixmap(oneshotRetrig_xpm, x()+1, y()+1);
+ break;
+ case SINGLE_ENDLESS:
+ fl_draw_pixmap(oneshotEndless_xpm, x()+1, y()+1);
+ break;
+ }
+}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gModeBox::cb_changeMode(Fl_Widget *v, void *p) { ((gModeBox*)v)->__cb_changeMode((intptr_t)p); }
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gModeBox::__cb_changeMode(int mode)
+{
+ ch->mode = mode;
+
+ /* what to do when the channel is playing and you change the mode?
+ * Nothing, since v0.5.3. Just refresh the action editor window, in
+ * case it's open */
+
+ gu_refreshActionEditor();
+}
diff --git a/src/gui/elems/ge_modeBox.h b/src/gui/elems/ge_modeBox.h
new file mode 100644
index 0000000..f6c661b
--- /dev/null
+++ b/src/gui/elems/ge_modeBox.h
@@ -0,0 +1,53 @@
+/* -----------------------------------------------------------------------------
+ *
+ * Giada - Your Hardcore Loopmachine
+ *
+ * ge_modeBox
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2015 Giovanni A. Zuliani | Monocasual
+ *
+ * This file is part of Giada - Your Hardcore Loopmachine.
+ *
+ * Giada - Your Hardcore Loopmachine is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Giada - Your Hardcore Loopmachine is distributed in the hope that it
+ * will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Giada - Your Hardcore Loopmachine. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------- */
+
+
+#ifndef GE_MODEBOX_H
+#define GE_MODEBOX_H
+
+
+#include <FL/Fl_Menu_Button.H>
+
+
+class gModeBox : public Fl_Menu_Button
+{
+private:
+
+ static void cb_changeMode (Fl_Widget *v, void *p);
+ inline void __cb_changeMode(int mode);
+
+ class SampleChannel *ch;
+
+public:
+
+ gModeBox(int x, int y, int w, int h, class SampleChannel *ch, const char *l=0);
+ void draw();
+};
+
+
+#endif
diff --git a/src/ge_muteChannel.cpp b/src/gui/elems/ge_muteChannel.cpp
index 01d1391..96f8cc8 100644
--- a/src/ge_muteChannel.cpp
+++ b/src/gui/elems/ge_muteChannel.cpp
@@ -28,16 +28,16 @@
* ------------------------------------------------------------------ */
-#include "ge_muteChannel.h"
-#include "gd_actionEditor.h"
+#include "../../core/recorder.h"
+#include "../../core/mixer.h"
+#include "../../core/channel.h"
+#include "../../glue/glue.h"
+#include "../../utils/log.h"
+#include "../dialogs/gd_actionEditor.h"
+#include "../dialogs/gd_mainWindow.h"
+#include "ge_keyboard.h"
#include "ge_actionWidget.h"
-#include "gd_mainWindow.h"
-#include "gg_keyboard.h"
-#include "recorder.h"
-#include "mixer.h"
-#include "glue.h"
-#include "channel.h"
-#include "log.h"
+#include "ge_muteChannel.h"
extern gdMainWindow *mainWin;
diff --git a/src/ge_muteChannel.h b/src/gui/elems/ge_muteChannel.h
index 5cb0ca1..e1835cb 100644
--- a/src/ge_muteChannel.h
+++ b/src/gui/elems/ge_muteChannel.h
@@ -34,8 +34,8 @@
#include <FL/Fl.H>
#include <FL/Fl_Widget.H>
#include <FL/fl_draw.H>
+#include "../../utils/utils.h"
#include "ge_actionWidget.h"
-#include "utils.h"
class gMuteChannel : public gActionWidget {
diff --git a/src/ge_pianoRoll.cpp b/src/gui/elems/ge_pianoRoll.cpp
index 51e8b95..c10e653 100644
--- a/src/ge_pianoRoll.cpp
+++ b/src/gui/elems/ge_pianoRoll.cpp
@@ -28,15 +28,15 @@
#include <FL/fl_draw.H>
+#include "../../core/channel.h"
+#include "../../core/midiChannel.h"
+#include "../../core/const.h"
+#include "../../core/kernelMidi.h"
+#include "../../core/conf.h"
+#include "../../utils/log.h"
+#include "../dialogs/gd_mainWindow.h"
+#include "../dialogs/gd_actionEditor.h"
#include "ge_pianoRoll.h"
-#include "gd_mainWindow.h"
-#include "gd_actionEditor.h"
-#include "channel.h"
-#include "midiChannel.h"
-#include "const.h"
-#include "kernelMidi.h"
-#include "log.h"
-#include "conf.h"
extern gdMainWindow *mainWin;
diff --git a/src/ge_pianoRoll.h b/src/gui/elems/ge_pianoRoll.h
index 30c04d2..aad0618 100644
--- a/src/ge_pianoRoll.h
+++ b/src/gui/elems/ge_pianoRoll.h
@@ -33,8 +33,8 @@
#include <FL/Fl.H>
#include <FL/Fl_Scroll.H>
#include <FL/Fl_Box.H>
+#include "../../core/recorder.h"
#include "ge_actionWidget.h"
-#include "recorder.h"
class gPianoRollContainer : public Fl_Scroll {
diff --git a/src/ge_sampleChannel.cpp b/src/gui/elems/ge_sampleChannel.cpp
index 7d0f846..8498391 100644
--- a/src/ge_sampleChannel.cpp
+++ b/src/gui/elems/ge_sampleChannel.cpp
@@ -27,30 +27,32 @@
* -------------------------------------------------------------------------- */
+#include "../../core/pluginHost.h"
+#include "../../core/mixer.h"
+#include "../../core/conf.h"
+#include "../../core/patch.h"
+#include "../../core/graphics.h"
+#include "../../core/channel.h"
+#include "../../core/wave.h"
+#include "../../core/sampleChannel.h"
+#include "../../core/midiChannel.h"
+#include "../../glue/glue.h"
+#include "../../utils/gui_utils.h"
+#include "../dialogs/gd_mainWindow.h"
+#include "../dialogs/gd_keyGrabber.h"
+#include "../dialogs/gd_midiInput.h"
+#include "../dialogs/gd_editor.h"
+#include "../dialogs/gd_actionEditor.h"
+#include "../dialogs/gd_warnings.h"
+#include "../dialogs/gd_browser.h"
+#include "../dialogs/gd_midiOutput.h"
+#include "ge_keyboard.h"
#include "ge_sampleChannel.h"
-#include "gd_mainWindow.h"
-#include "gd_keyGrabber.h"
-#include "gd_midiInput.h"
-#include "gd_editor.h"
-#include "gd_actionEditor.h"
-#include "gd_warnings.h"
-#include "gd_browser.h"
-#include "gd_midiOutput.h"
-#include "gg_keyboard.h"
-#include "pluginHost.h"
-#include "mixer.h"
-#include "conf.h"
-#include "patch.h"
-#include "graphics.h"
-#include "channel.h"
-#include "wave.h"
-#include "sampleChannel.h"
-#include "midiChannel.h"
-#include "glue.h"
-#include "gui_utils.h"
+#include "ge_status.h"
+#include "ge_modeBox.h"
#ifdef WITH_VST
-#include "gd_pluginList.h"
+#include "../dialogs/gd_pluginList.h"
#endif
@@ -71,9 +73,9 @@ gSampleChannel::gSampleChannel(int X, int Y, int W, int H, class SampleChannel *
int delta = 144; // (6 widgets * 20) + (6 paddings * 4)
#endif
- button = new gButton(x(), y(), 20, 20);
+ button = new gButton(x(), y(), 20, 20, "", channelStop_xpm, channelPlay_xpm);
status = new gStatus(button->x()+button->w()+4, y(), 20, 20, ch);
- mainButton = new gSampleMainButton(status->x()+status->w()+4, y(), w() - delta, 20, "-- no sample --");
+ mainButton = new gSampleChannelButton(status->x()+status->w()+4, y(), w() - delta, 20, "-- no sample --");
modeBox = new gModeBox(mainButton->x()+mainButton->w()+4, y(), 20, 20, ch);
mute = new gClick(modeBox->x()+modeBox->w()+4, y(), 20, 20, "", muteOff_xpm, muteOn_xpm);
solo = new gClick(mute->x()+mute->w()+4, y(), 20, 20, "", soloOff_xpm, soloOn_xpm);
@@ -386,15 +388,11 @@ void gSampleChannel::refresh()
setColorsByStatus(ch->status, ch->recStatus);
if (ch->wave != NULL) {
-
if (G_Mixer.chanInput == ch)
- mainButton->bgColor0 = COLOR_BG_3;
-
+ mainButton->setInputRecordMode();
if (recorder::active) {
- if (recorder::canRec(ch)) {
- mainButton->bgColor0 = COLOR_BG_4;
- mainButton->txtColor = COLOR_TEXT_0;
- }
+ if (recorder::canRec(ch))
+ mainButton->setActionRecordMode();
}
status->redraw(); // status invisible? sampleButton too (see below)
}
@@ -407,11 +405,8 @@ void gSampleChannel::refresh()
void gSampleChannel::reset()
{
- mainButton->bgColor0 = COLOR_BG_0;
- mainButton->bdColor = COLOR_BD_0;
- mainButton->txtColor = COLOR_TEXT_0;
- mainButton->label("-- no sample --");
delActionButton(true); // force==true, don't check, just remove it
+ mainButton->setDefaultMode("-- no sample --");
mainButton->redraw();
status->redraw();
}
@@ -446,13 +441,6 @@ void gSampleChannel::update()
else
delActionButton();
- /* update key box */
-
- char k[4];
- sprintf(k, "%c", ch->key);
- button->copy_label(k);
- button->redraw();
-
/* updates modebox */
modeBox->value(ch->mode);
@@ -581,14 +569,14 @@ void gSampleChannel::resize(int X, int Y, int W, int H)
/* -------------------------------------------------------------------------- */
-gSampleMainButton::gSampleMainButton(int x, int y, int w, int h, const char *l)
- : gMainButton(x, y, w, h, l) {}
+gSampleChannelButton::gSampleChannelButton(int x, int y, int w, int h, const char *l)
+ : gChannelButton(x, y, w, h, l) {}
/* -------------------------------------------------------------------------- */
-int gSampleMainButton::handle(int e)
+int gSampleChannelButton::handle(int e)
{
int ret = gClick::handle(e);
switch (e) {
diff --git a/src/ge_sampleChannel.h b/src/gui/elems/ge_sampleChannel.h
index 09238d7..0aad470 100644
--- a/src/ge_sampleChannel.h
+++ b/src/gui/elems/ge_sampleChannel.h
@@ -35,6 +35,7 @@
#include <FL/Fl_Box.H>
#include <FL/Fl_Menu_Button.H>
#include "ge_channel.h"
+#include "ge_channelButton.h"
#include "ge_mixed.h"
@@ -92,10 +93,10 @@ public:
/* -------------------------------------------------------------------------- */
-class gSampleMainButton : public gMainButton
+class gSampleChannelButton : public gChannelButton
{
public:
- gSampleMainButton(int x, int y, int w, int h, const char *l=0);
+ gSampleChannelButton(int x, int y, int w, int h, const char *l=0);
int handle(int e);
};
diff --git a/src/gui/elems/ge_status.cpp b/src/gui/elems/ge_status.cpp
new file mode 100644
index 0000000..564b9ab
--- /dev/null
+++ b/src/gui/elems/ge_status.cpp
@@ -0,0 +1,78 @@
+/* -----------------------------------------------------------------------------
+ *
+ * Giada - Your Hardcore Loopmachine
+ *
+ * ge_status
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2015 Giovanni A. Zuliani | Monocasual
+ *
+ * This file is part of Giada - Your Hardcore Loopmachine.
+ *
+ * Giada - Your Hardcore Loopmachine is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Giada - Your Hardcore Loopmachine is distributed in the hope that it
+ * will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Giada - Your Hardcore Loopmachine. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------- */
+
+
+#include "../../core/mixer.h"
+#include "ge_status.h"
+
+
+extern Mixer G_Mixer;
+
+
+gStatus::gStatus(int x, int y, int w, int h, SampleChannel *ch, const char *L)
+ : Fl_Box(x, y, w, h, L), ch(ch) {}
+
+
+/* -------------------------------------------------------------------------- */
+
+
+void gStatus::draw()
+{
+ fl_rect(x(), y(), w(), h(), COLOR_BD_0); // reset border
+ fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_0); // reset background
+
+ if (ch != NULL) {
+ if (ch->status & (STATUS_WAIT | STATUS_ENDING | REC_ENDING | REC_WAITING) ||
+ ch->recStatus & (REC_WAITING | REC_ENDING))
+ {
+ fl_rect(x(), y(), w(), h(), COLOR_BD_1);
+ }
+ else
+ if (ch->status == STATUS_PLAY)
+ fl_rect(x(), y(), w(), h(), COLOR_BD_1);
+ else
+ fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_0); // status empty
+
+
+ if (G_Mixer.chanInput == ch)
+ fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_3); // take in progress
+ else
+ if (recorder::active && recorder::canRec(ch))
+ fl_rectf(x()+1, y()+1, w()-2, h()-2, COLOR_BG_4); // action record
+
+ /* equation for the progress bar:
+ * ((chanTracker - chanStart) * w()) / (chanEnd - chanStart). */
+
+ int pos = ch->getPosition();
+ if (pos == -1)
+ pos = 0;
+ else
+ pos = (pos * (w()-1)) / (ch->end - ch->begin);
+ fl_rectf(x()+1, y()+1, pos, h()-2, COLOR_BG_2);
+ }
+}
diff --git a/src/gui/elems/ge_status.h b/src/gui/elems/ge_status.h
new file mode 100644
index 0000000..07e9b28
--- /dev/null
+++ b/src/gui/elems/ge_status.h
@@ -0,0 +1,48 @@
+/* -----------------------------------------------------------------------------
+ *
+ * Giada - Your Hardcore Loopmachine
+ *
+ * ge_status
+ *
+ * -----------------------------------------------------------------------------
+ *
+ * Copyright (C) 2010-2015 Giovanni A. Zuliani | Monocasual
+ *
+ * This file is part of Giada - Your Hardcore Loopmachine.
+ *
+ * Giada - Your Hardcore Loopmachine is free software: you can
+ * redistribute it and/or modify it under the terms of the GNU General
+ * Public License as published by the Free Software Foundation, either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Giada - Your Hardcore Loopmachine is distributed in the hope that it
+ * will be useful, but WITHOUT ANY WARRANTY; without even the implied
+ * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Giada - Your Hardcore Loopmachine. If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * -------------------------------------------------------------------------- */
+
+
+#ifndef GE_STATUS_H
+#define GE_STATUS_H
+
+
+#include <FL/Fl_Box.H>
+#include "../../core/sampleChannel.h"
+#include "ge_mixed.h"
+
+
+class gStatus : public Fl_Box
+{
+public:
+ gStatus(int X, int Y, int W, int H, class SampleChannel *ch, const char *L=0);
+ void draw();
+ class SampleChannel *ch;
+};
+
+
+#endif
diff --git a/src/gg_waveTools.cpp b/src/gui/elems/ge_waveTools.cpp
index d8462dd..d7712c1 100644
--- a/src/gg_waveTools.cpp
+++ b/src/gui/elems/ge_waveTools.cpp
@@ -27,11 +27,11 @@
* ------------------------------------------------------------------ */
-#include "gg_waveTools.h"
-#include "graphics.h"
-#include "ge_mixed.h"
-#include "ge_waveform.h"
-#include "mixer.h"
+#include "../../core/graphics.h"
+#include "../../core/mixer.h"
+#include "../elems/ge_mixed.h"
+#include "../elems/ge_waveform.h"
+#include "ge_waveTools.h"
gWaveTools::gWaveTools(int x, int y, int w, int h, SampleChannel *ch, const char *l)
diff --git a/src/gg_waveTools.h b/src/gui/elems/ge_waveTools.h
index 8f81ba1..51cbc65 100644
--- a/src/gg_waveTools.h
+++ b/src/gui/elems/ge_waveTools.h
@@ -27,8 +27,8 @@
* ------------------------------------------------------------------ */
-#ifndef GG_WAVETOOLS_H
-#define GG_WAVETOOLS_H
+#ifndef GE_WAVETOOLS_H
+#define GE_WAVETOOLS_H
#include <FL/Fl.H>
#include <FL/Fl_Group.H>
diff --git a/src/ge_waveform.cpp b/src/gui/elems/ge_waveform.cpp
index 5dcbdad..52cf539 100644
--- a/src/ge_waveform.cpp
+++ b/src/gui/elems/ge_waveform.cpp
@@ -31,17 +31,17 @@
#include <FL/Fl_Menu_Item.H>
#include <FL/Fl_Menu_Button.H>
#include <samplerate.h>
-#include "ge_waveform.h"
-#include "gd_editor.h"
-#include "wave.h"
-#include "conf.h"
-#include "glue.h"
-#include "mixer.h"
-#include "waveFx.h"
+#include "../../core/wave.h"
+#include "../../core/conf.h"
+#include "../../core/mixer.h"
+#include "../../core/waveFx.h"
+#include "../../core/channel.h"
+#include "../../core/sampleChannel.h"
+#include "../../glue/glue.h"
+#include "../dialogs/gd_editor.h"
+#include "ge_waveTools.h"
#include "ge_mixed.h"
-#include "gg_waveTools.h"
-#include "channel.h"
-#include "sampleChannel.h"
+#include "ge_waveform.h"
extern Mixer G_Mixer;
diff --git a/src/ge_waveform.h b/src/gui/elems/ge_waveform.h
index 65c1e40..45abd5b 100644
--- a/src/ge_waveform.h
+++ b/src/gui/elems/ge_waveform.h
@@ -35,7 +35,8 @@
#include <FL/Fl_Widget.H>
#include <FL/fl_draw.H>
#include <math.h>
-#include "utils.h"
+#include "../../utils/utils.h"
+
#define FLAG_WIDTH 14
#define FLAG_HEIGHT 12
diff --git a/src/ge_window.cpp b/src/gui/elems/ge_window.cpp
index aba6fc0..5d4763b 100644
--- a/src/ge_window.cpp
+++ b/src/gui/elems/ge_window.cpp
@@ -28,7 +28,7 @@
#include "ge_window.h"
-#include "log.h"
+#include "../../utils/log.h"
gWindow::gWindow(int x, int y, int w, int h, const char *title, int id)
diff --git a/src/ge_window.h b/src/gui/elems/ge_window.h
index 79d772e..74b5254 100644
--- a/src/ge_window.h
+++ b/src/gui/elems/ge_window.h
@@ -33,7 +33,7 @@
#include <FL/Fl_Double_Window.H>
-#include "utils.h"
+#include "../../utils/utils.h"
class gWindow : public Fl_Double_Window {
diff --git a/src/main.cpp b/src/main.cpp
index e714162..a70c616 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -29,19 +29,19 @@
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#endif
-#include "init.h"
-#include "const.h"
-#include "patch.h"
-#include "conf.h"
-#include "midiMapConf.h"
-#include "mixer.h"
-#include "mixerHandler.h"
-#include "kernelAudio.h"
-#include "recorder.h"
-#include "gui_utils.h"
-#include "gd_mainWindow.h"
+#include "core/init.h"
+#include "core/const.h"
+#include "core/patch.h"
+#include "core/conf.h"
+#include "core/midiMapConf.h"
+#include "core/mixer.h"
+#include "core/mixerHandler.h"
+#include "core/kernelAudio.h"
+#include "core/recorder.h"
+#include "utils/gui_utils.h"
+#include "gui/dialogs/gd_mainWindow.h"
#ifdef WITH_VST
-#include "pluginHost.h"
+#include "core/pluginHost.h"
#endif
diff --git a/src/gui_utils.cpp b/src/utils/gui_utils.cpp
index 4c3ffa7..7625576 100644
--- a/src/gui_utils.cpp
+++ b/src/utils/gui_utils.cpp
@@ -27,22 +27,22 @@
* -------------------------------------------------------------------------- */
-#include "mixer.h"
-#include "patch.h"
+#include "../core/mixer.h"
+#include "../core/patch.h"
+#include "../core/recorder.h"
+#include "../core/wave.h"
+#include "../core/pluginHost.h"
+#include "../core/channel.h"
+#include "../core/conf.h"
+#include "../core/graphics.h"
+#include "../gui/dialogs/gd_warnings.h"
+#include "../gui/dialogs/gd_mainWindow.h"
+#include "../gui/dialogs/gd_actionEditor.h"
+#include "../gui/elems/ge_keyboard.h"
+#include "../gui/elems/ge_window.h"
+#include "../gui/elems/ge_channel.h"
#include "gui_utils.h"
-#include "graphics.h"
-#include "gd_warnings.h"
-#include "ge_window.h"
-#include "ge_channel.h"
-#include "gd_mainWindow.h"
-#include "gg_keyboard.h"
-#include "gd_actionEditor.h"
-#include "recorder.h"
-#include "wave.h"
-#include "pluginHost.h"
-#include "channel.h"
#include "log.h"
-#include "conf.h"
extern Mixer G_Mixer;
diff --git a/src/gui_utils.h b/src/utils/gui_utils.h
index 80c873c..66156ce 100644
--- a/src/gui_utils.h
+++ b/src/utils/gui_utils.h
@@ -37,10 +37,10 @@
#include <libgen.h> // in osx, for basename() (but linux?)
#endif
-/* including stuff for the favicon (or whatever called) */
+/* including stuff for the favicon */
#if defined(_WIN32)
- #include "resource.h"
+ #include "../ext/resource.h"
#elif defined(__linux__)
#include <X11/xpm.h>
#endif
diff --git a/src/log.cpp b/src/utils/log.cpp
index 0f5be34..9b2182d 100644
--- a/src/log.cpp
+++ b/src/utils/log.cpp
@@ -30,9 +30,9 @@
#include <cstdio>
#include <cstdarg>
#include <string>
+#include "../utils/utils.h"
+#include "../core/const.h"
#include "log.h"
-#include "const.h"
-#include "utils.h"
static FILE *f;
diff --git a/src/log.h b/src/utils/log.h
index c53f9c7..c53f9c7 100644
--- a/src/log.h
+++ b/src/utils/log.h
diff --git a/src/utils.cpp b/src/utils/utils.cpp
index e7b2e8c..e7b2e8c 100644
--- a/src/utils.cpp
+++ b/src/utils/utils.cpp
diff --git a/src/utils.h b/src/utils/utils.h
index 0c1a2d0..0c1a2d0 100644
--- a/src/utils.h
+++ b/src/utils/utils.h