Some more cleanup for new spectrogram color scheme
- Add some assertion - Define spectrogram color scheme name using the two-argument constructor. (i18n)
This commit is contained in:
parent
474f05d414
commit
e135bcf16f
|
@ -2,8 +2,9 @@
|
|||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
AColorResources.h
|
||||
|
||||
@file AColorResources.h
|
||||
@brief RGB data of 'Color (New)' spectrogram color scheme
|
||||
|
||||
Colormap generated by using gen_wheel.py at
|
||||
https://github.com/dofuuz/audacity-colormap
|
||||
|
||||
|
|
|
@ -75,6 +75,7 @@ list( APPEND SOURCES
|
|||
PRIVATE
|
||||
AColor.cpp
|
||||
AColor.h
|
||||
AColorResources.h
|
||||
ActiveProjects.cpp
|
||||
ActiveProjects.h
|
||||
AboutDialog.cpp
|
||||
|
|
|
@ -16,6 +16,7 @@ Paul Licameli
|
|||
|
||||
#include "SpectrogramSettings.h"
|
||||
|
||||
#include "../AColor.h"
|
||||
#include "../NumberScale.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
@ -160,14 +161,18 @@ const EnumValueSymbols &SpectrogramSettings::GetColorSchemeNames()
|
|||
static const EnumValueSymbols result{
|
||||
// Keep in correspondence with enum SpectrogramSettings::ColorScheme:
|
||||
/* i18n-hint: New color scheme for spectrograms */
|
||||
XO("Color (New)") ,
|
||||
{ wxT("SpecColorNew"), XO("Color (New)") },
|
||||
/* i18n-hint: color scheme from theme for spectrograms */
|
||||
XO("Color (from Theme)") ,
|
||||
{ wxT("SpecColorTheme"), XO("Color (from Theme)") },
|
||||
/* i18n-hint: grayscale color scheme for spectrograms */
|
||||
XO("Grayscale") ,
|
||||
{ wxT("SpecGrayscale"), XO("Grayscale") },
|
||||
/* i18n-hint: inverse grayscale color scheme for spectrograms */
|
||||
XO("Inv. Grayscale") ,
|
||||
{ wxT("SpecInvGrayscale"), XO("Inv. Grayscale") },
|
||||
};
|
||||
|
||||
wxASSERT(csNumColorScheme == result.size());
|
||||
static_assert(csNumColorScheme == AColor::colorSchemes, "Broken correspondence");
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -131,7 +131,7 @@ public:
|
|||
|
||||
typedef int ColorScheme;
|
||||
enum ColorSchemeValues : int {
|
||||
// Keep in correspondence with AColor::gradient_pre
|
||||
// Keep in correspondence with AColor::colorSchemes, AColor::gradient_pre
|
||||
csColorNew = 0,
|
||||
csColorTheme,
|
||||
csGrayscale,
|
||||
|
|
Loading…
Reference in New Issue