EchoMap
2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Toggle main menu visibility
Loading...
Searching...
No Matches
SignalWaveformPanel.hpp
Go to the documentation of this file.
1
7
8
#ifndef ECHOMAP_SIGNALWAVEFORMPANEL_HPP
9
#define ECHOMAP_SIGNALWAVEFORMPANEL_HPP
10
11
#include <implot.h>
12
#include <sigc++/scoped_connection.h>
13
14
#include <
string
>
15
16
#include "
../objects/IDAllocator.hpp
"
17
#include "
IProjectPanel.hpp
"
18
19
namespace
echomap
20
{
21
22
class
WorkerResultDespatcher
;
23
class
DownsampleResult
;
24
class
Signal
;
25
class
Worker
;
26
32
class
SignalWaveformPanel
final :
public
IProjectPanel
33
{
34
public
:
44
explicit
SignalWaveformPanel
(
45
Worker
* parent_worker,
46
WorkerResultDespatcher
& despatcher,
47
const
Project
* initial_project =
nullptr
48
);
49
50
~SignalWaveformPanel
()
noexcept
override
;
51
52
SignalWaveformPanel
(
const
SignalWaveformPanel
&) =
delete
;
53
SignalWaveformPanel
& operator=(
const
SignalWaveformPanel
&) =
delete
;
54
55
SignalWaveformPanel
(
SignalWaveformPanel
&&)
noexcept
;
56
SignalWaveformPanel
& operator=(
SignalWaveformPanel
&&)
noexcept
=
delete
;
57
58
[[nodiscard]]
const
char
*
get_imgui_name
()
const
noexcept
override
;
59
60
void
draw
()
noexcept
override
;
61
62
void
change_active_project
(
const
Project
* new_project)
override
;
63
64
static
const
char
* get_imgui_stable_name()
noexcept
;
65
66
private
:
67
static
constexpr
float
default_downsample_factor = 50.0f;
68
69
struct
CallbackData
70
{
71
const
Signal
* signal;
72
};
73
74
static
ImPlotPoint get_indexed_signal_point(
75
int
index,
76
void
* user_data
77
)
noexcept
;
78
79
void
handle_downsampled_result(
DownsampleResult
&& result);
80
81
void
update_bounding_box(
const
Signal
& signal)
noexcept
;
82
void
update_bounding_box() noexcept;
83
93
const
Signal
*
get_downsampled_signal
(
std
::shared_ptr<
Signal
> signal);
94
109
std
::unordered_map<id_type,
std
::unique_ptr<
Signal
>>
downsample_cache
;
110
117
ImPlotRect
bounding_box
;
118
119
std
::
string
panel_name;
120
ImPlotSpec plotting_spec_2d;
121
Worker
* parent_worker;
122
const
Project
* active_project =
nullptr
;
123
std
::vector<sigc::scoped_connection> connections;
124
};
125
126
}
// namespace echomap
127
128
#endif
// ECHOMAP_SIGNALWAVEFORMPANEL_HPP
IDAllocator.hpp
IDAllocator specification.
IProjectPanel.hpp
IProjectPanel specification.
echomap::DownsampleResult
Denotes a completed for a downsampled Signal produced by a DownsampleTask job.
Definition
DownsampleResult.hpp:26
echomap::IProjectPanel
An IPanel which can receive updates to the application-wide active Project.
Definition
IProjectPanel.hpp:24
echomap::Project
Definition
Project.hpp:26
echomap::SignalWaveformPanel::get_downsampled_signal
const Signal * get_downsampled_signal(std::shared_ptr< Signal > signal)
Retrieves a downsampled Signal from the cache.
Definition
SignalWaveformPanel.cpp:163
echomap::SignalWaveformPanel::get_imgui_name
const char * get_imgui_name() const noexcept override
Retrieves the name of the IPanel for Dear ImGui API functions.
Definition
SignalWaveformPanel.cpp:47
echomap::SignalWaveformPanel::SignalWaveformPanel
SignalWaveformPanel(Worker *parent_worker, WorkerResultDespatcher &despatcher, const Project *initial_project=nullptr)
Create a new SignalWaveformPanel to display downsampled Signal waveforms in the time domain.
Definition
SignalWaveformPanel.cpp:23
echomap::SignalWaveformPanel::draw
void draw() noexcept override
Draw the panel to the active rendering context.
Definition
SignalWaveformPanel.cpp:52
echomap::SignalWaveformPanel::bounding_box
ImPlotRect bounding_box
The maximum bounding box of an LTTB-downsampled wave form plot.
Definition
SignalWaveformPanel.hpp:117
echomap::SignalWaveformPanel::downsample_cache
std::unordered_map< id_type, std::unique_ptr< Signal > > downsample_cache
The duplicated Signal objects, downsampled for visualisation.
Definition
SignalWaveformPanel.hpp:109
echomap::SignalWaveformPanel::change_active_project
void change_active_project(const Project *new_project) override
Updates the active Project being described by the IPanel.
Definition
SignalWaveformPanel.cpp:96
echomap::Signal
A single channel of discretely sampled audio data.
Definition
Signal.hpp:40
echomap::WorkerResultDespatcher
Manages channels for WorkerResult message routing.
Definition
WorkerResultDespatcher.hpp:27
echomap::Worker
A Worker provides an encapsulated thread-safe despatch model for submitting work and reviewing result...
Definition
Worker.hpp:45
echomap
The main EchoMap outermost namespace for all non-exported symbols.
Definition
ActionController.hpp:20
std
STL namespace.
string
echomap::SignalWaveformPanel::CallbackData
Definition
SignalWaveformPanel.hpp:70
src
panels
SignalWaveformPanel.hpp
Generated by
1.17.0