summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a14b635)
raw | patch | inline | side by side (parent: a14b635)
author | Kalle Wallin <kaw@linux.se> | |
Wed, 9 Jun 2004 17:31:24 +0000 (17:31 +0000) | ||
committer | Kalle Wallin <kaw@linux.se> | |
Wed, 9 Jun 2004 17:31:24 +0000 (17:31 +0000) |
src/main.c | patch | blob | history | |
src/mpc.c | patch | blob | history | |
src/ncmpc.h | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index 176bcf8a04a45a55f69f7b361aa557d5e8c1add7..7a44f09851b876957898c01af199573c510bc2c3 100644 (file)
--- a/src/main.c
+++ b/src/main.c
/*
* $Id$
*
- * (c) 2004 by Kalle Wallin (kaw@linux.se)
+ * (c) 2004 by Kalle Wallin <kaw@linux.se>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
}
else
mpd_finishCommand(mpc->connection);
+
g_timer_start(timer);
}
}
else if( options->reconnect )
{
- sleep(MPD_RECONNECT_TIMEOUT);
- screen_status_printf(_("Connecting to %s... [Press Ctrl-C to abort]"),
- options->host);
+ if( get_keyboard_command_with_timeout(MPD_RECONNECT_TIME)==CMD_QUIT)
+ exit(EXIT_SUCCESS);
+ screen_status_printf(_("Connecting to %s... [Press %s to abort]"),
+ options->host, get_key_names(CMD_QUIT,0) );
if( mpc_reconnect(mpc,
options->host,
options->port,
diff --git a/src/mpc.c b/src/mpc.c
index a2db4c62f994eab8739cadfaf65aae7c174a3e51..e5b6a2e8b5b40e58e7efeae85360f7ff390aeba8 100644 (file)
--- a/src/mpc.c
+++ b/src/mpc.c
{
mpd_Connection *connection;
- connection = mpd_newConnection(host, port, 10);
+ connection = mpd_newConnection(host, port, 1);
if( connection==NULL )
return -1;
if( connection->error )
diff --git a/src/ncmpc.h b/src/ncmpc.h
index 2708aac50873b1d3a5539707cc1ec8d804550d12..93e48d541235219e97e75dc4fcd98cebe6b0fe8d 100644 (file)
--- a/src/ncmpc.h
+++ b/src/ncmpc.h
/* time in seconds between mpd updates (double) */
#define MPD_UPDATE_TIME 0.5
-/* timout in seconds before trying to reconnect (int) */
-#define MPD_RECONNECT_TIMEOUT 3
+/* time in milliseconds before trying to reconnect (int) */
+#define MPD_RECONNECT_TIME 1000
#endif /* NCMPC_H */