mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-22 15:54:00 +02:00
misc: av settings
+ remove "Preview unavailable" and only set preview as invisible if no video device + fix preview not starting after branching device + resets eudiometer if no videodevice.listsize changes + fix preview visibility in recorderbox + fix recorderbox closing when changing from conversation to settings GitLab: #608 GitLab: #610 Change-Id: Ie7069934abdf5005ed8360fad20c0de20bdc1a43
This commit is contained in:
parent
f238b9d8ee
commit
218aa35e1e
5 changed files with 45 additions and 16 deletions
|
@ -89,6 +89,11 @@ Rectangle {
|
||||||
|
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (!visible) {
|
||||||
|
recordBox.visible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EmojiPicker {
|
EmojiPicker {
|
||||||
id: emojiPicker
|
id: emojiPicker
|
||||||
|
|
|
@ -41,7 +41,6 @@ Rectangle {
|
||||||
property int duration: 0
|
property int duration: 0
|
||||||
property int state: RecordBox.States.INIT
|
property int state: RecordBox.States.INIT
|
||||||
property bool isVideo: false
|
property bool isVideo: false
|
||||||
property bool previewAvailable: false
|
|
||||||
property int preferredWidth: 320
|
property int preferredWidth: 320
|
||||||
property int preferredHeight: 240
|
property int preferredHeight: 240
|
||||||
property int btnSize: 40
|
property int btnSize: 40
|
||||||
|
@ -61,7 +60,6 @@ Rectangle {
|
||||||
if (isVideo) {
|
if (isVideo) {
|
||||||
previewWidget.deviceId = VideoDevices.getDefaultDevice()
|
previewWidget.deviceId = VideoDevices.getDefaultDevice()
|
||||||
previewWidget.rendererId = VideoDevices.startDevice(previewWidget.deviceId)
|
previewWidget.rendererId = VideoDevices.startDevice(previewWidget.deviceId)
|
||||||
previewAvailable = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +241,7 @@ Rectangle {
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
visible: (isVideo && previewAvailable)
|
visible: (isVideo && VideoDevices.listSize !== 0)
|
||||||
color: JamiTheme.blackColor
|
color: JamiTheme.blackColor
|
||||||
radius: 5
|
radius: 5
|
||||||
|
|
||||||
|
@ -262,6 +260,13 @@ Rectangle {
|
||||||
maskSource: rectBox
|
maskSource: rectBox
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (visible) {
|
||||||
|
openRecorder(true)
|
||||||
|
} else
|
||||||
|
VideoDevices.stopDevice(previewWidget.deviceId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
|
@ -269,11 +274,14 @@ Rectangle {
|
||||||
|
|
||||||
width: root.width
|
width: root.width
|
||||||
|
|
||||||
visible: (isVideo && !previewAvailable)
|
visible: (isVideo && VideoDevices.listSize === 0)
|
||||||
|
|
||||||
text: qsTr("Preview unavailable")
|
text: JamiStrings.previewUnavailable
|
||||||
font.pointSize: 10
|
font.pointSize: JamiTheme.settingsFontSize
|
||||||
font.kerning: true
|
font.kerning: true
|
||||||
|
color: JamiTheme.primaryForegroundColor
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
}
|
}
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
|
|
|
@ -30,6 +30,7 @@ ColumnLayout {
|
||||||
id:root
|
id:root
|
||||||
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
property int videoDevicesListSize: VideoDevices.listSize
|
||||||
|
|
||||||
enum Setting {
|
enum Setting {
|
||||||
AUDIOINPUT,
|
AUDIOINPUT,
|
||||||
|
@ -38,6 +39,19 @@ ColumnLayout {
|
||||||
AUDIOMANAGER
|
AUDIOMANAGER
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (visible)
|
||||||
|
populateAudioSettings()
|
||||||
|
}
|
||||||
|
|
||||||
|
onVideoDevicesListSizeChanged: {
|
||||||
|
AvAdapter.stopAudioMeter()
|
||||||
|
var selectedAudioManager = inputComboBoxSetting.comboModel.data(
|
||||||
|
inputComboBoxSetting.comboModel.index(inputComboBoxSetting.modelIndex, 0), AudioDeviceModel.RawDeviceName)
|
||||||
|
AVModel.setInputDevice(selectedAudioManager)
|
||||||
|
AvAdapter.startAudioMeter()
|
||||||
|
}
|
||||||
|
|
||||||
function populateAudioSettings() {
|
function populateAudioSettings() {
|
||||||
inputComboBoxSetting.modelIndex = inputComboBoxSetting.comboModel.getCurrentIndex()
|
inputComboBoxSetting.modelIndex = inputComboBoxSetting.comboModel.getCurrentIndex()
|
||||||
outputComboBoxSetting.modelIndex = outputComboBoxSetting.comboModel.getCurrentIndex()
|
outputComboBoxSetting.modelIndex = outputComboBoxSetting.comboModel.getCurrentIndex()
|
||||||
|
|
|
@ -32,10 +32,6 @@ Rectangle {
|
||||||
property int contentWidth: avSettingsColumnLayout.width
|
property int contentWidth: avSettingsColumnLayout.width
|
||||||
property int preferredHeight: avSettingsColumnLayout.implicitHeight
|
property int preferredHeight: avSettingsColumnLayout.implicitHeight
|
||||||
|
|
||||||
function populateAVSettings() {
|
|
||||||
audioSettings.populateAudioSettings()
|
|
||||||
}
|
|
||||||
|
|
||||||
color: JamiTheme.secondaryBackgroundColor
|
color: JamiTheme.secondaryBackgroundColor
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
|
|
@ -32,14 +32,12 @@ ColumnLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property real aspectRatio: 0.75
|
property real aspectRatio: 0.75
|
||||||
property bool previewAvailable: false
|
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function startPreviewing(force = false) {
|
function startPreviewing(force = false) {
|
||||||
if (root.visible) {
|
if (root.visible) {
|
||||||
previewWidget.deviceId = VideoDevices.getDefaultDevice()
|
previewWidget.deviceId = VideoDevices.getDefaultDevice()
|
||||||
previewWidget.rendererId = VideoDevices.startDevice(previewWidget.deviceId, force)
|
previewWidget.rendererId = VideoDevices.startDevice(previewWidget.deviceId, force)
|
||||||
previewAvailable = true
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -196,7 +194,7 @@ ColumnLayout {
|
||||||
|
|
||||||
onSwitchToggled: {
|
onSwitchToggled: {
|
||||||
AvAdapter.setHardwareAcceleration(checked)
|
AvAdapter.setHardwareAcceleration(checked)
|
||||||
startPreviewing(true)
|
startPreviewing()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,11 +228,18 @@ ColumnLayout {
|
||||||
maskSource: rectBox
|
maskSource: rectBox
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
onVisibleChanged: {
|
||||||
|
if (visible) {
|
||||||
|
VideoDevices.stopDevice(previewWidget.deviceId)
|
||||||
|
startPreviewing(true)
|
||||||
|
} else
|
||||||
|
VideoDevices.stopDevice(previewWidget.deviceId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Label {
|
Label {
|
||||||
// TODO: proper use of previewAvailable
|
visible: VideoDevices.listSize === 0
|
||||||
visible: !previewAvailable
|
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
@ -243,6 +248,7 @@ ColumnLayout {
|
||||||
text: JamiStrings.previewUnavailable
|
text: JamiStrings.previewUnavailable
|
||||||
font.pointSize: JamiTheme.settingsFontSize
|
font.pointSize: JamiTheme.settingsFontSize
|
||||||
font.kerning: true
|
font.kerning: true
|
||||||
|
color: JamiTheme.primaryForegroundColor
|
||||||
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
Loading…
Add table
Reference in a new issue