Update of /cvsroot/audacity/audacity-src/src
In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv15290/src
Modified Files:
Tag: Audacity_UmixIt
Project.cpp Project.h TrackPanel.cpp
Log Message:
LyricsWindow
Index: Project.h
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.h,v
retrieving revision 1.70.2.3
retrieving revision 1.70.2.3.2.1
diff -u -d -r1.70.2.3 -r1.70.2.3.2.1
--- Project.h 4 Feb 2005 21:31:48 -0000 1.70.2.3
+++ Project.h 15 Nov 2006 22:35:38 -0000 1.70.2.3.2.1
@@ -55,6 +55,7 @@
class MixerToolBar;
class MeterToolBar;
class HistoryWindow;
+class LyricsWindow;
class Importer;
class AudacityProject;
@@ -121,6 +122,7 @@
Tags *GetTags();
int GetAudioIOToken();
void SetAudioIOToken(int token);
+ LyricsWindow* GetLyricsWindow() { return mLyricsWindow; };
bool IsActive();
@@ -253,6 +255,8 @@
void ModifyState();
void PopState(TrackList * l);
+ void UpdateLyrics();
+
// Callbacks for backend operations
bool mUserCanceledProgress;
@@ -322,6 +326,7 @@
bool mImportingRaw;
bool mIconized;
HistoryWindow *mHistoryWindow;
+ LyricsWindow *mLyricsWindow;
ToolBarArray mToolBarArray;
int mTotalToolBarHeight;
Index: Project.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/Project.cpp,v
retrieving revision 1.178.2.17
retrieving revision 1.178.2.17.2.1
diff -u -d -r1.178.2.17 -r1.178.2.17.2.1
--- Project.cpp 23 Mar 2006 16:40:59 -0000 1.178.2.17
+++ Project.cpp 15 Nov 2006 22:35:38 -0000 1.178.2.17.2.1
@@ -68,10 +68,12 @@
#include "FormatSelection.h"
#include "FreqWindow.h"
#include "HistoryWindow.h"
+#include "LyricsWindow.h"
#include "Internat.h"
#include "import/Import.h"
#include "LabelTrack.h"
#include "Legacy.h"
+#include "Lyrics.h"
#include "Mix.h"
#include "MixerToolBar.h"
#include "NoteTrack.h"
@@ -354,6 +356,7 @@
mAutoScrolling(false),
mActive(true),
mHistoryWindow(NULL),
+ mLyricsWindow(NULL),
mTotalToolBarHeight(0),
mDraggingToolBar(NoneID),
mAudioIOToken(-1),
@@ -2422,6 +2425,7 @@
ModifyUndoMenus();
UpdateMenus();
+ UpdateLyrics();
}
void AudacityProject::PushState(wxString desc,
@@ -2442,6 +2446,7 @@
ModifyUndoMenus();
UpdateMenus();
+ UpdateLyrics();
}
void AudacityProject::ModifyState()
@@ -2451,6 +2456,7 @@
mUndoManager.ModifyState(l, mViewInfo.sel0, mViewInfo.sel1);
delete l;
+ UpdateLyrics();
}
void AudacityProject::PopState(TrackList * l)
@@ -2469,6 +2475,7 @@
HandleResize();
UpdateMenus();
+ UpdateLyrics();
}
void AudacityProject::SetStateTo(unsigned int n)
@@ -2480,6 +2487,40 @@
HandleResize();
mTrackPanel->Refresh(false);
ModifyUndoMenus();
+ UpdateLyrics();
+}
+
+void AudacityProject::UpdateLyrics()
+{
+ if (mLyricsWindow == NULL) {
+ mLyricsWindow = new LyricsWindow(this);
+ wxASSERT(mLyricsWindow);
+ mLyricsWindow->Show(true);
+ }
+
+ LabelTrack *labelTrack = NULL;
+ Track *t;
+ TrackListIterator iter(mTracks);
+ t = iter.First();
+ while (t) {
+ if (t->GetKind() == Track::Label) {
+ labelTrack = (LabelTrack *)t;
+ break;
+ }
+ t = iter.Next();
+ }
+
+ if (!labelTrack)
+ return;
+
+ Lyrics *lyrics = mLyricsWindow->GetLyricsPanel();
+ lyrics->Clear();
+ for(int i=0; i<labelTrack->GetNumLabels(); i++) {
+ lyrics->Add(labelTrack->GetLabel(i)->t,
+ labelTrack->GetLabel(i)->title);
+ }
+ lyrics->Finish(labelTrack->GetEndTime());
+ lyrics->Update(0.0);
}
//
Index: TrackPanel.cpp
===================================================================
RCS file: /cvsroot/audacity/audacity-src/src/TrackPanel.cpp,v
retrieving revision 1.212.2.15
retrieving revision 1.212.2.15.2.1
diff -u -d -r1.212.2.15 -r1.212.2.15.2.1
--- TrackPanel.cpp 12 Nov 2006 00:59:17 -0000 1.212.2.15
+++ TrackPanel.cpp 15 Nov 2006 22:35:38 -0000 1.212.2.15.2.1
@@ -96,6 +96,8 @@
#include "ControlToolBar.h"
#include "Envelope.h"
#include "LabelTrack.h"
+#include "Lyrics.h"
+#include "LyricsWindow.h"
#include "NoteTrack.h"
#include "Track.h"
#include "TrackArtist.h"
@@ -1173,6 +1175,13 @@
wxCommandEvent dummyEvent;
AudacityProject *p = (AudacityProject*)GetParent();
+ // Update lyrics display
+ if (p->GetAudioIOToken()>0) {
+ LyricsWindow* lyricsWindow = p->GetLyricsWindow();
+ Lyrics *lyrics = lyricsWindow->GetLyricsPanel();
+ lyrics->Update(gAudioIO->GetStreamTime());
+ }
+
// Each time the loop, check to see if we were playing or
// recording audio, but the stream has stopped.
if (p->GetAudioIOToken()>0 &&
-------------------------------------------------------------------------
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