~ubuntu-branches/ubuntu/saucy/resiprocate/saucy-proposed

« back to all changes in this revision

Viewing changes to resip/recon/Conversation.hxx

  • Committer: Package Import Robot
  • Author(s): Daniel Pocock
  • Date: 2012-05-17 19:29:59 UTC
  • Revision ID: package-import@ubuntu.com-20120517192959-vv00m77isztdy64q
Tags: upstream-1.8.2
ImportĀ upstreamĀ versionĀ 1.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#if !defined(Conversation_hxx)
 
2
#define Conversation_hxx
 
3
 
 
4
#include "ConversationManager.hxx"
 
5
#include "ConversationParticipantAssignment.hxx"
 
6
 
 
7
namespace recon
 
8
{
 
9
class Participant;
 
10
class LocalParticipant;
 
11
class RemoteParticipant;
 
12
class RelatedConversationSet;
 
13
class BridgeMixer;
 
14
 
 
15
/**
 
16
  This class is used to manage membership of participants.
 
17
 
 
18
  Conversations are used to designate the audio properties
 
19
  between a number of managed participants.  By default all
 
20
  participants in a Conversation can talk to and hear all 
 
21
  other participants.  A modified participants contribution 
 
22
  setting to a conversation can change this.
 
23
 
 
24
  If a remote participant is a sole member in a conversation, 
 
25
  then he/she will be put on hold.
 
26
 
 
27
  Author: Scott Godin (sgodin AT SipSpectrum DOT com)
 
28
*/
 
29
 
 
30
class Conversation 
 
31
{
 
32
public:  
 
33
   Conversation(ConversationHandle handle, 
 
34
                ConversationManager& conversationManager,
 
35
                RelatedConversationSet* relatedConversationSet=0,  // Pass NULL to create new RelatedConversationSet 
 
36
                bool broadcastOnly = false);   
 
37
   ~Conversation();
 
38
 
 
39
   void addParticipant(Participant* participant, unsigned int inputGain = 100, unsigned int outputGain = 100);
 
40
   void removeParticipant(Participant* participant);
 
41
   void modifyParticipantContribution(Participant* participant, unsigned int inputGain, unsigned int outputGain);
 
42
 
 
43
   unsigned int getNumLocalParticipants() { return mNumLocalParticipants; }
 
44
   unsigned int getNumRemoteParticipants() { return mNumRemoteParticipants; }
 
45
   bool shouldHold();
 
46
   bool broadcastOnly();
 
47
   void notifyRemoteParticipantsOfHoldChange();
 
48
 
 
49
   void createRelatedConversation(RemoteParticipant* newForkedParticipant, ParticipantHandle origParticipantHandle);
 
50
   void join(Conversation* conversation);  // move all non-duplicate participants from this conversation to passed in conversation and destroy this one
 
51
 
 
52
   void destroy();
 
53
 
 
54
   ConversationHandle getHandle() { return mHandle; }
 
55
 
 
56
   void notifyMediaEvent(int mediaConnectionId, MediaEvent::MediaEventType eventType);
 
57
   void notifyDtmfEvent(int mediaConnectionId, int dtmf, int duration, bool up);
 
58
 
 
59
protected:
 
60
   friend class Participant;
 
61
   friend class LocalParticipant;
 
62
   friend class RemoteParticipant;
 
63
   friend class MediaResourceParticipant;
 
64
   void registerParticipant(Participant *, unsigned int inputGain=100, unsigned int outputGain=100);
 
65
   void unregisterParticipant(Participant *);
 
66
 
 
67
   friend class BridgeMixer;
 
68
   typedef std::map<ParticipantHandle, ConversationParticipantAssignment> ParticipantMap;
 
69
   ParticipantMap& getParticipants() { return mParticipants; }  
 
70
 
 
71
   resip::SharedPtr<MediaInterface> getMediaInterface() const { assert(mMediaInterface); return mMediaInterface; }
 
72
 
 
73
private: 
 
74
   ConversationHandle mHandle;
 
75
   ConversationManager& mConversationManager;
 
76
   RelatedConversationSet *mRelatedConversationSet;
 
77
 
 
78
   ParticipantMap mParticipants;
 
79
   Participant* getParticipant(ParticipantHandle partHandle);
 
80
   bool mDestroying;
 
81
   unsigned int mNumLocalParticipants;
 
82
   unsigned int mNumRemoteParticipants;
 
83
   unsigned int mNumMediaParticipants;
 
84
   bool mBroadcastOnly;
 
85
 
 
86
   // sipX Media related members
 
87
   BridgeMixer* getBridgeMixer() { return mBridgeMixer; }
 
88
   resip::SharedPtr<MediaInterface> mMediaInterface;  
 
89
   BridgeMixer* mBridgeMixer;
 
90
};
 
91
 
 
92
}
 
93
 
 
94
#endif
 
95
 
 
96
 
 
97
/* ====================================================================
 
98
 
 
99
 Copyright (c) 2007-2008, Plantronics, Inc.
 
100
 All rights reserved.
 
101
 
 
102
 Redistribution and use in source and binary forms, with or without
 
103
 modification, are permitted provided that the following conditions are 
 
104
 met:
 
105
 
 
106
 1. Redistributions of source code must retain the above copyright 
 
107
    notice, this list of conditions and the following disclaimer. 
 
108
 
 
109
 2. Redistributions in binary form must reproduce the above copyright
 
110
    notice, this list of conditions and the following disclaimer in the
 
111
    documentation and/or other materials provided with the distribution. 
 
112
 
 
113
 3. Neither the name of Plantronics nor the names of its contributors 
 
114
    may be used to endorse or promote products derived from this 
 
115
    software without specific prior written permission. 
 
116
 
 
117
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
 
118
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
 
119
 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 
 
120
 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
 
121
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
 
122
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
 
123
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
 
124
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 
 
125
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
 
126
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
 
127
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
128
 
 
129
 ==================================================================== */