sipxmedialib  Version 3.3
MprSpeakerSelectorConstructor.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2008 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2008 SIPez LLC.
6 // Licensed to SIPfoundry under a Contributor Agreement.
7 //
8 // $$
10 
11 // Author: Alexander Chemeris <Alexander DOT Chemeris AT SIPez DOT com>
12 
13 #ifndef _MprSpeakerSelectorConstructor_h_
14 #define _MprSpeakerSelectorConstructor_h_
15 
16 // SYSTEM INCLUDES
17 // APPLICATION INCLUDES
19 #include <mp/MprSpeakerSelector.h>
20 
21 // DEFINES
23 #define DEFAULT_SPEAKER_SELECTOR_MAX_INPUTS 20
24 #define DEFAULT_SPEAKER_SELECTOR_MAX_OUTPUTS 6
28 #define DEFAULT_SPEAKER_SELECTOR_MAX_SPEAKERS 3
30 
31 // MACROS
32 // EXTERNAL FUNCTIONS
33 // EXTERNAL VARIABLES
34 // CONSTANTS
35 // STRUCTS
36 // TYPEDEFS
37 // FORWARD DECLARATIONS
38 
43 {
44 /* //////////////////////////// PUBLIC //////////////////////////////////// */
45 public:
46 
47 /* ============================ CREATORS ================================== */
48 
51  int maxOutputs = DEFAULT_SPEAKER_SELECTOR_MAX_OUTPUTS,
52  int maxActiveSpeakers = DEFAULT_SPEAKER_SELECTOR_MAX_SPEAKERS)
54  1, maxInputs, //minInputs, maxInputs,
55  1, maxOutputs) //minOutputs, maxOutputs
56  , mMaxActiveSpeakers(maxActiveSpeakers)
57  {
58  }
59 
62 
63 /* ============================ MANIPULATORS ============================== */
64 
66  virtual OsStatus newResource(const UtlString& resourceName,
67  int maxResourcesToCreate,
68  int& numResourcesCreated,
69  MpResource* resourceArray[])
70  {
71  MprSpeakerSelector *pResource = new MprSpeakerSelector(resourceName,
72  mMaxInputs,
75 
76  // Return created resource
77  assert(maxResourcesToCreate >= 1);
78  numResourcesCreated = 1;
79  resourceArray[0] = pResource;
80  resourceArray[0]->enable();
81 
82  return OS_SUCCESS;
83  }
84 
85 /* ============================ ACCESSORS ================================= */
86 
87 /* ============================ INQUIRY =================================== */
88 
89 /* //////////////////////////// PROTECTED ///////////////////////////////// */
90 protected:
91 
93 
94 /* //////////////////////////// PRIVATE /////////////////////////////////// */
95 private:
96 
98  MprSpeakerSelectorConstructor(const MprSpeakerSelectorConstructor& rMprSpeakerSelectorConstructor);
99 
102 
103 };
104 
105 /* ============================ INLINE METHODS ============================ */
106 
107 #endif // _MprSpeakerSelectorConstructor_h_
MprSpeakerSelectorConstructor & operator=(const MprSpeakerSelectorConstructor &rhs)
Disabled assignment operator.
#define DEFAULT_SPEAKER_SELECTOR_MAX_OUTPUTS
Number of Speaker Selector outputs. Must be less or equal then number of inputs in the Bridge minus n...
Definition: MprSpeakerSelectorConstructor.h:27
MprSpeakerSelectorConstructor is used to construct Speaker Selector resource.
Definition: MprSpeakerSelectorConstructor.h:42
MprSpeakerSelectorConstructor(int maxInputs=DEFAULT_SPEAKER_SELECTOR_MAX_INPUTS, int maxOutputs=DEFAULT_SPEAKER_SELECTOR_MAX_OUTPUTS, int maxActiveSpeakers=DEFAULT_SPEAKER_SELECTOR_MAX_SPEAKERS)
Constructor.
Definition: MprSpeakerSelectorConstructor.h:50
#define DEFAULT_SPEAKER_SELECTOR_MAX_INPUTS
Number of Speaker Selector inputs.
Definition: MprSpeakerSelectorConstructor.h:23
#define DEFAULT_SPEAKER_SELECTOR_RESOURCE_TYPE
Definition: MpResourceFactory.h:40
The Speaker Selection resource.
Definition: MprSpeakerSelector.h:35
int mMaxActiveSpeakers
Number of speakers we want to mix.
Definition: MprSpeakerSelectorConstructor.h:92
int mMaxInputs
Definition: MpResourceConstructor.h:92
virtual UtlBoolean enable()
Enable this resource.
Definition: MpResource.cpp:145
#define DEFAULT_SPEAKER_SELECTOR_MAX_SPEAKERS
Maximum number of speakers we want to mix.
Definition: MprSpeakerSelectorConstructor.h:29
int mMaxOutputs
Definition: MpResourceConstructor.h:94
virtual ~MprSpeakerSelectorConstructor()
Destructor.
Definition: MprSpeakerSelectorConstructor.h:61
Abstract base class for all media processing objects.
Definition: MpResource.h:56
MpAudioResourceConstructor is used to construct a specific audio resource type.
Definition: MpAudioResourceConstructor.h:36
virtual OsStatus newResource(const UtlString &resourceName, int maxResourcesToCreate, int &numResourcesCreated, MpResource *resourceArray[])
Create a new resource.
Definition: MprSpeakerSelectorConstructor.h:66