soundcraft-ui-connection
Version:
Library for controlling the Soundcraft Ui series audio mixers
82 lines (81 loc) • 2.85 kB
TypeScript
import { MixerConnection } from '../mixer-connection';
import { MixerStore } from '../state/mixer-store';
import { PlayerState, PlaylistsWithTracks } from '../types';
/**
* Represents the media player
*/
export declare class Player {
private conn;
private store;
/** Current state (playing, stopped, paused) */
readonly state$: import('rxjs').Observable<PlayerState>;
/** Current playlist name */
readonly playlist$: import('rxjs').Observable<string>;
/** Current track name */
readonly track$: import('rxjs').Observable<string>;
/** Current track length in seconds */
readonly length$: import('rxjs').Observable<number>;
/** Elapsed time of current track in seconds */
readonly elapsedTime$: import('rxjs').Observable<number>;
/** Remaining time of current track in seconds */
readonly remainingTime$: import('rxjs').Observable<number>;
/** Shuffle state */
readonly shuffle$: import('rxjs').Observable<boolean>;
/**
* All available playlists with their tracks (playlist name -> track names).
* Fetched on connect; refresh manually with {@link refreshPlaylists}.
*/
readonly playlistsWithTracks$: import('rxjs').Observable<PlaylistsWithTracks>;
/**
* Names of all available playlists.
* Fetched on connect; refresh manually with {@link refreshPlaylists}.
*/
readonly playlists$: import('rxjs').Observable<string[]>;
constructor(conn: MixerConnection, store: MixerStore);
/** Start the media player */
play(): void;
/** Pause the media player */
pause(): void;
/** Stop the media player */
stop(): void;
/** Jump to next track */
next(): void;
/** Jump to previous track */
prev(): void;
/**
* Load a playlist by name
* @param playlist Playlist name
*/
loadPlaylist(playlist: string): void;
/**
* Load a track from a given playlist
* @param playlist Playlist name
* @param track Track name on the playlist
*/
loadTrack(playlist: string, track: string): void;
/**
* Set player shuffle state
* @param value shuffle state
*/
setShuffle(value: boolean): void;
/**
* Toggle player shuffle state
*/
toggleShuffle(): void;
/**
* Set player mode like `manual` or `auto`.
* Values are rather internal, please use convenience functions `manual()` and `auto()`.
* @param value
*/
setPlayMode(value: number): void;
/** Enable manual mode */
setManual(): void;
/** Enable automatic mode */
setAuto(): void;
/**
* Request the list of playlists and their tracks from the mixer.
* Results are exposed through {@link playlists$} and {@link playlistsWithTracks$}.
* This is called automatically on every connection open.
*/
refreshPlaylists(): void;
}