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.
12 #include "addons/kodi-dev-kit/include/kodi/c-api/addon-instance/pvr/pvr_edl.h"
13 #include "cores/EdlEdit.h"
14 #include "pvr/epg/EpgInfoTag.h"
15 #include "pvr/recordings/PVRRecording.h"
16 #include "utils/log.h"
21 std::vector
<EDL::Edit
> CPVREdl::GetEdits(const CFileItem
& item
)
23 std::vector
<PVR_EDL_ENTRY
> edl
;
25 if (item
.HasPVRRecordingInfoTag())
27 CLog::LogFC(LOGDEBUG
, LOGPVR
, "Reading EDL for recording: {}",
28 item
.GetPVRRecordingInfoTag()->m_strTitle
);
29 edl
= item
.GetPVRRecordingInfoTag()->GetEdl();
31 else if (item
.HasEPGInfoTag())
33 CLog::LogFC(LOGDEBUG
, LOGPVR
, "Reading EDL for EPG tag: {}", item
.GetEPGInfoTag()->Title());
34 edl
= item
.GetEPGInfoTag()->GetEdl();
37 std::vector
<EDL::Edit
> editlist
;
38 for (const auto& entry
: edl
)
41 edit
.start
= entry
.start
;
46 case PVR_EDL_TYPE_CUT
:
47 edit
.action
= EDL::Action::CUT
;
49 case PVR_EDL_TYPE_MUTE
:
50 edit
.action
= EDL::Action::MUTE
;
52 case PVR_EDL_TYPE_SCENE
:
53 edit
.action
= EDL::Action::SCENE
;
55 case PVR_EDL_TYPE_COMBREAK
:
56 edit
.action
= EDL::Action::COMM_BREAK
;
59 CLog::LogF(LOGWARNING
, "Ignoring entry of unknown EDL type: {}", entry
.type
);
63 editlist
.emplace_back(edit
);