Mercurial > audlegacy-plugins
diff 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 |
line wrap: on
line diff
--- a/src/vtx/vtx.c Sat Aug 04 21:37:11 2007 +0200 +++ b/src/vtx/vtx.c Sat Aug 04 22:07:08 2007 +0200 @@ -22,6 +22,7 @@ #include <audacious/output.h> #include <audacious/util.h> #include <audacious/titlestring.h> +#include <audacious/configdb.h> #include <audacious/vfs.h> #include <audacious/strings.h> #include <audacious/i18n.h> @@ -56,6 +57,19 @@ static gchar *vtx_fmts[] = { "vtx", NULL }; +void +vtx_init(void) +{ + ConfigDb *db; + db = bmp_cfg_db_open(); + + bmp_cfg_db_get_int(db, NULL, "src_rate", &freq); + if (freq < 4000 || freq > 192000) + freq = 44100; + + bmp_cfg_db_close(db); +} + int vtx_is_our_fd (char *filename, VFSFile *fp) { @@ -293,8 +307,8 @@ InputPlugin vtx_ip = { NULL, /* FILLED BY XMMS */ NULL, /* FILLED BY XMMS */ - "VTX Audio Plugin", /* Plugin description */ - NULL, /* Initialization */ + "VTX Audio Plugin", /* Plugin description */ + vtx_init, /* Initialization */ vtx_about, /* Show aboutbox */ vtx_config, /* Show/edit configuration */ vtx_is_our_file, /* Check file, return 1 if the plugin can handle this file */ @@ -323,4 +337,4 @@ InputPlugin *vtx_iplist[] = { &vtx_ip, NULL }; -DECLARE_PLUGIN(vtx, NULL, NULL, vtx_iplist, NULL, NULL, NULL, NULL, NULL); +DECLARE_PLUGIN(vtx, NULL, NULL, vtx_iplist, NULL, NULL, NULL, NULL);