sipxmedialib  Version 3.3
MprSpeexPreProcessConstructor.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2006-2007 SIPfoundry Inc.
3 // Licensed by SIPfoundry under the LGPL license.
4 //
5 // Copyright (C) 2006-2007 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 _MprSpeexPreProcessConstructor_h_
14 #define _MprSpeexPreProcessConstructor_h_
15 
16 // SYSTEM INCLUDES
17 // APPLICATION INCLUDES
19 #include <mp/MprSpeexPreProcess.h>
20 
21 // DEFINES
22 // MACROS
23 // EXTERNAL FUNCTIONS
24 // EXTERNAL VARIABLES
25 // CONSTANTS
26 // STRUCTS
27 // TYPEDEFS
28 // FORWARD DECLARATIONS
29 
36 {
37 /* //////////////////////////// PUBLIC //////////////////////////////////// */
38 public:
39 
40 /* ============================ CREATORS ================================== */
41 
43  MprSpeexPreProcessConstructor(UtlBoolean agc=FALSE, UtlBoolean noiseReduction=FALSE)
45  1, 1, //minInputs, maxInputs,
46  1, 1) //minOutputs, maxOutputs
47  , mAgc(agc)
48  , mNoiseReduction(noiseReduction)
49  {
50  };
51 
54 
55 /* ============================ MANIPULATORS ============================== */
56 
58  virtual OsStatus newResource(const UtlString& resourceName,
59  int maxResourcesToCreate,
60  int& numResourcesCreated,
61  MpResource* resourceArray[])
62  {
63  assert(maxResourcesToCreate >= 1);
64  numResourcesCreated = 1;
65  MprSpeexPreprocess *pPreprocess = new MprSpeexPreprocess(resourceName);
66  pPreprocess->setAGC(mAgc);
67  pPreprocess->setNoiseReduction(mNoiseReduction);
68  resourceArray[0] = pPreprocess;
69  resourceArray[0]->enable();
70  return(OS_SUCCESS);
71  }
72 
73 /* ============================ ACCESSORS ================================= */
74 
75 /* ============================ INQUIRY =================================== */
76 
77 /* //////////////////////////// PROTECTED ///////////////////////////////// */
78 protected:
79 
80  UtlBoolean mAgc;
81  UtlBoolean mNoiseReduction;
82 
83 /* //////////////////////////// PRIVATE /////////////////////////////////// */
84 private:
85 
87  MprSpeexPreProcessConstructor(const MprSpeexPreProcessConstructor& rMprSpeexPreProcessConstructor);
88 
89 
92 
93 };
94 
95 /* ============================ INLINE METHODS ============================ */
96 
97 #endif // _MprSpeexPreProcessConstructor_h_
MprSpeexPreProcessConstructor(UtlBoolean agc=FALSE, UtlBoolean noiseReduction=FALSE)
Constructor.
Definition: MprSpeexPreProcessConstructor.h:43
MprSpeexPreProcessConstructor is used to construct a SpeexPreProcess resource.
Definition: MprSpeexPreProcessConstructor.h:35
virtual ~MprSpeexPreProcessConstructor()
Destructor.
Definition: MprSpeexPreProcessConstructor.h:53
UtlBoolean mAgc
Is AGC enabled by default?
Definition: MprSpeexPreProcessConstructor.h:80
virtual OsStatus newResource(const UtlString &resourceName, int maxResourcesToCreate, int &numResourcesCreated, MpResource *resourceArray[])
Create a new resource.
Definition: MprSpeexPreProcessConstructor.h:58
UtlBoolean setNoiseReduction(UtlBoolean enable)
Enable or disable noise reduction.
The "Speex Audio Preprocessor" media processing resource.
Definition: MprSpeexPreProcess.h:42
virtual UtlBoolean enable()
Enable this resource.
Definition: MpResource.cpp:145
UtlBoolean setAGC(UtlBoolean enable)
Enable or disable Automatic Gain Control.
MprSpeexPreProcessConstructor & operator=(const MprSpeexPreProcessConstructor &rhs)
Disable assignment operator.
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
#define FALSE
Definition: PlgDefsV1.h:37
#define DEFAULT_SPEEX_PREPROCESS_RESOURCE_TYPE
Definition: MpResourceFactory.h:26
UtlBoolean mNoiseReduction
Is noise reduction enabled by default?
Definition: MprSpeexPreProcessConstructor.h:81