annotate src/OSS4/OSS4.c @ 2150:04421592e6a3

Fixed an unexpected cddb error messaje when no cddb info is available
author Calin Crisan ccrisan@gmail.com
date Sat, 03 Nov 2007 01:23:56 +0200
parents b8da6a0b0da2
children 7b284f323ad8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1214
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
1 /* BMP - Cross-platform multimedia player
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
2 * Copyright (C) 2003-2004 BMP development team.
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
3 *
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
4 * Based on XMMS:
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
5 * Copyright (C) 1998-2003 XMMS development team.
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
6 *
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
10 * (at your option) any later version.
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
11 *
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
15 * GNU General Public License for more details.
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
16 *
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
18 * along with this program; if not, write to the Free Software
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
20 */
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
21
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
22 #include "OSS4.h"
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
23
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
24 #include <glib.h>
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
25 #include <audacious/i18n.h>
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
26 #include <stdlib.h>
1244
d0f1e147cf62 now it saves VMIX volume between sessions
Cristi Magherusan <majeru@atheme-project.org>
parents: 1214
diff changeset
27 #include <audacious/configdb.h>
1214
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
28
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
29 OutputPlugin oss_op = {
1629
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
30 .description = "OSS4 Output Plugin", /* Description */
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
31 .init = oss_init,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
32 .cleanup = oss_cleanup,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
33 .about = oss_about,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
34 .configure = oss_configure,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
35 .get_volume = oss_get_volume,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
36 .set_volume = oss_set_volume,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
37 .open_audio = oss_open,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
38 .write_audio = oss_write,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
39 .close_audio = oss_close,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
40 .flush = oss_flush,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
41 .pause = oss_pause,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
42 .buffer_free = oss_free,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
43 .buffer_playing = oss_playing,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
44 .output_time = oss_get_output_time,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
45 .written_time = oss_get_written_time,
4c937c5a03d2 OSS, OSS4: C99 initialisers
William Pitcock <nenolod@atheme.org>
parents: 1395
diff changeset
46 .tell_audio = oss_tell
1214
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
47 };
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
48
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
49 OutputPlugin *oss_oplist[] = { &oss_op, NULL };
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
50
1395
761e17b23e0c added Discovery plugin type
Cristi Magherusan <majeru@atheme-project.org>
parents: 1245
diff changeset
51 DECLARE_PLUGIN(OSS4, NULL, NULL, NULL, oss_oplist, NULL, NULL, NULL, NULL);
1214
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
52
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
53 void oss_cleanup(void)
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
54 {
1244
d0f1e147cf62 now it saves VMIX volume between sessions
Cristi Magherusan <majeru@atheme-project.org>
parents: 1214
diff changeset
55 ConfigDb *db;
2124
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1629
diff changeset
56 db = aud_cfg_db_open();
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1629
diff changeset
57 aud_cfg_db_set_int(db, "OSS", "saved_volume", vol);
b8da6a0b0da2 s/bmp_cfg_/aud_cfg_/g
Matti Hamalainen <ccr@tnsp.org>
parents: 1629
diff changeset
58 aud_cfg_db_close(db);
1244
d0f1e147cf62 now it saves VMIX volume between sessions
Cristi Magherusan <majeru@atheme-project.org>
parents: 1214
diff changeset
59
1214
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
60 if (oss_cfg.alt_audio_device) {
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
61 free(oss_cfg.alt_audio_device);
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
62 oss_cfg.alt_audio_device = NULL;
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
63 }
1245
a18b7cdc505d stripped down the config dialog, added an option for the save dmix volume
Cristi Magherusan <majeru@atheme-project.org>
parents: 1244
diff changeset
64
1214
2a722c3ccd9e damn, I forgot to 'hg add' the sources
Cristi Magherusan <majeru@atheme-project.org>
parents:
diff changeset
65 }