Mercurial > mplayer.hg
annotate gui/mplayer/gui_common.c @ 26875:c276296cb6f8
Simplify/make new_sh behaviour more consistent when a stream gets redefined.
author | reimar |
---|---|
date | Tue, 27 May 2008 17:33:13 +0000 |
parents | b0a7b35b78d2 |
children | e1c5299a4114 |
rev | line source |
---|---|
26458 | 1 /* |
2 * main window | |
3 * | |
4 * This file is part of MPlayer. | |
5 * | |
6 * MPlayer is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * MPlayer is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License along | |
17 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
19 */ | |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
20 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
21 #include <stdlib.h> |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
22 #include <stdio.h> |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
23 #include <inttypes.h> |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
24 #include <sys/stat.h> |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
25 #include <unistd.h> |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
26 #include <string.h> |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
27 |
26365
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
25603
diff
changeset
|
28 #include "gui/app.h" |
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
25603
diff
changeset
|
29 #include "gui/skin/font.h" |
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
25603
diff
changeset
|
30 #include "gui/skin/skin.h" |
10dfbc523184
Add gui/ prefix to some #include paths so that compilation from the
diego
parents:
25603
diff
changeset
|
31 #include "gui/wm/ws.h" |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
32 |
26382
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
33 #include "config.h" |
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
34 #include "help_mp.h" |
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
35 #include "libvo/x11_common.h" |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
36 |
26382
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
37 #include "stream/stream.h" |
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
38 #include "mixer.h" |
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
39 #include "libvo/sub.h" |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
40 |
26382
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
41 #include "libmpdemux/demuxer.h" |
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
42 #include "libmpdemux/stheader.h" |
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
43 #include "codec-cfg.h" |
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
44 #include "access_mpcontext.h" |
b2f4abcf20ed
Make include paths consistent; do not use ../ in them.
diego
parents:
26365
diff
changeset
|
45 #include "libavutil/avstring.h" |
25603
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
46 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
47 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
48 #include "play.h" |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
49 #include "widgets.h" |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
50 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
51 extern unsigned int GetTimerMS( void ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
52 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
53 inline void TranslateFilename( int c,char * tmp,size_t tmplen ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
54 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
55 int i; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
56 char * p; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
57 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
58 switch ( guiIntfStruct.StreamType ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
59 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
60 case STREAMTYPE_STREAM: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
61 av_strlcpy(tmp, guiIntfStruct.Filename, tmplen); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
62 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
63 case STREAMTYPE_FILE: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
64 if ( ( guiIntfStruct.Filename )&&( guiIntfStruct.Filename[0] ) ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
65 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
66 if ( (p = strrchr(guiIntfStruct.Filename, '/')) ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
67 av_strlcpy(tmp, p + 1, tmplen); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
68 else |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
69 av_strlcpy(tmp, guiIntfStruct.Filename, tmplen); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
70 if ( tmp[strlen( tmp ) - 4] == '.' ) tmp[strlen( tmp ) - 4]=0; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
71 if ( tmp[strlen( tmp ) - 5] == '.' ) tmp[strlen( tmp ) - 5]=0; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
72 } else av_strlcpy( tmp,MSGTR_NoFileLoaded,tmplen ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
73 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
74 #ifdef USE_DVDREAD |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
75 case STREAMTYPE_DVD: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
76 if ( guiIntfStruct.DVD.current_chapter ) snprintf(tmp,tmplen,MSGTR_Chapter,guiIntfStruct.DVD.current_chapter ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
77 else av_strlcat( tmp,MSGTR_NoChapter,tmplen ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
78 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
79 #endif |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
80 #ifdef HAVE_VCD |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
81 case STREAMTYPE_VCD: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
82 snprintf( tmp,tmplen,MSGTR_VCDTrack,guiIntfStruct.Track ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
83 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
84 #endif |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
85 default: av_strlcpy( tmp,MSGTR_NoMediaOpened,tmplen ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
86 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
87 if ( c ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
88 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
89 for ( i=0;i < (int)strlen( tmp );i++ ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
90 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
91 int t=0; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
92 if ( c == 1 ) { if ( ( tmp[i] >= 'A' )&&( tmp[i] <= 'Z' ) ) t=32; } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
93 if ( c == 2 ) { if ( ( tmp[i] >= 'a' )&&( tmp[i] <= 'z' ) ) t=-32; } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
94 tmp[i]=(char)( tmp[i] + t ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
95 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
96 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
97 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
98 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
99 /* Unsafe! Pass only null-terminated strings as (char *)str. */ |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
100 char * Translate( char * str ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
101 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
102 mixer_t *mixer = mpctx_get_mixer(guiIntfStruct.mpcontext); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
103 static char trbuf[512]; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
104 char tmp[512]; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
105 int i,c; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
106 int t; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
107 int strsize = 0; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
108 memset( trbuf,0,512 ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
109 memset( tmp,0,128 ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
110 strsize = strlen(str); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
111 for ( c=0,i=0;i < strsize;i++ ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
112 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
113 if ( str[i] != '$' ) { trbuf[c++]=str[i]; trbuf[c]=0; } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
114 else |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
115 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
116 switch ( str[++i] ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
117 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
118 case 't': snprintf( tmp,sizeof( tmp ),"%02d",guiIntfStruct.Track ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
119 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
120 case 'o': TranslateFilename( 0,tmp,sizeof( tmp ) ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
121 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
122 case 'f': TranslateFilename( 1,tmp,sizeof( tmp ) ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
123 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
124 case 'F': TranslateFilename( 2,tmp,sizeof( tmp ) ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
125 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
126 case '6': t=guiIntfStruct.LengthInSec; goto calclengthhhmmss; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
127 case '1': t=guiIntfStruct.TimeSec; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
128 calclengthhhmmss: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
129 snprintf( tmp,sizeof( tmp ),"%02d:%02d:%02d",t/3600,t/60%60,t%60 ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
130 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
131 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
132 case '7': t=guiIntfStruct.LengthInSec; goto calclengthmmmmss; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
133 case '2': t=guiIntfStruct.TimeSec; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
134 calclengthmmmmss: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
135 snprintf( tmp,sizeof( tmp ),"%04d:%02d",t/60,t%60 ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
136 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
137 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
138 case '3': snprintf( tmp,sizeof( tmp ),"%02d",guiIntfStruct.TimeSec / 3600 ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
139 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
140 case '4': snprintf( tmp,sizeof( tmp ),"%02d",( ( guiIntfStruct.TimeSec / 60 ) % 60 ) ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
141 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
142 case '5': snprintf( tmp,sizeof( tmp ),"%02d",guiIntfStruct.TimeSec % 60 ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
143 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
144 case '8': snprintf( tmp,sizeof( tmp ),"%01d:%02d:%02d",guiIntfStruct.TimeSec / 3600,( guiIntfStruct.TimeSec / 60 ) % 60,guiIntfStruct.TimeSec % 60 ); av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
145 case 'v': snprintf( tmp,sizeof( tmp ),"%3.2f%%",guiIntfStruct.Volume ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
146 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
147 case 'V': snprintf( tmp,sizeof( tmp ),"%3.1f",guiIntfStruct.Volume ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
148 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
149 case 'b': snprintf( tmp,sizeof( tmp ),"%3.2f%%",guiIntfStruct.Balance ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
150 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
151 case 'B': snprintf( tmp,sizeof( tmp ),"%3.1f",guiIntfStruct.Balance ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
152 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
153 case 'd': snprintf( tmp,sizeof( tmp ),"%d",guiIntfStruct.FrameDrop ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
154 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
155 case 'x': snprintf( tmp,sizeof( tmp ),"%d",guiIntfStruct.MovieWidth ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
156 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
157 case 'y': snprintf( tmp,sizeof( tmp ),"%d",guiIntfStruct.MovieHeight ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
158 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
159 case 'C': snprintf( tmp,sizeof( tmp ),"%s", guiIntfStruct.sh_video? ((sh_video_t *)guiIntfStruct.sh_video)->codec->name : ""); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
160 av_strlcat( trbuf,tmp,sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
161 case 's': if ( guiIntfStruct.Playing == 0 ) av_strlcat( trbuf,"s",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
162 case 'l': if ( guiIntfStruct.Playing == 1 ) av_strlcat( trbuf,"p",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
163 case 'e': if ( guiIntfStruct.Playing == 2 ) av_strlcat( trbuf,"e",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
164 case 'a': |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
165 if ( mixer->muted ) { av_strlcat( trbuf,"n",sizeof( trbuf ) ); break; } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
166 switch ( guiIntfStruct.AudioType ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
167 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
168 case 0: av_strlcat( trbuf,"n",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
169 case 1: av_strlcat( trbuf,"m",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
170 case 2: av_strlcat( trbuf,"t",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
171 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
172 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
173 case 'T': |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
174 switch ( guiIntfStruct.StreamType ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
175 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
176 case STREAMTYPE_FILE: av_strlcat( trbuf,"f",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
177 #ifdef HAVE_VCD |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
178 case STREAMTYPE_VCD: av_strlcat( trbuf,"v",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
179 #endif |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
180 case STREAMTYPE_STREAM: av_strlcat( trbuf,"u",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
181 #ifdef USE_DVDREAD |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
182 case STREAMTYPE_DVD: av_strlcat( trbuf,"d",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
183 #endif |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
184 default: av_strlcat( trbuf," ",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
185 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
186 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
187 case '$': av_strlcat( trbuf,"$",sizeof( trbuf ) ); break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
188 default: continue; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
189 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
190 c=strlen( trbuf ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
191 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
192 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
193 return trbuf; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
194 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
195 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
196 static char * image_buffer = NULL; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
197 static int image_width = 0; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
198 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
199 void PutImage( txSample * bf,int x,int y,int max,int ofs ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
200 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
201 int i=0,ix,iy; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
202 uint32_t * buf = NULL; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
203 uint32_t * drw = NULL; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
204 register uint32_t tmp; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
205 /* register uint32_t yc; */ |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
206 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
207 if ( ( !bf )||( bf->Image == NULL ) ) return; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
208 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
209 i=( bf->Width * ( bf->Height / max ) ) * ofs; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
210 buf=(uint32_t *)image_buffer; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
211 drw=(uint32_t *)bf->Image; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
212 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
213 #if 1 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
214 for ( iy=y;iy < (int)(y+bf->Height / max);iy++ ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
215 for ( ix=x;ix < (int)(x+bf->Width);ix++ ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
216 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
217 tmp=drw[i++]; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
218 if ( tmp != 0x00ff00ff ) buf[iy * image_width + ix]=tmp; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
219 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
220 #else |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
221 yc=y * image_width; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
222 for ( iy=y;iy < (int)(y+bf->Height / max);iy++ ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
223 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
224 for ( ix=x;ix < (int)(x+bf->Width);ix++ ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
225 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
226 tmp=drw[i++]; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
227 if ( tmp != 0x00ff00ff ) buf[yc + ix]=tmp; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
228 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
229 yc+=image_width; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
230 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
231 #endif |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
232 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
233 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
234 void SimplePotmeterPutImage( txSample * bf,int x,int y,float frac ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
235 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
236 int i=0,w,r,ix,iy; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
237 uint32_t * buf = NULL; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
238 uint32_t * drw = NULL; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
239 register uint32_t tmp; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
240 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
241 if ( ( !bf )||( bf->Image == NULL ) ) return; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
242 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
243 buf=(uint32_t *)image_buffer; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
244 drw=(uint32_t *)bf->Image; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
245 w=bf->Width*frac; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
246 r=bf->Width-w; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
247 for ( iy=y;iy < (int)(y+bf->Height);iy++ ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
248 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
249 for ( ix=x;ix < (int)(x+w);ix++ ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
250 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
251 tmp=drw[i++]; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
252 if ( tmp != 0x00ff00ff ) buf[iy * image_width + ix]=tmp; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
253 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
254 i+=r; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
255 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
256 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
257 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
258 void Render( wsTWindow * window,wItem * Items,int nrItems,char * db,int size ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
259 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
260 wItem * item; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
261 txSample * image = NULL; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
262 int i; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
263 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
264 image_buffer=db; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
265 image_width=window->Width; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
266 |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
267 for( i=0;i < nrItems + 1;i++ ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
268 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
269 item=&Items[i]; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
270 switch( item->type ) |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
271 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
272 case itButton: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
273 PutImage( &item->Bitmap,item->x,item->y,3,item->pressed ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
274 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
275 case itPotmeter: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
276 if (item->phases == 1)SimplePotmeterPutImage( &item->Bitmap,item->x,item->y, item->value / 100.0f ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
277 else PutImage( &item->Bitmap,item->x,item->y,item->phases,( item->phases - 1 ) * ( item->value / 100.0f ) ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
278 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
279 case itHPotmeter: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
280 if (item->phases == 1)SimplePotmeterPutImage( &item->Bitmap,item->x,item->y, item->value / 100.0f ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
281 else PutImage( &item->Bitmap,item->x,item->y,item->phases,( item->phases - 1 ) * ( item->value / 100.0f ) ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
282 PutImage( &item->Mask,item->x + (int)( ( item->width - item->psx ) * item->value / 100.0f ),item->y,3,item->pressed ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
283 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
284 case itVPotmeter: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
285 PutImage( &item->Bitmap, |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
286 item->x,item->y, |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
287 item->phases, |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
288 item->phases * ( 1. - item->value / 100.0f ) ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
289 PutImage( &item->Mask, |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
290 item->x,item->y + (int)( ( item->height - item->psy ) * ( 1. - item->value / 100.0f ) ), |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
291 3,item->pressed ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
292 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
293 case itSLabel: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
294 image=fntRender( item,0,"%s",item->label ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
295 if ( image ) PutImage( image,item->x,item->y,1,0 ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
296 case itDLabel: |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
297 { |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
298 char * t = Translate( item->label ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
299 int l = fntTextWidth( item->fontid,t ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
300 l=(l?l:item->width); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
301 image=fntRender( item,l-(GetTimerMS() / 20)%l,"%s",t ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
302 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
303 if ( image ) PutImage( image,item->x,item->y,1,0 ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
304 break; |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
305 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
306 } |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
307 wsConvert( window,db,size ); |
01754b23193e
Rename common.[ch], there are too many files by that name.
diego
parents:
diff
changeset
|
308 } |