svn commit: r407613 - in head/audio: . deadbeef-playback-status-plugin deadbeef-playback-status-plugin/files

Alexey Dokuchaev danfe at FreeBSD.org
Sun Jan 31 11:50:44 UTC 2016


Author: danfe
Date: Sun Jan 31 11:50:41 2016
New Revision: 407613
URL: https://svnweb.freebsd.org/changeset/ports/407613

Log:
  This is playback status plugin (widget) for DeaDBeeF audio player.
  
  WWW: https://github.com/cboxdoerfer/ddb_playback_status

Added:
  head/audio/deadbeef-playback-status-plugin/
  head/audio/deadbeef-playback-status-plugin/Makefile   (contents, props changed)
  head/audio/deadbeef-playback-status-plugin/distinfo   (contents, props changed)
  head/audio/deadbeef-playback-status-plugin/files/
  head/audio/deadbeef-playback-status-plugin/files/patch-Makefile   (contents, props changed)
  head/audio/deadbeef-playback-status-plugin/files/patch-main.c   (contents, props changed)
  head/audio/deadbeef-playback-status-plugin/pkg-descr   (contents, props changed)
Modified:
  head/audio/Makefile

Modified: head/audio/Makefile
==============================================================================
--- head/audio/Makefile	Sun Jan 31 11:48:37 2016	(r407612)
+++ head/audio/Makefile	Sun Jan 31 11:50:41 2016	(r407613)
@@ -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

Added: head/audio/deadbeef-playback-status-plugin/Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/deadbeef-playback-status-plugin/Makefile	Sun Jan 31 11:50:41 2016	(r407613)
@@ -0,0 +1,39 @@
+# Created by: Alexey Dokuchaev <danfe at FreeBSD.org>
+# $FreeBSD$
+
+PORTNAME=	deadbeef-playback-status-plugin
+DISTVERSION=	0.0.2015.09.12
+CATEGORIES=	audio
+
+MAINTAINER=	danfe at 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>

Added: head/audio/deadbeef-playback-status-plugin/distinfo
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/deadbeef-playback-status-plugin/distinfo	Sun Jan 31 11:50:41 2016	(r407613)
@@ -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

Added: head/audio/deadbeef-playback-status-plugin/files/patch-Makefile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/deadbeef-playback-status-plugin/files/patch-Makefile	Sun Jan 31 11:50:41 2016	(r407613)
@@ -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..."

Added: head/audio/deadbeef-playback-status-plugin/files/patch-main.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/deadbeef-playback-status-plugin/files/patch-main.c	Sun Jan 31 11:50:41 2016	(r407613)
@@ -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]);

Added: head/audio/deadbeef-playback-status-plugin/pkg-descr
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/audio/deadbeef-playback-status-plugin/pkg-descr	Sun Jan 31 11:50:41 2016	(r407613)
@@ -0,0 +1,3 @@
+This is playback status plugin (widget) for DeaDBeeF audio player.
+
+WWW: https://github.com/cboxdoerfer/ddb_playback_status


More information about the svn-ports-head mailing list