UI: Sort audio controls by source name

Audio controls in OBS Mixer and Advanced Audio Properties window are not
sorted at all.  Every time OBS is restarted they get shuffled (Jim note:
This is due to json object hashing).  The order of these controls is
additionally not consistent between the mixer and the advanced audio
properties window.

Closes obsproject/obs-studio#1242
This commit is contained in:
Igor Bochkariov
2018-03-18 19:29:13 +04:00
committed by jp9000
parent 904ad9be1d
commit 61839d8c94
6 changed files with 46 additions and 18 deletions

View File

@@ -6,6 +6,7 @@
#include <QLabel>
#include "window-basic-adv-audio.hpp"
#include "window-basic-main.hpp"
#include "item-widget-helpers.hpp"
#include "adv-audio-control.hpp"
#include "obs-app.hpp"
#include "qt-wrappers.hpp"
@@ -133,7 +134,12 @@ void OBSBasicAdvAudio::OBSSourceRemoved(void *param, calldata_t *calldata)
inline void OBSBasicAdvAudio::AddAudioSource(obs_source_t *source)
{
OBSAdvAudioCtrl *control = new OBSAdvAudioCtrl(mainLayout, source);
controls.push_back(control);
InsertQObjectByName(controls, control);
for (auto control : controls) {
control->ShowAudioControl(mainLayout);
}
}
void OBSBasicAdvAudio::SourceAdded(OBSSource source)