MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / buildAvailableActions

Method buildAvailableActions

src/interface/TrayIcon.cpp:257–333  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

255}
256
257QMenu* TrayIcon::buildAvailableActions()
258{
259 QAction *reloadAction = new QAction(tr("&Reload JamesDSP"), this);
260 reloadAction->setProperty("tag", "reload");
261 connect(reloadAction, &QAction::triggered, this, &TrayIcon::restart);
262
263 QAction *quitAction = new QAction(tr("&Quit"), this);
264 connect(quitAction, &QAction::triggered, qApp, &QCoreApplication::quit);
265 quitAction->setProperty("tag", "quit");
266
267 QAction *showWindowAction = new QAction(tr("&Show/hide window"), this);
268 connect(showWindowAction, &QAction::triggered, this, &TrayIcon::iconActivated);
269 showWindowAction->setProperty("tag", "show");
270
271 QMenu *reverbMenu = new QMenu(tr("Re&verberation presets"));
272
273 QAction *reverbOff = new QAction(tr("Off"));
274 connect(reverbOff, &QAction::triggered, this, [this]() {
275 emit loadReverbPreset("off");
276 });
277 reverbMenu->addAction(reverbOff);
278 for (const auto& preset : PresetProvider::Reverb::getPresetNames())
279 {
280 QAction *newEntry = new QAction(preset);
281 connect(newEntry, &QAction::triggered, this, [this, preset]() {
282 emit loadReverbPreset(preset);
283 });
284 reverbMenu->addAction(newEntry);
285 }
286
287 reverbMenu->setProperty("tag", "menu_reverb_preset");
288
289 QMenu *eqMenu = new QMenu(tr("&Equalizer presets"), menuOwner);
290
291 for (const auto& preset : PresetProvider::EQ::EQ_LOOKUP_TABLE().keys())
292 {
293 QAction *newEntry = new QAction(preset);
294 connect(newEntry, &QAction::triggered, this, [this, preset]() {
295 emit loadEqPreset(preset);
296 });
297 eqMenu->addAction(newEntry);
298 }
299
300 eqMenu->setProperty("tag", "menu_eq_preset");
301
302 QMenu *bs2bMenu = new QMenu(tr("&Crossfeed"), menuOwner);
303 QAction *bs2bOff = new QAction("Off");
304 connect(bs2bOff, &QAction::triggered, this, [this]() {
305 emit loadCrossfeedPreset(-1);
306 });
307 bs2bMenu->addAction(bs2bOff);
308
309 for (const auto& preset : PresetProvider::BS2B::BS2B_LOOKUP_TABLE().toStdMap())
310 {
311 QAction *newEntry = new QAction(preset.first);
312 connect(newEntry, &QAction::triggered, this, [this, preset]() {
313 emit loadCrossfeedPreset(preset.second);
314 });

Callers 1

Calls 1

connectFunction · 0.85

Tested by

no test coverage detected