]> git.sesse.net Git - vlc/blobdiff - activex/vlccontrol2.cpp
libupnp: Don't unescape XML twice. Patch by Robson Braga Araujo
[vlc] / activex / vlccontrol2.cpp
index b9970b8346c04a664e9879df094ee1684f2fa437..8d45973db4e3b45c9cb6ce31078b1cba42e4f003 100644 (file)
@@ -2354,6 +2354,58 @@ STDMETHODIMP VLCVideo::put_crop(BSTR geometry)
     return hr;
 };
 
+STDMETHODIMP VLCVideo::get_teletext(long* page)
+{
+    if( NULL == page )
+        return E_POINTER;
+
+    libvlc_instance_t* p_libvlc;
+    HRESULT hr = _p_instance->getVLC(&p_libvlc);
+    if( SUCCEEDED(hr) )
+    {
+        libvlc_exception_t ex;
+        libvlc_exception_init(&ex);
+
+        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        if( ! libvlc_exception_raised(&ex) )
+        {
+            *page = libvlc_video_get_teletext(p_md, &ex);
+            libvlc_media_instance_release(p_md);
+            if( ! libvlc_exception_raised(&ex) )
+            {
+                return NOERROR;
+            }
+        }
+        _p_instance->setErrorInfo(IID_IVLCVideo, libvlc_exception_get_message(&ex));
+        libvlc_exception_clear(&ex);
+        return E_FAIL;
+    }
+    return hr;
+};
+
+STDMETHODIMP VLCVideo::put_teletext(long page)
+{
+    libvlc_instance_t* p_libvlc;
+    HRESULT hr = _p_instance->getVLC(&p_libvlc);
+    if( SUCCEEDED(hr) )
+    {
+        libvlc_exception_t ex;
+        libvlc_exception_init(&ex);
+
+        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_video_set_teletext(p_md, page, &ex);
+        libvlc_media_instance_release(p_md);
+        if( libvlc_exception_raised(&ex) )
+        {
+            _p_instance->setErrorInfo(IID_IVLCVideo, libvlc_exception_get_message(&ex));
+            libvlc_exception_clear(&ex);
+            return E_FAIL;
+        }
+        return NOERROR;
+    }
+    return hr;
+};
+
 STDMETHODIMP VLCVideo::takeSnapshot(LPPICTUREDISP* picture)
 {
     if( NULL == picture )
@@ -2427,7 +2479,7 @@ STDMETHODIMP VLCVideo::takeSnapshot(LPPICTUREDISP* picture)
                 return E_FAIL;
 
             /* take snapshot into file */
-            libvlc_video_take_snapshot(p_md, psz_filepath, &ex);
+            libvlc_video_take_snapshot(p_md, psz_filepath, 0, 0, &ex);
             libvlc_media_instance_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
@@ -2487,6 +2539,32 @@ STDMETHODIMP VLCVideo::toggleFullscreen()
     return hr;
 };
 
+STDMETHODIMP VLCVideo::toggleTeletext()
+{
+    libvlc_instance_t* p_libvlc;
+    HRESULT hr = _p_instance->getVLC(&p_libvlc);
+    if( SUCCEEDED(hr) )
+    {
+        libvlc_exception_t ex;
+        libvlc_exception_init(&ex);
+
+        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        if( ! libvlc_exception_raised(&ex) )
+        {
+            libvlc_toggle_teletext(p_md, &ex);
+            libvlc_media_instance_release(p_md);
+            if( ! libvlc_exception_raised(&ex) )
+            {
+                return NOERROR;
+            }
+        }
+        _p_instance->setErrorInfo(IID_IVLCVideo, libvlc_exception_get_message(&ex));
+        libvlc_exception_clear(&ex);
+        return E_FAIL;
+    }
+    return hr;
+};
+
 /*******************************************************************************/
 
 VLCControl2::VLCControl2(VLCPlugin *p_instance) :