|
Discman
|
Manages the state of the disc drive and any removable (iPod) drive. More...
#include <drive_manager.h>

Classes | |
| struct | NoDriveException |
| Thrown when the assumption of the presence of a drive is false. More... | |
| class | Poller |
| The Poller uses a separate thread to poll the host for the presence of an audio CD. More... | |
Public Types | |
| enum | Drive { Disc , Removable } |
| The two drives supported. More... | |
| typedef sigc::signal< void(Drive)> | sig_drive |
| "Inserted" and "Ejected" shared signal type. | |
Public Member Functions | |
| DriveManager () | |
| DriveManager constructor. | |
| ~DriveManager () | |
| DriveManager destructor. | |
| sig_drive | signal_inserted () |
| Getter for ::_signal_inserted. | |
| sig_drive | signal_ejected () |
| Getter for ::_signal_ejected. | |
| void | eject (const Drive drive) |
| Eject one of the drives. | |
| bool | is_disc_present () const |
| Returns the (cached) property of disc presence. | |
| bool | is_removable_present () const |
| Returns the (cached) property of iPod presence. | |
| UDisks2::Filesystem & | removable () |
| Returns the UDisks2::Filesystem cassociated with the iPod. | |
| CDDrive & | disc_drive () |
| Returns the CDDrive associated with the disc drive. | |
Private Member Functions | |
| void | on_udisks2_init () |
| Called when UDisks2 initializes the list of preregisterd drives and filesystems. | |
| void | on_notification_from_poller () |
| Called when _dispatcher is notified. | |
| void | on_cddrive_eject () |
| Called when the disc drive successfully ejects. | |
| void | on_removable_added (const std::string &path) |
| Called when a new filesystem appears. | |
| void | on_removable_removed (const std::string &path) |
| Called when a filesystem is removed. | |
| void | on_removable_mounted (const std::string &) |
| Called when the removable drive is mounted. | |
| void | on_removable_unmounted () |
| Called when the removable drive is unmounted. | |
Private Attributes | |
| sig_drive | _sig_inserted |
| Emitted when a drive is inserted. | |
| sig_drive | _sig_ejected |
| Emitted when a drive is removed. | |
| CDDrive | _drive |
| The disc drive. | |
| UDisks2::Manager | _udisks2 |
| UDisks2 provides access to removable disks. | |
| UDisks2::Filesystem * | _removable_fs |
| The filesystem associated with the iPod. | |
| Poller * | _poller |
| When running, checks for the presence of a disc in _drive. | |
| Glib::Dispatcher | _dispatcher |
| Used to samely emit _sig_inserted for the disc drive. | |
| std::regex | _acceptable_fs_pat |
| Filters the filesystems reported by UDisks2 to acceptable ones. | |
Manages the state of the disc drive and any removable (iPod) drive.
Definition at line 22 of file drive_manager.h.
| typedef sigc::signal<void(Drive)> DriveManager::sig_drive |
"Inserted" and "Ejected" shared signal type.
Definition at line 38 of file drive_manager.h.
| enum DriveManager::Drive |
| DriveManager::DriveManager | ( | ) |
DriveManager constructor.
Definition at line 9 of file drive_manager.cc.
| DriveManager::~DriveManager | ( | ) |
DriveManager destructor.
Definition at line 20 of file drive_manager.cc.
| CDDrive & DriveManager::disc_drive | ( | ) |
Returns the CDDrive associated with the disc drive.
Definition at line 150 of file drive_manager.cc.
| void DriveManager::eject | ( | const Drive | drive | ) |
Eject one of the drives.
| [in] | drive | Drive::Disc or Drive::Removable. |
Definition at line 52 of file drive_manager.cc.
| bool DriveManager::is_disc_present | ( | ) | const |
Returns the (cached) property of disc presence.
Definition at line 134 of file drive_manager.cc.
| bool DriveManager::is_removable_present | ( | ) | const |
Returns the (cached) property of iPod presence.
Definition at line 138 of file drive_manager.cc.
|
private |
Called when the disc drive successfully ejects.
Definition at line 65 of file drive_manager.cc.
|
private |
Called when _dispatcher is notified.
Definition at line 94 of file drive_manager.cc.
|
private |
Called when a new filesystem appears.
| [in] | path | The D-Bus path to the filesystem. |
Definition at line 101 of file drive_manager.cc.
|
private |
Called when the removable drive is mounted.
Definition at line 126 of file drive_manager.cc.
|
private |
Called when a filesystem is removed.
| [in] | path | The D-Bus path to the filesystem. |
Definition at line 114 of file drive_manager.cc.
|
private |
Called when the removable drive is unmounted.
Definition at line 130 of file drive_manager.cc.
|
private |
Called when UDisks2 initializes the list of preregisterd drives and filesystems.
Definition at line 80 of file drive_manager.cc.
| UDisks2::Filesystem & DriveManager::removable | ( | ) |
Returns the UDisks2::Filesystem cassociated with the iPod.
Definition at line 142 of file drive_manager.cc.
| DriveManager::sig_drive DriveManager::signal_ejected | ( | ) |
Getter for ::_signal_ejected.
Definition at line 76 of file drive_manager.cc.
| DriveManager::sig_drive DriveManager::signal_inserted | ( | ) |
Getter for ::_signal_inserted.
Definition at line 72 of file drive_manager.cc.
|
private |
Filters the filesystems reported by UDisks2 to acceptable ones.
Definition at line 75 of file drive_manager.h.
|
private |
Used to samely emit _sig_inserted for the disc drive.
Definition at line 73 of file drive_manager.h.
|
private |
The disc drive.
Definition at line 66 of file drive_manager.h.
|
private |
When running, checks for the presence of a disc in _drive.
Definition at line 71 of file drive_manager.h.
|
private |
The filesystem associated with the iPod.
Definition at line 69 of file drive_manager.h.
|
private |
Emitted when a drive is removed.
Definition at line 64 of file drive_manager.h.
|
private |
Emitted when a drive is inserted.
Definition at line 63 of file drive_manager.h.
|
private |
UDisks2 provides access to removable disks.
Definition at line 68 of file drive_manager.h.