Commit aa548fa3 authored by Ghislain MARY's avatar Ghislain MARY

Add conference interface.

parent 93d9c510
/*
* conference-interface.h
* Copyright (C) 2017 Belledonne Communications SARL
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CONFERENCE_INTERFACE_H_
#define _CONFERENCE_INTERFACE_H_
#include <list>
#include <memory>
#include "address/address.h"
#include "conference/participant.h"
#include "conference/params/call-session-params.h"
// =============================================================================
LINPHONE_BEGIN_NAMESPACE
class ConferenceInterface {
public:
virtual std::shared_ptr<Participant> addParticipant (const Address &addr, const std::shared_ptr<CallSessionParams> params, bool hasMedia) = 0;
virtual void addParticipants (const std::list<const Address> &addresses, const std::shared_ptr<CallSessionParams> params, bool hasMedia) = 0;
virtual const std::string& getId () const = 0;
virtual int getNbParticipants () const = 0;
virtual std::list<std::shared_ptr<Participant>> getParticipants () const = 0;
virtual void removeParticipant (const std::shared_ptr<Participant> participant) = 0;
virtual void removeParticipants (const std::list<const std::shared_ptr<Participant>> participants) = 0;
};
LINPHONE_END_NAMESPACE
#endif // ifndef _CONFERENCE_INTERFACE_H_
......@@ -61,8 +61,10 @@ private:
LinphoneCore *core = nullptr;
CallListener *callListener = nullptr;
std::shared_ptr<Participant> me = nullptr;
std::shared_ptr<Participant> activeParticipant = nullptr;
std::string id;
std::shared_ptr<Participant> me = nullptr;
std::list<std::shared_ptr<Participant>> participants;
L_DECLARE_PUBLIC(Conference);
};
......
......@@ -52,7 +52,7 @@ void ConferencePrivate::callSessionSetTerminated (const CallSession &session) {
callListener->callSetTerminated();
}
void ConferencePrivate::callSessionStateChanged (const CallSession &session, LinphoneCallState state, const std::string &message) {
void ConferencePrivate::callSessionStateChanged (const CallSession &session, LinphoneCallState state, const string &message) {
if (callListener)
callListener->callStateChanged(state, message);
}
......@@ -62,7 +62,7 @@ void ConferencePrivate::incomingCallSessionStarted (const CallSession &session)
callListener->incomingCallStarted();
}
void ConferencePrivate::encryptionChanged (const CallSession &session, bool activated, const std::string &authToken) {
void ConferencePrivate::encryptionChanged (const CallSession &session, bool activated, const string &authToken) {
if (callListener)
callListener->encryptionChanged(activated, authToken);
}
......@@ -109,6 +109,33 @@ shared_ptr<Participant> Conference::addParticipant (const Address &addr, const s
return d->activeParticipant;
}
void Conference::addParticipants (const list<const Address> &addresses, const shared_ptr<CallSessionParams> params, bool hasMedia) {
// TODO
}
const string& Conference::getId () const {
L_D(const Conference);
return d->id;
}
int Conference::getNbParticipants () const {
// TODO
return 1;
}
list<shared_ptr<Participant>> Conference::getParticipants () const {
L_D(const Conference);
return d->participants;
}
void Conference::removeParticipant (const shared_ptr<Participant> participant) {
// TODO
}
void Conference::removeParticipants (const list<const shared_ptr<Participant>> participants) {
// TODO
}
shared_ptr<Participant> Conference::getActiveParticipant () const {
L_D(const Conference);
return d->activeParticipant;
......
......@@ -24,6 +24,7 @@
#include "object/object.h"
#include "address/address.h"
#include "call/call-listener.h"
#include "conference/conference-interface.h"
#include "conference/params/call-session-params.h"
#include "conference/participant.h"
......@@ -36,16 +37,22 @@ LINPHONE_BEGIN_NAMESPACE
class ConferencePrivate;
class CallSessionPrivate;
class Conference : public Object {
class Conference : public Object, public ConferenceInterface {
friend class CallSessionPrivate;
public:
//Conference (CallListener *listener = nullptr);
std::shared_ptr<Participant> addParticipant (const Address &addr, const std::shared_ptr<CallSessionParams> params, bool hasMedia);
std::shared_ptr<Participant> getActiveParticipant () const;
std::shared_ptr<Participant> getMe () const;
/* ConferenceInterface */
virtual std::shared_ptr<Participant> addParticipant (const Address &addr, const std::shared_ptr<CallSessionParams> params, bool hasMedia);
virtual void addParticipants (const std::list<const Address> &addresses, const std::shared_ptr<CallSessionParams> params, bool hasMedia);
virtual const std::string& getId () const;
virtual int getNbParticipants () const;
virtual std::list<std::shared_ptr<Participant>> getParticipants () const;
virtual void removeParticipant (const std::shared_ptr<Participant> participant);
virtual void removeParticipants (const std::list<const std::shared_ptr<Participant>> participants);
protected:
explicit Conference (ConferencePrivate &p, LinphoneCore *core, const Address &myAddress, CallListener *listener = nullptr);
......
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