10#ifndef ECHOMAP_SIGNALDFTPANEL_HPP
11#define ECHOMAP_SIGNALDFTPANEL_HPP
13#include <sigc++/scoped_connection.h>
51 const Project* initial_project =
nullptr
62 void draw()
noexcept override;
64 [[nodiscard]]
const char*
get_imgui_name()
const noexcept override;
68 static const char* get_imgui_stable_name()
noexcept;
77 static ImPlotPoint get_indexed_frequency_bin(
82 void handle_completed_dft(
DFTResult&& result);
84 void draw_configuration_section() noexcept;
85 void draw_configuration_window_function() noexcept;
86 void draw_configuration_transform_size() noexcept;
87 void draw_configuration_scale_type() noexcept;
88 void draw_configuration_preview_actions() noexcept;
90 void draw_preview_section() noexcept;
91 void draw_preview_of_signal(
std::shared_ptr<
Signal> signal) noexcept;
93 void reset_available_transform_sizes();
95 void update_spectrum_bounds() noexcept;
96 void update_available_sizes(
std::uint64_t maximum_sample_count);
97 void reset_viewport_bounds() noexcept;
102 std::
size_t transform_size
118 ImPlotSpec plotting_spec_2d;
120 const Project* active_project =
nullptr;
129 WindowFunctions::AllFunctions window_function;
132 bool operator==(
const CacheKey& key)
const;
146 } status{State::NotRequested};
IDAllocator specification.
IProjectPanel specification.
WindowFunctions specification.
Denotes a completed DFT computation from a DFTTask.
The EchoMap maintains state for the application including WebGPU and Dear ImGui context,...
A Signal sampled in the frequency domain.
An IPanel which can receive updates to the application-wide active Project.
void change_active_project(const Project *new_project) override
Updates the active Project being described by the IPanel.
unsigned int selected_size_log
Base-2 log of selected transform size.
SignalDFTPanel(Worker *parent_worker, WorkerResultDespatcher &despatcher, EchoMap *app, const Project *initial_project=nullptr)
Create a new SignalDFTPanel to display DFTs of Signal waveforms in the frequency domain.
ImPlotRect spectrum_bounds
The minimal bounding box required to fully contain the DFT spectrum plot.
std::unordered_map< CacheKey, CacheValue, CacheKeyHash > spectra_cache
Cached DFT spectra.
ImPlotRect viewport_bounds
The user-controlled bounding box of the DFT plots.
std::vector< std::string > available_sizes
Strings of all available transform sizes.
void draw() noexcept override
Draw the panel to the active rendering context.
static constexpr unsigned int default_size_log
Base-2 log of the minimum transform size.
bool use_log_scale
Should the DFT be plotted with a linear or base-10 logarithmic freq.
const char * get_imgui_name() const noexcept override
Retrieves the name of the IPanel for Dear ImGui API functions.
A single channel of discretely sampled audio data.
Aggregation of callable DSP window functions.
Manages channels for WorkerResult message routing.
A Worker provides an encapsulated thread-safe despatch model for submitting work and reviewing result...
The main EchoMap outermost namespace for all non-exported symbols.
The hash functor for CacheKey.
A three-way key into the FrequencySpectrum cache.
A keyed value within the FrequencySpectrum cache, either denoting a pending, failed,...
The Constant invocable window function.