summaryrefslogtreecommitdiff
path: root/cgme.c
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-29 21:57:44 +0100
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-01-29 21:57:44 +0100
commitbfcb81908a5fa4018838b7ad90016efd5e17250a (patch)
tree723facedcfbc7469fcfbf58ab4e9766d2a75d134 /cgme.c
parent35ccc1dc4a3e98bd10882bab72fcb22414ab4ac2 (diff)
added configurable gme song playtime
Diffstat (limited to 'cgme.c')
-rw-r--r--cgme.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/cgme.c b/cgme.c
index 7a4e5332..0f72db80 100644
--- a/cgme.c
+++ b/cgme.c
@@ -145,7 +145,8 @@ cgme_insert (DB_playItem_t *after, const char *fname) {
snprintf (trk, 10, "%d", i+1);
deadbeef->pl_add_meta (it, "track", trk);
if (inf.length == -1) {
- deadbeef->pl_set_item_duration (it, 300);
+ float songlength = deadbeef->conf_get_float ("gme.songlength", 3);
+ deadbeef->pl_set_item_duration (it, songlength * 60.f);
}
else {
deadbeef->pl_set_item_duration (it, (float)inf.length/1000.f);
@@ -203,6 +204,20 @@ cgme_mutevoice (int voice, int mute) {
}
#endif
+static int
+cgme_start (void) {
+ return 0;
+}
+
+static int
+cgme_stop (void) {
+ return 0;
+}
+
+static const char settings_dlg[] =
+ "property \"Max song length (in minutes)\" entry gme.songlength 3;\n"
+;
+
// define plugin interface
static DB_decoder_t plugin = {
DB_PLUGIN_SET_API_VERSION
@@ -214,6 +229,9 @@ static DB_decoder_t plugin = {
.plugin.author = "Alexey Yakovenko",
.plugin.email = "waker@users.sourceforge.net",
.plugin.website = "http://deadbeef.sf.net",
+ .plugin.start = cgme_start,
+ .plugin.stop = cgme_stop,
+ .plugin.configdialog = settings_dlg,
.init = cgme_init,
.free = cgme_free,
.read_int16 = cgme_read,