#pragma once
#if USE(MEDIAREMOTE)
#if __has_include(<MediaRemote/MRNowPlayingTypes.h>)
#include <MediaRemote/MRNowPlayingTypes.h>
#else
enum {
MRNowPlayingClientVisibilityUndefined = 0,
MRNowPlayingClientVisibilityAlwaysVisible,
MRNowPlayingClientVisibilityVisibleWhenBackgrounded,
MRNowPlayingClientVisibilityNeverVisible
};
typedef uint32_t MRNowPlayingClientVisibility;
#endif
#if USE(APPLE_INTERNAL_SDK)
#include <MediaRemote/MediaRemote.h>
#else
enum {
MRMediaRemoteCommandPlay,
MRMediaRemoteCommandPause,
MRMediaRemoteCommandTogglePlayPause,
MRMediaRemoteCommandStop,
MRMediaRemoteCommandNextTrack,
MRMediaRemoteCommandPreviousTrack,
MRMediaRemoteCommandAdvanceShuffleMode,
MRMediaRemoteCommandAdvanceRepeatMode,
MRMediaRemoteCommandBeginFastForward,
MRMediaRemoteCommandEndFastForward,
MRMediaRemoteCommandBeginRewind,
MRMediaRemoteCommandEndRewind,
MRMediaRemoteCommandRewind15Seconds,
MRMediaRemoteCommandFastForward15Seconds,
MRMediaRemoteCommandRewind30Seconds,
MRMediaRemoteCommandFastForward30Seconds,
MRMediaRemoteCommandToggleRecord,
MRMediaRemoteCommandSkipForward,
MRMediaRemoteCommandSkipBackward,
MRMediaRemoteCommandChangePlaybackRate,
MRMediaRemoteCommandRateTrack,
MRMediaRemoteCommandLikeTrack,
MRMediaRemoteCommandDislikeTrack,
MRMediaRemoteCommandBookmarkTrack,
MRMediaRemoteCommandSeekToPlaybackPosition,
MRMediaRemoteCommandChangeRepeatMode,
MRMediaRemoteCommandChangeShuffleMode,
MRMediaRemoteCommandEnableLanguageOption,
MRMediaRemoteCommandDisableLanguageOption
};
typedef uint32_t MRMediaRemoteCommand;
enum {
kMRPlaybackStateUnknown = 0,
kMRPlaybackStatePlaying,
kMRPlaybackStatePaused,
kMRPlaybackStateStopped,
kMRPlaybackStateInterrupted
};
typedef uint32_t MRPlaybackState;
typedef uint32_t MRMediaRemoteError;
typedef struct _MROrigin *MROriginRef;
typedef struct _MRMediaRemoteCommandInfo *MRMediaRemoteCommandInfoRef;
typedef void(^MRMediaRemoteAsyncCommandHandlerBlock)(MRMediaRemoteCommand command, CFDictionaryRef options, void(^completion)(CFArrayRef));
WTF_EXTERN_C_BEGIN
#pragma mark - MRRemoteControl
void* MRMediaRemoteAddAsyncCommandHandlerBlock(MRMediaRemoteAsyncCommandHandlerBlock);
void MRMediaRemoteRemoveCommandHandlerBlock(void *observer);
void MRMediaRemoteSetSupportedCommands(CFArrayRef commands, MROriginRef, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError err));
void MRMediaRemoteSetNowPlayingVisibility(MROriginRef, MRNowPlayingClientVisibility);
#pragma mark - MROrigin
MROriginRef MRMediaRemoteGetLocalOrigin();
#pragma mark - MRCommandInfo
MRMediaRemoteCommandInfoRef MRMediaRemoteCommandInfoCreate(CFAllocatorRef);
void MRMediaRemoteCommandInfoSetCommand(MRMediaRemoteCommandInfoRef, MRMediaRemoteCommand);
void MRMediaRemoteCommandInfoSetEnabled(MRMediaRemoteCommandInfoRef, Boolean);
void MRMediaRemoteCommandInfoSetOptions(MRMediaRemoteCommandInfoRef, CFDictionaryRef);
#pragma mark - MRNowPlaying
Boolean MRMediaRemoteSetCanBeNowPlayingApplication(Boolean);
void MRMediaRemoteSetNowPlayingApplicationPlaybackStateForOrigin(MROriginRef, MRPlaybackState, dispatch_queue_t replyQ, void(^completion)(MRMediaRemoteError));
void MRMediaRemoteSetNowPlayingInfo(CFDictionaryRef);
WTF_EXTERN_C_END
#endif // USE(APPLE_INTERNAL_SDK)
#endif // USE(MEDIAREMOTE)