diff options
author | danfe <danfe@FreeBSD.org> | 2016-01-31 19:50:41 +0800 |
---|---|---|
committer | danfe <danfe@FreeBSD.org> | 2016-01-31 19:50:41 +0800 |
commit | af1f9b2134800e5e1bc530cd337cd2af6fbf502d (patch) | |
tree | 0fb454412006162204abdcc7f94634752290aa4c /audio | |
parent | 15a78b7be62fa96c25b44af77c36cdd19b06fb67 (diff) | |
download | freebsd-ports-graphics-af1f9b2134800e5e1bc530cd337cd2af6fbf502d.tar.gz freebsd-ports-graphics-af1f9b2134800e5e1bc530cd337cd2af6fbf502d.tar.zst freebsd-ports-graphics-af1f9b2134800e5e1bc530cd337cd2af6fbf502d.zip |
This is playback status plugin (widget) for DeaDBeeF audio player.
WWW: https://github.com/cboxdoerfer/ddb_playback_status
Diffstat (limited to 'audio')
-rw-r--r-- | audio/Makefile | 1 | ||||
-rw-r--r-- | audio/deadbeef-playback-status-plugin/Makefile | 39 | ||||
-rw-r--r-- | audio/deadbeef-playback-status-plugin/distinfo | 2 | ||||
-rw-r--r-- | audio/deadbeef-playback-status-plugin/files/patch-Makefile | 37 | ||||
-rw-r--r-- | audio/deadbeef-playback-status-plugin/files/patch-main.c | 120 | ||||
-rw-r--r-- | audio/deadbeef-playback-status-plugin/pkg-descr | 3 |
6 files changed, 202 insertions, 0 deletions
diff --git a/audio/Makefile b/audio/Makefile index 100da841586..d6f6c5d9362 100644 --- a/audio/Makefile +++ b/audio/Makefile @@ -95,6 +95,7 @@ SUBDIR += deadbeef-mpris-plugin SUBDIR += deadbeef-mpris2-plugin SUBDIR += deadbeef-musical-spectrum-plugin + SUBDIR += deadbeef-playback-status-plugin SUBDIR += deadbeef-quick-search-plugin SUBDIR += deadbeef-waveform-seekbar-plugin SUBDIR += decibel-audio-player diff --git a/audio/deadbeef-playback-status-plugin/Makefile b/audio/deadbeef-playback-status-plugin/Makefile new file mode 100644 index 00000000000..0f31023b006 --- /dev/null +++ b/audio/deadbeef-playback-status-plugin/Makefile @@ -0,0 +1,39 @@ +# Created by: Alexey Dokuchaev <danfe@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= deadbeef-playback-status-plugin +DISTVERSION= 0.0.2015.09.12 +CATEGORIES= audio + +MAINTAINER= danfe@FreeBSD.org +COMMENT= Playback status widget for DeaDBeeF audio player + +BUILD_DEPENDS= ${LOCALBASE}/include/deadbeef/deadbeef.h:${PORTSDIR}/audio/deadbeef +RUN_DEPENDS:= ${BUILD_DEPENDS} + +USE_GITHUB= yes +GH_ACCOUNT= cboxdoerfer +GH_PROJECT= ddb_playback_status +GH_TAGNAME= fce1de0 + +USES= gmake pkgconfig + +OPTIONS_DEFINE= GTK2 GTK3 +OPTIONS_DEFAULT= GTK3 + +.for v in 2 3 +GTK${v}_USE= GNOME=gtk${v}0 + +GTK${v}_ALL_TARGET= gtk${v} +GTK${v}_PLIST_FILES= lib/deadbeef/ddb_misc_playback_status_GTK${v}.so + +do-install-GTK${v}-on: + @${MKDIR} ${STAGEDIR}${PREFIX}/lib/deadbeef + ${INSTALL_LIB} ${WRKSRC}/gtk${v}/ddb_misc_playback_status_GTK${v}.so \ + ${STAGEDIR}${PREFIX}/lib/deadbeef +.endfor + +do-install: + @${DO_NADA} + +.include <bsd.port.mk> diff --git a/audio/deadbeef-playback-status-plugin/distinfo b/audio/deadbeef-playback-status-plugin/distinfo new file mode 100644 index 00000000000..e2f02f4b0ee --- /dev/null +++ b/audio/deadbeef-playback-status-plugin/distinfo @@ -0,0 +1,2 @@ +SHA256 (cboxdoerfer-ddb_playback_status-0.0.2015.09.12-fce1de0_GH0.tar.gz) = 853143f0be7e117f9e339d4b7503329c8f82fb7877c7815718167f75293ff2ec +SIZE (cboxdoerfer-ddb_playback_status-0.0.2015.09.12-fce1de0_GH0.tar.gz) = 8343 diff --git a/audio/deadbeef-playback-status-plugin/files/patch-Makefile b/audio/deadbeef-playback-status-plugin/files/patch-Makefile new file mode 100644 index 00000000000..95149c07d37 --- /dev/null +++ b/audio/deadbeef-playback-status-plugin/files/patch-Makefile @@ -0,0 +1,37 @@ +--- Makefile.orig 2015-09-12 12:42:47 UTC ++++ Makefile +@@ -30,7 +30,7 @@ GTK2_LIBS?=`pkg-config --libs gtk+-2.0` + GTK3_LIBS?=`pkg-config --libs gtk+-3.0` + + CC?=gcc +-CFLAGS+=-Wall -g -fPIC -std=c99 -D_GNU_SOURCE ++CFLAGS+=-Wall -fPIC -std=c99 -D_GNU_SOURCE + LDFLAGS+=-shared + + GTK2_DIR?=gtk2 +@@ -67,21 +67,21 @@ mkdir_gtk3: + + $(GTK2_DIR)/$(OUT_GTK2): $(OBJ_GTK2) + @echo "Linking GTK+2 version" +- @$(call link, $(OBJ_GTK2), $(GTK2_LIBS)) ++ $(call link, $(OBJ_GTK2), $(GTK2_LIBS)) + @echo "Done!" + + $(GTK3_DIR)/$(OUT_GTK3): $(OBJ_GTK3) + @echo "Linking GTK+3 version" +- @$(call link, $(OBJ_GTK3), $(GTK3_LIBS)) ++ $(call link, $(OBJ_GTK3), $(GTK3_LIBS)) + @echo "Done!" + + $(GTK2_DIR)/%.o: %.c + @echo "Compiling $(subst $(GTK2_DIR)/,,$@)" +- @$(call compile, $(GTK2_CFLAGS)) ++ $(call compile, $(GTK2_CFLAGS)) + + $(GTK3_DIR)/%.o: %.c + @echo "Compiling $(subst $(GTK3_DIR)/,,$@)" +- @$(call compile, $(GTK3_CFLAGS)) ++ $(call compile, $(GTK3_CFLAGS)) + + clean: + @echo "Cleaning files from previous build..." diff --git a/audio/deadbeef-playback-status-plugin/files/patch-main.c b/audio/deadbeef-playback-status-plugin/files/patch-main.c new file mode 100644 index 00000000000..1bab73df86f --- /dev/null +++ b/audio/deadbeef-playback-status-plugin/files/patch-main.c @@ -0,0 +1,120 @@ +--- main.c.orig 2015-09-12 12:42:47 UTC ++++ main.c +@@ -89,13 +89,13 @@ load_config (gpointer user_data) + for (int i = 0; i < CONFIG_NUM_LINES; i++) { + snprintf (conf_format_str, sizeof (conf_format_str), "%s%02d", CONFSTR_VM_FORMAT, i); + if (i == 0) { +- CONFIG_FORMAT[i] = strdup (deadbeef->conf_get_str_fast (conf_format_str, "<span foreground='grey' weight='bold' size='medium'>%playback_time% / %length%</span>")); ++ CONFIG_FORMAT[i] = strdup (deadbeef->conf_get_str_fast (conf_format_str, "<span size='xx-large' weight='semibold'>%e / %l%</span>")); + } + else if (i == 1) { +- CONFIG_FORMAT[i] = strdup (deadbeef->conf_get_str_fast (conf_format_str, "<span weight='bold' size='x-large'>%tracknumber%. %title%</span>")); ++ CONFIG_FORMAT[i] = strdup (deadbeef->conf_get_str_fast (conf_format_str, "<span size='large'>%n. %t</span>")); + } + else if (i== 2) { +- CONFIG_FORMAT[i] = strdup (deadbeef->conf_get_str_fast (conf_format_str, "%album% - <i>%album artist%</i>")); ++ CONFIG_FORMAT[i] = strdup (deadbeef->conf_get_str_fast (conf_format_str, "<span size='large' foreground='gray31'>%a - <i>%b</i></span>")); + } + else { + CONFIG_FORMAT[i] = strdup (deadbeef->conf_get_str_fast (conf_format_str, "")); +@@ -113,12 +113,18 @@ on_config_changed (gpointer user_data, u + load_config (user_data); + for (int i = 0; i < MAX_LINES; i++) { + if (w->bytecode[i]) { ++#if DDB_API_LEVEL >= 8 + deadbeef->tf_free (w->bytecode[i]); ++#endif + w->bytecode[i] = NULL; + } + if (i < CONFIG_NUM_LINES) { + gtk_widget_show (w->label[i]); ++#if DDB_API_LEVEL >= 8 + w->bytecode[i] = deadbeef->tf_compile (CONFIG_FORMAT[i]); ++#else ++ w->bytecode[i] = CONFIG_FORMAT[i]; ++#endif + } + else { + gtk_widget_hide (w->label[i]); +@@ -146,6 +152,8 @@ on_num_lines_changed (GtkSpinButton *spi + return TRUE; + } + ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + static void + on_button_config (GtkMenuItem *menuitem, gpointer user_data) + { +@@ -158,8 +166,6 @@ on_button_config (GtkMenuItem *menuitem, + GtkWidget *applybutton1; + GtkWidget *cancelbutton1; + GtkWidget *okbutton1; +-#pragma GCC diagnostic push +-#pragma GCC diagnostic ignored "-Wdeprecated-declarations" + playback_status_properties = gtk_dialog_new (); + gtk_window_set_title (GTK_WINDOW (playback_status_properties), "Playback Status Properties"); + gtk_window_set_type_hint (GTK_WINDOW (playback_status_properties), GDK_WINDOW_TYPE_HINT_DIALOG); +@@ -231,9 +237,9 @@ on_button_config (GtkMenuItem *menuitem, + break; + } + gtk_widget_destroy (playback_status_properties); +-#pragma GCC diagnostic pop + return; + } ++#pragma GCC diagnostic pop + + static void + w_playback_status_destroy (ddb_gtkui_widget_t *w) { +@@ -241,7 +247,9 @@ w_playback_status_destroy (ddb_gtkui_wid + deadbeef->vis_waveform_unlisten (w); + for (int i = 0; i < MAX_LINES; ++i) { + if (s->bytecode[i]) { ++#if DDB_API_LEVEL >= 8 + deadbeef->tf_free (s->bytecode[i]); ++#endif + s->bytecode[i] = NULL; + } + } +@@ -268,6 +276,7 @@ playback_status_set_label_text (gpointer + char title[1024]; + DB_playItem_t *playing = deadbeef->streamer_get_playing_track (); + if (playing) { ++#if DDB_API_LEVEL >= 8 + ddb_tf_context_t ctx = { + ._size = sizeof (ddb_tf_context_t), + .it = playing, +@@ -282,12 +291,19 @@ playback_status_set_label_text (gpointer + deadbeef->plt_unref (ctx.plt); + ctx.plt = NULL; + } ++#else ++ for (int i = 0; i < CONFIG_NUM_LINES; i++) { ++ if (deadbeef->pl_format_title(playing, -1, title, sizeof(title) ++ -1, -1, w->bytecode[i]) >= 0) ++ gtk_label_set_markup (GTK_LABEL (w->label[i]), title); ++ } ++#endif + deadbeef->pl_item_unref (playing); + } + else { +- gtk_label_set_markup (GTK_LABEL (w->label[0]), "<span weight='bold' size='x-large'>Stopped</span>"); +- for (int i = 1; i < CONFIG_NUM_LINES; i++) { +- gtk_label_set_markup (GTK_LABEL (w->label[i]), ""); ++ for (int i = 0; i < CONFIG_NUM_LINES; i++) { ++ gtk_label_set_markup (GTK_LABEL (w->label[i]), i == 1 ? ++ "<span weight='semibold' size='x-large'>Stopped</span>" : ""); + } + } + deadbeef->mutex_unlock (w->mutex); +@@ -371,7 +387,11 @@ w_playback_status_init (ddb_gtkui_widget + for (int i = 0; i < MAX_LINES; i++) { + if (i < CONFIG_NUM_LINES) { + gtk_widget_show (s->label[i]); ++#if DDB_API_LEVEL >= 8 + s->bytecode[i] = deadbeef->tf_compile (CONFIG_FORMAT[i]); ++#else ++ s->bytecode[i] = CONFIG_FORMAT[i]; ++#endif + } + else { + gtk_widget_hide (s->label[i]); diff --git a/audio/deadbeef-playback-status-plugin/pkg-descr b/audio/deadbeef-playback-status-plugin/pkg-descr new file mode 100644 index 00000000000..0cdd97d5e78 --- /dev/null +++ b/audio/deadbeef-playback-status-plugin/pkg-descr @@ -0,0 +1,3 @@ +This is playback status plugin (widget) for DeaDBeeF audio player. + +WWW: https://github.com/cboxdoerfer/ddb_playback_status |