-
Notifications
You must be signed in to change notification settings - Fork 5
/
MediaRemote.h
119 lines (99 loc) · 4.92 KB
/
MediaRemote.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
/*
* Media remote framework header.
*
* Copyright (c) 2013-2014 Cykey (David Murray)
* All rights reserved.
*/
#ifndef MEDIAREMOTE_H_
#define MEDIAREMOTE_H_
#include <CoreFoundation/CoreFoundation.h>
#if __cplusplus
extern "C" {
#endif
/*
* These are used on the local notification center.
*/
extern CFStringRef kMRMediaRemoteNowPlayingInfoTitle;
extern CFStringRef kMRMediaRemoteNowPlayingInfoArtist;
extern CFStringRef kMRMediaRemoteNowPlayingInfoAlbum;
extern CFStringRef kMRMediaRemoteNowPlayingInfoArtworkData;
extern CFStringRef kMRMediaRemoteNowPlayingInfoElapsedTime;
extern CFStringRef kMRMediaRemoteNowPlayingInfoDuration;
extern CFStringRef kMRMediaRemoteNowPlayingInfoIsMusicApp;
extern CFStringRef kMRMediaRemoteNowPlayingInfoSupportsRewind15Seconds;
extern CFStringRef kMRMediaRemoteNowPlayingInfoSupportsFastForward15Seconds;
extern CFStringRef kMRMediaRemoteNowPlayingInfoSupportsIsLiked;
extern CFStringRef kMRMediaRemoteNowPlayingInfoSupportsIsBanned;
extern CFStringRef kMRMediaRemoteNowPlayingInfoIsLiked;
extern CFStringRef kMRMediaRemoteNowPlayingInfoIsBanned;
extern CFStringRef kMRMediaRemoteNowPlayingInfoIsInWishList;
extern CFStringRef kMRMediaRemoteNowPlayingInfoUniqueIdentifier;
extern CFStringRef kMRMediaRemoteNowPlayingInfoRadioStationIdentifier;
extern CFStringRef kMRMediaRemoteNowPlayingInfoRadioStationHash;
extern CFStringRef kMRMediaRemoteOptionSkipInterval;
extern CFStringRef kMRMediaRemoteOptionTrackID;
extern CFStringRef kMRMediaRemoteOptionStationID;
extern CFStringRef kMRMediaRemoteOptionStationHash;
extern CFStringRef kMRMediaRemoteCommandInfoIsActiveKey;
extern CFStringRef kMRMediaRemoteNowPlayingInfoTimestamp;
extern CFStringRef kMRMediaRemoteOptionIsNegative;
extern CFStringRef kMRMediaRemoteNowPlayingInfoDidChangeNotification;
extern CFStringRef kMRMediaRemoteNowPlayingApplicationIsPlayingDidChangeNotification;
typedef NS_ENUM(NSInteger, MRCommand) {
kMRPlay = 0,
kMRPause = 1,
kMRTogglePlayPause = 2,
kMRStop = 3,
kMRNextTrack = 4,
kMRPreviousTrack = 5,
kMRToggleShuffle = 6,
kMRToggleRepeat = 7,
kMRStartForwardSeek = 8,
kMREndForwardSeek = 9,
kMRStartBackwardSeek = 10,
kMREndBackwardSeek = 11,
kMRSkipFifteenSeconds = 17,
kMRGoBackFifteenSeconds = 18,
kMRLikeTrack = 21,
kMRBanTrack = 22,
kMRBookmarkTrack = 23,
};
Boolean MRMediaRemoteSendCommand(MRCommand command, id userInfo);
void MRMediaRemoteSetElapsedTime(NSTimeInterval elapsedTime);
void MRMediaRemoteCopySupportedCommands(dispatch_queue_t queue, void(^block)(NSArray *));
MRCommand MRMediaRemoteCommandInfoGetCommand(id commandInfo);
Boolean MRMediaRemoteCommandInfoGetEnabled(id commandInfo);
CFTypeRef MRMediaRemoteCommandInfoCopyValueForKey(id commandInfo, CFStringRef key);
Boolean MRMediaRemoteSendCommand(MRCommand command, id userInfo);
void MRMediaRemoteSetPlaybackSpeed(int speed);
void MRMediaRemoteSetElapsedTime(double elapsedTime);
void MRMediaRemoteSetNowPlayingApplicationOverrideEnabled(Boolean enabled);
void MRMediaRemoteRegisterForNowPlayingNotifications(dispatch_queue_t queue);
void MRMediaRemoteUnregisterForNowPlayingNotifications();
void MRMediaRemoteBeginRouteDiscovery();
void MRMediaRemoteEndRouteDiscovery();
CFArrayRef MRMediaRemoteCopyPickableRoutes();
typedef void (^MRMediaRemoteGetNowPlayingInfoCompletion)(CFDictionaryRef information);
typedef void (^MRMediaRemoteGetNowPlayingApplicationPIDCompletion)(int PID);
typedef void (^MRMediaRemoteGetNowPlayingApplicationIsPlayingCompletion)(Boolean isPlaying);
void MRMediaRemoteGetNowPlayingApplicationPID(dispatch_queue_t queue, MRMediaRemoteGetNowPlayingApplicationPIDCompletion completion);
void MRMediaRemoteGetNowPlayingInfo(dispatch_queue_t queue, MRMediaRemoteGetNowPlayingInfoCompletion completion);
void MRMediaRemoteGetNowPlayingApplicationIsPlaying(dispatch_queue_t queue, MRMediaRemoteGetNowPlayingApplicationIsPlayingCompletion completion);
void MRMediaRemoteKeepAlive();
void MRMediaRemoteSetElapsedTime(double time);
void MRMediaRemoteSetShuffleMode(int mode);
void MRMediaRemoteSetRepeatMode(int mode);
/*
* The identifier can be obtained using MRMediaRemoteCopyPickableRoutes.
* Use the 'RouteUID' or the 'RouteName' key.
*/
int MRMediaRemoteSelectSourceWithID(CFStringRef identifier);
void MRMediaRemoteSetPickedRouteWithPassword(CFStringRef route, CFStringRef password);
CFArrayRef MRMediaRemoteCopyPickableRoutesForCategory(NSString *category);
Boolean MRMediaRemotePickedRouteHasVolumeControl();
void MRMediaRemoteSetCanBeNowPlayingApplication(Boolean can);
void MRMediaRemoteSetNowPlayingInfo(CFDictionaryRef information);
#if __cplusplus
}
#endif
#endif /* MEDIAREMOTE_H_ */