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 "DistortionEffect.h"
\r
33 using namespace System;
\r
37 namespace DirectSound
\r
39 float DistortionEffect::Gain::get()
\r
41 DSFXDistortion param;
\r
43 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
44 if( RECORD_DSOUND( hr ).IsFailure )
\r
50 void DistortionEffect::Gain::set( float value )
\r
52 DSFXDistortion param;
\r
54 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
55 if( RECORD_DSOUND( hr ).IsFailure )
\r
58 param.fGain = value;
\r
59 hr = InternalPointer->SetAllParameters( ¶m );
\r
60 RECORD_DSOUND( hr );
\r
63 float DistortionEffect::Edge::get()
\r
65 DSFXDistortion param;
\r
67 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
68 if( RECORD_DSOUND( hr ).IsFailure )
\r
74 void DistortionEffect::Edge::set( float value )
\r
76 DSFXDistortion param;
\r
78 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
79 if( RECORD_DSOUND( hr ).IsFailure )
\r
82 param.fEdge = value;
\r
83 hr = InternalPointer->SetAllParameters( ¶m );
\r
84 RECORD_DSOUND( hr );
\r
87 float DistortionEffect::PostEQCenterFrequency::get()
\r
89 DSFXDistortion param;
\r
91 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
92 if( RECORD_DSOUND( hr ).IsFailure )
\r
95 return param.fPostEQCenterFrequency;
\r
98 void DistortionEffect::PostEQCenterFrequency::set( float value )
\r
100 DSFXDistortion param;
\r
102 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
103 if( RECORD_DSOUND( hr ).IsFailure )
\r
106 param.fPostEQCenterFrequency = value;
\r
107 hr = InternalPointer->SetAllParameters( ¶m );
\r
108 RECORD_DSOUND( hr );
\r
111 float DistortionEffect::PostEQBandwidth::get()
\r
113 DSFXDistortion param;
\r
115 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
116 if( RECORD_DSOUND( hr ).IsFailure )
\r
119 return param.fPostEQBandwidth;
\r
122 void DistortionEffect::PostEQBandwidth::set( float value )
\r
124 DSFXDistortion param;
\r
126 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
127 if( RECORD_DSOUND( hr ).IsFailure )
\r
130 param.fPostEQBandwidth = value;
\r
131 hr = InternalPointer->SetAllParameters( ¶m );
\r
132 RECORD_DSOUND( hr );
\r
135 float DistortionEffect::PreLowPassCutoff::get()
\r
137 DSFXDistortion param;
\r
139 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
140 if( RECORD_DSOUND( hr ).IsFailure )
\r
143 return param.fPreLowpassCutoff;
\r
146 void DistortionEffect::PreLowPassCutoff::set( float value )
\r
148 DSFXDistortion param;
\r
150 HRESULT hr = InternalPointer->GetAllParameters( ¶m );
\r
151 if( RECORD_DSOUND( hr ).IsFailure )
\r
154 param.fPreLowpassCutoff = value;
\r
155 hr = InternalPointer->SetAllParameters( ¶m );
\r
156 RECORD_DSOUND( hr );
\r