now_playing_info_center_delegate_cocoa.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright 2019 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SYSTEM_MEDIA_CONTROLS_MAC_NOW_PLAYING_INFO_CENTER_DELEGATE_COCOA_H_
  5. #define COMPONENTS_SYSTEM_MEDIA_CONTROLS_MAC_NOW_PLAYING_INFO_CENTER_DELEGATE_COCOA_H_
  6. #import <Cocoa/Cocoa.h>
  7. #import <MediaPlayer/MediaPlayer.h>
  8. API_AVAILABLE(macos(10.13.1))
  9. @interface NowPlayingInfoCenterDelegateCocoa : NSObject
  10. - (instancetype)init;
  11. // Clears all "Now Playing" information.
  12. - (void)resetNowPlayingInfo;
  13. // Called by the NowPlayingInfoCenterDelegateImpl to set metadata.
  14. - (void)setPlaybackState:(MPNowPlayingPlaybackState)state;
  15. - (void)setTitle:(NSString*)title;
  16. - (void)setArtist:(NSString*)artist;
  17. - (void)setAlbum:(NSString*)album;
  18. - (void)setPlaybackRate:(NSNumber*)rate;
  19. - (void)setCurrentPlaybackDate:(NSDate*)date;
  20. - (void)setElapsedPlaybackTime:(NSNumber*)time;
  21. - (void)setDuration:(NSNumber*)duration;
  22. - (void)setThumbnail:(NSImage*)image;
  23. - (void)updateNowPlayingInfo;
  24. // Sets all metadata to default values.
  25. - (void)clearMetadata;
  26. @end
  27. #endif // COMPONENTS_SYSTEM_MEDIA_CONTROLS_MAC_NOW_PLAYING_INFO_CENTER_DELEGATE_COCOA_H_