Display live recording waveforms and bind finalization to its take
This commit is contained in:
1 parent
82b7f000bd
commit
4d578bc028
18 files changed
+516
-48
No files matched your search
+32
-2
@@ -8,6 +8,7 @@ export struct ShellRow {
|
||||
id: string, key: string, title: string, subtitle: string, depth: int, selected: bool, expanded: bool, expandable: bool,
|
||||
talking: bool, muted: bool, unread: string, kind: int, joined: bool, password: bool, full: bool,
|
||||
moderated: bool, spacer: int, own: bool, contact: bool, deafened: bool, away: bool, recording: bool, streaming: bool,
|
||||
waveform: [int],
|
||||
}
|
||||
export struct ShellTab { id: string, title: string, selected: bool, microphone-owner: bool, connected: bool, unread: string }
|
||||
export struct ShellCommand { id: string, label: string, enabled: bool, reason: string, destructive: bool, glyph: int, heading: bool }
|
||||
@@ -96,6 +97,7 @@ export global ShellBridge {
|
||||
in-out property <length> sidebar-width: 270px;
|
||||
in-out property <length> server-width: 500px;
|
||||
callback navigate(int);
|
||||
callback select-stage(int);
|
||||
callback back();
|
||||
callback select(string);
|
||||
callback expand(string);
|
||||
@@ -117,6 +119,30 @@ export global ShellBridge {
|
||||
callback resized(float,float);
|
||||
}
|
||||
|
||||
component RecordingWaveform inherits Rectangle {
|
||||
in property <[int]> peaks;
|
||||
private property <length> bucket-width: 2px;
|
||||
private property <length> live-inset: 2px;
|
||||
height: 36px;
|
||||
background: Theme.header;
|
||||
clip: true;
|
||||
accessible-role: none;
|
||||
// Match the recording mixer lane: centered amplitudes, newest bucket at the right.
|
||||
for peak[index] in root.peaks: Rectangle {
|
||||
visible: peak > 0;
|
||||
x: root.width - root.live-inset - (root.peaks.length - index) * root.bucket-width;
|
||||
y: (root.height - self.height) / 2;
|
||||
width: root.bucket-width;
|
||||
height: max(2px, (root.height - 14px) * clamp(peak, 0, 1000) / 1000);
|
||||
background: Theme.high-contrast ? Theme.fg : Theme.tint-secondary;
|
||||
}
|
||||
Rectangle {
|
||||
x: root.width - root.live-inset;
|
||||
width: 1px;
|
||||
background: Theme.outline;
|
||||
}
|
||||
}
|
||||
|
||||
component EntryRow inherits Rectangle {
|
||||
in property <ShellRow> item;
|
||||
function context-menu() { ShellBridge.context(root.item.id, (root.absolute-position.x + 20px) / 1px, (root.absolute-position.y + root.height / 2) / 1px); }
|
||||
@@ -142,6 +168,10 @@ component EntryRow inherits Rectangle {
|
||||
Text { text: root.item.title; color: Theme.fg; font-size: Theme.font-size; overflow: elide; }
|
||||
if root.item.subtitle != "": Text { text: root.item.subtitle; color: Theme.muted; font-size: Theme.font-size * 0.86; overflow: elide; }
|
||||
}
|
||||
if root.item.waveform.length > 0: parity-recording-waveform := RecordingWaveform {
|
||||
width: min(130px, root.width / 3);
|
||||
peaks: root.item.waveform;
|
||||
}
|
||||
if root.item.unread != "": Text { text: root.item.unread; color: Theme.tint; vertical-alignment: center; }
|
||||
ActionButton { text: ShellBridge.label-more; width: 70px; clicked => { root.context-menu(); } }
|
||||
}
|
||||
@@ -767,7 +797,7 @@ export component ShellScreen inherits Rectangle {
|
||||
for name[index] in ShellBridge.stages: ChromeButton {
|
||||
horizontal-stretch: 1; glyph: index == 0 ? 16 : index == 1 ? 3 : 12;
|
||||
label: name; active: ShellBridge.stage == index;
|
||||
clicked => { ShellBridge.stage = index; }
|
||||
clicked => { ShellBridge.select-stage(index); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -783,7 +813,7 @@ export component ShellScreen inherits Rectangle {
|
||||
if !root.desktop: Rectangle { min-height: 71px; background: Theme.shaded;
|
||||
VerticalLayout { padding: 12px; Text { text: ShellBridge.title; color: Theme.fg; font-size: Theme.font-size * 1.6; font-weight: 700; overflow: elide; } Text { text: ShellBridge.subtitle; color: Theme.muted; overflow: elide; } }
|
||||
}
|
||||
if !root.desktop: HorizontalLayout { for name[index] in ShellBridge.stages: ActionButton { text: name; primary: ShellBridge.stage == index; clicked => { ShellBridge.stage = index; } } }
|
||||
if !root.desktop: HorizontalLayout { for name[index] in ShellBridge.stages: ActionButton { text: name; primary: ShellBridge.stage == index; clicked => { ShellBridge.select-stage(index); } } }
|
||||
if root.chat-open: ChatScreen { width: root.detail-width; embedded-header: root.desktop; }
|
||||
if ShellBridge.stage == 2 && ShellBridge.destination != 1: ScrollView {
|
||||
VerticalLayout { padding: 10px; spacing: 10px;
|
||||
|
||||
Reference in new issue
Block a user