Loading...
Searching...
No Matches
Compressor.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_COMPRESSOR_AUDIO_EFFECT_H
#define OPENSHOT_COMPRESSOR_AUDIO_EFFECT_H
#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 Compressor : public EffectBase
{
private:
void init_effect_details();
public:
Keyframe threshold;
Keyframe ratio;
Keyframe attack;
Keyframe release;
Keyframe makeup_gain;
Keyframe bypass;
juce::AudioBuffer<float> mixed_down_input;
float xl;
float yl;
float xg;
float yg;
float control;
float input_level;
float yl_prev;
float inverse_sample_rate;
float inverseE;
Compressor();
Compressor(Keyframe threshold, Keyframe ratio, Keyframe attack,
Keyframe release, Keyframe makeup_gain, Keyframe bypass);
float calculateAttackOrRelease(float value);
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;
};
}
#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.
juce::AudioBuffer
Definition Frame.h:38
openshot::Compressor
This class adds a compressor into the audio.
Definition Compressor.h:36
openshot::Compressor::control
float control
Definition Compressor.h:55
openshot::Compressor::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition Compressor.cpp:183
openshot::Compressor::input_level
float input_level
Definition Compressor.h:57
openshot::Compressor::makeup_gain
Keyframe makeup_gain
Definition Compressor.h:47
openshot::Compressor::bypass
Keyframe bypass
Definition Compressor.h:48
openshot::Compressor::xg
float xg
Definition Compressor.h:53
openshot::Compressor::inverseE
float inverseE
Definition Compressor.h:61
openshot::Compressor::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 Compressor.h:72
openshot::Compressor::Compressor
Compressor()
Default constructor.
Definition Compressor.cpp:19
openshot::Compressor::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition Compressor.cpp:123
openshot::Compressor::ratio
Keyframe ratio
Definition Compressor.h:44
openshot::Compressor::xl
float xl
Definition Compressor.h:51
openshot::Compressor::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition Compressor.cpp:157
openshot::Compressor::mixed_down_input
juce::AudioBuffer< float > mixed_down_input
Definition Compressor.h:50
openshot::Compressor::release
Keyframe release
Definition Compressor.h:46
openshot::Compressor::yl_prev
float yl_prev
Definition Compressor.h:58
openshot::Compressor::inverse_sample_rate
float inverse_sample_rate
Definition Compressor.h:60
openshot::Compressor::yg
float yg
Definition Compressor.h:54
openshot::Compressor::attack
Keyframe attack
Definition Compressor.h:45
openshot::Compressor::threshold
Keyframe threshold
Definition Compressor.h:43
openshot::Compressor::yl
float yl
Definition Compressor.h:52
openshot::Compressor::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition Compressor.cpp:140
openshot::Compressor::Json
std::string Json() const override
Generate JSON string of this object.
Definition Compressor.cpp:116
openshot::Compressor::calculateAttackOrRelease
float calculateAttackOrRelease(float value)
Definition Compressor.cpp:107
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:53
openshot::Frame
This class represents a single frame of video (i.e. image & audio data)
Definition Frame.h:91
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
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29