Audacity 3.2.0
Classes | Namespaces | Functions | Variables
WaveTrack.cpp File Reference
#include "WaveTrack.h"
#include "WaveClip.h"
#include <wx/defs.h>
#include <wx/debug.h>
#include <wx/log.h>
#include <algorithm>
#include <float.h>
#include <math.h>
#include <numeric>
#include <optional>
#include <type_traits>
#include <unordered_set>
#include "float_cast.h"
#include "AudioSegmentSampleView.h"
#include "ChannelAttachments.h"
#include "ClipTimeAndPitchSource.h"
#include "Envelope.h"
#include "Sequence.h"
#include "StaffPadTimeAndPitch.h"
#include "TempoChange.h"
#include "Project.h"
#include "ProjectRate.h"
#include "SampleBlock.h"
#include "BasicUI.h"
#include "Prefs.h"
#include "QualitySettings.h"
#include "SyncLock.h"
#include "TimeWarper.h"
#include "InconsistencyException.h"
#include <cmath>
Include dependency graph for WaveTrack.cpp:

Go to the source code of this file.

Classes

struct  anonymous_namespace{WaveTrack.cpp}::WaveTrackData
 
struct  anonymous_namespace{WaveTrack.cpp}::SplitInfo
 

Namespaces

namespace  anonymous_namespace{WaveTrack.cpp}
 
namespace  anonymous_namespace{WaveTrack.cpp}::anonymous_namespace{WaveTrack.cpp}
 

Functions

WaveTrack::IntervalHolder anonymous_namespace{WaveTrack.cpp}::GetRenderedCopy (const WaveTrack::IntervalHolder &pInterval, const std::function< void(double)> &reportProgress, const SampleBlockFactoryPtr &factory, sampleFormat format)
 
bool anonymous_namespace{WaveTrack.cpp}::anonymous_namespace{WaveTrack.cpp}::AreAligned (const WaveTrack::IntervalConstHolders &a, const WaveTrack::IntervalConstHolders &b)
 
Track::LinkType anonymous_namespace{WaveTrack.cpp}::ToLinkType (int value)
 
static const Track::TypeInfotypeInfo ()
 
bool anonymous_namespace{WaveTrack.cpp}::ClipsAreUnique (const WaveClipHolders &clips)
 
bool GetEditClipsCanMove ()
 
 DEFINE_XML_METHOD_REGISTRY (WaveTrackIORegistry)
 

Variables

static const ChannelGroup::Attachments::RegisteredFactory anonymous_namespace{WaveTrack.cpp}::waveTrackDataFactory
 
static auto DefaultName = XO("Audio")
 
static ProjectFileIORegistry::ObjectReaderEntry readerEntry
 
static constexpr auto Offset_attr = "offset"
 
static constexpr auto Rate_attr = "rate"
 
static constexpr auto Volume_attr
 
static constexpr auto Pan_attr = "pan"
 
static constexpr auto Linked_attr = "linked"
 
static constexpr auto SampleFormat_attr = "sampleformat"
 
static constexpr auto Channel_attr = "channel"
 
static auto TrackFactoryFactory
 
static const AudacityProject::AttachedObjects::RegisteredFactory key2
 
StringSetting AudioTrackNameSetting
 
BoolSetting EditClipsCanMove
 

Function Documentation

◆ DEFINE_XML_METHOD_REGISTRY()

DEFINE_XML_METHOD_REGISTRY ( WaveTrackIORegistry  )

◆ GetEditClipsCanMove()

bool GetEditClipsCanMove ( )

Definition at line 3408 of file WaveTrack.cpp.

3409{
3410 bool mIsSyncLocked = SyncLockTracks.Read();
3411 if( mIsSyncLocked )
3412 return true;
3413 bool editClipsCanMove;
3414 return EditClipsCanMove.Read();
3415}
BoolSetting SyncLockTracks
Definition: SyncLock.cpp:163
BoolSetting EditClipsCanMove
Definition: WaveTrack.cpp:3417
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:207

References EditClipsCanMove, Setting< T >::Read(), and SyncLockTracks.

Referenced by anonymous_namespace{LabelMenus.cpp}::EditClipboardByLabel(), WaveTrackUtilities::ExpandCutLine(), WaveTrack::HandleClear(), anonymous_namespace{EditMenus.cpp}::OnPaste(), WaveTrack::PasteWaveTrackAtSameTempo(), and Generator::Process().

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

