RuntimeNPObject::InvokeResult LibvlcAudioNPObject::getProperty(int index, NPVariant &result) { /* is plugin still running */ if( isPluginRunning() ) { VlcPlugin* p_plugin = getPrivate<VlcPlugin>(); libvlc_exception_t ex; libvlc_exception_init(&ex); switch( index ) { case ID_audio_mute: { bool muted = libvlc_audio_get_mute(p_plugin->getVLC(), &ex); RETURN_ON_EXCEPTION(this,ex); BOOLEAN_TO_NPVARIANT(muted, result); return INVOKERESULT_NO_ERROR; } case ID_audio_volume: { int volume = libvlc_audio_get_volume(p_plugin->getVLC(), &ex); RETURN_ON_EXCEPTION(this,ex); INT32_TO_NPVARIANT(volume, result); return INVOKERESULT_NO_ERROR; } case ID_audio_track: { libvlc_media_player_t *p_md = p_plugin->getMD(&ex); RETURN_ON_EXCEPTION(this,ex); int track = libvlc_audio_get_track(p_md, &ex); RETURN_ON_EXCEPTION(this,ex); INT32_TO_NPVARIANT(track, result); return INVOKERESULT_NO_ERROR; } case ID_audio_count: { libvlc_media_player_t *p_md = p_plugin->getMD(&ex); RETURN_ON_EXCEPTION(this,ex); // get the number of audio track available int i_track = libvlc_audio_get_track_count(p_md, &ex); RETURN_ON_EXCEPTION(this,ex); // return it INT32_TO_NPVARIANT(i_track, result); return INVOKERESULT_NO_ERROR; } case ID_audio_channel: { int channel = libvlc_audio_get_channel(p_plugin->getVLC(), &ex); RETURN_ON_EXCEPTION(this,ex); INT32_TO_NPVARIANT(channel, result); return INVOKERESULT_NO_ERROR; } default: ; } } return INVOKERESULT_GENERIC_ERROR; }
void libvlc_audio_set_mute( libvlc_instance_t *p_instance, int mute, libvlc_exception_t *p_e ) { if ( mute ^ libvlc_audio_get_mute( p_instance, p_e ) ) { aout_ToggleMute( p_instance->p_libvlc_int, NULL ); } }
bool VlcAudio::getMute() const { bool mute = false; if (_vlcMediaPlayer) { mute = libvlc_audio_get_mute(_vlcMediaPlayer); VlcError::showErrmsg(); } return mute; }
STDMETHODIMP VLCAudio::get_mute(VARIANT_BOOL* mute) { if( NULL == mute ) return E_POINTER; libvlc_media_player_t *p_md; HRESULT hr = getMD(&p_md); if( SUCCEEDED(hr) ) *mute = varbool( libvlc_audio_get_mute(p_md) ); return hr; };
void VlcPlugin::redrawToolbar() { libvlc_exception_t ex; int is_playing = 0; bool b_mute = false; unsigned int dst_x, dst_y; GC gc; XGCValues gcv; unsigned int i_tb_width, i_tb_height; /* This method does nothing if toolbar is hidden. */ if( !b_toolbar ) return; const NPWindow& window = getWindow(); Window control = getControlWindow(); Display *p_display = ((NPSetWindowCallbackStruct *)window.ws_info)->display; getToolbarSize( &i_tb_width, &i_tb_height ); libvlc_exception_init( &ex ); /* get mute info */ b_mute = libvlc_audio_get_mute( getVLC() ); gcv.foreground = BlackPixel( p_display, 0 ); gc = XCreateGC( p_display, control, GCForeground, &gcv ); XFillRectangle( p_display, control, gc, 0, 0, window.width, i_tb_height ); gcv.foreground = WhitePixel( p_display, 0 ); XChangeGC( p_display, gc, GCForeground, &gcv ); /* position icons */ dst_x = BTN_SPACE; dst_y = i_tb_height >> 1; /* baseline = vertical middle */ if( p_btnPause && (is_playing == 1) ) { XPutImage( p_display, control, gc, p_btnPause, 0, 0, dst_x, dst_y - (p_btnPause->height >> 1), p_btnPause->width, p_btnPause->height ); dst_x += BTN_SPACE + p_btnPause->width; }
void libvlc_audio_toggle_mute( libvlc_media_player_t *mp ) { int mute = libvlc_audio_get_mute( mp ); if( mute != -1 ) libvlc_audio_set_mute( mp, !mute ); }
bool VLCWrapperImpl::GetMute() { bool bMuteState=!!libvlc_audio_get_mute(pMediaPlayer_); return bMuteState; }
bool VLCWrapperImpl::GetMute() { bool bMuteState=!!libvlc_audio_get_mute(m_pVLCInstance, &m_VLCex); ProcessVLCException(&m_VLCex, m_EH); return bMuteState; }