Commit 9f89cf11 authored by Jean-Paul Saman's avatar Jean-Paul Saman

Fix bug in vlc.audio.track and add new properties vlc.video.subtitle

to JavaScript API implementation.
parent 7edab558
......@@ -205,9 +205,9 @@ library AXVLC
[propput, helpstring("Returns/sets audio track used/to use.")]
HRESULT track([in] long track);
[propget, helpstring("Returns audio channel: reverse stereo, stereo, left, right, dolby.")]
[propget, helpstring("Returns audio channel [1-5] indicating; stereo, reverse stereo, left, right, dolby.")]
HRESULT channel([out, retval] long* channel);
[propput, helpstring("Sets audio channel to: reverse stereo, stereo, left, right, dolby.")]
[propput, helpstring("Sets audio channel to [1-5] indicating; stereo, reverse stereo, left, right, dolby.")]
HRESULT channel([in] long channel);
};
......@@ -422,6 +422,11 @@ library AXVLC
[propput, helpstring("Sets video aspect ratio.")]
HRESULT aspectRatio([in] BSTR aspect);
[propget, helpstring("Returns video subtitle used.")]
HRESULT subtitle([out, retval] long* spu);
[propput, helpstring("Sets video subtitle to use.")]
HRESULT subtitle([in] long spu);
[propget, helpstring("Returns crop filter geometry.")]
HRESULT crop([out, retval] BSTR* geometry);
[propput, helpstring("Sets crop filter geometry.")]
......
No preview for this file type
/*** Autogenerated by WIDL 0.9.27 from axvlc.idl - Do not edit ***/
/*** Autogenerated by WIDL 0.9.30 from axvlc.idl - Do not edit ***/
#include <rpc.h>
#include <rpcndr.h>
......
/*** Autogenerated by WIDL 0.9.27 from axvlc.idl - Do not edit ***/
/*** Autogenerated by WIDL 0.9.30 from axvlc.idl - Do not edit ***/
#include <rpc.h>
#include <rpcndr.h>
......@@ -2253,6 +2253,12 @@ interface IVLCVideo : public IDispatch
virtual HRESULT STDMETHODCALLTYPE put_aspectRatio(
BSTR aspect) = 0;
virtual HRESULT STDMETHODCALLTYPE get_subtitle(
long* spu) = 0;
virtual HRESULT STDMETHODCALLTYPE put_subtitle(
long spu) = 0;
virtual HRESULT STDMETHODCALLTYPE get_crop(
BSTR* geometry) = 0;
......@@ -2337,6 +2343,14 @@ typedef struct IVLCVideoVtbl {
IVLCVideo* This,
BSTR aspect);
HRESULT (STDMETHODCALLTYPE *get_subtitle)(
IVLCVideo* This,
long* spu);
HRESULT (STDMETHODCALLTYPE *put_subtitle)(
IVLCVideo* This,
long spu);
HRESULT (STDMETHODCALLTYPE *get_crop)(
IVLCVideo* This,
BSTR* geometry);
......@@ -2375,6 +2389,8 @@ interface IVLCVideo {
#define IVLCVideo_get_height(p,a) (p)->lpVtbl->get_height(p,a)
#define IVLCVideo_get_aspectRatio(p,a) (p)->lpVtbl->get_aspectRatio(p,a)
#define IVLCVideo_put_aspectRatio(p,a) (p)->lpVtbl->put_aspectRatio(p,a)
#define IVLCVideo_get_subtitle(p,a) (p)->lpVtbl->get_subtitle(p,a)
#define IVLCVideo_put_subtitle(p,a) (p)->lpVtbl->put_subtitle(p,a)
#define IVLCVideo_get_crop(p,a) (p)->lpVtbl->get_crop(p,a)
#define IVLCVideo_put_crop(p,a) (p)->lpVtbl->put_crop(p,a)
#define IVLCVideo_toggleFullscreen(p) (p)->lpVtbl->toggleFullscreen(p)
......@@ -2431,6 +2447,22 @@ void __RPC_STUB IVLCVideo_put_aspectRatio_Stub(
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCVideo_get_subtitle_Proxy(
IVLCVideo* This,
long* spu);
void __RPC_STUB IVLCVideo_get_subtitle_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCVideo_put_subtitle_Proxy(
IVLCVideo* This,
long spu);
void __RPC_STUB IVLCVideo_put_subtitle_Stub(
IRpcStubBuffer* This,
IRpcChannelBuffer* pRpcChannelBuffer,
PRPC_MESSAGE pRpcMessage,
DWORD* pdwStubPhase);
HRESULT CALLBACK IVLCVideo_get_crop_Proxy(
IVLCVideo* This,
BSTR* geometry);
......
......@@ -87,7 +87,7 @@ STDMETHODIMP VLCAudio::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
return E_NOTIMPL;
};
STDMETHODIMP VLCAudio::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
STDMETHODIMP VLCAudio::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
UINT cNames, LCID lcid, DISPID* rgDispID)
{
if( SUCCEEDED(loadTypeInfo()) )
......@@ -190,7 +190,8 @@ STDMETHODIMP VLCAudio::put_volume(long volume)
libvlc_audio_set_volume(p_libvlc, volume, &ex);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCAudio, libvlc_exception_get_message(&ex));
_p_instance->setErrorInfo(IID_IVLCAudio,
libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
......@@ -216,7 +217,8 @@ STDMETHODIMP VLCAudio::get_track(long* track)
libvlc_input_free(p_input);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCAudio, libvlc_exception_get_message(&ex));
_p_instance->setErrorInfo(IID_IVLCAudio,
libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
......@@ -239,7 +241,8 @@ STDMETHODIMP VLCAudio::put_track(long track)
libvlc_input_free(p_input);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCAudio, libvlc_exception_get_message(&ex));
_p_instance->setErrorInfo(IID_IVLCAudio,
libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
......@@ -307,7 +310,8 @@ STDMETHODIMP VLCAudio::toggleMute()
libvlc_audio_toggle_mute(p_libvlc, &ex);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCAudio, libvlc_exception_get_message(&ex));
_p_instance->setErrorInfo(IID_IVLCAudio,
libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
......@@ -373,7 +377,7 @@ STDMETHODIMP VLCInput::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
return E_NOTIMPL;
};
STDMETHODIMP VLCInput::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
STDMETHODIMP VLCInput::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
UINT cNames, LCID lcid, DISPID* rgDispID)
{
if( SUCCEEDED(loadTypeInfo()) )
......@@ -738,7 +742,7 @@ STDMETHODIMP VLCLog::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
return E_NOTIMPL;
};
STDMETHODIMP VLCLog::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
STDMETHODIMP VLCLog::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
UINT cNames, LCID lcid, DISPID* rgDispID)
{
if( SUCCEEDED(loadTypeInfo()) )
......@@ -991,7 +995,7 @@ STDMETHODIMP VLCMessages::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInf
return E_NOTIMPL;
};
STDMETHODIMP VLCMessages::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
STDMETHODIMP VLCMessages::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
UINT cNames, LCID lcid, DISPID* rgDispID)
{
if( SUCCEEDED(loadTypeInfo()) )
......@@ -1157,7 +1161,7 @@ STDMETHODIMP VLCMessageIterator::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO*
return E_NOTIMPL;
};
STDMETHODIMP VLCMessageIterator::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
STDMETHODIMP VLCMessageIterator::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
UINT cNames, LCID lcid, DISPID* rgDispID)
{
if( SUCCEEDED(loadTypeInfo()) )
......@@ -1288,7 +1292,7 @@ STDMETHODIMP VLCMessage::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo
return E_NOTIMPL;
};
STDMETHODIMP VLCMessage::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
STDMETHODIMP VLCMessage::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
UINT cNames, LCID lcid, DISPID* rgDispID)
{
if( SUCCEEDED(loadTypeInfo()) )
......@@ -1448,7 +1452,7 @@ STDMETHODIMP VLCPlaylistItems::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* p
return E_NOTIMPL;
};
STDMETHODIMP VLCPlaylistItems::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
STDMETHODIMP VLCPlaylistItems::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
UINT cNames, LCID lcid, DISPID* rgDispID)
{
if( SUCCEEDED(loadTypeInfo()) )
......@@ -1597,7 +1601,7 @@ STDMETHODIMP VLCPlaylist::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInf
return E_NOTIMPL;
};
STDMETHODIMP VLCPlaylist::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
STDMETHODIMP VLCPlaylist::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
UINT cNames, LCID lcid, DISPID* rgDispID)
{
if( SUCCEEDED(loadTypeInfo()) )
......@@ -2003,7 +2007,7 @@ STDMETHODIMP VLCVideo::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInfo)
return E_NOTIMPL;
};
STDMETHODIMP VLCVideo::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
STDMETHODIMP VLCVideo::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
UINT cNames, LCID lcid, DISPID* rgDispID)
{
if( SUCCEEDED(loadTypeInfo()) )
......@@ -2217,6 +2221,58 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
return hr;
};
STDMETHODIMP VLCVideo::get_subtitle(long* spu)
{
if( NULL == spu )
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_input_t *p_input = libvlc_playlist_get_input(p_libvlc, &ex);
if( ! libvlc_exception_raised(&ex) )
{
*spu = libvlc_video_get_spu(p_input, &ex);
libvlc_input_free(p_input);
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_subtitle(long spu)
{
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_input_t *p_input = libvlc_playlist_get_input(p_libvlc, &ex);
libvlc_video_set_spu(p_input, spu, &ex);
libvlc_input_free(p_input);
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::get_crop(BSTR* geometry)
{
if( NULL == geometry )
......@@ -2438,7 +2494,7 @@ STDMETHODIMP VLCControl2::GetTypeInfo(UINT iTInfo, LCID lcid, LPTYPEINFO* ppTInf
return E_NOTIMPL;
};
STDMETHODIMP VLCControl2::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
STDMETHODIMP VLCControl2::GetIDsOfNames(REFIID riid, LPOLESTR* rgszNames,
UINT cNames, LCID lcid, DISPID* rgDispID)
{
if( SUCCEEDED(loadTypeInfo()) )
......
......@@ -522,6 +522,8 @@ public:
STDMETHODIMP get_height(long*);
STDMETHODIMP get_aspectRatio(BSTR*);
STDMETHODIMP put_aspectRatio(BSTR);
STDMETHODIMP get_subtitle(long*);
STDMETHODIMP put_subtitle(long);
STDMETHODIMP get_crop(BSTR*);
STDMETHODIMP put_crop(BSTR);
STDMETHODIMP takeSnapshot(BSTR);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment