diff options
author | waker <wakeroid@gmail.com> | 2011-04-29 22:38:31 +0200 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-04-29 22:38:31 +0200 |
commit | 20627955d1184b5f07b8f7910a59f15cdc4802c8 (patch) | |
tree | afc2111b9d3be287d3e82dcc54b23f84c88e4183 /plugins | |
parent | cec677f6022983afbc144a52eff8a719a1086577 (diff) |
changed some API entry points to make it possible working with specific playlists, and not just the current one
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/aac/aac.c | 8 | ||||
-rw-r--r-- | plugins/adplug/adplug-db.cpp | 4 | ||||
-rw-r--r-- | plugins/adplug/plugin.c | 2 | ||||
-rw-r--r-- | plugins/ao/plugin.c | 4 | ||||
-rw-r--r-- | plugins/cdda/cdda.c | 10 | ||||
-rw-r--r-- | plugins/dca/dcaplug.c | 6 | ||||
-rw-r--r-- | plugins/dumb/cdumb.c | 4 | ||||
-rw-r--r-- | plugins/ffap/ffap.c | 8 | ||||
-rw-r--r-- | plugins/ffmpeg/ffmpeg.c | 6 | ||||
-rw-r--r-- | plugins/flac/flac.c | 8 | ||||
-rw-r--r-- | plugins/gme/cgme.c | 4 | ||||
-rw-r--r-- | plugins/m3u/m3u.c | 28 | ||||
-rw-r--r-- | plugins/mpgmad/mpgmad.c | 10 | ||||
-rw-r--r-- | plugins/musepack/musepack.c | 10 | ||||
-rw-r--r-- | plugins/shn/shn.c | 4 | ||||
-rw-r--r-- | plugins/sid/csid.cpp | 4 | ||||
-rw-r--r-- | plugins/sid/csid.h | 2 | ||||
-rw-r--r-- | plugins/sndfile/sndfile.c | 6 | ||||
-rw-r--r-- | plugins/tta/ttaplug.c | 8 | ||||
-rw-r--r-- | plugins/vorbis/vorbis.c | 10 | ||||
-rw-r--r-- | plugins/vtx/vtx.c | 4 | ||||
-rw-r--r-- | plugins/wavpack/wavpack.c | 8 | ||||
-rw-r--r-- | plugins/wildmidi/wildmidiplug.c | 4 |
23 files changed, 81 insertions, 81 deletions
diff --git a/plugins/aac/aac.c b/plugins/aac/aac.c index 95563f51..8027c612 100644 --- a/plugins/aac/aac.c +++ b/plugins/aac/aac.c @@ -1156,7 +1156,7 @@ aac_write_metadata (DB_playItem_t *it) { #endif static DB_playItem_t * -aac_insert (DB_playItem_t *after, const char *fname) { +aac_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { trace ("adding %s\n", fname); DB_FILE *fp = deadbeef->fopen (fname); if (!fp) { @@ -1284,7 +1284,7 @@ aac_insert (DB_playItem_t *after, const char *fname) { DB_playItem_t *cue = NULL; if (cuesheet) { - cue = deadbeef->pl_insert_cue_from_buffer (after, it, cuesheet, strlen (cuesheet), totalsamples, samplerate); + cue = deadbeef->plt_insert_cue_from_buffer (plt, after, it, cuesheet, strlen (cuesheet), totalsamples, samplerate); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); @@ -1294,7 +1294,7 @@ aac_insert (DB_playItem_t *after, const char *fname) { } deadbeef->pl_unlock (); - cue = deadbeef->pl_insert_cue (after, it, totalsamples, samplerate); + cue = deadbeef->plt_insert_cue (plt, after, it, totalsamples, samplerate); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); @@ -1304,7 +1304,7 @@ aac_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_add_meta (it, "title", NULL); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); return after; } diff --git a/plugins/adplug/adplug-db.cpp b/plugins/adplug/adplug-db.cpp index a25f3ffe..4b461ff1 100644 --- a/plugins/adplug/adplug-db.cpp +++ b/plugins/adplug/adplug-db.cpp @@ -241,7 +241,7 @@ adplug_add_meta (DB_playItem_t *it, const char *key, const char *value) { } DB_playItem_t * -adplug_insert (DB_playItem_t *after, const char *fname) { +adplug_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { // read information from the track // load/process cuesheet if exists // insert track into playlist @@ -285,7 +285,7 @@ adplug_insert (DB_playItem_t *after, const char *fname) { #endif deadbeef->pl_add_meta (it, "title", NULL); // insert - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); } diff --git a/plugins/adplug/plugin.c b/plugins/adplug/plugin.c index 4f2bb551..a89365f3 100644 --- a/plugins/adplug/plugin.c +++ b/plugins/adplug/plugin.c @@ -37,7 +37,7 @@ adplug_seek_sample (DB_fileinfo_t *, int sample); int adplug_seek (DB_fileinfo_t *, float time); DB_playItem_t * -adplug_insert (DB_playItem_t *after, const char *fname); +adplug_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname); int adplug_start (void); int diff --git a/plugins/ao/plugin.c b/plugins/ao/plugin.c index 6b489f45..8d5e6acb 100644 --- a/plugins/ao/plugin.c +++ b/plugins/ao/plugin.c @@ -205,7 +205,7 @@ aoplug_add_meta (DB_playItem_t *it, const char *key, const char *value, const ch } static DB_playItem_t * -aoplug_insert (DB_playItem_t *after, const char *fname) { +aoplug_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { DB_FILE *fp = deadbeef->fopen (fname); if (!fp) { trace ("psf: failed to fopen %s\n", fname); @@ -327,7 +327,7 @@ aoplug_insert (DB_playItem_t *after, const char *fname) { } deadbeef->pl_set_item_duration (it, duration+fade); deadbeef->pl_add_meta (it, "title", NULL); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); return after; } diff --git a/plugins/cdda/cdda.c b/plugins/cdda/cdda.c index 8bd8f296..6c4d6af7 100644 --- a/plugins/cdda/cdda.c +++ b/plugins/cdda/cdda.c @@ -303,7 +303,7 @@ resolve_disc (CdIo_t *cdio) } static DB_playItem_t * -insert_single_track (CdIo_t* cdio, DB_playItem_t *after, const char* file, int track_nr, int discid) +insert_single_track (CdIo_t* cdio, ddb_playlist_t *plt, DB_playItem_t *after, const char* file, int track_nr, int discid) { char tmp[file ? strlen (file) + 20 : 20]; if (file) @@ -330,7 +330,7 @@ insert_single_track (CdIo_t* cdio, DB_playItem_t *after, const char* file, int t deadbeef->pl_set_meta_int (it, ":CDIO_DISCID", discid); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); return after; } @@ -483,7 +483,7 @@ read_disc_cdtext (struct cddb_thread_params *params) } static DB_playItem_t * -cda_insert (DB_playItem_t *after, const char *fname) { +cda_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { trace ("CDA insert: %s\n", fname); CdIo_t* cdio = NULL; int track_nr; @@ -553,7 +553,7 @@ cda_insert (DB_playItem_t *after, const char *fname) { for (i = 0; i < tracks; i++) { trace ("inserting track %d\n", i); - res = insert_single_track (cdio, res, is_image ? fname : NULL, i+first_track, discid); + res = insert_single_track (cdio, plt, res, is_image ? fname : NULL, i+first_track, discid); if (res) { p->items[i] = res; } @@ -574,7 +574,7 @@ cda_insert (DB_playItem_t *after, const char *fname) { else { track_nr = atoi (shortname); - res = insert_single_track (cdio, after, NULL, track_nr, discid); + res = insert_single_track (cdio, plt, after, NULL, track_nr, discid); if (res) { read_track_cdtext (cdio, track_nr, res); deadbeef->pl_item_unref (res); diff --git a/plugins/dca/dcaplug.c b/plugins/dca/dcaplug.c index 6262d763..29f572e3 100644 --- a/plugins/dca/dcaplug.c +++ b/plugins/dca/dcaplug.c @@ -622,7 +622,7 @@ dts_seek (DB_fileinfo_t *_info, float time) { } static DB_playItem_t * -dts_insert (DB_playItem_t *after, const char *fname) { +dts_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { DB_FILE *fp = deadbeef->fopen (fname); if (!fp) { trace ("dca: failed to open %s\n", fname); @@ -690,7 +690,7 @@ dts_insert (DB_playItem_t *after, const char *fname) { // embedded cue DB_playItem_t *cue = NULL; - cue = deadbeef->pl_insert_cue (after, it, totalsamples, state.sample_rate); + cue = deadbeef->plt_insert_cue (plt, after, it, totalsamples, state.sample_rate); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); @@ -698,7 +698,7 @@ dts_insert (DB_playItem_t *after, const char *fname) { } deadbeef->pl_add_meta (it, "title", NULL); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); return after; diff --git a/plugins/dumb/cdumb.c b/plugins/dumb/cdumb.c index 03c9db94..dae92e77 100644 --- a/plugins/dumb/cdumb.c +++ b/plugins/dumb/cdumb.c @@ -791,7 +791,7 @@ cdumb_read_metadata (DB_playItem_t *it) { } static DB_playItem_t * -cdumb_insert (DB_playItem_t *after, const char *fname) { +cdumb_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { const char *ext = strrchr (fname, '.'); if (ext) { ext++; @@ -816,7 +816,7 @@ cdumb_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_set_item_duration (it, duh_get_length (duh)/65536.0f); deadbeef->pl_add_meta (it, ":FILETYPE", ftype); // printf ("duration: %f\n", _info->duration); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); unload_duh (duh); diff --git a/plugins/ffap/ffap.c b/plugins/ffap/ffap.c index 1dc98d72..99d965e2 100644 --- a/plugins/ffap/ffap.c +++ b/plugins/ffap/ffap.c @@ -1735,7 +1735,7 @@ error: } static DB_playItem_t * -ffap_insert (DB_playItem_t *after, const char *fname) { +ffap_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { APEContext ape_ctx; memset (&ape_ctx, 0, sizeof (ape_ctx)); DB_FILE *fp = deadbeef->fopen (fname); @@ -1786,7 +1786,7 @@ ffap_insert (DB_playItem_t *after, const char *fname) { const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet"); DB_playItem_t *cue = NULL; if (cuesheet) { - cue = deadbeef->pl_insert_cue_from_buffer (after, it, cuesheet, strlen (cuesheet), ape_ctx.totalsamples, ape_ctx.samplerate); + cue = deadbeef->plt_insert_cue_from_buffer (plt, after, it, cuesheet, strlen (cuesheet), ape_ctx.totalsamples, ape_ctx.samplerate); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); @@ -1809,7 +1809,7 @@ ffap_insert (DB_playItem_t *after, const char *fname) { snprintf (s, sizeof (s), "%d", br); deadbeef->pl_add_meta (it, ":BITRATE", s); - cue = deadbeef->pl_insert_cue (after, it, ape_ctx.totalsamples, ape_ctx.samplerate); + cue = deadbeef->plt_insert_cue (plt, after, it, ape_ctx.totalsamples, ape_ctx.samplerate); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); @@ -1818,7 +1818,7 @@ ffap_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_add_meta (it, "title", NULL); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); return after; diff --git a/plugins/ffmpeg/ffmpeg.c b/plugins/ffmpeg/ffmpeg.c index b212b3a3..e79a06d7 100644 --- a/plugins/ffmpeg/ffmpeg.c +++ b/plugins/ffmpeg/ffmpeg.c @@ -457,7 +457,7 @@ ffmpeg_read_metadata_internal (DB_playItem_t *it, AVFormatContext *fctx) { } static DB_playItem_t * -ffmpeg_insert (DB_playItem_t *after, const char *fname) { +ffmpeg_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { trace ("ffmpeg_insert %s\n", fname); // read information from the track // load/process cuesheet if exists @@ -569,14 +569,14 @@ ffmpeg_insert (DB_playItem_t *after, const char *fname) { av_close_input_file(fctx); // external cuesheet - DB_playItem_t *cue = deadbeef->pl_insert_cue (after, it, totalsamples, samplerate); + DB_playItem_t *cue = deadbeef->plt_insert_cue (plt, after, it, totalsamples, samplerate); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); return cue; } // now the track is ready, insert into playlist - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); return after; } diff --git a/plugins/flac/flac.c b/plugins/flac/flac.c index 678837b9..4e52cee2 100644 --- a/plugins/flac/flac.c +++ b/plugins/flac/flac.c @@ -605,7 +605,7 @@ cflac_init_metadata_callback(const FLAC__StreamDecoder *decoder, const FLAC__Str } static DB_playItem_t * -cflac_insert (DB_playItem_t *after, const char *fname) { +cflac_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { trace ("flac: inserting %s\n", fname); DB_playItem_t *it = NULL; FLAC__StreamDecoder *decoder = NULL; @@ -712,7 +712,7 @@ cflac_insert (DB_playItem_t *after, const char *fname) { // try embedded cue const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet"); if (cuesheet) { - DB_playItem_t *last = deadbeef->pl_insert_cue_from_buffer (after, it, cuesheet, strlen (cuesheet), info.totalsamples, info.info.fmt.samplerate); + DB_playItem_t *last = deadbeef->plt_insert_cue_from_buffer (plt, after, it, cuesheet, strlen (cuesheet), info.totalsamples, info.info.fmt.samplerate); if (last) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (last); @@ -721,7 +721,7 @@ cflac_insert (DB_playItem_t *after, const char *fname) { } // try external cue - DB_playItem_t *cue_after = deadbeef->pl_insert_cue (after, it, info.totalsamples, info.info.fmt.samplerate); + DB_playItem_t *cue_after = deadbeef->plt_insert_cue (plt, after, it, info.totalsamples, info.info.fmt.samplerate); if (cue_after) { if (info.file) { deadbeef->fclose (info.file); @@ -731,7 +731,7 @@ cflac_insert (DB_playItem_t *after, const char *fname) { trace ("flac: loaded external cuesheet\n"); return cue_after; } - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); if (info.file) { deadbeef->fclose (info.file); diff --git a/plugins/gme/cgme.c b/plugins/gme/cgme.c index dee03081..35070d7c 100644 --- a/plugins/gme/cgme.c +++ b/plugins/gme/cgme.c @@ -245,7 +245,7 @@ cgme_add_meta (DB_playItem_t *it, const char *key, const char *value) { } static DB_playItem_t * -cgme_insert (DB_playItem_t *after, const char *fname) { +cgme_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { Music_Emu *emu; trace ("gme_open_file %s\n", fname); @@ -351,7 +351,7 @@ cgme_insert (DB_playItem_t *after, const char *fname) { } } } - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); } else { diff --git a/plugins/m3u/m3u.c b/plugins/m3u/m3u.c index 18ed73c2..fae1f6c6 100644 --- a/plugins/m3u/m3u.c +++ b/plugins/m3u/m3u.c @@ -39,7 +39,7 @@ skipspaces (const uint8_t *p, const uint8_t *end) { } static DB_playItem_t * -load_m3u (DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_playItem_t *it, void *data), void *user_data) { +load_m3u (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_playItem_t *it, void *data), void *user_data) { printf ("load_m3u: cb=%p\n", cb); const char *slash = strrchr (fname, '/'); trace ("enter pl_insert_m3u\n"); @@ -121,13 +121,13 @@ load_m3u (DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_pla } static DB_playItem_t * -pls_insert_file (DB_playItem_t *after, const char *fname, const char *uri, int *pabort, int (*cb)(DB_playItem_t *it, void *data), void *user_data, const char *title, const char *length) { +pls_insert_file (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, const char *uri, int *pabort, int (*cb)(DB_playItem_t *it, void *data), void *user_data, const char *title, const char *length) { trace ("pls_insert_file uri: %s\n", uri); DB_playItem_t *it = NULL; const char *slash = NULL; if (strrchr (uri, '/')) { - it = deadbeef->pl_insert_file (after, uri, pabort, cb, user_data); + it = deadbeef->plt_insert_file (plt, after, uri, pabort, cb, user_data); } else if (slash = strrchr (fname, '/')) { int l = strlen (uri); @@ -135,10 +135,10 @@ pls_insert_file (DB_playItem_t *after, const char *fname, const char *uri, int * memcpy (fullpath, fname, slash - fname + 1); strcpy (fullpath + (slash - fname + 1), uri); trace ("pls_insert_file: adding file %s\n", fullpath); - it = deadbeef->pl_insert_file (after, fullpath, pabort, cb, user_data); + it = deadbeef->plt_insert_file (plt, after, fullpath, pabort, cb, user_data); } if (length[0]) { - deadbeef->pl_set_item_duration (it, atoi (length)); + deadbeef->plt_set_item_duration (plt, it, atoi (length)); } if (title[0]) { deadbeef->pl_replace_meta (it, "title", title); @@ -147,7 +147,7 @@ pls_insert_file (DB_playItem_t *after, const char *fname, const char *uri, int * } static DB_playItem_t * -load_pls (DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_playItem_t *it, void *data), void *user_data) { +load_pls (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_playItem_t *it, void *data), void *user_data) { const char *slash = strrchr (fname, '/'); DB_FILE *fp = deadbeef->fopen (fname); if (!fp) { @@ -204,7 +204,7 @@ load_pls (DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_pla int idx = atoi (p + 4); if (uri[0] && idx != lastidx && lastidx != -1) { trace ("uri%d\n", idx); - DB_playItem_t *it = pls_insert_file (after, fname, uri, pabort, cb, user_data, title, length); + DB_playItem_t *it = pls_insert_file (plt, after, fname, uri, pabort, cb, user_data, title, length); if (it) { after = it; } @@ -244,7 +244,7 @@ load_pls (DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_pla int idx = atoi (p + 5); if (uri[0] && idx != lastidx && lastidx != -1) { trace ("title%d\n", idx); - DB_playItem_t *it = pls_insert_file (after, fname, uri, pabort, cb, user_data, title, length); + DB_playItem_t *it = pls_insert_file (plt, after, fname, uri, pabort, cb, user_data, title, length); if (it) { after = it; } @@ -283,7 +283,7 @@ load_pls (DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_pla int idx = atoi (p + 6); if (uri[0] && idx != lastidx && lastidx != -1) { trace ("length%d\n", idx); - DB_playItem_t *it = pls_insert_file (after, fname, uri, pabort, cb, user_data, title, length); + DB_playItem_t *it = pls_insert_file (plt, after, fname, uri, pabort, cb, user_data, title, length); if (it) { after = it; } @@ -327,7 +327,7 @@ load_pls (DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_pla p = e; } if (uri[0]) { - DB_playItem_t *it = pls_insert_file (after, fname, uri, pabort, cb, user_data, title, length); + DB_playItem_t *it = pls_insert_file (plt, after, fname, uri, pabort, cb, user_data, title, length); if (it) { after = it; } @@ -340,7 +340,7 @@ load_pls (DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_pla } static DB_playItem_t * -m3uplug_load (DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_playItem_t *it, void *data), void *user_data) { +m3uplug_load (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB_playItem_t *it, void *data), void *user_data) { const char *ext = strrchr (fname, '.'); if (!ext) { return NULL; @@ -348,10 +348,10 @@ m3uplug_load (DB_playItem_t *after, const char *fname, int *pabort, int (*cb)(DB ext++; if (!strcasecmp (ext, "m3u") || !strcasecmp (ext, "m3u8")) { - return load_m3u (after, fname, pabort, cb, user_data); + return load_m3u (plt, after, fname, pabort, cb, user_data); } else if (!strcasecmp (ext, "pls")) { - return load_pls (after, fname, pabort, cb, user_data); + return load_pls (plt, after, fname, pabort, cb, user_data); } return NULL; @@ -428,7 +428,7 @@ m3uplug_save_pls (const char *fname, DB_playItem_t *first, DB_playItem_t *last) } int -m3uplug_save (const char *fname, DB_playItem_t *first, DB_playItem_t *last) { +m3uplug_save (ddb_playlist_t *plt, const char *fname, DB_playItem_t *first, DB_playItem_t *last) { const char *e = strrchr (fname, '.'); if (!e) { return -1; diff --git a/plugins/mpgmad/mpgmad.c b/plugins/mpgmad/mpgmad.c index 4354d3c8..e0d806b8 100644 --- a/plugins/mpgmad/mpgmad.c +++ b/plugins/mpgmad/mpgmad.c @@ -1299,7 +1299,7 @@ cmp3_seek (DB_fileinfo_t *_info, float time) { } static DB_playItem_t * -cmp3_insert (DB_playItem_t *after, const char *fname) { +cmp3_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { trace ("cmp3_insert %s\n", fname); DB_FILE *fp = deadbeef->fopen (fname); if (!fp) { @@ -1311,7 +1311,7 @@ cmp3_insert (DB_playItem_t *after, const char *fname) { deadbeef->fclose (fp); deadbeef->pl_add_meta (it, "title", NULL); deadbeef->pl_set_item_duration (it, -1); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); return after; } @@ -1347,18 +1347,18 @@ cmp3_insert (DB_playItem_t *after, const char *fname) { buffer.it = it; cmp3_set_extra_properties (&buffer); - deadbeef->pl_set_item_duration (it, buffer.duration); + deadbeef->plt_set_item_duration (plt, it, buffer.duration); deadbeef->fclose (fp); // FIXME! bad numsamples passed to cue - DB_playItem_t *cue_after = deadbeef->pl_insert_cue (after, it, buffer.totalsamples-buffer.delay-buffer.padding, buffer.samplerate); + DB_playItem_t *cue_after = deadbeef->plt_insert_cue (plt, after, it, buffer.totalsamples-buffer.delay-buffer.padding, buffer.samplerate); if (cue_after) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue_after); return cue_after; } - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); return after; } diff --git a/plugins/musepack/musepack.c b/plugins/musepack/musepack.c index e6b22c00..68f93013 100644 --- a/plugins/musepack/musepack.c +++ b/plugins/musepack/musepack.c @@ -319,7 +319,7 @@ mpc_set_trk_properties (DB_playItem_t *it, mpc_streaminfo *si, int64_t fsize) { } static DB_playItem_t * -musepack_insert (DB_playItem_t *after, const char *fname) { +musepack_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { trace ("mpc: inserting %s\n", fname); mpc_reader reader = { .read = musepack_vfs_read, @@ -417,7 +417,7 @@ musepack_insert (DB_playItem_t *after, const char *fname) { mpc_set_trk_properties (it, &si, fsize); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); prev = it; deadbeef->pl_item_unref (it); } @@ -448,7 +448,7 @@ musepack_insert (DB_playItem_t *after, const char *fname) { const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet"); DB_playItem_t *cue = NULL; if (cuesheet) { - cue = deadbeef->pl_insert_cue_from_buffer (after, it, cuesheet, strlen (cuesheet), totalsamples, si.sample_freq); + cue = deadbeef->plt_insert_cue_from_buffer (plt, after, it, cuesheet, strlen (cuesheet), totalsamples, si.sample_freq); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); @@ -461,7 +461,7 @@ musepack_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_unlock (); mpc_set_trk_properties (it, &si, fsize); - cue = deadbeef->pl_insert_cue (after, it, totalsamples, si.sample_freq); + cue = deadbeef->plt_insert_cue (plt, after, it, totalsamples, si.sample_freq); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); @@ -472,7 +472,7 @@ musepack_insert (DB_playItem_t *after, const char *fname) { } deadbeef->pl_add_meta (it, "title", NULL); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); mpc_demux_exit (demux); diff --git a/plugins/shn/shn.c b/plugins/shn/shn.c index 04b00575..c8e0a773 100644 --- a/plugins/shn/shn.c +++ b/plugins/shn/shn.c @@ -860,7 +860,7 @@ shn_seek (DB_fileinfo_t *_info, float time) { } DB_playItem_t * -shn_insert (DB_playItem_t *after, const char *fname) { +shn_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { shn_file *tmp_file; DB_FILE *f; char data[4]; @@ -918,7 +918,7 @@ shn_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_add_meta (it, ":BITRATE", s); deadbeef->pl_add_meta (it, "title", NULL); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); return after; } diff --git a/plugins/sid/csid.cpp b/plugins/sid/csid.cpp index 20293812..569c1083 100644 --- a/plugins/sid/csid.cpp +++ b/plugins/sid/csid.cpp @@ -444,7 +444,7 @@ convstr (const char* str) { } extern "C" DB_playItem_t * -csid_insert (DB_playItem_t *after, const char *fname) { +csid_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { trace ("inserting %s\n", fname); sldb_load (); SidTune *tune; @@ -569,7 +569,7 @@ csid_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_set_item_duration (it, length); deadbeef->pl_add_meta (it, ":FILETYPE", "SID"); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); } } diff --git a/plugins/sid/csid.h b/plugins/sid/csid.h index 66ad0ff5..e40f8c69 100644 --- a/plugins/sid/csid.h +++ b/plugins/sid/csid.h @@ -28,7 +28,7 @@ int csid_init (DB_fileinfo_t *_info, DB_playItem_t *it); void csid_free (DB_fileinfo_t *); int csid_read (DB_fileinfo_t *, char *bytes, int size); int csid_seek (DB_fileinfo_t *, float time); -DB_playItem_t *csid_insert (DB_playItem_t *after, const char *fname); +DB_playItem_t *csid_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname); int csid_numvoices (DB_fileinfo_t *); void csid_mutevoice (DB_fileinfo_t *, int voice, int mute); int csid_start (void); diff --git a/plugins/sndfile/sndfile.c b/plugins/sndfile/sndfile.c index e8a6231e..259fdfd6 100644 --- a/plugins/sndfile/sndfile.c +++ b/plugins/sndfile/sndfile.c @@ -294,7 +294,7 @@ sndfile_seek (DB_fileinfo_t *_info, float sec) { } static DB_playItem_t * -sndfile_insert (DB_playItem_t *after, const char *fname) { +sndfile_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { SF_INFO inf; sndfile_info_t info; memset (&info, 0, sizeof (info)); @@ -355,7 +355,7 @@ sndfile_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_add_meta (it, ":BITRATE", s); - DB_playItem_t *cue_after = deadbeef->pl_insert_cue (after, it, totalsamples, samplerate); + DB_playItem_t *cue_after = deadbeef->plt_insert_cue (plt, after, it, totalsamples, samplerate); if (cue_after) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue_after); @@ -363,7 +363,7 @@ sndfile_insert (DB_playItem_t *after, const char *fname) { } deadbeef->pl_add_meta (it, "title", NULL); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); return after; diff --git a/plugins/tta/ttaplug.c b/plugins/tta/ttaplug.c index 95bac3c5..30f7fc38 100644 --- a/plugins/tta/ttaplug.c +++ b/plugins/tta/ttaplug.c @@ -178,7 +178,7 @@ tta_seek (DB_fileinfo_t *_info, float time) { } static DB_playItem_t * -tta_insert (DB_playItem_t *after, const char *fname) { +tta_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { tta_info tta; if (open_tta_file (fname, &tta, 0) != 0) { fprintf (stderr, "tta: failed to open %s\n", fname); @@ -213,7 +213,7 @@ tta_insert (DB_playItem_t *after, const char *fname) { const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet"); DB_playItem_t *cue = NULL; if (cuesheet) { - cue = deadbeef->pl_insert_cue_from_buffer (after, it, cuesheet, strlen (cuesheet), totalsamples, tta.SAMPLERATE); + cue = deadbeef->plt_insert_cue_from_buffer (plt, after, it, cuesheet, strlen (cuesheet), totalsamples, tta.SAMPLERATE); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); @@ -235,7 +235,7 @@ tta_insert (DB_playItem_t *after, const char *fname) { snprintf (s, sizeof (s), "%d", tta.BITRATE); deadbeef->pl_add_meta (it, ":BITRATE", s); - cue = deadbeef->pl_insert_cue (after, it, totalsamples, tta.SAMPLERATE); + cue = deadbeef->plt_insert_cue (plt, after, it, totalsamples, tta.SAMPLERATE); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); @@ -243,7 +243,7 @@ tta_insert (DB_playItem_t *after, const char *fname) { } deadbeef->pl_add_meta (it, "title", NULL); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); return after; diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c index 5f94a474..07630735 100644 --- a/plugins/vorbis/vorbis.c +++ b/plugins/vorbis/vorbis.c @@ -451,7 +451,7 @@ cvorbis_seek (DB_fileinfo_t *_info, float time) { } static DB_playItem_t * -cvorbis_insert (DB_playItem_t *after, const char *fname) { +cvorbis_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { // check for validity DB_FILE *fp = deadbeef->fopen (fname); if (!fp) { @@ -464,7 +464,7 @@ cvorbis_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_add_meta (it, ":FILETYPE", "OggVorbis"); deadbeef->pl_set_item_duration (it, -1); deadbeef->pl_add_meta (it, "title", NULL); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); deadbeef->fclose (fp); return after; @@ -525,7 +525,7 @@ cvorbis_insert (DB_playItem_t *after, const char *fname) { if (nstreams == 1) { - DB_playItem_t *cue = deadbeef->pl_insert_cue (after, it, totalsamples, samplerate); + DB_playItem_t *cue = deadbeef->plt_insert_cue (plt, after, it, totalsamples, samplerate); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); @@ -536,7 +536,7 @@ cvorbis_insert (DB_playItem_t *after, const char *fname) { // embedded cue const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet"); if (cuesheet) { - cue = deadbeef->pl_insert_cue_from_buffer (after, it, cuesheet, strlen (cuesheet), totalsamples, samplerate); + cue = deadbeef->plt_insert_cue_from_buffer (plt, after, it, cuesheet, strlen (cuesheet), totalsamples, samplerate); if (cue) { deadbeef->pl_item_unref (it); deadbeef->pl_item_unref (cue); @@ -549,7 +549,7 @@ cvorbis_insert (DB_playItem_t *after, const char *fname) { currentsample += totalsamples; } - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); } ov_clear (&vorbis_file); diff --git a/plugins/vtx/vtx.c b/plugins/vtx/vtx.c index 891caec3..a24da110 100644 --- a/plugins/vtx/vtx.c +++ b/plugins/vtx/vtx.c @@ -228,7 +228,7 @@ vtx_seek (DB_fileinfo_t *_info, float time) { } static DB_playItem_t * -vtx_insert (DB_playItem_t *after, const char *fname) { +vtx_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { // read information from the track // load/process cuesheet if exists // insert track into playlist @@ -271,7 +271,7 @@ vtx_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_add_meta (it, "album", hdr->from); ayemu_vtx_free (hdr); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); return after; } diff --git a/plugins/wavpack/wavpack.c b/plugins/wavpack/wavpack.c index 1f3dd130..01f218f2 100644 --- a/plugins/wavpack/wavpack.c +++ b/plugins/wavpack/wavpack.c @@ -275,7 +275,7 @@ wv_seek (DB_fileinfo_t *_info, float sec) { } static DB_playItem_t * -wv_insert (DB_playItem_t *after, const char *fname) { +wv_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { DB_FILE *fp = deadbeef->fopen (fname); if (!fp) { return NULL; @@ -339,7 +339,7 @@ wv_insert (DB_playItem_t *after, const char *fname) { const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet"); if (cuesheet) { trace ("found cuesheet: %s\n", cuesheet); - DB_playItem_t *last = deadbeef->pl_insert_cue_from_buffer (after, it, cuesheet, strlen (cuesheet), totalsamples, samplerate); + DB_playItem_t *last = deadbeef->plt_insert_cue_from_buffer (plt, after, it, cuesheet, strlen (cuesheet), totalsamples, samplerate); if (last) { deadbeef->fclose (fp); WavpackCloseFile (ctx); @@ -349,7 +349,7 @@ wv_insert (DB_playItem_t *after, const char *fname) { } } // cue file on disc - DB_playItem_t *cue_after = deadbeef->pl_insert_cue (after, it, totalsamples, samplerate); + DB_playItem_t *cue_after = deadbeef->plt_insert_cue (plt, after, it, totalsamples, samplerate); if (cue_after) { deadbeef->fclose (fp); WavpackCloseFile (ctx); @@ -358,7 +358,7 @@ wv_insert (DB_playItem_t *after, const char *fname) { return cue_after; } - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); deadbeef->fclose (fp); diff --git a/plugins/wildmidi/wildmidiplug.c b/plugins/wildmidi/wildmidiplug.c index 5ddb3c97..0db8b525 100644 --- a/plugins/wildmidi/wildmidiplug.c +++ b/plugins/wildmidi/wildmidiplug.c @@ -107,7 +107,7 @@ wmidi_seek (DB_fileinfo_t *_info, float time) { } DB_playItem_t * -wmidi_insert (DB_playItem_t *after, const char *fname) { +wmidi_insert (ddb_playlist_t *plt, DB_playItem_t *after, const char *fname) { DB_playItem_t *it = NULL; midi *m = WildMidi_Open (fname); @@ -121,7 +121,7 @@ wmidi_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_add_meta (it, "title", NULL); deadbeef->pl_set_item_duration (it, inf->approx_total_samples / 44100.f); deadbeef->pl_add_meta (it, ":FILETYPE", "MID"); - after = deadbeef->pl_insert_item (after, it); + after = deadbeef->plt_insert_item (plt, after, it); deadbeef->pl_item_unref (it); WildMidi_Close (m); return after; |