From: <man...@us...> - 2013-11-17 21:44:55
|
Revision: 3254 http://sourceforge.net/p/modplug/code/3254 Author: manxorist Date: 2013-11-17 21:44:48 +0000 (Sun, 17 Nov 2013) Log Message: ----------- [Ref] sounddev: Also display latency and update interval values in frames in addition to milliseconds. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/sounddev/SoundDevice.h Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-11-17 21:22:42 UTC (rev 3253) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2013-11-17 21:44:48 UTC (rev 3254) @@ -546,11 +546,12 @@ const SoundBufferAttributes bufferAttributes = pMainFrm->gpSoundDevice->GetBufferAttributes(); const double currentLatency = pMainFrm->gpSoundDevice->GetCurrentLatency(); const double currentUpdateInterval = pMainFrm->gpSoundDevice->GetCurrentUpdateInterval(); + const uint32 samplerate = pMainFrm->gpSoundDevice->GetSettings().Samplerate; std::string s; s += mpt::String::Print("Buffer: %1%%\r\n", (bufferAttributes.Latency > 0.0) ? Util::Round<int64>(currentLatency / bufferAttributes.Latency * 100.0) : 0); s += mpt::String::Print("Buffers: %1 (current: %2)\r\n", bufferAttributes.NumBuffers, (currentUpdateInterval > 0.0) ? Util::Round<int64>(bufferAttributes.Latency / currentUpdateInterval) : 0); - s += mpt::String::Print("Latency: %1 ms (current: %2 ms)\r\n", mpt::Format("%4.1f").ToString(bufferAttributes.Latency * 1000.0), mpt::Format("%4.1f").ToString(currentLatency * 1000.0)); - s += mpt::String::Print("Update Interval: %1 ms (current: %2 ms)\r\n", mpt::Format("%4.1f").ToString(bufferAttributes.UpdateInterval * 1000.0), mpt::Format("%4.1f").ToString(currentUpdateInterval * 1000.0)); + s += mpt::String::Print("Latency: %1 ms (current: %2 ms, %3 frames)\r\n", mpt::Format("%4.1f").ToString(bufferAttributes.Latency * 1000.0), mpt::Format("%4.1f").ToString(currentLatency * 1000.0), Util::Round<int64>(currentLatency * samplerate)); + s += mpt::String::Print("Update Interval: %1 ms (current: %2 ms, %3 frames)\r\n", mpt::Format("%4.1f").ToString(bufferAttributes.UpdateInterval * 1000.0), mpt::Format("%4.1f").ToString(currentUpdateInterval * 1000.0), Util::Round<int64>(currentUpdateInterval * samplerate)); m_EditStatistics.SetWindowText(s.c_str()); } else { Modified: trunk/OpenMPT/sounddev/SoundDevice.h =================================================================== --- trunk/OpenMPT/sounddev/SoundDevice.h 2013-11-17 21:22:42 UTC (rev 3253) +++ trunk/OpenMPT/sounddev/SoundDevice.h 2013-11-17 21:44:48 UTC (rev 3254) @@ -305,7 +305,8 @@ bool IsOpen() const { return InternalIsOpen(); } bool IsPlaying() const { return m_IsPlaying; } - SampleFormat GetActualSampleFormat() { return IsOpen() ? m_Settings.sampleFormat : SampleFormatInvalid; } + SoundDeviceSettings GetSettings() const { return m_Settings; } + SampleFormat GetActualSampleFormat() const { return IsOpen() ? m_Settings.sampleFormat : SampleFormatInvalid; } SoundBufferAttributes GetBufferAttributes() const { return m_BufferAttributes; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |