[cosmetics] update date in GPL header
[vuplus_xbmc] / xbmc / music / karaoke / karaokelyrics.h
1 #ifndef KARAOKELYRICS_H
2 #define KARAOKELYRICS_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: karaokelyrics
25
26 // Abstract interface class for all Karaoke lyrics
27 class CKaraokeLyrics
28 {
29   public:
30       CKaraokeLyrics();
31     virtual ~CKaraokeLyrics();
32
33     //! Parses the lyrics or song file, and loads the lyrics into memory. This function
34     //! returns true if the lyrics are successfully loaded, or loading is in progress,
35     //! and false otherwise.
36     virtual bool Load() = 0;
37
38     //! Should return true if the lyrics have background, and therefore should not use
39     //! predefined background.
40     virtual bool HasBackground() = 0;
41
42     //! Should return true if the lyrics have video file to play
43     virtual bool HasVideo() = 0;
44
45     //! Should return video parameters if HasVideo() returned true
46     virtual void GetVideoParameters( CStdString& path, int64_t& offset  ) = 0;
47
48     //! This function is called when the karoke visualisation window created. It may
49     //! be called after Start(), but is guaranteed to be called before Render()
50     //! Default implementation does nothing and returns true.
51     virtual bool InitGraphics();
52
53     //! This function is called to render the lyrics (each frame(?))
54     virtual void Render() = 0;
55
56     //! This function is called before the object is destroyed. Default implementation does nothing.
57     //! You must override it if your lyrics class starts threads which need to be stopped, and stop
58     //! all of them before returning back.
59     virtual void Shutdown();
60
61     //! This function gets 'real' time since the moment song begins, corrected by using remote control
62     //! to increase/decrease lyrics delays. All lyric show functions must use it to properly calculate
63     //! the offset.
64     double getSongTime() const;
65
66     //! This function gets 'real' time since the moment song begins, corrected by using remote control
67     //! to increase/decrease lyrics delays. All lyric show functions must use it to properly calculate
68     //! the offset.
69     CStdString getSongFile() const;
70
71     //! Sets the path to the lyrics file, and restores musicdb values
72     void initData( const CStdString& songPath );
73
74     //! Adjusts lyrics delay
75     void lyricsDelayIncrease();
76     void lyricsDelayDecrease();
77
78   private:
79     //! Number of milliseconds the lyrics are delayed to compensate.
80     double        m_avDelay;
81
82     //! Original m_avDelay to see if it was changed
83     double        m_avOrigDelay;
84
85     //! Current playing song
86     CStdString    m_songPath;
87     long          m_idSong;
88 };
89
90 #endif