OpenShot Library | libopenshot  0.3.3
Robotization.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_ROBOTIZATION_AUDIO_EFFECT_H
14 #define OPENSHOT_ROBOTIZATION_AUDIO_EFFECT_H
15 #define _USE_MATH_DEFINES
16 
17 #include <memory>
18 #include <mutex>
19 #include <string>
20 
21 #include "EffectBase.h"
22 
23 #include "STFT.h"
24 
25 #include "Json.h"
26 #include "KeyFrame.h"
27 #include "Enums.h"
28 
29 namespace juce {
30  namespace dsp {
31  class FFT;
32  }
33 }
34 namespace openshot
35 {
36  class Frame;
37 
42  class Robotization : public EffectBase
43  {
44  private:
46  void init_effect_details();
47 
48  public:
52 
54  Robotization();
55 
60 
61  std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
62  return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
63  }
64 
65  std::shared_ptr<openshot::Frame>
66  GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
67 
68  // Get and Set JSON methods
69  std::string Json() const override;
70  void SetJson(const std::string value) override;
71  Json::Value JsonValue() const override;
72  void SetJsonValue(const Json::Value root) override;
73 
74  std::string PropertiesJSON(int64_t requested_frame) const override;
75 
76 
77  class RobotizationEffect : public STFT
78  {
79  public:
80  RobotizationEffect (Robotization& p) : parent (p) { }
81 
82  private:
83  void modification(const int channel) override;
84 
85  Robotization &parent;
86  };
87 
88  std::recursive_mutex mutex;
90  std::unique_ptr<juce::dsp::FFT> fft;
91  };
92 
93 } // namespace
94 
95 #endif // OPENSHOT_ROBOTIZATION_AUDIO_EFFECT_H
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition: EffectBase.h:53
openshot::Robotization::fft_size
openshot::FFTSize fft_size
Definition: Robotization.h:49
openshot
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:28
openshot::Robotization::window_type
openshot::WindowType window_type
Definition: Robotization.h:51
openshot::Robotization::mutex
std::recursive_mutex mutex
Definition: Robotization.h:88
EffectBase.h
Header file for EffectBase class.
openshot::Robotization::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition: Robotization.cpp:123
KeyFrame.h
Header file for the Keyframe class.
openshot::Robotization::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition: Robotization.cpp:139
openshot::Robotization::hop_size
openshot::HopSize hop_size
Definition: Robotization.h:50
openshot::Robotization::RobotizationEffect
Definition: Robotization.h:77
openshot::Robotization::RobotizationEffect::RobotizationEffect
RobotizationEffect(Robotization &p)
Definition: Robotization.h:80
openshot::Robotization::Json
std::string Json() const override
Generate JSON string of this object.
Definition: Robotization.cpp:85
juce
Definition: Robotization.h:29
openshot::FFTSize
FFTSize
This enumeration determines the FFT size.
Definition: Enums.h:91
openshot::Robotization::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition: Robotization.cpp:106
openshot::Robotization
This class adds a robotization effect into the audio.
Definition: Robotization.h:42
openshot::STFT
Definition: STFT.h:21
openshot::Robotization::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition: Robotization.cpp:92
Enums.h
Header file for TextReader class.
openshot::HopSize
HopSize
This enumeration determines the hop size.
Definition: Enums.h:105
openshot::Robotization::fft
std::unique_ptr< juce::dsp::FFT > fft
Definition: Robotization.h:90
openshot::Robotization::stft
RobotizationEffect stft
Definition: Robotization.h:89
openshot::Robotization::Robotization
Robotization()
Default constructor.
Definition: Robotization.cpp:20
Json.h
Header file for JSON class.
STFT.h
openshot::WindowType
WindowType
This enumeration determines the window type.
Definition: Enums.h:112
openshot::Robotization::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: Robotization.h:61