OpenShot Library | libopenshot  0.3.1
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 
58  openshot::HopSize hop_size,
59  openshot::WindowType window_type);
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
This abstract class is the base class, used by all effects in libopenshot.
Definition: EffectBase.h:52
FFTSize
This enumeration determines the FFT size.
Definition: Enums.h:91
Header file for the Keyframe class.
openshot::WindowType window_type
Definition: Robotization.h:51
openshot::HopSize hop_size
Definition: Robotization.h:50
std::recursive_mutex mutex
Definition: Robotization.h:88
Header file for JSON class.
RobotizationEffect stft
Definition: Robotization.h:89
Header file for TextReader class.
HopSize
This enumeration determines the hop size.
Definition: Enums.h:105
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:28
Header file for EffectBase class.
WindowType
This enumeration determines the window type.
Definition: Enums.h:112
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
openshot::FFTSize fft_size
Definition: Robotization.h:49
This class adds a robotization effect into the audio.
Definition: Robotization.h:42
std::unique_ptr< juce::dsp::FFT > fft
Definition: Robotization.h:90