Changeset c36f6582a09005300a78c70c28f530d1597ff262
- Timestamp:
- 05/30/07 14:47:26 (1 year ago)
- git-parent:
- Files:
-
- src/osd/osd.c (modified) (11 diffs)
- src/osd/osd_parser.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
src/osd/osd.c
racc91d3 rc36f658 66 66 vlc_mutex_lock( lockval.p_address ); 67 67 68 if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 68 p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ); 69 if( p_osd == NULL ) 69 70 { 70 71 vlc_value_t val; … … 89 90 p_osd->i_height = p_osd->p_state->p_visible->p_current_state->p_pic->p[Y_PLANE].i_visible_lines; 90 91 91 /* Update the volume state images to match the current volume */ 92 i_volume = config_GetInt( p_this, "volume" ); 93 i_steps = osd_VolumeStep( p_this, i_volume, p_osd->p_state->p_volume->i_ranges ); 94 p_osd->p_state->p_volume->p_current_state = osd_VolumeStateChange( p_osd->p_state->p_volume->p_states, i_steps ); 95 92 if( p_osd->p_state->p_volume ) 93 { 94 /* Update the volume state images to match the current volume */ 95 i_volume = config_GetInt( p_this, "volume" ); 96 i_steps = osd_VolumeStep( p_this, i_volume, p_osd->p_state->p_volume->i_ranges ); 97 p_osd->p_state->p_volume->p_current_state = osd_VolumeStateChange( 98 p_osd->p_state->p_volume->p_states, i_steps ); 99 } 96 100 /* Initialize OSD state */ 97 101 osd_UpdateState( p_osd->p_state, p_osd->i_x, p_osd->i_y, … … 199 203 vlc_value_t lockval; 200 204 201 if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 205 p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ); 206 if( p_osd == NULL ) 202 207 { 203 208 msg_Err( p_this, "osd_MenuNext failed" ); … … 240 245 vlc_value_t lockval; 241 246 242 if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 247 p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ); 248 if( p_osd == NULL ) 243 249 { 244 250 msg_Err( p_this, "osd_MenuNext failed" ); … … 267 273 vlc_value_t lockval; 268 274 269 if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 275 p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ); 276 if( p_osd == NULL ) 270 277 { 271 278 msg_Err( p_this, "osd_MenuNext failed" ); … … 329 336 vlc_value_t lockval; 330 337 331 if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 338 p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ); 339 if( p_osd == NULL ) 332 340 { 333 341 msg_Err( p_this, "osd_MenuNext failed" ); … … 379 387 vlc_value_t lockval; 380 388 381 if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 389 p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ); 390 if( p_osd == NULL ) 382 391 { 383 392 msg_Err( p_this, "osd_MenuPrev failed" ); … … 431 440 vlc_value_t val; 432 441 #endif 433 434 if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) )== NULL )442 p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ); 443 if( p_osd == NULL ) 435 444 { 436 445 msg_Err( p_this, "osd_MenuDown failed" ); … … 503 512 #endif 504 513 505 if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 514 p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ); 515 if( p_osd == NULL ) 506 516 { 507 517 msg_Err( p_this, "osd_MenuDown failed" ); … … 588 598 int i_steps = 0; 589 599 590 if( ( p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ) ) == NULL ) 600 p_osd = vlc_object_find( p_this, VLC_OBJECT_OSDMENU, FIND_ANYWHERE ); 601 if( p_osd == NULL ) 591 602 { 592 603 msg_Err( p_this, "OSD menu volume update failed" ); … … 594 605 } 595 606 596 var_Get( p_this->p_libvlc, "osd_mutex", &lockval ); 597 vlc_mutex_lock( lockval.p_address ); 598 599 p_button = p_osd->p_state->p_volume; 600 if( p_osd->p_state->p_volume ) 601 p_osd->p_state->p_visible = p_osd->p_state->p_volume; 602 if( p_button && p_button->b_range ) 603 { 604 /* Update the volume state images to match the current volume */ 605 i_volume = config_GetInt( p_this, "volume" ); 606 i_steps = osd_VolumeStep( p_this, i_volume, p_button->i_ranges ); 607 p_button->p_current_state = osd_VolumeStateChange( p_button->p_states, i_steps ); 608 609 osd_UpdateState( p_osd->p_state, 610 p_button->i_x, p_button->i_y, 611 p_button->p_current_state->p_pic->p[Y_PLANE].i_visible_pitch, 612 p_button->p_current_state->p_pic->p[Y_PLANE].i_visible_lines, 613 p_button->p_current_state->p_pic ); 614 osd_SetMenuUpdate( p_osd, VLC_TRUE ); 615 osd_SetMenuVisible( p_osd, VLC_TRUE ); 616 } 617 vlc_object_release( (vlc_object_t*) p_osd ); 618 vlc_mutex_unlock( lockval.p_address ); 619 } 607 if( p_osd->p_state && p_osd->p_state->p_volume ) 608 { 609 var_Get( p_this->p_libvlc, "osd_mutex", &lockval ); 610 vlc_mutex_lock( lockval.p_address ); 611 612 p_button = p_osd->p_state->p_volume; 613 if( p_osd->p_state->p_volume ) 614 p_osd->p_state->p_visible = p_osd->p_state->p_volume; 615 if( p_button && p_button->b_range ) 616 { 617 /* Update the volume state images to match the current volume */ 618 i_volume = config_GetInt( p_this, "volume" ); 619 i_steps = osd_VolumeStep( p_this, i_volume, p_button->i_ranges ); 620 p_button->p_current_state = osd_VolumeStateChange( p_button->p_states, i_steps ); 621 622 osd_UpdateState( p_osd->p_state, 623 p_button->i_x, p_button->i_y, 624 p_button->p_current_state->p_pic->p[Y_PLANE].i_visible_pitch, 625 p_button->p_current_state->p_pic->p[Y_PLANE].i_visible_lines, 626 p_button->p_current_state->p_pic ); 627 osd_SetMenuUpdate( p_osd, VLC_TRUE ); 628 osd_SetMenuVisible( p_osd, VLC_TRUE ); 629 } 630 vlc_object_release( (vlc_object_t*) p_osd ); 631 vlc_mutex_unlock( lockval.p_address ); 632 } 633 } src/osd/osd_parser.c
rafc8700 rc36f658 89 89 p_menu->p_state = (osd_menu_state_t *) malloc( sizeof( osd_menu_state_t ) ); 90 90 if( !p_menu->p_state ) 91 { 91 92 msg_Err( p_menu, "Memory allocation for OSD Menu state failed" ); 92 93 return NULL; 94 } 95 96 memset(p_menu->p_state, 0, sizeof(osd_menu_state_t)); 93 97 if( psz_path != NULL ) 94 98 p_menu->psz_path = strdup( psz_path );
