mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-20 13:18:06 +00:00
feat(ui/modules/Linphone/Codecs): in progress
This commit is contained in:
parent
ed550b73ac
commit
5ea03efebd
7 changed files with 121 additions and 23 deletions
|
|
@ -275,6 +275,8 @@
|
|||
<file>ui/modules/Linphone/Chat/Message.js</file>
|
||||
<file>ui/modules/Linphone/Chat/Message.qml</file>
|
||||
<file>ui/modules/Linphone/Chat/OutgoingMessage.qml</file>
|
||||
<file>ui/modules/Linphone/Codecs/CodecAttribute.qml</file>
|
||||
<file>ui/modules/Linphone/Codecs/CodecLegend.qml</file>
|
||||
<file>ui/modules/Linphone/Codecs/CodecsViewer.qml</file>
|
||||
<file>ui/modules/Linphone/Contact/Avatar.qml</file>
|
||||
<file>ui/modules/Linphone/Contact/ContactDescription.qml</file>
|
||||
|
|
@ -293,6 +295,7 @@
|
|||
<file>ui/modules/Linphone/Styles/Calls/CallsStyle.qml</file>
|
||||
<file>ui/modules/Linphone/Styles/CardBlockStyle.qml</file>
|
||||
<file>ui/modules/Linphone/Styles/ChatStyle.qml</file>
|
||||
<file>ui/modules/Linphone/Styles/Codecs/CodecsViewerStyle.qml</file>
|
||||
<file>ui/modules/Linphone/Styles/Contact/AvatarStyle.qml</file>
|
||||
<file>ui/modules/Linphone/Styles/Contact/ContactDescriptionStyle.qml</file>
|
||||
<file>ui/modules/Linphone/Styles/Contact/ContactStyle.qml</file>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ inline void addCodecToList (QVariantList &list, const T &codec, CodecsModel::Cod
|
|||
map["mime"] = ::Utils::linphoneStringToQString(codec->getMimeType());
|
||||
map["number"] = codec->getNumber();
|
||||
map["type"] = type;
|
||||
map["recvFmtp"] = ::Utils::linphoneStringToQString(codec->getRecvFmtp());
|
||||
|
||||
list << map;
|
||||
}
|
||||
|
|
@ -49,13 +50,15 @@ inline void addCodecToList (QVariantList &list, const T &codec, CodecsModel::Cod
|
|||
// -----------------------------------------------------------------------------
|
||||
|
||||
CodecsModel::CodecsModel (QObject *parent) : QAbstractListModel(parent) {
|
||||
for (const auto &codec : CoreManager::getInstance()->getCore()->getAudioPayloadTypes())
|
||||
shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
|
||||
|
||||
for (const auto &codec : core->getAudioPayloadTypes())
|
||||
addCodecToList(m_codecs, codec, AudioCodec);
|
||||
|
||||
for (const auto &codec : CoreManager::getInstance()->getCore()->getVideoPayloadTypes())
|
||||
for (const auto &codec : core->getVideoPayloadTypes())
|
||||
addCodecToList(m_codecs, codec, VideoCodec);
|
||||
|
||||
for (const auto &codec : CoreManager::getInstance()->getCore()->getTextPayloadTypes())
|
||||
for (const auto &codec : core->getTextPayloadTypes())
|
||||
addCodecToList(m_codecs, codec, TextCodec);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
import QtQuick 2.7
|
||||
|
||||
import Linphone.Styles 1.0
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Text {
|
||||
color: CodecsViewerStyle.attribute.color
|
||||
elide: Text.ElideRight
|
||||
font.pointSize: CodecsViewerStyle.attribute.fontSize
|
||||
}
|
||||
15
linphone-desktop/ui/modules/Linphone/Codecs/CodecLegend.qml
Normal file
15
linphone-desktop/ui/modules/Linphone/Codecs/CodecLegend.qml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import QtQuick 2.7
|
||||
|
||||
import Linphone.Styles 1.0
|
||||
|
||||
// =============================================================================
|
||||
|
||||
Text {
|
||||
color: CodecsViewerStyle.legend.color
|
||||
elide: Text.ElideRight
|
||||
|
||||
font {
|
||||
bold: true
|
||||
pointSize: CodecsViewerStyle.legend.fontSize
|
||||
}
|
||||
}
|
||||
|
|
@ -2,58 +2,90 @@ import QtQuick 2.7
|
|||
import QtQuick.Layouts 1.3
|
||||
|
||||
import Common 1.0
|
||||
import Linphone.Styles 1.0
|
||||
|
||||
// =============================================================================
|
||||
|
||||
ColumnLayout {
|
||||
Column {
|
||||
property alias model: view.model
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
height: 350
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Header.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Row {
|
||||
Layout.fillWidth: true
|
||||
height: 50
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: CodecsViewerStyle.leftMargin
|
||||
right: parent.right
|
||||
}
|
||||
|
||||
height: CodecsViewerStyle.legend.height
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Codecs.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
ScrollableListView {
|
||||
ListView {
|
||||
id: view
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
boundsBehavior: Flickable.StopAtBounds
|
||||
clip: true
|
||||
spacing: 0
|
||||
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: CodecsViewerStyle.leftMargin
|
||||
right: parent.right
|
||||
}
|
||||
|
||||
height: count * CodecsViewerStyle.attribute.height
|
||||
|
||||
delegate: Rectangle {
|
||||
color: 'red'
|
||||
height: 30
|
||||
width: view.width
|
||||
color: 'transparent'
|
||||
|
||||
Row {
|
||||
height: CodecsViewerStyle.attribute.height
|
||||
width: parent.width
|
||||
|
||||
RowLayout {
|
||||
anchors.fill: parent
|
||||
spacing: CodecsViewerStyle.column.spacing
|
||||
|
||||
Text {
|
||||
CodecAttribute {
|
||||
Layout.preferredWidth: CodecsViewerStyle.column.mimeWidth
|
||||
text: $codec.mime
|
||||
}
|
||||
|
||||
Text {
|
||||
text: $codec.description
|
||||
CodecAttribute {
|
||||
Layout.preferredWidth: CodecsViewerStyle.column.encoderDescriptionWidth
|
||||
text: $codec.encoderDescription
|
||||
}
|
||||
|
||||
Text {
|
||||
text: $codec.channels
|
||||
CodecAttribute {
|
||||
Layout.preferredWidth: CodecsViewerStyle.column.clockRateWidth
|
||||
text: $codec.clockRate
|
||||
}
|
||||
|
||||
Text {
|
||||
CodecAttribute {
|
||||
Layout.preferredWidth: CodecsViewerStyle.column.bitrateWidth
|
||||
text: $codec.bitrate
|
||||
}
|
||||
|
||||
TextField {
|
||||
Layout.preferredWidth: CodecsViewerStyle.column.recvFmtpWidth
|
||||
text: $codec.recvFmtp
|
||||
}
|
||||
|
||||
Switch {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
pragma Singleton
|
||||
import QtQuick 2.7
|
||||
|
||||
import Common 1.0
|
||||
|
||||
// =============================================================================
|
||||
|
||||
QtObject {
|
||||
property int leftMargin: 10
|
||||
|
||||
property QtObject attribute: QtObject {
|
||||
property color color: Colors.j
|
||||
property int fontSize: 10
|
||||
property int height: 40
|
||||
}
|
||||
|
||||
property QtObject column: QtObject {
|
||||
property int spacing: 5
|
||||
|
||||
property int bitrateWidth: 100
|
||||
property int clockRateWidth: 100
|
||||
property int recvFmtpWidth: 200
|
||||
property int encoderDescriptionWidth: 300
|
||||
property int mimeWidth: 100
|
||||
}
|
||||
|
||||
property QtObject legend: QtObject {
|
||||
property color color: Colors.k
|
||||
property int fontSize: 10
|
||||
property int height: 50
|
||||
}
|
||||
}
|
||||
|
|
@ -13,6 +13,8 @@ singleton ChatStyle 1.0 ChatStyle.qml
|
|||
singleton CallsStyle 1.0 Calls/CallsStyle.qml
|
||||
singleton CallControlsStyle 1.0 Calls/CallControlsStyle.qml
|
||||
|
||||
singleton CodecsViewerStyle 1.0 Codecs/CodecsViewerStyle.qml
|
||||
|
||||
singleton AvatarStyle 1.0 Contact/AvatarStyle.qml
|
||||
singleton ContactDescriptionStyle 1.0 Contact/ContactDescriptionStyle.qml
|
||||
singleton ContactStyle 1.0 Contact/ContactStyle.qml
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue