From c182191b3d54dcb22abc5c8b08d9c63e7a57b585 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Fri, 16 Apr 2010 21:05:57 +0200 Subject: add infrastructure to observe settings changes Check it out by changing BSC vales in the settings osd. --- dxr3device.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'dxr3device.c') diff --git a/dxr3device.c b/dxr3device.c index 1f8be19..02773bb 100644 --- a/dxr3device.c +++ b/dxr3device.c @@ -68,6 +68,9 @@ cDxr3Device::cDxr3Device() : spuDecoder(NULL), pluginOn(true), vPts(0), scrSet(f audioOut->openDevice(); aDecoder = new cDxr3AudioDecoder(); + + // register observer + cSettings::instance()->registerObserver(this); } cDxr3Device::~cDxr3Device() @@ -457,6 +460,18 @@ int cDxr3Device::ossSetPlayMode(uint32_t mode) return ioctl(fdControl, EM8300_IOCTL_SET_AUDIOMODE, &mode); } +void cDxr3Device::settingsChange(SettingsChange change) +{ + if (change == BCS) { + // update bcs value + bcs.brightness = cSettings::instance()->brightness(); + bcs.contrast = cSettings::instance()->contrast(); + bcs.saturation = cSettings::instance()->saturation(); + + CHECK(ioctl(fdControl, EM8300_IOCTL_SETBCS, &bcs)); + } +} + void cDxr3Device::claimDevices() { // open control stream -- cgit v1.2.3