OpenShot Library | libopenshot  0.3.2
Noise.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_NOISE_AUDIO_EFFECT_H
14 #define OPENSHOT_NOISE_AUDIO_EFFECT_H
15 
16 #include "../EffectBase.h"
17 
18 #include "../Frame.h"
19 #include "../Json.h"
20 #include "../KeyFrame.h"
21 
22 #include <memory>
23 #include <string>
24 #include <random>
25 #include <math.h>
26 
27 
28 namespace openshot
29 {
30 
35  class Noise : public EffectBase
36  {
37  private:
39  void init_effect_details();
40 
41  public:
43 
45  Noise();
46 
51 
52  std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
53  return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
54  }
55 
56  std::shared_ptr<openshot::Frame>
57  GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
58 
59  // Get and Set JSON methods
60  std::string Json() const override;
61  void SetJson(const std::string value) override;
62  Json::Value JsonValue() const override;
63  void SetJsonValue(const Json::Value root) override;
64 
65  std::string PropertiesJSON(int64_t requested_frame) const override;
66  };
67 
68 }
69 
70 #endif
openshot::Noise::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition: Noise.cpp:115
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition: EffectBase.h:53
openshot
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:28
openshot::Noise::level
Keyframe level
Noise level keyframe. The amount of noise inserted on the audio.
Definition: Noise.h:42
openshot::Noise::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: Noise.h:52
openshot::Noise::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition: Noise.cpp:104
openshot::Noise::Noise
Noise()
Default constructor.
Definition: Noise.cpp:22
openshot::Noise::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition: Noise.cpp:75
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::Noise::Json
std::string Json() const override
Generate JSON string of this object.
Definition: Noise.cpp:68
openshot::Noise::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition: Noise.cpp:87
openshot::Noise
This class adds a noise into the audio.
Definition: Noise.h:35