Mercurial > audlegacy-plugins
annotate src/statusicon/si.c @ 914:d12d27887bf0 trunk
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
author | giacomo |
---|---|
date | Wed, 04 Apr 2007 11:49:12 -0700 |
parents | fbf1f593b0c6 |
children | 1ccc7a9c7fc2 |
rev | line source |
---|---|
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
1 /* |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
2 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
3 * Author: Giacomo Lozito <james@develia.org>, (C) 2005-2007 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
4 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
5 * This program is free software; you can redistribute it and/or modify it |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License as published by the |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
7 * Free Software Foundation; either version 2 of the License, or (at your |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
8 * option) any later version. |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
9 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
10 * This program is distributed in the hope that it will be useful, but |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
11 * WITHOUT ANY WARRANTY; without even the implied warranty of |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
13 * General Public License for more details. |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
14 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License along |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
16 * with this program; if not, write to the Free Software Foundation, Inc., |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
18 * |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
19 */ |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
20 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
21 #include "si.h" |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
22 #include "si_ui.h" |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
23 #include "si_audacious.h" |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
24 #include "si_cfg.h" |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
25 #include "si_common.h" |
453
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
433
diff
changeset
|
26 #include <audacious/beepctrl.h> |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
27 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
28 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
29 static gboolean plugin_active = FALSE; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
30 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
31 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
32 /* ***************** */ |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
33 /* plug-in functions */ |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
34 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
35 GeneralPlugin *get_gplugin_info() |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
36 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
37 return &si_gp; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
38 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
39 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
40 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
41 void |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
42 si_init ( void ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
43 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
44 g_type_init(); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
45 g_log_set_handler( NULL , G_LOG_LEVEL_WARNING , g_log_default_handler , NULL ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
46 plugin_active = TRUE; |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
47 si_cfg_load(); |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
453
diff
changeset
|
48 si_ui_statusicon_enable( TRUE ); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
49 return; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
50 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
51 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
52 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
53 void |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
54 si_cleanup ( void ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
55 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
56 if ( plugin_active == TRUE ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
57 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
58 plugin_active = FALSE; |
795
ca6dca840074
[svn] - statusicon: re-display statusicon popup with updated information when song (or title) changes, closes bug #846
giacomo
parents:
453
diff
changeset
|
59 si_ui_statusicon_enable( FALSE ); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
60 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
61 return; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
62 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
63 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
64 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
65 void |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
66 si_prefs ( void ) |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
67 { |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
68 si_ui_prefs_show(); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
69 } |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
70 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
71 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
72 void |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
73 si_about ( void ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
74 { |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
75 si_ui_about_show(); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
76 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
77 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
78 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
79 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
80 /* ***************** */ |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
81 /* audacious actions */ |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
82 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
83 |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
84 void |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
85 si_audacious_toggle_visibility ( void ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
86 { |
914
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
87 static gboolean mw_prevstatus = FALSE; |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
88 static gboolean eq_prevstatus = FALSE; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
89 static gboolean pl_prevstatus = FALSE; |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
90 |
914
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
91 /* use the window visibility status to toggle show/hide |
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
92 (if at least one is visible, hide) */ |
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
93 if (( xmms_remote_is_main_win( si_gp.xmms_session ) == TRUE ) || |
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
94 ( xmms_remote_is_eq_win( si_gp.xmms_session ) == TRUE ) || |
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
95 ( xmms_remote_is_pl_win( si_gp.xmms_session ) == TRUE )) |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
96 { |
914
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
97 /* remember the visibility status of the player windows */ |
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
98 mw_prevstatus = xmms_remote_is_main_win( si_gp.xmms_session ); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
99 eq_prevstatus = xmms_remote_is_eq_win( si_gp.xmms_session ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
100 pl_prevstatus = xmms_remote_is_pl_win( si_gp.xmms_session ); |
914
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
101 /* now hide all of them */ |
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
102 if ( mw_prevstatus == TRUE ) |
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
103 xmms_remote_main_win_toggle( si_gp.xmms_session , FALSE ); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
104 if ( eq_prevstatus == TRUE ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
105 xmms_remote_eq_win_toggle( si_gp.xmms_session , FALSE ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
106 if ( pl_prevstatus == TRUE ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
107 xmms_remote_pl_win_toggle( si_gp.xmms_session , FALSE ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
108 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
109 else |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
110 { |
914
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
111 /* show the windows that were visible before */ |
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
112 if ( mw_prevstatus == TRUE ) |
d12d27887bf0
[svn] - statusicon: smarter show/hide on statusicon click (plugin will now correctly handle the situation where the player window is always hidden and the playlist window should be shown/hidden)
giacomo
parents:
855
diff
changeset
|
113 xmms_remote_main_win_toggle( si_gp.xmms_session , TRUE ); |
433
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
114 if ( eq_prevstatus == TRUE ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
115 xmms_remote_eq_win_toggle( si_gp.xmms_session , TRUE ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
116 if ( pl_prevstatus == TRUE ) |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
117 xmms_remote_pl_win_toggle( si_gp.xmms_session , TRUE ); |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
118 } |
38fe08dff5cd
[svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff
changeset
|
119 } |
453
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
433
diff
changeset
|
120 |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
433
diff
changeset
|
121 void |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
433
diff
changeset
|
122 si_audacious_volume_change ( gint value ) |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
433
diff
changeset
|
123 { |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
433
diff
changeset
|
124 gint vl, vr; |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
433
diff
changeset
|
125 xmms_remote_get_volume( si_gp.xmms_session , &vl , &vr ); |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
433
diff
changeset
|
126 xmms_remote_set_volume( si_gp.xmms_session , |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
433
diff
changeset
|
127 CLAMP(vl + value, 0, 100) , CLAMP(vr + value, 0, 100) ); |
60395c0d7587
[svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents:
433
diff
changeset
|
128 } |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
129 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
130 void |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
131 si_audacious_playback_ctrl ( gpointer ctrl_code_gp ) |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
132 { |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
133 gint ctrl_code = GPOINTER_TO_INT(ctrl_code_gp); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
134 switch ( ctrl_code ) |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
135 { |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
136 case SI_AUDACIOUS_PLAYBACK_CTRL_PREV: |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
137 xmms_remote_playlist_prev( si_gp.xmms_session ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
138 break; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
139 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
140 case SI_AUDACIOUS_PLAYBACK_CTRL_PLAY: |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
141 xmms_remote_play( si_gp.xmms_session ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
142 break; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
143 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
144 case SI_AUDACIOUS_PLAYBACK_CTRL_PAUSE: |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
145 xmms_remote_pause( si_gp.xmms_session ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
146 break; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
147 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
148 case SI_AUDACIOUS_PLAYBACK_CTRL_STOP: |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
149 xmms_remote_stop( si_gp.xmms_session ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
150 break; |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
151 |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
152 case SI_AUDACIOUS_PLAYBACK_CTRL_NEXT: |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
153 xmms_remote_playlist_next( si_gp.xmms_session ); |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
154 break; |
855
fbf1f593b0c6
[svn] statusicon: added a open-file item in the small right-click menu
giacomo
parents:
854
diff
changeset
|
155 |
fbf1f593b0c6
[svn] statusicon: added a open-file item in the small right-click menu
giacomo
parents:
854
diff
changeset
|
156 case SI_AUDACIOUS_PLAYBACK_CTRL_EJECT: |
fbf1f593b0c6
[svn] statusicon: added a open-file item in the small right-click menu
giacomo
parents:
854
diff
changeset
|
157 xmms_remote_eject( si_gp.xmms_session ); |
fbf1f593b0c6
[svn] statusicon: added a open-file item in the small right-click menu
giacomo
parents:
854
diff
changeset
|
158 break; |
854
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
159 } |
aac49941ee8f
[svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents:
795
diff
changeset
|
160 } |