Loading...
Searching...
No Matches
Delay.h
Go to the documentation of this file.
// Copyright (c) 2008-2019 OpenShot Studios, LLC
//
// SPDX-License-Identifier: LGPL-3.0-or-later
#ifndef OPENSHOT_DELAY_AUDIO_EFFECT_H
#define OPENSHOT_DELAY_AUDIO_EFFECT_H
#include "EffectBase.h"
#include "Json.h"
#include "KeyFrame.h"
#include <memory>
#include <string>
#include <AppConfig.h>
#include <juce_audio_basics/juce_audio_basics.h>
namespace openshot
{
class Frame;
class Delay : public EffectBase
{
private:
void init_effect_details();
public:
Keyframe delay_time;
juce::AudioBuffer<float> delay_buffer;
int delay_buffer_samples;
int delay_buffer_channels;
int delay_write_position;
bool initialized;
Delay();
Delay(Keyframe new_delay_time);
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
}
void setup(std::shared_ptr<openshot::Frame> frame);
std::shared_ptr<openshot::Frame>
GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
// Get and Set JSON methods
std::string Json() const override;
void SetJson(const std::string value) override;
Json::Value JsonValue() const override;
void SetJsonValue(const Json::Value root) override;
std::string PropertiesJSON(int64_t requested_frame) const override;
};
}
#endif
EffectBase.h
Header file for EffectBase class.
Json.h
Header file for JSON class.
KeyFrame.h
Header file for the Keyframe class.
juce::AudioBuffer
Definition Frame.h:38
openshot::Delay
This class adds a delay into the audio.
Definition Delay.h:36
openshot::Delay::delay_buffer
juce::AudioBuffer< float > delay_buffer
Definition Delay.h:44
openshot::Delay::SetJsonValue
void SetJsonValue(const Json::Value root) override
Load Json::Value into this object.
Definition Delay.cpp:141
openshot::Delay::delay_time
Keyframe delay_time
Definition Delay.h:42
openshot::Delay::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 Delay.h:56
openshot::Delay::Delay
Delay()
Default constructor.
Definition Delay.cpp:19
openshot::Delay::SetJson
void SetJson(const std::string value) override
Load JSON string into this object.
Definition Delay.cpp:124
openshot::Delay::JsonValue
Json::Value JsonValue() const override
Generate Json::Value for this object.
Definition Delay.cpp:112
openshot::Delay::Json
std::string Json() const override
Generate JSON string of this object.
Definition Delay.cpp:105
openshot::Delay::delay_write_position
int delay_write_position
Definition Delay.h:47
openshot::Delay::delay_buffer_samples
int delay_buffer_samples
Definition Delay.h:45
openshot::Delay::PropertiesJSON
std::string PropertiesJSON(int64_t requested_frame) const override
Definition Delay.cpp:152
openshot::Delay::initialized
bool initialized
Definition Delay.h:48
openshot::Delay::delay_buffer_channels
int delay_buffer_channels
Definition Delay.h:46
openshot::Delay::setup
void setup(std::shared_ptr< openshot::Frame > frame)
Definition Delay.cpp:41
openshot::EffectBase
This abstract class is the base class, used by all effects in libopenshot.
Definition EffectBase.h:53
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
This namespace is the default namespace for all code in the openshot library.
Definition Compressor.h:29