Make audio color schemes selectable in the preferences dialog

Originally committed to SVN as r5950.
This commit is contained in:
Thomas Goyne 2011-11-30 21:04:28 +00:00
parent 1a4d116617
commit fa15f0800e
2 changed files with 15 additions and 6 deletions

View File

@ -31,6 +31,10 @@
},
"Type" : 1
},
"Colour Schemes" : [
{ "string" : "Green" },
{ "string" : "Icy Blue" }
],
"Display Height" : 200,
"Display" : {
"Draw" : {

View File

@ -58,6 +58,12 @@
#include "audio_player_portaudio.h"
#endif
static wxArrayString vec_to_arrstr(std::vector<std::string> const& vec) {
wxArrayString arrstr;
std::copy(vec.begin(), vec.end(), std::back_inserter(arrstr));
return arrstr;
}
#define CLASS_PAGE(name) \
class name: public OptionPage { \
public: \
@ -162,6 +168,11 @@ Audio::Audio(wxTreebook *book, Preferences *parent): OptionPage(book, parent, _(
OptionAdd(display, _("Karaoke keyframes"), "Audio/Display/Draw/Keyframes in Karaoke Mode");
OptionAdd(display, _("Video position"), "Audio/Display/Draw/Video Position");
wxFlexGridSizer *color = PageSizer(_("Color Schemes"));
wxArrayString schemes = vec_to_arrstr(OPT_GET("Audio/Colour Schemes")->GetListString());
OptionChoice(color, _("Spectrum"), schemes, "Colour/Audio Display/Spectrum");
OptionChoice(color, _("Waveform"), schemes, "Colour/Audio Display/Waveform");
SetSizerAndFit(sizer);
}
@ -432,12 +443,6 @@ Advanced_Interface::Advanced_Interface(wxTreebook *book, Preferences *parent): O
SetSizerAndFit(sizer);
}
static wxArrayString vec_to_arrstr(std::vector<std::string> const& vec) {
wxArrayString arrstr;
std::copy(vec.begin(), vec.end(), std::back_inserter(arrstr));
return arrstr;
}
/// Advanced Audio preferences subpage
Advanced_Audio::Advanced_Audio(wxTreebook *book, Preferences *parent): OptionPage(book, parent, _("Audio"), PAGE_SUB) {
wxFlexGridSizer *expert = PageSizer(_("Expert"));