OpenShot Library | libopenshot  0.4.0
Echo.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_ECHO_AUDIO_EFFECT_H
14 #define OPENSHOT_ECHO_AUDIO_EFFECT_H
15 
16 #include "EffectBase.h"
17 
18 #include "Json.h"
19 #include "KeyFrame.h"
20 
21 #include <memory>
22 #include <string>
23 
24 #include <AppConfig.h>
25 #include <juce_audio_basics/juce_audio_basics.h>
26 
27 namespace openshot
28 {
29  class Frame;
30 
35  class Echo : public EffectBase
36  {
37  private:
39  void init_effect_details();
40 
41  public:
45 
51 
53  Echo();
54 
57 
58  std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
59  return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
60  }
61 
62  void setup(std::shared_ptr<openshot::Frame> frame);
63 
64  std::shared_ptr<openshot::Frame>
65  GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
66 
67  // Get and Set JSON methods
68  std::string Json() const override;
69  void SetJson(const std::string value) override;
70  Json::Value JsonValue() const override;
71  void SetJsonValue(const Json::Value root) override;
72 
73  std::string PropertiesJSON(int64_t requested_frame) const override;
74  };
75 
76 }
77 
78 #endif
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition: EffectBase.h:53
openshot::Echo::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: Echo.h:58
openshot::Echo::echo_time
Keyframe echo_time
Definition: Echo.h:42
openshot::Echo::feedback
Keyframe feedback
Definition: Echo.h:43
openshot::Echo::mix
Keyframe mix
Definition: Echo.h:44
openshot::Echo::echo_buffer_samples
int echo_buffer_samples
Definition: Echo.h:47
openshot
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:28
juce::AudioBuffer< float >
openshot::Echo::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition: Echo.cpp:146
EffectBase.h
Header file for EffectBase class.
KeyFrame.h
Header file for the Keyframe class.
openshot::Echo::setup
void setup(std::shared_ptr< openshot::Frame > frame)
Definition: Echo.cpp:43
openshot::Echo::Echo
Echo()
Default constructor.
Definition: Echo.cpp:19
openshot::Echo::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition: Echo.cpp:115
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::Echo::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition: Echo.cpp:129
openshot::Echo::initialized
bool initialized
Definition: Echo.h:50
openshot::Echo::echo_buffer_channels
int echo_buffer_channels
Definition: Echo.h:48
openshot::Echo::Json
std::string Json() const override
Generate JSON string of this object.
Definition: Echo.cpp:108
openshot::Echo
This class adds a echo into the audio.
Definition: Echo.h:35
Json.h
Header file for JSON class.
openshot::Echo::echo_write_position
int echo_write_position
Definition: Echo.h:49
openshot::Echo::echo_buffer
juce::AudioBuffer< float > echo_buffer
Definition: Echo.h:46
openshot::Echo::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition: Echo.cpp:161