]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/actions_manager.cpp
Qt: add a close to systray menu option.
[vlc] / modules / gui / qt4 / actions_manager.cpp
index 9e5cd8cba2b51488edf18dfec44a1e6a241d338e..cc4e535af99add8325db3f5c0099826835494384 100644 (file)
@@ -27,6 +27,7 @@
 #endif
 
 #include <vlc_vout.h>
+#include <vlc_aout.h>
 #include <vlc_keys.h>
 
 #include "actions_manager.hpp"
@@ -79,15 +80,17 @@ void ActionsManager::doAction( int id_action )
         case REVERSE_ACTION:
             THEMIM->getIM()->reverse(); break;
         case SKIP_BACK_ACTION:
-            var_SetInteger( p_intf->p_libvlc, "key-pressed",
-                    ACTIONID_JUMP_BACKWARD_SHORT );
+            skipBackward();
             break;
         case SKIP_FW_ACTION:
-            var_SetInteger( p_intf->p_libvlc, "key-pressed",
-                    ACTIONID_JUMP_FORWARD_SHORT );
+            skipForward();
             break;
         case QUIT_ACTION:
             THEDP->quit();  break;
+        case RANDOM_ACTION:
+            THEMIM->toggleRandom(); break;
+        case INFO_ACTION:
+            THEDP->mediaInfoDialog(); break;
         default:
             msg_Dbg( p_intf, "Action: %i", id_action );
             break;
@@ -113,10 +116,11 @@ void ActionsManager::play()
  */
 void ActionsManager::fullscreen()
 {
+    bool fs = var_ToggleBool( THEPL, "fullscreen" );
     vout_thread_t *p_vout = THEMIM->getVout();
     if( p_vout)
     {
-        var_SetBool( p_vout, "fullscreen", !var_GetBool( p_vout, "fullscreen" ) );
+        var_SetBool( p_vout, "fullscreen", fs );
         vlc_object_release( p_vout );
     }
 }
@@ -126,7 +130,7 @@ void ActionsManager::snapshot()
     vout_thread_t *p_vout = THEMIM->getVout();
     if( p_vout )
     {
-        vout_Control( p_vout, VOUT_SNAPSHOT );
+        var_TriggerCallback( p_vout, "video-snapshot" );
         vlc_object_release( p_vout );
     }
 }
@@ -142,8 +146,7 @@ void ActionsManager::record()
     if( p_input )
     {
         /* This method won't work fine if the stream can't be cut anywhere */
-        const bool b_recording = var_GetBool( p_input, "record" );
-        var_SetBool( p_input, "record", !b_recording );
+        var_ToggleBool( p_input, "record" );
 #if 0
         else
         {
@@ -154,7 +157,7 @@ void ActionsManager::record()
 
             char *psz = input_item_GetURI( p_item );
             if( psz )
-                THEDP->streamingDialog( NULL, psz, true );
+                THEDP->streamingDialog( NULL, qfu(psz), true );
         }
 #endif
     }
@@ -164,7 +167,31 @@ void ActionsManager::frame()
 {
     input_thread_t *p_input = THEMIM->getInput();
     if( p_input )
-        var_SetVoid( p_input, "frame-next" );
+        var_TriggerCallback( p_input, "frame-next" );
 }
 
+void ActionsManager::toggleMuteAudio()
+{
+     aout_ToggleMute( THEPL, NULL );
+}
+
+void ActionsManager::AudioUp()
+{
+    aout_VolumeUp( THEPL, 1, NULL );
+}
+
+void ActionsManager::AudioDown()
+{
+    aout_VolumeDown( THEPL, 1, NULL );
+}
+
+void ActionsManager::skipForward()
+{
+    THEMIM->getIM()->jumpFwd();
+}
+
+void ActionsManager::skipBackward()
+{
+    THEMIM->getIM()->jumpBwd();
+}