Mercurial > audlegacy
annotate src/audacious/mime.c @ 4374:335f4ac3993a
save volume between sessions
author | Paula Stanciu <paula.stanciu@gmail.com> |
---|---|
date | Sun, 23 Mar 2008 20:31:28 +0200 |
parents | 31355fc2bb9a |
children |
rev | line source |
---|---|
3009 | 1 /* |
2 * Audacious | |
3 * Copyright (c) 2007 William Pitcock | |
4 * | |
5 * This program is free software; you can redistribute it and/or modify | |
6 * it under the terms of the GNU General Public License as published by | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3015
diff
changeset
|
7 * the Free Software Foundation; under version 3 of the License. |
3009 | 8 * |
9 * This program is distributed in the hope that it will be useful, | |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
14 * You should have received a copy of the GNU General Public License | |
3121
3b6d316f8b09
GPL3 relicensing.
William Pitcock <nenolod@atheme-project.org>
parents:
3015
diff
changeset
|
15 * along with this program. If not, see <http://www.gnu.org/licenses>. |
3123
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
16 * |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
17 * The Audacious team does not consider modular code linking to |
f1c756f39e6c
Invoke "Plugins are not derived work" clause provided by GPL3.
William Pitcock <nenolod@atheme-project.org>
parents:
3121
diff
changeset
|
18 * Audacious or using our public API to be a derived work. |
3009 | 19 */ |
20 | |
21 #include "mime.h" | |
22 | |
23 mowgli_dictionary_t *mime_type_dict = NULL; | |
24 | |
25 void mime_set_plugin(const gchar *mimetype, InputPlugin *ip) | |
26 { | |
3161 | 27 g_return_if_fail(mimetype != NULL); |
28 g_return_if_fail(ip != NULL); | |
3009 | 29 |
3161 | 30 if (mime_type_dict == NULL) |
31 mime_type_dict = mowgli_dictionary_create(strcasecmp); | |
32 else if (mowgli_dictionary_find(mime_type_dict, mimetype)) | |
33 mowgli_dictionary_delete(mime_type_dict, mimetype); | |
34 mowgli_dictionary_add(mime_type_dict, mimetype, ip); | |
3009 | 35 } |
36 | |
37 InputPlugin *mime_get_plugin(const gchar *mimetype) | |
38 { | |
3161 | 39 if (mimetype == NULL) |
40 return NULL; | |
3015
02a62ac3d9c2
Handle metadata sources where there are no mimetype support yet implemented.
William Pitcock <nenolod@atheme-project.org>
parents:
3009
diff
changeset
|
41 |
3161 | 42 if (mime_type_dict == NULL) |
43 return NULL; | |
3009 | 44 |
3161 | 45 return mowgli_dictionary_retrieve(mime_type_dict, mimetype); |
3009 | 46 } |