[Windows] Fix driver version detection of AMD RDNA+ GPU on Windows 10
[xbmc.git] / xbmc / pvr / guilib / PVRGUIProgressHandler.h
blob6e7b72f20e51ceac9edf24793cd8f9f45a4700fa
1 /*
2 * Copyright (C) 2017-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 #include "threads/CriticalSection.h"
12 #include "threads/Thread.h"
14 #include <string>
16 namespace PVR
18 class CPVRGUIProgressHandler : private CThread
20 public:
21 CPVRGUIProgressHandler() = delete;
23 /*!
24 * @brief Creates and asynchronously shows a progress dialog with the given title.
25 * @param strTitle The title for the progress dialog.
27 explicit CPVRGUIProgressHandler(const std::string& strTitle);
29 ~CPVRGUIProgressHandler() override = default;
31 /*!
32 * @brief Update the progress dialogs's content.
33 * @param strText The new progress text.
34 * @param fProgress The new progress value, in a range from 0.0 to 100.0.
36 void UpdateProgress(const std::string& strText, float fProgress);
38 /*!
39 * @brief Update the progress dialogs's content.
40 * @param strText The new progress text.
41 * @param iCurrent The new current progress value, must be less or equal iMax.
42 * @param iMax The new maximum progress value, must be greater or equal iCurrent.
44 void UpdateProgress(const std::string& strText, int iCurrent, int iMax);
46 protected:
47 // CThread implementation
48 void Process() override;
50 private:
51 CCriticalSection m_critSection;
52 const std::string m_strTitle;
53 std::string m_strText;
54 float m_fProgress{0.0f};
55 bool m_bChanged{false};
56 bool m_bCreated{false};
59 } // namespace PVR