7 #ifndef BLUETOOTH_COMPONENT_H
8#define BLUETOOTH_COMPONENT_H
17#include <gtkmm/builder.h>
18#include <gtkmm/button.h>
19#include <gtkmm/label.h>
20#include <gtkmm/treeview.h>
21#include <gtkmm/treemodel.h>
22#include <gtkmm/liststore.h>
23#include <sigc++/signal.h>
25#include <bluez/adapter.h>
DevicesListColumnRecord()
Gtk::TreeModelColumn< Glib::ustring > name_column
Device name column.
Gtk::TreeModelColumn< Glib::ustring > address_column
Device address column (hidden).
Gtk::Button * _connect_button
Connect/Disconnect button.
void on_show()
Called when the Bluetooth device selection screen is navigated to.
Gtk::Button * _bluetooth_button
Button that switches to the Bluetooth device selection screen.
Gtk::Button * _done_button
Done button.
void on_bluetooth_button()
Bluetooth button handler.
sig_conn _signal_connected
Emitted when the chosen device has been connected to.
void on_device_added(const std::string &address)
Called when _adapter discovers a new device.
Gtk::TreeView * _devices_tree_view
Device list.
void set_device_labels()
Updates _device_label and _device_status_label based on current state.
sig_done _signal_done
Emitted when the Done button is clicked.
void get_alsa_device_address()
Retrieves the device MAC address from the ALSA configuration file.
void on_device_initialization_complete(const bool initialized)
Called when the Bluetooth device initialization procedure has finished.
void update_asoundrc(const std::string &address)
Update the ALSA configuration file with the newly selected Bluetooth device.
sig_conn signal_connected()
Getter for _signal_connected.
Bluez::Device * _alsa_device
Bluetooth device retrieved from _adapter.
void on_connect_button_clicked()
Called when the Connect/Disconnect button is clicked.
~BluetoothComponent()
BluetoothComponent destructor.
Glib::RefPtr< Gtk::ListStore > _devices_list_store
Device list model.
BluetoothComponent(Glib::RefPtr< Gtk::Builder > builder)
BluetoothComponent constructor.
sigc::signal< void()> sig_conn
"Connected" signal type.
void build_devices_list()
Builds the initial list of preregistered Bluetooth devices.
void on_device_status_change()
Called when the chosen device pairs, connects or disconnects.
void on_device_removed(const std::string &address)
Called when _adapter reports a removed device.
Gtk::Label * _device_status_label
Label displaying chosen device connection status.
sig_button _signal_button
Emitted when the Bluetooth button is clicked.
std::string _alsa_device_address
MAC address of the chosen device.
sigc::signal< void()> sig_button
"Button clicked" signal type.
sig_done signal_done()
Getter for _signal_done.
sigc::signal< void()> sig_done
"Done with screen" signal type.
DeviceInitialization
Bluetooth device initialization state.
Bluez::Adapter _adapter
Bluetooth adapter used for pairing and connection.
DeviceInitialization _alsa_device_init
Initialization status of the chosen device.
void on_hide()
Called when the Bluetooth device selection screen is navigated from.
Gtk::Label * _device_label
Label displaying the chosen device alias.
sig_button signal_button()
Getter for _signal_button.
void try_get_alsa_device()
Attempts to set _alsa_device based on _alsa_device_address.
void on_devices_list_selection_changed()
Called when a device is clicked in the device list.
void on_done_button_clicked()
Called when the Done button is clicked.