]> git.sesse.net Git - vlc/blobdiff - activex/vlccontrol2.cpp
I meant to use var_CreateGetNonEmptyString().
[vlc] / activex / vlccontrol2.cpp
index fcd27715ba34385d59bbf76da98c6e22f1d8dcaa..39a789df2c5b4092626856a20092cecc7ce60356 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 )
@@ -2715,6 +2767,21 @@ STDMETHODIMP VLCControl2::put_Volume(long volume)
     return NOERROR;
 };
 
+STDMETHODIMP VLCControl2::get_BackColor(OLE_COLOR *backcolor)
+{
+    if( NULL == backcolor )
+        return E_POINTER;
+
+    *backcolor  = _p_instance->getBackColor();
+    return NOERROR;
+};
+
+STDMETHODIMP VLCControl2::put_BackColor(OLE_COLOR backcolor)
+{
+    _p_instance->setBackColor(backcolor);
+    return NOERROR;
+};
+
 STDMETHODIMP VLCControl2::get_audio(IVLCAudio** obj)
 {
     if( NULL == obj )