Skip to content

Commit bfdaccf

Browse files
committed
feat: add --relink to CLI options
1 parent ff82151 commit bfdaccf

File tree

10 files changed

+48
-40
lines changed

10 files changed

+48
-40
lines changed

src/MainWindow.cpp

Lines changed: 6 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ MainWindow::MainWindow(IAudioService* audioService,
5757
_startupInTraySwitch = statupInTray;
5858

5959
_styleHelper = new StyleHelper(this);
60-
_eelEditor = new EELEditor(this);
60+
// TODO _eelEditor = new EELEditor(this);
6161
_trayIcon = new TrayIcon(this);
6262
_autostart = new AutostartManager(this);
6363

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);
64+
// TODO _appMgrFragment = new FragmentHost<AppManagerFragment*>(new AppManagerFragment(_audioService->appManager(), this), WAF::BottomSide, this);
65+
// TODO _statusFragment = new FragmentHost<StatusFragment*>(new StatusFragment(this), WAF::BottomSide, this);
66+
// TODO _presetFragment = new FragmentHost<PresetFragment*>(new PresetFragment(_audioService, this), WAF::LeftSide, this);
67+
// TODO _settingsFragment = new FragmentHost<SettingsFragment*>(new SettingsFragment(_trayIcon, _audioService, _autostart, this), WAF::BottomSide, this);
6868
}
6969

7070
// Prepare base UI
@@ -116,27 +116,6 @@ MainWindow::MainWindow(IAudioService* audioService,
116116
ciArgs.channels = ciArgs.frames = -1;
117117
onConvolverInfoChanged(ciArgs);
118118
connect(_audioService, &IAudioService::convolverInfoChanged, this, &MainWindow::onConvolverInfoChanged);
119-
120-
_eelEditor->attachHost(_audioService);
121-
connect(_eelEditor, &EELEditor::executionRequested, [this](QString path){
122-
if (QFileInfo::exists(path) && QFileInfo(path).isFile())
123-
{
124-
ui->liveprog->setCurrentLiveprog(path);
125-
}
126-
else
127-
{
128-
QMessageBox::critical(_eelEditor, tr("Cannot execute script"),
129-
tr("The current EEL file (at '%1') does not exist anymore on the filesystem. Please reopen the file manually.").arg(path));
130-
return;
131-
}
132-
133-
applyConfig();
134-
135-
if(path == ui->liveprog->currentLiveprog())
136-
{
137-
_audioService->reloadLiveprog();
138-
}
139-
});
140119
}
141120

142121
// Prepare tray icon
@@ -220,9 +199,7 @@ MainWindow::MainWindow(IAudioService* audioService,
220199
connect(&DspConfig::instance(), &DspConfig::configBuffered, this, &MainWindow::loadConfig);
221200
DspConfig::instance().load();
222201

223-
connect(_settingsFragment->fragment(), &SettingsFragment::launchSetupWizard, this, &MainWindow::launchFirstRunSetup);
224-
connect(_settingsFragment->fragment(), &SettingsFragment::reopenSettings, _settingsFragment, &FragmentHost<SettingsFragment*>::slideOutIn);
225-
connect(_styleHelper, &StyleHelper::iconColorChanged, _settingsFragment->fragment(), &SettingsFragment::updateButtonStyle);
202+
//connect(_styleHelper, &StyleHelper::iconColorChanged, _settingsFragment->fragment(), &SettingsFragment::updateButtonStyle);
226203
}
227204

