Mema
Memory Matrix — multi-channel audio matrix monitor and router
Loading...
Searching...
No Matches
Mema::Mema Class Reference

#include <Mema.h>

+ Inheritance diagram for Mema::Mema:
+ Collaboration diagram for Mema::Mema:

Public Member Functions

 Mema ()
 
 ~Mema () override
 
void timerCallback () override
 Periodic timer callback used to poll CPU usage and trigger deferred dumps.
 
juce::Component * getMemaProcessorEditor ()
 Returns the main processor editor component.
 
juce::Component * getDeviceSetupComponent ()
 Returns the audio device setup component.
 
const std::unique_ptr< MemaProcessor > & getMemaProcessor () const
 Provides read access to the owned MemaProcessor instance.
 
void clearUICallbacks ()
 Clears all UI callback functions.
 
void performConfigurationDump () override
 Serializes the current configuration to file.
 
void onConfigUpdated () override
 Reacts to configuration changes and updates internal state.
 
void propagateLookAndFeelChanged ()
 Propagates a look-and-feel change to all owned components.
 
void setUIConfigState (const std::unique_ptr< juce::XmlElement > &uiConfigState)
 Stores a UI configuration state snapshot.
 
const std::unique_ptr< juce::XmlElement > & getUIConfigState ()
 Returns the cached UI configuration state.
 
void triggerPromptLoadConfig ()
 Opens a file chooser dialog to load a configuration file.
 
void triggerPromptSaveConfig ()
 Opens a file chooser dialog to save the configuration file.
 

Public Attributes

std::function< void(int)> onCpuUsageUpdate
 Called when CPU load percentage changes.
 
std::function< void(const std::map< int, std::pair< double, bool > > &)> onNetworkUsageUpdate
 Called when network traffic metrics change.
 
std::function< void(const JUCEAppBasics::SessionServiceTopology &)> onServiceDiscoveryTopologyUpdate
 Called when the multicast service topology changes.
 
std::function< void(juce::Rectangle< int >)> onEditorSizeChangeRequested
 Called when the editor requests a resize.
 

Detailed Description

Definition at line 42 of file Mema.h.

Constructor & Destructor Documentation

◆ Mema()

◆ ~Mema()

Mema::Mema::~Mema ( )
override

Definition at line 87 of file Mema.cpp.

Member Function Documentation

◆ clearUICallbacks()

void Mema::Mema::clearUICallbacks ( )

Clears all UI callback functions.

Definition at line 140 of file Mema.cpp.

◆ getDeviceSetupComponent()

juce::Component * Mema::Mema::getDeviceSetupComponent ( )

Returns the audio device setup component.

Definition at line 127 of file Mema.cpp.

◆ getMemaProcessor()

const std::unique_ptr< MemaProcessor > & Mema::Mema::getMemaProcessor ( ) const

Provides read access to the owned MemaProcessor instance.

Intended for use by subsystems (e.g. HeadlessCLIMenu) that need to interact with the processor directly but must not take ownership of it. The returned reference remains valid for the lifetime of this Mema singleton.

Returns
A const reference to the unique_ptr that owns the MemaProcessor. Callers can check operator bool() to verify the processor is initialised before use.

Definition at line 135 of file Mema.cpp.

◆ getMemaProcessorEditor()

juce::Component * Mema::Mema::getMemaProcessorEditor ( )

Returns the main processor editor component.

Definition at line 106 of file Mema.cpp.

◆ getUIConfigState()

const std::unique_ptr< juce::XmlElement > & Mema::Mema::getUIConfigState ( )

Returns the cached UI configuration state.

Definition at line 199 of file Mema.cpp.

◆ onConfigUpdated()

void Mema::Mema::onConfigUpdated ( )
override

Reacts to configuration changes and updates internal state.

Definition at line 166 of file Mema.cpp.

References Mema::MemaAppConfiguration::getTagName(), Mema::MemaAppConfiguration::PROCESSORCONFIG, and Mema::MemaAppConfiguration::UICONFIG.

◆ performConfigurationDump()

void Mema::Mema::performConfigurationDump ( )
override

Serializes the current configuration to file.

Definition at line 151 of file Mema.cpp.

References Mema::MemaAppConfiguration::getTagName(), Mema::MemaAppConfiguration::PROCESSORCONFIG, and Mema::MemaAppConfiguration::UICONFIG.

◆ propagateLookAndFeelChanged()

void Mema::Mema::propagateLookAndFeelChanged ( )

Propagates a look-and-feel change to all owned components.

Definition at line 181 of file Mema.cpp.

◆ setUIConfigState()

void Mema::Mema::setUIConfigState ( const std::unique_ptr< juce::XmlElement > &  uiConfigState)

Stores a UI configuration state snapshot.

Definition at line 194 of file Mema.cpp.

◆ timerCallback()

void Mema::Mema::timerCallback ( )
override

Periodic timer callback used to poll CPU usage and trigger deferred dumps.

Definition at line 93 of file Mema.cpp.

◆ triggerPromptLoadConfig()

void Mema::Mema::triggerPromptLoadConfig ( )

Opens a file chooser dialog to load a configuration file.

Definition at line 204 of file Mema.cpp.

References Mema::MemaAppConfiguration::isValid().

◆ triggerPromptSaveConfig()

void Mema::Mema::triggerPromptSaveConfig ( )

Opens a file chooser dialog to save the configuration file.

Definition at line 274 of file Mema.cpp.

Member Data Documentation

◆ onCpuUsageUpdate

std::function<void(int)> Mema::Mema::onCpuUsageUpdate

Called when CPU load percentage changes.

Definition at line 71 of file Mema.h.

◆ onEditorSizeChangeRequested

std::function<void(juce::Rectangle<int>)> Mema::Mema::onEditorSizeChangeRequested

Called when the editor requests a resize.

Definition at line 74 of file Mema.h.

◆ onNetworkUsageUpdate

std::function<void(const std::map<int, std::pair<double, bool>>&)> Mema::Mema::onNetworkUsageUpdate

Called when network traffic metrics change.

Definition at line 72 of file Mema.h.

◆ onServiceDiscoveryTopologyUpdate

std::function<void(const JUCEAppBasics::SessionServiceTopology&)> Mema::Mema::onServiceDiscoveryTopologyUpdate

Called when the multicast service topology changes.

Definition at line 73 of file Mema.h.


The documentation for this class was generated from the following files: