aboutsummaryrefslogtreecommitdiffstats
path: root/screen_play.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2004-03-22 18:10:23 +0000
committerKalle Wallin <kaw@linux.se>2004-03-22 18:10:23 +0000
commit070f67aef44e135b2fbe14a35ca8b3f9bb8a1cc7 (patch)
tree8759a47ea4639621726e44667d28bd7ba797a7ae /screen_play.c
parent3da656b83260ef257675a4ae4c681b3b99f83353 (diff)
downloadmpd-070f67aef44e135b2fbe14a35ca8b3f9bb8a1cc7.tar.gz
mpd-070f67aef44e135b2fbe14a35ca8b3f9bb8a1cc7.tar.xz
mpd-070f67aef44e135b2fbe14a35ca8b3f9bb8a1cc7.zip
Added find (in page) functionality.
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@369 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--screen_play.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/screen_play.c b/screen_play.c
index 161e611a3..5ba3839c8 100644
--- a/screen_play.c
+++ b/screen_play.c
@@ -84,7 +84,6 @@ play_update(screen_t *screen, mpd_client_t *c)
int
play_cmd(screen_t *screen, mpd_client_t *c, command_t cmd)
{
- char buf[256];
mpd_Song *song;
switch(cmd)
@@ -94,10 +93,9 @@ play_cmd(screen_t *screen, mpd_client_t *c, command_t cmd)
file_clear_highlight(c, song);
mpd_sendDeleteCommand(c->connection, screen->playlist->selected);
mpd_finishCommand(c->connection);
- snprintf(buf, 256,
- "Removed \'%s\' from playlist!",
- mpc_get_song_name(song));
- screen_status_message(c, buf);
+ screen_status_printf(c,
+ "Removed \'%s\' from playlist!",
+ mpc_get_song_name(song));
break;
case CMD_LIST_PREVIOUS:
list_window_previous(screen->playlist);
@@ -122,6 +120,29 @@ play_cmd(screen_t *screen, mpd_client_t *c, command_t cmd)
list_window_previous_page(screen->playlist);
screen->playlist->repaint = 1;
break;
+ case CMD_LIST_FIND:
+ if( screen->findbuf )
+ {
+ free(screen->findbuf);
+ screen->findbuf=NULL;
+ }
+ /* fall throw... */
+ case CMD_LIST_FIND_NEXT:
+ if( !screen->findbuf )
+ screen->findbuf=screen_readln(screen->status_window.w, "/");
+ if( list_window_find(screen->playlist,
+ list_callback,
+ c,
+ screen->findbuf) == 0 )
+ {
+ screen->playlist->repaint = 1;
+ }
+ else
+ {
+ screen_status_printf(c, "Unable to find \'%s\'", screen->findbuf);
+ beep();
+ }
+ break;
default:
return 0;
}