Audacity 3.2.0
TagsEditor.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 TagsEditor.h
6
7 Paul Licameli split from Tags.h
8
9 **********************************************************************/
10
11#ifndef __AUDACITY_TAGS_EDITOR__
12#define __AUDACITY_TAGS_EDITOR__
13
14#include "Tags.h" // member variable
15#include "wxPanelWrapper.h" // to inherit
16
17class ShuttleGui;
18class wxStaticText;
19class wxButton;
20
22{
23 public:
24 // constructors and destructors
25 TagsEditorDialog(wxWindow * parent,
27 std::vector<Tags*> tags,
28 std::vector<wxString> names,
29 bool editTitle,
30 bool editTrack);
31
32 virtual ~TagsEditorDialog();
33
34 AUDACITY_DLL_API static bool ShowEditDialog( Tags &tags,
35 wxWindow *parent, const TranslatableString &title );
36
39 AUDACITY_DLL_API static bool EditProjectMetadata(AudacityProject &project,
41 const TranslatableString &shortUndoDescription);
42
43#if !defined(__WXMSW__)
44 bool IsEscapeKey(const wxKeyEvent& /*event*/) override { return false; }
45#endif
46
48
49 void OnHelp(wxCommandEvent & Evt);
50 bool TransferDataToWindow() override;
51 bool TransferDataFromWindow() override;
52
53 private:
54 void PopulateGenres();
55 void SetEditors();
56
57 void OnNext(wxCommandEvent&);
58 void OnPrev(wxCommandEvent&);
59
60 void OnChange(wxGridEvent & event);
61
62 void OnEdit(wxCommandEvent & event);
63 void OnReset(wxCommandEvent & event);
64
65 void OnClear(wxCommandEvent & event);
66
67 void OnLoad(wxCommandEvent & event);
68 void OnSave(wxCommandEvent & event);
69 void OnSaveDefaults(wxCommandEvent & event);
70
71 void OnAdd(wxCommandEvent & event);
72 void OnRemove(wxCommandEvent & event);
73
74 void OnOk(wxCommandEvent & event);
75 void DoCancel(bool escKey);
76 void OnCancel(wxCommandEvent & event);
77
78 void OnKeyDown(wxKeyEvent &event);
79
80 bool IsWindowRectValid(const wxRect *windowRect) const;
81
82 private:
83 std::vector<Tags*> mTags;
84 std::vector<wxString> mNames;
86
89
90 std::vector<std::unique_ptr<Tags>> mEditTags;
91
93 wxStaticText* mName{};
94 wxButton* mNext{};
95 wxButton* mPrev{};
97 wxGridCellStringRenderer *mStringRenderer;
98
99 DECLARE_EVENT_TABLE()
100};
101
102#endif
static const auto title
static TranslatableStrings names
Definition: TagsEditor.cpp:153
const auto project
#define S(N)
Definition: ToChars.cpp:64
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
Supplies an accessible grid based on wxGrid.
Definition: Grid.h:190
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:630
Derived from ExpandingToolBar, this dialog allows editing of Tags.
Definition: TagsEditor.h:22
void OnRemove(wxCommandEvent &event)
Definition: TagsEditor.cpp:833
wxButton * mPrev
Definition: TagsEditor.h:95
std::vector< Tags * > mTags
Definition: TagsEditor.h:83
wxGridCellStringRenderer * mStringRenderer
Definition: TagsEditor.h:97
void DoCancel(bool escKey)
Definition: TagsEditor.cpp:889
wxStaticText * mName
Definition: TagsEditor.h:93
static AUDACITY_DLL_API bool ShowEditDialog(Tags &tags, wxWindow *parent, const TranslatableString &title)
Definition: TagsEditor.cpp:30
virtual ~TagsEditorDialog()
Definition: TagsEditor.cpp:283
std::vector< std::unique_ptr< Tags > > mEditTags
Definition: TagsEditor.h:90
void OnClear(wxCommandEvent &event)
Definition: TagsEditor.cpp:661
void OnAdd(wxCommandEvent &event)
Definition: TagsEditor.cpp:828
void OnKeyDown(wxKeyEvent &event)
Definition: TagsEditor.cpp:910
bool IsWindowRectValid(const wxRect *windowRect) const
Definition: TagsEditor.cpp:979
void OnReset(wxCommandEvent &event)
Definition: TagsEditor.cpp:614
void PopulateOrExchange(ShuttleGui &S)
Definition: TagsEditor.cpp:296
void OnNext(wxCommandEvent &)
Definition: TagsEditor.cpp:934
void OnPrev(wxCommandEvent &)
Definition: TagsEditor.cpp:944
bool TransferDataToWindow() override
Definition: TagsEditor.cpp:451
void OnOk(wxCommandEvent &event)
Definition: TagsEditor.cpp:854
void OnLoad(wxCommandEvent &event)
Definition: TagsEditor.cpp:668
std::vector< wxString > mNames
Definition: TagsEditor.h:84
void OnSave(wxCommandEvent &event)
Definition: TagsEditor.cpp:725
bool TransferDataFromWindow() override
Definition: TagsEditor.cpp:395
void OnHelp(wxCommandEvent &Evt)
Definition: TagsEditor.cpp:390
void OnSaveDefaults(wxCommandEvent &event)
Definition: TagsEditor.cpp:786
void OnChange(wxGridEvent &event)
Definition: TagsEditor.cpp:522
ComboEditor * mComboEditor
Definition: TagsEditor.h:96
void OnEdit(wxCommandEvent &event)
Definition: TagsEditor.cpp:559
wxButton * mNext
Definition: TagsEditor.h:94
void OnCancel(wxCommandEvent &event)
Definition: TagsEditor.cpp:884
static AUDACITY_DLL_API bool EditProjectMetadata(AudacityProject &project, const TranslatableString &title, const TranslatableString &shortUndoDescription)
TagsEditorDialog(wxWindow *parent, const TranslatableString &title, std::vector< Tags * > tags, std::vector< wxString > names, bool editTitle, bool editTrack)
Definition: TagsEditor.cpp:212
ID3 Tags (for MP3)
Definition: Tags.h:73
Holds a msgid for the translation catalog; may also bind format arguments.