3
* Copyright © 2004 Bastien Nocera <hadess@hadess.net>
4
* Copyright © 2002 David A. Schleef <ds@schleef.org>
5
* Copyright © 2006, 2008 Christian Persch
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Library General Public
9
* License as published by the Free Software Foundation; either
10
* version 2 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Library General Public License for more details.
17
* You should have received a copy of the GNU Library General Public
18
* License along with this library; if not, write to the
19
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20
* Boston, MA 02110-1301 USA.
29
#include "totemPlugin.h"
30
#include "totemConePlaylist.h"
32
static const char *propertyNames[] = {
37
static const char *methodNames[] = {
48
TOTEM_IMPLEMENT_NPCLASS (totemConePlaylist,
49
propertyNames, G_N_ELEMENTS (propertyNames),
50
methodNames, G_N_ELEMENTS (methodNames),
53
totemConePlaylist::totemConePlaylist (NPP aNPP)
54
: totemNPObject (aNPP)
59
totemConePlaylist::~totemConePlaylist ()
65
totemConePlaylist::InvokeByIndex (int aIndex,
66
const NPVariant *argv,
70
TOTEM_LOG_INVOKE (aIndex, totemConePlaylist);
72
switch (Methods (aIndex)) {
74
/* long add (in AUTF8String MRL, [in AUTF8String name, in AUTF8String options]); */
75
if (!CheckArgc (argc, 1, 3))
79
if (!GetStringFromArguments (argv, argc, 0, mrl))
82
Plugin()->AddItem (mrl);
83
return Int32Variant (_result, 0);
87
Plugin()->Command (TOTEM_COMMAND_PLAY);
88
return VoidVariant (_result);
91
Plugin()->Command (TOTEM_COMMAND_STOP);
92
return VoidVariant (_result);
99
TOTEM_WARN_INVOKE_UNIMPLEMENTED (aIndex, totemConePlaylist);
100
return VoidVariant (_result);
107
totemConePlaylist::GetPropertyByIndex (int aIndex,
110
TOTEM_LOG_GETTER (aIndex, totemConePlaylist);
112
switch (Properties (aIndex)) {
114
return ObjectVariant (_result, Plugin()->GetNPObject (totemPlugin::eConePlaylistItems));
117
return BoolVariant (_result, Plugin()->State() == TOTEM_STATE_PLAYING);
124
totemConePlaylist::SetPropertyByIndex (int aIndex,
125
const NPVariant *aValue)
127
TOTEM_LOG_SETTER (aIndex, totemConePlaylist);
129
return ThrowPropertyNotWritable ();