Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Bugfix: volume,mute and power-buttons did not work in menu, replay...



Hi Klaus,

attached a patch to make the Volume, Mute and Power-Buttons to work
also in Menu (and during other modes). Now it also works during replay :-)

        Matthias

--- vdr.c.ori	Wed Sep 19 19:46:06 2001
+++ vdr.c	Wed Sep 19 19:54:53 2001
@@ -352,6 +352,32 @@
            EITScanner.Activity();
            LastActivity = time(NULL);
            }
+         switch (key) { //keys with the same function in every interaction mode
+             // Volume Control:
+             case kVolUp|k_Repeat:
+             case kVolUp:
+             case kVolDn|k_Repeat:
+             case kVolDn:
+                  cDvbApi::PrimaryDvbApi->SetVolume(NORMALKEY(key) == kVolDn ? -VOLUMEDELTA : VOLUMEDELTA);
+                  break;
+             case kMute:
+                  cDvbApi::PrimaryDvbApi->ToggleMute();
+                  break;
+             // Power off:
+             case kPower: isyslog(LOG_INFO, "Power button pressed");
+                          DELETENULL(*Interact);
+                          if (!Shutdown) {
+                             Interface->Error(tr("Can't shutdown - option '-s' not given!"));
+                             break;
+                             }
+                          if (cRecordControls::Active()) {
+                             if (Interface->Confirm(tr("Recording - shut down anyway?")))
+                                ForceShutdown = true;
+                             }
+                          LastActivity = 1; // not 0, see below!
+                          break;
+             default: 
+       {                 
         if (*Interact && key != kPower) {
            switch ((*Interact)->ProcessKey(key)) {
              case osMenu:   DELETENULL(Menu);
@@ -426,32 +452,11 @@
              case kMenu: Menu = new cMenuMain(ReplayControl); break;
              // Viewing Control:
              case kOk:   LastChannel = -1; break; // forces channel display
-             // Volume Control:
-             case kVolUp|k_Repeat:
-             case kVolUp:
-             case kVolDn|k_Repeat:
-             case kVolDn:
-                  cDvbApi::PrimaryDvbApi->SetVolume(NORMALKEY(key) == kVolDn ? -VOLUMEDELTA : VOLUMEDELTA);
-                  break;
-             case kMute:
-                  cDvbApi::PrimaryDvbApi->ToggleMute();
-                  break;
-             // Power off:
-             case kPower: isyslog(LOG_INFO, "Power button pressed");
-                          DELETENULL(*Interact);
-                          if (!Shutdown) {
-                             Interface->Error(tr("Can't shutdown - option '-s' not given!"));
-                             break;
-                             }
-                          if (cRecordControls::Active()) {
-                             if (Interface->Confirm(tr("Recording - shut down anyway?")))
-                                ForceShutdown = true;
-                             }
-                          LastActivity = 1; // not 0, see below!
-                          break;
              default:    break;
              }
            }
+       } break; 
+      } //case(key)   
         if (!Menu) {
            EITScanner.Process();
            cVideoCutter::Active();



Home | Main Index | Thread Index