Module lua_libpulse_glib.context
Bindings for libpulse’s connection context.
The connection Context provides introspection calls to query state from the server and various commands to change this state.
In many cases, sinks and sources may be addressed by either their name or their numeric index.
Both can be queried using the get_(sink|source)_info
or get_(sink|source)s
calls.
Table of contents
Class Context
Context:connect([server_address=nil], cb) | Connects the context to the given server address. |
Context:disconnect() | Disconnects from the server. |
Context:get_state() | Returns the current connection state. |
Context:set_default_sink(sink) | Sets the default sink. |
Context:set_default_source(source) | Sets the default source. |
Context:get_server_info(cb) | Gets information about the server the context is connected to. |
Context:get_sink_info(sink, cb) | Gets information about the given sink. |
Context:get_sinks(cb) | Gets information about all sinks. |
Context:set_sink_volume(sink, volume, cb) | Sets the sink’s volume to the given value. |
Context:set_sink_mute(sink, mute, cb) | Sets the sink’s mute state. |
Context:set_sink_suspended(sink, suspended, cb) | Sets the sink’s suspended state. |
Context:get_sink_input_info(sink, cb) | Gets information about the given sink input. |
Context:get_sink_inputs(cb) | Gets information about all sink inputs. |
Context:set_sink_suspended(The, sink, cb) | Moves the sink input to a different name. |
Context:set_sink_input_volume(sink_input, volume, cb) | Sets the sink input’s volume to the given value. |
Context:set_sink_input_mute(sink_input, mute, cb) | Sets the sink input’s mute state. |
Context:kill_sink_input(sink_input, cb) | Kills the sink input. |
Context:get_source_info(source, cb) | Gets information about the given source. |
Context:get_sources(cb) | Gets information about all sources. |
Context:set_source_volume(source, volume, cb) | Sets the source’s volume to the given value. |
Context:set_source_mute(source, mute, cb) | Sets the source’s mute state. |
Context:set_source_suspended(source, suspended, cb) | Sets the source’s suspended state. |
Context:get_source_output_info(source_output, cb) | Gets information about the given source output. |
Context:get_source_outputs(cb) | Gets information about all source outputs. |
Context:set_source_suspended(The, source, cb) | Moves the source output to a different name. |
Context:set_source_output_volume(source_output, volume, cb) | Sets the source output’s volume to the given value. |
Context:set_source_output_mute(source_output, mute, cb) | Sets the source output’s mute state. |
Context:kill_source_output(source_output, cb) | Kills the source output. |
Class Context
If the server address is nil
, libpulse will attempt to connect to what it considers the default server.
In most cases, this is the local machine.
The provided callback function will be registered as state callback function, and will be called whenever the context’s connection state changes.
Parameters:
-
server_address : The server address.
-
cb : The connection state callback.
Callback parameters:
-
The error message
-
The state
Returns:
Parameters:
-
sink : Name of the sink to set as default.
Callback parameters:
-
error
-
Parameters:
-
source : Name of the source to set as default.
Callback parameters:
-
error
-
See pa_server_info for documentation on the return type.
This will fail when the connection state is anything other than READY
.
Parameters:
-
cb
Callback parameters:
-
string The error
-
table The server info.
The sink may be indicated by either its name or its index.
See pa_sink_info for documentation on the return type.
Parameters:
-
sink : The index or name of the sink to query.
-
cb
Callback parameters:
This returns the same information as Context:get_sink_info would have returned for every sink that’s currently registered at the server.
See pa_sink_info for documentation on the return type.
Parameters:
-
cb
Callback parameters:
The sink may be indicated by either its name or its index.
Parameters:
-
sink : The sink to update.
-
volume
-
cb
Callback parameters:
The sink may be indicated by either its name or its index.
Parameters:
-
sink : The sink to update.
-
mute
-
cb
Callback parameters:
The sink may be indicated by either its name or its index.
Parameters:
-
sink : The sink to update.
-
suspended
-
cb
Callback parameters:
The sink input may be indicated by either its name or its index.
See pa_sink_input_info for documentation on the return type.
Parameters:
-
sink : input The index or name of the sink input to query.
-
cb
Callback parameters:
This returns the same information as Context:get_sink_input_info would have returned for every sink input that’s currently registered at the server.
See pa_sink_input_info for documentation on the return type.
Parameters:
-
cb
Callback parameters:
The target sink may be indicated by either its name or its index.
Parameters:
-
The : sink input to move.
-
sink : The sink to update.
-
cb
Callback parameters:
Parameters:
-
sink_input : The sink input to update.
-
volume
-
cb
Callback parameters:
Parameters:
-
sink_input : The sink input to update.
-
mute
-
cb
Callback parameters:
Parameters:
-
sink_input : The sink input to kill.
-
cb
Callback parameters:
The source may be indicated by either its name or its index.
See pa_source_info for documentation on the return type.
Parameters:
-
source : The index or name of the source to query.
-
cb
Callback parameters:
This returns the same information as Context:get_source_info would have returned for every source that’s currently registered at the server.
See pa_source_info for documentation on the return type.
Parameters:
-
cb
Callback parameters:
The source may be indicated by either its name or its index.
Parameters:
-
source : The source to update.
-
volume
-
cb
Callback parameters:
The source may be indicated by either its name or its index.
Parameters:
-
source : The source to update.
-
mute
-
cb
Callback parameters:
The source may be indicated by either its name or its index.
Parameters:
-
source : The source to update.
-
suspended
-
cb
Callback parameters:
See pa_source_output_info for documentation on the return type.
Parameters:
-
source_output : The index of the source output to query.
-
cb
Callback parameters:
This returns the same information as Context:get_source_output_info would have returned for every source output that’s currently registered at the server.
See pa_source_output_info for documentation on the return type.
Parameters:
-
cb
Callback parameters:
The target source may be indicated by either its name or its index.
Parameters:
-
The : source output to move.
-
source : The source to update.
-
cb
Callback parameters:
Parameters:
-
source_output : The source output to update.
-
volume
-
cb
Callback parameters:
Parameters:
-
source_output : The source output to update.
-
mute
-
cb
Callback parameters:
Parameters:
-
source_output : The source output to kill.
-
cb