Ejemplo n.º 1
0
/*****************************************************************************
 * SendEvents: forward mouse and keyboard events to the parent p_vout
 *****************************************************************************/
static int SendEvents( vlc_object_t *p_this, char const *psz_var,
                       vlc_value_t oldval, vlc_value_t newval, void *_p_vout )
{
    vout_thread_t *p_vout = (vout_thread_t *)_p_vout;
    vlc_value_t sentval = newval;

    /* Translate the mouse coordinates */
    if( !strcmp( psz_var, "mouse-x" ) )
    {
        switch( p_vout->p_sys->i_mode )
        {
        case TRANSFORM_MODE_270:
            sentval.i_int = p_vout->p_sys->p_vout->output.i_width
                             - sentval.i_int;
        case TRANSFORM_MODE_90:
            var_Set( p_vout, "mouse-y", sentval );
            return VLC_SUCCESS;

        case TRANSFORM_MODE_180:
        case TRANSFORM_MODE_HFLIP:
            sentval.i_int = p_vout->p_sys->p_vout->output.i_width
                             - sentval.i_int;
            break;

        case TRANSFORM_MODE_VFLIP:
        default:
            break;
        }
    }
    else if( !strcmp( psz_var, "mouse-y" ) )
    {
        switch( p_vout->p_sys->i_mode )
        {
        case TRANSFORM_MODE_90:
            sentval.i_int = p_vout->p_sys->p_vout->output.i_height
                             - sentval.i_int;
        case TRANSFORM_MODE_270:
            var_Set( p_vout, "mouse-x", sentval );
            return VLC_SUCCESS;

        case TRANSFORM_MODE_180:
        case TRANSFORM_MODE_VFLIP:
            sentval.i_int = p_vout->p_sys->p_vout->output.i_height
                             - sentval.i_int;
            break;

        case TRANSFORM_MODE_HFLIP:
        default:
            break;
        }
    }

    var_Set( p_vout, psz_var, sentval );

    return VLC_SUCCESS;
}
Ejemplo n.º 2
0
void libvlc_video_set_spu( libvlc_media_player_t *p_mi, int i_spu,
                           libvlc_exception_t *p_e )
{
    input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
    vlc_value_t val_list;
    vlc_value_t newval;
    int i_ret = -1;

    if( !p_input_thread ) return;

    var_Change( p_input_thread, "spu-es", VLC_VAR_GETCHOICES, &val_list, NULL );
    if( (i_spu < 0) && (i_spu > val_list.p_list->i_count) )
    {
        libvlc_exception_raise( p_e, "Subtitle value out of range" );
        vlc_object_release( p_input_thread );
        return;
    }

    newval = val_list.p_list->p_values[i_spu];
    i_ret = var_Set( p_input_thread, "spu-es", newval );
    if( i_ret < 0 )
    {
        libvlc_exception_raise( p_e, "Setting subtitle value failed" );
    }
    vlc_object_release( p_input_thread );
}
Ejemplo n.º 3
0
/*****************************************************************************
 * aout_VolumeDown : lower the output volume
 *****************************************************************************
 * If pi_volume != NULL, *pi_volume will contain the volume at the end of the
 * function.
 *****************************************************************************/
