VTB: release CVBuffer after it actually has been rendered
[xbmc.git] / xbmc / CueDocument.h
blobd48c9879cd3e634b6ab244dd7d57a156372067a2
1 #pragma once
3 /*
4 * Copyright (C) 2005-2013 Team XBMC
5 * http://xbmc.org
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
10 * any later version.
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
23 #include <string>
24 #include <vector>
26 #include "music/Song.h"
28 #define MAX_PATH_SIZE 1024
30 class CueReader;
32 class CCueDocument
34 class CCueTrack
36 public:
37 CCueTrack()
38 : iTrackNumber(0)
39 , iStartTime(0)
40 , iEndTime(0)
43 std::string strArtist;
44 std::string strTitle;
45 std::string strFile;
46 int iTrackNumber;
47 int iStartTime;
48 int iEndTime;
49 ReplayGain::Info replayGain;
51 public:
52 CCueDocument(void);
53 ~CCueDocument(void);
54 // USED
55 bool ParseFile(const std::string &strFilePath);
56 bool ParseTag(const std::string &strContent);
57 void GetSongs(VECSONGS &songs);
58 bool GetSong(int aTrackNumber, CSong& aSong);
59 std::string GetMediaPath();
60 std::string GetMediaTitle();
61 void GetMediaFiles(std::vector<std::string>& mediaFiles);
62 void UpdateMediaFile(const std::string& oldMediaFile, const std::string& mediaFile);
63 bool IsOneFilePerTrack() const;
64 bool IsLoaded() const;
65 private:
66 void Clear();
67 bool Parse(CueReader& reader, const std::string& strFile = std::string());
69 // Member variables
70 std::string m_strArtist; // album artist
71 std::string m_strAlbum; // album title
72 std::string m_strGenre; // album genre
73 int m_iYear; //album year
74 int m_iTrack; // current track
75 int m_iDiscNumber; // Disc number
76 ReplayGain::Info m_albumReplayGain;
78 bool m_bOneFilePerTrack;
80 // cuetrack array
81 typedef std::vector<CCueTrack> Tracks;
82 Tracks m_tracks;
84 std::string ExtractInfo(const std::string &line);
85 int ExtractTimeFromIndex(const std::string &index);
86 int ExtractNumericInfo(const std::string &info);
87 bool ResolvePath(std::string &strPath, const std::string &strBase);