Mercurial > audlegacy-plugins
comparison 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 |
comparison
equal
deleted
inserted
replaced
3047:4434b4c4a715 | 3048:c269a0351b53 |
---|---|
55 "USA."), _("Ok"), FALSE, NULL, NULL); | 55 "USA."), _("Ok"), FALSE, NULL, NULL); |
56 g_signal_connect(G_OBJECT(dialog), "destroy", | 56 g_signal_connect(G_OBJECT(dialog), "destroy", |
57 G_CALLBACK(gtk_widget_destroyed), &dialog); | 57 G_CALLBACK(gtk_widget_destroyed), &dialog); |
58 } | 58 } |
59 | 59 |
60 static void oss_init(void) | 60 static OutputPluginInitStatus oss_init(void) |
61 { | 61 { |
62 mcs_handle_t *db; | 62 mcs_handle_t *db; |
63 | 63 |
64 memset(&oss_cfg, 0, sizeof(OSSConfig)); | 64 memset(&oss_cfg, 0, sizeof(OSSConfig)); |
65 | 65 |
79 aud_cfg_db_get_string(db, "OSS", "alt_audio_device", | 79 aud_cfg_db_get_string(db, "OSS", "alt_audio_device", |
80 &oss_cfg.alt_audio_device); | 80 &oss_cfg.alt_audio_device); |
81 aud_cfg_db_get_int(db, "OSS", "saved_volume", &vol); | 81 aud_cfg_db_get_int(db, "OSS", "saved_volume", &vol); |
82 aud_cfg_db_close(db); | 82 aud_cfg_db_close(db); |
83 } | 83 } |
84 //volume gets saved anyway, but is ignored unless "saved_volume" is true | 84 |
85 if(!oss_cfg.save_volume) | 85 //volume gets saved anyway, but is ignored unless "saved_volume" is true |
86 vol=0x6464; //maximum | 86 if(!oss_cfg.save_volume) |
87 vol = 0x6464; //maximum | |
88 | |
89 if (!oss_hardware_present()) | |
90 { | |
91 return OUTPUT_PLUGIN_INIT_NO_DEVICES; | |
92 } | |
93 else | |
94 { | |
95 return OUTPUT_PLUGIN_INIT_FOUND_DEVICES; | |
96 } | |
87 } | 97 } |
88 | 98 |
89 static void oss_cleanup(void) | 99 static void oss_cleanup(void) |
90 { | 100 { |
91 mcs_handle_t *db; | 101 mcs_handle_t *db; |
99 } | 109 } |
100 | 110 |
101 } | 111 } |
102 | 112 |
103 static OutputPlugin oss4_op = { | 113 static OutputPlugin oss4_op = { |
104 .description = "OSS4 Output Plugin", /* Description */ | 114 .description = "OSS4 Output Plugin", |
115 .probe_priority = 1, | |
105 .init = oss_init, | 116 .init = oss_init, |
106 .cleanup = oss_cleanup, | 117 .cleanup = oss_cleanup, |
107 .about = oss_about, | 118 .about = oss_about, |
108 .configure = oss_configure, | 119 .configure = oss_configure, |
109 .get_volume = oss_get_volume, | 120 .get_volume = oss_get_volume, |