cody-music
Version:
mac osx spotify and itunes music player controller, spotify audio features, itunes and spotify genre, and playlist control
72 lines (71 loc) • 3.57 kB
TypeScript
import { PlayerDevice, Track, PlayerContext, Artist, PlayerName, CodyResponse } from "./models";
export declare const SPOTIFY_LIKED_SONGS_PLAYLIST_NAME = "Liked Songs";
export declare class MusicPlayerState {
private static instance;
private constructor();
static getInstance(): MusicPlayerState;
isWindowsSpotifyRunning(): Promise<boolean>;
isSpotifyWebRunning(): Promise<boolean>;
/**
* returns...
* {
"devices" : [ {
"id" : "5fbb3ba6aa454b5534c4ba43a8c7e8e45a63ad0e",
"is_active" : false,
"is_private_session": true,
"is_restricted" : false,
"name" : "My fridge",
"type" : "Computer",
"volume_percent" : 100
} ]
}
*/
getSpotifyDevices(): Promise<PlayerDevice[]>;
/**
* returns i.e.
* track = {
artist: 'Bob Dylan',
album: 'Highway 61 Revisited',
disc_number: 1,
duration: 370,
played count: 0,
track_number: 1,
starred: false,
popularity: 71,
id: 'spotify:track:3AhXZa8sUQht0UEdBJgpGc',
name: 'Like A Rolling Stone',
album_artist: 'Bob Dylan',
artwork_url: 'http://images.spotify.com/image/e3d720410b4a0770c1fc84bc8eb0f0b76758a358',
spotify_url: 'spotify:track:3AhXZa8sUQht0UEdBJgpGc' }
}
*/
getWindowsSpotifyTrackInfo(): Promise<any>;
getSpotifyTracks(ids: string[], includeArtistData?: boolean, includeAudioFeaturesData?: boolean, includeGenre?: boolean): Promise<Track[]>;
getSpotifyTrackById(id: string, includeArtistData?: boolean, includeAudioFeaturesData?: boolean, includeGenre?: boolean): Promise<Track>;
getSpotifyArtistsByIds(ids: string[]): Promise<Artist[]>;
getSpotifyArtistById(id: string): Promise<Artist>;
getSpotifyWebCurrentTrack(): Promise<Track>;
getSpotifyRecentlyPlayedTracksBefore(limit?: number, before?: number): Promise<CodyResponse>;
getSpotifyRecentlyPlayedTracksAfter(limit?: number, after?: number): Promise<CodyResponse>;
getSpotifyRecentlyPlayedTracks(limit?: number, after?: number, before?: number): Promise<Track[]>;
/**
* Fetch the recently played tracks data
* @param limit (max of 1000)
* @param after
* @param before
*/
fetchSpotifyReentlyPlayedTracksData(limit?: number, after?: number, before?: number): Promise<CodyResponse>;
getRecommendationsForTracks(seed_tracks?: string[], limit?: number, market?: string, min_popularity?: number, target_popularity?: number, seed_genres?: string[], seed_artists?: string[], features?: any): Promise<Track[]>;
setMute(mute: boolean, device_id?: string): Promise<CodyResponse>;
setShuffle(shuffle: boolean, device_id?: string): Promise<CodyResponse>;
setRepeatOff(device_id?: string): Promise<CodyResponse>;
setTrackRepeat(device_id?: string): Promise<CodyResponse>;
setPlaylistRepeat(device_id?: string): Promise<CodyResponse>;
updateRepeatMode(setToOn: boolean, device_id?: string): Promise<CodyResponse>;
setRepeat(state: string, device_id?: string): Promise<CodyResponse>;
getSpotifyPlayerContext(): Promise<PlayerContext>;
launchAndPlaySpotifyTrack(trackId?: string, playlistId?: string, playerName?: PlayerName): Promise<void>;
playSpotifyTrackFromPlaylist(trackId: string, spotifyUserId: string, playlistId?: string): Promise<void>;
launchWebPlayer(options: any): Promise<any>;
updateSpotifyLoved(loved: boolean): void;
}