Audacity  3.0.3
Public Member Functions | Private Member Functions | Private Attributes | List of all members
LabelDialog Class Referencefinal

Dialog for editing labels. More...

#include <LabelDialog.h>

Inheritance diagram for LabelDialog:
[legend]
Collaboration diagram for LabelDialog:
[legend]

Public Member Functions

 LabelDialog (wxWindow *parent, AudacityProject &project, TrackList *tracks, LabelTrack *selectedTrack, int index, ViewInfo &viewinfo, double rate, const NumericFormatSymbol &format, const NumericFormatSymbol &freqFormat)
 
 ~LabelDialog ()
 
bool Show (bool show=true) override
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Member Functions

void Populate ()
 Creates the dialog and its contents. More...
 
void PopulateOrExchange (ShuttleGui &S)
 
void PopulateLabels ()
 
void OnHelp (wxCommandEvent &event)
 
ManualPageID GetHelpPageName ()
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
bool Validate () override
 
void FindAllLabels ()
 
void AddLabels (const LabelTrack *t)
 
void FindInitialRow ()
 
wxString TrackName (int &index, const wxString &dflt=_("Label Track"))
 
void OnUpdate (wxCommandEvent &event)
 
void OnFreqUpdate (wxCommandEvent &event)
 
void OnInsert (wxCommandEvent &event)
 
void OnRemove (wxCommandEvent &event)
 
void OnImport (wxCommandEvent &event)
 
void OnExport (wxCommandEvent &event)
 
void OnSelectCell (wxGridEvent &event)
 
void OnCellChange (wxGridEvent &event)
 
void OnChangeTrack (wxGridEvent &event, int row, RowData *rd)
 
void OnChangeLabel (wxGridEvent &event, int row, RowData *rd)
 
void OnChangeStime (wxGridEvent &event, int row, RowData *rd)
 
void OnChangeEtime (wxGridEvent &event, int row, RowData *rd)
 
void OnChangeLfreq (wxGridEvent &event, int row, RowData *rd)
 
void OnChangeHfreq (wxGridEvent &event, int row, RowData *rd)
 
void OnOK (wxCommandEvent &event)
 
void OnCancel (wxCommandEvent &event)
 
void ReadSize ()
 
void WriteSize ()
 

Private Attributes

AudacityProjectmProject
 
GridmGrid
 
ChoiceEditormChoiceEditor
 
NumericEditormTimeEditor
 
NumericEditormFrequencyEditor
 
RowDataArray mData
 
TrackListmTracks
 
LabelTrackmSelectedTrack {}
 
int mIndex { -1 }
 
ViewInfomViewInfo
 
wxArrayString mTrackNames
 
double mRate
 
NumericFormatSymbol mFormat
 
NumericFormatSymbol mFreqFormat
 
int mInitialRow
 

Detailed Description

Dialog for editing labels.

Definition at line 35 of file LabelDialog.h.

Constructor & Destructor Documentation

◆ LabelDialog()

LabelDialog::LabelDialog ( wxWindow *  parent,
AudacityProject project,
TrackList tracks,
LabelTrack selectedTrack,
int  index,
ViewInfo viewinfo,
double  rate,
const NumericFormatSymbol format,
const NumericFormatSymbol freqFormat 
)

◆ ~LabelDialog()

LabelDialog::~LabelDialog ( )

Definition at line 125 of file LabelDialog.cpp.

126 {
127 }

Member Function Documentation

◆ AddLabels()

void LabelDialog::AddLabels ( const LabelTrack t)
private

Definition at line 473 of file LabelDialog.cpp.

474 {
475  wxString lab;
476  int tndx = 0;
477  int i;
478 
479  // Add a NEW track name
480  TrackName(tndx, t->GetName());
481 
482  // If editor was invoked for one label, add that one only, else add all.
483  if (!mSelectedTrack || mSelectedTrack == t) {
484  for (i = 0; i < t->GetNumLabels(); i++) {
485  const LabelStruct *ls = t->GetLabel(i);
486 
487  if (mIndex < 0 || mIndex == i)
488  mData.push_back(RowData(tndx, ls->title, ls->selectedRegion));
489  }
490  }
491 }

References LabelTrack::GetLabel(), Track::GetName(), LabelTrack::GetNumLabels(), mData, mIndex, mSelectedTrack, LabelStruct::selectedRegion, LabelStruct::title, and TrackName().

Referenced by FindAllLabels(), and OnImport().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindAllLabels()

void LabelDialog::FindAllLabels ( )
private

Definition at line 458 of file LabelDialog.cpp.

459 {
460  // Add labels from all label tracks
461  for (auto lt : mTracks->Any<const LabelTrack>()) {
462  AddLabels(lt);
463  }
464 
465  FindInitialRow();
466 
467  if (mData.size() == 0) {
468  wxCommandEvent e;
469  OnInsert(e);
470  }
471 }

References AddLabels(), TrackList::Any(), FindInitialRow(), mData, mTracks, and OnInsert().

Referenced by PopulateLabels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindInitialRow()

void LabelDialog::FindInitialRow ( )
private

Definition at line 493 of file LabelDialog.cpp.

494 {
495  int cnt = mData.size();
496  mInitialRow = -1;
497 
498  if (cnt == 0)
499  return;
500 
501  // find closest previous label
502 
503  double distMin = std::numeric_limits<double>::max();
504  double dist;
505  double t0 = mViewInfo->selectedRegion.t0();
506  int i;
507  for (i = 0; i < cnt; i++)
508  {
509  dist = t0 - mData[i].selectedRegion.t0();
510  if (dist >= 0.0 && dist < distMin)
511  {
512  mInitialRow = i;
513  distMin = dist;
514  }
515  }
516 
517  // if no previous label was found, find first label
518 
519  if (mInitialRow == -1)
520  {
521  double t0Min = std::numeric_limits<double>::max();
522  for (i = 0; i < cnt; i++)
523  {
524  if (mData[i].selectedRegion.t0() < t0Min)
525  {
526  mInitialRow = i;
527  t0Min = mData[i].selectedRegion.t0();
528  }
529  }
530  }
531 }

References mData, mInitialRow, mViewInfo, ViewInfo::selectedRegion, and NotifyingSelectedRegion::t0().

Referenced by FindAllLabels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetHelpPageName()

ManualPageID LabelDialog::GetHelpPageName ( )
inlineprivate

Definition at line 64 of file LabelDialog.h.

64 {return "Labels_Editor";}

Referenced by OnHelp().

Here is the caller graph for this function:

◆ OnCancel()

void LabelDialog::OnCancel ( wxCommandEvent &  event)
private

