Update of /cvsroot/audacity/audacity-src/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv6433
Modified Files: MixerBoard.cpp Log Message: Another layout revision: * Put all controls but track name and gain slider in right side stack. * Moved Mute/Solo back to near Pan slider. Index: MixerBoard.cpp =================================================================== RCS file: /cvsroot/audacity/audacity-src/src/MixerBoard.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- MixerBoard.cpp 21 Aug 2009 23:09:35 -0000 1.20 +++ MixerBoard.cpp 31 Aug 2009 01:20:11 -0000 1.21 @@ -81,9 +81,8 @@ #define PAN_HEIGHT 24 #define kLeftSideStackWidth MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH - kDoubleInset //vvvvv Change when numbers shown on slider scale. -#define kRightSideStackWidth MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH + kInset -#define kRequiredHeightBelowMeter (2 * (kDoubleInset + MUTE_SOLO_HEIGHT)) + kQuadrupleInset // mute/solo buttons stacked at bottom right -#define kMixerTrackClusterWidth kLeftSideStackWidth + kRightSideStackWidth + kQuadrupleInset // kInset margin on both sides +#define kRightSideStackWidth MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH + kDoubleInset +#define kMixerTrackClusterWidth kLeftSideStackWidth + kRightSideStackWidth + kQuadrupleInset // kDoubleInset margin on both sides enum { ID_BITMAPBUTTON_MUSICAL_INSTRUMENT = 13000, @@ -120,8 +119,6 @@ this->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE)); - // Create the controls programmatically. - // Not sure why, but sizers weren't getting offset vertically, // probably because not using wxDefaultPosition, // so positions are calculated explicitly below, and sizers code was removed. @@ -137,34 +134,12 @@ // mStaticText_TrackName->SetBackgroundColour(this->GetTrackColor()); - // pan slider - ctrlPos.x = size.GetWidth() / 10; - ctrlPos.y += TRACK_NAME_HEIGHT + kDoubleInset; - ctrlSize = wxSize((size.GetWidth() * 4 / 5), PAN_HEIGHT); - - // The width of the pan slider must be odd (don't ask). - if (!(ctrlSize.x & 1)) - ctrlSize.x--; - - mSlider_Pan = - new MixerTrackSlider( - this, ID_SLIDER_PAN, - /* i18n-hint: Title of the Pan slider, used to move the sound left or right */ - _("Pan"), - ctrlPos, ctrlSize, PAN_SLIDER, true); - - this->UpdatePan(); - - // gain slider at left ctrlPos.x = kDoubleInset; - ctrlPos.y += PAN_HEIGHT + kDoubleInset; - + ctrlPos.y += TRACK_NAME_HEIGHT + kDoubleInset; const int nGainSliderHeight = size.GetHeight() - ctrlPos.y - kQuadrupleInset; - ctrlSize = - wxSize(kLeftSideStackWidth - kQuadrupleInset, nGainSliderHeight); - + ctrlSize.Set(kLeftSideStackWidth - kQuadrupleInset, nGainSliderHeight); mSlider_Gain = new MixerTrackSlider( this, ID_SLIDER_GAIN, @@ -172,23 +147,14 @@ _("Gain"), ctrlPos, ctrlSize, DB_SLIDER, true, true, 0.0, wxVERTICAL); - - // too much color: mSlider_Gain->SetBackgroundColour(this->GetTrackColor()); - // too dark: mSlider_Gain->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW)); - //#ifdef __WXMAC__ - // mSlider_Gain->SetBackgroundColour(wxColour(220, 220, 220)); - //#else - // mSlider_Gain->SetBackgroundColour(wxColour(192, 192, 192)); - //#endif - this->UpdateGain(); - // meter and other controls at right + // other controls and meter at right // musical instrument image - ctrlPos.x = kInset + kLeftSideStackWidth; - ctrlSize = wxSize(MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH, MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH); + ctrlPos.x += kLeftSideStackWidth + kInset; // + kInset to center it in right side stack + ctrlSize.Set(MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH, MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH); wxBitmap* bitmap = mMixerBoard->GetMusicalInstrumentBitmap(mLeftTrack); wxASSERT(bitmap); mBitmapButton_MusicalInstrument = @@ -198,22 +164,28 @@ _("Musical Instrument")); - // meter + // pan slider + ctrlPos.x -= kInset; // Remove inset for instrument, so Pan is at leftmost of left side stack. ctrlPos.y += MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH + kDoubleInset; - const int nMeterHeight = - nGainSliderHeight - - (MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH + kDoubleInset) - - kQuadrupleInset - kRequiredHeightBelowMeter; - ctrlSize.Set(kRightSideStackWidth, nMeterHeight); - mMeter = - new Meter(this, -1, // wxWindow* parent, wxWindowID id, - false, // bool isInput - ctrlPos, ctrlSize, // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - Meter::MixerTrackCluster); // Style style = HorizontalStereo, + ctrlSize.Set(kRightSideStackWidth, PAN_HEIGHT); - // mute/solo buttons stacked below meter - ctrlPos.y += nMeterHeight + kQuadrupleInset; - ctrlSize = wxSize(mMixerBoard->mMuteSoloWidth, MUTE_SOLO_HEIGHT); + // The width of the pan slider must be odd (don't ask). + if (!(ctrlSize.x & 1)) + ctrlSize.x--; + + mSlider_Pan = + new MixerTrackSlider( + this, ID_SLIDER_PAN, + /* i18n-hint: Title of the Pan slider, used to move the sound left or right */ + _("Pan"), + ctrlPos, ctrlSize, PAN_SLIDER, true); + + this->UpdatePan(); + + + // mute/solo buttons stacked below Pan slider + ctrlPos.y += PAN_HEIGHT + kDoubleInset; + ctrlSize.Set(mMixerBoard->mMuteSoloWidth, MUTE_SOLO_HEIGHT); mToggleButton_Mute = new AButton(this, ID_TOGGLEBUTTON_MUTE, ctrlPos, ctrlSize, @@ -234,6 +206,21 @@ true); // toggle button this->UpdateSolo(); + + // meter + ctrlPos.y += MUTE_SOLO_HEIGHT + kDoubleInset; + const int nMeterHeight = + nGainSliderHeight - + (MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH + kDoubleInset) - + (PAN_HEIGHT + kDoubleInset) - + (MUTE_SOLO_HEIGHT + MUTE_SOLO_HEIGHT + kDoubleInset); + ctrlSize.Set(kRightSideStackWidth, nMeterHeight); + mMeter = + new Meter(this, -1, // wxWindow* parent, wxWindowID id, + false, // bool isInput + ctrlPos, ctrlSize, // const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + Meter::MixerTrackCluster); // Style style = HorizontalStereo, + #if wxUSE_TOOLTIPS mStaticText_TrackName->SetToolTip(mLeftTrack->GetName()); mToggleButton_Mute->SetToolTip(_T("Mute")); @@ -258,31 +245,20 @@ this->SetSize(-1, newClusterHeight); - // Change the heights of only mSlider_Gain and mMeter. - - // gain slider + // Change only the heights of mSlider_Gain and mMeter. const int nGainSliderHeight = newClusterHeight - (kInset + // margin above mStaticText_TrackName - TRACK_NAME_HEIGHT + kDoubleInset + // mStaticText_TrackName + margin - PAN_HEIGHT + kDoubleInset) - // pan slider + TRACK_NAME_HEIGHT + kDoubleInset) - // mStaticText_TrackName + margin kQuadrupleInset; // margin below gain slider mSlider_Gain->SetSize(-1, nGainSliderHeight); const int nMeterHeight = nGainSliderHeight - - (MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH + kDoubleInset) - - kQuadrupleInset - kRequiredHeightBelowMeter; + (MUSICAL_INSTRUMENT_HEIGHT_AND_WIDTH + kDoubleInset) - + (PAN_HEIGHT + kDoubleInset) - + (MUTE_SOLO_HEIGHT + MUTE_SOLO_HEIGHT + kDoubleInset); mMeter->SetSize(-1, nMeterHeight); - - // Reposition mute/solo buttons. - int newMuteSoloX; - int newMuteSoloY; - mMeter->GetPosition(&newMuteSoloX, &newMuteSoloY); - newMuteSoloY += nMeterHeight + kQuadrupleInset; - mToggleButton_Mute->Move(-1 , newMuteSoloY); - newMuteSoloY += MUTE_SOLO_HEIGHT; - mToggleButton_Solo->Move(-1 , newMuteSoloY); } void MixerTrackCluster::HandleSliderGain(const bool bWantPushState /*= false*/) ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Audacity-cvs mailing list Audacity-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/audacity-cvs