Audacity  2.2.0
CompareAudioCommand.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity - A Digital Audio Editor
4  Copyright 1999-2009 Audacity Team
5  License: wxwidgets
6 
7  Dan Horgan
8 
9 ******************************************************************//*******************************************************************/
16 
17 #ifndef __COMPAREAUDIOCOMMAND__
18 #define __COMPAREAUDIOCOMMAND__
19 
20 #include "Command.h"
21 #include "CommandType.h"
22 
23 class WaveTrack;
24 
26 {
27 public:
28  wxString BuildName() override;
29  void BuildSignature(CommandSignature &signature) override;
30  CommandHolder Create(std::unique_ptr<CommandOutputTarget> &&target) override;
31 };
32 
34 {
35 private:
36  double mT0, mT1;
39 
40  // Update member variables with project selection data (and validate)
41  bool GetSelection(AudacityProject &proj);
42 
43 protected:
44  double CompareSample(double value1, double value2) /* not override */;
45 
46 public:
47  CompareAudioCommand(CommandType &type, std::unique_ptr<CommandOutputTarget> &&target)
48  : CommandImplementation(type, std::move(target))
49  { }
50  bool Apply(CommandExecutionContext context) override;
51 };
52 
53 #endif /* End of include guard: __COMPAREAUDIOCOMMAND__ */
const WaveTrack * mTrack1
Definition: CompareAudioCommand.h:38
double CompareSample(double value1, double value2)
Definition: CompareAudioCommand.cpp:75
std::shared_ptr< Command > CommandHolder
Definition: AppCommandEvent.h:26
Contains declarations for CommandType class.
CompareAudioCommand(CommandType &type, std::unique_ptr< CommandOutputTarget > &&target)
Definition: CompareAudioCommand.h:47
Contains declaration of Command base class.
bool Apply(CommandExecutionContext context) override
Definition: CompareAudioCommand.cpp:85
double mT1
Definition: CompareAudioCommand.h:36
bool GetSelection(AudacityProject &proj)
Definition: CompareAudioCommand.cpp:42
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:161
const WaveTrack * mTrack0
Definition: CompareAudioCommand.h:37
is derived from Command. It validates and applies the command. CommandImplementation::Apply() is over...
Definition: Command.h:118
Base class for containing data common to all commands of a given type. Also acts as a factory...
Definition: CommandType.h:29
Definition: CompareAudioCommand.h:25
CommandHolder Create(std::unique_ptr< CommandOutputTarget > &&target) override
Definition: CompareAudioCommand.cpp:36
void BuildSignature(CommandSignature &signature) override
Postcondition: signature is a 'signature' map containing parameter.
Definition: CompareAudioCommand.cpp:30
A Track that contains audio waveform data.
Definition: WaveTrack.h:76
wxString BuildName() override
Definition: CompareAudioCommand.cpp:25
Represents a context to which a command may be applied.
Definition: Command.h:50
Class that maps parameter names to default values and validators.
Definition: CommandSignature.h:28
Returns information about the amount of audio that is about a certain threshold of difference in two ...
Definition: CompareAudioCommand.h:33
double mT0
Definition: CompareAudioCommand.h:36