OpenShot Library | libopenshot 0.3.2
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
29namespace juce {
30 namespace dsp {
31 class FFT;
32 }
33}
34namespace openshot
35{
36 class Frame;
37
42 class Robotization : public EffectBase
43 {
44 private:
46 void init_effect_details();
47
48 public:
52
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
Header file for EffectBase class.
Header file for TextReader class.
Header file for JSON class.
Header file for the Keyframe class.
This abstract class is the base class, used by all effects in libopenshot.
Definition: EffectBase.h:53
This class adds a robotization effect into the audio.
Definition: Robotization.h:43
Robotization()
Default constructor.
std::unique_ptr< juce::dsp::FFT > fft
Definition: Robotization.h:90
std::recursive_mutex mutex
Definition: Robotization.h:88
std::string PropertiesJSON(int64_t requested_frame) const override
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
openshot::HopSize hop_size
Definition: Robotization.h:50
openshot::FFTSize fft_size
Definition: Robotization.h:49
void SetJson(const std::string value) override
Load JSON string into this object.
openshot::WindowType window_type
Definition: Robotization.h:51
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
std::string Json() const override
Generate JSON string of this object.
Json::Value JsonValue() const override
Generate Json::Value for this object.
RobotizationEffect stft
Definition: Robotization.h:89
This namespace is the default namespace for all code in the openshot library.
Definition: Compressor.h:29
FFTSize
This enumeration determines the FFT size.
Definition: Enums.h:92
HopSize
This enumeration determines the hop size.
Definition: Enums.h:105
WindowType
This enumeration determines the window type.
Definition: Enums.h:112