Пример #1
0
STDMETHODIMP VLCAudio::toggleMute()
{
    libvlc_media_player_t *p_md;
    HRESULT hr = getMD(&p_md);
    if( SUCCEEDED(hr) )
        libvlc_audio_toggle_mute(p_md);
    return hr;
};
Пример #2
0
void media_mute_unmute()
{
	if(mediaplay != NULL)
	{
		libvlc_audio_toggle_mute(mediaplay);
	}
	else ;
}
Пример #3
0
bool VlcAudio::toggleMute() const
{
    if (_vlcMediaPlayer) {
        libvlc_audio_toggle_mute(_vlcMediaPlayer);
        VlcError::showErrmsg();
    }

    return getMute();
}
Пример #4
0
void VlcPluginBase::control_handler(vlc_toolbar_clicked_t clicked)
{
    switch( clicked )
    {
        case clicked_Play:
        {
            playlist_play();
        }
        break;

        case clicked_Pause:
        {
            playlist_pause();
        }
        break;

        case clicked_Stop:
        {
            playlist_stop();
        }
        break;

        case clicked_Fullscreen:
        {
            toggle_fullscreen();
        }
        break;

        case clicked_Mute:
        case clicked_Unmute:
#if 0
        {
            if( p_md )
                libvlc_audio_toggle_mute( p_md );
        }
#endif
        break;

        case clicked_timeline:
#if 0
        {
            /* if a movie is loaded */
            if( p_md )
            {
                int64_t f_length;
                f_length = libvlc_media_player_get_length( p_md ) / 100;

                f_length = (float)f_length *
                        ( ((float)i_xPos-4.0 ) / ( ((float)i_width-8.0)/100) );

                libvlc_media_player_set_time( p_md, f_length );
            }
        }
#endif
        break;

        case clicked_Time:
        {
            /* Not implemented yet*/
        }
        break;

        default: /* button_Unknown */
            fprintf(stderr, "button Unknown!\n");
        break;
    }
}
Пример #5
0
RuntimeNPObject::InvokeResult
LibvlcAudioNPObject::invoke(int index, const NPVariant *args,
                            uint32_t argCount, 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_togglemute:
                if( argCount == 0 )
                {
                    libvlc_audio_toggle_mute(p_plugin->getVLC(), &ex);
                    RETURN_ON_EXCEPTION(this,ex);
                    VOID_TO_NPVARIANT(result);
                    return INVOKERESULT_NO_ERROR;
                }
                return INVOKERESULT_NO_SUCH_METHOD;
            case ID_audio_description:
            {
                if( argCount == 1)
                {
                    char *psz_name;
                    int i_trackID, i_limit, i;
                    libvlc_track_description_t *p_trackDesc;

                    libvlc_media_player_t *p_md = p_plugin->getMD(&ex);
                    RETURN_ON_EXCEPTION(this,ex);

                    /* get tracks description */
                    p_trackDesc = libvlc_audio_get_track_description(p_md, &ex);
                    RETURN_ON_EXCEPTION(this,ex);
                    if( !p_trackDesc )
                        return INVOKERESULT_GENERIC_ERROR;

                    /* get the number of track available */
                    i_limit = libvlc_audio_get_track_count(p_md, &ex);
                    RETURN_ON_EXCEPTION(this,ex);

                    /* check if a number is given by the user
                     * and get the track number */
                    if( isNumberValue(args[0]) )
                        i_trackID = numberValue(args[0]);
                    else
                        return INVOKERESULT_INVALID_VALUE;

                    /* if bad number is given return invalid value */
                    if ( ( i_trackID > ( i_limit - 1 ) ) || ( i_trackID < 0 ) )
                        return INVOKERESULT_INVALID_VALUE;

                    /* get the good trackDesc */
                    for( i = 0 ; i < i_trackID ; i++ )
                    {
                        p_trackDesc = p_trackDesc->p_next;
                    }
                    psz_name = p_trackDesc->psz_name;

                    /* display the name of the track chosen */
                    return invokeResultString( psz_name, result );
                }
                return INVOKERESULT_NO_SUCH_METHOD;
            }
            default:
                ;
        }
    }
    return INVOKERESULT_GENERIC_ERROR;
}