Skip to content
Snippets Groups Projects
Unverified Commit c51772f9 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

conference: add ability to change layouts

Change-Id: I40ac23ccf29a0a138f5c759db59b2760d830fa45
parent 7af0cb82
Branches
No related tags found
No related merge requests found
...@@ -125,6 +125,12 @@ enum class Type { ...@@ -125,6 +125,12 @@ enum class Type {
CONFERENCE CONFERENCE
}; };
enum class Layout {
GRID,
ONE_WITH_SMALL,
ONE
};
struct Info struct Info
{ {
QString id; QString id;
...@@ -136,6 +142,7 @@ struct Info ...@@ -136,6 +142,7 @@ struct Info
bool audioMuted = false; bool audioMuted = false;
bool videoMuted = false; bool videoMuted = false;
bool isAudioOnly = false; bool isAudioOnly = false;
Layout layout = Layout::GRID;
}; };
static inline bool static inline bool
......
...@@ -225,6 +225,16 @@ public: ...@@ -225,6 +225,16 @@ public:
*/ */
void setCurrentCall(const QString& callId) const; 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: Q_SIGNALS:
/** /**
* Emitted when a call state changes * Emitted when a call state changes
......
...@@ -629,6 +629,33 @@ NewCallModel::setCurrentCall(const QString& callId) const ...@@ -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 void
NewCallModel::sendSipMessage(const QString& callId, const QString& body) const NewCallModel::sendSipMessage(const QString& callId, const QString& body) const
{ {
......
...@@ -363,6 +363,16 @@ public Q_SLOTS: // METHODS ...@@ -363,6 +363,16 @@ public Q_SLOTS: // METHODS
DRing::stopSmartInfo(); 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) bool switchInput(const QString &callId, const QString &resource)
{ {
#ifdef ENABLE_VIDEO #ifdef ENABLE_VIDEO
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment