Merge pull request #4594 from FernetMenta/paplayer
[xbmc.git] / xbmc / CueDocument.h
blob650ffd2409a7457e7924262c4d8cc79592acd13f
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 "music/Song.h"
24 #include "filesystem/File.h"
26 #define MAX_PATH_SIZE 1024
28 class CCueDocument
30 class CCueTrack
32 public:
33 CCueTrack()
35 iTrackNumber = 0;
36 iStartTime = 0;
37 iEndTime = 0;
38 replayGainTrackGain = 0.0f;
39 replayGainTrackPeak = 0.0f;
41 CStdString strArtist;
42 CStdString strTitle;
43 CStdString strFile;
44 int iTrackNumber;
45 int iStartTime;
46 int iEndTime;
47 float replayGainTrackGain;
48 float replayGainTrackPeak;
51 public:
52 CCueDocument(void);
53 ~CCueDocument(void);
54 // USED
55 bool Parse(const CStdString &strFile);
56 void GetSongs(VECSONGS &songs);
57 CStdString GetMediaPath();
58 CStdString GetMediaTitle();
59 void GetMediaFiles(std::vector<CStdString>& mediaFiles);
61 private:
63 // USED for file access
64 XFILE::CFile m_file;
65 char m_szBuffer[1024];
67 // Member variables
68 CStdString m_strArtist; // album artist
69 CStdString m_strAlbum; // album title
70 CStdString m_strGenre; // album genre
71 int m_iYear; //album year
72 int m_iTrack; // current track
73 int m_iTotalTracks; // total tracks
74 int m_iDiscNumber; // Disc number
75 float m_replayGainAlbumGain;
76 float m_replayGainAlbumPeak;
78 // cuetrack array
79 std::vector<CCueTrack> m_Track;
81 bool ReadNextLine(CStdString &strLine);
82 CStdString ExtractInfo(const CStdString &line);
83 int ExtractTimeFromIndex(const CStdString &index);
84 int ExtractNumericInfo(const CStdString &info);
85 bool ResolvePath(CStdString &strPath, const CStdString &strBase);