Definition at line 939 of file LabelDialog.cpp.

940 {
941  if (mGrid->IsCellEditControlShown()) {
942  auto editor = mGrid->GetCellEditor(mGrid->GetGridCursorRow(),
943  mGrid->GetGridCursorCol());
944  editor->Reset();
945  // To avoid memory leak, don't forget DecRef()!
946  editor->DecRef();
947  mGrid->HideCellEditControl();
948  return;
949  }
950 
951  WriteSize();
952  // Standard handling
953  EndModal(wxID_CANCEL);
954 
955  return;
956 }

References mGrid, and WriteSize().

Here is the call graph for this function:

◆ OnCellChange()

void LabelDialog::OnCellChange ( wxGridEvent &  event)
private

Definition at line 762 of file LabelDialog.cpp.

763 {
764  static bool guard = false;
765  int row = event.GetRow();
766 
767  // Guard against recursion which can happen when a change to the "NEW label" row
768  // is made. When InsertRow() is done in TransferDataToWindow(), checks are made
769  // within wxGrid to see if the edit control is active and since it hasn't yet
770  // been marked inactive on the first time through here, we get entered again.
771  // Sort of a double change. I think this is probably a bug in wxGrid.
772  if (guard) {
773  return;
774  }
775  guard = true;
776 
777  // The change was to an existing label, so go process it based
778  // on which column was changed.
779  RowData *rd = &mData[row];
780  switch (event.GetCol())
781  {
782  case Col_Track:
783  OnChangeTrack(event, row, rd);
784  break;
785 
786  case Col_Label:
787  OnChangeLabel(event, row, rd);
788  break;
789 
790  case Col_Stime:
791  OnChangeStime(event, row, rd);
792  break;
793 
794  case Col_Etime:
795  OnChangeEtime(event, row, rd);
796  break;
797 
798  case Col_Lfreq:
799  OnChangeLfreq(event, row, rd);
800  break;
801 
802  case Col_Hfreq:
803  OnChangeHfreq(event, row, rd);
804  break;
805  }
806 
807  // Done...no need for protection anymore
808  guard = false;
809 
810  return;
811 }

References Col_Etime, Col_Hfreq, Col_Label, Col_Lfreq, Col_Stime, Col_Track, mData, OnChangeEtime(), OnChangeHfreq(), OnChangeLabel(), OnChangeLfreq(), OnChangeStime(), and OnChangeTrack().

Here is the call graph for this function:

◆ OnChangeEtime()

void LabelDialog::OnChangeEtime ( wxGridEvent &  event,
int  row,
RowData rd 
)
private

Definition at line 867 of file LabelDialog.cpp.

868 {
869  // Remember the value...no need to repopulate
870  double t {};
871  mGrid->GetCellValue(row, Col_Etime).ToDouble(&t);
872  rd->selectedRegion.setT1(t, false);
873  mGrid->SetCellValue(row, Col_Stime, wxString::Format(wxT("%g"),
874  rd->selectedRegion.t0()));
875 
876  return;
877 }

References Col_Etime, Col_Stime, mGrid, RowData::selectedRegion, SelectedRegion::setT1(), and SelectedRegion::t0().

Referenced by OnCellChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnChangeHfreq()

void LabelDialog::OnChangeHfreq ( wxGridEvent &  event,
int  row,
RowData rd 
)
private

Definition at line 891 of file LabelDialog.cpp.

892 {
893  // Remember the value...no need to repopulate
894  double f;
895  mGrid->GetCellValue(row, Col_Hfreq).ToDouble(&f);
896  rd->selectedRegion.setF1(f, false);
897  mGrid->SetCellValue(row, Col_Lfreq, wxString::Format(wxT("%g"),
898  rd->selectedRegion.f0()));
899 
900  return;
901 }

References Col_Hfreq, Col_Lfreq, mGrid, and RowData::selectedRegion.

Referenced by OnCellChange().

Here is the caller graph for this function:

◆ OnChangeLabel()

void LabelDialog::OnChangeLabel ( wxGridEvent &  event,
int  row,
RowData rd 
)
private

Definition at line 847 of file LabelDialog.cpp.

848 {
849  // Remember the value...no need to repopulate
850  rd->title = mGrid->GetCellValue(row, Col_Label);
851 
852  return;
853 }

References Col_Label, mGrid, and RowData::title.

Referenced by OnCellChange().

Here is the caller graph for this function:

◆ OnChangeLfreq()

void LabelDialog::OnChangeLfreq ( wxGridEvent &  event,
int  row,
RowData rd 
)
private

Definition at line 879 of file LabelDialog.cpp.

880 {
881  // Remember the value...no need to repopulate
882  double f;
883  mGrid->GetCellValue(row, Col_Lfreq).ToDouble(&f);
884  rd->selectedRegion.setF0(f, false);
885  mGrid->SetCellValue(row, Col_Hfreq, wxString::Format(wxT("%g"),
886  rd->selectedRegion.f1()));
887 
888  return;
889 }

References Col_Hfreq, Col_Lfreq, mGrid, and RowData::selectedRegion.

Referenced by OnCellChange().

Here is the caller graph for this function:

◆ OnChangeStime()

void LabelDialog::OnChangeStime ( wxGridEvent &  event,
int  row,
RowData rd 
)
private

Definition at line 855 of file LabelDialog.cpp.

856 {
857  // Remember the value...no need to repopulate
858  double t {};
859  mGrid->GetCellValue(row, Col_Stime).ToDouble(&t);
860  rd->selectedRegion.setT0(t, false);
861  mGrid->SetCellValue(row, Col_Etime, wxString::Format(wxT("%g"),
862  rd->selectedRegion.t1()));
863 
864  return;
865 }

References Col_Etime, Col_Stime, mGrid, RowData::selectedRegion, SelectedRegion::setT0(), and SelectedRegion::t1().

Referenced by OnCellChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnChangeTrack()

void LabelDialog::OnChangeTrack ( wxGridEvent &  event,
int  row,
RowData rd 
)
private

Definition at line 813 of file LabelDialog.cpp.

814 {
815  wxString val = mGrid->GetCellValue(row, Col_Track);
816 
817  // User selected the "New..." choice so ask for a NEW name
818  if ( make_iterator_range( mTrackNames ).index( val ) == 0 ) {
820  XO("New Label Track"),
821  XO("Enter track name"),
822  /* i18n-hint: (noun) it's the name of a kind of track.*/
823  XO("Label Track").Translation());
824 
825  // User canceled so repopulating the grid will set the track
826  // name to the original value
827  if (d.ShowModal() == wxID_CANCEL) {
829  return;
830  }
831 
832  // Force generation of a NEW track name
833  rd->index = 0;
834  TrackName(rd->index, d.GetValue());
835  }
836  else {
837  // Remember the tracks index
838  rd->index = make_iterator_range( mTrackNames ).index( val );
839  }
840 
841  // Repopulate the grid
843 
844  return;
845 }

