summaryrefslogtreecommitdiff
path: root/plugins/oss
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-04-14 20:50:40 +0200
committerGravatar waker <wakeroid@gmail.com>2011-04-14 20:50:40 +0200
commit4e3bdbb0bc8649208400b9eb63751db15bc9bcda (patch)
tree3bfc597a6255a652ce774558bda4bf65c6b6252a /plugins/oss
parenta0116d4496107e368b791d86295834c6e844a6e8 (diff)
new event passing system
Diffstat (limited to 'plugins/oss')
-rw-r--r--plugins/oss/oss.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/plugins/oss/oss.c b/plugins/oss/oss.c
index 953398af..e64e1fc0 100644
--- a/plugins/oss/oss.c
+++ b/plugins/oss/oss.c
@@ -315,7 +315,7 @@ oss_get_state (void) {
}
static int
-oss_configchanged (DB_event_t *ev, uintptr_t data) {
+oss_configchanged (void) {
deadbeef->conf_lock ();
const char *dev = deadbeef->conf_get_str_fast ("oss.device", "/dev/dsp");
if (strcmp (dev, oss_device)) {
@@ -328,15 +328,23 @@ oss_configchanged (DB_event_t *ev, uintptr_t data) {
}
static int
+oss_message (uint32_t id, uintptr_t ctx, uint32_t p1, uint32_t p2) {
+ switch (id) {
+ case DB_EV_CONFIGCHANGED:
+ oss_configchanged ();
+ break;
+ }
+ return 0;
+}
+
+static int
oss_plugin_start (void) {
deadbeef->conf_get_str ("oss.device", "/dev/dsp", oss_device, sizeof (oss_device));
- deadbeef->ev_subscribe (DB_PLUGIN (&plugin), DB_EV_CONFIGCHANGED, DB_CALLBACK (oss_configchanged), 0);
return 0;
}
static int
oss_plugin_stop (void) {
- deadbeef->ev_unsubscribe (DB_PLUGIN (&plugin), DB_EV_CONFIGCHANGED, DB_CALLBACK (oss_configchanged), 0);
return 0;
}
@@ -379,6 +387,7 @@ static DB_output_t plugin = {
.plugin.start = oss_plugin_start,
.plugin.stop = oss_plugin_stop,
.plugin.configdialog = settings_dlg,
+ .plugin.message = oss_message,
.init = oss_init,
.free = oss_free,
.setformat = oss_setformat,