diff options
author | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2019-09-20 13:54:25 +0800 |
---|---|---|
committer | wang_zhiqiang <wang_zhiqiang@dl.cn.nexty-ele.com> | 2019-09-20 13:54:25 +0800 |
commit | c3ce52fd692f03cf984a9671d5aa0517e3386d19 (patch) | |
tree | 2aa7df179159511340f63dc15d633a7f7db80fdf /app | |
parent | bafd538e4a7d64c7831a93f5f126d2af961c5686 (diff) |
update als2019
Change-Id: Iebd292b108517a02325ff35c5d4a174f03aa5fff
Diffstat (limited to 'app')
-rw-r--r-- | app/CMakeLists.txt | 1 | ||||
-rw-r--r-- | app/VolumeSlider.qml | 10 | ||||
-rw-r--r-- | app/mixer.cpp | 4 |
3 files changed, 10 insertions, 5 deletions
diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index d77c0c8..e08a102 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -21,7 +21,6 @@ set(CMAKE_AUTOMOC ON) set(CMAKE_AUTORCC ON) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(OE_QMAKE_PATH_EXTERNAL_HOST_BINS $ENV{OE_QMAKE_PATH_HOST_BINS}) find_package(Qt5 COMPONENTS WebSockets AGLExtras REQUIRED) diff --git a/app/VolumeSlider.qml b/app/VolumeSlider.qml index b7a98f8..b44d74c 100644 --- a/app/VolumeSlider.qml +++ b/app/VolumeSlider.qml @@ -2,18 +2,24 @@ import QtQuick 2.6 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.0 -ColumnLayout { +RowLayout { anchors.left: parent.left anchors.right: parent.right - Layout.minimumHeight: 125 + Layout.minimumHeight: 75 Label { font.pixelSize: 24 text: modelData.name + Layout.minimumWidth: 150 + Layout.maximumWidth: 150 + elide: Text.ElideRight } Label { font.pixelSize: 24 text: modelData.value + " %" + Layout.minimumWidth: 75 + Layout.maximumWidth: 75 + elide: Text.ElideRight } Slider { id: roleValueSlider diff --git a/app/mixer.cpp b/app/mixer.cpp index 082ca12..e37e741 100644 --- a/app/mixer.cpp +++ b/app/mixer.cpp @@ -63,7 +63,7 @@ void Mixer::parseControls(const QJsonValue & v) for (const QJsonValue & av : v.toArray()) { QString name = av.toObject()["control"].toString(); - int value = static_cast<int>(av.toObject()["volume"].toDouble() * 100); + int value = av.toObject()["volume"].toDouble() * 100; value = qBound(0, value, 100); AudioRole *ar = new AudioRole(name, value); @@ -117,7 +117,7 @@ void Mixer::onClientEventReceived(QString eventName, const QJsonValue& data) } else if (eventName == "audiomixer/volume_changed") { QString name = data.toObject()["control"].toString(); - int value = static_cast<int>(data.toObject()["value"].toDouble() * 100); + int value = data.toObject()["value"].toDouble() * 100; value = qBound(0, value, 100); for (QObject *o : m_roles) { |