summaryrefslogtreecommitdiff
path: root/displayvolume.c
blob: 060a4ddf68a561be8d4793703c9178653ad41741 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "lcarsng.h"
#include "config.h"
#include "volumebox.h"
#include "displayvolume.h"

// --- cLCARSNGDisplayVolume -----------------------------------------------

cLCARSNGDisplayVolume::cLCARSNGDisplayVolume(void)
{
  const cFont *font = cFont::GetFont(fontOsd);
  int lineHeight = font->Height();

  osd = CreateOsd(cOsd::OsdLeft(), cOsd::OsdTop() + cOsd::OsdHeight() - lineHeight, 0, 0, cOsd::OsdWidth() - 1, lineHeight - 1);
  volumeBox = new cLCARSNGVolumeBox(osd, cRect(0, 0, cOsd::OsdWidth(), lineHeight));
}

cLCARSNGDisplayVolume::~cLCARSNGDisplayVolume()
{
  delete volumeBox;
  delete osd;
  cDevice::PrimaryDevice()->ScaleVideo(cRect::Null);
}

void cLCARSNGDisplayVolume::SetVolume(int Current, int Total, bool Mute)
{
  volumeBox->SetVolume(Current, Total, Mute);
}

void cLCARSNGDisplayVolume::Flush(void)
{
  osd->Flush();
}