You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Audio effects: Clean up doc comments, parameters
This commit is contained in:
@@ -18,9 +18,11 @@ using namespace openshot;
|
||||
|
||||
Compressor::Compressor() : Compressor::Compressor(-10, 1, 1, 1, 1, false) {}
|
||||
|
||||
Compressor::Compressor(Keyframe new_threshold, Keyframe new_ratio, Keyframe new_attack, Keyframe new_release, Keyframe new_makeup_gain, Keyframe new_bypass) :
|
||||
threshold(new_threshold), ratio(new_ratio), attack(new_attack),
|
||||
release(new_release), makeup_gain(new_makeup_gain), bypass(new_bypass),
|
||||
Compressor::Compressor(Keyframe threshold, Keyframe ratio, Keyframe attack,
|
||||
Keyframe release, Keyframe makeup_gain,
|
||||
Keyframe bypass):
|
||||
threshold(threshold), ratio(ratio), attack(attack),
|
||||
release(release), makeup_gain(makeup_gain), bypass(bypass),
|
||||
input_level(0.0), yl_prev(0.0)
|
||||
{
|
||||
// Init effect properties
|
||||
|
||||
@@ -60,36 +60,21 @@ namespace openshot
|
||||
float inverse_sample_rate;
|
||||
float inverseE;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
/// Default constructor
|
||||
Compressor();
|
||||
|
||||
/// Default constructor
|
||||
///
|
||||
/// @param new_level The audio default Compressor level (between 1 and 100)
|
||||
Compressor(Keyframe new_threshold, Keyframe new_ratio, Keyframe new_attack, Keyframe new_release, Keyframe new_makeup_gain, Keyframe new_bypass);
|
||||
/// Constructor
|
||||
Compressor(Keyframe threshold, Keyframe ratio, Keyframe attack,
|
||||
Keyframe release, Keyframe makeup_gain, Keyframe bypass);
|
||||
|
||||
float calculateAttackOrRelease(float value);
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// new openshot::Frame object. All Clip keyframes and effects are resolved into
|
||||
/// pixels.
|
||||
///
|
||||
/// @returns A new openshot::Frame object
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
|
||||
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
|
||||
}
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// modified openshot::Frame object
|
||||
///
|
||||
/// The frame object is passed into this method and used as a starting point (pixels and audio).
|
||||
/// All Clip keyframes and effects are resolved into pixels.
|
||||
///
|
||||
/// @returns The modified openshot::Frame object
|
||||
/// @param frame The frame object that needs the clip or effect applied to it
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
|
||||
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; ///< Generate JSON string of this object
|
||||
@@ -97,8 +82,6 @@ namespace openshot
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
|
||||
|
||||
/// Get all properties for a specific frame (perfect for a UI to display the current state
|
||||
/// of all properties at any time)
|
||||
std::string PropertiesJSON(int64_t requested_frame) const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -16,16 +16,10 @@
|
||||
|
||||
using namespace openshot;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
Delay::Delay() : delay_time(1) {
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
}
|
||||
Delay::Delay() : Delay::Delay(1) { }
|
||||
|
||||
// Default constructor
|
||||
Delay::Delay(Keyframe new_delay_time) : delay_time(new_delay_time)
|
||||
Delay::Delay(Keyframe delay_time) : delay_time(delay_time)
|
||||
{
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
}
|
||||
|
||||
|
||||
@@ -47,34 +47,20 @@ namespace openshot
|
||||
int delay_write_position;
|
||||
bool initialized;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
/// Default constructor
|
||||
Delay();
|
||||
|
||||
/// Default constructor
|
||||
/// Constructor
|
||||
Delay(Keyframe new_delay_time);
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// new openshot::Frame object. All Clip keyframes and effects are resolved into
|
||||
/// pixels.
|
||||
///
|
||||
/// @returns A new openshot::Frame object
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
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);
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// modified openshot::Frame object
|
||||
///
|
||||
/// The frame object is passed into this method and used as a starting point (pixels and audio).
|
||||
/// All Clip keyframes and effects are resolved into pixels.
|
||||
///
|
||||
/// @returns The modified openshot::Frame object
|
||||
/// @param frame The frame object that needs the clip or effect applied to it
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
|
||||
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; ///< Generate JSON string of this object
|
||||
@@ -82,8 +68,6 @@ namespace openshot
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
|
||||
|
||||
/// Get all properties for a specific frame (perfect for a UI to display the current state
|
||||
/// of all properties at any time)
|
||||
std::string PropertiesJSON(int64_t requested_frame) const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief Source file for Distortion audio effect class
|
||||
* @author
|
||||
* @author
|
||||
*
|
||||
* @ref License
|
||||
*/
|
||||
@@ -15,15 +15,13 @@
|
||||
|
||||
using namespace openshot;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
Distortion::Distortion() : distortion_type(HARD_CLIPPING), input_gain(10), output_gain(-10), tone(5) {
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
}
|
||||
Distortion::Distortion(): Distortion::Distortion(HARD_CLIPPING, 10, -10, 5) { }
|
||||
|
||||
// Default constructor
|
||||
Distortion::Distortion(openshot::DistortionType new_distortion_type, Keyframe new_input_gain, Keyframe new_output_gain, Keyframe new_tone) :
|
||||
distortion_type(new_distortion_type), input_gain(new_input_gain), output_gain(new_output_gain), tone(new_tone)
|
||||
Distortion::Distortion(openshot::DistortionType distortion_type,
|
||||
Keyframe input_gain, Keyframe output_gain,
|
||||
Keyframe tone):
|
||||
distortion_type(distortion_type), input_gain(input_gain),
|
||||
output_gain(output_gain), tone(tone)
|
||||
{
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
@@ -69,10 +67,10 @@ std::shared_ptr<openshot::Frame> Distortion::GetFrame(std::shared_ptr<openshot::
|
||||
const int input_gain_value = (int)input_gain.GetValue(frame_number);
|
||||
const int output_gain_value = (int)output_gain.GetValue(frame_number);
|
||||
const float in = channel_data[sample]*powf(10.0f, input_gain_value * 0.05f);
|
||||
|
||||
|
||||
// Use the current distortion type
|
||||
switch (distortion_type) {
|
||||
|
||||
|
||||
case HARD_CLIPPING: {
|
||||
float threshold = 0.5f;
|
||||
if (in > threshold)
|
||||
|
||||
@@ -46,33 +46,17 @@ namespace openshot
|
||||
Keyframe output_gain;
|
||||
Keyframe tone;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
/// Default constructor
|
||||
Distortion();
|
||||
|
||||
/// Default constructor
|
||||
///
|
||||
/// @param new_level The audio default distortion level (between 1 and 100)
|
||||
Distortion(openshot::DistortionType new_distortion_type, Keyframe new_input_gain, Keyframe new_output_gain, Keyframe new_tone);
|
||||
/// Constructor
|
||||
Distortion(openshot::DistortionType distortion_type,
|
||||
Keyframe input_gain, Keyframe output_gain, Keyframe tone);
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// new openshot::Frame object. All Clip keyframes and effects are resolved into
|
||||
/// pixels.
|
||||
///
|
||||
/// @returns A new openshot::Frame object
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
|
||||
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
|
||||
}
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// modified openshot::Frame object
|
||||
///
|
||||
/// The frame object is passed into this method and used as a starting point (pixels and audio).
|
||||
/// All Clip keyframes and effects are resolved into pixels.
|
||||
///
|
||||
/// @returns The modified openshot::Frame object
|
||||
/// @param frame The frame object that needs the clip or effect applied to it
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
|
||||
|
||||
// Get and Set JSON methods
|
||||
@@ -81,8 +65,6 @@ namespace openshot
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
|
||||
|
||||
/// Get all properties for a specific frame (perfect for a UI to display the current state
|
||||
/// of all properties at any time)
|
||||
std::string PropertiesJSON(int64_t requested_frame) const override;
|
||||
|
||||
class Filter : public juce::IIRFilter
|
||||
|
||||
@@ -18,8 +18,8 @@ using namespace openshot;
|
||||
|
||||
Echo::Echo() : Echo::Echo(0.1, 0.5, 0.5) { }
|
||||
|
||||
Echo::Echo(Keyframe new_echo_time, Keyframe new_feedback, Keyframe new_mix) :
|
||||
echo_time(new_echo_time), feedback(new_feedback), mix(new_mix)
|
||||
Echo::Echo(Keyframe echo_time, Keyframe feedback, Keyframe mix) :
|
||||
echo_time(echo_time), feedback(feedback), mix(mix)
|
||||
{
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
|
||||
@@ -49,34 +49,20 @@ namespace openshot
|
||||
int echo_write_position;
|
||||
bool initialized;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
/// Default constructor
|
||||
Echo();
|
||||
|
||||
/// Default constructor
|
||||
Echo(Keyframe new_echo_time, Keyframe new_feedback, Keyframe new_mix);
|
||||
/// Constructor
|
||||
Echo(Keyframe echo_time, Keyframe feedback, Keyframe mix);
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// new openshot::Frame object. All Clip keyframes and effects are resolved into
|
||||
/// pixels.
|
||||
///
|
||||
/// @returns A new openshot::Frame object
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
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);
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// modified openshot::Frame object
|
||||
///
|
||||
/// The frame object is passed into this method and used as a starting point (pixels and audio).
|
||||
/// All Clip keyframes and effects are resolved into pixels.
|
||||
///
|
||||
/// @returns The modified openshot::Frame object
|
||||
/// @param frame The frame object that needs the clip or effect applied to it
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
|
||||
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; ///< Generate JSON string of this object
|
||||
@@ -84,8 +70,6 @@ namespace openshot
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
|
||||
|
||||
/// Get all properties for a specific frame (perfect for a UI to display the current state
|
||||
/// of all properties at any time)
|
||||
std::string PropertiesJSON(int64_t requested_frame) const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -16,15 +16,13 @@
|
||||
|
||||
using namespace openshot;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
Expander::Expander() : threshold(-10), ratio(1), attack(1), release(1), makeup_gain(1), bypass(false) {
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
}
|
||||
Expander::Expander(): Expander::Expander(-10, 1, 1, 1, 1, false) { }
|
||||
|
||||
// Default constructor
|
||||
Expander::Expander(Keyframe new_threshold, Keyframe new_ratio, Keyframe new_attack, Keyframe new_release, Keyframe new_makeup_gain, Keyframe new_bypass) :
|
||||
threshold(new_threshold), ratio(new_ratio), attack(new_attack), release(new_release), makeup_gain(new_makeup_gain), bypass(new_bypass)
|
||||
Expander::Expander(Keyframe threshold, Keyframe ratio, Keyframe attack,
|
||||
Keyframe release, Keyframe makeup_gain, Keyframe bypass) :
|
||||
threshold(threshold), ratio(ratio), attack(attack),
|
||||
release(release), makeup_gain(makeup_gain), bypass(bypass)
|
||||
{
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
|
||||
@@ -61,36 +61,21 @@ namespace openshot
|
||||
float inverse_sample_rate;
|
||||
float inverseE;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
/// Default constructor
|
||||
Expander();
|
||||
|
||||
/// Default constructor
|
||||
///
|
||||
/// @param new_level The audio default Expander level (between 1 and 100)
|
||||
Expander(Keyframe new_threshold, Keyframe new_ratio, Keyframe new_attack, Keyframe new_release, Keyframe new_makeup_gain, Keyframe new_bypass);
|
||||
/// Constructor
|
||||
Expander(Keyframe threshold, Keyframe ratio, Keyframe attack,
|
||||
Keyframe release, Keyframe makeup_gain, Keyframe bypass);
|
||||
|
||||
float calculateAttackOrRelease(float value);
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// new openshot::Frame object. All Clip keyframes and effects are resolved into
|
||||
/// pixels.
|
||||
///
|
||||
/// @returns A new openshot::Frame object
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
|
||||
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
|
||||
}
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// modified openshot::Frame object
|
||||
///
|
||||
/// The frame object is passed into this method and used as a starting point (pixels and audio).
|
||||
/// All Clip keyframes and effects are resolved into pixels.
|
||||
///
|
||||
/// @returns The modified openshot::Frame object
|
||||
/// @param frame The frame object that needs the clip or effect applied to it
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
|
||||
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; ///< Generate JSON string of this object
|
||||
@@ -98,8 +83,6 @@ namespace openshot
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
|
||||
|
||||
/// Get all properties for a specific frame (perfect for a UI to display the current state
|
||||
/// of all properties at any time)
|
||||
std::string PropertiesJSON(int64_t requested_frame) const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -19,14 +19,9 @@
|
||||
|
||||
using namespace openshot;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
Noise::Noise() : level(30) {
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
}
|
||||
Noise::Noise(): Noise::Noise(30) { }
|
||||
|
||||
// Default constructor
|
||||
Noise::Noise(Keyframe new_level) : level(new_level)
|
||||
Noise::Noise(Keyframe level) : level(level)
|
||||
{
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief Header file for Noise audio effect class
|
||||
* @author
|
||||
* @author
|
||||
*
|
||||
* @ref License
|
||||
*/
|
||||
@@ -41,34 +41,20 @@ namespace openshot
|
||||
public:
|
||||
Keyframe level; ///< Noise level keyframe. The amount of noise inserted on the audio.
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
/// Default constructor
|
||||
Noise();
|
||||
|
||||
/// Default constructor
|
||||
/// Constructor
|
||||
///
|
||||
/// @param new_level The audio default noise level (between 1 and 100)
|
||||
Noise(Keyframe new_level);
|
||||
/// @param level The audio default noise level (between 1 and 100)
|
||||
Noise(Keyframe level);
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// new openshot::Frame object. All Clip keyframes and effects are resolved into
|
||||
/// pixels.
|
||||
///
|
||||
/// @returns A new openshot::Frame object
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
|
||||
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
|
||||
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
|
||||
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
|
||||
}
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// modified openshot::Frame object
|
||||
///
|
||||
/// The frame object is passed into this method and used as a starting point (pixels and audio).
|
||||
/// All Clip keyframes and effects are resolved into pixels.
|
||||
///
|
||||
/// @returns The modified openshot::Frame object
|
||||
/// @param frame The frame object that needs the clip or effect applied to it
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
|
||||
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; ///< Generate JSON string of this object
|
||||
@@ -76,8 +62,6 @@ namespace openshot
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
|
||||
|
||||
/// Get all properties for a specific frame (perfect for a UI to display the current state
|
||||
/// of all properties at any time)
|
||||
std::string PropertiesJSON(int64_t requested_frame) const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file
|
||||
* @brief Source file for ParametricEQ audio effect class
|
||||
* @author
|
||||
* @author
|
||||
*
|
||||
* @ref License
|
||||
*/
|
||||
@@ -16,16 +16,12 @@
|
||||
using namespace openshot;
|
||||
using namespace juce;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
ParametricEQ::ParametricEQ() : filter_type(LOW_PASS), frequency(500), gain(0), q_factor(0) {
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
}
|
||||
ParametricEQ::ParametricEQ(): ParametricEQ::ParametricEQ(LOW_PASS, 500, 0, 0) {}
|
||||
|
||||
|
||||
// Default constructor
|
||||
ParametricEQ::ParametricEQ(openshot::FilterType new_filter_type, Keyframe new_frequency, Keyframe new_gain, Keyframe new_q_factor) :
|
||||
filter_type(new_filter_type), frequency(new_frequency), gain(new_gain), q_factor(new_q_factor)
|
||||
ParametricEQ::ParametricEQ(openshot::FilterType filter_type,
|
||||
Keyframe frequency, Keyframe gain, Keyframe q_factor) :
|
||||
filter_type(filter_type),
|
||||
frequency(frequency), gain(gain), q_factor(q_factor)
|
||||
{
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
@@ -236,7 +232,7 @@ void ParametricEQ::SetJsonValue(const Json::Value root) {
|
||||
// Get all properties for a specific frame
|
||||
std::string ParametricEQ::PropertiesJSON(int64_t requested_frame) const {
|
||||
|
||||
// Generate JSON properties list
|
||||
// Generate JSON properties list
|
||||
Json::Value root;
|
||||
root["id"] = add_property_json("ID", 0.0, "string", Id(), NULL, -1, -1, true, requested_frame);
|
||||
root["layer"] = add_property_json("Track", Layer(), "int", "", NULL, 0, 20, false, requested_frame);
|
||||
|
||||
@@ -50,31 +50,16 @@ namespace openshot
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
ParametricEQ();
|
||||
|
||||
/// Default constructor
|
||||
///
|
||||
/// @param new_level
|
||||
ParametricEQ(openshot::FilterType new_filter_type, Keyframe new_frequency, Keyframe new_gain, Keyframe new_q_factor);
|
||||
/// Constructor
|
||||
ParametricEQ(openshot::FilterType filter_type, Keyframe frequency,
|
||||
Keyframe gain, Keyframe q_factor);
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// new openshot::Frame object. All Clip keyframes and effects are resolved into
|
||||
/// pixels.
|
||||
///
|
||||
/// @returns A new openshot::Frame object
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
|
||||
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
|
||||
}
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// modified openshot::Frame object
|
||||
///
|
||||
/// The frame object is passed into this method and used as a starting point (pixels and audio).
|
||||
/// All Clip keyframes and effects are resolved into pixels.
|
||||
///
|
||||
/// @returns The modified openshot::Frame object
|
||||
/// @param frame The frame object that needs the clip or effect applied to it
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
|
||||
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; ///< Generate JSON string of this object
|
||||
@@ -82,17 +67,15 @@ namespace openshot
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
|
||||
|
||||
/// Get all properties for a specific frame (perfect for a UI to display the current state
|
||||
/// of all properties at any time)
|
||||
std::string PropertiesJSON(int64_t requested_frame) const override;
|
||||
|
||||
class Filter : public juce::IIRFilter
|
||||
{
|
||||
public:
|
||||
void updateCoefficients (const double discrete_frequency,
|
||||
const double q_factor,
|
||||
const double gain,
|
||||
const int filter_type);
|
||||
const double q_factor,
|
||||
const double gain,
|
||||
const int filter_type);
|
||||
};
|
||||
|
||||
juce::OwnedArray<Filter> filters;
|
||||
|
||||
@@ -17,15 +17,14 @@
|
||||
using namespace openshot;
|
||||
using namespace juce;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
Robotization::Robotization() : fft_size(FFT_SIZE_512), hop_size(HOP_SIZE_2), window_type(RECTANGULAR), stft(*this) {
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
}
|
||||
Robotization::Robotization()
|
||||
: Robotization::Robotization(FFT_SIZE_512, HOP_SIZE_2, RECTANGULAR) {}
|
||||
|
||||
// Default constructor
|
||||
Robotization::Robotization(openshot::FFTSize new_fft_size, openshot::HopSize new_hop_size, openshot::WindowType new_window_type) :
|
||||
fft_size(new_fft_size), hop_size(new_hop_size), window_type(new_window_type), stft(*this)
|
||||
Robotization::Robotization(openshot::FFTSize fft_size,
|
||||
openshot::HopSize hop_size,
|
||||
openshot::WindowType window_type) :
|
||||
fft_size(fft_size), hop_size(hop_size),
|
||||
window_type(window_type), stft(*this)
|
||||
{
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
|
||||
@@ -50,34 +50,20 @@ namespace openshot
|
||||
openshot::HopSize hop_size;
|
||||
openshot::WindowType window_type;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
/// Default constructor
|
||||
Robotization();
|
||||
|
||||
/// Default constructor
|
||||
///
|
||||
/// @param new_level The audio default Robotization level (between 1 and 100)
|
||||
Robotization(openshot::FFTSize new_fft_size, openshot::HopSize new_hop_size, openshot::WindowType new_window_type);
|
||||
/// Constructor
|
||||
Robotization(openshot::FFTSize fft_size,
|
||||
openshot::HopSize hop_size,
|
||||
openshot::WindowType window_type);
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// new openshot::Frame object. All Clip keyframes and effects are resolved into
|
||||
/// pixels.
|
||||
///
|
||||
/// @returns A new openshot::Frame object
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
|
||||
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
|
||||
}
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// modified openshot::Frame object
|
||||
///
|
||||
/// The frame object is passed into this method and used as a starting point (pixels and audio).
|
||||
/// All Clip keyframes and effects are resolved into pixels.
|
||||
///
|
||||
/// @returns The modified openshot::Frame object
|
||||
/// @param frame The frame object that needs the clip or effect applied to it
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
|
||||
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; ///< Generate JSON string of this object
|
||||
@@ -85,8 +71,6 @@ namespace openshot
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
|
||||
|
||||
/// Get all properties for a specific frame (perfect for a UI to display the current state
|
||||
/// of all properties at any time)
|
||||
std::string PropertiesJSON(int64_t requested_frame) const override;
|
||||
|
||||
|
||||
|
||||
@@ -17,15 +17,14 @@
|
||||
using namespace openshot;
|
||||
using namespace juce;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
Whisperization::Whisperization() : fft_size(FFT_SIZE_512), hop_size(HOP_SIZE_8), window_type(RECTANGULAR), stft(*this) {
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
}
|
||||
Whisperization::Whisperization():
|
||||
Whisperization::Whisperization(FFT_SIZE_512, HOP_SIZE_8, RECTANGULAR) {}
|
||||
|
||||
// Default constructor
|
||||
Whisperization::Whisperization(openshot::FFTSize new_fft_size, openshot::HopSize new_hop_size, openshot::WindowType new_window_type) :
|
||||
fft_size(new_fft_size), hop_size(new_hop_size), window_type(new_window_type), stft(*this)
|
||||
Whisperization::Whisperization(openshot::FFTSize fft_size,
|
||||
openshot::HopSize hop_size,
|
||||
openshot::WindowType window_type) :
|
||||
fft_size(fft_size), hop_size(hop_size),
|
||||
window_type(window_type), stft(*this)
|
||||
{
|
||||
// Init effect properties
|
||||
init_effect_details();
|
||||
|
||||
@@ -49,34 +49,20 @@ namespace openshot
|
||||
openshot::HopSize hop_size;
|
||||
openshot::WindowType window_type;
|
||||
|
||||
/// Blank constructor, useful when using Json to load the effect properties
|
||||
/// Default constructor
|
||||
Whisperization();
|
||||
|
||||
/// Default constructor
|
||||
///
|
||||
/// @param new_level The audio default Whisperization level (between 1 and 100)
|
||||
Whisperization(openshot::FFTSize new_fft_size, openshot::HopSize new_hop_size, openshot::WindowType new_window_type);
|
||||
/// Constructor
|
||||
Whisperization(openshot::FFTSize fft_size,
|
||||
openshot::HopSize hop_size,
|
||||
openshot::WindowType window_type);
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// new openshot::Frame object. All Clip keyframes and effects are resolved into
|
||||
/// pixels.
|
||||
///
|
||||
/// @returns A new openshot::Frame object
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(int64_t frame_number) override {
|
||||
return GetFrame(std::make_shared<openshot::Frame>(), frame_number);
|
||||
}
|
||||
|
||||
/// @brief This method is required for all derived classes of ClipBase, and returns a
|
||||
/// modified openshot::Frame object
|
||||
///
|
||||
/// The frame object is passed into this method and used as a starting point (pixels and audio).
|
||||
/// All Clip keyframes and effects are resolved into pixels.
|
||||
///
|
||||
/// @returns The modified openshot::Frame object
|
||||
/// @param frame The frame object that needs the clip or effect applied to it
|
||||
/// @param frame_number The frame number (starting at 1) of the clip or effect on the timeline.
|
||||
std::shared_ptr<openshot::Frame> GetFrame(std::shared_ptr<openshot::Frame> frame, int64_t frame_number) override;
|
||||
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; ///< Generate JSON string of this object
|
||||
@@ -84,8 +70,6 @@ namespace openshot
|
||||
Json::Value JsonValue() const override; ///< Generate Json::Value for this object
|
||||
void SetJsonValue(const Json::Value root) override; ///< Load Json::Value into this object
|
||||
|
||||
/// Get all properties for a specific frame (perfect for a UI to display the current state
|
||||
/// of all properties at any time)
|
||||
std::string PropertiesJSON(int64_t requested_frame) const override;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user