Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce CoreServices to decouple backend from QWidgets #3446

Merged
merged 11 commits into from
Dec 14, 2020
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,7 @@ add_library(mixxx-lib STATIC EXCLUDE_FROM_ALL
src/mixer/previewdeck.cpp
src/mixer/sampler.cpp
src/mixer/samplerbank.cpp
src/coreservices.cpp
src/mixxx.cpp
src/mixxxapplication.cpp
src/musicbrainz/chromaprinter.cpp
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/dlgprefcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const QString kPresetExt(".midi.xml");
DlgPrefController::DlgPrefController(
QWidget* parent,
Controller* controller,
ControllerManager* controllerManager,
std::shared_ptr<ControllerManager> controllerManager,
UserSettingsPointer pConfig)
: DlgPreferencePage(parent),
m_pConfig(pConfig),
Expand Down Expand Up @@ -86,7 +86,7 @@ DlgPrefController::DlgPrefController(
// Connect our signals to controller manager.
connect(this,
&DlgPrefController::applyPreset,
m_pControllerManager,
m_pControllerManager.get(),
&ControllerManager::slotApplyPreset);

// Open script file links
Expand Down
12 changes: 7 additions & 5 deletions src/controllers/dlgprefcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@

#include <QHash>
#include <QSortFilterProxyModel>
#include <memory>

#include "controllers/controllerinputmappingtablemodel.h"
#include "controllers/controlleroutputmappingtablemodel.h"
#include "controllers/controllerpreset.h"
#include "controllers/controllerpresetinfo.h"
#include "controllers/dlgcontrollerlearning.h"
#include "controllers/ui_dlgprefcontrollerdlg.h"
#include "preferences/usersettings.h"
#include "preferences/dlgpreferencepage.h"
#include "preferences/usersettings.h"

// Forward declarations
class Controller;
Expand All @@ -21,9 +22,10 @@ class PresetInfoEnumerator;
class DlgPrefController : public DlgPreferencePage {
Q_OBJECT
public:
DlgPrefController(QWidget *parent, Controller* controller,
ControllerManager* controllerManager,
UserSettingsPointer pConfig);
DlgPrefController(QWidget* parent,
Controller* controller,
std::shared_ptr<ControllerManager> controllerManager,
UserSettingsPointer pConfig);
virtual ~DlgPrefController();

QUrl helpUrl() const override;
Expand Down Expand Up @@ -106,7 +108,7 @@ class DlgPrefController : public DlgPreferencePage {
Ui::DlgPrefControllerDlg m_ui;
UserSettingsPointer m_pConfig;
const QString m_pUserDir;
ControllerManager* m_pControllerManager;
std::shared_ptr<ControllerManager> m_pControllerManager;
Controller* m_pController;
DlgControllerLearning* m_pDlgControllerLearning;
ControllerPresetPointer m_pPreset;
Expand Down
8 changes: 4 additions & 4 deletions src/controllers/dlgprefcontrollers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
#include "preferences/dialog/dlgpreferences.h"

DlgPrefControllers::DlgPrefControllers(DlgPreferences* pPreferences,
UserSettingsPointer pConfig,
ControllerManager* pControllerManager,
QTreeWidgetItem* pControllerTreeItem)
UserSettingsPointer pConfig,
std::shared_ptr<ControllerManager> pControllerManager,
QTreeWidgetItem* pControllerTreeItem)
: DlgPreferencePage(pPreferences),
m_pDlgPreferences(pPreferences),
m_pConfig(pConfig),
Expand All @@ -27,7 +27,7 @@ DlgPrefControllers::DlgPrefControllers(DlgPreferences* pPreferences,
});

// Connections
connect(m_pControllerManager,
connect(m_pControllerManager.get(),
&ControllerManager::devicesChanged,
this,
&DlgPrefControllers::rescanControllers);
Expand Down
11 changes: 6 additions & 5 deletions src/controllers/dlgprefcontrollers.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#pragma once

#include <QTreeWidgetItem>
#include <memory>

#include "preferences/usersettings.h"
#include "controllers/ui_dlgprefcontrollersdlg.h"
#include "preferences/dlgpreferencepage.h"
#include "preferences/usersettings.h"

class DlgPreferences;
class DlgPrefController;
Expand All @@ -18,9 +19,9 @@ class DlgPrefControllers : public DlgPreferencePage, public Ui::DlgPrefControlle
Q_OBJECT
public:
DlgPrefControllers(DlgPreferences* pDlgPreferences,
UserSettingsPointer pConfig,
ControllerManager* pControllerManager,
QTreeWidgetItem* pControllerTreeItem);
UserSettingsPointer pConfig,
std::shared_ptr<ControllerManager> pControllerManager,
QTreeWidgetItem* pControllerTreeItem);
virtual ~DlgPrefControllers();

bool handleTreeItemClick(QTreeWidgetItem* clickedItem);
Expand All @@ -47,7 +48,7 @@ class DlgPrefControllers : public DlgPreferencePage, public Ui::DlgPrefControlle

DlgPreferences* m_pDlgPreferences;
UserSettingsPointer m_pConfig;
ControllerManager* m_pControllerManager;
std::shared_ptr<ControllerManager> m_pControllerManager;
QTreeWidgetItem* m_pControllerTreeItem;
QList<DlgPrefController*> m_controllerWindows;
QList<QTreeWidgetItem*> m_controllerTreeItems;
Expand Down
Loading