mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-01-22 05:08:37 -05:00
UI: Correctly toggle audio multi-track buttons
This toggles audio multi track display in Output settings when: 1. When there is a signal that a stream service is changed to a non custom one. Indeed multi-track audio is only available with Custom service and only with SRT or RIST protocols. 2. When a Custom service is picked, and SRT or RIST are detected in the server URL. 3. When Stream settings are saved when one hits Apply. This is in addition to the toggling done when loading Stream Settings. Signed-off-by: pkv <pkv@obsproject.com>
This commit is contained in:
@@ -2057,16 +2057,6 @@ static inline QString makeFormatToolTip()
|
||||
return html;
|
||||
}
|
||||
|
||||
#define RTMP_PROTOCOL "rtmp"
|
||||
#define SRT_PROTOCOL "srt"
|
||||
#define RIST_PROTOCOL "rist"
|
||||
|
||||
inline bool allowsMultiTrack(const char *protocol)
|
||||
{
|
||||
return astrcmpi_n(protocol, SRT_PROTOCOL, strlen(SRT_PROTOCOL)) == 0 ||
|
||||
astrcmpi_n(protocol, RIST_PROTOCOL, strlen(RIST_PROTOCOL)) == 0;
|
||||
}
|
||||
|
||||
void OBSBasicSettings::LoadAdvOutputStreamingSettings()
|
||||
{
|
||||
const char *rescaleRes =
|
||||
@@ -2118,21 +2108,10 @@ void OBSBasicSettings::LoadAdvOutputStreamingSettings()
|
||||
ui->advOutMultiTrack5->setChecked(audioMixes & (1 << 4));
|
||||
ui->advOutMultiTrack6->setChecked(audioMixes & (1 << 5));
|
||||
|
||||
bool is_multitrack_output = false;
|
||||
obs_service_t *service_obj = main->GetService();
|
||||
const char *protocol = nullptr;
|
||||
protocol = obs_service_get_protocol(service_obj);
|
||||
if (protocol) {
|
||||
is_multitrack_output = allowsMultiTrack(protocol);
|
||||
}
|
||||
|
||||
if (is_multitrack_output) {
|
||||
ui->advStreamTrackWidget->setCurrentWidget(
|
||||
ui->streamMultiTracks);
|
||||
} else {
|
||||
ui->advStreamTrackWidget->setCurrentWidget(
|
||||
ui->streamSingleTracks);
|
||||
}
|
||||
SwapMultiTrack(protocol);
|
||||
}
|
||||
|
||||
OBSPropertiesView *
|
||||
|
||||
Reference in New Issue
Block a user