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

Add support to the activex, mozilla, firefox, safari plugin for changing audio...

Add support to the activex, mozilla, firefox, safari plugin for changing audio track and audio output channel (reverse, stereo, left, right, dolby).
parent 9d83c3c7
......@@ -4,6 +4,7 @@
* Copyright (C) 2006 the VideoLAN team
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
* Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -198,6 +199,16 @@ library AXVLC
[helpstring("Mute/unmute audio playback.")]
HRESULT toggleMute();
[propget, helpstring("Returns/sets audio track used/to use.")]
HRESULT track([out, retval] long* track);
[propput, helpstring("Returns/sets audio track used/to use.")]
HRESULT track([in] long track);
[propget, helpstring("Returns audio channel: reverse, stereo, left, right, dolby.")]
HRESULT channel([out, retval] BSTR* channel);
[propput, helpstring("Sets audio channel to: reverse, stereo, left, right, dolby.")]
HRESULT channel([in] BSTR channel);
};
[
......
......@@ -4,6 +4,7 @@
* Copyright (C) 2006 the VideoLAN team
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
* Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -198,6 +199,119 @@ STDMETHODIMP VLCAudio::put_volume(long volume)
return hr;
};
STDMETHODIMP VLCAudio::get_track(long* track)
{
if( NULL == track )
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);
*track = libvlc_audio_get_track(p_libvlc, &ex);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCAudio, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
return NOERROR;
}
return hr;
};
STDMETHODIMP VLCAudio::put_track(long track)
{
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
libvlc_exception_t ex;
libvlc_exception_init(&ex);
libvlc_audio_set_track(p_libvlc, track, &ex);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCAudio, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
return NOERROR;
}
return hr;
};
STDMETHODIMP VLCAudio::get_channel(BSTR *channel)
{
if( NULL == channel )
return E_POINTER;
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
char *psz_channel = NULL;
libvlc_exception_t ex;
libvlc_exception_init(&ex);
psz_channel = libvlc_audio_get_channel(p_libvlc, &ex);
if( ! libvlc_exception_raised(&ex) )
{
if( NULL == psz_channel )
return E_OUTOFMEMORY;
*channel = SysAllocStringByteLen(psz_channel, strlen(psz_channel));
free( psz_channel );
psz_channel = NULL;
return NOERROR;
}
if( psz_channel ) free( psz_channel );
_p_instance->setErrorInfo(IID_IVLCAudio,
libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
return hr;
};
STDMETHODIMP VLCAudio::put_channel(BSTR channel)
{
if( NULL == channel )
return E_POINTER;
if( 0 == SysStringLen(channel) )
return E_INVALIDARG;
libvlc_instance_t* p_libvlc;
HRESULT hr = _p_instance->getVLC(&p_libvlc);
if( SUCCEEDED(hr) )
{
char *psz_channel = NULL;
libvlc_exception_t ex;
libvlc_exception_init(&ex);
psz_channel = CStrFromBSTR(CP_UTF8, channel);
if( NULL == psz_channel )
return E_OUTOFMEMORY;
libvlc_audio_set_channel(p_libvlc, psz_channel, &ex);
CoTaskMemFree(psz_channel);
if( libvlc_exception_raised(&ex) )
{
_p_instance->setErrorInfo(IID_IVLCAudio,
libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return E_FAIL;
}
return NOERROR;
}
return hr;
};
STDMETHODIMP VLCAudio::toggleMute()
{
libvlc_instance_t* p_libvlc;
......@@ -2261,7 +2375,7 @@ STDMETHODIMP VLCControl2::get_Visible(VARIANT_BOOL *isVisible)
return NOERROR;
};
STDMETHODIMP VLCControl2::put_Visible(VARIANT_BOOL isVisible)
{
_p_instance->setVisible(isVisible != VARIANT_FALSE);
......@@ -2277,7 +2391,7 @@ STDMETHODIMP VLCControl2::get_Volume(long *volume)
*volume = _p_instance->getVolume();
return NOERROR;
};
STDMETHODIMP VLCControl2::put_Volume(long volume)
{
_p_instance->setVolume(volume);
......
......@@ -4,6 +4,7 @@
* Copyright (C) 2006 the VideoLAN team
*
* Authors: Damien Fouilleul <Damien.Fouilleul@laposte.net>
* Jean-Paul Saman <jpsaman _at_ m2x _dot_ nl>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -65,8 +66,12 @@ public:
STDMETHODIMP put_mute(VARIANT_BOOL);
STDMETHODIMP get_volume(long*);
STDMETHODIMP put_volume(long);
STDMETHODIMP get_track(long*);
STDMETHODIMP put_track(long);
STDMETHODIMP get_channel(BSTR*);
STDMETHODIMP put_channel(BSTR);
STDMETHODIMP toggleMute();
protected:
HRESULT loadTypeInfo();
......@@ -75,7 +80,7 @@ private:
ITypeInfo* _p_typeinfo;
};
class VLCInput : public IVLCInput
{
public:
......@@ -130,7 +135,7 @@ private:
ITypeInfo* _p_typeinfo;
};
class VLCMessage: public IVLCMessage
{
public:
......@@ -184,7 +189,7 @@ public:
STDMETHODIMP get_name(BSTR *);
STDMETHODIMP get_header(BSTR *);
STDMETHODIMP get_message(BSTR *);
protected:
HRESULT loadTypeInfo();
......@@ -195,7 +200,7 @@ private:
struct libvlc_log_message_t _msg;
};
class VLCLog;
class VLCMessageIterator : public IVLCMessageIterator
......@@ -255,7 +260,7 @@ private:
VLCLog* _p_vlclog;
libvlc_log_iterator_t* _p_iter;
};
class VLCMessages : public IVLCMessages
{
public:
......@@ -297,7 +302,7 @@ public:
STDMETHODIMP clear();
STDMETHODIMP get_count(long*);
STDMETHODIMP iterator(IVLCMessageIterator**);
protected:
HRESULT loadTypeInfo();
......@@ -355,7 +360,7 @@ public:
STDMETHODIMP get_messages(IVLCMessages**);
STDMETHODIMP get_verbosity(long *);
STDMETHODIMP put_verbosity(long);
protected:
HRESULT loadTypeInfo();
......@@ -367,7 +372,7 @@ private:
VLCMessages* _p_vlcmessages;
};
class VLCPlaylistItems : public IVLCPlaylistItems
{
public:
......@@ -405,7 +410,7 @@ public:
STDMETHODIMP get_count(long*);
STDMETHODIMP clear();
STDMETHODIMP remove(long);
protected:
HRESULT loadTypeInfo();
......@@ -414,7 +419,7 @@ private:
ITypeInfo* _p_typeinfo;
};
class VLCPlaylist : public IVLCPlaylist
{
public:
......@@ -466,7 +471,7 @@ public:
STDMETHODIMP clear();
STDMETHODIMP removeItem(long);
STDMETHODIMP get_items(IVLCPlaylistItems**);
protected:
HRESULT loadTypeInfo();
......@@ -476,7 +481,7 @@ private:
VLCPlaylistItems* _p_vlcplaylistitems;
};
class VLCVideo : public IVLCVideo
{
public:
......@@ -518,7 +523,7 @@ public:
STDMETHODIMP get_aspectRatio(BSTR*);
STDMETHODIMP put_aspectRatio(BSTR);
STDMETHODIMP toggleFullscreen();
protected:
HRESULT loadTypeInfo();
......@@ -527,10 +532,9 @@ private:
ITypeInfo* _p_typeinfo;
};
class VLCControl2 : public IVLCControl2
{
public:
VLCControl2(VLCPlugin *p_instance);
......@@ -597,6 +601,5 @@ private:
VLCPlaylist* _p_vlcplaylist;
VLCVideo* _p_vlcvideo;
};
#endif
#endif
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