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

cmd_playlist.cpp

00001 /*****************************************************************************
00002  * cmd_playlist.cpp
00003  *****************************************************************************
00004  * Copyright (C) 2003 the VideoLAN team
00005  * $Id: cmd_playlist.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 "cmd_playlist.hpp"
00026 #include "../src/vlcproc.hpp"
00027 #include "../utils/var_bool.hpp"
00028 
00029 
00030 void CmdPlaylistDel::execute()
00031 {
00032     m_rList.delSelected();
00033 }
00034 
00035 
00036 void CmdPlaylistSort::execute()
00037 {
00038     // XXX add the mode and type
00039     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
00040     if( pPlaylist != NULL )
00041     {
00042         playlist_Sort( pPlaylist, SORT_TITLE, ORDER_NORMAL );
00043     }
00044 
00045 }
00046 
00047 
00048 void CmdPlaylistNext::execute()
00049 {
00050     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
00051     if( pPlaylist != NULL )
00052     {
00053         playlist_Next( pPlaylist );
00054     }
00055 }
00056 
00057 
00058 void CmdPlaylistPrevious::execute()
00059 {
00060     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
00061     if( pPlaylist != NULL )
00062     {
00063         playlist_Prev( pPlaylist );
00064     }
00065 }
00066 
00067 
00068 void CmdPlaylistRandom::execute()
00069 {
00070     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
00071     if( pPlaylist != NULL )
00072     {
00073         vlc_value_t val;
00074         val.b_bool = m_value;
00075         var_Set( pPlaylist , "random", val);
00076     }
00077 }
00078 
00079 
00080 void CmdPlaylistLoop::execute()
00081 {
00082     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
00083     if( pPlaylist != NULL )
00084     {
00085         vlc_value_t val;
00086         val.b_bool = m_value;
00087         var_Set( pPlaylist , "loop", val);
00088     }
00089 }
00090 
00091 
00092 void CmdPlaylistRepeat::execute()
00093 {
00094     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
00095     if( pPlaylist != NULL )
00096     {
00097         vlc_value_t val;
00098         val.b_bool = m_value;
00099         var_Set( pPlaylist , "repeat", val);
00100     }
00101 }
00102 
00103 
00104 void CmdPlaylistLoad::execute()
00105 {
00106     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
00107     if( pPlaylist != NULL )
00108     {
00109         playlist_Import( pPlaylist, m_file.c_str() );
00110     }
00111 }
00112 
00113 
00114 void CmdPlaylistSave::execute()
00115 {
00116     playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
00117     if( pPlaylist != NULL )
00118     {
00119         // FIXME: when the PLS export will be working, we'll need to remove
00120         // this hardcoding...
00121         playlist_Export( pPlaylist, m_file.c_str(), "export-m3u" );
00122     }
00123 }
00124 

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