1 /*****************************************************************************
2 * vlcpeer.cpp: scriptable peer descriptor
3 *****************************************************************************
4 * Copyright (C) 2002 VideoLAN
5 * $Id: vlcpeer.cpp,v 1.8 2003/09/21 10:23:59 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 *****************************************************************************/
30 /* We do not want to use nsDebug.h */
34 #include <nsISupports.h>
39 #include "vlcplugin.h"
41 NS_IMPL_ISUPPORTS2( VlcPeer, VlcIntf, nsIClassInfo )
43 /*****************************************************************************
44 * Scriptable peer constructor and destructor
45 *****************************************************************************/
51 VlcPeer::VlcPeer( VlcPlugin * plugin )
62 /*****************************************************************************
63 * Scriptable peer methods
64 *****************************************************************************/
65 void VlcPeer::Disable()
70 /*****************************************************************************
71 * Scriptable peer plugin methods
72 *****************************************************************************/
73 NS_IMETHODIMP VlcPeer::Play()
77 if( !p_plugin->b_stream && p_plugin->psz_target )
79 VLC_AddTarget( p_plugin->i_vlc, p_plugin->psz_target, 0, 0,
80 PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
81 p_plugin->b_stream = 1;
84 VLC_Play( p_plugin->i_vlc );
89 NS_IMETHODIMP VlcPeer::Pause()
93 VLC_Pause( p_plugin->i_vlc );
98 NS_IMETHODIMP VlcPeer::Stop()
102 VLC_Stop( p_plugin->i_vlc );
103 p_plugin->b_stream = 0;
108 NS_IMETHODIMP VlcPeer::Fullscreen()
114 VLC_FullScreen( p_plugin->i_vlc );