diff --git a/sflphone-common/src/Makefile.am b/sflphone-common/src/Makefile.am index 74cb553b3ece79c0fe0391dbafd697eec87af4c5..581c204f74317046a4b63eb572e1d36d1b306ead 100644 --- a/sflphone-common/src/Makefile.am +++ b/sflphone-common/src/Makefile.am @@ -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 \ diff --git a/sflphone-common/src/audio/mainbuffer.cpp b/sflphone-common/src/audio/mainbuffer.cpp index 9af6b715d0e6bac0810e3db9c43c78e6f91d9f7e..72eaa5fd477171d2ccf326d27d9e9ec2379c20ae 100644 --- a/sflphone-common/src/audio/mainbuffer.cpp +++ b/sflphone-common/src/audio/mainbuffer.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2005 Savoir-Faire Linux inc. + * Copyright (C) 2009 Savoir-Faire Linux inc. * Author : Alexandre Savard <alexandre.savard@savoirfairelinux.com> * * diff --git a/sflphone-common/src/conference.cpp b/sflphone-common/src/conference.cpp new file mode 100644 index 0000000000000000000000000000000000000000..db8e1a348966899e528c6b878805f82590f89cb3 --- /dev/null +++ b/sflphone-common/src/conference.cpp @@ -0,0 +1,70 @@ +/* + * 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--; + +} diff --git a/sflphone-common/src/conference.h b/sflphone-common/src/conference.h new file mode 100644 index 0000000000000000000000000000000000000000..454283ccf4357bf7a4eec470d533435cf9f0d931 --- /dev/null +++ b/sflphone-common/src/conference.h @@ -0,0 +1,54 @@ +/* + * 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