228205
// Init 3-dot menu button
@@ -264,8 +241,6 @@ MainWindow::MainWindow(IAudioService* audioService,
264241
menu->addAction(tr("Load from file"), this, SLOT(loadExternalFile()));
265242
menu->addAction(tr("Save to file"), this, SLOT(saveExternalFile()));
266243
menu->addSeparator();
267-
menu->addAction(tr("Open LiveprogIDE"), _eelEditor, &EELEditor::show);
268-
menu->addSeparator();
269244
menu->addAction(tr("What's this... (Select UI element)"), this, []()
270245
{
271246
QWhatsThis::enterWhatsThisMode();
@@ -329,8 +304,6 @@ MainWindow::MainWindow(IAudioService* audioService,
329304
connect(ui->conv_files, &FileSelectionWidget::bookmarkAdded, ui->conv_fav, &FileSelectionWidget::enumerateFiles);
330305

331306
// Liveprog
332-
ui->liveprog->coupleIDE(_eelEditor);
333-
ui->liveprog->updateList();
334307
connect(ui->liveprog, &LiveprogSelectionWidget::liveprogReloadRequested, _audioService, &IAudioService::reloadLiveprog);
335308
connect(ui->liveprog, &LiveprogSelectionWidget::unitLabelUpdateRequested, ui->info, qOverload<const QString&>(&FadingLabel::setAnimatedText));
336309
}
@@ -1333,8 +1306,6 @@ void MainWindow::connectActions()
13331306

13341307
connect(ui->eq_r_fixed, &QRadioButton::clicked, this, &MainWindow::onEqModeUpdated);
13351308
connect(ui->eq_r_flex, &QRadioButton::clicked, this, &MainWindow::onEqModeUpdated);
1336-
1337-
connect(_eelEditor, &EELEditor::scriptSaved, ui->liveprog, &LiveprogSelectionWidget::updateFromEelEditor);
13381309
}
13391310

13401311
// Setup wizard

src/utils/CliRemoteController.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,15 @@ bool CliRemoteController::showStatus() const
382382
return true;
383383
}
384384

385+
bool CliRemoteController::relinkAudioPipeline() const
386+
{
387+
if(!requireConnectionAndLog())
388+
return false;
389+
390+
service->relinkAudioPipeline();
391+
return true;
392+
}
393+
385394
// Helper to warn about failed connection
386395
bool CliRemoteController::checkConnectionAndLog() const
387396
{

src/utils/CliRemoteController.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class CliRemoteController : public QObject
3232
Q_INVOKABLE bool deletePresetRule(const QString& keyValue) const;
3333
Q_INVOKABLE bool listOutputDevices() const;
3434
Q_INVOKABLE bool showStatus() const;
35+
Q_INVOKABLE bool relinkAudioPipeline() const;
3536

3637
private:
3738
me::timschneeberger::jdsp4linux::Service* service = nullptr;
@@ -64,6 +65,8 @@ class CliRemoteController : public QObject
6465
OPT(_addPresetRule, ARGS("set-preset-rule", "Add/modify preset rule (Remote)", "deviceId[:routeId]=presetName"))
6566
OPT(_deletePresetRule, ARGS("delete-preset-rule", "Delete preset rule by device id and route id (Remote)", "deviceId[:routeId]"))
6667

68+
OPT(_relinkAudioPipeline, ARGS("relink", "Relink audio pipeline (Remote)"))
69+
6770
#undef ARGS
6871
#undef OPT
6972
};

src/utils/dbus/ClientProxy.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was generated by qdbusxml2cpp version 0.8
33
* Command line was: qdbusxml2cpp manifest.xml -i data/PresetRule.h --adaptor ServerAdaptor --proxy ClientProxy
44
*
5-
* qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
5+
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd.
66
*
77
* This is an auto-generated file.
88
* This file may have been hand-edited. Look for HAND-EDIT comments

src/utils/dbus/ClientProxy.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was generated by qdbusxml2cpp version 0.8
33
* Command line was: qdbusxml2cpp manifest.xml -i data/PresetRule.h --adaptor ServerAdaptor --proxy ClientProxy
44
*
5-
* qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
5+
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd.
66
*
77
* This is an auto-generated file.
88
* Do not edit! All changes made to it will be lost.
@@ -150,6 +150,12 @@ public Q_SLOTS: // METHODS
150150
return asyncCallWithArgumentList(QStringLiteral("loadPreset"), argumentList);
151151
}
152152

153+
inline QDBusPendingReply<> relinkAudioPipeline()
154+
{
155+
QList<QVariant> argumentList;
156+
return asyncCallWithArgumentList(QStringLiteral("relinkAudioPipeline"), argumentList);
157+
}
158+
153159
inline QDBusPendingReply<> savePreset(const QString &name)
154160
{
155161
QList<QVariant> argumentList;

src/utils/dbus/IpcHandler.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ QList<IOutputDevice> IpcHandler::getOutputDevices() const
164164
return QVector<IOutputDevice>(devices.begin(), devices.end()).toList();
165165
}
166166

