[cosmetics] update date in GPL header
[vuplus_xbmc] / xbmc / music / karaoke / karaokelyricstextkar.h
1 #ifndef KARAOKELYRICSTEXTKAR_H
2 #define KARAOKELYRICSTEXTKAR_H
3
4 /*
5  *      Copyright (C) 2005-2013 Team XBMC
6  *      http://www.xbmc.org
7  *
8  *  This Program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2, or (at your option)
11  *  any later version.
12  *
13  *  This Program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with XBMC; see the file COPYING.  If not, see
20  *  <http://www.gnu.org/licenses/>.
21  *
22  */
23
24 // C++ Interface: karaokelyricstextkar
25
26 #include "karaokelyricstext.h"
27
28
29 //! This class loads MIDI/KAR format lyrics
30 class CKaraokeLyricsTextKAR : public CKaraokeLyricsText
31 {
32   public:
33     CKaraokeLyricsTextKAR( const CStdString & midiFile );
34     ~CKaraokeLyricsTextKAR();
35
36     //! Parses the lyrics or song file, and loads the lyrics into memory.
37     //! Returns true if the lyrics are successfully loaded, false otherwise.
38     bool  Load();
39
40   private:
41     void      parseMIDI();
42     CStdString    convertText( const char * data );
43
44     unsigned char   readByte();
45     unsigned short  readWord();
46     unsigned int  readDword();
47     int       readVarLen();
48     void      readData( void * buf, unsigned int length );
49
50     unsigned int   currentPos() const;
51     void      setPos( unsigned int offset );
52
53     // MIDI file name
54     CStdString     m_midiFile;
55
56     // MIDI in-memory information
57     unsigned char *  m_midiData;
58     unsigned int  m_midiOffset;
59     unsigned int  m_midiSize;
60     bool          m_reportedInvalidVarField;
61 };
62
63 #endif