new package: gjay, thanks Joshua Judson Rosen

This commit is contained in:
Xiangfu Liu 2011-07-08 09:43:30 +08:00
parent 3d93557948
commit 9c1f686425
17 changed files with 1008 additions and 0 deletions

71
gjay/Makefile Normal file
View File

@ -0,0 +1,71 @@
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=gjay
PKG_VERSION:=0.3.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=@SF/gjay
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
TARGET_LDFLAGS+= \
-Wl,-rpath-link=$(STAGING_DIR)/usr/lib
CONFIGURE_ARGS += \
--disable-audclient \
--disable-mpdclient \
--disable-latin1
CONFIGURE_CMD = ./autogen.sh
define Package/gjay
SECTION:=sound
CATEGORY:=Sound
TITLE:=GJay
URL:=http://gjay.sourceforge.net/
DEPENDS:=+gtk2 +libgsl
endef
define Package/gjay/description
GJay (Gtk+ DJ) generates playlists across a collection of music
(ogg, mp3, wav) such that each song sounds good following
the previous song. It is ideal for home users who want a non-random
way to wander large collections or for DJs planning a set list.
You can generate playlists from within the application, or run GJay
as a standalone command-line utility.
Playlist matches are based on:
* Song characteristics that don't change:
- Frequency fingerprint
- Beats per minute
- Location in file system
* Song attributes that you set:
- Rating
- Color (whatever that means to you)
endef
define Build/Configure
( cd $(PKG_BUILD_DIR); chmod +x ./autogen.sh; );
$(call Build/Configure/Default)
endef
define Package/gjay/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/share/gjay/icons
$(INSTALL_BIN) \
$(PKG_INSTALL_DIR)/usr/bin/gjay \
$(1)/usr/bin/
$(INSTALL_DATA) \
$(PKG_INSTALL_DIR)/usr/share/gjay/icons/* \
$(1)/usr/share/gjay/icons/
endef
$(eval $(call BuildPackage,gjay))

View File

@ -0,0 +1,25 @@
From 1131c2eef458e553b483e61c8068f2de2865ad61 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Sun, 24 Apr 2011 22:34:10 -0400
Subject: [PATCH 01/17] Correctly document "./configure --disable-mpdclient".
---
configure.ac | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index 67cbaf9..c5545e8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -10,7 +10,7 @@ AM_INIT_AUTOMAKE([1.10])
dnl Options
AC_SUBST([WITH_MPDCLIENT])
AC_ARG_ENABLE([mpdclient],
- AS_HELP_STRING([--with-mpdclient], [Enable mpd client(default is YES)]),
+ AS_HELP_STRING([--disable-mpdclient], [Disable mpd client (enabled by default)]),
[enable_mpdclient=$enableval],
[enable_mpdclient="yes"])
if test "$enable_mpdclient" = "yes"; then
--
1.7.2.5

View File

@ -0,0 +1,26 @@
From 773e924a54ca8f870cc471442c6b4d6c51bafcc0 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Tue, 26 Apr 2011 21:37:50 -0400
Subject: [PATCH 02/17] Don't show unsupported players as options in the preferences GUI.
---
prefs.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/prefs.c b/prefs.c
index 844a61d..33a6016 100644
--- a/prefs.c
+++ b/prefs.c
@@ -123,7 +123,9 @@ const char *music_player_names[] =
{
"None",
"Audacious",
+#ifdef WITH_MPDCLIENT
"MPD",
+#endif
NULL
};
--
1.7.2.5

View File

@ -0,0 +1,107 @@
From 4d3796be444f7b42041d111e2c91b7ce6faff786 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Tue, 26 Apr 2011 22:35:23 -0400
Subject: [PATCH 03/17] Provide a "./configure --disable-audclient" option
to build without support for Audacious.
---
config.h.in | 3 +++
configure.ac | 10 +++++++++-
play_audacious.c | 4 ++--
play_common.c | 2 ++
prefs.c | 2 ++
5 files changed, 18 insertions(+), 3 deletions(-)
diff --git a/config.h.in b/config.h.in
index 9054b03..17decf1 100644
--- a/config.h.in
+++ b/config.h.in
@@ -85,5 +85,8 @@
/* Version number of package */
#undef VERSION
+/* Enable Audacious music player */
+#undef WITH_AUDCLIENT
+
/* Enable mpd music player */
#undef WITH_MPDCLIENT
diff --git a/configure.ac b/configure.ac
index c5545e8..bfe7ca4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,6 +18,15 @@ if test "$enable_mpdclient" = "yes"; then
PKG_CHECK_MODULES([MPDCLIENT], [libmpdclient])
fi
+AC_SUBST([WITH_AUDCLIENT])
+AC_ARG_ENABLE([audclient],
+ AS_HELP_STRING([--disable-audclient], [Disable Audacious client (enabled by default)]),
+ [enable_audclient=$enableval],
+ [enable_audclient="yes"])
+if test "$enable_audclient" = "yes"; then
+ AC_DEFINE([WITH_AUDCLIENT], [1], [Enable Audacious music player])
+ PKG_CHECK_MODULES([AUDACIOUS], [audacious])
+fi
# Checks for programs.
AC_PROG_CC
@@ -31,7 +40,6 @@ AM_GNU_GETTEXT_VERSION([0.18.1])
# Checks for libraries.
AM_PATH_GTK_2_0
PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
-PKG_CHECK_MODULES([AUDACIOUS], [audacious])
AX_PATH_GSL
dnl AC_CHECK_LIB([audclient], [audacious_remote_playlist])
diff --git a/play_audacious.c b/play_audacious.c
index 4ca8cee..93e5f52 100644
--- a/play_audacious.c
+++ b/play_audacious.c
@@ -22,6 +22,7 @@
#include "config.h"
#endif /* HAVE_CONFIG_H */
+#ifdef WITH_AUDCLIENT
#include <stdio.h>
#include <sys/types.h>
@@ -171,5 +172,4 @@ audacious_connect(void)
}
-
-
+#endif /* WITH_AUDCLIENT */
diff --git a/play_common.c b/play_common.c
index f0968b5..9034dbc 100644
--- a/play_common.c
+++ b/play_common.c
@@ -40,9 +40,11 @@ player_init(void)
case PLAYER_NONE:
/* break out, configured later */
break;
+#ifdef WITH_AUDCLIENT
case PLAYER_AUDACIOUS:
player_configured = audacious_init();
break;
+#endif /* WITH_AUDCLIENT */
/*case PLAYER_EXAILE:
exaile_init();
break;*/
diff --git a/prefs.c b/prefs.c
index 33a6016..3232d32 100644
--- a/prefs.c
+++ b/prefs.c
@@ -122,7 +122,9 @@ char * pref_element_strs[PE_LAST] = {
const char *music_player_names[] =
{
"None",
+#ifdef WITH_AUDCLIENT
"Audacious",
+#endif
#ifdef WITH_MPDCLIENT
"MPD",
#endif
--
1.7.2.5

View File

@ -0,0 +1,149 @@
From e812bd02096d2cd4ee8a61210d6363da227a48fa Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Tue, 26 Apr 2011 22:35:44 -0400
Subject: [PATCH 04/17] Don't build against (or require) dbus-glib unless building something that needs it.
---
config.h.in | 3 +++
configure.ac | 11 ++++++++++-
dbus.c | 7 +++++++
gjay.c | 8 ++++++++
gjay.h | 7 +++++++
5 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/config.h.in b/config.h.in
index 17decf1..8833d6c 100644
--- a/config.h.in
+++ b/config.h.in
@@ -88,5 +88,8 @@
/* Enable Audacious music player */
#undef WITH_AUDCLIENT
+/* Build with dbus-glib */
+#undef WITH_DBUSGLIB
+
/* Enable mpd music player */
#undef WITH_MPDCLIENT
diff --git a/configure.ac b/configure.ac
index bfe7ca4..62273bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,12 +8,16 @@ AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.10])
dnl Options
+# Don't require D-Bus unless building a component that needs it:
+enable_dbus=no
+
AC_SUBST([WITH_MPDCLIENT])
AC_ARG_ENABLE([mpdclient],
AS_HELP_STRING([--disable-mpdclient], [Disable mpd client (enabled by default)]),
[enable_mpdclient=$enableval],
[enable_mpdclient="yes"])
if test "$enable_mpdclient" = "yes"; then
+ enable_dbus=yes
AC_DEFINE([WITH_MPDCLIENT], [1], [Enable mpd music player])
PKG_CHECK_MODULES([MPDCLIENT], [libmpdclient])
fi
@@ -24,6 +28,7 @@ AC_ARG_ENABLE([audclient],
[enable_audclient=$enableval],
[enable_audclient="yes"])
if test "$enable_audclient" = "yes"; then
+ enable_dbus=yes
AC_DEFINE([WITH_AUDCLIENT], [1], [Enable Audacious music player])
PKG_CHECK_MODULES([AUDACIOUS], [audacious])
fi
@@ -39,7 +44,11 @@ AM_GNU_GETTEXT_VERSION([0.18.1])
# Checks for libraries.
AM_PATH_GTK_2_0
-PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
+
+if test "$enable_dbus" = "yes"; then
+ AC_DEFINE([WITH_DBUSGLIB], [1], [Build with dbus-glib])
+ PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
+fi
AX_PATH_GSL
dnl AC_CHECK_LIB([audclient], [audacious_remote_playlist])
diff --git a/dbus.c b/dbus.c
index 48a6453..81258ad 100644
--- a/dbus.c
+++ b/dbus.c
@@ -17,6 +17,12 @@
* with this program; if not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef WITH_DBUSGLIB
+
#include <dbus/dbus-glib.h>
#include "gjay.h"
#include "dbus.h"
@@ -62,3 +68,4 @@ gjay_dbus_is_running(const char *appname)
return running;
}
+#endif /* WITH_DBUSGLIB */
diff --git a/gjay.c b/gjay.c
index 547b72c..205065e 100644
--- a/gjay.c
+++ b/gjay.c
@@ -45,7 +45,11 @@
#include <string.h>
#include <ctype.h>
#include "gjay.h"
+
+#ifdef WITH_DBUSGLIB
#include "dbus.h"
+#endif /* WITH_DBUSGLIB */
+
#include "analysis.h"
#include "ipc.h"
#include "playlist.h"
@@ -468,7 +472,11 @@ static void run_as_ui(int argc, char *argv[] )
player_init();
make_app_ui();
gtk_widget_show_all(gjay->main_window);
+
+#ifdef WITH_DBUSGLIB
gjay->connection = gjay_dbus_connection();
+#endif /* WITH_DBUSGLIB */
+
gjay->message_window = make_message_window();
g_log_set_handler(NULL,
G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
diff --git a/gjay.h b/gjay.h
index 78f5180..89a0881 100644
--- a/gjay.h
+++ b/gjay.h
@@ -32,7 +32,10 @@
#include <assert.h>
#include <limits.h>
#include <math.h>
+
+#ifdef WITH_DBUSGLIB
#include <dbus/dbus-glib.h>
+#endif /* WITH_DBUSGLIB */
typedef struct _GjayApp GjayApp;
extern GjayApp *gjay;
@@ -77,8 +80,12 @@ gchar * parent_dir ( const char * path );
struct _GjayApp {
GjayPrefs *prefs;
/* Player connections/handles */
+
+#ifdef WITH_DBUSGLIB
DBusGConnection *connection;
DBusGProxy *player_proxy;
+#endif /* WITH_DBUSGLIB */
+
#ifdef WITH_MPDCLIENT
struct mpd_connection *mpdclient_connection;
#endif /* WITH_MPDCLIENT */
--
1.7.2.5

View File

@ -0,0 +1,35 @@
From bf07d7e3771166d0913e005b6835f534a302741e Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Tue, 26 Apr 2011 23:15:35 -0400
Subject: [PATCH 07/17] Use pkg-config to check for libraries wherever possible.
Some embedded environments ship pkg-config files but not the `*-config' scripts, so this should be more portable.
---
configure.ac | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 62273bd..ad72ece 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,14 +43,15 @@ AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18.1])
# Checks for libraries.
-AM_PATH_GTK_2_0
+PKG_CHECK_MODULES([GTK], [gtk+-2.0])
if test "$enable_dbus" = "yes"; then
AC_DEFINE([WITH_DBUSGLIB], [1], [Build with dbus-glib])
PKG_CHECK_MODULES([DBUS_GLIB], [dbus-glib-1])
fi
-AX_PATH_GSL
+PKG_CHECK_MODULES([GSL], [gsl])
+
dnl AC_CHECK_LIB([audclient], [audacious_remote_playlist])
AC_CHECK_LIB([dl], [dlopen])
--
1.7.2.5

View File

@ -0,0 +1,41 @@
From 48f75a95a05d778509381783da1b44d1049c65e1 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Wed, 27 Apr 2011 00:23:29 -0400
Subject: [PATCH 08/17] Check for pkg-config and other key programs first.
Otherwise, checks that *use* them may fail mysteriously.
---
configure.ac | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/configure.ac b/configure.ac
index ad72ece..cd90750 100644
--- a/configure.ac
+++ b/configure.ac
@@ -7,6 +7,11 @@ AC_CONFIG_SRCDIR([gjay.h])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([1.10])
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_INSTALL
+PKG_PROG_PKG_CONFIG
+
dnl Options
# Don't require D-Bus unless building a component that needs it:
enable_dbus=no
@@ -33,11 +38,6 @@ if test "$enable_audclient" = "yes"; then
PKG_CHECK_MODULES([AUDACIOUS], [audacious])
fi
-# Checks for programs.
-AC_PROG_CC
-AC_PROG_INSTALL
-PKG_PROG_PKG_CONFIG
-
dnl Check for language stuff
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18.1])
--
1.7.2.5

View File

@ -0,0 +1,23 @@
From a52792ae17ad9dfa392a4fe2588c3c526b0b06d5 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Wed, 27 Apr 2011 00:25:37 -0400
Subject: [PATCH 09/17] Distribute autogen.sh
in case someone needs to patch configure.ac, etc. before building.
---
Makefile.am | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 43660a9..9b1a5f4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,4 +23,4 @@ gjay_SOURCES = gjay.h songs.h prefs.h ui.h rgbhsv.h analysis.h playlist.h \
ACLOCAL_AMFLAGS = -I m4
-EXTRA_DIST = config.rpath m4/ChangeLog
+EXTRA_DIST = config.rpath m4/ChangeLog autogen.sh
--
1.7.2.5

View File

@ -0,0 +1,27 @@
From 5d548f4c49466df8928a108a4e864fd9372139b2 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Wed, 27 Apr 2011 00:26:04 -0400
Subject: [PATCH 10/17] Use the *Make* variables defined by Autoconf, not the autoconf variables themselves.
---
Makefile.am | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 9b1a5f4..0d22faf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3,8 +3,8 @@ SUBDIRS = po doc icons
bin_PROGRAMS = gjay
-gjay_LDADD = @GTK_LIBS@ @DBUS_GLIB_LIBS@ @GSL_LIBS@
-AM_CFLAGS = -Wall @GTK_CFLAGS@ @DBUS_GLIB_CFLAGS@ @GSL_CFLAGS@
+gjay_LDADD = $(GTK_LIBS) $(DBUS_GLIB_LIBS) $(GSL_LIBS)
+AM_CFLAGS = -Wall $(GTK_CFLAGS) $(DBUS_GLIB_CFLAGS) $(GSL_CFLAGS)
gjay_SOURCES = gjay.h songs.h prefs.h ui.h rgbhsv.h analysis.h playlist.h \
ipc.h constants.h vorbis.h mp3.h flac.h i18n.h \
--
1.7.2.5

View File

@ -0,0 +1,26 @@
From 550cb1bd232a1611daa90ab83f1440fb02df5f77 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Wed, 27 Apr 2011 00:26:44 -0400
Subject: [PATCH 11/17] Autoconf 2.62 appears to be sufficient.
It's also what OpenWRT is shipping right now--and what Qi Hardware is using for their Ben NanoNote environment.
---
configure.ac | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index cd90750..462350f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
-AC_PREREQ([2.67])
+AC_PREREQ([2.62])
AC_INIT([gjay],[0.3.2],[csmall@enc.com.au])
AC_CONFIG_SRCDIR([gjay.h])
AC_CONFIG_HEADERS([config.h])
--
1.7.2.5

View File

@ -0,0 +1,127 @@
From c52d500e6834815d4425b376f66895eb9e517896 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Wed, 27 Apr 2011 00:32:27 -0400
Subject: [PATCH 12/17] Don't show the `Music Player: ...' combo-box unless multiple choices are actually available.
---
ui_prefs_view.c | 72 +++++++++++++++++++++++++++++++++++--------------------
1 files changed, 46 insertions(+), 26 deletions(-)
diff --git a/ui_prefs_view.c b/ui_prefs_view.c
index e65981c..90e025d 100644
--- a/ui_prefs_view.c
+++ b/ui_prefs_view.c
@@ -73,6 +73,7 @@ GtkWidget * make_prefs_window ( void )
GtkWidget * hseparator, * hbox1, *max_working_set_entry, *table;
char buffer[BUFFER_SIZE];
int i;
+ int table_row = 0;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title(GTK_WINDOW(window), _("GJay Preferences"));
@@ -88,31 +89,44 @@ GtkWidget * make_prefs_window ( void )
gtk_label_set_markup(GTK_LABEL(label),_("<b>General</b>"));
gtk_box_pack_start(GTK_BOX(vbox2), label, TRUE, TRUE, 0);
- table = gtk_table_new(3,2,TRUE);
- gtk_box_pack_start(GTK_BOX(vbox1), table, TRUE, TRUE, 2);
+ table = gtk_table_new(2, 2, TRUE);
+ gtk_box_pack_start(GTK_BOX(vbox1), table, TRUE, TRUE, 2);
+
+ if (music_player_names[1] != NULL) {
+ /* There's always, at least, the "None" player.
+ If there are also other plays beyond that,
+ present the user with a menu.
+ */
+
+ /* Make room in the table for this row: */
+ gtk_table_resize(table, 3, 2);
+
+ /* Player selection combo box */
+ label = gtk_label_new(_("Music Player:"));
+
+ player_cbox = gtk_combo_box_new_text();
+ i=0;
+ while (music_player_names[i] != NULL)
+ {
+ gtk_combo_box_append_text(GTK_COMBO_BOX(player_cbox), music_player_names[i]);
+ i++;
+ }
+ gtk_combo_box_set_active(GTK_COMBO_BOX(player_cbox), gjay->prefs->music_player);
- /* Player selection combo box */
- label = gtk_label_new(_("Music Player:"));
+ alignment = gtk_alignment_new(0, 0, 0, 0);
+ gtk_container_add(GTK_CONTAINER(alignment), label);
+ gtk_table_attach(GTK_TABLE(table), alignment,
+ 0, 1, table_row, table_row+1,
+ (GTK_EXPAND|GTK_FILL),(GTK_EXPAND|GTK_FILL),6,0);
+ table_row++;
+ alignment = gtk_alignment_new(0, 0, 0, 0);
- player_cbox = gtk_combo_box_new_text();
- i=0;
- while (music_player_names[i] != NULL)
- {
- gtk_combo_box_append_text(GTK_COMBO_BOX(player_cbox), music_player_names[i]);
- i++;
+ gtk_container_add(GTK_CONTAINER(alignment), player_cbox);
+ gtk_table_attach(GTK_TABLE(table), alignment, 1, 2, 0, 1,
+ (GTK_EXPAND|GTK_FILL),(GTK_EXPAND|GTK_FILL),6,0);
+ g_signal_connect (G_OBJECT (player_cbox), "changed",
+ G_CALLBACK (player_combo_box_changed), NULL);
}
- gtk_combo_box_set_active(GTK_COMBO_BOX(player_cbox), gjay->prefs->music_player);
-
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_container_add(GTK_CONTAINER(alignment), label);
- gtk_table_attach(GTK_TABLE(table), alignment, 0, 1, 0, 1,
- (GTK_EXPAND|GTK_FILL),(GTK_EXPAND|GTK_FILL),6,0);
- alignment = gtk_alignment_new(0, 0, 0, 0);
- gtk_container_add(GTK_CONTAINER(alignment), player_cbox);
- gtk_table_attach(GTK_TABLE(table), alignment, 1, 2, 0, 1,
- (GTK_EXPAND|GTK_FILL),(GTK_EXPAND|GTK_FILL),6,0);
- g_signal_connect (G_OBJECT (player_cbox), "changed",
- G_CALLBACK (player_combo_box_changed), NULL);
/* Song Ratings checkbox */
label = gtk_label_new(_("Use song ratings"));
@@ -125,12 +139,15 @@ GtkWidget * make_prefs_window ( void )
alignment = gtk_alignment_new(0, 0, 0, 0);
gtk_container_add(GTK_CONTAINER(alignment), label);
- gtk_table_attach(GTK_TABLE(table), alignment, 0, 1, 1, 2,
+ gtk_table_attach(GTK_TABLE(table), alignment,
+ 0, 1, table_row, table_row+1,
(GTK_EXPAND|GTK_FILL),(GTK_EXPAND|GTK_FILL),6,0);
alignment = gtk_alignment_new(0, 0, 0, 0);
gtk_container_add(GTK_CONTAINER(alignment), button);
- gtk_table_attach(GTK_TABLE(table), alignment, 1, 2, 1, 2,
+ gtk_table_attach(GTK_TABLE(table), alignment,
+ 1, 2, table_row, table_row+1,
(GTK_EXPAND|GTK_FILL),(GTK_EXPAND|GTK_FILL),6,0);
+ table_row++;
/* Maximum working set box */
label = gtk_label_new(_("Max working set"));
@@ -147,12 +164,15 @@ GtkWidget * make_prefs_window ( void )
alignment = gtk_alignment_new(0, 0, 0, 0);
gtk_container_add(GTK_CONTAINER(alignment), label);
- gtk_table_attach(GTK_TABLE(table), alignment, 0, 1, 2, 3,
+ gtk_table_attach(GTK_TABLE(table), alignment,
+ 0, 1, table_row, table_row+1,
(GTK_EXPAND|GTK_FILL),(GTK_EXPAND|GTK_FILL),6,0);
alignment = gtk_alignment_new(0, 0, 0, 0);
gtk_container_add(GTK_CONTAINER(alignment), max_working_set_entry);
- gtk_table_attach(GTK_TABLE(table), alignment, 1, 2, 2, 3,
+ gtk_table_attach(GTK_TABLE(table), alignment,
+ 1, 2, table_row, table_row+1,
(GTK_EXPAND|GTK_FILL),(GTK_EXPAND|GTK_FILL),6,0);
+ table_row++;
hseparator = gtk_hseparator_new();
gtk_box_pack_start(GTK_BOX(vbox1), hseparator, TRUE, TRUE, 2);
--
1.7.2.5

View File

@ -0,0 +1,92 @@
From 3f16ee03c97f63e4f00142a356fd4f968a490c62 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Wed, 27 Apr 2011 00:46:39 -0400
Subject: [PATCH 13/17] Provide a "./configure --disable-latin1" option
for environments where UTF-8 is native and Latin-1 doesn't exist.
---
config.h.in | 3 +++
configure.ac | 9 +++++++++
util.c | 2 ++
util.h | 7 +++++++
4 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/config.h.in b/config.h.in
index 8833d6c..143620f 100644
--- a/config.h.in
+++ b/config.h.in
@@ -1,5 +1,8 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Assume tag-strings are encoded in Latin-1 */
+#undef ASSUME_LATIN1
+
/* Define to 1 if translation of program messages to the user's native
language is requested. */
#undef ENABLE_NLS
diff --git a/configure.ac b/configure.ac
index 462350f..68155ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -38,6 +38,15 @@ if test "$enable_audclient" = "yes"; then
PKG_CHECK_MODULES([AUDACIOUS], [audacious])
fi
+AC_ARG_ENABLE([latin1],
+ AS_HELP_STRING([--disable-latin1],
+ [Disable handling of tags encoded in Latin-1, and assume tags are UTF-8 encoded.]),
+ [assume_latin1=$enableval],
+ [assume_latin1="yes"])
+if test "$assume_latin1" = "yes"; then
+ AC_DEFINE([ASSUME_LATIN1], [1], [Assume tag-strings are encoded in Latin-1])
+fi
+
dnl Check for language stuff
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.18.1])
diff --git a/util.c b/util.c
index d5d7160..6b57e5b 100644
--- a/util.c
+++ b/util.c
@@ -50,6 +50,7 @@ gjay_dlsym(void *handle, const char const *func_name)
/**
* Duplicate a string from one encoding to another
*/
+#ifdef ASSUME_LATIN1
gchar * strdup_convert ( const gchar * str,
const gchar * enc_to,
const gchar * enc_from ) {
@@ -68,6 +69,7 @@ gchar * strdup_convert ( const gchar * str,
}
return conv;
}
+#endif /* ASSUME_LATIN1 */
/**
* Implement strtof, except make it locale agnostic w/r/t whether a
diff --git a/util.h b/util.h
index f422275..24c2170 100644
--- a/util.h
+++ b/util.h
@@ -21,11 +21,18 @@
#include <glib.h>
void * gjay_dlsym(void *handle, const char const *func_name);
+
#define strdup_to_utf8(str) (strdup_convert(str, "UTF8", "LATIN1"))
#define strdup_to_latin1(str) (strdup_convert(str, "LATIN1", "UTF8"))
+
+#ifdef ASSUME_LATIN1
gchar * strdup_convert ( const gchar * str,
const gchar * enc_to,
const gchar * enc_from );
+#else
+#define strdup_convert(str, enc_to, enc_from) (g_strdup(str))
+#endif /* ASSUME_LATIN1 */
+
float strtof_gjay ( const char * nptr,
char ** endptr);
--
1.7.2.5

View File

@ -0,0 +1,30 @@
From 5edd4a7b95c5be05ffe72ae6452e94ffa14bc5e5 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Thu, 12 May 2011 22:18:15 -0400
Subject: [PATCH 14/17] Use file_depth() rather than file_iter_depth() in explore_files_depth_distance().
The numbers end up the same here, but file_depth() is usable even when running without the GUI (e.g.: "gjay --playlist").
---
ui_explore_view.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui_explore_view.c b/ui_explore_view.c
index 413675d..d99eab2 100644
--- a/ui_explore_view.c
+++ b/ui_explore_view.c
@@ -658,9 +658,9 @@ gint explore_files_depth_distance ( char * file1,
k--;
/* Replace slash with null termination */
buffer[k] = '\0';
- f1 = file_iter_depth(file1);
- f2 = file_iter_depth(file2);
- shared = file_iter_depth(buffer) + 1;
+ f1 = file_depth(file1);
+ f2 = file_depth(file2);
+ shared = file_depth(buffer) + 1;
if (f1 && f2 && shared)
return ((f1 - shared) + (f2 - shared));
--
1.7.2.5

View File

@ -0,0 +1,89 @@
From 925908b925a9008a3da36d222874d2b66c9fe6f7 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Fri, 13 May 2011 21:32:04 -0400
Subject: [PATCH 15/17] Move file_depth() to util.c and make it public.
It's useful beyond the scope of ui_explore_view....
---
ui_explore_view.c | 17 ++---------------
util.c | 13 +++++++++++++
util.h | 2 ++
3 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/ui_explore_view.c b/ui_explore_view.c
index d99eab2..38f6c62 100644
--- a/ui_explore_view.c
+++ b/ui_explore_view.c
@@ -29,6 +29,7 @@
#include "gjay.h"
#include "ui.h"
#include "ipc.h"
+#include "util.h"
enum
@@ -80,7 +81,7 @@ static int get_iter_path ( GtkTreeModel *tree_model,
char * buffer,
gboolean is_start );
static int file_iter_depth ( char * file );
-static int file_depth ( char * file );
+
static gint explore_animate ( gpointer data );
static void explore_mark_new_dirs ( char * dir );
static gint iter_sort_strcmp ( GtkTreeModel *model,
@@ -628,20 +629,6 @@ static int file_iter_depth ( char * file ) {
return depth;
}
-/* Get the depth by counting the number of non-terminal '/' in the path */
-static int file_depth ( char * file ) {
- int len, kk, depth;
-
- len = strlen(file);
- if (len)
- len--; // Avoid ending '/'
- for (kk = 0, depth = 0; kk < len; kk++) {
- if (file[kk] == '/')
- depth++;
- }
- return depth;
-}
-
/* How many directory steps separate files 1 and 2? */
diff --git a/util.c b/util.c
index 6b57e5b..00db2d8 100644
--- a/util.c
+++ b/util.c
@@ -96,3 +96,16 @@ float strtof_gjay ( const char *nptr, char **endptr) {
return result;
}
+/* Get the depth by counting the number of non-terminal '/' in the path */
+int file_depth ( char * file ) {
+ int len, kk, depth;
+
+ len = strlen(file);
+ if (len)
+ len--; // Avoid ending '/'
+ for (kk = 0, depth = 0; kk < len; kk++) {
+ if (file[kk] == '/')
+ depth++;
+ }
+ return depth;
+}
diff --git a/util.h b/util.h
index 24c2170..b9fc7fd 100644
--- a/util.h
+++ b/util.h
@@ -36,4 +36,6 @@ gchar * strdup_convert ( const gchar * str,
float strtof_gjay ( const char * nptr,
char ** endptr);
+int file_depth ( char * file );
+
#endif /* UTIL_H */
--
1.7.2.5

View File

@ -0,0 +1,39 @@
From b6a3fef3df001aecb3ae8627de52bd0979bc42d8 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Fri, 13 May 2011 21:32:29 -0400
Subject: [PATCH 16/17] Set gjay->tree_depth based on the contents of the database during load
so that it's available even when running without the GUI.
---
songs.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/songs.c b/songs.c
index ea95d36..2fe010e 100644
--- a/songs.c
+++ b/songs.c
@@ -37,6 +37,7 @@
#include "flac.h"
#include "ui.h"
#include "i18n.h"
+#include "util.h"
typedef enum {
@@ -646,6 +647,13 @@ void data_start_element (GMarkupParseContext *context,
switch(get_element((char *) attribute_names[k])) {
case E_PATH:
path = (gchar *) attribute_values[k];
+ {
+ int depth = file_depth(path) - 1
+ - file_depth(gjay->prefs->song_root_dir);
+ if (depth > gjay->tree_depth) {
+ gjay->tree_depth = depth;
+ }
+ }
break;
case E_REPEATS:
repeat_path = (gchar *) attribute_values[k];
--
1.7.2.5

View File

@ -0,0 +1,25 @@
From 0a8f8397c09538b7e583f07960046913f6461579 Mon Sep 17 00:00:00 2001
From: Joshua Judson Rosen <rozzin@geekspace.com>
Date: Fri, 13 May 2011 21:34:34 -0400
Subject: [PATCH 17/17] Initialise locale before parsing options
to enable, for example, handling of localised filenames passed to the "--file" and "--analyze-standalone" options.
---
gjay.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/gjay.c b/gjay.c
index 205065e..ea1dc84 100644
--- a/gjay.c
+++ b/gjay.c
@@ -130,6 +130,7 @@ parse_commandline(int *argc_p, char ***argv_p, guint *playlist_minutes, gboolean
/* if (gtk_init_check(&argc, &argv))
g_option_context_add_group (context, gtk_get_option_group (TRUE));*/
error = NULL;
+ gtk_set_locale();
if (!g_option_context_parse (context, argc_p, argv_p, &error))
{
g_print (_("option parsing failed: %s\n"), error->message);
--
1.7.2.5

View File

@ -0,0 +1,76 @@
--- /dev/null 2011-04-12 08:45:25.703768888 -0400
+++ gjay/autogen.sh 2011-03-26 10:16:44.000000000 -0400
@@ -0,0 +1,73 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+# This was lifted from the Gimp, and adapted slightly by
+# Raph Levien .
+
+DIE=0
+
+PROJECT=gjay
+
+# Make it possible to specify path in the environment
+: ${AUTOCONF=autoconf}
+: ${AUTOHEADER=autoheader}
+: ${AUTOMAKE=automake}
+: ${ACLOCAL=aclocal}
+: ${AUTOPOINT=autopoint}
+
+($AUTOPOINT --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have gettext installed to compile $PROJECT."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/gettext-0.14.1.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+}
+
+($AUTOCONF --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have autoconf installed to compile $PROJECT."
+ echo "Download the appropriate package for your distribution,"
+ echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+ DIE=1
+}
+
+($AUTOMAKE --version) < /dev/null > /dev/null 2>&1 || {
+ echo
+ echo "You must have automake installed to compile $PROJECT."
+ echo "Get ftp://ftp.gnu.org/pub/gnu/automake-1.6.tar.gz"
+ echo "(or a newer version if it is available)"
+ DIE=1
+}
+
+if test "$DIE" -eq 1; then
+ exit 1
+fi
+
+if test -z "$*"; then
+ echo "I am going to run ./configure with no arguments - if you wish "
+ echo "to pass any to it, please specify them on the $0 command line."
+fi
+
+case $CC in
+*xlc | *xlc\ * | *lcc | *lcc\ *) am_opt=--include-deps;;
+esac
+
+for dir in .
+do
+ echo processing $dir
+ cd $dir
+ configdir="config"
+ test -d $configdir || mkdir $configdir
+ aclocalinclude="$ACLOCAL_FLAGS"
+ $AUTOPOINT
+ $ACLOCAL $aclocalinclude -I $configdir
+ $AUTOHEADER -Wall
+ $AUTOMAKE -Wall --add-missing --gnu $am_opt
+ $AUTOCONF -Wall
+ cd -
+done
+
+./configure "$@"
+
+echo
+echo "Now type 'make' to compile $PROJECT."
+