wxMediaCtrl::SetVolume bug

Terry Farnham TerryF at PipeWorks.Com
Tue Oct 2 18:54:07 PDT 2007


As you requested, I tested this version and an input dVolume=0.0 results
in an lVolume of -16000 which is again outside the range documented by
microsoft (-10000 to 0).  

I agree, there is a bit of strangeness with the various flavors of
mediactrl.  When I first decided to debug, I naively set my breakpoints
in mediactrl.cpp.  The "FIXME FIXME FIXME" in it's comments do, however,
indicate to me that it is under construction.

-----Original Message-----
From: Vadim Zeitlin [mailto:vadim at wxwidgets.org] 
Sent: Tuesday, October 02, 2007 5:39 PM
To: wx-users at lists.wxwidgets.org
Subject: Re[2]: wxMediaCtrl::SetVolume bug

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 
TF> step 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

TF> to 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) + 
TF> dVolume ) );
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/


---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-unsubscribe at lists.wxwidgets.org
For additional commands, e-mail: wx-users-help at lists.wxwidgets.org





More information about the wx-users mailing list