-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per track meter internals #5830
base: master
Are you sure you want to change the base?
Per track meter internals #5830
Conversation
2271159
to
f4680c4
Compare
4cf0c82
to
7780a46
Compare
src/widgets/MeterPanel.cpp
Outdated
@@ -1126,8 +1126,8 @@ void MeterPanel::OnMeterUpdate(wxTimerEvent & WXUNUSED(event)) | |||
|
|||
if (numChanges > 0) { | |||
#ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT | |||
if (gAudioIO->AILAIsActive() && mIsInput && !discarded) { | |||
gAudioIO->AILAProcess(maxPeak); | |||
if (AudioIO::Get()->AILAIsActive() && mIsInput && !discarded) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that the only place EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
should be used in such approach is AILAIsActive
.
src/widgets/MeterPanel.cpp
Outdated
if (gAudioIO->AILAIsActive() && mIsInput && !discarded) { | ||
gAudioIO->AILAProcess(maxPeak); | ||
if (AudioIO::Get()->AILAIsActive() && mIsInput && !discarded) { | ||
AudioIO::Get()->AILAProcess(maxPeak); | ||
putchar('\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this code is disturbing. Why is it here?
This transformation is not quite conservative anyway, so probably this line should be removed?
It seems that AILA logs extensively, probably way to extensively. Is it ready for use at all?
gAudioIO->GetMixer(&inputSource, &inputVolume, &outputVolume); | ||
|
||
auto settings = gAudioIO->GetMixer(); | ||
auto &[inputSource, inputVolume, outputVolume] = settings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the code would be much more readable without this line.
libraries/lib-audio-io/AudioIO.cpp
Outdated
@@ -2376,7 +2377,9 @@ void AudioIO::AILAProcess(double maxPeak) { | |||
|
|||
putchar('\n'); | |||
mAILAMax = pInputMeter ? ToLinearIfDB(mAILAMax, pInputMeter->GetDBRange()) : 0.0; | |||
double iv = (double) Px_GetInputVolume(mPortMixer); | |||
auto settings = audioIO.GetMixer(); | |||
auto &[_, inputVolume, __] = settings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, why?
libraries/lib-audio-io/AudioIO.cpp
Outdated
wxPrintf("\tnew vol:%f\n", vol); | ||
float check = Px_GetInputVolume(mPortMixer); | ||
wxPrintf("\tnew vol:%f\n", inputVolume); | ||
auto [_, check, __] = audioIO.GetMixer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is the weirdest case of structured binding use so far.
} | ||
|
||
double AudioIO::AILAGetLastDecisionTime() { | ||
return mAILAAnalysisEndTime; | ||
} | ||
|
||
double AudioIO::GetClockTime() const { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GetStreamTime
returns stream time specific to Audacity, GetClockTime
- actual stream time. Quite confusing, and I don't understand why is it called "clock" time.
AudioIO::AudioIO() | ||
{ | ||
wxTimer::Start(kTimerInterval.count()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no safety around what kind of duration the kTimerInterval will be. Explicit duration_cast<milliseconds>
would help.
I should have put the big red Experimental label on this bit of holiday hackathon. I didn't ask review yet, but thank you. |
7780a46
to
e3313e1
Compare
Rebased onto latest master. There is much cleanup of AudioIO.cpp that I prepared. It's still not all of the cleanup. Correct inter-thread communication of the stream of most recently played samples is necessary for a per-track meter display that is not meaningless garbage. |
e3313e1
to
e52daee
Compare
49f32f5
to
afbf2f6
Compare
... Don't emit start events until success is known. Only ProjectAudioManager cared, and anyway ignored start events.
5351389
to
f0cfee7
Compare
Resolves: (direct link to the issue)
Depends on
Some of this originated in #5779
Put into AudioIO.cpp all the support needed for per-track meters displaying correct peak and RMS data
(post all adjustments for the effect stack, pan, gain, envelope).
But also other cleanups of AudioIO. Move the experimental automated input level adjustment out, so the Meter
interface needs fewer virtual functions.
Also clean up the publication of events from AudioIO and correct some non-thread-safe message callbacks.
To do: MixerBoard should use this. It doesn't show correct data now in all cases. See #5117
(short description of the changes and the motivation to make the changes)
Recommended: