diff src/OSS4/OSS4.c @ 3048:c269a0351b53

ported OSS4
author Michal Lipski <tallica@o2.pl>
date Fri, 17 Apr 2009 17:31:14 +0200
parents 3134a0987162
children 9ec8a613a1d6
line wrap: on
line diff
--- a/src/OSS4/OSS4.c	Fri Apr 17 16:17:10 2009 +0300
+++ b/src/OSS4/OSS4.c	Fri Apr 17 17:31:14 2009 +0200
@@ -57,7 +57,7 @@
                      G_CALLBACK(gtk_widget_destroyed), &dialog);
 }
 
-static void oss_init(void)
+static OutputPluginInitStatus oss_init(void)
 {
     mcs_handle_t *db;
 
@@ -81,9 +81,19 @@
         aud_cfg_db_get_int(db, "OSS", "saved_volume", &vol);
         aud_cfg_db_close(db);
     }
-        //volume gets saved anyway, but is ignored unless "saved_volume" is true
-        if(!oss_cfg.save_volume)
-            vol=0x6464;  //maximum
+    
+    //volume gets saved anyway, but is ignored unless "saved_volume" is true
+    if(!oss_cfg.save_volume)
+        vol = 0x6464;  //maximum
+            
+    if (!oss_hardware_present())
+    {
+        return OUTPUT_PLUGIN_INIT_NO_DEVICES;
+    }
+    else
+    {
+        return OUTPUT_PLUGIN_INIT_FOUND_DEVICES;
+    }
 }
 
 static void oss_cleanup(void)
@@ -101,7 +111,8 @@
 }
 
 static OutputPlugin oss4_op = {
-    .description = "OSS4 Output Plugin",                      /* Description */
+    .description = "OSS4 Output Plugin",
+    .probe_priority = 1,
     .init = oss_init,
     .cleanup = oss_cleanup,
     .about = oss_about,