References Col_Track, RowData::index, make_iterator_range(), mGrid, mTrackNames, TrackName(), TransferDataToWindow(), and XO.

Referenced by OnCellChange().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnExport()

void LabelDialog::OnExport ( wxCommandEvent &  event)
private

Definition at line 671 of file LabelDialog.cpp.

672 {
673  int cnt = mData.size();
674 
675  // Silly user (could just disable the button, but that's a hassle ;-))
676  if (cnt == 0) {
677  AudacityMessageBox( XO("No labels to export.") );
678  return;
679  }
680 
681  // Extract the actual name.
682  wxString fName = mTrackNames[mTrackNames.size() - 1].AfterFirst(wxT('-')).Mid(1);
683 
684  fName = SelectFile(FileNames::Operation::Export,
685  XO("Export Labels As:"),
686  wxEmptyString,
687  fName,
688  wxT("txt"),
690  wxFD_SAVE | wxFD_OVERWRITE_PROMPT | wxRESIZE_BORDER,
691  this);
692 
693  if (fName.empty())
694  return;
695 
696  // Move existing files out of the way. Otherwise wxTextFile will
697  // append to (rather than replace) the current file.
698 
699  if (wxFileExists(fName)) {
700 #ifdef __WXGTK__
701  wxString safetyFileName = fName + wxT("~");
702 #else
703  wxString safetyFileName = fName + wxT(".bak");
704 #endif
705 
706  if (wxFileExists(safetyFileName))
707  wxRemoveFile(safetyFileName);
708 
709  wxRename(fName, safetyFileName);
710  }
711 
712  wxTextFile f(fName);
713 #ifdef __WXMAC__
714  wxFile{}.Create(fName);
715 #else
716  f.Create();
717 #endif
718  f.Open();
719  if (!f.IsOpened()) {
721  XO("Couldn't write to file: %s").Format( fName ) );
722  return;
723  }
724 
725  // Transfer our collection to a temporary label track
726  auto lt = std::make_shared<LabelTrack>();
727  int i;
728 
729  for (i = 0; i < cnt; i++) {
730  RowData &rd = mData[i];
731 
732  lt->AddLabel(rd.selectedRegion, rd.title);
733  }
734 
735  // Export them and clean
736  lt->Export(f);
737 
738 #ifdef __WXMAC__
739  f.Write(wxTextFileType_Mac);
740 #else
741  f.Write();
742 #endif
743  f.Close();
744 }

References AudacityMessageBox(), mData, mTrackNames, RowData::selectedRegion, SelectFile(), FileNames::TextFiles, RowData::title, and XO.

Here is the call graph for this function:

◆ OnFreqUpdate()

void LabelDialog::OnFreqUpdate ( wxCommandEvent &  event)
private

Definition at line 543 of file LabelDialog.cpp.

544 {
545  // Remember the NEW format and repopulate grid
547  NumericConverter::FREQUENCY, event.GetString() );
549 
550  event.Skip(false);
551 }

References NumericConverter::FREQUENCY, NumericConverter::LookupFormat(), mFreqFormat, and TransferDataToWindow().

Here is the call graph for this function:

◆ OnHelp()

void LabelDialog::OnHelp ( wxCommandEvent &  event)
private

Definition at line 287 of file LabelDialog.cpp.

288 {
289  const auto &page = GetHelpPageName();
290  HelpSystem::ShowHelp(this, page, true);
291 }

References GetHelpPageName(), and HelpSystem::ShowHelp().

Here is the call graph for this function:

◆ OnImport()

void LabelDialog::OnImport ( wxCommandEvent &  event)
private

Definition at line 631 of file LabelDialog.cpp.

632 {
633  // Ask user for a filename
634  wxString fileName =
635  SelectFile(FileNames::Operation::Open,
636  XO("Select a text file containing labels"),
637  wxEmptyString, // Path
638  wxT(""), // Name
639  wxT("txt"), // Extension
641  wxRESIZE_BORDER, // Flags
642  this); // Parent
643 
644  // They gave us one...
645  if (!fileName.empty()) {
646  wxTextFile f;
647 
648  // Get at the data
649  f.Open(fileName);
650  if (!f.IsOpened()) {
652  XO("Could not open file: %s").Format( fileName ) );
653  }
654  else {
655  // Create a temporary label track and load the labels
656  // into it
657  auto lt = std::make_shared<LabelTrack>();
658  lt->Import(f);
659 
660  // Add the labels to our collection
661  AddLabels(lt.get());
662 
663  // Done with the temporary track
664  }
665 
666  // Repopulate the grid
668  }
669 }

References AddLabels(), FileNames::AllFiles, AudacityMessageBox(), SelectFile(), FileNames::TextFiles, TransferDataToWindow(), and XO.

Here is the call graph for this function:

◆ OnInsert()

void LabelDialog::OnInsert ( wxCommandEvent &  event)
private

Definition at line 553 of file LabelDialog.cpp.

554 {
555  int cnt = mData.size();
556  int row = 0;
557  int index = 0;
558 
559  // Make sure the edit control isn't active before inserting any rows
560  if (mGrid->IsCellEditControlShown()) {
561  mGrid->HideCellEditControl();
562  }
563 
564  // Attempt to guess which track the label should reside on
565  if (cnt > 0) {
566  row = mGrid->GetGridCursorRow();
567  if (row > 0 && row >= cnt) {
569  .index( mGrid->GetCellValue(row - 1, Col_Track) );
570  }
571  else {
573  .index( mGrid->GetCellValue(row, Col_Track) );
574  }
575  }
576 
577  // Insert NEW label before or after the current row
578  if (event.GetId() == ID_INSERTA && row < cnt) {
579  row++;
580  }
581  mData.insert(mData.begin() + row, RowData(index, wxT(""), SelectedRegion()));
582 
583  // Repopulate the grid
585 
586  // Reposition cursor to NEW row/col and put user into edit mode to
587  // set the label name
588  mGrid->SetGridCursor(row, Col_Label);
589  mGrid->EnableCellEditControl(true);
590  mGrid->ShowCellEditControl();
591 }

References Col_Label, Col_Track, ID_INSERTA, make_iterator_range(), mData, mGrid, mTrackNames, and TransferDataToWindow().

Referenced by FindAllLabels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnOK()

