Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv26071

Modified Files:
      Tag: Audacity_UmixIt
        MixerBoard.cpp 
Log Message:
Mixer board fixes for Mac

Index: MixerBoard.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Attic/MixerBoard.cpp,v
retrieving revision 1.1.2.8
retrieving revision 1.1.2.9
diff -u -d -r1.1.2.8 -r1.1.2.9
--- MixerBoard.cpp      26 Feb 2007 10:23:47 -0000      1.1.2.8
+++ MixerBoard.cpp      26 Feb 2007 11:23:26 -0000      1.1.2.9
@@ -135,7 +135,7 @@
    ctrlPos.y += MUTE_SOLO_HEIGHT + kQuadrupleInset;
    ctrlSize = wxSize((size.GetWidth() * 4 / 5), PAN_HEIGHT);
    /* i18n-hint: Title of the Pan slider, used to move the sound left or right 
stereoscopically */
-   mSlider_Pan = new ASlider(this, ID_ASLIDER_PAN, _("Pan"), ctrlPos, 
ctrlSize, PAN_SLIDER);
+   mSlider_Pan = new ASlider(this, ID_ASLIDER_PAN, _("Pan"), ctrlPos, 
ctrlSize, PAN_SLIDER | NO_AQUA);
    //pBoxSizer_MixerTrackCluster->Add(mSlider_Pan, 0, wxALIGN_CENTER | wxALL, 
kDoubleInset);
 
 
@@ -147,12 +147,12 @@
    mSlider_Gain = 
       // ASlider doesn't do vertical.  
       /* i18n-hint: Title of the Gain slider, used to adjust the volume */
-      //    new ASlider(this, ID_SLIDER_GAIN, _("Gain"), ctrlPos, ctrlSize, 
DB_SLIDER);
+      //    new ASlider(this, ID_SLIDER_GAIN, _("Gain"), ctrlPos, ctrlSize, 
DB_SLIDER | NO_AQUA);
       new wxSlider(this, ID_SLIDER_GAIN, // wxWindow* parent, wxWindowID id, 
-                     this->GetGainToSliderValue(),  // int value, 
-                     kGainSliderMin, kGainSliderMax, // int minValue, int 
maxValue, 
-                     ctrlPos, ctrlSize, // const wxPoint& point = 
wxDefaultPosition, const wxSize& size = wxDefaultSize, 
-                     wxSL_VERTICAL | wxSL_AUTOTICKS | wxSUNKEN_BORDER); // 
long style = wxSL_HORIZONTAL, ...
+                   this->GetGainToSliderValue(),  // int value, 
+                   0, kGainSliderMax - kGainSliderMin, // int minValue, int 
maxValue, 
+                   ctrlPos, ctrlSize, // const wxPoint& point = 
wxDefaultPosition, const wxSize& size = wxDefaultSize, 
+                   wxSL_VERTICAL | wxSL_AUTOTICKS | wxSUNKEN_BORDER); // long 
style = wxSL_HORIZONTAL, ...
 
    // too much color:   mSlider_Gain->SetBackgroundColour(trackColor);
    // too dark:   
mSlider_Gain->SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DSHADOW));
@@ -190,6 +190,8 @@
       wxSizeEvent dummyEvent;
       this->OnSize(dummyEvent);
    #endif
+
+   UpdateGain();
 }
 
 void MixerTrackCluster::ResetMeter()
@@ -317,6 +319,13 @@
       nSliderValue = kGainSliderMin;
    if (nSliderValue > kGainSliderMax)
       nSliderValue = kGainSliderMax;
+   nSliderValue -= kGainSliderMin;
+
+   #ifdef __WXMAC__
+   // Mac is upside-down from Windows!!!
+   nSliderValue = (kGainSliderMax - kGainSliderMin) - nSliderValue;
+   #endif
+
    return nSliderValue;
 }
 
@@ -346,7 +355,7 @@
    #ifdef __WXMAC__
       // Fill with correct color, not scroller background. Done automatically 
on Windows.
       AColor::Medium(&dc, false);
-      dc.DrawRectangle(this->GetRect());
+      dc.DrawRectangle(this->GetClientRect());
    #endif
 
    wxSize clusterSize = this->GetSize();
@@ -413,7 +422,17 @@
 {
    // Analog to LWSlider::Set() calc for DB_SLIDER. Negate because wxSlider 
has min at top.
    // mSlider_Gain->GetValue() is in [-6,36]. wxSlider has min at top, so this 
is [-36dB,6dB]. 
-   float fValue = pow(10.0f, -(float)(mSlider_Gain->GetValue()) / 20.0f); 
+
+   int sliderValue = mSlider_Gain->GetValue();
+   
+   #ifdef __WXMAC__
+   // Mac slider is upside-down from Windows!
+   sliderValue = (kGainSliderMax - kGainSliderMin) - sliderValue;
+   #endif
+
+   sliderValue += kGainSliderMin;
+
+   float fValue = pow(10.0f, -(float)sliderValue / 20.0f); 
    mLeftTrack->SetGain(fValue);
    if (mRightTrack != NULL)
       mRightTrack->SetGain(fValue);


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to