|
Discman
|
Handles the interactions with the Bluetooth device selection screen. More...
#include <bluetooth_component.h>


Classes | |
| class | DevicesListColumnRecord |
| Bluetooth device list columns. More... | |
Public Types | |
| typedef sigc::signal< void()> | sig_done |
| "Done with screen" signal type. | |
| typedef sigc::signal< void()> | sig_conn |
| "Connected" signal type. | |
| typedef sigc::signal< void()> | sig_button |
| "Button clicked" signal type. | |
Public Member Functions | |
| BluetoothComponent (Glib::RefPtr< Gtk::Builder > builder) | |
| BluetoothComponent constructor. | |
| ~BluetoothComponent () | |
| BluetoothComponent destructor. | |
| void | on_show () |
| Called when the Bluetooth device selection screen is navigated to. | |
| void | on_hide () |
| Called when the Bluetooth device selection screen is navigated from. | |
| void | on_device_initialization_complete (const bool initialized) |
| Called when the Bluetooth device initialization procedure has finished. | |
| sig_button | signal_button () |
| Getter for _signal_button. | |
| sig_done | signal_done () |
| Getter for _signal_done. | |
| sig_conn | signal_connected () |
| Getter for _signal_connected. | |
Private Types | |
| enum | DeviceInitialization { NotInitialized , Initialized , Error } |
| Bluetooth device initialization state. More... | |
Private Member Functions | |
| void | on_bluetooth_button () |
| Bluetooth button handler. | |
| void | on_done_button_clicked () |
| Called when the Done button is clicked. | |
| void | on_device_added (const std::string &address) |
| Called when _adapter discovers a new device. | |
| void | on_device_removed (const std::string &address) |
| Called when _adapter reports a removed device. | |
| void | on_devices_list_selection_changed () |
| Called when a device is clicked in the device list. | |
| void | on_connect_button_clicked () |
| Called when the Connect/Disconnect button is clicked. | |
| void | on_device_status_change () |
| Called when the chosen device pairs, connects or disconnects. | |
| void | build_devices_list () |
| Builds the initial list of preregistered Bluetooth devices. | |
| void | get_alsa_device_address () |
| Retrieves the device MAC address from the ALSA configuration file. | |
| void | try_get_alsa_device () |
| Attempts to set _alsa_device based on _alsa_device_address. | |
| void | set_device_labels () |
| Updates _device_label and _device_status_label based on current state. | |
| void | update_asoundrc (const std::string &address) |
| Update the ALSA configuration file with the newly selected Bluetooth device. | |
Private Attributes | |
| sig_button | _signal_button |
| Emitted when the Bluetooth button is clicked. | |
| sig_conn | _signal_connected |
| Emitted when the chosen device has been connected to. | |
| sig_done | _signal_done |
| Emitted when the Done button is clicked. | |
| Bluez::Adapter | _adapter |
| Bluetooth adapter used for pairing and connection. | |
| std::string | _alsa_device_address |
| MAC address of the chosen device. | |
| Bluez::Device * | _alsa_device |
| Bluetooth device retrieved from _adapter. | |
| Gtk::Button * | _bluetooth_button |
| Button that switches to the Bluetooth device selection screen. | |
| Gtk::Label * | _device_label |
| Label displaying the chosen device alias. | |
| Gtk::Label * | _device_status_label |
| Label displaying chosen device connection status. | |
| Gtk::TreeView * | _devices_tree_view |
| Device list. | |
| Glib::RefPtr< Gtk::ListStore > | _devices_list_store |
| Device list model. | |
| Gtk::Button * | _done_button |
| Done button. | |
| Gtk::Button * | _connect_button |
| Connect/Disconnect button. | |
| DeviceInitialization | _alsa_device_init |
| Initialization status of the chosen device. | |
Additional Inherited Members | |
Protected Member Functions inherited from Component | |
| Component () | |
| virtual | ~Component ()=0 |
Handles the interactions with the Bluetooth device selection screen.
Definition at line 30 of file bluetooth_component.h.
| typedef sigc::signal<void()> BluetoothComponent::sig_button |
"Button clicked" signal type.
Definition at line 40 of file bluetooth_component.h.
| typedef sigc::signal<void()> BluetoothComponent::sig_conn |
"Connected" signal type.
Definition at line 37 of file bluetooth_component.h.
| typedef sigc::signal<void()> BluetoothComponent::sig_done |
"Done with screen" signal type.
Definition at line 34 of file bluetooth_component.h.
|
private |
Bluetooth device initialization state.
| Enumerator | |
|---|---|
| NotInitialized | |
| Initialized | |
| Error | |
Definition at line 63 of file bluetooth_component.h.
| BluetoothComponent::BluetoothComponent | ( | Glib::RefPtr< Gtk::Builder > | builder | ) |
BluetoothComponent constructor.
| [in] | builder | The builder initialized with the widgets on the Bluetooth device selection screen. |
Definition at line 9 of file bluetooth_component.cc.
| BluetoothComponent::~BluetoothComponent | ( | ) |
BluetoothComponent destructor.
Definition at line 33 of file bluetooth_component.cc.
|
private |
Builds the initial list of preregistered Bluetooth devices.
Definition at line 174 of file bluetooth_component.cc.
|
private |
Retrieves the device MAC address from the ALSA configuration file.
Definition at line 188 of file bluetooth_component.cc.
|
private |
Bluetooth button handler.
Definition at line 243 of file bluetooth_component.cc.
|
private |
Called when the Connect/Disconnect button is clicked.
Definition at line 141 of file bluetooth_component.cc.
|
private |
Called when _adapter discovers a new device.
Definition at line 79 of file bluetooth_component.cc.
| void BluetoothComponent::on_device_initialization_complete | ( | const bool | initialized | ) |
Called when the Bluetooth device initialization procedure has finished.
| [in] | initialized | initialized (true) or error (false) |
Definition at line 58 of file bluetooth_component.cc.
|
private |
Called when _adapter reports a removed device.
Definition at line 94 of file bluetooth_component.cc.
|
private |
Called when the chosen device pairs, connects or disconnects.
Definition at line 162 of file bluetooth_component.cc.
|
private |
Called when a device is clicked in the device list.
Definition at line 114 of file bluetooth_component.cc.
|
private |
Called when the Done button is clicked.
Definition at line 75 of file bluetooth_component.cc.
| void BluetoothComponent::on_hide | ( | ) |
Called when the Bluetooth device selection screen is navigated from.
Definition at line 54 of file bluetooth_component.cc.
| void BluetoothComponent::on_show | ( | ) |
Called when the Bluetooth device selection screen is navigated to.
Definition at line 44 of file bluetooth_component.cc.
|
private |
Updates _device_label and _device_status_label based on current state.
Definition at line 220 of file bluetooth_component.cc.
| BluetoothComponent::sig_done BluetoothComponent::signal_button | ( | ) |
Getter for _signal_button.
Definition at line 63 of file bluetooth_component.cc.
| BluetoothComponent::sig_conn BluetoothComponent::signal_connected | ( | ) |
Getter for _signal_connected.
Definition at line 71 of file bluetooth_component.cc.
| BluetoothComponent::sig_done BluetoothComponent::signal_done | ( | ) |
Getter for _signal_done.
Definition at line 67 of file bluetooth_component.cc.
|
private |
Attempts to set _alsa_device based on _alsa_device_address.
Definition at line 206 of file bluetooth_component.cc.
|
private |
Update the ALSA configuration file with the newly selected Bluetooth device.
| [in] | address | MAC address of the selected device. |
Definition at line 123 of file bluetooth_component.cc.
|
private |
Bluetooth adapter used for pairing and connection.
Definition at line 85 of file bluetooth_component.h.
|
private |
Bluetooth device retrieved from _adapter.
Definition at line 87 of file bluetooth_component.h.
|
private |
MAC address of the chosen device.
Definition at line 86 of file bluetooth_component.h.
|
private |
Initialization status of the chosen device.
Definition at line 98 of file bluetooth_component.h.
|
private |
Button that switches to the Bluetooth device selection screen.
Definition at line 89 of file bluetooth_component.h.
|
private |
Connect/Disconnect button.
Definition at line 96 of file bluetooth_component.h.
|
private |
Label displaying the chosen device alias.
Definition at line 91 of file bluetooth_component.h.
|
private |
Label displaying chosen device connection status.
Definition at line 92 of file bluetooth_component.h.
|
private |
Device list model.
Definition at line 94 of file bluetooth_component.h.
|
private |
Device list.
Definition at line 93 of file bluetooth_component.h.
|
private |
Done button.
Definition at line 95 of file bluetooth_component.h.
|
private |
Emitted when the Bluetooth button is clicked.
Definition at line 81 of file bluetooth_component.h.
|
private |
Emitted when the chosen device has been connected to.
Definition at line 82 of file bluetooth_component.h.
|
private |
Emitted when the Done button is clicked.
Definition at line 83 of file bluetooth_component.h.