Commit d64a2ebf authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#1883] Add a simple Conference class

parent fcd3978f
......@@ -27,8 +27,9 @@ sflphoned_SOURCES = \
eventthread.cpp \
sipaccount.cpp \
accountcreator.cpp \
sipvoiplink.cpp \
sipvoiplink.cpp \
call.cpp \
conference.cpp \
account.cpp \
sipcall.cpp \
sdp.cpp \
......@@ -59,7 +60,7 @@ sflphoned_LDFLAGS= -luuid
noinst_LTLIBRARIES = libsflphone.la
noinst_HEADERS = \
voiplink.h \
voiplink.h \
managerimpl.h \
manager.h \
global.h \
......@@ -70,8 +71,9 @@ noinst_HEADERS = \
account.h \
sipaccount.h \
accountcreator.h \
sipvoiplink.h \
sipvoiplink.h \
call.h \
conference.h \
sipcall.h \
sdp.h \
sdpmedia.h \
......
/*
* Copyright (C) 2004-2005 Savoir-Faire Linux inc.
* Copyright (C) 2009 Savoir-Faire Linux inc.
* Author : Alexandre Savard <alexandre.savard@savoirfairelinux.com>
*
*
......
/*
* Copyright (C) 2009 Savoir-Faire Linux inc.
* Author : Alexandre Savard <alexandre.savard@savoirfairelinux.com>
*
*
* 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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "conference.h"
#include "manager.h"
Conference::Conference()
{
_nbParticipant = 0;
}
Conference::~Conference()
{
}
void Conference::add(CallID participant_id)
{
if(_nbParticipant >= 1)
{
ParticipantSet::iterator iter;
for(iter = _participants.begin(); iter != _participants.end(); iter++)
Manager::instance().getAudioDriver()->getMainBuffer()->bindCallID(participant_id, *iter);
}
_participants.insert(participant_id);
_nbParticipant++;
}
void Conference::remove(CallID participant_id)
{
if(_nbParticipant >= 1)
{
ParticipantSet::iterator iter = _participants.begin();
for(iter = _participants.begin(); iter != _participants.end(); iter++)
Manager::instance().getAudioDriver()->getMainBuffer()->bindCallID(participant_id, *iter);
}
_participants.erase(participant_id);
_nbParticipant--;
}
/*
* Copyright (C) 2009 Savoir-Faire Linux inc.
* Author: Alexandre Savard <alexandre.savard@savoirfairelinux.com>
*
* 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, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef CONFERENCE_H
#define CONFERENCE_H
#include <set>
#include "call.h"
#include "manager.h"
#include "audio/audiolayer.h"
typedef std::set<CallID> ParticipantSet;
class Conference{
public:
Conference();
~Conference();
int getNbParticipants() { return _nbParticipant; }
void add(CallID participant_id);
void remove(CallID participant_id);
private:
/** Unique ID of the call */
CallID _id;
ParticipantSet _participants;
int _nbParticipant;
};
#endif
Supports Markdown
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