MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / PropertiesJSON

Method PropertiesJSON

src/audio_effects/Whisperization.cpp:147–178  ·  view source on GitHub ↗

Get all properties for a specific frame

Source from the content-addressed store, hash-verified

145
146// Get all properties for a specific frame
147std::string Whisperization::PropertiesJSON(int64_t requested_frame) const {
148
149 // Generate JSON properties list
150 Json::Value root = BasePropertiesJSON(requested_frame);
151
152 // Keyframes
153 root["fft_size"] = add_property_json("FFT Size", fft_size, "int", "", NULL, 0, 8, false, requested_frame);
154 root["hop_size"] = add_property_json("Hop Size", hop_size, "int", "", NULL, 0, 2, false, requested_frame);
155 root["window_type"] = add_property_json("Window Type", window_type, "int", "", NULL, 0, 3, false, requested_frame);
156
157 // Add fft_size choices (dropdown style)
158 root["fft_size"]["choices"].append(add_property_choice_json("128", FFT_SIZE_128, fft_size));
159 root["fft_size"]["choices"].append(add_property_choice_json("256", FFT_SIZE_256, fft_size));
160 root["fft_size"]["choices"].append(add_property_choice_json("512", FFT_SIZE_512, fft_size));
161 root["fft_size"]["choices"].append(add_property_choice_json("1024", FFT_SIZE_1024, fft_size));
162 root["fft_size"]["choices"].append(add_property_choice_json("2048", FFT_SIZE_2048, fft_size));
163
164 // Add hop_size choices (dropdown style)
165 root["hop_size"]["choices"].append(add_property_choice_json("1/2", HOP_SIZE_2, hop_size));
166 root["hop_size"]["choices"].append(add_property_choice_json("1/4", HOP_SIZE_4, hop_size));
167 root["hop_size"]["choices"].append(add_property_choice_json("1/8", HOP_SIZE_8, hop_size));
168
169 // Add window_type choices (dropdown style)
170 root["window_type"]["choices"].append(add_property_choice_json("Rectangular", RECTANGULAR, window_type));
171 root["window_type"]["choices"].append(add_property_choice_json("Bart Lett", BART_LETT, window_type));
172 root["window_type"]["choices"].append(add_property_choice_json("Hann", HANN, window_type));
173 root["window_type"]["choices"].append(add_property_choice_json("Hamming", HAMMING, window_type));
174
175
176 // Return formatted string
177 return root.toStyledString();
178}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected