1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-30 07:29:29 +02:00
audacity/src/LabelDialog.h
Paul Licameli 5162ab5c5b Use TrackFactory in more places...
... There should now be no direct allocation of Track subclasses with new,
except in those classes' own methods
2016-03-26 11:50:09 -04:00

92 lines
2.1 KiB
C++

/**********************************************************************
Audacity: A Digital Audio Editor
LabelDialog.h
Dominic Mazzoni
**********************************************************************/
#ifndef __AUDACITY_LABELDIALOG__
#define __AUDACITY_LABELDIALOG__
#include <vector>
#include <wx/defs.h>
#include <wx/dialog.h>
#include <wx/event.h>
#include <wx/grid.h>
#include <wx/string.h>
#include "Internat.h"
#include "widgets/Grid.h"
class TrackFactory;
class TrackList;
class RowData;
class EmptyLabelRenderer;
class LabelTrack;
class ViewInfo;
typedef std::vector<RowData> RowDataArray;
class LabelDialog final : public wxDialog
{
public:
LabelDialog(wxWindow *parent,
TrackFactory &factory,
TrackList *tracks,
ViewInfo &viewinfo,
double rate,
const wxString & format);
~LabelDialog();
bool Show(bool show = true) override;
private:
bool TransferDataToWindow();
bool TransferDataFromWindow();
bool Validate();
void FindAllLabels();
void AddLabels(LabelTrack *t);
void FindInitialRow();
wxString TrackName(int & index, const wxString &dflt = _("Label Track"));
void OnUpdate(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 OnOK(wxCommandEvent &event);
void OnCancel(wxCommandEvent &event);
private:
Grid *mGrid;
ChoiceEditor *mChoiceEditor;
TimeEditor *mTimeEditor;
RowDataArray mData;
TrackFactory &mFactory;
TrackList *mTracks;
ViewInfo *mViewInfo;
wxArrayString mTrackNames;
double mRate;
wxString mFormat;
int mInitialRow;
DECLARE_EVENT_TABLE();
};
#endif