void LabelDialog::OnOK ( wxCommandEvent &  event)
private

Definition at line 922 of file LabelDialog.cpp.

923 {
924  if (mGrid->IsCellEditControlShown()) {
925  mGrid->SaveEditControlValue();
926  mGrid->HideCellEditControl();
927  return;
928  }
929 
930  // Standard handling
931  if (Validate() && TransferDataFromWindow()) {
932  WriteSize();
933  EndModal(wxID_OK);
934  }
935 
936  return;
937 }

References mGrid, TransferDataFromWindow(), Validate(), and WriteSize().

Here is the call graph for this function:

◆ OnRemove()

void LabelDialog::OnRemove ( wxCommandEvent &  event)
private

Definition at line 593 of file LabelDialog.cpp.

594 {
595  int row = mGrid->GetGridCursorRow();
596  int col = mGrid->GetGridCursorCol();
597  int cnt = mData.size();
598 
599  // Don't try to remove if no labels exist
600  if (cnt == 0) {
601  return;
602  }
603 
604  // Make sure the edit control isn't active before removing rows
605  if (mGrid->IsCellEditControlShown()) {
606  mGrid->HideCellEditControl();
607  }
608 
609  // Remove the row
610  //RowData &rd = mData[row];
611  mData.erase(mData.begin() + row);
612 
613  // Repopulate the grid
615 
616  // Reposition the cursor
617  if (row > 0 && row >= --cnt) {
618  row--;
619  }
620  mGrid->SetGridCursor(row, col);
621 
622  // Make sure focus isn't lost
623  if (mData.size() == 0 && wxWindow::FindFocus() == mGrid->GetGridWindow()) {
624  wxWindow *ok = wxWindow::FindWindowById( wxID_OK, this);
625  if (ok) {
626  ok->SetFocus();
627  }
628  }
629 }

References mData, mGrid, and TransferDataToWindow().

Here is the call graph for this function:

◆ OnSelectCell()

void LabelDialog::OnSelectCell ( wxGridEvent &  event)
private

Definition at line 746 of file LabelDialog.cpp.

747 {
748  for (auto t: mTracks->Any())
749  t->SetSelected( true );
750 
751  if (!mData.empty())
752  {
753  RowData &rd = mData[event.GetRow()];
755 
757  }
758 
759  event.Skip();
760 }

References TrackList::Any(), ProjectWindow::Get(), mData, mProject, mTracks, mViewInfo, ProjectWindow::RedrawProject(), ViewInfo::selectedRegion, and RowData::selectedRegion.

Here is the call graph for this function:

◆ OnUpdate()

void LabelDialog::OnUpdate ( wxCommandEvent &  event)
private

Definition at line 533 of file LabelDialog.cpp.

534 {
535  // Remember the NEW format and repopulate grid
537  NumericConverter::TIME, event.GetString() );
539 
540  event.Skip(false);
541 }

References NumericConverter::LookupFormat(), mFormat, NumericConverter::TIME, and TransferDataToWindow().

Here is the call graph for this function:

◆ Populate()

void LabelDialog::Populate ( )
private

Creates the dialog and its contents.

Definition at line 216 of file LabelDialog.cpp.

217 {
218 
219  //------------------------- Main section --------------------
220  ShuttleGui S(this, eIsCreating);
222  // ----------------------- End of main section --------------
223 
224  // Go populate the macros list.
225  PopulateLabels();
226 
227  // Layout the works
228  Layout();
229  //Fit();
230 
231  // Resize width based on width of columns and the vertical scrollbar
232  wxRect r = mGrid->GetGridColLabelWindow()->GetRect();
233  wxScrollBar sb(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSB_VERTICAL);
234  r.width += sb.GetSize().GetWidth() + 6;
235 
236  // Add the size of the right column of buttons too...
237  wxWindow * w = FindWindowById( ID_IMPORT, this );
238  wxASSERT( w );
239  if( w )
240  r.width += w->GetSize().GetWidth();
241 
242  SetClientSize(r.width, 300);
243 
244  // Make sure it doesn't go below this size
245  r = GetRect();
246  SetSizeHints(r.GetWidth(), r.GetHeight());
247 
248  // Bug 1465
249  // There might be a saved size, in which case use that.
250  ReadSize();
251 
252  // Center on display
253  Center();
254 }

References eIsCreating, ID_IMPORT, mGrid, PopulateLabels(), PopulateOrExchange(), and ReadSize().

Here is the call graph for this function:

◆ PopulateLabels()

void LabelDialog::PopulateLabels ( )
private

Definition at line 129 of file LabelDialog.cpp.

130 {
131  // Build the initial (empty) grid
132  mGrid->CreateGrid(0, Col_Max, wxGrid::wxGridSelectRows);
133  mGrid->SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_CENTER);
134  mGrid->SetRowLabelSize(0);
135 
136  size_t ii = 0;
137  for ( const auto &label : {
138  /* i18n-hint: (noun). A track contains waves, audio etc.*/
139  XO("Track"),
140  /* i18n-hint: (noun)*/
141  XO("Label"),
142  /* i18n-hint: (noun) of a label*/
143  XO("Start Time"),
144  /* i18n-hint: (noun) of a label*/
145  XO("End Time"),
146  /* i18n-hint: (noun) of a label*/
147  XO("Low Frequency"),
148  /* i18n-hint: (noun) of a label*/
149  XO("High Frequency"),
150  })
151  mGrid->SetColLabelValue( ii++, label.Translation() );
152 
153  // Create and remember editors. No need to DELETE these as the wxGrid will
154  // do it for us. (The DecRef() that is needed after GetDefaultEditorForType
155  // becomes the duty of the wxGridCellAttr objects after we set them in the grid.)
156  mChoiceEditor = (ChoiceEditor *) mGrid->GetDefaultEditorForType(GRID_VALUE_CHOICE);
157  mTimeEditor = static_cast<NumericEditor*>
158  (mGrid->GetDefaultEditorForType(GRID_VALUE_TIME));
159  mFrequencyEditor = static_cast<NumericEditor *>
160  (mGrid->GetDefaultEditorForType(GRID_VALUE_FREQUENCY));
161 
162  // Initialize and set the track name column attributes
163  wxGridCellAttr *attr;
164  mGrid->SetColAttr(Col_Track, (attr = safenew wxGridCellAttr));
165  attr->SetEditor(mChoiceEditor);
166  mTrackNames.push_back(_("New..."));
167 
168  // Initialize and set the time column attributes
169  mGrid->SetColAttr(Col_Stime, (attr = safenew wxGridCellAttr));
170  // Don't need DecRef() after this GetDefaultRendererForType.
171  attr->SetRenderer(mGrid->GetDefaultRendererForType(GRID_VALUE_TIME));
172  attr->SetEditor(mTimeEditor);
173  attr->SetAlignment(wxALIGN_CENTER, wxALIGN_CENTER);
174 
175  mGrid->SetColAttr(Col_Etime, attr->Clone());
176 
177  // Initialize and set the frequency column attributes
178  mGrid->SetColAttr(Col_Lfreq, (attr = safenew wxGridCellAttr));
179  // Don't need DecRef() after this GetDefaultRendererForType.
180  attr->SetRenderer(mGrid->GetDefaultRendererForType(GRID_VALUE_FREQUENCY));
181  attr->SetEditor(mFrequencyEditor);
182  attr->SetAlignment(wxALIGN_CENTER, wxALIGN_CENTER);
183 
184  mGrid->SetColAttr(Col_Hfreq, attr->Clone());
185 
186  // Seems there's a bug in wxGrid. Adding only 1 row does not
187  // allow SetCellSize() to work properly and you will not get
188  // the expected 1 row by 4 column cell.
189  //
190  // So, we set the minimum row height to 0 and basically hide
191  // the extra row by setting its height to 0. And not allowing the
192  // rows to be manually resized prevents the user from ever seeing
193  // the extra row.
194  mGrid->SetRowMinimalAcceptableHeight(0);
195  mGrid->EnableDragRowSize(false);
196 
197  // Locate all labels in current track list
198  FindAllLabels();
199 
200  // Populate the grid
202 
203  // Resize the label name column and ensure it doesn't go below an
204  // arbitrary width.
205  //
206  // This should not be in TransferDataToWindow() since a user might
207  // resize the column and we'd resize it back to the minimum.
208  mGrid->AutoSizeColumn(Col_Label, false );
209  mGrid->SetColSize(Col_Label, wxMax(150, mGrid->GetColSize(Col_Label)));
210  mGrid->SetColMinimalWidth(Col_Label, mGrid->GetColSize(Col_Label));
211 
212 }

