void AudioSetupWizard::slotNext(void) { if (m_testThread) { toggleSpeakers(); } save(); MythScreenStack *mainStack = GetMythMainWindow()->GetMainStack(); VideoSetupWizard *sw = new VideoSetupWizard(mainStack, m_generalScreen, this, "videosetupwizard"); if (sw->Create()) { mainStack->AddScreen(sw); } else delete sw; }
bool AudioSetupWizard::Create() { bool foundtheme = false; // Load the theme for this screen foundtheme = LoadWindowFromXML("config-ui.xml", "audiowizard", this); if (!foundtheme) return false; m_audioDeviceButtonList = dynamic_cast<MythUIButtonList *> (GetChild("audiodevices")); m_speakerNumberButtonList = dynamic_cast<MythUIButtonList *> (GetChild("speakers")); m_dtsCheck = dynamic_cast<MythUICheckBox *> (GetChild("dtscheck")); m_ac3Check = dynamic_cast<MythUICheckBox *> (GetChild("ac3check")); m_eac3Check = dynamic_cast<MythUICheckBox *> (GetChild("eac3check")); m_truehdCheck = dynamic_cast<MythUICheckBox *> (GetChild("truehdcheck")); m_dtshdCheck = dynamic_cast<MythUICheckBox *> (GetChild("dtshdcheck")); m_testSpeakerButton = dynamic_cast<MythUIButton *> (GetChild("testspeakers")); m_nextButton = dynamic_cast<MythUIButton *> (GetChild("next")); m_prevButton = dynamic_cast<MythUIButton *> (GetChild("previous")); if (!m_audioDeviceButtonList || !m_speakerNumberButtonList || !m_dtsCheck || !m_ac3Check || !m_eac3Check || !m_truehdCheck || !m_dtshdCheck || !m_testSpeakerButton || !m_nextButton || !m_prevButton) { LOG(VB_GENERAL, LOG_ERR, "Theme is missing critical theme elements."); return false; } // Pre-set the widgets to their database values // Buttonlists are set in load() int dtsSetting = gCoreContext->GetNumSetting("DTSPassThru", 0); if (dtsSetting == 1) m_dtsCheck->SetCheckState(MythUIStateType::Full); int ac3Setting = gCoreContext->GetNumSetting("AC3PassThru", 0); if (ac3Setting == 1) m_ac3Check->SetCheckState(MythUIStateType::Full); int eac3Setting = gCoreContext->GetNumSetting("EAC3PassThru", 0); if (eac3Setting == 1) m_eac3Check->SetCheckState(MythUIStateType::Full); int truehdSetting = gCoreContext->GetNumSetting("TrueHDPassThru", 0); if (truehdSetting == 1) m_truehdCheck->SetCheckState(MythUIStateType::Full); int dtshdSetting = gCoreContext->GetNumSetting("DTSHDPassThru", 0); if (dtshdSetting == 1) m_dtshdCheck->SetCheckState(MythUIStateType::Full); // Help Text // Buttonlists m_audioDeviceButtonList->SetHelpText( tr("Select from one of the " "audio devices detected on your system. When " "satisfied, you can test audio before moving " "on. If you fail to configure audio, video " "playback may fail as well.") ); m_speakerNumberButtonList->SetHelpText( tr("Select the number of speakers you " "have.") ); // Checkboxes m_dtsCheck->SetHelpText( tr("Select this checkbox if your receiver " "is capable of playing DTS.") ); m_ac3Check->SetHelpText( tr("Select this checkbox if your receiver " "is capable of playing AC-3 (Dolby Digital).") ); m_eac3Check->SetHelpText( tr("Select this checkbox if your receiver " "is capable of playing E-AC-3 (Dolby Digital Plus).") ); m_truehdCheck->SetHelpText( tr("Select this checkbox if your receiver " "is capable of playing TrueHD.") ); m_dtshdCheck->SetHelpText( tr("Select this checkbox if your receiver " "is capable of playing DTS-HD.") ); // Buttons m_testSpeakerButton->SetHelpText( tr("Test your audio settings by playing " "noise through each speaker.") ); m_nextButton->SetHelpText( tr("Save these changes and move on to the next " "configuration step.") ); m_prevButton->SetHelpText( tr("Return to the previous configuration step.") ); // I hate to SetText but it's the only way to make it reliably bi-modal m_testSpeakerButton->SetText(tr("Test Speakers")); connect(m_testSpeakerButton, SIGNAL(Clicked()), this, SLOT(toggleSpeakers())); connect(m_nextButton, SIGNAL(Clicked()), this, SLOT(slotNext())); connect(m_prevButton, SIGNAL(Clicked()), this, SLOT(slotPrevious())); QString message = tr("Discovering audio devices..."); LoadInBackground(message); BuildFocusList(); return true; }