2 * Copyright (C) 2012-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.
9 #include "GUIDialogPVRRecordingInfo.h"
12 #include "ServiceBroker.h"
13 #include "guilib/GUIMessage.h"
14 #include "pvr/PVRManager.h"
15 #include "pvr/guilib/PVRGUIActionsEPG.h"
16 #include "pvr/guilib/PVRGUIRecordingsPlayActionProcessor.h"
20 #define CONTROL_BTN_FIND 4
21 #define CONTROL_BTN_OK 7
22 #define CONTROL_BTN_PLAY_RECORDING 8
24 CGUIDialogPVRRecordingInfo::CGUIDialogPVRRecordingInfo()
25 : CGUIDialog(WINDOW_DIALOG_PVR_RECORDING_INFO
, "DialogPVRInfo.xml"), m_recordItem(new CFileItem
)
29 bool CGUIDialogPVRRecordingInfo::OnMessage(CGUIMessage
& message
)
31 switch (message
.GetMessage())
34 return OnClickButtonOK(message
) || OnClickButtonPlay(message
) || OnClickButtonFind(message
);
37 return CGUIDialog::OnMessage(message
);
40 bool CGUIDialogPVRRecordingInfo::OnClickButtonOK(const CGUIMessage
& message
)
44 if (message
.GetSenderId() == CONTROL_BTN_OK
)
53 bool CGUIDialogPVRRecordingInfo::OnClickButtonPlay(const CGUIMessage
& message
)
57 if (message
.GetSenderId() == CONTROL_BTN_PLAY_RECORDING
)
63 CGUIPVRRecordingsPlayActionProcessor proc
{m_recordItem
};
64 proc
.ProcessDefaultAction();
65 if (proc
.UserCancelled())
75 bool CGUIDialogPVRRecordingInfo::OnClickButtonFind(const CGUIMessage
& message
)
79 if (message
.GetSenderId() == CONTROL_BTN_FIND
)
84 CServiceBroker::GetPVRManager().Get
<PVR::GUI::EPG
>().FindSimilar(*m_recordItem
);
92 bool CGUIDialogPVRRecordingInfo::OnInfo(int actionID
)
98 void CGUIDialogPVRRecordingInfo::SetRecording(const CFileItem
& item
)
100 m_recordItem
= std::make_shared
<CFileItem
>(item
);
103 CFileItemPtr
CGUIDialogPVRRecordingInfo::GetCurrentListItem(int offset
)