kodi
PVRGUIActionsPlayback.h
1 /*
2  * Copyright (C) 2016-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "pvr/IPVRComponent.h"
12 #include "pvr/settings/PVRSettings.h"
13 #include "utils/ContentUtils.h"
14 
15 #include <string>
16 
17 class CFileItem;
18 
19 namespace PVR
20 {
21 enum PlaybackType
22 {
23  PlaybackTypeAny = 0,
24  PlaybackTypeTV,
25  PlaybackTypeRadio
26 };
27 
29 {
30 public:
32  ~CPVRGUIActionsPlayback() override = default;
33 
41  bool ResumePlayRecording(const CFileItem& item, bool bFallbackToPlay) const;
42 
49  bool PlayRecording(const CFileItem& item, bool bCheckResume) const;
50 
57  bool PlayRecordingFolder(const CFileItem& item, bool bCheckResume) const;
58 
65  bool PlayEpgTag(
66  const CFileItem& item,
67  ContentUtils::PlayMode mode = ContentUtils::PlayMode::CHECK_AUTO_PLAY_NEXT_ITEM) const;
68 
76  bool SwitchToChannel(const CFileItem& item, bool bCheckResume) const;
77 
83  bool PlayMedia(const CFileItem& item) const;
84 
91  bool SwitchToChannel(PlaybackType type) const;
92 
97  bool PlayChannelOnStartup() const;
98 
104  void SeekForward();
105 
113  void SeekBackward(unsigned int iThreshold);
114 
115 private:
117  CPVRGUIActionsPlayback const& operator=(CPVRGUIActionsPlayback const&) = delete;
118 
125  bool CheckResumeRecording(const CFileItem& item) const;
126 
131  void CheckAndSwitchToFullscreen(bool bFullscreen) const;
132 
133  CPVRSettings m_settings;
134 };
135 
136 namespace GUI
137 {
138 // pretty scope and name
139 using Playback = CPVRGUIActionsPlayback;
140 } // namespace GUI
141 
142 } // namespace PVR
bool ResumePlayRecording(const CFileItem &item, bool bFallbackToPlay) const
Resume a previously not completely played recording.
Definition: PVRGUIActionsPlayback.cpp:83
Definition: ContextMenuManager.h:24
void SeekBackward(unsigned int iThreshold)
Seek to the start of the previous epg event in timeshift buffer, relative to the currently playing ev...
Definition: PVRGUIActionsPlayback.cpp:519
bool SwitchToChannel(const CFileItem &item, bool bCheckResume) const
Switch channel.
Definition: PVRGUIActionsPlayback.cpp:236
bool PlayEpgTag(const CFileItem &item, ContentUtils::PlayMode mode=ContentUtils::PlayMode::CHECK_AUTO_PLAY_NEXT_ITEM) const
Play EPG tag.
Definition: PVRGUIActionsPlayback.cpp:191
void SeekForward()
Seek to the start of the next epg event in timeshift buffer, relative to the currently playing event...
Definition: PVRGUIActionsPlayback.cpp:481
PlayMode
Defines play modes to be used in conjunction with the setting "play next video|song automatically"...
Definition: ContentUtils.h:22
bool PlayMedia(const CFileItem &item) const
Playback the given file item.
Definition: PVRGUIActionsPlayback.cpp:444
bool PlayChannelOnStartup() const
Plays the last played channel or the first channel of TV or Radio on startup.
Definition: PVRGUIActionsPlayback.cpp:414
Definition: IPVRComponent.h:13
bool PlayRecordingFolder(const CFileItem &item, bool bCheckResume) const
Play a recording folder.
Definition: PVRGUIActionsPlayback.cpp:172
bool PlayRecording(const CFileItem &item, bool bCheckResume) const
Play recording.
Definition: PVRGUIActionsPlayback.cpp:112
Definition: PVRSettings.h:27
Represents a file on a share.
Definition: FileItem.h:102
Definition: PVRGUIActionsPlayback.h:28