Skip to content

Commit

Permalink
[Chromium/hbbtv]
Browse files Browse the repository at this point in the history
* use eDVBVolumecontrol directly
  • Loading branch information
jbleyel committed Aug 26, 2024
1 parent 8dbdb12 commit a0bc449
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 31 deletions.
13 changes: 5 additions & 8 deletions GigaBlueChromium/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@
from Screens.Screen import Screen
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Components.config import config
from Components.ActionMap import ActionMap
from Components.VolumeControl import VolumeControl

import os
import time
import subprocess
from . import cbcfg
from . import pipc

from enigma import eTimer, fbClass, eRCInput, eDVBResourceManager
from enigma import eTimer, fbClass, eRCInput, eDVBResourceManager, eDVBVolumecontrol
from Tools.Transponder import ConvertToHumanReadable
from .pipc import PServerThread, PServerHandlers
from .youtube import YoutubeTVWindow, YoutubeTVSettings
Expand Down Expand Up @@ -114,8 +111,8 @@ def __init__(self, session, mode=None, url='http://gigablue.de'):
session.nav.stopService()
if feId != -1:
self.TryCloseFrontend(feId)
if VolumeControl.instance.volctrl.isMuted():
VolumeControl.instance.volctrl.volumeUnMute()
if eDVBVolumecontrol.getInstance().isMuted():
eDVBVolumecontrol.getInstance().volumeUnMute()
self.isMute = 1
else:
self.isMute = 0
Expand Down Expand Up @@ -202,9 +199,9 @@ def _cb_enigma2LockTimer(self):
def Exit(self):
print('BBrowserLauncher:Exit')
if self.isMute:
VolumeControl.instance.volctrl.volumeMute()
eDVBVolumecontrol.getInstance().volumeMute()
else:
VolumeControl.instance.volctrl.volumeUnMute()
eDVBVolumecontrol.getInstance().volumeUnMute()
cbcfg.DEBUG('[Chromium Plugin] ==== >> default mute [%d] , restore mute [%d]' % (self.isMute, self.isMute))
self.closeTimer.start(1500)

Expand Down
13 changes: 6 additions & 7 deletions HbbTV/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Components.config import config
from Components.ServiceEventTracker import ServiceEventTracker
from Components.VolumeControl import VolumeControl
from enigma import eTimer, fbClass, eRCInput, iServiceInformation, iPlayableService
from enigma import eTimer, fbClass, eRCInput, iServiceInformation, iPlayableService, eDVBVolumecontrol
from . import vbcfg
from .__init__ import _
from .hbbtv import HbbTVWindow
Expand Down Expand Up @@ -85,7 +84,7 @@ def set_volume(self, volume):
return

if self.max_volume < 0:
self.max_volume = VolumeControl.instance.volctrl.getVolume()
self.max_volume = eDVBVolumecontrol.getInstance().getVolume()

self.max_volume += volume
if self.max_volume > 100:
Expand All @@ -95,9 +94,9 @@ def set_volume(self, volume):

if self.soft_volume > 0:
v = int((self.max_volume * self.soft_volume) / 100)
VolumeControl.instance.volctrl.setVolume(v, v)
eDVBVolumecontrol.getInstance().setVolume(v, v)
else:
VolumeControl.instance.volctrl.setVolume(self.max_volume, self.max_volume)
eDVBVolumecontrol.getInstance().setVolume(self.max_volume, self.max_volume)

def close_vkb(self, data=""):
fbClass.getInstance().lock()
Expand Down Expand Up @@ -155,13 +154,13 @@ def _CB_CONTROL_GET_FBSIZE(self, result, packet):

def _CB_CONTROL_SET_VOLUME(self, result, packet):
if self.max_volume < 0:
self.max_volume = VolumeControl.instance.volctrl.getVolume()
self.max_volume = eDVBVolumecontrol.getInstance().getVolume()
self.soft_volume = int(packet)

