aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndreas Obergrusberger <tradiaz@yahoo.de>2006-08-05 20:27:03 +0000
committerAndreas Obergrusberger <tradiaz@yahoo.de>2006-08-05 20:27:03 +0000
commitdc65f5efcde822072b38909aa409d92ef17c291b (patch)
treef9bd5ad2ccb477db7a088604d52b375fd4e6c074 /src
parent08adffa6d506e99203bb7a7a62ffb540f647e408 (diff)
downloadmpd-dc65f5efcde822072b38909aa409d92ef17c291b.tar.gz
mpd-dc65f5efcde822072b38909aa409d92ef17c291b.tar.xz
mpd-dc65f5efcde822072b38909aa409d92ef17c291b.zip
interruption of lyrics loading + po blabla
git-svn-id: https://svn.musicpd.org/ncmpc/branches/tradiaz@4567 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/command.c2
-rw-r--r--src/command.h1
-rw-r--r--src/screen_help.c1
-rw-r--r--src/screen_lyrics.c9
4 files changed, 9 insertions, 4 deletions
diff --git a/src/command.c b/src/command.c
index 6766e2ac3..9802fc387 100644
--- a/src/command.c
+++ b/src/command.c
@@ -191,6 +191,8 @@ static command_definition_t cmds[] =
#ifdef ENABLE_LYRICS_SCREEN
{ {'7', F7, 0 }, 0, CMD_SCREEN_LYRICS, "screen-lyrics",
N_("Lyrics screen") },
+ { {ESC, 0, 0 }, 0, CMD_INTERRUPT, "screen-lyrics",
+ N_("Interrupt action") },
#endif
diff --git a/src/command.h b/src/command.h
index 6da0025c2..fd8c47c9a 100644
--- a/src/command.h
+++ b/src/command.h
@@ -53,6 +53,7 @@ typedef enum
CMD_SCREEN_CLOCK,
CMD_SCREEN_HELP,
CMD_SCREEN_LYRICS,
+ CMD_INTERRUPT,
CMD_QUIT
} command_t;
diff --git a/src/screen_help.c b/src/screen_help.c
index c90c8692d..90032cf9a 100644
--- a/src/screen_help.c
+++ b/src/screen_help.c
@@ -132,6 +132,7 @@ static help_text_row_t help_text[] =
{ 2, CMD_NONE, NULL },
{ 0, CMD_SCREEN_LYRICS, N_("View Lyrics") },
{ 0, CMD_SELECT, N_("(Re)load lyrics") },
+ { 0, CMD_INTERRUPT, N_("Interrupt retrieval") },
#endif
{ 0, CMD_NONE, NULL },
{-1, CMD_NONE, NULL }
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index 15f5721ec..c068a43ed 100644
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
@@ -59,9 +59,6 @@ guint8 result;
char *hid;
GTimer *dltime;
short int lock;
-//GString *lyr_text;
-//char *lyr_text;
-//GArray *textline;
formed_text lyr_text;
/* result is a bitset in which the succes when searching 4 lyrics is logged
countend by position - backwards
@@ -217,11 +214,12 @@ void check_repaint()
int check_dl_progress(void *clientp, double dltotal, double dlnow,
double ultotal, double ulnow)
{
- if(g_timer_elapsed(dltime, NULL) >= options.lyrics_timeout)
+ if(g_timer_elapsed(dltime, NULL) >= options.lyrics_timeout || lock == 4)
{
formed_text_init(&lyr_text);
return -1;
}
+
return 0;
}
@@ -493,6 +491,9 @@ lyrics_cmd(screen_t *screen, mpdclient_t *c, command_t cmd)
return 1;
case CMD_SELECT:
g_thread_create(get_lyr, c, FALSE, NULL);
+ return 1;
+ case CMD_INTERRUPT:
+ if(lock != 0) lock = 4;
return 1;
default:
break;