annotate src/statusicon/si.c @ 2150:04421592e6a3

Fixed an unexpected cddb error messaje when no cddb info is available
author Calin Crisan ccrisan@gmail.com
date Sat, 03 Nov 2007 01:23:56 +0200
parents 6a9f36552b14
children d44adaddae8b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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"
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
26 #include <audacious/auddrct.h>
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
27 #include <audacious/playlist.h>
433
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
1116
86578452bcd1 [svn] - statusicon: converted to v2 plugin system
giacomo
parents: 1022
diff changeset
30 GeneralPlugin *statusicon_gplist[] = { &si_gp, NULL };
1657
61f1f017e847 fix statusicon plugin
mf0102 <0102@gmx.at>
parents: 1395
diff changeset
31 SIMPLE_GENERAL_PLUGIN(statusicon, statusicon_gplist);
1116
86578452bcd1 [svn] - statusicon: converted to v2 plugin system
giacomo
parents: 1022
diff changeset
32
433
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
33 static gboolean plugin_active = FALSE;
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
34
915
1ccc7a9c7fc2 [svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents: 914
diff changeset
35 extern si_cfg_t si_cfg;
1ccc7a9c7fc2 [svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents: 914
diff changeset
36
433
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
37
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 /* plug-in functions */
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 );
915
1ccc7a9c7fc2 [svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents: 914
diff changeset
60 si_cfg_save(); /* required to save windows visibility status */
433
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
61 }
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
62 return;
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
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
66 void
854
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
67 si_prefs ( void )
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
68 {
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
69 si_ui_prefs_show();
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
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
73 void
433
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
74 si_about ( void )
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
75 {
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
76 si_ui_about_show();
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 /* ***************** */
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
82 /* audacious actions */
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
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
85 void
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
86 si_audacious_toggle_visibility ( void )
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
87 {
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
88 /* 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
89 (if at least one is visible, hide) */
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
90 if (( audacious_drct_main_win_is_visible() == TRUE ) ||
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
91 ( audacious_drct_eq_win_is_visible() == TRUE ) ||
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
92 ( audacious_drct_pl_win_is_visible() == TRUE ))
433
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
93 {
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
94 /* remember the visibility status of the player windows */
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
95 si_cfg.mw_visib_prevstatus = audacious_drct_main_win_is_visible();
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
96 si_cfg.ew_visib_prevstatus = audacious_drct_eq_win_is_visible();
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
97 si_cfg.pw_visib_prevstatus = audacious_drct_pl_win_is_visible();
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
98 /* now hide all of them */
915
1ccc7a9c7fc2 [svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents: 914
diff changeset
99 if ( si_cfg.mw_visib_prevstatus == TRUE )
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
100 audacious_drct_main_win_toggle( FALSE );
915
1ccc7a9c7fc2 [svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents: 914
diff changeset
101 if ( si_cfg.ew_visib_prevstatus == TRUE )
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
102 audacious_drct_eq_win_toggle( FALSE );
915
1ccc7a9c7fc2 [svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents: 914
diff changeset
103 if ( si_cfg.pw_visib_prevstatus == TRUE )
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
104 audacious_drct_pl_win_toggle( FALSE );
433
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
105 }
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
106 else
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
107 {
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
108 /* show the windows that were visible before */
915
1ccc7a9c7fc2 [svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents: 914
diff changeset
109 if ( si_cfg.mw_visib_prevstatus == TRUE )
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
110 audacious_drct_main_win_toggle( TRUE );
915
1ccc7a9c7fc2 [svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents: 914
diff changeset
111 if ( si_cfg.ew_visib_prevstatus == TRUE )
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
112 audacious_drct_eq_win_toggle( TRUE );
915
1ccc7a9c7fc2 [svn] - statusicon: memorize player windows visibility status between sessions
giacomo
parents: 914
diff changeset
113 if ( si_cfg.pw_visib_prevstatus == TRUE )
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
114 audacious_drct_pl_win_toggle( TRUE );
433
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
115 }
38fe08dff5cd [svn] - added status icon plugin (written from scratch, with code from gtk 2.10)
giacomo
parents:
diff changeset
116 }
453
60395c0d7587 [svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents: 433
diff changeset
117
60395c0d7587 [svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents: 433
diff changeset
118 void
60395c0d7587 [svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents: 433
diff changeset
119 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
120 {
60395c0d7587 [svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents: 433
diff changeset
121 gint vl, vr;
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
122 audacious_drct_get_volume( &vl , &vr );
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
123 audacious_drct_set_volume( CLAMP(vl + value, 0, 100) , CLAMP(vr + value, 0, 100) );
453
60395c0d7587 [svn] - status icon plugin: use scroll wheel on the status icon to change volume
giacomo
parents: 433
diff changeset
124 }
854
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
125
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
126 void
962
9f0ac3bb82f4 [svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents: 918
diff changeset
127 si_audacious_quit ( void )
9f0ac3bb82f4 [svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents: 918
diff changeset
128 {
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
129 audacious_drct_quit();
962
9f0ac3bb82f4 [svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents: 918
diff changeset
130 }
9f0ac3bb82f4 [svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents: 918
diff changeset
131
9f0ac3bb82f4 [svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents: 918
diff changeset
132 void
918
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
133 si_audacious_playback_skip ( gint numsong )
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
134 {
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
135 gpointer ctrl_code_gp = NULL;
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
136 gint i = 0;
962
9f0ac3bb82f4 [svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents: 918
diff changeset
137
918
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
138 if ( numsong >= 0 )
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
139 {
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
140 ctrl_code_gp = GINT_TO_POINTER(SI_AUDACIOUS_PLAYBACK_CTRL_NEXT);
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
141 }
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
142 else
962
9f0ac3bb82f4 [svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents: 918
diff changeset
143 {
918
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
144 ctrl_code_gp = GINT_TO_POINTER(SI_AUDACIOUS_PLAYBACK_CTRL_PREV);
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
145 numsong *= -1;
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
146 }
962
9f0ac3bb82f4 [svn] - statusicon: added support for quit button in smallmenu; also, the field is being prepared for customizable smallmenu entries
giacomo
parents: 918
diff changeset
147
918
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
148 for ( i = 0 ; i < numsong ; i++ )
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
149 si_audacious_playback_ctrl( ctrl_code_gp );
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
150 }
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
151
209bd85dc1b9 [svn] - statusicon: add an option to use mouse wheel to change playing song instead of volume
giacomo
parents: 915
diff changeset
152 void
854
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
153 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
154 {
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
155 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
156 switch ( ctrl_code )
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
157 {
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
158 case SI_AUDACIOUS_PLAYBACK_CTRL_PREV:
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
159 audacious_drct_pl_prev();
854
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
160 break;
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
161
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
162 case SI_AUDACIOUS_PLAYBACK_CTRL_PLAY:
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
163 audacious_drct_play();
854
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
164 break;
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
165
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
166 case SI_AUDACIOUS_PLAYBACK_CTRL_PAUSE:
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
167 audacious_drct_pause();
854
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
168 break;
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
169
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
170 case SI_AUDACIOUS_PLAYBACK_CTRL_STOP:
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
171 audacious_drct_stop();
854
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
172 break;
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
173
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
174 case SI_AUDACIOUS_PLAYBACK_CTRL_NEXT:
1022
e3beb4b76591 [svn] - statusicon: works again with auddrct
giacomo
parents: 962
diff changeset
175 audacious_drct_pl_next();
854
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
176 break;
855
fbf1f593b0c6 [svn] statusicon: added a open-file item in the small right-click menu
giacomo
parents: 854
diff changeset
177
fbf1f593b0c6 [svn] statusicon: added a open-file item in the small right-click menu
giacomo
parents: 854
diff changeset
178 case SI_AUDACIOUS_PLAYBACK_CTRL_EJECT:
2074
William Pitcock <nenolod@atheme.org>
parents: 1657
diff changeset
179 audacious_drct_eject();
855
fbf1f593b0c6 [svn] statusicon: added a open-file item in the small right-click menu
giacomo
parents: 854
diff changeset
180 break;
854
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
181 }
aac49941ee8f [svn] statusicon 0.3: alternative right-click menu with simple playback control commands
giacomo
parents: 795
diff changeset
182 }