Main Page | Modules | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

cmd_input.cpp

00001 /*****************************************************************************
00002  * cmd_input.cpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: cmd_input.cpp 11664 2005-07-09 06:17:09Z courmisch $
00006  *
00007  * Authors: Cyril Deguet     <[email protected]>
00008  *          Olivier Teulière <[email protected]>
00009  *
00010  * This program is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2 of the License, or
00013  * (at your option) any later version.
00014  *
00015  * This program is distributed in the hope that it will be useful,
00016  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00018  * GNU General Public License for more details.
00019  *
00020  * You should have received a copy of the GNU General Public License
00021  * along with this program; if not, write to the Free Software
00022  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
00023  *****************************************************************************/
00024 
00025 #include <vlc/aout.h>
00026 #include "cmd_input.hpp"
00027 #include "cmd_dialogs.hpp"
00028 
00029 
00030 void CmdPlay::execute()
00031 {
00032     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
00033     if( pPlaylist == NULL )
00034     {
00035         return;
00036     }
00037 
00038     if( pPlaylist->i_size )
00039     {
00040         playlist_Play( pPlaylist );
00041     }
00042     else
00043     {
00044         // If the playlist is empty, open a file requester instead
00045         CmdDlgFile cmd( getIntf() );
00046         cmd.execute();
00047     }
00048 }
00049 
00050 
00051 void CmdPause::execute()
00052 {
00053     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
00054     if( pPlaylist == NULL )
00055     {
00056         return;
00057     }
00058 
00059     playlist_Pause( pPlaylist );
00060 }
00061 
00062 
00063 void CmdStop::execute()
00064 {
00065     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
00066     if( pPlaylist == NULL )
00067     {
00068         return;
00069     }
00070 
00071     playlist_Stop( pPlaylist );
00072 }
00073 
00074 
00075 void CmdSlower::execute()
00076 {
00077     input_thread_t *pInput =
00078         (input_thread_t *)vlc_object_find( getIntf(), VLC_OBJECT_INPUT,
00079                                            FIND_ANYWHERE );
00080     if( pInput )
00081     {
00082         vlc_value_t val;
00083         val.b_bool = VLC_TRUE;
00084 
00085         var_Set( pInput, "rate-slower", val );
00086         vlc_object_release( pInput );
00087     }
00088 }
00089 
00090 
00091 void CmdFaster::execute()
00092 {
00093     input_thread_t *pInput =
00094         (input_thread_t *)vlc_object_find( getIntf(), VLC_OBJECT_INPUT,
00095                                            FIND_ANYWHERE );
00096     if( pInput )
00097     {
00098         vlc_value_t val;
00099         val.b_bool = VLC_TRUE;
00100 
00101         var_Set( pInput, "rate-faster", val );
00102         vlc_object_release( pInput );
00103     }
00104 }
00105 
00106 
00107 void CmdMute::execute()
00108 {
00109     aout_VolumeMute( getIntf(), NULL );
00110 }
00111 
00112 
00113 void CmdVolumeUp::execute()
00114 {
00115     aout_VolumeUp( getIntf(), 1, NULL );
00116 }
00117 
00118 
00119 void CmdVolumeDown::execute()
00120 {
00121     aout_VolumeDown( getIntf(), 1, NULL );
00122 }
00123 

Generated on Tue Dec 20 10:14:41 2005 for vlc-0.8.4a by  doxygen 1.4.2