conference.h 3.35 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

38
typedef std::set<std::string> ParticipantSet;
39

40
class Conference: public Recordable {
41
    public:
42
        enum ConferenceState {ACTIVE_ATTACHED, ACTIVE_DETACHED, ACTIVE_ATTACHED_REC, ACTIVE_DETACHED_REC, HOLD, HOLD_REC};
43

44
45
46
        /**
         * Constructor for this class, increment static counter
         */
47
        Conference();
48

49
50
51
        /**
         * Return the conference id
         */
52
        std::string getConfID() const {
Julien Bonjean's avatar
Julien Bonjean committed
53
54
            return _id;
        }
55

56
57
58
        /**
         * Return the current conference state
         */
59
        int getState() const;
60

61
62
63
        /**
         * Set conference state
         */
64
        void setState(ConferenceState state);
65

66
67
68
        /**
         * Return a string description of the conference state
         */
Julien Bonjean's avatar
Julien Bonjean committed
69
        std::string getStateStr();
70

71
72
73
        /**
         * Add a new participant to the conference
         */
74
        void add(const std::string &participant_id);
75

76
77
78
        /**
         * Remove a participant from the conference
         */
79
        void remove(const std::string &participant_id);
80

81
82
83
        /**
         * Bind a participant to the conference
         */
84
        void bindParticipant(const std::string &participant_id);
85

86
87
88
        /**
         * Get the participant list for this conference
         */
89
        ParticipantSet getParticipantList() const;
90

91
92
93
        /**
         * Get recording file ID
         */
94
        std::string getRecFileId() const {
Julien Bonjean's avatar
Julien Bonjean committed
95
96
            return getConfID();
        }
97

98
99
100
        /**
         * Start/stop recording toggle
         */
Julien Bonjean's avatar
Julien Bonjean committed
101
        virtual bool setRecording();
102

Julien Bonjean's avatar
Julien Bonjean committed
103
    private:
104

105
106
107
        /**
         * Unique ID of the conference
         */
108
        std::string _id;
109

110
111
112
        /**
         * Conference state
         */
Julien Bonjean's avatar
Julien Bonjean committed
113
        ConferenceState _confState;
114

115
116
117
        /**
         * List of participant ids
         */
118
119
120
121
        ParticipantSet _participants;
};

#endif