Skip to content
Snippets Groups Projects
Commit d64a2ebf authored by Alexandre Savard's avatar Alexandre Savard
Browse files

[#1883] Add a simple Conference class

parent fcd3978f
Branches
Tags
No related merge requests found
...@@ -29,6 +29,7 @@ sflphoned_SOURCES = \ ...@@ -29,6 +29,7 @@ sflphoned_SOURCES = \
accountcreator.cpp \ accountcreator.cpp \
sipvoiplink.cpp \ sipvoiplink.cpp \
call.cpp \ call.cpp \
conference.cpp \
account.cpp \ account.cpp \
sipcall.cpp \ sipcall.cpp \
sdp.cpp \ sdp.cpp \
...@@ -72,6 +73,7 @@ noinst_HEADERS = \ ...@@ -72,6 +73,7 @@ noinst_HEADERS = \
accountcreator.h \ accountcreator.h \
sipvoiplink.h \ sipvoiplink.h \
call.h \ call.h \
conference.h \
sipcall.h \ sipcall.h \
sdp.h \ sdp.h \
sdpmedia.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> * 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment