|
Kodi Documentation 23.0
Kodi is an open source media player and entertainment hub.
|
#include <MediaManager.h>
Public Types | |
| enum class | HasBlurayPlaylist : uint8_t { YES , NO , UNKNOWN } |
Public Member Functions | |
| CMediaManager () | |
| void | Initialize () |
| void | Stop () |
| void | ScanForPresentMedia () |
| void | LoadSources () |
| bool | SaveSources () |
| void | GetLocalDrives (std::vector< CMediaSource > &localDrives, bool includeQ=true) |
| void | GetRemovableDrives (std::vector< CMediaSource > &removableDrives) |
| void | GetNetworkLocations (std::vector< CMediaSource > &locations, bool autolocations=true) |
| bool | AddNetworkLocation (const std::string &path) |
| bool | HasLocation (const std::string &path) const |
| bool | RemoveLocation (const std::string &path) |
| bool | SetLocationPath (const std::string &oldPath, const std::string &newPath) |
| void | AddAutoSource (const CMediaSource &share, bool bAutorun=false) |
| void | RemoveAutoSource (const CMediaSource &share) |
| bool | IsDiscInDrive (const std::string &devicePath="") |
| bool | IsAudio (const std::string &devicePath="", bool allowCachedFailure=false) |
| Whether the disc in a drive is an audio CD. | |
| bool | HasOpticalDrive () |
| std::string | TranslateDevicePath (const std::string &devicePath, bool bReturnAsDevice=false) |
| DriveState | GetDriveStatus (const std::string &devicePath="") |
| void | ResetDriveCaches (const std::string &devicePath="") |
| Discard everything cached about a drive, so the next query asks the hardware again. | |
| std::string | GetDiscPath () |
| void | SetHasOpticalDrive (bool bstatus) |
| bool | Eject (const std::string &mountpath) |
| void | EjectTray (bool bEject=true, const std::string &devicePath="") |
| Eject or close the tray of an optical drive. | |
| void | CloseTray (const std::string &devicePath="") |
| Close the tray of an optical drive. | |
| void | ToggleTray (const std::string &devicePath="") |
| Eject the tray of an optical drive, or close it when already open. | |
| void | ProcessEvents () |
| std::vector< std::string > | GetDiskUsage () |
| void | OnStorageAdded (const MEDIA_DETECT::STORAGE::StorageDevice &device) override |
| Callback executed when a new storage device is added. | |
| void | OnStorageSafelyRemoved (const MEDIA_DETECT::STORAGE::StorageDevice &device) override |
| Callback executed when a new storage device is safely removed. | |
| void | OnStorageUnsafelyRemoved (const MEDIA_DETECT::STORAGE::StorageDevice &device) override |
| Callback executed when a new storage device is unsafely removed. | |
| void | OnJobComplete (unsigned int jobID, bool success, CJob *job) override |
| The callback used when a job completes. | |
| bool | playStubFile (const CFileItem &item) |
| UTILS::DISCS::DiscInfo | GetDiscInfo (const std::string &mediaPath) |
Public Member Functions inherited from IStorageEventsCallback | |
| virtual | ~IStorageEventsCallback ()=default |
Public Member Functions inherited from IJobCallback | |
| virtual | ~IJobCallback ()=default |
| Destructor for job call back objects. | |
| virtual void | OnJobAbort (unsigned int jobID, CJob *job) |
| An optional callback function used when a job will be aborted. | |
| virtual void | OnJobProgress (unsigned int jobID, unsigned int progress, unsigned int total, const CJob *job) |
| An optional callback function that a job may call while processing. | |
Protected Attributes | |
| std::vector< CNetworkLocation > | m_locations |
| CCriticalSection | m_muAutoSource |
| CCriticalSection | m_CritSecStorageProvider |
| bool | m_bOpticalDrivePresent |
| std::string | m_strFirstAvailDrive |
|
strong |
| CMediaManager::CMediaManager | ( | ) |
| void CMediaManager::AddAutoSource | ( | const CMediaSource & | share, |
| bool | bAutorun = false ) |
| bool CMediaManager::AddNetworkLocation | ( | const std::string & | path | ) |
| void CMediaManager::CloseTray | ( | const std::string & | devicePath = "" | ) |
Close the tray of an optical drive.
| devicePath | Path of the drive, empty for the first available optical drive |
| bool CMediaManager::Eject | ( | const std::string & | mountpath | ) |
Eject or close the tray of an optical drive.
| bEject | True to eject the tray, false to close it |
| devicePath | Path of the drive, empty for the first available optical drive |
| UTILS::DISCS::DiscInfo CMediaManager::GetDiscInfo | ( | const std::string & | mediaPath | ) |
| std::string CMediaManager::GetDiscPath | ( | ) |
| std::vector< std::string > CMediaManager::GetDiskUsage | ( | ) |
| DriveState CMediaManager::GetDriveStatus | ( | const std::string & | devicePath = "" | ) |
| void CMediaManager::GetLocalDrives | ( | std::vector< CMediaSource > & | localDrives, |
| bool | includeQ = true ) |
| void CMediaManager::GetNetworkLocations | ( | std::vector< CMediaSource > & | locations, |
| bool | autolocations = true ) |
| void CMediaManager::GetRemovableDrives | ( | std::vector< CMediaSource > & | removableDrives | ) |
| bool CMediaManager::HasLocation | ( | const std::string & | path | ) | const |
| bool CMediaManager::HasOpticalDrive | ( | ) |
| void CMediaManager::Initialize | ( | ) |
| bool CMediaManager::IsAudio | ( | const std::string & | devicePath = "", |
| bool | allowCachedFailure = false ) |
Whether the disc in a drive is an audio CD.
| allowCachedFailure | Allow GUI polling to reuse a recent failed TOC read on Windows. Explicit actions such as ripping must leave this false so they read the disc again. |
| bool CMediaManager::IsDiscInDrive | ( | const std::string & | devicePath = "" | ) |
| void CMediaManager::LoadSources | ( | ) |
|
inlineoverridevirtual |
The callback used when a job completes.
OnJobComplete is called at the completion of the job's DoWork() function, and is used to return information to the caller on the result of the job. On returning form this function the CJobManager will destroy this job.
| jobID | the unique id of the job (as retrieved from CJobManager::AddJob) |
| success | the result from the DoWork call |
| job | the job that has been processed. The job will be destroyed after this function returns |
Implements IJobCallback.
|
overridevirtual |
Callback executed when a new storage device is added.
| device | the storage device |
Implements IStorageEventsCallback.
|
overridevirtual |
Callback executed when a new storage device is safely removed.
| device | the storage device |
Implements IStorageEventsCallback.
|
overridevirtual |
Callback executed when a new storage device is unsafely removed.
| device | the storage device |
Implements IStorageEventsCallback.
| void CMediaManager::ProcessEvents | ( | ) |
| void CMediaManager::RemoveAutoSource | ( | const CMediaSource & | share | ) |
| bool CMediaManager::RemoveLocation | ( | const std::string & | path | ) |
| void CMediaManager::ResetDriveCaches | ( | const std::string & | devicePath = "" | ) |
Discard everything cached about a drive, so the next query asks the hardware again.
| devicePath | The optical drive path, empty for every drive |
| bool CMediaManager::SaveSources | ( | ) |
| void CMediaManager::ScanForPresentMedia | ( | ) |
| bool CMediaManager::SetLocationPath | ( | const std::string & | oldPath, |
| const std::string & | newPath ) |
| void CMediaManager::Stop | ( | ) |
| void CMediaManager::ToggleTray | ( | const std::string & | devicePath = "" | ) |
Eject the tray of an optical drive, or close it when already open.
| devicePath | Path of the drive, empty for the first available optical drive |
| std::string CMediaManager::TranslateDevicePath | ( | const std::string & | devicePath, |
| bool | bReturnAsDevice = false ) |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |