Mercurial > audlegacy-plugins
comparison src/vtx/vtx.c @ 1405:48e73f07ec9b
Use configured core sample rate frequency if available.
author | Christian Birchinger <joker@netswarm.net> |
---|---|
date | Sat, 04 Aug 2007 22:07:08 +0200 |
parents | ab7d89bb8fcb |
children | 90d4c120fbca |
comparison
equal
deleted
inserted
replaced
1404:ab7d89bb8fcb | 1405:48e73f07ec9b |
---|---|
20 #include <audacious/plugin.h> | 20 #include <audacious/plugin.h> |
21 | 21 |
22 #include <audacious/output.h> | 22 #include <audacious/output.h> |
23 #include <audacious/util.h> | 23 #include <audacious/util.h> |
24 #include <audacious/titlestring.h> | 24 #include <audacious/titlestring.h> |
25 #include <audacious/configdb.h> | |
25 #include <audacious/vfs.h> | 26 #include <audacious/vfs.h> |
26 #include <audacious/strings.h> | 27 #include <audacious/strings.h> |
27 #include <audacious/i18n.h> | 28 #include <audacious/i18n.h> |
28 | 29 |
29 #include "vtx.h" | 30 #include "vtx.h" |
53 | 54 |
54 ayemu_ay_t ay; | 55 ayemu_ay_t ay; |
55 ayemu_vtx_t vtx; | 56 ayemu_vtx_t vtx; |
56 | 57 |
57 static gchar *vtx_fmts[] = { "vtx", NULL }; | 58 static gchar *vtx_fmts[] = { "vtx", NULL }; |
59 | |
60 void | |
61 vtx_init(void) | |
62 { | |
63 ConfigDb *db; | |
64 db = bmp_cfg_db_open(); | |
65 | |
66 bmp_cfg_db_get_int(db, NULL, "src_rate", &freq); | |
67 if (freq < 4000 || freq > 192000) | |
68 freq = 44100; | |
69 | |
70 bmp_cfg_db_close(db); | |
71 } | |
58 | 72 |
59 int | 73 int |
60 vtx_is_our_fd (char *filename, VFSFile *fp) | 74 vtx_is_our_fd (char *filename, VFSFile *fp) |
61 { | 75 { |
62 char buf[2]; | 76 char buf[2]; |
291 } | 305 } |
292 | 306 |
293 InputPlugin vtx_ip = { | 307 InputPlugin vtx_ip = { |
294 NULL, /* FILLED BY XMMS */ | 308 NULL, /* FILLED BY XMMS */ |
295 NULL, /* FILLED BY XMMS */ | 309 NULL, /* FILLED BY XMMS */ |
296 "VTX Audio Plugin", /* Plugin description */ | 310 "VTX Audio Plugin", /* Plugin description */ |
297 NULL, /* Initialization */ | 311 vtx_init, /* Initialization */ |
298 vtx_about, /* Show aboutbox */ | 312 vtx_about, /* Show aboutbox */ |
299 vtx_config, /* Show/edit configuration */ | 313 vtx_config, /* Show/edit configuration */ |
300 vtx_is_our_file, /* Check file, return 1 if the plugin can handle this file */ | 314 vtx_is_our_file, /* Check file, return 1 if the plugin can handle this file */ |
301 NULL, /* Scan directory */ | 315 NULL, /* Scan directory */ |
302 vtx_play_file, /* Play given file */ | 316 vtx_play_file, /* Play given file */ |
321 vtx_fmts /* ext assist */ | 335 vtx_fmts /* ext assist */ |
322 }; | 336 }; |
323 | 337 |
324 InputPlugin *vtx_iplist[] = { &vtx_ip, NULL }; | 338 InputPlugin *vtx_iplist[] = { &vtx_ip, NULL }; |
325 | 339 |
326 DECLARE_PLUGIN(vtx, NULL, NULL, vtx_iplist, NULL, NULL, NULL, NULL, NULL); | 340 DECLARE_PLUGIN(vtx, NULL, NULL, vtx_iplist, NULL, NULL, NULL, NULL); |