Mercurial > audlegacy-plugins
diff src/hotkey/plugin.h @ 2336:ad45d65e9ae7
Hotkey Plugin: Complete GUI rework. Ability to use more than one binding for the same action.
author | Sascha Hlusiak <contact@saschahlusiak.de> |
---|---|
date | Wed, 23 Jan 2008 19:37:05 +0100 |
parents | 0be42d832217 |
children |
line wrap: on
line diff
--- a/src/hotkey/plugin.h Wed Jan 23 14:12:02 2008 +0100 +++ b/src/hotkey/plugin.h Wed Jan 23 19:37:05 2008 +0100 @@ -6,9 +6,31 @@ #define TYPE_KEY 0 #define TYPE_MOUSE 1 -typedef struct { +typedef enum { + EVENT_PREV_TRACK = 0, + EVENT_PLAY, + EVENT_PAUSE, + EVENT_STOP, + EVENT_NEXT_TRACK, + + EVENT_FORWARD, + EVENT_BACKWARD, + EVENT_MUTE, + EVENT_VOL_UP, + EVENT_VOL_DOWN, + EVENT_JUMP_TO_FILE, + EVENT_TOGGLE_WIN, + EVENT_SHOW_AOSD, + + EVENT_MAX +} EVENT; + + +typedef struct _HotkeyConfiguration { gint key, mask; gint type; + EVENT event; + struct _HotkeyConfiguration *next; } HotkeyConfiguration; typedef struct { @@ -16,25 +38,15 @@ gint vol_decrement; /* keyboard */ - HotkeyConfiguration mute; - HotkeyConfiguration vol_down; - HotkeyConfiguration vol_up; - HotkeyConfiguration play; - HotkeyConfiguration stop; - HotkeyConfiguration pause; - HotkeyConfiguration prev_track; - HotkeyConfiguration next_track; - HotkeyConfiguration jump_to_file; - HotkeyConfiguration toggle_win; - HotkeyConfiguration forward; - HotkeyConfiguration backward; - HotkeyConfiguration show_aosd; + HotkeyConfiguration first; } PluginConfig; + + void load_config (void); void save_config (void); PluginConfig* get_config(void); gboolean is_loaded (void); -gboolean handle_keyevent(int keycode, int state, int type); +gboolean handle_keyevent(EVENT event); #endif