PebbleOS
Loading...
Searching...
No Matches
Macros | Enumerations | Functions
music.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <string.h>

Macros

#define MUSIC_BUFFER_LENGTH   64
 Size of the string buffers used for metadata, including the terminator.
 

Enumerations

enum  MusicPlayState {
  MusicPlayStateUnknown , MusicPlayStatePlaying , MusicPlayStatePaused , MusicPlayStateForwarding ,
  MusicPlayStateRewinding , MusicPlayStateInvalid = 0xFF
}
 Playback state of the player. More...
 
enum  MusicCommand {
  MusicCommandPlay , MusicCommandPause , MusicCommandTogglePlayPause , MusicCommandNextTrack ,
  MusicCommandPreviousTrack , MusicCommandVolumeUp , MusicCommandVolumeDown , MusicCommandAdvanceRepeatMode ,
  MusicCommandAdvanceShuffleMode , MusicCommandSkipForward , MusicCommandSkipBackward , MusicCommandLike ,
  MusicCommandDislike , MusicCommandBookmark , NumMusicCommand
}
 Control command sent to the player. More...
 

Functions

void music_get_now_playing (char *title, char *artist, char *album)
 Copy the current track metadata.
 
bool music_has_now_playing (void)
 Check whether now-playing metadata is available.
 
bool music_get_player_name (char *player_name_out)
 Copy the name of the current player.
 
uint32_t music_get_ms_since_pos_last_updated (void)
 Time since the backend last reported the track position.
 
void music_get_pos (uint32_t *track_pos_ms, uint32_t *track_length_ms)
 Get the estimated track position and the track length.
 
int32_t music_get_playback_rate_percent (void)
 Get the playback rate.
 
uint8_t music_get_volume_percent (void)
 Get the player volume.
 
MusicPlayState music_get_playback_state (void)
 Get the playback state.
 
bool music_is_playback_state_reporting_supported (void)
 Check whether the backend reports the playback state.
 
bool music_is_progress_reporting_supported (void)
 Check whether the backend reports playback progress.
 
bool music_is_volume_reporting_supported (void)
 Check whether the backend reports the player volume.
 
void music_command_send (MusicCommand command)
 Send a command to the player, best effort.
 
bool music_is_command_supported (MusicCommand command)
 Check whether the connected backend supports a command.
 
bool music_skip_seeks_within_track (void)
 Check whether next/previous track commands seek within the track.
 
bool music_needs_user_to_start_playback_on_phone (void)
 Check whether playback must be started by the user on the phone.
 
void music_request_reduced_latency (bool reduced_latency)
 Enable or disable a reduced latency mode on the backend connection.
 
void music_request_low_latency_for_period (uint32_t period_seconds)
 Request the lowest connection latency for a limited time.
 
const char * music_get_connected_server_debug_name (void)
 Get the debug name of the connected backend, for tests.
 
uint8_t music_get_now_playing_generation (void)
 Get the now-playing generation token.
 
bool music_album_art_is_current (void)
 Check whether the held album art belongs to the current track.
 
const struct GBitmap * music_album_art_lock (void)
 Borrow the current album art for drawing.
 
void music_album_art_unlock (void)
 Release the album art borrowed with music_album_art_lock().