BAPS3 Specification

Feature: FileLoad

Provides the load request, for loading audio files, and the FILE response, for notifying upstream that a file has been loaded.

Dependencies

FileLoad depends on the concept of an initial file-loaded state, which is supplied by another feature such as PlayStop. Should no other feature provide such a state, the default state Ready may be used.

Conflicts

FileLoad may conflict with any other loading features.

States

Ejected — no file loaded

The state in which no file is loaded. Unless the server starts with a file loaded, this should be the initial state, overriding any initial state provided by a playback control feature (such as PlayStop), unless explicitly overridden by another feature.

Requests

load — load file

Synopsis

load <PATH>

Description

Loads the file at PATH, replacing any previously loaded file.

Will succeed and send FILE if the file has been loaded successfully. The state should then be set to the initial file-loaded state.

If the load failed, the state should be set to Ejected.

Responses

FILE — file loaded

Synopsis

FILE <PATH>

Description

FILE should be sent when:

Resources

/player

Resource group for player-related resources. Behaves as a simple composite resource. If defined in other features, treat as if singly defined.

/player/file

The currently loaded file.

GET

The GET representation should be equivalent to the file path announced in the latest FILE response (if the state is not Ejected), or nil if there is no file loaded (the state is Ejected). The value when the state is Quitting is undefined.

PUT

Given a string payload, this should behave as equivalent to the load Internal API request with the given string as the file path.

Given the nil payload, this should behave as equivalent to an eject request.

DELETE

As PUT with the nil payload.

/control/state (additional state)

Provides the Ejected state. Attempts to PUT the state to Ejected should behave in a manner equivalent to the eject Internal API request.