aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2011-01-12 18:15:16 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2011-01-12 18:15:16 +0000
commitf63dbfca6f7fb53de8507fe5a872fa8b563baeb8 (patch)
tree4313c0cfef91911be35ccd55baeb432d277f7c95
parent8935978c314f1fb1d7b123220e07b576b106828b (diff)
we have to call sys_audio_close() when resetting the audio-api
unfortunately this has not been made public yet, so there is a fallback using Pd's message api (with the drawback, that this would popup a preferences window if pd-gui is enabled) svn path=/trunk/externals/iem/mediasettings/; revision=14724
-rw-r--r--Makefile5
-rw-r--r--audiosettings.c12
2 files changed, 14 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 24a1fae..2d18f48 100644
--- a/Makefile
+++ b/Makefile
@@ -47,11 +47,10 @@ INSTALL = install
INSTALL_FILE = $(INSTALL) -p -m 644
INSTALL_DIR = $(INSTALL) -p -m 755 -d
-CFLAGS = -DPD -I$(PD_PATH)/src -I$(prefix)/include/pd -Wall -W -g
+CFLAGS = -DPD -I$(PD_PATH)/src -I$(prefix)/include/pd -Wall -W -g -DHAVE_SYS_CLOSE_AUDIO
LDFLAGS =
LIBS =
-ALLSOURCES := $(SOURCES) $(SOURCES_android) $(SOURCES_cygwin) $(SOURCES_macosx) \
- $(SOURCES_iphoneos) $(SOURCES_linux) $(SOURCES_windows)
+ALLSOURCES := $(SOURCES)
UNAME := $(shell uname -s)
ifeq ($(UNAME),Darwin)
diff --git a/audiosettings.c b/audiosettings.c
index 416c59b..e972e92 100644
--- a/audiosettings.c
+++ b/audiosettings.c
@@ -566,8 +566,20 @@ static void audiosettings_setdriver(t_audiosettings *x, t_symbol*s, int argc, t_
return;
}
verbose(1, "setting driver '%s' (=%d)", s->s_name, id);
+#ifdef HAVE_SYS_CLOSE_AUDIO
+ sys_close_audio();
sys_set_audio_api(id);
sys_reopen_audio();
+#else
+ if (s_pdsym->s_thing) {
+ t_atom ap[1];
+ SETFLOAT(ap, id);
+ typedmess(s_pdsym->s_thing,
+ gensym("audio-setapi"),
+ 1,
+ ap);
+ }
+#endif
}
static void audiosettings_bang(t_audiosettings *x) {