diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2009-11-29 15:56:37 +0100 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2009-11-29 15:56:37 +0100 |
commit | 5ddc0764e33e948869623381bf115b3fc2c5be0d (patch) | |
tree | 3ee4d235a6d0dd4062a67ea00db80371e5f996b0 /plugins | |
parent | 0c68fb081fd86c35b3f69cafdeebd555934eeba0 (diff) | |
parent | b0842cab06bfe598487c8f1b744c526850a98314 (diff) |
Merge branch 'master' into guiplug
Conflicts:
main.c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ffap/ffap.c | 21 | ||||
-rw-r--r-- | plugins/gtkui/gtkplaylist.c | 3 | ||||
-rw-r--r-- | plugins/gtkui/gtkui.c | 3 | ||||
-rw-r--r-- | plugins/wavpack/wavpack.c | 11 |
4 files changed, 33 insertions, 5 deletions
diff --git a/plugins/ffap/ffap.c b/plugins/ffap/ffap.c index 993863ed..8db1ad56 100644 --- a/plugins/ffap/ffap.c +++ b/plugins/ffap/ffap.c @@ -38,8 +38,8 @@ #define ENABLE_DEBUG 0 -#define trace(...) { fprintf(stderr, __VA_ARGS__); } -//#define trace(fmt,...) +//#define trace(...) { fprintf(stderr, __VA_ARGS__); } +#define trace(fmt,...) static DB_decoder_t plugin; static DB_functions_t *deadbeef; @@ -1645,7 +1645,7 @@ ffap_insert (DB_playItem_t *after, const char *fname) { } float duration = ape_ctx.totalsamples / (float)ape_ctx.samplerate; - DB_playItem_t *it; + DB_playItem_t *it = NULL; it = deadbeef->pl_insert_cue (after, fname, &plugin, "APE", ape_ctx.totalsamples, ape_ctx.samplerate); if (it) { deadbeef->fclose (fp); @@ -1668,10 +1668,23 @@ ffap_insert (DB_playItem_t *after, const char *fname) { deadbeef->fseek (fp, 0, SEEK_END); } int apeerr = deadbeef->junk_read_ape (it, fp); + + deadbeef->fclose (fp); + + // embedded cue + const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet"); + if (cuesheet) { + DB_playItem_t *last = deadbeef->pl_insert_cue_from_buffer (after, fname, cuesheet, strlen (cuesheet), &plugin, plugin.filetypes[0], ape_ctx.totalsamples, ape_ctx.samplerate); + if (last) { + deadbeef->pl_item_free (it); + ape_free_ctx (&ape_ctx); + return last; + } + } + deadbeef->pl_add_meta (it, "title", NULL); after = deadbeef->pl_insert_item (after, it); - deadbeef->fclose (fp); ape_free_ctx (&ape_ctx); return after; } diff --git a/plugins/gtkui/gtkplaylist.c b/plugins/gtkui/gtkplaylist.c index 7f5e9178..ed8eed6f 100644 --- a/plugins/gtkui/gtkplaylist.c +++ b/plugins/gtkui/gtkplaylist.c @@ -1402,6 +1402,7 @@ gtkpl_header_draw (gtkplaylist_t *ps) { // fill background //gdk_draw_rectangle (ps->backbuf_header, widget->style->bg_gc[0], TRUE, -10, -10, widget->allocation.width+20, widget->allocation.height+20); gtk_paint_box (widget->style, ps->backbuf_header, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, NULL, detail, -10, -10, widget->allocation.width+20, widget->allocation.height+20); + gdk_draw_line (ps->backbuf_header, widget->style->mid_gc[GTK_STATE_NORMAL], 0, widget->allocation.height-1, widget->allocation.width, widget->allocation.height-1); draw_begin ((uintptr_t)ps->backbuf_header); x = -ps->hscrollpos; gtkpl_column_t *c; @@ -1463,7 +1464,7 @@ gtkpl_header_draw (gtkplaylist_t *ps) { } if (w > 0) { gtk_paint_box (widget->style, ps->backbuf_header, GTK_STATE_SELECTED, GTK_SHADOW_OUT, NULL, NULL, "button", x, 0, w, h); - GdkColor *gdkfg = &widget->style->fg[0]; + GdkColor *gdkfg = &widget->style->fg[GTK_STATE_SELECTED]; float fg[3] = {(float)gdkfg->red/0xffff, (float)gdkfg->green/0xffff, (float)gdkfg->blue/0xffff}; draw_set_fg_color (fg); draw_text (x + 5, h/2-draw_get_font_size()/2, c->width-10, 0, c->title); diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c index 5e7f5a2d..0320c232 100644 --- a/plugins/gtkui/gtkui.c +++ b/plugins/gtkui/gtkui.c @@ -204,6 +204,9 @@ on_trayicon_button_press_event (GtkWidget *widget, gtk_window_present (GTK_WINDOW (mainwin)); } } + else if (event->button == 2) { + messagepump_push (M_PAUSESONG, 0, 0, 0); + } return FALSE; } diff --git a/plugins/wavpack/wavpack.c b/plugins/wavpack/wavpack.c index 5400a600..cdb26776 100644 --- a/plugins/wavpack/wavpack.c +++ b/plugins/wavpack/wavpack.c @@ -243,6 +243,17 @@ wv_insert (DB_playItem_t *after, const char *fname) { trace ("wv: id3v1 tag found\n"); } deadbeef->fclose (fp); + + // embedded cue + const char *cuesheet = deadbeef->pl_find_meta (it, "cuesheet"); + if (cuesheet) { + DB_playItem_t *last = deadbeef->pl_insert_cue_from_buffer (after, fname, cuesheet, strlen (cuesheet), &plugin, plugin.filetypes[0], totalsamples, samplerate); + if (last) { + deadbeef->pl_item_free (it); + return last; + } + } + deadbeef->pl_add_meta (it, "title", NULL); after = deadbeef->pl_insert_item (after, it); |