MCPcopy Create free account
hub / github.com/bbc/audiowaveform / createWaveformColors

Function createWaveformColors

src/OptionHandler.cpp:310–343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

308//------------------------------------------------------------------------------
309
310static WaveformColors createWaveformColors(const Options& options)
311{
312 WaveformColors colors;
313
314 const std::string& color_scheme = options.getColorScheme();
315
316 if (color_scheme == "audacity") {
317 colors = audacity_waveform_colors;
318 }
319 else if (color_scheme == "audition") {
320 colors = audition_waveform_colors;
321 }
322 else {
323 throwError("Unknown color scheme: %1%", color_scheme);
324 }
325
326 if (options.hasBorderColor()) {
327 colors.border_color = options.getBorderColor();
328 }
329
330 if (options.hasBackgroundColor()) {
331 colors.background_color = options.getBackgroundColor();
332 }
333
334 if (options.hasWaveformColor()) {
335 colors.waveform_colors = options.getWaveformColors();
336 }
337
338 if (options.hasAxisLabelColor()) {
339 colors.axis_label_color = options.getAxisLabelColor();
340 }
341
342 return colors;
343}
344
345//------------------------------------------------------------------------------
346

Callers 1

renderWaveformImageMethod · 0.85

Calls 5

hasBorderColorMethod · 0.80
hasBackgroundColorMethod · 0.80
hasWaveformColorMethod · 0.80
hasAxisLabelColorMethod · 0.80
throwErrorFunction · 0.70

Tested by

no test coverage detected