1 /*****************************************************************************
2 * vlcpeer.cpp: scriptable peer descriptor
3 *****************************************************************************
4 * Copyright (C) 2002 VideoLAN
5 * $Id: vlcpeer.cpp,v 1.6 2003/07/23 01:13:48 gbazin Exp $
7 * Authors: Samuel Hocevar <sam@zoy.org>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
22 *****************************************************************************/
24 /*****************************************************************************
26 *****************************************************************************/
29 #include <nsISupports.h>
34 #include "vlcplugin.h"
36 NS_IMPL_ISUPPORTS2( VlcPeer, VlcIntf, nsIClassInfo )
38 /*****************************************************************************
39 * Scriptable peer constructor and destructor
40 *****************************************************************************/
46 VlcPeer::VlcPeer( VlcPlugin * plugin )
57 /*****************************************************************************
58 * Scriptable peer methods
59 *****************************************************************************/
60 void VlcPeer::Disable()
65 /*****************************************************************************
66 * Scriptable peer plugin methods
67 *****************************************************************************/
68 NS_IMETHODIMP VlcPeer::Play()
72 if( !p_plugin->b_stream && p_plugin->psz_target )
74 VLC_AddTarget( p_plugin->i_vlc, p_plugin->psz_target, 0, 0,
75 PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
76 p_plugin->b_stream = 1;
79 VLC_Play( p_plugin->i_vlc );
84 NS_IMETHODIMP VlcPeer::Pause()
88 VLC_Pause( p_plugin->i_vlc );
93 NS_IMETHODIMP VlcPeer::Stop()
97 VLC_Stop( p_plugin->i_vlc );
98 p_plugin->b_stream = 0;
103 NS_IMETHODIMP VlcPeer::Fullscreen()
107 VLC_FullScreen( p_plugin->i_vlc );