[video] Fix the refresh of movies with additional versions or extras
[xbmc.git] / xbmc / CueDocument.h
blob7218a9fe2d308151db8ec0df4dafb6adac82122a
1 /*
2 * Copyright (C) 2005-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 "music/Song.h"
13 #include <string>
14 #include <vector>
16 #define MAX_PATH_SIZE 1024
18 class CueReader;
20 class CCueDocument
22 class CCueTrack
24 public:
25 std::string strArtist;
26 std::string strTitle;
27 std::string strFile;
28 int iTrackNumber = 0;
29 int iStartTime = 0;
30 int iEndTime = 0;
31 ReplayGain::Info replayGain;
33 public:
34 ~CCueDocument(void);
35 // USED
36 bool ParseFile(const std::string &strFilePath);
37 bool ParseTag(const std::string &strContent);
38 void GetSongs(VECSONGS &songs);
39 std::string GetMediaPath();
40 std::string GetMediaTitle();
41 void GetMediaFiles(std::vector<std::string>& mediaFiles);
42 void UpdateMediaFile(const std::string& oldMediaFile, const std::string& mediaFile);
43 bool IsOneFilePerTrack() const;
44 bool IsLoaded() const;
45 private:
46 void Clear();
47 bool Parse(CueReader& reader, const std::string& strFile = std::string());
49 // Member variables
50 std::string m_strArtist; // album artist
51 std::string m_strAlbum; // album title
52 std::string m_strGenre; // album genre
53 int m_iYear = 0; //album year
54 int m_iTrack = 0; // current track
55 int m_iDiscNumber = 0; // Disc number
56 ReplayGain::Info m_albumReplayGain;
58 bool m_bOneFilePerTrack = false;
60 // cuetrack array
61 typedef std::vector<CCueTrack> Tracks;
62 Tracks m_tracks;
64 std::string ExtractInfo(const std::string &line);
65 int ExtractTimeFromIndex(const std::string &index);
66 int ExtractNumericInfo(const std::string &info);
67 bool ResolvePath(std::string &strPath, const std::string &strBase);