Merge pull request #26013 from ksooo/estuary-recordings-info
[xbmc.git] / xbmc / InfoScanner.h
blob998c7c68a8dd9da81ef14e076fd5e7f8f66d6faf
1 /*
2 * Copyright (C) 2016-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.
7 */
9 #pragma once
11 #include <set>
12 #include <string>
13 #include <vector>
15 class CGUIDialogProgressBarHandle;
17 class CInfoScanner
19 public:
20 /*!
21 \brief Return values from the information lookup functions.
23 enum INFO_RET
25 INFO_CANCELLED,
26 INFO_ERROR,
27 INFO_NOT_NEEDED,
28 INFO_HAVE_ALREADY,
29 INFO_NOT_FOUND,
30 INFO_ADDED
34 \brief Type of information returned from tag readers.
37 enum INFO_TYPE
39 NO_NFO = 0, //!< No info found
40 FULL_NFO = 1, //!< Full info specified
41 URL_NFO = 2, //!< A URL to grab info from was found
42 OVERRIDE_NFO = 3, //!< Override info was found
43 COMBINED_NFO = 4, //!< A URL to grab info from + override info was found
44 ERROR_NFO = 5, //!< Error processing info
45 TITLE_NFO = 6 //!< At least Title was read (and optionally the Year)
48 //! \brief Empty destructor.
49 virtual ~CInfoScanner() = default;
51 virtual bool DoScan(const std::string& strDirectory) = 0;
53 /*! \brief Check if the folder is excluded from scanning process
54 \param strDirectory Directory to scan
55 \return true if there is a .nomedia file
57 static bool HasNoMedia(const std::string& strDirectory);
59 //! \brief Set whether or not to show a progress dialog.
60 void ShowDialog(bool show) { m_showDialog = show; }
62 //! \brief Returns whether or not a scan is in progress.
63 bool IsScanning() const { return m_bRunning; }
65 protected:
66 //! \brief Protected constructor to only allow subclass instances.
67 CInfoScanner() = default;
69 std::set<std::string> m_pathsToScan; //!< Set of paths to scan
70 bool m_showDialog = false; //!< Whether or not to show progress bar dialog
71 CGUIDialogProgressBarHandle* m_handle = nullptr; //!< Progress bar handle
72 bool m_bRunning = false; //!< Whether or not scanner is running
73 bool m_bCanInterrupt = false; //!< Whether or not scanner is currently interruptible
74 bool m_bClean = false; //!< Whether or not to perform cleaning during scanning