-- (void)manageMode
-{
- vlc_bool_t b_input;
- vlc_bool_t b_control = 0;
- intf_thread_t * p_intf = [NSApp getIntf];
-
- if( ( b_input = ( p_intf->p_sys->p_input != NULL ) ) )
- {
- /* control buttons for free pace streams */
- b_control = p_intf->p_sys->p_input->stream.b_pace_control;
-
- /* get ready for menu regeneration */
- p_intf->p_sys->b_program_update = 1;
- p_intf->p_sys->b_title_update = 1;
- p_intf->p_sys->b_chapter_update = 1;
- p_intf->p_sys->b_audio_update = 1;
- p_intf->p_sys->b_spu_update = 1;
- p_intf->p_sys->i_part = 0;
-
- p_intf->p_sys->p_input->stream.b_changed = 0;
- msg_Dbg( p_intf, "stream has changed, refreshing interface" );
- }
- else
- {
- /* unsensitize menus */
- [o_mi_program setEnabled: FALSE];
- [o_mi_title setEnabled: FALSE];
- [o_mi_chapter setEnabled: FALSE];
- [o_mi_language setEnabled: FALSE];
- [o_mi_subtitle setEnabled: FALSE];
- [o_mi_channels setEnabled: FALSE];
- [o_mi_device setEnabled: FALSE];
- [o_mi_screen setEnabled: FALSE];
- [o_mi_close_window setEnabled: FALSE];
- }
- [self setControlItems];
-}
-
-- (void)setControlItems {
- intf_thread_t * p_intf = [NSApp getIntf];
- vlc_bool_t b_input;
- vlc_bool_t b_plmul = NO;
- vlc_bool_t b_control = NO;
- vlc_bool_t b_chapters = NO;
- input_area_t * p_area;
- playlist_t * p_playlist = NULL;
- NSImage *playImage = [NSImage imageNamed:@"play"];
- NSImage *pauseImage = [NSImage imageNamed:@"pause"];
-
- p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
- FIND_ANYWHERE );
- if( p_playlist != NULL )
- {
- vlc_mutex_lock( &p_playlist->object_lock );
- b_plmul = p_playlist->i_size > 1;
- vlc_mutex_unlock( &p_playlist->object_lock );
- vlc_object_release( p_playlist );
- }
-
- if ( b_input = ( p_intf->p_sys->p_input != NULL ) )
- {
- /* control buttons for free pace streams */
- b_control = p_intf->p_sys->p_input->stream.b_pace_control;
- p_area = p_intf->p_sys->p_input->stream.p_selected_area;
- if ( p_area->i_part_nb > 1 )
- b_chapters = YES;
- }
-
- /* set control items */
- [o_btn_stop setEnabled: b_input];
- [o_btn_fastforward setEnabled: b_control];
- [o_btn_slowmotion setEnabled: b_control];
- [o_btn_prev setEnabled: (b_plmul || b_chapters) ];
- [o_btn_next setEnabled: (b_plmul || b_chapters) ];
- [o_controls setVolumeSlider];
- [o_timeslider setEnabled: b_input];
-
- if ( (p_intf->p_sys->b_loop = config_GetInt( p_intf, "loop" )) )
- {
- [o_mi_loop setState: NSOnState];
- }
- else
- {
- [o_mi_loop setState: NSOffState];
- }
-
- if ( p_intf->p_sys->p_input != NULL &&
- p_intf->p_sys->p_input->stream.control.i_status != PAUSE_S)
- {
- [o_btn_play setImage: pauseImage];
- [o_btn_play setToolTip: _NS("Pause")];
- [o_mi_play setTitle: _NS("Pause")];
- [o_dmi_play setTitle: _NS("Pause")];
- }
- else
- {
- [o_btn_play setImage: playImage];
- [o_btn_play setToolTip: _NS("Play")];
- [o_mi_play setTitle: _NS("Play")];
- [o_dmi_play setTitle: _NS("Play")];
- }
-}
-
-- (void)setupMenus