diff options
author | Be <be@mixxx.org> | 2020-12-07 21:08:48 -0600 |
---|---|---|
committer | Be <be@mixxx.org> | 2020-12-07 21:08:48 -0600 |
commit | 3085bbe95107fd789a8a966dfeb341cfe74cfad8 (patch) | |
tree | 7aac36fca1cce483218b3f06435d218283f156e3 /src/controllers/midi | |
parent | 7d82224170a6e9b9a9242b65c2ccb82ba749949a (diff) |
merge 2.3
Diffstat (limited to 'src/controllers/midi')
19 files changed, 48 insertions, 187 deletions
diff --git a/src/controllers/midi/hss1394controller.cpp b/src/controllers/midi/hss1394controller.cpp index 7acf885eaa..d35554bd29 100644 --- a/src/controllers/midi/hss1394controller.cpp +++ b/src/controllers/midi/hss1394controller.cpp @@ -1,10 +1,3 @@ -/** - * @file hss1394controller.cpp - * @author Sean M. Pappalardo spappalardo@mixxx.org - * @date Thu 15 Mar 2012 - * @brief HSS1394-based MIDI backend - */ - #include "controllers/midi/hss1394controller.h" #include "controllers/controllerdebug.h" diff --git a/src/controllers/midi/hss1394controller.h b/src/controllers/midi/hss1394controller.h index df67cdb647..622316eadf 100644 --- a/src/controllers/midi/hss1394controller.h +++ b/src/controllers/midi/hss1394controller.h @@ -1,18 +1,4 @@ -/** - * @file hss1394controller.h - * @author Sean M. Pappalardo spappalardo@mixxx.org - * @date Thu 15 Mar 2012 - * @brief HSS1394-based MIDI backend - * - * This class represents a physical HSS1394 device. - * (HSS1394 is simply a way to send MIDI messages at high speed over - * IEEE1394 (FireWire)) - * It uses the HSS1394 API to send and receive MIDI messages to/from - * the device. - */ - -#ifndef HSS1394CONTROLLER_H -#define HSS1394CONTROLLER_H +#pragma once #include <hss1394/HSS1394.h> @@ -22,6 +8,11 @@ #define MIXXX_HSS1394_BUFFER_LEN 64 /**Number of MIDI messages to buffer*/ #define MIXXX_HSS1394_NO_DEVICE_STRING "None" /**String to display for no HSS1394 devices present */ +/// HSS1394-based MIDI backend +/// +/// This class represents a physical HSS1394 device. (HSS1394 is simply a way +/// to send MIDI messages at high speed over IEEE1394 (FireWire)) It uses the +/// HSS1394 API to send and receive MIDI messages to/from the device. class DeviceChannelListener : public QObject, public hss1394::ChannelListener { Q_OBJECT public: @@ -69,5 +60,3 @@ class Hss1394Controller : public MidiController { hss1394::Channel* m_pChannel; DeviceChannelListener *m_pChannelListener; }; - -#endif diff --git a/src/controllers/midi/hss1394enumerator.cpp b/src/controllers/midi/hss1394enumerator.cpp index a5201e964f..76a120c970 100644 --- a/src/controllers/midi/hss1394enumerator.cpp +++ b/src/controllers/midi/hss1394enumerator.cpp @@ -1,9 +1,3 @@ -/** -* @file hss1394enumerator.cpp -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Thu 15 Mar 2012 -*/ - #include "controllers/midi/hss1394enumerator.h" #include <hss1394/HSS1394.h> diff --git a/src/controllers/midi/hss1394enumerator.h b/src/controllers/midi/hss1394enumerator.h index 5b52a9c0a6..725aaba5f1 100644 --- a/src/controllers/midi/hss1394enumerator.h +++ b/src/controllers/midi/hss1394enumerator.h @@ -1,15 +1,9 @@ -/** -* @file hss1394enumerator.h -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Thu 15 Mar 2012 -* @brief This class handles discovery and enumeration of DJ controllers that appear under the HSS1394 cross-platform API. -*/ - -#ifndef HSS1394ENUMERATOR_H -#define HSS1394ENUMERATOR_H +#pragma once #include "controllers/midi/midienumerator.h" +// Handles discovery and enumeration of DJ controllers that appear under the +// HSS1394 cross-platform API. class Hss1394Enumerator : public MidiEnumerator { Q_OBJECT public: @@ -22,5 +16,3 @@ class Hss1394Enumerator : public MidiEnumerator { UserSettingsPointer m_pConfig; QList<Controller*> m_devices; }; - -#endif diff --git a/src/controllers/midi/midicontroller.cpp b/src/controllers/midi/midicontroller.cpp index 69f0184534..6a6f7021ee 100644 --- a/src/controllers/midi/midicontroller.cpp +++ b/src/controllers/midi/midicontroller.cpp @@ -1,11 +1,3 @@ -/** - * @file midicontroller.cpp - * @author Sean Pappalardo spappalardo@mixxx.org - * @date Tue 7 Feb 2012 - * @brief MIDI Controller base class - * - */ - #include "controllers/midi/midicontroller.h" #include "control/controlobject.h" diff --git a/src/controllers/midi/midicontroller.h b/src/controllers/midi/midicontroller.h index 0cc39139a3..f3e5a1f971 100644 --- a/src/controllers/midi/midicontroller.h +++ b/src/controllers/midi/midicontroller.h @@ -1,17 +1,4 @@ -/** -* @file midicontroller.h -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Tue 7 Feb 2012 -* @brief MIDI Controller base class -* -* This is a base class representing a MIDI controller. -* It must be inherited by a class that implements it on some API. -* -* Note that the subclass' destructor should call close() at a minimum. -*/ - -#ifndef MIDICONTROLLER_H -#define MIDICONTROLLER_H +#pragma once #include "controllers/controller.h" #include "controllers/midi/midicontrollerpreset.h" @@ -20,6 +7,14 @@ #include "controllers/midi/midioutputhandler.h" #include "controllers/softtakeover.h" +class DlgControllerLearning; + +/// MIDI Controller base class +/// +/// This is a base class representing a MIDI controller. +/// It must be inherited by a class that implements it on some API. +/// +/// Note that the subclass' destructor should call close() at a minimum. class MidiController : public Controller { Q_OBJECT public: @@ -49,11 +44,10 @@ class MidiController : public Controller { return m_preset.isMappable(); } - bool matchPreset(const PresetInfo& preset) override; + bool matchPreset(const PresetInfo& preset) override; signals: - void messageReceived(unsigned char status, unsigned char control, - unsigned char value); + void messageReceived(unsigned char status, unsigned char control, unsigned char value); protected: virtual void sendShortMsg(unsigned char status, @@ -69,15 +63,17 @@ class MidiController : public Controller { } protected slots: - virtual void receive(unsigned char status, unsigned char control, - unsigned char value, mixxx::Duration timestamp); + virtual void receive(unsigned char status, + unsigned char control, + unsigned char value, + mixxx::Duration timestamp); // For receiving System Exclusive messages void receive(const QByteArray& data, mixxx::Duration timestamp) override; int close() override; private slots: /// Apply the preset to the controller. - /// @brief Initializes both controller engine and static output mappings. + /// Initializes both controller engine and static output mappings. /// /// @param initializeScripts Can be set to false to skip script /// initialization for unit tests. @@ -145,5 +141,3 @@ class MidiControllerJSProxy : public ControllerJSProxy { private: MidiController* m_pMidiController; }; - -#endif diff --git a/src/controllers/midi/midicontrollerpreset.cpp b/src/controllers/midi/midicontrollerpreset.cpp index 844746f50d..bbeadc97c6 100644 --- a/src/controllers/midi/midicontrollerpreset.cpp +++ b/src/controllers/midi/midicontrollerpreset.cpp @@ -1,11 +1,3 @@ -/// @file midicontrollerpreset.cpp -/// @author Jan Holthuis holzhaus@mixxx.org -/// @date Wed 8 Apr 2020 -/// @brief MIDI Controller Preset -/// -/// This class represents a MIDI controller preset, containing the data elements -/// that make it up. - #include "controllers/midi/midicontrollerpreset.h" #include "controllers/defs_controllers.h" diff --git a/src/controllers/midi/midicontrollerpreset.h b/src/controllers/midi/midicontrollerpreset.h index f077f0f8f3..a001996fd7 100644 --- a/src/controllers/midi/midicontrollerpreset.h +++ b/src/controllers/midi/midicontrollerpreset.h @@ -1,8 +1,4 @@ #pragma once -/// @file midicontrollerpreset.h -/// @author Sean Pappalardo spappalardo@mixxx.org -/// @date Mon 9 Apr 2012 -/// @brief MIDI Controller preset #include <QMultiHash> @@ -10,8 +6,8 @@ #include "controllers/controllerpresetvisitor.h" #include "controllers/midi/midimessage.h" -/// This class represents a MIDI controller preset, containing the data elements -/// that make it up. +/// Represents a MIDI controller preset, containing the data elements that make +/// it up. class MidiControllerPreset : public ControllerPreset { public: MidiControllerPreset(){}; diff --git a/src/controllers/midi/midicontrollerpresetfilehandler.cpp b/src/controllers/midi/midicontrollerpresetfilehandler.cpp index fddafd929a..838b915482 100644 --- a/src/controllers/midi/midicontrollerpresetfilehandler.cpp +++ b/src/controllers/midi/midicontrollerpresetfilehandler.cpp @@ -1,11 +1,3 @@ -/** -* @file midicontrollerpresetfilehandler.cpp -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Mon 9 Apr 2012 -* @brief Handles loading and saving of MIDI controller presets. -* -*/ - #include "controllers/midi/midicontrollerpresetfilehandler.h" #include "controllers/midi/midiutils.h" diff --git a/src/controllers/midi/midicontrollerpresetfilehandler.h b/src/controllers/midi/midicontrollerpresetfilehandler.h index ad7c43419e..44d82dd373 100644 --- a/src/controllers/midi/midicontrollerpresetfilehandler.h +++ b/src/controllers/midi/midicontrollerpresetfilehandler.h @@ -1,16 +1,9 @@ -/** - * @file midicontrollerpresetfilehandler.h - * @author Sean Pappalardo spappalardo@mixxx.org - * @date Mon 9 Apr 2012 - * @brief Handles loading and saving of MIDI controller presets. - */ - -#ifndef MIDICONTROLLERPRESETFILEHANDLER_H -#define MIDICONTROLLERPRESETFILEHANDLER_H +#pragma once #include "controllers/controllerpresetfilehandler.h" #include "controllers/midi/midicontrollerpreset.h" +/// Handles loading and saving of MIDI controller presets. class MidiControllerPresetFileHandler : public ControllerPresetFileHandler { public: MidiControllerPresetFileHandler() {}; @@ -36,5 +29,3 @@ class MidiControllerPresetFileHandler : public ControllerPresetFileHandler { QDomElement outputMappingToXML(QDomDocument* doc, const MidiOutputMapping& mapping) const; }; - -#endif diff --git a/src/controllers/midi/midimessage.h b/src/controllers/midi/midimessage.h index 2587603cb5..80ad2d5fac 100644 --- a/src/controllers/midi/midimessage.h +++ b/src/controllers/midi/midimessage.h @@ -1,5 +1,4 @@ -#ifndef MIDIMESSAGE_H -#define MIDIMESSAGE_H +#pragma once #include <QList> #include <QPair> @@ -193,5 +192,3 @@ struct MidiOutputMapping { QString description; }; typedef QList<MidiOutputMapping> MidiOutputMappings; - -#endif diff --git a/src/controllers/midi/midioutputhandler.cpp b/src/controllers/midi/midioutputhandler.cpp index 1d38401c78..bf3bb4dc01 100644 --- a/src/controllers/midi/midioutputhandler.cpp +++ b/src/controllers/midi/midioutputhandler.cpp @@ -1,11 +1,3 @@ -/** - * @file midioutputhandler.cpp - * @author Sean Pappalardo spappalardo@mixxx.org - * @date Tue 11 Feb 2012 - * @brief MIDI output mapping handler - * - */ - #include "controllers/midi/midioutputhandler.h" #include <QtDebug> diff --git a/src/controllers/midi/midioutputhandler.h b/src/controllers/midi/midioutputhandler.h index 9b1230b8e5..dc64911d02 100644 --- a/src/controllers/midi/midioutputhandler.h +++ b/src/controllers/midi/midioutputhandler.h @@ -1,21 +1,14 @@ -/** - * @file midioutputhandler.h - * @author Sean Pappalardo spappalardo@mixxx.org - * @date Tue 11 Feb 2012 - * @brief Static MIDI output mapping handler - * - * This class listens to a control object and sends a midi message based on the - * value. - */ - -#ifndef MIDIOUTPUTHANDLER_H -#define MIDIOUTPUTHANDLER_H +#pragma once #include "control/controlproxy.h" #include "controllers/midi/midimessage.h" class MidiController; +/// Static MIDI output mapping handler +/// +/// This class listens to a control object and sends a midi message based on +/// the value. class MidiOutputHandler : public QObject { Q_OBJECT public: @@ -35,5 +28,3 @@ class MidiOutputHandler : public QObject { ControlProxy m_cos; int m_lastVal; }; - -#endif diff --git a/src/controllers/midi/midiutils.h b/src/controllers/midi/midiutils.h index 56e912929c..f2ab12ec40 100644 --- a/src/controllers/midi/midiutils.h +++ b/src/controllers/midi/midiutils.h @@ -1,5 +1,4 @@ -#ifndef MIDIUTILS_H -#define MIDIUTILS_H +#pragma once #include "controllers/midi/midimessage.h" #include "util/duration.h" @@ -48,6 +47,3 @@ class MidiUtils { const QByteArray& data, mixxx::Duration timestamp = mixxx::Duration::fromMillis(0)); }; - - -#endif /* MIDIUTILS_H */ diff --git a/src/controllers/midi/portmidicontroller.cpp b/src/controllers/midi/portmidicontroller.cpp index 12ec9bf53f..65ddd8dbff 100644 --- a/src/controllers/midi/portmidicontroller.cpp +++ b/src/controllers/midi/portmidicontroller.cpp @@ -1,12 +1,3 @@ -/** - * @file portmidicontroller.h - * @author Albert Santoni alberts@mixxx.org - * @author Sean M. Pappalardo spappalardo@mixxx.org - * @date Thu 15 Mar 2012 - * @brief PortMidi-based MIDI backend - * - */ - #include "controllers/midi/portmidicontroller.h" #include "controllers/controllerdebug.h" diff --git a/src/controllers/midi/portmidicontroller.h b/src/controllers/midi/portmidicontroller.h index 45770edebd..25012eb1ac 100644 --- a/src/controllers/midi/portmidicontroller.h +++ b/src/controllers/midi/portmidicontroller.h @@ -1,21 +1,4 @@ -/** - * @file portmidicontroller.h - * @author Albert Santoni alberts@mixxx.org - * @author Sean M. Pappalardo spappalardo@mixxx.org - * @date Thu 15 Mar 2012 - * @brief PortMidi-based MIDI backend - * - * This class is represents a MIDI device, either physical or software. - * It uses the PortMidi API to send and receive MIDI messages to/from the device. - * It's important to note that PortMidi treats input and output on a single - * physical device as two separate half-duplex devices. In this class, we wrap - * those together into a single device, which is why the constructor takes - * both arguments pertaining to both input and output "devices". - * - */ - -#ifndef PORTMIDICONTROLLER_H -#define PORTMIDICONTROLLER_H +#pragma once #include <portmidi.h> @@ -55,7 +38,14 @@ // String to display for no MIDI devices present #define MIXXX_PORTMIDI_NO_DEVICE_STRING "None" -// A PortMidi-based implementation of MidiController +/// PortMidi-based implementation of MidiController +/// +/// This class is represents a MIDI device, either physical or software. +/// It uses the PortMidi API to send and receive MIDI messages to/from the device. +/// It's important to note that PortMidi treats input and output on a single +/// physical device as two separate half-duplex devices. In this class, we wrap +/// those together into a single device, which is why the constructor takes +/// both arguments pertaining to both input and output "devices". class PortMidiController : public MidiController { Q_OBJECT public: @@ -104,5 +94,3 @@ class PortMidiController : public MidiController { friend class PortMidiControllerTest; }; - -#endif diff --git a/src/controllers/midi/portmididevice.h b/src/controllers/midi/portmididevice.h index 071ddee38a..bda613ab3e 100644 --- a/src/controllers/midi/portmididevice.h +++ b/src/controllers/midi/portmididevice.h @@ -1,5 +1,4 @@ -#ifndef CONTROLLERS_MIDI_PORTMIDIDEVICE -#define CONTROLLERS_MIDI_PORTMIDIDEVICE +#pragma once #include <portmidi.h> @@ -72,5 +71,3 @@ class PortMidiDevice { int m_deviceIndex; PortMidiStream* m_pStream; }; - -#endif /* CONTROLLERS_MIDI_PORTMIDIDEVICE */ diff --git a/src/controllers/midi/portmidienumerator.cpp b/src/controllers/midi/portmidienumerator.cpp index 047cda64fd..4958ca8268 100644 --- a/src/controllers/midi/portmidienumerator.cpp +++ b/src/controllers/midi/portmidienumerator.cpp @@ -1,10 +1,3 @@ -/** -* @file portmidienumerator.cpp -* @author Sean Pappalardo spappalardo@mixxx.org -* @date Thu 15 Mar 2012 -* @brief This class handles discovery and enumeration of DJ controller devices that appear under the PortMIDI cross-platform API. -*/ - #include "controllers/midi/portmidienumerator.h" #include <portmidi.h> diff --git a/src/controllers/midi/portmidienumerator.h b/src/controllers/midi/portmidienumerator.h index 6be217dfe4..21548c90dd 100644 --- a/src/controllers/midi/portmidienumerator.h +++ b/src/controllers/midi/portmidienumerator.h @@ -1,15 +1,8 @@ -/** - * @file portmidienumerator.h - * @author Sean Pappalardo spappalardo@mixxx.org - * @date Thu 15 Mar 2012 - * @brief This class handles discovery and enumeration of DJ controllers that appear under the PortMIDI cross-platform API. - */ - -#ifndef PORTMIDIENUMERATOR_H -#define PORTMIDIENUMERATOR_H +#pragma once #include "controllers/midi/midienumerator.h" +/// This class handles discovery and enumeration of DJ controllers that appear under the PortMIDI cross-platform API. class PortMidiEnumerator : public MidiEnumerator { Q_OBJECT public: @@ -25,5 +18,3 @@ class PortMidiEnumerator : public MidiEnumerator { // For testing. bool shouldLinkInputToOutput(const QString& input_name, const QString& output_name); - -#endif |