OpenShot Library | libopenshot 0.3.3
Loading...
Searching...
No Matches
Compressor.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_COMPRESSOR_AUDIO_EFFECT_H
14#define OPENSHOT_COMPRESSOR_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;
35 class Compressor : public EffectBase
36 {
37 private:
39 void init_effect_details();
40
41
42 public:
49
51 float xl;
52 float yl;
53 float xg;
54 float yg;
55 float control;
56
58 float yl_prev;
59
61 float inverseE;
62
64 Compressor();
65
69
70 float calculateAttackOrRelease(float value);
71
72 std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
73 return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
74 }
75
76 std::shared_ptr<openshot::Frame>
77 GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
78
79 // Get and Set JSON methods
80 std::string Json() const override;
81 void SetJson(const std::string value) override;
82 Json::Value JsonValue() const override;
83 void SetJsonValue(const Json::Value root) override;
84
85 std::string PropertiesJSON(int64_t requested_frame) const override;
86 };
87
88}
89
90#endif
Header file for EffectBase class.
Header file for TextReader class.
Header file for JSON class.
Header file for the Keyframe class.
This class adds a compressor into the audio.
Definition Compressor.h:36
std::string PropertiesJSON(int64_t requested_frame) const override
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
Compressor()
Default constructor.
Json::Value JsonValue() const override
Generate Json::Value for this object.
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
juce::AudioBuffer< float > mixed_down_input
Definition Compressor.h:50
void SetJson(const std::string value) override
Load JSON string into this object.
std::string Json() const override
Generate JSON string of this object.
float calculateAttackOrRelease(float value)
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:54
This class represents a single frame of video (i.e. image & audio data)
Definition Frame.h:91
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