]> git.sesse.net Git - vlc/blobdiff - modules/control/hotkeys.c
* change hotkeys OSD message from 0-100% to 0-400%
[vlc] / modules / control / hotkeys.c
old mode 100755 (executable)
new mode 100644 (file)
index 6d5df98..21d7b4f
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * hotkeys.c: Hotkey handling for vlc
  *****************************************************************************
- * Copyright (C) 2004 VideoLAN
+ * Copyright (C) 2005 the VideoLAN team
  * $Id$
  *
  * Authors: Sigmund Augdal <sigmunau@idi.ntnu.no>
@@ -236,7 +236,7 @@ static void Run( intf_thread_t *p_intf )
         /* Find action triggered by hotkey */
         i_action = 0;
         i_key = GetKey( p_intf );
-        for( i = 0; p_hotkeys[i].psz_action != NULL; i++ )
+        for( i = 0; i_key != -1 && p_hotkeys[i].psz_action != NULL; i++ )
         {
             if( p_hotkeys[i].i_key == i_key )
             {
@@ -253,6 +253,14 @@ static void Run( intf_thread_t *p_intf )
 
         if( i_action == ACTIONID_QUIT )
         {
+            p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+                                    FIND_ANYWHERE );
+            if( p_playlist )
+            {
+                playlist_Stop( p_playlist );
+                vlc_object_release( p_playlist );
+            }
+            /* Playlist is stopped now kill vlc. */
             p_intf->p_vlc->b_die = VLC_TRUE;
             ClearChannels( p_intf, p_vout );
             vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Quit" ) );
@@ -299,6 +307,10 @@ static void Run( intf_thread_t *p_intf )
                 vlc_object_release( p_playlist );
             }
         }
+        else if( i_action == ACTIONID_SNAPSHOT )
+        {
+            if( p_vout ) vout_Control( p_vout, VOUT_SNAPSHOT );
+        }
         else if( i_action == ACTIONID_SUBDELAY_DOWN )
         {
             int64_t i_delay = var_GetTime( p_input, "spu-delay" );
@@ -698,7 +710,6 @@ static void PlayBookmark( intf_thread_t *p_intf, int i_num )
 
 static void SetBookmark( intf_thread_t *p_intf, int i_num )
 {
-    vlc_value_t val;
     playlist_t *p_playlist =
         vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
     if( p_playlist )
@@ -709,10 +720,11 @@ static void SetBookmark( intf_thread_t *p_intf, int i_num )
                     VLC_VAR_STRING|VLC_VAR_DOINHERIT );
         if( p_playlist->status.p_item )
         {
-            val.psz_string = strdup( p_playlist->status.p_item->input.psz_uri );
-            var_Set( p_intf, psz_bookmark_name, val );
+            config_PutPsz( p_intf, psz_bookmark_name, 
+                           p_playlist->status.p_item->input.psz_uri);
             msg_Info( p_intf, "setting playlist bookmark %i to %s", i_num,
-                      val.psz_string );
+                           p_playlist->status.p_item->input.psz_uri);
+            config_SaveConfigFile( p_intf, "hotkeys" );
         }
         vlc_object_release( p_playlist );
     }
@@ -772,8 +784,8 @@ static void DisplayVolume( intf_thread_t *p_intf, vout_thread_t *p_vout,
     }
     else
     {
-        vout_OSDMessage( p_vout, VOLUME_TEXT_CHAN, "Vol %d%%",
-                         2*i_vol*100/AOUT_VOLUME_MAX );
+        vout_OSDMessage( p_vout, VOLUME_TEXT_CHAN, "Volume %d%%",
+                         i_vol*400/AOUT_VOLUME_MAX );
     }
 }