Merge pull request #25922 from sarbes/shader-cleanup
[xbmc.git] / xbmc / video / VideoUtils.h
blob2ee611c4e81e3943a58bdd582eeb089bd8382177
1 /*
2 * Copyright (C) 2022 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 <string>
13 class CFileItem;
15 namespace KODI::VIDEO::UTILS
18 /*! \brief
19 * Find a local trailer file for a given file item
20 * \return non-empty string with path of trailer if found
22 std::string FindTrailer(const CFileItem& item);
24 /*!
25 \brief Check whether an item is an optical media folder or its parent.
26 This will return the non-empty path to the playable entry point of the media
27 one or two levels down (VIDEO_TS.IFO for DVDs or index.bdmv for BDs).
28 The returned path will be empty if folder does not meet this criterion.
29 \return non-empty string if item is optical media folder, empty otherwise.
31 std::string GetOpticalMediaPath(const CFileItem& item);
33 /*! \brief Check whether auto play next item is set for the media type of the given item.
34 \param item [in] the item to check
35 \return True if auto play next item is active, false otherwise.
37 bool IsAutoPlayNextItem(const CFileItem& item);
39 /*! \brief Check whether auto play next item is set for the given content type.
40 \param item [in] the content to check
41 \return True if auto play next item is active, false otherwise.
43 bool IsAutoPlayNextItem(const std::string& content);
45 struct ResumeInformation
47 bool isResumable{false}; // the playback of the item can be resumed
48 int64_t startOffset{0}; // a start offset
49 int partNumber{0}; // a part number
52 /*!
53 \brief Check whether playback of the given item can be resumed, get detailed information.
54 \param item The item to retrieve information for
55 \return The resume information.
57 ResumeInformation GetItemResumeInformation(const CFileItem& item);
59 /*!
60 \brief Get resume information for a part of a stack item.
61 \param item The stack item to retrieve information for
62 \param partNumber The number of the part
63 \return The resume information.
65 ResumeInformation GetStackPartResumeInformation(const CFileItem& item, unsigned int partNumber);
67 } // namespace KODI::VIDEO::UTILS