kodi
MusicLibraryScanningJob.h
1 /*
2  * Copyright (C) 2017-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 "music/infoscanner/MusicInfoScanner.h"
12 #include "music/jobs/MusicLibraryJob.h"
13 
14 #include <string>
15 
22 {
23 public:
30  CMusicLibraryScanningJob(const std::string& directory, int flags, bool showProgress = true);
31  ~CMusicLibraryScanningJob() override;
32 
33  // specialization of CMusicLibraryJob
34  bool CanBeCancelled() const override { return true; }
35  bool Cancel() override;
36 
37  // specialization of CJob
38  const char *GetType() const override { return "MusicLibraryScanningJob"; }
39  bool operator==(const CJob* job) const override;
40 
41 protected:
42  // implementation of CMusicLibraryJob
43  bool Work(CMusicDatabase &db) override;
44 
45 private:
47  std::string m_directory;
48  bool m_showProgress;
49  int m_flags;
50 };
Music library job implementation for scanning items. Uses CMusicInfoScanner for scanning and can be r...
Definition: MusicLibraryScanningJob.h:21
bool CanBeCancelled() const override
Whether the job can be cancelled or not.
Definition: MusicLibraryScanningJob.h:34
Base class for jobs that are executed asynchronously.
Definition: Job.h:109
Class to store and read tag information.
Definition: MusicDatabase.h:98
CMusicLibraryScanningJob(const std::string &directory, int flags, bool showProgress=true)
Creates a new music library tag scanning and data scraping job.
Definition: MusicLibraryScanningJob.cpp:13
Basic implementation/interface of a CJob which interacts with the music database. ...
Definition: MusicLibraryJob.h:19
const char * GetType() const override
Function that returns the type of job.
Definition: MusicLibraryScanningJob.h:38
bool Cancel() override
Tries to cancel the running job.
Definition: MusicLibraryScanningJob.cpp:22
Definition: MusicInfoScanner.h:26
bool Work(CMusicDatabase &db) override
Worker method to be implemented by an actual implementation.
Definition: MusicLibraryScanningJob.cpp:44