References _, Col_Etime, Col_Hfreq, Col_Label, Col_Lfreq, Col_Max, Col_Stime, Col_Track, FindAllLabels(), GRID_VALUE_CHOICE, GRID_VALUE_FREQUENCY, GRID_VALUE_TIME, label, mChoiceEditor, mFrequencyEditor, mGrid, mTimeEditor, mTrackNames, safenew, TransferDataToWindow(), TranslatableString::Translation(), and XO.

Referenced by Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ PopulateOrExchange()

void LabelDialog::PopulateOrExchange ( ShuttleGui S)
private

Definition at line 256 of file LabelDialog.cpp.

257 {
258  S.AddFixedText(XO("Press F2 or double click to edit cell contents."));
259  S.StartHorizontalLay(wxEXPAND,1);
260  {
261  S.StartVerticalLay(wxEXPAND,1);
262  {
263  mGrid = safenew Grid(S.GetParent(), wxID_ANY);
264  S.Prop(1).AddWindow( mGrid );
265  }
266  S.EndVerticalLay();
267  S.StartVerticalLay(0);
268  {
269  //S.Id(ID_INSERTA).AddButton(XO("&Insert"), wxALIGN_LEFT);
270  S.Id(ID_INSERTB).AddButton(XXO("&Insert"), wxALIGN_LEFT);
271  //S.Id(EditButtonID).AddButton(XO("&Edit"), wxALIGN_LEFT);
272  S.Id(ID_REMOVE).AddButton(XXO("De&lete"), wxALIGN_LEFT);
273  S.Id(ID_IMPORT).AddButton(XXO("I&mport..."), wxALIGN_LEFT);
274  S.Id(ID_EXPORT).AddButton(XXO("&Export..."), wxALIGN_LEFT);
275  }
276  S.EndVerticalLay();
277  }
278  S.EndHorizontalLay();
279 
280  S.StartHorizontalLay(wxALIGN_RIGHT, false);
281  {
283  }
284  S.EndHorizontalLay();
285 }

References ShuttleGuiBase::AddButton(), ShuttleGuiBase::AddFixedText(), ShuttleGui::AddStandardButtons(), ShuttleGuiBase::AddWindow(), eCancelButton, eHelpButton, ShuttleGuiBase::EndHorizontalLay(), ShuttleGuiBase::EndVerticalLay(), eOkButton, ShuttleGuiBase::GetParent(), ShuttleGui::Id(), ID_EXPORT, ID_IMPORT, ID_INSERTB, ID_REMOVE, mGrid, ShuttleGui::Prop(), safenew, ShuttleGuiBase::StartHorizontalLay(), ShuttleGuiBase::StartVerticalLay(), XO, and XXO.

Referenced by Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReadSize()

void LabelDialog::ReadSize ( )
private

Definition at line 903 of file LabelDialog.cpp.

903  {
904  wxSize sz = GetSize();
905  int prefWidth, prefHeight;
906  gPrefs->Read(wxT("/LabelEditor/Width"), &prefWidth, sz.x);
907  gPrefs->Read(wxT("/LabelEditor/Height"), &prefHeight, sz.y);
908 
909  wxRect screenRect(wxGetClientDisplayRect());
910  wxSize prefSize = wxSize(prefWidth, prefHeight);
911  prefSize.DecTo(screenRect.GetSize());
912  SetSize(prefSize);
913 }

References gPrefs.

Referenced by Populate().

Here is the caller graph for this function:

◆ Show()

bool LabelDialog::Show ( bool  show = true)
override

Definition at line 357 of file LabelDialog.cpp.

358 {
359  bool ret = wxDialogWrapper::Show(show);
360 
361 #if defined(__WXMAC__) || defined(__WXGTK__)
362  if (show) {
363  mGrid->SetFocus(); // Required for Linux and Mac.
364  }
365 #endif
366 
367  // Set initial row
368  // (This will not work until the grid is actually displayed)
369  if (show && mInitialRow != -1) {
370  mGrid->GoToCell(mInitialRow, Col_Label);
371  }
372 
373  return ret;
374 }

References Col_Label, mGrid, and mInitialRow.

◆ TrackName()

wxString LabelDialog::TrackName ( int &  index,
const wxString &  dflt = _("Label Track") 
)
private

Definition at line 446 of file LabelDialog.cpp.

447 {
448  // Generate a NEW track name if the passed index is out of range
449  if (index < 1 || index >= (int)mTrackNames.size()) {
450  index = mTrackNames.size();
451  mTrackNames.push_back(wxString::Format(wxT("%d - %s"), index, dflt));
452  }
453 
454  // Return the track name
455  return mTrackNames[index];
456 }