int __aout_VolumeDown( vlc_object_t * p_object, int i_nb_steps,
                       audio_volume_t * pi_volume )
{
    vlc_value_t val;
    aout_instance_t * p_aout = vlc_object_find( p_object, VLC_OBJECT_AOUT,
                               FIND_ANYWHERE );
    int i_result = 0, i_volume = 0, i_volume_step = 0;

    i_volume_step = config_GetInt( p_object->p_libvlc, "volume-step" );
    i_volume = config_GetInt( p_object, "volume" );
    i_volume -= i_volume_step * i_nb_steps;
    if ( i_volume < AOUT_VOLUME_MIN )
    {
        i_volume = AOUT_VOLUME_MIN;
    }
    config_PutInt( p_object, "volume", i_volume );
    var_Create( p_object->p_libvlc, "saved-volume", VLC_VAR_INTEGER );
    var_SetInteger( p_object->p_libvlc, "saved-volume", (audio_volume_t) i_volume );
    if ( pi_volume != NULL ) *pi_volume = (audio_volume_t) i_volume;

    val.b_bool = true;
    var_Set( p_object->p_libvlc, "volume-change", val );

    if ( p_aout == NULL ) return 0;

    aout_lock_mixer( p_aout );
    if ( !p_aout->mixer.b_error )
    {
        i_result = p_aout->output.pf_volume_set( p_aout, (audio_volume_t) i_volume );
    }
    aout_unlock_mixer( p_aout );

    vlc_object_release( p_aout );
    return i_result;
}
Ejemplo n.º 4
0
/*****************************************************************************
 * aout_New: initialize aout structure
 *****************************************************************************/
aout_instance_t * __aout_New( vlc_object_t * p_parent )
{
    aout_instance_t * p_aout;
    vlc_value_t val;

    /* Allocate descriptor. */
    p_aout = vlc_object_create( p_parent, VLC_OBJECT_AOUT );
    if( p_aout == NULL )
    {
        return NULL;
    }

    /* Initialize members. */
    vlc_mutex_init( p_parent, &p_aout->input_fifos_lock );
    vlc_mutex_init( p_parent, &p_aout->mixer_lock );
    vlc_mutex_init( p_parent, &p_aout->output_fifo_lock );
    p_aout->i_nb_inputs = 0;
    p_aout->mixer.f_multiplier = 1.0;
    p_aout->mixer.b_error = 1;
    p_aout->output.b_error = 1;
    p_aout->output.b_starving = 1;

    var_Create( p_aout, "intf-change", VLC_VAR_BOOL );
    val.b_bool = VLC_TRUE;
    var_Set( p_aout, "intf-change", val );

    return p_aout;
}
Ejemplo n.º 5
0
/*****************************************************************************
 * VLCVIew::MouseUp
 *****************************************************************************/
void
VLCView::MouseUp( BPoint where )
{
    vlc_value_t val;
    val.b_bool = VLC_TRUE;
    var_Set( p_vout, "mouse-clicked", val );
}
Ejemplo n.º 6
0
/**
 * Enables a playlist group
 *
 * \param p_playlist the playlist to enable from.
 * \param i_group the id of the group to enable
 * \return returns 0
 */
int playlist_EnableGroup( playlist_t * p_playlist, int i_group )
{
    vlc_value_t val;
    int i;
    vlc_mutex_lock( &p_playlist->object_lock );

    for( i = 0; i< p_playlist->i_size; i++ )
    {
        if( p_playlist->pp_items[i]->i_group == i_group )
        {
            msg_Dbg( p_playlist, "enabling playlist item `%s'",
                     p_playlist->pp_items[i]->input.psz_name );

            if( p_playlist->pp_items[i]->b_enabled == VLC_FALSE )
                p_playlist->i_enabled++;

            p_playlist->pp_items[i]->b_enabled = VLC_TRUE;
            val.b_bool = i;
            var_Set( p_playlist, "item-change", val );
        }
    }
    vlc_mutex_unlock( &p_playlist->object_lock );

    return 0;
}
Ejemplo n.º 7
0
/*****************************************************************************
 * libvlc_audio_set_track : Set the current audio track
 *****************************************************************************/
void libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track,
                             libvlc_exception_t *p_e )
{
    input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
    vlc_value_t val_list;
    vlc_value_t newval;
    int i_ret = -1;

    if( !p_input_thread )
        return;

    var_Change( p_input_thread, "audio-es", VLC_VAR_GETCHOICES, &val_list, NULL );
    if( (i_track < 0) || (i_track > val_list.p_list->i_count) )
    {
        libvlc_exception_raise( p_e );
        libvlc_printerr( "Audio track out of range" );
        goto end;
    }

    newval = val_list.p_list->p_values[i_track];
    i_ret = var_Set( p_input_thread, "audio-es", newval );
    if( i_ret < 0 )
    {
        libvlc_exception_raise( p_e );
        libvlc_printerr( "Audio track out of range" ); /* Race... */
    }

end:
    var_FreeList( &val_list, NULL );
    vlc_object_release( p_input_thread );
}
Ejemplo n.º 8
0
/*****************************************************************************
 * SendEventsToChild: forward events to the child/children vout
 *****************************************************************************/
static int SendEventsToChild( vlc_object_t *p_this, char const *psz_var,
                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
    vout_thread_t *p_vout = (vout_thread_t *)p_this;
    var_Set( p_vout->p_sys->p_vout, psz_var, newval );
    return VLC_SUCCESS;
}
Ejemplo n.º 9
0
void PrefsPanel::ApplyChanges()
{
    vlc_value_t val;

    for( size_t i = 0; i < config_array.size(); i++ )
    {
        ConfigControl *control = config_array[i];

        switch( control->GetType() )
        {
        case CONFIG_ITEM_STRING:
        case CONFIG_ITEM_FILE:
        case CONFIG_ITEM_DIRECTORY:
        case CONFIG_ITEM_MODULE:
            config_PutPsz( p_intf, control->GetName(),
                           control->GetPszValue() );
            break;
        case CONFIG_ITEM_KEY:
            /* So you don't need to restart to have the changes take effect */
            val.i_int = control->GetIntValue();
            var_Set( p_intf->p_vlc, control->GetName(), val );
        case CONFIG_ITEM_INTEGER:
        case CONFIG_ITEM_BOOL:
            config_PutInt( p_intf, control->GetName(),
                           control->GetIntValue() );
            break;
        case CONFIG_ITEM_FLOAT:
            config_PutFloat( p_intf, control->GetName(),
                             control->GetFloatValue() );
            break;
        }
    }
}
Ejemplo n.º 10
0
void VoutWindow::processEvent( EvtKey &rEvtKey )
{
    // Only do the action when the key is down
    if( rEvtKey.getAsString().find( "key:down") != string::npos )
    {
        vlc_value_t val;
        // Set the key
        val.i_int = rEvtKey.getKey();
        // Set the modifiers
        if( rEvtKey.getMod() & EvtInput::kModAlt )
        {
            val.i_int |= KEY_MODIFIER_ALT;
        }
        if( rEvtKey.getMod() & EvtInput::kModCtrl )
        {
            val.i_int |= KEY_MODIFIER_CTRL;
        }
        if( rEvtKey.getMod() & EvtInput::kModShift )
        {
            val.i_int |= KEY_MODIFIER_SHIFT;
        }

        var_Set( getIntf()->p_libvlc, "key-pressed", val );
    }
}
Ejemplo n.º 11
0
static int EqualizerCallback( vlc_object_t *p_this, char const *psz_cmd,
                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
    aout_instance_t *p_aout = (aout_instance_t *)p_this;
    char *psz_mode = newval.psz_string;
    vlc_value_t val;
    int i;
    int i_ret;

    if( !psz_mode || !*psz_mode )
    {
        i_ret = ChangeFiltersString( p_aout, "audio-filter", "equalizer",
                                     VLC_FALSE );
    }
    else
    {
        val.psz_string = psz_mode;
        var_Create( p_aout, "equalizer-preset", VLC_VAR_STRING );
        var_Set( p_aout, "equalizer-preset", val );
        i_ret = ChangeFiltersString( p_aout, "audio-filter", "equalizer",
                                     VLC_TRUE );

    }

    /* That sucks */
    if( i_ret == 1 )
    {
        for( i = 0; i < p_aout->i_nb_inputs; i++ )
        {
            p_aout->pp_inputs[i]->b_restart = VLC_TRUE;
        }
    }

    return VLC_SUCCESS;
}
Ejemplo n.º 12
0
/**
 * Move an item in a playlist
 *
 * This function must be entered without the playlist lock
 *
 * Move the item in the playlist with position i_pos before the current item
 * at position i_newpos.
 * \param p_playlist the playlist to move items in
 * \param i_pos the position of the item to move
 * \param i_newpos the position of the item that will be behind the moved item
 *        after the move
 * \return returns VLC_SUCCESS
 */
