[Windows] Fix driver version detection of AMD RDNA+ GPU on Windows 10
[xbmc.git] / xbmc / pvr / guilib / PVRGUIActionsPlayback.h
blob892dd198a140ebbb6af2bec123447156533beec5
1 /*
2 * Copyright (C) 2016-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 "pvr/IPVRComponent.h"
12 #include "pvr/settings/PVRSettings.h"
13 #include "utils/ContentUtils.h"
15 #include <string>
17 class CFileItem;
19 namespace PVR
21 enum PlaybackType
23 PlaybackTypeAny = 0,
24 PlaybackTypeTV,
25 PlaybackTypeRadio
28 class CPVRGUIActionsPlayback : public IPVRComponent
30 public:
31 CPVRGUIActionsPlayback();
32 ~CPVRGUIActionsPlayback() override = default;
34 /*!
35 * @brief Resume a previously not completely played recording.
36 * @param item containing a recording or an epg tag.
37 * @param bFallbackToPlay controls whether playback of the recording should be started at the
38 * beginning ig no resume data are available.
39 * @return true on success, false otherwise.
41 bool ResumePlayRecording(const CFileItem& item, bool bFallbackToPlay) const;
43 /*!
44 * @brief Play recording.
45 * @param item containing a recording or an epg tag.
46 * @param bCheckResume controls resume check.
47 * @return true on success, false otherwise.
49 bool PlayRecording(const CFileItem& item, bool bCheckResume) const;
51 /*!
52 * @brief Play a recording folder.
53 * @param item containing a recording folder.
54 * @param bCheckResume controls resume check.
55 * @return true on success, false otherwise.
57 bool PlayRecordingFolder(const CFileItem& item, bool bCheckResume) const;
59 /*!
60 * @brief Play EPG tag.
61 * @param item containing an epg tag.
62 * @param mode playback mode.
63 * @return true on success, false otherwise.
65 bool PlayEpgTag(
66 const CFileItem& item,
67 ContentUtils::PlayMode mode = ContentUtils::PlayMode::CHECK_AUTO_PLAY_NEXT_ITEM) const;
69 /*!
70 * @brief Switch channel.
71 * @param item containing a channel or an epg tag.
72 * @param bCheckResume controls resume check in case a recording for the current epg event is
73 * present.
74 * @return true on success, false otherwise.
76 bool SwitchToChannel(const CFileItem& item, bool bCheckResume) const;
78 /*!
79 * @brief Playback the given file item.
80 * @param item containing a channel or a recording.
81 * @return True if the item could be played, false otherwise.
83 bool PlayMedia(const CFileItem& item) const;
85 /*!
86 * @brief Start playback of the last played channel, and if there is none, play first channel in
87 * the current channelgroup.
88 * @param type The type of playback to be started (any, radio, tv). See PlaybackType enum
89 * @return True if playback was started, false otherwise.
91 bool SwitchToChannel(PlaybackType type) const;
93 /*!
94 * @brief Plays the last played channel or the first channel of TV or Radio on startup.
95 * @return True if playback was started, false otherwise.
97 bool PlayChannelOnStartup() const;
99 /*!
100 * @brief Seek to the start of the next epg event in timeshift buffer, relative to the currently
101 * playing event. If there is no next event, seek to the end of the currently playing event (to
102 * the 'live' position).
104 void SeekForward();
107 * @brief Seek to the start of the previous epg event in timeshift buffer, relative to the
108 * currently playing event or if there is no previous event or if playback time is greater than
109 * given threshold, seek to the start of the playing event.
110 * @param iThreshold the value in seconds to trigger seek to start of current event instead of
111 * start of previous event.
113 void SeekBackward(unsigned int iThreshold);
115 private:
116 CPVRGUIActionsPlayback(const CPVRGUIActionsPlayback&) = delete;
117 CPVRGUIActionsPlayback const& operator=(CPVRGUIActionsPlayback const&) = delete;
120 * @brief Check whether resume play is possible for a given item, display "resume from ..."/"play
121 * from start" context menu in case.
122 * @param item containing a recording or an epg tag.
123 * @return true, to play/resume the item, false otherwise.
125 bool CheckResumeRecording(const CFileItem& item) const;
128 * @brief Check "play minimized" settings value and switch to fullscreen if not set.
129 * @param bFullscreen switch to fullscreen or set windowed playback.
131 void CheckAndSwitchToFullscreen(bool bFullscreen) const;
133 CPVRSettings m_settings;
136 namespace GUI
138 // pretty scope and name
139 using Playback = CPVRGUIActionsPlayback;
140 } // namespace GUI
142 } // namespace PVR