Skip to content

Commit

Permalink
Clean up MixxxMainWindow includes & documentation comments
Browse files Browse the repository at this point in the history
  • Loading branch information
xeruf committed Jun 16, 2020
1 parent 634cf7d commit aea4059
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 73 deletions.
21 changes: 2 additions & 19 deletions src/mixxx.cpp
Original file line number Diff line number Diff line change
@@ -1,27 +1,9 @@
/***************************************************************************
mixxx.cpp - description
-------------------
begin : Mon Feb 18 09:48:17 CET 2002
copyright : (C) 2002 by Tue and Ken Haste Andersen
email :
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#include "mixxx.h"

#include <QDesktopServices>
#include <QDesktopWidget>
#include <QFileDialog>
#include <QGLFormat>
#include <QGLWidget>
#include <QGuiApplication>
#include <QInputMethod>
#include <QLocale>
Expand Down Expand Up @@ -90,9 +72,10 @@
#endif

#if defined(Q_OS_LINUX)
#include <QtX11Extras/QX11Info>
#include <X11/Xlib.h>
#include <X11/Xlibint.h>

#include <QtX11Extras/QX11Info>
// Xlibint.h predates C++ and defines macros which conflict
// with references to std::max and std::min
#undef max
Expand Down
79 changes: 25 additions & 54 deletions src/mixxx.h
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
/***************************************************************************
mixxx.h - description
-------------------
begin : Mon Feb 18 09:48:17 CET 2002
copyright : (C) 2002 by Tue and Ken Haste Andersen
email :
***************************************************************************/

/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/

#ifndef MIXXX_H
#define MIXXX_H
#pragma once

#include <QMainWindow>
#include <QSharedPointer>
Expand All @@ -31,44 +13,43 @@
#include "util/db/dbconnectionpool.h"
#include "soundio/sounddeviceerror.h"

class BroadcastManager;
class ChannelHandleFactory;
class ControlPushButton;
class ControllerManager;
class ControlPushButton;
class DlgDeveloperTools;
class DlgPreferences;
class EffectsManager;
class EngineMaster;
class GuiTick;
class VisualsManager;
class KeyboardEventFilter;
class LaunchImage;
class Library;
class TrackCollectionManager;
class KeyboardEventFilter;
class PlayerManager;
class RecordingManager;
class SettingsManager;
class BroadcastManager;
class SkinLoader;
class SoundManager;
class TrackCollectionManager;
class VinylControlManager;
class VisualsManager;
class WMainMenuBar;

typedef QSharedPointer<SettingsManager> SettingsManagerPointer;

// This Class is the base class for Mixxx. It sets up the main
// window and providing a menubar.
// For the main view, an instance of class MixxxView is
// created which creates your view.
/// This Class is the base class for Mixxx. It sets up the main
/// window and providing a menubar.
/// For the main view, an instance of class MixxxView is
/// created which creates your view.
class MixxxMainWindow : public QMainWindow {
Q_OBJECT
public:
// Constructor. files is a list of command line arguments
MixxxMainWindow(QApplication *app, const CmdlineArgs& args);
~MixxxMainWindow() override;

void finalize();

// creates the menu_bar and inserts the file Menu
/// creates the menu_bar and inserts the file Menu
void createMenuBar();
void connectMenuBar();
void setInhibitScreensaver(mixxx::ScreenSaverPreference inhibit);
Expand All @@ -83,45 +64,45 @@ class MixxxMainWindow : public QMainWindow {
void rebootMixxxView();

void slotFileLoadSongPlayer(int deck);
// toggle keyboard on-off
/// toggle keyboard on-off
void slotOptionsKeyboard(bool toggle);
// Preference dialog
/// Preference dialog
void slotOptionsPreferences();
// shows an about dlg
/// shows an about dlalogg
void slotHelpAbout();
// toggle full screen mode
/// toggle full screen mode
void slotViewFullScreen(bool toggle);
// Open the developer tools dialog.
/// Open the developer tools dialog.
void slotDeveloperTools(bool enable);
void slotDeveloperToolsClosed();

void slotUpdateWindowTitle(TrackPointer pTrack);
void slotChangedPlayingDeck(int deck);

// Warn the user when inputs are not configured.
/// Warn the user when inputs are not configured.
void slotNoMicrophoneInputConfigured();
void slotNoAuxiliaryInputConfigured();
void slotNoDeckPassthroughInputConfigured();
void slotNoVinylControlInputConfigured();

signals:
void skinLoaded();
// used to uncheck the menu when the dialog of develeoper tools is closed
/// used to uncheck the menu when the dialog of develeoper tools is closed
void developerToolsDlgClosed(int r);
void closeDeveloperToolsDlgChecked(int r);
void fullScreenChanged(bool fullscreen);

protected:
// Event filter to block certain events (eg. tooltips if tooltips are disabled)
/// Event filter to block certain events (eg. tooltips if tooltips are disabled)
bool eventFilter(QObject *obj, QEvent *event) override;
void closeEvent(QCloseEvent *event) override;
bool event(QEvent* e) override;

private:
void initialize(QApplication *app, const CmdlineArgs& args);

// progresses the launch image progress bar
// this must be called from the GUi thread only
/// progresses the launch image progress bar
/// this must be called from the GUI thread only
void launchProgress(int progress);

void initializeWindow();
Expand All @@ -144,22 +125,17 @@ class MixxxMainWindow : public QMainWindow {

SettingsManager* m_pSettingsManager;

// The effects processing system
/// The effects processing system
EffectsManager* m_pEffectsManager;

// The mixing engine.
/// The mixing engine.
EngineMaster* m_pEngine;

// The skin loader.
// TODO(rryan): doesn't need to be a member variable
SkinLoader* m_pSkinLoader;
SkinLoader* m_pSkinLoader; // TODO(rryan): doesn't need to be a member variable

// The sound manager
SoundManager* m_pSoundManager;

// Keeps track of players
PlayerManager* m_pPlayerManager;
// RecordingManager
RecordingManager* m_pRecordingManager;
#ifdef __BROADCAST__
BroadcastManager* m_pBroadcastManager;
Expand All @@ -173,26 +149,23 @@ class MixxxMainWindow : public QMainWindow {

KeyboardEventFilter* m_pKeyboard;

// The Mixxx database connection pool
mixxx::DbConnectionPoolPtr m_pDbConnectionPool;

TrackCollectionManager* m_pTrackCollectionManager;

// The library management object
Library* m_pLibrary;

parented_ptr<WMainMenuBar> m_pMenuBar;

DlgDeveloperTools* m_pDeveloperToolsDlg;

/** Pointer to preference dialog */
DlgPreferences* m_pPrefDlg;

ConfigObject<ConfigValueKbd>* m_pKbdConfig;
ConfigObject<ConfigValueKbd>* m_pKbdConfigEmpty;

mixxx::TooltipsPreference m_toolTipsCfg;
// Timer that tracks how long Mixxx has been running.
/// Timer that tracks how long Mixxx has been running.
Timer m_runtime_timer;

const CmdlineArgs& m_cmdLineArgs;
Expand All @@ -203,5 +176,3 @@ class MixxxMainWindow : public QMainWindow {
static const int kMicrophoneCount;
static const int kAuxiliaryCount;
};

#endif

0 comments on commit aea4059

Please sign in to comment.