axvlc.idl 19.7 KB
Newer Older
1 2 3
/*****************************************************************************
 * axvlc.idl: ActiveX control for VLC
 *****************************************************************************
4
 * Copyright (C) 2006 the VideoLAN team
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
 *
 * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
Antoine Cellerier's avatar
Antoine Cellerier committed
20
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
21 22
 *****************************************************************************/

23 24 25
//comments terminated by [t] are by tonsofpcs, regarding the string review.  April 02, 2006. [t]
//Possibly change all instances of "the current playlist" to "the playlist" and "current playlist" to "the playlist" [t]

26 27
import "oaidl.idl";

28 29 30
[
  uuid(DF2BBE39-40A8-433b-A279-073F48DA94B6),
  version(1.0),
31
  helpstring("VideoLAN VLC ActiveX Plugin")
32 33 34 35 36
]
library AXVLC
{
    // Forward declare all types defined in this typelib
    interface IVLCControl;
37 38
    interface IVLCAudio;
    interface IVLCInput;
Damien Fouilleul's avatar
Damien Fouilleul committed
39 40 41 42
    interface IVLCLog;
    interface IVLCMessage;
    interface IVLCMessageIterator;
    interface IVLCMessages;
43
    interface IVLCPlaylist;
44 45
    interface IVLCVideo;
    interface IVLCControl2;
46 47
    dispinterface DVLCEvents;

48 49
    importlib("stdole2.tlb");

50
    typedef [public] enum VLCPlaylistMode
51
    {
52
        VLCPlayListInsert       =  1,
53
        VLCPlayListInsertAndGo  =  9,
54
        VLCPlayListReplace      =  2,
55
        VLCPlayListReplaceAndGo = 10,
56
        VLCPlayListAppend       =  4,
57
        VLCPlayListAppendAndGo  = 12,
58
        VLCPlayListCheckInsert  = 16
59
    } eVLCPlaylistMode;
60 61

    // playlist target position
62 63 64
    const int VLCPlayListEnd    = -666;

    // DISPID definitions
65 66 67 68 69 70 71 72 73
    const int DISPID_Visible    = 100;
    const int DISPID_Playing    = 101;
    const int DISPID_Position   = 102;
    const int DISPID_Time       = 103;
    const int DISPID_Length     = 104;
    const int DISPID_Volume     = 105;
    const int DISPID_MRL        = 106;
    const int DISPID_AutoPlay   = 107;
    const int DISPID_AutoLoop   = 108;
74 75
    const int DISPID_StartTime  = 109;
    const int DISPID_BaseURL    = 110;
76 77 78 79

    [
      odl,
      uuid(C2FA41D0-B113-476e-AC8C-9BD14999C1C1),
80
      helpstring("VLC Control (deprecated)"),
81 82 83 84
      dual,
      hidden,
      oleautomation
    ]
85 86
    interface IVLCControl : IDispatch
    {
87
        [id(DISPID_Visible), propget, bindable, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]
88
        HRESULT Visible([out, retval] VARIANT_BOOL* visible);
89
        [id(DISPID_Visible), propput, bindable, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]
90 91 92 93 94 95 96
        HRESULT Visible([in] VARIANT_BOOL visible);
        [helpstring("Play current target in playlist.")]
        HRESULT play();
        [helpstring("Pause playback.")]
        HRESULT pause();
        [helpstring("Stop playback.")]
        HRESULT stop();
97
        [id(DISPID_Playing), hidden, propget, helpstring("Returns a value that determines whether VLC is currently playing.")]
98
        HRESULT Playing([out, retval] VARIANT_BOOL* isPlaying);
Jean-Paul Saman's avatar
Jean-Paul Saman committed
99
        [id(DISPID_Position), propget, helpstring("Returns/sets playback position within the current item. Position is a relative value ranging from 0.0 to 1.0.")]
100
        HRESULT Position([out, retval] float* position);
Jean-Paul Saman's avatar
Jean-Paul Saman committed
101
        [id(DISPID_Position), propput, helpstring("Returns/sets playback position within the current item. Position is a relative value ranging from 0.0 to 1.0.")]
102
        HRESULT Position([in] float position);
103
        [id(DISPID_Time), propget, helpstring("Returns/sets playback time relative to the start of the current item.")]
104
        HRESULT Time([out, retval] int* seconds);
105
        [id(DISPID_Time), propput, helpstring("Returns/sets playback time relative to the start of the current item.")]
106
        HRESULT Time([in] int seconds);
107
        [helpstring("Advance or backtrack playback time, relative to current time.")]  //possibly find a better word to replace 'backtrack' [t]
108
        HRESULT shuttle([in] int seconds);
109
        [helpstring("Switch video between normal and fullscreen view modes.")]
110
        HRESULT fullscreen();
111
        [id(DISPID_Length), propget, hidden, helpstring("Returns the total length, in seconds, of the current item, may be unknown.")]
112
        HRESULT Length([out, retval] int* seconds);
113
        [helpstring("Increases playback speed. Possible speeds are: 1x, 2x, 4x, 8x.")]
114
        HRESULT playFaster();
115
        [helpstring("Decreases playback speed. Possible speeds are: 1x, 2x, 4x, 8x.")]
116
        HRESULT playSlower();
117
        [id(DISPID_Volume), propget, helpstring("Returns/sets playback volume, ranges from 0 to 200%.")]  //possibly remove % from 'ranges', change to 'values', and specify that 200 is equivilant to 200% (remember, 200% == 2.0, but this gets an int not a float) [t]
118
        HRESULT Volume([out, retval] int* volume);
119
        [id(DISPID_Volume), propput, helpstring("Returns/sets playback volume, ranges from 0 to 200%.")]
120
        HRESULT Volume([in] int volume);
121
        [helpstring("Mute/unmute playback audio.")]
122
        HRESULT toggleMute();
123
        [helpstring("Sets the value of a VLC variable.")]
124
        HRESULT setVariable([in] BSTR name, [in] VARIANT value);
125
        [helpstring("Returns the value of a VLC variable.")]
126
        HRESULT getVariable([in] BSTR name, [out, retval] VARIANT *value);
127
        [helpstring("Add an item to the playlist.")]
128 129 130 131 132 133 134

/*
** use VARIANT rather than a SAFEARRAY as argument type
** for compatibility with some scripting language (JScript)
*/

        HRESULT addTarget([in] BSTR uri, [in] VARIANT options, [in] enum VLCPlaylistMode mode, [in] int position);
135
        [propget, helpstring("Returns index of current item in playlist.")]
136 137 138 139 140 141 142 143 144
        HRESULT PlaylistIndex([out, retval] int* index);
        [propget, helpstring("Returns number of items in playlist.")]
        HRESULT PlaylistCount([out, retval] int* index);
        [helpstring("Advance to next item in playlist.")]
        HRESULT playlistNext();
        [helpstring("Advance to previous item in playlist.")]
        HRESULT playlistPrev();
        [helpstring("Remove all items from playlist.")]
        HRESULT playlistClear();
145
        [propget, hidden, helpstring("Returns VLC Version.")]
146
        HRESULT VersionInfo([out, retval] BSTR* version);
147
        [id(DISPID_MRL), propget, helpstring("Returns/sets the first MRL in playlist, used for AutoPlay")]
148
        HRESULT MRL([out, retval] BSTR* mrl);
149
        [id(DISPID_MRL), propput, helpstring("Returns/sets the first MRL in playlist, used for AutoPlay")]
150
        HRESULT MRL([in] BSTR mrl);
151
        [id(DISPID_AutoPlay), propget, helpstring("Returns/sets a value that determines whether the playlist is played on startup")]
152
        HRESULT AutoPlay([out, retval] VARIANT_BOOL* autoplay);
153
        [id(DISPID_AutoPlay), propput, helpstring("Returns/Sets a value that determines whether the playlist is played on startup")]
154
        HRESULT AutoPlay([in] VARIANT_BOOL autoplay);
155
        [id(DISPID_AutoLoop), propget, helpstring("Returns/sets a value that determines whether the playlist is looped")]
156
        HRESULT AutoLoop([out, retval] VARIANT_BOOL* autoloop);
157
        [id(DISPID_AutoLoop), propput, helpstring("Returns/sets a value that determines whether the playlist is looped")]
158
        HRESULT AutoLoop([in] VARIANT_BOOL autoloop);
159 160
    };

161 162 163 164
    const int DISPID_PlayEvent  = 100;
    const int DISPID_PauseEvent = 101;
    const int DISPID_StopEvent  = 102;

165 166 167 168 169
    [
      uuid(DF48072F-5EF8-434e-9B40-E2F3AE759B5F),
      helpstring("Event interface for VLC control"),
      hidden
    ]
170 171
    dispinterface DVLCEvents
    {
172 173
        properties:
        methods:
174
            [id(DISPID_PlayEvent), helpstring("Playing")]
175
            void play();
176
            [id(DISPID_PauseEvent), helpstring("Paused")]
177
            void pause();
178
            [id(DISPID_StopEvent), helpstring("Stopped")]
179
            void stop();
180 181
    };

182 183 184 185
    [
      odl,
      uuid(9E0BD17B-2D3C-4656-B94D-03084F3FD9D4),
      helpstring("VLC Audio APIs"),
186
      hidden,
187
      dual,
188
      nonextensible,
189 190 191 192 193 194 195 196 197 198
      oleautomation
    ]
    interface IVLCAudio : IDispatch
    {
        [propget, helpstring("Returns/sets the audio mute state.")]
        HRESULT mute([out, retval] VARIANT_BOOL* muted);
        [propput, helpstring("Returns/sets the audio mute state.")]
        HRESULT mute([in] VARIANT_BOOL muted);

        [propget, helpstring("Returns/sets audio volume as a percent value.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
199
        HRESULT volume([out, retval] long* volume);
200
        [propput, helpstring("Returns/sets audio volume as a percent value.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
201
        HRESULT volume([in] long volume);
202 203 204 205 206 207 208 209 210

        [helpstring("Mute/unmute audio playback.")]
        HRESULT toggleMute();
    };

    [
      odl,
      uuid(49E0DBD1-9440-466C-9C97-95C67190C603),
      helpstring("VLC Input APIs"),
211
      hidden,
212
      dual,
213
      nonextensible,
214 215 216 217 218
      oleautomation
    ]
    interface IVLCInput : IDispatch
    {
        [propget, helpstring("Returns the clip length, in milliseconds.")]
219
        HRESULT length([out, retval] double* length);
220 221

        [propget, helpstring("Returns/sets playback position in current clip.  Position is ranging from 0.0 to 1.0.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
222
        HRESULT position([out, retval] double* position);
223
        [propput, helpstring("Returns/sets playback position in the current clip.  Position ranging from 0.0 to 1.0.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
224
        HRESULT position([in] double position);
225 226

        [propget, helpstring("Returns/sets playback time in current clip, in milliseconds.")]
227
        HRESULT time([out, retval] double* time);
228
        [propput, helpstring("Returns/sets playback time in the current clip, in milliseconds.")]
229
        HRESULT time([in] double time);
230 231

        [propget, helpstring("Returns current playback state.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
232
        HRESULT state([out, retval] long* state);
233 234

        [propget, helpstring("Returns/sets current playback rate, normal rate is 1.0 ")]
Damien Fouilleul's avatar
Damien Fouilleul committed
235
        HRESULT rate([out, retval] double* rate);
236
        [propput, helpstring("Returns/sets current playback rate, normal rate is 1.0.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
237
        HRESULT rate([in] double rate);
238 239

        [propget, helpstring("Returns current playback frames per seconds if available.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
240
        HRESULT fps([out, retval] double* fps);
241 242 243 244 245

        [propget, helpstring("Returns whether current playback displays video.")]
        HRESULT hasVout([out, retval] VARIANT_BOOL* hasVout);
    };

Damien Fouilleul's avatar
Damien Fouilleul committed
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337
    [
      odl,
      uuid(9ED00AFA-7BCD-4FFF-8D48-7DD4DB2C800D),
      helpstring("VLC Log Message"),
      hidden,
      dual,
      nonextensible,
      oleautomation
    ]
    interface IVLCMessage: IDispatch
    {
        [id(DISPID_VALUE), propget]
        HRESULT _Value([out, retval] VARIANT* message);

        [propget, helpstring("Returns message severity.")]
        HRESULT severity([out, retval] long* level);

        [propget, helpstring("Returns message issuer type.")]
        HRESULT type([out, retval] BSTR* type);

        [propget, helpstring("Returns message issuer name.")]
        HRESULT name([out, retval] BSTR* name);

        [propget, helpstring("Returns message header.")]
        HRESULT header([out, retval] BSTR* header);

        [propget, helpstring("Returns message content.")]
        HRESULT message([out, retval] BSTR* message);
    };

    [
      odl,
      uuid(15179CD8-CC12-4242-A58E-E412217FF343),
      helpstring("VLC Log iterator"),
      hidden,
      dual,
      nonextensible,
      oleautomation
    ]
    interface IVLCMessageIterator : IDispatch
    {
        [propget, helpstring("Returns whether a message is available.")]
        HRESULT hasNext([out, retval] VARIANT_BOOL* hasNext);

        [helpstring("Returns next message.")]
        HRESULT next([out, retval] IVLCMessage** msg);
    };

    [
      odl,
      uuid(6C5CE55D-2D6C-4AAD-8299-C62D2371F106),
      helpstring("VLC Log APIs"),
      hidden,
      dual,
      nonextensible,
      oleautomation
    ]
    interface IVLCMessages : IDispatch
    {
        [id(DISPID_NEWENUM), propget]
        HRESULT _NewEnum([out, retval] IUnknown** _NewEnum);

        [helpstring("Clear all messages from log.")]
        HRESULT clear();

        [propget, helpstring("Returns the number of messages.")]
        HRESULT count([out, retval] long* count);

        [helpstring("Returns an iterator for messages in log")]
        HRESULT iterator([out, retval] IVLCMessageIterator** iter);
    };

    [
      odl,
      uuid(8E3BC3D9-62E9-48FB-8A6D-993F9ABC4A0A),
      helpstring("VLC Log APIs"),
      hidden,
      dual,
      nonextensible,
      oleautomation
    ]
    interface IVLCLog : IDispatch
    {
        [propget, helpstring("Returns messages in log")]
        HRESULT messages([out, retval] IVLCMessages** iter);

        [propget, helpstring("Returns/Sets the log versbosity level.")]
        HRESULT verbosity([out, retval] long* level);
        [propput, helpstring("Returns/Sets the log versbosity level.")]
        HRESULT verbosity([in] long level);
    };

338 339 340 341
    [
      odl,
      uuid(54613049-40BF-4035-9E70-0A9312C0188D),
      helpstring("VLC Playlist APIs"),
342
      hidden,
343
      dual,
344
      nonextensible,
345 346 347 348 349
      oleautomation
    ]
    interface IVLCPlaylist : IDispatch
    {
        [propget, helpstring("Returns number of items in playlist.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
350
        HRESULT itemCount([out, retval] long* count);
351 352 353 354 355

        [propget, helpstring("Returns whether playback displays video.")]
        HRESULT isPlaying([out, retval] VARIANT_BOOL* playing);

        [helpstring("Add a playlist item.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
356
        HRESULT add([in] BSTR uri, [in, optional] VARIANT name, [in, optional] VARIANT options, [out, retval] long* item);
357 358 359 360 361

        [helpstring("Play/Resume the playlist.")]
        HRESULT play();

        [helpstring("Play item in playlist.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
362
        HRESULT playItem([in] long item);
363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379

        [helpstring("Play/Pause current clip.")]
        HRESULT togglePause();

        [helpstring("Stop current clip.")]
        HRESULT stop();

        [helpstring("Advance to next item in playlist.")]
        HRESULT next();

        [helpstring("Advance to previous item in playlist.")]
        HRESULT prev();

        [helpstring("Remove all items from playlist.")]
        HRESULT clear();

        [helpstring("remove item from playlist.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
380
        HRESULT removeItem([in] long item);
381 382 383 384 385 386
    };

    [
      odl,
      uuid(0AAEDF0B-D333-4B27-A0C6-BBF31413A42E),
      helpstring("VLC Video APIs"),
387
      hidden,
388
      dual,
389
      nonextensible,
390 391 392 393 394 395 396 397 398 399
      oleautomation
    ]
    interface IVLCVideo : IDispatch
    {
        [propget, helpstring("Returns/sets the fullscreen state.")]
        HRESULT fullscreen([out, retval] VARIANT_BOOL* fullscreen);
        [propput, helpstring("Returns/sets the fullscreen state.")]
        HRESULT fullscreen([in] VARIANT_BOOL fullscreen);

        [propget, helpstring("Returns video original width.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
400
        HRESULT width([out, retval] long* width);
401 402

        [propget, helpstring("Returns video original height.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
403
        HRESULT height([out, retval] long* height);
404

405
        [propget, helpstring("Returns video aspect ratio.")]
406
        HRESULT aspectRatio([out, retval] BSTR aspect);
407 408 409
        [propput, helpstring("Sets video aspect ratio.")]
        HRESULT aspectRatio([in] BSTR aspect);

410 411
        [helpstring("toggle fullscreen/windowed state.")]
        HRESULT toggleFullscreen();
412 413
    };

414 415
    [
      odl,
416 417
      uuid(2D719729-5333-406C-BF12-8DE787FD65E3),
      helpstring("VLC Control"),
418
      hidden,
419 420 421
      dual,
      oleautomation
    ]
422
    interface IVLCControl2 : IDispatch
423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439
    {
        [id(DISPID_AutoLoop), propget, helpstring("Returns/sets a value that determines whether the playlist is looped")]
        HRESULT AutoLoop([out, retval] VARIANT_BOOL* autoloop);
        [id(DISPID_AutoLoop), propput, helpstring("Returns/sets a value that determines whether the playlist is looped")]
        HRESULT AutoLoop([in] VARIANT_BOOL autoloop);

        [id(DISPID_AutoPlay), propget, helpstring("Returns/sets a value that determines whether the playlist is played on startup")]
        HRESULT AutoPlay([out, retval] VARIANT_BOOL* autoplay);
        [id(DISPID_AutoPlay), propput, helpstring("Returns/Sets a value that determines whether the playlist is played on startup")]
        HRESULT AutoPlay([in] VARIANT_BOOL autoplay);

        [id(DISPID_BaseURL), propget, helpstring("Returns/sets the base URL for relative paths")]
        HRESULT BaseURL([out, retval] BSTR* url);
        [id(DISPID_BaseURL), propput, helpstring("Returns/sets the base URL for relative paths")]
        HRESULT BaseURL([in] BSTR url);

        [id(DISPID_StartTime), propget, helpstring("Returns/sets playback start time of URL.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
440
        HRESULT StartTime([out, retval] long* seconds);
441
        [id(DISPID_StartTime), propput, helpstring("Returns/sets playback start time of URL.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
442
        HRESULT StartTime([in] long seconds);
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457

        [id(DISPID_MRL), propget, helpstring("Returns/sets the default MRL in playlist")]
        HRESULT MRL([out, retval] BSTR* mrl);
        [id(DISPID_MRL), propput, helpstring("Returns/sets the default MRL in playlist")]
        HRESULT MRL([in] BSTR mrl);

        [propget, helpstring("Returns VLC Version.")]
        HRESULT VersionInfo([out, retval] BSTR* version);

        [id(DISPID_Visible), propget, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]
        HRESULT Visible([out, retval] VARIANT_BOOL* visible);
        [id(DISPID_Visible), propput, helpstring("Returns/sets a value that determines whether viewing area is visible or hidden.")]
        HRESULT Visible([in] VARIANT_BOOL visible);

        [id(DISPID_Volume), propget, helpstring("Returns/sets default audio volume.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
458
        HRESULT Volume([out, retval] long* volume);
459
        [id(DISPID_Volume), propput, helpstring("Returns/sets default audio volume.")]
Damien Fouilleul's avatar
Damien Fouilleul committed
460
        HRESULT Volume([in] long volume);
461

462 463 464 465 466 467
        [propget, helpstring("Returns the audio object.")]
        HRESULT audio([out, retval] IVLCAudio** obj);

        [propget, helpstring("Returns the audio object.")]
        HRESULT input([out, retval] IVLCInput** obj);

Damien Fouilleul's avatar
Damien Fouilleul committed
468 469 470
        [propget, helpstring("Returns the log object.")]
        HRESULT log([out, retval] IVLCLog** obj);

471 472 473 474 475 476 477
        [propget, helpstring("Returns the playlist object.")]
        HRESULT playlist([out, retval] IVLCPlaylist** obj);

        [propget, helpstring("Returns the audio object.")]
        HRESULT video([out, retval] IVLCVideo** obj);
    };

478 479
    [
      uuid(E23FE9C6-778E-49D4-B537-38FCDE4887D8),
480
      helpstring("VLC control (deprecated)"),
481 482
      control
    ]
483 484
    coclass VLCPlugin
    {
485
        [default] interface IVLCControl;
486 487 488 489 490 491 492 493 494 495 496 497 498
        interface IVLCControl2;
        [default, source] dispinterface DVLCEvents;
    };

    [
      uuid(9BE31822-FDAD-461B-AD51-BE1D1C159921),
      helpstring("VLC control"),
      control
    ]
    coclass VLCPlugin2
    {
        [default] interface IVLCControl2;
        interface IVLCControl;
499 500 501
        [default, source] dispinterface DVLCEvents;
    };
};