conference.h 3.07 KB
Newer Older
1
/*
2
 *  Copyright (C) 2004-2019 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
18
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301 USA.
19 20 21 22
 */
#ifndef CONFERENCE_H
#define CONFERENCE_H

23 24 25 26
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

27
#include <set>
28
#include <string>
29
#include <memory>
30
#include <vector>
31

32
#include "recordable.h"
33

Adrien Béraud's avatar
Adrien Béraud committed
34
namespace jami {
35

Adrien Béraud's avatar
Adrien Béraud committed
36
#ifdef ENABLE_VIDEO
37 38 39
namespace video {
class VideoMixer;
}
40 41
#endif

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

44
class Conference : public Recordable {
45
    public:
46
        enum ConferenceState {ACTIVE_ATTACHED, ACTIVE_DETACHED, ACTIVE_ATTACHED_REC, ACTIVE_DETACHED_REC, HOLD, HOLD_REC};
47

48 49 50
        /**
         * Constructor for this class, increment static counter
         */
51
        Conference();
52

53 54 55 56 57
        /**
         * Destructor for this class, decrement static counter
         */
        ~Conference();

58 59 60
        /**
         * Return the conference id
         */
61
        std::string getConfID() const;
62

63 64 65
        /**
         * Return the current conference state
         */
66
        ConferenceState getState() const;
67

68 69 70
        /**
         * Set conference state
         */
71
        void setState(ConferenceState state);
72

73 74 75
        /**
         * Return a string description of the conference state
         */
76
        std::string getStateStr() const;
77

78 79 80
        /**
         * Add a new participant to the conference
         */
81
        void add(const std::string &participant_id);
82

83 84 85
        /**
         * Remove a participant from the conference
         */
86
        void remove(const std::string &participant_id);
87

88 89 90
        /**
         * Bind a participant to the conference
         */
91
        void bindParticipant(const std::string &participant_id);
92

93 94 95
        /**
         * Get the participant list for this conference
         */
Adrien Béraud's avatar
Adrien Béraud committed
96
        const ParticipantSet& getParticipantList() const;
97

98 99 100 101 102 103
        /**
         * Get the display names or peer numbers for this conference
         */
        std::vector<std::string>
        getDisplayNames() const;

104 105 106
        /**
         * Start/stop recording toggle
         */
107
        virtual bool toggleRecording();
108

Adrien Béraud's avatar
Adrien Béraud committed
109
#ifdef ENABLE_VIDEO
110
        std::shared_ptr<video::VideoMixer> getVideoMixer();
111 112
#endif

Julien Bonjean's avatar
Julien Bonjean committed
113
    private:
114 115 116
        std::string id_;
        ConferenceState confState_;
        ParticipantSet participants_;
117

Adrien Béraud's avatar
Adrien Béraud committed
118
#ifdef ENABLE_VIDEO
119
        std::shared_ptr<video::VideoMixer> videoMixer_;
120
#endif
121 122
};

Adrien Béraud's avatar
Adrien Béraud committed
123
} // namespace jami
124

125
#endif