summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f55a67b)
raw | patch | inline | side by side (parent: f55a67b)
author | Kalle Wallin <kaw@linux.se> | |
Sat, 5 Jun 2004 12:56:56 +0000 (12:56 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Sat, 5 Jun 2004 12:56:56 +0000 (12:56 +0000) |
src/command.c | patch | blob | history | |
src/command.h | patch | blob | history | |
src/screen.c | patch | blob | history | |
src/screen_help.c | patch | blob | history |
diff --git a/src/command.c b/src/command.c
index 1e9edcd0d5096e65088968c10beed11b105a6081..bb7dd7bc233adeafa2914dcec5b6d4ca313d3398 100644 (file)
--- a/src/command.c
+++ b/src/command.c
"Toggle random mode" },
{ { 'x', 0, 0 }, CMD_CROSSFADE, "crossfade",
"Toggle crossfade mode" },
+ { { 21, 0, 0 }, CMD_DB_UPDATE, "db-update",
+ "Start a music database update" },
+
{ { 'S', 0, 0 }, CMD_SAVE_PLAYLIST, "save",
"Save playlist" },
diff --git a/src/command.h b/src/command.h
index 1ce67e894c0c615b19e8c8adedb39c6b1027f013..f880998dcdc028e06b97fce5e590a762750b9edf 100644 (file)
--- a/src/command.h
+++ b/src/command.h
CMD_DELETE,
CMD_REPEAT,
CMD_CROSSFADE,
+ CMD_DB_UPDATE,
CMD_VOLUME_UP,
CMD_VOLUME_DOWN,
CMD_SAVE_PLAYLIST,
diff --git a/src/screen.c b/src/screen.c
index d846f3df562cd1629cbbed29e5baed970815779e..4059ac24fbb4168c438d24689529b1f99b707fd4 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
void
screen_cmd(mpd_client_t *c, command_t cmd)
{
- int n;
+ int n = 0;
screen_mode_t new_mode = screen->mode;
screen->input_timestamp = time(NULL);
mpd_sendCrossfadeCommand(c->connection, n);
mpd_finishCommand(c->connection);
break;
+ case CMD_DB_UPDATE:
+ if( !c->status->updatingDb )
+ {
+ mpd_sendUpdateCommand(c->connection);
+ n = mpd_getUpdateId(c->connection);
+ mpd_finishCommand(c->connection);
+ if( !mpc_error(c) )
+ screen_status_printf("Database update started [%d]", n);
+ }
+ else
+ screen_status_printf("Database update running...");
+ break;
case CMD_VOLUME_UP:
if( c->status->volume!=MPD_STATUS_NO_VOLUME && c->status->volume<100 )
{
diff --git a/src/screen_help.c b/src/screen_help.c
index c55c963802c4a31cfb33f12857473cb3801bb843..960638d650a3f41396628f76abb86c0cb593f2ca 100644 (file)
--- a/src/screen_help.c
+++ b/src/screen_help.c
{ 0, CMD_REPEAT, NULL },
{ 0, CMD_RANDOM, NULL },
{ 0, CMD_CROSSFADE, NULL },
+ { 0, CMD_DB_UPDATE, NULL },
{ 0, CMD_NONE, NULL },
{ 0, CMD_QUIT, NULL },