// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
// This file is automatically generated. DO NOT EDIT

/**
 * Player handles audio playback and state management.
 * 
 * Lock ordering: always acquire p.mu BEFORE speaker.Lock().
 * The beep playback-finished callback dispatches to a new goroutine
 * so it never holds p.mu while the speaker lock is held.
 * @module
 */

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import { Call as $Call, CancellablePromise as $CancellablePromise } from "@wailsio/runtime";

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Unused imports
import * as $models from "./models.js";

/**
 * ChangeVolume adjusts the volume by a relative amount.
 */
export function ChangeVolume(deltaVolume: number): $CancellablePromise<void> {
    return $Call.ByID(742861629, deltaVolume);
}

/**
 * CurrentPosition returns the playback position as a percentage
 * (0-100).
 */
export function CurrentPosition(): $CancellablePromise<number> {
    return $Call.ByID(2723620683);
}

/**
 * CurrentPositionSeconds returns the current playback position in
 * display seconds.
 */
export function CurrentPositionSeconds(): $CancellablePromise<number> {
    return $Call.ByID(1423359008);
}

/**
 * EmitCurrentState pushes the current player state to the frontend.
 * This is intended to be called after the frontend is ready to
 * receive events, separately from RestoreState which does the heavy
 * lifting during OnStartup.
 */
export function EmitCurrentState(): $CancellablePromise<void> {
    return $Call.ByID(2143346946);
}

/**
 * GetCurrentTrackInfo returns information about the currently
 * loaded track.
 */
export function GetCurrentTrackInfo(): $CancellablePromise<$models.TrackInfo> {
    return $Call.ByID(2615351053);
}

/**
 * InitSpeaker initializes the audio output device. This is
 * separated from NewPlayer so the player struct can be created
 * before wails.Run (for binding registration) while deferring
 * hardware initialization to OnStartup.
 */
export function InitSpeaker(): $CancellablePromise<void> {
    return $Call.ByID(3317123670);
}

/**
 * IsPlaying reports whether the player is currently playing audio.
 */
export function IsPlaying(): $CancellablePromise<boolean> {
    return $Call.ByID(1219303535);
}

/**
 * LoadFile opens and decodes an audio file for playback.
 */
export function LoadFile(filePath: string): $CancellablePromise<void> {
    return $Call.ByID(2214941041, filePath);
}

/**
 * MuteToggle toggles the mute state.
 */
export function MuteToggle(): $CancellablePromise<void> {
    return $Call.ByID(2840614678);
}

/**
 * Muted reports whether playback is currently silenced.
 */
export function Muted(): $CancellablePromise<boolean> {
    return $Call.ByID(2954670878);
}

/**
 * Pause pauses the current playback.
 */
export function Pause(): $CancellablePromise<void> {
    return $Call.ByID(1402758839);
}

/**
 * Play starts or resumes audio playback.
 */
export function Play(): $CancellablePromise<void> {
    return $Call.ByID(3327176373);
}

/**
 * RestoreState loads the persisted player state from the database.
 */
export function RestoreState(): $CancellablePromise<void> {
    return $Call.ByID(318202560);
}

/**
 * SaveState persists the current player state to the database and
 * waits for the write.  This is called during shutdown to capture the
 * final state, which is the one case that cannot be deferred.
 */
export function SaveState(): $CancellablePromise<void> {
    return $Call.ByID(3845072215);
}

/**
 * Seek jumps to a specific position in seconds.
 */
export function Seek(targetSeconds: number): $CancellablePromise<void> {
    return $Call.ByID(829056707, targetSeconds);
}

/**
 * SetVolume sets the playback volume (0-100), emits a
 * VolumeChanged event, and persists the new level.
 */
export function SetVolume(desiredVolume: $models.UserVolume): $CancellablePromise<void> {
    return $Call.ByID(1375836663, desiredVolume);
}

/**
 * SystemOwnsVolume reports whether the platform's own control is the
 * only volume control there is, so this app neither offers one nor
 * remembers a level.
 * 
 * It is bound: the frontend renders no `<volume-control>` when it is
 * true, at any width.
 */
export function SystemOwnsVolume(): $CancellablePromise<boolean> {
    return $Call.ByID(1027623185);
}

/**
 * TrackLengthInSeconds returns the duration of the current track.
 */
export function TrackLengthInSeconds(): $CancellablePromise<number> {
    return $Call.ByID(3749851426);
}

/**
 * UnloadTrack tears down the current track, releasing the file and
 * streamer chain. The player returns to the initial "no track
 * loaded" state and emits events so the frontend clears its
 * current-track display.
 */
export function UnloadTrack(): $CancellablePromise<void> {
    return $Call.ByID(3127425467);
}
