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 // LibExportSettings.h: interface for the CLibExportSettings class.
12 //
13 //////////////////////////////////////////////////////////////////////
14 
15 #include "settings/lib/Setting.h"
16 
17 #include <string>
18 
19 // Enumeration of library export options (possibly OR'd together)
20 enum ELIBEXPORTOPTIONS
21 {
22   ELIBEXPORT_SINGLEFILE = 0x0000,
23   ELIBEXPORT_SEPARATEFILES = 0x0001,
24   ELIBEXPORT_TOLIBRARYFOLDER = 0x0002,
25   ELIBEXPORT_OVERWRITE = 0x0004,
26   ELIBEXPORT_UNSCRAPED = 0x0008,
27   ELIBEXPORT_ALBUMS = 0x0010,
28   ELIBEXPORT_ALBUMARTISTS = 0x0020,
29   ELIBEXPORT_SONGARTISTS = 0x0040,
30   ELIBEXPORT_OTHERARTISTS = 0x0080,
31   ELIBEXPORT_ARTWORK = 0x0100,
32   ELIBEXPORT_NFOFILES = 0x0200,
33   ELIBEXPORT_ACTORTHUMBS = 0x0400,
34   ELIBEXPORT_ARTISTFOLDERS = 0x0800,
35   ELIBEXPORT_SONGS = 0x1000
36 };
37 
38 class CLibExportSettings
39 {
40 public:
41   CLibExportSettings();
42   ~CLibExportSettings() = default;
43 
44   bool operator!=(const CLibExportSettings &right) const;
45   bool IsItemExported(ELIBEXPORTOPTIONS item) const;
46   bool IsArtists() const;
47   std::vector<int> GetExportItems() const;
48   std::vector<int> GetLimitedItems(int items) const;
ClearItems()49   void ClearItems() { m_itemstoexport = 0; }
AddItem(ELIBEXPORTOPTIONS item)50   void AddItem(ELIBEXPORTOPTIONS item) { m_itemstoexport += item; }
GetItemsToExport()51   unsigned int GetItemsToExport() { return m_itemstoexport; }
SetItemsToExport(int itemstoexport)52   void SetItemsToExport(int itemstoexport) { m_itemstoexport = static_cast<unsigned int>(itemstoexport); }
GetExportType()53   unsigned int GetExportType() { return m_exporttype; }
SetExportType(int exporttype)54   void SetExportType(int exporttype) { m_exporttype = static_cast<unsigned int>(exporttype); }
55   bool IsSingleFile() const;
56   bool IsSeparateFiles() const;
57   bool IsToLibFolders() const;
58   bool IsArtistFoldersOnly() const;
59 
60   std::string m_strPath;
61   bool m_overwrite;
62   bool m_artwork;
63   bool m_unscraped;
64   bool m_skipnfo;
65 private:
66   unsigned int m_exporttype; //singlefile, separate files, to library folder
67   unsigned int m_itemstoexport;
68 };
69