[totem] media-player-keys: Add support for new keys



commit 631ddd2fd90c1845631bc91fa1c006cd754902df
Author: Bastien Nocera <hadess hadess net>
Date:   Thu Jan 27 18:01:05 2011 +0000

    media-player-keys: Add support for new keys
    
    Add support for FastForward, Rewind, Repeat and Shuffle
    multimedia keys.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=634184

 .../media-player-keys/totem-media-player-keys.c    |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/media-player-keys/totem-media-player-keys.c b/src/plugins/media-player-keys/totem-media-player-keys.c
index 0a74888..9534ba6 100644
--- a/src/plugins/media-player-keys/totem-media-player-keys.c
+++ b/src/plugins/media-player-keys/totem-media-player-keys.c
@@ -69,6 +69,21 @@ on_media_player_key_pressed (DBusGProxy *proxy, const gchar *application, const
 			totem_action_next (totem);
 		else if (strcmp ("Stop", key) == 0)
 			totem_action_pause (totem);
+		else if (strcmp ("FastForward", key) == 0)
+			totem_action_remote (totem, TOTEM_REMOTE_COMMAND_SEEK_FORWARD, NULL);
+		else if (strcmp ("Rewind", key) == 0)
+			totem_action_remote (totem, TOTEM_REMOTE_COMMAND_SEEK_BACKWARD, NULL);
+		else if (strcmp ("Repeat", key) == 0) {
+			gboolean value;
+
+			value = totem_action_remote_get_setting (totem, TOTEM_REMOTE_SETTING_REPEAT);
+			totem_action_remote_set_setting (totem, TOTEM_REMOTE_SETTING_REPEAT, !value);
+		} else if (strcmp ("Shuffle", key) == 0) {
+			gboolean value;
+
+			value = totem_action_remote_get_setting (totem, TOTEM_REMOTE_SETTING_SHUFFLE);
+			totem_action_remote_set_setting (totem, TOTEM_REMOTE_SETTING_SHUFFLE, !value);
+		}
 	}
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]