Changeset ef8cc37104e6db0cb6d37ab9197758c89b4bb8ae

Show
Ignore:
Timestamp:
18/09/05 12:03:10 (3 years ago)
Author:
Jean-Paul Saman <jpsaman@videolan.org>
git-committer:
Jean-Paul Saman <jpsaman@videolan.org> 1127037790 +0000
git-parent:

[266e4aa0177e922ad0819982d5ed5db9fce62f10]

git-author:
Jean-Paul Saman <jpsaman@videolan.org> 1127037790 +0000
Message:

Forward port of revision 12566: Ignore menu select|right|left|up|down when OSD Menu is not visible

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • include/vlc_osd.h

    ra92603f ref8cc37  
    403403{ 
    404404    vlc_value_t val; 
    405      
     405 
    406406    val.b_bool = p_osd->p_state->b_update = b_value; 
    407407    var_Set( p_osd, "osd-menu-update", val ); 
  • src/osd/osd.c

    r60de5f8 ref8cc37  
    4141static inline osd_state_t *osd_VolumeStateChange( osd_state_t *, int ); 
    4242static int osd_VolumeStep( vlc_object_t *, int, int ); 
     43static vlc_bool_t osd_isVisible( osd_menu_t *p_osd ); 
     44 
     45static vlc_bool_t osd_isVisible( osd_menu_t *p_osd ) 
     46{ 
     47    vlc_value_t val; 
     48 
     49    var_Get( p_osd, "osd-menu-visible", &val ); 
     50    return val.b_bool; 
     51} 
    4352 
    4453/***************************************************************************** 
     
    257266    osd_button_t *p_button = NULL; 
    258267    vlc_value_t lockval; 
    259      
     268 
    260269    if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 
    261270    { 
     
    263272        return; 
    264273    } 
    265      
    266     var_Get( p_this->p_libvlc, "osd_mutex", &lockval ); 
    267     vlc_mutex_lock( lockval.p_address ); 
    268      
     274 
     275    if( osd_isVisible( p_osd ) == VLC_FALSE ) 
     276    { 
     277        vlc_object_release( (vlc_object_t*) p_osd ); 
     278        return; 
     279    } 
     280 
     281    var_Get( p_this->p_libvlc, "osd_mutex", &lockval ); 
     282    vlc_mutex_lock( lockval.p_address ); 
     283 
    269284#if defined(OSD_MENU_DEBUG) 
    270285    msg_Dbg( p_osd, "select" ); 
     
    280295        __osd_MenuUp( p_this );   /* "menu select" means go to menu item above. */ 
    281296        return; 
    282     }     
     297    } 
    283298    if( p_button && p_button->p_down) 
    284     {     
     299    { 
    285300        vlc_object_release( (vlc_object_t*) p_osd ); 
    286301        vlc_mutex_unlock( lockval.p_address ); 
     
    305320    } 
    306321    vlc_object_release( (vlc_object_t*) p_osd ); 
    307     vlc_mutex_unlock( lockval.p_address );             
    308 }            
     322    vlc_mutex_unlock( lockval.p_address ); 
     323} 
    309324 
    310325void __osd_MenuNext( vlc_object_t *p_this ) 
     
    313328    osd_button_t *p_button = NULL; 
    314329    vlc_value_t lockval; 
    315      
     330 
    316331    if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 
    317332    { 
     
    319334        return; 
    320335    } 
    321              
    322     var_Get( p_this->p_libvlc, "osd_mutex", &lockval ); 
    323     vlc_mutex_lock( lockval.p_address ); 
    324      
     336 
     337    if( osd_isVisible( p_osd ) == VLC_FALSE ) 
     338    { 
     339        vlc_object_release( (vlc_object_t*) p_osd ); 
     340        return; 
     341    } 
     342 
     343    var_Get( p_this->p_libvlc, "osd_mutex", &lockval ); 
     344    vlc_mutex_lock( lockval.p_address ); 
     345 
    325346    p_button = p_osd->p_state->p_visible; 
    326347    if( p_button ) 
     
    332353        else 
    333354            p_osd->p_state->p_visible = p_osd->p_button; 
    334              
     355 
    335356        if( !p_osd->p_state->p_visible->b_range )  
    336357            p_osd->p_state->p_visible->p_current_state = 
    337358                osd_StateChange( p_osd->p_state->p_visible->p_states, OSD_BUTTON_SELECT ); 
    338          
     359 
    339360        osd_UpdateState( p_osd->p_state,  
    340361                p_osd->p_state->p_visible->i_x, p_osd->p_state->p_visible->i_y, 
     
    345366    } 
    346367#if defined(OSD_MENU_DEBUG) 
    347     msg_Dbg( p_osd, "direction right [button %s]", p_osd->p_state->p_visible->psz_action );             
    348 #endif 
    349      
     368    msg_Dbg( p_osd, "direction right [button %s]", p_osd->p_state->p_visible->psz_action ); 
     369#endif 
     370 
    350371    vlc_object_release( (vlc_object_t*) p_osd ); 
    351372    vlc_mutex_unlock( lockval.p_address ); 
     
    357378    osd_button_t *p_button = NULL; 
    358379    vlc_value_t lockval; 
    359      
     380 
    360381    if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 
    361382    { 
     
    364385    } 
    365386 
    366     var_Get( p_this->p_libvlc, "osd_mutex", &lockval ); 
    367     vlc_mutex_lock( lockval.p_address ); 
    368      
     387    if( osd_isVisible( p_osd ) == VLC_FALSE ) 
     388    { 
     389        vlc_object_release( (vlc_object_t*) p_osd ); 
     390        return; 
     391    } 
     392 
     393    var_Get( p_this->p_libvlc, "osd_mutex", &lockval ); 
     394    vlc_mutex_lock( lockval.p_address ); 
     395 
    369396    p_button = p_osd->p_state->p_visible; 
    370397    if( p_button ) 
    371     {                     
     398    { 
    372399        if( !p_button->b_range )  
    373400            p_button->p_current_state = osd_StateChange( p_button->p_states, OSD_BUTTON_UNSELECT ); 
     
    375402            p_osd->p_state->p_visible = p_button->p_prev; 
    376403        else 
    377             p_osd->p_state->p_visible = p_osd->p_last_button;                 
    378          
     404            p_osd->p_state->p_visible = p_osd->p_last_button; 
     405 
    379406        if( !p_osd->p_state->p_visible->b_range )  
    380407            p_osd->p_state->p_visible->p_current_state = 
    381408                osd_StateChange( p_osd->p_state->p_visible->p_states, OSD_BUTTON_SELECT ); 
    382          
     409 
    383410        osd_UpdateState( p_osd->p_state,  
    384411                p_osd->p_state->p_visible->i_x, p_osd->p_state->p_visible->i_y, 
     
    389416    } 
    390417#if defined(OSD_MENU_DEBUG) 
    391     msg_Dbg( p_osd, "direction left [button %s]", p_osd->p_state->p_visible->psz_action );             
    392 #endif 
    393              
     418    msg_Dbg( p_osd, "direction left [button %s]", p_osd->p_state->p_visible->psz_action ); 
     419#endif 
     420 
    394421    vlc_object_release( (vlc_object_t*) p_osd ); 
    395422    vlc_mutex_unlock( lockval.p_address ); 
     
    401428    osd_button_t *p_button = NULL; 
    402429    vlc_value_t lockval; 
    403 #if defined(OSD_MENU_DEBUG)     
     430#if defined(OSD_MENU_DEBUG) 
    404431    vlc_value_t val; 
    405432#endif 
    406          
     433 
    407434    if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 
    408435    { 
     
    410437        return; 
    411438    } 
    412              
     439 
     440    if( osd_isVisible( p_osd ) == VLC_FALSE ) 
     441    { 
     442        vlc_object_release( (vlc_object_t*) p_osd ); 
     443        return; 
     444    } 
     445 
    413446    var_Get( p_this->p_libvlc, "osd_mutex", &lockval ); 
    414447    vlc_mutex_lock( lockval.p_address ); 
     
    421454            p_button->p_current_state = osd_StateChange( p_button->p_states, OSD_BUTTON_SELECT ); 
    422455            if( p_button->p_up ) 
    423                 p_osd->p_state->p_visible = p_button->p_up;                     
    424         } 
    425          
     456                p_osd->p_state->p_visible = p_button->p_up; 
     457        } 
     458 
    426459        if( p_button->b_range && p_osd->p_state->p_visible->b_range )  
    427         {                     
     460        { 
    428461            osd_state_t *p_temp = p_osd->p_state->p_visible->p_current_state; 
    429462            if( p_temp && p_temp->p_next ) 
     
    431464        } 
    432465        else if( !p_osd->p_state->p_visible->b_range ) 
    433         {     
     466        { 
    434467            p_osd->p_state->p_visible->p_current_state = 
    435468                osd_StateChange( p_osd->p_state->p_visible->p_states, OSD_BUTTON_SELECT ); 
    436         }  
    437          
     469        } 
     470 
    438471        osd_UpdateState( p_osd->p_state,  
    439472                p_osd->p_state->p_visible->i_x, p_osd->p_state->p_visible->i_y, 
     
    454487    } 
    455488#if defined(OSD_MENU_DEBUG) 
    456     msg_Dbg( p_osd, "direction up [button %s]", p_osd->p_state->p_visible->psz_action );             
    457 #endif             
    458      
     489    msg_Dbg( p_osd, "direction up [button %s]", p_osd->p_state->p_visible->psz_action ); 
     490#endif 
     491 
    459492    vlc_object_release( (vlc_object_t*) p_osd ); 
    460493    vlc_mutex_unlock( lockval.p_address ); 
     
    475508        return; 
    476509    } 
    477      
     510 
     511    if( osd_isVisible( p_osd ) == VLC_FALSE ) 
     512    { 
     513        vlc_object_release( (vlc_object_t*) p_osd ); 
     514        return; 
     515    } 
     516 
    478517    var_Get( p_this->p_libvlc, "osd_mutex", &lockval ); 
    479518    vlc_mutex_lock( lockval.p_address );