intf_thread_t * p_intf = VLCIntf;
p_intf->p_sys->b_playlist_update = TRUE;
p_intf->p_sys->b_intf_update = TRUE;
+ p_intf->p_sys->b_playmode_update = TRUE;
return VLC_SUCCESS;
}
}
o_about = [[VLAboutBox alloc] init];
- o_prefs = [[VLCPrefs alloc] init];
+ o_prefs = nil;
o_open = [[VLCOpen alloc] init];
-
+
+ i_lastShownVolume = -1;
return _o_sharedMainInstance;
}
case NSDeleteCharFunctionKey:
case NSBackspaceCharacter:
return YES;
+ case NSUpArrowFunctionKey:
+ case NSDownArrowFunctionKey:
+ case NSRightArrowFunctionKey:
+ case NSLeftArrowFunctionKey:
+ case NSEnterCharacter:
+ case NSCarriageReturnCharacter:
+ return NO;
}
val.i_int |= CocoaKeyToVLC( key );
{
var_AddCallback( p_playlist, "intf-change", PlaylistChanged, self );
var_AddCallback( p_playlist, "item-change", PlaylistChanged, self );
+ var_AddCallback( p_playlist, "item-append", PlaylistChanged, self );
+ var_AddCallback( p_playlist, "item-deleted", PlaylistChanged, self );
var_AddCallback( p_playlist, "playlist-current", PlaylistChanged, self );
vlc_object_release( p_playlist );
}
#undef p_input
+ /* Manage volume status */
+ [self manageVolumeSlider];
+
vlc_mutex_unlock( &p_intf->change_lock );
o_sleep_date = [NSDate dateWithTimeIntervalSinceNow: .1];
p_intf->p_sys->b_intf_update = VLC_FALSE;
}
- if ( p_intf->p_sys->b_playlist_update )
+ if( p_intf->p_sys->b_playmode_update )
+ {
+ [o_playlist playModeUpdated];
+ p_intf->p_sys->b_playmode_update = VLC_FALSE;
+ }
+ if( p_intf->p_sys->b_playlist_update )
{
[o_playlist playlistUpdated];
p_intf->p_sys->b_playlist_update = VLC_FALSE;
{
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
-
- [o_btn_fullscreen setState: ( var_Get( p_playlist, "fullscreen", &val )>=0 && val.b_bool ) ];
-
+ var_Get( p_playlist, "fullscreen", &val );
+ [o_btn_fullscreen setState: val.b_bool];
vlc_object_release( p_playlist );
p_intf->p_sys->b_fullscreen_update = VLC_FALSE;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
- if( p_playlist == NULL )
+ if( p_playlist == NULL || p_playlist->status.p_item == NULL )
{
return;
}
{
if( [[o_vout_wnd className] isEqualToString: @"VLCWindow"] )
{
- ;[o_vout_wnd updateTitle];
+ [o_vout_wnd updateTitle];
}
}
vlc_object_release( (vlc_object_t *)p_vout );
(int) (i_seconds % 60)];
[o_timefield setStringValue: o_time];
}
-
- /* Manage volume status */
- [self manageVolumeSlider];
+
+ if( p_intf->p_sys->b_volume_update )
+ {
+ NSString *o_text;
+ o_text = [NSString stringWithFormat: _NS("Volume: %d"), i_lastShownVolume * 200 / AOUT_VOLUME_MAX];
+ if( i_lastShownVolume != -1 )
+ [self setScrollField:o_text stopAfter:1000000];
+
+ [o_volumeslider setFloatValue: (float)i_lastShownVolume / AOUT_VOLUME_STEP];
+ [o_volumeslider setEnabled: TRUE];
+ p_intf->p_sys->b_mute = ( i_lastShownVolume == 0 );
+ p_intf->p_sys->b_volume_update = FALSE;
+ }
/* Manage Playing status */
var_Get( p_input, "state", &val );
if( (i_end_scroll != -1) && (mdate() > i_end_scroll) )
[self resetScrollField];
+
[NSTimer scheduledTimerWithTimeInterval: 0.3
target: self selector: @selector(manageIntf:)
userInfo: nil repeats: FALSE];
- (void)manageVolumeSlider
{
audio_volume_t i_volume;
-
aout_VolumeGet( p_intf, &i_volume );
- [o_volumeslider setFloatValue: (float)i_volume / AOUT_VOLUME_STEP];
- [o_volumeslider setEnabled: TRUE];
-
- p_intf->p_sys->b_mute = ( i_volume == 0 );
+ if( i_volume != i_lastShownVolume )
+ {
+ i_lastShownVolume = i_volume;
+ p_intf->p_sys->b_volume_update = TRUE;
+ }
}
- (IBAction)timesliderUpdate:(id)sender
- (IBAction)viewPreferences:(id)sender
{
+/* GRUIIIIIIIK */
+ if( o_prefs == nil )
+ o_prefs = [[VLCPrefs alloc] init];
[o_prefs showPrefs];
}
else
{
o_rect.size.height = 500;
- if ( o_rect.size.width == [o_window minSize].width )
- {
- o_rect.size.width = 500;
- }
-
}
+
+ if ( o_rect.size.width == [o_window minSize].width )
+ {
+ o_rect.size.width = 500;
+ }
+
o_rect.size.height = (o_size_with_playlist.height > 200) ?
o_size_with_playlist.height : 500;
o_rect.origin.x = [o_window frame].origin.x;
{
/* make small */
o_rect.size.height = [o_window minSize].height;
+ o_rect.size.width = [o_window minSize].width;
o_rect.origin.x = [o_window frame].origin.x;
/* Calculate the position of the lower right corner after resize */
o_rect.origin.y = [o_window frame].origin.y +
[o_window frame].size.height - [o_window minSize].height;
+
[o_playlist_view setAutoresizesSubviews: NO];
[o_playlist_view removeFromSuperview];
[o_btn_playlist setState: NO];