forked from mia/Aegisub
Rename the audio rendering style enum values to reflect how they're actually used
Originally committed to SVN as r6483.
This commit is contained in:
parent
57b6a1f03a
commit
72ee3efdc3
8 changed files with 16 additions and 15 deletions
|
@ -57,8 +57,8 @@ AudioColorScheme::AudioColorScheme(int prec, std::string const& scheme_name, int
|
||||||
{
|
{
|
||||||
case AudioStyle_Normal: opt_base += "Normal/"; break;
|
case AudioStyle_Normal: opt_base += "Normal/"; break;
|
||||||
case AudioStyle_Inactive: opt_base += "Inactive/"; break;
|
case AudioStyle_Inactive: opt_base += "Inactive/"; break;
|
||||||
case AudioStyle_Active: opt_base += "Active/"; break;
|
case AudioStyle_Selected: opt_base += "Active/"; break;
|
||||||
case AudioStyle_Selected: opt_base += "Selected/"; break;
|
case AudioStyle_Primary: opt_base += "Selected/"; break;
|
||||||
default: throw agi::InternalError("Unknown audio rendering styling", 0);
|
default: throw agi::InternalError("Unknown audio rendering styling", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ public:
|
||||||
|
|
||||||
AudioSpectrumRenderer::AudioSpectrumRenderer(std::string const& color_scheme_name)
|
AudioSpectrumRenderer::AudioSpectrumRenderer(std::string const& color_scheme_name)
|
||||||
: colors_normal(new AudioColorScheme(12, color_scheme_name, AudioStyle_Normal))
|
: colors_normal(new AudioColorScheme(12, color_scheme_name, AudioStyle_Normal))
|
||||||
, colors_selected(new AudioColorScheme(12, color_scheme_name, AudioStyle_Selected))
|
, colors_primary(new AudioColorScheme(12, color_scheme_name, AudioStyle_Primary))
|
||||||
, colors_inactive(new AudioColorScheme(12, color_scheme_name, AudioStyle_Inactive))
|
, colors_inactive(new AudioColorScheme(12, color_scheme_name, AudioStyle_Inactive))
|
||||||
, derivation_size(8)
|
, derivation_size(8)
|
||||||
, derivation_dist(8)
|
, derivation_dist(8)
|
||||||
|
@ -330,7 +330,7 @@ const AudioColorScheme *AudioSpectrumRenderer::GetColorScheme(AudioRenderingStyl
|
||||||
{
|
{
|
||||||
switch (style)
|
switch (style)
|
||||||
{
|
{
|
||||||
case AudioStyle_Selected: return colors_selected.get();
|
case AudioStyle_Primary: return colors_primary.get();
|
||||||
case AudioStyle_Inactive: return colors_inactive.get();
|
case AudioStyle_Inactive: return colors_inactive.get();
|
||||||
default: return colors_normal.get();
|
default: return colors_normal.get();
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ class AudioSpectrumRenderer : public AudioRendererBitmapProvider {
|
||||||
agi::scoped_ptr<AudioColorScheme> colors_normal;
|
agi::scoped_ptr<AudioColorScheme> colors_normal;
|
||||||
|
|
||||||
/// Colour table used for rendering the audio selection
|
/// Colour table used for rendering the audio selection
|
||||||
agi::scoped_ptr<AudioColorScheme> colors_selected;
|
agi::scoped_ptr<AudioColorScheme> colors_primary;
|
||||||
|
|
||||||
/// Colour table used for rendering inactive lines
|
/// Colour table used for rendering inactive lines
|
||||||
agi::scoped_ptr<AudioColorScheme> colors_inactive;
|
agi::scoped_ptr<AudioColorScheme> colors_inactive;
|
||||||
|
|
|
@ -60,7 +60,7 @@ enum {
|
||||||
|
|
||||||
AudioWaveformRenderer::AudioWaveformRenderer(std::string const& color_scheme_name)
|
AudioWaveformRenderer::AudioWaveformRenderer(std::string const& color_scheme_name)
|
||||||
: colors_normal(new AudioColorScheme(6, color_scheme_name, AudioStyle_Normal))
|
: colors_normal(new AudioColorScheme(6, color_scheme_name, AudioStyle_Normal))
|
||||||
, colors_selected(new AudioColorScheme(6, color_scheme_name, AudioStyle_Selected))
|
, colors_primary(new AudioColorScheme(6, color_scheme_name, AudioStyle_Primary))
|
||||||
, colors_inactive(new AudioColorScheme(6, color_scheme_name, AudioStyle_Inactive))
|
, colors_inactive(new AudioColorScheme(6, color_scheme_name, AudioStyle_Inactive))
|
||||||
, audio_buffer(0)
|
, audio_buffer(0)
|
||||||
, render_averages(OPT_GET("Audio/Display/Waveform Style")->GetInt() == Waveform_MaxAvg)
|
, render_averages(OPT_GET("Audio/Display/Waveform Style")->GetInt() == Waveform_MaxAvg)
|
||||||
|
@ -186,7 +186,7 @@ const AudioColorScheme *AudioWaveformRenderer::GetColorScheme(AudioRenderingStyl
|
||||||
{
|
{
|
||||||
switch (style)
|
switch (style)
|
||||||
{
|
{
|
||||||
case AudioStyle_Selected: return colors_selected.get();
|
case AudioStyle_Primary: return colors_primary.get();
|
||||||
case AudioStyle_Inactive: return colors_inactive.get();
|
case AudioStyle_Inactive: return colors_inactive.get();
|
||||||
default: return colors_normal.get();
|
default: return colors_normal.get();
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ class AudioWaveformRenderer : public AudioRendererBitmapProvider {
|
||||||
agi::scoped_ptr<AudioColorScheme> colors_normal;
|
agi::scoped_ptr<AudioColorScheme> colors_normal;
|
||||||
|
|
||||||
/// Colour table used for rendering the audio selection
|
/// Colour table used for rendering the audio selection
|
||||||
agi::scoped_ptr<AudioColorScheme> colors_selected;
|
agi::scoped_ptr<AudioColorScheme> colors_primary;
|
||||||
|
|
||||||
/// Colour table used for rendering inactive lines
|
/// Colour table used for rendering inactive lines
|
||||||
agi::scoped_ptr<AudioColorScheme> colors_inactive;
|
agi::scoped_ptr<AudioColorScheme> colors_inactive;
|
||||||
|
|
|
@ -32,17 +32,18 @@
|
||||||
/// @brief Styles audio may be rendered in
|
/// @brief Styles audio may be rendered in
|
||||||
///
|
///
|
||||||
/// The constants are ordered by priority:
|
/// The constants are ordered by priority:
|
||||||
/// Selected has highest priority and should overlap active, which should
|
/// Primary has highest priority and should overlap selected, which should
|
||||||
/// overlap inactive, which should overlap normal regions.
|
/// overlap inactive, which should overlap normal regions.
|
||||||
enum AudioRenderingStyle {
|
enum AudioRenderingStyle {
|
||||||
/// Regular audio with no special properties
|
/// Regular audio with no special properties
|
||||||
AudioStyle_Normal,
|
AudioStyle_Normal,
|
||||||
/// Audio belonging to objects that can not be manipulated currently
|
/// Audio belonging to objects that are not part of the current selection
|
||||||
AudioStyle_Inactive,
|
AudioStyle_Inactive,
|
||||||
/// Audio that may be manipulated indirectly, usually part of selected lines
|
/// Audio belonging to objects that are part of the current selection,
|
||||||
AudioStyle_Active,
|
/// but not the primary work rage
|
||||||
/// Primary selection for work, usually coinciding with the primary playback range
|
|
||||||
AudioStyle_Selected,
|
AudioStyle_Selected,
|
||||||
|
/// Primary selection for work, usually coinciding with the primary playback range
|
||||||
|
AudioStyle_Primary,
|
||||||
/// Number of audio styles
|
/// Number of audio styles
|
||||||
AudioStyle_MAX
|
AudioStyle_MAX
|
||||||
};
|
};
|
||||||
|
|
|
@ -393,7 +393,7 @@ AudioTimingControllerDialogue::AudioTimingControllerDialogue(agi::Context *c)
|
||||||
: style_left("Colour/Audio Display/Line boundary Start", "Audio/Line Boundaries Thickness")
|
: style_left("Colour/Audio Display/Line boundary Start", "Audio/Line Boundaries Thickness")
|
||||||
, style_right("Colour/Audio Display/Line boundary End", "Audio/Line Boundaries Thickness")
|
, style_right("Colour/Audio Display/Line boundary End", "Audio/Line Boundaries Thickness")
|
||||||
, style_inactive("Colour/Audio Display/Line Boundary Inactive Line", "Audio/Line Boundaries Thickness")
|
, style_inactive("Colour/Audio Display/Line Boundary Inactive Line", "Audio/Line Boundaries Thickness")
|
||||||
, active_line(AudioStyle_Selected, &style_left, &style_right)
|
, active_line(AudioStyle_Primary, &style_left, &style_right)
|
||||||
, keyframes_provider(c, "Audio/Display/Draw/Keyframes in Dialogue Mode")
|
, keyframes_provider(c, "Audio/Display/Draw/Keyframes in Dialogue Mode")
|
||||||
, video_position_provider(c)
|
, video_position_provider(c)
|
||||||
, commit_id(-1)
|
, commit_id(-1)
|
||||||
|
|
|
@ -213,7 +213,7 @@ void AudioTimingControllerKaraoke::Prev() {
|
||||||
void AudioTimingControllerKaraoke::GetRenderingStyles(AudioRenderingStyleRanges &ranges) const
|
void AudioTimingControllerKaraoke::GetRenderingStyles(AudioRenderingStyleRanges &ranges) const
|
||||||
{
|
{
|
||||||
TimeRange sr = GetPrimaryPlaybackRange();
|
TimeRange sr = GetPrimaryPlaybackRange();
|
||||||
ranges.AddRange(sr.begin(), sr.end(), AudioStyle_Selected);
|
ranges.AddRange(sr.begin(), sr.end(), AudioStyle_Primary);
|
||||||
}
|
}
|
||||||
|
|
||||||
TimeRange AudioTimingControllerKaraoke::GetPrimaryPlaybackRange() const {
|
TimeRange AudioTimingControllerKaraoke::GetPrimaryPlaybackRange() const {
|
||||||
|
|
Loading…
Reference in a new issue