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:640
Derived from ExpandingToolBar, this dialog allows editing of Tags.
Definition: TagsEditor.h:22
void OnRemove(wxCommandEvent &event)
Definition: TagsEditor.cpp:835
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:891
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:285
std::vector< std::unique_ptr< Tags > > mEditTags
Definition: TagsEditor.h:90
void OnClear(wxCommandEvent &event)
Definition: TagsEditor.cpp:663
void OnAdd(wxCommandEvent &event)
Definition: TagsEditor.cpp:830
void OnKeyDown(wxKeyEvent &event)
Definition: TagsEditor.cpp:912
bool IsWindowRectValid(const wxRect *windowRect) const
Definition: TagsEditor.cpp:981
void OnReset(wxCommandEvent &event)
Definition: TagsEditor.cpp:616
void PopulateOrExchange(ShuttleGui &S)
Definition: TagsEditor.cpp:298
void OnNext(wxCommandEvent &)
Definition: TagsEditor.cpp:936
void OnPrev(wxCommandEvent &)
Definition: TagsEditor.cpp:946
bool TransferDataToWindow() override
Definition: TagsEditor.cpp:453
void OnOk(wxCommandEvent &event)
Definition: TagsEditor.cpp:856
void OnLoad(wxCommandEvent &event)
Definition: TagsEditor.cpp:670
std::vector< wxString > mNames
Definition: TagsEditor.h:84
void OnSave(wxCommandEvent &event)
Definition: TagsEditor.cpp:727
bool TransferDataFromWindow() override
Definition: TagsEditor.cpp:397
void OnHelp(wxCommandEvent &Evt)
Definition: TagsEditor.cpp:392
void OnSaveDefaults(wxCommandEvent &event)
Definition: TagsEditor.cpp:788
void OnChange(wxGridEvent &event)
Definition: TagsEditor.cpp:524
ComboEditor * mComboEditor
Definition: TagsEditor.h:96
void OnEdit(wxCommandEvent &event)
Definition: TagsEditor.cpp:561
wxButton * mNext
Definition: TagsEditor.h:94
void OnCancel(wxCommandEvent &event)
Definition: TagsEditor.cpp:886
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.