Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
IDiscDriveHandler Class Referenceabstract

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

#include <IDiscDriveHandler.h>

Inheritance diagram for IDiscDriveHandler:
CDiscDriveHandlerPosix CWin32DiscDriveHandler

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

virtual ~IDiscDriveHandler ()=default
 
 IDiscDriveHandler ()=default
 

Detailed Description

Generic interface for platform disc drive handling.

Constructor & Destructor Documentation

◆ ~IDiscDriveHandler()

virtual IDiscDriveHandler::~IDiscDriveHandler ( )
protectedvirtualdefault

◆ IDiscDriveHandler()

IDiscDriveHandler::IDiscDriveHandler ( )
protecteddefault

Member Function Documentation

◆ CloseDriveTray()

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

Close the provided drive device.

Note
Some drives support closing apart 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: