[cosmetics] update date in GPL header
[vuplus_xbmc] / xbmc / addons / include / xbmc_vis_types.h
1 /*
2  *      Copyright (C) 2005-2013 Team XBMC
3  *      http://www.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, or (at your option)
8  *  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 XBMC; see the file COPYING.  If not, see
17  *  <http://www.gnu.org/licenses/>.
18  *
19  */
20
21 /*
22   Common data structures shared between XBMC and XBMC's visualisations
23  */
24
25 #ifndef __VISUALISATION_TYPES_H__
26 #define __VISUALISATION_TYPES_H__
27 #include <cstddef>
28
29 extern "C"
30 {
31   struct VIS_INFO
32   {
33     int bWantsFreq;
34     int iSyncDelay;
35   };
36
37   struct VIS_PROPS
38   {
39     void *device;
40     int x;
41     int y;
42     int width;
43     int height;
44     float pixelRatio;
45     const char *name;
46     const char *presets;
47     const char *profile;
48     const char *submodule;
49   };
50
51   enum VIS_ACTION
52   { 
53     VIS_ACTION_NONE = 0,
54     VIS_ACTION_NEXT_PRESET,
55     VIS_ACTION_PREV_PRESET,
56     VIS_ACTION_LOAD_PRESET,
57     VIS_ACTION_RANDOM_PRESET,
58     VIS_ACTION_LOCK_PRESET,
59     VIS_ACTION_RATE_PRESET_PLUS,
60     VIS_ACTION_RATE_PRESET_MINUS,
61     VIS_ACTION_UPDATE_ALBUMART,
62     VIS_ACTION_UPDATE_TRACK
63   };
64
65   class VisTrack
66   {
67   public:
68     VisTrack()
69     {
70       title = artist = album = albumArtist = NULL;
71       genre = comment = lyrics = reserved1 = reserved2 = NULL;
72       trackNumber = discNumber = duration = year = 0;
73       rating = 0;
74       reserved3 = reserved4 = 0;
75     }
76
77     const char *title;
78     const char *artist;
79     const char *album;
80     const char *albumArtist;
81     const char *genre;
82     const char *comment;
83     const char *lyrics;
84     const char *reserved1;
85     const char *reserved2;
86
87     int        trackNumber;
88     int        discNumber;
89     int        duration;
90     int        year;
91     char       rating;
92     int        reserved3;
93     int        reserved4;
94   };
95
96   struct Visualisation
97   {
98     void (__cdecl* Start)(int iChannels, int iSamplesPerSec, int iBitsPerSample, const char* szSongName);
99     void (__cdecl* AudioData)(const float* pAudioData, int iAudioDataLength, float *pFreqData, int iFreqDataLength);
100     void (__cdecl* Render) ();
101     void (__cdecl* GetInfo)(VIS_INFO *info);
102     bool (__cdecl* OnAction)(long flags, const void *param);
103     int (__cdecl* HasPresets)();
104     unsigned int (__cdecl *GetPresets)(char ***presets);
105     unsigned int (__cdecl *GetPreset)();
106     unsigned int (__cdecl *GetSubModules)(char ***modules);
107     bool (__cdecl* IsLocked)();
108   };
109 }
110
111 #endif //__VISUALISATION_TYPES_H__