summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--common.h15
-rw-r--r--configure.ac32
-rw-r--r--deadbeef.h13
-rw-r--r--main.c75
-rw-r--r--plugins.c29
-rw-r--r--plugins.h8
-rw-r--r--plugins/artwork/artwork.c35
-rw-r--r--plugins/artwork/artwork.h1
-rw-r--r--plugins/gtkui/callbacks.c12
-rw-r--r--plugins/gtkui/coverart.c7
-rw-r--r--plugins/gtkui/gtkui.c3
12 files changed, 179 insertions, 52 deletions
diff --git a/.gitignore b/.gitignore
index fa4d4231..bfcca357 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,3 +45,4 @@ vala.stamp
POTFILES
stamp-it
po/Makevars.template
+*.so
diff --git a/common.h b/common.h
index dfecb27a..fd270c3e 100644
--- a/common.h
+++ b/common.h
@@ -18,12 +18,21 @@
#ifndef __COMMON_H
#define __COMMON_H
+#include <limits.h>
+#ifndef PATH_MAX
+#define PATH_MAX 1024 /* max # of characters in a path name */
+#endif
+
#define min(x,y) ((x)<(y)?(x):(y))
#define max(x,y) ((x)>(y)?(x):(y))
// those are defined in main.c
-extern char confdir[1024]; // $HOME/.config
-extern char dbconfdir[1024]; // $HOME/.config/deadbeef
-extern char sessfile[1024]; // $HOME/.config/deadbeef/session
+extern char confdir[PATH_MAX]; // $HOME/.config
+extern char dbconfdir[PATH_MAX]; // $HOME/.config/deadbeef
+extern char dbinstalldir[PATH_MAX]; // see deadbeef->get_prefix
+extern char dbdocdir[PATH_MAX]; // see deadbeef->get_doc_dir
+extern char dbplugindir[PATH_MAX]; // see deadbeef->get_plugin_dir
+extern char dbpixmapdir[PATH_MAX]; // see deadbeef->get_pixmap_dir
+
#endif // __COMMON_H
diff --git a/configure.ac b/configure.ac
index 5060b885..d0241d02 100644
--- a/configure.ac
+++ b/configure.ac
@@ -56,9 +56,6 @@ dnl INSANE_CXXFLAGS="-Wcomment -Wchar-subscripts -Wunused-function -Wunused-valu
AC_SUBST(INSANE_CFLAGS)
AC_SUBST(INSANE_CXXFLAGS)
-CXXFLAGS="$CXXFLAGS $INSANE_CXXFLAGS -D_GNU_SOURCE -DLIBDIR=\\\"$libdir\\\" -DPREFIX=\\\"$prefix\\\" -DDOCDIR=\\\"$docdir\\\""
-CFLAGS="$CFLAGS $INSANE_CFLAGS -D_GNU_SOURCE -DLIBDIR=\\\"$libdir\\\" -DPREFIX=\\\"$prefix\\\" -DDOCDIR=\\\"$docdir\\\""
-
AC_ARG_ENABLE(nullout, [ --disable-nullout disable NULL output plugin (default: enabled)], [enable_nullout=$enableval], [enable_nullout=yes])
AC_ARG_ENABLE(alsa, [ --disable-alsa disable ALSA output plugin (default: enabled)], [enable_alsa=$enableval], [enable_alsa=yes])
AC_ARG_ENABLE(oss, [ --disable-oss disable Open Sound System output plugin (default: enabled)], [enable_oss=$enableval], [enable_oss=yes])
@@ -84,16 +81,28 @@ AC_ARG_ENABLE(cdda, [ --disable-cdda disable CD-Audio plugin (defa
AC_ARG_ENABLE(gme, [ --disable-gme disable Game Music Emu plugin for NSF, AY, etc (default: enabled)], [enable_gme=$enableval], [enable_gme=yes])
AC_ARG_ENABLE(dumb, [ --disable-dumb disable D.U.M.B. plugin for MOD, S3M and other tracker formats (default: enabled)], [enable_dumb=$enableval], [enable_dumb=yes])
AC_ARG_ENABLE(notify, [ --disable-notify disable notification-daemon support plugin (default: enabled)], [enable_notify=$enableval], [enable_notify=yes])
-AC_ARG_ENABLE(shellexec, [ --disable-shellexec disable shell commands plugin (default: enabled)], [enable_shellexec=$enableval], [enable_shellexec=yes])
+AC_ARG_ENABLE(shellexec,[ --disable-shellexec disable shell commands plugin (default: enabled)], [enable_shellexec=$enableval], [enable_shellexec=yes])
AC_ARG_ENABLE(musepack, [ --disable-musepack disable musepack plugin (default: enabled)], [enable_musepack=$enableval], [enable_musepack=yes])
AC_ARG_ENABLE(wildmidi, [ --disable-wildmidi disable wildmidi plugin (default: enabled)], [enable_wildmidi=$enableval], [enable_wildmidi=yes])
-AC_ARG_ENABLE(tta, [ --disable-tta disable tta plugin (default: enabled)], [enable_tta=$enableval], [enable_tta=yes])
-AC_ARG_ENABLE(dca, [ --disable-dca disable dca (DTS audio) plugin (default: enabled)], [enable_dca=$enableval], [enable_dca=yes])
-AC_ARG_ENABLE(aac, [ --disable-aac disable AAC decoder based on FAAD2 (default: enabled)], [enable_aac=$enableval], [enable_aac=yes])
-AC_ARG_ENABLE(mms, [ --disable-mms disable MMS streaming vfs plugin (default: enabled)], [enable_mms=$enableval], [enable_mms=yes])
-AC_ARG_ENABLE(shn, [ --disable-shn disable shorten plugin (default: enabled)], [enable_shn=$enableval], [enable_shn=yes])
-AC_ARG_ENABLE(ao, [ --disable-ao disable audio overload plugin (default: enabled)], [enable_ao=$enableval], [enable_ao=yes])
-AC_ARG_ENABLE(mpris, [ --enable-mpris disable Ubuntu Sound Menu plugin (default: disabled)], [enable_mpris=$enableval], [enable_mpris=yes])
+AC_ARG_ENABLE(tta, [ --disable-tta disable tta plugin (default: enabled)], [enable_tta=$enableval], [enable_tta=yes])
+AC_ARG_ENABLE(dca, [ --disable-dca disable dca (DTS audio) plugin (default: enabled)], [enable_dca=$enableval], [enable_dca=yes])
+AC_ARG_ENABLE(aac, [ --disable-aac disable AAC decoder based on FAAD2 (default: enabled)], [enable_aac=$enableval], [enable_aac=yes])
+AC_ARG_ENABLE(mms, [ --disable-mms disable MMS streaming vfs plugin (default: enabled)], [enable_mms=$enableval], [enable_mms=yes])
+AC_ARG_ENABLE(shn, [ --disable-shn disable shorten plugin (default: enabled)], [enable_shn=$enableval], [enable_shn=yes])
+AC_ARG_ENABLE(ao, [ --disable-ao disable audio overload plugin (default: enabled)], [enable_ao=$enableval], [enable_ao=yes])
+AC_ARG_ENABLE(mpris, [ --enable-mpris enable Ubuntu Sound Menu plugin (default: disabled)], [enable_mpris=$enableval], [enable_mpris=yes])
+AC_ARG_ENABLE(portable, [ --enable-portable make portable static build (default: disabled)], [enable_portable=$enableval], [enable_portable=no])
+
+if test "x$enable_portable" != "xno" ; then
+ AC_DEFINE_UNQUOTED([PORTABLE], [1], [Define if building portable version])
+ PORTABLE=yes
+ PREFIXFLAGS="-DPREFIX=donotuse -DLIBDIR=donotuse -DDOCDIR=donotuse"
+else
+ PREFIXFLAGS=" -DLIBDIR=\\\"$libdir\\\" -DPREFIX=\\\"$prefix\\\" -DDOCDIR=\\\"$docdir\\\""
+fi
+
+CXXFLAGS="$CXXFLAGS $INSANE_CXXFLAGS -D_GNU_SOURCE $PREFIXFLAGS"
+CFLAGS="$CFLAGS $INSANE_CFLAGS -D_GNU_SOURCE $PREFIXFLAGS"
PKG_CHECK_MODULES(DEPS, samplerate)
@@ -436,6 +445,7 @@ AM_CONDITIONAL(HAVE_MMS, test "x$HAVE_MMS" = "xyes")
AM_CONDITIONAL(HAVE_SHN, test "x$HAVE_SHN" = "xyes")
AM_CONDITIONAL(HAVE_AO, test "x$HAVE_AO" = "xyes")
AM_CONDITIONAL(HAVE_MPRIS, test "x$HAVE_MPRIS" = "xyes")
+AM_CONDITIONAL(PORTABLE, test "x$PORTABLE" = "xyes")
AC_SUBST(PLUGINS_DIRS)
diff --git a/deadbeef.h b/deadbeef.h
index 337219ed..bd5ca217 100644
--- a/deadbeef.h
+++ b/deadbeef.h
@@ -64,8 +64,8 @@ extern "C" {
// 0.2 -- deadbeef-0.2.3
// 0.1 -- deadbeef-0.2.0
-#define DB_API_VERSION_MAJOR 0
-#define DB_API_VERSION_MINOR 8
+#define DB_API_VERSION_MAJOR 9
+#define DB_API_VERSION_MINOR 9
#define DB_PLUGIN_SET_API_VERSION\
.plugin.api_vmajor = DB_API_VERSION_MAJOR,\
@@ -317,8 +317,15 @@ typedef struct {
int (*streamer_get_apx_bitrate) (void);
struct DB_fileinfo_s *(*streamer_get_current_fileinfo) (void);
int (*streamer_get_current_playlist) (void);
+ // system folders
+ // normally functions will return standard folders derived from --prefix
+ // portable version will return pathes specified in comments below
+ const char *(*get_config_dir) (void); // installdir/config | $XDG_CONFIG_HOME/.config/deadbeef
+ const char *(*get_prefix) (void); // installdir | PREFIX
+ const char *(*get_doc_dir) (void); // installdir/doc | DOCDIR
+ const char *(*get_plugin_dir) (void); // installdir/plugins | LIBDIR/deadbeef
+ const char *(*get_pixmap_dir) (void); // installdir/pixmaps | PREFIX "/share/deadbeef/pixmaps"
// process control
- const char *(*get_config_dir) (void);
void (*quit) (void);
// threading
intptr_t (*thread_start) (void (*fn)(void *ctx), void *ctx);
diff --git a/main.c b/main.c
index 75185052..4552e00f 100644
--- a/main.c
+++ b/main.c
@@ -54,10 +54,7 @@
#include "conf.h"
#include "volume.h"
#include "plugins.h"
-
-#ifndef PATH_MAX
-#define PATH_MAX 1024 /* max # of characters in a path name */
-#endif
+#include "common.h"
#ifndef PREFIX
#error PREFIX must be defined
@@ -67,12 +64,18 @@
#define USE_ABSTRACT_NAME 0
#endif
-//#define trace(...) { fprintf(stderr, __VA_ARGS__); }
-#define trace(fmt,...)
+#define trace(...) { fprintf(stderr, __VA_ARGS__); }
+//#define trace(fmt,...)
+
// some common global variables
-char confdir[1024]; // $HOME/.config
-char dbconfdir[1024]; // $HOME/.config/deadbeef
+char sys_install_path[PATH_MAX]; // see deadbeef->get_prefix
+char confdir[PATH_MAX]; // $HOME/.config
+char dbconfdir[PATH_MAX]; // $HOME/.config/deadbeef
+char dbinstalldir[PATH_MAX]; // see deadbeef->get_prefix
+char dbdocdir[PATH_MAX]; // see deadbeef->get_doc_dir
+char dbplugindir[PATH_MAX]; // see deadbeef->get_plugin_dir
+char dbpixmapdir[PATH_MAX]; // see deadbeef->get_pixmap_dir
// client-side commandline support
// -1 error, program must exit with error code -1
@@ -529,11 +532,45 @@ main (int argc, char *argv[]) {
bind_textdomain_codeset (PACKAGE, "UTF-8");
textdomain (PACKAGE);
#endif
- fprintf (stderr, "starting deadbeef " VERSION "\n");
+ fprintf (stderr, "starting deadbeef " VERSION "%s\n", PORTABLE ? " [portable build]" : "");
srand (time (NULL));
#ifdef __linux__
prctl (PR_SET_NAME, "deadbeef-main", 0, 0, 0, 0);
#endif
+
+#if PORTABLE
+ strcpy (dbinstalldir, argv[0]);
+ char *e = dbinstalldir + strlen (dbinstalldir);
+ while (e >= dbinstalldir && *e != '/') {
+ e--;
+ }
+ *e = 0;
+ if (snprintf (confdir, sizeof (confdir), "%s/config", dbinstalldir) > sizeof (confdir)) {
+ fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir);
+ return -1;
+ }
+
+ strcpy (dbconfdir, confdir);
+
+ if (snprintf (dbdocdir, sizeof (dbdocdir), "%s/doc", dbinstalldir) > sizeof (dbdocdir)) {
+ fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir);
+ return -1;
+ }
+ if (snprintf (dbplugindir, sizeof (dbplugindir), "%s/plugins", dbinstalldir) > sizeof (dbplugindir)) {
+ fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir);
+ return -1;
+ }
+ if (snprintf (dbpixmapdir, sizeof (dbpixmapdir), "%s/pixmaps", dbinstalldir) > sizeof (dbpixmapdir)) {
+ fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir);
+ return -1;
+ }
+ trace ("installdir: %s\n", dbinstalldir);
+ trace ("confdir: %s\n", confdir);
+ trace ("docdir: %s\n", dbdocdir);
+ trace ("plugindir: %s\n", dbplugindir);
+ mkdir (dbplugindir, 0755);
+ trace ("pixmapdir: %s\n", dbpixmapdir);
+#else
char *homedir = getenv ("HOME");
if (!homedir) {
fprintf (stderr, "unable to find home directory. stopping.\n");
@@ -553,11 +590,25 @@ main (int argc, char *argv[]) {
return -1;
}
}
- mkdir (confdir, 0755);
if (snprintf (dbconfdir, sizeof (dbconfdir), "%s/deadbeef", confdir) > sizeof (dbconfdir)) {
fprintf (stderr, "fatal: out of memory while configuring\n");
return -1;
}
+ mkdir (confdir, 0755);
+ if (snprintf (dbdocdir, sizeof (dbdocdir), "%s", DOCDIR) > sizeof (dbdocdir)) {
+ fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir);
+ return -1;
+ }
+ if (snprintf (dbplugindir, sizeof (dbplugindir), "%s/deadbeef", LIBDIR) > sizeof (dbplugindir)) {
+ fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir);
+ return -1;
+ }
+ if (snprintf (dbpixmapdir, sizeof (dbpixmapdir), "%s/share/deadbeef/pixmaps", PREFIX) > sizeof (dbpixmapdir)) {
+ fprintf (stderr, "fatal: too long install path %s\n", dbinstalldir);
+ return -1;
+ }
+#endif
+
mkdir (dbconfdir, 0755);
char cmdline[2048];
@@ -679,7 +730,9 @@ main (int argc, char *argv[]) {
conf_load (); // required by some plugins at startup
volume_set_db (conf_get_float ("playback.volume", 0)); // volume need to be initialized before plugins start
messagepump_init (); // required to push messages while handling commandline
- plug_load_all (); // required to add files to playlist from commandline
+ if (plug_load_all ()) { // required to add files to playlist from commandline
+ exit (-1);
+ }
pl_load_all ();
plt_set_curr (conf_get_int ("playlist.current", 0));
diff --git a/plugins.c b/plugins.c
index 331baab9..61a95d33 100644
--- a/plugins.c
+++ b/plugins.c
@@ -88,8 +88,13 @@ static DB_functions_t deadbeef_api = {
.streamer_get_apx_bitrate = streamer_get_apx_bitrate,
.streamer_get_current_fileinfo = streamer_get_current_fileinfo,
.streamer_get_current_playlist = streamer_get_current_playlist,
- // process control
+ // folders
.get_config_dir = plug_get_config_dir,
+ .get_prefix = plug_get_prefix,
+ .get_doc_dir = plug_get_doc_dir,
+ .get_plugin_dir = plug_get_plugin_dir,
+ .get_pixmap_dir = plug_get_pixmap_dir,
+ // process control
.quit = plug_quit,
// threading
.thread_start = thread_start,
@@ -267,6 +272,26 @@ plug_get_config_dir (void) {
return dbconfdir;
}
+const char *
+plug_get_prefix (void) {
+ return dbinstalldir;
+}
+
+const char *
+plug_get_doc_dir (void) {
+ return dbdocdir;
+}
+
+const char *
+plug_get_plugin_dir (void) {
+ return dbplugindir;
+}
+
+const char *
+plug_get_pixmap_dir (void) {
+ return dbpixmapdir;
+}
+
void
plug_volume_set_db (float db) {
volume_set_db (db);
@@ -566,7 +591,7 @@ plug_load_all (void) {
const char *conf_blacklist_plugins = conf_get_str ("blacklist_plugins", "");
trace ("plug: mutex_create\n");
mutex = mutex_create ();
- const char *dirname = LIBDIR "/deadbeef";
+ const char *dirname = deadbeef->get_plugin_dir ();
struct dirent **namelist = NULL;
char *xdg_local_home = getenv ("XDG_LOCAL_HOME");
diff --git a/plugins.h b/plugins.h
index 231eaf1f..fc49930e 100644
--- a/plugins.h
+++ b/plugins.h
@@ -113,6 +113,14 @@ plug_volume_set_amp (float amp);
const char *
plug_get_config_dir (void);
+const char *
+plug_get_prefix (void);
+const char *
+plug_get_doc_dir (void);
+const char *
+plug_get_plugin_dir (void);
+const char *
+plug_get_pixmap_dir (void);
int
plug_activate (DB_plugin_t *plug, int activate);
diff --git a/plugins/artwork/artwork.c b/plugins/artwork/artwork.c
index fbbe71d9..469ec8bb 100644
--- a/plugins/artwork/artwork.c
+++ b/plugins/artwork/artwork.c
@@ -16,7 +16,7 @@
//#define trace(...) { fprintf(stderr, __VA_ARGS__); }
#define trace(...)
-#define DEFAULT_COVER_PATH (PREFIX "/share/deadbeef/pixmaps/noartwork.jpg")
+static char default_cover[PATH_MAX];
#define DEFAULT_FILEMASK "*cover*.jpg;*front*.jpg"
static DB_artwork_plugin_t plugin;
@@ -41,12 +41,16 @@ static volatile int terminate;
static volatile int clear_queue;
static intptr_t tid;
-int artwork_enable_embedded;
-int artwork_enable_local;
-int artwork_enable_lfm;
-int artwork_enable_aao;
-int artwork_reset_time;
-char artwork_filemask[200];
+static int artwork_enable_embedded;
+static int artwork_enable_local;
+static int artwork_enable_lfm;
+static int artwork_enable_aao;
+static int artwork_reset_time;
+static char artwork_filemask[200];
+
+static const char *get_default_cover (void) {
+ return default_cover;
+}
void
make_cache_dir_path (char *path, int size, const char *album, const char *artist) {
@@ -568,11 +572,11 @@ get_album_art (const char *fname, const char *artist, const char *album, artwork
if (!*artist || !*album)
{
//give up
- return strdup (DEFAULT_COVER_PATH);
+ return strdup (get_default_cover ());
}
if (!deadbeef->is_local_file (fname)) {
- return strdup (DEFAULT_COVER_PATH);
+ return strdup (get_default_cover ());
}
make_cache_path (path, sizeof (path), album, artist);
@@ -586,7 +590,7 @@ get_album_art (const char *fname, const char *artist, const char *album, artwork
trace ("reloading cached file %s\n", path);
unlink (path);
queue_add (fname, artist, album, callback, user_data);
- return strdup (DEFAULT_COVER_PATH);
+ return strdup (get_default_cover ());
}
trace ("found %s in cache\n", path);
@@ -594,7 +598,7 @@ get_album_art (const char *fname, const char *artist, const char *album, artwork
}
queue_add (fname, artist, album, callback, user_data);
- return strdup (DEFAULT_COVER_PATH);
+ return strdup (get_default_cover ());
}
DB_plugin_t *
@@ -664,6 +668,13 @@ artwork_on_configchanged (DB_event_t *ev, uintptr_t data) {
static int
artwork_plugin_start (void)
{
+ const char *def_art = deadbeef->conf_get_str ("gtkui.nocover_pixmap", NULL);
+ if (!def_art) {
+ snprintf (default_cover, sizeof (default_cover), "%s/noartwork.jpg", deadbeef->get_pixmap_dir ());
+ }
+ else {
+ strcpy (default_cover, def_art);
+ }
terminate = 0;
artwork_enable_embedded = deadbeef->conf_get_int ("artwork.enable_embedded", 1);
@@ -720,6 +731,7 @@ static const char settings_dlg[] =
"property \"Fetch from last.fm\" checkbox artwork.enable_lastfm 0;\n"
"property \"Fetch from albumart.org\" checkbox artwork.enable_albumartorg 0;\n"
;
+
// define plugin interface
static DB_artwork_plugin_t plugin = {
.plugin.plugin.api_vmajor = DB_API_VERSION_MAJOR,
@@ -736,4 +748,5 @@ static DB_artwork_plugin_t plugin = {
.plugin.plugin.configdialog = settings_dlg,
.get_album_art = get_album_art,
.reset = artwork_reset,
+ .get_default_cover = get_default_cover,
};
diff --git a/plugins/artwork/artwork.h b/plugins/artwork/artwork.h
index ab0fead6..ed5357df 100644
--- a/plugins/artwork/artwork.h
+++ b/plugins/artwork/artwork.h
@@ -14,6 +14,7 @@ typedef struct {
// this has to be called to clear queue on exit, before caller terminates
// `fast=1' means "don't wait, just flush queue"
void (*reset) (int fast);
+ const char *(*get_default_cover) (void);
} DB_artwork_plugin_t;
#endif /*__ARTWORK_H*/
diff --git a/plugins/gtkui/callbacks.c b/plugins/gtkui/callbacks.c
index 58a3da41..7ca76d0c 100644
--- a/plugins/gtkui/callbacks.c
+++ b/plugins/gtkui/callbacks.c
@@ -689,7 +689,7 @@ on_help1_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
char fname[PATH_MAX];
- snprintf (fname, sizeof (fname), DOCDIR "/%s", _("help.txt"));
+ snprintf (fname, sizeof (fname), "%s/%s", deadbeef->get_doc_dir (), _("help.txt"));
show_info_window (fname, _("Help"), &helpwindow);
}
@@ -702,7 +702,7 @@ on_about1_activate (GtkMenuItem *menuitem,
char s[200];
snprintf (s, sizeof (s), _("About DeaDBeeF %s"), VERSION);
char fname[PATH_MAX];
- snprintf (fname, sizeof (fname), DOCDIR "/%s", "about.txt");
+ snprintf (fname, sizeof (fname), "%s/%s", deadbeef->get_doc_dir (), "about.txt");
show_info_window (fname, s, &aboutwindow);
}
@@ -715,7 +715,7 @@ on_changelog1_activate (GtkMenuItem *menuitem,
char s[200];
snprintf (s, sizeof (s), _("DeaDBeeF %s ChangeLog"), VERSION);
char fname[PATH_MAX];
- snprintf (fname, sizeof (fname), DOCDIR "/%s", "ChangeLog");
+ snprintf (fname, sizeof (fname), "%s/%s", deadbeef->get_doc_dir (), "ChangeLog");
show_info_window (fname, s, &changelogwindow);
}
@@ -726,7 +726,7 @@ on_gpl1_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
char fname[PATH_MAX];
- snprintf (fname, sizeof (fname), DOCDIR "/%s", "COPYING.GPLv2");
+ snprintf (fname, sizeof (fname), "%s/%s", deadbeef->get_doc_dir (), "COPYING.GPLv2");
show_info_window (fname, "GNU GENERAL PUBLIC LICENSE Version 2", &gplwindow);
}
@@ -737,7 +737,7 @@ on_lgpl1_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
char fname[PATH_MAX];
- snprintf (fname, sizeof (fname), DOCDIR "/%s", "COPYING.LGPLv2.1");
+ snprintf (fname, sizeof (fname), "%s/%s", deadbeef->get_doc_dir (), "COPYING.LGPLv2.1");
show_info_window (fname, "GNU LESSER GENERAL PUBLIC LICENSE Version 2.1", &lgplwindow);
}
@@ -1079,7 +1079,7 @@ on_translators1_activate (GtkMenuItem *menuitem,
char s[200];
snprintf (s, sizeof (s), _("DeaDBeeF Translators"));
char fname[PATH_MAX];
- snprintf (fname, sizeof (fname), DOCDIR "/%s", "translators.txt");
+ snprintf (fname, sizeof (fname), "%s/%s", deadbeef->get_doc_dir (), "translators.txt");
show_info_window (fname, s, &translatorswindow);
}
diff --git a/plugins/gtkui/coverart.c b/plugins/gtkui/coverart.c
index 7fb50554..ffd2c2b2 100644
--- a/plugins/gtkui/coverart.c
+++ b/plugins/gtkui/coverart.c
@@ -25,8 +25,6 @@
#include "../artwork/artwork.h"
#include "gtkui.h"
-#define DEFAULT_COVER_PATH (PREFIX "/share/deadbeef/pixmaps/noartwork.jpg")
-
//#define trace(...) { fprintf(stderr, __VA_ARGS__); }
#define trace(...)
@@ -151,9 +149,10 @@ loading_thread (void *none) {
g_error_free (error);
error = NULL;
}
- pixbuf = gdk_pixbuf_new_from_file_at_scale (DEFAULT_COVER_PATH, queue->width, queue->width, TRUE, &error);
+ const char *defpath = coverart_plugin->get_default_cover ();
+ pixbuf = gdk_pixbuf_new_from_file_at_scale (defpath, queue->width, queue->width, TRUE, &error);
if (!pixbuf) {
- fprintf (stderr, "gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", DEFAULT_COVER_PATH, queue->width, error->message);
+ fprintf (stderr, "gdk_pixbuf_new_from_file_at_scale %s %d failed, error: %s\n", defpath, queue->width, error->message);
}
}
if (error) {
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index ae7ce4ee..2dd40a73 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -899,7 +899,8 @@ void
gtkui_thread (void *ctx) {
// let's start some gtk
g_thread_init (NULL);
- add_pixmap_directory (PREFIX "/share/deadbeef/pixmaps");
+// add_pixmap_directory (PREFIX "/share/deadbeef/pixmaps");
+ add_pixmap_directory (deadbeef->get_pixmap_dir ());
gdk_threads_init ();
gdk_threads_enter ();