mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
feat: volume overdrive
This commit is contained in:
@@ -137,6 +137,7 @@
|
||||
},
|
||||
"audio": {
|
||||
"volumeStep": 5,
|
||||
"volumeOverdrive": false,
|
||||
"cavaFrameRate": 60,
|
||||
"visualizerType": "linear",
|
||||
"mprisBlacklist": [],
|
||||
|
||||
@@ -261,6 +261,7 @@ Singleton {
|
||||
// audio
|
||||
property JsonObject audio: JsonObject {
|
||||
property int volumeStep: 5
|
||||
property bool volumeOverdrive: false
|
||||
property int cavaFrameRate: 60
|
||||
property string visualizerType: "linear"
|
||||
property list<string> mprisBlacklist: []
|
||||
|
||||
+5
-1
@@ -70,7 +70,11 @@ Loader {
|
||||
// Get progress bar color
|
||||
function getProgressColor() {
|
||||
if (osdType === OSD.Type.Volume) {
|
||||
return isMuted ? Color.mError : Color.mPrimary
|
||||
if (isMuted)
|
||||
return Color.mError
|
||||
if (currentVolume > 1.0)
|
||||
return Color.mError
|
||||
return Color.mPrimary
|
||||
} else {
|
||||
return Color.mPrimary
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ ColumnLayout {
|
||||
NValueSlider {
|
||||
Layout.fillWidth: true
|
||||
from: 0
|
||||
to: Settings.data.audio.volumeOverdrive ? 2.0 : 1.0
|
||||
to: Settings.data.audio.volumeOverdrive ? 1.5 : 1.0
|
||||
value: localVolume
|
||||
stepSize: 0.01
|
||||
text: Math.floor(AudioService.volume * 100) + "%"
|
||||
@@ -91,7 +91,7 @@ ColumnLayout {
|
||||
NValueSlider {
|
||||
Layout.fillWidth: true
|
||||
from: 0
|
||||
to: 1.0
|
||||
to: Settings.data.audio.volumeOverdrive ? 1.5 : 1.0
|
||||
value: AudioService.inputVolume
|
||||
stepSize: 0.01
|
||||
text: Math.floor(AudioService.inputVolume * 100) + "%"
|
||||
@@ -130,6 +130,19 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
// Raise maximum volume above 100%
|
||||
ColumnLayout {
|
||||
spacing: Style.marginS * scaling
|
||||
Layout.fillWidth: true
|
||||
|
||||
NToggle {
|
||||
label: "Allow volume overdrive"
|
||||
description: "Allow raising volume above 100%."
|
||||
checked: Settings.data.audio.volumeOverdrive
|
||||
onToggled: checked => Settings.data.audio.volumeOverdrive = checked
|
||||
}
|
||||
}
|
||||
|
||||
NDivider {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: Style.marginXL * scaling
|
||||
|
||||
@@ -96,7 +96,7 @@ Singleton {
|
||||
if (sink?.ready && sink?.audio) {
|
||||
// Clamp it accordingly
|
||||
sink.audio.muted = false
|
||||
sink.audio.volume = Math.max(0, Math.min(1, newVolume))
|
||||
sink.audio.volume = Math.max(0, Math.min(Settings.data.audio.volumeOverdrive ? 1.5 : 1.0, newVolume))
|
||||
//Logger.log("AudioService", "SetVolume", sink.audio.volume);
|
||||
} else {
|
||||
Logger.warn("AudioService", "No sink available")
|
||||
@@ -115,7 +115,7 @@ Singleton {
|
||||
if (source?.ready && source?.audio) {
|
||||
// Clamp it accordingly
|
||||
source.audio.muted = false
|
||||
source.audio.volume = Math.max(0, Math.min(1, newVolume))
|
||||
source.audio.volume = Math.max(0, Math.min(Settings.data.audio.volumeOverdrive ? 1.5 : 1.0, newVolume))
|
||||
} else {
|
||||
Logger.warn("AudioService", "No source available")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user