qs: add peak detection
This commit is contained in:
parent
f22dee69f0
commit
08a8ebbffd
5 changed files with 67 additions and 35 deletions
68
flake.lock
generated
68
flake.lock
generated
|
|
@ -20,11 +20,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765900596,
|
"lastModified": 1767024902,
|
||||||
"narHash": "sha256-+hn8v9jkkLP9m+o0Nm5SiEq10W0iWDSotH2XfjU45fA=",
|
"narHash": "sha256-sMdk6QkMDhIOnvULXKUM8WW8iyi551SWw2i6KQHbrrU=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "aquamarine",
|
"repo": "aquamarine",
|
||||||
"rev": "d83c97f8f5c0aae553c1489c7d9eff3eadcadace",
|
"rev": "b8a0c5ba5a9fbd2c660be7dd98bdde0ff3798556",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -59,15 +59,15 @@
|
||||||
"flake-compat": {
|
"flake-compat": {
|
||||||
"flake": false,
|
"flake": false,
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1761588595,
|
"lastModified": 1767039857,
|
||||||
"narHash": "sha256-XKUZz9zewJNUj46b4AJdiRZJAvSZ0Dqj2BNfXvFlJC4=",
|
"narHash": "sha256-vNpUSpF5Nuw8xvDLj2KCwwksIbjua2LZCqhV1LNRDns=",
|
||||||
"owner": "edolstra",
|
"owner": "NixOS",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"rev": "f387cd2afec9419c8ee37694406ca490c3f34ee5",
|
"rev": "5edf11c44bc78a0d334f6334cdaf7d60d732daab",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"owner": "edolstra",
|
"owner": "NixOS",
|
||||||
"repo": "flake-compat",
|
"repo": "flake-compat",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
|
|
@ -180,11 +180,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1763733840,
|
"lastModified": 1766946335,
|
||||||
"narHash": "sha256-JnET78yl5RvpGuDQy3rCycOCkiKoLr5DN1fPhRNNMco=",
|
"narHash": "sha256-MRD+Jr2bY11MzNDfenENhiK6pvN+nHygxdHoHbZ1HtE=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "hyprgraphics",
|
"repo": "hyprgraphics",
|
||||||
"rev": "8f1bec691b2d198c60cccabca7a94add2df4ed1a",
|
"rev": "4af02a3925b454deb1c36603843da528b67ded6c",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -218,11 +218,11 @@
|
||||||
"xdph": "xdph"
|
"xdph": "xdph"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1767201430,
|
"lastModified": 1767907620,
|
||||||
"narHash": "sha256-2FF66EaIbsc7CL1jKHbRFslSePDq40fzlTTbUlm5v3k=",
|
"narHash": "sha256-zpQr4jkAoARBI22dFDnRekUagdRt6Mfc+ThpSSHm90s=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "Hyprland",
|
"repo": "Hyprland",
|
||||||
"rev": "48a024e0322bbd7c4c88126498ec478444ec4cb2",
|
"rev": "5b1b79c29c5e0ea974b2a9da5d122dd0f3bedca6",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -264,11 +264,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765643131,
|
"lastModified": 1767023960,
|
||||||
"narHash": "sha256-CCGohW5EBIRy4B7vTyBMqPgsNcaNenVad/wszfddET0=",
|
"narHash": "sha256-R2HgtVS1G3KSIKAQ77aOZ+Q0HituOmPgXW9nBNkpp3Q=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "hyprland-guiutils",
|
"repo": "hyprland-guiutils",
|
||||||
"rev": "e50ae912813bdfa8372d62daf454f48d6df02297",
|
"rev": "c2e906261142f5dd1ee0bfc44abba23e2754c660",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -284,11 +284,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766381032,
|
"lastModified": 1767957561,
|
||||||
"narHash": "sha256-Wuk2MULnGfgAbP1N/Rp6H6k7zG/ynDiy54mPvkt/4bM=",
|
"narHash": "sha256-N0kFdc6tSE0yFeQ/Iit3KNrz4nf2K5xvP3juL7SUyhc=",
|
||||||
"owner": "outfoxxed",
|
"owner": "outfoxxed",
|
||||||
"repo": "hy3",
|
"repo": "hy3",
|
||||||
"rev": "50643d625829f303239f9ec019021f17d7e9f3fc",
|
"rev": "3287049e79e9e51431de8c09f9192a18afa1bf35",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -464,11 +464,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766253200,
|
"lastModified": 1767473322,
|
||||||
"narHash": "sha256-26qPwrd3od+xoYVywSB7hC2cz9ivN46VPLlrsXyGxvE=",
|
"narHash": "sha256-RGOeG+wQHeJ6BKcsSB8r0ZU77g9mDvoQzoTKj2dFHwA=",
|
||||||
"owner": "hyprwm",
|
"owner": "hyprwm",
|
||||||
"repo": "hyprwire",
|
"repo": "hyprwire",
|
||||||
"rev": "1079777525b30a947c8d657fac158e00ae85de9d",
|
"rev": "d5e7d6b49fe780353c1cf9a1cf39fa8970bd9d11",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -519,11 +519,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1730724501,
|
"lastModified": 1767942797,
|
||||||
"narHash": "sha256-zvNdomPM86fUf0iAwJV1RQC8yAqDCKbCDJKIs4iIPy0=",
|
"narHash": "sha256-ypny6yOP3Buh7UBmETW3R/el3nHdzYNOCMhVnCdm9U4=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "8f897ffb4a1575252c536c63db8be72f22b6a494",
|
"rev": "8bdd6351a130f8ed8fe13c9ec87ed965c4d9912b",
|
||||||
"revCount": 1,
|
"revCount": 2,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.outfoxxed.me/outfoxxed/nix-qml-support"
|
"url": "https://git.outfoxxed.me/outfoxxed/nix-qml-support"
|
||||||
},
|
},
|
||||||
|
|
@ -578,11 +578,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1765911976,
|
"lastModified": 1767281941,
|
||||||
"narHash": "sha256-t3T/xm8zstHRLx+pIHxVpQTiySbKqcQbK+r+01XVKc0=",
|
"narHash": "sha256-6MkqajPICgugsuZ92OMoQcgSHnD6sJHwk8AxvMcIgTE=",
|
||||||
"owner": "cachix",
|
"owner": "cachix",
|
||||||
"repo": "git-hooks.nix",
|
"repo": "git-hooks.nix",
|
||||||
"rev": "b68b780b69702a090c8bb1b973bab13756cc7a27",
|
"rev": "f0927703b7b1c8d97511c4116eb9b4ec6645a0fa",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
|
|
@ -598,11 +598,11 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1766725085,
|
"lastModified": 1767949765,
|
||||||
"narHash": "sha256-O2aMFdDUYJazFrlwL7aSIHbUSEm3ADVZjmf41uBJfHs=",
|
"narHash": "sha256-sb9X1evrQI2+4qmYCCAHMSiJFqj4eAuZp5BwYrOiJmA=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "41828c4180fb921df7992a5405f5ff05d2ac2fff",
|
"rev": "eecc2f88b3b12a672df79e74f2bd49ef65f0abdf",
|
||||||
"revCount": 715,
|
"revCount": 721,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
"url": "https://git.outfoxxed.me/quickshell/quickshell"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,12 @@ ClickableIcon {
|
||||||
|
|
||||||
PwObjectTracker { objects: [ node ] }
|
PwObjectTracker { objects: [ node ] }
|
||||||
|
|
||||||
|
PwNodePeakMonitor {
|
||||||
|
id: peakMonitor
|
||||||
|
node: root.node
|
||||||
|
enabled: tooltip.visible
|
||||||
|
}
|
||||||
|
|
||||||
implicitHeight: width;
|
implicitHeight: width;
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton;
|
acceptedButtons: Qt.LeftButton | Qt.RightButton;
|
||||||
fillWindowWidth: true
|
fillWindowWidth: true
|
||||||
|
|
@ -55,6 +61,7 @@ ClickableIcon {
|
||||||
|
|
||||||
//enabled: !node.audio.muted
|
//enabled: !node.audio.muted
|
||||||
value: node.audio.volume
|
value: node.audio.volume
|
||||||
|
peak: peakMonitor.peak
|
||||||
onValueChanged: node.audio.volume = value
|
onValueChanged: node.audio.volume = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ ColumnLayout {
|
||||||
required property PwLinkGroup modelData;
|
required property PwLinkGroup modelData;
|
||||||
node: trackedNode.isSink ? modelData.source : modelData.target;
|
node: trackedNode.isSink ? modelData.source : modelData.target;
|
||||||
state: modelData.state;
|
state: modelData.state;
|
||||||
|
peakDetect: trackedNode.isSink
|
||||||
|
|
||||||
image: {
|
image: {
|
||||||
let icon = "";
|
let icon = "";
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@ RowLayout {
|
||||||
required property PwNode node;
|
required property PwNode node;
|
||||||
required property string image;
|
required property string image;
|
||||||
required property Item headerComponent;
|
required property Item headerComponent;
|
||||||
|
property bool peakDetect: true;
|
||||||
|
|
||||||
property int state: PwLinkState.Unlinked;
|
property int state: PwLinkState.Unlinked;
|
||||||
|
|
||||||
|
|
@ -21,6 +22,12 @@ RowLayout {
|
||||||
|
|
||||||
PwObjectTracker { objects: [ node ] }
|
PwObjectTracker { objects: [ node ] }
|
||||||
|
|
||||||
|
PwNodePeakMonitor {
|
||||||
|
id: peakMonitor
|
||||||
|
node: root.node
|
||||||
|
enabled: root.peakDetect
|
||||||
|
}
|
||||||
|
|
||||||
ClickableIcon {
|
ClickableIcon {
|
||||||
image: root.image
|
image: root.image
|
||||||
asynchronous: true
|
asynchronous: true
|
||||||
|
|
@ -44,6 +51,7 @@ RowLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
value: node.audio.volume
|
value: node.audio.volume
|
||||||
|
peak: root.peakDetect ? peakMonitor.peak : 1
|
||||||
onValueChanged: node.audio.volume = value
|
onValueChanged: node.audio.volume = value
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,13 @@ Item {
|
||||||
property real to: 1.5
|
property real to: 1.5
|
||||||
property real warning: 1.0
|
property real warning: 1.0
|
||||||
property real value: 0.0
|
property real value: 0.0
|
||||||
|
property real peak: 1.0
|
||||||
|
|
||||||
implicitWidth: groove.implicitWidth
|
implicitWidth: groove.implicitWidth
|
||||||
implicitHeight: 20
|
implicitHeight: 20
|
||||||
|
|
||||||
property real __valueOffset: ((value - from) / (to - from)) * groove.width
|
property real __valueOffset: ((value - from) / (to - from)) * groove.width
|
||||||
|
property real __peakOffset: peak * __valueOffset
|
||||||
property real __wheelValue: -1
|
property real __wheelValue: -1
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
@ -55,10 +57,24 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
radius: 5
|
radius: 5
|
||||||
color: "#80ceffff"
|
color: "#40ceffff"
|
||||||
width: __valueOffset
|
width: __valueOffset
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: peakFill
|
||||||
|
|
||||||
|
anchors {
|
||||||
|
left: groove.left
|
||||||
|
top: groove.top
|
||||||
|
bottom: groove.bottom
|
||||||
|
}
|
||||||
|
|
||||||
|
radius: 5
|
||||||
|
color: "#60ceffff"
|
||||||
|
width: __peakOffset
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: groove
|
id: groove
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue