sipxmedialib  Version 3.3
MprBridgeSetGainsMsg.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007 SIPez LLC.
3 // Licensed to SIPfoundry under a Contributor Agreement.
4 //
5 // Copyright (C) 2007 SIPfoundry Inc.
6 // Licensed by SIPfoundry under the LGPL license.
7 //
8 // $$
10 
11 #ifndef _MprBridgeSetGainsMsg_h_
12 #define _MprBridgeSetGainsMsg_h_
13 
14 // SYSTEM INCLUDES
15 
16 // APPLICATION INCLUDES
17 #include "mp/MpResourceMsg.h"
18 #include "mp/MprBridge.h"
19 
20 // DEFINES
21 // MACROS
22 // EXTERNAL FUNCTIONS
23 // EXTERNAL VARIABLES
24 // CONSTANTS
25 // STRUCTS
26 // TYPEDEFS
27 // FORWARD DECLARATIONS
28 
31 {
32 /* //////////////////////////// PUBLIC //////////////////////////////////// */
33 public:
34 
39  };
40 
41 /* ============================ CREATORS ================================== */
43 
44 
46  MprBridgeSetGainsMsg(const UtlString& targetResourceName,
47  int port,
48  int numGains,
49  const MpBridgeGain pGains[],
50  SetGainMsgType type)
51  : MpResourceMsg(MPRM_BRIDGE_SET_GAINS, targetResourceName)
52  , mPort(port)
53  , mGainsNum(numGains)
54  , mpGains(NULL)
55  , mType(type)
56  {
58  memcpy(mpGains, pGains, mGainsNum*sizeof(MpBridgeGain));
59  };
60 
63  : MpResourceMsg(resourceMsg)
64  , mPort(resourceMsg.mPort)
65  , mGainsNum(resourceMsg.mGainsNum)
66  , mpGains(NULL)
67  , mType(resourceMsg.mType)
68  {
70  memcpy(mpGains, resourceMsg.mpGains, mGainsNum*sizeof(MpBridgeGain));
71  };
72 
74  OsMsg* createCopy(void) const
75  {
76  return new MprBridgeSetGainsMsg(*this);
77  }
78 
81  {
82  delete[] mpGains;
83  };
84 
86 
87 /* ============================ MANIPULATORS ============================== */
89 
90 
93  {
94  if(&rhs == this)
95  {
96  return(*this);
97  }
98 
100  mPort = rhs.mPort;
101  mType = rhs.mType;
102 
103  if (rhs.mGainsNum != mGainsNum)
104  {
105  delete[] mpGains;
106 
107  mGainsNum = rhs.mGainsNum;
109  }
110  memcpy(mpGains, rhs.mpGains, mGainsNum*sizeof(MpBridgeGain));
111 
112  return *this;
113  }
114 
116 
117 /* ============================ ACCESSORS ================================= */
119 
120 
121  int getPort() const {return mPort;}
122 
124  int getGainsNum() const {return mGainsNum;}
125 
127  const MpBridgeGain *getGains() const {return mpGains;}
128 
130  SetGainMsgType getType() const {return mType;}
131 
133 
134 /* ============================ INQUIRY =================================== */
136 
137 
139 
140 /* //////////////////////////// PROTECTED ///////////////////////////////// */
141 protected:
142 
143 /* //////////////////////////// PRIVATE /////////////////////////////////// */
144 private:
145  int mPort;
146  int mGainsNum;
150 };
151 
152 /* ============================ INLINE METHODS ============================ */
153 
154 #endif // _MprBridgeSetGainsMsg_h_
MpResourceMsg & operator=(const MpResourceMsg &rhs)
Assignment operator.
Definition: MpResourceMsg.cpp:60
Message object used to communicate with the media processing task.
Definition: MpResourceMsg.h:30
MprBridgeSetGainsMsg & operator=(const MprBridgeSetGainsMsg &rhs)
Assignment operator.
Definition: MprBridgeSetGainsMsg.h:92
int getGainsNum() const
Return number of values in gains array.
Definition: MprBridgeSetGainsMsg.h:124
SetGainMsgType
Set row or column in bridge mix matrix.
Definition: MprBridgeSetGainsMsg.h:36
~MprBridgeSetGainsMsg()
Destructor.
Definition: MprBridgeSetGainsMsg.h:80
int getPort() const
Definition: MprBridgeSetGainsMsg.h:121
const MpBridgeGain * getGains() const
Return pointer to gains array.
Definition: MprBridgeSetGainsMsg.h:127
int mGainsNum
Number of elements in mpGains array.
Definition: MprBridgeSetGainsMsg.h:147
SetGainMsgType mType
Should row or column be set?
Definition: MprBridgeSetGainsMsg.h:149
MprBridge: Set row or column in mix matrix.
Definition: MpResourceMsg.h:46
int mPort
Definition: MprBridgeSetGainsMsg.h:145
MprBridgeSetGainsMsg(const MprBridgeSetGainsMsg &resourceMsg)
Copy constructor.
Definition: MprBridgeSetGainsMsg.h:62
OsMsg * createCopy(void) const
Create a copy of this msg object (which may be of a derived type)
Definition: MprBridgeSetGainsMsg.h:74
SetGainMsgType getType() const
Should row or column be set?
Definition: MprBridgeSetGainsMsg.h:130
float MpBridgeGain
Definition: MpBridgeAlgBase.h:54
Set row in bridge mix matrix.
Definition: MprBridgeSetGainsMsg.h:37
MprBridgeSetGainsMsg(const UtlString &targetResourceName, int port, int numGains, const MpBridgeGain pGains[], SetGainMsgType type)
Constructor.
Definition: MprBridgeSetGainsMsg.h:46
Message used to set gains in bridge mix matrix.
Definition: MprBridgeSetGainsMsg.h:30
Set column in bridge mix matrix.
Definition: MprBridgeSetGainsMsg.h:38
MpBridgeGain * mpGains
Array of gains to set.
Definition: MprBridgeSetGainsMsg.h:148