Commit c51772f9 authored by Sébastien Blin's avatar Sébastien Blin

conference: add ability to change layouts

Change-Id: I40ac23ccf29a0a138f5c759db59b2760d830fa45
parent 7af0cb82
......@@ -125,6 +125,12 @@ enum class Type {
CONFERENCE
};
enum class Layout {
GRID,
ONE_WITH_SMALL,
ONE
};
struct Info
{
QString id;
......@@ -136,6 +142,7 @@ struct Info
bool audioMuted = false;
bool videoMuted = false;
bool isAudioOnly = false;
Layout layout = Layout::GRID;
};
static inline bool
......
......@@ -225,6 +225,16 @@ public:
*/
void setCurrentCall(const QString& callId) const;
/**
* Change the conference layout
*/
void setConferenceLayout(const QString& confId, const call::Layout& layout);
/**
* Set the shown participant
*/
void setActiveParticipant(const QString& confId, const QString& participant);
Q_SIGNALS:
/**
* Emitted when a call state changes
......
......@@ -629,6 +629,33 @@ NewCallModel::setCurrentCall(const QString& callId) const
}
}
void
NewCallModel::setConferenceLayout(const QString& confId, const call::Layout& layout)
{
auto call = pimpl_->calls.find(confId);
if (call != pimpl_->calls.end()) {
switch (layout) {
case call::Layout::GRID:
CallManager::instance().setConferenceLayout(confId, 0);
break;
case call::Layout::ONE_WITH_SMALL:
CallManager::instance().setConferenceLayout(confId, 1);
break;
case call::Layout::ONE:
CallManager::instance().setConferenceLayout(confId, 2);
break;
}
call->second->layout = layout;
}
}
void
NewCallModel::setActiveParticipant(const QString& confId, const QString& participant)
{
CallManager::instance().setActiveParticipant(confId, participant);
}
void
NewCallModel::sendSipMessage(const QString& callId, const QString& body) const
{
......
......@@ -363,6 +363,16 @@ public Q_SLOTS: // METHODS
DRing::stopSmartInfo();
}
void setConferenceLayout(const QString& confId, int layout)
{
DRing::setConferenceLayout(confId.toStdString(), layout);
}
void setActiveParticipant(const QString& confId, const QString& callId)
{
DRing::setActiveParticipant(confId.toStdString(), callId.toStdString());
}
bool switchInput(const QString &callId, const QString &resource)
{
#ifdef ENABLE_VIDEO
......
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