annotate gui/app.c @ 32770:5f64b983624a

FPS are in float in sh_video, not double. Original patch by rodries/wiimc.org. This is necessary for the next fix to come.
author cboesch
date Sat, 05 Feb 2011 19:05:02 +0000
parents 3ceeb62a1125
children 12ae3b893c59
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26458
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
1 /*
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
2 * This file is part of MPlayer.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
3 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
5 * it under the terms of the GNU General Public License as published by
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
7 * (at your option) any later version.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
8 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
12 * GNU General Public License for more details.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
13 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
14 * You should have received a copy of the GNU General Public License along
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 25243
diff changeset
17 */
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
18
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
19 #include <stdlib.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
20 #include <stdio.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
21 #include <string.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
22
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
23 #include "config.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
24 #include "mp_msg.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
25 #include "help_mp.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
26
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
27 #include "app.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
28 #include "wm/wskeys.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
29 #include "skin/skin.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
30 #include "mplayer/gmplayer.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
31 #include "interface.h"
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
32
25243
2dee54f0d8a0 evNames / evBoxs should be "static const"
reimar
parents: 23620
diff changeset
33 static const evName evNames[] =
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
34 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
35 { evNone, "evNone" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
36 { evPlay, "evPlay" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
37 { evStop, "evStop" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
38 { evPause, "evPause" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
39 { evPrev, "evPrev" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
40 { evNext, "evNext" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
41 { evLoad, "evLoad" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
42 { evEqualizer, "evEqualizer" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
43 { evEqualizer, "evEqualeaser" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
44 { evPlayList, "evPlaylist" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
45 { evExit, "evExit" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
46 { evIconify, "evIconify" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
47 { evIncBalance, "evIncBalance" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
48 { evDecBalance, "evDecBalance" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
49 { evFullScreen, "evFullScreen" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
50 { evFName, "evFName" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
51 { evMovieTime, "evMovieTime" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
52 { evAbout, "evAbout" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
53 { evLoadPlay, "evLoadPlay" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
54 { evPreferences, "evPreferences" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
55 { evSkinBrowser, "evSkinBrowser" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
56 { evBackward10sec, "evBackward10sec" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
57 { evForward10sec, "evForward10sec" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
58 { evBackward1min, "evBackward1min" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
59 { evForward1min, "evForward1min" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
60 { evBackward10min, "evBackward10min" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
61 { evForward10min, "evForward10min" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
62 { evIncVolume, "evIncVolume" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
63 { evDecVolume, "evDecVolume" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
64 { evMute, "evMute" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
65 { evIncAudioBufDelay, "evIncAudioBufDelay" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
66 { evDecAudioBufDelay, "evDecAudioBufDelay" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
67 { evPlaySwitchToPause, "evPlaySwitchToPause" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
68 { evPauseSwitchToPlay, "evPauseSwitchToPlay" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
69 { evNormalSize, "evHalfSize" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
70 { evNormalSize, "evNormalSize" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
71 { evDoubleSize, "evDoubleSize" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
72 { evSetMoviePosition, "evSetMoviePosition" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
73 { evSetVolume, "evSetVolume" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
74 { evSetBalance, "evSetBalance" },
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26458
diff changeset
75 { evHelp, "evHelp" },
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
76 { evLoadSubtitle, "evLoadSubtitle" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
77 { evPlayDVD, "evPlayDVD" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
78 { evPlayVCD, "evPlayVCD" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79 { evSetURL, "evSetURL" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
80 { evLoadAudioFile, "evLoadAudioFile" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
81 { evDropSubtitle, "evDropSubtitle" },
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
82 { evSetAspect, "evSetAspect" }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
83 };
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
84
25243
2dee54f0d8a0 evNames / evBoxs should be "static const"
reimar
parents: 23620
diff changeset
85 static const int evBoxs = sizeof( evNames ) / sizeof( evName );
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
86
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
87 // ---
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
88
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
89 listItems appMPlayer;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
90
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
91 /* FIXME: Eventually remove the obsolete directory names. */
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
92 char * skinDirInHome=NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
93 char * skinDirInHome_obsolete=NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
94 char * skinMPlayerDir=NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
95 char * skinMPlayerDir_obsolete=NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
96 char * skinName = NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
97
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
98 void appClearItem( wItem * item )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
99 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
100 item->type=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
101 // ---
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
102 item->x=0; item->y=0; item->width=0; item->height=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
103 // ---
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
104 item->px=0; item->py=0; item->psx=0; item->psy=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
105 // ---
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
106 item->msg=0; item->msg2=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
107 item->pressed=btnReleased;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
108 item->tmp=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
109 item->key=0; item->key2=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
110 item->Bitmap.Width=0; item->Bitmap.Height=0; item->Bitmap.BPP=0; item->Bitmap.ImageSize=0;
32537
8fa2f43cb760 Remove most of the NULL pointer check before free all over the code
cboesch
parents: 29263
diff changeset
111 free(item->Bitmap.Image);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
112 item->Bitmap.Image=NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
113 // ---
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
114 item->fontid=0;
32537
8fa2f43cb760 Remove most of the NULL pointer check before free all over the code
cboesch
parents: 29263
diff changeset
115 free(item->label);
8fa2f43cb760 Remove most of the NULL pointer check before free all over the code
cboesch
parents: 29263
diff changeset
116 item->label=NULL;
32761
3ceeb62a1125 Improve the readability of dynamic labels which scroll.
ib
parents: 32537
diff changeset
117 free(item->text);
3ceeb62a1125 Improve the readability of dynamic labels which scroll.
ib
parents: 32537
diff changeset
118 item->text=NULL;
3ceeb62a1125 Improve the readability of dynamic labels which scroll.
ib
parents: 32537
diff changeset
119 item->textwidth=0;
3ceeb62a1125 Improve the readability of dynamic labels which scroll.
ib
parents: 32537
diff changeset
120 item->starttime=0;
3ceeb62a1125 Improve the readability of dynamic labels which scroll.
ib
parents: 32537
diff changeset
121 item->last_x=0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
122 item->event=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
123 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
124
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
125 void appCopy( listItems * dest,listItems * source )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
126 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
127 dest->NumberOfItems=source->NumberOfItems;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
128 memcpy( &dest->Items,&source->Items,128 * sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
129
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
130 dest->NumberOfMenuItems=source->NumberOfMenuItems;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
131 memcpy( &dest->MenuItems,&source->MenuItems,32 * sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
132
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
133 memcpy( &dest->main,&source->main,sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
134 memcpy( &dest->sub,&source->sub,sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
135 memcpy( &dest->menuBase,&source->menuBase,sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
136 memcpy( &dest->menuSelected,&source->menuSelected,sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
137 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
138
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
139 void appInitStruct( listItems * item )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
140 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
141 int i;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
142 for ( i=0;i<item->NumberOfItems;i++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
143 appClearItem( &item->Items[i] );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
144 for ( i=0;i<item->NumberOfMenuItems;i++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
145 appClearItem( &item->MenuItems[i] );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
146 for ( i=0;i<item->NumberOfBarItems;i++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
147 appClearItem( &item->barItems[i] );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
148
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
149 item->NumberOfItems=-1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
150 memset( item->Items,0,256 * sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
151 item->NumberOfMenuItems=-1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
152 memset( item->MenuItems,0,64 * sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
153 item->NumberOfBarItems=-1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
154 memset( item->barItems,0,256 * sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
155
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
156 appClearItem( &item->main );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
157 item->mainDecoration=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
158 appClearItem( &item->sub );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
159 item->sub.width=0; item->sub.height=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
160 item->sub.x=-1; item->sub.y=-1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
161 appClearItem( &item->menuBase );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
162 appClearItem( &item->menuSelected );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
163 item->sub.R=item->sub.G=item->sub.B=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
164 item->bar.R=item->bar.G=item->bar.B=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
165 item->main.R=item->main.G=item->main.B=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
166 item->barIsPresent=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
167 item->menuIsPresent=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
168 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
169
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
170 int appFindKey( unsigned char * name )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
171 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
172 int i;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
173 for ( i=0;i<wsKeyNumber;i++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
174 if ( !strcmp( wsKeyNames[i].name,name ) ) return wsKeyNames[i].code;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
175 return -1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
176 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
177
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
178 int appFindMessage( unsigned char * str )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
179 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
180 int i;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
181 for ( i=0;i<evBoxs;i++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
182 if ( !strcmp( evNames[i].name,str ) ) return evNames[i].msg;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
183 return -1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
184 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
185
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
186 void btnModify( int event,float state )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
187 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
188 int j;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
189 for ( j=0;j < appMPlayer.NumberOfItems + 1;j++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
190 if ( appMPlayer.Items[j].msg == event )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
191 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
192 switch ( appMPlayer.Items[j].type )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
193 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
194 case itButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
195 appMPlayer.Items[j].pressed=(int)state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
196 appMPlayer.Items[j].tmp=(int)state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
197 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
198 case itPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
199 case itVPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
200 case itHPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
201 if ( state < 0.0f ) state=0.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
202 if ( state > 100.f ) state=100.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
203 appMPlayer.Items[j].value=state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
204 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
205 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
206 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
207
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
208 for ( j=0;j < appMPlayer.NumberOfBarItems + 1;j++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
209 if ( appMPlayer.barItems[j].msg == event )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
210 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
211 switch ( appMPlayer.barItems[j].type )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
212 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
213 case itButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
214 appMPlayer.barItems[j].pressed=(int)state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
215 appMPlayer.barItems[j].tmp=(int)state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
216 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
217 case itPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
218 case itVPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
219 case itHPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
220 if ( state < 0.0f ) state=0.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
221 if ( state > 100.f ) state=100.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
222 appMPlayer.barItems[j].value=state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
223 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
224 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
225 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
226 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
227
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
228 float btnGetValue( int event )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
229 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
230 int j;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
231 for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
232 if ( appMPlayer.Items[j].msg == event ) return appMPlayer.Items[j].value;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
233 return 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
234 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
235
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
236 void btnSet( int event,int set )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
237 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
238 int j;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
239 for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
240 if ( appMPlayer.Items[j].msg == event )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
241 { appMPlayer.Items[j].pressed=set; appMPlayer.barItems[j].tmp=0; }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
242 for ( j=0;j<appMPlayer.NumberOfBarItems + 1;j++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
243 if ( appMPlayer.barItems[j].msg == event )
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26458
diff changeset
244 { appMPlayer.barItems[j].pressed=set; appMPlayer.barItems[j].tmp=0; }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
245 }