wxMediaCtrl::SetVolume bug
Vadim Zeitlin
vadim at wxwidgets.org
Tue Oct 2 17:39:25 PDT 2007
On Sun, 30 Sep 2007 16:33:17 -0700 Terry Farnham <TerryF at PipeWorks.Com> wrote:
TF> The function you describe is contained in mediactrl.cpp. When I step
TF> into SetVolume, I get the following two calls.
TF>
TF> wxMediaCtrl::SetVolume (mediactrlcmn.cpp)
TF> wxAMMediaBackend::SetVolume (mediactrl_am.cpp)
TF>
TF> Maybe my build is somehow bad? Is this the path you would expect it to
TF> go down? I am playing an avi file under MSW XP.
I really have no idea about what's going on here... Apparently src/msw/
mediactrl.cpp is not used at all (but why is it present then?).
Anyhow, the question remains:
TF> bool wxAMMediaBackend::SetVolume(double dVolume) {
TF> // pow(10.0, -80.0) to correct 0 == -INF
TF> long lVolume = (long)(2000.0 * log10( pow( 10.0, -80.0) + dVolume )
TF> );
TF> HRESULT hr = GetAM()->put_Volume( lVolume );
TF> if (FAILED(hr))
TF> {
TF> wxAMLOG(hr);
TF> return false;
TF> }
TF>
TF> return true;
TF> }
TF>
TF> Does this version work for you?
If you replace wxAMMediaBackend::SetVolume() in mediactrl_am.cpp with the
version above, does it work for you?
Thanks,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
More information about the wx-users
mailing list