References mTrackNames.

Referenced by AddLabels(), OnChangeTrack(), and TransferDataToWindow().

Here is the caller graph for this function:

◆ TransferDataFromWindow()

bool LabelDialog::TransferDataFromWindow ( )
overrideprivate

Definition at line 376 of file LabelDialog.cpp.

377 {
378  int cnt = mData.size();
379  int i;
380  int tndx = 0;
381 
382  // Clear label tracks of labels
383  for (auto lt : mTracks->Any<LabelTrack>()) {
384  ++tndx;
385  if (!mSelectedTrack) {
386  for (i = lt->GetNumLabels() - 1; i >= 0 ; i--) {
387  lt->DeleteLabel(i);
388  }
389  }
390  else if (mSelectedTrack == lt && mIndex > -1) {
391  lt->DeleteLabel(mIndex);
392  }
393  else
394  // Do nothing to the nonselected tracks
395  ;
396  }
397 
398  // Create any added tracks
399  while (tndx < (int)mTrackNames.size() - 1) {
400 
401  // Extract the name
402  wxString name = mTrackNames[tndx + 1].AfterFirst(wxT('-')).Mid(1);
403 
404  // Create the NEW track and add to track list
405  auto newTrack = std::make_shared<LabelTrack>();
406  newTrack->SetName(name);
407  mTracks->Add( newTrack );
408  tndx++;
409  }
410 
411  // Repopulate with updated labels
412  for (i = 0; i < cnt; i++) {
413  RowData &rd = mData[i];
414 
415  // Look for track with matching index
416  tndx = 1;
417  LabelTrack *lt{};
418  for (auto t : mTracks->Any<LabelTrack>()) {
419  lt = t;
420  if (rd.index == tndx++) {
421  break;
422  }
423  }
424  wxASSERT(lt);
425  if (!lt)
426  return false;
427 
428  // Add the label to it
429  lt->AddLabel(rd.selectedRegion, rd.title);
431  }
432 
433  return true;
434 }

References TrackList::Add(), TrackList::Any(), LabelTrackView::Get(), RowData::index, mData, mIndex, mSelectedTrack, mTrackNames, mTracks, name, LabelTrackView::ResetTextSelection(), RowData::selectedRegion, and RowData::title.

Referenced by OnOK().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TransferDataToWindow()

bool LabelDialog::TransferDataToWindow ( )
overrideprivate

Definition at line 294 of file LabelDialog.cpp.

295 {
296  int cnt = mData.size();
297  int i;
298 
299  // Set the editor parameters. Do this each time since they may change
300  // due to NEW tracks and change in NumericTextCtrl format. Rate won't
301  // change but might as well leave it here.
307 
308  // Disable redrawing until we're done
309  mGrid->BeginBatch();
310 
311  // Delete all rows
312  if (mGrid->GetNumberRows()) {
313  mGrid->DeleteRows(0, mGrid->GetNumberRows());
314  }
315 
316  // Add the exact number that we'll need
317  mGrid->InsertRows(0, cnt);
318 
319  // Populate the rows
320  for (i = 0; i < cnt; i++) {
321  RowData &rd = mData[i];
322 
323  // Set the cell contents
324  mGrid->SetCellValue(i, Col_Track, TrackName(rd.index));
325  mGrid->SetCellValue(i, Col_Label, rd.title);
326  mGrid->SetCellValue(i, Col_Stime,
327  wxString::Format(wxT("%g"), rd.selectedRegion.t0()));
328  mGrid->SetCellValue(i, Col_Etime,
329  wxString::Format(wxT("%g"), rd.selectedRegion.t1()));
330  mGrid->SetCellValue(i, Col_Lfreq,
331  wxString::Format(wxT("%g"), rd.selectedRegion.f0()));
332  mGrid->SetCellValue(i, Col_Hfreq,
333  wxString::Format(wxT("%g"), rd.selectedRegion.f1()));
334  }
335 
336  // Autosize all the rows
337  mGrid->AutoSizeRows(true);
338 
339  // Resize the track name column. Use a wxChoice to determine the maximum
340  // width needed.
341  wxChoice tc(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, mTrackNames);
342  mGrid->SetColSize(Col_Track, tc.GetSize().x);
343  mGrid->SetColMinimalWidth(Col_Track, tc.GetSize().x);
344 
345  // Autosize the time columns and set their minimal widths
346  mGrid->AutoSizeColumn(Col_Stime);
347  mGrid->AutoSizeColumn(Col_Etime);
348  mGrid->AutoSizeColumn(Col_Lfreq);
349  mGrid->AutoSizeColumn(Col_Hfreq);
350 
351  // We're done, so allow the grid to redraw
352  mGrid->EndBatch();
353 
354  return true;
355 }

References Col_Etime, Col_Hfreq, Col_Label, Col_Lfreq, Col_Stime, Col_Track, RowData::index, mChoiceEditor, mData, mFormat, mFreqFormat, mFrequencyEditor, mGrid, mRate, mTimeEditor, mTrackNames, RowData::selectedRegion, ChoiceEditor::SetChoices(), NumericEditor::SetFormat(), NumericEditor::SetRate(), SelectedRegion::t0(), SelectedRegion::t1(), RowData::title, and TrackName().

Referenced by OnChangeTrack(), OnFreqUpdate(), OnImport(), OnInsert(), OnRemove(), OnUpdate(), and PopulateLabels().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Validate()

bool LabelDialog::Validate ( )
overrideprivate

Definition at line 436 of file LabelDialog.cpp.

437 {
438  if (mGrid->IsCellEditControlShown()) {
439  mGrid->HideCellEditControl();
440  mGrid->SaveEditControlValue();
441  }
442 
443  return true;
444 }

References mGrid.

Referenced by OnOK().

Here is the caller graph for this function:

◆ WriteSize()

void LabelDialog::WriteSize ( )
private

Definition at line 915 of file LabelDialog.cpp.

915  {
916  wxSize sz = GetSize();
917  gPrefs->Write(wxT("/LabelEditor/Width"), sz.x);
918  gPrefs->Write(wxT("/LabelEditor/Height"), sz.y);
919  gPrefs->Flush();
920 }

References FileConfig::Flush(), and gPrefs.

Referenced by OnCancel(), and OnOK().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mChoiceEditor

ChoiceEditor* LabelDialog::mChoiceEditor
private

Definition at line 99 of file LabelDialog.h.

Referenced by PopulateLabels(), and TransferDataToWindow().

◆ mData

RowDataArray LabelDialog::mData
private

◆ mFormat

NumericFormatSymbol LabelDialog::mFormat
private

