summaryrefslogtreecommitdiff
path: root/src/actions.h
blob: 3b4f7fa59ad6f451f1968095bd80e6b9ddb3af32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
/***************************************************************************
 *   Copyright (C) 2008-2012 by Andrzej Rybczak                            *
 *   electricityispower@gmail.com                                          *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.              *
 ***************************************************************************/

#ifndef _ACTIONS_H
#define _ACTIONS_H

#include <map>
#include <string>
#include "ncmpcpp.h"

enum ActionType
{
	aMacroUtility,
	aMouseEvent, aScrollUp, aScrollDown, aScrollUpArtist, aScrollUpAlbum, aScrollDownArtist,
	aScrollDownAlbum, aPageUp, aPageDown, aMoveHome, aMoveEnd, aToggleInterface, aJumpToParentDir,
	aPressEnter, aPressSpace, aPreviousColumn, aNextColumn, aMasterScreen, aSlaveScreen, aVolumeUp,
	aVolumeDown, aDelete, aReplaySong, aPreviousSong, aNextSong, aPause, aStop, aSavePlaylist,
	aMoveSortOrderUp, aMoveSortOrderDown, aMoveSelectedItemsUp, aMoveSelectedItemsDown,
	aMoveSelectedItemsTo, aAdd, aSeekForward, aSeekBackward, aToggleDisplayMode, aToggleSeparatorsInPlaylist,
	aToggleLyricsFetcher, aToggleFetchingLyricsInBackground, aToggleAutoCenter, aUpdateDatabase,
	aJumpToPlayingSong, aToggleRepeat, aShuffle, aToggleRandom, aStartSearching, aSaveTagChanges,
	aToggleSingle, aToggleConsume, aToggleCrossfade, aSetCrossfade, aEditSong, aEditLibraryTag,
	aEditLibraryAlbum, aEditDirectoryName, aEditPlaylistName, aEditLyrics, aJumpToBrowser,
	aJumpToMediaLibrary, aJumpToPlaylistEditor, aToggleScreenLock, aJumpToTagEditor,
	aJumpToPositionInSong, aReverseSelection, aDeselectItems, aSelectAlbum, aAddSelectedItems,
	aCropMainPlaylist, aCropPlaylist, aClearMainPlaylist, aClearPlaylist, aSortPlaylist, aReversePlaylist,
	aApplyFilter, aDisableFilter, aFind, aFindItemForward, aFindItemBackward, aNextFoundItem,
	aPreviousFoundItem, aToggleFindMode, aToggleReplayGainMode, aToggleSpaceMode, aToggleAddMode,
	aToggleMouse, aToggleBitrateVisibility, aAddRandomItems, aToggleBrowserSortMode, aToggleLibraryTagType,
	aRefetchLyrics, aRefetchArtistInfo, aSetSelectedItemsPriority, aShowSongInfo, aShowArtistInfo,
	aShowLyrics, aQuit, aNextScreen, aPreviousScreen, aShowHelp, aShowPlaylist, aShowBrowser,
	aShowSearchEngine, aShowMediaLibrary, aShowPlaylistEditor, aShowTagEditor, aShowOutputs,
	aShowVisualizer, aShowClock, aShowServerInfo
};

enum CharType { ctStandard, ctNCurses };

struct Action
{
	/// Key for binding actions to it. Supports non-ascii characters.
	struct Key
	{
		Key(wchar_t ch, CharType ct) : Char(ch), Type(ct) { }
		
		wchar_t getChar() const { return Char; }
		CharType getType() const { return Type; }
		
#		define INEQUALITY_OPERATOR(CMP) \
			bool operator CMP (const Key &k) const \
			{ \
				if (Char CMP k.Char) \
					return true; \
				if (Char != k.Char) \
					return false; \
				return Type CMP k.Type; \
			}
		INEQUALITY_OPERATOR(<);
		INEQUALITY_OPERATOR(<=);
		INEQUALITY_OPERATOR(>);
		INEQUALITY_OPERATOR(>=);
#		undef INEQUALITY_OPERATOR
		
		bool operator==(const Key &k) const { return Char == k.Char && Type == k.Type; }
		bool operator!=(const Key &k) const { return !(*this == k); }
		
		private:
			wchar_t Char;
			CharType Type;
	};
	
	enum FindDirection { fdForward, fdBackward };
	
	Action(ActionType type, const char *name) : itsType(type), itsName(name) { }
	
	const char *Name() const { return itsName; }
	ActionType Type() const { return itsType; }
	
	bool Execute()
	{
		if (canBeRun())
		{
			Run();
			return true;
		}
		return false;
	}
	
