kodi
Public Member Functions | Static Public Member Functions | List of all members
IDiscDriveHandler Class Referenceabstract

Generic interface for platform disc drive handling. More...

#include <IDiscDriveHandler.h>

Inheritance diagram for IDiscDriveHandler:
Inheritance graph
[legend]

Public Member Functions

virtual DriveState GetDriveState (const std::string &devicePath)=0
 Get the optical drive state provided its device path. More...
 
virtual TrayState GetTrayState (const std::string &devicePath)=0
 Get the optical drive tray state provided the drive device path. More...
 
virtual void EjectDriveTray (const std::string &devicePath)=0
 Eject the provided drive device. More...
 
virtual void CloseDriveTray (const std::string &devicePath)=0
 Close the provided drive device. More...
 
virtual void ToggleDriveTray (const std::string &devicePath)=0
 Toggle the state of a given drive device. More...
 

Static Public Member Functions

static std::shared_ptr< IDiscDriveHandlerCreateInstance ()
 Called to create platform-specific disc drive handler. More...
 

Detailed Description

Generic interface for platform disc drive handling.

Member Function Documentation

◆ CloseDriveTray()

virtual void IDiscDriveHandler::CloseDriveTray ( const std::string &  devicePath)
pure virtual

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)

Implemented in CDiscDriveHandlerPosix, and CWin32DiscDriveHandler.

◆ CreateInstance()

std::shared_ptr< IDiscDriveHandler > IDiscDriveHandler::CreateInstance ( )
static

Called to create platform-specific disc drive handler.

This method is used to create platform-specific disc drive handler

◆ EjectDriveTray()

virtual void IDiscDriveHandler::EjectDriveTray ( const std::string &  devicePath)
pure virtual

Eject the provided drive device.

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

Implemented in CDiscDriveHandlerPosix, and CWin32DiscDriveHandler.

◆ GetDriveState()

virtual DriveState IDiscDriveHandler::GetDriveState ( const std::string &  devicePath)
pure virtual

Get the optical drive state provided its device path.

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

Implemented in CDiscDriveHandlerPosix, and CWin32DiscDriveHandler.

◆ GetTrayState()

virtual TrayState IDiscDriveHandler::GetTrayState ( const std::string &  devicePath)
pure virtual

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

Implemented in CDiscDriveHandlerPosix, and CWin32DiscDriveHandler.

◆ ToggleDriveTray()

virtual void IDiscDriveHandler::ToggleDriveTray ( const std::string &  devicePath)
pure virtual

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)

Implemented in CDiscDriveHandlerPosix, and CWin32DiscDriveHandler.


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