annotate gui/app.c @ 31135:5a55c39743d1

Add empty newline to separate function declarations, for better readability.
author stefano
date Sun, 23 May 2010 10:02:30 +0000
parents 0f1b5b68af32
children 8fa2f43cb760
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;
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26458
diff changeset
111 if ( item->Bitmap.Image ) 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;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
115 if ( item->label ) free( item->label ); item->label=NULL;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
116 item->event=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
117 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
118
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
119 void appCopy( listItems * dest,listItems * source )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
120 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
121 dest->NumberOfItems=source->NumberOfItems;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
122 memcpy( &dest->Items,&source->Items,128 * sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
123
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
124 dest->NumberOfMenuItems=source->NumberOfMenuItems;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
125 memcpy( &dest->MenuItems,&source->MenuItems,32 * sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
126
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
127 memcpy( &dest->main,&source->main,sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
128 memcpy( &dest->sub,&source->sub,sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
129 memcpy( &dest->menuBase,&source->menuBase,sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
130 memcpy( &dest->menuSelected,&source->menuSelected,sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
131 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
132
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
133 void appInitStruct( listItems * item )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
134 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
135 int i;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
136 for ( i=0;i<item->NumberOfItems;i++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
137 appClearItem( &item->Items[i] );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
138 for ( i=0;i<item->NumberOfMenuItems;i++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
139 appClearItem( &item->MenuItems[i] );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
140 for ( i=0;i<item->NumberOfBarItems;i++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
141 appClearItem( &item->barItems[i] );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
142
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
143 item->NumberOfItems=-1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
144 memset( item->Items,0,256 * sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
145 item->NumberOfMenuItems=-1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
146 memset( item->MenuItems,0,64 * sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
147 item->NumberOfBarItems=-1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
148 memset( item->barItems,0,256 * sizeof( wItem ) );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
149
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
150 appClearItem( &item->main );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
151 item->mainDecoration=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
152 appClearItem( &item->sub );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
153 item->sub.width=0; item->sub.height=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
154 item->sub.x=-1; item->sub.y=-1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
155 appClearItem( &item->menuBase );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
156 appClearItem( &item->menuSelected );
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
157 item->sub.R=item->sub.G=item->sub.B=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
158 item->bar.R=item->bar.G=item->bar.B=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
159 item->main.R=item->main.G=item->main.B=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
160 item->barIsPresent=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
161 item->menuIsPresent=0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
162 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
163
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
164 int appFindKey( unsigned char * name )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
165 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
166 int i;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
167 for ( i=0;i<wsKeyNumber;i++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
168 if ( !strcmp( wsKeyNames[i].name,name ) ) return wsKeyNames[i].code;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
169 return -1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
170 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
171
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
172 int appFindMessage( unsigned char * str )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
173 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
174 int i;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
175 for ( i=0;i<evBoxs;i++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
176 if ( !strcmp( evNames[i].name,str ) ) return evNames[i].msg;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
177 return -1;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
178 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
179
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
180 void btnModify( int event,float state )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
181 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
182 int j;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
183 for ( j=0;j < appMPlayer.NumberOfItems + 1;j++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
184 if ( appMPlayer.Items[j].msg == event )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
185 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
186 switch ( appMPlayer.Items[j].type )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
187 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
188 case itButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
189 appMPlayer.Items[j].pressed=(int)state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
190 appMPlayer.Items[j].tmp=(int)state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
191 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
192 case itPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
193 case itVPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
194 case itHPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
195 if ( state < 0.0f ) state=0.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
196 if ( state > 100.f ) state=100.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
197 appMPlayer.Items[j].value=state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
198 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
199 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
200 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
201
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
202 for ( j=0;j < appMPlayer.NumberOfBarItems + 1;j++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
203 if ( appMPlayer.barItems[j].msg == event )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
204 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
205 switch ( appMPlayer.barItems[j].type )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
206 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
207 case itButton:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
208 appMPlayer.barItems[j].pressed=(int)state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
209 appMPlayer.barItems[j].tmp=(int)state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
210 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
211 case itPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
212 case itVPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
213 case itHPotmeter:
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
214 if ( state < 0.0f ) state=0.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
215 if ( state > 100.f ) state=100.0f;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
216 appMPlayer.barItems[j].value=state;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
217 break;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
218 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
219 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
220 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
221
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
222 float btnGetValue( int event )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
223 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
224 int j;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
225 for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
226 if ( appMPlayer.Items[j].msg == event ) return appMPlayer.Items[j].value;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
227 return 0;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
228 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
229
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
230 void btnSet( int event,int set )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
231 {
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
232 int j;
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
233 for ( j=0;j<appMPlayer.NumberOfItems + 1;j++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
234 if ( appMPlayer.Items[j].msg == event )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
235 { appMPlayer.Items[j].pressed=set; appMPlayer.barItems[j].tmp=0; }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
236 for ( j=0;j<appMPlayer.NumberOfBarItems + 1;j++ )
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
237 if ( appMPlayer.barItems[j].msg == event )
29263
0f1b5b68af32 whitespace cosmetics: Remove all trailing whitespace.
diego
parents: 26458
diff changeset
238 { appMPlayer.barItems[j].pressed=set; appMPlayer.barItems[j].tmp=0; }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
239 }