[PVR][Estuary] Timer settings dialog: Show client name in timer type selection dialog...
[xbmc.git] / xbmc / storage / DetectDVDType.h
blobc54272f5f1c26c71255733ded9c532207785e9cb
1 /*
2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 // CDetectDVDMedia
12 // Thread running in the background to detect a CD change and the filesystem
14 // by Bobbin007 in 2003
16 #include "PlatformDefs.h"
18 #ifdef HAS_DVD_DRIVE
20 #include "storage/discs/IDiscDriveHandler.h"
21 #include "threads/CriticalSection.h"
22 #include "threads/Thread.h"
23 #include "utils/DiscsUtils.h"
25 #include <memory>
26 #include <string>
28 namespace MEDIA_DETECT
30 class CCdInfo;
31 class CLibcdio;
33 class CDetectDVDMedia : public CThread
35 public:
36 CDetectDVDMedia();
37 ~CDetectDVDMedia() override;
39 void OnStartup() override;
40 void OnExit() override;
41 void Process() override;
43 static void WaitMediaReady();
44 static bool IsDiscInDrive();
45 static bool DriveReady();
46 static DriveState GetDriveState();
47 static CCdInfo* GetCdInfo();
48 static CEvent m_evAutorun;
50 static const std::string &GetDVDLabel();
51 static const std::string &GetDVDPath();
53 static void UpdateState();
54 protected:
55 void UpdateDvdrom();
56 DriveState PollDriveState();
59 void DetectMediaType();
60 void SetNewDVDShareUrl( const std::string& strNewUrl, bool bCDDA, const std::string& strDiscLabel );
62 void Clear();
64 private:
65 static CCriticalSection m_muReadingMedia;
67 static DriveState m_DriveState;
68 static time_t m_LastPoll;
69 static CDetectDVDMedia* m_pInstance;
71 static CCdInfo* m_pCdInfo;
73 bool m_bStartup = true; // Do not autorun on startup
74 bool m_bAutorun = false;
75 TrayState m_TrayState{TrayState::UNDEFINED};
76 TrayState m_LastTrayState{TrayState::UNDEFINED};
77 DriveState m_LastDriveState{DriveState::NONE};
79 static std::string m_diskLabel;
80 static std::string m_diskPath;
82 std::shared_ptr<CLibcdio> m_cdio;
84 /*! \brief Stores the DiscInfo of the current disk */
85 static UTILS::DISCS::DiscInfo m_discInfo;
88 #endif