v = 0
if self.soft_volume > 0 and self.max_volume > 0:
v = int((self.max_volume * self.soft_volume) / 100)
VolumeControl.instance.volctrl.setVolume(v, v)
eDVBVolumecontrol.getInstance().setVolume(v, v)
return (True, None)

def _CB_CONTROL_VOLUME_UP(self, result, packet):
Expand Down
13 changes: 5 additions & 8 deletions VuChromium/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
from Screens.Screen import Screen
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Components.config import config
from Components.ActionMap import ActionMap
from Components.VolumeControl import VolumeControl

import os
import time
import subprocess
from . import cbcfg
from . import pipc

from enigma import eTimer, fbClass, eRCInput, eDVBResourceManager
from enigma import eTimer, fbClass, eRCInput, eDVBResourceManager, eDVBVolumecontrol

from Tools.Transponder import ConvertToHumanReadable

Expand Down Expand Up @@ -117,8 +114,8 @@ def __init__(self, session, mode=None, url="http://vuplus.com"):
if feId != -1:
self.TryCloseFrontend(feId)

if VolumeControl.instance.volctrl.isMuted():
VolumeControl.instance.volctrl.volumeUnMute()
if eDVBVolumecontrol.getInstance().isMuted():
eDVBVolumecontrol.getInstance().volumeUnMute()
self.isMute = 1
else:
self.isMute = 0
Expand Down Expand Up @@ -205,9 +202,9 @@ def _cb_DvbappLockTimer(self):

def Exit(self):
if self.isMute:
VolumeControl.instance.volctrl.volumeMute()
eDVBVolumecontrol.getInstance().volumeMute()
else:
VolumeControl.instance.volctrl.volumeUnMute()
eDVBVolumecontrol.getInstance().volumeUnMute()

cbcfg.DEBUG("[Chromium Plugin] ==== >> default mute [%d] , restore mute [%d]" % (self.isMute, self.isMute))

Expand Down
14 changes: 6 additions & 8 deletions WebkitHbbTV/src/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@
from Screens.ChoiceBox import ChoiceBox
from Screens.VirtualKeyBoard import VirtualKeyBoard
from Components.ServiceEventTracker import ServiceEventTracker
from Components.VolumeControl import VolumeControl

from enigma import eTimer, iServiceInformation, iPlayableService
from enigma import eTimer, iServiceInformation, iPlayableService, eDVBVolumecontrol

import os
import struct
import time

Expand Down Expand Up @@ -85,7 +83,7 @@ def set_volume(self, volume):
return

if self.max_volume < 0:
self.max_volume = VolumeControl.instance.volctrl.getVolume()
self.max_volume = eDVBVolumecontrol.getInstance().getVolume()

self.max_volume += volume
if self.max_volume > 100:
Expand All @@ -95,9 +93,9 @@ def set_volume(self, volume):

if self.soft_volume > 0:
v = int((self.max_volume * self.soft_volume) / 100)
VolumeControl.instance.volctrl.setVolume(v, v)
eDVBVolumecontrol.getInstance().setVolume(v, v)
else:
VolumeControl.instance.volctrl.setVolume(self.max_volume, self.max_volume)
eDVBVolumecontrol.getInstance().setVolume(self.max_volume, self.max_volume)

def close_vkb(self, data=""):
vbcfg.osd_lock()
Expand Down Expand Up @@ -154,13 +152,13 @@ def _CB_CONTROL_GET_FBSIZE(self, result, packet):

def _CB_CONTROL_SET_VOLUME(self, result, packet):
if self.max_volume < 0:
self.max_volume = VolumeControl.instance.volctrl.getVolume()
self.max_volume = eDVBVolumecontrol.getInstance().getVolume()
self.soft_volume = int(packet)

v = 0
if self.soft_volume > 0 and self.max_volume > 0:
v = int((self.max_volume * self.soft_volume) / 100)
VolumeControl.instance.volctrl.setVolume(v, v)
eDVBVolumecontrol.getInstance().setVolume(v, v)
return (True, None)

def _CB_CONTROL_VOLUME_UP(self, result, packet):
Expand Down

0 comments on commit a0bc449

Please sign in to comment.