@@ -19,41 +19,26 @@ Packagers can make use of the 'PREFIX' and 'DESTDIR' variable during install, li | |||
The required build dependencies are: <i>(devel packages of these)</i> | |||
- JACK | |||
- liblo | |||
- Qt4 | |||
- PyQt4 | |||
- Python3 | |||
- PyQt4 (Py3 version) | |||
Optional but recommended: | |||
- FluidSynth | |||
- LinuxSampler | |||
Optional for extended LV2 UIs support: | |||
- Gtk2 | |||
- Gtk3 | |||
- Suil | |||
On Debian and Ubuntu, use these commands to install all dependencies: <br/> | |||
`$ sudo apt-get install libjack-dev liblo-dev libqt4-dev libfluidsynth-dev` <br/> | |||
On Debian and Ubuntu, use these commands to install all build dependencies: <br/> | |||
`$ sudo apt-get install libjack-dev libqt4-dev` <br/> | |||
`$ sudo apt-get install qt4-dev-tools python-qt4-dev python3-pyqt4 pyqt4-dev-tools` | |||
NOTE: linuxsampler is not packaged in either Debian or Ubuntu, but it's available in KXStudio. <br/> | |||
<br/> | |||
To run all the apps/tools, you'll additionally need: | |||
- python3-dbus | |||
- python3-liblo | |||
- python3-dbus.mainloop.qt | |||
Optional but recommended: | |||
- a2jmidid | |||
- jack-capture | |||
- python3-rdflib | |||
- pulseaudio-module-jack | |||
- pulseaudio[-module-jack] | |||
The 'Cadence' and 'Catia' apps rely on jackdbus to work properly (either JACK2 or JACK1+DBus patch). <br/> | |||
The 'Cadence' app relies on jackdbus to work properly (either JACK2 or JACK1+DBus patch). <br/> | |||
Claudia is a LADISH frontend, so it will obviously require LADISH to run. | |||
The python version used and tested is python3.2. <br/> | |||
@@ -67,28 +52,39 @@ All tools require Python3 and Qt4, some of them work on Windows and Mac. <br/> | |||
Here's the required run-time dependencies of each of the main tools: | |||
### Cadence | |||
Recommends a2jmidid (>= 8) and jackdbus <br/> | |||
Recommends a2jmidid (>= 7) and jackdbus <br/> | |||
Suggests pulseaudio[-module-jack] <br/> | |||
<br/> | |||
### Cadence-JackMeter | |||
Requires jack <br/> | |||
<br/> | |||
### Cadence-JackSettings | |||
Requires jackdbus <br/> | |||
<br/> | |||
### Cadence-Logs | |||
No special requirements <br/> | |||
<br/> | |||
### Cadence-Render | |||
Requires jack-capture <br/> | |||
<br/> | |||
### Cadence-XY Controller | |||
Requires jack <br/> | |||
<br/> | |||
### Catarina | |||
No special requirements <br/> | |||
<br/> | |||
### Catia | |||
Recommends a2jmidid (>= 8) and jackdbus <br/> | |||
Recommends a2jmidid (>= 7) and jackdbus <br/> | |||
<br/> | |||
### Claudia [Linux only] <br/> | |||
Requires jackdbus and ladish <br/> | |||
Recommends a2jmidid <br/> | |||
<br/> | |||
### Carla | |||
Requires liblo <br/> | |||
Recommends python3-rdflib (for LADSPA-RDF support) <br/> | |||
<br/> | |||
### Carla-Control | |||
Requires python3-liblo <br/> | |||
<br/> |
@@ -24,7 +24,7 @@ all: UI RES CPP | |||
# ------------------------------------------------------------------------------------------------------------------------------------------------------ | |||
UI: cadence catarina catia claudia carla tools | |||
UI: cadence catarina catia claudia tools | |||
cadence: src/ui_cadence.py \ | |||
src/ui_cadence_tb_jack.py src/ui_cadence_tb_alsa.py src/ui_cadence_tb_a2j.py src/ui_cadence_tb_pa.py \ | |||
@@ -42,132 +42,126 @@ claudia: src/ui_claudia.py \ | |||
src/ui_claudia_createroom.py src/ui_claudia_projectname.py src/ui_claudia_projectproperties.py \ | |||
src/ui_claudia_runcustom.py src/ui_claudia_launcher.py src/ui_claudia_launcher_app.py | |||
carla: src/ui_carla.py src/ui_carla_control.py \ | |||
src/ui_carla_about.py src/ui_carla_database.py src/ui_carla_edit.py src/ui_carla_parameter.py src/ui_carla_plugin.py src/ui_carla_refresh.py \ | |||
src/ui_inputdialog_value.py | |||
caitlyn: src/ui_caitlyn.py | |||
tools: \ | |||
src/ui_logs.py src/ui_render.py \ | |||
src/ui_settings_app.py src/ui_settings_jack.py | |||
src/ui_cadence.py: resources/ui/cadence.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_cadence_tb_jack.py: resources/ui/cadence_tb_jack.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_cadence_tb_alsa.py: resources/ui/cadence_tb_alsa.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_cadence_tb_a2j.py: resources/ui/cadence_tb_a2j.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_cadence_tb_pa.py: resources/ui/cadence_tb_pa.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_cadence_rwait.py: resources/ui/cadence_rwait.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_catarina.py: resources/ui/catarina.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_catarina_addgroup.py: resources/ui/catarina_addgroup.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_catarina_removegroup.py: resources/ui/catarina_removegroup.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_catarina_renamegroup.py: resources/ui/catarina_renamegroup.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_catarina_addport.py: resources/ui/catarina_addport.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_catarina_removeport.py: resources/ui/catarina_removeport.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_catarina_renameport.py: resources/ui/catarina_renameport.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_catarina_connectports.py: resources/ui/catarina_connectports.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_catarina_disconnectports.py: resources/ui/catarina_disconnectports.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_catia.py: resources/ui/catia.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_claudia.py: resources/ui/claudia.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_claudia_studioname.py: resources/ui/claudia_studioname.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_claudia_studiolist.py: resources/ui/claudia_studiolist.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_claudia_createroom.py: resources/ui/claudia_createroom.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_claudia_projectname.py: resources/ui/claudia_projectname.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_claudia_projectproperties.py: resources/ui/claudia_projectproperties.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_claudia_runcustom.py: resources/ui/claudia_runcustom.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_claudia_launcher.py: resources/ui/claudia_launcher.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_claudia_launcher_app.py: resources/ui/claudia_launcher_app.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_caitlyn.py: resources/ui/caitlyn.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_carla.py: resources/ui/carla.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_carla_control.py: resources/ui/carla_control.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_carla_about.py: resources/ui/carla_about.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_carla_database.py: resources/ui/carla_database.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_carla_edit.py: resources/ui/carla_edit.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_carla_parameter.py: resources/ui/carla_parameter.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_carla_plugin.py: resources/ui/carla_plugin.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_carla_refresh.py: resources/ui/carla_refresh.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_logs.py: resources/ui/logs.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_render.py: resources/ui/render.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_settings_app.py: resources/ui/settings_app.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_settings_jack.py: resources/ui/settings_jack.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_inputdialog_value.py: resources/ui/inputdialog_value.ui | |||
$(PYUIC) $< -o $@ | |||
src/ui_%.py: resources/ui/%.ui | |||
$(PYUIC) $< -o $@ | |||
# | |||
# src/ui_cadence_tb_jack.py: resources/ui/cadence_tb_jack.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_cadence_tb_alsa.py: resources/ui/cadence_tb_alsa.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_cadence_tb_a2j.py: resources/ui/cadence_tb_a2j.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_cadence_tb_pa.py: resources/ui/cadence_tb_pa.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_cadence_rwait.py: resources/ui/cadence_rwait.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_catarina.py: resources/ui/catarina.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_catarina_addgroup.py: resources/ui/catarina_addgroup.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_catarina_removegroup.py: resources/ui/catarina_removegroup.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_catarina_renamegroup.py: resources/ui/catarina_renamegroup.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_catarina_addport.py: resources/ui/catarina_addport.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_catarina_removeport.py: resources/ui/catarina_removeport.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_catarina_renameport.py: resources/ui/catarina_renameport.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_catarina_connectports.py: resources/ui/catarina_connectports.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_catarina_disconnectports.py: resources/ui/catarina_disconnectports.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_catia.py: resources/ui/catia.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_claudia.py: resources/ui/claudia.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_claudia_studioname.py: resources/ui/claudia_studioname.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_claudia_studiolist.py: resources/ui/claudia_studiolist.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_claudia_createroom.py: resources/ui/claudia_createroom.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_claudia_projectname.py: resources/ui/claudia_projectname.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_claudia_projectproperties.py: resources/ui/claudia_projectproperties.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_claudia_runcustom.py: resources/ui/claudia_runcustom.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_claudia_launcher.py: resources/ui/claudia_launcher.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_claudia_launcher_app.py: resources/ui/claudia_launcher_app.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_caitlyn.py: resources/ui/caitlyn.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_carla.py: resources/ui/carla.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_carla_control.py: resources/ui/carla_control.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_carla_about.py: resources/ui/carla_about.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_carla_database.py: resources/ui/carla_database.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_carla_edit.py: resources/ui/carla_edit.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_carla_parameter.py: resources/ui/carla_parameter.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_carla_plugin.py: resources/ui/carla_plugin.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_carla_refresh.py: resources/ui/carla_refresh.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_logs.py: resources/ui/logs.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_render.py: resources/ui/render.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_settings_app.py: resources/ui/settings_app.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_settings_jack.py: resources/ui/settings_jack.ui | |||
# $(PYUIC) $< -o $@ | |||
# | |||
# src/ui_inputdialog_value.py: resources/ui/inputdialog_value.ui | |||
# $(PYUIC) $< -o $@ | |||
# ------------------------------------------------------------------------------------------------------------------------------------------------------ | |||
@@ -178,34 +172,7 @@ src/resources_rc.py: resources/resources.qrc | |||
# ------------------------------------------------------------------------------------------------------------------------------------------------------ | |||
CPP: caitlib carla-backend carla-bridge carla-discovery jackmeter xycontroller | |||
caitlib: | |||
$(MAKE) -C c++/caitlib | |||
carla-backend: carla-engine carla-native carla-plugin | |||
$(MAKE) -C c++/carla-backend | |||
carla-bridge: | |||
$(MAKE) -C c++/carla-bridge | |||
carla-discovery: | |||
$(MAKE) -C c++/carla-discovery NATIVE=1 | |||
carla-engine: | |||
$(MAKE) -C c++/carla-engine | |||
carla-lilv: | |||
$(MAKE) -C c++/carla-lilv | |||
carla-native: | |||
$(MAKE) -C c++/carla-native | |||
carla-plugin: | |||
$(MAKE) -C c++/carla-plugin | |||
carla-rtmempool: | |||
$(MAKE) -C c++/carla-rtmempool | |||
CPP: jackmeter xycontroller | |||
jackmeter: | |||
$(MAKE) -C c++/jackmeter | |||
@@ -218,62 +185,16 @@ xycontroller: | |||
debug: | |||
$(MAKE) DEBUG=true | |||
doxygen: | |||
$(MAKE) doxygen -C c++/caitlib | |||
$(MAKE) doxygen -C c++/carla-backend | |||
$(MAKE) doxygen -C c++/carla-bridge | |||
$(MAKE) doxygen -C c++/carla-engine | |||
$(MAKE) doxygen -C c++/carla-native | |||
$(MAKE) doxygen -C c++/carla-plugin | |||
# ------------------------------------------------------------------------------------------------------------------------------------------------------ | |||
posix32: | |||
$(MAKE) -C c++/carla-bridge posix32 | |||
$(MAKE) -C c++/carla-discovery posix32 | |||
posix64: | |||
$(MAKE) -C c++/carla-bridge posix64 | |||
$(MAKE) -C c++/carla-discovery posix64 | |||
win32: | |||
$(MAKE) -C c++/carla-bridge win32 | |||
$(MAKE) -C c++/carla-discovery win32 | |||
win64: | |||
$(MAKE) -C c++/carla-bridge win64 | |||
$(MAKE) -C c++/carla-discovery win64 | |||
wine32: | |||
$(MAKE) -C c++/carla-jackbridge wine32 | |||
cp c++/carla-jackbridge/libcarla-jackbridge-win32.dll.so c++/carla-bridge/libcarla-jackbridge-win32.dll | |||
wine64: | |||
$(MAKE) -C c++/carla-jackbridge wine64 | |||
cp c++/carla-jackbridge/libcarla-jackbridge-win64.dll.so c++/carla-bridge/libcarla-jackbridge-win64.dll | |||
# ------------------------------------------------------------------------------------------------------------------------------------------------------ | |||
clean: | |||
$(MAKE) clean -C c++/caitlib | |||
$(MAKE) clean -C c++/carla-backend | |||
$(MAKE) clean -C c++/carla-bridge | |||
$(MAKE) clean -C c++/carla-discovery | |||
$(MAKE) clean -C c++/carla-engine | |||
$(MAKE) clean -C c++/carla-jackbridge | |||
$(MAKE) clean -C c++/carla-lilv | |||
$(MAKE) clean -C c++/carla-native | |||
$(MAKE) clean -C c++/carla-plugin | |||
$(MAKE) clean -C c++/carla-rtmempool | |||
$(MAKE) clean -C c++/jackmeter | |||
$(MAKE) clean -C c++/xycontroller | |||
rm -f *~ src/*~ src/*.pyc src/ui_*.py src/resources_rc.py | |||
rm -rf c++/*/doxygen | |||
install: | |||
# Create directories | |||
install -d $(DESTDIR)$(PREFIX)/bin/ | |||
install -d $(DESTDIR)$(PREFIX)/lib/cadence/ | |||
install -d $(DESTDIR)$(PREFIX)/share/applications/ | |||
install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
install -d $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
@@ -300,14 +221,9 @@ install: | |||
data/catia \ | |||
data/claudia \ | |||
data/claudia-launcher \ | |||
data/carla \ | |||
data/carla-control \ | |||
data/carla-standalone \ | |||
data/caitlyn \ | |||
c++/jackmeter/cadence-jackmeter \ | |||
c++/xycontroller/cadence-xycontroller \ | |||
$(DESTDIR)$(PREFIX)/bin/ | |||
# data/cadence-cpufreq | |||
# Install desktop files | |||
install -m 644 data/*.desktop $(DESTDIR)$(PREFIX)/share/applications/ | |||
@@ -318,8 +234,6 @@ install: | |||
install -m 644 resources/16x16/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
install -m 644 resources/16x16/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
install -m 644 resources/16x16/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
install -m 644 resources/16x16/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
install -m 644 resources/16x16/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/16x16/apps/ | |||
# Install icons, 48x48 | |||
install -m 644 resources/48x48/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
@@ -327,8 +241,6 @@ install: | |||
install -m 644 resources/48x48/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
install -m 644 resources/48x48/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
install -m 644 resources/48x48/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
install -m 644 resources/48x48/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
install -m 644 resources/48x48/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/48x48/apps/ | |||
# Install icons, 128x128 | |||
install -m 644 resources/128x128/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
@@ -336,8 +248,6 @@ install: | |||
install -m 644 resources/128x128/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
install -m 644 resources/128x128/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
install -m 644 resources/128x128/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
install -m 644 resources/128x128/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
install -m 644 resources/128x128/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/128x128/apps/ | |||
# Install icons, 256x256 | |||
install -m 644 resources/256x256/cadence.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
@@ -345,8 +255,6 @@ install: | |||
install -m 644 resources/256x256/catia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
install -m 644 resources/256x256/claudia.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
install -m 644 resources/256x256/claudia-launcher.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
install -m 644 resources/256x256/carla.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
install -m 644 resources/256x256/carla-control.png $(DESTDIR)$(PREFIX)/share/icons/hicolor/256x256/apps/ | |||
# Install icons, scalable | |||
install -m 644 resources/scalable/cadence.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
@@ -354,19 +262,10 @@ install: | |||
install -m 644 resources/scalable/catia.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
install -m 644 resources/scalable/claudia.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
install -m 644 resources/scalable/claudia-launcher.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
install -m 644 resources/scalable/carla.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
install -m 644 resources/scalable/carla-control.svg $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/ | |||
# Install main code | |||
install -m 755 src/*.py $(DESTDIR)$(PREFIX)/share/cadence/src/ | |||
install -m 755 \ | |||
c++/caitlib/*.so \ | |||
c++/carla-backend/*.so \ | |||
c++/carla-bridge/carla-bridge-* \ | |||
c++/carla-discovery/carla-discovery-* \ | |||
$(DESTDIR)$(PREFIX)/lib/cadence/ | |||
# Install addtional stuff for Cadence | |||
install -m 644 data/pulse2jack/* $(DESTDIR)$(PREFIX)/share/cadence/pulse2jack/ | |||
install -m 644 data/70cadence-plugin-paths $(X11_RC_DIR) | |||
@@ -389,47 +288,30 @@ install: | |||
$(DESTDIR)$(PREFIX)/bin/catia \ | |||
$(DESTDIR)$(PREFIX)/bin/claudia \ | |||
$(DESTDIR)$(PREFIX)/bin/claudia-launcher \ | |||
$(DESTDIR)$(PREFIX)/bin/carla \ | |||
$(DESTDIR)$(PREFIX)/bin/carla-control \ | |||
$(DESTDIR)$(PREFIX)/bin/carla-standalone \ | |||
$(DESTDIR)$(PREFIX)/bin/caitlyn \ | |||
$(X11_RC_DIR)/70cadence-plugin-paths \ | |||
$(X11_RC_DIR)/99cadence-session-start | |||
# $(DESTDIR)$(PREFIX)/bin/cadence-cpufreq | |||
# Remove unfinished | |||
rm $(DESTDIR)$(PREFIX)/bin/caitlyn | |||
rm $(DESTDIR)$(PREFIX)/share/applications/caitlyn.desktop | |||
uninstall: | |||
rm -f $(DESTDIR)$(PREFIX)/bin/cadence* | |||
rm -f $(DESTDIR)$(PREFIX)/bin/catarina | |||
rm -f $(DESTDIR)$(PREFIX)/bin/catia | |||
rm -f $(DESTDIR)$(PREFIX)/bin/claudia* | |||
rm -f $(DESTDIR)$(PREFIX)/bin/carla* | |||
rm -f $(DESTDIR)$(PREFIX)/share/applications/cadence.desktop | |||
rm -f $(DESTDIR)$(PREFIX)/share/applications/catarina.desktop | |||
rm -f $(DESTDIR)$(PREFIX)/share/applications/catia.desktop | |||
rm -f $(DESTDIR)$(PREFIX)/share/applications/claudia.desktop | |||
rm -f $(DESTDIR)$(PREFIX)/share/applications/claudia-launcher.desktop | |||
rm -f $(DESTDIR)$(PREFIX)/share/applications/carla.desktop | |||
rm -f $(DESTDIR)$(PREFIX)/share/applications/carla-control.desktop | |||
rm -f $(DESTDIR)$(PREFIX)/share/applications/caitlyn.desktop | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/cadence.png | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/catarina.png | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/catia.png | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/claudia.png | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/claudia-launcher.png | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/carla.png | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/*/apps/carla-control.png | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/cadence.svg | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/catarina.svg | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/catia.svg | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/claudia.svg | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/claudia-launcher.svg | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/carla.svg | |||
rm -f $(DESTDIR)$(PREFIX)/share/icons/hicolor/scalable/apps/carla-control.svg | |||
rm -f $(X11_RC_DIR)/70cadence-plugin-paths | |||
rm -f $(X11_RC_DIR)/99cadence-session-start | |||
rm -rf $(DESTDIR)$(PREFIX)/lib/cadence/ | |||
rm -rf $(DESTDIR)$(PREFIX)/share/cadence/ |
@@ -7,8 +7,6 @@ The tools share the same base source code, so most of them look quite similar (w | |||
Also, lots of custom widgets were coded when needed (like pixmapdial, pixmapkeyboard, patchcanvas and systray). <br/> | |||
They can be re-used in other projects. Contact the author if you need help on that. | |||
Note that the main focus goes to JACK2 (or JACK1+DBus); JACK1 (raw) may not work properly at this point. | |||
===== DESCRIPTIONS ===== | |||
------------------------ | |||
@@ -57,13 +55,3 @@ A multimedia application launcher with LADISH support. <br/> | |||
It searches for installed packages (not binaries), and displays the respective content as a launcher. <br/> | |||
The content is got through an hardcoded database, created and/or modified to suit the target distribution. <br/> | |||
Currently supports Debian and ArchLinux based distros. | |||
### [Carla](http://kxstudio.sourceforge.net/KXStudio:Applications:Carla) | |||
Multi-plugin host for JACK. <br/> | |||
It has some nice features like automation of parameters via MIDI CCs (and send control outputs back to MIDI too) and full OSC control. <br/> | |||
Currently supports LADSPA (including LRDF), DSSI, LV2, and VST plugin formats, with additional GIG, SF2 and SFZ file support via FluidSynth and LinuxSampler. | |||
### [Carla-Control](http://kxstudio.sourceforge.net/KXStudio:Applications:Carla-Control) | |||
An OSC Control GUI for Carla (you get the OSC address from the Carla's about dialog, and connect to it).<br/> | |||
Supports controlling main UI components (Dry/Wet, Volume and Balance), and all plugins parameters. <br/> | |||
Peak values and control outputs are displayed as well. |
@@ -26,9 +26,6 @@ BASE_FLAGS = -O2 -ffast-math -mtune=generic -msse -mfpmath=sse -Wall -Wextra | |||
BASE_FLAGS += -DNDEBUG | |||
endif | |||
32BIT_FLAGS = -m32 | |||
64BIT_FLAGS = -m64 | |||
BUILD_C_FLAGS = $(BASE_FLAGS) -std=c99 $(CFLAGS) | |||
BUILD_CXX_FLAGS = $(BASE_FLAGS) -std=c++0x $(CXXFLAGS) | |||
LINK_FLAGS = $(LDFLAGS) | |||
@@ -37,40 +34,9 @@ ifneq ($(DEBUG),true) | |||
BUILD_CXX_FLAGS += -DQT_NO_DEBUG -DQT_NO_DEBUG_STREAM -DQT_NO_DEBUG_OUTPUT | |||
endif | |||
# -------------------------------------------------------------- | |||
# Modify to enable/disable specific features | |||
# Support for LADSPA, DSSI, LV2 and VST plugins | |||
CARLA_PLUGIN_SUPPORT = true | |||
# Support for GIG, SF2 and SFZ sample banks (through fluidsynth and linuxsampler) | |||
CARLA_SAMPLERS_SUPPORT = true | |||
# Support for Native Audio (ALSA and/or PulseAudio in Linux) | |||
CARLA_RTAUDIO_SUPPORT = true | |||
# Comment this line to not use vestige header | |||
BUILD_CXX_FLAGS += -DVESTIGE_HEADER | |||
# -------------------------------------------------------------- | |||
HAVE_QT5 = $(shell pkg-config --atleast-version 5 QtCore && echo true) | |||
HAVE_JACK = $(shell pkg-config --exists jack && echo true) | |||
# HAVE_JACKSESSION = $(shell pkg-config --atleast-version=0.121.0 jack && echo true) | |||
ifeq ($(CARLA_PLUGIN_SUPPORT),true) | |||
HAVE_SUIL = $(shell pkg-config --exists suil-0 && echo true) | |||
endif | |||
ifeq ($(CARLA_SAMPLERS_SUPPORT),true) | |||
HAVE_FLUIDSYNTH = $(shell pkg-config --exists fluidsynth && echo true) | |||
HAVE_LINUXSAMPLER = $(shell pkg-config --exists linuxsampler && echo true) | |||
endif | |||
ifeq ($(CARLA_RTAUDIO_SUPPORT),true) | |||
HAVE_ALSA = $(shell pkg-config --exists alsa && echo true) | |||
HAVE_PULSEAUDIO = $(shell pkg-config --exists libpulse-simple && echo true) | |||
endif | |||
HAVE_QT5 = $(shell pkg-config --atleast-version 5 QtCore && echo true) | |||
HAVE_ZYN_DEPS = $(shell pkg-config --exists fftw3 mxml && echo true) | |||
# Currently broken | |||
# HAVE_JACKSESSION = $(shell pkg-config --atleast-version=0.121.0 jack && echo true) |
@@ -1,36 +0,0 @@ | |||
#!/usr/bin/make -f | |||
# Makefile for caitlib # | |||
# ----------------------------- # | |||
# Created by falkTX | |||
# | |||
include ../Makefile.mk | |||
BUILD_C_FLAGS += -D_GNU_SOURCE -I. | |||
BUILD_C_FLAGS += -fvisibility=hidden -fPIC -std=gnu99 -Werror | |||
BUILD_C_FLAGS += $(shell pkg-config --cflags jack) | |||
LINK_FLAGS += -fPIC -shared -lm -lpthread | |||
LINK_FLAGS += $(shell pkg-config --libs jack) | |||
OBJS = \ | |||
caitlib.o \ | |||
memory_atomic.o \ | |||
# -------------------------------------------------------------- | |||
all: caitlib.so | |||
caitlib.so: $(OBJS) | |||
$(CC) $^ $(LINK_FLAGS) -o $@ && $(STRIP) $@ | |||
doxygen: caitlib.doxygen | |||
doxygen $< | |||
# -------------------------------------------------------------- | |||
.c.o: | |||
$(CC) -c $< $(BUILD_C_FLAGS) -o $@ | |||
clean: | |||
rm -f $(OBJS) *.so *.dll |
@@ -1,697 +0,0 @@ | |||
/* | |||
* Caitlib | |||
* Copyright (C) 2007 Nedko Arnaudov <nedko@arnaudov.name> | |||
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#include <math.h> | |||
#include <stdbool.h> | |||
#include <stdlib.h> | |||
#include <stdio.h> | |||
#include <string.h> | |||
#include <pthread.h> | |||
#include <jack/jack.h> | |||
#include <jack/midiport.h> | |||
#include "caitlib.h" | |||
#include "list.h" | |||
#include "memory_atomic.h" | |||
#define MAX_EVENT_DATA_SIZE 100 | |||
#define MIN_PREALLOCATED_EVENT_COUNT 100 | |||
#define MAX_PREALLOCATED_EVENT_COUNT 1000 | |||
//#define USE_LIST_HEAD_OUTS // incomplete | |||
// ------------------------------------------------------------------------------------------ | |||
typedef struct list_head ListHead; | |||
typedef pthread_mutex_t Mutex; | |||
typedef struct _RawMidiEvent { | |||
ListHead siblings; | |||
jack_midi_data_t data[MAX_EVENT_DATA_SIZE]; | |||
size_t dataSize; | |||
jack_nframes_t time; | |||
double value; // used for special events | |||
} RawMidiEvent; | |||
typedef struct _CaitlibOutPort { | |||
#ifdef USE_LIST_HEAD_OUTS | |||
ListHead siblings; | |||
#endif | |||
uint32_t id; | |||
ListHead queue; | |||
jack_port_t* port; | |||
} CaitlibOutPort; | |||
typedef struct _CaitlibInstance { | |||
bool doProcess, wantEvents; | |||
jack_client_t* client; | |||
jack_port_t* midiIn; | |||
#ifdef USE_LIST_HEAD_OUTS | |||
ListHead outPorts; | |||
#else | |||
uint32_t midiOutCount; | |||
CaitlibOutPort** midiOuts; | |||
#endif | |||
ListHead inQueue; | |||
ListHead inQueuePendingRT; | |||
Mutex mutex; | |||
rtsafe_memory_pool_handle mempool; | |||
} CaitlibInstance; | |||
// ------------------------------------------------------------------------------------------ | |||
#define handlePtr ((CaitlibInstance*)ptr) | |||
static | |||
int jack_process(jack_nframes_t nframes, void* ptr) | |||
{ | |||
if (! handlePtr->doProcess) | |||
return 0; | |||
void* portBuffer; | |||
RawMidiEvent* eventPtr; | |||
jack_position_t transportPos; | |||
jack_transport_state_t transportState = jack_transport_query(handlePtr->client, &transportPos); | |||
if (transportPos.unique_1 != transportPos.unique_2) | |||
transportPos.frame = 0; | |||
// MIDI In | |||
if (handlePtr->wantEvents) | |||
{ | |||
jack_midi_event_t inEvent; | |||
jack_nframes_t inEventCount; | |||
portBuffer = jack_port_get_buffer(handlePtr->midiIn, nframes); | |||
inEventCount = jack_midi_get_event_count(portBuffer); | |||
for (jack_nframes_t i = 0 ; i < inEventCount; i++) | |||
{ | |||
if (jack_midi_event_get(&inEvent, portBuffer, i) != 0) | |||
break; | |||
if (inEvent.size > MAX_EVENT_DATA_SIZE) | |||
continue; | |||
/* allocate memory for buffer copy */ | |||
eventPtr = rtsafe_memory_pool_allocate(handlePtr->mempool); | |||
if (eventPtr == NULL) | |||
{ | |||
//LOG_ERROR("Ignored midi event with size %u because memory allocation failed.", (unsigned int)inEvent.size); | |||
continue; | |||
} | |||
/* copy buffer data */ | |||
memcpy(eventPtr->data, inEvent.buffer, inEvent.size); | |||
eventPtr->dataSize = inEvent.size; | |||
eventPtr->time = transportPos.frame + inEvent.time; | |||
/* Add event buffer to inQueuePendingRT list */ | |||
list_add(&eventPtr->siblings, &handlePtr->inQueuePendingRT); | |||
} | |||
} | |||
if (pthread_mutex_trylock(&handlePtr->mutex) != 0) | |||
return 0; | |||
if (handlePtr->wantEvents) | |||
list_splice_init(&handlePtr->inQueuePendingRT, &handlePtr->inQueue); | |||
#ifdef USE_LIST_HEAD_OUTS | |||
if (transportState == JackTransportRolling) | |||
{ | |||
} | |||
#else | |||
// MIDI Out | |||
if (transportState == JackTransportRolling && handlePtr->midiOutCount > 0) | |||
{ | |||
ListHead* entryPtr; | |||
CaitlibOutPort* outPortPtr; | |||
for (uint32_t i = 0; i < handlePtr->midiOutCount; i++) | |||
{ | |||
outPortPtr = handlePtr->midiOuts[i]; | |||
portBuffer = jack_port_get_buffer(outPortPtr->port, nframes); | |||
jack_midi_clear_buffer(portBuffer); | |||
list_for_each(entryPtr, &outPortPtr->queue) | |||
{ | |||
eventPtr = list_entry(entryPtr, RawMidiEvent, siblings); | |||
if (transportPos.frame > eventPtr->time || transportPos.frame + nframes <= eventPtr->time) | |||
continue; | |||
if (jack_midi_event_write(portBuffer, eventPtr->time - transportPos.frame, eventPtr->data, eventPtr->dataSize) != 0) | |||
break; | |||
} | |||
} | |||
} | |||
#endif | |||
pthread_mutex_unlock(&handlePtr->mutex); | |||
return 0; | |||
} | |||
#undef handlePtr | |||
// ------------------------------------------------------------------------------------------ | |||
// Initialization | |||
CaitlibHandle caitlib_init(const char* instanceName) | |||
{ | |||
CaitlibInstance* handlePtr = (CaitlibInstance*)malloc(sizeof(CaitlibInstance)); | |||
if (handlePtr == NULL) | |||
goto fail; | |||
handlePtr->doProcess = true; | |||
handlePtr->wantEvents = false; | |||
#ifdef USE_LIST_HEAD_OUTS | |||
INIT_LIST_HEAD(&handlePtr->outPorts); | |||
#else | |||
handlePtr->midiOuts = NULL; | |||
handlePtr->midiOutCount = 0; | |||
#endif | |||
INIT_LIST_HEAD(&handlePtr->inQueue); | |||
INIT_LIST_HEAD(&handlePtr->inQueuePendingRT); | |||
if (! rtsafe_memory_pool_create(sizeof(RawMidiEvent), MIN_PREALLOCATED_EVENT_COUNT, MAX_PREALLOCATED_EVENT_COUNT, &handlePtr->mempool)) | |||
goto fail_free; | |||
pthread_mutex_init(&handlePtr->mutex, NULL); | |||
handlePtr->client = jack_client_open(instanceName, JackNullOption, 0); | |||
if (handlePtr->client == NULL) | |||
goto fail_destroyMutex; | |||
handlePtr->midiIn = jack_port_register(handlePtr->client, "midi-in", JACK_DEFAULT_MIDI_TYPE, JackPortIsInput, 0); | |||
if (handlePtr->midiIn == NULL) | |||
goto fail_closeJack; | |||
if (jack_set_process_callback(handlePtr->client, jack_process, handlePtr) != 0) | |||
goto fail_closeJack; | |||
if (jack_activate(handlePtr->client) != 0) | |||
goto fail_closeJack; | |||
return handlePtr; | |||
fail_closeJack: | |||
jack_client_close(handlePtr->client); | |||
fail_destroyMutex: | |||
pthread_mutex_destroy(&handlePtr->mutex); | |||
//fail_destroy_pool: | |||
rtsafe_memory_pool_destroy(handlePtr->mempool); | |||
fail_free: | |||
free(handlePtr); | |||
fail: | |||
return NULL; | |||
} | |||
#define handlePtr ((CaitlibInstance*)handle) | |||
void caitlib_close(CaitlibHandle handle) | |||
{ | |||
// wait for jack processing to end | |||
handlePtr->doProcess = false; | |||
pthread_mutex_lock(&handlePtr->mutex); | |||
if (handlePtr->client) | |||
{ | |||
#ifdef USE_LIST_HEAD_OUTS | |||
ListHead* entryPtr; | |||
CaitlibOutPort* outPortPtr; | |||
#endif | |||
jack_deactivate(handlePtr->client); | |||
jack_port_unregister(handlePtr->client, handlePtr->midiIn); | |||
#ifdef USE_LIST_HEAD_OUTS | |||
list_for_each(entryPtr, &handlePtr->outPorts) | |||
{ | |||
outPortPtr = list_entry(entryPtr, CaitlibOutPort, siblings); | |||
jack_port_unregister(handlePtr->client, outPortPtr->port); | |||
} | |||
#else | |||
for (uint32_t i = 0; i < handlePtr->midiOutCount; i++) | |||
{ | |||
jack_port_unregister(handlePtr->client, handlePtr->midiOuts[i]->port); | |||
free(handlePtr->midiOuts[i]); | |||
} | |||
#endif | |||
jack_client_close(handlePtr->client); | |||
} | |||
pthread_mutex_unlock(&handlePtr->mutex); | |||
pthread_mutex_destroy(&handlePtr->mutex); | |||
rtsafe_memory_pool_destroy(handlePtr->mempool); | |||
free(handlePtr); | |||
} | |||
uint32_t caitlib_create_port(CaitlibHandle handle, const char* portName) | |||
{ | |||
uint32_t nextId = 0; | |||
// wait for jack processing to end | |||
handlePtr->doProcess = false; | |||
pthread_mutex_lock(&handlePtr->mutex); | |||
// re-allocate pointers (midiOutCount + 1) and find next available ID | |||
{ | |||
#ifdef USE_LIST_HEAD_OUTS | |||
ListHead* entryPtr; | |||
CaitlibOutPort* outPortPtr; | |||
list_for_each(entryPtr, &handlePtr->outPorts) | |||
{ | |||
outPortPtr = list_entry(entryPtr, CaitlibOutPort, siblings); | |||
if (outPortPtr->id == nextId) | |||
{ | |||
nextId++; | |||
continue; | |||
} | |||
} | |||
#else | |||
CaitlibOutPort* oldMidiOuts[handlePtr->midiOutCount]; | |||
for (uint32_t i = 0; i < handlePtr->midiOutCount; i++) | |||
{ | |||
oldMidiOuts[i] = handlePtr->midiOuts[i]; | |||
if (handlePtr->midiOuts[i]->id == nextId) | |||
nextId++; | |||
} | |||
if (handlePtr->midiOuts) | |||
free(handlePtr->midiOuts); | |||
handlePtr->midiOuts = (CaitlibOutPort**)malloc(sizeof(CaitlibOutPort*) * (handlePtr->midiOutCount+1)); | |||
for (uint32_t i = 0; i < handlePtr->midiOutCount; i++) | |||
handlePtr->midiOuts[i] = oldMidiOuts[i]; | |||
#endif | |||
} | |||
// we can continue normal operation now | |||
pthread_mutex_unlock(&handlePtr->mutex); | |||
handlePtr->doProcess = true; | |||
#ifdef USE_LIST_HEAD_OUTS | |||
#else | |||
// create new port | |||
{ | |||
CaitlibOutPort* newPort = (CaitlibOutPort*)malloc(sizeof(CaitlibOutPort)); | |||
newPort->id = nextId; | |||
newPort->port = jack_port_register(handlePtr->client, portName, JACK_DEFAULT_MIDI_TYPE, JackPortIsOutput, 0); | |||
INIT_LIST_HEAD(&newPort->queue); | |||
handlePtr->midiOuts[handlePtr->midiOutCount++] = newPort; | |||
} | |||
#endif | |||
return nextId; | |||
} | |||
void caitlib_destroy_port(CaitlibHandle handle, uint32_t port) | |||
{ | |||
// wait for jack processing to end | |||
handlePtr->doProcess = false; | |||
pthread_mutex_lock(&handlePtr->mutex); | |||
#ifdef USE_LIST_HEAD_OUTS | |||
#else | |||
// re-allocate pointers (midiOutCount - 1) | |||
{ | |||
CaitlibOutPort* oldMidiOuts[handlePtr->midiOutCount]; | |||
for (uint32_t i = 0; i < handlePtr->midiOutCount; i++) | |||
oldMidiOuts[i] = handlePtr->midiOuts[i]; | |||
if (handlePtr->midiOuts) | |||
free(handlePtr->midiOuts); | |||
if (handlePtr->midiOutCount == 1) | |||
{ | |||
handlePtr->midiOuts = NULL; | |||
} | |||
else | |||
{ | |||
handlePtr->midiOuts = (CaitlibOutPort**)malloc(sizeof(CaitlibOutPort*) * (handlePtr->midiOutCount-1)); | |||
for (uint32_t i = 0, j = 0; i < handlePtr->midiOutCount; i++) | |||
{ | |||
if (oldMidiOuts[i]->id != port) | |||
handlePtr->midiOuts[j++] = oldMidiOuts[i]; | |||
} | |||
} | |||
handlePtr->midiOutCount--; | |||
} | |||
#endif | |||
pthread_mutex_unlock(&handlePtr->mutex); | |||
handlePtr->doProcess = true; | |||
return; | |||
(void)port; | |||
} | |||
// ------------------------------------------------------------------------------------------ | |||
// Input | |||
void caitlib_want_events(CaitlibHandle handle, bool yesNo) | |||
{ | |||
pthread_mutex_lock(&handlePtr->mutex); | |||
handlePtr->wantEvents = yesNo; | |||
pthread_mutex_unlock(&handlePtr->mutex); | |||
} | |||
MidiEvent* caitlib_get_event(CaitlibHandle handle) | |||
{ | |||
static MidiEvent midiEvent; | |||
ListHead* nodePtr; | |||
RawMidiEvent* rawEventPtr; | |||
pthread_mutex_lock(&handlePtr->mutex); | |||
if (list_empty(&handlePtr->inQueue)) | |||
{ | |||
pthread_mutex_unlock(&handlePtr->mutex); | |||
return NULL; | |||
} | |||
nodePtr = handlePtr->inQueue.prev; | |||
list_del(nodePtr); | |||
rawEventPtr = list_entry(nodePtr, RawMidiEvent, siblings); | |||
pthread_mutex_unlock(&handlePtr->mutex); | |||
midiEvent.channel = rawEventPtr->data[0] & 0x0F; | |||
midiEvent.time = rawEventPtr->time; | |||
// note off | |||
if (rawEventPtr->dataSize == 3 && (rawEventPtr->data[0] & 0xF0) == MIDI_EVENT_TYPE_NOTE_OFF) | |||
{ | |||
midiEvent.type = MIDI_EVENT_TYPE_NOTE_OFF; | |||
midiEvent.data.note.note = rawEventPtr->data[1]; | |||
midiEvent.data.note.velocity = rawEventPtr->data[2]; | |||
} | |||
// note on | |||
else if (rawEventPtr->dataSize == 3 && (rawEventPtr->data[0] & 0xF0) == MIDI_EVENT_TYPE_NOTE_ON) | |||
{ | |||
midiEvent.type = MIDI_EVENT_TYPE_NOTE_ON; | |||
midiEvent.data.note.note = rawEventPtr->data[1]; | |||
midiEvent.data.note.velocity = rawEventPtr->data[2]; | |||
} | |||
// aftertouch | |||
else if (rawEventPtr->dataSize == 3 && (rawEventPtr->data[0] & 0xF0) == MIDI_EVENT_TYPE_AFTER_TOUCH) | |||
{ | |||
midiEvent.type = MIDI_EVENT_TYPE_AFTER_TOUCH; | |||
midiEvent.data.note.note = rawEventPtr->data[1]; | |||
midiEvent.data.note.velocity = rawEventPtr->data[2]; | |||
} | |||
// control | |||
else if (rawEventPtr->dataSize == 3 && (rawEventPtr->data[0] & 0xF0) == MIDI_EVENT_TYPE_CONTROL) | |||
{ | |||
midiEvent.type = MIDI_EVENT_TYPE_CONTROL; | |||
midiEvent.data.control.controller = rawEventPtr->data[1]; | |||
midiEvent.data.control.value = rawEventPtr->data[2]; | |||
} | |||
// program | |||
else if (rawEventPtr->dataSize == 2 && (rawEventPtr->data[0] & 0xF0) == MIDI_EVENT_TYPE_PROGRAM) | |||
{ | |||
midiEvent.type = MIDI_EVENT_TYPE_PROGRAM; | |||
midiEvent.data.program.value = rawEventPtr->data[1]; | |||
} | |||
// channel pressure | |||
else if (rawEventPtr->dataSize == 2 && (rawEventPtr->data[0] & 0xF0) == MIDI_EVENT_TYPE_CHANNEL_PRESSURE) | |||
{ | |||
midiEvent.type = MIDI_EVENT_TYPE_CHANNEL_PRESSURE; | |||
midiEvent.data.pressure.value = rawEventPtr->data[1]; | |||
} | |||
// pitch wheel | |||
else if (rawEventPtr->dataSize == 3 && (rawEventPtr->data[0] & 0xF0) == MIDI_EVENT_TYPE_PITCH_WHEEL) | |||
{ | |||
midiEvent.type = MIDI_EVENT_TYPE_PITCH_WHEEL; | |||
midiEvent.data.pitchwheel.value = ((rawEventPtr->data[2] << 7) | rawEventPtr->data[1]) - 8192; | |||
} | |||
else | |||
{ | |||
midiEvent.type = MIDI_EVENT_TYPE_NULL; | |||
} | |||
rtsafe_memory_pool_deallocate(handlePtr->mempool, rawEventPtr); | |||
return &midiEvent; | |||
} | |||
// ------------------------------------------------------------------------------------------ | |||
// Output (utils) | |||
void caitlib_midi_encode_control(RawMidiEvent* eventPtr, uint8_t channel, uint8_t control, uint8_t value) | |||
{ | |||
eventPtr->data[0] = MIDI_EVENT_TYPE_CONTROL | (channel & 0x0F); | |||
eventPtr->data[1] = control; | |||
eventPtr->data[2] = value; | |||
eventPtr->dataSize = 3; | |||
} | |||
void caitlib_midi_encode_note_on(RawMidiEvent* eventPtr, uint8_t channel, uint8_t note, uint8_t velocity) | |||
{ | |||
eventPtr->data[0] = MIDI_EVENT_TYPE_NOTE_ON | (channel & 0x0F); | |||
eventPtr->data[1] = note; | |||
eventPtr->data[2] = velocity; | |||
eventPtr->dataSize = 3; | |||
} | |||
void caitlib_midi_encode_note_off(RawMidiEvent* eventPtr, uint8_t channel, uint8_t note, uint8_t velocity) | |||
{ | |||
eventPtr->data[0] = MIDI_EVENT_TYPE_NOTE_OFF | (channel & 0x0F); | |||
eventPtr->data[1] = note; | |||
eventPtr->data[2] = velocity; | |||
eventPtr->dataSize = 3; | |||
} | |||
void caitlib_midi_encode_aftertouch(RawMidiEvent* eventPtr, uint8_t channel, uint8_t note, uint8_t pressure) | |||
{ | |||
eventPtr->data[0] = MIDI_EVENT_TYPE_AFTER_TOUCH | (channel & 0x0F); | |||
eventPtr->data[1] = note; | |||
eventPtr->data[2] = pressure; | |||
eventPtr->dataSize = 3; | |||
} | |||
void caitlib_midi_encode_channel_pressure(RawMidiEvent* eventPtr, uint8_t channel, uint8_t pressure) | |||
{ | |||
eventPtr->data[0] = MIDI_EVENT_TYPE_CHANNEL_PRESSURE | (channel & 0x0F); | |||
eventPtr->data[1] = pressure; | |||
eventPtr->dataSize = 2; | |||
} | |||
void caitlib_midi_encode_program(RawMidiEvent* eventPtr, uint8_t channel, uint8_t program) | |||
{ | |||
eventPtr->data[0] = MIDI_EVENT_TYPE_PROGRAM | (channel & 0x0F); | |||
eventPtr->data[1] = program; | |||
eventPtr->dataSize = 2; | |||
} | |||
void caitlib_midi_encode_pitchwheel(RawMidiEvent* eventPtr, uint8_t channel, int16_t pitchwheel) | |||
{ | |||
pitchwheel += 8192; | |||
eventPtr->data[0] = MIDI_EVENT_TYPE_PITCH_WHEEL | (channel & 0x0F); | |||
eventPtr->data[1] = pitchwheel & 0x7F; | |||
eventPtr->data[2] = pitchwheel >> 7; | |||
eventPtr->dataSize = 3; | |||
} | |||
// ------------------------------------------------------------------------------------------ | |||
// Output | |||
void caitlib_put_event(CaitlibHandle handle, uint32_t port, const MidiEvent* event) | |||
{ | |||
#ifdef USE_LIST_HEAD_OUTS | |||
ListHead* entryPtr; | |||
#endif | |||
RawMidiEvent* eventPtr; | |||
CaitlibOutPort* outPortPtr; | |||
bool portFound = false; | |||
eventPtr = rtsafe_memory_pool_allocate_sleepy(handlePtr->mempool); | |||
eventPtr->time = event->time; | |||
switch (event->type) | |||
{ | |||
case MIDI_EVENT_TYPE_CONTROL: | |||
caitlib_midi_encode_control(eventPtr, event->channel, event->data.control.controller, event->data.control.value); | |||
break; | |||
case MIDI_EVENT_TYPE_NOTE_ON: | |||
caitlib_midi_encode_note_on(eventPtr, event->channel, event->data.note.note, event->data.note.velocity); | |||
break; | |||
case MIDI_EVENT_TYPE_NOTE_OFF: | |||
caitlib_midi_encode_note_off(eventPtr, event->channel, event->data.note.note, event->data.note.velocity); | |||
break; | |||
case MIDI_EVENT_TYPE_AFTER_TOUCH: | |||
caitlib_midi_encode_aftertouch(eventPtr, event->channel, event->data.note.note, event->data.note.velocity); | |||
break; | |||
case MIDI_EVENT_TYPE_CHANNEL_PRESSURE: | |||
caitlib_midi_encode_channel_pressure(eventPtr, event->channel, event->data.pressure.value); | |||
break; | |||
case MIDI_EVENT_TYPE_PROGRAM: | |||
caitlib_midi_encode_program(eventPtr, event->channel, event->data.program.value); | |||
break; | |||
case MIDI_EVENT_TYPE_PITCH_WHEEL: | |||
caitlib_midi_encode_pitchwheel(eventPtr, event->channel, event->data.pitchwheel.value); | |||
break; | |||
default: | |||
return; | |||
} | |||
pthread_mutex_lock(&handlePtr->mutex); | |||
#ifdef USE_LIST_HEAD_OUTS | |||
list_for_each(entryPtr, &handlePtr->outPorts) | |||
{ | |||
outPortPtr = list_entry(entryPtr, CaitlibOutPort, siblings); | |||
if (outPortPtr->id == port) | |||
{ | |||
list_add_tail(&eventPtr->siblings, &outPortPtr->queue); | |||
break; | |||
} | |||
} | |||
#else | |||
for (uint32_t i = 0; i < handlePtr->midiOutCount; i++) | |||
{ | |||
outPortPtr = handlePtr->midiOuts[i]; | |||
if (outPortPtr->id == port) | |||
{ | |||
portFound = true; | |||
list_add_tail(&eventPtr->siblings, &outPortPtr->queue); | |||
break; | |||
} | |||
} | |||
#endif | |||
if (! portFound) | |||
printf("caitlib_put_event(%p, %i, %p) - failed to find port", handle, port, event); | |||
pthread_mutex_unlock(&handlePtr->mutex); | |||
} | |||
void caitlib_put_control(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t control, uint8_t value) | |||
{ | |||
MidiEvent event; | |||
event.type = MIDI_EVENT_TYPE_CONTROL; | |||
event.channel = channel; | |||
event.time = time; | |||
event.data.control.controller = control; | |||
event.data.control.value = value; | |||
caitlib_put_event(handle, port, &event); | |||
} | |||
void caitlib_put_note_on(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t note, uint8_t velocity) | |||
{ | |||
MidiEvent event; | |||
event.type = MIDI_EVENT_TYPE_NOTE_ON; | |||
event.channel = channel; | |||
event.time = time; | |||
event.data.note.note = note; | |||
event.data.note.velocity = velocity; | |||
caitlib_put_event(handle, port, &event); | |||
} | |||
void caitlib_put_note_off(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t note, uint8_t velocity) | |||
{ | |||
MidiEvent event; | |||
event.type = MIDI_EVENT_TYPE_NOTE_OFF; | |||
event.channel = channel; | |||
event.time = time; | |||
event.data.note.note = note; | |||
event.data.note.velocity = velocity; | |||
caitlib_put_event(handle, port, &event); | |||
} | |||
void caitlib_put_aftertouch(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t note, uint8_t pressure) | |||
{ | |||
MidiEvent event; | |||
event.type = MIDI_EVENT_TYPE_AFTER_TOUCH; | |||
event.channel = channel; | |||
event.time = time; | |||
event.data.note.note = note; | |||
event.data.note.velocity = pressure; | |||
caitlib_put_event(handle, port, &event); | |||
} | |||
void caitlib_put_channel_pressure(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t pressure) | |||
{ | |||
MidiEvent event; | |||
event.type = MIDI_EVENT_TYPE_CHANNEL_PRESSURE; | |||
event.channel = channel; | |||
event.time = time; | |||
event.data.pressure.value = pressure; | |||
caitlib_put_event(handle, port, &event); | |||
} | |||
void caitlib_put_program(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t program) | |||
{ | |||
MidiEvent event; | |||
event.type = MIDI_EVENT_TYPE_PROGRAM; | |||
event.channel = channel; | |||
event.time = time; | |||
event.data.program.value = program; | |||
caitlib_put_event(handle, port, &event); | |||
} | |||
void caitlib_put_pitchwheel(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, int16_t value) | |||
{ | |||
MidiEvent event; | |||
event.type = MIDI_EVENT_TYPE_PITCH_WHEEL; | |||
event.channel = channel; | |||
event.time = time; | |||
event.data.pitchwheel.value = value; | |||
caitlib_put_event(handle, port, &event); | |||
} |
@@ -1,287 +0,0 @@ | |||
# Doxyfile 1.7.6.1 | |||
#--------------------------------------------------------------------------- | |||
# Project related configuration options | |||
#--------------------------------------------------------------------------- | |||
DOXYFILE_ENCODING = UTF-8 | |||
PROJECT_NAME = "Caitlib" | |||
PROJECT_NUMBER = | |||
PROJECT_BRIEF = | |||
PROJECT_LOGO = | |||
OUTPUT_DIRECTORY = ../../doc/caitlib | |||
CREATE_SUBDIRS = NO | |||
OUTPUT_LANGUAGE = English | |||
BRIEF_MEMBER_DESC = YES | |||
REPEAT_BRIEF = YES | |||
ABBREVIATE_BRIEF = | |||
ALWAYS_DETAILED_SEC = NO | |||
INLINE_INHERITED_MEMB = NO | |||
FULL_PATH_NAMES = YES | |||
STRIP_FROM_PATH = | |||
STRIP_FROM_INC_PATH = | |||
SHORT_NAMES = NO | |||
JAVADOC_AUTOBRIEF = NO | |||
QT_AUTOBRIEF = NO | |||
MULTILINE_CPP_IS_BRIEF = NO | |||
INHERIT_DOCS = YES | |||
SEPARATE_MEMBER_PAGES = NO | |||
TAB_SIZE = 4 | |||
ALIASES = | |||
TCL_SUBST = | |||
OPTIMIZE_OUTPUT_FOR_C = NO | |||
OPTIMIZE_OUTPUT_JAVA = NO | |||
OPTIMIZE_FOR_FORTRAN = NO | |||
OPTIMIZE_OUTPUT_VHDL = NO | |||
EXTENSION_MAPPING = | |||
BUILTIN_STL_SUPPORT = NO | |||
CPP_CLI_SUPPORT = NO | |||
SIP_SUPPORT = NO | |||
IDL_PROPERTY_SUPPORT = YES | |||
DISTRIBUTE_GROUP_DOC = NO | |||
SUBGROUPING = YES | |||
INLINE_GROUPED_CLASSES = NO | |||
INLINE_SIMPLE_STRUCTS = NO | |||
TYPEDEF_HIDES_STRUCT = NO | |||
SYMBOL_CACHE_SIZE = 0 | |||
LOOKUP_CACHE_SIZE = 0 | |||
#--------------------------------------------------------------------------- | |||
# Build related configuration options | |||
#--------------------------------------------------------------------------- | |||
EXTRACT_ALL = YES | |||
EXTRACT_PRIVATE = NO | |||
EXTRACT_STATIC = NO | |||
EXTRACT_LOCAL_CLASSES = YES | |||
EXTRACT_LOCAL_METHODS = NO | |||
EXTRACT_ANON_NSPACES = NO | |||
HIDE_UNDOC_MEMBERS = NO | |||
HIDE_UNDOC_CLASSES = NO | |||
HIDE_FRIEND_COMPOUNDS = NO | |||
HIDE_IN_BODY_DOCS = NO | |||
INTERNAL_DOCS = NO | |||
CASE_SENSE_NAMES = YES | |||
HIDE_SCOPE_NAMES = NO | |||
SHOW_INCLUDE_FILES = YES | |||
FORCE_LOCAL_INCLUDES = NO | |||
INLINE_INFO = YES | |||
SORT_MEMBER_DOCS = NO | |||
SORT_BRIEF_DOCS = NO | |||
SORT_MEMBERS_CTORS_1ST = NO | |||
SORT_GROUP_NAMES = NO | |||
SORT_BY_SCOPE_NAME = NO | |||
STRICT_PROTO_MATCHING = NO | |||
GENERATE_TODOLIST = YES | |||
GENERATE_TESTLIST = YES | |||
GENERATE_BUGLIST = YES | |||
GENERATE_DEPRECATEDLIST= YES | |||
ENABLED_SECTIONS = | |||
MAX_INITIALIZER_LINES = 30 | |||
SHOW_USED_FILES = YES | |||
SHOW_DIRECTORIES = NO | |||
SHOW_FILES = YES | |||
SHOW_NAMESPACES = YES | |||
FILE_VERSION_FILTER = | |||
LAYOUT_FILE = | |||
CITE_BIB_FILES = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to warning and progress messages | |||
#--------------------------------------------------------------------------- | |||
QUIET = NO | |||
WARNINGS = YES | |||
WARN_IF_UNDOCUMENTED = YES | |||
WARN_IF_DOC_ERROR = YES | |||
WARN_NO_PARAMDOC = NO | |||
WARN_FORMAT = "$file:$line: $text" | |||
WARN_LOGFILE = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the input files | |||
#--------------------------------------------------------------------------- | |||
INPUT = | |||
INPUT_ENCODING = UTF-8 | |||
FILE_PATTERNS = | |||
RECURSIVE = NO | |||
EXCLUDE = caitlib.c list.h memory_atomic.h memory_atomic.c | |||
EXCLUDE_SYMLINKS = NO | |||
EXCLUDE_PATTERNS = | |||
EXCLUDE_SYMBOLS = | |||
EXAMPLE_PATH = | |||
EXAMPLE_PATTERNS = | |||
EXAMPLE_RECURSIVE = NO | |||
IMAGE_PATH = | |||
INPUT_FILTER = | |||
FILTER_PATTERNS = | |||
FILTER_SOURCE_FILES = NO | |||
FILTER_SOURCE_PATTERNS = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to source browsing | |||
#--------------------------------------------------------------------------- | |||
SOURCE_BROWSER = NO | |||
INLINE_SOURCES = NO | |||
STRIP_CODE_COMMENTS = YES | |||
REFERENCED_BY_RELATION = NO | |||
REFERENCES_RELATION = NO | |||
REFERENCES_LINK_SOURCE = YES | |||
USE_HTAGS = NO | |||
VERBATIM_HEADERS = YES | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the alphabetical class index | |||
#--------------------------------------------------------------------------- | |||
ALPHABETICAL_INDEX = YES | |||
COLS_IN_ALPHA_INDEX = 5 | |||
IGNORE_PREFIX = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the HTML output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_HTML = YES | |||
HTML_OUTPUT = . | |||
HTML_FILE_EXTENSION = .html | |||
HTML_HEADER = | |||
HTML_FOOTER = | |||
HTML_STYLESHEET = | |||
HTML_EXTRA_FILES = | |||
HTML_COLORSTYLE_HUE = 220 | |||
HTML_COLORSTYLE_SAT = 100 | |||
HTML_COLORSTYLE_GAMMA = 80 | |||
HTML_TIMESTAMP = YES | |||
HTML_ALIGN_MEMBERS = YES | |||
HTML_DYNAMIC_SECTIONS = NO | |||
GENERATE_DOCSET = NO | |||
DOCSET_FEEDNAME = "Doxygen generated docs" | |||
DOCSET_BUNDLE_ID = org.doxygen.Project | |||
DOCSET_PUBLISHER_ID = org.doxygen.Publisher | |||
DOCSET_PUBLISHER_NAME = Publisher | |||
GENERATE_HTMLHELP = NO | |||
CHM_FILE = | |||
HHC_LOCATION = | |||
GENERATE_CHI = NO | |||
CHM_INDEX_ENCODING = | |||
BINARY_TOC = NO | |||
TOC_EXPAND = NO | |||
GENERATE_QHP = NO | |||
QCH_FILE = | |||
QHP_NAMESPACE = org.doxygen.Project | |||
QHP_VIRTUAL_FOLDER = doc | |||
QHP_CUST_FILTER_NAME = | |||
QHP_CUST_FILTER_ATTRS = | |||
QHP_SECT_FILTER_ATTRS = | |||
QHG_LOCATION = | |||
GENERATE_ECLIPSEHELP = NO | |||
ECLIPSE_DOC_ID = org.doxygen.Project | |||
DISABLE_INDEX = NO | |||
GENERATE_TREEVIEW = NO | |||
ENUM_VALUES_PER_LINE = 4 | |||
USE_INLINE_TREES = NO | |||
TREEVIEW_WIDTH = 250 | |||
EXT_LINKS_IN_WINDOW = NO | |||
FORMULA_FONTSIZE = 10 | |||
FORMULA_TRANSPARENT = YES | |||
USE_MATHJAX = NO | |||
MATHJAX_RELPATH = http://www.mathjax.org/mathjax | |||
MATHJAX_EXTENSIONS = | |||
SEARCHENGINE = YES | |||
SERVER_BASED_SEARCH = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the LaTeX output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_LATEX = NO | |||
LATEX_OUTPUT = latex | |||
LATEX_CMD_NAME = latex | |||
MAKEINDEX_CMD_NAME = makeindex | |||
COMPACT_LATEX = NO | |||
PAPER_TYPE = a4 | |||
EXTRA_PACKAGES = | |||
LATEX_HEADER = | |||
LATEX_FOOTER = | |||
PDF_HYPERLINKS = YES | |||
USE_PDFLATEX = YES | |||
LATEX_BATCHMODE = NO | |||
LATEX_HIDE_INDICES = NO | |||
LATEX_SOURCE_CODE = NO | |||
LATEX_BIB_STYLE = plain | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the RTF output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_RTF = NO | |||
RTF_OUTPUT = rtf | |||
COMPACT_RTF = NO | |||
RTF_HYPERLINKS = NO | |||
RTF_STYLESHEET_FILE = | |||
RTF_EXTENSIONS_FILE = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the man page output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_MAN = NO | |||
MAN_OUTPUT = man | |||
MAN_EXTENSION = .3 | |||
MAN_LINKS = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the XML output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_XML = NO | |||
XML_OUTPUT = xml | |||
XML_SCHEMA = | |||
XML_DTD = | |||
XML_PROGRAMLISTING = YES | |||
#--------------------------------------------------------------------------- | |||
# configuration options for the AutoGen Definitions output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_AUTOGEN_DEF = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the Perl module output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_PERLMOD = NO | |||
PERLMOD_LATEX = NO | |||
PERLMOD_PRETTY = YES | |||
PERLMOD_MAKEVAR_PREFIX = | |||
#--------------------------------------------------------------------------- | |||
# Configuration options related to the preprocessor | |||
#--------------------------------------------------------------------------- | |||
ENABLE_PREPROCESSING = YES | |||
MACRO_EXPANSION = NO | |||
EXPAND_ONLY_PREDEF = NO | |||
SEARCH_INCLUDES = YES | |||
INCLUDE_PATH = | |||
INCLUDE_FILE_PATTERNS = | |||
PREDEFINED = DOXYGEN | |||
EXPAND_AS_DEFINED = | |||
SKIP_FUNCTION_MACROS = YES | |||
#--------------------------------------------------------------------------- | |||
# Configuration::additions related to external references | |||
#--------------------------------------------------------------------------- | |||
TAGFILES = | |||
GENERATE_TAGFILE = | |||
ALLEXTERNALS = NO | |||
EXTERNAL_GROUPS = YES | |||
PERL_PATH = /usr/bin/perl | |||
#--------------------------------------------------------------------------- | |||
# Configuration options related to the dot tool | |||
#--------------------------------------------------------------------------- | |||
CLASS_DIAGRAMS = YES | |||
MSCGEN_PATH = | |||
HIDE_UNDOC_RELATIONS = YES | |||
HAVE_DOT = NO | |||
DOT_NUM_THREADS = 0 | |||
DOT_FONTNAME = Helvetica | |||
DOT_FONTSIZE = 10 | |||
DOT_FONTPATH = | |||
CLASS_GRAPH = YES | |||
COLLABORATION_GRAPH = YES | |||
GROUP_GRAPHS = YES | |||
UML_LOOK = NO | |||
TEMPLATE_RELATIONS = NO | |||
INCLUDE_GRAPH = YES | |||
INCLUDED_BY_GRAPH = YES | |||
CALL_GRAPH = NO | |||
CALLER_GRAPH = NO | |||
GRAPHICAL_HIERARCHY = YES | |||
DIRECTORY_GRAPH = YES | |||
DOT_IMAGE_FORMAT = png | |||
INTERACTIVE_SVG = NO | |||
DOT_PATH = | |||
DOTFILE_DIRS = | |||
MSCFILE_DIRS = | |||
DOT_GRAPH_MAX_NODES = 50 | |||
MAX_DOT_GRAPH_DEPTH = 0 | |||
DOT_TRANSPARENT = NO | |||
DOT_MULTI_TARGETS = YES | |||
GENERATE_LEGEND = YES | |||
DOT_CLEANUP = YES |
@@ -1,268 +0,0 @@ | |||
/* | |||
* Caitlib | |||
* Copyright (C) 2007 Nedko Arnaudov <nedko@arnaudov.name> | |||
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CAITLIB_INCLUDED | |||
#define CAITLIB_INCLUDED | |||
#ifdef __cplusplus | |||
extern "C" { | |||
#else | |||
# include <stdbool.h> | |||
#endif | |||
#include <stdint.h> | |||
#ifdef _WIN32 | |||
# define CAITLIB_EXPORT __declspec (dllexport) | |||
#else | |||
# define CAITLIB_EXPORT __attribute__ ((visibility("default"))) | |||
#endif | |||
/*! | |||
* @defgroup CaitlibAPI Caitlib API | |||
* | |||
* The Caitlib API | |||
* | |||
* @{ | |||
*/ | |||
/*! | |||
* Native handle for all Caitlib calls. | |||
*/ | |||
typedef void* CaitlibHandle; | |||
/*! | |||
* @defgroup MidiEventType MidiEvent Type | |||
* @{ | |||
*/ | |||
#define MIDI_EVENT_TYPE_NULL 0x00 //!< Null Event. | |||
#define MIDI_EVENT_TYPE_NOTE_OFF 0x80 //!< Note-Off Event, uses Note data. | |||
#define MIDI_EVENT_TYPE_NOTE_ON 0x90 //!< Note-On Event, uses Note data. | |||
#define MIDI_EVENT_TYPE_AFTER_TOUCH 0xA0 //!< [Key] AfterTouch Event, uses Note data. | |||
#define MIDI_EVENT_TYPE_CONTROL 0xB0 //!< Control Event, uses Control data. | |||
#define MIDI_EVENT_TYPE_PROGRAM 0xC0 //!< Program Event, uses Program data. | |||
#define MIDI_EVENT_TYPE_CHANNEL_PRESSURE 0xD0 //!< Channel Pressure Event, uses Pressure data. | |||
#define MIDI_EVENT_TYPE_PITCH_WHEEL 0xE0 //!< PitchWheel Event, uses PitchWheel data. | |||
#define MIDI_EVENT_TYPE_TIME 0xF1 //!< Time Event, uses Time Data. | |||
/**@}*/ | |||
/*! | |||
* MidiEvent in Caitlib | |||
*/ | |||
typedef struct _MidiEvent | |||
{ | |||
/*! | |||
* MidiEvent Type | |||
*/ | |||
uint16_t type; | |||
/*! | |||
* MidiEvent Channel (0 - 16) | |||
*/ | |||
uint8_t channel; | |||
/*! | |||
* MidiEvent Data (values depend on type). | |||
* \note Time event types ignore channel value. | |||
*/ | |||
union MidiEventData { | |||
struct MidiEventControl { | |||
uint8_t controller; | |||
uint8_t value; | |||
} control; | |||
struct MidiEventNote { | |||
uint8_t note; | |||
uint8_t velocity; | |||
} note; | |||
struct MidiEventPressure { | |||
uint8_t value; | |||
} pressure; | |||
struct MidiEventProgram { | |||
uint8_t value; | |||
} program; | |||
struct MidiEventPitchWheel { | |||
int16_t value; | |||
} pitchwheel; | |||
struct MidiEventTime { | |||
double bpm; | |||
uint8_t sigNum; | |||
uint8_t sigDenum; | |||
} time; | |||
#ifndef DOXYGEN | |||
// padding for future events | |||
struct _MidiEventPadding { | |||
uint8_t pad[128]; | |||
} __padding; | |||
#endif | |||
} data; | |||
/*! | |||
* MidiEvent Time (in frames) | |||
*/ | |||
uint32_t time; | |||
} MidiEvent; | |||
// ------------------------------------------------------------------------------------------ | |||
/*! | |||
* @defgroup Initialization | |||
* | |||
* Functions for initialization and destruction of Caitlib instances. | |||
* @{ | |||
*/ | |||
/*! | |||
* Initialize a new Caitlib instance with name \a instanceName.\n | |||
* Must be closed when no longer needed with caitlib_close(). | |||
* | |||
* \note MIDI Input is disabled by default, call caitlib_want_events() to enable them. | |||
* \note There are no MIDI Output ports by default, call caitlib_create_port() for that. | |||
*/ | |||
CAITLIB_EXPORT | |||
CaitlibHandle caitlib_init(const char* instanceName); | |||
/*! | |||
* Close a previously opened Caitlib instance.\n | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_close(CaitlibHandle handle); | |||
/*! | |||
* Create a new MIDI Output port with name \a portName.\n | |||
* The return value is the ID for the port, which must be passed for any functions in the Output group.\n | |||
* The ID will be >= 0 for a valid port, or -1 if an error occurred. | |||
*/ | |||
CAITLIB_EXPORT | |||
uint32_t caitlib_create_port(CaitlibHandle handle, const char* portName); | |||
/*! | |||
* Close a previously opened Caitlib instance.\n | |||
* There's no need to call this function before caitlib_close(). | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_destroy_port(CaitlibHandle handle, uint32_t port); | |||
/**@}*/ | |||
// ------------------------------------------------------------------------------------------ | |||
/*! | |||
* @defgroup Input | |||
* | |||
* Functions for MIDI Input handling. | |||
* @{ | |||
*/ | |||
/*! | |||
* Tell a Caitlib instance wherever if we're interested in MIDI Input.\n | |||
* By default MIDI Input is disabled.\n | |||
* It's safe to call this function multiple times during the lifetime of an instance. | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_want_events(CaitlibHandle handle, bool yesNo); | |||
/*! | |||
* Get a MidiEvent from a Caitlib instance buffer.\n | |||
* When there are no more messages in the buffer, this function returns NULL. | |||
*/ | |||
CAITLIB_EXPORT | |||
MidiEvent* caitlib_get_event(CaitlibHandle handle); | |||
/**@}*/ | |||
// ------------------------------------------------------------------------------------------ | |||
/*! | |||
* @defgroup Output | |||
* | |||
* Functions for putting data into Caitlib instances (MIDI Output). | |||
* @{ | |||
*/ | |||
/*! | |||
* Put a MIDI event into a Caitlib instance port. | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_put_event(CaitlibHandle handle, uint32_t port, const MidiEvent* event); | |||
/*! | |||
* Put a MIDI Control event into a Caitlib instance port. | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_put_control(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t controller, uint8_t value); | |||
/*! | |||
* Put a MIDI Note On event into a Caitlib instance port. | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_put_note_on(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t note, uint8_t velocity); | |||
/*! | |||
* Put a MIDI Note Off event into a Caitlib instance port. | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_put_note_off(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t note, uint8_t velocity); | |||
/*! | |||
* Put a MIDI AfterTouch event into a Caitlib instance port. | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_put_aftertouch(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t note, uint8_t pressure); | |||
/*! | |||
* Put a MIDI Channel Pressure event into a Caitlib instance port. | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_put_channel_pressure(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t pressure); | |||
/*! | |||
* Put a MIDI Program event into a Caitlib instance port. | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_put_program(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, uint8_t program); | |||
/*! | |||
* Put a MIDI PitchWheel event into a Caitlib instance port. | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_put_pitchwheel(CaitlibHandle handle, uint32_t port, uint32_t time, uint8_t channel, int16_t value); | |||
/*! | |||
* Put a MIDI Time event into a Caitlib instance. | |||
*/ | |||
CAITLIB_EXPORT | |||
void caitlib_put_time(CaitlibHandle handle, uint32_t time, double bpm, uint8_t sigNum, uint8_t sigDenum); | |||
/**@}*/ | |||
// ------------------------------------------------------------------------------------------ | |||
/**@}*/ | |||
#ifdef __cplusplus | |||
} | |||
#endif | |||
#endif // CAITLIB_INCLUDED |
@@ -1,33 +0,0 @@ | |||
# QtCreator project file | |||
CONFIG = debug | |||
CONFIG += link_pkgconfig warn_on # plugin shared | |||
DEFINES = DEBUG | |||
DEFINES += QTCREATOR_TEST | |||
DEFINES += _GNU_SOURCE | |||
PKGCONFIG = jack | |||
TARGET = caitlib | |||
TEMPLATE = app # lib | |||
VERSION = 0.0.1 | |||
SOURCES = \ | |||
caitlib.c \ | |||
memory_atomic.c | |||
SOURCES += \ | |||
test.c | |||
HEADERS = \ | |||
caitlib.h | |||
INCLUDEPATH = . | |||
QMAKE_CFLAGS *= -fvisibility=hidden -fPIC -Wextra -Werror -std=gnu99 | |||
unix { | |||
LIBS = -lm -lpthread | |||
} |
@@ -1,874 +0,0 @@ | |||
/* -*- Mode: C ; c-basic-offset: 2 -*- */ | |||
/***************************************************************************** | |||
* | |||
* Linux kernel header adapted for user-mode | |||
* The 2.6.17-rt1 version was used. | |||
* | |||
* Original copyright holders of this code are unknown, they were not | |||
* mentioned in the original file. | |||
* | |||
* This program 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; version 2 of the License | |||
* | |||
* This program 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 this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |||
* | |||
*****************************************************************************/ | |||
#ifndef _LINUX_LIST_H | |||
#define _LINUX_LIST_H | |||
#include <stddef.h> | |||
#if !defined(offsetof) | |||
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) | |||
#endif | |||
/** | |||
* container_of - cast a member of a structure out to the containing structure | |||
* @ptr: the pointer to the member. | |||
* @type: the type of the container struct this is embedded in. | |||
* @member: the name of the member within the struct. | |||
* | |||
*/ | |||
#define container_of(ptr, type, member) ({ \ | |||
const typeof( ((type *)0)->member ) *__mptr = (ptr); \ | |||
(type *)( (char *)__mptr - offsetof(type,member) );}) | |||
#define prefetch(x) (x = x) | |||
/* | |||
* These are non-NULL pointers that will result in page faults | |||
* under normal circumstances, used to verify that nobody uses | |||
* non-initialized list entries. | |||
*/ | |||
#define LIST_POISON1 ((void *) 0x00100100) | |||
#define LIST_POISON2 ((void *) 0x00200200) | |||
/* | |||
* Simple doubly linked list implementation. | |||
* | |||
* Some of the internal functions ("__xxx") are useful when | |||
* manipulating whole lists rather than single entries, as | |||
* sometimes we already know the next/prev entries and we can | |||
* generate better code by using them directly rather than | |||
* using the generic single-entry routines. | |||
*/ | |||
struct list_head { | |||
struct list_head *next, *prev; | |||
}; | |||
#define LIST_HEAD_INIT(name) { &(name), &(name) } | |||
#define LIST_HEAD(name) \ | |||
struct list_head name = LIST_HEAD_INIT(name) | |||
static inline void INIT_LIST_HEAD(struct list_head *list) | |||
{ | |||
list->next = list; | |||
list->prev = list; | |||
} | |||
/* | |||
* Insert a new entry between two known consecutive entries. | |||
* | |||
* This is only for internal list manipulation where we know | |||
* the prev/next entries already! | |||
*/ | |||
static inline void __list_add(struct list_head *new, | |||
struct list_head *prev, | |||
struct list_head *next) | |||
{ | |||
next->prev = new; | |||
new->next = next; | |||
new->prev = prev; | |||
prev->next = new; | |||
} | |||
/** | |||
* list_add - add a new entry | |||
* @new: new entry to be added | |||
* @head: list head to add it after | |||
* | |||
* Insert a new entry after the specified head. | |||
* This is good for implementing stacks. | |||
*/ | |||
static inline void list_add(struct list_head *new, struct list_head *head) | |||
{ | |||
__list_add(new, head, head->next); | |||
} | |||
/** | |||
* list_add_tail - add a new entry | |||
* @new: new entry to be added | |||
* @head: list head to add it before | |||
* | |||
* Insert a new entry before the specified head. | |||
* This is useful for implementing queues. | |||
*/ | |||
static inline void list_add_tail(struct list_head *new, struct list_head *head) | |||
{ | |||
__list_add(new, head->prev, head); | |||
} | |||
/* | |||
* Insert a new entry between two known consecutive entries. | |||
* | |||
* This is only for internal list manipulation where we know | |||
* the prev/next entries already! | |||
*/ | |||
static inline void __list_add_rcu(struct list_head * new, | |||
struct list_head * prev, struct list_head * next) | |||
{ | |||
new->next = next; | |||
new->prev = prev; | |||
// smp_wmb(); | |||
next->prev = new; | |||
prev->next = new; | |||
} | |||
/** | |||
* list_add_rcu - add a new entry to rcu-protected list | |||
* @new: new entry to be added | |||
* @head: list head to add it after | |||
* | |||
* Insert a new entry after the specified head. | |||
* This is good for implementing stacks. | |||
* | |||
* The caller must take whatever precautions are necessary | |||
* (such as holding appropriate locks) to avoid racing | |||
* with another list-mutation primitive, such as list_add_rcu() | |||
* or list_del_rcu(), running on this same list. | |||
* However, it is perfectly legal to run concurrently with | |||
* the _rcu list-traversal primitives, such as | |||
* list_for_each_entry_rcu(). | |||
*/ | |||
static inline void list_add_rcu(struct list_head *new, struct list_head *head) | |||
{ | |||
__list_add_rcu(new, head, head->next); | |||
} | |||
/** | |||
* list_add_tail_rcu - add a new entry to rcu-protected list | |||
* @new: new entry to be added | |||
* @head: list head to add it before | |||
* | |||
* Insert a new entry before the specified head. | |||
* This is useful for implementing queues. | |||
* | |||
* The caller must take whatever precautions are necessary | |||
* (such as holding appropriate locks) to avoid racing | |||
* with another list-mutation primitive, such as list_add_tail_rcu() | |||
* or list_del_rcu(), running on this same list. | |||
* However, it is perfectly legal to run concurrently with | |||
* the _rcu list-traversal primitives, such as | |||
* list_for_each_entry_rcu(). | |||
*/ | |||
static inline void list_add_tail_rcu(struct list_head *new, | |||
struct list_head *head) | |||
{ | |||
__list_add_rcu(new, head->prev, head); | |||
} | |||
/* | |||
* Delete a list entry by making the prev/next entries | |||
* point to each other. | |||
* | |||
* This is only for internal list manipulation where we know | |||
* the prev/next entries already! | |||
*/ | |||
static inline void __list_del(struct list_head * prev, struct list_head * next) | |||
{ | |||
next->prev = prev; | |||
prev->next = next; | |||
} | |||
/** | |||
* list_del - deletes entry from list. | |||
* @entry: the element to delete from the list. | |||
* Note: list_empty on entry does not return true after this, the entry is | |||
* in an undefined state. | |||
*/ | |||
static inline void list_del(struct list_head *entry) | |||
{ | |||
__list_del(entry->prev, entry->next); | |||
entry->next = LIST_POISON1; | |||
entry->prev = LIST_POISON2; | |||
} | |||
/** | |||
* list_del_rcu - deletes entry from list without re-initialization | |||
* @entry: the element to delete from the list. | |||
* | |||
* Note: list_empty on entry does not return true after this, | |||
* the entry is in an undefined state. It is useful for RCU based | |||
* lockfree traversal. | |||
* | |||
* In particular, it means that we can not poison the forward | |||
* pointers that may still be used for walking the list. | |||
* | |||
* The caller must take whatever precautions are necessary | |||
* (such as holding appropriate locks) to avoid racing | |||
* with another list-mutation primitive, such as list_del_rcu() | |||
* or list_add_rcu(), running on this same list. | |||
* However, it is perfectly legal to run concurrently with | |||
* the _rcu list-traversal primitives, such as | |||
* list_for_each_entry_rcu(). | |||
* | |||
* Note that the caller is not permitted to immediately free | |||
* the newly deleted entry. Instead, either synchronize_rcu() | |||
* or call_rcu() must be used to defer freeing until an RCU | |||
* grace period has elapsed. | |||
*/ | |||
static inline void list_del_rcu(struct list_head *entry) | |||
{ | |||
__list_del(entry->prev, entry->next); | |||
entry->prev = LIST_POISON2; | |||
} | |||
/* | |||
* list_replace_rcu - replace old entry by new one | |||
* @old : the element to be replaced | |||
* @new : the new element to insert | |||
* | |||
* The old entry will be replaced with the new entry atomically. | |||
*/ | |||
static inline void list_replace_rcu(struct list_head *old, | |||
struct list_head *new) | |||
{ | |||
new->next = old->next; | |||
new->prev = old->prev; | |||
// smp_wmb(); | |||
new->next->prev = new; | |||
new->prev->next = new; | |||
old->prev = LIST_POISON2; | |||
} | |||
/** | |||
* list_del_init - deletes entry from list and reinitialize it. | |||
* @entry: the element to delete from the list. | |||
*/ | |||
static inline void list_del_init(struct list_head *entry) | |||
{ | |||
__list_del(entry->prev, entry->next); | |||
INIT_LIST_HEAD(entry); | |||
} | |||
/** | |||
* list_move - delete from one list and add as another's head | |||
* @list: the entry to move | |||
* @head: the head that will precede our entry | |||
*/ | |||
static inline void list_move(struct list_head *list, struct list_head *head) | |||
{ | |||
__list_del(list->prev, list->next); | |||
list_add(list, head); | |||
} | |||
/** | |||
* list_move_tail - delete from one list and add as another's tail | |||
* @list: the entry to move | |||
* @head: the head that will follow our entry | |||
*/ | |||
static inline void list_move_tail(struct list_head *list, | |||
struct list_head *head) | |||
{ | |||
__list_del(list->prev, list->next); | |||
list_add_tail(list, head); | |||
} | |||
/** | |||
* list_empty - tests whether a list is empty | |||
* @head: the list to test. | |||
*/ | |||
static inline int list_empty(const struct list_head *head) | |||
{ | |||
return head->next == head; | |||
} | |||
/** | |||
* list_empty_careful - tests whether a list is | |||
* empty _and_ checks that no other CPU might be | |||
* in the process of still modifying either member | |||
* | |||
* NOTE: using list_empty_careful() without synchronization | |||
* can only be safe if the only activity that can happen | |||
* to the list entry is list_del_init(). Eg. it cannot be used | |||
* if another CPU could re-list_add() it. | |||
* | |||
* @head: the list to test. | |||
*/ | |||
static inline int list_empty_careful(const struct list_head *head) | |||
{ | |||
struct list_head *next = head->next; | |||
return (next == head) && (next == head->prev); | |||
} | |||
static inline void __list_splice(struct list_head *list, | |||
struct list_head *head) | |||
{ | |||
struct list_head *first = list->next; | |||
struct list_head *last = list->prev; | |||
struct list_head *at = head->next; | |||
first->prev = head; | |||
head->next = first; | |||
last->next = at; | |||
at->prev = last; | |||
} | |||
/** | |||
* list_splice - join two lists | |||
* @list: the new list to add. | |||
* @head: the place to add it in the first list. | |||
*/ | |||
static inline void list_splice(struct list_head *list, struct list_head *head) | |||
{ | |||
if (!list_empty(list)) | |||
__list_splice(list, head); | |||
} | |||
/** | |||
* list_splice_init - join two lists and reinitialise the emptied list. | |||
* @list: the new list to add. | |||
* @head: the place to add it in the first list. | |||
* | |||
* The list at @list is reinitialised | |||
*/ | |||
static inline void list_splice_init(struct list_head *list, | |||
struct list_head *head) | |||
{ | |||
if (!list_empty(list)) { | |||
__list_splice(list, head); | |||
INIT_LIST_HEAD(list); | |||
} | |||
} | |||
/** | |||
* list_entry - get the struct for this entry | |||
* @ptr: the &struct list_head pointer. | |||
* @type: the type of the struct this is embedded in. | |||
* @member: the name of the list_struct within the struct. | |||
*/ | |||
#define list_entry(ptr, type, member) \ | |||
container_of(ptr, type, member) | |||
/** | |||
* list_for_each - iterate over a list | |||
* @pos: the &struct list_head to use as a loop counter. | |||
* @head: the head for your list. | |||
*/ | |||
#define list_for_each(pos, head) \ | |||
for (pos = (head)->next; prefetch(pos->next), pos != (head); \ | |||
pos = pos->next) | |||
/** | |||
* __list_for_each - iterate over a list | |||
* @pos: the &struct list_head to use as a loop counter. | |||
* @head: the head for your list. | |||
* | |||
* This variant differs from list_for_each() in that it's the | |||
* simplest possible list iteration code, no prefetching is done. | |||
* Use this for code that knows the list to be very short (empty | |||
* or 1 entry) most of the time. | |||
*/ | |||
#define __list_for_each(pos, head) \ | |||
for (pos = (head)->next; pos != (head); pos = pos->next) | |||
/** | |||
* list_for_each_prev - iterate over a list backwards | |||
* @pos: the &struct list_head to use as a loop counter. | |||
* @head: the head for your list. | |||
*/ | |||
#define list_for_each_prev(pos, head) \ | |||
for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \ | |||
pos = pos->prev) | |||
/** | |||
* list_for_each_safe - iterate over a list safe against removal of list entry | |||
* @pos: the &struct list_head to use as a loop counter. | |||
* @n: another &struct list_head to use as temporary storage | |||
* @head: the head for your list. | |||
*/ | |||
#define list_for_each_safe(pos, n, head) \ | |||
for (pos = (head)->next, n = pos->next; pos != (head); \ | |||
pos = n, n = pos->next) | |||
/** | |||
* list_for_each_entry - iterate over list of given type | |||
* @pos: the type * to use as a loop counter. | |||
* @head: the head for your list. | |||
* @member: the name of the list_struct within the struct. | |||
*/ | |||
#define list_for_each_entry(pos, head, member) \ | |||
for (pos = list_entry((head)->next, typeof(*pos), member); \ | |||
prefetch(pos->member.next), &pos->member != (head); \ | |||
pos = list_entry(pos->member.next, typeof(*pos), member)) | |||
/** | |||
* list_for_each_entry_reverse - iterate backwards over list of given type. | |||
* @pos: the type * to use as a loop counter. | |||
* @head: the head for your list. | |||
* @member: the name of the list_struct within the struct. | |||
*/ | |||
#define list_for_each_entry_reverse(pos, head, member) \ | |||
for (pos = list_entry((head)->prev, typeof(*pos), member); \ | |||
prefetch(pos->member.prev), &pos->member != (head); \ | |||
pos = list_entry(pos->member.prev, typeof(*pos), member)) | |||
/** | |||
* list_prepare_entry - prepare a pos entry for use as a start point in | |||
* list_for_each_entry_continue | |||
* @pos: the type * to use as a start point | |||
* @head: the head of the list | |||
* @member: the name of the list_struct within the struct. | |||
*/ | |||
#define list_prepare_entry(pos, head, member) \ | |||
((pos) ? : list_entry(head, typeof(*pos), member)) | |||
/** | |||
* list_for_each_entry_continue - iterate over list of given type | |||
* continuing after existing point | |||
* @pos: the type * to use as a loop counter. | |||
* @head: the head for your list. | |||
* @member: the name of the list_struct within the struct. | |||
*/ | |||
#define list_for_each_entry_continue(pos, head, member) \ | |||
for (pos = list_entry(pos->member.next, typeof(*pos), member); \ | |||
prefetch(pos->member.next), &pos->member != (head); \ | |||
pos = list_entry(pos->member.next, typeof(*pos), member)) | |||
/** | |||
* list_for_each_entry_from - iterate over list of given type | |||
* continuing from existing point | |||
* @pos: the type * to use as a loop counter. | |||
* @head: the head for your list. | |||
* @member: the name of the list_struct within the struct. | |||
*/ | |||
#define list_for_each_entry_from(pos, head, member) \ | |||
for (; prefetch(pos->member.next), &pos->member != (head); \ | |||
pos = list_entry(pos->member.next, typeof(*pos), member)) | |||
/** | |||
* list_for_each_entry_safe - iterate over list of given type safe against removal of list entry | |||
* @pos: the type * to use as a loop counter. | |||
* @n: another type * to use as temporary storage | |||
* @head: the head for your list. | |||
* @member: the name of the list_struct within the struct. | |||
*/ | |||
#define list_for_each_entry_safe(pos, n, head, member) \ | |||
for (pos = list_entry((head)->next, typeof(*pos), member), \ | |||
n = list_entry(pos->member.next, typeof(*pos), member); \ | |||
&pos->member != (head); \ | |||
pos = n, n = list_entry(n->member.next, typeof(*n), member)) | |||
/** | |||
* list_for_each_entry_safe_continue - iterate over list of given type | |||
* continuing after existing point safe against removal of list entry | |||
* @pos: the type * to use as a loop counter. | |||
* @n: another type * to use as temporary storage | |||
* @head: the head for your list. | |||
* @member: the name of the list_struct within the struct. | |||
*/ | |||
#define list_for_each_entry_safe_continue(pos, n, head, member) \ | |||
for (pos = list_entry(pos->member.next, typeof(*pos), member), \ | |||
n = list_entry(pos->member.next, typeof(*pos), member); \ | |||
&pos->member != (head); \ | |||
pos = n, n = list_entry(n->member.next, typeof(*n), member)) | |||
/** | |||
* list_for_each_entry_safe_from - iterate over list of given type | |||
* from existing point safe against removal of list entry | |||
* @pos: the type * to use as a loop counter. | |||
* @n: another type * to use as temporary storage | |||
* @head: the head for your list. | |||
* @member: the name of the list_struct within the struct. | |||
*/ | |||
#define list_for_each_entry_safe_from(pos, n, head, member) \ | |||
for (n = list_entry(pos->member.next, typeof(*pos), member); \ | |||
&pos->member != (head); \ | |||
pos = n, n = list_entry(n->member.next, typeof(*n), member)) | |||
/** | |||
* list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against | |||
* removal of list entry | |||
* @pos: the type * to use as a loop counter. | |||
* @n: another type * to use as temporary storage | |||
* @head: the head for your list. | |||
* @member: the name of the list_struct within the struct. | |||
*/ | |||
#define list_for_each_entry_safe_reverse(pos, n, head, member) \ | |||
for (pos = list_entry((head)->prev, typeof(*pos), member), \ | |||
n = list_entry(pos->member.prev, typeof(*pos), member); \ | |||
&pos->member != (head); \ | |||
pos = n, n = list_entry(n->member.prev, typeof(*n), member)) | |||
/** | |||
* list_for_each_rcu - iterate over an rcu-protected list | |||
* @pos: the &struct list_head to use as a loop counter. | |||
* @head: the head for your list. | |||
* | |||
* This list-traversal primitive may safely run concurrently with | |||
* the _rcu list-mutation primitives such as list_add_rcu() | |||
* as long as the traversal is guarded by rcu_read_lock(). | |||
*/ | |||
#define list_for_each_rcu(pos, head) \ | |||
for (pos = (head)->next; \ | |||
prefetch(rcu_dereference(pos)->next), pos != (head); \ | |||
pos = pos->next) | |||
#define __list_for_each_rcu(pos, head) \ | |||
for (pos = (head)->next; \ | |||
rcu_dereference(pos) != (head); \ | |||
pos = pos->next) | |||
/** | |||
* list_for_each_safe_rcu - iterate over an rcu-protected list safe | |||
* against removal of list entry | |||
* @pos: the &struct list_head to use as a loop counter. | |||
* @n: another &struct list_head to use as temporary storage | |||
* @head: the head for your list. | |||
* | |||
* This list-traversal primitive may safely run concurrently with | |||
* the _rcu list-mutation primitives such as list_add_rcu() | |||
* as long as the traversal is guarded by rcu_read_lock(). | |||
*/ | |||
#define list_for_each_safe_rcu(pos, n, head) \ | |||
for (pos = (head)->next; \ | |||
n = rcu_dereference(pos)->next, pos != (head); \ | |||
pos = n) | |||
/** | |||
* list_for_each_entry_rcu - iterate over rcu list of given type | |||
* @pos: the type * to use as a loop counter. | |||
* @head: the head for your list. | |||
* @member: the name of the list_struct within the struct. | |||
* | |||
* This list-traversal primitive may safely run concurrently with | |||
* the _rcu list-mutation primitives such as list_add_rcu() | |||
* as long as the traversal is guarded by rcu_read_lock(). | |||
*/ | |||
#define list_for_each_entry_rcu(pos, head, member) \ | |||
for (pos = list_entry((head)->next, typeof(*pos), member); \ | |||
prefetch(rcu_dereference(pos)->member.next), \ | |||
&pos->member != (head); \ | |||
pos = list_entry(pos->member.next, typeof(*pos), member)) | |||
/** | |||
* list_for_each_continue_rcu - iterate over an rcu-protected list | |||
* continuing after existing point. | |||
* @pos: the &struct list_head to use as a loop counter. | |||
* @head: the head for your list. | |||
* | |||
* This list-traversal primitive may safely run concurrently with | |||
* the _rcu list-mutation primitives such as list_add_rcu() | |||
* as long as the traversal is guarded by rcu_read_lock(). | |||
*/ | |||
#define list_for_each_continue_rcu(pos, head) \ | |||
for ((pos) = (pos)->next; \ | |||
prefetch(rcu_dereference((pos))->next), (pos) != (head); \ | |||
(pos) = (pos)->next) | |||
/* | |||
* Double linked lists with a single pointer list head. | |||
* Mostly useful for hash tables where the two pointer list head is | |||
* too wasteful. | |||
* You lose the ability to access the tail in O(1). | |||
*/ | |||
struct hlist_head { | |||
struct hlist_node *first; | |||
}; | |||
struct hlist_node { | |||
struct hlist_node *next, **pprev; | |||
}; | |||
#define HLIST_HEAD_INIT { .first = NULL } | |||
#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } | |||
#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) | |||
static inline void INIT_HLIST_NODE(struct hlist_node *h) | |||
{ | |||
h->next = NULL; | |||
h->pprev = NULL; | |||
} | |||
static inline int hlist_unhashed(const struct hlist_node *h) | |||
{ | |||
return !h->pprev; | |||
} | |||
static inline int hlist_empty(const struct hlist_head *h) | |||
{ | |||
return !h->first; | |||
} | |||
static inline void __hlist_del(struct hlist_node *n) | |||
{ | |||
struct hlist_node *next = n->next; | |||
struct hlist_node **pprev = n->pprev; | |||
*pprev = next; | |||
if (next) | |||
next->pprev = pprev; | |||
} | |||
static inline void hlist_del(struct hlist_node *n) | |||
{ | |||
__hlist_del(n); | |||
n->next = LIST_POISON1; | |||
n->pprev = LIST_POISON2; | |||
} | |||
/** | |||
* hlist_del_rcu - deletes entry from hash list without re-initialization | |||
* @n: the element to delete from the hash list. | |||
* | |||
* Note: list_unhashed() on entry does not return true after this, | |||
* the entry is in an undefined state. It is useful for RCU based | |||
* lockfree traversal. | |||
* | |||
* In particular, it means that we can not poison the forward | |||
* pointers that may still be used for walking the hash list. | |||
* | |||
* The caller must take whatever precautions are necessary | |||
* (such as holding appropriate locks) to avoid racing | |||
* with another list-mutation primitive, such as hlist_add_head_rcu() | |||
* or hlist_del_rcu(), running on this same list. | |||
* However, it is perfectly legal to run concurrently with | |||
* the _rcu list-traversal primitives, such as | |||
* hlist_for_each_entry(). | |||
*/ | |||
static inline void hlist_del_rcu(struct hlist_node *n) | |||
{ | |||
__hlist_del(n); | |||
n->pprev = LIST_POISON2; | |||
} | |||
static inline void hlist_del_init(struct hlist_node *n) | |||
{ | |||
if (!hlist_unhashed(n)) { | |||
__hlist_del(n); | |||
INIT_HLIST_NODE(n); | |||
} | |||
} | |||
/* | |||
* hlist_replace_rcu - replace old entry by new one | |||
* @old : the element to be replaced | |||
* @new : the new element to insert | |||
* | |||
* The old entry will be replaced with the new entry atomically. | |||
*/ | |||
static inline void hlist_replace_rcu(struct hlist_node *old, | |||
struct hlist_node *new) | |||
{ | |||
struct hlist_node *next = old->next; | |||
new->next = next; | |||
new->pprev = old->pprev; | |||
// smp_wmb(); | |||
if (next) | |||
new->next->pprev = &new->next; | |||
*new->pprev = new; | |||
old->pprev = LIST_POISON2; | |||
} | |||
static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h) | |||
{ | |||
struct hlist_node *first = h->first; | |||
n->next = first; | |||
if (first) | |||
first->pprev = &n->next; | |||
h->first = n; | |||
n->pprev = &h->first; | |||
} | |||
/** | |||
* hlist_add_head_rcu - adds the specified element to the specified hlist, | |||
* while permitting racing traversals. | |||
* @n: the element to add to the hash list. | |||
* @h: the list to add to. | |||
* | |||
* The caller must take whatever precautions are necessary | |||
* (such as holding appropriate locks) to avoid racing | |||
* with another list-mutation primitive, such as hlist_add_head_rcu() | |||
* or hlist_del_rcu(), running on this same list. | |||
* However, it is perfectly legal to run concurrently with | |||
* the _rcu list-traversal primitives, such as | |||
* hlist_for_each_entry_rcu(), used to prevent memory-consistency | |||
* problems on Alpha CPUs. Regardless of the type of CPU, the | |||
* list-traversal primitive must be guarded by rcu_read_lock(). | |||
*/ | |||
static inline void hlist_add_head_rcu(struct hlist_node *n, | |||
struct hlist_head *h) | |||
{ | |||
struct hlist_node *first = h->first; | |||
n->next = first; | |||
n->pprev = &h->first; | |||
// smp_wmb(); | |||
if (first) | |||
first->pprev = &n->next; | |||
h->first = n; | |||
} | |||
/* next must be != NULL */ | |||
static inline void hlist_add_before(struct hlist_node *n, | |||
struct hlist_node *next) | |||
{ | |||
n->pprev = next->pprev; | |||
n->next = next; | |||
next->pprev = &n->next; | |||
*(n->pprev) = n; | |||
} | |||
static inline void hlist_add_after(struct hlist_node *n, | |||
struct hlist_node *next) | |||
{ | |||
next->next = n->next; | |||
n->next = next; | |||
next->pprev = &n->next; | |||
if(next->next) | |||
next->next->pprev = &next->next; | |||
} | |||
/** | |||
* hlist_add_before_rcu - adds the specified element to the specified hlist | |||
* before the specified node while permitting racing traversals. | |||
* @n: the new element to add to the hash list. | |||
* @next: the existing element to add the new element before. | |||
* | |||
* The caller must take whatever precautions are necessary | |||
* (such as holding appropriate locks) to avoid racing | |||
* with another list-mutation primitive, such as hlist_add_head_rcu() | |||
* or hlist_del_rcu(), running on this same list. | |||
* However, it is perfectly legal to run concurrently with | |||
* the _rcu list-traversal primitives, such as | |||
* hlist_for_each_entry_rcu(), used to prevent memory-consistency | |||
* problems on Alpha CPUs. | |||
*/ | |||
static inline void hlist_add_before_rcu(struct hlist_node *n, | |||
struct hlist_node *next) | |||
{ | |||
n->pprev = next->pprev; | |||
n->next = next; | |||
// smp_wmb(); | |||
next->pprev = &n->next; | |||
*(n->pprev) = n; | |||
} | |||
/** | |||
* hlist_add_after_rcu - adds the specified element to the specified hlist | |||
* after the specified node while permitting racing traversals. | |||
* @prev: the existing element to add the new element after. | |||
* @n: the new element to add to the hash list. | |||
* | |||
* The caller must take whatever precautions are necessary | |||
* (such as holding appropriate locks) to avoid racing | |||
* with another list-mutation primitive, such as hlist_add_head_rcu() | |||
* or hlist_del_rcu(), running on this same list. | |||
* However, it is perfectly legal to run concurrently with | |||
* the _rcu list-traversal primitives, such as | |||
* hlist_for_each_entry_rcu(), used to prevent memory-consistency | |||
* problems on Alpha CPUs. | |||
*/ | |||
static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
struct hlist_node *n) | |||
{ | |||
n->next = prev->next; | |||
n->pprev = &prev->next; | |||
// smp_wmb(); | |||
prev->next = n; | |||
if (n->next) | |||
n->next->pprev = &n->next; | |||
} | |||
#define hlist_entry(ptr, type, member) container_of(ptr,type,member) | |||
#define hlist_for_each(pos, head) \ | |||
for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \ | |||
pos = pos->next) | |||
#define hlist_for_each_safe(pos, n, head) \ | |||
for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ | |||
pos = n) | |||
/** | |||
* hlist_for_each_entry - iterate over list of given type | |||
* @tpos: the type * to use as a loop counter. | |||
* @pos: the &struct hlist_node to use as a loop counter. | |||
* @head: the head for your list. | |||
* @member: the name of the hlist_node within the struct. | |||
*/ | |||
#define hlist_for_each_entry(tpos, pos, head, member) \ | |||
for (pos = (head)->first; \ | |||
pos && ({ prefetch(pos->next); 1;}) && \ | |||
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | |||
pos = pos->next) | |||
/** | |||
* hlist_for_each_entry_continue - iterate over a hlist continuing after existing point | |||
* @tpos: the type * to use as a loop counter. | |||
* @pos: the &struct hlist_node to use as a loop counter. | |||
* @member: the name of the hlist_node within the struct. | |||
*/ | |||
#define hlist_for_each_entry_continue(tpos, pos, member) \ | |||
for (pos = (pos)->next; \ | |||
pos && ({ prefetch(pos->next); 1;}) && \ | |||
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | |||
pos = pos->next) | |||
/** | |||
* hlist_for_each_entry_from - iterate over a hlist continuing from existing point | |||
* @tpos: the type * to use as a loop counter. | |||
* @pos: the &struct hlist_node to use as a loop counter. | |||
* @member: the name of the hlist_node within the struct. | |||
*/ | |||
#define hlist_for_each_entry_from(tpos, pos, member) \ | |||
for (; pos && ({ prefetch(pos->next); 1;}) && \ | |||
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | |||
pos = pos->next) | |||
/** | |||
* hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry | |||
* @tpos: the type * to use as a loop counter. | |||
* @pos: the &struct hlist_node to use as a loop counter. | |||
* @n: another &struct hlist_node to use as temporary storage | |||
* @head: the head for your list. | |||
* @member: the name of the hlist_node within the struct. | |||
*/ | |||
#define hlist_for_each_entry_safe(tpos, pos, n, head, member) \ | |||
for (pos = (head)->first; \ | |||
pos && ({ n = pos->next; 1; }) && \ | |||
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | |||
pos = n) | |||
/** | |||
* hlist_for_each_entry_rcu - iterate over rcu list of given type | |||
* @tpos: the type * to use as a loop counter. | |||
* @pos: the &struct hlist_node to use as a loop counter. | |||
* @head: the head for your list. | |||
* @member: the name of the hlist_node within the struct. | |||
* | |||
* This list-traversal primitive may safely run concurrently with | |||
* the _rcu list-mutation primitives such as hlist_add_head_rcu() | |||
* as long as the traversal is guarded by rcu_read_lock(). | |||
*/ | |||
#define hlist_for_each_entry_rcu(tpos, pos, head, member) \ | |||
for (pos = (head)->first; \ | |||
rcu_dereference(pos) && ({ prefetch(pos->next); 1;}) && \ | |||
({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ | |||
pos = pos->next) | |||
#endif |
@@ -1,357 +0,0 @@ | |||
/* -*- Mode: C ; c-basic-offset: 2 -*- */ | |||
/***************************************************************************** | |||
* | |||
* Non-sleeping memory allocation | |||
* | |||
* Copyright (C) 2006,2007 Nedko Arnaudov <nedko@arnaudov.name> | |||
* | |||
* This program 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; version 2 of the License | |||
* | |||
* This program 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 this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |||
* | |||
*****************************************************************************/ | |||
#include <stdlib.h> | |||
#include <assert.h> | |||
#include "memory_atomic.h" | |||
#include "list.h" | |||
#define TRUE 1 | |||
#define FALSE 0 | |||
struct rtsafe_memory_pool | |||
{ | |||
size_t data_size; | |||
size_t min_preallocated; | |||
size_t max_preallocated; | |||
struct list_head used; | |||
unsigned int used_count; | |||
struct list_head unused; | |||
unsigned int unused_count; | |||
}; | |||
#define RTSAFE_GROUPS_PREALLOCATE 1024 | |||
int | |||
rtsafe_memory_pool_create( | |||
size_t data_size, | |||
size_t min_preallocated, | |||
size_t max_preallocated, | |||
rtsafe_memory_pool_handle * pool_handle_ptr) | |||
{ | |||
struct rtsafe_memory_pool * pool_ptr; | |||
assert(min_preallocated <= max_preallocated); | |||
pool_ptr = malloc(sizeof(struct rtsafe_memory_pool)); | |||
if (pool_ptr == NULL) | |||
{ | |||
return FALSE; | |||
} | |||
pool_ptr->data_size = data_size; | |||
pool_ptr->min_preallocated = min_preallocated; | |||
pool_ptr->max_preallocated = max_preallocated; | |||
INIT_LIST_HEAD(&pool_ptr->used); | |||
pool_ptr->used_count = 0; | |||
INIT_LIST_HEAD(&pool_ptr->unused); | |||
pool_ptr->unused_count = 0; | |||
rtsafe_memory_pool_sleepy((rtsafe_memory_pool_handle)pool_ptr); | |||
*pool_handle_ptr = pool_ptr; | |||
return TRUE; | |||
} | |||
#define pool_ptr ((struct rtsafe_memory_pool *)pool_handle) | |||
void | |||
rtsafe_memory_pool_destroy( | |||
rtsafe_memory_pool_handle pool_handle) | |||
{ | |||
struct list_head * node_ptr; | |||
assert(pool_ptr->used_count == 0); /* called should deallocate all chunks prior releasing pool itself */ | |||
assert(list_empty(&pool_ptr->used)); | |||
while (pool_ptr->unused_count != 0) | |||
{ | |||
assert(!list_empty(&pool_ptr->unused)); | |||
node_ptr = pool_ptr->unused.next; | |||
list_del(node_ptr); | |||
pool_ptr->unused_count--; | |||
free(node_ptr); | |||
} | |||
assert(list_empty(&pool_ptr->unused)); | |||
free(pool_ptr); | |||
} | |||
/* adjust unused list size */ | |||
void | |||
rtsafe_memory_pool_sleepy( | |||
rtsafe_memory_pool_handle pool_handle) | |||
{ | |||
struct list_head * node_ptr; | |||
while (pool_ptr->unused_count < pool_ptr->min_preallocated) | |||
{ | |||
node_ptr = malloc(sizeof(struct list_head) + pool_ptr->data_size); | |||
if (node_ptr == NULL) | |||
{ | |||
return; | |||
} | |||
list_add_tail(node_ptr, &pool_ptr->unused); | |||
pool_ptr->unused_count++; | |||
} | |||
while (pool_ptr->unused_count > pool_ptr->max_preallocated) | |||
{ | |||
assert(!list_empty(&pool_ptr->unused)); | |||
node_ptr = pool_ptr->unused.next; | |||
list_del(node_ptr); | |||
pool_ptr->unused_count--; | |||
free(node_ptr); | |||
} | |||
} | |||
/* find entry in unused list, fail if it is empty */ | |||
void * | |||
rtsafe_memory_pool_allocate( | |||
rtsafe_memory_pool_handle pool_handle) | |||
{ | |||
struct list_head * node_ptr; | |||
if (list_empty(&pool_ptr->unused)) | |||
{ | |||
return NULL; | |||
} | |||
node_ptr = pool_ptr->unused.next; | |||
list_del(node_ptr); | |||
pool_ptr->unused_count--; | |||
pool_ptr->used_count++; | |||
return (node_ptr + 1); | |||
} | |||
/* move from used to unused list */ | |||
void | |||
rtsafe_memory_pool_deallocate( | |||
rtsafe_memory_pool_handle pool_handle, | |||
void * data) | |||
{ | |||
list_add_tail((struct list_head *)data - 1, &pool_ptr->unused); | |||
pool_ptr->used_count--; | |||
pool_ptr->unused_count++; | |||
} | |||
void * | |||
rtsafe_memory_pool_allocate_sleepy( | |||
rtsafe_memory_pool_handle pool_handle) | |||
{ | |||
void * data; | |||
do | |||
{ | |||
rtsafe_memory_pool_sleepy(pool_handle); | |||
data = rtsafe_memory_pool_allocate(pool_handle); | |||
} | |||
while (data == NULL); | |||
return data; | |||
} | |||
/* max alloc is DATA_MIN * (2 ^ POOLS_COUNT) - DATA_SUB */ | |||
#define DATA_MIN 1024 | |||
#define DATA_SUB 100 /* alloc slightly smaller chunks in hope to not allocating additional page for control data */ | |||
struct rtsafe_memory_pool_generic | |||
{ | |||
size_t size; | |||
rtsafe_memory_pool_handle pool; | |||
}; | |||
struct rtsafe_memory | |||
{ | |||
struct rtsafe_memory_pool_generic * pools; | |||
size_t pools_count; | |||
}; | |||
int | |||
rtsafe_memory_init( | |||
size_t max_size, | |||
size_t prealloc_min, | |||
size_t prealloc_max, | |||
rtsafe_memory_handle * handle_ptr) | |||
{ | |||
size_t i; | |||
size_t size; | |||
struct rtsafe_memory * memory_ptr; | |||
//LOG_DEBUG("rtsafe_memory_init() called."); | |||
memory_ptr = malloc(sizeof(struct rtsafe_memory)); | |||
if (memory_ptr == NULL) | |||
{ | |||
goto fail; | |||
} | |||
size = DATA_MIN; | |||
memory_ptr->pools_count = 1; | |||
while ((size << memory_ptr->pools_count) < max_size + DATA_SUB) | |||
{ | |||
memory_ptr->pools_count++; | |||
if (memory_ptr->pools_count > sizeof(size_t) * 8) | |||
{ | |||
assert(0); /* chances that caller really need such huge size are close to zero */ | |||
goto fail_free; | |||
} | |||
} | |||
memory_ptr->pools = malloc(memory_ptr->pools_count * sizeof(struct rtsafe_memory_pool_generic)); | |||
if (memory_ptr->pools == NULL) | |||
{ | |||
goto fail_free; | |||
} | |||
size = DATA_MIN; | |||
for (i = 0 ; i < memory_ptr->pools_count ; i++) | |||
{ | |||
memory_ptr->pools[i].size = size - DATA_SUB; | |||
if (!rtsafe_memory_pool_create( | |||
memory_ptr->pools[i].size, | |||
prealloc_min, | |||
prealloc_max, | |||
&memory_ptr->pools[i].pool)) | |||
{ | |||
while (i > 0) | |||
{ | |||
i--; | |||
rtsafe_memory_pool_destroy(memory_ptr->pools[i].pool); | |||
} | |||
goto fail_free_pools; | |||
} | |||
size = size << 1; | |||
} | |||
*handle_ptr = (rtsafe_memory_handle)memory_ptr; | |||
return TRUE; | |||
fail_free_pools: | |||
free(memory_ptr->pools); | |||
fail_free: | |||
free(memory_ptr); | |||
fail: | |||
return FALSE; | |||
} | |||
#define memory_ptr ((struct rtsafe_memory *)handle_ptr) | |||
void | |||
rtsafe_memory_uninit( | |||
rtsafe_memory_handle handle_ptr) | |||
{ | |||
unsigned int i; | |||
//LOG_DEBUG("rtsafe_memory_uninit() called."); | |||
for (i = 0 ; i < memory_ptr->pools_count ; i++) | |||
{ | |||
//LOG_DEBUG("Destroying pool for size %u", (unsigned int)memory_ptr->pools[i].size); | |||
rtsafe_memory_pool_destroy(memory_ptr->pools[i].pool); | |||
} | |||
free(memory_ptr->pools); | |||
free(memory_ptr); | |||
} | |||
void * | |||
rtsafe_memory_allocate( | |||
rtsafe_memory_handle handle_ptr, | |||
size_t size) | |||
{ | |||
rtsafe_memory_pool_handle * data_ptr; | |||
size_t i; | |||
//LOG_DEBUG("rtsafe_memory_allocate() called."); | |||
/* pool handle is stored just before user data to ease deallocation */ | |||
size += sizeof(rtsafe_memory_pool_handle); | |||
for (i = 0 ; i < memory_ptr->pools_count ; i++) | |||
{ | |||
if (size <= memory_ptr->pools[i].size) | |||
{ | |||
//LOG_DEBUG("Using chunk with size %u.", (unsigned int)memory_ptr->pools[i].size); | |||
data_ptr = rtsafe_memory_pool_allocate(memory_ptr->pools[i].pool); | |||
if (data_ptr == NULL) | |||
{ | |||
//LOG_DEBUG("rtsafe_memory_pool_allocate() failed."); | |||
return FALSE; | |||
} | |||
*data_ptr = memory_ptr->pools[i].pool; | |||
//LOG_DEBUG("rtsafe_memory_allocate() returning %p", (data_ptr + 1)); | |||
return (data_ptr + 1); | |||
} | |||
} | |||
/* data size too big, increase POOLS_COUNT */ | |||
//LOG_WARNING("Data size is too big"); | |||
return FALSE; | |||
} | |||
void | |||
rtsafe_memory_sleepy( | |||
rtsafe_memory_handle handle_ptr) | |||
{ | |||
unsigned int i; | |||
for (i = 0 ; i < memory_ptr->pools_count ; i++) | |||
{ | |||
rtsafe_memory_pool_sleepy(memory_ptr->pools[i].pool); | |||
} | |||
} | |||
void | |||
rtsafe_memory_deallocate( | |||
void * data) | |||
{ | |||
//LOG_DEBUG("rtsafe_memory_deallocate(%p) called.", data); | |||
rtsafe_memory_pool_deallocate( | |||
*((rtsafe_memory_pool_handle *)data -1), | |||
(rtsafe_memory_pool_handle *)data - 1); | |||
} |
@@ -1,105 +0,0 @@ | |||
/* -*- Mode: C ; c-basic-offset: 2 -*- */ | |||
/***************************************************************************** | |||
* | |||
* Non-sleeping memory allocation | |||
* | |||
* Copyright (C) 2006,2007 Nedko Arnaudov <nedko@arnaudov.name> | |||
* | |||
* This program 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; version 2 of the License | |||
* | |||
* This program 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 this program; if not, write to the Free Software | |||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. | |||
* | |||
*****************************************************************************/ | |||
#ifndef MEMORY_ATOMIC_H__7B572547_304D_4597_8808_990BE4476CC3__INCLUDED | |||
#define MEMORY_ATOMIC_H__7B572547_304D_4597_8808_990BE4476CC3__INCLUDED | |||
#ifdef __cplusplus | |||
extern "C" { | |||
#endif | |||
#if 0 | |||
} /* Adjust editor indent */ | |||
#endif | |||
typedef void * rtsafe_memory_pool_handle; | |||
/* will sleep */ | |||
int | |||
rtsafe_memory_pool_create( | |||
size_t data_size, /* chunk size */ | |||
size_t min_preallocated, /* min chunks preallocated */ | |||
size_t max_preallocated, /* max chunks preallocated */ | |||
rtsafe_memory_pool_handle * pool_ptr); | |||
/* will sleep */ | |||
void | |||
rtsafe_memory_pool_destroy( | |||
rtsafe_memory_pool_handle pool); | |||
/* may sleep */ | |||
void | |||
rtsafe_memory_pool_sleepy( | |||
rtsafe_memory_pool_handle pool); | |||
/* will not sleep, returns NULL if no memory is available */ | |||
void * | |||
rtsafe_memory_pool_allocate( | |||
rtsafe_memory_pool_handle pool); | |||
/* may sleep */ | |||
void * | |||
rtsafe_memory_pool_allocate_sleepy( | |||
rtsafe_memory_pool_handle pool); | |||
/* will not sleep */ | |||
void | |||
rtsafe_memory_pool_deallocate( | |||
rtsafe_memory_pool_handle pool, | |||
void * data); | |||
typedef void * rtsafe_memory_handle; | |||
/* will sleep */ | |||
int | |||
rtsafe_memory_init( | |||
size_t max_size, | |||
size_t prealloc_min, | |||
size_t prealloc_max, | |||
rtsafe_memory_handle * handle_ptr); | |||
/* will not sleep */ | |||
void * | |||
rtsafe_memory_allocate( | |||
rtsafe_memory_handle handle_ptr, | |||
size_t size); | |||
void | |||
rtsafe_memory_sleepy( | |||
rtsafe_memory_handle handle_ptr); | |||
/* will not sleep */ | |||
void | |||
rtsafe_memory_deallocate( | |||
void * data); | |||
void | |||
rtsafe_memory_uninit( | |||
rtsafe_memory_handle handle_ptr); | |||
#if 0 | |||
{ /* Adjust editor indent */ | |||
#endif | |||
#ifdef __cplusplus | |||
} /* extern "C" */ | |||
#endif | |||
#endif /* #ifndef MEMORY_ATOMIC_H__7B572547_304D_4597_8808_990BE4476CC3__INCLUDED */ |
@@ -1,106 +0,0 @@ | |||
#!/usr/bin/make -f | |||
# Makefile for carla-backend # | |||
# ------------------------------------- # | |||
# Created by falkTX | |||
# | |||
include ../Makefile.mk | |||
# -------------------------------------------------------------- | |||
BUILD_CXX_FLAGS += -I. -I../carla-engine -I../carla-includes -I../carla-native -I../carla-plugin -I../carla-utils | |||
BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore) | |||
LINK_FLAGS += -fPIC -shared -ldl -lm -lGL | |||
LINK_FLAGS += $(shell pkg-config --libs liblo QtCore QtGui) | |||
ifeq ($(CARLA_PLUGIN_SUPPORT),true) | |||
BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST | |||
endif | |||
ifeq ($(CARLA_RTAUDIO_SUPPORT),true) | |||
BUILD_CXX_FLAGS += -DCARLA_ENGINE_RTAUDIO | |||
endif | |||
ifeq ($(HAVE_JACK),true) | |||
LINK_FLAGS += $(shell pkg-config --libs jack) | |||
endif | |||
ifeq ($(HAVE_ALSA),true) | |||
LINK_FLAGS += $(shell pkg-config --libs alsa) | |||
endif | |||
ifeq ($(HAVE_PULSEAUDIO),true) | |||
LINK_FLAGS += $(shell pkg-config --libs libpulse-simple) | |||
endif | |||
ifeq ($(HAVE_SUIL),true) | |||
LINK_FLAGS += $(shell pkg-config --libs suil-0) | |||
endif | |||
ifeq ($(HAVE_FLUIDSYNTH),true) | |||
BUILD_CXX_FLAGS += -DWANT_FLUIDSYNTH | |||
LINK_FLAGS += $(shell pkg-config --libs fluidsynth) | |||
endif | |||
ifeq ($(HAVE_LINUXSAMPLER),true) | |||
BUILD_CXX_FLAGS += -DWANT_LINUXSAMPLER | |||
LINK_FLAGS += $(shell pkg-config --libs linuxsampler) | |||
endif | |||
ifeq ($(HAVE_ZYN_DEPS),true) | |||
LINK_FLAGS += $(shell pkg-config --libs fftw3 mxml) | |||
endif | |||
OBJS = \ | |||
carla_backend_standalone.o \ | |||
OBJS += ../carla-engine/carla_engine.a | |||
OBJS += ../carla-plugin/carla_plugin.a | |||
OBJS += ../carla-native/carla_native.a | |||
# others | |||
ifeq ($(CARLA_PLUGIN_SUPPORT),true) | |||
OBJS += ../carla-lilv/carla_lilv.a | |||
OBJS += ../carla-rtmempool/carla_rtmempool.a | |||
endif | |||
# -------------------------------------------------------------- | |||
all: carla_backend.so | |||
doxygen: carla_backend.doxygen | |||
doxygen $< | |||
carla_backend.dll: $(OBJS) | |||
carla_backend.so: $(OBJS) | |||
$(CXX) $^ $(LINK_FLAGS) -o $@ && $(STRIP) $@ | |||
carla_backend.dylib: $(OBJS) | |||
$(CXX) $^ $(LINK_FLAGS) -bundle -o $@ && $(STRIP) $@ | |||
# -------------------------------------------------------------- | |||
../carla-engine/carla_engine.a: | |||
$(MAKE) -C ../carla-engine | |||
../carla-lilv/carla_lilv.a: | |||
$(MAKE) -C ../carla-lilv | |||
../carla-native/carla_native.a: | |||
$(MAKE) -C ../carla-native | |||
../carla-plugin/carla_plugin.a: | |||
$(MAKE) -C ../carla-plugin | |||
../carla-rtmempool/carla_rtmempool.a: | |||
$(MAKE) -C ../carla-rtmempool | |||
# -------------------------------------------------------------- | |||
.cpp.o: | |||
$(CXX) -c $< $(BUILD_CXX_FLAGS) -o $@ | |||
clean: | |||
rm -f $(OBJS) *.dll *.dylib *.so |
@@ -1,287 +0,0 @@ | |||
# Doxyfile 1.7.6.1 | |||
#--------------------------------------------------------------------------- | |||
# Project related configuration options | |||
#--------------------------------------------------------------------------- | |||
DOXYFILE_ENCODING = UTF-8 | |||
PROJECT_NAME = "Carla Backend" | |||
PROJECT_NUMBER = | |||
PROJECT_BRIEF = | |||
PROJECT_LOGO = | |||
OUTPUT_DIRECTORY = ../../doc/carla-backend | |||
CREATE_SUBDIRS = NO | |||
OUTPUT_LANGUAGE = English | |||
BRIEF_MEMBER_DESC = YES | |||
REPEAT_BRIEF = YES | |||
ABBREVIATE_BRIEF = | |||
ALWAYS_DETAILED_SEC = NO | |||
INLINE_INHERITED_MEMB = NO | |||
FULL_PATH_NAMES = YES | |||
STRIP_FROM_PATH = | |||
STRIP_FROM_INC_PATH = | |||
SHORT_NAMES = NO | |||
JAVADOC_AUTOBRIEF = NO | |||
QT_AUTOBRIEF = NO | |||
MULTILINE_CPP_IS_BRIEF = NO | |||
INHERIT_DOCS = YES | |||
SEPARATE_MEMBER_PAGES = NO | |||
TAB_SIZE = 4 | |||
ALIASES = | |||
TCL_SUBST = | |||
OPTIMIZE_OUTPUT_FOR_C = NO | |||
OPTIMIZE_OUTPUT_JAVA = NO | |||
OPTIMIZE_FOR_FORTRAN = NO | |||
OPTIMIZE_OUTPUT_VHDL = NO | |||
EXTENSION_MAPPING = | |||
BUILTIN_STL_SUPPORT = NO | |||
CPP_CLI_SUPPORT = NO | |||
SIP_SUPPORT = NO | |||
IDL_PROPERTY_SUPPORT = YES | |||
DISTRIBUTE_GROUP_DOC = NO | |||
SUBGROUPING = YES | |||
INLINE_GROUPED_CLASSES = NO | |||
INLINE_SIMPLE_STRUCTS = NO | |||
TYPEDEF_HIDES_STRUCT = NO | |||
SYMBOL_CACHE_SIZE = 0 | |||
LOOKUP_CACHE_SIZE = 0 | |||
#--------------------------------------------------------------------------- | |||
# Build related configuration options | |||
#--------------------------------------------------------------------------- | |||
EXTRACT_ALL = YES | |||
EXTRACT_PRIVATE = NO | |||
EXTRACT_STATIC = NO | |||
EXTRACT_LOCAL_CLASSES = YES | |||
EXTRACT_LOCAL_METHODS = NO | |||
EXTRACT_ANON_NSPACES = NO | |||
HIDE_UNDOC_MEMBERS = NO | |||
HIDE_UNDOC_CLASSES = NO | |||
HIDE_FRIEND_COMPOUNDS = NO | |||
HIDE_IN_BODY_DOCS = NO | |||
INTERNAL_DOCS = NO | |||
CASE_SENSE_NAMES = YES | |||
HIDE_SCOPE_NAMES = NO | |||
SHOW_INCLUDE_FILES = YES | |||
FORCE_LOCAL_INCLUDES = NO | |||
INLINE_INFO = YES | |||
SORT_MEMBER_DOCS = NO | |||
SORT_BRIEF_DOCS = NO | |||
SORT_MEMBERS_CTORS_1ST = NO | |||
SORT_GROUP_NAMES = NO | |||
SORT_BY_SCOPE_NAME = NO | |||
STRICT_PROTO_MATCHING = NO | |||
GENERATE_TODOLIST = YES | |||
GENERATE_TESTLIST = YES | |||
GENERATE_BUGLIST = YES | |||
GENERATE_DEPRECATEDLIST= YES | |||
ENABLED_SECTIONS = | |||
MAX_INITIALIZER_LINES = 30 | |||
SHOW_USED_FILES = YES | |||
SHOW_DIRECTORIES = NO | |||
SHOW_FILES = YES | |||
SHOW_NAMESPACES = YES | |||
FILE_VERSION_FILTER = | |||
LAYOUT_FILE = | |||
CITE_BIB_FILES = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to warning and progress messages | |||
#--------------------------------------------------------------------------- | |||
QUIET = NO | |||
WARNINGS = YES | |||
WARN_IF_UNDOCUMENTED = YES | |||
WARN_IF_DOC_ERROR = YES | |||
WARN_NO_PARAMDOC = NO | |||
WARN_FORMAT = "$file:$line: $text" | |||
WARN_LOGFILE = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the input files | |||
#--------------------------------------------------------------------------- | |||
INPUT = | |||
INPUT_ENCODING = UTF-8 | |||
FILE_PATTERNS = | |||
RECURSIVE = NO | |||
EXCLUDE = carla_backend_standalone.cpp | |||
EXCLUDE_SYMLINKS = NO | |||
EXCLUDE_PATTERNS = | |||
EXCLUDE_SYMBOLS = | |||
EXAMPLE_PATH = | |||
EXAMPLE_PATTERNS = | |||
EXAMPLE_RECURSIVE = NO | |||
IMAGE_PATH = | |||
INPUT_FILTER = | |||
FILTER_PATTERNS = | |||
FILTER_SOURCE_FILES = NO | |||
FILTER_SOURCE_PATTERNS = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to source browsing | |||
#--------------------------------------------------------------------------- | |||
SOURCE_BROWSER = NO | |||
INLINE_SOURCES = NO | |||
STRIP_CODE_COMMENTS = YES | |||
REFERENCED_BY_RELATION = NO | |||
REFERENCES_RELATION = NO | |||
REFERENCES_LINK_SOURCE = YES | |||
USE_HTAGS = NO | |||
VERBATIM_HEADERS = YES | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the alphabetical class index | |||
#--------------------------------------------------------------------------- | |||
ALPHABETICAL_INDEX = YES | |||
COLS_IN_ALPHA_INDEX = 5 | |||
IGNORE_PREFIX = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the HTML output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_HTML = YES | |||
HTML_OUTPUT = . | |||
HTML_FILE_EXTENSION = .html | |||
HTML_HEADER = | |||
HTML_FOOTER = | |||
HTML_STYLESHEET = | |||
HTML_EXTRA_FILES = | |||
HTML_COLORSTYLE_HUE = 220 | |||
HTML_COLORSTYLE_SAT = 100 | |||
HTML_COLORSTYLE_GAMMA = 80 | |||
HTML_TIMESTAMP = YES | |||
HTML_ALIGN_MEMBERS = YES | |||
HTML_DYNAMIC_SECTIONS = NO | |||
GENERATE_DOCSET = NO | |||
DOCSET_FEEDNAME = "Doxygen generated docs" | |||
DOCSET_BUNDLE_ID = org.doxygen.Project | |||
DOCSET_PUBLISHER_ID = org.doxygen.Publisher | |||
DOCSET_PUBLISHER_NAME = Publisher | |||
GENERATE_HTMLHELP = NO | |||
CHM_FILE = | |||
HHC_LOCATION = | |||
GENERATE_CHI = NO | |||
CHM_INDEX_ENCODING = | |||
BINARY_TOC = NO | |||
TOC_EXPAND = NO | |||
GENERATE_QHP = NO | |||
QCH_FILE = | |||
QHP_NAMESPACE = org.doxygen.Project | |||
QHP_VIRTUAL_FOLDER = doc | |||
QHP_CUST_FILTER_NAME = | |||
QHP_CUST_FILTER_ATTRS = | |||
QHP_SECT_FILTER_ATTRS = | |||
QHG_LOCATION = | |||
GENERATE_ECLIPSEHELP = NO | |||
ECLIPSE_DOC_ID = org.doxygen.Project | |||
DISABLE_INDEX = NO | |||
GENERATE_TREEVIEW = NO | |||
ENUM_VALUES_PER_LINE = 4 | |||
USE_INLINE_TREES = NO | |||
TREEVIEW_WIDTH = 250 | |||
EXT_LINKS_IN_WINDOW = NO | |||
FORMULA_FONTSIZE = 10 | |||
FORMULA_TRANSPARENT = YES | |||
USE_MATHJAX = NO | |||
MATHJAX_RELPATH = http://www.mathjax.org/mathjax | |||
MATHJAX_EXTENSIONS = | |||
SEARCHENGINE = YES | |||
SERVER_BASED_SEARCH = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the LaTeX output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_LATEX = NO | |||
LATEX_OUTPUT = latex | |||
LATEX_CMD_NAME = latex | |||
MAKEINDEX_CMD_NAME = makeindex | |||
COMPACT_LATEX = NO | |||
PAPER_TYPE = a4 | |||
EXTRA_PACKAGES = | |||
LATEX_HEADER = | |||
LATEX_FOOTER = | |||
PDF_HYPERLINKS = YES | |||
USE_PDFLATEX = YES | |||
LATEX_BATCHMODE = NO | |||
LATEX_HIDE_INDICES = NO | |||
LATEX_SOURCE_CODE = NO | |||
LATEX_BIB_STYLE = plain | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the RTF output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_RTF = NO | |||
RTF_OUTPUT = rtf | |||
COMPACT_RTF = NO | |||
RTF_HYPERLINKS = NO | |||
RTF_STYLESHEET_FILE = | |||
RTF_EXTENSIONS_FILE = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the man page output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_MAN = NO | |||
MAN_OUTPUT = man | |||
MAN_EXTENSION = .3 | |||
MAN_LINKS = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the XML output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_XML = NO | |||
XML_OUTPUT = xml | |||
XML_SCHEMA = | |||
XML_DTD = | |||
XML_PROGRAMLISTING = YES | |||
#--------------------------------------------------------------------------- | |||
# configuration options for the AutoGen Definitions output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_AUTOGEN_DEF = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the Perl module output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_PERLMOD = NO | |||
PERLMOD_LATEX = NO | |||
PERLMOD_PRETTY = YES | |||
PERLMOD_MAKEVAR_PREFIX = | |||
#--------------------------------------------------------------------------- | |||
# Configuration options related to the preprocessor | |||
#--------------------------------------------------------------------------- | |||
ENABLE_PREPROCESSING = YES | |||
MACRO_EXPANSION = NO | |||
EXPAND_ONLY_PREDEF = NO | |||
SEARCH_INCLUDES = YES | |||
INCLUDE_PATH = | |||
INCLUDE_FILE_PATTERNS = | |||
PREDEFINED = DOXYGEN | |||
EXPAND_AS_DEFINED = | |||
SKIP_FUNCTION_MACROS = YES | |||
#--------------------------------------------------------------------------- | |||
# Configuration::additions related to external references | |||
#--------------------------------------------------------------------------- | |||
TAGFILES = | |||
GENERATE_TAGFILE = | |||
ALLEXTERNALS = NO | |||
EXTERNAL_GROUPS = YES | |||
PERL_PATH = /usr/bin/perl | |||
#--------------------------------------------------------------------------- | |||
# Configuration options related to the dot tool | |||
#--------------------------------------------------------------------------- | |||
CLASS_DIAGRAMS = YES | |||
MSCGEN_PATH = | |||
HIDE_UNDOC_RELATIONS = YES | |||
HAVE_DOT = NO | |||
DOT_NUM_THREADS = 0 | |||
DOT_FONTNAME = Helvetica | |||
DOT_FONTSIZE = 10 | |||
DOT_FONTPATH = | |||
CLASS_GRAPH = YES | |||
COLLABORATION_GRAPH = YES | |||
GROUP_GRAPHS = YES | |||
UML_LOOK = NO | |||
TEMPLATE_RELATIONS = NO | |||
INCLUDE_GRAPH = YES | |||
INCLUDED_BY_GRAPH = YES | |||
CALL_GRAPH = NO | |||
CALLER_GRAPH = NO | |||
GRAPHICAL_HIERARCHY = YES | |||
DIRECTORY_GRAPH = YES | |||
DOT_IMAGE_FORMAT = png | |||
INTERACTIVE_SVG = NO | |||
DOT_PATH = | |||
DOTFILE_DIRS = | |||
MSCFILE_DIRS = | |||
DOT_GRAPH_MAX_NODES = 50 | |||
MAX_DOT_GRAPH_DEPTH = 0 | |||
DOT_TRANSPARENT = NO | |||
DOT_MULTI_TARGETS = YES | |||
GENERATE_LEGEND = YES | |||
DOT_CLEANUP = YES |
@@ -1,581 +0,0 @@ | |||
/* | |||
* Carla Backend | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_BACKEND_HPP | |||
#define CARLA_BACKEND_HPP | |||
#include "carla_defines.hpp" | |||
#include <cstdint> | |||
#define CARLA_BACKEND_START_NAMESPACE namespace CarlaBackend { | |||
#define CARLA_BACKEND_END_NAMESPACE } | |||
#define CARLA_BACKEND_USE_NAMESPACE using namespace CarlaBackend; | |||
CARLA_BACKEND_START_NAMESPACE | |||
#define STR_MAX 0xFF | |||
/*! | |||
* @defgroup CarlaBackendAPI Carla Backend API | |||
* | |||
* The Carla Backend API | |||
* | |||
* @{ | |||
*/ | |||
#ifdef BUILD_BRIDGE | |||
const unsigned short MAX_PLUGINS = 1; | |||
#else | |||
const unsigned short MAX_PLUGINS = 99; //!< Maximum number of loadable plugins | |||
#endif | |||
const unsigned int MAX_PARAMETERS = 200; //!< Default value for the maximum number of parameters allowed.\see OPTION_MAX_PARAMETERS | |||
/*! | |||
* @defgroup PluginHints Plugin Hints | |||
* | |||
* Various plugin hints. | |||
* \see CarlaPlugin::hints() | |||
* @{ | |||
*/ | |||
#ifndef BUILD_BRIDGE | |||
const unsigned int PLUGIN_IS_BRIDGE = 0x001; //!< Plugin is a bridge (ie, BridgePlugin). This hint is required because "bridge" itself is not a plugin type. | |||
#endif | |||
const unsigned int PLUGIN_IS_SYNTH = 0x002; //!< Plugin is a synthesizer (produces sound). | |||
const unsigned int PLUGIN_HAS_GUI = 0x004; //!< Plugin has its own custom GUI. | |||
const unsigned int PLUGIN_USES_CHUNKS = 0x008; //!< Plugin uses chunks to save internal data.\see CarlaPlugin::chunkData() | |||
const unsigned int PLUGIN_USES_SINGLE_THREAD = 0x010; //!< Plugin needs a single thread for both DSP processing and UI events. | |||
const unsigned int PLUGIN_CAN_DRYWET = 0x020; //!< Plugin can make use of Dry/Wet controls. | |||
const unsigned int PLUGIN_CAN_VOLUME = 0x040; //!< Plugin can make use of Volume controls. | |||
const unsigned int PLUGIN_CAN_BALANCE = 0x080; //!< Plugin can make use of Left & Right Balance controls. | |||
const unsigned int PLUGIN_CAN_FORCE_STEREO = 0x100; //!< Plugin can be used in forced-stereo mode. | |||
/**@}*/ | |||
/*! | |||
* @defgroup ParameterHints Parameter Hints | |||
* | |||
* Various parameter hints. | |||
* \see CarlaPlugin::parameterData() | |||
* @{ | |||
*/ | |||
const unsigned int PARAMETER_IS_BOOLEAN = 0x01; //!< Parameter value is of boolean type (always at minimum or maximum). | |||
const unsigned int PARAMETER_IS_INTEGER = 0x02; //!< Parameter values are always integer. | |||
const unsigned int PARAMETER_IS_LOGARITHMIC = 0x04; //!< Parameter is logarithmic (informative only, not really implemented). | |||
const unsigned int PARAMETER_IS_ENABLED = 0x08; //!< Parameter is enabled and will be shown in the host built-in editor. | |||
const unsigned int PARAMETER_IS_AUTOMABLE = 0x10; //!< Parameter is automable (realtime safe) | |||
const unsigned int PARAMETER_USES_SAMPLERATE = 0x20; //!< Parameter needs sample rate to work (value and ranges are multiplied by SR, and divided by SR on save). | |||
const unsigned int PARAMETER_USES_SCALEPOINTS = 0x40; //!< Parameter uses scalepoints to define internal values in a meaninful way. | |||
const unsigned int PARAMETER_USES_CUSTOM_TEXT = 0x80; //!< Parameter uses custom text for displaying its value.\see CarlaPlugin::getParameterText() | |||
/**@}*/ | |||
/*! | |||
* @defgroup CustomDataTypes Custom Data types | |||
* | |||
* The type defines how the \param value in CustomData is stored. | |||
* | |||
* Types are valid URIs.\n | |||
* Any non-string type is saved in a base64 encoded format. | |||
*/ | |||
const char* const CUSTOM_DATA_INVALID = nullptr; //!< Null/Invalid data. | |||
const char* const CUSTOM_DATA_CHUNK = "http://kxstudio.sf.net/ns/carla/chunk"; //!< Carla Chunk | |||
const char* const CUSTOM_DATA_STRING = "http://kxstudio.sf.net/ns/carla/string"; //!< Carla String | |||
/**@}*/ | |||
/*! | |||
* @defgroup BridgeMessages Bridge Messages | |||
* | |||
* Various bridge related messages, used as configure(<message>, value). | |||
* \note This is for internal use only. | |||
* @{ | |||
*/ | |||
const char* const CARLA_BRIDGE_MSG_HIDE_GUI = "CarlaBridgeHideGUI"; //!< Plugin -> Host call, tells host GUI is now hidden | |||
const char* const CARLA_BRIDGE_MSG_SAVED = "CarlaBridgeSaved"; //!< Plugin -> Host call, tells host state is saved | |||
const char* const CARLA_BRIDGE_MSG_SAVE_NOW = "CarlaBridgeSaveNow"; //!< Host -> Plugin call, tells plugin to save state now | |||
const char* const CARLA_BRIDGE_MSG_SET_CHUNK = "CarlaBridgeSetChunk"; //!< Host -> Plugin call, tells plugin to set chunk in file \a value | |||
const char* const CARLA_BRIDGE_MSG_SET_CUSTOM = "CarlaBridgeSetCustom"; //!< Host -> Plugin call, tells plugin to set a custom data set using \a value ("type·key·rvalue").\n If \a type is 'chunk' or 'binary' \a rvalue refers to chunk file. | |||
/**@}*/ | |||
/*! | |||
* The binary type of a plugin. | |||
*/ | |||
enum BinaryType { | |||
BINARY_NONE = 0, //!< Null binary type. | |||
BINARY_POSIX32 = 1, //!< POSIX 32bit. | |||
BINARY_POSIX64 = 2, //!< POSIX 64bit. | |||
BINARY_WIN32 = 3, //!< Windows 32bit. | |||
BINARY_WIN64 = 4, //!< Windows 64bit. | |||
BINARY_OTHER = 5 //!< Other. | |||
}; | |||
/*! | |||
* All the available plugin types, as provided by subclasses of CarlaPlugin.\n | |||
* \note Some plugin classes might provide more than 1 plugin type. | |||
*/ | |||
enum PluginType { | |||
PLUGIN_NONE = 0, //!< Null plugin type. | |||
PLUGIN_INTERNAL = 1, //!< Internal plugin.\see NativePlugin | |||
PLUGIN_LADSPA = 2, //!< LADSPA plugin.\see LadspaPlugin | |||
PLUGIN_DSSI = 3, //!< DSSI plugin.\see DssiPlugin | |||
PLUGIN_LV2 = 4, //!< LV2 plugin.\see Lv2Plugin | |||
PLUGIN_VST = 5, //!< VST plugin.\see VstPlugin | |||
PLUGIN_GIG = 6, //!< GIG sound kit, implemented via LinuxSampler.\see LinuxSamplerPlugin | |||
PLUGIN_SF2 = 7, //!< SF2 sound kit (aka SoundFont), implemented via FluidSynth.\see FluidSynthPlugin | |||
PLUGIN_SFZ = 8 //!< SFZ sound kit, implemented via LinuxSampler.\see LinuxSamplerPlugin | |||
}; | |||
/*! | |||
* Plugin category, describing the funtionality of a plugin.\n | |||
* When a plugin fails to tell his own category, one is atributted to it based on its name. | |||
*/ | |||
enum PluginCategory { | |||
PLUGIN_CATEGORY_NONE = 0, //!< Null plugin category. | |||
PLUGIN_CATEGORY_SYNTH = 1, //!< A synthesizer or generator. | |||
PLUGIN_CATEGORY_DELAY = 2, //!< A delay or reverberator. | |||
PLUGIN_CATEGORY_EQ = 3, //!< An equalizer. | |||
PLUGIN_CATEGORY_FILTER = 4, //!< A filter. | |||
PLUGIN_CATEGORY_DYNAMICS = 5, //!< A 'dynamic' plugin (amplifier, compressor, gate, etc). | |||
PLUGIN_CATEGORY_MODULATOR = 6, //!< A 'modulator' plugin (chorus, flanger, phaser, etc). | |||
PLUGIN_CATEGORY_UTILITY = 7, //!< An 'utility' plugin (analyzer, converter, mixer, etc). | |||
PLUGIN_CATEGORY_OTHER = 8 //!< Misc plugin (used to check if the plugin has a category). | |||
}; | |||
/*! | |||
* Plugin parameter type. | |||
*/ | |||
enum ParameterType { | |||
PARAMETER_UNKNOWN = 0, //!< Null parameter type. | |||
PARAMETER_INPUT = 1, //!< Input parameter. | |||
PARAMETER_OUTPUT = 2, //!< Ouput parameter. | |||
PARAMETER_LATENCY = 3, //!< Special latency parameter, used in LADSPA, DSSI and LV2 plugins. | |||
PARAMETER_SAMPLE_RATE = 4, //!< Special sample-rate parameter, used in LADSPA, DSSI and LV2 plugins. | |||
PARAMETER_LV2_FREEWHEEL = 5, //!< Special LV2 Plugin parameter used to report freewheel (offline) mode. | |||
PARAMETER_LV2_TIME = 6 //!< Special LV2 Plugin parameter used to report time information. | |||
}; | |||
/*! | |||
* Internal parameter indexes.\n | |||
* These are special parameters used internally, plugins do not know about their existence. | |||
*/ | |||
enum InternalParametersIndex { | |||
PARAMETER_NULL = -1, //!< Null parameter. | |||
PARAMETER_ACTIVE = -2, //!< Active parameter, can only be 'true' or 'false'; default is 'false'. | |||
PARAMETER_DRYWET = -3, //!< Dry/Wet parameter, range 0.0...1.0; default is 1.0. | |||
PARAMETER_VOLUME = -4, //!< Volume parameter, range 0.0...1.27; default is 1.0. | |||
PARAMETER_BALANCE_LEFT = -5, //!< Balance-Left parameter, range -1.0...1.0; default is -1.0. | |||
PARAMETER_BALANCE_RIGHT = -6 //!< Balance-Right parameter, range -1.0...1.0; default is 1.0. | |||
}; | |||
/*! | |||
* Plugin custom GUI type. | |||
* \see OPTION_PREFER_UI_BRIDGES | |||
*/ | |||
enum GuiType { | |||
GUI_NONE = 0, //!< Null type, plugin has no custom GUI. | |||
GUI_INTERNAL_QT4 = 1, //!< Qt4 type, handled internally. | |||
GUI_INTERNAL_COCOA = 2, //!< Reparented MacOS native type, handled internally. | |||
GUI_INTERNAL_HWND = 3, //!< Reparented Windows native type, handled internally. | |||
GUI_INTERNAL_X11 = 4, //!< Reparented X11 native type, handled internally. | |||
GUI_EXTERNAL_LV2 = 5, //!< External LV2-UI type, handled internally. | |||
GUI_EXTERNAL_SUIL = 6, //!< SUIL type, currently used only for lv2 gtk2 direct-access UIs.\note This type will be removed in the future! | |||
GUI_EXTERNAL_OSC = 7 //!< External, osc-bridge controlled, UI. | |||
}; | |||
/*! | |||
* Options used in the set_option() call.\n | |||
* These options must be set before calling engine_init() or after engine_close(). | |||
*/ | |||
enum OptionsType { | |||
/*! | |||
* Try to set the current process name.\n | |||
* \note Not available on all platforms. | |||
*/ | |||
OPTION_PROCESS_NAME = 0, | |||
/*! | |||
* Set the engine processing mode.\n | |||
* Default is PROCESS_MODE_MULTIPLE_CLIENTS. | |||
* \see ProcessMode | |||
*/ | |||
OPTION_PROCESS_MODE = 1, | |||
/*! | |||
* High-Precision processing mode.\n | |||
* When enabled, audio will be processed by blocks of 8 samples at a time, indenpendently of the buffer size.\n | |||
* Default is off.\n | |||
* EXPERIMENTAL! | |||
*/ | |||
OPTION_PROCESS_HIGH_PRECISION = 2, | |||
/*! | |||
* Maximum number of parameters allowed.\n | |||
* Default is MAX_PARAMETERS. | |||
*/ | |||
OPTION_MAX_PARAMETERS = 3, | |||
/*! | |||
* Prefered buffer size, currently unused. | |||
*/ | |||
OPTION_PREFERRED_BUFFER_SIZE = 4, | |||
/*! | |||
* Prefered sample rate, currently unused. | |||
*/ | |||
OPTION_PREFERRED_SAMPLE_RATE = 5, | |||
/*! | |||
* Force mono plugins as stereo, by running 2 instances at the same time.\n | |||
* Not supported in VST plugins. | |||
*/ | |||
OPTION_FORCE_STEREO = 6, | |||
/*! | |||
* Use (unofficial) dssi-vst chunks feature.\n | |||
* Default is no.\n | |||
* EXPERIMENTAL! | |||
*/ | |||
OPTION_USE_DSSI_VST_CHUNKS = 7, | |||
/*! | |||
* Use plugin bridges whenever possible.\n | |||
* Default is no, and not recommended at this point!. | |||
* EXPERIMENTAL! | |||
*/ | |||
OPTION_PREFER_PLUGIN_BRIDGES = 8, | |||
/*! | |||
* Use OSC-UI bridges whenever possible, otherwise UIs will be handled in the main thread.\n | |||
* Default is yes. | |||
*/ | |||
OPTION_PREFER_UI_BRIDGES = 9, | |||
/*! | |||
* Timeout value in ms for how much to wait for OSC-UIs to respond.\n | |||
* Default is 4000 ms (4 secs). | |||
*/ | |||
OPTION_OSC_UI_TIMEOUT = 10, | |||
/*! | |||
* Set path to the POSIX 32bit plugin bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_POSIX32 = 11, | |||
/*! | |||
* Set path to the POSIX 64bit plugin bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_POSIX64 = 12, | |||
/*! | |||
* Set path to the Windows 32bit plugin bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_WIN32 = 13, | |||
/*! | |||
* Set path to the Windows 64bit plugin bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_WIN64 = 14, | |||
/*! | |||
* Set path to the LV2 Gtk2 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_GTK2 = 15, | |||
/*! | |||
* Set path to the LV2 Gtk3 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_GTK3 = 16, | |||
/*! | |||
* Set path to the LV2 Qt4 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_QT4 = 17, | |||
/*! | |||
* Set path to the LV2 Qt5 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_QT5 = 18, | |||
/*! | |||
* Set path to the LV2 Cocoa UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_COCOA = 19, | |||
/*! | |||
* Set path to the LV2 Windows UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_WINDOWS = 20, | |||
/*! | |||
* Set path to the LV2 X11 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_LV2_X11 = 21, | |||
/*! | |||
* Set path to the VST Cocoa UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_VST_COCOA = 22, | |||
/*! | |||
* Set path to the VST HWND UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_VST_HWND = 23, | |||
/*! | |||
* Set path to the VST X11 UI bridge executable.\n | |||
* Default unset. | |||
*/ | |||
OPTION_PATH_BRIDGE_VST_X11 = 24 | |||
}; | |||
/*! | |||
* Opcodes sent from the engine callback, as defined by CallbackFunc. | |||
* | |||
* \see set_callback_function() | |||
*/ | |||
enum CallbackType { | |||
/*! | |||
* Debug.\n | |||
* This opcode is undefined and used only for testing purposes. | |||
*/ | |||
CALLBACK_DEBUG = 0, | |||
/*! | |||
* A parameter has been changed. | |||
* | |||
* \param value1 Parameter index | |||
* \param value3 Value | |||
*/ | |||
CALLBACK_PARAMETER_VALUE_CHANGED = 1, | |||
/*! | |||
* A parameter's MIDI channel has been changed. | |||
* | |||
* \param value1 Parameter index | |||
* \param value2 MIDI channel | |||
*/ | |||
CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED = 2, | |||
/*! | |||
* A parameter's MIDI CC has been changed. | |||
* | |||
* \param value1 Parameter index | |||
* \param value2 MIDI CC | |||
*/ | |||
CALLBACK_PARAMETER_MIDI_CC_CHANGED = 3, | |||
/*! | |||
* The current program has has been changed. | |||
* | |||
* \param value1 Program index | |||
*/ | |||
CALLBACK_PROGRAM_CHANGED = 4, | |||
/*! | |||
* The current MIDI program has been changed. | |||
* | |||
* \param value1 MIDI bank | |||
* \param value2 MIDI program | |||
*/ | |||
CALLBACK_MIDI_PROGRAM_CHANGED = 5, | |||
/*! | |||
* A note has been pressed. | |||
* | |||
* \param value1 Channel | |||
* \param value2 Note | |||
* \param value3 Velocity | |||
*/ | |||
CALLBACK_NOTE_ON = 6, | |||
/*! | |||
* A note has been released. | |||
* | |||
* \param value1 Channel | |||
* \param value2 Note | |||
*/ | |||
CALLBACK_NOTE_OFF = 7, | |||
/*! | |||
* The plugin's custom GUI state has changed. | |||
* | |||
* \param value1 State, as follows:.\n | |||
* 0: GUI has been closed or hidden\n | |||
* 1: GUI has been shown\n | |||
* -1: GUI has crashed and should not be shown again\n | |||
*/ | |||
CALLBACK_SHOW_GUI = 8, | |||
/*! | |||
* The plugin's custom GUI has been resized. | |||
* | |||
* \param value1 Width | |||
* \param value2 Height | |||
*/ | |||
CALLBACK_RESIZE_GUI = 9, | |||
/*! | |||
* The plugin needs update. | |||
*/ | |||
CALLBACK_UPDATE = 10, | |||
/*! | |||
* The plugin's data/information has changed. | |||
*/ | |||
CALLBACK_RELOAD_INFO = 11, | |||
/*! | |||
* The plugin's parameters have changed. | |||
*/ | |||
CALLBACK_RELOAD_PARAMETERS = 12, | |||
/*! | |||
* The plugin's programs have changed. | |||
*/ | |||
CALLBACK_RELOAD_PROGRAMS = 13, | |||
/*! | |||
* The plugin's state has changed. | |||
*/ | |||
CALLBACK_RELOAD_ALL = 14, | |||
/*! | |||
* Non-Session-Manager Announce message. | |||
*/ | |||
CALLBACK_NSM_ANNOUNCE = 15, | |||
/*! | |||
* Non-Session-Manager Open message #1. | |||
*/ | |||
CALLBACK_NSM_OPEN1 = 16, | |||
/*! | |||
* Non-Session-Manager Open message #2. | |||
*/ | |||
CALLBACK_NSM_OPEN2 = 17, | |||
/*! | |||
* Non-Session-Manager Save message. | |||
*/ | |||
CALLBACK_NSM_SAVE = 18, | |||
/*! | |||
* An error occurred, show last error to user. | |||
*/ | |||
CALLBACK_ERROR = 19, | |||
/*! | |||
* The engine has crashed or malfunctioned and will no longer work. | |||
*/ | |||
CALLBACK_QUIT = 20 | |||
}; | |||
/*! | |||
* Engine process mode, changed using set_option(). | |||
* | |||
* \see OPTION_PROCESS_MODE | |||
*/ | |||
enum ProcessMode { | |||
PROCESS_MODE_SINGLE_CLIENT = 0, //!< Single client mode (dynamic input/outputs as needed by plugins) | |||
PROCESS_MODE_MULTIPLE_CLIENTS = 1, //!< Multiple client mode (1 master client + 1 client per plugin) | |||
PROCESS_MODE_CONTINUOUS_RACK = 2, //!< Single client, 'rack' mode. Processes plugins in order of id, with forced stereo. | |||
PROCESS_MODE_PATCHBAY = 3 //!< Single client, 'patchbay' mode. | |||
}; | |||
/*! | |||
* Callback function the backend will call when something interesting happens. | |||
* | |||
* \see set_callback_function() | |||
*/ | |||
typedef void (*CallbackFunc)(void* ptr, CallbackType action, unsigned short pluginId, int value1, int value2, double value3, const char* valueStr); | |||
struct ParameterData { | |||
ParameterType type; | |||
int32_t index; | |||
int32_t rindex; | |||
int32_t hints; | |||
uint8_t midiChannel; | |||
int16_t midiCC; | |||
ParameterData() | |||
: type(PARAMETER_UNKNOWN), | |||
index(-1), | |||
rindex(-1), | |||
hints(0), | |||
midiChannel(0), | |||
midiCC(-1) {} | |||
}; | |||
struct ParameterRanges { | |||
double def; | |||
double min; | |||
double max; | |||
double step; | |||
double stepSmall; | |||
double stepLarge; | |||
ParameterRanges() | |||
: def(0.0), | |||
min(0.0), | |||
max(1.0), | |||
step(0.01), | |||
stepSmall(0.0001), | |||
stepLarge(0.1) {} | |||
}; | |||
struct MidiProgramData { | |||
uint32_t bank; | |||
uint32_t program; | |||
const char* name; | |||
MidiProgramData() | |||
: bank(0), | |||
program(0), | |||
name(nullptr) {} | |||
}; | |||
struct CustomData { | |||
const char* type; | |||
const char* key; | |||
const char* value; | |||
CustomData() | |||
: type(nullptr), | |||
key(nullptr), | |||
value(nullptr) {} | |||
}; | |||
/**@}*/ | |||
// forward declarations of commonly used Carla classes | |||
class CarlaEngine; | |||
class CarlaPlugin; | |||
CARLA_BACKEND_END_NAMESPACE | |||
#endif // CARLA_BACKEND_HPP |
@@ -1,54 +0,0 @@ | |||
# QtCreator project file | |||
QT = core gui | |||
CONFIG = debug | |||
CONFIG += link_pkgconfig qt warn_on | |||
DEFINES = DEBUG | |||
DEFINES += QTCREATOR_TEST | |||
DEFINES += CARLA_ENGINE_RTAUDIO | |||
DEFINES += WANT_LADSPA WANT_DSSI WANT_LV2 WANT_VST | |||
DEFINES += WANT_FLUIDSYNTH WANT_LINUXSAMPLER | |||
PKGCONFIG = liblo | |||
PKGCONFIG += jack | |||
PKGCONFIG += alsa libpulse-simple | |||
PKGCONFIG += suil-0 | |||
PKGCONFIG += fluidsynth linuxsampler | |||
PKGCONFIG += fftw3 mxml | |||
TARGET = carla_backend | |||
TEMPLATE = app | |||
VERSION = 0.5.0 | |||
SOURCES = \ | |||
carla_backend_standalone.cpp | |||
HEADERS = \ | |||
carla_backend.hpp \ | |||
carla_backend_utils.hpp \ | |||
carla_backend_standalone.hpp | |||
INCLUDEPATH = . \ | |||
../carla-engine \ | |||
../carla-includes \ | |||
../carla-native \ | |||
../carla-plugin \ | |||
../carla-utils | |||
LIBS = \ | |||
../carla-engine/carla_engine.a \ | |||
../carla-plugin/carla_plugin.a \ | |||
../carla-native/carla_native.a | |||
LIBS += \ | |||
../carla-lilv/carla_lilv.a \ | |||
../carla-rtmempool/carla_rtmempool.a | |||
QMAKE_CXXFLAGS *= -std=c++0x | |||
unix { | |||
LIBS += -ldl -lm | |||
} |
@@ -1,186 +0,0 @@ | |||
/* | |||
* Carla Backend | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_BACKEND_STANDALONE_H | |||
#define CARLA_BACKEND_STANDALONE_H | |||
#include <cstdint> | |||
#include "carla_backend.hpp" | |||
// TODO - create struct for internal plugin info | |||
// TODO - dont strdup() on const-char* returns, use static char[STR_MAX] | |||
/*! | |||
* @defgroup CarlaBackendStandalone Carla Backend Standalone | |||
* | |||
* The Carla Backend Standalone API | |||
* | |||
* @{ | |||
*/ | |||
struct PluginInfo { | |||
CarlaBackend::PluginType type; | |||
CarlaBackend::PluginCategory category; | |||
unsigned int hints; | |||
const char* binary; | |||
const char* name; | |||
const char* label; | |||
const char* maker; | |||
const char* copyright; | |||
long uniqueId; | |||
PluginInfo() | |||
: type(CarlaBackend::PLUGIN_NONE), | |||
category(CarlaBackend::PLUGIN_CATEGORY_NONE), | |||
hints(0x0), | |||
binary(nullptr), | |||
name(nullptr), | |||
label(nullptr), | |||
maker(nullptr), | |||
copyright(nullptr), | |||
uniqueId(0) {} | |||
}; | |||
struct PortCountInfo { | |||
uint32_t ins; | |||
uint32_t outs; | |||
uint32_t total; | |||
PortCountInfo() | |||
: ins(0), | |||
outs(0), | |||
total(0) {} | |||
}; | |||
struct ParameterInfo { | |||
const char* name; | |||
const char* symbol; | |||
const char* unit; | |||
uint32_t scalePointCount; | |||
ParameterInfo() | |||
: name(nullptr), | |||
symbol(nullptr), | |||
unit(nullptr), | |||
scalePointCount(0) {} | |||
}; | |||
struct ScalePointInfo { | |||
double value; | |||
const char* label; | |||
ScalePointInfo() | |||
: value(0.0), | |||
label(nullptr) {} | |||
}; | |||
struct GuiInfo { | |||
CarlaBackend::GuiType type; | |||
bool resizable; | |||
GuiInfo() | |||
: type(CarlaBackend::GUI_NONE), | |||
resizable(false) {} | |||
}; | |||
CARLA_EXPORT const char* get_extended_license_text(); | |||
CARLA_EXPORT unsigned int get_engine_driver_count(); | |||
CARLA_EXPORT const char* get_engine_driver_name(unsigned int index); | |||
CARLA_EXPORT unsigned int get_internal_plugin_count(); | |||
CARLA_EXPORT const PluginInfo* get_internal_plugin_info(unsigned int pluginId); | |||
CARLA_EXPORT bool engine_init(const char* driverName, const char* clientName); | |||
CARLA_EXPORT bool engine_close(); | |||
CARLA_EXPORT bool is_engine_running(); | |||
CARLA_EXPORT short add_plugin(CarlaBackend::BinaryType btype, CarlaBackend::PluginType ptype, const char* filename, const char* name, const char* label, void* extraStuff); | |||
CARLA_EXPORT bool remove_plugin(unsigned short pluginId); | |||
CARLA_EXPORT const PluginInfo* get_plugin_info(unsigned short pluginId); | |||
CARLA_EXPORT const PortCountInfo* get_audio_port_count_info(unsigned short pluginId); | |||
CARLA_EXPORT const PortCountInfo* get_midi_port_count_info(unsigned short pluginId); | |||
CARLA_EXPORT const PortCountInfo* get_parameter_count_info(unsigned short pluginId); | |||
CARLA_EXPORT const ParameterInfo* get_parameter_info(unsigned short plugin_id, uint32_t parameterId); | |||
CARLA_EXPORT const ScalePointInfo* get_parameter_scalepoint_info(unsigned short pluginId, uint32_t parameterId, uint32_t scalePointId); | |||
CARLA_EXPORT const GuiInfo* get_gui_info(unsigned short pluginId); | |||
CARLA_EXPORT const CarlaBackend::ParameterData* get_parameter_data(unsigned short pluginId, uint32_t parameterId); | |||
CARLA_EXPORT const CarlaBackend::ParameterRanges* get_parameter_ranges(unsigned short pluginId, uint32_t parameterId); | |||
CARLA_EXPORT const CarlaBackend::MidiProgramData* get_midi_program_data(unsigned short pluginId, uint32_t midiProgramId); | |||
CARLA_EXPORT const CarlaBackend::CustomData* get_custom_data(unsigned short pluginId, uint32_t customDataId); | |||
CARLA_EXPORT const char* get_chunk_data(unsigned short pluginId); | |||
CARLA_EXPORT uint32_t get_parameter_count(unsigned short pluginId); | |||
CARLA_EXPORT uint32_t get_program_count(unsigned short pluginId); | |||
CARLA_EXPORT uint32_t get_midi_program_count(unsigned short pluginId); | |||
CARLA_EXPORT uint32_t get_custom_data_count(unsigned short pluginId); | |||
CARLA_EXPORT const char* get_parameter_text(unsigned short pluginId, uint32_t parameterId); | |||
CARLA_EXPORT const char* get_program_name(unsigned short pluginId, uint32_t programId); | |||
CARLA_EXPORT const char* get_midi_program_name(unsigned short pluginId, uint32_t midiProgramId); | |||
CARLA_EXPORT const char* get_real_plugin_name(unsigned short pluginId); | |||
CARLA_EXPORT int32_t get_current_program_index(unsigned short pluginId); | |||
CARLA_EXPORT int32_t get_current_midi_program_index(unsigned short pluginId); | |||
CARLA_EXPORT double get_default_parameter_value(unsigned short pluginId, uint32_t parameterId); | |||
CARLA_EXPORT double get_current_parameter_value(unsigned short pluginId, uint32_t parameterId); | |||
CARLA_EXPORT double get_input_peak_value(unsigned short pluginId, unsigned short portId); | |||
CARLA_EXPORT double get_output_peak_value(unsigned short pluginId, unsigned short portId); | |||
CARLA_EXPORT void set_active(unsigned short pluginId, bool onOff); | |||
CARLA_EXPORT void set_drywet(unsigned short pluginId, double value); | |||
CARLA_EXPORT void set_volume(unsigned short pluginId, double value); | |||
CARLA_EXPORT void set_balance_left(unsigned short pluginId, double value); | |||
CARLA_EXPORT void set_balance_right(unsigned short pluginId, double value); | |||
CARLA_EXPORT void set_parameter_value(unsigned short pluginId, uint32_t parameterId, double value); | |||
CARLA_EXPORT void set_parameter_midi_channel(unsigned short pluginId, uint32_t parameterId, uint8_t channel); | |||
CARLA_EXPORT void set_parameter_midi_cc(unsigned short pluginId, uint32_t parameterId, int16_t cc); | |||
CARLA_EXPORT void set_program(unsigned short pluginId, uint32_t programId); | |||
CARLA_EXPORT void set_midi_program(unsigned short pluginId, uint32_t midiProgramId); | |||
CARLA_EXPORT void set_custom_data(unsigned short pluginId, const char* type, const char* key, const char* value); | |||
CARLA_EXPORT void set_chunk_data(unsigned short pluginId, const char* chunkData); | |||
CARLA_EXPORT void set_gui_container(unsigned short pluginId, uintptr_t guiAddr); | |||
CARLA_EXPORT void show_gui(unsigned short pluginId, bool yesNo); | |||
CARLA_EXPORT void idle_guis(); | |||
CARLA_EXPORT void send_midi_note(unsigned short pluginId, uint8_t channel, uint8_t note, uint8_t velocity); | |||
CARLA_EXPORT void prepare_for_save(unsigned short pluginId); | |||
CARLA_EXPORT uint32_t get_buffer_size(); | |||
CARLA_EXPORT double get_sample_rate(); | |||
CARLA_EXPORT const char* get_last_error(); | |||
CARLA_EXPORT const char* get_host_osc_url(); | |||
CARLA_EXPORT void set_callback_function(CarlaBackend::CallbackFunc func); | |||
CARLA_EXPORT void set_option(CarlaBackend::OptionsType option, int value, const char* valueStr); | |||
CARLA_EXPORT void nsm_announce(const char* url, int pid); | |||
CARLA_EXPORT void nsm_reply_open(); | |||
CARLA_EXPORT void nsm_reply_save(); | |||
/**@}*/ | |||
#endif // CARLA_BACKEND_STANDALONE_H |
@@ -1,459 +0,0 @@ | |||
/* | |||
* Carla Backend | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_BACKEND_UTILS_HPP | |||
#define CARLA_BACKEND_UTILS_HPP | |||
#include "carla_backend.hpp" | |||
#include "carla_utils.hpp" | |||
CARLA_BACKEND_START_NAMESPACE | |||
/*! | |||
* @defgroup CarlaBackendUtils Carla Backend Utils | |||
* | |||
* Carla Backend Utils | |||
* | |||
* @{ | |||
*/ | |||
static inline | |||
const char* BinaryType2Str(const BinaryType& type) | |||
{ | |||
switch (type) | |||
{ | |||
case BINARY_NONE: | |||
return "BINARY_NONE"; | |||
case BINARY_POSIX32: | |||
return "BINARY_POSIX32"; | |||
case BINARY_POSIX64: | |||
return "BINARY_POSIX64"; | |||
case BINARY_WIN32: | |||
return "BINARY_WIN32"; | |||
case BINARY_WIN64: | |||
return "BINARY_WIN64"; | |||
case BINARY_OTHER: | |||
return "BINARY_OTHER"; | |||
} | |||
qWarning("CarlaBackend::BinaryType2Str(%i) - invalid type", type); | |||
return nullptr; | |||
} | |||
static inline | |||
const char* PluginType2Str(const PluginType& type) | |||
{ | |||
switch (type) | |||
{ | |||
case PLUGIN_NONE: | |||
return "PLUGIN_NONE"; | |||
case PLUGIN_INTERNAL: | |||
return "PLUGIN_INTERNAL"; | |||
case PLUGIN_LADSPA: | |||
return "PLUGIN_LADSPA"; | |||
case PLUGIN_DSSI: | |||
return "PLUGIN_DSSI"; | |||
case PLUGIN_LV2: | |||
return "PLUGIN_LV2"; | |||
case PLUGIN_VST: | |||
return "PLUGIN_VST"; | |||
case PLUGIN_GIG: | |||
return "PLUGIN_GIG"; | |||
case PLUGIN_SF2: | |||
return "PLUGIN_SF2"; | |||
case PLUGIN_SFZ: | |||
return "PLUGIN_SFZ"; | |||
} | |||
qWarning("CarlaBackend::PluginType2Str(%i) - invalid type", type); | |||
return nullptr; | |||
} | |||
static inline | |||
const char* PluginCategory2Str(const PluginCategory& category) | |||
{ | |||
switch (category) | |||
{ | |||
case PLUGIN_CATEGORY_NONE: | |||
return "PLUGIN_CATEGORY_NONE"; | |||
case PLUGIN_CATEGORY_SYNTH: | |||
return "PLUGIN_CATEGORY_SYNTH"; | |||
case PLUGIN_CATEGORY_DELAY: | |||
return "PLUGIN_CATEGORY_DELAY"; | |||
case PLUGIN_CATEGORY_EQ: | |||
return "PLUGIN_CATEGORY_EQ"; | |||
case PLUGIN_CATEGORY_FILTER: | |||
return "PLUGIN_CATEGORY_FILTER"; | |||
case PLUGIN_CATEGORY_DYNAMICS: | |||
return "PLUGIN_CATEGORY_DYNAMICS"; | |||
case PLUGIN_CATEGORY_MODULATOR: | |||
return "PLUGIN_CATEGORY_MODULATOR"; | |||
case PLUGIN_CATEGORY_UTILITY: | |||
return "PLUGIN_CATEGORY_UTILITY"; | |||
case PLUGIN_CATEGORY_OTHER: | |||
return "PLUGIN_CATEGORY_OTHER"; | |||
} | |||
qWarning("CarlaBackend::PluginCategory2Str(%i) - invalid category", category); | |||
return nullptr; | |||
} | |||
static inline | |||
const char* ParameterType2Str(const ParameterType& type) | |||
{ | |||
switch (type) | |||
{ | |||
case PARAMETER_UNKNOWN: | |||
return "PARAMETER_UNKNOWN"; | |||
case PARAMETER_INPUT: | |||
return "PARAMETER_INPUT"; | |||
case PARAMETER_OUTPUT: | |||
return "PARAMETER_OUTPUT"; | |||
case PARAMETER_LATENCY: | |||
return "PARAMETER_LATENCY"; | |||
case PARAMETER_SAMPLE_RATE: | |||
return "PARAMETER_SAMPLE_RATE"; | |||
case PARAMETER_LV2_FREEWHEEL: | |||
return "PARAMETER_LV2_FREEWHEEL"; | |||
case PARAMETER_LV2_TIME: | |||
return "PARAMETER_LV2_TIME"; | |||
} | |||
qWarning("CarlaBackend::ParameterType2Str(%i) - invalid type", type); | |||
return nullptr; | |||
} | |||
static inline | |||
const char* InternalParametersIndex2Str(const InternalParametersIndex& index) | |||
{ | |||
switch (index) | |||
{ | |||
case PARAMETER_NULL: | |||
return "PARAMETER_NULL"; | |||
case PARAMETER_ACTIVE: | |||
return "PARAMETER_ACTIVE"; | |||
case PARAMETER_DRYWET: | |||
return "PARAMETER_DRYWET"; | |||
case PARAMETER_VOLUME: | |||
return "PARAMETER_VOLUME"; | |||
case PARAMETER_BALANCE_LEFT: | |||
return "PARAMETER_BALANCE_LEFT"; | |||
case PARAMETER_BALANCE_RIGHT: | |||
return "PARAMETER_BALANCE_RIGHT"; | |||
} | |||
qWarning("CarlaBackend::InternalParametersIndex2Str(%i) - invalid index", index); | |||
return nullptr; | |||
} | |||
static inline | |||
const char* GuiType2Str(const GuiType& type) | |||
{ | |||
switch (type) | |||
{ | |||
case GUI_NONE: | |||
return "GUI_NONE"; | |||
case GUI_INTERNAL_QT4: | |||
return "GUI_INTERNAL_QT4"; | |||
case GUI_INTERNAL_COCOA: | |||
return "GUI_INTERNAL_COCOA"; | |||
case GUI_INTERNAL_HWND: | |||
return "GUI_INTERNAL_HWND"; | |||
case GUI_INTERNAL_X11: | |||
return "GUI_INTERNAL_X11"; | |||
case GUI_EXTERNAL_LV2: | |||
return "GUI_EXTERNAL_LV2"; | |||
case GUI_EXTERNAL_SUIL: | |||
return "GUI_EXTERNAL_SUIL"; | |||
case GUI_EXTERNAL_OSC: | |||
return "GUI_EXTERNAL_OSC"; | |||
} | |||
qWarning("CarlaBackend::GuiType2Str(%i) - invalid type", type); | |||
return nullptr; | |||
} | |||
static inline | |||
const char* OptionsType2Str(const OptionsType& type) | |||
{ | |||
switch (type) | |||
{ | |||
case OPTION_PROCESS_NAME: | |||
return "OPTION_PROCESS_NAME"; | |||
case OPTION_PROCESS_MODE: | |||
return "OPTION_PROCESS_MODE"; | |||
case OPTION_PROCESS_HIGH_PRECISION: | |||
return "OPTION_PROCESS_HIGH_PRECISION"; | |||
case OPTION_MAX_PARAMETERS: | |||
return "OPTION_MAX_PARAMETERS"; | |||
case OPTION_PREFERRED_BUFFER_SIZE: | |||
return "OPTION_PREFERRED_BUFFER_SIZE"; | |||
case OPTION_PREFERRED_SAMPLE_RATE: | |||
return "OPTION_PREFERRED_SAMPLE_RATE"; | |||
case OPTION_FORCE_STEREO: | |||
return "OPTION_FORCE_STEREO"; | |||
case OPTION_USE_DSSI_VST_CHUNKS: | |||
return "OPTION_USE_DSSI_VST_CHUNKS"; | |||
case OPTION_PREFER_PLUGIN_BRIDGES: | |||
return "OPTION_PREFER_PLUGIN_BRIDGES"; | |||
case OPTION_PREFER_UI_BRIDGES: | |||
return "OPTION_PREFER_UI_BRIDGES"; | |||
case OPTION_OSC_UI_TIMEOUT: | |||
return "OPTION_OSC_UI_TIMEOUT"; | |||
case OPTION_PATH_BRIDGE_POSIX32: | |||
return "OPTION_PATH_BRIDGE_POSIX32"; | |||
case OPTION_PATH_BRIDGE_POSIX64: | |||
return "OPTION_PATH_BRIDGE_POSIX64"; | |||
case OPTION_PATH_BRIDGE_WIN32: | |||
return "OPTION_PATH_BRIDGE_WIN32"; | |||
case OPTION_PATH_BRIDGE_WIN64: | |||
return "OPTION_PATH_BRIDGE_WIN64"; | |||
case OPTION_PATH_BRIDGE_LV2_GTK2: | |||
return "OPTION_PATH_BRIDGE_LV2_GTK2"; | |||
case OPTION_PATH_BRIDGE_LV2_GTK3: | |||
return "OPTION_PATH_BRIDGE_LV2_GTK3"; | |||
case OPTION_PATH_BRIDGE_LV2_QT4: | |||
return "OPTION_PATH_BRIDGE_LV2_QT4"; | |||
case OPTION_PATH_BRIDGE_LV2_QT5: | |||
return "OPTION_PATH_BRIDGE_LV2_QT5"; | |||
case OPTION_PATH_BRIDGE_LV2_COCOA: | |||
return "OPTION_PATH_BRIDGE_LV2_COCOA"; | |||
case OPTION_PATH_BRIDGE_LV2_WINDOWS: | |||
return "OPTION_PATH_BRIDGE_LV2_WINDOWS"; | |||
case OPTION_PATH_BRIDGE_LV2_X11: | |||
return "OPTION_PATH_BRIDGE_LV2_X11"; | |||
case OPTION_PATH_BRIDGE_VST_COCOA: | |||
return "OPTION_PATH_BRIDGE_VST_COCOA"; | |||
case OPTION_PATH_BRIDGE_VST_HWND: | |||
return "OPTION_PATH_BRIDGE_VST_HWND"; | |||
case OPTION_PATH_BRIDGE_VST_X11: | |||
return "OPTION_PATH_BRIDGE_VST_X11"; | |||
} | |||
qWarning("CarlaBackend::OptionsType2Str(%i) - invalid type", type); | |||
return nullptr; | |||
} | |||
static inline | |||
const char* CallbackType2Str(const CallbackType& type) | |||
{ | |||
switch (type) | |||
{ | |||
case CALLBACK_DEBUG: | |||
return "CALLBACK_DEBUG"; | |||
case CALLBACK_PARAMETER_VALUE_CHANGED: | |||
return "CALLBACK_PARAMETER_VALUE_CHANGED"; | |||
case CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED: | |||
return "CALLBACK_PARAMETER_MIDI_CHANNEL_CHANGED"; | |||
case CALLBACK_PARAMETER_MIDI_CC_CHANGED: | |||
return "CALLBACK_PARAMETER_MIDI_CC_CHANGED"; | |||
case CALLBACK_PROGRAM_CHANGED: | |||
return "CALLBACK_PROGRAM_CHANGED"; | |||
case CALLBACK_MIDI_PROGRAM_CHANGED: | |||
return "CALLBACK_MIDI_PROGRAM_CHANGED"; | |||
case CALLBACK_NOTE_ON: | |||
return "CALLBACK_NOTE_ON"; | |||
case CALLBACK_NOTE_OFF: | |||
return "CALLBACK_NOTE_OFF"; | |||
case CALLBACK_SHOW_GUI: | |||
return "CALLBACK_SHOW_GUI"; | |||
case CALLBACK_RESIZE_GUI: | |||
return "CALLBACK_RESIZE_GUI"; | |||
case CALLBACK_UPDATE: | |||
return "CALLBACK_UPDATE"; | |||
case CALLBACK_RELOAD_INFO: | |||
return "CALLBACK_RELOAD_INFO"; | |||
case CALLBACK_RELOAD_PARAMETERS: | |||
return "CALLBACK_RELOAD_PARAMETERS"; | |||
case CALLBACK_RELOAD_PROGRAMS: | |||
return "CALLBACK_RELOAD_PROGRAMS"; | |||
case CALLBACK_RELOAD_ALL: | |||
return "CALLBACK_RELOAD_ALL"; | |||
case CALLBACK_NSM_ANNOUNCE: | |||
return "CALLBACK_NSM_ANNOUNCE"; | |||
case CALLBACK_NSM_OPEN1: | |||
return "CALLBACK_NSM_OPEN1"; | |||
case CALLBACK_NSM_OPEN2: | |||
return "CALLBACK_NSM_OPEN2"; | |||
case CALLBACK_NSM_SAVE: | |||
return "CALLBACK_NSM_SAVE"; | |||
case CALLBACK_ERROR: | |||
return "CALLBACK_ERROR"; | |||
case CALLBACK_QUIT: | |||
return "CALLBACK_QUIT"; | |||
} | |||
qWarning("CarlaBackend::CallbackType2Str(%i) - invalid type", type); | |||
return nullptr; | |||
} | |||
static inline | |||
const char* ProcessMode2Str(const ProcessMode& mode) | |||
{ | |||
switch (mode) | |||
{ | |||
case PROCESS_MODE_SINGLE_CLIENT: | |||
return "PROCESS_MODE_SINGLE_CLIENT"; | |||
case PROCESS_MODE_MULTIPLE_CLIENTS: | |||
return "PROCESS_MODE_MULTIPLE_CLIENTS"; | |||
case PROCESS_MODE_CONTINUOUS_RACK: | |||
return "PROCESS_MODE_CONTINUOUS_RACK"; | |||
case PROCESS_MODE_PATCHBAY: | |||
return "PROCESS_MODE_PATCHBAY"; | |||
} | |||
qWarning("CarlaBackend::ProcessModeType2Str(%i) - invalid type", mode); | |||
return nullptr; | |||
} | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
static inline | |||
const char* getPluginTypeString(const PluginType& type) | |||
{ | |||
qDebug("CarlaBackend::getPluginTypeString(%s)", PluginType2Str(type)); | |||
switch (type) | |||
{ | |||
case PLUGIN_NONE: | |||
return "NONE"; | |||
case PLUGIN_INTERNAL: | |||
return "INTERNAL"; | |||
case PLUGIN_LADSPA: | |||
return "LADSPA"; | |||
case PLUGIN_DSSI: | |||
return "DSSI"; | |||
case PLUGIN_LV2: | |||
return "LV2"; | |||
case PLUGIN_VST: | |||
return "VST"; | |||
case PLUGIN_GIG: | |||
return "GIG"; | |||
case PLUGIN_SF2: | |||
return "SF2"; | |||
case PLUGIN_SFZ: | |||
return "SFZ"; | |||
} | |||
return "NONE"; | |||
} | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
static inline | |||
uintptr_t getAddressFromPointer(void* const ptr) | |||
{ | |||
qDebug("CarlaBackend::getAddressFromPointer(%p)", ptr); | |||
CARLA_ASSERT(ptr != nullptr); | |||
uintptr_t* addr = (uintptr_t*)&ptr; | |||
return *addr; | |||
} | |||
static inline | |||
void* getPointerFromAddress(const uintptr_t& addr) | |||
{ | |||
CARLA_ASSERT(addr != 0); | |||
uintptr_t** const ptr = (uintptr_t**)&addr; | |||
return *ptr; | |||
} | |||
static inline | |||
PluginCategory getPluginCategoryFromName(const char* const name) | |||
{ | |||
qDebug("CarlaBackend::getPluginCategoryFromName(\"%s\")", name); | |||
CARLA_ASSERT(name); | |||
if (! name) | |||
return PLUGIN_CATEGORY_NONE; | |||
CarlaString sname(name); | |||
if (sname.isEmpty()) | |||
return PLUGIN_CATEGORY_NONE; | |||
sname.toLower(); | |||
// generic tags first | |||
if (sname.contains("delay")) | |||
return PLUGIN_CATEGORY_DELAY; | |||
if (sname.contains("reverb")) | |||
return PLUGIN_CATEGORY_DELAY; | |||
// filter | |||
if (sname.contains("filter")) | |||
return PLUGIN_CATEGORY_FILTER; | |||
// dynamics | |||
if (sname.contains("dynamics")) | |||
return PLUGIN_CATEGORY_DYNAMICS; | |||
if (sname.contains("amplifier")) | |||
return PLUGIN_CATEGORY_DYNAMICS; | |||
if (sname.contains("compressor")) | |||
return PLUGIN_CATEGORY_DYNAMICS; | |||
if (sname.contains("enhancer")) | |||
return PLUGIN_CATEGORY_DYNAMICS; | |||
if (sname.contains("exciter")) | |||
return PLUGIN_CATEGORY_DYNAMICS; | |||
if (sname.contains("gate")) | |||
return PLUGIN_CATEGORY_DYNAMICS; | |||
if (sname.contains("limiter")) | |||
return PLUGIN_CATEGORY_DYNAMICS; | |||
// modulator | |||
if (sname.contains("modulator")) | |||
return PLUGIN_CATEGORY_MODULATOR; | |||
if (sname.contains("chorus")) | |||
return PLUGIN_CATEGORY_MODULATOR; | |||
if (sname.contains("flanger")) | |||
return PLUGIN_CATEGORY_MODULATOR; | |||
if (sname.contains("phaser")) | |||
return PLUGIN_CATEGORY_MODULATOR; | |||
if (sname.contains("saturator")) | |||
return PLUGIN_CATEGORY_MODULATOR; | |||
// utility | |||
if (sname.contains("utility")) | |||
return PLUGIN_CATEGORY_UTILITY; | |||
if (sname.contains("analyzer")) | |||
return PLUGIN_CATEGORY_UTILITY; | |||
if (sname.contains("converter")) | |||
return PLUGIN_CATEGORY_UTILITY; | |||
if (sname.contains("deesser")) | |||
return PLUGIN_CATEGORY_UTILITY; | |||
if (sname.contains("mixer")) | |||
return PLUGIN_CATEGORY_UTILITY; | |||
// common tags | |||
if (sname.contains("verb")) | |||
return PLUGIN_CATEGORY_DELAY; | |||
if (sname.contains("eq")) | |||
return PLUGIN_CATEGORY_EQ; | |||
if (sname.contains("tool")) | |||
return PLUGIN_CATEGORY_UTILITY; | |||
return PLUGIN_CATEGORY_NONE; | |||
} | |||
/**@}*/ | |||
CARLA_BACKEND_END_NAMESPACE | |||
#endif // CARLA_BACKEND_UTILS_HPP |
@@ -1,480 +0,0 @@ | |||
#!/usr/bin/make -f | |||
# Makefile for carla-bridges # | |||
# ---------------------------------------- # | |||
# Created by falkTX | |||
# | |||
include ../Makefile.mk | |||
HAVE_GTK2 = $(shell pkg-config --exists gtk+-2.0 && echo true) | |||
HAVE_GTK3 = $(shell pkg-config --exists gtk+-3.0 && echo true) | |||
# -------------------------------------------------------------- | |||
BUILD_CXX_FLAGS += -DBUILD_BRIDGE | |||
BUILD_CXX_FLAGS += -I. -I../carla-includes -I../carla-utils | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore QtXml) | |||
LINK_FLAGS += $(shell pkg-config --libs liblo QtCore QtXml) | |||
ifeq ($(CARLA_PLUGIN_SUPPORT),true) | |||
BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST | |||
endif | |||
ifeq ($(HAVE_QT5),true) | |||
QT_UI_FLAGS = $(shell pkg-config --cflags QtWidgets) | |||
QT_UI_LIBS = $(shell pkg-config --libs QtWidgets) | |||
else | |||
QT_UI_FLAGS = $(shell pkg-config --cflags QtGui) | |||
QT_UI_LIBS = $(shell pkg-config --libs QtGui) | |||
endif | |||
# -------------------------------------------------------------- | |||
# Plugin bridges | |||
BUILD_PLUGIN_FLAGS = $(BUILD_CXX_FLAGS) -DBUILD_BRIDGE_PLUGIN -DBRIDGE_PLUGIN | |||
BUILD_PLUGIN_FLAGS += -DCARLA_ENGINE_JACK -I../carla-backend -I../carla-engine -I../carla-jackbridge -I../carla-plugin | |||
BUILD_PLUGIN_FLAGS += $(shell pkg-config --cflags jack) $(QT_UI_FLAGS) | |||
LINK_PLUGIN_FLAGS = $(LINK_FLAGS) | |||
LINK_PLUGIN_FLAGS += $(QT_UI_LIBS) | |||
POSIX_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) | |||
POSIX_32BIT_FLAGS = $(32BIT_FLAGS) -L/usr/lib32 -L/usr/lib/i386-linux-gnu | |||
POSIX_64BIT_FLAGS = $(64BIT_FLAGS) -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu | |||
POSIX_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) $(shell pkg-config --libs jack) -ldl | |||
WIN_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) -DJACKBRIDGE_EXPORT -DPTW32_STATIC_LIB | |||
WIN_32BIT_FLAGS = $(32BIT_FLAGS) | |||
WIN_64BIT_FLAGS = $(64BIT_FLAGS) | |||
WIN_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) -mwindows -L../carla-jackbridge -lpthread -lwinspool -lole32 -luuid -limm32 -lshell32 -lws2_32 | |||
# -------------------------------------------------------------- | |||
# UI bridges | |||
BUILD_UI_FLAGS = $(BUILD_CXX_FLAGS) -DBUILD_BRIDGE_UI | |||
LINK_UI_FLAGS = $(LINK_FLAGS) -ldl | |||
BUILD_UI_LV2_FLAGS = $(BUILD_UI_FLAGS) -DBRIDGE_LV2 | |||
BUILD_UI_VST_FLAGS = $(BUILD_UI_FLAGS) -DBRIDGE_VST | |||
BUILD_UI_LV2_GTK2_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_GTK2 -DBRIDGE_LV2_GTK2 $(shell pkg-config --cflags gtk+-2.0) | |||
LINK_UI_LV2_GTK2_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs gtk+-2.0) | |||
BUILD_UI_LV2_GTK3_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_GTK3 -DBRIDGE_LV2_GTK3 $(shell pkg-config --cflags gtk+-3.0) | |||
LINK_UI_LV2_GTK3_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs gtk+-3.0) | |||
BUILD_UI_LV2_QT4_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_QT4 -DBRIDGE_LV2_QT4 $(shell pkg-config --cflags QtGui) | |||
LINK_UI_LV2_QT4_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs QtGui) | |||
BUILD_UI_LV2_QT5_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_QT5 -DBRIDGE_LV2_QT5 $(shell pkg-config --cflags QtWidgets) | |||
LINK_UI_LV2_QT5_FLAGS = $(LINK_UI_FLAGS) $(shell pkg-config --libs QtWidgets) | |||
BUILD_UI_LV2_HWND_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_HWND -DBRIDGE_LV2_HWND $(QT_UI_FLAGS) | |||
LINK_UI_LV2_HWND_FLAGS = $(LINK_FLAGS) $(QT_UI_LIBS) -mwindows -static | |||
BUILD_UI_LV2_X11_FLAGS = $(BUILD_UI_LV2_FLAGS) -DBRIDGE_X11 -DBRIDGE_LV2_X11 $(QT_UI_FLAGS) | |||
LINK_UI_LV2_X11_FLAGS = $(LINK_UI_FLAGS) $(QT_UI_LIBS) | |||
BUILD_UI_VST_HWND_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_HWND -DBRIDGE_VST_HWND $(QT_UI_FLAGS) | |||
LINK_UI_VST_HWND_FLAGS = $(LINK_FLAGS) $(QT_UI_LIBS) -mwindows -static | |||
BUILD_UI_VST_X11_FLAGS = $(BUILD_UI_VST_FLAGS) -DBRIDGE_X11 -DBRIDGE_VST_X11 $(QT_UI_FLAGS) | |||
LINK_UI_VST_X11_FLAGS = $(LINK_UI_FLAGS) $(QT_UI_LIBS) | |||
# -------------------------------------------------------------- | |||
ifeq ($(CARLA_PLUGIN_SUPPORT),true) | |||
all: native ui_lv2-gtk2 ui_lv2-gtk3 ui_lv2-qt4 ui_lv2-qt5 ui_lv2-x11 ui_vst-x11 | |||
ifeq ($(HAVE_GTK2),true) | |||
ui_lv2-gtk2: carla-bridge-lv2-gtk2 | |||
else | |||
ui_lv2-gtk2: | |||
endif | |||
ifeq ($(HAVE_GTK3),true) | |||
ui_lv2-gtk3: carla-bridge-lv2-gtk3 | |||
else | |||
ui_lv2-gtk3: | |||
endif | |||
ifneq ($(HAVE_QT5),true) | |||
ui_lv2-qt4: carla-bridge-lv2-qt4 | |||
ui_lv2-qt5: | |||
else | |||
ui_lv2-qt4: | |||
ui_lv2-qt5: carla-bridge-lv2-qt5 | |||
endif | |||
ui_lv2-hwnd: carla-bridge-lv2-hwnd.exe | |||
ui_lv2-x11: carla-bridge-lv2-x11 | |||
ui_vst-hwnd: carla-bridge-vst-hwnd.exe | |||
ui_vst-x11: carla-bridge-vst-x11 | |||
else # CARLA_PLUGIN_SUPPORT | |||
all: | |||
endif | |||
# -------------------------------------------------------------- | |||
native: carla-bridge-native | |||
posix32: carla-bridge-posix32 | |||
posix64: carla-bridge-posix64 | |||
win32: carla-bridge-win32.exe | |||
win64: carla-bridge-win64.exe | |||
# -------------------------------------------------------------- | |||
# UI common | |||
%__lv2.o: %.cpp | |||
$(CXX) $< $(BUILD_UI_LV2_FLAGS) -c -o $@ | |||
%__vst.o: %.cpp | |||
$(CXX) $< $(BUILD_UI_VST_FLAGS) -c -o $@ | |||
OBJS_UI_LV2_LIBS = \ | |||
../carla-lilv/carla_lilv.a \ | |||
../carla-rtmempool/carla_rtmempool.a | |||
# -------------------------------------------------------------- | |||
# ui_lv2-gtk2 | |||
OBJS_UI_LV2_GTK2 = carla_bridge_ui-lv2__lv2-gtk2.o \ | |||
carla_bridge_client__lv2.o carla_bridge_osc__lv2.o \ | |||
carla_bridge_toolkit__lv2.o carla_bridge_toolkit-gtk__lv2-gtk2.o | |||
carla-bridge-lv2-gtk2: $(OBJS_UI_LV2_GTK2) $(OBJS_UI_LV2_LIBS) | |||
$(CXX) $^ $(LINK_UI_LV2_GTK2_FLAGS) -o $@ && $(STRIP) $@ | |||
%__lv2-gtk2.o: %.cpp | |||
$(CXX) $< $(BUILD_UI_LV2_GTK2_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
# ui_lv2-gtk3 | |||
OBJS_UI_LV2_GTK3 = carla_bridge_ui-lv2__lv2-gtk3.o \ | |||
carla_bridge_client__lv2.o carla_bridge_osc__lv2.o \ | |||
carla_bridge_toolkit__lv2.o carla_bridge_toolkit-gtk__lv2-gtk3.o | |||
carla-bridge-lv2-gtk3: $(OBJS_UI_LV2_GTK3) $(OBJS_UI_LV2_LIBS) | |||
$(CXX) $^ $(LINK_UI_LV2_GTK3_FLAGS) -o $@ && $(STRIP) $@ | |||
%__lv2-gtk3.o: %.cpp | |||
$(CXX) $< $(BUILD_UI_LV2_GTK3_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
# ui_lv2-qt4 | |||
OBJS_UI_LV2_QT4 = carla_bridge_ui-lv2__lv2-qt4.o \ | |||
carla_bridge_client__lv2.o carla_bridge_osc__lv2.o \ | |||
carla_bridge_toolkit__lv2.o carla_bridge_toolkit-qt__lv2-qt4.o | |||
carla-bridge-lv2-qt4: $(OBJS_UI_LV2_QT4) $(OBJS_UI_LV2_LIBS) | |||
$(CXX) $^ $(LINK_UI_LV2_QT4_FLAGS) -o $@ && $(STRIP) $@ | |||
%__lv2-qt4.o: %.cpp | |||
$(CXX) $< $(BUILD_UI_LV2_QT4_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
# ui_lv2-qt5 | |||
OBJS_UI_LV2_QT5 = carla_bridge_ui-lv2__lv2-qt5.o \ | |||
carla_bridge_client__lv2.o carla_bridge_osc__lv2.o \ | |||
carla_bridge_toolkit__lv2.o carla_bridge_toolkit-qt__lv2-qt5.o | |||
carla-bridge-lv2-qt5: $(OBJS_UI_LV2_QT5) $(OBJS_UI_LV2_LIBS) | |||
$(CXX) $^ $(LINK_UI_LV2_QT5_FLAGS) -o $@ && $(STRIP) $@ | |||
%__lv2-qt5.o: %.cpp | |||
$(CXX) $< $(BUILD_UI_LV2_QT5_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
# ui_lv2-x11 | |||
OBJS_UI_LV2_X11 = carla_bridge_ui-lv2__lv2-x11.o \ | |||
carla_bridge_client__lv2.o carla_bridge_osc__lv2.o \ | |||
carla_bridge_toolkit__lv2.o carla_bridge_toolkit-qt__lv2-x11.o | |||
carla-bridge-lv2-x11: $(OBJS_UI_LV2_X11) $(OBJS_UI_LV2_LIBS) | |||
$(CXX) $^ $(LINK_UI_LV2_X11_FLAGS) -o $@ && $(STRIP) $@ | |||
%__lv2-x11.o: %.cpp | |||
$(CXX) $< $(BUILD_UI_LV2_X11_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
# ui_vst-hwnd | |||
OBJS_UI_VST_HWND = carla_bridge_ui-vst__vst-hwnd.o \ | |||
carla_bridge_client__vst.o carla_bridge_osc__vst.o \ | |||
carla_bridge_toolkit__vst.o carla_bridge_toolkit-qt__vst-hwnd.o | |||
carla-bridge-vst-hwnd.exe: $(OBJS_UI_VST_HWND) | |||
$(CXX) $^ $(LINK_UI_VST_HWND_FLAGS) -o $@ && $(STRIP) $@ | |||
%__vst-hwnd.o: %.cpp | |||
$(CXX) $< $(BUILD_UI_VST_HWND_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
# ui_vst-x11 | |||
OBJS_UI_VST_X11 = carla_bridge_ui-vst__vst-x11.o \ | |||
carla_bridge_client__vst.o carla_bridge_osc__vst.o \ | |||
carla_bridge_toolkit__vst.o carla_bridge_toolkit-qt__vst-x11.o | |||
carla-bridge-vst-x11: $(OBJS_UI_VST_X11) | |||
$(CXX) $^ $(LINK_UI_VST_X11_FLAGS) -o $@ && $(STRIP) $@ | |||
%__vst-x11.o: %.cpp | |||
$(CXX) $< $(BUILD_UI_VST_X11_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
# native | |||
NATIVE_BUILD_FLAGS = $(BUILD_PLUGIN_FLAGS) | |||
NATIVE_LINK_FLAGS = $(LINK_PLUGIN_FLAGS) $(shell pkg-config --libs jack) -ldl | |||
ifeq ($(HAVE_SUIL),true) | |||
NATIVE_BUILD_FLAGS += $(shell pkg-config --cflags suil-0) -DWANT_SUIL | |||
NATIVE_LINK_FLAGS += $(shell pkg-config --libs suil-0) | |||
endif | |||
OBJS_NATIVE = carla_bridge_plugin__native.o \ | |||
carla_bridge_client__native.o carla_bridge_osc__native.o \ | |||
carla_bridge_toolkit__native.o | |||
# carla | |||
OBJS_NATIVE += \ | |||
../carla/Shared__native.o | |||
# carla-engine | |||
OBJS_NATIVE += \ | |||
../carla-engine/carla_engine__native.o \ | |||
../carla-engine/carla_engine_osc__native.o \ | |||
../carla-engine/carla_engine_thread__native.o \ | |||
../carla-engine/jack__native.o | |||
# carla-plugin | |||
OBJS_NATIVE += \ | |||
../carla-plugin/carla_plugin__native.o \ | |||
../carla-plugin/carla_plugin_thread__native.o \ | |||
../carla-plugin/ladspa__native.o \ | |||
../carla-plugin/dssi__native.o \ | |||
../carla-plugin/lv2__native.o \ | |||
../carla-plugin/vst__native.o | |||
# libs | |||
OBJS_NATIVE += \ | |||
../carla-lilv/carla_lilv.a \ | |||
../carla-rtmempool/carla_rtmempool.a | |||
carla-bridge-native: $(OBJS_NATIVE) | |||
$(CXX) $^ $(NATIVE_LINK_FLAGS) -o $@ && $(STRIP) $@ | |||
%__native.o: %.cpp | |||
$(CXX) $< $(NATIVE_BUILD_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
# posix32 | |||
OBJS_POSIX32 = carla_bridge_plugin__posix32.o \ | |||
carla_bridge_client__posix32.o carla_bridge_osc__posix32.o \ | |||
carla_bridge_toolkit__posix32.o | |||
# carla | |||
OBJS_POSIX32 += \ | |||
../carla/Shared__posix32.o | |||
# carla-engine | |||
OBJS_POSIX32 += \ | |||
../carla-engine/carla_engine__posix32.o \ | |||
../carla-engine/carla_engine_osc__posix32.o \ | |||
../carla-engine/carla_engine_thread__posix32.o \ | |||
../carla-engine/jack__posix32.o | |||
# carla-plugin | |||
OBJS_POSIX32 += \ | |||
../carla-plugin/carla_plugin__posix32.o \ | |||
../carla-plugin/carla_plugin_thread__posix32.o \ | |||
../carla-plugin/ladspa__posix32.o \ | |||
../carla-plugin/dssi__posix32.o \ | |||
../carla-plugin/lv2__posix32.o \ | |||
../carla-plugin/vst__posix32.o | |||
# libs | |||
OBJS_POSIX32 += \ | |||
../carla-lilv/carla_lilv_posix32.a \ | |||
../carla-rtmempool/carla_rtmempool_posix32.a | |||
carla-bridge-posix32: $(OBJS_POSIX32) | |||
$(CXX) $^ $(POSIX_LINK_FLAGS) $(POSIX_32BIT_FLAGS) -o $@ && $(STRIP) $@ | |||
%__posix32.o: %.cpp | |||
$(CXX) $< $(POSIX_BUILD_FLAGS) $(POSIX_32BIT_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
# posix64 | |||
OBJS_POSIX64 = carla_bridge_plugin__posix64.o \ | |||
carla_bridge_client__posix64.o carla_bridge_osc__posix64.o \ | |||
carla_bridge_toolkit__posix64.o | |||
# carla | |||
OBJS_POSIX64 += \ | |||
../carla/Shared__posix64.o | |||
# carla-engine | |||
OBJS_POSIX64 += \ | |||
../carla-engine/carla_engine__posix64.o \ | |||
../carla-engine/carla_engine_osc__posix64.o \ | |||
../carla-engine/carla_engine_thread__posix64.o \ | |||
../carla-engine/jack__posix64.o | |||
# carla-plugin | |||
OBJS_POSIX64 += \ | |||
../carla-plugin/carla_plugin__posix64.o \ | |||
../carla-plugin/carla_plugin_thread__posix64.o \ | |||
../carla-plugin/ladspa__posix64.o \ | |||
../carla-plugin/dssi__posix64.o \ | |||
../carla-plugin/lv2__posix64.o \ | |||
../carla-plugin/vst__posix64.o | |||
# libs | |||
OBJS_POSIX64 += \ | |||
../carla-lilv/carla_lilv_posix64.a \ | |||
../carla-rtmempool/carla_rtmempool_posix64.a | |||
carla-bridge-posix64: $(OBJS_POSIX64) | |||
$(CXX) $^ $(POSIX_LINK_FLAGS) $(POSIX_64BIT_FLAGS) -o $@ && $(STRIP) $@ | |||
%__posix64.o: %.cpp | |||
$(CXX) $< $(POSIX_BUILD_FLAGS) $(POSIX_64BIT_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
# win32 | |||
OBJS_WIN32 = carla_bridge_plugin__win32.o \ | |||
carla_bridge_client__win32.o carla_bridge_osc__win32.o \ | |||
carla_bridge_toolkit__win32.o | |||
# carla | |||
OBJS_WIN32 += \ | |||
../carla/Shared__win32.o | |||
# carla-engine | |||
OBJS_WIN32 += \ | |||
../carla-engine/carla_engine__win32.o \ | |||
../carla-engine/carla_engine_osc__win32.o \ | |||
../carla-engine/carla_engine_thread__win32.o \ | |||
../carla-engine/jack__win32.o | |||
# carla-plugin | |||
OBJS_WIN32 += \ | |||
../carla-plugin/carla_plugin__win32.o \ | |||
../carla-plugin/carla_plugin_thread__win32.o \ | |||
../carla-plugin/ladspa__win32.o \ | |||
../carla-plugin/dssi__win32.o \ | |||
../carla-plugin/lv2__win32.o \ | |||
../carla-plugin/vst__win32.o | |||
# libs | |||
OBJS_WIN32 += \ | |||
../carla-lilv/carla_lilv_win32.a \ | |||
../carla-rtmempool/carla_rtmempool_win32.a | |||
carla-bridge-win32.exe: $(OBJS_WIN32) ../carla-jackbridge/libcarla-jackbridge-win32.dll | |||
$(CXX) $(OBJS_WIN32) $(WIN_32BIT_FLAGS) $(WIN_LINK_FLAGS) -lcarla-jackbridge-win32 -o $@ && $(STRIP) $@ | |||
%__win32.o: %.cpp | |||
$(CXX) $< $(WIN_BUILD_FLAGS) $(WIN_32BIT_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
# win64 | |||
OBJS_WIN64 = carla_bridge_plugin__win64.o \ | |||
carla_bridge_client__win64.o carla_bridge_osc__win64.o \ | |||
carla_bridge_toolkit__win64.o | |||
# carla | |||
OBJS_WIN64 += \ | |||
../carla/Shared__win64.o | |||
# carla-engine | |||
OBJS_WIN64 += \ | |||
../carla-engine/carla_engine__win64.o \ | |||
../carla-engine/carla_engine_osc__win64.o \ | |||
../carla-engine/carla_engine_thread__win64.o \ | |||
../carla-engine/jack__win64.o | |||
# carla-plugin | |||
OBJS_WIN64 += \ | |||
../carla-plugin/carla_plugin__win64.o \ | |||
../carla-plugin/carla_plugin_thread__win64.o \ | |||
../carla-plugin/ladspa__win64.o \ | |||
../carla-plugin/dssi__win64.o \ | |||
../carla-plugin/lv2__win64.o \ | |||
../carla-plugin/vst__win64.o | |||
# libs | |||
OBJS_WIN64 += \ | |||
../carla-lilv/carla_lilv_win64.a \ | |||
../carla-rtmempool/carla_rtmempool_win64.a | |||
carla-bridge-win64.exe: $(OBJS_WIN64) ../carla-jackbridge/libcarla-jackbridge-win64.dll | |||
$(CXX) $(OBJS_WIN64) $(WIN_64BIT_FLAGS) $(WIN_LINK_FLAGS) -lcarla-jackbridge-win64 -o $@ && $(STRIP) $@ | |||
%__win64.o: %.cpp | |||
$(CXX) $< $(WIN_BUILD_FLAGS) $(WIN_64BIT_FLAGS) -c -o $@ | |||
# -------------------------------------------------------------- | |||
../carla-lilv/carla_lilv.a: | |||
$(MAKE) -C ../carla-lilv | |||
../carla-lilv/carla_lilv_posix32.a: | |||
$(MAKE) -C ../carla-lilv posix32 | |||
../carla-lilv/carla_lilv_posix64.a: | |||
$(MAKE) -C ../carla-lilv posix64 | |||
../carla-lilv/carla_lilv_win32.a: | |||
$(MAKE) -C ../carla-lilv win32 | |||
../carla-lilv/carla_lilv_win64.a: | |||
$(MAKE) -C ../carla-lilv win64 | |||
../carla-rtmempool/carla_rtmempool.a: | |||
$(MAKE) -C ../carla-rtmempool | |||
../carla-rtmempool/carla_rtmempool_posix32.a: | |||
$(MAKE) -C ../carla-rtmempool posix32 | |||
../carla-rtmempool/carla_rtmempool_posix64.a: | |||
$(MAKE) -C ../carla-rtmempool posix64 | |||
../carla-rtmempool/carla_rtmempool_win32.a: | |||
$(MAKE) -C ../carla-rtmempool win32 | |||
../carla-rtmempool/carla_rtmempool_win64.a: | |||
$(MAKE) -C ../carla-rtmempool win64 | |||
../carla-jackbridge/libcarla-jackbridge-win32.dll: | |||
$(MAKE) -C ../carla-jackbridge win32 | |||
../carla-jackbridge/libcarla-jackbridge-win64.dll: | |||
$(MAKE) -C ../carla-jackbridge win64 | |||
# -------------------------------------------------------------- | |||
doxygen: carla_bridge.doxygen | |||
doxygen $< | |||
clean: | |||
rm -f *.o *.dll *.so *.exe | |||
rm -f $(OBJS_NATIVE) | |||
rm -f $(OBJS_POSIX32) | |||
rm -f $(OBJS_POSIX64) | |||
rm -f $(OBJS_WIN32) | |||
rm -f $(OBJS_WIN64) | |||
rm -f carla-bridge-lv2-gtk2 carla-bridge-lv2-gtk3 carla-bridge-lv2-qt4 carla-bridge-lv2-qt5 carla-bridge-lv2-x11 carla-bridge-vst-x11 | |||
rm -f carla-bridge-native carla-bridge-posix32 carla-bridge-posix64 |
@@ -1,287 +0,0 @@ | |||
# Doxyfile 1.7.6.1 | |||
#--------------------------------------------------------------------------- | |||
# Project related configuration options | |||
#--------------------------------------------------------------------------- | |||
DOXYFILE_ENCODING = UTF-8 | |||
PROJECT_NAME = "Carla Bridge" | |||
PROJECT_NUMBER = | |||
PROJECT_BRIEF = | |||
PROJECT_LOGO = | |||
OUTPUT_DIRECTORY = ../../doc/carla-bridge | |||
CREATE_SUBDIRS = NO | |||
OUTPUT_LANGUAGE = English | |||
BRIEF_MEMBER_DESC = YES | |||
REPEAT_BRIEF = YES | |||
ABBREVIATE_BRIEF = | |||
ALWAYS_DETAILED_SEC = NO | |||
INLINE_INHERITED_MEMB = NO | |||
FULL_PATH_NAMES = YES | |||
STRIP_FROM_PATH = | |||
STRIP_FROM_INC_PATH = | |||
SHORT_NAMES = NO | |||
JAVADOC_AUTOBRIEF = NO | |||
QT_AUTOBRIEF = NO | |||
MULTILINE_CPP_IS_BRIEF = NO | |||
INHERIT_DOCS = YES | |||
SEPARATE_MEMBER_PAGES = NO | |||
TAB_SIZE = 4 | |||
ALIASES = | |||
TCL_SUBST = | |||
OPTIMIZE_OUTPUT_FOR_C = NO | |||
OPTIMIZE_OUTPUT_JAVA = NO | |||
OPTIMIZE_FOR_FORTRAN = NO | |||
OPTIMIZE_OUTPUT_VHDL = NO | |||
EXTENSION_MAPPING = | |||
BUILTIN_STL_SUPPORT = NO | |||
CPP_CLI_SUPPORT = NO | |||
SIP_SUPPORT = NO | |||
IDL_PROPERTY_SUPPORT = YES | |||
DISTRIBUTE_GROUP_DOC = NO | |||
SUBGROUPING = YES | |||
INLINE_GROUPED_CLASSES = NO | |||
INLINE_SIMPLE_STRUCTS = NO | |||
TYPEDEF_HIDES_STRUCT = NO | |||
SYMBOL_CACHE_SIZE = 0 | |||
LOOKUP_CACHE_SIZE = 0 | |||
#--------------------------------------------------------------------------- | |||
# Build related configuration options | |||
#--------------------------------------------------------------------------- | |||
EXTRACT_ALL = YES | |||
EXTRACT_PRIVATE = NO | |||
EXTRACT_STATIC = NO | |||
EXTRACT_LOCAL_CLASSES = YES | |||
EXTRACT_LOCAL_METHODS = NO | |||
EXTRACT_ANON_NSPACES = NO | |||
HIDE_UNDOC_MEMBERS = NO | |||
HIDE_UNDOC_CLASSES = NO | |||
HIDE_FRIEND_COMPOUNDS = NO | |||
HIDE_IN_BODY_DOCS = NO | |||
INTERNAL_DOCS = NO | |||
CASE_SENSE_NAMES = YES | |||
HIDE_SCOPE_NAMES = NO | |||
SHOW_INCLUDE_FILES = YES | |||
FORCE_LOCAL_INCLUDES = NO | |||
INLINE_INFO = YES | |||
SORT_MEMBER_DOCS = NO | |||
SORT_BRIEF_DOCS = NO | |||
SORT_MEMBERS_CTORS_1ST = NO | |||
SORT_GROUP_NAMES = NO | |||
SORT_BY_SCOPE_NAME = NO | |||
STRICT_PROTO_MATCHING = NO | |||
GENERATE_TODOLIST = YES | |||
GENERATE_TESTLIST = YES | |||
GENERATE_BUGLIST = YES | |||
GENERATE_DEPRECATEDLIST= YES | |||
ENABLED_SECTIONS = | |||
MAX_INITIALIZER_LINES = 30 | |||
SHOW_USED_FILES = YES | |||
SHOW_DIRECTORIES = NO | |||
SHOW_FILES = YES | |||
SHOW_NAMESPACES = YES | |||
FILE_VERSION_FILTER = | |||
LAYOUT_FILE = | |||
CITE_BIB_FILES = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to warning and progress messages | |||
#--------------------------------------------------------------------------- | |||
QUIET = NO | |||
WARNINGS = YES | |||
WARN_IF_UNDOCUMENTED = YES | |||
WARN_IF_DOC_ERROR = YES | |||
WARN_NO_PARAMDOC = NO | |||
WARN_FORMAT = "$file:$line: $text" | |||
WARN_LOGFILE = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the input files | |||
#--------------------------------------------------------------------------- | |||
INPUT = | |||
INPUT_ENCODING = UTF-8 | |||
FILE_PATTERNS = | |||
RECURSIVE = NO | |||
EXCLUDE = carla_bridge_osc.hpp carla_bridge_osc.cpp carla_bridge_plugin.cpp | |||
EXCLUDE_SYMLINKS = NO | |||
EXCLUDE_PATTERNS = | |||
EXCLUDE_SYMBOLS = | |||
EXAMPLE_PATH = | |||
EXAMPLE_PATTERNS = | |||
EXAMPLE_RECURSIVE = NO | |||
IMAGE_PATH = | |||
INPUT_FILTER = | |||
FILTER_PATTERNS = | |||
FILTER_SOURCE_FILES = NO | |||
FILTER_SOURCE_PATTERNS = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to source browsing | |||
#--------------------------------------------------------------------------- | |||
SOURCE_BROWSER = NO | |||
INLINE_SOURCES = NO | |||
STRIP_CODE_COMMENTS = YES | |||
REFERENCED_BY_RELATION = NO | |||
REFERENCES_RELATION = NO | |||
REFERENCES_LINK_SOURCE = YES | |||
USE_HTAGS = NO | |||
VERBATIM_HEADERS = YES | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the alphabetical class index | |||
#--------------------------------------------------------------------------- | |||
ALPHABETICAL_INDEX = YES | |||
COLS_IN_ALPHA_INDEX = 5 | |||
IGNORE_PREFIX = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the HTML output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_HTML = YES | |||
HTML_OUTPUT = . | |||
HTML_FILE_EXTENSION = .html | |||
HTML_HEADER = | |||
HTML_FOOTER = | |||
HTML_STYLESHEET = | |||
HTML_EXTRA_FILES = | |||
HTML_COLORSTYLE_HUE = 220 | |||
HTML_COLORSTYLE_SAT = 100 | |||
HTML_COLORSTYLE_GAMMA = 80 | |||
HTML_TIMESTAMP = YES | |||
HTML_ALIGN_MEMBERS = YES | |||
HTML_DYNAMIC_SECTIONS = NO | |||
GENERATE_DOCSET = NO | |||
DOCSET_FEEDNAME = "Doxygen generated docs" | |||
DOCSET_BUNDLE_ID = org.doxygen.Project | |||
DOCSET_PUBLISHER_ID = org.doxygen.Publisher | |||
DOCSET_PUBLISHER_NAME = Publisher | |||
GENERATE_HTMLHELP = NO | |||
CHM_FILE = | |||
HHC_LOCATION = | |||
GENERATE_CHI = NO | |||
CHM_INDEX_ENCODING = | |||
BINARY_TOC = NO | |||
TOC_EXPAND = NO | |||
GENERATE_QHP = NO | |||
QCH_FILE = | |||
QHP_NAMESPACE = org.doxygen.Project | |||
QHP_VIRTUAL_FOLDER = doc | |||
QHP_CUST_FILTER_NAME = | |||
QHP_CUST_FILTER_ATTRS = | |||
QHP_SECT_FILTER_ATTRS = | |||
QHG_LOCATION = | |||
GENERATE_ECLIPSEHELP = NO | |||
ECLIPSE_DOC_ID = org.doxygen.Project | |||
DISABLE_INDEX = NO | |||
GENERATE_TREEVIEW = NO | |||
ENUM_VALUES_PER_LINE = 4 | |||
USE_INLINE_TREES = NO | |||
TREEVIEW_WIDTH = 250 | |||
EXT_LINKS_IN_WINDOW = NO | |||
FORMULA_FONTSIZE = 10 | |||
FORMULA_TRANSPARENT = YES | |||
USE_MATHJAX = NO | |||
MATHJAX_RELPATH = http://www.mathjax.org/mathjax | |||
MATHJAX_EXTENSIONS = | |||
SEARCHENGINE = YES | |||
SERVER_BASED_SEARCH = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the LaTeX output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_LATEX = NO | |||
LATEX_OUTPUT = latex | |||
LATEX_CMD_NAME = latex | |||
MAKEINDEX_CMD_NAME = makeindex | |||
COMPACT_LATEX = NO | |||
PAPER_TYPE = a4 | |||
EXTRA_PACKAGES = | |||
LATEX_HEADER = | |||
LATEX_FOOTER = | |||
PDF_HYPERLINKS = YES | |||
USE_PDFLATEX = YES | |||
LATEX_BATCHMODE = NO | |||
LATEX_HIDE_INDICES = NO | |||
LATEX_SOURCE_CODE = NO | |||
LATEX_BIB_STYLE = plain | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the RTF output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_RTF = NO | |||
RTF_OUTPUT = rtf | |||
COMPACT_RTF = NO | |||
RTF_HYPERLINKS = NO | |||
RTF_STYLESHEET_FILE = | |||
RTF_EXTENSIONS_FILE = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the man page output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_MAN = NO | |||
MAN_OUTPUT = man | |||
MAN_EXTENSION = .3 | |||
MAN_LINKS = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the XML output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_XML = NO | |||
XML_OUTPUT = xml | |||
XML_SCHEMA = | |||
XML_DTD = | |||
XML_PROGRAMLISTING = YES | |||
#--------------------------------------------------------------------------- | |||
# configuration options for the AutoGen Definitions output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_AUTOGEN_DEF = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the Perl module output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_PERLMOD = NO | |||
PERLMOD_LATEX = NO | |||
PERLMOD_PRETTY = YES | |||
PERLMOD_MAKEVAR_PREFIX = | |||
#--------------------------------------------------------------------------- | |||
# Configuration options related to the preprocessor | |||
#--------------------------------------------------------------------------- | |||
ENABLE_PREPROCESSING = YES | |||
MACRO_EXPANSION = NO | |||
EXPAND_ONLY_PREDEF = NO | |||
SEARCH_INCLUDES = YES | |||
INCLUDE_PATH = | |||
INCLUDE_FILE_PATTERNS = | |||
PREDEFINED = DOXYGEN BUILD_BRIDGE BUILD_BRIDGE_PLUGIN BUILD_BRIDGE_UI BRIDGE_LV2 BRIDGE_LV2_GTK2 BRIDGE_LV2_GTK3 BRIDGE_LV2_QT4 BRIDGE_LV2_X11 BRIDGE_VST BRIDGE_VST_HWND BRIDGE_VST_X11 | |||
EXPAND_AS_DEFINED = | |||
SKIP_FUNCTION_MACROS = YES | |||
#--------------------------------------------------------------------------- | |||
# Configuration::additions related to external references | |||
#--------------------------------------------------------------------------- | |||
TAGFILES = | |||
GENERATE_TAGFILE = | |||
ALLEXTERNALS = NO | |||
EXTERNAL_GROUPS = YES | |||
PERL_PATH = /usr/bin/perl | |||
#--------------------------------------------------------------------------- | |||
# Configuration options related to the dot tool | |||
#--------------------------------------------------------------------------- | |||
CLASS_DIAGRAMS = YES | |||
MSCGEN_PATH = | |||
HIDE_UNDOC_RELATIONS = YES | |||
HAVE_DOT = NO | |||
DOT_NUM_THREADS = 0 | |||
DOT_FONTNAME = Helvetica | |||
DOT_FONTSIZE = 10 | |||
DOT_FONTPATH = | |||
CLASS_GRAPH = YES | |||
COLLABORATION_GRAPH = YES | |||
GROUP_GRAPHS = YES | |||
UML_LOOK = NO | |||
TEMPLATE_RELATIONS = NO | |||
INCLUDE_GRAPH = YES | |||
INCLUDED_BY_GRAPH = YES | |||
CALL_GRAPH = NO | |||
CALLER_GRAPH = NO | |||
GRAPHICAL_HIERARCHY = YES | |||
DIRECTORY_GRAPH = YES | |||
DOT_IMAGE_FORMAT = png | |||
INTERACTIVE_SVG = NO | |||
DOT_PATH = | |||
DOTFILE_DIRS = | |||
MSCFILE_DIRS = | |||
DOT_GRAPH_MAX_NODES = 50 | |||
MAX_DOT_GRAPH_DEPTH = 0 | |||
DOT_TRANSPARENT = NO | |||
DOT_MULTI_TARGETS = YES | |||
GENERATE_LEGEND = YES | |||
DOT_CLEANUP = YES |
@@ -1,34 +0,0 @@ | |||
/* | |||
* Carla Bridge | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_BRIDGE_HPP | |||
#define CARLA_BRIDGE_HPP | |||
#include "carla_defines.hpp" | |||
#define CARLA_BRIDGE_START_NAMESPACE namespace CarlaBridge { | |||
#define CARLA_BRIDGE_END_NAMESPACE } | |||
#define CARLA_BRIDGE_USE_NAMESPACE using namespace CarlaBridge; | |||
CARLA_BRIDGE_START_NAMESPACE | |||
class CarlaBridgeClient; | |||
class CarlaBridgeToolkit; | |||
CARLA_BRIDGE_END_NAMESPACE | |||
#endif // CARLA_BRIDGE_HPP |
@@ -1,335 +0,0 @@ | |||
/* | |||
* Carla Bridge Client | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#include "carla_bridge_client.hpp" | |||
#include "carla_bridge_toolkit.hpp" | |||
#ifdef BUILD_BRIDGE_UI | |||
# include "carla_lib_utils.hpp" | |||
#endif | |||
#include <cstdlib> | |||
#include <cstring> | |||
CARLA_BRIDGE_START_NAMESPACE | |||
// --------------------------------------------------------------------- | |||
CarlaBridgeClient::CarlaBridgeClient(const char* const uiTitle) | |||
: m_osc(this), | |||
m_toolkit(CarlaBridgeToolkit::createNew(this, uiTitle)) | |||
{ | |||
qDebug("CarlaBridgeClient::CarlaBridgeClient(\"%s\")", uiTitle); | |||
m_oscData = nullptr; | |||
#ifdef BUILD_BRIDGE_UI | |||
m_uiFilename = nullptr; | |||
m_uiLib = nullptr; | |||
m_uiQuit = false; | |||
#endif | |||
} | |||
CarlaBridgeClient::~CarlaBridgeClient() | |||
{ | |||
qDebug("CarlaBridgeClient::~CarlaBridgeClient()"); | |||
#ifdef BUILD_BRIDGE_UI | |||
if (m_uiFilename) | |||
free(m_uiFilename); | |||
#endif | |||
delete m_toolkit; | |||
} | |||
#ifdef BUILD_BRIDGE_UI | |||
// --------------------------------------------------------------------- | |||
// ui initialization | |||
bool CarlaBridgeClient::init(const char* const, const char* const) | |||
{ | |||
qDebug("CarlaBridgeClient::init()"); | |||
// Test for single init | |||
{ | |||
static bool initiated = false; | |||
CARLA_ASSERT(! initiated); | |||
initiated = true; | |||
} | |||
m_uiQuit = false; | |||
m_toolkit->init(); | |||
return false; | |||
} | |||
void CarlaBridgeClient::close() | |||
{ | |||
qDebug("CarlaBridgeClient::close()"); | |||
if (! m_uiQuit) | |||
{ | |||
m_uiQuit = true; | |||
if (isOscControlRegistered()) | |||
sendOscExiting(); | |||
} | |||
m_toolkit->quit(); | |||
} | |||
#endif | |||
// --------------------------------------------------------------------- | |||
// osc stuff | |||
bool CarlaBridgeClient::oscInit(const char* const url) | |||
{ | |||
qDebug("CarlaBridgeClient::oscInit(\"%s\")", url); | |||
const bool ret = m_osc.init(url); | |||
m_oscData = m_osc.getControlData(); | |||
return ret; | |||
} | |||
bool CarlaBridgeClient::oscIdle() | |||
{ | |||
m_osc.idle(); | |||
#ifdef BUILD_BRIDGE_UI | |||
return ! m_uiQuit; | |||
#else | |||
return true; | |||
#endif | |||
} | |||
void CarlaBridgeClient::oscClose() | |||
{ | |||
qDebug("CarlaBridgeClient::oscClose()"); | |||
CARLA_ASSERT(m_oscData); | |||
m_osc.close(); | |||
m_oscData = nullptr; | |||
} | |||
bool CarlaBridgeClient::isOscControlRegistered() const | |||
{ | |||
return m_osc.isControlRegistered(); | |||
} | |||
void CarlaBridgeClient::sendOscUpdate() | |||
{ | |||
qDebug("CarlaBridgeClient::sendOscUpdate()"); | |||
CARLA_ASSERT(m_oscData); | |||
if (m_oscData && m_oscData->target) | |||
osc_send_update(m_oscData, m_osc.getServerPath()); | |||
} | |||
#ifdef BUILD_BRIDGE_PLUGIN | |||
void CarlaBridgeClient::sendOscBridgeUpdate() | |||
{ | |||
qDebug("CarlaBridgeClient::sendOscBridgeUpdate()"); | |||
CARLA_ASSERT(m_oscData); | |||
CARLA_ASSERT(m_oscData->target && m_oscData->path); | |||
if (m_oscData && m_oscData->target && m_oscData->path) | |||
osc_send_bridge_update(m_oscData, m_oscData->path); | |||
} | |||
void CarlaBridgeClient::sendOscBridgeError(const char* const error) | |||
{ | |||
qDebug("CarlaBridgeClient::sendOscBridgeError(\"%s\")", error); | |||
CARLA_ASSERT(m_oscData); | |||
CARLA_ASSERT(error); | |||
if (m_oscData && m_oscData->target) | |||
osc_send_bridge_error(m_oscData, error); | |||
} | |||
#endif | |||
// --------------------------------------------------------------------- | |||
// toolkit | |||
void CarlaBridgeClient::toolkitShow() | |||
{ | |||
qDebug("CarlaBridgeClient::toolkitShow()"); | |||
m_toolkit->show(); | |||
} | |||
void CarlaBridgeClient::toolkitHide() | |||
{ | |||
qDebug("CarlaBridgeClient::toolkitHide()"); | |||
m_toolkit->hide(); | |||
} | |||
void CarlaBridgeClient::toolkitResize(const int width, const int height) | |||
{ | |||
qDebug("CarlaBridgeClient::toolkitResize(%i, %i)", width, height); | |||
m_toolkit->resize(width, height); | |||
} | |||
void CarlaBridgeClient::toolkitExec(const bool showGui) | |||
{ | |||
qDebug("CarlaBridgeClient::toolkitExec(%s)", bool2str(showGui)); | |||
m_toolkit->exec(showGui); | |||
} | |||
void CarlaBridgeClient::toolkitQuit() | |||
{ | |||
qDebug("CarlaBridgeClient::toolkitQuit()"); | |||
#ifdef BUILD_BRIDGE_UI | |||
m_uiQuit = true; | |||
#endif | |||
m_toolkit->quit(); | |||
} | |||
// --------------------------------------------------------------------- | |||
void CarlaBridgeClient::sendOscConfigure(const char* const key, const char* const value) | |||
{ | |||
qDebug("CarlaBridgeClient::sendOscConfigure(\"%s\", \"%s\")", key, value); | |||
CARLA_ASSERT(m_oscData); | |||
if (m_oscData && m_oscData->target) | |||
osc_send_configure(m_oscData, key, value); | |||
} | |||
void CarlaBridgeClient::sendOscControl(const int32_t index, const float value) | |||
{ | |||
qDebug("CarlaBridgeClient::sendOscControl(%i, %f)", index, value); | |||
CARLA_ASSERT(m_oscData); | |||
if (m_oscData && m_oscData->target) | |||
osc_send_control(m_oscData, index, value); | |||
} | |||
void CarlaBridgeClient::sendOscProgram(const int32_t index) | |||
{ | |||
qDebug("CarlaBridgeClient::sendOscProgram(%i)", index); | |||
CARLA_ASSERT(m_oscData); | |||
if (m_oscData && m_oscData->target) | |||
osc_send_program(m_oscData, index); | |||
} | |||
void CarlaBridgeClient::sendOscMidiProgram(const int32_t index) | |||
{ | |||
qDebug("CarlaBridgeClient::sendOscMidiProgram(%i)", index); | |||
CARLA_ASSERT(m_oscData); | |||
if (m_oscData && m_oscData->target) | |||
osc_send_midi_program(m_oscData, index); | |||
} | |||
void CarlaBridgeClient::sendOscMidi(const uint8_t midiBuf[4]) | |||
{ | |||
qDebug("CarlaBridgeClient::sendOscMidi(%p)", midiBuf); | |||
CARLA_ASSERT(m_oscData); | |||
if (m_oscData && m_oscData->target) | |||
osc_send_midi(m_oscData, midiBuf); | |||
} | |||
void CarlaBridgeClient::sendOscExiting() | |||
{ | |||
qDebug("CarlaBridgeClient::sendOscExiting()"); | |||
CARLA_ASSERT(m_oscData); | |||
if (m_oscData && m_oscData->target) | |||
osc_send_exiting(m_oscData); | |||
} | |||
#ifdef BRIDGE_LV2 | |||
void CarlaBridgeClient::sendOscLv2TransferAtom(const int32_t portIndex, const char* const typeStr, const char* const atomBuf) | |||
{ | |||
qDebug("CarlaBridgeClient::sendOscLv2TransferAtom(%i, \"%s\", \"%s\")", portIndex, typeStr, atomBuf); | |||
CARLA_ASSERT(m_oscData); | |||
if (m_oscData && m_oscData->target) | |||
osc_send_lv2_transfer_atom(m_oscData, portIndex, typeStr, atomBuf); | |||
} | |||
void CarlaBridgeClient::sendOscLv2TransferEvent(const int32_t portIndex, const char* const typeStr, const char* const atomBuf) | |||
{ | |||
qDebug("CarlaBridgeClient::sendOscLv2TransferEvent(%i, \"%s\", \"%s\")", portIndex, typeStr, atomBuf); | |||
CARLA_ASSERT(m_oscData); | |||
if (m_oscData && m_oscData->target) | |||
osc_send_lv2_transfer_event(m_oscData, portIndex, typeStr, atomBuf); | |||
} | |||
#endif | |||
// --------------------------------------------------------------------- | |||
void* CarlaBridgeClient::getContainerId() | |||
{ | |||
return m_toolkit->getContainerId(); | |||
} | |||
#ifdef BUILD_BRIDGE_UI | |||
bool CarlaBridgeClient::uiLibOpen(const char* const filename) | |||
{ | |||
CARLA_ASSERT(! m_uiLib); | |||
CARLA_ASSERT(filename); | |||
if (m_uiFilename) | |||
free(m_uiFilename); | |||
m_uiLib = lib_open(filename); | |||
m_uiFilename = strdup(filename ? filename : ""); | |||
return bool(m_uiLib); | |||
} | |||
bool CarlaBridgeClient::uiLibClose() | |||
{ | |||
CARLA_ASSERT(m_uiLib); | |||
if (m_uiLib) | |||
{ | |||
const bool closed = lib_close(m_uiLib); | |||
m_uiLib = nullptr; | |||
return closed; | |||
} | |||
return false; | |||
} | |||
void* CarlaBridgeClient::uiLibSymbol(const char* const symbol) | |||
{ | |||
CARLA_ASSERT(m_uiLib); | |||
if (m_uiLib) | |||
return lib_symbol(m_uiLib, symbol); | |||
return nullptr; | |||
} | |||
const char* CarlaBridgeClient::uiLibError() | |||
{ | |||
return lib_error(m_uiFilename); | |||
} | |||
#endif | |||
CARLA_BRIDGE_END_NAMESPACE |
@@ -1,153 +0,0 @@ | |||
/* | |||
* Carla Bridge Client | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_BRIDGE_CLIENT_HPP | |||
#define CARLA_BRIDGE_CLIENT_HPP | |||
#include "carla_bridge_osc.hpp" | |||
CARLA_BRIDGE_START_NAMESPACE | |||
#if 0 | |||
} // Fix editor indentation | |||
#endif | |||
/*! | |||
* @defgroup CarlaBridgeClient Carla Bridge Client | |||
* | |||
* The Carla Bridge Client. | |||
* @{ | |||
*/ | |||
class CarlaBridgeClient | |||
{ | |||
public: | |||
CarlaBridgeClient(const char* const uiTitle); | |||
virtual ~CarlaBridgeClient(); | |||
#ifdef BUILD_BRIDGE_UI | |||
// --------------------------------------------------------------------- | |||
// ui initialization | |||
virtual bool init(const char* const, const char* const); | |||
virtual void close(); | |||
#endif | |||
#ifdef BUILD_BRIDGE_UI | |||
// --------------------------------------------------------------------- | |||
// ui management | |||
virtual void* getWidget() const = 0; | |||
virtual bool isResizable() const = 0; | |||
virtual bool needsReparent() const = 0; | |||
#endif | |||
// --------------------------------------------------------------------- | |||
// processing | |||
virtual void setParameter(const int32_t rindex, const double value) = 0; | |||
virtual void setProgram(const uint32_t index) = 0; | |||
#ifdef BUILD_BRIDGE_PLUGIN | |||
virtual void setMidiProgram(const uint32_t index) = 0; | |||
#endif | |||
#ifdef BUILD_BRIDGE_UI | |||
virtual void setMidiProgram(const uint32_t bank, const uint32_t program) = 0; | |||
#endif | |||
virtual void noteOn(const uint8_t channel, const uint8_t note, const uint8_t velo) = 0; | |||
virtual void noteOff(const uint8_t channel, const uint8_t note) = 0; | |||
#ifdef BUILD_BRIDGE_PLUGIN | |||
// --------------------------------------------------------------------- | |||
// plugin | |||
virtual void saveNow() = 0; | |||
virtual void setCustomData(const char* const type, const char* const key, const char* const value) = 0; | |||
virtual void setChunkData(const char* const filePath) = 0; | |||
#endif | |||
// --------------------------------------------------------------------- | |||
// osc stuff | |||
bool oscInit(const char* const url); | |||
bool oscIdle(); | |||
void oscClose(); | |||
bool isOscControlRegistered() const; | |||
void sendOscUpdate(); | |||
#ifdef BUILD_BRIDGE_PLUGIN | |||
void sendOscBridgeUpdate(); | |||
void sendOscBridgeError(const char* const error); | |||
#endif | |||
// --------------------------------------------------------------------- | |||
// toolkit | |||
void toolkitShow(); | |||
void toolkitHide(); | |||
void toolkitResize(const int width, const int height); | |||
void toolkitExec(const bool showGui); | |||
void toolkitQuit(); | |||
// --------------------------------------------------------------------- | |||
protected: | |||
void sendOscConfigure(const char* const key, const char* const value); | |||
void sendOscControl(const int32_t index, const float value); | |||
void sendOscProgram(const int32_t index); | |||
void sendOscMidiProgram(const int32_t index); | |||
void sendOscMidi(const uint8_t midiBuf[4]); | |||
void sendOscExiting(); | |||
#ifdef BRIDGE_LV2 | |||
void sendOscLv2TransferAtom(const int32_t portIndex, const char* const typeStr, const char* const atomBuf); | |||
void sendOscLv2TransferEvent(const int32_t portIndex, const char* const typeStr, const char* const atomBuf); | |||
#endif | |||
// --------------------------------------------------------------------- | |||
void* getContainerId(); | |||
#ifdef BUILD_BRIDGE_UI | |||
bool uiLibOpen(const char* const filename); | |||
bool uiLibClose(); | |||
void* uiLibSymbol(const char* const symbol); | |||
const char* uiLibError(); | |||
#endif | |||
// --------------------------------------------------------------------- | |||
private: | |||
CarlaBridgeOsc m_osc; | |||
CarlaBridgeToolkit* const m_toolkit; | |||
const CarlaOscData* m_oscData; | |||
#ifdef BUILD_BRIDGE_UI | |||
char* m_uiFilename; | |||
void* m_uiLib; | |||
bool m_uiQuit; | |||
#else | |||
friend class CarlaPluginClient; | |||
#endif | |||
}; | |||
/**@}*/ | |||
CARLA_BRIDGE_END_NAMESPACE | |||
#endif // CARLA_BRIDGE_CLIENT_HPP |
@@ -1,409 +0,0 @@ | |||
/* | |||
* Carla Bridge OSC | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#include "carla_bridge_osc.hpp" | |||
#include "carla_bridge_client.hpp" | |||
#include "carla_midi.h" | |||
#include "carla_utils.hpp" | |||
#include <QtCore/QString> | |||
#include <QtCore/QStringList> | |||
CARLA_BRIDGE_START_NAMESPACE | |||
// ----------------------------------------------------------------------- | |||
CarlaBridgeOsc::CarlaBridgeOsc(CarlaBridgeClient* const client_) | |||
: client(client_) | |||
{ | |||
qDebug("CarlaBridgeOsc::CarlaBridgeOsc(%p)", client); | |||
CARLA_ASSERT(client); | |||
m_name = nullptr; | |||
m_nameSize = 0; | |||
m_server = nullptr; | |||
m_serverPath = nullptr; | |||
} | |||
CarlaBridgeOsc::~CarlaBridgeOsc() | |||
{ | |||
qDebug("CarlaBridgeOsc::~CarlaBridgeOsc()"); | |||
CARLA_ASSERT(! m_name); | |||
CARLA_ASSERT(! m_server); | |||
CARLA_ASSERT(! m_serverPath); | |||
} | |||
bool CarlaBridgeOsc::init(const char* const url) | |||
{ | |||
qDebug("CarlaBridgeOsc::init(\"%s\")", url); | |||
CARLA_ASSERT(! m_name); | |||
CARLA_ASSERT(! m_server); | |||
CARLA_ASSERT(! m_serverPath); | |||
CARLA_ASSERT(m_nameSize == 0); | |||
CARLA_ASSERT(url); | |||
if (! url) | |||
{ | |||
qWarning("CarlaBridgeOsc::init(\"%s\") - invalid url", url); | |||
return false; | |||
} | |||
#ifdef BUILD_BRIDGE_PLUGIN | |||
m_name = strdup("carla-bridge-plugin"); | |||
#else | |||
m_name = strdup("carla-bridge-ui"); | |||
#endif | |||
m_nameSize = strlen(m_name); | |||
char* const host = lo_url_get_hostname(url); | |||
char* const path = lo_url_get_path(url); | |||
char* const port = lo_url_get_port(url); | |||
if (! host) | |||
{ | |||
qCritical("CarlaBridgeOsc::init(\"%s\") - failed to get url hostname", url); | |||
return false; | |||
} | |||
if (! path) | |||
{ | |||
free(host); | |||
qCritical("CarlaBridgeOsc::init(\"%s\") - failed to get url path", url); | |||
return false; | |||
} | |||
if (! port) | |||
{ | |||
free(host); | |||
free(path); | |||
qCritical("CarlaBridgeOsc::init(\"%s\") - failed to get url port", url); | |||
return false; | |||
} | |||
m_controlData.path = path; | |||
m_controlData.target = lo_address_new_with_proto(LO_TCP, host, port); | |||
free(host); | |||
free(port); | |||
if (! m_controlData.target) | |||
{ | |||
qCritical("CarlaBridgeOsc::init(\"%s\") - failed to get new url address for host '%s' and port '%s'", url, host, port); | |||
return false; | |||
} | |||
m_server = lo_server_new_with_proto(nullptr, LO_TCP, osc_error_handler); | |||
if (! m_server) | |||
{ | |||
qCritical("CarlaBridgeOsc::init(\"%s\") - failed to create new OSC server", url); | |||
return false; | |||
} | |||
if (char* const serverUrl = lo_server_get_url(m_server)) | |||
{ | |||
m_serverPath = strdup(QString("%1%2").arg(serverUrl).arg(m_name).toUtf8().constData()); | |||
free(serverUrl); | |||
} | |||
else | |||
m_serverPath = strdup(QString("%1carla-bridge").arg(serverUrl).toUtf8().constData()); | |||
lo_server_add_method(m_server, nullptr, nullptr, osc_message_handler, this); | |||
return true; | |||
} | |||
void CarlaBridgeOsc::idle() | |||
{ | |||
CARLA_ASSERT(m_server); | |||
if (m_server) | |||
{ | |||
while (lo_server_recv_noblock(m_server, 0) != 0) {} | |||
} | |||
} | |||
void CarlaBridgeOsc::close() | |||
{ | |||
qDebug("CarlaBridgeOsc::close()"); | |||
CARLA_ASSERT(m_name); | |||
CARLA_ASSERT(m_server); | |||
CARLA_ASSERT(m_serverPath); | |||
m_nameSize = 0; | |||
if (m_name) | |||
{ | |||
free(m_name); | |||
m_name = nullptr; | |||
} | |||
if (m_server) | |||
{ | |||
lo_server_del_method(m_server, nullptr, nullptr); | |||
lo_server_free(m_server); | |||
m_server = nullptr; | |||
} | |||
if (m_serverPath) | |||
{ | |||
free(m_serverPath); | |||
m_serverPath = nullptr; | |||
} | |||
m_controlData.free(); | |||
} | |||
// ----------------------------------------------------------------------- | |||
int CarlaBridgeOsc::handleMessage(const char* const path, const int argc, const lo_arg* const* const argv, const char* const types, const lo_message msg) | |||
{ | |||
qDebug("CarlaBridgeOsc::handleMessage(\"%s\", %i, %p, \"%s\", %p)", path, argc, argv, types, msg); | |||
CARLA_ASSERT(m_name); | |||
CARLA_ASSERT(m_server); | |||
CARLA_ASSERT(m_serverPath); | |||
CARLA_ASSERT(path); | |||
if (! path) | |||
{ | |||
qCritical("CarlaBridgeOsc::handleMessage() - got invalid path"); | |||
return 1; | |||
} | |||
if (! (m_name && m_server && m_serverPath)) | |||
{ | |||
qCritical("CarlaBridgeOsc::handleMessage(\"%s\", ...) - received message but client is offline", path); | |||
return 1; | |||
} | |||
if (strlen(path) <= m_nameSize || strncmp(path+1, m_name, m_nameSize) != 0) | |||
{ | |||
qWarning("CarlaBridgeOsc::handleMessage() - message not for this client: '%s' != '/%s/'", path, m_name); | |||
return 1; | |||
} | |||
char method[32] = { 0 }; | |||
strncpy(method, path + (m_nameSize + 2), 31); | |||
if (method[0] == '\0') | |||
{ | |||
qWarning("CarlaBridgeOsc::handleMessage(\"%s\", ...) - received message without method", path); | |||
return 1; | |||
} | |||
// Common OSC methods | |||
if (strcmp(method, "configure") == 0) | |||
return handleMsgConfigure(argc, argv, types); | |||
if (strcmp(method, "control") == 0) | |||
return handleMsgControl(argc, argv, types); | |||
if (strcmp(method, "program") == 0) | |||
return handleMsgProgram(argc, argv, types); | |||
if (strcmp(method, "midi_program") == 0) | |||
return handleMsgMidiProgram(argc, argv, types); | |||
if (strcmp(method, "midi") == 0) | |||
return handleMsgMidi(argc, argv, types); | |||
if (strcmp(method, "sample-rate") == 0) | |||
return 0; // unused | |||
if (strcmp(method, "show") == 0) | |||
return handleMsgShow(); | |||
if (strcmp(method, "hide") == 0) | |||
return handleMsgHide(); | |||
if (strcmp(method, "quit") == 0) | |||
return handleMsgQuit(); | |||
#ifdef BRIDGE_LV2 | |||
// LV2 UI methods | |||
if (strcmp(method, "lv2_atom_transfer") == 0) | |||
return handleMsgLv2TransferAtom(argc, argv, types); | |||
if (strcmp(method, "lv2_event_transfer") == 0) | |||
return handleMsgLv2TransferEvent(argc, argv, types); | |||
#endif | |||
#ifdef BUILD_BRIDGE_PLUGIN | |||
// Plugin methods | |||
if (strcmp(method, "plugin_save_now") == 0) | |||
return handleMsgPluginSaveNow(); | |||
if (strcmp(method, "plugin_set_chunk") == 0) | |||
return handleMsgPluginSetChunk(argc, argv, types); | |||
if (strcmp(method, "plugin_set_custom_data") == 0) | |||
return handleMsgPluginSetCustomData(argc, argv, types); | |||
#endif | |||
#if 0 | |||
// TODO | |||
else if (strcmp(method, "set_parameter_midi_channel") == 0) | |||
return osc_set_parameter_midi_channel_handler(argv); | |||
else if (strcmp(method, "set_parameter_midi_cc") == 0) | |||
return osc_set_parameter_midi_channel_handler(argv); | |||
#endif | |||
qWarning("CarlaBridgeOsc::handleMessage(\"%s\", ...) - received unsupported OSC method '%s'", path, method); | |||
return 1; | |||
} | |||
int CarlaBridgeOsc::handleMsgConfigure(CARLA_BRIDGE_OSC_HANDLE_ARGS) | |||
{ | |||
qDebug("CarlaBridgeOsc::handleMsgConfigure()"); | |||
CARLA_BRIDGE_OSC_CHECK_OSC_TYPES(2, "ss"); | |||
if (! client) | |||
return 1; | |||
// nothing here for now | |||
return 0; | |||
Q_UNUSED(argv); | |||
} | |||
int CarlaBridgeOsc::handleMsgControl(CARLA_BRIDGE_OSC_HANDLE_ARGS) | |||
{ | |||
qDebug("CarlaBridgeOsc::handleMsgControl()"); | |||
CARLA_BRIDGE_OSC_CHECK_OSC_TYPES(2, "if"); | |||
if (! client) | |||
return 1; | |||
const int32_t index = argv[0]->i; | |||
const float value = argv[1]->f; | |||
client->setParameter(index, value); | |||
return 0; | |||
} | |||
int CarlaBridgeOsc::handleMsgProgram(CARLA_BRIDGE_OSC_HANDLE_ARGS) | |||
{ | |||
qDebug("CarlaBridgeOsc::handleMsgProgram()"); | |||
CARLA_BRIDGE_OSC_CHECK_OSC_TYPES(1, "i"); | |||
if (! client) | |||
return 1; | |||
const int32_t index = argv[0]->i; | |||
client->setProgram(index); | |||
return 0; | |||
} | |||
#ifdef BUILD_BRIDGE_PLUGIN | |||
int CarlaBridgeOsc::handleMsgMidiProgram(CARLA_BRIDGE_OSC_HANDLE_ARGS) | |||
{ | |||
qDebug("CarlaBridgeOsc::handleMsgMidiProgram()"); | |||
CARLA_BRIDGE_OSC_CHECK_OSC_TYPES(1, "i"); | |||
if (! client) | |||
return 1; | |||
const int32_t index = argv[0]->i; | |||
client->setMidiProgram(index); | |||
return 0; | |||
} | |||
#else | |||
int CarlaBridgeOsc::handleMsgMidiProgram(CARLA_BRIDGE_OSC_HANDLE_ARGS) | |||
{ | |||
qDebug("CarlaBridgeOsc::handleMsgMidiProgram()"); | |||
CARLA_BRIDGE_OSC_CHECK_OSC_TYPES(2, "ii"); | |||
if (! client) | |||
return 1; | |||
const int32_t bank = argv[0]->i; | |||
const int32_t program = argv[1]->i; | |||
client->setMidiProgram(bank, program); | |||
return 0; | |||
} | |||
#endif | |||
int CarlaBridgeOsc::handleMsgMidi(CARLA_BRIDGE_OSC_HANDLE_ARGS) | |||
{ | |||
qDebug("CarlaBridgeOsc::handleMsgMidi()"); | |||
CARLA_BRIDGE_OSC_CHECK_OSC_TYPES(1, "m"); | |||
if (! client) | |||
return 1; | |||
const uint8_t* const mdata = argv[0]->m; | |||
const uint8_t data[4] = { mdata[0], mdata[1], mdata[2], mdata[3] }; | |||
uint8_t status = data[1]; | |||
uint8_t channel = status & 0x0F; | |||
// Fix bad note-off | |||
if (MIDI_IS_STATUS_NOTE_ON(status) && data[3] == 0) | |||
status -= 0x10; | |||
if (MIDI_IS_STATUS_NOTE_OFF(status)) | |||
{ | |||
const uint8_t note = data[2]; | |||
client->noteOff(channel, note); | |||
} | |||
else if (MIDI_IS_STATUS_NOTE_ON(status)) | |||
{ | |||
const uint8_t note = data[2]; | |||
const uint8_t velo = data[3]; | |||
client->noteOn(channel, note, velo); | |||
} | |||
return 0; | |||
} | |||
int CarlaBridgeOsc::handleMsgShow() | |||
{ | |||
qDebug("CarlaBridgeOsc::handleMsgShow()"); | |||
if (! client) | |||
return 1; | |||
client->toolkitShow(); | |||
return 0; | |||
} | |||
int CarlaBridgeOsc::handleMsgHide() | |||
{ | |||
qDebug("CarlaBridgeOsc::handleMsgHide()"); | |||
if (! client) | |||
return 1; | |||
client->toolkitHide(); | |||
return 0; | |||
} | |||
int CarlaBridgeOsc::handleMsgQuit() | |||
{ | |||
qDebug("CarlaBridgeOsc::handleMsgQuit()"); | |||
if (! client) | |||
return 1; | |||
client->toolkitQuit(); | |||
return 0; | |||
} | |||
CARLA_BRIDGE_END_NAMESPACE |
@@ -1,137 +0,0 @@ | |||
/* | |||
* Carla Bridge OSC | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_BRIDGE_OSC_HPP | |||
#define CARLA_BRIDGE_OSC_HPP | |||
#include "carla_bridge.hpp" | |||
#include "carla_osc_utils.hpp" | |||
#define CARLA_BRIDGE_OSC_HANDLE_ARGS const int argc, const lo_arg* const* const argv, const char* const types | |||
#define CARLA_BRIDGE_OSC_CHECK_OSC_TYPES(/* argc, types, */ argcToCompare, typesToCompare) \ | |||
/* check argument count */ \ | |||
if (argc != argcToCompare) \ | |||
{ \ | |||
qCritical("CarlaBridgeOsc::%s() - argument count mismatch: %i != %i", __FUNCTION__, argc, argcToCompare); \ | |||
return 1; \ | |||
} \ | |||
if (argc > 0) \ | |||
{ \ | |||
/* check for nullness */ \ | |||
if (! (types && typesToCompare)) \ | |||
{ \ | |||
qCritical("CarlaBridgeOsc::%s() - argument types are null", __FUNCTION__); \ | |||
return 1; \ | |||
} \ | |||
/* check argument types */ \ | |||
if (strcmp(types, typesToCompare) != 0) \ | |||
{ \ | |||
qCritical("CarlaBridgeOsc::%s() - argument types mismatch: '%s' != '%s'", __FUNCTION__, types, typesToCompare); \ | |||
return 1; \ | |||
} \ | |||
} | |||
CARLA_BRIDGE_START_NAMESPACE | |||
#if 0 | |||
} // Fix editor indentation | |||
#endif | |||
class CarlaBridgeOsc | |||
{ | |||
public: | |||
CarlaBridgeOsc(CarlaBridgeClient* const client); | |||
~CarlaBridgeOsc(); | |||
bool init(const char* const url); | |||
void idle(); | |||
void close(); | |||
// ------------------------------------------------------------------- | |||
bool isControlRegistered() const | |||
{ | |||
return bool(m_controlData.target); | |||
} | |||
const CarlaOscData* getControlData() const | |||
{ | |||
return &m_controlData; | |||
} | |||
const char* getServerPath() const | |||
{ | |||
return m_serverPath; | |||
} | |||
// ------------------------------------------------------------------- | |||
private: | |||
CarlaBridgeClient* const client; | |||
char* m_name; | |||
size_t m_nameSize; | |||
lo_server m_server; | |||
char* m_serverPath; | |||
CarlaOscData m_controlData; | |||
// ------------------------------------------------------------------- | |||
int handleMessage(const char* const path, const int argc, const lo_arg* const* const argv, const char* const types, const lo_message msg); | |||
int handleMsgConfigure(CARLA_BRIDGE_OSC_HANDLE_ARGS); | |||
int handleMsgControl(CARLA_BRIDGE_OSC_HANDLE_ARGS); | |||
int handleMsgProgram(CARLA_BRIDGE_OSC_HANDLE_ARGS); | |||
int handleMsgMidiProgram(CARLA_BRIDGE_OSC_HANDLE_ARGS); | |||
int handleMsgMidi(CARLA_BRIDGE_OSC_HANDLE_ARGS); | |||
int handleMsgShow(); | |||
int handleMsgHide(); | |||
int handleMsgQuit(); | |||
#ifdef BRIDGE_LV2 | |||
int handleMsgLv2TransferAtom(CARLA_BRIDGE_OSC_HANDLE_ARGS); | |||
int handleMsgLv2TransferEvent(CARLA_BRIDGE_OSC_HANDLE_ARGS); | |||
#endif | |||
#ifdef BUILD_BRIDGE_PLUGIN | |||
int handleMsgPluginSaveNow(); | |||
int handleMsgPluginSetChunk(CARLA_BRIDGE_OSC_HANDLE_ARGS); | |||
int handleMsgPluginSetCustomData(CARLA_BRIDGE_OSC_HANDLE_ARGS); | |||
#endif | |||
// ------------------------------------------------------------------- | |||
static void osc_error_handler(const int num, const char* const msg, const char* const path) | |||
{ | |||
qWarning("CarlaBridgeOsc::osc_error_handler(%i, \"%s\", \"%s\")", num, msg, path); | |||
} | |||
static int osc_message_handler(const char* const path, const char* const types, lo_arg** const argv, const int argc, const lo_message msg, void* const user_data) | |||
{ | |||
CARLA_ASSERT(user_data); | |||
if (CarlaBridgeOsc* const _this_ = (CarlaBridgeOsc*)user_data) | |||
return _this_->handleMessage(path, argc, argv, types, msg); | |||
return 1; | |||
} | |||
}; | |||
CARLA_BRIDGE_END_NAMESPACE | |||
#endif // CARLA_BRIDGE_OSC_HPP |
@@ -1,245 +0,0 @@ | |||
/* | |||
* Carla UI bridge code | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#include "carla_bridge_client.hpp" | |||
#include "carla_bridge_toolkit.hpp" | |||
#if defined(BRIDGE_COCOA) || defined(BRIDGE_HWND) || defined(BRIDGE_X11) | |||
# error Embed UI uses Qt | |||
#endif | |||
#include <gtk/gtk.h> | |||
#include <QtCore/QSettings> | |||
CARLA_BRIDGE_START_NAMESPACE | |||
// ------------------------------------------------------------------------- | |||
#if defined(BRIDGE_GTK2) | |||
static const char* const appName = "Carla-Gtk2UIs"; | |||
#elif defined(BRIDGE_GTK3) | |||
static const char* const appName = "Carla-Gtk3UIs"; | |||
#else | |||
static const char* const appName = "Carla-UIs"; | |||
#endif | |||
static int gargc = 0; | |||
static char** gargv = {}; | |||
// ------------------------------------------------------------------------- | |||
class CarlaToolkitGtk : public CarlaBridgeToolkit | |||
{ | |||
public: | |||
CarlaToolkitGtk(CarlaBridgeClient* const client, const char* const uiTitle) | |||
: CarlaBridgeToolkit(client, uiTitle), | |||
settings("Cadence", appName) | |||
{ | |||
qDebug("CarlaToolkitGtk::CarlaToolkitGtk(%p, \"%s\")", client, uiTitle); | |||
window = nullptr; | |||
lastX = 0; | |||
lastY = 0; | |||
lastWidth = 0; | |||
lastHeight = 0; | |||
} | |||
~CarlaToolkitGtk() | |||
{ | |||
qDebug("CarlaToolkitGtk::~CarlaToolkitGtk()"); | |||
if (window) | |||
gtk_widget_destroy(window); | |||
} | |||
void init() | |||
{ | |||
qDebug("CarlaToolkitGtk::init()"); | |||
CARLA_ASSERT(! window); | |||
gtk_init(&gargc, &gargv); | |||
window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |||
gtk_window_resize(GTK_WINDOW(window), 30, 30); | |||
gtk_widget_hide(window); | |||
} | |||
void exec(const bool showGui) | |||
{ | |||
qDebug("CarlaToolkitGtk::exec(%s)", bool2str(showGui)); | |||
CARLA_ASSERT(window); | |||
CARLA_ASSERT(client); | |||
GtkWidget* const widget = (GtkWidget*)client->getWidget(); | |||
gtk_container_add(GTK_CONTAINER(window), widget); | |||
gtk_window_set_resizable(GTK_WINDOW(window), client->isResizable()); | |||
gtk_window_set_title(GTK_WINDOW(window), uiTitle); | |||
if (settings.contains(QString("%1/pos_x").arg(uiTitle))) | |||
{ | |||
gtk_window_get_position(GTK_WINDOW(window), &lastX, &lastY); | |||
bool hasX, hasY; | |||
lastX = settings.value(QString("%1/pos_x").arg(uiTitle), lastX).toInt(&hasX); | |||
lastY = settings.value(QString("%1/pos_y").arg(uiTitle), lastY).toInt(&hasY); | |||
if (hasX && hasY) | |||
gtk_window_move(GTK_WINDOW(window), lastX, lastY); | |||
if (client->isResizable()) | |||
{ | |||
gtk_window_get_size(GTK_WINDOW(window), &lastWidth, &lastHeight); | |||
bool hasWidth, hasHeight; | |||
lastWidth = settings.value(QString("%1/width").arg(uiTitle), lastWidth).toInt(&hasWidth); | |||
lastHeight = settings.value(QString("%1/height").arg(uiTitle), lastHeight).toInt(&hasHeight); | |||
if (hasWidth && hasHeight) | |||
gtk_window_resize(GTK_WINDOW(window), lastWidth, lastHeight); | |||
} | |||
} | |||
if (showGui) | |||
show(); | |||
else | |||
client->sendOscUpdate(); | |||
// Timer | |||
g_timeout_add(50, gtk_ui_timeout, this); | |||
g_signal_connect(window, "destroy", G_CALLBACK(gtk_ui_destroy), this); | |||
// First idle | |||
handleTimeout(); | |||
// Main loop | |||
gtk_main(); | |||
} | |||
void quit() | |||
{ | |||
qDebug("CarlaToolkitGtk::quit()"); | |||
if (window) | |||
{ | |||
gtk_widget_destroy(window); | |||
gtk_main_quit(); | |||
window = nullptr; | |||
} | |||
} | |||
void show() | |||
{ | |||
qDebug("CarlaToolkitGtk::show()"); | |||
CARLA_ASSERT(window); | |||
if (window) | |||
gtk_widget_show_all(window); | |||
} | |||
void hide() | |||
{ | |||
qDebug("CarlaToolkitGtk::hide()"); | |||
CARLA_ASSERT(window); | |||
if (window) | |||
{ | |||
#ifdef BRIDGE_GTK2 | |||
gtk_widget_hide_all(window); | |||
#else | |||
gtk_widget_hide(window); | |||
#endif | |||
} | |||
} | |||
void resize(int width, int height) | |||
{ | |||
qDebug("CarlaToolkitGtk::resize(%i, %i)", width, height); | |||
CARLA_ASSERT(window); | |||
if (window) | |||
gtk_window_resize(GTK_WINDOW(window), width, height); | |||
} | |||
// --------------------------------------------------------------------- | |||
protected: | |||
GtkWidget* window; | |||
QSettings settings; | |||
gint lastX, lastY, lastWidth, lastHeight; | |||
void handleDestroy() | |||
{ | |||
qDebug("CarlaToolkitGtk::handleDestroy()"); | |||
window = nullptr; | |||
settings.setValue(QString("%1/pos_x").arg(uiTitle), lastX); | |||
settings.setValue(QString("%1/pos_y").arg(uiTitle), lastY); | |||
settings.setValue(QString("%1/width").arg(uiTitle), lastWidth); | |||
settings.setValue(QString("%1/height").arg(uiTitle), lastHeight); | |||
settings.sync(); | |||
} | |||
gboolean handleTimeout() | |||
{ | |||
if (window) | |||
{ | |||
gtk_window_get_position(GTK_WINDOW(window), &lastX, &lastY); | |||
gtk_window_get_size(GTK_WINDOW(window), &lastWidth, &lastHeight); | |||
} | |||
// FIXME? | |||
return client->isOscControlRegistered() ? client->oscIdle() : false; | |||
} | |||
// --------------------------------------------------------------------- | |||
private: | |||
static void gtk_ui_destroy(GtkWidget*, gpointer data) | |||
{ | |||
CARLA_ASSERT(data); | |||
if (CarlaToolkitGtk* const _this_ = (CarlaToolkitGtk*)data) | |||
_this_->handleDestroy(); | |||
gtk_main_quit(); | |||
} | |||
static gboolean gtk_ui_timeout(gpointer data) | |||
{ | |||
CARLA_ASSERT(data); | |||
if (CarlaToolkitGtk* const _this_ = (CarlaToolkitGtk*)data) | |||
return _this_->handleTimeout(); | |||
return false; | |||
} | |||
}; | |||
// ------------------------------------------------------------------------- | |||
CarlaBridgeToolkit* CarlaBridgeToolkit::createNew(CarlaBridgeClient* const client, const char* const uiTitle) | |||
{ | |||
return new CarlaToolkitGtk(client, uiTitle); | |||
} | |||
CARLA_BRIDGE_END_NAMESPACE |
@@ -1,334 +0,0 @@ | |||
/* | |||
* Carla Bridge Toolkit, Qt version | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#include "carla_bridge_client.hpp" | |||
#include "carla_bridge_toolkit.hpp" | |||
#include <QtCore/QSettings> | |||
#include <QtCore/QThread> | |||
#include <QtCore/QTimerEvent> | |||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) | |||
# include <QtWidgets/QApplication> | |||
# include <QtWidgets/QMainWindow> | |||
# ifdef Q_WS_X11 | |||
# undef Q_WS_X11 | |||
# endif | |||
#else | |||
# include <QtGui/QApplication> | |||
# include <QtGui/QMainWindow> | |||
# ifdef Q_WS_X11 | |||
# include <QtGui/QX11EmbedContainer> | |||
# endif | |||
#endif | |||
#if defined(BRIDGE_COCOA) || defined(BRIDGE_HWND) || defined(BRIDGE_X11) | |||
# define BRIDGE_CONTAINER | |||
# ifdef Q_WS_X11 | |||
typedef QX11EmbedContainer QEmbedContainer; | |||
# else | |||
typedef QWidget QEmbedContainer; | |||
# endif | |||
#endif | |||
CARLA_BRIDGE_START_NAMESPACE | |||
// ------------------------------------------------------------------------- | |||
#if defined(BRIDGE_QT4) | |||
static const char* const appName = "Carla-Qt4UIs"; | |||
#elif defined(BRIDGE_QT5) | |||
static const char* const appName = "Carla-Qt5UIs"; | |||
#elif defined(BRIDGE_COCOA) | |||
static const char* const appName = "Carla-CocoaUIs"; | |||
#elif defined(BRIDGE_HWND) | |||
static const char* const appName = "Carla-HWNDUIs"; | |||
#elif defined(BRIDGE_X11) | |||
static const char* const appName = "Carla-X11UIs"; | |||
#else | |||
static const char* const appName = "Carla-UIs"; | |||
#endif | |||
static int qargc = 0; | |||
static char* qargv[0] = {}; | |||
// ------------------------------------------------------------------------- | |||
class CarlaBridgeToolkitQt: public CarlaBridgeToolkit, | |||
public QObject | |||
{ | |||
public: | |||
CarlaBridgeToolkitQt(CarlaBridgeClient* const client, const char* const uiTitle) | |||
: CarlaBridgeToolkit(client, uiTitle), | |||
QObject(nullptr), | |||
settings("Cadence", appName) | |||
{ | |||
qDebug("CarlaBridgeToolkitQt::CarlaBridgeToolkitQt(%p, \"%s\")", client, uiTitle); | |||
app = nullptr; | |||
window = nullptr; | |||
msgTimer = 0; | |||
needsResize = false; | |||
nextWidth = 0; | |||
nextHeight = 0; | |||
#ifdef BRIDGE_CONTAINER | |||
embedContainer = nullptr; | |||
#endif | |||
} | |||
~CarlaBridgeToolkitQt() | |||
{ | |||
qDebug("CarlaBridgeToolkitQt::~CarlaBridgeToolkitQt()"); | |||
CARLA_ASSERT(! app); | |||
CARLA_ASSERT(! window); | |||
CARLA_ASSERT(! msgTimer); | |||
} | |||
void init() | |||
{ | |||
qDebug("CarlaBridgeToolkitQt::init()"); | |||
CARLA_ASSERT(! app); | |||
CARLA_ASSERT(! window); | |||
CARLA_ASSERT(! msgTimer); | |||
app = new QApplication(qargc, qargv); | |||
window = new QMainWindow(nullptr); | |||
window->resize(30, 30); | |||
window->hide(); | |||
} | |||
void exec(const bool showGui) | |||
{ | |||
qDebug("CarlaBridgeToolkitQt::exec(%s)", bool2str(showGui)); | |||
CARLA_ASSERT(app); | |||
CARLA_ASSERT(window); | |||
CARLA_ASSERT(client); | |||
#if defined(BRIDGE_QT4) || defined(BRIDGE_QT5) | |||
QWidget* const widget = (QWidget*)client->getWidget(); | |||
window->setCentralWidget(widget); | |||
window->adjustSize(); | |||
widget->setParent(window); | |||
widget->show(); | |||
#endif | |||
if (! client->isResizable()) | |||
{ | |||
window->setFixedSize(window->width(), window->height()); | |||
#ifdef Q_OS_WIN | |||
window->setWindowFlags(window->windowFlags() | Qt::MSWindowsFixedSizeDialogHint); | |||
#endif | |||
} | |||
window->setWindowTitle(uiTitle); | |||
if (settings.contains(QString("%1/pos_x").arg(uiTitle))) | |||
{ | |||
bool hasX, hasY; | |||
int posX = settings.value(QString("%1/pos_x").arg(uiTitle), window->x()).toInt(&hasX); | |||
int posY = settings.value(QString("%1/pos_y").arg(uiTitle), window->y()).toInt(&hasY); | |||
if (hasX && hasY) | |||
window->move(posX, posY); | |||
if (client->isResizable()) | |||
{ | |||
bool hasWidth, hasHeight; | |||
int width = settings.value(QString("%1/width").arg(uiTitle), window->width()).toInt(&hasWidth); | |||
int height = settings.value(QString("%1/height").arg(uiTitle), window->height()).toInt(&hasHeight); | |||
if (hasWidth && hasHeight) | |||
window->resize(width, height); | |||
} | |||
} | |||
if (showGui) | |||
show(); | |||
else | |||
client->sendOscUpdate(); | |||
// Timer | |||
msgTimer = startTimer(50); | |||
// First idle | |||
handleTimeout(); | |||
// Main loop | |||
app->exec(); | |||
} | |||
void quit() | |||
{ | |||
qDebug("CarlaBridgeToolkitQt::quit()"); | |||
CARLA_ASSERT(app); | |||
if (msgTimer != 0) | |||
{ | |||
killTimer(msgTimer); | |||
msgTimer = 0; | |||
} | |||
if (window) | |||
{ | |||
settings.setValue(QString("%1/pos_x").arg(uiTitle), window->x()); | |||
settings.setValue(QString("%1/pos_y").arg(uiTitle), window->y()); | |||
settings.setValue(QString("%1/width").arg(uiTitle), window->width()); | |||
settings.setValue(QString("%1/height").arg(uiTitle), window->height()); | |||
settings.sync(); | |||
window->close(); | |||
delete window; | |||
window = nullptr; | |||
} | |||
#ifdef BRIDGE_CONTAINER | |||
if (embedContainer) | |||
{ | |||
embedContainer->close(); | |||
delete embedContainer; | |||
embedContainer = nullptr; | |||
} | |||
#endif | |||
if (app) | |||
{ | |||
if (! app->closingDown()) | |||
app->quit(); | |||
delete app; | |||
app = nullptr; | |||
} | |||
} | |||
void show() | |||
{ | |||
qDebug("CarlaBridgeToolkitQt::show()"); | |||
CARLA_ASSERT(window); | |||
if (window) | |||
window->show(); | |||
} | |||
void hide() | |||
{ | |||
qDebug("CarlaBridgeToolkitQt::hide()"); | |||
CARLA_ASSERT(window); | |||
if (window) | |||
window->hide(); | |||
} | |||
void resize(const int width, const int height) | |||
{ | |||
qDebug("CarlaBridgeToolkitQt::resize(%i, %i)", width, height); | |||
CARLA_ASSERT(window); | |||
if (app->thread() != QThread::currentThread()) | |||
{ | |||
nextWidth = width; | |||
nextHeight = height; | |||
needsResize = true; | |||
return; | |||
} | |||
if (window) | |||
window->setFixedSize(width, height); | |||
#ifdef BRIDGE_CONTAINER | |||
if (embedContainer) | |||
embedContainer->setFixedSize(width, height); | |||
#endif | |||
} | |||
#ifdef BRIDGE_CONTAINER | |||
void* getContainerId() | |||
{ | |||
qDebug("CarlaBridgeToolkitQt::getContainerId()"); | |||
CARLA_ASSERT(window); | |||
if (! embedContainer) | |||
{ | |||
embedContainer = new QEmbedContainer(window); | |||
window->setCentralWidget(embedContainer); | |||
window->adjustSize(); | |||
embedContainer->setParent(window); | |||
embedContainer->show(); | |||
} | |||
return (void*)embedContainer->winId(); | |||
} | |||
#endif | |||
protected: | |||
QApplication* app; | |||
QMainWindow* window; | |||
QSettings settings; | |||
int msgTimer; | |||
bool needsResize; | |||
int nextWidth, nextHeight; | |||
#ifdef BRIDGE_CONTAINER | |||
QEmbedContainer* embedContainer; | |||
#endif | |||
void handleTimeout() | |||
{ | |||
if (! client) | |||
return; | |||
if (needsResize) | |||
{ | |||
client->toolkitResize(nextWidth, nextHeight); | |||
needsResize = false; | |||
} | |||
if (client->isOscControlRegistered() && ! client->oscIdle()) | |||
{ | |||
killTimer(msgTimer); | |||
msgTimer = 0; | |||
} | |||
} | |||
private: | |||
void timerEvent(QTimerEvent* const event) | |||
{ | |||
if (event->timerId() == msgTimer) | |||
handleTimeout(); | |||
QObject::timerEvent(event); | |||
} | |||
}; | |||
// ------------------------------------------------------------------------- | |||
CarlaBridgeToolkit* CarlaBridgeToolkit::createNew(CarlaBridgeClient* const client, const char* const uiTitle) | |||
{ | |||
return new CarlaBridgeToolkitQt(client, uiTitle); | |||
} | |||
CARLA_BRIDGE_END_NAMESPACE |
@@ -1,49 +0,0 @@ | |||
/* | |||
* Carla Bridge Toolkit | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#include "carla_bridge_toolkit.hpp" | |||
#include "carla_utils.hpp" | |||
#include <cstdlib> | |||
#include <cstring> | |||
CARLA_BRIDGE_START_NAMESPACE | |||
CarlaBridgeToolkit::CarlaBridgeToolkit(CarlaBridgeClient* const client_, const char* const newTitle) | |||
: client(client_) | |||
{ | |||
qDebug("CarlaBridgeToolkit::CarlaBridgeToolkit(%p, \"%s\")", client, newTitle); | |||
CARLA_ASSERT(client); | |||
CARLA_ASSERT(newTitle); | |||
uiTitle = strdup(newTitle ? newTitle : "(null)"); | |||
} | |||
CarlaBridgeToolkit::~CarlaBridgeToolkit() | |||
{ | |||
qDebug("CarlaBridgeToolkit::~CarlaBridgeToolkit()"); | |||
free(uiTitle); | |||
} | |||
void* CarlaBridgeToolkit::getContainerId() | |||
{ | |||
qDebug("CarlaBridgeToolkit::getContainerId()"); | |||
return nullptr; | |||
} | |||
CARLA_BRIDGE_END_NAMESPACE |
@@ -1,63 +0,0 @@ | |||
/* | |||
* Carla Bridge Toolkit | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_BRIDGE_TOOLKIT_HPP | |||
#define CARLA_BRIDGE_TOOLKIT_HPP | |||
#include "carla_bridge.hpp" | |||
CARLA_BRIDGE_START_NAMESPACE | |||
#if 0 | |||
} // Fix editor indentation | |||
#endif | |||
/*! | |||
* @defgroup CarlaBridgeToolkit Carla Bridge Toolkit | |||
* | |||
* The Carla Bridge Toolkit. | |||
* @{ | |||
*/ | |||
class CarlaBridgeToolkit | |||
{ | |||
public: | |||
CarlaBridgeToolkit(CarlaBridgeClient* const client, const char* const uiTitle); | |||
virtual ~CarlaBridgeToolkit(); | |||
virtual void init() = 0; | |||
virtual void exec(const bool showGui) = 0; | |||
virtual void quit() = 0; | |||
virtual void show() = 0; | |||
virtual void hide() = 0; | |||
virtual void resize(const int width, const int height) = 0; | |||
virtual void* getContainerId(); | |||
static CarlaBridgeToolkit* createNew(CarlaBridgeClient* const client, const char* const uiTitle); | |||
protected: | |||
CarlaBridgeClient* const client; | |||
char* uiTitle; | |||
}; | |||
/**@}*/ | |||
CARLA_BRIDGE_END_NAMESPACE | |||
#endif // CARLA_BRIDGE_TOOLKIT_HPP |
@@ -1,595 +0,0 @@ | |||
/* | |||
* Carla Bridge UI, VST version | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifdef BRIDGE_VST | |||
#include "carla_bridge_client.hpp" | |||
#include "carla_bridge_toolkit.hpp" | |||
#include "carla_vst_utils.hpp" | |||
#include "carla_midi.h" | |||
#include <QtCore/QObject> | |||
#include <QtCore/QTimerEvent> | |||
#if defined(Q_WS_X11) && (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) | |||
# include <QtGui/QX11Info> | |||
#endif | |||
CARLA_BRIDGE_START_NAMESPACE | |||
// ------------------------------------------------------------------------- | |||
// fake values | |||
uint32_t bufferSize = 512; | |||
double sampleRate = 44100.0; | |||
class CarlaVstClient : public CarlaBridgeClient, | |||
public QObject | |||
{ | |||
public: | |||
CarlaVstClient(const char* const uiTitle) | |||
: CarlaBridgeClient(uiTitle), | |||
QObject(nullptr) | |||
{ | |||
effect = nullptr; | |||
idleTimer = 0; | |||
needIdle = false; | |||
// make client valid | |||
srand(uiTitle[0]); | |||
unique1 = unique2 = rand(); | |||
} | |||
~CarlaVstClient() | |||
{ | |||
// make client invalid | |||
unique2 += 1; | |||
} | |||
// --------------------------------------------------------------------- | |||
// ui initialization | |||
bool init(const char* binary, const char*) | |||
{ | |||
// ----------------------------------------------------------------- | |||
// init | |||
CarlaBridgeClient::init(binary, nullptr); | |||
// ----------------------------------------------------------------- | |||
// open DLL | |||
if (! uiLibOpen(binary)) | |||
{ | |||
qWarning("%s", uiLibError()); | |||
return false; | |||
} | |||
// ----------------------------------------------------------------- | |||
// get DLL main entry | |||
VST_Function vstFn = (VST_Function)uiLibSymbol("VSTPluginMain"); | |||
if (! vstFn) | |||
vstFn = (VST_Function)uiLibSymbol("main"); | |||
if (! vstFn) | |||
return false; | |||
// ----------------------------------------------------------------- | |||
// initialize plugin | |||
lastVstPlugin = this; | |||
effect = vstFn(hostCallback); | |||
lastVstPlugin = nullptr; | |||
if (! (effect && effect->magic == kEffectMagic)) | |||
return false; | |||
// ----------------------------------------------------------------- | |||
// initialize VST stuff | |||
#ifdef VESTIGE_HEADER | |||
effect->ptr1 = this; | |||
#else | |||
effect->resvd1 = ToVstPtr(this); | |||
#endif | |||
int32_t value = 0; | |||
#if defined(Q_WS_X11) && (QT_VERSION < QT_VERSION_CHECK(5, 0, 0)) | |||
value = (int64_t)QX11Info::display(); | |||
#endif | |||
effect->dispatcher(effect, effOpen, 0, 0, nullptr, 0.0f); | |||
effect->dispatcher(effect, effMainsChanged, 0, 0, nullptr, 0.0f); | |||
#if ! VST_FORCE_DEPRECATED | |||
effect->dispatcher(effect, effSetBlockSizeAndSampleRate, 0, bufferSize, nullptr, sampleRate); | |||
#endif | |||
effect->dispatcher(effect, effSetSampleRate, 0, 0, nullptr, sampleRate); | |||
effect->dispatcher(effect, effSetBlockSize, 0, bufferSize, nullptr, 0.0f); | |||
effect->dispatcher(effect, effSetProcessPrecision, 0, kVstProcessPrecision32, nullptr, 0.0f); | |||
if (effect->dispatcher(effect, effEditOpen, 0, value, getContainerId(), 0.0f) != 1) | |||
{ | |||
//effect->dispatcher(effect, effClose, 0, 0, nullptr, 0.0f); | |||
//return false; | |||
qWarning("VST UI failed to open, trying to init anyway..."); | |||
} | |||
// ----------------------------------------------------------------- | |||
// initialize gui stuff | |||
ERect* vstRect = nullptr; | |||
effect->dispatcher(effect, effEditGetRect, 0, 0, &vstRect, 0.0f); | |||
if (vstRect) | |||
{ | |||
int width = vstRect->right - vstRect->left; | |||
int height = vstRect->bottom - vstRect->top; | |||
if (width > 0 && height > 0) | |||
toolkitResize(width, height); | |||
} | |||
idleTimer = startTimer(50); | |||
return true; | |||
} | |||
void close() | |||
{ | |||
CarlaBridgeClient::close(); | |||
if (effect) | |||
{ | |||
effect->dispatcher(effect, effEditClose, 0, 0, nullptr, 0.0f); | |||
effect->dispatcher(effect, effClose, 0, 0, nullptr, 0.0f); | |||
} | |||
} | |||
// --------------------------------------------------------------------- | |||
// ui management | |||
void* getWidget() const | |||
{ | |||
return nullptr; // VST always uses reparent | |||
} | |||
bool isResizable() const | |||
{ | |||
return false; | |||
} | |||
bool needsReparent() const | |||
{ | |||
return true; | |||
} | |||
// --------------------------------------------------------------------- | |||
// processing | |||
void setParameter(const int32_t rindex, const double value) | |||
{ | |||
if (effect) | |||
effect->setParameter(effect, rindex, value); | |||
} | |||
void setProgram(const uint32_t index) | |||
{ | |||
if (effect) | |||
effect->dispatcher(effect, effSetProgram, 0, index, nullptr, 0.0f); | |||
} | |||
void setMidiProgram(const uint32_t, const uint32_t) | |||
{ | |||
} | |||
void noteOn(const uint8_t, const uint8_t, const uint8_t) | |||
{ | |||
} | |||
void noteOff(const uint8_t, const uint8_t) | |||
{ | |||
} | |||
// --------------------------------------------------------------------- | |||
void handleAudioMasterAutomate(const uint32_t index, const float value) | |||
{ | |||
effect->setParameter(effect, index, value); | |||
if (isOscControlRegistered()) | |||
sendOscControl(index, value); | |||
} | |||
intptr_t handleAudioMasterGetCurrentProcessLevel() | |||
{ | |||
return kVstProcessLevelUser; | |||
} | |||
intptr_t handleAudioMasterGetBlockSize() | |||
{ | |||
return bufferSize; | |||
} | |||
intptr_t handleAudioMasterGetSampleRate() | |||
{ | |||
return sampleRate; | |||
} | |||
intptr_t handleAudioMasterGetTime() | |||
{ | |||
memset(&vstTimeInfo, 0, sizeof(VstTimeInfo_R)); | |||
vstTimeInfo.sampleRate = sampleRate; | |||
// Tempo | |||
vstTimeInfo.tempo = 120.0; | |||
vstTimeInfo.flags |= kVstTempoValid; | |||
// Time Signature | |||
vstTimeInfo.timeSigNumerator = 4; | |||
vstTimeInfo.timeSigDenominator = 4; | |||
vstTimeInfo.flags |= kVstTimeSigValid; | |||
return (intptr_t)&vstTimeInfo; | |||
} | |||
void handleAudioMasterNeedIdle() | |||
{ | |||
needIdle = true; | |||
} | |||
intptr_t handleAudioMasterProcessEvents(const VstEvents* const vstEvents) | |||
{ | |||
if (isOscControlRegistered()) | |||
return 1; | |||
for (int32_t i=0; i < vstEvents->numEvents; i++) | |||
{ | |||
if (! vstEvents->events[i]) | |||
break; | |||
const VstMidiEvent* const vstMidiEvent = (const VstMidiEvent*)vstEvents->events[i]; | |||
if (vstMidiEvent->type != kVstMidiType) | |||
{ | |||
uint8_t status = vstMidiEvent->midiData[0]; | |||
// Fix bad note-off | |||
if (MIDI_IS_STATUS_NOTE_ON(status) && vstMidiEvent->midiData[2] == 0) | |||
status -= 0x10; | |||
uint8_t midiBuf[4] = { 0, status, (uint8_t)vstMidiEvent->midiData[1], (uint8_t)vstMidiEvent->midiData[2] }; | |||
sendOscMidi(midiBuf); | |||
} | |||
} | |||
return 1; | |||
} | |||
intptr_t handleAdioMasterSizeWindow(int32_t width, int32_t height) | |||
{ | |||
toolkitResize(width, height); | |||
return 1; | |||
} | |||
void handleAudioMasterUpdateDisplay() | |||
{ | |||
if (isOscControlRegistered()) | |||
sendOscConfigure("reloadprograms", ""); | |||
} | |||
// --------------------------------------------------------------------- | |||
static intptr_t hostCanDo(const char* const feature) | |||
{ | |||
qDebug("CarlaVstClient::hostCanDo(\"%s\")", feature); | |||
if (strcmp(feature, "supplyIdle") == 0) | |||
return 1; | |||
if (strcmp(feature, "sendVstEvents") == 0) | |||
return 1; | |||
if (strcmp(feature, "sendVstMidiEvent") == 0) | |||
return 1; | |||
if (strcmp(feature, "sendVstMidiEventFlagIsRealtime") == 0) | |||
return -1; | |||
if (strcmp(feature, "sendVstTimeInfo") == 0) | |||
return 1; | |||
if (strcmp(feature, "receiveVstEvents") == 0) | |||
return 1; | |||
if (strcmp(feature, "receiveVstMidiEvent") == 0) | |||
return 1; | |||
if (strcmp(feature, "receiveVstTimeInfo") == 0) | |||
return -1; | |||
if (strcmp(feature, "reportConnectionChanges") == 0) | |||
return -1; | |||
if (strcmp(feature, "acceptIOChanges") == 0) | |||
return 1; | |||
if (strcmp(feature, "sizeWindow") == 0) | |||
return 1; | |||
if (strcmp(feature, "offline") == 0) | |||
return -1; | |||
if (strcmp(feature, "openFileSelector") == 0) | |||
return -1; | |||
if (strcmp(feature, "closeFileSelector") == 0) | |||
return -1; | |||
if (strcmp(feature, "startStopProcess") == 0) | |||
return 1; | |||
if (strcmp(feature, "supportShell") == 0) | |||
return -1; | |||
if (strcmp(feature, "shellCategory") == 0) | |||
return -1; | |||
// unimplemented | |||
qWarning("CarlaVstClient::hostCanDo(\"%s\") - unknown feature", feature); | |||
return 0; | |||
} | |||
static intptr_t VSTCALLBACK hostCallback(AEffect* const effect, const int32_t opcode, const int32_t index, const intptr_t value, void* const ptr, const float opt) | |||
{ | |||
#if DEBUG | |||
qDebug("CarlaVstClient::hostCallback(%p, %s, %i, " P_INTPTR ", %p, %f", effect, vstMasterOpcode2str(opcode), index, value, ptr, opt); | |||
#endif | |||
// Check if 'resvd1' points to this client, or register ourselfs if possible | |||
CarlaVstClient* self = nullptr; | |||
if (effect) | |||
{ | |||
#ifdef VESTIGE_HEADER | |||
if (effect && effect->ptr1) | |||
{ | |||
self = (CarlaVstClient*)effect->ptr1; | |||
#else | |||
if (effect && effect->resvd1) | |||
{ | |||
self = FromVstPtr<CarlaVstClient>(effect->resvd1); | |||
#endif | |||
if (self->unique1 != self->unique2) | |||
self = nullptr; | |||
} | |||
if (self) | |||
{ | |||
if (! self->effect) | |||
self->effect = effect; | |||
CARLA_ASSERT(self->effect == effect); | |||
if (self->effect != effect) | |||
{ | |||
qWarning("CarlaVstClient::hostCallback() - host pointer mismatch: %p != %p", self->effect, effect); | |||
self = nullptr; | |||
} | |||
} | |||
else if (lastVstPlugin) | |||
{ | |||
#ifdef VESTIGE_HEADER | |||
effect->ptr1 = lastVstPlugin; | |||
#else | |||
effect->resvd1 = ToVstPtr(lastVstPlugin); | |||
#endif | |||
self = lastVstPlugin; | |||
} | |||
} | |||
intptr_t ret = 0; | |||
switch (opcode) | |||
{ | |||
case audioMasterAutomate: | |||
if (self) | |||
self->handleAudioMasterAutomate(index, opt); | |||
break; | |||
case audioMasterVersion: | |||
ret = kVstVersion; | |||
break; | |||
case audioMasterCurrentId: | |||
// TODO | |||
break; | |||
case audioMasterIdle: | |||
//if (effect) | |||
// effect->dispatcher(effect, effEditIdle, 0, 0, nullptr, 0.0f); | |||
break; | |||
case audioMasterGetTime: | |||
static VstTimeInfo_R timeInfo; | |||
memset(&timeInfo, 0, sizeof(VstTimeInfo_R)); | |||
timeInfo.sampleRate = sampleRate; | |||
// Tempo | |||
timeInfo.tempo = 120.0; | |||
timeInfo.flags |= kVstTempoValid; | |||
// Time Signature | |||
timeInfo.timeSigNumerator = 4; | |||
timeInfo.timeSigDenominator = 4; | |||
timeInfo.flags |= kVstTimeSigValid; | |||
ret = (intptr_t)&timeInfo; | |||
break; | |||
case audioMasterProcessEvents: | |||
if (self && ptr) | |||
ret = self->handleAudioMasterProcessEvents((const VstEvents*)ptr); | |||
break; | |||
#if ! VST_FORCE_DEPRECATED | |||
case audioMasterTempoAt: | |||
// Deprecated in VST SDK 2.4 | |||
ret = 120 * 10000; | |||
break; | |||
#endif | |||
case audioMasterSizeWindow: | |||
if (self && index > 0 && value > 0) | |||
ret = self->handleAdioMasterSizeWindow(index, value); | |||
break; | |||
case audioMasterGetSampleRate: | |||
ret = sampleRate; | |||
break; | |||
case audioMasterGetBlockSize: | |||
ret = bufferSize; | |||
break; | |||
case audioMasterGetCurrentProcessLevel: | |||
ret = kVstProcessLevelUser; | |||
break; | |||
case audioMasterGetAutomationState: | |||
ret = kVstAutomationReadWrite; | |||
break; | |||
case audioMasterGetVendorString: | |||
if (ptr) | |||
strcpy((char*)ptr, "Cadence"); | |||
break; | |||
case audioMasterGetProductString: | |||
if (ptr) | |||
strcpy((char*)ptr, "Carla-Bridge"); | |||
break; | |||
case audioMasterGetVendorVersion: | |||
ret = 0x050; // 0.5.0 | |||
break; | |||
case audioMasterCanDo: | |||
if (ptr) | |||
ret = hostCanDo((const char*)ptr); | |||
break; | |||
case audioMasterGetLanguage: | |||
ret = kVstLangEnglish; | |||
break; | |||
case audioMasterUpdateDisplay: | |||
if (self) | |||
self->handleAudioMasterUpdateDisplay(); | |||
break; | |||
default: | |||
#ifdef DEBUG | |||
qDebug("CarlaVstClient::hostCallback(%p, %s, %i, " P_INTPTR ", %p, %f", effect, vstMasterOpcode2str(opcode), index, value, ptr, opt); | |||
#endif | |||
break; | |||
} | |||
return ret; | |||
} | |||
protected: | |||
void timerEvent(QTimerEvent* const event) | |||
{ | |||
if (event->timerId() == idleTimer && effect) | |||
{ | |||
if (needIdle) | |||
effect->dispatcher(effect, effIdle, 0, 0, nullptr, 0.0f); | |||
effect->dispatcher(effect, effEditIdle, 0, 0, nullptr, 0.0f); | |||
} | |||
QObject::timerEvent(event); | |||
} | |||
private: | |||
int unique1; | |||
AEffect* effect; | |||
VstTimeInfo_R vstTimeInfo; | |||
int idleTimer; | |||
bool needIdle; | |||
static CarlaVstClient* lastVstPlugin; | |||
int unique2; | |||
}; | |||
CarlaVstClient* CarlaVstClient::lastVstPlugin = nullptr; | |||
// ------------------------------------------------------------------------- | |||
CARLA_BRIDGE_END_NAMESPACE | |||
int main(int argc, char* argv[]) | |||
{ | |||
CARLA_BRIDGE_USE_NAMESPACE | |||
if (argc != 4) | |||
{ | |||
qWarning("usage: %s <osc-url|\"null\"> <binary> <ui-title>", argv[0]); | |||
return 1; | |||
} | |||
const char* oscUrl = argv[1]; | |||
const char* binary = argv[2]; | |||
const char* uiTitle = argv[3]; | |||
const bool useOsc = strcmp(oscUrl, "null"); | |||
// try to get sampleRate value | |||
const char* const sampleRateStr = getenv("CARLA_SAMPLE_RATE"); | |||
if (sampleRateStr) | |||
sampleRate = atof(sampleRateStr); | |||
// Init VST client | |||
CarlaVstClient client(uiTitle); | |||
// Init OSC | |||
if (useOsc && ! client.oscInit(oscUrl)) | |||
{ | |||
return -1; | |||
} | |||
// Load UI | |||
int ret; | |||
if (client.init(binary, nullptr)) | |||
{ | |||
client.toolkitExec(!useOsc); | |||
ret = 0; | |||
} | |||
else | |||
{ | |||
qCritical("Failed to load VST UI"); | |||
ret = 1; | |||
} | |||
// Close OSC | |||
if (useOsc) | |||
{ | |||
client.oscClose(); | |||
} | |||
// Close VST client | |||
client.close(); | |||
return ret; | |||
} | |||
#endif // BRIDGE_VST | |||
@@ -1,43 +0,0 @@ | |||
# QtCreator project file | |||
QT = core | |||
CONFIG = debug link_pkgconfig qt warn_on | |||
PKGCONFIG = liblo gtk+-2.0 | |||
TARGET = carla-bridge-lv2-gtk2 | |||
TEMPLATE = app | |||
VERSION = 0.5.0 | |||
SOURCES = \ | |||
../carla_bridge_client.cpp \ | |||
../carla_bridge_osc.cpp \ | |||
../carla_bridge_toolkit.cpp \ | |||
../carla_bridge_toolkit-gtk.cpp \ | |||
../carla_bridge_ui-lv2.cpp | |||
HEADERS = \ | |||
../carla_bridge.hpp \ | |||
../carla_bridge_client.hpp \ | |||
../carla_bridge_osc.hpp \ | |||
../carla_bridge_toolkit.hpp \ | |||
../../carla-includes/carla_defines.hpp \ | |||
../../carla-includes/carla_midi.h \ | |||
../../carla-includes/lv2_rdf.hpp \ | |||
../../carla-utils/carla_lib_utils.hpp \ | |||
../../carla-utils/carla_osc_utils.hpp \ | |||
../../carla-utils/carla_lv2_utils.hpp | |||
INCLUDEPATH = .. \ | |||
../../carla-includes \ | |||
../../carla-utils | |||
LIBS = \ | |||
../../carla-lilv/carla_lilv.a \ | |||
../../carla-rtmempool/carla_rtmempool.a | |||
DEFINES = QTCREATOR_TEST | |||
DEFINES += DEBUG | |||
DEFINES += BUILD_BRIDGE BUILD_BRIDGE_UI BRIDGE_LV2 BRIDGE_GTK2 BRIDGE_LV2_GTK2 | |||
QMAKE_CXXFLAGS *= -std=c++0x |
@@ -1,43 +0,0 @@ | |||
# QtCreator project file | |||
QT = core | |||
CONFIG = debug link_pkgconfig qt warn_on | |||
PKGCONFIG = liblo gtk+-3.0 | |||
TARGET = carla-bridge-lv2-gtk3 | |||
TEMPLATE = app | |||
VERSION = 0.5.0 | |||
SOURCES = \ | |||
../carla_bridge_client.cpp \ | |||
../carla_bridge_osc.cpp \ | |||
../carla_bridge_toolkit.cpp \ | |||
../carla_bridge_toolkit-gtk.cpp \ | |||
../carla_bridge_ui-lv2.cpp | |||
HEADERS = \ | |||
../carla_bridge.hpp \ | |||
../carla_bridge_client.hpp \ | |||
../carla_bridge_osc.hpp \ | |||
../carla_bridge_toolkit.hpp \ | |||
../../carla-includes/carla_defines.hpp \ | |||
../../carla-includes/carla_midi.h \ | |||
../../carla-includes/lv2_rdf.hpp \ | |||
../../carla-utils/carla_lib_utils.hpp \ | |||
../../carla-utils/carla_osc_utils.hpp \ | |||
../../carla-utils/carla_lv2_utils.hpp | |||
INCLUDEPATH = .. \ | |||
../../carla-includes \ | |||
../../carla-utils | |||
LIBS = \ | |||
../../carla-lilv/carla_lilv.a \ | |||
../../carla-rtmempool/carla_rtmempool.a | |||
DEFINES = QTCREATOR_TEST | |||
DEFINES += DEBUG | |||
DEFINES += BUILD_BRIDGE BUILD_BRIDGE_UI BRIDGE_LV2 BRIDGE_GTK3 BRIDGE_LV2_GTK3 | |||
QMAKE_CXXFLAGS *= -std=c++0x |
@@ -1,43 +0,0 @@ | |||
# QtCreator project file | |||
QT = core gui | |||
CONFIG = debug link_pkgconfig qt warn_on | |||
PKGCONFIG = liblo | |||
TARGET = carla-bridge-lv2-qt4 | |||
TEMPLATE = app | |||
VERSION = 0.5.0 | |||
SOURCES = \ | |||
../carla_bridge_client.cpp \ | |||
../carla_bridge_osc.cpp \ | |||
../carla_bridge_toolkit.cpp \ | |||
../carla_bridge_toolkit-qt.cpp \ | |||
../carla_bridge_ui-lv2.cpp | |||
HEADERS = \ | |||
../carla_bridge.hpp \ | |||
../carla_bridge_client.hpp \ | |||
../carla_bridge_osc.hpp \ | |||
../carla_bridge_toolkit.hpp \ | |||
../../carla-includes/carla_defines.hpp \ | |||
../../carla-includes/carla_midi.h \ | |||
../../carla-includes/lv2_rdf.hpp \ | |||
../../carla-utils/carla_lib_utils.hpp \ | |||
../../carla-utils/carla_osc_utils.hpp \ | |||
../../carla-utils/carla_lv2_utils.hpp | |||
INCLUDEPATH = .. \ | |||
../../carla-includes \ | |||
../../carla-utils | |||
LIBS = \ | |||
../../carla-lilv/carla_lilv.a \ | |||
../../carla-rtmempool/carla_rtmempool.a | |||
DEFINES = QTCREATOR_TEST | |||
DEFINES += DEBUG | |||
DEFINES += BUILD_BRIDGE BUILD_BRIDGE_UI BRIDGE_LV2 BRIDGE_QT4 BRIDGE_LV2_QT4 | |||
QMAKE_CXXFLAGS *= -std=c++0x |
@@ -1,43 +0,0 @@ | |||
# QtCreator project file | |||
QT = core widgets | |||
CONFIG = debug link_pkgconfig qt warn_on | |||
PKGCONFIG = liblo | |||
TARGET = carla-bridge-lv2-qt5 | |||
TEMPLATE = app | |||
VERSION = 0.5.0 | |||
SOURCES = \ | |||
../carla_bridge_client.cpp \ | |||
../carla_bridge_osc.cpp \ | |||
../carla_bridge_toolkit.cpp \ | |||
../carla_bridge_toolkit-qt.cpp \ | |||
../carla_bridge_ui-lv2.cpp | |||
HEADERS = \ | |||
../carla_bridge.hpp \ | |||
../carla_bridge_client.hpp \ | |||
../carla_bridge_osc.hpp \ | |||
../carla_bridge_toolkit.hpp \ | |||
../../carla-includes/carla_defines.hpp \ | |||
../../carla-includes/carla_midi.h \ | |||
../../carla-includes/lv2_rdf.hpp \ | |||
../../carla-utils/carla_lib_utils.hpp \ | |||
../../carla-utils/carla_osc_utils.hpp \ | |||
../../carla-utils/carla_lv2_utils.hpp | |||
INCLUDEPATH = .. \ | |||
../../carla-includes \ | |||
../../carla-utils | |||
LIBS = \ | |||
../../carla-lilv/carla_lilv.a \ | |||
../../carla-rtmempool/carla_rtmempool.a | |||
DEFINES = QTCREATOR_TEST | |||
DEFINES += DEBUG | |||
DEFINES += BUILD_BRIDGE BUILD_BRIDGE_UI BRIDGE_LV2 BRIDGE_QT5 BRIDGE_LV2_QT5 | |||
QMAKE_CXXFLAGS *= -std=c++0x |
@@ -1,47 +0,0 @@ | |||
# QtCreator project file | |||
contains(QT_VERSION, ^5.*) { | |||
QT = core widgets | |||
} else { | |||
QT = core gui | |||
} | |||
CONFIG = debug link_pkgconfig qt warn_on | |||
PKGCONFIG = liblo | |||
TARGET = carla-bridge-lv2-x11 | |||
TEMPLATE = app | |||
VERSION = 0.5.0 | |||
SOURCES = \ | |||
../carla_bridge_client.cpp \ | |||
../carla_bridge_osc.cpp \ | |||
../carla_bridge_toolkit.cpp \ | |||
../carla_bridge_toolkit-qt.cpp \ | |||
../carla_bridge_ui-lv2.cpp | |||
HEADERS = \ | |||
../carla_bridge.hpp \ | |||
../carla_bridge_client.hpp \ | |||
../carla_bridge_osc.hpp \ | |||
../carla_bridge_toolkit.hpp \ | |||
../../carla-includes/carla_defines.hpp \ | |||
../../carla-includes/carla_midi.h \ | |||
../../carla-includes/lv2_rdf.hpp \ | |||
../../carla-utils/carla_lib_utils.hpp \ | |||
../../carla-utils/carla_osc_utils.hpp \ | |||
../../carla-utils/carla_lv2_utils.hpp | |||
INCLUDEPATH = .. \ | |||
../../carla-includes \ | |||
../../carla-utils | |||
LIBS = \ | |||
../../carla-lilv/carla_lilv.a \ | |||
../../carla-rtmempool/carla_rtmempool.a | |||
DEFINES = QTCREATOR_TEST | |||
DEFINES += DEBUG | |||
DEFINES += BUILD_BRIDGE BUILD_BRIDGE_UI BRIDGE_LV2 BRIDGE_X11 BRIDGE_LV2_X11 | |||
QMAKE_CXXFLAGS *= -std=c++0x |
@@ -1,100 +0,0 @@ | |||
# QtCreator project file | |||
contains(QT_VERSION, ^5.*) { | |||
QT = core widgets xml | |||
} else { | |||
QT = core gui xml | |||
} | |||
CONFIG = debug link_pkgconfig qt warn_on | |||
PKGCONFIG = jack liblo | |||
TARGET = carla-bridge-qtcreator | |||
TEMPLATE = app | |||
VERSION = 0.5.0 | |||
SOURCES = \ | |||
../carla_bridge_client.cpp \ | |||
../carla_bridge_osc.cpp \ | |||
../carla_bridge_toolkit.cpp \ | |||
../carla_bridge_plugin.cpp | |||
HEADERS = \ | |||
../carla_bridge.hpp \ | |||
../carla_bridge_client.hpp \ | |||
../carla_bridge_osc.hpp \ | |||
../carla_bridge_toolkit.hpp \ | |||
# carla | |||
SOURCES += \ | |||
../../carla/Shared.cpp | |||
HEADERS += \ | |||
../../carla/Shared.hpp | |||
# carla-engine | |||
SOURCES += \ | |||
../../carla-engine/carla_engine.cpp \ | |||
../../carla-engine/carla_engine_osc.cpp \ | |||
../../carla-engine/carla_engine_thread.cpp \ | |||
../../carla-engine/jack.cpp | |||
HEADERS += \ | |||
../../carla-engine/carla_engine.hpp \ | |||
../../carla-engine/carla_engine_osc.hpp \ | |||
../../carla-engine/carla_engine_thread.hpp \ | |||
# carla-plugin | |||
SOURCES += \ | |||
../../carla-plugin/carla_plugin.cpp \ | |||
../../carla-plugin/carla_plugin_thread.cpp \ | |||
../../carla-plugin/ladspa.cpp \ | |||
../../carla-plugin/dssi.cpp \ | |||
../../carla-plugin/lv2.cpp \ | |||
../../carla-plugin/vst.cpp | |||
HEADERS += \ | |||
../../carla-plugin/carla_plugin.hpp \ | |||
../../carla-plugin/carla_plugin_thread.hpp | |||
# carla-backend | |||
HEADERS += \ | |||
../../carla-backend/carla_backend.hpp \ | |||
../../carla-backend/carla_backend_utils.hpp | |||
# carla-includes | |||
HEADERS += \ | |||
../../carla-includes/carla_defines.hpp \ | |||
../../carla-includes/carla_midi.h \ | |||
../../carla-includes/ladspa_rdf.hpp \ | |||
../../carla-includes/lv2_rdf.hpp | |||
# carla-utils | |||
HEADERS += \ | |||
../../carla-utils/carla_lib_utils.hpp \ | |||
../../carla-utils/carla_osc_utils.hpp \ | |||
../../carla-utils/carla_ladspa_utils.hpp \ | |||
../../carla-utils/carla_lv2_utils.hpp \ | |||
../../carla-utils/carla_vst_utils.hpp | |||
INCLUDEPATH = .. \ | |||
../../carla-backend \ | |||
../../carla-engine \ | |||
../../carla-includes \ | |||
../../carla-jackbridge \ | |||
../../carla-plugin \ | |||
../../carla-utils | |||
DEFINES = QTCREATOR_TEST | |||
DEFINES += DEBUG | |||
#DEFINES += VESTIGE_HEADER | |||
DEFINES += BUILD_BRIDGE BUILD_BRIDGE_PLUGIN BRIDGE_PLUGIN | |||
DEFINES += CARLA_ENGINE_JACK | |||
DEFINES += WANT_LADSPA WANT_DSSI WANT_LV2 WANT_VST | |||
LIBS = -ldl \ | |||
../../carla-lilv/carla_lilv.a \ | |||
../../carla-rtmempool/carla_rtmempool.a | |||
QMAKE_CXXFLAGS *= -std=c++0x |
@@ -1,42 +0,0 @@ | |||
# QtCreator project file | |||
contains(QT_VERSION, ^5.*) { | |||
QT = core widgets | |||
} else { | |||
QT = core gui | |||
} | |||
CONFIG = debug link_pkgconfig qt warn_on | |||
PKGCONFIG = liblo | |||
TARGET = carla-bridge-vst-x11 | |||
TEMPLATE = app | |||
VERSION = 0.5.0 | |||
SOURCES = \ | |||
../carla_bridge_client.cpp \ | |||
../carla_bridge_osc.cpp \ | |||
../carla_bridge_toolkit.cpp \ | |||
../carla_bridge_toolkit-qt.cpp \ | |||
../carla_bridge_ui-vst.cpp | |||
HEADERS = \ | |||
../carla_bridge.hpp \ | |||
../carla_bridge_client.hpp \ | |||
../carla_bridge_osc.hpp \ | |||
../carla_bridge_toolkit.hpp \ | |||
../../carla-includes/carla_defines.hpp \ | |||
../../carla-includes/carla_midi.h \ | |||
../../carla-utils/carla_lib_utils.hpp \ | |||
../../carla-utils/carla_osc_utils.hpp \ | |||
../../carla-utils/carla_vst_utils.hpp | |||
INCLUDEPATH = .. \ | |||
../../carla-includes \ | |||
../../carla-utils | |||
DEFINES = QTCREATOR_TEST | |||
DEFINES += DEBUG | |||
DEFINES += BUILD_BRIDGE BUILD_BRIDGE_UI BRIDGE_VST BRIDGE_X11 BRIDGE_VST_X11 | |||
QMAKE_CXXFLAGS *= -std=c++0x |
@@ -1,91 +0,0 @@ | |||
#!/usr/bin/make -f | |||
# Makefile for carla-discovery # | |||
# ----------------------------------------- # | |||
# Created by falkTX | |||
# | |||
include ../Makefile.mk | |||
# -------------------------------------------------------------- | |||
BUILD_CXX_FLAGS += -I../carla-backend -I../carla-includes -I../carla-utils | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags QtCore) | |||
LINK_FLAGS += $(shell pkg-config --libs QtCore) | |||
ifeq ($(CARLA_PLUGIN_SUPPORT),true) | |||
BUILD_CXX_FLAGS += -DWANT_LADSPA -DWANT_DSSI -DWANT_LV2 -DWANT_VST | |||
endif | |||
ifneq ($(NATIVE),) | |||
ifeq ($(HAVE_FLUIDSYNTH),true) | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags fluidsynth) -DWANT_FLUIDSYNTH | |||
LINK_FLAGS += $(shell pkg-config --libs fluidsynth) | |||
endif | |||
ifeq ($(HAVE_LINUXSAMPLER),true) | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags linuxsampler) -DWANT_LINUXSAMPLER | |||
LINK_FLAGS += $(shell pkg-config --libs linuxsampler) | |||
endif | |||
endif | |||
# -------------------------------------------------------------- | |||
POSIX_BUILD_FLAGS = $(BUILD_CXX_FLAGS) | |||
POSIX_32BIT_FLAGS = $(32BIT_FLAGS) -L/usr/lib32 -L/usr/lib/i386-linux-gnu | |||
POSIX_64BIT_FLAGS = $(64BIT_FLAGS) -L/usr/lib64 -L/usr/lib/x86_64-linux-gnu | |||
POSIX_LINK_FLAGS = $(LINK_FLAGS) -ldl -lpthread | |||
WIN_BUILD_FLAGS = $(BUILD_CXX_FLAGS) | |||
WIN_32BIT_FLAGS = $(32BIT_FLAGS) | |||
WIN_64BIT_FLAGS = $(64BIT_FLAGS) | |||
WIN_LINK_FLAGS = $(LINK_FLAGS) -static -mwindows | |||
# -------------------------------------------------------------- | |||
all: carla-discovery-native | |||
posix32: carla-discovery-posix32 | |||
posix64: carla-discovery-posix64 | |||
win32: carla-discovery-win32.exe | |||
win64: carla-discovery-win64.exe | |||
# -------------------------------------------------------------- | |||
OBJS = carla-discovery.cpp | |||
carla-discovery-native: $(OBJS) ../carla-lilv/carla_lilv.a | |||
$(CXX) $^ $(POSIX_BUILD_FLAGS) $(POSIX_LINK_FLAGS) -o $@ && $(STRIP) $@ | |||
carla-discovery-posix32: $(OBJS) ../carla-lilv/carla_lilv_posix32.a | |||
$(CXX) $^ $(POSIX_BUILD_FLAGS) $(POSIX_32BIT_FLAGS) $(POSIX_LINK_FLAGS) -o $@ && $(STRIP) $@ | |||
carla-discovery-posix64: $(OBJS) ../carla-lilv/carla_lilv_posix64.a | |||
$(CXX) $^ $(POSIX_BUILD_FLAGS) $(POSIX_64BIT_FLAGS) $(POSIX_LINK_FLAGS) -o $@ && $(STRIP) $@ | |||
carla-discovery-win32.exe: $(OBJS) ../carla-lilv/carla_lilv_win32.a | |||
$(CXX) $^ $(WIN_BUILD_FLAGS) $(WIN_32BIT_FLAGS) $(WIN_LINK_FLAGS) -o $@ && $(STRIP) $@ | |||
carla-discovery-win64.exe: $(OBJS) ../carla-lilv/carla_lilv_win64.a | |||
$(CXX) $^ $(WIN_BUILD_FLAGS) $(WIN_64BIT_FLAGS) $(WIN_LINK_FLAGS) -o $@ && $(STRIP) $@ | |||
# -------------------------------------------------------------- | |||
../carla-lilv/carla_lilv.a: | |||
$(MAKE) -C ../carla-lilv | |||
../carla-lilv/carla_lilv_posix32.a: | |||
$(MAKE) -C ../carla-lilv posix32 | |||
../carla-lilv/carla_lilv_posix64.a: | |||
$(MAKE) -C ../carla-lilv posix64 | |||
../carla-lilv/carla_lilv_win32.a: | |||
$(MAKE) -C ../carla-lilv win32 | |||
../carla-lilv/carla_lilv_win64.a: | |||
$(MAKE) -C ../carla-lilv win64 | |||
# -------------------------------------------------------------- | |||
clean: | |||
rm -f carla-discovery-* |
@@ -1,35 +0,0 @@ | |||
# QtCreator project file | |||
QT = core | |||
CONFIG = debug | |||
CONFIG += link_pkgconfig qt warn_on | |||
DEFINES = DEBUG | |||
DEFINES += WANT_LADSPA WANT_DSSI WANT_LV2 WANT_VST | |||
DEFINES += WANT_FLUIDSYNTH WANT_LINUXSAMPLER | |||
PKGCONFIG = fluidsynth linuxsampler | |||
TARGET = carla-discovery-native | |||
TEMPLATE = app | |||
VERSION = 0.5.0 | |||
SOURCES = \ | |||
carla-discovery.cpp | |||
INCLUDEPATH = \ | |||
../carla-backend \ | |||
../carla-includes \ | |||
../carla-utils | |||
LIBS = \ | |||
../carla-lilv/carla_lilv.a | |||
unix { | |||
LIBS += -ldl -lpthread | |||
} | |||
win { | |||
LIBS += -static -mwindows | |||
} | |||
QMAKE_CXXFLAGS *= -std=c++0x |
@@ -1,35 +0,0 @@ | |||
/* | |||
* Carla Plugin Engine | |||
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef __DISTRHO_PLUGIN_INFO_H__ | |||
#define __DISTRHO_PLUGIN_INFO_H__ | |||
#define DISTRHO_PLUGIN_NAME "Carla" | |||
#define DISTRHO_PLUGIN_HAS_UI 0 | |||
#define DISTRHO_PLUGIN_IS_SYNTH 1 | |||
#define DISTRHO_PLUGIN_NUM_INPUTS 2 | |||
#define DISTRHO_PLUGIN_NUM_OUTPUTS 2 | |||
#define DISTRHO_PLUGIN_WANT_LATENCY 1 | |||
#define DISTRHO_PLUGIN_WANT_PROGRAMS 1 | |||
#define DISTRHO_PLUGIN_WANT_STATE 1 | |||
#define DISTRHO_PLUGIN_URI "http://kxstudio.sf.net/carla" | |||
#endif // __DISTRHO_PLUGIN_INFO_H__ |
@@ -1,74 +0,0 @@ | |||
#!/usr/bin/make -f | |||
# Makefile for carla-engine # | |||
# ------------------------------------ # | |||
# Created by falkTX | |||
# | |||
include ../Makefile.mk | |||
# -------------------------------------------------------------- | |||
BUILD_CXX_FLAGS += -fvisibility=hidden -fPIC | |||
BUILD_CXX_FLAGS += -I. -I../carla-backend -I../carla-includes -I../carla-plugin -I../carla-utils | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags liblo QtCore) | |||
ifeq ($(CARLA_PLUGIN_SUPPORT),true) | |||
BUILD_CXX_FLAGS += -DWANT_LV2 | |||
endif | |||
ifeq ($(HAVE_JACK),true) | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags jack) -D__UNIX_JACK__ | |||
WANT_JACK = true | |||
endif | |||
ifeq ($(HAVE_ALSA),true) | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags alsa) -D__LINUX_ALSA__ -D__LINUX_ALSASEQ__ | |||
WANT_RTAUDIO = true | |||
endif | |||
ifeq ($(HAVE_PULSEAUDIO),true) | |||
BUILD_CXX_FLAGS += $(shell pkg-config --cflags libpulse-simple) -D__LINUX_PULSE__ | |||
WANT_RTAUDIO = true | |||
endif | |||
OBJS = \ | |||
carla_engine.o \ | |||
carla_engine_osc.o \ | |||
carla_engine_thread.o \ | |||
jack.o \ | |||
rtaudio.o | |||
# -------------------------------------------------------------- | |||
ifeq ($(WANT_JACK),true) | |||
BUILD_CXX_FLAGS += -DCARLA_ENGINE_JACK | |||
BUILD_CXX_FLAGS += -I../carla-jackbridge | |||
endif | |||
ifeq ($(WANT_RTAUDIO),true) | |||
BUILD_CXX_FLAGS += -DCARLA_ENGINE_RTAUDIO -DHAVE_GETTIMEOFDAY -D_FORTIFY_SOURCE=2 | |||
BUILD_CXX_FLAGS += -Irtaudio-4.0.11 -Irtmidi-2.0.1 | |||
ifeq ($(DEBUG),true) | |||
BUILD_CXX_FLAGS += -D__RTAUDIO_DEBUG__ -D__RTMIDI_DEBUG__ | |||
endif | |||
OBJS += rtaudio-4.0.11/RtAudio.o | |||
OBJS += rtmidi-2.0.1/RtMidi.o | |||
endif | |||
# -------------------------------------------------------------- | |||
all: carla_engine.a | |||
doxygen: carla_engine.doxygen | |||
doxygen $< | |||
carla_engine.a: $(OBJS) | |||
$(AR) rs $@ $^ | |||
# -------------------------------------------------------------- | |||
.cpp.o: | |||
$(CXX) -c $< $(BUILD_CXX_FLAGS) -o $@ | |||
clean: | |||
rm -f *.a $(OBJS) |
@@ -1,287 +0,0 @@ | |||
# Doxyfile 1.7.6.1 | |||
#--------------------------------------------------------------------------- | |||
# Project related configuration options | |||
#--------------------------------------------------------------------------- | |||
DOXYFILE_ENCODING = UTF-8 | |||
PROJECT_NAME = "Carla Engine" | |||
PROJECT_NUMBER = | |||
PROJECT_BRIEF = | |||
PROJECT_LOGO = | |||
OUTPUT_DIRECTORY = ../../doc/carla-engine | |||
CREATE_SUBDIRS = NO | |||
OUTPUT_LANGUAGE = English | |||
BRIEF_MEMBER_DESC = YES | |||
REPEAT_BRIEF = YES | |||
ABBREVIATE_BRIEF = | |||
ALWAYS_DETAILED_SEC = NO | |||
INLINE_INHERITED_MEMB = NO | |||
FULL_PATH_NAMES = YES | |||
STRIP_FROM_PATH = | |||
STRIP_FROM_INC_PATH = | |||
SHORT_NAMES = NO | |||
JAVADOC_AUTOBRIEF = NO | |||
QT_AUTOBRIEF = NO | |||
MULTILINE_CPP_IS_BRIEF = NO | |||
INHERIT_DOCS = YES | |||
SEPARATE_MEMBER_PAGES = NO | |||
TAB_SIZE = 4 | |||
ALIASES = | |||
TCL_SUBST = | |||
OPTIMIZE_OUTPUT_FOR_C = NO | |||
OPTIMIZE_OUTPUT_JAVA = NO | |||
OPTIMIZE_FOR_FORTRAN = NO | |||
OPTIMIZE_OUTPUT_VHDL = NO | |||
EXTENSION_MAPPING = | |||
BUILTIN_STL_SUPPORT = NO | |||
CPP_CLI_SUPPORT = NO | |||
SIP_SUPPORT = NO | |||
IDL_PROPERTY_SUPPORT = YES | |||
DISTRIBUTE_GROUP_DOC = NO | |||
SUBGROUPING = YES | |||
INLINE_GROUPED_CLASSES = NO | |||
INLINE_SIMPLE_STRUCTS = NO | |||
TYPEDEF_HIDES_STRUCT = NO | |||
SYMBOL_CACHE_SIZE = 0 | |||
LOOKUP_CACHE_SIZE = 0 | |||
#--------------------------------------------------------------------------- | |||
# Build related configuration options | |||
#--------------------------------------------------------------------------- | |||
EXTRACT_ALL = YES | |||
EXTRACT_PRIVATE = NO | |||
EXTRACT_STATIC = NO | |||
EXTRACT_LOCAL_CLASSES = YES | |||
EXTRACT_LOCAL_METHODS = NO | |||
EXTRACT_ANON_NSPACES = NO | |||
HIDE_UNDOC_MEMBERS = NO | |||
HIDE_UNDOC_CLASSES = NO | |||
HIDE_FRIEND_COMPOUNDS = NO | |||
HIDE_IN_BODY_DOCS = NO | |||
INTERNAL_DOCS = NO | |||
CASE_SENSE_NAMES = YES | |||
HIDE_SCOPE_NAMES = NO | |||
SHOW_INCLUDE_FILES = YES | |||
FORCE_LOCAL_INCLUDES = NO | |||
INLINE_INFO = YES | |||
SORT_MEMBER_DOCS = NO | |||
SORT_BRIEF_DOCS = NO | |||
SORT_MEMBERS_CTORS_1ST = NO | |||
SORT_GROUP_NAMES = NO | |||
SORT_BY_SCOPE_NAME = NO | |||
STRICT_PROTO_MATCHING = NO | |||
GENERATE_TODOLIST = YES | |||
GENERATE_TESTLIST = YES | |||
GENERATE_BUGLIST = YES | |||
GENERATE_DEPRECATEDLIST= YES | |||
ENABLED_SECTIONS = | |||
MAX_INITIALIZER_LINES = 30 | |||
SHOW_USED_FILES = YES | |||
SHOW_DIRECTORIES = NO | |||
SHOW_FILES = YES | |||
SHOW_NAMESPACES = YES | |||
FILE_VERSION_FILTER = | |||
LAYOUT_FILE = | |||
CITE_BIB_FILES = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to warning and progress messages | |||
#--------------------------------------------------------------------------- | |||
QUIET = NO | |||
WARNINGS = YES | |||
WARN_IF_UNDOCUMENTED = YES | |||
WARN_IF_DOC_ERROR = YES | |||
WARN_NO_PARAMDOC = NO | |||
WARN_FORMAT = "$file:$line: $text" | |||
WARN_LOGFILE = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the input files | |||
#--------------------------------------------------------------------------- | |||
INPUT = | |||
INPUT_ENCODING = UTF-8 | |||
FILE_PATTERNS = | |||
RECURSIVE = NO | |||
EXCLUDE = carla_engine.cpp carla_engine_osc.hpp carla_engine_osc.cpp carla_engine_thread.hpp carla_engine_thread.cpp DistrhoPluginInfo.h | |||
EXCLUDE_SYMLINKS = NO | |||
EXCLUDE_PATTERNS = | |||
EXCLUDE_SYMBOLS = | |||
EXAMPLE_PATH = | |||
EXAMPLE_PATTERNS = | |||
EXAMPLE_RECURSIVE = NO | |||
IMAGE_PATH = | |||
INPUT_FILTER = | |||
FILTER_PATTERNS = | |||
FILTER_SOURCE_FILES = NO | |||
FILTER_SOURCE_PATTERNS = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to source browsing | |||
#--------------------------------------------------------------------------- | |||
SOURCE_BROWSER = NO | |||
INLINE_SOURCES = NO | |||
STRIP_CODE_COMMENTS = YES | |||
REFERENCED_BY_RELATION = NO | |||
REFERENCES_RELATION = NO | |||
REFERENCES_LINK_SOURCE = YES | |||
USE_HTAGS = NO | |||
VERBATIM_HEADERS = YES | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the alphabetical class index | |||
#--------------------------------------------------------------------------- | |||
ALPHABETICAL_INDEX = YES | |||
COLS_IN_ALPHA_INDEX = 5 | |||
IGNORE_PREFIX = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the HTML output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_HTML = YES | |||
HTML_OUTPUT = . | |||
HTML_FILE_EXTENSION = .html | |||
HTML_HEADER = | |||
HTML_FOOTER = | |||
HTML_STYLESHEET = | |||
HTML_EXTRA_FILES = | |||
HTML_COLORSTYLE_HUE = 220 | |||
HTML_COLORSTYLE_SAT = 100 | |||
HTML_COLORSTYLE_GAMMA = 80 | |||
HTML_TIMESTAMP = YES | |||
HTML_ALIGN_MEMBERS = YES | |||
HTML_DYNAMIC_SECTIONS = NO | |||
GENERATE_DOCSET = NO | |||
DOCSET_FEEDNAME = "Doxygen generated docs" | |||
DOCSET_BUNDLE_ID = org.doxygen.Project | |||
DOCSET_PUBLISHER_ID = org.doxygen.Publisher | |||
DOCSET_PUBLISHER_NAME = Publisher | |||
GENERATE_HTMLHELP = NO | |||
CHM_FILE = | |||
HHC_LOCATION = | |||
GENERATE_CHI = NO | |||
CHM_INDEX_ENCODING = | |||
BINARY_TOC = NO | |||
TOC_EXPAND = NO | |||
GENERATE_QHP = NO | |||
QCH_FILE = | |||
QHP_NAMESPACE = org.doxygen.Project | |||
QHP_VIRTUAL_FOLDER = doc | |||
QHP_CUST_FILTER_NAME = | |||
QHP_CUST_FILTER_ATTRS = | |||
QHP_SECT_FILTER_ATTRS = | |||
QHG_LOCATION = | |||
GENERATE_ECLIPSEHELP = NO | |||
ECLIPSE_DOC_ID = org.doxygen.Project | |||
DISABLE_INDEX = NO | |||
GENERATE_TREEVIEW = NO | |||
ENUM_VALUES_PER_LINE = 4 | |||
USE_INLINE_TREES = NO | |||
TREEVIEW_WIDTH = 250 | |||
EXT_LINKS_IN_WINDOW = NO | |||
FORMULA_FONTSIZE = 10 | |||
FORMULA_TRANSPARENT = YES | |||
USE_MATHJAX = NO | |||
MATHJAX_RELPATH = http://www.mathjax.org/mathjax | |||
MATHJAX_EXTENSIONS = | |||
SEARCHENGINE = YES | |||
SERVER_BASED_SEARCH = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the LaTeX output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_LATEX = NO | |||
LATEX_OUTPUT = latex | |||
LATEX_CMD_NAME = latex | |||
MAKEINDEX_CMD_NAME = makeindex | |||
COMPACT_LATEX = NO | |||
PAPER_TYPE = a4 | |||
EXTRA_PACKAGES = | |||
LATEX_HEADER = | |||
LATEX_FOOTER = | |||
PDF_HYPERLINKS = YES | |||
USE_PDFLATEX = YES | |||
LATEX_BATCHMODE = NO | |||
LATEX_HIDE_INDICES = NO | |||
LATEX_SOURCE_CODE = NO | |||
LATEX_BIB_STYLE = plain | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the RTF output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_RTF = NO | |||
RTF_OUTPUT = rtf | |||
COMPACT_RTF = NO | |||
RTF_HYPERLINKS = NO | |||
RTF_STYLESHEET_FILE = | |||
RTF_EXTENSIONS_FILE = | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the man page output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_MAN = NO | |||
MAN_OUTPUT = man | |||
MAN_EXTENSION = .3 | |||
MAN_LINKS = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the XML output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_XML = NO | |||
XML_OUTPUT = xml | |||
XML_SCHEMA = | |||
XML_DTD = | |||
XML_PROGRAMLISTING = YES | |||
#--------------------------------------------------------------------------- | |||
# configuration options for the AutoGen Definitions output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_AUTOGEN_DEF = NO | |||
#--------------------------------------------------------------------------- | |||
# configuration options related to the Perl module output | |||
#--------------------------------------------------------------------------- | |||
GENERATE_PERLMOD = NO | |||
PERLMOD_LATEX = NO | |||
PERLMOD_PRETTY = YES | |||
PERLMOD_MAKEVAR_PREFIX = | |||
#--------------------------------------------------------------------------- | |||
# Configuration options related to the preprocessor | |||
#--------------------------------------------------------------------------- | |||
ENABLE_PREPROCESSING = YES | |||
MACRO_EXPANSION = NO | |||
EXPAND_ONLY_PREDEF = NO | |||
SEARCH_INCLUDES = YES | |||
INCLUDE_PATH = | |||
INCLUDE_FILE_PATTERNS = | |||
PREDEFINED = DOXYGEN CARLA_ENGINE_JACK CARLA_ENGINE_RTAUDIO CARLA_ENGINE_PLUGIN | |||
EXPAND_AS_DEFINED = | |||
SKIP_FUNCTION_MACROS = YES | |||
#--------------------------------------------------------------------------- | |||
# Configuration::additions related to external references | |||
#--------------------------------------------------------------------------- | |||
TAGFILES = | |||
GENERATE_TAGFILE = | |||
ALLEXTERNALS = NO | |||
EXTERNAL_GROUPS = YES | |||
PERL_PATH = /usr/bin/perl | |||
#--------------------------------------------------------------------------- | |||
# Configuration options related to the dot tool | |||
#--------------------------------------------------------------------------- | |||
CLASS_DIAGRAMS = YES | |||
MSCGEN_PATH = | |||
HIDE_UNDOC_RELATIONS = YES | |||
HAVE_DOT = NO | |||
DOT_NUM_THREADS = 0 | |||
DOT_FONTNAME = Helvetica | |||
DOT_FONTSIZE = 10 | |||
DOT_FONTPATH = | |||
CLASS_GRAPH = YES | |||
COLLABORATION_GRAPH = YES | |||
GROUP_GRAPHS = YES | |||
UML_LOOK = NO | |||
TEMPLATE_RELATIONS = NO | |||
INCLUDE_GRAPH = YES | |||
INCLUDED_BY_GRAPH = YES | |||
CALL_GRAPH = NO | |||
CALLER_GRAPH = NO | |||
GRAPHICAL_HIERARCHY = YES | |||
DIRECTORY_GRAPH = YES | |||
DOT_IMAGE_FORMAT = png | |||
INTERACTIVE_SVG = NO | |||
DOT_PATH = | |||
DOTFILE_DIRS = | |||
MSCFILE_DIRS = | |||
DOT_GRAPH_MAX_NODES = 50 | |||
MAX_DOT_GRAPH_DEPTH = 0 | |||
DOT_TRANSPARENT = NO | |||
DOT_MULTI_TARGETS = YES | |||
GENERATE_LEGEND = YES | |||
DOT_CLEANUP = YES |
@@ -1,985 +0,0 @@ | |||
/* | |||
* Carla Engine | |||
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_ENGINE_HPP | |||
#define CARLA_ENGINE_HPP | |||
#include "carla_engine_osc.hpp" | |||
#include "carla_engine_thread.hpp" | |||
#include <QtCore/QProcessEnvironment> | |||
CARLA_BACKEND_START_NAMESPACE | |||
/*! | |||
* @defgroup CarlaBackendEngine Carla Backend Engine | |||
* | |||
* The Carla Backend Engine | |||
* @{ | |||
*/ | |||
/*! | |||
* @defgroup TimeInfoValidHints TimeInfo Valid Hints | |||
* | |||
* Various hints used for CarlaTimeInfo::valid. | |||
* @{ | |||
*/ | |||
const uint32_t CarlaEngineTimeBBT = 0x1; | |||
/**@}*/ | |||
/*! | |||
* The type of an engine. | |||
*/ | |||
enum CarlaEngineType { | |||
/*! | |||
* Null engine type. | |||
*/ | |||
CarlaEngineTypeNull = 0, | |||
/*! | |||
* Jack engine type.\n | |||
* Provides single, multi-client, and rack processing modes. | |||
*/ | |||
CarlaEngineTypeJack = 1, | |||
/*! | |||
* RtAudio engine type, used to provide ALSA, PulseAudio, DirectSound, ASIO and CoreAudio/Midi support.\n | |||
* Provides rack mode processing only. | |||
*/ | |||
CarlaEngineTypeRtAudio = 2, | |||
/*! | |||
* Plugin engine type, used to export the engine as a plugin (DSSI, LV2 and VST) via the DISTRHO Plugin Toolkit.\n | |||
* Works in rack mode only. | |||
*/ | |||
CarlaEngineTypePlugin = 3 | |||
}; | |||
/*! | |||
* The type of an engine port. | |||
*/ | |||
enum CarlaEnginePortType { | |||
/*! | |||
* Null engine port type. | |||
*/ | |||
CarlaEnginePortTypeNull = 0, | |||
/*! | |||
* Audio port. | |||
*/ | |||
CarlaEnginePortTypeAudio = 1, | |||
/*! | |||
* Control port.\n | |||
* These are MIDI ports on some engine types, by handling MIDI-CC as control. | |||
*/ | |||
CarlaEnginePortTypeControl = 2, | |||
/*! | |||
* MIDI port. | |||
*/ | |||
CarlaEnginePortTypeMIDI = 3 | |||
}; | |||
/*! | |||
* The type of a control event. | |||
*/ | |||
enum CarlaEngineControlEventType { | |||
/*! | |||
* Null event type. | |||
*/ | |||
CarlaEngineNullEvent = 0, | |||
/*! | |||
* Parameter change event.\n | |||
* \note Value uses a range of 0.0<->1.0. | |||
*/ | |||
CarlaEngineParameterChangeEvent = 1, | |||
/*! | |||
* MIDI Bank change event. | |||
*/ | |||
CarlaEngineMidiBankChangeEvent = 2, | |||
/*! | |||
* MIDI Program change event. | |||
*/ | |||
CarlaEngineMidiProgramChangeEvent = 3, | |||
/*! | |||
* All sound off event. | |||
*/ | |||
CarlaEngineAllSoundOffEvent = 4, | |||
/*! | |||
* All notes off event. | |||
*/ | |||
CarlaEngineAllNotesOffEvent = 5 | |||
}; | |||
/*! | |||
* Engine control event. | |||
*/ | |||
struct CarlaEngineControlEvent { | |||
CarlaEngineControlEventType type; | |||
uint32_t time; | |||
uint8_t channel; | |||
uint16_t parameter; | |||
double value; | |||
CarlaEngineControlEvent() | |||
: type(CarlaEngineNullEvent), | |||
time(0), | |||
channel(0), | |||
parameter(0), | |||
value(0.0) {} | |||
}; | |||
/*! | |||
* Engine MIDI event. | |||
*/ | |||
struct CarlaEngineMidiEvent { | |||
uint32_t time; | |||
uint8_t size; | |||
uint8_t data[3]; | |||
CarlaEngineMidiEvent() | |||
: time(0), | |||
size(0), | |||
data{0} {} | |||
}; | |||
/*! | |||
* Engine BBT Time information. | |||
*/ | |||
struct CarlaEngineTimeInfoBBT { | |||
int32_t bar; | |||
int32_t beat; | |||
int32_t tick; | |||
double bar_start_tick; | |||
float beats_per_bar; | |||
float beat_type; | |||
double ticks_per_beat; | |||
double beats_per_minute; | |||
CarlaEngineTimeInfoBBT() | |||
: bar(0), | |||
beat(0), | |||
tick(0), | |||
bar_start_tick(0.0), | |||
beats_per_bar(0.0f), | |||
beat_type(0.0f), | |||
ticks_per_beat(0.0), | |||
beats_per_minute(0.0) {} | |||
}; | |||
/*! | |||
* Engine Time information. | |||
*/ | |||
struct CarlaEngineTimeInfo { | |||
bool playing; | |||
uint32_t frame; | |||
uint32_t time; | |||
uint32_t valid; | |||
CarlaEngineTimeInfoBBT bbt; | |||
CarlaEngineTimeInfo() | |||
: playing(false), | |||
frame(0), | |||
time(0), | |||
valid(0) {} | |||
}; | |||
/*! | |||
* Engine options. | |||
*/ | |||
struct CarlaEngineOptions { | |||
ProcessMode processMode; | |||
bool processHighPrecision; | |||
uint maxParameters; | |||
uint preferredBufferSize; | |||
uint preferredSampleRate; | |||
bool forceStereo; | |||
bool useDssiVstChunks; | |||
bool preferPluginBridges; | |||
bool preferUiBridges; | |||
uint oscUiTimeout; | |||
CarlaString bridge_posix32; | |||
CarlaString bridge_posix64; | |||
CarlaString bridge_win32; | |||
CarlaString bridge_win64; | |||
CarlaString bridge_lv2gtk2; | |||
CarlaString bridge_lv2gtk3; | |||
CarlaString bridge_lv2qt4; | |||
CarlaString bridge_lv2qt5; | |||
CarlaString bridge_lv2cocoa; | |||
CarlaString bridge_lv2win; | |||
CarlaString bridge_lv2x11; | |||
CarlaString bridge_vstcocoa; | |||
CarlaString bridge_vsthwnd; | |||
CarlaString bridge_vstx11; | |||
CarlaEngineOptions() | |||
: processMode(PROCESS_MODE_CONTINUOUS_RACK), | |||
processHighPrecision(false), | |||
maxParameters(MAX_PARAMETERS), | |||
preferredBufferSize(512), | |||
preferredSampleRate(44100), | |||
forceStereo(false), | |||
useDssiVstChunks(false), | |||
preferPluginBridges(false), | |||
preferUiBridges(true), | |||
oscUiTimeout(4000/100) {} | |||
}; | |||
// ----------------------------------------------------------------------- | |||
/*! | |||
* Engine port (Base).\n | |||
* This is the base class for all Carla engine ports. | |||
*/ | |||
class CarlaEngineBasePort | |||
{ | |||
public: | |||
/*! | |||
* The contructor.\n | |||
* Param \a isInput defines wherever this is an input port or not (output otherwise).\n | |||
* Input/output state is constant for the lifetime of the port. | |||
*/ | |||
CarlaEngineBasePort(const bool isInput, const ProcessMode processMode); | |||
/*! | |||
* The decontructor. | |||
*/ | |||
virtual ~CarlaEngineBasePort(); | |||
/*! | |||
* Get the type of the port, as provided by the respective subclasses. | |||
*/ | |||
virtual CarlaEnginePortType type() const = 0; | |||
/*! | |||
* Initialize the port's internal buffer for \a engine. | |||
*/ | |||
virtual void initBuffer(CarlaEngine* const engine) = 0; | |||
protected: | |||
const bool isInput; | |||
const ProcessMode processMode; | |||
void* buffer; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
/*! | |||
* Engine port (Audio). | |||
*/ | |||
class CarlaEngineAudioPort : public CarlaEngineBasePort | |||
{ | |||
public: | |||
/*! | |||
* The contructor.\n | |||
* Param \a isInput defines wherever this is an input port or not (output otherwise).\n | |||
* Input/output state is constant for the lifetime of the port. | |||
*/ | |||
CarlaEngineAudioPort(const bool isInput, const ProcessMode processMode); | |||
/*! | |||
* The decontructor. | |||
*/ | |||
virtual ~CarlaEngineAudioPort(); | |||
/*! | |||
* Get the type of the port, in this case CarlaEnginePortTypeAudio. | |||
*/ | |||
CarlaEnginePortType type() const | |||
{ | |||
return CarlaEnginePortTypeAudio; | |||
} | |||
/*! | |||
* Initialize the port's internal buffer for \a engine. | |||
*/ | |||
virtual void initBuffer(CarlaEngine* const engine); | |||
}; | |||
// ----------------------------------------------------------------------- | |||
/*! | |||
* Engine port (Control). | |||
*/ | |||
class CarlaEngineControlPort : public CarlaEngineBasePort | |||
{ | |||
public: | |||
/*! | |||
* The contructor.\n | |||
* Param \a isInput defines wherever this is an input port or not (output otherwise).\n | |||
* Input/output state is constant for the lifetime of the port. | |||
*/ | |||
CarlaEngineControlPort(const bool isInput, const ProcessMode processMode); | |||
/*! | |||
* The decontructor. | |||
*/ | |||
virtual ~CarlaEngineControlPort(); | |||
/*! | |||
* Get the type of the port, in this case CarlaEnginePortTypeControl. | |||
*/ | |||
CarlaEnginePortType type() const | |||
{ | |||
return CarlaEnginePortTypeControl; | |||
} | |||
/*! | |||
* Initialize the port's internal buffer for \a engine. | |||
*/ | |||
virtual void initBuffer(CarlaEngine* const engine); | |||
/*! | |||
* Get the number of control events present in the buffer. | |||
* \note You must only call this for input ports. | |||
*/ | |||
virtual uint32_t getEventCount(); | |||
/*! | |||
* Get the control event at \a index. | |||
** \note You must only call this for input ports. | |||
*/ | |||
virtual const CarlaEngineControlEvent* getEvent(const uint32_t index); | |||
/*! | |||
* Write a control event to the buffer.\n | |||
* Arguments are the same as in the CarlaEngineControlEvent struct. | |||
** \note You must only call this for output ports. | |||
*/ | |||
virtual void writeEvent(const CarlaEngineControlEventType type, const uint32_t time, const uint8_t channel, const uint16_t parameter, const double value); | |||
}; | |||
// ----------------------------------------------------------------------- | |||
/*! | |||
* Engine port (MIDI). | |||
*/ | |||
class CarlaEngineMidiPort : public CarlaEngineBasePort | |||
{ | |||
public: | |||
/*! | |||
* The contructor.\n | |||
* Param \a isInput defines wherever this is an input port or not (output otherwise).\n | |||
* Input/output state is constant for the lifetime of the port. | |||
*/ | |||
CarlaEngineMidiPort(const bool isInput, const ProcessMode processMode); | |||
/*! | |||
* The decontructor. | |||
*/ | |||
virtual ~CarlaEngineMidiPort(); | |||
/*! | |||
* Get the type of the port, in this case CarlaEnginePortTypeMIDI. | |||
*/ | |||
CarlaEnginePortType type() const | |||
{ | |||
return CarlaEnginePortTypeMIDI; | |||
} | |||
/*! | |||
* Initialize the port's internal buffer for \a engine. | |||
*/ | |||
virtual void initBuffer(CarlaEngine* const engine); | |||
/*! | |||
* Get the number of MIDI events present in the buffer. | |||
* \note You must only call this for input ports. | |||
*/ | |||
virtual uint32_t getEventCount(); | |||
/*! | |||
* Get the MIDI event at \a index. | |||
** \note You must only call this for input ports. | |||
*/ | |||
virtual const CarlaEngineMidiEvent* getEvent(const uint32_t index); | |||
/*! | |||
* Write a MIDI event to the buffer.\n | |||
* Arguments are the same as in the CarlaEngineMidiEvent struct. | |||
** \note You must only call this for output ports. | |||
*/ | |||
virtual void writeEvent(const uint32_t time, const uint8_t* const data, const uint8_t size); | |||
}; | |||
// ----------------------------------------------------------------------- | |||
/*! | |||
* Engine client.\n | |||
* Each plugin requires one client from the engine (created via CarlaEngine::addPort()).\n | |||
* \note This is a virtual class, each engine type provides its own funtionality. | |||
*/ | |||
class CarlaEngineClient | |||
{ | |||
public: | |||
/*! | |||
* The contructor.\n | |||
* All constructor parameters are constant and will never change in the lifetime of the client.\n | |||
* Client starts in deactivated state. | |||
*/ | |||
CarlaEngineClient(const CarlaEngineType engineType, const ProcessMode processMode); | |||
/*! | |||
* The decontructor. | |||
*/ | |||
virtual ~CarlaEngineClient(); | |||
/*! | |||
* Activate this client.\n | |||
* \note Client must be deactivated before calling this function. | |||
*/ | |||
virtual void activate(); | |||
/*! | |||
* Deactivate this client.\n | |||
* \note Client must be activated before calling this function. | |||
*/ | |||
virtual void deactivate(); | |||
/*! | |||
* Check if the client is activated. | |||
*/ | |||
virtual bool isActive() const; | |||
/*! | |||
* Check if the client is ok.\n | |||
* Plugins will refuse to instantiate if this returns false. | |||
* \note This is always true in rack and patchbay processing modes. | |||
*/ | |||
virtual bool isOk() const; | |||
/*! | |||
* Get the current latency, in samples. | |||
*/ | |||
virtual uint32_t getLatency() const; | |||
/*! | |||
* Change the client's latency. | |||
*/ | |||
virtual void setLatency(const uint32_t samples); | |||
/*! | |||
* Add a new port of type \a portType. | |||
* \note This function does nothing in rack processing mode since its ports are static (2 audio, 1 midi and 1 control for both input and output). | |||
*/ | |||
virtual const CarlaEngineBasePort* addPort(const CarlaEnginePortType portType, const char* const name, const bool isInput) = 0; | |||
protected: | |||
const CarlaEngineType engineType; | |||
const ProcessMode processMode; | |||
private: | |||
bool m_active; | |||
uint32_t m_latency; | |||
}; | |||
// ----------------------------------------------------------------------- | |||
/*! | |||
* Carla Engine. | |||
* \note This is a virtual class for all available engine types available in Carla. | |||
*/ | |||
class CarlaEngine | |||
{ | |||
public: | |||
/*! | |||
* The decontructor. | |||
* The engine must have been closed before this happens. | |||
*/ | |||
virtual ~CarlaEngine(); | |||
// ------------------------------------------------------------------- | |||
// Static values and calls | |||
/*! | |||
* Maximum number of peaks per plugin.\n | |||
* \note There are both input and output peaks. | |||
*/ | |||
static const unsigned short MAX_PEAKS = 2; | |||
/*! | |||
* Get the number of available engine drivers. | |||
*/ | |||
static unsigned int getDriverCount(); | |||
/*! | |||
* Get the name of the engine driver at \a index. | |||
*/ | |||
static const char* getDriverName(unsigned int index); | |||
/*! | |||
* Create a new engine, using driver \a driverName.\n | |||
* Returned variable must be deleted when no longer needed. | |||
*/ | |||
static CarlaEngine* newDriverByName(const char* const driverName); | |||
// ------------------------------------------------------------------- | |||
// Maximum values | |||
/*! | |||
* Maximum client name size. | |||
*/ | |||
virtual int maxClientNameSize(); | |||
/*! | |||
* Maximum port name size. | |||
*/ | |||
virtual int maxPortNameSize(); | |||
/*! | |||
* Maximum number of loadable plugins. | |||
* \note This function returns 0 if engine is not started. | |||
*/ | |||
unsigned short maxPluginNumber() const; | |||
// ------------------------------------------------------------------- | |||
// Virtual, per-engine type calls | |||
/*! | |||
* Initialize engine, using \a clientName. | |||
*/ | |||
virtual bool init(const char* const clientName); | |||
/*! | |||
* Close engine. | |||
*/ | |||
virtual bool close(); | |||
/*! | |||
* Check if engine is running. | |||
*/ | |||
virtual bool isRunning() const = 0; | |||
/*! | |||
* Check if engine is running offline (aka freewheel mode). | |||
*/ | |||
virtual bool isOffline() const = 0; | |||
/*! | |||
* Get engine type. | |||
*/ | |||
virtual CarlaEngineType type() const = 0; | |||
/*! | |||
* Add new engine client. | |||
* \note This must only be called within a plugin class. | |||
*/ | |||
virtual CarlaEngineClient* addClient(CarlaPlugin* const plugin) = 0; | |||
// ------------------------------------------------------------------- | |||
// Plugin management | |||
/*! | |||
* Get next available plugin id.\n | |||
* Returns -1 if no more plugins can be loaded. | |||
*/ | |||
short getNewPluginId() const; | |||
/*! | |||
* Get plugin with id \a id. | |||
*/ | |||
CarlaPlugin* getPlugin(const unsigned short id) const; | |||
/*! | |||
* Get plugin with id \a id, faster unchecked version. | |||
*/ | |||
CarlaPlugin* getPluginUnchecked(const unsigned short id) const; | |||
/*! | |||
* Get a unique plugin name within the engine.\n | |||
* Returned variable must be free'd when no longer needed. | |||
*/ | |||
const char* getUniquePluginName(const char* const name); | |||
/*! | |||
* Add new plugin.\n | |||
* Returns the id of the plugin, or -1 if the operation failed. | |||
*/ | |||
short addPlugin(const BinaryType btype, const PluginType ptype, const char* const filename, const char* const name, const char* const label, void* const extra = nullptr); | |||
/*! | |||
* Add new plugin, using native binary type.\n | |||
* Returns the id of the plugin, or -1 if the operation failed. | |||
*/ | |||
short addPlugin(const PluginType ptype, const char* const filename, const char* const name, const char* const label, void* const extra = nullptr); | |||
/*! | |||
* Remove plugin with id \a id. | |||
*/ | |||
bool removePlugin(const unsigned short id); | |||
/*! | |||
* Remove all plugins. | |||
*/ | |||
void removeAllPlugins(); | |||
/*! | |||
* Idle all plugins GUIs. | |||
*/ | |||
void idlePluginGuis(); | |||
// bridge, internal use only | |||
// TODO - find a better way for this | |||
void __bridgePluginRegister(const unsigned short id, CarlaPlugin* const plugin) | |||
{ | |||
m_carlaPlugins[id] = plugin; | |||
} | |||
// ------------------------------------------------------------------- | |||
// Information (base) | |||
/*! | |||
* Get engine name. | |||
*/ | |||
const char* getName() const; | |||
/*! | |||
* Get current sample rate. | |||
*/ | |||
double getSampleRate() const; | |||
/*! | |||
* Get current buffer size. | |||
*/ | |||
uint32_t getBufferSize() const; | |||
/*! | |||
* Get current Time information. | |||
*/ | |||
const CarlaEngineTimeInfo* getTimeInfo() const; | |||
/*! | |||
* Tell the engine it's about to close.\n | |||
* This is used to prevent the engine thread from reactivating. | |||
*/ | |||
void aboutToClose(); | |||
// ------------------------------------------------------------------- | |||
// Information (audio peaks) | |||
double getInputPeak(const unsigned short pluginId, const unsigned short id) const; | |||
double getOutputPeak(const unsigned short pluginId, const unsigned short id) const; | |||
void setInputPeak(const unsigned short pluginId, const unsigned short id, double value); | |||
void setOutputPeak(const unsigned short pluginId, const unsigned short id, double value); | |||
// ------------------------------------------------------------------- | |||
// Callback | |||
void callback(const CallbackType action, const unsigned short pluginId, const int value1, const int value2, const double value3, const char* const valueStr); | |||
void setCallback(const CallbackFunc func, void* const ptr); | |||
// ------------------------------------------------------------------- | |||
// Error handling | |||
/*! | |||
* Get last error. | |||
*/ | |||
const char* getLastError() const; | |||
/*! | |||
* Set last error. | |||
*/ | |||
void setLastError(const char* const error); | |||
// ------------------------------------------------------------------- | |||
// Options | |||
/*! | |||
* Get the engine options (read-only). | |||
*/ | |||
const CarlaEngineOptions& getOptions() const | |||
{ | |||
return options; | |||
} | |||
#ifndef BUILD_BRIDGE | |||
/*! | |||
* Get the engine options as process environment. | |||
*/ | |||
const QProcessEnvironment& getOptionsAsProcessEnvironment() const | |||
{ | |||
return m_procEnv; | |||
} | |||
/*! | |||
* Set the engine option \a option. | |||
*/ | |||
void setOption(const OptionsType option, const int value, const char* const valueStr); | |||
#endif | |||
// ------------------------------------------------------------------- | |||
// Mutex locks | |||
/*! | |||
* Lock processing. | |||
*/ | |||
void processLock(); | |||
/*! | |||
* Try Lock processing. | |||
*/ | |||
void processTryLock(); | |||
/*! | |||
* Unlock processing. | |||
*/ | |||
void processUnlock(); | |||
/*! | |||
* Lock MIDI. | |||
*/ | |||
void midiLock(); | |||
/*! | |||
* Try Lock MIDI. | |||
*/ | |||
void midiTryLock(); | |||
/*! | |||
* Unlock MIDI. | |||
*/ | |||
void midiUnlock(); | |||
// ------------------------------------------------------------------- | |||
// OSC Stuff | |||
#ifndef BUILD_BRIDGE | |||
/*! | |||
* Check if OSC controller is registered. | |||
*/ | |||
bool isOscControlRegistered() const; | |||
#else | |||
/*! | |||
* Check if OSC bridge is registered. | |||
*/ | |||
bool isOscBridgeRegistered() const; | |||
#endif | |||
/*! | |||
* Idle OSC. | |||
*/ | |||
void idleOsc(); | |||
/*! | |||
* Get OSC TCP server path. | |||
*/ | |||
const char* getOscServerPathTCP() const; | |||
/*! | |||
* Get OSC UDP server path. | |||
*/ | |||
const char* getOscServerPathUDP() const; | |||
#ifdef BUILD_BRIDGE | |||
/*! | |||
* Set OSC bridge data. | |||
*/ | |||
void setOscBridgeData(const CarlaOscData* const oscData); | |||
#endif | |||
#ifdef BUILD_BRIDGE | |||
void osc_send_peaks(CarlaPlugin* const plugin); | |||
#else | |||
void osc_send_peaks(CarlaPlugin* const plugin, const unsigned short& id); | |||
#endif | |||
#ifdef BUILD_BRIDGE | |||
void osc_send_bridge_audio_count(const int32_t ins, const int32_t outs, const int32_t total); | |||
void osc_send_bridge_midi_count(const int32_t ins, const int32_t outs, const int32_t total); | |||
void osc_send_bridge_parameter_count(const int32_t ins, const int32_t outs, const int32_t total); | |||
void osc_send_bridge_program_count(const int32_t count); | |||
void osc_send_bridge_midi_program_count(const int32_t count); | |||
void osc_send_bridge_plugin_info(const int32_t category, const int32_t hints, const char* const name, const char* const label, const char* const maker, const char* const copyright, const int64_t uniqueId); | |||
void osc_send_bridge_parameter_info(const int32_t index, const char* const name, const char* const unit); | |||
void osc_send_bridge_parameter_data(const int32_t index, const int32_t type, const int32_t rindex, const int32_t hints, const int32_t midiChannel, const int32_t midiCC); | |||
void osc_send_bridge_parameter_ranges(const int32_t index, const double def, const double min, const double max, const double step, const double stepSmall, const double stepLarge); | |||
void osc_send_bridge_program_info(const int32_t index, const char* const name); | |||
void osc_send_bridge_midi_program_info(const int32_t index, const int32_t bank, const int32_t program, const char* const label); | |||
void osc_send_bridge_configure(const char* const key, const char* const value); | |||
void osc_send_bridge_set_parameter_value(const int32_t index, const double value); | |||
void osc_send_bridge_set_default_value(const int32_t index, const double value); | |||
void osc_send_bridge_set_program(const int32_t index); | |||
void osc_send_bridge_set_midi_program(const int32_t index); | |||
void osc_send_bridge_set_custom_data(const char* const type, const char* const key, const char* const value); | |||
void osc_send_bridge_set_chunk_data(const char* const chunkFile); | |||
void osc_send_bridge_set_inpeak(const int32_t portId); | |||
void osc_send_bridge_set_outpeak(const int32_t portId); | |||
#else | |||
void osc_send_control_add_plugin_start(const int32_t pluginId, const char* const pluginName); | |||
void osc_send_control_add_plugin_end(const int32_t pluginId); | |||
void osc_send_control_remove_plugin(const int32_t pluginId); | |||
void osc_send_control_set_plugin_data(const int32_t pluginId, const int32_t type, const int32_t category, const int32_t hints, const char* const realName, const char* const label, const char* const maker, const char* const copyright, const int64_t uniqueId); | |||
void osc_send_control_set_plugin_ports(const int32_t pluginId, const int32_t audioIns, const int32_t audioOuts, const int32_t midiIns, const int32_t midiOuts, const int32_t cIns, const int32_t cOuts, const int32_t cTotals); | |||
void osc_send_control_set_parameter_data(const int32_t pluginId, const int32_t index, const int32_t type, const int32_t hints, const char* const name, const char* const label, const double current); | |||
void osc_send_control_set_parameter_ranges(const int32_t pluginId, const int32_t index, const double min, const double max, const double def, const double step, const double stepSmall, const double stepLarge); | |||
void osc_send_control_set_parameter_midi_cc(const int32_t pluginId, const int32_t index, const int32_t cc); | |||
void osc_send_control_set_parameter_midi_channel(const int32_t pluginId, const int32_t index, const int32_t channel); | |||
void osc_send_control_set_parameter_value(const int32_t pluginId, const int32_t index, const double value); | |||
void osc_send_control_set_default_value(const int32_t pluginId, const int32_t index, const double value); | |||
void osc_send_control_set_program(const int32_t pluginId, const int32_t index); | |||
void osc_send_control_set_program_count(const int32_t pluginId, const int32_t count); | |||
void osc_send_control_set_program_name(const int32_t pluginId, const int32_t index, const char* const name); | |||
void osc_send_control_set_midi_program(const int32_t pluginId, const int32_t index); | |||
void osc_send_control_set_midi_program_count(const int32_t pluginId, const int32_t count); | |||
void osc_send_control_set_midi_program_data(const int32_t pluginId, const int32_t index, const int32_t bank, const int32_t program, const char* const name); | |||
void osc_send_control_note_on(const int32_t pluginId, const int32_t channel, const int32_t note, const int32_t velo); | |||
void osc_send_control_note_off(const int32_t pluginId, const int32_t channel, const int32_t note); | |||
void osc_send_control_set_input_peak_value(const int32_t pluginId, const int32_t portId); | |||
void osc_send_control_set_output_peak_value(const int32_t pluginId, const int32_t portId); | |||
void osc_send_control_exit(); | |||
#endif | |||
#ifndef BUILD_BRIDGE | |||
// ------------------------------------------------------------------- | |||
// Rack mode | |||
static const unsigned short MAX_CONTROL_EVENTS = 512; | |||
static const unsigned short MAX_MIDI_EVENTS = 512; | |||
CarlaEngineControlEvent rackControlEventsIn[MAX_CONTROL_EVENTS]; | |||
CarlaEngineControlEvent rackControlEventsOut[MAX_CONTROL_EVENTS]; | |||
CarlaEngineMidiEvent rackMidiEventsIn[MAX_MIDI_EVENTS]; | |||
CarlaEngineMidiEvent rackMidiEventsOut[MAX_MIDI_EVENTS]; | |||
#endif | |||
// ------------------------------------- | |||
/*! | |||
* \class ScopedLocker | |||
* | |||
* \brief Carla engine scoped locker | |||
* | |||
* This is a handy class that temporarily locks an engine during a function scope. | |||
*/ | |||
class ScopedLocker | |||
{ | |||
public: | |||
/*! | |||
* Lock the engine \a engine if \a lock is true. | |||
* The engine is unlocked in the deconstructor of this class if \a lock is true. | |||
* | |||
* \param engine The engine to lock | |||
* \param lock Wherever to lock the engine or not, true by default | |||
*/ | |||
ScopedLocker(CarlaEngine* const engine, bool lock = true) | |||
: mutex(&engine->m_procLock), | |||
m_lock(lock) | |||
{ | |||
if (m_lock) | |||
mutex->lock(); | |||
} | |||
~ScopedLocker() | |||
{ | |||
if (m_lock) | |||
mutex->unlock(); | |||
} | |||
private: | |||
QMutex* const mutex; | |||
const bool m_lock; | |||
}; | |||
// ------------------------------------- | |||
protected: | |||
/*! | |||
* The contructor, protected.\n | |||
* \note This only initializes engine data, it doesn't initialize the engine itself. | |||
*/ | |||
CarlaEngine(); | |||
#ifndef BUILD_BRIDGE | |||
/*! | |||
* Proccess audio buffer in rack mode, protected. | |||
*/ | |||
void processRack(float* inBuf[2], float* outBuf[2], const uint32_t frames); | |||
#endif | |||
CarlaEngineOptions options; | |||
CarlaString name; | |||
uint32_t bufferSize; | |||
double sampleRate; | |||
CarlaEngineTimeInfo timeInfo; | |||
void bufferSizeChanged(const uint32_t newBufferSize); | |||
private: | |||
CarlaEngineOsc m_osc; | |||
CarlaEngineThread m_thread; | |||
const CarlaOscData* m_oscData; | |||
CallbackFunc m_callback; | |||
void* m_callbackPtr; | |||
CarlaString m_lastError; | |||
#ifndef BUILD_BRIDGE | |||
QProcessEnvironment m_procEnv; | |||
#endif | |||
QMutex m_procLock; | |||
QMutex m_midiLock; | |||
CarlaPlugin* m_carlaPlugins[MAX_PLUGINS]; | |||
const char* m_uniqueNames[MAX_PLUGINS]; | |||
double m_insPeak[MAX_PLUGINS * MAX_PEAKS]; | |||
double m_outsPeak[MAX_PLUGINS * MAX_PEAKS]; | |||
bool m_aboutToClose; | |||
unsigned short m_maxPluginNumber; | |||
#ifdef CARLA_ENGINE_JACK | |||
static CarlaEngine* newJack(); | |||
#endif | |||
#ifdef CARLA_ENGINE_RTAUDIO | |||
enum RtAudioApi { | |||
RTAUDIO_DUMMY = 0, | |||
RTAUDIO_LINUX_ALSA = 1, | |||
RTAUDIO_LINUX_PULSE = 2, | |||
RTAUDIO_LINUX_OSS = 3, | |||
RTAUDIO_UNIX_JACK = 4, | |||
RTAUDIO_MACOSX_CORE = 5, | |||
RTAUDIO_WINDOWS_ASIO = 6, | |||
RTAUDIO_WINDOWS_DS = 7 | |||
}; | |||
static CarlaEngine* newRtAudio(RtAudioApi api); | |||
static unsigned int getRtAudioApiCount(); | |||
static const char* getRtAudioApiName(unsigned int index); | |||
#endif | |||
}; | |||
// ----------------------------------------------------------------------- | |||
/**@}*/ | |||
CARLA_BACKEND_END_NAMESPACE | |||
#endif // CARLA_ENGINE_HPP |
@@ -1,71 +0,0 @@ | |||
# QtCreator project file | |||
QT = core | |||
CONFIG = debug | |||
CONFIG += static | |||
CONFIG += link_pkgconfig qt warn_on | |||
DEFINES = DEBUG | |||
DEFINES += QTCREATOR_TEST | |||
# JACK | |||
DEFINES += CARLA_ENGINE_JACK | |||
# RtAudio/RtMidi | |||
DEFINES += CARLA_ENGINE_RTAUDIO HAVE_GETTIMEOFDAY _FORTIFY_SOURCE=2 | |||
DEFINES += __LINUX_ALSA__ __LINUX_ALSASEQ__ __LINUX_PULSE__ __UNIX_JACK__ | |||
DEFINES += __RTAUDIO_DEBUG__ __RTMIDI_DEBUG__ | |||
# DISTRHO Plugin | |||
DEFINES += CARLA_ENGINE_PLUGIN | |||
DEFINES += DISTRHO_PLUGIN_TARGET_DSSI | |||
# Misc | |||
DEFINES += WANT_LV2 | |||
PKGCONFIG = liblo jack alsa libpulse-simple | |||
TARGET = carla_engine | |||
TEMPLATE = lib | |||
VERSION = 0.5.0 | |||
SOURCES = \ | |||
carla_engine.cpp \ | |||
carla_engine_osc.cpp \ | |||
carla_engine_thread.cpp \ | |||
jack.cpp \ | |||
rtaudio.cpp \ | |||
plugin.cpp | |||
HEADERS = \ | |||
carla_engine.hpp \ | |||
carla_engine_osc.hpp \ | |||
carla_engine_thread.hpp | |||
HEADERS += \ | |||
DistrhoPluginInfo.h | |||
INCLUDEPATH = . \ | |||
../carla-backend \ | |||
../carla-includes \ | |||
../carla-plugin \ | |||
../carla-utils | |||
# FIXME | |||
INCLUDEPATH += \ | |||
/opt/kxstudio/include | |||
# JACK | |||
INCLUDEPATH += ../carla-jackbridge | |||
# RtAudio/RtMidi | |||
INCLUDEPATH += rtaudio-4.0.11 | |||
INCLUDEPATH += rtmidi-2.0.1 | |||
SOURCES += rtaudio-4.0.11/RtAudio.cpp | |||
SOURCES += rtmidi-2.0.1/RtMidi.cpp | |||
# Plugin | |||
INCLUDEPATH += ../distrho-plugin-toolkit | |||
QMAKE_CXXFLAGS *= -std=c++0x |
@@ -1,683 +0,0 @@ | |||
/* | |||
* Carla Engine OSC | |||
* Copyright (C) 2011-2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#include "carla_engine.hpp" | |||
#include "carla_plugin.hpp" | |||
CARLA_BACKEND_START_NAMESPACE | |||
// ----------------------------------------------------------------------- | |||
CarlaEngineOsc::CarlaEngineOsc(CarlaEngine* const engine_) | |||
: engine(engine_) | |||
{ | |||
qDebug("CarlaEngineOsc::CarlaEngineOsc(%p)", engine); | |||
CARLA_ASSERT(engine); | |||
m_name = nullptr; | |||
m_nameSize = 0; | |||
m_serverTCP = nullptr; | |||
m_serverUDP = nullptr; | |||
} | |||
CarlaEngineOsc::~CarlaEngineOsc() | |||
{ | |||
qDebug("CarlaEngineOsc::~CarlaEngineOsc()"); | |||
CARLA_ASSERT(! m_name); | |||
CARLA_ASSERT(! m_serverTCP); | |||
CARLA_ASSERT(! m_serverUDP); | |||
} | |||
// ----------------------------------------------------------------------- | |||
void CarlaEngineOsc::init(const char* const name) | |||
{ | |||
qDebug("CarlaEngineOsc::init(\"%s\")", name); | |||
CARLA_ASSERT(! m_name); | |||
CARLA_ASSERT(! m_serverTCP); | |||
CARLA_ASSERT(! m_serverUDP); | |||
CARLA_ASSERT(m_nameSize == 0); | |||
CARLA_ASSERT(m_serverPathTCP.isEmpty()); | |||
CARLA_ASSERT(m_serverPathUDP.isEmpty()); | |||
CARLA_ASSERT(name); | |||
m_name = strdup(name ? name : ""); | |||
m_nameSize = strlen(m_name); | |||
m_serverTCP = lo_server_new_with_proto(nullptr, LO_TCP, osc_error_handlerTCP); | |||
m_serverUDP = lo_server_new_with_proto(nullptr, LO_UDP, osc_error_handlerUDP); | |||
if (m_serverTCP) | |||
{ | |||
if (char* const serverPathTCP = lo_server_get_url(m_serverTCP)) | |||
{ | |||
m_serverPathTCP = serverPathTCP; | |||
m_serverPathTCP += m_name; | |||
free(serverPathTCP); | |||
} | |||
lo_server_add_method(m_serverTCP, nullptr, nullptr, osc_message_handler, this); | |||
} | |||
if (m_serverUDP) | |||
{ | |||
if (char* const serverPathUDP = lo_server_get_url(m_serverUDP)) | |||
{ | |||
m_serverPathUDP = serverPathUDP; | |||
m_serverPathUDP += m_name; | |||
free(serverPathUDP); | |||
} | |||
lo_server_add_method(m_serverUDP, nullptr, nullptr, osc_message_handler, this); | |||
} | |||
} | |||
void CarlaEngineOsc::idle() | |||
{ | |||
if (m_serverTCP) | |||
{ | |||
while (lo_server_recv_noblock(m_serverTCP, 0) != 0) {} | |||
} | |||
if (m_serverUDP) | |||
{ | |||
while (lo_server_recv_noblock(m_serverUDP, 0) != 0) {} | |||
} | |||
} | |||
void CarlaEngineOsc::close() | |||
{ | |||
qDebug("CarlaEngineOsc::close()"); | |||
CARLA_ASSERT(m_name); | |||
CARLA_ASSERT(m_serverTCP); | |||
CARLA_ASSERT(m_serverUDP); | |||
CARLA_ASSERT(m_serverPathTCP.isNotEmpty()); | |||
CARLA_ASSERT(m_serverPathUDP.isNotEmpty()); | |||
m_nameSize = 0; | |||
if (m_name) | |||
{ | |||
free(m_name); | |||
m_name = nullptr; | |||
} | |||
if (m_serverTCP) | |||
{ | |||
lo_server_del_method(m_serverTCP, nullptr, nullptr); | |||
lo_server_free(m_serverTCP); | |||
m_serverTCP = nullptr; | |||
} | |||
if (m_serverUDP) | |||
{ | |||
lo_server_del_method(m_serverUDP, nullptr, nullptr); | |||
lo_server_free(m_serverUDP); | |||
m_serverUDP = nullptr; | |||
} | |||
m_serverPathTCP.clear(); | |||
m_serverPathUDP.clear(); | |||
#ifndef BUILD_BRIDGE | |||
m_controlData.free(); | |||
#endif | |||
} | |||
// ----------------------------------------------------------------------- | |||
int CarlaEngineOsc::handleMessage(const char* const path, const int argc, const lo_arg* const* const argv, const char* const types, const lo_message msg) | |||
{ | |||
#if DEBUG | |||
if (! QString(path).endsWith("peak")) | |||
qDebug("CarlaEngineOsc::handleMessage(%s, %i, %p, %s, %p)", path, argc, argv, types, msg); | |||
#endif | |||
CARLA_ASSERT(m_name); | |||
CARLA_ASSERT(m_serverTCP || m_serverUDP); | |||
CARLA_ASSERT(m_serverPathTCP.isNotEmpty() || m_serverPathUDP.isNotEmpty()); | |||
CARLA_ASSERT(path); | |||
if (! path) | |||
{ | |||
qCritical("CarlaEngineOsc::handleMessage() - got invalid path"); | |||
return 1; | |||
} | |||
if (! m_name) | |||
{ | |||
qCritical("CarlaEngineOsc::handleMessage(\"%s\", ...) - received message but client is offline", path); | |||
return 1; | |||
} | |||
#ifndef BUILD_BRIDGE | |||
// Initial path check | |||
if (strcmp(path, "/register") == 0) | |||
{ | |||
const lo_address source = lo_message_get_source(msg); | |||
return handleMsgRegister(argc, argv, types, source); | |||
} | |||
if (strcmp(path, "/unregister") == 0) | |||
{ | |||
return handleMsgUnregister(); | |||
} | |||
#endif | |||
// Check if message is for this client | |||
if (strlen(path) <= m_nameSize || strncmp(path+1, m_name, m_nameSize) != 0) | |||
{ | |||
qWarning("CarlaEngineOsc::handleMessage() - message not for this client -> '%s' != '/%s/'", path, m_name); | |||
return 1; | |||
} | |||
// Get plugin id from message | |||
int pluginId = 0; | |||
if (std::isdigit(path[m_nameSize+2])) | |||
pluginId += path[m_nameSize+2]-'0'; | |||
if (std::isdigit(path[m_nameSize+3])) | |||
pluginId += (path[m_nameSize+3]-'0')*10; | |||
if (pluginId < 0 || pluginId > engine->maxPluginNumber()) | |||
{ | |||
qCritical("CarlaEngineOsc::handleMessage() - failed to get plugin, wrong id '%i'", pluginId); | |||
return 1; | |||
} | |||
// Get plugin | |||
CarlaPlugin* const plugin = engine->getPluginUnchecked(pluginId); | |||
if (plugin == nullptr || plugin->id() != pluginId) | |||
{ | |||
qWarning("CarlaEngineOsc::handleMessage() - invalid plugin id '%i', probably has been removed", pluginId); | |||
return 1; | |||
} | |||
// Get method from path, "/Carla/i/method" | |||
const int offset = (pluginId >= 10) ? 5 : 4; | |||
char method[32] = { 0 }; | |||
strncpy(method, path + (m_nameSize + offset), 31); | |||
if (method[0] == '\0') | |||
{ | |||
qWarning("CarlaEngineOsc::handleMessage(\"%s\", ...) - received message without method", path); | |||
return 1; | |||
} | |||
// Common OSC methods (DSSI and internal UIs) | |||
if (strcmp(method, "update") == 0) | |||
{ | |||
const lo_address source = lo_message_get_source(msg); | |||
return handleMsgUpdate(plugin, argc, argv, types, source); | |||
} | |||
if (strcmp(method, "configure") == 0) | |||
return handleMsgConfigure(plugin, argc, argv, types); | |||
if (strcmp(method, "control") == 0) | |||
return handleMsgControl(plugin, argc, argv, types); | |||
if (strcmp(method, "program") == 0) | |||
return handleMsgProgram(plugin, argc, argv, types); | |||
if (strcmp(method, "midi") == 0) | |||
return handleMsgMidi(plugin, argc, argv, types); | |||
if (strcmp(method, "exiting") == 0) | |||
return handleMsgExiting(plugin); | |||
#ifndef BUILD_BRIDGE | |||
// Internal methods | |||
if (strcmp(method, "set_active") == 0) | |||
return handleMsgSetActive(plugin, argc, argv, types); | |||
if (strcmp(method, "set_drywet") == 0) | |||
return handleMsgSetDryWet(plugin, argc, argv, types); | |||
if (strcmp(method, "set_volume") == 0) | |||
return handleMsgSetVolume(plugin, argc, argv, types); | |||
if (strcmp(method, "set_balance_left") == 0) | |||
return handleMsgSetBalanceLeft(plugin, argc, argv, types); | |||
if (strcmp(method, "set_balance_right") == 0) | |||
return handleMsgSetBalanceRight(plugin, argc, argv, types); | |||
if (strcmp(method, "set_parameter_value") == 0) | |||
return handleMsgSetParameterValue(plugin, argc, argv, types); | |||
if (strcmp(method, "set_parameter_midi_cc") == 0) | |||
return handleMsgSetParameterMidiCC(plugin, argc, argv, types); | |||
if (strcmp(method, "set_parameter_midi_channel") == 0) | |||
return handleMsgSetParameterMidiChannel(plugin, argc, argv, types); | |||
if (strcmp(method, "set_program") == 0) | |||
return handleMsgSetProgram(plugin, argc, argv, types); | |||
if (strcmp(method, "set_midi_program") == 0) | |||
return handleMsgSetMidiProgram(plugin, argc, argv, types); | |||
if (strcmp(method, "note_on") == 0) | |||
return handleMsgNoteOn(plugin, argc, argv, types); | |||
if (strcmp(method, "note_off") == 0) | |||
return handleMsgNoteOff(plugin, argc, argv, types); | |||
// Plugin Bridges | |||
if ((plugin->hints() & PLUGIN_IS_BRIDGE) > 0 && strlen(method) > 11 && strncmp(method, "bridge_", 7) == 0) | |||
{ | |||
if (strcmp(method+7, "set_inpeak") == 0) | |||
return handleMsgBridgeSetInPeak(plugin, argc, argv, types); | |||
if (strcmp(method+7, "set_outpeak") == 0) | |||
return handleMsgBridgeSetOutPeak(plugin, argc, argv, types); | |||
if (strcmp(method+7, "audio_count") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeAudioCount, argc, argv, types); | |||
if (strcmp(method+7, "midi_count") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeMidiCount, argc, argv, types); | |||
if (strcmp(method+7, "parameter_count") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeParameterCount, argc, argv, types); | |||
if (strcmp(method+7, "program_count") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeProgramCount, argc, argv, types); | |||
if (strcmp(method+7, "midi_program_count") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeMidiProgramCount, argc, argv, types); | |||
if (strcmp(method+7, "plugin_info") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgePluginInfo, argc, argv, types); | |||
if (strcmp(method+7, "parameter_info") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeParameterInfo, argc, argv, types); | |||
if (strcmp(method+7, "parameter_data") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeParameterData, argc, argv, types); | |||
if (strcmp(method+7, "parameter_ranges") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeParameterRanges, argc, argv, types); | |||
if (strcmp(method+7, "program_info") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeProgramInfo, argc, argv, types); | |||
if (strcmp(method+7, "midi_program_info") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeMidiProgramInfo, argc, argv, types); | |||
if (strcmp(method+7, "configure") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeConfigure, argc, argv, types); | |||
if (strcmp(method+7, "set_parameter_value") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeSetParameterValue, argc, argv, types); | |||
if (strcmp(method+7, "set_default_value") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeSetDefaultValue, argc, argv, types); | |||
if (strcmp(method+7, "set_program") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeSetProgram, argc, argv, types); | |||
if (strcmp(method+7, "set_midi_program") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeSetMidiProgram, argc, argv, types); | |||
if (strcmp(method+7, "set_custom_data") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeSetCustomData, argc, argv, types); | |||
if (strcmp(method+7, "set_chunk_data") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeSetChunkData, argc, argv, types); | |||
if (strcmp(method+7, "update") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeUpdateNow, argc, argv, types); | |||
if (strcmp(method+7, "error") == 0) | |||
return plugin->setOscBridgeInfo(PluginBridgeError, argc, argv, types); | |||
} | |||
#endif | |||
// Plugin-specific methods | |||
#ifdef WANT_LV2 | |||
if (strcmp(method, "lv2_atom_transfer") == 0) | |||
return handleMsgLv2AtomTransfer(plugin, argc, argv, types); | |||
if (strcmp(method, "lv2_event_transfer") == 0) | |||
return handleMsgLv2EventTransfer(plugin, argc, argv, types); | |||
#endif | |||
qWarning("CarlaEngineOsc::handleMessage() - unsupported OSC method '%s'", method); | |||
return 1; | |||
} | |||
// ----------------------------------------------------------------------- | |||
#ifndef BUILD_BRIDGE | |||
int CarlaEngineOsc::handleMsgRegister(const int argc, const lo_arg* const* const argv, const char* const types, const lo_address source) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgRegister()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(1, "s"); | |||
if (m_controlData.path) | |||
{ | |||
qWarning("CarlaEngineOsc::handleMsgRegister() - OSC backend already registered to %s", m_controlData.path); | |||
return 1; | |||
} | |||
const char* const url = (const char*)&argv[0]->s; | |||
const char* host; | |||
const char* port; | |||
qDebug("CarlaEngineOsc::handleMsgRegister() - OSC backend registered to %s", url); | |||
host = lo_address_get_hostname(source); | |||
port = lo_address_get_port(source); | |||
m_controlData.source = lo_address_new_with_proto(LO_TCP, host, port); | |||
host = lo_url_get_hostname(url); | |||
port = lo_url_get_port(url); | |||
m_controlData.path = lo_url_get_path(url); | |||
m_controlData.target = lo_address_new_with_proto(LO_TCP, host, port); | |||
free((void*)host); | |||
free((void*)port); | |||
for (unsigned short i=0; i < engine->maxPluginNumber(); i++) | |||
{ | |||
CarlaPlugin* const plugin = engine->getPluginUnchecked(i); | |||
if (plugin && plugin->enabled()) | |||
plugin->registerToOscClient(); | |||
} | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgUnregister() | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgUnregister()"); | |||
if (! m_controlData.path) | |||
{ | |||
qWarning("CarlaEngineOsc::handleMsgUnregister() - OSC backend is not registered yet"); | |||
return 1; | |||
} | |||
m_controlData.free(); | |||
return 0; | |||
} | |||
#endif | |||
// ----------------------------------------------------------------------- | |||
int CarlaEngineOsc::handleMsgUpdate(CARLA_ENGINE_OSC_HANDLE_ARGS2, const lo_address source) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgUpdate()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(1, "s"); | |||
const char* const url = (const char*)&argv[0]->s; | |||
plugin->updateOscData(source, url); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgConfigure(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgConfigure()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(2, "ss"); | |||
const char* const key = (const char*)&argv[0]->s; | |||
const char* const value = (const char*)&argv[1]->s; | |||
#ifdef DEBUG | |||
qDebug("CarlaEngineOsc::handleMsgConfigure(\"%s\", \"%s\")", key, value); | |||
#endif | |||
plugin->setCustomData(CUSTOM_DATA_STRING, key, value, false); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgControl(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgControl()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(2, "if"); | |||
const int rindex = argv[0]->i; | |||
const float value = argv[1]->f; | |||
plugin->setParameterValueByRIndex(rindex, value, false, true, true); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgProgram(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgProgram()"); | |||
if (argc == 2) | |||
{ | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(2, "ii"); | |||
const uint32_t bank_id = argv[0]->i; | |||
const uint32_t program_id = argv[1]->i; | |||
plugin->setMidiProgramById(bank_id, program_id, false, true, true, true); | |||
return 0; | |||
} | |||
else | |||
{ | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(1, "i"); | |||
const uint32_t program_id = argv[0]->i; | |||
if (program_id < plugin->programCount()) | |||
{ | |||
plugin->setProgram(program_id, false, true, true, true); | |||
return 0; | |||
} | |||
qCritical("CarlaEngineOsc::handleMsgProgram() - program_id '%i' out of bounds", program_id); | |||
} | |||
return 1; | |||
} | |||
int CarlaEngineOsc::handleMsgMidi(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgMidi()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(1, "m"); | |||
if (plugin->midiInCount() > 0) | |||
{ | |||
const uint8_t* const data = argv[0]->m; | |||
uint8_t status = data[1]; | |||
uint8_t channel = status & 0x0F; | |||
// Fix bad note-off | |||
if (MIDI_IS_STATUS_NOTE_ON(status) && data[3] == 0) | |||
status -= 0x10; | |||
if (MIDI_IS_STATUS_NOTE_OFF(status)) | |||
{ | |||
uint8_t note = data[2]; | |||
plugin->sendMidiSingleNote(channel, note, 0, false, true, true); | |||
} | |||
else if (MIDI_IS_STATUS_NOTE_ON(status)) | |||
{ | |||
uint8_t note = data[2]; | |||
uint8_t velo = data[3]; | |||
plugin->sendMidiSingleNote(channel, note, velo, false, true, true); | |||
} | |||
return 0; | |||
} | |||
qWarning("CarlaEngineOsc::handleMsgMidi() - recived midi when plugin has no midi inputs"); | |||
return 1; | |||
} | |||
int CarlaEngineOsc::handleMsgExiting(CARLA_ENGINE_OSC_HANDLE_ARGS1) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgExiting()"); | |||
// TODO - check for non-UIs (dssi-vst) and set to -1 instead | |||
engine->callback(CALLBACK_SHOW_GUI, plugin->id(), 0, 0, 0.0, nullptr); | |||
plugin->freeOscData(); | |||
return 0; | |||
} | |||
// ----------------------------------------------------------------------- | |||
#ifndef BUILD_BRIDGE | |||
int CarlaEngineOsc::handleMsgSetActive(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgSetActive()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(1, "i"); | |||
const bool active = (bool)argv[0]->i; | |||
plugin->setActive(active, false, true); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgSetDryWet(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgSetDryWet()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(1, "f"); | |||
const float value = argv[0]->f; | |||
plugin->setDryWet(value, false, true); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgSetVolume(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgSetVolume()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(1, "f"); | |||
const float value = argv[0]->f; | |||
plugin->setVolume(value, false, true); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgSetBalanceLeft(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgSetBalanceLeft()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(1, "f"); | |||
const float value = argv[0]->f; | |||
plugin->setBalanceLeft(value, false, true); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgSetBalanceRight(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgSetBalanceRight()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(1, "f"); | |||
const float value = argv[0]->f; | |||
plugin->setBalanceRight(value, false, true); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgSetParameterValue(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgSetParameterValue()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(2, "if"); | |||
const int32_t index = argv[0]->i; | |||
const float value = argv[1]->f; | |||
plugin->setParameterValue(index, value, true, false, true); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgSetParameterMidiCC(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgSetParameterMidiCC()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(2, "ii"); | |||
const int32_t index = argv[0]->i; | |||
const int32_t cc = argv[1]->i; | |||
plugin->setParameterMidiCC(index, cc, false, true); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgSetParameterMidiChannel(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgSetParameterMidiChannel()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(2, "ii"); | |||
const int32_t index = argv[0]->i; | |||
const int32_t channel = argv[1]->i; | |||
plugin->setParameterMidiChannel(index, channel, false, true); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgSetProgram(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgSetProgram()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(1, "i"); | |||
const int32_t index = argv[0]->i; | |||
plugin->setProgram(index, true, false, true, true); | |||
// parameters might have changed, send all param values back | |||
if (m_controlData.target && index >= 0) | |||
{ | |||
for (uint32_t i=0; i < plugin->parameterCount(); i++) | |||
engine->osc_send_control_set_parameter_value(plugin->id(), i, plugin->getParameterValue(i)); | |||
} | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgSetMidiProgram(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgSetMidiProgram()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(1, "i"); | |||
const int32_t index = argv[0]->i; | |||
plugin->setMidiProgram(index, true, false, true, true); | |||
// parameters might have changed, send all param values back | |||
if (m_controlData.target && index >= 0) | |||
{ | |||
for (uint32_t i=0; i < plugin->parameterCount(); i++) | |||
engine->osc_send_control_set_parameter_value(plugin->id(), i, plugin->getParameterValue(i)); | |||
} | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgNoteOn(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgNoteOn()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(3, "iii"); | |||
const int32_t channel = argv[0]->i; | |||
const int32_t note = argv[1]->i; | |||
const int32_t velo = argv[2]->i; | |||
plugin->sendMidiSingleNote(channel, note, velo, true, false, true); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgNoteOff(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
qDebug("CarlaEngineOsc::handleMsgNoteOff()"); | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(2, "ii"); | |||
const int32_t channel = argv[0]->i; | |||
const int32_t note = argv[1]->i; | |||
plugin->sendMidiSingleNote(channel, note, 0, true, false, true); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgBridgeSetInPeak(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(2, "id"); | |||
const int32_t index = argv[0]->i; | |||
const double value = argv[1]->d; | |||
engine->setInputPeak(plugin->id(), index-1, value); | |||
return 0; | |||
} | |||
int CarlaEngineOsc::handleMsgBridgeSetOutPeak(CARLA_ENGINE_OSC_HANDLE_ARGS2) | |||
{ | |||
CARLA_ENGINE_OSC_CHECK_OSC_TYPES(2, "id"); | |||
const int32_t index = argv[0]->i; | |||
const double value = argv[1]->d; | |||
engine->setOutputPeak(plugin->id(), index-1, value); | |||
return 0; | |||
} | |||
#endif | |||
CARLA_BACKEND_END_NAMESPACE |
@@ -1,169 +0,0 @@ | |||
/* | |||
* Carla Engine OSC | |||
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_ENGINE_OSC_HPP | |||
#define CARLA_ENGINE_OSC_HPP | |||
#include "carla_backend.hpp" | |||
#include "carla_osc_utils.hpp" | |||
#define CARLA_ENGINE_OSC_HANDLE_ARGS1 CarlaPlugin* const plugin | |||
#define CARLA_ENGINE_OSC_HANDLE_ARGS2 CarlaPlugin* const plugin, const int argc, const lo_arg* const* const argv, const char* const types | |||
#define CARLA_ENGINE_OSC_CHECK_OSC_TYPES(/* argc, types, */ argcToCompare, typesToCompare) \ | |||
/* check argument count */ \ | |||
if (argc != argcToCompare) \ | |||
{ \ | |||
qCritical("CarlaEngineOsc::%s() - argument count mismatch: %i != %i", __FUNCTION__, argc, argcToCompare); \ | |||
return 1; \ | |||
} \ | |||
if (argc > 0) \ | |||
{ \ | |||
/* check for nullness */ \ | |||
if (! (types && typesToCompare)) \ | |||
{ \ | |||
qCritical("CarlaEngineOsc::%s() - argument types are null", __FUNCTION__); \ | |||
return 1; \ | |||
} \ | |||
/* check argument types */ \ | |||
if (strcmp(types, typesToCompare) != 0) \ | |||
{ \ | |||
qCritical("CarlaEngineOsc::%s() - argument types mismatch: '%s' != '%s'", __FUNCTION__, types, typesToCompare); \ | |||
return 1; \ | |||
} \ | |||
} | |||
CARLA_BACKEND_START_NAMESPACE | |||
#if 0 | |||
} // Fix editor indentation | |||
#endif | |||
class CarlaEngineOsc | |||
{ | |||
public: | |||
CarlaEngineOsc(CarlaEngine* const engine); | |||
~CarlaEngineOsc(); | |||
void init(const char* const name); | |||
void idle(); | |||
void close(); | |||
// ------------------------------------------------------------------- | |||
#ifndef BUILD_BRIDGE | |||
bool isControlRegistered() const | |||
{ | |||
return bool(m_controlData.target); | |||
} | |||
const CarlaOscData* getControlData() const | |||
{ | |||
return &m_controlData; | |||
} | |||
#endif | |||
const char* getServerPathTCP() const | |||
{ | |||
return (const char*)m_serverPathTCP; | |||
} | |||
const char* getServerPathUDP() const | |||
{ | |||
return (const char*)m_serverPathUDP; | |||
} | |||
// ------------------------------------------------------------------- | |||
private: | |||
CarlaEngine* const engine; | |||
char* m_name; | |||
size_t m_nameSize; | |||
lo_server m_serverTCP; | |||
lo_server m_serverUDP; | |||
CarlaString m_serverPathTCP; | |||
CarlaString m_serverPathUDP; | |||
#ifndef BUILD_BRIDGE | |||
CarlaOscData m_controlData; // for carla-control | |||
#endif | |||
// ------------------------------------------------------------------- | |||
int handleMessage(const char* const path, const int argc, const lo_arg* const* const argv, const char* const types, const lo_message msg); | |||
#ifndef BUILD_BRIDGE | |||
int handleMsgRegister(const int argc, const lo_arg* const* const argv, const char* const types, const lo_address source); | |||
int handleMsgUnregister(); | |||
#endif | |||
int handleMsgUpdate(CARLA_ENGINE_OSC_HANDLE_ARGS2, const lo_address source); | |||
int handleMsgConfigure(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgControl(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgProgram(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgMidi(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgExiting(CARLA_ENGINE_OSC_HANDLE_ARGS1); | |||
#ifndef BUILD_BRIDGE | |||
int handleMsgSetActive(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetDryWet(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetVolume(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetBalanceLeft(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetBalanceRight(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetParameterValue(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetParameterMidiCC(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetParameterMidiChannel(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetProgram(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgSetMidiProgram(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgNoteOn(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgNoteOff(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgBridgeSetInPeak(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgBridgeSetOutPeak(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
#endif | |||
#ifdef WANT_LV2 | |||
int handleMsgLv2AtomTransfer(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
int handleMsgLv2EventTransfer(CARLA_ENGINE_OSC_HANDLE_ARGS2); | |||
#endif | |||
// ----------------------------------------------------------------------- | |||
static void osc_error_handlerTCP(const int num, const char* const msg, const char* const path) | |||
{ | |||
qWarning("CarlaEngineOsc::osc_error_handlerTCP(%i, \"%s\", \"%s\")", num, msg, path); | |||
} | |||
static void osc_error_handlerUDP(const int num, const char* const msg, const char* const path) | |||
{ | |||
qWarning("CarlaEngineOsc::osc_error_handlerUDP(%i, \"%s\", \"%s\")", num, msg, path); | |||
} | |||
static int osc_message_handler(const char* const path, const char* const types, lo_arg** const argv, const int argc, const lo_message msg, void* const userData) | |||
{ | |||
CARLA_ASSERT(userData); | |||
if (CarlaEngineOsc* const _this_ = (CarlaEngineOsc*)userData) | |||
return _this_->handleMessage(path, argc, argv, types, msg); | |||
return 1; | |||
} | |||
}; | |||
CARLA_BACKEND_END_NAMESPACE | |||
#endif // CARLA_ENGINE_OSC_HPP |
@@ -1,157 +0,0 @@ | |||
/* | |||
* Carla Engine Thread | |||
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#include "carla_engine.hpp" | |||
#include "carla_plugin.hpp" | |||
CARLA_BACKEND_START_NAMESPACE | |||
// ----------------------------------------------------------------------- | |||
CarlaEngineThread::CarlaEngineThread(CarlaEngine* const engine_, QObject* const parent) | |||
: QThread(parent), | |||
engine(engine_) | |||
{ | |||
qDebug("CarlaEngineThread::CarlaEngineThread(%p, %p)", engine, parent); | |||
CARLA_ASSERT(engine); | |||
m_stopNow = true; | |||
} | |||
CarlaEngineThread::~CarlaEngineThread() | |||
{ | |||
qDebug("CarlaEngineThread::~CarlaEngineThread()"); | |||
CARLA_ASSERT(m_stopNow); | |||
} | |||
// ----------------------------------------------------------------------- | |||
void CarlaEngineThread::startNow() | |||
{ | |||
qDebug("CarlaEngineThread::startNow()"); | |||
CARLA_ASSERT(m_stopNow); | |||
m_stopNow = false; | |||
start(QThread::HighPriority); | |||
} | |||
void CarlaEngineThread::stopNow() | |||
{ | |||
qDebug("CarlaEngineThread::stopNow()"); | |||
if (m_stopNow) | |||
return; | |||
m_stopNow = true; | |||
const ScopedLocker m(this); | |||
if (isRunning() && ! wait(200)) | |||
{ | |||
quit(); | |||
if (isRunning() && ! wait(300)) | |||
terminate(); | |||
} | |||
} | |||
// ----------------------------------------------------------------------- | |||
void CarlaEngineThread::run() | |||
{ | |||
qDebug("CarlaEngineThread::run()"); | |||
CARLA_ASSERT(engine->isRunning()); | |||
bool oscRegisted, usesSingleThread; | |||
unsigned short i; | |||
double value; | |||
while (engine->isRunning() && ! m_stopNow) | |||
{ | |||
const ScopedLocker m(this); | |||
#ifndef BUILD_BRIDGE | |||
oscRegisted = engine->isOscControlRegistered(); | |||
#else | |||
oscRegisted = engine->isOscBridgeRegistered(); | |||
#endif | |||
for (i=0; i < engine->maxPluginNumber(); i++) | |||
{ | |||
CarlaPlugin* const plugin = engine->getPluginUnchecked(i); | |||
if (! (plugin && plugin->enabled())) | |||
continue; | |||
#ifndef BUILD_BRIDGE | |||
const unsigned short id = plugin->id(); | |||
#endif | |||
usesSingleThread = (plugin->hints() & PLUGIN_USES_SINGLE_THREAD); | |||
// ------------------------------------------------------- | |||
// Process postponed events | |||
if (! usesSingleThread) | |||
plugin->postEventsRun(); | |||
if (oscRegisted || ! usesSingleThread) | |||
{ | |||
// --------------------------------------------------- | |||
// Update parameter outputs | |||
for (uint32_t j=0; j < plugin->parameterCount(); j++) | |||
{ | |||
if (! plugin->parameterIsOutput(j)) | |||
continue; | |||
value = plugin->getParameterValue(j); | |||
// Update UI | |||
if (! usesSingleThread) | |||
plugin->uiParameterChange(j, value); | |||
// Update OSC engine client | |||
if (oscRegisted) | |||
{ | |||
#ifdef BUILD_BRIDGE | |||
engine->osc_send_bridge_set_parameter_value(j, value); | |||
#else | |||
engine->osc_send_control_set_parameter_value(id, j, value); | |||
#endif | |||
} | |||
} | |||
// --------------------------------------------------- | |||
// Update OSC control client peaks | |||
if (oscRegisted) | |||
{ | |||
#ifdef BUILD_BRIDGE | |||
engine->osc_send_peaks(plugin); | |||
#else | |||
engine->osc_send_peaks(plugin, id); | |||
#endif | |||
} | |||
} | |||
} | |||
engine->idleOsc(); | |||
msleep(oscRegisted ? 40 : 50); | |||
} | |||
} | |||
CARLA_BACKEND_END_NAMESPACE |
@@ -1,77 +0,0 @@ | |||
/* | |||
* Carla Engine Thread | |||
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifndef CARLA_ENGINE_THREAD_HPP | |||
#define CARLA_ENGINE_THREAD_HPP | |||
#include "carla_backend.hpp" | |||
#include <QtCore/QMutex> | |||
#include <QtCore/QThread> | |||
CARLA_BACKEND_START_NAMESPACE | |||
#if 0 | |||
} // Fix editor indentation | |||
#endif | |||
class CarlaEngineThread : public QThread | |||
{ | |||
public: | |||
CarlaEngineThread(CarlaEngine* const engine, QObject* const parent = nullptr); | |||
~CarlaEngineThread(); | |||
void startNow(); | |||
void stopNow(); | |||
// ---------------------------------------------- | |||
protected: | |||
void run(); | |||
// ---------------------------------------------- | |||
private: | |||
CarlaEngine* const engine; | |||
QMutex m_mutex; | |||
bool m_stopNow; | |||
// ---------------------------------------------- | |||
class ScopedLocker | |||
{ | |||
public: | |||
ScopedLocker(CarlaEngineThread* const thread) | |||
: mutex(&thread->m_mutex) | |||
{ | |||
mutex->lock(); | |||
} | |||
~ScopedLocker() | |||
{ | |||
mutex->unlock(); | |||
} | |||
private: | |||
QMutex* const mutex; | |||
}; | |||
}; | |||
CARLA_BACKEND_END_NAMESPACE | |||
#endif // CARLA_ENGINE_THREAD_HPP |
@@ -1,539 +0,0 @@ | |||
/* | |||
* Carla Plugin Engine | |||
* Copyright (C) 2012 Filipe Coelho <falktx@falktx.com> | |||
* | |||
* This program 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 2 of the License, or | |||
* any later version. | |||
* | |||
* This program 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. | |||
* | |||
* For a full copy of the GNU General Public License see the COPYING file | |||
*/ | |||
#ifdef CARLA_ENGINE_PLUGIN | |||
#include "carla_engine.hpp" | |||
#include "carla_plugin.hpp" | |||
#include "DistrhoPlugin.h" | |||
CARLA_BACKEND_START_NAMESPACE | |||
// ----------------------------------------- | |||
// Parameters | |||
static const unsigned char paramMap[] = { | |||
0x01, 0x02, 0x03, 0x04, 0x05, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, | |||
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F, | |||
0x46, 0x47, 0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, | |||
0x50, 0x51, 0x52, 0x53, 0x54, 0x5B, 0x5C, 0x5D, 0x5E, 0x5F | |||
}; | |||
static const unsigned int paramVolume = 5; | |||
static const unsigned int paramBalance = 6; | |||
static const unsigned int paramPan = 8; | |||
static const unsigned int paramCount = sizeof(paramMap); | |||
static const unsigned int programCount = 128; | |||
// ------------------------------------------------------------------------------------------------------------------- | |||
// Plugin Engine client | |||
class CarlaEnginePluginClient : public CarlaEngineClient | |||
{ | |||
public: | |||
CarlaEnginePluginClient(const CarlaEngineType engineType, const ProcessMode processMode) | |||
: CarlaEngineClient(engineType, processMode) | |||
{ | |||
} | |||
~CarlaEnginePluginClient() | |||
{ | |||
} | |||
const CarlaEngineBasePort* addPort(const CarlaEnginePortType portType, const char* const name, const bool isInput) | |||
{ | |||
qDebug("CarlaEnginePluginClient::addPort(%i, \"%s\", %s)", portType, name, bool2str(isInput)); | |||
switch (portType) | |||
{ | |||
case CarlaEnginePortTypeNull: | |||
break; | |||
case CarlaEnginePortTypeAudio: | |||
return new CarlaEngineAudioPort(isInput, processMode); | |||
case CarlaEnginePortTypeControl: | |||
return new CarlaEngineControlPort(isInput, processMode); | |||
case CarlaEnginePortTypeMIDI: | |||
return new CarlaEngineMidiPort(isInput, processMode); | |||
} | |||
qCritical("CarlaEnginePluginClient::addPort(%i, \"%s\", %s) - invalid type", portType, name, bool2str(isInput)); | |||
return nullptr; | |||
} | |||
}; | |||
// ----------------------------------------- | |||
class CarlaEnginePlugin : public CarlaEngine, | |||
public DISTRHO::Plugin | |||
{ | |||
public: | |||
short idZyn; | |||
CarlaEnginePlugin() | |||
: CarlaEngine(), | |||
DISTRHO::Plugin(paramCount, programCount, 0) | |||
{ | |||
qDebug("CarlaEnginePlugin::CarlaEnginePlugin()"); | |||
// init parameters | |||
for (unsigned int i=0; i < paramCount; i++) | |||
paramBuffers[i] = 0.0f; | |||
paramBuffers[paramVolume] = 100.0f; | |||
paramBuffers[paramBalance] = 63.5f; | |||
paramBuffers[paramPan] = 63.5f; | |||
memcpy(prevParamBuffers, paramBuffers, sizeof(float)*paramCount); | |||
// set-up engine | |||
options.processMode = PROCESS_MODE_CONTINUOUS_RACK; | |||
options.forceStereo = true; | |||
options.preferPluginBridges = false; | |||
options.preferUiBridges = false; | |||
init("Carla"); | |||
// Force thread start so we get some OSC usage | |||
// (liblo locks otherwise) | |||
//startCheckThread(); | |||
// testing | |||
idZyn = addPlugin(PLUGIN_DSSI, "/usr/lib/dssi/sineshaper.so", nullptr, "ll-sineshaper"); | |||
} | |||
~CarlaEnginePlugin() | |||
{ | |||
qDebug("CarlaEnginePlugin::~CarlaEnginePlugin()"); | |||
removeAllPlugins(); | |||
close(); | |||
} | |||
// ------------------------------------- | |||
// CarlaEngine virtual calls | |||
bool init(const char* const clientName) | |||
{ | |||
qDebug("CarlaEnginePlugin::init(\"%s\")", clientName); | |||
bufferSize = d_bufferSize(); | |||
sampleRate = d_sampleRate(); | |||
name = clientName; | |||
name.toBasic(); | |||
CarlaEngine::init(name); | |||
return true; | |||
} | |||
bool close() | |||
{ | |||
qDebug("CarlaEnginePlugin::close()"); | |||
CarlaEngine::close(); | |||
return true; | |||
} | |||
bool isRunning() const | |||
{ | |||
return true; | |||
} | |||
bool isOffline() const | |||
{ | |||
return false; | |||
} | |||
CarlaEngineType type() const | |||
{ | |||
return CarlaEngineTypeRtAudio; | |||
} | |||
CarlaEngineClient* addClient(CarlaPlugin* const) | |||
{ | |||
return new CarlaEnginePluginClient(CarlaEngineTypeRtAudio, options.processMode); | |||
} | |||
protected: | |||
// --------------------------------------------- | |||
// DISTRHO Plugin Information | |||
const char* d_label() | |||
{ | |||
return "Carla"; | |||
} | |||
const char* d_maker() | |||
{ | |||
return "falkTX"; | |||
} | |||
const char* d_license() | |||
{ | |||
return "GPL v2+"; | |||
} | |||
uint32_t d_version() | |||
{ | |||
return 0x0500; | |||
} | |||
long d_uniqueId() | |||
{ | |||
return d_cconst('C', 'r', 'l', 'a'); | |||
} | |||
// --------------------------------------------- | |||
// DISTRHO Plugin Init | |||
void d_initParameter(uint32_t index, DISTRHO::Parameter& parameter) | |||
{ | |||
if (index >= paramCount) | |||
return; | |||
parameter.hints = DISTRHO::PARAMETER_IS_AUTOMABLE; | |||
parameter.ranges.def = 0.0f; | |||
parameter.ranges.min = 0.0f; | |||
parameter.ranges.max = 127.0f; | |||
if (index == paramVolume) | |||
parameter.ranges.def = 100.0f; | |||
else if (index == paramBalance) | |||
parameter.ranges.def = 63.5f; | |||
else if (index == paramPan) | |||
parameter.ranges.def = 63.5f; | |||
switch (paramMap[index]) | |||
{ | |||
case 0x01: | |||
parameter.name = "0x01 Modulation"; | |||
break; | |||
case 0x02: | |||
parameter.name = "0x02 Breath"; | |||
break; | |||
case 0x03: | |||
parameter.name = "0x03 (Undefined)"; | |||
break; | |||
case 0x04: | |||
parameter.name = "0x04 Foot"; | |||
break; | |||
case 0x05: | |||
parameter.name = "0x05 Portamento"; | |||
break; | |||
case 0x07: | |||
parameter.name = "0x07 Volume"; | |||
break; | |||
case 0x08: | |||
parameter.name = "0x08 Balance"; | |||
break; | |||
case 0x09: | |||
parameter.name = "0x09 (Undefined)"; | |||
break; | |||
case 0x0A: | |||
parameter.name = "0x0A Pan"; | |||
break; | |||
case 0x0B: | |||
parameter.name = "0x0B Expression"; | |||
break; | |||
case 0x0C: | |||
parameter.name = "0x0C FX Control 1"; | |||
break; | |||
case 0x0D: | |||
parameter.name = "0x0D FX Control 2"; | |||
break; | |||
case 0x0E: | |||
parameter.name = "0x0E (Undefined)"; | |||
break; | |||
case 0x0F: | |||
parameter.name = "0x0F (Undefined)"; | |||
break; | |||
case 0x10: | |||
parameter.name = "0x10 General Purpose 1"; | |||
break; | |||
case 0x11: | |||
parameter.name = "0x11 General Purpose 2"; | |||
break; | |||
case 0x12: | |||
parameter.name = "0x12 General Purpose 3"; | |||
break; | |||
case 0x13: | |||
parameter.name = "0x13 General Purpose 4"; | |||
break; | |||
case 0x14: | |||
parameter.name = "0x14 (Undefined)"; | |||
break; | |||
case 0x15: | |||
parameter.name = "0x15 (Undefined)"; | |||
break; | |||
case 0x16: | |||
parameter.name = "0x16 (Undefined)"; | |||
break; | |||
case 0x17: | |||
parameter.name = "0x17 (Undefined)"; | |||
break; | |||
case 0x18: | |||
parameter.name = "0x18 (Undefined)"; | |||
break; | |||
case 0x19: | |||
parameter.name = "0x19 (Undefined)"; | |||
break; | |||
case 0x1A: | |||
parameter.name = "0x1A (Undefined)"; | |||
break; | |||
case 0x1B: | |||
parameter.name = "0x1B (Undefined)"; | |||
break; | |||
case 0x1C: | |||
parameter.name = "0x1C (Undefined)"; | |||
break; | |||
case 0x1D: | |||
parameter.name = "0x1D (Undefined)"; | |||
break; | |||
case 0x1E: | |||
parameter.name = "0x1E (Undefined)"; | |||
break; | |||
case 0x1F: | |||
parameter.name = "0x1F (Undefined)"; | |||
break; | |||
case 0x46: | |||
parameter.name = "0x46 Control 1 [Variation]"; | |||
break; | |||
case 0x47: | |||
parameter.name = "0x47 Control 2 [Timbre]"; | |||
break; | |||
case 0x48: | |||
parameter.name = "0x48 Control 3 [Release]"; | |||
break; | |||
case 0x49: | |||
parameter.name = "0x49 Control 4 [Attack]"; | |||
break; | |||
case 0x4A: | |||
parameter.name = "0x4A Control 5 [Brightness]"; | |||
break; | |||
case 0x4B: | |||
parameter.name = "0x4B Control 6 [Decay]"; | |||
break; | |||
case 0x4C: | |||
parameter.name = "0x4C Control 7 [Vib Rate]"; | |||
break; | |||
case 0x4D: | |||
parameter.name = "0x4D Control 8 [Vib Depth]"; | |||
break; | |||
case 0x4E: | |||
parameter.name = "0x4E Control 9 [Vib Delay]"; | |||
break; | |||
case 0x4F: | |||
parameter.name = "0x4F Control 10 [Undefined]"; | |||
break; | |||
case 0x50: | |||
parameter.name = "0x50 General Purpose 5"; | |||
break; | |||
case 0x51: | |||
parameter.name = "0x51 General Purpose 6"; | |||
break; | |||
case 0x52: | |||
parameter.name = "0x52 General Purpose 7"; | |||
break; | |||
case 0x53: | |||
parameter.name = "0x53 General Purpose 8"; | |||
break; | |||
case 0x54: | |||
parameter.name = "0x54 Portamento Control"; | |||
break; | |||
case 0x5B: | |||
parameter.name = "0x5B FX 1 Depth [Reverb]"; | |||
break; | |||
case 0x5C: | |||
parameter.name = "0x5C FX 2 Depth [Tremolo]"; | |||
break; | |||
case 0x5D: | |||
parameter.name = "0x5D FX 3 Depth [Chorus]"; | |||
break; | |||
case 0x5E: | |||
parameter.name = "0x5E FX 4 Depth [Detune]"; | |||
break; | |||
case 0x5F: | |||
parameter.name = "0x5F FX 5 Depth [Phaser]"; | |||
break; | |||
} | |||
} | |||
void d_initProgramName(uint32_t index, d_string& programName) | |||
{ | |||
programName = "Program #" + d_string(index); | |||
} | |||
void d_initStateKey(uint32_t index, d_string& stateKey) | |||
{ | |||
Q_UNUSED(index); | |||
Q_UNUSED(stateKey); | |||
} | |||
// --------------------------------------------- | |||
// DISTRHO Plugin Internal data | |||
float d_parameterValue(uint32_t index) | |||
{ | |||
if (index >= paramCount) | |||
return 0.0f; | |||
return paramBuffers[index]; | |||
} | |||
void d_setParameterValue(uint32_t index, float value) | |||
{ | |||
if (index >= paramCount) | |||
return; | |||
paramBuffers[index] = value; | |||
} | |||
void d_setProgram(uint32_t index) | |||
{ | |||
if (index >= programCount) | |||
return; | |||
if (maxPluginNumber() == 0) | |||
return; | |||
if (CarlaPlugin* const plugin = getPlugin(0)) | |||
{ | |||
if (index > plugin->programCount()) | |||
plugin->setProgram(index, true, true, false, true); | |||
} | |||
} | |||
void d_setState(const char* key, const char* value) | |||
{ | |||
Q_UNUSED(key); | |||
Q_UNUSED(value); | |||
} | |||
// --------------------------------------------- | |||
// DISTRHO Plugin Process | |||
void d_activate() | |||
{ | |||
//#if 0 | |||
for (unsigned short i=0, max=maxPluginNumber(); i < max; i++) | |||
{ | |||
CarlaPlugin* const plugin = getPluginUnchecked(i); | |||
if (plugin && plugin->enabled()) | |||
plugin->setActive(true, true, false); | |||
} | |||
//#endif | |||
memcpy(prevParamBuffers, paramBuffers, sizeof(float)*paramCount); | |||
} | |||
void d_deactivate() | |||
{ | |||
//#if 0 | |||
for (unsigned short i=0, max=maxPluginNumber(); i < max; i++) | |||
{ | |||
CarlaPlugin* const plugin = getPluginUnchecked(i); | |||
if (plugin && plugin->enabled()) | |||
plugin->setActive(false, true, false); | |||
} | |||
//#endif | |||
} | |||
void d_run(float** inputs, float** outputs, uint32_t frames, uint32_t midiEventCount, const DISTRHO::MidiEvent* midiEvents) | |||
{ | |||
if (maxPluginNumber() == 0) | |||
return; | |||
// create audio buffers | |||
float* inBuf[2] = { (float*)inputs[0], (float*)inputs[1] }; | |||
float* outBuf[2] = { outputs[0], outputs[1] }; | |||
// initialize control input | |||
memset(rackControlEventsIn, 0, sizeof(CarlaEngineControlEvent)*CarlaEngine::MAX_CONTROL_EVENTS); | |||
{ | |||
uint32_t carlaEventIndex = 0; | |||
for (unsigned int i=0; i < paramCount; i++) | |||
{ | |||
if (prevParamBuffers[i] == paramBuffers[i]) | |||
continue; | |||
CarlaEngineControlEvent* const carlaEvent = &rackControlEventsIn[carlaEventIndex++]; | |||
carlaEvent->type = CarlaEngineParameterChangeEvent; | |||
carlaEvent->parameter = paramMap[i]; | |||
carlaEvent->value = paramBuffers[i]/127; | |||
} | |||
} | |||
memcpy(prevParamBuffers, paramBuffers, sizeof(float)*paramCount); | |||
// initialize midi input | |||
memset(rackMidiEventsIn, 0, sizeof(CarlaEngineMidiEvent)*CarlaEngine::MAX_MIDI_EVENTS); | |||
{ | |||
const DISTRHO::MidiEvent* event; | |||
for (uint32_t i=0, j=0; j < midiEventCount; j++) | |||
{ | |||
if (i == CarlaEngine::MAX_MIDI_EVENTS) | |||
break; | |||
event = &midiEvents[j]; | |||
rackMidiEventsIn[i].time = event->frame; | |||
rackMidiEventsIn[i].size = 3; | |||
memcpy(rackMidiEventsIn[i].data, event->buffer, 3); | |||
i += 1; | |||
} | |||
} | |||
processRack(inBuf, outBuf, frames); | |||
} | |||
// --------------------------------------------- | |||
// Callbacks | |||
void d_bufferSizeChanged(uint32_t newBufferSize) | |||
{ | |||
bufferSizeChanged(newBufferSize); | |||
} | |||
// --------------------------------------------- | |||
private: | |||
float paramBuffers[paramCount]; | |||
float prevParamBuffers[paramCount]; | |||
}; | |||
CARLA_BACKEND_END_NAMESPACE | |||
// ------------------------------------------------- | |||
START_NAMESPACE_DISTRHO | |||
Plugin* createPlugin() | |||
{ | |||
return new CarlaBackend::CarlaEnginePlugin(); | |||
} | |||
END_NAMESPACE_DISTRHO | |||
// ------------------------------------------------- | |||
#include "DistrhoPluginMain.cpp" | |||
#endif // CARLA_ENGINE_PLUGIN |
@@ -1,57 +0,0 @@ | |||
### Do not edit -- Generated by 'configure --with-whatever' from Makefile.in | |||
### RtAudio library Makefile | |||
RM = /bin/rm | |||
LN = /bin/ln | |||
OBJECTS = RtAudio.o @objects@ | |||
STATIC = librtaudio.a | |||
SHARED = @sharedlib@ | |||
RELEASE = 4.0.11 | |||
MAJOR = 4 | |||
LIBRARIES = $(STATIC) $(SHARED) | |||
CC = @CXX@ | |||
AR = @AR@ | |||
RANLIB = @RANLIB@ | |||
DEFS = @CPPFLAGS@ | |||
CFLAGS = @CXXFLAGS@ -Iinclude -fPIC | |||
all : $(LIBRARIES) | |||
tests: | |||
cd tests && $(MAKE) all | |||
$(LIBRARIES): $(OBJECTS) | |||
$(AR) ruv $(STATIC) $(OBJECTS) | |||
ranlib $(STATIC) | |||
$(CC) -fPIC @libflags@ $(OBJECTS) @LIBS@ | |||
$(LN) -s @sharedname@ $(SHARED) | |||
# $(CC) -shared $(OBJECTS) -o $(SHARED) @LIBS@ | |||
%.o : %.cpp | |||
$(CC) $(CFLAGS) $(DEFS) -c $(<) -o $@ | |||
%.o : include/%.cpp | |||
$(CC) $(CFLAGS) $(DEFS) -c $(<) -o $@ | |||
clean : | |||
$(RM) -f $(LIBRARIES) @sharedname@ $(SHARED)* | |||
$(RM) -f $(OBJECTS) | |||
$(RM) -f *~ | |||
cd tests && $(MAKE) clean | |||
distclean: | |||
$(RM) -f $(LIBRARIES) @sharedname@ $(SHARED)* | |||
$(RM) -f $(OBJECTS) | |||
$(RM) -f *~ | |||
$(RM) -rf config.log config.status autom4te.cache Makefile rtaudio-config | |||
cd tests && $(MAKE) distclean | |||
strip : | |||
strip $(LIBRARIES) | |||
ranlib $(LIBRARIES) | |||
cd tests && $(MAKE) strip |
@@ -1,60 +0,0 @@ | |||
/************************************************************************/ | |||
/*! \class RtError | |||
\brief Exception handling class for RtAudio & RtMidi. | |||
The RtError class is quite simple but it does allow errors to be | |||
"caught" by RtError::Type. See the RtAudio and RtMidi | |||
documentation to know which methods can throw an RtError. | |||
*/ | |||
/************************************************************************/ | |||
#ifndef RTERROR_H | |||
#define RTERROR_H | |||
#include <exception> | |||
#include <iostream> | |||
#include <string> | |||
class RtError : public std::exception | |||
{ | |||
public: | |||
//! Defined RtError types. | |||
enum Type { | |||
WARNING, /*!< A non-critical error. */ | |||
DEBUG_WARNING, /*!< A non-critical error which might be useful for debugging. */ | |||
UNSPECIFIED, /*!< The default, unspecified error type. */ | |||
NO_DEVICES_FOUND, /*!< No devices found on system. */ | |||
INVALID_DEVICE, /*!< An invalid device ID was specified. */ | |||
MEMORY_ERROR, /*!< An error occured during memory allocation. */ | |||
INVALID_PARAMETER, /*!< An invalid parameter was specified to a function. */ | |||
INVALID_USE, /*!< The function was called incorrectly. */ | |||
DRIVER_ERROR, /*!< A system driver error occured. */ | |||
SYSTEM_ERROR, /*!< A system error occured. */ | |||
THREAD_ERROR /*!< A thread error occured. */ | |||
}; | |||
//! The constructor. | |||
RtError( const std::string& message, Type type = RtError::UNSPECIFIED ) throw() : message_(message), type_(type) {} | |||
//! The destructor. | |||
virtual ~RtError( void ) throw() {} | |||
//! Prints thrown error message to stderr. | |||
virtual void printMessage( void ) const throw() { std::cerr << '\n' << message_ << "\n\n"; } | |||
//! Returns the thrown error message type. | |||
virtual const Type& getType(void) const throw() { return type_; } | |||
//! Returns the thrown error message string. | |||
virtual const std::string& getMessage(void) const throw() { return message_; } | |||
//! Returns the thrown error message as a c-style string. | |||
virtual const char* what( void ) const throw() { return message_.c_str(); } | |||
protected: | |||
std::string message_; | |||
Type type_; | |||
}; | |||
#endif |
@@ -1,166 +0,0 @@ | |||
# Process this file with autoconf to produce a configure script. | |||
AC_INIT(RtAudio, 4.0, gary@music.mcgill.ca, rtaudio) | |||
AC_CONFIG_AUX_DIR(config) | |||
AC_CONFIG_SRCDIR(RtAudio.cpp) | |||
AC_CONFIG_FILES([rtaudio-config Makefile tests/Makefile]) | |||
# Fill GXX with something before test. | |||
AC_SUBST( GXX, ["no"] ) | |||
# Checks for programs. | |||
AC_PROG_CXX(g++ CC c++ cxx) | |||
AC_PROG_RANLIB | |||
AC_PATH_PROG(AR, ar, no) | |||
if [[ $AR = "no" ]] ; then | |||
AC_MSG_ERROR("Could not find ar - needed to create a library"); | |||
fi | |||
# Checks for header files. | |||
AC_HEADER_STDC | |||
AC_CHECK_HEADERS(sys/ioctl.h unistd.h) | |||
# Check for debug | |||
AC_MSG_CHECKING(whether to compile debug version) | |||
AC_ARG_ENABLE(debug, | |||
[ --enable-debug = enable various debug output], | |||
[AC_SUBST( cppflag, [-D__RTAUDIO_DEBUG__] ) AC_SUBST( cxxflag, [-g] ) AC_SUBST( object_path, [Debug] ) AC_MSG_RESULT(yes)], | |||
[AC_SUBST( cppflag, [] ) AC_SUBST( cxxflag, [-O2] ) AC_SUBST( object_path, [Release] ) AC_MSG_RESULT(no)]) | |||
# Checks for functions | |||
AC_CHECK_FUNC(gettimeofday, [cppflag="$cppflag -DHAVE_GETTIMEOFDAY"], ) | |||
# For -I and -D flags | |||
CPPFLAGS="$CPPFLAGS $cppflag" | |||
# For debugging and optimization ... overwrite default because it has both -g and -O2 | |||
#CXXFLAGS="$CXXFLAGS $cxxflag" | |||
CXXFLAGS="$cxxflag" | |||
# Check compiler and use -Wall if gnu. | |||
if [test $GXX = "yes" ;] then | |||
AC_SUBST( cxxflag, [-Wall] ) | |||
fi | |||
CXXFLAGS="$CXXFLAGS $cxxflag" | |||
AC_CANONICAL_HOST | |||
AC_SUBST( sharedlib, ["librtaudio.so"] ) | |||
AC_SUBST( sharedname, ["librtaudio.so.\$(RELEASE)"] ) | |||
AC_SUBST( libflags, ["-shared -Wl,-soname,\$(SHARED).\$(MAJOR) -o \$(SHARED).\$(RELEASE)"] ) | |||
case $host in | |||
*-apple*) | |||
AC_SUBST( sharedlib, ["librtaudio.dylib"] ) | |||
AC_SUBST( sharedname, ["librtaudio.\$(RELEASE).dylib"] ) | |||
AC_SUBST( libflags, ["-dynamiclib -o librtaudio.\$(RELEASE).dylib"] ) | |||
esac | |||
# Checks for package options and external software | |||
AC_SUBST( api, [""] ) | |||
AC_MSG_CHECKING(for audio API) | |||
case $host in | |||
*-*-netbsd*) | |||
AC_MSG_RESULT(using OSS) | |||
api="$api -D__LINUX_OSS__" | |||
LIBS="$LIBS -lossaudio" | |||
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!)) | |||
;; | |||
*-*-linux*) | |||
AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (mac and linux only)], [ | |||
api="$api -D__UNIX_JACK__" | |||
AC_MSG_RESULT(using JACK) | |||
AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!)) | |||
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(Jack support also requires the asound library!))], ) | |||
# Look for ALSA flag | |||
AC_ARG_WITH(alsa, [ --with-alsa = choose native ALSA API support (linux only)], [ | |||
api="$api -D__LINUX_ALSA__" | |||
AC_MSG_RESULT(using ALSA) | |||
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!))], ) | |||
# Look for PULSE flag | |||
AC_ARG_WITH(pulse, [ --with-pulse = choose PulseAudio API support (linux only)], [ | |||
api="$api -D__LINUX_PULSE__" | |||
AC_MSG_RESULT(using PulseAudio) | |||
AC_CHECK_LIB(pulse-simple, pa_simple_new, , AC_MSG_ERROR(PulseAudio support requires the pulse-simple library!))], ) | |||
# Look for OSS flag | |||
AC_ARG_WITH(oss, [ --with-oss = choose OSS API support (linux only)], [ | |||
api="$api -D__LINUX_OSS__" | |||
AC_MSG_RESULT(using OSS)], ) | |||
# If no audio api flags specified, use ALSA | |||
if [test "$api" == "";] then | |||
AC_MSG_RESULT(using ALSA) | |||
AC_SUBST( api, [-D__LINUX_ALSA__] ) | |||
AC_CHECK_LIB(asound, snd_pcm_open, , AC_MSG_ERROR(ALSA support requires the asound library!)) | |||
fi | |||
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!)) | |||
;; | |||
*-apple*) | |||
AC_ARG_WITH(jack, [ --with-jack = choose JACK server support (unix only)], [ | |||
api="$api -D__UNIX_JACK__" | |||
AC_MSG_RESULT(using JACK) | |||
AC_CHECK_LIB(jack, jack_client_open, , AC_MSG_ERROR(JACK support requires the jack library!))], ) | |||
# AC_CHECK_HEADER(jack/jack.h, [], [AC_MSG_ERROR(Jack header file not found!)] ) | |||
# LIBS="$LIBS -framework jackmp" ], ) | |||
# Look for Core flag | |||
AC_ARG_WITH(core, [ --with-core = choose CoreAudio API support (mac only)], [ | |||
api="$api -D__MACOSX_CORE__" | |||
AC_MSG_RESULT(using CoreAudio) | |||
AC_CHECK_HEADER(CoreAudio/CoreAudio.h, [], [AC_MSG_ERROR(CoreAudio header files not found!)] ) | |||
LIBS="$LIBS -framework CoreAudio -framework CoreFoundation" ], ) | |||
# If no audio api flags specified, use CoreAudio | |||
if [test "$api" == ""; ] then | |||
AC_SUBST( api, [-D__MACOSX_CORE__] ) | |||
AC_MSG_RESULT(using CoreAudio) | |||
AC_CHECK_HEADER(CoreAudio/CoreAudio.h, | |||
[], | |||
[AC_MSG_ERROR(CoreAudio header files not found!)] ) | |||
AC_SUBST( LIBS, ["-framework CoreAudio -framework CoreFoundation"] ) | |||
fi | |||
AC_CHECK_LIB(pthread, pthread_create, , AC_MSG_ERROR(RtAudio requires the pthread library!)) | |||
;; | |||
*-mingw32*) | |||
AC_ARG_WITH(asio, [ --with-asio = choose ASIO API support (windoze only)], [ | |||
api="$api -D__WINDOWS_ASIO__" | |||
AC_MSG_RESULT(using ASIO) | |||
AC_SUBST( objects, ["asio.o asiodrivers.o asiolist.o iasiothiscallresolver.o"] ) ], ) | |||
# Look for DirectSound flag | |||
AC_ARG_WITH(ds, [ --with-ds = choose DirectSound API support (windoze only)], [ | |||
api="$api -D__WINDOWS_DS__" | |||
AC_MSG_RESULT(using DirectSound) | |||
LIBS="-ldsound -lwinmm $LIBS" ], ) | |||
# If no audio api flags specified, use DirectSound | |||
if [test "$api" == "";] then | |||
AC_SUBST( api, [-D__WINDOWS_DS__] ) | |||
AC_MSG_RESULT(using DirectSound) | |||
LIBS="-ldsound -lwinmm $LIBS" | |||
fi | |||
LIBS="-lole32 $LIBS" | |||
;; | |||
*) | |||
# Default case for unknown realtime systems. | |||
AC_MSG_ERROR(Unknown system type for realtime support!) | |||
;; | |||
esac | |||
CPPFLAGS="$CPPFLAGS $api" | |||
AC_OUTPUT | |||
chmod oug+x rtaudio-config |
@@ -1,70 +0,0 @@ | |||
import rtaudio as rt | |||
from math import cos | |||
import struct | |||
class audio_generator: | |||
def __init__(self): | |||
self.idx = -1 | |||
self.freq = 440. | |||
def __call__(self): | |||
self.idx += 1 | |||
if self.idx%48000 == 0: | |||
self.freq *= 2**(1/12.) | |||
return 0.5*cos(2.*3.1416*self.freq*self.idx/48000.) | |||
class callback: | |||
def __init__(self, gen): | |||
self.gen = gen | |||
self.i = 0 | |||
def __call__(self,playback, capture): | |||
[struct.pack_into("f", playback, 4*o, self.gen()) for o in xrange(256)] | |||
self.i = self.i + 256 | |||
if self.i > 48000*10: | |||
print '.' | |||
return 1 | |||
dac = rt.RtAudio() | |||
n = dac.getDeviceCount() | |||
print 'Number of devices available: ', n | |||
for i in range(n): | |||
try: | |||
print dac.getDeviceInfo(i) | |||
except rt.RtError as e: | |||
print e | |||
print 'Default output device: ', dac.getDefaultOutputDevice() | |||
print 'Default input device: ', dac.getDefaultInputDevice() | |||
print 'is stream open: ', dac.isStreamOpen() | |||
print 'is stream running: ', dac.isStreamRunning() | |||
oParams = {'deviceId': 1, 'nChannels': 1, 'firstChannel': 0} | |||
iParams = {'deviceId': 1, 'nChannels': 1, 'firstChannel': 0} | |||
try: | |||
dac.openStream(oParams,oParams,48000,256,callback(audio_generator()) ) | |||
except rt.RtError as e: | |||
print e | |||
else: | |||
dac.startStream() | |||
import time | |||
print 'latency: ', dac.getStreamLatency() | |||
while (dac.isStreamRunning()): | |||
time.sleep(0.1) | |||
print dac.getStreamTime() | |||
dac.stopStream() | |||
dac.abortStream() | |||
dac.closeStream() | |||
@@ -1,57 +0,0 @@ | |||
PyRtAudio - a python wrapper around RtAudio that allows to perform audio i/o operations in real-time from the python language. | |||
By Antoine Lefebvre, 2011 | |||
This software is in the development stage. Do not expect compatibility | |||
with future versions. Comments, suggestions, new features, bug fixes, | |||
etc. are welcome. | |||
This distribution of PyRtAudio contains the following: | |||
- rtaudiomodule.cpp: the python wrapper code | |||
- setup.py: a setup script use to compile and install PyRtAudio | |||
- examples: a single PyRtAudioTest.py script | |||
INSTALLATION | |||
The compilation and installation of the PyRtAudio module is handled by | |||
the python Distribution Utilities ("Distutils"). Provided that your | |||
system has a C++ compiler and is properly configure, the following | |||
command should be sufficient: | |||
>> python setup.py install | |||
Please refer to the distutils documentation for installation problems: http://docs.python.org/distutils/index.html | |||
LEGAL AND ETHICAL: | |||
The PyRtAudio license is the same as the RtAudio license: | |||
PyRtAudio: a python wrapper around RtAudio | |||
Copyright (c)2011 Antoine Lefebvre | |||
Permission is hereby granted, free of charge, to any person | |||
obtaining a copy of this software and associated documentation files | |||
(the "Software"), to deal in the Software without restriction, | |||
including without limitation the rights to use, copy, modify, merge, | |||
publish, distribute, sublicense, and/or sell copies of the Software, | |||
and to permit persons to whom the Software is furnished to do so, | |||
subject to the following conditions: | |||
The above copyright notice and this permission notice shall be | |||
included in all copies or substantial portions of the Software. | |||
Any person wishing to distribute modifications to the Software is | |||
asked to send the modifications to the original developer so that | |||
they can be incorporated into the canonical version. This is, | |||
however, not a binding provision of this license. | |||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR | |||
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | |||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
@@ -1,605 +0,0 @@ | |||
/************************************************************************/ | |||
/* PyRtAudio: a python wrapper around RtAudio | |||
Copyright (c) 2011 Antoine Lefebvre | |||
Permission is hereby granted, free of charge, to any person | |||
obtaining a copy of this software and associated documentation files | |||
(the "Software"), to deal in the Software without restriction, | |||
including without limitation the rights to use, copy, modify, merge, | |||
publish, distribute, sublicense, and/or sell copies of the Software, | |||
and to permit persons to whom the Software is furnished to do so, | |||
subject to the following conditions: | |||
The above copyright notice and this permission notice shall be | |||
included in all copies or substantial portions of the Software. | |||
Any person wishing to distribute modifications to the Software is | |||
asked to send the modifications to the original developer so that | |||
they can be incorporated into the canonical version. This is, | |||
however, not a binding provision of this license. | |||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR | |||
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | |||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
*/ | |||
/************************************************************************/ | |||
// This software is in the development stage | |||
// Do not expect compatibility with future versions. | |||
// Comments, suggestions, new features, bug fixes, etc. are welcome | |||
#include <Python.h> | |||
#include "RtAudio.h" | |||
extern "C" { | |||
typedef struct | |||
{ | |||
PyObject_HEAD; | |||
RtAudio *dac; | |||
RtAudioFormat _format; | |||
int _bufferSize; | |||
unsigned int inputChannels; | |||
PyObject *callback_func; | |||
} PyRtAudio; | |||
static PyObject *RtAudioError; | |||
static int callback(void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, | |||
double streamTime, RtAudioStreamStatus status, void *data ) | |||
{ | |||
PyRtAudio* self = (PyRtAudio*) data; | |||
if (status == RTAUDIO_OUTPUT_UNDERFLOW) | |||
printf("underflow.\n"); | |||
if (self == NULL) return -1; | |||
float* in = (float *) inputBuffer; | |||
float* out = (float *) outputBuffer; | |||
PyObject *py_callback_func = self->callback_func; | |||
int retval = 0; | |||
if (py_callback_func) { | |||
PyGILState_STATE gstate = PyGILState_Ensure(); | |||
PyObject* iBuffer = PyBuffer_FromMemory(in, sizeof(float) * self->inputChannels * nBufferFrames); | |||
PyObject* oBuffer = PyBuffer_FromReadWriteMemory(out, sizeof(float) * nBufferFrames); | |||
PyObject *arglist = Py_BuildValue("(O,O)", oBuffer, iBuffer); | |||
if (arglist == NULL) { | |||
printf("error.\n"); | |||
PyErr_Print(); | |||
PyGILState_Release(gstate); | |||
return 2; | |||
} | |||
// Calling the callback | |||
PyObject *result = PyEval_CallObject(py_callback_func, arglist); | |||
if (PyErr_Occurred() != NULL) { | |||
PyErr_Print(); | |||
} | |||
else if PyInt_Check(result) { | |||
retval = PyInt_AsLong(result); | |||
} | |||
Py_DECREF(arglist); | |||
Py_DECREF(oBuffer); | |||
Py_DECREF(iBuffer); | |||
Py_XDECREF(result); | |||
PyGILState_Release(gstate); | |||
} | |||
return retval; | |||
} | |||
static void RtAudio_dealloc(PyRtAudio *self) | |||
{ | |||
printf("RtAudio_dealloc.\n"); | |||
if (self == NULL) return; | |||
if (self->dac) { | |||
self->dac->closeStream(); | |||
Py_CLEAR(self->callback_func); | |||
delete self->dac; | |||
} | |||
self->ob_type->tp_free((PyObject *) self); | |||
} | |||
static PyObject* RtAudio_new(PyTypeObject *type, PyObject *args, PyObject *kwds) | |||
{ | |||
printf("RtAudio_new.\n"); | |||
PyRtAudio *self; | |||
char *api = NULL; | |||
if(!PyArg_ParseTuple(args, "|s", &api)) | |||
return NULL; | |||
self = (PyRtAudio *) type->tp_alloc(type, 0); | |||
if(self == NULL) return NULL; | |||
self->dac = NULL; | |||
self->callback_func = NULL; | |||
try { | |||
if (api == NULL) | |||
self->dac = new RtAudio; | |||
else if(!strcmp(api, "jack")) | |||
self->dac = new RtAudio(RtAudio::UNIX_JACK); | |||
else if(!strcmp(api, "alsa")) | |||
self->dac = new RtAudio(RtAudio::LINUX_ALSA); | |||
else if(!strcmp(api, "oss")) | |||
self->dac = new RtAudio(RtAudio::LINUX_ALSA); | |||
else if(!strcmp(api, "core")) | |||
self->dac = new RtAudio(RtAudio::MACOSX_CORE); | |||
else if(!strcmp(api, "asio")) | |||
self->dac = new RtAudio(RtAudio::WINDOWS_ASIO); | |||
else if(!strcmp(api, "directsound")) | |||
self->dac = new RtAudio(RtAudio::WINDOWS_DS); | |||
} | |||
catch (RtError &error) { | |||
PyErr_SetString(RtAudioError, error.getMessage().c_str()); | |||
Py_INCREF(RtAudioError); | |||
return NULL; | |||
} | |||
self->dac->showWarnings(false); | |||
//Py_XINCREF(self); | |||
return (PyObject *) self; | |||
} | |||
static int RtAudio_init(PyRtAudio *self, PyObject *args, PyObject *kwds) | |||
{ | |||
printf("RtAudio_init.\n"); | |||
//if (self == NULL) return 0; | |||
return 0; | |||
} | |||
// This functions does not yet support all the features of the RtAudio::openStream method. | |||
// Please send your patches if you improves this. | |||
static PyObject* RtAudio_openStream(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL) return NULL; | |||
if (self->dac == NULL) { | |||
printf("the dac is null.\n"); | |||
Py_RETURN_NONE; | |||
} | |||
PyObject *oParamsObj; | |||
PyObject *iParamsObj; | |||
int fs; | |||
unsigned int bf; | |||
PyObject *pycallback; | |||
if (!PyArg_ParseTuple(args, "OOiiO", &oParamsObj, &iParamsObj, &fs, &bf, &pycallback)) | |||
return NULL; | |||
RtAudio::StreamParameters oParams; | |||
oParams.deviceId = 1; | |||
oParams.nChannels = 1; | |||
oParams.firstChannel = 0; | |||
if (PyDict_Check(oParamsObj)) { | |||
if (PyDict_Contains(oParamsObj, PyString_FromString("deviceId"))) { | |||
PyObject *value = PyDict_GetItem(oParamsObj, PyString_FromString("deviceId")); | |||
oParams.deviceId = PyInt_AsLong(value); | |||
} | |||
if (PyDict_Contains(oParamsObj, PyString_FromString("nChannels"))) { | |||
PyObject *value = PyDict_GetItem(oParamsObj, PyString_FromString("nChannels")); | |||
oParams.nChannels = PyInt_AsLong(value); | |||
} | |||
if (PyDict_Contains(oParamsObj, PyString_FromString("firstChannel"))) { | |||
PyObject *value = PyDict_GetItem(oParamsObj, PyString_FromString("firstChannel")); | |||
oParams.firstChannel = PyInt_AsLong(value); | |||
} | |||
} | |||
else { | |||
printf("First argument must be a dictionary. Default values will be used.\n"); | |||
} | |||
RtAudio::StreamParameters iParams; | |||
iParams.deviceId = 1; | |||
iParams.nChannels = 2; | |||
iParams.firstChannel = 0; | |||
if (PyDict_Check(iParamsObj)) { | |||
if (PyDict_Contains(iParamsObj, PyString_FromString("deviceId"))) { | |||
PyObject *value = PyDict_GetItem(iParamsObj, PyString_FromString("deviceId")); | |||
iParams.deviceId = PyInt_AsLong(value); | |||
} | |||
if (PyDict_Contains(iParamsObj, PyString_FromString("nChannels"))) { | |||
PyObject *value = PyDict_GetItem(iParamsObj, PyString_FromString("nChannels")); | |||
iParams.nChannels = PyInt_AsLong(value); | |||
} | |||
if (PyDict_Contains(iParamsObj, PyString_FromString("firstChannel"))) { | |||
PyObject *value = PyDict_GetItem(iParamsObj, PyString_FromString("firstChannel")); | |||
iParams.firstChannel = PyInt_AsLong(value); | |||
} | |||
} | |||
else { | |||
printf("Second argument must be a dictionary. Default values will be used.\n"); | |||
} | |||
if (!PyCallable_Check(pycallback)) { | |||
PyErr_SetString(PyExc_TypeError, "Need a callable object!"); | |||
Py_XINCREF(PyExc_TypeError); | |||
return NULL; | |||
} | |||
// sanity check the callback ? | |||
Py_INCREF(pycallback); /* Add a reference to new callback */ | |||
self->callback_func = pycallback; /*Remember new callback */ | |||
// add support for other format | |||
self->_format = RTAUDIO_FLOAT32; | |||
// add support for other options | |||
RtAudio::StreamOptions options; | |||
options.flags = RTAUDIO_NONINTERLEAVED; | |||
try { | |||
if (self->dac->isStreamOpen()) | |||
self->dac->closeStream(); | |||
self->dac->openStream(&oParams, &iParams, self->_format, fs, &bf, &callback, self, &options); | |||
} | |||
catch ( RtError& error ) { | |||
PyErr_SetString(RtAudioError, error.getMessage().c_str()); | |||
Py_INCREF(RtAudioError); | |||
return NULL; | |||
} | |||
self->inputChannels = iParams.nChannels; | |||
Py_RETURN_NONE; | |||
} | |||
static PyObject* RtAudio_closeStream(PyRtAudio *self, PyObject *args) | |||
{ | |||
printf("RtAudio_closeStream.\n"); | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
try { | |||
self->dac->closeStream(); | |||
Py_CLEAR(self->callback_func); | |||
} | |||
catch(RtError &error) { | |||
PyErr_SetString(RtAudioError, error.getMessage().c_str()); | |||
Py_INCREF(RtAudioError); | |||
return NULL; | |||
} | |||
Py_RETURN_NONE; | |||
} | |||
static PyObject* RtAudio_startStream(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
try { | |||
self->dac->startStream(); | |||
} | |||
catch(RtError &error) { | |||
PyErr_SetString(RtAudioError, error.getMessage().c_str()); | |||
Py_INCREF(RtAudioError); | |||
return NULL; | |||
} | |||
Py_RETURN_NONE; | |||
} | |||
static PyObject* RtAudio_stopStream(PyRtAudio *self, PyObject *args) | |||
{ | |||
printf("RtAudio_stopStream.\n"); | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
try { | |||
self->dac->stopStream(); | |||
} | |||
catch(RtError &error) { | |||
PyErr_SetString(RtAudioError, error.getMessage().c_str()); | |||
Py_INCREF(RtAudioError); | |||
return NULL; | |||
} | |||
Py_RETURN_NONE; | |||
} | |||
static PyObject* RtAudio_abortStream(PyRtAudio *self, PyObject *args) | |||
{ | |||
printf("RtAudio_abortStream.\n"); | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
try { | |||
self->dac->abortStream(); | |||
} | |||
catch(RtError &error) { | |||
PyErr_SetString(RtAudioError, error.getMessage().c_str()); | |||
Py_INCREF(RtAudioError); | |||
return NULL; | |||
} | |||
Py_RETURN_NONE; | |||
} | |||
static PyObject* RtAudio_isStreamRunning(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
if (self->dac == NULL) { | |||
Py_RETURN_FALSE; | |||
} | |||
if (self->dac->isStreamRunning()) | |||
Py_RETURN_TRUE; | |||
else | |||
Py_RETURN_FALSE; | |||
} | |||
static PyObject* RtAudio_isStreamOpen(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
if (self->dac == NULL) { | |||
Py_RETURN_FALSE; | |||
} | |||
if (self->dac->isStreamOpen()) | |||
Py_RETURN_TRUE; | |||
else | |||
Py_RETURN_FALSE; | |||
} | |||
static PyObject* RtAudio_getDeviceCount(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
return PyInt_FromLong(self->dac->getDeviceCount()); | |||
} | |||
static PyObject* RtAudio_getDeviceInfo(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
int device; | |||
if (!PyArg_ParseTuple(args, "i", &device)) | |||
return NULL; | |||
try { | |||
RtAudio::DeviceInfo info = self->dac->getDeviceInfo(device); | |||
PyObject* info_dict = PyDict_New(); | |||
if (info.probed) { | |||
Py_INCREF(Py_True); | |||
PyDict_SetItemString(info_dict, "probed", Py_True); | |||
} | |||
else { | |||
Py_INCREF(Py_False); | |||
PyDict_SetItemString(info_dict, "probed", Py_False); | |||
} | |||
PyObject* obj; | |||
obj = PyString_FromString(info.name.c_str()); | |||
PyDict_SetItemString(info_dict, "name", obj); | |||
obj = PyInt_FromLong(info.outputChannels); | |||
PyDict_SetItemString(info_dict, "outputChannels", obj); | |||
obj = PyInt_FromLong(info.inputChannels); | |||
PyDict_SetItemString(info_dict, "inputChannels", obj); | |||
obj = PyInt_FromLong(info.duplexChannels); | |||
PyDict_SetItemString(info_dict, "duplexChannels", obj); | |||
if (info.isDefaultOutput) { | |||
Py_INCREF(Py_True); | |||
PyDict_SetItemString(info_dict, "isDefaultOutput", Py_True); | |||
} | |||
else { | |||
Py_INCREF(Py_False); | |||
PyDict_SetItemString(info_dict, "isDefaultOutput", Py_False); | |||
} | |||
if (info.isDefaultInput) { | |||
Py_INCREF(Py_True); | |||
PyDict_SetItemString(info_dict, "isDefaultInput", Py_True); | |||
} | |||
else { | |||
Py_INCREF(Py_False); | |||
PyDict_SetItemString(info_dict, "isDefaultInput", Py_False); | |||
} | |||
return info_dict; | |||
} | |||
catch(RtError &error) { | |||
PyErr_SetString(RtAudioError, error.getMessage().c_str()); | |||
Py_INCREF(RtAudioError); | |||
return NULL; | |||
} | |||
} | |||
static PyObject* RtAudio_getDefaultOutputDevice(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
return PyInt_FromLong(self->dac->getDefaultOutputDevice()); | |||
} | |||
static PyObject* RtAudio_getDefaultInputDevice(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
return PyInt_FromLong(self->dac->getDefaultInputDevice()); | |||
} | |||
static PyObject* RtAudio_getStreamTime(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
return PyFloat_FromDouble( self->dac->getStreamTime() ); | |||
} | |||
static PyObject* RtAudio_getStreamLatency(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
return PyInt_FromLong( self->dac->getStreamLatency() ); | |||
} | |||
static PyObject* RtAudio_getStreamSampleRate(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
return PyInt_FromLong( self->dac->getStreamSampleRate() ); | |||
} | |||
static PyObject* RtAudio_showWarnings(PyRtAudio *self, PyObject *args) | |||
{ | |||
if (self == NULL || self->dac == NULL) return NULL; | |||
PyObject *obj; | |||
if (!PyArg_ParseTuple(args, "O", &obj)) | |||
return NULL; | |||
if (!PyBool_Check(obj)) | |||
return NULL; | |||
if (obj == Py_True) | |||
self->dac->showWarnings(true); | |||
else if (obj == Py_False) | |||
self->dac->showWarnings(false); | |||
else { | |||
printf("not true nor false\n"); | |||
} | |||
Py_RETURN_NONE; | |||
} | |||
static PyMethodDef RtAudio_methods[] = | |||
{ | |||
// TO BE DONE: getCurrentApi(void) | |||
{"getDeviceCount", (PyCFunction) RtAudio_getDeviceCount, METH_NOARGS, | |||
"A public function that queries for the number of audio devices available."}, | |||
{"getDeviceInfo", (PyCFunction) RtAudio_getDeviceInfo, METH_VARARGS, | |||
"Return a dictionary with information for a specified device number."}, | |||
{"getDefaultOutputDevice", (PyCFunction) RtAudio_getDefaultOutputDevice, METH_NOARGS, | |||
"A function that returns the index of the default output device."}, | |||
{"getDefaultInputDevice", (PyCFunction) RtAudio_getDefaultInputDevice, METH_NOARGS, | |||
"A function that returns the index of the default input device."}, | |||
{"openStream", (PyCFunction) RtAudio_openStream, METH_VARARGS, | |||
"A public method for opening a stream with the specified parameters."}, | |||
{"closeStream", (PyCFunction) RtAudio_closeStream, METH_NOARGS, | |||
"A function that closes a stream and frees any associated stream memory. "}, | |||
{"startStream", (PyCFunction) RtAudio_startStream, METH_NOARGS, | |||
"A function that starts a stream. "}, | |||
{"stopStream", (PyCFunction) RtAudio_stopStream, METH_NOARGS, | |||
"Stop a stream, allowing any samples remaining in the output queue to be played. "}, | |||
{"abortStream", (PyCFunction) RtAudio_abortStream, METH_NOARGS, | |||
"Stop a stream, discarding any samples remaining in the input/output queue."}, | |||
{"isStreamOpen", (PyCFunction) RtAudio_isStreamOpen, METH_NOARGS, | |||
"Returns true if a stream is open and false if not."}, | |||
{"isStreamRunning", (PyCFunction) RtAudio_isStreamRunning, METH_NOARGS, | |||
"Returns true if the stream is running and false if it is stopped or not open."}, | |||
{"getStreamTime", (PyCFunction) RtAudio_getStreamTime, METH_NOARGS, | |||
"Returns the number of elapsed seconds since the stream was started."}, | |||
{"getStreamLatency", (PyCFunction) RtAudio_getStreamLatency, METH_NOARGS, | |||
"Returns the internal stream latency in sample frames."}, | |||
{"getStreamSampleRate", (PyCFunction) RtAudio_getStreamSampleRate, METH_NOARGS, | |||
"Returns actual sample rate in use by the stream."}, | |||
{"showWarnings", (PyCFunction) RtAudio_showWarnings, METH_VARARGS, | |||
"Specify whether warning messages should be printed to stderr."}, | |||
// TO BE DONE: getCompiledApi (std::vector< RtAudio::Api > &apis) throw () | |||
{NULL} | |||
}; | |||
static PyTypeObject RtAudio_type = { | |||
PyObject_HEAD_INIT(NULL) | |||
0, /*ob_size*/ | |||
"rtaudio.RtAudio", /*tp_name*/ | |||
sizeof(RtAudio), /*tp_basicsize*/ | |||
0, /*tp_itemsize*/ | |||
(destructor) RtAudio_dealloc, /*tp_dealloc*/ | |||
0, /*tp_print*/ | |||
0, /*tp_getattr*/ | |||
0, /*tp_setattr*/ | |||
0, /*tp_compare*/ | |||
0, /*tp_repr*/ | |||
0, /*tp_as_number*/ | |||
0, /*tp_as_sequence*/ | |||
0, /*tp_as_mapping*/ | |||
0, /*tp_hash */ | |||
0, /*tp_call*/ | |||
0, /*tp_str*/ | |||
0, /*tp_getattro*/ | |||
0, /*tp_setattro*/ | |||
0, /*tp_as_buffer*/ | |||
Py_TPFLAGS_DEFAULT, /*tp_flags*/ | |||
"Audio input device", /* tp_doc */ | |||
0, /* tp_traverse */ | |||
0, /* tp_clear */ | |||
0, /* tp_richcompare */ | |||
0, /* tp_weaklistoffset */ | |||
0, /* tp_iter */ | |||
0, /* tp_iternext */ | |||
RtAudio_methods, /* tp_methods */ | |||
0, /* tp_members */ | |||
0, /* tp_getset */ | |||
0, /* tp_base */ | |||
0, /* tp_dict */ | |||
0, /* tp_descr_get */ | |||
0, /* tp_descr_set */ | |||
0, /* tp_dictoffset */ | |||
(initproc)RtAudio_init, /* tp_init */ | |||
0, /* tp_alloc */ | |||
RtAudio_new, /* tp_new */ | |||
0, /* Low-level free-memory routine */ | |||
0, /* For PyObject_IS_GC */ | |||
0, // PyObject *tp_bases; | |||
0, // PyObject *tp_mro; /* method resolution order */ | |||
0, //PyObject *tp_cache; | |||
0, //PyObject *tp_subclasses; | |||
0, //PyObject *tp_weaklist; | |||
0, //destructor tp_del; | |||
//0, /* Type attribute cache version tag. Added in version 2.6 */ | |||
}; | |||
#ifndef PyMODINIT_FUNC /* declarations for DLL import/export */ | |||
#define PyMODINIT_FUNC void | |||
#endif | |||
PyMODINIT_FUNC | |||
initrtaudio(void) | |||
{ | |||
PyEval_InitThreads(); | |||
if (PyType_Ready(&RtAudio_type) < 0) | |||
return; | |||
PyObject* module = Py_InitModule3("rtaudio", NULL, "RtAudio wrapper."); | |||
if (module == NULL) | |||
return; | |||
Py_INCREF(&RtAudio_type); | |||
PyModule_AddObject(module, "RtAudio", (PyObject *)&RtAudio_type); | |||
RtAudioError = PyErr_NewException("rtaudio.RtError", NULL, NULL); | |||
Py_INCREF(RtAudioError); | |||
PyModule_AddObject(module, "RtError", RtAudioError); | |||
} | |||
} |
@@ -1,58 +0,0 @@ | |||
#!/bin/env python | |||
import os | |||
from distutils.core import setup, Extension | |||
if hasattr(os, 'uname'): | |||
OSNAME = os.uname()[0] | |||
else: | |||
OSNAME = 'Windows' | |||
define_macros = [] | |||
libraries = [] | |||
extra_link_args = [] | |||
extra_compile_args = ['-I../../../'] | |||
sources = ['rtaudiomodule.cpp', '../../../RtAudio.cpp'] | |||
if OSNAME == 'Linux': | |||
define_macros=[("__LINUX_ALSA__", ''), | |||
('__LINUX_JACK__', ''), | |||
('__LINUX_OSS__', '')] | |||
libraries = ['asound', 'jack', 'pthread'] | |||
elif OSNAME == 'Darwin': | |||
define_macros = [('__MACOSX_CORE__', '')] | |||
libraries = ['pthread', 'stdc++'] | |||
extra_link_args = ['-framework', 'CoreAudio'] | |||
elif OSNAME == 'Windows': | |||
define_macros = [('__WINDOWS_DS__', None), | |||
('__WINDOWS_ASIO__', None), | |||
('__LITTLE_ENDIAN__',None), | |||
('WIN32',None)] | |||
libraries = ['winmm', 'dsound', 'Advapi32','Ole32','User32'] | |||
sources += ['../../../include/asio.cpp', | |||
'../../../include/asiodrivers.cpp', | |||
'../../../include/asiolist.cpp', | |||
'../../../include/iasiothiscallresolver.cpp'] | |||
extra_compile_args.append('-I../../../include/') | |||
extra_compile_args.append('-EHsc') | |||
audio = Extension('rtaudio', | |||
sources=sources, | |||
libraries=libraries, | |||
define_macros=define_macros, | |||
extra_compile_args = extra_compile_args, | |||
extra_link_args = extra_link_args, | |||
) | |||
setup(name = 'rtaudio', | |||
version = '0.1', | |||
description = 'Python RtAudio interface', | |||
ext_modules = [audio]) | |||
@@ -1,28 +0,0 @@ | |||
/*! \page acknowledge Acknowledgements | |||
Many thanks to the following people for providing bug fixes and improvements: | |||
<UL> | |||
<LI>Stefan Arisona</LI> | |||
<LI>Vincent Bénony</LI> | |||
<LI>Rasmus Ekman</LI> | |||
<LI>Anders Ervik</LI> | |||
<LI>Robin Davies (Windows DS and ASIO)</LI> | |||
<LI>Martin Koegler</LI> | |||
<LI>Dmitry Kostjuchenko</LI> | |||
<LI>Oliver Larkin</LI> | |||
<LI>Antoine Lefebvre</LI> | |||
<LI>Carlos Luna</LI> | |||
<LI>Dominic Mazzoni</LI> | |||
<LI>Tristan Matthews</LI> | |||
<LI>Peter Meerwald (PulseAudio)</LI> | |||
<LI>Benjamin Schroeder</LI> | |||
<LI>Ryan Williams (Windows non-MS compiler ASIO support)</LI> | |||
<LI>Ed Wildgoose (Linux ALSA and Jack)</LI> | |||
</UL> | |||
The RtAudio API incorporates many of the concepts developed in the <A href="http://www.portaudio.com/">PortAudio</A> project by Phil Burk and Ross Bencina. Early development also incorporated ideas from Bill Schottstaedt's <A href="http://www-ccrma.stanford.edu/software/snd/sndlib/">sndlib</A>. The CCRMA <A href="http://www-ccrma.stanford.edu/groups/soundwire/">SoundWire group</A> provided valuable feedback during the API proposal stages. | |||
The early 2.0 version of RtAudio was slowly developed over the course of many months while in residence at the <A href="http://www.iua.upf.es/">Institut Universitari de L'Audiovisual (IUA)</A> in Barcelona, Spain and the <A href="http://www.acoustics.hut.fi/">Laboratory of Acoustics and Audio Signal Processing</A> at the Helsinki University of Technology, Finland. Much subsequent development happened while working at the <A href="http://www-ccrma.stanford.edu/">Center for Computer Research in Music and Acoustics (CCRMA)</A> at <A href="http://www.stanford.edu/">Stanford University</A>. All recent versions of RtAudio have been completed while working as an assistant / associate professor of <a href="http://www.music.mcgill.ca/musictech/">Music Technology</a> at <a href="http://www.mcgill.ca/">McGill University</a>. This work was supported in part by the United States Air Force Office of Scientific Research (grant \#F49620-99-1-0293). | |||
*/ |
@@ -1,39 +0,0 @@ | |||
/*! \page apinotes API Notes | |||
RtAudio is designed to provide a common API across the various supported operating systems and audio libraries. Despite that, some issues should be mentioned with regard to each. | |||
\section linux Linux: | |||
RtAudio for Linux was developed under Redhat distributions 7.0 - Fedora. Four different audio APIs are supported on Linux platforms: <A href="http://www.opensound.com/oss.html">OSS</A> (versions >= 4.0), <A href="http://www.alsa-project.org/">ALSA</A>, <A href="http://jackit.sourceforge.net/">Jack</A>, and <A href="http://www.freedesktop.org/wiki/Software/PulseAudio">PulseAudio</A>. Note that RtAudio now only supports the newer version 4.0 OSS API. The ALSA API is now part of the Linux kernel and offers significantly better functionality than the OSS API. RtAudio provides support for the 1.0 and higher versions of ALSA. Jack is a low-latency audio server written primarily for the GNU/Linux operating system. It can connect a number of different applications to an audio device, as well as allow them to share audio between themselves. Input/output latency on the order of 15 milliseconds can typically be achieved using any of the Linux APIs by fine-tuning the RtAudio buffer parameters (without kernel modifications). Latencies on the order of 5 milliseconds or less can be achieved using a low-latency kernel patch and increasing FIFO scheduling priority. The pthread library, which is used for callback functionality, is a standard component of all Linux distributions. | |||
The ALSA library includes OSS emulation support. That means that you can run programs compiled for the OSS API even when using the ALSA drivers and library. It should be noted however that OSS emulation under ALSA is not perfect. Specifically, channel number queries seem to consistently produce invalid results. While OSS emulation is successful for the majority of RtAudio tests, it is recommended that the native ALSA implementation of RtAudio be used on systems which have ALSA drivers installed. | |||
The ALSA implementation of RtAudio makes no use of the ALSA "plug" interface. All necessary data format conversions, channel compensation, de-interleaving, and byte-swapping is handled by internal RtAudio routines. | |||
\section macosx Macintosh OS-X (CoreAudio and Jack): | |||
The Apple CoreAudio API is designed to use a separate callback procedure for each of its audio devices. A single RtAudio duplex stream using two different devices is supported, though it cannot be guaranteed to always behave correctly because we cannot synchronize these two callbacks. The <I>numberOfBuffers</I> parameter to the RtAudio::openStream() function has no affect in this implementation. | |||
It is not possible to have multiple instances of RtAudio accessing the same CoreAudio device. | |||
The RtAudio Jack support can be compiled on Macintosh OS-X systems, as well as in Linux. | |||
\section windowsds Windows (DirectSound): | |||
The \c configure script provides support for the MinGW compiler. DirectSound support is specified with the "--with-ds" flag. | |||
In order to compile RtAudio under Windows for the DirectSound API, you must have the header and source files for DirectSound version 5.0 or higher. As far as I know, there is no DirectSoundCapture support for Windows NT. Audio output latency with DirectSound can be reasonably good, especially since RtAudio version 3.0.2. Input audio latency still tends to be bad but better since version 3.0.2. RtAudio was originally developed with Visual C++ version 6.0 but has been tested with .NET. | |||
The DirectSound version of RtAudio can be compiled with or without the UNICODE preprocessor definition. | |||
\section windowsasio Windows (ASIO): | |||
ASIO support using MinGW and the \c configure script is specified with the "--with-asio" flag. | |||
The Steinberg ASIO audio API allows only a single device driver to be loaded and accessed at a time. ASIO device drivers must be supplied by audio hardware manufacturers, though ASIO emulation is possible on top of systems with DirectSound drivers. The <I>numberOfBuffers</I> parameter to the RtAudio::openStream() function has no affect in this implementation. | |||
A number of ASIO source and header files are required for use with RtAudio. Specifically, an RtAudio project must include the following files: <TT>asio.h,cpp; asiodrivers.h,cpp; asiolist.h,cpp; asiodrvr.h; asiosys.h; ginclude.h; iasiodrv.h; iasiothiscallresolver.h,cpp</TT>. The Visual C++ projects found in <TT>/tests/Windows/</TT> compile both ASIO and DirectSound support. | |||
The Steinberg provided <TT>asiolist</TT> class does not compile when the preprocessor definition UNICODE is defined. Note that this could be an issue when using RtAudio with Qt, though Qt programs appear to compile without the UNICODE definition (try <tt>DEFINES -= UNICODE</tt> in your .pro file). RtAudio with ASIO support has been tested using the MinGW compiler under Windows XP, as well as in the Visual Studio environment. | |||
*/ |
@@ -1,84 +0,0 @@ | |||
/*! \page compiling Debugging & Compiling | |||
\section debug Debugging | |||
If you are having problems getting RtAudio to run on your system, make sure to pass a value of \e true to the RtAudio::showWarnings() function (this is the default setting). A variety of warning messages will be displayed which may help in determining the problem. Also, try using the programs included in the <tt>tests</tt> directory. The program <tt>audioprobe</tt> displays the queried capabilities of all hardware devices found for all APIs compiled. When using the ALSA and JACK APIs, further information can be displayed by defining the preprocessor definition __RTAUDIO_DEBUG__. | |||
\section compile Compiling | |||
In order to compile RtAudio for a specific OS and audio API, it is necessary to supply the appropriate preprocessor definition and library within the compiler statement: | |||
<P> | |||
<TABLE BORDER=2 COLS=5 WIDTH="100%"> | |||
<TR BGCOLOR="beige"> | |||
<TD WIDTH="5%"><B>OS:</B></TD> | |||
<TD WIDTH="5%"><B>Audio API:</B></TD> | |||
<TD WIDTH="5%"><B>C++ Class:</B></TD> | |||
<TD WIDTH="5%"><B>Preprocessor Definition:</B></TD> | |||
<TD WIDTH="5%"><B>Library or Framework:</B></TD> | |||
<TD><B>Example Compiler Statement:</B></TD> | |||
</TR> | |||
<TR> | |||
<TD>Linux</TD> | |||
<TD>ALSA</TD> | |||
<TD>RtApiAlsa</TD> | |||
<TD>__LINUX_ALSA__</TD> | |||
<TD><TT>asound, pthread</TT></TD> | |||
<TD><TT>g++ -Wall -D__LINUX_ALSA__ -o audioprobe audioprobe.cpp RtAudio.cpp -lasound -lpthread</TT></TD> | |||
</TR> | |||
<TR> | |||
<TD>Linux</TD> | |||
<TD>PulseAudio</TD> | |||
<TD>RtApiPulse</TD> | |||
<TD>__LINUX_PULSE__</TD> | |||
<TD><TT>pthread</TT></TD> | |||
<TD><TT>g++ -Wall -D__LINUX_PULSE__ -o audioprobe audioprobe.cpp RtAudio.cpp -lpthread</TT></TD> | |||
</TR> | |||
<TR> | |||
<TD>Linux</TD> | |||
<TD>OSS</TD> | |||
<TD>RtApiOss</TD> | |||
<TD>__LINUX_OSS__</TD> | |||
<TD><TT>pthread</TT></TD> | |||
<TD><TT>g++ -Wall -D__LINUX_OSS__ -o audioprobe audioprobe.cpp RtAudio.cpp -lpthread</TT></TD> | |||
</TR> | |||
<TR> | |||
<TD>Linux or Macintosh OS-X</TD> | |||
<TD>Jack Audio Server</TD> | |||
<TD>RtApiJack</TD> | |||
<TD>__UNIX_JACK__</TD> | |||
<TD><TT>jack, pthread</TT></TD> | |||
<TD><TT>g++ -Wall -D__UNIX_JACK__ -o audioprobe audioprobe.cpp RtAudio.cpp `pkg-config --cflags --libs jack` -lpthread</TT></TD> | |||
</TR> | |||
<TR> | |||
<TD>Macintosh OS-X</TD> | |||
<TD>CoreAudio</TD> | |||
<TD>RtApiCore</TD> | |||
<TD>__MACOSX_CORE__</TD> | |||
<TD><TT>pthread, CoreAudio</TT></TD> | |||
<TD><TT>g++ -Wall -D__MACOSX_CORE__ -o audioprobe audioprobe.cpp RtAudio.cpp -framework CoreAudio -lpthread</TT></TD> | |||
</TR> | |||
<TR> | |||
<TD>Windows</TD> | |||
<TD>Direct Sound</TD> | |||
<TD>RtApiDs</TD> | |||
<TD>__WINDOWS_DS__</TD> | |||
<TD><TT>dsound.lib (ver. 5.0 or higher), multithreaded</TT></TD> | |||
<TD><I>compiler specific</I></TD> | |||
</TR> | |||
<TR> | |||
<TD>Windows</TD> | |||
<TD>ASIO</TD> | |||
<TD>RtApiAsio</TD> | |||
<TD>__WINDOWS_ASIO__</TD> | |||
<TD><I>various ASIO header and source files</I></TD> | |||
<TD><I>compiler specific</I></TD> | |||
</TR> | |||
</TABLE> | |||
<P> | |||
The example compiler statements above could be used to compile the <TT>audioprobe.cpp</TT> example file, assuming that <TT>audioprobe.cpp</TT>, <TT>RtAudio.h</TT>, <tt>RtError.h</tt>, and <TT>RtAudio.cpp</TT> all exist in the same directory. | |||
*/ |
@@ -1,76 +0,0 @@ | |||
/*! \page duplex Duplex Mode | |||
Finally, it is easy to use RtAudio for simultaneous audio input/output, or duplex operation. In this example, we simply pass the input data back to the output. | |||
\code | |||
#include "RtAudio.h" | |||
#include <iostream> | |||
#include <cstdlib> | |||
#include <cstring> | |||
// Pass-through function. | |||
int inout( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, | |||
double streamTime, RtAudioStreamStatus status, void *data ) | |||
{ | |||
// Since the number of input and output channels is equal, we can do | |||
// a simple buffer copy operation here. | |||
if ( status ) std::cout << "Stream over/underflow detected." << std::endl; | |||
unsigned long *bytes = (unsigned long *) data; | |||
memcpy( outputBuffer, inputBuffer, *bytes ); | |||
return 0; | |||
} | |||
int main() | |||
{ | |||
RtAudio adac; | |||
if ( adac.getDeviceCount() < 1 ) { | |||
std::cout << "\nNo audio devices found!\n"; | |||
exit( 0 ); | |||
} | |||
// Set the same number of channels for both input and output. | |||
unsigned int bufferBytes, bufferFrames = 512; | |||
RtAudio::StreamParameters iParams, oParams; | |||
iParams.deviceId = 0; // first available device | |||
iParams.nChannels = 2; | |||
oParams.deviceId = 0; // first available device | |||
oParams.nChannels = 2; | |||
try { | |||
adac.openStream( &oParams, &iParams, RTAUDIO_SINT32, 44100, &bufferFrames, &inout, (void *)&bufferBytes ); | |||
} | |||
catch ( RtError& e ) { | |||
e.printMessage(); | |||
exit( 0 ); | |||
} | |||
bufferBytes = bufferFrames * 2 * 4; | |||
try { | |||
adac.startStream(); | |||
char input; | |||
std::cout << "\nRunning ... press <enter> to quit.\n"; | |||
std::cin.get(input); | |||
// Stop the stream. | |||
adac.stopStream(); | |||
} | |||
catch ( RtError& e ) { | |||
e.printMessage(); | |||
goto cleanup; | |||
} | |||
cleanup: | |||
if ( adac.isStreamOpen() ) adac.closeStream(); | |||
return 0; | |||
} | |||
\endcode | |||
In this example, audio recorded by the stream input will be played out during the next round of audio processing. | |||
Note that a duplex stream can make use of two different devices (except when using the Linux Jack and Windows ASIO APIs). However, this may cause timing problems due to possible device clock variations, unless a common external "sync" is provided. | |||
*/ |
@@ -1,5 +0,0 @@ | |||
/*! \page errors Error Handling | |||
RtAudio makes restrained use of C++ exceptions. That is, exceptions are thrown only when system errors occur that prevent further class operation or when the user makes invalid function calls. In other cases, a warning message may be displayed and an appropriate value is returned. For example, if a system error occurs when processing the RtAudio::getDeviceCount() function, the return value is zero. In such a case, the user cannot expect to make use of most other RtAudio functions because no devices are available (and thus a stream cannot be opened). A client can call the function RtAudio::showWarnings() with a boolean argument to enable or disable the printing of warning messages to <tt>stderr</tt>. By default, warning messages are displayed. There is a protected RtAudio method, error(), that can be modified to globally control how these messages are handled and reported. | |||
*/ |
@@ -1,8 +0,0 @@ | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,10 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> |
@@ -1,30 +0,0 @@ | |||
/*! \page license License | |||
RtAudio: a set of realtime audio i/o C++ classes<BR> | |||
Copyright (c) 2001-2012 Gary P. Scavone | |||
Permission is hereby granted, free of charge, to any person | |||
obtaining a copy of this software and associated documentation files | |||
(the "Software"), to deal in the Software without restriction, | |||
including without limitation the rights to use, copy, modify, merge, | |||
publish, distribute, sublicense, and/or sell copies of the Software, | |||
and to permit persons to whom the Software is furnished to do so, | |||
subject to the following conditions: | |||
The above copyright notice and this permission notice shall be | |||
included in all copies or substantial portions of the Software. | |||
Any person wishing to distribute modifications to the Software is | |||
asked to send the modifications to the original developer so that | |||
they can be incorporated into the canonical version. This is, | |||
however, not a binding provision of this license. | |||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | |||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | |||
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR | |||
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | |||
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | |||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
*/ |
@@ -1,7 +0,0 @@ | |||
/*! \page multi Using Simultaneous Multiple APIs | |||
Because support for each audio API is encapsulated in a specific RtApi subclass, it is possible to compile and instantiate multiple API-specific subclasses on a given operating system. For example, one can compile both the RtApiDs and RtApiAsio classes on Windows operating systems by providing the appropriate preprocessor definitions, include files, and libraries for each. In a run-time situation, one might first attempt to determine whether any ASIO device drivers exist. This can be done by specifying the api argument RtAudio::WINDOWS_ASIO when attempting to create an instance of RtAudio. If no available devices are found, then an instance of RtAudio with the api argument RtAudio::WINDOWS_DS can be created. Alternately, if no api argument is specified, RtAudio will first look for an ASIO instance and then a DirectSound instance (on Linux systems, the default API search order is Jack, Alsa, and finally OSS). In theory, it should also be possible to have separate instances of RtAudio open at the same time with different underlying audio API support, though this has not been tested. It is difficult to know how well different audio APIs can simultaneously coexist on a given operating system. In particular, it is unlikely that the same device could be simultaneously controlled with two different audio APIs. | |||
The static function RtAudio::getCompiledApi() is provided to determine the available compiled API support. The function RtAudio::getCurrentApi() indicates the API selected for a given RtAudio instance. | |||
*/ |
@@ -1,82 +0,0 @@ | |||
/*! \page playback Playback | |||
In this example, we provide a complete program that demonstrates the use of RtAudio for audio playback. Our program produces a two-channel sawtooth waveform for output. | |||
\code | |||
#include "RtAudio.h" | |||
#include <iostream> | |||
#include <cstdlib> | |||
// Two-channel sawtooth wave generator. | |||
int saw( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, | |||
double streamTime, RtAudioStreamStatus status, void *userData ) | |||
{ | |||
unsigned int i, j; | |||
double *buffer = (double *) outputBuffer; | |||
double *lastValues = (double *) userData; | |||
if ( status ) | |||
std::cout << "Stream underflow detected!" << std::endl; | |||
// Write interleaved audio data. | |||
for ( i=0; i<nBufferFrames; i++ ) { | |||
for ( j=0; j<2; j++ ) { | |||
*buffer++ = lastValues[j]; | |||
lastValues[j] += 0.005 * (j+1+(j*0.1)); | |||
if ( lastValues[j] >= 1.0 ) lastValues[j] -= 2.0; | |||
} | |||
} | |||
return 0; | |||
} | |||
int main() | |||
{ | |||
RtAudio dac; | |||
if ( dac.getDeviceCount() < 1 ) { | |||
std::cout << "\nNo audio devices found!\n"; | |||
exit( 0 ); | |||
} | |||
RtAudio::StreamParameters parameters; | |||
parameters.deviceId = dac.getDefaultOutputDevice(); | |||
parameters.nChannels = 2; | |||
parameters.firstChannel = 0; | |||
unsigned int sampleRate = 44100; | |||
unsigned int bufferFrames = 256; // 256 sample frames | |||
double data[2]; | |||
try { | |||
dac.openStream( ¶meters, NULL, RTAUDIO_FLOAT64, | |||
sampleRate, &bufferFrames, &saw, (void *)&data ); | |||
dac.startStream(); | |||
} | |||
catch ( RtError& e ) { | |||
e.printMessage(); | |||
exit( 0 ); | |||
} | |||
char input; | |||
std::cout << "\nPlaying ... press <enter> to quit.\n"; | |||
std::cin.get( input ); | |||
try { | |||
// Stop the stream | |||
dac.stopStream(); | |||
} | |||
catch (RtError& e) { | |||
e.printMessage(); | |||
} | |||
if ( dac.isStreamOpen() ) dac.closeStream(); | |||
return 0; | |||
} | |||
\endcode | |||
We open the stream in exactly the same way as the previous example (except with a data format change) and specify the address of our callback function \e "saw()". The callback function will automatically be invoked when the underlying audio system needs data for output. Note that the callback function is called only when the stream is "running" (between calls to the RtAudio::startStream() and RtAudio::stopStream() functions). We can also pass a pointer value to the RtAudio::openStream() function that is made available in the callback function. In this way, it is possible to gain access to arbitrary data created in our \e main() function from within the globally defined callback function. | |||
In this example, we stop the stream with an explicit call to RtAudio::stopStream(). It is also possible to stop a stream by returning a non-zero value from the callback function. A return value of 1 will cause the stream to finish draining its internal buffers and then halt (equivalent to calling the RtAudio::stopStream() function). A return value of 2 will cause the stream to stop immediately (equivalent to calling the RtAudio::abortStream() function). | |||
*/ |
@@ -1,70 +0,0 @@ | |||
/*! \page probe Probing Device Capabilities | |||
A programmer may wish to query the available audio device capabilities before deciding which to use. The following example outlines how this can be done. | |||
\code | |||
// audioprobe.cpp | |||
#include <iostream> | |||
#include "RtAudio.h" | |||
int main() | |||
{ | |||
RtAudio audio; | |||
// Determine the number of devices available | |||
unsigned int devices = audio.getDeviceCount(); | |||
// Scan through devices for various capabilities | |||
RtAudio::DeviceInfo info; | |||
for ( unsigned int i=0; i<=devices; i++ ) { | |||
info = audio.getDeviceInfo( i ); | |||
if ( info.probed == true ) { | |||
// Print, for example, the maximum number of output channels for each device | |||
std::cout << "device = " << i; | |||
std::cout << ": maximum output channels = " << info.outputChannels << "\n"; | |||
} | |||
} | |||
return 0; | |||
} | |||
\endcode | |||
The RtAudio::DeviceInfo structure is defined in RtAudio.h and provides a variety of information useful in assessing the capabilities of a device: | |||
\code | |||
typedef struct RtAudio::DeviceInfo { | |||
bool probed; // true if the device capabilities were successfully probed. | |||
std::string name; // Character string device identifier. | |||
unsigned int outputChannels; // Maximum output channels supported by device. | |||
unsigned int inputChannels; // Maximum input channels supported by device. | |||
unsigned int duplexChannels; // Maximum simultaneous input/output channels supported by device. | |||
bool isDefaultOutput; // true if this is the default output device. | |||
bool isDefaultInput; // true if this is the default input device. | |||
std::vector<unsigned int> sampleRates; // Supported sample rates. | |||
RtAudioFormat nativeFormats; // Bit mask of supported data formats. | |||
}; | |||
\endcode | |||
The following data formats are defined and fully supported by RtAudio: | |||
\code | |||
typedef unsigned long RtAudioFormat; | |||
static const RtAudioFormat RTAUDIO_SINT8; // Signed 8-bit integer | |||
static const RtAudioFormat RTAUDIO_SINT16; // Signed 16-bit integer | |||
static const RtAudioFormat RTAUDIO_SINT24; // Signed 24-bit integer (lower 3 bytes of 32-bit signed integer.) | |||
static const RtAudioFormat RTAUDIO_SINT32; // Signed 32-bit integer | |||
static const RtAudioFormat RTAUDIO_FLOAT32; // 32-bit float normalized between +/- 1.0 | |||
static const RtAudioFormat RTAUDIO_FLOAT64; // 64-bit double normalized between +/- 1.0 | |||
\endcode | |||
The \c nativeFormats member of the RtAudio::DeviceInfo structure is a bit mask of the above formats which are natively supported by the device. However, RtAudio will automatically provide format conversion if a particular format is not natively supported. When the \c probed member of the RtAudio::DeviceInfo structure is false, the remaining structure members are undefined and the device is probably unusable. | |||
Some audio devices may require a minimum channel value greater than one. RtAudio will provide automatic channel number compensation when the number of channels set by the user is less than that required by the device. Channel compensation is <I>NOT</I> possible when the number of channels set by the user is greater than that supported by the device. | |||
It should be noted that the capabilities reported by a device driver or underlying audio API are not always accurate and/or may be dependent on a combination of device settings. For this reason, RtAudio does not rely on the queried values when attempting to open a stream. | |||
*/ |
@@ -1,68 +0,0 @@ | |||
/*! \page recording Recording | |||
Using RtAudio for audio input is almost identical to the way it is used for playback. Here's the blocking playback example rewritten for recording: | |||
\code | |||
#include "RtAudio.h" | |||
#include <iostream> | |||
#include <cstdlib> | |||
#include <cstring> | |||
int record( void *outputBuffer, void *inputBuffer, unsigned int nBufferFrames, | |||
double streamTime, RtAudioStreamStatus status, void *userData ) | |||
{ | |||
if ( status ) | |||
std::cout << "Stream overflow detected!" << std::endl; | |||
// Do something with the data in the "inputBuffer" buffer. | |||
return 0; | |||
} | |||
int main() | |||
{ | |||
RtAudio adc; | |||
if ( adc.getDeviceCount() < 1 ) { | |||
std::cout << "\nNo audio devices found!\n"; | |||
exit( 0 ); | |||
} | |||
RtAudio::StreamParameters parameters; | |||
parameters.deviceId = adc.getDefaultInputDevice(); | |||
parameters.nChannels = 2; | |||
parameters.firstChannel = 0; | |||
unsigned int sampleRate = 44100; | |||
unsigned int bufferFrames = 256; // 256 sample frames | |||
try { | |||
adc.openStream( NULL, ¶meters, RTAUDIO_SINT16, | |||
sampleRate, &bufferFrames, &record ); | |||
adc.startStream(); | |||
} | |||
catch ( RtError& e ) { | |||
e.printMessage(); | |||
exit( 0 ); | |||
} | |||
char input; | |||
std::cout << "\nRecording ... press <enter> to quit.\n"; | |||
std::cin.get( input ); | |||
try { | |||
// Stop the stream | |||
adc.stopStream(); | |||
} | |||
catch (RtError& e) { | |||
e.printMessage(); | |||
} | |||
if ( adc.isStreamOpen() ) adc.closeStream(); | |||
return 0; | |||
} | |||
\endcode | |||
In this example, we pass the address of the stream parameter structure as the second argument of the RtAudio::openStream() function and pass a NULL value for the output stream parameters. In this example, the \e record() callback function performs no specific operations. | |||
*/ |
@@ -1,48 +0,0 @@ | |||
/*! \page settings Device Settings | |||
The next step in using RtAudio is to open a stream with particular device and parameter settings. | |||
\code | |||
#include "RtAudio.h" | |||
int main() | |||
{ | |||
RtAudio dac; | |||
if ( dac.getDeviceCount() == 0 ) exit( 0 ); | |||
RtAudio::StreamParameters parameters; | |||
parameters.deviceId = dac.getDefaultOutputDevice(); | |||
parameters.nChannels = 2; | |||
unsigned int sampleRate = 44100; | |||
unsigned int bufferFrames = 256; // 256 sample frames | |||
RtAudio::StreamOptions options; | |||
options.flags = RTAUDIO_NONINTERLEAVED; | |||
try { | |||
dac.openStream( ¶meters, NULL, RTAUDIO_FLOAT32, | |||
sampleRate, &bufferFrames, &myCallback, NULL, &options ); | |||
} | |||
catch ( RtError& e ) { | |||
std::cout << '\n' << e.getMessage() << '\n' << std::endl; | |||
exit( 0 ); | |||
} | |||
return 0; | |||
} | |||
\endcode | |||
The RtAudio::openStream() function attempts to open a stream with a specified set of parameter values. In the above example, we attempt to open a two channel playback stream using the default output device, 32-bit floating point data, a sample rate of 44100 Hz, and a frame rate of 256 sample frames per output buffer. If the user specifies an invalid parameter value (such as a device id greater than or equal to the number of enumerated devices), an RtError is thrown of type = INVALID_USE. If a system error occurs or the device does not support the specified parameter values, an RtError of type = SYSTEM_ERROR is thrown. In either case, a descriptive error message is bundled with the exception and can be queried with the RtError::getMessage() or RtError::what() functions. | |||
RtAudio provides four signed integer and two floating point data formats which can be specified using the RtAudioFormat parameter values mentioned earlier. If the opened device does not natively support the given format, RtAudio will automatically perform the necessary data format conversion. | |||
The \c bufferFrames parameter specifies the desired number of sample frames that will be written to and/or read from a device per write/read operation. This parameter can be used to control stream latency though there is no guarantee that the passed value will be that used by a device. In general, a lower \c bufferFrames value will produce less latency but perhaps less robust performance. A value of zero can be specified, in which case the smallest allowable value will be used. The \c bufferFrames parameter is passed as a pointer and the actual value used by the stream is set during the device setup procedure. \c bufferFrames values should be a power of two. Optimal and allowable buffer values tend to vary between systems and devices. Stream latency can also be controlled via the optional RtAudio::StreamOptions member \c numberOfBuffers (not used in the example above), though this tends to be more system dependent. In particular, the \c numberOfBuffers parameter is ignored when using the OS-X Core Audio, Jack, and the Windows ASIO APIs. | |||
As noted earlier, the device capabilities reported by a driver or underlying audio API are not always accurate and/or may be dependent on a combination of device settings. Because of this, RtAudio does not attempt to query a device's capabilities or use previously reported values when opening a device. Instead, RtAudio simply attempts to set the given parameters on a specified device and then checks whether the setup is successful or not. | |||
The RtAudioCallback parameter above is a pointer to a user-defined function that will be called whenever the audio system is ready for new output data or has new input data to be read. Further details on the use of a callback function are provided in the next section. | |||
Several stream options are available to fine-tune the behavior of an audio stream. In the example above, we specify that data will be written by the user in a \e non-interleaved format via the RtAudio::StreamOptions member \c flags. That is, all \c bufferFrames of the first channel should be written consecutively, followed by all \c bufferFrames of the second channel. By default (when no option is specified), RtAudio expects data to be written in an \e interleaved format. | |||
*/ |
@@ -1,54 +0,0 @@ | |||
/*! \mainpage The RtAudio Home Page | |||
RtAudio is a set of C++ classes that provide a common API (Application Programming Interface) for realtime audio input/output across Linux, Macintosh OS-X and Windows operating systems. RtAudio significantly simplifies the process of interacting with computer audio hardware. It was designed with the following objectives: | |||
<UL> | |||
<LI>object-oriented C++ design</LI> | |||
<LI>simple, common API across all supported platforms</LI> | |||
<LI>only one source and two header files for easy inclusion in programming projects</LI> | |||
<LI>allow simultaneous multi-api support</LI> | |||
<LI>support dynamic connection of devices</LI> | |||
<LI>provide extensive audio device parameter control</LI> | |||
<LI>allow audio device capability probing</LI> | |||
<LI>automatic internal conversion for data format, channel number compensation, (de)interleaving, and byte-swapping</LI> | |||
</UL> | |||
RtAudio incorporates the concept of audio streams, which represent audio output (playback) and/or input (recording). Available audio devices and their capabilities can be enumerated and then specified when opening a stream. Where applicable, multiple API support can be compiled and a particular API specified when creating an RtAudio instance. See the \ref apinotes section for information specific to each of the supported audio APIs. | |||
\section whatsnew What's New (Version 4.0) | |||
RtAudio V4 represents a significant rewrite of the code and includes a number of API and functionality changes from previous versions. A partial list of the changes includes: | |||
- new support for non-interleaved user data | |||
- additional input/output parameter specifications, including channel offset | |||
- new support for dynamic connection of devices | |||
- new support for stream time | |||
- revised callback arguments, including separate input and output buffer arguments | |||
- revised C++ exception handling | |||
- updated support for OSS version 4.0 | |||
- discontinued support of blocking functionality | |||
- discontinued support of SGI | |||
Devices are now re-enumerated every time the RtAudio::getDeviceCount(), RtAudio::getDeviceInfo(), and RtAudio::openStream() functions are called. This allows for the proper identification of hot-pluggable (USB, Firewire, ...) devices that are connected after an RtAudio instance is created. | |||
\section download Download | |||
Latest Release (14 June 2012): <A href="http://www.music.mcgill.ca/~gary/rtaudio/release/rtaudio-4.0.11.tar.gz">Version 4.0.11</A> | |||
\section documentation Documentation Links | |||
-# \ref errors | |||
-# \ref probe | |||
-# \ref settings | |||
-# \ref playback | |||
-# \ref recording | |||
-# \ref duplex | |||
-# \ref multi | |||
-# \ref compiling | |||
-# \ref apinotes | |||
-# \ref acknowledge | |||
-# \ref license | |||
-# <A href="bugs.html">Bug Tracker</A> | |||
-# <A href="updates.html">Possible Updates</A> | |||
-# <A href="http://sourceforge.net/projects/rtaudio">RtAudio at SourceForge</A> | |||
*/ |
@@ -1,641 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.5.8 --> | |||
<h1>RtAudio.h</h1><a href="RtAudio_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/************************************************************************/</span> | |||
<a name="l00039"></a>00039 <span class="comment">/************************************************************************/</span> | |||
<a name="l00040"></a>00040 | |||
<a name="l00045"></a>00045 <span class="comment">// RtAudio: Version 4.0.6</span> | |||
<a name="l00046"></a>00046 | |||
<a name="l00047"></a>00047 <span class="preprocessor">#ifndef __RTAUDIO_H</span> | |||
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define __RTAUDIO_H</span> | |||
<a name="l00049"></a>00049 <span class="preprocessor"></span> | |||
<a name="l00050"></a>00050 <span class="preprocessor">#include <string></span> | |||
<a name="l00051"></a>00051 <span class="preprocessor">#include <vector></span> | |||
<a name="l00052"></a>00052 <span class="preprocessor">#include "RtError.h"</span> | |||
<a name="l00053"></a>00053 | |||
<a name="l00070"></a><a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8">00070</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a>; | |||
<a name="l00071"></a>00071 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT8 = 0x1; <span class="comment">// 8-bit signed integer.</span> | |||
<a name="l00072"></a>00072 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT16 = 0x2; <span class="comment">// 16-bit signed integer.</span> | |||
<a name="l00073"></a>00073 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT24 = 0x4; <span class="comment">// Lower 3 bytes of 32-bit signed integer.</span> | |||
<a name="l00074"></a>00074 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT32 = 0x8; <span class="comment">// 32-bit signed integer.</span> | |||
<a name="l00075"></a>00075 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_FLOAT32 = 0x10; <span class="comment">// Normalized between plus/minus 1.0.</span> | |||
<a name="l00076"></a>00076 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_FLOAT64 = 0x20; <span class="comment">// Normalized between plus/minus 1.0.</span> | |||
<a name="l00077"></a>00077 | |||
<a name="l00115"></a><a class="code" href="RtAudio_8h.html#2c0f59b200dcec4d4e760f9166b29c41">00115</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="RtAudio_8h.html#2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a>; | |||
<a name="l00116"></a>00116 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_NONINTERLEAVED = 0x1; <span class="comment">// Use non-interleaved buffers (default = interleaved).</span> | |||
<a name="l00117"></a>00117 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_MINIMIZE_LATENCY = 0x2; <span class="comment">// Attempt to set stream parameters for lowest possible latency.</span> | |||
<a name="l00118"></a>00118 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_HOG_DEVICE = 0x4; <span class="comment">// Attempt grab device and prevent use by others.</span> | |||
<a name="l00119"></a>00119 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_SCHEDULE_REALTIME = 0x8; <span class="comment">// Try to select realtime scheduling for callback thread.</span> | |||
<a name="l00120"></a>00120 | |||
<a name="l00132"></a><a class="code" href="RtAudio_8h.html#80e306d363583da3b0a1b65d9b57c806">00132</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="RtAudio_8h.html#80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a>; | |||
<a name="l00133"></a>00133 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a> RTAUDIO_INPUT_OVERFLOW = 0x1; <span class="comment">// Input data was discarded because of an overflow condition at the driver.</span> | |||
<a name="l00134"></a>00134 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a> RTAUDIO_OUTPUT_UNDERFLOW = 0x2; <span class="comment">// The output buffer ran low, likely causing a gap in the output sound.</span> | |||
<a name="l00135"></a>00135 | |||
<a name="l00137"></a>00137 | |||
<a name="l00175"></a><a class="code" href="RtAudio_8h.html#112c7b7e25a974977f6fc094cef1a31f">00175</a> <span class="keyword">typedef</span> int (*<a class="code" href="RtAudio_8h.html#112c7b7e25a974977f6fc094cef1a31f" title="RtAudio callback function prototype.">RtAudioCallback</a>)( <span class="keywordtype">void</span> *outputBuffer, <span class="keywordtype">void</span> *inputBuffer, | |||
<a name="l00176"></a>00176 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nFrames, | |||
<a name="l00177"></a>00177 <span class="keywordtype">double</span> streamTime, | |||
<a name="l00178"></a>00178 <a class="code" href="RtAudio_8h.html#80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a> status, | |||
<a name="l00179"></a>00179 <span class="keywordtype">void</span> *userData ); | |||
<a name="l00180"></a>00180 | |||
<a name="l00181"></a>00181 | |||
<a name="l00182"></a>00182 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00183"></a>00183 <span class="comment">//</span> | |||
<a name="l00184"></a>00184 <span class="comment">// RtAudio class declaration.</span> | |||
<a name="l00185"></a>00185 <span class="comment">//</span> | |||
<a name="l00186"></a>00186 <span class="comment">// RtAudio is a "controller" used to select an available audio i/o</span> | |||
<a name="l00187"></a>00187 <span class="comment">// interface. It presents a common API for the user to call but all</span> | |||
<a name="l00188"></a>00188 <span class="comment">// functionality is implemented by the class RtApi and its</span> | |||
<a name="l00189"></a>00189 <span class="comment">// subclasses. RtAudio creates an instance of an RtApi subclass</span> | |||
<a name="l00190"></a>00190 <span class="comment">// based on the user's API choice. If no choice is made, RtAudio</span> | |||
<a name="l00191"></a>00191 <span class="comment">// attempts to make a "logical" API selection.</span> | |||
<a name="l00192"></a>00192 <span class="comment">//</span> | |||
<a name="l00193"></a>00193 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00194"></a>00194 | |||
<a name="l00195"></a>00195 <span class="keyword">class </span>RtApi; | |||
<a name="l00196"></a>00196 | |||
<a name="l00197"></a><a class="code" href="classRtAudio.html">00197</a> <span class="keyword">class </span><a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> | |||
<a name="l00198"></a>00198 { | |||
<a name="l00199"></a>00199 <span class="keyword">public</span>: | |||
<a name="l00200"></a>00200 | |||
<a name="l00202"></a><a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849">00202</a> <span class="keyword">enum</span> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">Api</a> { | |||
<a name="l00203"></a><a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849a49af3ac767106158bc6cad74fb214ae">00203</a> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849a49af3ac767106158bc6cad74fb214ae">UNSPECIFIED</a>, | |||
<a name="l00204"></a><a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849a7a2ba095c2806caa893b6fb8fc3a1a8">00204</a> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849a7a2ba095c2806caa893b6fb8fc3a1a8">LINUX_ALSA</a>, | |||
<a name="l00205"></a><a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d84939c84615e61de75e6a4e865596d62c82">00205</a> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d84939c84615e61de75e6a4e865596d62c82">LINUX_OSS</a>, | |||
<a name="l00206"></a><a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d8494767e17c6edfbd827f91763915df4105">00206</a> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d8494767e17c6edfbd827f91763915df4105">UNIX_JACK</a>, | |||
<a name="l00207"></a><a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d8499fec92b8272244a87a6a11a717bd662d">00207</a> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d8499fec92b8272244a87a6a11a717bd662d">MACOSX_CORE</a>, | |||
<a name="l00208"></a><a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849219517d1df90f94d07758481155bd469">00208</a> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849219517d1df90f94d07758481155bd469">WINDOWS_ASIO</a>, | |||
<a name="l00209"></a><a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d84928478830f42c2fd61e6c7ad498901931">00209</a> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d84928478830f42c2fd61e6c7ad498901931">WINDOWS_DS</a>, | |||
<a name="l00210"></a><a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849b06b8fd88bf18c9a2b8271f6961ae2d1">00210</a> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849b06b8fd88bf18c9a2b8271f6961ae2d1">RTAUDIO_DUMMY</a> | |||
<a name="l00211"></a>00211 }; | |||
<a name="l00212"></a>00212 | |||
<a name="l00214"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html">00214</a> <span class="keyword">struct </span><a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">DeviceInfo</a> { | |||
<a name="l00215"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#5bf008c629ef493c713ec870d0217407">00215</a> <span class="keywordtype">bool</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#5bf008c629ef493c713ec870d0217407">probed</a>; | |||
<a name="l00216"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#a0e2ea10c52c206c9e105ac76b01f194">00216</a> std::string <a class="code" href="structRtAudio_1_1DeviceInfo.html#a0e2ea10c52c206c9e105ac76b01f194">name</a>; | |||
<a name="l00217"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#185f8aac1095de4fbb6e0076875d24c4">00217</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#185f8aac1095de4fbb6e0076875d24c4">outputChannels</a>; | |||
<a name="l00218"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#731b31adf84c550ab98329be1baa58b4">00218</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#731b31adf84c550ab98329be1baa58b4">inputChannels</a>; | |||
<a name="l00219"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#ca6ecfb8b5b8c114c54809d8af50ee5b">00219</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#ca6ecfb8b5b8c114c54809d8af50ee5b">duplexChannels</a>; | |||
<a name="l00220"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#af74fc23f451fdd22ed073a47f0db674">00220</a> <span class="keywordtype">bool</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#af74fc23f451fdd22ed073a47f0db674">isDefaultOutput</a>; | |||
<a name="l00221"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#a8b03618fa1d4c051f6add14bb031728">00221</a> <span class="keywordtype">bool</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a8b03618fa1d4c051f6add14bb031728">isDefaultInput</a>; | |||
<a name="l00222"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#5b158efcbfbd30e7226df92d0109d475">00222</a> std::vector<unsigned int> <a class="code" href="structRtAudio_1_1DeviceInfo.html#5b158efcbfbd30e7226df92d0109d475">sampleRates</a>; | |||
<a name="l00223"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#97559ee4a1f2c8cfb765949e6193e1f4">00223</a> <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> <a class="code" href="structRtAudio_1_1DeviceInfo.html#97559ee4a1f2c8cfb765949e6193e1f4">nativeFormats</a>; | |||
<a name="l00225"></a>00225 <span class="comment">// Default constructor.</span> | |||
<a name="l00226"></a>00226 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">DeviceInfo</a>() | |||
<a name="l00227"></a>00227 :<a class="code" href="structRtAudio_1_1DeviceInfo.html#5bf008c629ef493c713ec870d0217407">probed</a>(false), <a class="code" href="structRtAudio_1_1DeviceInfo.html#185f8aac1095de4fbb6e0076875d24c4">outputChannels</a>(0), <a class="code" href="structRtAudio_1_1DeviceInfo.html#731b31adf84c550ab98329be1baa58b4">inputChannels</a>(0), <a class="code" href="structRtAudio_1_1DeviceInfo.html#ca6ecfb8b5b8c114c54809d8af50ee5b">duplexChannels</a>(0), | |||
<a name="l00228"></a>00228 <a class="code" href="structRtAudio_1_1DeviceInfo.html#af74fc23f451fdd22ed073a47f0db674">isDefaultOutput</a>(false), <a class="code" href="structRtAudio_1_1DeviceInfo.html#a8b03618fa1d4c051f6add14bb031728">isDefaultInput</a>(false), <a class="code" href="structRtAudio_1_1DeviceInfo.html#97559ee4a1f2c8cfb765949e6193e1f4">nativeFormats</a>(0) {} | |||
<a name="l00229"></a>00229 }; | |||
<a name="l00230"></a>00230 | |||
<a name="l00232"></a><a class="code" href="structRtAudio_1_1StreamParameters.html">00232</a> <span class="keyword">struct </span><a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">StreamParameters</a> { | |||
<a name="l00233"></a><a class="code" href="structRtAudio_1_1StreamParameters.html#ffd27496c70c0986522056234c64e28e">00233</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamParameters.html#ffd27496c70c0986522056234c64e28e">deviceId</a>; | |||
<a name="l00234"></a><a class="code" href="structRtAudio_1_1StreamParameters.html#78798b65fada7941e1a7e47c11c9e627">00234</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamParameters.html#78798b65fada7941e1a7e47c11c9e627">nChannels</a>; | |||
<a name="l00235"></a><a class="code" href="structRtAudio_1_1StreamParameters.html#ddc8281f23a87455ec6dedbc766a74db">00235</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamParameters.html#ddc8281f23a87455ec6dedbc766a74db">firstChannel</a>; | |||
<a name="l00237"></a>00237 <span class="comment">// Default constructor.</span> | |||
<a name="l00238"></a>00238 <a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">StreamParameters</a>() | |||
<a name="l00239"></a>00239 : <a class="code" href="structRtAudio_1_1StreamParameters.html#ffd27496c70c0986522056234c64e28e">deviceId</a>(0), <a class="code" href="structRtAudio_1_1StreamParameters.html#78798b65fada7941e1a7e47c11c9e627">nChannels</a>(0), <a class="code" href="structRtAudio_1_1StreamParameters.html#ddc8281f23a87455ec6dedbc766a74db">firstChannel</a>(0) {} | |||
<a name="l00240"></a>00240 }; | |||
<a name="l00241"></a>00241 | |||
<a name="l00243"></a>00243 | |||
<a name="l00294"></a><a class="code" href="structRtAudio_1_1StreamOptions.html">00294</a> <span class="keyword">struct </span><a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">StreamOptions</a> { | |||
<a name="l00295"></a><a class="code" href="structRtAudio_1_1StreamOptions.html#6a284d045b8adcfcf178a4f6a22330f8">00295</a> <a class="code" href="RtAudio_8h.html#2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> <a class="code" href="structRtAudio_1_1StreamOptions.html#6a284d045b8adcfcf178a4f6a22330f8">flags</a>; | |||
<a name="l00296"></a><a class="code" href="structRtAudio_1_1StreamOptions.html#5a04d3c3d0c1cfa063872ecff383af1d">00296</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamOptions.html#5a04d3c3d0c1cfa063872ecff383af1d">numberOfBuffers</a>; | |||
<a name="l00297"></a><a class="code" href="structRtAudio_1_1StreamOptions.html#214da35056f18ffb7c8e4dc074a01a9a">00297</a> std::string <a class="code" href="structRtAudio_1_1StreamOptions.html#214da35056f18ffb7c8e4dc074a01a9a">streamName</a>; | |||
<a name="l00298"></a><a class="code" href="structRtAudio_1_1StreamOptions.html#81b364f137d1ee1073b74dac666af352">00298</a> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamOptions.html#81b364f137d1ee1073b74dac666af352">priority</a>; | |||
<a name="l00300"></a>00300 <span class="comment">// Default constructor.</span> | |||
<a name="l00301"></a>00301 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">StreamOptions</a>() | |||
<a name="l00302"></a>00302 : <a class="code" href="structRtAudio_1_1StreamOptions.html#6a284d045b8adcfcf178a4f6a22330f8">flags</a>(0), <a class="code" href="structRtAudio_1_1StreamOptions.html#5a04d3c3d0c1cfa063872ecff383af1d">numberOfBuffers</a>(0), <a class="code" href="structRtAudio_1_1StreamOptions.html#81b364f137d1ee1073b74dac666af352">priority</a>(0) {} | |||
<a name="l00303"></a>00303 }; | |||
<a name="l00304"></a>00304 | |||
<a name="l00306"></a>00306 | |||
<a name="l00311"></a>00311 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#e266ffad2ef428d0b2c6c262d391ce26" title="A static function to determine the available compiled audio APIs.">getCompiledApi</a>( std::vector<RtAudio::Api> &apis ) <span class="keywordflow">throw</span>(); | |||
<a name="l00312"></a>00312 | |||
<a name="l00314"></a>00314 | |||
<a name="l00322"></a>00322 <a class="code" href="classRtAudio.html#fd0bfa26deae9804e18faff59d0273d9" title="The class constructor.">RtAudio</a>( <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> api=<a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849a49af3ac767106158bc6cad74fb214ae">UNSPECIFIED</a> ) throw(); | |||
<a name="l00323"></a>00323 | |||
<a name="l00325"></a>00325 | |||
<a name="l00329"></a>00329 ~<a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>() throw(); | |||
<a name="l00330"></a>00330 | |||
<a name="l00332"></a>00332 <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::<a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">Api</a> <a class="code" href="classRtAudio.html#83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>( <span class="keywordtype">void</span> ) throw(); | |||
<a name="l00333"></a>00333 | |||
<a name="l00335"></a>00335 | |||
<a name="l00340"></a>00340 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> ) throw(); | |||
<a name="l00341"></a>00341 | |||
<a name="l00343"></a>00343 | |||
<a name="l00353"></a>00353 <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::DeviceInfo <a class="code" href="classRtAudio.html#02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00354"></a>00354 | |||
<a name="l00356"></a>00356 | |||
<a name="l00363"></a>00363 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#3a3f3dbe13ea696b521e49cdaaa357bc" title="A function that returns the index of the default output device.">getDefaultOutputDevice</a>( <span class="keywordtype">void</span> ) throw(); | |||
<a name="l00364"></a>00364 | |||
<a name="l00366"></a>00366 | |||
<a name="l00373"></a>00373 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#ad8b94edd3cd379ee300b125750ac6ce" title="A function that returns the index of the default input device.">getDefaultInputDevice</a>( <span class="keywordtype">void</span> ) throw(); | |||
<a name="l00374"></a>00374 | |||
<a name="l00376"></a>00376 | |||
<a name="l00413"></a>00413 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#facc99740fa4c5606fb35467cdea6da8" title="A public function for opening a stream with the specified parameters.">openStream</a>( <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::StreamParameters *outputParameters, | |||
<a name="l00414"></a>00414 <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::StreamParameters *inputParameters, | |||
<a name="l00415"></a>00415 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00416"></a>00416 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferFrames, <a class="code" href="RtAudio_8h.html#112c7b7e25a974977f6fc094cef1a31f" title="RtAudio callback function prototype.">RtAudioCallback</a> callback, | |||
<a name="l00417"></a>00417 <span class="keywordtype">void</span> *userData = NULL, <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::StreamOptions *options = NULL ); | |||
<a name="l00418"></a>00418 | |||
<a name="l00420"></a>00420 | |||
<a name="l00424"></a>00424 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> ) throw(); | |||
<a name="l00425"></a>00425 | |||
<a name="l00427"></a>00427 | |||
<a name="l00433"></a>00433 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00434"></a>00434 | |||
<a name="l00436"></a>00436 | |||
<a name="l00442"></a>00442 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#f4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00443"></a>00443 | |||
<a name="l00445"></a>00445 | |||
<a name="l00451"></a>00451 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#d0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00452"></a>00452 | |||
<a name="l00454"></a>00454 <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#3863e45ff81dbe97176de0ee7545917f" title="Returns true if a stream is open and false if not.">isStreamOpen</a>( <span class="keywordtype">void</span> ) const throw(); | |||
<a name="l00455"></a>00455 | |||
<a name="l00457"></a>00457 <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#84cc8d9b7ab9bc5f37bcf48430ec5aea" title="Returns true if the stream is running and false if it is stopped or not open.">isStreamRunning</a>( <span class="keywordtype">void</span> ) const throw(); | |||
<a name="l00458"></a>00458 | |||
<a name="l00460"></a>00460 | |||
<a name="l00463"></a>00463 <span class="keywordtype">double</span> <a class="code" href="classRtAudio.html#344e59a62353c5791db4621b985cb2ca" title="Returns the number of elapsed seconds since the stream was started.">getStreamTime</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00464"></a>00464 | |||
<a name="l00466"></a>00466 | |||
<a name="l00474"></a>00474 <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">getStreamLatency</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00475"></a>00475 | |||
<a name="l00477"></a>00477 | |||
<a name="l00482"></a>00482 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#28214b8b05d60b45c24ee6fae7b2a0b5" title="Returns actual sample rate in use by the stream.">getStreamSampleRate</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00483"></a>00483 | |||
<a name="l00485"></a>00485 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#f0752ee51cce3dd90a3bd009f9fdbe77" title="Specify whether warning messages should be printed to stderr.">showWarnings</a>( <span class="keywordtype">bool</span> value = true ) throw(); | |||
<a name="l00486"></a>00486 | |||
<a name="l00487"></a>00487 protected: | |||
<a name="l00488"></a>00488 | |||
<a name="l00489"></a>00489 <span class="keywordtype">void</span> openRtApi( <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::<a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">Api</a> api ); | |||
<a name="l00490"></a>00490 RtApi *rtapi_; | |||
<a name="l00491"></a>00491 }; | |||
<a name="l00492"></a>00492 | |||
<a name="l00493"></a>00493 <span class="comment">// Operating system dependent thread functionality.</span> | |||
<a name="l00494"></a>00494 <span class="preprocessor">#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)</span> | |||
<a name="l00495"></a>00495 <span class="preprocessor"></span><span class="preprocessor"> #include <windows.h></span> | |||
<a name="l00496"></a>00496 <span class="preprocessor"> #include <process.h></span> | |||
<a name="l00497"></a>00497 | |||
<a name="l00498"></a>00498 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ThreadHandle; | |||
<a name="l00499"></a>00499 <span class="keyword">typedef</span> CRITICAL_SECTION StreamMutex; | |||
<a name="l00500"></a>00500 | |||
<a name="l00501"></a>00501 <span class="preprocessor">#elif defined(__LINUX_ALSA__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)</span> | |||
<a name="l00502"></a>00502 <span class="preprocessor"></span> <span class="comment">// Using pthread library for various flavors of unix.</span> | |||
<a name="l00503"></a>00503 <span class="preprocessor"> #include <pthread.h></span> | |||
<a name="l00504"></a>00504 | |||
<a name="l00505"></a>00505 <span class="keyword">typedef</span> pthread_t ThreadHandle; | |||
<a name="l00506"></a>00506 <span class="keyword">typedef</span> pthread_mutex_t StreamMutex; | |||
<a name="l00507"></a>00507 | |||
<a name="l00508"></a>00508 <span class="preprocessor">#else // Setup for "dummy" behavior</span> | |||
<a name="l00509"></a>00509 <span class="preprocessor"></span> | |||
<a name="l00510"></a>00510 <span class="preprocessor"> #define __RTAUDIO_DUMMY__</span> | |||
<a name="l00511"></a>00511 <span class="preprocessor"></span> <span class="keyword">typedef</span> <span class="keywordtype">int</span> ThreadHandle; | |||
<a name="l00512"></a>00512 <span class="keyword">typedef</span> <span class="keywordtype">int</span> StreamMutex; | |||
<a name="l00513"></a>00513 | |||
<a name="l00514"></a>00514 <span class="preprocessor">#endif</span> | |||
<a name="l00515"></a>00515 <span class="preprocessor"></span> | |||
<a name="l00516"></a>00516 <span class="comment">// This global structure type is used to pass callback information</span> | |||
<a name="l00517"></a>00517 <span class="comment">// between the private RtAudio stream structure and global callback</span> | |||
<a name="l00518"></a>00518 <span class="comment">// handling functions.</span> | |||
<a name="l00519"></a>00519 <span class="keyword">struct </span>CallbackInfo { | |||
<a name="l00520"></a>00520 <span class="keywordtype">void</span> *object; <span class="comment">// Used as a "this" pointer.</span> | |||
<a name="l00521"></a>00521 ThreadHandle thread; | |||
<a name="l00522"></a>00522 <span class="keywordtype">void</span> *callback; | |||
<a name="l00523"></a>00523 <span class="keywordtype">void</span> *userData; | |||
<a name="l00524"></a>00524 <span class="keywordtype">void</span> *apiInfo; <span class="comment">// void pointer for API specific callback information</span> | |||
<a name="l00525"></a>00525 <span class="keywordtype">bool</span> isRunning; | |||
<a name="l00526"></a>00526 | |||
<a name="l00527"></a>00527 <span class="comment">// Default constructor.</span> | |||
<a name="l00528"></a>00528 CallbackInfo() | |||
<a name="l00529"></a>00529 :object(0), callback(0), userData(0), apiInfo(0), isRunning(false) {} | |||
<a name="l00530"></a>00530 }; | |||
<a name="l00531"></a>00531 | |||
<a name="l00532"></a>00532 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00533"></a>00533 <span class="comment">//</span> | |||
<a name="l00534"></a>00534 <span class="comment">// RtApi class declaration.</span> | |||
<a name="l00535"></a>00535 <span class="comment">//</span> | |||
<a name="l00536"></a>00536 <span class="comment">// Subclasses of RtApi contain all API- and OS-specific code necessary</span> | |||
<a name="l00537"></a>00537 <span class="comment">// to fully implement the RtAudio API.</span> | |||
<a name="l00538"></a>00538 <span class="comment">//</span> | |||
<a name="l00539"></a>00539 <span class="comment">// Note that RtApi is an abstract base class and cannot be</span> | |||
<a name="l00540"></a>00540 <span class="comment">// explicitly instantiated. The class RtAudio will create an</span> | |||
<a name="l00541"></a>00541 <span class="comment">// instance of an RtApi subclass (RtApiOss, RtApiAlsa,</span> | |||
<a name="l00542"></a>00542 <span class="comment">// RtApiJack, RtApiCore, RtApiAl, RtApiDs, or RtApiAsio).</span> | |||
<a name="l00543"></a>00543 <span class="comment">//</span> | |||
<a name="l00544"></a>00544 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00545"></a>00545 | |||
<a name="l00546"></a>00546 <span class="preprocessor">#if defined( HAVE_GETTIMEOFDAY )</span> | |||
<a name="l00547"></a>00547 <span class="preprocessor"></span><span class="preprocessor"> #include <sys/time.h></span> | |||
<a name="l00548"></a>00548 <span class="preprocessor">#endif</span> | |||
<a name="l00549"></a>00549 <span class="preprocessor"></span> | |||
<a name="l00550"></a>00550 <span class="preprocessor">#include <sstream></span> | |||
<a name="l00551"></a>00551 | |||
<a name="l00552"></a>00552 <span class="keyword">class </span>RtApi | |||
<a name="l00553"></a>00553 { | |||
<a name="l00554"></a>00554 <span class="keyword">public</span>: | |||
<a name="l00555"></a>00555 | |||
<a name="l00556"></a>00556 RtApi(); | |||
<a name="l00557"></a>00557 <span class="keyword">virtual</span> ~RtApi(); | |||
<a name="l00558"></a>00558 <span class="keyword">virtual</span> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>( <span class="keywordtype">void</span> ) = 0; | |||
<a name="l00559"></a>00559 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> ) = 0; | |||
<a name="l00560"></a>00560 <span class="keyword">virtual</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ) = 0; | |||
<a name="l00561"></a>00561 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#ad8b94edd3cd379ee300b125750ac6ce" title="A function that returns the index of the default input device.">getDefaultInputDevice</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00562"></a>00562 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#3a3f3dbe13ea696b521e49cdaaa357bc" title="A function that returns the index of the default output device.">getDefaultOutputDevice</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00563"></a>00563 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#facc99740fa4c5606fb35467cdea6da8" title="A public function for opening a stream with the specified parameters.">openStream</a>( <a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">RtAudio::StreamParameters</a> *outputParameters, | |||
<a name="l00564"></a>00564 <a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">RtAudio::StreamParameters</a> *inputParameters, | |||
<a name="l00565"></a>00565 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00566"></a>00566 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferFrames, <a class="code" href="RtAudio_8h.html#112c7b7e25a974977f6fc094cef1a31f" title="RtAudio callback function prototype.">RtAudioCallback</a> callback, | |||
<a name="l00567"></a>00567 <span class="keywordtype">void</span> *userData, <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00568"></a>00568 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00569"></a>00569 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> ) = 0; | |||
<a name="l00570"></a>00570 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#f4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> ) = 0; | |||
<a name="l00571"></a>00571 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#d0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> ) = 0; | |||
<a name="l00572"></a>00572 <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">getStreamLatency</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00573"></a>00573 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#28214b8b05d60b45c24ee6fae7b2a0b5" title="Returns actual sample rate in use by the stream.">getStreamSampleRate</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00574"></a>00574 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classRtAudio.html#344e59a62353c5791db4621b985cb2ca" title="Returns the number of elapsed seconds since the stream was started.">getStreamTime</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00575"></a>00575 <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#3863e45ff81dbe97176de0ee7545917f" title="Returns true if a stream is open and false if not.">isStreamOpen</a>( <span class="keywordtype">void</span> )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> stream_.state != STREAM_CLOSED; }; | |||
<a name="l00576"></a>00576 <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#84cc8d9b7ab9bc5f37bcf48430ec5aea" title="Returns true if the stream is running and false if it is stopped or not open.">isStreamRunning</a>( <span class="keywordtype">void</span> )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> stream_.state == STREAM_RUNNING; }; | |||
<a name="l00577"></a>00577 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#f0752ee51cce3dd90a3bd009f9fdbe77" title="Specify whether warning messages should be printed to stderr.">showWarnings</a>( <span class="keywordtype">bool</span> value ) { showWarnings_ = value; }; | |||
<a name="l00578"></a>00578 | |||
<a name="l00579"></a>00579 | |||
<a name="l00580"></a>00580 <span class="keyword">protected</span>: | |||
<a name="l00581"></a>00581 | |||
<a name="l00582"></a>00582 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> MAX_SAMPLE_RATES; | |||
<a name="l00583"></a>00583 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> SAMPLE_RATES[]; | |||
<a name="l00584"></a>00584 | |||
<a name="l00585"></a>00585 <span class="keyword">enum</span> { FAILURE, SUCCESS }; | |||
<a name="l00586"></a>00586 | |||
<a name="l00587"></a>00587 <span class="keyword">enum</span> StreamState { | |||
<a name="l00588"></a>00588 STREAM_STOPPED, | |||
<a name="l00589"></a>00589 STREAM_RUNNING, | |||
<a name="l00590"></a>00590 STREAM_CLOSED = -50 | |||
<a name="l00591"></a>00591 }; | |||
<a name="l00592"></a>00592 | |||
<a name="l00593"></a>00593 <span class="keyword">enum</span> StreamMode { | |||
<a name="l00594"></a>00594 OUTPUT, | |||
<a name="l00595"></a>00595 INPUT, | |||
<a name="l00596"></a>00596 DUPLEX, | |||
<a name="l00597"></a>00597 UNINITIALIZED = -75 | |||
<a name="l00598"></a>00598 }; | |||
<a name="l00599"></a>00599 | |||
<a name="l00600"></a>00600 <span class="comment">// A protected structure used for buffer conversion.</span> | |||
<a name="l00601"></a>00601 <span class="keyword">struct </span>ConvertInfo { | |||
<a name="l00602"></a>00602 <span class="keywordtype">int</span> channels; | |||
<a name="l00603"></a>00603 <span class="keywordtype">int</span> inJump, outJump; | |||
<a name="l00604"></a>00604 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> inFormat, outFormat; | |||
<a name="l00605"></a>00605 std::vector<int> inOffset; | |||
<a name="l00606"></a>00606 std::vector<int> outOffset; | |||
<a name="l00607"></a>00607 }; | |||
<a name="l00608"></a>00608 | |||
<a name="l00609"></a>00609 <span class="comment">// A protected structure for audio streams.</span> | |||
<a name="l00610"></a>00610 <span class="keyword">struct </span>RtApiStream { | |||
<a name="l00611"></a>00611 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00612"></a>00612 <span class="keywordtype">void</span> *apiHandle; <span class="comment">// void pointer for API specific stream handle information</span> | |||
<a name="l00613"></a>00613 StreamMode mode; <span class="comment">// OUTPUT, INPUT, or DUPLEX.</span> | |||
<a name="l00614"></a>00614 StreamState state; <span class="comment">// STOPPED, RUNNING, or CLOSED</span> | |||
<a name="l00615"></a>00615 <span class="keywordtype">char</span> *userBuffer[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00616"></a>00616 <span class="keywordtype">char</span> *deviceBuffer; | |||
<a name="l00617"></a>00617 <span class="keywordtype">bool</span> doConvertBuffer[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00618"></a>00618 <span class="keywordtype">bool</span> userInterleaved; | |||
<a name="l00619"></a>00619 <span class="keywordtype">bool</span> deviceInterleaved[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00620"></a>00620 <span class="keywordtype">bool</span> doByteSwap[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00621"></a>00621 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate; | |||
<a name="l00622"></a>00622 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> bufferSize; | |||
<a name="l00623"></a>00623 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nBuffers; | |||
<a name="l00624"></a>00624 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nUserChannels[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00625"></a>00625 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nDeviceChannels[2]; <span class="comment">// Playback and record channels, respectively.</span> | |||
<a name="l00626"></a>00626 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channelOffset[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00627"></a>00627 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> latency[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00628"></a>00628 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> userFormat; | |||
<a name="l00629"></a>00629 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> deviceFormat[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00630"></a>00630 StreamMutex mutex; | |||
<a name="l00631"></a>00631 CallbackInfo callbackInfo; | |||
<a name="l00632"></a>00632 ConvertInfo convertInfo[2]; | |||
<a name="l00633"></a>00633 <span class="keywordtype">double</span> streamTime; <span class="comment">// Number of elapsed seconds since the stream started.</span> | |||
<a name="l00634"></a>00634 | |||
<a name="l00635"></a>00635 <span class="preprocessor">#if defined(HAVE_GETTIMEOFDAY)</span> | |||
<a name="l00636"></a>00636 <span class="preprocessor"></span> <span class="keyword">struct </span>timeval lastTickTimestamp; | |||
<a name="l00637"></a>00637 <span class="preprocessor">#endif</span> | |||
<a name="l00638"></a>00638 <span class="preprocessor"></span> | |||
<a name="l00639"></a>00639 RtApiStream() | |||
<a name="l00640"></a>00640 :apiHandle(0), deviceBuffer(0) { device[0] = 11111; device[1] = 11111; } | |||
<a name="l00641"></a>00641 }; | |||
<a name="l00642"></a>00642 | |||
<a name="l00643"></a>00643 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">short</span> Int16; | |||
<a name="l00644"></a>00644 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">int</span> Int32; | |||
<a name="l00645"></a>00645 <span class="keyword">typedef</span> <span class="keywordtype">float</span> Float32; | |||
<a name="l00646"></a>00646 <span class="keyword">typedef</span> <span class="keywordtype">double</span> Float64; | |||
<a name="l00647"></a>00647 | |||
<a name="l00648"></a>00648 std::ostringstream errorStream_; | |||
<a name="l00649"></a>00649 std::string errorText_; | |||
<a name="l00650"></a>00650 <span class="keywordtype">bool</span> showWarnings_; | |||
<a name="l00651"></a>00651 RtApiStream stream_; | |||
<a name="l00652"></a>00652 | |||
<a name="l00660"></a>00660 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00661"></a>00661 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00662"></a>00662 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00663"></a>00663 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00664"></a>00664 | |||
<a name="l00666"></a>00666 <span class="keywordtype">void</span> tickStreamTime( <span class="keywordtype">void</span> ); | |||
<a name="l00667"></a>00667 | |||
<a name="l00669"></a>00669 <span class="keywordtype">void</span> clearStreamInfo(); | |||
<a name="l00670"></a>00670 | |||
<a name="l00675"></a>00675 <span class="keywordtype">void</span> verifyStream( <span class="keywordtype">void</span> ); | |||
<a name="l00676"></a>00676 | |||
<a name="l00678"></a>00678 <span class="keywordtype">void</span> error( <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">RtError::Type</a> type ); | |||
<a name="l00679"></a>00679 | |||
<a name="l00684"></a>00684 <span class="keywordtype">void</span> convertBuffer( <span class="keywordtype">char</span> *outBuffer, <span class="keywordtype">char</span> *inBuffer, ConvertInfo &info ); | |||
<a name="l00685"></a>00685 | |||
<a name="l00687"></a>00687 <span class="keywordtype">void</span> byteSwapBuffer( <span class="keywordtype">char</span> *buffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> samples, <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format ); | |||
<a name="l00688"></a>00688 | |||
<a name="l00690"></a>00690 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> formatBytes( <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format ); | |||
<a name="l00691"></a>00691 | |||
<a name="l00693"></a>00693 <span class="keywordtype">void</span> setConvertInfo( StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel ); | |||
<a name="l00694"></a>00694 }; | |||
<a name="l00695"></a>00695 | |||
<a name="l00696"></a>00696 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00697"></a>00697 <span class="comment">//</span> | |||
<a name="l00698"></a>00698 <span class="comment">// Inline RtAudio definitions.</span> | |||
<a name="l00699"></a>00699 <span class="comment">//</span> | |||
<a name="l00700"></a>00700 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00701"></a>00701 | |||
<a name="l00702"></a><a class="code" href="classRtAudio.html#83687634795792b2c47e4ae1cf8a5246">00702</a> <span class="keyword">inline</span> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">RtAudio :: getCurrentApi</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_->getCurrentApi(); } | |||
<a name="l00703"></a><a class="code" href="classRtAudio.html#747ce2d73803641bbb66d6e78092aa1a">00703</a> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">RtAudio :: getDeviceCount</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_->getDeviceCount(); } | |||
<a name="l00704"></a><a class="code" href="classRtAudio.html#02d7ff44ad1d7eae22283a052f3dfda8">00704</a> <span class="keyword">inline</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">RtAudio :: getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ) { <span class="keywordflow">return</span> rtapi_->getDeviceInfo( device ); } | |||
<a name="l00705"></a><a class="code" href="classRtAudio.html#ad8b94edd3cd379ee300b125750ac6ce">00705</a> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#ad8b94edd3cd379ee300b125750ac6ce" title="A function that returns the index of the default input device.">RtAudio :: getDefaultInputDevice</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_->getDefaultInputDevice(); } | |||
<a name="l00706"></a><a class="code" href="classRtAudio.html#3a3f3dbe13ea696b521e49cdaaa357bc">00706</a> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#3a3f3dbe13ea696b521e49cdaaa357bc" title="A function that returns the index of the default output device.">RtAudio :: getDefaultOutputDevice</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_->getDefaultOutputDevice(); } | |||
<a name="l00707"></a><a class="code" href="classRtAudio.html#90d599002ad32cf250a4cb866f2cc93a">00707</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">RtAudio :: closeStream</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_->closeStream(); } | |||
<a name="l00708"></a><a class="code" href="classRtAudio.html#ec017a89629ccef66a90b60be22a2f80">00708</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">RtAudio :: startStream</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->startStream(); } | |||
<a name="l00709"></a><a class="code" href="classRtAudio.html#f4c241ff86936ecc8108f0d9dfe3efdd">00709</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#f4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">RtAudio :: stopStream</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->stopStream(); } | |||
<a name="l00710"></a><a class="code" href="classRtAudio.html#d0586b47cd6bb9591a80b4052815991f">00710</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#d0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">RtAudio :: abortStream</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->abortStream(); } | |||
<a name="l00711"></a><a class="code" href="classRtAudio.html#3863e45ff81dbe97176de0ee7545917f">00711</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#3863e45ff81dbe97176de0ee7545917f" title="Returns true if a stream is open and false if not.">RtAudio :: isStreamOpen</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> rtapi_->isStreamOpen(); } | |||
<a name="l00712"></a><a class="code" href="classRtAudio.html#84cc8d9b7ab9bc5f37bcf48430ec5aea">00712</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#84cc8d9b7ab9bc5f37bcf48430ec5aea" title="Returns true if the stream is running and false if it is stopped or not open.">RtAudio :: isStreamRunning</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> rtapi_->isStreamRunning(); } | |||
<a name="l00713"></a><a class="code" href="classRtAudio.html#843c989d9f501c71bc2f2c5ca18df9f3">00713</a> <span class="keyword">inline</span> <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">RtAudio :: getStreamLatency</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->getStreamLatency(); } | |||
<a name="l00714"></a><a class="code" href="classRtAudio.html#28214b8b05d60b45c24ee6fae7b2a0b5">00714</a> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#28214b8b05d60b45c24ee6fae7b2a0b5" title="Returns actual sample rate in use by the stream.">RtAudio :: getStreamSampleRate</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->getStreamSampleRate(); }; | |||
<a name="l00715"></a><a class="code" href="classRtAudio.html#344e59a62353c5791db4621b985cb2ca">00715</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classRtAudio.html#344e59a62353c5791db4621b985cb2ca" title="Returns the number of elapsed seconds since the stream was started.">RtAudio :: getStreamTime</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->getStreamTime(); } | |||
<a name="l00716"></a><a class="code" href="classRtAudio.html#f0752ee51cce3dd90a3bd009f9fdbe77">00716</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#f0752ee51cce3dd90a3bd009f9fdbe77" title="Specify whether warning messages should be printed to stderr.">RtAudio :: showWarnings</a>( <span class="keywordtype">bool</span> value ) <span class="keywordflow">throw</span>() { rtapi_->showWarnings( value ); } | |||
<a name="l00717"></a>00717 | |||
<a name="l00718"></a>00718 <span class="comment">// RtApi Subclass prototypes.</span> | |||
<a name="l00719"></a>00719 | |||
<a name="l00720"></a>00720 <span class="preprocessor">#if defined(__MACOSX_CORE__)</span> | |||
<a name="l00721"></a>00721 <span class="preprocessor"></span> | |||
<a name="l00722"></a>00722 <span class="preprocessor">#include <CoreAudio/AudioHardware.h></span> | |||
<a name="l00723"></a>00723 | |||
<a name="l00724"></a>00724 <span class="keyword">class </span>RtApiCore: <span class="keyword">public</span> RtApi | |||
<a name="l00725"></a>00725 { | |||
<a name="l00726"></a>00726 <span class="keyword">public</span>: | |||
<a name="l00727"></a>00727 | |||
<a name="l00728"></a>00728 RtApiCore(); | |||
<a name="l00729"></a>00729 ~RtApiCore(); | |||
<a name="l00730"></a>00730 <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d8499fec92b8272244a87a6a11a717bd662d">RtAudio::MACOSX_CORE</a>; }; | |||
<a name="l00731"></a>00731 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00732"></a>00732 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00733"></a>00733 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDefaultOutputDevice( <span class="keywordtype">void</span> ); | |||
<a name="l00734"></a>00734 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDefaultInputDevice( <span class="keywordtype">void</span> ); | |||
<a name="l00735"></a>00735 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00736"></a>00736 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00737"></a>00737 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00738"></a>00738 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00739"></a>00739 <span class="keywordtype">long</span> getStreamLatency( <span class="keywordtype">void</span> ); | |||
<a name="l00740"></a>00740 | |||
<a name="l00741"></a>00741 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00742"></a>00742 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00743"></a>00743 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00744"></a>00744 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00745"></a>00745 <span class="keywordtype">bool</span> callbackEvent( AudioDeviceID deviceId, | |||
<a name="l00746"></a>00746 <span class="keyword">const</span> AudioBufferList *inBufferList, | |||
<a name="l00747"></a>00747 <span class="keyword">const</span> AudioBufferList *outBufferList ); | |||
<a name="l00748"></a>00748 | |||
<a name="l00749"></a>00749 <span class="keyword">private</span>: | |||
<a name="l00750"></a>00750 | |||
<a name="l00751"></a>00751 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00752"></a>00752 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00753"></a>00753 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00754"></a>00754 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00755"></a>00755 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* getErrorCode( OSStatus code ); | |||
<a name="l00756"></a>00756 }; | |||
<a name="l00757"></a>00757 | |||
<a name="l00758"></a>00758 <span class="preprocessor">#endif</span> | |||
<a name="l00759"></a>00759 <span class="preprocessor"></span> | |||
<a name="l00760"></a>00760 <span class="preprocessor">#if defined(__UNIX_JACK__)</span> | |||
<a name="l00761"></a>00761 <span class="preprocessor"></span> | |||
<a name="l00762"></a>00762 <span class="keyword">class </span>RtApiJack: <span class="keyword">public</span> RtApi | |||
<a name="l00763"></a>00763 { | |||
<a name="l00764"></a>00764 <span class="keyword">public</span>: | |||
<a name="l00765"></a>00765 | |||
<a name="l00766"></a>00766 RtApiJack(); | |||
<a name="l00767"></a>00767 ~RtApiJack(); | |||
<a name="l00768"></a>00768 <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d8494767e17c6edfbd827f91763915df4105">RtAudio::UNIX_JACK</a>; }; | |||
<a name="l00769"></a>00769 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00770"></a>00770 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00771"></a>00771 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00772"></a>00772 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00773"></a>00773 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00774"></a>00774 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00775"></a>00775 <span class="keywordtype">long</span> getStreamLatency( <span class="keywordtype">void</span> ); | |||
<a name="l00776"></a>00776 | |||
<a name="l00777"></a>00777 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00778"></a>00778 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00779"></a>00779 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00780"></a>00780 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00781"></a>00781 <span class="keywordtype">bool</span> callbackEvent( <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> nframes ); | |||
<a name="l00782"></a>00782 | |||
<a name="l00783"></a>00783 <span class="keyword">private</span>: | |||
<a name="l00784"></a>00784 | |||
<a name="l00785"></a>00785 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00786"></a>00786 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00787"></a>00787 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00788"></a>00788 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00789"></a>00789 }; | |||
<a name="l00790"></a>00790 | |||
<a name="l00791"></a>00791 <span class="preprocessor">#endif</span> | |||
<a name="l00792"></a>00792 <span class="preprocessor"></span> | |||
<a name="l00793"></a>00793 <span class="preprocessor">#if defined(__WINDOWS_ASIO__)</span> | |||
<a name="l00794"></a>00794 <span class="preprocessor"></span> | |||
<a name="l00795"></a>00795 <span class="keyword">class </span>RtApiAsio: <span class="keyword">public</span> RtApi | |||
<a name="l00796"></a>00796 { | |||
<a name="l00797"></a>00797 <span class="keyword">public</span>: | |||
<a name="l00798"></a>00798 | |||
<a name="l00799"></a>00799 RtApiAsio(); | |||
<a name="l00800"></a>00800 ~RtApiAsio(); | |||
<a name="l00801"></a>00801 <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849219517d1df90f94d07758481155bd469">RtAudio::WINDOWS_ASIO</a>; }; | |||
<a name="l00802"></a>00802 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00803"></a>00803 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00804"></a>00804 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00805"></a>00805 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00806"></a>00806 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00807"></a>00807 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00808"></a>00808 <span class="keywordtype">long</span> getStreamLatency( <span class="keywordtype">void</span> ); | |||
<a name="l00809"></a>00809 | |||
<a name="l00810"></a>00810 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00811"></a>00811 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00812"></a>00812 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00813"></a>00813 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00814"></a>00814 <span class="keywordtype">bool</span> callbackEvent( <span class="keywordtype">long</span> bufferIndex ); | |||
<a name="l00815"></a>00815 | |||
<a name="l00816"></a>00816 <span class="keyword">private</span>: | |||
<a name="l00817"></a>00817 | |||
<a name="l00818"></a>00818 std::vector<RtAudio::DeviceInfo> devices_; | |||
<a name="l00819"></a>00819 <span class="keywordtype">void</span> saveDeviceInfo( <span class="keywordtype">void</span> ); | |||
<a name="l00820"></a>00820 <span class="keywordtype">bool</span> coInitialized_; | |||
<a name="l00821"></a>00821 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00822"></a>00822 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00823"></a>00823 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00824"></a>00824 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00825"></a>00825 }; | |||
<a name="l00826"></a>00826 | |||
<a name="l00827"></a>00827 <span class="preprocessor">#endif</span> | |||
<a name="l00828"></a>00828 <span class="preprocessor"></span> | |||
<a name="l00829"></a>00829 <span class="preprocessor">#if defined(__WINDOWS_DS__)</span> | |||
<a name="l00830"></a>00830 <span class="preprocessor"></span> | |||
<a name="l00831"></a>00831 <span class="keyword">class </span>RtApiDs: <span class="keyword">public</span> RtApi | |||
<a name="l00832"></a>00832 { | |||
<a name="l00833"></a>00833 <span class="keyword">public</span>: | |||
<a name="l00834"></a>00834 | |||
<a name="l00835"></a>00835 RtApiDs(); | |||
<a name="l00836"></a>00836 ~RtApiDs(); | |||
<a name="l00837"></a>00837 <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d84928478830f42c2fd61e6c7ad498901931">RtAudio::WINDOWS_DS</a>; }; | |||
<a name="l00838"></a>00838 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00839"></a>00839 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDefaultOutputDevice( <span class="keywordtype">void</span> ); | |||
<a name="l00840"></a>00840 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDefaultInputDevice( <span class="keywordtype">void</span> ); | |||
<a name="l00841"></a>00841 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00842"></a>00842 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00843"></a>00843 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00844"></a>00844 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00845"></a>00845 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00846"></a>00846 <span class="keywordtype">long</span> getStreamLatency( <span class="keywordtype">void</span> ); | |||
<a name="l00847"></a>00847 | |||
<a name="l00848"></a>00848 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00849"></a>00849 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00850"></a>00850 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00851"></a>00851 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00852"></a>00852 <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">void</span> ); | |||
<a name="l00853"></a>00853 | |||
<a name="l00854"></a>00854 <span class="keyword">private</span>: | |||
<a name="l00855"></a>00855 | |||
<a name="l00856"></a>00856 <span class="keywordtype">bool</span> coInitialized_; | |||
<a name="l00857"></a>00857 <span class="keywordtype">bool</span> buffersRolling; | |||
<a name="l00858"></a>00858 <span class="keywordtype">long</span> duplexPrerollBytes; | |||
<a name="l00859"></a>00859 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00860"></a>00860 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00861"></a>00861 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00862"></a>00862 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00863"></a>00863 }; | |||
<a name="l00864"></a>00864 | |||
<a name="l00865"></a>00865 <span class="preprocessor">#endif</span> | |||
<a name="l00866"></a>00866 <span class="preprocessor"></span> | |||
<a name="l00867"></a>00867 <span class="preprocessor">#if defined(__LINUX_ALSA__)</span> | |||
<a name="l00868"></a>00868 <span class="preprocessor"></span> | |||
<a name="l00869"></a>00869 <span class="keyword">class </span>RtApiAlsa: <span class="keyword">public</span> RtApi | |||
<a name="l00870"></a>00870 { | |||
<a name="l00871"></a>00871 <span class="keyword">public</span>: | |||
<a name="l00872"></a>00872 | |||
<a name="l00873"></a>00873 RtApiAlsa(); | |||
<a name="l00874"></a>00874 ~RtApiAlsa(); | |||
<a name="l00875"></a>00875 <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi() { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849a7a2ba095c2806caa893b6fb8fc3a1a8">RtAudio::LINUX_ALSA</a>; }; | |||
<a name="l00876"></a>00876 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00877"></a>00877 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00878"></a>00878 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00879"></a>00879 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00880"></a>00880 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00881"></a>00881 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00882"></a>00882 | |||
<a name="l00883"></a>00883 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00884"></a>00884 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00885"></a>00885 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00886"></a>00886 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00887"></a>00887 <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">void</span> ); | |||
<a name="l00888"></a>00888 | |||
<a name="l00889"></a>00889 <span class="keyword">private</span>: | |||
<a name="l00890"></a>00890 | |||
<a name="l00891"></a>00891 std::vector<RtAudio::DeviceInfo> devices_; | |||
<a name="l00892"></a>00892 <span class="keywordtype">void</span> saveDeviceInfo( <span class="keywordtype">void</span> ); | |||
<a name="l00893"></a>00893 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00894"></a>00894 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00895"></a>00895 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00896"></a>00896 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00897"></a>00897 }; | |||
<a name="l00898"></a>00898 | |||
<a name="l00899"></a>00899 <span class="preprocessor">#endif</span> | |||
<a name="l00900"></a>00900 <span class="preprocessor"></span> | |||
<a name="l00901"></a>00901 <span class="preprocessor">#if defined(__LINUX_OSS__)</span> | |||
<a name="l00902"></a>00902 <span class="preprocessor"></span> | |||
<a name="l00903"></a>00903 <span class="keyword">class </span>RtApiOss: <span class="keyword">public</span> RtApi | |||
<a name="l00904"></a>00904 { | |||
<a name="l00905"></a>00905 <span class="keyword">public</span>: | |||
<a name="l00906"></a>00906 | |||
<a name="l00907"></a>00907 RtApiOss(); | |||
<a name="l00908"></a>00908 ~RtApiOss(); | |||
<a name="l00909"></a>00909 <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi() { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d84939c84615e61de75e6a4e865596d62c82">RtAudio::LINUX_OSS</a>; }; | |||
<a name="l00910"></a>00910 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00911"></a>00911 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00912"></a>00912 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00913"></a>00913 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00914"></a>00914 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00915"></a>00915 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00916"></a>00916 | |||
<a name="l00917"></a>00917 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00918"></a>00918 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00919"></a>00919 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00920"></a>00920 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00921"></a>00921 <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">void</span> ); | |||
<a name="l00922"></a>00922 | |||
<a name="l00923"></a>00923 <span class="keyword">private</span>: | |||
<a name="l00924"></a>00924 | |||
<a name="l00925"></a>00925 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00926"></a>00926 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00927"></a>00927 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00928"></a>00928 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00929"></a>00929 }; | |||
<a name="l00930"></a>00930 | |||
<a name="l00931"></a>00931 <span class="preprocessor">#endif</span> | |||
<a name="l00932"></a>00932 <span class="preprocessor"></span> | |||
<a name="l00933"></a>00933 <span class="preprocessor">#if defined(__RTAUDIO_DUMMY__)</span> | |||
<a name="l00934"></a>00934 <span class="preprocessor"></span> | |||
<a name="l00935"></a>00935 <span class="keyword">class </span>RtApiDummy: <span class="keyword">public</span> RtApi | |||
<a name="l00936"></a>00936 { | |||
<a name="l00937"></a>00937 <span class="keyword">public</span>: | |||
<a name="l00938"></a>00938 | |||
<a name="l00939"></a>00939 RtApiDummy() { errorText_ = <span class="stringliteral">"RtApiDummy: This class provides no functionality."</span>; error( <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac3a1603c24a56cbdaf5f8ae4ddcb86398">RtError::WARNING</a> ); }; | |||
<a name="l00940"></a>00940 <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#c9b6f625da88249d08a8409a9db0d849b06b8fd88bf18c9a2b8271f6961ae2d1">RtAudio::RTAUDIO_DUMMY</a>; }; | |||
<a name="l00941"></a>00941 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> 0; }; | |||
<a name="l00942"></a>00942 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ) { <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> info; <span class="keywordflow">return</span> info; }; | |||
<a name="l00943"></a>00943 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ) {}; | |||
<a name="l00944"></a>00944 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ) {}; | |||
<a name="l00945"></a>00945 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ) {}; | |||
<a name="l00946"></a>00946 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ) {}; | |||
<a name="l00947"></a>00947 | |||
<a name="l00948"></a>00948 <span class="keyword">private</span>: | |||
<a name="l00949"></a>00949 | |||
<a name="l00950"></a>00950 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00951"></a>00951 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00952"></a>00952 <a class="code" href="RtAudio_8h.html#afca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00953"></a>00953 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ) { <span class="keywordflow">return</span> <span class="keyword">false</span>; }; | |||
<a name="l00954"></a>00954 }; | |||
<a name="l00955"></a>00955 | |||
<a name="l00956"></a>00956 <span class="preprocessor">#endif</span> | |||
<a name="l00957"></a>00957 <span class="preprocessor"></span> | |||
<a name="l00958"></a>00958 <span class="preprocessor">#endif</span> | |||
<a name="l00959"></a>00959 <span class="preprocessor"></span> | |||
<a name="l00960"></a>00960 <span class="comment">// Indentation settings for Vim and Emacs</span> | |||
<a name="l00961"></a>00961 <span class="comment">//</span> | |||
<a name="l00962"></a>00962 <span class="comment">// Local Variables:</span> | |||
<a name="l00963"></a>00963 <span class="comment">// c-basic-offset: 2</span> | |||
<a name="l00964"></a>00964 <span class="comment">// indent-tabs-mode: nil</span> | |||
<a name="l00965"></a>00965 <span class="comment">// End:</span> | |||
<a name="l00966"></a>00966 <span class="comment">//</span> | |||
<a name="l00967"></a>00967 <span class="comment">// vim: et sts=2 sw=2</span> | |||
</pre></div></div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,148 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<div class="contents"> | |||
<h1>RtAudio.h File Reference</h1><code>#include <string></code><br/> | |||
<code>#include <vector></code><br/> | |||
<code>#include "RtError.h"</code><br/> | |||
<code>#include <sstream></code><br/> | |||
<p><a href="RtAudio_8h_source.html">Go to the source code of this file.</a></p> | |||
<table border="0" cellpadding="0" cellspacing="0"> | |||
<tr><td colspan="2"><h2>Classes</h2></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">class </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html">RtAudio</a></td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Realtime audio i/o C++ classes. <a href="classRtAudio.html#_details">More...</a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a></td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The public device information structure for returning queried values. <a href="structRtAudio_1_1DeviceInfo.html#_details">More...</a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a></td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The structure for specifying input or ouput stream parameters. <a href="structRtAudio_1_1StreamParameters.html#_details">More...</a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html">RtAudio::StreamOptions</a></td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The structure for specifying stream options. <a href="structRtAudio_1_1StreamOptions.html#_details">More...</a><br/></td></tr> | |||
<tr><td colspan="2"><h2>Typedefs</h2></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">typedef unsigned long </td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8">RtAudioFormat</a></td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> data format type. <a href="#aafca92882d25915560018873221e44b8"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">typedef unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41">RtAudioStreamFlags</a></td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream option flags. <a href="#a2c0f59b200dcec4d4e760f9166b29c41"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">typedef unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">RtAudioStreamStatus</a></td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream status (over- or underflow) flags. <a href="#a80e306d363583da3b0a1b65d9b57c806"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">typedef int(* </td><td class="memItemRight" valign="bottom"><a class="el" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f">RtAudioCallback</a> )(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, <a class="el" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">RtAudioStreamStatus</a> status, void *userData)</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> callback function prototype. <a href="#a112c7b7e25a974977f6fc094cef1a31f"></a><br/></td></tr> | |||
</table> | |||
<hr/><a name="_details"></a><h2>Detailed Description</h2> | |||
<hr/><h2>Typedef Documentation</h2> | |||
<a class="anchor" id="aafca92882d25915560018873221e44b8"></a><!-- doxytag: member="RtAudio.h::RtAudioFormat" ref="aafca92882d25915560018873221e44b8" args="" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">typedef unsigned long <a class="el" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8">RtAudioFormat</a></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> data format type. </p> | |||
<p>Support for signed integers and floats. Audio data fed to/from an <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream is assumed to ALWAYS be in host byte order. The internal routines will automatically take care of any necessary byte-swapping between the host format and the soundcard. Thus, endian-ness is not a concern in the following format definitions. Note that 24-bit data is expected to be encapsulated in a 32-bit format.</p> | |||
<ul> | |||
<li><em>RTAUDIO_SINT8:</em> 8-bit signed integer.</li> | |||
<li><em>RTAUDIO_SINT16:</em> 16-bit signed integer.</li> | |||
<li><em>RTAUDIO_SINT24:</em> Lower 3 bytes of 32-bit signed integer.</li> | |||
<li><em>RTAUDIO_SINT32:</em> 32-bit signed integer.</li> | |||
<li><em>RTAUDIO_FLOAT32:</em> Normalized between plus/minus 1.0.</li> | |||
<li><em>RTAUDIO_FLOAT64:</em> Normalized between plus/minus 1.0. </li> | |||
</ul> | |||
</div> | |||
</div> | |||
<a class="anchor" id="a2c0f59b200dcec4d4e760f9166b29c41"></a><!-- doxytag: member="RtAudio.h::RtAudioStreamFlags" ref="a2c0f59b200dcec4d4e760f9166b29c41" args="" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">typedef unsigned long <a class="el" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41">RtAudioStreamFlags</a></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream option flags. </p> | |||
<p>The following flags can be OR'ed together to allow a client to make changes to the default stream behavior:</p> | |||
<ul> | |||
<li><em>RTAUDIO_NONINTERLEAVED:</em> Use non-interleaved buffers (default = interleaved).</li> | |||
<li><em>RTAUDIO_MINIMIZE_LATENCY:</em> Attempt to set stream parameters for lowest possible latency.</li> | |||
<li><em>RTAUDIO_HOG_DEVICE:</em> Attempt grab device for exclusive use.</li> | |||
<li><em>RTAUDIO_ALSA_USE_DEFAULT:</em> Use the "default" PCM device (ALSA only).</li> | |||
</ul> | |||
<p>By default, <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the openStream() function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with <code>nFrames</code> samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index <code>nFrames</code> (assuming the <code>buffer</code> pointer was recast to the correct data type for the stream).</p> | |||
<p>Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the openStream() function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance.</p> | |||
<p>If the RTAUDIO_HOG_DEVICE flag is set, <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs.</p> | |||
<p>If the RTAUDIO_SCHEDULE_REALTIME flag is set, <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> will attempt to select realtime scheduling (round-robin) for the callback thread.</p> | |||
<p>If the RTAUDIO_ALSA_USE_DEFAULT flag is set, <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> will attempt to open the "default" PCM device when using the ALSA API. Note that this will override any specified input or output device id. </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="a80e306d363583da3b0a1b65d9b57c806"></a><!-- doxytag: member="RtAudio.h::RtAudioStreamStatus" ref="a80e306d363583da3b0a1b65d9b57c806" args="" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">typedef unsigned long <a class="el" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">RtAudioStreamStatus</a></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> stream status (over- or underflow) flags. </p> | |||
<p>Notification of a stream over- or underflow is indicated by a non-zero stream <code>status</code> argument in the RtAudioCallback function. The stream status can be one of the following two options, depending on whether the stream is open for output and/or input:</p> | |||
<ul> | |||
<li><em>RTAUDIO_INPUT_OVERFLOW:</em> Input data was discarded because of an overflow condition at the driver.</li> | |||
<li><em>RTAUDIO_OUTPUT_UNDERFLOW:</em> The output buffer ran low, likely producing a break in the output sound. </li> | |||
</ul> | |||
</div> | |||
</div> | |||
<a class="anchor" id="a112c7b7e25a974977f6fc094cef1a31f"></a><!-- doxytag: member="RtAudio.h::RtAudioCallback" ref="a112c7b7e25a974977f6fc094cef1a31f" args=")(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *userData)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">typedef int(* <a class="el" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f">RtAudioCallback</a>)(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, <a class="el" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">RtAudioStreamStatus</a> status, void *userData)</td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> callback function prototype. </p> | |||
<p>All <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> clients must create a function of type RtAudioCallback to read and/or write data from/to the audio stream. When the underlying audio system is ready for new input or output data, this function will be invoked.</p> | |||
<dl><dt><b>Parameters:</b></dt><dd> | |||
<table border="0" cellspacing="2" cellpadding="0"> | |||
<tr><td valign="top"></td><td valign="top"><em>outputBuffer</em> </td><td>For output (or duplex) streams, the client should write <code>nFrames</code> of audio sample frames into this buffer. This argument should be recast to the datatype specified when the stream was opened. For input-only streams, this argument will be NULL.</td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>inputBuffer</em> </td><td>For input (or duplex) streams, this buffer will hold <code>nFrames</code> of input audio sample frames. This argument should be recast to the datatype specified when the stream was opened. For output-only streams, this argument will be NULL.</td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>nFrames</em> </td><td>The number of sample frames of input or output data in the buffers. The actual buffer size in bytes is dependent on the data type and number of channels in use.</td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>streamTime</em> </td><td>The number of seconds that have elapsed since the stream was started.</td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>status</em> </td><td>If non-zero, this argument indicates a data overflow or underflow condition for the stream. The particular condition can be determined by comparison with the RtAudioStreamStatus flags.</td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>userData</em> </td><td>A pointer to optional data provided by the client when opening the stream (default = NULL).</td></tr> | |||
</table> | |||
</dd> | |||
</dl> | |||
<p>To continue normal stream operation, the RtAudioCallback function should return a value of zero. To stop the stream and drain the output buffer, the function should return a value of one. To abort the stream immediately, the client should return a value of two. </p> | |||
</div> | |||
</div> | |||
</div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,677 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<h1>RtAudio.h</h1><a href="RtAudio_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/************************************************************************/</span> | |||
<a name="l00039"></a>00039 <span class="comment">/************************************************************************/</span> | |||
<a name="l00040"></a>00040 | |||
<a name="l00045"></a>00045 <span class="comment">// RtAudio: Version 4.0.11</span> | |||
<a name="l00046"></a>00046 | |||
<a name="l00047"></a>00047 <span class="preprocessor">#ifndef __RTAUDIO_H</span> | |||
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define __RTAUDIO_H</span> | |||
<a name="l00049"></a>00049 <span class="preprocessor"></span> | |||
<a name="l00050"></a>00050 <span class="preprocessor">#include <string></span> | |||
<a name="l00051"></a>00051 <span class="preprocessor">#include <vector></span> | |||
<a name="l00052"></a>00052 <span class="preprocessor">#include "RtError.h"</span> | |||
<a name="l00053"></a>00053 | |||
<a name="l00072"></a><a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8">00072</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a>; | |||
<a name="l00073"></a>00073 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT8 = 0x1; <span class="comment">// 8-bit signed integer.</span> | |||
<a name="l00074"></a>00074 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT16 = 0x2; <span class="comment">// 16-bit signed integer.</span> | |||
<a name="l00075"></a>00075 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT24 = 0x4; <span class="comment">// Lower 3 bytes of 32-bit signed integer.</span> | |||
<a name="l00076"></a>00076 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_SINT32 = 0x8; <span class="comment">// 32-bit signed integer.</span> | |||
<a name="l00077"></a>00077 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_FLOAT32 = 0x10; <span class="comment">// Normalized between plus/minus 1.0.</span> | |||
<a name="l00078"></a>00078 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> RTAUDIO_FLOAT64 = 0x20; <span class="comment">// Normalized between plus/minus 1.0.</span> | |||
<a name="l00079"></a>00079 | |||
<a name="l00122"></a><a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41">00122</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a>; | |||
<a name="l00123"></a>00123 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_NONINTERLEAVED = 0x1; <span class="comment">// Use non-interleaved buffers (default = interleaved).</span> | |||
<a name="l00124"></a>00124 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_MINIMIZE_LATENCY = 0x2; <span class="comment">// Attempt to set stream parameters for lowest possible latency.</span> | |||
<a name="l00125"></a>00125 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_HOG_DEVICE = 0x4; <span class="comment">// Attempt grab device and prevent use by others.</span> | |||
<a name="l00126"></a>00126 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_SCHEDULE_REALTIME = 0x8; <span class="comment">// Try to select realtime scheduling for callback thread.</span> | |||
<a name="l00127"></a>00127 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> RTAUDIO_ALSA_USE_DEFAULT = 0x10; <span class="comment">// Use the "default" PCM device (ALSA only).</span> | |||
<a name="l00128"></a>00128 | |||
<a name="l00140"></a><a class="code" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806">00140</a> <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a>; | |||
<a name="l00141"></a>00141 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a> RTAUDIO_INPUT_OVERFLOW = 0x1; <span class="comment">// Input data was discarded because of an overflow condition at the driver.</span> | |||
<a name="l00142"></a>00142 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a> RTAUDIO_OUTPUT_UNDERFLOW = 0x2; <span class="comment">// The output buffer ran low, likely causing a gap in the output sound.</span> | |||
<a name="l00143"></a>00143 | |||
<a name="l00145"></a>00145 | |||
<a name="l00183"></a><a class="code" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f">00183</a> <span class="keyword">typedef</span> int (*<a class="code" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f" title="RtAudio callback function prototype.">RtAudioCallback</a>)( <span class="keywordtype">void</span> *outputBuffer, <span class="keywordtype">void</span> *inputBuffer, | |||
<a name="l00184"></a>00184 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nFrames, | |||
<a name="l00185"></a>00185 <span class="keywordtype">double</span> streamTime, | |||
<a name="l00186"></a>00186 <a class="code" href="RtAudio_8h.html#a80e306d363583da3b0a1b65d9b57c806" title="RtAudio stream status (over- or underflow) flags.">RtAudioStreamStatus</a> status, | |||
<a name="l00187"></a>00187 <span class="keywordtype">void</span> *userData ); | |||
<a name="l00188"></a>00188 | |||
<a name="l00189"></a>00189 | |||
<a name="l00190"></a>00190 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00191"></a>00191 <span class="comment">//</span> | |||
<a name="l00192"></a>00192 <span class="comment">// RtAudio class declaration.</span> | |||
<a name="l00193"></a>00193 <span class="comment">//</span> | |||
<a name="l00194"></a>00194 <span class="comment">// RtAudio is a "controller" used to select an available audio i/o</span> | |||
<a name="l00195"></a>00195 <span class="comment">// interface. It presents a common API for the user to call but all</span> | |||
<a name="l00196"></a>00196 <span class="comment">// functionality is implemented by the class RtApi and its</span> | |||
<a name="l00197"></a>00197 <span class="comment">// subclasses. RtAudio creates an instance of an RtApi subclass</span> | |||
<a name="l00198"></a>00198 <span class="comment">// based on the user's API choice. If no choice is made, RtAudio</span> | |||
<a name="l00199"></a>00199 <span class="comment">// attempts to make a "logical" API selection.</span> | |||
<a name="l00200"></a>00200 <span class="comment">//</span> | |||
<a name="l00201"></a>00201 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00202"></a>00202 | |||
<a name="l00203"></a>00203 <span class="keyword">class </span>RtApi; | |||
<a name="l00204"></a>00204 | |||
<a name="l00205"></a><a class="code" href="classRtAudio.html">00205</a> <span class="keyword">class </span><a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> | |||
<a name="l00206"></a>00206 { | |||
<a name="l00207"></a>00207 <span class="keyword">public</span>: | |||
<a name="l00208"></a>00208 | |||
<a name="l00210"></a><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">00210</a> <span class="keyword">enum</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">Api</a> { | |||
<a name="l00211"></a><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae">00211</a> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae">UNSPECIFIED</a>, | |||
<a name="l00212"></a><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8">00212</a> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8">LINUX_ALSA</a>, | |||
<a name="l00213"></a><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77">00213</a> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77">LINUX_PULSE</a>, | |||
<a name="l00214"></a><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82">00214</a> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82">LINUX_OSS</a>, | |||
<a name="l00215"></a><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105">00215</a> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105">UNIX_JACK</a>, | |||
<a name="l00216"></a><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d">00216</a> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d">MACOSX_CORE</a>, | |||
<a name="l00217"></a><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469">00217</a> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469">WINDOWS_ASIO</a>, | |||
<a name="l00218"></a><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931">00218</a> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931">WINDOWS_DS</a>, | |||
<a name="l00219"></a><a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1">00219</a> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1">RTAUDIO_DUMMY</a> | |||
<a name="l00220"></a>00220 }; | |||
<a name="l00221"></a>00221 | |||
<a name="l00223"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html">00223</a> <span class="keyword">struct </span><a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">DeviceInfo</a> { | |||
<a name="l00224"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#a97573717ccb1e75a834a0a108cd6982d">00224</a> <span class="keywordtype">bool</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a97573717ccb1e75a834a0a108cd6982d">probed</a>; | |||
<a name="l00225"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#a24df596ab8d54f2eb540c7cf16212b3b">00225</a> std::string <a class="code" href="structRtAudio_1_1DeviceInfo.html#a24df596ab8d54f2eb540c7cf16212b3b">name</a>; | |||
<a name="l00226"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#a81aaf488f8158ef55b1bb678f66feb7d">00226</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a81aaf488f8158ef55b1bb678f66feb7d">outputChannels</a>; | |||
<a name="l00227"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#a56247b458a937ae84d98ca9c4b243275">00227</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a56247b458a937ae84d98ca9c4b243275">inputChannels</a>; | |||
<a name="l00228"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#a3e8ad34c2d14e24293a0beafc26186e7">00228</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a3e8ad34c2d14e24293a0beafc26186e7">duplexChannels</a>; | |||
<a name="l00229"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#a5365245e73ffe29a05734de4474acd58">00229</a> <span class="keywordtype">bool</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a5365245e73ffe29a05734de4474acd58">isDefaultOutput</a>; | |||
<a name="l00230"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#a7c8aca084bd908799b6be5954b80def2">00230</a> <span class="keywordtype">bool</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a7c8aca084bd908799b6be5954b80def2">isDefaultInput</a>; | |||
<a name="l00231"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#afa65f5f92f66ce7aacd3ff35e11b230f">00231</a> std::vector<unsigned int> <a class="code" href="structRtAudio_1_1DeviceInfo.html#afa65f5f92f66ce7aacd3ff35e11b230f">sampleRates</a>; | |||
<a name="l00232"></a><a class="code" href="structRtAudio_1_1DeviceInfo.html#a23251b549b89b2fe04a57fcd7cb76ea4">00232</a> <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> <a class="code" href="structRtAudio_1_1DeviceInfo.html#a23251b549b89b2fe04a57fcd7cb76ea4">nativeFormats</a>; | |||
<a name="l00234"></a>00234 <span class="comment">// Default constructor.</span> | |||
<a name="l00235"></a>00235 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">DeviceInfo</a>() | |||
<a name="l00236"></a>00236 :<a class="code" href="structRtAudio_1_1DeviceInfo.html#a97573717ccb1e75a834a0a108cd6982d">probed</a>(false), <a class="code" href="structRtAudio_1_1DeviceInfo.html#a81aaf488f8158ef55b1bb678f66feb7d">outputChannels</a>(0), <a class="code" href="structRtAudio_1_1DeviceInfo.html#a56247b458a937ae84d98ca9c4b243275">inputChannels</a>(0), <a class="code" href="structRtAudio_1_1DeviceInfo.html#a3e8ad34c2d14e24293a0beafc26186e7">duplexChannels</a>(0), | |||
<a name="l00237"></a>00237 <a class="code" href="structRtAudio_1_1DeviceInfo.html#a5365245e73ffe29a05734de4474acd58">isDefaultOutput</a>(false), <a class="code" href="structRtAudio_1_1DeviceInfo.html#a7c8aca084bd908799b6be5954b80def2">isDefaultInput</a>(false), <a class="code" href="structRtAudio_1_1DeviceInfo.html#a23251b549b89b2fe04a57fcd7cb76ea4">nativeFormats</a>(0) {} | |||
<a name="l00238"></a>00238 }; | |||
<a name="l00239"></a>00239 | |||
<a name="l00241"></a><a class="code" href="structRtAudio_1_1StreamParameters.html">00241</a> <span class="keyword">struct </span><a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">StreamParameters</a> { | |||
<a name="l00242"></a><a class="code" href="structRtAudio_1_1StreamParameters.html#ab3c72bcf3ef12149ae9a4fb597cc5489">00242</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamParameters.html#ab3c72bcf3ef12149ae9a4fb597cc5489">deviceId</a>; | |||
<a name="l00243"></a><a class="code" href="structRtAudio_1_1StreamParameters.html#a88a10091b6e284e21235cc6f25332ebd">00243</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamParameters.html#a88a10091b6e284e21235cc6f25332ebd">nChannels</a>; | |||
<a name="l00244"></a><a class="code" href="structRtAudio_1_1StreamParameters.html#ad4b4503782653ec93c83328c46abe50c">00244</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamParameters.html#ad4b4503782653ec93c83328c46abe50c">firstChannel</a>; | |||
<a name="l00246"></a>00246 <span class="comment">// Default constructor.</span> | |||
<a name="l00247"></a>00247 <a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">StreamParameters</a>() | |||
<a name="l00248"></a>00248 : <a class="code" href="structRtAudio_1_1StreamParameters.html#ab3c72bcf3ef12149ae9a4fb597cc5489">deviceId</a>(0), <a class="code" href="structRtAudio_1_1StreamParameters.html#a88a10091b6e284e21235cc6f25332ebd">nChannels</a>(0), <a class="code" href="structRtAudio_1_1StreamParameters.html#ad4b4503782653ec93c83328c46abe50c">firstChannel</a>(0) {} | |||
<a name="l00249"></a>00249 }; | |||
<a name="l00250"></a>00250 | |||
<a name="l00252"></a>00252 | |||
<a name="l00308"></a><a class="code" href="structRtAudio_1_1StreamOptions.html">00308</a> <span class="keyword">struct </span><a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">StreamOptions</a> { | |||
<a name="l00309"></a><a class="code" href="structRtAudio_1_1StreamOptions.html#a0ecc98b031aa3af49d09b781643e298b">00309</a> <a class="code" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41" title="RtAudio stream option flags.">RtAudioStreamFlags</a> <a class="code" href="structRtAudio_1_1StreamOptions.html#a0ecc98b031aa3af49d09b781643e298b">flags</a>; | |||
<a name="l00310"></a><a class="code" href="structRtAudio_1_1StreamOptions.html#a75a14cfab903d0e1c091bc16aec80240">00310</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamOptions.html#a75a14cfab903d0e1c091bc16aec80240">numberOfBuffers</a>; | |||
<a name="l00311"></a><a class="code" href="structRtAudio_1_1StreamOptions.html#a2a4b0b8d690c624d20f4e8f4be6ca9ba">00311</a> std::string <a class="code" href="structRtAudio_1_1StreamOptions.html#a2a4b0b8d690c624d20f4e8f4be6ca9ba">streamName</a>; | |||
<a name="l00312"></a><a class="code" href="structRtAudio_1_1StreamOptions.html#adfd267059434edb21573c584e6367def">00312</a> <span class="keywordtype">int</span> <a class="code" href="structRtAudio_1_1StreamOptions.html#adfd267059434edb21573c584e6367def">priority</a>; | |||
<a name="l00314"></a>00314 <span class="comment">// Default constructor.</span> | |||
<a name="l00315"></a>00315 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">StreamOptions</a>() | |||
<a name="l00316"></a>00316 : <a class="code" href="structRtAudio_1_1StreamOptions.html#a0ecc98b031aa3af49d09b781643e298b">flags</a>(0), <a class="code" href="structRtAudio_1_1StreamOptions.html#a75a14cfab903d0e1c091bc16aec80240">numberOfBuffers</a>(0), <a class="code" href="structRtAudio_1_1StreamOptions.html#adfd267059434edb21573c584e6367def">priority</a>(0) {} | |||
<a name="l00317"></a>00317 }; | |||
<a name="l00318"></a>00318 | |||
<a name="l00320"></a>00320 | |||
<a name="l00325"></a>00325 <span class="keyword">static</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ae266ffad2ef428d0b2c6c262d391ce26" title="A static function to determine the available compiled audio APIs.">getCompiledApi</a>( std::vector<RtAudio::Api> &apis ) <span class="keywordflow">throw</span>(); | |||
<a name="l00326"></a>00326 | |||
<a name="l00328"></a>00328 | |||
<a name="l00336"></a>00336 <a class="code" href="classRtAudio.html#afd0bfa26deae9804e18faff59d0273d9" title="The class constructor.">RtAudio</a>( <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> api=<a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae">UNSPECIFIED</a> ) throw(); | |||
<a name="l00337"></a>00337 | |||
<a name="l00339"></a>00339 | |||
<a name="l00343"></a>00343 ~<a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>() throw(); | |||
<a name="l00344"></a>00344 | |||
<a name="l00346"></a>00346 <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::<a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>( <span class="keywordtype">void</span> ) throw(); | |||
<a name="l00347"></a>00347 | |||
<a name="l00349"></a>00349 | |||
<a name="l00354"></a>00354 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> ) throw(); | |||
<a name="l00355"></a>00355 | |||
<a name="l00357"></a>00357 | |||
<a name="l00367"></a>00367 <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::DeviceInfo <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00368"></a>00368 | |||
<a name="l00370"></a>00370 | |||
<a name="l00377"></a>00377 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc" title="A function that returns the index of the default output device.">getDefaultOutputDevice</a>( <span class="keywordtype">void</span> ) throw(); | |||
<a name="l00378"></a>00378 | |||
<a name="l00380"></a>00380 | |||
<a name="l00387"></a>00387 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce" title="A function that returns the index of the default input device.">getDefaultInputDevice</a>( <span class="keywordtype">void</span> ) throw(); | |||
<a name="l00388"></a>00388 | |||
<a name="l00390"></a>00390 | |||
<a name="l00427"></a>00427 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#afacc99740fa4c5606fb35467cdea6da8" title="A public function for opening a stream with the specified parameters.">openStream</a>( <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::StreamParameters *outputParameters, | |||
<a name="l00428"></a>00428 <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::StreamParameters *inputParameters, | |||
<a name="l00429"></a>00429 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00430"></a>00430 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferFrames, <a class="code" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f" title="RtAudio callback function prototype.">RtAudioCallback</a> callback, | |||
<a name="l00431"></a>00431 <span class="keywordtype">void</span> *userData = NULL, <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::StreamOptions *options = NULL ); | |||
<a name="l00432"></a>00432 | |||
<a name="l00434"></a>00434 | |||
<a name="l00438"></a>00438 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> ) throw(); | |||
<a name="l00439"></a>00439 | |||
<a name="l00441"></a>00441 | |||
<a name="l00447"></a>00447 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00448"></a>00448 | |||
<a name="l00450"></a>00450 | |||
<a name="l00456"></a>00456 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00457"></a>00457 | |||
<a name="l00459"></a>00459 | |||
<a name="l00465"></a>00465 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00466"></a>00466 | |||
<a name="l00468"></a>00468 <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a3863e45ff81dbe97176de0ee7545917f" title="Returns true if a stream is open and false if not.">isStreamOpen</a>( <span class="keywordtype">void</span> ) const throw(); | |||
<a name="l00469"></a>00469 | |||
<a name="l00471"></a>00471 <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a84cc8d9b7ab9bc5f37bcf48430ec5aea" title="Returns true if the stream is running and false if it is stopped or not open.">isStreamRunning</a>( <span class="keywordtype">void</span> ) const throw(); | |||
<a name="l00472"></a>00472 | |||
<a name="l00474"></a>00474 | |||
<a name="l00477"></a>00477 <span class="keywordtype">double</span> <a class="code" href="classRtAudio.html#a344e59a62353c5791db4621b985cb2ca" title="Returns the number of elapsed seconds since the stream was started.">getStreamTime</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00478"></a>00478 | |||
<a name="l00480"></a>00480 | |||
<a name="l00488"></a>00488 <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">getStreamLatency</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00489"></a>00489 | |||
<a name="l00491"></a>00491 | |||
<a name="l00496"></a>00496 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a28214b8b05d60b45c24ee6fae7b2a0b5" title="Returns actual sample rate in use by the stream.">getStreamSampleRate</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00497"></a>00497 | |||
<a name="l00499"></a>00499 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77" title="Specify whether warning messages should be printed to stderr.">showWarnings</a>( <span class="keywordtype">bool</span> value = true ) throw(); | |||
<a name="l00500"></a>00500 | |||
<a name="l00501"></a>00501 protected: | |||
<a name="l00502"></a>00502 | |||
<a name="l00503"></a>00503 <span class="keywordtype">void</span> openRtApi( <a class="code" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>::<a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">Api</a> api ); | |||
<a name="l00504"></a>00504 RtApi *rtapi_; | |||
<a name="l00505"></a>00505 }; | |||
<a name="l00506"></a>00506 | |||
<a name="l00507"></a>00507 <span class="comment">// Operating system dependent thread functionality.</span> | |||
<a name="l00508"></a>00508 <span class="preprocessor">#if defined(__WINDOWS_DS__) || defined(__WINDOWS_ASIO__)</span> | |||
<a name="l00509"></a>00509 <span class="preprocessor"></span><span class="preprocessor"> #include <windows.h></span> | |||
<a name="l00510"></a>00510 <span class="preprocessor"> #include <process.h></span> | |||
<a name="l00511"></a>00511 | |||
<a name="l00512"></a>00512 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ThreadHandle; | |||
<a name="l00513"></a>00513 <span class="keyword">typedef</span> CRITICAL_SECTION StreamMutex; | |||
<a name="l00514"></a>00514 | |||
<a name="l00515"></a>00515 <span class="preprocessor">#elif defined(__LINUX_ALSA__) || defined(__LINUX_PULSE__) || defined(__UNIX_JACK__) || defined(__LINUX_OSS__) || defined(__MACOSX_CORE__)</span> | |||
<a name="l00516"></a>00516 <span class="preprocessor"></span> <span class="comment">// Using pthread library for various flavors of unix.</span> | |||
<a name="l00517"></a>00517 <span class="preprocessor"> #include <pthread.h></span> | |||
<a name="l00518"></a>00518 | |||
<a name="l00519"></a>00519 <span class="keyword">typedef</span> pthread_t ThreadHandle; | |||
<a name="l00520"></a>00520 <span class="keyword">typedef</span> pthread_mutex_t StreamMutex; | |||
<a name="l00521"></a>00521 | |||
<a name="l00522"></a>00522 <span class="preprocessor">#else // Setup for "dummy" behavior</span> | |||
<a name="l00523"></a>00523 <span class="preprocessor"></span> | |||
<a name="l00524"></a>00524 <span class="preprocessor"> #define __RTAUDIO_DUMMY__</span> | |||
<a name="l00525"></a>00525 <span class="preprocessor"></span> <span class="keyword">typedef</span> <span class="keywordtype">int</span> ThreadHandle; | |||
<a name="l00526"></a>00526 <span class="keyword">typedef</span> <span class="keywordtype">int</span> StreamMutex; | |||
<a name="l00527"></a>00527 | |||
<a name="l00528"></a>00528 <span class="preprocessor">#endif</span> | |||
<a name="l00529"></a>00529 <span class="preprocessor"></span> | |||
<a name="l00530"></a>00530 <span class="comment">// This global structure type is used to pass callback information</span> | |||
<a name="l00531"></a>00531 <span class="comment">// between the private RtAudio stream structure and global callback</span> | |||
<a name="l00532"></a>00532 <span class="comment">// handling functions.</span> | |||
<a name="l00533"></a>00533 <span class="keyword">struct </span>CallbackInfo { | |||
<a name="l00534"></a>00534 <span class="keywordtype">void</span> *object; <span class="comment">// Used as a "this" pointer.</span> | |||
<a name="l00535"></a>00535 ThreadHandle thread; | |||
<a name="l00536"></a>00536 <span class="keywordtype">void</span> *callback; | |||
<a name="l00537"></a>00537 <span class="keywordtype">void</span> *userData; | |||
<a name="l00538"></a>00538 <span class="keywordtype">void</span> *apiInfo; <span class="comment">// void pointer for API specific callback information</span> | |||
<a name="l00539"></a>00539 <span class="keywordtype">bool</span> isRunning; | |||
<a name="l00540"></a>00540 | |||
<a name="l00541"></a>00541 <span class="comment">// Default constructor.</span> | |||
<a name="l00542"></a>00542 CallbackInfo() | |||
<a name="l00543"></a>00543 :object(0), callback(0), userData(0), apiInfo(0), isRunning(false) {} | |||
<a name="l00544"></a>00544 }; | |||
<a name="l00545"></a>00545 | |||
<a name="l00546"></a>00546 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00547"></a>00547 <span class="comment">//</span> | |||
<a name="l00548"></a>00548 <span class="comment">// RtApi class declaration.</span> | |||
<a name="l00549"></a>00549 <span class="comment">//</span> | |||
<a name="l00550"></a>00550 <span class="comment">// Subclasses of RtApi contain all API- and OS-specific code necessary</span> | |||
<a name="l00551"></a>00551 <span class="comment">// to fully implement the RtAudio API.</span> | |||
<a name="l00552"></a>00552 <span class="comment">//</span> | |||
<a name="l00553"></a>00553 <span class="comment">// Note that RtApi is an abstract base class and cannot be</span> | |||
<a name="l00554"></a>00554 <span class="comment">// explicitly instantiated. The class RtAudio will create an</span> | |||
<a name="l00555"></a>00555 <span class="comment">// instance of an RtApi subclass (RtApiOss, RtApiAlsa,</span> | |||
<a name="l00556"></a>00556 <span class="comment">// RtApiJack, RtApiCore, RtApiDs, or RtApiAsio).</span> | |||
<a name="l00557"></a>00557 <span class="comment">//</span> | |||
<a name="l00558"></a>00558 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00559"></a>00559 | |||
<a name="l00560"></a>00560 <span class="preprocessor">#if defined( HAVE_GETTIMEOFDAY )</span> | |||
<a name="l00561"></a>00561 <span class="preprocessor"></span><span class="preprocessor"> #include <sys/time.h></span> | |||
<a name="l00562"></a>00562 <span class="preprocessor">#endif</span> | |||
<a name="l00563"></a>00563 <span class="preprocessor"></span> | |||
<a name="l00564"></a>00564 <span class="preprocessor">#include <sstream></span> | |||
<a name="l00565"></a>00565 | |||
<a name="l00566"></a>00566 <span class="keyword">class </span>RtApi | |||
<a name="l00567"></a>00567 { | |||
<a name="l00568"></a>00568 <span class="keyword">public</span>: | |||
<a name="l00569"></a>00569 | |||
<a name="l00570"></a>00570 RtApi(); | |||
<a name="l00571"></a>00571 <span class="keyword">virtual</span> ~RtApi(); | |||
<a name="l00572"></a>00572 <span class="keyword">virtual</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">getCurrentApi</a>( <span class="keywordtype">void</span> ) = 0; | |||
<a name="l00573"></a>00573 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount</a>( <span class="keywordtype">void</span> ) = 0; | |||
<a name="l00574"></a>00574 <span class="keyword">virtual</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ) = 0; | |||
<a name="l00575"></a>00575 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce" title="A function that returns the index of the default input device.">getDefaultInputDevice</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00576"></a>00576 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc" title="A function that returns the index of the default output device.">getDefaultOutputDevice</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00577"></a>00577 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#afacc99740fa4c5606fb35467cdea6da8" title="A public function for opening a stream with the specified parameters.">openStream</a>( <a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">RtAudio::StreamParameters</a> *outputParameters, | |||
<a name="l00578"></a>00578 <a class="code" href="structRtAudio_1_1StreamParameters.html" title="The structure for specifying input or ouput stream parameters.">RtAudio::StreamParameters</a> *inputParameters, | |||
<a name="l00579"></a>00579 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00580"></a>00580 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferFrames, <a class="code" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f" title="RtAudio callback function prototype.">RtAudioCallback</a> callback, | |||
<a name="l00581"></a>00581 <span class="keywordtype">void</span> *userData, <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00582"></a>00582 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">closeStream</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00583"></a>00583 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">startStream</a>( <span class="keywordtype">void</span> ) = 0; | |||
<a name="l00584"></a>00584 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">stopStream</a>( <span class="keywordtype">void</span> ) = 0; | |||
<a name="l00585"></a>00585 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">abortStream</a>( <span class="keywordtype">void</span> ) = 0; | |||
<a name="l00586"></a>00586 <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">getStreamLatency</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00587"></a>00587 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a28214b8b05d60b45c24ee6fae7b2a0b5" title="Returns actual sample rate in use by the stream.">getStreamSampleRate</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00588"></a>00588 <span class="keyword">virtual</span> <span class="keywordtype">double</span> <a class="code" href="classRtAudio.html#a344e59a62353c5791db4621b985cb2ca" title="Returns the number of elapsed seconds since the stream was started.">getStreamTime</a>( <span class="keywordtype">void</span> ); | |||
<a name="l00589"></a>00589 <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a3863e45ff81dbe97176de0ee7545917f" title="Returns true if a stream is open and false if not.">isStreamOpen</a>( <span class="keywordtype">void</span> )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> stream_.state != STREAM_CLOSED; }; | |||
<a name="l00590"></a>00590 <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a84cc8d9b7ab9bc5f37bcf48430ec5aea" title="Returns true if the stream is running and false if it is stopped or not open.">isStreamRunning</a>( <span class="keywordtype">void</span> )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> stream_.state == STREAM_RUNNING; }; | |||
<a name="l00591"></a>00591 <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77" title="Specify whether warning messages should be printed to stderr.">showWarnings</a>( <span class="keywordtype">bool</span> value ) { showWarnings_ = value; }; | |||
<a name="l00592"></a>00592 | |||
<a name="l00593"></a>00593 | |||
<a name="l00594"></a>00594 <span class="keyword">protected</span>: | |||
<a name="l00595"></a>00595 | |||
<a name="l00596"></a>00596 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> MAX_SAMPLE_RATES; | |||
<a name="l00597"></a>00597 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> SAMPLE_RATES[]; | |||
<a name="l00598"></a>00598 | |||
<a name="l00599"></a>00599 <span class="keyword">enum</span> { FAILURE, SUCCESS }; | |||
<a name="l00600"></a>00600 | |||
<a name="l00601"></a>00601 <span class="keyword">enum</span> StreamState { | |||
<a name="l00602"></a>00602 STREAM_STOPPED, | |||
<a name="l00603"></a>00603 STREAM_STOPPING, | |||
<a name="l00604"></a>00604 STREAM_RUNNING, | |||
<a name="l00605"></a>00605 STREAM_CLOSED = -50 | |||
<a name="l00606"></a>00606 }; | |||
<a name="l00607"></a>00607 | |||
<a name="l00608"></a>00608 <span class="keyword">enum</span> StreamMode { | |||
<a name="l00609"></a>00609 OUTPUT, | |||
<a name="l00610"></a>00610 INPUT, | |||
<a name="l00611"></a>00611 DUPLEX, | |||
<a name="l00612"></a>00612 UNINITIALIZED = -75 | |||
<a name="l00613"></a>00613 }; | |||
<a name="l00614"></a>00614 | |||
<a name="l00615"></a>00615 <span class="comment">// A protected structure used for buffer conversion.</span> | |||
<a name="l00616"></a>00616 <span class="keyword">struct </span>ConvertInfo { | |||
<a name="l00617"></a>00617 <span class="keywordtype">int</span> channels; | |||
<a name="l00618"></a>00618 <span class="keywordtype">int</span> inJump, outJump; | |||
<a name="l00619"></a>00619 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> inFormat, outFormat; | |||
<a name="l00620"></a>00620 std::vector<int> inOffset; | |||
<a name="l00621"></a>00621 std::vector<int> outOffset; | |||
<a name="l00622"></a>00622 }; | |||
<a name="l00623"></a>00623 | |||
<a name="l00624"></a>00624 <span class="comment">// A protected structure for audio streams.</span> | |||
<a name="l00625"></a>00625 <span class="keyword">struct </span>RtApiStream { | |||
<a name="l00626"></a>00626 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00627"></a>00627 <span class="keywordtype">void</span> *apiHandle; <span class="comment">// void pointer for API specific stream handle information</span> | |||
<a name="l00628"></a>00628 StreamMode mode; <span class="comment">// OUTPUT, INPUT, or DUPLEX.</span> | |||
<a name="l00629"></a>00629 StreamState state; <span class="comment">// STOPPED, RUNNING, or CLOSED</span> | |||
<a name="l00630"></a>00630 <span class="keywordtype">char</span> *userBuffer[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00631"></a>00631 <span class="keywordtype">char</span> *deviceBuffer; | |||
<a name="l00632"></a>00632 <span class="keywordtype">bool</span> doConvertBuffer[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00633"></a>00633 <span class="keywordtype">bool</span> userInterleaved; | |||
<a name="l00634"></a>00634 <span class="keywordtype">bool</span> deviceInterleaved[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00635"></a>00635 <span class="keywordtype">bool</span> doByteSwap[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00636"></a>00636 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate; | |||
<a name="l00637"></a>00637 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> bufferSize; | |||
<a name="l00638"></a>00638 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nBuffers; | |||
<a name="l00639"></a>00639 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nUserChannels[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00640"></a>00640 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> nDeviceChannels[2]; <span class="comment">// Playback and record channels, respectively.</span> | |||
<a name="l00641"></a>00641 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channelOffset[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00642"></a>00642 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> latency[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00643"></a>00643 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> userFormat; | |||
<a name="l00644"></a>00644 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> deviceFormat[2]; <span class="comment">// Playback and record, respectively.</span> | |||
<a name="l00645"></a>00645 StreamMutex mutex; | |||
<a name="l00646"></a>00646 CallbackInfo callbackInfo; | |||
<a name="l00647"></a>00647 ConvertInfo convertInfo[2]; | |||
<a name="l00648"></a>00648 <span class="keywordtype">double</span> streamTime; <span class="comment">// Number of elapsed seconds since the stream started.</span> | |||
<a name="l00649"></a>00649 | |||
<a name="l00650"></a>00650 <span class="preprocessor">#if defined(HAVE_GETTIMEOFDAY)</span> | |||
<a name="l00651"></a>00651 <span class="preprocessor"></span> <span class="keyword">struct </span>timeval lastTickTimestamp; | |||
<a name="l00652"></a>00652 <span class="preprocessor">#endif</span> | |||
<a name="l00653"></a>00653 <span class="preprocessor"></span> | |||
<a name="l00654"></a>00654 RtApiStream() | |||
<a name="l00655"></a>00655 :apiHandle(0), deviceBuffer(0) { device[0] = 11111; device[1] = 11111; } | |||
<a name="l00656"></a>00656 }; | |||
<a name="l00657"></a>00657 | |||
<a name="l00658"></a>00658 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">short</span> Int16; | |||
<a name="l00659"></a>00659 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">int</span> Int32; | |||
<a name="l00660"></a>00660 <span class="keyword">typedef</span> <span class="keywordtype">float</span> Float32; | |||
<a name="l00661"></a>00661 <span class="keyword">typedef</span> <span class="keywordtype">double</span> Float64; | |||
<a name="l00662"></a>00662 | |||
<a name="l00663"></a>00663 std::ostringstream errorStream_; | |||
<a name="l00664"></a>00664 std::string errorText_; | |||
<a name="l00665"></a>00665 <span class="keywordtype">bool</span> showWarnings_; | |||
<a name="l00666"></a>00666 RtApiStream stream_; | |||
<a name="l00667"></a>00667 | |||
<a name="l00675"></a>00675 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00676"></a>00676 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00677"></a>00677 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00678"></a>00678 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00679"></a>00679 | |||
<a name="l00681"></a>00681 <span class="keywordtype">void</span> tickStreamTime( <span class="keywordtype">void</span> ); | |||
<a name="l00682"></a>00682 | |||
<a name="l00684"></a>00684 <span class="keywordtype">void</span> clearStreamInfo(); | |||
<a name="l00685"></a>00685 | |||
<a name="l00690"></a>00690 <span class="keywordtype">void</span> verifyStream( <span class="keywordtype">void</span> ); | |||
<a name="l00691"></a>00691 | |||
<a name="l00693"></a>00693 <span class="keywordtype">void</span> error( <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">RtError::Type</a> type ); | |||
<a name="l00694"></a>00694 | |||
<a name="l00699"></a>00699 <span class="keywordtype">void</span> convertBuffer( <span class="keywordtype">char</span> *outBuffer, <span class="keywordtype">char</span> *inBuffer, ConvertInfo &info ); | |||
<a name="l00700"></a>00700 | |||
<a name="l00702"></a>00702 <span class="keywordtype">void</span> byteSwapBuffer( <span class="keywordtype">char</span> *buffer, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> samples, <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format ); | |||
<a name="l00703"></a>00703 | |||
<a name="l00705"></a>00705 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> formatBytes( <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format ); | |||
<a name="l00706"></a>00706 | |||
<a name="l00708"></a>00708 <span class="keywordtype">void</span> setConvertInfo( StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel ); | |||
<a name="l00709"></a>00709 }; | |||
<a name="l00710"></a>00710 | |||
<a name="l00711"></a>00711 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00712"></a>00712 <span class="comment">//</span> | |||
<a name="l00713"></a>00713 <span class="comment">// Inline RtAudio definitions.</span> | |||
<a name="l00714"></a>00714 <span class="comment">//</span> | |||
<a name="l00715"></a>00715 <span class="comment">// **************************************************************** //</span> | |||
<a name="l00716"></a>00716 | |||
<a name="l00717"></a><a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246">00717</a> <span class="keyword">inline</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> <a class="code" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246" title="Returns the audio API specifier for the current instance of RtAudio.">RtAudio :: getCurrentApi</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_->getCurrentApi(); } | |||
<a name="l00718"></a><a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a">00718</a> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">RtAudio :: getDeviceCount</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_->getDeviceCount(); } | |||
<a name="l00719"></a><a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8">00719</a> <span class="keyword">inline</span> <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> <a class="code" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8" title="Return an RtAudio::DeviceInfo structure for a specified device number.">RtAudio :: getDeviceInfo</a>( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ) { <span class="keywordflow">return</span> rtapi_->getDeviceInfo( device ); } | |||
<a name="l00720"></a><a class="code" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce">00720</a> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce" title="A function that returns the index of the default input device.">RtAudio :: getDefaultInputDevice</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_->getDefaultInputDevice(); } | |||
<a name="l00721"></a><a class="code" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc">00721</a> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc" title="A function that returns the index of the default output device.">RtAudio :: getDefaultOutputDevice</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_->getDefaultOutputDevice(); } | |||
<a name="l00722"></a><a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a">00722</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a" title="A function that closes a stream and frees any associated stream memory.">RtAudio :: closeStream</a>( <span class="keywordtype">void</span> ) throw() { <span class="keywordflow">return</span> rtapi_->closeStream(); } | |||
<a name="l00723"></a><a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80">00723</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80" title="A function that starts a stream.">RtAudio :: startStream</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->startStream(); } | |||
<a name="l00724"></a><a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd">00724</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd" title="Stop a stream, allowing any samples remaining in the output queue to be played.">RtAudio :: stopStream</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->stopStream(); } | |||
<a name="l00725"></a><a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f">00725</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f" title="Stop a stream, discarding any samples remaining in the input/output queue.">RtAudio :: abortStream</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->abortStream(); } | |||
<a name="l00726"></a><a class="code" href="classRtAudio.html#a3863e45ff81dbe97176de0ee7545917f">00726</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a3863e45ff81dbe97176de0ee7545917f" title="Returns true if a stream is open and false if not.">RtAudio :: isStreamOpen</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> rtapi_->isStreamOpen(); } | |||
<a name="l00727"></a><a class="code" href="classRtAudio.html#a84cc8d9b7ab9bc5f37bcf48430ec5aea">00727</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="classRtAudio.html#a84cc8d9b7ab9bc5f37bcf48430ec5aea" title="Returns true if the stream is running and false if it is stopped or not open.">RtAudio :: isStreamRunning</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> rtapi_->isStreamRunning(); } | |||
<a name="l00728"></a><a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3">00728</a> <span class="keyword">inline</span> <span class="keywordtype">long</span> <a class="code" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3" title="Returns the internal stream latency in sample frames.">RtAudio :: getStreamLatency</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->getStreamLatency(); } | |||
<a name="l00729"></a><a class="code" href="classRtAudio.html#a28214b8b05d60b45c24ee6fae7b2a0b5">00729</a> <span class="keyword">inline</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="classRtAudio.html#a28214b8b05d60b45c24ee6fae7b2a0b5" title="Returns actual sample rate in use by the stream.">RtAudio :: getStreamSampleRate</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->getStreamSampleRate(); }; | |||
<a name="l00730"></a><a class="code" href="classRtAudio.html#a344e59a62353c5791db4621b985cb2ca">00730</a> <span class="keyword">inline</span> <span class="keywordtype">double</span> <a class="code" href="classRtAudio.html#a344e59a62353c5791db4621b985cb2ca" title="Returns the number of elapsed seconds since the stream was started.">RtAudio :: getStreamTime</a>( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> rtapi_->getStreamTime(); } | |||
<a name="l00731"></a><a class="code" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77">00731</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77" title="Specify whether warning messages should be printed to stderr.">RtAudio :: showWarnings</a>( <span class="keywordtype">bool</span> value ) <span class="keywordflow">throw</span>() { rtapi_->showWarnings( value ); } | |||
<a name="l00732"></a>00732 | |||
<a name="l00733"></a>00733 <span class="comment">// RtApi Subclass prototypes.</span> | |||
<a name="l00734"></a>00734 | |||
<a name="l00735"></a>00735 <span class="preprocessor">#if defined(__MACOSX_CORE__)</span> | |||
<a name="l00736"></a>00736 <span class="preprocessor"></span> | |||
<a name="l00737"></a>00737 <span class="preprocessor">#include <CoreAudio/AudioHardware.h></span> | |||
<a name="l00738"></a>00738 | |||
<a name="l00739"></a>00739 <span class="keyword">class </span>RtApiCore: <span class="keyword">public</span> RtApi | |||
<a name="l00740"></a>00740 { | |||
<a name="l00741"></a>00741 <span class="keyword">public</span>: | |||
<a name="l00742"></a>00742 | |||
<a name="l00743"></a>00743 RtApiCore(); | |||
<a name="l00744"></a>00744 ~RtApiCore(); | |||
<a name="l00745"></a>00745 <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d">RtAudio::MACOSX_CORE</a>; }; | |||
<a name="l00746"></a>00746 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00747"></a>00747 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00748"></a>00748 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDefaultOutputDevice( <span class="keywordtype">void</span> ); | |||
<a name="l00749"></a>00749 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDefaultInputDevice( <span class="keywordtype">void</span> ); | |||
<a name="l00750"></a>00750 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00751"></a>00751 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00752"></a>00752 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00753"></a>00753 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00754"></a>00754 <span class="keywordtype">long</span> getStreamLatency( <span class="keywordtype">void</span> ); | |||
<a name="l00755"></a>00755 | |||
<a name="l00756"></a>00756 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00757"></a>00757 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00758"></a>00758 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00759"></a>00759 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00760"></a>00760 <span class="keywordtype">bool</span> callbackEvent( AudioDeviceID deviceId, | |||
<a name="l00761"></a>00761 <span class="keyword">const</span> AudioBufferList *inBufferList, | |||
<a name="l00762"></a>00762 <span class="keyword">const</span> AudioBufferList *outBufferList ); | |||
<a name="l00763"></a>00763 | |||
<a name="l00764"></a>00764 <span class="keyword">private</span>: | |||
<a name="l00765"></a>00765 | |||
<a name="l00766"></a>00766 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00767"></a>00767 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00768"></a>00768 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00769"></a>00769 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00770"></a>00770 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* getErrorCode( OSStatus code ); | |||
<a name="l00771"></a>00771 }; | |||
<a name="l00772"></a>00772 | |||
<a name="l00773"></a>00773 <span class="preprocessor">#endif</span> | |||
<a name="l00774"></a>00774 <span class="preprocessor"></span> | |||
<a name="l00775"></a>00775 <span class="preprocessor">#if defined(__UNIX_JACK__)</span> | |||
<a name="l00776"></a>00776 <span class="preprocessor"></span> | |||
<a name="l00777"></a>00777 <span class="keyword">class </span>RtApiJack: <span class="keyword">public</span> RtApi | |||
<a name="l00778"></a>00778 { | |||
<a name="l00779"></a>00779 <span class="keyword">public</span>: | |||
<a name="l00780"></a>00780 | |||
<a name="l00781"></a>00781 RtApiJack(); | |||
<a name="l00782"></a>00782 ~RtApiJack(); | |||
<a name="l00783"></a>00783 <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105">RtAudio::UNIX_JACK</a>; }; | |||
<a name="l00784"></a>00784 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00785"></a>00785 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00786"></a>00786 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00787"></a>00787 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00788"></a>00788 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00789"></a>00789 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00790"></a>00790 <span class="keywordtype">long</span> getStreamLatency( <span class="keywordtype">void</span> ); | |||
<a name="l00791"></a>00791 | |||
<a name="l00792"></a>00792 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00793"></a>00793 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00794"></a>00794 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00795"></a>00795 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00796"></a>00796 <span class="keywordtype">bool</span> callbackEvent( <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> nframes ); | |||
<a name="l00797"></a>00797 | |||
<a name="l00798"></a>00798 <span class="keyword">private</span>: | |||
<a name="l00799"></a>00799 | |||
<a name="l00800"></a>00800 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00801"></a>00801 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00802"></a>00802 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00803"></a>00803 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00804"></a>00804 }; | |||
<a name="l00805"></a>00805 | |||
<a name="l00806"></a>00806 <span class="preprocessor">#endif</span> | |||
<a name="l00807"></a>00807 <span class="preprocessor"></span> | |||
<a name="l00808"></a>00808 <span class="preprocessor">#if defined(__WINDOWS_ASIO__)</span> | |||
<a name="l00809"></a>00809 <span class="preprocessor"></span> | |||
<a name="l00810"></a>00810 <span class="keyword">class </span>RtApiAsio: <span class="keyword">public</span> RtApi | |||
<a name="l00811"></a>00811 { | |||
<a name="l00812"></a>00812 <span class="keyword">public</span>: | |||
<a name="l00813"></a>00813 | |||
<a name="l00814"></a>00814 RtApiAsio(); | |||
<a name="l00815"></a>00815 ~RtApiAsio(); | |||
<a name="l00816"></a>00816 <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469">RtAudio::WINDOWS_ASIO</a>; }; | |||
<a name="l00817"></a>00817 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00818"></a>00818 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00819"></a>00819 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00820"></a>00820 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00821"></a>00821 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00822"></a>00822 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00823"></a>00823 <span class="keywordtype">long</span> getStreamLatency( <span class="keywordtype">void</span> ); | |||
<a name="l00824"></a>00824 | |||
<a name="l00825"></a>00825 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00826"></a>00826 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00827"></a>00827 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00828"></a>00828 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00829"></a>00829 <span class="keywordtype">bool</span> callbackEvent( <span class="keywordtype">long</span> bufferIndex ); | |||
<a name="l00830"></a>00830 | |||
<a name="l00831"></a>00831 <span class="keyword">private</span>: | |||
<a name="l00832"></a>00832 | |||
<a name="l00833"></a>00833 std::vector<RtAudio::DeviceInfo> devices_; | |||
<a name="l00834"></a>00834 <span class="keywordtype">void</span> saveDeviceInfo( <span class="keywordtype">void</span> ); | |||
<a name="l00835"></a>00835 <span class="keywordtype">bool</span> coInitialized_; | |||
<a name="l00836"></a>00836 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00837"></a>00837 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00838"></a>00838 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00839"></a>00839 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00840"></a>00840 }; | |||
<a name="l00841"></a>00841 | |||
<a name="l00842"></a>00842 <span class="preprocessor">#endif</span> | |||
<a name="l00843"></a>00843 <span class="preprocessor"></span> | |||
<a name="l00844"></a>00844 <span class="preprocessor">#if defined(__WINDOWS_DS__)</span> | |||
<a name="l00845"></a>00845 <span class="preprocessor"></span> | |||
<a name="l00846"></a>00846 <span class="keyword">class </span>RtApiDs: <span class="keyword">public</span> RtApi | |||
<a name="l00847"></a>00847 { | |||
<a name="l00848"></a>00848 <span class="keyword">public</span>: | |||
<a name="l00849"></a>00849 | |||
<a name="l00850"></a>00850 RtApiDs(); | |||
<a name="l00851"></a>00851 ~RtApiDs(); | |||
<a name="l00852"></a>00852 <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931">RtAudio::WINDOWS_DS</a>; }; | |||
<a name="l00853"></a>00853 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00854"></a>00854 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDefaultOutputDevice( <span class="keywordtype">void</span> ); | |||
<a name="l00855"></a>00855 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDefaultInputDevice( <span class="keywordtype">void</span> ); | |||
<a name="l00856"></a>00856 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00857"></a>00857 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00858"></a>00858 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00859"></a>00859 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00860"></a>00860 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00861"></a>00861 <span class="keywordtype">long</span> getStreamLatency( <span class="keywordtype">void</span> ); | |||
<a name="l00862"></a>00862 | |||
<a name="l00863"></a>00863 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00864"></a>00864 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00865"></a>00865 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00866"></a>00866 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00867"></a>00867 <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">void</span> ); | |||
<a name="l00868"></a>00868 | |||
<a name="l00869"></a>00869 <span class="keyword">private</span>: | |||
<a name="l00870"></a>00870 | |||
<a name="l00871"></a>00871 <span class="keywordtype">bool</span> coInitialized_; | |||
<a name="l00872"></a>00872 <span class="keywordtype">bool</span> buffersRolling; | |||
<a name="l00873"></a>00873 <span class="keywordtype">long</span> duplexPrerollBytes; | |||
<a name="l00874"></a>00874 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00875"></a>00875 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00876"></a>00876 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00877"></a>00877 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00878"></a>00878 }; | |||
<a name="l00879"></a>00879 | |||
<a name="l00880"></a>00880 <span class="preprocessor">#endif</span> | |||
<a name="l00881"></a>00881 <span class="preprocessor"></span> | |||
<a name="l00882"></a>00882 <span class="preprocessor">#if defined(__LINUX_ALSA__)</span> | |||
<a name="l00883"></a>00883 <span class="preprocessor"></span> | |||
<a name="l00884"></a>00884 <span class="keyword">class </span>RtApiAlsa: <span class="keyword">public</span> RtApi | |||
<a name="l00885"></a>00885 { | |||
<a name="l00886"></a>00886 <span class="keyword">public</span>: | |||
<a name="l00887"></a>00887 | |||
<a name="l00888"></a>00888 RtApiAlsa(); | |||
<a name="l00889"></a>00889 ~RtApiAlsa(); | |||
<a name="l00890"></a>00890 <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi() { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8">RtAudio::LINUX_ALSA</a>; }; | |||
<a name="l00891"></a>00891 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00892"></a>00892 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00893"></a>00893 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00894"></a>00894 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00895"></a>00895 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00896"></a>00896 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00897"></a>00897 | |||
<a name="l00898"></a>00898 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00899"></a>00899 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00900"></a>00900 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00901"></a>00901 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00902"></a>00902 <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">void</span> ); | |||
<a name="l00903"></a>00903 | |||
<a name="l00904"></a>00904 <span class="keyword">private</span>: | |||
<a name="l00905"></a>00905 | |||
<a name="l00906"></a>00906 std::vector<RtAudio::DeviceInfo> devices_; | |||
<a name="l00907"></a>00907 <span class="keywordtype">void</span> saveDeviceInfo( <span class="keywordtype">void</span> ); | |||
<a name="l00908"></a>00908 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00909"></a>00909 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00910"></a>00910 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00911"></a>00911 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00912"></a>00912 }; | |||
<a name="l00913"></a>00913 | |||
<a name="l00914"></a>00914 <span class="preprocessor">#endif</span> | |||
<a name="l00915"></a>00915 <span class="preprocessor"></span> | |||
<a name="l00916"></a>00916 <span class="preprocessor">#if defined(__LINUX_PULSE__)</span> | |||
<a name="l00917"></a>00917 <span class="preprocessor"></span> | |||
<a name="l00918"></a>00918 <span class="keyword">class </span>RtApiPulse: <span class="keyword">public</span> RtApi | |||
<a name="l00919"></a>00919 { | |||
<a name="l00920"></a>00920 <span class="keyword">public</span>: | |||
<a name="l00921"></a>00921 ~RtApiPulse(); | |||
<a name="l00922"></a>00922 <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi() { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77">RtAudio::LINUX_PULSE</a>; }; | |||
<a name="l00923"></a>00923 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00924"></a>00924 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00925"></a>00925 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00926"></a>00926 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00927"></a>00927 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00928"></a>00928 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00929"></a>00929 | |||
<a name="l00930"></a>00930 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00931"></a>00931 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00932"></a>00932 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00933"></a>00933 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00934"></a>00934 <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">void</span> ); | |||
<a name="l00935"></a>00935 | |||
<a name="l00936"></a>00936 <span class="keyword">private</span>: | |||
<a name="l00937"></a>00937 | |||
<a name="l00938"></a>00938 std::vector<RtAudio::DeviceInfo> devices_; | |||
<a name="l00939"></a>00939 <span class="keywordtype">void</span> saveDeviceInfo( <span class="keywordtype">void</span> ); | |||
<a name="l00940"></a>00940 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00941"></a>00941 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00942"></a>00942 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00943"></a>00943 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00944"></a>00944 }; | |||
<a name="l00945"></a>00945 | |||
<a name="l00946"></a>00946 <span class="preprocessor">#endif</span> | |||
<a name="l00947"></a>00947 <span class="preprocessor"></span> | |||
<a name="l00948"></a>00948 | |||
<a name="l00949"></a>00949 <span class="preprocessor">#if defined(__LINUX_OSS__)</span> | |||
<a name="l00950"></a>00950 <span class="preprocessor"></span> | |||
<a name="l00951"></a>00951 <span class="keyword">class </span>RtApiOss: <span class="keyword">public</span> RtApi | |||
<a name="l00952"></a>00952 { | |||
<a name="l00953"></a>00953 <span class="keyword">public</span>: | |||
<a name="l00954"></a>00954 | |||
<a name="l00955"></a>00955 RtApiOss(); | |||
<a name="l00956"></a>00956 ~RtApiOss(); | |||
<a name="l00957"></a>00957 <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi() { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82">RtAudio::LINUX_OSS</a>; }; | |||
<a name="l00958"></a>00958 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ); | |||
<a name="l00959"></a>00959 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ); | |||
<a name="l00960"></a>00960 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ); | |||
<a name="l00961"></a>00961 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ); | |||
<a name="l00962"></a>00962 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ); | |||
<a name="l00963"></a>00963 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ); | |||
<a name="l00964"></a>00964 | |||
<a name="l00965"></a>00965 <span class="comment">// This function is intended for internal use only. It must be</span> | |||
<a name="l00966"></a>00966 <span class="comment">// public because it is called by the internal callback handler,</span> | |||
<a name="l00967"></a>00967 <span class="comment">// which is not a member of RtAudio. External use of this function</span> | |||
<a name="l00968"></a>00968 <span class="comment">// will most likely produce highly undesireable results!</span> | |||
<a name="l00969"></a>00969 <span class="keywordtype">void</span> callbackEvent( <span class="keywordtype">void</span> ); | |||
<a name="l00970"></a>00970 | |||
<a name="l00971"></a>00971 <span class="keyword">private</span>: | |||
<a name="l00972"></a>00972 | |||
<a name="l00973"></a>00973 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00974"></a>00974 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l00975"></a>00975 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l00976"></a>00976 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ); | |||
<a name="l00977"></a>00977 }; | |||
<a name="l00978"></a>00978 | |||
<a name="l00979"></a>00979 <span class="preprocessor">#endif</span> | |||
<a name="l00980"></a>00980 <span class="preprocessor"></span> | |||
<a name="l00981"></a>00981 <span class="preprocessor">#if defined(__RTAUDIO_DUMMY__)</span> | |||
<a name="l00982"></a>00982 <span class="preprocessor"></span> | |||
<a name="l00983"></a>00983 <span class="keyword">class </span>RtApiDummy: <span class="keyword">public</span> RtApi | |||
<a name="l00984"></a>00984 { | |||
<a name="l00985"></a>00985 <span class="keyword">public</span>: | |||
<a name="l00986"></a>00986 | |||
<a name="l00987"></a>00987 RtApiDummy() { errorText_ = <span class="stringliteral">"RtApiDummy: This class provides no functionality."</span>; error( <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca3a1603c24a56cbdaf5f8ae4ddcb86398">RtError::WARNING</a> ); }; | |||
<a name="l00988"></a>00988 <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849" title="Audio API specifier arguments.">RtAudio::Api</a> getCurrentApi( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> <a class="code" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1">RtAudio::RTAUDIO_DUMMY</a>; }; | |||
<a name="l00989"></a>00989 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> getDeviceCount( <span class="keywordtype">void</span> ) { <span class="keywordflow">return</span> 0; }; | |||
<a name="l00990"></a>00990 <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> getDeviceInfo( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device ) { <a class="code" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> info; <span class="keywordflow">return</span> info; }; | |||
<a name="l00991"></a>00991 <span class="keywordtype">void</span> closeStream( <span class="keywordtype">void</span> ) {}; | |||
<a name="l00992"></a>00992 <span class="keywordtype">void</span> startStream( <span class="keywordtype">void</span> ) {}; | |||
<a name="l00993"></a>00993 <span class="keywordtype">void</span> stopStream( <span class="keywordtype">void</span> ) {}; | |||
<a name="l00994"></a>00994 <span class="keywordtype">void</span> abortStream( <span class="keywordtype">void</span> ) {}; | |||
<a name="l00995"></a>00995 | |||
<a name="l00996"></a>00996 <span class="keyword">private</span>: | |||
<a name="l00997"></a>00997 | |||
<a name="l00998"></a>00998 <span class="keywordtype">bool</span> probeDeviceOpen( <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> device, StreamMode mode, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels, | |||
<a name="l00999"></a>00999 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> firstChannel, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sampleRate, | |||
<a name="l01000"></a>01000 <a class="code" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8" title="RtAudio data format type.">RtAudioFormat</a> format, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> *bufferSize, | |||
<a name="l01001"></a>01001 <a class="code" href="structRtAudio_1_1StreamOptions.html" title="The structure for specifying stream options.">RtAudio::StreamOptions</a> *options ) { <span class="keywordflow">return</span> <span class="keyword">false</span>; }; | |||
<a name="l01002"></a>01002 }; | |||
<a name="l01003"></a>01003 | |||
<a name="l01004"></a>01004 <span class="preprocessor">#endif</span> | |||
<a name="l01005"></a>01005 <span class="preprocessor"></span> | |||
<a name="l01006"></a>01006 <span class="preprocessor">#endif</span> | |||
<a name="l01007"></a>01007 <span class="preprocessor"></span> | |||
<a name="l01008"></a>01008 <span class="comment">// Indentation settings for Vim and Emacs</span> | |||
<a name="l01009"></a>01009 <span class="comment">//</span> | |||
<a name="l01010"></a>01010 <span class="comment">// Local Variables:</span> | |||
<a name="l01011"></a>01011 <span class="comment">// c-basic-offset: 2</span> | |||
<a name="l01012"></a>01012 <span class="comment">// indent-tabs-mode: nil</span> | |||
<a name="l01013"></a>01013 <span class="comment">// End:</span> | |||
<a name="l01014"></a>01014 <span class="comment">//</span> | |||
<a name="l01015"></a>01015 <span class="comment">// vim: et sts=2 sw=2</span> | |||
</pre></div></div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,65 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.5.8 --> | |||
<h1>RtError.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/************************************************************************/</span> | |||
<a name="l00010"></a>00010 <span class="comment">/************************************************************************/</span> | |||
<a name="l00011"></a>00011 | |||
<a name="l00012"></a>00012 <span class="preprocessor">#ifndef RTERROR_H</span> | |||
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define RTERROR_H</span> | |||
<a name="l00014"></a>00014 <span class="preprocessor"></span> | |||
<a name="l00015"></a>00015 <span class="preprocessor">#include <exception></span> | |||
<a name="l00016"></a>00016 <span class="preprocessor">#include <iostream></span> | |||
<a name="l00017"></a>00017 <span class="preprocessor">#include <string></span> | |||
<a name="l00018"></a>00018 | |||
<a name="l00019"></a><a class="code" href="classRtError.html">00019</a> <span class="keyword">class </span><a class="code" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> : <span class="keyword">public</span> std::exception | |||
<a name="l00020"></a>00020 { | |||
<a name="l00021"></a>00021 <span class="keyword">public</span>: | |||
<a name="l00023"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac">00023</a> <span class="keyword">enum</span> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> { | |||
<a name="l00024"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac3a1603c24a56cbdaf5f8ae4ddcb86398">00024</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac3a1603c24a56cbdaf5f8ae4ddcb86398">WARNING</a>, | |||
<a name="l00025"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac20e5a369394d19b704ace17002007eba">00025</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac20e5a369394d19b704ace17002007eba">DEBUG_WARNING</a>, | |||
<a name="l00026"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac444efd3ccf774b2ba9f9bde70ec71cd6">00026</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac444efd3ccf774b2ba9f9bde70ec71cd6">UNSPECIFIED</a>, | |||
<a name="l00027"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acf267eb2d710f33d649ba840eeab6ff82">00027</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acf267eb2d710f33d649ba840eeab6ff82">NO_DEVICES_FOUND</a>, | |||
<a name="l00028"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acd6064062066fffdba258237a7c2159b1">00028</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acd6064062066fffdba258237a7c2159b1">INVALID_DEVICE</a>, | |||
<a name="l00029"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acb4f813e5a36905c89d4081a59497432e">00029</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903acb4f813e5a36905c89d4081a59497432e">MEMORY_ERROR</a>, | |||
<a name="l00030"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903aca3eabf0f71120beaba94148a1b78fed6">00030</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903aca3eabf0f71120beaba94148a1b78fed6">INVALID_PARAMETER</a>, | |||
<a name="l00031"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac8e65f51a3fbdc1a4a1552b3260df36bc">00031</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac8e65f51a3fbdc1a4a1552b3260df36bc">INVALID_USE</a>, | |||
<a name="l00032"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac995e97ecf6beeedaba525022a63aec6b">00032</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac995e97ecf6beeedaba525022a63aec6b">DRIVER_ERROR</a>, | |||
<a name="l00033"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac8947d0a2e2a84ecf3646271844e06a6b">00033</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac8947d0a2e2a84ecf3646271844e06a6b">SYSTEM_ERROR</a>, | |||
<a name="l00034"></a><a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903aceb6282f991e2d93ab294a4272fc3f6c6">00034</a> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903aceb6282f991e2d93ab294a4272fc3f6c6">THREAD_ERROR</a> | |||
<a name="l00035"></a>00035 }; | |||
<a name="l00036"></a>00036 | |||
<a name="l00038"></a><a class="code" href="classRtError.html#a479a305ccbe56be0fd9137b9b405a37">00038</a> <a class="code" href="classRtError.html#a479a305ccbe56be0fd9137b9b405a37" title="The constructor.">RtError</a>( <span class="keyword">const</span> std::string& message, <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> type = <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac444efd3ccf774b2ba9f9bde70ec71cd6">RtError::UNSPECIFIED</a> ) throw() : message_(message), type_(type) {} | |||
<a name="l00039"></a>00039 | |||
<a name="l00041"></a><a class="code" href="classRtError.html#6793e03386e7e69ffafb65a296dfa48c">00041</a> <span class="keyword">virtual</span> <a class="code" href="classRtError.html#6793e03386e7e69ffafb65a296dfa48c" title="The destructor.">~RtError</a>( <span class="keywordtype">void</span> ) throw() {} | |||
<a name="l00042"></a>00042 | |||
<a name="l00044"></a><a class="code" href="classRtError.html#da41f7472122f45bc5b4677f066e0943">00044</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtError.html#da41f7472122f45bc5b4677f066e0943" title="Prints thrown error message to stderr.">printMessage</a>( <span class="keywordtype">void</span> ) throw() { std::cerr << <span class="charliteral">'\n'</span> << message_ << <span class="stringliteral">"\n\n"</span>; } | |||
<a name="l00045"></a>00045 | |||
<a name="l00047"></a><a class="code" href="classRtError.html#4ee7df9728d73f533afbaddcd9ca4d9c">00047</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a>& <a class="code" href="classRtError.html#4ee7df9728d73f533afbaddcd9ca4d9c" title="Returns the thrown error message type.">getType</a>(<span class="keywordtype">void</span>) throw() { <span class="keywordflow">return</span> type_; } | |||
<a name="l00048"></a>00048 | |||
<a name="l00050"></a><a class="code" href="classRtError.html#c7f467788e29d246333d7af050801164">00050</a> <span class="keyword">virtual</span> <span class="keyword">const</span> std::string& <a class="code" href="classRtError.html#c7f467788e29d246333d7af050801164" title="Returns the thrown error message string.">getMessage</a>(<span class="keywordtype">void</span>) throw() { <span class="keywordflow">return</span> message_; } | |||
<a name="l00051"></a>00051 | |||
<a name="l00053"></a><a class="code" href="classRtError.html#eb843b7a7785d66061c61ebfc29e7e9d">00053</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classRtError.html#eb843b7a7785d66061c61ebfc29e7e9d" title="Returns the thrown error message as a c-style string.">what</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> message_.c_str(); } | |||
<a name="l00054"></a>00054 | |||
<a name="l00055"></a>00055 <span class="keyword">protected</span>: | |||
<a name="l00056"></a>00056 std::string message_; | |||
<a name="l00057"></a>00057 <a class="code" href="classRtError.html#b04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> type_; | |||
<a name="l00058"></a>00058 }; | |||
<a name="l00059"></a>00059 | |||
<a name="l00060"></a>00060 <span class="preprocessor">#endif</span> | |||
</pre></div></div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2009 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,65 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<h1>RtError.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/************************************************************************/</span> | |||
<a name="l00010"></a>00010 <span class="comment">/************************************************************************/</span> | |||
<a name="l00011"></a>00011 | |||
<a name="l00012"></a>00012 <span class="preprocessor">#ifndef RTERROR_H</span> | |||
<a name="l00013"></a>00013 <span class="preprocessor"></span><span class="preprocessor">#define RTERROR_H</span> | |||
<a name="l00014"></a>00014 <span class="preprocessor"></span> | |||
<a name="l00015"></a>00015 <span class="preprocessor">#include <exception></span> | |||
<a name="l00016"></a>00016 <span class="preprocessor">#include <iostream></span> | |||
<a name="l00017"></a>00017 <span class="preprocessor">#include <string></span> | |||
<a name="l00018"></a>00018 | |||
<a name="l00019"></a><a class="code" href="classRtError.html">00019</a> <span class="keyword">class </span><a class="code" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> : <span class="keyword">public</span> std::exception | |||
<a name="l00020"></a>00020 { | |||
<a name="l00021"></a>00021 <span class="keyword">public</span>: | |||
<a name="l00023"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac">00023</a> <span class="keyword">enum</span> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> { | |||
<a name="l00024"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca3a1603c24a56cbdaf5f8ae4ddcb86398">00024</a> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca3a1603c24a56cbdaf5f8ae4ddcb86398">WARNING</a>, | |||
<a name="l00025"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca20e5a369394d19b704ace17002007eba">00025</a> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca20e5a369394d19b704ace17002007eba">DEBUG_WARNING</a>, | |||
<a name="l00026"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca444efd3ccf774b2ba9f9bde70ec71cd6">00026</a> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca444efd3ccf774b2ba9f9bde70ec71cd6">UNSPECIFIED</a>, | |||
<a name="l00027"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaf267eb2d710f33d649ba840eeab6ff82">00027</a> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaf267eb2d710f33d649ba840eeab6ff82">NO_DEVICES_FOUND</a>, | |||
<a name="l00028"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acad6064062066fffdba258237a7c2159b1">00028</a> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acad6064062066fffdba258237a7c2159b1">INVALID_DEVICE</a>, | |||
<a name="l00029"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acab4f813e5a36905c89d4081a59497432e">00029</a> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acab4f813e5a36905c89d4081a59497432e">MEMORY_ERROR</a>, | |||
<a name="l00030"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaa3eabf0f71120beaba94148a1b78fed6">00030</a> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaa3eabf0f71120beaba94148a1b78fed6">INVALID_PARAMETER</a>, | |||
<a name="l00031"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8e65f51a3fbdc1a4a1552b3260df36bc">00031</a> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8e65f51a3fbdc1a4a1552b3260df36bc">INVALID_USE</a>, | |||
<a name="l00032"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca995e97ecf6beeedaba525022a63aec6b">00032</a> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca995e97ecf6beeedaba525022a63aec6b">DRIVER_ERROR</a>, | |||
<a name="l00033"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8947d0a2e2a84ecf3646271844e06a6b">00033</a> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8947d0a2e2a84ecf3646271844e06a6b">SYSTEM_ERROR</a>, | |||
<a name="l00034"></a><a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaeb6282f991e2d93ab294a4272fc3f6c6">00034</a> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaeb6282f991e2d93ab294a4272fc3f6c6">THREAD_ERROR</a> | |||
<a name="l00035"></a>00035 }; | |||
<a name="l00036"></a>00036 | |||
<a name="l00038"></a><a class="code" href="classRtError.html#aa479a305ccbe56be0fd9137b9b405a37">00038</a> <a class="code" href="classRtError.html#aa479a305ccbe56be0fd9137b9b405a37" title="The constructor.">RtError</a>( <span class="keyword">const</span> std::string& message, <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> type = <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca444efd3ccf774b2ba9f9bde70ec71cd6">RtError::UNSPECIFIED</a> ) throw() : message_(message), type_(type) {} | |||
<a name="l00039"></a>00039 | |||
<a name="l00041"></a><a class="code" href="classRtError.html#a6793e03386e7e69ffafb65a296dfa48c">00041</a> <span class="keyword">virtual</span> <a class="code" href="classRtError.html#a6793e03386e7e69ffafb65a296dfa48c" title="The destructor.">~RtError</a>( <span class="keywordtype">void</span> ) throw() {} | |||
<a name="l00042"></a>00042 | |||
<a name="l00044"></a><a class="code" href="classRtError.html#a251dcdac396c998c91706dd2dd3b8bfc">00044</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classRtError.html#a251dcdac396c998c91706dd2dd3b8bfc" title="Prints thrown error message to stderr.">printMessage</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { std::cerr << <span class="charliteral">'\n'</span> << message_ << <span class="stringliteral">"\n\n"</span>; } | |||
<a name="l00045"></a>00045 | |||
<a name="l00047"></a><a class="code" href="classRtError.html#a3e316dc9b9b41fe2f64cabf34beb4fe7">00047</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a>& <a class="code" href="classRtError.html#a3e316dc9b9b41fe2f64cabf34beb4fe7" title="Returns the thrown error message type.">getType</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> type_; } | |||
<a name="l00048"></a>00048 | |||
<a name="l00050"></a><a class="code" href="classRtError.html#afd067ba6b46edd37f989cad02cd70b50">00050</a> <span class="keyword">virtual</span> <span class="keyword">const</span> std::string& <a class="code" href="classRtError.html#afd067ba6b46edd37f989cad02cd70b50" title="Returns the thrown error message string.">getMessage</a>(<span class="keywordtype">void</span>) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> message_; } | |||
<a name="l00051"></a>00051 | |||
<a name="l00053"></a><a class="code" href="classRtError.html#aeb843b7a7785d66061c61ebfc29e7e9d">00053</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="classRtError.html#aeb843b7a7785d66061c61ebfc29e7e9d" title="Returns the thrown error message as a c-style string.">what</a>( <span class="keywordtype">void</span> ) <span class="keyword">const</span> throw() { <span class="keywordflow">return</span> message_.c_str(); } | |||
<a name="l00054"></a>00054 | |||
<a name="l00055"></a>00055 <span class="keyword">protected</span>: | |||
<a name="l00056"></a>00056 std::string message_; | |||
<a name="l00057"></a>00057 <a class="code" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">Type</a> type_; | |||
<a name="l00058"></a>00058 }; | |||
<a name="l00059"></a>00059 | |||
<a name="l00060"></a>00060 <span class="preprocessor">#endif</span> | |||
</pre></div></div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,62 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<div class="contents"> | |||
<h1><a class="anchor" id="acknowledge">Acknowledgements </a></h1><p>Many thanks to the following people for providing bug fixes and improvements: </p> | |||
<ul> | |||
<li> | |||
Stefan Arisona </li> | |||
<li> | |||
Vincent Bénony </li> | |||
<li> | |||
Rasmus Ekman </li> | |||
<li> | |||
Anders Ervik </li> | |||
<li> | |||
Robin Davies (Windows DS and ASIO) </li> | |||
<li> | |||
Martin Koegler </li> | |||
<li> | |||
Dmitry Kostjuchenko </li> | |||
<li> | |||
Oliver Larkin </li> | |||
<li> | |||
Antoine Lefebvre </li> | |||
<li> | |||
Carlos Luna </li> | |||
<li> | |||
Dominic Mazzoni </li> | |||
<li> | |||
Tristan Matthews </li> | |||
<li> | |||
Peter Meerwald (PulseAudio) </li> | |||
<li> | |||
Benjamin Schroeder </li> | |||
<li> | |||
Ryan Williams (Windows non-MS compiler ASIO support) </li> | |||
<li> | |||
<p class="startli">Ed Wildgoose (Linux ALSA and Jack)</p> | |||
<p class="endli"></p> | |||
</li> | |||
</ul> | |||
<p>The <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> API incorporates many of the concepts developed in the <a href="http://www.portaudio.com/">PortAudio</a> project by Phil Burk and Ross Bencina. Early development also incorporated ideas from Bill Schottstaedt's <a href="http://www-ccrma.stanford.edu/software/snd/sndlib/">sndlib</a>. The CCRMA <a href="http://www-ccrma.stanford.edu/groups/soundwire/">SoundWire group</a> provided valuable feedback during the API proposal stages.</p> | |||
<p>The early 2.0 version of <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> was slowly developed over the course of many months while in residence at the <a href="http://www.iua.upf.es/">Institut Universitari de L'Audiovisual (IUA)</a> in Barcelona, Spain and the <a href="http://www.acoustics.hut.fi/">Laboratory of Acoustics and Audio Signal Processing</a> at the Helsinki University of Technology, Finland. Much subsequent development happened while working at the <a href="http://www-ccrma.stanford.edu/">Center for Computer Research in Music and Acoustics (CCRMA)</a> at <a href="http://www.stanford.edu/">Stanford University</a>. All recent versions of <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> have been completed while working as an assistant / associate professor of <a href="http://www.music.mcgill.ca/musictech/">Music Technology</a> at <a href="http://www.mcgill.ca/">McGill University</a>. This work was supported in part by the United States Air Force Office of Scientific Research (grant #F49620-99-1-0293). </p> | |||
</div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,28 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<div class="contents"> | |||
<h1>Class List</h1>Here are the classes, structs, unions and interfaces with brief descriptions:<table> | |||
<tr><td class="indexkey"><a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a></td><td class="indexvalue">The public device information structure for returning queried values </td></tr> | |||
<tr><td class="indexkey"><a class="el" href="classRtAudio.html">RtAudio</a></td><td class="indexvalue">Realtime audio i/o C++ classes </td></tr> | |||
<tr><td class="indexkey"><a class="el" href="classRtError.html">RtError</a></td><td class="indexvalue">Exception handling class for <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> & RtMidi </td></tr> | |||
<tr><td class="indexkey"><a class="el" href="structRtAudio_1_1StreamOptions.html">RtAudio::StreamOptions</a></td><td class="indexvalue">The structure for specifying stream options </td></tr> | |||
<tr><td class="indexkey"><a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a></td><td class="indexvalue">The structure for specifying input or ouput stream parameters </td></tr> | |||
</table> | |||
</div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,45 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<div class="contents"> | |||
<h1><a class="anchor" id="apinotes">API Notes </a></h1><p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> is designed to provide a common API across the various supported operating systems and audio libraries. Despite that, some issues should be mentioned with regard to each.</p> | |||
<h2><a class="anchor" id="linux"> | |||
Linux:</a></h2> | |||
<p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> for Linux was developed under Redhat distributions 7.0 - Fedora. Four different audio APIs are supported on Linux platforms: <a href="http://www.opensound.com/oss.html">OSS</a> (versions >= 4.0), <a href="http://www.alsa-project.org/">ALSA</a>, <a href="http://jackit.sourceforge.net/">Jack</a>, and <a href="http://www.freedesktop.org/wiki/Software/PulseAudio">PulseAudio</a>. Note that <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> now only supports the newer version 4.0 OSS API. The ALSA API is now part of the Linux kernel and offers significantly better functionality than the OSS API. <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> provides support for the 1.0 and higher versions of ALSA. Jack is a low-latency audio server written primarily for the GNU/Linux operating system. It can connect a number of different applications to an audio device, as well as allow them to share audio between themselves. Input/output latency on the order of 15 milliseconds can typically be achieved using any of the Linux APIs by fine-tuning the <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> buffer parameters (without kernel modifications). Latencies on the order of 5 milliseconds or less can be achieved using a low-latency kernel patch and increasing FIFO scheduling priority. The pthread library, which is used for callback functionality, is a standard component of all Linux distributions.</p> | |||
<p>The ALSA library includes OSS emulation support. That means that you can run programs compiled for the OSS API even when using the ALSA drivers and library. It should be noted however that OSS emulation under ALSA is not perfect. Specifically, channel number queries seem to consistently produce invalid results. While OSS emulation is successful for the majority of <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> tests, it is recommended that the native ALSA implementation of <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> be used on systems which have ALSA drivers installed.</p> | |||
<p>The ALSA implementation of <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> makes no use of the ALSA "plug" interface. All necessary data format conversions, channel compensation, de-interleaving, and byte-swapping is handled by internal <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> routines.</p> | |||
<h2><a class="anchor" id="macosx"> | |||
Macintosh OS-X (CoreAudio and Jack):</a></h2> | |||
<p>The Apple CoreAudio API is designed to use a separate callback procedure for each of its audio devices. A single <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> duplex stream using two different devices is supported, though it cannot be guaranteed to always behave correctly because we cannot synchronize these two callbacks. The <em>numberOfBuffers</em> parameter to the <a class="el" href="classRtAudio.html#afacc99740fa4c5606fb35467cdea6da8" title="A public function for opening a stream with the specified parameters.">RtAudio::openStream()</a> function has no affect in this implementation.</p> | |||
<p>It is not possible to have multiple instances of <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> accessing the same CoreAudio device.</p> | |||
<p>The <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> Jack support can be compiled on Macintosh OS-X systems, as well as in Linux.</p> | |||
<h2><a class="anchor" id="windowsds"> | |||
Windows (DirectSound):</a></h2> | |||
<p>The <code>configure</code> script provides support for the MinGW compiler. DirectSound support is specified with the "--with-ds" flag.</p> | |||
<p>In order to compile <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> under Windows for the DirectSound API, you must have the header and source files for DirectSound version 5.0 or higher. As far as I know, there is no DirectSoundCapture support for Windows NT. Audio output latency with DirectSound can be reasonably good, especially since <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> version 3.0.2. Input audio latency still tends to be bad but better since version 3.0.2. <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> was originally developed with Visual C++ version 6.0 but has been tested with .NET.</p> | |||
<p>The DirectSound version of <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> can be compiled with or without the UNICODE preprocessor definition.</p> | |||
<h2><a class="anchor" id="windowsasio"> | |||
Windows (ASIO):</a></h2> | |||
<p>ASIO support using MinGW and the <code>configure</code> script is specified with the "--with-asio" flag.</p> | |||
<p>The Steinberg ASIO audio API allows only a single device driver to be loaded and accessed at a time. ASIO device drivers must be supplied by audio hardware manufacturers, though ASIO emulation is possible on top of systems with DirectSound drivers. The <em>numberOfBuffers</em> parameter to the <a class="el" href="classRtAudio.html#afacc99740fa4c5606fb35467cdea6da8" title="A public function for opening a stream with the specified parameters.">RtAudio::openStream()</a> function has no affect in this implementation.</p> | |||
<p>A number of ASIO source and header files are required for use with <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>. Specifically, an <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> project must include the following files: <code>asio.h,cpp; asiodrivers.h,cpp; asiolist.h,cpp; asiodrvr.h; asiosys.h; ginclude.h; iasiodrv.h; iasiothiscallresolver.h,cpp</code>. The Visual C++ projects found in <code>/tests/Windows/</code> compile both ASIO and DirectSound support.</p> | |||
<p>The Steinberg provided <code>asiolist</code> class does not compile when the preprocessor definition UNICODE is defined. Note that this could be an issue when using <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> with Qt, though Qt programs appear to compile without the UNICODE definition (try <code>DEFINES -= UNICODE</code> in your .pro file). <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> with ASIO support has been tested using the MinGW compiler under Windows XP, as well as in the Visual Studio environment. </p> | |||
</div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,57 +0,0 @@ | |||
<html> | |||
<head> | |||
<title>RtAudio Bugs</title> | |||
</head> | |||
<body bgcolor="#FFFFFF"> | |||
<center><h1>RtAudio Bug Tracker</h1></center> | |||
"Bugs" are considered to be problems that cause program crashes or unpredictable results. Incomplete or unavailable features are tracked as <a href="updates.html">updates</a>. | |||
<h2>Reported (Unconfirmed) Bugs:</h2> | |||
<table border=1 cellpadding=10 cellspacing=0> | |||
<tr bgcolor="#C7CAFF"><td><b>#</b></td><td><b>Version</b></td><td><b>API</b></td><td><b>Description</b></td><td><b>Status</b></td></b></tr> | |||
</table> | |||
<h2>Confirmed Bugs (Unfixed):</h2> | |||
<table border=1 cellpadding=10 cellspacing=0> | |||
<tr bgcolor="#C7CAFF"><td><b>#</b></td><td><b>Version</b></td><td><b>API</b></td><td><b>Description</b></td></tr> | |||
</table> | |||
<h2>Fixed Bugs:</h2> | |||
<table border=1 cellpadding=10 cellspacing=0> | |||
<tr bgcolor="#C7CAFF"><td><b>#</b></td><td><b>Version</b></td><td><b>API</b></td><td><b>Description</b></td></tr> | |||
<tr><td>24</td><td>4.0.8</td><td>All</td><td>Various updates to most APIs to improve stopping efficiency and avoid lockup issues</td></tr> | |||
<tr><td>23</td><td>4.0.8</td><td>All</td><td>New python binding in "contrib" directory (beta, thanks to Antoine Lefebvre)</td></tr> | |||
<tr><td>22</td><td>4.0.8</td><td>OS-X</td><td>Fixed problem handling device names in some languages (CFString conversion, Vincent Bénony)</td></tr> | |||
<tr><td>21</td><td>4.0.8</td><td>ASIO</td><td>Fixed problem using gcc4.4 (MinGW) to set and query supported sample rates</td></tr> | |||
<tr><td>20</td><td>4.0.6</td><td>OS-X</td><td>Fixed OS-X for OS < 10.5 ... need preprocessor definition around new variable type (thanks to Tristan Matthews)</td></tr> | |||
<tr><td>19</td><td>4.0.6</td><td>ALSA</td><td>Fixed ALSA code to set period size to power of two (thanks to Joakim Karrstrom)</td></tr> | |||
<tr><td>18</td><td>4.0.5</td><td>ASIO</td><td>Fixed ASIO sample rate selection bug (thanks to Sasha Zheligovsky)</td></tr> | |||
<tr><td>17</td><td>4.0.5</td><td>ALSA</td><td>64-bit fixes in ALSA API (thanks to Stefan Muller Arisona)</td></tr> | |||
<tr><td>16</td><td>4.0.5</td><td>All</td><td>Fixed bug in rtaudio-config script</td></tr> | |||
<tr><td>15</td><td>4.0.5</td><td>OS-X</td><td>Fixed a few gcc 4.4 errors in OS-X</td></tr> | |||
<tr><td>14</td><td>4.0.5</td><td>All</td><td>Bug fix in byteSwapBuffer() (thanks to Stefan Muller Arisona and Theo Veenker)</td></tr> | |||
<tr><td>13</td><td>4.0.5</td><td>All</td><td>Fix to int<->float conversion in convertBuffer() (thanks to Theo Veenker)</td></tr> | |||
<tr><td>12</td><td>4.0.5</td><td>All</td><td>Fix to the way the stream state is changed to avoid infinite loop problem</td></tr> | |||
<tr><td>11</td><td>4.0.4</td><td>All</td><td>Fixes in configure script</td></tr> | |||
<tr><td>10</td><td>4.0.4</td><td>All</td><td>Fixed clearing of error message stream in error()</td></tr> | |||
<tr><td>9</td><td>4.0.4</td><td>All</td><td>Fixed RtAudio::DeviceInfo description in "probing" documentation</td></tr> | |||
<tr><td>8</td><td>4.0.4</td><td>ALSA/OSS</td><td>Memory leak fixes in ALSA and OSS</td></tr> | |||
<tr><td>7</td><td>4.0.4</td><td>Jack</td><td>Jack in/out port flag fix</td></tr> | |||
<tr><td>6</td><td>4.0.2</td><td>All</td><td>Fix to RtError::WARNING typo in RtAudio.h (RtApiDummy)</td></tr> | |||
<tr><td>5</td><td>4.0.1</td><td>All</td><td>Fix to RtError::WARNING typo in RtAudio.cpp</td></tr> | |||
<tr><td>4</td><td>4.0</td><td>CoreAudio</td><td>RtAudio checks a device's <i>internal</i> data format and sets it to the highest allowable bit rate. For some stupid devices, like the Griffin iMic, the default format is 8-bit mono when the requested format and number of channels does not exist. So, we need to query the device's capabilities using the kAudioStreamPropertyPhysicalFormats selector - i.e. ask a device for all of the channels/format/rate combination that it supports - and then enumerate through them to pick the best one.</td></tr> | |||
<tr><td>3</td><td>4.0</td><td>ALSA</td><td>Changed sample rate setting to use <tt>snd_pcm_hw_params_set_rate_near()</tt> function</td></tr> | |||
<tr><td>2</td><td>4.0</td><td>All unices</td><td>Default pthread scheduling priority changed to SCHED_RR when defined</td></tr> | |||
<tr><td>1</td><td>4.0</td><td>Windows DS</td><td>Memory allocation bug in device querying</td></tr> | |||
</table> | |||
</body> | |||
</html> |
@@ -1,51 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<div class="contents"> | |||
<h1>RtAudio Member List</h1>This is the complete list of members for <a class="el" href="classRtAudio.html">RtAudio</a>, including all inherited members.<table> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f">abortStream</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">Api</a> enum name</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a">closeStream</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ae266ffad2ef428d0b2c6c262d391ce26">getCompiledApi</a>(std::vector< RtAudio::Api > &apis)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [static]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246">getCurrentApi</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce">getDefaultInputDevice</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc">getDefaultOutputDevice</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a">getDeviceCount</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8">getDeviceInfo</a>(unsigned int device)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3">getStreamLatency</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a28214b8b05d60b45c24ee6fae7b2a0b5">getStreamSampleRate</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a344e59a62353c5791db4621b985cb2ca">getStreamTime</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a3863e45ff81dbe97176de0ee7545917f">isStreamOpen</a>(void) const </td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#a84cc8d9b7ab9bc5f37bcf48430ec5aea">isStreamRunning</a>(void) const </td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8">LINUX_ALSA</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82">LINUX_OSS</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77">LINUX_PULSE</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d">MACOSX_CORE</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#afacc99740fa4c5606fb35467cdea6da8">openStream</a>(RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData=NULL, RtAudio::StreamOptions *options=NULL)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#afd0bfa26deae9804e18faff59d0273d9">RtAudio</a>(RtAudio::Api api=UNSPECIFIED)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1">RTAUDIO_DUMMY</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77">showWarnings</a>(bool value=true)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80">startStream</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd">stopStream</a>(void)</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105">UNIX_JACK</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae">UNSPECIFIED</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469">WINDOWS_ASIO</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931">WINDOWS_DS</a> enum value</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtAudio.html#aa8a9716fd64680657ef69c9465442a2f">~RtAudio</a>()</td><td><a class="el" href="classRtAudio.html">RtAudio</a></td><td></td></tr> | |||
</table></div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,534 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<div class="contents"> | |||
<h1>RtAudio Class Reference</h1><!-- doxytag: class="RtAudio" --> | |||
<p>Realtime audio i/o C++ classes. | |||
<a href="#_details">More...</a></p> | |||
<p><code>#include <<a class="el" href="RtAudio_8h_source.html">RtAudio.h</a>></code></p> | |||
<p><a href="classRtAudio-members.html">List of all members.</a></p> | |||
<table border="0" cellpadding="0" cellspacing="0"> | |||
<tr><td colspan="2"><h2>Classes</h2></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1DeviceInfo.html">DeviceInfo</a></td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The public device information structure for returning queried values. <a href="structRtAudio_1_1DeviceInfo.html#_details">More...</a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html">StreamOptions</a></td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The structure for specifying stream options. <a href="structRtAudio_1_1StreamOptions.html#_details">More...</a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamParameters.html">StreamParameters</a></td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The structure for specifying input or ouput stream parameters. <a href="structRtAudio_1_1StreamParameters.html#_details">More...</a><br/></td></tr> | |||
<tr><td colspan="2"><h2>Public Types</h2></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">Api</a> { <br/> | |||
<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae">UNSPECIFIED</a>, | |||
<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8">LINUX_ALSA</a>, | |||
<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77">LINUX_PULSE</a>, | |||
<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82">LINUX_OSS</a>, | |||
<br/> | |||
<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105">UNIX_JACK</a>, | |||
<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d">MACOSX_CORE</a>, | |||
<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469">WINDOWS_ASIO</a>, | |||
<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931">WINDOWS_DS</a>, | |||
<br/> | |||
<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1">RTAUDIO_DUMMY</a> | |||
<br/> | |||
}</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight"><p>Audio API specifier arguments. </p> | |||
<a href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">More...</a><br/></td></tr> | |||
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#afd0bfa26deae9804e18faff59d0273d9">RtAudio</a> (<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a> api=UNSPECIFIED) throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The class constructor. <a href="#afd0bfa26deae9804e18faff59d0273d9"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#aa8a9716fd64680657ef69c9465442a2f">~RtAudio</a> () throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The destructor. <a href="#aa8a9716fd64680657ef69c9465442a2f"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a83687634795792b2c47e4ae1cf8a5246"></a><!-- doxytag: member="RtAudio::getCurrentApi" ref="a83687634795792b2c47e4ae1cf8a5246" args="(void)" --> | |||
<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246">getCurrentApi</a> (void) throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the audio API specifier for the current instance of <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>. <br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a">getDeviceCount</a> (void) throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">A public function that queries for the number of audio devices available. <a href="#a747ce2d73803641bbb66d6e78092aa1a"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8">getDeviceInfo</a> (unsigned int device)</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return an <a class="el" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> structure for a specified device number. <a href="#a02d7ff44ad1d7eae22283a052f3dfda8"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc">getDefaultOutputDevice</a> (void) throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">A function that returns the index of the default output device. <a href="#a3a3f3dbe13ea696b521e49cdaaa357bc"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce">getDefaultInputDevice</a> (void) throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">A function that returns the index of the default input device. <a href="#aad8b94edd3cd379ee300b125750ac6ce"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#afacc99740fa4c5606fb35467cdea6da8">openStream</a> (<a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> *outputParameters, <a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> *inputParameters, <a class="el" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8">RtAudioFormat</a> format, unsigned int sampleRate, unsigned int *bufferFrames, <a class="el" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f">RtAudioCallback</a> callback, void *userData=NULL, <a class="el" href="structRtAudio_1_1StreamOptions.html">RtAudio::StreamOptions</a> *options=NULL)</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">A public function for opening a stream with the specified parameters. <a href="#afacc99740fa4c5606fb35467cdea6da8"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a">closeStream</a> (void) throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">A function that closes a stream and frees any associated stream memory. <a href="#a90d599002ad32cf250a4cb866f2cc93a"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80">startStream</a> (void)</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">A function that starts a stream. <a href="#aec017a89629ccef66a90b60be22a2f80"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd">stopStream</a> (void)</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Stop a stream, allowing any samples remaining in the output queue to be played. <a href="#af4c241ff86936ecc8108f0d9dfe3efdd"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f">abortStream</a> (void)</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Stop a stream, discarding any samples remaining in the input/output queue. <a href="#ad0586b47cd6bb9591a80b4052815991f"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3863e45ff81dbe97176de0ee7545917f"></a><!-- doxytag: member="RtAudio::isStreamOpen" ref="a3863e45ff81dbe97176de0ee7545917f" args="(void) const " --> | |||
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a3863e45ff81dbe97176de0ee7545917f">isStreamOpen</a> (void) const throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if a stream is open and false if not. <br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a84cc8d9b7ab9bc5f37bcf48430ec5aea"></a><!-- doxytag: member="RtAudio::isStreamRunning" ref="a84cc8d9b7ab9bc5f37bcf48430ec5aea" args="(void) const " --> | |||
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a84cc8d9b7ab9bc5f37bcf48430ec5aea">isStreamRunning</a> (void) const throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns true if the stream is running and false if it is stopped or not open. <br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a344e59a62353c5791db4621b985cb2ca">getStreamTime</a> (void)</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the number of elapsed seconds since the stream was started. <a href="#a344e59a62353c5791db4621b985cb2ca"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">long </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3">getStreamLatency</a> (void)</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the internal stream latency in sample frames. <a href="#a843c989d9f501c71bc2f2c5ca18df9f3"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">unsigned int </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a28214b8b05d60b45c24ee6fae7b2a0b5">getStreamSampleRate</a> (void)</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns actual sample rate in use by the stream. <a href="#a28214b8b05d60b45c24ee6fae7b2a0b5"></a><br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af0752ee51cce3dd90a3bd009f9fdbe77"></a><!-- doxytag: member="RtAudio::showWarnings" ref="af0752ee51cce3dd90a3bd009f9fdbe77" args="(bool value=true)" --> | |||
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77">showWarnings</a> (bool value=true) throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Specify whether warning messages should be printed to stderr. <br/></td></tr> | |||
<tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#ae266ffad2ef428d0b2c6c262d391ce26">getCompiledApi</a> (std::vector< <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a> > &apis) throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">A static function to determine the available compiled audio APIs. <a href="#ae266ffad2ef428d0b2c6c262d391ce26"></a><br/></td></tr> | |||
</table> | |||
<hr/><a name="_details"></a><h2>Detailed Description</h2> | |||
<p>Realtime audio i/o C++ classes. </p> | |||
<p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, Jack, and OSS), Macintosh OS X (CoreAudio and Jack), and Windows (DirectSound and ASIO) operating systems.</p> | |||
<p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> WWW site: <a href="http://www.music.mcgill.ca/~gary/rtaudio/">http://www.music.mcgill.ca/~gary/rtaudio/</a></p> | |||
<p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>: realtime audio i/o C++ classes Copyright (c) 2001-2012 Gary P. Scavone</p> | |||
<p>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:</p> | |||
<p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p> | |||
<p>Any person wishing to distribute modifications to the Software is asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license.</p> | |||
<p>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. </p> | |||
<hr/><h2>Member Enumeration Documentation</h2> | |||
<a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849"></a><!-- doxytag: member="RtAudio::Api" ref="ac9b6f625da88249d08a8409a9db0d849" args="" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">enum <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>Audio API specifier arguments. </p> | |||
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"> | |||
<tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae"></a><!-- doxytag: member="UNSPECIFIED" ref="ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae" args="" -->UNSPECIFIED</em> </td><td> | |||
<p>Search for a working compiled API. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8"></a><!-- doxytag: member="LINUX_ALSA" ref="ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8" args="" -->LINUX_ALSA</em> </td><td> | |||
<p>The Advanced Linux Sound Architecture API. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77"></a><!-- doxytag: member="LINUX_PULSE" ref="ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77" args="" -->LINUX_PULSE</em> </td><td> | |||
<p>The Linux PulseAudio API. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82"></a><!-- doxytag: member="LINUX_OSS" ref="ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82" args="" -->LINUX_OSS</em> </td><td> | |||
<p>The Linux Open Sound System API. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105"></a><!-- doxytag: member="UNIX_JACK" ref="ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105" args="" -->UNIX_JACK</em> </td><td> | |||
<p>The Jack Low-Latency Audio Server API. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d"></a><!-- doxytag: member="MACOSX_CORE" ref="ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d" args="" -->MACOSX_CORE</em> </td><td> | |||
<p>Macintosh OS-X Core Audio API. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469"></a><!-- doxytag: member="WINDOWS_ASIO" ref="ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469" args="" -->WINDOWS_ASIO</em> </td><td> | |||
<p>The Steinberg Audio Stream I/O API. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931"></a><!-- doxytag: member="WINDOWS_DS" ref="ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931" args="" -->WINDOWS_DS</em> </td><td> | |||
<p>The Microsoft Direct Sound API. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1"></a><!-- doxytag: member="RTAUDIO_DUMMY" ref="ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1" args="" -->RTAUDIO_DUMMY</em> </td><td> | |||
<p>A compilable but non-functional API. </p> | |||
</td></tr> | |||
</table> | |||
</dd> | |||
</dl> | |||
</div> | |||
</div> | |||
<hr/><h2>Constructor & Destructor Documentation</h2> | |||
<a class="anchor" id="afd0bfa26deae9804e18faff59d0273d9"></a><!-- doxytag: member="RtAudio::RtAudio" ref="afd0bfa26deae9804e18faff59d0273d9" args="(RtAudio::Api api=UNSPECIFIED)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">RtAudio::RtAudio </td> | |||
<td>(</td> | |||
<td class="paramtype"><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a> </td> | |||
<td class="paramname"> <em>api</em> = <code>UNSPECIFIED</code></td> | |||
<td> ) </td> | |||
<td> throw ()</td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>The class constructor. </p> | |||
<p>The constructor performs minor initialization tasks. No exceptions can be thrown.</p> | |||
<p>If no API argument is specified and multiple API support has been compiled, the default order of use is JACK, ALSA, OSS (Linux systems) and ASIO, DS (Windows systems). </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="aa8a9716fd64680657ef69c9465442a2f"></a><!-- doxytag: member="RtAudio::~RtAudio" ref="aa8a9716fd64680657ef69c9465442a2f" args="()" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">RtAudio::~RtAudio </td> | |||
<td>(</td> | |||
<td class="paramname"></td> | |||
<td> ) </td> | |||
<td> throw ()</td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>The destructor. </p> | |||
<p>If a stream is running or open, it will be stopped and closed automatically. </p> | |||
</div> | |||
</div> | |||
<hr/><h2>Member Function Documentation</h2> | |||
<a class="anchor" id="ae266ffad2ef428d0b2c6c262d391ce26"></a><!-- doxytag: member="RtAudio::getCompiledApi" ref="ae266ffad2ef428d0b2c6c262d391ce26" args="(std::vector< RtAudio::Api > &apis)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">static void RtAudio::getCompiledApi </td> | |||
<td>(</td> | |||
<td class="paramtype">std::vector< <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a> > & </td> | |||
<td class="paramname"> <em>apis</em></td> | |||
<td> ) </td> | |||
<td> throw ()<code> [static]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>A static function to determine the available compiled audio APIs. </p> | |||
<p>The values returned in the std::vector can be compared against the enumerated list values. Note that there can be more than one API compiled for certain operating systems. </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="a747ce2d73803641bbb66d6e78092aa1a"></a><!-- doxytag: member="RtAudio::getDeviceCount" ref="a747ce2d73803641bbb66d6e78092aa1a" args="(void)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">unsigned int RtAudio::getDeviceCount </td> | |||
<td>(</td> | |||
<td class="paramtype">void </td> | |||
<td class="paramname"></td> | |||
<td> ) </td> | |||
<td> throw ()<code> [inline]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>A public function that queries for the number of audio devices available. </p> | |||
<p>This function performs a system query of available devices each time it is called, thus supporting devices connected <em>after</em> instantiation. If a system error occurs during processing, a warning will be issued. </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="a02d7ff44ad1d7eae22283a052f3dfda8"></a><!-- doxytag: member="RtAudio::getDeviceInfo" ref="a02d7ff44ad1d7eae22283a052f3dfda8" args="(unsigned int device)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname"><a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a> RtAudio::getDeviceInfo </td> | |||
<td>(</td> | |||
<td class="paramtype">unsigned int </td> | |||
<td class="paramname"> <em>device</em></td> | |||
<td> ) </td> | |||
<td><code> [inline]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>Return an <a class="el" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> structure for a specified device number. </p> | |||
<p>Any device integer between 0 and <a class="el" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount()</a> - 1 is valid. If an invalid argument is provided, an <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = INVALID_USE) will be thrown. If a device is busy or otherwise unavailable, the structure member "probed" will have a value of "false" and all other members are undefined. If the specified device is the current default input or output device, the corresponding "isDefault" member will have a value of "true". </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="a3a3f3dbe13ea696b521e49cdaaa357bc"></a><!-- doxytag: member="RtAudio::getDefaultOutputDevice" ref="a3a3f3dbe13ea696b521e49cdaaa357bc" args="(void)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">unsigned int RtAudio::getDefaultOutputDevice </td> | |||
<td>(</td> | |||
<td class="paramtype">void </td> | |||
<td class="paramname"></td> | |||
<td> ) </td> | |||
<td> throw ()<code> [inline]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>A function that returns the index of the default output device. </p> | |||
<p>If the underlying audio API does not provide a "default | |||
device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream. </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="aad8b94edd3cd379ee300b125750ac6ce"></a><!-- doxytag: member="RtAudio::getDefaultInputDevice" ref="aad8b94edd3cd379ee300b125750ac6ce" args="(void)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">unsigned int RtAudio::getDefaultInputDevice </td> | |||
<td>(</td> | |||
<td class="paramtype">void </td> | |||
<td class="paramname"></td> | |||
<td> ) </td> | |||
<td> throw ()<code> [inline]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>A function that returns the index of the default input device. </p> | |||
<p>If the underlying audio API does not provide a "default | |||
device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream. </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="afacc99740fa4c5606fb35467cdea6da8"></a><!-- doxytag: member="RtAudio::openStream" ref="afacc99740fa4c5606fb35467cdea6da8" args="(RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData=NULL, RtAudio::StreamOptions *options=NULL)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">void RtAudio::openStream </td> | |||
<td>(</td> | |||
<td class="paramtype"><a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> * </td> | |||
<td class="paramname"> <em>outputParameters</em>, </td> | |||
</tr> | |||
<tr> | |||
<td class="paramkey"></td> | |||
<td></td> | |||
<td class="paramtype"><a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> * </td> | |||
<td class="paramname"> <em>inputParameters</em>, </td> | |||
</tr> | |||
<tr> | |||
<td class="paramkey"></td> | |||
<td></td> | |||
<td class="paramtype"><a class="el" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8">RtAudioFormat</a> </td> | |||
<td class="paramname"> <em>format</em>, </td> | |||
</tr> | |||
<tr> | |||
<td class="paramkey"></td> | |||
<td></td> | |||
<td class="paramtype">unsigned int </td> | |||
<td class="paramname"> <em>sampleRate</em>, </td> | |||
</tr> | |||
<tr> | |||
<td class="paramkey"></td> | |||
<td></td> | |||
<td class="paramtype">unsigned int * </td> | |||
<td class="paramname"> <em>bufferFrames</em>, </td> | |||
</tr> | |||
<tr> | |||
<td class="paramkey"></td> | |||
<td></td> | |||
<td class="paramtype"><a class="el" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f">RtAudioCallback</a> </td> | |||
<td class="paramname"> <em>callback</em>, </td> | |||
</tr> | |||
<tr> | |||
<td class="paramkey"></td> | |||
<td></td> | |||
<td class="paramtype">void * </td> | |||
<td class="paramname"> <em>userData</em> = <code>NULL</code>, </td> | |||
</tr> | |||
<tr> | |||
<td class="paramkey"></td> | |||
<td></td> | |||
<td class="paramtype"><a class="el" href="structRtAudio_1_1StreamOptions.html">RtAudio::StreamOptions</a> * </td> | |||
<td class="paramname"> <em>options</em> = <code>NULL</code></td><td> </td> | |||
</tr> | |||
<tr> | |||
<td></td> | |||
<td>)</td> | |||
<td></td><td></td><td></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>A public function for opening a stream with the specified parameters. </p> | |||
<p>An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = SYSTEM_ERROR) is thrown if a stream cannot be opened with the specified parameters or an error occurs during processing. An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = INVALID_USE) is thrown if any invalid device ID or channel number parameters are specified.</p> | |||
<dl><dt><b>Parameters:</b></dt><dd> | |||
<table border="0" cellspacing="2" cellpadding="0"> | |||
<tr><td valign="top"></td><td valign="top"><em>outputParameters</em> </td><td>Specifies output stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For input-only streams, this argument should be NULL. The device ID is an index value between 0 and <a class="el" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount()</a> - 1. </td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>inputParameters</em> </td><td>Specifies input stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For output-only streams, this argument should be NULL. The device ID is an index value between 0 and <a class="el" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount()</a> - 1. </td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>format</em> </td><td>An RtAudioFormat specifying the desired sample data format. </td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>sampleRate</em> </td><td>The desired sample rate (sample frames per second). </td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>*bufferFrames</em> </td><td>A pointer to a value indicating the desired internal buffer size in sample frames. The actual value used by the device is returned via the same pointer. A value of zero can be specified, in which case the lowest allowable value is determined. </td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>callback</em> </td><td>A client-defined function that will be invoked when input data is available and/or output data is needed. </td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>userData</em> </td><td>An optional pointer to data that can be accessed from within the callback function. </td></tr> | |||
<tr><td valign="top"></td><td valign="top"><em>options</em> </td><td>An optional pointer to a structure containing various global stream options, including a list of OR'ed RtAudioStreamFlags and a suggested number of stream buffers that can be used to control stream latency. More buffers typically result in more robust performance, though at a cost of greater latency. If a value of zero is specified, a system-specific median value is chosen. If the RTAUDIO_MINIMIZE_LATENCY flag bit is set, the lowest allowable value is used. The actual value used is returned via the structure argument. The parameter is API dependent. </td></tr> | |||
</table> | |||
</dd> | |||
</dl> | |||
</div> | |||
</div> | |||
<a class="anchor" id="a90d599002ad32cf250a4cb866f2cc93a"></a><!-- doxytag: member="RtAudio::closeStream" ref="a90d599002ad32cf250a4cb866f2cc93a" args="(void)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">void RtAudio::closeStream </td> | |||
<td>(</td> | |||
<td class="paramtype">void </td> | |||
<td class="paramname"></td> | |||
<td> ) </td> | |||
<td> throw ()<code> [inline]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>A function that closes a stream and frees any associated stream memory. </p> | |||
<p>If a stream is not open, this function issues a warning and returns (no exception is thrown). </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="aec017a89629ccef66a90b60be22a2f80"></a><!-- doxytag: member="RtAudio::startStream" ref="aec017a89629ccef66a90b60be22a2f80" args="(void)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">void RtAudio::startStream </td> | |||
<td>(</td> | |||
<td class="paramtype">void </td> | |||
<td class="paramname"></td> | |||
<td> ) </td> | |||
<td><code> [inline]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>A function that starts a stream. </p> | |||
<p>An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already running. </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="af4c241ff86936ecc8108f0d9dfe3efdd"></a><!-- doxytag: member="RtAudio::stopStream" ref="af4c241ff86936ecc8108f0d9dfe3efdd" args="(void)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">void RtAudio::stopStream </td> | |||
<td>(</td> | |||
<td class="paramtype">void </td> | |||
<td class="paramname"></td> | |||
<td> ) </td> | |||
<td><code> [inline]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>Stop a stream, allowing any samples remaining in the output queue to be played. </p> | |||
<p>An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped. </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="ad0586b47cd6bb9591a80b4052815991f"></a><!-- doxytag: member="RtAudio::abortStream" ref="ad0586b47cd6bb9591a80b4052815991f" args="(void)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">void RtAudio::abortStream </td> | |||
<td>(</td> | |||
<td class="paramtype">void </td> | |||
<td class="paramname"></td> | |||
<td> ) </td> | |||
<td><code> [inline]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>Stop a stream, discarding any samples remaining in the input/output queue. </p> | |||
<p>An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped. </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="a344e59a62353c5791db4621b985cb2ca"></a><!-- doxytag: member="RtAudio::getStreamTime" ref="a344e59a62353c5791db4621b985cb2ca" args="(void)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">double RtAudio::getStreamTime </td> | |||
<td>(</td> | |||
<td class="paramtype">void </td> | |||
<td class="paramname"></td> | |||
<td> ) </td> | |||
<td><code> [inline]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>Returns the number of elapsed seconds since the stream was started. </p> | |||
<p>If a stream is not open, an <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = INVALID_USE) will be thrown. </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="a843c989d9f501c71bc2f2c5ca18df9f3"></a><!-- doxytag: member="RtAudio::getStreamLatency" ref="a843c989d9f501c71bc2f2c5ca18df9f3" args="(void)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">long RtAudio::getStreamLatency </td> | |||
<td>(</td> | |||
<td class="paramtype">void </td> | |||
<td class="paramname"></td> | |||
<td> ) </td> | |||
<td><code> [inline]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>Returns the internal stream latency in sample frames. </p> | |||
<p>The stream latency refers to delay in audio input and/or output caused by internal buffering by the audio system and/or hardware. For duplex streams, the returned value will represent the sum of the input and output latencies. If a stream is not open, an <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = INVALID_USE) will be thrown. If the API does not report latency, the return value will be zero. </p> | |||
</div> | |||
</div> | |||
<a class="anchor" id="a28214b8b05d60b45c24ee6fae7b2a0b5"></a><!-- doxytag: member="RtAudio::getStreamSampleRate" ref="a28214b8b05d60b45c24ee6fae7b2a0b5" args="(void)" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">unsigned int RtAudio::getStreamSampleRate </td> | |||
<td>(</td> | |||
<td class="paramtype">void </td> | |||
<td class="paramname"></td> | |||
<td> ) </td> | |||
<td><code> [inline]</code></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>Returns actual sample rate in use by the stream. </p> | |||
<p>On some systems, the sample rate used may be slightly different than that specified in the stream parameters. If a stream is not open, an <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> (type = INVALID_USE) will be thrown. </p> | |||
</div> | |||
</div> | |||
<hr/>The documentation for this class was generated from the following file:<ul> | |||
<li><a class="el" href="RtAudio_8h_source.html">RtAudio.h</a></li> | |||
</ul> | |||
</div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,40 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<div class="contents"> | |||
<h1>RtError Member List</h1>This is the complete list of members for <a class="el" href="classRtError.html">RtError</a>, including all inherited members.<table> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca20e5a369394d19b704ace17002007eba">DEBUG_WARNING</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca995e97ecf6beeedaba525022a63aec6b">DRIVER_ERROR</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#afd067ba6b46edd37f989cad02cd70b50">getMessage</a>(void) const </td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline, virtual]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#a3e316dc9b9b41fe2f64cabf34beb4fe7">getType</a>(void) const </td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline, virtual]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acad6064062066fffdba258237a7c2159b1">INVALID_DEVICE</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaa3eabf0f71120beaba94148a1b78fed6">INVALID_PARAMETER</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8e65f51a3fbdc1a4a1552b3260df36bc">INVALID_USE</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acab4f813e5a36905c89d4081a59497432e">MEMORY_ERROR</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaf267eb2d710f33d649ba840eeab6ff82">NO_DEVICES_FOUND</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#a251dcdac396c998c91706dd2dd3b8bfc">printMessage</a>(void) const </td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline, virtual]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#aa479a305ccbe56be0fd9137b9b405a37">RtError</a>(const std::string &message, Type type=RtError::UNSPECIFIED)</td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8947d0a2e2a84ecf3646271844e06a6b">SYSTEM_ERROR</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaeb6282f991e2d93ab294a4272fc3f6c6">THREAD_ERROR</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac">Type</a> enum name</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca444efd3ccf774b2ba9f9bde70ec71cd6">UNSPECIFIED</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca3a1603c24a56cbdaf5f8ae4ddcb86398">WARNING</a> enum value</td><td><a class="el" href="classRtError.html">RtError</a></td><td></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#aeb843b7a7785d66061c61ebfc29e7e9d">what</a>(void) const </td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline, virtual]</code></td></tr> | |||
<tr class="memlist"><td><a class="el" href="classRtError.html#a6793e03386e7e69ffafb65a296dfa48c">~RtError</a>(void)</td><td><a class="el" href="classRtError.html">RtError</a></td><td><code> [inline, virtual]</code></td></tr> | |||
</table></div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,127 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<div class="contents"> | |||
<h1>RtError Class Reference</h1><!-- doxytag: class="RtError" --> | |||
<p>Exception handling class for <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> & RtMidi. | |||
<a href="#_details">More...</a></p> | |||
<p><code>#include <<a class="el" href="RtError_8h_source.html">RtError.h</a>></code></p> | |||
<p><a href="classRtError-members.html">List of all members.</a></p> | |||
<table border="0" cellpadding="0" cellspacing="0"> | |||
<tr><td colspan="2"><h2>Public Types</h2></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top">enum </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac">Type</a> { <br/> | |||
<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca3a1603c24a56cbdaf5f8ae4ddcb86398">WARNING</a>, | |||
<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca20e5a369394d19b704ace17002007eba">DEBUG_WARNING</a>, | |||
<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca444efd3ccf774b2ba9f9bde70ec71cd6">UNSPECIFIED</a>, | |||
<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaf267eb2d710f33d649ba840eeab6ff82">NO_DEVICES_FOUND</a>, | |||
<br/> | |||
<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acad6064062066fffdba258237a7c2159b1">INVALID_DEVICE</a>, | |||
<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acab4f813e5a36905c89d4081a59497432e">MEMORY_ERROR</a>, | |||
<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaa3eabf0f71120beaba94148a1b78fed6">INVALID_PARAMETER</a>, | |||
<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8e65f51a3fbdc1a4a1552b3260df36bc">INVALID_USE</a>, | |||
<br/> | |||
<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca995e97ecf6beeedaba525022a63aec6b">DRIVER_ERROR</a>, | |||
<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903aca8947d0a2e2a84ecf3646271844e06a6b">SYSTEM_ERROR</a>, | |||
<a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903acaeb6282f991e2d93ab294a4272fc3f6c6">THREAD_ERROR</a> | |||
<br/> | |||
}</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight"><p>Defined <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> types. </p> | |||
<a href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac">More...</a><br/></td></tr> | |||
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa479a305ccbe56be0fd9137b9b405a37"></a><!-- doxytag: member="RtError::RtError" ref="aa479a305ccbe56be0fd9137b9b405a37" args="(const std::string &message, Type type=RtError::UNSPECIFIED)" --> | |||
</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtError.html#aa479a305ccbe56be0fd9137b9b405a37">RtError</a> (const std::string &message, <a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac">Type</a> type=RtError::UNSPECIFIED) throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The constructor. <br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6793e03386e7e69ffafb65a296dfa48c"></a><!-- doxytag: member="RtError::~RtError" ref="a6793e03386e7e69ffafb65a296dfa48c" args="(void)" --> | |||
virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtError.html#a6793e03386e7e69ffafb65a296dfa48c">~RtError</a> (void) throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">The destructor. <br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a251dcdac396c998c91706dd2dd3b8bfc"></a><!-- doxytag: member="RtError::printMessage" ref="a251dcdac396c998c91706dd2dd3b8bfc" args="(void) const " --> | |||
virtual void </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtError.html#a251dcdac396c998c91706dd2dd3b8bfc">printMessage</a> (void) const throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Prints thrown error message to stderr. <br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3e316dc9b9b41fe2f64cabf34beb4fe7"></a><!-- doxytag: member="RtError::getType" ref="a3e316dc9b9b41fe2f64cabf34beb4fe7" args="(void) const " --> | |||
virtual const <a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac">Type</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtError.html#a3e316dc9b9b41fe2f64cabf34beb4fe7">getType</a> (void) const throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the thrown error message type. <br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afd067ba6b46edd37f989cad02cd70b50"></a><!-- doxytag: member="RtError::getMessage" ref="afd067ba6b46edd37f989cad02cd70b50" args="(void) const " --> | |||
virtual const std::string & </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtError.html#afd067ba6b46edd37f989cad02cd70b50">getMessage</a> (void) const throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the thrown error message string. <br/></td></tr> | |||
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aeb843b7a7785d66061c61ebfc29e7e9d"></a><!-- doxytag: member="RtError::what" ref="aeb843b7a7785d66061c61ebfc29e7e9d" args="(void) const " --> | |||
virtual const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="classRtError.html#aeb843b7a7785d66061c61ebfc29e7e9d">what</a> (void) const throw ()</td></tr> | |||
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the thrown error message as a c-style string. <br/></td></tr> | |||
</table> | |||
<hr/><a name="_details"></a><h2>Detailed Description</h2> | |||
<p>Exception handling class for <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> & RtMidi. </p> | |||
<p>The <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> class is quite simple but it does allow errors to be "caught" by <a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac" title="Defined RtError types.">RtError::Type</a>. See the <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> and RtMidi documentation to know which methods can throw an <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a>. </p> | |||
<hr/><h2>Member Enumeration Documentation</h2> | |||
<a class="anchor" id="ab04667aae01bffc354a9ac6bda6903ac"></a><!-- doxytag: member="RtError::Type" ref="ab04667aae01bffc354a9ac6bda6903ac" args="" --> | |||
<div class="memitem"> | |||
<div class="memproto"> | |||
<table class="memname"> | |||
<tr> | |||
<td class="memname">enum <a class="el" href="classRtError.html#ab04667aae01bffc354a9ac6bda6903ac">RtError::Type</a></td> | |||
</tr> | |||
</table> | |||
</div> | |||
<div class="memdoc"> | |||
<p>Defined <a class="el" href="classRtError.html" title="Exception handling class for RtAudio & RtMidi.">RtError</a> types. </p> | |||
<dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0"> | |||
<tr><td valign="top"><em><a class="anchor" id="ab04667aae01bffc354a9ac6bda6903aca3a1603c24a56cbdaf5f8ae4ddcb86398"></a><!-- doxytag: member="WARNING" ref="ab04667aae01bffc354a9ac6bda6903aca3a1603c24a56cbdaf5f8ae4ddcb86398" args="" -->WARNING</em> </td><td> | |||
<p>A non-critical error. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ab04667aae01bffc354a9ac6bda6903aca20e5a369394d19b704ace17002007eba"></a><!-- doxytag: member="DEBUG_WARNING" ref="ab04667aae01bffc354a9ac6bda6903aca20e5a369394d19b704ace17002007eba" args="" -->DEBUG_WARNING</em> </td><td> | |||
<p>A non-critical error which might be useful for debugging. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ab04667aae01bffc354a9ac6bda6903aca444efd3ccf774b2ba9f9bde70ec71cd6"></a><!-- doxytag: member="UNSPECIFIED" ref="ab04667aae01bffc354a9ac6bda6903aca444efd3ccf774b2ba9f9bde70ec71cd6" args="" -->UNSPECIFIED</em> </td><td> | |||
<p>The default, unspecified error type. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ab04667aae01bffc354a9ac6bda6903acaf267eb2d710f33d649ba840eeab6ff82"></a><!-- doxytag: member="NO_DEVICES_FOUND" ref="ab04667aae01bffc354a9ac6bda6903acaf267eb2d710f33d649ba840eeab6ff82" args="" -->NO_DEVICES_FOUND</em> </td><td> | |||
<p>No devices found on system. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ab04667aae01bffc354a9ac6bda6903acad6064062066fffdba258237a7c2159b1"></a><!-- doxytag: member="INVALID_DEVICE" ref="ab04667aae01bffc354a9ac6bda6903acad6064062066fffdba258237a7c2159b1" args="" -->INVALID_DEVICE</em> </td><td> | |||
<p>An invalid device ID was specified. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ab04667aae01bffc354a9ac6bda6903acab4f813e5a36905c89d4081a59497432e"></a><!-- doxytag: member="MEMORY_ERROR" ref="ab04667aae01bffc354a9ac6bda6903acab4f813e5a36905c89d4081a59497432e" args="" -->MEMORY_ERROR</em> </td><td> | |||
<p>An error occured during memory allocation. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ab04667aae01bffc354a9ac6bda6903acaa3eabf0f71120beaba94148a1b78fed6"></a><!-- doxytag: member="INVALID_PARAMETER" ref="ab04667aae01bffc354a9ac6bda6903acaa3eabf0f71120beaba94148a1b78fed6" args="" -->INVALID_PARAMETER</em> </td><td> | |||
<p>An invalid parameter was specified to a function. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ab04667aae01bffc354a9ac6bda6903aca8e65f51a3fbdc1a4a1552b3260df36bc"></a><!-- doxytag: member="INVALID_USE" ref="ab04667aae01bffc354a9ac6bda6903aca8e65f51a3fbdc1a4a1552b3260df36bc" args="" -->INVALID_USE</em> </td><td> | |||
<p>The function was called incorrectly. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ab04667aae01bffc354a9ac6bda6903aca995e97ecf6beeedaba525022a63aec6b"></a><!-- doxytag: member="DRIVER_ERROR" ref="ab04667aae01bffc354a9ac6bda6903aca995e97ecf6beeedaba525022a63aec6b" args="" -->DRIVER_ERROR</em> </td><td> | |||
<p>A system driver error occured. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ab04667aae01bffc354a9ac6bda6903aca8947d0a2e2a84ecf3646271844e06a6b"></a><!-- doxytag: member="SYSTEM_ERROR" ref="ab04667aae01bffc354a9ac6bda6903aca8947d0a2e2a84ecf3646271844e06a6b" args="" -->SYSTEM_ERROR</em> </td><td> | |||
<p>A system error occured. </p> | |||
</td></tr> | |||
<tr><td valign="top"><em><a class="anchor" id="ab04667aae01bffc354a9ac6bda6903acaeb6282f991e2d93ab294a4272fc3f6c6"></a><!-- doxytag: member="THREAD_ERROR" ref="ab04667aae01bffc354a9ac6bda6903acaeb6282f991e2d93ab294a4272fc3f6c6" args="" -->THREAD_ERROR</em> </td><td> | |||
<p>A thread error occured. </p> | |||
</td></tr> | |||
</table> | |||
</dd> | |||
</dl> | |||
</div> | |||
</div> | |||
<hr/>The documentation for this class was generated from the following file:<ul> | |||
<li><a class="el" href="RtError_8h_source.html">RtError.h</a></li> | |||
</ul> | |||
</div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,27 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<div class="contents"> | |||
<h1>Class Index</h1><div class="qindex"><a class="qindex" href="#letter_D">D</a> | <a class="qindex" href="#letter_R">R</a> | <a class="qindex" href="#letter_S">S</a></div> | |||
<table align="center" width="95%" border="0" cellspacing="0" cellpadding="0"> | |||
<tr><td><a name="letter_D"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> D </div></td></tr></table> | |||
</td><td><a name="letter_R"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> R </div></td></tr></table> | |||
</td><td><a class="el" href="classRtError.html">RtError</a> </td><td><a class="el" href="structRtAudio_1_1StreamOptions.html">RtAudio::StreamOptions</a> </td><td><a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> </td></tr><tr><td><a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a> </td><td><a class="el" href="classRtAudio.html">RtAudio</a> </td><td><a name="letter_S"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah"> S </div></td></tr></table> | |||
</td></tr></table><div class="qindex"><a class="qindex" href="#letter_D">D</a> | <a class="qindex" href="#letter_R">R</a> | <a class="qindex" href="#letter_S">S</a></div> | |||
</div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,50 +0,0 @@ | |||
<HTML> | |||
<HEAD> | |||
<TITLE>The RtAudio Home Page</TITLE> | |||
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css"> | |||
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico"> | |||
</HEAD> | |||
<BODY BGCOLOR="#FFFFFF"> | |||
<CENTER> | |||
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="annotated.html">Class/Enum List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </CENTER> | |||
<HR> | |||
<!-- Generated by Doxygen 1.6.2 --> | |||
<div class="contents"> | |||
<h1><a class="anchor" id="compiling">Debugging & Compiling </a></h1><h2><a class="anchor" id="debug"> | |||
Debugging</a></h2> | |||
<p>If you are having problems getting <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> to run on your system, make sure to pass a value of <em>true</em> to the <a class="el" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77" title="Specify whether warning messages should be printed to stderr.">RtAudio::showWarnings()</a> function (this is the default setting). A variety of warning messages will be displayed which may help in determining the problem. Also, try using the programs included in the <code>tests</code> directory. The program <code>audioprobe</code> displays the queried capabilities of all hardware devices found for all APIs compiled. When using the ALSA and JACK APIs, further information can be displayed by defining the preprocessor definition __RTAUDIO_DEBUG__.</p> | |||
<h2><a class="anchor" id="compile"> | |||
Compiling</a></h2> | |||
<p>In order to compile <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> for a specific OS and audio API, it is necessary to supply the appropriate preprocessor definition and library within the compiler statement: </p> | |||
<table class="doxtable" border="2" cols="5" width="100%"> | |||
<tr bgcolor="beige"> | |||
<td width="5%"><b>OS:</b> </td><td width="5%"><b>Audio API:</b> </td><td width="5%"><b>C++ Class:</b> </td><td width="5%"><b>Preprocessor Definition:</b> </td><td width="5%"><b>Library or Framework:</b> </td><td><b>Example Compiler Statement:</b> </td></tr> | |||
<tr> | |||
<td>Linux </td><td>ALSA </td><td>RtApiAlsa </td><td>__LINUX_ALSA__ </td><td><code>asound, pthread</code> </td><td><code>g++ -Wall -D__LINUX_ALSA__ -o audioprobe audioprobe.cpp RtAudio.cpp -lasound -lpthread</code> </td></tr> | |||
<tr> | |||
<td>Linux </td><td>PulseAudio </td><td>RtApiPulse </td><td>__LINUX_PULSE__ </td><td><code>pthread</code> </td><td><code>g++ -Wall -D__LINUX_PULSE__ -o audioprobe audioprobe.cpp RtAudio.cpp -lpthread</code> </td></tr> | |||
<tr> | |||
<td>Linux </td><td>OSS </td><td>RtApiOss </td><td>__LINUX_OSS__ </td><td><code>pthread</code> </td><td><code>g++ -Wall -D__LINUX_OSS__ -o audioprobe audioprobe.cpp RtAudio.cpp -lpthread</code> </td></tr> | |||
<tr> | |||
<td>Linux or Macintosh OS-X </td><td>Jack Audio Server </td><td>RtApiJack </td><td>__UNIX_JACK__ </td><td><code>jack, pthread</code> </td><td><p class="starttd"><code>g++ -Wall -D__UNIX_JACK__ -o audioprobe audioprobe.cpp RtAudio.cpp `pkg-config --cflags --libs jack` -lpthread</code> </p> | |||
<p class="endtd"></p> | |||
</td></tr> | |||
<tr> | |||
<td>Macintosh OS-X </td><td>CoreAudio </td><td>RtApiCore </td><td>__MACOSX_CORE__ </td><td><code>pthread, CoreAudio</code> </td><td><code>g++ -Wall -D__MACOSX_CORE__ -o audioprobe audioprobe.cpp RtAudio.cpp -framework CoreAudio -lpthread</code> </td></tr> | |||
<tr> | |||
<td>Windows </td><td>Direct Sound </td><td>RtApiDs </td><td>__WINDOWS_DS__ </td><td><code>dsound.lib (ver. 5.0 or higher), multithreaded</code> </td><td><em>compiler specific</em> </td></tr> | |||
<tr> | |||
<td>Windows </td><td>ASIO </td><td>RtApiAsio </td><td>__WINDOWS_ASIO__ </td><td><em>various ASIO header and source files</em> </td><td><em>compiler specific</em> </td></tr> | |||
</table> | |||
<p>The example compiler statements above could be used to compile the <code>audioprobe.cpp</code> example file, assuming that <code>audioprobe.cpp</code>, <code><a class="el" href="RtAudio_8h.html">RtAudio.h</a></code>, <code><a class="el" href="RtError_8h_source.html">RtError.h</a></code>, and <code>RtAudio.cpp</code> all exist in the same directory. </p> | |||
</div> | |||
<HR> | |||
<table><tr><td><img src="../images/mcgill.gif" width=165></td> | |||
<td>©2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr> | |||
</table> | |||
</BODY> | |||
</HTML> |
@@ -1,532 +0,0 @@ | |||
/* The standard CSS for doxygen */ | |||
body, table, div, p, dl { | |||
font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; | |||
font-size: 12px; | |||
} | |||
/* @group Heading Levels */ | |||
h1 { | |||
text-align: center; | |||
font-size: 150%; | |||
} | |||
h2 { | |||
font-size: 120%; | |||
} | |||
h3 { | |||
font-size: 100%; | |||
} | |||
dt { | |||
font-weight: bold; | |||
} | |||
div.multicol { | |||
-moz-column-gap: 1em; | |||
-webkit-column-gap: 1em; | |||
-moz-column-count: 3; | |||
-webkit-column-count: 3; | |||
} | |||
p.startli, p.startdd, p.starttd { | |||
margin-top: 2px; | |||
} | |||
p.endli { | |||
margin-bottom: 0px; | |||
} | |||
p.enddd { | |||
margin-bottom: 4px; | |||
} | |||
p.endtd { | |||
margin-bottom: 2px; | |||
} | |||
/* @end */ | |||
caption { | |||
font-weight: bold; | |||
} | |||
span.legend { | |||
font-size: 70%; | |||
text-align: center; | |||
} | |||
h3.version { | |||
font-size: 90%; | |||
text-align: center; | |||
} | |||
div.qindex, div.navtab{ | |||
background-color: #e8eef2; | |||
border: 1px solid #84b0c7; | |||
text-align: center; | |||
margin: 2px; | |||
padding: 2px; | |||
} | |||
div.qindex, div.navpath { | |||
width: 100%; | |||
line-height: 140%; | |||
} | |||
div.navtab { | |||
margin-right: 15px; | |||
} | |||
/* @group Link Styling */ | |||
a { | |||
color: #153788; | |||
font-weight: normal; | |||
text-decoration: none; | |||
} | |||
.contents a:visited { | |||
color: #1b77c5; | |||
} | |||
a:hover { | |||
text-decoration: underline; | |||
} | |||
a.qindex { | |||
font-weight: bold; | |||
} | |||
a.qindexHL { | |||
font-weight: bold; | |||
background-color: #6666cc; | |||
color: #ffffff; | |||
border: 1px double #9295C2; | |||
} | |||
.contents a.qindexHL:visited { | |||
color: #ffffff; | |||
} | |||
a.el { | |||
font-weight: bold; | |||
} | |||
a.elRef { | |||
} | |||
a.code { | |||
color: #3030f0; | |||
} | |||
a.codeRef { | |||
color: #3030f0; | |||
} | |||
/* @end */ | |||
dl.el { | |||
margin-left: -1cm; | |||
} | |||
.fragment { | |||
font-family: monospace, fixed; | |||
font-size: 105%; | |||
} | |||
pre.fragment { | |||
border: 1px solid #CCCCCC; | |||
background-color: #f5f5f5; | |||
padding: 4px 6px; | |||
margin: 4px 8px 4px 2px; | |||
overflow: auto; | |||
word-wrap: break-word; | |||
font-size: 9pt; | |||
line-height: 125%; | |||
} | |||
div.ah { | |||
background-color: black; | |||
font-weight: bold; | |||
color: #ffffff; | |||
margin-bottom: 3px; | |||
margin-top: 3px | |||
} | |||
div.groupHeader { | |||
margin-left: 16px; | |||
margin-top: 12px; | |||
margin-bottom: 6px; | |||
font-weight: bold; | |||
} | |||
div.groupText { | |||
margin-left: 16px; | |||
font-style: italic; | |||
} | |||
body { | |||
background: white; | |||
color: black; | |||
margin-right: 20px; | |||
margin-left: 20px; | |||
} | |||
td.indexkey { | |||
background-color: #e8eef2; | |||
font-weight: bold; | |||
border: 1px solid #CCCCCC; | |||
margin: 2px 0px 2px 0; | |||
padding: 2px 10px; | |||
} | |||
td.indexvalue { | |||
background-color: #e8eef2; | |||
border: 1px solid #CCCCCC; | |||
padding: 2px 10px; | |||
margin: 2px 0px; | |||
} | |||
tr.memlist { | |||
background-color: #f0f0f0; | |||
} | |||
p.formulaDsp { | |||
text-align: center; | |||
} | |||
img.formulaDsp { | |||
} | |||
img.formulaInl { | |||
vertical-align: middle; | |||
} | |||
div.center { | |||
text-align: center; | |||
margin-top: 0px; | |||
margin-bottom: 0px; | |||
padding: 0px; | |||
} | |||
div.center img { | |||
border: 0px; | |||
} | |||
img.footer { | |||
border: 0px; | |||
vertical-align: middle; | |||
} | |||
/* @group Code Colorization */ | |||
span.keyword { | |||
color: #008000 | |||
} | |||
span.keywordtype { | |||
color: #604020 | |||
} | |||
span.keywordflow { | |||
color: #e08000 | |||
} | |||
span.comment { | |||
color: #800000 | |||
} | |||
span.preprocessor { | |||
color: #806020 | |||
} | |||
span.stringliteral { | |||
color: #002080 | |||
} | |||
span.charliteral { | |||
color: #008080 | |||
} | |||
span.vhdldigit { | |||
color: #ff00ff | |||
} | |||
span.vhdlchar { | |||
color: #000000 | |||
} | |||
span.vhdlkeyword { | |||
color: #700070 | |||
} | |||
span.vhdllogic { | |||
color: #ff0000 | |||
} | |||
/* @end */ | |||
.search { | |||
color: #003399; | |||
font-weight: bold; | |||
} | |||
form.search { | |||
margin-bottom: 0px; | |||
margin-top: 0px; | |||
} | |||
input.search { | |||
font-size: 75%; | |||
color: #000080; | |||
font-weight: normal; | |||
background-color: #e8eef2; | |||
} | |||
td.tiny { | |||
font-size: 75%; | |||
} | |||
.dirtab { | |||
padding: 4px; | |||
border-collapse: collapse; | |||
border: 1px solid #84b0c7; | |||
} | |||
th.dirtab { | |||
background: #e8eef2; | |||
font-weight: bold; | |||
} | |||
hr { | |||
height: 0; | |||
border: none; | |||
border-top: 1px solid #666; | |||
} | |||
/* @group Member Descriptions */ | |||
.mdescLeft, .mdescRight, | |||
.memItemLeft, .memItemRight, | |||
.memTemplItemLeft, .memTemplItemRight, .memTemplParams { | |||
background-color: #FAFAFA; | |||
border: none; | |||
margin: 4px; | |||
padding: 1px 0 0 8px; | |||
} | |||
.mdescLeft, .mdescRight { | |||
padding: 0px 8px 4px 8px; | |||
color: #555; | |||
} | |||
.memItemLeft, .memItemRight, .memTemplParams { | |||
border-top: 1px solid #ccc; | |||
} | |||
.memItemLeft, .memTemplItemLeft { | |||
white-space: nowrap; | |||
} | |||
.memTemplParams { | |||
color: #606060; | |||
white-space: nowrap; | |||
} | |||
/* @end */ | |||
/* @group Member Details */ | |||
/* Styles for detailed member documentation */ | |||
.memtemplate { | |||
font-size: 80%; | |||
color: #606060; | |||
font-weight: normal; | |||
margin-left: 3px; | |||
} | |||
.memnav { | |||
background-color: #e8eef2; | |||
border: 1px solid #84b0c7; | |||
text-align: center; | |||
margin: 2px; | |||
margin-right: 15px; | |||
padding: 2px; | |||
} | |||
.memitem { | |||
padding: 0; | |||
margin-bottom: 10px; | |||
} | |||
.memname { | |||
white-space: nowrap; | |||
font-weight: bold; | |||
} | |||
.memproto, .memdoc { | |||
border: 1px solid #84b0c7; | |||
} | |||
.memproto { | |||
padding: 0; | |||
background-color: #d5e1e8; | |||
font-weight: bold; | |||
-webkit-border-top-left-radius: 8px; | |||
-webkit-border-top-right-radius: 8px; | |||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); | |||
-moz-border-radius-topleft: 8px; | |||
-moz-border-radius-topright: 8px; | |||
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; | |||
} | |||
.memdoc { | |||
padding: 2px 5px; | |||
background-color: #eef3f5; | |||
border-top-width: 0; | |||
-webkit-border-bottom-left-radius: 8px; | |||
-webkit-border-bottom-right-radius: 8px; | |||
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); | |||
-moz-border-radius-bottomleft: 8px; | |||
-moz-border-radius-bottomright: 8px; | |||
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; | |||
} | |||
.paramkey { | |||
text-align: right; | |||
} | |||
.paramtype { | |||
white-space: nowrap; | |||
} | |||
.paramname { | |||
color: #602020; | |||
white-space: nowrap; | |||
} | |||
.paramname em { | |||
font-style: normal; | |||
} | |||
/* @end */ | |||
/* @group Directory (tree) */ | |||
/* for the tree view */ | |||
.ftvtree { | |||
font-family: sans-serif; | |||
margin: 0.5em; | |||
} | |||
/* these are for tree view when used as main index */ | |||
.directory { | |||
font-size: 9pt; | |||
font-weight: bold; | |||
} | |||
.directory h3 { | |||
margin: 0px; | |||
margin-top: 1em; | |||
font-size: 11pt; | |||
} | |||
/* | |||
The following two styles can be used to replace the root node title | |||
with an image of your choice. Simply uncomment the next two styles, | |||
specify the name of your image and be sure to set 'height' to the | |||
proper pixel height of your image. | |||
*/ | |||
/* | |||
.directory h3.swap { | |||
height: 61px; | |||
background-repeat: no-repeat; | |||
background-image: url("yourimage.gif"); | |||
} | |||
.directory h3.swap span { | |||
display: none; | |||
} | |||
*/ | |||
.directory > h3 { | |||
margin-top: 0; | |||
} | |||
.directory p { | |||
margin: 0px; | |||
white-space: nowrap; | |||
} | |||
.directory div { | |||
display: none; | |||
margin: 0px; | |||
} | |||
.directory img { | |||
vertical-align: -30%; | |||
} | |||
/* these are for tree view when not used as main index */ | |||
.directory-alt { | |||
font-size: 100%; | |||
font-weight: bold; | |||
} | |||
.directory-alt h3 { | |||
margin: 0px; | |||
margin-top: 1em; | |||
font-size: 11pt; | |||
} | |||
.directory-alt > h3 { | |||
margin-top: 0; | |||
} | |||
.directory-alt p { | |||
margin: 0px; | |||
white-space: nowrap; | |||
} | |||
.directory-alt div { | |||
display: none; | |||
margin: 0px; | |||
} | |||
.directory-alt img { | |||
vertical-align: -30%; | |||
} | |||
/* @end */ | |||
address { | |||
font-style: normal; | |||
color: #333; | |||
} | |||
table.doxtable { | |||
border-collapse:collapse; | |||
} | |||
table.doxtable td, table.doxtable th { | |||
border: 1px solid #153788; | |||
padding: 3px 7px 2px; | |||
} | |||
table.doxtable th { | |||
background-color: #254798; | |||
color: #FFFFFF; | |||
font-size: 110%; | |||
padding-bottom: 4px; | |||
padding-top: 5px; | |||
text-align:left; | |||
} | |||