public class RemoteControlService extends Object implements ApplicationComponent<BeaTunes>
To execute an action, connect to the loopback address (ipv4: 127.0.0.1) and send a UTF-8-encoded action id (see
ApplicationAction.getId()) followed by a newline
The port to connect to can be read from the file
getPortFile()(ASCII encoded). The port may not stay stable between application restarts. The file should not exist, if beaTunes is not running.
Connections from other IP addresses than the loopback address is not allowed.
The service usually responds with a simple, JSON-formatted status message.
Important ids are:
audioplayer.pause.play, audioplayer.next, audioplayer.previous, audioplayer.volume.up, audioplayer.volume.down, audioplayer.mute, audioplayer.pause, audioplayer.playing, audioplayer.track, audioplayer.image, audioplayer.love.toggle.
To list all possible action ids, use the id
Ids may change without notice. You can obtain a complete set of registered action ids from
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description
getApplication()Returns the main application component.
getId()Unique id for each instance of this object.
static @NotNull Path
getPortFile()Returns the file name for the file that contains the current port number.
init()Initializes this component and its sub-components.
setApplication(BeaTunes beaTunes)Sets the main application component.
shutdown()Shuts down this component and its sub-components.
public RemoteControlService(BeaTunes application)
public void setApplication(BeaTunes beaTunes)Sets the main application component.
public BeaTunes getApplication()Returns the main application component.
public String getId()Unique id for each instance of this object.
public void init()Initializes this component and its sub-components.
@NotNull public static @NotNull Path getPortFile() throws IOExceptionReturns the file name for the file that contains the current port number. There is no guarantee, that the file actually exists. However, it should exists, if beaTunes is running.
- file with port number
IOException- if the file cannot be determined
public void shutdown() throws ShutdownVetoExceptionShuts down this component and its sub-components.