int playlist_Move( playlist_t * p_playlist, int i_pos, int i_newpos )
{
    vlc_value_t val;
    vlc_mutex_lock( &p_playlist->object_lock );

    /* take into account that our own row disappears. */
    if( i_pos < i_newpos ) i_newpos--;

    if( i_pos >= 0 && i_newpos >=0 && i_pos <= p_playlist->i_size &&
        i_newpos <= p_playlist->i_size )
    {
        playlist_item_t * temp;

        msg_Dbg( p_playlist, "moving playlist item `%s' (%i -> %i)",
                 p_playlist->pp_items[i_pos]->input.psz_name, i_pos, i_newpos);

        if( i_pos == p_playlist->i_index )
        {
            p_playlist->i_index = i_newpos;
        }
        else if( i_pos > p_playlist->i_index &&
                 i_newpos <= p_playlist->i_index )
        {
            p_playlist->i_index++;
        }
        else if( i_pos < p_playlist->i_index &&
                 i_newpos >= p_playlist->i_index )
        {
            p_playlist->i_index--;
        }

        if ( i_pos < i_newpos )
        {
            temp = p_playlist->pp_items[i_pos];
            while ( i_pos < i_newpos )
            {
                p_playlist->pp_items[i_pos] = p_playlist->pp_items[i_pos+1];
                i_pos++;
            }
            p_playlist->pp_items[i_newpos] = temp;
        }
        else if ( i_pos > i_newpos )
        {
            temp = p_playlist->pp_items[i_pos];
            while ( i_pos > i_newpos )
            {
                p_playlist->pp_items[i_pos] = p_playlist->pp_items[i_pos-1];
                i_pos--;
            }
            p_playlist->pp_items[i_newpos] = temp;
        }
    }

    vlc_mutex_unlock( &p_playlist->object_lock );

    val.b_bool = VLC_TRUE;
    var_Set( p_playlist, "intf-change", val );

    return VLC_SUCCESS;
}
Ejemplo n.º 13
0
static void
Close( vlc_object_t *p_this )
{
    /*tls_t *p_tls = (tls_t *)p_this;
    tls_sys_t *p_sys = (tls_sys_t *)(p_this->p_sys);*/

    vlc_value_t lock, count;

    var_Create( p_this->p_libvlc, "gnutls_mutex", VLC_VAR_MUTEX );
    var_Get( p_this->p_libvlc, "gnutls_mutex", &lock );
    vlc_mutex_lock( lock.p_address );

    var_Create( p_this->p_libvlc, "gnutls_count", VLC_VAR_INTEGER );
    var_Get( p_this->p_libvlc, "gnutls_count", &count);
    count.i_int--;
    var_Set( p_this->p_libvlc, "gnutls_count", count);

    if( count.i_int == 0 )
    {
        gnutls_global_deinit( );
        msg_Dbg( p_this, "GNUTLS deinitialized" );
    }

    vlc_mutex_unlock( lock.p_address);
}
Ejemplo n.º 14
0
/*****************************************************************************
 * SendEvents: forward mouse and keyboard events to the parent p_vout
 *****************************************************************************/
static int SendEvents( vlc_object_t *p_this, char const *psz_var,
                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
    var_Set( (vlc_object_t *)p_data, psz_var, newval );

    return VLC_SUCCESS;
}
Ejemplo n.º 15
0
/*****************************************************************************
 * PlayItem: play current playlist item
 *****************************************************************************
 * This function calculates the position of the next playlist item, depending
 * on the playlist course mode (forward, backward, random...).
 *****************************************************************************/
