aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-11-25 21:11:23 +0100
committerMax Kellermann <max@duempel.org>2008-11-25 21:11:23 +0100
commita992f12521da4f9024f8022ea6b8aa3794ea5a99 (patch)
treeb55567c86e780a597e8633aa150510d006639806
parente8e36c5003ebaf4b4057916eeecc8e90d1435c90 (diff)
downloadmpd-a992f12521da4f9024f8022ea6b8aa3794ea5a99.tar.gz
mpd-a992f12521da4f9024f8022ea6b8aa3794ea5a99.tar.xz
mpd-a992f12521da4f9024f8022ea6b8aa3794ea5a99.zip
ncmpc-mini: disable scrolling
The scrolling code broke in the ncmpc-mini build. Disable it when --enable-mini was specified.
Diffstat (limited to '')
-rw-r--r--src/screen_play.c10
-rw-r--r--src/support.c4
-rw-r--r--src/support.h6
3 files changed, 19 insertions, 1 deletions
diff --git a/src/screen_play.c b/src/screen_play.c
index b4fb15f57..525207618 100644
--- a/src/screen_play.c
+++ b/src/screen_play.c
@@ -93,7 +93,9 @@ static const char *
list_callback(unsigned idx, int *highlight, G_GNUC_UNUSED void *data)
{
static char songname[MAX_SONG_LENGTH];
+#ifndef NCMPC_MINI
static scroll_state_t st;
+#endif
mpd_Song *song;
if (playlist == NULL || idx >= playlist_length(playlist))
@@ -105,6 +107,7 @@ list_callback(unsigned idx, int *highlight, G_GNUC_UNUSED void *data)
strfsong(songname, MAX_SONG_LENGTH, options.list_format, song);
+#ifndef NCMPC_MINI
if (options.scroll && (unsigned)song->pos == lw->selected &&
utf8_width(songname) > (unsigned)COLS) {
static unsigned current_song;
@@ -121,6 +124,7 @@ list_callback(unsigned idx, int *highlight, G_GNUC_UNUSED void *data)
g_free(tmp);
} else if ((unsigned)song->pos == lw->selected)
st.offset = 0;
+#endif
return songname;
}
@@ -468,7 +472,11 @@ play_update(mpdclient_t *c)
current_song_id = c->song != NULL && c->status != NULL &&
!IS_STOPPED(c->status->state) ? c->song->id : -1;
- if (options.scroll || current_song_id != prev_song_id) {
+ if (current_song_id != prev_song_id
+#ifndef NCMPC_MINI
+ || options.scroll
+#endif
+ ) {
prev_song_id = current_song_id;
/* center the cursor */
diff --git a/src/support.c b/src/support.c
index 8d9d0d010..68dc55887 100644
--- a/src/support.c
+++ b/src/support.c
@@ -43,6 +43,8 @@ strcasestr(const char *haystack, const char *needle)
}
#endif /* HAVE_STRCASESTR */
+#ifndef NCMPC_MINI
+
// FIXME: utf-8 length
char *
strscroll(char *str, char *separator, int width, scroll_state_t *st)
@@ -90,3 +92,5 @@ strscroll(char *str, char *separator, int width, scroll_state_t *st)
g_free(tmp);
return buf;
}
+
+#endif
diff --git a/src/support.h b/src/support.h
index 95bde4691..f7c08325d 100644
--- a/src/support.h
+++ b/src/support.h
@@ -1,10 +1,14 @@
#ifndef SUPPORT_H
#define SUPPORT_H
+#include "config.h"
+
#include <glib.h>
const char *strcasestr(const char *haystack, const char *needle);
+#ifndef NCMPC_MINI
+
typedef struct {
gsize offset;
GTime t; /* GTime is equivalent to time_t */
@@ -13,3 +17,5 @@ typedef struct {
char *strscroll(char *str, char *separator, int width, scroll_state_t *st);
#endif
+
+#endif