annotate gui/app.c @ 32925:992a4b9d7624

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