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

Modified Files:
        ControlToolBar.cpp 
Log Message:
Fix track height when recording more than 2 channels.  Patch supplied by Simon 
(The Hoff) Hoff.

Index: ControlToolBar.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/toolbars/ControlToolBar.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ControlToolBar.cpp  7 May 2007 01:59:44 -0000       1.12
+++ ControlToolBar.cpp  20 May 2007 19:15:16 -0000      1.13
@@ -679,8 +679,7 @@
       return;
    }
    AudacityProject *p = GetActiveProject();
-   if( p && p->GetCleanSpeechMode() )
-   {
+   if (p && p->GetCleanSpeechMode()) {
       size_t numProjects = gAudacityProjects.Count();
       bool tracks = (p && !p->GetTracks()->IsEmpty());
       if (tracks || (numProjects > 1)) {
@@ -702,8 +701,7 @@
 
    mRecord->PushDown();
 
-   if (p) 
-   {
+   if (p) {
       TrackList *t = p->GetTracks();
       double t0 = p->GetSel0();
       double t1 = p->GetSel1();
@@ -716,7 +714,7 @@
 
       bool duplex;
       gPrefs->Read(wxT("/AudioIO/Duplex"), &duplex, true);
-      if( duplex )
+      if (duplex)
          playbackTracks = t->GetWaveTrackArray(false);
       else
          playbackTracks = WaveTrackArray();
@@ -773,27 +771,31 @@
       }
       else {
          recordingChannels = gPrefs->Read(wxT("/AudioIO/RecordChannels"), 1);
-         for( int c = 0; c < recordingChannels; c++ )
-         {
+         for (int c = 0; c < recordingChannels; c++) {
             WaveTrack *newTrack = p->GetTrackFactory()->NewWaveTrack();
+
             int initialheight = newTrack->GetHeight();
+
             newTrack->SetOffset(t0);
-            newTrack->SetHeight(initialheight / recordingChannels);
-            if( recordingChannels == 2 )
-            {
-               if( c == 0 )
-               {
+
+            if (recordingChannels <= 2) {
+               newTrack->SetHeight(initialheight/recordingChannels);
+            }
+            else {
+               newTrack->SetMinimized(true);
+            }
+
+            if (recordingChannels == 2) {
+               if (c == 0) {
                   newTrack->SetChannel(Track::LeftChannel);
                   newTrack->SetLinked(true);
                }
-               else
-               {
+               else {
                   newTrack->SetChannel(Track::RightChannel);
                   newTrack->SetTeamed(true);
                }
             }
-            else
-            {
+            else {
                newTrack->SetChannel( Track::MonoChannel );
             }
 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs

Reply via email to