1010
1111CINNAMON_SOUNDS = "org.cinnamon.sounds"
1212CINNAMON_DESKTOP_SOUNDS = "org.cinnamon.desktop.sound"
13- MAXIMUM_VOLUME_KEY = "maximum -volume"
13+ OVERAMPLIFICATION_KEY = "allow-amplified -volume"
1414
1515DECAY_STEP = .15
1616
@@ -538,8 +538,7 @@ def buildLayout(self):
538538 sizeGroup = Gtk .SizeGroup .new (Gtk .SizeGroupMode .HORIZONTAL )
539539
540540 # output volume
541- max_volume = self .sound_settings .get_int (MAXIMUM_VOLUME_KEY )
542- self .outVolume = VolumeBar (self .controller .get_vol_max_norm (), max_volume , sizeGroup = sizeGroup )
541+ self .outVolume = VolumeBar (self .controller .get_vol_max_norm (), 100 , sizeGroup = sizeGroup )
543542 devSettings .add_row (self .outVolume )
544543
545544 # balance
@@ -550,6 +549,11 @@ def buildLayout(self):
550549 self .woofer = BalanceBar ("lfe" , 0 , self .controller .get_vol_max_norm (), sizeGroup = sizeGroup )
551550 devSettings .add_row (self .woofer )
552551
552+ # overamplification
553+ switch = GSettingsSwitch (_ ("Overamplification" ), CINNAMON_DESKTOP_SOUNDS , OVERAMPLIFICATION_KEY )
554+ switch .set_tooltip_text (_ ("Allow the volume to exceed 100%, with reduced sound quality." ))
555+ devSettings .add_row (switch )
556+
553557 ## Input page
554558 page = SettingsPage ()
555559 self .sidePage .stack .add_titled (page , "input" , _ ("Input" ))
@@ -569,7 +573,7 @@ def buildLayout(self):
569573 sizeGroup = Gtk .SizeGroup .new (Gtk .SizeGroupMode .HORIZONTAL )
570574
571575 # input volume
572- self .inVolume = VolumeBar (self .controller .get_vol_max_norm (), max_volume , sizeGroup = sizeGroup )
576+ self .inVolume = VolumeBar (self .controller .get_vol_max_norm (), 100 , sizeGroup = sizeGroup )
573577 devSettings .add_row (self .inVolume )
574578
575579 # input level
@@ -626,24 +630,17 @@ def buildLayout(self):
626630 noAppsMessage .pack_start (box , True , True , 0 )
627631 self .appStack .add_named (noAppsMessage , "noAppsMessage" )
628632
629- ## Settings page
630- page = SettingsPage ()
631- self .sidePage .stack .add_titled (page , "settings" , _ ("Settings" ))
632-
633- amplificationSection = page .add_section (_ ("Amplification" ))
634- self .maxVolume = Slider (_ ("Maximum volume: %d" ) % max_volume + "%" , _ ("Reduced" ), _ ("Amplified" ), 1 , 150 , None , step = 1 , page = 10 , value = max_volume , gicon = None , iconName = None )
635- self .maxVolume .adjustment .connect ("value-changed" , self .onMaxVolumeChanged )
636- self .maxVolume .setMark (100 )
637- amplificationSection .add_row (self .maxVolume )
638-
639- def onMaxVolumeChanged (self , adjustment ):
640- newValue = int (round (adjustment .get_value ()))
641- self .sound_settings .set_int (MAXIMUM_VOLUME_KEY , newValue )
642- self .maxVolume .label .set_label (_ ("Maximum volume: %d" ) % newValue + "%" )
643- self .outVolume .adjustment .set_upper (newValue )
633+ self .sound_settings .connect (f"changed::{ OVERAMPLIFICATION_KEY } " , self .onOverAmplificationChanged )
634+ self .onOverAmplificationChanged ()
635+
636+ def onOverAmplificationChanged (self , settings = None , key = None ):
637+ overamplification = self .sound_settings .get_boolean (OVERAMPLIFICATION_KEY )
644638 self .outVolume .slider .clear_marks ()
645- if newValue > 100 :
639+ if overamplification :
640+ self .outVolume .adjustment .set_upper (150 )
646641 self .outVolume .setMark (100 )
642+ else :
643+ self .outVolume .adjustment .set_upper (100 )
647644
648645 def inializeController (self ):
649646 self .controller = Cvc .MixerControl (name = "cinnamon" )
0 commit comments