]> git.sesse.net Git - vlc/blobdiff - modules/gui/skins2/commands/cmd_input.cpp
Don't include config.h from the headers - refs #297.
[vlc] / modules / gui / skins2 / commands / cmd_input.cpp
index 54a55ce7a84fa563ab6ef24c6182fdb97faba8af..9b776b223f8e6ce3546c63e10b34dec639558e09 100644 (file)
@@ -1,11 +1,11 @@
 /*****************************************************************************
  * cmd_input.cpp
  *****************************************************************************
- * Copyright (C) 2003 VideoLAN
- * $Id: cmd_input.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
+ * Copyright (C) 2003 the VideoLAN team
+ * $Id$
  *
  * Authors: Cyril Deguet     <asmax@via.ecp.fr>
- *          Olivier Teulière <ipkiss@via.ecp.fr>
+ *          Olivier Teulière <ipkiss@via.ecp.fr>
  *
  * 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
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
  *****************************************************************************/
 
 #include "cmd_input.hpp"
+#include "cmd_dialogs.hpp"
+#include <vlc_aout.h>
+#include <vlc_input.h>
+#include <vlc_playlist.h>
+
+void CmdPlay::execute()
+{
+    playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
+    if( pPlaylist == NULL )
+    {
+        return;
+    }
+
+    if( !playlist_IsEmpty( pPlaylist ) )
+        playlist_Play( pPlaylist );
+    else
+    {
+        // If the playlist is empty, open a file requester instead
+        CmdDlgFile cmd( getIntf() );
+        cmd.execute();
+    }
+}
+
+
+void CmdPause::execute()
+{
+    playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
+    if( pPlaylist == NULL )
+    {
+        return;
+    }
+
+    playlist_Pause( pPlaylist );
+}
 
 
 void CmdStop::execute()
@@ -68,3 +102,21 @@ void CmdFaster::execute()
     }
 }
 
+
+void CmdMute::execute()
+{
+    aout_VolumeMute( getIntf(), NULL );
+}
+
+
+void CmdVolumeUp::execute()
+{
+    aout_VolumeUp( getIntf(), 1, NULL );
+}
+
+
+void CmdVolumeDown::execute()
+{
+    aout_VolumeDown( getIntf(), 1, NULL );
+}
+