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

Refactor MixxxMainWindow. #941

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion build/depends.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ def sources(self, build):
"controllers/keyboard/keyboardeventfilter.cpp",

"main.cpp",
"mixxx.cpp",
"coreservices.cpp",
"mixxxapplication.cpp",
"errordialoghandler.cpp",

Expand Down Expand Up @@ -950,6 +950,7 @@ def sources(self, build):
"widget/wcoverartmenu.cpp",
"widget/wsingletoncontainer.cpp",
"widget/wmainmenubar.cpp",
"widget/wmainwindow.cpp",

"musicbrainz/network.cpp",
"musicbrainz/tagfetcher.cpp",
Expand Down
4 changes: 2 additions & 2 deletions src/broadcast/broadcastmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace {
const mixxx::Logger kLogger("BroadcastManager");
}

BroadcastManager::BroadcastManager(SettingsManager* pSettingsManager,
SoundManager* pSoundManager)
BroadcastManager::BroadcastManager(std::shared_ptr<SettingsManager> pSettingsManager,
std::shared_ptr<SoundManager> pSoundManager)
: m_pConfig(pSettingsManager->settings()),
m_pBroadcastSettings(pSettingsManager->broadcastSettings()),
m_pNetworkStream(pSoundManager->getNetworkStream()) {
Expand Down
5 changes: 3 additions & 2 deletions src/broadcast/broadcastmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define BROADCAST_BROADCASTMANAGER_H

#include <QObject>
#include <QSharedPointer>

#include "preferences/settingsmanager.h"
#include "preferences/usersettings.h"
Expand All @@ -22,8 +23,8 @@ class BroadcastManager : public QObject {
STATUSCO_WARNING = 4
};

BroadcastManager(SettingsManager* pSettingsManager,
SoundManager* pSoundManager);
BroadcastManager(std::shared_ptr<SettingsManager> pSettingsManager,
std::shared_ptr<SoundManager> pSoundManager);
virtual ~BroadcastManager();

// Returns true if the broadcast connection is enabled. Note this only
Expand Down
10 changes: 4 additions & 6 deletions src/controllers/dlgprefcontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "util/version.h"

DlgPrefController::DlgPrefController(QWidget* parent, Controller* controller,
ControllerManager* controllerManager,
std::shared_ptr<ControllerManager> controllerManager,
UserSettingsPointer pConfig)
: DlgPreferencePage(parent),
m_pConfig(pConfig),
Expand Down Expand Up @@ -68,11 +68,11 @@ DlgPrefController::DlgPrefController(QWidget* parent, Controller* controller,

// Connect our signals to controller manager.
connect(this, SIGNAL(openController(Controller*)),
m_pControllerManager, SLOT(openController(Controller*)));
m_pControllerManager.get(), SLOT(openController(Controller*)));
connect(this, SIGNAL(closeController(Controller*)),
m_pControllerManager, SLOT(closeController(Controller*)));
m_pControllerManager.get(), SLOT(closeController(Controller*)));
connect(this, SIGNAL(loadPreset(Controller*, ControllerPresetPointer)),
m_pControllerManager, SLOT(loadPreset(Controller*, ControllerPresetPointer)));
m_pControllerManager.get(), SLOT(loadPreset(Controller*, ControllerPresetPointer)));

// Input mappings
connect(m_ui.btnAddInputMapping, SIGNAL(clicked()),
Expand Down Expand Up @@ -744,5 +744,3 @@ void DlgPrefController::openScript() {
}
}
}


5 changes: 3 additions & 2 deletions src/controllers/dlgprefcontroller.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "controllers/ui_dlgprefcontrollerdlg.h"
#include "preferences/usersettings.h"
#include "preferences/dlgpreferencepage.h"
#include "util/memory.h"

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

Expand Down Expand Up @@ -94,7 +95,7 @@ class DlgPrefController : public DlgPreferencePage {

Ui::DlgPrefControllerDlg m_ui;
UserSettingsPointer m_pConfig;
ControllerManager* m_pControllerManager;
std::shared_ptr<ControllerManager> m_pControllerManager;
Controller* m_pController;
DlgControllerLearning* m_pDlgControllerLearning;
ControllerPresetPointer m_pPreset;
Expand Down
4 changes: 2 additions & 2 deletions src/controllers/dlgprefcontrollers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

DlgPrefControllers::DlgPrefControllers(DlgPreferences* pPreferences,
UserSettingsPointer pConfig,
ControllerManager* pControllerManager,
std::shared_ptr<ControllerManager> pControllerManager,
QTreeWidgetItem* pControllerTreeItem)
: DlgPreferencePage(pPreferences),
m_pDlgPreferences(pPreferences),
Expand All @@ -28,7 +28,7 @@ DlgPrefControllers::DlgPrefControllers(DlgPreferences* pPreferences,
m_buttonMapper.setMapping(btnOpenUserPresets, userPresetsPath(m_pConfig));

// Connections
connect(m_pControllerManager, SIGNAL(devicesChanged()),
connect(m_pControllerManager.get(), SIGNAL(devicesChanged()),
this, SLOT(rescanControllers()));
}

Expand Down
5 changes: 3 additions & 2 deletions src/controllers/dlgprefcontrollers.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "preferences/usersettings.h"
#include "controllers/ui_dlgprefcontrollersdlg.h"
#include "preferences/dlgpreferencepage.h"
#include "util/memory.h"

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

Expand All @@ -39,7 +40,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