MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
Generator.cpp
Go to the documentation of this file.
1#include "Generator.hpp"
2
4
13
18
33
34void Generator::set_amplitude(double amplitude)
35{
36 m_amplitude = amplitude;
37}
38
40{
41 return m_amplitude;
42}
43
44void Generator::set_frequency(float frequency)
45{
46 m_frequency = frequency;
47}
48
50{
51 if (is_gpu_compatible()) {
52 return m_context_gpu;
53 }
54 return m_context;
55}
56
57} // namespace MayaFlux::Nodes::Generator
double amplitude
Current amplitude of the generator.
Definition Generator.hpp:57
double phase
Current phase of the generator.
Definition Generator.hpp:62
float frequency
Current frequency of the generator.
Definition Generator.hpp:52
virtual void set_frequency(float frequency)
Sets the generator's frequency.
Definition Generator.cpp:44
virtual bool should_mock_process() const
Checks if the generator should mock process.
Definition Generator.cpp:14
virtual double get_amplitude() const
Gets the current base amplitude.
Definition Generator.cpp:39
virtual void set_amplitude(double amplitude)
Sets the generator's amplitude.
Definition Generator.cpp:34
float m_frequency
Base frequency of the generator.
NodeContext & get_last_context() override
Gets the last created context object.
Definition Generator.cpp:49
double m_amplitude
Base amplitude of the generator.
virtual void update_context(double value) override
Updates the context object for callbacks.
Definition Generator.cpp:19
virtual void enable_mock_process(bool mock_process)
Allows RootNode to process the Generator without using the processed sample.
Definition Generator.cpp:5
double m_phase
Current phase of the generator.
double value
Current sample value.
Definition Node.hpp:40
Base context class for node callbacks.
Definition Node.hpp:30
bool is_gpu_compatible() const
Checks if the node supports GPU processing.
Definition Node.hpp:329
std::atomic< Utils::NodeState > m_state
Atomic state flag tracking the node's processing status.
Definition Node.hpp:463
bool m_gpu_compatible
Flag indicating if the node supports GPU processing This flag is set by derived classes to indicate w...
Definition Node.hpp:383
void atomic_add_flag(std::atomic< Utils::NodeState > &state, Utils::NodeState flag)
Atomically adds a flag to a node state.
Definition NodeUtils.cpp:96
void atomic_remove_flag(std::atomic< Utils::NodeState > &state, Utils::NodeState flag)
Atomically removes a flag from a node state.
@ MOCK_PROCESS
Node should be processed but output ignored.
Definition Utils.hpp:33