Audacity 3.2.0
Classes | Namespaces | Macros | Functions | Variables
SpectrumView.cpp File Reference
#include "SpectrumView.h"
#include "SpectralDataManager.h"
#include "SpectrumCache.h"
#include "Sequence.h"
#include "Spectrum.h"
#include "ClipParameters.h"
#include "SpectrumVRulerControls.h"
#include "WaveChannelViewConstants.h"
#include "../../../ui/BrushHandle.h"
#include "AColor.h"
#include "PendingTracks.h"
#include "Prefs.h"
#include "NumberScale.h"
#include "../../../../TrackArt.h"
#include "../../../../TrackArtist.h"
#include "../../../../TrackPanelDrawingContext.h"
#include "ViewInfo.h"
#include "WaveClip.h"
#include "WaveTrack.h"
#include "WaveTrackLocation.h"
#include "WaveTrackUtilities.h"
#include "SpectrogramSettings.h"
#include <wx/dcmemory.h>
#include <wx/graphics.h>
#include "float_cast.h"
#include "WaveTrackControls.h"
#include "AudioIOBase.h"
#include "../../../../MenuCreator.h"
#include "ProjectHistory.h"
#include "../../../../RefreshCode.h"
#include "../../../../prefs/PrefsDialog.h"
#include "../../../../prefs/SpectrumPrefs.h"
#include "AudacityMessageBox.h"
#include "../../../../widgets/PopupMenuTable.h"
#include "../../../ui/SelectHandle.h"
#include "../../../../CommonCommandFlags.h"
#include "Project.h"
#include "SpectrumAnalyst.h"
#include "CommandContext.h"
Include dependency graph for SpectrumView.cpp:

Go to the source code of this file.

Classes

class  SpectrumView::SpectralDataSaver
 
struct  anonymous_namespace{SpectrumView.cpp}::SpectrogramSettingsHandler
 
struct  anonymous_namespace{SpectrumView.cpp}::Handler
 

Namespaces

namespace  anonymous_namespace{SpectrumView.cpp}
 

Macros

#define FN(X)   (& Handler :: X)
 

Functions

static UIHandlePtr BrushHandleHitTest (std::weak_ptr< BrushHandle > &holder, const TrackPanelMouseState &st, const AudacityProject *pProject, const std::shared_ptr< SpectrumView > &pChannelView, const std::shared_ptr< SpectralData > &mpData)
 
static float anonymous_namespace{SpectrumView.cpp}::findValue (const float *spectrum, float bin0, float bin1, unsigned nBins, bool autocorrelation, int gain, int range)
 
AColor::ColorGradientChoice anonymous_namespace{SpectrumView.cpp}::ChooseColorSet (float bin0, float bin1, float selBinLo, float selBinCenter, float selBinHi, int dashCount, bool isSpectral)
 
std::pair< sampleCount, sampleCountanonymous_namespace{SpectrumView.cpp}::GetSelectedSampleIndices (const SelectedRegion &selectedRegion, const WaveChannelInterval &clip, bool trackIsSelected)
 
void anonymous_namespace{SpectrumView.cpp}::DrawClipSpectrum (TrackPanelDrawingContext &context, const WaveChannel &channel, const WaveChannelInterval &clip, const wxRect &rect, const std::shared_ptr< SpectralData > &mpSpectralData, bool selected)
 
static bool ShouldCaptureEvent (wxKeyEvent &event, SpectralData *pData)
 
void anonymous_namespace{SpectrumView.cpp}::DoNextPeakFrequency (AudacityProject &project, bool up)
 
static CommandHandlerObjectanonymous_namespace{SpectrumView.cpp}::findCommandHandler (AudacityProject &project)
 
auto anonymous_namespace{SpectrumView.cpp}::SpectralSelectionMenu ()
 

Variables

static WaveChannelSubView::Type sType
 
static WaveChannelSubViewType::RegisteredType reg { sType }
 
static const WaveChannelSubViews::RegisteredFactory key
 
PopupMenuTable::AttachedItem anonymous_namespace{SpectrumView.cpp}::sAttachment
 
static const AttachedProjectObjects::RegisteredFactory anonymous_namespace{SpectrumView.cpp}::key
 
AttachedItem anonymous_namespace{SpectrumView.cpp}::sAttachment2
 

Macro Definition Documentation

◆ FN

#define FN (   X)    (& Handler :: X)

Definition at line 1180 of file SpectrumView.cpp.

Function Documentation

◆ BrushHandleHitTest()

static UIHandlePtr BrushHandleHitTest ( std::weak_ptr< BrushHandle > &  holder,
const TrackPanelMouseState st,
const AudacityProject pProject,
const std::shared_ptr< SpectrumView > &  pChannelView,
const std::shared_ptr< SpectralData > &  mpData 
)
static

Definition at line 129 of file SpectrumView.cpp.

134{
135 const auto &viewInfo = ViewInfo::Get( *pProject );
136 auto &projectSettings = ProjectSettings::Get( *pProject );
137 auto result = std::make_shared<BrushHandle>(
138 std::make_shared<SpectrumView::SpectralDataSaver>(*pChannelView),
139 pChannelView, TrackList::Get(*pProject),
140 st, viewInfo, mpData, projectSettings);
141
142 result = AssignUIHandlePtr(holder, result);
143
144 //Make sure we are within the selected track
145 const auto pChannel = pChannelView->FindWaveChannel();
146 if (!pChannel ||
147 !pChannel->GetTrack().GetSelected())
148 {
149 return result;
150 }
151
152 return result;
153}
std::shared_ptr< Subclass > AssignUIHandlePtr(std::weak_ptr< Subclass > &holder, const std::shared_ptr< Subclass > &pNew)
Definition: UIHandle.h:164
static ProjectSettings & Get(AudacityProject &project)
static TrackList & Get(AudacityProject &project)
Definition: Track.cpp:314
static ViewInfo & Get(AudacityProject &project)
Definition: ViewInfo.cpp:235

References AssignUIHandlePtr(), ViewInfo::Get(), TrackList::Get(), and ProjectSettings::Get().

Referenced by SpectrumView::DetailedHitTest().

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

◆ ShouldCaptureEvent()

static bool ShouldCaptureEvent ( wxKeyEvent &  event,
SpectralData pData 
)
static

Definition at line 1057 of file SpectrumView.cpp.

1058{
1059 const auto keyCode = event.GetKeyCode();
1060 return
1061 (keyCode == WXK_BACK || keyCode == WXK_DELETE ||
1062 keyCode == WXK_NUMPAD_DELETE)
1063 && pData && !pData->dataHistory.empty();
1064}
std::vector< HopsAndBinsMap > dataHistory
Definition: SpectrumView.h:44

References SpectralData::dataHistory.

Referenced by SpectrumView::CaptureKey(), SpectrumView::Char(), and SpectrumView::KeyDown().

Here is the caller graph for this function:

Variable Documentation

◆ key

Initial value:
{
[](WaveChannelView &view){
return std::make_shared<SpectrumView>(view);
}
}

Definition at line 915 of file SpectrumView.cpp.

Referenced by anonymous_namespace{SpectrumView.cpp}::findCommandHandler().

◆ reg

Definition at line 57 of file SpectrumView.cpp.

◆ sType

Initial value:
{
{ wxT("Spectrogram"), XXO("&Spectrogram") }
}
wxT("CloseDown"))
XXO("&Cut/Copy/Paste Toolbar")

Definition at line 52 of file SpectrumView.cpp.

Referenced by SpectrumView::SubViewType().