Doxygen, Clips and Labels
- Classes renamed and better doxygenated - GetInfo: Type=Clips added - GetInfo: Type=Labels added.
This commit is contained in:
parent
ca5dac59ff
commit
b1b1a362ed
|
@ -321,6 +321,7 @@ private:
|
|||
protected:
|
||||
std::shared_ptr<TrackControls> GetControls() override;
|
||||
std::shared_ptr<TrackVRulerControls> GetVRulerControls() override;
|
||||
friend class GetInfoCommand;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5175,7 +5175,7 @@ void AudacityProject::TP_DisplayStatusMessage(const wxString &msg)
|
|||
void AudacityProject::SafeDisplayStatusMessage(const wxChar *msg)
|
||||
{
|
||||
auto target
|
||||
= std::make_unique<CommandOutputTarget>(TargetFactory::ProgressDefault(),
|
||||
= std::make_unique<CommandOutputTargets>(TargetFactory::ProgressDefault(),
|
||||
std::make_shared<StatusBarTarget>(*mStatusBar),
|
||||
TargetFactory::MessageDefault());
|
||||
OldStyleCommandType *type = CommandDirectory::Get()->LookUp(wxT("Message"));
|
||||
|
|
|
@ -248,7 +248,7 @@ std::unique_ptr<ScreenshotCommand> ScreenFrame::CreateCommand()
|
|||
{
|
||||
wxASSERT(mStatus != NULL);
|
||||
auto output =
|
||||
std::make_unique<CommandOutputTarget>(std::make_unique<NullProgressTarget>(),
|
||||
std::make_unique<CommandOutputTargets>(std::make_unique<NullProgressTarget>(),
|
||||
std::make_shared<StatusBarTarget>(*mStatus),
|
||||
std::make_shared<MessageBoxTarget>());
|
||||
//OldStyleCommandType *type = CommandDirectory::Get()->LookUp(wxT("Screenshot"));
|
||||
|
|
|
@ -255,7 +255,7 @@ public:
|
|||
void MarkChanged() // NOFAIL-GUARANTEE
|
||||
{ mDirty++; }
|
||||
|
||||
/** Getting high-level data from the for screen display and clipping
|
||||
/** Getting high-level data for screen display and clipping
|
||||
* calculations and Contrast */
|
||||
bool GetWaveDisplay(WaveDisplay &display,
|
||||
double t0, double pixelsPerSecond, bool &isLoadingOD) const;
|
||||
|
|
|
@ -54,8 +54,8 @@ class AUDACITY_DLL_API AudacityCommand /* not final */ : public wxEvtHandler,
|
|||
public CommandDefinitionInterface
|
||||
{
|
||||
public:
|
||||
//std::unique_ptr<CommandOutputTarget> mOutput;
|
||||
//CommandOutputTarget * mOutput;
|
||||
//std::unique_ptr<CommandOutputTargets> mOutput;
|
||||
//CommandOutputTargets * mOutput;
|
||||
public:
|
||||
AudacityCommand();
|
||||
virtual ~AudacityCommand();
|
||||
|
|
|
@ -32,7 +32,7 @@ void BatchEvalCommandType::BuildSignature(CommandSignature &signature)
|
|||
signature.AddParameter(wxT("ChainName"), wxT(""), std::move(chainValidator));
|
||||
}
|
||||
|
||||
OldStyleCommandPointer BatchEvalCommandType::Create(std::unique_ptr<CommandOutputTarget> &&target)
|
||||
OldStyleCommandPointer BatchEvalCommandType::Create(std::unique_ptr<CommandOutputTargets> &&target)
|
||||
{
|
||||
return std::make_shared<BatchEvalCommand>(*this);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ class BatchEvalCommandType final : public OldStyleCommandType
|
|||
public:
|
||||
wxString BuildName() override;
|
||||
void BuildSignature(CommandSignature &signature) override;
|
||||
OldStyleCommandPointer Create(std::unique_ptr<CommandOutputTarget> &&target) override;
|
||||
OldStyleCommandPointer Create(std::unique_ptr<CommandOutputTargets> &&target) override;
|
||||
};
|
||||
|
||||
class BatchEvalCommand final : public CommandImplementation
|
||||
|
|
|
@ -122,7 +122,7 @@ bool DecoratedCommand::SetParameter(const wxString ¶mName,
|
|||
return mCommand->SetParameter(paramName, paramValue);
|
||||
}
|
||||
|
||||
ApplyAndSendResponse::ApplyAndSendResponse(const OldStyleCommandPointer &cmd, std::unique_ptr<CommandOutputTarget> &target)
|
||||
ApplyAndSendResponse::ApplyAndSendResponse(const OldStyleCommandPointer &cmd, std::unique_ptr<CommandOutputTargets> &target)
|
||||
: DecoratedCommand(cmd),
|
||||
mCtx( std::make_unique<CommandContext>( *GetActiveProject(), std::move(target) ) )
|
||||
{
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
class AudacityApp;
|
||||
class CommandContext;
|
||||
class CommandOutputTarget;
|
||||
class CommandOutputTargets;
|
||||
|
||||
// Abstract base class for command interface.
|
||||
class OldStyleCommand /* not final */
|
||||
|
@ -67,7 +67,7 @@ public:
|
|||
class ApplyAndSendResponse final : public DecoratedCommand
|
||||
{
|
||||
public:
|
||||
ApplyAndSendResponse(const OldStyleCommandPointer &cmd, std::unique_ptr<CommandOutputTarget> &target);
|
||||
ApplyAndSendResponse(const OldStyleCommandPointer &cmd, std::unique_ptr<CommandOutputTargets> &target);
|
||||
bool Apply() override;
|
||||
bool Apply(const CommandContext &context) override;// Error to use this.
|
||||
std::unique_ptr<CommandContext> mCtx;
|
||||
|
|
|
@ -85,7 +85,7 @@ void CommandBuilder::BuildCommand(const wxString &cmdName,
|
|||
|
||||
auto scriptOutput = ScriptCommandRelay::GetResponseTarget();
|
||||
auto output
|
||||
= std::make_unique<CommandOutputTarget>(std::make_unique<NullProgressTarget>(),
|
||||
= std::make_unique<CommandOutputTargets>(std::make_unique<NullProgressTarget>(),
|
||||
scriptOutput,
|
||||
scriptOutput);
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ CommandContext::CommandContext(
|
|||
)
|
||||
: project{ p }
|
||||
// No target specified? Use the special interactive one that pops up a dialog.
|
||||
, pOutput( std::move( std::make_unique<InteractiveOutputTarget>()) )
|
||||
, pOutput( std::move( std::make_unique<InteractiveOutputTargets>()) )
|
||||
, pEvt{ e }
|
||||
, index{ ii }
|
||||
, parameter{ param }
|
||||
|
@ -56,7 +56,7 @@ CommandContext::CommandContext(
|
|||
|
||||
CommandContext::CommandContext(
|
||||
AudacityProject &p,
|
||||
std::unique_ptr<CommandOutputTarget> target)
|
||||
std::unique_ptr<CommandOutputTargets> target)
|
||||
: project{ p }
|
||||
// Revisit and use std_unique pointer for pOutput??
|
||||
, pOutput( std::move( target) )
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
class AudacityProject;
|
||||
class AudacityApp;
|
||||
class wxEvent;
|
||||
class CommandOutputTarget;
|
||||
class CommandOutputTargets;
|
||||
using CommandParameter = wxString;
|
||||
|
||||
class CommandContext {
|
||||
|
@ -33,7 +33,7 @@ public:
|
|||
|
||||
CommandContext(
|
||||
AudacityProject &p,
|
||||
std::unique_ptr<CommandOutputTarget> target);
|
||||
std::unique_ptr<CommandOutputTargets> target);
|
||||
|
||||
virtual void Status( const wxString & WXUNUSED(message) ) const;
|
||||
virtual void Error( const wxString & WXUNUSED(message) ) const;
|
||||
|
@ -49,7 +49,7 @@ public:
|
|||
void AddItem(const double value , const wxString &name="" ) const;
|
||||
|
||||
AudacityProject &project;
|
||||
std::unique_ptr<CommandOutputTarget> pOutput;
|
||||
std::unique_ptr<CommandOutputTargets> pOutput;
|
||||
const wxEvent *pEvt;
|
||||
int index;
|
||||
CommandParameter parameter;
|
||||
|
|
|
@ -28,7 +28,7 @@ they are kept separate to make things simpler.
|
|||
#include "CommandType.h"
|
||||
|
||||
class Command;
|
||||
class CommandOutputTarget;
|
||||
class CommandOutputTargets;
|
||||
|
||||
class CommandDirectory
|
||||
{
|
||||
|
|
|
@ -11,10 +11,14 @@
|
|||
\file CommandTargets.cpp
|
||||
\brief Contains definitions for CommandType class
|
||||
|
||||
\class InteractiveOutputTarget
|
||||
\brief InteractiveOutputTarget is an output target that pops up a
|
||||
\class InteractiveOutputTargets
|
||||
\brief InteractiveOutputTargets is an output target that pops up a
|
||||
dialog, if necessary.
|
||||
|
||||
\class LongMessageDialog
|
||||
\brief LongMessageDialog is a dialog with a Text Window in it to
|
||||
capture the more lengthy output from some commands.
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
#include "../Audacity.h"
|
||||
|
@ -126,7 +130,7 @@ void LispyCommandMessageTarget::AddField(const wxString &name){
|
|||
|
||||
|
||||
|
||||
void DeformattedCommandMessageTarget::StartArray()
|
||||
void BriefCommandMessageTarget::StartArray()
|
||||
{
|
||||
wxString Padding;
|
||||
Padding.Pad( mCounts.GetCount() *2 -2);
|
||||
|
@ -136,14 +140,14 @@ void DeformattedCommandMessageTarget::StartArray()
|
|||
mCounts.push_back( 0 );
|
||||
}
|
||||
|
||||
void DeformattedCommandMessageTarget::EndArray(){
|
||||
void BriefCommandMessageTarget::EndArray(){
|
||||
if( mCounts.GetCount() > 1 ){
|
||||
mCounts.pop_back();
|
||||
}
|
||||
if( mCounts.GetCount() <= 3 )
|
||||
Update( " " );
|
||||
}
|
||||
void DeformattedCommandMessageTarget::StartStruct(){
|
||||
void BriefCommandMessageTarget::StartStruct(){
|
||||
wxString Padding;
|
||||
Padding.Pad( mCounts.GetCount() *2 -2);
|
||||
if( mCounts.GetCount() <= 3 )
|
||||
|
@ -151,30 +155,30 @@ void DeformattedCommandMessageTarget::StartStruct(){
|
|||
mCounts.Last() += 1;
|
||||
mCounts.push_back( 0 );
|
||||
}
|
||||
void DeformattedCommandMessageTarget::EndStruct(){
|
||||
void BriefCommandMessageTarget::EndStruct(){
|
||||
if( mCounts.GetCount() > 1 ){
|
||||
mCounts.pop_back();
|
||||
}
|
||||
if( mCounts.GetCount() <= 3 )
|
||||
Update( " " );
|
||||
}
|
||||
void DeformattedCommandMessageTarget::AddItem(const wxString &value, const wxString &name){
|
||||
void BriefCommandMessageTarget::AddItem(const wxString &value, const wxString &name){
|
||||
if( mCounts.GetCount() <= 3 )
|
||||
Update( wxString::Format( "%s\"%s\"", (mCounts.Last()>0)?" ":"",value));
|
||||
mCounts.Last() += 1;
|
||||
}
|
||||
void DeformattedCommandMessageTarget::AddItem(const bool value, const wxString &name){
|
||||
void BriefCommandMessageTarget::AddItem(const bool value, const wxString &name){
|
||||
if( mCounts.GetCount() <= 3 )
|
||||
Update( wxString::Format( "%s%s", (mCounts.Last()>0)?" ":"",value?"True":"False"));
|
||||
mCounts.Last() += 1;
|
||||
}
|
||||
void DeformattedCommandMessageTarget::AddItem(const double value, const wxString &name){
|
||||
void BriefCommandMessageTarget::AddItem(const double value, const wxString &name){
|
||||
if( mCounts.GetCount() <= 3 )
|
||||
Update( wxString::Format( "%s%g", (mCounts.Last()>0)?" ":"", value));
|
||||
mCounts.Last() += 1;
|
||||
}
|
||||
|
||||
void DeformattedCommandMessageTarget::AddField(const wxString &name){
|
||||
void BriefCommandMessageTarget::AddField(const wxString &name){
|
||||
mCounts.Last() = 0; // Lie so that we don't get a comma.
|
||||
}
|
||||
|
||||
|
@ -182,8 +186,8 @@ void DeformattedCommandMessageTarget::AddField(const wxString &name){
|
|||
|
||||
|
||||
|
||||
LispifiedCommandOutputTarget::LispifiedCommandOutputTarget( CommandOutputTarget & target )
|
||||
: CommandOutputTarget() ,
|
||||
LispifiedCommandOutputTargets::LispifiedCommandOutputTargets( CommandOutputTargets & target )
|
||||
: CommandOutputTargets() ,
|
||||
pToRestore( &target )
|
||||
{
|
||||
mProgressTarget = std::move(target.mProgressTarget),
|
||||
|
@ -191,7 +195,7 @@ LispifiedCommandOutputTarget::LispifiedCommandOutputTarget( CommandOutputTarget
|
|||
mErrorTarget = std::move( target.mErrorTarget );
|
||||
}
|
||||
|
||||
LispifiedCommandOutputTarget::~LispifiedCommandOutputTarget()
|
||||
LispifiedCommandOutputTargets::~LispifiedCommandOutputTargets()
|
||||
{
|
||||
pToRestore->mProgressTarget = std::move( mProgressTarget );
|
||||
//The status was never captured so does not need restoring.
|
||||
|
@ -199,16 +203,16 @@ LispifiedCommandOutputTarget::~LispifiedCommandOutputTarget()
|
|||
pToRestore->mErrorTarget = std::move( mErrorTarget );
|
||||
}
|
||||
|
||||
DeformattedCommandOutputTarget::DeformattedCommandOutputTarget( CommandOutputTarget & target )
|
||||
: CommandOutputTarget() ,
|
||||
BriefCommandOutputTargets::BriefCommandOutputTargets( CommandOutputTargets & target )
|
||||
: CommandOutputTargets() ,
|
||||
pToRestore( &target )
|
||||
{
|
||||
mProgressTarget = std::move(target.mProgressTarget),
|
||||
mStatusTarget = std::make_shared<DeformattedCommandMessageTarget>( *target.mStatusTarget.get() ),
|
||||
mStatusTarget = std::make_shared<BriefCommandMessageTarget>( *target.mStatusTarget.get() ),
|
||||
mErrorTarget = std::move( target.mErrorTarget );
|
||||
}
|
||||
|
||||
DeformattedCommandOutputTarget::~DeformattedCommandOutputTarget()
|
||||
BriefCommandOutputTargets::~BriefCommandOutputTargets()
|
||||
{
|
||||
pToRestore->mProgressTarget = std::move( mProgressTarget );
|
||||
//The status was never captured so does not need restoring.
|
||||
|
@ -226,9 +230,6 @@ DeformattedCommandOutputTarget::~DeformattedCommandOutputTarget()
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
/// Dialog for long messages.
|
||||
class AUDACITY_DLL_API LongMessageDialog /* not final */ : public wxDialogWrapper
|
||||
{
|
||||
public:
|
||||
|
@ -336,7 +337,10 @@ void LongMessageDialog::Flush()
|
|||
|
||||
|
||||
|
||||
/// Displays messages from a command in an AudacityMessageBox
|
||||
/**
|
||||
CommandMessageTarget that displays messages from a command in the
|
||||
LongMessageDialog
|
||||
*/
|
||||
class MessageDialogTarget final : public CommandMessageTarget
|
||||
{
|
||||
public:
|
||||
|
@ -365,8 +369,8 @@ public:
|
|||
|
||||
|
||||
|
||||
InteractiveOutputTarget::InteractiveOutputTarget() :
|
||||
CommandOutputTarget(
|
||||
InteractiveOutputTargets::InteractiveOutputTargets() :
|
||||
CommandOutputTargets(
|
||||
ExtTargetFactory::ProgressDefault(),
|
||||
ExtTargetFactory::LongMessages(),
|
||||
ExtTargetFactory::MessageDefault()
|
||||
|
|
|
@ -17,6 +17,39 @@ objects needn't be concerned with what happens to the information.
|
|||
Note: currently, reusing target objects is not generally safe - perhaps they
|
||||
should be reference-counted.
|
||||
|
||||
\class CommandMessageTargetDecorator
|
||||
\brief CommandMessageTargetDecorator is a CommandOutputTarget that forwards
|
||||
its work on to another one. Typically we derive from it to modify some
|
||||
functionality and forward the rest.
|
||||
|
||||
\class BriefCommandMessageTarget
|
||||
\brief BriefCommandMessageTarget is a CommandOutputTarget that provides
|
||||
status in a briefer listing
|
||||
|
||||
\class LispyCommandMessageTarget
|
||||
\brief LispyCommandMessageTarget is a CommandOutputTarget that provides status
|
||||
in a lispy style.
|
||||
|
||||
\class MessageDialogTarget
|
||||
\brief MessageDialogTarget is a CommandOutputTarget that sends its status
|
||||
to the LongMessageDialog.
|
||||
|
||||
\class CommandOutputTargets
|
||||
\brief CommandOutputTargets a mix of three output classes to output
|
||||
progress indication, status messages and errors.
|
||||
|
||||
\class BriefCommandOutputTargets
|
||||
\brief BriefCommandOutputTargets is a CommandOutputTargets that replaces the
|
||||
status message target with the BriefCommandMessageTarget version.
|
||||
|
||||
\class LispifiedCommandOutputTargets
|
||||
\brief LispifiedCommandOutputTargets is a CommandOutputTargets that replaces the
|
||||
status message target with the LispyCommandMessageTarget version.
|
||||
|
||||
\class ProgressToMessageTarget
|
||||
\brief ProgressToMessageTarget formats the percentage complete text as a message
|
||||
and sends it to that message target.
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
#ifndef __COMMANDTARGETS__
|
||||
|
@ -89,10 +122,10 @@ public:
|
|||
virtual void AddField( const wxString &name="" )override;
|
||||
};
|
||||
|
||||
class DeformattedCommandMessageTarget : public CommandMessageTargetDecorator /* not final */
|
||||
class BriefCommandMessageTarget : public CommandMessageTargetDecorator /* not final */
|
||||
{
|
||||
public:
|
||||
DeformattedCommandMessageTarget( CommandMessageTarget & target): CommandMessageTargetDecorator(target) {};
|
||||
BriefCommandMessageTarget( CommandMessageTarget & target): CommandMessageTargetDecorator(target) {};
|
||||
virtual void StartArray() override;
|
||||
virtual void EndArray() override;
|
||||
virtual void StartStruct() override;
|
||||
|
@ -223,8 +256,11 @@ public:
|
|||
};
|
||||
|
||||
|
||||
// By default, we ignore progress updates but display all other messages
|
||||
// directly
|
||||
/**
|
||||
\class TargetFactory
|
||||
\brief TargetFactory makes Command output targets. By default, we ignore progress
|
||||
updates but display all other messages directly
|
||||
*/
|
||||
class TargetFactory
|
||||
{
|
||||
public:
|
||||
|
@ -241,19 +277,19 @@ public:
|
|||
|
||||
/// Used to aggregate the various output targets a command may have.
|
||||
/// Assumes responsibility for pointers passed into it.
|
||||
class CommandOutputTarget
|
||||
class CommandOutputTargets
|
||||
{
|
||||
public:
|
||||
std::unique_ptr<CommandProgressTarget> mProgressTarget;
|
||||
std::shared_ptr<CommandMessageTarget> mStatusTarget;
|
||||
std::shared_ptr<CommandMessageTarget> mErrorTarget;
|
||||
public:
|
||||
CommandOutputTarget(std::unique_ptr<CommandProgressTarget> &&pt = TargetFactory::ProgressDefault(),
|
||||
CommandOutputTargets(std::unique_ptr<CommandProgressTarget> &&pt = TargetFactory::ProgressDefault(),
|
||||
std::shared_ptr<CommandMessageTarget> &&st = TargetFactory::MessageDefault(),
|
||||
std::shared_ptr<CommandMessageTarget> &&et = TargetFactory::MessageDefault())
|
||||
: mProgressTarget(std::move(pt)), mStatusTarget(st), mErrorTarget(et)
|
||||
{ }
|
||||
~CommandOutputTarget()
|
||||
~CommandOutputTargets()
|
||||
{
|
||||
}
|
||||
// Lots of forwarding...
|
||||
|
@ -309,28 +345,28 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class LispifiedCommandOutputTarget : public CommandOutputTarget
|
||||
class LispifiedCommandOutputTargets : public CommandOutputTargets
|
||||
{
|
||||
public :
|
||||
LispifiedCommandOutputTarget( CommandOutputTarget & target );
|
||||
~LispifiedCommandOutputTarget();
|
||||
LispifiedCommandOutputTargets( CommandOutputTargets & target );
|
||||
~LispifiedCommandOutputTargets();
|
||||
private:
|
||||
CommandOutputTarget * pToRestore;
|
||||
CommandOutputTargets * pToRestore;
|
||||
};
|
||||
|
||||
class DeformattedCommandOutputTarget : public CommandOutputTarget
|
||||
class BriefCommandOutputTargets : public CommandOutputTargets
|
||||
{
|
||||
public :
|
||||
DeformattedCommandOutputTarget( CommandOutputTarget & target );
|
||||
~DeformattedCommandOutputTarget();
|
||||
BriefCommandOutputTargets( CommandOutputTargets & target );
|
||||
~BriefCommandOutputTargets();
|
||||
private:
|
||||
CommandOutputTarget * pToRestore;
|
||||
CommandOutputTargets * pToRestore;
|
||||
};
|
||||
|
||||
class InteractiveOutputTarget : public CommandOutputTarget
|
||||
class InteractiveOutputTargets : public CommandOutputTargets
|
||||
{
|
||||
public:
|
||||
InteractiveOutputTarget();
|
||||
InteractiveOutputTargets();
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ for its output.
|
|||
*******************************************************************/
|
||||
|
||||
using OldStyleCommandPointer = std::shared_ptr<OldStyleCommand>;
|
||||
class CommandOutputTarget;
|
||||
class CommandOutputTargets;
|
||||
class CommandSignature;
|
||||
class wxString;
|
||||
|
||||
|
@ -65,7 +65,7 @@ public:
|
|||
virtual void BuildSignature(CommandSignature &signature) = 0;
|
||||
|
||||
// Create a command instance with the specified output target
|
||||
virtual OldStyleCommandPointer Create(std::unique_ptr<CommandOutputTarget> &&target) = 0;
|
||||
virtual OldStyleCommandPointer Create(std::unique_ptr<CommandOutputTargets> &&target) = 0;
|
||||
};
|
||||
|
||||
#endif /* End of include guard: __COMMANDTYPE__ */
|
||||
|
|
|
@ -37,7 +37,7 @@ threshold of difference in two selected tracks
|
|||
|
||||
extern void RegisterCompareAudio( Registrar & R){
|
||||
R.AddCommand( make_movable<CompareAudioCommand>() );
|
||||
// std::unique_ptr<CommandOutputTarget> &&target
|
||||
// std::unique_ptr<CommandOutputTargets> &&target
|
||||
// return std::make_shared<CompareAudioCommand>(*this, std::move(target));
|
||||
|
||||
}
|
||||
|
|
|
@ -4,16 +4,20 @@
|
|||
Copyright 1999-2009 Audacity Team
|
||||
License: wxWidgets
|
||||
|
||||
Dan Horgan
|
||||
James Crook
|
||||
|
||||
******************************************************************//**
|
||||
|
||||
\file GetInfoCommand.cpp
|
||||
\brief Contains definitions for GetInfoCommand class.
|
||||
This class now handles the GetAll script command, which can
|
||||
- Get all keycodes
|
||||
- Get all menus
|
||||
- Get all boxes
|
||||
This class now lists
|
||||
- Commands
|
||||
- Menus
|
||||
- Tracks
|
||||
- Clips
|
||||
- Labels
|
||||
- Keycodes
|
||||
- Boxes
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
|
@ -32,6 +36,7 @@ This class now handles the GetAll script command, which can
|
|||
#include "SelectCommand.h"
|
||||
#include "../Project.h"
|
||||
#include "../Track.h"
|
||||
#include "../LabelTrack.h"
|
||||
#include "../ShuttleGui.h"
|
||||
#include "CommandContext.h"
|
||||
|
||||
|
@ -63,13 +68,13 @@ static const wxString kFormats[nFormats] =
|
|||
{
|
||||
XO("JSON"),
|
||||
XO("LISP"),
|
||||
XO("Other")
|
||||
XO("Brief")
|
||||
};
|
||||
|
||||
enum {
|
||||
kJson ,
|
||||
kLisp,
|
||||
kOther
|
||||
kBrief
|
||||
};
|
||||
|
||||
|
||||
|
@ -104,18 +109,18 @@ bool GetInfoCommand::Apply(const CommandContext &context)
|
|||
{
|
||||
CommandContext LispyContext(
|
||||
*(context.GetProject()),
|
||||
std::make_unique<LispifiedCommandOutputTarget>( *context.pOutput.get() )
|
||||
std::make_unique<LispifiedCommandOutputTargets>( *context.pOutput.get() )
|
||||
);
|
||||
return ApplyInner( LispyContext );
|
||||
}
|
||||
|
||||
if( mFormat == kOther )
|
||||
if( mFormat == kBrief )
|
||||
{
|
||||
CommandContext DeformattedContext(
|
||||
CommandContext BriefContext(
|
||||
*(context.GetProject()),
|
||||
std::make_unique<DeformattedCommandOutputTarget>( *context.pOutput.get() )
|
||||
std::make_unique<BriefCommandOutputTargets>( *context.pOutput.get() )
|
||||
);
|
||||
return ApplyInner( DeformattedContext );
|
||||
return ApplyInner( BriefContext );
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -271,13 +276,61 @@ bool GetInfoCommand::SendTracks(const CommandContext & context)
|
|||
|
||||
bool GetInfoCommand::SendClips(const CommandContext &context)
|
||||
{
|
||||
context.Status("Clips - Not yet");
|
||||
TrackList *tracks = context.GetProject()->GetTracks();
|
||||
TrackListIterator iter(tracks);
|
||||
Track *t = iter.First();
|
||||
int i=0;
|
||||
context.StartArray();
|
||||
while (t) {
|
||||
if (t->GetKind() == Track::Wave) {
|
||||
WaveTrack *waveTrack = static_cast<WaveTrack*>(t);
|
||||
for(const auto &clip : waveTrack->GetAllClips()) {
|
||||
context.StartStruct();
|
||||
context.AddItem( (double)i, "track" );
|
||||
context.AddItem( clip->GetStartTime(), "start" );
|
||||
context.AddItem( clip->GetEndTime(), "end" );
|
||||
context.AddItem( clip->GetColourIndex(), "color" );
|
||||
context.EndStruct();
|
||||
}
|
||||
}
|
||||
t = iter.Next();
|
||||
i++;
|
||||
}
|
||||
context.EndArray();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GetInfoCommand::SendLabels(const CommandContext &context)
|
||||
{
|
||||
context.Status("Labels - Not yet");
|
||||
TrackList *tracks = context.GetProject()->GetTracks();
|
||||
TrackListIterator iter(tracks);
|
||||
Track *t = iter.First();
|
||||
int i=0;
|
||||
context.StartArray();
|
||||
while (t) {
|
||||
if (t->GetKind() == Track::Label) {
|
||||
LabelTrack *labelTrack = static_cast<LabelTrack*>(t);
|
||||
if( labelTrack )
|
||||
{
|
||||
for (int nn = 0; nn< (int)labelTrack->mLabels.size(); nn++) {
|
||||
const auto &label = labelTrack->mLabels[nn];
|
||||
context.StartStruct();
|
||||
context.AddItem( (double)i, "track" );
|
||||
context.AddItem( label.getT0(), "start" );
|
||||
context.AddItem( label.getT1(), "end" );
|
||||
context.AddItem( label.title, "text" );
|
||||
context.EndStruct();
|
||||
}
|
||||
}
|
||||
}
|
||||
t = iter.Next();
|
||||
i++;
|
||||
}
|
||||
context.EndArray();
|
||||
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ void MessageCommandType::BuildSignature(CommandSignature &signature)
|
|||
signature.AddParameter(wxT("MessageString"), wxT("Connected"), std::move(stringValidator));
|
||||
}
|
||||
|
||||
OldStyleCommandPointer MessageCommandType::Create(std::unique_ptr<CommandOutputTarget> &&target)
|
||||
OldStyleCommandPointer MessageCommandType::Create(std::unique_ptr<CommandOutputTargets> &&target)
|
||||
{
|
||||
return std::make_shared<MessageCommand>(*this);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ class MessageCommandType final : public OldStyleCommandType
|
|||
public:
|
||||
wxString BuildName() override;
|
||||
void BuildSignature(CommandSignature &signature) override;
|
||||
OldStyleCommandPointer Create(std::unique_ptr<CommandOutputTarget> &&target) override;
|
||||
OldStyleCommandPointer Create(std::unique_ptr<CommandOutputTargets> &&target) override;
|
||||
};
|
||||
|
||||
class MessageCommand final : public CommandImplementation
|
||||
|
|
|
@ -22,7 +22,7 @@ class wxTopLevelWindow;
|
|||
class wxCommandEvent;
|
||||
class wxRect;
|
||||
class ToolManager;
|
||||
class CommandOutputTarget;
|
||||
class CommandOutputTargets;
|
||||
class TrackPanel;
|
||||
class AdornedRulerPanel;
|
||||
class AudacityProject;
|
||||
|
|
|
@ -406,7 +406,6 @@
|
|||
<ClCompile Include="..\..\..\src\commands\CommandType.cpp" />
|
||||
<ClCompile Include="..\..\..\src\commands\CompareAudioCommand.cpp" />
|
||||
<ClCompile Include="..\..\..\src\commands\GetInfoCommand.cpp" />
|
||||
<ClCompile Include="..\..\..\src\commands\GetTrackInfoCommand.cpp" />
|
||||
<ClCompile Include="..\..\..\src\commands\HelpCommand.cpp" />
|
||||
<ClCompile Include="..\..\..\src\commands\ImportExportCommands.cpp" />
|
||||
<ClCompile Include="..\..\..\src\commands\Keyboard.cpp" />
|
||||
|
@ -758,7 +757,6 @@
|
|||
<ClInclude Include="..\..\..\src\commands\CommandType.h" />
|
||||
<ClInclude Include="..\..\..\src\commands\CompareAudioCommand.h" />
|
||||
<ClInclude Include="..\..\..\src\commands\GetInfoCommand.h" />
|
||||
<ClInclude Include="..\..\..\src\commands\GetTrackInfoCommand.h" />
|
||||
<ClInclude Include="..\..\..\src\commands\HelpCommand.h" />
|
||||
<ClInclude Include="..\..\..\src\commands\ImportExportCommands.h" />
|
||||
<ClInclude Include="..\..\..\src\commands\Keyboard.h" />
|
||||
|
|
|
@ -1037,9 +1037,6 @@
|
|||
<ClCompile Include="..\..\..\src\commands\GetInfoCommand.cpp">
|
||||
<Filter>src\commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\commands\GetTrackInfoCommand.cpp">
|
||||
<Filter>src\commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\commands\HelpCommand.cpp">
|
||||
<Filter>src\commands</Filter>
|
||||
</ClCompile>
|
||||
|
@ -2098,9 +2095,6 @@
|
|||
<ClInclude Include="..\..\..\src\commands\GetInfoCommand.h">
|
||||
<Filter>src\commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\commands\GetTrackInfoCommand.h">
|
||||
<Filter>src\commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\commands\HelpCommand.h">
|
||||
<Filter>src\commands</Filter>
|
||||
</ClInclude>
|
||||
|
|
Loading…
Reference in New Issue