]> git.sesse.net Git - vlc/blobdiff - projects/activex/vlccontrol.cpp
Document new feature RTSP trickplay support.
[vlc] / projects / activex / vlccontrol.cpp
index 19210148ab6d58e4522ad67a8b6ce27d09f72c70..298a4495062d8db1d9805f31a8c11734ba1ecc76 100644 (file)
@@ -509,16 +509,28 @@ STDMETHODIMP VLCControl::toggleMute(void)
 
 STDMETHODIMP VLCControl::setVariable(BSTR name, VARIANT value)
 {
-    /** setVariable() is an unsafe interface because of security
-      implications it has and is thus removed. */
-    return E_INVALIDARG;
+    libvlc_instance_t* p_libvlc;
+    HRESULT result = _p_instance->getVLC(&p_libvlc);
+    if( SUCCEEDED(result) )
+    {
+        _p_instance->setErrorInfo(IID_IVLCControl,
+            "setVariable() is an unsafe interface to use. "
+            "It has been removed because of security implications." );
+    }
+    return E_FAIL;
 };
 
 STDMETHODIMP VLCControl::getVariable(BSTR name, VARIANT *value)
 {
-    /** getVariable() is an unsafe interface because of security
-      implications it has and is thus removed. */
-    return E_INVALIDARG;
+    libvlc_instance_t* p_libvlc;
+    HRESULT result = _p_instance->getVLC(&p_libvlc);
+    if( SUCCEEDED(result) )
+    {
+        _p_instance->setErrorInfo(IID_IVLCControl,
+            "getVariable() is an unsafe interface to use. "
+            "It has been removed because of security implications." );
+    }
+    return E_FAIL;
 };
 
 void VLCControl::FreeTargetOptions(char **cOptions, int cOptionCount)
@@ -890,21 +902,28 @@ STDMETHODIMP VLCControl::addTarget(BSTR uri, VARIANT options, enum VLCPlaylistMo
 
 STDMETHODIMP VLCControl::get_PlaylistIndex(int *index)
 {
-    return E_INVALIDARG;
-#if 0
     if( NULL == index )
         return E_POINTER;
 
+    *index = 0;
     libvlc_instance_t *p_libvlc;
     HRESULT result = _p_instance->getVLC(&p_libvlc);
     if( SUCCEEDED(result) )
     {
-        *index = VLC_PlaylistIndex(i_vlc);
+        libvlc_exception_t ex;
+        libvlc_exception_init(&ex);
+
+        *index = libvlc_playlist_get_current_index(p_libvlc, &ex);
+        if( libvlc_exception_raised(&ex) )
+        {
+            _p_instance->setErrorInfo(IID_IVLCControl,
+                libvlc_exception_get_message(&ex));
+            libvlc_exception_clear(&ex);
+            return E_FAIL;
+        }
         return NOERROR;
     }
-    *index = 0;
     return result;
-#endif
 };
 
 STDMETHODIMP VLCControl::get_PlaylistCount(int *count)