Audacity  3.0.3
Classes | Macros | Typedefs | Enumerations | Functions
Types.h File Reference
#include <algorithm>
#include <functional>
#include <type_traits>
#include <vector>
#include <wx/debug.h>
#include <wx/string.h>
Include dependency graph for Types.h:

Go to the source code of this file.

Classes

class  Identifier
 
struct  std::hash< Identifier >
 
class  TaggedIdentifier< Tag, CaseSensitive >
 
struct  std::hash< TaggedIdentifier< Tag, b > >
 
class  TranslatableString
 
struct  TranslatableString::PluralTemp< N >
 
struct  std::hash< TranslatableString >
 
class  sampleCount
 

Macros

#define SAMPLE_SIZE(SampleFormat)   (SampleFormat >> 16)
 

Typedefs

using PluginPath = wxString
 type alias for identifying a Plugin supplied by a module, each module defining its own interpretation of the strings, which may or may not be as a file system path More...
 
using PluginPaths = std::vector< PluginPath >
 
using RegistryPath = wxString
 
using RegistryPaths = std::vector< RegistryPath >
 
using FileExtension = wxString
 
using FileExtensions = wxArrayStringEx
 
using FilePath = wxString
 
using FilePaths = wxArrayStringEx
 
using CommandID = TaggedIdentifier< CommandIdTag, false >
 
using CommandIDs = std::vector< CommandID >
 
using TranslatableStrings = std::vector< TranslatableString >
 
typedef char * samplePtr
 
typedef const char * constSamplePtr
 
typedef wxString PluginID
 
typedef enum ChannelNameChannelNames
 
using EnumValueSymbol = ComponentInterfaceSymbol
 
using NumericFormatSymbol = EnumValueSymbol
 
using VendorSymbol = ComponentInterfaceSymbol
 
using EffectFamilySymbol = ComponentInterfaceSymbol
 

Enumerations

enum  sampleFormat : unsigned {
  int16Sample = 0x00020001, int24Sample = 0x00040001, floatSample = 0x0004000F, narrowestSampleFormat = int16Sample,
  widestSampleFormat = floatSample
}
 
enum  ChannelName {
  ChannelNameEOL = -1, ChannelNameMono, ChannelNameFrontLeft, ChannelNameFrontRight,
  ChannelNameFrontCenter, ChannelNameLowFrequency1, ChannelNameBackLeft, ChannelNameBackRight,
  ChannelNameFrontLeftCenter, ChannelNameFrontRightCenter, ChannelNameBackCenter, ChannelNameLowFrequency2,
  ChannelNameSideLeft, ChannelNameSideRight, ChannelNameTopFrontLeft, ChannelNameTopFrontRight,
  ChannelNameTopFrontCenter, ChannelNameTopCenter, ChannelNameTopBackLeft, ChannelNameTopBackRight,
  ChannelNameTopSideLeft, ChannelNameTopSideRight, ChannelNameTopBackCenter, ChannelNameBottomFrontCenter,
  ChannelNameBottomFrontLeft, ChannelNameBottomFrontRight
}
 

Functions

bool operator== (const Identifier &x, const Identifier &y)
 
bool operator!= (const Identifier &x, const Identifier &y)
 
bool operator< (const Identifier &x, const Identifier &y)
 
bool operator> (const Identifier &x, const Identifier &y)
 
bool operator<= (const Identifier &x, const Identifier &y)
 
bool operator>= (const Identifier &x, const Identifier &y)
 
bool wxFromString (const wxString &str, Identifier *id)
 
