OpenShot Library | libopenshot  0.4.0
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 
28 namespace 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 
58  float input_level;
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
openshot::Expander::makeup_gain
Keyframe makeup_gain
Definition: Expander.h:48
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition: EffectBase.h:53
openshot::Expander::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition: Expander.cpp:163
openshot::Expander::yl
float yl
Definition: Expander.h:53
openshot
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:28
openshot::Expander::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition: Expander.cpp:146
openshot::Expander::threshold
Keyframe threshold
Definition: Expander.h:44
juce::AudioBuffer< float >
openshot::Expander::attack
Keyframe attack
Definition: Expander.h:46
openshot::Expander::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition: Expander.cpp:129
openshot::Expander
This class adds a expander (or noise gate) into the audio.
Definition: Expander.h:36
openshot::Expander::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: Expander.h:73
EffectBase.h
Header file for EffectBase class.
openshot::Expander::calculateAttackOrRelease
float calculateAttackOrRelease(float value)
Definition: Expander.cpp:113
openshot::Expander::mixed_down_input
juce::AudioBuffer< float > mixed_down_input
Definition: Expander.h:51
openshot::Expander::yg
float yg
Definition: Expander.h:55
KeyFrame.h
Header file for the Keyframe class.
openshot::Expander::release
Keyframe release
Definition: Expander.h:47
openshot::Expander::inverseE
float inverseE
Definition: Expander.h:62
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::Expander::bypass
Keyframe bypass
Definition: Expander.h:49
openshot::Expander::xg
float xg
Definition: Expander.h:54
openshot::Expander::yl_prev
float yl_prev
Definition: Expander.h:59
openshot::Expander::control
float control
Definition: Expander.h:56
openshot::Expander::input_level
float input_level
Definition: Expander.h:58
openshot::Expander::xl
float xl
Definition: Expander.h:52
Enums.h
Header file for TextReader class.
openshot::Expander::Expander
Expander()
Default constructor.
Definition: Expander.cpp:19
openshot::Expander::Json
std::string Json() const override
Generate JSON string of this object.
Definition: Expander.cpp:122
openshot::Expander::inverse_sample_rate
float inverse_sample_rate
Definition: Expander.h:61
openshot::Expander::ratio
Keyframe ratio
Definition: Expander.h:45
Json.h
Header file for JSON class.
openshot::Expander::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition: Expander.cpp:189