167+
void IpcHandler::relinkAudioPipeline() const
168+
{
169+
_service->reloadService();
170+
DspConfig::instance().commit();
171+
}
172+
167173
void IpcHandler::setInternal(const QString &key, const QDBusVariant &value) const
168174
{
169175
QMetaEnum meta = QMetaEnum::fromType<DspConfig::Key>();

src/utils/dbus/IpcHandler.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ public slots:
5656
void deletePresetRule(const QString &deviceId, const QString &routeId) const;
5757
QList<PresetRule> getPresetRules() const;
5858

59-
QList<IOutputDevice> getOutputDevices() const;
59+
QList<IOutputDevice> getOutputDevices() const;
60+
61+
void relinkAudioPipeline() const;
6062

6163
private:
6264
QDBusConnection _connection = QDBusConnection::sessionBus();

src/utils/dbus/ServerAdaptor.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was generated by qdbusxml2cpp version 0.8
33
* Command line was: qdbusxml2cpp manifest.xml -i data/PresetRule.h --adaptor ServerAdaptor --proxy ClientProxy
44
*
5-
* qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
5+
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd.
66
*
77
* This is an auto-generated file.
88
* Do not edit! All changes made to it will be lost.
@@ -163,6 +163,12 @@ void ServiceAdaptor::loadPreset(const QString &name)
163163
QMetaObject::invokeMethod(parent(), "loadPreset", Q_ARG(QString, name));
164164
}
165165

166+
void ServiceAdaptor::relinkAudioPipeline()
167+
{
168+
// handle method call me.timschneeberger.jdsp4linux.Service.relinkAudioPipeline
169+
QMetaObject::invokeMethod(parent(), "relinkAudioPipeline");
170+
}
171+
166172
void ServiceAdaptor::savePreset(const QString &name)
167173
{
168174
// handle method call me.timschneeberger.jdsp4linux.Service.savePreset

src/utils/dbus/ServerAdaptor.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* This file was generated by qdbusxml2cpp version 0.8
33
* Command line was: qdbusxml2cpp manifest.xml -i data/PresetRule.h --adaptor ServerAdaptor --proxy ClientProxy
44
*
5-
* qdbusxml2cpp is Copyright (C) 2022 The Qt Company Ltd.
5+
* qdbusxml2cpp is Copyright (C) 2023 The Qt Company Ltd.
66
*
77
* This is an auto-generated file.
88
* This file may have been hand-edited. Look for HAND-EDIT comments
@@ -20,6 +20,7 @@ class QByteArray;
2020
template<class T> class QList;
2121
template<class Key, class Value> class QMap;
2222
class QString;
23+
class QStringList;
2324
class QVariant;
2425
QT_END_NAMESPACE
2526

@@ -110,6 +111,7 @@ class ServiceAdaptor: public QDBusAbstractAdaptor
110111
" <annotation value=\"QList&lt;IOutputDevice&gt;\" name=\"org.qtproject.QtDBus.QtTypeName.Out0\"/>\n"
111112
" <arg direction=\"out\" type=\"a(issss)\" name=\"devices\"/>\n"
112113
" </method>\n"
114+
" <method name=\"relinkAudioPipeline\"/>\n"
113115
" </interface>\n"
114116
"")
115117
public:
@@ -146,6 +148,7 @@ public Q_SLOTS: // METHODS
146148
QList<PresetRule> getPresetRules();
147149
QStringList getPresets();
148150
void loadPreset(const QString &name);
151+
void relinkAudioPipeline();
149152
void savePreset(const QString &name);
150153
void set(const QString &key, const QDBusVariant &value);
151154
void setAndCommit(const QString &key, const QDBusVariant &value);

src/utils/dbus/manifest.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@
7979
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QList&lt;IOutputDevice&gt;"/>
8080
<arg name="devices" type="a(issss)" direction="out"/>
8181
</method>
82+
83+
<method name="relinkAudioPipeline" />
8284
</interface>
8385
</node>
8486
</node>

0 commit comments

Comments
 (0)