annotate gui/ui/render.c @ 37065:b28b632efeef

Cosmetic: Revise a few comments.
author ib
date Thu, 24 Apr 2014 11:31:31 +0000
parents 84c93a60ead3
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
26458
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
1 /*
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
2 * This file is part of MPlayer.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
3 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
4 * MPlayer is free software; you can redistribute it and/or modify
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
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: 26382
diff changeset
6 * the Free Software Foundation; either version 2 of the License, or
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
7 * (at your option) any later version.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
8 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
9 * MPlayer is distributed in the hope that it will be useful,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
12 * GNU General Public License for more details.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
13 *
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
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: 26382
diff changeset
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
b0a7b35b78d2 Add standard GPL header to individual files.
diego
parents: 26382
diff changeset
17 */
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
18
37017
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
19 /**
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
20 * @file
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
21 * @brief GUI rendering
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
22 */
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
23
37053
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
24 #include <math.h>
33123
9566100d88a1 Replace inttypes.h by stdint.h and remove inttypes.h where unneeded.
ib
parents: 32982
diff changeset
25 #include <stdint.h>
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
26 #include <stdio.h>
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
27 #include <stdlib.h>
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
28 #include <string.h>
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
29
33556
520fb0f7544c Rename GUI directory 'mplayer' and some files in it.
ib
parents: 33555
diff changeset
30 #include "render.h"
32952
1aeeba137de9 Remove needless includes.
ib
parents: 32920
diff changeset
31 #include "gui/interface.h"
37007
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
32 #include "gui/app/gui.h"
26365
10dfbc523184 Add gui/ prefix to some #include paths so that compilation from the
diego
parents: 25603
diff changeset
33 #include "gui/skin/font.h"
34175
a345e7162d0a Move TranslateFilename() to util/string.c.
ib
parents: 34077
diff changeset
34 #include "gui/util/string.h"
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
35
36984
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
36 #include "access_mpcontext.h"
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
37 #include "help_mp.h"
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
38 #include "libavutil/avstring.h"
37053
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
39 #include "libavutil/common.h"
32954
682b370ac832 Get prototype for GetTimerMS() from header file.
ib
parents: 32952
diff changeset
40 #include "osdep/timer.h"
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
41 #include "stream/stream.h"
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
42
37016
45663ee3a990 Change comment into doxygen comment.
ib
parents: 37015
diff changeset
43 /**
45663ee3a990 Change comment into doxygen comment.
ib
parents: 37015
diff changeset
44 * @brief Time in milliseconds a scrolling dlabel stops
45663ee3a990 Change comment into doxygen comment.
ib
parents: 37015
diff changeset
45 * when reaching the left margin until scrolling starts over
45663ee3a990 Change comment into doxygen comment.
ib
parents: 37015
diff changeset
46 */
45663ee3a990 Change comment into doxygen comment.
ib
parents: 37015
diff changeset
47 #define DLABEL_DELAY 2500
33269
49ca38147d1f Remove private symbolic constants from header files.
ib
parents: 33129
diff changeset
48
36980
7ed97bf8eef9 Add doxygen comment.
ib
parents: 36979
diff changeset
49 /**
36984
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
50 * @brief Convert #guiInfo member Filename.
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
51 *
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
52 * @param how 0 (cut file path and extension),
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
53 * 1 (additionally, convert lower case) or
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
54 * 2 (additionally, convert upper case)
37065
b28b632efeef Cosmetic: Revise a few comments.
ib
parents: 37053
diff changeset
55 * @param fname memory location of a buffer to receive the converted Filename
b28b632efeef Cosmetic: Revise a few comments.
ib
parents: 37053
diff changeset
56 * @param maxlen size of the @a fname buffer
36984
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
57 *
37065
b28b632efeef Cosmetic: Revise a few comments.
ib
parents: 37053
diff changeset
58 * @return pointer to the @a fname buffer
36984
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
59 */
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
60 static char *TranslateFilename(int how, char *fname, size_t maxlen)
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
61 {
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
62 char *p;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
63 size_t len;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
64 stream_t *stream;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
65
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
66 switch (guiInfo.StreamType) {
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
67 case STREAMTYPE_FILE:
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
68
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
69 if (guiInfo.Filename && *guiInfo.Filename) {
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
70 p = strrchr(guiInfo.Filename, '/');
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
71
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
72 if (p)
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
73 av_strlcpy(fname, p + 1, maxlen);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
74 else
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
75 av_strlcpy(fname, guiInfo.Filename, maxlen);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
76
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
77 len = strlen(fname);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
78
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
79 if (len > 3 && fname[len - 3] == '.')
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
80 fname[len - 3] = 0;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
81 else if (len > 4 && fname[len - 4] == '.')
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
82 fname[len - 4] = 0;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
83 else if (len > 5 && fname[len - 5] == '.')
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
84 fname[len - 5] = 0;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
85 } else
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
86 av_strlcpy(fname, MSGTR_GUI_MSG_NoFileLoaded, maxlen);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
87
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
88 break;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
89
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
90 case STREAMTYPE_STREAM:
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
91
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
92 av_strlcpy(fname, guiInfo.Filename, maxlen);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
93 break;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
94
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
95 case STREAMTYPE_CDDA:
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
96
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
97 snprintf(fname, maxlen, MSGTR_GUI_TitleN, guiInfo.Track);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
98 break;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
99
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
100 case STREAMTYPE_VCD:
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
101
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
102 snprintf(fname, maxlen, MSGTR_GUI_TitleN, guiInfo.Track - 1);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
103 break;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
104
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
105 case STREAMTYPE_DVD:
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
106
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
107 if (guiInfo.Chapter)
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
108 snprintf(fname, maxlen, MSGTR_GUI_ChapterN, guiInfo.Chapter);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
109 else
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
110 av_strlcpy(fname, MSGTR_GUI_NoChapter, maxlen);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
111
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
112 break;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
113
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
114 case STREAMTYPE_TV:
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
115 case STREAMTYPE_DVB:
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
116
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
117 p = MSGTR_GUI_NoChannelName;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
118 stream = mpctx_get_stream(guiInfo.mpcontext);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
119
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
120 if (stream)
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
121 stream_control(stream, STREAM_CTRL_GET_CURRENT_CHANNEL, &p);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
122
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
123 av_strlcpy(fname, p, maxlen);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
124 break;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
125
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
126 default:
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
127
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
128 av_strlcpy(fname, MSGTR_GUI_MSG_NoMediaOpened, maxlen);
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
129 break;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
130 }
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
131
36988
c9ccf9b4a43b Use strlower() and strupper() in TranslateFilename().
ib
parents: 36984
diff changeset
132 if (how == 1)
c9ccf9b4a43b Use strlower() and strupper() in TranslateFilename().
ib
parents: 36984
diff changeset
133 strlower(fname);
c9ccf9b4a43b Use strlower() and strupper() in TranslateFilename().
ib
parents: 36984
diff changeset
134 if (how == 2)
c9ccf9b4a43b Use strlower() and strupper() in TranslateFilename().
ib
parents: 36984
diff changeset
135 strupper(fname);
36984
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
136
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
137 return fname;
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
138 }
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
139
3f3a415d605b Move most of TranslateFilename() back to the renderer files.
ib
parents: 36980
diff changeset
140 /**
36980
7ed97bf8eef9 Add doxygen comment.
ib
parents: 36979
diff changeset
141 * @brief Translate all variables in the @a text.
7ed97bf8eef9 Add doxygen comment.
ib
parents: 36979
diff changeset
142 *
7ed97bf8eef9 Add doxygen comment.
ib
parents: 36979
diff changeset
143 * @param text text containing variables
7ed97bf8eef9 Add doxygen comment.
ib
parents: 36979
diff changeset
144 *
7ed97bf8eef9 Add doxygen comment.
ib
parents: 36979
diff changeset
145 * @return new text with all variables translated
7ed97bf8eef9 Add doxygen comment.
ib
parents: 36979
diff changeset
146 */
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
147 static char *TranslateVariables(const char *text)
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
148 {
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
149 static char translation[512];
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
150 char trans[512];
32972
fbaae7fe1a13 Fix several issues with Translate().
ib
parents: 32970
diff changeset
151 unsigned int i, c;
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
152 int t;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
153
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
154 *translation = 0;
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
155
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
156 for (c = 0, i = 0; i < strlen(text); i++) {
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
157 if (text[i] != '$') {
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
158 if (c + 1 < sizeof(translation)) {
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
159 translation[c++] = text[i];
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
160 translation[c] = 0;
32972
fbaae7fe1a13 Fix several issues with Translate().
ib
parents: 32970
diff changeset
161 }
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
162 } else {
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
163 switch (text[++i]) {
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
164 case '1':
33897
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33876
diff changeset
165 t = guiInfo.ElapsedTime;
36979
14fa9031f766 Cosmetic: Rename goto labels.
ib
parents: 36978
diff changeset
166 HH_MM_SS: snprintf(trans, sizeof(trans), "%02d:%02d:%02d", t / 3600, t / 60 % 60, t % 60);
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
167 av_strlcat(translation, trans, sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
168 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
169
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
170 case '2':
33897
e0d211c62cf7 Cosmetic: Rename some guiInfo members.
ib
parents: 33876
diff changeset
171 t = guiInfo.ElapsedTime;
36979
14fa9031f766 Cosmetic: Rename goto labels.
ib
parents: 36978
diff changeset
172 MMMM_SS: snprintf(trans, sizeof(trans), "%04d:%02d", t / 60, t % 60);
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
173 av_strlcat(translation, trans, sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
174 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
175
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
176 case '3':
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
177 snprintf(trans, sizeof(trans), "%02d", guiInfo.ElapsedTime / 3600);
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
178 av_strlcat(translation, trans, sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
179 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
180
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
181 case '4':
36978
3f306145b3da Remove unnecessary, bothering parentheses.
ib
parents: 36977
diff changeset
182 snprintf(trans, sizeof(trans), "%02d", guiInfo.ElapsedTime / 60 % 60);
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
183 av_strlcat(translation, trans, sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
184 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
185
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
186 case '5':
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
187 snprintf(trans, sizeof(trans), "%02d", guiInfo.ElapsedTime % 60);
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
188 av_strlcat(translation, trans, sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
189 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
190
36977
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
191 case '6':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
192 t = guiInfo.RunningTime;
36979
14fa9031f766 Cosmetic: Rename goto labels.
ib
parents: 36978
diff changeset
193 goto HH_MM_SS;
36977
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
194
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
195 case '7':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
196 t = guiInfo.RunningTime;
36979
14fa9031f766 Cosmetic: Rename goto labels.
ib
parents: 36978
diff changeset
197 goto MMMM_SS;
36977
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
198
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
199 case '8':
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
200 snprintf(trans, sizeof(trans), "%01d:%02d:%02d", guiInfo.ElapsedTime / 3600, (guiInfo.ElapsedTime / 60) % 60, guiInfo.ElapsedTime % 60);
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
201 av_strlcat(translation, trans, sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
202 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
203
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
204 case 'a':
33646
f3300b0c38a9 Rename guiInterface_t member AudioType AudioChannels.
ib
parents: 33616
diff changeset
205 switch (guiInfo.AudioChannels) {
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
206 case 0:
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
207 av_strlcat(translation, "n", sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
208 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
209
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
210 case 1:
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
211 av_strlcat(translation, "m", sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
212 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
213
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
214 case 2:
36978
3f306145b3da Remove unnecessary, bothering parentheses.
ib
parents: 36977
diff changeset
215 av_strlcat(translation, guiInfo.AudioPassthrough ? "r" : "t", sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
216 break;
36910
11932adad7a2 Add symbol character 'r' for dynamic label variable $a.
ib
parents: 36909
diff changeset
217
11932adad7a2 Add symbol character 'r' for dynamic label variable $a.
ib
parents: 36909
diff changeset
218 default:
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
219 av_strlcat(translation, "r", sizeof(translation));
36910
11932adad7a2 Add symbol character 'r' for dynamic label variable $a.
ib
parents: 36909
diff changeset
220 break;
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
221 }
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
222 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
223
36977
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
224 case 'b':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
225 snprintf(trans, sizeof(trans), "%3.2f%%", guiInfo.Balance);
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
226 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
227 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
228
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
229 case 'B':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
230 snprintf(trans, sizeof(trans), "%3.1f", guiInfo.Balance);
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
231 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
232 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
233
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
234 case 'C':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
235 snprintf(trans, sizeof(trans), "%s", guiInfo.CodecName ? guiInfo.CodecName : "");
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
236 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
237 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
238
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
239 case 'D':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
240 snprintf(trans, sizeof(trans), "%3.0f", guiInfo.Balance);
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
241 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
242 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
243
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
244 case 'e':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
245 if (guiInfo.Playing == GUI_PAUSE)
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
246 av_strlcat(translation, "e", sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
247 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
248
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
249 case 'f':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
250 TranslateFilename(1, trans, sizeof(trans));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
251 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
252 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
253
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
254 case 'F':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
255 TranslateFilename(2, trans, sizeof(trans));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
256 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
257 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
258
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
259 case 'o':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
260 TranslateFilename(0, trans, sizeof(trans));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
261 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
262 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
263
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
264 case 'l': // legacy
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
265 case 'p':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
266 if (guiInfo.Playing == GUI_PLAY)
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
267 av_strlcat(translation, "p", sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
268 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
269
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
270 case 'P':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
271 switch (guiInfo.Playing) {
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
272 case GUI_STOP:
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
273 av_strlcat(translation, "s", sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
274 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
275
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
276 case GUI_PLAY:
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
277 av_strlcat(translation, "p", sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
278 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
279
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
280 case GUI_PAUSE:
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
281 av_strlcat(translation, "e", sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
282 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
283 }
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
284 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
285
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
286 case 's':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
287 if (guiInfo.Playing == GUI_STOP)
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
288 av_strlcat(translation, "s", sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
289 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
290
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
291 case 't':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
292 snprintf(trans, sizeof(trans), "%02d", guiInfo.Track);
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
293 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
294 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
295
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
296 case 'T':
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
297 switch (guiInfo.StreamType) {
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
298 case STREAMTYPE_FILE:
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
299 av_strlcat(translation, "f", sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
300 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
301
34077
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 33971
diff changeset
302 case STREAMTYPE_STREAM:
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
303 av_strlcat(translation, "u", sizeof(translation));
34077
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 33971
diff changeset
304 break;
deff81b57903 Cosmetic: Order STREAMTYPE related code.
ib
parents: 33971
diff changeset
305
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34175
diff changeset
306 case STREAMTYPE_CDDA:
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
307 av_strlcat(translation, "a", sizeof(translation));
34387
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34175
diff changeset
308 break;
0ba85cad4c7e Add audio CD playback support to the X11/GTK GUI.
ib
parents: 34175
diff changeset
309
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
310 case STREAMTYPE_VCD:
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
311 av_strlcat(translation, "v", sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
312 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
313
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
314 case STREAMTYPE_DVD:
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
315 av_strlcat(translation, "d", sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
316 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
317
36429
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
318 case STREAMTYPE_TV:
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
319 case STREAMTYPE_DVB:
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
320 av_strlcat(translation, "b", sizeof(translation));
36429
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
321 break;
28ea255e40ce Add support for TV/DVB to the GUI.
ib
parents: 36032
diff changeset
322
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
323 default:
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
324 av_strlcat(translation, " ", sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
325 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
326 }
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
327 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
328
36977
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
329 case 'U':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
330 snprintf(trans, sizeof(trans), "%3.0f", guiInfo.Volume);
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
331 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
332 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
333
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
334 case 'v':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
335 snprintf(trans, sizeof(trans), "%3.2f%%", guiInfo.Volume);
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
336 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
337 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
338
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
339 case 'V':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
340 snprintf(trans, sizeof(trans), "%3.1f", guiInfo.Volume);
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
341 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
342 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
343
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
344 case 'x':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
345 snprintf(trans, sizeof(trans), "%d", guiInfo.VideoWidth);
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
346 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
347 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
348
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
349 case 'y':
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
350 snprintf(trans, sizeof(trans), "%d", guiInfo.VideoHeight);
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
351 av_strlcat(translation, trans, sizeof(translation));
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
352 break;
dc70bee70223 Arrange variables to be translated alphabetically.
ib
parents: 36974
diff changeset
353
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
354 case '$':
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
355 av_strlcat(translation, "$", sizeof(translation));
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
356 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
357
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
358 default:
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
359 continue;
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
360 }
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
361
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
362 c = strlen(translation);
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
363 }
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
364 }
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
365
36974
6c3562d643a8 Cosmetic: Revise Translate().
ib
parents: 36970
diff changeset
366 return translation;
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
367 }
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
368
37017
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
369 /**
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
370 * @brief Put a part of a #guiImage image into a (window's) draw buffer.
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
371 *
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
372 * @param x x position where to start in the draw buffer
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
373 * @param y y position where to start in the draw buffer
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
374 * @param drawbuf draw buffer where the image should be put in
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
375 * @param drawbuf_width width of the draw buffer
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
376 * @param img image (containing several phases, i.e. image parts)
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
377 * @param parts number of parts in the image
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
378 * @param index index of the part of the image to be drawn
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
379 * @param below flag indicating whether the image parts are arranged
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
380 * below each other or side by side
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
381 */
37007
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
382 static void PutImage(int x, int y, uint32_t *drawbuf, int drawbuf_width, guiImage *img, int parts, int index, int below)
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
383 {
37009
393bd4f71bd6 Remove variable.
ib
parents: 37008
diff changeset
384 register int i, ic, yc;
37007
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
385 register uint32_t pixel;
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
386 int xlimit, ylimit, ix, iy;
37005
4330b0a2af69 Change the parameter list of PutImage().
ib
parents: 37003
diff changeset
387 uint32_t *pixels;
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
388
37010
af84671a576f Simplify condition.
ib
parents: 37009
diff changeset
389 if (!img || !img->Image)
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
390 return;
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
391
37007
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
392 if (below) {
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
393 i = img->Width * (img->Height / parts) * index;
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
394 xlimit = x + img->Width;
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
395 ylimit = y + img->Height / parts;
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
396 } else {
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
397 i = (img->Width / parts) * index;
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
398 xlimit = x + img->Width / parts;
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
399 ylimit = y + img->Height;
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
400 }
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
401
37006
5526b86aaa7c Cosmetic: Adjust indent.
ib
parents: 37005
diff changeset
402 pixels = (uint32_t *)img->Image;
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
403
36993
764a6a754b89 Cosmetic: Rename variables in PutImage().
ib
parents: 36992
diff changeset
404 yc = y * drawbuf_width;
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
405
37007
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
406 for (iy = y; iy < ylimit; iy++) {
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
407 ic = i;
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
408
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
409 for (ix = x; ix < xlimit; ix++) {
36993
764a6a754b89 Cosmetic: Rename variables in PutImage().
ib
parents: 36992
diff changeset
410 pixel = pixels[i++];
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
411
36993
764a6a754b89 Cosmetic: Rename variables in PutImage().
ib
parents: 36992
diff changeset
412 if (!IS_TRANSPARENT(pixel))
764a6a754b89 Cosmetic: Rename variables in PutImage().
ib
parents: 36992
diff changeset
413 drawbuf[yc + ix] = pixel;
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
414 }
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
415
37007
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
416 if (!below)
37009
393bd4f71bd6 Remove variable.
ib
parents: 37008
diff changeset
417 i = ic + img->Width;
37007
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
418
36993
764a6a754b89 Cosmetic: Rename variables in PutImage().
ib
parents: 36992
diff changeset
419 yc += drawbuf_width;
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
420 }
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
421 }
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
422
37017
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
423 /**
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
424 * @brief Render all GUI items in a window, i.e. copy the respective images
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
425 * into the draw buffer.
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
426 *
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
427 * @param window pointer to a ws window structure of the window to be rendered
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
428 * @param items pointer to the array of items
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
429 * @param till maximum index in use for the @a items, i.e. number of last item in array
37065
b28b632efeef Cosmetic: Revise a few comments.
ib
parents: 37053
diff changeset
430 * @param drawbuf memory location of the @a window's draw buffer
37017
3b5fdb62a907 Add doxygen comments.
ib
parents: 37016
diff changeset
431 */
37011
322951bebfd6 Rename parameter.
ib
parents: 37010
diff changeset
432 void RenderAll(wsWindow *window, guiItem *items, int till, char *drawbuf)
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
433 {
37005
4330b0a2af69 Change the parameter list of PutImage().
ib
parents: 37003
diff changeset
434 uint32_t *db;
35688
6fd886ce32b9 Cosmetic: Rename wItem guiItem.
ib
parents: 35681
diff changeset
435 guiItem *item;
33555
c5a19bbeac2b Cosmetic: Rename some GUI variables and functions.
ib
parents: 33548
diff changeset
436 guiImage *image = NULL;
37012
79c50282f8ab Remove braces.
ib
parents: 37011
diff changeset
437 int dw, i, index, x;
37015
68066d733c76 Cosmetic: Rename variable.
ib
parents: 37014
diff changeset
438 char *trans;
37012
79c50282f8ab Remove braces.
ib
parents: 37011
diff changeset
439 unsigned int d;
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
440
37005
4330b0a2af69 Change the parameter list of PutImage().
ib
parents: 37003
diff changeset
441 db = (uint32_t *)drawbuf;
4330b0a2af69 Change the parameter list of PutImage().
ib
parents: 37003
diff changeset
442 dw = window->Width;
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
443
37011
322951bebfd6 Rename parameter.
ib
parents: 37010
diff changeset
444 for (i = 0; i <= till; i++) {
36994
167442bc79d0 Cosmetic: Rename same variables in RenderAll().
ib
parents: 36993
diff changeset
445 item = &items[i];
32966
1f51f39916e1 Replace ternary operator by more intelligible switch statement.
ib
parents: 32965
diff changeset
446
1f51f39916e1 Replace ternary operator by more intelligible switch statement.
ib
parents: 32965
diff changeset
447 switch (item->pressed) {
1f51f39916e1 Replace ternary operator by more intelligible switch statement.
ib
parents: 32965
diff changeset
448 case btnPressed:
36994
167442bc79d0 Cosmetic: Rename same variables in RenderAll().
ib
parents: 36993
diff changeset
449 index = 0;
32966
1f51f39916e1 Replace ternary operator by more intelligible switch statement.
ib
parents: 32965
diff changeset
450 break;
1f51f39916e1 Replace ternary operator by more intelligible switch statement.
ib
parents: 32965
diff changeset
451
1f51f39916e1 Replace ternary operator by more intelligible switch statement.
ib
parents: 32965
diff changeset
452 case btnReleased:
36994
167442bc79d0 Cosmetic: Rename same variables in RenderAll().
ib
parents: 36993
diff changeset
453 index = 1;
32966
1f51f39916e1 Replace ternary operator by more intelligible switch statement.
ib
parents: 32965
diff changeset
454 break;
1f51f39916e1 Replace ternary operator by more intelligible switch statement.
ib
parents: 32965
diff changeset
455
1f51f39916e1 Replace ternary operator by more intelligible switch statement.
ib
parents: 32965
diff changeset
456 default:
36994
167442bc79d0 Cosmetic: Rename same variables in RenderAll().
ib
parents: 36993
diff changeset
457 index = 2;
32966
1f51f39916e1 Replace ternary operator by more intelligible switch statement.
ib
parents: 32965
diff changeset
458 break;
1f51f39916e1 Replace ternary operator by more intelligible switch statement.
ib
parents: 32965
diff changeset
459 }
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
460
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
461 switch (item->type) {
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
462 case itButton:
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35538
diff changeset
463
37007
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
464 PutImage(item->x, item->y, db, dw, &item->Bitmap, 3, index, True);
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
465 break;
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
466
36920
40ad45360c8a Replace old item 'potmeter' by new item 'pimage'.
ib
parents: 36918
diff changeset
467 case itPimage:
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35538
diff changeset
468
37008
7b4cb946634a Remove unnecessary parentheses.
ib
parents: 37007
diff changeset
469 PutImage(item->x, item->y, db, dw, &item->Bitmap, item->numphases, (item->numphases - 1) * item->value / 100.0, True);
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
470 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
471
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
472 case itHPotmeter:
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35538
diff changeset
473
37008
7b4cb946634a Remove unnecessary parentheses.
ib
parents: 37007
diff changeset
474 PutImage(item->x, item->y, db, dw, &item->Bitmap, item->numphases, (item->numphases - 1) * item->value / 100.0, True);
37020
c840891d1be9 Rename guiItem's members pwidth and pheight.
ib
parents: 37017
diff changeset
475 PutImage(item->x + (item->width - item->pbwidth) * item->value / 100.0, item->y, db, dw, &item->Mask, 3, index, True);
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
476 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
477
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
478 case itVPotmeter:
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35538
diff changeset
479
37008
7b4cb946634a Remove unnecessary parentheses.
ib
parents: 37007
diff changeset
480 PutImage(item->x, item->y, db, dw, &item->Bitmap, item->numphases, (item->numphases - 1) * item->value / 100.0, False);
37020
c840891d1be9 Rename guiItem's members pwidth and pheight.
ib
parents: 37017
diff changeset
481 PutImage(item->x, item->y + (item->height - item->pbheight) * (1.0 - item->value / 100.0), db, dw, &item->Mask, 3, index, True);
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
482 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
483
37053
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
484 case itRPotmeter:
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
485
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
486 PutImage(item->x, item->y, db, dw, &item->Bitmap, item->numphases, (item->numphases - 1) * item->value / 100.0, True);
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
487
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
488 if (item->Mask.Image) {
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
489 double radius, radian;
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
490 int y;
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
491
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
492 // keep the button inside the potmeter outline
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
493 radius = (FFMIN(item->width, item->height) - FFMAX(item->pbwidth, item->pbheight)) / 2.0;
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
494
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
495 radian = item->value / 100.0 * item->arclength + item->zeropoint;
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
496
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
497 // coordinates plus a correction for a non-square item
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
498 // (remember: both axes are mirrored, we have a clockwise radian)
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
499 x = radius * (1 + cos(radian)) + FFMAX(0, (item->width - item->height) / 2.0) + 0.5;
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
500 y = radius * (1 + sin(radian)) + FFMAX(0, (item->height - item->width) / 2.0) + 0.5;
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
501
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
502 PutImage(item->x + x, item->y + y, db, dw, &item->Mask, 3, index, True);
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
503 }
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
504
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
505 break;
84c93a60ead3 Add new item 'rpotmeter'.
ib
parents: 37020
diff changeset
506
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
507 case itSLabel:
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35538
diff changeset
508
32969
ad1a232df994 Make slabel work.
ib
parents: 32968
diff changeset
509 if (item->width == -1)
ad1a232df994 Make slabel work.
ib
parents: 32968
diff changeset
510 item->width = fntTextWidth(item->fontid, item->label);
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35538
diff changeset
511
33971
922771be85f6 Cosmetic: Rename fntRender() fntTextRender().
ib
parents: 33901
diff changeset
512 image = fntTextRender(item, 0, item->label);
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35538
diff changeset
513
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
514 if (image)
37007
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
515 PutImage(item->x, item->y, db, dw, image, 1, 0, True);
35541
ded4a8c2aa70 Cosmetic: Add some blank lines.
ib
parents: 35538
diff changeset
516
32969
ad1a232df994 Make slabel work.
ib
parents: 32968
diff changeset
517 break;
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
518
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
519 case itDLabel:
37013
11d2d0444f42 Cosmetic: Add blank line and adjust indent.
ib
parents: 37012
diff changeset
520
37015
68066d733c76 Cosmetic: Rename variable.
ib
parents: 37014
diff changeset
521 trans = TranslateVariables(item->label);
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
522
37015
68066d733c76 Cosmetic: Rename variable.
ib
parents: 37014
diff changeset
523 if (!item->text || (strcmp(item->text, trans) != 0)) {
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
524 free(item->text);
37015
68066d733c76 Cosmetic: Rename variable.
ib
parents: 37014
diff changeset
525 item->text = strdup(trans);
68066d733c76 Cosmetic: Rename variable.
ib
parents: 37014
diff changeset
526 item->textwidth = fntTextWidth(item->fontid, trans);
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
527 item->starttime = GetTimerMS();
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
528 item->last_x = 0;
32761
3ceeb62a1125 Improve the readability of dynamic labels which scroll.
ib
parents: 32759
diff changeset
529 }
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
530
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
531 d = GetTimerMS() - item->starttime;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
532
32964
cddc94d28830 Cosmetic: Rename macro controlling the dlabel delay.
ib
parents: 32963
diff changeset
533 if (d < DLABEL_DELAY)
37013
11d2d0444f42 Cosmetic: Add blank line and adjust indent.
ib
parents: 37012
diff changeset
534 x = item->last_x; // don't scroll yet
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
535 else {
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
536 int l;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
537 char c[2];
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
538
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
539 l = (item->textwidth ? item->textwidth : item->width);
35362
848ca0b6d5ca Prevent floating point exception.
ib
parents: 34454
diff changeset
540 x = (l ? l - ((d - DLABEL_DELAY) / 20) % l - 1 : 0);
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
541 c[0] = *item->text;
37014
01b3cd8a1e76 Simplify string termination.
ib
parents: 37013
diff changeset
542 c[1] = 0;
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
543
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
544 if (x < (fntTextWidth(item->fontid, c) + 1) >> 1) {
37013
11d2d0444f42 Cosmetic: Add blank line and adjust indent.
ib
parents: 37012
diff changeset
545 item->starttime = GetTimerMS(); // stop again
11d2d0444f42 Cosmetic: Add blank line and adjust indent.
ib
parents: 37012
diff changeset
546 item->last_x = x; // at current x pos
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
547 }
32761
3ceeb62a1125 Improve the readability of dynamic labels which scroll.
ib
parents: 32759
diff changeset
548 }
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
549
37015
68066d733c76 Cosmetic: Rename variable.
ib
parents: 37014
diff changeset
550 image = fntTextRender(item, x, trans);
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
551
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
552 if (image)
37007
55f911b7217a Fix PutImage() for item type itVPotmeter.
ib
parents: 37006
diff changeset
553 PutImage(item->x, item->y, db, dw, image, 1, 0, True);
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
554
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
555 break;
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
556 }
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
557 }
32963
ce00479b68ce Cosmetic: Format to MPlayer coding style.
ib
parents: 32962
diff changeset
558
36994
167442bc79d0 Cosmetic: Rename same variables in RenderAll().
ib
parents: 36993
diff changeset
559 wsImageRender(window, drawbuf);
25603
01754b23193e Rename common.[ch], there are too many files by that name.
diego
parents:
diff changeset
560 }