summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3e738fd)
raw | patch | inline | side by side (parent: 3e738fd)
author | Max Kellermann <max@duempel.org> | |
Thu, 25 Sep 2008 15:42:30 +0000 (17:42 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 25 Sep 2008 15:42:30 +0000 (17:42 +0200) |
lyrics_repaint() or lyrics_repaint_if_active() are called after data
has changed, and the screen needs an update.
has changed, and the screen needs an update.
src/screen_lyrics.c | patch | blob | history |
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index 931b114fb86eb789d697ef4a5b7e827ac5f3361a..a039c3859e4df42ccfbe3932283029055e4cde2c 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
g_ptr_array_set_size(current.lines, 0);
}
-static const char *
-list_callback(unsigned idx, int *highlight, void *data);
+static void
+lyrics_paint(mpdclient_t *c);
+
+/**
+ * Repaint and update the screen.
+ */
+static void
+lyrics_repaint(void)
+{
+ lyrics_paint(NULL);
+ wrefresh(lw->w);
+}
+
+/**
+ * Repaint and update the screen, if it is currently active.
+ */
+static void
+lyrics_repaint_if_active(void)
+{
+ if (get_cur_mode_id() == 104) { /* XXX don't use the literal number */
+ lyrics_repaint();
+
+ /* XXX repaint the screen title */
+ }
+}
static void
screen_lyrics_set(const GString *str)
/* paint new data */
- if (get_cur_mode_id() == 104) { /* XXX don't use the literal number */
- list_window_paint(lw, list_callback, NULL);
- wrefresh(lw->w);
-
- /* XXX repaint the screen title */
- }
+ lyrics_repaint_if_active();
}
static void
case CMD_LYRICS_UPDATE:
if (c->song != NULL) {
screen_lyrics_load(c->song);
- lyrics_paint(NULL);
- wrefresh(lw->w);
+ lyrics_repaint();
}
return 1;
default: