Audacity 3.2.0
Typedefs | Functions
TempoChange.h File Reference
#include "AttachedVirtualFunction.h"
#include <optional>
Include dependency graph for TempoChange.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

using OnProjectTempoChange = AttachedVirtualFunction< struct OnProjectTempoChangeTag, void, ChannelGroup, const std::optional< double > &, double >
 Method to set project tempo on a channel group, defaulting to no-op. More...
 

Functions

 DECLARE_EXPORTED_ATTACHED_VIRTUAL (STRETCHING_SEQUENCE_API, OnProjectTempoChange)
 
STRETCHING_SEQUENCE_API void DoProjectTempoChange (ChannelGroup &group, double newTempo)
 
STRETCHING_SEQUENCE_API const std::optional< double > & GetProjectTempo (const ChannelGroup &group)
 

Typedef Documentation

◆ OnProjectTempoChange

using OnProjectTempoChange = AttachedVirtualFunction< struct OnProjectTempoChangeTag, void, ChannelGroup, const std::optional<double>& , double >

Method to set project tempo on a channel group, defaulting to no-op.

Definition at line 17 of file TempoChange.h.

Function Documentation

◆ DECLARE_EXPORTED_ATTACHED_VIRTUAL()

DECLARE_EXPORTED_ATTACHED_VIRTUAL ( STRETCHING_SEQUENCE_API  ,
OnProjectTempoChange   
)

◆ DoProjectTempoChange()

STRETCHING_SEQUENCE_API void DoProjectTempoChange ( ChannelGroup group,
double  newTempo 
)

Definition at line 41 of file TempoChange.cpp.

42{
43 auto &oldTempo = ProjectTempo::Get(group).mProjectTempo;
44 OnProjectTempoChange::Call(group, oldTempo, newTempo);
45 oldTempo = newTempo;
46}
static Return Call(This &obj, Arguments ...arguments)
Invoke the method – but only after static initialization time.
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:200

References AttachedVirtualFunction< Tag, Return, This, Arguments >::Call(), and BasicUI::Get().

Referenced by WaveTrack::DuplicateWithOtherTempo(), ProjectFileManager::Import(), ProjectTempoListener::OnProjectTempoChange(), BenchmarkDialog::OnRun(), and ProjectTempoListener::ProjectTempoListener().

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

◆ GetProjectTempo()

STRETCHING_SEQUENCE_API const std::optional< double > & GetProjectTempo ( const ChannelGroup group)

Definition at line 48 of file TempoChange.cpp.

49{
50 return ProjectTempo::Get(group).mProjectTempo;
51}

References BasicUI::Get().

Referenced by WaveTrack::ClearAndPaste(), WaveTrack::ClearAndPasteAtSameTempo(), WaveTrack::DoCreateClip(), anonymous_namespace{EditMenus.cpp}::DoPasteNothingSelected(), WaveTrack::InsertClip(), WaveTrack::PasteWaveTrack(), and WaveTrack::PasteWaveTrackAtSameTempo().

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