summaryrefslogtreecommitdiff
path: root/plugins/adplug
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-03-09 11:38:38 +0100
committerGravatar waker <wakeroid@gmail.com>2011-03-09 11:38:38 +0100
commit2d0b00f6bbd326790c053961ccec07106cb172c7 (patch)
treea4ffb39b2a5d1c9a80aa2ba79f885d0d20667df8 /plugins/adplug
parentfb269bc2b4cbbe6b457b46588d39ace1c021e3f1 (diff)
moved most of track properties from playItem struct to metadata
implemented track properties with multiple selection
Diffstat (limited to 'plugins/adplug')
-rw-r--r--plugins/adplug/adplug-db.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/plugins/adplug/adplug-db.cpp b/plugins/adplug/adplug-db.cpp
index 1f096727..973da0da 100644
--- a/plugins/adplug/adplug-db.cpp
+++ b/plugins/adplug/adplug-db.cpp
@@ -82,13 +82,13 @@ adplug_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
int channels = 2;
info->opl = new CEmuopl (samplerate, bps == 16 ? true : false, channels == 2);
// opl->settype (Copl::TYPE_OPL2);
- info->decoder = CAdPlug::factory (it->fname, info->opl, CAdPlug::players);
+ info->decoder = CAdPlug::factory (deadbeef->pl_find_meta (it, ":URI"), info->opl, CAdPlug::players);
if (!info->decoder) {
- trace ("adplug: failed to open %s\n", it->fname);
+ trace ("adplug: failed to open %s\n", deadbeef->pl_find_meta (it, ":URI"));
return -1;
}
- info->subsong = it->tracknum;
+ info->subsong = deadbeef->pl_find_meta_int (it, ":TRACKNUM", 0);
info->decoder->rewind (info->subsong);
float dur = deadbeef->pl_get_item_duration (it);
info->totalsamples = dur * samplerate;
@@ -264,11 +264,9 @@ adplug_insert (DB_playItem_t *after, const char *fname) {
if (dur < 0.1) {
continue;
}
- DB_playItem_t *it = deadbeef->pl_item_alloc ();
- it->decoder_id = deadbeef->plug_get_decoder_id (adplug_plugin.plugin.id);
- it->fname = strdup (fname);
+ DB_playItem_t *it = deadbeef->pl_item_alloc_init (fname, adplug_plugin.plugin.id);
it->filetype = adplug_get_extension (fname);
- it->tracknum = i;
+ deadbeef->pl_set_meta_int (it, ":TRACKNUM", i);
deadbeef->pl_set_item_duration (it, dur);
#if 0
// add metainfo