Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CDiscDriveHandlerPosix Class Reference

#include <DiscDriveHandlerPosix.h>

Inheritance diagram for CDiscDriveHandlerPosix:
IDiscDriveHandler

Public Member Functions

 CDiscDriveHandlerPosix ()=default
 Posix DiscDriveHandler constructor.
 
 ~CDiscDriveHandlerPosix () override=default
 Posix DiscDriveHandler default destructor.
 
DriveState GetDriveState (const std::string &devicePath) override
 Get the optical drive state provided its device path.
 
TrayState GetTrayState (const std::string &devicePath) override
 Get the optical drive tray state provided the drive device path.
 
void EjectDriveTray (const std::string &devicePath) override
 Eject the provided drive device.
 
void CloseDriveTray (const std::string &devicePath) override
 Close the provided drive device.
 
void ToggleDriveTray (const std::string &devicePath) override
 Toggle the state of a given drive device.
 
- Public Member Functions inherited from IDiscDriveHandler

Additional Inherited Members

- Static Public Member Functions inherited from IDiscDriveHandler
static std::shared_ptr< IDiscDriveHandlerCreateInstance ()
 Called to create platform-specific disc drive handler.
 
- Protected Member Functions inherited from IDiscDriveHandler
virtual ~IDiscDriveHandler ()=default
 
 IDiscDriveHandler ()=default
 

Constructor & Destructor Documentation

◆ CDiscDriveHandlerPosix()

CDiscDriveHandlerPosix::CDiscDriveHandlerPosix ( )
default

Posix DiscDriveHandler constructor.

◆ ~CDiscDriveHandlerPosix()

CDiscDriveHandlerPosix::~CDiscDriveHandlerPosix ( )
overridedefault

Posix DiscDriveHandler default destructor.

Member Function Documentation

◆ CloseDriveTray()

void CDiscDriveHandlerPosix::CloseDriveTray ( const std::string & devicePath)
overridevirtual

Close the provided drive device.

Note
Some drives support closing appart from opening/eject
Parameters
devicePaththe path for the device drive (e.g. /dev/sr0)

Implements IDiscDriveHandler.

◆ EjectDriveTray()

void CDiscDriveHandlerPosix::EjectDriveTray ( const std::string & devicePath)
overridevirtual

Eject the provided drive device.

Parameters
devicePaththe path for the device drive (e.g. /dev/sr0)

Implements IDiscDriveHandler.

◆ GetDriveState()

DriveState CDiscDriveHandlerPosix::GetDriveState ( const std::string & devicePath)
overridevirtual

Get the optical drive state provided its device path.

Parameters
devicePaththe path for the device drive (e.g. /dev/sr0)
Returns
The drive state

Implements IDiscDriveHandler.

◆ GetTrayState()

TrayState CDiscDriveHandlerPosix::GetTrayState ( const std::string & devicePath)
overridevirtual

Get the optical drive tray state provided the drive device path.

Parameters
devicePaththe path for the device drive (e.g. /dev/sr0)
Returns
The drive state

Implements IDiscDriveHandler.

◆ ToggleDriveTray()

void CDiscDriveHandlerPosix::ToggleDriveTray ( const std::string & devicePath)
overridevirtual

Toggle the state of a given drive device.

Will internally call EjectDriveTray or CloseDriveTray depending on the internal state of the drive (i.e. if open -> CloseDriveTray / if closed -> EjectDriveTray)

Parameters
devicePaththe path for the device drive (e.g. /dev/sr0)

Implements IDiscDriveHandler.


The documentation for this class was generated from the following files: