2 * Copyright (C) Hidenori TAKESHIMA
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include "wine/debug.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
27 /***********************************************************************
28 * AmpFactorToDB (QUARTZ.@)
31 * converting from Amp to dB?
34 LONG WINAPI QUARTZ_AmpFactorToDB( LONG amp )
38 FIXME( "(%08ld): undocumented API.\n", amp );
40 if ( amp <= 0 || amp > 65536 )
43 dB = (LONG)(2000.0 * log10((double)amp / 65536.0) + 0.5);
44 if ( dB >= 0 ) dB = 0;
45 if ( dB < -10000 ) dB = -10000;
50 /***********************************************************************
51 * DBToAmpFactor (QUARTZ.@)
54 * converting from dB to Amp?
56 LONG WINAPI QUARTZ_DBToAmpFactor( LONG dB )
60 FIXME( "(%08ld): undocumented API.\n", dB );
67 amp = (LONG)(pow(10.0,dB / 2000.0) * 65536.0 + 0.5);
68 if ( amp <= 0 ) amp = 1;
69 if ( amp >= 65536 ) amp = 65535;