From 16ad7db27617639b8bbadd65656980af770471d2 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Wed, 29 Sep 2021 12:50:20 +0200 Subject: [PATCH 001/118] Move file-scope variable 'framesPerPeriod' into the private scope of 'BufferManager'. --- include/BufferManager.h | 6 +++++- src/core/BufferManager.cpp | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/include/BufferManager.h b/include/BufferManager.h index 20390644b95..b8a1a4f2f61 100644 --- a/include/BufferManager.h +++ b/include/BufferManager.h @@ -32,7 +32,7 @@ class LMMS_EXPORT BufferManager { public: - static void init( fpp_t framesPerPeriod ); + static void init( fpp_t fpp ); static sampleFrame * acquire(); // audio-buffer-mgm static void clear( sampleFrame * ab, const f_cnt_t frames, @@ -42,6 +42,10 @@ class LMMS_EXPORT BufferManager const f_cnt_t offset = 0 ); #endif static void release( sampleFrame * buf ); + +private: + + static fpp_t framesPerPeriod; }; #endif diff --git a/src/core/BufferManager.cpp b/src/core/BufferManager.cpp index eb8764074a4..5b74b1493f2 100644 --- a/src/core/BufferManager.cpp +++ b/src/core/BufferManager.cpp @@ -29,17 +29,17 @@ #include "Engine.h" #include "MemoryManager.h" -static fpp_t framesPerPeriod; +fpp_t BufferManager::framesPerPeriod; -void BufferManager::init( fpp_t framesPerPeriod ) +void BufferManager::init( fpp_t fpp ) { - ::framesPerPeriod = framesPerPeriod; + BufferManager::framesPerPeriod = fpp; } sampleFrame * BufferManager::acquire() { - return MM_ALLOC( ::framesPerPeriod ); + return MM_ALLOC( BufferManager::framesPerPeriod ); } void BufferManager::clear( sampleFrame *ab, const f_cnt_t frames, const f_cnt_t offset ) From 480250e069affa7cb4e38444334ed24a205ae036 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 30 Sep 2021 17:49:53 +0200 Subject: [PATCH 002/118] Place LMMS symbols into namespaces 'lmms' and 'lmms::gui' (broken WIP commit) --- include/AboutDialog.h | 3 ++ include/ActionGroup.h | 5 ++ include/AudioAlsa.h | 4 ++ include/AudioAlsaSetupWidget.h | 7 ++- include/AudioDevice.h | 8 ++- include/AudioDeviceSetupWidget.h | 3 ++ include/AudioDummy.h | 7 ++- include/AudioEngine.h | 5 ++ include/AudioEngineProfiler.h | 5 ++ include/AudioEngineWorkerThread.h | 7 ++- include/AudioFileDevice.h | 3 ++ include/AudioFileFlac.h | 6 +++ include/AudioFileMP3.h | 4 ++ include/AudioFileOgg.h | 4 ++ include/AudioFileWave.h | 5 ++ include/AudioJack.h | 16 ++++-- include/AudioOss.h | 14 ++++-- include/AudioPort.h | 4 ++ include/AudioPortAudio.h | 15 ++++-- include/AudioPulseAudio.h | 14 ++++-- include/AudioSampleRecorder.h | 4 ++ include/AudioSdl.h | 7 ++- include/AudioSndio.h | 15 ++++-- include/AudioSoundIo.h | 9 ++++ include/AutomatableButton.h | 3 ++ include/AutomatableModel.h | 7 +++ include/AutomatableModelView.h | 5 ++ include/AutomatableSlider.h | 3 ++ include/AutomationEditor.h | 12 ++++- include/AutomationNode.h | 4 ++ include/AutomationPattern.h | 8 ++- include/AutomationPatternView.h | 5 ++ include/AutomationTrack.h | 6 ++- include/AutomationTrackView.h | 4 ++ include/BBEditor.h | 12 ++++- include/BBTCO.h | 5 +- include/BBTCOView.h | 4 ++ include/BBTrack.h | 18 +++++-- include/BBTrackContainer.h | 5 ++ include/BBTrackView.h | 5 ++ include/BandLimitedWave.h | 4 ++ include/BasicFilters.h | 5 ++ include/BufferManager.h | 8 ++- include/CPULoadWidget.h | 6 +++ include/CaptionMenu.h | 5 +- include/Clipboard.h | 6 ++- include/ColorChooser.h | 7 +++ include/ComboBox.h | 5 ++ include/ComboBoxModel.h | 3 ++ include/ConfigManager.h | 8 +++ include/ControlLayout.h | 6 +++ include/Controller.h | 19 +++++-- include/ControllerConnection.h | 13 ++++- include/ControllerConnectionDialog.h | 14 +++++- include/ControllerDialog.h | 10 ++++ include/ControllerRackView.h | 14 +++++- include/ControllerView.h | 7 +++ include/Controls.h | 10 ++++ include/CustomTextKnob.h | 7 +++ include/DataFile.h | 5 ++ include/Delay.h | 6 +++ include/DeprecationHelper.h | 5 ++ include/DetuningHelper.h | 5 ++ include/DrumSynth.h | 6 +++ include/DspEffectLibrary.h | 4 +- include/DummyEffect.h | 13 ++++- include/DummyInstrument.h | 10 +++- include/DummyPlugin.h | 9 +++- include/Editor.h | 9 +++- include/Effect.h | 7 ++- include/EffectChain.h | 5 ++ include/EffectControlDialog.h | 9 ++++ include/EffectControls.h | 13 ++++- include/EffectRackView.h | 5 ++ include/EffectSelectDialog.h | 5 ++ include/EffectView.h | 6 +++ include/Engine.h | 5 ++ include/EnvelopeAndLfoParameters.h | 4 ++ include/EnvelopeAndLfoView.h | 10 ++++ include/ExportFilter.h | 6 +++ include/ExportProjectDialog.h | 8 +++ include/FadeButton.h | 6 +++ include/Fader.h | 6 +++ include/FifoBuffer.h | 6 +++ include/FileBrowser.h | 13 ++++- include/FileDialog.h | 7 +++ include/FxLine.h | 5 ++ include/FxLineLcdSpinBox.h | 7 +++ include/FxMixer.h | 6 +++ include/FxMixerView.h | 9 ++++ include/Graph.h | 17 ++++++- include/GroupBox.h | 3 ++ include/GuiApplication.h | 13 ++++- include/ImportFilter.h | 5 ++ include/InlineAutomation.h | 4 ++ include/Instrument.h | 5 ++ include/InstrumentFunctionViews.h | 17 +++++-- include/InstrumentFunctions.h | 13 ++++- include/InstrumentMidiIOView.h | 16 +++++- include/InstrumentMiscView.h | 13 ++++- include/InstrumentPlayHandle.h | 6 +++ include/InstrumentSoundShaping.h | 12 ++++- include/InstrumentSoundShapingView.h | 6 +++ include/InstrumentTrack.h | 28 +++++++++-- include/InstrumentTrackView.h | 8 ++- include/InstrumentTrackWindow.h | 21 ++++++-- include/InstrumentView.h | 6 +++ include/IoHelper.h | 28 ++++++++--- include/JournallingObject.h | 4 ++ include/Keymap.h | 5 ++ include/Knob.h | 8 +++ include/Ladspa2LMMS.h | 6 +++ include/LadspaBase.h | 6 +++ include/LadspaControl.h | 15 +++++- include/LadspaControlView.h | 10 ++++ include/LadspaManager.h | 6 +++ include/LcdFloatSpinBox.h | 5 ++ include/LcdSpinBox.h | 4 ++ include/LcdWidget.h | 5 ++ include/LedCheckbox.h | 6 +++ include/LeftRightNav.h | 6 +++ include/LfoController.h | 26 ++++++++-- include/LinkedModelGroupViews.h | 5 ++ include/LinkedModelGroups.h | 5 ++ include/LmmsPalette.h | 5 ++ include/LmmsStyle.h | 6 +++ include/LocaleHelper.h | 7 ++- include/LocklessAllocator.h | 7 +++ include/LocklessList.h | 5 ++ include/LocklessRingBuffer.h | 6 +++ include/Lv2Basics.h | 5 ++ include/Lv2ControlBase.h | 7 +++ include/Lv2Evbuf.h | 8 +++ include/Lv2Features.h | 7 +++ include/Lv2Manager.h | 6 +++ include/Lv2Options.h | 6 +++ include/Lv2Ports.h | 8 +++ include/Lv2Proc.h | 7 +++ include/Lv2SubPluginFeatures.h | 7 +++ include/Lv2UridCache.h | 8 +++ include/Lv2UridMap.h | 8 +++ include/Lv2ViewBase.h | 12 +++++ include/MainApplication.h | 8 +++ include/MainWindow.h | 12 +++++ include/MemoryHelper.h | 7 +++ include/MemoryManager.h | 7 +++ include/MeterDialog.h | 5 ++ include/MeterModel.h | 6 +++ include/MicroTimer.h | 5 ++ include/Microtuner.h | 5 ++ include/MicrotunerConfig.h | 7 +++ include/Midi.h | 7 +++ include/MidiAlsaRaw.h | 8 ++- include/MidiAlsaSeq.h | 9 +++- include/MidiApple.h | 9 +++- include/MidiCCRackView.h | 12 +++++ include/MidiClient.h | 3 ++ include/MidiController.h | 7 ++- include/MidiDummy.h | 6 +++ include/MidiEvent.h | 5 ++ include/MidiEventProcessor.h | 5 ++ include/MidiEventToByteSeq.h | 7 +++ include/MidiJack.h | 9 +++- include/MidiOss.h | 9 +++- include/MidiPort.h | 13 ++++- include/MidiPortMenu.h | 3 ++ include/MidiSetupWidget.h | 7 +++ include/MidiSndio.h | 6 +++ include/MidiWinMM.h | 9 +++- include/MixHelpers.h | 8 ++- include/Model.h | 4 ++ include/ModelView.h | 3 ++ include/ModelVisitor.h | 7 +++ include/NStateButton.h | 6 +++ include/Note.h | 7 +++ include/NotePlayHandle.h | 6 +++ include/Oscillator.h | 6 +++ include/OscillatorConstants.h | 6 ++- include/Oscilloscope.h | 6 +++ include/OutputSettings.h | 8 +++ include/PathUtil.h | 4 +- include/Pattern.h | 9 +++- include/PatternView.h | 18 +++++-- include/PeakController.h | 16 ++++-- include/PerfLog.h | 7 +++ include/Piano.h | 7 +++ include/PianoRoll.h | 16 +++++- include/PianoView.h | 9 ++++ include/Pitch.h | 7 +++ include/PixmapButton.h | 6 +++ include/PlayHandle.h | 4 ++ include/Plugin.h | 17 +++++-- include/PluginBrowser.h | 4 ++ include/PluginFactory.h | 6 +++ include/PluginIssue.h | 10 +++- include/PluginView.h | 4 ++ include/PositionLine.h | 5 ++ include/PresetPreviewPlayHandle.h | 5 ++ include/ProjectJournal.h | 7 +++ include/ProjectNotes.h | 5 ++ include/ProjectRenderer.h | 7 +++ include/ProjectVersion.h | 7 +++ include/QuadratureLfo.h | 7 +++ include/RecentProjectsMenu.h | 7 +++ include/RemotePlugin.h | 9 +++- include/RenameDialog.h | 4 ++ include/RenderManager.h | 7 +++ include/RingBuffer.h | 9 ++++ include/RmsHelper.h | 7 +++ include/RowTableView.h | 4 ++ include/Rubberband.h | 5 ++ include/SampleBuffer.h | 4 ++ include/SamplePlayHandle.h | 6 +++ include/SampleRecordHandle.h | 6 +++ include/SampleTCO.h | 6 ++- include/SampleTCOView.h | 5 ++ include/SampleTrack.h | 5 ++ include/SampleTrackView.h | 13 ++++- include/SampleTrackWindow.h | 8 ++- include/Scale.h | 6 +++ include/SendButtonIndicator.h | 6 +++ include/SerializingObject.h | 5 ++ include/SetupDialog.h | 9 ++++ include/SideBar.h | 6 +++ include/SideBarWidget.h | 6 +++ include/Song.h | 10 +++- include/SongEditor.h | 17 ++++++- include/StepRecorder.h | 17 +++++-- include/StepRecorderWidget.h | 5 ++ include/StringPairDrag.h | 5 ++ include/SubWindow.h | 8 +++ include/SweepOscillator.h | 4 ++ include/TabBar.h | 6 +++ include/TabButton.h | 6 +++ include/TabWidget.h | 6 +++ include/TemplatesMenu.h | 8 +++ include/TempoSyncKnob.h | 5 ++ include/TempoSyncKnobModel.h | 5 ++ include/TextFloat.h | 5 ++ include/ThreadableJob.h | 5 ++ include/TimeDisplayWidget.h | 4 ++ include/TimeLineWidget.h | 7 +++ include/TimePos.h | 5 ++ include/ToolButton.h | 4 ++ include/ToolPlugin.h | 8 +++ include/ToolPluginView.h | 11 ++++ include/ToolTip.h | 4 ++ include/Track.h | 17 +++++-- include/TrackContainer.h | 11 +++- include/TrackContainerView.h | 34 ++++++++----- include/TrackContentObject.h | 15 +++++- include/TrackContentObjectView.h | 13 ++++- include/TrackContentWidget.h | 10 ++++ include/TrackLabelButton.h | 6 +++ include/TrackOperationsWidget.h | 6 +++ include/TrackRenameLineEdit.h | 5 ++ include/TrackView.h | 15 +++++- include/ValueBuffer.h | 7 +++ include/VersionedSaveDialog.h | 7 +++ include/VstSyncController.h | 6 +++ include/VstSyncData.h | 7 +++ include/aeffectx.h | 4 ++ include/base64.h | 6 +-- include/denormals.h | 5 ++ include/embed.h | 4 ++ include/endian_handling.h | 7 +++ include/fft_helpers.h | 6 +++ include/gui_templates.h | 4 ++ include/interpolation.h | 5 +- include/lmms_basics.h | 7 +++ include/lmms_constants.h | 7 +++ include/lmms_math.h | 6 +++ include/panning.h | 7 +++ include/panning_constants.h | 7 +++ include/shared_object.h | 6 +++ include/volume.h | 7 +++ .../peak_controller_effect.cpp | 6 +++ .../peak_controller_effect.h | 7 +++ .../peak_controller_effect_controls.cpp | 7 +-- .../peak_controller_effect_controls.h | 6 +++ src/core/AudioEngine.cpp | 6 +++ src/core/AudioEngineProfiler.cpp | 3 ++ src/core/AudioEngineWorkerThread.cpp | 5 +- src/core/AutomatableModel.cpp | 12 +++-- src/core/AutomationNode.cpp | 5 ++ src/core/AutomationPattern.cpp | 9 +++- src/core/BBTCO.cpp | 12 +++-- src/core/BBTrackContainer.cpp | 4 +- src/core/BandLimitedWave.cpp | 5 ++ src/core/BufferManager.cpp | 4 ++ src/core/Clipboard.cpp | 7 ++- src/core/ComboBoxModel.cpp | 5 +- src/core/ConfigManager.cpp | 12 ++++- src/core/Controller.cpp | 13 +++-- src/core/ControllerConnection.cpp | 5 +- src/core/DataFile.cpp | 19 +++++-- src/core/DrumSynth.cpp | 5 ++ src/core/Effect.cpp | 8 ++- src/core/EffectChain.cpp | 6 +++ src/core/Engine.cpp | 5 ++ src/core/EnvelopeAndLfoParameters.cpp | 5 +- src/core/FxMixer.cpp | 7 +++ src/core/ImportFilter.cpp | 4 ++ src/core/InlineAutomation.cpp | 5 ++ src/core/Instrument.cpp | 7 +++ src/core/InstrumentFunctions.cpp | 6 +++ src/core/InstrumentPlayHandle.cpp | 7 +++ src/core/InstrumentSoundShaping.cpp | 5 +- src/core/JournallingObject.cpp | 3 ++ src/core/Keymap.cpp | 7 +++ src/core/Ladspa2LMMS.cpp | 7 +++ src/core/LadspaControl.cpp | 6 ++- src/core/LadspaManager.cpp | 6 +++ src/core/LfoController.cpp | 12 +++-- src/core/LinkedModelGroups.cpp | 4 ++ src/core/LocklessAllocator.cpp | 6 +++ src/core/MemoryHelper.cpp | 6 +++ src/core/MemoryManager.cpp | 7 +++ src/core/MeterModel.cpp | 9 ++-- src/core/MicroTimer.cpp | 5 ++ src/core/Microtuner.cpp | 6 +++ src/core/MixHelpers.cpp | 4 +- src/core/Model.cpp | 4 +- src/core/ModelVisitor.cpp | 7 +++ src/core/Note.cpp | 6 +++ src/core/NotePlayHandle.cpp | 6 +++ src/core/Oscillator.cpp | 5 +- src/core/PathUtil.cpp | 5 +- src/core/PeakController.cpp | 11 ++-- src/core/PerfLog.cpp | 8 +++ src/core/Piano.cpp | 6 +++ src/core/PlayHandle.cpp | 5 ++ src/core/Plugin.cpp | 8 ++- src/core/PluginFactory.cpp | 7 +++ src/core/PluginIssue.cpp | 9 +++- src/core/PresetPreviewPlayHandle.cpp | 5 +- src/core/ProjectJournal.cpp | 4 ++ src/core/ProjectRenderer.cpp | 5 ++ src/core/ProjectVersion.cpp | 5 ++ src/core/RemotePlugin.cpp | 5 ++ src/core/RenderManager.cpp | 7 +++ src/core/RingBuffer.cpp | 4 ++ src/core/SampleBuffer.cpp | 4 ++ src/core/SamplePlayHandle.cpp | 5 +- src/core/SampleRecordHandle.cpp | 6 ++- src/core/SampleTCO.cpp | 10 +++- src/core/Scale.cpp | 6 +++ src/core/SerializingObject.cpp | 5 +- src/core/Song.cpp | 10 +++- src/core/StepRecorder.cpp | 9 +++- src/core/TempoSyncKnobModel.cpp | 10 ++-- src/core/TimePos.cpp | 6 +++ src/core/ToolPlugin.cpp | 6 +++ src/core/Track.cpp | 4 ++ src/core/TrackContainer.cpp | 6 +++ src/core/TrackContentObject.cpp | 4 ++ src/core/ValueBuffer.cpp | 7 +++ src/core/VstSyncController.cpp | 8 +-- src/core/audio/AudioAlsa.cpp | 4 ++ src/core/audio/AudioDevice.cpp | 4 +- src/core/audio/AudioFileDevice.cpp | 3 ++ src/core/audio/AudioFileFlac.cpp | 5 ++ src/core/audio/AudioFileMP3.cpp | 4 ++ src/core/audio/AudioFileOgg.cpp | 4 ++ src/core/audio/AudioFileWave.cpp | 3 ++ src/core/audio/AudioJack.cpp | 8 +-- src/core/audio/AudioOss.cpp | 8 ++- src/core/audio/AudioPort.cpp | 4 ++ src/core/audio/AudioPortAudio.cpp | 5 ++ src/core/audio/AudioPulseAudio.cpp | 7 ++- src/core/audio/AudioSampleRecorder.cpp | 5 +- src/core/audio/AudioSdl.cpp | 5 ++ src/core/audio/AudioSndio.cpp | 8 ++- src/core/audio/AudioSoundIo.cpp | 6 +++ src/core/base64.cpp | 5 +- src/core/fft_helpers.cpp | 7 +++ src/core/lv2/Lv2Basics.cpp | 5 ++ src/core/lv2/Lv2ControlBase.cpp | 3 ++ src/core/lv2/Lv2Evbuf.cpp | 7 +++ src/core/lv2/Lv2Features.cpp | 6 +++ src/core/lv2/Lv2Manager.cpp | 4 +- src/core/lv2/Lv2Options.cpp | 6 +++ src/core/lv2/Lv2Ports.cpp | 6 ++- src/core/lv2/Lv2Proc.cpp | 4 ++ src/core/lv2/Lv2SubPluginFeatures.cpp | 6 +++ src/core/lv2/Lv2UridCache.cpp | 7 +++ src/core/lv2/Lv2UridMap.cpp | 7 +++ src/core/midi/MidiAlsaRaw.cpp | 8 ++- src/core/midi/MidiAlsaSeq.cpp | 8 ++- src/core/midi/MidiApple.cpp | 9 +++- src/core/midi/MidiClient.cpp | 5 ++ src/core/midi/MidiController.cpp | 7 ++- src/core/midi/MidiEventToByteSeq.cpp | 6 +++ src/core/midi/MidiJack.cpp | 5 ++ src/core/midi/MidiOss.cpp | 7 ++- src/core/midi/MidiPort.cpp | 8 +++ src/core/midi/MidiSndio.cpp | 7 +++ src/core/midi/MidiWinMM.cpp | 8 ++- src/gui/AboutDialog.cpp | 4 ++ src/gui/ActionGroup.cpp | 5 ++ src/gui/AudioAlsaSetupWidget.cpp | 4 ++ src/gui/AudioDeviceSetupWidget.cpp | 4 ++ src/gui/AutomatableModelView.cpp | 5 ++ src/gui/AutomationPatternView.cpp | 6 +++ src/gui/AutomationTrackView.cpp | 10 +++- src/gui/BBTCOView.cpp | 9 +++- src/gui/BBTrackView.cpp | 8 ++- src/gui/ControllerConnectionDialog.cpp | 8 ++- src/gui/ControllerDialog.cpp | 5 +- src/gui/EffectControlDialog.cpp | 7 +-- src/gui/EffectSelectDialog.cpp | 8 +-- src/gui/ExportProjectDialog.cpp | 4 ++ src/gui/FileBrowser.cpp | 7 +++ src/gui/FxMixerView.cpp | 7 +++ src/gui/GuiApplication.cpp | 21 ++++++-- src/gui/InstrumentTrackView.cpp | 6 +++ src/gui/InstrumentTrackWindow.cpp | 6 +++ src/gui/InstrumentView.cpp | 4 ++ src/gui/LfoControllerDialog.cpp | 5 ++ src/gui/LmmsPalette.cpp | 5 +- src/gui/LmmsStyle.cpp | 8 +++ src/gui/Lv2ViewBase.cpp | 4 ++ src/gui/MainApplication.cpp | 7 +++ src/gui/MainWindow.cpp | 6 +++ src/gui/MidiCCRackView.cpp | 6 +++ src/gui/MidiSetupWidget.cpp | 8 +++ src/gui/ModelView.cpp | 3 ++ src/gui/PatternView.cpp | 7 +++ src/gui/PeakControllerDialog.cpp | 4 ++ src/gui/PianoView.cpp | 6 ++- src/gui/PluginBrowser.cpp | 10 ++-- src/gui/RowTableView.cpp | 7 ++- src/gui/SampleTCOView.cpp | 9 +++- src/gui/SampleTrackView.cpp | 9 +++- src/gui/SampleTrackWindow.cpp | 10 +++- src/gui/SetupDialog.cpp | 7 +++ src/gui/StringPairDrag.cpp | 7 +++ src/gui/SubWindow.cpp | 5 ++ src/gui/TimeLineWidget.cpp | 6 +++ src/gui/ToolPluginView.cpp | 4 ++ src/gui/TrackContainerView.cpp | 50 +++++++++++-------- src/gui/TrackContentObjectView.cpp | 6 +++ src/gui/TrackView.cpp | 6 +++ src/gui/dialogs/ColorChooser.cpp | 5 ++ src/gui/dialogs/FileDialog.cpp | 6 +++ src/gui/dialogs/VersionedSaveDialog.cpp | 7 +++ src/gui/editors/AutomationEditor.cpp | 6 +++ src/gui/editors/BBEditor.cpp | 5 ++ src/gui/editors/Editor.cpp | 5 ++ src/gui/editors/PianoRoll.cpp | 12 +++++ src/gui/editors/SongEditor.cpp | 7 +++ src/gui/embed.cpp | 6 +-- src/gui/menus/RecentProjectsMenu.cpp | 7 +++ src/gui/menus/TemplatesMenu.cpp | 8 +++ src/gui/widgets/AutomatableButton.cpp | 4 +- src/gui/widgets/AutomatableSlider.cpp | 4 +- src/gui/widgets/CPULoadWidget.cpp | 9 ++-- src/gui/widgets/CaptionMenu.cpp | 5 ++ src/gui/widgets/ComboBox.cpp | 4 +- src/gui/widgets/ControlLayout.cpp | 5 ++ src/gui/widgets/ControllerRackView.cpp | 5 ++ src/gui/widgets/ControllerView.cpp | 6 +++ src/gui/widgets/Controls.cpp | 4 ++ src/gui/widgets/CustomTextKnob.cpp | 7 +++ src/gui/widgets/EffectRackView.cpp | 5 +- src/gui/widgets/EffectView.cpp | 5 ++ src/gui/widgets/EnvelopeAndLfoView.cpp | 5 +- src/gui/widgets/FadeButton.cpp | 6 +++ src/gui/widgets/Fader.cpp | 6 +++ src/gui/widgets/FxLine.cpp | 7 +++ src/gui/widgets/FxLineLcdSpinBox.cpp | 7 +++ src/gui/widgets/Graph.cpp | 13 +++-- src/gui/widgets/GroupBox.cpp | 6 +++ src/gui/widgets/InstrumentFunctionViews.cpp | 5 +- src/gui/widgets/InstrumentMidiIOView.cpp | 5 ++ src/gui/widgets/InstrumentMiscView.cpp | 7 +++ .../widgets/InstrumentSoundShapingView.cpp | 5 +- src/gui/widgets/Knob.cpp | 7 +++ src/gui/widgets/LadspaControlView.cpp | 6 ++- src/gui/widgets/LcdFloatSpinBox.cpp | 6 +++ src/gui/widgets/LcdSpinBox.cpp | 3 ++ src/gui/widgets/LcdWidget.cpp | 4 +- src/gui/widgets/LedCheckbox.cpp | 7 +-- src/gui/widgets/LeftRightNav.cpp | 7 ++- src/gui/widgets/LinkedModelGroupViews.cpp | 4 ++ src/gui/widgets/MeterDialog.cpp | 5 ++ src/gui/widgets/MicrotunerConfig.cpp | 6 +++ src/gui/widgets/MidiPortMenu.cpp | 4 +- src/gui/widgets/NStateButton.cpp | 6 +++ src/gui/widgets/Oscilloscope.cpp | 5 +- src/gui/widgets/PixmapButton.cpp | 6 +-- src/gui/widgets/PositionLine.cpp | 6 +++ src/gui/widgets/ProjectNotes.cpp | 5 ++ src/gui/widgets/RenameDialog.cpp | 5 ++ src/gui/widgets/Rubberband.cpp | 9 ++-- src/gui/widgets/SendButtonIndicator.cpp | 7 +++ src/gui/widgets/SideBar.cpp | 6 ++- src/gui/widgets/SideBarWidget.cpp | 7 +-- src/gui/widgets/StepRecorderWidget.cpp | 5 ++ src/gui/widgets/TabBar.cpp | 10 ++-- src/gui/widgets/TabWidget.cpp | 6 +++ src/gui/widgets/TempoSyncKnob.cpp | 6 ++- src/gui/widgets/TextFloat.cpp | 5 +- src/gui/widgets/TimeDisplayWidget.cpp | 4 ++ src/gui/widgets/ToolButton.cpp | 6 +++ src/gui/widgets/ToolTip.cpp | 3 ++ src/gui/widgets/TrackContentWidget.cpp | 6 +++ src/gui/widgets/TrackLabelButton.cpp | 6 ++- src/gui/widgets/TrackOperationsWidget.cpp | 5 ++ src/gui/widgets/TrackRenameLineEdit.cpp | 5 ++ src/tracks/AutomationTrack.cpp | 11 ++-- src/tracks/BBTrack.cpp | 11 ++-- src/tracks/InstrumentTrack.cpp | 11 ++-- src/tracks/Pattern.cpp | 17 +++++-- src/tracks/SampleTrack.cpp | 8 ++- 515 files changed, 3317 insertions(+), 373 deletions(-) diff --git a/include/AboutDialog.h b/include/AboutDialog.h index 93aca988d59..c7d65023fe2 100644 --- a/include/AboutDialog.h +++ b/include/AboutDialog.h @@ -30,6 +30,8 @@ #include "ui_about_dialog.h" +namespace lmms::gui +{ class AboutDialog : public QDialog, public Ui::AboutDialog { @@ -38,6 +40,7 @@ class AboutDialog : public QDialog, public Ui::AboutDialog } ; +} // namespace lmms::gui #endif diff --git a/include/ActionGroup.h b/include/ActionGroup.h index 226e3913625..0fe9d78ed41 100644 --- a/include/ActionGroup.h +++ b/include/ActionGroup.h @@ -28,6 +28,9 @@ #include +namespace lmms::gui +{ + /// \brief Convenience subclass of QActionGroup /// /// This class provides the same functionality as QActionGroup, but in addition @@ -54,4 +57,6 @@ private slots: QList m_actions; }; +} // namespace lmms::gui + #endif diff --git a/include/AudioAlsa.h b/include/AudioAlsa.h index c8452d003e5..8b0438d5cc1 100644 --- a/include/AudioAlsa.h +++ b/include/AudioAlsa.h @@ -37,6 +37,8 @@ #include "AudioDevice.h" +namespace lmms +{ class AudioAlsa : public QThread, public AudioDevice { @@ -102,6 +104,8 @@ class AudioAlsa : public QThread, public AudioDevice } ; +} // namespace lmms + #endif #endif diff --git a/include/AudioAlsaSetupWidget.h b/include/AudioAlsaSetupWidget.h index db88558a75b..1007f493ab2 100644 --- a/include/AudioAlsaSetupWidget.h +++ b/include/AudioAlsaSetupWidget.h @@ -35,8 +35,11 @@ class QComboBox; -class LcdSpinBox; +namespace lmms::gui +{ + +class LcdSpinBox; class AudioAlsaSetupWidget : public AudioDeviceSetupWidget { @@ -59,6 +62,8 @@ public slots: AudioAlsa::DeviceInfoCollection m_deviceInfos; }; +} // namespace lmms::gui + #endif #endif diff --git a/include/AudioDevice.h b/include/AudioDevice.h index d635efa09c8..460080294bd 100644 --- a/include/AudioDevice.h +++ b/include/AudioDevice.h @@ -30,10 +30,13 @@ #include "lmms_basics.h" +class QThread; + +namespace lmms +{ class AudioEngine; class AudioPort; -class QThread; class AudioDevice @@ -153,7 +156,8 @@ class AudioDevice surroundSampleFrame * m_buffer; -} ; +}; +} // namespace lmms #endif diff --git a/include/AudioDeviceSetupWidget.h b/include/AudioDeviceSetupWidget.h index 9b82300bbc0..6bf656e0a7f 100644 --- a/include/AudioDeviceSetupWidget.h +++ b/include/AudioDeviceSetupWidget.h @@ -27,6 +27,8 @@ #include "TabWidget.h" +namespace lmms::gui +{ class AudioDeviceSetupWidget : public TabWidget { @@ -41,5 +43,6 @@ class AudioDeviceSetupWidget : public TabWidget virtual void show(); }; +} // namespace lmms::gui #endif diff --git a/include/AudioDummy.h b/include/AudioDummy.h index a0f2c528e8e..f2c198bbc33 100644 --- a/include/AudioDummy.h +++ b/include/AudioDummy.h @@ -30,6 +30,8 @@ #include "AudioEngine.h" #include "MicroTimer.h" +namespace lmms +{ class AudioDummy : public QThread, public AudioDevice { @@ -52,11 +54,11 @@ class AudioDummy : public QThread, public AudioDevice } - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ) : - AudioDeviceSetupWidget( AudioDummy::name(), _parent ) + gui::AudioDeviceSetupWidget( AudioDummy::name(), _parent ) { } @@ -114,5 +116,6 @@ class AudioDummy : public QThread, public AudioDevice } ; +} // namespace lmms #endif diff --git a/include/AudioEngine.h b/include/AudioEngine.h index 93770ef728a..efeb4fb970c 100644 --- a/include/AudioEngine.h +++ b/include/AudioEngine.h @@ -40,6 +40,9 @@ #include "PlayHandle.h" +namespace lmms +{ + class AudioDevice; class MidiClient; class AudioPort; @@ -435,4 +438,6 @@ class LMMS_EXPORT AudioEngine : public QObject friend class ProjectRenderer; } ; +} // namespace lmms + #endif diff --git a/include/AudioEngineProfiler.h b/include/AudioEngineProfiler.h index 19f0b612b38..136c6dbea1e 100644 --- a/include/AudioEngineProfiler.h +++ b/include/AudioEngineProfiler.h @@ -30,6 +30,9 @@ #include "lmms_basics.h" #include "MicroTimer.h" +namespace lmms +{ + class AudioEngineProfiler { public: @@ -57,4 +60,6 @@ class AudioEngineProfiler QFile m_outputFile; }; +} // namespace lmms + #endif diff --git a/include/AudioEngineWorkerThread.h b/include/AudioEngineWorkerThread.h index 546a963b3b6..bb3184e4506 100644 --- a/include/AudioEngineWorkerThread.h +++ b/include/AudioEngineWorkerThread.h @@ -29,8 +29,12 @@ #include -class AudioEngine; class QWaitCondition; + +namespace lmms +{ + +class AudioEngine; class ThreadableJob; class AudioEngineWorkerThread : public QThread @@ -115,5 +119,6 @@ class AudioEngineWorkerThread : public QThread volatile bool m_quit; } ; +} // namespace lmms #endif diff --git a/include/AudioFileDevice.h b/include/AudioFileDevice.h index cdcd407e18b..0975773845a 100644 --- a/include/AudioFileDevice.h +++ b/include/AudioFileDevice.h @@ -31,6 +31,8 @@ #include "AudioDevice.h" #include "OutputSettings.h" +namespace lmms +{ class AudioFileDevice : public AudioDevice { @@ -74,5 +76,6 @@ typedef AudioFileDevice * ( * AudioFileDeviceInstantiaton ) AudioEngine* audioEngine, bool & successful ); +} // namespace lmms #endif diff --git a/include/AudioFileFlac.h b/include/AudioFileFlac.h index 75e86d36827..675ab21d9ec 100644 --- a/include/AudioFileFlac.h +++ b/include/AudioFileFlac.h @@ -30,6 +30,9 @@ #include "AudioFileDevice.h" #include +namespace lmms +{ + class AudioFileFlac: public AudioFileDevice { public: @@ -71,4 +74,7 @@ class AudioFileFlac: public AudioFileDevice }; + +} // namespace lmms + #endif //AUDIO_FILE_FLAC_H diff --git a/include/AudioFileMP3.h b/include/AudioFileMP3.h index ab72ed68918..39d52e3c624 100644 --- a/include/AudioFileMP3.h +++ b/include/AudioFileMP3.h @@ -34,6 +34,8 @@ #include "lame/lame.h" +namespace lmms +{ class AudioFileMP3 : public AudioFileDevice { @@ -69,6 +71,8 @@ class AudioFileMP3 : public AudioFileDevice lame_t m_lame; }; +} // namespace lmms + #endif #endif diff --git a/include/AudioFileOgg.h b/include/AudioFileOgg.h index 9c7337e9cd5..ae60bbfcc22 100644 --- a/include/AudioFileOgg.h +++ b/include/AudioFileOgg.h @@ -34,6 +34,8 @@ #include "AudioFileDevice.h" +namespace lmms +{ class AudioFileOgg : public AudioFileDevice { @@ -107,6 +109,8 @@ class AudioFileOgg : public AudioFileDevice } ; +} // namespace lmms + #endif #endif diff --git a/include/AudioFileWave.h b/include/AudioFileWave.h index d8e537859f8..e9425dd86aa 100644 --- a/include/AudioFileWave.h +++ b/include/AudioFileWave.h @@ -31,6 +31,8 @@ #include +namespace lmms +{ class AudioFileWave : public AudioFileDevice { @@ -66,4 +68,7 @@ class AudioFileWave : public AudioFileDevice SNDFILE * m_sf; } ; + +} // namespace lmms + #endif diff --git a/include/AudioJack.h b/include/AudioJack.h index ca65b0f96ed..dd1e5afd3d9 100644 --- a/include/AudioJack.h +++ b/include/AudioJack.h @@ -43,9 +43,17 @@ #include "AudioDeviceSetupWidget.h" class QLineEdit; -class LcdSpinBox; + +namespace lmms +{ + class MidiJack; +namespace gui +{ +class LcdSpinBox; +} + class AudioJack : public QObject, public AudioDevice { @@ -68,7 +76,7 @@ class AudioJack : public QObject, public AudioDevice } - class setupWidget : public AudioDeviceSetupWidget +class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -78,7 +86,7 @@ class AudioJack : public QObject, public AudioDevice private: QLineEdit * m_clientName; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; @@ -134,6 +142,8 @@ private slots: } ; +} // namespace lmms + #endif #endif diff --git a/include/AudioOss.h b/include/AudioOss.h index b1b5d839ccd..14fb3e147cc 100644 --- a/include/AudioOss.h +++ b/include/AudioOss.h @@ -34,9 +34,16 @@ #include "AudioDevice.h" #include "AudioDeviceSetupWidget.h" +class QLineEdit; + +namespace lmms +{ +namespace gui +{ class LcdSpinBox; -class QLineEdit; +} + class AudioOss : public QThread, public AudioDevice @@ -54,7 +61,7 @@ class AudioOss : public QThread, public AudioDevice static QString probeDevice(); - class setupWidget : public AudioDeviceSetupWidget +class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -64,7 +71,7 @@ class AudioOss : public QThread, public AudioDevice private: QLineEdit * m_device; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; @@ -81,6 +88,7 @@ class AudioOss : public QThread, public AudioDevice } ; +} // namespace lmms #endif diff --git a/include/AudioPort.h b/include/AudioPort.h index 5ce4fbc8aa3..3777738b5ed 100644 --- a/include/AudioPort.h +++ b/include/AudioPort.h @@ -33,6 +33,9 @@ #include "MemoryManager.h" #include "PlayHandle.h" +namespace lmms +{ + class EffectChain; class FloatModel; class BoolModel; @@ -134,5 +137,6 @@ class AudioPort : public ThreadableJob } ; +} // namespace lmms #endif diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index 763703c33a4..ef7f4e6f5ae 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -30,6 +30,9 @@ #include "lmmsconfig.h" #include "ComboBoxModel.h" +namespace lmms +{ + class AudioPortAudioSetupUtil : public QObject { Q_OBJECT @@ -59,9 +62,11 @@ public slots: # define PORTAUDIO_V18 #endif - +namespace gui +{ class ComboBox; class LcdSpinBox; +} // namespace gui class AudioPortAudio : public AudioDevice @@ -81,7 +86,7 @@ class AudioPortAudio : public AudioDevice unsigned long _framesPerBuffer ); - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -91,8 +96,8 @@ class AudioPortAudio : public AudioDevice virtual void show(); private: - ComboBox * m_backend; - ComboBox * m_device; + gui::ComboBox * m_backend; + gui::ComboBox * m_device; AudioPortAudioSetupUtil m_setupUtil; } ; @@ -150,6 +155,8 @@ class AudioPortAudio : public AudioDevice } ; +} // namespace lmms + #endif #endif diff --git a/include/AudioPulseAudio.h b/include/AudioPulseAudio.h index 3fe098d689e..70da0808763 100644 --- a/include/AudioPulseAudio.h +++ b/include/AudioPulseAudio.h @@ -36,9 +36,15 @@ #include "AudioDevice.h" #include "AudioDeviceSetupWidget.h" +class QLineEdit; + +namespace lmms +{ +namespace gui +{ class LcdSpinBox; -class QLineEdit; +} class AudioPulseAudio : public QThread, public AudioDevice @@ -56,7 +62,7 @@ class AudioPulseAudio : public QThread, public AudioDevice static QString probeDevice(); - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -66,7 +72,7 @@ class AudioPulseAudio : public QThread, public AudioDevice private: QLineEdit * m_device; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; @@ -94,6 +100,8 @@ class AudioPulseAudio : public QThread, public AudioDevice } ; +} // namespace lmms + #endif #endif diff --git a/include/AudioSampleRecorder.h b/include/AudioSampleRecorder.h index 76cb7e1a451..7097ea51d92 100644 --- a/include/AudioSampleRecorder.h +++ b/include/AudioSampleRecorder.h @@ -31,6 +31,9 @@ #include "AudioDevice.h" +namespace lmms +{ + class SampleBuffer; @@ -54,5 +57,6 @@ class AudioSampleRecorder : public AudioDevice } ; +} // namespace lmms #endif diff --git a/include/AudioSdl.h b/include/AudioSdl.h index 1e6c03358bc..08a7362f103 100644 --- a/include/AudioSdl.h +++ b/include/AudioSdl.h @@ -42,6 +42,8 @@ class QLineEdit; +namespace lmms +{ class AudioSdl : public AudioDevice { @@ -56,7 +58,7 @@ class AudioSdl : public AudioDevice } - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -109,6 +111,9 @@ class AudioSdl : public AudioDevice } ; + +} // namespace lmms + #endif #endif diff --git a/include/AudioSndio.h b/include/AudioSndio.h index 94fcfa93b66..5fb7c78fce4 100644 --- a/include/AudioSndio.h +++ b/include/AudioSndio.h @@ -36,9 +36,16 @@ #include "AudioDevice.h" #include "AudioDeviceSetupWidget.h" -class LcdSpinBox; class QLineEdit; +namespace lmms +{ + +namespace gui +{ +class LcdSpinBox; +} + class AudioSndio : public QThread, public AudioDevice { @@ -52,7 +59,7 @@ class AudioSndio : public QThread, public AudioDevice return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "sndio" ); } - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -62,7 +69,7 @@ class AudioSndio : public QThread, public AudioDevice private: QLineEdit * m_device; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; private: @@ -78,6 +85,8 @@ class AudioSndio : public QThread, public AudioDevice } ; +} // namespace lmms + #endif /* LMMS_HAVE_SNDIO */ #endif /* _AUDIO_SNDIO_H */ diff --git a/include/AudioSoundIo.h b/include/AudioSoundIo.h index 17102203222..fc9add5dd97 100644 --- a/include/AudioSoundIo.h +++ b/include/AudioSoundIo.h @@ -37,8 +37,14 @@ #include "AudioDevice.h" #include "AudioDeviceSetupWidget.h" +namespace lmms +{ + +namespace gui +{ class ComboBox; class LcdSpinBox; +} // Exists only to work around "Error: Meta object features not supported for nested classes" class AudioSoundIoSetupUtil : public QObject @@ -134,6 +140,9 @@ class AudioSoundIo : public AudioDevice }; + +} // namespace lmms + #endif #endif diff --git a/include/AutomatableButton.h b/include/AutomatableButton.h index d7859a10c15..fefaf70e398 100644 --- a/include/AutomatableButton.h +++ b/include/AutomatableButton.h @@ -30,6 +30,8 @@ #include "AutomatableModelView.h" +namespace lmms::gui +{ class automatableButtonGroup; @@ -105,5 +107,6 @@ private slots: } ; +} // namespace lmms::gui #endif diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 88faeb4bea7..4a7a2348079 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -35,6 +35,10 @@ #include "MemoryManager.h" #include "ModelVisitor.h" + +namespace lmms +{ + // simple way to map a property of a view to a model #define mapPropertyFromModelPtr(type,getfunc,setfunc,modelname) \ public: \ @@ -502,5 +506,8 @@ class LMMS_EXPORT BoolModel : public TypedAutomatableModel typedef QMap AutomatedValueMap; + +} // namespace lmms + #endif diff --git a/include/AutomatableModelView.h b/include/AutomatableModelView.h index a5996118595..58ff6fdf1f3 100644 --- a/include/AutomatableModelView.h +++ b/include/AutomatableModelView.h @@ -32,6 +32,9 @@ class QMenu; class QMouseEvent; +namespace lmms +{ + class LMMS_EXPORT AutomatableModelView : public ModelView { public: @@ -132,5 +135,7 @@ using FloatModelView = TypedModelView; using IntModelView = TypedModelView; using BoolModelView = TypedModelView; +} // namespace lmms + #endif diff --git a/include/AutomatableSlider.h b/include/AutomatableSlider.h index b51ef1e3ff2..d6a95f5d8ea 100644 --- a/include/AutomatableSlider.h +++ b/include/AutomatableSlider.h @@ -31,6 +31,8 @@ #include "AutomatableModelView.h" +namespace lmms::gui +{ class AutomatableSlider : public QSlider, public IntModelView { @@ -73,5 +75,6 @@ private slots: typedef IntModel sliderModel; +} // namespace lmms::gui #endif diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index e11600c71f2..02fd882a133 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -42,8 +42,16 @@ class QPainter; class QPixmap; class QScrollBar; -class ComboBox; +namespace lmms +{ class NotePlayHandle; +} + +namespace lmms::gui +{ + + +class ComboBox; class TimeLineWidget; @@ -295,4 +303,6 @@ private slots: }; +} // namespace lmms::gui + #endif diff --git a/include/AutomationNode.h b/include/AutomationNode.h index 0dbb4c649f2..d77adddacc7 100644 --- a/include/AutomationNode.h +++ b/include/AutomationNode.h @@ -26,6 +26,9 @@ #ifndef AUTOMATION_NODE_H #define AUTOMATION_NODE_H +namespace lmms +{ + class AutomationPattern; @@ -151,5 +154,6 @@ class AutomationNode float m_outTangent; }; +} // namespace lmms #endif diff --git a/include/AutomationPattern.h b/include/AutomationPattern.h index 61a8af41630..bca0701089a 100644 --- a/include/AutomationPattern.h +++ b/include/AutomationPattern.h @@ -34,6 +34,9 @@ #include "TrackContentObject.h" +namespace lmms +{ + class AutomationTrack; class TimePos; @@ -152,7 +155,7 @@ class LMMS_EXPORT AutomationPattern : public TrackContentObject static const QString classNodeName() { return "automationpattern"; } QString nodeName() const override { return classNodeName(); } - TrackContentObjectView * createView( TrackView * _tv ) override; + gui::TrackContentObjectView * createView( gui::TrackView * _tv ) override; static bool isAutomated( const AutomatableModel * _m ); @@ -242,4 +245,7 @@ inline int POS(AutomationPattern::TimemapIterator it) return it.key(); } + +} // namespace lmms + #endif diff --git a/include/AutomationPatternView.h b/include/AutomationPatternView.h index 5e7b12977af..664346684c3 100644 --- a/include/AutomationPatternView.h +++ b/include/AutomationPatternView.h @@ -33,6 +33,9 @@ #include "TrackContentObjectView.h" +namespace lmms::gui +{ + class AutomationPatternView : public TrackContentObjectView { Q_OBJECT @@ -76,4 +79,6 @@ protected slots: } ; +} // lmms::gui + #endif diff --git a/include/AutomationTrack.h b/include/AutomationTrack.h index ee55c31acd8..48010518b3c 100644 --- a/include/AutomationTrack.h +++ b/include/AutomationTrack.h @@ -29,6 +29,8 @@ #include "Track.h" +namespace lmms +{ class AutomationTrack : public Track { @@ -45,7 +47,7 @@ class AutomationTrack : public Track return "automationtrack"; } - TrackView * createView( TrackContainerView* ) override; + gui::TrackView* createView( gui::TrackContainerView* ) override; TrackContentObject* createTCO(const TimePos & pos) override; virtual void saveTrackSpecificSettings( QDomDocument & _doc, @@ -58,4 +60,6 @@ class AutomationTrack : public Track } ; +} // namespace lmms + #endif diff --git a/include/AutomationTrackView.h b/include/AutomationTrackView.h index 148c05b6f5a..18ef3f74382 100644 --- a/include/AutomationTrackView.h +++ b/include/AutomationTrackView.h @@ -29,6 +29,8 @@ #include "AutomationTrack.h" #include "TrackView.h" +namespace lmms::gui +{ class AutomationTrackView : public TrackView { @@ -41,4 +43,6 @@ class AutomationTrackView : public TrackView } ; +} // namespace lmms::gui + #endif diff --git a/include/BBEditor.h b/include/BBEditor.h index d02dc198b64..41431cd906c 100644 --- a/include/BBEditor.h +++ b/include/BBEditor.h @@ -30,10 +30,15 @@ #include "Editor.h" #include "TrackContainerView.h" +namespace lmms +{ class BBTrackContainer; -class ComboBox; +namespace gui +{ + +class ComboBox; class BBTrackContainerView; class BBEditor : public Editor @@ -99,4 +104,9 @@ protected slots: }; +} // namespace gui + + +} // namespace lmms + #endif diff --git a/include/BBTCO.h b/include/BBTCO.h index 8a0ba49bd3e..13bae1be785 100644 --- a/include/BBTCO.h +++ b/include/BBTCO.h @@ -28,6 +28,8 @@ #include "TrackContentObjectView.h" +namespace lmms +{ class BBTCO : public TrackContentObject { @@ -44,12 +46,13 @@ class BBTCO : public TrackContentObject int bbTrackIndex(); - TrackContentObjectView * createView( TrackView * _tv ) override; + gui::TrackContentObjectView * createView( gui::TrackView * _tv ) override; private: friend class BBTCOView; } ; +} // namespace lmms #endif \ No newline at end of file diff --git a/include/BBTCOView.h b/include/BBTCOView.h index 13c65ba5873..4f7ecd00b48 100644 --- a/include/BBTCOView.h +++ b/include/BBTCOView.h @@ -31,6 +31,9 @@ #include +namespace lmms::gui +{ + class BBTCOView : public TrackContentObjectView { Q_OBJECT @@ -62,5 +65,6 @@ protected slots: } ; +} // namespace lmms::gui #endif \ No newline at end of file diff --git a/include/BBTrack.h b/include/BBTrack.h index da578ffc8d1..1467765ad4f 100644 --- a/include/BBTrack.h +++ b/include/BBTrack.h @@ -33,9 +33,19 @@ #include "BBTCOView.h" #include "Track.h" -class TrackLabelButton; +namespace lmms +{ + class TrackContainer; +namespace gui +{ + +class TrackLabelButton; +class BBTrackView; + +} // namespace gui + class LMMS_EXPORT BBTrack : public Track { @@ -46,7 +56,7 @@ class LMMS_EXPORT BBTrack : public Track virtual bool play( const TimePos & _start, const fpp_t _frames, const f_cnt_t _frame_base, int _tco_num = -1 ) override; - TrackView * createView( TrackContainerView* tcv ) override; + gui::TrackView * createView( gui::TrackContainerView* tcv ) override; TrackContentObject* createTCO(const TimePos & pos) override; virtual void saveTrackSpecificSettings( QDomDocument & _doc, @@ -87,9 +97,11 @@ class LMMS_EXPORT BBTrack : public Track typedef QMap infoMap; static infoMap s_infoMap; - friend class BBTrackView; + friend class gui::BBTrackView; } ; +} // namespace lmms + #endif diff --git a/include/BBTrackContainer.h b/include/BBTrackContainer.h index 79bf2e31565..0bbcb25a592 100644 --- a/include/BBTrackContainer.h +++ b/include/BBTrackContainer.h @@ -30,6 +30,9 @@ #include "ComboBoxModel.h" +namespace lmms +{ + class LMMS_EXPORT BBTrackContainer : public TrackContainer { Q_OBJECT @@ -79,4 +82,6 @@ public slots: } ; +} // namespace lmms + #endif diff --git a/include/BBTrackView.h b/include/BBTrackView.h index 86c10cd305d..afaf82ede6a 100644 --- a/include/BBTrackView.h +++ b/include/BBTrackView.h @@ -32,6 +32,9 @@ #include "TrackView.h" +namespace lmms::gui +{ + class BBTrackView : public TrackView { Q_OBJECT @@ -58,4 +61,6 @@ public slots: +} // namespace lmms::gui + #endif \ No newline at end of file diff --git a/include/BandLimitedWave.h b/include/BandLimitedWave.h index 1cd8d69ed47..30d28d4a126 100644 --- a/include/BandLimitedWave.h +++ b/include/BandLimitedWave.h @@ -36,6 +36,9 @@ class QString; #include "Engine.h" #include "AudioEngine.h" +namespace lmms +{ + constexpr int MAXLEN = 11; constexpr int MIPMAPSIZE = 2 << ( MAXLEN + 1 ); constexpr int MIPMAPSIZE3 = 3 << ( MAXLEN + 1 ); @@ -168,5 +171,6 @@ class LMMS_EXPORT BandLimitedWave static QString s_wavetableDir; }; +} // namespace lmms #endif diff --git a/include/BasicFilters.h b/include/BasicFilters.h index 180a5c8af8a..f9be5b27838 100644 --- a/include/BasicFilters.h +++ b/include/BasicFilters.h @@ -43,6 +43,9 @@ #include "interpolation.h" #include "MemoryManager.h" +namespace lmms +{ + template class BasicFilters; template @@ -913,4 +916,6 @@ class BasicFilters } ; +} // namespace lmms + #endif diff --git a/include/BufferManager.h b/include/BufferManager.h index b8a1a4f2f61..886316b57fd 100644 --- a/include/BufferManager.h +++ b/include/BufferManager.h @@ -29,6 +29,10 @@ #include "lmms_export.h" #include "lmms_basics.h" +namespace lmms +{ + + class LMMS_EXPORT BufferManager { public: @@ -44,8 +48,10 @@ class LMMS_EXPORT BufferManager static void release( sampleFrame * buf ); private: - static fpp_t framesPerPeriod; }; + +} // namespace lmms + #endif diff --git a/include/CPULoadWidget.h b/include/CPULoadWidget.h index 2bc41283b0d..a3b02fa5729 100644 --- a/include/CPULoadWidget.h +++ b/include/CPULoadWidget.h @@ -34,6 +34,10 @@ #include "lmms_basics.h" +namespace lmms::gui +{ + + class CPULoadWidget : public QWidget { Q_OBJECT @@ -64,4 +68,6 @@ protected slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/CaptionMenu.h b/include/CaptionMenu.h index e6531fe3166..2309cec6fd4 100644 --- a/include/CaptionMenu.h +++ b/include/CaptionMenu.h @@ -30,6 +30,9 @@ #include "lmms_export.h" +namespace lmms::gui +{ + /// /// \brief A context menu with a caption /// @@ -42,6 +45,6 @@ class LMMS_EXPORT CaptionMenu : public QMenu } ; - +} // namespace lmms::gui #endif diff --git a/include/Clipboard.h b/include/Clipboard.h index 5aa03d8d842..1a538edccea 100644 --- a/include/Clipboard.h +++ b/include/Clipboard.h @@ -30,8 +30,9 @@ class QMimeData; -namespace Clipboard +namespace lmms::Clipboard { + enum class MimeType { StringPair, @@ -64,6 +65,7 @@ namespace Clipboard break; } } -} ; + +} // namespace lmms::Clipboard #endif diff --git a/include/ColorChooser.h b/include/ColorChooser.h index ac2a1b62d4a..a5a952c002b 100644 --- a/include/ColorChooser.h +++ b/include/ColorChooser.h @@ -27,6 +27,10 @@ #include #include +namespace lmms::gui +{ + + class ColorChooser: public QColorDialog { public: @@ -57,3 +61,6 @@ class ColorChooser: public QColorDialog //! Generate a nice palette, with adjustable value static QVector nicePalette (int); }; + + +} // namespace lmms::gui diff --git a/include/ComboBox.h b/include/ComboBox.h index 1f7dd43ffcd..412279d15bb 100644 --- a/include/ComboBox.h +++ b/include/ComboBox.h @@ -32,6 +32,9 @@ #include "ComboBoxModel.h" #include "AutomatableModelView.h" +namespace lmms::gui +{ + class LMMS_EXPORT ComboBox : public QWidget, public IntModelView { Q_OBJECT @@ -78,4 +81,6 @@ private slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/ComboBoxModel.h b/include/ComboBoxModel.h index 09ad1238a6c..5bc398378e3 100644 --- a/include/ComboBoxModel.h +++ b/include/ComboBoxModel.h @@ -33,6 +33,8 @@ #include "AutomatableModel.h" #include "embed.h" +namespace lmms +{ class LMMS_EXPORT ComboBoxModel : public IntModel { @@ -92,5 +94,6 @@ class LMMS_EXPORT ComboBoxModel : public IntModel } ; +} // namespace lmms #endif diff --git a/include/ConfigManager.h b/include/ConfigManager.h index 8a3d8073b23..46413457687 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -37,6 +37,10 @@ #include "lmms_export.h" +namespace lmms +{ + + class LmmsCore; const QString PROJECTS_PATH = "projects/"; @@ -305,4 +309,8 @@ class LMMS_EXPORT ConfigManager : public QObject friend class LmmsCore; }; + + +} // namespace lmms + #endif diff --git a/include/ControlLayout.h b/include/ControlLayout.h index 60182010792..f9974092324 100644 --- a/include/ControlLayout.h +++ b/include/ControlLayout.h @@ -80,6 +80,10 @@ class QLayoutItem; class QRect; class QString; + +namespace lmms::gui +{ + /** Layout for controls (models) @@ -133,4 +137,6 @@ private slots: static constexpr const char* s_searchBarName = "!!searchBar!!"; }; +} // namespace lmms::gui + #endif // CONTROLLAYOUT_H diff --git a/include/Controller.h b/include/Controller.h index 092c684e06f..c2e5205d284 100644 --- a/include/Controller.h +++ b/include/Controller.h @@ -33,10 +33,20 @@ #include "JournallingObject.h" #include "ValueBuffer.h" -class ControllerDialog; +namespace lmms +{ + class Controller; class ControllerConnection; +namespace gui +{ + +class ControllerDialog; + +} // namespace gui + + typedef QVector ControllerVector; @@ -132,7 +142,7 @@ class LMMS_EXPORT Controller : public Model, public JournallingObject bool hasModel( const Model * m ) const; public slots: - virtual ControllerDialog * createDialog( QWidget * _parent ); + virtual gui::ControllerDialog * createDialog( QWidget * _parent ); virtual void setName( const QString & _new_name ) { @@ -169,9 +179,12 @@ public slots: // The value changed while the audio engine isn't running (i.e: MIDI CC) void valueChanged(); - friend class ControllerDialog; + friend class gui::ControllerDialog; } ; + +} // namespace lmms + #endif diff --git a/include/ControllerConnection.h b/include/ControllerConnection.h index 4c5673c8dd3..3618dd077f5 100644 --- a/include/ControllerConnection.h +++ b/include/ControllerConnection.h @@ -37,8 +37,16 @@ #include "JournallingObject.h" #include "ValueBuffer.h" +namespace lmms +{ + class ControllerConnection; +namespace gui +{ +class ControllerConnectionDialog; +} + typedef QVector ControllerConnectionVector; @@ -115,8 +123,11 @@ public slots: // The value changed while the audio engine isn't running (i.e: MIDI CC) void valueChanged(); - friend class ControllerConnectionDialog; + friend class gui::ControllerConnectionDialog; }; + +} // namespace lmms + #endif diff --git a/include/ControllerConnectionDialog.h b/include/ControllerConnectionDialog.h index 95e55ce79d8..62980987f1b 100644 --- a/include/ControllerConnectionDialog.h +++ b/include/ControllerConnectionDialog.h @@ -38,7 +38,15 @@ class QLineEdit; class QListView; class QScrollArea; + +namespace lmms +{ + class AutoDetectMidiController; + +namespace gui +{ + class ComboBox; class GroupBox; class TabWidget; @@ -47,7 +55,6 @@ class LedCheckBox; class MidiPortMenu; - class ControllerConnectionDialog : public QDialog { Q_OBJECT @@ -99,4 +106,9 @@ protected slots: AutoDetectMidiController * m_midiController; } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ControllerDialog.h b/include/ControllerDialog.h index 05e8f3bfedb..0592cadf34d 100644 --- a/include/ControllerDialog.h +++ b/include/ControllerDialog.h @@ -30,8 +30,13 @@ #include "ModelView.h" +namespace lmms +{ + class Controller; +namespace gui +{ class ControllerDialog : public QWidget, public ModelView { @@ -51,4 +56,9 @@ class ControllerDialog : public QWidget, public ModelView } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ControllerRackView.h b/include/ControllerRackView.h index 9ef2d9b7ff4..6c6c8f958c7 100644 --- a/include/ControllerRackView.h +++ b/include/ControllerRackView.h @@ -36,9 +36,17 @@ class QPushButton; class QScrollArea; class QVBoxLayout; -class ControllerView; + +namespace lmms +{ + class Controller; +namespace gui +{ + +class ControllerView; + class ControllerRackView : public QWidget, public SerializingObject { @@ -80,4 +88,8 @@ private slots: int m_nextIndex; } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ControllerView.h b/include/ControllerView.h index d1284845eee..3e11ee66deb 100644 --- a/include/ControllerView.h +++ b/include/ControllerView.h @@ -36,6 +36,10 @@ class QLabel; class QPushButton; class QMdiSubWindow; +namespace lmms::gui +{ + + class LedCheckBox; @@ -81,4 +85,7 @@ public slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Controls.h b/include/Controls.h index 236abbc1199..44fc29f9751 100644 --- a/include/Controls.h +++ b/include/Controls.h @@ -35,8 +35,14 @@ class QString; class QWidget; + +namespace lmms +{ + class AutomatableModel; +namespace gui +{ /** These classes provide @@ -131,4 +137,8 @@ class CheckControl : public Control }; +} // namespace gui + +} // namespace lmms + #endif // CONTROLS_H diff --git a/include/CustomTextKnob.h b/include/CustomTextKnob.h index aa7b9d57339..403799ff018 100644 --- a/include/CustomTextKnob.h +++ b/include/CustomTextKnob.h @@ -4,6 +4,10 @@ #include "Knob.h" +namespace lmms::gui +{ + + class LMMS_EXPORT CustomTextKnob : public Knob { protected: @@ -27,4 +31,7 @@ class LMMS_EXPORT CustomTextKnob : public Knob QString m_value_text; } ; + +} // namespace lmms::gui + #endif diff --git a/include/DataFile.h b/include/DataFile.h index b504f93cb17..dd35a3d1c79 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -36,6 +36,9 @@ class QTextStream; +namespace lmms +{ + class LMMS_EXPORT DataFile : public QDomDocument { MM_OPERATORS @@ -153,4 +156,6 @@ class LMMS_EXPORT DataFile : public QDomDocument } ; +} // namespace lmms + #endif diff --git a/include/Delay.h b/include/Delay.h index 5be1ac183ad..404782f90b6 100644 --- a/include/Delay.h +++ b/include/Delay.h @@ -32,6 +32,9 @@ #include "interpolation.h" #include "MemoryManager.h" +namespace lmms +{ + // brief usage // Classes: @@ -360,4 +363,7 @@ typedef CombFeedfwd<2> StereoCombFeedfwd; typedef CombFeedbackDualtap<2> StereoCombFeedbackDualtap; typedef AllpassDelay<2> StereoAllpassDelay; + +} // namespace lmms + #endif diff --git a/include/DeprecationHelper.h b/include/DeprecationHelper.h index bef4ea9b954..7543e85a059 100644 --- a/include/DeprecationHelper.h +++ b/include/DeprecationHelper.h @@ -30,6 +30,9 @@ #include #include +namespace lmms +{ + /** * @brief horizontalAdvance is a backwards-compatible adapter for * QFontMetrics::horizontalAdvance and width functions. @@ -61,3 +64,5 @@ inline QPoint position(QWheelEvent *wheelEvent) #endif } #endif // DEPRECATIONHELPER_H + +} // namespace lmms diff --git a/include/DetuningHelper.h b/include/DetuningHelper.h index 2157b6ba828..7444b8b22e5 100644 --- a/include/DetuningHelper.h +++ b/include/DetuningHelper.h @@ -29,6 +29,9 @@ #include "InlineAutomation.h" #include "MemoryManager.h" +namespace lmms +{ + class DetuningHelper : public InlineAutomation { Q_OBJECT @@ -61,4 +64,6 @@ class DetuningHelper : public InlineAutomation } ; +} // namespace lmms + #endif diff --git a/include/DrumSynth.h b/include/DrumSynth.h index f7e9b1d4c3e..79383a6d49b 100644 --- a/include/DrumSynth.h +++ b/include/DrumSynth.h @@ -32,6 +32,9 @@ class QString; +namespace lmms +{ + class DrumSynth { public: DrumSynth() {}; @@ -51,4 +54,7 @@ class DrumSynth { }; + +} // namespace lmms + #endif diff --git a/include/DspEffectLibrary.h b/include/DspEffectLibrary.h index bf175df6d7c..1e10de2ebe7 100644 --- a/include/DspEffectLibrary.h +++ b/include/DspEffectLibrary.h @@ -31,7 +31,7 @@ #include "lmms_basics.h" -namespace DspEffectLibrary +namespace lmms::DspEffectLibrary { template @@ -329,7 +329,7 @@ namespace DspEffectLibrary } ; -} ; +} // namespace lmms::DspEffectLibaray #endif diff --git a/include/DummyEffect.h b/include/DummyEffect.h index 92bfd5bdd79..e777ba6e4a8 100644 --- a/include/DummyEffect.h +++ b/include/DummyEffect.h @@ -30,6 +30,12 @@ #include "EffectControlDialog.h" +namespace lmms +{ + +namespace gui +{ + class DummyEffectControlDialog : public EffectControlDialog { public: @@ -40,6 +46,7 @@ class DummyEffectControlDialog : public EffectControlDialog } ; +} class DummyEffectControls : public EffectControls { @@ -71,9 +78,9 @@ class DummyEffectControls : public EffectControls return "DummyControls"; } - EffectControlDialog * createView() override + gui::EffectControlDialog * createView() override { - return new DummyEffectControlDialog( this ); + return new gui::DummyEffectControlDialog( this ); } } ; @@ -140,4 +147,6 @@ class DummyEffect : public Effect } ; +} // namespace lmms + #endif diff --git a/include/DummyInstrument.h b/include/DummyInstrument.h index bbc112f9636..a5005a25748 100644 --- a/include/DummyInstrument.h +++ b/include/DummyInstrument.h @@ -35,6 +35,10 @@ #include "AudioEngine.h" +namespace lmms +{ + + class DummyInstrument : public Instrument { public: @@ -66,11 +70,13 @@ class DummyInstrument : public Instrument return "dummyinstrument"; } - PluginView * instantiateView( QWidget * _parent ) override + gui::PluginView * instantiateView( QWidget * _parent ) override { - return new InstrumentViewFixedSize( this, _parent ); + return new gui::InstrumentViewFixedSize( this, _parent ); } } ; +} // namespace lmms + #endif diff --git a/include/DummyPlugin.h b/include/DummyPlugin.h index 61a399889b1..313649526d9 100644 --- a/include/DummyPlugin.h +++ b/include/DummyPlugin.h @@ -30,6 +30,9 @@ #include "PluginView.h" +namespace lmms +{ + class DummyPlugin : public Plugin { public: @@ -57,12 +60,14 @@ class DummyPlugin : public Plugin protected: - PluginView * instantiateView( QWidget * _parent ) override + gui::PluginView * instantiateView( QWidget * _parent ) override { - return new PluginView( this, _parent ); + return new gui::PluginView( this, _parent ); } } ; +} // namesplace lmms + #endif diff --git a/include/Editor.h b/include/Editor.h index d755608a6c9..88cd84654ab 100644 --- a/include/Editor.h +++ b/include/Editor.h @@ -28,14 +28,17 @@ #include #include +class QAction; + +namespace lmms::gui +{ + static const int Quantizations[] = { 1, 2, 4, 8, 16, 32, 64, 3, 6, 12, 24, 48, 96, 192 }; -class QAction; - class DropToolBar; /// \brief Superclass for editors with a toolbar. @@ -108,4 +111,6 @@ class DropToolBar : public QToolBar }; +} // namespace lmms::gui + #endif diff --git a/include/Effect.h b/include/Effect.h index 6d1fea6bf2e..78fc13f8002 100644 --- a/include/Effect.h +++ b/include/Effect.h @@ -33,6 +33,9 @@ #include "TempoSyncKnobModel.h" #include "MemoryManager.h" +namespace lmms +{ + class EffectChain; class EffectControls; @@ -170,7 +173,7 @@ class LMMS_EXPORT Effect : public Plugin */ void checkGate( double _out_sum ); - PluginView * instantiateView( QWidget * ) override; + gui::PluginView* instantiateView( QWidget * ) override; // some effects might not be capable of higher sample-rates so they can // sample it down before processing and back after processing @@ -231,4 +234,6 @@ typedef Effect::Descriptor::SubPluginFeatures::Key EffectKey; typedef Effect::Descriptor::SubPluginFeatures::KeyList EffectKeyList; +} // namespace lmms + #endif diff --git a/include/EffectChain.h b/include/EffectChain.h index 9ebc4d534b3..7e372b0d703 100644 --- a/include/EffectChain.h +++ b/include/EffectChain.h @@ -30,6 +30,9 @@ #include "SerializingObject.h" #include "AutomatableModel.h" +namespace lmms +{ + class Effect; @@ -73,5 +76,7 @@ class LMMS_EXPORT EffectChain : public Model, public SerializingObject } ; +} // namespace lmms + #endif diff --git a/include/EffectControlDialog.h b/include/EffectControlDialog.h index 4a59489da20..e17b28f2aeb 100644 --- a/include/EffectControlDialog.h +++ b/include/EffectControlDialog.h @@ -30,8 +30,15 @@ #include "ModelView.h" +namespace lmms +{ + class EffectControls; +} // namespace lmms + +namespace lmms::gui +{ class LMMS_EXPORT EffectControlDialog : public QWidget, public ModelView { @@ -54,4 +61,6 @@ class LMMS_EXPORT EffectControlDialog : public QWidget, public ModelView } ; +} // namespace lmms::gui + #endif diff --git a/include/EffectControls.h b/include/EffectControls.h index 6af7a7d6c47..b8e7d0041ef 100644 --- a/include/EffectControls.h +++ b/include/EffectControls.h @@ -29,8 +29,16 @@ #include "JournallingObject.h" #include "Effect.h" +namespace lmms +{ + + +namespace gui +{ + class EffectControlDialog; +} // namespace gui class EffectControls : public JournallingObject, public Model { @@ -48,7 +56,7 @@ class EffectControls : public JournallingObject, public Model } virtual int controlCount() = 0; - virtual EffectControlDialog * createView() = 0; + virtual gui::EffectControlDialog * createView() = 0; void setViewVisible( bool _visible ) @@ -73,4 +81,7 @@ class EffectControls : public JournallingObject, public Model } ; + +} // namespace lmms + #endif diff --git a/include/EffectRackView.h b/include/EffectRackView.h index b590d8eb13d..fb38c4fb90b 100644 --- a/include/EffectRackView.h +++ b/include/EffectRackView.h @@ -35,6 +35,9 @@ class QScrollArea; class QVBoxLayout; +namespace lmms::gui +{ + class EffectView; class GroupBox; @@ -83,4 +86,6 @@ private slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/EffectSelectDialog.h b/include/EffectSelectDialog.h index 3e81653dd19..75510ed4c47 100644 --- a/include/EffectSelectDialog.h +++ b/include/EffectSelectDialog.h @@ -35,6 +35,9 @@ namespace Ui { class EffectSelectDialog; } +namespace lmms::gui +{ + class EffectSelectDialog : public QDialog { @@ -66,5 +69,7 @@ protected slots: } ; +} // namespace lmms + #endif diff --git a/include/EffectView.h b/include/EffectView.h index a2509dc5b1f..f99cba48c20 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -35,6 +35,9 @@ class QLabel; class QPushButton; class QMdiSubWindow; +namespace lmms::gui +{ + class EffectControlDialog; class Knob; class LedCheckBox; @@ -90,4 +93,7 @@ public slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Engine.h b/include/Engine.h index 835abc342fc..07994fac2f9 100644 --- a/include/Engine.h +++ b/include/Engine.h @@ -34,6 +34,9 @@ #include "lmms_export.h" #include "lmms_basics.h" +namespace lmms +{ + class AudioEngine; class BBTrackContainer; class FxMixer; @@ -159,5 +162,7 @@ class LMMS_EXPORT LmmsCore : public QObject }; +} // namespace lmms + #endif diff --git a/include/EnvelopeAndLfoParameters.h b/include/EnvelopeAndLfoParameters.h index 0f691adb0bb..8d12bdcf5c1 100644 --- a/include/EnvelopeAndLfoParameters.h +++ b/include/EnvelopeAndLfoParameters.h @@ -33,6 +33,8 @@ #include "TempoSyncKnobModel.h" #include "lmms_basics.h" +namespace lmms +{ class LMMS_EXPORT EnvelopeAndLfoParameters : public Model, public JournallingObject { @@ -183,4 +185,6 @@ public slots: } ; +} // namespace lmms + #endif diff --git a/include/EnvelopeAndLfoView.h b/include/EnvelopeAndLfoView.h index f6d4fd0a8e7..2067f929185 100644 --- a/include/EnvelopeAndLfoView.h +++ b/include/EnvelopeAndLfoView.h @@ -33,8 +33,14 @@ class QPaintEvent; class QPixmap; +namespace lmms +{ + class EnvelopeAndLfoParameters; +namespace gui +{ + class automatableButtonGroup; class Knob; class LedCheckBox; @@ -94,4 +100,8 @@ protected slots: float m_randomGraph; } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ExportFilter.h b/include/ExportFilter.h index dc33c2aa2d6..61378e94fd7 100644 --- a/include/ExportFilter.h +++ b/include/ExportFilter.h @@ -32,6 +32,10 @@ #include "Plugin.h" +namespace lmms +{ + + class LMMS_EXPORT ExportFilter : public Plugin { public: @@ -63,4 +67,6 @@ class LMMS_EXPORT ExportFilter : public Plugin } ; +} // namespace lmms + #endif diff --git a/include/ExportProjectDialog.h b/include/ExportProjectDialog.h index 06c1e3011d1..5e4418a2853 100644 --- a/include/ExportProjectDialog.h +++ b/include/ExportProjectDialog.h @@ -34,6 +34,10 @@ #include "ProjectRenderer.h" #include "RenderManager.h" +namespace lmms::gui +{ + + class ExportProjectDialog : public QDialog, public Ui::ExportProjectDialog { Q_OBJECT @@ -63,4 +67,8 @@ private slots: std::unique_ptr m_renderManager; } ; + +} // namespace lmms::gui + + #endif diff --git a/include/FadeButton.h b/include/FadeButton.h index dfffe93a284..ee0936ca726 100644 --- a/include/FadeButton.h +++ b/include/FadeButton.h @@ -31,6 +31,10 @@ #include +namespace lmms::gui +{ + + class FadeButton : public QAbstractButton { Q_OBJECT @@ -71,4 +75,6 @@ public slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/Fader.h b/include/Fader.h index 10f8c92ef05..1f6b7a7b940 100644 --- a/include/Fader.h +++ b/include/Fader.h @@ -55,6 +55,9 @@ #include "AutomatableModelView.h" +namespace lmms::gui +{ + class TextFloat; @@ -169,4 +172,7 @@ class LMMS_EXPORT Fader : public QWidget, public FloatModelView } ; +} // namespace lmms::gui + + #endif diff --git a/include/FifoBuffer.h b/include/FifoBuffer.h index e41d5caac76..0fa9d14aacd 100644 --- a/include/FifoBuffer.h +++ b/include/FifoBuffer.h @@ -28,6 +28,10 @@ #include +namespace lmms +{ + + template class FifoBuffer { @@ -88,4 +92,6 @@ class FifoBuffer } ; +} // namespace lmms + #endif diff --git a/include/FileBrowser.h b/include/FileBrowser.h index 2e26199fcec..ea7f722f26e 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -37,13 +37,18 @@ class QLineEdit; -class FileItem; +namespace lmms +{ + class InstrumentTrack; -class FileBrowserTreeWidget; class PlayHandle; class TrackContainer; +namespace gui +{ +class FileItem; +class FileBrowserTreeWidget; class FileBrowser : public SideBarWidget { @@ -281,4 +286,8 @@ class FileItem : public QTreeWidgetItem } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/FileDialog.h b/include/FileDialog.h index 6e29703b8a1..01f3668e35d 100644 --- a/include/FileDialog.h +++ b/include/FileDialog.h @@ -30,6 +30,10 @@ #include "lmms_export.h" +namespace lmms::gui +{ + + class LMMS_EXPORT FileDialog : public QFileDialog { Q_OBJECT @@ -50,4 +54,7 @@ class LMMS_EXPORT FileDialog : public QFileDialog void clearSelection(); }; + +} // namespace lmms::gui + #endif // FILEDIALOG_HPP diff --git a/include/FxLine.h b/include/FxLine.h index d909dd6fd83..29ebed299b8 100644 --- a/include/FxLine.h +++ b/include/FxLine.h @@ -37,6 +37,9 @@ #include "SendButtonIndicator.h" +namespace lmms::gui +{ + class FxMixerView; class SendButtonIndicator; @@ -116,4 +119,6 @@ private slots: }; +} // namespace lmms::gui + #endif // FXLINE_H diff --git a/include/FxLineLcdSpinBox.h b/include/FxLineLcdSpinBox.h index 1f8081b1e15..6eada95352c 100644 --- a/include/FxLineLcdSpinBox.h +++ b/include/FxLineLcdSpinBox.h @@ -27,6 +27,10 @@ #include "LcdSpinBox.h" +namespace lmms::gui +{ + + class TrackView; @@ -50,4 +54,7 @@ class FxLineLcdSpinBox : public LcdSpinBox }; + +} // namespace lmms::gui + #endif diff --git a/include/FxMixer.h b/include/FxMixer.h index e7af1d50e1c..8f9db051c6e 100644 --- a/include/FxMixer.h +++ b/include/FxMixer.h @@ -34,6 +34,10 @@ #include +namespace lmms +{ + + class FxRoute; typedef QVector FxRouteVector; @@ -221,4 +225,6 @@ class LMMS_EXPORT FxMixer : public Model, public JournallingObject } ; +} // namespace lmms + #endif diff --git a/include/FxMixerView.h b/include/FxMixerView.h index a7662321ac7..6e12d42e3c8 100644 --- a/include/FxMixerView.h +++ b/include/FxMixerView.h @@ -39,6 +39,12 @@ #include "EffectRackView.h" class QButtonGroup; + + +namespace lmms::gui +{ + + class FxLine; class LMMS_EXPORT FxMixerView : public QWidget, public ModelView, @@ -133,4 +139,7 @@ private slots: friend class FxChannelView; } ; + +} // namespace lmms::gui + #endif diff --git a/include/Graph.h b/include/Graph.h index 2a6fc4f8a15..7a9599f12cd 100644 --- a/include/Graph.h +++ b/include/Graph.h @@ -35,8 +35,15 @@ #include "ModelView.h" #include "lmms_basics.h" +namespace lmms +{ + + class graphModel; +namespace gui +{ + class LMMS_EXPORT Graph : public QWidget, public ModelView { @@ -116,6 +123,9 @@ protected slots: } ; +} // namespace gui + + /** @brief 2 dimensional function plot @@ -137,7 +147,7 @@ class LMMS_EXPORT graphModel : public Model graphModel( float _min, float _max, int _size, - :: Model * _parent, + Model * _parent, bool _default_constructed = false, float _step = 0.0 ); @@ -211,8 +221,11 @@ public slots: float m_maxValue; float m_step; - friend class Graph; + friend class gui::Graph; }; + +} // namespace lmms + #endif diff --git a/include/GroupBox.h b/include/GroupBox.h index 77b0ec578e1..6a282fedbfe 100644 --- a/include/GroupBox.h +++ b/include/GroupBox.h @@ -34,6 +34,8 @@ class QPixmap; +namespace lmms::gui +{ class GroupBox : public QWidget, public BoolModelView { @@ -70,6 +72,7 @@ class GroupBox : public QWidget, public BoolModelView } ; +} // namespace lmms::gui #endif diff --git a/include/GuiApplication.h b/include/GuiApplication.h index 1536cc2ceef..bee1cff0c26 100644 --- a/include/GuiApplication.h +++ b/include/GuiApplication.h @@ -32,6 +32,12 @@ class QLabel; +namespace lmms +{ + +namespace gui +{ + class AutomationEditorWindow; class BBEditor; class ControllerRackView; @@ -85,7 +91,12 @@ private slots: QLabel* m_loadingProgressLabel; }; + +} // namespace gui + // Short-hand function -LMMS_EXPORT GuiApplication* getGUI(); +LMMS_EXPORT gui::GuiApplication* getGUI(); + +} // namespace lmms #endif // GUIAPPLICATION_H diff --git a/include/ImportFilter.h b/include/ImportFilter.h index ccefd3db261..0c9005d7136 100644 --- a/include/ImportFilter.h +++ b/include/ImportFilter.h @@ -30,6 +30,9 @@ #include "Plugin.h" +namespace lmms +{ + class TrackContainer; @@ -109,4 +112,6 @@ class LMMS_EXPORT ImportFilter : public Plugin } ; +} // namespace lmms + #endif diff --git a/include/InlineAutomation.h b/include/InlineAutomation.h index 9fd8362ccc6..2660f90fb6f 100644 --- a/include/InlineAutomation.h +++ b/include/InlineAutomation.h @@ -29,6 +29,8 @@ #include "AutomationPattern.h" #include "shared_object.h" +namespace lmms +{ class InlineAutomation : public FloatModel, public sharedObject { @@ -95,4 +97,6 @@ class InlineAutomation : public FloatModel, public sharedObject } ; +} // namespace lmms + #endif diff --git a/include/Instrument.h b/include/Instrument.h index c3cd56272c1..e9e69c59cb4 100644 --- a/include/Instrument.h +++ b/include/Instrument.h @@ -33,6 +33,8 @@ #include "Plugin.h" #include "TimePos.h" +namespace lmms +{ // forward-declarations class InstrumentTrack; @@ -148,4 +150,7 @@ class LMMS_EXPORT Instrument : public Plugin Q_DECLARE_OPERATORS_FOR_FLAGS(Instrument::Flags) + +} // namespace lmms + #endif diff --git a/include/InstrumentFunctionViews.h b/include/InstrumentFunctionViews.h index 6536a8db7df..322a6774357 100644 --- a/include/InstrumentFunctionViews.h +++ b/include/InstrumentFunctionViews.h @@ -30,15 +30,22 @@ #include class QLabel; -class ComboBox; -class GroupBox; -class Knob; -class TempoSyncKnob; + +namespace lmms +{ class InstrumentFunctionArpeggio; class InstrumentFunctionNoteStacking; +} +namespace lmms::gui +{ + +class ComboBox; +class GroupBox; +class Knob; +class TempoSyncKnob; class InstrumentFunctionNoteStackingView : public QWidget, public ModelView { @@ -91,4 +98,6 @@ class InstrumentFunctionArpeggioView : public QWidget, public ModelView } ; +} // namespace lmms::gui + #endif diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index e1591ea2703..7390e2999d5 100644 --- a/include/InstrumentFunctions.h +++ b/include/InstrumentFunctions.h @@ -31,10 +31,19 @@ #include "TempoSyncKnobModel.h" #include "ComboBoxModel.h" +namespace lmms +{ class InstrumentTrack; class NotePlayHandle; +namespace gui +{ + +class InstrumentFunctionNoteStackingView; +class InstrumentFunctionArpeggioView; + +} class InstrumentFunctionNoteStacking : public Model, public JournallingObject @@ -207,9 +216,11 @@ class InstrumentFunctionArpeggio : public Model, public JournallingObject friend class InstrumentTrack; - friend class InstrumentFunctionArpeggioView; + friend class gui::InstrumentFunctionArpeggioView; } ; +} // namespace lmms + #endif diff --git a/include/InstrumentMidiIOView.h b/include/InstrumentMidiIOView.h index 9b1e5adfdb2..399aee890b1 100644 --- a/include/InstrumentMidiIOView.h +++ b/include/InstrumentMidiIOView.h @@ -30,12 +30,19 @@ #include "ModelView.h" +class QToolButton; + +namespace lmms +{ + +class InstrumentTrack; + +namespace gui +{ class GroupBox; class LcdSpinBox; -class QToolButton; class LedCheckBox; -class InstrumentTrack; class InstrumentMidiIOView : public QWidget, public ModelView @@ -65,4 +72,9 @@ class InstrumentMidiIOView : public QWidget, public ModelView } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/InstrumentMiscView.h b/include/InstrumentMiscView.h index 6024436e8b5..25e16395d96 100644 --- a/include/InstrumentMiscView.h +++ b/include/InstrumentMiscView.h @@ -29,10 +29,16 @@ #include +namespace lmms +{ + +class InstrumentTrack; + +namespace gui +{ class ComboBox; class GroupBox; -class InstrumentTrack; class LedCheckBox; @@ -60,4 +66,9 @@ class InstrumentMiscView : public QWidget LedCheckBox *m_rangeImportCheckbox; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/InstrumentPlayHandle.h b/include/InstrumentPlayHandle.h index ac5fc322240..2d7bfa58732 100644 --- a/include/InstrumentPlayHandle.h +++ b/include/InstrumentPlayHandle.h @@ -30,6 +30,9 @@ #include "NotePlayHandle.h" #include "lmms_export.h" +namespace lmms +{ + class LMMS_EXPORT InstrumentPlayHandle : public PlayHandle { public: @@ -81,4 +84,7 @@ class LMMS_EXPORT InstrumentPlayHandle : public PlayHandle } ; + +} // namespace lmms + #endif diff --git a/include/InstrumentSoundShaping.h b/include/InstrumentSoundShaping.h index b037f615a77..00208392d09 100644 --- a/include/InstrumentSoundShaping.h +++ b/include/InstrumentSoundShaping.h @@ -27,11 +27,19 @@ #include "ComboBoxModel.h" +namespace lmms +{ + class InstrumentTrack; class EnvelopeAndLfoParameters; class NotePlayHandle; +namespace gui +{ +class InstrumentSoundShapingView; +} + class InstrumentSoundShaping : public Model, public JournallingObject { @@ -77,9 +85,11 @@ class InstrumentSoundShaping : public Model, public JournallingObject static const char *const targetNames[InstrumentSoundShaping::NumTargets][3]; - friend class InstrumentSoundShapingView; + friend class gui::InstrumentSoundShapingView; } ; +} // namespace lmms + #endif diff --git a/include/InstrumentSoundShapingView.h b/include/InstrumentSoundShapingView.h index 06d53232ce3..9b4efcfab04 100644 --- a/include/InstrumentSoundShapingView.h +++ b/include/InstrumentSoundShapingView.h @@ -32,6 +32,9 @@ class QLabel; +namespace lmms::gui +{ + class EnvelopeAndLfoView; class ComboBox; class GroupBox; @@ -67,4 +70,7 @@ class InstrumentSoundShapingView : public QWidget, public ModelView } ; + +} // namespace lmms::gui + #endif diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index f0dd29ae821..79931d1d9c0 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -41,9 +41,23 @@ #include "TrackView.h" +namespace lmms +{ + + class Instrument; class DataFile; +namespace gui +{ + +class InstrumentTrackView; +class InstrumentTrackWindow; +class InstrumentMiscView; +class MidiCCRackView; + +} // namespace gui + class LMMS_EXPORT InstrumentTrack : public Track, public MidiEventProcessor { @@ -113,7 +127,7 @@ class LMMS_EXPORT InstrumentTrack : public Track, public MidiEventProcessor virtual bool play( const TimePos & _start, const fpp_t _frames, const f_cnt_t _frame_base, int _tco_num = -1 ) override; // create new view for me - TrackView * createView( TrackContainerView* tcv ) override; + gui::TrackView* createView( gui::TrackContainerView* tcv ) override; // create new track-content-object = pattern TrackContentObject* createTCO(const TimePos & pos) override; @@ -296,12 +310,16 @@ protected slots: std::unique_ptr m_midiCCEnable; std::unique_ptr m_midiCCModel[MidiControllerCount]; - friend class InstrumentTrackView; - friend class InstrumentTrackWindow; + friend class gui::InstrumentTrackView; + friend class gui::InstrumentTrackWindow; friend class NotePlayHandle; - friend class InstrumentMiscView; - friend class MidiCCRackView; + friend class gui::InstrumentMiscView; + friend class gui::MidiCCRackView; } ; + + +} // namespace lmms + #endif diff --git a/include/InstrumentTrackView.h b/include/InstrumentTrackView.h index 03ae6839d58..c497a924ddb 100644 --- a/include/InstrumentTrackView.h +++ b/include/InstrumentTrackView.h @@ -31,6 +31,10 @@ #include "MidiCCRackView.h" +namespace lmms::gui +{ + + class InstrumentTrackWindow; class Knob; class TrackContainerView; @@ -114,5 +118,7 @@ private slots: friend class InstrumentTrackWindow; } ; -#endif +} // namespace lmms::gui + +#endif diff --git a/include/InstrumentTrackWindow.h b/include/InstrumentTrackWindow.h index 7a023a635c0..48b8787c390 100644 --- a/include/InstrumentTrackWindow.h +++ b/include/InstrumentTrackWindow.h @@ -30,6 +30,17 @@ #include "ModelView.h" #include "SerializingObject.h" +class QLabel; +class QLineEdit; +class QWidget; + +namespace lmms +{ + +class InstrumentTrack; + +namespace gui +{ class EffectRackView; class FxLineLcdSpinBox; @@ -38,7 +49,6 @@ class InstrumentFunctionNoteStackingView; class InstrumentMidiIOView; class InstrumentMiscView; class InstrumentSoundShapingView; -class InstrumentTrack; class InstrumentTrackShapingView; class InstrumentTrackView; class Knob; @@ -46,9 +56,6 @@ class LcdSpinBox; class LeftRightNav; class PianoView; class PluginView; -class QLabel; -class QLineEdit; -class QWidget; class TabWidget; @@ -157,5 +164,9 @@ protected slots: friend class InstrumentTrackView; } ; -#endif +} // namespace gui + +} // namespace lmms + +#endif diff --git a/include/InstrumentView.h b/include/InstrumentView.h index 838ed2d9121..695e8c47770 100644 --- a/include/InstrumentView.h +++ b/include/InstrumentView.h @@ -29,6 +29,10 @@ #include "Instrument.h" #include "PluginView.h" + +namespace lmms::gui +{ + class InstrumentTrackWindow; @@ -70,4 +74,6 @@ class LMMS_EXPORT InstrumentViewFixedSize : public InstrumentView } ; +} // namespace lmms::gui + #endif diff --git a/include/IoHelper.h b/include/IoHelper.h index 35ee8cb8721..4f08f5087dc 100644 --- a/include/IoHelper.h +++ b/include/IoHelper.h @@ -27,9 +27,23 @@ #include - #ifdef _WIN32 #include +#endif + +#ifdef LMMS_BUILD_WIN32 +#include +#else +#ifdef LMMS_HAVE_UNISTD_H +#include +#endif +#endif + +namespace lmms +{ + + +#ifdef _WIN32 std::wstring toWString(const std::string& s) { @@ -44,16 +58,10 @@ std::wstring toWString(const std::string& s) MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, s.data(), s.length(), &ret[0], len); return ret; } -#endif -#ifdef LMMS_BUILD_WIN32 -#include -#else -#ifdef LMMS_HAVE_UNISTD_H -#include -#endif #endif + FILE* F_OPEN_UTF8(std::string const& fname, const char* mode){ #ifdef LMMS_BUILD_WIN32 return _wfopen(toWString(fname).data(), toWString(mode).data()); @@ -62,6 +70,7 @@ FILE* F_OPEN_UTF8(std::string const& fname, const char* mode){ #endif } + int fileToDescriptor(FILE* f, bool closeFile = true) { int fh; @@ -76,3 +85,6 @@ int fileToDescriptor(FILE* f, bool closeFile = true) if (closeFile) {fclose(f);} return fh; } + + +} // namespace lmms \ No newline at end of file diff --git a/include/JournallingObject.h b/include/JournallingObject.h index f4755994b9e..aecce679385 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -30,6 +30,8 @@ #include "lmms_basics.h" #include "SerializingObject.h" +namespace lmms +{ class LMMS_EXPORT JournallingObject : public SerializingObject { @@ -99,5 +101,7 @@ class LMMS_EXPORT JournallingObject : public SerializingObject } ; +} // namespace lmms + #endif diff --git a/include/Keymap.h b/include/Keymap.h index 69286034374..f738e306a09 100644 --- a/include/Keymap.h +++ b/include/Keymap.h @@ -32,6 +32,9 @@ #include "Note.h" #include "SerializingObject.h" +namespace lmms +{ + class Keymap : public QObject, public SerializingObject { Q_OBJECT @@ -76,4 +79,6 @@ class Keymap : public QObject, public SerializingObject float m_baseFreq; //!< frequency of the base note (usually A4 @440 Hz) }; +} // namespace lmms + #endif diff --git a/include/Knob.h b/include/Knob.h index 91aa6b478e0..f80847396c2 100644 --- a/include/Knob.h +++ b/include/Knob.h @@ -36,6 +36,11 @@ class QPixmap; + +namespace lmms::gui +{ + + class TextFloat; enum knobTypes @@ -206,4 +211,7 @@ private slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Ladspa2LMMS.h b/include/Ladspa2LMMS.h index 28fa25b894c..a14d52d7b4c 100644 --- a/include/Ladspa2LMMS.h +++ b/include/Ladspa2LMMS.h @@ -30,6 +30,9 @@ #include "LadspaManager.h" +namespace lmms +{ + //! Class responsible for sorting found plugins (by LadspaManager) //! into categories class LMMS_EXPORT Ladspa2LMMS : public LadspaManager @@ -77,4 +80,7 @@ class LMMS_EXPORT Ladspa2LMMS : public LadspaManager } ; + +} // namespace lmms + #endif diff --git a/include/LadspaBase.h b/include/LadspaBase.h index be4576f5503..68e91dd7a76 100644 --- a/include/LadspaBase.h +++ b/include/LadspaBase.h @@ -29,6 +29,10 @@ #include "LadspaManager.h" #include "Plugin.h" +namespace lmms +{ + + class LadspaControl; @@ -88,4 +92,6 @@ inline Plugin::Descriptor::SubPluginFeatures::Key ladspaKeyToSubPluginKey( } +} // namespace lmms + #endif diff --git a/include/LadspaControl.h b/include/LadspaControl.h index 34f6c9ae218..8b6fe3d1999 100644 --- a/include/LadspaControl.h +++ b/include/LadspaControl.h @@ -32,9 +32,19 @@ #include "TempoSyncKnobModel.h" #include "ValueBuffer.h" +namespace lmms +{ + typedef struct PortDescription port_desc_t; +namespace gui +{ + +class LadspaControlView; + +} // namespace gui + class LMMS_EXPORT LadspaControl : public Model, public JournallingObject { @@ -115,8 +125,11 @@ protected slots: TempoSyncKnobModel m_tempoSyncKnobModel; - friend class LadspaControlView; + friend class gui::LadspaControlView; } ; + +} // namespace lmms + #endif diff --git a/include/LadspaControlView.h b/include/LadspaControlView.h index d2d0ca44d85..15eb722a7a3 100644 --- a/include/LadspaControlView.h +++ b/include/LadspaControlView.h @@ -30,8 +30,13 @@ #include "ModelView.h" +namespace lmms +{ + class LadspaControl; +namespace gui +{ class LMMS_EXPORT LadspaControlView : public QWidget, public ModelView { @@ -45,4 +50,9 @@ class LMMS_EXPORT LadspaControlView : public QWidget, public ModelView } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/LadspaManager.h b/include/LadspaManager.h index f9ac76eae5c..4c2c22751a1 100644 --- a/include/LadspaManager.h +++ b/include/LadspaManager.h @@ -40,6 +40,9 @@ #include "lmms_basics.h" +namespace lmms +{ + const float NOHINT = -99342.2243f; typedef QPair ladspa_key_t; @@ -346,4 +349,7 @@ class LMMS_EXPORT LadspaManager } ; + +} // namespace lmms + #endif diff --git a/include/LcdFloatSpinBox.h b/include/LcdFloatSpinBox.h index 034168fbb9e..ab0de304e0f 100644 --- a/include/LcdFloatSpinBox.h +++ b/include/LcdFloatSpinBox.h @@ -32,6 +32,9 @@ #include "LcdWidget.h" #include "AutomatableModelView.h" +namespace lmms::gui +{ + class LMMS_EXPORT LcdFloatSpinBox : public QWidget, public FloatModelView { @@ -80,4 +83,6 @@ public slots: using LcdFloatSpinBoxModel = FloatModel; +} // namespace lmms::gui + #endif diff --git a/include/LcdSpinBox.h b/include/LcdSpinBox.h index 91ac8b4a78c..1c30bfcf631 100644 --- a/include/LcdSpinBox.h +++ b/include/LcdSpinBox.h @@ -29,6 +29,8 @@ #include "LcdWidget.h" #include "AutomatableModelView.h" +namespace lmms::gui +{ class LMMS_EXPORT LcdSpinBox : public LcdWidget, public IntModelView { @@ -86,4 +88,6 @@ public slots: typedef IntModel LcdSpinBoxModel; +} // namespace lmms::gui + #endif diff --git a/include/LcdWidget.h b/include/LcdWidget.h index 7dc2e2a289e..9a117b8d1b1 100644 --- a/include/LcdWidget.h +++ b/include/LcdWidget.h @@ -31,6 +31,9 @@ #include "lmms_export.h" +namespace lmms::gui +{ + class LMMS_EXPORT LcdWidget : public QWidget { Q_OBJECT @@ -112,4 +115,6 @@ public slots: }; +} // namespace lmms::gui + #endif diff --git a/include/LedCheckbox.h b/include/LedCheckbox.h index 66d7ce07e7e..877e74dbccc 100644 --- a/include/LedCheckbox.h +++ b/include/LedCheckbox.h @@ -32,6 +32,9 @@ class QPixmap; +namespace lmms::gui +{ + class LMMS_EXPORT LedCheckBox : public AutomatableButton { Q_OBJECT @@ -78,4 +81,7 @@ class LMMS_EXPORT LedCheckBox : public AutomatableButton } ; + +} // namespace lmms::gui + #endif diff --git a/include/LeftRightNav.h b/include/LeftRightNav.h index 93585305424..dd4dd35284f 100644 --- a/include/LeftRightNav.h +++ b/include/LeftRightNav.h @@ -29,6 +29,9 @@ #include +namespace lmms::gui +{ + class LeftRightNav : public QWidget { Q_OBJECT @@ -46,4 +49,7 @@ class LeftRightNav : public QWidget PixmapButton m_rightBtn; }; + +} // namespace lmms::gui + #endif \ No newline at end of file diff --git a/include/LfoController.h b/include/LfoController.h index 8fc35fd0903..6ee136a1469 100644 --- a/include/LfoController.h +++ b/include/LfoController.h @@ -34,11 +34,21 @@ #include "TempoSyncKnobModel.h" #include "Oscillator.h" +namespace lmms +{ + +namespace gui +{ + class automatableButtonGroup; -class Knob; class LedCheckBox; -class TempoSyncKnob; class PixmapButton; +class Knob; +class TempoSyncKnob; + +class LfoControllerDialog; + +} class LfoController : public Controller @@ -55,7 +65,7 @@ class LfoController : public Controller public slots: - ControllerDialog * createDialog( QWidget * _parent ) override; + gui::ControllerDialog * createDialog( QWidget * _parent ) override; protected: @@ -83,11 +93,12 @@ protected slots: void updateSampleFunction(); void updateDuration(); - friend class LfoControllerDialog; + friend class gui::LfoControllerDialog; } ; - +namespace gui +{ class LfoControllerDialog : public ControllerDialog { @@ -120,4 +131,9 @@ private slots: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/LinkedModelGroupViews.h b/include/LinkedModelGroupViews.h index 46ba4c3ab55..a3a7986a2fd 100644 --- a/include/LinkedModelGroupViews.h +++ b/include/LinkedModelGroupViews.h @@ -32,6 +32,9 @@ #include +namespace lmms::gui +{ + /** @file LinkedModelGroupViews.h See Lv2ViewBase.h for example usage @@ -104,4 +107,6 @@ class LinkedModelGroupsView }; +} // namespace lmms::gui + #endif // LINKEDMODELGROUPVIEWS_H diff --git a/include/LinkedModelGroups.h b/include/LinkedModelGroups.h index 686f09cba36..4f780cc6103 100644 --- a/include/LinkedModelGroups.h +++ b/include/LinkedModelGroups.h @@ -33,6 +33,9 @@ #include "Model.h" +namespace lmms +{ + /** @file LinkedModelGroups.h See Lv2ControlBase.h and Lv2Proc.h for example usage @@ -172,4 +175,6 @@ class LinkedModelGroups }; +} // namespace lmms + #endif // LINKEDMODELGROUPS_H diff --git a/include/LmmsPalette.h b/include/LmmsPalette.h index a8ee5d1c8ab..87ea186879a 100644 --- a/include/LmmsPalette.h +++ b/include/LmmsPalette.h @@ -30,6 +30,10 @@ #define LMMSPALETTE_H +namespace lmms::gui +{ + + class LMMS_EXPORT LmmsPalette : public QWidget { Q_OBJECT @@ -83,5 +87,6 @@ class LMMS_EXPORT LmmsPalette : public QWidget +} // namespace lmms::gui #endif diff --git a/include/LmmsStyle.h b/include/LmmsStyle.h index ccf14396c8f..a4c9edd31aa 100644 --- a/include/LmmsStyle.h +++ b/include/LmmsStyle.h @@ -30,6 +30,9 @@ #include +namespace lmms::gui +{ + class LmmsStyle : public QProxyStyle { @@ -92,4 +95,7 @@ class LmmsStyle : public QProxyStyle }; + +} // namespace lmms::gui + #endif diff --git a/include/LocaleHelper.h b/include/LocaleHelper.h index c5d9d4c46c5..b071a1596c1 100644 --- a/include/LocaleHelper.h +++ b/include/LocaleHelper.h @@ -33,8 +33,9 @@ #include #include -namespace LocaleHelper +namespace lmms::LocaleHelper { + inline double toDouble(QString str, bool* ok = nullptr) { bool isOkay; @@ -62,6 +63,8 @@ inline float toFloat(QString str, bool* ok = nullptr) } return static_cast(d); } -} + + +} // namespace lmms::LocaleHelper #endif // LOCALEHELPER_H diff --git a/include/LocklessAllocator.h b/include/LocklessAllocator.h index e7e265680b8..70464f60c9e 100644 --- a/include/LocklessAllocator.h +++ b/include/LocklessAllocator.h @@ -28,6 +28,11 @@ #include #include + +namespace lmms +{ + + class LocklessAllocator { public: @@ -79,4 +84,6 @@ class LocklessAllocatorT : private LocklessAllocator } ; +} // namespace lmms + #endif diff --git a/include/LocklessList.h b/include/LocklessList.h index 05df56f41af..44b71805954 100644 --- a/include/LocklessList.h +++ b/include/LocklessList.h @@ -29,6 +29,9 @@ #include +namespace lmms +{ + template class LocklessList { @@ -92,4 +95,6 @@ class LocklessList } ; +} // namespace lmms + #endif diff --git a/include/LocklessRingBuffer.h b/include/LocklessRingBuffer.h index 5950b842fce..60f8ab98996 100644 --- a/include/LocklessRingBuffer.h +++ b/include/LocklessRingBuffer.h @@ -32,6 +32,9 @@ #include "../src/3rdparty/ringbuffer/include/ringbuffer/ringbuffer.h" +namespace lmms +{ + //! A convenience layer for a realtime-safe and thread-safe multi-reader ringbuffer template class LocklessRingBuffer @@ -83,4 +86,7 @@ class LocklessRingBufferReader : public ringbuffer_reader_t QWaitCondition *m_notifier; }; + +} // namespace lmms + #endif //LOCKLESSRINGBUFFER_H diff --git a/include/Lv2Basics.h b/include/Lv2Basics.h index 0003f83e814..b935e6a02f9 100644 --- a/include/Lv2Basics.h +++ b/include/Lv2Basics.h @@ -36,6 +36,9 @@ #include #include +namespace lmms +{ + struct LilvNodeDeleter { void operator()(LilvNode* n) { lilv_node_free(n); } @@ -63,5 +66,7 @@ QString qStringFromPortName(const LilvPlugin* plug, const LilvPort* port); //! Return port name as std::string, everything will be freed automatically std::string stdStringFromPortName(const LilvPlugin* plug, const LilvPort* port); +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2BASICS_H diff --git a/include/Lv2ControlBase.h b/include/Lv2ControlBase.h index de90960dcd7..cd026686441 100644 --- a/include/Lv2ControlBase.h +++ b/include/Lv2ControlBase.h @@ -36,6 +36,10 @@ #include "lmms_export.h" #include "Plugin.h" +namespace lmms +{ + + class Lv2Proc; class PluginIssue; @@ -154,5 +158,8 @@ class LMMS_EXPORT Lv2ControlBase : public LinkedModelGroups const LilvPlugin* m_plugin; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2_CONTROL_BASE_H diff --git a/include/Lv2Evbuf.h b/include/Lv2Evbuf.h index 9cf6a6801fe..2f569f7d6ce 100644 --- a/include/Lv2Evbuf.h +++ b/include/Lv2Evbuf.h @@ -39,6 +39,11 @@ #include + +namespace lmms +{ + + /** An abstract/opaque LV2 event buffer. */ @@ -144,6 +149,9 @@ lv2_evbuf_write( LV2_Evbuf_Iterator* iter, uint32_t size, const uint8_t* data); + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2_EVBUF_H diff --git a/include/Lv2Features.h b/include/Lv2Features.h index f036c6d1f67..e4cd4726995 100644 --- a/include/Lv2Features.h +++ b/include/Lv2Features.h @@ -34,6 +34,10 @@ #include #include "Lv2Manager.h" + +namespace lmms +{ + /** Feature container @@ -76,6 +80,9 @@ class Lv2Features std::map m_featureByUri; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2FEATURES_H diff --git a/include/Lv2Manager.h b/include/Lv2Manager.h index dbea510ce39..7c4a4bcb799 100644 --- a/include/Lv2Manager.h +++ b/include/Lv2Manager.h @@ -39,6 +39,9 @@ #include "Plugin.h" +namespace lmms +{ + /* all Lv2 classes in relation (use our "4 spaces per tab rule" to view): @@ -158,6 +161,9 @@ class Lv2Manager bool isSubclassOf(const LilvPluginClass *clvss, const char *uriStr); }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2MANAGER_H diff --git a/include/Lv2Options.h b/include/Lv2Options.h index 1453de2ea10..32225ea8918 100644 --- a/include/Lv2Options.h +++ b/include/Lv2Options.h @@ -41,6 +41,9 @@ #include "Lv2Manager.h" #include "Lv2UridCache.h" +namespace lmms +{ + /** Option container @@ -99,6 +102,9 @@ class Lv2Options std::map> m_optionValues; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2OPTIONS_H diff --git a/include/Lv2Ports.h b/include/Lv2Ports.h index 529200793ad..fbb917d6337 100644 --- a/include/Lv2Ports.h +++ b/include/Lv2Ports.h @@ -36,6 +36,11 @@ #include "lmms_basics.h" #include "PluginIssue.h" + +namespace lmms +{ + + struct ConnectPortVisitor; typedef struct LV2_Evbuf_Impl LV2_Evbuf; @@ -261,5 +266,8 @@ const Target* dcast(const PortBase* base) } // namespace Lv2Ports + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2PORTS_H diff --git a/include/Lv2Proc.h b/include/Lv2Proc.h index a80c10e3f18..cd8267011ef 100644 --- a/include/Lv2Proc.h +++ b/include/Lv2Proc.h @@ -43,6 +43,10 @@ #include "../src/3rdparty/ringbuffer/include/ringbuffer/ringbuffer.h" #include "TimePos.h" + +namespace lmms +{ + // forward declare port structs/enums namespace Lv2Ports { @@ -213,5 +217,8 @@ class Lv2Proc : public LinkedModelGroup static AutoLilvNode uri(const char* uriStr); }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2PROC_H diff --git a/include/Lv2SubPluginFeatures.h b/include/Lv2SubPluginFeatures.h index fee3c381216..9ba2c76cb9d 100644 --- a/include/Lv2SubPluginFeatures.h +++ b/include/Lv2SubPluginFeatures.h @@ -36,6 +36,10 @@ #include "lmms_export.h" #include "Plugin.h" +namespace lmms +{ + + class LMMS_EXPORT Lv2SubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures { private: @@ -57,6 +61,9 @@ class LMMS_EXPORT Lv2SubPluginFeatures : public Plugin::Descriptor::SubPluginFea const Plugin::Descriptor *desc, KeyList &kl) const override; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif diff --git a/include/Lv2UridCache.h b/include/Lv2UridCache.h index 1921bdfd70b..5a1b9a8dda3 100644 --- a/include/Lv2UridCache.h +++ b/include/Lv2UridCache.h @@ -32,6 +32,11 @@ #include #include + +namespace lmms +{ + + //! Cached URIDs for fast access (for use in real-time code) class Lv2UridCache { @@ -66,5 +71,8 @@ class Lv2UridCache template<> struct Lv2UridCache::IdForType { static constexpr auto value = Id::atom_Float; }; template<> struct Lv2UridCache::IdForType { static constexpr auto value = Id::atom_Int; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2URIDCACHE_H diff --git a/include/Lv2UridMap.h b/include/Lv2UridMap.h index 39cfcc44fb2..9db9cb0c2ae 100644 --- a/include/Lv2UridMap.h +++ b/include/Lv2UridMap.h @@ -35,6 +35,11 @@ #include #include + +namespace lmms +{ + + /** * Complete implementation of the Lv2 Urid Map extension */ @@ -66,5 +71,8 @@ class UridMap LV2_URID_Unmap* unmapFeature() { return &m_unmapFeature; } }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2URIDMAP_H diff --git a/include/Lv2ViewBase.h b/include/Lv2ViewBase.h index 5ccbbb75be1..bdcf64cd182 100644 --- a/include/Lv2ViewBase.h +++ b/include/Lv2ViewBase.h @@ -37,10 +37,18 @@ #include "lmms_export.h" #include "Lv2Basics.h" + +namespace lmms +{ + + class Lv2Proc; class Lv2ControlBase; +namespace gui +{ + //! View for one processor, Lv2ViewBase contains 2 of those for mono plugins class Lv2ViewProc : public LinkedModelGroupView { @@ -94,5 +102,9 @@ class LMMS_EXPORT Lv2ViewBase : public LinkedModelGroupsView }; +} // namespace gui + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2VIEWBASE_H diff --git a/include/MainApplication.h b/include/MainApplication.h index d28900213c9..ece887265d9 100644 --- a/include/MainApplication.h +++ b/include/MainApplication.h @@ -34,6 +34,11 @@ #include #endif + +namespace lmms +{ + + #if defined(LMMS_BUILD_WIN32) class MainApplication : public QApplication, public QAbstractNativeEventFilter #else @@ -56,4 +61,7 @@ class MainApplication : public QApplication QString m_queuedFile; }; + +} // namespace lmms + #endif // MAINAPPLICATION_H diff --git a/include/MainWindow.h b/include/MainWindow.h index 688e4fc6053..55b1286c96e 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -38,7 +38,14 @@ class QDomElement; class QGridLayout; class QMdiArea; +namespace lmms +{ + class ConfigManager; + +namespace gui +{ + class PluginView; class ToolButton; @@ -248,4 +255,9 @@ private slots: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/MemoryHelper.h b/include/MemoryHelper.h index f5c5bf11b1b..1def9d9c4dc 100644 --- a/include/MemoryHelper.h +++ b/include/MemoryHelper.h @@ -27,6 +27,10 @@ #include +namespace lmms +{ + + /** * Helper class to alocate aligned memory and free it. */ @@ -40,5 +44,8 @@ class MemoryHelper { private: }; + +} // namespace lmms + #endif diff --git a/include/MemoryManager.h b/include/MemoryManager.h index a5899d922af..014071617f8 100644 --- a/include/MemoryManager.h +++ b/include/MemoryManager.h @@ -32,6 +32,10 @@ #include "lmms_export.h" +namespace lmms +{ + + class LMMS_EXPORT MemoryManager { public: @@ -99,4 +103,7 @@ void MM_FREE(T* ptr) MemoryManager::free(ptr); } + +} // namespace lmms + #endif diff --git a/include/MeterDialog.h b/include/MeterDialog.h index da254c7c7cb..e606a448231 100644 --- a/include/MeterDialog.h +++ b/include/MeterDialog.h @@ -30,6 +30,9 @@ #include "ModelView.h" +namespace lmms::gui +{ + class LcdSpinBox; @@ -49,4 +52,6 @@ class MeterDialog : public QWidget, public ModelView } ; +} // namespace lmms::gui + #endif diff --git a/include/MeterModel.h b/include/MeterModel.h index 2b98bed0b85..bcd3fa2b2e7 100644 --- a/include/MeterModel.h +++ b/include/MeterModel.h @@ -27,6 +27,9 @@ #include "AutomatableModel.h" +namespace lmms +{ + class MeterModel : public Model { @@ -62,4 +65,7 @@ class MeterModel : public Model } ; + +} // namespace lmms + #endif diff --git a/include/MicroTimer.h b/include/MicroTimer.h index 2026619e2b0..2eaf28b97ad 100644 --- a/include/MicroTimer.h +++ b/include/MicroTimer.h @@ -27,6 +27,9 @@ #include +namespace lmms +{ + class MicroTimer { using time_point = std::chrono::steady_clock::time_point; @@ -43,4 +46,6 @@ class MicroTimer } ; +} // namespace lmms + #endif diff --git a/include/Microtuner.h b/include/Microtuner.h index 93998369c03..56d0462185b 100644 --- a/include/Microtuner.h +++ b/include/Microtuner.h @@ -31,6 +31,9 @@ #include "lmms_constants.h" #include "Note.h" +namespace lmms +{ + class LMMS_EXPORT Microtuner : public Model, public JournallingObject { Q_OBJECT @@ -70,4 +73,6 @@ protected slots: }; +} // namespace lmms + #endif diff --git a/include/MicrotunerConfig.h b/include/MicrotunerConfig.h index 00783af4bc3..9a2b188a662 100644 --- a/include/MicrotunerConfig.h +++ b/include/MicrotunerConfig.h @@ -36,6 +36,10 @@ #include "LcdSpinBox.h" #include "SerializingObject.h" +namespace lmms::gui +{ + + class LMMS_EXPORT MicrotunerConfig : public QWidget, public SerializingObject { Q_OBJECT @@ -90,4 +94,7 @@ private slots: FloatModel m_baseFreqModel; //!< model for spinbox of currently edited base note frequency }; + +} // namespace lmms::gui + #endif diff --git a/include/Midi.h b/include/Midi.h index b922ac41f47..9a97ae6e44b 100644 --- a/include/Midi.h +++ b/include/Midi.h @@ -28,6 +28,10 @@ #include "lmms_basics.h" +namespace lmms +{ + + enum MidiEventTypes { // messages @@ -137,4 +141,7 @@ const int MidiMinPanning = -128; const int MidiMinPitchBend = 0; const int MidiMaxPitchBend = 16383; + +} // namespace lmms + #endif diff --git a/include/MidiAlsaRaw.h b/include/MidiAlsaRaw.h index 69f9366f161..53748d9de7f 100644 --- a/include/MidiAlsaRaw.h +++ b/include/MidiAlsaRaw.h @@ -39,6 +39,9 @@ struct pollfd; +namespace lmms +{ + class MidiAlsaRaw : public QThread, public MidiClientRaw { Q_OBJECT @@ -76,6 +79,9 @@ class MidiAlsaRaw : public QThread, public MidiClientRaw } ; -#endif + +} // namespace lmms + +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/MidiAlsaSeq.h b/include/MidiAlsaSeq.h index 5db5357d829..1189cfb3397 100644 --- a/include/MidiAlsaSeq.h +++ b/include/MidiAlsaSeq.h @@ -41,6 +41,10 @@ struct pollfd; +namespace lmms +{ + + class MidiAlsaSeq : public QThread, public MidiClient { Q_OBJECT @@ -148,7 +152,10 @@ private slots: } ; -#endif + +} // namespace lmms + +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/MidiApple.h b/include/MidiApple.h index 4ea4805e5a8..d2a90169868 100644 --- a/include/MidiApple.h +++ b/include/MidiApple.h @@ -38,6 +38,10 @@ class QLineEdit; +namespace lmms +{ + + class MidiApple : public QObject, public MidiClient { Q_OBJECT @@ -146,7 +150,10 @@ class MidiApple : public QObject, public MidiClient } ; -#endif + +} // namespace lmms + +#endif // LMMS_BUILD_APPLE #endif diff --git a/include/MidiCCRackView.h b/include/MidiCCRackView.h index 9d015e4e8fb..f91ed72e583 100644 --- a/include/MidiCCRackView.h +++ b/include/MidiCCRackView.h @@ -8,8 +8,15 @@ #include "Midi.h" #include "SerializingObject.h" +namespace lmms +{ + class InstrumentTrack; +namespace gui +{ + + class MidiCCRackView : public QWidget, public SerializingObject { Q_OBJECT @@ -37,4 +44,9 @@ private slots: }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/MidiClient.h b/include/MidiClient.h index ff441e24f1d..fe131eaace4 100644 --- a/include/MidiClient.h +++ b/include/MidiClient.h @@ -33,6 +33,8 @@ #include "MidiEventProcessor.h" #include "TabWidget.h" +namespace lmms +{ class MidiPort; @@ -167,6 +169,7 @@ class MidiClientRaw : public MidiClient } ; +} // namespace lmms #endif diff --git a/include/MidiController.h b/include/MidiController.h index 74b408f867d..6d0f3d805c2 100644 --- a/include/MidiController.h +++ b/include/MidiController.h @@ -33,6 +33,9 @@ #include "MidiPort.h" +namespace lmms +{ + class MidiPort; @@ -61,7 +64,7 @@ class MidiController : public Controller, public MidiEventProcessor public slots: - ControllerDialog * createDialog( QWidget * _parent ) override; + gui::ControllerDialog* createDialog( QWidget * _parent ) override; void updateName(); @@ -82,4 +85,6 @@ public slots: } ; +} // namespace lmms + #endif diff --git a/include/MidiDummy.h b/include/MidiDummy.h index f809d3c3630..8744c6aa2fb 100644 --- a/include/MidiDummy.h +++ b/include/MidiDummy.h @@ -28,6 +28,10 @@ #include "MidiClient.h" +namespace lmms +{ + + class MidiDummy : public MidiClientRaw { public: @@ -63,4 +67,6 @@ class MidiDummy : public MidiClientRaw } ; +} // namespace lmms + #endif diff --git a/include/MidiEvent.h b/include/MidiEvent.h index 29a3c5df6c2..e73a7d1a884 100644 --- a/include/MidiEvent.h +++ b/include/MidiEvent.h @@ -30,6 +30,9 @@ #include "panning_constants.h" #include "volume.h" +namespace lmms +{ + class MidiEvent { public: @@ -225,4 +228,6 @@ class MidiEvent Source m_source; } ; +} // namespace lmms + #endif diff --git a/include/MidiEventProcessor.h b/include/MidiEventProcessor.h index 3ded20430d2..1398f4b6d16 100644 --- a/include/MidiEventProcessor.h +++ b/include/MidiEventProcessor.h @@ -29,6 +29,9 @@ #include "MemoryManager.h" #include "TimePos.h" +namespace lmms +{ + // all classes being able to process MIDI-events should inherit from this class MidiEventProcessor { @@ -48,4 +51,6 @@ class MidiEventProcessor } ; +} // namespace lmms + #endif diff --git a/include/MidiEventToByteSeq.h b/include/MidiEventToByteSeq.h index fba8cdeb414..f2e36f50a29 100644 --- a/include/MidiEventToByteSeq.h +++ b/include/MidiEventToByteSeq.h @@ -30,6 +30,10 @@ #include "lmms_export.h" + +namespace lmms +{ + /** Write MIDI event into byte sequence. @@ -44,4 +48,7 @@ std::size_t LMMS_EXPORT writeToByteSeq( const class MidiEvent& ev, uint8_t* data, std::size_t bufsize ); + +} // namespace lmms + #endif // MIDIEVENTTOBYTESEQ_H diff --git a/include/MidiJack.h b/include/MidiJack.h index 66525c3a9ba..779f1292033 100644 --- a/include/MidiJack.h +++ b/include/MidiJack.h @@ -42,9 +42,13 @@ #include "MidiClient.h" #include "AudioJack.h" +class QLineEdit; + +namespace lmms +{ + constexpr size_t JACK_MIDI_BUFFER_MAX = 64; /* events */ -class QLineEdit; class MidiJack : public QThread, public MidiClientRaw { @@ -95,6 +99,9 @@ class MidiJack : public QThread, public MidiClientRaw }; + +} // namesapce lmms + #endif // LMMS_HAVE_JACK #endif // MIDIJACK_H diff --git a/include/MidiOss.h b/include/MidiOss.h index 7e1f179efd6..5ac643040ea 100644 --- a/include/MidiOss.h +++ b/include/MidiOss.h @@ -35,6 +35,9 @@ #include "MidiClient.h" +namespace lmms +{ + class MidiOss : public QThread, public MidiClientRaw { @@ -69,7 +72,11 @@ class MidiOss : public QThread, public MidiClientRaw } ; -#endif + +} // namespace lmms + + +#endif // LMMS_HAVE_OSS #endif diff --git a/include/MidiPort.h b/include/MidiPort.h index d5797a3e609..9782f3fb6b2 100644 --- a/include/MidiPort.h +++ b/include/MidiPort.h @@ -34,12 +34,20 @@ #include "TimePos.h" #include "AutomatableModel.h" +namespace lmms +{ class MidiClient; class MidiEvent; class MidiEventProcessor; + +namespace gui +{ + class MidiPortMenu; +} + // class for abstraction of MIDI-port class MidiPort : public Model, public SerializingObject @@ -129,8 +137,8 @@ class MidiPort : public Model, public SerializingObject void invalidateCilent(); - MidiPortMenu* m_readablePortsMenu; - MidiPortMenu* m_writablePortsMenu; + gui::MidiPortMenu* m_readablePortsMenu; + gui::MidiPortMenu* m_writablePortsMenu; public slots: @@ -179,5 +187,6 @@ private slots: typedef QList MidiPortList; +} // namespace lmms #endif diff --git a/include/MidiPortMenu.h b/include/MidiPortMenu.h index ce39c4aace0..7f7689edc2e 100644 --- a/include/MidiPortMenu.h +++ b/include/MidiPortMenu.h @@ -33,6 +33,8 @@ class QAction; +namespace lmms::gui +{ class MidiPortMenu : public QMenu, public ModelView { @@ -57,5 +59,6 @@ protected slots: } ; +} // namespace lmms::gui #endif diff --git a/include/MidiSetupWidget.h b/include/MidiSetupWidget.h index d740c0290d0..db6bc864f3d 100644 --- a/include/MidiSetupWidget.h +++ b/include/MidiSetupWidget.h @@ -31,6 +31,10 @@ class QLineEdit; +namespace lmms::gui +{ + + class MidiSetupWidget : public TabWidget { Q_OBJECT @@ -54,4 +58,7 @@ class MidiSetupWidget : public TabWidget }; + +} // namespace lmms::gui + #endif diff --git a/include/MidiSndio.h b/include/MidiSndio.h index 14ecfa0e94a..7bbd09f111e 100644 --- a/include/MidiSndio.h +++ b/include/MidiSndio.h @@ -37,6 +37,9 @@ #include "MidiClient.h" +namespace lmms +{ + class MidiSndio : public QThread, public MidiClientRaw { @@ -67,6 +70,9 @@ class MidiSndio : public QThread, public MidiClientRaw volatile bool m_quit; } ; + +} // namespace lmms + #endif /* LMMS_HAVE_SNDIO */ #endif /* _MIDI_SNDIO_H */ diff --git a/include/MidiWinMM.h b/include/MidiWinMM.h index cbb13998313..7cc7f0f7721 100644 --- a/include/MidiWinMM.h +++ b/include/MidiWinMM.h @@ -38,6 +38,10 @@ class QLineEdit; +namespace lmms +{ + + class MidiWinMM : public QObject, public MidiClient { Q_OBJECT @@ -141,7 +145,10 @@ class MidiWinMM : public QObject, public MidiClient } ; -#endif + +} // namespace lmms + +#endif // LMMS_BUILD_WIN32 #endif diff --git a/include/MixHelpers.h b/include/MixHelpers.h index 872319f82df..6599b40ec0a 100644 --- a/include/MixHelpers.h +++ b/include/MixHelpers.h @@ -27,6 +27,9 @@ #include "lmms_basics.h" +namespace lmms +{ + class ValueBuffer; namespace MixHelpers { @@ -73,7 +76,10 @@ void multiplyAndAddMultiplied( sampleFrame* dst, const sampleFrame* src, float c /*! \brief Multiply dst by coeffDst and add samples from srcLeft/srcRight multiplied by coeffSrc */ void multiplyAndAddMultipliedJoined( sampleFrame* dst, const sample_t* srcLeft, const sample_t* srcRight, float coeffDst, float coeffSrc, int frames ); -} +} // namespace MixHelpers + + +} // namespace lmms #endif diff --git a/include/Model.h b/include/Model.h index b40c21029de..a69d07825c3 100644 --- a/include/Model.h +++ b/include/Model.h @@ -30,6 +30,8 @@ #include "lmms_export.h" +namespace lmms +{ class LMMS_EXPORT Model : public QObject { @@ -88,5 +90,7 @@ class LMMS_EXPORT Model : public QObject } ; +} // namespace lmms + #endif diff --git a/include/ModelView.h b/include/ModelView.h index 04229ed0d2f..cde2e3bed3c 100644 --- a/include/ModelView.h +++ b/include/ModelView.h @@ -28,6 +28,8 @@ #include #include "Model.h" +namespace lmms +{ class LMMS_EXPORT ModelView { @@ -81,6 +83,7 @@ class LMMS_EXPORT ModelView } ; +} // namespace lmms #endif diff --git a/include/ModelVisitor.h b/include/ModelVisitor.h index f9d156e30f4..cf0740b1c1f 100644 --- a/include/ModelVisitor.h +++ b/include/ModelVisitor.h @@ -25,6 +25,10 @@ #ifndef MODELVISITOR_H #define MODELVISITOR_H +namespace lmms +{ + + class AutomatableModel; class BoolModel; class IntModel; @@ -61,4 +65,7 @@ class ConstModelVisitor virtual ~ConstModelVisitor(); }; + +} // namespace lmms + #endif // MODELVISITOR_H diff --git a/include/NStateButton.h b/include/NStateButton.h index 95d36c253db..3c7b2724379 100644 --- a/include/NStateButton.h +++ b/include/NStateButton.h @@ -32,6 +32,9 @@ #include "ToolButton.h" +namespace lmms::gui +{ + class NStateButton : public ToolButton { @@ -72,4 +75,7 @@ public slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Note.h b/include/Note.h index 21988447194..b91b4a4a7ad 100644 --- a/include/Note.h +++ b/include/Note.h @@ -33,6 +33,11 @@ #include "SerializingObject.h" #include "TimePos.h" + +namespace lmms +{ + + class DetuningHelper; @@ -247,4 +252,6 @@ class LMMS_EXPORT Note : public SerializingObject typedef QVector NoteVector; +} // namespace lmms + #endif diff --git a/include/NotePlayHandle.h b/include/NotePlayHandle.h index cc78eec92e7..9f106f16c01 100644 --- a/include/NotePlayHandle.h +++ b/include/NotePlayHandle.h @@ -35,6 +35,10 @@ #include "MemoryManager.h" class QReadWriteLock; + +namespace lmms +{ + class InstrumentTrack; class NotePlayHandle; @@ -359,4 +363,6 @@ class NotePlayHandleManager }; +} // namespace lmms + #endif diff --git a/include/Oscillator.h b/include/Oscillator.h index 4b1db97872b..36f777f9da6 100644 --- a/include/Oscillator.h +++ b/include/Oscillator.h @@ -41,6 +41,10 @@ #include "OscillatorConstants.h" #include "SampleBuffer.h" +namespace lmms +{ + + class IntModel; @@ -311,4 +315,6 @@ class LMMS_EXPORT Oscillator } ; +} // namespace lmms + #endif diff --git a/include/OscillatorConstants.h b/include/OscillatorConstants.h index dcdad8dc4f5..47b13a87563 100644 --- a/include/OscillatorConstants.h +++ b/include/OscillatorConstants.h @@ -30,8 +30,9 @@ #include "lmms_basics.h" -namespace OscillatorConstants +namespace lmms::OscillatorConstants { + // Limit wavetables to the audible audio spectrum const int MAX_FREQ = 20000; // Minimum size of table to have all audible bands for midi note 1 (i.e. 20 000 Hz / 8.176 Hz) @@ -51,7 +52,8 @@ namespace OscillatorConstants // - wavetable: a table containing one period of a wave, with frequency content optimized for a specific pitch. typedef std::array wavetable_t; typedef std::array waveform_t; -}; +} // namespace lmms::OscillatorConstants + #endif // OSCILLATORCONSTANTS_H diff --git a/include/Oscilloscope.h b/include/Oscilloscope.h index 4072df47856..7e9ee8f4106 100644 --- a/include/Oscilloscope.h +++ b/include/Oscilloscope.h @@ -31,6 +31,9 @@ #include "lmms_basics.h" +namespace lmms::gui +{ + class Oscilloscope : public QWidget { @@ -73,4 +76,7 @@ protected slots: QColor m_clippingColor; } ; + +} // namespace lmms::gui + #endif // OSCILLOSCOPE_H diff --git a/include/OutputSettings.h b/include/OutputSettings.h index 4a375d244e2..03e3333acdf 100644 --- a/include/OutputSettings.h +++ b/include/OutputSettings.h @@ -28,6 +28,11 @@ #include "lmms_basics.h" + +namespace lmms +{ + + class OutputSettings { public: @@ -112,4 +117,7 @@ class OutputSettings double m_compressionLevel; }; + +} // namespace lmms + #endif diff --git a/include/PathUtil.h b/include/PathUtil.h index b1eec517e0b..d2d412c1e29 100644 --- a/include/PathUtil.h +++ b/include/PathUtil.h @@ -5,7 +5,7 @@ #include -namespace PathUtil +namespace lmms::PathUtil { enum class Base { Absolute, ProjectDir, FactorySample, UserSample, UserVST, Preset, UserLADSPA, DefaultLADSPA, UserSoundfont, DefaultSoundfont, UserGIG, DefaultGIG, @@ -44,6 +44,6 @@ namespace PathUtil //! Defaults to an absolute path if all bases fail. QString LMMS_EXPORT toShortestRelative(const QString & input, bool allowLocal = false); -} +} // namespace lmms::PathUtil #endif diff --git a/include/Pattern.h b/include/Pattern.h index 9d1697a989c..bade1446a2f 100644 --- a/include/Pattern.h +++ b/include/Pattern.h @@ -33,6 +33,10 @@ #include "TrackContentObjectView.h" +namespace lmms +{ + + class InstrumentTrack; @@ -138,8 +142,8 @@ protected slots: Pattern * adjacentPatternByOffset(int offset) const; - friend class PatternView; - friend class BBTrackContainerView; + friend class gui::PatternView; + friend class gui::BBTrackContainerView; signals: @@ -147,5 +151,6 @@ protected slots: } ; +} // namespace lmms #endif diff --git a/include/PatternView.h b/include/PatternView.h index 6c2243e72e6..245f4ff72a2 100644 --- a/include/PatternView.h +++ b/include/PatternView.h @@ -28,9 +28,16 @@ #include "Pattern.h" #include "TrackContentObjectView.h" +namespace lmms +{ + class Pattern; - - + + +namespace gui +{ + + class PatternView : public TrackContentObjectView { Q_OBJECT @@ -95,7 +102,10 @@ protected slots: bool m_legacySEBB; } ; - - + + +} // namespace gui + +} // namespace lmms #endif \ No newline at end of file diff --git a/include/PeakController.h b/include/PeakController.h index df3902ab23a..59dc8605b4b 100644 --- a/include/PeakController.h +++ b/include/PeakController.h @@ -31,6 +31,10 @@ class QWidget; +namespace lmms +{ + + class PeakControllerEffect; typedef QVector PeakControllerEffectVector; @@ -57,7 +61,7 @@ class LMMS_EXPORT PeakController : public Controller public slots: - ControllerDialog * createDialog( QWidget * _parent ) override; + gui::ControllerDialog * createDialog( QWidget * _parent ) override; void handleDestroyedEffect( ); void updateCoeffs(); @@ -81,7 +85,8 @@ public slots: bool m_coeffNeedsUpdate; } ; - +namespace gui +{ class PeakControllerDialog : public ControllerDialog { @@ -97,6 +102,11 @@ class PeakControllerDialog : public ControllerDialog PeakController * m_peakController; -} ; +}; + + +} // namespace gui + +} // namespace lmms #endif diff --git a/include/PerfLog.h b/include/PerfLog.h index f9790113dd6..b90bf340e79 100644 --- a/include/PerfLog.h +++ b/include/PerfLog.h @@ -28,6 +28,10 @@ #include #include +namespace lmms +{ + + /// \brief CPU time point /// /// Represents a point in CPU time (not wall-clock time) intended for measuring @@ -70,4 +74,7 @@ class PerfLogTimer PerfTime begin_time; }; + +} // namespace lmms + #endif diff --git a/include/Piano.h b/include/Piano.h index ece3abb0631..b9f5e979705 100644 --- a/include/Piano.h +++ b/include/Piano.h @@ -28,6 +28,10 @@ #include "Note.h" #include "Model.h" +namespace lmms +{ + + class InstrumentTrack; class MidiEventProcessor; @@ -82,5 +86,8 @@ class Piano final : public Model } ; + +} // namespace lmms + #endif diff --git a/include/PianoRoll.h b/include/PianoRoll.h index dd32f7c81fe..5dd9c94f6f7 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -49,11 +49,21 @@ class QString; class QMenu; class QToolButton; -class ComboBox; +namespace lmms +{ + + class NotePlayHandle; class Pattern; + + +namespace gui +{ + +class ComboBox; class TimeLineWidget; + class PianoRoll : public QWidget { Q_OBJECT @@ -559,4 +569,8 @@ private slots: }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/PianoView.h b/include/PianoView.h index 88854943176..7a6ab647953 100644 --- a/include/PianoView.h +++ b/include/PianoView.h @@ -31,8 +31,13 @@ #include "AutomatableModel.h" #include "ModelView.h" +namespace lmms +{ + class Piano; +namespace gui +{ class PianoView : public QWidget, public ModelView { @@ -94,4 +99,8 @@ private slots: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/Pitch.h b/include/Pitch.h index 17de48b940b..3f58785eae0 100644 --- a/include/Pitch.h +++ b/include/Pitch.h @@ -27,6 +27,10 @@ #include +namespace lmms +{ + + typedef int16_t pitch_t; constexpr pitch_t CentsPerSemitone = 100; @@ -34,4 +38,7 @@ constexpr pitch_t MinPitchDefault = -CentsPerSemitone; constexpr pitch_t MaxPitchDefault = CentsPerSemitone; constexpr pitch_t DefaultPitch = 0; + +} // namespace lmms + #endif diff --git a/include/PixmapButton.h b/include/PixmapButton.h index e2fb5888508..f4062826d01 100644 --- a/include/PixmapButton.h +++ b/include/PixmapButton.h @@ -30,6 +30,9 @@ #include "AutomatableButton.h" +namespace lmms::gui +{ + class LMMS_EXPORT PixmapButton : public AutomatableButton { @@ -62,4 +65,7 @@ class LMMS_EXPORT PixmapButton : public AutomatableButton } ; + +} // namespace lmms::gui + #endif diff --git a/include/PlayHandle.h b/include/PlayHandle.h index 1ddd632d1c3..15944a83594 100644 --- a/include/PlayHandle.h +++ b/include/PlayHandle.h @@ -37,6 +37,9 @@ class QThread; +namespace lmms +{ + class Track; class AudioPort; @@ -163,5 +166,6 @@ class LMMS_EXPORT PlayHandle : public ThreadableJob typedef QList PlayHandleList; typedef QList ConstPlayHandleList; +} // namespace lmms #endif diff --git a/include/Plugin.h b/include/Plugin.h index fb7e592bd53..93361a5d9de 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -36,9 +36,18 @@ class QWidget; +namespace lmms +{ + +class AutomatableModel; class PixmapLoader; + +namespace gui +{ + class PluginView; -class AutomatableModel; + +} /** Abstract representation of a plugin @@ -287,11 +296,11 @@ class LMMS_EXPORT Plugin : public Model, public JournallingObject static Plugin * instantiate(const QString& pluginName, Model * parent, void *data); //! Create a view for the model - PluginView * createView( QWidget * parent ); + gui::PluginView * createView( QWidget * parent ); protected: //! Create a view for the model - virtual PluginView* instantiateView( QWidget * ) = 0; + virtual gui::PluginView* instantiateView( QWidget * ) = 0; void collectErrorForUI( QString errMsg ); @@ -306,4 +315,6 @@ class LMMS_EXPORT Plugin : public Model, public JournallingObject } ; +} // namespace lmms + #endif diff --git a/include/PluginBrowser.h b/include/PluginBrowser.h index fa13f246916..950b737d9f5 100644 --- a/include/PluginBrowser.h +++ b/include/PluginBrowser.h @@ -34,6 +34,8 @@ class QLineEdit; class QTreeWidget; +namespace lmms::gui +{ class PluginBrowser : public SideBarWidget { @@ -82,4 +84,6 @@ class PluginDescWidget : public QWidget }; +} // namespace lmms::gui + #endif diff --git a/include/PluginFactory.h b/include/PluginFactory.h index a1f84f8d1e8..ce8c7e2ec6e 100644 --- a/include/PluginFactory.h +++ b/include/PluginFactory.h @@ -39,6 +39,9 @@ class QLibrary; +namespace lmms +{ + class LMMS_EXPORT PluginFactory { public: @@ -106,4 +109,7 @@ public slots: //Short-hand function LMMS_EXPORT PluginFactory* getPluginFactory(); + +} // namespace lmms + #endif // PLUGINFACTORY_H diff --git a/include/PluginIssue.h b/include/PluginIssue.h index 8bfad5bf10f..6e034724cde 100644 --- a/include/PluginIssue.h +++ b/include/PluginIssue.h @@ -28,6 +28,10 @@ #include #include + +namespace lmms +{ + //! Types of issues that can cause LMMS to not load a plugin //! LMMS Plugins should use this to indicate errors enum PluginIssueType @@ -77,6 +81,10 @@ class PluginIssue friend QDebug operator<<(QDebug stream, const PluginIssue& iss); }; -QDebug operator<<(QDebug stream, const PluginIssue& iss); + +} // namespace lmms + +QDebug operator<<(QDebug stream, const lmms::PluginIssue& iss); + #endif // PLUGINISSUE_H diff --git a/include/PluginView.h b/include/PluginView.h index 476d65acf49..2c06b9ba23d 100644 --- a/include/PluginView.h +++ b/include/PluginView.h @@ -30,6 +30,8 @@ #include "Plugin.h" #include "ModelView.h" +namespace lmms::gui +{ class LMMS_EXPORT PluginView : public QWidget, public ModelView { @@ -43,4 +45,6 @@ class LMMS_EXPORT PluginView : public QWidget, public ModelView } ; +} // namespace lmms::gui + #endif diff --git a/include/PositionLine.h b/include/PositionLine.h index e9ec8c3d529..cc1313e578e 100644 --- a/include/PositionLine.h +++ b/include/PositionLine.h @@ -28,6 +28,9 @@ #include +namespace lmms::gui +{ + class PositionLine : public QWidget { Q_OBJECT @@ -46,4 +49,6 @@ public slots: QColor m_lineColor; }; +} // namespace lmms::gui + #endif diff --git a/include/PresetPreviewPlayHandle.h b/include/PresetPreviewPlayHandle.h index fcdecf6b8bb..9dd15133030 100644 --- a/include/PresetPreviewPlayHandle.h +++ b/include/PresetPreviewPlayHandle.h @@ -28,6 +28,9 @@ #include "NotePlayHandle.h" +namespace lmms +{ + class DataFile; class InstrumentTrack; @@ -64,4 +67,6 @@ class LMMS_EXPORT PresetPreviewPlayHandle : public PlayHandle } ; +} // namespace lmms + #endif diff --git a/include/ProjectJournal.h b/include/ProjectJournal.h index d19d02d7ed0..99d02f8365c 100644 --- a/include/ProjectJournal.h +++ b/include/ProjectJournal.h @@ -31,6 +31,11 @@ #include "lmms_basics.h" #include "DataFile.h" + +namespace lmms +{ + + class JournallingObject; @@ -119,5 +124,7 @@ class ProjectJournal } ; +} // namespace lmms + #endif diff --git a/include/ProjectNotes.h b/include/ProjectNotes.h index fc97a8844e7..21801fdaec4 100644 --- a/include/ProjectNotes.h +++ b/include/ProjectNotes.h @@ -36,6 +36,9 @@ class QComboBox; class QTextCharFormat; class QTextEdit; +namespace lmms::gui +{ + class LMMS_EXPORT ProjectNotes : public QMainWindow, public SerializingObject { @@ -90,4 +93,6 @@ private slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/ProjectRenderer.h b/include/ProjectRenderer.h index ce5d6af3c61..bd61c4730b2 100644 --- a/include/ProjectRenderer.h +++ b/include/ProjectRenderer.h @@ -32,6 +32,10 @@ #include "lmms_export.h" +namespace lmms +{ + + class LMMS_EXPORT ProjectRenderer : public QThread { Q_OBJECT @@ -96,4 +100,7 @@ public slots: } ; + +} // namespace lmms + #endif diff --git a/include/ProjectVersion.h b/include/ProjectVersion.h index 94ee9c6ba89..cd72871fda4 100644 --- a/include/ProjectVersion.h +++ b/include/ProjectVersion.h @@ -32,6 +32,10 @@ #include +namespace lmms +{ + + /*! \brief Version number parsing and comparison * * Parses and compares version information. i.e. "1.0.3" < "1.0.10" @@ -75,4 +79,7 @@ inline bool operator>=(const ProjectVersion & v1, const ProjectVersion & v2) { r inline bool operator==(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) == 0; } inline bool operator!=(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) != 0; } + +} // namespace lmms + #endif diff --git a/include/QuadratureLfo.h b/include/QuadratureLfo.h index b530937b0f9..42d4d32c03d 100644 --- a/include/QuadratureLfo.h +++ b/include/QuadratureLfo.h @@ -27,6 +27,10 @@ #include "lmms_math.h" +namespace lmms +{ + + class QuadratureLfo { public: @@ -93,4 +97,7 @@ class QuadratureLfo }; + +} // namespace lmms + #endif // QUADRATURELFO_H diff --git a/include/RecentProjectsMenu.h b/include/RecentProjectsMenu.h index b3837ee2e31..33f7ff1b7fb 100644 --- a/include/RecentProjectsMenu.h +++ b/include/RecentProjectsMenu.h @@ -3,6 +3,10 @@ #include +namespace lmms::gui +{ + + class RecentProjectsMenu : public QMenu { Q_OBJECT @@ -14,4 +18,7 @@ private slots: void openProject(QAction * _action ); }; + +} // namespace lmms::gui + #endif // RECENTPROJECTSMENU_H diff --git a/include/RemotePlugin.h b/include/RemotePlugin.h index fd3ef5e09e1..254eb3afa6e 100644 --- a/include/RemotePlugin.h +++ b/include/RemotePlugin.h @@ -101,6 +101,10 @@ typedef int32_t key_t; #endif +namespace lmms +{ + + #ifdef SYNC_WITH_SHM_FIFO // sometimes we need to exchange bigger messages (e.g. for VST parameter dumps) // so set a usable value here @@ -1452,6 +1456,9 @@ LMMS_EXPORT inline std::string QSTR_TO_STDSTR(QString const& qstr) return qstr.toStdString(); } -#endif +#endif // BUILD_REMOTE_PLUGIN_CLIENT + + +} // namespace lmms #endif diff --git a/include/RenameDialog.h b/include/RenameDialog.h index 8f526baddad..c1e30b9d866 100644 --- a/include/RenameDialog.h +++ b/include/RenameDialog.h @@ -32,6 +32,8 @@ class QLineEdit; +namespace lmms::gui +{ class RenameDialog : public QDialog { @@ -58,4 +60,6 @@ protected slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/RenderManager.h b/include/RenderManager.h index 93598370241..ff59cb95377 100644 --- a/include/RenderManager.h +++ b/include/RenderManager.h @@ -32,6 +32,10 @@ #include "OutputSettings.h" +namespace lmms +{ + + class RenderManager : public QObject { Q_OBJECT @@ -78,4 +82,7 @@ private slots: QVector m_unmuted; } ; + +} // namespace lmms + #endif diff --git a/include/RingBuffer.h b/include/RingBuffer.h index c7e91bd3392..5d5f2974b58 100644 --- a/include/RingBuffer.h +++ b/include/RingBuffer.h @@ -32,6 +32,11 @@ #include "lmms_math.h" #include "MemoryManager.h" + +namespace lmms +{ + + /** \brief A basic LMMS ring buffer for single-thread use. For thread and realtime safe alternative see LocklessRingBuffer. */ class LMMS_EXPORT RingBuffer : public QObject @@ -216,4 +221,8 @@ protected slots: volatile unsigned int m_position; }; + + +} // namespace lmms + #endif diff --git a/include/RmsHelper.h b/include/RmsHelper.h index f5f2770fa2e..19b7da89cfc 100644 --- a/include/RmsHelper.h +++ b/include/RmsHelper.h @@ -28,6 +28,11 @@ #include "lmms_math.h" + +namespace lmms +{ + + class RmsHelper { public: @@ -91,4 +96,6 @@ class RmsHelper }; +} // namespace lmms + #endif diff --git a/include/RowTableView.h b/include/RowTableView.h index a7b07c2c893..fc55383a1c1 100644 --- a/include/RowTableView.h +++ b/include/RowTableView.h @@ -27,6 +27,9 @@ #include +namespace lmms::gui +{ + class RowDelegate; @@ -51,5 +54,6 @@ class RowTableView : public QTableView } ; +} // namespace lmms::gui #endif diff --git a/include/Rubberband.h b/include/Rubberband.h index eeb3c7e5b9a..27b67d0a430 100644 --- a/include/Rubberband.h +++ b/include/Rubberband.h @@ -30,6 +30,9 @@ #include #include +namespace lmms::gui +{ + class selectableObject : public QWidget { @@ -90,5 +93,7 @@ class RubberBand : public QRubberBand }; +} // namespace lmms::gui + #endif diff --git a/include/SampleBuffer.h b/include/SampleBuffer.h index d1e594b2c06..37ef653d3c1 100644 --- a/include/SampleBuffer.h +++ b/include/SampleBuffer.h @@ -44,6 +44,9 @@ class QPainter; class QRect; +namespace lmms +{ + // values for buffer margins, used for various libsamplerate interpolation modes // the array positions correspond to the converter_type parameter values in libsamplerate // if there appears problems with playback on some interpolation mode, then the value for that mode @@ -351,5 +354,6 @@ public slots: } ; +} // namespace lmms #endif diff --git a/include/SamplePlayHandle.h b/include/SamplePlayHandle.h index 33f5ebe5294..ec39e07c9be 100644 --- a/include/SamplePlayHandle.h +++ b/include/SamplePlayHandle.h @@ -30,6 +30,10 @@ #include "AutomatableModel.h" #include "PlayHandle.h" +namespace lmms +{ + + class BBTrack; class SampleTCO; class Track; @@ -94,4 +98,6 @@ class SamplePlayHandle : public PlayHandle } ; +} // namespace lmms + #endif diff --git a/include/SampleRecordHandle.h b/include/SampleRecordHandle.h index f2a6fd63be4..770caa29f39 100644 --- a/include/SampleRecordHandle.h +++ b/include/SampleRecordHandle.h @@ -32,6 +32,10 @@ #include "PlayHandle.h" #include "TimePos.h" +namespace lmms +{ + + class BBTrack; class SampleBuffer; class SampleTCO; @@ -69,4 +73,6 @@ class SampleRecordHandle : public PlayHandle } ; +} // namespace lmms + #endif diff --git a/include/SampleTCO.h b/include/SampleTCO.h index 616dba04432..f4abce309ad 100644 --- a/include/SampleTCO.h +++ b/include/SampleTCO.h @@ -28,7 +28,10 @@ #include "SampleBuffer.h" #include "SampleTrack.h" #include "TrackContentObject.h" - + +namespace lmms +{ + class SampleTCO : public TrackContentObject { @@ -88,5 +91,6 @@ public slots: } ; +} // namespace lmms #endif \ No newline at end of file diff --git a/include/SampleTCOView.h b/include/SampleTCOView.h index 37b77d5306a..ca051b3c5f4 100644 --- a/include/SampleTCOView.h +++ b/include/SampleTCOView.h @@ -30,6 +30,10 @@ #include "SampleTCO.h" #include "TrackContentObjectView.h" +namespace lmms::gui +{ + + class SampleTCOView : public TrackContentObjectView { Q_OBJECT @@ -61,5 +65,6 @@ public slots: } ; +} // namespace lmms::gui #endif \ No newline at end of file diff --git a/include/SampleTrack.h b/include/SampleTrack.h index c2d984434ed..738eae7eb07 100644 --- a/include/SampleTrack.h +++ b/include/SampleTrack.h @@ -35,6 +35,10 @@ #include "Track.h" +namespace lmms +{ + + class SampleTrack : public Track { Q_OBJECT @@ -101,5 +105,6 @@ public slots: } ; +} // namespace lmms #endif \ No newline at end of file diff --git a/include/SampleTrackView.h b/include/SampleTrackView.h index 4942cd18dfa..f4bd174adcf 100644 --- a/include/SampleTrackView.h +++ b/include/SampleTrackView.h @@ -29,8 +29,16 @@ #include "TrackView.h" -class Knob; +namespace lmms +{ + class SampleTrack; + + +namespace gui +{ + +class Knob; class SampleTrackWindow; class TrackLabelButton; @@ -98,5 +106,8 @@ private slots: } ; +} // namespace gui + +} // namespace lmms #endif \ No newline at end of file diff --git a/include/SampleTrackWindow.h b/include/SampleTrackWindow.h index e73a66c2cab..ca9826f374e 100644 --- a/include/SampleTrackWindow.h +++ b/include/SampleTrackWindow.h @@ -32,7 +32,10 @@ #include "EffectRackView.h" #include "SampleTrack.h" - + +namespace lmms::gui +{ + class SampleTrackWindow : public QWidget, public ModelView, public SerializingObjectHook { @@ -89,4 +92,7 @@ public slots: +} // namespace lmms::gui + + #endif \ No newline at end of file diff --git a/include/Scale.h b/include/Scale.h index 5d371502205..ef3c7751821 100644 --- a/include/Scale.h +++ b/include/Scale.h @@ -33,6 +33,9 @@ #include "SerializingObject.h" +namespace lmms +{ + class Interval : public SerializingObject { public: @@ -84,4 +87,7 @@ class Scale : public QObject, public SerializingObject }; + +} // namespace lmms + #endif diff --git a/include/SendButtonIndicator.h b/include/SendButtonIndicator.h index b60113758d7..c9bbd83fd69 100644 --- a/include/SendButtonIndicator.h +++ b/include/SendButtonIndicator.h @@ -8,6 +8,9 @@ #include "FxLine.h" #include "FxMixerView.h" +namespace lmms::gui +{ + class FxLine; class FxMixerView; @@ -30,4 +33,7 @@ class SendButtonIndicator : public QLabel FloatModel * getSendModel(); }; + +} // namespace lmms::gui + #endif // SENDBUTTONINDICATOR_H diff --git a/include/SerializingObject.h b/include/SerializingObject.h index fbcda9187d6..06e730ed4f4 100644 --- a/include/SerializingObject.h +++ b/include/SerializingObject.h @@ -33,6 +33,9 @@ class QDomDocument; class QDomElement; +namespace lmms +{ + class SerializingObjectHook; @@ -96,5 +99,7 @@ class SerializingObjectHook } ; +} // namespace lmms + #endif diff --git a/include/SetupDialog.h b/include/SetupDialog.h index 760d86fbcbc..cfa279c6fe6 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -42,6 +42,11 @@ class QLabel; class QLineEdit; class QSlider; + +namespace lmms::gui +{ + + class TabBar; class SetupDialog : public QDialog @@ -208,4 +213,8 @@ private slots: QLabel * restartWarningLbl; }; + + +} // namespace lmms::gui + #endif diff --git a/include/SideBar.h b/include/SideBar.h index aab126ae385..8176529f8d4 100644 --- a/include/SideBar.h +++ b/include/SideBar.h @@ -30,6 +30,10 @@ #include class QToolButton; + +namespace lmms::gui +{ + class SideBarWidget; @@ -54,4 +58,6 @@ private slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/SideBarWidget.h b/include/SideBarWidget.h index 9972daa7c19..ab1cf6c50eb 100644 --- a/include/SideBarWidget.h +++ b/include/SideBarWidget.h @@ -30,6 +30,9 @@ #include #include +namespace lmms::gui +{ + class SideBarWidget : public QWidget { @@ -83,4 +86,7 @@ class SideBarWidget : public QWidget } ; + +} // namespace lmms::gui + #endif diff --git a/include/Song.h b/include/Song.h index 9639ce14ebc..0762c6965f3 100644 --- a/include/Song.h +++ b/include/Song.h @@ -42,10 +42,16 @@ #include "Scale.h" #include "VstSyncController.h" +namespace lmms +{ class AutomationTrack; class Pattern; + +namespace gui +{ class TimeLineWidget; +} const bpm_t MinTempo = 10; @@ -117,7 +123,7 @@ class LMMS_EXPORT Song : public TrackContainer { return m_jumped; } - TimeLineWidget * m_timeLine; + gui::TimeLineWidget * m_timeLine; private: float m_currentFrame; @@ -518,4 +524,6 @@ private slots: } ; +} // namespace lmms + #endif diff --git a/include/SongEditor.h b/include/SongEditor.h index 6c5f9eb6e6d..7aaf104c90b 100644 --- a/include/SongEditor.h +++ b/include/SongEditor.h @@ -38,12 +38,20 @@ class QLabel; class QScrollBar; +namespace lmms +{ + +class Song; +class ComboBoxModel; + +namespace gui +{ + + class AutomatableSlider; class ComboBox; -class ComboBoxModel; class LcdSpinBox; class MeterDialog; -class Song; class TextFloat; class TimeLineWidget; @@ -217,4 +225,9 @@ protected slots: QAction* m_removeBarAction; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/StepRecorder.h b/include/StepRecorder.h index 13b3577a86c..b2a9847e218 100644 --- a/include/StepRecorder.h +++ b/include/StepRecorder.h @@ -30,15 +30,23 @@ #include "lmms_basics.h" #include "Pattern.h" +namespace lmms +{ + + + +namespace gui +{ class PianoRoll; class StepRecorderWidget; +} // namespace gui class StepRecorder : public QObject { Q_OBJECT public: - StepRecorder(PianoRoll& pianoRoll, StepRecorderWidget& stepRecorderWidget); + StepRecorder(gui::PianoRoll& pianoRoll, gui::StepRecorderWidget& stepRecorderWidget); void initialize(); void start(const TimePos& currentPosition,const TimePos& stepLength); @@ -80,8 +88,8 @@ class StepRecorder : public QObject bool allCurStepNotesReleased(); - PianoRoll& m_pianoRoll; - StepRecorderWidget& m_stepRecorderWidget; + gui::PianoRoll& m_pianoRoll; + gui::StepRecorderWidget& m_stepRecorderWidget; bool m_isRecording = false; TimePos m_curStepStartPos = 0; @@ -140,4 +148,7 @@ class StepRecorder : public QObject bool m_isStepInProgress = false; }; + +} // namespace lmms + #endif //STEP_RECORDER_H diff --git a/include/StepRecorderWidget.h b/include/StepRecorderWidget.h index dfaeaed0aa6..ab7d87d85ca 100644 --- a/include/StepRecorderWidget.h +++ b/include/StepRecorderWidget.h @@ -29,6 +29,9 @@ #include #include +namespace lmms::gui +{ + class StepRecorderWidget : public QWidget { Q_OBJECT @@ -91,4 +94,6 @@ class StepRecorderWidget : public QWidget void positionChanged(const TimePos & t); } ; +} // namespace lmms::gui + #endif //STEP_RECOREDER_WIDGET_H diff --git a/include/StringPairDrag.h b/include/StringPairDrag.h index 969a12eec4e..9da2381b033 100644 --- a/include/StringPairDrag.h +++ b/include/StringPairDrag.h @@ -35,6 +35,9 @@ class QPixmap; +namespace lmms::gui +{ + class LMMS_EXPORT StringPairDrag : public QDrag { @@ -50,4 +53,6 @@ class LMMS_EXPORT StringPairDrag : public QDrag } ; +} // namespace lmms::gui + #endif diff --git a/include/SubWindow.h b/include/SubWindow.h index e2b1a9a37eb..d1e28820068 100644 --- a/include/SubWindow.h +++ b/include/SubWindow.h @@ -39,6 +39,10 @@ class QMoveEvent; class QResizeEvent; class QWidget; +namespace lmms::gui +{ + + /** * @brief The SubWindow class * @@ -97,4 +101,8 @@ private slots: void focusChanged( QMdiSubWindow * subWindow ); }; + + +} // namespace lmms::gui + #endif diff --git a/include/SweepOscillator.h b/include/SweepOscillator.h index 0e54e6cce81..2e795be3b42 100644 --- a/include/SweepOscillator.h +++ b/include/SweepOscillator.h @@ -28,6 +28,8 @@ #include "Oscillator.h" #include "DspEffectLibrary.h" +namespace lmms +{ template class SweepOscillator @@ -67,4 +69,6 @@ class SweepOscillator } ; +} // namespace lmms + #endif diff --git a/include/TabBar.h b/include/TabBar.h index 48b429bd54e..1c74a994721 100644 --- a/include/TabBar.h +++ b/include/TabBar.h @@ -33,6 +33,10 @@ #include "lmms_export.h" +namespace lmms::gui +{ + + class TabButton; @@ -85,4 +89,6 @@ protected slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/TabButton.h b/include/TabButton.h index ffb425d710d..d5d70fcac82 100644 --- a/include/TabButton.h +++ b/include/TabButton.h @@ -28,6 +28,9 @@ #include +namespace lmms::gui +{ + class TabButton : public QPushButton { @@ -63,4 +66,7 @@ protected slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/TabWidget.h b/include/TabWidget.h index 4442ef643f9..b1939beb7ee 100644 --- a/include/TabWidget.h +++ b/include/TabWidget.h @@ -29,6 +29,9 @@ #include #include +namespace lmms::gui +{ + const int TEXT_TAB_HEIGHT = 14; const int GRAPHIC_TAB_HEIGHT = 17; @@ -106,4 +109,7 @@ class TabWidget : public QWidget QColor m_tabBorder; // The TabWidget's borders color. } ; + +} // namespace lmms::gui + #endif diff --git a/include/TemplatesMenu.h b/include/TemplatesMenu.h index 049f1f47eeb..9f0afe13fe2 100644 --- a/include/TemplatesMenu.h +++ b/include/TemplatesMenu.h @@ -4,6 +4,11 @@ #include #include + +namespace lmms::gui +{ + + class TemplatesMenu : public QMenu { Q_OBJECT @@ -18,4 +23,7 @@ private slots: }; + +} // namespace lmms::gui + #endif // TEMPLATESMENU_H diff --git a/include/TempoSyncKnob.h b/include/TempoSyncKnob.h index 12851f6e538..09e1243372d 100644 --- a/include/TempoSyncKnob.h +++ b/include/TempoSyncKnob.h @@ -32,6 +32,9 @@ #include "Knob.h" #include "TempoSyncKnobModel.h" +namespace lmms::gui +{ + class MeterDialog; class LMMS_EXPORT TempoSyncKnob : public Knob @@ -79,4 +82,6 @@ protected slots: +} // namespace lmms::gui + #endif diff --git a/include/TempoSyncKnobModel.h b/include/TempoSyncKnobModel.h index b9512aa1a93..281ec55c2f1 100644 --- a/include/TempoSyncKnobModel.h +++ b/include/TempoSyncKnobModel.h @@ -30,6 +30,9 @@ class QAction; +namespace lmms +{ + class LMMS_EXPORT TempoSyncKnobModel : public FloatModel { Q_OBJECT @@ -102,4 +105,6 @@ protected slots: } ; +} // namespace lmms + #endif diff --git a/include/TextFloat.h b/include/TextFloat.h index 1df7ed46ac6..580c3b9792a 100644 --- a/include/TextFloat.h +++ b/include/TextFloat.h @@ -31,6 +31,8 @@ #include "lmms_export.h" +namespace lmms::gui +{ class LMMS_EXPORT TextFloat : public QWidget { @@ -79,4 +81,7 @@ class LMMS_EXPORT TextFloat : public QWidget }; + +} // namespace lmms::gui + #endif diff --git a/include/ThreadableJob.h b/include/ThreadableJob.h index b2b20e9be95..8e714ae19cf 100644 --- a/include/ThreadableJob.h +++ b/include/ThreadableJob.h @@ -29,6 +29,9 @@ #include +namespace lmms +{ + class ThreadableJob { public: @@ -85,4 +88,6 @@ class ThreadableJob std::atomic m_state; } ; +} // namespace lmms + #endif diff --git a/include/TimeDisplayWidget.h b/include/TimeDisplayWidget.h index 303ce6d5eb4..d8e38333a89 100644 --- a/include/TimeDisplayWidget.h +++ b/include/TimeDisplayWidget.h @@ -31,6 +31,8 @@ #include "LcdWidget.h" +namespace lmms::gui +{ class TimeDisplayWidget : public QWidget { @@ -67,4 +69,6 @@ private slots: } ; +} // namespace lmms::gui + #endif // TIME_DISPLAY_WIDGET_H diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index c7ac0124c9e..76eaaa1c407 100644 --- a/include/TimeLineWidget.h +++ b/include/TimeLineWidget.h @@ -33,6 +33,10 @@ class QPixmap; class QToolBar; + +namespace lmms::gui +{ + class NStateButton; class TextFloat; class SongEditor; @@ -250,4 +254,7 @@ public slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/TimePos.h b/include/TimePos.h index 675416c4299..c758ac5c91e 100644 --- a/include/TimePos.h +++ b/include/TimePos.h @@ -32,6 +32,9 @@ #include "lmms_export.h" #include "lmms_basics.h" +namespace lmms +{ + // note: a bar was erroneously called "tact" in older versions of LMMS const int DefaultTicksPerBar = 192; const int DefaultStepsPerBar = 16; @@ -114,4 +117,6 @@ class LMMS_EXPORT TimePos } ; +} // namespace lmms + #endif diff --git a/include/ToolButton.h b/include/ToolButton.h index 196ec48f077..909af6f9aed 100644 --- a/include/ToolButton.h +++ b/include/ToolButton.h @@ -29,6 +29,8 @@ #include #include +namespace lmms::gui +{ class ToolButton : public QToolButton { @@ -46,5 +48,7 @@ class ToolButton : public QToolButton } ; +} // namespace lmms::gui + #endif diff --git a/include/ToolPlugin.h b/include/ToolPlugin.h index 8a65147ac80..899c3190605 100644 --- a/include/ToolPlugin.h +++ b/include/ToolPlugin.h @@ -29,6 +29,11 @@ #include "Plugin.h" + +namespace lmms +{ + + class LMMS_EXPORT ToolPlugin : public Plugin { public: @@ -42,4 +47,7 @@ class LMMS_EXPORT ToolPlugin : public Plugin } ; + +} // namespace lmms + #endif diff --git a/include/ToolPluginView.h b/include/ToolPluginView.h index 2b64caaafd3..0b702fd1bf7 100644 --- a/include/ToolPluginView.h +++ b/include/ToolPluginView.h @@ -28,8 +28,15 @@ #include "PluginView.h" +namespace lmms +{ + class ToolPlugin; +namespace gui +{ + + class LMMS_EXPORT ToolPluginView : public PluginView { public: @@ -38,4 +45,8 @@ class LMMS_EXPORT ToolPluginView : public PluginView } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ToolTip.h b/include/ToolTip.h index 7f769a05b2a..89f706d5ab7 100644 --- a/include/ToolTip.h +++ b/include/ToolTip.h @@ -32,6 +32,8 @@ class QWidget; +namespace lmms::gui +{ struct ToolTip { @@ -39,4 +41,6 @@ struct ToolTip } ; +} // namespace lmms::gui + #endif diff --git a/include/Track.h b/include/Track.h index dc7f418e96b..623dd184140 100644 --- a/include/Track.h +++ b/include/Track.h @@ -34,11 +34,21 @@ #include "lmms_basics.h" +namespace lmms +{ + class TimePos; class TrackContainer; -class TrackContainerView; class TrackContentObject; + + +namespace gui +{ + class TrackView; +class TrackContainerView; + +} /*! The minimum track height in pixels @@ -93,7 +103,7 @@ class LMMS_EXPORT Track : public Model, public JournallingObject const f_cnt_t frameBase, int tcoNum = -1 ) = 0; - virtual TrackView * createView( TrackContainerView * view ) = 0; + virtual gui::TrackView* createView( gui::TrackContainerView* view ) = 0; virtual TrackContentObject * createTCO( const TimePos & pos ) = 0; virtual void saveTrackSpecificSettings( QDomDocument & doc, @@ -222,7 +232,7 @@ public slots: QColor m_color; bool m_hasColor; - friend class TrackView; + friend class gui::TrackView; signals: @@ -234,5 +244,6 @@ public slots: } ; +} // namespace lmms #endif diff --git a/include/TrackContainer.h b/include/TrackContainer.h index 895d4e6c3df..2d332782645 100644 --- a/include/TrackContainer.h +++ b/include/TrackContainer.h @@ -31,11 +31,19 @@ #include "Track.h" #include "JournallingObject.h" +namespace lmms +{ class AutomationPattern; class InstrumentTrack; + +namespace gui +{ + class TrackContainerView; +} + class LMMS_EXPORT TrackContainer : public Model, public JournallingObject { @@ -109,10 +117,11 @@ class LMMS_EXPORT TrackContainer : public Model, public JournallingObject TrackContainerTypes m_TrackContainerType; - friend class TrackContainerView; + friend class gui::TrackContainerView; friend class Track; } ; +} // namespace lmms #endif diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index ebc4e42a6ea..607cdf8e6cd 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -39,9 +39,29 @@ class QVBoxLayout; +namespace lmms +{ + class InstrumentTrack; class TrackContainer; +class InstrumentLoaderThread : public QThread +{ +Q_OBJECT +public: + InstrumentLoaderThread( QObject *parent = 0, InstrumentTrack *it = 0, + QString name = "" ); + + void run() override; + +private: + InstrumentTrack *m_it; + QString m_name; + QThread *m_containerThread; +}; + +namespace gui +{ class TrackContainerView : public QWidget, public ModelView, public JournallingObject, @@ -191,19 +211,9 @@ public slots: } ; -class InstrumentLoaderThread : public QThread -{ - Q_OBJECT -public: - InstrumentLoaderThread( QObject *parent = 0, InstrumentTrack *it = 0, - QString name = "" ); - void run() override; +} // namespace gui -private: - InstrumentTrack *m_it; - QString m_name; - QThread *m_containerThread; -}; +} // namespace lmms #endif diff --git a/include/TrackContentObject.h b/include/TrackContentObject.h index 3945c0ac33b..6bd3c6a178b 100644 --- a/include/TrackContentObject.h +++ b/include/TrackContentObject.h @@ -31,10 +31,19 @@ #include "lmms_basics.h" +namespace lmms +{ + class Track; -class TrackContentObjectView; class TrackContainer; + +namespace gui +{ + class TrackView; +class TrackContentObjectView; + +} // namespace gui class LMMS_EXPORT TrackContentObject : public Model, public JournallingObject @@ -117,7 +126,7 @@ class LMMS_EXPORT TrackContentObject : public Model, public JournallingObject virtual void movePosition( const TimePos & pos ); virtual void changeLength( const TimePos & length ); - virtual TrackContentObjectView * createView( TrackView * tv ) = 0; + virtual gui::TrackContentObjectView * createView( gui::TrackView * tv ) = 0; inline void selectViewOnCreate( bool select ) { @@ -178,4 +187,6 @@ public slots: } ; +} // namespace lmms + #endif diff --git a/include/TrackContentObjectView.h b/include/TrackContentObjectView.h index 5f823eb6f99..db15faa55ed 100644 --- a/include/TrackContentObjectView.h +++ b/include/TrackContentObjectView.h @@ -36,9 +36,16 @@ class QMenu; class QContextMenuEvent; +namespace lmms +{ + class DataFile; -class TextFloat; class TrackContentObject; + +namespace gui +{ + +class TextFloat; class TrackView; @@ -239,4 +246,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/TrackContentWidget.h b/include/TrackContentWidget.h index 37362319b76..eb298f8cde3 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -33,8 +33,15 @@ class QMimeData; +namespace lmms +{ + class Track; class TrackContentObjectView; + +namespace gui +{ + class TrackView; @@ -139,5 +146,8 @@ public slots: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/TrackLabelButton.h b/include/TrackLabelButton.h index 7d9726febde..584c8666005 100644 --- a/include/TrackLabelButton.h +++ b/include/TrackLabelButton.h @@ -29,6 +29,9 @@ #include #include +namespace lmms::gui +{ + class TrackView; class TrackRenameLineEdit; @@ -67,4 +70,7 @@ public slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/TrackOperationsWidget.h b/include/TrackOperationsWidget.h index 20c59e95162..404a8aa772d 100644 --- a/include/TrackOperationsWidget.h +++ b/include/TrackOperationsWidget.h @@ -29,6 +29,9 @@ class QPushButton; +namespace lmms::gui +{ + class PixmapButton; class TrackView; @@ -74,4 +77,7 @@ private slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/TrackRenameLineEdit.h b/include/TrackRenameLineEdit.h index e681a2d212c..4b13ff9b749 100644 --- a/include/TrackRenameLineEdit.h +++ b/include/TrackRenameLineEdit.h @@ -29,6 +29,9 @@ #include +namespace lmms::gui +{ + class TrackRenameLineEdit : public QLineEdit { Q_OBJECT @@ -43,4 +46,6 @@ class TrackRenameLineEdit : public QLineEdit QString m_oldName; } ; +} // namespace lmms::gui + #endif diff --git a/include/TrackView.h b/include/TrackView.h index 1029e148c1d..09afd9c054e 100644 --- a/include/TrackView.h +++ b/include/TrackView.h @@ -37,12 +37,20 @@ class QMenu; -class FadeButton; +namespace lmms +{ + class Track; -class TrackContainerView; class TrackContentObject; +namespace gui +{ + +class FadeButton; +class TrackContainerView; + + const int DEFAULT_SETTINGS_WIDGET_WIDTH = 224; const int TRACK_OP_WIDTH = 78; // This shaves 150-ish pixels off track buttons, @@ -169,5 +177,8 @@ private slots: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/ValueBuffer.h b/include/ValueBuffer.h index f9869de8888..24c8e0daa19 100644 --- a/include/ValueBuffer.h +++ b/include/ValueBuffer.h @@ -31,6 +31,10 @@ #include "MemoryManager.h" #include "lmms_export.h" +namespace lmms +{ + + class LMMS_EXPORT ValueBuffer : public std::vector { MM_OPERATORS @@ -50,4 +54,7 @@ class LMMS_EXPORT ValueBuffer : public std::vector void interpolate(float start, float end); }; + +} // namespace lmms + #endif diff --git a/include/VersionedSaveDialog.h b/include/VersionedSaveDialog.h index bb4894500f7..79ab516b0c2 100644 --- a/include/VersionedSaveDialog.h +++ b/include/VersionedSaveDialog.h @@ -32,6 +32,10 @@ #include "Song.h" class QLineEdit; + +namespace lmms::gui +{ + class LedCheckBox; class SaveOptionsWidget : public QWidget { @@ -62,4 +66,7 @@ public slots: void decrementVersion(); }; + +} // namespace lmms::gui + #endif // VERSIONEDSAVEDIALOG_H diff --git a/include/VstSyncController.h b/include/VstSyncController.h index 33f2ee036b3..fba60670c0f 100644 --- a/include/VstSyncController.h +++ b/include/VstSyncController.h @@ -31,6 +31,9 @@ #include "VstSyncData.h" +namespace lmms +{ + class VstSyncController : public QObject { @@ -82,4 +85,7 @@ private slots: }; + +} // namespace lmms + #endif diff --git a/include/VstSyncData.h b/include/VstSyncData.h index 07694b81bda..2fcbece1963 100644 --- a/include/VstSyncData.h +++ b/include/VstSyncData.h @@ -26,6 +26,10 @@ #ifndef VST_SYNC_DATA_H #define VST_SYNC_DATA_H +namespace lmms +{ + + // VST sync frequency (in ms), how often will be VST plugin synced // keep it power of two if possible (not used by now) //#define VST_SNC_TIMER 1 @@ -59,4 +63,7 @@ struct VstSyncData #endif } ; + +} // namespace lmms + #endif diff --git a/include/aeffectx.h b/include/aeffectx.h index 61597270140..e0f6ee406ab 100644 --- a/include/aeffectx.h +++ b/include/aeffectx.h @@ -32,6 +32,9 @@ // Calling convention #define VST_CALL_CONV __cdecl +namespace lmms +{ + template constexpr int32_t CCONST(T a, T b, T c, T d) { @@ -295,5 +298,6 @@ class VstTimeInfo typedef intptr_t (VST_CALL_CONV * audioMasterCallback)( AEffect * , int32_t, int32_t, intptr_t, void * , float ); +} // namespace lmms #endif diff --git a/include/base64.h b/include/base64.h index 688a12ef849..661a2bef3b9 100644 --- a/include/base64.h +++ b/include/base64.h @@ -30,9 +30,9 @@ #include #include - -namespace base64 +namespace lmms::base64 { + inline void encode( const char * _data, const int _size, QString & _dst ) { @@ -51,6 +51,6 @@ namespace base64 QVariant decode( const QString & _b64, QVariant::Type _force_type = QVariant::Invalid ); -} +} // namespace lmms::base64 #endif diff --git a/include/denormals.h b/include/denormals.h index f89325ac1c9..05768f87369 100644 --- a/include/denormals.h +++ b/include/denormals.h @@ -12,6 +12,8 @@ #include #endif +namespace lmms +{ // Set denormal protection for this thread. // To be on the safe side, don't set the DAZ flag for SSE2 builds, @@ -28,5 +30,8 @@ void inline disable_denormals() { #endif } + +} // namespace lmms + #endif diff --git a/include/embed.h b/include/embed.h index aa224580e11..ab22d420121 100644 --- a/include/embed.h +++ b/include/embed.h @@ -32,6 +32,9 @@ #include "lmms_basics.h" +namespace lmms +{ + namespace embed { @@ -136,5 +139,6 @@ class PluginPixmapLoader : public PixmapLoader #endif +} // namespace lmms #endif diff --git a/include/endian_handling.h b/include/endian_handling.h index 06e9d82447c..13c877151de 100644 --- a/include/endian_handling.h +++ b/include/endian_handling.h @@ -30,6 +30,10 @@ #include "lmms_basics.h" +namespace lmms +{ + + inline bool isLittleEndian() { return( QSysInfo::ByteOrder == QSysInfo::LittleEndian ); @@ -50,4 +54,7 @@ inline int32_t swap32IfBE( int32_t i ) ( ( i & 0x000000ff ) << 24 ) ); } + +} // namespace lmms + #endif diff --git a/include/fft_helpers.h b/include/fft_helpers.h index 88183fb1969..8ba0fc7a0b6 100644 --- a/include/fft_helpers.h +++ b/include/fft_helpers.h @@ -32,6 +32,9 @@ #include #include +namespace lmms +{ + // NOTE: FFT_BUFFER_SIZE should be considered deprecated! // It is used by Eq plugin and some older code here, but this should be a user // switchable parameter, not a constant. Use a value from FFT_BLOCK_SIZES @@ -103,4 +106,7 @@ int LMMS_EXPORT absspec(const fftwf_complex *complex_buffer, float *absspec_buff int LMMS_EXPORT compressbands(const float * _absspec_buffer, float * _compressedband, int _num_old, int _num_new, int _bottom, int _top); + +} // namespace lmms + #endif diff --git a/include/gui_templates.h b/include/gui_templates.h index 073cb50f1c1..ee0ccdbf674 100644 --- a/include/gui_templates.h +++ b/include/gui_templates.h @@ -32,6 +32,8 @@ #include #include +namespace lmms +{ // return DPI-independent font-size - font with returned font-size has always @@ -65,4 +67,6 @@ inline QFont pointSizeF( QFont _f, float SIZE ) } +} // namespace lmms + #endif diff --git a/include/interpolation.h b/include/interpolation.h index c2bc8421d79..62f06e521e7 100644 --- a/include/interpolation.h +++ b/include/interpolation.h @@ -34,6 +34,9 @@ #include "lmms_constants.h" #include "lmms_math.h" +namespace lmms +{ + inline float hermiteInterpolate( float x0, float x1, float x2, float x3, float frac_pos ) { @@ -135,6 +138,6 @@ inline float lagrangeInterpolate( float v0, float v1, float v2, float v3, float - +} // namespace lmms #endif diff --git a/include/lmms_basics.h b/include/lmms_basics.h index a4c2e5509a2..48f45736819 100644 --- a/include/lmms_basics.h +++ b/include/lmms_basics.h @@ -37,6 +37,10 @@ #endif +namespace lmms +{ + + typedef int32_t bar_t; typedef int32_t tick_t; typedef uint8_t volume_t; @@ -145,4 +149,7 @@ constexpr const char* UI_CTRL_KEY = "Ctrl"; #endif + +} // namespace lmms + #endif diff --git a/include/lmms_constants.h b/include/lmms_constants.h index f5a86bc880c..7796f6bdfc1 100644 --- a/include/lmms_constants.h +++ b/include/lmms_constants.h @@ -25,6 +25,10 @@ #ifndef LMMS_CONSTANTS_H #define LMMS_CONSTANTS_H +namespace lmms +{ + + constexpr long double LD_PI = 3.14159265358979323846264338327950288419716939937510; constexpr long double LD_2PI = LD_PI * 2.0; constexpr long double LD_PI_2 = LD_PI * 0.5; @@ -96,4 +100,7 @@ constexpr int ARANGE_LOUD_END = 0; constexpr int ARANGE_SILENT_START = -60; constexpr int ARANGE_SILENT_END = -10; + +} // namespace lmms + #endif diff --git a/include/lmms_math.h b/include/lmms_math.h index a64bbd3d43f..9f3e7a28f6e 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -33,6 +33,9 @@ #include +namespace lmms +{ + #ifdef __INTEL_COMPILER static inline float absFraction( const float _x ) @@ -323,4 +326,7 @@ static inline T absMin( T a, T b ) return qAbs(a) < qAbs(b) ? a : b; } + +} // namespace lmms + #endif diff --git a/include/panning.h b/include/panning.h index c043adf5c65..78d97e207ea 100644 --- a/include/panning.h +++ b/include/panning.h @@ -31,6 +31,10 @@ #include "Midi.h" #include "volume.h" +namespace lmms +{ + + inline stereoVolumeVector panningToVolumeVector( panning_t _p, float _scale = 1.0f ) { @@ -49,4 +53,7 @@ inline int panningToMidi( panning_t _p ) ( (float)( MidiMaxPanning - MidiMinPanning ) ) ); } + +} // namespace lmms + #endif diff --git a/include/panning_constants.h b/include/panning_constants.h index cf335ccfb36..00a5c3291da 100644 --- a/include/panning_constants.h +++ b/include/panning_constants.h @@ -26,9 +26,16 @@ #ifndef PANNING_CONSTANTS_H #define PANNING_CONSTANTS_H +namespace lmms +{ + + constexpr panning_t PanningRight = ( 0 + 100 ); constexpr panning_t PanningLeft = - PanningRight; constexpr panning_t PanningCenter = 0; constexpr panning_t DefaultPanning = PanningCenter; + +} // namespace lmms + #endif diff --git a/include/shared_object.h b/include/shared_object.h index efb8ba5d69a..e68186336a6 100644 --- a/include/shared_object.h +++ b/include/shared_object.h @@ -28,6 +28,9 @@ #include +namespace lmms +{ + class sharedObject { public: @@ -82,4 +85,7 @@ class sharedObject std::atomic_int m_referenceCount; } ; + +} // namespace lmms + #endif diff --git a/include/volume.h b/include/volume.h index 5ea4ffc50b4..b57b9b7c5aa 100644 --- a/include/volume.h +++ b/include/volume.h @@ -28,6 +28,10 @@ #include "lmms_basics.h" +namespace lmms +{ + + constexpr volume_t MinVolume = 0; constexpr volume_t MaxVolume = 200; constexpr volume_t DefaultVolume = 100; @@ -37,4 +41,7 @@ typedef struct float vol[2]; } stereoVolumeVector; + +} // namespace lmms + #endif diff --git a/plugins/peak_controller_effect/peak_controller_effect.cpp b/plugins/peak_controller_effect/peak_controller_effect.cpp index 6db4fba5c52..9d88a9f3155 100644 --- a/plugins/peak_controller_effect/peak_controller_effect.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect.cpp @@ -34,6 +34,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -158,3 +162,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * _parent, void * _data ) } + +} // namespace lmms diff --git a/plugins/peak_controller_effect/peak_controller_effect.h b/plugins/peak_controller_effect/peak_controller_effect.h index 2e025cc8a5c..ba041ce6da3 100644 --- a/plugins/peak_controller_effect/peak_controller_effect.h +++ b/plugins/peak_controller_effect/peak_controller_effect.h @@ -29,6 +29,10 @@ #include "Effect.h" #include "peak_controller_effect_controls.h" +namespace lmms +{ + + class PeakController; class PeakControllerEffect : public Effect @@ -78,4 +82,7 @@ class PeakControllerEffect : public Effect } ; + +} // namespace lmms + #endif diff --git a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp index ff87d0d9980..307fe388e10 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_controls.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect_controls.cpp @@ -31,6 +31,9 @@ #include "peak_controller_effect.h" #include "Song.h" +namespace lmms +{ + PeakControllerEffectControls:: PeakControllerEffectControls( PeakControllerEffect * _eff ) : @@ -105,6 +108,4 @@ void PeakControllerEffectControls::saveSettings( QDomDocument & _doc, } - - - +} // namespace lmms diff --git a/plugins/peak_controller_effect/peak_controller_effect_controls.h b/plugins/peak_controller_effect/peak_controller_effect_controls.h index fe90eddca85..8375cf8d543 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_controls.h +++ b/plugins/peak_controller_effect/peak_controller_effect_controls.h @@ -30,6 +30,10 @@ #include "peak_controller_effect_control_dialog.h" #include "Knob.h" +namespace lmms +{ + + class PeakControllerEffect; class PeakControllerEffectControls : public EffectControls @@ -76,4 +80,6 @@ class PeakControllerEffectControls : public EffectControls } ; +} // namespace lmms + #endif diff --git a/src/core/AudioEngine.cpp b/src/core/AudioEngine.cpp index 0fb93462e14..f2863191385 100644 --- a/src/core/AudioEngine.cpp +++ b/src/core/AudioEngine.cpp @@ -61,6 +61,10 @@ #include "BufferManager.h" +namespace lmms +{ + + typedef LocklessList::Element LocklessListElement; @@ -1287,3 +1291,5 @@ void AudioEngine::fifoWriter::write( surroundSampleFrame * buffer ) m_audioEngine->m_waitingForWrite = false; m_audioEngine->m_doChangesMutex.unlock(); } + +} // namespace lmms diff --git a/src/core/AudioEngineProfiler.cpp b/src/core/AudioEngineProfiler.cpp index 837894c7937..24c4dc5aee9 100644 --- a/src/core/AudioEngineProfiler.cpp +++ b/src/core/AudioEngineProfiler.cpp @@ -24,6 +24,8 @@ #include "AudioEngineProfiler.h" +namespace lmms +{ AudioEngineProfiler::AudioEngineProfiler() : m_periodTimer(), @@ -61,3 +63,4 @@ void AudioEngineProfiler::setOutputFile( const QString& outputFile ) m_outputFile.open( QFile::WriteOnly | QFile::Truncate ); } +} // namespace lmms diff --git a/src/core/AudioEngineWorkerThread.cpp b/src/core/AudioEngineWorkerThread.cpp index c119f04a42f..b4b6084608b 100644 --- a/src/core/AudioEngineWorkerThread.cpp +++ b/src/core/AudioEngineWorkerThread.cpp @@ -36,6 +36,9 @@ #include #endif +namespace lmms +{ + AudioEngineWorkerThread::JobQueue AudioEngineWorkerThread::globalJobQueue; QWaitCondition * AudioEngineWorkerThread::queueReadyWaitCond = nullptr; QList AudioEngineWorkerThread::workerThreads; @@ -176,4 +179,4 @@ void AudioEngineWorkerThread::run() } } - +} // namespace lmms diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index bd2d478db8a..daf786d1eda 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -33,6 +33,9 @@ #include "ProjectJournal.h" #include "Song.h" +namespace lmms +{ + long AutomatableModel::s_periodCounter = 0; @@ -326,7 +329,7 @@ void AutomatableModel::setValue( const float value ) template T AutomatableModel::logToLinearScale( T value ) const { - return castValue( ::logToLinearScale( minValue(), maxValue(), static_cast( value ) ) ); + return castValue( lmms::logToLinearScale( minValue(), maxValue(), static_cast( value ) ) ); } @@ -342,7 +345,7 @@ float AutomatableModel::inverseScaledValue( float value ) const { return m_scaleType == Linear ? value - : ::linearToLogScale( minValue(), maxValue(), value ); + : lmms::linearToLogScale( minValue(), maxValue(), value ); } @@ -364,7 +367,7 @@ void roundAt( T& value, const T& where, const T& step_size ) template void AutomatableModel::roundAt( T& value, const T& where ) const { - ::roundAt(value, where, m_step); + lmms::roundAt(value, where, m_step); } @@ -824,3 +827,6 @@ QString BoolModel::displayValue( const float val ) const { return QString::number( castValue( scaledValue( val ) ) ); } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/AutomationNode.cpp b/src/core/AutomationNode.cpp index d289b2f216f..9e6910210fa 100644 --- a/src/core/AutomationNode.cpp +++ b/src/core/AutomationNode.cpp @@ -27,6 +27,9 @@ #include "AutomationPattern.h" +namespace lmms +{ + // Dummy constructor for the QMap AutomationNode::AutomationNode() : m_pattern(nullptr), @@ -107,3 +110,5 @@ void AutomationNode::resetOutValue() // the tangents setOutValue(m_inValue); } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/AutomationPattern.cpp b/src/core/AutomationPattern.cpp index 4fd04376374..27a5ba1cfdc 100644 --- a/src/core/AutomationPattern.cpp +++ b/src/core/AutomationPattern.cpp @@ -36,6 +36,9 @@ #include +namespace lmms +{ + int AutomationPattern::s_quantization = 1; const float AutomationPattern::DEFAULT_MIN_VALUE = 0; const float AutomationPattern::DEFAULT_MAX_VALUE = 1; @@ -869,11 +872,11 @@ const QString AutomationPattern::name() const -TrackContentObjectView * AutomationPattern::createView( TrackView * _tv ) +gui::TrackContentObjectView * AutomationPattern::createView( gui::TrackView * _tv ) { QMutexLocker m(&m_patternMutex); - return new AutomationPatternView( this, _tv ); + return new gui::AutomationPatternView( this, _tv ); } @@ -1182,3 +1185,5 @@ void AutomationPattern::generateTangents(timeMap::iterator it, int numToGenerate it++; } } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/BBTCO.cpp b/src/core/BBTCO.cpp index 5f92c57fbba..7fc9d297be1 100644 --- a/src/core/BBTCO.cpp +++ b/src/core/BBTCO.cpp @@ -29,7 +29,9 @@ #include "BBTrack.h" #include "BBTrackContainer.h" #include "Engine.h" - + +namespace lmms +{ BBTCO::BBTCO( Track * _track ) : TrackContentObject( _track ) @@ -108,7 +110,9 @@ int BBTCO::bbTrackIndex() -TrackContentObjectView * BBTCO::createView( TrackView * _tv ) +gui::TrackContentObjectView * BBTCO::createView( gui::TrackView * _tv ) { - return new BBTCOView( this, _tv ); -} \ No newline at end of file + return new gui::BBTCOView( this, _tv ); +} + +} // namespace lmms \ No newline at end of file diff --git a/src/core/BBTrackContainer.cpp b/src/core/BBTrackContainer.cpp index 15967000afa..596e548b15b 100644 --- a/src/core/BBTrackContainer.cpp +++ b/src/core/BBTrackContainer.cpp @@ -28,7 +28,8 @@ #include "Engine.h" #include "Song.h" - +namespace lmms +{ BBTrackContainer::BBTrackContainer() : TrackContainer(), @@ -255,3 +256,4 @@ AutomatedValueMap BBTrackContainer::automatedValuesAt(TimePos time, int tcoNum) return TrackContainer::automatedValuesAt(time + (TimePos::ticksPerBar() * tcoNum), tcoNum); } +} // namespace lmms diff --git a/src/core/BandLimitedWave.cpp b/src/core/BandLimitedWave.cpp index 0f83badcf63..0f303fe1542 100644 --- a/src/core/BandLimitedWave.cpp +++ b/src/core/BandLimitedWave.cpp @@ -27,6 +27,9 @@ #include +namespace lmms +{ + WaveMipMap BandLimitedWave::s_waveforms[4] = { }; bool BandLimitedWave::s_wavesGenerated = false; QString BandLimitedWave::s_wavetableDir = ""; @@ -270,3 +273,5 @@ moogfile.close(); */ } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/BufferManager.cpp b/src/core/BufferManager.cpp index 5b74b1493f2..76f22c2366b 100644 --- a/src/core/BufferManager.cpp +++ b/src/core/BufferManager.cpp @@ -29,6 +29,9 @@ #include "Engine.h" #include "MemoryManager.h" +namespace lmms +{ + fpp_t BufferManager::framesPerPeriod; void BufferManager::init( fpp_t fpp ) @@ -61,3 +64,4 @@ void BufferManager::release( sampleFrame * buf ) MM_FREE( buf ); } +} // namespace lmms diff --git a/src/core/Clipboard.cpp b/src/core/Clipboard.cpp index 9b7cf2e775c..2eff35c93bd 100644 --- a/src/core/Clipboard.cpp +++ b/src/core/Clipboard.cpp @@ -30,8 +30,9 @@ #include "JournallingObject.h" -namespace Clipboard +namespace lmms::Clipboard { + const QMimeData * getMimeData() { return QApplication::clipboard()->mimeData( QClipboard::Clipboard ); @@ -91,4 +92,6 @@ namespace Clipboard { return( QString::fromUtf8( mimeData->data( mimeType( MimeType::StringPair ) ) ).section( ':', 1, -1 ) ); } -} + + +} // namespace lmms::Clipboard diff --git a/src/core/ComboBoxModel.cpp b/src/core/ComboBoxModel.cpp index 5694ec5d38c..186ce4fe1ab 100644 --- a/src/core/ComboBoxModel.cpp +++ b/src/core/ComboBoxModel.cpp @@ -25,6 +25,9 @@ #include "ComboBoxModel.h" #include "embed.h" +namespace lmms +{ + using std::unique_ptr; using std::move; @@ -68,6 +71,6 @@ int ComboBoxModel::findText( const QString& txt ) const } - +} // namespace lmms diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index b6cff1eed43..46d08e7d042 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -37,6 +37,9 @@ #include "lmmsversion.h" +namespace lmms +{ + // Vector with all the upgrade methods const std::vector ConfigManager::UPGRADE_METHODS = { @@ -495,8 +498,8 @@ void ConfigManager::loadConfigFile(const QString & configFile) } else if(getGUI() != nullptr) { - QMessageBox::warning(nullptr, MainWindow::tr("Configuration file"), - MainWindow::tr("Error while parsing configuration file at line %1:%2: %3"). + QMessageBox::warning(nullptr, gui::MainWindow::tr("Configuration file"), + gui::MainWindow::tr("Error while parsing configuration file at line %1:%2: %3"). arg(errorLine). arg(errorCol). arg(errorString)); @@ -613,6 +616,8 @@ void ConfigManager::saveConfigFile() QFile outfile(m_lmmsRcFile); if(!outfile.open(QIODevice::WriteOnly | QIODevice::Truncate)) { + using gui::MainWindow; + QString title, message; title = MainWindow::tr("Could not open file"); message = MainWindow::tr("Could not open file %1 " @@ -713,3 +718,6 @@ unsigned int ConfigManager::legacyConfigVersion() return 2; } } + + +} // namespace lmms diff --git a/src/core/Controller.cpp b/src/core/Controller.cpp index 3b1db245bbe..977acc09fd7 100644 --- a/src/core/Controller.cpp +++ b/src/core/Controller.cpp @@ -37,6 +37,9 @@ #include "MidiController.h" #include "PeakController.h" +namespace lmms +{ + long Controller::s_periods = 0; QVector Controller::s_controllers; @@ -196,7 +199,7 @@ Controller * Controller::create( ControllerTypes _ct, Model * _parent ) break; case Controller::LfoController: - c = new ::LfoController( _parent ); + c = new class LfoController( _parent ); break; case Controller::PeakController: @@ -205,7 +208,7 @@ Controller * Controller::create( ControllerTypes _ct, Model * _parent ) break; case Controller::MidiController: - c = new ::MidiController( _parent ); + c = new class MidiController( _parent ); break; default: @@ -293,9 +296,9 @@ QString Controller::nodeName() const -ControllerDialog * Controller::createDialog( QWidget * _parent ) +gui::ControllerDialog * Controller::createDialog( QWidget * _parent ) { - ControllerDialog * d = new ControllerDialog( this, _parent ); + gui::ControllerDialog * d = new gui::ControllerDialog( this, _parent ); return d; } @@ -325,7 +328,7 @@ int Controller::connectionCount() const{ } - +} // namespace lmms diff --git a/src/core/ControllerConnection.cpp b/src/core/ControllerConnection.cpp index 03b05462982..a6402227f78 100644 --- a/src/core/ControllerConnection.cpp +++ b/src/core/ControllerConnection.cpp @@ -31,6 +31,9 @@ #include "Song.h" #include "ControllerConnection.h" +namespace lmms +{ + ControllerConnectionVector ControllerConnection::s_connections; @@ -233,4 +236,4 @@ void ControllerConnection::deleteConnection() - +} // namespace lmms diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 82694b7da6d..be8175fdc90 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -49,6 +49,10 @@ #include "lmmsversion.h" +namespace lmms +{ + + static void findIds(const QDomElement& elem, QList& idList); @@ -140,8 +144,8 @@ DataFile::DataFile( const QString & _fileName ) : if( getGUI() != nullptr ) { QMessageBox::critical( nullptr, - SongEditor::tr( "Could not open file" ), - SongEditor::tr( "Could not open file %1. You probably " + gui::SongEditor::tr( "Could not open file" ), + gui::SongEditor::tr( "Could not open file %1. You probably " "have no permissions to read this " "file.\n Please make sure to have at " "least read permissions to the file " @@ -320,6 +324,8 @@ bool DataFile::writeFile(const QString& filename, bool withResources) const QString fullNameTemp = fullName + ".new"; const QString fullNameBak = fullName + ".bak"; + using gui::SongEditor; + // If we are saving with resources, setup the bundle folder first if (withResources) { @@ -1814,6 +1820,8 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile ) } if( line >= 0 && col >= 0 ) { + using gui::SongEditor; + qWarning() << "at line" << line << "column" << errorMsg; if( getGUI() != nullptr ) { @@ -1848,6 +1856,8 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile ) if (root.hasAttribute("creatorversion")) { + using gui::SongEditor; + // compareType defaults to All, so it doesn't have to be set here ProjectVersion createdWith = root.attribute("creatorversion"); ProjectVersion openedWith = LMMS_VERSION; @@ -1861,7 +1871,7 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile ) auto projectType = _sourceFile.endsWith(".mpt") ? SongEditor::tr("template") : SongEditor::tr("project"); - TextFloat::displayMessage( + gui::TextFloat::displayMessage( SongEditor::tr("Version difference"), SongEditor::tr("This %1 was created with LMMS %2") .arg(projectType).arg(createdWith.getVersion()), @@ -1902,3 +1912,6 @@ unsigned int DataFile::legacyFileVersion() // Convert the iterator to an index, which is our file version (starting at 0) return std::distance( UPGRADE_VERSIONS.begin(), firstRequiredUpgrade ); } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/DrumSynth.cpp b/src/core/DrumSynth.cpp index d4f9fe16747..2b7ad9d1b0c 100644 --- a/src/core/DrumSynth.cpp +++ b/src/core/DrumSynth.cpp @@ -39,6 +39,9 @@ #define strcasecmp _stricmp #endif +namespace lmms +{ + using namespace std; @@ -741,3 +744,5 @@ int DrumSynth::GetDSFileSamples(QString dsfile, int16_t *&wave, int channels, sa return Length; } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Effect.cpp b/src/core/Effect.cpp index e730db5a57e..78f0937737d 100644 --- a/src/core/Effect.cpp +++ b/src/core/Effect.cpp @@ -32,6 +32,9 @@ #include "ConfigManager.h" +namespace lmms +{ + Effect::Effect( const Plugin::Descriptor * _desc, Model * _parent, @@ -162,9 +165,9 @@ void Effect::checkGate( double _out_sum ) -PluginView * Effect::instantiateView( QWidget * _parent ) +gui::PluginView * Effect::instantiateView( QWidget * _parent ) { - return new EffectView( this, _parent ); + return new gui::EffectView( this, _parent ); } @@ -215,3 +218,4 @@ void Effect::resample( int _i, const sampleFrame * _src_buf, } } +} // namespace lmms diff --git a/src/core/EffectChain.cpp b/src/core/EffectChain.cpp index 2f5deaec42d..8f8fc4a6d56 100644 --- a/src/core/EffectChain.cpp +++ b/src/core/EffectChain.cpp @@ -32,6 +32,9 @@ #include "MixHelpers.h" #include "Song.h" +namespace lmms +{ + EffectChain::EffectChain( Model * _parent ) : Model( _parent ), @@ -241,3 +244,6 @@ void EffectChain::clear() m_enabledModel.setValue( false ); } + + +} // namespace lmms diff --git a/src/core/Engine.cpp b/src/core/Engine.cpp index 6dbde861369..c09b2b66e5c 100644 --- a/src/core/Engine.cpp +++ b/src/core/Engine.cpp @@ -37,6 +37,9 @@ #include "BandLimitedWave.h" #include "Oscillator.h" +namespace lmms +{ + float LmmsCore::s_framesPerTick; AudioEngine* LmmsCore::s_audioEngine = nullptr; FxMixer * LmmsCore::s_fxMixer = nullptr; @@ -167,3 +170,5 @@ void *LmmsCore::pickDndPluginKey() LmmsCore * LmmsCore::s_instanceOfMe = nullptr; + +} // namespace lmms \ No newline at end of file diff --git a/src/core/EnvelopeAndLfoParameters.cpp b/src/core/EnvelopeAndLfoParameters.cpp index 7dc948e3b70..b80b5494683 100644 --- a/src/core/EnvelopeAndLfoParameters.cpp +++ b/src/core/EnvelopeAndLfoParameters.cpp @@ -30,6 +30,9 @@ #include "Oscillator.h" +namespace lmms +{ + // how long should be each envelope-segment maximal (e.g. attack)? extern const float SECS_PER_ENV_SEGMENT = 5.0f; // how long should be one LFO-oscillation maximal? @@ -540,4 +543,4 @@ void EnvelopeAndLfoParameters::updateSampleVars() - +} // namespace lmms diff --git a/src/core/FxMixer.cpp b/src/core/FxMixer.cpp index 2d2b8cc89f3..bf91c5e3d76 100644 --- a/src/core/FxMixer.cpp +++ b/src/core/FxMixer.cpp @@ -36,6 +36,10 @@ #include "BBTrackContainer.h" #include "TrackContainer.h" // For TrackContainer::TrackList typedef +namespace lmms +{ + + FxRoute::FxRoute( FxChannel * from, FxChannel * to, float amount ) : m_from( from ), m_to( to ), @@ -827,3 +831,6 @@ void FxMixer::validateChannelName( int index, int oldIndex ) m_fxChannels[index]->m_name = tr( "FX %1" ).arg( index ); } } + + +} // namespace lmms diff --git a/src/core/ImportFilter.cpp b/src/core/ImportFilter.cpp index 6f41756a6f1..1caa62e7da4 100644 --- a/src/core/ImportFilter.cpp +++ b/src/core/ImportFilter.cpp @@ -33,6 +33,9 @@ #include "ProjectJournal.h" +namespace lmms +{ + using std::unique_ptr; ImportFilter::ImportFilter( const QString & _file_name, @@ -117,3 +120,4 @@ bool ImportFilter::openFile() +} // namespace lmms \ No newline at end of file diff --git a/src/core/InlineAutomation.cpp b/src/core/InlineAutomation.cpp index 4ee596dbcca..29a0651ecfc 100644 --- a/src/core/InlineAutomation.cpp +++ b/src/core/InlineAutomation.cpp @@ -27,6 +27,9 @@ #include "InlineAutomation.h" +namespace lmms +{ + void InlineAutomation::saveSettings( QDomDocument & _doc, QDomElement & _parent ) { @@ -58,3 +61,5 @@ void InlineAutomation::loadSettings( const QDomElement & _this ) } } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Instrument.cpp b/src/core/Instrument.cpp index 9b7267c0d00..a7d3f73e85e 100644 --- a/src/core/Instrument.cpp +++ b/src/core/Instrument.cpp @@ -31,6 +31,10 @@ #include "lmms_constants.h" +namespace lmms +{ + + Instrument::Instrument(InstrumentTrack * _instrument_track, const Descriptor * _descriptor, const Descriptor::SubPluginFeatures::Key *key) : @@ -201,3 +205,6 @@ QString Instrument::fullDisplayName() const { return instrumentTrack()->displayName(); } + + +} // namespace lmms diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index 1295ed6d20e..27c9e4f6624 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -31,6 +31,9 @@ #include "InstrumentTrack.h" #include "PresetPreviewPlayHandle.h" +namespace lmms +{ + InstrumentFunctionNoteStacking::ChordTable::Init InstrumentFunctionNoteStacking::ChordTable::s_initTable[] = { @@ -556,3 +559,6 @@ void InstrumentFunctionArpeggio::loadSettings( const QDomElement & _this ) m_arpDirectionModel.loadSettings( _this, "arpdir" ); m_arpModeModel.loadSettings( _this, "arpmode" ); } + + +} // namespace lmms diff --git a/src/core/InstrumentPlayHandle.cpp b/src/core/InstrumentPlayHandle.cpp index 71ac555b35e..8c272cd475e 100644 --- a/src/core/InstrumentPlayHandle.cpp +++ b/src/core/InstrumentPlayHandle.cpp @@ -26,9 +26,16 @@ #include "InstrumentPlayHandle.h" #include "InstrumentTrack.h" +namespace lmms +{ + + InstrumentPlayHandle::InstrumentPlayHandle( Instrument * instrument, InstrumentTrack* instrumentTrack ) : PlayHandle( TypeInstrumentPlayHandle ), m_instrument( instrument ) { setAudioPort( instrumentTrack->audioPort() ); } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/InstrumentSoundShaping.cpp b/src/core/InstrumentSoundShaping.cpp index 59141f5e446..eebf33a9f5f 100644 --- a/src/core/InstrumentSoundShaping.cpp +++ b/src/core/InstrumentSoundShaping.cpp @@ -34,6 +34,9 @@ #include "Instrument.h" #include "InstrumentTrack.h" +namespace lmms +{ + const float CUT_FREQ_MULTIPLIER = 6000.0f; const float RES_MULTIPLIER = 2.0f; @@ -377,4 +380,4 @@ void InstrumentSoundShaping::loadSettings( const QDomElement & _this ) - +} // namespace lmms diff --git a/src/core/JournallingObject.cpp b/src/core/JournallingObject.cpp index 729303c67d7..802f4291ecd 100644 --- a/src/core/JournallingObject.cpp +++ b/src/core/JournallingObject.cpp @@ -29,6 +29,8 @@ #include "ProjectJournal.h" #include "Engine.h" +namespace lmms +{ JournallingObject::JournallingObject() : @@ -140,3 +142,4 @@ void JournallingObject::changeID( jo_id_t _id ) } +} // namespace lmms diff --git a/src/core/Keymap.cpp b/src/core/Keymap.cpp index 325a6d6b6d8..657804438d4 100644 --- a/src/core/Keymap.cpp +++ b/src/core/Keymap.cpp @@ -27,6 +27,10 @@ #include +namespace lmms +{ + + Keymap::Keymap() : m_description(tr("empty")), m_firstKey(0), @@ -147,3 +151,6 @@ void Keymap::loadSettings(const QDomElement &element) node = node.nextSibling(); } } + + +} // namespace lmms diff --git a/src/core/Ladspa2LMMS.cpp b/src/core/Ladspa2LMMS.cpp index 13ff51324f8..0145aeb183f 100644 --- a/src/core/Ladspa2LMMS.cpp +++ b/src/core/Ladspa2LMMS.cpp @@ -27,6 +27,10 @@ #include "Ladspa2LMMS.h" +namespace lmms +{ + + Ladspa2LMMS::Ladspa2LMMS() { l_sortable_plugin_t plugins = getSortedPlugins(); @@ -126,3 +130,6 @@ QString Ladspa2LMMS::getShortName( const ladspa_key_t & _key ) return name; } + + +} // namespace lmms diff --git a/src/core/LadspaControl.cpp b/src/core/LadspaControl.cpp index 4dbcb77fc0e..2b8e94c8825 100644 --- a/src/core/LadspaControl.cpp +++ b/src/core/LadspaControl.cpp @@ -28,6 +28,9 @@ #include "LadspaControl.h" #include "LadspaBase.h" +namespace lmms +{ + LadspaControl::LadspaControl( Model * _parent, port_desc_t * _port, bool _link ) : @@ -377,5 +380,4 @@ void LadspaControl::setLink( bool _state ) } - - +} // namespace lmms diff --git a/src/core/LadspaManager.cpp b/src/core/LadspaManager.cpp index a7bccd3d4d7..179d090b74c 100644 --- a/src/core/LadspaManager.cpp +++ b/src/core/LadspaManager.cpp @@ -36,6 +36,9 @@ #include "PluginFactory.h" +namespace lmms +{ + LadspaManager::LadspaManager() { @@ -715,3 +718,6 @@ bool LadspaManager::cleanup( const ladspa_key_t & _plugin, } return( false ); } + + +} // namespace lmms diff --git a/src/core/LfoController.cpp b/src/core/LfoController.cpp index c58551510dd..c890ab68c02 100644 --- a/src/core/LfoController.cpp +++ b/src/core/LfoController.cpp @@ -32,6 +32,10 @@ #include "Song.h" +namespace lmms +{ + + LfoController::LfoController( Model * _parent ) : Controller( Controller::LfoController, _parent, tr( "LFO Controller" ) ), m_baseModel( 0.5, 0.0, 1.0, 0.001, this, tr( "Base value" ) ), @@ -221,12 +225,10 @@ QString LfoController::nodeName() const -ControllerDialog * LfoController::createDialog( QWidget * _parent ) +gui::ControllerDialog * LfoController::createDialog( QWidget * _parent ) { - return new LfoControllerDialog( this, _parent ); + return new gui::LfoControllerDialog( this, _parent ); } - - - +} // namespace lmms diff --git a/src/core/LinkedModelGroups.cpp b/src/core/LinkedModelGroups.cpp index d0bcd8cfd11..11d740bd1a7 100644 --- a/src/core/LinkedModelGroups.cpp +++ b/src/core/LinkedModelGroups.cpp @@ -31,6 +31,8 @@ +namespace lmms +{ /* LinkedModelGroup @@ -182,3 +184,5 @@ void LinkedModelGroups::loadSettings(const QDomElement& that) } } + +} // namespace lmms diff --git a/src/core/LocklessAllocator.cpp b/src/core/LocklessAllocator.cpp index 9fab5f5cad4..801a0bbb07e 100644 --- a/src/core/LocklessAllocator.cpp +++ b/src/core/LocklessAllocator.cpp @@ -33,6 +33,9 @@ #include #endif +namespace lmms +{ + static const size_t SIZEOF_SET = sizeof( int ) * 8; @@ -162,3 +165,6 @@ void LocklessAllocator::free( void * ptr ) } ++m_available; } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/MemoryHelper.cpp b/src/core/MemoryHelper.cpp index eaf10825bc3..b845dfd7f36 100644 --- a/src/core/MemoryHelper.cpp +++ b/src/core/MemoryHelper.cpp @@ -26,6 +26,10 @@ #include "lmms_basics.h" #include "MemoryHelper.h" +namespace lmms +{ + + /** * Allocate a number of bytes and return them. * @param byteNum is the number of bytes @@ -63,3 +67,5 @@ void MemoryHelper::alignedFree( void* _buffer ) } } + +} // namespac elmms diff --git a/src/core/MemoryManager.cpp b/src/core/MemoryManager.cpp index 0f1c9346621..f86e37485d8 100644 --- a/src/core/MemoryManager.cpp +++ b/src/core/MemoryManager.cpp @@ -28,6 +28,10 @@ #include #include "rpmalloc.h" +namespace lmms +{ + + /// Global static object handling rpmalloc intializing and finalizing struct MemoryManagerGlobalGuard { MemoryManagerGlobalGuard() { @@ -75,3 +79,6 @@ void MemoryManager::free(void * ptr) Q_ASSERT_X(rpmalloc_is_thread_initialized(), "MemoryManager::free", "Thread not initialized"); return rpfree(ptr); } + + +} // namespace lmms diff --git a/src/core/MeterModel.cpp b/src/core/MeterModel.cpp index 30db26d9b71..d6a70c3bd81 100644 --- a/src/core/MeterModel.cpp +++ b/src/core/MeterModel.cpp @@ -27,7 +27,10 @@ #include "AutomationPattern.h" -MeterModel::MeterModel( ::Model * _parent ) : +namespace lmms +{ + +MeterModel::MeterModel( Model * _parent ) : Model( _parent ), m_numeratorModel( 4, 1, 32, this, tr( "Numerator" ) ), m_denominatorModel( 4, 1, 32, this, tr( "Denominator" ) ) @@ -78,6 +81,4 @@ void MeterModel::loadSettings( const QDomElement & _this, } - - - +} // namespace lmms diff --git a/src/core/MicroTimer.cpp b/src/core/MicroTimer.cpp index ba94f1c9a72..44506481e96 100644 --- a/src/core/MicroTimer.cpp +++ b/src/core/MicroTimer.cpp @@ -1,5 +1,8 @@ #include "MicroTimer.h" +namespace lmms +{ + using namespace std; using namespace std::chrono; @@ -25,3 +28,5 @@ int MicroTimer::elapsed() const auto now = steady_clock::now(); return std::chrono::duration_cast>(now - begin).count(); } + +} // namespace lmms diff --git a/src/core/Microtuner.cpp b/src/core/Microtuner.cpp index cbd4f16d30a..d3f9801e9a5 100644 --- a/src/core/Microtuner.cpp +++ b/src/core/Microtuner.cpp @@ -33,6 +33,9 @@ #include "Scale.h" #include "Song.h" +namespace lmms +{ + Microtuner::Microtuner() : Model(nullptr, tr("Microtuner")), @@ -165,3 +168,6 @@ void Microtuner::loadSettings(const QDomElement &element) m_keymapModel.loadSettings(element, "keymap"); m_keyRangeImportModel.loadSettings(element, "range_import"); } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/MixHelpers.cpp b/src/core/MixHelpers.cpp index d78f6f879d5..254b47aec51 100644 --- a/src/core/MixHelpers.cpp +++ b/src/core/MixHelpers.cpp @@ -35,7 +35,7 @@ static bool s_NaNHandler; -namespace MixHelpers +namespace lmms::MixHelpers { /*! \brief Function for applying MIXOP on all sample frames */ @@ -324,5 +324,5 @@ void multiplyAndAddMultipliedJoined( sampleFrame* dst, run<>( dst, srcLeft, srcRight, frames, MultiplyAndAddMultipliedOp(coeffDst, coeffSrc) ); } -} +} // namespace lmms::MixHelpers diff --git a/src/core/Model.cpp b/src/core/Model.cpp index 597d0340d0b..dd277bc4e80 100644 --- a/src/core/Model.cpp +++ b/src/core/Model.cpp @@ -24,6 +24,8 @@ #include "Model.h" +namespace lmms +{ QString Model::fullDisplayName() const { @@ -46,5 +48,5 @@ QString Model::fullDisplayName() const - +} // namespace lmms diff --git a/src/core/ModelVisitor.cpp b/src/core/ModelVisitor.cpp index 4036f56e0a3..17e32858777 100644 --- a/src/core/ModelVisitor.cpp +++ b/src/core/ModelVisitor.cpp @@ -28,6 +28,10 @@ #include "ComboBoxModel.h" #include "TempoSyncKnobModel.h" +namespace lmms +{ + + void ModelVisitor::visit(BoolModel &m) { up(m); } void ModelVisitor::visit(IntModel &m) { up(m); } void ModelVisitor::visit(FloatModel &m) { up(m); } @@ -42,3 +46,6 @@ void ConstModelVisitor::visit(const TempoSyncKnobModel &m) { up(m); ModelVisitor::~ModelVisitor() {} ConstModelVisitor::~ConstModelVisitor() {} + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Note.cpp b/src/core/Note.cpp index 16c36b1bc2e..ea828363c65 100644 --- a/src/core/Note.cpp +++ b/src/core/Note.cpp @@ -30,6 +30,9 @@ #include "Note.h" #include "DetuningHelper.h" +namespace lmms +{ + Note::Note( const TimePos & length, const TimePos & pos, int key, volume_t volume, panning_t panning, @@ -232,3 +235,6 @@ bool Note::withinRange(int tickStart, int tickEnd) const return pos().getTicks() >= tickStart && pos().getTicks() <= tickEnd && length().getTicks() != 0; } + + +} // namespace lmms diff --git a/src/core/NotePlayHandle.cpp b/src/core/NotePlayHandle.cpp index f1a26dd7f0f..8168d14e541 100644 --- a/src/core/NotePlayHandle.cpp +++ b/src/core/NotePlayHandle.cpp @@ -34,6 +34,9 @@ #include "Instrument.h" #include "Song.h" +namespace lmms +{ + NotePlayHandle::BaseDetuning::BaseDetuning( DetuningHelper *detuning ) : m_value( detuning ? detuning->automationPattern()->valueAt( 0 ) : 0 ) { @@ -664,3 +667,6 @@ void NotePlayHandleManager::free() { MM_FREE(s_available); } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Oscillator.cpp b/src/core/Oscillator.cpp index 16b99bb5f6b..2dc7f691009 100644 --- a/src/core/Oscillator.cpp +++ b/src/core/Oscillator.cpp @@ -38,6 +38,9 @@ #include "fft_helpers.h" +namespace lmms +{ + void Oscillator::waveTableInit() { @@ -814,4 +817,4 @@ inline sample_t Oscillator::getSample( } - +} // namespace lmms diff --git a/src/core/PathUtil.cpp b/src/core/PathUtil.cpp index 03f16bc89f4..1f2063f2e2f 100644 --- a/src/core/PathUtil.cpp +++ b/src/core/PathUtil.cpp @@ -8,7 +8,7 @@ #include "Engine.h" #include "Song.h" -namespace PathUtil +namespace lmms::PathUtil { Base relativeBases[] = { Base::ProjectDir, Base::FactorySample, Base::UserSample, Base::UserVST, Base::Preset, Base::UserLADSPA, Base::DefaultLADSPA, Base::UserSoundfont, Base::DefaultSoundfont, Base::UserGIG, Base::DefaultGIG, @@ -188,4 +188,5 @@ namespace PathUtil } return basePrefix(shortestBase) + relativeOrAbsolute(absolutePath, shortestBase); } -} + +} // namespace lmms::PathUtil diff --git a/src/core/PeakController.cpp b/src/core/PeakController.cpp index baa157801e4..57061558eb8 100644 --- a/src/core/PeakController.cpp +++ b/src/core/PeakController.cpp @@ -34,6 +34,10 @@ #include "EffectChain.h" #include "plugins/peak_controller_effect/peak_controller_effect.h" +namespace lmms +{ + + PeakControllerEffectVector PeakController::s_effects; int PeakController::m_getCount; int PeakController::m_loadCount; @@ -247,11 +251,10 @@ QString PeakController::nodeName() const -ControllerDialog * PeakController::createDialog( QWidget * _parent ) +gui::ControllerDialog * PeakController::createDialog( QWidget * _parent ) { - return new PeakControllerDialog( this, _parent ); + return new gui::PeakControllerDialog( this, _parent ); } - - +} // namespace lmms diff --git a/src/core/PerfLog.cpp b/src/core/PerfLog.cpp index 951c6d8428c..49056744863 100644 --- a/src/core/PerfLog.cpp +++ b/src/core/PerfLog.cpp @@ -35,6 +35,11 @@ # include #endif + +namespace lmms +{ + + PerfTime::PerfTime() : m_real(-1) { @@ -129,3 +134,6 @@ void PerfLogTimer::end() // Invalidate so destructor won't call print another log entry begin_time = PerfTime(); } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Piano.cpp b/src/core/Piano.cpp index 62680efa775..8cf1917e341 100644 --- a/src/core/Piano.cpp +++ b/src/core/Piano.cpp @@ -41,6 +41,10 @@ #include "InstrumentTrack.h" +namespace lmms +{ + + /*! The black / white order of keys as they appear on the keyboard. */ static const Piano::KeyTypes KEY_ORDER[] = @@ -137,3 +141,5 @@ bool Piano::isWhiteKey( int key ) return !isBlackKey( key ); } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/PlayHandle.cpp b/src/core/PlayHandle.cpp index 37149583f5b..02578c5ff39 100644 --- a/src/core/PlayHandle.cpp +++ b/src/core/PlayHandle.cpp @@ -32,6 +32,9 @@ #include +namespace lmms +{ + PlayHandle::PlayHandle(const Type type, f_cnt_t offset) : m_type(type), m_offset(offset), @@ -73,3 +76,5 @@ sampleFrame* PlayHandle::buffer() { return m_bufferReleased ? nullptr : reinterpret_cast(m_playHandleBuffer); }; + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Plugin.cpp b/src/core/Plugin.cpp index 753f5dfbdd0..85ab5d9f2b7 100644 --- a/src/core/Plugin.cpp +++ b/src/core/Plugin.cpp @@ -37,6 +37,9 @@ #include "AutomatableModel.h" #include "Song.h" +namespace lmms +{ + static PixmapLoader dummyLoader; @@ -266,9 +269,9 @@ void Plugin::collectErrorForUI( QString errMsg ) -PluginView * Plugin::createView( QWidget * parent ) +gui::PluginView * Plugin::createView( QWidget * parent ) { - PluginView * pv = instantiateView( parent ); + gui::PluginView * pv = instantiateView( parent ); if( pv != nullptr ) { pv->setModel( this ); @@ -313,3 +316,4 @@ QDomElement Plugin::Descriptor::SubPluginFeatures::Key::saveXML( +} // namespace lmms diff --git a/src/core/PluginFactory.cpp b/src/core/PluginFactory.cpp index 05d0628a3db..7fba4ca83f6 100644 --- a/src/core/PluginFactory.cpp +++ b/src/core/PluginFactory.cpp @@ -35,6 +35,10 @@ #include "Plugin.h" #include "embed.h" +namespace lmms +{ + + #ifdef LMMS_BUILD_WIN32 QStringList nameFilters("*.dll"); #else @@ -252,3 +256,6 @@ const QString PluginFactory::PluginInfo::name() const { return descriptor ? descriptor->name : QString(); } + + +} // namespace lmms diff --git a/src/core/PluginIssue.cpp b/src/core/PluginIssue.cpp index 7d43586f5b6..532fca6565b 100644 --- a/src/core/PluginIssue.cpp +++ b/src/core/PluginIssue.cpp @@ -26,6 +26,10 @@ #include "PluginIssue.h" +namespace lmms +{ + + const char *PluginIssue::msgFor(const PluginIssueType &it) { switch (it) @@ -91,11 +95,12 @@ bool PluginIssue::operator<(const PluginIssue &other) const } +} // namespace lmms -QDebug operator<<(QDebug stream, const PluginIssue &iss) +QDebug operator<<(QDebug stream, const lmms::PluginIssue &iss) { - stream << PluginIssue::msgFor(iss.m_issueType); + stream << lmms::PluginIssue::msgFor(iss.m_issueType); if (iss.m_info.length()) { stream.nospace() << ": " << iss.m_info.c_str(); diff --git a/src/core/PresetPreviewPlayHandle.cpp b/src/core/PresetPreviewPlayHandle.cpp index a0e5da44560..0ce248e9cae 100644 --- a/src/core/PresetPreviewPlayHandle.cpp +++ b/src/core/PresetPreviewPlayHandle.cpp @@ -35,6 +35,9 @@ #include +namespace lmms +{ + // invisible track-container which is needed as parent for preview-channels class PreviewTrackContainer : public TrackContainer { @@ -274,4 +277,4 @@ bool PresetPreviewPlayHandle::isPreviewing() } - +} // namespace lmms diff --git a/src/core/ProjectJournal.cpp b/src/core/ProjectJournal.cpp index 3d1e9078a21..2a59a2724cb 100644 --- a/src/core/ProjectJournal.cpp +++ b/src/core/ProjectJournal.cpp @@ -29,6 +29,9 @@ #include "JournallingObject.h" #include "Song.h" +namespace lmms +{ + //! Avoid clashes between loaded IDs (have the bit cleared) //! and newly created IDs (have the bit set) static const int EO_ID_MSB = 1 << 23; @@ -206,3 +209,4 @@ void ProjectJournal::stopAllJournalling() +} // namespace lmms diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index 05d50ca9be5..9b88a42ab6f 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -38,6 +38,10 @@ #include "sched.h" #endif +namespace lmms +{ + + const ProjectRenderer::FileEncodeDevice ProjectRenderer::fileEncodeDevices[] = { @@ -250,3 +254,4 @@ void ProjectRenderer::updateConsoleProgress() } +} // namespace lmms diff --git a/src/core/ProjectVersion.cpp b/src/core/ProjectVersion.cpp index 6f3dcddbeb1..b6ee2843f94 100644 --- a/src/core/ProjectVersion.cpp +++ b/src/core/ProjectVersion.cpp @@ -28,6 +28,8 @@ #include "ProjectVersion.h" +namespace lmms +{ ProjectVersion::ProjectVersion(QString version, CompareType c) : @@ -135,3 +137,6 @@ int ProjectVersion::compare(ProjectVersion v1, ProjectVersion v2) { return compare(v1, v2, std::min(v1.getCompareType(), v2.getCompareType())); } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/RemotePlugin.cpp b/src/core/RemotePlugin.cpp index 520ae4379ef..5ff8ea4bc86 100644 --- a/src/core/RemotePlugin.cpp +++ b/src/core/RemotePlugin.cpp @@ -42,6 +42,8 @@ #include #endif +namespace lmms +{ // simple helper thread monitoring our RemotePlugin - if process terminates // unexpectedly invalidate plugin so LMMS doesn't lock up @@ -549,3 +551,6 @@ bool RemotePlugin::processMessage( const message & _m ) return true; } + + +} // namespace lmms diff --git a/src/core/RenderManager.cpp b/src/core/RenderManager.cpp index 4d64f3a1421..06b30da58fa 100644 --- a/src/core/RenderManager.cpp +++ b/src/core/RenderManager.cpp @@ -31,6 +31,10 @@ #include "BBTrack.h" +namespace lmms +{ + + RenderManager::RenderManager( const AudioEngine::qualitySettings & qualitySettings, const OutputSettings & outputSettings, @@ -201,3 +205,6 @@ void RenderManager::updateConsoleProgress() } } } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/RingBuffer.cpp b/src/core/RingBuffer.cpp index 3fe1feeb7e8..b2e40f3c0ad 100644 --- a/src/core/RingBuffer.cpp +++ b/src/core/RingBuffer.cpp @@ -28,6 +28,9 @@ #include "Engine.h" #include "MixHelpers.h" +namespace lmms +{ + RingBuffer::RingBuffer( f_cnt_t size ) : m_fpp( Engine::audioEngine()->framesPerPeriod() ), @@ -314,3 +317,4 @@ void RingBuffer::updateSamplerate() } +} // namespace lmms diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index 949a4667b41..3d550ece869 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -62,6 +62,8 @@ #include "FileDialog.h" +namespace lmms +{ SampleBuffer::SampleBuffer() : m_userAntiAliasWaveTable(nullptr), @@ -1588,3 +1590,5 @@ SampleBuffer::handleState::~handleState() { src_delete(m_resamplingData); } + +} // namespace lmms diff --git a/src/core/SamplePlayHandle.cpp b/src/core/SamplePlayHandle.cpp index 3c38a858fb1..a0e9bb77e17 100644 --- a/src/core/SamplePlayHandle.cpp +++ b/src/core/SamplePlayHandle.cpp @@ -31,6 +31,8 @@ #include "lmms_constants.h" #include "SampleTCO.h" +namespace lmms +{ SamplePlayHandle::SamplePlayHandle( SampleBuffer* sampleBuffer , bool ownAudioPort ) : @@ -148,5 +150,4 @@ f_cnt_t SamplePlayHandle::totalFrames() const } - - +} // namespace lmms diff --git a/src/core/SampleRecordHandle.cpp b/src/core/SampleRecordHandle.cpp index a86d19b79cf..a15b64e0d12 100644 --- a/src/core/SampleRecordHandle.cpp +++ b/src/core/SampleRecordHandle.cpp @@ -33,6 +33,10 @@ #include "debug.h" +namespace lmms +{ + + SampleRecordHandle::SampleRecordHandle( SampleTCO* tco ) : PlayHandle( TypeSamplePlayHandle ), m_framesRecorded( 0 ), @@ -149,4 +153,4 @@ void SampleRecordHandle::writeBuffer( const sampleFrame * _ab, const f_cnt_t _fr } - +} // namespace lmms diff --git a/src/core/SampleTCO.cpp b/src/core/SampleTCO.cpp index 6fcf8a126ba..0dd94fd59de 100644 --- a/src/core/SampleTCO.cpp +++ b/src/core/SampleTCO.cpp @@ -29,6 +29,11 @@ #include "SampleTCOView.h" #include "TimeLineWidget.h" + +namespace lmms +{ + + SampleTCO::SampleTCO( Track * _track ) : TrackContentObject( _track ), m_sampleBuffer( new SampleBuffer ), @@ -317,4 +322,7 @@ void SampleTCO::loadSettings( const QDomElement & _this ) TrackContentObjectView * SampleTCO::createView( TrackView * _tv ) { return new SampleTCOView( this, _tv ); -} \ No newline at end of file +} + + +} // namespace lmms diff --git a/src/core/Scale.cpp b/src/core/Scale.cpp index c71d8607596..78c9d152860 100644 --- a/src/core/Scale.cpp +++ b/src/core/Scale.cpp @@ -26,6 +26,9 @@ #include +namespace lmms +{ + Interval::Interval(float cents) : m_numerator(0), @@ -120,3 +123,6 @@ void Scale::loadSettings(const QDomElement &element) node = node.nextSibling(); } } + + +} // namespace lmms diff --git a/src/core/SerializingObject.cpp b/src/core/SerializingObject.cpp index bc79eb92082..9487ebef558 100644 --- a/src/core/SerializingObject.cpp +++ b/src/core/SerializingObject.cpp @@ -26,7 +26,8 @@ #include "SerializingObject.h" - +namespace lmms +{ SerializingObject::SerializingObject() : m_hook( nullptr ) @@ -110,4 +111,4 @@ void SerializingObject::loadSettings( const QDomElement& element ) Q_UNUSED(element) } - +} // namespace lmms diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 09c00d933e1..3d166256c2c 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -59,6 +59,9 @@ #include "PeakController.h" +namespace lmms +{ + tick_t TimePos::s_ticksPerBar = DefaultTicksPerBar; @@ -185,7 +188,7 @@ void Song::setTimeSignature() void Song::savePos() { - TimeLineWidget * tl = m_playPos[m_playMode].m_timeLine; + gui::TimeLineWidget* tl = m_playPos[m_playMode].m_timeLine; if( tl != nullptr ) { @@ -638,6 +641,8 @@ void Song::stop() return; } + using gui::TimeLineWidget; + // To avoid race conditions with the processing threads Engine::audioEngine()->requestChangeInModel(); @@ -1553,3 +1558,6 @@ void Song::setKeymap(unsigned int index, std::shared_ptr newMap) emit keymapListChanged(index); Engine::audioEngine()->doneChangeInModel(); } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/StepRecorder.cpp b/src/core/StepRecorder.cpp index bd117f5493c..bfe4be039ad 100644 --- a/src/core/StepRecorder.cpp +++ b/src/core/StepRecorder.cpp @@ -25,12 +25,17 @@ #include #include + +namespace lmms +{ + + using std::min; using std::max; const int REMOVE_RELEASED_NOTE_TIME_THRESHOLD_MS = 70; -StepRecorder::StepRecorder(PianoRoll& pianoRoll, StepRecorderWidget& stepRecorderWidget): +StepRecorder::StepRecorder(gui::PianoRoll& pianoRoll, gui::StepRecorderWidget& stepRecorderWidget): m_pianoRoll(pianoRoll), m_stepRecorderWidget(stepRecorderWidget), m_pattern(nullptr) @@ -365,3 +370,5 @@ StepRecorder::StepNote* StepRecorder::findCurStepNote(const int key) return nullptr; } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/TempoSyncKnobModel.cpp b/src/core/TempoSyncKnobModel.cpp index a85ca2e9ff8..d319407ecfe 100644 --- a/src/core/TempoSyncKnobModel.cpp +++ b/src/core/TempoSyncKnobModel.cpp @@ -31,6 +31,10 @@ #include "Song.h" +namespace lmms +{ + + TempoSyncKnobModel::TempoSyncKnobModel( const float _val, const float _min, const float _max, const float _step, const float _scale, Model * _parent, @@ -181,8 +185,4 @@ void TempoSyncKnobModel::updateCustom() } - - - - - +} // namespace lmms diff --git a/src/core/TimePos.cpp b/src/core/TimePos.cpp index 4a22a1eb999..f3b09474dad 100644 --- a/src/core/TimePos.cpp +++ b/src/core/TimePos.cpp @@ -27,6 +27,9 @@ #include "MeterModel.h" +namespace lmms +{ + TimeSig::TimeSig( int num, int denom ) : m_num(num), m_denom(denom) @@ -216,3 +219,6 @@ double TimePos::ticksToMilliseconds(double ticks, bpm_t beatsPerMinute) // 60 * 1000 / 48 = 1250 return ( ticks * 1250 ) / beatsPerMinute; } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/ToolPlugin.cpp b/src/core/ToolPlugin.cpp index 6c2b0fed77a..99c3e5bec5f 100644 --- a/src/core/ToolPlugin.cpp +++ b/src/core/ToolPlugin.cpp @@ -26,6 +26,10 @@ #include "ToolPlugin.h" +namespace lmms +{ + + ToolPlugin::ToolPlugin( const Descriptor * _descriptor, Model * _parent ) : Plugin( _descriptor, _parent ) { @@ -56,3 +60,5 @@ ToolPlugin * ToolPlugin::instantiate( const QString & _plugin_name, Model * _par return nullptr; } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Track.cpp b/src/core/Track.cpp index a79a79c652c..0b5019804cd 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -42,6 +42,9 @@ #include "Song.h" +namespace lmms +{ + /*! \brief Create a new (empty) track object * * The track object is the whole track, linking its contents, its @@ -670,3 +673,4 @@ BoolModel *Track::getMutedModel() return &m_mutedModel; } +} // namespace lmms \ No newline at end of file diff --git a/src/core/TrackContainer.cpp b/src/core/TrackContainer.cpp index 3995981c6ba..5ee249dbcbd 100644 --- a/src/core/TrackContainer.cpp +++ b/src/core/TrackContainer.cpp @@ -42,6 +42,10 @@ #include "MainWindow.h" #include "TextFloat.h" +namespace lmms +{ + + TrackContainer::TrackContainer() : Model( nullptr ), JournallingObject(), @@ -331,3 +335,5 @@ AutomatedValueMap TrackContainer::automatedValuesFromTracks(const TrackList &tra return valueMap; }; + +} // namespace lmms diff --git a/src/core/TrackContentObject.cpp b/src/core/TrackContentObject.cpp index 0b2a1fa3fee..f8213aa5d0e 100644 --- a/src/core/TrackContentObject.cpp +++ b/src/core/TrackContentObject.cpp @@ -33,6 +33,9 @@ #include "Song.h" +namespace lmms +{ + /*! \brief Create a new TrackContentObject * * Creates a new track content object for the given track. @@ -197,3 +200,4 @@ bool TrackContentObject::hasColor() return usesCustomClipColor() || getTrack()->useColor(); } +} // namespace lmms diff --git a/src/core/ValueBuffer.cpp b/src/core/ValueBuffer.cpp index 687bd3c1569..09aee65bdfc 100644 --- a/src/core/ValueBuffer.cpp +++ b/src/core/ValueBuffer.cpp @@ -2,6 +2,10 @@ #include "interpolation.h" +namespace lmms +{ + + ValueBuffer::ValueBuffer() {} @@ -41,3 +45,6 @@ void ValueBuffer::interpolate(float start, float end_) return linearInterpolate( start, end_, i++ / length()); }); } + + +} // namespace lmms diff --git a/src/core/VstSyncController.cpp b/src/core/VstSyncController.cpp index 9caa92e09e4..1abf6838fd3 100644 --- a/src/core/VstSyncController.cpp +++ b/src/core/VstSyncController.cpp @@ -41,6 +41,10 @@ #endif +namespace lmms +{ + + VstSyncController::VstSyncController() : m_syncData( nullptr ), m_shmID( -1 ), @@ -189,6 +193,4 @@ void VstSyncController::updateSampleRate() } - - - +} // namespace lmms diff --git a/src/core/audio/AudioAlsa.cpp b/src/core/audio/AudioAlsa.cpp index 83c64f46c0a..bc840a56fe7 100644 --- a/src/core/audio/AudioAlsa.cpp +++ b/src/core/audio/AudioAlsa.cpp @@ -35,6 +35,8 @@ #include "Engine.h" #include "gui_templates.h" +namespace lmms +{ AudioAlsa::AudioAlsa( bool & _success_ful, AudioEngine* _audioEngine ) : AudioDevice( qBound( @@ -541,4 +543,6 @@ int AudioAlsa::setSWParams() return 0; // all ok } +} // namespace lmms + #endif diff --git a/src/core/audio/AudioDevice.cpp b/src/core/audio/AudioDevice.cpp index bc25f9ba8e5..86fa59b7818 100644 --- a/src/core/audio/AudioDevice.cpp +++ b/src/core/audio/AudioDevice.cpp @@ -29,7 +29,8 @@ #include "ConfigManager.h" #include "debug.h" - +namespace lmms +{ AudioDevice::AudioDevice( const ch_cnt_t _channels, AudioEngine* _audioEngine ) : m_supportsCapture( false ), @@ -267,3 +268,4 @@ bool AudioDevice::hqAudio() const } +} // namespace lmms \ No newline at end of file diff --git a/src/core/audio/AudioFileDevice.cpp b/src/core/audio/AudioFileDevice.cpp index e7d78bc3611..485dc77b5e6 100644 --- a/src/core/audio/AudioFileDevice.cpp +++ b/src/core/audio/AudioFileDevice.cpp @@ -29,6 +29,8 @@ #include "ExportProjectDialog.h" #include "GuiApplication.h" +namespace lmms +{ AudioFileDevice::AudioFileDevice( OutputSettings const & outputSettings, const ch_cnt_t _channels, @@ -87,3 +89,4 @@ int AudioFileDevice::writeData( const void* data, int len ) return -1; } +} // namespace lmms \ No newline at end of file diff --git a/src/core/audio/AudioFileFlac.cpp b/src/core/audio/AudioFileFlac.cpp index aa6d8e21400..4e40257cd7f 100644 --- a/src/core/audio/AudioFileFlac.cpp +++ b/src/core/audio/AudioFileFlac.cpp @@ -31,6 +31,9 @@ #include "endian_handling.h" #include "AudioEngine.h" +namespace lmms +{ + AudioFileFlac::AudioFileFlac(OutputSettings const& outputSettings, ch_cnt_t const channels, bool& successful, QString const& file, AudioEngine* audioEngine): AudioFileDevice(outputSettings,channels,file,audioEngine), m_sf(nullptr) @@ -124,3 +127,5 @@ void AudioFileFlac::finishEncoding() sf_close(m_sf); } } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/audio/AudioFileMP3.cpp b/src/core/audio/AudioFileMP3.cpp index 0a0045a9c9e..f9931f17bad 100644 --- a/src/core/audio/AudioFileMP3.cpp +++ b/src/core/audio/AudioFileMP3.cpp @@ -31,6 +31,8 @@ #include +namespace lmms +{ AudioFileMP3::AudioFileMP3( OutputSettings const & outputSettings, const ch_cnt_t channels, @@ -131,4 +133,6 @@ void AudioFileMP3::tearDownEncoder() lame_close(m_lame); } +} // namespace lmms + #endif diff --git a/src/core/audio/AudioFileOgg.cpp b/src/core/audio/AudioFileOgg.cpp index d9aa8b4f08e..1f40f456e02 100644 --- a/src/core/audio/AudioFileOgg.cpp +++ b/src/core/audio/AudioFileOgg.cpp @@ -38,6 +38,8 @@ #include "AudioEngine.h" +namespace lmms +{ AudioFileOgg::AudioFileOgg( OutputSettings const & outputSettings, const ch_cnt_t channels, @@ -268,6 +270,8 @@ void AudioFileOgg::finishEncoding() } +} // namespace lmms + #endif diff --git a/src/core/audio/AudioFileWave.cpp b/src/core/audio/AudioFileWave.cpp index 94b84c0dab9..7b61132a4e2 100644 --- a/src/core/audio/AudioFileWave.cpp +++ b/src/core/audio/AudioFileWave.cpp @@ -30,6 +30,8 @@ #include #include +namespace lmms +{ AudioFileWave::AudioFileWave( OutputSettings const & outputSettings, const ch_cnt_t channels, bool & successful, @@ -138,3 +140,4 @@ void AudioFileWave::finishEncoding() } } +} // namespace lmms \ No newline at end of file diff --git a/src/core/audio/AudioJack.cpp b/src/core/audio/AudioJack.cpp index aac1cda8edd..8b6692bee25 100644 --- a/src/core/audio/AudioJack.cpp +++ b/src/core/audio/AudioJack.cpp @@ -41,6 +41,8 @@ #include "MidiJack.h" +namespace lmms +{ AudioJack::AudioJack( bool & _success_ful, AudioEngine* _audioEngine ) : AudioDevice( qBound( @@ -465,13 +467,13 @@ AudioJack::setupWidget::setupWidget( QWidget * _parent ) : cn_lbl->setFont( pointSize<7>( cn_lbl->font() ) ); cn_lbl->setGeometry( 10, 40, 160, 10 ); - LcdSpinBoxModel * m = new LcdSpinBoxModel( /* this */ ); + gui::LcdSpinBoxModel * m = new gui::LcdSpinBoxModel( /* this */ ); m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS ); m->setStep( 2 ); m->setValue( ConfigManager::inst()->value( "audiojack", "channels" ).toInt() ); - m_channels = new LcdSpinBox( 1, this ); + m_channels = new gui::LcdSpinBox( 1, this ); m_channels->setModel( m ); m_channels->setLabel( tr( "Channels" ) ); m_channels->move( 180, 20 ); @@ -499,6 +501,6 @@ void AudioJack::setupWidget::saveSettings() - +} // namespace lmms #endif diff --git a/src/core/audio/AudioOss.cpp b/src/core/audio/AudioOss.cpp index 76df85adc43..76f10a61eac 100644 --- a/src/core/audio/AudioOss.cpp +++ b/src/core/audio/AudioOss.cpp @@ -57,6 +57,8 @@ #include "ConfigManager.h" +namespace lmms +{ static const QString PATH_DEV_DSP = #if defined(__NetBSD__) || defined(__OpenBSD__) @@ -325,13 +327,13 @@ AudioOss::setupWidget::setupWidget( QWidget * _parent ) : dev_lbl->setFont( pointSize<7>( dev_lbl->font() ) ); dev_lbl->setGeometry( 10, 40, 160, 10 ); - LcdSpinBoxModel * m = new LcdSpinBoxModel( /* this */ ); + gui::LcdSpinBoxModel * m = new gui::LcdSpinBoxModel( /* this */ ); m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS ); m->setStep( 2 ); m->setValue( ConfigManager::inst()->value( "audiooss", "channels" ).toInt() ); - m_channels = new LcdSpinBox( 1, this ); + m_channels = new gui::LcdSpinBox( 1, this ); m_channels->setModel( m ); m_channels->setLabel( tr( "Channels" ) ); m_channels->move( 180, 20 ); @@ -358,5 +360,7 @@ void AudioOss::setupWidget::saveSettings() } +} // namespace lmms + #endif diff --git a/src/core/audio/AudioPort.cpp b/src/core/audio/AudioPort.cpp index e3c4569f018..0d30ff57330 100644 --- a/src/core/audio/AudioPort.cpp +++ b/src/core/audio/AudioPort.cpp @@ -31,6 +31,8 @@ #include "MixHelpers.h" #include "BufferManager.h" +namespace lmms +{ AudioPort::AudioPort( const QString & _name, bool _has_effect_chain, FloatModel * volumeModel, FloatModel * panningModel, @@ -247,3 +249,5 @@ void AudioPort::removePlayHandle( PlayHandle * handle ) } m_playHandleLock.unlock(); } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/audio/AudioPortAudio.cpp b/src/core/audio/AudioPortAudio.cpp index 2bd2874c784..0b86bd56429 100644 --- a/src/core/audio/AudioPortAudio.cpp +++ b/src/core/audio/AudioPortAudio.cpp @@ -51,6 +51,9 @@ void AudioPortAudioSetupUtil::updateChannels() #include "ComboBox.h" #include "AudioEngine.h" +namespace lmms +{ + AudioPortAudio::AudioPortAudio( bool & _success_ful, AudioEngine * _audioEngine ) : AudioDevice( qBound( @@ -497,6 +500,8 @@ void AudioPortAudio::setupWidget::show() AudioDeviceSetupWidget::show(); } +} // namespace lmms + #endif diff --git a/src/core/audio/AudioPulseAudio.cpp b/src/core/audio/AudioPulseAudio.cpp index 5f82b64dc86..40c955434ab 100644 --- a/src/core/audio/AudioPulseAudio.cpp +++ b/src/core/audio/AudioPulseAudio.cpp @@ -35,6 +35,8 @@ #include "gui_templates.h" #include "Engine.h" +namespace lmms +{ static void stream_write_callback(pa_stream *s, size_t length, void *userdata) { @@ -317,13 +319,13 @@ AudioPulseAudio::setupWidget::setupWidget( QWidget * _parent ) : dev_lbl->setFont( pointSize<7>( dev_lbl->font() ) ); dev_lbl->setGeometry( 10, 40, 160, 10 ); - LcdSpinBoxModel * m = new LcdSpinBoxModel( /* this */ ); + gui::LcdSpinBoxModel * m = new gui::LcdSpinBoxModel( /* this */ ); m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS ); m->setStep( 2 ); m->setValue( ConfigManager::inst()->value( "audiopa", "channels" ).toInt() ); - m_channels = new LcdSpinBox( 1, this ); + m_channels = new gui::LcdSpinBox( 1, this ); m_channels->setModel( m ); m_channels->setLabel( tr( "Channels" ) ); m_channels->move( 180, 20 ); @@ -349,6 +351,7 @@ void AudioPulseAudio::setupWidget::saveSettings() QString::number( m_channels->value() ) ); } +} // namespace lmms #endif diff --git a/src/core/audio/AudioSampleRecorder.cpp b/src/core/audio/AudioSampleRecorder.cpp index a33308c99c7..358a9b89736 100644 --- a/src/core/audio/AudioSampleRecorder.cpp +++ b/src/core/audio/AudioSampleRecorder.cpp @@ -29,6 +29,9 @@ #include "debug.h" +namespace lmms +{ + AudioSampleRecorder::AudioSampleRecorder( const ch_cnt_t _channels, bool & _success_ful, @@ -111,4 +114,4 @@ void AudioSampleRecorder::writeBuffer( const surroundSampleFrame * _ab, } - +} // namespace lmms diff --git a/src/core/audio/AudioSdl.cpp b/src/core/audio/AudioSdl.cpp index 50991642cd3..5376e22b01f 100644 --- a/src/core/audio/AudioSdl.cpp +++ b/src/core/audio/AudioSdl.cpp @@ -34,6 +34,9 @@ #include "ConfigManager.h" #include "gui_templates.h" +namespace lmms +{ + AudioSdl::AudioSdl( bool & _success_ful, AudioEngine* _audioEngine ) : AudioDevice( DEFAULT_CHANNELS, _audioEngine ), m_outBuf( new surroundSampleFrame[audioEngine()->framesPerPeriod()] ) @@ -351,5 +354,7 @@ void AudioSdl::setupWidget::saveSettings() } +} // namespace lmms + #endif diff --git a/src/core/audio/AudioSndio.cpp b/src/core/audio/AudioSndio.cpp index 4bd978744da..242c4fee59b 100644 --- a/src/core/audio/AudioSndio.cpp +++ b/src/core/audio/AudioSndio.cpp @@ -47,6 +47,8 @@ #include "ConfigManager.h" +namespace lmms +{ AudioSndio::AudioSndio(bool & _success_ful, AudioEngine * _audioEngine) : AudioDevice( qBound( @@ -195,13 +197,13 @@ AudioSndio::setupWidget::setupWidget( QWidget * _parent ) : dev_lbl->setFont( pointSize<6>( dev_lbl->font() ) ); dev_lbl->setGeometry( 10, 40, 160, 10 ); - LcdSpinBoxModel * m = new LcdSpinBoxModel( /* this */ ); + gui::LcdSpinBoxModel * m = new gui::LcdSpinBoxModel( /* this */ ); m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS ); m->setStep( 2 ); m->setValue( ConfigManager::inst()->value( "audiosndio", "channels" ).toInt() ); - m_channels = new LcdSpinBox( 1, this ); + m_channels = new gui::LcdSpinBox( 1, this ); m_channels->setModel( m ); m_channels->setLabel( tr( "Channels" ) ); m_channels->move( 180, 20 ); @@ -224,4 +226,6 @@ void AudioSndio::setupWidget::saveSettings( void ) } +} // namespace lmms + #endif /* LMMS_HAVE_SNDIO */ diff --git a/src/core/audio/AudioSoundIo.cpp b/src/core/audio/AudioSoundIo.cpp index c8ef045428e..c56d23dc342 100644 --- a/src/core/audio/AudioSoundIo.cpp +++ b/src/core/audio/AudioSoundIo.cpp @@ -36,6 +36,9 @@ #include "ComboBox.h" #include "AudioEngine.h" +namespace lmms +{ + AudioSoundIo::AudioSoundIo( bool & outSuccessful, AudioEngine * _audioEngine ) : AudioDevice( qBound( DEFAULT_CHANNELS, @@ -519,4 +522,7 @@ void AudioSoundIo::setupWidget::saveSettings() ConfigManager::inst()->setValue( "audiosoundio", "out_device_raw", configDeviceRaw); } + +} // namespace lmms + #endif diff --git a/src/core/base64.cpp b/src/core/base64.cpp index c04300dcf25..b1c26b610ba 100644 --- a/src/core/base64.cpp +++ b/src/core/base64.cpp @@ -28,7 +28,7 @@ #include #include -namespace base64 +namespace lmms::base64 { @@ -54,5 +54,4 @@ QVariant decode( const QString & _b64, QVariant::Type _force_type ) } -} ; - +} // namespace lmms::base64 diff --git a/src/core/fft_helpers.cpp b/src/core/fft_helpers.cpp index 9e49c554403..63088f655b9 100644 --- a/src/core/fft_helpers.cpp +++ b/src/core/fft_helpers.cpp @@ -29,6 +29,10 @@ #include #include "lmms_constants.h" +namespace lmms +{ + + /* Returns biggest value from abs_spectrum[spec_size] array. * * return -1 on error, otherwise the maximum value @@ -212,3 +216,6 @@ int compressbands(const float *absspec_buffer, float *compressedband, int num_ol return 0; } + + +} // namespace lmms diff --git a/src/core/lv2/Lv2Basics.cpp b/src/core/lv2/Lv2Basics.cpp index b6be53a2cf6..ab5db6ef106 100644 --- a/src/core/lv2/Lv2Basics.cpp +++ b/src/core/lv2/Lv2Basics.cpp @@ -26,6 +26,9 @@ #ifdef LMMS_HAVE_LV2 +namespace lmms +{ + QString qStringFromPluginNode(const LilvPlugin* plug, LilvNode* (*getFunc)(const LilvPlugin*)) { @@ -45,5 +48,7 @@ std::string stdStringFromPortName(const LilvPlugin* plug, const LilvPort* port) lilv_node_as_string(AutoLilvNode(lilv_port_get_name(plug, port)).get())); } +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2ControlBase.cpp b/src/core/lv2/Lv2ControlBase.cpp index 98fe7b13b20..5b820883154 100644 --- a/src/core/lv2/Lv2ControlBase.cpp +++ b/src/core/lv2/Lv2ControlBase.cpp @@ -34,6 +34,8 @@ #include "Lv2Proc.h" +namespace lmms +{ Plugin::PluginTypes Lv2ControlBase::check(const LilvPlugin *plugin, @@ -212,6 +214,7 @@ void Lv2ControlBase::handleMidiInputEvent(const MidiEvent &event, } +} // namespace lmms #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2Evbuf.cpp b/src/core/lv2/Lv2Evbuf.cpp index 0c908181571..2d2ad0517e7 100644 --- a/src/core/lv2/Lv2Evbuf.cpp +++ b/src/core/lv2/Lv2Evbuf.cpp @@ -36,6 +36,10 @@ #include +namespace lmms +{ + + struct LV2_Evbuf_Impl { uint32_t capacity; uint32_t atom_Chunk; @@ -190,4 +194,7 @@ lv2_evbuf_write(LV2_Evbuf_Iterator* iter, return true; } + +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2Features.cpp b/src/core/lv2/Lv2Features.cpp index fe668807e06..1a311446821 100644 --- a/src/core/lv2/Lv2Features.cpp +++ b/src/core/lv2/Lv2Features.cpp @@ -32,6 +32,10 @@ #include "Lv2Manager.h" +namespace lmms +{ + + bool Lv2Features::isFeatureSupported(const char* featName) { return Engine::getLv2Manager()->isFeatureSupported(featName); @@ -93,5 +97,7 @@ void *&Lv2Features::operator[](const char *featName) } +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2Manager.cpp b/src/core/lv2/Lv2Manager.cpp index ed2d0505340..c15b83da03a 100644 --- a/src/core/lv2/Lv2Manager.cpp +++ b/src/core/lv2/Lv2Manager.cpp @@ -46,6 +46,8 @@ #include "PluginIssue.h" +namespace lmms +{ const std::set Lv2Manager::pluginBlacklist = @@ -260,6 +262,6 @@ bool Lv2Manager::isSubclassOf(const LilvPluginClass* clvss, const char* uriStr) } - +} // namespace lmms #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2Options.cpp b/src/core/lv2/Lv2Options.cpp index e941165f090..36281ee6345 100644 --- a/src/core/lv2/Lv2Options.cpp +++ b/src/core/lv2/Lv2Options.cpp @@ -29,6 +29,10 @@ #include +namespace lmms +{ + + std::set Lv2Options::s_supportedOptions; @@ -90,4 +94,6 @@ void Lv2Options::initOption(LV2_URID key, uint32_t size, LV2_URID type, } +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2Ports.cpp b/src/core/lv2/Lv2Ports.cpp index 4db7f3e2a5a..9e7a9e80cfa 100644 --- a/src/core/lv2/Lv2Ports.cpp +++ b/src/core/lv2/Lv2Ports.cpp @@ -35,7 +35,9 @@ #include "Lv2Manager.h" #include "Lv2Evbuf.h" -namespace Lv2Ports { + +namespace lmms::Lv2Ports +{ @@ -359,7 +361,7 @@ Visitor::~Visitor() {} -} // namespace Lv2Ports +} // namespace lmms::Lv2Ports #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2Proc.cpp b/src/core/lv2/Lv2Proc.cpp index 3ea734f9130..d946e7d8f76 100644 --- a/src/core/lv2/Lv2Proc.cpp +++ b/src/core/lv2/Lv2Proc.cpp @@ -44,6 +44,8 @@ #include "MidiEventToByteSeq.h" +namespace lmms +{ // container for everything required to store MIDI events going to the plugin @@ -838,4 +840,6 @@ AutoLilvNode Lv2Proc::uri(const char *uriStr) } +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2SubPluginFeatures.cpp b/src/core/lv2/Lv2SubPluginFeatures.cpp index 3f86c5324e2..f8ab04a1cc9 100644 --- a/src/core/lv2/Lv2SubPluginFeatures.cpp +++ b/src/core/lv2/Lv2SubPluginFeatures.cpp @@ -36,6 +36,9 @@ #include "Lv2Basics.h" #include "Lv2Manager.h" +namespace lmms +{ + const LilvPlugin *Lv2SubPluginFeatures::getPlugin( const Plugin::Descriptor::SubPluginFeatures::Key &k) @@ -180,5 +183,8 @@ void Lv2SubPluginFeatures::listSubPluginKeys(const Plugin::Descriptor *desc, } } + +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2UridCache.cpp b/src/core/lv2/Lv2UridCache.cpp index 3392f9bd2f7..746878afb96 100644 --- a/src/core/lv2/Lv2UridCache.cpp +++ b/src/core/lv2/Lv2UridCache.cpp @@ -39,6 +39,10 @@ #define LV2_BUF_SIZE__nominalBlockLength LV2_BUF_SIZE_PREFIX "nominalBlockLength" #endif +namespace lmms +{ + + uint32_t Lv2UridCache::operator[](Lv2UridCache::Id id) const { Q_ASSERT(id != Id::size); @@ -67,6 +71,9 @@ Lv2UridCache::Lv2UridCache(UridMap &mapper) for(uint32_t urid : m_cache) { Q_ASSERT(urid != noIdYet); } } + +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2UridMap.cpp b/src/core/lv2/Lv2UridMap.cpp index 7e4fa864f1e..4709f4898ff 100644 --- a/src/core/lv2/Lv2UridMap.cpp +++ b/src/core/lv2/Lv2UridMap.cpp @@ -27,6 +27,10 @@ #ifdef LMMS_HAVE_LV2 +namespace lmms +{ + + static LV2_URID staticMap(LV2_URID_Map_Handle handle, const char* uri) { UridMap* map = static_cast(handle); @@ -95,5 +99,8 @@ const char *UridMap::unmap(LV2_URID urid) return (idx < m_unMap.size()) ? m_unMap[idx] : nullptr; } + +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/midi/MidiAlsaRaw.cpp b/src/core/midi/MidiAlsaRaw.cpp index a4fcae19e7b..74d80be964a 100644 --- a/src/core/midi/MidiAlsaRaw.cpp +++ b/src/core/midi/MidiAlsaRaw.cpp @@ -30,6 +30,10 @@ #ifdef LMMS_HAVE_ALSA +namespace lmms +{ + + MidiAlsaRaw::MidiAlsaRaw() : MidiClientRaw(), m_inputp( &m_input ), @@ -170,5 +174,7 @@ void MidiAlsaRaw::run() } -#endif +} // namespace lmms + +#endif // LMMS_HAVE_ALSA diff --git a/src/core/midi/MidiAlsaSeq.cpp b/src/core/midi/MidiAlsaSeq.cpp index c47dcf6cfae..80bce1edbcd 100644 --- a/src/core/midi/MidiAlsaSeq.cpp +++ b/src/core/midi/MidiAlsaSeq.cpp @@ -33,6 +33,10 @@ #ifdef LMMS_HAVE_ALSA + +namespace lmms +{ + const int EventPollTimeOut = 250; @@ -695,5 +699,7 @@ void MidiAlsaSeq::updatePortList() } -#endif +} // namespace lmms + +#endif // LMMS_HAVE_ALSA diff --git a/src/core/midi/MidiApple.cpp b/src/core/midi/MidiApple.cpp index 66a996d0fec..01836c50b3e 100644 --- a/src/core/midi/MidiApple.cpp +++ b/src/core/midi/MidiApple.cpp @@ -36,6 +36,11 @@ #include + +namespace lmms +{ + + const unsigned int SYSEX_LENGTH=1024; MidiApple::MidiApple() : @@ -625,6 +630,6 @@ char * MidiApple::getFullName(MIDIEndpointRef &endpoint_ref) } -#endif - +} // namespace lmms +#endif // LMMS_BUILD_APPLE diff --git a/src/core/midi/MidiClient.cpp b/src/core/midi/MidiClient.cpp index 06de8c4b090..328ef1ca986 100644 --- a/src/core/midi/MidiClient.cpp +++ b/src/core/midi/MidiClient.cpp @@ -28,6 +28,9 @@ #include "Note.h" +namespace lmms +{ + MidiClient::MidiClient() { } @@ -325,3 +328,5 @@ int MidiClientRaw::eventLength( const unsigned char event ) } return 1; } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/midi/MidiController.cpp b/src/core/midi/MidiController.cpp index 051ab978a72..f9204e56f10 100644 --- a/src/core/midi/MidiController.cpp +++ b/src/core/midi/MidiController.cpp @@ -31,6 +31,9 @@ #include "MidiClient.h" #include "MidiController.h" +namespace lmms +{ + MidiController::MidiController( Model * _parent ) : Controller( Controller::MidiController, _parent, tr( "MIDI Controller" ) ), @@ -149,11 +152,11 @@ QString MidiController::nodeName() const -ControllerDialog * MidiController::createDialog( QWidget * _parent ) +gui::ControllerDialog* MidiController::createDialog( QWidget * _parent ) { return nullptr; } - +} // namespace lmms diff --git a/src/core/midi/MidiEventToByteSeq.cpp b/src/core/midi/MidiEventToByteSeq.cpp index 98f0541d032..6ef302c309b 100644 --- a/src/core/midi/MidiEventToByteSeq.cpp +++ b/src/core/midi/MidiEventToByteSeq.cpp @@ -29,6 +29,10 @@ #include "MidiEvent.h" +namespace lmms +{ + + std::size_t writeToByteSeq( const MidiEvent& ev, uint8_t *data, std::size_t bufsize) { @@ -105,3 +109,5 @@ std::size_t writeToByteSeq( return size; } + +} // namespace lmms diff --git a/src/core/midi/MidiJack.cpp b/src/core/midi/MidiJack.cpp index c6e6873437f..dc5f250b705 100644 --- a/src/core/midi/MidiJack.cpp +++ b/src/core/midi/MidiJack.cpp @@ -36,6 +36,9 @@ #include "Engine.h" #include "MainWindow.h" +namespace lmms +{ + /* callback functions for jack */ static int JackMidiProcessCallback(jack_nframes_t nframes, void *arg) { @@ -229,4 +232,6 @@ void MidiJack::run() } } +} // namespace lmms + #endif // LMMS_HAVE_JACK diff --git a/src/core/midi/MidiOss.cpp b/src/core/midi/MidiOss.cpp index 77f324442d7..6aedbd9c1d1 100644 --- a/src/core/midi/MidiOss.cpp +++ b/src/core/midi/MidiOss.cpp @@ -31,6 +31,9 @@ #include "gui_templates.h" +namespace lmms +{ + MidiOss::MidiOss() : MidiClientRaw(), @@ -105,6 +108,6 @@ void MidiOss::run() } -#endif - +} // namespace lmms +#endif // LMMS_HAVE_OSS diff --git a/src/core/midi/MidiPort.cpp b/src/core/midi/MidiPort.cpp index 99790add6ff..29088c0cd54 100644 --- a/src/core/midi/MidiPort.cpp +++ b/src/core/midi/MidiPort.cpp @@ -31,6 +31,11 @@ #include "Note.h" #include "Song.h" + +namespace lmms +{ + + static MidiDummy s_dummyClient; @@ -421,3 +426,6 @@ void MidiPort::invalidateCilent() { m_midiClient = &s_dummyClient; } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/midi/MidiSndio.cpp b/src/core/midi/MidiSndio.cpp index 29fa4d84fbc..1fe9519b032 100644 --- a/src/core/midi/MidiSndio.cpp +++ b/src/core/midi/MidiSndio.cpp @@ -40,6 +40,10 @@ #include "gui_templates.h" +namespace lmms +{ + + MidiSndio::MidiSndio( void ) : MidiClientRaw(), m_quit( false ) @@ -117,4 +121,7 @@ void MidiSndio::run( void ) } } + +} // namespace lmms + #endif /* LMMS_HAVE_SNDIO */ diff --git a/src/core/midi/MidiWinMM.cpp b/src/core/midi/MidiWinMM.cpp index eb1a00c7fb1..35792090f5b 100644 --- a/src/core/midi/MidiWinMM.cpp +++ b/src/core/midi/MidiWinMM.cpp @@ -28,6 +28,10 @@ #ifdef LMMS_BUILD_WIN32 +namespace lmms +{ + + MidiWinMM::MidiWinMM() : MidiClient(), m_inputDevices(), @@ -300,4 +304,6 @@ void MidiWinMM::openDevices() } -#endif +} // namespace lmms + +#endif // LMMS_BUILD_WIN32 diff --git a/src/gui/AboutDialog.cpp b/src/gui/AboutDialog.cpp index e3f016b5eb8..6c6b435eb8b 100644 --- a/src/gui/AboutDialog.cpp +++ b/src/gui/AboutDialog.cpp @@ -29,6 +29,8 @@ #include "versioninfo.h" +namespace lmms::gui +{ AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), @@ -58,3 +60,5 @@ AboutDialog::AboutDialog(QWidget* parent) : involvedLabel->setPlainText( embed::getText( "CONTRIBUTORS" ) ); } + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/ActionGroup.cpp b/src/gui/ActionGroup.cpp index 5b40bd2040a..053bb556d1e 100644 --- a/src/gui/ActionGroup.cpp +++ b/src/gui/ActionGroup.cpp @@ -24,6 +24,9 @@ #include "ActionGroup.h" +namespace lmms::gui +{ + ActionGroup::ActionGroup(QObject* parent) : QActionGroup(parent) { connect(this, SIGNAL(triggered(QAction*)), this, SLOT(actionTriggered_(QAction*))); @@ -53,3 +56,5 @@ void ActionGroup::actionTriggered_(QAction* action) emit triggered(actions().indexOf(action)); } + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/AudioAlsaSetupWidget.cpp b/src/gui/AudioAlsaSetupWidget.cpp index 26da660dae9..f6e91f8e34b 100644 --- a/src/gui/AudioAlsaSetupWidget.cpp +++ b/src/gui/AudioAlsaSetupWidget.cpp @@ -33,6 +33,8 @@ #include "LcdSpinBox.h" #include "gui_templates.h" +namespace lmms::gui +{ AudioAlsaSetupWidget::AudioAlsaSetupWidget( QWidget * _parent ) : AudioDeviceSetupWidget( AudioAlsa::name(), _parent ), @@ -116,4 +118,6 @@ void AudioAlsaSetupWidget::onCurrentIndexChanged(int index) } +} // namespace lmms::gui + #endif diff --git a/src/gui/AudioDeviceSetupWidget.cpp b/src/gui/AudioDeviceSetupWidget.cpp index feba3f1b0fb..ae559404c72 100644 --- a/src/gui/AudioDeviceSetupWidget.cpp +++ b/src/gui/AudioDeviceSetupWidget.cpp @@ -24,6 +24,8 @@ #include "AudioDeviceSetupWidget.h" +namespace lmms::gui +{ AudioDeviceSetupWidget::AudioDeviceSetupWidget(const QString & caption, QWidget * parent) : TabWidget(TabWidget::tr("Settings for %1").arg(tr(caption.toUtf8())), parent) @@ -39,3 +41,5 @@ void AudioDeviceSetupWidget::show() parentWidget()->show(); QWidget::show(); } + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/AutomatableModelView.cpp b/src/gui/AutomatableModelView.cpp index 6427134dc4d..9f7d1ba9418 100644 --- a/src/gui/AutomatableModelView.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -39,6 +39,9 @@ #include "AutomationEditor.h" +namespace lmms +{ + static float floatFromClipboard(bool* ok=nullptr); AutomatableModelView::AutomatableModelView( ::Model* model, QWidget* _this ) : @@ -304,3 +307,5 @@ static float floatFromClipboard(bool* ok) return getString( MimeType::Default ).toFloat(ok); } + +} // namespace lmms diff --git a/src/gui/AutomationPatternView.cpp b/src/gui/AutomationPatternView.cpp index b40c91dc08c..786f437402c 100644 --- a/src/gui/AutomationPatternView.cpp +++ b/src/gui/AutomationPatternView.cpp @@ -41,6 +41,9 @@ #include "Engine.h" +namespace lmms::gui +{ + QPixmap * AutomationPatternView::s_pat_rec = nullptr; AutomationPatternView::AutomationPatternView( AutomationPattern * _pattern, @@ -508,3 +511,6 @@ void AutomationPatternView::scaleTimemapToFit( float oldMin, float oldMax ) m_pat->generateTangents(); } + + +} // namespace lmms::gui diff --git a/src/gui/AutomationTrackView.cpp b/src/gui/AutomationTrackView.cpp index 9242c081a68..965c883420e 100644 --- a/src/gui/AutomationTrackView.cpp +++ b/src/gui/AutomationTrackView.cpp @@ -32,7 +32,10 @@ #include "StringPairDrag.h" #include "TrackContainerView.h" #include "TrackLabelButton.h" - + + +namespace lmms::gui +{ AutomationTrackView::AutomationTrackView( AutomationTrack * _at, TrackContainerView* tcv ) : TrackView( _at, tcv ) @@ -85,4 +88,7 @@ void AutomationTrackView::dropEvent( QDropEvent * _de ) } update(); -} \ No newline at end of file +} + + +} // namespace lmms::gui diff --git a/src/gui/BBTCOView.cpp b/src/gui/BBTCOView.cpp index f15206460c0..25677584b1c 100644 --- a/src/gui/BBTCOView.cpp +++ b/src/gui/BBTCOView.cpp @@ -36,6 +36,10 @@ #include "Song.h" #include "ToolTip.h" +namespace lmms::gui +{ + + BBTCOView::BBTCOView( TrackContentObject * _tco, TrackView * _tv ) : TrackContentObjectView( _tco, _tv ), m_bbTCO( dynamic_cast( _tco ) ), @@ -188,4 +192,7 @@ void BBTCOView::update() ToolTip::add(this, m_bbTCO->name()); TrackContentObjectView::update(); -} \ No newline at end of file +} + + +} // namespace lmms::gui diff --git a/src/gui/BBTrackView.cpp b/src/gui/BBTrackView.cpp index 8bec7e8efbb..5c350d660f0 100644 --- a/src/gui/BBTrackView.cpp +++ b/src/gui/BBTrackView.cpp @@ -30,6 +30,9 @@ #include "GuiApplication.h" #include "TrackLabelButton.h" +namespace lmms::gui +{ + BBTrackView::BBTrackView( BBTrack * _bbt, TrackContainerView* tcv ) : TrackView( _bbt, tcv ), m_bbTrack( _bbt ) @@ -73,4 +76,7 @@ void BBTrackView::clickedTrackLabel() Engine::getBBTrackContainer()->setCurrentBB( m_bbTrack->index() ); getGUI()->getBBEditor()->parentWidget()->show(); getGUI()->getBBEditor()->setFocus( Qt::ActiveWindowFocusReason ); -} \ No newline at end of file +} + + +} // namespace lmms::gui diff --git a/src/gui/ControllerConnectionDialog.cpp b/src/gui/ControllerConnectionDialog.cpp index b72914716ce..d38e5fcee2f 100644 --- a/src/gui/ControllerConnectionDialog.cpp +++ b/src/gui/ControllerConnectionDialog.cpp @@ -46,6 +46,9 @@ #include "embed.h" +namespace lmms +{ + class AutoDetectMidiController : public MidiController { public: @@ -122,6 +125,8 @@ public slots: +namespace gui +{ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, const AutomatableModel * _target_model ) : @@ -441,5 +446,6 @@ void ControllerConnectionDialog::enableAutoDetect( QAction * _a ) +} // namespace gui - +} // namespace lmms diff --git a/src/gui/ControllerDialog.cpp b/src/gui/ControllerDialog.cpp index f854ab1b94e..be7d5dbef6d 100644 --- a/src/gui/ControllerDialog.cpp +++ b/src/gui/ControllerDialog.cpp @@ -28,6 +28,9 @@ #include "ControllerDialog.h" #include "Controller.h" +namespace lmms::gui +{ + ControllerDialog::ControllerDialog( Controller * _controller, QWidget * _parent ) : @@ -52,4 +55,4 @@ void ControllerDialog::closeEvent( QCloseEvent * _ce ) - +} // namespace lmms::gui diff --git a/src/gui/EffectControlDialog.cpp b/src/gui/EffectControlDialog.cpp index 3439835d139..ad914ffca7c 100644 --- a/src/gui/EffectControlDialog.cpp +++ b/src/gui/EffectControlDialog.cpp @@ -29,6 +29,9 @@ #include "EffectControlDialog.h" #include "EffectControls.h" +namespace lmms::gui +{ + EffectControlDialog::EffectControlDialog( EffectControls * _controls ) : QWidget( nullptr ), @@ -56,6 +59,4 @@ void EffectControlDialog::closeEvent( QCloseEvent * _ce ) } - - - +} // namespace lmms::gui diff --git a/src/gui/EffectSelectDialog.cpp b/src/gui/EffectSelectDialog.cpp index 56e30d4b2d5..80e9ba40131 100644 --- a/src/gui/EffectSelectDialog.cpp +++ b/src/gui/EffectSelectDialog.cpp @@ -34,6 +34,10 @@ #include +namespace lmms::gui +{ + + EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) : QDialog( _parent ), ui( new Ui::EffectSelectDialog ), @@ -271,6 +275,4 @@ void EffectSelectDialog::updateSelection() } - - - +} // namespace lmms::gui diff --git a/src/gui/ExportProjectDialog.cpp b/src/gui/ExportProjectDialog.cpp index c3bf074e05d..9a1a2784631 100644 --- a/src/gui/ExportProjectDialog.cpp +++ b/src/gui/ExportProjectDialog.cpp @@ -33,6 +33,8 @@ #include "MainWindow.h" #include "OutputSettings.h" +namespace lmms::gui +{ ExportProjectDialog::ExportProjectDialog( const QString & _file_name, QWidget * _parent, bool multi_export=false ) : @@ -296,3 +298,5 @@ void ExportProjectDialog::updateTitleBar( int _prog ) getGUI()->mainWindow()->setWindowTitle( tr( "Rendering: %1%" ).arg( _prog ) ); } + +} // namespace lmms::gui diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index fb61deada23..c89f8179cec 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -58,6 +58,10 @@ #include "StringPairDrag.h" #include "TextFloat.h" +namespace lmms::gui +{ + + enum TreeWidgetItemTypes { TypeFileItem = QTreeWidgetItem::UserType, @@ -1290,3 +1294,6 @@ QString FileItem::extension(const QString & file ) { return QFileInfo( file ).suffix().toLower(); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/FxMixerView.cpp b/src/gui/FxMixerView.cpp index 9b235e654d6..1bccde63a82 100644 --- a/src/gui/FxMixerView.cpp +++ b/src/gui/FxMixerView.cpp @@ -52,6 +52,10 @@ #include "BBTrackContainer.h" #include "TrackContainer.h" // For TrackContainer::TrackList typedef +namespace lmms::gui +{ + + FxMixerView::FxMixerView() : QWidget(), ModelView( nullptr, this ), @@ -624,3 +628,6 @@ void FxMixerView::updateFaders() } } } + + +} // namesapce lmms::gui diff --git a/src/gui/GuiApplication.cpp b/src/gui/GuiApplication.cpp index 4624cf2ffff..90714b91afe 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -51,6 +51,17 @@ #include #endif +namespace lmms +{ + +gui::GuiApplication* getGUI() +{ + return gui::GuiApplication::instance(); +} + +namespace gui +{ + GuiApplication* GuiApplication::s_instance = nullptr; GuiApplication* GuiApplication::instance() @@ -58,10 +69,7 @@ GuiApplication* GuiApplication::instance() return s_instance; } -GuiApplication* getGUI() -{ - return GuiApplication::instance(); -} + GuiApplication::GuiApplication() { @@ -249,3 +257,8 @@ QFont GuiApplication::getWin32SystemFont() return QFont( QString::fromUtf8( metrics.lfMessageFont.lfFaceName ), pointSize ); } #endif + + +} // namespace gui + +} // namespace lmms \ No newline at end of file diff --git a/src/gui/InstrumentTrackView.cpp b/src/gui/InstrumentTrackView.cpp index 17454a64041..6bac4d471e6 100644 --- a/src/gui/InstrumentTrackView.cpp +++ b/src/gui/InstrumentTrackView.cpp @@ -48,6 +48,10 @@ #include "TrackLabelButton.h" +namespace lmms::gui +{ + + InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerView* tcv ) : TrackView( _it, tcv ), m_window( nullptr ), @@ -384,3 +388,5 @@ QMenu * InstrumentTrackView::createFxMenu(QString title, QString newFxLabel) return fxMenu; } + +} // namespace lmms::gui diff --git a/src/gui/InstrumentTrackWindow.cpp b/src/gui/InstrumentTrackWindow.cpp index cda4e44f813..4e49f795bc5 100644 --- a/src/gui/InstrumentTrackWindow.cpp +++ b/src/gui/InstrumentTrackWindow.cpp @@ -67,6 +67,10 @@ #include "TrackLabelButton.h" +namespace lmms::gui +{ + + const int INSTRUMENT_WIDTH = 254; const int INSTRUMENT_HEIGHT = INSTRUMENT_WIDTH; const int PIANO_HEIGHT = 80; @@ -671,3 +675,5 @@ void InstrumentTrackWindow::adjustTabSize(QWidget *w) w->setMinimumSize(INSTRUMENT_WIDTH - 4, INSTRUMENT_HEIGHT - 4 - 1); } + +} // namespace lmms::gui diff --git a/src/gui/InstrumentView.cpp b/src/gui/InstrumentView.cpp index 80594a04ad7..ee0eed77ed3 100644 --- a/src/gui/InstrumentView.cpp +++ b/src/gui/InstrumentView.cpp @@ -30,6 +30,8 @@ #include "InstrumentTrackWindow.h" #include "StringPairDrag.h" +namespace lmms::gui +{ InstrumentView::InstrumentView( Instrument * _Instrument, QWidget * _parent ) : PluginView( _Instrument, _parent ) @@ -78,3 +80,5 @@ InstrumentViewFixedSize::~InstrumentViewFixedSize() { } + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/LfoControllerDialog.cpp b/src/gui/LfoControllerDialog.cpp index 943894a7160..77ad3d8da55 100644 --- a/src/gui/LfoControllerDialog.cpp +++ b/src/gui/LfoControllerDialog.cpp @@ -41,6 +41,10 @@ #include "TempoSyncKnob.h" #include "PixmapButton.h" +namespace lmms::gui +{ + + const int CD_ENV_KNOBS_LBL_Y = 11; const int CD_KNOB_X_SPACING = 32; @@ -274,3 +278,4 @@ void LfoControllerDialog::modelChanged() } +} // namespace lmms::gui diff --git a/src/gui/LmmsPalette.cpp b/src/gui/LmmsPalette.cpp index e0b356d7a25..769405d3e7f 100644 --- a/src/gui/LmmsPalette.cpp +++ b/src/gui/LmmsPalette.cpp @@ -28,6 +28,9 @@ #include "LmmsPalette.h" +namespace lmms::gui +{ + LmmsPalette::LmmsPalette( QWidget * parent, QStyle * stylearg ) : QWidget( parent ), @@ -90,4 +93,4 @@ QPalette LmmsPalette::palette() const } - +} // namespace lmms::gui diff --git a/src/gui/LmmsStyle.cpp b/src/gui/LmmsStyle.cpp index bc0115f49bf..0315b890dd4 100644 --- a/src/gui/LmmsStyle.cpp +++ b/src/gui/LmmsStyle.cpp @@ -34,6 +34,11 @@ #include "LmmsStyle.h" + +namespace lmms::gui +{ + + QPalette * LmmsStyle::s_palette = nullptr; QLinearGradient getGradient( const QColor & _col, const QRectF & _rect ) @@ -369,3 +374,6 @@ void LmmsStyle::hoverColors( bool sunken, bool hover, bool active, QColor& color blend = QColor( 33, 33, 33 ); } } + + +} // namespace lmms::gui diff --git a/src/gui/Lv2ViewBase.cpp b/src/gui/Lv2ViewBase.cpp index 5dedc5b13f7..1819a6a394d 100644 --- a/src/gui/Lv2ViewBase.cpp +++ b/src/gui/Lv2ViewBase.cpp @@ -48,6 +48,8 @@ #include "SubWindow.h" +namespace lmms::gui +{ Lv2ViewProc::Lv2ViewProc(QWidget* parent, Lv2Proc* ctrlBase, int colNum) : @@ -245,4 +247,6 @@ AutoLilvNode Lv2ViewBase::uri(const char *uriStr) } +} // namespace lmms::gui + #endif // LMMS_HAVE_LV2 diff --git a/src/gui/MainApplication.cpp b/src/gui/MainApplication.cpp index 64aeb73a583..3d77395cf29 100644 --- a/src/gui/MainApplication.cpp +++ b/src/gui/MainApplication.cpp @@ -31,6 +31,10 @@ #include "MainWindow.h" #include "Song.h" +namespace lmms +{ + + MainApplication::MainApplication(int& argc, char** argv) : QApplication(argc, argv), m_queuedFile() @@ -102,3 +106,6 @@ bool MainApplication::nativeEventFilter(const QByteArray& eventType, return false; } #endif + + +} // namespace lmms \ No newline at end of file diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 461802686c8..0f9ced717f7 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -77,6 +77,9 @@ #include "lmmsversion.h" +namespace lmms::gui +{ + #if !defined(LMMS_BUILD_WIN32) && !defined(LMMS_BUILD_APPLE) && !defined(LMMS_BUILD_HAIKU) //Work around an issue on KDE5 as per https://bugs.kde.org/show_bug.cgi?id=337491#c21 void disableAutoKeyAccelerators(QWidget* mainWindow) @@ -1723,3 +1726,6 @@ void MainWindow::onProjectFileNameChanged() { this->resetWindowTitle(); } + + +} // namespace lmms::gui diff --git a/src/gui/MidiCCRackView.cpp b/src/gui/MidiCCRackView.cpp index a77cceede0c..345c9cf041b 100644 --- a/src/gui/MidiCCRackView.cpp +++ b/src/gui/MidiCCRackView.cpp @@ -39,6 +39,9 @@ #include "MainWindow.h" #include "Track.h" +namespace lmms::gui +{ + MidiCCRackView::MidiCCRackView(InstrumentTrack * track) : QWidget(), @@ -131,3 +134,6 @@ void MidiCCRackView::saveSettings(QDomDocument & doc, QDomElement & parent) void MidiCCRackView::loadSettings(const QDomElement &) { } + + +} // namespace lmms::gui diff --git a/src/gui/MidiSetupWidget.cpp b/src/gui/MidiSetupWidget.cpp index 8342070571b..91a695afa99 100644 --- a/src/gui/MidiSetupWidget.cpp +++ b/src/gui/MidiSetupWidget.cpp @@ -29,6 +29,11 @@ #include "ConfigManager.h" #include "gui_templates.h" + +namespace lmms::gui +{ + + MidiSetupWidget::MidiSetupWidget(const QString & caption, const QString & configSection, const QString & devName, QWidget * parent) : TabWidget(TabWidget::tr("Settings for %1").arg(tr(caption.toUtf8())), parent), @@ -64,3 +69,6 @@ void MidiSetupWidget::show() parentWidget()->setVisible(visible); QWidget::setVisible(visible); } + + +} // namespace lmms::gui diff --git a/src/gui/ModelView.cpp b/src/gui/ModelView.cpp index 055f0846dcf..e6ba92258d8 100644 --- a/src/gui/ModelView.cpp +++ b/src/gui/ModelView.cpp @@ -26,6 +26,8 @@ #include "ModelView.h" +namespace lmms +{ ModelView::ModelView( Model* model, QWidget* widget ) : @@ -94,3 +96,4 @@ void ModelView::doConnections() } +} // namespace lmms diff --git a/src/gui/PatternView.cpp b/src/gui/PatternView.cpp index 34c947283bb..9edfbcdba72 100644 --- a/src/gui/PatternView.cpp +++ b/src/gui/PatternView.cpp @@ -35,6 +35,10 @@ #include "PianoRoll.h" #include "RenameDialog.h" +namespace lmms::gui +{ + + PatternView::PatternView( Pattern* pattern, TrackView* parent ) : TrackContentObjectView( pattern, parent ), m_pat( pattern ), @@ -613,3 +617,6 @@ void PatternView::paintEvent( QPaintEvent * ) painter.drawPixmap( 0, 0, m_paintPixmap ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/PeakControllerDialog.cpp b/src/gui/PeakControllerDialog.cpp index 48f0a93da3f..33aa21b4108 100644 --- a/src/gui/PeakControllerDialog.cpp +++ b/src/gui/PeakControllerDialog.cpp @@ -39,6 +39,9 @@ #include "Knob.h" #include "TempoSyncKnob.h" +namespace lmms::gui +{ + PeakControllerDialog::PeakControllerDialog( Controller * _model, QWidget * _parent ) : ControllerDialog( _model, _parent ) @@ -94,3 +97,4 @@ void PeakControllerDialog::modelChanged() } +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/PianoView.cpp b/src/gui/PianoView.cpp index 8771e0588d7..ac2cdf4e433 100644 --- a/src/gui/PianoView.cpp +++ b/src/gui/PianoView.cpp @@ -57,6 +57,10 @@ #include "MainWindow.h" +namespace lmms::gui +{ + + /*! The scale of C Major - white keys only. */ Keys WhiteKeys[] = @@ -983,5 +987,5 @@ void PianoView::paintEvent( QPaintEvent * ) } - +} // namespace lmms::gui diff --git a/src/gui/PluginBrowser.cpp b/src/gui/PluginBrowser.cpp index 0f8a07f788b..c81332aa894 100644 --- a/src/gui/PluginBrowser.cpp +++ b/src/gui/PluginBrowser.cpp @@ -38,6 +38,9 @@ #include "StringPairDrag.h" #include "PluginFactory.h" +namespace lmms::gui +{ + PluginBrowser::PluginBrowser( QWidget * _parent ) : SideBarWidget( tr( "Instrument Plugins" ), @@ -286,9 +289,4 @@ void PluginDescWidget::mousePressEvent( QMouseEvent * _me ) } - - - - - - +} // namespace lmms::gui diff --git a/src/gui/RowTableView.cpp b/src/gui/RowTableView.cpp index 9830354beb2..cef8b87ea6e 100644 --- a/src/gui/RowTableView.cpp +++ b/src/gui/RowTableView.cpp @@ -29,6 +29,10 @@ #include +namespace lmms::gui +{ + + class RowDelegate : public QStyledItemDelegate { public: @@ -135,5 +139,4 @@ void RowTableView::keyPressEvent( QKeyEvent * event ) } - - +} // namespace lmms::gui diff --git a/src/gui/SampleTCOView.cpp b/src/gui/SampleTCOView.cpp index 57ca51893b1..519a680469e 100644 --- a/src/gui/SampleTCOView.cpp +++ b/src/gui/SampleTCOView.cpp @@ -34,6 +34,10 @@ #include "StringPairDrag.h" #include "ToolTip.h" +namespace lmms::gui +{ + + SampleTCOView::SampleTCOView( SampleTCO * _tco, TrackView * _tv ) : TrackContentObjectView( _tco, _tv ), m_tco( _tco ), @@ -350,4 +354,7 @@ bool SampleTCOView::splitTCO( const TimePos pos ) return true; } else { return false; } -} \ No newline at end of file +} + + +} // namespace lmms::gui diff --git a/src/gui/SampleTrackView.cpp b/src/gui/SampleTrackView.cpp index 1f53c55e598..78d3e350a7d 100644 --- a/src/gui/SampleTrackView.cpp +++ b/src/gui/SampleTrackView.cpp @@ -39,6 +39,10 @@ #include "TrackLabelButton.h" +namespace lmms::gui +{ + + SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) : TrackView( _t, tcv ) { @@ -228,4 +232,7 @@ void SampleTrackView::assignFxLine(int channelIndex) model()->effectChannelModel()->setValue(channelIndex); getGUI()->fxMixerView()->setCurrentFxLine(channelIndex); -} \ No newline at end of file +} + + +} // namespace lmms::gui diff --git a/src/gui/SampleTrackWindow.cpp b/src/gui/SampleTrackWindow.cpp index 59566962909..40f6e4f1019 100644 --- a/src/gui/SampleTrackWindow.cpp +++ b/src/gui/SampleTrackWindow.cpp @@ -35,7 +35,10 @@ #include "Song.h" #include "TabWidget.h" #include "TrackLabelButton.h" - + +namespace lmms::gui +{ + SampleTrackWindow::SampleTrackWindow(SampleTrackView * tv) : QWidget(), @@ -262,4 +265,7 @@ void SampleTrackWindow::loadSettings(const QDomElement& element) { m_stv->m_tlb->setChecked(true); } -} \ No newline at end of file +} + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/SetupDialog.cpp b/src/gui/SetupDialog.cpp index 5f7cdc04a41..eb8174508c6 100644 --- a/src/gui/SetupDialog.cpp +++ b/src/gui/SetupDialog.cpp @@ -70,6 +70,10 @@ #include "MidiWinMM.h" +namespace lmms::gui +{ + + constexpr int BUFFERSIZE_RESOLUTION = 32; inline void labelWidget(QWidget * w, const QString & txt) @@ -1398,3 +1402,6 @@ void SetupDialog::showRestartWarning() { restartWarningLbl->show(); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/StringPairDrag.cpp b/src/gui/StringPairDrag.cpp index 6aa5da170ca..e9eef0b88fc 100644 --- a/src/gui/StringPairDrag.cpp +++ b/src/gui/StringPairDrag.cpp @@ -35,6 +35,10 @@ #include "Clipboard.h" +namespace lmms::gui +{ + + StringPairDrag::StringPairDrag( const QString & _key, const QString & _value, const QPixmap & _icon, QWidget * _w ) : QDrag( _w ) @@ -111,3 +115,6 @@ QString StringPairDrag::decodeValue( QDropEvent * _de ) { return Clipboard::decodeValue( _de->mimeData() ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index 5cbac4cd6fa..20bff486d1b 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -35,6 +35,8 @@ #include "embed.h" +namespace lmms::gui +{ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : @@ -376,3 +378,6 @@ void SubWindow::resizeEvent( QResizeEvent * event ) m_trackedNormalGeom.setSize( event->size() ); } } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/TimeLineWidget.cpp b/src/gui/TimeLineWidget.cpp index c9c95190188..31596542fcc 100644 --- a/src/gui/TimeLineWidget.cpp +++ b/src/gui/TimeLineWidget.cpp @@ -39,6 +39,9 @@ #include "TextFloat.h" #include "SongEditor.h" +namespace lmms::gui +{ + QPixmap * TimeLineWidget::s_posMarkerPixmap = nullptr; @@ -435,3 +438,6 @@ void TimeLineWidget::mouseReleaseEvent( QMouseEvent* event ) if ( m_action == SelectSongTCO ) { emit selectionFinished(); } m_action = NoAction; } + + +} // namespace lmms::gui diff --git a/src/gui/ToolPluginView.cpp b/src/gui/ToolPluginView.cpp index a85a7ff6d34..de553519c23 100644 --- a/src/gui/ToolPluginView.cpp +++ b/src/gui/ToolPluginView.cpp @@ -32,6 +32,9 @@ #include "GuiApplication.h" #include "MainWindow.h" +namespace lmms::gui +{ + ToolPluginView::ToolPluginView( ToolPlugin * _toolPlugin ) : PluginView( _toolPlugin, nullptr ) @@ -44,3 +47,4 @@ ToolPluginView::ToolPluginView( ToolPlugin * _toolPlugin ) : } +} // namespace lmms::gui diff --git a/src/gui/TrackContainerView.cpp b/src/gui/TrackContainerView.cpp index 7201427bea8..00c5f1d0c96 100644 --- a/src/gui/TrackContainerView.cpp +++ b/src/gui/TrackContainerView.cpp @@ -46,8 +46,36 @@ #include "GuiApplication.h" #include "PluginFactory.h" +namespace lmms +{ + using namespace std; + +InstrumentLoaderThread::InstrumentLoaderThread( QObject *parent, InstrumentTrack *it, QString name ) : + QThread( parent ), + m_it( it ), + m_name( name ) +{ + m_containerThread = thread(); +} + + + + +void InstrumentLoaderThread::run() +{ + Instrument *i = m_it->loadInstrument(m_name, nullptr, + true /*always DnD*/); + QObject *parent = i->parent(); + i->setParent( 0 ); + i->moveToThread( m_containerThread ); + i->setParent( parent ); +} + +namespace gui +{ + TrackContainerView::TrackContainerView( TrackContainer * _tc ) : QWidget(), ModelView( nullptr, this ), @@ -482,25 +510,7 @@ void TrackContainerView::scrollArea::wheelEvent( QWheelEvent * _we ) } +} // namespace gui -InstrumentLoaderThread::InstrumentLoaderThread( QObject *parent, InstrumentTrack *it, QString name ) : - QThread( parent ), - m_it( it ), - m_name( name ) -{ - m_containerThread = thread(); -} - - - - -void InstrumentLoaderThread::run() -{ - Instrument *i = m_it->loadInstrument(m_name, nullptr, - true /*always DnD*/); - QObject *parent = i->parent(); - i->setParent( 0 ); - i->moveToThread( m_containerThread ); - i->setParent( parent ); -} +} // namespace lmms \ No newline at end of file diff --git a/src/gui/TrackContentObjectView.cpp b/src/gui/TrackContentObjectView.cpp index 6fcb500ef8a..0f4137168da 100644 --- a/src/gui/TrackContentObjectView.cpp +++ b/src/gui/TrackContentObjectView.cpp @@ -51,6 +51,9 @@ #include "TrackContainerView.h" #include "TrackView.h" +namespace lmms::gui +{ + /*! The width of the resize grip in pixels */ @@ -1502,3 +1505,6 @@ QColor TrackContentObjectView::getColorForDisplay( QColor defaultColor ) // Return color to caller return c; } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/TrackView.cpp b/src/gui/TrackView.cpp index 5ede84d9729..2db49f76c1f 100644 --- a/src/gui/TrackView.cpp +++ b/src/gui/TrackView.cpp @@ -47,6 +47,9 @@ #include "TrackContentObjectView.h" +namespace lmms::gui +{ + /*! \brief Create a new track View. * * The track View is handles the actual display of the track, including @@ -450,3 +453,6 @@ void TrackView::setIndicatorMute(FadeButton* indicator, bool muted) QPalette::ColorRole role = muted ? QPalette::Highlight : QPalette::BrightText; indicator->setActiveColor(QApplication::palette().color(QPalette::Active, role)); } + + +} // namespace lmms::gui diff --git a/src/gui/dialogs/ColorChooser.cpp b/src/gui/dialogs/ColorChooser.cpp index b25aa97be6c..d178debe5e3 100644 --- a/src/gui/dialogs/ColorChooser.cpp +++ b/src/gui/dialogs/ColorChooser.cpp @@ -24,6 +24,8 @@ #include +namespace lmms::gui +{ //! Set global palette via array, checking bounds @@ -91,3 +93,6 @@ QVector ColorChooser::nicePalette (int base) } return result; } + + +} // namespace lmms::gui diff --git a/src/gui/dialogs/FileDialog.cpp b/src/gui/dialogs/FileDialog.cpp index 848a7f52a7c..a3b6aaa9bfd 100644 --- a/src/gui/dialogs/FileDialog.cpp +++ b/src/gui/dialogs/FileDialog.cpp @@ -31,6 +31,10 @@ #include "FileDialog.h" +namespace lmms::gui +{ + + FileDialog::FileDialog( QWidget *parent, const QString &caption, const QString &directory, const QString &filter ) : QFileDialog( parent, caption, directory, filter ) @@ -105,3 +109,5 @@ void FileDialog::clearSelection() view->clearSelection(); } + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/dialogs/VersionedSaveDialog.cpp b/src/gui/dialogs/VersionedSaveDialog.cpp index b9b229b1c0c..b4a1d64dd3b 100644 --- a/src/gui/dialogs/VersionedSaveDialog.cpp +++ b/src/gui/dialogs/VersionedSaveDialog.cpp @@ -36,6 +36,10 @@ #include "LedCheckbox.h" +namespace lmms::gui +{ + + VersionedSaveDialog::VersionedSaveDialog( QWidget *parent, QWidget *saveOptionsWidget, const QString &caption, @@ -191,3 +195,6 @@ SaveOptionsWidget::SaveOptionsWidget(Song::SaveOptions &saveOptions) { setLayout(layout); } + + +} // namespace lmms::gui diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 5bdd92b49f4..6cc70b947e0 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -64,6 +64,9 @@ #include "ToolTip.h" +namespace lmms::gui +{ + QPixmap * AutomationEditor::s_toolDraw = nullptr; QPixmap * AutomationEditor::s_toolErase = nullptr; QPixmap * AutomationEditor::s_toolDrawOut = nullptr; @@ -2110,3 +2113,6 @@ void AutomationEditorWindow::updateWindowTitle() setWindowTitle( tr( "Automation Editor - %1" ).arg( m_editor->m_pattern->name() ) ); } + + +} // namespace lmms::gui diff --git a/src/gui/editors/BBEditor.cpp b/src/gui/editors/BBEditor.cpp index 0cb8980281e..c5fbb3dd337 100644 --- a/src/gui/editors/BBEditor.cpp +++ b/src/gui/editors/BBEditor.cpp @@ -39,6 +39,8 @@ #include "Pattern.h" +namespace lmms::gui +{ BBEditor::BBEditor( BBTrackContainer* tc ) : @@ -338,3 +340,6 @@ void BBTrackContainerView::clonePattern() newTrack->unlock(); } } + + +} // namespace lmms::gui diff --git a/src/gui/editors/Editor.cpp b/src/gui/editors/Editor.cpp index dc86a1789dc..d8678bcfd4f 100644 --- a/src/gui/editors/Editor.cpp +++ b/src/gui/editors/Editor.cpp @@ -35,6 +35,10 @@ #include +namespace lmms::gui +{ + + void Editor::setPauseIcon(bool displayPauseIcon) { // If we're playing, show a pause icon @@ -171,3 +175,4 @@ void DropToolBar::dropEvent(QDropEvent* event) +} // namespace lmms::gui diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 22cc09f3a2c..e41ba3f8dff 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -72,11 +72,18 @@ #include "FileDialog.h" +namespace lmms +{ + + using std::move; typedef AutomationPattern::timeMap timeMap; +namespace gui +{ + // some constants... const int INITIAL_PIANOROLL_WIDTH = 970; const int INITIAL_PIANOROLL_HEIGHT = 485; @@ -5337,3 +5344,8 @@ void PianoRollWindow::updateStepRecordingIcon() m_toggleStepRecordingAction->setIcon(embed::getIconPixmap("record_step_off")); } } + + +} // namespace gui + +} // namespace lmms diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 6024b9184be..60e36a18adf 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -54,6 +54,10 @@ #include "ToolTip.h" #include "Track.h" +namespace lmms::gui +{ + + const QVector SongEditor::m_zoomLevels = { 0.125f, 0.25f, 0.5f, 1.0f, 2.0f, 4.0f, 8.0f, 16.0f }; @@ -1131,3 +1135,6 @@ void SongEditorWindow::adjustUiAfterProjectLoad() connect( qobject_cast( parentWidget() ), SIGNAL( focusLost() ), this, SLOT( lostFocus() ) ); m_editor->scrolled(0); } + + +} // namespace lmms::gui diff --git a/src/gui/embed.cpp b/src/gui/embed.cpp index 6ce4b5bd725..d934adcde64 100644 --- a/src/gui/embed.cpp +++ b/src/gui/embed.cpp @@ -28,7 +28,7 @@ #include #include "embed.h" -namespace embed +namespace lmms::embed { QPixmap getIconPixmap(const QString& pixmapName, @@ -86,6 +86,4 @@ QString getText( const char * name ) } -} - - +} // namespace lmms::embed diff --git a/src/gui/menus/RecentProjectsMenu.cpp b/src/gui/menus/RecentProjectsMenu.cpp index dc7b3bd2b4f..bbbf79e86c0 100644 --- a/src/gui/menus/RecentProjectsMenu.cpp +++ b/src/gui/menus/RecentProjectsMenu.cpp @@ -10,6 +10,10 @@ #include "GuiApplication.h" #include "MainWindow.h" +namespace lmms::gui +{ + + RecentProjectsMenu::RecentProjectsMenu(QWidget *parent) : QMenu(tr( "&Recently Opened Projects" ), parent) { @@ -76,3 +80,6 @@ void RecentProjectsMenu::openProject(QAction * _action ) mainWindow->setCursor( Qt::ArrowCursor ); } } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/menus/TemplatesMenu.cpp b/src/gui/menus/TemplatesMenu.cpp index 9f89e3a9f05..1a1ef7c843a 100644 --- a/src/gui/menus/TemplatesMenu.cpp +++ b/src/gui/menus/TemplatesMenu.cpp @@ -8,6 +8,11 @@ #include "GuiApplication.h" #include "MainWindow.h" + +namespace lmms::gui +{ + + TemplatesMenu::TemplatesMenu(QWidget *parent) : QMenu(tr("New from template"), parent) { @@ -67,3 +72,6 @@ void TemplatesMenu::addTemplatesFromDir( const QDir& dir ) { #endif } } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/AutomatableButton.cpp b/src/gui/widgets/AutomatableButton.cpp index 80df31913d5..dbf4ea666d9 100644 --- a/src/gui/widgets/AutomatableButton.cpp +++ b/src/gui/widgets/AutomatableButton.cpp @@ -32,6 +32,8 @@ #include "StringPairDrag.h" +namespace lmms::gui +{ AutomatableButton::AutomatableButton( QWidget * _parent, const QString & _name ) : @@ -267,4 +269,4 @@ void automatableButtonGroup::updateButtons() - +} // namespace lmms::gui diff --git a/src/gui/widgets/AutomatableSlider.cpp b/src/gui/widgets/AutomatableSlider.cpp index cd162a057ff..57e1577b319 100644 --- a/src/gui/widgets/AutomatableSlider.cpp +++ b/src/gui/widgets/AutomatableSlider.cpp @@ -31,6 +31,8 @@ #include "MainWindow.h" +namespace lmms::gui +{ AutomatableSlider::AutomatableSlider( QWidget * _parent, @@ -141,5 +143,5 @@ void AutomatableSlider::updateSlider() - +} // namespace lmms::gui diff --git a/src/gui/widgets/CPULoadWidget.cpp b/src/gui/widgets/CPULoadWidget.cpp index 4cc6bca9fe5..01c36994e94 100644 --- a/src/gui/widgets/CPULoadWidget.cpp +++ b/src/gui/widgets/CPULoadWidget.cpp @@ -32,6 +32,10 @@ #include "Engine.h" +namespace lmms::gui +{ + + CPULoadWidget::CPULoadWidget( QWidget * _parent ) : QWidget( _parent ), m_currentLoad( 0 ), @@ -102,7 +106,4 @@ void CPULoadWidget::updateCpuLoad() } - - - - +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/widgets/CaptionMenu.cpp b/src/gui/widgets/CaptionMenu.cpp index d58879d4d2d..ea9ee9b77d1 100644 --- a/src/gui/widgets/CaptionMenu.cpp +++ b/src/gui/widgets/CaptionMenu.cpp @@ -27,6 +27,8 @@ #include "embed.h" +namespace lmms::gui +{ CaptionMenu::CaptionMenu( const QString & _title, QWidget * _parent ) : @@ -42,3 +44,6 @@ CaptionMenu::CaptionMenu( const QString & _title, QWidget * _parent ) : CaptionMenu::~CaptionMenu() { } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/ComboBox.cpp b/src/gui/widgets/ComboBox.cpp index 9f18bb7cd07..618eda5ec31 100644 --- a/src/gui/widgets/ComboBox.cpp +++ b/src/gui/widgets/ComboBox.cpp @@ -37,6 +37,8 @@ #include "gui_templates.h" #include "MainWindow.h" +namespace lmms::gui +{ QPixmap * ComboBox::s_background = nullptr; QPixmap * ComboBox::s_arrow = nullptr; @@ -250,6 +252,6 @@ void ComboBox::setItem( QAction* item ) } - +} // namespace lmms::gui diff --git a/src/gui/widgets/ControlLayout.cpp b/src/gui/widgets/ControlLayout.cpp index 0885c3c449e..356d608e38a 100644 --- a/src/gui/widgets/ControlLayout.cpp +++ b/src/gui/widgets/ControlLayout.cpp @@ -80,6 +80,10 @@ #include #include + +namespace lmms::gui +{ + constexpr const int ControlLayout::m_minWidth; ControlLayout::ControlLayout(QWidget *parent, int margin, int hSpacing, int vSpacing) @@ -312,3 +316,4 @@ int ControlLayout::smartSpacing(QStyle::PixelMetric pm) const } +} // namespace lmms::gui diff --git a/src/gui/widgets/ControllerRackView.cpp b/src/gui/widgets/ControllerRackView.cpp index d6b7cc410d9..0be8fb6ebc1 100644 --- a/src/gui/widgets/ControllerRackView.cpp +++ b/src/gui/widgets/ControllerRackView.cpp @@ -40,6 +40,9 @@ #include "ControllerView.h" #include "LfoController.h" +namespace lmms::gui +{ + ControllerRackView::ControllerRackView( ) : QWidget(), @@ -214,3 +217,5 @@ void ControllerRackView::closeEvent( QCloseEvent * _ce ) _ce->ignore(); } + +} // namespace lmms::gui diff --git a/src/gui/widgets/ControllerView.cpp b/src/gui/widgets/ControllerView.cpp index a0cdf089356..1a5c7c932bd 100644 --- a/src/gui/widgets/ControllerView.cpp +++ b/src/gui/widgets/ControllerView.cpp @@ -43,6 +43,9 @@ #include "MainWindow.h" #include "ToolTip.h" +namespace lmms::gui +{ + ControllerView::ControllerView( Controller * _model, QWidget * _parent ) : QFrame( _parent ), @@ -182,3 +185,6 @@ void ControllerView::contextMenuEvent( QContextMenuEvent * ) contextMenu->exec( QCursor::pos() ); delete contextMenu; } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/widgets/Controls.cpp b/src/gui/widgets/Controls.cpp index 98aaf0e0eee..a5214efe125 100644 --- a/src/gui/widgets/Controls.cpp +++ b/src/gui/widgets/Controls.cpp @@ -34,6 +34,8 @@ #include "Knob.h" +namespace lmms::gui +{ Control::~Control() {} @@ -138,3 +140,5 @@ LcdControl::LcdControl(int numDigits, QWidget *parent) : LcdControl::~LcdControl() {} + +} // namespace lmms::gui diff --git a/src/gui/widgets/CustomTextKnob.cpp b/src/gui/widgets/CustomTextKnob.cpp index 149b3494be6..9f6e19b90d5 100644 --- a/src/gui/widgets/CustomTextKnob.cpp +++ b/src/gui/widgets/CustomTextKnob.cpp @@ -1,5 +1,9 @@ #include "CustomTextKnob.h" +namespace lmms::gui +{ + + CustomTextKnob::CustomTextKnob( knobTypes _knob_num, QWidget * _parent, const QString & _name, const QString & _value_text ) : Knob( _knob_num, _parent, _name ), m_value_text( _value_text ) {} @@ -12,3 +16,6 @@ QString CustomTextKnob::displayValue() const { return m_description.trimmed() + m_value_text; } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/EffectRackView.cpp b/src/gui/widgets/EffectRackView.cpp index def51123b50..f79f3aad3a6 100644 --- a/src/gui/widgets/EffectRackView.cpp +++ b/src/gui/widgets/EffectRackView.cpp @@ -34,6 +34,9 @@ #include "GroupBox.h" +namespace lmms::gui +{ + EffectRackView::EffectRackView( EffectChain* model, QWidget* parent ) : QWidget( parent ), ModelView( nullptr, this ) @@ -263,4 +266,4 @@ void EffectRackView::modelChanged() - +} // namespace lmms::gui diff --git a/src/gui/widgets/EffectView.cpp b/src/gui/widgets/EffectView.cpp index b99fdf349af..87fd61c1cf8 100644 --- a/src/gui/widgets/EffectView.cpp +++ b/src/gui/widgets/EffectView.cpp @@ -43,6 +43,9 @@ #include "ToolTip.h" +namespace lmms::gui +{ + EffectView::EffectView( Effect * _model, QWidget * _parent ) : PluginView( _model, _parent ), m_bg( embed::getIconPixmap( "effect_plugin" ) ), @@ -237,3 +240,5 @@ void EffectView::modelChanged() m_autoQuit->setModel( &effect()->m_autoQuitModel ); m_gate->setModel( &effect()->m_gateModel ); } + +} // namespace lmms::gui diff --git a/src/gui/widgets/EnvelopeAndLfoView.cpp b/src/gui/widgets/EnvelopeAndLfoView.cpp index 586d01473fc..59a5273e683 100644 --- a/src/gui/widgets/EnvelopeAndLfoView.cpp +++ b/src/gui/widgets/EnvelopeAndLfoView.cpp @@ -43,6 +43,9 @@ #include "ToolTip.h" #include "Track.h" +namespace lmms::gui +{ + extern const float SECS_PER_ENV_SEGMENT; extern const float SECS_PER_LFO_OSCILLATION; @@ -529,4 +532,4 @@ void EnvelopeAndLfoView::lfoUserWaveChanged() - +} // namespace lmms::gui diff --git a/src/gui/widgets/FadeButton.cpp b/src/gui/widgets/FadeButton.cpp index c40569c2181..d4b75cbf11a 100644 --- a/src/gui/widgets/FadeButton.cpp +++ b/src/gui/widgets/FadeButton.cpp @@ -30,6 +30,9 @@ #include "FadeButton.h" +namespace lmms::gui +{ + const float FadeDuration = 300; @@ -164,3 +167,6 @@ QColor FadeButton::fadeToColor(QColor startCol, QColor endCol, QElapsedTimer tim return col; } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/Fader.cpp b/src/gui/widgets/Fader.cpp index 17a97e8982d..b22f16dceff 100644 --- a/src/gui/widgets/Fader.cpp +++ b/src/gui/widgets/Fader.cpp @@ -57,6 +57,9 @@ #include "TextFloat.h" #include "MainWindow.h" +namespace lmms::gui +{ + TextFloat * Fader::s_textFloat = nullptr; QPixmap * Fader::s_back = nullptr; @@ -479,3 +482,6 @@ void Fader::setPeakYellow( const QColor & c ) { m_peakYellow = c; } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/widgets/FxLine.cpp b/src/gui/widgets/FxLine.cpp index 4ea927279c2..dbcfe230f69 100644 --- a/src/gui/widgets/FxLine.cpp +++ b/src/gui/widgets/FxLine.cpp @@ -35,6 +35,10 @@ #include "GuiApplication.h" #include "Song.h" +namespace lmms::gui +{ + + bool FxLine::eventFilter( QObject *dist, QEvent *event ) { // If we are in a rename, capture the enter/return events and handle them @@ -448,3 +452,6 @@ void FxLine::randomizeColor() Engine::getSong()->setModified(); update(); } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/FxLineLcdSpinBox.cpp b/src/gui/widgets/FxLineLcdSpinBox.cpp index 44515762bca..0a33d53cd97 100644 --- a/src/gui/widgets/FxLineLcdSpinBox.cpp +++ b/src/gui/widgets/FxLineLcdSpinBox.cpp @@ -29,6 +29,10 @@ #include "GuiApplication.h" #include "TrackView.h" +namespace lmms::gui +{ + + void FxLineLcdSpinBox::setTrackView(TrackView * tv) { m_tv = tv; @@ -64,3 +68,6 @@ void FxLineLcdSpinBox::contextMenuEvent(QContextMenuEvent* event) addDefaultActions(contextMenu); contextMenu->exec(QCursor::pos()); } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/Graph.cpp b/src/gui/widgets/Graph.cpp index 350b07f032b..56625968702 100644 --- a/src/gui/widgets/Graph.cpp +++ b/src/gui/widgets/Graph.cpp @@ -32,6 +32,11 @@ #include "SampleBuffer.h" #include "Oscillator.h" +namespace lmms +{ + +namespace gui +{ Graph::Graph( QWidget * _parent, graphStyle _style, int _width, int _height ) : @@ -453,8 +458,10 @@ void Graph::updateGraph() } +} // namespace gui + graphModel::graphModel( float _min, float _max, int _length, - ::Model * _parent, bool _default_constructed, float _step ) : + Model* _parent, bool _default_constructed, float _step ) : Model( _parent, tr( "Graph" ), _default_constructed ), m_samples( _length ), m_length( _length ), @@ -746,6 +753,4 @@ void graphModel::drawSampleAt( int x, float val ) } - - - +} // namespace lmms diff --git a/src/gui/widgets/GroupBox.cpp b/src/gui/widgets/GroupBox.cpp index b8378d54f70..b5187de2572 100644 --- a/src/gui/widgets/GroupBox.cpp +++ b/src/gui/widgets/GroupBox.cpp @@ -34,6 +34,9 @@ #include "gui_templates.h" +namespace lmms::gui +{ + GroupBox::GroupBox( const QString & _caption, QWidget * _parent ) : QWidget( _parent ), @@ -101,3 +104,6 @@ void GroupBox::paintEvent( QPaintEvent * pe ) p.setFont( pointSize<8>( font() ) ); p.drawText( 22, m_titleBarHeight, m_caption ); } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/InstrumentFunctionViews.cpp b/src/gui/widgets/InstrumentFunctionViews.cpp index feba2a332b9..a2ac027bb59 100644 --- a/src/gui/widgets/InstrumentFunctionViews.cpp +++ b/src/gui/widgets/InstrumentFunctionViews.cpp @@ -34,6 +34,9 @@ #include "TempoSyncKnob.h" +namespace lmms::gui +{ + InstrumentFunctionNoteStackingView::InstrumentFunctionNoteStackingView( InstrumentFunctionNoteStacking* cc, QWidget* parent ) : QWidget( parent ), ModelView( nullptr, this ), @@ -200,4 +203,4 @@ void InstrumentFunctionArpeggioView::modelChanged() - +} // namespace lmms::gui diff --git a/src/gui/widgets/InstrumentMidiIOView.cpp b/src/gui/widgets/InstrumentMidiIOView.cpp index 8c511f95a64..d70b4bcc43f 100644 --- a/src/gui/widgets/InstrumentMidiIOView.cpp +++ b/src/gui/widgets/InstrumentMidiIOView.cpp @@ -39,6 +39,9 @@ #include "InstrumentTrack.h" #include "LedCheckbox.h" +namespace lmms::gui +{ + InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : QWidget( parent ), @@ -211,3 +214,5 @@ void InstrumentMidiIOView::modelChanged() } } + +} // namespace lmms::gui diff --git a/src/gui/widgets/InstrumentMiscView.cpp b/src/gui/widgets/InstrumentMiscView.cpp index 81f77a88212..9c9509c512e 100644 --- a/src/gui/widgets/InstrumentMiscView.cpp +++ b/src/gui/widgets/InstrumentMiscView.cpp @@ -35,6 +35,10 @@ #include "LedCheckbox.h" +namespace lmms::gui +{ + + InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) : QWidget(parent) { @@ -84,3 +88,6 @@ InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) : // Fill remaining space layout->addStretch(); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/widgets/InstrumentSoundShapingView.cpp b/src/gui/widgets/InstrumentSoundShapingView.cpp index 47dc389aaa7..dd5c14a093d 100644 --- a/src/gui/widgets/InstrumentSoundShapingView.cpp +++ b/src/gui/widgets/InstrumentSoundShapingView.cpp @@ -34,6 +34,8 @@ #include "TabWidget.h" +namespace lmms::gui +{ const int TARGETS_TABWIDGET_X = 4; const int TARGETS_TABWIDGET_Y = 5; @@ -135,4 +137,5 @@ void InstrumentSoundShapingView::modelChanged() - + +} // namespace lmms::gui diff --git a/src/gui/widgets/Knob.cpp b/src/gui/widgets/Knob.cpp index 0c98734d298..89a2d3e9a54 100644 --- a/src/gui/widgets/Knob.cpp +++ b/src/gui/widgets/Knob.cpp @@ -50,6 +50,10 @@ #include "StringPairDrag.h" #include "TextFloat.h" + +namespace lmms::gui +{ + TextFloat * Knob::s_textFloat = nullptr; @@ -866,3 +870,6 @@ void convertPixmapToGrayScale(QPixmap& pixMap) } pixMap.convertFromImage(temp); } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/LadspaControlView.cpp b/src/gui/widgets/LadspaControlView.cpp index e04a5235158..1d9b149b23e 100644 --- a/src/gui/widgets/LadspaControlView.cpp +++ b/src/gui/widgets/LadspaControlView.cpp @@ -33,6 +33,9 @@ #include "ToolTip.h" +namespace lmms::gui +{ + LadspaControlView::LadspaControlView( QWidget * _parent, LadspaControl * _ctl ) : QWidget( _parent ), @@ -124,5 +127,4 @@ LadspaControlView::~LadspaControlView() - - +} // namespace lmms::gui diff --git a/src/gui/widgets/LcdFloatSpinBox.cpp b/src/gui/widgets/LcdFloatSpinBox.cpp index a28d54b9b9e..a6ce1736c52 100644 --- a/src/gui/widgets/LcdFloatSpinBox.cpp +++ b/src/gui/widgets/LcdFloatSpinBox.cpp @@ -44,6 +44,9 @@ #include "gui_templates.h" #include "MainWindow.h" +namespace lmms::gui +{ + LcdFloatSpinBox::LcdFloatSpinBox(int numWhole, int numFrac, const QString& name, QWidget* parent) : FloatModelView(new FloatModel(0, 0, 0, 0, nullptr, name, true), this), @@ -242,3 +245,6 @@ void LcdFloatSpinBox::paintEvent(QPaintEvent*) p.drawText(width() / 2 - p.fontMetrics().width(m_label) / 2, height() - 1, m_label); } } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/LcdSpinBox.cpp b/src/gui/widgets/LcdSpinBox.cpp index 630b2b8ecaa..d60ceed708b 100644 --- a/src/gui/widgets/LcdSpinBox.cpp +++ b/src/gui/widgets/LcdSpinBox.cpp @@ -37,6 +37,8 @@ #include "MainWindow.h" +namespace lmms::gui +{ LcdSpinBox::LcdSpinBox( int numDigits, QWidget* parent, const QString& name ) : LcdWidget( numDigits, parent, name ), @@ -175,3 +177,4 @@ void LcdSpinBox::enterValue() } } +} // namespace lmms::gui diff --git a/src/gui/widgets/LcdWidget.cpp b/src/gui/widgets/LcdWidget.cpp index 1fefe3dd0a4..526356036f2 100644 --- a/src/gui/widgets/LcdWidget.cpp +++ b/src/gui/widgets/LcdWidget.cpp @@ -38,7 +38,8 @@ #include "MainWindow.h" - +namespace lmms::gui +{ LcdWidget::LcdWidget(QWidget* parent, const QString& name, bool leadingZero) : LcdWidget(1, parent, name, leadingZero) @@ -294,3 +295,4 @@ void LcdWidget::initUi(const QString& name , const QString& style) updateSize(); } +} // namespace lmms::gui diff --git a/src/gui/widgets/LedCheckbox.cpp b/src/gui/widgets/LedCheckbox.cpp index 1ce64f1a85e..c02d2d21177 100644 --- a/src/gui/widgets/LedCheckbox.cpp +++ b/src/gui/widgets/LedCheckbox.cpp @@ -31,6 +31,9 @@ #include "embed.h" #include "gui_templates.h" +namespace lmms::gui +{ + static const QString names[LedCheckBox::NumColors] = { @@ -127,6 +130,4 @@ void LedCheckBox::onTextUpdated() } - - - +} // namespace lmms::gui diff --git a/src/gui/widgets/LeftRightNav.cpp b/src/gui/widgets/LeftRightNav.cpp index 2502a040585..abf2cef69fb 100644 --- a/src/gui/widgets/LeftRightNav.cpp +++ b/src/gui/widgets/LeftRightNav.cpp @@ -27,6 +27,9 @@ #include "ToolTip.h" #include "embed.h" +namespace lmms::gui +{ + LeftRightNav::LeftRightNav(QWidget *parent) : QWidget(parent), @@ -88,4 +91,6 @@ void LeftRightNav::setShortcuts(const QKeySequence &leftShortcut, const QKeySequ ToolTip::add(&m_leftBtn, tr("Previous (%1)").arg(leftShortcut.toString())); ToolTip::add(&m_rightBtn, tr("Next (%1)").arg(rightShortcut.toString())); -} \ No newline at end of file +} + +} // namespace lmms::gui diff --git a/src/gui/widgets/LinkedModelGroupViews.cpp b/src/gui/widgets/LinkedModelGroupViews.cpp index b9e007ff9d1..8ad42532ab0 100644 --- a/src/gui/widgets/LinkedModelGroupViews.cpp +++ b/src/gui/widgets/LinkedModelGroupViews.cpp @@ -29,6 +29,9 @@ #include "ControlLayout.h" #include "LinkedModelGroups.h" +namespace lmms::gui +{ + /* LinkedModelGroupViewBase @@ -171,3 +174,4 @@ void LinkedModelGroupsView::modelChanged(LinkedModelGroups *groups) } +} // namespace lmms::gui diff --git a/src/gui/widgets/MeterDialog.cpp b/src/gui/widgets/MeterDialog.cpp index b1e3ffad4d1..f3182adf81d 100644 --- a/src/gui/widgets/MeterDialog.cpp +++ b/src/gui/widgets/MeterDialog.cpp @@ -34,6 +34,9 @@ #include "LcdSpinBox.h" #include "ToolTip.h" +namespace lmms::gui +{ + MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : QWidget( _parent ), @@ -115,3 +118,5 @@ void MeterDialog::modelChanged() m_denominator->setModel( &mm->denominatorModel() ); } + +} // namespace lmms::gui diff --git a/src/gui/widgets/MicrotunerConfig.cpp b/src/gui/widgets/MicrotunerConfig.cpp index 9646e2f3a0c..ef20a96cdc4 100644 --- a/src/gui/widgets/MicrotunerConfig.cpp +++ b/src/gui/widgets/MicrotunerConfig.cpp @@ -44,6 +44,9 @@ #include "MainWindow.h" #include "Song.h" +namespace lmms::gui +{ + MicrotunerConfig::MicrotunerConfig() : QWidget(), @@ -645,3 +648,6 @@ void MicrotunerConfig::closeEvent(QCloseEvent *ce) else {hide();} ce->ignore(); } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/MidiPortMenu.cpp b/src/gui/widgets/MidiPortMenu.cpp index 1cdb43f687b..328efebd144 100644 --- a/src/gui/widgets/MidiPortMenu.cpp +++ b/src/gui/widgets/MidiPortMenu.cpp @@ -26,6 +26,8 @@ #include "MidiPortMenu.h" #include "gui_templates.h" +namespace lmms::gui +{ MidiPortMenu::MidiPortMenu( MidiPort::Modes _mode ) : @@ -99,6 +101,6 @@ void MidiPortMenu::updateMenu() } - +} // namespace lmms::gui diff --git a/src/gui/widgets/NStateButton.cpp b/src/gui/widgets/NStateButton.cpp index 44736f33c31..4b2688b2358 100644 --- a/src/gui/widgets/NStateButton.cpp +++ b/src/gui/widgets/NStateButton.cpp @@ -29,6 +29,9 @@ #include "ToolTip.h" +namespace lmms::gui +{ + NStateButton::NStateButton( QWidget * _parent ) : ToolButton( _parent ), @@ -93,3 +96,6 @@ void NStateButton::mousePressEvent( QMouseEvent * _me ) } ToolButton::mousePressEvent( _me ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/widgets/Oscilloscope.cpp b/src/gui/widgets/Oscilloscope.cpp index 2a8f04acb4b..3ed617e7f2a 100644 --- a/src/gui/widgets/Oscilloscope.cpp +++ b/src/gui/widgets/Oscilloscope.cpp @@ -37,6 +37,9 @@ #include "embed.h" #include "BufferManager.h" +namespace lmms::gui +{ + Oscilloscope::Oscilloscope( QWidget * _p ) : QWidget( _p ), @@ -205,4 +208,4 @@ QColor const & Oscilloscope::determineLineColor(float level) const } - +} // namespace lmms::gui diff --git a/src/gui/widgets/PixmapButton.cpp b/src/gui/widgets/PixmapButton.cpp index f792fcac751..6f9b9b11ad5 100644 --- a/src/gui/widgets/PixmapButton.cpp +++ b/src/gui/widgets/PixmapButton.cpp @@ -31,6 +31,8 @@ #include "MainWindow.h" #include "embed.h" +namespace lmms::gui +{ PixmapButton::PixmapButton( QWidget * _parent, const QString & _name ) : @@ -143,6 +145,4 @@ QSize PixmapButton::sizeHint() const } - - - +} // namespace lmms::gui diff --git a/src/gui/widgets/PositionLine.cpp b/src/gui/widgets/PositionLine.cpp index 978c94a96c2..1124ad6600e 100644 --- a/src/gui/widgets/PositionLine.cpp +++ b/src/gui/widgets/PositionLine.cpp @@ -30,6 +30,9 @@ #include "Song.h" +namespace lmms::gui +{ + PositionLine::PositionLine(QWidget* parent) : QWidget(parent), m_hasTailGradient(false), @@ -96,3 +99,6 @@ void PositionLine::zoomChange(float zoom) update(); } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/ProjectNotes.cpp b/src/gui/widgets/ProjectNotes.cpp index 6fac7320817..238c30dc68c 100644 --- a/src/gui/widgets/ProjectNotes.cpp +++ b/src/gui/widgets/ProjectNotes.cpp @@ -43,6 +43,9 @@ #include "Song.h" +namespace lmms::gui +{ + ProjectNotes::ProjectNotes() : QMainWindow( getGUI()->mainWindow()->workspace() ) @@ -408,3 +411,5 @@ void ProjectNotes::closeEvent( QCloseEvent * _ce ) } _ce->ignore(); } + +} // namespace lmms::gui diff --git a/src/gui/widgets/RenameDialog.cpp b/src/gui/widgets/RenameDialog.cpp index cb427b2c0d4..76ae9d6bbbc 100644 --- a/src/gui/widgets/RenameDialog.cpp +++ b/src/gui/widgets/RenameDialog.cpp @@ -28,6 +28,8 @@ #include "RenameDialog.h" +namespace lmms::gui +{ RenameDialog::RenameDialog( QString & _string ) : @@ -80,3 +82,6 @@ void RenameDialog::textChanged( const QString & _new_string ) { m_stringToEdit = _new_string; } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/widgets/Rubberband.cpp b/src/gui/widgets/Rubberband.cpp index b0bd5cc06ce..c1ef329f09d 100644 --- a/src/gui/widgets/Rubberband.cpp +++ b/src/gui/widgets/Rubberband.cpp @@ -26,6 +26,9 @@ #include "Rubberband.h" +namespace lmms::gui +{ + RubberBand::RubberBand( QWidget * _parent ) : QRubberBand( Rectangle, _parent ) @@ -90,8 +93,4 @@ QVector RubberBand::selectableObjects() const } - - - - - +} // namespace lmms::gui diff --git a/src/gui/widgets/SendButtonIndicator.cpp b/src/gui/widgets/SendButtonIndicator.cpp index f0229b6a790..c93c438ee06 100644 --- a/src/gui/widgets/SendButtonIndicator.cpp +++ b/src/gui/widgets/SendButtonIndicator.cpp @@ -2,6 +2,10 @@ #include "FxMixer.h" +namespace lmms::gui +{ + + QPixmap * SendButtonIndicator::s_qpmOff = nullptr; QPixmap * SendButtonIndicator::s_qpmOn = nullptr; @@ -59,3 +63,6 @@ void SendButtonIndicator::updateLightStatus() { setPixmap( getSendModel() == nullptr ? *s_qpmOff : *s_qpmOn ); } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/SideBar.cpp b/src/gui/widgets/SideBar.cpp index 130616e55dc..f85d62aaf69 100644 --- a/src/gui/widgets/SideBar.cpp +++ b/src/gui/widgets/SideBar.cpp @@ -30,6 +30,9 @@ #include "SideBarWidget.h" #include "ToolTip.h" +namespace lmms::gui +{ + // internal helper class allowing to create QToolButtons with // vertical orientation @@ -165,5 +168,4 @@ void SideBar::toggleButton( QAbstractButton * button ) } - - +} // namespace lmms::gui diff --git a/src/gui/widgets/SideBarWidget.cpp b/src/gui/widgets/SideBarWidget.cpp index 41647a4fd30..3689b15eba6 100644 --- a/src/gui/widgets/SideBarWidget.cpp +++ b/src/gui/widgets/SideBarWidget.cpp @@ -30,6 +30,9 @@ #include "embed.h" +namespace lmms::gui +{ + SideBarWidget::SideBarWidget( const QString & _title, const QPixmap & _icon, QWidget * _parent ) : @@ -92,6 +95,4 @@ void SideBarWidget::resizeEvent( QResizeEvent * ) } - - - +} // namespace lmms::gui diff --git a/src/gui/widgets/StepRecorderWidget.cpp b/src/gui/widgets/StepRecorderWidget.cpp index 65deb0d0a8b..e490ec49c89 100644 --- a/src/gui/widgets/StepRecorderWidget.cpp +++ b/src/gui/widgets/StepRecorderWidget.cpp @@ -24,6 +24,9 @@ #include "TextFloat.h" #include "embed.h" +namespace lmms::gui +{ + StepRecorderWidget::StepRecorderWidget( QWidget * parent, const int ppb, @@ -166,3 +169,5 @@ void StepRecorderWidget::updateBoundaries() //(no need to change top and left as they are static) } + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/widgets/TabBar.cpp b/src/gui/widgets/TabBar.cpp index d40b41d981a..f671b9544fd 100644 --- a/src/gui/widgets/TabBar.cpp +++ b/src/gui/widgets/TabBar.cpp @@ -29,6 +29,9 @@ #include "ToolTip.h" +namespace lmms::gui +{ + TabBar::TabBar( QWidget * _parent, QBoxLayout::Direction _dir ) : QWidget( _parent ), @@ -230,9 +233,4 @@ bool TabBar::allHidden() } - - - - - - +} // namespace lmms::gui diff --git a/src/gui/widgets/TabWidget.cpp b/src/gui/widgets/TabWidget.cpp index 07889c331f5..8899625fc8d 100644 --- a/src/gui/widgets/TabWidget.cpp +++ b/src/gui/widgets/TabWidget.cpp @@ -35,6 +35,9 @@ #include "embed.h" #include "gui_templates.h" +namespace lmms::gui +{ + TabWidget::TabWidget(const QString & caption, QWidget * parent, bool usePixmap, bool resizable) : QWidget( parent ), @@ -415,3 +418,6 @@ void TabWidget::setTabBorder( const QColor & c ) { m_tabBorder = c; } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/TempoSyncKnob.cpp b/src/gui/widgets/TempoSyncKnob.cpp index a141c0003c9..bb5150b2d4c 100644 --- a/src/gui/widgets/TempoSyncKnob.cpp +++ b/src/gui/widgets/TempoSyncKnob.cpp @@ -36,6 +36,10 @@ #include "Song.h" +namespace lmms::gui +{ + + TempoSyncKnob::TempoSyncKnob( knobTypes _knob_num, QWidget * _parent, const QString & _name ) : @@ -307,4 +311,4 @@ void TempoSyncKnob::showCustom() - +} // namespace lmms::gui diff --git a/src/gui/widgets/TextFloat.cpp b/src/gui/widgets/TextFloat.cpp index 5a93b55c6e7..a43c91c80c2 100644 --- a/src/gui/widgets/TextFloat.cpp +++ b/src/gui/widgets/TextFloat.cpp @@ -31,6 +31,9 @@ #include "GuiApplication.h" #include "MainWindow.h" +namespace lmms::gui +{ + TextFloat::TextFloat() : QWidget( getGUI()->mainWindow(), Qt::ToolTip ), @@ -199,4 +202,4 @@ void TextFloat::updateSize() - +} // namespace lmms::gui diff --git a/src/gui/widgets/TimeDisplayWidget.cpp b/src/gui/widgets/TimeDisplayWidget.cpp index bc5e5d6048c..78d06a4de5f 100644 --- a/src/gui/widgets/TimeDisplayWidget.cpp +++ b/src/gui/widgets/TimeDisplayWidget.cpp @@ -32,6 +32,8 @@ #include "Song.h" +namespace lmms::gui +{ TimeDisplayWidget::TimeDisplayWidget() : QWidget(), @@ -128,3 +130,5 @@ void TimeDisplayWidget::mousePressEvent( QMouseEvent* mouseEvent ) } } } + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/widgets/ToolButton.cpp b/src/gui/widgets/ToolButton.cpp index f5ef3560a68..122c0465a2c 100644 --- a/src/gui/widgets/ToolButton.cpp +++ b/src/gui/widgets/ToolButton.cpp @@ -26,6 +26,9 @@ #include "ToolButton.h" #include "ToolTip.h" +namespace lmms::gui +{ + ToolButton::ToolButton( const QPixmap & _pixmap, const QString & _tooltip, QObject * _receiver, const char * _slot, @@ -41,3 +44,6 @@ ToolButton::ToolButton( const QPixmap & _pixmap, const QString & _tooltip, ToolTip::add( this, _tooltip ); setIcon( _pixmap ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/widgets/ToolTip.cpp b/src/gui/widgets/ToolTip.cpp index 81f963edb56..335e92cf691 100644 --- a/src/gui/widgets/ToolTip.cpp +++ b/src/gui/widgets/ToolTip.cpp @@ -28,6 +28,8 @@ #include "ToolTip.h" #include "ConfigManager.h" +namespace lmms::gui +{ void ToolTip::add( QWidget * _w, const QString & _txt ) { @@ -38,3 +40,4 @@ void ToolTip::add( QWidget * _w, const QString & _txt ) } +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/widgets/TrackContentWidget.cpp b/src/gui/widgets/TrackContentWidget.cpp index 4c2c105296b..39b232d73e0 100644 --- a/src/gui/widgets/TrackContentWidget.cpp +++ b/src/gui/widgets/TrackContentWidget.cpp @@ -44,6 +44,9 @@ #include "TrackView.h" +namespace lmms::gui +{ + /*! Alternate between a darker and a lighter background color every 4 bars */ const int BARS_PER_GROUP = 4; @@ -724,3 +727,6 @@ void TrackContentWidget::setGridColor( const QBrush & c ) //! \brief CSS theming qproperty access method void TrackContentWidget::setEmbossColor( const QBrush & c ) { m_embossColor = c; } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/TrackLabelButton.cpp b/src/gui/widgets/TrackLabelButton.cpp index 361db740e63..537f6061854 100644 --- a/src/gui/widgets/TrackLabelButton.cpp +++ b/src/gui/widgets/TrackLabelButton.cpp @@ -38,7 +38,8 @@ #include "Song.h" #include "TrackRenameLineEdit.h" - +namespace lmms::gui +{ TrackLabelButton::TrackLabelButton( TrackView * _tv, QWidget * _parent ) : QToolButton( _parent ), @@ -240,3 +241,6 @@ QString TrackLabelButton::elideName( const QString &name ) QString elidedName = metrics.elidedText( name, Qt::ElideRight, maxTextWidth ); return elidedName; } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/TrackOperationsWidget.cpp b/src/gui/widgets/TrackOperationsWidget.cpp index 2f1a1aeed00..aade59636c0 100644 --- a/src/gui/widgets/TrackOperationsWidget.cpp +++ b/src/gui/widgets/TrackOperationsWidget.cpp @@ -48,6 +48,9 @@ #include "TrackContainerView.h" #include "TrackView.h" +namespace lmms::gui +{ + /*! \brief Create a new trackOperationsWidget * * The trackOperationsWidget is the grip and the mute button of a track. @@ -392,3 +395,5 @@ void TrackOperationsWidget::recordingOff() toggleRecording( false ); } + +} // namespace lmms::gui diff --git a/src/gui/widgets/TrackRenameLineEdit.cpp b/src/gui/widgets/TrackRenameLineEdit.cpp index b68af31417f..dab827ff934 100644 --- a/src/gui/widgets/TrackRenameLineEdit.cpp +++ b/src/gui/widgets/TrackRenameLineEdit.cpp @@ -30,6 +30,8 @@ #include +namespace lmms::gui +{ TrackRenameLineEdit::TrackRenameLineEdit( QWidget * parent ) : @@ -59,3 +61,6 @@ void TrackRenameLineEdit::keyPressEvent( QKeyEvent * ke ) QLineEdit::keyPressEvent( ke ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/tracks/AutomationTrack.cpp b/src/tracks/AutomationTrack.cpp index 034ad4251d0..ee548da4030 100644 --- a/src/tracks/AutomationTrack.cpp +++ b/src/tracks/AutomationTrack.cpp @@ -27,6 +27,9 @@ #include "AutomationTrackView.h" #include "AutomationPattern.h" +namespace lmms +{ + AutomationTrack::AutomationTrack( TrackContainer* tc, bool _hidden ) : Track( _hidden ? HiddenAutomationTrack : Track::AutomationTrack, tc ) @@ -43,9 +46,9 @@ bool AutomationTrack::play( const TimePos & time_start, const fpp_t _frames, -TrackView * AutomationTrack::createView( TrackContainerView* tcv ) +gui::TrackView* AutomationTrack::createView( gui::TrackContainerView* tcv ) { - return new AutomationTrackView( this, tcv ); + return new gui::AutomationTrackView( this, tcv ); } @@ -76,4 +79,6 @@ void AutomationTrack::loadTrackSpecificSettings( const QDomElement & _this ) { setMuted( false ); } -} \ No newline at end of file +} + +} // namespace lmms diff --git a/src/tracks/BBTrack.cpp b/src/tracks/BBTrack.cpp index 9df773ddc0d..ad4fd59049c 100644 --- a/src/tracks/BBTrack.cpp +++ b/src/tracks/BBTrack.cpp @@ -31,7 +31,8 @@ #include "BBTrackView.h" #include "Song.h" - +namespace lmms +{ BBTrack::infoMap BBTrack::s_infoMap; @@ -126,9 +127,9 @@ bool BBTrack::play( const TimePos & _start, const fpp_t _frames, -TrackView * BBTrack::createView( TrackContainerView* tcv ) +gui::TrackView * BBTrack::createView( gui::TrackContainerView* tcv ) { - return new BBTrackView( this, tcv ); + return new gui::BBTrackView( this, tcv ); } @@ -240,4 +241,6 @@ void BBTrack::swapBBTracks( Track * _track1, Track * _track2 ) s_infoMap[t2] ); Engine::getBBTrackContainer()->setCurrentBB( s_infoMap[t1] ); } -} \ No newline at end of file +} + +} // namespace lmms diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index d7904b38ee4..fafc1ff0d0b 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -37,6 +37,9 @@ #include "Pattern.h" #include "Song.h" +namespace lmms +{ + InstrumentTrack::InstrumentTrack( TrackContainer* tc ) : Track( Track::InstrumentTrack, tc ), @@ -688,7 +691,7 @@ bool InstrumentTrack::play( const TimePos & _start, const fpp_t _frames, const float frames_per_tick = Engine::framesPerTick(); tcoVector tcos; - ::BBTrack * bb_track = nullptr; + class BBTrack* bb_track = nullptr; if( _tco_num >= 0 ) { TrackContentObject * tco = getTCO( _tco_num ); @@ -793,9 +796,9 @@ TrackContentObject* InstrumentTrack::createTCO(const TimePos & pos) -TrackView * InstrumentTrack::createView( TrackContainerView* tcv ) +gui::TrackView* InstrumentTrack::createView( gui::TrackContainerView* tcv ) { - return new InstrumentTrackView( this, tcv ); + return new gui::InstrumentTrackView( this, tcv ); } @@ -1062,3 +1065,5 @@ void InstrumentTrack::autoAssignMidiDevice(bool assign) } } + +} // namespace lmms diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index 215fab7746e..12f7cb791a2 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -33,10 +33,14 @@ #include -QPixmap * PatternView::s_stepBtnOn0 = nullptr; -QPixmap * PatternView::s_stepBtnOn200 = nullptr; -QPixmap * PatternView::s_stepBtnOff = nullptr; -QPixmap * PatternView::s_stepBtnOffLight = nullptr; +namespace lmms +{ + + +QPixmap* gui::PatternView::s_stepBtnOn0 = nullptr; +QPixmap* gui::PatternView::s_stepBtnOn200 = nullptr; +QPixmap* gui::PatternView::s_stepBtnOff = nullptr; +QPixmap* gui::PatternView::s_stepBtnOffLight = nullptr; @@ -608,4 +612,7 @@ void Pattern::changeTimeSignature() m_steps = qMax( TimePos::stepsPerBar(), last_pos.getBar() * TimePos::stepsPerBar() ); updateLength(); -} \ No newline at end of file +} + + +} // namespace lmms \ No newline at end of file diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index ef1c8bfc4a7..c65dd092c1c 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -33,6 +33,9 @@ #include "Song.h" +namespace lmms +{ + SampleTrack::SampleTrack(TrackContainer* tc) : Track(Track::SampleTrack, tc), @@ -241,4 +244,7 @@ void SampleTrack::setPlayingTcos( bool isPlaying ) void SampleTrack::updateEffectChannel() { m_audioPort.setNextFxChannel( m_effectChannelModel.value() ); -} \ No newline at end of file +} + + +} // namespace lmms From 24c5fc7d47b47ee79b77d2a4c45b68d510038500 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 1 Oct 2021 14:24:04 +0200 Subject: [PATCH 003/118] Add #endif comments in RemotePlugin.h to ease navigation around conditional compilation macros. --- include/RemotePlugin.h | 116 ++++++++++++++++++++--------------------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/include/RemotePlugin.h b/include/RemotePlugin.h index 254eb3afa6e..1779647fe6c 100644 --- a/include/RemotePlugin.h +++ b/include/RemotePlugin.h @@ -43,11 +43,11 @@ #ifdef LMMS_HAVE_PROCESS_H #include -#endif +#endif // LMMS_HAVE_PROCESS_H #include #include -#endif +#endif // not (LMMS_HAVE_SYS_IPC_H && LMMS_HAVE_SEMAPHORE_H) #ifdef LMMS_HAVE_SYS_SHM_H @@ -55,7 +55,7 @@ #ifdef LMMS_HAVE_UNISTD_H #include -#endif +#endif // LMMS_HAVE_UNISTD_H #else #define USE_QT_SHMEM @@ -64,17 +64,17 @@ #if !defined(LMMS_HAVE_SYS_TYPES_H) || defined(LMMS_BUILD_WIN32) typedef int32_t key_t; -#endif -#endif +#endif // (not LMMS_HAVE_SYS_TYPES_H) || LMMS_BUILD_WIN32 +#endif // LMMS_HAVE_SYS_SHM_H #ifdef LMMS_HAVE_LOCALE_H #include -#endif +#endif // LMMS_HAVE_LOCALE_H #ifdef LMMS_HAVE_PTHREAD_H #include -#endif +#endif // LMMS_HAVE_PTHREAD_H #ifdef BUILD_REMOTE_PLUGIN_CLIENT @@ -85,7 +85,7 @@ typedef int32_t key_t; #ifndef SYNC_WITH_SHM_FIFO #include #include -#endif +#endif // not SYNC_WITH_SHM_FIFO #else #include "lmms_export.h" @@ -97,9 +97,9 @@ typedef int32_t key_t; #ifndef SYNC_WITH_SHM_FIFO #include #include -#endif +#endif // not SYNC_WITH_SHM_FIFO -#endif +#endif // BUILD_REMOTE_PLUGIN_CLIENT namespace lmms { @@ -141,7 +141,7 @@ class shmFifo m_shmObj(), #else m_shmID( -1 ), -#endif +#endif // USE_QT_SHMEM m_data( nullptr ), m_dataSem( QString() ), m_messageSem( QString() ), @@ -161,7 +161,7 @@ class shmFifo { } m_data = (shmData *) shmat( m_shmID, 0, 0 ); -#endif +#endif // USE_QT_SHMEM assert( m_data != nullptr ); m_data->startPtr = m_data->endPtr = 0; static int k = 0; @@ -184,7 +184,7 @@ class shmFifo m_shmObj( QString::number( _shm_key ) ), #else m_shmID( shmget( _shm_key, 0, 0 ) ), -#endif +#endif // USE_QT_SHMEM m_data( nullptr ), m_dataSem( QString() ), m_messageSem( QString() ), @@ -200,7 +200,7 @@ class shmFifo { m_data = (shmData *) shmat( m_shmID, 0, 0 ); } -#endif +#endif // USE_QT_SHMEM assert( m_data != nullptr ); m_dataSem.setKey( QString::number( m_data->dataSem.semKey ) ); m_messageSem.setKey( QString::number( @@ -214,11 +214,11 @@ class shmFifo { #ifndef USE_QT_SHMEM shmctl( m_shmID, IPC_RMID, nullptr ); -#endif +#endif // not USE_QT_SHMEM } #ifndef USE_QT_SHMEM shmdt( m_data ); -#endif +#endif // not USE_QT_SHMEM } inline bool isInvalid() const @@ -355,7 +355,7 @@ class shmFifo unlock(); #ifndef LMMS_BUILD_WIN32 usleep( 5 ); -#endif +#endif // not LMMS_BUILD_WIN32 lock(); } fastMemCpy( _buf, m_data->data + m_data->startPtr, _len ); @@ -391,7 +391,7 @@ class shmFifo unlock(); #ifndef LMMS_BUILD_WIN32 usleep( 5 ); -#endif +#endif // not LMMS_BUILD_WIN32 lock(); } fastMemCpy( m_data->data + m_data->endPtr, _buf, _len ); @@ -406,14 +406,14 @@ class shmFifo QSharedMemory m_shmObj; #else int m_shmID; -#endif +#endif // USE_QT_SHMEM shmData * m_data; QSystemSemaphore m_dataSem; QSystemSemaphore m_messageSem; std::atomic_int m_lockDepth; } ; -#endif +#endif // SYNC_WITH_SHM_FIFO @@ -504,7 +504,7 @@ class LMMS_EXPORT RemotePluginBase { return QString::fromStdString( getString( _p ) ); } -#endif +#endif // BUILD_REMOTE_PLUGIN_CLIENT inline int getInt( int _p = 0 ) const { @@ -534,7 +534,7 @@ class LMMS_EXPORT RemotePluginBase RemotePluginBase( shmFifo * _in, shmFifo * _out ); #else RemotePluginBase(); -#endif +#endif // SYNC_WITH_SHM_FIFO virtual ~RemotePluginBase(); #ifdef SYNC_WITH_SHM_FIFO @@ -545,7 +545,7 @@ class LMMS_EXPORT RemotePluginBase m_in = in; m_out = out; } -#endif +#endif // SYNC_WITH_SHM_FIFO int sendMessage( const message & _m ); message receiveMessage(); @@ -556,7 +556,7 @@ class LMMS_EXPORT RemotePluginBase return m_in->isInvalid() || m_out->isInvalid(); #else return m_invalid; -#endif +#endif // SYNC_WITH_SHM_FIFO } message waitForMessage( const message & _m, @@ -604,7 +604,7 @@ class LMMS_EXPORT RemotePluginBase writeInt( len ); write( _s.c_str(), len ); } -#endif +#endif // not SYNC_WITH_SHM_FIFO #ifndef BUILD_REMOTE_PLUGIN_CLIENT inline bool messagesLeft() @@ -621,7 +621,7 @@ class LMMS_EXPORT RemotePluginBase qWarning( "Unexpected poll error." ); } return pollin.revents & POLLIN; -#endif +#endif // SYNC_WITH_SHM_FIFO } inline void fetchAndProcessAllMessages() @@ -636,7 +636,7 @@ class LMMS_EXPORT RemotePluginBase { return waitDepthCounter() > 0; } -#endif +#endif // not BUILD_REMOTE_PLUGIN_CLIENT virtual bool processMessage( const message & _m ) = 0; @@ -652,7 +652,7 @@ class LMMS_EXPORT RemotePluginBase { return m_out; } -#endif +#endif // SYNC_WITH_SHM_FIFO inline void invalidate() { @@ -662,13 +662,13 @@ class LMMS_EXPORT RemotePluginBase m_in->messageSent(); #else m_invalid = true; -#endif +#endif // SYNC_WITH_SHM_FIFO } #ifndef SYNC_WITH_SHM_FIFO int m_socket; -#endif +#endif // not SYNC_WITH_SHM_FIFO private: @@ -678,7 +678,7 @@ class LMMS_EXPORT RemotePluginBase static int waitDepth = 0; return waitDepth; } -#endif +#endif // not BUILD_REMOTE_PLUGIN_CLIENT #ifdef SYNC_WITH_SHM_FIFO shmFifo * m_in; @@ -741,7 +741,7 @@ class LMMS_EXPORT RemotePluginBase pthread_mutex_t m_receiveMutex; pthread_mutex_t m_sendMutex; -#endif +#endif // SYNC_WITH_SHM_FIFO } ; @@ -792,7 +792,7 @@ class LMMS_EXPORT RemotePlugin : public QObject, public RemotePluginBase return true; #else return m_process.state() != QProcess::NotRunning; -#endif +#endif // DEBUG_REMOTE_PLUGIN } bool init( const QString &pluginExecutable, bool waitForInitDoneMsg, QStringList extraArgs = {} ); @@ -882,7 +882,7 @@ public slots: QSharedMemory m_shmObj; #else int m_shmID; -#endif +#endif // USE_QT_SHMEM size_t m_shmSize; float * m_shm; @@ -892,7 +892,7 @@ public slots: #ifndef SYNC_WITH_SHM_FIFO int m_server; QString m_socketFile; -#endif +#endif // not SYNC_WITH_SHM_FIFO friend class ProcessWatcher; @@ -902,7 +902,7 @@ private slots: void processErrored(QProcess::ProcessError err ); } ; -#endif +#endif // not BUILD_REMOTE_PLUGIN_CLIENT #ifdef BUILD_REMOTE_PLUGIN_CLIENT @@ -914,11 +914,11 @@ class RemotePluginClient : public RemotePluginBase RemotePluginClient( key_t _shm_in, key_t _shm_out ); #else RemotePluginClient( const char * socketPath ); -#endif +#endif // SYNC_WITH_SHM_FIFO virtual ~RemotePluginClient(); #ifdef USE_QT_SHMEM VstSyncData * getQtVSTshm(); -#endif +#endif // USE_QT_SHMEM virtual bool processMessage( const message & _m ); virtual void process( const sampleFrame * _in_buf, @@ -1007,7 +1007,7 @@ class RemotePluginClient : public RemotePluginBase } ; -#endif +#endif // BUILD_REMOTE_PLUGIN_CLIENT @@ -1017,7 +1017,7 @@ class RemotePluginClient : public RemotePluginBase #ifndef BUILD_REMOTE_PLUGIN_CLIENT #include -#endif +#endif // not BUILD_REMOTE_PLUGIN_CLIENT #ifdef SYNC_WITH_SHM_FIFO @@ -1028,17 +1028,17 @@ RemotePluginBase::RemotePluginBase( shmFifo * _in, shmFifo * _out ) : RemotePluginBase::RemotePluginBase() : m_socket( -1 ), m_invalid( false ) -#endif +#endif // SYNC_WITH_SHM_FIFO { #ifdef LMMS_HAVE_LOCALE_H // make sure, we're using common ways to print/scan // floats to/from strings (',' vs. '.' for decimal point etc.) setlocale( LC_NUMERIC, "C" ); -#endif +#endif // LMMS_HAVE_LOCALE_H #ifndef SYNC_WITH_SHM_FIFO pthread_mutex_init( &m_receiveMutex, nullptr ); pthread_mutex_init( &m_sendMutex, nullptr ); -#endif +#endif // not SYNC_WITH_SHM_FIFO } @@ -1052,7 +1052,7 @@ RemotePluginBase::~RemotePluginBase() #else pthread_mutex_destroy( &m_receiveMutex ); pthread_mutex_destroy( &m_sendMutex ); -#endif +#endif // SYNC_WITH_SHM_FIFO } @@ -1083,7 +1083,7 @@ int RemotePluginBase::sendMessage( const message & _m ) j += 4 + _m.data[i].size(); } pthread_mutex_unlock( &m_sendMutex ); -#endif +#endif // SYNC_WITH_SHM_FIFO return j; } @@ -1114,7 +1114,7 @@ RemotePluginBase::message RemotePluginBase::receiveMessage() m.data.push_back( readString() ); } pthread_mutex_unlock( &m_receiveMutex ); -#endif +#endif // SYNC_WITH_SHM_FIFO return m; } @@ -1152,7 +1152,7 @@ RemotePluginBase::message RemotePluginBase::waitForMessage( }; WaitDepthCounter wdc( waitDepthCounter(), _busy_waiting ); -#endif +#endif // not BUILD_REMOTE_PLUGIN_CLIENT while( !isInvalid() ) { #ifndef BUILD_REMOTE_PLUGIN_CLIENT @@ -1162,7 +1162,7 @@ RemotePluginBase::message RemotePluginBase::waitForMessage( QEventLoop::ExcludeUserInputEvents, 50 ); continue; } -#endif +#endif // not BUILD_REMOTE_PLUGIN_CLIENT message m = receiveMessage(); processMessage( m ); if( m.id == _wm.id ) @@ -1179,7 +1179,7 @@ RemotePluginBase::message RemotePluginBase::waitForMessage( } -#endif +#endif // COMPILE_REMOTE_PLUGIN_BASE @@ -1198,7 +1198,7 @@ RemotePluginClient::RemotePluginClient( const char * socketPath ) : #ifdef USE_QT_SHMEM m_shmObj(), m_shmQtID( "/usr/bin/lmms" ), -#endif +#endif // USE_QT_SHMEM m_vstSyncData( nullptr ), m_shm( nullptr ), m_inputCount( 0 ), @@ -1228,7 +1228,7 @@ RemotePluginClient::RemotePluginClient( const char * socketPath ) : { fprintf( stderr, "Could not connect to local server.\n" ); } -#endif +#endif // not SYNC_WITH_SHM_FIFO #ifdef USE_QT_SHMEM if( m_shmQtID.attach( QSharedMemory::ReadOnly ) ) @@ -1275,7 +1275,7 @@ RemotePluginClient::RemotePluginClient( const char * socketPath ) : } } } -#endif +#endif // USE_QT_SHMEM // if attaching shared memory fails sendMessage( IdSampleRateInformation ); @@ -1295,19 +1295,19 @@ RemotePluginClient::~RemotePluginClient() { #ifdef USE_QT_SHMEM m_shmQtID.detach(); -#endif +#endif // USE_QT_SHMEM sendMessage( IdQuit ); #ifndef USE_QT_SHMEM shmdt( m_shm ); -#endif +#endif // not USE_QT_SHMEM #ifndef SYNC_WITH_SHM_FIFO if ( close( m_socket ) == -1) { fprintf( stderr, "Error freeing resources.\n" ); } -#endif +#endif // not SYNC_WITH_SHM_FIFO } @@ -1317,7 +1317,7 @@ VstSyncData * RemotePluginClient::getQtVSTshm() { return m_vstSyncData; } -#endif +#endif // USE_QT_SHMEM @@ -1426,7 +1426,7 @@ void RemotePluginClient::setShmKey( key_t _key, int _size ) { m_shm = (float *) shmat( shm_id, 0, 0 ); } -#endif +#endif // USE_QT_SHMEM } @@ -1461,4 +1461,4 @@ LMMS_EXPORT inline std::string QSTR_TO_STDSTR(QString const& qstr) } // namespace lmms -#endif +#endif // REMOTE_PLUGIN_H From 885bdd3ada5e5d3584702848ca62b5f564c14d71 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 1 Oct 2021 14:39:19 +0200 Subject: [PATCH 004/118] RemotePlugin.h: Move conditional #include directive to the top --- include/RemotePlugin.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include/RemotePlugin.h b/include/RemotePlugin.h index 1779647fe6c..134fdb16ed5 100644 --- a/include/RemotePlugin.h +++ b/include/RemotePlugin.h @@ -101,6 +101,10 @@ typedef int32_t key_t; #endif // BUILD_REMOTE_PLUGIN_CLIENT +#if defined(COMPILE_REMOTE_PLUGIN_BASE) && !defined(BUILD_REMOTE_PLUGIN_CLIENT) +#include +#endif // COMPILE_REMOTE_PLUGIN_BASE && not BUILD_REMOTE_PLUGIN_CLIENT + namespace lmms { @@ -1015,11 +1019,6 @@ class RemotePluginClient : public RemotePluginBase #ifdef COMPILE_REMOTE_PLUGIN_BASE -#ifndef BUILD_REMOTE_PLUGIN_CLIENT -#include -#endif // not BUILD_REMOTE_PLUGIN_CLIENT - - #ifdef SYNC_WITH_SHM_FIFO RemotePluginBase::RemotePluginBase( shmFifo * _in, shmFifo * _out ) : m_in( _in ), From 7f5507187008281b45f4f2a24cd8ac0e8db62767 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 1 Oct 2021 14:40:12 +0200 Subject: [PATCH 005/118] PluginIssue: Move debug output operator into the lmms namespace. --- include/PluginIssue.h | 5 ++--- src/core/PluginIssue.cpp | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/PluginIssue.h b/include/PluginIssue.h index 6e034724cde..b7a3aaebe3c 100644 --- a/include/PluginIssue.h +++ b/include/PluginIssue.h @@ -78,13 +78,12 @@ class PluginIssue PluginIssueType type() const { return m_issueType; } bool operator==(const PluginIssue& other) const; bool operator<(const PluginIssue& other) const; - friend QDebug operator<<(QDebug stream, const PluginIssue& iss); + friend QDebug (operator<<)(QDebug stream, const PluginIssue& iss); }; +QDebug operator<<(QDebug stream, const lmms::PluginIssue& iss); } // namespace lmms -QDebug operator<<(QDebug stream, const lmms::PluginIssue& iss); - #endif // PLUGINISSUE_H diff --git a/src/core/PluginIssue.cpp b/src/core/PluginIssue.cpp index 532fca6565b..a64c3c485f1 100644 --- a/src/core/PluginIssue.cpp +++ b/src/core/PluginIssue.cpp @@ -95,9 +95,6 @@ bool PluginIssue::operator<(const PluginIssue &other) const } -} // namespace lmms - - QDebug operator<<(QDebug stream, const lmms::PluginIssue &iss) { stream << lmms::PluginIssue::msgFor(iss.m_issueType); @@ -108,4 +105,7 @@ QDebug operator<<(QDebug stream, const lmms::PluginIssue &iss) return stream; } +} // namespace lmms + + From 59cabc137cb2ef2845aaf5b66811e589fb6860d0 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 1 Oct 2021 14:48:09 +0200 Subject: [PATCH 006/118] Plugin.cpp: Move #include directive to the top. --- src/core/Plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Plugin.cpp b/src/core/Plugin.cpp index 85ab5d9f2b7..920f6397b17 100644 --- a/src/core/Plugin.cpp +++ b/src/core/Plugin.cpp @@ -36,6 +36,7 @@ #include "DummyPlugin.h" #include "AutomatableModel.h" #include "Song.h" +#include "PluginFactory.h" namespace lmms { @@ -187,7 +188,6 @@ AutomatableModel * Plugin::childModel( const QString & ) -#include "PluginFactory.h" Plugin * Plugin::instantiateWithKey(const QString& pluginName, Model * parent, const Descriptor::SubPluginFeatures::Key *key, bool keyFromDnd) From bae7cd7c5aad4d39f9ab8e784fcf47600e9605ea Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 1 Oct 2021 14:57:26 +0200 Subject: [PATCH 007/118] Track.cpp: Add 'class' keyword to differentiate between type names and enum value names. --- src/core/Track.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 0b5019804cd..e86983e6069 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -114,14 +114,14 @@ Track * Track::create( TrackTypes tt, TrackContainer * tc ) switch( tt ) { - case InstrumentTrack: t = new ::InstrumentTrack( tc ); break; - case BBTrack: t = new ::BBTrack( tc ); break; - case SampleTrack: t = new ::SampleTrack( tc ); break; + case InstrumentTrack: t = new class InstrumentTrack( tc ); break; + case BBTrack: t = new class BBTrack( tc ); break; + case SampleTrack: t = new class SampleTrack( tc ); break; // case EVENT_TRACK: // case VIDEO_TRACK: - case AutomationTrack: t = new ::AutomationTrack( tc ); break; + case AutomationTrack: t = new class AutomationTrack( tc ); break; case HiddenAutomationTrack: - t = new ::AutomationTrack( tc, true ); break; + t = new class AutomationTrack( tc, true ); break; default: break; } From a73856a1938a36db420127def2f9484ba720d34a Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 1 Oct 2021 14:57:58 +0200 Subject: [PATCH 008/118] AudioPortAudio.h: Move #include directives and macro handling to the top. --- include/AudioPortAudio.h | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index ef7f4e6f5ae..941e89f025b 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -30,6 +30,21 @@ #include "lmmsconfig.h" #include "ComboBoxModel.h" +#ifdef LMMS_HAVE_PORTAUDIO + +#include + +#include + +#include "AudioDevice.h" +#include "AudioDeviceSetupWidget.h" + +#if defined paNeverDropInput || defined paNonInterleaved +# define PORTAUDIO_V19 +#else +# define PORTAUDIO_V18 +#endif + namespace lmms { @@ -47,21 +62,6 @@ public slots: } ; -#ifdef LMMS_HAVE_PORTAUDIO - -#include - -#include - -#include "AudioDevice.h" -#include "AudioDeviceSetupWidget.h" - -#if defined paNeverDropInput || defined paNonInterleaved -# define PORTAUDIO_V19 -#else -# define PORTAUDIO_V18 -#endif - namespace gui { class ComboBox; @@ -155,6 +155,7 @@ class AudioPortAudio : public AudioDevice } ; + } // namespace lmms #endif From 6383727e09eff6d1c65ee55ba94d46cce3d49bd6 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 1 Oct 2021 15:02:21 +0200 Subject: [PATCH 009/118] SampleTrack: add gui:: prefixes where required and add 'class' keyword for type name / enum value name differentiation. --- include/SampleTrack.h | 2 +- src/tracks/SampleTrack.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/SampleTrack.h b/include/SampleTrack.h index 738eae7eb07..81c3df38efd 100644 --- a/include/SampleTrack.h +++ b/include/SampleTrack.h @@ -48,7 +48,7 @@ class SampleTrack : public Track virtual bool play( const TimePos & _start, const fpp_t _frames, const f_cnt_t _frame_base, int _tco_num = -1 ) override; - TrackView * createView( TrackContainerView* tcv ) override; + gui::TrackView * createView( gui::TrackContainerView* tcv ) override; TrackContentObject* createTCO(const TimePos & pos) override; diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index c65dd092c1c..c27885323cc 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -70,7 +70,7 @@ bool SampleTrack::play( const TimePos & _start, const fpp_t _frames, bool played_a_note = false; // will be return variable tcoVector tcos; - ::BBTrack * bb_track = nullptr; + class BBTrack* bb_track = nullptr; if( _tco_num >= 0 ) { if (_start > getTCO(_tco_num)->length()) @@ -162,9 +162,9 @@ bool SampleTrack::play( const TimePos & _start, const fpp_t _frames, -TrackView * SampleTrack::createView( TrackContainerView* tcv ) +gui::TrackView * SampleTrack::createView( gui::TrackContainerView* tcv ) { - return new SampleTrackView( this, tcv ); + return new gui::SampleTrackView( this, tcv ); } From fdc7cfb64a378e743df5ef4ff4c1fe12cab3c01d Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 1 Oct 2021 15:14:35 +0200 Subject: [PATCH 010/118] AudioEngine.h: Remove redundant #include directive. --- include/AudioEngine.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/include/AudioEngine.h b/include/AudioEngine.h index efeb4fb970c..d26ce08f656 100644 --- a/include/AudioEngine.h +++ b/include/AudioEngine.h @@ -46,6 +46,7 @@ namespace lmms class AudioDevice; class MidiClient; class AudioPort; +class AudioEngineWorkerThread; const fpp_t MINIMUM_BUFFER_SIZE = 32; @@ -59,10 +60,6 @@ const int BYTES_PER_SURROUND_FRAME = sizeof( surroundSampleFrame ); const float OUTPUT_SAMPLE_MULTIPLIER = 32767.0f; -#include "PlayHandle.h" - - -class AudioEngineWorkerThread; class LMMS_EXPORT AudioEngine : public QObject From 07aa7ca85dba16fd1905a346c175806128c02663 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 1 Oct 2021 15:29:12 +0200 Subject: [PATCH 011/118] Add predeclarations, #includes and gui::prefixes in some places that were missing them. --- include/AutomationPattern.h | 7 ++++++- include/LinkedModelGroups.h | 3 +++ include/Lv2Ports.h | 2 +- include/MidiController.h | 7 ++++++- include/MidiPort.h | 6 ++++-- include/Pattern.h | 8 +++++++- include/SampleTCO.h | 2 +- .../peak_controller_effect_control_dialog.cpp | 4 ++++ .../peak_controller_effect_control_dialog.h | 9 +++++++++ .../peak_controller_effect_controls.h | 7 ++++--- src/core/LinkedModelGroups.cpp | 2 -- src/core/SampleBuffer.cpp | 4 ++-- src/core/SampleTCO.cpp | 6 +++--- src/core/TrackContainer.cpp | 2 +- src/core/TrackContentObject.cpp | 2 +- src/core/audio/AudioFileDevice.cpp | 2 ++ src/core/audio/AudioPortAudio.cpp | 2 ++ src/gui/AutomatableModelView.cpp | 6 +++--- src/tracks/Pattern.cpp | 4 ++-- 19 files changed, 61 insertions(+), 24 deletions(-) diff --git a/include/AutomationPattern.h b/include/AutomationPattern.h index bca0701089a..5c0e9b4e8c2 100644 --- a/include/AutomationPattern.h +++ b/include/AutomationPattern.h @@ -40,6 +40,11 @@ namespace lmms class AutomationTrack; class TimePos; +namespace gui +{ +class AutomationPatternView; +} // namespace gui + class LMMS_EXPORT AutomationPattern : public TrackContentObject @@ -207,7 +212,7 @@ public slots: static const float DEFAULT_MIN_VALUE; static const float DEFAULT_MAX_VALUE; - friend class AutomationPatternView; + friend class gui::AutomationPatternView; friend class AutomationNode; } ; diff --git a/include/LinkedModelGroups.h b/include/LinkedModelGroups.h index 4f780cc6103..378836afa98 100644 --- a/include/LinkedModelGroups.h +++ b/include/LinkedModelGroups.h @@ -30,6 +30,9 @@ #include #include +#include +#include + #include "Model.h" diff --git a/include/Lv2Ports.h b/include/Lv2Ports.h index fbb917d6337..22a051a21b4 100644 --- a/include/Lv2Ports.h +++ b/include/Lv2Ports.h @@ -205,7 +205,7 @@ struct Audio : public VisitablePort bool m_sidechain; // the only case when data of m_buffer may be referenced: - friend struct ::ConnectPortVisitor; + friend struct lmms::ConnectPortVisitor; }; struct AtomSeq : public VisitablePort diff --git a/include/MidiController.h b/include/MidiController.h index 6d0f3d805c2..533f8ff032b 100644 --- a/include/MidiController.h +++ b/include/MidiController.h @@ -38,6 +38,11 @@ namespace lmms class MidiPort; +namespace gui +{ +class ControllerConnectionDialog; +} + class MidiController : public Controller, public MidiEventProcessor { @@ -79,7 +84,7 @@ public slots: float m_lastValue; float m_previousValue; - friend class ControllerConnectionDialog; + friend class gui::ControllerConnectionDialog; friend class AutoDetectMidiController; } ; diff --git a/include/MidiPort.h b/include/MidiPort.h index 9782f3fb6b2..980980597f6 100644 --- a/include/MidiPort.h +++ b/include/MidiPort.h @@ -45,6 +45,8 @@ namespace gui { class MidiPortMenu; +class ControllerConnectionDialog; +class InstrumentMidiIOView; } @@ -173,8 +175,8 @@ private slots: Map m_writablePorts; - friend class ControllerConnectionDialog; - friend class InstrumentMidiIOView; + friend class gui::ControllerConnectionDialog; + friend class gui::InstrumentMidiIOView; signals: diff --git a/include/Pattern.h b/include/Pattern.h index bade1446a2f..edc29cd3e40 100644 --- a/include/Pattern.h +++ b/include/Pattern.h @@ -39,6 +39,12 @@ namespace lmms class InstrumentTrack; +namespace gui +{ +class PatternView; +class BBTrackContainerView; +} + class LMMS_EXPORT Pattern : public TrackContentObject { @@ -106,7 +112,7 @@ class LMMS_EXPORT Pattern : public TrackContentObject bool empty(); - TrackContentObjectView * createView( TrackView * _tv ) override; + gui::TrackContentObjectView * createView( gui::TrackView * _tv ) override; using Model::dataChanged; diff --git a/include/SampleTCO.h b/include/SampleTCO.h index f4abce309ad..7824345b017 100644 --- a/include/SampleTCO.h +++ b/include/SampleTCO.h @@ -62,7 +62,7 @@ class SampleTCO : public TrackContentObject TimePos sampleLength() const; void setSampleStartFrame( f_cnt_t startFrame ); void setSamplePlayLength( f_cnt_t length ); - TrackContentObjectView * createView( TrackView * _tv ) override; + gui::TrackContentObjectView* createView( gui::TrackView* _tv ) override; bool isPlaying() const; diff --git a/plugins/peak_controller_effect/peak_controller_effect_control_dialog.cpp b/plugins/peak_controller_effect/peak_controller_effect_control_dialog.cpp index 88538b813f2..2e261a364e3 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_control_dialog.cpp +++ b/plugins/peak_controller_effect/peak_controller_effect_control_dialog.cpp @@ -34,6 +34,8 @@ #include "LedCheckbox.h" #include "embed.h" +namespace lmms::gui +{ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog( PeakControllerEffectControls * _controls ) : @@ -103,3 +105,5 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog( setLayout( mainLayout ); } + +} // namespace lmms::gui diff --git a/plugins/peak_controller_effect/peak_controller_effect_control_dialog.h b/plugins/peak_controller_effect/peak_controller_effect_control_dialog.h index cd6a99d2b37..7211679759e 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_control_dialog.h +++ b/plugins/peak_controller_effect/peak_controller_effect_control_dialog.h @@ -28,7 +28,13 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class PeakControllerEffectControls; + +namespace gui +{ class Knob; class LedCheckBox; @@ -57,5 +63,8 @@ class PeakControllerEffectControlDialog : public EffectControlDialog } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/peak_controller_effect/peak_controller_effect_controls.h b/plugins/peak_controller_effect/peak_controller_effect_controls.h index 8375cf8d543..574fb622c5f 100644 --- a/plugins/peak_controller_effect/peak_controller_effect_controls.h +++ b/plugins/peak_controller_effect/peak_controller_effect_controls.h @@ -36,6 +36,7 @@ namespace lmms class PeakControllerEffect; + class PeakControllerEffectControls : public EffectControls { Q_OBJECT @@ -56,9 +57,9 @@ class PeakControllerEffectControls : public EffectControls { return 1; } - EffectControlDialog * createView() override + gui::EffectControlDialog * createView() override { - return new PeakControllerEffectControlDialog( this ); + return new gui::PeakControllerEffectControlDialog( this ); } @@ -74,7 +75,7 @@ class PeakControllerEffectControls : public EffectControls BoolModel m_absModel; FloatModel m_amountMultModel; - friend class PeakControllerEffectControlDialog; + friend class gui::PeakControllerEffectControlDialog; friend class PeakControllerEffect; } ; diff --git a/src/core/LinkedModelGroups.cpp b/src/core/LinkedModelGroups.cpp index 11d740bd1a7..0cbaedb33b4 100644 --- a/src/core/LinkedModelGroups.cpp +++ b/src/core/LinkedModelGroups.cpp @@ -24,8 +24,6 @@ #include "LinkedModelGroups.h" -#include -#include #include "AutomatableModel.h" diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index 3d550ece869..70ef2ea1119 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -1124,7 +1124,7 @@ void SampleBuffer::visualize( QString SampleBuffer::openAudioFile() const { - FileDialog ofd(nullptr, tr("Open audio file")); + gui::FileDialog ofd(nullptr, tr("Open audio file")); QString dir; if (!m_audioFile.isEmpty()) @@ -1147,7 +1147,7 @@ QString SampleBuffer::openAudioFile() const } // change dir to position of previously opened file ofd.setDirectory(dir); - ofd.setFileMode(FileDialog::ExistingFiles); + ofd.setFileMode(gui::FileDialog::ExistingFiles); // set filters QStringList types; diff --git a/src/core/SampleTCO.cpp b/src/core/SampleTCO.cpp index 0dd94fd59de..8f4124695d7 100644 --- a/src/core/SampleTCO.cpp +++ b/src/core/SampleTCO.cpp @@ -51,7 +51,7 @@ SampleTCO::SampleTCO( Track * _track ) : this, SLOT( updateLength() ) ); //care about positionmarker - TimeLineWidget * timeLine = Engine::getSong()->getPlayPos( Engine::getSong()->Mode_PlaySong ).m_timeLine; + gui::TimeLineWidget* timeLine = Engine::getSong()->getPlayPos( Engine::getSong()->Mode_PlaySong ).m_timeLine; if( timeLine ) { connect( timeLine, SIGNAL( positionMarkerMoved() ), this, SLOT( playbackPositionChanged() ) ); @@ -319,9 +319,9 @@ void SampleTCO::loadSettings( const QDomElement & _this ) -TrackContentObjectView * SampleTCO::createView( TrackView * _tv ) +gui::TrackContentObjectView* SampleTCO::createView( gui::TrackView* _tv ) { - return new SampleTCOView( this, _tv ); + return new gui::SampleTCOView( this, _tv ); } diff --git a/src/core/TrackContainer.cpp b/src/core/TrackContainer.cpp index 5ee249dbcbd..b5496f0c15f 100644 --- a/src/core/TrackContainer.cpp +++ b/src/core/TrackContainer.cpp @@ -118,7 +118,7 @@ void TrackContainer::loadSettings( const QDomElement & _this ) { if ( getGUI() != nullptr ) { - TextFloat::displayMessage( tr( "Loading cancelled" ), + gui::TextFloat::displayMessage( tr( "Loading cancelled" ), tr( "Project loading was cancelled." ), embed::getIconPixmap( "project_file", 24, 24 ), 2000 ); diff --git a/src/core/TrackContentObject.cpp b/src/core/TrackContentObject.cpp index f8213aa5d0e..4d6a040a484 100644 --- a/src/core/TrackContentObject.cpp +++ b/src/core/TrackContentObject.cpp @@ -148,7 +148,7 @@ void TrackContentObject::copyStateTo( TrackContentObject *src, TrackContentObjec dst->movePosition( pos ); AutomationPattern::resolveAllIDs(); - GuiApplication::instance()->automationEditor()->m_editor->updateAfterPatternChange(); + getGUI()->automationEditor()->m_editor->updateAfterPatternChange(); } } diff --git a/src/core/audio/AudioFileDevice.cpp b/src/core/audio/AudioFileDevice.cpp index 485dc77b5e6..80db5897172 100644 --- a/src/core/audio/AudioFileDevice.cpp +++ b/src/core/audio/AudioFileDevice.cpp @@ -40,6 +40,8 @@ AudioFileDevice::AudioFileDevice( OutputSettings const & outputSettings, m_outputFile( _file ), m_outputSettings(outputSettings) { + using gui::ExportProjectDialog; + setSampleRate( outputSettings.getSampleRate() ); if( m_outputFile.open( QFile::WriteOnly | QFile::Truncate ) == false ) diff --git a/src/core/audio/AudioPortAudio.cpp b/src/core/audio/AudioPortAudio.cpp index 0b86bd56429..eecdf7f5ae2 100644 --- a/src/core/audio/AudioPortAudio.cpp +++ b/src/core/audio/AudioPortAudio.cpp @@ -411,6 +411,8 @@ void AudioPortAudioSetupUtil::updateChannels() AudioPortAudio::setupWidget::setupWidget( QWidget * _parent ) : AudioDeviceSetupWidget( AudioPortAudio::name(), _parent ) { + using gui::ComboBox; + m_backend = new ComboBox( this, "BACKEND" ); m_backend->setGeometry( 64, 15, 260, ComboBox::DEFAULT_HEIGHT ); diff --git a/src/gui/AutomatableModelView.cpp b/src/gui/AutomatableModelView.cpp index 9f7d1ba9418..a1f6c414250 100644 --- a/src/gui/AutomatableModelView.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -44,7 +44,7 @@ namespace lmms static float floatFromClipboard(bool* ok=nullptr); -AutomatableModelView::AutomatableModelView( ::Model* model, QWidget* _this ) : +AutomatableModelView::AutomatableModelView( Model* model, QWidget* _this ) : ModelView( model, _this ), m_conversionFactor( 1.0 ) { @@ -174,7 +174,7 @@ void AutomatableModelView::mousePressEvent( QMouseEvent* event ) { if( event->button() == Qt::LeftButton && event->modifiers() & Qt::ControlModifier ) { - new StringPairDrag( "automatable_model", QString::number( modelUntyped()->id() ), QPixmap(), widget() ); + new gui::StringPairDrag( "automatable_model", QString::number( modelUntyped()->id() ), QPixmap(), widget() ); event->accept(); } else if( event->button() == Qt::MidButton ) @@ -216,7 +216,7 @@ void AutomatableModelViewSlots::execConnectionDialog() AutomatableModel* m = m_amv->modelUntyped(); m->displayName(); - ControllerConnectionDialog d( getGUI()->mainWindow(), m ); + gui::ControllerConnectionDialog d( getGUI()->mainWindow(), m ); if( d.exec() == 1 ) { diff --git a/src/tracks/Pattern.cpp b/src/tracks/Pattern.cpp index 12f7cb791a2..50414b34174 100644 --- a/src/tracks/Pattern.cpp +++ b/src/tracks/Pattern.cpp @@ -554,9 +554,9 @@ void Pattern::removeSteps() -TrackContentObjectView * Pattern::createView( TrackView * _tv ) +gui::TrackContentObjectView * Pattern::createView( gui::TrackView * _tv ) { - return new PatternView( this, _tv ); + return new gui::PatternView( this, _tv ); } From 1657aaf991d84dd272229b3acadac17ecae37756 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 2 Oct 2021 15:16:43 +0200 Subject: [PATCH 012/118] Move QT qHash overload in PluginFactory.cpp into global namespace. --- src/core/PluginFactory.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/core/PluginFactory.cpp b/src/core/PluginFactory.cpp index 7fba4ca83f6..72e7d2aec37 100644 --- a/src/core/PluginFactory.cpp +++ b/src/core/PluginFactory.cpp @@ -35,6 +35,12 @@ #include "Plugin.h" #include "embed.h" +// QT qHash specialization, needs to be in global namespace +qint64 qHash(const QFileInfo& fi) +{ + return qHash(fi.absoluteFilePath()); +} + namespace lmms { @@ -45,11 +51,6 @@ namespace lmms QStringList nameFilters("lib*.so"); #endif -qint64 qHash(const QFileInfo& fi) -{ - return qHash(fi.absoluteFilePath()); -} - std::unique_ptr PluginFactory::s_instance; PluginFactory::PluginFactory() From 3d065e2b7d376b6d0b0fce3fb26f221577e76d4c Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 2 Oct 2021 15:36:36 +0200 Subject: [PATCH 013/118] Update RowTableView reference in EffectDialog.ui to lmms::gui::RowTableView --- src/gui/Forms/EffectSelectDialog.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/Forms/EffectSelectDialog.ui b/src/gui/Forms/EffectSelectDialog.ui index f8e7734862a..b0433e66cef 100644 --- a/src/gui/Forms/EffectSelectDialog.ui +++ b/src/gui/Forms/EffectSelectDialog.ui @@ -24,7 +24,7 @@ - + 500 From 13d7ef11cf1c414fe6f77a83a1f6a78266e49c87 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 2 Oct 2021 16:04:09 +0200 Subject: [PATCH 014/118] PianoRoll.cpp: Remove file scope 'using std::move'; std::move only used in two places, name it explicitly in those. --- src/gui/editors/PianoRoll.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index e41ba3f8dff..a539c76d909 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -76,8 +76,6 @@ namespace lmms { -using std::move; - typedef AutomationPattern::timeMap timeMap; @@ -378,12 +376,12 @@ PianoRoll::PianoRoll() : for( int i = 0; i < NUM_EVEN_LENGTHS; ++i ) { auto loader = std::make_unique( "note_" + pixmaps[i] ); - m_noteLenModel.addItem( "1/" + QString::number( 1 << i ), ::move(loader) ); + m_noteLenModel.addItem( "1/" + QString::number( 1 << i ), std::move(loader) ); } for( int i = 0; i < NUM_TRIPLET_LENGTHS; ++i ) { auto loader = std::make_unique( "note_" + pixmaps[i+NUM_EVEN_LENGTHS] ); - m_noteLenModel.addItem( "1/" + QString::number( (1 << i) * 3 ), ::move(loader) ); + m_noteLenModel.addItem( "1/" + QString::number( (1 << i) * 3 ), std::move(loader) ); } m_noteLenModel.setValue( 0 ); From 9014890ee2705eb3ae5f3e682e664b0dec86251e Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 2 Oct 2021 18:16:38 +0200 Subject: [PATCH 015/118] Add all missing predeclarations and #includes for core & gui; plugins still broken. --- include/AutomatableModelView.h | 4 ++-- include/BBTrackContainer.h | 7 ++++++- include/ControlLayout.h | 4 +++- include/Controls.h | 26 ++++++++++++++++---------- include/Effect.h | 9 ++++++++- include/EffectChain.h | 9 ++++++++- include/EnvelopeAndLfoParameters.h | 9 ++++++++- include/InstrumentFunctions.h | 2 +- include/LinkedModelGroupViews.h | 24 ++++++++++++++++++------ include/Lv2ViewBase.h | 15 ++++++++++----- include/SampleTCO.h | 9 ++++++++- include/SampleTrack.h | 12 ++++++++++-- include/Song.h | 9 ++++++--- include/TempoSyncKnobModel.h | 10 +++++++++- include/TrackContentWidget.h | 7 +++---- src/3rdparty/rpmalloc/rpmalloc | 2 +- src/core/main.cpp | 6 +++++- src/gui/AutomatableModelView.cpp | 4 ++-- src/gui/Lv2ViewBase.cpp | 1 + src/gui/widgets/Controls.cpp | 1 + src/gui/widgets/EnvelopeAndLfoView.cpp | 11 ++++++++--- 21 files changed, 134 insertions(+), 47 deletions(-) diff --git a/include/AutomatableModelView.h b/include/AutomatableModelView.h index 58ff6fdf1f3..fa8926c0c1b 100644 --- a/include/AutomatableModelView.h +++ b/include/AutomatableModelView.h @@ -32,7 +32,7 @@ class QMenu; class QMouseEvent; -namespace lmms +namespace lmms::gui { class LMMS_EXPORT AutomatableModelView : public ModelView @@ -135,7 +135,7 @@ using FloatModelView = TypedModelView; using IntModelView = TypedModelView; using BoolModelView = TypedModelView; -} // namespace lmms +} // namespace lmms::gui #endif diff --git a/include/BBTrackContainer.h b/include/BBTrackContainer.h index 0bbcb25a592..f00f17f2aba 100644 --- a/include/BBTrackContainer.h +++ b/include/BBTrackContainer.h @@ -33,6 +33,11 @@ namespace lmms { +namespace gui +{ +class BBEditor; +} // namespace gui + class LMMS_EXPORT BBTrackContainer : public TrackContainer { Q_OBJECT @@ -77,7 +82,7 @@ public slots: ComboBoxModel m_bbComboBoxModel; - friend class BBEditor; + friend class gui::BBEditor; } ; diff --git a/include/ControlLayout.h b/include/ControlLayout.h index f9974092324..8c629f8e1cd 100644 --- a/include/ControlLayout.h +++ b/include/ControlLayout.h @@ -76,9 +76,11 @@ #include #include #include + class QLayoutItem; class QRect; class QString; +class QLineEdit; namespace lmms::gui @@ -132,7 +134,7 @@ private slots: // relevant dimension is width, as later, heightForWidth() will be called // 400 looks good and is ~4 knobs in a row constexpr const static int m_minWidth = 400; - class QLineEdit* m_searchBar; + QLineEdit* m_searchBar; //! name of search bar, must be ASCII sorted before any alpha numerics static constexpr const char* s_searchBarName = "!!searchBar!!"; }; diff --git a/include/Controls.h b/include/Controls.h index 44fc29f9751..e413e0370c5 100644 --- a/include/Controls.h +++ b/include/Controls.h @@ -35,6 +35,7 @@ class QString; class QWidget; +class QLabel; namespace lmms { @@ -44,6 +45,11 @@ class AutomatableModel; namespace gui { +class AutomatableModelView; +class Knob; +class ComboBox; +class LedCheckBox; + /** These classes provide - a control with a text label @@ -59,7 +65,7 @@ class Control virtual void setModel(AutomatableModel* model) = 0; virtual AutomatableModel* model() = 0; - virtual class AutomatableModelView* modelView() = 0; + virtual AutomatableModelView* modelView() = 0; virtual ~Control(); }; @@ -67,7 +73,7 @@ class Control class KnobControl : public Control { - class Knob* m_knob; + Knob* m_knob; public: void setText(const QString& text) override; @@ -75,7 +81,7 @@ class KnobControl : public Control void setModel(AutomatableModel* model) override; FloatModel* model() override; - class AutomatableModelView* modelView() override; + AutomatableModelView* modelView() override; KnobControl(QWidget* parent = nullptr); ~KnobControl() override; @@ -85,8 +91,8 @@ class KnobControl : public Control class ComboControl : public Control { QWidget* m_widget; - class ComboBox* m_combo; - class QLabel* m_label; + ComboBox* m_combo; + QLabel* m_label; public: void setText(const QString& text) override; @@ -94,7 +100,7 @@ class ComboControl : public Control void setModel(AutomatableModel* model) override; ComboBoxModel* model() override; - class AutomatableModelView* modelView() override; + AutomatableModelView* modelView() override; ComboControl(QWidget* parent = nullptr); ~ComboControl() override; @@ -111,7 +117,7 @@ class LcdControl : public Control void setModel(AutomatableModel* model) override; IntModel* model() override; - class AutomatableModelView* modelView() override; + AutomatableModelView* modelView() override; LcdControl(int numDigits, QWidget* parent = nullptr); ~LcdControl() override; @@ -121,7 +127,7 @@ class LcdControl : public Control class CheckControl : public Control { QWidget* m_widget; - class LedCheckBox* m_checkBox; + LedCheckBox* m_checkBox; QLabel* m_label; public: @@ -129,8 +135,8 @@ class CheckControl : public Control QWidget* topWidget() override; void setModel(AutomatableModel* model) override; - BoolModel *model() override; - class AutomatableModelView* modelView() override; + BoolModel* model() override; + AutomatableModelView* modelView() override; CheckControl(QWidget* parent = nullptr); ~CheckControl() override; diff --git a/include/Effect.h b/include/Effect.h index 78fc13f8002..abd65f2070e 100644 --- a/include/Effect.h +++ b/include/Effect.h @@ -39,6 +39,13 @@ namespace lmms class EffectChain; class EffectControls; +namespace gui +{ + +class EffectView; + +} // namespace gui + class LMMS_EXPORT Effect : public Plugin { @@ -224,7 +231,7 @@ class LMMS_EXPORT Effect : public Plugin SRC_STATE * m_srcState[2]; - friend class EffectView; + friend class gui::EffectView; friend class EffectChain; } ; diff --git a/include/EffectChain.h b/include/EffectChain.h index 7e372b0d703..ca764876190 100644 --- a/include/EffectChain.h +++ b/include/EffectChain.h @@ -35,6 +35,13 @@ namespace lmms class Effect; +namespace gui +{ + +class EffectRackView; + +} // namespace gui + class LMMS_EXPORT EffectChain : public Model, public SerializingObject { @@ -68,7 +75,7 @@ class LMMS_EXPORT EffectChain : public Model, public SerializingObject BoolModel m_enabledModel; - friend class EffectRackView; + friend class gui::EffectRackView; signals: diff --git a/include/EnvelopeAndLfoParameters.h b/include/EnvelopeAndLfoParameters.h index 8d12bdcf5c1..fa44334591d 100644 --- a/include/EnvelopeAndLfoParameters.h +++ b/include/EnvelopeAndLfoParameters.h @@ -36,6 +36,13 @@ namespace lmms { +namespace gui +{ + +class EnvelopeAndLfoView; + +} + class LMMS_EXPORT EnvelopeAndLfoParameters : public Model, public JournallingObject { Q_OBJECT @@ -181,7 +188,7 @@ public slots: void updateLfoShapeData(); - friend class EnvelopeAndLfoView; + friend class gui::EnvelopeAndLfoView; } ; diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index 7390e2999d5..ef1d17902b2 100644 --- a/include/InstrumentFunctions.h +++ b/include/InstrumentFunctions.h @@ -158,7 +158,7 @@ class InstrumentFunctionNoteStacking : public Model, public JournallingObject FloatModel m_chordRangeModel; - friend class InstrumentFunctionNoteStackingView; + friend class gui::InstrumentFunctionNoteStackingView; } ; diff --git a/include/LinkedModelGroupViews.h b/include/LinkedModelGroupViews.h index a3a7986a2fd..c262e1e20ab 100644 --- a/include/LinkedModelGroupViews.h +++ b/include/LinkedModelGroupViews.h @@ -32,9 +32,19 @@ #include -namespace lmms::gui +namespace lmms { + +class LinkedModelGroup; +class LinkedModelGroups; + + +namespace gui +{ + +class Control; + /** @file LinkedModelGroupViews.h See Lv2ViewBase.h for example usage @@ -59,17 +69,17 @@ class LinkedModelGroupView : public QWidget @param colNum numbers of columns for the controls (link LEDs not counted) */ - LinkedModelGroupView(QWidget *parent, class LinkedModelGroup* model, + LinkedModelGroupView(QWidget* parent, LinkedModelGroup* model, std::size_t colNum); ~LinkedModelGroupView(); //! Reconnect models if model changed - void modelChanged(class LinkedModelGroup *linkedModelGroup); + void modelChanged(LinkedModelGroup* linkedModelGroup); protected: //! Add a control to this widget //! @warning This widget will own this control, do not free it - void addControl(class Control *ctrl, const std::string &id, + void addControl(Control* ctrl, const std::string &id, const std::string& display, bool removable); void removeControl(const QString &key); @@ -98,7 +108,7 @@ class LinkedModelGroupsView ~LinkedModelGroupsView() = default; //! Reconnect models if model changed; to be called by child virtuals - void modelChanged(class LinkedModelGroups* ctrlBase); + void modelChanged(LinkedModelGroups* ctrlBase); private: //! The base class must return the addressed group view, @@ -107,6 +117,8 @@ class LinkedModelGroupsView }; -} // namespace lmms::gui +} // namespace gui + +} // namespace lmms #endif // LINKEDMODELGROUPVIEWS_H diff --git a/include/Lv2ViewBase.h b/include/Lv2ViewBase.h index bdcf64cd182..5033f5b21ef 100644 --- a/include/Lv2ViewBase.h +++ b/include/Lv2ViewBase.h @@ -38,6 +38,9 @@ #include "Lv2Basics.h" +class QPushButton; +class QMdiSubWindow; + namespace lmms { @@ -49,6 +52,8 @@ class Lv2ControlBase; namespace gui { +class LedCheckBox; + //! View for one processor, Lv2ViewBase contains 2 of those for mono plugins class Lv2ViewProc : public LinkedModelGroupView { @@ -71,9 +76,9 @@ class LMMS_EXPORT Lv2ViewBase : public LinkedModelGroupsView ~Lv2ViewBase(); // these widgets must be connected by child widgets - class QPushButton *m_reloadPluginButton = nullptr; - class QPushButton *m_toggleUIButton = nullptr; - class QPushButton *m_helpButton = nullptr; + QPushButton* m_reloadPluginButton = nullptr; + QPushButton* m_toggleUIButton = nullptr; + QPushButton* m_helpButton = nullptr; void toggleUI(); void toggleHelp(bool visible); @@ -97,8 +102,8 @@ class LMMS_EXPORT Lv2ViewBase : public LinkedModelGroupsView //! Numbers of controls per row; must be multiple of 2 for mono effects const int m_colNum = 6; - class QMdiSubWindow* m_helpWindow = nullptr; - class LedCheckBox *m_multiChannelLink; + QMdiSubWindow* m_helpWindow = nullptr; + LedCheckBox* m_multiChannelLink; }; diff --git a/include/SampleTCO.h b/include/SampleTCO.h index 7824345b017..bd4c606e1df 100644 --- a/include/SampleTCO.h +++ b/include/SampleTCO.h @@ -32,6 +32,13 @@ namespace lmms { +namespace gui +{ + +class SampleTCOView; + +} // namespace gui + class SampleTCO : public TrackContentObject { @@ -82,7 +89,7 @@ public slots: BoolModel m_recordModel; bool m_isPlaying; - friend class SampleTCOView; + friend class gui::SampleTCOView; signals: diff --git a/include/SampleTrack.h b/include/SampleTrack.h index 81c3df38efd..16276f44301 100644 --- a/include/SampleTrack.h +++ b/include/SampleTrack.h @@ -38,6 +38,14 @@ namespace lmms { +namespace gui +{ + +class SampleTrackView; +class SampleTrackWindow; + +} // namespace gui + class SampleTrack : public Track { @@ -99,8 +107,8 @@ public slots: - friend class SampleTrackView; - friend class SampleTrackWindow; + friend class gui::SampleTrackView; + friend class gui::SampleTrackWindow; } ; diff --git a/include/Song.h b/include/Song.h index 0762c6965f3..a9dbcefce10 100644 --- a/include/Song.h +++ b/include/Song.h @@ -50,7 +50,11 @@ class Pattern; namespace gui { + class TimeLineWidget; +class SongEditor; +class ControllerRackView; + } @@ -502,9 +506,8 @@ private slots: AutomatedValueMap m_oldAutomatedValues; friend class LmmsCore; - friend class SongEditor; - friend class mainWindow; - friend class ControllerRackView; + friend class gui::SongEditor; + friend class gui::ControllerRackView; signals: void projectLoaded(); diff --git a/include/TempoSyncKnobModel.h b/include/TempoSyncKnobModel.h index 281ec55c2f1..db4b8176345 100644 --- a/include/TempoSyncKnobModel.h +++ b/include/TempoSyncKnobModel.h @@ -33,6 +33,14 @@ class QAction; namespace lmms { +namespace gui +{ + +class TempoSyncKnob; + +} // namespace gui + + class LMMS_EXPORT TempoSyncKnobModel : public FloatModel { Q_OBJECT @@ -101,7 +109,7 @@ protected slots: MeterModel m_custom; - friend class TempoSyncKnob; + friend class gui::TempoSyncKnob; } ; diff --git a/include/TrackContentWidget.h b/include/TrackContentWidget.h index eb298f8cde3..25ae757b4bb 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -37,13 +37,12 @@ namespace lmms { class Track; -class TrackContentObjectView; namespace gui { class TrackView; - +class TrackContentObjectView; class TrackContentWidget : public QWidget, public JournallingObject { @@ -62,8 +61,8 @@ class TrackContentWidget : public QWidget, public JournallingObject /*! \brief Updates the background tile pixmap. */ void updateBackground(); - void addTCOView( TrackContentObjectView * tcov ); - void removeTCOView( TrackContentObjectView * tcov ); + void addTCOView( TrackContentObjectView* tcov ); + void removeTCOView( TrackContentObjectView* tcov ); void removeTCOView( int tcoNum ) { if( tcoNum >= 0 && tcoNum < m_tcoViews.size() ) diff --git a/src/3rdparty/rpmalloc/rpmalloc b/src/3rdparty/rpmalloc/rpmalloc index 80daac0d539..30cc0c7a8c1 160000 --- a/src/3rdparty/rpmalloc/rpmalloc +++ b/src/3rdparty/rpmalloc/rpmalloc @@ -1 +1 @@ -Subproject commit 80daac0d539ab2a8edfd5ca24b1e0c77a4974bbb +Subproject commit 30cc0c7a8c1b4decdeb72d456b158f0995ca839e diff --git a/src/core/main.cpp b/src/core/main.cpp index 9912d234872..65d7b0d48de 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -125,7 +125,7 @@ void consoleMessageHandler(QtMsgType type, inline void loadTranslation( const QString & tname, - const QString & dir = ConfigManager::inst()->localeDir() ) + const QString & dir = lmms::ConfigManager::inst()->localeDir() ) { QTranslator * t = new QTranslator( QCoreApplication::instance() ); QString name = tname + ".qm"; @@ -253,6 +253,8 @@ int noInputFileError() int main( int argc, char * * argv ) { + using namespace lmms; + #ifdef LMMS_DEBUG_FPE // Enable exceptions for certain floating point results // FE_UNDERFLOW is disabled for the time being @@ -855,6 +857,8 @@ int main( int argc, char * * argv ) } else // otherwise, start the GUI { + using namespace lmms::gui; + new GuiApplication(); // re-intialize RNG - shared libraries might have srand() or diff --git a/src/gui/AutomatableModelView.cpp b/src/gui/AutomatableModelView.cpp index a1f6c414250..611c252dbbb 100644 --- a/src/gui/AutomatableModelView.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -39,7 +39,7 @@ #include "AutomationEditor.h" -namespace lmms +namespace lmms::gui { static float floatFromClipboard(bool* ok=nullptr); @@ -308,4 +308,4 @@ static float floatFromClipboard(bool* ok) } -} // namespace lmms +} // namespace lmms::gui diff --git a/src/gui/Lv2ViewBase.cpp b/src/gui/Lv2ViewBase.cpp index 1819a6a394d..79c43aff0b8 100644 --- a/src/gui/Lv2ViewBase.cpp +++ b/src/gui/Lv2ViewBase.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include "AudioEngine.h" diff --git a/src/gui/widgets/Controls.cpp b/src/gui/widgets/Controls.cpp index a5214efe125..f35ec2956d2 100644 --- a/src/gui/widgets/Controls.cpp +++ b/src/gui/widgets/Controls.cpp @@ -32,6 +32,7 @@ #include "LcdSpinBox.h" #include "LedCheckbox.h" #include "Knob.h" +#include "AutomatableModelView.h" namespace lmms::gui diff --git a/src/gui/widgets/EnvelopeAndLfoView.cpp b/src/gui/widgets/EnvelopeAndLfoView.cpp index 59a5273e683..19bb6bb9941 100644 --- a/src/gui/widgets/EnvelopeAndLfoView.cpp +++ b/src/gui/widgets/EnvelopeAndLfoView.cpp @@ -43,14 +43,17 @@ #include "ToolTip.h" #include "Track.h" -namespace lmms::gui +namespace lmms { - extern const float SECS_PER_ENV_SEGMENT; extern const float SECS_PER_LFO_OSCILLATION; +namespace gui +{ + + const int ENV_GRAPH_X = 6; const int ENV_GRAPH_Y = 6; @@ -532,4 +535,6 @@ void EnvelopeAndLfoView::lfoUserWaveChanged() -} // namespace lmms::gui +} // namespace gui + +} // namespace lmms \ No newline at end of file From 3435c676530eca51cbf6833394038fee2bf89e88 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 2 Oct 2021 18:33:28 +0200 Subject: [PATCH 016/118] Rename LmmsCore back to Engine inside namespace lmms and remove the typedef alias - to keep until we find a better name for it. --- include/AudioEngine.h | 2 +- include/ConfigManager.h | 4 ++-- include/Engine.h | 36 ++++++++++++------------------------ include/Ladspa2LMMS.h | 2 +- include/Song.h | 2 +- src/core/Engine.cpp | 36 ++++++++++++++++++------------------ 6 files changed, 35 insertions(+), 47 deletions(-) diff --git a/include/AudioEngine.h b/include/AudioEngine.h index d26ce08f656..3ad97324044 100644 --- a/include/AudioEngine.h +++ b/include/AudioEngine.h @@ -430,7 +430,7 @@ class LMMS_EXPORT AudioEngine : public QObject bool m_waitingForWrite; - friend class LmmsCore; + friend class Engine; friend class AudioEngineWorkerThread; friend class ProjectRenderer; } ; diff --git a/include/ConfigManager.h b/include/ConfigManager.h index 46413457687..bd0f8eec146 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -41,7 +41,7 @@ namespace lmms { -class LmmsCore; +class Engine; const QString PROJECTS_PATH = "projects/"; const QString TEMPLATE_PATH = "templates/"; @@ -307,7 +307,7 @@ class LMMS_EXPORT ConfigManager : public QObject settingsMap m_settings; - friend class LmmsCore; + friend class Engine; }; diff --git a/include/Engine.h b/include/Engine.h index 07994fac2f9..592aa3ceeeb 100644 --- a/include/Engine.h +++ b/include/Engine.h @@ -45,19 +45,7 @@ class Song; class Ladspa2LMMS; -// Note: This class is called 'LmmsCore' instead of 'Engine' because of naming -// conflicts caused by ZynAddSubFX. See https://github.com/LMMS/lmms/issues/2269 -// and https://github.com/LMMS/lmms/pull/2118 for more details. -// -// The workaround was to rename Lmms' Engine so that it has a different symbol -// name in the object files, but typedef it back to 'Engine' and keep it inside -// of Engine.h so that the rest of the codebase can be oblivious to this issue -// (and it could be fixed without changing every single file). - -class LmmsCore; -typedef LmmsCore Engine; - -class LMMS_EXPORT LmmsCore : public QObject +class LMMS_EXPORT Engine : public QObject { Q_OBJECT public: @@ -113,11 +101,11 @@ class LMMS_EXPORT LmmsCore : public QObject static void updateFramesPerTick(); - static inline LmmsCore * inst() + static inline Engine * inst() { if( s_instanceOfMe == nullptr ) { - s_instanceOfMe = new LmmsCore(); + s_instanceOfMe = new Engine(); } return s_instanceOfMe; } @@ -133,9 +121,9 @@ class LMMS_EXPORT LmmsCore : public QObject // small helper function which sets the pointer to NULL before actually deleting // the object it refers to template - static inline void deleteHelper( T * * ptr ) + static inline void deleteHelper(T** ptr) { - T * tmp = *ptr; + T* tmp = *ptr; *ptr = nullptr; delete tmp; } @@ -143,20 +131,20 @@ class LMMS_EXPORT LmmsCore : public QObject static float s_framesPerTick; // core - static AudioEngine *s_audioEngine; - static FxMixer * s_fxMixer; - static Song * s_song; - static BBTrackContainer * s_bbTrackContainer; - static ProjectJournal * s_projectJournal; + static AudioEngine* s_audioEngine; + static FxMixer* s_fxMixer; + static Song* s_song; + static BBTrackContainer* s_bbTrackContainer; + static ProjectJournal* s_projectJournal; #ifdef LMMS_HAVE_LV2 static class Lv2Manager* s_lv2Manager; #endif - static Ladspa2LMMS * s_ladspaManager; + static Ladspa2LMMS* s_ladspaManager; static void* s_dndPluginKey; // even though most methods are static, an instance is needed for Qt slots/signals - static LmmsCore * s_instanceOfMe; + static Engine* s_instanceOfMe; friend class GuiApplication; }; diff --git a/include/Ladspa2LMMS.h b/include/Ladspa2LMMS.h index a14d52d7b4c..63db75cd94a 100644 --- a/include/Ladspa2LMMS.h +++ b/include/Ladspa2LMMS.h @@ -76,7 +76,7 @@ class LMMS_EXPORT Ladspa2LMMS : public LadspaManager l_sortable_plugin_t m_analysisTools; l_sortable_plugin_t m_otherPlugins; - friend class LmmsCore; + friend class Engine; } ; diff --git a/include/Song.h b/include/Song.h index a9dbcefce10..9ea89e98dfc 100644 --- a/include/Song.h +++ b/include/Song.h @@ -505,7 +505,7 @@ private slots: AutomatedValueMap m_oldAutomatedValues; - friend class LmmsCore; + friend class Engine; friend class gui::SongEditor; friend class gui::ControllerRackView; diff --git a/src/core/Engine.cpp b/src/core/Engine.cpp index c09b2b66e5c..6b047596b7e 100644 --- a/src/core/Engine.cpp +++ b/src/core/Engine.cpp @@ -40,24 +40,24 @@ namespace lmms { -float LmmsCore::s_framesPerTick; -AudioEngine* LmmsCore::s_audioEngine = nullptr; -FxMixer * LmmsCore::s_fxMixer = nullptr; -BBTrackContainer * LmmsCore::s_bbTrackContainer = nullptr; -Song * LmmsCore::s_song = nullptr; -ProjectJournal * LmmsCore::s_projectJournal = nullptr; +float Engine::s_framesPerTick; +AudioEngine* Engine::s_audioEngine = nullptr; +FxMixer * Engine::s_fxMixer = nullptr; +BBTrackContainer * Engine::s_bbTrackContainer = nullptr; +Song * Engine::s_song = nullptr; +ProjectJournal * Engine::s_projectJournal = nullptr; #ifdef LMMS_HAVE_LV2 -Lv2Manager * LmmsCore::s_lv2Manager = nullptr; +Lv2Manager * Engine::s_lv2Manager = nullptr; #endif -Ladspa2LMMS * LmmsCore::s_ladspaManager = nullptr; -void* LmmsCore::s_dndPluginKey = nullptr; +Ladspa2LMMS * Engine::s_ladspaManager = nullptr; +void* Engine::s_dndPluginKey = nullptr; -void LmmsCore::init( bool renderOnly ) +void Engine::init( bool renderOnly ) { - LmmsCore *engine = inst(); + Engine *engine = inst(); emit engine->initProgress(tr("Generating wavetables")); // generate (load from file) bandlimited wavetables @@ -92,7 +92,7 @@ void LmmsCore::init( bool renderOnly ) -void LmmsCore::destroy() +void Engine::destroy() { s_projectJournal->stopAllJournalling(); s_audioEngine->stopProcessing(); @@ -126,7 +126,7 @@ void LmmsCore::destroy() -bool LmmsCore::ignorePluginBlacklist() +bool Engine::ignorePluginBlacklist() { const char* envVar = getenv("LMMS_IGNORE_BLACKLIST"); return (envVar && *envVar); @@ -135,7 +135,7 @@ bool LmmsCore::ignorePluginBlacklist() -float LmmsCore::framesPerTick(sample_rate_t sampleRate) +float Engine::framesPerTick(sample_rate_t sampleRate) { return sampleRate * 60.0f * 4 / DefaultTicksPerBar / s_song->getTempo(); @@ -144,7 +144,7 @@ float LmmsCore::framesPerTick(sample_rate_t sampleRate) -void LmmsCore::updateFramesPerTick() +void Engine::updateFramesPerTick() { s_framesPerTick = s_audioEngine->processingSampleRate() * 60.0f * 4 / DefaultTicksPerBar / s_song->getTempo(); } @@ -152,7 +152,7 @@ void LmmsCore::updateFramesPerTick() -void LmmsCore::setDndPluginKey(void *newKey) +void Engine::setDndPluginKey(void *newKey) { Q_ASSERT(static_cast(newKey)); s_dndPluginKey = newKey; @@ -161,7 +161,7 @@ void LmmsCore::setDndPluginKey(void *newKey) -void *LmmsCore::pickDndPluginKey() +void *Engine::pickDndPluginKey() { return s_dndPluginKey; } @@ -169,6 +169,6 @@ void *LmmsCore::pickDndPluginKey() -LmmsCore * LmmsCore::s_instanceOfMe = nullptr; +Engine * Engine::s_instanceOfMe = nullptr; } // namespace lmms \ No newline at end of file From 88f80797cb6448f66a0e6804424f355801fd2f97 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Wed, 6 Oct 2021 17:23:44 +0200 Subject: [PATCH 017/118] Add namespaces to Amplifier plugin. --- plugins/Amplifier/Amplifier.cpp | 4 ++++ plugins/Amplifier/Amplifier.h | 6 ++++++ plugins/Amplifier/AmplifierControlDialog.cpp | 6 ++++++ plugins/Amplifier/AmplifierControlDialog.h | 10 ++++++++++ plugins/Amplifier/AmplifierControls.cpp | 4 +++- plugins/Amplifier/AmplifierControls.h | 16 +++++++++++++--- 6 files changed, 42 insertions(+), 4 deletions(-) diff --git a/plugins/Amplifier/Amplifier.cpp b/plugins/Amplifier/Amplifier.cpp index 2dfdc9d8c80..ced43f1e263 100644 --- a/plugins/Amplifier/Amplifier.cpp +++ b/plugins/Amplifier/Amplifier.cpp @@ -28,6 +28,9 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + extern "C" { @@ -145,3 +148,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } +} // namespace lmms \ No newline at end of file diff --git a/plugins/Amplifier/Amplifier.h b/plugins/Amplifier/Amplifier.h index a5e85aa8b94..008dcc3939a 100644 --- a/plugins/Amplifier/Amplifier.h +++ b/plugins/Amplifier/Amplifier.h @@ -31,6 +31,9 @@ #include "AmplifierControls.h" #include "ValueBuffer.h" +namespace lmms +{ + class AmplifierEffect : public Effect { public: @@ -51,4 +54,7 @@ class AmplifierEffect : public Effect } ; + +} // namespace lmms + #endif diff --git a/plugins/Amplifier/AmplifierControlDialog.cpp b/plugins/Amplifier/AmplifierControlDialog.cpp index 53ab6a57651..5205e7fc1e6 100644 --- a/plugins/Amplifier/AmplifierControlDialog.cpp +++ b/plugins/Amplifier/AmplifierControlDialog.cpp @@ -30,6 +30,9 @@ #include "embed.h" +namespace lmms::gui +{ + AmplifierControlDialog::AmplifierControlDialog( AmplifierControls* controls ) : EffectControlDialog( controls ) @@ -67,3 +70,6 @@ AmplifierControlDialog::AmplifierControlDialog( AmplifierControls* controls ) : rightKnob->setLabel( tr( "RIGHT" ) ); rightKnob->setHintText( tr( "Right gain:" ) , "%" ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/Amplifier/AmplifierControlDialog.h b/plugins/Amplifier/AmplifierControlDialog.h index d0d7d0aa325..e8a544e8d42 100644 --- a/plugins/Amplifier/AmplifierControlDialog.h +++ b/plugins/Amplifier/AmplifierControlDialog.h @@ -28,10 +28,15 @@ #include "EffectControlDialog.h" +namespace lmms +{ class AmplifierControls; +namespace gui +{ + class AmplifierControlDialog : public EffectControlDialog { Q_OBJECT @@ -43,4 +48,9 @@ class AmplifierControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace plugin + #endif diff --git a/plugins/Amplifier/AmplifierControls.cpp b/plugins/Amplifier/AmplifierControls.cpp index 43b7545a3cf..57f8afde233 100644 --- a/plugins/Amplifier/AmplifierControls.cpp +++ b/plugins/Amplifier/AmplifierControls.cpp @@ -31,6 +31,8 @@ #include "Engine.h" #include "Song.h" +namespace lmms +{ AmplifierControls::AmplifierControls( AmplifierEffect* effect ) : EffectControls( effect ), @@ -77,6 +79,6 @@ void AmplifierControls::saveSettings( QDomDocument& doc, QDomElement& _this ) } - +} // namespace lmms diff --git a/plugins/Amplifier/AmplifierControls.h b/plugins/Amplifier/AmplifierControls.h index 3cf0321c5db..784272ebeef 100644 --- a/plugins/Amplifier/AmplifierControls.h +++ b/plugins/Amplifier/AmplifierControls.h @@ -30,9 +30,16 @@ #include "AmplifierControlDialog.h" #include "Knob.h" +namespace lmms +{ class AmplifierEffect; +namespace gui +{ +class AmplifierControlDialog; +} + class AmplifierControls : public EffectControls { @@ -55,9 +62,9 @@ class AmplifierControls : public EffectControls return 4; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new AmplifierControlDialog( this ); + return new gui::AmplifierControlDialog( this ); } @@ -71,9 +78,12 @@ private slots: FloatModel m_leftModel; FloatModel m_rightModel; - friend class AmplifierControlDialog; + friend class gui::AmplifierControlDialog; friend class AmplifierEffect; } ; + +} // namespace lmms + #endif From 26fa915322661ef3ade1ac1152ef69a27a802e6c Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Wed, 6 Oct 2021 17:24:25 +0200 Subject: [PATCH 018/118] Add namespaces to AudioFileProcessor plugin. --- .../audio_file_processor.cpp | 17 +++++++++-- .../audio_file_processor.h | 29 +++++++++++++++---- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/plugins/audio_file_processor/audio_file_processor.cpp b/plugins/audio_file_processor/audio_file_processor.cpp index b4f2576fd0d..dfccdd3355c 100644 --- a/plugins/audio_file_processor/audio_file_processor.cpp +++ b/plugins/audio_file_processor/audio_file_processor.cpp @@ -49,6 +49,11 @@ #include "embed.h" #include "plugin_export.h" + +namespace lmms +{ + + extern "C" { @@ -314,9 +319,9 @@ int audioFileProcessor::getBeatLen( NotePlayHandle * _n ) const -PluginView * audioFileProcessor::instantiateView( QWidget * _parent ) +gui::PluginView* audioFileProcessor::instantiateView( QWidget * _parent ) { - return new AudioFileProcessorView( this, _parent ); + return new gui::AudioFileProcessorView( this, _parent ); } @@ -444,6 +449,8 @@ void audioFileProcessor::pointChanged( void ) +namespace gui +{ QPixmap * AudioFileProcessorView::s_artwork = nullptr; @@ -1244,7 +1251,7 @@ float AudioFileProcessorWaveView::knob::getValue( const QPoint & _p ) const double dec_fact = ! m_waveView ? 1 : double( m_waveView->m_to - m_waveView->m_from ) / m_waveView->m_sampleBuffer.frames(); - const float inc = ::Knob::getValue( _p ) * dec_fact; + const float inc = Knob::getValue( _p ) * dec_fact; return inc; } @@ -1275,6 +1282,7 @@ bool AudioFileProcessorWaveView::knob::checkBound( double _v ) const } +} // namespace gui @@ -1290,3 +1298,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main(Model * model, void *) } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/audio_file_processor/audio_file_processor.h b/plugins/audio_file_processor/audio_file_processor.h index 0df7eeaf15c..336e5cd7137 100644 --- a/plugins/audio_file_processor/audio_file_processor.h +++ b/plugins/audio_file_processor/audio_file_processor.h @@ -38,6 +38,19 @@ #include "ComboBox.h" +namespace lmms +{ + +namespace gui +{ +class PluginView; +class InstrumentViewFixedSize; +class Knob; +class PixmapButton; +class ComboBox; +class AudioFileProcessorView; +} + class audioFileProcessor : public Instrument { Q_OBJECT @@ -64,7 +77,7 @@ class audioFileProcessor : public Instrument return 128; } - virtual PluginView * instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; public slots: @@ -102,16 +115,18 @@ private slots: f_cnt_t m_nextPlayStartPoint; bool m_nextPlayBackwards; - friend class AudioFileProcessorView; + friend class gui::AudioFileProcessorView; } ; +namespace gui +{ class AudioFileProcessorWaveView; -class AudioFileProcessorView : public InstrumentViewFixedSize +class AudioFileProcessorView : public gui::InstrumentViewFixedSize { Q_OBJECT public: @@ -141,7 +156,7 @@ protected slots: Knob * m_endKnob; Knob * m_loopKnob; - PixmapButton * m_openAudioFileButton; + gui::PixmapButton * m_openAudioFileButton; PixmapButton * m_reverseButton; automatableButtonGroup * m_loopGroup; PixmapButton * m_stutterButton; @@ -172,7 +187,7 @@ class AudioFileProcessorWaveView : public QWidget loop } ; - class knob : public ::Knob + class knob : public Knob { const AudioFileProcessorWaveView * m_waveView; const Knob * m_relatedKnob; @@ -180,7 +195,7 @@ class AudioFileProcessorWaveView : public QWidget public: knob( QWidget * _parent ) : - ::Knob( knobBright_26, _parent ), + Knob( knobBright_26, _parent ), m_waveView( 0 ), m_relatedKnob( 0 ) { @@ -285,6 +300,8 @@ public slots: } ; +} // namespace gui +} // namespace lmms #endif From 46f6e880964fc060f996fc43ea00d5ca311c7e14 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Wed, 6 Oct 2021 17:29:50 +0200 Subject: [PATCH 019/118] Add namespaces to BassBooster plugin. --- plugins/BassBooster/BassBooster.cpp | 6 ++++++ plugins/BassBooster/BassBooster.h | 5 +++++ plugins/BassBooster/BassBoosterControlDialog.cpp | 6 ++++++ plugins/BassBooster/BassBoosterControlDialog.h | 9 +++++++++ plugins/BassBooster/BassBoosterControls.cpp | 6 +++--- plugins/BassBooster/BassBoosterControls.h | 11 ++++++++--- 6 files changed, 37 insertions(+), 6 deletions(-) diff --git a/plugins/BassBooster/BassBooster.cpp b/plugins/BassBooster/BassBooster.cpp index f01e70720ad..b8ea271ee36 100644 --- a/plugins/BassBooster/BassBooster.cpp +++ b/plugins/BassBooster/BassBooster.cpp @@ -27,6 +27,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -155,3 +159,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } + +} // namespace lmms \ No newline at end of file diff --git a/plugins/BassBooster/BassBooster.h b/plugins/BassBooster/BassBooster.h index d3db6e2205d..9edca3b2220 100644 --- a/plugins/BassBooster/BassBooster.h +++ b/plugins/BassBooster/BassBooster.h @@ -30,6 +30,8 @@ #include "DspEffectLibrary.h" #include "BassBoosterControls.h" +namespace lmms +{ class BassBoosterEffect : public Effect { @@ -60,4 +62,7 @@ class BassBoosterEffect : public Effect } ; + +} // namespace lmms + #endif diff --git a/plugins/BassBooster/BassBoosterControlDialog.cpp b/plugins/BassBooster/BassBoosterControlDialog.cpp index 24886098918..af45df07ed8 100644 --- a/plugins/BassBooster/BassBoosterControlDialog.cpp +++ b/plugins/BassBooster/BassBoosterControlDialog.cpp @@ -29,6 +29,9 @@ #include "embed.h" +namespace lmms::gui +{ + BassBoosterControlDialog::BassBoosterControlDialog( BassBoosterControls* controls ) : EffectControlDialog( controls ) @@ -66,3 +69,6 @@ BassBoosterControlDialog::BassBoosterControlDialog( BassBoosterControls* control tl->addLayout( l ); setLayout( tl ); } + + +} // namespace lmms::gui diff --git a/plugins/BassBooster/BassBoosterControlDialog.h b/plugins/BassBooster/BassBoosterControlDialog.h index ec636e808e7..89a60fa1a7d 100644 --- a/plugins/BassBooster/BassBoosterControlDialog.h +++ b/plugins/BassBooster/BassBoosterControlDialog.h @@ -27,9 +27,13 @@ #include "EffectControlDialog.h" +namespace lmms +{ class BassBoosterControls; +namespace gui +{ class BassBoosterControlDialog : public EffectControlDialog { @@ -42,4 +46,9 @@ class BassBoosterControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/BassBooster/BassBoosterControls.cpp b/plugins/BassBooster/BassBoosterControls.cpp index 195f00801db..cda00043bc3 100644 --- a/plugins/BassBooster/BassBoosterControls.cpp +++ b/plugins/BassBooster/BassBoosterControls.cpp @@ -28,6 +28,8 @@ #include "BassBoosterControls.h" #include "BassBooster.h" +namespace lmms +{ BassBoosterControls::BassBoosterControls( BassBoosterEffect* effect ) : @@ -66,6 +68,4 @@ void BassBoosterControls::saveSettings( QDomDocument& doc, QDomElement& _this ) } - - - +} // namespace lmms diff --git a/plugins/BassBooster/BassBoosterControls.h b/plugins/BassBooster/BassBoosterControls.h index 133c1456c12..20d997f4137 100644 --- a/plugins/BassBooster/BassBoosterControls.h +++ b/plugins/BassBooster/BassBoosterControls.h @@ -29,6 +29,8 @@ #include "BassBoosterControlDialog.h" #include "Knob.h" +namespace lmms +{ class BassBoosterEffect; @@ -54,9 +56,9 @@ class BassBoosterControls : public EffectControls return 3; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new BassBoosterControlDialog( this ); + return new gui::BassBoosterControlDialog( this ); } @@ -69,8 +71,11 @@ private slots: FloatModel m_gainModel; FloatModel m_ratioModel; - friend class BassBoosterControlDialog; + friend class gui::BassBoosterControlDialog; friend class BassBoosterEffect; } ; + +} // namespace lmms + #endif From 76010d47cb984e47865e7c208f2cb8239e4b79a4 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Wed, 6 Oct 2021 17:50:06 +0200 Subject: [PATCH 020/118] Add namespaces to BitInvader plugin. --- plugins/bit_invader/bit_invader.cpp | 15 ++++++++++++--- plugins/bit_invader/bit_invader.h | 19 ++++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/plugins/bit_invader/bit_invader.cpp b/plugins/bit_invader/bit_invader.cpp index a79276f30b7..2c1aa53c4e4 100644 --- a/plugins/bit_invader/bit_invader.cpp +++ b/plugins/bit_invader/bit_invader.cpp @@ -44,6 +44,10 @@ #include "plugin_export.h" +namespace lmms +{ + + static const int wavetableSize = 200; static const float defaultNormalizationFactor = 1.0f; @@ -327,15 +331,16 @@ void bitInvader::deleteNotePluginData( NotePlayHandle * _n ) -PluginView * bitInvader::instantiateView( QWidget * _parent ) +gui::PluginView * bitInvader::instantiateView( QWidget * _parent ) { - return( new bitInvaderView( this, _parent ) ); + return( new gui::bitInvaderView( this, _parent ) ); } - +namespace gui +{ bitInvaderView::bitInvaderView( Instrument * _instrument, @@ -573,6 +578,7 @@ void bitInvaderView::normalizeToggled( bool value ) } +} // namespace gui extern "C" @@ -586,3 +592,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/bit_invader/bit_invader.h b/plugins/bit_invader/bit_invader.h index ae9c92cb264..137751d5e9d 100644 --- a/plugins/bit_invader/bit_invader.h +++ b/plugins/bit_invader/bit_invader.h @@ -35,8 +35,16 @@ #include "LedCheckbox.h" #include "MemoryManager.h" -class oscillator; +namespace lmms +{ + + +namespace gui +{ class bitInvaderView; +} + + class bSynth { @@ -84,7 +92,7 @@ class bitInvader : public Instrument return( 64 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView * instantiateView( QWidget * _parent ); protected slots: void lengthChanged(); @@ -102,10 +110,12 @@ protected slots: float m_normalizeFactor; - friend class bitInvaderView; + friend class gui::bitInvaderView; } ; +namespace gui +{ class bitInvaderView : public InstrumentViewFixedSize { @@ -152,5 +162,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms #endif From c3c840220303d6ec0046ebc4c583d1fdc1cf0dc0 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Wed, 6 Oct 2021 17:54:10 +0200 Subject: [PATCH 021/118] Add namespaces to Bitcrush plugin. --- plugins/Bitcrush/Bitcrush.cpp | 7 +++++++ plugins/Bitcrush/Bitcrush.h | 8 ++++++++ plugins/Bitcrush/BitcrushControlDialog.cpp | 7 +++++++ plugins/Bitcrush/BitcrushControlDialog.h | 12 ++++++++++++ plugins/Bitcrush/BitcrushControls.cpp | 7 +++++++ plugins/Bitcrush/BitcrushControls.h | 13 ++++++++++--- 6 files changed, 51 insertions(+), 3 deletions(-) diff --git a/plugins/Bitcrush/Bitcrush.cpp b/plugins/Bitcrush/Bitcrush.cpp index 206f6307d4f..13f8806232f 100644 --- a/plugins/Bitcrush/Bitcrush.cpp +++ b/plugins/Bitcrush/Bitcrush.cpp @@ -27,6 +27,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + const int OS_RATE = 5; const float OS_RATIO = 1.0f / OS_RATE; const float CUTOFF_RATIO = 0.353553391f; @@ -251,3 +255,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/Bitcrush/Bitcrush.h b/plugins/Bitcrush/Bitcrush.h index c80ff3bc70c..b722040df12 100644 --- a/plugins/Bitcrush/Bitcrush.h +++ b/plugins/Bitcrush/Bitcrush.h @@ -33,6 +33,11 @@ #include "lmms_math.h" #include "BasicFilters.h" + +namespace lmms +{ + + class BitcrushEffect : public Effect { public: @@ -80,4 +85,7 @@ class BitcrushEffect : public Effect friend class BitcrushControls; }; + +} // namespace lmms + #endif diff --git a/plugins/Bitcrush/BitcrushControlDialog.cpp b/plugins/Bitcrush/BitcrushControlDialog.cpp index 083a7bedb68..3ee09c780fb 100755 --- a/plugins/Bitcrush/BitcrushControlDialog.cpp +++ b/plugins/Bitcrush/BitcrushControlDialog.cpp @@ -34,6 +34,10 @@ #include "LedCheckbox.h" #include "Knob.h" +namespace lmms::gui +{ + + BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) : EffectControlDialog( controls ) { @@ -112,3 +116,6 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) : levels->setLabel( tr( "QUANT" ) ); levels->setHintText( tr( "Levels:" ) , "" ); } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/Bitcrush/BitcrushControlDialog.h b/plugins/Bitcrush/BitcrushControlDialog.h index c56b94c5ae8..49d5bce7e30 100644 --- a/plugins/Bitcrush/BitcrushControlDialog.h +++ b/plugins/Bitcrush/BitcrushControlDialog.h @@ -29,8 +29,15 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class BitcrushControls; + +namespace gui +{ + class BitcrushControlDialog : public EffectControlDialog { Q_OBJECT @@ -41,4 +48,9 @@ class BitcrushControlDialog : public EffectControlDialog } }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Bitcrush/BitcrushControls.cpp b/plugins/Bitcrush/BitcrushControls.cpp index f572b83eb06..b1235f5b2a3 100644 --- a/plugins/Bitcrush/BitcrushControls.cpp +++ b/plugins/Bitcrush/BitcrushControls.cpp @@ -30,6 +30,10 @@ #include "Bitcrush.h" #include "lmms_math.h" +namespace lmms +{ + + BitcrushControls::BitcrushControls( BitcrushEffect * eff ) : EffectControls( eff ), @@ -87,3 +91,6 @@ void BitcrushControls::sampleRateChanged() { m_effect->sampleRateChanged(); } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/Bitcrush/BitcrushControls.h b/plugins/Bitcrush/BitcrushControls.h index 02c96919699..ed69dd704c2 100644 --- a/plugins/Bitcrush/BitcrushControls.h +++ b/plugins/Bitcrush/BitcrushControls.h @@ -29,6 +29,10 @@ #include "EffectControls.h" #include "BitcrushControlDialog.h" +namespace lmms +{ + + class BitcrushEffect; class BitcrushControls : public EffectControls @@ -50,9 +54,9 @@ class BitcrushControls : public EffectControls return( 9 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog * createView() { - return( new BitcrushControlDialog( this ) ); + return( new gui::BitcrushControlDialog( this ) ); } private slots: @@ -75,8 +79,11 @@ private slots: BoolModel m_rateEnabled; BoolModel m_depthEnabled; - friend class BitcrushControlDialog; + friend class gui::BitcrushControlDialog; friend class BitcrushEffect; }; + +} // namespace lmms + #endif From b103ba947dc6b6e7655bb828e5716bf1a702c431 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Wed, 6 Oct 2021 18:05:13 +0200 Subject: [PATCH 022/118] Add namespaces to Carla plugins. --- plugins/carlabase/carla.cpp | 16 ++- plugins/carlabase/carla.h | 128 +++++++++++++----------- plugins/carlapatchbay/carlapatchbay.cpp | 7 ++ plugins/carlarack/carlarack.cpp | 7 ++ 4 files changed, 100 insertions(+), 58 deletions(-) diff --git a/plugins/carlabase/carla.cpp b/plugins/carlabase/carla.cpp index 01cbb8454ad..02f33e49916 100644 --- a/plugins/carlabase/carla.cpp +++ b/plugins/carlabase/carla.cpp @@ -56,6 +56,9 @@ #include "embed.h" +namespace lmms +{ + // this doesn't seem to be defined anywhere static const double ticksPerBeat = 48.0; @@ -143,6 +146,7 @@ static const char* host_ui_save_file(NativeHostHandle, bool isDir, const char* t // ----------------------------------------------------------------------- + CarlaInstrument::CarlaInstrument(InstrumentTrack* const instrumentTrack, const Descriptor* const descriptor, const bool isPatchbay) : Instrument(instrumentTrack, descriptor), kIsPatchbay(isPatchbay), @@ -573,7 +577,7 @@ bool CarlaInstrument::handleMidiEvent(const MidiEvent& event, const TimePos&, f_ return true; } -PluginView* CarlaInstrument::instantiateView(QWidget* parent) +gui::PluginView* CarlaInstrument::instantiateView(QWidget* parent) { // Disable plugin focus per https://bugreports.qt.io/browse/QTBUG-30181 #ifndef CARLA_OS_MAC @@ -590,7 +594,7 @@ PluginView* CarlaInstrument::instantiateView(QWidget* parent) //fHost.uiName = strdup(parent->windowTitle().toUtf8().constData()); fHost.uiName = strdup(kIsPatchbay ? "CarlaPatchbay-LMMS" : "CarlaRack-LMMS"); - return new CarlaInstrumentView(this, parent); + return new gui::CarlaInstrumentView(this, parent); } void CarlaInstrument::sampleRateChanged() @@ -600,6 +604,9 @@ void CarlaInstrument::sampleRateChanged() // ------------------------------------------------------------------- +namespace gui +{ + CarlaInstrumentView::CarlaInstrumentView(CarlaInstrument* const instrument, QWidget* const parent) : InstrumentViewFixedSize(instrument, parent), fHandle(instrument->fHandle), @@ -1109,3 +1116,8 @@ void CarlaParamsView::clearKnobs() m_curOutColumn = 0; m_curOutRow = 0; } + + +} // namespace gui + +} // namespace lmms \ No newline at end of file diff --git a/plugins/carlabase/carla.h b/plugins/carlabase/carla.h index 6de8e3379a0..6912ba6f781 100644 --- a/plugins/carlabase/carla.h +++ b/plugins/carlabase/carla.h @@ -63,7 +63,15 @@ class QPushButton; class QComboBox; + +namespace lmms +{ + +namespace gui +{ class CarlaParamsView; +class CarlaInstrumentView; +} class CarlaParamFloatModel : public FloatModel { @@ -158,59 +166,6 @@ class CarlaParamFloatModel : public FloatModel // ------------------------------------------------------------------- -class CarlaParamsSubWindow : public SubWindow -{ - Q_OBJECT - -signals: - void uiClosed(); - void resized(); - -public: - CarlaParamsSubWindow(QWidget * _parent, Qt::WindowFlags windowFlags) : - SubWindow(_parent) - { - setAttribute(Qt::WA_DeleteOnClose, false); - setWindowFlags(windowFlags); - } - - virtual void resizeEvent(QResizeEvent * event) override - { - if (mousePress) { - resizing = true; - } - SubWindow::resizeEvent(event); - } - - virtual void mousePressEvent(QMouseEvent * event) override - { - mousePress = true; - SubWindow::mousePressEvent(event); - } - - virtual void mouseReleaseEvent(QMouseEvent * event) override - { - if (resizing) { - resizing = false; - mousePress = false; - emit resized(); - } - SubWindow::mouseReleaseEvent(event); - } - - virtual void closeEvent(QCloseEvent * event) override - { - emit uiClosed(); - event->accept(); - } - -private: - bool resizing = false; - bool mousePress = false; -}; - -// ------------------------------------------------------------------- - class CARLABASE_EXPORT CarlaInstrument : public Instrument { Q_OBJECT @@ -237,7 +192,7 @@ class CARLABASE_EXPORT CarlaInstrument : public Instrument virtual void loadSettings(const QDomElement& elem); virtual void play(sampleFrame* workingBuffer); virtual bool handleMidiEvent(const MidiEvent& event, const TimePos& time, f_cnt_t offset); - virtual PluginView* instantiateView(QWidget* parent); + virtual gui::PluginView* instantiateView(QWidget* parent); signals: void uiClosed(); @@ -271,11 +226,67 @@ private slots: QCompleter* m_paramsCompleter; QStringListModel* m_completerModel; - friend class CarlaInstrumentView; - friend class CarlaParamsView; + friend class gui::CarlaInstrumentView; + friend class gui::CarlaParamsView; }; +// ------------------------------------------------------------------- + +namespace gui +{ + +class CarlaParamsSubWindow : public SubWindow +{ +Q_OBJECT + +signals: + void uiClosed(); + void resized(); + +public: + CarlaParamsSubWindow(QWidget * _parent, Qt::WindowFlags windowFlags) : + SubWindow(_parent) + { + setAttribute(Qt::WA_DeleteOnClose, false); + setWindowFlags(windowFlags); + } + + virtual void resizeEvent(QResizeEvent * event) override + { + if (mousePress) { + resizing = true; + } + SubWindow::resizeEvent(event); + } + + virtual void mousePressEvent(QMouseEvent * event) override + { + mousePress = true; + SubWindow::mousePressEvent(event); + } + + virtual void mouseReleaseEvent(QMouseEvent * event) override + { + if (resizing) { + resizing = false; + mousePress = false; + emit resized(); + } + SubWindow::mouseReleaseEvent(event); + } + + virtual void closeEvent(QCloseEvent * event) override + { + emit uiClosed(); + event->accept(); + } + +private: + bool resizing = false; + bool mousePress = false; +}; + // ------------------------------------------------------------------- class CarlaInstrumentView : public InstrumentViewFixedSize @@ -362,4 +373,9 @@ private slots: QStringListModel* m_groupFilterModel; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/carlapatchbay/carlapatchbay.cpp b/plugins/carlapatchbay/carlapatchbay.cpp index c01112c0509..bb663d9fedc 100644 --- a/plugins/carlapatchbay/carlapatchbay.cpp +++ b/plugins/carlapatchbay/carlapatchbay.cpp @@ -28,6 +28,10 @@ #include "plugin_export.h" #include "InstrumentTrack.h" +namespace lmms +{ + + extern "C" { @@ -51,3 +55,6 @@ PLUGIN_EXPORT Plugin* lmms_plugin_main(Model* m, void*) } } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/carlarack/carlarack.cpp b/plugins/carlarack/carlarack.cpp index c2f3cc128a9..c4c1a571b66 100644 --- a/plugins/carlarack/carlarack.cpp +++ b/plugins/carlarack/carlarack.cpp @@ -28,6 +28,10 @@ #include "plugin_export.h" #include "InstrumentTrack.h" +namespace lmms +{ + + extern "C" { @@ -51,3 +55,6 @@ PLUGIN_EXPORT Plugin* lmms_plugin_main(Model* m, void*) } } + + +} // namespace lmms From 7d8017bb089b1950dc5f0efdd47904aa85a1fc24 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Wed, 6 Oct 2021 18:53:58 +0200 Subject: [PATCH 023/118] Add namespaces to Eq plugin. --- plugins/Eq/EqControls.cpp | 10 ++++++++-- plugins/Eq/EqControls.h | 16 ++++++++++++++-- plugins/Eq/EqControlsDialog.cpp | 6 ++++++ plugins/Eq/EqControlsDialog.h | 12 ++++++++++++ plugins/Eq/EqCurve.cpp | 7 +++++++ plugins/Eq/EqCurve.h | 6 ++++++ plugins/Eq/EqEffect.cpp | 7 +++++++ plugins/Eq/EqEffect.h | 5 +++++ plugins/Eq/EqFader.h | 7 +++++++ plugins/Eq/EqFilter.h | 5 +++++ plugins/Eq/EqParameterWidget.cpp | 6 ++++++ plugins/Eq/EqParameterWidget.h | 13 +++++++++++++ plugins/Eq/EqSpectrumView.cpp | 11 +++++++++++ plugins/Eq/EqSpectrumView.h | 12 +++++++++++- 14 files changed, 118 insertions(+), 5 deletions(-) diff --git a/plugins/Eq/EqControls.cpp b/plugins/Eq/EqControls.cpp index 9c6ecbf7609..37897e71295 100644 --- a/plugins/Eq/EqControls.cpp +++ b/plugins/Eq/EqControls.cpp @@ -30,6 +30,9 @@ #include "EqEffect.h" +namespace lmms +{ + EqControls::EqControls( EqEffect *effect ) : EffectControls( effect ), @@ -149,9 +152,9 @@ void EqControls::loadSettings( const QDomElement &_this ) m_analyseOutModel.loadSettings( _this, "AnalyseOut" ); } -EffectControlDialog*EqControls::createView() +gui::EffectControlDialog* EqControls::createView() { - return new EqControlsDialog( this ); + return new gui::EqControlsDialog( this ); } @@ -202,3 +205,6 @@ void EqControls::saveSettings( QDomDocument &doc, QDomElement &parent ) m_analyseInModel.saveSettings( doc, parent, "AnalyseIn" ); m_analyseOutModel.saveSettings( doc, parent, "AnalyseOut" ); } + + +} // namespace lmms diff --git a/plugins/Eq/EqControls.h b/plugins/Eq/EqControls.h index b314454ea88..8a2061cce0c 100644 --- a/plugins/Eq/EqControls.h +++ b/plugins/Eq/EqControls.h @@ -28,9 +28,17 @@ #include "EffectControls.h" #include "EqSpectrumView.h" +namespace lmms +{ + class EqEffect; +namespace gui +{ +class EqControlsDialog; +} + class EqControls : public EffectControls { Q_OBJECT @@ -54,7 +62,7 @@ class EqControls : public EffectControls return 42; } - virtual EffectControlDialog* createView(); + virtual gui::EffectControlDialog* createView(); float m_inPeakL; float m_inPeakR; @@ -126,7 +134,11 @@ class EqControls : public EffectControls BoolModel m_analyseInModel; BoolModel m_analyseOutModel; - friend class EqControlsDialog; + friend class gui::EqControlsDialog; friend class EqEffect; }; + + +} // namespace lmms + #endif // EQCONTROLS_H diff --git a/plugins/Eq/EqControlsDialog.cpp b/plugins/Eq/EqControlsDialog.cpp index 89ec7a59590..5a06e3be5d0 100644 --- a/plugins/Eq/EqControlsDialog.cpp +++ b/plugins/Eq/EqControlsDialog.cpp @@ -42,6 +42,9 @@ #include "EqParameterWidget.h" #include "EqSpectrumView.h" +namespace lmms::gui +{ + EqControlsDialog::EqControlsDialog( EqControls *controls ) : EffectControlDialog( controls ), @@ -238,3 +241,6 @@ EqBand* EqControlsDialog::setBand(int index, BoolModel* active, FloatModel* freq filterModels->lp48 = lp48; return filterModels; } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/Eq/EqControlsDialog.h b/plugins/Eq/EqControlsDialog.h index b28d3868718..f0cdfe536b7 100644 --- a/plugins/Eq/EqControlsDialog.h +++ b/plugins/Eq/EqControlsDialog.h @@ -30,10 +30,17 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class BoolModel; class FloatModel; class EqControls; + +namespace gui +{ + class EqBand; class EqParameterWidget; @@ -59,4 +66,9 @@ class EqControlsDialog : public EffectControlDialog int m_originalHeight; }; + +} // namespace gui + +} // namespace lmms + #endif // EQCONTROLSDIALOG_H diff --git a/plugins/Eq/EqCurve.cpp b/plugins/Eq/EqCurve.cpp index b066871fac2..0a3a0b5457d 100644 --- a/plugins/Eq/EqCurve.cpp +++ b/plugins/Eq/EqCurve.cpp @@ -27,6 +27,10 @@ #include "embed.h" #include "lmms_math.h" +namespace lmms::gui +{ + + EqHandle::EqHandle( int num, int x, int y ): m_numb( num ), m_width( x ), @@ -809,3 +813,6 @@ void EqCurve::setModelChanged( bool mc ) { m_modelChanged = mc; } + + +} // namespace lmms::gui diff --git a/plugins/Eq/EqCurve.h b/plugins/Eq/EqCurve.h index 58dfa2ac92b..5ca52ddd111 100644 --- a/plugins/Eq/EqCurve.h +++ b/plugins/Eq/EqCurve.h @@ -31,6 +31,9 @@ #include "lmms_math.h" #include "AutomatableModelView.h" +namespace lmms::gui +{ + enum{ highpass=1, @@ -137,4 +140,7 @@ class EqCurve : public QGraphicsObject float m_scale; }; + +} // namespace lmms::gui + #endif // EQCURVE_H diff --git a/plugins/Eq/EqEffect.cpp b/plugins/Eq/EqEffect.cpp index f871596ec73..29ddb008283 100644 --- a/plugins/Eq/EqEffect.cpp +++ b/plugins/Eq/EqEffect.cpp @@ -32,6 +32,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -365,3 +369,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/Eq/EqEffect.h b/plugins/Eq/EqEffect.h index 614e92146e6..b79110e5fe5 100644 --- a/plugins/Eq/EqEffect.h +++ b/plugins/Eq/EqEffect.h @@ -30,6 +30,8 @@ #include "EqFilter.h" #include "lmms_math.h" +namespace lmms +{ class EqEffect : public Effect @@ -97,4 +99,7 @@ class EqEffect : public Effect void setBandPeaks( EqAnalyser * fft , int ); }; + +} // namespace lmms + #endif // EQEFFECT_H diff --git a/plugins/Eq/EqFader.h b/plugins/Eq/EqFader.h index 0df66f7b7bb..1601081e986 100644 --- a/plugins/Eq/EqFader.h +++ b/plugins/Eq/EqFader.h @@ -32,6 +32,9 @@ #include "MainWindow.h" #include "TextFloat.h" +namespace lmms::gui +{ + class EqFader : public Fader { @@ -112,4 +115,8 @@ private slots: FloatModel* m_model; }; + + +} // namespace lmms::gui + #endif // EQFADER_H diff --git a/plugins/Eq/EqFilter.h b/plugins/Eq/EqFilter.h index 5223fdeda39..7361c751cb4 100644 --- a/plugins/Eq/EqFilter.h +++ b/plugins/Eq/EqFilter.h @@ -28,6 +28,10 @@ #include "BasicFilters.h" #include "lmms_math.h" +namespace lmms +{ + + /// /// \brief The EqFilter class. /// A wrapper for the StereoBiQuad class, giving it freq, res, and gain controls. @@ -454,6 +458,7 @@ class EqLinkwitzRiley : public StereoLinkwitzRiley }; +} // namespace lmms #endif // EQFILTER_H diff --git a/plugins/Eq/EqParameterWidget.cpp b/plugins/Eq/EqParameterWidget.cpp index be2174a2b36..b37332b80e3 100644 --- a/plugins/Eq/EqParameterWidget.cpp +++ b/plugins/Eq/EqParameterWidget.cpp @@ -33,6 +33,9 @@ #include "EqControls.h" #include "lmms_math.h" +namespace lmms::gui +{ + EqParameterWidget::EqParameterWidget( QWidget *parent, EqControls * controls ) : QWidget( parent ), @@ -240,3 +243,6 @@ EqBand::EqBand() : peakR( 0 ) { } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/Eq/EqParameterWidget.h b/plugins/Eq/EqParameterWidget.h index 231256bf00c..df77711174e 100644 --- a/plugins/Eq/EqParameterWidget.h +++ b/plugins/Eq/EqParameterWidget.h @@ -33,8 +33,15 @@ #include "EqCurve.h" #include "TextFloat.h" +namespace lmms +{ + class EqControls; + +namespace gui +{ + class EqBand { public : @@ -92,4 +99,10 @@ private slots: void updateModels(); void updateHandle(); }; + + +} // namespace gui + +} // namespace lmms + #endif // EQPARAMETERWIDGET_H diff --git a/plugins/Eq/EqSpectrumView.cpp b/plugins/Eq/EqSpectrumView.cpp index 27c320dfb70..8c845a7b278 100644 --- a/plugins/Eq/EqSpectrumView.cpp +++ b/plugins/Eq/EqSpectrumView.cpp @@ -28,6 +28,10 @@ #include "GuiApplication.h" #include "MainWindow.h" +namespace lmms +{ + + EqAnalyser::EqAnalyser() : m_framesFilledUp ( 0 ), m_energy ( 0 ), @@ -171,6 +175,8 @@ void EqAnalyser::clear() +namespace gui +{ EqSpectrumView::EqSpectrumView(EqAnalyser *b, QWidget *_parent) : QWidget( _parent ), @@ -293,3 +299,8 @@ void EqSpectrumView::periodicalUpdate() m_analyser->setActive( isVisible() ); update(); } + + +} // namespace gui + +} // namespace lmms \ No newline at end of file diff --git a/plugins/Eq/EqSpectrumView.h b/plugins/Eq/EqSpectrumView.h index 84feeff13e8..fba59def0ef 100644 --- a/plugins/Eq/EqSpectrumView.h +++ b/plugins/Eq/EqSpectrumView.h @@ -31,6 +31,9 @@ #include "lmms_basics.h" #include "lmms_math.h" +namespace lmms +{ + const int MAX_BANDS = 2048; class EqAnalyser @@ -65,7 +68,8 @@ class EqAnalyser }; - +namespace gui +{ class EqSpectrumView : public QWidget { @@ -98,4 +102,10 @@ private slots: float bandToFreq ( int index ); }; + + +} // namespace gui + +} // namespace lmms + #endif // EQSPECTRUMVIEW_H From f2740f8911cc5799f57dd66ef53504d94928eb69 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Wed, 6 Oct 2021 18:54:31 +0200 Subject: [PATCH 024/118] Add namespaces to Compressor plugin. --- plugins/Compressor/Compressor.cpp | 6 ++++++ plugins/Compressor/Compressor.h | 9 ++++++++- plugins/Compressor/CompressorControlDialog.cpp | 7 +++++++ plugins/Compressor/CompressorControlDialog.h | 13 +++++++++++++ plugins/Compressor/CompressorControls.cpp | 3 +++ plugins/Compressor/CompressorControls.h | 11 ++++++++--- 6 files changed, 45 insertions(+), 4 deletions(-) diff --git a/plugins/Compressor/Compressor.cpp b/plugins/Compressor/Compressor.cpp index 6728f403f30..60688863334 100755 --- a/plugins/Compressor/Compressor.cpp +++ b/plugins/Compressor/Compressor.cpp @@ -29,6 +29,10 @@ #include "lmms_math.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -662,3 +666,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main(Model* parent, void* data) } + +} // namespace lmms diff --git a/plugins/Compressor/Compressor.h b/plugins/Compressor/Compressor.h index be9cd066264..90de79615da 100755 --- a/plugins/Compressor/Compressor.h +++ b/plugins/Compressor/Compressor.h @@ -33,6 +33,10 @@ #include "RmsHelper.h" +namespace lmms +{ + + constexpr float COMP_LOG = -2.2; class CompressorEffect : public Effect @@ -147,7 +151,10 @@ private slots: bool m_redrawThreshold = true; friend class CompressorControls; - friend class CompressorControlDialog; + friend class gui::CompressorControlDialog; } ; + +} // namespace lmms + #endif diff --git a/plugins/Compressor/CompressorControlDialog.cpp b/plugins/Compressor/CompressorControlDialog.cpp index 2e8ea835a6b..39b9ff37152 100755 --- a/plugins/Compressor/CompressorControlDialog.cpp +++ b/plugins/Compressor/CompressorControlDialog.cpp @@ -37,6 +37,10 @@ #include "MainWindow.h" #include "ToolTip.h" +namespace lmms::gui +{ + + CompressorControlDialog::CompressorControlDialog(CompressorControls* controls) : EffectControlDialog(controls), m_controls(controls), @@ -760,3 +764,6 @@ void CompressorControlDialog::resetCompressorView() m_autoReleaseKnob->move(m_controlsBoxX + 590, m_controlsBoxY + 38); lookaheadButton->move(m_controlsBoxX + 202, m_controlsBoxY + 171); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/Compressor/CompressorControlDialog.h b/plugins/Compressor/CompressorControlDialog.h index 7eb19c5b9f1..b3652309978 100755 --- a/plugins/Compressor/CompressorControlDialog.h +++ b/plugins/Compressor/CompressorControlDialog.h @@ -38,6 +38,8 @@ #include "MainWindow.h" #include "PixmapButton.h" +namespace lmms +{ constexpr int COMP_MILLI_PER_PIXEL = 6; constexpr int MIN_COMP_SCREEN_X = 800; @@ -60,6 +62,11 @@ constexpr float COMP_NOISE_FLOOR = 0.000001;// -120 dbFs class CompressorControls; + +namespace gui +{ + + class CompressorControlDialog : public EffectControlDialog { Q_OBJECT @@ -215,4 +222,10 @@ private slots: friend class CompressorControls; } ; + + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Compressor/CompressorControls.cpp b/plugins/Compressor/CompressorControls.cpp index 772fb5261ee..5b3d4c5dda0 100755 --- a/plugins/Compressor/CompressorControls.cpp +++ b/plugins/Compressor/CompressorControls.cpp @@ -31,6 +31,8 @@ #include "Engine.h" #include "Song.h" +namespace lmms +{ CompressorControls::CompressorControls(CompressorEffect* effect) : EffectControls(effect), @@ -145,3 +147,4 @@ void CompressorControls::loadSettings(const QDomElement& _this) } +} // namespace lmms \ No newline at end of file diff --git a/plugins/Compressor/CompressorControls.h b/plugins/Compressor/CompressorControls.h index 775a3be89f5..20a66b843ef 100755 --- a/plugins/Compressor/CompressorControls.h +++ b/plugins/Compressor/CompressorControls.h @@ -30,6 +30,8 @@ #include "EffectControls.h" #include "Knob.h" +namespace lmms +{ class CompressorEffect; @@ -52,9 +54,9 @@ class CompressorControls : public EffectControls return 28; } - EffectControlDialog* createView() override + gui::EffectControlDialog* createView() override { - return new CompressorControlDialog(this); + return new gui::CompressorControlDialog(this); } private: @@ -94,9 +96,12 @@ class CompressorControls : public EffectControls float m_outPeakL; float m_outPeakR; - friend class CompressorControlDialog; + friend class gui::CompressorControlDialog; friend class CompressorEffect; } ; + +} // namespace lmms + #endif From fafd97e83d9fbaf384daf4a6e9e2ceb9d2e17a31 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Wed, 6 Oct 2021 19:02:58 +0200 Subject: [PATCH 025/118] Add namespaces to CrossoverEQ plugin. --- plugins/CrossoverEQ/CrossoverEQ.cpp | 7 +++++++ plugins/CrossoverEQ/CrossoverEQ.h | 7 +++++++ plugins/CrossoverEQ/CrossoverEQControlDialog.cpp | 7 +++++++ plugins/CrossoverEQ/CrossoverEQControlDialog.h | 13 +++++++++++++ plugins/CrossoverEQ/CrossoverEQControls.cpp | 7 +++++++ plugins/CrossoverEQ/CrossoverEQControls.h | 12 +++++++++--- 6 files changed, 50 insertions(+), 3 deletions(-) diff --git a/plugins/CrossoverEQ/CrossoverEQ.cpp b/plugins/CrossoverEQ/CrossoverEQ.cpp index 92a3f6a6d1b..d915afc23a3 100644 --- a/plugins/CrossoverEQ/CrossoverEQ.cpp +++ b/plugins/CrossoverEQ/CrossoverEQ.cpp @@ -29,6 +29,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -222,3 +226,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/CrossoverEQ/CrossoverEQ.h b/plugins/CrossoverEQ/CrossoverEQ.h index 36d619c3b22..fe590691e2b 100644 --- a/plugins/CrossoverEQ/CrossoverEQ.h +++ b/plugins/CrossoverEQ/CrossoverEQ.h @@ -33,6 +33,10 @@ #include "lmms_math.h" #include "BasicFilters.h" +namespace lmms +{ + + class CrossoverEQEffect : public Effect { public: @@ -76,4 +80,7 @@ class CrossoverEQEffect : public Effect friend class CrossoverEQControls; }; + +} // namespace lmms + #endif diff --git a/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp b/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp index eec318a936e..b5f72535280 100644 --- a/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp +++ b/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp @@ -35,6 +35,10 @@ #include "Knob.h" #include "Fader.h" +namespace lmms::gui +{ + + CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * controls ) : EffectControlDialog( controls ) { @@ -113,3 +117,6 @@ CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * contro mute4->setModel( & controls->m_mute4 ); ToolTip::add( mute4, tr( "Mute band 4" ) ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/CrossoverEQ/CrossoverEQControlDialog.h b/plugins/CrossoverEQ/CrossoverEQControlDialog.h index e1e9f013dfd..f2836655712 100644 --- a/plugins/CrossoverEQ/CrossoverEQControlDialog.h +++ b/plugins/CrossoverEQ/CrossoverEQControlDialog.h @@ -30,8 +30,16 @@ #include #include "EffectControlDialog.h" +namespace lmms +{ + + class CrossoverEQControls; + +namespace gui +{ + class CrossoverEQControlDialog : public EffectControlDialog { Q_OBJECT @@ -47,4 +55,9 @@ class CrossoverEQControlDialog : public EffectControlDialog QPixmap m_fader_knob; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/CrossoverEQ/CrossoverEQControls.cpp b/plugins/CrossoverEQ/CrossoverEQControls.cpp index 19c1163a32d..9758d804a86 100644 --- a/plugins/CrossoverEQ/CrossoverEQControls.cpp +++ b/plugins/CrossoverEQ/CrossoverEQControls.cpp @@ -27,6 +27,10 @@ #include "CrossoverEQControls.h" #include "CrossoverEQ.h" +namespace lmms +{ + + CrossoverEQControls::CrossoverEQControls( CrossoverEQEffect * eff ) : EffectControls( eff ), m_effect( eff ), @@ -115,3 +119,6 @@ void CrossoverEQControls::sampleRateChanged() { m_effect->sampleRateChanged(); } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/CrossoverEQ/CrossoverEQControls.h b/plugins/CrossoverEQ/CrossoverEQControls.h index 3823a8370ba..7f941736588 100644 --- a/plugins/CrossoverEQ/CrossoverEQControls.h +++ b/plugins/CrossoverEQ/CrossoverEQControls.h @@ -30,6 +30,9 @@ #include "EffectControls.h" #include "CrossoverEQControlDialog.h" +namespace lmms +{ + class CrossoverEQEffect; class CrossoverEQControls : public EffectControls @@ -51,9 +54,9 @@ class CrossoverEQControls : public EffectControls return( 11 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog * createView() { - return( new CrossoverEQControlDialog( this ) ); + return( new gui::CrossoverEQControlDialog( this ) ); } private slots: @@ -79,8 +82,11 @@ private slots: BoolModel m_mute3; BoolModel m_mute4; - friend class CrossoverEQControlDialog; + friend class gui::CrossoverEQControlDialog; friend class CrossoverEQEffect; }; + +} // namespace lmms + #endif From 312f984f3c5a41c8e6c26d5814374d053b6e0c4a Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 14:15:46 +0200 Subject: [PATCH 026/118] Add namespaces to Delay plugin. --- plugins/Delay/DelayControls.cpp | 6 ++++++ plugins/Delay/DelayControls.h | 12 +++++++++--- plugins/Delay/DelayControlsDialog.cpp | 6 +++++- plugins/Delay/DelayControlsDialog.h | 12 ++++++++++++ plugins/Delay/DelayEffect.cpp | 6 ++++++ plugins/Delay/DelayEffect.h | 7 +++++++ plugins/Delay/Lfo.cpp | 6 +++++- plugins/Delay/Lfo.h | 7 +++++++ plugins/Delay/StereoDelay.cpp | 8 ++++---- plugins/Delay/StereoDelay.h | 7 +++++++ 10 files changed, 68 insertions(+), 9 deletions(-) diff --git a/plugins/Delay/DelayControls.cpp b/plugins/Delay/DelayControls.cpp index 35e8f869e7f..8bc4947b968 100644 --- a/plugins/Delay/DelayControls.cpp +++ b/plugins/Delay/DelayControls.cpp @@ -29,6 +29,9 @@ #include "Engine.h" #include "Song.h" +namespace lmms +{ + DelayControls::DelayControls( DelayEffect* effect ): EffectControls( effect ), m_effect ( effect ), @@ -73,3 +76,6 @@ void DelayControls::changeSampleRate() { m_effect->changeSampleRate(); } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/Delay/DelayControls.h b/plugins/Delay/DelayControls.h index 8c9b2eb1a99..22da5d6f924 100644 --- a/plugins/Delay/DelayControls.h +++ b/plugins/Delay/DelayControls.h @@ -29,10 +29,13 @@ #include "Knob.h" #include "DelayControlsDialog.h" +namespace lmms +{ class DelayEffect; + class DelayControls : public EffectControls { Q_OBJECT @@ -50,9 +53,9 @@ class DelayControls : public EffectControls virtual int controlCount(){ return 5; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new DelayControlsDialog( this ); + return new gui::DelayControlsDialog( this ); } float m_outPeakL; @@ -70,8 +73,11 @@ private slots: TempoSyncKnobModel m_lfoAmountModel; FloatModel m_outGainModel; - friend class DelayControlsDialog; + friend class gui::DelayControlsDialog; friend class DelayEffect; }; + +} // namespace lmms + #endif // DELAYCONTROLS_H diff --git a/plugins/Delay/DelayControlsDialog.cpp b/plugins/Delay/DelayControlsDialog.cpp index efc8a7169b6..d456a6f2017 100755 --- a/plugins/Delay/DelayControlsDialog.cpp +++ b/plugins/Delay/DelayControlsDialog.cpp @@ -30,7 +30,8 @@ #include #include - +namespace lmms::gui +{ DelayControlsDialog::DelayControlsDialog( DelayControls *controls ) : @@ -151,3 +152,6 @@ void XyPad::mouseMoveEvent(QMouseEvent *event) m_yModel->setValue( m_yModel->minValue() + ( event->y() * yInc ) ); } } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/Delay/DelayControlsDialog.h b/plugins/Delay/DelayControlsDialog.h index 9bd50b4a71d..4a81afa1735 100644 --- a/plugins/Delay/DelayControlsDialog.h +++ b/plugins/Delay/DelayControlsDialog.h @@ -28,8 +28,15 @@ #include "EffectControlDialog.h" #include "AutomatableModel.h" +namespace lmms +{ + + class DelayControls; +namespace gui +{ + class DelayControlsDialog : public EffectControlDialog { Q_OBJECT @@ -59,4 +66,9 @@ class XyPad : public QWidget bool m_acceptInput; }; + +} // namespace gui + +} // namespace lmms + #endif // DELAYCONTROLSDIALOG_H diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index fc12cb820c1..e87f7de6b70 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -28,6 +28,10 @@ #include "interpolation.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -164,3 +168,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) }} + +} // namespace lmms \ No newline at end of file diff --git a/plugins/Delay/DelayEffect.h b/plugins/Delay/DelayEffect.h index 3c89b567ae5..2f5656a6153 100644 --- a/plugins/Delay/DelayEffect.h +++ b/plugins/Delay/DelayEffect.h @@ -31,6 +31,10 @@ #include "StereoDelay.h" #include "ValueBuffer.h" +namespace lmms +{ + + class DelayEffect : public Effect { public: @@ -51,4 +55,7 @@ class DelayEffect : public Effect float m_currentLength; }; + +} // namespace lmms + #endif // DELAYEFFECT_H diff --git a/plugins/Delay/Lfo.cpp b/plugins/Delay/Lfo.cpp index c12452038da..02bd90aaa80 100644 --- a/plugins/Delay/Lfo.cpp +++ b/plugins/Delay/Lfo.cpp @@ -25,7 +25,8 @@ #include "Lfo.h" #include "lmms_math.h" - +namespace lmms +{ Lfo::Lfo( int samplerate ) @@ -44,3 +45,6 @@ float Lfo::tick() return output; } + + +} // namespace lmms diff --git a/plugins/Delay/Lfo.h b/plugins/Delay/Lfo.h index 02d9ed25eeb..aea50028c4a 100644 --- a/plugins/Delay/Lfo.h +++ b/plugins/Delay/Lfo.h @@ -27,6 +27,10 @@ #include "lmms_math.h" +namespace lmms +{ + + class Lfo { public: @@ -76,4 +80,7 @@ class Lfo int m_samplerate; }; + +} // namespace lmms + #endif // LFO_H diff --git a/plugins/Delay/StereoDelay.cpp b/plugins/Delay/StereoDelay.cpp index f240b93547b..be437f0e1cb 100644 --- a/plugins/Delay/StereoDelay.cpp +++ b/plugins/Delay/StereoDelay.cpp @@ -28,6 +28,9 @@ #include "interpolation.h" #include "lmms_math.h" +namespace lmms +{ + StereoDelay::StereoDelay( int maxTime, int sampleRate ) { @@ -90,7 +93,4 @@ void StereoDelay::setSampleRate( int sampleRate ) } - - - - +} // namespace lmms diff --git a/plugins/Delay/StereoDelay.h b/plugins/Delay/StereoDelay.h index afea59b9af1..0ea0efeed06 100644 --- a/plugins/Delay/StereoDelay.h +++ b/plugins/Delay/StereoDelay.h @@ -27,6 +27,10 @@ #include "lmms_basics.h" + +namespace lmms +{ + class StereoDelay { public: @@ -57,4 +61,7 @@ class StereoDelay float m_maxTime; }; + +} // namespace lmms + #endif // STEREODELAY_H From bd2dd1d6c48b3d60e44e06c4dc9ae953b9946451 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 15:13:59 +0200 Subject: [PATCH 027/118] Add namespaces to DualFilter plugin. --- plugins/DualFilter/DualFilter.cpp | 6 ++++++ plugins/DualFilter/DualFilter.h | 7 +++++++ plugins/DualFilter/DualFilterControlDialog.cpp | 14 ++++++++++---- plugins/DualFilter/DualFilterControlDialog.h | 11 +++++++++++ plugins/DualFilter/DualFilterControls.cpp | 8 +++++--- plugins/DualFilter/DualFilterControls.h | 13 ++++++++++--- 6 files changed, 49 insertions(+), 10 deletions(-) diff --git a/plugins/DualFilter/DualFilter.cpp b/plugins/DualFilter/DualFilter.cpp index 19bed543623..2279ae37dec 100644 --- a/plugins/DualFilter/DualFilter.cpp +++ b/plugins/DualFilter/DualFilter.cpp @@ -29,6 +29,10 @@ #include "BasicFilters.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -229,3 +233,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } + +} // namespace lmms diff --git a/plugins/DualFilter/DualFilter.h b/plugins/DualFilter/DualFilter.h index a8eb82075d1..bfc9dc81be1 100644 --- a/plugins/DualFilter/DualFilter.h +++ b/plugins/DualFilter/DualFilter.h @@ -31,6 +31,10 @@ #include "DualFilterControls.h" #include "BasicFilters.h" +namespace lmms +{ + + class DualFilterEffect : public Effect { public: @@ -62,4 +66,7 @@ class DualFilterEffect : public Effect } ; + +} // namespace lmms + #endif diff --git a/plugins/DualFilter/DualFilterControlDialog.cpp b/plugins/DualFilter/DualFilterControlDialog.cpp index 0c7732bc6c2..837c20545a7 100755 --- a/plugins/DualFilter/DualFilterControlDialog.cpp +++ b/plugins/DualFilter/DualFilterControlDialog.cpp @@ -33,12 +33,16 @@ #include "ToolTip.h" #include "gui_templates.h" +namespace lmms::gui +{ + + #define makeknob( name, x, y, model, label, hint, unit ) \ Knob * name = new Knob( knobBright_26, this); \ - name -> move( x, y ); \ - name ->setModel( &controls-> model ); \ - name ->setLabel( label ); \ - name ->setHintText( hint, unit ); + (name) -> move( x, y ); \ + (name) ->setModel( &controls-> model ); \ + (name) ->setLabel( label ); \ + (name) ->setHintText( hint, unit ); @@ -85,3 +89,5 @@ DualFilterControlDialog::DualFilterControlDialog( DualFilterControls* controls ) m_filter2ComboBox->setModel( &controls->m_filter2Model ); } + +} // namespace lmms::gui diff --git a/plugins/DualFilter/DualFilterControlDialog.h b/plugins/DualFilter/DualFilterControlDialog.h index f839864d87f..a6ac469549f 100644 --- a/plugins/DualFilter/DualFilterControlDialog.h +++ b/plugins/DualFilter/DualFilterControlDialog.h @@ -28,9 +28,15 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class DualFilterControls; +namespace gui +{ + class DualFilterControlDialog : public EffectControlDialog { @@ -43,4 +49,9 @@ class DualFilterControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/DualFilter/DualFilterControls.cpp b/plugins/DualFilter/DualFilterControls.cpp index 575a6215209..dca2047b562 100644 --- a/plugins/DualFilter/DualFilterControls.cpp +++ b/plugins/DualFilter/DualFilterControls.cpp @@ -33,6 +33,10 @@ #include "Engine.h" #include "Song.h" +namespace lmms +{ + + DualFilterControls::DualFilterControls( DualFilterEffect* effect ) : EffectControls( effect ), m_effect( effect ), @@ -157,6 +161,4 @@ void DualFilterControls::saveSettings( QDomDocument& _doc, QDomElement& _this ) } - - - +} // namespace lmms diff --git a/plugins/DualFilter/DualFilterControls.h b/plugins/DualFilter/DualFilterControls.h index 4392b88966c..e3e3aae9a7b 100644 --- a/plugins/DualFilter/DualFilterControls.h +++ b/plugins/DualFilter/DualFilterControls.h @@ -31,6 +31,10 @@ #include "Knob.h" #include "ComboBoxModel.h" +namespace lmms +{ + + class DualFilterEffect; @@ -55,9 +59,9 @@ class DualFilterControls : public EffectControls return 11; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new DualFilterControlDialog( this ); + return new gui::DualFilterControlDialog( this ); } @@ -81,9 +85,12 @@ private slots: FloatModel m_res2Model; FloatModel m_gain2Model; - friend class DualFilterControlDialog; + friend class gui::DualFilterControlDialog; friend class DualFilterEffect; } ; + +} // namespace lmms + #endif From ac9e7d5e2cacbf6899eb72c9e541c05d387df18a Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 15:18:05 +0200 Subject: [PATCH 028/118] Add namespaces to Dynamics Processor plugin. --- plugins/dynamics_processor/dynamics_processor.cpp | 6 ++++++ plugins/dynamics_processor/dynamics_processor.h | 6 ++++-- .../dynamics_processor_control_dialog.cpp | 5 +++++ .../dynamics_processor_control_dialog.h | 11 +++++++++++ .../dynamics_processor_controls.cpp | 6 ++++-- .../dynamics_processor_controls.h | 13 ++++++++++--- 6 files changed, 40 insertions(+), 7 deletions(-) diff --git a/plugins/dynamics_processor/dynamics_processor.cpp b/plugins/dynamics_processor/dynamics_processor.cpp index 0dae64504db..e88e29913b9 100644 --- a/plugins/dynamics_processor/dynamics_processor.cpp +++ b/plugins/dynamics_processor/dynamics_processor.cpp @@ -31,6 +31,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -243,3 +247,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * _parent, void * _data ) } + +} // namespace lmms diff --git a/plugins/dynamics_processor/dynamics_processor.h b/plugins/dynamics_processor/dynamics_processor.h index 3edf98cfcae..d44d1f5fa7d 100644 --- a/plugins/dynamics_processor/dynamics_processor.h +++ b/plugins/dynamics_processor/dynamics_processor.h @@ -31,6 +31,9 @@ #include "dynamics_processor_controls.h" #include "RmsHelper.h" +namespace lmms +{ + class dynProcEffect : public Effect { @@ -67,7 +70,6 @@ class dynProcEffect : public Effect } ; - - +} // namespace lmms #endif diff --git a/plugins/dynamics_processor/dynamics_processor_control_dialog.cpp b/plugins/dynamics_processor/dynamics_processor_control_dialog.cpp index 00d92f9445c..0e600252ef0 100644 --- a/plugins/dynamics_processor/dynamics_processor_control_dialog.cpp +++ b/plugins/dynamics_processor/dynamics_processor_control_dialog.cpp @@ -34,6 +34,9 @@ #include "ToolTip.h" #include "LedCheckbox.h" +namespace lmms::gui +{ + dynProcControlDialog::dynProcControlDialog( dynProcControls * _controls ) : @@ -153,3 +156,5 @@ dynProcControlDialog::dynProcControlDialog( _controls, SLOT( subOneClicked() ) ); } + +} // namespace lmms::gui diff --git a/plugins/dynamics_processor/dynamics_processor_control_dialog.h b/plugins/dynamics_processor/dynamics_processor_control_dialog.h index 3a53ab65335..97fd114fcf6 100644 --- a/plugins/dynamics_processor/dynamics_processor_control_dialog.h +++ b/plugins/dynamics_processor/dynamics_processor_control_dialog.h @@ -28,10 +28,16 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class dynProcControls; +namespace gui +{ + class dynProcControlDialog : public EffectControlDialog { Q_OBJECT @@ -46,4 +52,9 @@ class dynProcControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/dynamics_processor/dynamics_processor_controls.cpp b/plugins/dynamics_processor/dynamics_processor_controls.cpp index 87db6089424..da4dac39713 100644 --- a/plugins/dynamics_processor/dynamics_processor_controls.cpp +++ b/plugins/dynamics_processor/dynamics_processor_controls.cpp @@ -33,6 +33,9 @@ #include "Engine.h" #include "Song.h" +namespace lmms +{ + #define onedB 1.1220184543019633f @@ -154,5 +157,4 @@ void dynProcControls::subOneClicked() } - - +} // namespace lmms diff --git a/plugins/dynamics_processor/dynamics_processor_controls.h b/plugins/dynamics_processor/dynamics_processor_controls.h index 8682531d13b..809ccd55956 100644 --- a/plugins/dynamics_processor/dynamics_processor_controls.h +++ b/plugins/dynamics_processor/dynamics_processor_controls.h @@ -31,6 +31,10 @@ #include "Knob.h" #include "Graph.h" +namespace lmms +{ + + class dynProcEffect; @@ -64,9 +68,9 @@ class dynProcControls : public EffectControls return( 6 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog * createView() { - return( new dynProcControlDialog( this ) ); + return( new gui::dynProcControlDialog( this ) ); } @@ -90,9 +94,12 @@ private slots: graphModel m_wavegraphModel; IntModel m_stereomodeModel; - friend class dynProcControlDialog; + friend class gui::dynProcControlDialog; friend class dynProcEffect; } ; + +} // namespace lmms + #endif From 9764e916aacfef0c6698ed38f3d04630620c5c41 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 15:23:07 +0200 Subject: [PATCH 029/118] Add namespaces to Flanger plugin. --- plugins/Flanger/FlangerControls.cpp | 5 +++++ plugins/Flanger/FlangerControls.h | 12 +++++++++--- plugins/Flanger/FlangerControlsDialog.cpp | 6 +++++- plugins/Flanger/FlangerControlsDialog.h | 13 +++++++++++++ plugins/Flanger/FlangerEffect.cpp | 7 +++++++ plugins/Flanger/FlangerEffect.h | 6 ++++++ plugins/Flanger/MonoDelay.cpp | 7 +++++++ plugins/Flanger/MonoDelay.h | 7 +++++++ plugins/Flanger/Noise.cpp | 7 +++++++ plugins/Flanger/Noise.h | 7 +++++++ 10 files changed, 73 insertions(+), 4 deletions(-) diff --git a/plugins/Flanger/FlangerControls.cpp b/plugins/Flanger/FlangerControls.cpp index 81e9268c7ed..62b9db20908 100644 --- a/plugins/Flanger/FlangerControls.cpp +++ b/plugins/Flanger/FlangerControls.cpp @@ -29,6 +29,8 @@ #include "Engine.h" #include "Song.h" +namespace lmms +{ FlangerControls::FlangerControls( FlangerEffect *effect ) : @@ -91,3 +93,6 @@ void FlangerControls::changedPlaybackState() { m_effect->restartLFO(); } + + +} // namespace lmms diff --git a/plugins/Flanger/FlangerControls.h b/plugins/Flanger/FlangerControls.h index 8397a69faf5..2acffbd2739 100644 --- a/plugins/Flanger/FlangerControls.h +++ b/plugins/Flanger/FlangerControls.h @@ -29,6 +29,9 @@ #include "Knob.h" #include "FlangerControlsDialog.h" +namespace lmms +{ + class FlangerEffect; @@ -50,9 +53,9 @@ class FlangerControls : public EffectControls { return 7; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new FlangerControlsDialog( this ); + return new gui::FlangerControlsDialog( this ); } private slots: @@ -69,9 +72,12 @@ private slots: FloatModel m_whiteNoiseAmountModel; BoolModel m_invertFeedbackModel; - friend class FlangerControlsDialog; + friend class gui::FlangerControlsDialog; friend class FlangerEffect; }; + +} // namespace lmms + #endif // FLANGERCONTROLS_H diff --git a/plugins/Flanger/FlangerControlsDialog.cpp b/plugins/Flanger/FlangerControlsDialog.cpp index 8b7fdcf100a..d5905f1b2a9 100644 --- a/plugins/Flanger/FlangerControlsDialog.cpp +++ b/plugins/Flanger/FlangerControlsDialog.cpp @@ -28,7 +28,8 @@ #include "LedCheckbox.h" #include "TempoSyncKnob.h" - +namespace lmms::gui +{ FlangerControlsDialog::FlangerControlsDialog( FlangerControls *controls ) : @@ -88,3 +89,6 @@ FlangerControlsDialog::FlangerControlsDialog( FlangerControls *controls ) : } + + +} // namespace lmms::gui diff --git a/plugins/Flanger/FlangerControlsDialog.h b/plugins/Flanger/FlangerControlsDialog.h index 3e27bda4751..6aed1b6b4ad 100644 --- a/plugins/Flanger/FlangerControlsDialog.h +++ b/plugins/Flanger/FlangerControlsDialog.h @@ -27,8 +27,16 @@ #include "EffectControlDialog.h" +namespace lmms +{ + + class FlangerControls; +namespace gui +{ + + class FlangerControlsDialog : public EffectControlDialog { Q_OBJECT @@ -39,4 +47,9 @@ class FlangerControlsDialog : public EffectControlDialog } }; + +} // namespace gui + +} // namespace lmms + #endif // FLANGERCONTROLSDIALOG_H diff --git a/plugins/Flanger/FlangerEffect.cpp b/plugins/Flanger/FlangerEffect.cpp index 2668b63c501..71cf96e186a 100644 --- a/plugins/Flanger/FlangerEffect.cpp +++ b/plugins/Flanger/FlangerEffect.cpp @@ -28,6 +28,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -161,3 +165,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } }} + + +} // namespace lmms diff --git a/plugins/Flanger/FlangerEffect.h b/plugins/Flanger/FlangerEffect.h index a70e87827dd..48332c30610 100644 --- a/plugins/Flanger/FlangerEffect.h +++ b/plugins/Flanger/FlangerEffect.h @@ -32,6 +32,9 @@ #include "MonoDelay.h" #include "Noise.h" +namespace lmms +{ + class FlangerEffect : public Effect { @@ -55,4 +58,7 @@ class FlangerEffect : public Effect }; + +} // namespace lmms + #endif // FLANGEREFFECT_H diff --git a/plugins/Flanger/MonoDelay.cpp b/plugins/Flanger/MonoDelay.cpp index fc63d57d1be..445e7c37ddb 100644 --- a/plugins/Flanger/MonoDelay.cpp +++ b/plugins/Flanger/MonoDelay.cpp @@ -27,6 +27,10 @@ #include "lmms_math.h" #include "string.h" +namespace lmms +{ + + MonoDelay::MonoDelay( int maxTime , int sampleRate ) { m_buffer = 0; @@ -76,3 +80,6 @@ void MonoDelay::setSampleRate( int sampleRate ) m_buffer = new sample_t[( int )( sampleRate * m_maxTime ) ]; memset( m_buffer, 0, sizeof(float) * ( int )( sampleRate * m_maxTime ) ); } + + +} // namespace lmms diff --git a/plugins/Flanger/MonoDelay.h b/plugins/Flanger/MonoDelay.h index 52898bfe45d..2e9324a7df5 100644 --- a/plugins/Flanger/MonoDelay.h +++ b/plugins/Flanger/MonoDelay.h @@ -27,6 +27,10 @@ #include "lmms_basics.h" +namespace lmms +{ + + class MonoDelay { public: @@ -57,4 +61,7 @@ class MonoDelay float m_maxTime; }; + +} // namespace lmms + #endif // MONODELAY_H diff --git a/plugins/Flanger/Noise.cpp b/plugins/Flanger/Noise.cpp index f2acb16fea4..263fb7c458f 100644 --- a/plugins/Flanger/Noise.cpp +++ b/plugins/Flanger/Noise.cpp @@ -25,6 +25,10 @@ #include "Noise.h" #include "lmms_math.h" +namespace lmms +{ + + Noise::Noise() { inv_randmax = 1.0/FAST_RAND_MAX; /* for range of 0 - 1.0 */ @@ -37,3 +41,6 @@ float Noise::tick() { return (float) ((2.0 * fast_rand() * inv_randmax) - 1.0); } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/Flanger/Noise.h b/plugins/Flanger/Noise.h index 9a3106f3ef1..9f6e2f2e1eb 100644 --- a/plugins/Flanger/Noise.h +++ b/plugins/Flanger/Noise.h @@ -25,6 +25,10 @@ #ifndef NOISE_H #define NOISE_H +namespace lmms +{ + + class Noise { public: @@ -34,4 +38,7 @@ class Noise double inv_randmax; }; + +} // namespace lmms + #endif // NOISE_H From 8f5c73e9d4cf744ca5c0bb70059d0e2585083f5a Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 15:27:30 +0200 Subject: [PATCH 030/118] Add namespaces to FreeBoy plugin. --- plugins/FreeBoy/FreeBoy.cpp | 16 ++++++++++++++-- plugins/FreeBoy/FreeBoy.h | 24 +++++++++++++++++++++--- plugins/FreeBoy/Gb_Apu_Buffer.cpp | 6 ++++++ plugins/FreeBoy/Gb_Apu_Buffer.h | 7 +++++++ 4 files changed, 48 insertions(+), 5 deletions(-) diff --git a/plugins/FreeBoy/FreeBoy.cpp b/plugins/FreeBoy/FreeBoy.cpp index f426f5387c1..0340f86b740 100644 --- a/plugins/FreeBoy/FreeBoy.cpp +++ b/plugins/FreeBoy/FreeBoy.cpp @@ -44,6 +44,10 @@ #include "plugin_export.h" +namespace lmms +{ + + const blip_time_t FRAME_LENGTH = 70224; const long CLOCK_RATE = 4194304; @@ -430,12 +434,16 @@ void FreeBoyInstrument::deleteNotePluginData( NotePlayHandle * _n ) -PluginView * FreeBoyInstrument::instantiateView( QWidget * _parent ) +gui::PluginView * FreeBoyInstrument::instantiateView( QWidget * _parent ) { - return( new FreeBoyInstrumentView( this, _parent ) ); + return( new gui::FreeBoyInstrumentView( this, _parent ) ); } +namespace gui +{ + + class FreeBoyKnob : public Knob { public: @@ -724,6 +732,9 @@ void FreeBoyInstrumentView::modelChanged() m_graph->setModel( &p->m_graphModel ); } + +} // namespace gui + extern "C" { @@ -738,3 +749,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } +} // namespace lmms \ No newline at end of file diff --git a/plugins/FreeBoy/FreeBoy.h b/plugins/FreeBoy/FreeBoy.h index 9ceb2796671..e5e9cacdc25 100644 --- a/plugins/FreeBoy/FreeBoy.h +++ b/plugins/FreeBoy/FreeBoy.h @@ -33,9 +33,19 @@ #include "Graph.h" #include "Gb_Apu.h" -class FreeBoyInstrumentView; +namespace lmms +{ + + class NotePlayHandle; + + +namespace gui +{ class PixmapButton; +class FreeBoyInstrumentView; +} + class FreeBoyInstrument : public Instrument { @@ -57,7 +67,7 @@ class FreeBoyInstrument : public Instrument virtual f_cnt_t desiredReleaseFrames() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); /*public slots: @@ -107,10 +117,14 @@ class FreeBoyInstrument : public Instrument blip_time_t m_time; blip_time_t fakeClock() { return m_time += 4; } - friend class FreeBoyInstrumentView; + friend class gui::FreeBoyInstrumentView; } ; +namespace gui +{ + + class FreeBoyInstrumentView : public InstrumentViewFixedSize { Q_OBJECT @@ -162,4 +176,8 @@ class FreeBoyInstrumentView : public InstrumentViewFixedSize } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/FreeBoy/Gb_Apu_Buffer.cpp b/plugins/FreeBoy/Gb_Apu_Buffer.cpp index 0cd8662ac29..f261bc9c043 100644 --- a/plugins/FreeBoy/Gb_Apu_Buffer.cpp +++ b/plugins/FreeBoy/Gb_Apu_Buffer.cpp @@ -22,6 +22,10 @@ */ #include "Gb_Apu_Buffer.h" +namespace lmms +{ + + Gb_Apu_Buffer::Gb_Apu_Buffer() {} Gb_Apu_Buffer::~Gb_Apu_Buffer() {} @@ -51,3 +55,5 @@ void Gb_Apu_Buffer::bass_freq(int freq) { m_buf.bass_freq(freq); } + +} // namespace lmms diff --git a/plugins/FreeBoy/Gb_Apu_Buffer.h b/plugins/FreeBoy/Gb_Apu_Buffer.h index 5228b7b8afd..0b025bea003 100644 --- a/plugins/FreeBoy/Gb_Apu_Buffer.h +++ b/plugins/FreeBoy/Gb_Apu_Buffer.h @@ -27,6 +27,10 @@ #include "Multi_Buffer.h" #include "MemoryManager.h" +namespace lmms +{ + + class Gb_Apu_Buffer : public Gb_Apu { MM_OPERATORS public: @@ -44,5 +48,8 @@ class Gb_Apu_Buffer : public Gb_Apu { Stereo_Buffer m_buf; }; + +} // namespace lmms + #endif From ee8e474e3f1478198aad96975069e63048458131 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 18:27:41 +0200 Subject: [PATCH 031/118] Add namespaces to GigPlayer plugin. --- plugins/GigPlayer/GigPlayer.cpp | 15 +++++++++++++-- plugins/GigPlayer/GigPlayer.h | 28 ++++++++++++++++++++++------ plugins/GigPlayer/PatchesDialog.cpp | 6 ++++++ plugins/GigPlayer/PatchesDialog.h | 7 +++++++ 4 files changed, 48 insertions(+), 8 deletions(-) diff --git a/plugins/GigPlayer/GigPlayer.cpp b/plugins/GigPlayer/GigPlayer.cpp index feed428d138..f5adc610cbe 100644 --- a/plugins/GigPlayer/GigPlayer.cpp +++ b/plugins/GigPlayer/GigPlayer.cpp @@ -56,6 +56,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -704,9 +708,9 @@ void GigInstrument::deleteNotePluginData( NotePlayHandle * _n ) -PluginView * GigInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* GigInstrument::instantiateView( QWidget * _parent ) { - return new GigInstrumentView( this, _parent ); + return new gui::GigInstrumentView( this, _parent ); } @@ -908,6 +912,9 @@ void GigInstrument::updateSampleRate() +namespace gui +{ + class gigKnob : public Knob { @@ -1095,6 +1102,7 @@ void GigInstrumentView::showPatchDialog() } +} // namespace gui // Store information related to playing a sample from the GIG file @@ -1397,3 +1405,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } } + + +} // namespace lmms diff --git a/plugins/GigPlayer/GigPlayer.h b/plugins/GigPlayer/GigPlayer.h index b9467b91bbf..4dacfe8014c 100644 --- a/plugins/GigPlayer/GigPlayer.h +++ b/plugins/GigPlayer/GigPlayer.h @@ -41,11 +41,21 @@ #include "MemoryManager.h" #include "gig.h" -class GigInstrumentView; + +class QLabel; + + +namespace lmms +{ + + class NotePlayHandle; +namespace gui +{ class PatchesDialog; -class QLabel; +class GigInstrumentView; +} @@ -261,7 +271,7 @@ class GigInstrument : public Instrument return IsSingleStreamed|IsNotBendable; } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); QString getCurrentPatchName(); @@ -283,8 +293,8 @@ public slots: // Part of the UI QString m_filename; - LcdSpinBoxModel m_bankNum; - LcdSpinBoxModel m_patchNum; + gui::LcdSpinBoxModel m_bankNum; + gui::LcdSpinBoxModel m_patchNum; FloatModel m_gain; @@ -322,7 +332,7 @@ public slots: // samples void addSamples( GigNote & gignote, bool wantReleaseSample ); - friend class GigInstrumentView; + friend class gui::GigInstrumentView; signals: void fileLoading(); @@ -332,6 +342,8 @@ public slots: } ; +namespace gui +{ class GigInstrumentView : public InstrumentViewFixedSize @@ -367,4 +379,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/GigPlayer/PatchesDialog.cpp b/plugins/GigPlayer/PatchesDialog.cpp index 3d75dd21671..a5066c2af8f 100644 --- a/plugins/GigPlayer/PatchesDialog.cpp +++ b/plugins/GigPlayer/PatchesDialog.cpp @@ -27,6 +27,9 @@ #include +namespace lmms::gui +{ + // Custom list-view item (as for numerical sort purposes...) class PatchItem : public QTreeWidgetItem @@ -408,3 +411,6 @@ void PatchesDialog::progChanged( QTreeWidgetItem * curr, QTreeWidgetItem * prev // Stabilize the form. stabilizeForm(); } + + +} // namespace lmms::gui diff --git a/plugins/GigPlayer/PatchesDialog.h b/plugins/GigPlayer/PatchesDialog.h index ae00f660aaf..c43b4cb5c9f 100644 --- a/plugins/GigPlayer/PatchesDialog.h +++ b/plugins/GigPlayer/PatchesDialog.h @@ -36,6 +36,10 @@ //---------------------------------------------------------------------------- // qsynthPresetForm -- UI wrapper form. +namespace lmms::gui +{ + + class PatchesDialog : public QDialog, private Ui::PatchesDialog { Q_OBJECT @@ -88,4 +92,7 @@ protected slots: QLabel * m_patchLabel; }; + +} // namespace lmms::gui + #endif From 450aab58a2896fe1349771614f2e831d956ca1e7 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 18:29:59 +0200 Subject: [PATCH 032/118] Add namespaces to HydrogenImport plugin. --- plugins/HydrogenImport/HydrogenImport.cpp | 7 +++++++ plugins/HydrogenImport/HydrogenImport.h | 9 ++++++++- plugins/HydrogenImport/LocalFileMng.h | 8 ++++++++ plugins/HydrogenImport/local_file_mgr.cpp | 5 +++++ 4 files changed, 28 insertions(+), 1 deletion(-) diff --git a/plugins/HydrogenImport/HydrogenImport.cpp b/plugins/HydrogenImport/HydrogenImport.cpp index c1f5deeacf0..b70a259326b 100644 --- a/plugins/HydrogenImport/HydrogenImport.cpp +++ b/plugins/HydrogenImport/HydrogenImport.cpp @@ -22,6 +22,11 @@ #include "plugin_export.h" #define MAX_LAYERS 4 + +namespace lmms +{ + + extern "C" { @@ -357,3 +362,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *, void * _data ) } + +} // namespace lmms diff --git a/plugins/HydrogenImport/HydrogenImport.h b/plugins/HydrogenImport/HydrogenImport.h index 9818a136619..905c72b24a9 100644 --- a/plugins/HydrogenImport/HydrogenImport.h +++ b/plugins/HydrogenImport/HydrogenImport.h @@ -7,6 +7,9 @@ #include "ImportFilter.h" +namespace lmms +{ + class HydrogenImport : public ImportFilter { @@ -16,12 +19,16 @@ class HydrogenImport : public ImportFilter virtual ~HydrogenImport(); - virtual PluginView * instantiateView( QWidget * ) + virtual gui::PluginView* instantiateView( QWidget * ) { return( nullptr ); } private: virtual bool tryImport( TrackContainer* tc ); }; + + +} // namespace lmms + #endif diff --git a/plugins/HydrogenImport/LocalFileMng.h b/plugins/HydrogenImport/LocalFileMng.h index 217f95f346f..0aaf7d1c855 100644 --- a/plugins/HydrogenImport/LocalFileMng.h +++ b/plugins/HydrogenImport/LocalFileMng.h @@ -7,6 +7,10 @@ #include #include +namespace lmms +{ + + class LocalFileMng { public: @@ -25,5 +29,9 @@ class LocalFileMng static QDomDocument openXmlDocument( const QString& filename ); std::vector m_allPatternList; }; + + +} // namespace lmms + #endif //LFILEMNG_H diff --git a/plugins/HydrogenImport/local_file_mgr.cpp b/plugins/HydrogenImport/local_file_mgr.cpp index 78560fef942..2b0cc8ad04e 100644 --- a/plugins/HydrogenImport/local_file_mgr.cpp +++ b/plugins/HydrogenImport/local_file_mgr.cpp @@ -13,6 +13,9 @@ #include #include "LocalFileMng.h" +namespace lmms +{ + /* New QtXml based methods */ @@ -232,3 +235,5 @@ QDomDocument LocalFileMng::openXmlDocument( const QString& filename ) return doc; } + +} // namespace lmms From efe38ab9cb9c7994da94754a758c07800946fd63 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 18:37:16 +0200 Subject: [PATCH 033/118] Add namespaces to Kicker plugin. --- plugins/kicker/KickerOsc.h | 5 +++++ plugins/kicker/kicker.cpp | 15 ++++++++++----- plugins/kicker/kicker.h | 19 ++++++++++++++++--- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/plugins/kicker/KickerOsc.h b/plugins/kicker/KickerOsc.h index 1375725b32e..3a263ffc878 100644 --- a/plugins/kicker/KickerOsc.h +++ b/plugins/kicker/KickerOsc.h @@ -33,6 +33,9 @@ #include "interpolation.h" #include "MemoryManager.h" +namespace lmms +{ + template class KickerOsc @@ -107,4 +110,6 @@ class KickerOsc }; +} // namespace lmms + #endif diff --git a/plugins/kicker/kicker.cpp b/plugins/kicker/kicker.cpp index 1867f6f3b2f..c6c58f4ff7c 100644 --- a/plugins/kicker/kicker.cpp +++ b/plugins/kicker/kicker.cpp @@ -38,6 +38,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -218,12 +222,14 @@ void kickerInstrument::deleteNotePluginData( NotePlayHandle * _n ) -PluginView * kickerInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* kickerInstrument::instantiateView( QWidget * _parent ) { - return new kickerInstrumentView( this, _parent ); + return new gui::kickerInstrumentView( this, _parent ); } +namespace gui +{ class kickerKnob : public Knob @@ -359,7 +365,7 @@ void kickerInstrumentView::modelChanged() } - +} // namespace gui extern "C" @@ -375,5 +381,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * m, void * ) } - - +} // namespace lmms diff --git a/plugins/kicker/kicker.h b/plugins/kicker/kicker.h index 22b2b854fa7..9078f166bbd 100644 --- a/plugins/kicker/kicker.h +++ b/plugins/kicker/kicker.h @@ -35,12 +35,19 @@ #include "TempoSyncKnob.h" +namespace lmms +{ + #define KICKER_PRESET_VERSION 1 -class kickerInstrumentView; class NotePlayHandle; +namespace gui +{ +class kickerInstrumentView; +} + class kickerInstrument : public Instrument { @@ -68,7 +75,7 @@ class kickerInstrument : public Instrument return( 512 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); private: @@ -88,11 +95,14 @@ class kickerInstrument : public Instrument IntModel m_versionModel; - friend class kickerInstrumentView; + friend class gui::kickerInstrumentView; } ; +namespace gui +{ + class kickerInstrumentView : public InstrumentViewFixedSize { @@ -121,5 +131,8 @@ class kickerInstrumentView : public InstrumentViewFixedSize } ; +} // namespace gui + +} // namespace lmms #endif From 0962782369d31ebc2af8794366ef5e7147ef5c28 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 18:44:10 +0200 Subject: [PATCH 034/118] Add namespaces to LADSPA Browser plugin --- plugins/ladspa_browser/ladspa_browser.cpp | 10 +++++++--- plugins/ladspa_browser/ladspa_browser.h | 20 +++++++++++++++---- plugins/ladspa_browser/ladspa_description.cpp | 7 ++++--- plugins/ladspa_browser/ladspa_description.h | 5 ++++- plugins/ladspa_browser/ladspa_port_dialog.cpp | 7 ++++--- plugins/ladspa_browser/ladspa_port_dialog.h | 5 +++-- 6 files changed, 38 insertions(+), 16 deletions(-) diff --git a/plugins/ladspa_browser/ladspa_browser.cpp b/plugins/ladspa_browser/ladspa_browser.cpp index 193b1d4b360..dacb567ea1a 100644 --- a/plugins/ladspa_browser/ladspa_browser.cpp +++ b/plugins/ladspa_browser/ladspa_browser.cpp @@ -41,6 +41,9 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + extern "C" { @@ -93,7 +96,8 @@ QString ladspaBrowser::nodeName() const - +namespace gui +{ ladspaBrowserView::ladspaBrowserView( ToolPlugin * _tool ) : @@ -206,6 +210,6 @@ void ladspaBrowserView::showPorts( const ladspa_key_t & _key ) } +} // namespace gui - - +} // namespace lmms diff --git a/plugins/ladspa_browser/ladspa_browser.h b/plugins/ladspa_browser/ladspa_browser.h index 3d9679394f8..f9c60619d75 100644 --- a/plugins/ladspa_browser/ladspa_browser.h +++ b/plugins/ladspa_browser/ladspa_browser.h @@ -31,9 +31,16 @@ #include "ToolPlugin.h" #include "ToolPluginView.h" -class TabBar; +namespace lmms +{ + + +namespace gui +{ +class TabBar; + class ladspaBrowserView : public ToolPluginView { Q_OBJECT @@ -52,7 +59,10 @@ public slots: QWidget * createTab( QWidget * _parent, const QString & _txt, ladspaPluginType _type ); -} ; +}; + + +} // namespace gui class ladspaBrowser : public ToolPlugin @@ -61,9 +71,9 @@ class ladspaBrowser : public ToolPlugin ladspaBrowser(); virtual ~ladspaBrowser(); - virtual PluginView * instantiateView( QWidget * ) + virtual gui::PluginView* instantiateView( QWidget * ) { - return new ladspaBrowserView( this ); + return new gui::ladspaBrowserView( this ); } virtual QString nodeName() const; @@ -83,4 +93,6 @@ class ladspaBrowser : public ToolPlugin } ; +} // namespace lmms + #endif diff --git a/plugins/ladspa_browser/ladspa_description.cpp b/plugins/ladspa_browser/ladspa_description.cpp index da195546c0f..25786b99b2e 100644 --- a/plugins/ladspa_browser/ladspa_description.cpp +++ b/plugins/ladspa_browser/ladspa_description.cpp @@ -36,6 +36,9 @@ #include "Ladspa2LMMS.h" +namespace lmms::gui +{ + ladspaDescription::ladspaDescription( QWidget * _parent, ladspaPluginType _type ) : @@ -215,6 +218,4 @@ void ladspaDescription::onDoubleClicked( QListWidgetItem * _item ) } - - - +} // namespace lmms::gui diff --git a/plugins/ladspa_browser/ladspa_description.h b/plugins/ladspa_browser/ladspa_description.h index 2f88afb4733..b043ef8abc7 100644 --- a/plugins/ladspa_browser/ladspa_description.h +++ b/plugins/ladspa_browser/ladspa_description.h @@ -35,6 +35,9 @@ class QListWidgetItem; class QScrollArea; +namespace lmms::gui +{ + class ladspaDescription : public QWidget { @@ -64,6 +67,6 @@ private slots: } ; - +} // namespace lmms::gui #endif diff --git a/plugins/ladspa_browser/ladspa_port_dialog.cpp b/plugins/ladspa_browser/ladspa_port_dialog.cpp index f1301f7440b..a5179b5be22 100644 --- a/plugins/ladspa_browser/ladspa_port_dialog.cpp +++ b/plugins/ladspa_browser/ladspa_port_dialog.cpp @@ -33,6 +33,9 @@ #include "Engine.h" #include "Ladspa2LMMS.h" +namespace lmms::gui +{ + ladspaPortDialog::ladspaPortDialog( const ladspa_key_t & _key ) { @@ -170,6 +173,4 @@ ladspaPortDialog::~ladspaPortDialog() } - - - +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/ladspa_browser/ladspa_port_dialog.h b/plugins/ladspa_browser/ladspa_port_dialog.h index 44892489aef..becfb6faeb9 100644 --- a/plugins/ladspa_browser/ladspa_port_dialog.h +++ b/plugins/ladspa_browser/ladspa_port_dialog.h @@ -31,7 +31,8 @@ #include "LadspaManager.h" - +namespace lmms::gui +{ class ladspaPortDialog : public QDialog @@ -44,6 +45,6 @@ class ladspaPortDialog : public QDialog }; - +} // namespace lmms::gui #endif From b508d518cc6683a62c6b0fc8d76dad3df4439bd3 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 18:51:38 +0200 Subject: [PATCH 035/118] Add namespaces to LADSPA Effect plugin. --- plugins/LadspaEffect/LadspaControlDialog.cpp | 5 +++-- plugins/LadspaEffect/LadspaControlDialog.h | 15 +++++++++++++++ plugins/LadspaEffect/LadspaControls.cpp | 6 ++++-- plugins/LadspaEffect/LadspaControls.h | 12 +++++++++--- plugins/LadspaEffect/LadspaEffect.cpp | 7 +++++-- plugins/LadspaEffect/LadspaEffect.h | 6 ++++++ plugins/LadspaEffect/LadspaSubPluginFeatures.cpp | 5 +++++ plugins/LadspaEffect/LadspaSubPluginFeatures.h | 8 +++++++- 8 files changed, 54 insertions(+), 10 deletions(-) diff --git a/plugins/LadspaEffect/LadspaControlDialog.cpp b/plugins/LadspaEffect/LadspaControlDialog.cpp index 0034dfd6d0c..95cb984ecda 100644 --- a/plugins/LadspaEffect/LadspaControlDialog.cpp +++ b/plugins/LadspaEffect/LadspaControlDialog.cpp @@ -34,6 +34,8 @@ #include "LadspaControlView.h" #include "LedCheckbox.h" +namespace lmms::gui +{ LadspaControlDialog::LadspaControlDialog( LadspaControls * _ctl ) : @@ -144,5 +146,4 @@ void LadspaControlDialog::updateEffectView( LadspaControls * _ctl ) } - - +} // namespace lmms::gui diff --git a/plugins/LadspaEffect/LadspaControlDialog.h b/plugins/LadspaEffect/LadspaControlDialog.h index 86468112ddf..f9726e90d35 100644 --- a/plugins/LadspaEffect/LadspaControlDialog.h +++ b/plugins/LadspaEffect/LadspaControlDialog.h @@ -31,7 +31,17 @@ class QHBoxLayout; + +namespace lmms +{ + class LadspaControls; + + +namespace gui +{ + + class LedCheckBox; @@ -53,4 +63,9 @@ private slots: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/LadspaEffect/LadspaControls.cpp b/plugins/LadspaEffect/LadspaControls.cpp index 028394d309e..6e6ea94bda2 100644 --- a/plugins/LadspaEffect/LadspaControls.cpp +++ b/plugins/LadspaEffect/LadspaControls.cpp @@ -26,6 +26,9 @@ #include "LadspaEffect.h" +namespace lmms +{ + LadspaControls::LadspaControls( LadspaEffect * _eff ) : EffectControls( _eff ), @@ -188,5 +191,4 @@ void LadspaControls::updateLinkStatesFromGlobal() } - - +} // namespace lmms diff --git a/plugins/LadspaEffect/LadspaControls.h b/plugins/LadspaEffect/LadspaControls.h index 013b914d45d..44754ab5b09 100644 --- a/plugins/LadspaEffect/LadspaControls.h +++ b/plugins/LadspaEffect/LadspaControls.h @@ -29,6 +29,9 @@ #include "LadspaControl.h" #include "LadspaControlDialog.h" +namespace lmms +{ + typedef QVector control_list_t; @@ -54,9 +57,9 @@ class LadspaControls : public EffectControls return "ladspacontrols"; } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return new LadspaControlDialog( this ); + return new gui::LadspaControlDialog( this ); } @@ -75,7 +78,7 @@ protected slots: QVector m_controls; - friend class LadspaControlDialog; + friend class gui::LadspaControlDialog; friend class LadspaEffect; @@ -84,4 +87,7 @@ protected slots: } ; + +} // namespace lmms + #endif diff --git a/plugins/LadspaEffect/LadspaEffect.cpp b/plugins/LadspaEffect/LadspaEffect.cpp index c571a582763..ba279822bef 100644 --- a/plugins/LadspaEffect/LadspaEffect.cpp +++ b/plugins/LadspaEffect/LadspaEffect.cpp @@ -46,6 +46,10 @@ #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -606,5 +610,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * _parent, void * _data ) } - - +} // namespace lmms diff --git a/plugins/LadspaEffect/LadspaEffect.h b/plugins/LadspaEffect/LadspaEffect.h index e9f8eef7be1..e41bbb13089 100644 --- a/plugins/LadspaEffect/LadspaEffect.h +++ b/plugins/LadspaEffect/LadspaEffect.h @@ -32,6 +32,9 @@ #include "LadspaBase.h" #include "LadspaControls.h" +namespace lmms +{ + typedef QVector multi_proc_t; @@ -86,4 +89,7 @@ private slots: } ; + +} // namespace lmms + #endif diff --git a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp index dfd302d6ce5..15b3edf684b 100644 --- a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp +++ b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp @@ -35,6 +35,9 @@ #include "Ladspa2LMMS.h" #include "LadspaBase.h" +namespace lmms +{ + LadspaSubPluginFeatures::LadspaSubPluginFeatures( Plugin::PluginTypes _type ) : SubPluginFeatures( _type ) @@ -178,3 +181,5 @@ ladspa_key_t LadspaSubPluginFeatures::subPluginKeyToLadspaKey( , _key->attributes["plugin"] ) ); } + +} // namespace lmms diff --git a/plugins/LadspaEffect/LadspaSubPluginFeatures.h b/plugins/LadspaEffect/LadspaSubPluginFeatures.h index 3f47734f9c8..36edeebd36d 100644 --- a/plugins/LadspaEffect/LadspaSubPluginFeatures.h +++ b/plugins/LadspaEffect/LadspaSubPluginFeatures.h @@ -31,6 +31,9 @@ #include "LadspaManager.h" #include "Plugin.h" +namespace lmms +{ + class LadspaSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures { @@ -47,6 +50,9 @@ class LadspaSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures static ladspa_key_t subPluginKeyToLadspaKey( const Key * _key ); -} ; +}; + + +} // namespace lmms #endif From 076ef6fced6a95c84cbeecccaa0b6086efad268e Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 18:55:18 +0200 Subject: [PATCH 036/118] Add namespaces to LB302 plugin. --- plugins/lb302/lb302.cpp | 14 ++++++++++++-- plugins/lb302/lb302.h | 25 ++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 5 deletions(-) diff --git a/plugins/lb302/lb302.cpp b/plugins/lb302/lb302.cpp index 2385073b23b..ecf12d8601a 100644 --- a/plugins/lb302/lb302.cpp +++ b/plugins/lb302/lb302.cpp @@ -72,6 +72,9 @@ // Old config // +namespace lmms +{ + //#define engine::audioEngine()->processingSampleRate() 44100.0f const float sampleRateCutoff = 44100.0f; @@ -806,12 +809,16 @@ void lb302Synth::deleteNotePluginData( NotePlayHandle * _n ) } -PluginView * lb302Synth::instantiateView( QWidget * _parent ) +gui::PluginView* lb302Synth::instantiateView( QWidget * _parent ) { - return( new lb302SynthView( this, _parent ) ); + return( new gui::lb302SynthView( this, _parent ) ); } +namespace gui +{ + + lb302SynthView::lb302SynthView( Instrument * _instrument, QWidget * _parent ) : InstrumentViewFixedSize( _instrument, _parent ) { @@ -1033,6 +1040,8 @@ void lb302SynthView::modelChanged() } +} // namespace gui + extern "C" { @@ -1049,3 +1058,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * m, void * ) } +} // namespace lmms diff --git a/plugins/lb302/lb302.h b/plugins/lb302/lb302.h index 557d958d462..f12fa0379f0 100644 --- a/plugins/lb302/lb302.h +++ b/plugins/lb302/lb302.h @@ -40,11 +40,21 @@ #include "NotePlayHandle.h" #include +namespace lmms +{ + + static const int NUM_FILTERS = 2; -class lb302SynthView; class NotePlayHandle; + +namespace gui +{ +class lb302SynthView; +} + + class lb302FilterKnobState { public: @@ -162,7 +172,7 @@ class lb302Synth : public Instrument return 0; //4048; } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); private: void processNote( NotePlayHandle * n ); @@ -248,7 +258,7 @@ public slots: int process(sampleFrame *outbuf, const int size); - friend class lb302SynthView; + friend class gui::lb302SynthView; NotePlayHandle * m_playingNote; NotePlayHandleList m_notes; @@ -256,6 +266,10 @@ public slots: } ; +namespace gui +{ + + class lb302SynthView : public InstrumentViewFixedSize { Q_OBJECT @@ -283,4 +297,9 @@ class lb302SynthView : public InstrumentViewFixedSize } ; + +} // namespace gui + +} // namespace lmms + #endif From db466196b136b467995a122dfa154f809361d6bf Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 19:10:27 +0200 Subject: [PATCH 037/118] Add namespace to Lv2Effect plugin. --- plugins/Lv2Effect/Lv2Effect.cpp | 5 +++++ plugins/Lv2Effect/Lv2Effect.h | 7 +++++++ plugins/Lv2Effect/Lv2FxControlDialog.cpp | 4 ++++ plugins/Lv2Effect/Lv2FxControlDialog.h | 9 +++++++++ plugins/Lv2Effect/Lv2FxControls.cpp | 8 +++++--- plugins/Lv2Effect/Lv2FxControls.h | 16 ++++++++++++++-- 6 files changed, 44 insertions(+), 5 deletions(-) diff --git a/plugins/Lv2Effect/Lv2Effect.cpp b/plugins/Lv2Effect/Lv2Effect.cpp index ddec187bbfc..b8b9de8eea6 100644 --- a/plugins/Lv2Effect/Lv2Effect.cpp +++ b/plugins/Lv2Effect/Lv2Effect.cpp @@ -33,6 +33,8 @@ #include "plugin_export.h" +namespace lmms +{ extern "C" @@ -115,3 +117,6 @@ PLUGIN_EXPORT Plugin *lmms_plugin_main(Model *_parent, void *_data) } } + + +} // namespace lmms diff --git a/plugins/Lv2Effect/Lv2Effect.h b/plugins/Lv2Effect/Lv2Effect.h index 77792d428a1..5df4ba9d21e 100644 --- a/plugins/Lv2Effect/Lv2Effect.h +++ b/plugins/Lv2Effect/Lv2Effect.h @@ -28,6 +28,10 @@ #include "Effect.h" #include "Lv2FxControls.h" +namespace lmms +{ + + class Lv2Effect : public Effect { Q_OBJECT @@ -51,4 +55,7 @@ class Lv2Effect : public Effect std::vector m_tmpOutputSmps; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/plugins/Lv2Effect/Lv2FxControlDialog.cpp b/plugins/Lv2Effect/Lv2FxControlDialog.cpp index 9a77171d6df..07bea1bca9e 100644 --- a/plugins/Lv2Effect/Lv2FxControlDialog.cpp +++ b/plugins/Lv2Effect/Lv2FxControlDialog.cpp @@ -31,6 +31,9 @@ #include "Lv2Effect.h" #include "Lv2FxControls.h" +namespace lmms::gui +{ + Lv2FxControlDialog::Lv2FxControlDialog(Lv2FxControls *controls) : EffectControlDialog(controls), @@ -70,3 +73,4 @@ void Lv2FxControlDialog::modelChanged() } +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/Lv2Effect/Lv2FxControlDialog.h b/plugins/Lv2Effect/Lv2FxControlDialog.h index 3abdb300d4d..c749dc12413 100644 --- a/plugins/Lv2Effect/Lv2FxControlDialog.h +++ b/plugins/Lv2Effect/Lv2FxControlDialog.h @@ -28,8 +28,13 @@ #include "EffectControlDialog.h" #include "Lv2ViewBase.h" +namespace lmms +{ + class Lv2FxControls; +namespace gui +{ class Lv2FxControlDialog : public EffectControlDialog, public Lv2ViewBase { @@ -44,4 +49,8 @@ class Lv2FxControlDialog : public EffectControlDialog, public Lv2ViewBase }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Lv2Effect/Lv2FxControls.cpp b/plugins/Lv2Effect/Lv2FxControls.cpp index 56469d3ccf8..5e241a924c6 100644 --- a/plugins/Lv2Effect/Lv2FxControls.cpp +++ b/plugins/Lv2Effect/Lv2FxControls.cpp @@ -31,7 +31,8 @@ #include "Lv2FxControlDialog.h" #include "Lv2Proc.h" - +namespace lmms +{ Lv2FxControls::Lv2FxControls(class Lv2Effect *effect, const QString& uri) : @@ -72,9 +73,9 @@ int Lv2FxControls::controlCount() -EffectControlDialog *Lv2FxControls::createView() +gui::EffectControlDialog *Lv2FxControls::createView() { - return new Lv2FxControlDialog(this); + return new gui::Lv2FxControlDialog(this); } @@ -102,3 +103,4 @@ void Lv2FxControls::setNameFromFile(const QString &name) } +} // namespace lmms diff --git a/plugins/Lv2Effect/Lv2FxControls.h b/plugins/Lv2Effect/Lv2FxControls.h index e5449a4f7fe..952e4db6c11 100644 --- a/plugins/Lv2Effect/Lv2FxControls.h +++ b/plugins/Lv2Effect/Lv2FxControls.h @@ -28,8 +28,17 @@ #include "EffectControls.h" #include "Lv2ControlBase.h" +namespace lmms +{ + + class Lv2Effect; +namespace gui +{ +class Lv2FxControlDialog; +} + class Lv2FxControls : public EffectControls, public Lv2ControlBase { @@ -45,7 +54,7 @@ class Lv2FxControls : public EffectControls, public Lv2ControlBase } int controlCount() override; - EffectControlDialog *createView() override; + gui::EffectControlDialog* createView() override; private slots: void changeControl(); @@ -54,8 +63,11 @@ private slots: DataFile::Types settingsType() override; void setNameFromFile(const QString &name) override; - friend class Lv2FxControlDialog; + friend class gui::Lv2FxControlDialog; friend class Lv2Effect; }; + +} // namespace lmms + #endif From 8dcce589d1c3c146261017718194601639cfc2d7 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 19:14:30 +0200 Subject: [PATCH 038/118] Add namespace to Lv2Instrument plugin. --- plugins/Lv2Instrument/Lv2Instrument.cpp | 14 ++++++-- plugins/Lv2Instrument/Lv2Instrument.h | 46 ++++++++++++++++--------- 2 files changed, 41 insertions(+), 19 deletions(-) diff --git a/plugins/Lv2Instrument/Lv2Instrument.cpp b/plugins/Lv2Instrument/Lv2Instrument.cpp index b94e30aef02..f7e0a2b37ea 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.cpp +++ b/plugins/Lv2Instrument/Lv2Instrument.cpp @@ -40,6 +40,8 @@ #include "plugin_export.h" +namespace lmms +{ extern "C" @@ -173,9 +175,9 @@ void Lv2Instrument::play(sampleFrame *buf) -PluginView *Lv2Instrument::instantiateView(QWidget *parent) +gui::PluginView* Lv2Instrument::instantiateView(QWidget *parent) { - return new Lv2InsView(this, parent); + return new gui::Lv2InsView(this, parent); } @@ -213,6 +215,9 @@ void Lv2Instrument::setNameFromFile(const QString &name) +namespace gui +{ + /* Lv2InsView @@ -285,7 +290,7 @@ void Lv2InsView::modelChanged() } - +} // namespace gui extern "C" { @@ -302,3 +307,6 @@ PLUGIN_EXPORT Plugin *lmms_plugin_main(Model *_parent, void *_data) } } + + +} // namespace lmms diff --git a/plugins/Lv2Instrument/Lv2Instrument.h b/plugins/Lv2Instrument/Lv2Instrument.h index 00a0f35fbe3..12ef63e15a6 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.h +++ b/plugins/Lv2Instrument/Lv2Instrument.h @@ -37,6 +37,33 @@ // currently only MIDI works #define LV2_INSTRUMENT_USE_MIDI +namespace lmms +{ + +class Lv2Instrument; + +namespace gui +{ + + +class Lv2InsView : public InstrumentView, public Lv2ViewBase +{ +Q_OBJECT +public: + Lv2InsView(Lv2Instrument *_instrument, QWidget *_parent); + +protected: + void dragEnterEvent(QDragEnterEvent *_dee) override; + void dropEvent(QDropEvent *_de) override; + +private: + void modelChanged() override; +}; + + +} // namespace gui + + class Lv2Instrument : public Instrument, public Lv2ControlBase { @@ -81,7 +108,7 @@ class Lv2Instrument : public Instrument, public Lv2ControlBase return IsSingleStreamed; #endif } - PluginView *instantiateView(QWidget *parent) override; + gui::PluginView* instantiateView(QWidget *parent) override; private slots: void updatePitchRange(); @@ -95,23 +122,10 @@ private slots: int m_runningNotes[NumKeys]; #endif - friend class Lv2InsView; + friend class gui::Lv2InsView; }; -class Lv2InsView : public InstrumentView, public Lv2ViewBase -{ - Q_OBJECT -public: - Lv2InsView(Lv2Instrument *_instrument, QWidget *_parent); - -protected: - void dragEnterEvent(QDragEnterEvent *_dee) override; - void dropEvent(QDropEvent *_de) override; - -private: - void modelChanged() override; -}; - +} // namespace lmms #endif // LV2_INSTRUMENT_H From 3c33cf8a095ab88fa591245b9d37ebaa3ca6ffb7 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 19:18:59 +0200 Subject: [PATCH 039/118] Add namespaces to Midi Import & Export plugins. (And played canyon.mid to celebrate the occasion.) --- plugins/MidiExport/MidiExport.cpp | 6 ++++++ plugins/MidiExport/MidiExport.h | 7 ++++++- plugins/MidiImport/MidiImport.cpp | 6 ++++++ plugins/MidiImport/MidiImport.h | 7 ++++++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/plugins/MidiExport/MidiExport.cpp b/plugins/MidiExport/MidiExport.cpp index cdd8bb0fae1..491fde25240 100644 --- a/plugins/MidiExport/MidiExport.cpp +++ b/plugins/MidiExport/MidiExport.cpp @@ -41,6 +41,10 @@ #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -357,3 +361,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *, void * _data ) } + +} // namespace lmms diff --git a/plugins/MidiExport/MidiExport.h b/plugins/MidiExport/MidiExport.h index 3c36eeb8f55..9ffd25a0c3c 100644 --- a/plugins/MidiExport/MidiExport.h +++ b/plugins/MidiExport/MidiExport.h @@ -31,6 +31,9 @@ #include "ExportFilter.h" #include "MidiFile.hpp" +namespace lmms +{ + const int BUFFER_SIZE = 50*1024; typedef MidiFile::MIDITrack MTrack; @@ -60,7 +63,7 @@ class MidiExport: public ExportFilter MidiExport(); ~MidiExport(); - virtual PluginView *instantiateView(QWidget *) + virtual gui::PluginView* instantiateView(QWidget *) { return nullptr; } @@ -83,4 +86,6 @@ class MidiExport: public ExportFilter } ; +} // namespace lmms + #endif diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index 1429b41d7cb..3f73c96efb7 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -52,6 +52,10 @@ #include "portsmf/allegro.h" +namespace lmms +{ + + #define makeID(_c0, _c1, _c2, _c3) \ ( 0 | \ ( ( _c0 ) | ( ( _c1 ) << 8 ) | ( ( _c2 ) << 16 ) | ( ( _c3 ) << 24 ) ) ) @@ -656,3 +660,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *, void * _data ) } + +} // namespace lmms diff --git a/plugins/MidiImport/MidiImport.h b/plugins/MidiImport/MidiImport.h index 2edcbe9267e..a7ab478a2b7 100644 --- a/plugins/MidiImport/MidiImport.h +++ b/plugins/MidiImport/MidiImport.h @@ -32,6 +32,9 @@ #include "MidiEvent.h" #include "ImportFilter.h" +namespace lmms +{ + class MidiImport : public ImportFilter { @@ -40,7 +43,7 @@ class MidiImport : public ImportFilter MidiImport( const QString & _file ); virtual ~MidiImport(); - virtual PluginView * instantiateView( QWidget * ) + virtual gui::PluginView* instantiateView( QWidget * ) { return( nullptr ); } @@ -125,4 +128,6 @@ class MidiImport : public ImportFilter } ; +} // namespace lmms + #endif From f632962ee2708d2ac69bc171105618bc2c4d6fa1 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 19:24:35 +0200 Subject: [PATCH 040/118] Add namespaces to Monstro plugin. --- plugins/monstro/Monstro.cpp | 19 +++++++++++++++---- plugins/monstro/Monstro.h | 28 ++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/plugins/monstro/Monstro.cpp b/plugins/monstro/Monstro.cpp index 39f5fa66ecd..b378048d313 100644 --- a/plugins/monstro/Monstro.cpp +++ b/plugins/monstro/Monstro.cpp @@ -38,6 +38,10 @@ #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -1304,9 +1308,9 @@ f_cnt_t MonstroInstrument::desiredReleaseFrames() const } -PluginView * MonstroInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* MonstroInstrument::instantiateView( QWidget * _parent ) { - return( new MonstroView( this, _parent ) ); + return( new gui::MonstroView( this, _parent ) ); } @@ -1445,6 +1449,10 @@ void MonstroInstrument::updateSlope2() } +namespace gui +{ + + MonstroView::MonstroView( Instrument * _instrument, QWidget * _parent ) : InstrumentViewFixedSize( _instrument, _parent ) @@ -1823,6 +1831,10 @@ QWidget * MonstroView::setupMatrixView( QWidget * _parent ) return( view ); } + +} // namespace gui + + extern "C" { @@ -1836,5 +1848,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } - - +} // namespace lmms diff --git a/plugins/monstro/Monstro.h b/plugins/monstro/Monstro.h index c8acde3f02d..bfc1915fbf1 100644 --- a/plugins/monstro/Monstro.h +++ b/plugins/monstro/Monstro.h @@ -66,6 +66,14 @@ name -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "tinyled_off" ) ); \ ToolTip::add( name, ttip ); +namespace lmms +{ + + +namespace gui +{ + + // UI constants const int O1ROW = 22; const int O2ROW = 22 + 39; @@ -108,6 +116,9 @@ const int MATROW6 = 22 + 39*5; const int OPVIEW = 0; const int MATVIEW = 1; + +} // namespace gui + // waveform enumerators const int WAVE_SINE = 0; const int WAVE_TRI = 1; @@ -154,7 +165,11 @@ const float PW_MIN = 0.25f; const float PW_MAX = 100.0f - PW_MIN; class MonstroInstrument; + +namespace gui +{ class MonstroView; +} class MonstroSynth @@ -355,7 +370,7 @@ class MonstroInstrument : public Instrument virtual f_cnt_t desiredReleaseFrames() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); public slots: void updateVolume1(); @@ -564,10 +579,15 @@ public slots: FloatModel m_sub3lfo2; friend class MonstroSynth; - friend class MonstroView; + friend class gui::MonstroView; }; + +namespace gui +{ + + class MonstroView : public InstrumentViewFixedSize { Q_OBJECT @@ -719,4 +739,8 @@ protected slots: }; +} // namespace gui + +} // namespace lmms + #endif From e067dcde8af1f3439c4d454756aae9beeaecf0f6 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 19:30:07 +0200 Subject: [PATCH 041/118] Add namespaces to Multitap Echo plugin. --- plugins/MultitapEcho/MultitapEcho.cpp | 7 +++++++ plugins/MultitapEcho/MultitapEcho.h | 6 ++++++ plugins/MultitapEcho/MultitapEchoControlDialog.cpp | 6 ++++++ plugins/MultitapEcho/MultitapEchoControlDialog.h | 13 +++++++++++++ plugins/MultitapEcho/MultitapEchoControls.cpp | 6 ++++++ plugins/MultitapEcho/MultitapEchoControls.h | 11 ++++++++--- 6 files changed, 46 insertions(+), 3 deletions(-) diff --git a/plugins/MultitapEcho/MultitapEcho.cpp b/plugins/MultitapEcho/MultitapEcho.cpp index 4134436bb42..f3d03740c20 100644 --- a/plugins/MultitapEcho/MultitapEcho.cpp +++ b/plugins/MultitapEcho/MultitapEcho.cpp @@ -27,6 +27,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -170,3 +174,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/MultitapEcho/MultitapEcho.h b/plugins/MultitapEcho/MultitapEcho.h index 0735fada0a1..9f066a21253 100644 --- a/plugins/MultitapEcho/MultitapEcho.h +++ b/plugins/MultitapEcho/MultitapEcho.h @@ -33,6 +33,10 @@ #include "lmms_math.h" #include "BasicFilters.h" +namespace lmms +{ + + class MultitapEchoEffect : public Effect { public: @@ -75,4 +79,6 @@ class MultitapEchoEffect : public Effect }; +} // namespace lmms + #endif diff --git a/plugins/MultitapEcho/MultitapEchoControlDialog.cpp b/plugins/MultitapEcho/MultitapEchoControlDialog.cpp index 20018ddc5d1..d3376e5a93c 100644 --- a/plugins/MultitapEcho/MultitapEchoControlDialog.cpp +++ b/plugins/MultitapEcho/MultitapEchoControlDialog.cpp @@ -36,6 +36,9 @@ #include "TempoSyncKnob.h" #include "LcdSpinBox.h" +namespace lmms::gui +{ + MultitapEchoControlDialog::MultitapEchoControlDialog( MultitapEchoControls * controls ) : EffectControlDialog( controls ) @@ -102,3 +105,6 @@ MultitapEchoControlDialog::MultitapEchoControlDialog( MultitapEchoControls * con swapInputs->setModel( & controls->m_swapInputs ); ToolTip::add( swapInputs, tr( "Swap left and right input channels for reflections" ) ); } + + +} // namespace lmms::gui diff --git a/plugins/MultitapEcho/MultitapEchoControlDialog.h b/plugins/MultitapEcho/MultitapEchoControlDialog.h index 5ea09877e9f..6104d433eea 100644 --- a/plugins/MultitapEcho/MultitapEchoControlDialog.h +++ b/plugins/MultitapEcho/MultitapEchoControlDialog.h @@ -29,8 +29,16 @@ #include "EffectControlDialog.h" +namespace lmms +{ + + class MultitapEchoControls; +namespace gui +{ + + class MultitapEchoControlDialog : public EffectControlDialog { Q_OBJECT @@ -41,4 +49,9 @@ class MultitapEchoControlDialog : public EffectControlDialog } }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/MultitapEcho/MultitapEchoControls.cpp b/plugins/MultitapEcho/MultitapEchoControls.cpp index 4f2fe63fe4d..4382151af8b 100644 --- a/plugins/MultitapEcho/MultitapEchoControls.cpp +++ b/plugins/MultitapEcho/MultitapEchoControls.cpp @@ -31,6 +31,9 @@ #include "lmms_math.h" #include "base64.h" +namespace lmms +{ + MultitapEchoControls::MultitapEchoControls( MultitapEchoEffect * eff ) : EffectControls( eff ), @@ -178,3 +181,6 @@ void MultitapEchoControls::sampleRateChanged() m_effect->m_sampleRatio = 1.0f / m_effect->m_sampleRate; m_effect->updateFilters( 0, 19 ); } + + +} // namespace lmms diff --git a/plugins/MultitapEcho/MultitapEchoControls.h b/plugins/MultitapEcho/MultitapEchoControls.h index cbecb1b3d80..dac5bc97afa 100644 --- a/plugins/MultitapEcho/MultitapEchoControls.h +++ b/plugins/MultitapEcho/MultitapEchoControls.h @@ -31,6 +31,9 @@ #include "Knob.h" #include "Graph.h" +namespace lmms +{ + class MultitapEchoEffect; @@ -56,9 +59,9 @@ class MultitapEchoControls : public EffectControls return( 5 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return( new MultitapEchoControlDialog( this ) ); + return( new gui::MultitapEchoControlDialog( this ) ); } private slots: @@ -84,8 +87,10 @@ private slots: graphModel m_lpGraph; friend class MultitapEchoEffect; - friend class MultitapEchoControlDialog; + friend class gui::MultitapEchoControlDialog; }; +} // namespace lmms + #endif From 71c1affd0465ef0bf23920887192b64402be3432 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 19:34:40 +0200 Subject: [PATCH 042/118] Add namespaces to NEScaline plugin. --- plugins/nes/Nes.cpp | 15 ++++++++++++--- plugins/nes/Nes.h | 23 +++++++++++++++++++++-- 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/plugins/nes/Nes.cpp b/plugins/nes/Nes.cpp index 637fbfcd30e..90925eed7c0 100644 --- a/plugins/nes/Nes.cpp +++ b/plugins/nes/Nes.cpp @@ -37,6 +37,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -700,9 +704,9 @@ QString NesInstrument::nodeName() const } -PluginView * NesInstrument::instantiateView( QWidget * parent ) +gui::PluginView* NesInstrument::instantiateView( QWidget * parent ) { - return( new NesInstrumentView( this, parent ) ); + return( new gui::NesInstrumentView( this, parent ) ); } @@ -725,6 +729,8 @@ void NesInstrument::updateFreq3() } +namespace gui +{ QPixmap * NesInstrumentView::s_artwork = nullptr; @@ -913,6 +919,9 @@ void NesInstrumentView::modelChanged() } +} // namespace gui + + extern "C" { @@ -926,4 +935,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * _data ) } - +} // namespace lmms diff --git a/plugins/nes/Nes.h b/plugins/nes/Nes.h index 1646bae310d..75390452ca1 100644 --- a/plugins/nes/Nes.h +++ b/plugins/nes/Nes.h @@ -37,6 +37,10 @@ #include "MemoryManager.h" +namespace lmms +{ + + #define makeknob( name, x, y, hint, unit, oname ) \ name = new Knob( knobStyled, this ); \ name ->move( x, y ); \ @@ -81,6 +85,12 @@ const int MIN_WLEN = 4; class NesInstrument; +namespace gui +{ +class NesInstrumentView; +} // namespace gui + + class NesObject { MM_OPERATORS @@ -220,7 +230,7 @@ class NesInstrument : public Instrument return( 8 ); } - virtual PluginView * instantiateView( QWidget * parent ); + virtual gui::PluginView* instantiateView( QWidget * parent ); public slots: void updateFreq1(); @@ -290,10 +300,14 @@ public slots: friend class NesObject; - friend class NesInstrumentView; + friend class gui::NesInstrumentView; }; +namespace gui +{ + + class NesInstrumentView : public InstrumentViewFixedSize { Q_OBJECT @@ -362,4 +376,9 @@ class NesInstrumentView : public InstrumentViewFixedSize static QPixmap * s_artwork; }; + +} // namespace gui + +} // namespace lmms + #endif From f2624e8fe76e6485332a6dd612e2092bd67245c7 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 23:25:41 +0200 Subject: [PATCH 043/118] Add namespaces to OpulenZ plugin. --- plugins/OpulenZ/OpulenZ.cpp | 13 ++++++++++--- plugins/OpulenZ/OpulenZ.h | 14 +++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/plugins/OpulenZ/OpulenZ.cpp b/plugins/OpulenZ/OpulenZ.cpp index fa3a6bbdd01..74e71f27315 100644 --- a/plugins/OpulenZ/OpulenZ.cpp +++ b/plugins/OpulenZ/OpulenZ.cpp @@ -61,6 +61,10 @@ #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -391,9 +395,9 @@ QString OpulenzInstrument::nodeName() const return( opulenz_plugin_descriptor.name ); } -PluginView * OpulenzInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* OpulenzInstrument::instantiateView( QWidget * _parent ) { - return( new OpulenzInstrumentView( this, _parent ) ); + return( new gui::OpulenzInstrumentView( this, _parent ) ); } @@ -676,7 +680,8 @@ void OpulenzInstrument::loadFile( const QString& file ) { - +namespace gui +{ OpulenzInstrumentView::OpulenzInstrumentView( Instrument * _instrument, QWidget * _parent ) : @@ -873,4 +878,6 @@ void OpulenzInstrumentView::modelChanged() } +} // namespace gui +} // namespace lmms diff --git a/plugins/OpulenZ/OpulenZ.h b/plugins/OpulenZ/OpulenZ.h index 1776df93fa9..23807eb9805 100644 --- a/plugins/OpulenZ/OpulenZ.h +++ b/plugins/OpulenZ/OpulenZ.h @@ -33,6 +33,10 @@ #include "Knob.h" #include "PixmapButton.h" +namespace lmms +{ + + // This one is a flag, MIDI notes take 7 low bits #define OPL2_VOICE_FREE 128 #define OPL2_NO_VOICE 255 @@ -49,7 +53,7 @@ class OpulenzInstrument : public Instrument virtual ~OpulenzInstrument(); virtual QString nodeName() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); virtual Flags flags() const { @@ -141,6 +145,9 @@ private slots: }; +namespace gui +{ + class OpulenzInstrumentView : public InstrumentViewFixedSize { @@ -200,4 +207,9 @@ class OpulenzInstrumentView : public InstrumentViewFixedSize }; + +} // namespace gui + +} // namespace lmms + #endif From 1e674f34523fe45ea19c83108dff8d3d98bf85c8 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 23:30:57 +0200 Subject: [PATCH 044/118] Add namespaces to Organic plugin. --- plugins/organic/organic.cpp | 17 ++++++++++------- plugins/organic/organic.h | 24 ++++++++++++++++++++---- 2 files changed, 30 insertions(+), 11 deletions(-) diff --git a/plugins/organic/organic.cpp b/plugins/organic/organic.cpp index 1dbc06b852f..62d0b5f84f2 100644 --- a/plugins/organic/organic.cpp +++ b/plugins/organic/organic.cpp @@ -43,6 +43,9 @@ #include "plugin_export.h" +namespace lmms +{ + extern "C" { @@ -63,7 +66,6 @@ Plugin::Descriptor PLUGIN_EXPORT organic_plugin_descriptor = } -QPixmap * organicInstrumentView::s_artwork = nullptr; float * organicInstrument::s_harmonics = nullptr; /*********************************************************************** @@ -394,12 +396,14 @@ int organicInstrument::intRand( int min, int max ) } -PluginView * organicInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* organicInstrument::instantiateView( QWidget * _parent ) { - return( new organicInstrumentView( this, _parent ) ); + return( new gui::organicInstrumentView( this, _parent ) ); } +namespace gui +{ class organicKnob : public Knob @@ -413,6 +417,7 @@ class organicKnob : public Knob }; +QPixmap * organicInstrumentView::s_artwork = nullptr; organicInstrumentView::organicInstrumentView( Instrument * _instrument, @@ -559,6 +564,7 @@ void organicInstrumentView::updateKnobHint() } +} // namespace gui OscillatorObject::OscillatorObject( Model * _parent, int _index ) : @@ -629,8 +635,6 @@ void OscillatorObject::updateDetuning() } - - extern "C" { @@ -654,5 +658,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) */ - - +} // namespace lmms diff --git a/plugins/organic/organic.h b/plugins/organic/organic.h index c0bc29f16e8..6eee662f813 100644 --- a/plugins/organic/organic.h +++ b/plugins/organic/organic.h @@ -35,9 +35,18 @@ class QPixmap; -class Knob; +namespace lmms +{ + + class NotePlayHandle; + +namespace gui +{ +class Knob; class PixmapButton; +class organicInstrumentView; +} // namespace gui const int NUM_OSCILLATORS = 8; const int NUM_HARMONICS = 18; @@ -99,7 +108,7 @@ class OscillatorObject : public Model virtual ~OscillatorObject(); friend class organicInstrument; - friend class organicInstrumentView; + friend class gui::organicInstrumentView; private slots: @@ -163,15 +172,18 @@ public slots: FloatModel m_fx1Model; FloatModel m_volModel; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); private slots: void updateAllDetuning(); - friend class organicInstrumentView; + friend class gui::organicInstrumentView; } ; +namespace gui +{ + class organicInstrumentView : public InstrumentViewFixedSize { @@ -225,4 +237,8 @@ protected slots: }; +} // namespace gui + +} // namespace lmms + #endif From 218399e30fbc4f647c813791cf1cffa54c4cf727 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 23:36:19 +0200 Subject: [PATCH 045/118] Add namespaces to Patman plugin. --- plugins/patman/patman.cpp | 16 ++++++++++++---- plugins/patman/patman.h | 17 +++++++++++++++-- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/plugins/patman/patman.cpp b/plugins/patman/patman.cpp index 896b6c330a9..fb21bafbbb6 100644 --- a/plugins/patman/patman.cpp +++ b/plugins/patman/patman.cpp @@ -47,6 +47,9 @@ #include "plugin_export.h" +namespace lmms +{ + extern "C" { @@ -428,9 +431,9 @@ void patmanInstrument::selectSample( NotePlayHandle * _n ) -PluginView * patmanInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* patmanInstrument::instantiateView( QWidget * _parent ) { - return( new PatmanView( this, _parent ) ); + return( new gui::PatmanView( this, _parent ) ); } @@ -438,8 +441,8 @@ PluginView * patmanInstrument::instantiateView( QWidget * _parent ) - - +namespace gui +{ PatmanView::PatmanView( Instrument * _instrument, QWidget * _parent ) : @@ -644,3 +647,8 @@ void PatmanView::modelChanged( void ) connect( m_pi, SIGNAL( fileChanged() ), this, SLOT( updateFilename() ) ); } + + +} // namespace gui + +} // namespace lmms diff --git a/plugins/patman/patman.h b/plugins/patman/patman.h index 8d5689b7363..36e7df81d3e 100644 --- a/plugins/patman/patman.h +++ b/plugins/patman/patman.h @@ -32,7 +32,14 @@ #include "AutomatableModel.h" #include "MemoryManager.h" +namespace lmms +{ + +namespace gui +{ class PixmapButton; +class PatmanView; +} // namespace gui #define MODES_16BIT ( 1 << 0 ) @@ -69,7 +76,7 @@ class patmanInstrument : public Instrument return( 128 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); public slots: @@ -107,7 +114,7 @@ public slots: void selectSample( NotePlayHandle * _n ); - friend class PatmanView; + friend class gui::PatmanView; signals: void fileChanged( void ); @@ -115,6 +122,9 @@ public slots: } ; +namespace gui +{ + class PatmanView : public InstrumentViewFixedSize { @@ -148,5 +158,8 @@ public slots: } ; +} // namespace gui + +} // namespace lmms #endif From 3f2b336479968b0003087fde068d79267558935a Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 7 Oct 2021 23:43:51 +0200 Subject: [PATCH 046/118] Add namespaces to ReverbSC plugin. --- plugins/ReverbSC/ReverbSC.cpp | 7 +++++++ plugins/ReverbSC/ReverbSC.h | 8 ++++++++ plugins/ReverbSC/ReverbSCControlDialog.cpp | 7 +++++++ plugins/ReverbSC/ReverbSCControlDialog.h | 11 +++++++++++ plugins/ReverbSC/ReverbSCControls.cpp | 7 +++++++ plugins/ReverbSC/ReverbSCControls.h | 13 ++++++++++--- 6 files changed, 50 insertions(+), 3 deletions(-) diff --git a/plugins/ReverbSC/ReverbSC.cpp b/plugins/ReverbSC/ReverbSC.cpp index da42e65dc89..0d0aec75c76 100644 --- a/plugins/ReverbSC/ReverbSC.cpp +++ b/plugins/ReverbSC/ReverbSC.cpp @@ -28,6 +28,10 @@ #define DB2LIN(X) pow(10, X / 20.0f); +namespace lmms +{ + + extern "C" { @@ -161,3 +165,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } } + + +} // namespace lmms diff --git a/plugins/ReverbSC/ReverbSC.h b/plugins/ReverbSC/ReverbSC.h index 0e697c19799..3e41f966fc1 100644 --- a/plugins/ReverbSC/ReverbSC.h +++ b/plugins/ReverbSC/ReverbSC.h @@ -36,6 +36,11 @@ extern "C" { #include "dcblock.h" } + +namespace lmms +{ + + class ReverbSCEffect : public Effect { public: @@ -59,4 +64,7 @@ class ReverbSCEffect : public Effect friend class ReverbSCControls; } ; + +} // namespace lmms + #endif diff --git a/plugins/ReverbSC/ReverbSCControlDialog.cpp b/plugins/ReverbSC/ReverbSCControlDialog.cpp index 9c9f3f44a1f..a8fd712a4d3 100644 --- a/plugins/ReverbSC/ReverbSCControlDialog.cpp +++ b/plugins/ReverbSC/ReverbSCControlDialog.cpp @@ -28,6 +28,10 @@ #include "ReverbSCControls.h" #include "embed.h" +namespace lmms::gui +{ + + ReverbSCControlDialog::ReverbSCControlDialog( ReverbSCControls* controls ) : EffectControlDialog( controls ) { @@ -61,3 +65,6 @@ ReverbSCControlDialog::ReverbSCControlDialog( ReverbSCControls* controls ) : outputGainKnob->setLabel( tr( "Output" ) ); outputGainKnob->setHintText( tr( "Output gain:" ) , "dB" ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/ReverbSC/ReverbSCControlDialog.h b/plugins/ReverbSC/ReverbSCControlDialog.h index 0d9c1f51a45..ba373509a89 100644 --- a/plugins/ReverbSC/ReverbSCControlDialog.h +++ b/plugins/ReverbSC/ReverbSCControlDialog.h @@ -28,9 +28,15 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class ReverbSCControls; +namespace gui +{ + class ReverbSCControlDialog : public EffectControlDialog { Q_OBJECT @@ -42,4 +48,9 @@ class ReverbSCControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/ReverbSC/ReverbSCControls.cpp b/plugins/ReverbSC/ReverbSCControls.cpp index 165e784f60b..87f453546d9 100644 --- a/plugins/ReverbSC/ReverbSCControls.cpp +++ b/plugins/ReverbSC/ReverbSCControls.cpp @@ -30,6 +30,10 @@ #include "Engine.h" #include "Song.h" +namespace lmms +{ + + ReverbSCControls::ReverbSCControls( ReverbSCEffect* effect ) : EffectControls( effect ), m_effect( effect ), @@ -65,3 +69,6 @@ void ReverbSCControls::changeSampleRate() { m_effect->changeSampleRate(); } + + +} // namespace lmms diff --git a/plugins/ReverbSC/ReverbSCControls.h b/plugins/ReverbSC/ReverbSCControls.h index 36cc16a7ec8..ad3506c9ce4 100644 --- a/plugins/ReverbSC/ReverbSCControls.h +++ b/plugins/ReverbSC/ReverbSCControls.h @@ -30,6 +30,10 @@ #include "Knob.h" +namespace lmms +{ + + class ReverbSCEffect; class ReverbSCControls : public EffectControls @@ -53,9 +57,9 @@ class ReverbSCControls : public EffectControls return 4; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new ReverbSCControlDialog( this ); + return new gui::ReverbSCControlDialog( this ); } @@ -70,9 +74,12 @@ private slots: FloatModel m_colorModel; FloatModel m_outputGainModel; - friend class ReverbSCControlDialog; + friend class gui::ReverbSCControlDialog; friend class ReverbSCEffect; } ; + +} // namespace lmms + #endif From 278703ebd80f81f53df2fe4af2f7ed5106ee010a Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 00:16:36 +0200 Subject: [PATCH 047/118] Add namespaces to SF2Player plugin. --- plugins/sf2_player/fluidsynthshims.h | 7 +++++++ plugins/sf2_player/patches_dialog.cpp | 5 ++++- plugins/sf2_player/patches_dialog.h | 5 +++++ plugins/sf2_player/sf2_player.cpp | 15 +++++++++++--- plugins/sf2_player/sf2_player.h | 28 ++++++++++++++++++++------- 5 files changed, 49 insertions(+), 11 deletions(-) diff --git a/plugins/sf2_player/fluidsynthshims.h b/plugins/sf2_player/fluidsynthshims.h index 4302256ba38..844f7052c2e 100644 --- a/plugins/sf2_player/fluidsynthshims.h +++ b/plugins/sf2_player/fluidsynthshims.h @@ -28,6 +28,10 @@ #include +namespace lmms +{ + + #if FLUIDSYNTH_VERSION_MAJOR < 2 inline const char* fluid_preset_get_name(fluid_preset_t* preset) @@ -85,4 +89,7 @@ inline fluid_preset_t* fluid_sfont_iteration_next_wrapper(fluid_sfont_t* sfont, #endif // FLUIDSYNTH_VERSION_MAJOR < 2 + +} // namespace lmms + #endif // FLUIDSYNTHSHIMS_H diff --git a/plugins/sf2_player/patches_dialog.cpp b/plugins/sf2_player/patches_dialog.cpp index 9586e7408b8..4f513a61dcb 100644 --- a/plugins/sf2_player/patches_dialog.cpp +++ b/plugins/sf2_player/patches_dialog.cpp @@ -28,6 +28,9 @@ #include //#include +namespace lmms::gui +{ + // Custom list-view item (as for numerical sort purposes...) class patchItem : public QTreeWidgetItem @@ -377,4 +380,4 @@ void patchesDialog::progChanged (QTreeWidgetItem * _curr, QTreeWidgetItem * _pre } - +} // namespace lmms::gui diff --git a/plugins/sf2_player/patches_dialog.h b/plugins/sf2_player/patches_dialog.h index 76387e830c4..fe2ca158483 100644 --- a/plugins/sf2_player/patches_dialog.h +++ b/plugins/sf2_player/patches_dialog.h @@ -33,6 +33,9 @@ #include #include +namespace lmms::gui +{ + //---------------------------------------------------------------------------- // qsynthPresetForm -- UI wrapper form. @@ -91,5 +94,7 @@ protected slots: }; +} // namespace lmms::gui + #endif diff --git a/plugins/sf2_player/sf2_player.cpp b/plugins/sf2_player/sf2_player.cpp index 2f42fc2304e..ef3254f4a2a 100644 --- a/plugins/sf2_player/sf2_player.cpp +++ b/plugins/sf2_player/sf2_player.cpp @@ -50,6 +50,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -875,15 +879,16 @@ void sf2Instrument::deleteNotePluginData( NotePlayHandle * _n ) -PluginView * sf2Instrument::instantiateView( QWidget * _parent ) +gui::PluginView* sf2Instrument::instantiateView( QWidget * _parent ) { - return new sf2InstrumentView( this, _parent ); + return new gui::sf2InstrumentView( this, _parent ); } - +namespace gui +{ class sf2Knob : public Knob @@ -1183,6 +1188,7 @@ void sf2InstrumentView::showPatchDialog() } +} // namespace gui extern "C" { @@ -1194,3 +1200,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } } + + +} // namespace lmms diff --git a/plugins/sf2_player/sf2_player.h b/plugins/sf2_player/sf2_player.h index afd7bfecdbe..7932bbf377f 100644 --- a/plugins/sf2_player/sf2_player.h +++ b/plugins/sf2_player/sf2_player.h @@ -39,14 +39,22 @@ #include "fluidsynthshims.h" #include "MemoryManager.h" -class sf2InstrumentView; +class QLabel; + +namespace lmms +{ + + +struct SF2PluginData; class sf2Font; class NotePlayHandle; +namespace gui +{ +class sf2InstrumentView; class patchesDialog; -class QLabel; +} // namespace gui -struct SF2PluginData; class sf2Instrument : public Instrument { @@ -84,7 +92,7 @@ class sf2Instrument : public Instrument return IsSingleStreamed; } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); QString getCurrentPatchName(); @@ -134,8 +142,8 @@ public slots: int m_lastMidiPitchRange; int m_channel; - LcdSpinBoxModel m_bankNum; - LcdSpinBoxModel m_patchNum; + gui::LcdSpinBoxModel m_bankNum; + gui::LcdSpinBoxModel m_patchNum; FloatModel m_gain; @@ -160,7 +168,7 @@ public slots: void noteOff( SF2PluginData * n ); void renderFrames( f_cnt_t frames, sampleFrame * buf ); - friend class sf2InstrumentView; + friend class gui::sf2InstrumentView; signals: void fileLoading(); @@ -186,6 +194,9 @@ class sf2Font }; +namespace gui +{ + class sf2InstrumentView : public InstrumentViewFixedSize { @@ -232,5 +243,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms #endif From bc41ea9f036846ca3ca1b055e216cdc37d964ac1 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 00:23:10 +0200 Subject: [PATCH 048/118] Add namespaces to SFXR plugin. --- plugins/sfxr/sfxr.cpp | 17 +++++++++++++---- plugins/sfxr/sfxr.h | 17 +++++++++++++++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/plugins/sfxr/sfxr.cpp b/plugins/sfxr/sfxr.cpp index bfdd22b5530..f4085800f4c 100644 --- a/plugins/sfxr/sfxr.cpp +++ b/plugins/sfxr/sfxr.cpp @@ -55,6 +55,10 @@ float frnd(float range) #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -507,9 +511,9 @@ void sfxrInstrument::deleteNotePluginData( NotePlayHandle * _n ) -PluginView * sfxrInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* sfxrInstrument::instantiateView( QWidget * _parent ) { - return( new sfxrInstrumentView( this, _parent ) ); + return( new gui::sfxrInstrumentView( this, _parent ) ); } @@ -552,6 +556,9 @@ void sfxrInstrument::resetModels() +namespace gui +{ + class sfxrKnob : public Knob { @@ -1118,6 +1125,9 @@ void sfxrInstrumentView::previewSound() +} // namespace gui + + extern "C" { @@ -1131,5 +1141,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* m, void* ) } - - +} // namespace lmms diff --git a/plugins/sfxr/sfxr.h b/plugins/sfxr/sfxr.h index 20ae54c96fe..33b9ec7864e 100644 --- a/plugins/sfxr/sfxr.h +++ b/plugins/sfxr/sfxr.h @@ -36,6 +36,9 @@ #include "LedCheckbox.h" #include "MemoryManager.h" +namespace lmms +{ + enum SfxrWaves { @@ -66,6 +69,10 @@ const int KNOB_BLOCK_SIZE_Y = 40; class sfxrInstrument; +namespace gui +{ +class sfxrInstrumentView; +} class SfxrSynth @@ -180,7 +187,7 @@ class sfxrInstrument : public Instrument virtual QString nodeName() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); void resetModels(); @@ -217,11 +224,14 @@ class sfxrInstrument : public Instrument IntModel m_waveFormModel; - friend class sfxrInstrumentView; + friend class gui::sfxrInstrumentView; friend class SfxrSynth; }; +namespace gui +{ + class sfxrInstrumentView : public InstrumentViewFixedSize { @@ -300,5 +310,8 @@ protected slots: }; +} // namespace gui + +} // namespace lmms #endif From ef0bc4db4315cef21af34a991d367690a4e33138 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 00:39:54 +0200 Subject: [PATCH 049/118] Add namespaces to SID plugin. --- plugins/Sid/SidInstrument.cpp | 16 +++++++++++----- plugins/Sid/SidInstrument.h | 22 ++++++++++++++++++---- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/plugins/Sid/SidInstrument.cpp b/plugins/Sid/SidInstrument.cpp index 236b00589e8..f61d9cfe63f 100644 --- a/plugins/Sid/SidInstrument.cpp +++ b/plugins/Sid/SidInstrument.cpp @@ -44,6 +44,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + #define C64_PAL_CYCLES_PER_SEC 985248 #define NUMSIDREGS 0x19 @@ -454,13 +458,16 @@ void SidInstrument::deleteNotePluginData( NotePlayHandle * _n ) -PluginView * SidInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* SidInstrument::instantiateView( QWidget * _parent ) { - return( new SidInstrumentView( this, _parent ) ); + return( new gui::SidInstrumentView( this, _parent ) ); } +namespace gui +{ + class sidKnob : public Knob { @@ -787,7 +794,7 @@ void SidInstrumentView::modelChanged() } - +} // namespace gui extern "C" @@ -803,5 +810,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } - - +} // namespace lmms diff --git a/plugins/Sid/SidInstrument.h b/plugins/Sid/SidInstrument.h index c0998f0265d..a473dbd3b1c 100644 --- a/plugins/Sid/SidInstrument.h +++ b/plugins/Sid/SidInstrument.h @@ -32,11 +32,18 @@ #include "InstrumentView.h" #include "Knob.h" +namespace lmms +{ + -class SidInstrumentView; class NotePlayHandle; + +namespace gui +{ class automatableButtonGroup; +class SidInstrumentView; class PixmapButton; +} class voiceObject : public Model { @@ -68,7 +75,7 @@ class voiceObject : public Model BoolModel m_testModel; friend class SidInstrument; - friend class SidInstrumentView; + friend class gui::SidInstrumentView; } ; class SidInstrument : public Instrument @@ -104,7 +111,7 @@ class SidInstrument : public Instrument virtual f_cnt_t desiredReleaseFrames() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); /*public slots: @@ -126,11 +133,14 @@ class SidInstrument : public Instrument IntModel m_chipModel; - friend class SidInstrumentView; + friend class gui::SidInstrumentView; } ; +namespace gui +{ + class SidInstrumentView : public InstrumentViewFixedSize { @@ -200,4 +210,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms + #endif From 5a1c436fa642f136f325d29826c2c18d83b942ac Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 00:47:10 +0200 Subject: [PATCH 050/118] Add namespaces to SpectrumAnalyzer plugin. --- plugins/SpectrumAnalyzer/Analyzer.cpp | 5 +++++ plugins/SpectrumAnalyzer/Analyzer.h | 6 +++++ plugins/SpectrumAnalyzer/DataprocLauncher.h | 7 ++++++ plugins/SpectrumAnalyzer/SaControls.cpp | 10 +++++++-- plugins/SpectrumAnalyzer/SaControls.h | 22 +++++++++++++++---- plugins/SpectrumAnalyzer/SaControlsDialog.cpp | 6 +++++ plugins/SpectrumAnalyzer/SaControlsDialog.h | 7 ++++++ plugins/SpectrumAnalyzer/SaProcessor.cpp | 5 +++++ plugins/SpectrumAnalyzer/SaProcessor.h | 7 ++++++ plugins/SpectrumAnalyzer/SaSpectrumView.cpp | 5 +++++ plugins/SpectrumAnalyzer/SaSpectrumView.h | 15 +++++++++++++ plugins/SpectrumAnalyzer/SaWaterfallView.cpp | 7 ++++++ plugins/SpectrumAnalyzer/SaWaterfallView.h | 8 +++++++ 13 files changed, 104 insertions(+), 6 deletions(-) diff --git a/plugins/SpectrumAnalyzer/Analyzer.cpp b/plugins/SpectrumAnalyzer/Analyzer.cpp index e7b23d7b035..de4ac8c681c 100644 --- a/plugins/SpectrumAnalyzer/Analyzer.cpp +++ b/plugins/SpectrumAnalyzer/Analyzer.cpp @@ -36,6 +36,9 @@ #include "lmms_basics.h" #include "plugin_export.h" +namespace lmms +{ + extern "C" { Plugin::Descriptor PLUGIN_EXPORT analyzer_plugin_descriptor = @@ -116,3 +119,5 @@ extern "C" { } } + +} // namespace lmms diff --git a/plugins/SpectrumAnalyzer/Analyzer.h b/plugins/SpectrumAnalyzer/Analyzer.h index 304777c9a09..57e6036341b 100644 --- a/plugins/SpectrumAnalyzer/Analyzer.h +++ b/plugins/SpectrumAnalyzer/Analyzer.h @@ -35,6 +35,9 @@ #include "SaControls.h" #include "SaProcessor.h" +namespace lmms +{ + //! Top level class; handles LMMS interface and feeds data to the data processor. class Analyzer : public Effect @@ -71,5 +74,8 @@ class Analyzer : public Effect #endif }; + +} // namespace lmms + #endif // ANALYZER_H diff --git a/plugins/SpectrumAnalyzer/DataprocLauncher.h b/plugins/SpectrumAnalyzer/DataprocLauncher.h index d91e0bedfcc..4325284c9cd 100644 --- a/plugins/SpectrumAnalyzer/DataprocLauncher.h +++ b/plugins/SpectrumAnalyzer/DataprocLauncher.h @@ -30,6 +30,10 @@ #include "SaProcessor.h" #include "LocklessRingBuffer.h" +namespace lmms +{ + + class DataprocLauncher : public QThread { public: @@ -49,4 +53,7 @@ class DataprocLauncher : public QThread LocklessRingBuffer *m_inputBuffer; }; + +} // namespace lmms + #endif // DATAPROCLAUNCHER_H diff --git a/plugins/SpectrumAnalyzer/SaControls.cpp b/plugins/SpectrumAnalyzer/SaControls.cpp index 6be298e27e4..274df80d9ea 100644 --- a/plugins/SpectrumAnalyzer/SaControls.cpp +++ b/plugins/SpectrumAnalyzer/SaControls.cpp @@ -29,6 +29,9 @@ #include "Analyzer.h" #include "SaControlsDialog.h" +namespace lmms +{ + SaControls::SaControls(Analyzer *effect) : EffectControls(effect), @@ -121,9 +124,9 @@ SaControls::SaControls(Analyzer *effect) : // Create the SaControlDialog widget which handles display of GUI elements. -EffectControlDialog* SaControls::createView() +gui::EffectControlDialog* SaControls::createView() { - return new SaControlsDialog(this, m_effect->getProcessor()); + return new gui::SaControlsDialog(this, m_effect->getProcessor()); } @@ -174,3 +177,6 @@ void SaControls::saveSettings(QDomDocument &doc, QDomElement &parent) m_zeroPaddingModel.saveSettings(doc, parent, "ZeroPadding"); } + + +} // namespace lmms diff --git a/plugins/SpectrumAnalyzer/SaControls.h b/plugins/SpectrumAnalyzer/SaControls.h index ee8a9e001fe..5856437439a 100644 --- a/plugins/SpectrumAnalyzer/SaControls.h +++ b/plugins/SpectrumAnalyzer/SaControls.h @@ -31,9 +31,19 @@ //#define SA_DEBUG 1 // define SA_DEBUG to enable performance measurements +namespace lmms +{ + class Analyzer; +namespace gui +{ +class SaControlsDialog; +class SaSpectrumView; +class SaWaterfallView; +} + // Holds all the configuration values class SaControls : public EffectControls { @@ -42,7 +52,7 @@ class SaControls : public EffectControls explicit SaControls(Analyzer* effect); virtual ~SaControls() {} - EffectControlDialog* createView() override; + gui::EffectControlDialog* createView() override; void saveSettings (QDomDocument& doc, QDomElement& parent) override; void loadSettings (const QDomElement &_this) override; @@ -89,9 +99,13 @@ class SaControls : public EffectControls QColor m_colorGrid; //!< color of grid lines QColor m_colorLabels; //!< color of axis labels - friend class SaControlsDialog; - friend class SaSpectrumView; - friend class SaWaterfallView; + friend class gui::SaControlsDialog; + friend class gui::SaSpectrumView; + friend class gui::SaWaterfallView; friend class SaProcessor; }; + + +} // namespace lmms + #endif // SACONTROLS_H diff --git a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp index ddd1489e85d..c25475baa68 100644 --- a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp +++ b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp @@ -41,6 +41,10 @@ #include "SaProcessor.h" +namespace lmms::gui +{ + + // The entire GUI layout is built here. SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) : EffectControlDialog(controls), @@ -350,3 +354,5 @@ QSize SaControlsDialog::sizeHint() const } } + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/SpectrumAnalyzer/SaControlsDialog.h b/plugins/SpectrumAnalyzer/SaControlsDialog.h index e5a35f186bc..a4492382e21 100644 --- a/plugins/SpectrumAnalyzer/SaControlsDialog.h +++ b/plugins/SpectrumAnalyzer/SaControlsDialog.h @@ -32,6 +32,10 @@ #include "SaWaterfallView.h" +namespace lmms::gui +{ + + //! Top-level widget holding the configuration GUI and spectrum displays class SaControlsDialog : public EffectControlDialog { @@ -54,4 +58,7 @@ class SaControlsDialog : public EffectControlDialog SaWaterfallView *m_waterfall; }; + +} // namespace lmms::gui + #endif // SACONTROLSDIALOG_H diff --git a/plugins/SpectrumAnalyzer/SaProcessor.cpp b/plugins/SpectrumAnalyzer/SaProcessor.cpp index 3fa6c2048df..d8f6bc1dfb0 100644 --- a/plugins/SpectrumAnalyzer/SaProcessor.cpp +++ b/plugins/SpectrumAnalyzer/SaProcessor.cpp @@ -39,6 +39,9 @@ #include "lmms_math.h" #include "LocklessRingBuffer.h" +namespace lmms +{ + SaProcessor::SaProcessor(const SaControls *controls) : m_controls(controls), @@ -690,3 +693,5 @@ float SaProcessor::yPixelToAmp(float y, unsigned int height) const } } + +} // namespace lmms diff --git a/plugins/SpectrumAnalyzer/SaProcessor.h b/plugins/SpectrumAnalyzer/SaProcessor.h index 0c396b3c031..4386bbce2c4 100644 --- a/plugins/SpectrumAnalyzer/SaProcessor.h +++ b/plugins/SpectrumAnalyzer/SaProcessor.h @@ -35,6 +35,9 @@ #include "fft_helpers.h" #include "SaControls.h" +namespace lmms +{ + template class LocklessRingBuffer; @@ -156,5 +159,9 @@ class SaProcessor float m_max_execution; #endif }; + + +} // namespace lmms + #endif // SAPROCESSOR_H diff --git a/plugins/SpectrumAnalyzer/SaSpectrumView.cpp b/plugins/SpectrumAnalyzer/SaSpectrumView.cpp index 849cba66540..30e2e4f2bd1 100644 --- a/plugins/SpectrumAnalyzer/SaSpectrumView.cpp +++ b/plugins/SpectrumAnalyzer/SaSpectrumView.cpp @@ -41,6 +41,9 @@ #include #endif +namespace lmms::gui +{ + SaSpectrumView::SaSpectrumView(SaControls *controls, SaProcessor *processor, QWidget *_parent) : QWidget(_parent), @@ -811,3 +814,5 @@ void SaSpectrumView::resizeEvent(QResizeEvent *event) m_linearAmpTics = makeLinearAmpTics(m_processor->getAmpRangeMin(), m_processor->getAmpRangeMax()); } + +} // namespace lmms::gui diff --git a/plugins/SpectrumAnalyzer/SaSpectrumView.h b/plugins/SpectrumAnalyzer/SaSpectrumView.h index b59264d9ce7..cffa2eab464 100644 --- a/plugins/SpectrumAnalyzer/SaSpectrumView.h +++ b/plugins/SpectrumAnalyzer/SaSpectrumView.h @@ -36,8 +36,17 @@ class QMouseEvent; class QPainter; + +namespace lmms +{ + + class SaProcessor; +namespace gui +{ + + //! Widget that displays a spectrum curve and frequency / amplitude grid class SaSpectrumView : public QWidget { @@ -127,5 +136,11 @@ private slots: float m_draw_avg; #endif }; + + +} // namespace gui + +} // namespace lmms + #endif // SASPECTRUMVIEW_H diff --git a/plugins/SpectrumAnalyzer/SaWaterfallView.cpp b/plugins/SpectrumAnalyzer/SaWaterfallView.cpp index 510ba835b2f..0bad8650d6d 100644 --- a/plugins/SpectrumAnalyzer/SaWaterfallView.cpp +++ b/plugins/SpectrumAnalyzer/SaWaterfallView.cpp @@ -40,6 +40,10 @@ #include "SaProcessor.h" +namespace lmms::gui +{ + + SaWaterfallView::SaWaterfallView(SaControls *controls, SaProcessor *processor, QWidget *_parent) : QWidget(_parent), m_controls(controls), @@ -341,3 +345,6 @@ void SaWaterfallView::resizeEvent(QResizeEvent *event) { m_timeTics = makeTimeTics(); } + + +} // namespace lmms::gui diff --git a/plugins/SpectrumAnalyzer/SaWaterfallView.h b/plugins/SpectrumAnalyzer/SaWaterfallView.h index bd91d6d1641..392e5891ec7 100644 --- a/plugins/SpectrumAnalyzer/SaWaterfallView.h +++ b/plugins/SpectrumAnalyzer/SaWaterfallView.h @@ -34,6 +34,10 @@ class QMouseEvent; +namespace lmms::gui +{ + + // Widget that displays a spectrum waterfall (spectrogram) and time labels. class SaWaterfallView : public QWidget { @@ -87,4 +91,8 @@ private slots: float m_execution_avg; #endif }; + + +} // namespace lmms::gui + #endif // SAWATERFALLVIEW_H From c948b09d331f42bfee57604880507cb6d5267b5d Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 00:56:08 +0200 Subject: [PATCH 051/118] Add namespaces to StereoEnhancer plugin. --- plugins/stereo_enhancer/stereo_enhancer.cpp | 6 ++++++ plugins/stereo_enhancer/stereo_enhancer.h | 5 +++++ .../stereoenhancer_control_dialog.cpp | 5 +++++ .../stereo_enhancer/stereoenhancer_control_dialog.h | 9 +++++++++ plugins/stereo_enhancer/stereoenhancer_controls.cpp | 7 ++++--- plugins/stereo_enhancer/stereoenhancer_controls.h | 12 +++++++++--- 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/plugins/stereo_enhancer/stereo_enhancer.cpp b/plugins/stereo_enhancer/stereo_enhancer.cpp index ad2ebd4e9f2..f32057f4815 100644 --- a/plugins/stereo_enhancer/stereo_enhancer.cpp +++ b/plugins/stereo_enhancer/stereo_enhancer.cpp @@ -28,6 +28,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -172,3 +176,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * _parent, void * _data ) } + +} // namespace lmms \ No newline at end of file diff --git a/plugins/stereo_enhancer/stereo_enhancer.h b/plugins/stereo_enhancer/stereo_enhancer.h index c13af958eb2..66aec431c2f 100644 --- a/plugins/stereo_enhancer/stereo_enhancer.h +++ b/plugins/stereo_enhancer/stereo_enhancer.h @@ -31,6 +31,10 @@ #include "Engine.h" #include "stereoenhancer_controls.h" +namespace lmms +{ + + class stereoEnhancerEffect : public Effect { public: @@ -60,5 +64,6 @@ class stereoEnhancerEffect : public Effect } ; +} // namespace lmms #endif diff --git a/plugins/stereo_enhancer/stereoenhancer_control_dialog.cpp b/plugins/stereo_enhancer/stereoenhancer_control_dialog.cpp index 47523f05fbb..ad1eaaa7488 100644 --- a/plugins/stereo_enhancer/stereoenhancer_control_dialog.cpp +++ b/plugins/stereo_enhancer/stereoenhancer_control_dialog.cpp @@ -30,6 +30,9 @@ #include "stereoenhancer_controls.h" +namespace lmms::gui +{ + stereoEnhancerControlDialog::stereoEnhancerControlDialog( stereoEnhancerControls * _controls ) : @@ -47,3 +50,5 @@ stereoEnhancerControlDialog::stereoEnhancerControlDialog( this->setLayout(l); } + +} // namespace lmms::gui diff --git a/plugins/stereo_enhancer/stereoenhancer_control_dialog.h b/plugins/stereo_enhancer/stereoenhancer_control_dialog.h index 791a8dd470e..ef4d0797ad9 100644 --- a/plugins/stereo_enhancer/stereoenhancer_control_dialog.h +++ b/plugins/stereo_enhancer/stereoenhancer_control_dialog.h @@ -27,9 +27,15 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class stereoEnhancerControls; +namespace gui +{ + class stereoEnhancerControlDialog : public EffectControlDialog { Q_OBJECT @@ -41,5 +47,8 @@ class stereoEnhancerControlDialog : public EffectControlDialog }; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/stereo_enhancer/stereoenhancer_controls.cpp b/plugins/stereo_enhancer/stereoenhancer_controls.cpp index c038d3ce0f8..5074a1d5299 100644 --- a/plugins/stereo_enhancer/stereoenhancer_controls.cpp +++ b/plugins/stereo_enhancer/stereoenhancer_controls.cpp @@ -28,6 +28,9 @@ #include "stereoenhancer_controls.h" #include "stereo_enhancer.h" +namespace lmms +{ + stereoEnhancerControls::stereoEnhancerControls( stereoEnhancerEffect * _eff ) : EffectControls( _eff ), @@ -64,6 +67,4 @@ void stereoEnhancerControls::saveSettings( QDomDocument & _doc, } - - - +} // namespace lmms diff --git a/plugins/stereo_enhancer/stereoenhancer_controls.h b/plugins/stereo_enhancer/stereoenhancer_controls.h index 458d6e86074..0d53a79cd16 100644 --- a/plugins/stereo_enhancer/stereoenhancer_controls.h +++ b/plugins/stereo_enhancer/stereoenhancer_controls.h @@ -29,6 +29,10 @@ #include "stereoenhancer_control_dialog.h" #include "Knob.h" +namespace lmms +{ + + class stereoEnhancerEffect; class stereoEnhancerControls : public EffectControls @@ -52,9 +56,9 @@ class stereoEnhancerControls : public EffectControls return( 1 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return new stereoEnhancerControlDialog( this ); + return new gui::stereoEnhancerControlDialog( this ); } @@ -66,9 +70,11 @@ private slots: stereoEnhancerEffect * m_effect; FloatModel m_widthModel; - friend class stereoEnhancerControlDialog; + friend class gui::stereoEnhancerControlDialog; } ; +} // namespace lmms + #endif /*_STEREO_ENHANCER_CONTROLS_H*/ From bf2062e54488d8a387d2ef1fda1d717c69ac0bd3 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 01:00:03 +0200 Subject: [PATCH 052/118] Add namespaces to Stereo Matrix plugin. --- plugins/stereo_matrix/stereo_matrix.cpp | 7 +++++++ plugins/stereo_matrix/stereo_matrix.h | 7 ++++++- .../stereo_matrix/stereomatrix_control_dialog.cpp | 5 +++++ plugins/stereo_matrix/stereomatrix_control_dialog.h | 11 +++++++++++ plugins/stereo_matrix/stereomatrix_controls.cpp | 6 ++++++ plugins/stereo_matrix/stereomatrix_controls.h | 12 +++++++++--- 6 files changed, 44 insertions(+), 4 deletions(-) diff --git a/plugins/stereo_matrix/stereo_matrix.cpp b/plugins/stereo_matrix/stereo_matrix.cpp index cec73072586..f717cc3e866 100644 --- a/plugins/stereo_matrix/stereo_matrix.cpp +++ b/plugins/stereo_matrix/stereo_matrix.cpp @@ -28,6 +28,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -121,3 +125,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * _parent, void * _data ) } } + + +} // namespace lmms diff --git a/plugins/stereo_matrix/stereo_matrix.h b/plugins/stereo_matrix/stereo_matrix.h index a8876c6bc77..dadf40993c6 100644 --- a/plugins/stereo_matrix/stereo_matrix.h +++ b/plugins/stereo_matrix/stereo_matrix.h @@ -29,6 +29,10 @@ #include "Effect.h" #include "stereomatrix_controls.h" +namespace lmms +{ + + class stereoMatrixEffect : public Effect { public: @@ -38,7 +42,7 @@ class stereoMatrixEffect : public Effect virtual bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ); - virtual EffectControls * controls() + virtual EffectControls* controls() { return( &m_smControls ); } @@ -51,5 +55,6 @@ class stereoMatrixEffect : public Effect } ; +} // namespace lmms #endif diff --git a/plugins/stereo_matrix/stereomatrix_control_dialog.cpp b/plugins/stereo_matrix/stereomatrix_control_dialog.cpp index 79a36604851..38bffb38283 100644 --- a/plugins/stereo_matrix/stereomatrix_control_dialog.cpp +++ b/plugins/stereo_matrix/stereomatrix_control_dialog.cpp @@ -31,6 +31,8 @@ #include "stereomatrix_controls.h" #include "embed.h" +namespace lmms::gui +{ stereoMatrixControlDialog::stereoMatrixControlDialog( @@ -67,3 +69,6 @@ stereoMatrixControlDialog::stereoMatrixControlDialog( rrKnob->setHintText( tr( "Right to Right Vol:" ) , "" ); rrKnob->move( 123, 79 ); } + + +} // namespace lmms::gui diff --git a/plugins/stereo_matrix/stereomatrix_control_dialog.h b/plugins/stereo_matrix/stereomatrix_control_dialog.h index 8a05f93a865..8a5e6a51398 100644 --- a/plugins/stereo_matrix/stereomatrix_control_dialog.h +++ b/plugins/stereo_matrix/stereomatrix_control_dialog.h @@ -27,9 +27,16 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class stereoMatrixControls; +namespace gui +{ + + class stereoMatrixControlDialog : public EffectControlDialog { Q_OBJECT @@ -42,4 +49,8 @@ class stereoMatrixControlDialog : public EffectControlDialog }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/stereo_matrix/stereomatrix_controls.cpp b/plugins/stereo_matrix/stereomatrix_controls.cpp index afc46b85e43..6cb7b8a7ffe 100644 --- a/plugins/stereo_matrix/stereomatrix_controls.cpp +++ b/plugins/stereo_matrix/stereomatrix_controls.cpp @@ -28,6 +28,9 @@ #include "stereomatrix_controls.h" #include "stereo_matrix.h" +namespace lmms +{ + stereoMatrixControls::stereoMatrixControls( stereoMatrixEffect * _eff ) : EffectControls( _eff ), @@ -81,3 +84,6 @@ void stereoMatrixControls::saveSettings( QDomDocument & _doc, m_rlModel.saveSettings( _doc, _this, "r-l" ); m_rrModel.saveSettings( _doc, _this, "r-r" ); } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/stereo_matrix/stereomatrix_controls.h b/plugins/stereo_matrix/stereomatrix_controls.h index 4f886cae744..50430bcaa24 100644 --- a/plugins/stereo_matrix/stereomatrix_controls.h +++ b/plugins/stereo_matrix/stereomatrix_controls.h @@ -29,6 +29,10 @@ #include "stereomatrix_control_dialog.h" #include "Knob.h" +namespace lmms +{ + + class stereoMatrixEffect; class stereoMatrixControls : public EffectControls @@ -52,9 +56,9 @@ class stereoMatrixControls : public EffectControls return( 1 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return new stereoMatrixControlDialog( this ); + return new gui::stereoMatrixControlDialog( this ); } @@ -70,10 +74,12 @@ private slots: FloatModel m_rlModel; FloatModel m_rrModel; - friend class stereoMatrixControlDialog; + friend class gui::stereoMatrixControlDialog; friend class stereoMatrixEffect; } ; +} // namespace lmms + #endif From 7932d3e1a9e98311e46e929f78215496b0f52887 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 01:11:12 +0200 Subject: [PATCH 053/118] Add namespaces to STK Mallets plugin. --- plugins/stk/mallets/mallets.cpp | 16 +++++++++++----- plugins/stk/mallets/mallets.h | 24 ++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/plugins/stk/mallets/mallets.cpp b/plugins/stk/mallets/mallets.cpp index a175b385d5c..64b4414708e 100644 --- a/plugins/stk/mallets/mallets.cpp +++ b/plugins/stk/mallets/mallets.cpp @@ -43,6 +43,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -376,12 +380,14 @@ void malletsInstrument::deleteNotePluginData( NotePlayHandle * _n ) -PluginView * malletsInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* malletsInstrument::instantiateView( QWidget * _parent ) { - return( new malletsInstrumentView( this, _parent ) ); + return( new gui::malletsInstrumentView( this, _parent ) ); } +namespace gui +{ malletsInstrumentView::malletsInstrumentView( malletsInstrument * _instrument, @@ -604,6 +610,8 @@ void malletsInstrumentView::changePreset() } +} // namespace gui + // ModalBar malletsSynth::malletsSynth( const StkFloat _pitch, @@ -769,6 +777,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * m, void * ) } - - - +} // namespace lmms diff --git a/plugins/stk/mallets/mallets.h b/plugins/stk/mallets/mallets.h index e4b4cf48fb8..bcdfd93d348 100644 --- a/plugins/stk/mallets/mallets.h +++ b/plugins/stk/mallets/mallets.h @@ -40,10 +40,22 @@ // However in older versions this namespace does not exist, therefore declare it // so this plugin builds with all versions of Stk. namespace stk { } ; + +namespace lmms +{ + + using namespace stk; static const int MALLETS_PRESET_VERSION = 1; + +namespace gui +{ +class malletsInstrumentView; +} // namespace gui + + class malletsSynth { public: @@ -160,7 +172,7 @@ class malletsInstrument : public Instrument virtual QString nodeName() const; - virtual PluginView * instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; private: @@ -193,10 +205,13 @@ class malletsInstrument : public Instrument bool m_filesMissing; - friend class malletsInstrumentView; + friend class gui::malletsInstrumentView; } ; +namespace gui +{ + class malletsInstrumentView: public InstrumentViewFixedSize { @@ -242,4 +257,9 @@ public slots: Knob * m_spreadKnob; }; + +} // namespace gui + +} // namespace lmms + #endif From 6b32302615b5d57e60659cf40a8974df8e25a373 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 01:14:56 +0200 Subject: [PATCH 054/118] Add namespaces to TripleOscillator plugin. --- .../triple_oscillator/TripleOscillator.cpp | 14 +++++++--- plugins/triple_oscillator/TripleOscillator.h | 26 +++++++++++++++---- 2 files changed, 32 insertions(+), 8 deletions(-) diff --git a/plugins/triple_oscillator/TripleOscillator.cpp b/plugins/triple_oscillator/TripleOscillator.cpp index a39da6cb562..86c17bf0ef8 100644 --- a/plugins/triple_oscillator/TripleOscillator.cpp +++ b/plugins/triple_oscillator/TripleOscillator.cpp @@ -42,6 +42,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -403,9 +407,9 @@ void TripleOscillator::deleteNotePluginData( NotePlayHandle * _n ) -PluginView * TripleOscillator::instantiateView( QWidget * _parent ) +gui::PluginView* TripleOscillator::instantiateView( QWidget * _parent ) { - return new TripleOscillatorView( this, _parent ); + return new gui::TripleOscillatorView( this, _parent ); } @@ -422,6 +426,9 @@ void TripleOscillator::updateAllDetuning() +namespace gui +{ + class TripleOscKnob : public Knob { @@ -749,6 +756,7 @@ void TripleOscillatorView::modelChanged() } +} // namespace gui extern "C" @@ -764,4 +772,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* model, void * ) - +} // namespace lmms diff --git a/plugins/triple_oscillator/TripleOscillator.h b/plugins/triple_oscillator/TripleOscillator.h index 6c84874634e..6c39cb2ab0c 100644 --- a/plugins/triple_oscillator/TripleOscillator.h +++ b/plugins/triple_oscillator/TripleOscillator.h @@ -31,12 +31,22 @@ #include "Oscillator.h" #include "AutomatableModel.h" +namespace lmms +{ + +class NotePlayHandle; +class SampleBuffer; + + +namespace gui +{ class automatableButtonGroup; class Knob; -class NotePlayHandle; class PixmapButton; -class SampleBuffer; +class TripleOscillatorView; +} // namespace gui + const int NUM_OF_OSCILLATORS = 3; @@ -75,7 +85,7 @@ class OscillatorObject : public Model bool m_useWaveTable; friend class TripleOscillator; - friend class TripleOscillatorView; + friend class gui::TripleOscillatorView; private slots: @@ -115,7 +125,7 @@ class TripleOscillator : public Instrument return( 128 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); protected slots: @@ -133,11 +143,14 @@ protected slots: } ; - friend class TripleOscillatorView; + friend class gui::TripleOscillatorView; } ; +namespace gui +{ + class TripleOscillatorView : public InstrumentViewFixedSize { @@ -198,5 +211,8 @@ class TripleOscillatorView : public InstrumentViewFixedSize } ; +} // namespace gui + +} // namespace lmms #endif From 9fce93000bad4d9d41378070ff8b3d4ccdafb117 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 01:26:28 +0200 Subject: [PATCH 055/118] Add namespaces to VST Base. --- plugins/vst_base/RemoteVstPlugin.cpp | 7 +++++++ plugins/vst_base/VstPlugin.cpp | 16 +++++++++++----- plugins/vst_base/VstPlugin.h | 5 ++++- plugins/vst_base/communication.h | 5 ++++- plugins/vst_base/vst_base.cpp | 5 +++++ 5 files changed, 31 insertions(+), 7 deletions(-) diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index c949147eb41..272765cd90a 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -109,6 +109,11 @@ struct ERect #include #endif + +namespace lmms +{ + + using namespace std; static VstHostLanguages hlang = LanguageEnglish; @@ -2283,3 +2288,5 @@ int main( int _argc, char * * _argv ) } + +} // namespace lmms diff --git a/plugins/vst_base/VstPlugin.cpp b/plugins/vst_base/VstPlugin.cpp index 2b14fc936f9..2f83cae8dd3 100644 --- a/plugins/vst_base/VstPlugin.cpp +++ b/plugins/vst_base/VstPlugin.cpp @@ -116,6 +116,9 @@ class FileInfo } +namespace lmms +{ + VstPlugin::VstPlugin( const QString & _plugin ) : m_plugin( PathUtil::toAbsolute(_plugin) ), @@ -478,9 +481,9 @@ QWidget *VstPlugin::editor() void VstPlugin::openPreset( ) { - FileDialog ofd( nullptr, tr( "Open Preset" ), "", + gui::FileDialog ofd( nullptr, tr( "Open Preset" ), "", tr( "Vst Plugin Preset (*.fxp *.fxb)" ) ); - ofd.setFileMode( FileDialog::ExistingFiles ); + ofd.setFileMode( gui::FileDialog::ExistingFiles ); if( ofd.exec () == QDialog::Accepted && !ofd.selectedFiles().isEmpty() ) { @@ -558,7 +561,7 @@ void VstPlugin::savePreset( ) QString presName = currentProgramName().isEmpty() ? tr(": default") : currentProgramName(); presName.replace("\"", "'"); // QFileDialog unable to handle double quotes properly - FileDialog sfd( nullptr, tr( "Save Preset" ), presName.section(": ", 1, 1) + tr(".fxp"), + gui::FileDialog sfd( nullptr, tr( "Save Preset" ), presName.section(": ", 1, 1) + tr(".fxp"), tr( "Vst Plugin Preset (*.fxp *.fxb)" ) ); if( p_name != "" ) // remember last directory @@ -566,8 +569,8 @@ void VstPlugin::savePreset( ) sfd.setDirectory( QFileInfo( p_name ).absolutePath() ); } - sfd.setAcceptMode( FileDialog::AcceptSave ); - sfd.setFileMode( FileDialog::AnyFile ); + sfd.setAcceptMode( gui::FileDialog::AcceptSave ); + sfd.setFileMode( gui::FileDialog::AnyFile ); if( sfd.exec () == QDialog::Accepted && !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" ) { @@ -796,3 +799,6 @@ QString VstPlugin::embedMethod() const { return m_embedMethod; } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/vst_base/VstPlugin.h b/plugins/vst_base/VstPlugin.h index e05031256eb..d509ae8657a 100644 --- a/plugins/vst_base/VstPlugin.h +++ b/plugins/vst_base/VstPlugin.h @@ -37,7 +37,8 @@ #include "vstbase_export.h" -class vstSubWin; +namespace lmms +{ class VSTBASE_EXPORT VstPlugin : public RemotePlugin, public JournallingObject @@ -174,4 +175,6 @@ public slots: } ; +} // namespace lmms + #endif diff --git a/plugins/vst_base/communication.h b/plugins/vst_base/communication.h index c25b213d18d..1f32dd1354d 100644 --- a/plugins/vst_base/communication.h +++ b/plugins/vst_base/communication.h @@ -27,6 +27,8 @@ #ifndef _COMMUNICATION_H #define _COMMUNICATION_H +namespace lmms +{ struct VstParameterDumpItem @@ -54,7 +56,7 @@ enum VstHostLanguages enum VstRemoteMessageIDs { // vstPlugin -> remoteVstPlugin - IdVstLoadPlugin = IdUserBase, + IdVstLoadPlugin = RemoteMessageIDs::IdUserBase, IdVstClosePlugin, IdVstSetTempo, IdVstSetLanguage, @@ -87,5 +89,6 @@ enum VstRemoteMessageIDs } ; +} // namespace lmms #endif diff --git a/plugins/vst_base/vst_base.cpp b/plugins/vst_base/vst_base.cpp index 2d7333dd30e..7e3e161bb33 100644 --- a/plugins/vst_base/vst_base.cpp +++ b/plugins/vst_base/vst_base.cpp @@ -28,6 +28,10 @@ #include "embed.h" #include "vstbase_export.h" +namespace lmms +{ + + extern "C" { @@ -46,3 +50,4 @@ Plugin::Descriptor VSTBASE_EXPORT vstbase_plugin_descriptor = } +} // namespace lmms From d27085091e0e2e47cadc59138d712452ddc07e2c Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 01:34:39 +0200 Subject: [PATCH 056/118] Add namespaces to Vestige plugin. --- plugins/vestige/vestige.cpp | 30 +++++++++++++++++++++--------- plugins/vestige/vestige.h | 23 +++++++++++++++++++---- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/plugins/vestige/vestige.cpp b/plugins/vestige/vestige.cpp index 97af8bc43b8..d9798d6047b 100644 --- a/plugins/vestige/vestige.cpp +++ b/plugins/vestige/vestige.cpp @@ -63,6 +63,8 @@ #include "embed.h" +namespace lmms +{ extern "C" @@ -84,6 +86,9 @@ Plugin::Descriptor Q_DECL_EXPORT vestige_plugin_descriptor = } +namespace gui +{ + class vstSubWin : public SubWindow { @@ -109,6 +114,9 @@ class vstSubWin : public SubWindow }; +} // namespace gui + + class VstInstrumentPlugin : public VstPlugin { public: @@ -121,7 +129,7 @@ class VstInstrumentPlugin : public VstPlugin return; } if ( embedMethod() != "none" ) { - m_pluginSubWindow.reset(new vstSubWin( getGUI()->mainWindow()->workspace() )); + m_pluginSubWindow.reset(new gui::vstSubWin( getGUI()->mainWindow()->workspace() )); VstPlugin::createUI( m_pluginSubWindow.get() ); m_pluginSubWindow->setWidget(pluginWidget()); } else { @@ -141,10 +149,6 @@ class VstInstrumentPlugin : public VstPlugin }; -QPixmap * VestigeInstrumentView::s_artwork = nullptr; -QPixmap * manageVestigeInstrumentView::s_artwork = nullptr; - - vestigeInstrument::vestigeInstrument( InstrumentTrack * _instrument_track ) : Instrument( _instrument_track, &vestige_plugin_descriptor ), m_plugin( nullptr ), @@ -347,10 +351,10 @@ void vestigeInstrument::loadFile( const QString & _file ) closePlugin(); } m_pluginDLL = PathUtil::toShortestRelative( _file ); - TextFloat * tf = nullptr; + gui::TextFloat * tf = nullptr; if( getGUI() != nullptr ) { - tf = TextFloat::displayMessage( + tf = gui::TextFloat::displayMessage( tr( "Loading plugin" ), tr( "Please wait while loading the VST plugin..." ), PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ), 0 ); @@ -474,13 +478,17 @@ void vestigeInstrument::closePlugin( void ) -PluginView * vestigeInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* vestigeInstrument::instantiateView( QWidget * _parent ) { - return new VestigeInstrumentView( this, _parent ); + return new gui::VestigeInstrumentView( this, _parent ); } +namespace gui +{ +QPixmap * VestigeInstrumentView::s_artwork = nullptr; +QPixmap * manageVestigeInstrumentView::s_artwork = nullptr; VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument, @@ -1227,6 +1235,7 @@ void manageVestigeInstrumentView::paintEvent( QPaintEvent * ) } +} // namespace gui extern "C" @@ -1240,3 +1249,6 @@ Q_DECL_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } + + +} // namespace lmms diff --git a/plugins/vestige/vestige.h b/plugins/vestige/vestige.h index 60c75cd9d23..2e8276317b2 100644 --- a/plugins/vestige/vestige.h +++ b/plugins/vestige/vestige.h @@ -41,9 +41,18 @@ class QPixmap; class QPushButton; -class PixmapButton; +namespace lmms +{ + class VstPlugin; +namespace gui +{ +class PixmapButton; +class VestigeInstrumentView; +class manageVestigeInstrumentView; +} // namespace gui + class vestigeInstrument : public Instrument { @@ -68,7 +77,7 @@ class vestigeInstrument : public Instrument virtual bool handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset = 0 ); - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); protected slots: void setParameter( Model * action ); @@ -90,12 +99,15 @@ protected slots: int paramCount; - friend class VestigeInstrumentView; - friend class manageVestigeInstrumentView; + friend class gui::VestigeInstrumentView; + friend class gui::manageVestigeInstrumentView; } ; +namespace gui +{ + class manageVestigeInstrumentView : public InstrumentViewFixedSize { Q_OBJECT @@ -184,5 +196,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms #endif From 084e5c177462a23cfce12cf7b6ef51289e3fed98 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 01:42:42 +0200 Subject: [PATCH 057/118] Add namespaces to Vectorscope plugin. --- plugins/Vectorscope/VecControls.cpp | 10 ++++++++-- plugins/Vectorscope/VecControls.h | 19 ++++++++++++++++--- plugins/Vectorscope/VecControlsDialog.cpp | 6 ++++++ plugins/Vectorscope/VecControlsDialog.h | 13 +++++++++++++ plugins/Vectorscope/VectorView.cpp | 6 ++++++ plugins/Vectorscope/VectorView.h | 7 +++++++ plugins/Vectorscope/Vectorscope.cpp | 5 +++++ plugins/Vectorscope/Vectorscope.h | 6 ++++++ 8 files changed, 67 insertions(+), 5 deletions(-) diff --git a/plugins/Vectorscope/VecControls.cpp b/plugins/Vectorscope/VecControls.cpp index 0e7a2d06160..5007c348c4d 100644 --- a/plugins/Vectorscope/VecControls.cpp +++ b/plugins/Vectorscope/VecControls.cpp @@ -29,6 +29,9 @@ #include "VecControlsDialog.h" #include "Vectorscope.h" +namespace lmms +{ + VecControls::VecControls(Vectorscope *effect) : EffectControls(effect), @@ -48,9 +51,9 @@ VecControls::VecControls(Vectorscope *effect) : // Create the VecControlDialog widget which handles display of GUI elements. -EffectControlDialog* VecControls::createView() +gui::EffectControlDialog* VecControls::createView() { - return new VecControlsDialog(this); + return new gui::VecControlsDialog(this); } @@ -68,3 +71,6 @@ void VecControls::saveSettings(QDomDocument &document, QDomElement &element) m_logarithmicModel.saveSettings(document, element, "Logarithmic"); m_highQualityModel.saveSettings(document, element, "HighQuality"); } + + +} // namespace lmms diff --git a/plugins/Vectorscope/VecControls.h b/plugins/Vectorscope/VecControls.h index 04b688e5a5b..e4aa27b435c 100644 --- a/plugins/Vectorscope/VecControls.h +++ b/plugins/Vectorscope/VecControls.h @@ -29,9 +29,18 @@ #include "EffectControls.h" +namespace lmms +{ + class Vectorscope; +namespace gui +{ +class VecControlsDialog; +class VectorView; +} + // Holds all the configuration values class VecControls : public EffectControls { @@ -40,7 +49,7 @@ class VecControls : public EffectControls explicit VecControls(Vectorscope *effect); virtual ~VecControls() {} - EffectControlDialog *createView() override; + gui::EffectControlDialog* createView() override; void saveSettings (QDomDocument &document, QDomElement &element) override; void loadSettings (const QDomElement &element) override; @@ -60,7 +69,11 @@ class VecControls : public EffectControls QColor m_colorLabels; QColor m_colorOutline; - friend class VecControlsDialog; - friend class VectorView; + friend class gui::VecControlsDialog; + friend class gui::VectorView; }; + + +} // namespace lmms + #endif // VECCONTROLS_H diff --git a/plugins/Vectorscope/VecControlsDialog.cpp b/plugins/Vectorscope/VecControlsDialog.cpp index 9916d775605..70ae9ff23eb 100644 --- a/plugins/Vectorscope/VecControlsDialog.cpp +++ b/plugins/Vectorscope/VecControlsDialog.cpp @@ -36,6 +36,9 @@ #include "Vectorscope.h" #include "VectorView.h" +namespace lmms::gui +{ + // The entire GUI layout is built here. VecControlsDialog::VecControlsDialog(VecControls *controls) : @@ -92,3 +95,6 @@ QSize VecControlsDialog::sizeHint() const { return QSize(275, 300); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/Vectorscope/VecControlsDialog.h b/plugins/Vectorscope/VecControlsDialog.h index b76c06ad001..97108cdf409 100644 --- a/plugins/Vectorscope/VecControlsDialog.h +++ b/plugins/Vectorscope/VecControlsDialog.h @@ -27,8 +27,16 @@ #include "EffectControlDialog.h" +namespace lmms +{ + + class VecControls; +namespace gui +{ + + //! Top-level widget holding the configuration GUI and vector display class VecControlsDialog : public EffectControlDialog { @@ -44,4 +52,9 @@ class VecControlsDialog : public EffectControlDialog VecControls *m_controls; }; + +} // namespace gui + +} // namespace lmms + #endif // VECCONTROLSDIALOG_H diff --git a/plugins/Vectorscope/VectorView.cpp b/plugins/Vectorscope/VectorView.cpp index f6db921cc3a..06c9ee93bf5 100644 --- a/plugins/Vectorscope/VectorView.cpp +++ b/plugins/Vectorscope/VectorView.cpp @@ -32,6 +32,9 @@ #include "GuiApplication.h" #include "MainWindow.h" +namespace lmms::gui +{ + VectorView::VectorView(VecControls *controls, LocklessRingBuffer *inputBuffer, unsigned short displaySize, QWidget *parent) : QWidget(parent), @@ -326,3 +329,6 @@ void VectorView::wheelEvent(QWheelEvent *event) ).count(); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/Vectorscope/VectorView.h b/plugins/Vectorscope/VectorView.h index 066e306a0a0..0c827ba4fb5 100644 --- a/plugins/Vectorscope/VectorView.h +++ b/plugins/Vectorscope/VectorView.h @@ -34,6 +34,9 @@ //#define VEC_DEBUG +namespace lmms::gui +{ + // Widget that displays a vectorscope visualization of stereo signal. class VectorView : public QWidget @@ -77,4 +80,8 @@ private slots: float m_executionAvg = 0; #endif }; + + +} // namespace lmms::gui + #endif // VECTORVIEW_H diff --git a/plugins/Vectorscope/Vectorscope.cpp b/plugins/Vectorscope/Vectorscope.cpp index b3c2b2dda6f..df093f6715a 100644 --- a/plugins/Vectorscope/Vectorscope.cpp +++ b/plugins/Vectorscope/Vectorscope.cpp @@ -27,6 +27,9 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + extern "C" { Plugin::Descriptor PLUGIN_EXPORT vectorscope_plugin_descriptor = @@ -78,3 +81,5 @@ extern "C" { } } + +} // namespace lmms diff --git a/plugins/Vectorscope/Vectorscope.h b/plugins/Vectorscope/Vectorscope.h index b45ff6de4ab..973fecf0e11 100644 --- a/plugins/Vectorscope/Vectorscope.h +++ b/plugins/Vectorscope/Vectorscope.h @@ -28,6 +28,9 @@ #include "LocklessRingBuffer.h" #include "VecControls.h" +namespace lmms +{ + //! Top level class; handles LMMS interface and accumulates data for processing. class Vectorscope : public Effect @@ -48,5 +51,8 @@ class Vectorscope : public Effect LocklessRingBuffer m_inputBuffer; }; + +} // namespace lmms + #endif // VECTORSCOPE_H From 3fa1edd4ce271454bef1d4d735e7e909e4e05815 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 01:57:41 +0200 Subject: [PATCH 058/118] Add namespaces to VibedStrings plugin. --- plugins/vibed/nine_button_selector.cpp | 6 ++++++ plugins/vibed/nine_button_selector.h | 6 ++++++ plugins/vibed/string_container.cpp | 6 ++++++ plugins/vibed/string_container.h | 6 ++++++ plugins/vibed/vibed.cpp | 18 +++++++++++++----- plugins/vibed/vibed.h | 24 ++++++++++++++++++++---- plugins/vibed/vibrating_string.cpp | 5 +++++ plugins/vibed/vibrating_string.h | 7 +++++++ 8 files changed, 69 insertions(+), 9 deletions(-) diff --git a/plugins/vibed/nine_button_selector.cpp b/plugins/vibed/nine_button_selector.cpp index 222f232ee3f..3c61dcd7f73 100644 --- a/plugins/vibed/nine_button_selector.cpp +++ b/plugins/vibed/nine_button_selector.cpp @@ -29,6 +29,9 @@ #include "CaptionMenu.h" #include "embed.h" +namespace lmms::gui +{ + nineButtonSelector::nineButtonSelector( QPixmap _button0_on, QPixmap _button0_off, @@ -252,3 +255,6 @@ void nineButtonSelector::contextMenuEvent( QContextMenuEvent * ) CaptionMenu contextMenu( windowTitle(), this ); contextMenu.exec( QCursor::pos() ); } + + +} // namespace lmms::gui diff --git a/plugins/vibed/nine_button_selector.h b/plugins/vibed/nine_button_selector.h index dd68a8261fe..8190b594197 100644 --- a/plugins/vibed/nine_button_selector.h +++ b/plugins/vibed/nine_button_selector.h @@ -27,6 +27,9 @@ #include "PixmapButton.h" +namespace lmms::gui +{ + class nineButtonSelector: public QWidget , public IntModelView { @@ -90,4 +93,7 @@ public slots: typedef IntModel nineButtonSelectorModel; + +} // namespace lmms::gui + #endif diff --git a/plugins/vibed/string_container.cpp b/plugins/vibed/string_container.cpp index 424f333a16e..abc1fc04dbe 100644 --- a/plugins/vibed/string_container.cpp +++ b/plugins/vibed/string_container.cpp @@ -24,6 +24,9 @@ #include "string_container.h" +namespace lmms +{ + stringContainer::stringContainer(const float _pitch, const sample_rate_t _sample_rate, @@ -100,3 +103,6 @@ void stringContainer::addString(int _harm, _state ) ); m_exists[_id] = true; } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/vibed/string_container.h b/plugins/vibed/string_container.h index f615080790e..44984730214 100644 --- a/plugins/vibed/string_container.h +++ b/plugins/vibed/string_container.h @@ -29,6 +29,9 @@ #include "vibrating_string.h" #include "MemoryManager.h" +namespace lmms +{ + class stringContainer { @@ -77,4 +80,7 @@ class stringContainer QVector m_exists; } ; + +} // namespace lmms + #endif diff --git a/plugins/vibed/vibed.cpp b/plugins/vibed/vibed.cpp index 8e582158f6e..32fb4a562c3 100644 --- a/plugins/vibed/vibed.cpp +++ b/plugins/vibed/vibed.cpp @@ -41,6 +41,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -67,7 +71,7 @@ vibed::vibed( InstrumentTrack * _instrumentTrack ) : FloatModel * knob; BoolModel * led; - nineButtonSelectorModel * harmonic; + gui::nineButtonSelectorModel * harmonic; graphModel * graphTmp; for( int harm = 0; harm < 9; harm++ ) @@ -112,7 +116,7 @@ vibed::vibed( InstrumentTrack * _instrumentTrack ) : tr( "String %1" ).arg( harm+1 ) ); m_powerButtons.append( led ); - harmonic = new nineButtonSelectorModel( 2, 0, 8, this ); + harmonic = new gui::nineButtonSelectorModel( 2, 0, 8, this ); m_harmonics.append( harmonic ); graphTmp = new graphModel( -1.0, 1.0, __sampleLength, this ); @@ -338,13 +342,15 @@ void vibed::deleteNotePluginData( NotePlayHandle * _n ) -PluginView * vibed::instantiateView( QWidget * _parent ) +gui::PluginView* vibed::instantiateView( QWidget * _parent ) { - return( new vibedView( this, _parent ) ); + return( new gui::vibedView( this, _parent ) ); } +namespace gui +{ vibedView::vibedView( Instrument * _instrument, @@ -677,6 +683,8 @@ void vibedView::contextMenuEvent( QContextMenuEvent * ) } +} // namespace gui + extern "C" { @@ -690,4 +698,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } - +} // namespace lmms diff --git a/plugins/vibed/vibed.h b/plugins/vibed/vibed.h index b1c33f4b711..3e0268d05bd 100644 --- a/plugins/vibed/vibed.h +++ b/plugins/vibed/vibed.h @@ -32,9 +32,17 @@ #include "LedCheckbox.h" #include "nine_button_selector.h" -class vibedView; +namespace lmms +{ + + class NotePlayHandle; +namespace gui +{ +class vibedView; +} + class vibed : public Instrument { Q_OBJECT @@ -58,7 +66,7 @@ class vibed : public Instrument } - virtual PluginView * instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; private: @@ -73,14 +81,17 @@ class vibed : public Instrument QList m_powerButtons; QList m_graphs; QList m_impulses; - QList m_harmonics; + QList m_harmonics; static const int __sampleLength = 128; - friend class vibedView; + friend class gui::vibedView; } ; +namespace gui +{ + class vibedView : public InstrumentViewFixedSize { @@ -138,4 +149,9 @@ protected slots: }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/vibed/vibrating_string.cpp b/plugins/vibed/vibrating_string.cpp index aee2d252720..5520a5fb555 100644 --- a/plugins/vibed/vibrating_string.cpp +++ b/plugins/vibed/vibrating_string.cpp @@ -28,6 +28,9 @@ #include "AudioEngine.h" #include "Engine.h" +namespace lmms +{ + vibratingString::vibratingString( float _pitch, float _pick, @@ -156,3 +159,5 @@ void vibratingString::resample( float *_src, f_cnt_t _src_frames, } } + +} // namespace lmms diff --git a/plugins/vibed/vibrating_string.h b/plugins/vibed/vibrating_string.h index 3739d19a9a8..412ccf4922f 100644 --- a/plugins/vibed/vibrating_string.h +++ b/plugins/vibed/vibrating_string.h @@ -29,6 +29,10 @@ #include "lmms_basics.h" +namespace lmms +{ + + class vibratingString { @@ -268,4 +272,7 @@ class vibratingString } ; + +} // namespace lmms + #endif From 51dbf04e75e0187f30f938b02334b5ac3fc04d72 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 15:42:14 +0200 Subject: [PATCH 059/118] Add namespaces to VstEffect plugin. --- plugins/VstEffect/VstEffect.cpp | 10 ++++++++-- plugins/VstEffect/VstEffect.h | 10 ++++++++-- plugins/VstEffect/VstEffectControlDialog.cpp | 6 ++++++ plugins/VstEffect/VstEffectControlDialog.h | 17 ++++++++++++++--- plugins/VstEffect/VstEffectControls.cpp | 16 ++++++++++------ plugins/VstEffect/VstEffectControls.h | 20 +++++++++++++++++--- plugins/VstEffect/VstSubPluginFeatures.cpp | 4 ++++ plugins/VstEffect/VstSubPluginFeatures.h | 6 ++++-- 8 files changed, 71 insertions(+), 18 deletions(-) diff --git a/plugins/VstEffect/VstEffect.cpp b/plugins/VstEffect/VstEffect.cpp index d3d722990b6..b0222010b7c 100644 --- a/plugins/VstEffect/VstEffect.cpp +++ b/plugins/VstEffect/VstEffect.cpp @@ -34,6 +34,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -126,10 +130,10 @@ bool VstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) void VstEffect::openPlugin( const QString & _plugin ) { - TextFloat * tf = nullptr; + gui::TextFloat* tf = nullptr; if( getGUI() != nullptr ) { - tf = TextFloat::displayMessage( + tf = gui::TextFloat::displayMessage( VstPlugin::tr( "Loading plugin" ), VstPlugin::tr( "Please wait while loading VST plugin..." ), PLUGIN_NAME::getIconPixmap( "logo", 24, 24 ), 0 ); @@ -166,3 +170,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * _parent, void * _data ) } + +} // namespace lmms diff --git a/plugins/VstEffect/VstEffect.h b/plugins/VstEffect/VstEffect.h index 95834e86294..b1e403d13a5 100644 --- a/plugins/VstEffect/VstEffect.h +++ b/plugins/VstEffect/VstEffect.h @@ -32,8 +32,13 @@ #include "VstEffectControlDialog.h" #include "VstEffectControls.h" +namespace lmms +{ + + class VstPlugin; + class VstEffect : public Effect { public: @@ -67,11 +72,12 @@ class VstEffect : public Effect friend class VstEffectControls; - friend class VstEffectControlDialog; - friend class manageVSTEffectView; + friend class gui::VstEffectControlDialog; + friend class gui::manageVSTEffectView; } ; +} // namespace lmms #endif diff --git a/plugins/VstEffect/VstEffectControlDialog.cpp b/plugins/VstEffect/VstEffectControlDialog.cpp index f160367d0aa..ae949b99f62 100644 --- a/plugins/VstEffect/VstEffectControlDialog.cpp +++ b/plugins/VstEffect/VstEffectControlDialog.cpp @@ -41,6 +41,10 @@ #include #include +namespace lmms::gui +{ + + VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) : EffectControlDialog( _ctl ), m_pluginWidget( nullptr ), @@ -298,3 +302,5 @@ void VstEffectControlDialog::togglePluginUI( bool checked ) } } + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/VstEffect/VstEffectControlDialog.h b/plugins/VstEffect/VstEffectControlDialog.h index 930f514c9b3..03f00784aca 100644 --- a/plugins/VstEffect/VstEffectControlDialog.h +++ b/plugins/VstEffect/VstEffectControlDialog.h @@ -33,11 +33,17 @@ #include #include - -class VstEffectControls; -class PixmapButton; class QPixmap; class QPushButton; + +namespace lmms +{ + +class VstEffectControls; + +namespace gui +{ + class PixmapButton; @@ -70,4 +76,9 @@ public slots: void togglePluginUI( bool checked ); } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/VstEffect/VstEffectControls.cpp b/plugins/VstEffect/VstEffectControls.cpp index 68181e2a068..13df9655ad2 100644 --- a/plugins/VstEffect/VstEffectControls.cpp +++ b/plugins/VstEffect/VstEffectControls.cpp @@ -33,6 +33,8 @@ #include #include +namespace lmms +{ VstEffectControls::VstEffectControls( VstEffect * _eff ) : @@ -146,9 +148,9 @@ int VstEffectControls::controlCount() -EffectControlDialog *VstEffectControls::createView() +gui::EffectControlDialog* VstEffectControls::createView() { - auto dialog = new VstEffectControlDialog( this ); + auto dialog = new gui::VstEffectControlDialog( this ); dialog->togglePluginUI( m_vstGuiVisible ); return dialog; } @@ -159,7 +161,7 @@ EffectControlDialog *VstEffectControls::createView() void VstEffectControls::managePlugin( void ) { if ( m_effect->m_plugin != nullptr && m_subWindow == nullptr ) { - manageVSTEffectView * tt = new manageVSTEffectView( m_effect, this); + gui::manageVSTEffectView* tt = new gui::manageVSTEffectView( m_effect, this); ctrHandle = (QObject *)tt; } else if (m_subWindow != nullptr) { if (m_subWindow->widget()->isVisible() == false ) { @@ -299,6 +301,9 @@ void VstEffectControls::paintEvent( QPaintEvent * ) +namespace gui +{ + manageVSTEffectView::manageVSTEffectView( VstEffect * _eff, VstEffectControls * m_vi ) : m_effect( _eff ) @@ -563,7 +568,6 @@ manageVSTEffectView::~manageVSTEffectView() } +} // namespace gui - - - +} // namespace lmms diff --git a/plugins/VstEffect/VstEffectControls.h b/plugins/VstEffect/VstEffectControls.h index cb98d0f439a..56537cdc1c1 100644 --- a/plugins/VstEffect/VstEffectControls.h +++ b/plugins/VstEffect/VstEffectControls.h @@ -39,9 +39,17 @@ #include #include +namespace lmms +{ + class VstEffect; +namespace gui +{ +class manageVSTEffectView; +} + class VstEffectControls : public EffectControls { @@ -59,7 +67,7 @@ class VstEffectControls : public EffectControls virtual int controlCount(); - virtual EffectControlDialog * createView(); + virtual gui::EffectControlDialog* createView(); protected slots: @@ -90,13 +98,15 @@ protected slots: int lastPosInMenu; // QLabel * m_presetLabel; - friend class VstEffectControlDialog; - friend class manageVSTEffectView; + friend class gui::VstEffectControlDialog; + friend class gui::manageVSTEffectView; bool m_vstGuiVisible; } ; +namespace gui +{ class manageVSTEffectView : public QObject @@ -135,4 +145,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/VstEffect/VstSubPluginFeatures.cpp b/plugins/VstEffect/VstSubPluginFeatures.cpp index b2141cd70f0..d69a53e4e82 100644 --- a/plugins/VstEffect/VstSubPluginFeatures.cpp +++ b/plugins/VstEffect/VstSubPluginFeatures.cpp @@ -30,6 +30,8 @@ #include "VstSubPluginFeatures.h" #include "ConfigManager.h" +namespace lmms +{ VstSubPluginFeatures::VstSubPluginFeatures( Plugin::PluginTypes _type ) : @@ -90,3 +92,5 @@ void VstSubPluginFeatures::addPluginsFromDir( QStringList* filenames, QString pa } } + +} // namespace lmms diff --git a/plugins/VstEffect/VstSubPluginFeatures.h b/plugins/VstEffect/VstSubPluginFeatures.h index 00629d66d44..3343df0142b 100644 --- a/plugins/VstEffect/VstSubPluginFeatures.h +++ b/plugins/VstEffect/VstSubPluginFeatures.h @@ -29,6 +29,9 @@ #include "Effect.h" +namespace lmms +{ + class VstSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures { @@ -45,8 +48,7 @@ class VstSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures } ; - - +} // namespace lmms #endif From 649dd0f39407b537769288b04684e3dee2b0ecb1 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 15:46:32 +0200 Subject: [PATCH 060/118] Add namespaces to Watsyn plugin. --- plugins/watsyn/Watsyn.cpp | 13 ++++++++++--- plugins/watsyn/Watsyn.h | 21 +++++++++++++++++++-- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/plugins/watsyn/Watsyn.cpp b/plugins/watsyn/Watsyn.cpp index d8b6f80f483..c8a476b76a4 100644 --- a/plugins/watsyn/Watsyn.cpp +++ b/plugins/watsyn/Watsyn.cpp @@ -37,6 +37,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -580,9 +584,9 @@ QString WatsynInstrument::nodeName() const } -PluginView * WatsynInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* WatsynInstrument::instantiateView( QWidget * _parent ) { - return( new WatsynView( this, _parent ) ); + return( new gui::WatsynView( this, _parent ) ); } @@ -662,6 +666,8 @@ void WatsynInstrument::updateWaveB2() } +namespace gui +{ WatsynView::WatsynView( Instrument * _instrument, @@ -1271,6 +1277,7 @@ void WatsynView::modelChanged() } +} // namespace gui @@ -1287,4 +1294,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } - +} // namespace lmms diff --git a/plugins/watsyn/Watsyn.h b/plugins/watsyn/Watsyn.h index 079e532e41a..70b1491dc6f 100644 --- a/plugins/watsyn/Watsyn.h +++ b/plugins/watsyn/Watsyn.h @@ -37,6 +37,9 @@ #include #include "MemoryManager.h" +namespace lmms +{ + #define makeknob( name, x, y, hint, unit, oname ) \ name = new Knob( knobStyled, this ); \ @@ -79,6 +82,11 @@ const int NUM_OSCS = 4; class WatsynInstrument; +namespace gui +{ +class WatsynView; +} + class WatsynObject { MM_OPERATORS @@ -150,7 +158,7 @@ class WatsynInstrument : public Instrument return( 64 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); public slots: void updateVolumes(); @@ -289,10 +297,14 @@ public slots: float B2_wave [WAVELEN]; friend class WatsynObject; - friend class WatsynView; + friend class gui::WatsynView; }; +namespace gui +{ + + class WatsynView : public InstrumentViewFixedSize { Q_OBJECT @@ -377,4 +389,9 @@ protected slots: }; + +} // namespace gui + +} // namespace lmms + #endif From 00fbd1e27d374967bdb0c7c2f6898fe69b176a4f Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 15:49:24 +0200 Subject: [PATCH 061/118] Add namespace to Waveshaper plugin. --- plugins/waveshaper/waveshaper.cpp | 6 ++++++ plugins/waveshaper/waveshaper.h | 4 +++- plugins/waveshaper/waveshaper_control_dialog.cpp | 5 +++++ plugins/waveshaper/waveshaper_control_dialog.h | 10 ++++++++++ plugins/waveshaper/waveshaper_controls.cpp | 6 ++++-- plugins/waveshaper/waveshaper_controls.h | 13 ++++++++++--- 6 files changed, 38 insertions(+), 6 deletions(-) diff --git a/plugins/waveshaper/waveshaper.cpp b/plugins/waveshaper/waveshaper.cpp index 4fe08260054..e248092ca5a 100644 --- a/plugins/waveshaper/waveshaper.cpp +++ b/plugins/waveshaper/waveshaper.cpp @@ -31,6 +31,10 @@ #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -171,3 +175,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * _parent, void * _data ) } + +} // namespace lmms diff --git a/plugins/waveshaper/waveshaper.h b/plugins/waveshaper/waveshaper.h index 0a2f931eb76..caefb2c431c 100644 --- a/plugins/waveshaper/waveshaper.h +++ b/plugins/waveshaper/waveshaper.h @@ -30,6 +30,8 @@ #include "Effect.h" #include "waveshaper_controls.h" +namespace lmms +{ class waveShaperEffect : public Effect @@ -56,7 +58,7 @@ class waveShaperEffect : public Effect } ; - +} // namespace lmms #endif diff --git a/plugins/waveshaper/waveshaper_control_dialog.cpp b/plugins/waveshaper/waveshaper_control_dialog.cpp index ffa75d51378..2fd2f56896e 100644 --- a/plugins/waveshaper/waveshaper_control_dialog.cpp +++ b/plugins/waveshaper/waveshaper_control_dialog.cpp @@ -34,6 +34,9 @@ #include "ToolTip.h" #include "LedCheckbox.h" +namespace lmms::gui +{ + waveShaperControlDialog::waveShaperControlDialog( waveShaperControls * _controls ) : @@ -117,3 +120,5 @@ waveShaperControlDialog::waveShaperControlDialog( _controls, SLOT( subOneClicked() ) ); } + +} // namespace lmms::gui diff --git a/plugins/waveshaper/waveshaper_control_dialog.h b/plugins/waveshaper/waveshaper_control_dialog.h index f4743da5147..ae453a5cce7 100644 --- a/plugins/waveshaper/waveshaper_control_dialog.h +++ b/plugins/waveshaper/waveshaper_control_dialog.h @@ -28,9 +28,14 @@ #include "EffectControlDialog.h" +namespace lmms +{ class waveShaperControls; +namespace gui +{ + class waveShaperControlDialog : public EffectControlDialog { @@ -46,4 +51,9 @@ class waveShaperControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/waveshaper/waveshaper_controls.cpp b/plugins/waveshaper/waveshaper_controls.cpp index 35241353908..f392cca239a 100644 --- a/plugins/waveshaper/waveshaper_controls.cpp +++ b/plugins/waveshaper/waveshaper_controls.cpp @@ -33,6 +33,9 @@ #include "Engine.h" #include "Song.h" +namespace lmms +{ + #define onedB 1.1220184543019633f @@ -143,5 +146,4 @@ void waveShaperControls::subOneClicked() } - - +} // namespace lmms \ No newline at end of file diff --git a/plugins/waveshaper/waveshaper_controls.h b/plugins/waveshaper/waveshaper_controls.h index 550dcc75244..7d30dd17b5d 100644 --- a/plugins/waveshaper/waveshaper_controls.h +++ b/plugins/waveshaper/waveshaper_controls.h @@ -31,6 +31,10 @@ #include "Knob.h" #include "Graph.h" +namespace lmms +{ + + class waveShaperEffect; @@ -57,9 +61,9 @@ class waveShaperControls : public EffectControls return( 4 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return( new waveShaperControlDialog( this ) ); + return( new gui::waveShaperControlDialog( this ) ); } @@ -79,9 +83,12 @@ private slots: graphModel m_wavegraphModel; BoolModel m_clipModel; - friend class waveShaperControlDialog; + friend class gui::waveShaperControlDialog; friend class waveShaperEffect; } ; + +} // namespace lmms + #endif From c898cae23ea7d9854b2830e939e4a28e3ecfa529 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 15:54:48 +0200 Subject: [PATCH 062/118] Add namespaces to Xpressive plugin. --- plugins/Xpressive/ExprSynth.cpp | 8 ++ plugins/Xpressive/ExprSynth.h | 4 + plugins/Xpressive/Xpressive.cpp | 125 +++++++++++++++++--------------- plugins/Xpressive/Xpressive.h | 14 +++- 4 files changed, 93 insertions(+), 58 deletions(-) diff --git a/plugins/Xpressive/ExprSynth.cpp b/plugins/Xpressive/ExprSynth.cpp index 7d1cf13b65c..a1b097e50cc 100644 --- a/plugins/Xpressive/ExprSynth.cpp +++ b/plugins/Xpressive/ExprSynth.cpp @@ -41,6 +41,11 @@ #include "exprtk.hpp" #define WARN_EXPRTK qWarning("ExprTk exception") + +namespace lmms +{ + + typedef exprtk::symbol_table symbol_table_t; typedef exprtk::expression expression_t; typedef exprtk::parser parser_t; @@ -822,3 +827,6 @@ void ExprSynth::renderOutput(fpp_t frames, sampleFrame *buf) WARN_EXPRTK; } } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/Xpressive/ExprSynth.h b/plugins/Xpressive/ExprSynth.h index bb25fd036dd..a59127bc0c3 100644 --- a/plugins/Xpressive/ExprSynth.h +++ b/plugins/Xpressive/ExprSynth.h @@ -33,6 +33,9 @@ #include "Instrument.h" #include "MemoryManager.h" +namespace lmms +{ + class ExprFrontData; @@ -141,5 +144,6 @@ inline void clearArray(T* arr,unsigned int size) } +} // namespace lmms #endif diff --git a/plugins/Xpressive/Xpressive.cpp b/plugins/Xpressive/Xpressive.cpp index 51b00de878d..3af99f23edf 100644 --- a/plugins/Xpressive/Xpressive.cpp +++ b/plugins/Xpressive/Xpressive.cpp @@ -50,6 +50,10 @@ #include "plugin_export.h" +namespace lmms +{ + + extern "C" { Plugin::Descriptor PLUGIN_EXPORT xpressive_plugin_descriptor = { STRINGIFY( @@ -244,10 +248,43 @@ void Xpressive::deleteNotePluginData(NotePlayHandle* nph) { delete static_cast(nph->m_pluginData); } -PluginView * Xpressive::instantiateView(QWidget* parent) { - return (new XpressiveView(this, parent)); +gui::PluginView* Xpressive::instantiateView(QWidget* parent) { + return (new gui::XpressiveView(this, parent)); +} + + +void Xpressive::smooth(float smoothness,const graphModel * in,graphModel * out) +{ + out->setSamples(in->samples()); + if (smoothness>0) + { + const int guass_size = (int)(smoothness * 5) | 1; + const int guass_center = guass_size/2; + const float delta = smoothness; + const float a= 1.0f / (sqrtf(2.0f * F_PI) * delta); + float * const guassian = new float [guass_size]; + float sum = 0.0f; + float temp = 0.0f; + int i; + for (i = 0; i < guass_size; i++ ) + { + temp = (i - guass_center) / delta; + sum += guassian[i] = a * powf(F_E, -0.5f * temp * temp); + } + for (i = 0; i < guass_size; i++ ) + { + guassian[i] = guassian[i] / sum; + } + out->convolve(guassian, guass_size, guass_center); + delete [] guassian; + } } + +namespace gui +{ + + class XpressiveKnob: public Knob { public: void setStyle() @@ -261,11 +298,11 @@ class XpressiveKnob: public Knob { setLineWidth(3); } XpressiveKnob(QWidget * _parent, const QString & _name) : - Knob(knobStyled, _parent,_name) { + Knob(knobStyled, _parent,_name) { setStyle(); } XpressiveKnob(QWidget * _parent) : - Knob(knobStyled, _parent) { + Knob(knobStyled, _parent) { setStyle(); } @@ -302,7 +339,7 @@ XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) : m_graph->setEnabled(false); ToolTip::add(m_graph, tr("Draw your own waveform here " - "by dragging your mouse on this graph.")); + "by dragging your mouse on this graph.")); pal = QPalette(); pal.setBrush(backgroundRole(), PLUGIN_NAME::getIconPixmap("wavegraph")); @@ -395,24 +432,24 @@ XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) : m_triangleWaveBtn = new PixmapButton(this, tr("Triangle wave")); m_triangleWaveBtn->move(4 + 14, ROW_WAVEBTN); m_triangleWaveBtn->setActiveGraphic( - embed::getIconPixmap("triangle_wave_active")); + embed::getIconPixmap("triangle_wave_active")); m_triangleWaveBtn->setInactiveGraphic( - embed::getIconPixmap("triangle_wave_inactive")); + embed::getIconPixmap("triangle_wave_inactive")); ToolTip::add(m_triangleWaveBtn, tr("Triangle wave")); m_sqrWaveBtn = new PixmapButton(this, tr("Square wave")); m_sqrWaveBtn->move(4 + 14 * 2, ROW_WAVEBTN); m_sqrWaveBtn->setActiveGraphic(embed::getIconPixmap("square_wave_active")); m_sqrWaveBtn->setInactiveGraphic( - embed::getIconPixmap("square_wave_inactive")); + embed::getIconPixmap("square_wave_inactive")); ToolTip::add(m_sqrWaveBtn, tr("Square wave")); m_whiteNoiseWaveBtn = new PixmapButton(this, tr("White noise")); m_whiteNoiseWaveBtn->move(4 + 14 * 3, ROW_WAVEBTN); m_whiteNoiseWaveBtn->setActiveGraphic( - embed::getIconPixmap("white_noise_wave_active")); + embed::getIconPixmap("white_noise_wave_active")); m_whiteNoiseWaveBtn->setInactiveGraphic( - embed::getIconPixmap("white_noise_wave_inactive")); + embed::getIconPixmap("white_noise_wave_inactive")); ToolTip::add(m_whiteNoiseWaveBtn, tr("White noise")); @@ -421,7 +458,7 @@ XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) : m_waveInterpolate->move(2, 230); m_expressionValidToggle = new LedCheckBox("", this, tr("ExpressionValid"), - LedCheckBox::Red); + LedCheckBox::Red); m_expressionValidToggle->move(168, EXPR_TEXT_Y+EXPR_TEXT_H-2); m_expressionValidToggle->setEnabled( false ); @@ -502,6 +539,7 @@ XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) : updateLayout(); } + XpressiveView::~XpressiveView() { } @@ -512,21 +550,21 @@ void XpressiveView::expressionChanged() { QByteArray text = m_expressionEditor->toPlainText().toLatin1(); switch (m_selectedGraphGroup->model()->value()) { - case W1_EXPR: - e->wavesExpression(0) = text; - break; - case W2_EXPR: - e->wavesExpression(1) = text; - break; - case W3_EXPR: - e->wavesExpression(2) = text; - break; - case O1_EXPR: - e->outputExpression(0) = text; - break; - case O2_EXPR: - e->outputExpression(1) = text; - break; + case W1_EXPR: + e->wavesExpression(0) = text; + break; + case W2_EXPR: + e->wavesExpression(1) = text; + break; + case W3_EXPR: + e->wavesExpression(2) = text; + break; + case O1_EXPR: + e->outputExpression(0) = text; + break; + case O2_EXPR: + e->outputExpression(1) = text; + break; } if (m_wave_expr) m_graph->setEnabled(m_smoothKnob->model()->value() == 0 && text.size() == 0); @@ -597,35 +635,6 @@ void XpressiveView::expressionChanged() { } } -void Xpressive::smooth(float smoothness,const graphModel * in,graphModel * out) -{ - out->setSamples(in->samples()); - if (smoothness>0) - { - const int guass_size = (int)(smoothness * 5) | 1; - const int guass_center = guass_size/2; - const float delta = smoothness; - const float a= 1.0f / (sqrtf(2.0f * F_PI) * delta); - float * const guassian = new float [guass_size]; - float sum = 0.0f; - float temp = 0.0f; - int i; - for (i = 0; i < guass_size; i++ ) - { - temp = (i - guass_center) / delta; - sum += guassian[i] = a * powf(F_E, -0.5f * temp * temp); - } - for (i = 0; i < guass_size; i++ ) - { - guassian[i] = guassian[i] / sum; - } - out->convolve(guassian, guass_size, guass_center); - delete [] guassian; - } -} - - - void XpressiveView::smoothChanged() { @@ -889,6 +898,9 @@ void XpressiveView::helpClicked() { } + +} // namespace gui + extern "C" { // necessary for getting instance out of shared lib @@ -899,5 +911,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main(Model *m, void *) { } - - +} // namespace lmms diff --git a/plugins/Xpressive/Xpressive.h b/plugins/Xpressive/Xpressive.h index 5abee26912c..2c86f24a271 100644 --- a/plugins/Xpressive/Xpressive.h +++ b/plugins/Xpressive/Xpressive.h @@ -37,6 +37,10 @@ #include "ExprSynth.h" +namespace lmms +{ + + class oscillator; class XpressiveView; @@ -71,7 +75,7 @@ class Xpressive : public Instrument virtual QString nodeName() const; - virtual PluginView* instantiateView( QWidget * parent ); + gui::PluginView* instantiateView( QWidget * parent ) override; graphModel& graphO1() { return m_graphO1; } graphModel& graphO2() { return m_graphO2; } @@ -138,6 +142,9 @@ protected slots: } ; +namespace gui +{ + class XpressiveView : public InstrumentViewFixedSize { @@ -218,4 +225,9 @@ class XpressiveHelpView: public QTextEdit static QString s_helpText; }; + +} // namespace gui + +} // namespace lmms + #endif From 1840a3e64dd24cdad27af80b7e9198b4990cb155 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 17:12:02 +0200 Subject: [PATCH 063/118] Add namespaces to ZynAddSubFX plugin. --- plugins/zynaddsubfx/LocalZynAddSubFx.cpp | 8 +++++++- plugins/zynaddsubfx/LocalZynAddSubFx.h | 7 +++++++ plugins/zynaddsubfx/RemoteZynAddSubFx.cpp | 1 + plugins/zynaddsubfx/RemoteZynAddSubFx.h | 9 ++++++++- plugins/zynaddsubfx/ZynAddSubFx.cpp | 13 ++++++++++--- plugins/zynaddsubfx/ZynAddSubFx.h | 22 ++++++++++++++++++---- 6 files changed, 51 insertions(+), 9 deletions(-) diff --git a/plugins/zynaddsubfx/LocalZynAddSubFx.cpp b/plugins/zynaddsubfx/LocalZynAddSubFx.cpp index b6a036ed219..f7146d89b71 100644 --- a/plugins/zynaddsubfx/LocalZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/LocalZynAddSubFx.cpp @@ -35,9 +35,14 @@ #include "zynaddsubfx/src/Misc/Part.h" #include "zynaddsubfx/src/Misc/Dump.h" - +// Global variable in zynaddsubfx/src/globals.h SYNTH_T* synth = nullptr; + +namespace lmms +{ + + int LocalZynAddSubFx::s_instanceCount = 0; @@ -275,3 +280,4 @@ void LocalZynAddSubFx::processAudio( sampleFrame * _out ) } +} // namespace lmms diff --git a/plugins/zynaddsubfx/LocalZynAddSubFx.h b/plugins/zynaddsubfx/LocalZynAddSubFx.h index 7068d0b1283..f3dad2aee7e 100644 --- a/plugins/zynaddsubfx/LocalZynAddSubFx.h +++ b/plugins/zynaddsubfx/LocalZynAddSubFx.h @@ -31,6 +31,10 @@ class Master; class NulEngine; +namespace lmms +{ + + class LocalZynAddSubFx { public: @@ -73,4 +77,7 @@ class LocalZynAddSubFx } ; + +} // namespace lmms + #endif diff --git a/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp b/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp index a3154421762..1c306de3e19 100644 --- a/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/RemoteZynAddSubFx.cpp @@ -41,6 +41,7 @@ #include "zynaddsubfx/src/Nio/Nio.h" #include "zynaddsubfx/src/UI/MasterUI.h" +using namespace lmms; class RemoteZynAddSubFx : public RemotePluginClient, public LocalZynAddSubFx { diff --git a/plugins/zynaddsubfx/RemoteZynAddSubFx.h b/plugins/zynaddsubfx/RemoteZynAddSubFx.h index db2ea4fa0bb..47474c8d6ff 100644 --- a/plugins/zynaddsubfx/RemoteZynAddSubFx.h +++ b/plugins/zynaddsubfx/RemoteZynAddSubFx.h @@ -27,11 +27,18 @@ #include "RemotePlugin.h" +namespace lmms +{ + + enum ZasfRemoteMessageIDs { - IdZasfPresetDirectory = IdUserBase, + IdZasfPresetDirectory = RemoteMessageIDs::IdUserBase, IdZasfLmmsWorkingDirectory, IdZasfSetPitchWheelBendRange } ; + +} // namespace lmms + #endif diff --git a/plugins/zynaddsubfx/ZynAddSubFx.cpp b/plugins/zynaddsubfx/ZynAddSubFx.cpp index eaa4c618239..e51da8de15b 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.cpp +++ b/plugins/zynaddsubfx/ZynAddSubFx.cpp @@ -52,6 +52,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -486,15 +490,16 @@ void ZynAddSubFxInstrument::sendControlChange( MidiControllers midiCtl, float va -PluginView * ZynAddSubFxInstrument::instantiateView( QWidget * _parent ) +gui::PluginView* ZynAddSubFxInstrument::instantiateView( QWidget * _parent ) { - return new ZynAddSubFxView( this, _parent ); + return new gui::ZynAddSubFxView( this, _parent ); } - +namespace gui +{ ZynAddSubFxView::ZynAddSubFxView( Instrument * _instrument, QWidget * _parent ) : @@ -658,6 +663,7 @@ void ZynAddSubFxView::toggleUI() } +} // namespace gui @@ -674,3 +680,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main(Model * m, void *) } +} // namespace lmms diff --git a/plugins/zynaddsubfx/ZynAddSubFx.h b/plugins/zynaddsubfx/ZynAddSubFx.h index 10243e3731e..728a4f282ba 100644 --- a/plugins/zynaddsubfx/ZynAddSubFx.h +++ b/plugins/zynaddsubfx/ZynAddSubFx.h @@ -37,12 +37,19 @@ class QPushButton; +namespace lmms +{ + + class LocalZynAddSubFx; -class ZynAddSubFxView; class NotePlayHandle; + +namespace gui +{ class Knob; class LedCheckBox; - +class ZynAddSubFxView; +} class ZynAddSubFxRemotePlugin : public RemotePlugin { @@ -85,7 +92,7 @@ class ZynAddSubFxInstrument : public Instrument return IsSingleStreamed | IsMidiBased; } - virtual PluginView * instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; private slots: @@ -122,7 +129,7 @@ private slots: QMap m_modifiedControllers; - friend class ZynAddSubFxView; + friend class gui::ZynAddSubFxView; signals: @@ -131,6 +138,9 @@ private slots: } ; +namespace gui +{ + class ZynAddSubFxView : public InstrumentViewFixedSize { @@ -165,4 +175,8 @@ private slots: } ; +} // namespace gui + +} // namespace lmms + #endif From bab399f65534c451f3677f3952a23848769d3c1a Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 8 Oct 2021 17:20:48 +0200 Subject: [PATCH 064/118] RemoteVSTPlugin: Leave some symbols in the global namespace. --- plugins/vst_base/RemoteVstPlugin.cpp | 35 ++++++++++++++-------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/plugins/vst_base/RemoteVstPlugin.cpp b/plugins/vst_base/RemoteVstPlugin.cpp index 272765cd90a..8ff7aa44d78 100644 --- a/plugins/vst_base/RemoteVstPlugin.cpp +++ b/plugins/vst_base/RemoteVstPlugin.cpp @@ -109,27 +109,26 @@ struct ERect #include #endif - -namespace lmms -{ - - -using namespace std; - -static VstHostLanguages hlang = LanguageEnglish; +static lmms::VstHostLanguages hlang = lmms::LanguageEnglish; static bool EMBED = false; static bool EMBED_X11 = false; static bool EMBED_WIN32 = false; static bool HEADLESS = false; +namespace lmms +{ class RemoteVstPlugin; +} -RemoteVstPlugin * __plugin = nullptr; +lmms::RemoteVstPlugin * __plugin = nullptr; HWND __MessageHwnd = nullptr; DWORD __processingThreadId = 0; +namespace lmms +{ + //Returns the last Win32 error, in string format. Returns an empty string if there is no error. std::string GetErrorAsString(DWORD errorMessageID) @@ -2161,10 +2160,13 @@ LRESULT CALLBACK RemoteVstPlugin::wndProc( HWND hwnd, UINT uMsg, } +} // namespace lmms int main( int _argc, char * * _argv ) { + using lmms::RemoteVstPlugin; + #ifdef SYNC_WITH_SHM_FIFO if( _argc < 4 ) #else @@ -2226,32 +2228,32 @@ int main( int _argc, char * * _argv ) if ( embedMethod == "none" ) { - cerr << "Starting detached." << endl; + std::cerr << "Starting detached." << std::endl; EMBED = EMBED_X11 = EMBED_WIN32 = HEADLESS = false; } else if ( embedMethod == "win32" ) { - cerr << "Starting using Win32-native embedding." << endl; + std::cerr << "Starting using Win32-native embedding." << std::endl; EMBED = EMBED_WIN32 = true; EMBED_X11 = HEADLESS = false; } else if ( embedMethod == "qt" ) { - cerr << "Starting using Qt-native embedding." << endl; + std::cerr << "Starting using Qt-native embedding." << std::endl; EMBED = true; EMBED_X11 = EMBED_WIN32 = HEADLESS = false; } else if ( embedMethod == "xembed" ) { - cerr << "Starting using X11Embed protocol." << endl; + std::cerr << "Starting using X11Embed protocol." << std::endl; EMBED = EMBED_X11 = true; EMBED_WIN32 = HEADLESS = false; } else if ( embedMethod == "headless" ) { - cerr << "Starting without UI." << endl; + std::cerr << "Starting without UI." << std::endl; HEADLESS = true; EMBED = EMBED_X11 = EMBED_WIN32 = false; } else { - cerr << "Unknown embed method " << embedMethod << ". Starting detached instead." << endl; + std::cerr << "Unknown embed method " << embedMethod << ". Starting detached instead." << std::endl; EMBED = EMBED_X11 = EMBED_WIN32 = HEADLESS = false; } } @@ -2287,6 +2289,3 @@ int main( int _argc, char * * _argv ) return 0; } - - -} // namespace lmms From 0dfd04d0037211838f797d84e3b0c31cf21e0a21 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 9 Oct 2021 14:44:27 +0200 Subject: [PATCH 065/118] Fix PortAudio module compilation error if Portaudio not found. --- include/AudioPortAudio.h | 35 ++++++++++++++++++------------- src/core/audio/AudioPortAudio.cpp | 7 +++++++ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index 941e89f025b..2b54fff9e46 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -30,6 +30,26 @@ #include "lmmsconfig.h" #include "ComboBoxModel.h" +namespace lmms +{ + + +class AudioPortAudioSetupUtil : public QObject +{ +Q_OBJECT +public slots: + void updateBackends(); + void updateDevices(); + void updateChannels(); + +public: + ComboBoxModel m_backendModel; + ComboBoxModel m_deviceModel; +}; + + +} + #ifdef LMMS_HAVE_PORTAUDIO #include @@ -48,19 +68,6 @@ namespace lmms { -class AudioPortAudioSetupUtil : public QObject -{ - Q_OBJECT -public slots: - void updateBackends(); - void updateDevices(); - void updateChannels(); - -public: - ComboBoxModel m_backendModel; - ComboBoxModel m_deviceModel; -} ; - namespace gui { @@ -158,6 +165,6 @@ class AudioPortAudio : public AudioDevice } // namespace lmms -#endif +#endif // LMMS_HAVE_PORTAUDIO #endif diff --git a/src/core/audio/AudioPortAudio.cpp b/src/core/audio/AudioPortAudio.cpp index eecdf7f5ae2..7fad223adca 100644 --- a/src/core/audio/AudioPortAudio.cpp +++ b/src/core/audio/AudioPortAudio.cpp @@ -27,6 +27,10 @@ #include "AudioPortAudio.h" #ifndef LMMS_HAVE_PORTAUDIO +namespace lmms +{ + + void AudioPortAudioSetupUtil::updateBackends() { } @@ -38,6 +42,9 @@ void AudioPortAudioSetupUtil::updateDevices() void AudioPortAudioSetupUtil::updateChannels() { } + + +} // namespace lmms #endif #ifdef LMMS_HAVE_PORTAUDIO From bd6852aad2c89cafcb71a5b37a19c0d2bb45861a Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 16 Apr 2022 22:08:58 +0200 Subject: [PATCH 066/118] denormals.h: Fix conditional compilation breaking a namespace scope, and add some comments to make the #endifs easier to parse. --- include/denormals.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/include/denormals.h b/include/denormals.h index c1017e9b34d..2b5b2d1c57d 100644 --- a/include/denormals.h +++ b/include/denormals.h @@ -8,7 +8,7 @@ #include #ifdef __GNUC__ #include -#endif +#endif // __GNUC__ namespace lmms { @@ -22,12 +22,18 @@ int inline can_we_daz() { _fxsave(buffer); #elif defined(LMMS_HOST_X86_64) _fxsave64(buffer); -#endif +#endif // defined(LLMS_HOST_X86) // Bit 6 of the MXCSR_MASK, i.e. in the lowest byte, // tells if we can use the DAZ flag. return ((buffer[28] & (1 << 6)) != 0); } -#endif + +} // namespace lmms +#endif // __SSE__ + +namespace lmms +{ + // Set denormal protection for this thread. void inline disable_denormals() { @@ -44,5 +50,5 @@ void inline disable_denormals() { } // namespace lmms -#endif +#endif // DENORMALS_H From 300afafead8fe17a633fae5bbeb13f852e62f62c Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 16 Apr 2022 23:07:35 +0200 Subject: [PATCH 067/118] Remove ambiguity from forward declarations of GuiApplication in Engine and MainWindow. --- include/Engine.h | 7 ++++++- include/MainWindow.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/Engine.h b/include/Engine.h index 965565edfb1..b63308cde35 100644 --- a/include/Engine.h +++ b/include/Engine.h @@ -44,6 +44,11 @@ class ProjectJournal; class Song; class Ladspa2LMMS; +namespace gui +{ +class GuiApplication; +} + class LMMS_EXPORT Engine : public QObject { @@ -146,7 +151,7 @@ class LMMS_EXPORT Engine : public QObject // even though most methods are static, an instance is needed for Qt slots/signals static Engine* s_instanceOfMe; - friend class GuiApplication; + friend class gui::GuiApplication; }; diff --git a/include/MainWindow.h b/include/MainWindow.h index fe889380480..8fbc20e6a55 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -48,6 +48,7 @@ namespace gui class PluginView; class SubWindow; class ToolButton; +class GuiApplication; class MainWindow : public QMainWindow From 6828f06224a244b0be87a3af0a20cc92d739a318 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 16 Apr 2022 23:32:05 +0200 Subject: [PATCH 068/118] Resolve lmms namespace within test targets. --- tests/main.cpp | 2 +- tests/src/core/AutomatableModelTest.cpp | 4 ++++ tests/src/core/ProjectVersionTest.cpp | 2 ++ tests/src/core/RelativePathsTest.cpp | 2 ++ tests/src/tracks/AutomationTrackTest.cpp | 14 ++++++++++++++ 5 files changed, 23 insertions(+), 1 deletion(-) diff --git a/tests/main.cpp b/tests/main.cpp index b2c21b79ab8..6d375e6c657 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char* argv[]) { new QCoreApplication(argc, argv); - Engine::init(true); + lmms::Engine::init(true); int numsuites = QTestSuite::suites().size(); qDebug() << ">> Will run" << numsuites << "test suites"; diff --git a/tests/src/core/AutomatableModelTest.cpp b/tests/src/core/AutomatableModelTest.cpp index d84d89db4a6..78b9069b5e8 100644 --- a/tests/src/core/AutomatableModelTest.cpp +++ b/tests/src/core/AutomatableModelTest.cpp @@ -43,6 +43,8 @@ private slots: // tests //! but no downcast or any other casts void CastTests() { + using namespace lmms; + ComboBoxModel comboModel; AutomatableModel* amPtr = &comboModel; QVERIFY(nullptr == amPtr->dynamicCast()); // not a parent class @@ -60,6 +62,8 @@ private slots: // tests void LinkTests() { + using namespace lmms; + BoolModel m1(false), m2(false); QObject::connect(&m1, SIGNAL(dataChanged()), diff --git a/tests/src/core/ProjectVersionTest.cpp b/tests/src/core/ProjectVersionTest.cpp index e52088f6f8c..2d066dca543 100644 --- a/tests/src/core/ProjectVersionTest.cpp +++ b/tests/src/core/ProjectVersionTest.cpp @@ -32,6 +32,8 @@ class ProjectVersionTest : QTestSuite private slots: void ProjectVersionComparisonTests() { + using namespace lmms; + QVERIFY(ProjectVersion("1.1.0", ProjectVersion::Minor) > "1.0.3"); QVERIFY(ProjectVersion("1.1.0", ProjectVersion::Major) < "2.1.0"); QVERIFY(ProjectVersion("1.1.0", ProjectVersion::Release) > "0.2.1"); diff --git a/tests/src/core/RelativePathsTest.cpp b/tests/src/core/RelativePathsTest.cpp index 3f1712e1b5a..3b5d023d041 100644 --- a/tests/src/core/RelativePathsTest.cpp +++ b/tests/src/core/RelativePathsTest.cpp @@ -36,6 +36,8 @@ class RelativePathsTest : QTestSuite private slots: void PathUtilComparisonTests() { + using namespace lmms; + QFileInfo fi(ConfigManager::inst()->factorySamplesDir() + "/drums/kick01.ogg"); QVERIFY(fi.exists()); diff --git a/tests/src/tracks/AutomationTrackTest.cpp b/tests/src/tracks/AutomationTrackTest.cpp index 5adafbb0fc4..2bf8759920b 100644 --- a/tests/src/tracks/AutomationTrackTest.cpp +++ b/tests/src/tracks/AutomationTrackTest.cpp @@ -49,6 +49,8 @@ private slots: void testClipLinear() { + using namespace lmms; + AutomationClip c(nullptr); c.setProgressionType(AutomationClip::LinearProgression); c.putValue(0, 0.0, false); @@ -64,6 +66,8 @@ private slots: void testClipDiscrete() { + using namespace lmms; + AutomationClip c(nullptr); c.setProgressionType(AutomationClip::DiscreteProgression); c.putValue(0, 0.0, false); @@ -77,6 +81,8 @@ private slots: void testClips() { + using namespace lmms; + FloatModel model; auto song = Engine::getSong(); @@ -111,6 +117,8 @@ private slots: void testLengthRespected() { + using namespace lmms; + FloatModel model; auto song = Engine::getSong(); @@ -136,6 +144,8 @@ private slots: void testInlineAutomation() { + using namespace lmms; + auto song = Engine::getSong(); InstrumentTrack* instrumentTrack = @@ -160,6 +170,8 @@ private slots: void testPatternTrack() { + using namespace lmms; + auto song = Engine::getSong(); auto patternStore = Engine::patternStore(); PatternTrack patternTrack(song); @@ -197,6 +209,8 @@ private slots: void testGlobalAutomation() { + using namespace lmms; + // Global automation should not have priority, see https://github.com/LMMS/lmms/issues/4268 // Tests regression caused by 75077f6200a5aee3a5821aae48a3b8466ed8714a auto song = Engine::getSong(); From 8dc8371524306b1a5a3fcc61a79bc55aa2f4d176 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 24 Apr 2022 12:51:32 +0200 Subject: [PATCH 069/118] Update style CSS (thanks to allejok) --- data/themes/classic/style.css | 162 ++++++++++++++++---------------- data/themes/default/style.css | 170 +++++++++++++++++----------------- 2 files changed, 168 insertions(+), 164 deletions(-) diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css index c4068d1647a..110a98a1f19 100644 --- a/data/themes/classic/style.css +++ b/data/themes/classic/style.css @@ -11,12 +11,12 @@ QMdiArea { background-image: url(resources:background_artwork.png); } -Knob { +lmms--gui--Knob { qproperty-lineInactiveColor: rgb(120, 120, 120); qproperty-arcInactiveColor: rgba(120, 120, 120, 70); } -AutomationEditor { +lmms--gui--AutomationEditor { background-color: rgb(0, 0, 0); color: #e0e0e0; qproperty-backgroundShade: rgba(255, 255, 255, 15); @@ -70,7 +70,7 @@ QToolTip { color: #4afd85; } -TextFloat { +lmms--gui--TextFloat { border-radius: 4px; background: qlineargradient(spread:reflect, x1:0.5, y1:0.5, x2:0.5, y2:0, stop:0 rgba(0, 0, 0, 255), stop:1 rgba(50, 50, 50, 220)); opacity: 175; @@ -130,18 +130,18 @@ QMenu::indicator:selected { background-color: #747474; } -FileBrowser QCheckBox +lmms--gui--FileBrowser QCheckBox { font-size: 10px; color: white; } -PositionLine { +lmms--gui--PositionLine { qproperty-tailGradient: false; qproperty-lineColor: rgb(255, 255, 255); } -PianoRoll { +lmms--gui--PianoRoll { background-color: rgb(0, 0, 0); qproperty-backgroundShade: rgba( 255, 255, 255, 10 ); qproperty-noteModeColor: rgb( 255, 255, 255 ); @@ -182,7 +182,7 @@ PianoRoll { qproperty-textShadow: rgb( 240, 240, 240 ); } -TabWidget { +lmms--gui--TabWidget { background-color: #5b6571; qproperty-tabText: rgba(255, 255, 255, 180); qproperty-tabTitleText: #fff; @@ -191,13 +191,13 @@ TabWidget { qproperty-tabBorder: #3c434b; } -GroupBox { +lmms--gui--GroupBox { background-color: #5b6571; } /* main toolbar oscilloscope - can have transparent bg now */ -Oscilloscope { +lmms--gui--Oscilloscope { background: none; border: none; qproperty-normalColor: rgb(71, 253, 133); @@ -206,7 +206,7 @@ Oscilloscope { /* main toolbar cpu load widget - this can have transparent bg now */ -CPULoadWidget { +lmms--gui--CPULoadWidget { border: none; background: url(resources:cpuload_bg.png); } @@ -335,19 +335,19 @@ QScrollBar::down-arrow:vertical:disabled { background-image: url(resources:sbarr /* background for song editor and pattern editor */ -TrackContainerView QFrame{ +lmms--gui--TrackContainerView QFrame{ background-color: #49515b; } /* background for track controls */ -TrackView > QWidget { +lmms--gui--TrackView > QWidget { background-color: #5b6571; } /* autoscroll, loop, stop behaviour toggle buttons */ /* track background colors */ -TrackContentWidget { +lmms--gui--TrackContentWidget { qproperty-darkerColor: qlineargradient(x1:0, y1:0, x2:0, y2:1, stop:0 rgb( 50, 50, 50 ), stop:0.33 rgb( 20, 20, 20 ), stop:1 rgb( 15, 15, 15 ) ); qproperty-lighterColor: qlineargradient(x1:0, y1:0, x2:0, y2:1, @@ -359,7 +359,7 @@ TrackContentWidget { /* gear button in tracks */ -TrackOperationsWidget > QPushButton { +lmms--gui--TrackOperationsWidget > QPushButton { max-height: 26px; max-width: 26px; min-height: 26px; @@ -368,7 +368,7 @@ TrackOperationsWidget > QPushButton { border: none; } -TrackOperationsWidget > QPushButton::menu-indicator { +lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator { image: url(resources:trackop.png); subcontrol-origin: padding; subcontrol-position: center; @@ -376,12 +376,12 @@ TrackOperationsWidget > QPushButton::menu-indicator { top: 1px; } -TrackOperationsWidget > QPushButton::menu-indicator:hover { +lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator:hover { image: url(resources:trackop_h.png); } -TrackOperationsWidget > QPushButton::menu-indicator:pressed, -TrackOperationsWidget > QPushButton::menu-indicator:checked { +lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator:pressed, +lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator:checked { image: url(resources:trackop_c.png); position: relative; top: 2px; @@ -395,13 +395,13 @@ TrackOperationsWidget > QPushButton::menu-indicator:checked { /* font sizes */ -nameLabel, effectLabel, Sf2InstrumentView > QLabel { +lmms--gui--Sf2InstrumentView > QLabel { font-size:10px; } /* main toolbar sliders (master vol, master pitch) */ -AutomatableSlider::groove:vertical { +lmms--gui--AutomatableSlider::groove:vertical { background: rgba(0,0,0, 128); border: 1px inset rgba(100,100,100, 64); border-radius: 2px; @@ -409,7 +409,7 @@ AutomatableSlider::groove:vertical { margin: 2px 2px; } -AutomatableSlider::handle:vertical { +lmms--gui--AutomatableSlider::handle:vertical { background: none; border-image: url(resources:main_slider.png); width: 26px; @@ -425,13 +425,13 @@ QTabWidget, QTabWidget QWidget { /* window that shows up when you add effects */ -EffectSelectDialog QScrollArea { +lmms--gui--EffectSelectDialog QScrollArea { background: #5b6571; } /* the inner boxes in LADSPA effect windows */ -EffectControlDialog QGroupBox { +lmms--gui--EffectControlDialog QGroupBox { background: #49515b; margin-top: 1ex; padding: 10px 2px 1px; @@ -441,7 +441,7 @@ EffectControlDialog QGroupBox { /* the inner box titles when present (channel 1, channel 2...) */ -EffectControlDialog QGroupBox::title { +lmms--gui--EffectControlDialog QGroupBox::title { subcontrol-origin: margin; subcontrol-position: top left; background: #7b838d; @@ -531,7 +531,7 @@ QToolButton::menu-button { /* track label buttons - the part that contains the icon and track title */ -TrackLabelButton { +lmms--gui--TrackLabelButton { background-color: #5b6571; color: #c9c9c9; font-size: 11px; @@ -541,7 +541,7 @@ TrackLabelButton { padding: 2px 1px; } -TrackLabelButton:hover { +lmms--gui--TrackLabelButton:hover { background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:0.5, stop:0 #5b6571, stop:0.75 #7b838d, stop:1 #7b838d ); color: white; border: 1px solid rgba(0,0,0,64); @@ -549,7 +549,7 @@ TrackLabelButton:hover { margin: 0px; } -TrackLabelButton:pressed { +lmms--gui--TrackLabelButton:pressed { background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.3 #5b6571, stop:1 #6b7581 ); color: white; border: 1px solid rgba(0,0,0,64); @@ -557,7 +557,7 @@ TrackLabelButton:pressed { font-weight: bold; } -TrackLabelButton:checked { +lmms--gui--TrackLabelButton:checked { background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.3 #5b6571, stop:1 #6b7581 ); color: white; border: 1px solid rgba(0,0,0,128); @@ -565,54 +565,56 @@ TrackLabelButton:checked { font-weight: bold; } -TrackLabelButton:checked:hover { +lmms--gui--TrackLabelButton:checked:hover { background-color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:0.5, stop:0 #5b6571, stop:0.75 #7b838d, stop:1 #7b838d ); } -TrackLabelButton:checked:pressed { +lmms--gui--TrackLabelButton:checked:pressed { background: qlineargradient(spread:reflect, x1:0.5, y1:0, x2:0.5, y2:1, stop:0 #49515b, stop:0.3 #5b6571, stop:1 #6b7581 ); } /* sidebar, sidebar buttons */ -SideBar { +lmms--gui--SideBar { background: qlineargradient(x1:0, y1:0, x2:1, y2:0, stop: 0 #98a2a7, stop: 1.0 #5b646f); } -SideBar QToolButton { +lmms--gui--SideBar QToolButton { font-size: 12px; } /* Instrument plugin list */ -PluginDescList { +lmms--gui--PluginDescList { background-color: #5b6571; } -PluginDescWidget { +lmms--gui--PluginDescWidget { background-color: #e0e0e0; color: #404040; border: 1px solid rgb(64, 64, 64); margin: 0px; } -PluginDescWidget:hover { +lmms--gui--PluginDescWidget:hover { background-color: #e0e0e0; } /* piano widget */ -PianoView { +lmms--gui--PianoView { background-color: #14171a; } /* font sizes for text buttons */ -MixerView QPushButton, EffectRackView QPushButton, ControllerRackView QPushButton { +lmms--gui--MixerView QPushButton, +lmms--gui--EffectRackView QPushButton, +lmms--gui--ControllerRackView QPushButton { font-size: 10px; } -MixerLine { +lmms--gui--MixerLine { background: #5b6571; color: #e0e0e0; qproperty-backgroundActive: qlineargradient(spread:reflect, x1:0, y1:0, x2:1, y2:0, @@ -624,13 +626,13 @@ MixerLine { } /* persistent peak markers for fx peak meters */ -Fader { +lmms--gui--Fader { qproperty-peakGreen: rgb( 74, 253, 133); qproperty-peakYellow: rgb(224, 222, 18); qproperty-peakRed: rgb( 255, 100, 100); } -TimeLineWidget { +lmms--gui--TimeLineWidget { /* font-size only supports px and pt. */ font-size: 7pt; /* lengths also support em. This will make sure that the height @@ -658,7 +660,7 @@ QTreeView { alternate-background-color: #747474; } -TrackContainerView QLabel +lmms--gui--TrackContainerView QLabel { background: none; } @@ -666,7 +668,7 @@ TrackContainerView QLabel /* Clips */ /* common clip colors */ -ClipView { +lmms--gui--ClipView { qproperty-mutedColor: rgb( 128, 128, 128 ); qproperty-mutedBackgroundColor: rgb( 80, 80, 80 ); qproperty-selectedColor: rgb( 0, 125, 255 ); @@ -683,7 +685,7 @@ ClipView { } /* MIDI (instrument) clip */ -MidiClipView { +lmms--gui--MidiClipView { background-color: rgb( 119, 199, 216 ); color: rgb( 187, 227, 236 ); @@ -694,24 +696,24 @@ MidiClipView { } /* sample track clip */ -SampleClipView { +lmms--gui--SampleClipView { background-color: rgba(42,51,59,255); color: #FF8F05; } /* automation clip */ -AutomationClipView { +lmms--gui--AutomationClipView { background-color: #99afff; color: rgb( 204, 215, 255 ); } /* pattern clip */ -PatternClipView { +lmms--gui--PatternClipView { background-color: rgb( 128, 182, 175 ); /* default colour for pattern tracks */ } /* Subwindows in MDI-Area */ -SubWindow { +lmms--gui--SubWindow { color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #4b525c, stop: 1.0 #31363d); qproperty-activeColor: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, @@ -721,21 +723,21 @@ SubWindow { } /* Subwindow title text */ -SubWindow > QLabel { +lmms--gui--SubWindow > QLabel { color: rgb( 255, 255, 255 ); font-size: 12px; font-style: normal; } /* SubWindow titlebar button */ -SubWindow > QPushButton { +lmms--gui--SubWindow > QPushButton { background-color: rgba( 255, 255, 255, 0% ); border-width: 0px; border-color: none; border-style: none; } -SubWindow > QPushButton:hover{ +lmms--gui--SubWindow > QPushButton:hover{ background-color: rgba( 255, 255, 255, 15% ); border-width: 1px; border-color: rgba( 0, 0, 0, 20% ); @@ -746,7 +748,7 @@ SubWindow > QPushButton:hover{ /* Plugins */ -TripleOscillatorView Knob { +lmms--gui--TripleOscillatorView Knob { color: rgb(255, 255, 255); qproperty-outerColor: rgb(255, 255, 255); qproperty-innerRadius: 2; @@ -757,7 +759,7 @@ TripleOscillatorView Knob { } -KickerInstrumentView Knob#smallKnob { +lmms--gui--KickerInstrumentView Knob#smallKnob { color: #595959; qproperty-outerColor: black; qproperty-innerRadius: 3; @@ -768,7 +770,7 @@ KickerInstrumentView Knob#smallKnob { } -KickerInstrumentView Knob#largeKnob { +lmms--gui--KickerInstrumentView Knob#largeKnob { color: #0c3b89; qproperty-outerColor: #519fff; qproperty-innerRadius: 12.0; @@ -779,7 +781,7 @@ KickerInstrumentView Knob#largeKnob { } -AudioFileProcessorView Knob { +lmms--gui--AudioFileProcessorView Knob { color: rgb(240, 147, 14); qproperty-outerColor: rgb(30, 35, 37); qproperty-innerRadius: 4; @@ -789,7 +791,7 @@ AudioFileProcessorView Knob { qproperty-lineWidth: 3; } -OrganicInstrumentView Knob { +lmms--gui--OrganicInstrumentView Knob { color: rgb(124, 207, 98); qproperty-outerColor: rgb(13, 42, 4); qproperty-innerRadius: 2; @@ -799,13 +801,13 @@ OrganicInstrumentView Knob { qproperty-lineWidth: 1.5; } -OrganicInstrumentView Knob#harmKnob { +lmms--gui--OrganicInstrumentView Knob#harmKnob { color: rgb(205, 98, 216); qproperty-outerColor: rgb(18, 4, 18); } -OrganicInstrumentView Knob#fx1Knob, -OrganicInstrumentView Knob#volKnob { +lmms--gui--OrganicInstrumentView Knob#fx1Knob, +lmms--gui--OrganicInstrumentView Knob#volKnob { color: rgb(157, 157, 157); qproperty-outerColor: rgb(37, 37, 37); qproperty-innerRadius: 4; @@ -815,7 +817,7 @@ OrganicInstrumentView Knob#volKnob { qproperty-lineWidth: 2; } -Sf2InstrumentView Knob { +lmms--gui--Sf2InstrumentView Knob { color: #ff00ea; qproperty-outerColor: rgb(20, 5, 18); qproperty-innerRadius: 2; @@ -825,7 +827,7 @@ Sf2InstrumentView Knob { qproperty-lineWidth: 2; } -SfxrInstrumentView Knob { +lmms--gui--SfxrInstrumentView Knob { color: #000; qproperty-outerColor: rgb(194, 177, 145); qproperty-innerRadius: 2; @@ -833,42 +835,42 @@ SfxrInstrumentView Knob { qproperty-lineWidth: 2; } -SfxrInstrumentView Knob#envKnob { +lmms--gui--SfxrInstrumentView Knob#envKnob { color: #263352; qproperty-outerColor: #4b66a4; } -SfxrInstrumentView Knob#freqKnob { +lmms--gui--SfxrInstrumentView Knob#freqKnob { color: #1e4a22; qproperty-outerColor: #3c9544; } -SfxrInstrumentView Knob#changeKnob { +lmms--gui--SfxrInstrumentView Knob#changeKnob { color: #591c1c; qproperty-outerColor: #b23737; } -SfxrInstrumentView Knob#sqrKnob { +lmms--gui--SfxrInstrumentView Knob#sqrKnob { color: #3b2714; qproperty-outerColor: #724c27; } -SfxrInstrumentView Knob#repeatKnob { +lmms--gui--SfxrInstrumentView Knob#repeatKnob { color: #292929; qproperty-outerColor: #515151; } -SfxrInstrumentView Knob#phaserKnob { +lmms--gui--SfxrInstrumentView Knob#phaserKnob { color: #144c4d; qproperty-outerColor: #299899; } -SfxrInstrumentView Knob#filterKnob { +lmms--gui--SfxrInstrumentView Knob#filterKnob { color: #47224c; qproperty-outerColor: #8e4397; } -OpulenzInstrumentView Knob { +lmms--gui--OpulenzInstrumentView Knob { color: rgb(128,128,128); qproperty-outerColor: rgb(255,255,255); qproperty-innerRadius: 2; @@ -876,7 +878,7 @@ OpulenzInstrumentView Knob { qproperty-lineWidth: 2; } -SidInstrumentView Knob { +lmms--gui--SidInstrumentView Knob { color: rgb(113,95,80); qproperty-outerColor: rgb( 255,255,255 ); qproperty-innerRadius: 2; @@ -884,7 +886,7 @@ SidInstrumentView Knob { qproperty-lineWidth: 2; } -WatsynView Knob { +lmms--gui--WatsynView Knob { qproperty-innerRadius: 1; qproperty-outerRadius: 7; qproperty-centerPointX: 9.5; @@ -892,17 +894,17 @@ WatsynView Knob { qproperty-lineWidth: 2; } -WatsynView Knob#aKnob { +lmms--gui--WatsynView Knob#aKnob { color: #43b2ff; qproperty-outerColor: #43b2ff; } -WatsynView Knob#bKnob { +lmms--gui--WatsynView Knob#bKnob { color: #fc5431; qproperty-outerColor: #fc5431; } -WatsynView Knob#mixKnob { +lmms--gui--WatsynView Knob#mixKnob { color: #43ff82; qproperty-outerColor: #43ff82; qproperty-outerRadius: 13; @@ -910,17 +912,17 @@ WatsynView Knob#mixKnob { qproperty-centerPointY: 15.5; } -WatsynView Knob#mixenvKnob { +lmms--gui--WatsynView Knob#mixenvKnob { color: #43ff82; qproperty-outerColor: #43ff82; } -WatsynView Knob#xtalkKnob { +lmms--gui--WatsynView Knob#xtalkKnob { color: #fb50fb; qproperty-outerColor: #fb50fb; } -MonstroView Knob { +lmms--gui--MonstroView Knob { color: #ffffff; qproperty-outerColor: #aaaaaa; qproperty-outerRadius: 9; @@ -930,7 +932,7 @@ MonstroView Knob { qproperty-lineWidth: 2.5; } -NesInstrumentView Knob { +lmms--gui--NesInstrumentView Knob { color: #e7231b; qproperty-outerColor: #fff; qproperty-outerRadius: 11.0; @@ -940,7 +942,7 @@ NesInstrumentView Knob { qproperty-lineWidth: 2; } -CompressorControlDialog { +lmms--gui--CompressorControlDialog { qproperty-inVolAreaColor: rgba(209, 216, 228, 17); qproperty-inVolColor: rgba(209, 216, 228, 100); qproperty-outVolAreaColor: rgba(209, 216, 228, 30); @@ -954,7 +956,7 @@ CompressorControlDialog { qproperty-resetColor: rgba(200, 100, 15, 200); } -CompressorControlDialog Knob { +lmms--gui--CompressorControlDialog Knob { color: #2fcc71; qproperty-outerColor: #2fcc71; qproperty-lineWidth: 2; @@ -962,7 +964,7 @@ CompressorControlDialog Knob { /* palette information */ -LmmsPalette { +lmms--gui--LmmsPalette { qproperty-background: #5b6571; qproperty-windowText: #f0f0f0; qproperty-base: #808080; diff --git a/data/themes/default/style.css b/data/themes/default/style.css index cc101a5b415..26b72bc58c5 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -40,18 +40,18 @@ QMdiArea { background-color: #111314; } -FileBrowser QCheckBox +lmms--gui--FileBrowser QCheckBox { font-size: 10px; color: white; } -Knob { +lmms--gui--Knob { qproperty-lineInactiveColor: rgb(120, 120, 120); qproperty-arcInactiveColor: rgba(120, 120, 120, 70); } -AutomationEditor { +lmms--gui--AutomationEditor { color: #ffffff; background-color: #141616; qproperty-backgroundShade: rgba(255, 255, 255, 15); @@ -100,7 +100,7 @@ QToolTip { color: #d1d8e4; } -TextFloat { +lmms--gui--TextFloat { background: #040506; color: #d1d8e4; } @@ -168,12 +168,12 @@ QMenu::indicator:selected { background-color: #101213; } -PositionLine { +lmms--gui--PositionLine { qproperty-tailGradient: true; qproperty-lineColor: rgb(255, 255, 255); } -PianoRoll { +lmms--gui--PianoRoll { background-color: #141616; qproperty-backgroundShade: rgba(255, 255, 255, 10); qproperty-noteModeColor: #0bd556; @@ -214,7 +214,7 @@ PianoRoll { qproperty-textShadow: #fff; } -TabWidget { +lmms--gui--TabWidget { background-color: #262b30; qproperty-tabText: rgba(255, 255, 255, 180); qproperty-tabTitleText: #fff; @@ -223,13 +223,13 @@ TabWidget { qproperty-tabBorder: #181b1f; } -GroupBox { +lmms--gui--GroupBox { background-color: #262b30; } /* main toolbar oscilloscope - can have transparent bg now */ -Oscilloscope { +lmms--gui--Oscilloscope { background: none; border: none; qproperty-normalColor: rgb(71, 253, 133); @@ -238,7 +238,7 @@ Oscilloscope { /* main toolbar cpu load widget - this can have transparent bg now */ -CPULoadWidget { +lmms--gui--CPULoadWidget { border: none; background: url(resources:cpuload_bg.png); } @@ -308,7 +308,7 @@ QScrollBar::handle:horizontal:disabled, QScrollBar::handle:vertical:disabled { border: none; } -EffectRackView QScrollBar::handle:vertical:disabled { +lmms--gui--EffectRackView QScrollBar::handle:vertical:disabled { background: #3f4750; border: none; border-radius: 4px; @@ -366,17 +366,17 @@ QScrollBar::left-arrow:horizontal:disabled { background-image: url(resources:sba QScrollBar::right-arrow:horizontal:disabled { background-image: url(resources:sbarrow_right_d.png);} QScrollBar::up-arrow:vertical:disabled { background-image: url(resources:sbarrow_up_d.png);} QScrollBar::down-arrow:vertical:disabled { background-image: url(resources:sbarrow_down_d.png);} -EffectRackView QScrollBar::up-arrow:vertical:disabled { background-image: url(resources:sbarrow_up.png);} -EffectRackView QScrollBar::down-arrow:vertical:disabled { background-image: url(resources:sbarrow_down.png);} +lmms--gui--EffectRackView QScrollBar::up-arrow:vertical:disabled { background-image: url(resources:sbarrow_up.png);} +lmms--gui--EffectRackView QScrollBar::down-arrow:vertical:disabled { background-image: url(resources:sbarrow_down.png);} /* background for song editor and pattern editor */ -TrackContainerView QFrame { +lmms--gui--TrackContainerView QFrame { background-color: #262b30; } /* background for track controls */ -TrackView > QWidget { +lmms--gui--TrackView > QWidget { background-color: #3B424A; } @@ -384,7 +384,7 @@ TrackView > QWidget { /* autoscroll, loop, stop behaviour toggle buttons */ /* track background colors */ -TrackContentWidget { +lmms--gui--TrackContentWidget { qproperty-darkerColor: #0C0E0F; qproperty-lighterColor: #14151A; qproperty-gridColor: #262B30; @@ -394,7 +394,7 @@ TrackContentWidget { /* gear button in tracks */ -TrackOperationsWidget > QPushButton { +lmms--gui--TrackOperationsWidget > QPushButton { max-height: 26px; max-width: 26px; min-height: 26px; @@ -403,7 +403,7 @@ TrackOperationsWidget > QPushButton { border: none; } -TrackOperationsWidget > QPushButton::menu-indicator { +lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator { image: url(resources:trackop.png); subcontrol-origin: padding; subcontrol-position: center; @@ -411,8 +411,8 @@ TrackOperationsWidget > QPushButton::menu-indicator { top: 1px; } -TrackOperationsWidget > QPushButton::menu-indicator:pressed, -TrackOperationsWidget > QPushButton::menu-indicator:checked { +lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator:pressed, +lmms--gui--TrackOperationsWidget > QPushButton::menu-indicator:checked { image: url(resources:trackop.png); position: relative; top: 2px; @@ -420,13 +420,13 @@ TrackOperationsWidget > QPushButton::menu-indicator:checked { /* font sizes */ -nameLabel, effectLabel, Sf2InstrumentView > QLabel { +lmms--gui--Sf2InstrumentView > QLabel { font-size:10px; } /* main toolbar sliders (master vol, master pitch) */ -AutomatableSlider::groove:vertical { +lmms--gui--AutomatableSlider::groove:vertical { background: #040506; border: none; border-radius: 2px; @@ -434,7 +434,7 @@ AutomatableSlider::groove:vertical { margin: 2px 2px; } -AutomatableSlider::handle:vertical { +lmms--gui--AutomatableSlider::handle:vertical { background: none; border-image: url(resources:main_slider.png); width: 26px; @@ -445,13 +445,13 @@ AutomatableSlider::handle:vertical { /* window that shows up when you add effects */ -EffectSelectDialog QScrollArea { +lmms--gui--EffectSelectDialog QScrollArea { background: #262b30; } /* the inner boxes in LADSPA effect windows */ -EffectControlDialog QGroupBox { +lmms--gui--EffectControlDialog QGroupBox { background: #262b30; margin-top: 1ex; padding: 10px 2px 1px; @@ -461,7 +461,7 @@ EffectControlDialog QGroupBox { /* the inner box titles when present (channel 1, channel 2...) */ -EffectControlDialog QGroupBox::title { +lmms--gui--EffectControlDialog QGroupBox::title { subcontrol-origin: margin; subcontrol-position: top center; background: #262b30; @@ -543,7 +543,7 @@ QToolButton::menu-button { /* track label buttons - the part that contains the icon and track title */ -TrackLabelButton { +lmms--gui--TrackLabelButton { background-color: #3B424A; border: 1px solid #3B424A; font-size: 11px; @@ -551,7 +551,7 @@ TrackLabelButton { padding: 2px 1px; } -TrackLabelButton:hover { +lmms--gui--TrackLabelButton:hover { background: #3B424A; border: 1px solid #515B66; border-radius: none; @@ -560,7 +560,7 @@ TrackLabelButton:hover { padding: 2px 1px; } -TrackLabelButton:pressed { +lmms--gui--TrackLabelButton:pressed { background: #262B30; border-radius: none; font-size: 11px; @@ -568,7 +568,7 @@ TrackLabelButton:pressed { padding: 2px 1px; } -TrackLabelButton:checked { +lmms--gui--TrackLabelButton:checked { border: 1px solid #485059; background: #1C1F24; background-image: url(resources:track_shadow_p.png); @@ -578,7 +578,7 @@ TrackLabelButton:checked { padding: 2px 1px; } -TrackLabelButton:checked:pressed { +lmms--gui--TrackLabelButton:checked:pressed { border: 1px solid #2f353b; background: #0e1012; background-image: url(resources:track_shadow_p.png); @@ -589,30 +589,30 @@ TrackLabelButton:checked:pressed { /* sidebar, sidebar buttons */ -SideBar { +lmms--gui--SideBar { subcontrol-position: center; background: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1, stop:0 #1D2122, stop:1 #262B30); } -SideBar QToolButton { +lmms--gui--SideBar QToolButton { background: none; border: none; font-size: 12px; } -SideBar QToolButton:hover { +lmms--gui--SideBar QToolButton:hover { background: none; border: none; font-size: 12px; } -SideBar QToolButton:pressed { +lmms--gui--SideBar QToolButton:pressed { background: none; border: none; font-size: 12px; } -SideBar QToolButton:checked { +lmms--gui--SideBar QToolButton:checked { background: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1, stop:0 #4b525b, stop:1 #2f333a); border: none; font-size: 12px; @@ -620,11 +620,11 @@ SideBar QToolButton:checked { /* Instrument plugin list */ -PluginDescList { +lmms--gui--PluginDescList { background-color: #131517; } -PluginDescWidget { +lmms--gui--PluginDescWidget { border-top: 1px solid #3E474F; border-bottom: 1px solid #101314; border-radius: 2px; @@ -634,24 +634,26 @@ PluginDescWidget { margin: 0px; } -PluginDescWidget:hover { +lmms--gui--PluginDescWidget:hover { background: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1, stop:0 #7C8799, stop:1 #343840); color: #d1d8e4; } /* piano widget */ -PianoView { +lmms--gui--PianoView { background-color: #14171a; } /* font sizes for text buttons */ -MixerView QPushButton, EffectRackView QPushButton, ControllerRackView QPushButton { +lmms--gui--MixerView QPushButton, +lmms--gui--EffectRackView QPushButton, +lmms--gui--ControllerRackView QPushButton { font-size: 10px; } -MixerLine { +lmms--gui--MixerLine { background: #14161A; color: #d1d8e4; qproperty-backgroundActive: #3B424A; @@ -662,13 +664,13 @@ MixerLine { } /* persistent peak markers for fx peak meters */ -Fader { +lmms--gui--Fader { qproperty-peakGreen: #0ad45c; qproperty-peakYellow: #d6ec52; qproperty-peakRed: #c12038; } -TimeLineWidget { +lmms--gui--TimeLineWidget { /* font-size only supports px and pt. */ font-size: 7pt; /* lengths also support em. This will make sure that the height @@ -704,7 +706,7 @@ QTreeView { alternate-background-color: #111314; } -TrackContainerView QLabel +lmms--gui--TrackContainerView QLabel { background: none; } @@ -712,7 +714,7 @@ TrackContainerView QLabel /* Clips */ /* common clip colors */ -ClipView { +lmms--gui--ClipView { qproperty-mutedColor: rgba(255,255,255,100); qproperty-mutedBackgroundColor: #373d48; qproperty-selectedColor: #006B65; @@ -729,7 +731,7 @@ ClipView { } /* MIDI (instrument) clip */ -MidiClipView { +lmms--gui--MidiClipView { background-color: #21A14F; color: rgba(255,255,255,220); @@ -740,24 +742,24 @@ MidiClipView { } /* sample track clip */ -SampleClipView { +lmms--gui--SampleClipView { background-color: rgba(42,51,59,255); color: #FF8F05; } /* automation clip */ -AutomationClipView { +lmms--gui--AutomationClipView { background-color: #663DE1; color: rgba(255,255,255,90); } /* pattern clip */ -PatternClipView { +lmms--gui--PatternClipView { background-color: #20BDB2; /* default colour for pattern tracks */ } /* Subwindows in MDI-Area */ -SubWindow { +lmms--gui--SubWindow { color: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1, stop:0 #090909, stop:0.05 #3D454F, stop:1 #262B30); qproperty-activeColor: qlineargradient(spread:reflect, x1:0, y1:0, x2:0, y2:1 stop:0 #090909, stop:0.05 #636c7a, stop:1 #343840); qproperty-textShadowColor: #000; @@ -765,21 +767,21 @@ SubWindow { } /* Subwindow title text */ -SubWindow > QLabel { +lmms--gui--SubWindow > QLabel { color: #d1d8e4; font-size: 12px; font-style: normal; } /* SubWindow titlebar button */ -SubWindow > QPushButton { +lmms--gui--SubWindow > QPushButton { background-color: rgba( 255, 255, 255, 0% ); border-width: 0px; border-color: none; border-style: none; } -SubWindow > QPushButton:hover{ +lmms--gui--SubWindow > QPushButton:hover{ background-color: rgba( 255, 255, 255, 15% ); border-width: 1px; border-color: rgba( 0, 0, 0, 20% ); @@ -790,7 +792,7 @@ SubWindow > QPushButton:hover{ /* Plugins */ -TripleOscillatorView Knob { +lmms--gui--TripleOscillatorView Knob { color: rgb(255,255,255); qproperty-outerColor: rgb(255,255,255); qproperty-innerRadius: 2; @@ -801,7 +803,7 @@ TripleOscillatorView Knob { } -KickerInstrumentView Knob#smallKnob { +lmms--gui--KickerInstrumentView Knob#smallKnob { color: #595959; qproperty-outerColor: black; qproperty-innerRadius: 3; @@ -812,7 +814,7 @@ KickerInstrumentView Knob#smallKnob { } -KickerInstrumentView Knob#largeKnob { +lmms--gui--KickerInstrumentView Knob#largeKnob { color: #0c3b89; qproperty-outerColor: #519fff; qproperty-innerRadius: 12.0; @@ -823,7 +825,7 @@ KickerInstrumentView Knob#largeKnob { } -AudioFileProcessorView Knob { +lmms--gui--AudioFileProcessorView Knob { color: rgb(240, 147, 14); qproperty-outerColor: rgb(30, 35, 37); qproperty-innerRadius: 4; @@ -833,7 +835,7 @@ AudioFileProcessorView Knob { qproperty-lineWidth: 3; } -OrganicInstrumentView Knob { +lmms--gui--OrganicInstrumentView Knob { color: rgb(124, 207, 98); qproperty-outerColor: rgb(13, 42, 4); qproperty-innerRadius: 2; @@ -843,13 +845,13 @@ OrganicInstrumentView Knob { qproperty-lineWidth: 1.5; } -OrganicInstrumentView Knob#harmKnob { +lmms--gui--OrganicInstrumentView Knob#harmKnob { color: rgb(205, 98, 216); qproperty-outerColor: rgb(18, 4, 18); } -OrganicInstrumentView Knob#fx1Knob, -OrganicInstrumentView Knob#volKnob { +lmms--gui--OrganicInstrumentView Knob#fx1Knob, +lmms--gui--OrganicInstrumentView Knob#volKnob { color: rgb(157, 157, 157); qproperty-outerColor: rgb(37, 37, 37); qproperty-innerRadius: 4; @@ -859,7 +861,7 @@ OrganicInstrumentView Knob#volKnob { qproperty-lineWidth: 2; } -Sf2InstrumentView Knob { +lmms--gui--Sf2InstrumentView Knob { color: #ff00ea; qproperty-outerColor: rgb(20, 5, 18); qproperty-innerRadius: 2; @@ -869,7 +871,7 @@ Sf2InstrumentView Knob { qproperty-lineWidth: 2; } -SfxrInstrumentView Knob { +lmms--gui--SfxrInstrumentView Knob { color: #000; qproperty-outerColor: rgb(194, 177, 145); qproperty-innerRadius: 2; @@ -877,42 +879,42 @@ SfxrInstrumentView Knob { qproperty-lineWidth: 2; } -SfxrInstrumentView Knob#envKnob { +lmms--gui--SfxrInstrumentView Knob#envKnob { color: #263352; qproperty-outerColor: #4b66a4; } -SfxrInstrumentView Knob#freqKnob { +lmms--gui--SfxrInstrumentView Knob#freqKnob { color: #1e4a22; qproperty-outerColor: #3c9544; } -SfxrInstrumentView Knob#changeKnob { +lmms--gui--SfxrInstrumentView Knob#changeKnob { color: #591c1c; qproperty-outerColor: #b23737; } -SfxrInstrumentView Knob#sqrKnob { +lmms--gui--SfxrInstrumentView Knob#sqrKnob { color: #3b2714; qproperty-outerColor: #724c27; } -SfxrInstrumentView Knob#repeatKnob { +lmms--gui--SfxrInstrumentView Knob#repeatKnob { color: #292929; qproperty-outerColor: #515151; } -SfxrInstrumentView Knob#phaserKnob { +lmms--gui--SfxrInstrumentView Knob#phaserKnob { color: #144c4d; qproperty-outerColor: #299899; } -SfxrInstrumentView Knob#filterKnob { +lmms--gui--SfxrInstrumentView Knob#filterKnob { color: #47224c; qproperty-outerColor: #8e4397; } -OpulenzInstrumentView Knob { +lmms--gui--OpulenzInstrumentView Knob { color: rgb(128,128,128); qproperty-outerColor: rgb(255,255,255); qproperty-innerRadius: 2; @@ -920,7 +922,7 @@ OpulenzInstrumentView Knob { qproperty-lineWidth: 2; } -SidInstrumentView Knob { +lmms--gui--SidInstrumentView Knob { color: rgb(113,95,80); qproperty-outerColor: rgb( 255,255,255 ); qproperty-innerRadius: 2; @@ -928,7 +930,7 @@ SidInstrumentView Knob { qproperty-lineWidth: 2; } -WatsynView Knob { +lmms--gui--WatsynView Knob { qproperty-innerRadius: 1; qproperty-outerRadius: 7; qproperty-centerPointX: 9.5; @@ -936,17 +938,17 @@ WatsynView Knob { qproperty-lineWidth: 2; } -WatsynView Knob#aKnob { +lmms--gui--WatsynView Knob#aKnob { color: #43b2ff; qproperty-outerColor: #43b2ff; } -WatsynView Knob#bKnob { +lmms--gui--WatsynView Knob#bKnob { color: #fc5431; qproperty-outerColor: #fc5431; } -WatsynView Knob#mixKnob { +lmms--gui--WatsynView Knob#mixKnob { color: #43ff82; qproperty-outerColor: #43ff82; qproperty-outerRadius: 13; @@ -954,17 +956,17 @@ WatsynView Knob#mixKnob { qproperty-centerPointY: 15.5; } -WatsynView Knob#mixenvKnob { +lmms--gui--WatsynView Knob#mixenvKnob { color: #43ff82; qproperty-outerColor: #43ff82; } -WatsynView Knob#xtalkKnob { +lmms--gui--WatsynView Knob#xtalkKnob { color: #fb50fb; qproperty-outerColor: #fb50fb; } -MonstroView Knob { +lmms--gui--MonstroView Knob { color: #ffffff; qproperty-outerColor: #aaaaaa; qproperty-outerRadius: 9; @@ -974,7 +976,7 @@ MonstroView Knob { qproperty-lineWidth: 2.5; } -NesInstrumentView Knob { +lmms--gui--NesInstrumentView Knob { color: #e7231b; qproperty-outerColor: #fff; qproperty-outerRadius: 11.0; @@ -984,7 +986,7 @@ NesInstrumentView Knob { qproperty-lineWidth: 2; } -CompressorControlDialog { +lmms--gui--CompressorControlDialog { qproperty-inVolAreaColor: rgba(209, 216, 228, 17); qproperty-inVolColor: rgba(209, 216, 228, 100); qproperty-outVolAreaColor: rgba(209, 216, 228, 30); @@ -998,7 +1000,7 @@ CompressorControlDialog { qproperty-resetColor: rgba(200, 100, 15, 200); } -CompressorControlDialog Knob { +lmms--gui--CompressorControlDialog Knob { color: #2fcc71; qproperty-outerColor: #2fcc71; qproperty-lineWidth: 2; @@ -1006,7 +1008,7 @@ CompressorControlDialog Knob { /* palette information */ -LmmsPalette { +lmms--gui--LmmsPalette { qproperty-background: #262b30; qproperty-windowText: #1de276; qproperty-base: #101213; From fefc25c7df17a1867c44ec7215b5776e5762df3f Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 24 Apr 2022 13:03:35 +0200 Subject: [PATCH 070/118] Add missed namespace prefix in RemoteVstPlugin. --- plugins/VstBase/RemoteVstPlugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/VstBase/RemoteVstPlugin.cpp b/plugins/VstBase/RemoteVstPlugin.cpp index cfa469e4383..39fdefa2537 100644 --- a/plugins/VstBase/RemoteVstPlugin.cpp +++ b/plugins/VstBase/RemoteVstPlugin.cpp @@ -2486,7 +2486,7 @@ int main( int _argc, char * * _argv ) } #ifndef LMMS_BUILD_WIN32 - const auto pollParentThread = PollParentThread{}; + const auto pollParentThread = lmms::PollParentThread{}; #endif #ifndef NATIVE_LINUX_VST From c5bb0b2f1c685d92bd5a3db6833e3ad562577e91 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 24 Apr 2022 14:02:12 +0200 Subject: [PATCH 071/118] Add explicit Qt::Alignment typecast in InstrumentTrackWindow --- src/gui/InstrumentTrackWindow.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/InstrumentTrackWindow.cpp b/src/gui/InstrumentTrackWindow.cpp index a554b858045..a70f76518b6 100644 --- a/src/gui/InstrumentTrackWindow.cpp +++ b/src/gui/InstrumentTrackWindow.cpp @@ -135,8 +135,8 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : basicControlsLayout->setContentsMargins(0, 0, 0, 0); QString labelStyleSheet = "font-size: 6pt;"; - Qt::Alignment labelAlignment = Qt::AlignHCenter | Qt::AlignTop; - Qt::Alignment widgetAlignment = Qt::AlignHCenter | Qt::AlignCenter; + auto labelAlignment = static_cast(Qt::AlignHCenter | Qt::AlignTop); + auto widgetAlignment = static_cast(Qt::AlignHCenter | Qt::AlignCenter); // set up volume knob m_volumeKnob = new Knob( knobBright_26, nullptr, tr( "Volume" ) ); From 1ef7ce95b2ff4a19dab93667136e0787ab5d1267 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 24 Apr 2022 14:28:05 +0200 Subject: [PATCH 072/118] Rollback c5bb0b2f1 and move Q_DECLARE_OPERATORS_FOR_FLAGS out of lmms namespace in Instrument.h --- include/Instrument.h | 4 ++-- src/gui/InstrumentTrackWindow.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/Instrument.h b/include/Instrument.h index e9e69c59cb4..533051cacdd 100644 --- a/include/Instrument.h +++ b/include/Instrument.h @@ -148,9 +148,9 @@ class LMMS_EXPORT Instrument : public Plugin } ; -Q_DECLARE_OPERATORS_FOR_FLAGS(Instrument::Flags) - } // namespace lmms +Q_DECLARE_OPERATORS_FOR_FLAGS(lmms::Instrument::Flags) + #endif diff --git a/src/gui/InstrumentTrackWindow.cpp b/src/gui/InstrumentTrackWindow.cpp index a70f76518b6..a554b858045 100644 --- a/src/gui/InstrumentTrackWindow.cpp +++ b/src/gui/InstrumentTrackWindow.cpp @@ -135,8 +135,8 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : basicControlsLayout->setContentsMargins(0, 0, 0, 0); QString labelStyleSheet = "font-size: 6pt;"; - auto labelAlignment = static_cast(Qt::AlignHCenter | Qt::AlignTop); - auto widgetAlignment = static_cast(Qt::AlignHCenter | Qt::AlignCenter); + Qt::Alignment labelAlignment = Qt::AlignHCenter | Qt::AlignTop; + Qt::Alignment widgetAlignment = Qt::AlignHCenter | Qt::AlignCenter; // set up volume knob m_volumeKnob = new Knob( knobBright_26, nullptr, tr( "Volume" ) ); From 7780c11154e7516cf6b0e7751747e42801cc6a46 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 24 Apr 2022 14:39:15 +0200 Subject: [PATCH 073/118] Move Q_DECLARE_OPERATORS_FOR_FLAGS back into namespace to adhere to C++ best practices; and add a workaround for the lookup bug for QT versions below 5.12 --- include/Instrument.h | 5 +++-- src/gui/InstrumentTrackWindow.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/include/Instrument.h b/include/Instrument.h index 533051cacdd..aba9ec4a97f 100644 --- a/include/Instrument.h +++ b/include/Instrument.h @@ -149,8 +149,9 @@ class LMMS_EXPORT Instrument : public Plugin } ; -} // namespace lmms - Q_DECLARE_OPERATORS_FOR_FLAGS(lmms::Instrument::Flags) + +} // namespace lmms + #endif diff --git a/src/gui/InstrumentTrackWindow.cpp b/src/gui/InstrumentTrackWindow.cpp index a554b858045..a457acec85b 100644 --- a/src/gui/InstrumentTrackWindow.cpp +++ b/src/gui/InstrumentTrackWindow.cpp @@ -134,6 +134,17 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : basicControlsLayout->setVerticalSpacing(0); basicControlsLayout->setContentsMargins(0, 0, 0, 0); +#if QT_VERSION < 0x50C00 + // Workaround for a bug in Qt versions below 5.12, + // where argument-dependent-lookup fails for QFlags operators + // declared inside a namepsace. + // This affects the Q_DECLARE_OPERATORS_FOR_FLAGS macro in Instrument.h + // See also: https://codereview.qt-project.org/c/qt/qtbase/+/225348 + + using ::operator|; + +#endif + QString labelStyleSheet = "font-size: 6pt;"; Qt::Alignment labelAlignment = Qt::AlignHCenter | Qt::AlignTop; Qt::Alignment widgetAlignment = Qt::AlignHCenter | Qt::AlignCenter; From b290b73895a2bd7253f985604af3e90cc24a84f5 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 24 Apr 2022 15:00:30 +0200 Subject: [PATCH 074/118] Add Qt < 5.12 operator lookup workaround to Carla.cpp as well. --- plugins/CarlaBase/Carla.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plugins/CarlaBase/Carla.cpp b/plugins/CarlaBase/Carla.cpp index 1df7d9c1fe1..6082f00da0a 100644 --- a/plugins/CarlaBase/Carla.cpp +++ b/plugins/CarlaBase/Carla.cpp @@ -854,6 +854,17 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid splitter->addWidget(outputFrame); verticalLayout->addWidget(splitter); +#if QT_VERSION < 0x50C00 + // Workaround for a bug in Qt versions below 5.12, + // where argument-dependent-lookup fails for QFlags operators + // declared inside a namepsace. + // This affects the Q_DECLARE_OPERATORS_FOR_FLAGS macro in Instrument.h + // See also: https://codereview.qt-project.org/c/qt/qtbase/+/225348 + + using ::operator|; + +#endif + // -- Sub window CarlaParamsSubWindow* win = new CarlaParamsSubWindow(getGUI()->mainWindow()->workspace()->viewport(), Qt::SubWindow | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint); @@ -1050,6 +1061,17 @@ void CarlaParamsView::windowResized() void CarlaParamsView::addKnob(uint32_t index) { +#if QT_VERSION < 0x50C00 + // Workaround for a bug in Qt versions below 5.12, + // where argument-dependent-lookup fails for QFlags operators + // declared inside a namepsace. + // This affects the Q_DECLARE_OPERATORS_FOR_FLAGS macro in Instrument.h + // See also: https://codereview.qt-project.org/c/qt/qtbase/+/225348 + + using ::operator|; + +#endif + bool output = m_carlaInstrument->m_paramModels[index]->isOutput(); if (output) { From 09019cb582e6701a53ef1cf289d7b0d28230f424 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 24 Apr 2022 15:08:06 +0200 Subject: [PATCH 075/118] Add Qt < 5.12 operator lookup workaround to XPressive. --- plugins/Xpressive/Xpressive.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/Xpressive/Xpressive.cpp b/plugins/Xpressive/Xpressive.cpp index 9d61b9b453d..487d69d43ba 100644 --- a/plugins/Xpressive/Xpressive.cpp +++ b/plugins/Xpressive/Xpressive.cpp @@ -878,6 +878,18 @@ QString XpressiveHelpView::s_helpText= XpressiveHelpView::XpressiveHelpView():QTextEdit(s_helpText) { + +#if QT_VERSION < 0x50C00 + // Workaround for a bug in Qt versions below 5.12, + // where argument-dependent-lookup fails for QFlags operators + // declared inside a namepsace. + // This affects the Q_DECLARE_OPERATORS_FOR_FLAGS macro in Instrument.h + // See also: https://codereview.qt-project.org/c/qt/qtbase/+/225348 + + using ::operator|; + +#endif + setWindowTitle ( "Xpressive Help" ); setTextInteractionFlags ( Qt::TextSelectableByKeyboard | Qt::TextSelectableByMouse ); getGUI()->mainWindow()->addWindowedWidget( this ); From 45bad66fc85f57d1b63e9e796b64761267d77571 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 24 Apr 2022 15:28:49 +0200 Subject: [PATCH 076/118] Add Qt < 5.12 operator lookup workaround to Vestige. --- plugins/Vestige/Vestige.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index 93dcd39a95e..a627a10ae08 100644 --- a/plugins/Vestige/Vestige.cpp +++ b/plugins/Vestige/Vestige.cpp @@ -937,6 +937,17 @@ ManageVestigeInstrumentView::ManageVestigeInstrumentView( Instrument * _instrume QWidget * _parent, VestigeInstrument * m_vi2 ) : InstrumentViewFixedSize( _instrument, _parent ) { +#if QT_VERSION < 0x50C00 + // Workaround for a bug in Qt versions below 5.12, + // where argument-dependent-lookup fails for QFlags operators + // declared inside a namepsace. + // This affects the Q_DECLARE_OPERATORS_FOR_FLAGS macro in Instrument.h + // See also: https://codereview.qt-project.org/c/qt/qtbase/+/225348 + + using ::operator|; + +#endif + m_vi = m_vi2; m_vi->m_scrollArea = new QScrollArea( this ); widget = new QWidget(this); From ee12e7fb321453292187f7b67beb5b527993b705 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 24 Apr 2022 17:42:02 +0200 Subject: [PATCH 077/118] Fix knob dials in theme CSS sheets. --- data/themes/classic/style.css | 56 +++++++++++++++++------------------ data/themes/default/style.css | 56 +++++++++++++++++------------------ 2 files changed, 56 insertions(+), 56 deletions(-) diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css index 110a98a1f19..32a72927e4b 100644 --- a/data/themes/classic/style.css +++ b/data/themes/classic/style.css @@ -748,7 +748,7 @@ lmms--gui--SubWindow > QPushButton:hover{ /* Plugins */ -lmms--gui--TripleOscillatorView Knob { +lmms--gui--TripleOscillatorView lmms--gui--Knob { color: rgb(255, 255, 255); qproperty-outerColor: rgb(255, 255, 255); qproperty-innerRadius: 2; @@ -759,7 +759,7 @@ lmms--gui--TripleOscillatorView Knob { } -lmms--gui--KickerInstrumentView Knob#smallKnob { +lmms--gui--KickerInstrumentView lmms--gui--Knob#smallKnob { color: #595959; qproperty-outerColor: black; qproperty-innerRadius: 3; @@ -770,7 +770,7 @@ lmms--gui--KickerInstrumentView Knob#smallKnob { } -lmms--gui--KickerInstrumentView Knob#largeKnob { +lmms--gui--KickerInstrumentView lmms--gui--Knob#largeKnob { color: #0c3b89; qproperty-outerColor: #519fff; qproperty-innerRadius: 12.0; @@ -781,7 +781,7 @@ lmms--gui--KickerInstrumentView Knob#largeKnob { } -lmms--gui--AudioFileProcessorView Knob { +lmms--gui--AudioFileProcessorView lmms--gui--Knob { color: rgb(240, 147, 14); qproperty-outerColor: rgb(30, 35, 37); qproperty-innerRadius: 4; @@ -791,7 +791,7 @@ lmms--gui--AudioFileProcessorView Knob { qproperty-lineWidth: 3; } -lmms--gui--OrganicInstrumentView Knob { +lmms--gui--OrganicInstrumentView lmms--gui--Knob { color: rgb(124, 207, 98); qproperty-outerColor: rgb(13, 42, 4); qproperty-innerRadius: 2; @@ -801,13 +801,13 @@ lmms--gui--OrganicInstrumentView Knob { qproperty-lineWidth: 1.5; } -lmms--gui--OrganicInstrumentView Knob#harmKnob { +lmms--gui--OrganicInstrumentView lmms--gui--Knob#harmKnob { color: rgb(205, 98, 216); qproperty-outerColor: rgb(18, 4, 18); } -lmms--gui--OrganicInstrumentView Knob#fx1Knob, -lmms--gui--OrganicInstrumentView Knob#volKnob { +lmms--gui--OrganicInstrumentView lmms--gui--Knob#fx1Knob, +lmms--gui--OrganicInstrumentView lmms--gui--Knob#volKnob { color: rgb(157, 157, 157); qproperty-outerColor: rgb(37, 37, 37); qproperty-innerRadius: 4; @@ -817,7 +817,7 @@ lmms--gui--OrganicInstrumentView Knob#volKnob { qproperty-lineWidth: 2; } -lmms--gui--Sf2InstrumentView Knob { +lmms--gui--Sf2InstrumentView lmms--gui--Knob { color: #ff00ea; qproperty-outerColor: rgb(20, 5, 18); qproperty-innerRadius: 2; @@ -827,7 +827,7 @@ lmms--gui--Sf2InstrumentView Knob { qproperty-lineWidth: 2; } -lmms--gui--SfxrInstrumentView Knob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob { color: #000; qproperty-outerColor: rgb(194, 177, 145); qproperty-innerRadius: 2; @@ -835,42 +835,42 @@ lmms--gui--SfxrInstrumentView Knob { qproperty-lineWidth: 2; } -lmms--gui--SfxrInstrumentView Knob#envKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#envKnob { color: #263352; qproperty-outerColor: #4b66a4; } -lmms--gui--SfxrInstrumentView Knob#freqKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#freqKnob { color: #1e4a22; qproperty-outerColor: #3c9544; } -lmms--gui--SfxrInstrumentView Knob#changeKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#changeKnob { color: #591c1c; qproperty-outerColor: #b23737; } -lmms--gui--SfxrInstrumentView Knob#sqrKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#sqrKnob { color: #3b2714; qproperty-outerColor: #724c27; } -lmms--gui--SfxrInstrumentView Knob#repeatKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#repeatKnob { color: #292929; qproperty-outerColor: #515151; } -lmms--gui--SfxrInstrumentView Knob#phaserKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#phaserKnob { color: #144c4d; qproperty-outerColor: #299899; } -lmms--gui--SfxrInstrumentView Knob#filterKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#filterKnob { color: #47224c; qproperty-outerColor: #8e4397; } -lmms--gui--OpulenzInstrumentView Knob { +lmms--gui--OpulenzInstrumentView lmms--gui--Knob { color: rgb(128,128,128); qproperty-outerColor: rgb(255,255,255); qproperty-innerRadius: 2; @@ -878,7 +878,7 @@ lmms--gui--OpulenzInstrumentView Knob { qproperty-lineWidth: 2; } -lmms--gui--SidInstrumentView Knob { +lmms--gui--SidInstrumentView lmms--gui--Knob { color: rgb(113,95,80); qproperty-outerColor: rgb( 255,255,255 ); qproperty-innerRadius: 2; @@ -886,7 +886,7 @@ lmms--gui--SidInstrumentView Knob { qproperty-lineWidth: 2; } -lmms--gui--WatsynView Knob { +lmms--gui--WatsynView lmms--gui--Knob { qproperty-innerRadius: 1; qproperty-outerRadius: 7; qproperty-centerPointX: 9.5; @@ -894,17 +894,17 @@ lmms--gui--WatsynView Knob { qproperty-lineWidth: 2; } -lmms--gui--WatsynView Knob#aKnob { +lmms--gui--WatsynView lmms--gui--Knob#aKnob { color: #43b2ff; qproperty-outerColor: #43b2ff; } -lmms--gui--WatsynView Knob#bKnob { +lmms--gui--WatsynView lmms--gui--Knob#bKnob { color: #fc5431; qproperty-outerColor: #fc5431; } -lmms--gui--WatsynView Knob#mixKnob { +lmms--gui--WatsynView lmms--gui--Knob#mixKnob { color: #43ff82; qproperty-outerColor: #43ff82; qproperty-outerRadius: 13; @@ -912,17 +912,17 @@ lmms--gui--WatsynView Knob#mixKnob { qproperty-centerPointY: 15.5; } -lmms--gui--WatsynView Knob#mixenvKnob { +lmms--gui--WatsynView lmms--gui--Knob#mixenvKnob { color: #43ff82; qproperty-outerColor: #43ff82; } -lmms--gui--WatsynView Knob#xtalkKnob { +lmms--gui--WatsynView lmms--gui--Knob#xtalkKnob { color: #fb50fb; qproperty-outerColor: #fb50fb; } -lmms--gui--MonstroView Knob { +lmms--gui--MonstroView lmms--gui--Knob { color: #ffffff; qproperty-outerColor: #aaaaaa; qproperty-outerRadius: 9; @@ -932,7 +932,7 @@ lmms--gui--MonstroView Knob { qproperty-lineWidth: 2.5; } -lmms--gui--NesInstrumentView Knob { +lmms--gui--NesInstrumentView lmms--gui--Knob { color: #e7231b; qproperty-outerColor: #fff; qproperty-outerRadius: 11.0; @@ -956,7 +956,7 @@ lmms--gui--CompressorControlDialog { qproperty-resetColor: rgba(200, 100, 15, 200); } -lmms--gui--CompressorControlDialog Knob { +lmms--gui--CompressorControlDialog lmms--gui--Knob { color: #2fcc71; qproperty-outerColor: #2fcc71; qproperty-lineWidth: 2; diff --git a/data/themes/default/style.css b/data/themes/default/style.css index 26b72bc58c5..58c91d2fd5c 100644 --- a/data/themes/default/style.css +++ b/data/themes/default/style.css @@ -792,7 +792,7 @@ lmms--gui--SubWindow > QPushButton:hover{ /* Plugins */ -lmms--gui--TripleOscillatorView Knob { +lmms--gui--TripleOscillatorView lmms--gui--Knob { color: rgb(255,255,255); qproperty-outerColor: rgb(255,255,255); qproperty-innerRadius: 2; @@ -803,7 +803,7 @@ lmms--gui--TripleOscillatorView Knob { } -lmms--gui--KickerInstrumentView Knob#smallKnob { +lmms--gui--KickerInstrumentView lmms--gui--Knob#smallKnob { color: #595959; qproperty-outerColor: black; qproperty-innerRadius: 3; @@ -814,7 +814,7 @@ lmms--gui--KickerInstrumentView Knob#smallKnob { } -lmms--gui--KickerInstrumentView Knob#largeKnob { +lmms--gui--KickerInstrumentView lmms--gui--Knob#largeKnob { color: #0c3b89; qproperty-outerColor: #519fff; qproperty-innerRadius: 12.0; @@ -825,7 +825,7 @@ lmms--gui--KickerInstrumentView Knob#largeKnob { } -lmms--gui--AudioFileProcessorView Knob { +lmms--gui--AudioFileProcessorView lmms--gui--Knob { color: rgb(240, 147, 14); qproperty-outerColor: rgb(30, 35, 37); qproperty-innerRadius: 4; @@ -835,7 +835,7 @@ lmms--gui--AudioFileProcessorView Knob { qproperty-lineWidth: 3; } -lmms--gui--OrganicInstrumentView Knob { +lmms--gui--OrganicInstrumentView lmms--gui--Knob { color: rgb(124, 207, 98); qproperty-outerColor: rgb(13, 42, 4); qproperty-innerRadius: 2; @@ -845,13 +845,13 @@ lmms--gui--OrganicInstrumentView Knob { qproperty-lineWidth: 1.5; } -lmms--gui--OrganicInstrumentView Knob#harmKnob { +lmms--gui--OrganicInstrumentView lmms--gui--Knob#harmKnob { color: rgb(205, 98, 216); qproperty-outerColor: rgb(18, 4, 18); } -lmms--gui--OrganicInstrumentView Knob#fx1Knob, -lmms--gui--OrganicInstrumentView Knob#volKnob { +lmms--gui--OrganicInstrumentView lmms--gui--Knob#fx1Knob, +lmms--gui--OrganicInstrumentView lmms--gui--Knob#volKnob { color: rgb(157, 157, 157); qproperty-outerColor: rgb(37, 37, 37); qproperty-innerRadius: 4; @@ -861,7 +861,7 @@ lmms--gui--OrganicInstrumentView Knob#volKnob { qproperty-lineWidth: 2; } -lmms--gui--Sf2InstrumentView Knob { +lmms--gui--Sf2InstrumentView lmms--gui--Knob { color: #ff00ea; qproperty-outerColor: rgb(20, 5, 18); qproperty-innerRadius: 2; @@ -871,7 +871,7 @@ lmms--gui--Sf2InstrumentView Knob { qproperty-lineWidth: 2; } -lmms--gui--SfxrInstrumentView Knob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob { color: #000; qproperty-outerColor: rgb(194, 177, 145); qproperty-innerRadius: 2; @@ -879,42 +879,42 @@ lmms--gui--SfxrInstrumentView Knob { qproperty-lineWidth: 2; } -lmms--gui--SfxrInstrumentView Knob#envKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#envKnob { color: #263352; qproperty-outerColor: #4b66a4; } -lmms--gui--SfxrInstrumentView Knob#freqKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#freqKnob { color: #1e4a22; qproperty-outerColor: #3c9544; } -lmms--gui--SfxrInstrumentView Knob#changeKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#changeKnob { color: #591c1c; qproperty-outerColor: #b23737; } -lmms--gui--SfxrInstrumentView Knob#sqrKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#sqrKnob { color: #3b2714; qproperty-outerColor: #724c27; } -lmms--gui--SfxrInstrumentView Knob#repeatKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#repeatKnob { color: #292929; qproperty-outerColor: #515151; } -lmms--gui--SfxrInstrumentView Knob#phaserKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#phaserKnob { color: #144c4d; qproperty-outerColor: #299899; } -lmms--gui--SfxrInstrumentView Knob#filterKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#filterKnob { color: #47224c; qproperty-outerColor: #8e4397; } -lmms--gui--OpulenzInstrumentView Knob { +lmms--gui--OpulenzInstrumentView lmms--gui--Knob { color: rgb(128,128,128); qproperty-outerColor: rgb(255,255,255); qproperty-innerRadius: 2; @@ -922,7 +922,7 @@ lmms--gui--OpulenzInstrumentView Knob { qproperty-lineWidth: 2; } -lmms--gui--SidInstrumentView Knob { +lmms--gui--SidInstrumentView lmms--gui--Knob { color: rgb(113,95,80); qproperty-outerColor: rgb( 255,255,255 ); qproperty-innerRadius: 2; @@ -930,7 +930,7 @@ lmms--gui--SidInstrumentView Knob { qproperty-lineWidth: 2; } -lmms--gui--WatsynView Knob { +lmms--gui--WatsynView lmms--gui--Knob { qproperty-innerRadius: 1; qproperty-outerRadius: 7; qproperty-centerPointX: 9.5; @@ -938,17 +938,17 @@ lmms--gui--WatsynView Knob { qproperty-lineWidth: 2; } -lmms--gui--WatsynView Knob#aKnob { +lmms--gui--WatsynView lmms--gui--Knob#aKnob { color: #43b2ff; qproperty-outerColor: #43b2ff; } -lmms--gui--WatsynView Knob#bKnob { +lmms--gui--WatsynView lmms--gui--Knob#bKnob { color: #fc5431; qproperty-outerColor: #fc5431; } -lmms--gui--WatsynView Knob#mixKnob { +lmms--gui--WatsynView lmms--gui--Knob#mixKnob { color: #43ff82; qproperty-outerColor: #43ff82; qproperty-outerRadius: 13; @@ -956,17 +956,17 @@ lmms--gui--WatsynView Knob#mixKnob { qproperty-centerPointY: 15.5; } -lmms--gui--WatsynView Knob#mixenvKnob { +lmms--gui--WatsynView lmms--gui--Knob#mixenvKnob { color: #43ff82; qproperty-outerColor: #43ff82; } -lmms--gui--WatsynView Knob#xtalkKnob { +lmms--gui--WatsynView lmms--gui--Knob#xtalkKnob { color: #fb50fb; qproperty-outerColor: #fb50fb; } -lmms--gui--MonstroView Knob { +lmms--gui--MonstroView lmms--gui--Knob { color: #ffffff; qproperty-outerColor: #aaaaaa; qproperty-outerRadius: 9; @@ -976,7 +976,7 @@ lmms--gui--MonstroView Knob { qproperty-lineWidth: 2.5; } -lmms--gui--NesInstrumentView Knob { +lmms--gui--NesInstrumentView lmms--gui--Knob { color: #e7231b; qproperty-outerColor: #fff; qproperty-outerRadius: 11.0; @@ -1000,7 +1000,7 @@ lmms--gui--CompressorControlDialog { qproperty-resetColor: rgba(200, 100, 15, 200); } -lmms--gui--CompressorControlDialog Knob { +lmms--gui--CompressorControlDialog lmms--gui--Knob { color: #2fcc71; qproperty-outerColor: #2fcc71; qproperty-lineWidth: 2; From bdc5fcad58303cb1ec6154e2905ba4fad7d62f11 Mon Sep 17 00:00:00 2001 From: allejok96 Date: Sun, 5 Jun 2022 14:49:56 +0200 Subject: [PATCH 078/118] Fix comments by DomClark and JohannesLorenz --- include/DeprecationHelper.h | 3 ++- include/MainApplication.h | 4 ++-- include/ModelView.h | 4 ++-- include/aeffectx.h | 4 ---- plugins/Amplifier/AmplifierControlDialog.h | 2 +- plugins/Compressor/CompressorControlDialog.h | 18 ++++++++---------- plugins/Sf2Player/fluidsynthshims.h | 6 ------ src/core/main.cpp | 2 +- src/gui/MainApplication.cpp | 4 ++-- src/gui/ModelView.cpp | 4 ++-- 10 files changed, 20 insertions(+), 31 deletions(-) diff --git a/include/DeprecationHelper.h b/include/DeprecationHelper.h index 7543e85a059..7786665a30f 100644 --- a/include/DeprecationHelper.h +++ b/include/DeprecationHelper.h @@ -63,6 +63,7 @@ inline QPoint position(QWheelEvent *wheelEvent) return wheelEvent->pos(); #endif } -#endif // DEPRECATIONHELPER_H } // namespace lmms + +#endif // DEPRECATIONHELPER_H diff --git a/include/MainApplication.h b/include/MainApplication.h index ece887265d9..04bc82226de 100644 --- a/include/MainApplication.h +++ b/include/MainApplication.h @@ -35,7 +35,7 @@ #endif -namespace lmms +namespace lmms::gui { @@ -62,6 +62,6 @@ class MainApplication : public QApplication }; -} // namespace lmms +} // namespace lmms::gui #endif // MAINAPPLICATION_H diff --git a/include/ModelView.h b/include/ModelView.h index 65fb07a35ba..a858dc7ec1d 100644 --- a/include/ModelView.h +++ b/include/ModelView.h @@ -28,7 +28,7 @@ #include #include "Model.h" -namespace lmms +namespace lmms::gui { class LMMS_EXPORT ModelView @@ -83,7 +83,7 @@ class LMMS_EXPORT ModelView } ; -} // namespace lmms +} // namespace lmms::gui #endif diff --git a/include/aeffectx.h b/include/aeffectx.h index 617211e956f..5ba81e6a0a7 100644 --- a/include/aeffectx.h +++ b/include/aeffectx.h @@ -36,8 +36,6 @@ #define VST_CALL_CONV #endif -namespace lmms -{ template constexpr int32_t CCONST(T a, T b, T c, T d) @@ -302,6 +300,4 @@ class VstTimeInfo typedef intptr_t (VST_CALL_CONV * audioMasterCallback)( AEffect * , int32_t, int32_t, intptr_t, void * , float ); -} // namespace lmms - #endif diff --git a/plugins/Amplifier/AmplifierControlDialog.h b/plugins/Amplifier/AmplifierControlDialog.h index e8a544e8d42..6362d5f72a6 100644 --- a/plugins/Amplifier/AmplifierControlDialog.h +++ b/plugins/Amplifier/AmplifierControlDialog.h @@ -51,6 +51,6 @@ class AmplifierControlDialog : public EffectControlDialog } // namespace gui -} // namespace plugin +} // namespace lmms #endif diff --git a/plugins/Compressor/CompressorControlDialog.h b/plugins/Compressor/CompressorControlDialog.h index 2ab28815571..1324d7e2653 100755 --- a/plugins/Compressor/CompressorControlDialog.h +++ b/plugins/Compressor/CompressorControlDialog.h @@ -36,6 +36,14 @@ class QLabel; namespace lmms { +constexpr float COMP_NOISE_FLOOR = 0.000001;// -120 dbFs + +class CompressorControls; + + +namespace gui +{ + constexpr int COMP_MILLI_PER_PIXEL = 6; constexpr int MIN_COMP_SCREEN_X = 800; constexpr int MIN_COMP_SCREEN_Y = 360; @@ -51,16 +59,6 @@ constexpr int COMP_BOX_Y = 280; constexpr float COMP_GRID_SPACING = 3.f;// 3 db per grid line constexpr float COMP_GRID_MAX = 96.f;// Can't zoom out past 96 db -constexpr float COMP_NOISE_FLOOR = 0.000001;// -120 dbFs - - - -class CompressorControls; - - -namespace gui -{ - class automatableButtonGroup; class Knob; class PixmapButton; diff --git a/plugins/Sf2Player/fluidsynthshims.h b/plugins/Sf2Player/fluidsynthshims.h index 844f7052c2e..2ccadce8d96 100644 --- a/plugins/Sf2Player/fluidsynthshims.h +++ b/plugins/Sf2Player/fluidsynthshims.h @@ -28,9 +28,6 @@ #include -namespace lmms -{ - #if FLUIDSYNTH_VERSION_MAJOR < 2 @@ -89,7 +86,4 @@ inline fluid_preset_t* fluid_sfont_iteration_next_wrapper(fluid_sfont_t* sfont, #endif // FLUIDSYNTH_VERSION_MAJOR < 2 - -} // namespace lmms - #endif // FLUIDSYNTHSHIMS_H diff --git a/src/core/main.cpp b/src/core/main.cpp index 16f4491c0cc..c4964abc3e2 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -361,7 +361,7 @@ int main( int argc, char * * argv ) #endif QCoreApplication * app = coreOnly ? new QCoreApplication( argc, argv ) : - new MainApplication( argc, argv ); + new gui::MainApplication(argc, argv); AudioEngine::qualitySettings qs( AudioEngine::qualitySettings::Mode_HighQuality ); OutputSettings os( 44100, OutputSettings::BitRateSettings(160, false), OutputSettings::Depth_16Bit, OutputSettings::StereoMode_JointStereo ); diff --git a/src/gui/MainApplication.cpp b/src/gui/MainApplication.cpp index 3d77395cf29..a08df0f0927 100644 --- a/src/gui/MainApplication.cpp +++ b/src/gui/MainApplication.cpp @@ -31,7 +31,7 @@ #include "MainWindow.h" #include "Song.h" -namespace lmms +namespace lmms::gui { @@ -108,4 +108,4 @@ bool MainApplication::nativeEventFilter(const QByteArray& eventType, #endif -} // namespace lmms \ No newline at end of file +} // namespace lmms::gui diff --git a/src/gui/ModelView.cpp b/src/gui/ModelView.cpp index e6ba92258d8..4ccdffd7251 100644 --- a/src/gui/ModelView.cpp +++ b/src/gui/ModelView.cpp @@ -26,7 +26,7 @@ #include "ModelView.h" -namespace lmms +namespace lmms::gui { @@ -96,4 +96,4 @@ void ModelView::doConnections() } -} // namespace lmms +} // namespace lmms::gui From a1beba3e48f7c19c0d54ec03f1fdc87b3cd2dbbd Mon Sep 17 00:00:00 2001 From: allejok96 Date: Sun, 5 Jun 2022 15:03:09 +0200 Subject: [PATCH 079/118] Move getGUI to gui namespace --- include/GuiApplication.h | 12 +++--------- plugins/MidiImport/MidiImport.cpp | 10 +++++----- src/3rdparty/rpmalloc/rpmalloc | 2 +- src/core/Clip.cpp | 2 +- src/core/ConfigManager.cpp | 4 ++-- src/core/DataFile.cpp | 10 +++++----- src/core/Plugin.cpp | 4 ++-- src/core/SampleBuffer.cpp | 2 +- src/core/Song.cpp | 8 +++++++- src/core/TrackContainer.cpp | 6 +++--- src/core/audio/AudioFileDevice.cpp | 4 ++-- src/core/audio/AudioJack.cpp | 4 ++-- src/core/main.cpp | 2 +- src/core/midi/MidiJack.cpp | 2 +- src/gui/GuiApplication.cpp | 12 +++++++----- src/tracks/MidiClip.cpp | 12 ++++++------ 16 files changed, 49 insertions(+), 47 deletions(-) diff --git a/include/GuiApplication.h b/include/GuiApplication.h index 29a23393e96..84697175fcf 100644 --- a/include/GuiApplication.h +++ b/include/GuiApplication.h @@ -32,10 +32,7 @@ class QLabel; -namespace lmms -{ - -namespace gui +namespace lmms::gui { class AutomationEditorWindow; @@ -91,12 +88,9 @@ private slots: QLabel* m_loadingProgressLabel; }; - -} // namespace gui - // Short-hand function -LMMS_EXPORT gui::GuiApplication* getGUI(); +LMMS_EXPORT GuiApplication* getGUI(); -} // namespace lmms +} // namespace lmms::gui #endif // GUIAPPLICATION_H diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index e1c8661a542..e6cf644cf39 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -105,10 +105,10 @@ bool MidiImport::tryImport( TrackContainer* tc ) } #ifdef LMMS_HAVE_FLUIDSYNTH - if( getGUI() != nullptr && + if (gui::getGUI() != nullptr && ConfigManager::inst()->sf2File().isEmpty() ) { - QMessageBox::information( getGUI()->mainWindow(), + QMessageBox::information(gui::getGUI()->mainWindow(), tr( "Setup incomplete" ), tr( "You have not set up a default soundfont in " "the settings dialog (Edit->Settings). " @@ -118,9 +118,9 @@ bool MidiImport::tryImport( TrackContainer* tc ) "settings dialog and try again." ) ); } #else - if( getGUI() != nullptr ) + if (gui::getGUI() != nullptr) { - QMessageBox::information( getGUI()->mainWindow(), + QMessageBox::information(gui::getGUI()->mainWindow(), tr( "Setup incomplete" ), tr( "You did not compile LMMS with support for " "SoundFont2 player, which is used to add default " @@ -309,7 +309,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) const int MIDI_CC_COUNT = 128 + 1; // 0-127 (128) + pitch bend const int preTrackSteps = 2; QProgressDialog pd( TrackContainer::tr( "Importing MIDI-file..." ), - TrackContainer::tr( "Cancel" ), 0, preTrackSteps, getGUI()->mainWindow() ); + TrackContainer::tr("Cancel"), 0, preTrackSteps, gui::getGUI()->mainWindow()); pd.setWindowTitle( TrackContainer::tr( "Please wait..." ) ); pd.setWindowModality(Qt::WindowModal); pd.setMinimumDuration( 0 ); diff --git a/src/3rdparty/rpmalloc/rpmalloc b/src/3rdparty/rpmalloc/rpmalloc index 30cc0c7a8c1..80daac0d539 160000 --- a/src/3rdparty/rpmalloc/rpmalloc +++ b/src/3rdparty/rpmalloc/rpmalloc @@ -1 +1 @@ -Subproject commit 30cc0c7a8c1b4decdeb72d456b158f0995ca839e +Subproject commit 80daac0d539ab2a8edfd5ca24b1e0c77a4974bbb diff --git a/src/core/Clip.cpp b/src/core/Clip.cpp index b23de0d01c3..74a168fbdf7 100644 --- a/src/core/Clip.cpp +++ b/src/core/Clip.cpp @@ -148,7 +148,7 @@ void Clip::copyStateTo( Clip *src, Clip *dst ) dst->movePosition( pos ); AutomationClip::resolveAllIDs(); - getGUI()->automationEditor()->m_editor->updateAfterClipChange(); + gui::getGUI()->automationEditor()->m_editor->updateAfterClipChange(); } } diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 08117c02898..59987de97aa 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -517,7 +517,7 @@ void ConfigManager::loadConfigFile(const QString & configFile) #endif setBackgroundPicFile(value("paths", "backgroundtheme")); } - else if(getGUI() != nullptr) + else if (gui::getGUI() != nullptr) { QMessageBox::warning(nullptr, gui::MainWindow::tr("Configuration file"), gui::MainWindow::tr("Error while parsing configuration file at line %1:%2: %3"). @@ -648,7 +648,7 @@ void ConfigManager::saveConfigFile() "the directory containing the " "file and try again!" ).arg(m_lmmsRcFile); - if(getGUI() != nullptr) + if (gui::getGUI() != nullptr) { QMessageBox::critical(nullptr, title, message, QMessageBox::Ok, diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index b926bd3932a..da19b4b619e 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -143,7 +143,7 @@ DataFile::DataFile( const QString & _fileName ) : QFile inFile( _fileName ); if( !inFile.open( QIODevice::ReadOnly ) ) { - if( getGUI() != nullptr ) + if (gui::getGUI() != nullptr) { QMessageBox::critical( nullptr, gui::SongEditor::tr( "Could not open file" ), @@ -299,7 +299,7 @@ bool DataFile::writeFile(const QString& filename, bool withResources) { // Small lambda function for displaying errors auto showError = [this](QString title, QString body){ - if (getGUI() != nullptr) + if (gui::getGUI() != nullptr) { QMessageBox mb; mb.setWindowTitle(title); @@ -1893,7 +1893,7 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile ) using gui::SongEditor; qWarning() << "at line" << line << "column" << errorMsg; - if( getGUI() != nullptr ) + if (gui::getGUI() != nullptr) { QMessageBox::critical( nullptr, SongEditor::tr( "Error in file" ), @@ -1936,7 +1936,7 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile ) if (createdWith.setCompareType(ProjectVersion::Minor) != openedWith.setCompareType(ProjectVersion::Minor) - && getGUI() != nullptr && root.attribute("type") == "song" + && gui::getGUI() != nullptr && root.attribute("type") == "song" ){ auto projectType = _sourceFile.endsWith(".mpt") ? SongEditor::tr("template") : SongEditor::tr("project"); @@ -1984,4 +1984,4 @@ unsigned int DataFile::legacyFileVersion() } -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/src/core/Plugin.cpp b/src/core/Plugin.cpp index b8a391f9acd..e71df15b89f 100644 --- a/src/core/Plugin.cpp +++ b/src/core/Plugin.cpp @@ -221,7 +221,7 @@ Plugin * Plugin::instantiate(const QString& pluginName, Model * parent, Plugin* inst; if( pi.isNull() ) { - if( getGUI() != nullptr ) + if (gui::getGUI() != nullptr) { QMessageBox::information( nullptr, tr( "Plugin not found" ), @@ -243,7 +243,7 @@ Plugin * Plugin::instantiate(const QString& pluginName, Model * parent, } else { - if( getGUI() != nullptr ) + if (gui::getGUI() != nullptr) { QMessageBox::information( nullptr, tr( "Error while loading plugin" ), diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index 82d43edc37c..b931b27b5a9 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -369,7 +369,7 @@ void SampleBuffer::update(bool keepSettings) QString message = tr("Audio files are limited to %1 MB " "in size and %2 minutes of playing time" ).arg(fileSizeMax).arg(sampleLengthMax); - if (getGUI() != nullptr) + if (gui::getGUI() != nullptr) { QMessageBox::information(nullptr, title, message, QMessageBox::Ok); diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 73b2d2d68d1..d26eab45052 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -856,6 +856,8 @@ AutomatedValueMap Song::automatedValuesAt(TimePos time, int clipNum) const void Song::clearProject() { + using gui::getGUI; + Engine::projectJournal()->setJournalling( false ); if( m_playing ) @@ -1013,6 +1015,8 @@ void Song::createNewProjectFromTemplate( const QString & templ ) // load given song void Song::loadProject( const QString & fileName ) { + using gui::getGUI; + QDomNode node; m_loadingProject = true; @@ -1230,6 +1234,8 @@ void Song::loadProject( const QString & fileName ) // only save current song as filename and do nothing else bool Song::saveProjectFile(const QString & filename, bool withResources) { + using gui::getGUI; + DataFile dataFile( DataFile::SongProject ); m_savingProject = true; @@ -1558,4 +1564,4 @@ void Song::setKeymap(unsigned int index, std::shared_ptr newMap) } -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/src/core/TrackContainer.cpp b/src/core/TrackContainer.cpp index 93d156e6580..ce8fdd4005d 100644 --- a/src/core/TrackContainer.cpp +++ b/src/core/TrackContainer.cpp @@ -91,14 +91,14 @@ void TrackContainer::loadSettings( const QDomElement & _this ) static QProgressDialog * pd = nullptr; bool was_null = ( pd == nullptr ); - if( !journalRestore && getGUI() != nullptr ) + if (!journalRestore && gui::getGUI() != nullptr) { if( pd == nullptr ) { pd = new QProgressDialog( tr( "Loading project..." ), tr( "Cancel" ), 0, Engine::getSong()->getLoadingTrackCount(), - getGUI()->mainWindow() ); + gui::getGUI()->mainWindow()); pd->setWindowModality( Qt::ApplicationModal ); pd->setWindowTitle( tr( "Please wait..." ) ); pd->show(); @@ -115,7 +115,7 @@ void TrackContainer::loadSettings( const QDomElement & _this ) QEventLoop::AllEvents, 100 ); if( pd->wasCanceled() ) { - if ( getGUI() != nullptr ) + if (gui::getGUI() != nullptr) { gui::TextFloat::displayMessage( tr( "Loading cancelled" ), tr( "Project loading was cancelled." ), diff --git a/src/core/audio/AudioFileDevice.cpp b/src/core/audio/AudioFileDevice.cpp index 80db5897172..f80d4a00f91 100644 --- a/src/core/audio/AudioFileDevice.cpp +++ b/src/core/audio/AudioFileDevice.cpp @@ -56,7 +56,7 @@ AudioFileDevice::AudioFileDevice( OutputSettings const & outputSettings, "file and try again!" ).arg( _file ); - if( getGUI() != nullptr ) + if (gui::getGUI() != nullptr) { QMessageBox::critical( nullptr, title, message, QMessageBox::Ok, @@ -91,4 +91,4 @@ int AudioFileDevice::writeData( const void* data, int len ) return -1; } -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/src/core/audio/AudioJack.cpp b/src/core/audio/AudioJack.cpp index ce356cbfedd..f0e606f4783 100644 --- a/src/core/audio/AudioJack.cpp +++ b/src/core/audio/AudioJack.cpp @@ -104,7 +104,7 @@ void AudioJack::restartAfterZombified() { m_active = false; startProcessing(); - QMessageBox::information( getGUI()->mainWindow(), + QMessageBox::information(gui::getGUI()->mainWindow(), tr( "JACK client restarted" ), tr( "LMMS was kicked by JACK for some reason. " "Therefore the JACK backend of LMMS has been " @@ -113,7 +113,7 @@ void AudioJack::restartAfterZombified() } else { - QMessageBox::information( getGUI()->mainWindow(), + QMessageBox::information(gui::getGUI()->mainWindow(), tr( "JACK server down" ), tr( "The JACK server seems to have been shutdown " "and starting a new instance failed. " diff --git a/src/core/main.cpp b/src/core/main.cpp index c4964abc3e2..5d454dd9b04 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -1011,7 +1011,7 @@ int main( int argc, char * * argv ) // instances of LMMS. if( autoSaveEnabled ) { - getGUI()->mainWindow()->autoSaveTimerReset(); + gui::getGUI()->mainWindow()->autoSaveTimerReset(); } } diff --git a/src/core/midi/MidiJack.cpp b/src/core/midi/MidiJack.cpp index 4f6be909e4a..1ad4da09deb 100644 --- a/src/core/midi/MidiJack.cpp +++ b/src/core/midi/MidiJack.cpp @@ -58,7 +58,7 @@ static void JackMidiShutdown(void *arg) QString msg_short = MidiJack::tr("JACK server down"); //: When JACK(JACK Audio Connection Kit) disconnects, it will show the following message (dialog message) QString msg_long = MidiJack::tr("The JACK server seems to be shuted down."); - QMessageBox::information( getGUI()->mainWindow(), msg_short, msg_long ); + QMessageBox::information(gui::getGUI()->mainWindow(), msg_short, msg_long); } MidiJack::MidiJack() : diff --git a/src/gui/GuiApplication.cpp b/src/gui/GuiApplication.cpp index 5b530123bd9..a016aaea53d 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -54,14 +54,16 @@ namespace lmms { -gui::GuiApplication* getGUI() -{ - return gui::GuiApplication::instance(); -} namespace gui { +GuiApplication* getGUI() +{ + return GuiApplication::instance(); +} + + GuiApplication* GuiApplication::s_instance = nullptr; GuiApplication* GuiApplication::instance() @@ -261,4 +263,4 @@ QFont GuiApplication::getWin32SystemFont() } // namespace gui -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/src/tracks/MidiClip.cpp b/src/tracks/MidiClip.cpp index c2a5d6e4b4f..ef693ba5b47 100644 --- a/src/tracks/MidiClip.cpp +++ b/src/tracks/MidiClip.cpp @@ -200,9 +200,9 @@ TimePos MidiClip::beatClipLength() const Note * MidiClip::addNote( const Note & _new_note, const bool _quant_pos ) { Note * new_note = new Note( _new_note ); - if( _quant_pos && getGUI()->pianoRoll() ) + if (_quant_pos && gui::getGUI()->pianoRoll()) { - new_note->quantizePos( getGUI()->pianoRoll()->quantization() ); + new_note->quantizePos(gui::getGUI()->pianoRoll()->quantization()); } instrumentTrack()->lock(); @@ -569,11 +569,11 @@ void MidiClip::updatePatternTrack() Engine::patternStore()->updatePatternTrack(this); } - if( getGUI() != nullptr - && getGUI()->pianoRoll() - && getGUI()->pianoRoll()->currentMidiClip() == this ) + if (gui::getGUI() != nullptr + && gui::getGUI()->pianoRoll() + && gui::getGUI()->pianoRoll()->currentMidiClip() == this) { - getGUI()->pianoRoll()->update(); + gui::getGUI()->pianoRoll()->update(); } } From 9a9e091fd5f55040a0ef4d655381b6a93722ae10 Mon Sep 17 00:00:00 2001 From: allejok96 Date: Mon, 6 Jun 2022 18:21:54 +0200 Subject: [PATCH 080/118] Remove redundant lmms:: --- include/AutomationEditor.h | 7 ++++--- include/Instrument.h | 2 +- include/InstrumentFunctionViews.h | 7 +++---- include/PluginIssue.h | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index cc104f3d00a..2e05caa862f 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -42,10 +42,10 @@ class QScrollBar; namespace lmms { + class NotePlayHandle; -} -namespace lmms::gui +namespace gui { class Knob; @@ -300,7 +300,8 @@ private slots: ComboBox * m_quantizeComboBox; }; +} // namespace gui -} // namespace lmms::gui +} // namespace lmms #endif diff --git a/include/Instrument.h b/include/Instrument.h index aba9ec4a97f..7ec3c66be6c 100644 --- a/include/Instrument.h +++ b/include/Instrument.h @@ -149,7 +149,7 @@ class LMMS_EXPORT Instrument : public Plugin } ; -Q_DECLARE_OPERATORS_FOR_FLAGS(lmms::Instrument::Flags) +Q_DECLARE_OPERATORS_FOR_FLAGS(Instrument::Flags) } // namespace lmms diff --git a/include/InstrumentFunctionViews.h b/include/InstrumentFunctionViews.h index 322a6774357..bf4b07668ef 100644 --- a/include/InstrumentFunctionViews.h +++ b/include/InstrumentFunctionViews.h @@ -37,9 +37,7 @@ namespace lmms class InstrumentFunctionArpeggio; class InstrumentFunctionNoteStacking; -} - -namespace lmms::gui +namespace gui { class ComboBox; @@ -97,7 +95,8 @@ class InstrumentFunctionArpeggioView : public QWidget, public ModelView } ; +} // namespace gui -} // namespace lmms::gui +} // namespace lmms #endif diff --git a/include/PluginIssue.h b/include/PluginIssue.h index b7a3aaebe3c..3cc01623384 100644 --- a/include/PluginIssue.h +++ b/include/PluginIssue.h @@ -81,7 +81,7 @@ class PluginIssue friend QDebug (operator<<)(QDebug stream, const PluginIssue& iss); }; -QDebug operator<<(QDebug stream, const lmms::PluginIssue& iss); +QDebug operator<<(QDebug stream, const PluginIssue& iss); } // namespace lmms From f01bb65af52bd49fd3dbf0f525c7750e242e4ca9 Mon Sep 17 00:00:00 2001 From: allejok96 Date: Fri, 10 Jun 2022 16:44:38 +0200 Subject: [PATCH 081/118] Add 4 copyright messages --- include/PathUtil.h | 24 ++++++++++++++++++++++++ include/RecentProjectsMenu.h | 24 ++++++++++++++++++++++++ include/SendButtonIndicator.h | 23 +++++++++++++++++++++++ include/TemplatesMenu.h | 23 +++++++++++++++++++++++ 4 files changed, 94 insertions(+) diff --git a/include/PathUtil.h b/include/PathUtil.h index d2d412c1e29..8b1ef10970b 100644 --- a/include/PathUtil.h +++ b/include/PathUtil.h @@ -1,3 +1,27 @@ +/* + * PathUtil.h + * + * Copyright (c) 2019-2022 Spekular + * + * This file is part of LMMS - https://lmms.io + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + #ifndef PATHUTIL_H #define PATHUTIL_H diff --git a/include/RecentProjectsMenu.h b/include/RecentProjectsMenu.h index 33f7ff1b7fb..ac363829843 100644 --- a/include/RecentProjectsMenu.h +++ b/include/RecentProjectsMenu.h @@ -1,3 +1,27 @@ +/* + * RecentProjectsMenu.h + * + * Copyright (c) 2004-2022 Tobias Doerffel + * + * This file is part of LMMS - https://lmms.io + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + #ifndef RECENTPROJECTSMENU_H #define RECENTPROJECTSMENU_H diff --git a/include/SendButtonIndicator.h b/include/SendButtonIndicator.h index 2214c7ae022..ec4a90db37a 100644 --- a/include/SendButtonIndicator.h +++ b/include/SendButtonIndicator.h @@ -1,3 +1,26 @@ +/* + * SendButtonIndicator.h + * + * Copyright (c) 2014-2022 Tobias Doerffel + * + * This file is part of LMMS - https://lmms.io + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ #ifndef SENDBUTTONINDICATOR_H #define SENDBUTTONINDICATOR_H diff --git a/include/TemplatesMenu.h b/include/TemplatesMenu.h index 9f0afe13fe2..45c7bce4be0 100644 --- a/include/TemplatesMenu.h +++ b/include/TemplatesMenu.h @@ -1,3 +1,26 @@ +/* + * TemplatesMenu.h + * + * Copyright (c) 2004-2022 Tobias Doerffel + * + * This file is part of LMMS - https://lmms.io + * + * 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. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ #ifndef TEMPLATESMENU_H #define TEMPLATESMENU_H From 5aceabfc4837862681c886a148ee0be025e36550 Mon Sep 17 00:00:00 2001 From: allejok96 Date: Fri, 10 Jun 2022 18:21:58 +0200 Subject: [PATCH 082/118] ColorChooser include guard + some endif labels --- include/AudioAlsa.h | 2 +- include/AudioAlsaSetupWidget.h | 2 +- include/AudioFileMP3.h | 2 +- include/AudioFileOgg.h | 2 +- include/AudioJack.h | 2 +- include/AudioOss.h | 2 +- include/AudioSdl.h | 2 +- include/AudioSoundIo.h | 2 +- include/ColorChooser.h | 6 ++++++ include/embed.h | 4 ++-- 10 files changed, 16 insertions(+), 10 deletions(-) diff --git a/include/AudioAlsa.h b/include/AudioAlsa.h index 8b0438d5cc1..e1024b030a5 100644 --- a/include/AudioAlsa.h +++ b/include/AudioAlsa.h @@ -106,6 +106,6 @@ class AudioAlsa : public QThread, public AudioDevice } // namespace lmms -#endif +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/AudioAlsaSetupWidget.h b/include/AudioAlsaSetupWidget.h index 1007f493ab2..9e168934e68 100644 --- a/include/AudioAlsaSetupWidget.h +++ b/include/AudioAlsaSetupWidget.h @@ -64,6 +64,6 @@ public slots: } // namespace lmms::gui -#endif +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/AudioFileMP3.h b/include/AudioFileMP3.h index 39d52e3c624..16c3617a88d 100644 --- a/include/AudioFileMP3.h +++ b/include/AudioFileMP3.h @@ -73,6 +73,6 @@ class AudioFileMP3 : public AudioFileDevice } // namespace lmms -#endif +#endif // LMMS_HAVE_MP3LAME #endif diff --git a/include/AudioFileOgg.h b/include/AudioFileOgg.h index ae60bbfcc22..7e6921015d1 100644 --- a/include/AudioFileOgg.h +++ b/include/AudioFileOgg.h @@ -111,6 +111,6 @@ class AudioFileOgg : public AudioFileDevice } // namespace lmms -#endif +#endif // LMMS_HAVE_OGGVORBIS #endif diff --git a/include/AudioJack.h b/include/AudioJack.h index cd1bf542db9..648bb157df4 100644 --- a/include/AudioJack.h +++ b/include/AudioJack.h @@ -142,6 +142,6 @@ private slots: } // namespace lmms -#endif +#endif // LMMS_HAVE_JACK #endif diff --git a/include/AudioOss.h b/include/AudioOss.h index 14fb3e147cc..4a552040ba5 100644 --- a/include/AudioOss.h +++ b/include/AudioOss.h @@ -90,6 +90,6 @@ class setupWidget : public gui::AudioDeviceSetupWidget } // namespace lmms -#endif +#endif // LMMS_HAVE_OSS #endif diff --git a/include/AudioSdl.h b/include/AudioSdl.h index df186ddd848..b49e2ebe97e 100644 --- a/include/AudioSdl.h +++ b/include/AudioSdl.h @@ -113,6 +113,6 @@ class AudioSdl : public AudioDevice } // namespace lmms -#endif +#endif // LMMS_HAVE_SDL #endif diff --git a/include/AudioSoundIo.h b/include/AudioSoundIo.h index 61df3877c0b..411f4ab225d 100644 --- a/include/AudioSoundIo.h +++ b/include/AudioSoundIo.h @@ -143,6 +143,6 @@ class AudioSoundIo : public AudioDevice } // namespace lmms -#endif +#endif // LMMS_HAVE_SOUNDIO #endif diff --git a/include/ColorChooser.h b/include/ColorChooser.h index a5a952c002b..9b3389c477c 100644 --- a/include/ColorChooser.h +++ b/include/ColorChooser.h @@ -21,6 +21,9 @@ * */ +#ifndef COLOR_CHOOSER_H +#define COLOR_CHOOSER_H + #include #include #include @@ -64,3 +67,6 @@ class ColorChooser: public QColorDialog } // namespace lmms::gui + +#endif + diff --git a/include/embed.h b/include/embed.h index f8043ace6c3..5dd6a41a271 100644 --- a/include/embed.h +++ b/include/embed.h @@ -66,8 +66,8 @@ inline QPixmap getIconPixmap( const QString& _name, //QString getText( const char * _name ); } -#endif +#endif // PLUGIN_NAME class PixmapLoader @@ -136,7 +136,7 @@ class PluginPixmapLoader : public PixmapLoader } } ; -#endif +#endif // PLUGIN_NAME } // namespace lmms From 81e8400c9670c361a9a464791fc19b94643aef07 Mon Sep 17 00:00:00 2001 From: allejok96 Date: Fri, 10 Jun 2022 21:58:42 +0200 Subject: [PATCH 083/118] Add namespaces, move includes and ifdefs - AudioEngine: remove duplicate class - AudioPortAudio: move includes - EffectControlDialog: nested namespace - RaiiHelpers, RemotePluginBase, SharedMemory: add namespace - denormals: don't use namespace twice --- include/AudioEngine.h | 4 ---- include/AudioPortAudio.h | 39 +++++++++++++++------------------ include/EffectControlDialog.h | 7 +++--- include/RaiiHelpers.h | 6 +++++ include/RemotePluginBase.h | 9 +++++++- include/SharedMemory.h | 10 ++++++++- include/denormals.h | 18 +++++++-------- src/common/RemotePluginBase.cpp | 6 +++++ src/common/SharedMemory.cpp | 6 +++-- 9 files changed, 64 insertions(+), 41 deletions(-) diff --git a/include/AudioEngine.h b/include/AudioEngine.h index 11008e8fe48..e2833470e41 100644 --- a/include/AudioEngine.h +++ b/include/AudioEngine.h @@ -58,10 +58,6 @@ const int BYTES_PER_SURROUND_FRAME = sizeof( surroundSampleFrame ); const float OUTPUT_SAMPLE_MULTIPLIER = 32767.0f; - -class AudioEngineWorkerThread; - - class LMMS_EXPORT AudioEngine : public QObject { Q_OBJECT diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index 259b7466d63..10dab74eb2c 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -30,10 +30,25 @@ #include "lmmsconfig.h" #include "ComboBoxModel.h" +#ifdef LMMS_HAVE_PORTAUDIO + +# include + +# include "AudioDevice.h" +# include "AudioDeviceSetupWidget.h" + +# if defined paNeverDropInput || defined paNonInterleaved +# define PORTAUDIO_V19 +# else +# define PORTAUDIO_V18 +# endif + +#endif + + namespace lmms { - class AudioPortAudioSetupUtil : public QObject { Q_OBJECT @@ -48,31 +63,14 @@ public slots: }; -} - #ifdef LMMS_HAVE_PORTAUDIO -#include - - -#include "AudioDevice.h" -#include "AudioDeviceSetupWidget.h" - -#if defined paNeverDropInput || defined paNonInterleaved -# define PORTAUDIO_V19 -#else -# define PORTAUDIO_V18 -#endif - -namespace lmms -{ - namespace gui { class ComboBox; class LcdSpinBox; -} // namespace gui +} class AudioPortAudio : public AudioDevice @@ -161,9 +159,8 @@ class AudioPortAudio : public AudioDevice } ; +#endif // LMMS_HAVE_PORTAUDIO } // namespace lmms -#endif // LMMS_HAVE_PORTAUDIO - #endif diff --git a/include/EffectControlDialog.h b/include/EffectControlDialog.h index e17b28f2aeb..ec0ef3f1d77 100644 --- a/include/EffectControlDialog.h +++ b/include/EffectControlDialog.h @@ -35,9 +35,8 @@ namespace lmms class EffectControls; -} // namespace lmms -namespace lmms::gui +namespace gui { class LMMS_EXPORT EffectControlDialog : public QWidget, public ModelView @@ -61,6 +60,8 @@ class LMMS_EXPORT EffectControlDialog : public QWidget, public ModelView } ; -} // namespace lmms::gui +} // namespace gui + +} // namespace lmms #endif diff --git a/include/RaiiHelpers.h b/include/RaiiHelpers.h index bebd91ff911..0cfa2c4acbb 100644 --- a/include/RaiiHelpers.h +++ b/include/RaiiHelpers.h @@ -27,6 +27,10 @@ #include #include + +namespace lmms +{ + template class NullableResource { @@ -57,4 +61,6 @@ struct NullableResourceDeleter template using UniqueNullableResource = std::unique_ptr>; +} // namespace lmms + #endif // RAII_HELPERS_H diff --git a/include/RemotePluginBase.h b/include/RemotePluginBase.h index a5646ad1190..c5a168c96bc 100644 --- a/include/RemotePluginBase.h +++ b/include/RemotePluginBase.h @@ -83,7 +83,12 @@ #include #endif -#endif +#endif // BUILD_REMOTE_PLUGIN_CLIENT + + +namespace lmms +{ + #ifdef SYNC_WITH_SHM_FIFO @@ -669,4 +674,6 @@ class LMMS_EXPORT RemotePluginBase } ; +} // namespace lmms + #endif // REMOTE_PLUGIN_BASE_H diff --git a/include/SharedMemory.h b/include/SharedMemory.h index bc649110bb7..32a40ff2590 100644 --- a/include/SharedMemory.h +++ b/include/SharedMemory.h @@ -28,7 +28,12 @@ #include #include -namespace detail { + +namespace lmms +{ + +namespace detail +{ class SharedMemoryImpl; @@ -67,6 +72,7 @@ class SharedMemoryData } // namespace detail + template class SharedMemory { @@ -140,4 +146,6 @@ class SharedMemory detail::SharedMemoryData m_data; }; +} // namespace lmms + #endif // SHARED_MEMORY_H diff --git a/include/denormals.h b/include/denormals.h index 2b5b2d1c57d..e99e767a39c 100644 --- a/include/denormals.h +++ b/include/denormals.h @@ -9,14 +9,19 @@ #ifdef __GNUC__ #include #endif // __GNUC__ +#endif // __SSE__ + namespace lmms { +#ifdef __SSE__ + // Intel® 64 and IA-32 Architectures Software Developer’s Manual, // Volume 1: Basic Architecture, // 11.6.3 Checking for the DAZ Flag in the MXCSR Register -int inline can_we_daz() { +int inline can_we_daz() +{ alignas(16) unsigned char buffer[512] = {0}; #if defined(LMMS_HOST_X86) _fxsave(buffer); @@ -28,15 +33,11 @@ int inline can_we_daz() { return ((buffer[28] & (1 << 6)) != 0); } -} // namespace lmms #endif // __SSE__ -namespace lmms -{ - - // Set denormal protection for this thread. -void inline disable_denormals() { +void inline disable_denormals() +{ #ifdef __SSE__ /* Setting DAZ might freeze systems not supporting it */ if (can_we_daz()) { @@ -44,10 +45,9 @@ void inline disable_denormals() { } /* FTZ flag */ _MM_SET_FLUSH_ZERO_MODE( _MM_FLUSH_ZERO_ON ); -#endif +#endif // __SSE__ } - } // namespace lmms #endif // DENORMALS_H diff --git a/src/common/RemotePluginBase.cpp b/src/common/RemotePluginBase.cpp index 9dc2ebec5eb..10775ed5e59 100644 --- a/src/common/RemotePluginBase.cpp +++ b/src/common/RemotePluginBase.cpp @@ -29,6 +29,10 @@ #endif +namespace lmms +{ + + #ifdef SYNC_WITH_SHM_FIFO RemotePluginBase::RemotePluginBase( shmFifo * _in, shmFifo * _out ) : m_in( _in ), @@ -186,3 +190,5 @@ RemotePluginBase::message RemotePluginBase::waitForMessage( return message(); } + +} // namespace lmms diff --git a/src/common/SharedMemory.cpp b/src/common/SharedMemory.cpp index 3c546ac32e8..5c944dfab64 100644 --- a/src/common/SharedMemory.cpp +++ b/src/common/SharedMemory.cpp @@ -44,10 +44,12 @@ # include #endif -namespace detail { + +namespace lmms::detail { #if _POSIX_SHARED_MEMORY_OBJECTS > 0 + namespace { template @@ -198,4 +200,4 @@ SharedMemoryData::SharedMemoryData(SharedMemoryData&& other) noexcept : m_ptr{other.m_ptr} { } -} // namespace detail +} // namespace lmms::detail From e1d122c7bfc88c38b326cbf4ef0a86d3c31328cd Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 11 Jun 2022 14:11:39 +0200 Subject: [PATCH 084/118] Add missing gui:: prefixes in VstPlugin.cpp --- plugins/VstBase/VstPlugin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index b307124b332..d4576b019af 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -124,7 +124,7 @@ enum class ExecutableType VstPlugin::VstPlugin( const QString & _plugin ) : m_plugin( PathUtil::toAbsolute(_plugin) ), m_pluginWindowID( 0 ), - m_embedMethod( (getGUI() != nullptr) + m_embedMethod( (gui::getGUI() != nullptr) ? ConfigManager::inst()->vstEmbedMethod() : "headless" ), m_version( 0 ), @@ -422,7 +422,7 @@ bool VstPlugin::processMessage( const message & _m ) #ifdef LMMS_BUILD_LINUX XSetTransientForHint( QX11Info::display(), m_pluginWindowID, - getGUI()->mainWindow()->winId() ); + gui::getGUI()->mainWindow()->winId() ); #endif } break; From 4fb9f89409121266d37c93084a4bd5ae8fa6477f Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 11 Jun 2022 14:13:20 +0200 Subject: [PATCH 085/118] Add missing gui:: prefixes in VstEffect and Vestige --- plugins/Vestige/Vestige.cpp | 4 ++-- plugins/VstEffect/VstEffect.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index a627a10ae08..9088321cc2d 100644 --- a/plugins/Vestige/Vestige.cpp +++ b/plugins/Vestige/Vestige.cpp @@ -132,7 +132,7 @@ class VstInstrumentPlugin : public VstPlugin return; } if ( embedMethod() != "none" ) { - m_pluginSubWindow.reset(new gui::vstSubWin( getGUI()->mainWindow()->workspace() )); + m_pluginSubWindow.reset(new gui::vstSubWin( gui::getGUI()->mainWindow()->workspace() )); VstPlugin::createUI( m_pluginSubWindow.get() ); m_pluginSubWindow->setWidget(pluginWidget()); } else { @@ -356,7 +356,7 @@ void VestigeInstrument::loadFile( const QString & _file ) } m_pluginDLL = PathUtil::toShortestRelative( _file ); gui::TextFloat * tf = nullptr; - if( getGUI() != nullptr ) + if( gui::getGUI() != nullptr ) { tf = gui::TextFloat::displayMessage( tr( "Loading plugin" ), diff --git a/plugins/VstEffect/VstEffect.cpp b/plugins/VstEffect/VstEffect.cpp index dcef04f9c33..4fd66dbb506 100644 --- a/plugins/VstEffect/VstEffect.cpp +++ b/plugins/VstEffect/VstEffect.cpp @@ -131,7 +131,7 @@ bool VstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) void VstEffect::openPlugin( const QString & _plugin ) { gui::TextFloat* tf = nullptr; - if( getGUI() != nullptr ) + if( gui::getGUI() != nullptr ) { tf = gui::TextFloat::displayMessage( VstPlugin::tr( "Loading plugin" ), From 1f82399f9011003bd027969afd05d8854a5564fa Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 11 Jun 2022 14:58:57 +0200 Subject: [PATCH 086/118] Delete leftover directories carlabase and zynaddsubfx --- plugins/carlabase/carla | 1 - plugins/zynaddsubfx/zynaddsubfx | 1 - 2 files changed, 2 deletions(-) delete mode 160000 plugins/carlabase/carla delete mode 160000 plugins/zynaddsubfx/zynaddsubfx diff --git a/plugins/carlabase/carla b/plugins/carlabase/carla deleted file mode 160000 index 4ac8ff2ef41..00000000000 --- a/plugins/carlabase/carla +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4ac8ff2ef412d4ab190d2e285e318b1f339af4ae diff --git a/plugins/zynaddsubfx/zynaddsubfx b/plugins/zynaddsubfx/zynaddsubfx deleted file mode 160000 index abf6ab10fe6..00000000000 --- a/plugins/zynaddsubfx/zynaddsubfx +++ /dev/null @@ -1 +0,0 @@ -Subproject commit abf6ab10fe61c5e60220ed3ce14e139133c27bb4 From a2fad5560c37b804b57d9d7454c253055cfd4807 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 11 Jun 2022 15:00:49 +0200 Subject: [PATCH 087/118] Delete Tooltip.cpp --- src/gui/widgets/ToolTip.cpp | 43 ------------------------------------- 1 file changed, 43 deletions(-) delete mode 100644 src/gui/widgets/ToolTip.cpp diff --git a/src/gui/widgets/ToolTip.cpp b/src/gui/widgets/ToolTip.cpp deleted file mode 100644 index 335e92cf691..00000000000 --- a/src/gui/widgets/ToolTip.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - * ToolTip.cpp - namespace toolTip, a tooltip-wrapper for LMMS - * - * Copyright (c) 2005-2006 Tobias Doerffel - * - * This file is part of LMMS - https://lmms.io - * - * 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. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public - * License along with this program (see COPYING); if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - */ - - -#include - -#include "ToolTip.h" -#include "ConfigManager.h" - -namespace lmms::gui -{ - -void ToolTip::add( QWidget * _w, const QString & _txt ) -{ - if( !ConfigManager::inst()->value( "tooltips", "disabled" ).toInt() ) - { - _w->setToolTip( _txt ); - } -} - - -} // namespace lmms::gui \ No newline at end of file From a6d1c67268bfd12c0f06b65a40c5d7eb2ad8e965 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 12 Jun 2022 13:58:49 +0200 Subject: [PATCH 088/118] Update include/DspEffectLibrary.h Nasty little typoes. Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> --- include/DspEffectLibrary.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/DspEffectLibrary.h b/include/DspEffectLibrary.h index 1e10de2ebe7..df758811611 100644 --- a/include/DspEffectLibrary.h +++ b/include/DspEffectLibrary.h @@ -329,7 +329,7 @@ namespace lmms::DspEffectLibrary } ; -} // namespace lmms::DspEffectLibaray +} // namespace lmms::DspEffectLibrary #endif From 92991a88550c09d0386c429ee98291467eca64cc Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 12 Jun 2022 13:59:18 +0200 Subject: [PATCH 089/118] Update include/EffectSelectDialog.h Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> --- include/EffectSelectDialog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/EffectSelectDialog.h b/include/EffectSelectDialog.h index e5da516154b..bf1b6ba04a7 100644 --- a/include/EffectSelectDialog.h +++ b/include/EffectSelectDialog.h @@ -68,7 +68,7 @@ protected slots: } ; -} // namespace lmms +} // namespace lmms::gui #endif From 6562668e3bea55b43ab0f06a5c72e5dea24bb453 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 12 Jun 2022 13:59:51 +0200 Subject: [PATCH 090/118] Update plugins/Bitcrush/BitcrushControlDialog.cpp Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> --- plugins/Bitcrush/BitcrushControlDialog.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Bitcrush/BitcrushControlDialog.cpp b/plugins/Bitcrush/BitcrushControlDialog.cpp index fcb3620ca0d..ddf41508adb 100755 --- a/plugins/Bitcrush/BitcrushControlDialog.cpp +++ b/plugins/Bitcrush/BitcrushControlDialog.cpp @@ -116,4 +116,4 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) : } -} // namespace lmms \ No newline at end of file +} // namespace lmms::gui \ No newline at end of file From 806bc61bc8a661816cbe6a15c5f2117d3e7b387a Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 12 Jun 2022 15:42:07 +0200 Subject: [PATCH 091/118] Expect LMMS class names in stylesheets to be prefixed with lmms--gui, and compare only the unscoped name against the reference name. --- tests/check-strings/check-strings | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/check-strings/check-strings b/tests/check-strings/check-strings index d5b0260db99..5504cc588d9 100755 --- a/tests/check-strings/check-strings +++ b/tests/check-strings/check-strings @@ -91,6 +91,21 @@ for c in sorted(classes_found): caption('themes') + +GUI_NAMESPACE_PREFIX = "lmms--gui" + + +def unscope_classname(stylesheet, cname): + # Strip the namespace part from the given class name, + # while expecting it to have one in the first place. + SCOPE_TOKEN = "--" + i = cname.rfind(SCOPE_TOKEN) + len(SCOPE_TOKEN) + + assert i>=0 + + return cname[i:] + + for theme in sorted([d for d in Path('data/themes').iterdir() if d.is_dir()]): classes_in_sheet = set() stylesheet = theme / 'style.css' @@ -101,7 +116,10 @@ for theme in sorted([d for d in Path('data/themes').iterdir() if d.is_dir()]): for c in rule.prelude: if c.type == 'ident' and not class_found: if is_our_class(c.value): - classes_in_sheet.add(c.value) + if str(c.value).startswith(GUI_NAMESPACE_PREFIX): + classes_in_sheet.add(unscope_classname(stylesheet, c.value)) + else: + error(str(stylesheet), f"Namespace prefix missing from class {c.value}") class_found = True # After whitespace or comma comes a new class elif c.type == 'whitespace' or (c.type == 'literal' and c.value == ','): From c1aafba80d1060324b3119a4512da3f5ccd39063 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 12 Jun 2022 15:54:25 +0200 Subject: [PATCH 092/118] Rename LmmsCore to Engine in translation files. --- data/locale/ar.ts | 2 +- data/locale/bs.ts | 2 +- data/locale/ca.ts | 2 +- data/locale/cs.ts | 2 +- data/locale/de.ts | 2 +- data/locale/el.ts | 2 +- data/locale/en.ts | 2 +- data/locale/eo.ts | 2 +- data/locale/es.ts | 2 +- data/locale/eu.ts | 2 +- data/locale/fa.ts | 2 +- data/locale/fr.ts | 2 +- data/locale/gl.ts | 2 +- data/locale/he.ts | 2 +- data/locale/hi_IN.ts | 2 +- data/locale/hu_HU.ts | 2 +- data/locale/id.ts | 2 +- data/locale/it.ts | 2 +- data/locale/ja.ts | 2 +- data/locale/ka.ts | 2 +- data/locale/ko.ts | 2 +- data/locale/ms_MY.ts | 2 +- data/locale/nb.ts | 2 +- data/locale/nl.ts | 2 +- data/locale/oc.ts | 2 +- data/locale/pl.ts | 2 +- data/locale/pt.ts | 2 +- data/locale/ro.ts | 2 +- data/locale/ru.ts | 2 +- data/locale/sl.ts | 2 +- data/locale/sr.ts | 2 +- data/locale/sv.ts | 2 +- data/locale/tr.ts | 2 +- data/locale/uk.ts | 2 +- data/locale/zh_CN.ts | 2 +- data/locale/zh_TW.ts | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/data/locale/ar.ts b/data/locale/ar.ts index 8e989509dab..1f159c42a2a 100644 --- a/data/locale/ar.ts +++ b/data/locale/ar.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/bs.ts b/data/locale/bs.ts index 013585b5fac..506b401bd61 100644 --- a/data/locale/bs.ts +++ b/data/locale/bs.ts @@ -4416,7 +4416,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ca.ts b/data/locale/ca.ts index 3512b48716d..765cf3b6081 100644 --- a/data/locale/ca.ts +++ b/data/locale/ca.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/cs.ts b/data/locale/cs.ts index 7951c75b9a6..0ed175022be 100644 --- a/data/locale/cs.ts +++ b/data/locale/cs.ts @@ -7157,7 +7157,7 @@ Poklepejte pro výběr souboru. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/de.ts b/data/locale/de.ts index ef4d946341b..51ca7d56204 100644 --- a/data/locale/de.ts +++ b/data/locale/de.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/el.ts b/data/locale/el.ts index b543854d399..320a6657f61 100644 --- a/data/locale/el.ts +++ b/data/locale/el.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/en.ts b/data/locale/en.ts index b58d27f3093..e52ae39ab7e 100644 --- a/data/locale/en.ts +++ b/data/locale/en.ts @@ -7157,7 +7157,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/eo.ts b/data/locale/eo.ts index b133d802952..005ee8100bf 100644 --- a/data/locale/eo.ts +++ b/data/locale/eo.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/es.ts b/data/locale/es.ts index 8fb16442157..4fc4951ef92 100644 --- a/data/locale/es.ts +++ b/data/locale/es.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/eu.ts b/data/locale/eu.ts index 9642a3ff269..25c165f81f8 100644 --- a/data/locale/eu.ts +++ b/data/locale/eu.ts @@ -7436,7 +7436,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/fa.ts b/data/locale/fa.ts index 4e72345fd8b..181ca0ca1ff 100644 --- a/data/locale/fa.ts +++ b/data/locale/fa.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/fr.ts b/data/locale/fr.ts index 85f4433094c..2c65444a8e0 100644 --- a/data/locale/fr.ts +++ b/data/locale/fr.ts @@ -7448,7 +7448,7 @@ Double-cliquez pour choisir un fichier. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/gl.ts b/data/locale/gl.ts index 38a80a5da97..cf04fd5d428 100644 --- a/data/locale/gl.ts +++ b/data/locale/gl.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/he.ts b/data/locale/he.ts index 783b473b7e0..ee5a23613b2 100644 --- a/data/locale/he.ts +++ b/data/locale/he.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/hi_IN.ts b/data/locale/hi_IN.ts index 5ba65acd64f..15550231f85 100644 --- a/data/locale/hi_IN.ts +++ b/data/locale/hi_IN.ts @@ -7157,7 +7157,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/hu_HU.ts b/data/locale/hu_HU.ts index f82ff12c496..83605994674 100644 --- a/data/locale/hu_HU.ts +++ b/data/locale/hu_HU.ts @@ -7162,7 +7162,7 @@ Kattints duplán egy fájl kiválasztásához. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/id.ts b/data/locale/id.ts index b55f6c98c2b..e381ea726d8 100644 --- a/data/locale/id.ts +++ b/data/locale/id.ts @@ -7160,7 +7160,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/it.ts b/data/locale/it.ts index 29865352a15..ff146d47120 100644 --- a/data/locale/it.ts +++ b/data/locale/it.ts @@ -7169,7 +7169,7 @@ Fai doppio click per scegliere un file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ja.ts b/data/locale/ja.ts index 28fda3123f8..e10ca511818 100644 --- a/data/locale/ja.ts +++ b/data/locale/ja.ts @@ -7157,7 +7157,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ka.ts b/data/locale/ka.ts index b48b3f2b07d..1956d8d04e5 100644 --- a/data/locale/ka.ts +++ b/data/locale/ka.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ko.ts b/data/locale/ko.ts index 78cfbdd5c2f..7373b5ca9a7 100644 --- a/data/locale/ko.ts +++ b/data/locale/ko.ts @@ -7160,7 +7160,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ms_MY.ts b/data/locale/ms_MY.ts index 533efdcad66..209d51d108c 100644 --- a/data/locale/ms_MY.ts +++ b/data/locale/ms_MY.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/nb.ts b/data/locale/nb.ts index 41865ef0c73..3675b7f589c 100644 --- a/data/locale/nb.ts +++ b/data/locale/nb.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/nl.ts b/data/locale/nl.ts index 2eaa6b15431..ad630a249c9 100644 --- a/data/locale/nl.ts +++ b/data/locale/nl.ts @@ -7158,7 +7158,7 @@ Dubbelklikken om een bestand te kiezen. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/oc.ts b/data/locale/oc.ts index 8df1aa1a117..58c81c96453 100644 --- a/data/locale/oc.ts +++ b/data/locale/oc.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/pl.ts b/data/locale/pl.ts index 340be33d81a..bb0c64edec0 100644 --- a/data/locale/pl.ts +++ b/data/locale/pl.ts @@ -7441,7 +7441,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/pt.ts b/data/locale/pt.ts index f94f22920e6..b375e289f38 100644 --- a/data/locale/pt.ts +++ b/data/locale/pt.ts @@ -7158,7 +7158,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ro.ts b/data/locale/ro.ts index ca148f452b5..eceb45a6485 100644 --- a/data/locale/ro.ts +++ b/data/locale/ro.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ru.ts b/data/locale/ru.ts index 40e385d2c3f..8235f291f34 100644 --- a/data/locale/ru.ts +++ b/data/locale/ru.ts @@ -7178,7 +7178,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/sl.ts b/data/locale/sl.ts index dd96809765d..3ad55a4c044 100644 --- a/data/locale/sl.ts +++ b/data/locale/sl.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/sr.ts b/data/locale/sr.ts index a8c1fd96dc1..9b90164ab3b 100644 --- a/data/locale/sr.ts +++ b/data/locale/sr.ts @@ -3550,7 +3550,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/sv.ts b/data/locale/sv.ts index 882524c50a8..4963b07a9ad 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -7447,7 +7447,7 @@ Dubbelklicka för att välja en fil. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/tr.ts b/data/locale/tr.ts index fa4ccb696cd..387be6d8b96 100644 --- a/data/locale/tr.ts +++ b/data/locale/tr.ts @@ -7449,7 +7449,7 @@ Bir dosya seçmek için çift tıklayın. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/uk.ts b/data/locale/uk.ts index 84cc8189910..50df10e4b72 100644 --- a/data/locale/uk.ts +++ b/data/locale/uk.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/zh_CN.ts b/data/locale/zh_CN.ts index 301d54362f0..63b22df9902 100644 --- a/data/locale/zh_CN.ts +++ b/data/locale/zh_CN.ts @@ -7166,7 +7166,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/zh_TW.ts b/data/locale/zh_TW.ts index a190c831cda..791a45599f9 100644 --- a/data/locale/zh_TW.ts +++ b/data/locale/zh_TW.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables From 0aa4cbdedcaac8154086ab63bebe53ebe7e83e16 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 12:36:45 +0200 Subject: [PATCH 093/118] Typo in MidiJack.h Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> --- include/MidiJack.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/MidiJack.h b/include/MidiJack.h index dc0096d62c0..16d09d431e3 100644 --- a/include/MidiJack.h +++ b/include/MidiJack.h @@ -98,7 +98,7 @@ class MidiJack : public QThread, public MidiClientRaw }; -} // namesapce lmms +} // namespace lmms #endif // LMMS_HAVE_JACK From 33c8dca5af76258a68bd355d828be8aa826d4c28 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 12:36:54 +0200 Subject: [PATCH 094/118] LinkedModelGroups: Predeclaration instead of header include for QDomDocument. --- include/LinkedModelGroups.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/LinkedModelGroups.h b/include/LinkedModelGroups.h index c9a6531950e..57bc94dd2b7 100644 --- a/include/LinkedModelGroups.h +++ b/include/LinkedModelGroups.h @@ -28,12 +28,13 @@ #include -#include #include #include "Model.h" +class QDomDocument; + namespace lmms { From f519e87ed90e271bf121be7532887e99438fdc62 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 12:39:30 +0200 Subject: [PATCH 095/118] LinkedModelGroups: Predeclaration for QDomElement; include moved to .cpp file. --- include/LinkedModelGroups.h | 3 +-- src/core/LinkedModelGroups.cpp | 3 +++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/LinkedModelGroups.h b/include/LinkedModelGroups.h index 57bc94dd2b7..802ac8080cf 100644 --- a/include/LinkedModelGroups.h +++ b/include/LinkedModelGroups.h @@ -28,12 +28,11 @@ #include -#include - #include "Model.h" class QDomDocument; +class QDomElement; namespace lmms { diff --git a/src/core/LinkedModelGroups.cpp b/src/core/LinkedModelGroups.cpp index 0cbaedb33b4..4fdf54fc0c2 100644 --- a/src/core/LinkedModelGroups.cpp +++ b/src/core/LinkedModelGroups.cpp @@ -22,6 +22,9 @@ * */ +#include +#include + #include "LinkedModelGroups.h" From 6057d328b8c906847d8b3607ae0ca28bd6dda919 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 12:44:04 +0200 Subject: [PATCH 096/118] Update include/FileDialog.h Outdated include guard end comment Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> --- include/FileDialog.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/FileDialog.h b/include/FileDialog.h index 01f3668e35d..ed5d2f231bb 100644 --- a/include/FileDialog.h +++ b/include/FileDialog.h @@ -57,4 +57,4 @@ class LMMS_EXPORT FileDialog : public QFileDialog } // namespace lmms::gui -#endif // FILEDIALOG_HPP +#endif // FILEDIALOG_H From 818dd2dbcd8df89abfd990892a12677d612eadc2 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 12:44:33 +0200 Subject: [PATCH 097/118] Update include/PluginIssue.h Remove potentially confusing parentheses around function name. Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> --- include/PluginIssue.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/PluginIssue.h b/include/PluginIssue.h index 3cc01623384..f0fa275f378 100644 --- a/include/PluginIssue.h +++ b/include/PluginIssue.h @@ -78,7 +78,7 @@ class PluginIssue PluginIssueType type() const { return m_issueType; } bool operator==(const PluginIssue& other) const; bool operator<(const PluginIssue& other) const; - friend QDebug (operator<<)(QDebug stream, const PluginIssue& iss); + friend QDebug operator<<(QDebug stream, const PluginIssue& iss); }; QDebug operator<<(QDebug stream, const PluginIssue& iss); From e3b00c452f2bfd3c3b89dccb4f630466603b6b08 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 12:52:19 +0200 Subject: [PATCH 098/118] Remove unused #includes from SampleClip.h and Controls.cpp --- include/SampleClip.h | 2 -- src/gui/Controls.cpp | 1 - 2 files changed, 3 deletions(-) diff --git a/include/SampleClip.h b/include/SampleClip.h index c94978d6985..8344885336e 100644 --- a/include/SampleClip.h +++ b/include/SampleClip.h @@ -26,8 +26,6 @@ #define SAMPLE_CLIP_H #include "Clip.h" -#include "SampleBuffer.h" -#include "SampleTrack.h" namespace lmms { diff --git a/src/gui/Controls.cpp b/src/gui/Controls.cpp index baeb101a96d..fa28c695f87 100644 --- a/src/gui/Controls.cpp +++ b/src/gui/Controls.cpp @@ -32,7 +32,6 @@ #include "LcdSpinBox.h" #include "LedCheckBox.h" #include "Knob.h" -#include "AutomatableModelView.h" namespace lmms::gui From e6612d78e15974801011c545c5d9b76b5c31c923 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 12:53:43 +0200 Subject: [PATCH 099/118] Rename include guard in MixerLine.h to MIXERLINE_H --- include/MixerLine.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/MixerLine.h b/include/MixerLine.h index 125570c6afb..12ac3df7530 100644 --- a/include/MixerLine.h +++ b/include/MixerLine.h @@ -23,8 +23,8 @@ * */ -#ifndef MIXER_LINE_H -#define MIXER_LINE_H +#ifndef MIXERLINE_H +#define MIXERLINE_H #include From 1b62fb679209a8360bc3a907a4fb9ebc3fe032bf Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 13:05:14 +0200 Subject: [PATCH 100/118] Define UI class after core class in Lv2Instrument.h; core needs to only see the declaration. --- plugins/Lv2Instrument/Lv2Instrument.h | 44 +++++++++++++++------------ 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/plugins/Lv2Instrument/Lv2Instrument.h b/plugins/Lv2Instrument/Lv2Instrument.h index bd450fa17a2..116b3ce0535 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.h +++ b/plugins/Lv2Instrument/Lv2Instrument.h @@ -40,30 +40,12 @@ namespace lmms { -class Lv2Instrument; - namespace gui { +class Lv2InsView; -class Lv2InsView : public InstrumentView, public Lv2ViewBase -{ -Q_OBJECT -public: - Lv2InsView(Lv2Instrument *_instrument, QWidget *_parent); - -protected: - void dragEnterEvent(QDragEnterEvent *_dee) override; - void dropEvent(QDropEvent *_de) override; - -private: - void modelChanged() override; -}; - - -} // namespace gui - - +} class Lv2Instrument : public Instrument, public Lv2ControlBase { @@ -126,6 +108,28 @@ private slots: }; +namespace gui +{ + + +class Lv2InsView : public InstrumentView, public Lv2ViewBase +{ +Q_OBJECT +public: + Lv2InsView(Lv2Instrument *_instrument, QWidget *_parent); + +protected: + void dragEnterEvent(QDragEnterEvent *_dee) override; + void dropEvent(QDropEvent *_de) override; + +private: + void modelChanged() override; +}; + + +} // namespace gui + + } // namespace lmms #endif // LV2_INSTRUMENT_H From 8bb8d994bdd05d68b7733d1e24c0bcaeed104736 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 13:10:00 +0200 Subject: [PATCH 101/118] Rename static variable BufferManager::framesPerPeriod according to convention. --- include/BufferManager.h | 2 +- src/core/BufferManager.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/BufferManager.h b/include/BufferManager.h index 886316b57fd..57729918ec6 100644 --- a/include/BufferManager.h +++ b/include/BufferManager.h @@ -48,7 +48,7 @@ class LMMS_EXPORT BufferManager static void release( sampleFrame * buf ); private: - static fpp_t framesPerPeriod; + static fpp_t s_framesPerPeriod; }; diff --git a/src/core/BufferManager.cpp b/src/core/BufferManager.cpp index f35ace6575a..ff35e6a194e 100644 --- a/src/core/BufferManager.cpp +++ b/src/core/BufferManager.cpp @@ -33,17 +33,17 @@ namespace lmms { -fpp_t BufferManager::framesPerPeriod; +fpp_t BufferManager::s_framesPerPeriod; void BufferManager::init( fpp_t fpp ) { - BufferManager::framesPerPeriod = fpp; + s_framesPerPeriod = fpp; } sampleFrame * BufferManager::acquire() { - return MM_ALLOC( BufferManager::framesPerPeriod ); + return MM_ALLOC( s_framesPerPeriod ); } void BufferManager::clear( sampleFrame *ab, const f_cnt_t frames, const f_cnt_t offset ) From 6f079b23d0535e604d162aa51eb4fa54a2073cf6 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 14:09:46 +0200 Subject: [PATCH 102/118] clazy: Fully qualify signal/slot argument and return types. --- include/AudioEngine.h | 2 +- include/AutomatableModel.h | 2 +- include/AutomationClip.h | 2 +- include/AutomationEditor.h | 4 ++-- include/ControllerRackView.h | 6 +++--- include/ControllerView.h | 2 +- include/EffectRackView.h | 6 +++--- include/EffectView.h | 6 +++--- include/FileBrowser.h | 8 ++++---- include/LinkedModelGroups.h | 4 ++-- include/MidiAlsaSeq.h | 2 +- include/MidiClip.h | 2 +- include/MidiClipView.h | 2 +- include/Oscilloscope.h | 2 +- include/PianoRoll.h | 16 ++++++++-------- include/SampleClip.h | 2 +- include/Song.h | 8 ++++---- include/SongEditor.h | 4 ++-- include/StepRecorderWidget.h | 2 +- include/TempoSyncKnobModel.h | 4 ++-- include/TimeLineWidget.h | 4 ++-- include/Track.h | 2 +- include/TrackContainer.h | 2 +- include/TrackContainerView.h | 6 +++--- include/TrackContentWidget.h | 2 +- include/TrackOperationsWidget.h | 2 +- include/TrackView.h | 2 +- plugins/LadspaBrowser/LadspaBrowser.h | 2 +- plugins/LadspaBrowser/LadspaDescription.h | 2 +- plugins/LadspaEffect/LadspaControlDialog.h | 2 +- plugins/LadspaEffect/LadspaControls.h | 2 +- plugins/Vestige/Vestige.h | 4 ++-- plugins/VstBase/VstPlugin.h | 2 +- plugins/VstEffect/VstEffectControls.h | 4 ++-- 34 files changed, 62 insertions(+), 62 deletions(-) diff --git a/include/AudioEngine.h b/include/AudioEngine.h index e2833470e41..034988c2968 100644 --- a/include/AudioEngine.h +++ b/include/AudioEngine.h @@ -316,7 +316,7 @@ class LMMS_EXPORT AudioEngine : public QObject signals: void qualitySettingsChanged(); void sampleRateChanged(); - void nextAudioBuffer( const surroundSampleFrame * buffer ); + void nextAudioBuffer( const lmms::surroundSampleFrame * buffer ); private: diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 055b18445fd..672abaf818e 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -420,7 +420,7 @@ public slots: signals: void initValueChanged( float val ); - void destroyed( jo_id_t id ); + void destroyed( lmms::jo_id_t id ); } ; diff --git a/include/AutomationClip.h b/include/AutomationClip.h index 2d6537fdcb5..376c1e9e79a 100644 --- a/include/AutomationClip.h +++ b/include/AutomationClip.h @@ -176,7 +176,7 @@ class LMMS_EXPORT AutomationClip : public Clip public slots: void clear(); - void objectDestroyed( jo_id_t ); + void objectDestroyed( lmms::jo_id_t ); void flipY( int min, int max ); void flipY(); void flipX( int length = -1 ); diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index 2e05caa862f..d9d1b0a10be 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -135,7 +135,7 @@ protected slots: void setProgressionType(int type); void setTension(); - void updatePosition( const TimePos & t ); + void updatePosition( const lmms::TimePos & t ); void zoomingXChanged(); void zoomingYChanged(); @@ -241,7 +241,7 @@ protected slots: signals: void currentClipChanged(); - void positionChanged( const TimePos & ); + void positionChanged( const lmms::TimePos & ); } ; diff --git a/include/ControllerRackView.h b/include/ControllerRackView.h index 6c6c8f958c7..6d60562f615 100644 --- a/include/ControllerRackView.h +++ b/include/ControllerRackView.h @@ -65,9 +65,9 @@ class ControllerRackView : public QWidget, public SerializingObject public slots: - void deleteController( ControllerView * _view ); - void onControllerAdded( Controller * ); - void onControllerRemoved( Controller * ); + void deleteController( lmms::gui::ControllerView * _view ); + void onControllerAdded( lmms::Controller * ); + void onControllerRemoved( lmms::Controller * ); protected: void closeEvent( QCloseEvent * _ce ) override; diff --git a/include/ControllerView.h b/include/ControllerView.h index 3e11ee66deb..2e18e13205e 100644 --- a/include/ControllerView.h +++ b/include/ControllerView.h @@ -68,7 +68,7 @@ public slots: void renameController(); signals: - void deleteController( ControllerView * _view ); + void deleteController( lmms::gui::ControllerView * _view ); protected: diff --git a/include/EffectRackView.h b/include/EffectRackView.h index fb38c4fb90b..014a07dfe2f 100644 --- a/include/EffectRackView.h +++ b/include/EffectRackView.h @@ -53,9 +53,9 @@ class EffectRackView : public QWidget, public ModelView public slots: void clearViews(); - void moveUp( EffectView* view ); - void moveDown( EffectView* view ); - void deletePlugin( EffectView* view ); + void moveUp( lmms::gui::EffectView* view ); + void moveDown( lmms::gui::EffectView* view ); + void deletePlugin( lmms::gui::EffectView* view ); private slots: diff --git a/include/EffectView.h b/include/EffectView.h index f99cba48c20..9f30575e9a8 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -71,9 +71,9 @@ public slots: signals: - void moveUp( EffectView * _plugin ); - void moveDown( EffectView * _plugin ); - void deletePlugin( EffectView * _plugin ); + void moveUp( lmms::gui::EffectView * _plugin ); + void moveDown( lmms::gui::EffectView * _plugin ); + void deletePlugin( lmms::gui::EffectView * _plugin ); protected: diff --git a/include/FileBrowser.h b/include/FileBrowser.h index ad37debee43..eb50dd1bb39 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -147,11 +147,11 @@ class FileBrowserTreeWidget : public QTreeWidget private slots: void activateListItem( QTreeWidgetItem * item, int column ); - void openInNewInstrumentTrack( FileItem* item, bool songEditor ); - bool openInNewSampleTrack( FileItem* item ); - void sendToActiveInstrumentTrack( FileItem* item ); + void openInNewInstrumentTrack( lmms::gui::FileItem* item, bool songEditor ); + bool openInNewSampleTrack( lmms::gui::FileItem* item ); + void sendToActiveInstrumentTrack( lmms::gui::FileItem* item ); void updateDirectory( QTreeWidgetItem * item ); - void openContainingFolder( FileItem* item ); + void openContainingFolder( lmms::gui::FileItem* item ); } ; diff --git a/include/LinkedModelGroups.h b/include/LinkedModelGroups.h index 802ac8080cf..9fa0fefa6de 100644 --- a/include/LinkedModelGroups.h +++ b/include/LinkedModelGroups.h @@ -113,8 +113,8 @@ class LinkedModelGroup : public Model // (who would kno if the client is Qt, i.e. it may not have slots at all) // In this case you'd e.g. send the UI something like // "/added " - void modelAdded(AutomatableModel* added); - void modelRemoved(AutomatableModel* removed); + void modelAdded(lmms::AutomatableModel* added); + void modelRemoved(lmms::AutomatableModel* removed); public: AutomatableModel* getModel(const std::string& s) diff --git a/include/MidiAlsaSeq.h b/include/MidiAlsaSeq.h index a36c3a201d6..8a2d3a0987e 100644 --- a/include/MidiAlsaSeq.h +++ b/include/MidiAlsaSeq.h @@ -117,7 +117,7 @@ class MidiAlsaSeq : public QThread, public MidiClient private slots: - void changeQueueTempo( bpm_t _bpm ); + void changeQueueTempo( lmms::bpm_t _bpm ); void updatePortList(); diff --git a/include/MidiClip.h b/include/MidiClip.h index 04c10e6ef89..173ca569955 100644 --- a/include/MidiClip.h +++ b/include/MidiClip.h @@ -149,7 +149,7 @@ protected slots: signals: - void destroyedMidiClip( MidiClip* ); + void destroyedMidiClip( lmms::MidiClip* ); } ; diff --git a/include/MidiClipView.h b/include/MidiClipView.h index 7534e7703df..c9f1c3e1e95 100644 --- a/include/MidiClipView.h +++ b/include/MidiClipView.h @@ -63,7 +63,7 @@ class MidiClipView : public ClipView void setMutedNoteBorderColor(QColor const & color) { m_mutedNoteBorderColor = color; } public slots: - MidiClip* getMidiClip(); + lmms::MidiClip* getMidiClip(); void update() override; diff --git a/include/Oscilloscope.h b/include/Oscilloscope.h index 7e9ee8f4106..4404fd98bb0 100644 --- a/include/Oscilloscope.h +++ b/include/Oscilloscope.h @@ -60,7 +60,7 @@ class Oscilloscope : public QWidget protected slots: - void updateAudioBuffer( const surroundSampleFrame * buffer ); + void updateAudioBuffer( const lmms::surroundSampleFrame * buffer ); private: QColor const & determineLineColor(float level) const; diff --git a/include/PianoRoll.h b/include/PianoRoll.h index d990e124b07..73a2e5b7693 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -196,8 +196,8 @@ protected slots: bool toggleStepRecording(); void stop(); - void startRecordNote( const Note & n ); - void finishRecordNote( const Note & n ); + void startRecordNote( const lmms::Note & n ); + void finishRecordNote( const lmms::Note & n ); void horScrolled( int new_pos ); void verScrolled( int new_pos ); @@ -209,23 +209,23 @@ protected slots: void pasteNotes(); bool deleteSelectedNotes(); - void updatePosition(const TimePos & t ); - void updatePositionAccompany(const TimePos & t ); - void updatePositionStepRecording(const TimePos & t ); + void updatePosition(const lmms::TimePos & t ); + void updatePositionAccompany(const lmms::TimePos & t ); + void updatePositionStepRecording(const lmms::TimePos & t ); void zoomingChanged(); void zoomingYChanged(); void quantizeChanged(); void noteLengthChanged(); void keyChanged(); - void quantizeNotes(QuantizeActions mode = QuantizeBoth); + void quantizeNotes(lmms::gui::PianoRoll::QuantizeActions mode = QuantizeBoth); void updateSemiToneMarkerMenu(); void changeNoteEditMode( int i ); void markSemiTone(int i, bool fromMenu = true); - void hideMidiClip( MidiClip* clip ); + void hideMidiClip( lmms::MidiClip* clip ); void selectRegionFromPixels( int xStart, int xEnd ); @@ -494,7 +494,7 @@ protected slots: QBrush m_blackKeyDisabledBackground; signals: - void positionChanged( const TimePos & ); + void positionChanged( const lmms::TimePos & ); } ; diff --git a/include/SampleClip.h b/include/SampleClip.h index 8344885336e..52a2d6209e4 100644 --- a/include/SampleClip.h +++ b/include/SampleClip.h @@ -76,7 +76,7 @@ class SampleClip : public Clip void setIsPlaying(bool isPlaying); public slots: - void setSampleBuffer( SampleBuffer* sb ); + void setSampleBuffer( lmms::SampleBuffer* sb ); void setSampleFile( const QString & _sf ); void updateLength(); void toggleRecord(); diff --git a/include/Song.h b/include/Song.h index 7e72698835c..cfe63a2ea41 100644 --- a/include/Song.h +++ b/include/Song.h @@ -371,7 +371,7 @@ public slots: void record(); void playAndRecord(); void playPattern(); - void playMidiClip( const MidiClip * midiClipToPlay, bool loop = true ); + void playMidiClip( const lmms::MidiClip * midiClipToPlay, bool loop = true ); void togglePause(); void stop(); @@ -511,10 +511,10 @@ private slots: void playbackStateChanged(); void playbackPositionChanged(); void lengthChanged( int bars ); - void tempoChanged( bpm_t newBPM ); + void tempoChanged( lmms::bpm_t newBPM ); void timeSignatureChanged( int oldTicksPerBar, int ticksPerBar ); - void controllerAdded( Controller * ); - void controllerRemoved( Controller * ); + void controllerAdded( lmms::Controller * ); + void controllerRemoved( lmms::Controller * ); void updateSampleTracks(); void stopped(); void modified(); diff --git a/include/SongEditor.h b/include/SongEditor.h index 554fb07a14f..29a9be0bfba 100644 --- a/include/SongEditor.h +++ b/include/SongEditor.h @@ -82,13 +82,13 @@ public slots: void stopSelectRegion(); void updateRubberband(); - void setEditMode( EditMode mode ); + void setEditMode( lmms::gui::SongEditor::EditMode mode ); void setEditModeDraw(); void setEditModeKnife(); void setEditModeSelect(); void toggleProportionalSnap(); - void updatePosition( const TimePos & t ); + void updatePosition( const lmms::TimePos & t ); void updatePositionLine(); void selectAllClips( bool select ); diff --git a/include/StepRecorderWidget.h b/include/StepRecorderWidget.h index 3107e0f600b..4067b00011c 100644 --- a/include/StepRecorderWidget.h +++ b/include/StepRecorderWidget.h @@ -90,7 +90,7 @@ class StepRecorderWidget : public QWidget const int m_marginRight; signals: - void positionChanged(const TimePos & t); + void positionChanged(const lmms::TimePos & t); } ; } // namespace lmms::gui diff --git a/include/TempoSyncKnobModel.h b/include/TempoSyncKnobModel.h index db4b8176345..1e6decfb9ad 100644 --- a/include/TempoSyncKnobModel.h +++ b/include/TempoSyncKnobModel.h @@ -83,7 +83,7 @@ class LMMS_EXPORT TempoSyncKnobModel : public FloatModel void setScale( float _new_scale ); signals: - void syncModeChanged( TempoSyncMode _new_mode ); + void syncModeChanged( lmms::TempoSyncKnobModel::TempoSyncMode _new_mode ); void scaleChanged( float _new_scale ); @@ -97,7 +97,7 @@ public slots: protected slots: - void calculateTempoSyncTime( bpm_t _bpm ); + void calculateTempoSyncTime( lmms::bpm_t _bpm ); void updateCustom(); diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index fa0ed8b1251..4cbddcda4b1 100644 --- a/include/TimeLineWidget.h +++ b/include/TimeLineWidget.h @@ -179,7 +179,7 @@ class TimeLineWidget : public QWidget, public JournallingObject public slots: - void updatePosition( const TimePos & ); + void updatePosition( const lmms::TimePos & ); void updatePosition() { updatePosition( TimePos() ); @@ -251,7 +251,7 @@ public slots: signals: - void positionChanged( const TimePos & _t ); + void positionChanged( const lmms::TimePos & _t ); void loopPointStateLoaded( int _n ); void positionMarkerMoved(); void loadBehaviourAtStop( int _n ); diff --git a/include/Track.h b/include/Track.h index 1b3e977c744..ec069c38f9c 100644 --- a/include/Track.h +++ b/include/Track.h @@ -250,7 +250,7 @@ public slots: signals: void destroyedTrack(); void nameChanged(); - void clipAdded( Clip * ); + void clipAdded( lmms::Clip * ); void colorChanged(); } ; diff --git a/include/TrackContainer.h b/include/TrackContainer.h index 07fa3493535..beb7564adb3 100644 --- a/include/TrackContainer.h +++ b/include/TrackContainer.h @@ -104,7 +104,7 @@ class LMMS_EXPORT TrackContainer : public Model, public JournallingObject virtual AutomatedValueMap automatedValuesAt(TimePos time, int clipNum = -1) const; signals: - void trackAdded( Track * _track ); + void trackAdded( lmms::Track * _track ); protected: static AutomatedValueMap automatedValuesFromTracks(const TrackList &tracks, TimePos timeStart, int clipNum = -1); diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index 604c3f3d217..edcffeb2fa0 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -153,8 +153,8 @@ class TrackContainerView : public QWidget, public ModelView, public slots: void realignTracks(); - TrackView * createTrackView( Track * _t ); - void deleteTrackView( TrackView * _tv ); + lmms::gui::TrackView * createTrackView( lmms::Track * _t ); + void deleteTrackView( lmms::gui::TrackView * _tv ); void dropEvent( QDropEvent * _de ) override; void dragEnterEvent( QDragEnterEvent * _dee ) override; @@ -209,7 +209,7 @@ public slots: signals: - void positionChanged( const TimePos & _pos ); + void positionChanged( const lmms::TimePos & _pos ); } ; diff --git a/include/TrackContentWidget.h b/include/TrackContentWidget.h index ec395999544..228a3e7395d 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -92,7 +92,7 @@ class TrackContentWidget : public QWidget, public JournallingObject public slots: void update(); - void changePosition( const TimePos & newPos = TimePos( -1 ) ); + void changePosition( const lmms::TimePos & newPos = TimePos( -1 ) ); protected: enum ContextMenuAction diff --git a/include/TrackOperationsWidget.h b/include/TrackOperationsWidget.h index 0eff551a31b..92f1a889cc5 100644 --- a/include/TrackOperationsWidget.h +++ b/include/TrackOperationsWidget.h @@ -73,7 +73,7 @@ private slots: friend class TrackView; signals: - void trackRemovalScheduled( TrackView * t ); + void trackRemovalScheduled( lmms::gui::TrackView * t ); } ; diff --git a/include/TrackView.h b/include/TrackView.h index c56046c8080..2f5c5ed2880 100644 --- a/include/TrackView.h +++ b/include/TrackView.h @@ -169,7 +169,7 @@ public slots: private slots: - void createClipView( Clip * clip ); + void createClipView( lmms::Clip * clip ); void muteChanged(); } ; diff --git a/plugins/LadspaBrowser/LadspaBrowser.h b/plugins/LadspaBrowser/LadspaBrowser.h index d32c65482ff..c421090376c 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.h +++ b/plugins/LadspaBrowser/LadspaBrowser.h @@ -50,7 +50,7 @@ class LadspaBrowserView : public ToolPluginView public slots: - void showPorts( const ladspa_key_t & _key ); + void showPorts( const lmms::ladspa_key_t & _key ); private: diff --git a/plugins/LadspaBrowser/LadspaDescription.h b/plugins/LadspaBrowser/LadspaDescription.h index c683ab9ee49..547f06bd5bb 100644 --- a/plugins/LadspaBrowser/LadspaDescription.h +++ b/plugins/LadspaBrowser/LadspaDescription.h @@ -48,7 +48,7 @@ class LadspaDescription : public QWidget signals: - void doubleClicked( const ladspa_key_t & ); + void doubleClicked( const lmms::ladspa_key_t & ); private: diff --git a/plugins/LadspaEffect/LadspaControlDialog.h b/plugins/LadspaEffect/LadspaControlDialog.h index f9726e90d35..3a102599b4e 100644 --- a/plugins/LadspaEffect/LadspaControlDialog.h +++ b/plugins/LadspaEffect/LadspaControlDialog.h @@ -54,7 +54,7 @@ class LadspaControlDialog : public EffectControlDialog private slots: - void updateEffectView( LadspaControls * _ctl ); + void updateEffectView( lmms::LadspaControls * _ctl ); private: diff --git a/plugins/LadspaEffect/LadspaControls.h b/plugins/LadspaEffect/LadspaControls.h index 6cc3207e444..e8f8863cfe8 100644 --- a/plugins/LadspaEffect/LadspaControls.h +++ b/plugins/LadspaEffect/LadspaControls.h @@ -83,7 +83,7 @@ protected slots: signals: - void effectModelChanged( LadspaControls * ); + void effectModelChanged( lmms::LadspaControls * ); } ; diff --git a/plugins/Vestige/Vestige.h b/plugins/Vestige/Vestige.h index d41ee26952d..5b7b1461de5 100644 --- a/plugins/Vestige/Vestige.h +++ b/plugins/Vestige/Vestige.h @@ -80,7 +80,7 @@ class VestigeInstrument : public Instrument virtual gui::PluginView* instantiateView( QWidget * _parent ); protected slots: - void setParameter( Model * action ); + void setParameter( lmms::Model * action ); void handleConfigChange( QString cls, QString attr, QString value ); void reloadPlugin(); @@ -119,7 +119,7 @@ class ManageVestigeInstrumentView : public InstrumentViewFixedSize protected slots: void syncPlugin( void ); void displayAutomatedOnly( void ); - void setParameter( Model * action ); + void setParameter( lmms::Model * action ); void syncParameterText(); void closeWindow(); diff --git a/plugins/VstBase/VstPlugin.h b/plugins/VstBase/VstPlugin.h index 3b1ba15a5ae..f73c1c87633 100644 --- a/plugins/VstBase/VstPlugin.h +++ b/plugins/VstBase/VstPlugin.h @@ -124,7 +124,7 @@ class VSTBASE_EXPORT VstPlugin : public RemotePlugin, public JournallingObject QString embedMethod() const; public slots: - void setTempo( bpm_t _bpm ); + void setTempo( lmms::bpm_t _bpm ); void updateSampleRate(); void openPreset( void ); void setProgram( int index ); diff --git a/plugins/VstEffect/VstEffectControls.h b/plugins/VstEffect/VstEffectControls.h index 8895979d6cc..24d5961ae95 100644 --- a/plugins/VstEffect/VstEffectControls.h +++ b/plugins/VstEffect/VstEffectControls.h @@ -77,7 +77,7 @@ protected slots: void rollPreset( void ); void rolrPreset( void ); void selPreset( void ); - void setParameter( Model * action ); + void setParameter( lmms::Model * action ); protected: virtual void paintEvent( QPaintEvent * _pe ); @@ -119,7 +119,7 @@ class ManageVSTEffectView : public QObject protected slots: void syncPlugin( void ); void displayAutomatedOnly( void ); - void setParameter( Model * action ); + void setParameter( lmms::Model * action ); void syncParameterText(); void closeWindow(); From d1bce5839aa2d3a3b81b5810d28d48af7361b212 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 19:27:12 +0200 Subject: [PATCH 103/118] Point zyn submodule to integration fork. --- plugins/ZynAddSubFx/zynaddsubfx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ZynAddSubFx/zynaddsubfx b/plugins/ZynAddSubFx/zynaddsubfx index 5a8328bc43c..9702dbbd9ec 160000 --- a/plugins/ZynAddSubFx/zynaddsubfx +++ b/plugins/ZynAddSubFx/zynaddsubfx @@ -1 +1 @@ -Subproject commit 5a8328bc43ce638b5b5c4d8fbb23fc401c18d2b5 +Subproject commit 9702dbbd9ecb02db8ca91ce8a97e5867b8cce7d5 From c63b9031aa63cabff10266a11de81c214d9eccee Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 19:58:09 +0200 Subject: [PATCH 104/118] Remove #include from lmms namespace in RemotePluginBase.h when SYNC_WITH_SHM_FIFO is enabled. --- include/RemotePluginBase.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/RemotePluginBase.h b/include/RemotePluginBase.h index c5a168c96bc..41424931a9d 100644 --- a/include/RemotePluginBase.h +++ b/include/RemotePluginBase.h @@ -81,6 +81,8 @@ #ifndef SYNC_WITH_SHM_FIFO #include #include +#else +#include "SharedMemory.h" #endif #endif // BUILD_REMOTE_PLUGIN_CLIENT @@ -92,7 +94,6 @@ namespace lmms #ifdef SYNC_WITH_SHM_FIFO -#include "SharedMemory.h" // sometimes we need to exchange bigger messages (e.g. for VST parameter dumps) // so set a usable value here From c9b4a101bf802463b30e89b7a46f5018677bfda7 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 20:08:28 +0200 Subject: [PATCH 105/118] Moved the SharedMemory include to the correct place and added some comments to avoid future confusion. --- include/RemotePluginBase.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/include/RemotePluginBase.h b/include/RemotePluginBase.h index 41424931a9d..18b3d2f12c9 100644 --- a/include/RemotePluginBase.h +++ b/include/RemotePluginBase.h @@ -47,11 +47,11 @@ #include #include #include -#else +#else // !(LMMS_HAVE_SYS_IPC_H && LMMS_HAVE_SEMAPHORE_H) #ifdef LMMS_HAVE_UNISTD_H #include #endif -#endif +#endif // !(LMMS_HAVE_SYS_IPC_H && LMMS_HAVE_SEMAPHORE_H) #ifdef LMMS_HAVE_LOCALE_H #include @@ -69,9 +69,10 @@ #ifndef SYNC_WITH_SHM_FIFO #include #include -#endif +#include "SharedMemory.h" +#endif // SYNC_WITH_SHM_FIFO -#else +#else // BUILD_REMOTE_PLUGIN_CLIENT #include "lmms_export.h" #include #include @@ -81,9 +82,7 @@ #ifndef SYNC_WITH_SHM_FIFO #include #include -#else -#include "SharedMemory.h" -#endif +#endif // SYNC_WITH_SHM_FIFO #endif // BUILD_REMOTE_PLUGIN_CLIENT From 08d0e0b47afa9162dcbd275136302b84a8ae34c5 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 20:15:49 +0200 Subject: [PATCH 106/118] Attempt 3. Just include this thing when SYNC_WITH_SHM_FIFO, no other conditions, yo. --- include/RemotePluginBase.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/RemotePluginBase.h b/include/RemotePluginBase.h index 18b3d2f12c9..4d5627a92a4 100644 --- a/include/RemotePluginBase.h +++ b/include/RemotePluginBase.h @@ -69,7 +69,6 @@ #ifndef SYNC_WITH_SHM_FIFO #include #include -#include "SharedMemory.h" #endif // SYNC_WITH_SHM_FIFO #else // BUILD_REMOTE_PLUGIN_CLIENT @@ -86,6 +85,9 @@ #endif // BUILD_REMOTE_PLUGIN_CLIENT +#ifdef SYNC_WITH_SHM_FIFO +#include "SharedMemory.h" +#endif namespace lmms { From bfb3e9258985c147d0204dee612cb8524908f6ba Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 20:26:16 +0200 Subject: [PATCH 107/118] Add missing gui:: scope prefix in VstPlugin.cpp in Windows build. --- plugins/VstBase/VstPlugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index d4576b019af..783e300b94d 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -416,7 +416,7 @@ bool VstPlugin::processMessage( const message & _m ) // so this is legal despite MSDN's warning SetWindowLongPtr( (HWND)(intptr_t) m_pluginWindowID, GWLP_HWNDPARENT, - (LONG_PTR) getGUI()->mainWindow()->winId() ); + (LONG_PTR) gui::getGUI()->mainWindow()->winId() ); #endif #ifdef LMMS_BUILD_LINUX From 9c42bd40c1d09fc352d2a6bff5b157cf520c6672 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 22:16:54 +0200 Subject: [PATCH 108/118] Remove unused member m_multiChannelLink from Lv2ViewBase --- include/Lv2ViewBase.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/Lv2ViewBase.h b/include/Lv2ViewBase.h index 715a7ee796e..74a0bd87618 100644 --- a/include/Lv2ViewBase.h +++ b/include/Lv2ViewBase.h @@ -101,7 +101,6 @@ class LMMS_EXPORT Lv2ViewBase : public LinkedModelGroupsView //! Numbers of controls per row; must be multiple of 2 for mono effects const int m_colNum = 6; QMdiSubWindow* m_helpWindow = nullptr; - LedCheckBox* m_multiChannelLink; }; From 2a39ad3268d14a48c2d310109343ba70d3f7e92e Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 22:19:24 +0200 Subject: [PATCH 109/118] Mark overriding functions 'override' and remove explicit default destructor implementation from AudioFileProcessor --- .../AudioFileProcessor/AudioFileProcessor.cpp | 7 ------- .../AudioFileProcessor/AudioFileProcessor.h | 19 +++++++++---------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.cpp b/plugins/AudioFileProcessor/AudioFileProcessor.cpp index a7e778f726e..98ea070afdf 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessor.cpp @@ -115,13 +115,6 @@ AudioFileProcessor::AudioFileProcessor( InstrumentTrack * _instrument_track ) : -AudioFileProcessor::~AudioFileProcessor() -{ -} - - - - void AudioFileProcessor::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) { diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.h b/plugins/AudioFileProcessor/AudioFileProcessor.h index 2ff679ebdbe..ad81ecfe337 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.h +++ b/plugins/AudioFileProcessor/AudioFileProcessor.h @@ -56,23 +56,22 @@ class AudioFileProcessor : public Instrument Q_OBJECT public: AudioFileProcessor( InstrumentTrack * _instrument_track ); - virtual ~AudioFileProcessor(); - virtual void playNote( NotePlayHandle * _n, - sampleFrame * _working_buffer ); - virtual void deleteNotePluginData( NotePlayHandle * _n ); + void playNote( NotePlayHandle * _n, + sampleFrame * _working_buffer ) override; + void deleteNotePluginData( NotePlayHandle * _n ) override; - virtual void saveSettings( QDomDocument & _doc, - QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); + void saveSettings( QDomDocument & _doc, + QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; - virtual void loadFile( const QString & _file ); + void loadFile( const QString & _file ) override; - virtual QString nodeName() const; + QString nodeName() const override; virtual int getBeatLen( NotePlayHandle * _n ) const; - virtual f_cnt_t desiredReleaseFrames() const + f_cnt_t desiredReleaseFrames() const override { return 128; } From 1a6260727daf43725f3a5e76d67d7aa2052a6e80 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 22:21:05 +0200 Subject: [PATCH 110/118] Mark overriding functions 'override' and remove explicit default destructor implementation from Vibed --- plugins/Vibed/Vibed.cpp | 7 ------- plugins/Vibed/Vibed.h | 15 +++++++-------- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/plugins/Vibed/Vibed.cpp b/plugins/Vibed/Vibed.cpp index 2979c6a208d..87c42b187a8 100644 --- a/plugins/Vibed/Vibed.cpp +++ b/plugins/Vibed/Vibed.cpp @@ -132,13 +132,6 @@ Vibed::Vibed( InstrumentTrack * _instrumentTrack ) : -Vibed::~Vibed() -{ -} - - - - void Vibed::saveSettings( QDomDocument & _doc, QDomElement & _this ) { diff --git a/plugins/Vibed/Vibed.h b/plugins/Vibed/Vibed.h index ed7d3fabcaf..f13fd665aed 100644 --- a/plugins/Vibed/Vibed.h +++ b/plugins/Vibed/Vibed.h @@ -47,19 +47,18 @@ class Vibed : public Instrument Q_OBJECT public: Vibed( InstrumentTrack * _instrument_track ); - virtual ~Vibed(); - virtual void playNote( NotePlayHandle * _n, - sampleFrame * _working_buffer ); - virtual void deleteNotePluginData( NotePlayHandle * _n ); + void playNote( NotePlayHandle * _n, + sampleFrame * _working_buffer ) override; + void deleteNotePluginData( NotePlayHandle * _n ) override; - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; - virtual QString nodeName() const; + QString nodeName() const override; - virtual Flags flags() const + Flags flags() const override { return IsNotBendable; } From bebd6e1da80dc71605bd206793095e86bc8c92da Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 22:23:55 +0200 Subject: [PATCH 111/118] Mark overriding functions 'override' and remove explicit default destructor implementation from Xpressive and XpressiveView --- plugins/Xpressive/Xpressive.cpp | 8 -------- plugins/Xpressive/Xpressive.h | 18 ++++++++---------- 2 files changed, 8 insertions(+), 18 deletions(-) diff --git a/plugins/Xpressive/Xpressive.cpp b/plugins/Xpressive/Xpressive.cpp index 487d69d43ba..a69343e07f7 100644 --- a/plugins/Xpressive/Xpressive.cpp +++ b/plugins/Xpressive/Xpressive.cpp @@ -111,9 +111,6 @@ Xpressive::Xpressive(InstrumentTrack* instrument_track) : m_outputExpression[1]="expw(integrate(f*atan(500t)*2/pi))*0.5+0.12"; } -Xpressive::~Xpressive() { -} - void Xpressive::saveSettings(QDomDocument & _doc, QDomElement & _this) { // Save plugin version @@ -538,11 +535,6 @@ XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) : } -XpressiveView::~XpressiveView() -{ -} - - void XpressiveView::expressionChanged() { Xpressive * e = castModel(); QByteArray text = m_expressionEditor->toPlainText().toLatin1(); diff --git a/plugins/Xpressive/Xpressive.h b/plugins/Xpressive/Xpressive.h index c846af922bc..d075e908839 100644 --- a/plugins/Xpressive/Xpressive.h +++ b/plugins/Xpressive/Xpressive.h @@ -66,18 +66,17 @@ class Xpressive : public Instrument Q_OBJECT public: Xpressive(InstrumentTrack* instrument_track ); - virtual ~Xpressive(); - virtual void playNote(NotePlayHandle* nph, - sampleFrame* working_buffer ); - virtual void deleteNotePluginData( NotePlayHandle* nph ); + void playNote(NotePlayHandle* nph, + sampleFrame* working_buffer ) override; + void deleteNotePluginData( NotePlayHandle* nph ) override; - virtual void saveSettings( QDomDocument& _doc, - QDomElement& _this ); - virtual void loadSettings( const QDomElement& _this ); + void saveSettings( QDomDocument& _doc, + QDomElement& _this ) override; + void loadSettings( const QDomElement& _this ) override; - virtual QString nodeName() const; + QString nodeName() const override; gui::PluginView* instantiateView( QWidget * parent ) override; @@ -157,7 +156,6 @@ class XpressiveView : public InstrumentViewFixedSize XpressiveView( Instrument* _instrument, QWidget* _parent ); - virtual ~XpressiveView(); protected: @@ -178,7 +176,7 @@ protected slots: void graphDrawn( ); private: - virtual void modelChanged(); + void modelChanged() override; Knob *m_generalPurposeKnob[3]; Knob *m_panningKnob[2]; From 739515240b8916e0b52a332f231a20b64b959fd9 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 22:28:08 +0200 Subject: [PATCH 112/118] Mark overriding functions 'override' (including dtor of ZynAddSubFxInstrument) and remove explicit default destructor implementation from all classes in ZynAddSubFx.h --- plugins/ZynAddSubFx/ZynAddSubFx.cpp | 15 --------------- plugins/ZynAddSubFx/ZynAddSubFx.h | 26 ++++++++++++-------------- 2 files changed, 12 insertions(+), 29 deletions(-) diff --git a/plugins/ZynAddSubFx/ZynAddSubFx.cpp b/plugins/ZynAddSubFx/ZynAddSubFx.cpp index dd21a467e2c..27cb4728e30 100644 --- a/plugins/ZynAddSubFx/ZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/ZynAddSubFx.cpp @@ -84,13 +84,6 @@ ZynAddSubFxRemotePlugin::ZynAddSubFxRemotePlugin() : - -ZynAddSubFxRemotePlugin::~ZynAddSubFxRemotePlugin() -{ -} - - - bool ZynAddSubFxRemotePlugin::processMessage( const message & _m ) { switch( _m.id ) @@ -573,14 +566,6 @@ ZynAddSubFxView::ZynAddSubFxView( Instrument * _instrument, QWidget * _parent ) - -ZynAddSubFxView::~ZynAddSubFxView() -{ -} - - - - void ZynAddSubFxView::dragEnterEvent( QDragEnterEvent * _dee ) { // For mimeType() and MimeType enum class diff --git a/plugins/ZynAddSubFx/ZynAddSubFx.h b/plugins/ZynAddSubFx/ZynAddSubFx.h index 728a4f282ba..996c187ee45 100644 --- a/plugins/ZynAddSubFx/ZynAddSubFx.h +++ b/plugins/ZynAddSubFx/ZynAddSubFx.h @@ -56,9 +56,8 @@ class ZynAddSubFxRemotePlugin : public RemotePlugin Q_OBJECT public: ZynAddSubFxRemotePlugin(); - virtual ~ZynAddSubFxRemotePlugin(); - virtual bool processMessage( const message & _m ); + bool processMessage( const message & _m ) override; signals: @@ -73,21 +72,21 @@ class ZynAddSubFxInstrument : public Instrument Q_OBJECT public: ZynAddSubFxInstrument( InstrumentTrack * _instrument_track ); - virtual ~ZynAddSubFxInstrument(); + ~ZynAddSubFxInstrument() override; - virtual void play( sampleFrame * _working_buffer ); + void play( sampleFrame * _working_buffer ) override; - virtual bool handleMidiEvent( const MidiEvent& event, const TimePos& time = TimePos(), f_cnt_t offset = 0 ); + bool handleMidiEvent( const MidiEvent& event, const TimePos& time = TimePos(), f_cnt_t offset = 0 ) override; - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; - virtual void loadFile( const QString & _file ); + void loadFile( const QString & _file ) override; - virtual QString nodeName() const; + QString nodeName() const override; - virtual Flags flags() const + Flags flags() const override { return IsSingleStreamed | IsMidiBased; } @@ -147,16 +146,15 @@ class ZynAddSubFxView : public InstrumentViewFixedSize Q_OBJECT public: ZynAddSubFxView( Instrument * _instrument, QWidget * _parent ); - virtual ~ZynAddSubFxView(); protected: - virtual void dragEnterEvent( QDragEnterEvent * _dee ); - virtual void dropEvent( QDropEvent * _de ); + void dragEnterEvent( QDragEnterEvent * _dee ) override; + void dropEvent( QDropEvent * _de ) override; private: - void modelChanged(); + void modelChanged() override; QPushButton * m_toggleUIButton; Knob * m_portamento; From 145a8b0f2e723c8072bf574872ee38de757b2da1 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 22:37:52 +0200 Subject: [PATCH 113/118] Most important change ever. Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> --- src/core/MemoryHelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/MemoryHelper.cpp b/src/core/MemoryHelper.cpp index 44157ceeaaa..de80ef7701d 100644 --- a/src/core/MemoryHelper.cpp +++ b/src/core/MemoryHelper.cpp @@ -68,4 +68,4 @@ void MemoryHelper::alignedFree( void* _buffer ) } -} // namespac elmms +} // namespace lmms From df3a8e948eb83f08a7348e54d9fcf54c01f0f109 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 22:43:07 +0200 Subject: [PATCH 114/118] Remove redundant lmms:: prefix from PluginIssue output operator; operator has moved into the namespace. --- src/core/PluginIssue.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/PluginIssue.cpp b/src/core/PluginIssue.cpp index a64c3c485f1..f8ae06bc71d 100644 --- a/src/core/PluginIssue.cpp +++ b/src/core/PluginIssue.cpp @@ -95,9 +95,9 @@ bool PluginIssue::operator<(const PluginIssue &other) const } -QDebug operator<<(QDebug stream, const lmms::PluginIssue &iss) +QDebug operator<<(QDebug stream, const PluginIssue &iss) { - stream << lmms::PluginIssue::msgFor(iss.m_issueType); + stream << PluginIssue::msgFor(iss.m_issueType); if (iss.m_info.length()) { stream.nospace() << ": " << iss.m_info.c_str(); From 865889f7574825f64e03982e62410f86bc4104a8 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 23:27:59 +0200 Subject: [PATCH 115/118] Fully qualify signal/slot argument types in InstrumentTrack and SampleBuffer. --- include/InstrumentTrack.h | 4 ++-- include/SampleBuffer.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index d8864ed0fda..d05da176bd8 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -237,8 +237,8 @@ class LMMS_EXPORT InstrumentTrack : public Track, public MidiEventProcessor signals: void instrumentChanged(); - void midiNoteOn( const Note& ); - void midiNoteOff( const Note& ); + void midiNoteOn( const lmms::Note& ); + void midiNoteOff( const lmms::Note& ); void nameChanged(); void newNote(); void endNote(); diff --git a/include/SampleBuffer.h b/include/SampleBuffer.h index aef0cee56ce..b556fccbe61 100644 --- a/include/SampleBuffer.h +++ b/include/SampleBuffer.h @@ -284,8 +284,8 @@ class LMMS_EXPORT SampleBuffer : public QObject, public sharedObject public slots: void setAudioFile(const QString & audioFile); void loadFromBase64(const QString & data); - void setStartFrame(const f_cnt_t s); - void setEndFrame(const f_cnt_t e); + void setStartFrame(const lmms::f_cnt_t s); + void setEndFrame(const lmms::f_cnt_t e); void setAmplification(float a); void setReversed(bool on); void sampleRateChanged(); From bbb0dd4d876691c4949fb09503857c4e98123366 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 18 Jun 2022 23:34:55 +0200 Subject: [PATCH 116/118] Fully qualify signal/slot argument types in AudioFileProcessor --- plugins/AudioFileProcessor/AudioFileProcessor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.h b/plugins/AudioFileProcessor/AudioFileProcessor.h index ad81ecfe337..12816cc02c0 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.h +++ b/plugins/AudioFileProcessor/AudioFileProcessor.h @@ -94,7 +94,7 @@ private slots: signals: - void isPlaying( f_cnt_t _current_frame ); + void isPlaying( lmms::f_cnt_t _current_frame ); private: From d984f49b36231ec68d040c3637253dc9ffd117fa Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 19 Jun 2022 12:15:39 +0200 Subject: [PATCH 117/118] Use fully scoped type names in signal/slot connect statements, and catch the missing one in AudioFileProcessor.h --- .../AudioFileProcessor/AudioFileProcessor.cpp | 4 +-- .../AudioFileProcessor/AudioFileProcessor.h | 2 +- plugins/LadspaBrowser/LadspaBrowser.cpp | 6 ++--- plugins/LadspaBrowser/LadspaBrowser.h | 2 +- plugins/LadspaBrowser/LadspaDescription.h | 2 +- plugins/LadspaEffect/LadspaControlDialog.cpp | 4 +-- plugins/VstBase/VstPlugin.cpp | 4 +-- src/core/AutomationClip.cpp | 4 +-- src/core/SampleClip.cpp | 2 +- src/core/TempoSyncKnobModel.cpp | 4 +-- src/core/midi/MidiAlsaSeq.cpp | 4 +-- src/gui/ControllerRackView.cpp | 8 +++--- src/gui/EffectRackView.cpp | 12 ++++----- src/gui/editors/AutomationEditor.cpp | 8 +++--- src/gui/editors/PianoRoll.cpp | 26 +++++++++---------- src/gui/editors/SongEditor.cpp | 8 +++--- src/gui/editors/TrackContainerView.cpp | 8 +++--- src/gui/tracks/TrackContentWidget.cpp | 4 +-- src/gui/tracks/TrackOperationsWidget.cpp | 4 +-- src/gui/tracks/TrackView.cpp | 4 +-- src/gui/widgets/Oscilloscope.cpp | 8 +++--- src/gui/widgets/TempoSyncKnob.cpp | 2 +- 22 files changed, 65 insertions(+), 65 deletions(-) diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.cpp b/plugins/AudioFileProcessor/AudioFileProcessor.cpp index 98ea070afdf..b5e991a2ca4 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessor.cpp @@ -548,8 +548,8 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument, m_waveView = 0; newWaveView(); - connect( castModel(), SIGNAL( isPlaying( f_cnt_t ) ), - m_waveView, SLOT( isPlaying( f_cnt_t ) ) ); + connect( castModel(), SIGNAL( isPlaying( lmms::f_cnt_t ) ), + m_waveView, SLOT( isPlaying( lmms::f_cnt_t ) ) ); qRegisterMetaType( "f_cnt_t" ); diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.h b/plugins/AudioFileProcessor/AudioFileProcessor.h index 12816cc02c0..30fcbc50213 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.h +++ b/plugins/AudioFileProcessor/AudioFileProcessor.h @@ -235,7 +235,7 @@ public slots: QWidget::update(); } - void isPlaying( f_cnt_t _current_frame ); + void isPlaying( lmms::f_cnt_t _current_frame ); private: diff --git a/plugins/LadspaBrowser/LadspaBrowser.cpp b/plugins/LadspaBrowser/LadspaBrowser.cpp index 2e83852d42f..d40b855fd33 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.cpp +++ b/plugins/LadspaBrowser/LadspaBrowser.cpp @@ -193,8 +193,8 @@ QWidget * LadspaBrowserView::createTab( QWidget * _parent, const QString & _txt, layout->addSpacing( 10 ); LadspaDescription * description = new LadspaDescription( tab, _type ); - connect( description, SIGNAL( doubleClicked( const ladspa_key_t & ) ), - SLOT( showPorts( const ladspa_key_t & ) ) ); + connect( description, SIGNAL( doubleClicked( const ::lmms::ladspa_key_t & ) ), + SLOT( showPorts( const ::lmms::ladspa_key_t & ) ) ); layout->addWidget( description, 1 ); return tab; @@ -203,7 +203,7 @@ QWidget * LadspaBrowserView::createTab( QWidget * _parent, const QString & _txt, -void LadspaBrowserView::showPorts( const ladspa_key_t & _key ) +void LadspaBrowserView::showPorts( const ::lmms::ladspa_key_t & _key ) { LadspaPortDialog ports( _key ); ports.exec(); diff --git a/plugins/LadspaBrowser/LadspaBrowser.h b/plugins/LadspaBrowser/LadspaBrowser.h index c421090376c..f1f88872cab 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.h +++ b/plugins/LadspaBrowser/LadspaBrowser.h @@ -50,7 +50,7 @@ class LadspaBrowserView : public ToolPluginView public slots: - void showPorts( const lmms::ladspa_key_t & _key ); + void showPorts( const ::lmms::ladspa_key_t & _key ); private: diff --git a/plugins/LadspaBrowser/LadspaDescription.h b/plugins/LadspaBrowser/LadspaDescription.h index 547f06bd5bb..0e54acd323e 100644 --- a/plugins/LadspaBrowser/LadspaDescription.h +++ b/plugins/LadspaBrowser/LadspaDescription.h @@ -48,7 +48,7 @@ class LadspaDescription : public QWidget signals: - void doubleClicked( const lmms::ladspa_key_t & ); + void doubleClicked( const ::lmms::ladspa_key_t & ); private: diff --git a/plugins/LadspaEffect/LadspaControlDialog.cpp b/plugins/LadspaEffect/LadspaControlDialog.cpp index 5d64c1b9f78..199982bb0da 100644 --- a/plugins/LadspaEffect/LadspaControlDialog.cpp +++ b/plugins/LadspaEffect/LadspaControlDialog.cpp @@ -143,8 +143,8 @@ void LadspaControlDialog::updateEffectView( LadspaControls * _ctl ) m_stereoLink->setModel( &_ctl->m_stereoLinkModel ); } - connect( _ctl, SIGNAL( effectModelChanged( LadspaControls * ) ), - this, SLOT( updateEffectView( LadspaControls * ) ), + connect( _ctl, SIGNAL( effectModelChanged( lmms::LadspaControls * ) ), + this, SLOT( updateEffectView( lmms::LadspaControls * ) ), Qt::DirectConnection ); } diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index 783e300b94d..a31cc832c8c 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -182,8 +182,8 @@ VstPlugin::VstPlugin( const QString & _plugin ) : setTempo( Engine::getSong()->getTempo() ); - connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), - this, SLOT( setTempo( bpm_t ) ), Qt::DirectConnection ); + connect( Engine::getSong(), SIGNAL( tempoChanged( lmms::bpm_t ) ), + this, SLOT( setTempo( lmms::bpm_t ) ), Qt::DirectConnection ); connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) ); diff --git a/src/core/AutomationClip.cpp b/src/core/AutomationClip.cpp index 7b7501b85cc..928cf48a964 100644 --- a/src/core/AutomationClip.cpp +++ b/src/core/AutomationClip.cpp @@ -130,8 +130,8 @@ bool AutomationClip::addObject( AutomatableModel * _obj, bool _search_dup ) m_objects += _obj; - connect( _obj, SIGNAL( destroyed( jo_id_t ) ), - this, SLOT( objectDestroyed( jo_id_t ) ), + connect( _obj, SIGNAL( destroyed( lmms::jo_id_t ) ), + this, SLOT( objectDestroyed( lmms::jo_id_t ) ), Qt::DirectConnection ); emit dataChanged(); diff --git a/src/core/SampleClip.cpp b/src/core/SampleClip.cpp index 51f6009dae1..9ee8e93e458 100644 --- a/src/core/SampleClip.cpp +++ b/src/core/SampleClip.cpp @@ -47,7 +47,7 @@ SampleClip::SampleClip( Track * _track ) : // we need to receive bpm-change-events, because then we have to // change length of this Clip - connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), + connect( Engine::getSong(), SIGNAL( tempoChanged( lmms::bpm_t ) ), this, SLOT( updateLength() ), Qt::DirectConnection ); connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int,int ) ), this, SLOT( updateLength() ) ); diff --git a/src/core/TempoSyncKnobModel.cpp b/src/core/TempoSyncKnobModel.cpp index d319407ecfe..bc7c86db956 100644 --- a/src/core/TempoSyncKnobModel.cpp +++ b/src/core/TempoSyncKnobModel.cpp @@ -45,8 +45,8 @@ TempoSyncKnobModel::TempoSyncKnobModel( const float _val, const float _min, m_scale( _scale ), m_custom( _parent ) { - connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), - this, SLOT( calculateTempoSyncTime( bpm_t ) ), + connect( Engine::getSong(), SIGNAL( tempoChanged( lmms::bpm_t ) ), + this, SLOT( calculateTempoSyncTime( lmms::bpm_t ) ), Qt::DirectConnection ); } diff --git a/src/core/midi/MidiAlsaSeq.cpp b/src/core/midi/MidiAlsaSeq.cpp index 50c3bd938dc..41904812c3b 100644 --- a/src/core/midi/MidiAlsaSeq.cpp +++ b/src/core/midi/MidiAlsaSeq.cpp @@ -101,8 +101,8 @@ MidiAlsaSeq::MidiAlsaSeq() : snd_seq_start_queue( m_seqHandle, m_queueID, nullptr ); changeQueueTempo( Engine::getSong()->getTempo() ); - connect( Engine::getSong(), SIGNAL( tempoChanged( bpm_t ) ), - this, SLOT( changeQueueTempo( bpm_t ) ), Qt::DirectConnection ); + connect( Engine::getSong(), SIGNAL( tempoChanged( lmms::bpm_t ) ), + this, SLOT( changeQueueTempo( lmms::bpm_t ) ), Qt::DirectConnection ); // initial list-update updatePortList(); diff --git a/src/gui/ControllerRackView.cpp b/src/gui/ControllerRackView.cpp index b2e3ffbfe38..9549b6e0dc8 100644 --- a/src/gui/ControllerRackView.cpp +++ b/src/gui/ControllerRackView.cpp @@ -68,8 +68,8 @@ ControllerRackView::ControllerRackView( ) : this, SLOT( addController() ) ); Song * song = Engine::getSong(); - connect( song, SIGNAL( controllerAdded( Controller* ) ), SLOT( onControllerAdded( Controller* ) ) ); - connect( song, SIGNAL( controllerRemoved( Controller* ) ), SLOT( onControllerRemoved( Controller* ) ) ); + connect( song, SIGNAL( controllerAdded( lmms::Controller* ) ), SLOT( onControllerAdded( lmms::Controller* ) ) ); + connect( song, SIGNAL( controllerRemoved( lmms::Controller* ) ), SLOT( onControllerRemoved( lmms::Controller* ) ) ); QVBoxLayout * layout = new QVBoxLayout(); layout->addWidget( m_scrollArea ); @@ -148,8 +148,8 @@ void ControllerRackView::onControllerAdded( Controller * controller ) ControllerView * controllerView = new ControllerView( controller, scrollAreaWidget ); - connect( controllerView, SIGNAL( deleteController( ControllerView * ) ), - this, SLOT( deleteController( ControllerView * ) ), Qt::QueuedConnection ); + connect( controllerView, SIGNAL( deleteController( lmms::gui::ControllerView * ) ), + this, SLOT( deleteController( lmms::gui::ControllerView * ) ), Qt::QueuedConnection ); m_controllerViews.append( controllerView ); m_scrollAreaLayout->insertWidget( m_nextIndex, controllerView ); diff --git a/src/gui/EffectRackView.cpp b/src/gui/EffectRackView.cpp index 0ff181ce01c..27600056e93 100644 --- a/src/gui/EffectRackView.cpp +++ b/src/gui/EffectRackView.cpp @@ -171,12 +171,12 @@ void EffectRackView::update() if( i >= m_effectViews.size() ) { EffectView * view = new EffectView( *it, w ); - connect( view, SIGNAL( moveUp( EffectView * ) ), - this, SLOT( moveUp( EffectView * ) ) ); - connect( view, SIGNAL( moveDown( EffectView * ) ), - this, SLOT( moveDown( EffectView * ) ) ); - connect( view, SIGNAL( deletePlugin( EffectView * ) ), - this, SLOT( deletePlugin( EffectView * ) ), + connect( view, SIGNAL( moveUp( lmms::gui::EffectView * ) ), + this, SLOT( moveUp( lmms::gui::EffectView * ) ) ); + connect( view, SIGNAL( moveDown( lmms::gui::EffectView * ) ), + this, SLOT( moveDown( lmms::gui::EffectView * ) ) ); + connect( view, SIGNAL( deletePlugin( lmms::gui::EffectView * ) ), + this, SLOT( deletePlugin( lmms::gui::EffectView * ) ), Qt::QueuedConnection ); view->show(); m_effectViews.append( view ); diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 4c0472cfc5c..8f8cdd57074 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -150,10 +150,10 @@ AutomationEditor::AutomationEditor() : Song::Mode_PlayAutomationClip ), m_currentPosition, Song::Mode_PlayAutomationClip, this ); - connect( this, SIGNAL( positionChanged( const TimePos & ) ), - m_timeLine, SLOT( updatePosition( const TimePos & ) ) ); - connect( m_timeLine, SIGNAL( positionChanged( const TimePos & ) ), - this, SLOT( updatePosition( const TimePos & ) ) ); + connect( this, SIGNAL( positionChanged( const lmms::TimePos & ) ), + m_timeLine, SLOT( updatePosition( const lmms::TimePos & ) ) ); + connect( m_timeLine, SIGNAL( positionChanged( const lmms::TimePos & ) ), + this, SLOT( updatePosition( const lmms::TimePos & ) ) ); // init scrollbars m_leftRightScroll = new QScrollBar( Qt::Horizontal, this ); diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 3f8ca8644c3..fd1cd0480ab 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -301,28 +301,28 @@ PianoRoll::PianoRoll() : Song::Mode_PlayMidiClip ), m_currentPosition, Song::Mode_PlayMidiClip, this ); - connect( this, SIGNAL( positionChanged( const TimePos & ) ), - m_timeLine, SLOT( updatePosition( const TimePos & ) ) ); - connect( m_timeLine, SIGNAL( positionChanged( const TimePos & ) ), - this, SLOT( updatePosition( const TimePos & ) ) ); + connect( this, SIGNAL( positionChanged( const lmms::TimePos & ) ), + m_timeLine, SLOT( updatePosition( const lmms::TimePos & ) ) ); + connect( m_timeLine, SIGNAL( positionChanged( const lmms::TimePos & ) ), + this, SLOT( updatePosition( const lmms::TimePos & ) ) ); // white position line follows timeline marker m_positionLine = new PositionLine(this); //update timeline when in step-recording mode - connect( &m_stepRecorderWidget, SIGNAL( positionChanged( const TimePos & ) ), - this, SLOT( updatePositionStepRecording( const TimePos & ) ) ); + connect( &m_stepRecorderWidget, SIGNAL( positionChanged( const lmms::TimePos & ) ), + this, SLOT( updatePositionStepRecording( const lmms::TimePos & ) ) ); // update timeline when in record-accompany mode connect( Engine::getSong()->getPlayPos( Song::Mode_PlaySong ).m_timeLine, - SIGNAL( positionChanged( const TimePos & ) ), + SIGNAL( positionChanged( const lmms::TimePos & ) ), this, - SLOT( updatePositionAccompany( const TimePos & ) ) ); + SLOT( updatePositionAccompany( const lmms::TimePos & ) ) ); // TODO /* connect( engine::getSong()->getPlayPos( Song::Mode_PlayPattern ).m_timeLine, - SIGNAL( positionChanged( const TimePos & ) ), + SIGNAL( positionChanged( const lmms::TimePos & ) ), this, - SLOT( updatePositionAccompany( const TimePos & ) ) );*/ + SLOT( updatePositionAccompany( const lmms::TimePos & ) ) );*/ removeSelection(); @@ -913,10 +913,10 @@ void PianoRoll::setCurrentMidiClip( MidiClip* newMidiClip ) resizeEvent( nullptr ); // make sure to always get informed about the MIDI clip being destroyed - connect( m_midiClip, SIGNAL( destroyedMidiClip( MidiClip* ) ), this, SLOT( hideMidiClip( MidiClip* ) ) ); + connect( m_midiClip, SIGNAL( destroyedMidiClip( lmms::MidiClip* ) ), this, SLOT( hideMidiClip( lmms::MidiClip* ) ) ); - connect( m_midiClip->instrumentTrack(), SIGNAL( midiNoteOn( const Note& ) ), this, SLOT( startRecordNote( const Note& ) ) ); - connect( m_midiClip->instrumentTrack(), SIGNAL( midiNoteOff( const Note& ) ), this, SLOT( finishRecordNote( const Note& ) ) ); + connect( m_midiClip->instrumentTrack(), SIGNAL( midiNoteOn( const lmms::Note& ) ), this, SLOT( startRecordNote( const lmms::Note& ) ) ); + connect( m_midiClip->instrumentTrack(), SIGNAL( midiNoteOff( const lmms::Note& ) ), this, SLOT( finishRecordNote( const lmms::Note& ) ) ); connect( m_midiClip, SIGNAL(dataChanged()), this, SLOT(update())); connect( m_midiClip->instrumentTrack()->pianoModel(), SIGNAL( dataChanged() ), this, SLOT( update() ) ); diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 964552086b4..9c028feba49 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -88,11 +88,11 @@ SongEditor::SongEditor( Song * song ) : m_song->m_playPos[Song::Mode_PlaySong], m_currentPosition, Song::Mode_PlaySong, this ); - connect( this, SIGNAL( positionChanged( const TimePos & ) ), + connect( this, SIGNAL( positionChanged( const lmms::TimePos & ) ), m_song->m_playPos[Song::Mode_PlaySong].m_timeLine, - SLOT( updatePosition( const TimePos & ) ) ); - connect( m_timeLine, SIGNAL( positionChanged( const TimePos & ) ), - this, SLOT( updatePosition( const TimePos & ) ) ); + SLOT( updatePosition( const lmms::TimePos & ) ) ); + connect( m_timeLine, SIGNAL( positionChanged( const lmms::TimePos & ) ), + this, SLOT( updatePosition( const lmms::TimePos & ) ) ); connect( m_timeLine, SIGNAL( regionSelectedFromPixels( int, int ) ), this, SLOT( selectRegionFromPixels( int, int ) ) ); connect( m_timeLine, SIGNAL( selectionFinished() ), diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index 8b86d903360..6c85cf1a3b2 100644 --- a/src/gui/editors/TrackContainerView.cpp +++ b/src/gui/editors/TrackContainerView.cpp @@ -110,8 +110,8 @@ TrackContainerView::TrackContainerView( TrackContainer * _tc ) : connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), this, SLOT( realignTracks() ) ); - connect( m_tc, SIGNAL( trackAdded( Track * ) ), - this, SLOT( createTrackView( Track * ) ), + connect( m_tc, SIGNAL( trackAdded( lmms::Track * ) ), + this, SLOT( createTrackView( lmms::Track * ) ), Qt::QueuedConnection ); } @@ -151,9 +151,9 @@ TrackView * TrackContainerView::addTrackView( TrackView * _tv ) { m_trackViews.push_back( _tv ); m_scrollLayout->addWidget( _tv ); - connect( this, SIGNAL( positionChanged( const TimePos & ) ), + connect( this, SIGNAL( positionChanged( const lmms::TimePos & ) ), _tv->getTrackContentWidget(), - SLOT( changePosition( const TimePos & ) ) ); + SLOT( changePosition( const lmms::TimePos & ) ) ); realignTracks(); return( _tv ); } diff --git a/src/gui/tracks/TrackContentWidget.cpp b/src/gui/tracks/TrackContentWidget.cpp index cbe227234f9..03e7487a6c0 100644 --- a/src/gui/tracks/TrackContentWidget.cpp +++ b/src/gui/tracks/TrackContentWidget.cpp @@ -71,8 +71,8 @@ TrackContentWidget::TrackContentWidget( TrackView * parent ) : setAcceptDrops( true ); connect( parent->trackContainerView(), - SIGNAL( positionChanged( const TimePos & ) ), - this, SLOT( changePosition( const TimePos & ) ) ); + SIGNAL( positionChanged( const lmms::TimePos & ) ), + this, SLOT( changePosition( const lmms::TimePos & ) ) ); setStyle( QApplication::style() ); diff --git a/src/gui/tracks/TrackOperationsWidget.cpp b/src/gui/tracks/TrackOperationsWidget.cpp index a2ce87b275a..c529b26e8e2 100644 --- a/src/gui/tracks/TrackOperationsWidget.cpp +++ b/src/gui/tracks/TrackOperationsWidget.cpp @@ -106,9 +106,9 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : m_soloBtn->show(); m_soloBtn->setToolTip(tr("Solo")); - connect( this, SIGNAL( trackRemovalScheduled( TrackView * ) ), + connect( this, SIGNAL( trackRemovalScheduled( lmms::gui::TrackView * ) ), m_trackView->trackContainerView(), - SLOT( deleteTrackView( TrackView * ) ), + SLOT( deleteTrackView( lmms::gui::TrackView * ) ), Qt::QueuedConnection ); connect( m_trackView->getTrack()->getMutedModel(), SIGNAL( dataChanged() ), diff --git a/src/gui/tracks/TrackView.cpp b/src/gui/tracks/TrackView.cpp index ba880579307..61d598f6ed6 100644 --- a/src/gui/tracks/TrackView.cpp +++ b/src/gui/tracks/TrackView.cpp @@ -90,8 +90,8 @@ TrackView::TrackView( Track * track, TrackContainerView * tcv ) : connect( m_track, SIGNAL( destroyedTrack() ), this, SLOT( close() ) ); connect( m_track, - SIGNAL( clipAdded( Clip * ) ), - this, SLOT( createClipView( Clip * ) ), + SIGNAL( clipAdded( lmms::Clip * ) ), + this, SLOT( createClipView( lmms::Clip * ) ), Qt::QueuedConnection ); connect( &m_track->m_mutedModel, SIGNAL( dataChanged() ), diff --git a/src/gui/widgets/Oscilloscope.cpp b/src/gui/widgets/Oscilloscope.cpp index 7b282858921..cd028f63770 100644 --- a/src/gui/widgets/Oscilloscope.cpp +++ b/src/gui/widgets/Oscilloscope.cpp @@ -94,8 +94,8 @@ void Oscilloscope::setActive( bool _active ) SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); connect( Engine::audioEngine(), - SIGNAL( nextAudioBuffer( const surroundSampleFrame* ) ), - this, SLOT( updateAudioBuffer( const surroundSampleFrame* ) ) ); + SIGNAL( nextAudioBuffer( const lmms::surroundSampleFrame* ) ), + this, SLOT( updateAudioBuffer( const lmms::surroundSampleFrame* ) ) ); } else { @@ -103,8 +103,8 @@ void Oscilloscope::setActive( bool _active ) SIGNAL( periodicUpdate() ), this, SLOT( update() ) ); disconnect( Engine::audioEngine(), - SIGNAL( nextAudioBuffer( const surroundSampleFrame* ) ), - this, SLOT( updateAudioBuffer( const surroundSampleFrame* ) ) ); + SIGNAL( nextAudioBuffer( const lmms::surroundSampleFrame* ) ), + this, SLOT( updateAudioBuffer( const lmms::surroundSampleFrame* ) ) ); // we have to update (remove last waves), // because timer doesn't do that anymore update(); diff --git a/src/gui/widgets/TempoSyncKnob.cpp b/src/gui/widgets/TempoSyncKnob.cpp index 52a6deed5d1..47da424d4bc 100644 --- a/src/gui/widgets/TempoSyncKnob.cpp +++ b/src/gui/widgets/TempoSyncKnob.cpp @@ -75,7 +75,7 @@ void TempoSyncKnob::modelChanged() { m_custom->setModel( &model()->m_custom ); } - connect( model(), SIGNAL( syncModeChanged( TempoSyncMode ) ), + connect( model(), SIGNAL( syncModeChanged( lmms::TempoSyncKnobModel::TempoSyncMode ) ), this, SLOT( updateDescAndIcon() ) ); connect( this, SIGNAL( sliderMoved( float ) ), model(), SLOT( disableSync() ) ); From cd301fdcd431dc6db10c4a25a81dd26ae4b1868e Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 19 Jun 2022 14:11:37 +0200 Subject: [PATCH 118/118] namespace changes are merged in zyn; point submodule back at master. --- plugins/ZynAddSubFx/zynaddsubfx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ZynAddSubFx/zynaddsubfx b/plugins/ZynAddSubFx/zynaddsubfx index 9702dbbd9ec..b9855dbe164 160000 --- a/plugins/ZynAddSubFx/zynaddsubfx +++ b/plugins/ZynAddSubFx/zynaddsubfx @@ -1 +1 @@ -Subproject commit 9702dbbd9ecb02db8ca91ce8a97e5867b8cce7d5 +Subproject commit b9855dbe16424edc528a6796ddbc50b1042482c7