Commit 5ea03efe authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/modules/Linphone/Codecs): in progress

parent ed550b73
......@@ -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);
}
......
import QtQuick 2.7
import Linphone.Styles 1.0
// =============================================================================
Text {
color: CodecsViewerStyle.attribute.color
elide: Text.ElideRight
font.pointSize: CodecsViewerStyle.attribute.fontSize
}
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
}
}
}
......
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment