| 42 | using namespace std; |
| 43 | |
| 44 | MainWindow::MainWindow(IAudioService* audioService, |
| 45 | bool statupInTray, |
| 46 | QWidget *parent) : |
| 47 | QMainWindow(parent), |
| 48 | ui(new Ui::MainWindow), |
| 49 | _audioService(audioService) |
| 50 | { |
| 51 | ui->setupUi(this); |
| 52 | |
| 53 | |
| 54 | |
| 55 | // Allocate resources |
| 56 | { |
| 57 | _startupInTraySwitch = statupInTray; |
| 58 | |
| 59 | _styleHelper = new StyleHelper(this); |
| 60 | _eelEditor = new EELEditor(this); |
| 61 | _trayIcon = new TrayIcon(this); |
| 62 | _autostart = new AutostartManager(this); |
| 63 | |
| 64 | _appMgrFragment = new FragmentHost<AppManagerFragment*>(new AppManagerFragment(_audioService->appManager(), this), WAF::BottomSide, this); |
| 65 | _statusFragment = new FragmentHost<StatusFragment*>(new StatusFragment(this), WAF::BottomSide, this); |
| 66 | _presetFragment = new FragmentHost<PresetFragment*>(new PresetFragment(_audioService, this), WAF::LeftSide, this); |
| 67 | _settingsFragment = new FragmentHost<SettingsFragment*>(new SettingsFragment(_trayIcon, _audioService, _autostart, this), WAF::BottomSide, this); |
| 68 | } |
| 69 | |
| 70 | // Prepare base UI |
| 71 | { |
| 72 | Log::information("============ Initializing user interface ============"); |
| 73 | |
| 74 | this->setWindowIcon(QIcon::fromTheme("jamesdsp", QIcon(":/icons/icon.png"))); |
| 75 | |
| 76 | // Restore window size and position |
| 77 | const QByteArray geometry = AppConfig::instance().get<QByteArray>(AppConfig::LastWindowGeometry); |
| 78 | if (!geometry.isEmpty()) |
| 79 | { |
| 80 | restoreGeometry(geometry); |
| 81 | } |
| 82 | |
| 83 | // Equalizer |
| 84 | QButtonGroup eq_mode; |
| 85 | eq_mode.addButton(ui->eq_r_fixed); |
| 86 | eq_mode.addButton(ui->eq_r_flex); |
| 87 | ui->eq_widget->setBands(PresetProvider::EQ::defaultPreset(), false); |
| 88 | ui->eq_dyn_widget->setSidebarHidden(true); |
| 89 | ui->eq_dyn_widget->set15BandFreeMode(true); |
| 90 | |
| 91 | ConfigContainer pref; |
| 92 | pref.setValue("scrollX", 160); |
| 93 | pref.setValue("scrollY", 311); |
| 94 | pref.setValue("zoomX", 0.561); |
| 95 | pref.setValue("zoomY", 1.651); |
| 96 | ui->eq_dyn_widget->loadPreferences(pref.getConfigMap()); |
| 97 | |
| 98 | // GraphicEQ |
| 99 | ui->graphicEq->setEnableSwitchVisible(true); |
| 100 | ui->graphicEq->setAutoEqAvailable(true); |
| 101 | } |
nothing calls this directly
no test coverage detected