1 #ifndef KARAOKELYRICS_H
2 #define KARAOKELYRICS_H
5 * Copyright (C) 2005-2013 Team XBMC
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)
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.
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/>.
24 // C++ Interface: karaokelyrics
26 // Abstract interface class for all Karaoke lyrics
31 virtual ~CKaraokeLyrics();
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;
38 //! Should return true if the lyrics have background, and therefore should not use
39 //! predefined background.
40 virtual bool HasBackground() = 0;
42 //! Should return true if the lyrics have video file to play
43 virtual bool HasVideo() = 0;
45 //! Should return video parameters if HasVideo() returned true
46 virtual void GetVideoParameters( CStdString& path, int64_t& offset ) = 0;
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();
53 //! This function is called to render the lyrics (each frame(?))
54 virtual void Render() = 0;
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();
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
64 double getSongTime() const;
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
69 CStdString getSongFile() const;
71 //! Sets the path to the lyrics file, and restores musicdb values
72 void initData( const CStdString& songPath );
74 //! Adjusts lyrics delay
75 void lyricsDelayIncrease();
76 void lyricsDelayDecrease();
79 //! Number of milliseconds the lyrics are delayed to compensate.
82 //! Original m_avDelay to see if it was changed
85 //! Current playing song
86 CStdString m_songPath;