wxString wxToString (const Identifier &str)
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator== (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator!= (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator< (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator> (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator<= (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator>= (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 
TranslatableString operator+ (TranslatableString x, TranslatableString y)
 
template<typename Sink >
Sink & operator<< (Sink &sink, const TranslatableString &str)
 
TranslatableString Verbatim (wxString str)
 
bool operator== (sampleCount a, sampleCount b)
 
bool operator!= (sampleCount a, sampleCount b)
 
bool operator< (sampleCount a, sampleCount b)
 
bool operator>= (sampleCount a, sampleCount b)
 
bool operator> (sampleCount a, sampleCount b)
 
bool operator<= (sampleCount a, sampleCount b)
 
sampleCount operator+ (sampleCount a, sampleCount b)
 
sampleCount operator- (sampleCount a, sampleCount b)
 
sampleCount operator* (sampleCount a, sampleCount b)
 
sampleCount operator/ (sampleCount a, sampleCount b)
 
sampleCount operator% (sampleCount a, sampleCount b)
 
size_t limitSampleBufferSize (size_t bufferSize, sampleCount limit)
 

Macro Definition Documentation

◆ SAMPLE_SIZE

#define SAMPLE_SIZE (   SampleFormat)    (SampleFormat >> 16)

Definition at line 732 of file Types.h.

Typedef Documentation

◆ ChannelNames

typedef enum ChannelName * ChannelNames

◆ CommandID

using CommandID = TaggedIdentifier< CommandIdTag, false >

Definition at line 276 of file Types.h.

◆ CommandIDs

using CommandIDs = std::vector<CommandID>

Definition at line 277 of file Types.h.

◆ constSamplePtr

typedef const char* constSamplePtr

Definition at line 738 of file Types.h.

◆ EffectFamilySymbol

Definition at line 793 of file Types.h.

◆ EnumValueSymbol

Definition at line 788 of file Types.h.

◆ FileExtension

using FileExtension = wxString

Definition at line 267 of file Types.h.

◆ FileExtensions

Definition at line 268 of file Types.h.

◆ FilePath

using FilePath = wxString

Definition at line 270 of file Types.h.

◆ FilePaths

Definition at line 271 of file Types.h.

◆ NumericFormatSymbol

Definition at line 789 of file Types.h.

◆ PluginID

typedef wxString PluginID

Definition at line 743 of file Types.h.

◆ PluginPath

using PluginPath = wxString

type alias for identifying a Plugin supplied by a module, each module defining its own interpretation of the strings, which may or may not be as a file system path

Definition at line 257 of file Types.h.

◆ PluginPaths

using PluginPaths = std::vector< PluginPath >

Definition at line 258 of file Types.h.

◆ RegistryPath

using RegistryPath = wxString

Definition at line 261 of file Types.h.

◆ RegistryPaths

using RegistryPaths = std::vector< RegistryPath >

Definition at line 262 of file Types.h.

◆ samplePtr

typedef char* samplePtr

Definition at line 737 of file Types.h.

◆ TranslatableStrings

Definition at line 555 of file Types.h.

◆ VendorSymbol

Definition at line 791 of file Types.h.

Enumeration Type Documentation

◆ ChannelName

Enumerator
ChannelNameEOL 
ChannelNameMono 
ChannelNameFrontLeft 
ChannelNameFrontRight 
ChannelNameFrontCenter 
ChannelNameLowFrequency1 
ChannelNameBackLeft 
ChannelNameBackRight 
ChannelNameFrontLeftCenter 
ChannelNameFrontRightCenter 
ChannelNameBackCenter 
ChannelNameLowFrequency2 
ChannelNameSideLeft 
ChannelNameSideRight 
ChannelNameTopFrontLeft 
ChannelNameTopFrontRight 
ChannelNameTopFrontCenter 
ChannelNameTopCenter 
ChannelNameTopBackLeft 
ChannelNameTopBackRight 
ChannelNameTopSideLeft 
ChannelNameTopSideRight 
ChannelNameTopBackCenter 
ChannelNameBottomFrontCenter 
ChannelNameBottomFrontLeft 
ChannelNameBottomFrontRight 

Definition at line 749 of file Types.h.

◆ sampleFormat

enum sampleFormat : unsigned
Enumerator
int16Sample 

The increasing sequence of these enum values must correspond to the increasing data type width These values persist in saved project files, so must not be changed in later program versions

int24Sample 
floatSample 
narrowestSampleFormat 

Two synonyms for previous values that might change if more values were added.

widestSampleFormat 

Definition at line 716 of file Types.h.

717 {
720  int16Sample = 0x00020001,
721  int24Sample = 0x00040001,
722  floatSample = 0x0004000F,
723 
727 };

Function Documentation

◆ limitSampleBufferSize()

size_t limitSampleBufferSize ( size_t  bufferSize,
sampleCount  limit 
)
inline

Definition at line 706 of file Types.h.

707 {
708  return
709  std::min( sampleCount( bufferSize ), std::max( sampleCount(0), limit ) )
710  .as_size_t();
711 }

References min().

Referenced by EffectNormalize::AnalyseTrackData(), EffectTruncSilence::Analyze(), CompareAudioCommand::Apply(), EffectAutoDuck::ApplyDuckFade(), VoiceKey::CalibrateNoise(), Sequence::Delete(), WaveTrack::Disjoin(), AudioIO::FillBuffers(), BlockGenerator::GenerateTrack(), NyquistEffect::GetCallback(), WaveTrack::GetEnvelopeValues(), Sequence::GetMinMax(), Sequence::GetRMS(), ImportRaw(), Mixer::MixSameRate(), Mixer::MixVariableRates(), VoiceKey::OffBackward(), VoiceKey::OffForward(), VoiceKey::OnBackward(), VoiceKey::OnForward(), EffectAutoDuck::Process(), EffectSBSMS::Process(), VampEffect::Process(), EffectDtmf::ProcessBlock(), EffectNoiseReduction::Worker::ProcessOne(), EffectEqualization::ProcessOne(), EffectClickRemoval::ProcessOne(), EffectNoiseRemoval::ProcessOne(), EffectFindClipping::ProcessOne(), EffectLoudness::ProcessOne(), EffectNormalize::ProcessOne(), EffectChangeSpeed::ProcessOne(), EffectSimpleMono::ProcessOne(), EffectTwoPassSimpleMono::ProcessOne(), EffectReverse::ProcessOneClip(), Effect::ProcessTrack(), WaveClip::Resample(), resampleCB(), Sequence::SetSamples(), SelectHandle::StartSnappingFreqSelection(), VoiceKey::TestDirectionChanges(), VoiceKey::TestEnergy(), and VoiceKey::TestSignChanges().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=() [1/3]

bool operator!= ( const Identifier x,
const Identifier y 
)
inline

Definition at line 122 of file Types.h.

123 { return !(x == y); }

◆ operator!=() [2/3]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator!= ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Definition at line 213 of file Types.h.

215 { return !(x == y); }

◆ operator!=() [3/3]

bool operator!= ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 651 of file Types.h.

652 {
653  return !(a == b);
654 }

◆ operator%()

sampleCount operator% ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 696 of file Types.h.

697 {
698  return sampleCount{ a } %= b;
699 }

◆ operator*()

sampleCount operator* ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 686 of file Types.h.

687 {
688  return sampleCount{ a } *= b;
689 }

◆ operator+() [1/2]

sampleCount operator+ ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 676 of file Types.h.

677 {
678  return sampleCount{ a } += b;
679 }

◆ operator+() [2/2]

TranslatableString operator+ ( TranslatableString  x,
TranslatableString  y 
)
inline

Definition at line 549 of file Types.h.

551 {
552  return std::move(x += std::move(y));
553 }

◆ operator-()

sampleCount operator- ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 681 of file Types.h.

682 {
683  return sampleCount{ a } -= b;
684 }

◆ operator/()

sampleCount operator/ ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 691 of file Types.h.

692 {
693  return sampleCount{ a } /= b;
694 }

◆ operator<() [1/3]

bool operator< ( const Identifier x,
const Identifier y 
)
inline

Definition at line 125 of file Types.h.

126 { return x.GET() < y.GET(); }

References Identifier::GET().

Here is the call graph for this function:

◆ operator<() [2/3]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator< ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Definition at line 218 of file Types.h.

220 {
221  static_assert( std::is_same< Tag1, Tag2 >::value && b1 == b2,
222  "TaggedIdentifiers with different tags or sensitivity are not comparable" );
223  // This test should be eliminated at compile time:
224  if ( b1 )
225  return x.GET(). Cmp ( y.GET() ) < 0;
226  else
227  return x.GET(). CmpNoCase ( y.GET() ) < 0;
228 }

References Identifier::GET().

Here is the call graph for this function:

◆ operator<() [3/3]

bool operator< ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 656 of file Types.h.

657 {
658  return a.as_long_long() < b.as_long_long();
659 }

References sampleCount::as_long_long().

Here is the call graph for this function:

◆ operator<<()

template<typename Sink >
Sink& operator<< ( Sink &  sink,
const TranslatableString str 
)
inline

Definition at line 573 of file Types.h.

574 {
575  return sink << str.Translation();
576 }

References TranslatableString::Translation().

Here is the call graph for this function:

◆ operator<=() [1/3]

bool operator<= ( const Identifier x,
const Identifier y 
)
inline

Definition at line 131 of file Types.h.

132 { return !(y < x); }

◆ operator<=() [2/3]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator<= ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Definition at line 236 of file Types.h.

238 { return !(y < x); }

◆ operator<=() [3/3]

bool operator<= ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 671 of file Types.h.

672 {
673  return !(b < a);
674 }

◆ operator==() [1/3]

bool operator== ( const Identifier x,
const Identifier y 
)
inline

Definition at line 119 of file Types.h.

120 { return x.GET() == y.GET(); }

References Identifier::GET().

Here is the call graph for this function:

◆ operator==() [2/3]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator== ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Definition at line 200 of file Types.h.

202 {
203  static_assert( std::is_same< Tag1, Tag2 >::value && b1 == b2,
204  "TaggedIdentifiers with different tags or sensitivity are not comparable" );
205  // This test should be eliminated at compile time:
206  if ( b1 )
207  return x.GET(). Cmp ( y.GET() ) == 0;
208  else
209  return x.GET(). CmpNoCase ( y.GET() ) == 0;
210 }

References Identifier::GET().

Here is the call graph for this function:

◆ operator==() [3/3]

bool operator== ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 646 of file Types.h.

647 {
648  return a.as_long_long() == b.as_long_long();
649 }

References sampleCount::as_long_long().

Here is the call graph for this function:

◆ operator>() [1/3]

bool operator> ( const Identifier x,
const Identifier y 
)
inline

Definition at line 128 of file Types.h.

129 { return y < x; }

◆ operator>() [2/3]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator> ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Definition at line 231 of file Types.h.

233 { return y < x; }

◆ operator>() [3/3]

bool operator> ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 666 of file Types.h.

667 {
668  return b < a;
669 }

◆ operator>=() [1/3]

bool operator>= ( const Identifier x,
const Identifier y 
)
inline

Definition at line 134 of file Types.h.

135 { return !(x < y); }

◆ operator>=() [2/3]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator>= ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Definition at line 241 of file Types.h.

243 { return !(x < y); }

◆ operator>=() [3/3]

bool operator>= ( sampleCount  a,
sampleCount  b 
)
inline

Definition at line 661 of file Types.h.

662 {
663  return !(a < b);
664 }

◆ Verbatim()

TranslatableString Verbatim ( wxString  str)
inline

Definition at line 581 of file Types.h.

582 { return TranslatableString( std::move( str ) ); }

Referenced by anonymous_namespace{PluginMenus.cpp}::AddEffectMenuItemGroup(), BatchEvalCommand::Apply(), MacroCommands::ApplyMacro(), ExportFFmpeg::AskResample(), NyquistEffect::BuildEffectWindow(), anonymous_namespace{ClipMenus.cpp}::FoundTrack::ComposeTrackName(), ImportFileHandle::CreateProgress(), CommandManager::DescribeCommandsAndShortcuts(), VSTEffectsModule::DiscoverPluginsAtPath(), anonymous_namespace{FileMenus.cpp}::DoExport(), PluginManager::DropFile(), EVT_COMMAND_RANGE(), ProjectFileIO::Exec(), LadspaEffect::GetDescription(), VampEffect::GetDescription(), TimerRecordDialog::GetDisplayDate(), ExportPCMOptions::GetEncodings(), GetFFmpegVersion(), GetLanguages(), GetMP3Version(), DevicePrefs::GetNamesAndLabels(), CommandManager::GetPrefixedLabelFromName(), LWSlider::GetTip(), ExportPCMOptions::GetTypes(), Importer::Import(), ImportRawDialog::ImportRawDialog(), ExportFFmpeg::InitCodecs(), ExportPlugin::InitProgress(), Ruler::TickSizes::LabelString(), ApplyMacroDialog::OnApplyToFiles(), MeterPanel::OnMouse(), PluginRegistrationDialog::OnOK(), MacrosWindow::OnRemove(), KeyConfigPrefs::OnSet(), XMLFileReader::Parse(), NyquistEffect::ParseFileTypes(), XMLFileReader::ParseString(), PitchName_Absolute(), FrequencyPlotDialog::Populate(), anonymous_namespace{PluginMenus.cpp}::PopulateMacrosMenu(), ExportMultipleDialog::PopulateOrExchange(), EffectEqualization::PopulateOrExchange(), EffectScienFilter::PopulateOrExchange(), VampEffect::PopulateOrExchange(), DevicePrefs::PopulateOrExchange(), ModulePrefs::PopulateOrExchange(), ThemePrefs::PopulateOrExchange(), SpectrumPrefs::PopulatePaddingChoices(), TimerRecordDialog::PreActionDelay(), NyquistEffect::Process(), NyquistEffect::ProcessOne(), ControlToolBar::RegenerateTooltips(), TimerRecordDialog::RunWaitDialog(), ProjectFileIO::SaveProject(), DBConnection::SetDBError(), ToolBar::SetLabel(), ProjectFileIO::SetProjectTitle(), DeviceToolBar::ShowComboDialog(), PrefsDialog::ShowModal(), AudioIO::StartStream(), NyquistEffect::UnQuoteMsgid(), MessageBoxTarget::Update(), AdornedRulerPanel::UpdateButtonStates(), MixerTrackCluster::UpdateForStateChange(), AButton::UpdateStatus(), and TimerRecordDialog::WaitForStart().

◆ wxFromString()

bool wxFromString ( const wxString &  str,
Identifier id 
)
inline

Definition at line 146 of file Types.h.

147  { if (id) { *id = str; return true; } else return false; }

◆ wxToString()

wxString wxToString ( const Identifier str)
inline

Definition at line 150 of file Types.h.

150 { return str.GET(); }

References Identifier::GET().

Here is the call graph for this function:
ChannelNameBackCenter
@ ChannelNameBackCenter
Definition: Types.h:764
TranslatableString
Definition: Types.h:290
ChannelNameTopCenter
@ ChannelNameTopCenter
Definition: Types.h:771
ChannelNameBackRight
@ ChannelNameBackRight
Definition: Types.h:761
ChannelNameMono
@ ChannelNameMono
Definition: Types.h:754
ChannelNameFrontRightCenter
@ ChannelNameFrontRightCenter
Definition: Types.h:763
int24Sample
@ int24Sample
Definition: Types.h:721
ChannelNameTopFrontRight
@ ChannelNameTopFrontRight
Definition: Types.h:769
ChannelNameTopFrontLeft
@ ChannelNameTopFrontLeft
Definition: Types.h:768
floatSample
@ floatSample
Definition: Types.h:722
ChannelNameFrontLeftCenter
@ ChannelNameFrontLeftCenter
Definition: Types.h:762
ChannelNameTopSideRight
@ ChannelNameTopSideRight
Definition: Types.h:775
ChannelNameFrontLeft
@ ChannelNameFrontLeft
Definition: Types.h:756
ChannelNameLowFrequency2
@ ChannelNameLowFrequency2
Definition: Types.h:765
ChannelNameBottomFrontLeft
@ ChannelNameBottomFrontLeft
Definition: Types.h:778
ChannelName
ChannelName
Definition: Types.h:750
ChannelNameEOL
@ ChannelNameEOL
Definition: Types.h:752
sampleCount::as_long_long
long long as_long_long() const
Definition: Types.h:618
ChannelNameBottomFrontRight
@ ChannelNameBottomFrontRight
Definition: Types.h:779
ChannelNames
enum ChannelName * ChannelNames
narrowestSampleFormat
@ narrowestSampleFormat
Two synonyms for previous values that might change if more values were added.
Definition: Types.h:725
ChannelNameLowFrequency1
@ ChannelNameLowFrequency1
Definition: Types.h:759
ChannelNameTopSideLeft
@ ChannelNameTopSideLeft
Definition: Types.h:774
ChannelNameTopBackLeft
@ ChannelNameTopBackLeft
Definition: Types.h:772
ChannelNameTopBackRight
@ ChannelNameTopBackRight
Definition: Types.h:773
Identifier::GET
const wxString & GET() const
Definition: Types.h:110
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
sampleCount
Definition: Types.h:589
ChannelNameSideRight
@ ChannelNameSideRight
Definition: Types.h:767
int16Sample
@ int16Sample
Definition: Types.h:720
ChannelNameSideLeft
@ ChannelNameSideLeft
Definition: Types.h:766
TranslatableString::Translation
wxString Translation() const
Definition: Types.h:337
ChannelNameFrontCenter
@ ChannelNameFrontCenter
Definition: Types.h:758
ChannelNameFrontRight
@ ChannelNameFrontRight
Definition: Types.h:757
ChannelNameBackLeft
@ ChannelNameBackLeft
Definition: Types.h:760
widestSampleFormat
@ widestSampleFormat
Definition: Types.h:726
ChannelNameTopFrontCenter
@ ChannelNameTopFrontCenter
Definition: Types.h:770
ChannelNameTopBackCenter
@ ChannelNameTopBackCenter
Definition: Types.h:776
ChannelNameBottomFrontCenter
@ ChannelNameBottomFrontCenter
Definition: Types.h:777