static void PlayItem( playlist_t *p_playlist )
{
    playlist_item_t *p_item;
    vlc_value_t val;
    if( p_playlist->i_index == -1 )
    {
        if( p_playlist->i_size == 0 || p_playlist->i_enabled == 0)
        {
            return;
        }
        SkipItem( p_playlist, 1 );
    }
    if( p_playlist->i_enabled == 0)
    {
        return;
    }

    msg_Dbg( p_playlist, "creating new input thread" );
    p_item = p_playlist->pp_items[p_playlist->i_index];

    p_item->i_nb_played++;
    p_playlist->p_input = input_CreateThread( p_playlist, &p_item->input );

    val.i_int = p_playlist->i_index;
    /* unlock the playlist to set the var...mmm */
    vlc_mutex_unlock( &p_playlist->object_lock);
    var_Set( p_playlist, "playlist-current", val);
    vlc_mutex_lock( &p_playlist->object_lock);
}
Ejemplo n.º 16
0
/*****************************************************************************
 * CloseEncoder: x264 encoder destruction
 *****************************************************************************/
static void Close( vlc_object_t *p_this )
{
    encoder_t     *p_enc = (encoder_t *)p_this;
    encoder_sys_t *p_sys = p_enc->p_sys;

    free( p_sys->psz_stat_name );

    if( p_sys->h )
        x264_encoder_close( p_sys->h );

#ifdef PTW32_STATIC_LIB
    vlc_value_t lock, count;

    var_Get( p_enc->p_libvlc, "pthread_win32_mutex", &lock );
    vlc_mutex_lock( lock.p_address );

    var_Get( p_enc->p_libvlc, "pthread_win32_count", &count );
    count.i_int--;
    var_Set( p_enc->p_libvlc, "pthread_win32_count", count );

    if( count.i_int == 0 )
    {
        pthread_win32_thread_detach_np();
        pthread_win32_process_detach_np();
        msg_Dbg( p_enc, "pthread-win32 deinitialized" );
    }
    vlc_mutex_unlock( lock.p_address );
#endif

    free( p_sys->p_buffer );
    free( p_sys );
}
Ejemplo n.º 17
0
static int vlclua_var_create( lua_State *L )
{
    int i_type, i_ret;
    vlc_object_t **pp_obj = luaL_checkudata( L, 1, "vlc_object" );
    const char *psz_var = luaL_checkstring( L, 2 );

    switch( lua_type( L, 3 ) )
    {
        case LUA_TNUMBER:
            i_type = VLC_VAR_FLOAT;
            break;
        case LUA_TBOOLEAN:
            i_type = VLC_VAR_BOOL;
            break;
        case LUA_TSTRING:
            i_type = VLC_VAR_STRING;
            break;
        case LUA_TNIL:
            i_type = VLC_VAR_VOID;
            break;
        default:
            return 0;
    }

    if( ( i_ret = var_Create( *pp_obj, psz_var, i_type ) ) != VLC_SUCCESS )
        return vlclua_push_ret( L, i_ret );

    // Special case for void variables
    if( i_type == VLC_VAR_VOID )
        return 0;

    vlc_value_t val;
    vlclua_tovalue( L, i_type, &val );
    return vlclua_push_ret( L, var_Set( *pp_obj, psz_var, val ) );
}
Ejemplo n.º 18
0
static int TriggerFilterCallback(vlc_object_t *p_this, char const *psz_var,
                                 vlc_value_t oldval, vlc_value_t newval,
                                 void *p_data)
{
    (void) p_this; (void) oldval;
    var_Set((filter_t *)p_data, psz_var, newval);
    return 0;
}
Ejemplo n.º 19
0
Archivo: menus.cpp Proyecto: Kafay/vlc
void QVLCMenu::DoAction( QObject *data )
{
    MenuItemData *itemData = qobject_cast<MenuItemData *>( data );
    vlc_object_t *p_object = itemData->p_obj;
    if( p_object == NULL ) return;

    var_Set( p_object, itemData->psz_var, itemData->val );
}
Ejemplo n.º 20
0
static int FullscreenCallback( vlc_object_t *p_this, char const *psz_cmd,
                       vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
    vout_thread_t *p_vout = (vout_thread_t *)p_this;
    vlc_value_t val;
    (void)psz_cmd; (void)oldval; (void)p_data;

    p_vout->i_changes |= VOUT_FULLSCREEN_CHANGE;

    /* Modify libvlc as well because the vout might have to be restarted */
    var_Create( p_vout->p_libvlc, "fullscreen", VLC_VAR_BOOL );
    var_Set( p_vout->p_libvlc, "fullscreen", newval );

    val.b_bool = true;
    var_Set( p_vout, "intf-change", val );
    return VLC_SUCCESS;
}
Ejemplo n.º 21
0
Archivo: output.c Proyecto: Annovae/vlc
static int var_Copy (vlc_object_t *src, const char *name, vlc_value_t prev,
                     vlc_value_t value, void *data)
{
    vlc_object_t *dst = data;

    (void) src; (void) prev;
    return var_Set (dst, name, value);
}
Ejemplo n.º 22
0
static void menu_callback(GtkMenuItem *menuitem, gpointer user_data)
{
    VlcMenuItem *item = (VlcMenuItem *)menuitem;
    vlc_object_t *p_object = item->p_obj;
    (void)user_data;
    if( p_object == NULL ) return;
    var_Set( p_object, item->psz_var, item->val );
}
Ejemplo n.º 23
0
static int Forward(vlc_object_t *object, char const *var,
                   vlc_value_t oldval, vlc_value_t newval, void *data)
{
    vout_thread_t *vout = (vout_thread_t*)object;

    VLC_UNUSED(oldval);
    VLC_UNUSED(data);
    return var_Set(vout->p->display.vd, var, newval);
}
Ejemplo n.º 24
0
/*****************************************************************************
 * Foo: put anything here
 *****************************************************************************/
