~ubuntu-branches/ubuntu/maverick/vdr-plugin-mp3/maverick

« back to all changes in this revision

Viewing changes to menu.c

  • Committer: Bazaar Package Importer
  • Author(s): Tobias Grimm
  • Date: 2010-03-28 15:09:21 UTC
  • mfrom: (2.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100328150921-3kti802cqh0pe1hl
Tags: 0.10.2-3
* Build-depend on vdr-dev >= 1.6.0-16
* Minor debian/copyright update

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * MP3/MPlayer plugin to VDR (C++)
3
3
 *
4
 
 * (C) 2001-2007 Stefan Huelswitt <s.huelswitt@gmx.de>
 
4
 * (C) 2001-2009 Stefan Huelswitt <s.huelswitt@gmx.de>
5
5
 *
6
6
 * This code is free software; you can redistribute it and/or
7
7
 * modify it under the terms of the GNU General Public License
39
39
 
40
40
void Status(const char *text)
41
41
{
42
 
#if APIVERSNUM >= 10307
43
42
  Skins.Message(mtStatus,text);
44
 
#else
45
 
  if(text) {
46
 
    Interface->Status(text);
47
 
    Interface->Flush();
48
 
    }
49
 
#endif
50
43
}
51
44
 
52
45
void Error(const char *text)
53
46
{
54
 
#if APIVERSNUM >= 10307
55
47
  Skins.Message(mtError,text);
56
 
#else
57
 
  Interface->Error(text);
58
 
#endif
59
48
}
60
49
 
61
50
void Info(const char *text)
62
51
{
63
 
#if APIVERSNUM >= 10307
64
52
  Skins.Message(mtInfo,text);
65
 
#else
66
 
  Interface->Info(text);
67
 
#endif
68
53
}
69
54
 
70
55
// --- cMenuBrowseItem ---------------------------------------------------------
86
71
 
87
72
void cMenuBrowseItem::Set(void)
88
73
{
89
 
  char *buffer=0;
90
 
  asprintf(&buffer,item->Type()==otFile?"%s":"[%s]",item->Name());
 
74
  char *buffer=aprintf(item->Type()==otFile?"%s":"[%s]",item->Name());
91
75
  SetText(buffer,false);
92
76
}
93
77
 
266
250
 
267
251
void cMenuSourceItem::Set(void)
268
252
{
269
 
  char *buffer=0;
270
 
  asprintf(&buffer, "%s\t%s\t%s", source->NeedsMount()?(source->Status()?"*":">"):"", source->Description(), source->BaseDir());
 
253
  char *buffer=aprintf("%s\t%s\t%s", source->NeedsMount()?(source->Status()?"*":">"):"", source->Description(), source->BaseDir());
271
254
  SetText(buffer,false);
272
255
}
273
256
 
390
373
{
391
374
  if(Total > 0) {
392
375
    int p = Current * Width / Total;;
393
 
#if APIVERSNUM >= 10307
394
376
    DrawRectangle(0, 0, p, Height - 1, clrGreen);
395
377
    DrawRectangle(p + 1, 0, Width - 1, Height - 1, clrWhite);
396
 
#else
397
 
    Fill(0, 0, p, Height - 1, clrGreen);
398
 
    Fill(p + 1, 0, Width - 1, Height - 1, clrWhite);
399
 
#endif
400
378
    }
401
379
}
402
380