mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:43:50 +02:00
Moved Menu dependency out of audio
This commit is contained in:
parent
71b565c33c
commit
dbdb87a1a2
4 changed files with 9 additions and 11 deletions
|
@ -296,6 +296,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
|
|||
auto audioIO = DependencyManager::get<Audio>();
|
||||
audioIO->moveToThread(audioThread);
|
||||
connect(audioThread, &QThread::started, audioIO.data(), &Audio::start);
|
||||
connect(audioIO, SIGNAL(muteToggled()), this, SLOT(audioMuteToggled()));
|
||||
|
||||
audioThread->start();
|
||||
|
||||
|
@ -693,6 +694,12 @@ void Application::runTests() {
|
|||
runTimingTests();
|
||||
}
|
||||
|
||||
void Application::audioMuteToggled() {
|
||||
QAction* muteAction = Menu::getInstance()->getActionForOption(MenuOption::MuteAudio);
|
||||
Q_CHECK_PTR(muteAction);
|
||||
muteAction->setChecked(DependencyManager::get<Audio>()->isMuted());
|
||||
}
|
||||
|
||||
void Application::aboutApp() {
|
||||
InfoView::forcedShow(INFO_HELP_PATH);
|
||||
}
|
||||
|
|
|
@ -395,6 +395,8 @@ private slots:
|
|||
void manageRunningScriptsWidgetVisibility(bool shown);
|
||||
|
||||
void runTests();
|
||||
|
||||
void audioMuteToggled();
|
||||
|
||||
private:
|
||||
void resetCamerasOnResizeGL(Camera& camera, int width, int height);
|
||||
|
|
|
@ -104,18 +104,10 @@ Audio::Audio() :
|
|||
|
||||
connect(&_receivedAudioStream, &MixedProcessedAudioStream::processSamples, this, &Audio::processReceivedSamples, Qt::DirectConnection);
|
||||
|
||||
connect(this, SIGNAL(muteToggled()), this, SLOT(audioMuteToggled()));
|
||||
|
||||
// Initialize GVerb
|
||||
initGverb();
|
||||
}
|
||||
|
||||
void Audio::audioMuteToggled() {
|
||||
QAction* muteAction = Menu::getInstance()->getActionForOption(MenuOption::MuteAudio);
|
||||
Q_CHECK_PTR(muteAction);
|
||||
muteAction->setChecked(isMuted());
|
||||
}
|
||||
|
||||
void Audio::reset() {
|
||||
_receivedAudioStream.reset();
|
||||
_stats.reset();
|
||||
|
|
|
@ -176,9 +176,6 @@ public slots:
|
|||
void loadSettings();
|
||||
void saveSettings();
|
||||
|
||||
private slots:
|
||||
void audioMuteToggled();
|
||||
|
||||
signals:
|
||||
bool muteToggled();
|
||||
void inputReceived(const QByteArray& inputSamples);
|
||||
|
|
Loading…
Reference in a new issue