Cvc.MixerControl

g Cvc.MixerControl Cvc.MixerControl GObject.Object GObject.Object GObject.Object->Cvc.MixerControl

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (name)

change_input (input)

change_output (output)

change_profile_on_selected_device (device, profile)

close ()

get_cards ()

get_default_sink ()

get_default_source ()

get_event_sink_input ()

get_sink_inputs ()

get_sinks ()

get_source_outputs ()

get_sources ()

get_state ()

get_stream_from_device (device)

get_streams ()

get_vol_max_amplified ()

get_vol_max_norm ()

lookup_card_id (id)

lookup_device_from_stream (stream)

lookup_input_id (id)

lookup_output_id (id)

lookup_stream_id (id)

open ()

set_default_sink (stream)

set_default_source (stream)

set_headset_port (id, choices)

Virtual Methods

Inherited:

GObject.Object (7)

do_active_input_update (id)

do_active_output_update (id)

do_audio_device_selection_needed (id, show_dialog, choices)

do_card_added (id)

do_card_removed (id)

do_default_sink_changed (id)

do_default_source_changed (id)

do_input_added (id)

do_input_removed (id)

do_output_added (id)

do_output_removed (id)

do_state_changed (new_state)

do_stream_added (id)

do_stream_changed (id)

do_stream_removed (id)

Properties

Name

Type

Flags

Short Description

name

str

r/w/co

Name to display for this mixer control

Signals

Inherited:

GObject.Object (1)

Name

Short Description

active-input-update

active-output-update

audio-device-selection-needed

card-added

card-removed

default-sink-changed

default-source-changed

input-added

input-removed

output-added

output-removed

state-changed

stream-added

stream-changed

