Reorder publish settings checks to group messages by settings pane

This commit is contained in:
palana 2014-03-07 22:26:45 +01:00
parent 359ee4fde1
commit f9ccde2dbf

View File

@ -275,14 +275,17 @@ void SettingsPublish::SetWarningInfo()
} }
} }
if (r->HasItem(TEXT("profile"))) if (r->HasItem(L"supported audio codec"))
{ {
String expectedProfile = r->GetString(TEXT("profile")); StringList codecs;
r->GetStringList(L"supported audio codec", codecs);
if (!expectedProfile.CompareI(currentx264Profile)) if (codecs.FindValueIndex(currentAudioCodec) == INVALID)
{ {
errors++; String msg = Str("Settings.Publish.Warning.UnsupportedAudioCodec"); //good thing OBS only supports MP3 (and AAC), otherwise I'd have to come up with a better translation solution
strWarnings << Str("Settings.Publish.Warning.RecommendMainProfile"); msg.FindReplace(L"$1", codecs[0].Array());
msg.FindReplace(L"$2", currentAudioCodec.Array());
errors += 1;
strWarnings << msg;
} }
} }
@ -306,16 +309,6 @@ void SettingsPublish::SetWarningInfo()
} }
} }
if (r->HasItem(TEXT("keyint")))
{
int keyint = r->GetInt(TEXT("keyint"));
if (!keyframeInt || keyframeInt * 1000 > keyint)
{
errors++;
strWarnings << FormattedString(Str("Settings.Publish.Warning.Keyint"), keyint / 1000);
}
}
if (r->HasItem(L"video aspect ratio")) if (r->HasItem(L"video aspect ratio"))
{ {
String aspectRatio = r->GetString(L"video aspect ratio"); String aspectRatio = r->GetString(L"video aspect ratio");
@ -338,17 +331,24 @@ void SettingsPublish::SetWarningInfo()
} }
} }
if (r->HasItem(L"supported audio codec")) if (r->HasItem(TEXT("profile")))
{ {
StringList codecs; String expectedProfile = r->GetString(TEXT("profile"));
r->GetStringList(L"supported audio codec", codecs);
if (codecs.FindValueIndex(currentAudioCodec) == INVALID) if (!expectedProfile.CompareI(currentx264Profile))
{ {
String msg = Str("Settings.Publish.Warning.UnsupportedAudioCodec"); //good thing OBS only supports MP3 (and AAC), otherwise I'd have to come up with a better translation solution errors++;
msg.FindReplace(L"$1", codecs[0].Array()); strWarnings << Str("Settings.Publish.Warning.RecommendMainProfile");
msg.FindReplace(L"$2", currentAudioCodec.Array()); }
errors += 1; }
strWarnings << msg;
if (r->HasItem(TEXT("keyint")))
{
int keyint = r->GetInt(TEXT("keyint"));
if (!keyframeInt || keyframeInt * 1000 > keyint)
{
errors++;
strWarnings << FormattedString(Str("Settings.Publish.Warning.Keyint"), keyint / 1000);
} }
} }