summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a9007c6)
raw | patch | inline | side by side (parent: a9007c6)
| author | Kalle Wallin <kaw@linux.se> | |
| Sat, 27 Mar 2004 23:14:00 +0000 (23:14 +0000) | ||
| committer | Kalle Wallin <kaw@linux.se> | |
| Sat, 27 Mar 2004 23:14:00 +0000 (23:14 +0000) | 
| main.c | patch | blob | history | |
| screen.c | patch | blob | history | 
index f4e0f1dfe2609b7db804b735d29ef1a30211690f..0bfcb74349ae9a1e6283bcb72373e036b0341d8f 100644 (file)
--- a/main.c
+++ b/main.c
   while( connected || options->reconnect )
     {
       command_t cmd;
-      static int repeat = -1;
-      static int random = -1;
       if( connected && counter==0  )
        {
            {
              connected=0;
              screen_status_printf("Lost connection to %s", options->host);
+             doupdate();
              mpd_closeConnection(mpc->connection);
              mpc->connection = NULL;
            }
          else
            mpd_finishCommand(mpc->connection);
          counter=10;
-
-         if( repeat<0 )
-           {
-             repeat = mpc->status->repeat;
-             random = mpc->status->random;
-           }
-         if( repeat != mpc->status->repeat )
-           screen_status_printf("Repeat is %s", 
-                                mpc->status->repeat  ? "On" : "Off");
-         if( random != mpc->status->random )
-           screen_status_printf("Random is %s", 
-                                mpc->status->random ? "On" : "Off");
-
-         repeat = mpc->status->repeat;
-         random = mpc->status->random;
        }
+
       if( connected )
        {
-         
-
          screen_update(mpc);
          if( (cmd=get_keyboard_command()) != CMD_NONE )
            {
              connected=1;
              counter=0;
            }
+         doupdate();
        }
       if( counter>0 )
diff --git a/screen.c b/screen.c
index 17457843294f3ad6686f335b6c5d103fedb8a230..7e3e51d7ffdaf9e473e30d485d73926e3ffc7e56 100644 (file)
--- a/screen.c
+++ b/screen.c
 void 
 screen_update(mpd_client_t *c)
 {
+  static int repeat = -1;
+  static int random = -1;
+
   if( !screen->painted )
     return screen_paint(c);
+  if( repeat<0 )
+    {
+      repeat = c->status->repeat;
+      random = c->status->random;
+    }
+  if( repeat != c->status->repeat )
+    screen_status_printf("Repeat is %s", 
+                        c->status->repeat  ? "On" : "Off");
+  if( random != c->status->random )
+    screen_status_printf("Random is %s", 
+                        c->status->random ? "On" : "Off");
+  
+  repeat = c->status->repeat;
+  random = c->status->random;
+
   switch(screen->mode)
     {
     case SCREEN_PLAY_WINDOW:
![[tokkee]](http://tokkee.org/images/avatar.png)