Definition at line 111 of file LabelDialog.h.

Referenced by OnUpdate(), and TransferDataToWindow().

◆ mFreqFormat

NumericFormatSymbol LabelDialog::mFreqFormat
private

Definition at line 111 of file LabelDialog.h.

Referenced by OnFreqUpdate(), and TransferDataToWindow().

◆ mFrequencyEditor

NumericEditor* LabelDialog::mFrequencyEditor
private

Definition at line 101 of file LabelDialog.h.

Referenced by PopulateLabels(), and TransferDataToWindow().

◆ mGrid

Grid* LabelDialog::mGrid
private

◆ mIndex

int LabelDialog::mIndex { -1 }
private

Definition at line 107 of file LabelDialog.h.

Referenced by AddLabels(), and TransferDataFromWindow().

◆ mInitialRow

int LabelDialog::mInitialRow
private

Definition at line 113 of file LabelDialog.h.

Referenced by FindInitialRow(), and Show().

◆ mProject

AudacityProject& LabelDialog::mProject
private

Definition at line 96 of file LabelDialog.h.

Referenced by OnSelectCell().

◆ mRate

double LabelDialog::mRate
private

Definition at line 110 of file LabelDialog.h.

Referenced by TransferDataToWindow().

◆ mSelectedTrack

LabelTrack* LabelDialog::mSelectedTrack {}
private

Definition at line 106 of file LabelDialog.h.

Referenced by AddLabels(), and TransferDataFromWindow().

◆ mTimeEditor

NumericEditor* LabelDialog::mTimeEditor
private

Definition at line 100 of file LabelDialog.h.

Referenced by PopulateLabels(), and TransferDataToWindow().

◆ mTrackNames

wxArrayString LabelDialog::mTrackNames
private

◆ mTracks

TrackList* LabelDialog::mTracks
private

Definition at line 105 of file LabelDialog.h.

Referenced by FindAllLabels(), OnSelectCell(), and TransferDataFromWindow().

◆ mViewInfo

ViewInfo* LabelDialog::mViewInfo
private

Definition at line 108 of file LabelDialog.h.

Referenced by FindInitialRow(), and OnSelectCell().