◆ typeInfo()

static const Track::TypeInfo & typeInfo ( )
static

Definition at line 676 of file WaveTrack.cpp.

677{
678 static const Track::TypeInfo info{
679 { "wave", "wave", XO("Wave Track") },
681 return info;
682}
XO("Cut/Copy/Paste")
static const TypeInfo & ClassTypeInfo()
Definition: SampleTrack.cpp:60

References WritableSampleTrack::ClassTypeInfo(), and XO().

Referenced by WaveTrack::ClassTypeInfo(), and WaveTrack::GetTypeInfo().

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

Variable Documentation

◆ AudioTrackNameSetting

StringSetting AudioTrackNameSetting
Initial value:
{
L"/GUI/TrackNames/DefaultTrackName",
[]{ return DefaultName.Translation(); }
}
static auto DefaultName
Definition: WaveTrack.cpp:364

Definition at line 3398 of file WaveTrack.cpp.

Referenced by TracksPrefs::Commit(), WaveTrack::GetDefaultAudioTrackNamePreference(), and TracksPrefs::PopulateOrExchange().

◆ Channel_attr

constexpr auto Channel_attr = "channel"
staticconstexpr

Definition at line 2359 of file WaveTrack.cpp.

Referenced by WaveTrack::WriteOneXML().

◆ DefaultName

auto DefaultName = XO("Audio")
static

Definition at line 364 of file WaveTrack.cpp.

Referenced by WaveTrack::GetDefaultAudioTrackNamePreference().

◆ EditClipsCanMove

BoolSetting EditClipsCanMove
Initial value:
{
L"/GUI/EditClipCanMove", false }

Definition at line 3417 of file WaveTrack.cpp.

Referenced by TracksBehaviorsPrefs::Commit(), GetEditClipsCanMove(), BenchmarkDialog::OnRun(), TracksBehaviorsPrefs::PopulateOrExchange(), and WaveTrack::SyncLockAdjust().

◆ key2

Initial value:
{
}
static auto TrackFactoryFactory
Definition: WaveTrack.cpp:3366

Definition at line 3372 of file WaveTrack.cpp.

Referenced by WaveTrackFactory::Destroy(), WaveTrackFactory::Get(), and WaveTrackFactory::Reset().

◆ Linked_attr

constexpr auto Linked_attr = "linked"
staticconstexpr

Definition at line 2357 of file WaveTrack.cpp.

Referenced by WaveTrack::HandleXMLTag(), and WaveTrack::WriteOneXML().

◆ Offset_attr

constexpr auto Offset_attr = "offset"
staticconstexpr

Definition at line 2351 of file WaveTrack.cpp.

Referenced by WaveTrack::HandleXMLTag().

◆ Pan_attr

constexpr auto Pan_attr = "pan"
staticconstexpr

Definition at line 2356 of file WaveTrack.cpp.

Referenced by WaveTrack::HandleXMLTag(), and WaveTrack::WriteOneXML().

◆ Rate_attr

constexpr auto Rate_attr = "rate"
staticconstexpr

Definition at line 2352 of file WaveTrack.cpp.

Referenced by WaveTrack::HandleXMLTag(), and WaveTrack::WriteOneXML().

◆ readerEntry

Initial value:
{
"wavetrack",
}
static WaveTrack * New(AudacityProject &project)
Definition: WaveTrack.cpp:486

Definition at line 386 of file WaveTrack.cpp.

◆ SampleFormat_attr

constexpr auto SampleFormat_attr = "sampleformat"
staticconstexpr

Definition at line 2358 of file WaveTrack.cpp.

Referenced by WaveTrack::HandleXMLTag(), and WaveTrack::WriteOneXML().

◆ TrackFactoryFactory

auto TrackFactoryFactory
static
Initial value:
return std::make_shared< WaveTrackFactory >(
}
const auto project
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
static ProjectRate & Get(AudacityProject &project)
Definition: ProjectRate.cpp:28
static SampleBlockFactoryPtr New(AudacityProject &project)
Definition: SampleBlock.cpp:16

Definition at line 3366 of file WaveTrack.cpp.

Referenced by WaveTrackFactory::Reset().

◆ Volume_attr

constexpr auto Volume_attr
staticconstexpr
Initial value:
=
"gain"

Definition at line 2353 of file WaveTrack.cpp.

Referenced by WaveTrack::HandleXMLTag(), and WaveTrack::WriteOneXML().