]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/actions_manager.cpp
configure: fix detection of ARM NEON
[vlc] / modules / gui / qt4 / actions_manager.cpp
index 475049f6e1939d575566fda943d375dce3bc9e6f..f2c7f35807def60e5a218218c06c338ecc017f30 100644 (file)
@@ -27,6 +27,7 @@
 #endif
 
 #include <vlc_vout.h>
+#include <vlc_aout.h>
 #include <vlc_keys.h>
 
 #include "actions_manager.hpp"
@@ -50,51 +51,54 @@ void ActionsManager::doAction( int id_action )
     {
         case PLAY_ACTION:
             play(); break;
+        case STOP_ACTION:
+            THEMIM->stop(); break;
+        case OPEN_ACTION:
+            THEDP->openDialog(); break;
         case PREVIOUS_ACTION:
-            prev(); break;
+            THEMIM->prev(); break;
         case NEXT_ACTION:
-            next(); break;
-        case STOP_ACTION:
-            stop(); break;
+            THEMIM->next(); break;
         case SLOWER_ACTION:
-            slower(); break;
+            THEMIM->getIM()->slower(); break;
         case FASTER_ACTION:
-            faster(); break;
+            THEMIM->getIM()->faster(); break;
         case FULLSCREEN_ACTION:
             fullscreen(); break;
         case EXTENDED_ACTION:
-            extSettings(); break;
+            THEDP->extendedDialog(); break;
         case PLAYLIST_ACTION:
             playlist(); break;
         case SNAPSHOT_ACTION:
             snapshot(); break;
         case RECORD_ACTION:
             record(); break;
-        case ATOB_ACTION:
-            THEMIM->getIM()->setAtoB(); break;
         case FRAME_ACTION:
             frame(); break;
+        case ATOB_ACTION:
+            THEMIM->getIM()->setAtoB(); break;
         case REVERSE_ACTION:
-            reverse(); break;
+            THEMIM->getIM()->reverse(); break;
         case SKIP_BACK_ACTION:
-            var_SetInteger( p_intf->p_libvlc, "key-pressed",
+            var_SetInteger( p_intf->p_libvlc, "key-action",
                     ACTIONID_JUMP_BACKWARD_SHORT );
             break;
         case SKIP_FW_ACTION:
-            var_SetInteger( p_intf->p_libvlc, "key-pressed",
+            var_SetInteger( p_intf->p_libvlc, "key-action",
                     ACTIONID_JUMP_FORWARD_SHORT );
             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;
     }
 }
 
-inline void ActionsManager::stop()
-{
-    THEMIM->stop();
-}
-
 void ActionsManager::play()
 {
     if( THEPL->current.i_size == 0 )
@@ -106,16 +110,6 @@ void ActionsManager::play()
     THEMIM->togglePlayPause();
 }
 
-inline void ActionsManager::prev()
-{
-    THEMIM->prev();
-}
-
-inline void ActionsManager::next()
-{
-    THEMIM->next();
-}
-
 /**
   * TODO
  * This functions toggle the fullscreen mode
@@ -124,47 +118,25 @@ inline void ActionsManager::next()
  */
 void ActionsManager::fullscreen()
 {
-    vout_thread_t *p_vout =
-      (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
+    vout_thread_t *p_vout = THEMIM->getVout();
     if( p_vout)
     {
-        var_SetBool( p_vout, "fullscreen", !var_GetBool( p_vout, "fullscreen" ) );
+        var_ToggleBool( p_vout, "fullscreen" );
         vlc_object_release( p_vout );
     }
 }
 
 void ActionsManager::snapshot()
 {
-    vout_thread_t *p_vout =
-      (vout_thread_t *)vlc_object_find( p_intf, VLC_OBJECT_VOUT, FIND_ANYWHERE );
+    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 );
     }
 }
 
-inline void ActionsManager::extSettings()
-{
-    THEDP->extendedDialog();
-}
-
-inline void ActionsManager::reverse()
-{
-    THEMIM->getIM()->reverse();
-}
-
-inline void ActionsManager::slower()
-{
-    THEMIM->getIM()->slower();
-}
-
-inline void ActionsManager::faster()
-{
-    THEMIM->getIM()->faster();
-}
-
-inline void ActionsManager::playlist()
+void ActionsManager::playlist()
 {
     if( p_intf->p_sys->p_mi ) p_intf->p_sys->p_mi->togglePlaylist();
 }
@@ -175,8 +147,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
         {
@@ -197,7 +168,21 @@ 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 );
+}