summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 242799e)
raw | patch | inline | side by side (parent: 242799e)
author | Max Kellermann <max@duempel.org> | |
Thu, 1 Oct 2009 20:03:33 +0000 (22:03 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Thu, 1 Oct 2009 20:03:33 +0000 (22:03 +0200) |
Better do it manually.
src/main.c | patch | blob | history | |
src/player_command.c | patch | blob | history | |
src/screen.c | patch | blob | history | |
src/screen.h | patch | blob | history | |
src/screen_play.c | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index a03b707d4f47a33809bd4a874ab646573bebe240..43e0dd7a3d2db19a883b5834008260f5ca3a569e 100644 (file)
--- a/src/main.c
+++ b/src/main.c
}
if (options.xterm_title_format && status && song &&
- IS_PLAYING(mpd_status_get_state(status)))
+ mpd_status_get_state(status) == MPD_STATE_PLAY)
strfsong(tmp, BUFSIZE, options.xterm_title_format, song);
else
g_strlcpy(tmp, PACKAGE " version " VERSION, BUFSIZE);
diff --git a/src/player_command.c b/src/player_command.c
index 085ffa14a478f0eba1f211954b7fd3653369c59d..3d6d75ab3c40ed3a27713d7013a3a9db2d18cae3 100644 (file)
--- a/src/player_command.c
+++ b/src/player_command.c
#include "i18n.h"
#include "screen_client.h"
-#define IS_PAUSED(s) (s==MPD_STATE_PAUSE)
-
int seek_id = -1;
int seek_target_time;
*/
case CMD_PAUSE:
if (!mpd_run_pause(c->connection,
- !IS_PAUSED(mpd_status_get_state(c->status))))
+ mpd_status_get_state(c->status) != MPD_STATE_PAUSE))
mpdclient_handle_error(c);
break;
case CMD_STOP:
diff --git a/src/screen.c b/src/screen.c
index cf995383cf361dc0dae0f14e0b517f46ed44675d..f988cb09208d1168dbc74070efd1420e96f5f81e 100644 (file)
--- a/src/screen.c
+++ b/src/screen.c
elapsed = 0;
duration = c->status != NULL &&
- !IS_STOPPED(mpd_status_get_state(c->status))
+ (mpd_status_get_state(c->status) == MPD_STATE_PLAY ||
+ mpd_status_get_state(c->status) == MPD_STATE_PAUSE)
? mpd_status_get_total_time(c->status)
: 0;
diff --git a/src/screen.h b/src/screen.h
index 17fc3d46d14691b7a27c30a9fc7db2ee0b2f89e5..5ed300fa67551d4cad85127e4558a20bd71cc4dc 100644 (file)
--- a/src/screen.h
+++ b/src/screen.h
#include <ncurses.h>
#endif
-#define IS_PLAYING(s) (s==MPD_STATE_PLAY)
-#define IS_PAUSED(s) (s==MPD_STATE_PAUSE)
-#define IS_STOPPED(s) (!(IS_PLAYING(s) | IS_PAUSED(s)))
-
#define MAX_SONGNAME_LENGTH 512
struct mpdclient;
diff --git a/src/screen_play.c b/src/screen_play.c
index ceb13616662197b076a0316e9fdfbb3dc735a971..f1af5196f76a0ff572201f38f1e24662ab0a6194 100644 (file)
--- a/src/screen_play.c
+++ b/src/screen_play.c
playlist_restore_selection();
current_song_id = c->status != NULL &&
- !IS_STOPPED(mpd_status_get_state(c->status))
+ (mpd_status_get_state(c->status) == MPD_STATE_PLAY ||
+ mpd_status_get_state(c->status) == MPD_STATE_PAUSE)
? (int)mpd_status_get_song_id(c->status) : -1;
if (current_song_id != prev_song_id) {