Update of /cvsroot/audacity/audacity-src/src
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv22258
Modified Files:
LabelTrack.cpp Project.cpp TimeTrack.cpp Track.h WaveTrack.cpp
Log Message:
Enhance track state saving with height and minimized flag, for Save/Save As and
Save Compressed Copy.
Index: Track.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Track.h,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- Track.h 9 Feb 2009 06:29:41 -0000 1.50
+++ Track.h 16 Feb 2009 19:06:52 -0000 1.51
@@ -60,6 +60,7 @@
// This just returns a constant and can be overriden by subclasses
// to specify a different height for the case that the track is minimized.
virtual int GetMinimizedHeight() const;
+ int GetActualHeight() { return mHeight; };
int GetHeight() const;
void SetHeight( int h ) { mHeight = h; }
Index: LabelTrack.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/LabelTrack.cpp,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -d -r1.99 -r1.100
--- LabelTrack.cpp 6 Feb 2009 00:43:40 -0000 1.99
+++ LabelTrack.cpp 16 Feb 2009 19:06:52 -0000 1.100
@@ -1860,6 +1860,12 @@
mLabels.Clear();
mLabels.Alloc(nValue);
}
+ else if (!wxStrcmp(attr, wxT("height")) &&
+ XMLValueChecker::IsGoodInt(strValue) &&
strValue.ToLong(&nValue))
+ mHeight = nValue;
+ else if (!wxStrcmp(attr, wxT("minimized")) &&
+ XMLValueChecker::IsGoodInt(strValue) &&
strValue.ToLong(&nValue))
+ mMinimized = (nValue != 0);
}
return true;
@@ -1884,6 +1890,8 @@
xmlFile.StartTag(wxT("labeltrack"));
xmlFile.WriteAttr(wxT("name"), mName);
xmlFile.WriteAttr(wxT("numlabels"), len);
+ xmlFile.WriteAttr(wxT("height"), this->GetActualHeight());
+ xmlFile.WriteAttr(wxT("minimized"), this->GetMinimized());
for (i = 0; i < len; i++) {
xmlFile.StartTag(wxT("label"));
Index: WaveTrack.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/WaveTrack.cpp,v
retrieving revision 1.137
retrieving revision 1.138
diff -u -d -r1.137 -r1.138
--- WaveTrack.cpp 7 Feb 2009 03:05:35 -0000 1.137
+++ WaveTrack.cpp 16 Feb 2009 19:06:52 -0000 1.138
@@ -1175,6 +1175,12 @@
else if (!wxStrcmp(attr, wxT("solo")) &&
XMLValueChecker::IsGoodInt(strValue) &&
strValue.ToLong(&nValue))
mSolo = (nValue != 0);
+ else if (!wxStrcmp(attr, wxT("height")) &&
+ XMLValueChecker::IsGoodInt(strValue) &&
strValue.ToLong(&nValue))
+ mHeight = nValue;
+ else if (!wxStrcmp(attr, wxT("minimized")) &&
+ XMLValueChecker::IsGoodInt(strValue) &&
strValue.ToLong(&nValue))
+ mMinimized = (nValue != 0);
else if (!wxStrcmp(attr, wxT("gain")) &&
XMLValueChecker::IsGoodString(strValue) &&
Internat::CompatibleToDouble(strValue, &dblValue))
@@ -1256,6 +1262,8 @@
xmlFile.WriteAttr(wxT("offset"), mOffset, 8);
xmlFile.WriteAttr(wxT("mute"), mMute);
xmlFile.WriteAttr(wxT("solo"), mSolo);
+ xmlFile.WriteAttr(wxT("height"), this->GetActualHeight());
+ xmlFile.WriteAttr(wxT("minimized"), this->GetMinimized());
xmlFile.WriteAttr(wxT("rate"), mRate);
xmlFile.WriteAttr(wxT("gain"), (double)mGain);
xmlFile.WriteAttr(wxT("pan"), (double)mPan);
Index: TimeTrack.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/TimeTrack.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- TimeTrack.cpp 23 May 2007 06:29:50 -0000 1.18
+++ TimeTrack.cpp 16 Feb 2009 19:06:52 -0000 1.19
@@ -139,7 +139,12 @@
return false;
mChannel = nValue;
}
-
+ else if (!wxStrcmp(attr, wxT("height")) &&
+ XMLValueChecker::IsGoodInt(strValue) &&
strValue.ToLong(&nValue))
+ mHeight = nValue;
+ else if (!wxStrcmp(attr, wxT("minimized")) &&
+ XMLValueChecker::IsGoodInt(strValue) &&
strValue.ToLong(&nValue))
+ mMinimized = (nValue != 0);
} // while
return true;
@@ -163,6 +168,8 @@
xmlFile.WriteAttr(wxT("name"), mName);
xmlFile.WriteAttr(wxT("channel"), mChannel);
xmlFile.WriteAttr(wxT("offset"), mOffset, 8);
+ xmlFile.WriteAttr(wxT("height"), this->GetActualHeight());
+ xmlFile.WriteAttr(wxT("minimized"), this->GetMinimized());
mEnvelope->WriteXML(xmlFile);
Index: Project.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.cpp,v
retrieving revision 1.395
retrieving revision 1.396
diff -u -d -r1.395 -r1.396
--- Project.cpp 9 Feb 2009 21:54:33 -0000 1.395
+++ Project.cpp 16 Feb 2009 19:06:52 -0000 1.396
@@ -2566,6 +2566,8 @@
xmlFile.WriteAttr(wxT("offset"), t->GetOffset(), 8);
xmlFile.WriteAttr(wxT("mute"), t->GetMute());
xmlFile.WriteAttr(wxT("solo"), t->GetSolo());
+ xmlFile.WriteAttr(wxT("height"), t->GetActualHeight());
+ xmlFile.WriteAttr(wxT("minimized"), t->GetMinimized());
pWaveTrack = (WaveTrack*)t;
// Don't store "rate" tag because the importer can figure that out.
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Audacity-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/audacity-cvs