	static Key ReadKey(Window &w);
	
	static void ValidateScreenSize();
	static void SetResizeFlags();
	static void ResizeScreen();
	static void SetWindowsDimensions();
	
	static bool AskYesNoQuestion(const std::string &question, void (*callback)());
	static bool isMPDMusicDirSet();
	
	static Action *Get(ActionType);
	
	static bool OriginalStatusbarVisibility;
	static bool DesignChanged;
	static bool OrderResize;
	static bool ExitMainLoop;
	
	static size_t HeaderHeight;
	static size_t FooterHeight;
	static size_t FooterStartY;
	
	static Key NoOp;
	
	protected:
		virtual bool canBeRun() const { return true; }
		virtual void Run() = 0;
		
		static void Seek();
		static void FindItem(const FindDirection);
		static void ListsChangeFinisher();
		
	private:
		ActionType itsType;
		const char *itsName;
		
		static void insertAction(Action *a) { Actions[a->Type()] = a; }
		static std::map<ActionType, Action *> Actions;
};

struct MouseEvent : public Action
{
	MouseEvent() : Action(aMouseEvent, "mouse_event") { }
	virtual bool canBeRun() const;
	virtual void Run();
	
	private:
		MEVENT itsMouseEvent;
		MEVENT itsOldMouseEvent;
};

struct ScrollUp : public Action
{
	ScrollUp() : Action(aScrollUp, "scroll_up") { }
	virtual void Run();
};

struct ScrollDown : public Action
{
	ScrollDown() : Action(aScrollDown, "scroll_down") { }
	virtual void Run();
};

struct ScrollUpArtist : public Action
{
	ScrollUpArtist() : Action(aScrollUpArtist, "scroll_up_artist") { }
	virtual void Run();
};

struct ScrollUpAlbum : public Action
{
	ScrollUpAlbum() : Action(aScrollUpAlbum, "scroll_up_album") { }
	virtual void Run();
};

struct ScrollDownArtist : public Action
{
	ScrollDownArtist() : Action(aScrollDownArtist, "scroll_down_artist") { }
	virtual void Run();
};

struct ScrollDownAlbum : public Action
{
	ScrollDownAlbum() : Action(aScrollDownAlbum, "scroll_down_album") { }
	virtual void Run();
};

struct PageUp : public Action
{
	PageUp() : Action(aPageUp, "page_up") { }
	virtual void Run();
};

struct PageDown : public Action
{
	PageDown() : Action(aPageDown, "page_down") { }
	virtual void Run();
};

struct MoveHome : public Action
{
	MoveHome() : Action(aMoveHome, "move_home") { }
	virtual void Run();
};

struct MoveEnd : public Action
{
	MoveEnd() : Action(aMoveEnd, "move_end") { }
	virtual void Run();
};

struct ToggleInterface : public Action
{
	ToggleInterface() : Action(aToggleInterface, "toggle_inferface") { }
	virtual void Run();
};

