1 /*****************************************************************************
\r
2 * control.cpp: functions to handle stream control buttons.
\r
3 *****************************************************************************
\r
4 * Copyright (C) 2002 VideoLAN
\r
6 * Authors: Olivier Teuliere <ipkiss@via.ecp.fr>
\r
8 * This program is free software; you can redistribute it and/or modify
\r
9 * it under the terms of the GNU General Public License as published by
\r
10 * the Free Software Foundation; either version 2 of the License, or
\r
11 * (at your option) any later version.
\r
13 * This program is distributed in the hope that it will be useful,
\r
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
16 * GNU General Public License for more details.
\r
18 * You should have received a copy of the GNU General Public License
\r
19 * along with this program; if not, write to the Free Software
\r
20 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
\r
21 *****************************************************************************/
\r
25 #include <vlc/vlc.h>
\r
26 #include <vlc/intf.h>
\r
28 #include "win32_common.h"
\r
30 extern intf_thread_t *p_intfGlobal;
\r
32 /****************************************************************************
\r
33 * Control functions: this is where the functions are defined
\r
34 ****************************************************************************
\r
35 * These functions are used by toolbuttons callbacks
\r
36 ****************************************************************************/
\r
37 bool ControlBack( TObject *Sender )
\r
45 bool ControlStop( TObject *Sender )
\r
47 playlist_t * p_playlist = (playlist_t *)
\r
48 vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
\r
49 if( p_playlist == NULL )
\r
54 playlist_Stop( p_playlist );
\r
55 vlc_object_release( p_playlist );
\r
61 bool ControlPlay( TObject *Sender )
\r
63 playlist_t * p_playlist = (playlist_t *)
\r
64 vlc_object_find( p_intfGlobal, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
\r
65 if( p_playlist == NULL )
\r
67 p_intfGlobal->p_sys->p_window->MenuOpenFileClick( Sender );
\r
71 vlc_mutex_lock( &p_playlist->object_lock );
\r
72 if( p_playlist->i_size )
\r
74 vlc_mutex_unlock( &p_playlist->object_lock );
\r
75 playlist_Play( p_playlist );
\r
76 vlc_object_release( p_playlist );
\r
80 vlc_mutex_unlock( &p_playlist->object_lock );
\r
81 vlc_object_release( p_playlist );
\r
82 p_intfGlobal->p_sys->p_window->MenuOpenFileClick( Sender );
\r
89 bool ControlPause( TObject *Sender )
\r
91 if( p_intfGlobal->p_sys->p_input != NULL )
\r
93 input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_PAUSE );
\r
100 bool ControlSlow( TObject *Sender )
\r
102 if( p_intfGlobal->p_sys->p_input != NULL )
\r
104 input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_SLOWER );
\r
111 bool ControlFast( TObject *Sender )
\r
113 if( p_intfGlobal->p_sys->p_input != NULL )
\r
115 input_SetStatus( p_intfGlobal->p_sys->p_input, INPUT_STATUS_FASTER );
\r