annotate gui/app.c @ 33084:b8779b19730e

Cosmetic: Rename menuBase menu. The new name corresponds better to the names of the other wItems and statements using it are more intelligible.
author ib
date Thu, 31 Mar 2011 12:25:32 +0000
parents 901dc2c4130f
children eabc2472e7eb
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 "app.h"
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
20
32921
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
21 #include "interface.h"
32983
8de2eee48196 Cosmetic: Prefer path relative to current directory.
ib
parents: 32960
diff changeset
22 #include "skin/font.h"
32921
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
23
32944
27a98940e3aa Use FF_ARRAY_ELEMS() rather than a separate constant.
ib
parents: 32937
diff changeset
24 #include "libavutil/common.h"
27a98940e3aa Use FF_ARRAY_ELEMS() rather than a separate constant.
ib
parents: 32937
diff changeset
25
32937
3c57056637cc Cosmetic: Rename listItems structure.
ib
parents: 32933
diff changeset
26 guiItems appMPlayer;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
27
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
28 static const evName evNames[] = {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
29 { evNone, "evNone" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
30 { evPlay, "evPlay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
31 { evStop, "evStop" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
32 { evPause, "evPause" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
33 { evPrev, "evPrev" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
34 { evNext, "evNext" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
35 { evLoad, "evLoad" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
36 { evEqualizer, "evEqualizer" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
37 { evPlayList, "evPlaylist" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
38 { evExit, "evExit" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
39 { evIconify, "evIconify" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
40 { evIncBalance, "evIncBalance" }, // NOTE TO MYSELF: not all of these events
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
41 { evDecBalance, "evDecBalance" }, // are actually implemented, and update doc
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
42 { evFullScreen, "evFullScreen" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
43 { evFName, "evFName" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
44 { evMovieTime, "evMovieTime" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
45 { evAbout, "evAbout" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
46 { evLoadPlay, "evLoadPlay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
47 { evPreferences, "evPreferences" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
48 { evSkinBrowser, "evSkinBrowser" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
49 { evBackward10sec, "evBackward10sec" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
50 { evForward10sec, "evForward10sec" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
51 { evBackward1min, "evBackward1min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
52 { evForward1min, "evForward1min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
53 { evBackward10min, "evBackward10min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
54 { evForward10min, "evForward10min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
55 { evIncVolume, "evIncVolume" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
56 { evDecVolume, "evDecVolume" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
57 { evMute, "evMute" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
58 { evIncAudioBufDelay, "evIncAudioBufDelay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
59 { evDecAudioBufDelay, "evDecAudioBufDelay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
60 { evPlaySwitchToPause, "evPlaySwitchToPause" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
61 { evPauseSwitchToPlay, "evPauseSwitchToPlay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
62 { evNormalSize, "evHalfSize" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
63 { evNormalSize, "evNormalSize" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
64 { evDoubleSize, "evDoubleSize" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
65 { evSetMoviePosition, "evSetMoviePosition" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
66 { evSetVolume, "evSetVolume" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
67 { evSetBalance, "evSetBalance" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
68 { evHelp, "evHelp" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
69 { evLoadSubtitle, "evLoadSubtitle" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
70 { evPlayDVD, "evPlayDVD" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
71 { evPlayVCD, "evPlayVCD" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
72 { evSetURL, "evSetURL" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
73 { evLoadAudioFile, "evLoadAudioFile" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
74 { evDropSubtitle, "evDropSubtitle" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
75 { evSetAspect, "evSetAspect" }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
76 };
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
77
32898
eeb36d798219 Limit scope of internally used appClearItem().
ib
parents: 32897
diff changeset
78 static void appClearItem(wItem *item)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79 {
32917
9949f3a123cf Add new function bpFree() to free txSamples (bitmaps).
ib
parents: 32912
diff changeset
80 bpFree(&item->Bitmap);
32921
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
81 bpFree(&item->Mask);
32947
0e4fd1834f76 Prefer free() to gfree().
ib
parents: 32946
diff changeset
82 free(item->label);
0e4fd1834f76 Prefer free() to gfree().
ib
parents: 32946
diff changeset
83 free(item->text);
32946
d551faf8d07e Simplify appClearItem() by using memset().
ib
parents: 32945
diff changeset
84 memset(item, 0, sizeof(*item));
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
85 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
86
32945
15aecb36f23e Cosmetic: Rename appResetStruct() appInitStruct().
ib
parents: 32944
diff changeset
87 void appInitStruct(void)
32927
edb972e22021 Fix memory leak in appInitStruct().
ib
parents: 32926
diff changeset
88 {
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32930
diff changeset
89 appMPlayer.IndexOfMainItems = -1;
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32930
diff changeset
90 appMPlayer.IndexOfBarItems = -1;
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32930
diff changeset
91 appMPlayer.IndexOfMenuItems = -1;
32927
edb972e22021 Fix memory leak in appInitStruct().
ib
parents: 32926
diff changeset
92
edb972e22021 Fix memory leak in appInitStruct().
ib
parents: 32926
diff changeset
93 appMPlayer.sub.x = -1; // NOTE TO MYSELF: is this really necessary?
edb972e22021 Fix memory leak in appInitStruct().
ib
parents: 32926
diff changeset
94 appMPlayer.sub.y = -1; // NOTE TO MYSELF: is this really necessary?
edb972e22021 Fix memory leak in appInitStruct().
ib
parents: 32926
diff changeset
95 }
edb972e22021 Fix memory leak in appInitStruct().
ib
parents: 32926
diff changeset
96
32932
e95ec1b2feea Cosmetic: Rename appInitStruct() to appFreeStruct().
ib
parents: 32931
diff changeset
97 void appFreeStruct(void)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
98 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
99 int i;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
100
32929
6ea9e024f05e Clean up appInitStruct().
ib
parents: 32928
diff changeset
101 appClearItem(&appMPlayer.main);
6ea9e024f05e Clean up appInitStruct().
ib
parents: 32928
diff changeset
102 appMPlayer.mainDecoration = 0;
6ea9e024f05e Clean up appInitStruct().
ib
parents: 32928
diff changeset
103
6ea9e024f05e Clean up appInitStruct().
ib
parents: 32928
diff changeset
104 appClearItem(&appMPlayer.sub);
6ea9e024f05e Clean up appInitStruct().
ib
parents: 32928
diff changeset
105
6ea9e024f05e Clean up appInitStruct().
ib
parents: 32928
diff changeset
106 appClearItem(&appMPlayer.bar);
6ea9e024f05e Clean up appInitStruct().
ib
parents: 32928
diff changeset
107 appMPlayer.barIsPresent = 0;
6ea9e024f05e Clean up appInitStruct().
ib
parents: 32928
diff changeset
108
33084
b8779b19730e Cosmetic: Rename menuBase menu.
ib
parents: 33047
diff changeset
109 appClearItem(&appMPlayer.menu);
32929
6ea9e024f05e Clean up appInitStruct().
ib
parents: 32928
diff changeset
110 appClearItem(&appMPlayer.menuSelected);
6ea9e024f05e Clean up appInitStruct().
ib
parents: 32928
diff changeset
111 appMPlayer.menuIsPresent = 0;
6ea9e024f05e Clean up appInitStruct().
ib
parents: 32928
diff changeset
112
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32930
diff changeset
113 for (i = 0; i <= appMPlayer.IndexOfMainItems; i++)
32926
7c205a5c2a9b Remove parameter from appInitStruct() function.
ib
parents: 32925
diff changeset
114 appClearItem(&appMPlayer.mainItems[i]);
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32930
diff changeset
115 for (i = 0; i <= appMPlayer.IndexOfBarItems; i++)
32926
7c205a5c2a9b Remove parameter from appInitStruct() function.
ib
parents: 32925
diff changeset
116 appClearItem(&appMPlayer.barItems[i]);
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32930
diff changeset
117 for (i = 0; i <= appMPlayer.IndexOfMenuItems; i++)
32926
7c205a5c2a9b Remove parameter from appInitStruct() function.
ib
parents: 32925
diff changeset
118 appClearItem(&appMPlayer.menuItems[i]);
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
119
32945
15aecb36f23e Cosmetic: Rename appResetStruct() appInitStruct().
ib
parents: 32944
diff changeset
120 appInitStruct();
32933
258baf2bfeca Move fntFreeFont() into appFreeStruct().
ib
parents: 32932
diff changeset
121 fntFreeFont();
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
122 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
123
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
124 int appFindMessage(unsigned char *str)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
125 {
32944
27a98940e3aa Use FF_ARRAY_ELEMS() rather than a separate constant.
ib
parents: 32937
diff changeset
126 unsigned int i;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
127
32944
27a98940e3aa Use FF_ARRAY_ELEMS() rather than a separate constant.
ib
parents: 32937
diff changeset
128 for (i = 0; i < FF_ARRAY_ELEMS(evNames); i++)
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
129 if (!strcmp(evNames[i].name, str))
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
130 return evNames[i].message;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
131
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
132 return -1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
133 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
134
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
135 void btnModify(int event, float state)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
136 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
137 int i;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
138
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32930
diff changeset
139 for (i = 0; i <= appMPlayer.IndexOfMainItems; i++) {
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
140 if (appMPlayer.mainItems[i].message == event) {
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
141 switch (appMPlayer.mainItems[i].type) {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
142 case itButton:
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
143 appMPlayer.mainItems[i].pressed = (int)state;
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
144 appMPlayer.mainItems[i].tmp = (int)state;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
145 break;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
146
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
147 case itPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
148 case itVPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
149 case itHPotmeter:
32960
06d7501e046f Make constants explicitly type float.
ib
parents: 32947
diff changeset
150 if (state < 0.0f)
06d7501e046f Make constants explicitly type float.
ib
parents: 32947
diff changeset
151 state = 0.0f;
06d7501e046f Make constants explicitly type float.
ib
parents: 32947
diff changeset
152 if (state > 100.0f)
06d7501e046f Make constants explicitly type float.
ib
parents: 32947
diff changeset
153 state = 100.0f;
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
154 appMPlayer.mainItems[i].value = state;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
155 break;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
156 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
157 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
158 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
159
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32930
diff changeset
160 for (i = 0; i <= appMPlayer.IndexOfBarItems; i++) {
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
161 if (appMPlayer.barItems[i].message == event) {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
162 switch (appMPlayer.barItems[i].type) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
163 case itButton:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
164 appMPlayer.barItems[i].pressed = (int)state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
165 appMPlayer.barItems[i].tmp = (int)state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
166 break;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
167
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
168 case itPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
169 case itVPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
170 case itHPotmeter:
32960
06d7501e046f Make constants explicitly type float.
ib
parents: 32947
diff changeset
171 if (state < 0.0f)
06d7501e046f Make constants explicitly type float.
ib
parents: 32947
diff changeset
172 state = 0.0f;
06d7501e046f Make constants explicitly type float.
ib
parents: 32947
diff changeset
173 if (state > 100.0f)
06d7501e046f Make constants explicitly type float.
ib
parents: 32947
diff changeset
174 state = 100.0f;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
175 appMPlayer.barItems[i].value = state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
176 break;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
177 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
178 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
179 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
180 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
181
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
182 void btnSet(int event, int set)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
183 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
184 int i;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
185
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32930
diff changeset
186 for (i = 0; i <= appMPlayer.IndexOfMainItems; i++) {
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
187 if (appMPlayer.mainItems[i].message == event) {
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
188 appMPlayer.mainItems[i].pressed = set;
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
189 appMPlayer.barItems[i].tmp = 0;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
190 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
191 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
192
32931
03b1051bed5c Rename the 'NumberOf' members of the listItems structure.
ib
parents: 32930
diff changeset
193 for (i = 0; i <= appMPlayer.IndexOfBarItems; i++) {
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
194 if (appMPlayer.barItems[i].message == event) {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
195 appMPlayer.barItems[i].pressed = set;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
196 appMPlayer.barItems[i].tmp = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
197 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
198 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
199 }