The documentation for this class was generated from the following files:
LabelDialog::mGrid
Grid * mGrid
Definition: LabelDialog.h:98
LabelDialog::OnChangeLfreq
void OnChangeLfreq(wxGridEvent &event, int row, RowData *rd)
Definition: LabelDialog.cpp:879
eIsCreating
@ eIsCreating
Definition: ShuttleGui.h:38
LabelDialog::OnChangeHfreq
void OnChangeHfreq(wxGridEvent &event, int row, RowData *rd)
Definition: LabelDialog.cpp:891
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
make_iterator_range
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:551
Col_Label
@ Col_Label
Definition: LabelDialog.cpp:51
GRID_VALUE_FREQUENCY
#define GRID_VALUE_FREQUENCY
Definition: Grid.h:35
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Definition: AudacityMessageBox.cpp:17
GRID_VALUE_TIME
#define GRID_VALUE_TIME
Definition: Grid.h:34
LabelDialog::PopulateLabels
void PopulateLabels()
Definition: LabelDialog.cpp:129
LabelStruct::title
wxString title
Definition: LabelTrack.h:71
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
LabelDialog::TrackName
wxString TrackName(int &index, const wxString &dflt=_("Label Track"))
Definition: LabelDialog.cpp:446
LabelDialog::OnChangeLabel
void OnChangeLabel(wxGridEvent &event, int row, RowData *rd)
Definition: LabelDialog.cpp:847
SelectedRegion::t1
double t1() const
Definition: SelectedRegion.h:92
eHelpButton
@ eHelpButton
Definition: ShuttleGui.h:604
Track::GetName
wxString GetName() const
Definition: Track.h:426
Col_Track
@ Col_Track
Definition: LabelDialog.cpp:50
LabelDialog::mData
RowDataArray mData
Definition: LabelDialog.h:103
SelectFile
FilePath SelectFile(FileNames::Operation op, const TranslatableString &message, const FilePath &default_path, const FilePath &default_filename, const FileExtension &default_extension, const FileTypes &fileTypes, int flags, wxWindow *parent)
Definition: SelectFile.cpp:17
AudacityTextEntryDialog
Wrap wxTextEntryDialog so that caption IS translatable.
Definition: AudacityTextEntryDialog.h:23
Format
Abstract base class used in importing a file.
Col_Etime
@ Col_Etime
Definition: LabelDialog.cpp:53
Grid
Supplies an accessible grid based on wxGrid.
Definition: Grid.h:185
LabelDialog::FindAllLabels
void FindAllLabels()
Definition: LabelDialog.cpp:458
LabelDialog::mViewInfo
ViewInfo * mViewInfo
Definition: LabelDialog.h:108
XO
#define XO(s)
Definition: Internat.h:31
LabelDialog::mSelectedTrack
LabelTrack * mSelectedTrack
Definition: LabelDialog.h:106
TrackList::Add
TrackKind * Add(const std::shared_ptr< TrackKind > &t)
Definition: Track.h:1503
LabelDialog::OnInsert
void OnInsert(wxCommandEvent &event)
Definition: LabelDialog.cpp:553
LabelTrack
A LabelTrack is a Track that holds labels (LabelStruct).
Definition: LabelTrack.h:88
GRID_VALUE_CHOICE
#define GRID_VALUE_CHOICE
Definition: Grid.h:117
Col_Max
@ Col_Max
Definition: LabelDialog.cpp:56
ProjectWindow::Get
static ProjectWindow & Get(AudacityProject &project)
Definition: ProjectWindow.cpp:535
ID_REMOVE
@ ID_REMOVE
Definition: LabelDialog.cpp:76
LabelDialog::mFrequencyEditor
NumericEditor * mFrequencyEditor
Definition: LabelDialog.h:101
FileNames::AllFiles
FILES_API const FileType AllFiles
Definition: FileNames.h:71
LabelDialog::Validate
bool Validate() override
Definition: LabelDialog.cpp:436
Col_Lfreq
@ Col_Lfreq
Definition: LabelDialog.cpp:54
LabelStruct
A LabelStruct holds information for ONE label in a LabelTrack.
Definition: LabelTrack.h:30
HelpSystem::ShowHelp
static void ShowHelp(wxWindow *parent, const FilePath &localFileName, const URLString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:237
ID_INSERTA
@ ID_INSERTA
Definition: LabelDialog.cpp:74
RowData::title
wxString title
Definition: LabelDialog.cpp:69
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2274
LabelDialog::AddLabels
void AddLabels(const LabelTrack *t)
Definition: LabelDialog.cpp:473
LabelDialog::TransferDataToWindow
bool TransferDataToWindow() override
Definition: LabelDialog.cpp:294
RowData::selectedRegion
SelectedRegion selectedRegion
Definition: LabelDialog.cpp:70
NumericConverter::LookupFormat
static NumericFormatSymbol LookupFormat(Type type, const wxString &id)
Definition: NumericTextCtrl.cpp:704
SelectedRegion::setT0
bool setT0(double t, bool maySwap=true)
Definition: SelectedRegion.h:112
ViewInfo::selectedRegion
NotifyingSelectedRegion selectedRegion
Definition: ViewInfo.h:229
XXO
#define XXO(s)
Definition: Internat.h:44
eCancelButton
@ eCancelButton
Definition: ShuttleGui.h:601
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1177
ID_INSERTB
@ ID_INSERTB
Definition: LabelDialog.cpp:75
label
TranslatableString label
Definition: Tags.cpp:756
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1167
LabelStruct::selectedRegion
SelectedRegion selectedRegion
Definition: LabelTrack.h:70
FileNames::TextFiles
FILES_API const FileType TextFiles
Definition: FileNames.h:74
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
ID_EXPORT
@ ID_EXPORT
Definition: LabelDialog.cpp:78
LabelDialog::mIndex
int mIndex
Definition: LabelDialog.h:107
ID_IMPORT
@ ID_IMPORT
Definition: LabelDialog.cpp:77
ShuttleGuiBase::AddFixedText
void AddFixedText(const TranslatableString &Str, bool bCenter=false, int wrapWidth=0)
Definition: ShuttleGui.cpp:440
name
const TranslatableString name
Definition: Distortion.cpp:98
RowData::index
int index
Definition: LabelDialog.cpp:68
NumericConverter::TIME
@ TIME
Definition: NumericTextCtrl.h:52
LabelDialog::mFreqFormat
NumericFormatSymbol mFreqFormat
Definition: LabelDialog.h:111
ShuttleGuiBase::GetParent
wxWindow * GetParent()
Definition: ShuttleGui.h:496
LabelTrackView::Get
static LabelTrackView & Get(LabelTrack &)
Definition: LabelTrackView.cpp:162
ShuttleGuiBase::AddWindow
wxWindow * AddWindow(wxWindow *pWindow, int PositionFlags=wxALIGN_CENTRE)
Definition: ShuttleGui.cpp:299
Col_Hfreq
@ Col_Hfreq
Definition: LabelDialog.cpp:55
LabelDialog::mTimeEditor
NumericEditor * mTimeEditor
Definition: LabelDialog.h:100
LabelDialog::FindInitialRow
void FindInitialRow()
Definition: LabelDialog.cpp:493
ShuttleGui::Prop
ShuttleGui & Prop(int iProp)
Definition: ShuttleGui.h:725
NumericConverter::FREQUENCY
@ FREQUENCY
Definition: NumericTextCtrl.h:54
LabelDialog::OnChangeStime
void OnChangeStime(wxGridEvent &event, int row, RowData *rd)
Definition: LabelDialog.cpp:855
ShuttleGuiBase::AddButton
wxButton * AddButton(const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
Definition: ShuttleGui.cpp:360
NumericEditor::SetRate
void SetRate(double rate)
Definition: Grid.cpp:240
NumericEditor
wxGridCellEditor for the NumericTextCtrl.
Definition: Grid.h:38
SelectedRegion::t0
double t0() const
Definition: SelectedRegion.h:91
Col_Stime
@ Col_Stime
Definition: LabelDialog.cpp:52
LabelTrack::GetNumLabels
int GetNumLabels() const
Definition: LabelTrack.cpp:921
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
eOkButton
@ eOkButton
Definition: ShuttleGui.h:600
LabelDialog::mProject
AudacityProject & mProject
Definition: LabelDialog.h:96
LabelDialog::OnChangeEtime
void OnChangeEtime(wxGridEvent &event, int row, RowData *rd)
Definition: LabelDialog.cpp:867
RowData
Definition: LabelDialog.cpp:62
_
#define _(s)
Definition: Internat.h:75
ChoiceEditor
Modified version of wxGridChoiceEditor using wxChoice instead of wxComboBox.
Definition: Grid.h:121
LabelDialog::GetHelpPageName
ManualPageID GetHelpPageName()
Definition: LabelDialog.h:64
LabelTrack::GetLabel
const LabelStruct * GetLabel(int index) const
Definition: LabelTrack.cpp:926
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2444
LabelDialog::ReadSize
void ReadSize()
Definition: LabelDialog.cpp:903
LabelDialog::OnChangeTrack
void OnChangeTrack(wxGridEvent &event, int row, RowData *rd)
Definition: LabelDialog.cpp:813
LabelDialog::mRate
double mRate
Definition: LabelDialog.h:110
ChoiceEditor::SetChoices
void SetChoices(const wxArrayString &choices)
Definition: Grid.cpp:453
NumericEditor::SetFormat
void SetFormat(const NumericFormatSymbol &format)
Definition: Grid.cpp:235
NotifyingSelectedRegion::t0
double t0() const
Definition: ViewInfo.h:47
TranslatableString::Translation
wxString Translation() const
Definition: TranslatableString.h:79
ProjectWindow::RedrawProject
void RedrawProject(const bool bForceWaveTracks=false)
Definition: ProjectWindow.cpp:710
TrackList::Any
auto Any() -> TrackIterRange< TrackType >
Definition: Track.h:1371
LabelDialog::WriteSize
void WriteSize()
Definition: LabelDialog.cpp:915
LabelDialog::mChoiceEditor
ChoiceEditor * mChoiceEditor
Definition: LabelDialog.h:99
LabelDialog::mInitialRow
int mInitialRow
Definition: LabelDialog.h:113
safenew
#define safenew
Definition: MemoryX.h:10
LabelDialog::mTrackNames
wxArrayString mTrackNames
Definition: LabelDialog.h:109
LabelDialog::mFormat
NumericFormatSymbol mFormat
Definition: LabelDialog.h:111
SelectedRegion::setT1
bool setT1(double t, bool maySwap=true)
Definition: SelectedRegion.h:124
LabelTrackView::ResetTextSelection
void ResetTextSelection()
Definition: LabelTrackView.cpp:1009
LabelDialog::mTracks
TrackList * mTracks
Definition: LabelDialog.h:105
LabelDialog::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: LabelDialog.cpp:376
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
SelectedRegion
Defines a selected portion of a project.
Definition: SelectedRegion.h:35
LabelDialog::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: LabelDialog.cpp:256