OpenShot Library | libopenshot 0.3.3
Loading...
Searching...
No Matches
Expander.h
Go to the documentation of this file.
1
9// Copyright (c) 2008-2019 OpenShot Studios, LLC
10//
11// SPDX-License-Identifier: LGPL-3.0-or-later
12
13#ifndef OPENSHOT_EXPANDER_AUDIO_EFFECT_H
14#define OPENSHOT_EXPANDER_AUDIO_EFFECT_H
15
16#include "EffectBase.h"
17
18#include "Json.h"
19#include "KeyFrame.h"
20#include "Enums.h"
21
22#include <memory>
23#include <string>
24
25#include <AppConfig.h>
26#include <juce_audio_basics/juce_audio_basics.h>
27
28namespace openshot
29{
30 class Frame;
31
36 class Expander : public EffectBase
37 {
38 private:
40 void init_effect_details();
41
42
43 public:
50
52 float xl;
53 float yl;
54 float xg;
55 float yg;
56 float control;
57
59 float yl_prev;
60
62 float inverseE;
63
65 Expander();
66
70
71 float calculateAttackOrRelease(float value);
72
73 std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
74 return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
75 }
76
77 std::shared_ptr<openshot::Frame>
78 GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
79
80 // Get and Set JSON methods
81 std::string Json() const override;
82 void SetJson(const std::string value) override;
83 Json::Value JsonValue() const override;
84 void SetJsonValue(const Json::Value root) override;
85
86 std::string PropertiesJSON(int64_t requested_frame) const override;
87 };
88
89}
90
91#endif
Header file for EffectBase class.
Header file for TextReader class.
Header file for JSON class.
Header file for the Keyframe class.
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:54
This class adds a expander (or noise gate) into the audio.
Definition Expander.h:37
Expander()
Default constructor.
Definition Expander.cpp:19
float inverse_sample_rate
Definition Expander.h:61
std::string PropertiesJSON(int64_t requested_frame) const override
Definition Expander.cpp:189
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition Expander.cpp:163
Keyframe makeup_gain
Definition Expander.h:48
Keyframe release
Definition Expander.h:47
float calculateAttackOrRelease(float value)
Definition Expander.cpp:113
void SetJson(const std::string value) override
Load JSON string into this object.
Definition Expander.cpp:146
Keyframe threshold
Definition Expander.h:44
Keyframe bypass
Definition Expander.h:49
Keyframe attack
Definition Expander.h:46
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition Expander.cpp:129
juce::AudioBuffer< float > mixed_down_input
Definition Expander.h:51
std::string Json() const override
Generate JSON string of this object.
Definition Expander.cpp:122
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 Expander.h:73
A Keyframe is a collection of Point instances, which is used to vary a number or property over time.
Definition KeyFrame.h:53
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29