![]() |
Audacity 3.2.0
|
LyricsPanel is a panel that paints the bouncing ball and the lyrics text. More...
#include <Lyrics.h>
Public Member Functions | |
LyricsPanel (wxWindow *parent, wxWindowID id, AudacityProject *project, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize) | |
virtual | ~LyricsPanel () |
int | FindSyllable (long startChar) |
int | GetCurrentSyllableIndex () |
Syllable * | GetSyllable (int nSyl) |
void | SetCurrentSyllableIndex (int nSyl) |
LyricsStyle | GetLyricsStyle () |
void | SetLyricsStyle (const LyricsStyle newLyricsStyle) |
void | Update (double t) |
void | UpdateLyrics (struct UndoRedoMessage) |
void | DoUpdateLyrics () |
void | OnShow (wxShowEvent &e) |
void | OnStartStop (AudioIOEvent) |
void | OnKeyEvent (wxKeyEvent &event) |
void | DoPaint (wxDC &dc) |
void | OnPaint (wxPaintEvent &evt) |
void | OnSize (wxSizeEvent &evt) |
void | HandlePaint (wxDC &dc) |
void | HandlePaint_BouncingBall (wxDC &dc) |
void | HandleLayout () |
![]() | |
wxPanelWrapper () | |
wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel")) | |
bool | Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel")) |
void | SetLabel (const TranslatableString &label) |
void | SetName (const TranslatableString &name) |
void | SetToolTip (const TranslatableString &toolTip) |
void | SetName () |
![]() | |
wxTabTraversalWrapper (Args &&... args) | |
wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete | |
wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete | |
wxTabTraversalWrapper & | operator= (const wxTabTraversalWrapper &)=delete |
wxTabTraversalWrapper & | operator= (wxTabTraversalWrapper &&)=delete |
![]() | |
virtual | ~NonKeystrokeInterceptingWindow () |
Private Types | |
enum | LyricsStyle { kBouncingBallLyrics , kHighlightLyrics } |
Private Member Functions | |
void | Clear () |
void | AddLabels (const LabelTrack *pLT) |
void | Finish (double finalT) |
void | Add (double t, const wxString &syllable, wxString &highlightText) |
unsigned int | GetDefaultFontSize () const |
void | SetDrawnFont (wxDC *dc) |
void | SetHighlightFont () |
void | Measure (wxDC *dc) |
int | FindSyllable (double t) |
void | GetKaraokePosition (double t, int *outX, double *outY) |
Private Attributes | |
Observer::Subscription | mAudioIOSubscription |
Observer::Subscription | mUndoSubscription |
int | mWidth |
int | mHeight |
int | mKaraokeHeight |
unsigned int | mKaraokeFontSize |
LyricsStyle | mLyricsStyle |
HighlightTextCtrl * | mHighlightTextCtrl |
double | mT |
int | mCurrentSyllable |
std::vector< Syllable > | mSyllables |
wxString | mText |
int | mTextHeight |
bool | mMeasurementsDone |
wxWeakRef< AudacityProject > | mProject |
bool | mDelayedUpdate { false } |
LyricsPanel is a panel that paints the bouncing ball and the lyrics text.
|
private |
LyricsPanel::LyricsPanel | ( | wxWindow * | parent, |
wxWindowID | id, | ||
AudacityProject * | project, | ||
const wxPoint & | pos = wxDefaultPosition , |
||
const wxSize & | size = wxDefaultSize |
||
) |
Definition at line 89 of file Lyrics.cpp.
References AudioIO::Get(), UndoManager::Get(), OnShow(), OnSize(), OnStartStop(), safenew, size, Observer::Publisher< Message, NotifyAll >::Subscribe(), UpdateLyrics(), and wxT().
|
virtual |
Definition at line 132 of file Lyrics.cpp.
|
private |
Definition at line 163 of file Lyrics.cpp.
References Syllable::char0, Syllable::char1, mSyllables, mText, Syllable::t, Syllable::text, Syllable::textWithSpace, and wxT().
Referenced by AddLabels().
|
private |
Definition at line 152 of file Lyrics.cpp.
References Add(), LabelTrack::GetLabel(), LabelTrack::GetNumLabels(), LabelStruct::getT0(), mHighlightTextCtrl, and LabelStruct::title.
Referenced by DoUpdateLyrics().
|
private |
Definition at line 138 of file Lyrics.cpp.
References mHighlightTextCtrl, mSyllables, mText, and wxT().
Referenced by DoUpdateLyrics().
void LyricsPanel::DoPaint | ( | wxDC & | dc | ) |
Definition at line 557 of file Lyrics.cpp.
References HandlePaint(), kBouncingBallLyrics, Measure(), mKaraokeHeight, mLyricsStyle, mMeasurementsDone, and mWidth.
Referenced by OnPaint(), and OnSize().
void LyricsPanel::DoUpdateLyrics | ( | ) |
Definition at line 492 of file Lyrics.cpp.
References AddLabels(), TrackList::Any(), Clear(), Finish(), AudioIOBase::Get(), ViewInfo::Get(), TrackList::Get(), mDelayedUpdate, mProject, ViewInfo::selectedRegion, and Update().
Referenced by OnShow(), OnStartStop(), and UpdateLyrics().
|
private |
Definition at line 333 of file Lyrics.cpp.
References mSyllables.
int LyricsPanel::FindSyllable | ( | long | startChar | ) |
Definition at line 225 of file Lyrics.cpp.
References mSyllables.
Referenced by GetKaraokePosition(), HighlightTextCtrl::OnMouseEvent(), and Update().
|
private |
Definition at line 207 of file Lyrics.cpp.
References mCurrentSyllable, mHighlightTextCtrl, mMeasurementsDone, and mSyllables.
Referenced by DoUpdateLyrics().
|
inline |
Definition at line 96 of file Lyrics.h.
References mCurrentSyllable.
Referenced by HighlightTextCtrl::OnMouseEvent().
|
private |
Definition at line 260 of file Lyrics.cpp.
References kBouncingBallLyrics, and mLyricsStyle.
Referenced by OnSize().
|
private |
Definition at line 362 of file Lyrics.cpp.
References FindSyllable(), I_FIRST_REAL_SYLLABLE, M_PI, and mSyllables.
Referenced by HandlePaint_BouncingBall().
|
inline |
|
inline |
Definition at line 97 of file Lyrics.h.
References mSyllables.
Referenced by HighlightTextCtrl::OnMouseEvent().
void LyricsPanel::HandleLayout | ( | ) |
void LyricsPanel::HandlePaint | ( | wxDC & | dc | ) |
Definition at line 622 of file Lyrics.cpp.
References HandlePaint_BouncingBall(), kBouncingBallLyrics, mKaraokeHeight, mLyricsStyle, and mWidth.
Referenced by DoPaint().
void LyricsPanel::HandlePaint_BouncingBall | ( | wxDC & | dc | ) |
Definition at line 631 of file Lyrics.cpp.
References GetKaraokePosition(), mKaraokeHeight, mSyllables, mT, mTextHeight, mWidth, SetDrawnFont(), and wxT().
Referenced by HandlePaint().
|
private |
Definition at line 278 of file Lyrics.cpp.
References I_FIRST_REAL_SYLLABLE, mMeasurementsDone, mSyllables, mTextHeight, SetDrawnFont(), and wxT().
Referenced by DoPaint().
void LyricsPanel::OnKeyEvent | ( | wxKeyEvent & | event | ) |
Definition at line 543 of file Lyrics.cpp.
References FindProjectFromWindow(), and CommandManager::Get().
void LyricsPanel::OnPaint | ( | wxPaintEvent & | evt | ) |
Definition at line 551 of file Lyrics.cpp.
References DoPaint().
void LyricsPanel::OnShow | ( | wxShowEvent & | e | ) |
Definition at line 536 of file Lyrics.cpp.
References DoUpdateLyrics().
Referenced by LyricsPanel().
void LyricsPanel::OnSize | ( | wxSizeEvent & | evt | ) |
Definition at line 586 of file Lyrics.cpp.
References DoPaint(), GetDefaultFontSize(), kBouncingBallLyrics, LYRICS_DEFAULT_HEIGHT, mHeight, mHighlightTextCtrl, mKaraokeFontSize, mKaraokeHeight, mLyricsStyle, mMeasurementsDone, mWidth, and SetHighlightFont().
Referenced by SetLyricsStyle().
void LyricsPanel::OnStartStop | ( | AudioIOEvent | e | ) |
Definition at line 526 of file Lyrics.cpp.
References DoUpdateLyrics(), mDelayedUpdate, AudioIOEvent::MONITOR, AudioIOEvent::on, and AudioIOEvent::type.
Referenced by LyricsPanel().
|
inline |
Definition at line 98 of file Lyrics.h.
References mCurrentSyllable.
|
private |
Definition at line 265 of file Lyrics.cpp.
References mKaraokeFontSize.
Referenced by HandlePaint_BouncingBall(), and Measure().
|
private |
Definition at line 270 of file Lyrics.cpp.
References mHighlightTextCtrl, and mKaraokeFontSize.
Referenced by OnSize().
void LyricsPanel::SetLyricsStyle | ( | const LyricsStyle | newLyricsStyle | ) |
Definition at line 247 of file Lyrics.cpp.
References kHighlightLyrics, mHighlightTextCtrl, mLyricsStyle, and OnSize().
Referenced by LyricsWindow::OnStyle_BouncingBall(), and LyricsWindow::OnStyle_Highlight().
void LyricsPanel::Update | ( | double | t | ) |
Definition at line 437 of file Lyrics.cpp.
References FindProjectFromWindow(), FindSyllable(), ViewInfo::Get(), kBouncingBallLyrics, kHighlightLyrics, mCurrentSyllable, mHighlightTextCtrl, mKaraokeHeight, mLyricsStyle, mSyllables, mT, mWidth, and ViewInfo::selectedRegion.
Referenced by DoUpdateLyrics(), and LyricsWindow::OnTimer().
void LyricsPanel::UpdateLyrics | ( | struct UndoRedoMessage | message | ) |
Definition at line 478 of file Lyrics.cpp.
References DoUpdateLyrics(), UndoRedoMessage::Modified, UndoRedoMessage::Pushed, UndoRedoMessage::Reset, UndoRedoMessage::type, and UndoRedoMessage::UndoOrRedo.
Referenced by LyricsPanel().
|
private |
|
private |
Definition at line 158 of file Lyrics.h.
Referenced by Finish(), GetCurrentSyllableIndex(), SetCurrentSyllableIndex(), and Update().
|
private |
Definition at line 166 of file Lyrics.h.
Referenced by DoUpdateLyrics(), and OnStartStop().
|
private |
Definition at line 154 of file Lyrics.h.
Referenced by AddLabels(), Clear(), Finish(), OnSize(), SetHighlightFont(), SetLyricsStyle(), and Update().
|
private |
Definition at line 151 of file Lyrics.h.
Referenced by OnSize(), SetDrawnFont(), and SetHighlightFont().
|
private |
Definition at line 150 of file Lyrics.h.
Referenced by DoPaint(), HandlePaint(), HandlePaint_BouncingBall(), OnSize(), and Update().
|
private |
Definition at line 153 of file Lyrics.h.
Referenced by DoPaint(), GetDefaultFontSize(), GetLyricsStyle(), HandlePaint(), OnSize(), SetLyricsStyle(), and Update().
|
private |
|
private |
Definition at line 165 of file Lyrics.h.
Referenced by DoUpdateLyrics().
|
private |
Definition at line 159 of file Lyrics.h.
Referenced by Add(), Clear(), FindSyllable(), Finish(), GetKaraokePosition(), GetSyllable(), HandlePaint_BouncingBall(), Measure(), and Update().
|
private |
Definition at line 156 of file Lyrics.h.
Referenced by HandlePaint_BouncingBall(), and Update().
|
private |
|
private |
Definition at line 162 of file Lyrics.h.
Referenced by HandlePaint_BouncingBall(), and Measure().
|
private |
|
private |
Definition at line 147 of file Lyrics.h.
Referenced by DoPaint(), HandlePaint(), HandlePaint_BouncingBall(), OnSize(), and Update().