mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
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
|
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
|
Colormap generated by using gen_wheel.py at
|
||||||
https://github.com/dofuuz/audacity-colormap
|
https://github.com/dofuuz/audacity-colormap
|
||||||
|
|
||||||
|
@ -75,6 +75,7 @@ list( APPEND SOURCES
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
AColor.cpp
|
AColor.cpp
|
||||||
AColor.h
|
AColor.h
|
||||||
|
AColorResources.h
|
||||||
ActiveProjects.cpp
|
ActiveProjects.cpp
|
||||||
ActiveProjects.h
|
ActiveProjects.h
|
||||||
AboutDialog.cpp
|
AboutDialog.cpp
|
||||||
|
@ -16,6 +16,7 @@ Paul Licameli
|
|||||||
|
|
||||||
#include "SpectrogramSettings.h"
|
#include "SpectrogramSettings.h"
|
||||||
|
|
||||||
|
#include "../AColor.h"
|
||||||
#include "../NumberScale.h"
|
#include "../NumberScale.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
@ -160,14 +161,18 @@ const EnumValueSymbols &SpectrogramSettings::GetColorSchemeNames()
|
|||||||
static const EnumValueSymbols result{
|
static const EnumValueSymbols result{
|
||||||
// Keep in correspondence with enum SpectrogramSettings::ColorScheme:
|
// Keep in correspondence with enum SpectrogramSettings::ColorScheme:
|
||||||
/* i18n-hint: New color scheme for spectrograms */
|
/* i18n-hint: New color scheme for spectrograms */
|
||||||
XO("Color (New)") ,
|
{ wxT("SpecColorNew"), XO("Color (New)") },
|
||||||
/* i18n-hint: color scheme from theme for spectrograms */
|
/* 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 */
|
/* i18n-hint: grayscale color scheme for spectrograms */
|
||||||
XO("Grayscale") ,
|
{ wxT("SpecGrayscale"), XO("Grayscale") },
|
||||||
/* i18n-hint: inverse grayscale color scheme for spectrograms */
|
/* 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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ public:
|
|||||||
|
|
||||||
typedef int ColorScheme;
|
typedef int ColorScheme;
|
||||||
enum ColorSchemeValues : int {
|
enum ColorSchemeValues : int {
|
||||||
// Keep in correspondence with AColor::gradient_pre
|
// Keep in correspondence with AColor::colorSchemes, AColor::gradient_pre
|
||||||
csColorNew = 0,
|
csColorNew = 0,
|
||||||
csColorTheme,
|
csColorTheme,
|
||||||
csGrayscale,
|
csGrayscale,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user