1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 16:48:44 +02:00

Steve's fix for bug/enhancement 74.

This commit is contained in:
martynshaw99 2013-03-17 23:33:28 +00:00
parent bcff3a8a86
commit b04c7f18a7
3 changed files with 16 additions and 5 deletions

View File

@ -123,7 +123,6 @@ void MixerToolBar::Populate()
this); this);
// Show or hide the input slider based on whether it works // Show or hide the input slider based on whether it works
mInputSlider->Enable(gAudioIO->InputMixerWorks()); mInputSlider->Enable(gAudioIO->InputMixerWorks());
SetToolTips();
UpdateControls(); UpdateControls();
@ -181,7 +180,6 @@ void MixerToolBar::UpdatePrefs()
// Show or hide the input slider based on whether it works // Show or hide the input slider based on whether it works
mInputSlider->Enable(gAudioIO->InputMixerWorks()); mInputSlider->Enable(gAudioIO->InputMixerWorks());
SetToolTips();
// Layout the toolbar // Layout the toolbar
Layout(); Layout();
@ -218,10 +216,14 @@ void MixerToolBar::UpdateControls()
if (mOutputSlider->Get() != playbackVolume) { if (mOutputSlider->Get() != playbackVolume) {
mOutputSlider->Set(playbackVolume); mOutputSlider->Set(playbackVolume);
mOutputSliderVolume = playbackVolume;
SetToolTips();
} }
if (mInputSlider->Get() != inputVolume) { if (mInputSlider->Get() != inputVolume) {
mInputSlider->Set(inputVolume); mInputSlider->Set(inputVolume);
mInputSliderVolume = inputVolume;
SetToolTips();
} }
#endif // USE_PORTMIXER #endif // USE_PORTMIXER
} }
@ -236,6 +238,9 @@ void MixerToolBar::SetMixer(wxCommandEvent &event)
gAudioIO->GetMixer(&inputSource, &oldIn, &oldOut); gAudioIO->GetMixer(&inputSource, &oldIn, &oldOut);
gAudioIO->SetMixer(inputSource, inputVolume, outputVolume); gAudioIO->SetMixer(inputSource, inputVolume, outputVolume);
mOutputSliderVolume = outputVolume;
mInputSliderVolume = inputVolume;
SetToolTips();
#endif // USE_PORTMIXER #endif // USE_PORTMIXER
} }
@ -285,7 +290,8 @@ void MixerToolBar::SetToolTips()
{ {
#if wxUSE_TOOLTIPS #if wxUSE_TOOLTIPS
if (mInputSlider->IsEnabled()) { if (mInputSlider->IsEnabled()) {
mInputSlider->SetToolTip(_("Input Volume")); mInputSlider->SetToolTip(wxString::Format(
_("Input Volume: %.2f"), mInputSliderVolume));
} }
else { else {
mInputSlider->SetToolTip( mInputSlider->SetToolTip(
@ -293,7 +299,8 @@ void MixerToolBar::SetToolTips()
} }
if (mOutputSlider->IsEnabled()) { if (mOutputSlider->IsEnabled()) {
mOutputSlider->SetToolTip(_("Output Volume")); mOutputSlider->SetToolTip(wxString::Format(
_("Output Volume: %.2f"), mOutputSliderVolume));
} }
else { else {
mOutputSlider->SetToolTip( mOutputSlider->SetToolTip(

View File

@ -50,6 +50,10 @@ class MixerToolBar:public ToolBar {
void AdjustOutputGain(int adj); void AdjustOutputGain(int adj);
void AdjustInputGain(int adj); void AdjustInputGain(int adj);
protected:
float mInputSliderVolume;
float mOutputSliderVolume;
private: private:
void InitializeMixerToolBar(); void InitializeMixerToolBar();

View File

@ -897,7 +897,7 @@ void LWSlider::FormatPopWin()
switch(mStyle) { switch(mStyle) {
case FRAC_SLIDER: case FRAC_SLIDER:
label.Printf(wxT("%s: %.1f"), mName.c_str(), mCurrentValue); label.Printf(wxT("%s: %.2f"), mName.c_str(), mCurrentValue);
break; break;
case DB_SLIDER: case DB_SLIDER: