Update of /cvsroot/audacity/audacity-src/src/toolbars In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv15712
Modified Files: SelectionBar.cpp Log Message: Fix Project Rate editing and update issues. Index: SelectionBar.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/toolbars/SelectionBar.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- SelectionBar.cpp 6 Apr 2008 16:16:31 -0000 1.22 +++ SelectionBar.cpp 7 May 2008 02:27:09 -0000 1.23 @@ -449,11 +449,21 @@ void SelectionBar::OnRate(wxCommandEvent & WXUNUSED(event)) { - mRateBox->GetStringSelection().ToDouble(&mRate); - if (mRate != 0.0 && mLeftTime) mLeftTime->SetSampleRate(mRate); - if (mRate != 0.0 && mRightTime) mRightTime->SetSampleRate(mRate); - if (mRate != 0.0 && mAudioTime) mAudioTime->SetSampleRate(mRate); - if (mRate != 0.0 && mListener) mListener->AS_SetRate(mRate); + int nSel = mRateBox->GetSelection(); + wxString sValue; + if (nSel != -1) // one of the existing choices + sValue = mRateBox->GetString(nSel); + else + sValue = mRateBox->GetValue(); + + if (sValue.ToDouble(&mRate) && // is a numeric value + (mRate != 0.0)) + { + if (mLeftTime) mLeftTime->SetSampleRate(mRate); + if (mRightTime) mRightTime->SetSampleRate(mRate); + if (mAudioTime) mAudioTime->SetSampleRate(mRate); + if (mListener) mListener->AS_SetRate(mRate); + } } void SelectionBar::UpdateRates() @@ -504,7 +514,8 @@ return; } - event.Skip(); + // Swallow any others, so SelectionBar "handled" it. + // event.Skip(); return; } ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone _______________________________________________ Audacity-cvs mailing list Audacity-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/audacity-cvs