test_close_CFLAGS = @TEST_CFLAGS@ $(AM_CFLAGS)
test_close_LDADD = @TEST_LIBS@ $(top_builddir)/libchimara/libchimara.la
-noinst_LTLIBRARIES = first.la model.la gridtest.la splittest.la multiwin.la styletest.la
+noinst_LTLIBRARIES = first.la model.la gridtest.la splittest.la multiwin.la \
+ styletest.la soundtest.la
first_la_SOURCES = first.c
first_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS)
styletest_la_SOURCES = styletest.c
styletest_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS)
+
+soundtest_la_SOURCES = soundtest.c
+soundtest_la_LDFLAGS = $(TEST_PLUGIN_LIBTOOL_FLAGS)
--- /dev/null
+#include <libchimara/glk.h>
+#include <stdio.h>
+
+void
+glk_main(void)
+{
+ if(!glk_gestalt(gestalt_Sound, 0)) {
+ fprintf(stderr, "Sound not supported.\n");
+ return;
+ }
+ if(!glk_gestalt(gestalt_SoundVolume, 0)) {
+ fprintf(stderr, "Sound volume not supported.\n");
+ return;
+ }
+
+ schanid_t sc = glk_schannel_create(0);
+ if(!sc) {
+ fprintf(stderr, "Could not create sound channel.\n");
+ return;
+ }
+
+ glk_schannel_set_volume(sc, 0x10000);
+ glk_schannel_set_volume(sc, 0x08000);
+ glk_schannel_set_volume(sc, 0x04000);
+ glk_schannel_set_volume(sc, 0x00000);
+ glk_schannel_set_volume(sc, 0xA0000); /* max supported volume */
+ glk_schannel_set_volume(sc, 0xB0000); /* should be coerced */
+ glk_schannel_set_volume(sc, 0x10000);
+
+ glk_schannel_destroy(sc);
+}