Clapper.Server¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/en |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Error signal when server could not start. |
Fields¶
- Inherited:
Class Details¶
- class Clapper.Server(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
An optional Server feature to add to the player.
Clapper.Server
is a feature that hosts a local server providing an ability to both monitor and control playback through WebSocket messages and HTTP requests.Use [const`Clapper`.HAVE_SERVER] macro to check if Clapper API was compiled with this feature.
- classmethod new()¶
- Returns:
a new
Clapper.Server
instance.- Return type:
Creates a new
Clapper.Server
instance.
- get_current_port()¶
- Returns:
Current listening port or 0 if server is not listening.
- Return type:
Get port on which server is currently listening on.
- get_enabled()¶
-
Get whether
Clapper.Server
is set to be running.
- get_port()¶
- Returns:
Requested listening port or 0 when using random port.
- Return type:
Get requested server listening port.
If you want to know the port server is currently listening on, use [method`Clapper`.Server.get_current_port] instead.
- get_queue_controllable()¶
- Returns:
True
if control overClapper.Queue
is allowed,False
otherwise.- Return type:
Get whether remote self clients can control [class`Clapper`.Queue].
- get_running()¶
-
Get whether
Clapper.Server
is currently running.
- set_enabled(enabled)¶
- Parameters:
enabled (
bool
) – ifClapper.Server
should run
Set whether
Clapper.Server
should be running.Note that server feature will run only after being added to the player. It can be however set to enabled earlier. If server was already added, changing this property allows to start/stop server at any time.
To be notified when server is actually running/stopped after being enabled/disabled, you can listen for changes to [property`Clapper`.Server:running] property.
- set_port(port)¶
- Parameters:
port (
int
) – a port number or 0 for random free port
Set server listening port.
- set_queue_controllable(controllable)¶
- Parameters:
controllable (
bool
) – ifClapper.Queue
should be controllable
Set whether remote self clients can control [class`Clapper`.Queue].
This includes ability to add/remove items from the queue and selecting current item for playback remotely using WebSocket messages.
You probably want to keep this disabled if your application is supposed to manage what is played now and not WebSocket client.
Signal Details¶
- Clapper.Server.signals.error(server, error)¶
- Signal Name:
error
- Flags:
- Parameters:
server (
Clapper.Server
) – The object which received the signalerror (
GLib.Error
) – aGLib.Error
Error signal when server could not start. This will be emitted from application main thread.
Property Details¶
- Clapper.Server.props.current_port¶
- Name:
current-port
- Type:
- Default Value:
0
- Flags:
Port on which server is currently listening on or 0 if not listening.
- Clapper.Server.props.enabled¶
- Name:
enabled
- Type:
- Default Value:
- Flags:
Whether server is enabled.
- Clapper.Server.props.port¶
- Name:
port
- Type:
- Default Value:
0
- Flags:
Port to listen on or 0 for using random unused port.
- Clapper.Server.props.queue_controllable¶
- Name:
queue-controllable
- Type:
- Default Value:
- Flags:
Whether remote server clients can control
Clapper.Queue
.
- Clapper.Server.props.running¶
- Name:
running
- Type:
- Default Value:
- Flags:
Whether server is currently running.