annotate gui/app.c @ 32921:448517f556a5

Fix memory leak in appClearItem(). Mask wasn't freed. Additionally: symbolic constants are used for initialization where possible, the pressed default is btnDisabled now, gfree() is preferred to free() and setting NULL, and statements are rearranged according to members in structure.
author ib
date Thu, 03 Mar 2011 11:43:01 +0000
parents efb929029ec9
children 4546e629ae70
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 <string.h>
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
21
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
22 #include "app.h"
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
23
32921
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
24 #include "gui/skin/font.h"
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
25 #include "interface.h"
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
26
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
27 listItems appMPlayer;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
28
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
29 static const evName evNames[] = {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
30 { evNone, "evNone" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
31 { evPlay, "evPlay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
32 { evStop, "evStop" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
33 { evPause, "evPause" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
34 { evPrev, "evPrev" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
35 { evNext, "evNext" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
36 { evLoad, "evLoad" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
37 { evEqualizer, "evEqualizer" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
38 { evEqualizer, "evEqualeaser" }, // NOTE TO MYSELF: any skin using this?
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
39 { evPlayList, "evPlaylist" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
40 { evExit, "evExit" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
41 { evIconify, "evIconify" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
42 { evIncBalance, "evIncBalance" }, // NOTE TO MYSELF: not all of these events
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
43 { evDecBalance, "evDecBalance" }, // are actually implemented, and update doc
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
44 { evFullScreen, "evFullScreen" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
45 { evFName, "evFName" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
46 { evMovieTime, "evMovieTime" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
47 { evAbout, "evAbout" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
48 { evLoadPlay, "evLoadPlay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
49 { evPreferences, "evPreferences" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
50 { evSkinBrowser, "evSkinBrowser" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
51 { evBackward10sec, "evBackward10sec" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
52 { evForward10sec, "evForward10sec" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
53 { evBackward1min, "evBackward1min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
54 { evForward1min, "evForward1min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
55 { evBackward10min, "evBackward10min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
56 { evForward10min, "evForward10min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
57 { evIncVolume, "evIncVolume" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
58 { evDecVolume, "evDecVolume" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
59 { evMute, "evMute" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
60 { evIncAudioBufDelay, "evIncAudioBufDelay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
61 { evDecAudioBufDelay, "evDecAudioBufDelay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
62 { evPlaySwitchToPause, "evPlaySwitchToPause" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
63 { evPauseSwitchToPlay, "evPauseSwitchToPlay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
64 { evNormalSize, "evHalfSize" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
65 { evNormalSize, "evNormalSize" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
66 { evDoubleSize, "evDoubleSize" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
67 { evSetMoviePosition, "evSetMoviePosition" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
68 { evSetVolume, "evSetVolume" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
69 { evSetBalance, "evSetBalance" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
70 { evHelp, "evHelp" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
71 { evLoadSubtitle, "evLoadSubtitle" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
72 { evPlayDVD, "evPlayDVD" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
73 { evPlayVCD, "evPlayVCD" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
74 { evSetURL, "evSetURL" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
75 { evLoadAudioFile, "evLoadAudioFile" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
76 { evDropSubtitle, "evDropSubtitle" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
77 { evSetAspect, "evSetAspect" }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
78 };
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
79
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
80 static const int evBoxs = sizeof(evNames) / sizeof(evName);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
81
32898
eeb36d798219 Limit scope of internally used appClearItem().
ib
parents: 32897
diff changeset
82 static void appClearItem(wItem *item)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
83 {
32921
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
84 item->type = itNone;
32918
efb929029ec9 Cosmetic: Adjust indent.
ib
parents: 32917
diff changeset
85 item->x = 0;
efb929029ec9 Cosmetic: Adjust indent.
ib
parents: 32917
diff changeset
86 item->y = 0;
efb929029ec9 Cosmetic: Adjust indent.
ib
parents: 32917
diff changeset
87 item->width = 0;
efb929029ec9 Cosmetic: Adjust indent.
ib
parents: 32917
diff changeset
88 item->height = 0;
32917
9949f3a123cf Add new function bpFree() to free txSamples (bitmaps).
ib
parents: 32912
diff changeset
89 bpFree(&item->Bitmap);
32921
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
90 bpFree(&item->Mask);
32918
efb929029ec9 Cosmetic: Adjust indent.
ib
parents: 32917
diff changeset
91 item->fontid = 0;
32921
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
92 item->align = fntAlignLeft;
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
93 gfree((void **)&item->label);
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
94 item->pwidth = 0;
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
95 item->pheight = 0;
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
96 item->numphases = 0;
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
97 item->value = 0;
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
98 item->message = evNone;
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
99 item->R = 0;
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
100 item->G = 0;
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
101 item->B = 0;
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
102 gfree((void **)&item->text);
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
103 item->textwidth = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
104 item->starttime = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
105 item->last_x = 0;
32921
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
106 item->pressed = btnDisabled;
448517f556a5 Fix memory leak in appClearItem().
ib
parents: 32918
diff changeset
107 item->tmp = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
108 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
109
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
110 void appInitStruct(listItems *item)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
111 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
112 int i;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
113
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
114 for (i = 0; i < item->NumberOfMainItems; i++)
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
115 appClearItem(&item->mainItems[i]);
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
116 for (i = 0; i < item->NumberOfBarItems; i++)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
117 appClearItem(&item->barItems[i]);
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
118 for (i = 0; i < item->NumberOfMenuItems; i++)
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
119 appClearItem(&item->menuItems[i]);
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
120
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
121 item->NumberOfMainItems = -1;
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
122 memset(item->mainItems, 0, 256 * sizeof(wItem));
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
123
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
124 item->NumberOfMenuItems = -1;
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
125 memset(item->menuItems, 0, 64 * sizeof(wItem));
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
126
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
127 item->NumberOfBarItems = -1;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
128 memset(item->barItems, 0, 256 * sizeof(wItem));
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
129
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
130 appClearItem(&item->main);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
131 item->mainDecoration = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
132
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
133 appClearItem(&item->sub);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
134 item->sub.width = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
135 item->sub.height = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
136 item->sub.x = -1;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
137 item->sub.y = -1;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
138
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
139 appClearItem(&item->menuBase);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
140 appClearItem(&item->menuSelected);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
141
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
142 item->sub.R = item->sub.G = item->sub.B = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
143 item->bar.R = item->bar.G = item->bar.B = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
144 item->main.R = item->main.G = item->main.B = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
145 item->barIsPresent = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
146 item->menuIsPresent = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
147 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
148
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
149 int appFindMessage(unsigned char *str)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
150 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
151 int i;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
152
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
153 for (i = 0; i < evBoxs; i++)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
154 if (!strcmp(evNames[i].name, str))
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
155 return evNames[i].message;
32897
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 return -1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
158 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
159
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
160 void btnModify(int event, float state)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
161 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
162 int i;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
163
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
164 for (i = 0; i < appMPlayer.NumberOfMainItems + 1; i++) {
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
165 if (appMPlayer.mainItems[i].message == event) {
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
166 switch (appMPlayer.mainItems[i].type) {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
167 case itButton:
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
168 appMPlayer.mainItems[i].pressed = (int)state;
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
169 appMPlayer.mainItems[i].tmp = (int)state;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
170 break;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
171
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
172 case itPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
173 case itVPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
174 case itHPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
175 if (state < 0.0)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
176 state = 0.0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
177 if (state > 100.0)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
178 state = 100.0;
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
179 appMPlayer.mainItems[i].value = state;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
180 break;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
181 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
182 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
183 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
184
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
185 for (i = 0; i < appMPlayer.NumberOfBarItems + 1; i++) {
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
186 if (appMPlayer.barItems[i].message == event) {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
187 switch (appMPlayer.barItems[i].type) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
188 case itButton:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
189 appMPlayer.barItems[i].pressed = (int)state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
190 appMPlayer.barItems[i].tmp = (int)state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
191 break;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
192
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
193 case itPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
194 case itVPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
195 case itHPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
196 if (state < 0.0)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
197 state = 0.0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
198 if (state > 100.0)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
199 state = 100.0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
200 appMPlayer.barItems[i].value = state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
201 break;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
202 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
203 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
204 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
205 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
206
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
207 void btnSet(int event, int set)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
208 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
209 int i;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
210
32912
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
211 for (i = 0; i < appMPlayer.NumberOfMainItems + 1; i++) {
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
212 if (appMPlayer.mainItems[i].message == event) {
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
213 appMPlayer.mainItems[i].pressed = set;
ca4d3fa55e43 Adjust the listItems structure.
ib
parents: 32911
diff changeset
214 appMPlayer.barItems[i].tmp = 0;
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
215 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
216 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
217
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
218 for (i = 0; i < appMPlayer.NumberOfBarItems + 1; i++) {
32911
e06fbdd8eb46 Clean up the wItem structure.
ib
parents: 32900
diff changeset
219 if (appMPlayer.barItems[i].message == event) {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
220 appMPlayer.barItems[i].pressed = set;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
221 appMPlayer.barItems[i].tmp = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
222 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
223 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
224 }