[video] fix selection after changing video or extra art
[xbmc.git] / xbmc / pvr / guilib / PVRGUIRecordingsPlayActionProcessor.h
blob80df2dfc96950e1c63dc3dd3b6122f75a24a3e2f
1 /*
2 * Copyright (C) 2023 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 "FileItem.h"
12 #include "ServiceBroker.h"
13 #include "pvr/PVRManager.h"
14 #include "pvr/guilib/PVRGUIActionsPlayback.h"
15 #include "video/guilib/VideoPlayActionProcessor.h"
17 namespace PVR
19 class CGUIPVRRecordingsPlayActionProcessor : public VIDEO::GUILIB::CVideoPlayActionProcessorBase
21 public:
22 explicit CGUIPVRRecordingsPlayActionProcessor(const std::shared_ptr<CFileItem>& item)
23 : CVideoPlayActionProcessorBase(item)
27 protected:
28 bool OnResumeSelected() override
30 m_item->SetStartOffset(STARTOFFSET_RESUME);
31 Play();
32 return true;
35 bool OnPlaySelected() override
37 Play();
38 return true;
41 private:
42 void Play()
44 CServiceBroker::GetPVRManager().Get<PVR::GUI::Playback>().PlayRecording(
45 *m_item, false /* no resume check */);
48 } // namespace PVR