~ubuntu-branches/debian/sid/vorbis-tools/sid

« back to all changes in this revision

Viewing changes to ogg123/status.c

  • Committer: Bazaar Package Importer
  • Author(s): Jesus Climent
  • Date: 2005-04-10 09:22:24 UTC
  • mfrom: (2.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20050410092224-xtukpa3qghghhjje
Tags: 1.0.1-1.3
* Authorized NMU.
* Modified alsa to mention alsa09 (although the device might be nowadays
  alsa, back, since alsa1.0 has been already released). (Closes: #258286)
* Modified the manpage/help message for vorbiscomment to make it a bit more
  userfiendly: Closes: #252531.
* Added oggdec to the long description field, so that it triggers apt-cache
  searches: Closes: #274894.
* Typos in manpages: Closes: #302150.
* Escaped dashes in manpage: Closes: #264365.
* Quiet option is actually with -Q, not -q (Closes: #211289) Reported
  upstream but patched for Debian.
* Change input.wav with inputfile, since we accept flac-formated files:
  Closes: #262509.
* Translation bits:
  * Updated translation hu.po: Closes: #272037.
  * French translation correction: Encodage -> Codage (Closes: #248431).
  * debian/rules: remove .gmo's to avoid clash with uploaded tarball.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 *                                                                  *
12
12
 ********************************************************************
13
13
 
14
 
 last mod: $Id: status.c,v 1.5 2001/12/22 00:02:19 volsung Exp $
 
14
 last mod: $Id: status.c,v 1.8 2002/03/19 09:50:09 msmith Exp $
15
15
 
16
16
 ********************************************************************/
17
17
 
20
20
#include <pthread.h>
21
21
 
22
22
#include "status.h"
 
23
#include "i18n.h"
23
24
 
24
25
char temp_buffer[200];
25
26
int last_line_len = 0;
43
44
  char *sep = "(";
44
45
 
45
46
  if (buf_stats->prebuffering) {
46
 
    cur += sprintf (cur, "%sPrebuf to %1.f%%", sep, 
 
47
    cur += sprintf (cur, _("%sPrebuf to %.1f%%"), sep, 
47
48
                    100.0f * buf_stats->prebuffer_fill);
48
49
    sep = comma;
49
50
  }
50
51
  if (buf_stats->paused) {
51
 
    cur += sprintf (cur, "%sPaused", sep);
 
52
    cur += sprintf (cur, _("%sPaused"), sep);
52
53
    sep = comma;
53
54
  }
54
55
  if (buf_stats->eos) {
55
 
    cur += sprintf (cur, "%sEOS", sep);
 
56
    cur += sprintf (cur, _("%sEOS"), sep);
56
57
    sep = comma;
57
58
  }
58
59
  if (cur != dest)
114
115
  int len = 0;
115
116
  char *str = temp_buffer;
116
117
 
 
118
  if (max_verbosity == 0)
 
119
    return 0;
 
120
 
117
121
  /* Put the clear line text into the same string buffer so that the
118
122
     line is cleared and redrawn all at once.  This reduces
119
123
     flickering.  Don't count characters used to clear line in len */
184
188
 
185
189
  stats = calloc(NUM_STATS + 1, sizeof(stat_format_t));  /* One extra for end flag */
186
190
  if (stats == NULL) {
187
 
    fprintf(stderr, "Memory allocation error in stats_init()\n");
 
191
    fprintf(stderr, _("Memory allocation error in stats_init()\n"));
188
192
    exit(1);
189
193
  }
190
194
 
191
195
  cur = stats + 0; /* currently playing file / stream */
192
196
  cur->verbosity = 3; 
193
197
  cur->enabled = 0;
194
 
  cur->formatstr = "File: %s"; 
 
198
  cur->formatstr = _("File: %s"); 
195
199
  cur->type = stat_stringarg;
196
200
  
197
201
  cur = stats + 1; /* current playback time (preformatted) */
198
202
  cur->verbosity = 1;
199
203
  cur->enabled = 1;
200
 
  cur->formatstr = "Time: %s"; 
 
204
  cur->formatstr = _("Time: %s"); 
201
205
  cur->type = stat_stringarg;
202
206
  cur->arg.stringarg = calloc(TIME_STR_SIZE, sizeof(char));
203
207
 
204
208
  if (cur->arg.stringarg == NULL) {
205
 
    fprintf(stderr, "Memory allocation error in stats_init()\n");
 
209
    fprintf(stderr, _("Memory allocation error in stats_init()\n"));
206
210
    exit(1);
207
211
  }  
208
212
  write_time_string(cur->arg.stringarg, 0.0);
216
220
  cur->arg.stringarg = calloc(TIME_STR_SIZE, sizeof(char));
217
221
 
218
222
  if (cur->arg.stringarg == NULL) {
219
 
    fprintf(stderr, "Memory allocation error in stats_init()\n");
 
223
    fprintf(stderr, _("Memory allocation error in stats_init()\n"));
220
224
    exit(1);
221
225
  }
222
226
  write_time_string(cur->arg.stringarg, 0.0);
225
229
  cur = stats + 3; /* total playback time (preformatted) */
226
230
  cur->verbosity = 1;
227
231
  cur->enabled = 1;
228
 
  cur->formatstr = "of %s";
 
232
  cur->formatstr = _("of %s");
229
233
  cur->type = stat_stringarg;
230
234
  cur->arg.stringarg = calloc(TIME_STR_SIZE, sizeof(char));
231
235
 
232
236
  if (cur->arg.stringarg == NULL) {
233
 
    fprintf(stderr, "Memory allocation error in stats_init()\n");
 
237
    fprintf(stderr, _("Memory allocation error in stats_init()\n"));
234
238
    exit(1);
235
239
  }
236
240
  write_time_string(cur->arg.stringarg, 0.0);
245
249
  cur = stats + 5; /* average bitrate (not yet implemented) */
246
250
  cur->verbosity = 2;
247
251
  cur->enabled = 0;
248
 
  cur->formatstr = "Avg bitrate: %5.1f";
 
252
  cur->formatstr = _("Avg bitrate: %5.1f");
249
253
  cur->type = stat_doublearg;
250
254
 
251
255
  cur = stats + 6; /* input buffer fill % */
252
256
  cur->verbosity = 2;
253
257
  cur->enabled = 0;
254
 
  cur->formatstr = " Input Buffer %5.1f%%";
 
258
  cur->formatstr = _(" Input Buffer %5.1f%%");
255
259
  cur->type = stat_doublearg;
256
260
 
257
261
  cur = stats + 7; /* input buffer status */
262
266
  cur->arg.stringarg = calloc(STATE_STR_SIZE, sizeof(char));
263
267
 
264
268
  if (cur->arg.stringarg == NULL) {
265
 
    fprintf(stderr, "Memory allocation error in stats_init()\n");
 
269
    fprintf(stderr, _("Memory allocation error in stats_init()\n"));
266
270
    exit(1);
267
271
  }
268
272
 
270
274
  cur = stats + 8; /* output buffer fill % */
271
275
  cur->verbosity = 2;
272
276
  cur->enabled = 0;
273
 
  cur->formatstr = " Output Buffer %5.1f%%"; 
 
277
  cur->formatstr = _(" Output Buffer %5.1f%%"); 
274
278
  cur->type = stat_doublearg;
275
279
 
276
280
  cur = stats + 9; /* output buffer status */
281
285
  cur->arg.stringarg = calloc(STATE_STR_SIZE, sizeof(char));
282
286
 
283
287
  if (cur->arg.stringarg == NULL) {
284
 
    fprintf(stderr, "Memory allocation error in stats_init()\n");
 
288
    fprintf(stderr, _("Memory allocation error in stats_init()\n"));
285
289
    exit(1);
286
290
  }
287
291