static int Foo( vlc_object_t *p_this, char const *psz_cmd,
                vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
    vlc_value_t val;
    int i;

    var_Create( p_this, "honk", VLC_VAR_STRING | VLC_VAR_HASCHOICE );

    val.psz_string = "foo";
    var_Change( p_this, "honk", VLC_VAR_ADDCHOICE, &val, NULL );
    val.psz_string = "bar";
    var_Change( p_this, "honk", VLC_VAR_ADDCHOICE, &val, NULL );
    val.psz_string = "baz";
    var_Change( p_this, "honk", VLC_VAR_ADDCHOICE, &val, NULL );
    var_Change( p_this, "honk", VLC_VAR_SETDEFAULT, &val, NULL );

    var_Get( p_this, "honk", &val ); printf( "value: %s\n", val.psz_string );

    val.psz_string = "foo";
    var_Set( p_this, "honk", val );

    var_Get( p_this, "honk", &val ); printf( "value: %s\n", val.psz_string );

    val.psz_string = "blork";
    var_Set( p_this, "honk", val );

    var_Get( p_this, "honk", &val ); printf( "value: %s\n", val.psz_string );

    val.psz_string = "baz";
    var_Change( p_this, "honk", VLC_VAR_DELCHOICE, &val, NULL );

    var_Get( p_this, "honk", &val ); printf( "value: %s\n", val.psz_string );

    var_Change( p_this, "honk", VLC_VAR_GETLIST, &val, NULL );
    for( i = 0 ; i < val.p_list->i_count ; i++ )
    {
        printf( "value %i: %s\n", i, val.p_list->p_values[i].psz_string );
    }
    var_Change( p_this, "honk", VLC_VAR_FREELIST, &val, NULL );

    var_Destroy( p_this, "honk" );

    return VLC_SUCCESS;
}
Ejemplo n.º 25
0
void TopWindow::processEvent( EvtKey &rEvtKey )
{
    // Forward the event to the focused control, if any
    if( m_pFocusControl )
    {
        m_pFocusControl->handleEvent( rEvtKey );
        return;
    }

    // Only do the action when the key is down
    if( rEvtKey.getAsString().find( "key:down") != string::npos )
    {
        //XXX not to be hardcoded!
        // Ctrl-S = Change skin
        if( (rEvtKey.getMod() & EvtInput::kModCtrl) &&
            rEvtKey.getKey() == 's' )
        {
            CmdDlgChangeSkin cmd( getIntf() );
            cmd.execute();
            return;
        }

        //XXX not to be hardcoded!
        // Ctrl-T = Toggle on top
        if( (rEvtKey.getMod() & EvtInput::kModCtrl) &&
            rEvtKey.getKey() == 't' )
        {
            CmdOnTop cmd( getIntf() );
            cmd.execute();
            return;
        }

        vlc_value_t val;
        // Set the key
        val.i_int = rEvtKey.getKey();
        // Set the modifiers
        if( rEvtKey.getMod() & EvtInput::kModAlt )
        {
            val.i_int |= KEY_MODIFIER_ALT;
        }
        if( rEvtKey.getMod() & EvtInput::kModCtrl )
        {
            val.i_int |= KEY_MODIFIER_CTRL;
        }
        if( rEvtKey.getMod() & EvtInput::kModShift )
        {
            val.i_int |= KEY_MODIFIER_SHIFT;
        }

        var_Set( getIntf()->p_vlc, "key-pressed", val );
    }

    // Always store the modifier, which can be needed for scroll events
    m_currModifier = rEvtKey.getMod();
}
Ejemplo n.º 26
0
static int OnTopCallback( vlc_object_t *p_this, char const *psz_cmd,
                         vlc_value_t oldval, vlc_value_t newval, void *p_data )
{
    vout_thread_t *p_vout = (vout_thread_t *)p_this;
    vout_Control( p_vout, VOUT_SET_STAY_ON_TOP, newval.b_bool );
    (void)psz_cmd; (void)oldval; (void)p_data;

    /* Modify libvlc as well because the vout might have to be restarted */
    var_Create( p_vout->p_libvlc, "video-on-top", VLC_VAR_BOOL );
    var_Set( p_vout->p_libvlc, "video-on-top", newval );

    return VLC_SUCCESS;
}
Ejemplo n.º 27
0
Archivo: variables.c Proyecto: paa/vlc
static int vlclua_var_set( lua_State *L )
{
    int i_type;
    vlc_value_t val;
    vlc_object_t **pp_obj = luaL_checkudata( L, 1, "vlc_object" );
    const char *psz_var = luaL_checkstring( L, 2 );
    int i_ret;
    i_type = var_Type( *pp_obj, psz_var );
    vlclua_tovalue( L, i_type, &val );
    i_ret = var_Set( *pp_obj, psz_var, val );
    lua_pop( L, 3 );
    return vlclua_push_ret( L, i_ret );
}
Ejemplo n.º 28
0
//---------------------------------------------------------------------------
// DemuxOpen: initialize demux
//---------------------------------------------------------------------------
static int DemuxOpen( vlc_object_t *p_this )
{
    demux_t *p_demux = (demux_t*)p_this;
    intf_thread_t *p_intf;
    char *ext;

    // Needed callbacks
    p_demux->pf_demux   = Demux;
    p_demux->pf_control = DemuxControl;

    // Test that we have a valid .vlt file, based on the extension
    // TODO: an actual check of the contents would be better...
    if( ( ext = strchr( p_demux->psz_path, '.' ) ) == NULL ||
        strcasecmp( ext, ".vlt" ) )
    {
        return VLC_EGENERIC;
    }

    p_intf = (intf_thread_t *)vlc_object_find( p_this, VLC_OBJECT_INTF,
                                               FIND_ANYWHERE );
    if( p_intf != NULL )
    {
        // Do nothing is skins2 is not the main interface
        if( var_Type( p_intf, "skin-to-load" ) == VLC_VAR_STRING )
        {
            playlist_t *p_playlist =
                (playlist_t *) vlc_object_find( p_this, VLC_OBJECT_PLAYLIST,
                                                FIND_ANYWHERE );
            if( p_playlist != NULL )
            {
                // Make sure the item is deleted afterwards
                p_playlist->pp_items[p_playlist->i_index]->b_autodeletion =
                    VLC_TRUE;
                vlc_object_release( p_playlist );
            }

            vlc_value_t val;
            val.psz_string = p_demux->psz_path;
            var_Set( p_intf, "skin-to-load", val );
        }
        else
        {
            msg_Warn( p_this,
                      "skin could not be loaded (not using skins2 intf)" );
        }

        vlc_object_release( p_intf );
    }

    return VLC_SUCCESS;
}
Ejemplo n.º 29
0
/*****************************************************************************
 * OpenDecoder: probe the decoder and return score
 *****************************************************************************
 * Tries to launch a decoder and return score so that the interface is able
 * to chose.
 *****************************************************************************/
