-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathAppDelegate.h
128 lines (84 loc) · 3.24 KB
/
AppDelegate.h
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
//
// AppDelegate.h
// Pinna
//
// Created by Peter MacWhinnie on 10/29/10.
// Copyright 2010 Roundabout Software, LLC. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "PlayKeysBridge.h"
#import "HotKeyDispatcher.h"
@class MainWindow, PreferencesWindow, EffectsWindow;
@class LastFMSession, Song, AudioPlayer, MenuNotificationView;
///The class responsible for tying all of Player's disparate controllers together.
@interface AppDelegate : NSObject <NSApplicationDelegate, NSUserInterfaceValidations, PlayKeysBridgeDelegate, HotKeyDispatcherDelegate>
{
/** Outlets **/
///The window to display when Player is busy in the background when the user asks to quit.
IBOutlet NSWindow *oBusyWindow;
///The menu item in the dock menu used to display playback status.
IBOutlet NSMenuItem *oPlaybackStatusItem;
/** Subcontrollers **/
///The main window.
MainWindow *mMainWindow;
///The preferences window.
PreferencesWindow *mPreferencesWindow;
///The background status view used to display notifications.
MenuNotificationView *mBackgroundStatusView;
/** Internal **/
///The player of the delegate.
AudioPlayer *player;
///Whether or not private listening is enabled.
BOOL mPrivateListeningEnabled;
///The scrobbler that belongs to Player.
LastFMSession *mScrobbler;
Song *mLastSong;
///The timer used to make sure we don't flood Last.fm with now playing updates.
NSTimer *mNowPlayingUpdateDelayTimer;
///The media key watcher.
PlayKeysBridge *mPlayKeysBridge;
///The update pulse timer.
NSTimer *mUpdatePulse;
}
#pragma mark Interface Hooks
///The title for play pause menu items.
- (NSString *)playPauseMenuItemTitle;
///The title for toggle shulfle menu items.
- (NSString *)toggleShuffleMenuItemTitle;
#pragma mark - Showing Subcontrollers
///Shows the main window.
- (IBAction)showMainWindow:(id)sender;
///Shows the preferences window.
- (IBAction)showPreferencesWindow:(id)sender;
#pragma mark - Playback Control Actions
///Toggle the playback state of the receiver.
- (IBAction)playPause:(id)sender;
///Move to the previous track in the receiver's player's play queue.
- (IBAction)previousTrack:(id)sender;
///Move to the next track in the receiver's player's play queue.
- (IBAction)nextTrack:(id)sender;
#pragma mark -
///Randomizes the play queue.
- (IBAction)randomizePlayQueue:(id)sender;
///Toggle shuffle mode on the play queue.
- (IBAction)toggleShuffleMode:(id)sender;
///Sets the shared audio player's mode to be that of the sender's tag.
- (IBAction)takeNewPlaybackModeFrom:(id)sender;
#pragma mark -
///Increases the application volume.
- (IBAction)increaseVolume:(id)sender;
///Decreases the application volume.
- (IBAction)decreaseVolume:(id)sender;
#pragma mark - Other
///Toggle the state of private listening.
- (IBAction)togglePrivateListening:(id)sender;
///Causes the artwork cache of Player to be destroyed.
- (IBAction)deleteArtworkCaches:(id)sender;
///Change the amount of history to keep in the play queue.
- (IBAction)changeQueueHistoryAmount:(id)sender;
///Refresh everything possible to refresh.
- (IBAction)refresh:(id)sender;
#pragma mark - Properties
@property (readonly, nonatomic) PreferencesWindow *preferencesWindow;
@property (readonly, nonatomic) MainWindow *mainWindow;
@end