1 /*****************************************************************************
2 * vlccontrol.cpp: ActiveX control for VLC
3 *****************************************************************************
4 * Copyright (C) 2005 the VideoLAN team
6 * Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
7 * Jean-Paul Saman <jpsaman@videolan.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., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22 *****************************************************************************/
25 #include "vlccontrol.h"
31 VLCControl::~VLCControl()
34 _p_typeinfo->Release();
37 HRESULT VLCControl::getTypeInfo(void)
40 if( NULL == _p_typeinfo )
44 hr = _p_instance->getTypeLib(LOCALE_USER_DEFAULT, &p_typelib);
47 hr = p_typelib->GetTypeInfoOfGuid(IID_IVLCControl, &_p_typeinfo);
58 STDMETHODIMP VLCControl::GetTypeInfoCount(UINT* pctInfo)
63 if( SUCCEEDED(getTypeInfo()) )
71 STDMETHODIMP VLCControl::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
76 if( SUCCEEDED(getTypeInfo()) )
78 _p_typeinfo->AddRef();
79 *ppTInfo = _p_typeinfo;
86 STDMETHODIMP VLCControl::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
87 UINT cNames, LCID lcid, DISPID* rgDispID)
89 if( SUCCEEDED(getTypeInfo()) )
91 return DispGetIDsOfNames(_p_typeinfo, rgszNames, cNames, rgDispID);
96 STDMETHODIMP VLCControl::Invoke(DISPID dispIdMember, REFIID riid,
97 LCID lcid, WORD wFlags, DISPPARAMS* pDispParams,
98 VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr)
100 if( SUCCEEDED(getTypeInfo()) )
102 return DispInvoke(this, _p_typeinfo, dispIdMember, wFlags, pDispParams,
103 pVarResult, pExcepInfo, puArgErr);
108 STDMETHODIMP VLCControl::get_Visible(VARIANT_BOOL *isVisible)
110 if( NULL == isVisible )
113 *isVisible = _p_instance->getVisible() ? VARIANT_TRUE : VARIANT_FALSE;
118 STDMETHODIMP VLCControl::put_Visible(VARIANT_BOOL isVisible)
120 _p_instance->setVisible(isVisible != VARIANT_FALSE);
125 STDMETHODIMP VLCControl::play(void)
127 libvlc_instance_t* p_libvlc;
128 HRESULT result = _p_instance->getVLC(&p_libvlc);
129 if( SUCCEEDED(result) )
131 libvlc_exception_t ex;
132 libvlc_exception_init(&ex);
134 libvlc_playlist_play(p_libvlc, -1, 0, NULL, &ex);
135 if( libvlc_exception_raised(&ex) )
137 _p_instance->setErrorInfo(IID_IVLCControl,
138 libvlc_exception_get_message(&ex));
139 libvlc_exception_clear(&ex);
142 _p_instance->fireOnPlayEvent();
148 STDMETHODIMP VLCControl::pause(void)
150 libvlc_instance_t* p_libvlc;
151 HRESULT result = _p_instance->getVLC(&p_libvlc);
152 if( SUCCEEDED(result) )
154 libvlc_exception_t ex;
155 libvlc_exception_init(&ex);
157 libvlc_playlist_pause(p_libvlc, &ex);
158 if( libvlc_exception_raised(&ex) )
160 _p_instance->setErrorInfo(IID_IVLCControl,
161 libvlc_exception_get_message(&ex));
162 libvlc_exception_clear(&ex);
165 _p_instance->fireOnPauseEvent();
171 STDMETHODIMP VLCControl::stop(void)
173 libvlc_instance_t* p_libvlc;
174 HRESULT result = _p_instance->getVLC(&p_libvlc);
175 if( SUCCEEDED(result) )
177 libvlc_exception_t ex;
178 libvlc_exception_init(&ex);
180 libvlc_playlist_stop(p_libvlc, &ex);
181 if( libvlc_exception_raised(&ex) )
183 _p_instance->setErrorInfo(IID_IVLCControl,
184 libvlc_exception_get_message(&ex));
185 libvlc_exception_clear(&ex);
190 _p_instance->fireOnStopEvent();
194 STDMETHODIMP VLCControl::get_Playing(VARIANT_BOOL *isPlaying)
196 if( NULL == isPlaying )
199 HRESULT result = NOERROR;
200 if( _p_instance->isRunning() )
202 libvlc_instance_t *p_libvlc;
203 result = _p_instance->getVLC(&p_libvlc);
204 if( SUCCEEDED(result) )
206 if( libvlc_playlist_isplaying(p_libvlc, NULL) )
207 *isPlaying = VARIANT_TRUE;
209 *isPlaying = VARIANT_FALSE;
213 *isPlaying = VARIANT_FALSE;
217 STDMETHODIMP VLCControl::get_Position(float *position)
219 if( NULL == position )
223 libvlc_instance_t* p_libvlc;
224 HRESULT result = E_UNEXPECTED;
225 result = _p_instance->getVLC(&p_libvlc);
226 if( SUCCEEDED(result) )
228 libvlc_exception_t ex;
229 libvlc_exception_init(&ex);
231 libvlc_media_player_t *p_md;
232 p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
233 if( !libvlc_exception_raised(&ex) )
235 *position = libvlc_media_player_get_position(p_md, &ex);
236 libvlc_media_player_release(p_md);
237 if( ! libvlc_exception_raised(&ex) )
242 _p_instance->setErrorInfo(IID_IVLCControl,
243 libvlc_exception_get_message(&ex));
244 libvlc_exception_clear(&ex);
250 STDMETHODIMP VLCControl::put_Position(float position)
252 HRESULT result = E_UNEXPECTED;
253 libvlc_instance_t* p_libvlc;
254 result = _p_instance->getVLC(&p_libvlc);
255 if( SUCCEEDED(result) )
257 libvlc_exception_t ex;
258 libvlc_exception_init(&ex);
260 libvlc_media_player_t *p_md;
261 p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
262 if( ! libvlc_exception_raised(&ex) )
264 libvlc_media_player_set_position(p_md, position, &ex);
265 libvlc_media_player_release(p_md);
266 if( ! libvlc_exception_raised(&ex) )
271 _p_instance->setErrorInfo(IID_IVLCControl,
272 libvlc_exception_get_message(&ex));
273 libvlc_exception_clear(&ex);
279 STDMETHODIMP VLCControl::get_Time(int *seconds)
281 if( NULL == seconds )
285 libvlc_instance_t* p_libvlc;
286 HRESULT result = _p_instance->getVLC(&p_libvlc);
287 if( SUCCEEDED(result) )
289 libvlc_exception_t ex;
290 libvlc_exception_init(&ex);
292 libvlc_media_player_t *p_md;
293 p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
294 if( ! libvlc_exception_raised(&ex) )
296 *seconds = libvlc_media_player_get_time(p_md, &ex);
297 libvlc_media_player_release(p_md);
298 if( ! libvlc_exception_raised(&ex) )
303 _p_instance->setErrorInfo(IID_IVLCControl,
304 libvlc_exception_get_message(&ex));
305 libvlc_exception_clear(&ex);
311 STDMETHODIMP VLCControl::put_Time(int seconds)
313 /* setTime function of the plugin sets the time. */
314 _p_instance->setTime(seconds);
318 STDMETHODIMP VLCControl::shuttle(int seconds)
320 libvlc_instance_t* p_libvlc;
321 HRESULT result = _p_instance->getVLC(&p_libvlc);
322 if( SUCCEEDED(result) )
324 libvlc_exception_t ex;
325 libvlc_exception_init(&ex);
327 libvlc_media_player_t *p_md;
328 p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
329 if( ! libvlc_exception_raised(&ex) )
331 if( seconds < 0 ) seconds = 0;
332 libvlc_media_player_set_time(p_md, (int64_t)seconds, &ex);
333 libvlc_media_player_release(p_md);
334 if( ! libvlc_exception_raised(&ex) )
339 _p_instance->setErrorInfo(IID_IVLCControl,
340 libvlc_exception_get_message(&ex));
341 libvlc_exception_clear(&ex);
348 STDMETHODIMP VLCControl::fullscreen(void)
350 HRESULT result = E_UNEXPECTED;
351 if( _p_instance->isRunning() )
353 libvlc_instance_t *p_libvlc;
354 result = _p_instance->getVLC(&p_libvlc);
355 if( SUCCEEDED(result) )
357 if( libvlc_playlist_isplaying(p_libvlc, NULL) )
359 libvlc_media_player_t *p_md =
360 libvlc_playlist_get_media_player(p_libvlc, NULL);
363 libvlc_toggle_fullscreen(p_md, NULL);
364 libvlc_media_player_release(p_md);
372 STDMETHODIMP VLCControl::get_Length(int *seconds)
374 if( NULL == seconds )
378 libvlc_instance_t* p_libvlc;
379 HRESULT result = _p_instance->getVLC(&p_libvlc);
380 if( SUCCEEDED(result) )
382 libvlc_exception_t ex;
383 libvlc_exception_init(&ex);
385 libvlc_media_player_t *p_md;
386 p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
387 if( ! libvlc_exception_raised(&ex) )
389 *seconds = (double)libvlc_media_player_get_length(p_md, &ex);
390 libvlc_media_player_release(p_md);
391 if( ! libvlc_exception_raised(&ex) )
396 _p_instance->setErrorInfo(IID_IVLCControl,
397 libvlc_exception_get_message(&ex));
398 libvlc_exception_clear(&ex);
405 STDMETHODIMP VLCControl::playFaster(void)
409 HRESULT result = E_UNEXPECTED;
410 if( !_p_instance->isRunning() )
413 libvlc_instance_t* p_libvlc;
414 result = _p_instance->getVLC(&p_libvlc);
415 if( SUCCEEDED(result) )
417 libvlc_exception_t ex;
418 libvlc_exception_init(&ex);
420 libvlc_media_player_t *p_md;
421 p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
422 if( ! libvlc_exception_raised(&ex) )
424 libvlc_media_player_set_rate(p_md, rate, &ex);
425 libvlc_media_player_release(p_md);
426 if( ! libvlc_exception_raised(&ex) )
431 _p_instance->setErrorInfo(IID_IVLCControl,
432 libvlc_exception_get_message(&ex));
433 libvlc_exception_clear(&ex);
439 STDMETHODIMP VLCControl::playSlower(void)
443 HRESULT result = E_UNEXPECTED;
444 if( !_p_instance->isRunning() )
447 libvlc_instance_t* p_libvlc;
448 result = _p_instance->getVLC(&p_libvlc);
449 if( SUCCEEDED(result) )
451 libvlc_exception_t ex;
452 libvlc_exception_init(&ex);
454 libvlc_media_player_t *p_md;
455 p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
456 if( ! libvlc_exception_raised(&ex) )
458 libvlc_media_player_set_rate(p_md, rate, &ex);
459 libvlc_media_player_release(p_md);
460 if( ! libvlc_exception_raised(&ex) )
465 _p_instance->setErrorInfo(IID_IVLCControl,
466 libvlc_exception_get_message(&ex));
467 libvlc_exception_clear(&ex);
473 STDMETHODIMP VLCControl::get_Volume(int *volume)
478 *volume = _p_instance->getVolume();
482 STDMETHODIMP VLCControl::put_Volume(int volume)
484 _p_instance->setVolume(volume);
488 STDMETHODIMP VLCControl::toggleMute(void)
490 libvlc_instance_t* p_libvlc;
491 HRESULT result = _p_instance->getVLC(&p_libvlc);
492 if( SUCCEEDED(result) )
494 libvlc_exception_t ex;
495 libvlc_exception_init(&ex);
497 libvlc_audio_toggle_mute(p_libvlc, &ex);
498 if( libvlc_exception_raised(&ex) )
500 _p_instance->setErrorInfo(IID_IVLCControl,
501 libvlc_exception_get_message(&ex));
502 libvlc_exception_clear(&ex);
510 STDMETHODIMP VLCControl::setVariable(BSTR name, VARIANT value)
512 /** setVariable() is an unsafe interface because of security
513 implications it has and is thus removed. */
517 STDMETHODIMP VLCControl::getVariable(BSTR name, VARIANT *value)
519 /** getVariable() is an unsafe interface because of security
520 implications it has and is thus removed. */
524 void VLCControl::FreeTargetOptions(char **cOptions, int cOptionCount)
527 if( NULL != cOptions )
529 for( int pos=0; pos<cOptionCount; ++pos )
531 char *cOption = cOptions[pos];
532 if( NULL != cOption )
533 CoTaskMemFree(cOption);
537 CoTaskMemFree(cOptions);
541 static HRESULT parseStringOptions(int codePage, BSTR bstr, char*** cOptions, int *cOptionCount)
543 HRESULT hr = E_INVALIDARG;
544 if( SysStringLen(bstr) > 0 )
547 char *s = CStrFromBSTR(codePage, bstr);
552 char **options = (char **)CoTaskMemAlloc(capacity*sizeof(char *));
557 char *end = val + strlen(val);
560 // skip leading blanks
562 && ((*val == ' ' ) || (*val == '\t')) )
566 // skip till we get a blank character
572 if( ('\'' == c) || ('"' == c) )
574 // skip till end of string
575 while( (val < end) && (*(val++) != c ) );
581 if( nOptions == capacity )
584 char **moreOptions = (char **)CoTaskMemRealloc(options, capacity*sizeof(char*));
587 /* failed to allocate more memory */
589 /* return what we got so far */
590 *cOptionCount = nOptions;
594 options = moreOptions;
597 options[nOptions] = (char *)CoTaskMemAlloc(val-start);
598 if( options[nOptions] )
600 memcpy(options[nOptions], start, val-start);
605 /* failed to allocate memory */
607 /* return what we got so far */
608 *cOptionCount = nOptions;
614 // must be end of string
617 *cOptionCount = nOptions;
627 HRESULT VLCControl::CreateTargetOptions(int codePage, VARIANT *options, char ***cOptions, int *cOptionCount)
629 HRESULT hr = E_INVALIDARG;
630 if( VT_ERROR == V_VT(options) )
632 if( DISP_E_PARAMNOTFOUND == V_ERROR(options) )
634 // optional parameter not set
640 else if( (VT_EMPTY == V_VT(options)) || (VT_NULL == V_VT(options)) )
647 else if( VT_DISPATCH == V_VT(options) )
649 // if object is a collection, retrieve enumerator
651 V_VT(&colEnum) = VT_UNKNOWN;
652 hr = GetObjectProperty(V_DISPATCH(options), DISPID_NEWENUM, colEnum);
655 IEnumVARIANT *enumVar;
656 hr = V_UNKNOWN(&colEnum)->QueryInterface(IID_IEnumVARIANT, (LPVOID *)&enumVar);
663 *cOptions = (char **)CoTaskMemAlloc(capacity*sizeof(char *));
664 if( NULL != *cOptions )
666 ZeroMemory(*cOptions, sizeof(char *)*capacity);
667 while( SUCCEEDED(hr) && (S_OK == enumVar->Next(1, &option, NULL)) )
669 if( VT_BSTR == V_VT(&option) )
671 char *cOption = CStrFromBSTR(codePage, V_BSTR(&option));
672 (*cOptions)[pos] = cOption;
673 if( NULL != cOption )
676 if( pos == capacity )
678 char **moreOptions = (char **)CoTaskMemRealloc(*cOptions, (capacity+16)*sizeof(char *));
679 if( NULL != moreOptions )
681 ZeroMemory(moreOptions+capacity, sizeof(char *)*16);
683 *cOptions = moreOptions;
690 hr = ( SysStringLen(V_BSTR(&option)) > 0 ) ?
691 E_OUTOFMEMORY : E_INVALIDARG;
696 VariantClear(&option);
701 // free already processed elements
702 FreeTargetOptions(*cOptions, *cOptionCount);
713 // coerce object into a string and parse it
715 VariantInit(&v_name);
716 hr = VariantChangeType(&v_name, options, 0, VT_BSTR);
719 hr = parseStringOptions(codePage, V_BSTR(&v_name), cOptions, cOptionCount);
720 VariantClear(&v_name);
724 else if( V_ISARRAY(options) )
727 SAFEARRAY *array = V_ISBYREF(options) ? *V_ARRAYREF(options) : V_ARRAY(options);
729 if( SafeArrayGetDim(array) != 1 )
734 SafeArrayGetLBound(array, 1, &lBound);
735 SafeArrayGetUBound(array, 1, &uBound);
737 // have we got any options
738 if( uBound >= lBound )
741 hr = SafeArrayGetVartype(array, &vType);
747 // marshall options into an array of C strings
748 if( VT_VARIANT == vType )
750 *cOptions = (char **)CoTaskMemAlloc(sizeof(char *)*(uBound-lBound+1));
751 if( NULL == *cOptions )
752 return E_OUTOFMEMORY;
754 ZeroMemory(*cOptions, sizeof(char *)*(uBound-lBound+1));
755 for(pos=lBound; (pos<=uBound) && SUCCEEDED(hr); ++pos )
758 hr = SafeArrayGetElement(array, &pos, &option);
761 if( VT_BSTR == V_VT(&option) )
763 char *cOption = CStrFromBSTR(codePage, V_BSTR(&option));
764 (*cOptions)[pos-lBound] = cOption;
765 if( NULL == cOption )
766 hr = ( SysStringLen(V_BSTR(&option)) > 0 ) ?
767 E_OUTOFMEMORY : E_INVALIDARG;
771 VariantClear(&option);
775 else if( VT_BSTR == vType )
777 *cOptions = (char **)CoTaskMemAlloc(sizeof(char *)*(uBound-lBound+1));
778 if( NULL == *cOptions )
779 return E_OUTOFMEMORY;
781 ZeroMemory(*cOptions, sizeof(char *)*(uBound-lBound+1));
782 for(pos=lBound; (pos<=uBound) && SUCCEEDED(hr); ++pos )
785 hr = SafeArrayGetElement(array, &pos, &option);
788 char *cOption = CStrFromBSTR(codePage, option);
790 (*cOptions)[pos-lBound] = cOption;
791 if( NULL == cOption )
792 hr = ( SysStringLen(option) > 0 ) ?
793 E_OUTOFMEMORY : E_INVALIDARG;
794 SysFreeString(option);
804 *cOptionCount = pos-lBound;
807 // free already processed elements
808 FreeTargetOptions(*cOptions, *cOptionCount);
819 else if( VT_UNKNOWN == V_VT(options) )
821 // coerce object into a string and parse it
823 VariantInit(&v_name);
824 hr = VariantChangeType(&v_name, options, 0, VT_BSTR);
827 hr = parseStringOptions(codePage, V_BSTR(&v_name), cOptions, cOptionCount);
828 VariantClear(&v_name);
831 else if( VT_BSTR == V_VT(options) )
833 hr = parseStringOptions(codePage, V_BSTR(options), cOptions, cOptionCount);
839 ** use VARIANT rather than a SAFEARRAY as argument type
840 ** for compatibility with some scripting language (JScript)
843 STDMETHODIMP VLCControl::addTarget(BSTR uri, VARIANT options, enum VLCPlaylistMode mode, int position)
845 if( 0 == SysStringLen(uri) )
848 libvlc_instance_t *p_libvlc;
849 HRESULT hr = _p_instance->getVLC(&p_libvlc);
852 char *cUri = CStrFromBSTR(CP_UTF8, uri);
854 return E_OUTOFMEMORY;
859 if( FAILED(CreateTargetOptions(CP_UTF8, &options, &cOptions, &cOptionsCount)) )
862 libvlc_exception_t ex;
863 libvlc_exception_init(&ex);
865 position = libvlc_playlist_add_extended(p_libvlc, cUri, cUri,
867 const_cast<const char**>(cOptions),
870 FreeTargetOptions(cOptions, cOptionsCount);
873 if( libvlc_exception_raised(&ex) )
875 _p_instance->setErrorInfo(IID_IVLCPlaylist,
876 libvlc_exception_get_message(&ex));
877 libvlc_exception_clear(&ex);
879 if( mode & VLCPlayListAppendAndGo )
880 _p_instance->fireOnStopEvent();
884 if( mode & VLCPlayListAppendAndGo )
885 _p_instance->fireOnPlayEvent();
891 STDMETHODIMP VLCControl::get_PlaylistIndex(int *index)
898 libvlc_instance_t *p_libvlc;
899 HRESULT result = _p_instance->getVLC(&p_libvlc);
900 if( SUCCEEDED(result) )
902 *index = VLC_PlaylistIndex(i_vlc);
910 STDMETHODIMP VLCControl::get_PlaylistCount(int *count)
916 libvlc_instance_t* p_libvlc;
917 HRESULT result = _p_instance->getVLC(&p_libvlc);
918 if( SUCCEEDED(result) )
920 libvlc_exception_t ex;
921 libvlc_exception_init(&ex);
923 *count = libvlc_playlist_items_count(p_libvlc, &ex);
924 if( libvlc_exception_raised(&ex) )
926 _p_instance->setErrorInfo(IID_IVLCControl,
927 libvlc_exception_get_message(&ex));
928 libvlc_exception_clear(&ex);
936 STDMETHODIMP VLCControl::playlistNext(void)
938 libvlc_instance_t* p_libvlc;
939 HRESULT result = _p_instance->getVLC(&p_libvlc);
940 if( SUCCEEDED(result) )
942 libvlc_exception_t ex;
943 libvlc_exception_init(&ex);
945 libvlc_playlist_next(p_libvlc, &ex);
946 if( libvlc_exception_raised(&ex) )
948 _p_instance->setErrorInfo(IID_IVLCControl,
949 libvlc_exception_get_message(&ex));
950 libvlc_exception_clear(&ex);
958 STDMETHODIMP VLCControl::playlistPrev(void)
960 libvlc_instance_t* p_libvlc;
961 HRESULT result = _p_instance->getVLC(&p_libvlc);
962 if( SUCCEEDED(result) )
964 libvlc_exception_t ex;
965 libvlc_exception_init(&ex);
967 libvlc_playlist_prev(p_libvlc, &ex);
968 if( libvlc_exception_raised(&ex) )
970 _p_instance->setErrorInfo(IID_IVLCControl,
971 libvlc_exception_get_message(&ex));
972 libvlc_exception_clear(&ex);
980 STDMETHODIMP VLCControl::playlistClear(void)
982 libvlc_instance_t* p_libvlc;
983 HRESULT result = _p_instance->getVLC(&p_libvlc);
984 if( SUCCEEDED(result) )
986 libvlc_exception_t ex;
987 libvlc_exception_init(&ex);
989 libvlc_playlist_clear(p_libvlc, &ex);
990 if( libvlc_exception_raised(&ex) )
992 _p_instance->setErrorInfo(IID_IVLCControl,
993 libvlc_exception_get_message(&ex));
994 libvlc_exception_clear(&ex);
1002 STDMETHODIMP VLCControl::get_VersionInfo(BSTR *version)
1004 if( NULL == version )
1007 const char *versionStr = libvlc_get_version();
1008 if( NULL != versionStr )
1010 *version = BSTRFromCStr(CP_UTF8, versionStr);
1011 return (NULL == *version) ? E_OUTOFMEMORY : NOERROR;
1017 STDMETHODIMP VLCControl::get_MRL(BSTR *mrl)
1022 *mrl = SysAllocStringLen(_p_instance->getMRL(),
1023 SysStringLen(_p_instance->getMRL()));
1027 STDMETHODIMP VLCControl::put_MRL(BSTR mrl)
1029 _p_instance->setMRL(mrl);
1034 STDMETHODIMP VLCControl::get_AutoPlay(VARIANT_BOOL *autoplay)
1036 if( NULL == autoplay )
1039 *autoplay = _p_instance->getAutoPlay() ? VARIANT_TRUE: VARIANT_FALSE;
1043 STDMETHODIMP VLCControl::put_AutoPlay(VARIANT_BOOL autoplay)
1045 _p_instance->setAutoPlay((VARIANT_FALSE != autoplay) ? TRUE: FALSE);
1049 STDMETHODIMP VLCControl::get_AutoLoop(VARIANT_BOOL *autoloop)
1051 if( NULL == autoloop )
1054 *autoloop = _p_instance->getAutoLoop() ? VARIANT_TRUE: VARIANT_FALSE;
1058 STDMETHODIMP VLCControl::put_AutoLoop(VARIANT_BOOL autoloop)
1060 _p_instance->setAutoLoop((VARIANT_FALSE != autoloop) ? TRUE: FALSE);