struct JumpToParentDir : public Action
{
	JumpToParentDir() : Action(aJumpToParentDir, "jump_to_parent_dir") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct PressEnter : public Action
{
	PressEnter() : Action(aPressEnter, "press_enter") { }
	virtual void Run();
};

struct PressSpace : public Action
{
	PressSpace() : Action(aPressSpace, "press_space") { }
	virtual void Run();
};

struct PreviousColumn : public Action
{
	PreviousColumn() : Action(aPreviousColumn, "previous_column") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct NextColumn : public Action
{
	NextColumn() : Action(aNextColumn, "next_column") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct MasterScreen : public Action
{
	MasterScreen() : Action(aMasterScreen, "master_screen") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct SlaveScreen : public Action
{
	SlaveScreen() : Action(aSlaveScreen, "slave_screen") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct VolumeUp : public Action
{
	VolumeUp() : Action(aVolumeUp, "volume_up") { }
	virtual void Run();
};

struct VolumeDown : public Action
{
	VolumeDown() : Action(aVolumeDown, "volume_down") { }
	virtual void Run();
};

struct Delete : public Action
{
	Delete() : Action(aDelete, "delete") { }
	virtual void Run();
};

struct ReplaySong : public Action
{
	ReplaySong() : Action(aReplaySong, "replay_song") { }
	virtual void Run();
};

struct PreviousSong : public Action
{
	PreviousSong() : Action(aPreviousSong, "previous") { }
	virtual void Run();
};

struct NextSong : public Action
{
	NextSong() : Action(aNextSong, "next") { }
	virtual void Run();
};

struct Pause : public Action
{
	Pause() : Action(aPause, "pause") { }
	virtual void Run();
};

struct Stop : public Action
{
	Stop() : Action(aStop, "stop") { }
	virtual void Run();
};

struct SavePlaylist : public Action
{
	SavePlaylist() : Action(aSavePlaylist, "save_playlist") { }
	virtual void Run();
};

struct MoveSortOrderUp : public Action
{
	MoveSortOrderUp() : Action(aMoveSortOrderUp, "move_sort_order_up") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct MoveSortOrderDown : public Action
{
	MoveSortOrderDown() : Action(aMoveSortOrderDown, "move_sort_order_down") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct MoveSelectedItemsUp : public Action
{
	MoveSelectedItemsUp() : Action(aMoveSelectedItemsUp, "move_selected_items_up") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct MoveSelectedItemsDown : public Action
{
	MoveSelectedItemsDown() : Action(aMoveSelectedItemsDown, "move_selected_items_down") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct MoveSelectedItemsTo : public Action
{
	MoveSelectedItemsTo() : Action(aMoveSelectedItemsTo, "move_selected_items_to") { }
	virtual void Run();
};

struct Add : public Action
{
	Add() : Action(aAdd, "add") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct SeekForward : public Action
{
	SeekForward() : Action(aSeekForward, "seek_forward") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct SeekBackward : public Action
{
	SeekBackward() : Action(aSeekBackward, "seek_backward") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ToggleDisplayMode : public Action
{
	ToggleDisplayMode() : Action(aToggleDisplayMode, "toggle_display_mode") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ToggleSeparatorsInPlaylist : public Action
{
	ToggleSeparatorsInPlaylist() : Action(aToggleSeparatorsInPlaylist, "toggle_separators_in_playlist") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ToggleLyricsFetcher : public Action
{
	ToggleLyricsFetcher() : Action(aToggleLyricsFetcher, "toggle_lyrics_fetcher") { }
#	ifndef HAVE_CURL_CURL_H
	virtual bool canBeRun() const;
#	endif // NOT HAVE_CURL_CURL_H
	virtual void Run();
};

struct ToggleFetchingLyricsInBackground : public Action
{
	ToggleFetchingLyricsInBackground() : Action(aToggleFetchingLyricsInBackground, "toggle_fetching_lyrics_in_background") { }
#	ifndef HAVE_CURL_CURL_H
	virtual bool canBeRun() const;
#	endif // NOT HAVE_CURL_CURL_H
	virtual void Run();
};

struct ToggleAutoCenter : public Action
{
	ToggleAutoCenter() : Action(aToggleAutoCenter, "toggle_autocentering") { }
	virtual void Run();
};

struct UpdateDatabase : public Action
{
	UpdateDatabase() : Action(aUpdateDatabase, "update_database") { }
	virtual void Run();
};

struct JumpToPlayingSong : public Action
{
	JumpToPlayingSong() : Action(aJumpToPlayingSong, "jump_to_playing_song") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ToggleRepeat : public Action
{
	ToggleRepeat() : Action(aToggleRepeat, "toggle_repeat") { }
	virtual void Run();
};

struct Shuffle : public Action
{
	Shuffle() : Action(aShuffle, "shuffle") { }
	virtual void Run();
};

struct ToggleRandom : public Action
{
	ToggleRandom() : Action(aToggleRandom, "toggle_random") { }
	virtual void Run();
};

struct StartSearching : public Action
{
	StartSearching() : Action(aStartSearching, "start_searching") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct SaveTagChanges : public Action
{
	SaveTagChanges() : Action(aSaveTagChanges, "save_tag_changes") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ToggleSingle : public Action
{
	ToggleSingle() : Action(aToggleSingle, "toggle_single") { }
	virtual void Run();
};

struct ToggleConsume : public Action
{
	ToggleConsume() : Action(aToggleConsume, "toggle_consume") { }
	virtual void Run();
};

struct ToggleCrossfade : public Action
{
	ToggleCrossfade() : Action(aToggleCrossfade, "toggle_crossfade") { }
	virtual void Run();
};

struct SetCrossfade : public Action
{
	SetCrossfade() : Action(aSetCrossfade, "set_crossfade") { }
	virtual void Run();
};

struct EditSong : public Action
{
	EditSong() : Action(aEditSong, "edit_song") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct EditLibraryTag : public Action
{
	EditLibraryTag() : Action(aEditLibraryTag, "edit_library_tag") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct EditLibraryAlbum : public Action
{
	EditLibraryAlbum() : Action(aEditLibraryAlbum, "edit_library_album") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct EditDirectoryName : public Action
{
	EditDirectoryName() : Action(aEditDirectoryName, "edit_directory_name") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct EditPlaylistName : public Action
{
	EditPlaylistName() : Action(aEditPlaylistName, "edit_playlist_name") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct EditLyrics : public Action
{
	EditLyrics() : Action(aEditLyrics, "edit_lyrics") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct JumpToBrowser : public Action
{
	JumpToBrowser() : Action(aJumpToBrowser, "jump_to_browser") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct JumpToMediaLibrary : public Action
{
	JumpToMediaLibrary() : Action(aJumpToMediaLibrary, "jump_to_media_library") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct JumpToPlaylistEditor : public Action
{
	JumpToPlaylistEditor() : Action(aJumpToPlaylistEditor, "jump_to_playlist_editor") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ToggleScreenLock : public Action
{
	ToggleScreenLock() : Action(aToggleScreenLock, "toggle_screen_lock") { }
	virtual void Run();
};

struct JumpToTagEditor : public Action
{
	JumpToTagEditor() : Action(aJumpToTagEditor, "jump_to_tag_editor") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct JumpToPositionInSong : public Action
{
	JumpToPositionInSong() : Action(aJumpToPositionInSong, "jump_to_position_in_song") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ReverseSelection : public Action
{
	ReverseSelection() : Action(aReverseSelection, "reverse_selection") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct DeselectItems : public Action
{
	DeselectItems() : Action(aDeselectItems, "deselect_items") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct SelectAlbum : public Action
{
	SelectAlbum() : Action(aSelectAlbum, "select_album") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct AddSelectedItems : public Action
{
	AddSelectedItems() : Action(aAddSelectedItems, "add_selected_items") { }
	virtual void Run();
};

struct CropMainPlaylist : public Action
{
	CropMainPlaylist() : Action(aCropMainPlaylist, "crop_main_playlist") { }
	virtual void Run();
};

struct CropPlaylist : public Action
{
	CropPlaylist() : Action(aCropPlaylist, "crop_playlist") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ClearMainPlaylist : public Action
{
	ClearMainPlaylist() : Action(aClearMainPlaylist, "clear_main_playlist") { }
	virtual void Run();
};

struct ClearPlaylist : public Action
{
	ClearPlaylist() : Action(aClearPlaylist, "clear_playlist") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct SortPlaylist : public Action
{
	SortPlaylist() : Action(aSortPlaylist, "sort_playlist") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ReversePlaylist : public Action
{
	ReversePlaylist() : Action(aReversePlaylist, "reverse_playlist") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ApplyFilter : public Action
{
	ApplyFilter() : Action(aApplyFilter, "apply_filter") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct DisableFilter : public Action
{
	DisableFilter() : Action(aDisableFilter, "disable_filter") { }
	virtual void Run();
};

struct Find : public Action
{
	Find() : Action(aFind, "find") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct FindItemForward : public Action
{
	FindItemForward() : Action(aFindItemForward, "find_item_forward") { }
	virtual void Run();
};

struct FindItemBackward : public Action
{
	FindItemBackward() : Action(aFindItemBackward, "find_item_backward") { }
	virtual void Run();
};

struct NextFoundItem : public Action
{
	NextFoundItem() : Action(aNextFoundItem, "next_found_item") { }
	virtual void Run();
};

struct PreviousFoundItem : public Action
{
	PreviousFoundItem() : Action(aPreviousFoundItem, "previous_found_item") { }
	virtual void Run();
};

struct ToggleFindMode : public Action
{
	ToggleFindMode() : Action(aToggleFindMode, "toggle_find_mode") { }
	virtual void Run();
};

struct ToggleReplayGainMode : public Action
{
	ToggleReplayGainMode() : Action(aToggleReplayGainMode, "toggle_replay_gain_mode") { }
	virtual void Run();
};

struct ToggleSpaceMode : public Action
{
	ToggleSpaceMode() : Action(aToggleSpaceMode, "toggle_space_mode") { }
	virtual void Run();
};

struct ToggleAddMode : public Action
{
	ToggleAddMode() : Action(aToggleAddMode, "toggle_add_mode") { }
	virtual void Run();
};

struct ToggleMouse : public Action
{
	ToggleMouse() : Action(aToggleMouse, "toggle_mouse") { }
	virtual void Run();
};

struct ToggleBitrateVisibility : public Action
{
	ToggleBitrateVisibility() : Action(aToggleBitrateVisibility, "toggle_bitrate_visibility") { }
	virtual void Run();
};

struct AddRandomItems : public Action
{
	AddRandomItems() : Action(aAddRandomItems, "add_random_items") { }
	virtual void Run();
};

struct ToggleBrowserSortMode : public Action
{
	ToggleBrowserSortMode() : Action(aToggleBrowserSortMode, "toggle_browser_sort_mode") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ToggleLibraryTagType : public Action
{
	ToggleLibraryTagType() : Action(aToggleLibraryTagType, "toggle_library_tag_type") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct RefetchLyrics : public Action
{
	RefetchLyrics() : Action(aRefetchLyrics, "refetch_lyrics") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct RefetchArtistInfo : public Action
{
	RefetchArtistInfo() : Action(aRefetchArtistInfo, "refetch_artist_info") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct SetSelectedItemsPriority : public Action
{
	SetSelectedItemsPriority() : Action(aSetSelectedItemsPriority, "set_selected_items_priority") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ShowSongInfo : public Action
{
	ShowSongInfo() : Action(aShowSongInfo, "show_song_info") { }
	virtual void Run();
};

struct ShowArtistInfo : public Action
{
	ShowArtistInfo() : Action(aShowArtistInfo, "show_artist_info") { }
#	ifndef HAVE_CURL_CURL_H
	virtual bool canBeRun() const;
#	endif // NOT HAVE_CURL_CURL_H
	virtual void Run();
};

struct ShowLyrics : public Action
{
	ShowLyrics() : Action(aShowLyrics, "show_lyrics") { }
	virtual void Run();
};

struct Quit : public Action
{
	Quit() : Action(aQuit, "quit") { }
	virtual void Run();
};

struct NextScreen : public Action
{
	NextScreen() : Action(aNextScreen, "next_screen") { }
	virtual void Run();
};

struct PreviousScreen : public Action
{
	PreviousScreen() : Action(aPreviousScreen, "previous_screen") { }
	virtual void Run();
};

struct ShowHelp : public Action
{
	ShowHelp() : Action(aShowHelp, "show_help") { }
#	ifdef HAVE_TAGLIB_H
	virtual bool canBeRun() const;
#	endif // HAVE_TAGLIB_H
	virtual void Run();
};

struct ShowPlaylist : public Action
{
	ShowPlaylist() : Action(aShowPlaylist, "show_playlist") { }
#	ifdef HAVE_TAGLIB_H
	virtual bool canBeRun() const;
#	endif // HAVE_TAGLIB_H
	virtual void Run();
};

struct ShowBrowser : public Action
{
	ShowBrowser() : Action(aShowBrowser, "show_browser") { }
#	ifdef HAVE_TAGLIB_H
	virtual bool canBeRun() const;
#	endif // HAVE_TAGLIB_H
	virtual void Run();
};

struct ShowSearchEngine : public Action
{
	ShowSearchEngine() : Action(aShowSearchEngine, "show_search_engine") { }
#	ifdef HAVE_TAGLIB_H
	virtual bool canBeRun() const;
#	endif // HAVE_TAGLIB_H
	virtual void Run();
};

struct ShowMediaLibrary : public Action
{
	ShowMediaLibrary() : Action(aShowMediaLibrary, "show_media_library") { }
#	ifdef HAVE_TAGLIB_H
	virtual bool canBeRun() const;
#	endif // HAVE_TAGLIB_H
	virtual void Run();
};

struct ShowPlaylistEditor : public Action
{
	ShowPlaylistEditor() : Action(aShowPlaylistEditor, "show_playlist_editor") { }
#	ifdef HAVE_TAGLIB_H
	virtual bool canBeRun() const;
#	endif // HAVE_TAGLIB_H
	virtual void Run();
};

struct ShowTagEditor : public Action
{
	ShowTagEditor() : Action(aShowTagEditor, "show_tag_editor") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ShowOutputs : public Action
{
	ShowOutputs() : Action(aShowOutputs, "show_outputs") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ShowVisualizer : public Action
{
	ShowVisualizer() : Action(aShowVisualizer, "show_visualizer") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ShowClock : public Action
{
	ShowClock() : Action(aShowClock, "show_clock") { }
	virtual bool canBeRun() const;
	virtual void Run();
};

struct ShowServerInfo : public Action
{
	ShowServerInfo() : Action(aShowServerInfo, "show_server_info") { }
#	ifdef HAVE_TAGLIB_H
	virtual bool canBeRun() const;
#	endif // HAVE_TAGLIB_H
	virtual void Run();
};

#endif // _ACTIONS_H