diff --git a/src/audio_effects/Compressor.cpp b/src/audio_effects/Compressor.cpp index a35edf21..07043482 100644 --- a/src/audio_effects/Compressor.cpp +++ b/src/audio_effects/Compressor.cpp @@ -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 diff --git a/src/audio_effects/Compressor.h b/src/audio_effects/Compressor.h index 6933005f..b7da6be7 100644 --- a/src/audio_effects/Compressor.h +++ b/src/audio_effects/Compressor.h @@ -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 GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared(), 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 GetFrame(std::shared_ptr frame, int64_t frame_number) override; + std::shared_ptr + GetFrame(std::shared_ptr 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; }; diff --git a/src/audio_effects/Delay.cpp b/src/audio_effects/Delay.cpp index ff886d79..be53abfa 100644 --- a/src/audio_effects/Delay.cpp +++ b/src/audio_effects/Delay.cpp @@ -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(); } diff --git a/src/audio_effects/Delay.h b/src/audio_effects/Delay.h index 2d96e250..8a07d977 100644 --- a/src/audio_effects/Delay.h +++ b/src/audio_effects/Delay.h @@ -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 GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared(), frame_number); } void setup(std::shared_ptr 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 GetFrame(std::shared_ptr frame, int64_t frame_number) override; + std::shared_ptr + GetFrame(std::shared_ptr 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; }; diff --git a/src/audio_effects/Distortion.cpp b/src/audio_effects/Distortion.cpp index a21e790a..18e38144 100644 --- a/src/audio_effects/Distortion.cpp +++ b/src/audio_effects/Distortion.cpp @@ -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 Distortion::GetFrame(std::shared_ptr threshold) diff --git a/src/audio_effects/Distortion.h b/src/audio_effects/Distortion.h index ba7cf892..9c09fa9b 100644 --- a/src/audio_effects/Distortion.h +++ b/src/audio_effects/Distortion.h @@ -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 GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared(), 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 GetFrame(std::shared_ptr 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 diff --git a/src/audio_effects/Echo.cpp b/src/audio_effects/Echo.cpp index 7667c62d..afffdcf3 100644 --- a/src/audio_effects/Echo.cpp +++ b/src/audio_effects/Echo.cpp @@ -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(); diff --git a/src/audio_effects/Echo.h b/src/audio_effects/Echo.h index 8d16e292..dab00646 100644 --- a/src/audio_effects/Echo.h +++ b/src/audio_effects/Echo.h @@ -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 GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared(), frame_number); } void setup(std::shared_ptr 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 GetFrame(std::shared_ptr frame, int64_t frame_number) override; + std::shared_ptr + GetFrame(std::shared_ptr 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; }; diff --git a/src/audio_effects/Expander.cpp b/src/audio_effects/Expander.cpp index d08cc340..cbdd2312 100644 --- a/src/audio_effects/Expander.cpp +++ b/src/audio_effects/Expander.cpp @@ -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(); diff --git a/src/audio_effects/Expander.h b/src/audio_effects/Expander.h index 202bbd16..70f34612 100644 --- a/src/audio_effects/Expander.h +++ b/src/audio_effects/Expander.h @@ -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 GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared(), 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 GetFrame(std::shared_ptr frame, int64_t frame_number) override; + std::shared_ptr + GetFrame(std::shared_ptr 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; }; diff --git a/src/audio_effects/Noise.cpp b/src/audio_effects/Noise.cpp index df869d67..b3d08620 100644 --- a/src/audio_effects/Noise.cpp +++ b/src/audio_effects/Noise.cpp @@ -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(); diff --git a/src/audio_effects/Noise.h b/src/audio_effects/Noise.h index c3c7a264..807737e6 100644 --- a/src/audio_effects/Noise.h +++ b/src/audio_effects/Noise.h @@ -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 GetFrame(int64_t frame_number) override { - return GetFrame(std::make_shared(), frame_number); + std::shared_ptr GetFrame(int64_t frame_number) override { + return GetFrame(std::make_shared(), 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 GetFrame(std::shared_ptr frame, int64_t frame_number) override; + std::shared_ptr + GetFrame(std::shared_ptr 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; }; diff --git a/src/audio_effects/ParametricEQ.cpp b/src/audio_effects/ParametricEQ.cpp index 0b1eceb7..3542bfbe 100644 --- a/src/audio_effects/ParametricEQ.cpp +++ b/src/audio_effects/ParametricEQ.cpp @@ -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); diff --git a/src/audio_effects/ParametricEQ.h b/src/audio_effects/ParametricEQ.h index e2a733d4..456b8709 100644 --- a/src/audio_effects/ParametricEQ.h +++ b/src/audio_effects/ParametricEQ.h @@ -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 GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared(), 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 GetFrame(std::shared_ptr frame, int64_t frame_number) override; + std::shared_ptr + GetFrame(std::shared_ptr 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 filters; diff --git a/src/audio_effects/Robotization.cpp b/src/audio_effects/Robotization.cpp index c3a3792e..a26d9493 100644 --- a/src/audio_effects/Robotization.cpp +++ b/src/audio_effects/Robotization.cpp @@ -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(); diff --git a/src/audio_effects/Robotization.h b/src/audio_effects/Robotization.h index cf24b7f7..9719ee21 100644 --- a/src/audio_effects/Robotization.h +++ b/src/audio_effects/Robotization.h @@ -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 GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared(), 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 GetFrame(std::shared_ptr frame, int64_t frame_number) override; + std::shared_ptr + GetFrame(std::shared_ptr 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; diff --git a/src/audio_effects/Whisperization.cpp b/src/audio_effects/Whisperization.cpp index 41162a2c..df65cbb0 100644 --- a/src/audio_effects/Whisperization.cpp +++ b/src/audio_effects/Whisperization.cpp @@ -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(); diff --git a/src/audio_effects/Whisperization.h b/src/audio_effects/Whisperization.h index 5a75d237..d79337ec 100644 --- a/src/audio_effects/Whisperization.h +++ b/src/audio_effects/Whisperization.h @@ -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 GetFrame(int64_t frame_number) override { return GetFrame(std::make_shared(), 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 GetFrame(std::shared_ptr frame, int64_t frame_number) override; + std::shared_ptr + GetFrame(std::shared_ptr 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;