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 <videolan/vlc.h>
\r
27 #include "stream_control.h"
\r
28 #include "input_ext-intf.h"
\r
30 #include "interface.h"
\r
31 #include "intf_playlist.h"
\r
33 #include "win32_common.h"
\r
35 extern struct intf_thread_s *p_intfGlobal;
\r
37 /****************************************************************************
\r
38 * Control functions: this is where the functions are defined
\r
39 ****************************************************************************
\r
40 * These functions are used by toolbuttons callbacks
\r
41 ****************************************************************************/
\r
42 bool ControlBack( TObject *Sender )
\r
50 bool ControlStop( TObject *Sender )
\r
52 if( p_input_bank->pp_input[0] != NULL )
\r
54 /* end playing item */
\r
55 p_input_bank->pp_input[0]->b_eof = 1;
\r
57 /* update playlist */
\r
58 vlc_mutex_lock( &p_main->p_playlist->change_lock );
\r
60 p_main->p_playlist->i_index--;
\r
61 p_main->p_playlist->b_stopped = 1;
\r
63 vlc_mutex_unlock( &p_main->p_playlist->change_lock );
\r
71 bool ControlPlay( TObject *Sender )
\r
73 if( p_input_bank->pp_input[0] != NULL )
\r
75 input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PLAY );
\r
76 p_main->p_playlist->b_stopped = 0;
\r
80 vlc_mutex_lock( &p_main->p_playlist->change_lock );
\r
82 if( p_main->p_playlist->b_stopped )
\r
84 if( p_main->p_playlist->i_size )
\r
86 vlc_mutex_unlock( &p_main->p_playlist->change_lock );
\r
87 intf_PlaylistJumpto( p_main->p_playlist,
\r
88 p_main->p_playlist->i_index );
\r
92 vlc_mutex_unlock( &p_main->p_playlist->change_lock );
\r
93 p_intfGlobal->p_sys->p_window->MenuOpenFileClick( Sender );
\r
98 vlc_mutex_unlock( &p_main->p_playlist->change_lock );
\r
107 bool ControlPause( TObject *Sender )
\r
109 if( p_input_bank->pp_input[0] != NULL )
\r
111 input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_PAUSE );
\r
113 vlc_mutex_lock( &p_main->p_playlist->change_lock );
\r
114 p_main->p_playlist->b_stopped = 0;
\r
115 vlc_mutex_unlock( &p_main->p_playlist->change_lock );
\r
122 bool ControlSlow( TObject *Sender )
\r
124 if( p_input_bank->pp_input[0] != NULL )
\r
126 input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_SLOWER );
\r
128 vlc_mutex_lock( &p_main->p_playlist->change_lock );
\r
129 p_main->p_playlist->b_stopped = 0;
\r
130 vlc_mutex_unlock( &p_main->p_playlist->change_lock );
\r
137 bool ControlFast( TObject *Sender )
\r
139 if( p_input_bank->pp_input[0] != NULL )
\r
141 input_SetStatus( p_input_bank->pp_input[0], INPUT_STATUS_FASTER );
\r
143 vlc_mutex_lock( &p_main->p_playlist->change_lock );
\r
144 p_main->p_playlist->b_stopped = 0;
\r
145 vlc_mutex_unlock( &p_main->p_playlist->change_lock );
\r