Add live peak meters (pavucontrol-style level bars)
Each row on Playback, Output Devices and Input Devices gets a level bar under its slider. A meter is a small capture pw_stream on WirePlumber's pw_core with the properties pipewire-pulse gives pavucontrol's peak streams (stream.monitor, target.object, stream.capture.sink for sinks); its process callback folds samples into a peak that a 40 ms GUI timer reads, maps with the slider's cubic curve and decays smoothly. - Only the visible tab is metered; output/stream meters are passive. - stream.monitor nodes (ours and pavucontrol's) are hidden from the tabs. - moonmix-probe gains `meter <id>`; the smoke test now plays noise and checks the stream and sink meters see it. - Screenshot mode holds the meters still before capturing, since a constantly redrawing window never yields a frame under broadway. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
92ae5cdbfe
commit
f08f241edb
17 files changed
+503
-18
No files matched your search
+17
@@ -136,6 +136,12 @@ extern "C" fn ffi_dropdown_new(tag : Int32) -> Widget = "mm_gtk_dropdown_new"
|
||||
#borrow(items)
|
||||
extern "C" fn ffi_dropdown_set(dd : Widget, items : Bytes, selected : Int32) = "mm_gtk_dropdown_set"
|
||||
|
||||
///|
|
||||
extern "C" fn ffi_levelbar_new() -> Widget = "mm_gtk_levelbar_new"
|
||||
|
||||
///|
|
||||
extern "C" fn ffi_levelbar_set(lb : Widget, v : Double) = "mm_gtk_levelbar_set"
|
||||
|
||||
///|
|
||||
#borrow(text)
|
||||
extern "C" fn ffi_set_tooltip(w : Widget, text : Bytes) = "mm_gtk_widget_set_tooltip"
|
||||
@@ -436,6 +442,17 @@ pub fn Widget::set_items(
|
||||
ffi_dropdown_set(self, cstr(clean.join("\n")), selected)
|
||||
}
|
||||
|
||||
///|
|
||||
/// A 0..1 level bar (peak meter).
|
||||
pub fn level_bar() -> Widget {
|
||||
ffi_levelbar_new()
|
||||
}
|
||||
|
||||
///|
|
||||
pub fn Widget::set_level(self : Widget, v : Double) -> Unit {
|
||||
ffi_levelbar_set(self, v)
|
||||
}
|
||||
|
||||
///|
|
||||
pub fn Widget::set_tooltip(self : Widget, text : String) -> Unit {
|
||||
ffi_set_tooltip(self, cstr(text))
|
||||
|
||||
Reference in new issue
Block a user