- (IBAction)play:(id)sender
{
- vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Yield( p_intf );
- vlc_mutex_lock( &p_playlist->object_lock );
+ vlc_object_lock( p_playlist );
if( playlist_IsEmpty( p_playlist ) )
{
- vlc_mutex_unlock( &p_playlist->object_lock );
+ vlc_object_unlock( p_playlist );
vlc_object_release( p_playlist );
[o_main intfOpenFileGeneric: (id)sender];
}
else
{
- vlc_mutex_unlock( &p_playlist->object_lock );
+ vlc_object_unlock( p_playlist );
vlc_object_release( p_playlist );
}
- val.i_int = config_GetInt( p_intf, "key-play-pause" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_PLAY_PAUSE );
}
/* Small helper method */
return o_vout_view;
}
-
- (IBAction)stop:(id)sender
{
- vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
- val.i_int = config_GetInt( p_intf, "key-stop" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_STOP );
+ /* Close the window directly, because we do know that there
+ * won't be anymore video. It's currently waiting a bit. */
+ [[[self getVoutView] window] orderOut:self];
}
- (IBAction)faster:(id)sender
{
- vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
- val.i_int = config_GetInt( p_intf, "key-faster" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_FASTER );
}
- (IBAction)slower:(id)sender
{
- vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
- val.i_int = config_GetInt( p_intf, "key-slower" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_SLOWER );
}
- (IBAction)prev:(id)sender
{
- vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
- val.i_int = config_GetInt( p_intf, "key-prev" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_PREV );
}
- (IBAction)next:(id)sender
{
- vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
- val.i_int = config_GetInt( p_intf, "key-next" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_NEXT );
}
- (IBAction)random:(id)sender
- (IBAction)forward:(id)sender
{
- vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
- val.i_int = config_GetInt( p_intf, "key-jump+short" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_JUMP_FORWARD_SHORT );
}
- (IBAction)backward:(id)sender
{
vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
- val.i_int = config_GetInt( p_intf, "key-jump-short" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_JUMP_BACKWARD_SHORT );
}
- (IBAction)volumeUp:(id)sender
{
- vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
- val.i_int = config_GetInt( p_intf, "key-vol-up" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_VOL_UP );
/* Manage volume status */
[o_main manageVolumeSlider];
}
- (IBAction)volumeDown:(id)sender
{
- vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
- val.i_int = config_GetInt( p_intf, "key-vol-down" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_VOL_DOWN );
/* Manage volume status */
[o_main manageVolumeSlider];
}
- (IBAction)mute:(id)sender
{
- vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
- val.i_int = config_GetInt( p_intf, "key-vol-mute" );
- var_Set( p_intf->p_libvlc, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_VOL_MUTE );
/* Manage volume status */
[o_main manageVolumeSlider];
}
FIND_ANYWHERE );
if( p_vout != NULL )
{
- vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
- val.i_int = config_GetInt( p_intf, "key-position" );
- var_Set( p_intf, "key-pressed", val );
+ var_SetInteger( p_intf->p_libvlc, "key-action", ACTIONID_POSITION );
vlc_object_release( (vlc_object_t *)p_vout );
}
}
}
else
{
+ /* Fullscreen state for next time will be saved here too */
[o_vout_view toggleFullscreen];
}
}
var_Set( p_playlist, "fullscreen", (vlc_value_t)!val.b_bool );
}
- vlc_object_release( p_playlist );
+ pl_Release( VLCIntf );
}
}
}
else if( sender == o_specificTime_ok_btn )
{
- input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
- VLC_OBJECT_INPUT, FIND_ANYWHERE );
+ input_thread_t * p_input = pl_CurrentInput( VLCIntf );
if( p_input )
{
unsigned int timeInSec = 0;
input_Control( p_input, INPUT_SET_TIME, (int64_t)(timeInSec * 1000000));
vlc_object_release( p_input );
}
-
+
[NSApp endSheet: o_specificTime_win];
[o_specificTime_win close];
}
else
{
- input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
- VLC_OBJECT_INPUT, FIND_ANYWHERE );
+ input_thread_t * p_input = pl_CurrentInput( VLCIntf );
if( p_input )
{
/* we can obviously only do that if an input is available */
vlc_value_t val;
intf_thread_t * p_intf = VLCIntf;
playlist_t * p_playlist = pl_Yield( p_intf );
-
- vlc_mutex_lock( &p_playlist->object_lock );
-
-#define p_input p_playlist->p_input
+ input_thread_t * p_input = playlist_CurrentInput( p_playlist );
if( [[o_mi title] isEqualToString: _NS("Faster")] ||
[[o_mi title] isEqualToString: _NS("Slower")] )
[[o_mi title] isEqualToString: _NS("Next")] )
{
/** \todo fix i_size use */
+ PL_LOCK;
bEnabled = p_playlist->items.i_size > 1;
+ PL_UNLOCK;
}
else if( [[o_mi title] isEqualToString: _NS("Random")] )
{
break;
}
}
+
vlc_object_release( (vlc_object_t *)p_vout );
}
- else if( [[o_mi title] isEqualToString: _NS("Fullscreen")] )
+ if( [[o_mi title] isEqualToString: _NS("Fullscreen")] )
{
var_Get( p_playlist, "fullscreen", &val );
[o_mi setState: val.b_bool];
[o_main setupMenus]; /* Make sure video menu is up to date */
}
- vlc_mutex_unlock( &p_playlist->object_lock );
+ if( p_input ) vlc_object_release( p_input );
vlc_object_release( p_playlist );
return( bEnabled );