static int OpenDecoder( vlc_object_t *p_this )
{
    decoder_t *p_dec = (decoder_t*)p_this;
    input_thread_t * p_input;
    decoder_sys_t *p_sys;
    vlc_value_t val;

    if( p_dec->fmt_in.i_codec != VLC_FOURCC('c','m','m','l') )
    {
        return VLC_EGENERIC;
    }

    p_dec->pf_decode_sub = DecodeBlock;

#ifdef CMML_DEBUG
    msg_Dbg( p_dec, "i am at %p", p_dec );
#endif

    /* Allocate the memory needed to store the decoder's structure */
    if( ( p_dec->p_sys = p_sys =
          (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
    {
        msg_Err( p_dec, "out of memory" );
        return VLC_EGENERIC;
    }

    /* Let other interested modules know that we're a CMML decoder
     * We have to set this variable on the input thread, because there's
     * typically more than one decoder running so we can't find the CMML
     * decoder succesfully with vlc_object_find.  (Any hints on how to achieve
     * this would be rather appreciated ;) */
    p_input = vlc_object_find( p_dec, VLC_OBJECT_INPUT, FIND_ANYWHERE );
#ifdef CMML_DEBUG
    msg_Dbg( p_dec, "p_input is at %p", p_input );
#endif
    val.p_address = p_dec;
    var_Create( p_input, "has-cmml-decoder",
                VLC_VAR_ADDRESS|VLC_VAR_DOINHERIT );
    if( var_Set( p_input, "has-cmml-decoder", val ) != VLC_SUCCESS )
    {
        msg_Dbg( p_dec, "var_Set of has-cmml-decoder failed" );
    }
    vlc_object_release( p_input );

    /* initialise the CMML responder interface */
    p_sys->p_intf = intf_Create( p_dec, "cmml", 0, NULL );
    p_sys->p_intf->b_block = VLC_FALSE;
    intf_RunThread( p_sys->p_intf );

    return VLC_SUCCESS;
}
Ejemplo n.º 30
0
void CmdFaster::execute()
{
    input_thread_t *pInput =
        (input_thread_t *)vlc_object_find( getIntf(), VLC_OBJECT_INPUT,
                                           FIND_ANYWHERE );
    if( pInput )
    {
        vlc_value_t val;
        val.b_bool = VLC_TRUE;

        var_Set( pInput, "rate-faster", val );
        vlc_object_release( pInput );
    }
}