1
/*****************************************************************************
2
* vlcpeer.cpp: scriptable peer descriptor
3
*****************************************************************************
4
* Copyright (C) 2002 VideoLAN
5
* $Id: vlcpeer.cpp 6961 2004-03-05 17:34:23Z sam $
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
*****************************************************************************/
32
/* We do not want to use nsDebug.h */
36
#ifdef HAVE_MOZILLA_CONFIG_H
37
# include <mozilla-config.h>
39
#include <nsISupports.h>
43
#if !defined(XP_MACOSX) && !defined(XP_UNIX) && !defined(XP_WIN)
45
#elif defined(XP_MACOSX)
50
#include "vlcplugin.h"
52
NS_IMPL_ISUPPORTS2( VlcPeer, VlcIntf, nsIClassInfo )
54
/*****************************************************************************
55
* Scriptable peer constructor and destructor
56
*****************************************************************************/
62
VlcPeer::VlcPeer( VlcPlugin * plugin )
73
/*****************************************************************************
74
* Scriptable peer methods
75
*****************************************************************************/
76
void VlcPeer::Disable()
81
/*****************************************************************************
82
* Scriptable peer plugin methods
83
*****************************************************************************/
84
NS_IMETHODIMP VlcPeer::Play()
88
if( !p_plugin->b_stream && p_plugin->psz_target )
90
VLC_AddTarget( p_plugin->i_vlc, p_plugin->psz_target, 0, 0,
91
PLAYLIST_APPEND | PLAYLIST_GO, PLAYLIST_END );
92
p_plugin->b_stream = 1;
95
VLC_Play( p_plugin->i_vlc );
100
NS_IMETHODIMP VlcPeer::Pause()
104
VLC_Pause( p_plugin->i_vlc );
109
NS_IMETHODIMP VlcPeer::Stop()
113
VLC_Stop( p_plugin->i_vlc );
114
p_plugin->b_stream = 0;
119
NS_IMETHODIMP VlcPeer::Fullscreen()
125
VLC_FullScreen( p_plugin->i_vlc );