mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-04-30 16:06:24 +00:00
feat(src/components/codecs/CodecsModel): in progress.
This commit is contained in:
parent
b43517001e
commit
f91aaf01cf
3 changed files with 11 additions and 1 deletions
|
|
@ -89,6 +89,6 @@ QVariant CodecsModel::data (const QModelIndex &index, int role) const {
|
||||||
|
|
||||||
void CodecsModel::enableCodec (int id, bool status) {
|
void CodecsModel::enableCodec (int id, bool status) {
|
||||||
Q_ASSERT(id >= 0 && id < m_codecs.count());
|
Q_ASSERT(id >= 0 && id < m_codecs.count());
|
||||||
shared_ptr<linphone::PayloadType> codec = m_codecs[id].toMap().value("__codec").value<>();
|
shared_ptr<linphone::PayloadType> codec = m_codecs[id].toMap().value("__codec").value<shared_ptr<linphone::PayloadType> >();
|
||||||
codec->enable(status);
|
codec->enable(status);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,10 +23,16 @@
|
||||||
#ifndef CODECS_MODEL_H_
|
#ifndef CODECS_MODEL_H_
|
||||||
#define CODECS_MODEL_H_
|
#define CODECS_MODEL_H_
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#include <QAbstractListModel>
|
#include <QAbstractListModel>
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
|
namespace linphone {
|
||||||
|
class PayloadType;
|
||||||
|
}
|
||||||
|
|
||||||
class CodecsModel : public QAbstractListModel {
|
class CodecsModel : public QAbstractListModel {
|
||||||
Q_OBJECT;
|
Q_OBJECT;
|
||||||
|
|
||||||
|
|
@ -53,4 +59,6 @@ private:
|
||||||
QVariantList m_codecs;
|
QVariantList m_codecs;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Q_DECLARE_METATYPE(std::shared_ptr<linphone::PayloadType> );
|
||||||
|
|
||||||
#endif // CODECS_MODEL_H_
|
#endif // CODECS_MODEL_H_
|
||||||
|
|
|
||||||
|
|
@ -12,4 +12,6 @@ Text {
|
||||||
bold: true
|
bold: true
|
||||||
pointSize: CodecsViewerStyle.legend.fontSize
|
pointSize: CodecsViewerStyle.legend.fontSize
|
||||||
}
|
}
|
||||||
|
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue