]> git.sesse.net Git - vlc/blobdiff - modules/gui/qt4/actions_manager.cpp
Qt: create a AM::PPAction
[vlc] / modules / gui / qt4 / actions_manager.cpp
index fa3703ba9a135a7d9daeb7c1af3378ec4f376e32..eff40d9039f79c4e89f0ca75c665d5d0018880f1 100644 (file)
@@ -1,11 +1,10 @@
 /*****************************************************************************
  * actions_manager.cpp : Controller for the main interface
  ****************************************************************************
- * Copyright (C) 2006-2008 the VideoLAN team
+ * Copyright © 2009-2014 VideoLAN and VLC authors
  * $Id$
  *
  * Authors: Jean-Baptiste Kempf <jb@videolan.org>
- *          Ilkka Ollakka <ileoo@videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
 #include <vlc_keys.h>
 
 #include "actions_manager.hpp"
-#include "dialogs_provider.hpp" /* Opening Dialogs */
-#include "input_manager.hpp"
-#include "main_interface.hpp" /* Show playlist */
-#include "components/controller.hpp" /* Toggle FSC controller width */
 
-ActionsManager * ActionsManager::instance = NULL;
+#include "dialogs_provider.hpp"      /* Opening Dialogs */
+#include "input_manager.hpp"         /* THEMIM */
+#include "main_interface.hpp"        /* Show playlist */
+#include "components/controller.hpp" /* Toggle FSC controller width */
+#include "components/extended_panels.hpp"
 
-ActionsManager::ActionsManager( intf_thread_t * _p_i, QObject *_parent )
-               : QObject( _parent )
+ActionsManager::ActionsManager( intf_thread_t * _p_i )
 {
     p_intf = _p_i;
 }
 
-ActionsManager::~ActionsManager(){}
-
 void ActionsManager::doAction( int id_action )
 {
     switch( id_action )
@@ -98,14 +94,14 @@ void ActionsManager::doAction( int id_action )
                 p_intf->p_sys->p_mi->getFullscreenControllerWidget()->toggleFullwidth();
             break;
         default:
-            msg_Dbg( p_intf, "Action: %i", id_action );
+            msg_Warn( p_intf, "Action not supported: %i", id_action );
             break;
     }
 }
 
 void ActionsManager::play()
 {
-    if( THEPL->current.i_size == 0 )
+    if( THEPL->current.i_size == 0 && THEPL->items.i_size == 0 )
     {
         /* The playlist is empty, open a file requester */
         THEDP->openFileDialog();
@@ -115,10 +111,10 @@ void ActionsManager::play()
 }
 
 /**
 * TODO
+ * TODO
  * This functions toggle the fullscreen mode
  * If there is no video, it should first activate Visualisations...
- *  This has also to be fixed in enableVideo()
+ * This has also to be fixed in enableVideo()
  */
 void ActionsManager::fullscreen()
 {
@@ -143,7 +139,8 @@ void ActionsManager::snapshot()
 
 void ActionsManager::playlist()
 {
-    if( p_intf->p_sys->p_mi ) p_intf->p_sys->p_mi->togglePlaylist();
+    if( p_intf->p_sys->p_mi )
+        p_intf->p_sys->p_mi->togglePlaylist();
 }
 
 void ActionsManager::record()
@@ -178,7 +175,7 @@ void ActionsManager::frame()
 
 void ActionsManager::toggleMuteAudio()
 {
-     playlist_MuteToggle( THEPL );
+    playlist_MuteToggle( THEPL );
 }
 
 void ActionsManager::AudioUp()
@@ -205,3 +202,11 @@ void ActionsManager::skipBackward()
         THEMIM->getIM()->jumpBwd();
 }
 
+void ActionsManager::PPaction( QAction *a )
+{
+    int i_q = -1;
+    if( a != NULL )
+        i_q = a->data().toInt();
+
+    ExtVideo::setPostprocessing( p_intf, i_q );
+}