xbmc
TagLoaderTagLib.h
1 /*
2  * Copyright (C) 2005-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 "ImusicInfoTagLoader.h"
12 
13 #include <string>
14 #include <vector>
15 
16 class EmbeddedArt;
17 
18 namespace MUSIC_INFO
19 {
20  class CMusicInfoTag;
21 };
22 
24 {
25 public:
26  CTagLoaderTagLib() = default;
27  ~CTagLoaderTagLib() override = default;
28  bool Load(const std::string& strFileName, MUSIC_INFO::CMusicInfoTag& tag,
29  EmbeddedArt *art = nullptr) override;
30  bool Load(const std::string& strFileName, MUSIC_INFO::CMusicInfoTag& tag,
31  const std::string& fallbackFileExtension, EmbeddedArt *art = nullptr);
32 
33  static std::vector<std::string> SplitMBID(const std::vector<std::string> &values);
34 protected:
35  static void SetArtist(MUSIC_INFO::CMusicInfoTag &tag, const std::vector<std::string> &values);
36  static void SetArtistSort(MUSIC_INFO::CMusicInfoTag &tag, const std::vector<std::string> &values);
37  static void SetArtistHints(MUSIC_INFO::CMusicInfoTag &tag, const std::vector<std::string> &values);
38  static void SetAlbumArtist(MUSIC_INFO::CMusicInfoTag &tag, const std::vector<std::string> &values);
39  static void SetAlbumArtistSort(MUSIC_INFO::CMusicInfoTag &tag, const std::vector<std::string> &values);
40  static void SetAlbumArtistHints(MUSIC_INFO::CMusicInfoTag &tag, const std::vector<std::string> &values);
41  static void SetComposerSort(MUSIC_INFO::CMusicInfoTag &tag, const std::vector<std::string> &values);
42  static void SetDiscSubtitle(MUSIC_INFO::CMusicInfoTag& tag,
43  const std::vector<std::string>& values);
44  static void SetGenre(MUSIC_INFO::CMusicInfoTag& tag, const std::vector<std::string>& values);
45  static void SetReleaseType(MUSIC_INFO::CMusicInfoTag &tag, const std::vector<std::string> &values);
46  static void AddArtistRole(MUSIC_INFO::CMusicInfoTag &tag, const std::string& strRole, const std::vector<std::string> &values);
47  static void AddArtistRole(MUSIC_INFO::CMusicInfoTag &tag, const std::vector<std::string> &values);
48  static void AddArtistInstrument(MUSIC_INFO::CMusicInfoTag &tag, const std::vector<std::string> &values);
49  static int POPMtoXBMC(int popm);
50 
51 template<typename T>
52  static bool ParseTag(T *tag, EmbeddedArt *art, MUSIC_INFO::CMusicInfoTag& infoTag);
53 };
54 
Definition: EmbeddedArt.h:38
Definition: ImusicInfoTagLoader.h:18
Definition: TagLoaderTagLib.h:23
Definition: MusicInfoTag.h:27
Definition: Application.h:79