annotate gui/app.c @ 32900:1481268ccd30

Move global skin directory variables. The more appropriate place for these variables is interface.c, because this is where they are set after all. Furthermore, their needless explicit initialization has been removed.
author ib
date Mon, 28 Feb 2011 14:47:17 +0000
parents 7104e2b2b648
children e06fbdd8eb46
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
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
24 listItems appMPlayer;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
25
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
26 static const evName evNames[] = {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
27 { evNone, "evNone" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
28 { evPlay, "evPlay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
29 { evStop, "evStop" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
30 { evPause, "evPause" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
31 { evPrev, "evPrev" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
32 { evNext, "evNext" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
33 { evLoad, "evLoad" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
34 { evEqualizer, "evEqualizer" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
35 { evEqualizer, "evEqualeaser" }, // NOTE TO MYSELF: any skin using this?
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
36 { evPlayList, "evPlaylist" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
37 { evExit, "evExit" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
38 { evIconify, "evIconify" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
39 { evIncBalance, "evIncBalance" }, // NOTE TO MYSELF: not all of these events
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
40 { evDecBalance, "evDecBalance" }, // are actually implemented, and update doc
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
41 { evFullScreen, "evFullScreen" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
42 { evFName, "evFName" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
43 { evMovieTime, "evMovieTime" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
44 { evAbout, "evAbout" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
45 { evLoadPlay, "evLoadPlay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
46 { evPreferences, "evPreferences" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
47 { evSkinBrowser, "evSkinBrowser" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
48 { evBackward10sec, "evBackward10sec" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
49 { evForward10sec, "evForward10sec" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
50 { evBackward1min, "evBackward1min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
51 { evForward1min, "evForward1min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
52 { evBackward10min, "evBackward10min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
53 { evForward10min, "evForward10min" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
54 { evIncVolume, "evIncVolume" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
55 { evDecVolume, "evDecVolume" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
56 { evMute, "evMute" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
57 { evIncAudioBufDelay, "evIncAudioBufDelay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
58 { evDecAudioBufDelay, "evDecAudioBufDelay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
59 { evPlaySwitchToPause, "evPlaySwitchToPause" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
60 { evPauseSwitchToPlay, "evPauseSwitchToPlay" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
61 { evNormalSize, "evHalfSize" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
62 { evNormalSize, "evNormalSize" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
63 { evDoubleSize, "evDoubleSize" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
64 { evSetMoviePosition, "evSetMoviePosition" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
65 { evSetVolume, "evSetVolume" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
66 { evSetBalance, "evSetBalance" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
67 { evHelp, "evHelp" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
68 { evLoadSubtitle, "evLoadSubtitle" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
69 { evPlayDVD, "evPlayDVD" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
70 { evPlayVCD, "evPlayVCD" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
71 { evSetURL, "evSetURL" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
72 { evLoadAudioFile, "evLoadAudioFile" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
73 { evDropSubtitle, "evDropSubtitle" },
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
74 { evSetAspect, "evSetAspect" }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
75 };
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
76
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
77 static const int evBoxs = sizeof(evNames) / sizeof(evName);
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
78
32898
eeb36d798219 Limit scope of internally used appClearItem().
ib
parents: 32897
diff changeset
79 static void appClearItem(wItem *item)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
80 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
81 item->type = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
82 item->x = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
83 item->y = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
84 item->width = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
85 item->height = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
86 item->px = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
87 item->py = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
88 item->psx = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
89 item->psy = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
90 item->msg = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
91 item->msg2 = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
92 item->pressed = btnReleased;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
93 item->tmp = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
94 item->key = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
95 item->key2 = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
96 item->Bitmap.Width = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
97 item->Bitmap.Height = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
98 item->Bitmap.BPP = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
99 item->Bitmap.ImageSize = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
100 free(item->Bitmap.Image);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
101 item->Bitmap.Image = NULL;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
102 item->fontid = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
103 free(item->label);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
104 item->label = NULL;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
105 free(item->text);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
106 item->text = NULL;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
107 item->textwidth = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
108 item->starttime = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
109 item->last_x = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
110 item->event = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
111 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
112
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
113 void appInitStruct(listItems *item)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
114 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
115 int i;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
116
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
117 for (i = 0; i < item->NumberOfItems; i++)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
118 appClearItem(&item->Items[i]);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
119 for (i = 0; i < item->NumberOfMenuItems; i++)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
120 appClearItem(&item->MenuItems[i]);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
121 for (i = 0; i < item->NumberOfBarItems; i++)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
122 appClearItem(&item->barItems[i]);
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->NumberOfItems = -1;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
125 memset(item->Items, 0, 256 * sizeof(wItem));
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
126
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
127 item->NumberOfMenuItems = -1;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
128 memset(item->MenuItems, 0, 64 * sizeof(wItem));
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
129
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
130 item->NumberOfBarItems = -1;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
131 memset(item->barItems, 0, 256 * sizeof(wItem));
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
132
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
133 appClearItem(&item->main);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
134 item->mainDecoration = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
135
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
136 appClearItem(&item->sub);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
137 item->sub.width = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
138 item->sub.height = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
139 item->sub.x = -1;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
140 item->sub.y = -1;
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 appClearItem(&item->menuBase);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
143 appClearItem(&item->menuSelected);
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
144
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
145 item->sub.R = item->sub.G = item->sub.B = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
146 item->bar.R = item->bar.G = item->bar.B = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
147 item->main.R = item->main.G = item->main.B = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
148 item->barIsPresent = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
149 item->menuIsPresent = 0;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
150 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
151
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
152 int appFindMessage(unsigned char *str)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
153 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
154 int i;
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 for (i = 0; i < evBoxs; i++)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
157 if (!strcmp(evNames[i].name, str))
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
158 return evNames[i].msg;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
159
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
160 return -1;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
161 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
162
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
163 void btnModify(int event, float state)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
164 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
165 int i;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
166
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
167 for (i = 0; i < appMPlayer.NumberOfItems + 1; i++) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
168 if (appMPlayer.Items[i].msg == event) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
169 switch (appMPlayer.Items[i].type) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
170 case itButton:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
171 appMPlayer.Items[i].pressed = (int)state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
172 appMPlayer.Items[i].tmp = (int)state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
173 break;
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
174
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
175 case itPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
176 case itVPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
177 case itHPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
178 if (state < 0.0)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
179 state = 0.0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
180 if (state > 100.0)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
181 state = 100.0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
182 appMPlayer.Items[i].value = state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
183 break;
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 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
186 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
187
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
188 for (i = 0; i < appMPlayer.NumberOfBarItems + 1; i++) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
189 if (appMPlayer.barItems[i].msg == event) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
190 switch (appMPlayer.barItems[i].type) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
191 case itButton:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
192 appMPlayer.barItems[i].pressed = (int)state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
193 appMPlayer.barItems[i].tmp = (int)state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
194 break;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
195
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
196 case itPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
197 case itVPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
198 case itHPotmeter:
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
199 if (state < 0.0)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
200 state = 0.0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
201 if (state > 100.0)
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
202 state = 100.0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
203 appMPlayer.barItems[i].value = state;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
204 break;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
205 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
206 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
207 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
208 }
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
209
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
210 void btnSet(int event, int set)
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
211 {
32897
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
212 int i;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
213
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
214 for (i = 0; i < appMPlayer.NumberOfItems + 1; i++) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
215 if (appMPlayer.Items[i].msg == event) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
216 appMPlayer.Items[i].pressed = set;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
217 appMPlayer.barItems[i].tmp = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
218 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
219 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
220
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
221 for (i = 0; i < appMPlayer.NumberOfBarItems + 1; i++) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
222 if (appMPlayer.barItems[i].msg == event) {
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
223 appMPlayer.barItems[i].pressed = set;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
224 appMPlayer.barItems[i].tmp = 0;
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
225 }
14af78beac02 Cosmetic: Format to MPlayer coding style.
ib
parents: 32847
diff changeset
226 }
23077
17bf4f4b0715 Gui --> gui
diego
parents:
diff changeset
227 }