Loading...
Searching...
No Matches
ParametricEQ.h
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef OPENSHOT_PARAMETRIC_EQ_AUDIO_EFFECT_H
#define OPENSHOT_PARAMETRIC_EQ_AUDIO_EFFECT_H
#define _USE_MATH_DEFINES
#include "EffectBase.h"
#include "Json.h"
#include "KeyFrame.h"
#include "Enums.h"
#include <memory>
#include <string>
#include <AppConfig.h>
#include <juce_audio_basics/juce_audio_basics.h>
namespace openshot
{
class Frame;
class ParametricEQ : public EffectBase
{
private:
void init_effect_details();
public:
openshot::FilterType filter_type;
Keyframe frequency;
Keyframe q_factor;
Keyframe gain;
bool initialized;
ParametricEQ();
ParametricEQ(openshot::FilterType filter_type, Keyframe frequency,
Keyframe gain, Keyframe q_factor);
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
}
std::shared_ptr<openshot::Frame>
GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
// Get and Set JSON methods
std::string Json() const override;
void SetJson(const std::string value) override;
Json::Value JsonValue() const override;
void SetJsonValue(const Json::Value root) override;
std::string PropertiesJSON(int64_t requested_frame) const override;
class Filter : public juce::IIRFilter
{
public:
void updateCoefficients (const double discrete_frequency,
const double q_factor,
const double gain,
const int filter_type);
};
juce::OwnedArray<Filter> filters;
void updateFilters(int64_t frame_number, double sample_rate);
};
}
#endif
EffectBase.h
Header file for EffectBase class.
Enums.h
Header file for TextReader class.
Json.h
Header file for JSON class.
KeyFrame.h
Header file for the Keyframe class.
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:54
openshot::Keyframe
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
Definition KeyFrame.h:53
openshot::ParametricEQ::Filter
Definition ParametricEQ.h:73
openshot::ParametricEQ::Filter::updateCoefficients
void updateCoefficients(const double discrete_frequency, const double q_factor, const double gain, const int filter_type)
Definition ParametricEQ.cpp:81
openshot::ParametricEQ::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition ParametricEQ.cpp:233
openshot::ParametricEQ::q_factor
Keyframe q_factor
Definition ParametricEQ.h:46
openshot::ParametricEQ::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition ParametricEQ.cpp:196
openshot::ParametricEQ::ParametricEQ
ParametricEQ()
Blank constructor, useful when using Json to load the effect properties.
Definition ParametricEQ.cpp:19
openshot::ParametricEQ::GetFrame
std::shared_ptr< openshot::Frame > GetFrame(int64_t frame_number) override
This method is required for all derived classes of ClipBase, and returns a new openshot::Frame object...
Definition ParametricEQ.h:57
openshot::ParametricEQ::Json
std::string Json() const override
Generate JSON string of this object.
Definition ParametricEQ.cpp:174
openshot::ParametricEQ::initialized
bool initialized
Definition ParametricEQ.h:48
openshot::ParametricEQ::updateFilters
void updateFilters(int64_t frame_number, double sample_rate)
Definition ParametricEQ.cpp:162
openshot::ParametricEQ::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition ParametricEQ.cpp:213
openshot::ParametricEQ::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition ParametricEQ.cpp:181
openshot::ParametricEQ::frequency
Keyframe frequency
Definition ParametricEQ.h:45
openshot::ParametricEQ::gain
Keyframe gain
Definition ParametricEQ.h:47
openshot::ParametricEQ::filter_type
openshot::FilterType filter_type
Definition ParametricEQ.h:44
openshot::ParametricEQ::filters
juce::OwnedArray< Filter > filters
Definition ParametricEQ.h:81
openshot
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29
openshot::FilterType
FilterType
This enumeration determines the filter type of ParametricEQ Effect.
Definition Enums.h:118