sipxmediaadapterlib  Version 3.3
MiNotification.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2007-2021 SIPez LLC. All rights reserved.
3 //
4 // $$
6 
7 // Author: Keith Kyzivat <kkyzivat AT SIPez DOT com>
8 
9 #ifndef _MiNotification_h_
10 #define _MiNotification_h_
11 
12 // SYSTEM INCLUDES
13 
14 // APPLICATION INCLUDES
15 #include "os/OsMsg.h"
16 #include "utl/UtlString.h"
17 
18 // DEFINES
19 // MACROS
20 // EXTERNAL FUNCTIONS
21 // EXTERNAL VARIABLES
22 // CONSTANTS
23 // STRUCTS
24 // TYPEDEFS
25 // FORWARD DECLARATIONS
26 
42 class MiNotification : public OsMsg
43 {
44  /* //////////////////////////// PUBLIC //////////////////////////////////// */
45 public:
46 
48  typedef enum
49  {
51 
82  } NotfType;
83 
85  static const int INVALID_CONNECTION_ID;
86 
87  /* ============================ CREATORS ================================== */
89 
90 
92  MiNotification(NotfType msgType,
93  const UtlString& sourceId,
94  int connectionId = INVALID_CONNECTION_ID,
95  int streamId = -1);
96 
98  MiNotification(const MiNotification& rNotf);
99 
101  virtual OsMsg* createCopy(void) const;
102 
104  virtual ~MiNotification();
105 
107 
108  /* ============================ MANIPULATORS ============================== */
110 
111 
114 
116  void setSourceId(const UtlString& sourceId);
122  void setConnectionId(int connId);
124 
127  void setStreamId(int streamId);
128 
130 
131  /* ============================ ACCESSORS ================================= */
133 
134 
136  NotfType getType(void) const;
137 
139  UtlString getSourceId(void) const;
145  int getConnectionId() const;
147 
150  int getStreamId() const;
151 
153 
154  /* ============================ INQUIRY =================================== */
156 
157 
159 
160  /* //////////////////////////// PROTECTED ///////////////////////////////// */
161 protected:
162 
163  /* //////////////////////////// PRIVATE /////////////////////////////////// */
164 private:
165  UtlString mSourceId;
167  int mStreamId;
169 };
171 
172 /* ============================ INLINE METHODS ============================ */
173 
174 #endif // _MiNotification_h_
void setSourceId(const UtlString &sourceId)
Set the unique source identifier.
Definition: MiNotification.cpp:83
NotfType
Media notification message types.
Definition: MiNotification.h:48
Definition: MiNotification.h:55
Definition: MiNotification.h:68
Recording started.
Definition: MiNotification.h:59
void setStreamId(int streamId)
Set the stream number inside the connection this notification is associated with. ...
Definition: MiNotification.cpp:94
Recording paused after starting or resumed (MiIntNotf bears number of recorded samples thus far)...
Definition: MiNotification.h:60
NotfType getType(void) const
Returns the type of the notification message.
Definition: MiNotification.cpp:102
Value for MiRtpStreamActivityNotf notifications.
Definition: MiNotification.h:69
Definition: MiNotification.h:53
Definition: MiNotification.h:76
Audio energy level (MiIntNotf)
Definition: MiNotification.h:70
Definition: MiNotification.h:72
Definition: MiNotification.h:52
Recording resumed after being paused.
Definition: MiNotification.h:61
Message notification class used to communicate media notification events.
Definition: MiNotification.h:42
Definition: MiNotification.h:66
virtual OsMsg * createCopy(void) const
Create a copy of this msg object (which may be of a derived type)
Definition: MiNotification.cpp:54
Definition: MiNotification.h:56
Recording stopped automatically (MiIntNotf bears number of recorded samples).
Definition: MiNotification.h:63
Definition: MiNotification.h:73
Message type is invalid (similar to NULL)
Definition: MiNotification.h:50
virtual ~MiNotification()
Destructor.
Definition: MiNotification.cpp:60
Definition: MiNotification.h:74
static const int INVALID_CONNECTION_ID
Connection ID that indicates invalid connection or no connection.
Definition: MiNotification.h:85
Value for MiProgressNotf notifications.
Definition: MiNotification.h:58
void setConnectionId(int connId)
Set the connection ID that this notification is associated with.
Definition: MiNotification.cpp:89
Definition: MiNotification.h:75
Definition: MiNotification.h:57
int getStreamId() const
Get the stream number inside the connection this notification is associated with. ...
Definition: MiNotification.cpp:119
Recording stopped manually (MiIntNotf bears number of recorded samples).
Definition: MiNotification.h:62
MiNotification(NotfType msgType, const UtlString &sourceId, int connectionId=INVALID_CONNECTION_ID, int streamId=-1)
Constructor.
Definition: MiNotification.cpp:33
Definition: MiNotification.h:54
Definition: MiNotification.h:67
int mConnectionId
Definition: MiNotification.h:166
int getConnectionId() const
Get the connection ID that this message is associated with.
Definition: MiNotification.cpp:114
UtlString getSourceId(void) const
Get the unique source identifier.
Definition: MiNotification.cpp:108
Recording stopped because of an error.
Definition: MiNotification.h:64
UtlString mSourceId
Unique identifier of the thing that originated this notification.
Definition: MiNotification.h:165
int mStreamId
Definition: MiNotification.h:168
Value for MiDtmfNotf notifications.
Definition: MiNotification.h:65
Definition: MiNotification.h:71
MiNotification & operator=(const MiNotification &rhs)
Assignment operator.
Definition: MiNotification.cpp:69