conference.h 3.7 KB
Newer Older
1
/*
2
 *  Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2011 Savoir-Faire Linux Inc.
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
 *  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.
18
19
20
21
22
23
24
25
26
27
28
 *
 *  Additional permission under GNU GPL version 3 section 7:
 *
 *  If you modify this program, or any covered work, by linking or
 *  combining it with the OpenSSL project's OpenSSL library (or a
 *  modified version of that library), containing parts covered by the
 *  terms of the OpenSSL or SSLeay licenses, Savoir-Faire Linux Inc.
 *  grants you additional permission to convey the resulting work.
 *  Corresponding Source for a non-source form of such a combination
 *  shall include the source code for the parts of OpenSSL used as well
 *  as that of the covered work.
29
30
31
32
33
 */
#ifndef CONFERENCE_H
#define CONFERENCE_H

#include <set>
34
#include <string>
35

36
#include "audio/recordable.h"
37
#include "call.h"
38
39
40
41

// class ManagerImpl;
// class Call;

42
typedef std::set<std::string> ParticipantSet;
43

Julien Bonjean's avatar
Julien Bonjean committed
44
45
class Conference: public Recordable
{
46
47
48

    public:

49
        enum ConferenceState {ACTIVE_ATTACHED, ACTIVE_DETACHED, ACTIVE_ATTACHED_REC, ACTIVE_DETACHED_REC, HOLD, HOLD_REC};
50

51
52
53
        /**
         * Constructor for this class, increment static counter
         */
54
        Conference();
55

56
57
58
        /**
         * Destructor
         */
59
60
        ~Conference();

61
62
63
        /**
         * Return the conference id
         */
64
        std::string getConfID() const {
Julien Bonjean's avatar
Julien Bonjean committed
65
66
            return _id;
        }
67

68
69
70
        /**
         * Return the current conference state
         */
Julien Bonjean's avatar
Julien Bonjean committed
71
        int getState();
72

73
74
75
        /**
         * Set conference state
         */
Julien Bonjean's avatar
Julien Bonjean committed
76
        void setState (ConferenceState state);
77

78
79
80
        /**
         * Return a string description of the conference state
         */
Julien Bonjean's avatar
Julien Bonjean committed
81
        std::string getStateStr();
82

83
84
85
        /**
         * Return the number of participant for this conference
         */
Julien Bonjean's avatar
Julien Bonjean committed
86
87
88
        int getNbParticipants() {
            return _nbParticipant;
        }
89

90
91
92
        /**
         * Add a new participant to the conference
         */
93
        void add (std::string participant_id);
94

95
96
97
        /**
         * Remove a participant from the conference
         */
98
        void remove (std::string participant_id);
99

100
101
102
        /**
         * Bind a participant to the conference
         */
103
        void bindParticipant (std::string participant_id);
104

105
106
107
        /**
         * Get the participant list for this conference
         */
Julien Bonjean's avatar
Julien Bonjean committed
108
        ParticipantSet getParticipantList();
109

110
111
112
        /**
         * Get recording file ID
         */
113
        std::string getRecFileId() const {
Julien Bonjean's avatar
Julien Bonjean committed
114
115
            return getConfID();
        }
116

117
118
119
        /**
         * Start/stop recording toggle
         */
Julien Bonjean's avatar
Julien Bonjean committed
120
        virtual bool setRecording();
121

Julien Bonjean's avatar
Julien Bonjean committed
122
    private:
123

124
125
126
        /**
         * Unique ID of the conference
         */
127
        std::string _id;
128

129
130
131
        /**
         * Conference state
         */
Julien Bonjean's avatar
Julien Bonjean committed
132
        ConferenceState _confState;
133

134
135
136
        /**
         * List of participant ids
         */
137
138
        ParticipantSet _participants;

139
140
141
        /**
         * Number of participant
         */
142
        int _nbParticipant;
143

144
145
146
};

#endif