2313
|
1 /* Audacious - Cross-platform multimedia player
|
|
2 * Copyright (C) 2005-2007 Audacious development team.
|
|
3 *
|
|
4 * This program is free software; you can redistribute it and/or modify
|
|
5 * it under the terms of the GNU General Public License as published by
|
|
6 * the Free Software Foundation; under version 2 of the License.
|
|
7 *
|
|
8 * This program is distributed in the hope that it will be useful,
|
|
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
11 * GNU General Public License for more details.
|
|
12 *
|
|
13 * You should have received a copy of the GNU General Public License
|
|
14 * along with this program; if not, write to the Free Software
|
|
15 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
16 */
|
|
17
|
|
18 #ifdef HAVE_CONFIG_H
|
|
19 # include "config.h"
|
|
20 #endif
|
|
21
|
|
22 #include "ui_manager.h"
|
|
23 #include "actions-mainwin.h"
|
|
24 #include "actions-playlist.h"
|
|
25 #include "actions-equalizer.h"
|
|
26
|
|
27 /* TODO ui_main.h is only included because ui_manager.c needs the values of
|
|
28 TimerMode enum; move that enum elsewhere so we can get rid of this include */
|
|
29 #include "ui_main.h"
|
|
30 /* we need this to define values of visualization radio-actions */
|
|
31 #include "widgets/widgetcore.h"
|
|
32
|
|
33 #include "icons-stock.h"
|
|
34
|
|
35
|
|
36 static GtkUIManager *ui_manager;
|
|
37
|
|
38
|
|
39 /* toggle action entries */
|
|
40
|
|
41 static GtkToggleActionEntry toggleaction_entries_others[] = {
|
|
42
|
|
43 { "autoscroll songname", NULL , N_("Autoscroll Songname"), NULL,
|
|
44 N_("Autoscroll Songname"), G_CALLBACK(action_autoscroll_songname) , FALSE },
|
|
45
|
|
46 { "stop after current song", NULL , N_("Stop after Current Song"), "<Ctrl>M",
|
|
47 N_("Stop after Current Song"), G_CALLBACK(action_stop_after_current_song) , FALSE },
|
|
48
|
|
49 { "anamode peaks", NULL , N_("Peaks"), NULL,
|
|
50 N_("Peaks"), G_CALLBACK(action_anamode_peaks) , FALSE },
|
|
51
|
|
52 { "playback repeat", NULL , N_("Repeat"), "R",
|
|
53 N_("Repeat"), G_CALLBACK(action_playback_repeat) , FALSE },
|
|
54
|
|
55 { "playback shuffle", NULL , N_("Shuffle"), "S",
|
|
56 N_("Shuffle"), G_CALLBACK(action_playback_shuffle) , FALSE },
|
|
57
|
|
58 { "playback no playlist advance", NULL , N_("No Playlist Advance"), "<Ctrl>N",
|
|
59 N_("No Playlist Advance"), G_CALLBACK(action_playback_noplaylistadvance) , FALSE },
|
|
60
|
|
61 { "show player", NULL , N_("Show Player"), "<Alt>M",
|
|
62 N_("Show Player"), G_CALLBACK(action_show_player) , FALSE },
|
|
63
|
|
64 { "show playlist editor", NULL , N_("Show Playlist Editor"), "<Alt>E",
|
|
65 N_("Show Playlist Editor"), G_CALLBACK(action_show_playlist_editor) , FALSE },
|
|
66
|
|
67 { "show equalizer", NULL , N_("Show Equalizer"), "<Alt>G",
|
|
68 N_("Show Equalizer"), G_CALLBACK(action_show_equalizer) , FALSE },
|
|
69
|
|
70 { "view always on top", NULL , N_("Always on Top"), "<Ctrl>O",
|
|
71 N_("Always on Top"), G_CALLBACK(action_view_always_on_top) , FALSE },
|
|
72
|
|
73 { "view put on all workspaces", NULL , N_("Put on All Workspaces"), "<Ctrl>S",
|
|
74 N_("Put on All Workspaces"), G_CALLBACK(action_view_on_all_workspaces) , FALSE },
|
|
75
|
|
76 { "roll up player", NULL , N_("Roll up Player"), "<Ctrl>W",
|
|
77 N_("Roll up Player"), G_CALLBACK(action_roll_up_player) , FALSE },
|
|
78
|
|
79 { "roll up playlist editor", NULL , N_("Roll up Playlist Editor"), "<Shift><Ctrl>W",
|
|
80 N_("Roll up Playlist Editor"), G_CALLBACK(action_roll_up_playlist_editor) , FALSE },
|
|
81
|
|
82 { "roll up equalizer", NULL , N_("Roll up Equalizer"), "<Ctrl><Alt>W",
|
|
83 N_("Roll up Equalizer"), G_CALLBACK(action_roll_up_equalizer) , FALSE },
|
|
84
|
|
85 { "view doublesize", NULL , N_("DoubleSize"), "<Ctrl>D",
|
|
86 N_("DoubleSize"), G_CALLBACK(action_view_doublesize) , FALSE },
|
|
87
|
|
88 { "view easy move", NULL , N_("Easy Move"), "<Ctrl>E",
|
|
89 N_("Easy Move"), G_CALLBACK(action_view_easymove) , FALSE }
|
|
90 };
|
|
91
|
|
92
|
|
93
|
|
94 /* radio action entries */
|
|
95
|
|
96 static GtkRadioActionEntry radioaction_entries_vismode[] = {
|
|
97 { "vismode analyzer", NULL , N_("Analyzer"), NULL, N_("Analyzer"), VIS_ANALYZER },
|
|
98 { "vismode scope", NULL , N_("Scope"), NULL, N_("Scope"), VIS_SCOPE },
|
|
99 { "vismode voiceprint", NULL , N_("Voiceprint"), NULL, N_("Voiceprint"), VIS_VOICEPRINT },
|
|
100 { "vismode off", NULL , N_("Off"), NULL, N_("Off"), VIS_OFF }
|
|
101 };
|
|
102
|
|
103 static GtkRadioActionEntry radioaction_entries_anamode[] = {
|
|
104 { "anamode normal", NULL , N_("Normal"), NULL, N_("Normal"), ANALYZER_NORMAL },
|
|
105 { "anamode fire", NULL , N_("Fire"), NULL, N_("Fire"), ANALYZER_FIRE },
|
|
106 { "anamode vertical lines", NULL , N_("Vertical Lines"), NULL, N_("Vertical Lines"), ANALYZER_VLINES }
|
|
107 };
|
|
108
|
|
109 static GtkRadioActionEntry radioaction_entries_anatype[] = {
|
|
110 { "anatype lines", NULL , N_("Lines"), NULL, N_("Lines"), ANALYZER_LINES },
|
|
111 { "anatype bars", NULL , N_("Bars"), NULL, N_("Bars"), ANALYZER_BARS }
|
|
112 };
|
|
113
|
|
114 static GtkRadioActionEntry radioaction_entries_scomode[] = {
|
|
115 { "scomode dot", NULL , N_("Dot Scope"), NULL, N_("Dot Scope"), SCOPE_DOT },
|
|
116 { "scomode line", NULL , N_("Line Scope"), NULL, N_("Line Scope"), SCOPE_LINE },
|
|
117 { "scomode solid", NULL , N_("Solid Scope"), NULL, N_("Solid Scope"), SCOPE_SOLID }
|
|
118 };
|
|
119
|
|
120 static GtkRadioActionEntry radioaction_entries_vprmode[] = {
|
|
121 { "vprmode normal", NULL , N_("Normal"), NULL, N_("Normal"), VOICEPRINT_NORMAL },
|
|
122 { "vprmode fire", NULL , N_("Fire"), NULL, N_("Fire"), VOICEPRINT_FIRE },
|
|
123 { "vprmode ice", NULL , N_("Ice"), NULL, N_("Ice"), VOICEPRINT_ICE }
|
|
124 };
|
|
125
|
|
126 static GtkRadioActionEntry radioaction_entries_wshmode[] = {
|
|
127 { "wshmode normal", NULL , N_("Normal"), NULL, N_("Normal"), VU_NORMAL },
|
|
128 { "wshmode smooth", NULL , N_("Smooth"), NULL, N_("Smooth"), VU_SMOOTH }
|
|
129 };
|
|
130
|
|
131 static GtkRadioActionEntry radioaction_entries_refrate[] = {
|
|
132 { "refrate full", NULL , N_("Full (~50 fps)"), NULL, N_("Full (~50 fps)"), REFRESH_FULL },
|
|
133 { "refrate half", NULL , N_("Half (~25 fps)"), NULL, N_("Half (~25 fps)"), REFRESH_HALF },
|
|
134 { "refrate quarter", NULL , N_("Quarter (~13 fps)"), NULL, N_("Quarter (~13 fps)"), REFRESH_QUARTER },
|
|
135 { "refrate eighth", NULL , N_("Eighth (~6 fps)"), NULL, N_("Eighth (~6 fps)"), REFRESH_EIGTH }
|
|
136 };
|
|
137
|
|
138 static GtkRadioActionEntry radioaction_entries_anafoff[] = {
|
|
139 { "anafoff slowest", NULL , N_("Slowest"), NULL, N_("Slowest"), FALLOFF_SLOWEST },
|
|
140 { "anafoff slow", NULL , N_("Slow"), NULL, N_("Slow"), FALLOFF_SLOW },
|
|
141 { "anafoff medium", NULL , N_("Medium"), NULL, N_("Medium"), FALLOFF_MEDIUM },
|
|
142 { "anafoff fast", NULL , N_("Fast"), NULL, N_("Fast"), FALLOFF_FAST },
|
|
143 { "anafoff fastest", NULL , N_("Fastest"), NULL, N_("Fastest"), FALLOFF_FASTEST }
|
|
144 };
|
|
145
|
|
146 static GtkRadioActionEntry radioaction_entries_peafoff[] = {
|
|
147 { "peafoff slowest", NULL , N_("Slowest"), NULL, N_("Slowest"), FALLOFF_SLOWEST },
|
|
148 { "peafoff slow", NULL , N_("Slow"), NULL, N_("Slow"), FALLOFF_SLOW },
|
|
149 { "peafoff medium", NULL , N_("Medium"), NULL, N_("Medium"), FALLOFF_MEDIUM },
|
|
150 { "peafoff fast", NULL , N_("Fast"), NULL, N_("Fast"), FALLOFF_FAST },
|
|
151 { "peafoff fastest", NULL , N_("Fastest"), NULL, N_("Fastest"), FALLOFF_FASTEST }
|
|
152 };
|
|
153
|
|
154 static GtkRadioActionEntry radioaction_entries_viewtime[] = {
|
|
155 { "view time elapsed", NULL , N_("Time Elapsed"), "<Ctrl>E", N_("Time Elapsed"), TIMER_ELAPSED },
|
|
156 { "view time remaining", NULL , N_("Time Remaining"), "<Ctrl>R", N_("Time Remaining"), TIMER_REMAINING }
|
|
157 };
|
|
158
|
|
159
|
|
160
|
|
161 /* normal actions */
|
|
162
|
|
163 static GtkActionEntry action_entries_playback[] = {
|
|
164
|
|
165 { "playback", NULL, N_("Playback") },
|
|
166
|
|
167 { "playback play cd", GTK_STOCK_CDROM , N_("Play CD"), "<Alt>C",
|
|
168 N_("Play CD"), G_CALLBACK(action_playback_playcd) },
|
|
169
|
|
170 { "playback play", GTK_STOCK_MEDIA_PLAY , N_("Play"), "X",
|
|
171 N_("Play"), G_CALLBACK(action_playback_play) },
|
|
172
|
|
173 { "playback pause", GTK_STOCK_MEDIA_PAUSE , N_("Pause"), "C",
|
|
174 N_("Pause"), G_CALLBACK(action_playback_pause) },
|
|
175
|
|
176 { "playback stop", GTK_STOCK_MEDIA_STOP , N_("Stop"), "V",
|
|
177 N_("Stop"), G_CALLBACK(action_playback_stop) },
|
|
178
|
|
179 { "playback previous", GTK_STOCK_MEDIA_PREVIOUS , N_("Previous"), "Z",
|
|
180 N_("Previous"), G_CALLBACK(action_playback_previous) },
|
|
181
|
|
182 { "playback next", GTK_STOCK_MEDIA_NEXT , N_("Next"), "B",
|
|
183 N_("Next"), G_CALLBACK(action_playback_next) }
|
|
184 };
|
|
185
|
|
186
|
|
187 static GtkActionEntry action_entries_visualization[] = {
|
|
188 { "visualization", NULL, N_("Visualization") },
|
|
189 { "vismode", NULL, N_("Visualization Mode") },
|
|
190 { "anamode", NULL, N_("Analyzer Mode") },
|
|
191 { "scomode", NULL, N_("Scope Mode") },
|
|
192 { "vprmode", NULL, N_("Voiceprint Mode") },
|
|
193 { "wshmode", NULL, N_("WindowShade VU Mode") },
|
|
194 { "refrate", NULL, N_("Refresh Rate") },
|
|
195 { "anafoff", NULL, N_("Analyzer Falloff") },
|
|
196 { "peafoff", NULL, N_("Peaks Falloff") }
|
|
197 };
|
|
198
|
|
199 static GtkActionEntry action_entries_playlist[] = {
|
|
200
|
|
201 { "playlist", NULL, N_("Playlist") },
|
|
202
|
|
203 { "playlist new", GTK_STOCK_NEW , N_("New Playlist"), "<Shift>N",
|
|
204 N_("New Playlist"), G_CALLBACK(action_playlist_new) },
|
|
205
|
|
206 { "playlist select next", GTK_STOCK_MEDIA_NEXT, N_("Select Next Playlist"), "<Shift>P",
|
|
207 N_("Select Next Playlist"), G_CALLBACK(action_playlist_next) },
|
|
208
|
|
209 { "playlist select previous", GTK_STOCK_MEDIA_PREVIOUS, N_("Select Previous Playlist"), "<Shift><Ctrl>P",
|
|
210 N_("Select Previous Playlist"), G_CALLBACK(action_playlist_prev) },
|
|
211
|
|
212 { "playlist delete", GTK_STOCK_DELETE , N_("Delete Playlist"), "<Shift>D",
|
|
213 N_("Delete Playlist"), G_CALLBACK(action_playlist_delete) },
|
|
214
|
|
215 { "playlist load", GTK_STOCK_OPEN, N_("Load List"), "O",
|
|
216 N_("Loads a playlist file into the selected playlist."), G_CALLBACK(action_playlist_load_list) },
|
|
217
|
|
218 { "playlist save", GTK_STOCK_SAVE, N_("Save List"), "<Shift>S",
|
|
219 N_("Saves the selected playlist."), G_CALLBACK(action_playlist_save_list) },
|
|
220
|
|
221 { "playlist save default", GTK_STOCK_SAVE, N_("Save Default List"), "<Alt>S",
|
|
222 N_("Saves the selected playlist to the default location."),
|
|
223 G_CALLBACK(action_playlist_save_default_list) },
|
|
224
|
|
225 { "playlist refresh", GTK_STOCK_REFRESH, N_("Refresh List"), "F5",
|
|
226 N_("Refreshes metadata associated with a playlist entry."),
|
|
227 G_CALLBACK(action_playlist_refresh_list) },
|
|
228
|
|
229 { "playlist manager", AUD_STOCK_PLAYLIST , N_("List Manager"), "P",
|
|
230 N_("Opens the playlist manager."),
|
|
231 G_CALLBACK(action_open_list_manager) }
|
|
232 };
|
|
233
|
|
234 static GtkActionEntry action_entries_view[] = {
|
|
235
|
|
236 { "view", NULL, N_("View") }
|
|
237 };
|
|
238
|
|
239 static GtkActionEntry action_entries_playlist_add[] = {
|
|
240 { "playlist add cd", GTK_STOCK_CDROM, N_("Add CD..."), "<Shift>C",
|
|
241 N_("Adds a CD to the playlist."),
|
|
242 G_CALLBACK(action_playlist_add_cd) },
|
|
243
|
|
244 { "playlist add url", GTK_STOCK_NETWORK, N_("Add Internet Address..."), "<Ctrl>H",
|
|
245 N_("Adds a remote track to the playlist."),
|
|
246 G_CALLBACK(action_playlist_add_url) },
|
|
247
|
|
248 { "playlist add files", GTK_STOCK_ADD, N_("Add Files..."), "F",
|
|
249 N_("Adds files to the playlist."),
|
|
250 G_CALLBACK(action_playlist_add_files) },
|
|
251 };
|
|
252
|
|
253 static GtkActionEntry action_entries_playlist_select[] = {
|
|
254 { "playlist search and select", GTK_STOCK_FIND, N_("Search and Select"), "<Ctrl>F",
|
|
255 N_("Searches the playlist and selects playlist entries based on specific criteria."),
|
|
256 G_CALLBACK(action_playlist_search_and_select) },
|
|
257
|
|
258 { "playlist invert selection", AUD_STOCK_SELECTINVERT , N_("Invert Selection"), NULL,
|
|
259 N_("Inverts the selected and unselected entries."),
|
|
260 G_CALLBACK(action_playlist_invert_selection) },
|
|
261
|
|
262 { "playlist select all", AUD_STOCK_SELECTALL , N_("Select All"), "<Ctrl>A",
|
|
263 N_("Selects all of the playlist entries."),
|
|
264 G_CALLBACK(action_playlist_select_all) },
|
|
265
|
|
266 { "playlist select none", AUD_STOCK_SELECTNONE , N_("Select None"), "<Shift><Ctrl>A",
|
|
267 N_("Deselects all of the playlist entries."),
|
|
268 G_CALLBACK(action_playlist_select_none) },
|
|
269 };
|
|
270
|
|
271 static GtkActionEntry action_entries_playlist_delete[] = {
|
|
272 { "playlist clear queue", GTK_STOCK_REMOVE, N_("Clear Queue"), "<Shift>Q",
|
|
273 N_("Clears the queue associated with this playlist."),
|
|
274 G_CALLBACK(action_playlist_clear_queue) },
|
|
275
|
|
276 { "playlist remove unavailable", AUD_STOCK_REMOVEUNAVAIL , N_("Remove Unavailable Files"), NULL,
|
|
277 N_("Removes unavailable files from the playlist."),
|
|
278 G_CALLBACK(action_playlist_remove_unavailable) },
|
|
279
|
|
280 { "playlist remove dups menu", AUD_STOCK_REMOVEDUPS , N_("Remove Duplicates") },
|
|
281
|
|
282 { "playlist remove dups by title", AUD_STOCK_REMOVEDUPS , N_("By Title"), NULL,
|
|
283 N_("Removes duplicate entries from the playlist by title."),
|
|
284 G_CALLBACK(action_playlist_remove_dupes_by_title) },
|
|
285
|
|
286 { "playlist remove dups by filename", AUD_STOCK_REMOVEDUPS , N_("By Filename"), NULL,
|
|
287 N_("Removes duplicate entries from the playlist by filename."),
|
|
288 G_CALLBACK(action_playlist_remove_dupes_by_filename) },
|
|
289
|
|
290 { "playlist remove dups by full path", AUD_STOCK_REMOVEDUPS , N_("By Path + Filename"), NULL,
|
|
291 N_("Removes duplicate entries from the playlist by their full path."),
|
|
292 G_CALLBACK(action_playlist_remove_dupes_by_full_path) },
|
|
293
|
|
294 { "playlist remove all", GTK_STOCK_CLEAR, N_("Remove All"), NULL,
|
|
295 N_("Removes all entries from the playlist."),
|
|
296 G_CALLBACK(action_playlist_remove_all) },
|
|
297
|
|
298 { "playlist remove unselected", GTK_STOCK_REMOVE, N_("Remove Unselected"), NULL,
|
|
299 N_("Remove unselected entries from the playlist."),
|
|
300 G_CALLBACK(action_playlist_remove_unselected) },
|
|
301
|
|
302 { "playlist remove selected", GTK_STOCK_REMOVE, N_("Remove Selected"), "Delete",
|
|
303 N_("Remove selected entries from the playlist."),
|
|
304 G_CALLBACK(action_playlist_remove_selected) },
|
|
305 };
|
|
306
|
|
307 static GtkActionEntry action_entries_playlist_sort[] = {
|
|
308 { "playlist randomize list", AUD_STOCK_RANDOMIZEPL , N_("Randomize List"), "<Ctrl><Shift>R",
|
|
309 N_("Randomizes the playlist."),
|
|
310 G_CALLBACK(action_playlist_randomize_list) },
|
|
311
|
|
312 { "playlist reverse list", AUD_STOCK_INVERTPL , N_("Reverse List"), NULL,
|
|
313 N_("Reverses the playlist."),
|
|
314 G_CALLBACK(action_playlist_reverse_list) },
|
|
315
|
|
316 { "playlist sort menu", AUD_STOCK_SORTBYTITLE , N_("Sort List") },
|
|
317
|
|
318 { "playlist sort by title", AUD_STOCK_SORTBYTITLE , N_("By Title"), NULL,
|
|
319 N_("Sorts the list by title."),
|
|
320 G_CALLBACK(action_playlist_sort_by_title) },
|
|
321
|
|
322 { "playlist sort by artist", AUD_STOCK_SORTBYARTIST , N_("By Artist"), NULL,
|
|
323 N_("Sorts the list by artist."),
|
|
324 G_CALLBACK(action_playlist_sort_by_artist) },
|
|
325
|
|
326 { "playlist sort by filename", AUD_STOCK_SORTBYFILENAME , N_("By Filename"), NULL,
|
|
327 N_("Sorts the list by filename."),
|
|
328 G_CALLBACK(action_playlist_sort_by_filename) },
|
|
329
|
|
330 { "playlist sort by full path", AUD_STOCK_SORTBYPATHFILE , N_("By Path + Filename"), NULL,
|
|
331 N_("Sorts the list by full pathname."),
|
|
332 G_CALLBACK(action_playlist_sort_by_full_path) },
|
|
333
|
|
334 { "playlist sort by date", AUD_STOCK_SORTBYARTIST , N_("By Date"), NULL,
|
|
335 N_("Sorts the list by modification time."),
|
|
336 G_CALLBACK(action_playlist_sort_by_date) },
|
|
337
|
|
338 { "playlist sort by track number", AUD_STOCK_SORTBYFILENAME , N_("By Track Number"), NULL,
|
|
339 N_("Sorts the list by track number."),
|
|
340 G_CALLBACK(action_playlist_sort_by_track_number) },
|
|
341
|
|
342 { "playlist sort by playlist entry", AUD_STOCK_SORTBYPATHFILE , N_("By Playlist Entry"), NULL,
|
|
343 N_("Sorts the list by playlist entry."),
|
|
344 G_CALLBACK(action_playlist_sort_by_playlist_entry) },
|
|
345
|
|
346 { "playlist sort selected menu", AUD_STOCK_SORTBYTITLE , N_("Sort Selected") },
|
|
347
|
|
348 { "playlist sort selected by title", AUD_STOCK_SORTBYTITLE , N_("By Title"), NULL,
|
|
349 N_("Sorts the list by title."),
|
|
350 G_CALLBACK(action_playlist_sort_selected_by_title) },
|
|
351
|
|
352 { "playlist sort selected by artist", AUD_STOCK_SORTBYARTIST, N_("By Artist"), NULL,
|
|
353 N_("Sorts the list by artist."),
|
|
354 G_CALLBACK(action_playlist_sort_selected_by_artist) },
|
|
355
|
|
356 { "playlist sort selected by filename", AUD_STOCK_SORTBYFILENAME , N_("By Filename"), NULL,
|
|
357 N_("Sorts the list by filename."),
|
|
358 G_CALLBACK(action_playlist_sort_selected_by_filename) },
|
|
359
|
|
360 { "playlist sort selected by full path", AUD_STOCK_SORTBYPATHFILE , N_("By Path + Filename"), NULL,
|
|
361 N_("Sorts the list by full pathname."),
|
|
362 G_CALLBACK(action_playlist_sort_selected_by_full_path) },
|
|
363
|
|
364 { "playlist sort selected by date", AUD_STOCK_SORTBYARTIST , N_("By Date"), NULL,
|
|
365 N_("Sorts the list by modification time."),
|
|
366 G_CALLBACK(action_playlist_sort_selected_by_date) },
|
|
367
|
|
368 { "playlist sort selected by track number", AUD_STOCK_SORTBYFILENAME , N_("By Track Number"), NULL,
|
|
369 N_("Sorts the list by track number."),
|
|
370 G_CALLBACK(action_playlist_sort_selected_by_track_number) },
|
|
371
|
|
372 { "playlist sort selected by playlist entry", AUD_STOCK_SORTBYPATHFILE, N_("By Playlist Entry"), NULL,
|
|
373 N_("Sorts the list by playlist entry."),
|
|
374 G_CALLBACK(action_playlist_sort_selected_by_playlist_entry) },
|
|
375 };
|
|
376
|
|
377 static GtkActionEntry action_entries_others[] = {
|
|
378
|
|
379 { "dummy", NULL, "dummy" },
|
|
380
|
|
381 { "current track info", AUD_STOCK_INFO , N_("View Track Details"), "I",
|
|
382 N_("View track details"), G_CALLBACK(action_current_track_info) },
|
|
383
|
|
384 { "playlist track info", AUD_STOCK_INFO , N_("View Track Details"), "<Alt>I",
|
|
385 N_("View track details"), G_CALLBACK(action_playlist_track_info) },
|
|
386
|
|
387 { "about audacious", GTK_STOCK_DIALOG_INFO , N_("About Audacious"), NULL,
|
|
388 N_("About Audacious"), G_CALLBACK(action_about_audacious) },
|
|
389
|
|
390 { "play file", GTK_STOCK_OPEN , N_("Play File"), "L",
|
|
391 N_("Load and play a file"), G_CALLBACK(action_play_file) },
|
|
392
|
|
393 { "play location", GTK_STOCK_NETWORK , N_("Play Location"), "<Ctrl>L",
|
|
394 N_("Play media from the selected location"), G_CALLBACK(action_play_location) },
|
|
395
|
|
396 { "preferences", GTK_STOCK_PREFERENCES , N_("Preferences"), "<Ctrl>P",
|
|
397 N_("Open preferences window"), G_CALLBACK(action_preferences) },
|
|
398
|
|
399 { "quit", GTK_STOCK_QUIT , N_("_Quit"), NULL,
|
|
400 N_("Quit Audacious"), G_CALLBACK(action_quit) },
|
|
401
|
|
402 { "ab set", NULL , N_("Set A-B"), "A",
|
|
403 N_("Set A-B"), G_CALLBACK(action_ab_set) },
|
|
404
|
2598
|
405 { "ab clear", NULL , N_("Clear A-B"), "<Shift>A",
|
2313
|
406 N_("Clear A-B"), G_CALLBACK(action_ab_clear) },
|
|
407
|
|
408 { "jump to playlist start", GTK_STOCK_GOTO_TOP , N_("Jump to Playlist Start"), "<Ctrl>Z",
|
|
409 N_("Jump to Playlist Start"), G_CALLBACK(action_jump_to_playlist_start) },
|
|
410
|
|
411 { "jump to file", GTK_STOCK_JUMP_TO , N_("Jump to File"), "J",
|
|
412 N_("Jump to File"), G_CALLBACK(action_jump_to_file) },
|
|
413
|
|
414 { "jump to time", GTK_STOCK_JUMP_TO , N_("Jump to Time"), "<Ctrl>J",
|
|
415 N_("Jump to Time"), G_CALLBACK(action_jump_to_time) },
|
|
416
|
|
417 { "queue toggle", AUD_STOCK_QUEUETOGGLE , N_("Queue Toggle"), "Q",
|
|
418 N_("Enables/disables the entry in the playlist's queue."),
|
|
419 G_CALLBACK(action_queue_toggle) },
|
|
420 };
|
|
421
|
|
422
|
|
423 static GtkActionEntry action_entries_equalizer[] = {
|
|
424
|
|
425 { "equ preset load menu", NULL, N_("Load") },
|
|
426 { "equ preset import menu", NULL, N_("Import") },
|
|
427 { "equ preset save menu", NULL, N_("Save") },
|
|
428 { "equ preset delete menu", NULL, N_("Delete") },
|
|
429
|
|
430 { "equ load preset", NULL, N_("Preset"), NULL,
|
|
431 N_("Load preset"), G_CALLBACK(action_equ_load_preset) },
|
|
432
|
|
433 { "equ load auto preset", NULL, N_("Auto-load preset"), NULL,
|
|
434 N_("Load auto-load preset"), G_CALLBACK(action_equ_load_auto_preset) },
|
|
435
|
|
436 { "equ load default preset", NULL, N_("Default"), NULL,
|
|
437 N_("Load default preset into equalizer"), G_CALLBACK(action_equ_load_default_preset) },
|
|
438
|
|
439 { "equ zero preset", NULL, N_("Zero"), NULL,
|
|
440 N_("Set equalizer preset levels to zero"), G_CALLBACK(action_equ_zero_preset) },
|
|
441
|
|
442 { "equ load preset file", NULL, N_("From file"), NULL,
|
|
443 N_("Load preset from file"), G_CALLBACK(action_equ_load_preset_file) },
|
|
444
|
|
445 { "equ load preset eqf", NULL, N_("From WinAMP EQF file"), NULL,
|
|
446 N_("Load preset from WinAMP EQF file"), G_CALLBACK(action_equ_load_preset_eqf) },
|
|
447
|
|
448 { "equ import winamp presets", NULL, N_("WinAMP Presets"), NULL,
|
|
449 N_("Import WinAMP presets"), G_CALLBACK(action_equ_import_winamp_presets) },
|
|
450
|
|
451 { "equ save preset", NULL, N_("Preset"), NULL,
|
|
452 N_("Save preset"), G_CALLBACK(action_equ_save_preset) },
|
|
453
|
|
454 { "equ save auto preset", NULL, N_("Auto-load preset"), NULL,
|
|
455 N_("Save auto-load preset"), G_CALLBACK(action_equ_save_auto_preset) },
|
|
456
|
|
457 { "equ save default preset", NULL, N_("Default"), NULL,
|
|
458 N_("Save default preset"), G_CALLBACK(action_equ_save_default_preset) },
|
|
459
|
|
460 { "equ save preset file", NULL, N_("To file"), NULL,
|
|
461 N_("Save preset to file"), G_CALLBACK(action_equ_save_preset_file) },
|
|
462
|
|
463 { "equ save preset eqf", NULL, N_("To WinAMP EQF file"), NULL,
|
|
464 N_("Save preset to WinAMP EQF file"), G_CALLBACK(action_equ_save_preset_eqf) },
|
|
465
|
|
466 { "equ delete preset", NULL, N_("Preset"), NULL,
|
|
467 N_("Delete preset"), G_CALLBACK(action_equ_delete_preset) },
|
|
468
|
|
469 { "equ delete auto preset", NULL, N_("Auto-load preset"), NULL,
|
|
470 N_("Delete auto-load preset"), G_CALLBACK(action_equ_delete_auto_preset) }
|
|
471 };
|
|
472
|
|
473
|
|
474
|
|
475 /* ***************************** */
|
|
476
|
|
477
|
|
478 static GtkActionGroup *
|
|
479 ui_manager_new_action_group( const gchar * group_name )
|
|
480 {
|
|
481 GtkActionGroup *group = gtk_action_group_new( group_name );
|
|
482 gtk_action_group_set_translation_domain( group , PACKAGE_NAME );
|
|
483 return group;
|
|
484 }
|
|
485
|
|
486 void
|
|
487 ui_manager_init ( void )
|
|
488 {
|
|
489 /* toggle actions */
|
|
490 toggleaction_group_others = ui_manager_new_action_group("toggleaction_others");
|
|
491 gtk_action_group_add_toggle_actions(
|
|
492 toggleaction_group_others , toggleaction_entries_others ,
|
|
493 G_N_ELEMENTS(toggleaction_entries_others) , NULL );
|
|
494
|
|
495 /* radio actions */
|
|
496 radioaction_group_anamode = ui_manager_new_action_group("radioaction_anamode");
|
|
497 gtk_action_group_add_radio_actions(
|
|
498 radioaction_group_anamode , radioaction_entries_anamode ,
|
|
499 G_N_ELEMENTS(radioaction_entries_anamode) , 0 , G_CALLBACK(action_anamode) , NULL );
|
|
500
|
|
501 radioaction_group_anatype = ui_manager_new_action_group("radioaction_anatype");
|
|
502 gtk_action_group_add_radio_actions(
|
|
503 radioaction_group_anatype , radioaction_entries_anatype ,
|
|
504 G_N_ELEMENTS(radioaction_entries_anatype) , 0 , G_CALLBACK(action_anatype) , NULL );
|
|
505
|
|
506 radioaction_group_scomode = ui_manager_new_action_group("radioaction_scomode");
|
|
507 gtk_action_group_add_radio_actions(
|
|
508 radioaction_group_scomode , radioaction_entries_scomode ,
|
|
509 G_N_ELEMENTS(radioaction_entries_scomode) , 0 , G_CALLBACK(action_scomode) , NULL );
|
|
510
|
|
511 radioaction_group_vprmode = ui_manager_new_action_group("radioaction_vprmode");
|
|
512 gtk_action_group_add_radio_actions(
|
|
513 radioaction_group_vprmode , radioaction_entries_vprmode ,
|
|
514 G_N_ELEMENTS(radioaction_entries_vprmode) , 0 , G_CALLBACK(action_vprmode) , NULL );
|
|
515
|
|
516 radioaction_group_wshmode = ui_manager_new_action_group("radioaction_wshmode");
|
|
517 gtk_action_group_add_radio_actions(
|
|
518 radioaction_group_wshmode , radioaction_entries_wshmode ,
|
|
519 G_N_ELEMENTS(radioaction_entries_wshmode) , 0 , G_CALLBACK(action_wshmode) , NULL );
|
|
520
|
|
521 radioaction_group_refrate = ui_manager_new_action_group("radioaction_refrate");
|
|
522 gtk_action_group_add_radio_actions(
|
|
523 radioaction_group_refrate , radioaction_entries_refrate ,
|
|
524 G_N_ELEMENTS(radioaction_entries_refrate) , 0 , G_CALLBACK(action_refrate) , NULL );
|
|
525
|
|
526 radioaction_group_anafoff = ui_manager_new_action_group("radioaction_anafoff");
|
|
527 gtk_action_group_add_radio_actions(
|
|
528 radioaction_group_anafoff , radioaction_entries_anafoff ,
|
|
529 G_N_ELEMENTS(radioaction_entries_anafoff) , 0 , G_CALLBACK(action_anafoff) , NULL );
|
|
530
|
|
531 radioaction_group_peafoff = ui_manager_new_action_group("radioaction_peafoff");
|
|
532 gtk_action_group_add_radio_actions(
|
|
533 radioaction_group_peafoff , radioaction_entries_peafoff ,
|
|
534 G_N_ELEMENTS(radioaction_entries_peafoff) , 0 , G_CALLBACK(action_peafoff) , NULL );
|
|
535
|
|
536 radioaction_group_vismode = ui_manager_new_action_group("radioaction_vismode");
|
|
537 gtk_action_group_add_radio_actions(
|
|
538 radioaction_group_vismode , radioaction_entries_vismode ,
|
|
539 G_N_ELEMENTS(radioaction_entries_vismode) , 0 , G_CALLBACK(action_vismode) , NULL );
|
|
540
|
|
541 radioaction_group_viewtime = ui_manager_new_action_group("radioaction_viewtime");
|
|
542 gtk_action_group_add_radio_actions(
|
|
543 radioaction_group_viewtime , radioaction_entries_viewtime ,
|
|
544 G_N_ELEMENTS(radioaction_entries_viewtime) , 0 , G_CALLBACK(action_viewtime) , NULL );
|
|
545
|
|
546 /* normal actions */
|
|
547 action_group_playback = ui_manager_new_action_group("action_playback");
|
|
548 gtk_action_group_add_actions(
|
|
549 action_group_playback , action_entries_playback ,
|
|
550 G_N_ELEMENTS(action_entries_playback) , NULL );
|
|
551
|
|
552 action_group_playlist = ui_manager_new_action_group("action_playlist");
|
|
553 gtk_action_group_add_actions(
|
|
554 action_group_playlist , action_entries_playlist ,
|
|
555 G_N_ELEMENTS(action_entries_playlist) , NULL );
|
|
556
|
|
557 action_group_visualization = ui_manager_new_action_group("action_visualization");
|
|
558 gtk_action_group_add_actions(
|
|
559 action_group_visualization , action_entries_visualization ,
|
|
560 G_N_ELEMENTS(action_entries_visualization) , NULL );
|
|
561
|
|
562 action_group_view = ui_manager_new_action_group("action_view");
|
|
563 gtk_action_group_add_actions(
|
|
564 action_group_view , action_entries_view ,
|
|
565 G_N_ELEMENTS(action_entries_view) , NULL );
|
|
566
|
|
567 action_group_others = ui_manager_new_action_group("action_others");
|
|
568 gtk_action_group_add_actions(
|
|
569 action_group_others , action_entries_others ,
|
|
570 G_N_ELEMENTS(action_entries_others) , NULL );
|
|
571
|
|
572 action_group_playlist_add = ui_manager_new_action_group("action_playlist_add");
|
|
573 gtk_action_group_add_actions(
|
|
574 action_group_playlist_add, action_entries_playlist_add,
|
|
575 G_N_ELEMENTS(action_entries_playlist_add), NULL );
|
|
576
|
|
577 action_group_playlist_select = ui_manager_new_action_group("action_playlist_select");
|
|
578 gtk_action_group_add_actions(
|
|
579 action_group_playlist_select, action_entries_playlist_select,
|
|
580 G_N_ELEMENTS(action_entries_playlist_select), NULL );
|
|
581
|
|
582 action_group_playlist_delete = ui_manager_new_action_group("action_playlist_delete");
|
|
583 gtk_action_group_add_actions(
|
|
584 action_group_playlist_delete, action_entries_playlist_delete,
|
|
585 G_N_ELEMENTS(action_entries_playlist_delete), NULL );
|
|
586
|
|
587 action_group_playlist_sort = ui_manager_new_action_group("action_playlist_sort");
|
|
588 gtk_action_group_add_actions(
|
|
589 action_group_playlist_sort, action_entries_playlist_sort,
|
|
590 G_N_ELEMENTS(action_entries_playlist_sort), NULL );
|
|
591
|
|
592 action_group_equalizer = ui_manager_new_action_group("action_equalizer");
|
|
593 gtk_action_group_add_actions(
|
|
594 action_group_equalizer, action_entries_equalizer,
|
|
595 G_N_ELEMENTS(action_entries_equalizer), NULL);
|
|
596
|
|
597 /* ui */
|
|
598 ui_manager = gtk_ui_manager_new();
|
|
599 gtk_ui_manager_insert_action_group( ui_manager , toggleaction_group_others , 0 );
|
|
600 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_anamode , 0 );
|
|
601 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_anatype , 0 );
|
|
602 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_scomode , 0 );
|
|
603 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_vprmode , 0 );
|
|
604 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_wshmode , 0 );
|
|
605 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_refrate , 0 );
|
|
606 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_anafoff , 0 );
|
|
607 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_peafoff , 0 );
|
|
608 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_vismode , 0 );
|
|
609 gtk_ui_manager_insert_action_group( ui_manager , radioaction_group_viewtime , 0 );
|
|
610 gtk_ui_manager_insert_action_group( ui_manager , action_group_playback , 0 );
|
|
611 gtk_ui_manager_insert_action_group( ui_manager , action_group_playlist , 0 );
|
|
612 gtk_ui_manager_insert_action_group( ui_manager , action_group_visualization , 0 );
|
|
613 gtk_ui_manager_insert_action_group( ui_manager , action_group_view , 0 );
|
|
614 gtk_ui_manager_insert_action_group( ui_manager , action_group_others , 0 );
|
|
615 gtk_ui_manager_insert_action_group( ui_manager , action_group_playlist_add , 0 );
|
|
616 gtk_ui_manager_insert_action_group( ui_manager , action_group_playlist_select , 0 );
|
|
617 gtk_ui_manager_insert_action_group( ui_manager , action_group_playlist_delete , 0 );
|
|
618 gtk_ui_manager_insert_action_group( ui_manager , action_group_playlist_sort , 0 );
|
|
619 gtk_ui_manager_insert_action_group( ui_manager , action_group_equalizer , 0 );
|
|
620
|
|
621 return;
|
|
622 }
|
|
623
|
|
624
|
|
625 void
|
|
626 ui_manager_create_menus ( void )
|
|
627 {
|
|
628 GError *gerr = NULL;
|
|
629
|
|
630 /* attach xml menu definitions */
|
|
631 gtk_ui_manager_add_ui_from_file( ui_manager , DATA_DIR "/ui/mainwin.ui" , &gerr );
|
|
632
|
|
633 if ( gerr != NULL )
|
|
634 {
|
|
635 g_critical( "Error creating UI<ui/mainwin.ui>: %s" , gerr->message );
|
|
636 g_error_free( gerr );
|
|
637 return;
|
|
638 }
|
|
639
|
|
640 /* create GtkMenu widgets using path from xml definitions */
|
|
641 mainwin_songname_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/songname-menu" );
|
|
642 mainwin_visualization_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu/visualization" );
|
|
643 mainwin_playback_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu/playback" );
|
|
644 mainwin_playlist_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu/playlist" );
|
|
645 mainwin_view_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu/view" );
|
|
646 mainwin_general_menu = ui_manager_get_popup_menu( ui_manager , "/mainwin-menus/main-menu" );
|
|
647
|
|
648 gtk_ui_manager_add_ui_from_file( ui_manager , DATA_DIR "/ui/playlist.ui" , &gerr );
|
|
649
|
|
650 if ( gerr != NULL )
|
|
651 {
|
|
652 g_critical( "Error creating UI<ui/playlist.ui>: %s" , gerr->message );
|
|
653 g_error_free( gerr );
|
|
654 return;
|
|
655 }
|
|
656
|
|
657 playlistwin_popup_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/playlist-rightclick-menu");
|
|
658
|
|
659 playlistwin_pladd_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/add-menu");
|
|
660 playlistwin_pldel_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/del-menu");
|
|
661 playlistwin_plsel_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/select-menu");
|
|
662 playlistwin_plsort_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/misc-menu");
|
|
663 playlistwin_pllist_menu = ui_manager_get_popup_menu(ui_manager, "/playlist-menus/playlist-menu");
|
|
664
|
|
665 gtk_ui_manager_add_ui_from_file( ui_manager , DATA_DIR "/ui/equalizer.ui" , &gerr );
|
|
666
|
|
667 if ( gerr != NULL )
|
|
668 {
|
|
669 g_critical( "Error creating UI<ui/equalizer.ui>: %s" , gerr->message );
|
|
670 g_error_free( gerr );
|
|
671 return;
|
|
672 }
|
|
673
|
|
674 equalizerwin_presets_menu = ui_manager_get_popup_menu(ui_manager, "/equalizer-menus/preset-menu");
|
|
675
|
|
676 return;
|
|
677 }
|
|
678
|
|
679
|
|
680 GtkAccelGroup *
|
|
681 ui_manager_get_accel_group ( void )
|
|
682 {
|
|
683 return gtk_ui_manager_get_accel_group( ui_manager );
|
|
684 }
|
|
685
|
|
686
|
|
687 GtkWidget *
|
|
688 ui_manager_get_popup_menu ( GtkUIManager * self , const gchar * path )
|
|
689 {
|
|
690 GtkWidget *menu_item = gtk_ui_manager_get_widget( self , path );
|
|
691
|
|
692 if (GTK_IS_MENU_ITEM(menu_item))
|
|
693 return gtk_menu_item_get_submenu(GTK_MENU_ITEM(menu_item));
|
|
694 else
|
|
695 return NULL;
|
|
696 }
|
|
697
|
|
698
|
|
699 static void
|
|
700 menu_popup_pos_func (GtkMenu * menu , gint * x , gint * y , gboolean * push_in , gint * point )
|
|
701 {
|
|
702 GtkRequisition requisition;
|
|
703 gint screen_width;
|
|
704 gint screen_height;
|
|
705
|
|
706 gtk_widget_size_request(GTK_WIDGET(menu), &requisition);
|
|
707
|
|
708 screen_width = gdk_screen_width();
|
|
709 screen_height = gdk_screen_height();
|
|
710
|
|
711 *x = CLAMP(point[0] - 2, 0, MAX(0, screen_width - requisition.width));
|
|
712 *y = CLAMP(point[1] - 2, 0, MAX(0, screen_height - requisition.height));
|
|
713
|
|
714 *push_in = FALSE;
|
|
715 }
|
|
716
|
|
717
|
|
718 void
|
|
719 ui_manager_popup_menu_show ( GtkMenu * menu , gint x , gint y , guint button , guint time )
|
|
720 {
|
|
721 gint pos[2];
|
|
722 pos[0] = x;
|
|
723 pos[1] = y;
|
|
724
|
|
725 gtk_menu_popup( menu , NULL , NULL ,
|
|
726 (GtkMenuPositionFunc) menu_popup_pos_func , pos , button , time );
|
|
727 }
|