24#include "../CommonCommandFlags.h"
33#include "../tracks/labeltrack/ui/LabelTrackView.h"
48 S.OptionalY(
bHasT0 ).Define(
mT0,
wxT(
"Start"), 0.0, 0.0, 100000.0);
49 S.OptionalY(
bHasT1 ).Define(
mT1,
wxT(
"End"), 0.0, 0.0, 100000.0);
55 {
return VisitSettings<false>(
S); }
58 {
return VisitSettings<true>(
S); }
64 S.StartMultiColumn(2, wxALIGN_CENTER);
69 S.StartMultiColumn(3, wxALIGN_CENTER);
93 const auto &labels = lt->GetLabels();
94 const auto nLabels = labels.size();
95 if( ii >= (
int)nLabels )
99 pLabel = &labels[ ii ];
107 context.
Error(
wxT(
"LabelIndex was invalid."));
110 auto newLabel = *pLabel;
112 newLabel.title =
mText;
114 newLabel.selectedRegion.setT0(
mT0,
false);
116 newLabel.selectedRegion.setT1(
mT1,
false);
118 newLabel.selectedRegion.ensureOrdering();
119 labelTrack->SetLabel( ii, newLabel );
126 view.SetNavigationIndex( ii );
127 double t0 = pLabel->selectedRegion.t0();
128 double t1 = pLabel->selectedRegion.t1();
129 selectedRegion.setTimes( t0, t1);
131 else if( view.GetNavigationIndex( context.
project ) == ii )
132 view.SetNavigationIndex( -1 );
135 labelTrack->SortLabels();
138 XO(
"Edited Label"),
XO(
"Label"));
155 wxT(
"Optional/Extra/Part2/Scriptables1")
AttachedItem sAttachment1
const ReservedCommandFlag & AudioIONotBusyFlag()
XXO("&Cut/Copy/Paste Toolbar")
Declarations of SetLabelCommand and SetLabelCommandType classes.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
CommandContext provides additional information to an 'Apply()' command. It provides the project,...
virtual void Error(const wxString &message) const
AudacityProject & project
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
A LabelStruct holds information for ONE label in a LabelTrack.
A LabelTrack is a Track that holds labels (LabelStruct).
static LabelTrackView & Get(LabelTrack &)
void PushState(const TranslatableString &desc, const TranslatableString &shortDesc)
static ProjectHistory & Get(AudacityProject &project)
Generates classes whose instances register items at construction.
bool Apply(const CommandContext &context) override
bool VisitSettings(SettingsVisitorBase< Const > &S)
void PopulateOrExchange(ShuttleGui &S) override
static const ComponentInterfaceSymbol Symbol
Visitor of effect or command parameters. This is a base class with lots of virtual functions that do ...
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
static TrackList & Get(AudacityProject &project)
NotifyingSelectedRegion selectedRegion
static ViewInfo & Get(AudacityProject &project)
AUDACITY_DLL_API void OnAudacityCommand(const CommandContext &ctx)
BuiltinCommandsModule::Registration< SetLabelCommand > reg