kodi
PVRGUIRecordingsPlayActionProcessor.h
1 /*
2  * Copyright (C) 2023 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 "FileItem.h"
12 #include "ServiceBroker.h"
13 #include "pvr/PVRManager.h"
14 #include "pvr/guilib/PVRGUIActionsPlayback.h"
15 #include "video/guilib/VideoPlayActionProcessor.h"
16 
17 namespace PVR
18 {
20 {
21 public:
22  explicit CGUIPVRRecordingsPlayActionProcessor(const std::shared_ptr<CFileItem>& item)
23  : CVideoPlayActionProcessorBase(item)
24  {
25  }
26 
27 protected:
28  bool OnResumeSelected() override
29  {
30  m_item->SetStartOffset(STARTOFFSET_RESUME);
31  Play();
32  return true;
33  }
34 
35  bool OnPlaySelected() override
36  {
37  Play();
38  return true;
39  }
40 
41 private:
42  void Play()
43  {
44  CServiceBroker::GetPVRManager().Get<PVR::GUI::Playback>().PlayRecording(
45  *m_item, false /* no resume check */);
46  }
47 };
48 } // namespace PVR
Definition: ContextMenuManager.h:24
Definition: PVRGUIRecordingsPlayActionProcessor.h:19
T & Get()
Get a PVR component.
Definition: PVRManager.h:119
Definition: VideoPlayActionProcessor.h:21
Definition: PVRGUIActionsPlayback.h:28