summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-03-09 18:59:43 +0100
committerGravatar waker <wakeroid@gmail.com>2011-03-09 18:59:43 +0100
commitc779e656a626088d2cd5aff9b12ace39ea3c3559 (patch)
treedca24b9894a4c545432ecd13870cc8721966dcf2 /plugins
parent9d67fd87c68b325f52505a464df7a7748414b04f (diff)
fixed all plugins for the API changes
Diffstat (limited to 'plugins')
-rw-r--r--plugins/ao/plugin.c12
-rw-r--r--plugins/converter/converter.c2
-rw-r--r--plugins/converter/convgui.c2
-rw-r--r--plugins/dumb/cdumb.c12
-rw-r--r--plugins/shn/shn.c12
5 files changed, 17 insertions, 23 deletions
diff --git a/plugins/ao/plugin.c b/plugins/ao/plugin.c
index b64108df..77eba78c 100644
--- a/plugins/ao/plugin.c
+++ b/plugins/ao/plugin.c
@@ -67,9 +67,9 @@ aoplug_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
_info->plugin = &plugin;
info->duration = deadbeef->pl_get_item_duration (it);
- DB_FILE *file = deadbeef->fopen (it->fname);
+ DB_FILE *file = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI"));
if (!file) {
- trace ("psf: failed to fopen %s\n", it->fname);
+ trace ("psf: failed to fopen %s\n", deadbeef->pl_find_meta (it, ":URI"));
return -1;
}
@@ -82,7 +82,7 @@ aoplug_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
}
if (deadbeef->fread(info->filebuffer, 1, info->filesize, file) != info->filesize) {
- fprintf(stderr, "psf: file read error: %s\n", it->fname);
+ fprintf(stderr, "psf: file read error: %s\n", deadbeef->pl_find_meta (it, ":URI"));
deadbeef->fclose (file);
return -1;
}
@@ -94,7 +94,7 @@ aoplug_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
return -1;
}
- info->decoder = ao_start (info->type, it->fname, (uint8 *)info->filebuffer, info->filesize);
+ info->decoder = ao_start (info->type, deadbeef->pl_find_meta (it, ":URI"), (uint8 *)info->filebuffer, info->filesize);
if (!info->decoder) {
fprintf (stderr, "psf: ao_start failed\n");
return -1;
@@ -251,9 +251,7 @@ aoplug_insert (DB_playItem_t *after, const char *fname) {
free (buffer);
- DB_playItem_t *it = deadbeef->pl_item_alloc ();
- it->decoder_id = deadbeef->plug_get_decoder_id (plugin.plugin.id);
- it->fname = strdup (fname);
+ DB_playItem_t *it = deadbeef->pl_item_alloc_init (fname, plugin.plugin.id);
const char *ext = fname + strlen (fname);
while (*ext != '.' && ext > fname) {
ext--;
diff --git a/plugins/converter/converter.c b/plugins/converter/converter.c
index 611f5af0..47b9eb9b 100644
--- a/plugins/converter/converter.c
+++ b/plugins/converter/converter.c
@@ -552,7 +552,7 @@ convert (DB_playItem_t *it, const char *outfolder, int selected_format, ddb_enco
DB_fileinfo_t *fileinfo = NULL;
char out[PATH_MAX] = ""; // full path to output file
char input_file_name[PATH_MAX] = "";
- dec = (DB_decoder_t *)deadbeef->plug_get_for_id (it->decoder_id);
+ dec = (DB_decoder_t *)deadbeef->plug_get_for_id (deadbeef->pl_find_meta (it, ":DECODER"));
if (dec) {
fileinfo = dec->open (0);
if (fileinfo && dec->init (fileinfo, DB_PLAYITEM (it)) != 0) {
diff --git a/plugins/converter/convgui.c b/plugins/converter/convgui.c
index 9ccf9299..3d82c4cf 100644
--- a/plugins/converter/convgui.c
+++ b/plugins/converter/convgui.c
@@ -96,7 +96,7 @@ converter_worker (void *ctx) {
update_progress_info_t *info = malloc (sizeof (update_progress_info_t));
info->entry = conv->progress_entry;
g_object_ref (info->entry);
- info->text = strdup (conv->convert_items[n]->fname);
+ info->text = strdup (deadbeef->pl_find_meta (conv->convert_items[n], ":URI"));
g_idle_add (update_progress_cb, info);
converter_plugin->convert (conv->convert_items[n], conv->outfolder, conv->selected_format, conv->encoder_preset, conv->dsp_preset, &conv->cancelled);
diff --git a/plugins/dumb/cdumb.c b/plugins/dumb/cdumb.c
index 1bbd71c2..bf3780cb 100644
--- a/plugins/dumb/cdumb.c
+++ b/plugins/dumb/cdumb.c
@@ -59,18 +59,18 @@ cdumb_open (uint32_t hints) {
static int
cdumb_init (DB_fileinfo_t *_info, DB_playItem_t *it) {
- trace ("cdumb_init %s\n", it->fname);
+ trace ("cdumb_init %s\n", deadbeef->pl_find_meta (it, ":URI"));
dumb_info_t *info = (dumb_info_t *)_info;
int start_order = 0;
int is_dos, is_it;
- const char *ext = it->fname + strlen (it->fname) - 1;
- while (*ext != '.' && ext > it->fname) {
+ const char *ext = deadbeef->pl_find_meta (it, ":URI") + strlen (deadbeef->pl_find_meta (it, ":URI")) - 1;
+ while (*ext != '.' && ext > deadbeef->pl_find_meta (it, ":URI")) {
ext--;
}
ext++;
const char *ftype;
- info->duh = open_module(it->fname, ext, &start_order, &is_it, &is_dos, &ftype);
+ info->duh = open_module(deadbeef->pl_find_meta (it, ":URI"), ext, &start_order, &is_it, &is_dos, &ftype);
dumb_it_do_initial_runthrough (info->duh);
@@ -734,9 +734,7 @@ cdumb_insert (DB_playItem_t *after, const char *fname) {
if (!duh) {
return NULL;
}
- DB_playItem_t *it = deadbeef->pl_item_alloc ();
- it->decoder_id = deadbeef->plug_get_decoder_id (plugin.plugin.id);
- it->fname = strdup (fname);
+ DB_playItem_t *it = deadbeef->pl_item_alloc_init (fname, plugin.plugin.id);
DUMB_IT_SIGDATA * itsd = duh_get_it_sigdata(duh);
if (itsd->name[0]) {
int tl = sizeof(itsd->name);
diff --git a/plugins/shn/shn.c b/plugins/shn/shn.c
index 5baf8a30..7d33de5e 100644
--- a/plugins/shn/shn.c
+++ b/plugins/shn/shn.c
@@ -321,9 +321,9 @@ shn_init(DB_fileinfo_t *_info, DB_playItem_t *it) {
char data[4];
DB_FILE *f;
- f = deadbeef->fopen (it->fname);
+ f = deadbeef->fopen (deadbeef->pl_find_meta (it, ":URI"));
if (!f) {
- trace ("shn: failed to open %s\n", it->fname);
+ trace ("shn: failed to open %s\n", deadbeef->pl_find_meta (it, ":URI"));
return -1;
}
@@ -335,7 +335,7 @@ shn_init(DB_fileinfo_t *_info, DB_playItem_t *it) {
if (deadbeef->fread((void *)data,1,4,f) != 4)
{
deadbeef->fclose(f);
- trace ("shn: failed to read magic from %s\n", it->fname);
+ trace ("shn: failed to read magic from %s\n", deadbeef->pl_find_meta (it, ":URI"));
return -1;
}
deadbeef->fclose(f);
@@ -345,7 +345,7 @@ shn_init(DB_fileinfo_t *_info, DB_playItem_t *it) {
return -1;
}
- if (!(info->shnfile = load_shn(it->fname))) {
+ if (!(info->shnfile = load_shn(deadbeef->pl_find_meta (it, ":URI")))) {
trace ("shn: load_shn failed\n");
return -1;
}
@@ -893,9 +893,7 @@ shn_insert (DB_playItem_t *after, const char *fname) {
return NULL;
}
- DB_playItem_t *it = deadbeef->pl_item_alloc ();
- it->decoder_id = deadbeef->plug_get_decoder_id (plugin.plugin.id);
- it->fname = strdup (fname);
+ DB_playItem_t *it = deadbeef->pl_item_alloc_init (fname, plugin.plugin.id);
it->filetype = "Shorten";
deadbeef->pl_set_item_duration (it, tmp_file->wave_header.length);