kodi
InfoScanner.h
1 /*
2  * Copyright (C) 2016-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include <set>
12 #include <string>
13 #include <vector>
14 
16 
18 {
19 public:
23  enum INFO_RET
24  {
25  INFO_CANCELLED,
26  INFO_ERROR,
27  INFO_NOT_NEEDED,
28  INFO_HAVE_ALREADY,
29  INFO_NOT_FOUND,
30  INFO_ADDED
31  };
32 
33  /*
34  \brief Type of information returned from tag readers.
35  */
36 
37  enum INFO_TYPE
38  {
39  NO_NFO = 0,
40  FULL_NFO = 1,
41  URL_NFO = 2,
44  ERROR_NFO = 5,
45  TITLE_NFO = 6
46  };
47 
49  virtual ~CInfoScanner() = default;
50 
51  virtual bool DoScan(const std::string& strDirectory) = 0;
52 
57  bool HasNoMedia(const std::string& strDirectory) const;
58 
60  void ShowDialog(bool show) { m_showDialog = show; }
61 
63  bool IsScanning() const { return m_bRunning; }
64 
65 protected:
67  CInfoScanner() = default;
68 
69  std::set<std::string> m_pathsToScan;
70  bool m_showDialog = false;
72  bool m_bRunning = false;
73  bool m_bCanInterrupt = false;
74  bool m_bClean = false;
75 };
bool HasNoMedia(const std::string &strDirectory) const
Check if the folder is excluded from scanning process.
Definition: InfoScanner.cpp:16
CGUIDialogProgressBarHandle * m_handle
Progress bar handle.
Definition: InfoScanner.h:71
CInfoScanner()=default
Protected constructor to only allow subclass instances.
A URL to grab info from + override info was found.
Definition: InfoScanner.h:43
bool IsScanning() const
Returns whether or not a scan is in progress.
Definition: InfoScanner.h:63
virtual ~CInfoScanner()=default
Empty destructor.
A URL to grab info from was found.
Definition: InfoScanner.h:41
void ShowDialog(bool show)
Set whether or not to show a progress dialog.
Definition: InfoScanner.h:60
bool m_showDialog
Whether or not to show progress bar dialog.
Definition: InfoScanner.h:70
Full info specified.
Definition: InfoScanner.h:40
Error processing info.
Definition: InfoScanner.h:44
No info found.
Definition: InfoScanner.h:39
bool m_bRunning
Whether or not scanner is running.
Definition: InfoScanner.h:72
Definition: InfoScanner.h:17
std::set< std::string > m_pathsToScan
Set of paths to scan.
Definition: InfoScanner.h:69
Definition: GUIDialogExtendedProgressBar.h:16
bool m_bClean
Whether or not to perform cleaning during scanning.
Definition: InfoScanner.h:74
bool m_bCanInterrupt
Whether or not scanner is currently interruptible.
Definition: InfoScanner.h:73
At least Title was read (and optionally the Year)
Definition: InfoScanner.h:45
Override info was found.
Definition: InfoScanner.h:42
INFO_RET
Return values from the information lookup functions.
Definition: InfoScanner.h:23
INFO_TYPE
Definition: InfoScanner.h:37