3 * Copyright (c) 2007-2010 SlimDX Group
\r
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
\r
6 * of this software and associated documentation files (the "Software"), to deal
\r
7 * in the Software without restriction, including without limitation the rights
\r
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
\r
9 * copies of the Software, and to permit persons to whom the Software is
\r
10 * furnished to do so, subject to the following conditions:
\r
12 * The above copyright notice and this permission notice shall be included in
\r
13 * all copies or substantial portions of the Software.
\r
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
\r
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
\r
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
\r
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
\r
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
\r
23 #include <windows.h>
\r
26 #include "../ComObject.h"
\r
28 #include "DirectSoundException.h"
\r
31 #include "AcousticEchoCancel.h"
\r
33 using namespace System;
\r
37 namespace DirectSound
\r
39 Result AcousticEchoCancel::Reset()
\r
41 HRESULT hr = InternalPointer->Reset();
\r
42 return RECORD_DSOUND( hr );
\r
45 bool AcousticEchoCancel::Enabled::get()
\r
49 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
50 if( RECORD_DSOUND( hr ).IsFailure )
\r
53 return param.fEnable == TRUE;
\r
56 void AcousticEchoCancel::Enabled::set( bool value )
\r
60 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
61 if( RECORD_DSOUND( hr ).IsFailure )
\r
64 param.fEnable = value;
\r
65 hr = InternalPointer->SetAllParameters( ¶m );
\r
66 RECORD_DSOUND( hr );
\r
69 bool AcousticEchoCancel::NoiseFill::get()
\r
73 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
74 if( RECORD_DSOUND( hr ).IsFailure )
\r
77 return param.fNoiseFill == TRUE;
\r
80 void AcousticEchoCancel::NoiseFill::set( bool value )
\r
84 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
85 if( RECORD_DSOUND( hr ).IsFailure )
\r
88 param.fNoiseFill = value;
\r
89 hr = InternalPointer->SetAllParameters( ¶m );
\r
90 RECORD_DSOUND( hr );
\r
93 AcousticEchoCancelMode AcousticEchoCancel::Mode::get()
\r
97 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
98 if( RECORD_DSOUND( hr ).IsFailure )
\r
99 return AcousticEchoCancelMode::PassThrough;
\r
101 return static_cast<AcousticEchoCancelMode>( param.dwMode );
\r
104 void AcousticEchoCancel::Mode::set( AcousticEchoCancelMode value )
\r
108 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
109 if( RECORD_DSOUND( hr ).IsFailure )
\r
112 param.dwMode = static_cast<DWORD>( value );
\r
113 hr = InternalPointer->SetAllParameters( ¶m );
\r
114 RECORD_DSOUND( hr );
\r
117 bool AcousticEchoCancel::Uninitialized::get()
\r
120 HRESULT hr = InternalPointer->GetStatus( &status );
\r
121 RECORD_DSOUND( hr );
\r
123 return ( status & DSCFX_AEC_STATUS_HISTORY_UNINITIALIZED ) != 0;
\r
126 bool AcousticEchoCancel::ContinuouslyConverged::get()
\r
129 HRESULT hr = InternalPointer->GetStatus( &status );
\r
130 RECORD_DSOUND( hr );
\r
132 return ( status & DSCFX_AEC_STATUS_HISTORY_CONTINUOUSLY_CONVERGED ) != 0;
\r
135 bool AcousticEchoCancel::CurrentlyConverged::get()
\r
138 HRESULT hr = InternalPointer->GetStatus( &status );
\r
139 RECORD_DSOUND( hr );
\r
141 return ( status & DSCFX_AEC_STATUS_CURRENTLY_CONVERGED ) != 0;
\r
144 bool AcousticEchoCancel::PreviouslyDiverged::get()
\r
147 HRESULT hr = InternalPointer->GetStatus( &status );
\r
148 RECORD_DSOUND( hr );
\r
150 return ( status & DSCFX_AEC_STATUS_HISTORY_PREVIOUSLY_DIVERGED ) != 0;
\r