]> git.sesse.net Git - vlc/commitdiff
macosx: directly set "key-action" variable where we can.
authorDerk-Jan Hartman <hartman@videolan.org>
Sun, 10 Aug 2008 15:09:16 +0000 (17:09 +0200)
committerDerk-Jan Hartman <hartman@videolan.org>
Sun, 10 Aug 2008 15:10:01 +0000 (17:10 +0200)
modules/gui/macosx/controls.m

index bbd35e275a069b37b90324fb3f098f9dd27aeba4..826d89a852a5dad3329a409d7f7a79e0a7123a22 100644 (file)
 
 - (IBAction)play:(id)sender
 {
-    vlc_value_t val;
     intf_thread_t * p_intf = VLCIntf;
     playlist_t * p_playlist = pl_Yield( p_intf );
 
         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 */
 
 - (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 );
     }
 }