Audacity 3.2.0
Typedefs | Functions | Variables
anonymous_namespace{WaveTrackControls.cpp} Namespace Reference

Typedefs

using ValueFinder = std::function< int(WaveTrack &) >
 

Functions

template<typename Table >
PopupMenuTableEntry::InitFunction initFn (const ValueFinder &findValue)
 
void SliderDrawFunction (LWSlider *(*Selector)(const wxRect &sliderRect, const WaveTrack *t, bool captured, wxWindow *), wxDC *dc, const wxRect &rect, const Track *pTrack, wxWindow *pParent, bool captured, bool highlight)
 
void PanSliderDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 
void VolumeSliderDrawFunction (TrackPanelDrawingContext &context, const wxRect &rect, const Track *pTrack)
 

Variables

std::unique_ptr< LWSlidergVolumeCaptured
 
std::unique_ptr< LWSlidergPanCaptured
 
std::unique_ptr< LWSlidergVolume
 
std::unique_ptr< LWSlidergPan
 

Typedef Documentation

◆ ValueFinder

using anonymous_namespace{WaveTrackControls.cpp}::ValueFinder = typedef std::function< int( WaveTrack& ) >

Definition at line 144 of file WaveTrackControls.cpp.

Function Documentation

◆ initFn()

template<typename Table >
PopupMenuTableEntry::InitFunction anonymous_namespace{WaveTrackControls.cpp}::initFn ( const ValueFinder findValue)

Definition at line 149 of file WaveTrackControls.cpp.

150{
151 return [findValue]( PopupMenuHandler &handler, wxMenu &menu, int id ){
152 auto pData = static_cast<Table&>( handler ).mpData;
153 auto &track = static_cast<WaveTrack&>(pData->track);
154 auto &project = pData->project;
155 bool unsafe = ProjectAudioIO::Get( project ).IsAudioActive();
156
157 menu.Check(id, id == findValue(track));
158 menu.Enable( id, !unsafe );
159 };
160};
const auto project
int id
bool IsAudioActive() const
static ProjectAudioIO & Get(AudacityProject &project)
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
static float findValue(const float *spectrum, float bin0, float bin1, unsigned nBins, bool autocorrelation, int gain, int range)

References anonymous_namespace{SpectrumView.cpp}::findValue(), ProjectAudioIO::Get(), audacity::cloud::audiocom::anonymous_namespace{AuthorizationHandler.cpp}::handler, id, ProjectAudioIO::IsAudioActive(), and project.

Referenced by for().

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

◆ PanSliderDrawFunction()

void anonymous_namespace{WaveTrackControls.cpp}::PanSliderDrawFunction ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack 
)

Definition at line 964 of file WaveTrackControls.cpp.

967{
968 auto target = dynamic_cast<PanSliderHandle*>( context.target.get() );
969 auto dc = &context.dc;
970 bool hit = target && target->GetTrack().get() == pTrack;
971 bool captured = hit && target->IsDragging();
972
973 const auto artist = TrackArtist::Get( context );
974 auto pParent = FindProjectFrame( artist->parent->GetProject() );
975
977 &WaveTrackControls::PanSlider, dc, rect, pTrack,
978 pParent, captured, hit);
979}
wxFrame * FindProjectFrame(AudacityProject *project)
Get a pointer to the window associated with a project, or null if the given pointer is null,...
static TrackArtist * Get(TrackPanelDrawingContext &)
Definition: TrackArtist.cpp:81
static LWSlider * PanSlider(CellularPanel &panel, const WaveTrack &wt)
void SliderDrawFunction(LWSlider *(*Selector)(const wxRect &sliderRect, const WaveTrack *t, bool captured, wxWindow *), wxDC *dc, const wxRect &rect, const Track *pTrack, wxWindow *pParent, bool captured, bool highlight)

References TrackPanelDrawingContext::dc, FindProjectFrame(), TrackArtist::Get(), WaveTrackControls::PanSlider(), SliderDrawFunction(), and TrackPanelDrawingContext::target.

Referenced by WaveTrackTCPLines::WaveTrackTCPLines().

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

◆ SliderDrawFunction()

void anonymous_namespace{WaveTrackControls.cpp}::SliderDrawFunction ( LWSlider *(*)(const wxRect &sliderRect, const WaveTrack *t, bool captured, wxWindow *)  Selector,
wxDC *  dc,
const wxRect &  rect,
const Track pTrack,
wxWindow *  pParent,
bool  captured,
bool  highlight 
)

Definition at line 951 of file WaveTrackControls.cpp.

957{
958 wxRect sliderRect = rect;
960 auto wt = static_cast<const WaveTrack*>( pTrack );
961 Selector( sliderRect, wt, captured, pParent )->OnPaint(*dc, highlight);
962}
void OnPaint(wxDC &dc, bool highlighted)
Definition: ASlider.cpp:723
AUDACITY_DLL_API void GetSliderHorizontalBounds(const wxRect &rect, wxRect &dest)

References CommonTrackInfo::GetSliderHorizontalBounds().

Referenced by PanSliderDrawFunction(), and VolumeSliderDrawFunction().

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

◆ VolumeSliderDrawFunction()

void anonymous_namespace{WaveTrackControls.cpp}::VolumeSliderDrawFunction ( TrackPanelDrawingContext context,
const wxRect &  rect,
const Track pTrack 
)

Definition at line 981 of file WaveTrackControls.cpp.

984{
985 auto target = dynamic_cast<VolumeSliderHandle*>( context.target.get() );
986 auto dc = &context.dc;
987 bool hit = target && target->GetTrack().get() == pTrack;
988 if( hit )
989 hit=hit;
990 bool captured = hit && target->IsDragging();
991
992 const auto artist = TrackArtist::Get( context );
993 auto pParent = FindProjectFrame( artist->parent->GetProject() );
994
996 &WaveTrackControls::VolumeSlider, dc, rect, pTrack,
997 pParent, captured, hit);
998}
static LWSlider * VolumeSlider(CellularPanel &panel, const WaveTrack &wt)

References TrackPanelDrawingContext::dc, FindProjectFrame(), TrackArtist::Get(), SliderDrawFunction(), TrackPanelDrawingContext::target, and WaveTrackControls::VolumeSlider().

Referenced by WaveTrackTCPLines::WaveTrackTCPLines().

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

Variable Documentation

◆ gPan

std::unique_ptr<LWSlider> anonymous_namespace{WaveTrackControls.cpp}::gPan

◆ gPanCaptured

std::unique_ptr<LWSlider> anonymous_namespace{WaveTrackControls.cpp}::gPanCaptured

◆ gVolume

std::unique_ptr<LWSlider> anonymous_namespace{WaveTrackControls.cpp}::gVolume

◆ gVolumeCaptured

std::unique_ptr<LWSlider> anonymous_namespace{WaveTrackControls.cpp}::gVolumeCaptured