stream-removed

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Cvc.MixerControl(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Cvc.MixerControlClass

classmethod new(name)
Parameters:

name (str) –

Return type:

Cvc.MixerControl

change_input(input)
Parameters:

input (Cvc.MixerUIDevice) –

This method is called from the UI when the user selects a previously unselected device.

  • Firstly it queries the stream from the device.

    • It assumes that if the stream is null that it cannot be a bluetooth or network stream (they never show unless they have valid sinks and sources) In the scenario of a None stream on the device

      • It fetches the device’s preferred profile or if NUll the profile with the highest priority on that device.

      • It then caches this device in control->priv->cached_desired_input_id so that when the update_source triggered from when we attempt to change profile we will know exactly what device to highlight on that stream.

      • It attempts to swap the profile on the card from that device and returns.

  • Next, it handles network or bluetooth streams that only require their stream to be made the default.

  • Next it deals with port changes so if the stream’s active port is not the same as the port on the device it will attempt to change the port on that stream to be same as the device. If this fails it will return.

  • Finally it will set this new stream to be the default stream and emit a signal for the UI confirming the active input device.

change_output(output)
Parameters:

output (Cvc.MixerUIDevice) –

This method is called from the UI when the user selects a previously unselected device.

  • Firstly it queries the stream from the device.

    • It assumes that if the stream is null that it cannot be a bluetooth or network stream (they never show unless they have valid sinks and sources) In the scenario of a None stream on the device

      • It fetches the device’s preferred profile or if NUll the profile with the highest priority on that device.

      • It then caches this device in control->priv->cached_desired_output_id so that when the update_sink triggered from when we attempt to change profile we will know exactly what device to highlight on that stream.

      • It attempts to swap the profile on the card from that device and returns.

  • Next, it handles network or bluetooth streams that only require their stream to be made the default.

  • Next it deals with port changes so if the stream’s active port is not the same as the port on the device it will attempt to change the port on that stream to be same as the device. If this fails it will return.

  • Finally it will set this new stream to be the default stream and emit a signal for the UI confirming the active output device.

change_profile_on_selected_device(device, profile)
Parameters:
Returns:

This method will attempt to swap the profile on the card of the device with given profile name. If successfull it will set the preferred profile on that device so as we know the next time the user moves to that device it should have this profile active.

Return type:

bool

close()
Return type:

bool

get_cards()
Return type:

[Cvc.MixerCard]

get_default_sink()
Return type:

Cvc.MixerStream

get_default_source()
Return type:

Cvc.MixerStream

get_event_sink_input()
Return type:

Cvc.MixerStream

get_sink_inputs()
Return type:

[Cvc.MixerSinkInput]

get_sinks()
Return type:

[Cvc.MixerSink]

get_source_outputs()
Return type:

[Cvc.MixerSourceOutput]

get_sources()
Return type:

[Cvc.MixerSource]

get_state()
Return type:

Cvc.MixerControlState

get_stream_from_device(device)
Parameters:

device (Cvc.MixerUIDevice) –

Return type:

Cvc.MixerStream

get_streams()
Return type:

[Cvc.MixerStream]

get_vol_max_amplified()
Return type:

float

get_vol_max_norm()
Return type:

float

lookup_card_id(id)
Parameters:

id (int) –

Return type:

Cvc.MixerCard

lookup_device_from_stream(stream)
Parameters:

stream (Cvc.MixerStream) –

Returns:

a #GvcUIDevice or None

Return type:

Cvc.MixerUIDevice

lookup_input_id(id)
Parameters:

id (int) –

Return type:

Cvc.MixerUIDevice

lookup_output_id(id)
Parameters:

id (int) –

Return type:

Cvc.MixerUIDevice

lookup_stream_id(id)
Parameters:

id (int) –

Return type:

Cvc.MixerStream

open()
Return type:

bool

set_default_sink(stream)
Parameters:

stream (Cvc.MixerStream) –

Return type:

bool

set_default_source(stream)
Parameters:

stream (Cvc.MixerStream) –

Return type:

bool

set_headset_port(id, choices)
Parameters:
do_active_input_update(id) virtual
Parameters:

id (int) –

do_active_output_update(id) virtual
Parameters:

id (int) –

do_audio_device_selection_needed(id, show_dialog, choices) virtual
Parameters:
do_card_added(id) virtual
Parameters:

id (int) –

do_card_removed(id) virtual
Parameters:

id (int) –

do_default_sink_changed(id) virtual
Parameters:

id (int) –

do_default_source_changed(id) virtual
Parameters:

id (int) –

do_input_added(id) virtual
Parameters:

id (int) –

do_input_removed(id) virtual
Parameters:

id (int) –

do_output_added(id) virtual
Parameters:

id (int) –

do_output_removed(id) virtual
Parameters:

id (int) –

do_state_changed(new_state) virtual
Parameters:

new_state (Cvc.MixerControlState) –

do_stream_added(id) virtual
Parameters:

id (int) –

do_stream_changed(id) virtual
Parameters:

id (int) –

do_stream_removed(id) virtual
Parameters:

id (int) –

Signal Details

Cvc.MixerControl.signals.active_input_update(mixer_control, object)
Signal Name:

active-input-update

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.active_output_update(mixer_control, object)
Signal Name:

active-output-update

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.audio_device_selection_needed(mixer_control, object, p0, p1)
Signal Name:

audio-device-selection-needed

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.card_added(mixer_control, object)
Signal Name:

card-added

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.card_removed(mixer_control, object)
Signal Name:

card-removed

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.default_sink_changed(mixer_control, object)
Signal Name:

default-sink-changed

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.default_source_changed(mixer_control, object)
Signal Name:

default-source-changed

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.input_added(mixer_control, object)
Signal Name:

input-added

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.input_removed(mixer_control, object)
Signal Name:

input-removed

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.output_added(mixer_control, object)
Signal Name:

output-added

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.output_removed(mixer_control, object)
Signal Name:

output-removed

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.state_changed(mixer_control, object)
Signal Name:

state-changed

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.stream_added(mixer_control, object)
Signal Name:

stream-added

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.stream_changed(mixer_control, object)
Signal Name:

stream-changed

Flags:

RUN_LAST

Parameters:
Cvc.MixerControl.signals.stream_removed(mixer_control, object)
Signal Name:

stream-removed

Flags:

RUN_LAST

Parameters:

Property Details

Cvc.MixerControl.props.name
Name:

name

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Name to display for this mixer control