Merge pull request #3819 from arnova/subtitles_for_stacks
[vuplus_xbmc] / xbmc / visualizations / Vortex / VortexVis / Core / Vortex.h
1 /*
2  *  Copyright © 2010-2013 Team XBMC
3  *  http://xbmc.org
4  *
5  *  This program is free software: you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation, either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  *
18  */
19
20 #ifndef _VORTEX_H_
21
22 #include <d3d9.h>
23
24 class asIScriptEngine;
25 class VisTrack;
26
27 struct UserSettings
28 {
29         bool RandomPresetsEnabled;
30         bool PresetLocked;
31         bool TransitionsEnabled;
32         bool ShowAudioAnalysis;
33         bool StopFirstPreset;
34         bool ShowFPS;
35         bool ShowDebugConsole;
36         float TimeBetweenPresets;
37         float TimeBetweenPresetsRand;
38
39         UserSettings()
40         {
41                 RandomPresetsEnabled = true;
42                 PresetLocked = false;
43                 TransitionsEnabled = true;
44                 ShowAudioAnalysis = false;
45                 StopFirstPreset = true;
46                 ShowFPS = false;
47                 ShowDebugConsole = false;
48                 TimeBetweenPresets = 10.0f;
49                 TimeBetweenPresetsRand = 0.0f;
50         }
51
52 };
53
54 class Vortex
55 {
56 public:
57         void Init( LPDIRECT3DDEVICE9 pD3DDevice, int iPosX, int iPosY, int iWidth, int iHeight, float fPixelRatio );
58         void Start( int iChannels, int iSamplesPerSec, int iBitsPerSample, const char* szSongName );
59         void Shutdown();
60         void AudioData( const float* pAudioData, int iAudioDataLength, float* pFreq, int iFreqDataLength );
61         void Render();
62         void UpdateTrack( VisTrack* pVisTrack );
63         void UpdateAlbumArt( char* artFilename );
64         void LoadNextPreset();
65         void LoadPreviousPreset();
66         void LoadRandomPreset();
67         void LoadPreset( int PresetId );
68
69         int GetCurrentPresetIndex();
70         int GetPresets( char*** Presets );
71
72         UserSettings& GetUserSettings();
73         void LoadSettings();
74         void SaveSettings();
75
76 private:
77         bool InitAngelScript();
78         asIScriptEngine* m_pScriptEngine;
79 };
80
81 #endif // _VORTEX_H_