From 7227c89847a5472f322ae6a0702027dda18b0bc7 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 19 Jun 2022 20:08:46 +0200 Subject: [PATCH 01/55] Namespace `lmms` (#6174) This PR places all LMMS symbols into namespaces to eliminate any potential future name collisions between LMMS and third-party modules. Also, this PR changes back `LmmsCore` to `Engine`, reverting c5199213068cdce59ddc2cffab07f5bcdecfc325 . Co-authored-by: allejok96 --- 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 +- data/themes/classic/style.css | 160 +++++++++-------- data/themes/default/style.css | 168 +++++++++--------- include/AboutDialog.h | 3 + include/ActionGroup.h | 5 + include/AudioAlsa.h | 6 +- include/AudioAlsaSetupWidget.h | 9 +- include/AudioDevice.h | 8 +- include/AudioDeviceSetupWidget.h | 3 + include/AudioDummy.h | 7 +- include/AudioEngine.h | 14 +- include/AudioEngineProfiler.h | 5 + include/AudioEngineWorkerThread.h | 7 +- include/AudioFileDevice.h | 3 + include/AudioFileFlac.h | 6 + include/AudioFileMP3.h | 6 +- include/AudioFileOgg.h | 6 +- include/AudioFileWave.h | 5 + include/AudioJack.h | 18 +- include/AudioOss.h | 20 ++- include/AudioPort.h | 4 + include/AudioPortAudio.h | 48 +++-- include/AudioPulseAudio.h | 16 +- include/AudioSampleRecorder.h | 4 + include/AudioSdl.h | 9 +- include/AudioSndio.h | 15 +- include/AudioSoundIo.h | 11 +- include/AutomatableButton.h | 3 + include/AutomatableModel.h | 9 +- include/AutomatableModelView.h | 5 + include/AutomatableSlider.h | 3 + include/AutomationClip.h | 17 +- include/AutomationClipView.h | 10 ++ include/AutomationEditor.h | 18 +- include/AutomationNode.h | 4 + include/AutomationTrack.h | 6 +- include/AutomationTrackView.h | 10 ++ include/BandLimitedWave.h | 4 + include/BasicFilters.h | 5 + include/BufferManager.h | 12 +- include/CPULoadWidget.h | 6 + include/CaptionMenu.h | 5 +- include/Clip.h | 15 +- include/ClipView.h | 13 +- include/Clipboard.h | 6 +- include/ColorChooser.h | 13 ++ include/ComboBox.h | 5 + include/ComboBoxModel.h | 3 + include/ConfigManager.h | 12 +- include/ControlLayout.h | 10 +- include/Controller.h | 19 +- include/ControllerConnection.h | 13 +- include/ControllerConnectionDialog.h | 14 +- include/ControllerDialog.h | 10 ++ include/ControllerRackView.h | 20 ++- include/ControllerView.h | 9 +- include/Controls.h | 36 ++-- include/CustomTextKnob.h | 7 + include/DataFile.h | 9 +- include/Delay.h | 6 + include/DeprecationHelper.h | 6 + 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 | 16 +- include/EffectChain.h | 14 +- include/EffectControlDialog.h | 10 ++ include/EffectControls.h | 13 +- include/EffectRackView.h | 11 +- include/EffectSelectDialog.h | 5 + include/EffectView.h | 12 +- include/Engine.h | 36 ++-- include/EnvelopeAndLfoParameters.h | 13 +- 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 | 21 ++- include/FileDialog.h | 9 +- include/Graph.h | 17 +- include/GroupBox.h | 3 + include/GuiApplication.h | 5 + include/ImportFilter.h | 5 + include/InlineAutomation.h | 4 + include/Instrument.h | 6 + include/InstrumentFunctionViews.h | 16 +- include/InstrumentFunctions.h | 15 +- include/InstrumentMidiIOView.h | 16 +- include/InstrumentMiscView.h | 13 +- include/InstrumentPlayHandle.h | 6 + include/InstrumentSoundShaping.h | 12 +- include/InstrumentSoundShapingView.h | 6 + include/InstrumentTrack.h | 32 +++- 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 | 8 +- 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 | 25 ++- include/LinkedModelGroups.h | 12 +- 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 | 10 +- include/Lv2Proc.h | 7 + include/Lv2SubPluginFeatures.h | 7 + include/Lv2UridCache.h | 8 + include/Lv2UridMap.h | 8 + include/Lv2ViewBase.h | 26 ++- include/MainApplication.h | 8 + include/MainWindow.h | 13 ++ 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 | 11 +- include/MidiApple.h | 9 +- include/MidiCCRackView.h | 14 +- include/MidiClient.h | 7 +- include/MidiClip.h | 16 +- include/MidiClipView.h | 20 ++- include/MidiController.h | 14 +- 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 | 19 +- include/MidiPortMenu.h | 3 + include/MidiSetupWidget.h | 7 + include/MidiSndio.h | 12 +- include/MidiWinMM.h | 9 +- include/MixHelpers.h | 8 +- include/Mixer.h | 6 + include/MixerLine.h | 14 +- include/MixerLineLcdSpinBox.h | 7 + include/MixerView.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 | 8 +- include/OutputSettings.h | 8 + include/PathUtil.h | 28 ++- include/PatternClip.h | 6 +- include/PatternClipView.h | 8 + include/PatternEditor.h | 15 +- include/PatternStore.h | 11 +- include/PatternTrack.h | 19 +- include/PatternTrackView.h | 11 ++ include/PeakController.h | 16 +- include/PerfLog.h | 7 + include/Piano.h | 7 + include/PianoRoll.h | 32 +++- include/PianoView.h | 9 + include/Pitch.h | 7 + include/PixmapButton.h | 6 + include/PlayHandle.h | 4 + include/Plugin.h | 19 +- include/PluginBrowser.h | 4 + include/PluginFactory.h | 6 + include/PluginIssue.h | 7 + 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/RaiiHelpers.h | 6 + include/RecentProjectsMenu.h | 31 ++++ include/RemotePlugin.h | 12 +- include/RemotePluginBase.h | 21 ++- include/RemotePluginClient.h | 5 + 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 | 8 +- include/SampleClip.h | 17 +- include/SampleClipView.h | 12 ++ include/SamplePlayHandle.h | 6 + include/SampleRecordHandle.h | 6 + include/SampleTrack.h | 19 +- include/SampleTrackView.h | 13 +- include/SampleTrackWindow.h | 9 +- include/Scale.h | 6 + include/SendButtonIndicator.h | 36 ++++ include/SerializingObject.h | 5 + include/SetupDialog.h | 9 + include/SharedMemory.h | 10 +- include/SideBar.h | 6 + include/SideBarWidget.h | 6 + include/Song.h | 29 ++- include/SongEditor.h | 21 ++- include/StepRecorder.h | 21 ++- include/StepRecorderWidget.h | 7 +- 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 | 31 ++++ include/TempoSyncKnob.h | 5 + include/TempoSyncKnobModel.h | 19 +- include/TextFloat.h | 5 + include/ThreadableJob.h | 5 + include/TimeDisplayWidget.h | 4 + include/TimeLineWidget.h | 11 +- include/TimePos.h | 5 + include/ToolButton.h | 4 + include/ToolPlugin.h | 8 + include/ToolPluginView.h | 11 ++ include/Track.h | 20 ++- include/TrackContainer.h | 13 +- include/TrackContainerView.h | 43 +++-- include/TrackContentWidget.h | 17 +- include/TrackLabelButton.h | 6 + include/TrackOperationsWidget.h | 8 +- include/TrackRenameLineEdit.h | 5 + include/TrackView.h | 17 +- include/ValueBuffer.h | 7 + include/VersionedSaveDialog.h | 7 + include/VstSyncController.h | 6 + include/VstSyncData.h | 7 + include/aeffectx.h | 2 +- include/base64.h | 6 +- include/denormals.h | 26 ++- include/embed.h | 8 +- 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 + 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 +- .../AudioFileProcessor/AudioFileProcessor.cpp | 28 +-- .../AudioFileProcessor/AudioFileProcessor.h | 52 ++++-- plugins/BassBooster/BassBooster.cpp | 6 + plugins/BassBooster/BassBooster.h | 5 + .../BassBooster/BassBoosterControlDialog.cpp | 6 + .../BassBooster/BassBoosterControlDialog.h | 9 + plugins/BassBooster/BassBoosterControls.cpp | 6 +- plugins/BassBooster/BassBoosterControls.h | 11 +- plugins/BitInvader/BitInvader.cpp | 15 +- plugins/BitInvader/BitInvader.h | 18 +- 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 +- plugins/CarlaBase/Carla.cpp | 38 +++- plugins/CarlaBase/Carla.h | 152 +++++++++------- plugins/CarlaPatchbay/CarlaPatchbay.cpp | 7 + plugins/CarlaRack/CarlaRack.cpp | 7 + plugins/Compressor/Compressor.cpp | 6 + plugins/Compressor/Compressor.h | 9 +- .../Compressor/CompressorControlDialog.cpp | 7 + plugins/Compressor/CompressorControlDialog.h | 27 ++- plugins/Compressor/CompressorControls.cpp | 3 + plugins/Compressor/CompressorControls.h | 11 +- plugins/CrossoverEQ/CrossoverEQ.cpp | 7 + plugins/CrossoverEQ/CrossoverEQ.h | 7 + .../CrossoverEQ/CrossoverEQControlDialog.cpp | 7 + .../CrossoverEQ/CrossoverEQControlDialog.h | 13 ++ plugins/CrossoverEQ/CrossoverEQControls.cpp | 7 + plugins/CrossoverEQ/CrossoverEQControls.h | 12 +- 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 | 6 + plugins/Delay/Lfo.cpp | 6 +- plugins/Delay/Lfo.h | 7 + plugins/Delay/StereoDelay.cpp | 8 +- plugins/Delay/StereoDelay.h | 7 + plugins/DualFilter/DualFilter.cpp | 6 + plugins/DualFilter/DualFilter.h | 7 + .../DualFilter/DualFilterControlDialog.cpp | 14 +- plugins/DualFilter/DualFilterControlDialog.h | 11 ++ plugins/DualFilter/DualFilterControls.cpp | 8 +- plugins/DualFilter/DualFilterControls.h | 13 +- .../DynamicsProcessor/DynamicsProcessor.cpp | 6 + plugins/DynamicsProcessor/DynamicsProcessor.h | 6 +- .../DynamicsProcessorControlDialog.cpp | 5 + .../DynamicsProcessorControlDialog.h | 11 ++ .../DynamicsProcessorControls.cpp | 6 +- .../DynamicsProcessorControls.h | 13 +- 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 | 16 +- plugins/Eq/EqSpectrumView.cpp | 11 ++ plugins/Eq/EqSpectrumView.h | 12 +- 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 + plugins/FreeBoy/FreeBoy.cpp | 16 +- plugins/FreeBoy/FreeBoy.h | 25 ++- plugins/FreeBoy/Gb_Apu_Buffer.cpp | 6 + plugins/FreeBoy/Gb_Apu_Buffer.h | 7 + plugins/GigPlayer/GigPlayer.cpp | 15 +- plugins/GigPlayer/GigPlayer.h | 28 ++- plugins/GigPlayer/PatchesDialog.cpp | 6 + plugins/GigPlayer/PatchesDialog.h | 7 + plugins/HydrogenImport/HydrogenImport.cpp | 7 + plugins/HydrogenImport/HydrogenImport.h | 9 +- plugins/HydrogenImport/LocalFileMng.h | 8 + plugins/HydrogenImport/local_file_mgr.cpp | 5 + plugins/Kicker/Kicker.cpp | 15 +- plugins/Kicker/Kicker.h | 23 ++- plugins/Kicker/KickerOsc.h | 5 + plugins/LadspaBrowser/LadspaBrowser.cpp | 16 +- plugins/LadspaBrowser/LadspaBrowser.h | 22 ++- plugins/LadspaBrowser/LadspaDescription.cpp | 7 +- plugins/LadspaBrowser/LadspaDescription.h | 7 +- plugins/LadspaBrowser/LadspaPortDialog.cpp | 7 +- plugins/LadspaBrowser/LadspaPortDialog.h | 5 +- plugins/LadspaEffect/LadspaControlDialog.cpp | 9 +- plugins/LadspaEffect/LadspaControlDialog.h | 17 +- plugins/LadspaEffect/LadspaControls.cpp | 6 +- plugins/LadspaEffect/LadspaControls.h | 14 +- plugins/LadspaEffect/LadspaEffect.cpp | 7 +- plugins/LadspaEffect/LadspaEffect.h | 6 + .../LadspaEffect/LadspaSubPluginFeatures.cpp | 5 + .../LadspaEffect/LadspaSubPluginFeatures.h | 8 +- plugins/Lb302/Lb302.cpp | 13 +- plugins/Lb302/Lb302.h | 25 ++- 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 +- plugins/Lv2Instrument/Lv2Instrument.cpp | 14 +- plugins/Lv2Instrument/Lv2Instrument.h | 24 ++- plugins/MidiExport/MidiExport.cpp | 6 + plugins/MidiExport/MidiExport.h | 7 +- plugins/MidiImport/MidiImport.cpp | 16 +- plugins/MidiImport/MidiImport.h | 7 +- plugins/Monstro/Monstro.cpp | 19 +- plugins/Monstro/Monstro.h | 31 +++- plugins/MultitapEcho/MultitapEcho.cpp | 7 + plugins/MultitapEcho/MultitapEcho.h | 6 + .../MultitapEchoControlDialog.cpp | 6 + .../MultitapEcho/MultitapEchoControlDialog.h | 13 ++ plugins/MultitapEcho/MultitapEchoControls.cpp | 6 + plugins/MultitapEcho/MultitapEchoControls.h | 11 +- plugins/Nes/Nes.cpp | 15 +- plugins/Nes/Nes.h | 26 ++- plugins/OpulenZ/OpulenZ.cpp | 13 +- plugins/OpulenZ/OpulenZ.h | 20 ++- plugins/Organic/Organic.cpp | 18 +- plugins/Organic/Organic.h | 24 ++- plugins/Patman/Patman.cpp | 16 +- plugins/Patman/Patman.h | 17 +- .../PeakControllerEffect.cpp | 6 + .../PeakControllerEffect.h | 7 + .../PeakControllerEffectControlDialog.cpp | 4 + .../PeakControllerEffectControlDialog.h | 9 + .../PeakControllerEffectControls.cpp | 7 +- .../PeakControllerEffectControls.h | 13 +- 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 +- plugins/Sf2Player/PatchesDialog.cpp | 5 +- plugins/Sf2Player/PatchesDialog.h | 5 + plugins/Sf2Player/Sf2Player.cpp | 15 +- plugins/Sf2Player/Sf2Player.h | 36 ++-- plugins/Sf2Player/fluidsynthshims.h | 1 + plugins/Sfxr/Sfxr.cpp | 17 +- plugins/Sfxr/Sfxr.h | 19 +- plugins/Sid/SidInstrument.cpp | 16 +- plugins/Sid/SidInstrument.h | 24 ++- 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 | 12 +- 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 | 15 +- plugins/StereoEnhancer/StereoEnhancer.cpp | 6 + plugins/StereoEnhancer/StereoEnhancer.h | 5 + .../StereoEnhancerControlDialog.cpp | 6 +- .../StereoEnhancerControlDialog.h | 10 ++ .../StereoEnhancer/StereoEnhancerControls.cpp | 7 +- .../StereoEnhancer/StereoEnhancerControls.h | 12 +- plugins/StereoMatrix/StereoMatrix.cpp | 7 + plugins/StereoMatrix/StereoMatrix.h | 7 +- .../StereoMatrixControlDialog.cpp | 5 + .../StereoMatrix/StereoMatrixControlDialog.h | 10 ++ plugins/StereoMatrix/StereoMatrixControls.cpp | 6 + plugins/StereoMatrix/StereoMatrixControls.h | 12 +- plugins/Stk/Mallets/Mallets.cpp | 16 +- plugins/Stk/Mallets/Mallets.h | 24 ++- plugins/TripleOscillator/TripleOscillator.cpp | 14 +- plugins/TripleOscillator/TripleOscillator.h | 28 ++- 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 | 10 ++ plugins/Vectorscope/Vectorscope.cpp | 5 + plugins/Vectorscope/Vectorscope.h | 6 + plugins/Vestige/Vestige.cpp | 42 ++++- plugins/Vestige/Vestige.h | 33 +++- plugins/Vibed/NineButtonSelector.cpp | 6 + plugins/Vibed/NineButtonSelector.h | 15 +- plugins/Vibed/StringContainer.cpp | 6 + plugins/Vibed/StringContainer.h | 6 + plugins/Vibed/Vibed.cpp | 25 +-- plugins/Vibed/Vibed.h | 40 +++-- plugins/Vibed/VibratingString.cpp | 5 + plugins/Vibed/VibratingString.h | 7 + plugins/VstBase/RemoteVstPlugin.cpp | 34 ++-- plugins/VstBase/VstPlugin.cpp | 26 +-- plugins/VstBase/VstPlugin.h | 7 +- plugins/VstBase/communication.h | 5 +- plugins/VstBase/vst_base.cpp | 5 + plugins/VstEffect/VstEffect.cpp | 12 +- plugins/VstEffect/VstEffect.h | 10 +- plugins/VstEffect/VstEffectControlDialog.cpp | 6 + plugins/VstEffect/VstEffectControlDialog.h | 19 +- plugins/VstEffect/VstEffectControls.cpp | 16 +- plugins/VstEffect/VstEffectControls.h | 30 +++- plugins/VstEffect/VstSubPluginFeatures.cpp | 4 + plugins/VstEffect/VstSubPluginFeatures.h | 6 +- plugins/Watsyn/Watsyn.cpp | 13 +- plugins/Watsyn/Watsyn.h | 23 ++- plugins/WaveShaper/WaveShaper.cpp | 6 + plugins/WaveShaper/WaveShaper.h | 4 +- .../WaveShaper/WaveShaperControlDialog.cpp | 5 + plugins/WaveShaper/WaveShaperControlDialog.h | 10 ++ plugins/WaveShaper/WaveShaperControls.cpp | 6 +- plugins/WaveShaper/WaveShaperControls.h | 13 +- plugins/Xpressive/ExprSynth.cpp | 8 + plugins/Xpressive/ExprSynth.h | 13 +- plugins/Xpressive/Xpressive.cpp | 135 +++++++------- plugins/Xpressive/Xpressive.h | 41 +++-- plugins/ZynAddSubFx/LocalZynAddSubFx.cpp | 8 +- plugins/ZynAddSubFx/LocalZynAddSubFx.h | 10 +- plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp | 1 + plugins/ZynAddSubFx/RemoteZynAddSubFx.h | 9 +- plugins/ZynAddSubFx/ZynAddSubFx.cpp | 28 ++- plugins/ZynAddSubFx/ZynAddSubFx.h | 48 +++-- plugins/ZynAddSubFx/zynaddsubfx | 2 +- src/common/RemotePluginBase.cpp | 6 + src/common/SharedMemory.cpp | 6 +- src/core/AudioEngine.cpp | 6 + src/core/AudioEngineProfiler.cpp | 3 + src/core/AudioEngineWorkerThread.cpp | 5 +- src/core/AutomatableModel.cpp | 12 +- src/core/AutomationClip.cpp | 13 +- src/core/AutomationNode.cpp | 5 + src/core/BandLimitedWave.cpp | 5 + src/core/BufferManager.cpp | 14 +- src/core/Clip.cpp | 6 +- src/core/Clipboard.cpp | 7 +- src/core/ComboBoxModel.cpp | 5 +- src/core/ConfigManager.cpp | 16 +- src/core/Controller.cpp | 13 +- src/core/ControllerConnection.cpp | 5 +- src/core/DataFile.cpp | 27 ++- src/core/DrumSynth.cpp | 5 + src/core/Effect.cpp | 8 +- src/core/EffectChain.cpp | 6 + src/core/Engine.cpp | 53 +++--- src/core/EnvelopeAndLfoParameters.cpp | 5 +- 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 | 9 +- 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/Mixer.cpp | 7 + 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/PatternClip.cpp | 10 +- src/core/PatternStore.cpp | 4 + src/core/PeakController.cpp | 11 +- src/core/PerfLog.cpp | 8 + src/core/Piano.cpp | 6 + src/core/PlayHandle.cpp | 5 + src/core/Plugin.cpp | 14 +- src/core/PluginFactory.cpp | 18 +- src/core/PluginIssue.cpp | 9 +- src/core/PresetPreviewPlayHandle.cpp | 5 +- src/core/ProjectJournal.cpp | 4 + src/core/ProjectRenderer.cpp | 6 + src/core/ProjectVersion.cpp | 5 + src/core/RemotePlugin.cpp | 6 + src/core/RenderManager.cpp | 7 + src/core/RingBuffer.cpp | 4 + src/core/SampleBuffer.cpp | 10 +- src/core/SampleClip.cpp | 16 +- src/core/SamplePlayHandle.cpp | 5 +- src/core/SampleRecordHandle.cpp | 6 +- src/core/Scale.cpp | 6 + src/core/SerializingObject.cpp | 5 +- src/core/Song.cpp | 16 +- src/core/StepRecorder.cpp | 8 +- src/core/TempoSyncKnobModel.cpp | 14 +- src/core/TimePos.cpp | 6 + src/core/ToolPlugin.cpp | 6 + src/core/Track.cpp | 14 +- src/core/TrackContainer.cpp | 14 +- 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 | 7 +- 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 | 12 +- src/core/audio/AudioOss.cpp | 8 +- src/core/audio/AudioPort.cpp | 4 + src/core/audio/AudioPortAudio.cpp | 14 ++ 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/main.cpp | 10 +- src/core/midi/MidiAlsaRaw.cpp | 8 +- src/core/midi/MidiAlsaSeq.cpp | 12 +- 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 | 7 +- 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/ActionGroup.cpp | 5 + src/gui/AudioAlsaSetupWidget.cpp | 4 + src/gui/AudioDeviceSetupWidget.cpp | 4 + src/gui/AutomatableModelView.cpp | 11 +- src/gui/ControlLayout.cpp | 5 + src/gui/ControllerDialog.cpp | 5 +- src/gui/ControllerRackView.cpp | 13 +- src/gui/ControllerView.cpp | 6 + src/gui/Controls.cpp | 4 + src/gui/EffectControlDialog.cpp | 7 +- src/gui/EffectRackView.cpp | 17 +- src/gui/EffectView.cpp | 5 + src/gui/FileBrowser.cpp | 7 + src/gui/GuiApplication.cpp | 23 ++- src/gui/LadspaControlView.cpp | 6 +- src/gui/LfoControllerDialog.cpp | 5 + src/gui/LinkedModelGroupViews.cpp | 4 + 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/MicrotunerConfig.cpp | 6 + src/gui/MidiCCRackView.cpp | 6 + src/gui/MidiSetupWidget.cpp | 8 + src/gui/MixerLine.cpp | 7 + src/gui/MixerView.cpp | 7 + src/gui/ModelView.cpp | 3 + src/gui/PeakControllerDialog.cpp | 4 + src/gui/PluginBrowser.cpp | 10 +- src/gui/ProjectNotes.cpp | 5 + src/gui/RowTableView.cpp | 7 +- src/gui/SampleTrackWindow.cpp | 8 +- src/gui/SendButtonIndicator.cpp | 7 + src/gui/SideBar.cpp | 6 +- src/gui/SideBarWidget.cpp | 7 +- src/gui/StringPairDrag.cpp | 7 + src/gui/SubWindow.cpp | 5 + src/gui/ToolPluginView.cpp | 4 + src/gui/clips/AutomationClipView.cpp | 6 + src/gui/clips/ClipView.cpp | 6 + src/gui/clips/MidiClipView.cpp | 7 + src/gui/clips/PatternClipView.cpp | 7 + src/gui/clips/SampleClipView.cpp | 7 + src/gui/editors/AutomationEditor.cpp | 14 +- src/gui/editors/Editor.cpp | 5 + src/gui/editors/PatternEditor.cpp | 5 + src/gui/editors/PianoRoll.cpp | 42 +++-- src/gui/editors/PositionLine.cpp | 6 + src/gui/editors/Rubberband.cpp | 9 +- src/gui/editors/SongEditor.cpp | 15 +- src/gui/editors/StepRecorderWidget.cpp | 5 + src/gui/editors/TimeLineWidget.cpp | 6 + src/gui/editors/TrackContainerView.cpp | 58 +++--- src/gui/embed.cpp | 6 +- src/gui/instrument/EnvelopeAndLfoView.cpp | 8 + .../instrument/InstrumentFunctionViews.cpp | 5 +- src/gui/instrument/InstrumentMidiIOView.cpp | 5 + src/gui/instrument/InstrumentMiscView.cpp | 7 + .../instrument/InstrumentSoundShapingView.cpp | 5 +- src/gui/instrument/InstrumentTrackWindow.cpp | 17 ++ src/gui/instrument/InstrumentView.cpp | 4 + src/gui/instrument/PianoView.cpp | 6 +- src/gui/menus/MidiPortMenu.cpp | 4 +- src/gui/menus/RecentProjectsMenu.cpp | 7 + src/gui/menus/TemplatesMenu.cpp | 8 + src/gui/modals/AboutDialog.cpp | 4 + src/gui/modals/ColorChooser.cpp | 5 + src/gui/modals/ControllerConnectionDialog.cpp | 8 +- src/gui/modals/EffectSelectDialog.cpp | 8 +- src/gui/modals/EffectSelectDialog.ui | 2 +- src/gui/modals/ExportProjectDialog.cpp | 4 + src/gui/modals/FileDialog.cpp | 6 + src/gui/modals/RenameDialog.cpp | 5 + src/gui/modals/SetupDialog.cpp | 7 + src/gui/modals/VersionedSaveDialog.cpp | 7 + src/gui/tracks/AutomationTrackView.cpp | 10 +- src/gui/tracks/FadeButton.cpp | 6 + src/gui/tracks/InstrumentTrackView.cpp | 6 + src/gui/tracks/PatternTrackView.cpp | 6 + src/gui/tracks/SampleTrackView.cpp | 7 + src/gui/tracks/TrackContentWidget.cpp | 10 +- src/gui/tracks/TrackLabelButton.cpp | 6 +- src/gui/tracks/TrackOperationsWidget.cpp | 9 +- src/gui/tracks/TrackRenameLineEdit.cpp | 5 + src/gui/tracks/TrackView.cpp | 10 +- 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/CustomTextKnob.cpp | 7 + src/gui/widgets/Fader.cpp | 6 + src/gui/widgets/Graph.cpp | 13 +- src/gui/widgets/GroupBox.cpp | 6 + src/gui/widgets/Knob.cpp | 7 + 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 | 6 + src/gui/widgets/MeterDialog.cpp | 5 + src/gui/widgets/MixerLineLcdSpinBox.cpp | 7 + src/gui/widgets/NStateButton.cpp | 6 + src/gui/widgets/Oscilloscope.cpp | 13 +- src/gui/widgets/PixmapButton.cpp | 6 +- src/gui/widgets/TabBar.cpp | 10 +- src/gui/widgets/TabWidget.cpp | 6 + src/gui/widgets/TempoSyncKnob.cpp | 8 +- src/gui/widgets/TextFloat.cpp | 5 +- src/gui/widgets/TimeDisplayWidget.cpp | 4 + src/gui/widgets/ToolButton.cpp | 6 + src/tracks/AutomationTrack.cpp | 10 +- src/tracks/InstrumentTrack.cpp | 11 +- src/tracks/MidiClip.cpp | 30 ++-- src/tracks/PatternTrack.cpp | 10 +- src/tracks/SampleTrack.cpp | 13 +- tests/check-strings/check-strings | 20 ++- 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 ++ 804 files changed, 6609 insertions(+), 1478 deletions(-) diff --git a/data/locale/ar.ts b/data/locale/ar.ts index 8e989509d..1f159c42a 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 013585b5f..506b401bd 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 3512b4871..765cf3b60 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 7951c75b9..0ed175022 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 ef4d94634..51ca7d562 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 b543854d3..320a6657f 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 b58d27f30..e52ae39ab 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 b133d8029..005ee8100 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 8fb164421..4fc4951ef 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 9642a3ff2..25c165f81 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 4e72345fd..181ca0ca1 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 85f443309..2c65444a8 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 38a80a5da..cf04fd5d4 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 783b473b7..ee5a23613 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 5ba65acd6..15550231f 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 f82ff12c4..836059946 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 b55f6c98c..e381ea726 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 29865352a..ff146d471 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 28fda3123..e10ca5118 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 b48b3f2b0..1956d8d04 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 78cfbdd5c..7373b5ca9 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 533efdcad..209d51d10 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 41865ef0c..3675b7f58 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 2eaa6b154..ad630a249 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 8df1aa1a1..58c81c964 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 340be33d8..bb0c64ede 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 f94f22920..b375e289f 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 ca148f452..eceb45a64 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 40e385d2c..8235f291f 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 dd9680976..3ad55a4c0 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 a8c1fd96d..9b90164ab 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 882524c50..4963b07a9 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 fa4ccb696..387be6d8b 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 84cc81899..50df10e4b 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 301d54362..63b22df99 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 a190c831c..791a45599 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 diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css index ea3cbf4a2..58ec5dc09 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 */ -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,50 +565,52 @@ 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 */ -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, @@ -620,13 +622,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 @@ -654,7 +656,7 @@ QTreeView { alternate-background-color: #747474; } -TrackContainerView QLabel +lmms--gui--TrackContainerView QLabel { background: none; } @@ -662,7 +664,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 ); @@ -679,7 +681,7 @@ ClipView { } /* MIDI (instrument) clip */ -MidiClipView { +lmms--gui--MidiClipView { background-color: rgb( 119, 199, 216 ); color: rgb( 187, 227, 236 ); @@ -690,24 +692,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, @@ -717,21 +719,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% ); @@ -742,7 +744,7 @@ SubWindow > QPushButton:hover{ /* Plugins */ -TripleOscillatorView Knob { +lmms--gui--TripleOscillatorView lmms--gui--Knob { color: rgb(255, 255, 255); qproperty-outerColor: rgb(255, 255, 255); qproperty-innerRadius: 2; @@ -753,7 +755,7 @@ TripleOscillatorView Knob { } -KickerInstrumentView Knob#smallKnob { +lmms--gui--KickerInstrumentView lmms--gui--Knob#smallKnob { color: #595959; qproperty-outerColor: black; qproperty-innerRadius: 3; @@ -764,7 +766,7 @@ KickerInstrumentView Knob#smallKnob { } -KickerInstrumentView Knob#largeKnob { +lmms--gui--KickerInstrumentView lmms--gui--Knob#largeKnob { color: #0c3b89; qproperty-outerColor: #519fff; qproperty-innerRadius: 12.0; @@ -775,7 +777,7 @@ KickerInstrumentView Knob#largeKnob { } -AudioFileProcessorView Knob { +lmms--gui--AudioFileProcessorView lmms--gui--Knob { color: rgb(240, 147, 14); qproperty-outerColor: rgb(30, 35, 37); qproperty-innerRadius: 4; @@ -785,7 +787,7 @@ AudioFileProcessorView Knob { qproperty-lineWidth: 3; } -OrganicInstrumentView Knob { +lmms--gui--OrganicInstrumentView lmms--gui--Knob { color: rgb(124, 207, 98); qproperty-outerColor: rgb(13, 42, 4); qproperty-innerRadius: 2; @@ -795,13 +797,13 @@ OrganicInstrumentView Knob { qproperty-lineWidth: 1.5; } -OrganicInstrumentView Knob#harmKnob { +lmms--gui--OrganicInstrumentView lmms--gui--Knob#harmKnob { color: rgb(205, 98, 216); qproperty-outerColor: rgb(18, 4, 18); } -OrganicInstrumentView Knob#fx1Knob, -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; @@ -811,7 +813,7 @@ OrganicInstrumentView Knob#volKnob { qproperty-lineWidth: 2; } -Sf2InstrumentView Knob { +lmms--gui--Sf2InstrumentView lmms--gui--Knob { color: #ff00ea; qproperty-outerColor: rgb(20, 5, 18); qproperty-innerRadius: 2; @@ -821,7 +823,7 @@ Sf2InstrumentView Knob { qproperty-lineWidth: 2; } -SfxrInstrumentView Knob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob { color: #000; qproperty-outerColor: rgb(194, 177, 145); qproperty-innerRadius: 2; @@ -829,42 +831,42 @@ SfxrInstrumentView Knob { qproperty-lineWidth: 2; } -SfxrInstrumentView Knob#envKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#envKnob { color: #263352; qproperty-outerColor: #4b66a4; } -SfxrInstrumentView Knob#freqKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#freqKnob { color: #1e4a22; qproperty-outerColor: #3c9544; } -SfxrInstrumentView Knob#changeKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#changeKnob { color: #591c1c; qproperty-outerColor: #b23737; } -SfxrInstrumentView Knob#sqrKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#sqrKnob { color: #3b2714; qproperty-outerColor: #724c27; } -SfxrInstrumentView Knob#repeatKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#repeatKnob { color: #292929; qproperty-outerColor: #515151; } -SfxrInstrumentView Knob#phaserKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#phaserKnob { color: #144c4d; qproperty-outerColor: #299899; } -SfxrInstrumentView Knob#filterKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#filterKnob { color: #47224c; qproperty-outerColor: #8e4397; } -OpulenzInstrumentView Knob { +lmms--gui--OpulenzInstrumentView lmms--gui--Knob { color: rgb(128,128,128); qproperty-outerColor: rgb(255,255,255); qproperty-innerRadius: 2; @@ -872,7 +874,7 @@ OpulenzInstrumentView Knob { qproperty-lineWidth: 2; } -SidInstrumentView Knob { +lmms--gui--SidInstrumentView lmms--gui--Knob { color: rgb(113,95,80); qproperty-outerColor: rgb( 255,255,255 ); qproperty-innerRadius: 2; @@ -880,7 +882,7 @@ SidInstrumentView Knob { qproperty-lineWidth: 2; } -WatsynView Knob { +lmms--gui--WatsynView lmms--gui--Knob { qproperty-innerRadius: 1; qproperty-outerRadius: 7; qproperty-centerPointX: 9.5; @@ -888,17 +890,17 @@ WatsynView Knob { qproperty-lineWidth: 2; } -WatsynView Knob#aKnob { +lmms--gui--WatsynView lmms--gui--Knob#aKnob { color: #43b2ff; qproperty-outerColor: #43b2ff; } -WatsynView Knob#bKnob { +lmms--gui--WatsynView lmms--gui--Knob#bKnob { color: #fc5431; qproperty-outerColor: #fc5431; } -WatsynView Knob#mixKnob { +lmms--gui--WatsynView lmms--gui--Knob#mixKnob { color: #43ff82; qproperty-outerColor: #43ff82; qproperty-outerRadius: 13; @@ -906,17 +908,17 @@ WatsynView Knob#mixKnob { qproperty-centerPointY: 15.5; } -WatsynView Knob#mixenvKnob { +lmms--gui--WatsynView lmms--gui--Knob#mixenvKnob { color: #43ff82; qproperty-outerColor: #43ff82; } -WatsynView Knob#xtalkKnob { +lmms--gui--WatsynView lmms--gui--Knob#xtalkKnob { color: #fb50fb; qproperty-outerColor: #fb50fb; } -MonstroView Knob { +lmms--gui--MonstroView lmms--gui--Knob { color: #ffffff; qproperty-outerColor: #aaaaaa; qproperty-outerRadius: 9; @@ -926,7 +928,7 @@ MonstroView Knob { qproperty-lineWidth: 2.5; } -NesInstrumentView Knob { +lmms--gui--NesInstrumentView lmms--gui--Knob { color: #e7231b; qproperty-outerColor: #fff; qproperty-outerRadius: 11.0; @@ -936,7 +938,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); @@ -950,7 +952,7 @@ CompressorControlDialog { qproperty-resetColor: rgba(200, 100, 15, 200); } -CompressorControlDialog Knob { +lmms--gui--CompressorControlDialog lmms--gui--Knob { color: #2fcc71; qproperty-outerColor: #2fcc71; qproperty-lineWidth: 2; @@ -958,7 +960,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 b10e493e7..f4c651c9e 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 */ -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,7 +620,7 @@ SideBar QToolButton:checked { /* Instrument plugin list */ -PluginDescWidget { +lmms--gui--PluginDescWidget { border-top: 1px solid #3E474F; border-bottom: 1px solid #101314; border-radius: 2px; @@ -630,24 +630,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; @@ -658,13 +660,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 @@ -700,7 +702,7 @@ QTreeView { alternate-background-color: #111314; } -TrackContainerView QLabel +lmms--gui--TrackContainerView QLabel { background: none; } @@ -708,7 +710,7 @@ TrackContainerView QLabel /* Clips */ /* common clip colors */ -ClipView { +lmms--gui--ClipView { qproperty-mutedColor: rgba(255,255,255,100); qproperty-mutedBackgroundColor: #373d48; qproperty-selectedColor: #006B65; @@ -725,7 +727,7 @@ ClipView { } /* MIDI (instrument) clip */ -MidiClipView { +lmms--gui--MidiClipView { background-color: #21A14F; color: rgba(255,255,255,220); @@ -736,24 +738,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; @@ -761,21 +763,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% ); @@ -786,7 +788,7 @@ SubWindow > QPushButton:hover{ /* Plugins */ -TripleOscillatorView Knob { +lmms--gui--TripleOscillatorView lmms--gui--Knob { color: rgb(255,255,255); qproperty-outerColor: rgb(255,255,255); qproperty-innerRadius: 2; @@ -797,7 +799,7 @@ TripleOscillatorView Knob { } -KickerInstrumentView Knob#smallKnob { +lmms--gui--KickerInstrumentView lmms--gui--Knob#smallKnob { color: #595959; qproperty-outerColor: black; qproperty-innerRadius: 3; @@ -808,7 +810,7 @@ KickerInstrumentView Knob#smallKnob { } -KickerInstrumentView Knob#largeKnob { +lmms--gui--KickerInstrumentView lmms--gui--Knob#largeKnob { color: #0c3b89; qproperty-outerColor: #519fff; qproperty-innerRadius: 12.0; @@ -819,7 +821,7 @@ KickerInstrumentView Knob#largeKnob { } -AudioFileProcessorView Knob { +lmms--gui--AudioFileProcessorView lmms--gui--Knob { color: rgb(240, 147, 14); qproperty-outerColor: rgb(30, 35, 37); qproperty-innerRadius: 4; @@ -829,7 +831,7 @@ AudioFileProcessorView Knob { qproperty-lineWidth: 3; } -OrganicInstrumentView Knob { +lmms--gui--OrganicInstrumentView lmms--gui--Knob { color: rgb(124, 207, 98); qproperty-outerColor: rgb(13, 42, 4); qproperty-innerRadius: 2; @@ -839,13 +841,13 @@ OrganicInstrumentView Knob { qproperty-lineWidth: 1.5; } -OrganicInstrumentView Knob#harmKnob { +lmms--gui--OrganicInstrumentView lmms--gui--Knob#harmKnob { color: rgb(205, 98, 216); qproperty-outerColor: rgb(18, 4, 18); } -OrganicInstrumentView Knob#fx1Knob, -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; @@ -855,7 +857,7 @@ OrganicInstrumentView Knob#volKnob { qproperty-lineWidth: 2; } -Sf2InstrumentView Knob { +lmms--gui--Sf2InstrumentView lmms--gui--Knob { color: #ff00ea; qproperty-outerColor: rgb(20, 5, 18); qproperty-innerRadius: 2; @@ -865,7 +867,7 @@ Sf2InstrumentView Knob { qproperty-lineWidth: 2; } -SfxrInstrumentView Knob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob { color: #000; qproperty-outerColor: rgb(194, 177, 145); qproperty-innerRadius: 2; @@ -873,42 +875,42 @@ SfxrInstrumentView Knob { qproperty-lineWidth: 2; } -SfxrInstrumentView Knob#envKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#envKnob { color: #263352; qproperty-outerColor: #4b66a4; } -SfxrInstrumentView Knob#freqKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#freqKnob { color: #1e4a22; qproperty-outerColor: #3c9544; } -SfxrInstrumentView Knob#changeKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#changeKnob { color: #591c1c; qproperty-outerColor: #b23737; } -SfxrInstrumentView Knob#sqrKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#sqrKnob { color: #3b2714; qproperty-outerColor: #724c27; } -SfxrInstrumentView Knob#repeatKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#repeatKnob { color: #292929; qproperty-outerColor: #515151; } -SfxrInstrumentView Knob#phaserKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#phaserKnob { color: #144c4d; qproperty-outerColor: #299899; } -SfxrInstrumentView Knob#filterKnob { +lmms--gui--SfxrInstrumentView lmms--gui--Knob#filterKnob { color: #47224c; qproperty-outerColor: #8e4397; } -OpulenzInstrumentView Knob { +lmms--gui--OpulenzInstrumentView lmms--gui--Knob { color: rgb(128,128,128); qproperty-outerColor: rgb(255,255,255); qproperty-innerRadius: 2; @@ -916,7 +918,7 @@ OpulenzInstrumentView Knob { qproperty-lineWidth: 2; } -SidInstrumentView Knob { +lmms--gui--SidInstrumentView lmms--gui--Knob { color: rgb(113,95,80); qproperty-outerColor: rgb( 255,255,255 ); qproperty-innerRadius: 2; @@ -924,7 +926,7 @@ SidInstrumentView Knob { qproperty-lineWidth: 2; } -WatsynView Knob { +lmms--gui--WatsynView lmms--gui--Knob { qproperty-innerRadius: 1; qproperty-outerRadius: 7; qproperty-centerPointX: 9.5; @@ -932,17 +934,17 @@ WatsynView Knob { qproperty-lineWidth: 2; } -WatsynView Knob#aKnob { +lmms--gui--WatsynView lmms--gui--Knob#aKnob { color: #43b2ff; qproperty-outerColor: #43b2ff; } -WatsynView Knob#bKnob { +lmms--gui--WatsynView lmms--gui--Knob#bKnob { color: #fc5431; qproperty-outerColor: #fc5431; } -WatsynView Knob#mixKnob { +lmms--gui--WatsynView lmms--gui--Knob#mixKnob { color: #43ff82; qproperty-outerColor: #43ff82; qproperty-outerRadius: 13; @@ -950,17 +952,17 @@ WatsynView Knob#mixKnob { qproperty-centerPointY: 15.5; } -WatsynView Knob#mixenvKnob { +lmms--gui--WatsynView lmms--gui--Knob#mixenvKnob { color: #43ff82; qproperty-outerColor: #43ff82; } -WatsynView Knob#xtalkKnob { +lmms--gui--WatsynView lmms--gui--Knob#xtalkKnob { color: #fb50fb; qproperty-outerColor: #fb50fb; } -MonstroView Knob { +lmms--gui--MonstroView lmms--gui--Knob { color: #ffffff; qproperty-outerColor: #aaaaaa; qproperty-outerRadius: 9; @@ -970,7 +972,7 @@ MonstroView Knob { qproperty-lineWidth: 2.5; } -NesInstrumentView Knob { +lmms--gui--NesInstrumentView lmms--gui--Knob { color: #e7231b; qproperty-outerColor: #fff; qproperty-outerRadius: 11.0; @@ -980,7 +982,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); @@ -994,7 +996,7 @@ CompressorControlDialog { qproperty-resetColor: rgba(200, 100, 15, 200); } -CompressorControlDialog Knob { +lmms--gui--CompressorControlDialog lmms--gui--Knob { color: #2fcc71; qproperty-outerColor: #2fcc71; qproperty-lineWidth: 2; @@ -1002,7 +1004,7 @@ CompressorControlDialog Knob { /* palette information */ -LmmsPalette { +lmms--gui--LmmsPalette { qproperty-background: #262b30; qproperty-windowText: #1de276; qproperty-base: #101213; diff --git a/include/AboutDialog.h b/include/AboutDialog.h index 93aca988d..c7d65023f 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 @@ public: } ; +} // namespace lmms::gui #endif diff --git a/include/ActionGroup.h b/include/ActionGroup.h index 226e39136..0fe9d78ed 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: QList m_actions; }; +} // namespace lmms::gui + #endif diff --git a/include/AudioAlsa.h b/include/AudioAlsa.h index c8452d003..e1024b030 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 @@ private: } ; -#endif +} // namespace lmms + +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/AudioAlsaSetupWidget.h b/include/AudioAlsaSetupWidget.h index db88558a7..9e168934e 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 @@ private: AudioAlsa::DeviceInfoCollection m_deviceInfos; }; -#endif +} // namespace lmms::gui + +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/AudioDevice.h b/include/AudioDevice.h index 627ba470c..6b4e9939a 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 @@ private: surroundSampleFrame * m_buffer; -} ; +}; +} // namespace lmms #endif diff --git a/include/AudioDeviceSetupWidget.h b/include/AudioDeviceSetupWidget.h index 9b82300bb..6bf656e0a 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 @@ public: virtual void show(); }; +} // namespace lmms::gui #endif diff --git a/include/AudioDummy.h b/include/AudioDummy.h index a0f2c528e..f2c198bbc 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 @@ public: } - 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 @@ private: } ; +} // namespace lmms #endif diff --git a/include/AudioEngine.h b/include/AudioEngine.h index a86f540cb..08e03a113 100644 --- a/include/AudioEngine.h +++ b/include/AudioEngine.h @@ -39,9 +39,13 @@ #include "PlayHandle.h" +namespace lmms +{ + class AudioDevice; class MidiClient; class AudioPort; +class AudioEngineWorkerThread; const fpp_t MINIMUM_BUFFER_SIZE = 32; @@ -54,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 @@ -361,7 +361,7 @@ public: signals: void qualitySettingsChanged(); void sampleRateChanged(); - void nextAudioBuffer( const surroundSampleFrame * buffer ); + void nextAudioBuffer( const lmms::surroundSampleFrame * buffer ); private: @@ -471,9 +471,11 @@ private: bool m_waitingForWrite; - friend class LmmsCore; + friend class Engine; friend class AudioEngineWorkerThread; friend class ProjectRenderer; } ; +} // namespace lmms + #endif diff --git a/include/AudioEngineProfiler.h b/include/AudioEngineProfiler.h index 19f0b612b..136c6dbea 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 @@ private: QFile m_outputFile; }; +} // namespace lmms + #endif diff --git a/include/AudioEngineWorkerThread.h b/include/AudioEngineWorkerThread.h index f86d41c9a..811f75753 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 @@ private: volatile bool m_quit; } ; +} // namespace lmms #endif diff --git a/include/AudioFileDevice.h b/include/AudioFileDevice.h index c21a55c4c..937cd9d00 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 75e86d368..675ab21d9 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 @@ private: }; + +} // namespace lmms + #endif //AUDIO_FILE_FLAC_H diff --git a/include/AudioFileMP3.h b/include/AudioFileMP3.h index ab72ed689..16c3617a8 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 @@ private: lame_t m_lame; }; -#endif +} // namespace lmms + +#endif // LMMS_HAVE_MP3LAME #endif diff --git a/include/AudioFileOgg.h b/include/AudioFileOgg.h index 9c7337e9c..7e6921015 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 @@ private: } ; -#endif +} // namespace lmms + +#endif // LMMS_HAVE_OGGVORBIS #endif diff --git a/include/AudioFileWave.h b/include/AudioFileWave.h index d8e537859..e9425dd86 100644 --- a/include/AudioFileWave.h +++ b/include/AudioFileWave.h @@ -31,6 +31,8 @@ #include +namespace lmms +{ class AudioFileWave : public AudioFileDevice { @@ -66,4 +68,7 @@ private: SNDFILE * m_sf; } ; + +} // namespace lmms + #endif diff --git a/include/AudioJack.h b/include/AudioJack.h index e74ac4782..648bb157d 100644 --- a/include/AudioJack.h +++ b/include/AudioJack.h @@ -41,9 +41,17 @@ #include "AudioDeviceSetupWidget.h" class QLineEdit; -class LcdSpinBox; + +namespace lmms +{ + class MidiJack; +namespace gui +{ +class LcdSpinBox; +} + class AudioJack : public QObject, public AudioDevice { @@ -66,7 +74,7 @@ public: } - class setupWidget : public AudioDeviceSetupWidget +class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -76,7 +84,7 @@ public: private: QLineEdit * m_clientName; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; @@ -132,6 +140,8 @@ signals: } ; -#endif +} // namespace lmms + +#endif // LMMS_HAVE_JACK #endif diff --git a/include/AudioOss.h b/include/AudioOss.h index b1b5d839c..4a552040b 100644 --- a/include/AudioOss.h +++ b/include/AudioOss.h @@ -34,10 +34,17 @@ #include "AudioDevice.h" #include "AudioDeviceSetupWidget.h" - -class LcdSpinBox; class QLineEdit; +namespace lmms +{ + +namespace gui +{ +class LcdSpinBox; +} + + class AudioOss : public QThread, public AudioDevice { @@ -54,7 +61,7 @@ public: static QString probeDevice(); - class setupWidget : public AudioDeviceSetupWidget +class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -64,7 +71,7 @@ public: private: QLineEdit * m_device; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; @@ -81,7 +88,8 @@ private: } ; - -#endif +} // namespace lmms + +#endif // LMMS_HAVE_OSS #endif diff --git a/include/AudioPort.h b/include/AudioPort.h index 0f6c931d9..5a2645784 100644 --- a/include/AudioPort.h +++ b/include/AudioPort.h @@ -32,6 +32,9 @@ #include "MemoryManager.h" #include "PlayHandle.h" +namespace lmms +{ + class EffectChain; class FloatModel; class BoolModel; @@ -133,5 +136,6 @@ private: } ; +} // namespace lmms #endif diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index 2d78af1c4..10dab74eb 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -30,9 +30,28 @@ #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 +Q_OBJECT public slots: void updateBackends(); void updateDevices(); @@ -41,26 +60,17 @@ public slots: public: ComboBoxModel m_backendModel; ComboBoxModel m_deviceModel; -} ; +}; #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 gui +{ class ComboBox; class LcdSpinBox; +} class AudioPortAudio : public AudioDevice @@ -80,7 +90,7 @@ public: unsigned long _framesPerBuffer ); - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -90,8 +100,8 @@ public: virtual void show(); private: - ComboBox * m_backend; - ComboBox * m_device; + gui::ComboBox * m_backend; + gui::ComboBox * m_device; AudioPortAudioSetupUtil m_setupUtil; } ; @@ -149,6 +159,8 @@ private: } ; -#endif +#endif // LMMS_HAVE_PORTAUDIO + +} // namespace lmms #endif diff --git a/include/AudioPulseAudio.h b/include/AudioPulseAudio.h index 3fe098d68..70da08087 100644 --- a/include/AudioPulseAudio.h +++ b/include/AudioPulseAudio.h @@ -36,10 +36,16 @@ #include "AudioDevice.h" #include "AudioDeviceSetupWidget.h" - -class LcdSpinBox; class QLineEdit; +namespace lmms +{ + +namespace gui +{ +class LcdSpinBox; +} + class AudioPulseAudio : public QThread, public AudioDevice { @@ -56,7 +62,7 @@ public: static QString probeDevice(); - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -66,7 +72,7 @@ public: private: QLineEdit * m_device; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; @@ -94,6 +100,8 @@ private: } ; +} // namespace lmms + #endif #endif diff --git a/include/AudioSampleRecorder.h b/include/AudioSampleRecorder.h index f5d5985c1..294ffa17d 100644 --- a/include/AudioSampleRecorder.h +++ b/include/AudioSampleRecorder.h @@ -31,6 +31,9 @@ #include "AudioDevice.h" +namespace lmms +{ + class SampleBuffer; @@ -54,5 +57,6 @@ private: } ; +} // namespace lmms #endif diff --git a/include/AudioSdl.h b/include/AudioSdl.h index 307973013..b49e2ebe9 100644 --- a/include/AudioSdl.h +++ b/include/AudioSdl.h @@ -41,6 +41,8 @@ class QLineEdit; +namespace lmms +{ class AudioSdl : public AudioDevice { @@ -55,7 +57,7 @@ public: } - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -108,6 +110,9 @@ private: } ; -#endif + +} // namespace lmms + +#endif // LMMS_HAVE_SDL #endif diff --git a/include/AudioSndio.h b/include/AudioSndio.h index 94fcfa93b..5fb7c78fc 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 @@ public: return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "sndio" ); } - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -62,7 +69,7 @@ public: private: QLineEdit * m_device; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; private: @@ -78,6 +85,8 @@ private: } ; +} // namespace lmms + #endif /* LMMS_HAVE_SNDIO */ #endif /* _AUDIO_SNDIO_H */ diff --git a/include/AudioSoundIo.h b/include/AudioSoundIo.h index 5dbd35250..411f4ab22 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 @@ private: }; -#endif + +} // namespace lmms + +#endif // LMMS_HAVE_SOUNDIO #endif diff --git a/include/AutomatableButton.h b/include/AutomatableButton.h index d7859a10c..fefaf70e3 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: } ; +} // namespace lmms::gui #endif diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 2f4b31467..672abaf81 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: \ @@ -416,7 +420,7 @@ private: signals: void initValueChanged( float val ); - void destroyed( jo_id_t id ); + void destroyed( lmms::jo_id_t id ); } ; @@ -502,5 +506,8 @@ public: typedef QMap AutomatedValueMap; + +} // namespace lmms + #endif diff --git a/include/AutomatableModelView.h b/include/AutomatableModelView.h index a59961185..fa8926c0c 100644 --- a/include/AutomatableModelView.h +++ b/include/AutomatableModelView.h @@ -32,6 +32,9 @@ class QMenu; class QMouseEvent; +namespace lmms::gui +{ + class LMMS_EXPORT AutomatableModelView : public ModelView { public: @@ -132,5 +135,7 @@ using FloatModelView = TypedModelView; using IntModelView = TypedModelView; using BoolModelView = TypedModelView; +} // namespace lmms::gui + #endif diff --git a/include/AutomatableSlider.h b/include/AutomatableSlider.h index b51ef1e3f..d6a95f5d8 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/AutomationClip.h b/include/AutomationClip.h index 22af90ed1..376c1e9e7 100644 --- a/include/AutomationClip.h +++ b/include/AutomationClip.h @@ -34,9 +34,17 @@ #include "Clip.h" +namespace lmms +{ + class AutomationTrack; class TimePos; +namespace gui +{ +class AutomationClipView; +} // namespace gui + class LMMS_EXPORT AutomationClip : public Clip @@ -152,7 +160,7 @@ public: static const QString classNodeName() { return "automationclip"; } QString nodeName() const override { return classNodeName(); } - ClipView * createView( TrackView * _tv ) override; + gui::ClipView * createView( gui::TrackView * _tv ) override; static bool isAutomated( const AutomatableModel * _m ); @@ -168,7 +176,7 @@ public: 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 ); @@ -204,7 +212,7 @@ private: static const float DEFAULT_MIN_VALUE; static const float DEFAULT_MAX_VALUE; - friend class AutomationClipView; + friend class gui::AutomationClipView; friend class AutomationNode; } ; @@ -242,4 +250,7 @@ inline int POS(AutomationClip::TimemapIterator it) return it.key(); } + +} // namespace lmms + #endif diff --git a/include/AutomationClipView.h b/include/AutomationClipView.h index 641a58699..0b80ad2eb 100644 --- a/include/AutomationClipView.h +++ b/include/AutomationClipView.h @@ -29,8 +29,14 @@ #include "ClipView.h" +namespace lmms +{ + class AutomationClip; +namespace gui +{ + class AutomationClipView : public ClipView { @@ -75,4 +81,8 @@ private: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index c655ffcdf..d9d1b0a10 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -40,9 +40,16 @@ class QPainter; class QPixmap; class QScrollBar; -class ComboBox; -class Knob; +namespace lmms +{ + class NotePlayHandle; + +namespace gui +{ + +class Knob; +class ComboBox; class TimeLineWidget; @@ -128,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(); @@ -234,7 +241,7 @@ private: signals: void currentClipChanged(); - void positionChanged( const TimePos & ); + void positionChanged( const lmms::TimePos & ); } ; @@ -293,5 +300,8 @@ private: ComboBox * m_quantizeComboBox; }; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/AutomationNode.h b/include/AutomationNode.h index 6cd445662..11bd6d57d 100644 --- a/include/AutomationNode.h +++ b/include/AutomationNode.h @@ -26,6 +26,9 @@ #ifndef AUTOMATION_NODE_H #define AUTOMATION_NODE_H +namespace lmms +{ + class AutomationClip; @@ -151,5 +154,6 @@ private: float m_outTangent; }; +} // namespace lmms #endif diff --git a/include/AutomationTrack.h b/include/AutomationTrack.h index dc33f76c3..1bbc77b1c 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 @@ public: return "automationtrack"; } - TrackView * createView( TrackContainerView* ) override; + gui::TrackView * createView( gui::TrackContainerView* ) override; Clip* createClip(const TimePos & pos) override; virtual void saveTrackSpecificSettings( QDomDocument & _doc, @@ -58,4 +60,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/AutomationTrackView.h b/include/AutomationTrackView.h index 5ed993213..b5bafe58e 100644 --- a/include/AutomationTrackView.h +++ b/include/AutomationTrackView.h @@ -28,8 +28,14 @@ #include "TrackView.h" +namespace lmms +{ + class AutomationTrack; +namespace gui +{ + class AutomationTrackView : public TrackView { @@ -42,4 +48,8 @@ public: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/BandLimitedWave.h b/include/BandLimitedWave.h index 1cd8d69ed..30d28d4a1 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 @@ public: static QString s_wavetableDir; }; +} // namespace lmms #endif diff --git a/include/BasicFilters.h b/include/BasicFilters.h index 07cdda06b..10b5b24b7 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 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/BufferManager.h b/include/BufferManager.h index 20390644b..57729918e 100644 --- a/include/BufferManager.h +++ b/include/BufferManager.h @@ -29,10 +29,14 @@ #include "lmms_export.h" #include "lmms_basics.h" +namespace lmms +{ + + 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 +46,12 @@ public: const f_cnt_t offset = 0 ); #endif static void release( sampleFrame * buf ); + +private: + static fpp_t s_framesPerPeriod; }; + +} // namespace lmms + #endif diff --git a/include/CPULoadWidget.h b/include/CPULoadWidget.h index a5da11663..9cf275fb3 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 @@ private: } ; +} // namespace lmms::gui + #endif diff --git a/include/CaptionMenu.h b/include/CaptionMenu.h index e6531fe31..2309cec6f 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 @@ public: } ; - +} // namespace lmms::gui #endif diff --git a/include/Clip.h b/include/Clip.h index 7b42fc91b..5c70aeaba 100644 --- a/include/Clip.h +++ b/include/Clip.h @@ -30,11 +30,20 @@ #include "AutomatableModel.h" +namespace lmms +{ + class Track; -class ClipView; class TrackContainer; + +namespace gui +{ + +class ClipView; class TrackView; +} // namespace gui + class LMMS_EXPORT Clip : public Model, public JournallingObject { @@ -116,7 +125,7 @@ public: virtual void movePosition( const TimePos & pos ); virtual void changeLength( const TimePos & length ); - virtual ClipView * createView( TrackView * tv ) = 0; + virtual gui::ClipView * createView( gui::TrackView * tv ) = 0; inline void selectViewOnCreate( bool select ) { @@ -177,4 +186,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/ClipView.h b/include/ClipView.h index b3fd20920..00a8b261e 100644 --- a/include/ClipView.h +++ b/include/ClipView.h @@ -36,9 +36,16 @@ class QMenu; class QContextMenuEvent; +namespace lmms +{ + class DataFile; -class TextFloat; class Clip; + +namespace gui +{ + +class TextFloat; class TrackView; @@ -241,4 +248,8 @@ private: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/Clipboard.h b/include/Clipboard.h index 168134e9d..1c2dcb647 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 ac2a1b62d..9b3389c47 100644 --- a/include/ColorChooser.h +++ b/include/ColorChooser.h @@ -21,12 +21,19 @@ * */ +#ifndef COLOR_CHOOSER_H +#define COLOR_CHOOSER_H + #include #include #include #include #include +namespace lmms::gui +{ + + class ColorChooser: public QColorDialog { public: @@ -57,3 +64,9 @@ private: //! Generate a nice palette, with adjustable value static QVector nicePalette (int); }; + + +} // namespace lmms::gui + +#endif + diff --git a/include/ComboBox.h b/include/ComboBox.h index 1f7dd43ff..412279d15 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 a3c2a082b..faff03620 100644 --- a/include/ComboBoxModel.h +++ b/include/ComboBoxModel.h @@ -32,6 +32,8 @@ #include "AutomatableModel.h" #include "embed.h" +namespace lmms +{ class LMMS_EXPORT ComboBoxModel : public IntModel { @@ -91,5 +93,6 @@ private: } ; +} // namespace lmms #endif diff --git a/include/ConfigManager.h b/include/ConfigManager.h index e9b2783ab..6aa7fc037 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -37,7 +37,11 @@ #include "lmms_export.h" -class LmmsCore; +namespace lmms +{ + + +class Engine; const QString PROJECTS_PATH = "projects/"; const QString TEMPLATE_PATH = "templates/"; @@ -304,6 +308,10 @@ private: settingsMap m_settings; - friend class LmmsCore; + friend class Engine; }; + + +} // namespace lmms + #endif diff --git a/include/ControlLayout.h b/include/ControlLayout.h index 601820107..8c629f8e1 100644 --- a/include/ControlLayout.h +++ b/include/ControlLayout.h @@ -76,9 +76,15 @@ #include #include #include + class QLayoutItem; class QRect; class QString; +class QLineEdit; + + +namespace lmms::gui +{ /** Layout for controls (models) @@ -128,9 +134,11 @@ private: // 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!!"; }; +} // namespace lmms::gui + #endif // CONTROLLAYOUT_H diff --git a/include/Controller.h b/include/Controller.h index 092c684e0..c2e5205d2 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 @@ public: 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 @@ signals: // 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 68fd2dc89..50b98539c 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 @@ signals: // 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 95e55ce79..62980987f 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 @@ private: AutoDetectMidiController * m_midiController; } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ControllerDialog.h b/include/ControllerDialog.h index 05e8f3bfe..0592cadf3 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 @@ protected: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ControllerRackView.h b/include/ControllerRackView.h index 9ef2d9b7f..6d60562f6 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 { @@ -57,9 +65,9 @@ public: 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; @@ -80,4 +88,8 @@ private: int m_nextIndex; } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ControllerView.h b/include/ControllerView.h index d1284845e..2e18e1320 100644 --- a/include/ControllerView.h +++ b/include/ControllerView.h @@ -36,6 +36,10 @@ class QLabel; class QPushButton; class QMdiSubWindow; +namespace lmms::gui +{ + + class LedCheckBox; @@ -64,7 +68,7 @@ public slots: void renameController(); signals: - void deleteController( ControllerView * _view ); + void deleteController( lmms::gui::ControllerView * _view ); protected: @@ -81,4 +85,7 @@ private: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Controls.h b/include/Controls.h index 414258368..af2a5fa71 100644 --- a/include/Controls.h +++ b/include/Controls.h @@ -34,8 +34,20 @@ class QString; class QWidget; +class QLabel; + +namespace lmms +{ + class AutomatableModel; +namespace gui +{ + +class AutomatableModelView; +class Knob; +class ComboBox; +class LedCheckBox; /** These classes provide @@ -52,7 +64,7 @@ public: virtual void setModel(AutomatableModel* model) = 0; virtual AutomatableModel* model() = 0; - virtual class AutomatableModelView* modelView() = 0; + virtual AutomatableModelView* modelView() = 0; virtual ~Control(); }; @@ -60,7 +72,7 @@ public: class KnobControl : public Control { - class Knob* m_knob; + Knob* m_knob; public: void setText(const QString& text) override; @@ -68,7 +80,7 @@ public: void setModel(AutomatableModel* model) override; FloatModel* model() override; - class AutomatableModelView* modelView() override; + AutomatableModelView* modelView() override; KnobControl(QWidget* parent = nullptr); ~KnobControl() override; @@ -78,8 +90,8 @@ public: 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; @@ -87,7 +99,7 @@ public: void setModel(AutomatableModel* model) override; ComboBoxModel* model() override; - class AutomatableModelView* modelView() override; + AutomatableModelView* modelView() override; ComboControl(QWidget* parent = nullptr); ~ComboControl() override; @@ -104,7 +116,7 @@ public: void setModel(AutomatableModel* model) override; IntModel* model() override; - class AutomatableModelView* modelView() override; + AutomatableModelView* modelView() override; LcdControl(int numDigits, QWidget* parent = nullptr); ~LcdControl() override; @@ -114,7 +126,7 @@ public: class CheckControl : public Control { QWidget* m_widget; - class LedCheckBox* m_checkBox; + LedCheckBox* m_checkBox; QLabel* m_label; public: @@ -122,12 +134,16 @@ public: 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; }; +} // namespace gui + +} // namespace lmms + #endif // CONTROLS_H diff --git a/include/CustomTextKnob.h b/include/CustomTextKnob.h index aa7b9d573..403799ff0 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 @@ protected: QString m_value_text; } ; + +} // namespace lmms::gui + #endif diff --git a/include/DataFile.h b/include/DataFile.h index 0600e85d4..c17b3546f 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -33,9 +33,14 @@ #include "lmms_export.h" #include "MemoryManager.h" -class ProjectVersion; class QTextStream; +namespace lmms +{ + +class ProjectVersion; + + class LMMS_EXPORT DataFile : public QDomDocument { MM_OPERATORS @@ -155,4 +160,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/Delay.h b/include/Delay.h index 5be1ac183..404782f90 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 bef4ea9b9..7786665a3 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. @@ -60,4 +63,7 @@ inline QPoint position(QWheelEvent *wheelEvent) return wheelEvent->pos(); #endif } + +} // namespace lmms + #endif // DEPRECATIONHELPER_H diff --git a/include/DetuningHelper.h b/include/DetuningHelper.h index 2157b6ba8..7444b8b22 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 @@ public: } ; +} // namespace lmms + #endif diff --git a/include/DrumSynth.h b/include/DrumSynth.h index f7e9b1d4c..79383a6d4 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 bf175df6d..df7588116 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::DspEffectLibrary #endif diff --git a/include/DummyEffect.h b/include/DummyEffect.h index 6bb8c873e..8d0f769b6 100644 --- a/include/DummyEffect.h +++ b/include/DummyEffect.h @@ -31,6 +31,12 @@ #include "EffectControls.h" #include "EffectControlDialog.h" +namespace lmms +{ + +namespace gui +{ + class Knob; @@ -44,6 +50,7 @@ public: } ; +} class DummyEffectControls : public EffectControls { @@ -75,9 +82,9 @@ public: return "DummyControls"; } - EffectControlDialog * createView() override + gui::EffectControlDialog * createView() override { - return new DummyEffectControlDialog( this ); + return new gui::DummyEffectControlDialog( this ); } } ; @@ -144,4 +151,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/DummyInstrument.h b/include/DummyInstrument.h index ebfcfbefe..27246e6eb 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 @@ public: 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 61a399889..313649526 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 @@ public: 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 d755608a6..88cd84654 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 @@ protected: }; +} // namespace lmms::gui + #endif diff --git a/include/Effect.h b/include/Effect.h index 6d1fea6bf..abd65f207 100644 --- a/include/Effect.h +++ b/include/Effect.h @@ -33,9 +33,19 @@ #include "TempoSyncKnobModel.h" #include "MemoryManager.h" +namespace lmms +{ + class EffectChain; class EffectControls; +namespace gui +{ + +class EffectView; + +} // namespace gui + class LMMS_EXPORT Effect : public Plugin { @@ -170,7 +180,7 @@ protected: */ 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 @@ -221,7 +231,7 @@ private: SRC_STATE * m_srcState[2]; - friend class EffectView; + friend class gui::EffectView; friend class EffectChain; } ; @@ -231,4 +241,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 9ebc4d534..ca7648761 100644 --- a/include/EffectChain.h +++ b/include/EffectChain.h @@ -30,8 +30,18 @@ #include "SerializingObject.h" #include "AutomatableModel.h" +namespace lmms +{ + class Effect; +namespace gui +{ + +class EffectRackView; + +} // namespace gui + class LMMS_EXPORT EffectChain : public Model, public SerializingObject { @@ -65,7 +75,7 @@ private: BoolModel m_enabledModel; - friend class EffectRackView; + friend class gui::EffectRackView; signals: @@ -73,5 +83,7 @@ signals: } ; +} // namespace lmms + #endif diff --git a/include/EffectControlDialog.h b/include/EffectControlDialog.h index 4a59489da..ec0ef3f1d 100644 --- a/include/EffectControlDialog.h +++ b/include/EffectControlDialog.h @@ -30,9 +30,15 @@ #include "ModelView.h" +namespace lmms +{ + class EffectControls; +namespace gui +{ + class LMMS_EXPORT EffectControlDialog : public QWidget, public ModelView { Q_OBJECT @@ -54,4 +60,8 @@ protected: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/EffectControls.h b/include/EffectControls.h index 6af7a7d6c..b8e7d0041 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 @@ public: } virtual int controlCount() = 0; - virtual EffectControlDialog * createView() = 0; + virtual gui::EffectControlDialog * createView() = 0; void setViewVisible( bool _visible ) @@ -73,4 +81,7 @@ private: } ; + +} // namespace lmms + #endif diff --git a/include/EffectRackView.h b/include/EffectRackView.h index b590d8eb1..014a07dfe 100644 --- a/include/EffectRackView.h +++ b/include/EffectRackView.h @@ -35,6 +35,9 @@ class QScrollArea; class QVBoxLayout; +namespace lmms::gui +{ + class EffectView; class GroupBox; @@ -50,9 +53,9 @@ public: 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: @@ -83,4 +86,6 @@ private: } ; +} // namespace lmms::gui + #endif diff --git a/include/EffectSelectDialog.h b/include/EffectSelectDialog.h index 19e0ca05f..bf1b6ba04 100644 --- a/include/EffectSelectDialog.h +++ b/include/EffectSelectDialog.h @@ -34,6 +34,9 @@ namespace Ui { class EffectSelectDialog; } +namespace lmms::gui +{ + class EffectSelectDialog : public QDialog { @@ -65,5 +68,7 @@ private: } ; +} // namespace lmms::gui + #endif diff --git a/include/EffectView.h b/include/EffectView.h index a2509dc5b..9f30575e9 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; @@ -68,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: @@ -90,4 +93,7 @@ private: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Engine.h b/include/Engine.h index 531e24220..b63308cde 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 Mixer; class PatternStore; @@ -41,20 +44,13 @@ class ProjectJournal; class Song; class Ladspa2LMMS; +namespace gui +{ +class GuiApplication; +} -// 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: @@ -110,11 +106,11 @@ public: 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; } @@ -130,9 +126,9 @@ private: // 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; } @@ -149,15 +145,17 @@ private: #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; + friend class gui::GuiApplication; }; +} // namespace lmms + #endif diff --git a/include/EnvelopeAndLfoParameters.h b/include/EnvelopeAndLfoParameters.h index 42502800e..0a4a0d0f2 100644 --- a/include/EnvelopeAndLfoParameters.h +++ b/include/EnvelopeAndLfoParameters.h @@ -33,6 +33,15 @@ #include "TempoSyncKnobModel.h" #include "lmms_basics.h" +namespace lmms +{ + +namespace gui +{ + +class EnvelopeAndLfoView; + +} class LMMS_EXPORT EnvelopeAndLfoParameters : public Model, public JournallingObject { @@ -179,8 +188,10 @@ private: void updateLfoShapeData(); - friend class EnvelopeAndLfoView; + friend class gui::EnvelopeAndLfoView; } ; +} // namespace lmms + #endif diff --git a/include/EnvelopeAndLfoView.h b/include/EnvelopeAndLfoView.h index f6d4fd0a8..2067f9291 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 @@ private: float m_randomGraph; } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ExportFilter.h b/include/ExportFilter.h index e60faef3a..29cb1c711 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 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/ExportProjectDialog.h b/include/ExportProjectDialog.h index 06c1e3011..5e4418a28 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: std::unique_ptr m_renderManager; } ; + +} // namespace lmms::gui + + #endif diff --git a/include/FadeButton.h b/include/FadeButton.h index dfffe93a2..ee0936ca7 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 @@ private: } ; +} // namespace lmms::gui + #endif diff --git a/include/Fader.h b/include/Fader.h index 86d7f0b96..355684c4a 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 @@ private: } ; +} // namespace lmms::gui + + #endif diff --git a/include/FifoBuffer.h b/include/FifoBuffer.h index 5bbf8b702..d49e367c0 100644 --- a/include/FifoBuffer.h +++ b/include/FifoBuffer.h @@ -28,6 +28,10 @@ #include +namespace lmms +{ + + template class FifoBuffer { @@ -88,4 +92,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/FileBrowser.h b/include/FileBrowser.h index d99c619e9..eb50dd1bb 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 { @@ -142,11 +147,11 @@ private: 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 ); } ; @@ -281,4 +286,8 @@ private: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/FileDialog.h b/include/FileDialog.h index 6e29703b8..ed5d2f231 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 @@ public: void clearSelection(); }; -#endif // FILEDIALOG_HPP + +} // namespace lmms::gui + +#endif // FILEDIALOG_H diff --git a/include/Graph.h b/include/Graph.h index 2a6fc4f8a..7a9599f12 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 @@ private: } ; +} // namespace gui + + /** @brief 2 dimensional function plot @@ -137,7 +147,7 @@ public: graphModel( float _min, float _max, int _size, - :: Model * _parent, + Model * _parent, bool _default_constructed = false, float _step = 0.0 ); @@ -211,8 +221,11 @@ private: 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 77b0ec578..6a282fedb 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 @@ private: } ; +} // namespace lmms::gui #endif diff --git a/include/GuiApplication.h b/include/GuiApplication.h index ee5e83e2b..84697175f 100644 --- a/include/GuiApplication.h +++ b/include/GuiApplication.h @@ -32,6 +32,9 @@ class QLabel; +namespace lmms::gui +{ + class AutomationEditorWindow; class ControllerRackView; class MixerView; @@ -88,4 +91,6 @@ private: // Short-hand function LMMS_EXPORT GuiApplication* getGUI(); +} // namespace lmms::gui + #endif // GUIAPPLICATION_H diff --git a/include/ImportFilter.h b/include/ImportFilter.h index ef58cce24..60eca6f80 100644 --- a/include/ImportFilter.h +++ b/include/ImportFilter.h @@ -30,6 +30,9 @@ #include "Plugin.h" +namespace lmms +{ + class TrackContainer; @@ -109,4 +112,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/InlineAutomation.h b/include/InlineAutomation.h index 1ce486fde..453184329 100644 --- a/include/InlineAutomation.h +++ b/include/InlineAutomation.h @@ -29,6 +29,8 @@ #include "AutomationClip.h" #include "shared_object.h" +namespace lmms +{ class InlineAutomation : public FloatModel, public sharedObject { @@ -95,4 +97,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/Instrument.h b/include/Instrument.h index c3cd56272..7ec3c66be 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; @@ -146,6 +148,10 @@ private: } ; + Q_DECLARE_OPERATORS_FOR_FLAGS(Instrument::Flags) + +} // namespace lmms + #endif diff --git a/include/InstrumentFunctionViews.h b/include/InstrumentFunctionViews.h index 6536a8db7..bf4b07668 100644 --- a/include/InstrumentFunctionViews.h +++ b/include/InstrumentFunctionViews.h @@ -30,15 +30,20 @@ #include class QLabel; -class ComboBox; -class GroupBox; -class Knob; -class TempoSyncKnob; + +namespace lmms +{ class InstrumentFunctionArpeggio; class InstrumentFunctionNoteStacking; +namespace gui +{ +class ComboBox; +class GroupBox; +class Knob; +class TempoSyncKnob; class InstrumentFunctionNoteStackingView : public QWidget, public ModelView { @@ -90,5 +95,8 @@ private: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index e1591ea27..ef1d17902 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 @@ -149,7 +158,7 @@ private: FloatModel m_chordRangeModel; - friend class InstrumentFunctionNoteStackingView; + friend class gui::InstrumentFunctionNoteStackingView; } ; @@ -207,9 +216,11 @@ private: friend class InstrumentTrack; - friend class InstrumentFunctionArpeggioView; + friend class gui::InstrumentFunctionArpeggioView; } ; +} // namespace lmms + #endif diff --git a/include/InstrumentMidiIOView.h b/include/InstrumentMidiIOView.h index 9b1e5adfd..399aee890 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 @@ private: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/InstrumentMiscView.h b/include/InstrumentMiscView.h index 6024436e8..25e16395d 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 @@ private: LedCheckBox *m_rangeImportCheckbox; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/InstrumentPlayHandle.h b/include/InstrumentPlayHandle.h index ac5fc3222..2d7bfa587 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 @@ private: } ; + +} // namespace lmms + #endif diff --git a/include/InstrumentSoundShaping.h b/include/InstrumentSoundShaping.h index b037f615a..00208392d 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 @@ private: 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 06d53232c..9b4efcfab 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 @@ private: } ; + +} // namespace lmms::gui + #endif diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index 952884829..d05da176b 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -39,9 +39,23 @@ #include "Track.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 { @@ -111,7 +125,7 @@ public: virtual bool play( const TimePos & _start, const fpp_t _frames, const f_cnt_t _frame_base, int _clip_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 = clip Clip* createClip(const TimePos & pos) override; @@ -223,8 +237,8 @@ public: 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(); @@ -294,12 +308,16 @@ private: 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 d863d6c19..a5297b332 100644 --- a/include/InstrumentTrackView.h +++ b/include/InstrumentTrackView.h @@ -30,6 +30,10 @@ #include "InstrumentTrack.h" +namespace lmms::gui +{ + + class InstrumentTrackWindow; class Knob; class MidiCCRackView; @@ -114,5 +118,7 @@ private: friend class InstrumentTrackWindow; } ; -#endif +} // namespace lmms::gui + +#endif diff --git a/include/InstrumentTrackWindow.h b/include/InstrumentTrackWindow.h index a215e08f9..cd208c165 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 MixerLineLcdSpinBox; @@ -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 @@ private: friend class InstrumentTrackView; } ; -#endif +} // namespace gui + +} // namespace lmms + +#endif diff --git a/include/InstrumentView.h b/include/InstrumentView.h index 838ed2d91..695e8c477 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 @@ public: } ; +} // namespace lmms::gui + #endif diff --git a/include/IoHelper.h b/include/IoHelper.h index 35ee8cb87..4f08f5087 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,15 +58,9 @@ 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 @@ -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 9e0322591..cd853dc7f 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 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/Keymap.h b/include/Keymap.h index 08a27c473..6286f8362 100644 --- a/include/Keymap.h +++ b/include/Keymap.h @@ -31,6 +31,9 @@ #include "SerializingObject.h" +namespace lmms +{ + class Keymap : public QObject, public SerializingObject { Q_OBJECT @@ -75,4 +78,6 @@ private: 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 f27328aa9..16ac7ed01 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: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Ladspa2LMMS.h b/include/Ladspa2LMMS.h index 28fa25b89..63db75cd9 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 @@ -73,8 +76,11 @@ private: l_sortable_plugin_t m_analysisTools; l_sortable_plugin_t m_otherPlugins; - friend class LmmsCore; + friend class Engine; } ; + +} // namespace lmms + #endif diff --git a/include/LadspaBase.h b/include/LadspaBase.h index be4576f55..68e91dd7a 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 34f6c9ae2..8b6fe3d19 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 @@ private: TempoSyncKnobModel m_tempoSyncKnobModel; - friend class LadspaControlView; + friend class gui::LadspaControlView; } ; + +} // namespace lmms + #endif diff --git a/include/LadspaControlView.h b/include/LadspaControlView.h index d2d0ca44d..15eb722a7 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 @@ private: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/LadspaManager.h b/include/LadspaManager.h index a87511161..565a7c898 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 @@ private: } ; + +} // namespace lmms + #endif diff --git a/include/LcdFloatSpinBox.h b/include/LcdFloatSpinBox.h index 034168fbb..ab0de304e 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 @@ signals: using LcdFloatSpinBoxModel = FloatModel; +} // namespace lmms::gui + #endif diff --git a/include/LcdSpinBox.h b/include/LcdSpinBox.h index 91ac8b4a7..1c30bfcf6 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 @@ signals: typedef IntModel LcdSpinBoxModel; +} // namespace lmms::gui + #endif diff --git a/include/LcdWidget.h b/include/LcdWidget.h index a04e7ae91..aad1d189a 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 @@ private: }; +} // namespace lmms::gui + #endif diff --git a/include/LedCheckBox.h b/include/LedCheckBox.h index f5477704f..8eac9b562 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 @@ private: } ; + +} // namespace lmms::gui + #endif diff --git a/include/LeftRightNav.h b/include/LeftRightNav.h index 4f3f4ecbb..df72193dc 100644 --- a/include/LeftRightNav.h +++ b/include/LeftRightNav.h @@ -28,6 +28,9 @@ #include "PixmapButton.h" +namespace lmms::gui +{ + class LeftRightNav : public QWidget { Q_OBJECT @@ -45,4 +48,7 @@ private: PixmapButton m_rightBtn; }; + +} // namespace lmms::gui + #endif \ No newline at end of file diff --git a/include/LfoController.h b/include/LfoController.h index 8fc35fd09..6ee136a14 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 @@ public: 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 a70480d5c..50ef03596 100644 --- a/include/LinkedModelGroupViews.h +++ b/include/LinkedModelGroupViews.h @@ -31,6 +31,19 @@ #include +namespace lmms +{ + + +class LinkedModelGroup; +class LinkedModelGroups; + + +namespace gui +{ + +class Control; + /** @file LinkedModelGroupViews.h See Lv2ViewBase.h for example usage @@ -55,17 +68,17 @@ public: @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); @@ -94,7 +107,7 @@ protected: ~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, @@ -103,4 +116,8 @@ private: }; +} // namespace gui + +} // namespace lmms + #endif // LINKEDMODELGROUPVIEWS_H diff --git a/include/LinkedModelGroups.h b/include/LinkedModelGroups.h index 770518076..9fa0fefa6 100644 --- a/include/LinkedModelGroups.h +++ b/include/LinkedModelGroups.h @@ -31,6 +31,12 @@ #include "Model.h" +class QDomDocument; +class QDomElement; + +namespace lmms +{ + /** @file LinkedModelGroups.h See Lv2ControlBase.h and Lv2Proc.h for example usage @@ -107,8 +113,8 @@ signals: // (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) @@ -170,4 +176,6 @@ public: }; +} // namespace lmms + #endif // LINKEDMODELGROUPS_H diff --git a/include/LmmsPalette.h b/include/LmmsPalette.h index a8ee5d1c8..87ea18687 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 @@ private: +} // namespace lmms::gui #endif diff --git a/include/LmmsStyle.h b/include/LmmsStyle.h index ccf14396c..a4c9edd31 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 @@ private: }; + +} // namespace lmms::gui + #endif diff --git a/include/LocaleHelper.h b/include/LocaleHelper.h index c5d9d4c46..b071a1596 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 d7977480e..17f5ebfb5 100644 --- a/include/LocklessAllocator.h +++ b/include/LocklessAllocator.h @@ -28,6 +28,11 @@ #include #include + +namespace lmms +{ + + class LocklessAllocator { public: @@ -79,4 +84,6 @@ public: } ; +} // namespace lmms + #endif diff --git a/include/LocklessList.h b/include/LocklessList.h index 05df56f41..44b718059 100644 --- a/include/LocklessList.h +++ b/include/LocklessList.h @@ -29,6 +29,9 @@ #include +namespace lmms +{ + template class LocklessList { @@ -92,4 +95,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/LocklessRingBuffer.h b/include/LocklessRingBuffer.h index 5950b842f..60f8ab989 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 @@ private: QWaitCondition *m_notifier; }; + +} // namespace lmms + #endif //LOCKLESSRINGBUFFER_H diff --git a/include/Lv2Basics.h b/include/Lv2Basics.h index 0003f83e8..b935e6a02 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 6b72bec5d..c6b08db8c 100644 --- a/include/Lv2ControlBase.h +++ b/include/Lv2ControlBase.h @@ -37,6 +37,10 @@ #include "lmms_export.h" #include "Plugin.h" +namespace lmms +{ + + class Lv2Proc; class PluginIssue; @@ -155,5 +159,8 @@ private: 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 9cf6a6801..2f569f7d6 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 272bb3a4d..033273f31 100644 --- a/include/Lv2Features.h +++ b/include/Lv2Features.h @@ -33,6 +33,10 @@ #include #include "Lv2Manager.h" + +namespace lmms +{ + /** Feature container @@ -75,6 +79,9 @@ private: std::map m_featureByUri; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2FEATURES_H diff --git a/include/Lv2Manager.h b/include/Lv2Manager.h index dbea510ce..7c4a4bcb7 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 @@ private: 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 1453de2ea..32225ea89 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 @@ private: std::map> m_optionValues; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2OPTIONS_H diff --git a/include/Lv2Ports.h b/include/Lv2Ports.h index 529200793..22a051a21 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; @@ -200,7 +205,7 @@ private: 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 @@ -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 06185a9ac..31a694044 100644 --- a/include/Lv2Proc.h +++ b/include/Lv2Proc.h @@ -40,6 +40,10 @@ #include "../src/3rdparty/ringbuffer/include/ringbuffer/ringbuffer.h" #include "TimePos.h" + +namespace lmms +{ + class PluginIssue; // forward declare port structs/enums @@ -212,5 +216,8 @@ private: 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 fee3c3812..9ba2c76cb 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 @@ public: 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 e50fd4bab..bae42d318 100644 --- a/include/Lv2UridCache.h +++ b/include/Lv2UridCache.h @@ -31,6 +31,11 @@ #include + +namespace lmms +{ + + //! Cached URIDs for fast access (for use in real-time code) class Lv2UridCache { @@ -65,5 +70,8 @@ private: 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 39cfcc44f..9db9cb0c2 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 @@ public: 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 6eafbde88..74a0bd876 100644 --- a/include/Lv2ViewBase.h +++ b/include/Lv2ViewBase.h @@ -35,10 +35,23 @@ #include "lmms_export.h" #include "Lv2Basics.h" + +class QPushButton; +class QMdiSubWindow; + +namespace lmms +{ + + class Lv2Proc; class Lv2ControlBase; +namespace gui +{ + +class LedCheckBox; + //! View for one processor, Lv2ViewBase contains 2 of those for mono plugins class Lv2ViewProc : public LinkedModelGroupView { @@ -61,9 +74,9 @@ protected: ~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); @@ -87,10 +100,13 @@ private: //! 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; }; +} // namespace gui + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2VIEWBASE_H diff --git a/include/MainApplication.h b/include/MainApplication.h index d28900213..04bc82226 100644 --- a/include/MainApplication.h +++ b/include/MainApplication.h @@ -34,6 +34,11 @@ #include #endif + +namespace lmms::gui +{ + + #if defined(LMMS_BUILD_WIN32) class MainApplication : public QApplication, public QAbstractNativeEventFilter #else @@ -56,4 +61,7 @@ private: QString m_queuedFile; }; + +} // namespace lmms::gui + #endif // MAINAPPLICATION_H diff --git a/include/MainWindow.h b/include/MainWindow.h index 145023161..8fbc20e6a 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -37,10 +37,18 @@ class QDomElement; class QGridLayout; class QMdiArea; +namespace lmms +{ + class ConfigManager; + +namespace gui +{ + class PluginView; class SubWindow; class ToolButton; +class GuiApplication; class MainWindow : public QMainWindow @@ -250,4 +258,9 @@ signals: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/MemoryHelper.h b/include/MemoryHelper.h index f5c5bf11b..1def9d9c4 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 @@ public: private: }; + +} // namespace lmms + #endif diff --git a/include/MemoryManager.h b/include/MemoryManager.h index a5899d922..014071617 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 da254c7c7..e606a4482 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 @@ private: } ; +} // namespace lmms::gui + #endif diff --git a/include/MeterModel.h b/include/MeterModel.h index 2b98bed0b..bcd3fa2b2 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 @@ private: } ; + +} // namespace lmms + #endif diff --git a/include/MicroTimer.h b/include/MicroTimer.h index 2026619e2..2eaf28b97 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 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/Microtuner.h b/include/Microtuner.h index 9ac732817..934739ff5 100644 --- a/include/Microtuner.h +++ b/include/Microtuner.h @@ -29,6 +29,9 @@ #include "ComboBoxModel.h" #include "JournallingObject.h" +namespace lmms +{ + class LMMS_EXPORT Microtuner : public Model, public JournallingObject { Q_OBJECT @@ -68,4 +71,6 @@ private: }; +} // namespace lmms + #endif diff --git a/include/MicrotunerConfig.h b/include/MicrotunerConfig.h index 58752026c..690587dd5 100644 --- a/include/MicrotunerConfig.h +++ b/include/MicrotunerConfig.h @@ -35,6 +35,10 @@ class QLineEdit; class QPlainTextEdit; +namespace lmms::gui +{ + + class LMMS_EXPORT MicrotunerConfig : public QWidget, public SerializingObject { Q_OBJECT @@ -89,4 +93,7 @@ private: 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 b922ac41f..9a97ae6e4 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 60bf1e685..3ab2b8af7 100644 --- a/include/MidiAlsaRaw.h +++ b/include/MidiAlsaRaw.h @@ -40,6 +40,9 @@ struct pollfd; +namespace lmms +{ + class MidiAlsaRaw : public QThread, public MidiClientRaw { Q_OBJECT @@ -77,6 +80,9 @@ private: } ; -#endif + +} // namespace lmms + +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/MidiAlsaSeq.h b/include/MidiAlsaSeq.h index bbb3f7242..8a2d3a098 100644 --- a/include/MidiAlsaSeq.h +++ b/include/MidiAlsaSeq.h @@ -42,6 +42,10 @@ struct pollfd; +namespace lmms +{ + + class MidiAlsaSeq : public QThread, public MidiClient { Q_OBJECT @@ -113,7 +117,7 @@ public: private slots: - void changeQueueTempo( bpm_t _bpm ); + void changeQueueTempo( lmms::bpm_t _bpm ); void updatePortList(); @@ -149,7 +153,10 @@ signals: } ; -#endif + +} // namespace lmms + +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/MidiApple.h b/include/MidiApple.h index 4ea4805e5..d2a901698 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 @@ signals: } ; -#endif + +} // namespace lmms + +#endif // LMMS_BUILD_APPLE #endif diff --git a/include/MidiCCRackView.h b/include/MidiCCRackView.h index 982e06048..59f1de020 100644 --- a/include/MidiCCRackView.h +++ b/include/MidiCCRackView.h @@ -6,9 +6,16 @@ #include "Midi.h" #include "SerializingObject.h" -class GroupBox; +namespace lmms +{ + class InstrumentTrack; + +namespace gui +{ + class Knob; +class GroupBox; class MidiCCRackView : public QWidget, public SerializingObject { @@ -37,4 +44,9 @@ private: }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/MidiClient.h b/include/MidiClient.h index 384a664ce..835d2e46a 100644 --- a/include/MidiClient.h +++ b/include/MidiClient.h @@ -31,9 +31,13 @@ #include "MidiEvent.h" +class QObject; + + +namespace lmms +{ class MidiPort; -class QObject; class TimePos; @@ -167,6 +171,7 @@ private: } ; +} // namespace lmms #endif diff --git a/include/MidiClip.h b/include/MidiClip.h index 036f2771c..173ca5699 100644 --- a/include/MidiClip.h +++ b/include/MidiClip.h @@ -31,8 +31,17 @@ #include "Note.h" +namespace lmms +{ + + class InstrumentTrack; +namespace gui +{ +class MidiClipView; +} + class LMMS_EXPORT MidiClip : public Clip { @@ -100,7 +109,7 @@ public: bool empty(); - ClipView * createView( TrackView * _tv ) override; + gui::ClipView * createView( gui::TrackView * _tv ) override; using Model::dataChanged; @@ -136,13 +145,14 @@ private: MidiClip * adjacentMidiClipByOffset(int offset) const; - friend class MidiClipView; + friend class gui::MidiClipView; signals: - void destroyedMidiClip( MidiClip* ); + void destroyedMidiClip( lmms::MidiClip* ); } ; +} // namespace lmms #endif diff --git a/include/MidiClipView.h b/include/MidiClipView.h index 82e552a8c..c9f1c3e1e 100644 --- a/include/MidiClipView.h +++ b/include/MidiClipView.h @@ -26,12 +26,17 @@ #define MIDI_CLIP_VIEW_H #include - #include "ClipView.h" +namespace lmms +{ + class MidiClip; - - + +namespace gui +{ + + class MidiClipView : public ClipView { Q_OBJECT @@ -58,7 +63,7 @@ public: void setMutedNoteBorderColor(QColor const & color) { m_mutedNoteBorderColor = color; } public slots: - MidiClip* getMidiClip(); + lmms::MidiClip* getMidiClip(); void update() override; @@ -96,7 +101,10 @@ private: bool m_legacySEPattern; } ; - - + + +} // namespace gui + +} // namespace lmms #endif diff --git a/include/MidiController.h b/include/MidiController.h index 74b408f86..533f8ff03 100644 --- a/include/MidiController.h +++ b/include/MidiController.h @@ -33,8 +33,16 @@ #include "MidiPort.h" +namespace lmms +{ + class MidiPort; +namespace gui +{ +class ControllerConnectionDialog; +} + class MidiController : public Controller, public MidiEventProcessor { @@ -61,7 +69,7 @@ public: public slots: - ControllerDialog * createDialog( QWidget * _parent ) override; + gui::ControllerDialog* createDialog( QWidget * _parent ) override; void updateName(); @@ -76,10 +84,12 @@ protected: float m_lastValue; float m_previousValue; - friend class ControllerConnectionDialog; + friend class gui::ControllerConnectionDialog; friend class AutoDetectMidiController; } ; +} // namespace lmms + #endif diff --git a/include/MidiDummy.h b/include/MidiDummy.h index f809d3c36..8744c6aa2 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 @@ protected: } ; +} // namespace lmms + #endif diff --git a/include/MidiEvent.h b/include/MidiEvent.h index 29a3c5df6..e73a7d1a8 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 @@ private: Source m_source; } ; +} // namespace lmms + #endif diff --git a/include/MidiEventProcessor.h b/include/MidiEventProcessor.h index 3ded20430..1398f4b6d 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 @@ public: } ; +} // namespace lmms + #endif diff --git a/include/MidiEventToByteSeq.h b/include/MidiEventToByteSeq.h index fba8cdeb4..f2e36f50a 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 f12f9cebf..16d09d431 100644 --- a/include/MidiJack.h +++ b/include/MidiJack.h @@ -39,10 +39,14 @@ #include "MidiClient.h" +class QLineEdit; + +namespace lmms +{ + constexpr size_t JACK_MIDI_BUFFER_MAX = 64; /* events */ class AudioJack; -class QLineEdit; class MidiJack : public QThread, public MidiClientRaw { @@ -93,6 +97,9 @@ private: }; + +} // namespace lmms + #endif // LMMS_HAVE_JACK #endif // MIDIJACK_H diff --git a/include/MidiOss.h b/include/MidiOss.h index 68b970bc5..30f78bec1 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 @@ private: } ; -#endif + +} // namespace lmms + + +#endif // LMMS_HAVE_OSS #endif diff --git a/include/MidiPort.h b/include/MidiPort.h index b057f5d6c..3d3ceffdb 100644 --- a/include/MidiPort.h +++ b/include/MidiPort.h @@ -34,11 +34,21 @@ #include "TimePos.h" #include "AutomatableModel.h" +namespace lmms +{ class MidiClient; class MidiEvent; class MidiEventProcessor; + +namespace gui +{ + class MidiPortMenu; +class ControllerConnectionDialog; +class InstrumentMidiIOView; + +} // class for abstraction of MIDI-port @@ -129,8 +139,8 @@ public: void invalidateCilent(); - MidiPortMenu* m_readablePortsMenu; - MidiPortMenu* m_writablePortsMenu; + gui::MidiPortMenu* m_readablePortsMenu; + gui::MidiPortMenu* m_writablePortsMenu; public slots: @@ -165,8 +175,8 @@ private: Map m_writablePorts; - friend class ControllerConnectionDialog; - friend class InstrumentMidiIOView; + friend class gui::ControllerConnectionDialog; + friend class gui::InstrumentMidiIOView; signals: @@ -179,5 +189,6 @@ signals: typedef QList MidiPortList; +} // namespace lmms #endif diff --git a/include/MidiPortMenu.h b/include/MidiPortMenu.h index ce39c4aac..7f7689edc 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 @@ private: } ; +} // namespace lmms::gui #endif diff --git a/include/MidiSetupWidget.h b/include/MidiSetupWidget.h index fcaa29408..4021db142 100644 --- a/include/MidiSetupWidget.h +++ b/include/MidiSetupWidget.h @@ -30,6 +30,10 @@ class QLineEdit; +namespace lmms::gui +{ + + class MidiSetupWidget : public TabWidget { Q_OBJECT @@ -53,4 +57,7 @@ private: }; + +} // namespace lmms::gui + #endif diff --git a/include/MidiSndio.h b/include/MidiSndio.h index 2042a16ad..07c42186d 100644 --- a/include/MidiSndio.h +++ b/include/MidiSndio.h @@ -32,10 +32,15 @@ #include - #include "MidiClient.h" +struct mio_hdl; + +namespace lmms +{ + + class MidiSndio : public QThread, public MidiClientRaw { Q_OBJECT @@ -61,10 +66,13 @@ protected: void run(void) override; private: - struct mio_hdl *m_hdl; + mio_hdl *m_hdl; 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 cbb139983..7cc7f0f77 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 @@ signals: } ; -#endif + +} // namespace lmms + +#endif // LMMS_BUILD_WIN32 #endif diff --git a/include/MixHelpers.h b/include/MixHelpers.h index 872319f82..6599b40ec 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/Mixer.h b/include/Mixer.h index 7a6e3d0ff..36aa9f5d0 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -34,6 +34,10 @@ #include +namespace lmms +{ + + class MixerRoute; typedef QVector MixerRouteVector; @@ -220,4 +224,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/MixerLine.h b/include/MixerLine.h index 4f7f7242f..12ac3df75 100644 --- a/include/MixerLine.h +++ b/include/MixerLine.h @@ -23,16 +23,18 @@ * */ -#ifndef MIXER_LINE_H -#define MIXER_LINE_H +#ifndef MIXERLINE_H +#define MIXERLINE_H #include - - - class QGraphicsView; class QLineEdit; + +namespace lmms::gui +{ + + class Knob; class LcdWidget; class MixerView; @@ -113,4 +115,6 @@ private slots: }; +} // namespace lmms::gui + #endif // MIXERLINE_H diff --git a/include/MixerLineLcdSpinBox.h b/include/MixerLineLcdSpinBox.h index 6de8fcb47..7e739093d 100644 --- a/include/MixerLineLcdSpinBox.h +++ b/include/MixerLineLcdSpinBox.h @@ -27,6 +27,10 @@ #include "LcdSpinBox.h" +namespace lmms::gui +{ + + class TrackView; @@ -49,4 +53,7 @@ private: TrackView * m_tv; }; + +} // namespace lmms::gui + #endif diff --git a/include/MixerView.h b/include/MixerView.h index 6c586a607..5e63194c9 100644 --- a/include/MixerView.h +++ b/include/MixerView.h @@ -38,6 +38,11 @@ #include "EffectRackView.h" class QButtonGroup; + + +namespace lmms::gui +{ + class MixerLine; class LMMS_EXPORT MixerView : public QWidget, public ModelView, @@ -131,4 +136,7 @@ private: friend class MixerChannelView; } ; + +} // namespace lmms::gui + #endif diff --git a/include/Model.h b/include/Model.h index 623d3a9f9..1c96de21c 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 @@ signals: } ; +} // namespace lmms + #endif diff --git a/include/ModelView.h b/include/ModelView.h index 7aad9ce7f..a858dc7ec 100644 --- a/include/ModelView.h +++ b/include/ModelView.h @@ -28,6 +28,8 @@ #include #include "Model.h" +namespace lmms::gui +{ class LMMS_EXPORT ModelView { @@ -81,6 +83,7 @@ private: } ; +} // namespace lmms::gui #endif diff --git a/include/ModelVisitor.h b/include/ModelVisitor.h index f9d156e30..cf0740b1c 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 @@ public: virtual ~ConstModelVisitor(); }; + +} // namespace lmms + #endif // MODELVISITOR_H diff --git a/include/NStateButton.h b/include/NStateButton.h index 10cb151ae..ff48593a7 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 @@ private: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Note.h b/include/Note.h index 31ba6995e..d6e0b85c2 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 @@ private: typedef QVector NoteVector; +} // namespace lmms + #endif diff --git a/include/NotePlayHandle.h b/include/NotePlayHandle.h index 778acd46e..396d00e71 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 @@ private: }; +} // namespace lmms + #endif diff --git a/include/Oscillator.h b/include/Oscillator.h index da9bea4eb..e9f64008c 100644 --- a/include/Oscillator.h +++ b/include/Oscillator.h @@ -37,6 +37,10 @@ #include "OscillatorConstants.h" #include "SampleBuffer.h" +namespace lmms +{ + + class IntModel; @@ -307,4 +311,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/OscillatorConstants.h b/include/OscillatorConstants.h index dcdad8dc4..47b13a875 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 4072df478..4404fd98b 100644 --- a/include/Oscilloscope.h +++ b/include/Oscilloscope.h @@ -31,6 +31,9 @@ #include "lmms_basics.h" +namespace lmms::gui +{ + class Oscilloscope : public QWidget { @@ -57,7 +60,7 @@ protected: protected slots: - void updateAudioBuffer( const surroundSampleFrame * buffer ); + void updateAudioBuffer( const lmms::surroundSampleFrame * buffer ); private: QColor const & determineLineColor(float level) const; @@ -73,4 +76,7 @@ private: QColor m_clippingColor; } ; + +} // namespace lmms::gui + #endif // OSCILLOSCOPE_H diff --git a/include/OutputSettings.h b/include/OutputSettings.h index 4a375d244..03e3333ac 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 @@ private: double m_compressionLevel; }; + +} // namespace lmms + #endif diff --git a/include/PathUtil.h b/include/PathUtil.h index b1eec517e..8b1ef1097 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 @@ -5,7 +29,7 @@ #include -namespace PathUtil +namespace lmms::PathUtil { enum class Base { Absolute, ProjectDir, FactorySample, UserSample, UserVST, Preset, UserLADSPA, DefaultLADSPA, UserSoundfont, DefaultSoundfont, UserGIG, DefaultGIG, @@ -44,6 +68,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/PatternClip.h b/include/PatternClip.h index a6543267b..a1beb00f5 100644 --- a/include/PatternClip.h +++ b/include/PatternClip.h @@ -28,6 +28,9 @@ #include "Clip.h" +namespace lmms +{ + /*! \brief Dummy clip for PatternTracks * * Only used in the Song (Editor). See PatternStore.h for more info. @@ -47,12 +50,13 @@ public: int patternIndex(); - ClipView * createView( TrackView * _tv ) override; + gui::ClipView * createView( gui::TrackView * _tv ) override; private: friend class PatternClipView; } ; +} // namespace lmms #endif diff --git a/include/PatternClipView.h b/include/PatternClipView.h index 9cda17688..d66de70f0 100644 --- a/include/PatternClipView.h +++ b/include/PatternClipView.h @@ -31,8 +31,13 @@ #include "ClipView.h" +namespace lmms +{ + class PatternClip; +namespace gui +{ class PatternClipView : public ClipView { @@ -65,5 +70,8 @@ private: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/PatternEditor.h b/include/PatternEditor.h index 03861c1b0..15b141580 100644 --- a/include/PatternEditor.h +++ b/include/PatternEditor.h @@ -30,8 +30,14 @@ #include "Editor.h" #include "TrackContainerView.h" +namespace lmms +{ class PatternStore; + +namespace gui +{ + class ComboBox; @@ -69,11 +75,9 @@ private: }; - - class PatternEditorWindow : public Editor { - Q_OBJECT +Q_OBJECT public: PatternEditorWindow(PatternStore* ps); ~PatternEditorWindow(); @@ -90,4 +94,9 @@ private: ComboBox* m_patternComboBox; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/PatternStore.h b/include/PatternStore.h index e11328c16..39b65d1c1 100644 --- a/include/PatternStore.h +++ b/include/PatternStore.h @@ -29,6 +29,13 @@ #include "TrackContainer.h" #include "ComboBoxModel.h" +namespace lmms +{ + +namespace gui +{ + class PatternEditorWindow; +} /* * PatternStore is the backend of Pattern Editor: @@ -100,9 +107,11 @@ private: // Where the pattern selection combo box is - friend class PatternEditorWindow; + friend class gui::PatternEditorWindow; } ; +} // namespace lmms + #endif diff --git a/include/PatternTrack.h b/include/PatternTrack.h index c594b4cf5..a8e7a505c 100644 --- a/include/PatternTrack.h +++ b/include/PatternTrack.h @@ -31,9 +31,19 @@ #include "Track.h" -class TrackLabelButton; +namespace lmms +{ + class TrackContainer; +namespace gui +{ + +class TrackLabelButton; +class PatternTrackView; + +} // namespace gui + /*! Track type used in the Song (Editor) to reference a pattern in the PatternStore */ class LMMS_EXPORT PatternTrack : public Track @@ -44,8 +54,9 @@ public: virtual ~PatternTrack(); virtual bool play( const TimePos & _start, const fpp_t _frames, + const f_cnt_t _frame_base, int _clip_num = -1 ) override; - TrackView * createView( TrackContainerView* tcv ) override; + gui::TrackView * createView( gui::TrackContainerView* tcv ) override; Clip* createClip(const TimePos & pos) override; virtual void saveTrackSpecificSettings( QDomDocument & _doc, @@ -86,9 +97,11 @@ private: typedef QMap infoMap; static infoMap s_infoMap; - friend class PatternTrackView; + friend class gui::PatternTrackView; } ; +} // namespace lmms + #endif diff --git a/include/PatternTrackView.h b/include/PatternTrackView.h index ecc209f04..41f8fac33 100644 --- a/include/PatternTrackView.h +++ b/include/PatternTrackView.h @@ -29,7 +29,14 @@ #include "TrackView.h" +namespace lmms +{ + class PatternTrack; + +namespace gui +{ + class TrackLabelButton; @@ -59,4 +66,8 @@ private: +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/PeakController.h b/include/PeakController.h index 341d4f47a..d50c0b06f 100644 --- a/include/PeakController.h +++ b/include/PeakController.h @@ -30,6 +30,10 @@ class QWidget; +namespace lmms +{ + + class PeakControllerEffect; typedef QVector PeakControllerEffectVector; @@ -56,7 +60,7 @@ public: public slots: - ControllerDialog * createDialog( QWidget * _parent ) override; + gui::ControllerDialog * createDialog( QWidget * _parent ) override; void handleDestroyedEffect( ); void updateCoeffs(); @@ -80,7 +84,8 @@ private: bool m_coeffNeedsUpdate; } ; - +namespace gui +{ class PeakControllerDialog : public ControllerDialog { @@ -96,6 +101,11 @@ protected: PeakController * m_peakController; -} ; +}; + + +} // namespace gui + +} // namespace lmms #endif diff --git a/include/PerfLog.h b/include/PerfLog.h index 5d1efc14c..b8cc35f45 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 ece3abb06..b9f5e9797 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 @@ private: } ; + +} // namespace lmms + #endif diff --git a/include/PianoRoll.h b/include/PianoRoll.h index f00e8a79c..73a2e5b76 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -47,13 +47,23 @@ class QString; class QMenu; class QToolButton; -class ComboBox; +namespace lmms +{ + + class NotePlayHandle; class MidiClip; + + +namespace gui +{ + +class ComboBox; class PositionLine; class TextFloat; class TimeLineWidget; + class PianoRoll : public QWidget { Q_OBJECT @@ -186,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 ); @@ -199,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 ); @@ -484,7 +494,7 @@ private: QBrush m_blackKeyDisabledBackground; signals: - void positionChanged( const TimePos & ); + void positionChanged( const lmms::TimePos & ); } ; @@ -559,4 +569,8 @@ private: }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/PianoView.h b/include/PianoView.h index 888549431..7a6ab6479 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 @@ signals: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/Pitch.h b/include/Pitch.h index 17de48b94..3f58785ea 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 e2fb58885..f4062826d 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 @@ private: } ; + +} // namespace lmms::gui + #endif diff --git a/include/PlayHandle.h b/include/PlayHandle.h index 6de358acd..53457f916 100644 --- a/include/PlayHandle.h +++ b/include/PlayHandle.h @@ -36,6 +36,9 @@ class QThread; +namespace lmms +{ + class Track; class AudioPort; @@ -162,5 +165,6 @@ private: typedef QList PlayHandleList; typedef QList ConstPlayHandleList; +} // namespace lmms #endif diff --git a/include/Plugin.h b/include/Plugin.h index fb9ebd567..b50d81116 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -35,9 +35,18 @@ class QWidget; -class PixmapLoader; -class PluginView; +namespace lmms +{ + class AutomatableModel; +class PixmapLoader; + +namespace gui +{ + +class PluginView; + +} /** Abstract representation of a plugin @@ -286,11 +295,11 @@ public: 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 ); @@ -305,4 +314,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/PluginBrowser.h b/include/PluginBrowser.h index 9c74ed643..0b2a59d15 100644 --- a/include/PluginBrowser.h +++ b/include/PluginBrowser.h @@ -33,6 +33,8 @@ class QLineEdit; class QTreeWidget; +namespace lmms::gui +{ class PluginBrowser : public SideBarWidget { @@ -81,4 +83,6 @@ private: }; +} // namespace lmms::gui + #endif diff --git a/include/PluginFactory.h b/include/PluginFactory.h index 80627f351..c0e2ff8e0 100644 --- a/include/PluginFactory.h +++ b/include/PluginFactory.h @@ -38,6 +38,9 @@ class QLibrary; +namespace lmms +{ + class LMMS_EXPORT PluginFactory { public: @@ -105,4 +108,7 @@ private: //Short-hand function LMMS_EXPORT PluginFactory* getPluginFactory(); + +} // namespace lmms + #endif // PLUGINFACTORY_H diff --git a/include/PluginIssue.h b/include/PluginIssue.h index 8bfad5bf1..f0fa275f3 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 @@ -79,4 +83,7 @@ public: QDebug operator<<(QDebug stream, const PluginIssue& iss); +} // namespace lmms + + #endif // PLUGINISSUE_H diff --git a/include/PluginView.h b/include/PluginView.h index 476d65acf..2c06b9ba2 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 @@ public: } ; +} // namespace lmms::gui + #endif diff --git a/include/PositionLine.h b/include/PositionLine.h index e9ec8c3d5..cc1313e57 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 @@ private: QColor m_lineColor; }; +} // namespace lmms::gui + #endif diff --git a/include/PresetPreviewPlayHandle.h b/include/PresetPreviewPlayHandle.h index fcdecf6b8..9dd151330 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 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/ProjectJournal.h b/include/ProjectJournal.h index f8b9e642b..69e0752cb 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 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/ProjectNotes.h b/include/ProjectNotes.h index 03add4b04..fda5c9b51 100644 --- a/include/ProjectNotes.h +++ b/include/ProjectNotes.h @@ -35,6 +35,9 @@ class QComboBox; class QTextCharFormat; class QTextEdit; +namespace lmms::gui +{ + class LMMS_EXPORT ProjectNotes : public QMainWindow, public SerializingObject { @@ -89,4 +92,6 @@ private: } ; +} // namespace lmms::gui + #endif diff --git a/include/ProjectRenderer.h b/include/ProjectRenderer.h index ce5d6af3c..bd61c4730 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 @@ private: } ; + +} // namespace lmms + #endif diff --git a/include/ProjectVersion.h b/include/ProjectVersion.h index d72704ba3..5be259c97 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 b530937b0..42d4d32c0 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 @@ private: }; + +} // namespace lmms + #endif // QUADRATURELFO_H diff --git a/include/RaiiHelpers.h b/include/RaiiHelpers.h index bebd91ff9..0cfa2c4ac 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/RecentProjectsMenu.h b/include/RecentProjectsMenu.h index b3837ee2e..ac3638298 100644 --- a/include/RecentProjectsMenu.h +++ b/include/RecentProjectsMenu.h @@ -1,8 +1,36 @@ +/* + * 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 #include +namespace lmms::gui +{ + + class RecentProjectsMenu : public QMenu { Q_OBJECT @@ -14,4 +42,7 @@ private slots: void openProject(QAction * _action ); }; + +} // namespace lmms::gui + #endif // RECENTPROJECTSMENU_H diff --git a/include/RemotePlugin.h b/include/RemotePlugin.h index 615cce2c8..ec08896e2 100644 --- a/include/RemotePlugin.h +++ b/include/RemotePlugin.h @@ -28,6 +28,10 @@ #include "RemotePluginBase.h" #include "SharedMemory.h" +namespace lmms +{ + + class RemotePlugin; class ProcessWatcher : public QThread @@ -70,7 +74,7 @@ public: return true; #else return m_process.state() != QProcess::NotRunning; -#endif +#endif // DEBUG_REMOTE_PLUGIN } bool init( const QString &pluginExecutable, bool waitForInitDoneMsg, QStringList extraArgs = {} ); @@ -166,7 +170,7 @@ private: #ifndef SYNC_WITH_SHM_FIFO int m_server; QString m_socketFile; -#endif +#endif // not SYNC_WITH_SHM_FIFO friend class ProcessWatcher; @@ -176,9 +180,13 @@ private slots: void processErrored(QProcess::ProcessError err ); } ; + LMMS_EXPORT inline std::string QSTR_TO_STDSTR(QString const& qstr) { return qstr.toStdString(); } + +} // namespace lmms + #endif // REMOTE_PLUGIN_H diff --git a/include/RemotePluginBase.h b/include/RemotePluginBase.h index a5646ad11..4d5627a92 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,9 @@ #ifndef SYNC_WITH_SHM_FIFO #include #include -#endif +#endif // SYNC_WITH_SHM_FIFO -#else +#else // BUILD_REMOTE_PLUGIN_CLIENT #include "lmms_export.h" #include #include @@ -81,13 +81,20 @@ #ifndef SYNC_WITH_SHM_FIFO #include #include +#endif // SYNC_WITH_SHM_FIFO + +#endif // BUILD_REMOTE_PLUGIN_CLIENT + +#ifdef SYNC_WITH_SHM_FIFO +#include "SharedMemory.h" #endif -#endif +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 @@ -669,4 +676,6 @@ private: } ; +} // namespace lmms + #endif // REMOTE_PLUGIN_BASE_H diff --git a/include/RemotePluginClient.h b/include/RemotePluginClient.h index 94f05af0f..69a9d41e9 100644 --- a/include/RemotePluginClient.h +++ b/include/RemotePluginClient.h @@ -40,6 +40,9 @@ #include "SharedMemory.h" +namespace lmms +{ + class RemotePluginClient : public RemotePluginBase { public: @@ -355,4 +358,6 @@ void RemotePluginClient::doProcessing() } +} // namespace lmms + #endif // REMOTE_PLUGIN_CLIENT_H diff --git a/include/RenameDialog.h b/include/RenameDialog.h index 8f526badd..c1e30b9d8 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 @@ private: } ; +} // namespace lmms::gui + #endif diff --git a/include/RenderManager.h b/include/RenderManager.h index 935983702..ff59cb953 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: QVector m_unmuted; } ; + +} // namespace lmms + #endif diff --git a/include/RingBuffer.h b/include/RingBuffer.h index 46539c0ea..efb5afd39 100644 --- a/include/RingBuffer.h +++ b/include/RingBuffer.h @@ -32,6 +32,11 @@ #include "lmms_basics.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 @@ private: volatile unsigned int m_position; }; + + +} // namespace lmms + #endif diff --git a/include/RmsHelper.h b/include/RmsHelper.h index f5f2770fa..19b7da89c 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 @@ private: }; +} // namespace lmms + #endif diff --git a/include/RowTableView.h b/include/RowTableView.h index a7b07c2c8..fc55383a1 100644 --- a/include/RowTableView.h +++ b/include/RowTableView.h @@ -27,6 +27,9 @@ #include +namespace lmms::gui +{ + class RowDelegate; @@ -51,5 +54,6 @@ private: } ; +} // namespace lmms::gui #endif diff --git a/include/Rubberband.h b/include/Rubberband.h index 21e699d85..1332a932d 100644 --- a/include/Rubberband.h +++ b/include/Rubberband.h @@ -30,6 +30,9 @@ #include #include +namespace lmms::gui +{ + class selectableObject : public QWidget { @@ -91,5 +94,7 @@ private: }; +} // namespace lmms::gui + #endif diff --git a/include/SampleBuffer.h b/include/SampleBuffer.h index 991d9d140..b556fccbe 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 @@ -281,8 +284,8 @@ public: 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(); @@ -351,5 +354,6 @@ signals: } ; +} // namespace lmms #endif diff --git a/include/SampleClip.h b/include/SampleClip.h index 7c4f9cf60..52a2d6209 100644 --- a/include/SampleClip.h +++ b/include/SampleClip.h @@ -27,8 +27,18 @@ #include "Clip.h" +namespace lmms +{ + class SampleBuffer; +namespace gui +{ + +class SampleClipView; + +} // namespace gui + class SampleClip : public Clip { @@ -59,14 +69,14 @@ public: TimePos sampleLength() const; void setSampleStartFrame( f_cnt_t startFrame ); void setSamplePlayLength( f_cnt_t length ); - ClipView * createView( TrackView * _tv ) override; + gui::ClipView * createView( gui::TrackView * _tv ) override; bool isPlaying() const; void setIsPlaying(bool isPlaying); public slots: - void setSampleBuffer( SampleBuffer* sb ); + void setSampleBuffer( lmms::SampleBuffer* sb ); void setSampleFile( const QString & _sf ); void updateLength(); void toggleRecord(); @@ -79,7 +89,7 @@ private: BoolModel m_recordModel; bool m_isPlaying; - friend class SampleClipView; + friend class gui::SampleClipView; signals: @@ -88,5 +98,6 @@ signals: } ; +} // namespace lmms #endif diff --git a/include/SampleClipView.h b/include/SampleClipView.h index c18e6ab5a..d5218e28a 100644 --- a/include/SampleClipView.h +++ b/include/SampleClipView.h @@ -27,8 +27,17 @@ #include "ClipView.h" + + +namespace lmms +{ + class SampleClip; +namespace gui +{ + + class SampleClipView : public ClipView { Q_OBJECT @@ -60,5 +69,8 @@ private: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/SamplePlayHandle.h b/include/SamplePlayHandle.h index 04360a26e..d27591df3 100644 --- a/include/SamplePlayHandle.h +++ b/include/SamplePlayHandle.h @@ -30,6 +30,10 @@ #include "AutomatableModel.h" #include "PlayHandle.h" +namespace lmms +{ + + class PatternTrack; class SampleClip; class Track; @@ -94,4 +98,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/SampleRecordHandle.h b/include/SampleRecordHandle.h index f5ebb2201..724f4216d 100644 --- a/include/SampleRecordHandle.h +++ b/include/SampleRecordHandle.h @@ -32,6 +32,10 @@ #include "PlayHandle.h" #include "TimePos.h" +namespace lmms +{ + + class PatternTrack; class SampleBuffer; class SampleClip; @@ -69,4 +73,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/SampleTrack.h b/include/SampleTrack.h index 5ca5741b8..677e04889 100644 --- a/include/SampleTrack.h +++ b/include/SampleTrack.h @@ -30,6 +30,18 @@ #include "Track.h" +namespace lmms +{ + +namespace gui +{ + +class SampleTrackView; +class SampleTrackWindow; + +} // namespace gui + + class SampleTrack : public Track { Q_OBJECT @@ -39,7 +51,7 @@ public: virtual bool play( const TimePos & _start, const fpp_t _frames, const f_cnt_t _frame_base, int _clip_num = -1 ) override; - TrackView * createView( TrackContainerView* tcv ) override; + gui::TrackView * createView( gui::TrackContainerView* tcv ) override; Clip* createClip(const TimePos & pos) override; @@ -90,11 +102,12 @@ private: - friend class SampleTrackView; - friend class SampleTrackWindow; + friend class gui::SampleTrackView; + friend class gui::SampleTrackWindow; } ; +} // namespace lmms #endif \ No newline at end of file diff --git a/include/SampleTrackView.h b/include/SampleTrackView.h index 7d3e550c2..1223f999d 100644 --- a/include/SampleTrackView.h +++ b/include/SampleTrackView.h @@ -28,8 +28,16 @@ #include "TrackView.h" -class Knob; +namespace lmms +{ + class SampleTrack; + + +namespace gui +{ + +class Knob; class SampleTrackWindow; class TrackLabelButton; @@ -97,5 +105,8 @@ private: } ; +} // namespace gui + +} // namespace lmms #endif \ No newline at end of file diff --git a/include/SampleTrackWindow.h b/include/SampleTrackWindow.h index 85c175564..dd670fd09 100644 --- a/include/SampleTrackWindow.h +++ b/include/SampleTrackWindow.h @@ -34,10 +34,14 @@ #include "SampleTrack.h" #include "SerializingObject.h" +class QLineEdit; + +namespace lmms::gui +{ + class EffectRackView; class Knob; class MixerLineLcdSpinBox; -class QLineEdit; class SampleTrackView; @@ -96,4 +100,7 @@ private: +} // namespace lmms::gui + + #endif diff --git a/include/Scale.h b/include/Scale.h index a9321fe40..3a92dd689 100644 --- a/include/Scale.h +++ b/include/Scale.h @@ -32,6 +32,9 @@ #include "SerializingObject.h" +namespace lmms +{ + class Interval : public SerializingObject { public: @@ -83,4 +86,7 @@ private: }; + +} // namespace lmms + #endif diff --git a/include/SendButtonIndicator.h b/include/SendButtonIndicator.h index 33d8cac64..ec4a90db3 100644 --- a/include/SendButtonIndicator.h +++ b/include/SendButtonIndicator.h @@ -1,13 +1,44 @@ +/* + * 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 #include +namespace lmms +{ + class FloatModel; + +namespace gui +{ + class MixerLine; class MixerView; + class SendButtonIndicator : public QLabel { public: @@ -27,4 +58,9 @@ private: FloatModel * getSendModel(); }; + +} // namespace gui + +} // namespace lmms + #endif // SENDBUTTONINDICATOR_H diff --git a/include/SerializingObject.h b/include/SerializingObject.h index aba8c7b0f..e32d5d046 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 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/SetupDialog.h b/include/SetupDialog.h index d0878e462..28668d8e9 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: QLabel * restartWarningLbl; }; + + +} // namespace lmms::gui + #endif diff --git a/include/SharedMemory.h b/include/SharedMemory.h index bc649110b..32a40ff25 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 @@ private: } // namespace detail + template class SharedMemory { @@ -140,4 +146,6 @@ private: detail::SharedMemoryData m_data; }; +} // namespace lmms + #endif // SHARED_MEMORY_H diff --git a/include/SideBar.h b/include/SideBar.h index 7ed52efc3..70bac6385 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: } ; +} // namespace lmms::gui + #endif diff --git a/include/SideBarWidget.h b/include/SideBarWidget.h index 95c6ab9ed..71a33a3ce 100644 --- a/include/SideBarWidget.h +++ b/include/SideBarWidget.h @@ -31,6 +31,9 @@ class QPushButton; +namespace lmms::gui +{ + class SideBarWidget : public QWidget { @@ -84,4 +87,7 @@ private: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Song.h b/include/Song.h index ae8c697b5..cfe63a2ea 100644 --- a/include/Song.h +++ b/include/Song.h @@ -37,12 +37,22 @@ #include "MeterModel.h" #include "VstSyncController.h" +namespace lmms +{ class AutomationTrack; class Keymap; class MidiClip; class Scale; + +namespace gui +{ + class TimeLineWidget; +class SongEditor; +class ControllerRackView; + +} const bpm_t MinTempo = 10; @@ -114,7 +124,7 @@ public: { return m_jumped; } - TimeLineWidget * m_timeLine; + gui::TimeLineWidget * m_timeLine; private: float m_currentFrame; @@ -361,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(); @@ -492,20 +502,19 @@ private: AutomatedValueMap m_oldAutomatedValues; - friend class LmmsCore; - friend class SongEditor; - friend class mainWindow; - friend class ControllerRackView; + friend class Engine; + friend class gui::SongEditor; + friend class gui::ControllerRackView; signals: void projectLoaded(); 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(); @@ -515,4 +524,6 @@ signals: } ; +} // namespace lmms + #endif diff --git a/include/SongEditor.h b/include/SongEditor.h index db52f7352..29a9be0bf 100644 --- a/include/SongEditor.h +++ b/include/SongEditor.h @@ -34,14 +34,22 @@ class QLabel; class QScrollBar; +namespace lmms +{ + +class Song; +class ComboBoxModel; + +namespace gui +{ + + class ActionGroup; class AutomatableSlider; class ComboBox; -class ComboBoxModel; class LcdSpinBox; class MeterDialog; class PositionLine; -class Song; class TextFloat; class TimeLineWidget; @@ -74,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 ); @@ -215,4 +223,9 @@ private: QAction* m_removeBarAction; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/StepRecorder.h b/include/StepRecorder.h index 864faef4b..b89fadb15 100644 --- a/include/StepRecorder.h +++ b/include/StepRecorder.h @@ -28,18 +28,26 @@ #include "Note.h" -class MidiClip; -class PianoRoll; class QKeyEvent; class QMouseEvent; + +namespace lmms +{ + +class MidiClip; + +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); @@ -81,8 +89,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; @@ -141,4 +149,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 512ab5b35..4067b0001 100644 --- a/include/StepRecorderWidget.h +++ b/include/StepRecorderWidget.h @@ -28,6 +28,9 @@ #include "TimePos.h" +namespace lmms::gui +{ + class StepRecorderWidget : public QWidget { Q_OBJECT @@ -87,7 +90,9 @@ private: const int m_marginRight; signals: - void positionChanged(const TimePos & t); + void positionChanged(const lmms::TimePos & t); } ; +} // namespace lmms::gui + #endif //STEP_RECOREDER_WIDGET_H diff --git a/include/StringPairDrag.h b/include/StringPairDrag.h index 969a12eec..9da2381b0 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 @@ public: } ; +} // namespace lmms::gui + #endif diff --git a/include/SubWindow.h b/include/SubWindow.h index 113db636a..3c73a9dde 100644 --- a/include/SubWindow.h +++ b/include/SubWindow.h @@ -38,6 +38,10 @@ class QPushButton; class QResizeEvent; class QWidget; +namespace lmms::gui +{ + + /** * @brief The SubWindow class * @@ -96,4 +100,8 @@ private slots: void focusChanged( QMdiSubWindow * subWindow ); }; + + +} // namespace lmms::gui + #endif diff --git a/include/SweepOscillator.h b/include/SweepOscillator.h index 0e54e6cce..2e795be3b 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 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/TabBar.h b/include/TabBar.h index 46226618b..9239aef94 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 @@ signals: } ; +} // namespace lmms::gui + #endif diff --git a/include/TabButton.h b/include/TabButton.h index ffb425d71..d5d70fcac 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 @@ private: } ; + +} // namespace lmms::gui + #endif diff --git a/include/TabWidget.h b/include/TabWidget.h index d4a3ec3c9..fdd0123da 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 @@ private: QColor m_tabBorder; // The TabWidget's borders color. } ; + +} // namespace lmms::gui + #endif diff --git a/include/TemplatesMenu.h b/include/TemplatesMenu.h index 049f1f47e..45c7bce4b 100644 --- a/include/TemplatesMenu.h +++ b/include/TemplatesMenu.h @@ -1,9 +1,37 @@ +/* + * 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 #include #include + +namespace lmms::gui +{ + + class TemplatesMenu : public QMenu { Q_OBJECT @@ -18,4 +46,7 @@ private slots: }; + +} // namespace lmms::gui + #endif // TEMPLATESMENU_H diff --git a/include/TempoSyncKnob.h b/include/TempoSyncKnob.h index 3e9fc9738..22a21f3dc 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 @@ private: +} // namespace lmms::gui + #endif diff --git a/include/TempoSyncKnobModel.h b/include/TempoSyncKnobModel.h index b9512aa1a..1e6decfb9 100644 --- a/include/TempoSyncKnobModel.h +++ b/include/TempoSyncKnobModel.h @@ -30,6 +30,17 @@ class QAction; +namespace lmms +{ + +namespace gui +{ + +class TempoSyncKnob; + +} // namespace gui + + class LMMS_EXPORT TempoSyncKnobModel : public FloatModel { Q_OBJECT @@ -72,7 +83,7 @@ public: void setScale( float _new_scale ); signals: - void syncModeChanged( TempoSyncMode _new_mode ); + void syncModeChanged( lmms::TempoSyncKnobModel::TempoSyncMode _new_mode ); void scaleChanged( float _new_scale ); @@ -86,7 +97,7 @@ public slots: protected slots: - void calculateTempoSyncTime( bpm_t _bpm ); + void calculateTempoSyncTime( lmms::bpm_t _bpm ); void updateCustom(); @@ -98,8 +109,10 @@ private: MeterModel m_custom; - friend class TempoSyncKnob; + friend class gui::TempoSyncKnob; } ; +} // namespace lmms + #endif diff --git a/include/TextFloat.h b/include/TextFloat.h index 1df7ed46a..580c3b979 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 @@ private: }; + +} // namespace lmms::gui + #endif diff --git a/include/ThreadableJob.h b/include/ThreadableJob.h index b2b20e9be..8e714ae19 100644 --- a/include/ThreadableJob.h +++ b/include/ThreadableJob.h @@ -29,6 +29,9 @@ #include +namespace lmms +{ + class ThreadableJob { public: @@ -85,4 +88,6 @@ protected: std::atomic m_state; } ; +} // namespace lmms + #endif diff --git a/include/TimeDisplayWidget.h b/include/TimeDisplayWidget.h index 303ce6d5e..d8e38333a 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: } ; +} // namespace lmms::gui + #endif // TIME_DISPLAY_WIDGET_H diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index 7809c042e..4cbddcda4 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; @@ -175,7 +179,7 @@ signals: public slots: - void updatePosition( const TimePos & ); + void updatePosition( const lmms::TimePos & ); void updatePosition() { updatePosition( TimePos() ); @@ -247,7 +251,7 @@ private: signals: - void positionChanged( const TimePos & _t ); + void positionChanged( const lmms::TimePos & _t ); void loopPointStateLoaded( int _n ); void positionMarkerMoved(); void loadBehaviourAtStop( int _n ); @@ -255,4 +259,7 @@ signals: } ; + +} // namespace lmms::gui + #endif diff --git a/include/TimePos.h b/include/TimePos.h index 8b758d9b4..808eede25 100644 --- a/include/TimePos.h +++ b/include/TimePos.h @@ -31,6 +31,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; @@ -113,4 +116,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/include/ToolButton.h b/include/ToolButton.h index 2f64d45b8..c6e80b4c2 100644 --- a/include/ToolButton.h +++ b/include/ToolButton.h @@ -28,6 +28,8 @@ #include +namespace lmms::gui +{ class ToolButton : public QToolButton { @@ -45,5 +47,7 @@ public: } ; +} // namespace lmms::gui + #endif diff --git a/include/ToolPlugin.h b/include/ToolPlugin.h index 8a65147ac..899c31906 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 @@ public: } ; + +} // namespace lmms + #endif diff --git a/include/ToolPluginView.h b/include/ToolPluginView.h index 2b64caaaf..0b702fd1b 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 @@ public: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/Track.h b/include/Track.h index d00ac3783..ec069c38f 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 Clip; + + +namespace gui +{ + class TrackView; +class TrackContainerView; + +} /*! The minimum track height in pixels @@ -93,7 +103,8 @@ public: const f_cnt_t frameBase, int clipNum = -1 ) = 0; - virtual TrackView * createView( TrackContainerView * view ) = 0; + + virtual gui::TrackView * createView( gui::TrackContainerView * view ) = 0; virtual Clip * createClip( const TimePos & pos ) = 0; virtual void saveTrackSpecificSettings( QDomDocument & doc, @@ -233,16 +244,17 @@ private: QColor m_color; bool m_hasColor; - friend class TrackView; + friend class gui::TrackView; signals: void destroyedTrack(); void nameChanged(); - void clipAdded( Clip * ); + void clipAdded( lmms::Clip * ); void colorChanged(); } ; +} // namespace lmms #endif diff --git a/include/TrackContainer.h b/include/TrackContainer.h index 18139a0da..beb7564ad 100644 --- a/include/TrackContainer.h +++ b/include/TrackContainer.h @@ -31,11 +31,19 @@ #include "Track.h" #include "JournallingObject.h" +namespace lmms +{ class AutomationClip; class InstrumentTrack; + +namespace gui +{ + class TrackContainerView; +} + class LMMS_EXPORT TrackContainer : public Model, public JournallingObject { @@ -96,7 +104,7 @@ public: 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); @@ -109,10 +117,11 @@ private: 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 00267bfe8..edcffeb2f 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -39,11 +39,32 @@ class QVBoxLayout; +namespace lmms +{ + class InstrumentTrack; class Track; class TrackContainer; -class TrackView; +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 TrackView; class TrackContainerView : public QWidget, public ModelView, public JournallingObject, @@ -132,8 +153,8 @@ public: 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; @@ -188,24 +209,14 @@ private: signals: - void positionChanged( const TimePos & _pos ); + void positionChanged( const lmms::TimePos & _pos ); } ; -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/TrackContentWidget.h b/include/TrackContentWidget.h index d3bf60488..228a3e739 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -33,10 +33,16 @@ class QMimeData; -class Track; -class ClipView; -class TrackView; +namespace lmms +{ +class Track; + +namespace gui +{ + +class TrackView; +class ClipView; class TrackContentWidget : public QWidget, public JournallingObject { @@ -86,7 +92,7 @@ public: public slots: void update(); - void changePosition( const TimePos & newPos = TimePos( -1 ) ); + void changePosition( const lmms::TimePos & newPos = TimePos( -1 ) ); protected: enum ContextMenuAction @@ -139,5 +145,8 @@ private: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/TrackLabelButton.h b/include/TrackLabelButton.h index a46f418e9..3be64adee 100644 --- a/include/TrackLabelButton.h +++ b/include/TrackLabelButton.h @@ -28,6 +28,9 @@ #include +namespace lmms::gui +{ + class TrackView; class TrackRenameLineEdit; @@ -66,4 +69,7 @@ private: } ; + +} // namespace lmms::gui + #endif diff --git a/include/TrackOperationsWidget.h b/include/TrackOperationsWidget.h index 7680aa7b4..92f1a889c 100644 --- a/include/TrackOperationsWidget.h +++ b/include/TrackOperationsWidget.h @@ -29,6 +29,9 @@ class QPushButton; +namespace lmms::gui +{ + class PixmapButton; class TrackView; @@ -70,8 +73,11 @@ private: friend class TrackView; signals: - void trackRemovalScheduled( TrackView * t ); + void trackRemovalScheduled( lmms::gui::TrackView * t ); } ; + +} // namespace lmms::gui + #endif diff --git a/include/TrackRenameLineEdit.h b/include/TrackRenameLineEdit.h index e681a2d21..4b13ff9b7 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 @@ private: QString m_oldName; } ; +} // namespace lmms::gui + #endif diff --git a/include/TrackView.h b/include/TrackView.h index 4467ecbdb..2f5c5ed28 100644 --- a/include/TrackView.h +++ b/include/TrackView.h @@ -37,12 +37,20 @@ class QMenu; -class FadeButton; +namespace lmms +{ + class Track; -class TrackContainerView; class Clip; +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, @@ -161,11 +169,14 @@ private: private slots: - void createClipView( Clip * clip ); + void createClipView( lmms::Clip * clip ); void muteChanged(); } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/ValueBuffer.h b/include/ValueBuffer.h index f9869de88..24c8e0daa 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 @@ public: void interpolate(float start, float end); }; + +} // namespace lmms + #endif diff --git a/include/VersionedSaveDialog.h b/include/VersionedSaveDialog.h index bb4894500..79ab516b0 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 ec7d9820c..947a65ea2 100644 --- a/include/VstSyncController.h +++ b/include/VstSyncController.h @@ -31,6 +31,9 @@ #include "SharedMemory.h" #include "VstSyncData.h" +namespace lmms +{ + class VstSyncController : public QObject { @@ -78,4 +81,7 @@ private: SharedMemory m_shm; }; + +} // namespace lmms + #endif diff --git a/include/VstSyncData.h b/include/VstSyncData.h index ac1bed218..bf4d42b80 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 @@ -55,4 +59,7 @@ struct VstSyncData #endif } ; + +} // namespace lmms + #endif diff --git a/include/aeffectx.h b/include/aeffectx.h index 7cdfcfe7d..5ba81e6a0 100644 --- a/include/aeffectx.h +++ b/include/aeffectx.h @@ -36,6 +36,7 @@ #define VST_CALL_CONV #endif + template constexpr int32_t CCONST(T a, T b, T c, T d) { @@ -299,5 +300,4 @@ public: typedef intptr_t (VST_CALL_CONV * audioMasterCallback)( AEffect * , int32_t, int32_t, intptr_t, void * , float ); - #endif diff --git a/include/base64.h b/include/base64.h index a0557fe0d..f52d90d13 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 e08669b2b..e99e767a3 100644 --- a/include/denormals.h +++ b/include/denormals.h @@ -8,26 +8,36 @@ #include #ifdef __GNUC__ #include -#endif +#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); #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 + +#endif // __SSE__ // 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()) { @@ -35,8 +45,10 @@ void inline disable_denormals() { } /* FTZ flag */ _MM_SET_FLUSH_ZERO_MODE( _MM_FLUSH_ZERO_ON ); -#endif +#endif // __SSE__ } -#endif +} // namespace lmms + +#endif // DENORMALS_H diff --git a/include/embed.h b/include/embed.h index ea3e3417e..5dd6a41a2 100644 --- a/include/embed.h +++ b/include/embed.h @@ -32,6 +32,9 @@ #include "lmms_basics.h" +namespace lmms +{ + namespace embed { @@ -63,8 +66,8 @@ inline QPixmap getIconPixmap( const QString& _name, //QString getText( const char * _name ); } -#endif +#endif // PLUGIN_NAME class PixmapLoader @@ -133,8 +136,9 @@ public: } } ; -#endif +#endif // PLUGIN_NAME +} // namespace lmms #endif diff --git a/include/endian_handling.h b/include/endian_handling.h index 09953a0ac..b3d122fa3 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 88183fb19..8ba0fc7a0 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 073cb50f1..ee0ccdbf6 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 cb324cd76..3a74334e4 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 cda591c0d..3f7057ef7 100644 --- a/include/lmms_basics.h +++ b/include/lmms_basics.h @@ -35,6 +35,10 @@ #include +namespace lmms +{ + + typedef int32_t bar_t; typedef int32_t tick_t; typedef uint8_t volume_t; @@ -143,4 +147,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 f5a86bc88..7796f6bdf 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 aa043170c..e1de09936 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 6f65c8295..1521ec984 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 cf335ccfb..00a5c3291 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 efb8ba5d6..e68186336 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 @@ private: std::atomic_int m_referenceCount; } ; + +} // namespace lmms + #endif diff --git a/include/volume.h b/include/volume.h index bb9fff228..eaf5ab9ff 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/Amplifier/Amplifier.cpp b/plugins/Amplifier/Amplifier.cpp index 2dfdc9d8c..ced43f1e2 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 843c25bdb..941971ae7 100644 --- a/plugins/Amplifier/Amplifier.h +++ b/plugins/Amplifier/Amplifier.h @@ -30,6 +30,9 @@ #include "Effect.h" #include "AmplifierControls.h" +namespace lmms +{ + class AmplifierEffect : public Effect { public: @@ -50,4 +53,7 @@ private: } ; + +} // namespace lmms + #endif diff --git a/plugins/Amplifier/AmplifierControlDialog.cpp b/plugins/Amplifier/AmplifierControlDialog.cpp index ad2846edb..34114e90b 100644 --- a/plugins/Amplifier/AmplifierControlDialog.cpp +++ b/plugins/Amplifier/AmplifierControlDialog.cpp @@ -30,6 +30,9 @@ #include "Knob.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 d0d7d0aa3..6362d5f72 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 @@ public: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Amplifier/AmplifierControls.cpp b/plugins/Amplifier/AmplifierControls.cpp index 70876be11..307730460 100644 --- a/plugins/Amplifier/AmplifierControls.cpp +++ b/plugins/Amplifier/AmplifierControls.cpp @@ -29,6 +29,8 @@ #include "AmplifierControls.h" #include "Amplifier.h" +namespace lmms +{ AmplifierControls::AmplifierControls( AmplifierEffect* effect ) : EffectControls( effect ), @@ -75,6 +77,6 @@ void AmplifierControls::saveSettings( QDomDocument& doc, QDomElement& _this ) } - +} // namespace lmms diff --git a/plugins/Amplifier/AmplifierControls.h b/plugins/Amplifier/AmplifierControls.h index f0f950fd1..7eaa0f099 100644 --- a/plugins/Amplifier/AmplifierControls.h +++ b/plugins/Amplifier/AmplifierControls.h @@ -29,9 +29,16 @@ #include "EffectControls.h" #include "AmplifierControlDialog.h" +namespace lmms +{ class AmplifierEffect; +namespace gui +{ +class AmplifierControlDialog; +} + class AmplifierControls : public EffectControls { @@ -54,9 +61,9 @@ public: return 4; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new AmplifierControlDialog( this ); + return new gui::AmplifierControlDialog( this ); } @@ -70,9 +77,12 @@ private: FloatModel m_leftModel; FloatModel m_rightModel; - friend class AmplifierControlDialog; + friend class gui::AmplifierControlDialog; friend class AmplifierEffect; } ; + +} // namespace lmms + #endif diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.cpp b/plugins/AudioFileProcessor/AudioFileProcessor.cpp index d3c13511b..b5e991a2c 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessor.cpp @@ -47,6 +47,11 @@ #include "embed.h" #include "plugin_export.h" + +namespace lmms +{ + + extern "C" { @@ -110,13 +115,6 @@ AudioFileProcessor::AudioFileProcessor( InstrumentTrack * _instrument_track ) : -AudioFileProcessor::~AudioFileProcessor() -{ -} - - - - void AudioFileProcessor::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) { @@ -312,9 +310,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 ); } @@ -442,6 +440,8 @@ void AudioFileProcessor::pointChanged( void ) +namespace gui +{ QPixmap * AudioFileProcessorView::s_artwork = nullptr; @@ -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" ); @@ -1242,7 +1242,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; } @@ -1273,6 +1273,7 @@ bool AudioFileProcessorWaveView::knob::checkBound( double _v ) const } +} // namespace gui @@ -1288,3 +1289,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main(Model * model, void *) } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.h b/plugins/AudioFileProcessor/AudioFileProcessor.h index 532a16114..30fcbc502 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.h +++ b/plugins/AudioFileProcessor/AudioFileProcessor.h @@ -35,9 +35,20 @@ #include "SampleBuffer.h" #include "Knob.h" + +namespace lmms +{ + +namespace gui +{ class automatableButtonGroup; -class ComboBox; +class PluginView; +class InstrumentViewFixedSize; +class Knob; class PixmapButton; +class ComboBox; +class AudioFileProcessorView; +} class AudioFileProcessor : public Instrument @@ -45,28 +56,27 @@ 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; } - virtual PluginView * instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; public slots: @@ -84,7 +94,7 @@ private slots: signals: - void isPlaying( f_cnt_t _current_frame ); + void isPlaying( lmms::f_cnt_t _current_frame ); private: @@ -104,16 +114,18 @@ private: 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: @@ -143,7 +155,7 @@ private: Knob * m_endKnob; Knob * m_loopKnob; - PixmapButton * m_openAudioFileButton; + gui::PixmapButton * m_openAudioFileButton; PixmapButton * m_reverseButton; automatableButtonGroup * m_loopGroup; PixmapButton * m_stutterButton; @@ -174,7 +186,7 @@ public: loop } ; - class knob : public ::Knob + class knob : public Knob { const AudioFileProcessorWaveView * m_waveView; const Knob * m_relatedKnob; @@ -182,7 +194,7 @@ public: public: knob( QWidget * _parent ) : - ::Knob( knobBright_26, _parent ), + Knob( knobBright_26, _parent ), m_waveView( 0 ), m_relatedKnob( 0 ) { @@ -223,7 +235,7 @@ public slots: QWidget::update(); } - void isPlaying( f_cnt_t _current_frame ); + void isPlaying( lmms::f_cnt_t _current_frame ); private: @@ -287,6 +299,8 @@ private: } ; +} // namespace gui +} // namespace lmms #endif diff --git a/plugins/BassBooster/BassBooster.cpp b/plugins/BassBooster/BassBooster.cpp index f01e70720..b8ea271ee 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 d3db6e220..9edca3b22 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 @@ private: } ; + +} // namespace lmms + #endif diff --git a/plugins/BassBooster/BassBoosterControlDialog.cpp b/plugins/BassBooster/BassBoosterControlDialog.cpp index f7513e13e..f1e60c3ff 100644 --- a/plugins/BassBooster/BassBoosterControlDialog.cpp +++ b/plugins/BassBooster/BassBoosterControlDialog.cpp @@ -32,6 +32,9 @@ #include "Knob.h" +namespace lmms::gui +{ + BassBoosterControlDialog::BassBoosterControlDialog( BassBoosterControls* controls ) : EffectControlDialog( controls ) @@ -69,3 +72,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 ec636e808..89a60fa1a 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 @@ public: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/BassBooster/BassBoosterControls.cpp b/plugins/BassBooster/BassBoosterControls.cpp index 195f00801..cda00043b 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 e7b61348a..c67ce4d7a 100644 --- a/plugins/BassBooster/BassBoosterControls.h +++ b/plugins/BassBooster/BassBoosterControls.h @@ -28,6 +28,8 @@ #include "EffectControls.h" #include "BassBoosterControlDialog.h" +namespace lmms +{ class BassBoosterEffect; @@ -53,9 +55,9 @@ public: return 3; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new BassBoosterControlDialog( this ); + return new gui::BassBoosterControlDialog( this ); } @@ -68,8 +70,11 @@ private: FloatModel m_gainModel; FloatModel m_ratioModel; - friend class BassBoosterControlDialog; + friend class gui::BassBoosterControlDialog; friend class BassBoosterEffect; } ; + +} // namespace lmms + #endif diff --git a/plugins/BitInvader/BitInvader.cpp b/plugins/BitInvader/BitInvader.cpp index 60c933949..55dd97386 100644 --- a/plugins/BitInvader/BitInvader.cpp +++ b/plugins/BitInvader/BitInvader.cpp @@ -42,6 +42,10 @@ #include "plugin_export.h" +namespace lmms +{ + + static const int wavetableSize = 200; static const float defaultNormalizationFactor = 1.0f; @@ -325,15 +329,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, @@ -571,6 +576,7 @@ void BitInvaderView::normalizeToggled( bool value ) } +} // namespace gui extern "C" @@ -584,3 +590,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/BitInvader/BitInvader.h b/plugins/BitInvader/BitInvader.h index 64d5bbfda..cce524beb 100644 --- a/plugins/BitInvader/BitInvader.h +++ b/plugins/BitInvader/BitInvader.h @@ -33,11 +33,18 @@ #include "Graph.h" #include "MemoryManager.h" -class oscillator; +namespace lmms +{ + + +namespace gui +{ class BitInvaderView; class Knob; class LedCheckBox; class PixmapButton; +} + class BSynth { @@ -85,7 +92,7 @@ public: return( 64 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView * instantiateView( QWidget * _parent ); protected slots: void lengthChanged(); @@ -103,10 +110,12 @@ private: float m_normalizeFactor; - friend class BitInvaderView; + friend class gui::BitInvaderView; } ; +namespace gui +{ class BitInvaderView : public InstrumentViewFixedSize { @@ -153,5 +162,8 @@ private: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/Bitcrush/Bitcrush.cpp b/plugins/Bitcrush/Bitcrush.cpp index 206f6307d..13f880623 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 f309021e1..670742e20 100644 --- a/plugins/Bitcrush/Bitcrush.h +++ b/plugins/Bitcrush/Bitcrush.h @@ -31,6 +31,11 @@ #include "BitcrushControls.h" #include "BasicFilters.h" + +namespace lmms +{ + + class BitcrushEffect : public Effect { public: @@ -78,4 +83,7 @@ private: friend class BitcrushControls; }; + +} // namespace lmms + #endif diff --git a/plugins/Bitcrush/BitcrushControlDialog.cpp b/plugins/Bitcrush/BitcrushControlDialog.cpp index 43117f00b..ddf41508a 100755 --- a/plugins/Bitcrush/BitcrushControlDialog.cpp +++ b/plugins/Bitcrush/BitcrushControlDialog.cpp @@ -32,6 +32,10 @@ #include "LedCheckBox.h" #include "Knob.h" +namespace lmms::gui +{ + + BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) : EffectControlDialog( controls ) { @@ -110,3 +114,6 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) : levels->setLabel( tr( "QUANT" ) ); levels->setHintText( tr( "Levels:" ) , "" ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/plugins/Bitcrush/BitcrushControlDialog.h b/plugins/Bitcrush/BitcrushControlDialog.h index c56b94c5a..49d5bce7e 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 @@ public: } }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Bitcrush/BitcrushControls.cpp b/plugins/Bitcrush/BitcrushControls.cpp index 19886aa75..9acd7d7c0 100644 --- a/plugins/Bitcrush/BitcrushControls.cpp +++ b/plugins/Bitcrush/BitcrushControls.cpp @@ -29,6 +29,10 @@ #include "BitcrushControls.h" #include "Bitcrush.h" +namespace lmms +{ + + BitcrushControls::BitcrushControls( BitcrushEffect * eff ) : EffectControls( eff ), @@ -86,3 +90,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 02c969196..ed69dd704 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 @@ public: 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: BoolModel m_rateEnabled; BoolModel m_depthEnabled; - friend class BitcrushControlDialog; + friend class gui::BitcrushControlDialog; friend class BitcrushEffect; }; + +} // namespace lmms + #endif diff --git a/plugins/CarlaBase/Carla.cpp b/plugins/CarlaBase/Carla.cpp index a09b2367d..6082f00da 100644 --- a/plugins/CarlaBase/Carla.cpp +++ b/plugins/CarlaBase/Carla.cpp @@ -58,6 +58,9 @@ #include "embed.h" +namespace lmms +{ + // this doesn't seem to be defined anywhere static const double ticksPerBeat = 48.0; @@ -145,6 +148,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), @@ -575,7 +579,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 @@ -592,7 +596,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() @@ -602,6 +606,9 @@ void CarlaInstrument::sampleRateChanged() // ------------------------------------------------------------------- +namespace gui +{ + CarlaInstrumentView::CarlaInstrumentView(CarlaInstrument* const instrument, QWidget* const parent) : InstrumentViewFixedSize(instrument, parent), fHandle(instrument->fHandle), @@ -847,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); @@ -1043,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) { @@ -1111,3 +1140,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 98662014b..2010ac3c4 100644 --- a/plugins/CarlaBase/Carla.h +++ b/plugins/CarlaBase/Carla.h @@ -65,8 +65,16 @@ class QLineEdit; class QStringListModel; class QScrollArea; + +namespace lmms +{ + +namespace gui +{ class CarlaParamsView; +class CarlaInstrumentView; class Knob; +} class CarlaParamFloatModel : public FloatModel { @@ -161,9 +169,79 @@ private: // ------------------------------------------------------------------- +class CARLABASE_EXPORT CarlaInstrument : public Instrument +{ + Q_OBJECT + +public: + static const uint32_t kMaxMidiEvents = 512; + + CarlaInstrument(InstrumentTrack* const instrumentTrack, const Descriptor* const descriptor, const bool isPatchbay); + virtual ~CarlaInstrument(); + + // Carla NativeHostDescriptor functions + uint32_t handleGetBufferSize() const; + double handleGetSampleRate() const; + bool handleIsOffline() const; + const NativeTimeInfo* handleGetTimeInfo() const; + void handleUiParameterChanged(const uint32_t index, const float value) const; + void handleUiClosed(); + intptr_t handleDispatcher(const NativeHostDispatcherOpcode opcode, const int32_t index, const intptr_t value, void* const ptr, const float opt); + + // LMMS functions + virtual Flags flags() const; + virtual QString nodeName() const; + virtual void saveSettings(QDomDocument& doc, QDomElement& parent); + 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 gui::PluginView* instantiateView(QWidget* parent); + +signals: + void uiClosed(); + void paramsUpdated(); + +private slots: + void sampleRateChanged(); + void refreshParams(bool init = false); + void clearParamModels(); + void paramModelChanged(uint32_t index); + void updateParamModel(uint32_t index); + +private: + const bool kIsPatchbay; + + NativePluginHandle fHandle; + NativeHostDescriptor fHost; + const NativePluginDescriptor* fDescriptor; + + uint32_t fMidiEventCount; + NativeMidiEvent fMidiEvents[kMaxMidiEvents]; + NativeTimeInfo fTimeInfo; + + // this is only needed because note-offs are being sent during play + QMutex fMutex; + + uint8_t m_paramGroupCount; + QList m_paramModels; + QDomElement m_settingsElem; + + QCompleter* m_paramsCompleter; + QStringListModel* m_completerModel; + + friend class gui::CarlaInstrumentView; + friend class gui::CarlaParamsView; +}; + + +// ------------------------------------------------------------------- + +namespace gui +{ + class CarlaParamsSubWindow : public SubWindow { - Q_OBJECT +Q_OBJECT signals: void uiClosed(); @@ -212,73 +290,6 @@ private: bool mousePress = false; }; -// ------------------------------------------------------------------- - -class CARLABASE_EXPORT CarlaInstrument : public Instrument -{ - Q_OBJECT - -public: - static const uint32_t kMaxMidiEvents = 512; - - CarlaInstrument(InstrumentTrack* const instrumentTrack, const Descriptor* const descriptor, const bool isPatchbay); - virtual ~CarlaInstrument(); - - // Carla NativeHostDescriptor functions - uint32_t handleGetBufferSize() const; - double handleGetSampleRate() const; - bool handleIsOffline() const; - const NativeTimeInfo* handleGetTimeInfo() const; - void handleUiParameterChanged(const uint32_t index, const float value) const; - void handleUiClosed(); - intptr_t handleDispatcher(const NativeHostDispatcherOpcode opcode, const int32_t index, const intptr_t value, void* const ptr, const float opt); - - // LMMS functions - virtual Flags flags() const; - virtual QString nodeName() const; - virtual void saveSettings(QDomDocument& doc, QDomElement& parent); - 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); - -signals: - void uiClosed(); - void paramsUpdated(); - -private slots: - void sampleRateChanged(); - void refreshParams(bool init = false); - void clearParamModels(); - void paramModelChanged(uint32_t index); - void updateParamModel(uint32_t index); - -private: - const bool kIsPatchbay; - - NativePluginHandle fHandle; - NativeHostDescriptor fHost; - const NativePluginDescriptor* fDescriptor; - - uint32_t fMidiEventCount; - NativeMidiEvent fMidiEvents[kMaxMidiEvents]; - NativeTimeInfo fTimeInfo; - - // this is only needed because note-offs are being sent during play - QMutex fMutex; - - uint8_t m_paramGroupCount; - QList m_paramModels; - QDomElement m_settingsElem; - - QCompleter* m_paramsCompleter; - QStringListModel* m_completerModel; - - friend class CarlaInstrumentView; - friend class CarlaParamsView; -}; - - // ------------------------------------------------------------------- class CarlaInstrumentView : public InstrumentViewFixedSize @@ -365,4 +376,9 @@ private: QStringListModel* m_groupFilterModel; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/CarlaPatchbay/CarlaPatchbay.cpp b/plugins/CarlaPatchbay/CarlaPatchbay.cpp index 0c9ca9f01..7f5b2060e 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 d8f0ac978..ad2dd00b8 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 diff --git a/plugins/Compressor/Compressor.cpp b/plugins/Compressor/Compressor.cpp index 6728f403f..606888633 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 374f3f8b6..9b81d9b70 100755 --- a/plugins/Compressor/Compressor.h +++ b/plugins/Compressor/Compressor.h @@ -31,6 +31,10 @@ #include "Effect.h" +namespace lmms +{ + + constexpr float COMP_LOG = -2.2; class CompressorEffect : public Effect @@ -145,7 +149,10 @@ private: 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 106aa7a1d..2f9fed9c2 100755 --- a/plugins/Compressor/CompressorControlDialog.cpp +++ b/plugins/Compressor/CompressorControlDialog.cpp @@ -39,6 +39,10 @@ #include "MainWindow.h" #include "PixmapButton.h" +namespace lmms::gui +{ + + CompressorControlDialog::CompressorControlDialog(CompressorControls* controls) : EffectControlDialog(controls), m_controls(controls), @@ -762,3 +766,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 f20a1d220..1324d7e26 100755 --- a/plugins/Compressor/CompressorControlDialog.h +++ b/plugins/Compressor/CompressorControlDialog.h @@ -31,6 +31,18 @@ #include "EffectControlDialog.h" +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; @@ -47,16 +59,11 @@ 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 automatableButtonGroup; -class CompressorControls; -class EqFader; class Knob; class PixmapButton; -class QLabel; +class EqFader; + class CompressorControlDialog : public EffectControlDialog { @@ -213,4 +220,10 @@ private: friend class CompressorControls; } ; + + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Compressor/CompressorControls.cpp b/plugins/Compressor/CompressorControls.cpp index 01d44c245..81247e900 100755 --- a/plugins/Compressor/CompressorControls.cpp +++ b/plugins/Compressor/CompressorControls.cpp @@ -29,6 +29,8 @@ #include +namespace lmms +{ CompressorControls::CompressorControls(CompressorEffect* effect) : EffectControls(effect), @@ -143,3 +145,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 233b89ddf..852781f38 100755 --- a/plugins/Compressor/CompressorControls.h +++ b/plugins/Compressor/CompressorControls.h @@ -29,6 +29,8 @@ #include "EffectControls.h" +namespace lmms +{ class CompressorEffect; @@ -51,9 +53,9 @@ public: return 28; } - EffectControlDialog* createView() override + gui::EffectControlDialog* createView() override { - return new CompressorControlDialog(this); + return new gui::CompressorControlDialog(this); } private: @@ -93,9 +95,12 @@ private: float m_outPeakL; float m_outPeakR; - friend class CompressorControlDialog; + friend class gui::CompressorControlDialog; friend class CompressorEffect; } ; + +} // namespace lmms + #endif diff --git a/plugins/CrossoverEQ/CrossoverEQ.cpp b/plugins/CrossoverEQ/CrossoverEQ.cpp index 92a3f6a6d..d915afc23 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 d1f76c1e6..4e5872f0c 100644 --- a/plugins/CrossoverEQ/CrossoverEQ.h +++ b/plugins/CrossoverEQ/CrossoverEQ.h @@ -31,6 +31,10 @@ #include "CrossoverEQControls.h" #include "BasicFilters.h" +namespace lmms +{ + + class CrossoverEQEffect : public Effect { public: @@ -74,4 +78,7 @@ private: friend class CrossoverEQControls; }; + +} // namespace lmms + #endif diff --git a/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp b/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp index 7cf2d0c5b..225068177 100644 --- a/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp +++ b/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp @@ -32,6 +32,10 @@ #include "Knob.h" #include "Fader.h" +namespace lmms::gui +{ + + CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * controls ) : EffectControlDialog( controls ) { @@ -110,3 +114,6 @@ CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * contro mute4->setModel( & controls->m_mute4 ); mute4->setToolTip(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 e1e9f013d..f28366557 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 @@ private: QPixmap m_fader_knob; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/CrossoverEQ/CrossoverEQControls.cpp b/plugins/CrossoverEQ/CrossoverEQControls.cpp index 19c1163a3..9758d804a 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 3823a8370..7f9417365 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 @@ public: 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: BoolModel m_mute3; BoolModel m_mute4; - friend class CrossoverEQControlDialog; + friend class gui::CrossoverEQControlDialog; friend class CrossoverEQEffect; }; + +} // namespace lmms + #endif diff --git a/plugins/Delay/DelayControls.cpp b/plugins/Delay/DelayControls.cpp index d4b3220a9..b31488f72 100644 --- a/plugins/Delay/DelayControls.cpp +++ b/plugins/Delay/DelayControls.cpp @@ -28,6 +28,9 @@ #include "DelayEffect.h" #include "Engine.h" +namespace lmms +{ + DelayControls::DelayControls( DelayEffect* effect ): EffectControls( effect ), m_effect ( effect ), @@ -72,3 +75,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 c912a453e..4f4b193f4 100644 --- a/plugins/Delay/DelayControls.h +++ b/plugins/Delay/DelayControls.h @@ -28,10 +28,13 @@ #include "EffectControls.h" #include "DelayControlsDialog.h" +namespace lmms +{ class DelayEffect; + class DelayControls : public EffectControls { Q_OBJECT @@ -49,9 +52,9 @@ public: virtual int controlCount(){ return 5; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new DelayControlsDialog( this ); + return new gui::DelayControlsDialog( this ); } float m_outPeakL; @@ -69,8 +72,11 @@ private: 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 db59b3f39..0354667f5 100755 --- a/plugins/Delay/DelayControlsDialog.cpp +++ b/plugins/Delay/DelayControlsDialog.cpp @@ -31,7 +31,8 @@ #include #include - +namespace lmms::gui +{ DelayControlsDialog::DelayControlsDialog( DelayControls *controls ) : @@ -152,3 +153,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 4b2c0af41..9ab349d4e 100644 --- a/plugins/Delay/DelayControlsDialog.h +++ b/plugins/Delay/DelayControlsDialog.h @@ -27,9 +27,16 @@ #include "EffectControlDialog.h" +namespace lmms +{ + + class DelayControls; class FloatModel; +namespace gui +{ + class DelayControlsDialog : public EffectControlDialog { Q_OBJECT @@ -59,4 +66,9 @@ private: bool m_acceptInput; }; + +} // namespace gui + +} // namespace lmms + #endif // DELAYCONTROLSDIALOG_H diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index 1377498b0..5ce29f8ec 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -30,6 +30,10 @@ #include "plugin_export.h" #include "StereoDelay.h" +namespace lmms +{ + + extern "C" { @@ -166,3 +170,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 c409458ed..2757d6cc4 100644 --- a/plugins/Delay/DelayEffect.h +++ b/plugins/Delay/DelayEffect.h @@ -28,6 +28,9 @@ #include "Effect.h" #include "DelayControls.h" +namespace lmms +{ + class Lfo; class StereoDelay; @@ -51,4 +54,7 @@ private: float m_currentLength; }; + +} // namespace lmms + #endif // DELAYEFFECT_H diff --git a/plugins/Delay/Lfo.cpp b/plugins/Delay/Lfo.cpp index 0360263ef..5a449243a 100644 --- a/plugins/Delay/Lfo.cpp +++ b/plugins/Delay/Lfo.cpp @@ -26,7 +26,8 @@ #include - +namespace lmms +{ Lfo::Lfo( int samplerate ) @@ -45,3 +46,6 @@ float Lfo::tick() return output; } + + +} // namespace lmms diff --git a/plugins/Delay/Lfo.h b/plugins/Delay/Lfo.h index 10b7e2fc0..cb2d13f11 100644 --- a/plugins/Delay/Lfo.h +++ b/plugins/Delay/Lfo.h @@ -28,6 +28,10 @@ #include "lmms_constants.h" +namespace lmms +{ + + class Lfo { public: @@ -77,4 +81,7 @@ private: int m_samplerate; }; + +} // namespace lmms + #endif // LFO_H diff --git a/plugins/Delay/StereoDelay.cpp b/plugins/Delay/StereoDelay.cpp index bdbd63404..e4b8b5641 100644 --- a/plugins/Delay/StereoDelay.cpp +++ b/plugins/Delay/StereoDelay.cpp @@ -25,6 +25,9 @@ #include "StereoDelay.h" #include "lmms_basics.h" +namespace lmms +{ + StereoDelay::StereoDelay( int maxTime, int sampleRate ) { @@ -87,7 +90,4 @@ void StereoDelay::setSampleRate( int sampleRate ) } - - - - +} // namespace lmms diff --git a/plugins/Delay/StereoDelay.h b/plugins/Delay/StereoDelay.h index afea59b9a..0ea0efeed 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 @@ private: float m_maxTime; }; + +} // namespace lmms + #endif // STEREODELAY_H diff --git a/plugins/DualFilter/DualFilter.cpp b/plugins/DualFilter/DualFilter.cpp index 19bed5436..2279ae37d 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 a8eb82075..bfc9dc81b 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 @@ private: } ; + +} // namespace lmms + #endif diff --git a/plugins/DualFilter/DualFilterControlDialog.cpp b/plugins/DualFilter/DualFilterControlDialog.cpp index c6c56befd..0b23f4b8a 100755 --- a/plugins/DualFilter/DualFilterControlDialog.cpp +++ b/plugins/DualFilter/DualFilterControlDialog.cpp @@ -31,12 +31,16 @@ #include "ComboBox.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 ); @@ -83,3 +87,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 f839864d8..a6ac46954 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 @@ public: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/DualFilter/DualFilterControls.cpp b/plugins/DualFilter/DualFilterControls.cpp index 7d54c7c78..e862e6ae1 100644 --- a/plugins/DualFilter/DualFilterControls.cpp +++ b/plugins/DualFilter/DualFilterControls.cpp @@ -32,6 +32,10 @@ #include "embed.h" #include "Engine.h" +namespace lmms +{ + + DualFilterControls::DualFilterControls( DualFilterEffect* effect ) : EffectControls( effect ), m_effect( effect ), @@ -156,6 +160,4 @@ void DualFilterControls::saveSettings( QDomDocument& _doc, QDomElement& _this ) } - - - +} // namespace lmms diff --git a/plugins/DualFilter/DualFilterControls.h b/plugins/DualFilter/DualFilterControls.h index 9713f657a..586b2d15a 100644 --- a/plugins/DualFilter/DualFilterControls.h +++ b/plugins/DualFilter/DualFilterControls.h @@ -30,6 +30,10 @@ #include "DualFilterControlDialog.h" #include "ComboBoxModel.h" +namespace lmms +{ + + class DualFilterEffect; @@ -54,9 +58,9 @@ public: return 11; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new DualFilterControlDialog( this ); + return new gui::DualFilterControlDialog( this ); } @@ -80,9 +84,12 @@ private: FloatModel m_res2Model; FloatModel m_gain2Model; - friend class DualFilterControlDialog; + friend class gui::DualFilterControlDialog; friend class DualFilterEffect; } ; + +} // namespace lmms + #endif diff --git a/plugins/DynamicsProcessor/DynamicsProcessor.cpp b/plugins/DynamicsProcessor/DynamicsProcessor.cpp index 5ead265b2..85f1d94f4 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessor.cpp +++ b/plugins/DynamicsProcessor/DynamicsProcessor.cpp @@ -32,6 +32,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -244,3 +248,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * _parent, void * _data ) } + +} // namespace lmms diff --git a/plugins/DynamicsProcessor/DynamicsProcessor.h b/plugins/DynamicsProcessor/DynamicsProcessor.h index 34e10287c..91763e682 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessor.h +++ b/plugins/DynamicsProcessor/DynamicsProcessor.h @@ -30,6 +30,9 @@ #include "Effect.h" #include "DynamicsProcessorControls.h" +namespace lmms +{ + class RmsHelper; @@ -68,7 +71,6 @@ private: } ; - - +} // namespace lmms #endif diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.cpp b/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.cpp index e8ac87ab5..fb0fee445 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.cpp +++ b/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.cpp @@ -32,6 +32,9 @@ #include "Knob.h" #include "PixmapButton.h" +namespace lmms::gui +{ + DynProcControlDialog::DynProcControlDialog( DynProcControls * _controls ) : @@ -151,3 +154,5 @@ DynProcControlDialog::DynProcControlDialog( _controls, SLOT( subOneClicked() ) ); } + +} // namespace lmms::gui diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h b/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h index 29f8288c8..0b4091b30 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h +++ b/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h @@ -28,10 +28,16 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class DynProcControls; +namespace gui +{ + class DynProcControlDialog : public EffectControlDialog { Q_OBJECT @@ -46,4 +52,9 @@ private: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp b/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp index 263a2a793..f4bd8c77a 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp +++ b/plugins/DynamicsProcessor/DynamicsProcessorControls.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/DynamicsProcessor/DynamicsProcessorControls.h b/plugins/DynamicsProcessor/DynamicsProcessorControls.h index a292b3f9a..cb9aebb6a 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessorControls.h +++ b/plugins/DynamicsProcessor/DynamicsProcessorControls.h @@ -30,6 +30,10 @@ #include "DynamicsProcessorControlDialog.h" #include "Graph.h" +namespace lmms +{ + + class DynProcEffect; @@ -63,9 +67,9 @@ public: return( 6 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog * createView() { - return( new DynProcControlDialog( this ) ); + return( new gui::DynProcControlDialog( this ) ); } @@ -89,9 +93,12 @@ private: graphModel m_wavegraphModel; IntModel m_stereomodeModel; - friend class DynProcControlDialog; + friend class gui::DynProcControlDialog; friend class DynProcEffect; } ; + +} // namespace lmms + #endif diff --git a/plugins/Eq/EqControls.cpp b/plugins/Eq/EqControls.cpp index f33a64675..ad1ffa2ac 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 b314454ea..8a2061cce 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 @@ public: return 42; } - virtual EffectControlDialog* createView(); + virtual gui::EffectControlDialog* createView(); float m_inPeakL; float m_inPeakR; @@ -126,7 +134,11 @@ private: 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 57fdee6f3..c044e2b80 100644 --- a/plugins/Eq/EqControlsDialog.cpp +++ b/plugins/Eq/EqControlsDialog.cpp @@ -38,6 +38,9 @@ #include "EqParameterWidget.h" #include "EqSpectrumView.h" +namespace lmms::gui +{ + EqControlsDialog::EqControlsDialog( EqControls *controls ) : EffectControlDialog( controls ), @@ -234,3 +237,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 b79354355..297737699 100644 --- a/plugins/Eq/EqControlsDialog.h +++ b/plugins/Eq/EqControlsDialog.h @@ -28,10 +28,17 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class BoolModel; class FloatModel; class EqControls; + +namespace gui +{ + class EqBand; class EqParameterWidget; @@ -57,4 +64,9 @@ private: int m_originalHeight; }; + +} // namespace gui + +} // namespace lmms + #endif // EQCONTROLSDIALOG_H diff --git a/plugins/Eq/EqCurve.cpp b/plugins/Eq/EqCurve.cpp index be664b774..704231284 100644 --- a/plugins/Eq/EqCurve.cpp +++ b/plugins/Eq/EqCurve.cpp @@ -33,6 +33,10 @@ #include "lmms_constants.h" +namespace lmms::gui +{ + + EqHandle::EqHandle( int num, int x, int y ): m_numb( num ), m_width( x ), @@ -815,3 +819,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 6bc3f8871..c7e7d0688 100644 --- a/plugins/Eq/EqCurve.h +++ b/plugins/Eq/EqCurve.h @@ -28,6 +28,9 @@ #include +namespace lmms::gui +{ + enum{ highpass=1, @@ -134,4 +137,7 @@ private: float m_scale; }; + +} // namespace lmms::gui + #endif // EQCURVE_H diff --git a/plugins/Eq/EqEffect.cpp b/plugins/Eq/EqEffect.cpp index 3b46143e6..7a9b5b15e 100644 --- a/plugins/Eq/EqEffect.cpp +++ b/plugins/Eq/EqEffect.cpp @@ -30,6 +30,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -363,3 +367,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 b94ddef26..3697a11e2 100644 --- a/plugins/Eq/EqEffect.h +++ b/plugins/Eq/EqEffect.h @@ -28,6 +28,8 @@ #include "EqControls.h" #include "EqFilter.h" +namespace lmms +{ class EqEffect : public Effect @@ -95,4 +97,7 @@ private: void setBandPeaks( EqAnalyser * fft , int ); }; + +} // namespace lmms + #endif // EQEFFECT_H diff --git a/plugins/Eq/EqFader.h b/plugins/Eq/EqFader.h index 0df66f7b7..1601081e9 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: FloatModel* m_model; }; + + +} // namespace lmms::gui + #endif // EQFADER_H diff --git a/plugins/Eq/EqFilter.h b/plugins/Eq/EqFilter.h index 5223fdeda..7361c751c 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 @@ protected: }; +} // namespace lmms #endif // EQFILTER_H diff --git a/plugins/Eq/EqParameterWidget.cpp b/plugins/Eq/EqParameterWidget.cpp index a919f2773..393421291 100644 --- a/plugins/Eq/EqParameterWidget.cpp +++ b/plugins/Eq/EqParameterWidget.cpp @@ -38,6 +38,9 @@ #include "lmms_constants.h" +namespace lmms::gui +{ + EqParameterWidget::EqParameterWidget( QWidget *parent, EqControls * controls ) : QWidget( parent ), @@ -245,3 +248,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 28d01efbe..abfe5a9bb 100644 --- a/plugins/Eq/EqParameterWidget.h +++ b/plugins/Eq/EqParameterWidget.h @@ -30,11 +30,19 @@ #include +namespace lmms +{ + class BoolModel; class EqControls; +class FloatModel; + + +namespace gui +{ + class EqCurve; class EqHandle; -class FloatModel; class EqBand { @@ -93,4 +101,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 e65a12ea9..24e812049 100644 --- a/plugins/Eq/EqSpectrumView.cpp +++ b/plugins/Eq/EqSpectrumView.cpp @@ -33,6 +33,10 @@ #include "MainWindow.h" #include "lmms_constants.h" +namespace lmms +{ + + EqAnalyser::EqAnalyser() : m_framesFilledUp ( 0 ), m_energy ( 0 ), @@ -176,6 +180,8 @@ void EqAnalyser::clear() +namespace gui +{ EqSpectrumView::EqSpectrumView(EqAnalyser *b, QWidget *_parent) : QWidget( _parent ), @@ -298,3 +304,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 40a24868d..c9bfebeb5 100644 --- a/plugins/Eq/EqSpectrumView.h +++ b/plugins/Eq/EqSpectrumView.h @@ -29,6 +29,9 @@ #include "fft_helpers.h" #include "lmms_basics.h" +namespace lmms +{ + const int MAX_BANDS = 2048; class EqAnalyser @@ -63,7 +66,8 @@ private: }; - +namespace gui +{ class EqSpectrumView : public QWidget { @@ -96,4 +100,10 @@ private: float bandToFreq ( int index ); }; + + +} // namespace gui + +} // namespace lmms + #endif // EQSPECTRUMVIEW_H diff --git a/plugins/Flanger/FlangerControls.cpp b/plugins/Flanger/FlangerControls.cpp index 1b4007b38..7402216ee 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 54ef38a1c..1d112bc99 100644 --- a/plugins/Flanger/FlangerControls.h +++ b/plugins/Flanger/FlangerControls.h @@ -28,6 +28,9 @@ #include "EffectControls.h" #include "FlangerControlsDialog.h" +namespace lmms +{ + class FlangerEffect; @@ -49,9 +52,9 @@ public: { return 7; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new FlangerControlsDialog( this ); + return new gui::FlangerControlsDialog( this ); } private slots: @@ -68,9 +71,12 @@ private: 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 3c9b463fb..5edab2894 100644 --- a/plugins/Flanger/FlangerControlsDialog.cpp +++ b/plugins/Flanger/FlangerControlsDialog.cpp @@ -29,7 +29,8 @@ #include "LedCheckBox.h" #include "TempoSyncKnob.h" - +namespace lmms::gui +{ FlangerControlsDialog::FlangerControlsDialog( FlangerControls *controls ) : @@ -89,3 +90,6 @@ FlangerControlsDialog::FlangerControlsDialog( FlangerControls *controls ) : } + + +} // namespace lmms::gui diff --git a/plugins/Flanger/FlangerControlsDialog.h b/plugins/Flanger/FlangerControlsDialog.h index 3e27bda47..6aed1b6b4 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 @@ public: } }; + +} // namespace gui + +} // namespace lmms + #endif // FLANGERCONTROLSDIALOG_H diff --git a/plugins/Flanger/FlangerEffect.cpp b/plugins/Flanger/FlangerEffect.cpp index 2668b63c5..71cf96e18 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 630513ade..d32429194 100644 --- a/plugins/Flanger/FlangerEffect.h +++ b/plugins/Flanger/FlangerEffect.h @@ -36,6 +36,9 @@ class MonoDelay; class Noise; class QuadratureLfo; +namespace lmms +{ + class FlangerEffect : public Effect { @@ -59,4 +62,7 @@ private: }; + +} // namespace lmms + #endif // FLANGEREFFECT_H diff --git a/plugins/Flanger/MonoDelay.cpp b/plugins/Flanger/MonoDelay.cpp index d43e5b99d..3ec028968 100644 --- a/plugins/Flanger/MonoDelay.cpp +++ b/plugins/Flanger/MonoDelay.cpp @@ -25,6 +25,10 @@ #include "MonoDelay.h" #include "string.h" +namespace lmms +{ + + MonoDelay::MonoDelay( int maxTime , int sampleRate ) { m_buffer = 0; @@ -74,3 +78,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 52898bfe4..2e9324a7d 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 @@ private: float m_maxTime; }; + +} // namespace lmms + #endif // MONODELAY_H diff --git a/plugins/Flanger/Noise.cpp b/plugins/Flanger/Noise.cpp index f2acb16fe..263fb7c45 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 9a3106f3e..9f6e2f2e1 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 @@ private: double inv_randmax; }; + +} // namespace lmms + #endif // NOISE_H diff --git a/plugins/FreeBoy/FreeBoy.cpp b/plugins/FreeBoy/FreeBoy.cpp index 55c7dd79b..67a7ac019 100644 --- a/plugins/FreeBoy/FreeBoy.cpp +++ b/plugins/FreeBoy/FreeBoy.cpp @@ -41,6 +41,10 @@ #include "plugin_export.h" +namespace lmms +{ + + const blip_time_t FRAME_LENGTH = 70224; const long CLOCK_RATE = 4194304; @@ -427,12 +431,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: @@ -721,6 +729,9 @@ void FreeBoyInstrumentView::modelChanged() m_graph->setModel( &p->m_graphModel ); } + +} // namespace gui + extern "C" { @@ -735,3 +746,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 a6bef0af2..6f92b41e9 100644 --- a/plugins/FreeBoy/FreeBoy.h +++ b/plugins/FreeBoy/FreeBoy.h @@ -32,10 +32,19 @@ #include "InstrumentView.h" #include "Graph.h" +namespace lmms +{ + +class NotePlayHandle; + + +namespace gui +{ +class PixmapButton; class FreeBoyInstrumentView; class Knob; -class NotePlayHandle; -class PixmapButton; +} + class FreeBoyInstrument : public Instrument { @@ -57,7 +66,7 @@ public: virtual f_cnt_t desiredReleaseFrames() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); /*public slots: @@ -107,10 +116,14 @@ private: 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 +175,8 @@ private: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/FreeBoy/Gb_Apu_Buffer.cpp b/plugins/FreeBoy/Gb_Apu_Buffer.cpp index 0cd8662ac..f261bc9c0 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 5228b7b8a..0b025bea0 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 @@ private: Stereo_Buffer m_buf; }; + +} // namespace lmms + #endif diff --git a/plugins/GigPlayer/GigPlayer.cpp b/plugins/GigPlayer/GigPlayer.cpp index b2239d895..e3d37baa9 100644 --- a/plugins/GigPlayer/GigPlayer.cpp +++ b/plugins/GigPlayer/GigPlayer.cpp @@ -55,6 +55,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -703,9 +707,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 ); } @@ -907,6 +911,9 @@ void GigInstrument::updateSampleRate() +namespace gui +{ + class gigKnob : public Knob { @@ -1094,6 +1101,7 @@ void GigInstrumentView::showPatchDialog() } +} // namespace gui // Store information related to playing a sample from the GIG file @@ -1396,3 +1404,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 288146b60..c192ee4ae 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 @@ public: return IsSingleStreamed|IsNotBendable; } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); QString getCurrentPatchName(); @@ -283,8 +293,8 @@ private: // 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 @@ private: // samples void addSamples( GigNote & gignote, bool wantReleaseSample ); - friend class GigInstrumentView; + friend class gui::GigInstrumentView; signals: void fileLoading(); @@ -332,6 +342,8 @@ signals: } ; +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 3d75dd216..a5066c2af 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 ae00f660a..c43b4cb5c 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 @@ private: QLabel * m_patchLabel; }; + +} // namespace lmms::gui + #endif diff --git a/plugins/HydrogenImport/HydrogenImport.cpp b/plugins/HydrogenImport/HydrogenImport.cpp index 7e13d2351..9dc0950fb 100644 --- a/plugins/HydrogenImport/HydrogenImport.cpp +++ b/plugins/HydrogenImport/HydrogenImport.cpp @@ -14,6 +14,11 @@ #include "plugin_export.h" #define MAX_LAYERS 4 + +namespace lmms +{ + + extern "C" { @@ -351,3 +356,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 d19d1e8dd..657d61f0c 100644 --- a/plugins/HydrogenImport/HydrogenImport.h +++ b/plugins/HydrogenImport/HydrogenImport.h @@ -5,6 +5,9 @@ #include "ImportFilter.h" +namespace lmms +{ + class HydrogenImport : public ImportFilter { @@ -14,12 +17,16 @@ public: 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 217f95f34..0aaf7d1c8 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 @@ public: 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 3ca6572a9..227440501 100644 --- a/plugins/HydrogenImport/local_file_mgr.cpp +++ b/plugins/HydrogenImport/local_file_mgr.cpp @@ -8,6 +8,9 @@ #include "LocalFileMng.h" +namespace lmms +{ + /* New QtXml based methods */ @@ -227,3 +230,5 @@ QDomDocument LocalFileMng::openXmlDocument( const QString& filename ) return doc; } + +} // namespace lmms diff --git a/plugins/Kicker/Kicker.cpp b/plugins/Kicker/Kicker.cpp index de14f4af7..4c5fa77f8 100644 --- a/plugins/Kicker/Kicker.cpp +++ b/plugins/Kicker/Kicker.cpp @@ -40,6 +40,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -220,12 +224,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 @@ -361,7 +367,7 @@ void KickerInstrumentView::modelChanged() } - +} // namespace gui extern "C" @@ -377,5 +383,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 f63f68c9c..f48a5ab12 100644 --- a/plugins/Kicker/Kicker.h +++ b/plugins/Kicker/Kicker.h @@ -32,17 +32,22 @@ #include "InstrumentView.h" #include "TempoSyncKnobModel.h" -class Knob; -class LedCheckBox; - +namespace lmms +{ #define KICKER_PRESET_VERSION 1 -class KickerInstrumentView; class NotePlayHandle; +namespace gui +{ +class Knob; +class LedCheckBox; +class KickerInstrumentView; +} + class KickerInstrument : public Instrument { @@ -70,7 +75,7 @@ public: return( 512 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); private: @@ -90,11 +95,14 @@ private: IntModel m_versionModel; - friend class KickerInstrumentView; + friend class gui::KickerInstrumentView; } ; +namespace gui +{ + class KickerInstrumentView : public InstrumentViewFixedSize { @@ -123,5 +131,8 @@ private: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/Kicker/KickerOsc.h b/plugins/Kicker/KickerOsc.h index 1375725b3..3a263ffc8 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 @@ private: }; +} // namespace lmms + #endif diff --git a/plugins/LadspaBrowser/LadspaBrowser.cpp b/plugins/LadspaBrowser/LadspaBrowser.cpp index 97282c309..d40b855fd 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.cpp +++ b/plugins/LadspaBrowser/LadspaBrowser.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 ) : @@ -189,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; @@ -199,13 +203,13 @@ 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(); } +} // namespace gui - - +} // namespace lmms diff --git a/plugins/LadspaBrowser/LadspaBrowser.h b/plugins/LadspaBrowser/LadspaBrowser.h index 69c9d6263..f1f88872c 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.h +++ b/plugins/LadspaBrowser/LadspaBrowser.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 @@ -43,7 +50,7 @@ public: public slots: - void showPorts( const ladspa_key_t & _key ); + void showPorts( const ::lmms::ladspa_key_t & _key ); private: @@ -52,7 +59,10 @@ private: QWidget * createTab( QWidget * _parent, const QString & _txt, LadspaPluginType _type ); -} ; +}; + + +} // namespace gui class LadspaBrowser : public ToolPlugin @@ -61,9 +71,9 @@ public: 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 @@ public: } ; +} // namespace lmms + #endif diff --git a/plugins/LadspaBrowser/LadspaDescription.cpp b/plugins/LadspaBrowser/LadspaDescription.cpp index 49c16a695..5b2364d6f 100644 --- a/plugins/LadspaBrowser/LadspaDescription.cpp +++ b/plugins/LadspaBrowser/LadspaDescription.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/LadspaBrowser/LadspaDescription.h b/plugins/LadspaBrowser/LadspaDescription.h index 01495663a..0e54acd32 100644 --- a/plugins/LadspaBrowser/LadspaDescription.h +++ b/plugins/LadspaBrowser/LadspaDescription.h @@ -35,6 +35,9 @@ class QListWidgetItem; class QScrollArea; +namespace lmms::gui +{ + class LadspaDescription : public QWidget { @@ -45,7 +48,7 @@ public: signals: - void doubleClicked( const ladspa_key_t & ); + void doubleClicked( const ::lmms::ladspa_key_t & ); private: @@ -64,6 +67,6 @@ private slots: } ; - +} // namespace lmms::gui #endif diff --git a/plugins/LadspaBrowser/LadspaPortDialog.cpp b/plugins/LadspaBrowser/LadspaPortDialog.cpp index 20f25ece2..ab542ce00 100644 --- a/plugins/LadspaBrowser/LadspaPortDialog.cpp +++ b/plugins/LadspaBrowser/LadspaPortDialog.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/LadspaBrowser/LadspaPortDialog.h b/plugins/LadspaBrowser/LadspaPortDialog.h index 3b66e7ec6..1473b1ecf 100644 --- a/plugins/LadspaBrowser/LadspaPortDialog.h +++ b/plugins/LadspaBrowser/LadspaPortDialog.h @@ -31,7 +31,8 @@ #include "LadspaManager.h" - +namespace lmms::gui +{ class LadspaPortDialog : public QDialog @@ -44,6 +45,6 @@ public: }; - +} // namespace lmms::gui #endif diff --git a/plugins/LadspaEffect/LadspaControlDialog.cpp b/plugins/LadspaEffect/LadspaControlDialog.cpp index a5be83d80..199982bb0 100644 --- a/plugins/LadspaEffect/LadspaControlDialog.cpp +++ b/plugins/LadspaEffect/LadspaControlDialog.cpp @@ -37,6 +37,8 @@ #include "LadspaControlView.h" #include "LedCheckBox.h" +namespace lmms::gui +{ LadspaControlDialog::LadspaControlDialog( LadspaControls * _ctl ) : @@ -141,11 +143,10 @@ 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 ); } - - +} // namespace lmms::gui diff --git a/plugins/LadspaEffect/LadspaControlDialog.h b/plugins/LadspaEffect/LadspaControlDialog.h index 86468112d..3a102599b 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; @@ -44,7 +54,7 @@ public: private slots: - void updateEffectView( LadspaControls * _ctl ); + void updateEffectView( lmms::LadspaControls * _ctl ); private: @@ -53,4 +63,9 @@ private: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/LadspaEffect/LadspaControls.cpp b/plugins/LadspaEffect/LadspaControls.cpp index 9399fce03..1480da743 100644 --- a/plugins/LadspaEffect/LadspaControls.cpp +++ b/plugins/LadspaEffect/LadspaControls.cpp @@ -28,6 +28,9 @@ #include "LadspaControl.h" #include "LadspaEffect.h" +namespace lmms +{ + LadspaControls::LadspaControls( LadspaEffect * _eff ) : EffectControls( _eff ), @@ -190,5 +193,4 @@ void LadspaControls::updateLinkStatesFromGlobal() } - - +} // namespace lmms diff --git a/plugins/LadspaEffect/LadspaControls.h b/plugins/LadspaEffect/LadspaControls.h index 0a157009c..e8f8863cf 100644 --- a/plugins/LadspaEffect/LadspaControls.h +++ b/plugins/LadspaEffect/LadspaControls.h @@ -28,6 +28,9 @@ #include "EffectControls.h" #include "LadspaControlDialog.h" +namespace lmms +{ + class LadspaControl; typedef QVector control_list_t; @@ -54,9 +57,9 @@ public: return "ladspacontrols"; } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return new LadspaControlDialog( this ); + return new gui::LadspaControlDialog( this ); } @@ -75,13 +78,16 @@ private: QVector m_controls; - friend class LadspaControlDialog; + friend class gui::LadspaControlDialog; friend class LadspaEffect; signals: - void effectModelChanged( LadspaControls * ); + void effectModelChanged( lmms::LadspaControls * ); } ; + +} // namespace lmms + #endif diff --git a/plugins/LadspaEffect/LadspaEffect.cpp b/plugins/LadspaEffect/LadspaEffect.cpp index b2e119af7..a26e35eb7 100644 --- a/plugins/LadspaEffect/LadspaEffect.cpp +++ b/plugins/LadspaEffect/LadspaEffect.cpp @@ -44,6 +44,10 @@ #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -604,5 +608,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 a46099f93..153e2adeb 100644 --- a/plugins/LadspaEffect/LadspaEffect.h +++ b/plugins/LadspaEffect/LadspaEffect.h @@ -33,6 +33,9 @@ #include "LadspaControls.h" #include "LadspaManager.h" +namespace lmms +{ + typedef struct PortDescription port_desc_t; typedef QVector multi_proc_t; @@ -88,4 +91,7 @@ private: } ; + +} // namespace lmms + #endif diff --git a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp index dfd302d6c..15b3edf68 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 3f47734f9..36edeebd3 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 @@ public: static ladspa_key_t subPluginKeyToLadspaKey( const Key * _key ); -} ; +}; + + +} // namespace lmms #endif diff --git a/plugins/Lb302/Lb302.cpp b/plugins/Lb302/Lb302.cpp index 949f85510..999b66151 100644 --- a/plugins/Lb302/Lb302.cpp +++ b/plugins/Lb302/Lb302.cpp @@ -68,6 +68,9 @@ // Old config // +namespace lmms +{ + //#define engine::audioEngine()->processingSampleRate() 44100.0f const float sampleRateCutoff = 44100.0f; @@ -802,11 +805,14 @@ 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 ) @@ -1029,6 +1035,8 @@ void Lb302SynthView::modelChanged() } +} // namespace gui + extern "C" { @@ -1045,3 +1053,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 f7fa9ea84..550c3d00a 100644 --- a/plugins/Lb302/Lb302.h +++ b/plugins/Lb302/Lb302.h @@ -38,13 +38,23 @@ #include "NotePlayHandle.h" #include +namespace lmms +{ + + static const int NUM_FILTERS = 2; +class NotePlayHandle; + + +namespace gui +{ class automatableButtonGroup; class Knob; class Lb302SynthView; class LedCheckBox; -class NotePlayHandle; +} + class Lb302FilterKnobState { @@ -163,7 +173,7 @@ public: return 0; //4048; } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); private: void processNote( NotePlayHandle * n ); @@ -249,7 +259,7 @@ private: int process(sampleFrame *outbuf, const int size); - friend class Lb302SynthView; + friend class gui::Lb302SynthView; NotePlayHandle * m_playingNote; NotePlayHandleList m_notes; @@ -257,6 +267,10 @@ private: } ; +namespace gui +{ + + class Lb302SynthView : public InstrumentViewFixedSize { Q_OBJECT @@ -284,4 +298,9 @@ private: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Lv2Effect/Lv2Effect.cpp b/plugins/Lv2Effect/Lv2Effect.cpp index 3d6a114d1..d3755a2c9 100644 --- a/plugins/Lv2Effect/Lv2Effect.cpp +++ b/plugins/Lv2Effect/Lv2Effect.cpp @@ -31,6 +31,8 @@ #include "plugin_export.h" +namespace lmms +{ extern "C" @@ -113,3 +115,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 b9e4e06b0..7e1457777 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 @@ private: std::vector m_tmpOutputSmps; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/plugins/Lv2Effect/Lv2FxControlDialog.cpp b/plugins/Lv2Effect/Lv2FxControlDialog.cpp index 267923561..d10c01cd4 100644 --- a/plugins/Lv2Effect/Lv2FxControlDialog.cpp +++ b/plugins/Lv2Effect/Lv2FxControlDialog.cpp @@ -28,6 +28,9 @@ #include "Lv2FxControls.h" +namespace lmms::gui +{ + Lv2FxControlDialog::Lv2FxControlDialog(Lv2FxControls *controls) : EffectControlDialog(controls), @@ -67,3 +70,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 3abdb300d..c749dc124 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 @@ private: }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Lv2Effect/Lv2FxControls.cpp b/plugins/Lv2Effect/Lv2FxControls.cpp index 99d4162d8..a865151dd 100644 --- a/plugins/Lv2Effect/Lv2FxControls.cpp +++ b/plugins/Lv2Effect/Lv2FxControls.cpp @@ -30,7 +30,8 @@ #include "Lv2Effect.h" #include "Lv2FxControlDialog.h" - +namespace lmms +{ Lv2FxControls::Lv2FxControls(class Lv2Effect *effect, const QString& uri) : @@ -71,9 +72,9 @@ int Lv2FxControls::controlCount() -EffectControlDialog *Lv2FxControls::createView() +gui::EffectControlDialog *Lv2FxControls::createView() { - return new Lv2FxControlDialog(this); + return new gui::Lv2FxControlDialog(this); } @@ -101,3 +102,4 @@ void Lv2FxControls::setNameFromFile(const QString &name) } +} // namespace lmms diff --git a/plugins/Lv2Effect/Lv2FxControls.h b/plugins/Lv2Effect/Lv2FxControls.h index e5449a4f7..952e4db6c 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 @@ public: } int controlCount() override; - EffectControlDialog *createView() override; + gui::EffectControlDialog* createView() override; private slots: void changeControl(); @@ -54,8 +63,11 @@ private: DataFile::Types settingsType() override; void setNameFromFile(const QString &name) override; - friend class Lv2FxControlDialog; + friend class gui::Lv2FxControlDialog; friend class Lv2Effect; }; + +} // namespace lmms + #endif diff --git a/plugins/Lv2Instrument/Lv2Instrument.cpp b/plugins/Lv2Instrument/Lv2Instrument.cpp index b94e30aef..f7e0a2b37 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 bb4f797fa..116b3ce05 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.h +++ b/plugins/Lv2Instrument/Lv2Instrument.h @@ -37,6 +37,15 @@ // currently only MIDI works #define LV2_INSTRUMENT_USE_MIDI +namespace lmms +{ + +namespace gui +{ + +class Lv2InsView; + +} class Lv2Instrument : public Instrument, public Lv2ControlBase { @@ -81,7 +90,7 @@ public: return IsSingleStreamed; #endif } - PluginView *instantiateView(QWidget *parent) override; + gui::PluginView* instantiateView(QWidget *parent) override; private slots: void updatePitchRange(); @@ -95,13 +104,17 @@ private: int m_runningNotes[NumKeys]; #endif - friend class Lv2InsView; + friend class gui::Lv2InsView; }; +namespace gui +{ + + class Lv2InsView : public InstrumentView, public Lv2ViewBase { - Q_OBJECT +Q_OBJECT public: Lv2InsView(Lv2Instrument *_instrument, QWidget *_parent); @@ -114,4 +127,9 @@ private: }; +} // namespace gui + + +} // namespace lmms + #endif // LV2_INSTRUMENT_H diff --git a/plugins/MidiExport/MidiExport.cpp b/plugins/MidiExport/MidiExport.cpp index a150b424a..6f0f5a11e 100644 --- a/plugins/MidiExport/MidiExport.cpp +++ b/plugins/MidiExport/MidiExport.cpp @@ -35,6 +35,10 @@ #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -359,3 +363,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 fd73442b5..f443c965f 100644 --- a/plugins/MidiExport/MidiExport.h +++ b/plugins/MidiExport/MidiExport.h @@ -33,6 +33,9 @@ class QDomNode; +namespace lmms +{ + const int BUFFER_SIZE = 50*1024; typedef MidiFile::MIDITrack MTrack; @@ -62,7 +65,7 @@ public: MidiExport(); ~MidiExport(); - virtual PluginView *instantiateView(QWidget *) + virtual gui::PluginView* instantiateView(QWidget *) { return nullptr; } @@ -85,4 +88,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index a57a425a2..e6cf644cf 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -50,6 +50,10 @@ #include "portsmf/allegro.h" +namespace lmms +{ + + #define makeID(_c0, _c1, _c2, _c3) \ ( 0 | \ ( ( _c0 ) | ( ( _c1 ) << 8 ) | ( ( _c2 ) << 16 ) | ( ( _c3 ) << 24 ) ) ) @@ -101,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). " @@ -114,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 " @@ -305,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 ); @@ -654,3 +658,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 2edcbe926..a7ab478a2 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 @@ public: MidiImport( const QString & _file ); virtual ~MidiImport(); - virtual PluginView * instantiateView( QWidget * ) + virtual gui::PluginView* instantiateView( QWidget * ) { return( nullptr ); } @@ -125,4 +128,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/plugins/Monstro/Monstro.cpp b/plugins/Monstro/Monstro.cpp index e95b05030..889a89fb0 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 98c5d6600..d6b57cfae 100644 --- a/plugins/Monstro/Monstro.h +++ b/plugins/Monstro/Monstro.h @@ -38,8 +38,6 @@ #include "lmms_math.h" #include "BandLimitedWave.h" -class ComboBox; - // // UI Macros // @@ -66,6 +64,14 @@ class ComboBox; name -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "tinyled_off" ) ); \ name->setToolTip(ttip); +namespace lmms +{ + + +namespace gui +{ + + // UI constants const int O1ROW = 22; const int O2ROW = 22 + 39; @@ -108,6 +114,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 +163,12 @@ const float PW_MIN = 0.25f; const float PW_MAX = 100.0f - PW_MIN; class MonstroInstrument; + +namespace gui +{ class MonstroView; +class ComboBox; +} class MonstroSynth @@ -355,7 +369,7 @@ public: virtual f_cnt_t desiredReleaseFrames() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); public slots: void updateVolume1(); @@ -564,10 +578,15 @@ private: FloatModel m_sub3lfo2; friend class MonstroSynth; - friend class MonstroView; + friend class gui::MonstroView; }; + +namespace gui +{ + + class MonstroView : public InstrumentViewFixedSize { Q_OBJECT @@ -719,4 +738,8 @@ private: }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/MultitapEcho/MultitapEcho.cpp b/plugins/MultitapEcho/MultitapEcho.cpp index 4134436bb..f3d03740c 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 539ae9475..3d6772d24 100644 --- a/plugins/MultitapEcho/MultitapEcho.h +++ b/plugins/MultitapEcho/MultitapEcho.h @@ -31,6 +31,10 @@ #include "RingBuffer.h" #include "BasicFilters.h" +namespace lmms +{ + + class MultitapEchoEffect : public Effect { public: @@ -73,4 +77,6 @@ private: }; +} // namespace lmms + #endif diff --git a/plugins/MultitapEcho/MultitapEchoControlDialog.cpp b/plugins/MultitapEcho/MultitapEchoControlDialog.cpp index ac8f480da..f96ea46ec 100644 --- a/plugins/MultitapEcho/MultitapEchoControlDialog.cpp +++ b/plugins/MultitapEcho/MultitapEchoControlDialog.cpp @@ -33,6 +33,9 @@ #include "TempoSyncKnob.h" #include "LcdSpinBox.h" +namespace lmms::gui +{ + MultitapEchoControlDialog::MultitapEchoControlDialog( MultitapEchoControls * controls ) : EffectControlDialog( controls ) @@ -99,3 +102,6 @@ MultitapEchoControlDialog::MultitapEchoControlDialog( MultitapEchoControls * con swapInputs->setModel( & controls->m_swapInputs ); swapInputs->setToolTip(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 5ea09877e..6104d433e 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 @@ public: } }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/MultitapEcho/MultitapEchoControls.cpp b/plugins/MultitapEcho/MultitapEchoControls.cpp index 4f2fe63fe..4382151af 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 4696f46d9..65311c157 100644 --- a/plugins/MultitapEcho/MultitapEchoControls.h +++ b/plugins/MultitapEcho/MultitapEchoControls.h @@ -30,6 +30,9 @@ #include "MultitapEchoControlDialog.h" #include "Graph.h" +namespace lmms +{ + class MultitapEchoEffect; @@ -55,9 +58,9 @@ public: return( 5 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return( new MultitapEchoControlDialog( this ) ); + return( new gui::MultitapEchoControlDialog( this ) ); } private slots: @@ -83,8 +86,10 @@ private: graphModel m_lpGraph; friend class MultitapEchoEffect; - friend class MultitapEchoControlDialog; + friend class gui::MultitapEchoControlDialog; }; +} // namespace lmms + #endif diff --git a/plugins/Nes/Nes.cpp b/plugins/Nes/Nes.cpp index a84f6e6a4..b774f7efa 100644 --- a/plugins/Nes/Nes.cpp +++ b/plugins/Nes/Nes.cpp @@ -36,6 +36,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -699,9 +703,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 ) ); } @@ -724,6 +728,8 @@ void NesInstrument::updateFreq3() } +namespace gui +{ QPixmap * NesInstrumentView::s_artwork = nullptr; @@ -912,6 +918,9 @@ void NesInstrumentView::modelChanged() } +} // namespace gui + + extern "C" { @@ -925,4 +934,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 f17265c14..f57cca9e7 100644 --- a/plugins/Nes/Nes.h +++ b/plugins/Nes/Nes.h @@ -56,6 +56,11 @@ name -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "nesdc_off" ) ); \ name->setToolTip(ttip); + +namespace lmms +{ + + const float NES_SIMPLE_FILTER = 1.0 / 20.0; // simulate nes analog audio output const float NFB = 895000.0f; const float NOISE_FREQS[16] = @@ -76,9 +81,15 @@ const float NES_MIXING_ALL = 1.0 / ( NES_MIXING_12 + NES_MIXING_34 ); // constan const int MIN_WLEN = 4; -class Knob; class NesInstrument; +namespace gui +{ +class Knob; +class NesInstrumentView; +} // namespace gui + + class NesObject { MM_OPERATORS @@ -218,7 +229,7 @@ public: return( 8 ); } - virtual PluginView * instantiateView( QWidget * parent ); + virtual gui::PluginView* instantiateView( QWidget * parent ); public slots: void updateFreq1(); @@ -288,10 +299,14 @@ private: friend class NesObject; - friend class NesInstrumentView; + friend class gui::NesInstrumentView; }; +namespace gui +{ + + class NesInstrumentView : public InstrumentViewFixedSize { Q_OBJECT @@ -360,4 +375,9 @@ private: static QPixmap * s_artwork; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/OpulenZ/OpulenZ.cpp b/plugins/OpulenZ/OpulenZ.cpp index da85e2d02..6abfb4e19 100644 --- a/plugins/OpulenZ/OpulenZ.cpp +++ b/plugins/OpulenZ/OpulenZ.cpp @@ -58,6 +58,10 @@ #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -388,9 +392,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 ) ); } @@ -673,7 +677,8 @@ void OpulenzInstrument::loadFile( const QString& file ) { - +namespace gui +{ OpulenzInstrumentView::OpulenzInstrumentView( Instrument * _instrument, QWidget * _parent ) : @@ -870,4 +875,6 @@ void OpulenzInstrumentView::modelChanged() } +} // namespace gui +} // namespace lmms diff --git a/plugins/OpulenZ/OpulenZ.h b/plugins/OpulenZ/OpulenZ.h index 7b4868b4f..f2a13ffe0 100644 --- a/plugins/OpulenZ/OpulenZ.h +++ b/plugins/OpulenZ/OpulenZ.h @@ -31,11 +31,19 @@ #include "Instrument.h" #include "InstrumentView.h" -class automatableButtonGroup; class Copl; + + +namespace lmms +{ + +namespace gui +{ class Knob; class LcdSpinBox; class PixmapButton; +class automatableButtonGroup; +} // This one is a flag, MIDI notes take 7 low bits @@ -54,7 +62,7 @@ public: virtual ~OpulenzInstrument(); virtual QString nodeName() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); virtual Flags flags() const { @@ -146,6 +154,9 @@ private: }; +namespace gui +{ + class OpulenzInstrumentView : public InstrumentViewFixedSize { @@ -205,4 +216,9 @@ public: }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Organic/Organic.cpp b/plugins/Organic/Organic.cpp index c2a6fcce4..320769200 100644 --- a/plugins/Organic/Organic.cpp +++ b/plugins/Organic/Organic.cpp @@ -41,6 +41,9 @@ #include "plugin_export.h" +namespace lmms +{ + extern "C" { @@ -61,7 +64,7 @@ Plugin::Descriptor PLUGIN_EXPORT organic_plugin_descriptor = } -QPixmap * OrganicInstrumentView::s_artwork = nullptr; +QPixmap * gui::OrganicInstrumentView::s_artwork = nullptr; float * OrganicInstrument::s_harmonics = nullptr; /*********************************************************************** @@ -392,12 +395,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 @@ -412,7 +417,6 @@ public: - OrganicInstrumentView::OrganicInstrumentView( Instrument * _instrument, QWidget * _parent ) : InstrumentViewFixedSize( _instrument, _parent ), @@ -557,6 +561,7 @@ void OrganicInstrumentView::updateKnobHint() } +} // namespace gui OscillatorObject::OscillatorObject( Model * _parent, int _index ) : @@ -627,8 +632,6 @@ void OscillatorObject::updateDetuning() } - - extern "C" { @@ -652,5 +655,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 b16b2ef9a..b2f5ed518 100644 --- a/plugins/Organic/Organic.h +++ b/plugins/Organic/Organic.h @@ -34,10 +34,19 @@ class QPixmap; -class Knob; +namespace lmms +{ + + class NotePlayHandle; class Oscillator; + +namespace gui +{ +class Knob; class PixmapButton; +class OrganicInstrumentView; +} // namespace gui const int NUM_OSCILLATORS = 8; const int NUM_HARMONICS = 18; @@ -99,7 +108,7 @@ private: virtual ~OscillatorObject(); friend class OrganicInstrument; - friend class OrganicInstrumentView; + friend class gui::OrganicInstrumentView; private slots: @@ -163,15 +172,18 @@ private: 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 diff --git a/plugins/Patman/Patman.cpp b/plugins/Patman/Patman.cpp index 9268b2919..25b055b9c 100644 --- a/plugins/Patman/Patman.cpp +++ b/plugins/Patman/Patman.cpp @@ -46,6 +46,9 @@ #include "plugin_export.h" +namespace lmms +{ + extern "C" { @@ -427,9 +430,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 ) ); } @@ -437,8 +440,8 @@ PluginView * PatmanInstrument::instantiateView( QWidget * _parent ) - - +namespace gui +{ PatmanView::PatmanView( Instrument * _instrument, QWidget * _parent ) : @@ -643,3 +646,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 6aa6497aa..5088068df 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 @@ public: return( 128 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); public slots: @@ -107,7 +114,7 @@ private: void selectSample( NotePlayHandle * _n ); - friend class PatmanView; + friend class gui::PatmanView; signals: void fileChanged( void ); @@ -115,6 +122,9 @@ signals: } ; +namespace gui +{ + class PatmanView : public InstrumentViewFixedSize { @@ -148,5 +158,8 @@ private: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/PeakControllerEffect/PeakControllerEffect.cpp b/plugins/PeakControllerEffect/PeakControllerEffect.cpp index 672e020c4..529437d6e 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffect.cpp +++ b/plugins/PeakControllerEffect/PeakControllerEffect.cpp @@ -33,6 +33,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -157,3 +161,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model * _parent, void * _data ) } + +} // namespace lmms diff --git a/plugins/PeakControllerEffect/PeakControllerEffect.h b/plugins/PeakControllerEffect/PeakControllerEffect.h index 4eeddf45d..3d944a1a6 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffect.h +++ b/plugins/PeakControllerEffect/PeakControllerEffect.h @@ -29,6 +29,10 @@ #include "Effect.h" #include "PeakControllerEffectControls.h" +namespace lmms +{ + + class PeakController; class PeakControllerEffect : public Effect @@ -78,4 +82,7 @@ private: } ; + +} // namespace lmms + #endif diff --git a/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.cpp b/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.cpp index 044a4c60c..b0d6fafc6 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.cpp +++ b/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.cpp @@ -35,6 +35,8 @@ #include "LedCheckBox.h" #include "embed.h" +namespace lmms::gui +{ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog( PeakControllerEffectControls * _controls ) : @@ -104,3 +106,5 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog( setLayout( mainLayout ); } + +} // namespace lmms::gui diff --git a/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h b/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h index cd6a99d2b..721167975 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h +++ b/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h @@ -28,7 +28,13 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class PeakControllerEffectControls; + +namespace gui +{ class Knob; class LedCheckBox; @@ -57,5 +63,8 @@ protected: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/PeakControllerEffect/PeakControllerEffectControls.cpp b/plugins/PeakControllerEffect/PeakControllerEffectControls.cpp index d19b15d37..070c9fbb8 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffectControls.cpp +++ b/plugins/PeakControllerEffect/PeakControllerEffectControls.cpp @@ -30,6 +30,9 @@ #include "PeakControllerEffect.h" #include "Song.h" +namespace lmms +{ + PeakControllerEffectControls:: PeakControllerEffectControls( PeakControllerEffect * _eff ) : @@ -104,6 +107,4 @@ void PeakControllerEffectControls::saveSettings( QDomDocument & _doc, } - - - +} // namespace lmms diff --git a/plugins/PeakControllerEffect/PeakControllerEffectControls.h b/plugins/PeakControllerEffect/PeakControllerEffectControls.h index 7706784f0..278c2f069 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffectControls.h +++ b/plugins/PeakControllerEffect/PeakControllerEffectControls.h @@ -29,8 +29,13 @@ #include "EffectControls.h" #include "PeakControllerEffectControlDialog.h" +namespace lmms +{ + + class PeakControllerEffect; + class PeakControllerEffectControls : public EffectControls { Q_OBJECT @@ -51,9 +56,9 @@ public: { return 1; } - EffectControlDialog * createView() override + gui::EffectControlDialog * createView() override { - return new PeakControllerEffectControlDialog( this ); + return new gui::PeakControllerEffectControlDialog( this ); } @@ -69,10 +74,12 @@ private: BoolModel m_absModel; FloatModel m_amountMultModel; - friend class PeakControllerEffectControlDialog; + friend class gui::PeakControllerEffectControlDialog; friend class PeakControllerEffect; } ; +} // namespace lmms + #endif diff --git a/plugins/ReverbSC/ReverbSC.cpp b/plugins/ReverbSC/ReverbSC.cpp index 2d56d7f48..6faea8c9a 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 3a7a81e8d..0cbeba875 100644 --- a/plugins/ReverbSC/ReverbSC.h +++ b/plugins/ReverbSC/ReverbSC.h @@ -35,6 +35,11 @@ extern "C" { #include "dcblock.h" } + +namespace lmms +{ + + class ReverbSCEffect : public Effect { public: @@ -58,4 +63,7 @@ private: friend class ReverbSCControls; } ; + +} // namespace lmms + #endif diff --git a/plugins/ReverbSC/ReverbSCControlDialog.cpp b/plugins/ReverbSC/ReverbSCControlDialog.cpp index 9c5ae7eab..38b93e234 100644 --- a/plugins/ReverbSC/ReverbSCControlDialog.cpp +++ b/plugins/ReverbSC/ReverbSCControlDialog.cpp @@ -29,6 +29,10 @@ #include "Knob.h" #include "ReverbSCControls.h" +namespace lmms::gui +{ + + ReverbSCControlDialog::ReverbSCControlDialog( ReverbSCControls* controls ) : EffectControlDialog( controls ) { @@ -62,3 +66,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 0d9c1f51a..ba373509a 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 @@ public: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/ReverbSC/ReverbSCControls.cpp b/plugins/ReverbSC/ReverbSCControls.cpp index 11c99f665..4784d416d 100644 --- a/plugins/ReverbSC/ReverbSCControls.cpp +++ b/plugins/ReverbSC/ReverbSCControls.cpp @@ -29,6 +29,10 @@ #include "ReverbSC.h" #include "Engine.h" +namespace lmms +{ + + ReverbSCControls::ReverbSCControls( ReverbSCEffect* effect ) : EffectControls( effect ), m_effect( effect ), @@ -64,3 +68,6 @@ void ReverbSCControls::changeSampleRate() { m_effect->changeSampleRate(); } + + +} // namespace lmms diff --git a/plugins/ReverbSC/ReverbSCControls.h b/plugins/ReverbSC/ReverbSCControls.h index 78423ae8d..2bd76990a 100644 --- a/plugins/ReverbSC/ReverbSCControls.h +++ b/plugins/ReverbSC/ReverbSCControls.h @@ -29,6 +29,10 @@ #include "ReverbSCControlDialog.h" +namespace lmms +{ + + class ReverbSCEffect; class ReverbSCControls : public EffectControls @@ -52,9 +56,9 @@ public: return 4; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new ReverbSCControlDialog( this ); + return new gui::ReverbSCControlDialog( this ); } @@ -69,9 +73,12 @@ private: FloatModel m_colorModel; FloatModel m_outputGainModel; - friend class ReverbSCControlDialog; + friend class gui::ReverbSCControlDialog; friend class ReverbSCEffect; } ; + +} // namespace lmms + #endif diff --git a/plugins/Sf2Player/PatchesDialog.cpp b/plugins/Sf2Player/PatchesDialog.cpp index f9c414ac0..3cba7561f 100644 --- a/plugins/Sf2Player/PatchesDialog.cpp +++ b/plugins/Sf2Player/PatchesDialog.cpp @@ -32,6 +32,9 @@ #include "fluidsynthshims.h" +namespace lmms::gui +{ + // Custom list-view item (as for numerical sort purposes...) class PatchItem : public QTreeWidgetItem @@ -381,4 +384,4 @@ void PatchesDialog::progChanged (QTreeWidgetItem * _curr, QTreeWidgetItem * _pre } - +} // namespace lmms::gui diff --git a/plugins/Sf2Player/PatchesDialog.h b/plugins/Sf2Player/PatchesDialog.h index 73b649a2a..9f80981df 100644 --- a/plugins/Sf2Player/PatchesDialog.h +++ b/plugins/Sf2Player/PatchesDialog.h @@ -34,6 +34,9 @@ class QLabel; +namespace lmms::gui +{ + //---------------------------------------------------------------------------- // qsynthPresetForm -- UI wrapper form. @@ -92,5 +95,7 @@ private: }; +} // namespace lmms::gui + #endif diff --git a/plugins/Sf2Player/Sf2Player.cpp b/plugins/Sf2Player/Sf2Player.cpp index ee9156a0b..8b17f0bb0 100644 --- a/plugins/Sf2Player/Sf2Player.cpp +++ b/plugins/Sf2Player/Sf2Player.cpp @@ -49,6 +49,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -874,15 +878,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 @@ -1182,6 +1187,7 @@ void Sf2InstrumentView::showPatchDialog() } +} // namespace gui extern "C" { @@ -1193,3 +1199,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) } } + + +} // namespace lmms diff --git a/plugins/Sf2Player/Sf2Player.h b/plugins/Sf2Player/Sf2Player.h index aeea1a553..3824595ea 100644 --- a/plugins/Sf2Player/Sf2Player.h +++ b/plugins/Sf2Player/Sf2Player.h @@ -36,16 +36,24 @@ #include "LcdSpinBox.h" #include "MemoryManager.h" -class Sf2InstrumentView; -class Sf2Font; -class Knob; -class NotePlayHandle; -class PixmapButton; - -class PatchesDialog; class QLabel; +namespace lmms +{ + + +class Sf2Font; struct Sf2PluginData; +class NotePlayHandle; + +namespace gui +{ +class Knob; +class PixmapButton; +class Sf2InstrumentView; +class PatchesDialog; +} // namespace gui + class Sf2Instrument : public Instrument { @@ -83,7 +91,7 @@ public: return IsSingleStreamed; } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); QString getCurrentPatchName(); @@ -133,8 +141,8 @@ private: int m_lastMidiPitchRange; int m_channel; - LcdSpinBoxModel m_bankNum; - LcdSpinBoxModel m_patchNum; + gui::LcdSpinBoxModel m_bankNum; + gui::LcdSpinBoxModel m_patchNum; FloatModel m_gain; @@ -159,7 +167,7 @@ private: void noteOff( Sf2PluginData * n ); void renderFrames( f_cnt_t frames, sampleFrame * buf ); - friend class Sf2InstrumentView; + friend class gui::Sf2InstrumentView; signals: void fileLoading(); @@ -185,6 +193,9 @@ public: }; +namespace gui +{ + class Sf2InstrumentView : public InstrumentViewFixedSize { @@ -231,5 +242,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/Sf2Player/fluidsynthshims.h b/plugins/Sf2Player/fluidsynthshims.h index 4302256ba..2ccadce8d 100644 --- a/plugins/Sf2Player/fluidsynthshims.h +++ b/plugins/Sf2Player/fluidsynthshims.h @@ -28,6 +28,7 @@ #include + #if FLUIDSYNTH_VERSION_MAJOR < 2 inline const char* fluid_preset_get_name(fluid_preset_t* preset) diff --git a/plugins/Sfxr/Sfxr.cpp b/plugins/Sfxr/Sfxr.cpp index cdce50430..ad7dd26a7 100644 --- a/plugins/Sfxr/Sfxr.cpp +++ b/plugins/Sfxr/Sfxr.cpp @@ -52,6 +52,10 @@ float frnd(float range) #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -504,9 +508,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 ) ); } @@ -549,6 +553,9 @@ void SfxrInstrument::resetModels() +namespace gui +{ + class SfxrKnob : public Knob { @@ -1115,6 +1122,9 @@ void SfxrInstrumentView::previewSound() +} // namespace gui + + extern "C" { @@ -1128,5 +1138,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 a8ce12efe..4c14d33bb 100644 --- a/plugins/Sfxr/Sfxr.h +++ b/plugins/Sfxr/Sfxr.h @@ -33,6 +33,9 @@ #include "InstrumentView.h" #include "MemoryManager.h" +namespace lmms +{ + enum SfxrWaves { @@ -60,11 +63,15 @@ const int KNOB_BLOCK_SIZE_Y = 40; +class SfxrInstrument; +namespace gui +{ class automatableButtonGroup; class Knob; class PixmapButton; -class SfxrInstrument; +class SfxrInstrumentView; +} @@ -180,7 +187,7 @@ public: virtual QString nodeName() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); void resetModels(); @@ -217,11 +224,14 @@ private: IntModel m_waveFormModel; - friend class SfxrInstrumentView; + friend class gui::SfxrInstrumentView; friend class SfxrSynth; }; +namespace gui +{ + class SfxrInstrumentView : public InstrumentViewFixedSize { @@ -300,5 +310,8 @@ private: }; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/Sid/SidInstrument.cpp b/plugins/Sid/SidInstrument.cpp index 32b0d7a24..450d172cf 100644 --- a/plugins/Sid/SidInstrument.cpp +++ b/plugins/Sid/SidInstrument.cpp @@ -42,6 +42,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + #define C64_PAL_CYCLES_PER_SEC 985248 #define NUMSIDREGS 0x19 @@ -452,13 +456,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 { @@ -785,7 +792,7 @@ void SidInstrumentView::modelChanged() } - +} // namespace gui extern "C" @@ -801,5 +808,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 5f2fa7157..3a92605b6 100644 --- a/plugins/Sid/SidInstrument.h +++ b/plugins/Sid/SidInstrument.h @@ -31,12 +31,19 @@ #include "Instrument.h" #include "InstrumentView.h" +namespace lmms +{ + -class Knob; -class SidInstrumentView; class NotePlayHandle; + +namespace gui +{ +class Knob; class automatableButtonGroup; +class SidInstrumentView; class PixmapButton; +} class VoiceObject : public Model { @@ -68,7 +75,7 @@ private: BoolModel m_testModel; friend class SidInstrument; - friend class SidInstrumentView; + friend class gui::SidInstrumentView; } ; class SidInstrument : public Instrument @@ -104,7 +111,7 @@ public: virtual f_cnt_t desiredReleaseFrames() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); /*public slots: @@ -126,11 +133,14 @@ private: 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 diff --git a/plugins/SpectrumAnalyzer/Analyzer.cpp b/plugins/SpectrumAnalyzer/Analyzer.cpp index e7b23d7b0..de4ac8c68 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 57a11d30a..9013b6745 100644 --- a/plugins/SpectrumAnalyzer/Analyzer.h +++ b/plugins/SpectrumAnalyzer/Analyzer.h @@ -34,6 +34,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 @@ -70,5 +73,8 @@ private: #endif }; + +} // namespace lmms + #endif // ANALYZER_H diff --git a/plugins/SpectrumAnalyzer/DataprocLauncher.h b/plugins/SpectrumAnalyzer/DataprocLauncher.h index d91e0bedf..4325284c9 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 @@ private: LocklessRingBuffer *m_inputBuffer; }; + +} // namespace lmms + #endif // DATAPROCLAUNCHER_H diff --git a/plugins/SpectrumAnalyzer/SaControls.cpp b/plugins/SpectrumAnalyzer/SaControls.cpp index 45490f6b3..1ebfcdca3 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 d75156f74..70a7559f2 100644 --- a/plugins/SpectrumAnalyzer/SaControls.h +++ b/plugins/SpectrumAnalyzer/SaControls.h @@ -30,9 +30,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 { @@ -41,7 +51,7 @@ public: 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; @@ -88,9 +98,13 @@ private: 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 7b6adeb1c..e8344ead5 100644 --- a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp +++ b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp @@ -41,6 +41,10 @@ #include "SaWaterfallView.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 8cbb0ecaa..1504da3dc 100644 --- a/plugins/SpectrumAnalyzer/SaControlsDialog.h +++ b/plugins/SpectrumAnalyzer/SaControlsDialog.h @@ -28,12 +28,19 @@ #include "EffectControlDialog.h" #include "fft_helpers.h" +namespace lmms +{ class SaControls; class SaProcessor; +} + + +namespace lmms::gui +{ + class SaSpectrumView; class SaWaterfallView; - //! Top-level widget holding the configuration GUI and spectrum displays class SaControlsDialog : public EffectControlDialog { @@ -56,4 +63,7 @@ private: SaWaterfallView *m_waterfall; }; + +} // namespace lmms::gui + #endif // SACONTROLSDIALOG_H diff --git a/plugins/SpectrumAnalyzer/SaProcessor.cpp b/plugins/SpectrumAnalyzer/SaProcessor.cpp index 843067988..02fd3d770 100644 --- a/plugins/SpectrumAnalyzer/SaProcessor.cpp +++ b/plugins/SpectrumAnalyzer/SaProcessor.cpp @@ -41,6 +41,9 @@ #include "LocklessRingBuffer.h" #include "SaControls.h" +namespace lmms +{ + SaProcessor::SaProcessor(const SaControls *controls) : m_controls(controls), @@ -689,3 +692,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 b331a9c09..66b79788d 100644 --- a/plugins/SpectrumAnalyzer/SaProcessor.h +++ b/plugins/SpectrumAnalyzer/SaProcessor.h @@ -36,6 +36,9 @@ #include "lmms_basics.h" +namespace lmms +{ + template class LocklessRingBuffer; @@ -161,5 +164,9 @@ private: float m_max_execution; #endif }; + + +} // namespace lmms + #endif // SAPROCESSOR_H diff --git a/plugins/SpectrumAnalyzer/SaSpectrumView.cpp b/plugins/SpectrumAnalyzer/SaSpectrumView.cpp index 1feee5cef..8c3d7a82d 100644 --- a/plugins/SpectrumAnalyzer/SaSpectrumView.cpp +++ b/plugins/SpectrumAnalyzer/SaSpectrumView.cpp @@ -43,6 +43,9 @@ #include #endif +namespace lmms::gui +{ + SaSpectrumView::SaSpectrumView(SaControls *controls, SaProcessor *processor, QWidget *_parent) : QWidget(_parent), @@ -843,3 +846,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 70606cc34..4ac24cbf0 100644 --- a/plugins/SpectrumAnalyzer/SaSpectrumView.h +++ b/plugins/SpectrumAnalyzer/SaSpectrumView.h @@ -36,9 +36,18 @@ class QMouseEvent; class QPainter; + +namespace lmms +{ + + class SaControls; class SaProcessor; +namespace gui +{ + + //! Widget that displays a spectrum curve and frequency / amplitude grid class SaSpectrumView : public QWidget { @@ -137,5 +146,11 @@ private: 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 36fcbf3bc..598bad725 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 b2f815203..cdfad6ad4 100644 --- a/plugins/SpectrumAnalyzer/SaWaterfallView.h +++ b/plugins/SpectrumAnalyzer/SaWaterfallView.h @@ -29,10 +29,19 @@ #include -class EffectControlDialog; class QMouseEvent; + +namespace lmms +{ class SaControls; class SaProcessor; +} + +namespace lmms::gui +{ + +class EffectControlDialog; + // Widget that displays a spectrum waterfall (spectrogram) and time labels. class SaWaterfallView : public QWidget @@ -87,4 +96,8 @@ private: float m_execution_avg; #endif }; + + +} // namespace lmms::gui + #endif // SAWATERFALLVIEW_H diff --git a/plugins/StereoEnhancer/StereoEnhancer.cpp b/plugins/StereoEnhancer/StereoEnhancer.cpp index 6e8661dcb..bda9c8086 100644 --- a/plugins/StereoEnhancer/StereoEnhancer.cpp +++ b/plugins/StereoEnhancer/StereoEnhancer.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/StereoEnhancer/StereoEnhancer.h b/plugins/StereoEnhancer/StereoEnhancer.h index 4c7ea6ac6..a3f4a6de4 100644 --- a/plugins/StereoEnhancer/StereoEnhancer.h +++ b/plugins/StereoEnhancer/StereoEnhancer.h @@ -30,6 +30,10 @@ #include "DspEffectLibrary.h" #include "StereoEnhancerControls.h" +namespace lmms +{ + + class StereoEnhancerEffect : public Effect { public: @@ -59,5 +63,6 @@ private: } ; +} // namespace lmms #endif diff --git a/plugins/StereoEnhancer/StereoEnhancerControlDialog.cpp b/plugins/StereoEnhancer/StereoEnhancerControlDialog.cpp index d86fbc6d7..f024ab33f 100644 --- a/plugins/StereoEnhancer/StereoEnhancerControlDialog.cpp +++ b/plugins/StereoEnhancer/StereoEnhancerControlDialog.cpp @@ -26,12 +26,12 @@ #include "StereoEnhancerControlDialog.h" - #include - #include "Knob.h" #include "StereoEnhancerControls.h" +namespace lmms::gui +{ StereoEnhancerControlDialog::StereoEnhancerControlDialog( @@ -50,3 +50,5 @@ StereoEnhancerControlDialog::StereoEnhancerControlDialog( this->setLayout(l); } + +} // namespace lmms::gui diff --git a/plugins/StereoEnhancer/StereoEnhancerControlDialog.h b/plugins/StereoEnhancer/StereoEnhancerControlDialog.h index 3d1d82bae..62f78d1cd 100644 --- a/plugins/StereoEnhancer/StereoEnhancerControlDialog.h +++ b/plugins/StereoEnhancer/StereoEnhancerControlDialog.h @@ -27,9 +27,16 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class StereoEnhancerControls; +namespace gui +{ + + class StereoEnhancerControlDialog : public EffectControlDialog { Q_OBJECT @@ -41,5 +48,8 @@ public: }; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/StereoEnhancer/StereoEnhancerControls.cpp b/plugins/StereoEnhancer/StereoEnhancerControls.cpp index a844e74f5..3cad94f91 100644 --- a/plugins/StereoEnhancer/StereoEnhancerControls.cpp +++ b/plugins/StereoEnhancer/StereoEnhancerControls.cpp @@ -28,6 +28,9 @@ #include "StereoEnhancerControls.h" #include "StereoEnhancer.h" +namespace lmms +{ + StereoEnhancerControls::StereoEnhancerControls( StereoEnhancerEffect * _eff ) : EffectControls( _eff ), @@ -64,6 +67,4 @@ void StereoEnhancerControls::saveSettings( QDomDocument & _doc, } - - - +} // namespace lmms diff --git a/plugins/StereoEnhancer/StereoEnhancerControls.h b/plugins/StereoEnhancer/StereoEnhancerControls.h index cefed77f9..c9a0f6e61 100644 --- a/plugins/StereoEnhancer/StereoEnhancerControls.h +++ b/plugins/StereoEnhancer/StereoEnhancerControls.h @@ -28,6 +28,10 @@ #include "EffectControls.h" #include "StereoEnhancerControlDialog.h" +namespace lmms +{ + + class StereoEnhancerEffect; class StereoEnhancerControls : public EffectControls @@ -51,9 +55,9 @@ public: return( 1 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return new StereoEnhancerControlDialog( this ); + return new gui::StereoEnhancerControlDialog( this ); } @@ -65,9 +69,11 @@ private: StereoEnhancerEffect * m_effect; FloatModel m_widthModel; - friend class StereoEnhancerControlDialog; + friend class gui::StereoEnhancerControlDialog; } ; +} // namespace lmms + #endif /*_STEREO_ENHANCER_CONTROLS_H*/ diff --git a/plugins/StereoMatrix/StereoMatrix.cpp b/plugins/StereoMatrix/StereoMatrix.cpp index c8a743fe3..de15d8370 100644 --- a/plugins/StereoMatrix/StereoMatrix.cpp +++ b/plugins/StereoMatrix/StereoMatrix.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/StereoMatrix/StereoMatrix.h b/plugins/StereoMatrix/StereoMatrix.h index 39ed4a1ad..88d265ad2 100644 --- a/plugins/StereoMatrix/StereoMatrix.h +++ b/plugins/StereoMatrix/StereoMatrix.h @@ -29,6 +29,10 @@ #include "Effect.h" #include "StereoMatrixControls.h" +namespace lmms +{ + + class StereoMatrixEffect : public Effect { public: @@ -38,7 +42,7 @@ public: virtual bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ); - virtual EffectControls * controls() + virtual EffectControls* controls() { return( &m_smControls ); } @@ -51,5 +55,6 @@ private: } ; +} // namespace lmms #endif diff --git a/plugins/StereoMatrix/StereoMatrixControlDialog.cpp b/plugins/StereoMatrix/StereoMatrixControlDialog.cpp index 3899219dd..5bf62b9ce 100644 --- a/plugins/StereoMatrix/StereoMatrixControlDialog.cpp +++ b/plugins/StereoMatrix/StereoMatrixControlDialog.cpp @@ -31,6 +31,8 @@ #include "Knob.h" #include "StereoMatrixControls.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/StereoMatrix/StereoMatrixControlDialog.h b/plugins/StereoMatrix/StereoMatrixControlDialog.h index 4de00ec70..fd5cf786a 100644 --- a/plugins/StereoMatrix/StereoMatrixControlDialog.h +++ b/plugins/StereoMatrix/StereoMatrixControlDialog.h @@ -27,8 +27,14 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class StereoMatrixControls; +namespace gui +{ + class StereoMatrixControlDialog : public EffectControlDialog { @@ -42,4 +48,8 @@ public: }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/StereoMatrix/StereoMatrixControls.cpp b/plugins/StereoMatrix/StereoMatrixControls.cpp index 75f513a60..e60b02a8d 100644 --- a/plugins/StereoMatrix/StereoMatrixControls.cpp +++ b/plugins/StereoMatrix/StereoMatrixControls.cpp @@ -28,6 +28,9 @@ #include "StereoMatrixControls.h" #include "StereoMatrix.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/StereoMatrix/StereoMatrixControls.h b/plugins/StereoMatrix/StereoMatrixControls.h index 3b89d74d2..97f0cf8e1 100644 --- a/plugins/StereoMatrix/StereoMatrixControls.h +++ b/plugins/StereoMatrix/StereoMatrixControls.h @@ -28,6 +28,10 @@ #include "EffectControls.h" #include "StereoMatrixControlDialog.h" +namespace lmms +{ + + class StereoMatrixEffect; class StereoMatrixControls : public EffectControls @@ -51,9 +55,9 @@ public: return( 1 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return new StereoMatrixControlDialog( this ); + return new gui::StereoMatrixControlDialog( this ); } @@ -69,10 +73,12 @@ private: FloatModel m_rlModel; FloatModel m_rrModel; - friend class StereoMatrixControlDialog; + friend class gui::StereoMatrixControlDialog; friend class StereoMatrixEffect; } ; +} // namespace lmms + #endif diff --git a/plugins/Stk/Mallets/Mallets.cpp b/plugins/Stk/Mallets/Mallets.cpp index 9a4d9ea3a..37ab3f6f1 100644 --- a/plugins/Stk/Mallets/Mallets.cpp +++ b/plugins/Stk/Mallets/Mallets.cpp @@ -44,6 +44,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -377,12 +381,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, @@ -605,6 +611,8 @@ void MalletsInstrumentView::changePreset() } +} // namespace gui + // ModalBar MalletsSynth::MalletsSynth( const StkFloat _pitch, @@ -770,6 +778,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 fb35abb73..51b0bfb43 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 @@ public: virtual QString nodeName() const; - virtual PluginView * instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; private: @@ -193,10 +205,13 @@ private: bool m_filesMissing; - friend class MalletsInstrumentView; + friend class gui::MalletsInstrumentView; } ; +namespace gui +{ + class MalletsInstrumentView: public InstrumentViewFixedSize { @@ -242,4 +257,9 @@ private: Knob * m_spreadKnob; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/TripleOscillator/TripleOscillator.cpp b/plugins/TripleOscillator/TripleOscillator.cpp index 897b03586..2931c3b85 100644 --- a/plugins/TripleOscillator/TripleOscillator.cpp +++ b/plugins/TripleOscillator/TripleOscillator.cpp @@ -41,6 +41,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -402,9 +406,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 ); } @@ -421,6 +425,9 @@ void TripleOscillator::updateAllDetuning() +namespace gui +{ + class TripleOscKnob : public Knob { @@ -748,6 +755,7 @@ void TripleOscillatorView::modelChanged() } +} // namespace gui extern "C" @@ -763,4 +771,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* model, void * ) - +} // namespace lmms diff --git a/plugins/TripleOscillator/TripleOscillator.h b/plugins/TripleOscillator/TripleOscillator.h index 944834417..1c8871796 100644 --- a/plugins/TripleOscillator/TripleOscillator.h +++ b/plugins/TripleOscillator/TripleOscillator.h @@ -30,13 +30,23 @@ #include "InstrumentView.h" #include "AutomatableModel.h" +namespace lmms +{ + +class NotePlayHandle; +class SampleBuffer; +class Oscillator; + + +namespace gui +{ class automatableButtonGroup; class Knob; -class NotePlayHandle; -class Oscillator; class PixmapButton; -class SampleBuffer; +class TripleOscillatorView; +} // namespace gui + const int NUM_OF_OSCILLATORS = 3; @@ -75,7 +85,7 @@ private: bool m_useWaveTable; friend class TripleOscillator; - friend class TripleOscillatorView; + friend class gui::TripleOscillatorView; private slots: @@ -115,7 +125,7 @@ public: return( 128 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); protected slots: @@ -133,11 +143,14 @@ private: } ; - friend class TripleOscillatorView; + friend class gui::TripleOscillatorView; } ; +namespace gui +{ + class TripleOscillatorView : public InstrumentViewFixedSize { @@ -198,5 +211,8 @@ private: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/Vectorscope/VecControls.cpp b/plugins/Vectorscope/VecControls.cpp index ede9c77b2..cd0f21f61 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 04b688e5a..e4aa27b43 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 @@ public: 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 @@ private: 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 f5e740887..72b072823 100644 --- a/plugins/Vectorscope/VecControlsDialog.cpp +++ b/plugins/Vectorscope/VecControlsDialog.cpp @@ -34,6 +34,9 @@ #include "Vectorscope.h" #include "VectorView.h" +namespace lmms::gui +{ + // The entire GUI layout is built here. VecControlsDialog::VecControlsDialog(VecControls *controls) : @@ -90,3 +93,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 b76c06ad0..97108cdf4 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 @@ private: VecControls *m_controls; }; + +} // namespace gui + +} // namespace lmms + #endif // VECCONTROLSDIALOG_H diff --git a/plugins/Vectorscope/VectorView.cpp b/plugins/Vectorscope/VectorView.cpp index 93a384891..ed57f64a4 100644 --- a/plugins/Vectorscope/VectorView.cpp +++ b/plugins/Vectorscope/VectorView.cpp @@ -33,6 +33,9 @@ #include "MainWindow.h" #include "VecControls.h" +namespace lmms::gui +{ + VectorView::VectorView(VecControls *controls, LocklessRingBuffer *inputBuffer, unsigned short displaySize, QWidget *parent) : QWidget(parent), @@ -327,3 +330,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 8e88847ab..0aae988db 100644 --- a/plugins/Vectorscope/VectorView.h +++ b/plugins/Vectorscope/VectorView.h @@ -27,10 +27,16 @@ #include "LocklessRingBuffer.h" +namespace lmms +{ class VecControls; +} //#define VEC_DEBUG +namespace lmms::gui +{ + // Widget that displays a vectorscope visualization of stereo signal. class VectorView : public QWidget @@ -74,4 +80,8 @@ private: float m_executionAvg = 0; #endif }; + + +} // namespace lmms::gui + #endif // VECTORVIEW_H diff --git a/plugins/Vectorscope/Vectorscope.cpp b/plugins/Vectorscope/Vectorscope.cpp index b3c2b2dda..df093f671 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 b45ff6de4..973fecf0e 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 @@ private: LocklessRingBuffer m_inputBuffer; }; + +} // namespace lmms + #endif // VECTORSCOPE_H diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index cb1902c66..9088321cc 100644 --- a/plugins/Vestige/Vestige.cpp +++ b/plugins/Vestige/Vestige.cpp @@ -62,6 +62,8 @@ #include "embed.h" +namespace lmms +{ extern "C" @@ -87,6 +89,9 @@ Plugin::Descriptor Q_DECL_EXPORT vestige_plugin_descriptor = } +namespace gui +{ + class vstSubWin : public SubWindow { @@ -112,6 +117,9 @@ public: }; +} // namespace gui + + class VstInstrumentPlugin : public VstPlugin { public: @@ -124,7 +132,7 @@ public: return; } if ( embedMethod() != "none" ) { - m_pluginSubWindow.reset(new vstSubWin( getGUI()->mainWindow()->workspace() )); + m_pluginSubWindow.reset(new gui::vstSubWin( gui::getGUI()->mainWindow()->workspace() )); VstPlugin::createUI( m_pluginSubWindow.get() ); m_pluginSubWindow->setWidget(pluginWidget()); } else { @@ -144,9 +152,6 @@ private: }; -QPixmap * VestigeInstrumentView::s_artwork = nullptr; -QPixmap * ManageVestigeInstrumentView::s_artwork = nullptr; - VestigeInstrument::VestigeInstrument( InstrumentTrack * _instrument_track ) : Instrument( _instrument_track, &vestige_plugin_descriptor ), @@ -350,10 +355,10 @@ void VestigeInstrument::loadFile( const QString & _file ) closePlugin(); } m_pluginDLL = PathUtil::toShortestRelative( _file ); - TextFloat * tf = nullptr; - if( getGUI() != nullptr ) + gui::TextFloat * tf = nullptr; + if( gui::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 ); @@ -477,13 +482,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, @@ -928,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); @@ -1233,6 +1253,7 @@ void ManageVestigeInstrumentView::paintEvent( QPaintEvent * ) } +} // namespace gui extern "C" @@ -1246,3 +1267,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 934c26088..5b7b1461d 100644 --- a/plugins/Vestige/Vestige.h +++ b/plugins/Vestige/Vestige.h @@ -37,13 +37,22 @@ class QPixmap; class QPushButton; class QScrollArea; - -class CustomTextKnob; -class FloatModel; class QGridLayout; -class PixmapButton; + +namespace lmms +{ + +class FloatModel; class VstPlugin; +namespace gui +{ +class PixmapButton; +class CustomTextKnob; +class VestigeInstrumentView; +class ManageVestigeInstrumentView; +} // namespace gui + class VestigeInstrument : public Instrument { @@ -68,10 +77,10 @@ public: 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 ); + void setParameter( lmms::Model * action ); void handleConfigChange( QString cls, QString attr, QString value ); void reloadPlugin(); @@ -90,12 +99,15 @@ private: int paramCount; - friend class VestigeInstrumentView; - friend class ManageVestigeInstrumentView; + friend class gui::VestigeInstrumentView; + friend class gui::ManageVestigeInstrumentView; } ; +namespace gui +{ + class ManageVestigeInstrumentView : public InstrumentViewFixedSize { Q_OBJECT @@ -107,7 +119,7 @@ public: protected slots: void syncPlugin( void ); void displayAutomatedOnly( void ); - void setParameter( Model * action ); + void setParameter( lmms::Model * action ); void syncParameterText(); void closeWindow(); @@ -184,5 +196,8 @@ private: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/Vibed/NineButtonSelector.cpp b/plugins/Vibed/NineButtonSelector.cpp index 618a8e09d..431dbec8b 100644 --- a/plugins/Vibed/NineButtonSelector.cpp +++ b/plugins/Vibed/NineButtonSelector.cpp @@ -29,6 +29,9 @@ #include "CaptionMenu.h" #include "PixmapButton.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/NineButtonSelector.h b/plugins/Vibed/NineButtonSelector.h index 96b441031..1c3183055 100644 --- a/plugins/Vibed/NineButtonSelector.h +++ b/plugins/Vibed/NineButtonSelector.h @@ -25,14 +25,20 @@ #ifndef _NINE_BUTTON_SELECTOR_H #define _NINE_BUTTON_SELECTOR_H - #include - #include "AutomatableModelView.h" +namespace lmms +{ +class graphModel; +} + +namespace lmms::gui +{ + + class Knob; class PixmapButton; -class graphModel; class NineButtonSelector: public QWidget , public IntModelView @@ -97,4 +103,7 @@ private: typedef IntModel NineButtonSelectorModel; + +} // namespace lmms::gui + #endif diff --git a/plugins/Vibed/StringContainer.cpp b/plugins/Vibed/StringContainer.cpp index 0ec38c94f..36dee6da0 100644 --- a/plugins/Vibed/StringContainer.cpp +++ b/plugins/Vibed/StringContainer.cpp @@ -24,6 +24,9 @@ #include "StringContainer.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/StringContainer.h b/plugins/Vibed/StringContainer.h index 503b7c16c..96408c56a 100644 --- a/plugins/Vibed/StringContainer.h +++ b/plugins/Vibed/StringContainer.h @@ -29,6 +29,9 @@ #include "VibratingString.h" #include "MemoryManager.h" +namespace lmms +{ + class StringContainer { @@ -77,4 +80,7 @@ private: QVector m_exists; } ; + +} // namespace lmms + #endif diff --git a/plugins/Vibed/Vibed.cpp b/plugins/Vibed/Vibed.cpp index 0a6f14c2a..87c42b187 100644 --- a/plugins/Vibed/Vibed.cpp +++ b/plugins/Vibed/Vibed.cpp @@ -43,6 +43,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -69,7 +73,7 @@ Vibed::Vibed( InstrumentTrack * _instrumentTrack ) : FloatModel * knob; BoolModel * led; - NineButtonSelectorModel * harmonic; + gui::NineButtonSelectorModel * harmonic; graphModel * graphTmp; for( int harm = 0; harm < 9; harm++ ) @@ -114,7 +118,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 ); @@ -128,13 +132,6 @@ Vibed::Vibed( InstrumentTrack * _instrumentTrack ) : -Vibed::~Vibed() -{ -} - - - - void Vibed::saveSettings( QDomDocument & _doc, QDomElement & _this ) { @@ -340,13 +337,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, @@ -679,6 +678,8 @@ void VibedView::contextMenuEvent( QContextMenuEvent * ) } +} // namespace gui + extern "C" { @@ -692,4 +693,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 2fee8eaed..f13fd665a 100644 --- a/plugins/Vibed/Vibed.h +++ b/plugins/Vibed/Vibed.h @@ -28,35 +28,43 @@ #include "InstrumentView.h" #include "NineButtonSelector.h" +namespace lmms +{ + + +class NotePlayHandle; +class graphModel; + +namespace gui +{ class Graph; class LedCheckBox; -class NotePlayHandle; class VibedView; +} 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; } - virtual PluginView * instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; private: @@ -71,14 +79,17 @@ private: 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 { @@ -136,4 +147,9 @@ private: }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Vibed/VibratingString.cpp b/plugins/Vibed/VibratingString.cpp index fda5c0c5d..4a9e740fb 100644 --- a/plugins/Vibed/VibratingString.cpp +++ b/plugins/Vibed/VibratingString.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/VibratingString.h b/plugins/Vibed/VibratingString.h index 254e2ebd5..ed7cbe38c 100644 --- a/plugins/Vibed/VibratingString.h +++ b/plugins/Vibed/VibratingString.h @@ -28,6 +28,10 @@ #include "lmms_basics.h" +namespace lmms +{ + + class VibratingString { @@ -267,4 +271,7 @@ private: } ; + +} // namespace lmms + #endif diff --git a/plugins/VstBase/RemoteVstPlugin.cpp b/plugins/VstBase/RemoteVstPlugin.cpp index f2199893a..7ac0c97e2 100644 --- a/plugins/VstBase/RemoteVstPlugin.cpp +++ b/plugins/VstBase/RemoteVstPlugin.cpp @@ -127,16 +127,19 @@ struct ERect 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; #ifndef NATIVE_LINUX_VST HWND __MessageHwnd = nullptr; @@ -145,6 +148,10 @@ DWORD __processingThreadId = 0; pthread_t __processingThreadId = 0; #endif +namespace lmms +{ + + #ifdef _WIN32 //Returns the last Win32 error, in string format. Returns an empty string if there is no error. std::string GetErrorAsString(DWORD errorMessageID) @@ -2414,11 +2421,17 @@ LRESULT CALLBACK RemoteVstPlugin::wndProc( HWND hwnd, UINT uMsg, return DefWindowProc( hwnd, uMsg, wParam, lParam ); } + + #endif +} // namespace lmms + int main( int _argc, char * * _argv ) { + using lmms::RemoteVstPlugin; + #ifdef SYNC_WITH_SHM_FIFO if( _argc < 4 ) #else @@ -2430,7 +2443,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 @@ -2490,32 +2503,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; } } @@ -2523,7 +2536,7 @@ int main( int _argc, char * * _argv ) #ifdef NATIVE_LINUX_VST if (EMBED) { - cerr << "Native linux VST works only without embedding." << endl; + std::cerr << "Native linux VST works only without embedding." << std::endl; } #endif @@ -2567,4 +2580,3 @@ int main( int _argc, char * * _argv ) #endif return 0; } - diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index 61d734675..a31cc832c 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -113,6 +113,9 @@ private: } +namespace lmms +{ + enum class ExecutableType { Unknown, Win32, Win64, Linux64, @@ -121,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 ), @@ -179,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() ) ); @@ -413,13 +416,13 @@ 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 XSetTransientForHint( QX11Info::display(), m_pluginWindowID, - getGUI()->mainWindow()->winId() ); + gui::getGUI()->mainWindow()->winId() ); #endif } break; @@ -505,9 +508,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() ) { @@ -585,7 +588,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 @@ -593,8 +596,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] != "" ) { @@ -823,3 +826,6 @@ QString VstPlugin::embedMethod() const { return m_embedMethod; } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/VstBase/VstPlugin.h b/plugins/VstBase/VstPlugin.h index 2317cf3ad..f73c1c876 100644 --- a/plugins/VstBase/VstPlugin.h +++ b/plugins/VstBase/VstPlugin.h @@ -36,7 +36,8 @@ #include "vstbase_export.h" -class vstSubWin; +namespace lmms +{ class VSTBASE_EXPORT VstPlugin : public RemotePlugin, public JournallingObject @@ -123,7 +124,7 @@ public: 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 ); @@ -173,4 +174,6 @@ private: } ; +} // namespace lmms + #endif diff --git a/plugins/VstBase/communication.h b/plugins/VstBase/communication.h index c25b213d1..1f32dd135 100644 --- a/plugins/VstBase/communication.h +++ b/plugins/VstBase/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/VstBase/vst_base.cpp b/plugins/VstBase/vst_base.cpp index 67217390a..6885feb97 100644 --- a/plugins/VstBase/vst_base.cpp +++ b/plugins/VstBase/vst_base.cpp @@ -27,6 +27,10 @@ #include "Plugin.h" #include "vstbase_export.h" +namespace lmms +{ + + extern "C" { @@ -45,3 +49,4 @@ Plugin::Descriptor VSTBASE_EXPORT vstbase_plugin_descriptor = } +} // namespace lmms diff --git a/plugins/VstEffect/VstEffect.cpp b/plugins/VstEffect/VstEffect.cpp index df5b18eb9..4fd66dbb5 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; - if( getGUI() != nullptr ) + gui::TextFloat* tf = nullptr; + if( gui::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 7070ffc2f..12b15dc49 100644 --- a/plugins/VstEffect/VstEffect.h +++ b/plugins/VstEffect/VstEffect.h @@ -31,8 +31,13 @@ #include "Effect.h" #include "VstEffectControls.h" +namespace lmms +{ + + class VstPlugin; + class VstEffect : public Effect { public: @@ -61,11 +66,12 @@ private: 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 4e86cc71d..ba7d58ffa 100644 --- a/plugins/VstEffect/VstEffectControlDialog.cpp +++ b/plugins/VstEffect/VstEffectControlDialog.cpp @@ -37,6 +37,10 @@ #include #include +namespace lmms::gui +{ + + VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) : EffectControlDialog( _ctl ), m_pluginWidget( nullptr ), @@ -294,3 +298,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 dad68ae04..f54ab750c 100644 --- a/plugins/VstEffect/VstEffectControlDialog.h +++ b/plugins/VstEffect/VstEffectControlDialog.h @@ -29,13 +29,19 @@ #include +class QPixmap; +class QPushButton; +class QLabel; + +namespace lmms +{ class VstEffectControls; class VstPlugin; -class PixmapButton; -class QLabel; -class QPixmap; -class QPushButton; + +namespace gui +{ + class PixmapButton; @@ -68,4 +74,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 21de98fab..9def52727 100644 --- a/plugins/VstEffect/VstEffectControls.cpp +++ b/plugins/VstEffect/VstEffectControls.cpp @@ -42,6 +42,8 @@ #include "SubWindow.h" #include +namespace lmms +{ VstEffectControls::VstEffectControls( VstEffect * _eff ) : @@ -155,9 +157,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; } @@ -168,7 +170,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 ) { @@ -308,6 +310,9 @@ void VstEffectControls::paintEvent( QPaintEvent * ) +namespace gui +{ + ManageVSTEffectView::ManageVSTEffectView( VstEffect * _eff, VstEffectControls * m_vi ) : m_effect( _eff ) @@ -572,7 +577,6 @@ ManageVSTEffectView::~ManageVSTEffectView() } +} // namespace gui - - - +} // namespace lmms diff --git a/plugins/VstEffect/VstEffectControls.h b/plugins/VstEffect/VstEffectControls.h index c9bd626cd..24d5961ae 100644 --- a/plugins/VstEffect/VstEffectControls.h +++ b/plugins/VstEffect/VstEffectControls.h @@ -30,15 +30,25 @@ #include - -class CustomTextKnob; class QGridLayout; class QPaintEvent; class QPushButton; class QMdiSubWindow; class QScrollArea; + +namespace lmms +{ + + class VstEffect; +namespace gui +{ +class CustomTextKnob; +class ManageVSTEffectView; +class VstEffectControlDialog; +} + class VstEffectControls : public EffectControls { @@ -56,7 +66,7 @@ public: virtual int controlCount(); - virtual EffectControlDialog * createView(); + virtual gui::EffectControlDialog* createView(); protected slots: @@ -67,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 ); @@ -87,13 +97,15 @@ private: 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 @@ -107,7 +119,7 @@ public: protected slots: void syncPlugin( void ); void displayAutomatedOnly( void ); - void setParameter( Model * action ); + void setParameter( lmms::Model * action ); void syncParameterText(); void closeWindow(); @@ -132,4 +144,8 @@ private: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/VstEffect/VstSubPluginFeatures.cpp b/plugins/VstEffect/VstSubPluginFeatures.cpp index b2141cd70..d69a53e4e 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 1c6d9cc2a..d3b9de58c 100644 --- a/plugins/VstEffect/VstSubPluginFeatures.h +++ b/plugins/VstEffect/VstSubPluginFeatures.h @@ -31,6 +31,9 @@ #include "Effect.h" #include "Plugin.h" +namespace lmms +{ + class VstSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures { @@ -47,8 +50,7 @@ private: } ; - - +} // namespace lmms #endif diff --git a/plugins/Watsyn/Watsyn.cpp b/plugins/Watsyn/Watsyn.cpp index 0be4af29a..7978dc120 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 b957faef7..454329b57 100644 --- a/plugins/Watsyn/Watsyn.h +++ b/plugins/Watsyn/Watsyn.h @@ -34,6 +34,9 @@ #include #include "MemoryManager.h" +namespace lmms +{ + #define makeknob( name, x, y, hint, unit, oname ) \ name = new Knob( knobStyled, this ); \ @@ -74,9 +77,14 @@ const int B1_OSC = 2; const int B2_OSC = 3; const int NUM_OSCS = 4; +class WatsynInstrument; + +namespace gui +{ class automatableButtonGroup; class PixmapButton; -class WatsynInstrument; +class WatsynView; +} class WatsynObject { @@ -149,7 +157,7 @@ public: return( 64 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); public slots: void updateVolumes(); @@ -288,10 +296,14 @@ private: float B2_wave [WAVELEN]; friend class WatsynObject; - friend class WatsynView; + friend class gui::WatsynView; }; +namespace gui +{ + + class WatsynView : public InstrumentViewFixedSize { Q_OBJECT @@ -376,4 +388,9 @@ private: }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/WaveShaper/WaveShaper.cpp b/plugins/WaveShaper/WaveShaper.cpp index be3e943bc..ededa2e0f 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 4763c40b7..7364784bb 100644 --- a/plugins/WaveShaper/WaveShaper.h +++ b/plugins/WaveShaper/WaveShaper.h @@ -30,6 +30,8 @@ #include "Effect.h" #include "WaveShaperControls.h" +namespace lmms +{ class WaveShaperEffect : public Effect @@ -56,7 +58,7 @@ private: } ; - +} // namespace lmms #endif diff --git a/plugins/WaveShaper/WaveShaperControlDialog.cpp b/plugins/WaveShaper/WaveShaperControlDialog.cpp index aede7317e..e4fae0c92 100644 --- a/plugins/WaveShaper/WaveShaperControlDialog.cpp +++ b/plugins/WaveShaper/WaveShaperControlDialog.cpp @@ -33,6 +33,9 @@ #include "PixmapButton.h" #include "LedCheckBox.h" +namespace lmms::gui +{ + WaveShaperControlDialog::WaveShaperControlDialog( WaveShaperControls * _controls ) : @@ -116,3 +119,5 @@ WaveShaperControlDialog::WaveShaperControlDialog( _controls, SLOT( subOneClicked() ) ); } + +} // namespace lmms::gui diff --git a/plugins/WaveShaper/WaveShaperControlDialog.h b/plugins/WaveShaper/WaveShaperControlDialog.h index be0f10212..672b55f62 100644 --- a/plugins/WaveShaper/WaveShaperControlDialog.h +++ b/plugins/WaveShaper/WaveShaperControlDialog.h @@ -28,9 +28,14 @@ #include "EffectControlDialog.h" +namespace lmms +{ class WaveShaperControls; +namespace gui +{ + class WaveShaperControlDialog : public EffectControlDialog { @@ -46,4 +51,9 @@ private: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/WaveShaper/WaveShaperControls.cpp b/plugins/WaveShaper/WaveShaperControls.cpp index 529cc4289..40e20055a 100644 --- a/plugins/WaveShaper/WaveShaperControls.cpp +++ b/plugins/WaveShaper/WaveShaperControls.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/WaveShaperControls.h b/plugins/WaveShaper/WaveShaperControls.h index fa0768afd..f94bc3d9b 100644 --- a/plugins/WaveShaper/WaveShaperControls.h +++ b/plugins/WaveShaper/WaveShaperControls.h @@ -30,6 +30,10 @@ #include "WaveShaperControlDialog.h" #include "Graph.h" +namespace lmms +{ + + class WaveShaperEffect; @@ -56,9 +60,9 @@ public: return( 4 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return( new WaveShaperControlDialog( this ) ); + return( new gui::WaveShaperControlDialog( this ) ); } @@ -78,9 +82,12 @@ private: graphModel m_wavegraphModel; BoolModel m_clipModel; - friend class WaveShaperControlDialog; + friend class gui::WaveShaperControlDialog; friend class WaveShaperEffect; } ; + +} // namespace lmms + #endif diff --git a/plugins/Xpressive/ExprSynth.cpp b/plugins/Xpressive/ExprSynth.cpp index ceb79138e..ac850bca9 100644 --- a/plugins/Xpressive/ExprSynth.cpp +++ b/plugins/Xpressive/ExprSynth.cpp @@ -39,6 +39,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; @@ -820,3 +825,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 1246058ca..4ea46e1bb 100644 --- a/plugins/Xpressive/ExprSynth.h +++ b/plugins/Xpressive/ExprSynth.h @@ -32,12 +32,20 @@ #include "Graph.h" #include "MemoryManager.h" -class automatableButtonGroup; +namespace lmms +{ + + class ExprFrontData; +class NotePlayHandle; + +namespace gui +{ +class automatableButtonGroup; class Knob; class LedCheckBox; -class NotePlayHandle; class PixmapButton; +} class ExprFront @@ -145,5 +153,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 bf543c695..a69343e07 100644 --- a/plugins/Xpressive/Xpressive.cpp +++ b/plugins/Xpressive/Xpressive.cpp @@ -48,6 +48,10 @@ #include "plugin_export.h" +namespace lmms +{ + + extern "C" { Plugin::Descriptor PLUGIN_EXPORT xpressive_plugin_descriptor = { STRINGIFY( @@ -107,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 @@ -242,10 +243,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() @@ -259,11 +293,11 @@ public: 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(); } @@ -393,7 +427,7 @@ 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")); m_triangleWaveBtn->setToolTip(tr("Triangle wave")); @@ -408,7 +442,7 @@ XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) : 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")); m_whiteNoiseWaveBtn->setToolTip(tr("White noise")); @@ -419,7 +453,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 ); @@ -500,31 +534,27 @@ XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) : updateLayout(); } -XpressiveView::~XpressiveView() -{ -} - void XpressiveView::expressionChanged() { Xpressive * e = castModel(); 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); @@ -595,35 +625,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() { @@ -869,6 +870,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 ); @@ -887,6 +900,9 @@ void XpressiveView::helpClicked() { } + +} // namespace gui + extern "C" { // necessary for getting instance out of shared lib @@ -897,5 +913,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 651660cfe..d075e9088 100644 --- a/plugins/Xpressive/Xpressive.h +++ b/plugins/Xpressive/Xpressive.h @@ -35,8 +35,13 @@ #include "ExprSynth.h" +class QPlainTextEdit; + +namespace lmms +{ + + class oscillator; -class XpressiveView; const int W1_EXPR = 0; const int W2_EXPR = 1; @@ -47,8 +52,12 @@ const int NUM_EXPRS = 5; class ExprFront; + +namespace gui +{ class SubWindow; -class QPlainTextEdit; +class XpressiveView; +} @@ -57,20 +66,19 @@ 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; - virtual PluginView* instantiateView( QWidget * parent ); + gui::PluginView* instantiateView( QWidget * parent ) override; graphModel& graphO1() { return m_graphO1; } graphModel& graphO2() { return m_graphO2; } @@ -137,6 +145,9 @@ private: } ; +namespace gui +{ + class XpressiveView : public InstrumentViewFixedSize { @@ -145,7 +156,6 @@ public: XpressiveView( Instrument* _instrument, QWidget* _parent ); - virtual ~XpressiveView(); protected: @@ -166,7 +176,7 @@ protected slots: void graphDrawn( ); private: - virtual void modelChanged(); + void modelChanged() override; Knob *m_generalPurposeKnob[3]; Knob *m_panningKnob[2]; @@ -217,4 +227,9 @@ private: static QString s_helpText; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp index ed32339eb..fd1d2b838 100644 --- a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp @@ -36,9 +36,14 @@ #include "zynaddsubfx/src/Misc/Master.h" #include "zynaddsubfx/src/Misc/Part.h" - +// Global variable in zynaddsubfx/src/globals.h SYNTH_T* synth = nullptr; + +namespace lmms +{ + + int LocalZynAddSubFx::s_instanceCount = 0; @@ -276,3 +281,4 @@ void LocalZynAddSubFx::processAudio( sampleFrame * _out ) } +} // namespace lmms diff --git a/plugins/ZynAddSubFx/LocalZynAddSubFx.h b/plugins/ZynAddSubFx/LocalZynAddSubFx.h index 397fbbe82..81da0f9ce 100644 --- a/plugins/ZynAddSubFx/LocalZynAddSubFx.h +++ b/plugins/ZynAddSubFx/LocalZynAddSubFx.h @@ -28,9 +28,14 @@ #include "Note.h" class Master; -class MidiEvent; class NulEngine; +namespace lmms +{ + +class MidiEvent; + + class LocalZynAddSubFx { public: @@ -73,4 +78,7 @@ protected: } ; + +} // namespace lmms + #endif diff --git a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp index 0c0c0af39..2d9a2701e 100644 --- a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp @@ -38,6 +38,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 edeb42427..6745cb846 100644 --- a/plugins/ZynAddSubFx/RemoteZynAddSubFx.h +++ b/plugins/ZynAddSubFx/RemoteZynAddSubFx.h @@ -27,11 +27,18 @@ #include "RemotePluginBase.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 b83f055ef..27cb4728e 100644 --- a/plugins/ZynAddSubFx/ZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/ZynAddSubFx.cpp @@ -51,6 +51,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -80,13 +84,6 @@ ZynAddSubFxRemotePlugin::ZynAddSubFxRemotePlugin() : - -ZynAddSubFxRemotePlugin::~ZynAddSubFxRemotePlugin() -{ -} - - - bool ZynAddSubFxRemotePlugin::processMessage( const message & _m ) { switch( _m.id ) @@ -485,15 +482,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 ) : @@ -568,14 +566,6 @@ ZynAddSubFxView::ZynAddSubFxView( Instrument * _instrument, QWidget * _parent ) - -ZynAddSubFxView::~ZynAddSubFxView() -{ -} - - - - void ZynAddSubFxView::dragEnterEvent( QDragEnterEvent * _dee ) { // For mimeType() and MimeType enum class @@ -657,6 +647,7 @@ void ZynAddSubFxView::toggleUI() } +} // namespace gui @@ -673,3 +664,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 10243e373..996c187ee 100644 --- a/plugins/ZynAddSubFx/ZynAddSubFx.h +++ b/plugins/ZynAddSubFx/ZynAddSubFx.h @@ -37,21 +37,27 @@ class QPushButton; +namespace lmms +{ + + class LocalZynAddSubFx; -class ZynAddSubFxView; class NotePlayHandle; + +namespace gui +{ class Knob; class LedCheckBox; - +class ZynAddSubFxView; +} class ZynAddSubFxRemotePlugin : public RemotePlugin { Q_OBJECT public: ZynAddSubFxRemotePlugin(); - virtual ~ZynAddSubFxRemotePlugin(); - virtual bool processMessage( const message & _m ); + bool processMessage( const message & _m ) override; signals: @@ -66,26 +72,26 @@ 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; } - virtual PluginView * instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; private slots: @@ -122,7 +128,7 @@ private: QMap m_modifiedControllers; - friend class ZynAddSubFxView; + friend class gui::ZynAddSubFxView; signals: @@ -131,22 +137,24 @@ signals: } ; +namespace gui +{ + 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; @@ -165,4 +173,8 @@ private slots: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/ZynAddSubFx/zynaddsubfx b/plugins/ZynAddSubFx/zynaddsubfx index 5a8328bc4..b9855dbe1 160000 --- a/plugins/ZynAddSubFx/zynaddsubfx +++ b/plugins/ZynAddSubFx/zynaddsubfx @@ -1 +1 @@ -Subproject commit 5a8328bc43ce638b5b5c4d8fbb23fc401c18d2b5 +Subproject commit b9855dbe16424edc528a6796ddbc50b1042482c7 diff --git a/src/common/RemotePluginBase.cpp b/src/common/RemotePluginBase.cpp index 9dc2ebec5..10775ed5e 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 3c546ac32..5c944dfab 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 diff --git a/src/core/AudioEngine.cpp b/src/core/AudioEngine.cpp index eae7c6f20..827e8b2e4 100644 --- a/src/core/AudioEngine.cpp +++ b/src/core/AudioEngine.cpp @@ -61,6 +61,10 @@ #include "BufferManager.h" +namespace lmms +{ + + typedef LocklessList::Element LocklessListElement; @@ -1284,3 +1288,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 837894c79..24c4dc5ae 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 3d45cbccb..129b3accf 100644 --- a/src/core/AudioEngineWorkerThread.cpp +++ b/src/core/AudioEngineWorkerThread.cpp @@ -37,6 +37,9 @@ #include #endif +namespace lmms +{ + AudioEngineWorkerThread::JobQueue AudioEngineWorkerThread::globalJobQueue; QWaitCondition * AudioEngineWorkerThread::queueReadyWaitCond = nullptr; QList AudioEngineWorkerThread::workerThreads; @@ -177,4 +180,4 @@ void AudioEngineWorkerThread::run() } } - +} // namespace lmms diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index 51733936f..5463fa482 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/AutomationClip.cpp b/src/core/AutomationClip.cpp index 300944416..928cf48a9 100644 --- a/src/core/AutomationClip.cpp +++ b/src/core/AutomationClip.cpp @@ -37,6 +37,9 @@ #include +namespace lmms +{ + int AutomationClip::s_quantization = 1; const float AutomationClip::DEFAULT_MIN_VALUE = 0; const float AutomationClip::DEFAULT_MAX_VALUE = 1; @@ -127,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(); @@ -870,11 +873,11 @@ const QString AutomationClip::name() const -ClipView * AutomationClip::createView( TrackView * _tv ) +gui::ClipView * AutomationClip::createView( gui::TrackView * _tv ) { QMutexLocker m(&m_clipMutex); - return new AutomationClipView( this, _tv ); + return new gui::AutomationClipView( this, _tv ); } @@ -1183,3 +1186,5 @@ void AutomationClip::generateTangents(timeMap::iterator it, int numToGenerate) it++; } } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/AutomationNode.cpp b/src/core/AutomationNode.cpp index a2906b0d0..eee4df8d2 100644 --- a/src/core/AutomationNode.cpp +++ b/src/core/AutomationNode.cpp @@ -27,6 +27,9 @@ #include "AutomationClip.h" +namespace lmms +{ + // Dummy constructor for the QMap AutomationNode::AutomationNode() : m_clip(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/BandLimitedWave.cpp b/src/core/BandLimitedWave.cpp index 0f83badcf..0f303fe15 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 248434cf9..ff35e6a19 100644 --- a/src/core/BufferManager.cpp +++ b/src/core/BufferManager.cpp @@ -30,17 +30,20 @@ #include "MemoryManager.h" -static fpp_t framesPerPeriod; - -void BufferManager::init( fpp_t framesPerPeriod ) +namespace lmms { - ::framesPerPeriod = framesPerPeriod; + +fpp_t BufferManager::s_framesPerPeriod; + +void BufferManager::init( fpp_t fpp ) +{ + s_framesPerPeriod = fpp; } sampleFrame * BufferManager::acquire() { - return MM_ALLOC( ::framesPerPeriod ); + return MM_ALLOC( s_framesPerPeriod ); } void BufferManager::clear( sampleFrame *ab, const f_cnt_t frames, const f_cnt_t offset ) @@ -62,3 +65,4 @@ void BufferManager::release( sampleFrame * buf ) MM_FREE( buf ); } +} // namespace lmms diff --git a/src/core/Clip.cpp b/src/core/Clip.cpp index f247b967e..74a168fbd 100644 --- a/src/core/Clip.cpp +++ b/src/core/Clip.cpp @@ -33,6 +33,9 @@ #include "Song.h" +namespace lmms +{ + /*! \brief Create a new Clip * * Creates a new clip for the given track. @@ -145,7 +148,7 @@ void Clip::copyStateTo( Clip *src, Clip *dst ) dst->movePosition( pos ); AutomationClip::resolveAllIDs(); - GuiApplication::instance()->automationEditor()->m_editor->updateAfterClipChange(); + gui::getGUI()->automationEditor()->m_editor->updateAfterClipChange(); } } @@ -197,3 +200,4 @@ bool Clip::hasColor() return usesCustomClipColor() || getTrack()->useColor(); } +} // namespace lmms diff --git a/src/core/Clipboard.cpp b/src/core/Clipboard.cpp index c30b657bb..6e1503b2f 100644 --- a/src/core/Clipboard.cpp +++ b/src/core/Clipboard.cpp @@ -29,8 +29,9 @@ #include "Clipboard.h" -namespace Clipboard +namespace lmms::Clipboard { + const QMimeData * getMimeData() { return QApplication::clipboard()->mimeData( QClipboard::Clipboard ); @@ -90,4 +91,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 19d4f576f..f1b1c6b2e 100644 --- a/src/core/ComboBoxModel.cpp +++ b/src/core/ComboBoxModel.cpp @@ -26,6 +26,9 @@ #include +namespace lmms +{ + using std::unique_ptr; using std::move; @@ -69,6 +72,6 @@ int ComboBoxModel::findText( const QString& txt ) const } - +} // namespace lmms diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 5444ea834..59987de97 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 = { @@ -514,10 +517,10 @@ void ConfigManager::loadConfigFile(const QString & configFile) #endif setBackgroundPicFile(value("paths", "backgroundtheme")); } - else if(getGUI() != nullptr) + else if (gui::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)); @@ -634,6 +637,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 " @@ -643,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, @@ -734,3 +739,6 @@ unsigned int ConfigManager::legacyConfigVersion() return 2; } } + + +} // namespace lmms diff --git a/src/core/Controller.cpp b/src/core/Controller.cpp index 5cb3218a9..4ff9c4c93 100644 --- a/src/core/Controller.cpp +++ b/src/core/Controller.cpp @@ -35,6 +35,9 @@ #include "MidiController.h" #include "PeakController.h" +namespace lmms +{ + long Controller::s_periods = 0; QVector Controller::s_controllers; @@ -194,7 +197,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: @@ -203,7 +206,7 @@ Controller * Controller::create( ControllerTypes _ct, Model * _parent ) break; case Controller::MidiController: - c = new ::MidiController( _parent ); + c = new class MidiController( _parent ); break; default: @@ -291,9 +294,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; } @@ -323,7 +326,7 @@ int Controller::connectionCount() const{ } - +} // namespace lmms diff --git a/src/core/ControllerConnection.cpp b/src/core/ControllerConnection.cpp index 03b054629..a6402227f 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 2fe9b88d9..1cbacc2fd 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -50,6 +50,10 @@ #include "lmmsversion.h" +namespace lmms +{ + + static void findIds(const QDomElement& elem, QList& idList); @@ -139,11 +143,11 @@ DataFile::DataFile( const QString & _fileName ) : QFile inFile( _fileName ); if( !inFile.open( QIODevice::ReadOnly ) ) { - if( getGUI() != nullptr ) + if (gui::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 " @@ -295,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); @@ -325,6 +329,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) { @@ -1884,8 +1890,10 @@ 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 ) + if (gui::getGUI() != nullptr) { QMessageBox::critical( nullptr, SongEditor::tr( "Error in file" ), @@ -1918,18 +1926,20 @@ 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; 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"); - TextFloat::displayMessage( + gui::TextFloat::displayMessage( SongEditor::tr("Version difference"), SongEditor::tr("This %1 was created with LMMS %2") .arg(projectType).arg(createdWith.getVersion()), @@ -1973,3 +1983,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 diff --git a/src/core/DrumSynth.cpp b/src/core/DrumSynth.cpp index d4f9fe167..2b7ad9d1b 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 e730db5a5..78f093773 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 7b9b3b2db..6d16bb19e 100644 --- a/src/core/EffectChain.cpp +++ b/src/core/EffectChain.cpp @@ -31,6 +31,9 @@ #include "DummyEffect.h" #include "MixHelpers.h" +namespace lmms +{ + EffectChain::EffectChain( Model * _parent ) : Model( _parent ), @@ -240,3 +243,6 @@ void EffectChain::clear() m_enabledModel.setValue( false ); } + + +} // namespace lmms diff --git a/src/core/Engine.cpp b/src/core/Engine.cpp index a46590188..6c8104721 100644 --- a/src/core/Engine.cpp +++ b/src/core/Engine.cpp @@ -37,24 +37,27 @@ #include "BandLimitedWave.h" #include "Oscillator.h" -float LmmsCore::s_framesPerTick; -AudioEngine* LmmsCore::s_audioEngine = nullptr; -Mixer * LmmsCore::s_mixer = nullptr; -PatternStore * LmmsCore::s_patternStore = nullptr; -Song * LmmsCore::s_song = nullptr; -ProjectJournal * LmmsCore::s_projectJournal = nullptr; -#ifdef LMMS_HAVE_LV2 -Lv2Manager * LmmsCore::s_lv2Manager = nullptr; -#endif -Ladspa2LMMS * LmmsCore::s_ladspaManager = nullptr; -void* LmmsCore::s_dndPluginKey = nullptr; - - - - -void LmmsCore::init( bool renderOnly ) +namespace lmms { - LmmsCore *engine = inst(); + +float Engine::s_framesPerTick; +AudioEngine* Engine::s_audioEngine = nullptr; +Mixer * Engine::s_mixer = nullptr; +PatternStore * Engine::s_patternStore = nullptr; +Song * Engine::s_song = nullptr; +ProjectJournal * Engine::s_projectJournal = nullptr; +#ifdef LMMS_HAVE_LV2 +Lv2Manager * Engine::s_lv2Manager = nullptr; +#endif +Ladspa2LMMS * Engine::s_ladspaManager = nullptr; +void* Engine::s_dndPluginKey = nullptr; + + + + +void Engine::init( bool renderOnly ) +{ + Engine *engine = inst(); emit engine->initProgress(tr("Generating wavetables")); // generate (load from file) bandlimited wavetables @@ -89,7 +92,7 @@ void LmmsCore::init( bool renderOnly ) -void LmmsCore::destroy() +void Engine::destroy() { s_projectJournal->stopAllJournalling(); s_audioEngine->stopProcessing(); @@ -123,7 +126,7 @@ void LmmsCore::destroy() -bool LmmsCore::ignorePluginBlacklist() +bool Engine::ignorePluginBlacklist() { const char* envVar = getenv("LMMS_IGNORE_BLACKLIST"); return (envVar && *envVar); @@ -132,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(); @@ -141,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(); } @@ -149,7 +152,7 @@ void LmmsCore::updateFramesPerTick() -void LmmsCore::setDndPluginKey(void *newKey) +void Engine::setDndPluginKey(void *newKey) { Q_ASSERT(static_cast(newKey)); s_dndPluginKey = newKey; @@ -158,7 +161,7 @@ void LmmsCore::setDndPluginKey(void *newKey) -void *LmmsCore::pickDndPluginKey() +void *Engine::pickDndPluginKey() { return s_dndPluginKey; } @@ -166,4 +169,6 @@ void *LmmsCore::pickDndPluginKey() -LmmsCore * LmmsCore::s_instanceOfMe = nullptr; +Engine * Engine::s_instanceOfMe = nullptr; + +} // namespace lmms \ No newline at end of file diff --git a/src/core/EnvelopeAndLfoParameters.cpp b/src/core/EnvelopeAndLfoParameters.cpp index 7dc948e3b..b80b54946 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/ImportFilter.cpp b/src/core/ImportFilter.cpp index 6f41756a6..1caa62e7d 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 7df6a2d75..bbea1becb 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 9b7267c0d..a7d3f73e8 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 1295ed6d2..27c9e4f66 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 71ac555b3..8c272cd47 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 e3ab82c0e..a9765d256 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 729303c67..802f4291e 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 a50abfaf2..5dfdd9186 100644 --- a/src/core/Keymap.cpp +++ b/src/core/Keymap.cpp @@ -29,6 +29,10 @@ #include "Note.h" +namespace lmms +{ + + Keymap::Keymap() : m_description(tr("empty")), m_firstKey(0), @@ -149,3 +153,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 950e4bf0d..e16f5c98c 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 4d3faeda7..fb6ef9167 100644 --- a/src/core/LadspaControl.cpp +++ b/src/core/LadspaControl.cpp @@ -30,6 +30,9 @@ #include "LadspaControl.h" #include "LadspaBase.h" +namespace lmms +{ + LadspaControl::LadspaControl( Model * _parent, port_desc_t * _port, bool _link ) : @@ -379,5 +382,4 @@ void LadspaControl::setLink( bool _state ) } - - +} // namespace lmms diff --git a/src/core/LadspaManager.cpp b/src/core/LadspaManager.cpp index 851ae007e..875a4f132 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 947fd5e22..548da5d7c 100644 --- a/src/core/LfoController.cpp +++ b/src/core/LfoController.cpp @@ -31,6 +31,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" ) ), @@ -220,12 +224,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 d0bcd8cfd..4fdf54fc0 100644 --- a/src/core/LinkedModelGroups.cpp +++ b/src/core/LinkedModelGroups.cpp @@ -22,15 +22,18 @@ * */ -#include "LinkedModelGroups.h" - #include #include +#include "LinkedModelGroups.h" + + #include "AutomatableModel.h" +namespace lmms +{ /* LinkedModelGroup @@ -182,3 +185,5 @@ void LinkedModelGroups::loadSettings(const QDomElement& that) } } + +} // namespace lmms diff --git a/src/core/LocklessAllocator.cpp b/src/core/LocklessAllocator.cpp index 07aaa0c14..919093906 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 @@ invalid: } ++m_available; } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/MemoryHelper.cpp b/src/core/MemoryHelper.cpp index 8ac2700f3..de80ef770 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 ) } } + +} // namespace lmms diff --git a/src/core/MemoryManager.cpp b/src/core/MemoryManager.cpp index 01fdfd5d6..bd3168f14 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 7bf61958d..ee5d8bbc8 100644 --- a/src/core/MeterModel.cpp +++ b/src/core/MeterModel.cpp @@ -27,7 +27,10 @@ #include "AutomationClip.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 ba94f1c9a..44506481e 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 b384cf390..f8de21267 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 816104061..2b2b5952f 100644 --- a/src/core/MixHelpers.cpp +++ b/src/core/MixHelpers.cpp @@ -38,7 +38,7 @@ static bool s_NaNHandler; -namespace MixHelpers +namespace lmms::MixHelpers { /*! \brief Function for applying MIXOP on all sample frames */ @@ -328,5 +328,5 @@ void multiplyAndAddMultipliedJoined( sampleFrame* dst, run<>( dst, srcLeft, srcRight, frames, MultiplyAndAddMultipliedOp(coeffDst, coeffSrc) ); } -} +} // namespace lmms::MixHelpers diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index bf72c42a4..688190ee2 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -36,6 +36,10 @@ #include "SampleTrack.h" #include "TrackContainer.h" // For TrackContainer::TrackList typedef +namespace lmms +{ + + MixerRoute::MixerRoute( MixerChannel * from, MixerChannel * to, float amount ) : m_from( from ), m_to( to ), @@ -827,3 +831,6 @@ void Mixer::validateChannelName( int index, int oldIndex ) m_mixerChannels[index]->m_name = tr( "Channel %1" ).arg( index ); } } + + +} // namespace lmms diff --git a/src/core/Model.cpp b/src/core/Model.cpp index 597d0340d..dd277bc4e 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 4036f56e0..17e328587 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 cba02ee9e..b730ec1cc 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 2a4cf8f12..e31299eda 100644 --- a/src/core/NotePlayHandle.cpp +++ b/src/core/NotePlayHandle.cpp @@ -33,6 +33,9 @@ #include "Instrument.h" #include "Song.h" +namespace lmms +{ + NotePlayHandle::BaseDetuning::BaseDetuning( DetuningHelper *detuning ) : m_value( detuning ? detuning->automationClip()->valueAt( 0 ) : 0 ) { @@ -663,3 +666,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 16b99bb5f..2dc7f6910 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 24d9c8992..299993673 100644 --- a/src/core/PathUtil.cpp +++ b/src/core/PathUtil.cpp @@ -7,7 +7,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, @@ -187,4 +187,5 @@ namespace PathUtil } return basePrefix(shortestBase) + relativeOrAbsolute(absolutePath, shortestBase); } -} + +} // namespace lmms::PathUtil diff --git a/src/core/PatternClip.cpp b/src/core/PatternClip.cpp index d88ef5224..7ea56cd48 100644 --- a/src/core/PatternClip.cpp +++ b/src/core/PatternClip.cpp @@ -31,6 +31,9 @@ #include "PatternStore.h" #include "PatternTrack.h" +namespace lmms +{ + PatternClip::PatternClip(Track* track) : Clip(track) @@ -109,7 +112,10 @@ int PatternClip::patternIndex() -ClipView* PatternClip::createView(TrackView* tv) +gui::ClipView* PatternClip::createView(gui::TrackView* tv) { - return new PatternClipView(this, tv); + return new gui::PatternClipView(this, tv); } + + +} // namespace lmms diff --git a/src/core/PatternStore.cpp b/src/core/PatternStore.cpp index c16726777..af1b9b3bb 100644 --- a/src/core/PatternStore.cpp +++ b/src/core/PatternStore.cpp @@ -30,6 +30,8 @@ #include "PatternTrack.h" #include "Song.h" +namespace lmms +{ PatternStore::PatternStore() : @@ -257,3 +259,5 @@ AutomatedValueMap PatternStore::automatedValuesAt(TimePos time, int clipNum) con return TrackContainer::automatedValuesAt(time + (TimePos::ticksPerBar() * clipNum), clipNum); } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/PeakController.cpp b/src/core/PeakController.cpp index c46123507..b29295604 100644 --- a/src/core/PeakController.cpp +++ b/src/core/PeakController.cpp @@ -34,6 +34,10 @@ #include "EffectChain.h" #include "plugins/PeakControllerEffect/PeakControllerEffect.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 951c6d842..490567448 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 62680efa7..8cf1917e3 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 1c5f90ef0..168121e0f 100644 --- a/src/core/PlayHandle.cpp +++ b/src/core/PlayHandle.cpp @@ -30,6 +30,9 @@ #include +namespace lmms +{ + PlayHandle::PlayHandle(const Type type, f_cnt_t offset) : m_type(type), m_offset(offset), @@ -71,3 +74,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 7772bffde..e71df15b8 100644 --- a/src/core/Plugin.cpp +++ b/src/core/Plugin.cpp @@ -35,6 +35,10 @@ #include "DummyPlugin.h" #include "AutomatableModel.h" #include "Song.h" +#include "PluginFactory.h" + +namespace lmms +{ static PixmapLoader dummyLoader; @@ -183,7 +187,6 @@ AutomatableModel * Plugin::childModel( const QString & ) -#include "PluginFactory.h" Plugin * Plugin::instantiateWithKey(const QString& pluginName, Model * parent, const Descriptor::SubPluginFeatures::Key *key, bool keyFromDnd) @@ -218,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" ), @@ -240,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" ), @@ -265,9 +268,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 ); @@ -312,3 +315,4 @@ QDomElement Plugin::Descriptor::SubPluginFeatures::Key::saveXML( +} // namespace lmms diff --git a/src/core/PluginFactory.cpp b/src/core/PluginFactory.cpp index 879af542c..184dc0b94 100644 --- a/src/core/PluginFactory.cpp +++ b/src/core/PluginFactory.cpp @@ -34,17 +34,22 @@ #include "ConfigManager.h" #include "Plugin.h" +// QT qHash specialization, needs to be in global namespace +qint64 qHash(const QFileInfo& fi) +{ + return qHash(fi.absoluteFilePath()); +} + +namespace lmms +{ + + #ifdef LMMS_BUILD_WIN32 QStringList nameFilters("*.dll"); #else QStringList nameFilters("lib*.so"); #endif -qint64 qHash(const QFileInfo& fi) -{ - return qHash(fi.absoluteFilePath()); -} - std::unique_ptr PluginFactory::s_instance; PluginFactory::PluginFactory() @@ -251,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 7d43586f5..f8ae06bc7 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,8 +95,6 @@ bool PluginIssue::operator<(const PluginIssue &other) const } - - QDebug operator<<(QDebug stream, const PluginIssue &iss) { stream << PluginIssue::msgFor(iss.m_issueType); @@ -103,4 +105,7 @@ QDebug operator<<(QDebug stream, const PluginIssue &iss) return stream; } +} // namespace lmms + + diff --git a/src/core/PresetPreviewPlayHandle.cpp b/src/core/PresetPreviewPlayHandle.cpp index a0e5da445..0ce248e9c 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 3d1e9078a..2a59a2724 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 323fdd6c9..bb5020c9b 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -34,6 +34,11 @@ #include "AudioFileMP3.h" #include "AudioFileFlac.h" + +namespace lmms +{ + + const ProjectRenderer::FileEncodeDevice ProjectRenderer::fileEncodeDevices[] = { @@ -246,3 +251,4 @@ void ProjectRenderer::updateConsoleProgress() } +} // namespace lmms diff --git a/src/core/ProjectVersion.cpp b/src/core/ProjectVersion.cpp index 6f3dcddbe..b6ee2843f 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 a70ce0a31..ff18fde53 100644 --- a/src/core/RemotePlugin.cpp +++ b/src/core/RemotePlugin.cpp @@ -71,6 +71,9 @@ HANDLE getRemotePluginJob() #endif // LMMS_BUILD_WIN32 +namespace lmms +{ + // simple helper thread monitoring our RemotePlugin - if process terminates // unexpectedly invalidate plugin so LMMS doesn't lock up ProcessWatcher::ProcessWatcher( RemotePlugin * _p ) : @@ -571,3 +574,6 @@ bool RemotePlugin::processMessage( const message & _m ) return true; } + + +} // namespace lmms diff --git a/src/core/RenderManager.cpp b/src/core/RenderManager.cpp index a0de888f4..e2f6b9311 100644 --- a/src/core/RenderManager.cpp +++ b/src/core/RenderManager.cpp @@ -30,6 +30,10 @@ #include "Song.h" +namespace lmms +{ + + RenderManager::RenderManager( const AudioEngine::qualitySettings & qualitySettings, const OutputSettings & outputSettings, @@ -200,3 +204,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 3fe1feeb7..b2e40f3c0 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 e09dd5198..b931b27b5 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -61,6 +61,8 @@ #include "FileDialog.h" +namespace lmms +{ SampleBuffer::SampleBuffer() : m_userAntiAliasWaveTable(nullptr), @@ -367,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); @@ -1121,7 +1123,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()) @@ -1144,7 +1146,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; @@ -1587,3 +1589,5 @@ SampleBuffer::handleState::~handleState() { src_delete(m_resamplingData); } + +} // namespace lmms diff --git a/src/core/SampleClip.cpp b/src/core/SampleClip.cpp index 46bb6e6b7..9ee8e93e4 100644 --- a/src/core/SampleClip.cpp +++ b/src/core/SampleClip.cpp @@ -31,6 +31,11 @@ #include "SampleTrack.h" #include "TimeLineWidget.h" + +namespace lmms +{ + + SampleClip::SampleClip( Track * _track ) : Clip( _track ), m_sampleBuffer( new SampleBuffer ), @@ -42,13 +47,13 @@ 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() ) ); //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() ) ); @@ -316,7 +321,10 @@ void SampleClip::loadSettings( const QDomElement & _this ) -ClipView * SampleClip::createView( TrackView * _tv ) +gui::ClipView * SampleClip::createView( gui::TrackView * _tv ) { - return new SampleClipView( this, _tv ); + return new gui::SampleClipView( this, _tv ); } + + +} // namespace lmms diff --git a/src/core/SamplePlayHandle.cpp b/src/core/SamplePlayHandle.cpp index f82f5dbf4..77658e1d8 100644 --- a/src/core/SamplePlayHandle.cpp +++ b/src/core/SamplePlayHandle.cpp @@ -31,6 +31,8 @@ #include "SampleClip.h" #include "SampleTrack.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 cc0ce1635..76d71c9f3 100644 --- a/src/core/SampleRecordHandle.cpp +++ b/src/core/SampleRecordHandle.cpp @@ -32,6 +32,10 @@ #include "debug.h" +namespace lmms +{ + + SampleRecordHandle::SampleRecordHandle( SampleClip* clip ) : PlayHandle( TypeSamplePlayHandle ), m_framesRecorded( 0 ), @@ -148,4 +152,4 @@ void SampleRecordHandle::writeBuffer( const sampleFrame * _ab, const f_cnt_t _fr } - +} // namespace lmms diff --git a/src/core/Scale.cpp b/src/core/Scale.cpp index 394377e28..762da4ff8 100644 --- a/src/core/Scale.cpp +++ b/src/core/Scale.cpp @@ -27,6 +27,9 @@ #include #include +namespace lmms +{ + Interval::Interval(float cents) : m_numerator(0), @@ -121,3 +124,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 bc79eb920..9487ebef5 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 c52a1fa6f..d26eab450 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -58,6 +58,9 @@ #include "PeakController.h" +namespace lmms +{ + tick_t TimePos::s_ticksPerBar = DefaultTicksPerBar; @@ -184,7 +187,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 ) { @@ -636,6 +639,8 @@ void Song::stop() return; } + using gui::TimeLineWidget; + // To avoid race conditions with the processing threads Engine::audioEngine()->requestChangeInModel(); @@ -851,6 +856,8 @@ AutomatedValueMap Song::automatedValuesAt(TimePos time, int clipNum) const void Song::clearProject() { + using gui::getGUI; + Engine::projectJournal()->setJournalling( false ); if( m_playing ) @@ -1008,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; @@ -1225,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; @@ -1551,3 +1562,6 @@ void Song::setKeymap(unsigned int index, std::shared_ptr newMap) emit keymapListChanged(index); Engine::audioEngine()->doneChangeInModel(); } + + +} // namespace lmms diff --git a/src/core/StepRecorder.cpp b/src/core/StepRecorder.cpp index 29675d5b2..e8f31f644 100644 --- a/src/core/StepRecorder.cpp +++ b/src/core/StepRecorder.cpp @@ -27,12 +27,16 @@ #include "PianoRoll.h" +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_midiClip(nullptr) @@ -367,3 +371,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 a85ca2e9f..bc7c86db9 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, @@ -41,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 ); } @@ -181,8 +185,4 @@ void TempoSyncKnobModel::updateCustom() } - - - - - +} // namespace lmms diff --git a/src/core/TimePos.cpp b/src/core/TimePos.cpp index 4a22a1eb9..f3b09474d 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 6c2b0fed7..99c3e5bec 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 d3418ea33..1bb1b8e8b 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -43,6 +43,9 @@ #include "Song.h" +namespace lmms +{ + /*! \brief Create a new (empty) track object * * The track object is the whole track, linking its contents, its @@ -106,14 +109,14 @@ Track * Track::create( TrackTypes tt, TrackContainer * tc ) switch( tt ) { - case InstrumentTrack: t = new ::InstrumentTrack( tc ); break; - case PatternTrack: t = new ::PatternTrack( tc ); break; - case SampleTrack: t = new ::SampleTrack( tc ); break; + case InstrumentTrack: t = new class InstrumentTrack( tc ); break; + case PatternTrack: t = new class PatternTrack( 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; } @@ -656,3 +659,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 6c52b41af..ce8fdd400 100644 --- a/src/core/TrackContainer.cpp +++ b/src/core/TrackContainer.cpp @@ -41,6 +41,10 @@ #include "MainWindow.h" #include "TextFloat.h" +namespace lmms +{ + + TrackContainer::TrackContainer() : Model( nullptr ), JournallingObject(), @@ -87,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(); @@ -111,9 +115,9 @@ void TrackContainer::loadSettings( const QDomElement & _this ) QEventLoop::AllEvents, 100 ); if( pd->wasCanceled() ) { - if ( getGUI() != nullptr ) + if (gui::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 ); @@ -330,3 +334,5 @@ AutomatedValueMap TrackContainer::automatedValuesFromTracks(const TrackList &tra return valueMap; }; + +} // namespace lmms diff --git a/src/core/ValueBuffer.cpp b/src/core/ValueBuffer.cpp index 687bd3c15..09aee65bd 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 efe295d7a..1699905c6 100644 --- a/src/core/VstSyncController.cpp +++ b/src/core/VstSyncController.cpp @@ -35,6 +35,10 @@ #include "RemotePlugin.h" +namespace lmms +{ + + VstSyncController::VstSyncController() : m_syncData( nullptr ) { @@ -140,6 +144,4 @@ void VstSyncController::updateSampleRate() } - - - +} // namespace lmms diff --git a/src/core/audio/AudioAlsa.cpp b/src/core/audio/AudioAlsa.cpp index 1cea301b9..0cf95f895 100644 --- a/src/core/audio/AudioAlsa.cpp +++ b/src/core/audio/AudioAlsa.cpp @@ -32,6 +32,8 @@ #include "ConfigManager.h" #include "Engine.h" +namespace lmms +{ AudioAlsa::AudioAlsa( bool & _success_ful, AudioEngine* _audioEngine ) : AudioDevice( qBound( @@ -538,4 +540,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 145e6b471..5fb58a1b0 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 e7d78bc36..f80d4a00f 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, @@ -38,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 ) @@ -52,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, @@ -87,3 +91,4 @@ int AudioFileDevice::writeData( const void* data, int len ) return -1; } +} // namespace lmms diff --git a/src/core/audio/AudioFileFlac.cpp b/src/core/audio/AudioFileFlac.cpp index aa6d8e214..4e40257cd 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 088cd6eda..75084460f 100644 --- a/src/core/audio/AudioFileMP3.cpp +++ b/src/core/audio/AudioFileMP3.cpp @@ -30,6 +30,8 @@ #include +namespace lmms +{ AudioFileMP3::AudioFileMP3( OutputSettings const & outputSettings, const ch_cnt_t channels, @@ -130,4 +132,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 d9aa8b4f0..1f40f456e 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 1fce2fe48..6f1a425b9 100644 --- a/src/core/audio/AudioFileWave.cpp +++ b/src/core/audio/AudioFileWave.cpp @@ -28,6 +28,8 @@ #include "AudioEngine.h" +namespace lmms +{ AudioFileWave::AudioFileWave( OutputSettings const & outputSettings, const ch_cnt_t channels, bool & successful, @@ -136,3 +138,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 6bc039a50..f0e606f47 100644 --- a/src/core/audio/AudioJack.cpp +++ b/src/core/audio/AudioJack.cpp @@ -40,6 +40,8 @@ #include "MidiJack.h" +namespace lmms +{ AudioJack::AudioJack( bool & _success_ful, AudioEngine* _audioEngine ) : AudioDevice( qBound( @@ -102,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 " @@ -111,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. " @@ -464,13 +466,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 ); @@ -498,6 +500,6 @@ void AudioJack::setupWidget::saveSettings() - +} // namespace lmms #endif diff --git a/src/core/audio/AudioOss.cpp b/src/core/audio/AudioOss.cpp index 76df85adc..76f10a61e 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 b83e6b418..4bbf509d8 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 1bc137dac..cc1e611c9 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 @@ -50,6 +57,9 @@ void AudioPortAudioSetupUtil::updateChannels() #include "ComboBox.h" #include "AudioEngine.h" +namespace lmms +{ + AudioPortAudio::AudioPortAudio( bool & _success_ful, AudioEngine * _audioEngine ) : AudioDevice( qBound( @@ -407,6 +417,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 ); @@ -496,6 +508,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 5f82b64dc..40c955434 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 a33308c99..358a9b897 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 d62678b49..cb622a941 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 114e01460..52ff1666e 100644 --- a/src/core/audio/AudioSndio.cpp +++ b/src/core/audio/AudioSndio.cpp @@ -40,6 +40,8 @@ #include "ConfigManager.h" +namespace lmms +{ AudioSndio::AudioSndio(bool & _success_ful, AudioEngine * _audioEngine) : AudioDevice( qBound( @@ -188,13 +190,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 ); @@ -217,4 +219,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 c8ef04542..c56d23dc3 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 c04300dcf..b1c26b610 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 9e49c5544..63088f655 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 b6be53a2c..ab5db6ef1 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 3c8ccbf8a..6fb5900ea 100644 --- a/src/core/lv2/Lv2ControlBase.cpp +++ b/src/core/lv2/Lv2ControlBase.cpp @@ -35,6 +35,8 @@ #include "Lv2Proc.h" +namespace lmms +{ Plugin::PluginTypes Lv2ControlBase::check(const LilvPlugin *plugin, @@ -213,6 +215,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 0c9081815..2d2ad0517 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 74d2415b0..60c1b4324 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); @@ -101,5 +105,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 09870a90b..1622d4c1b 100644 --- a/src/core/lv2/Lv2Manager.cpp +++ b/src/core/lv2/Lv2Manager.cpp @@ -42,6 +42,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 e941165f0..36281ee63 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 4db7f3e2a..9e7a9e80c 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 59f84befe..20987b32f 100644 --- a/src/core/lv2/Lv2Proc.cpp +++ b/src/core/lv2/Lv2Proc.cpp @@ -45,6 +45,8 @@ #include "MidiEventToByteSeq.h" +namespace lmms +{ // container for everything required to store MIDI events going to the plugin @@ -839,4 +841,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 8fb908cb1..ce950c6ba 100644 --- a/src/core/lv2/Lv2SubPluginFeatures.cpp +++ b/src/core/lv2/Lv2SubPluginFeatures.cpp @@ -35,6 +35,9 @@ #include "Lv2Basics.h" #include "Lv2Manager.h" +namespace lmms +{ + const LilvPlugin *Lv2SubPluginFeatures::getPlugin( const Plugin::Descriptor::SubPluginFeatures::Key &k) @@ -179,5 +182,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 3392f9bd2..746878afb 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 7e4fa864f..4709f4898 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/main.cpp b/src/core/main.cpp index 953995b67..5d454dd9b 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -124,7 +124,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"; @@ -252,6 +252,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 @@ -359,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 ); @@ -854,6 +856,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 @@ -1007,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/MidiAlsaRaw.cpp b/src/core/midi/MidiAlsaRaw.cpp index 883d31e96..04ef5c1ce 100644 --- a/src/core/midi/MidiAlsaRaw.cpp +++ b/src/core/midi/MidiAlsaRaw.cpp @@ -29,6 +29,10 @@ #ifdef LMMS_HAVE_ALSA +namespace lmms +{ + + MidiAlsaRaw::MidiAlsaRaw() : MidiClientRaw(), m_inputp( &m_input ), @@ -169,5 +173,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 b04964843..41904812c 100644 --- a/src/core/midi/MidiAlsaSeq.cpp +++ b/src/core/midi/MidiAlsaSeq.cpp @@ -31,6 +31,10 @@ #ifdef LMMS_HAVE_ALSA + +namespace lmms +{ + const int EventPollTimeOut = 250; @@ -97,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(); @@ -693,5 +697,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 66a996d0f..01836c50b 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 109e01fd6..def556170 100644 --- a/src/core/midi/MidiClient.cpp +++ b/src/core/midi/MidiClient.cpp @@ -27,6 +27,9 @@ #include "MidiPort.h" +namespace lmms +{ + MidiClient::MidiClient() { } @@ -324,3 +327,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 91d0dd782..61c85104e 100644 --- a/src/core/midi/MidiController.cpp +++ b/src/core/midi/MidiController.cpp @@ -28,6 +28,9 @@ #include "AudioEngine.h" #include "MidiController.h" +namespace lmms +{ + MidiController::MidiController( Model * _parent ) : Controller( Controller::MidiController, _parent, tr( "MIDI Controller" ) ), @@ -146,11 +149,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 98f0541d0..6ef302c30 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 fdf194889..1ad4da09d 100644 --- a/src/core/midi/MidiJack.cpp +++ b/src/core/midi/MidiJack.cpp @@ -35,6 +35,9 @@ #include "Engine.h" #include "MainWindow.h" +namespace lmms +{ + /* callback functions for jack */ static int JackMidiProcessCallback(jack_nframes_t nframes, void *arg) { @@ -55,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() : @@ -228,4 +231,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 faf6453a2..848bac705 100644 --- a/src/core/midi/MidiOss.cpp +++ b/src/core/midi/MidiOss.cpp @@ -30,6 +30,9 @@ #include "ConfigManager.h" +namespace lmms +{ + MidiOss::MidiOss() : MidiClientRaw(), @@ -106,6 +109,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 40460f434..9b3f46304 100644 --- a/src/core/midi/MidiPort.cpp +++ b/src/core/midi/MidiPort.cpp @@ -32,6 +32,11 @@ #include "Note.h" #include "Song.h" + +namespace lmms +{ + + static MidiDummy s_dummyClient; @@ -422,3 +427,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 4acd2827e..d09803e86 100644 --- a/src/core/midi/MidiSndio.cpp +++ b/src/core/midi/MidiSndio.cpp @@ -34,6 +34,10 @@ #include "ConfigManager.h" +namespace lmms +{ + + MidiSndio::MidiSndio( void ) : MidiClientRaw(), m_quit( false ) @@ -111,4 +115,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 80ebea964..811e0842c 100644 --- a/src/core/midi/MidiWinMM.cpp +++ b/src/core/midi/MidiWinMM.cpp @@ -27,6 +27,10 @@ #ifdef LMMS_BUILD_WIN32 +namespace lmms +{ + + MidiWinMM::MidiWinMM() : MidiClient(), m_inputDevices(), @@ -299,4 +303,6 @@ void MidiWinMM::openDevices() } -#endif +} // namespace lmms + +#endif // LMMS_BUILD_WIN32 diff --git a/src/gui/ActionGroup.cpp b/src/gui/ActionGroup.cpp index 5b40bd204..053bb556d 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 26da660da..f6e91f8e3 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 feba3f1b0..ae559404c 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 082022d35..7ef527cae 100644 --- a/src/gui/AutomatableModelView.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -38,9 +38,12 @@ #include "AutomationEditor.h" +namespace lmms::gui +{ + 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 ) { @@ -170,7 +173,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 ) @@ -212,7 +215,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 ) { @@ -303,3 +306,5 @@ static float floatFromClipboard(bool* ok) return getString( MimeType::Default ).toFloat(ok); } + +} // namespace lmms::gui diff --git a/src/gui/ControlLayout.cpp b/src/gui/ControlLayout.cpp index 0885c3c44..356d608e3 100644 --- a/src/gui/ControlLayout.cpp +++ b/src/gui/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/ControllerDialog.cpp b/src/gui/ControllerDialog.cpp index f854ab1b9..be7d5dbef 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/ControllerRackView.cpp b/src/gui/ControllerRackView.cpp index 2b597e1c2..9549b6e0d 100644 --- a/src/gui/ControllerRackView.cpp +++ b/src/gui/ControllerRackView.cpp @@ -38,6 +38,9 @@ #include "LfoController.h" #include "SubWindow.h" +namespace lmms::gui +{ + ControllerRackView::ControllerRackView( ) : QWidget(), @@ -65,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 ); @@ -145,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 ); @@ -212,3 +215,5 @@ void ControllerRackView::closeEvent( QCloseEvent * _ce ) _ce->ignore(); } + +} // namespace lmms::gui diff --git a/src/gui/ControllerView.cpp b/src/gui/ControllerView.cpp index a3b1a7934..7e046b4f2 100644 --- a/src/gui/ControllerView.cpp +++ b/src/gui/ControllerView.cpp @@ -40,6 +40,9 @@ #include "MainWindow.h" #include "SubWindow.h" +namespace lmms::gui +{ + ControllerView::ControllerView( Controller * _model, QWidget * _parent ) : QFrame( _parent ), @@ -179,3 +182,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/Controls.cpp b/src/gui/Controls.cpp index 246b08734..fa28c695f 100644 --- a/src/gui/Controls.cpp +++ b/src/gui/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/EffectControlDialog.cpp b/src/gui/EffectControlDialog.cpp index d7d5b4054..a134435fa 100644 --- a/src/gui/EffectControlDialog.cpp +++ b/src/gui/EffectControlDialog.cpp @@ -28,6 +28,9 @@ #include "EffectControlDialog.h" #include "EffectControls.h" +namespace lmms::gui +{ + EffectControlDialog::EffectControlDialog( EffectControls * _controls ) : QWidget( nullptr ), @@ -55,6 +58,4 @@ void EffectControlDialog::closeEvent( QCloseEvent * _ce ) } - - - +} // namespace lmms::gui diff --git a/src/gui/EffectRackView.cpp b/src/gui/EffectRackView.cpp index f6bac18e2..27600056e 100644 --- a/src/gui/EffectRackView.cpp +++ b/src/gui/EffectRackView.cpp @@ -34,6 +34,9 @@ #include "GroupBox.h" +namespace lmms::gui +{ + EffectRackView::EffectRackView( EffectChain* model, QWidget* parent ) : QWidget( parent ), ModelView( nullptr, this ) @@ -168,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 ); @@ -263,4 +266,4 @@ void EffectRackView::modelChanged() - +} // namespace lmms::gui diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index 11d95cb2e..f90283631 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -40,6 +40,9 @@ #include "TempoSyncKnob.h" +namespace lmms::gui +{ + EffectView::EffectView( Effect * _model, QWidget * _parent ) : PluginView( _model, _parent ), m_bg( embed::getIconPixmap( "effect_plugin" ) ), @@ -234,3 +237,5 @@ void EffectView::modelChanged() m_autoQuit->setModel( &effect()->m_autoQuitModel ); m_gate->setModel( &effect()->m_gateModel ); } + +} // namespace lmms::gui diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index a67dc52ee..7f212b10a 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -59,6 +59,10 @@ #include "StringPairDrag.h" #include "TextFloat.h" +namespace lmms::gui +{ + + enum TreeWidgetItemTypes { TypeFileItem = QTreeWidgetItem::UserType, @@ -1295,3 +1299,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/GuiApplication.cpp b/src/gui/GuiApplication.cpp index 0829bfd80..a016aaea5 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -51,6 +51,19 @@ #include #endif +namespace lmms +{ + + +namespace gui +{ + +GuiApplication* getGUI() +{ + return GuiApplication::instance(); +} + + GuiApplication* GuiApplication::s_instance = nullptr; GuiApplication* GuiApplication::instance() @@ -58,10 +71,7 @@ GuiApplication* GuiApplication::instance() return s_instance; } -GuiApplication* getGUI() -{ - return GuiApplication::instance(); -} + GuiApplication::GuiApplication() { @@ -249,3 +259,8 @@ QFont GuiApplication::getWin32SystemFont() return QFont( QString::fromUtf8( metrics.lfMessageFont.lfFaceName ), pointSize ); } #endif + + +} // namespace gui + +} // namespace lmms diff --git a/src/gui/LadspaControlView.cpp b/src/gui/LadspaControlView.cpp index 9b539ff21..a82f2e33e 100644 --- a/src/gui/LadspaControlView.cpp +++ b/src/gui/LadspaControlView.cpp @@ -33,6 +33,9 @@ #include "TempoSyncKnob.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/LfoControllerDialog.cpp b/src/gui/LfoControllerDialog.cpp index 672e22ed5..84a3451d8 100644 --- a/src/gui/LfoControllerDialog.cpp +++ b/src/gui/LfoControllerDialog.cpp @@ -32,6 +32,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; @@ -268,3 +272,4 @@ void LfoControllerDialog::modelChanged() } +} // namespace lmms::gui diff --git a/src/gui/LinkedModelGroupViews.cpp b/src/gui/LinkedModelGroupViews.cpp index 8cac826eb..80b08f384 100644 --- a/src/gui/LinkedModelGroupViews.cpp +++ b/src/gui/LinkedModelGroupViews.cpp @@ -29,6 +29,9 @@ #include "ControlLayout.h" #include "LinkedModelGroups.h" +namespace lmms::gui +{ + /* LinkedModelGroupViewBase @@ -169,3 +172,4 @@ void LinkedModelGroupsView::modelChanged(LinkedModelGroups *groups) } +} // namespace lmms::gui diff --git a/src/gui/LmmsPalette.cpp b/src/gui/LmmsPalette.cpp index e0b356d7a..769405d3e 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 2882b9572..ee62e613d 100644 --- a/src/gui/LmmsStyle.cpp +++ b/src/gui/LmmsStyle.cpp @@ -33,6 +33,11 @@ #include "LmmsStyle.h" + +namespace lmms::gui +{ + + QPalette * LmmsStyle::s_palette = nullptr; QLinearGradient getGradient( const QColor & _col, const QRectF & _rect ) @@ -368,3 +373,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 1ae12beed..7f7a06959 100644 --- a/src/gui/Lv2ViewBase.cpp +++ b/src/gui/Lv2ViewBase.cpp @@ -47,6 +47,8 @@ #include "SubWindow.h" +namespace lmms::gui +{ Lv2ViewProc::Lv2ViewProc(QWidget* parent, Lv2Proc* ctrlBase, int colNum) : @@ -248,4 +250,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 64aeb73a5..a08df0f09 100644 --- a/src/gui/MainApplication.cpp +++ b/src/gui/MainApplication.cpp @@ -31,6 +31,10 @@ #include "MainWindow.h" #include "Song.h" +namespace lmms::gui +{ + + 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::gui diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index 2bb1ae599..bc917f53c 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -75,6 +75,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) @@ -1735,3 +1738,6 @@ void MainWindow::onProjectFileNameChanged() { this->resetWindowTitle(); } + + +} // namespace lmms::gui diff --git a/src/gui/MicrotunerConfig.cpp b/src/gui/MicrotunerConfig.cpp index 307369a19..dc0ef4a37 100644 --- a/src/gui/MicrotunerConfig.cpp +++ b/src/gui/MicrotunerConfig.cpp @@ -50,6 +50,9 @@ #include "Song.h" #include "SubWindow.h" +namespace lmms::gui +{ + MicrotunerConfig::MicrotunerConfig() : QWidget(), @@ -651,3 +654,6 @@ void MicrotunerConfig::closeEvent(QCloseEvent *ce) else {hide();} ce->ignore(); } + + +} // namespace lmms::gui diff --git a/src/gui/MidiCCRackView.cpp b/src/gui/MidiCCRackView.cpp index f7bf98e81..ac9e45244 100644 --- a/src/gui/MidiCCRackView.cpp +++ b/src/gui/MidiCCRackView.cpp @@ -38,6 +38,9 @@ #include "MainWindow.h" #include "SubWindow.h" +namespace lmms::gui +{ + MidiCCRackView::MidiCCRackView(InstrumentTrack * track) : QWidget(), @@ -130,3 +133,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 7298eb558..fed63f5bb 100644 --- a/src/gui/MidiSetupWidget.cpp +++ b/src/gui/MidiSetupWidget.cpp @@ -30,6 +30,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), @@ -65,3 +70,6 @@ void MidiSetupWidget::show() parentWidget()->setVisible(visible); QWidget::setVisible(visible); } + + +} // namespace lmms::gui diff --git a/src/gui/MixerLine.cpp b/src/gui/MixerLine.cpp index 6c0cc5bc3..bf63a9035 100644 --- a/src/gui/MixerLine.cpp +++ b/src/gui/MixerLine.cpp @@ -44,6 +44,10 @@ #include "SendButtonIndicator.h" #include "Song.h" +namespace lmms::gui +{ + + bool MixerLine::eventFilter( QObject *dist, QEvent *event ) { // If we are in a rename, capture the enter/return events and handle them @@ -456,3 +460,6 @@ void MixerLine::randomizeColor() Engine::getSong()->setModified(); update(); } + + +} // namespace lmms::gui diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index 15a24721f..0a24b32cc 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -46,6 +46,10 @@ #include "SubWindow.h" #include "TrackContainer.h" // For TrackContainer::TrackList typedef +namespace lmms::gui +{ + + MixerView::MixerView() : QWidget(), ModelView( nullptr, this ), @@ -618,3 +622,6 @@ void MixerView::updateFaders() } } } + + +} // namesapce lmms::gui diff --git a/src/gui/ModelView.cpp b/src/gui/ModelView.cpp index 055f0846d..4ccdffd72 100644 --- a/src/gui/ModelView.cpp +++ b/src/gui/ModelView.cpp @@ -26,6 +26,8 @@ #include "ModelView.h" +namespace lmms::gui +{ ModelView::ModelView( Model* model, QWidget* widget ) : @@ -94,3 +96,4 @@ void ModelView::doConnections() } +} // namespace lmms::gui diff --git a/src/gui/PeakControllerDialog.cpp b/src/gui/PeakControllerDialog.cpp index 923467d7e..62307fc7d 100644 --- a/src/gui/PeakControllerDialog.cpp +++ b/src/gui/PeakControllerDialog.cpp @@ -32,6 +32,9 @@ #include "PeakController.h" +namespace lmms::gui +{ + PeakControllerDialog::PeakControllerDialog( Controller * _model, QWidget * _parent ) : ControllerDialog( _model, _parent ) @@ -87,3 +90,4 @@ void PeakControllerDialog::modelChanged() } +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/PluginBrowser.cpp b/src/gui/PluginBrowser.cpp index 649d6bb56..2fd1374da 100644 --- a/src/gui/PluginBrowser.cpp +++ b/src/gui/PluginBrowser.cpp @@ -37,6 +37,9 @@ #include "StringPairDrag.h" #include "PluginFactory.h" +namespace lmms::gui +{ + PluginBrowser::PluginBrowser( QWidget * _parent ) : SideBarWidget( tr( "Instrument Plugins" ), @@ -285,9 +288,4 @@ void PluginDescWidget::mousePressEvent( QMouseEvent * _me ) } - - - - - - +} // namespace lmms::gui diff --git a/src/gui/ProjectNotes.cpp b/src/gui/ProjectNotes.cpp index 428720ee9..9a218c571 100644 --- a/src/gui/ProjectNotes.cpp +++ b/src/gui/ProjectNotes.cpp @@ -44,6 +44,9 @@ #include "Song.h" +namespace lmms::gui +{ + ProjectNotes::ProjectNotes() : QMainWindow( getGUI()->mainWindow()->workspace() ) @@ -409,3 +412,5 @@ void ProjectNotes::closeEvent( QCloseEvent * _ce ) } _ce->ignore(); } + +} // namespace lmms::gui diff --git a/src/gui/RowTableView.cpp b/src/gui/RowTableView.cpp index 9830354be..cef8b87ea 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/SampleTrackWindow.cpp b/src/gui/SampleTrackWindow.cpp index 0ef22a01d..1aee88082 100644 --- a/src/gui/SampleTrackWindow.cpp +++ b/src/gui/SampleTrackWindow.cpp @@ -43,7 +43,10 @@ #include "SubWindow.h" #include "TabWidget.h" #include "TrackLabelButton.h" - + +namespace lmms::gui +{ + SampleTrackWindow::SampleTrackWindow(SampleTrackView * tv) : QWidget(), @@ -271,3 +274,6 @@ void SampleTrackWindow::loadSettings(const QDomElement& element) m_stv->m_tlb->setChecked(true); } } + + +} // namespace lmms::gui diff --git a/src/gui/SendButtonIndicator.cpp b/src/gui/SendButtonIndicator.cpp index 6772f6289..cd1996c45 100644 --- a/src/gui/SendButtonIndicator.cpp +++ b/src/gui/SendButtonIndicator.cpp @@ -5,6 +5,10 @@ #include "MixerLine.h" #include "MixerView.h" +namespace lmms::gui +{ + + QPixmap * SendButtonIndicator::s_qpmOff = nullptr; QPixmap * SendButtonIndicator::s_qpmOn = nullptr; @@ -62,3 +66,6 @@ void SendButtonIndicator::updateLightStatus() { setPixmap( getSendModel() == nullptr ? *s_qpmOff : *s_qpmOn ); } + + +} // namespace lmms::gui diff --git a/src/gui/SideBar.cpp b/src/gui/SideBar.cpp index 92b7d8884..4c6f6abd1 100644 --- a/src/gui/SideBar.cpp +++ b/src/gui/SideBar.cpp @@ -29,6 +29,9 @@ #include "SideBar.h" #include "SideBarWidget.h" +namespace lmms::gui +{ + // internal helper class allowing to create QToolButtons with // vertical orientation @@ -164,5 +167,4 @@ void SideBar::toggleButton( QAbstractButton * button ) } - - +} // namespace lmms::gui diff --git a/src/gui/SideBarWidget.cpp b/src/gui/SideBarWidget.cpp index ab827f8d1..600ed245c 100644 --- a/src/gui/SideBarWidget.cpp +++ b/src/gui/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/StringPairDrag.cpp b/src/gui/StringPairDrag.cpp index 6aa5da170..e9eef0b88 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 df3fe0047..add614670 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -37,6 +37,8 @@ #include "embed.h" +namespace lmms::gui +{ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : @@ -378,3 +380,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/ToolPluginView.cpp b/src/gui/ToolPluginView.cpp index a85a7ff6d..de553519c 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/clips/AutomationClipView.cpp b/src/gui/clips/AutomationClipView.cpp index f11885893..b87e7e097 100644 --- a/src/gui/clips/AutomationClipView.cpp +++ b/src/gui/clips/AutomationClipView.cpp @@ -41,6 +41,9 @@ #include "Engine.h" +namespace lmms::gui +{ + QPixmap * AutomationClipView::s_clip_rec = nullptr; AutomationClipView::AutomationClipView( AutomationClip * _clip, @@ -508,3 +511,6 @@ void AutomationClipView::scaleTimemapToFit( float oldMin, float oldMax ) m_clip->generateTangents(); } + + +} // namespace lmms::gui diff --git a/src/gui/clips/ClipView.cpp b/src/gui/clips/ClipView.cpp index 1e154f155..12603b2e7 100644 --- a/src/gui/clips/ClipView.cpp +++ b/src/gui/clips/ClipView.cpp @@ -52,6 +52,9 @@ #include "TrackContainerView.h" #include "TrackView.h" +namespace lmms::gui +{ + /*! The width of the resize grip in pixels */ @@ -1502,3 +1505,6 @@ QColor ClipView::getColorForDisplay( QColor defaultColor ) // Return color to caller return c; } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/clips/MidiClipView.cpp b/src/gui/clips/MidiClipView.cpp index 987d1fe14..355363a01 100644 --- a/src/gui/clips/MidiClipView.cpp +++ b/src/gui/clips/MidiClipView.cpp @@ -37,6 +37,10 @@ #include "PianoRoll.h" #include "RenameDialog.h" +namespace lmms::gui +{ + + MidiClipView::MidiClipView( MidiClip* clip, TrackView* parent ) : ClipView( clip, parent ), m_clip( clip ), @@ -616,3 +620,6 @@ void MidiClipView::paintEvent( QPaintEvent * ) painter.drawPixmap( 0, 0, m_paintPixmap ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/clips/PatternClipView.cpp b/src/gui/clips/PatternClipView.cpp index f865f778b..3884b3eb6 100644 --- a/src/gui/clips/PatternClipView.cpp +++ b/src/gui/clips/PatternClipView.cpp @@ -35,6 +35,10 @@ #include "PatternStore.h" #include "RenameDialog.h" +namespace lmms::gui +{ + + PatternClipView::PatternClipView(Clip* _clip, TrackView* _tv) : ClipView( _clip, _tv ), m_patternClip(dynamic_cast(_clip)), @@ -188,3 +192,6 @@ void PatternClipView::update() ClipView::update(); } + + +} // namespace lmms::gui diff --git a/src/gui/clips/SampleClipView.cpp b/src/gui/clips/SampleClipView.cpp index 80b0e6ef2..d2fe7cbaa 100644 --- a/src/gui/clips/SampleClipView.cpp +++ b/src/gui/clips/SampleClipView.cpp @@ -35,6 +35,10 @@ #include "Song.h" #include "StringPairDrag.h" +namespace lmms::gui +{ + + SampleClipView::SampleClipView( SampleClip * _clip, TrackView * _tv ) : ClipView( _clip, _tv ), m_clip( _clip ), @@ -351,3 +355,6 @@ bool SampleClipView::splitClip( const TimePos pos ) } else { return false; } } + + +} // namespace lmms::gui diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 998af4be8..8f8cdd570 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -62,6 +62,9 @@ #include "TimeLineWidget.h" +namespace lmms::gui +{ + QPixmap * AutomationEditor::s_toolDraw = nullptr; QPixmap * AutomationEditor::s_toolErase = nullptr; QPixmap * AutomationEditor::s_toolDrawOut = nullptr; @@ -147,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 ); @@ -2107,3 +2110,6 @@ void AutomationEditorWindow::updateWindowTitle() setWindowTitle( tr( "Automation Editor - %1" ).arg( m_editor->m_clip->name() ) ); } + + +} // namespace lmms::gui diff --git a/src/gui/editors/Editor.cpp b/src/gui/editors/Editor.cpp index f9ab600bf..19f64a65c 100644 --- a/src/gui/editors/Editor.cpp +++ b/src/gui/editors/Editor.cpp @@ -33,6 +33,10 @@ #include +namespace lmms::gui +{ + + void Editor::setPauseIcon(bool displayPauseIcon) { // If we're playing, show a pause icon @@ -169,3 +173,4 @@ void DropToolBar::dropEvent(QDropEvent* event) +} // namespace lmms::gui diff --git a/src/gui/editors/PatternEditor.cpp b/src/gui/editors/PatternEditor.cpp index 818c454f6..86a116dd2 100644 --- a/src/gui/editors/PatternEditor.cpp +++ b/src/gui/editors/PatternEditor.cpp @@ -40,6 +40,8 @@ #include "MidiClip.h" +namespace lmms::gui +{ PatternEditor::PatternEditor(PatternStore* ps) : @@ -327,3 +329,6 @@ void PatternEditorWindow::stop() { Engine::getSong()->stop(); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index bafede415..fd1cd0480 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -73,11 +73,16 @@ #include "FileDialog.h" -using std::move; +namespace lmms +{ + typedef AutomationClip::timeMap timeMap; +namespace gui +{ + // some constants... const int INITIAL_PIANOROLL_WIDTH = 970; const int INITIAL_PIANOROLL_HEIGHT = 485; @@ -296,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(); @@ -372,12 +377,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 ); @@ -908,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() ) ); @@ -5349,3 +5354,8 @@ void PianoRollWindow::updateStepRecordingIcon() m_toggleStepRecordingAction->setIcon(embed::getIconPixmap("record_step_off")); } } + + +} // namespace gui + +} // namespace lmms diff --git a/src/gui/editors/PositionLine.cpp b/src/gui/editors/PositionLine.cpp index c91a82abe..e340a1c8c 100644 --- a/src/gui/editors/PositionLine.cpp +++ b/src/gui/editors/PositionLine.cpp @@ -29,6 +29,9 @@ #include "Song.h" +namespace lmms::gui +{ + PositionLine::PositionLine(QWidget* parent) : QWidget(parent), m_hasTailGradient(false), @@ -95,3 +98,6 @@ void PositionLine::zoomChange(float zoom) update(); } + + +} // namespace lmms::gui diff --git a/src/gui/editors/Rubberband.cpp b/src/gui/editors/Rubberband.cpp index b0bd5cc06..c1ef329f0 100644 --- a/src/gui/editors/Rubberband.cpp +++ b/src/gui/editors/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/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index c70705aaf..9c028feba 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -54,6 +54,10 @@ #include "TimeLineWidget.h" #include "TrackView.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 }; @@ -84,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() ), @@ -1138,3 +1142,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/editors/StepRecorderWidget.cpp b/src/gui/editors/StepRecorderWidget.cpp index 679901b0e..ffb45aa53 100644 --- a/src/gui/editors/StepRecorderWidget.cpp +++ b/src/gui/editors/StepRecorderWidget.cpp @@ -26,6 +26,9 @@ #include "TextFloat.h" #include "embed.h" +namespace lmms::gui +{ + StepRecorderWidget::StepRecorderWidget( QWidget * parent, const int ppb, @@ -168,3 +171,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/editors/TimeLineWidget.cpp b/src/gui/editors/TimeLineWidget.cpp index f5159d640..b7aa6d94f 100644 --- a/src/gui/editors/TimeLineWidget.cpp +++ b/src/gui/editors/TimeLineWidget.cpp @@ -36,6 +36,9 @@ #include "GuiApplication.h" #include "TextFloat.h" +namespace lmms::gui +{ + QPixmap * TimeLineWidget::s_posMarkerPixmap = nullptr; @@ -423,3 +426,6 @@ void TimeLineWidget::mouseReleaseEvent( QMouseEvent* event ) if ( m_action == SelectSongClip ) { emit selectionFinished(); } m_action = NoAction; } + + +} // namespace lmms::gui diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index 04034074e..6c85cf1a3 100644 --- a/src/gui/editors/TrackContainerView.cpp +++ b/src/gui/editors/TrackContainerView.cpp @@ -44,8 +44,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 ), @@ -82,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 ); } @@ -123,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 ); } @@ -480,25 +508,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/embed.cpp b/src/gui/embed.cpp index 6ce4b5bd7..d934adcde 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/instrument/EnvelopeAndLfoView.cpp b/src/gui/instrument/EnvelopeAndLfoView.cpp index 3ca55c9a8..cff230e38 100644 --- a/src/gui/instrument/EnvelopeAndLfoView.cpp +++ b/src/gui/instrument/EnvelopeAndLfoView.cpp @@ -42,11 +42,17 @@ #include "TextFloat.h" #include "Track.h" +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; @@ -528,4 +534,6 @@ void EnvelopeAndLfoView::lfoUserWaveChanged() +} // namespace gui +} // namespace lmms \ No newline at end of file diff --git a/src/gui/instrument/InstrumentFunctionViews.cpp b/src/gui/instrument/InstrumentFunctionViews.cpp index c10b7d349..639e9e7c3 100644 --- a/src/gui/instrument/InstrumentFunctionViews.cpp +++ b/src/gui/instrument/InstrumentFunctionViews.cpp @@ -35,6 +35,9 @@ #include "TempoSyncKnob.h" +namespace lmms::gui +{ + InstrumentFunctionNoteStackingView::InstrumentFunctionNoteStackingView( InstrumentFunctionNoteStacking* cc, QWidget* parent ) : QWidget( parent ), ModelView( nullptr, this ), @@ -201,4 +204,4 @@ void InstrumentFunctionArpeggioView::modelChanged() - +} // namespace lmms::gui diff --git a/src/gui/instrument/InstrumentMidiIOView.cpp b/src/gui/instrument/InstrumentMidiIOView.cpp index c85ee75be..f42208b51 100644 --- a/src/gui/instrument/InstrumentMidiIOView.cpp +++ b/src/gui/instrument/InstrumentMidiIOView.cpp @@ -37,6 +37,9 @@ #include "LcdSpinBox.h" #include "MidiClient.h" +namespace lmms::gui +{ + InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : QWidget( parent ), @@ -206,3 +209,5 @@ void InstrumentMidiIOView::modelChanged() } } + +} // namespace lmms::gui diff --git a/src/gui/instrument/InstrumentMiscView.cpp b/src/gui/instrument/InstrumentMiscView.cpp index 5fcd4dc41..be79db788 100644 --- a/src/gui/instrument/InstrumentMiscView.cpp +++ b/src/gui/instrument/InstrumentMiscView.cpp @@ -36,6 +36,10 @@ #include "LedCheckBox.h" +namespace lmms::gui +{ + + InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) : QWidget(parent) { @@ -85,3 +89,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/instrument/InstrumentSoundShapingView.cpp b/src/gui/instrument/InstrumentSoundShapingView.cpp index 47dc389aa..dd5c14a09 100644 --- a/src/gui/instrument/InstrumentSoundShapingView.cpp +++ b/src/gui/instrument/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/instrument/InstrumentTrackWindow.cpp b/src/gui/instrument/InstrumentTrackWindow.cpp index 6c4acbfa1..a457acec8 100644 --- a/src/gui/instrument/InstrumentTrackWindow.cpp +++ b/src/gui/instrument/InstrumentTrackWindow.cpp @@ -69,6 +69,10 @@ #include "TrackLabelButton.h" +namespace lmms::gui +{ + + const int INSTRUMENT_WIDTH = 254; const int INSTRUMENT_HEIGHT = INSTRUMENT_WIDTH; const int PIANO_HEIGHT = 80; @@ -130,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; @@ -679,3 +694,5 @@ void InstrumentTrackWindow::adjustTabSize(QWidget *w) w->setMinimumSize(INSTRUMENT_WIDTH - 4, INSTRUMENT_HEIGHT - 4 - 1); } + +} // namespace lmms::gui diff --git a/src/gui/instrument/InstrumentView.cpp b/src/gui/instrument/InstrumentView.cpp index eaa49df10..06f37feda 100644 --- a/src/gui/instrument/InstrumentView.cpp +++ b/src/gui/instrument/InstrumentView.cpp @@ -29,6 +29,8 @@ #include "InstrumentTrack.h" #include "InstrumentTrackWindow.h" +namespace lmms::gui +{ InstrumentView::InstrumentView( Instrument * _Instrument, QWidget * _parent ) : PluginView( _Instrument, _parent ) @@ -77,3 +79,5 @@ InstrumentViewFixedSize::~InstrumentViewFixedSize() { } + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/instrument/PianoView.cpp b/src/gui/instrument/PianoView.cpp index 78962d938..fa5594c68 100644 --- a/src/gui/instrument/PianoView.cpp +++ b/src/gui/instrument/PianoView.cpp @@ -56,6 +56,10 @@ #include "StringPairDrag.h" +namespace lmms::gui +{ + + /*! The scale of C Major - white keys only. */ Keys WhiteKeys[] = @@ -982,5 +986,5 @@ void PianoView::paintEvent( QPaintEvent * ) } - +} // namespace lmms::gui diff --git a/src/gui/menus/MidiPortMenu.cpp b/src/gui/menus/MidiPortMenu.cpp index 1cdb43f68..328efebd1 100644 --- a/src/gui/menus/MidiPortMenu.cpp +++ b/src/gui/menus/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/menus/RecentProjectsMenu.cpp b/src/gui/menus/RecentProjectsMenu.cpp index dc7b3bd2b..bbbf79e86 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 9f89e3a9f..1a1ef7c84 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/modals/AboutDialog.cpp b/src/gui/modals/AboutDialog.cpp index e3f016b5e..6c6b435eb 100644 --- a/src/gui/modals/AboutDialog.cpp +++ b/src/gui/modals/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/modals/ColorChooser.cpp b/src/gui/modals/ColorChooser.cpp index b25aa97be..d178debe5 100644 --- a/src/gui/modals/ColorChooser.cpp +++ b/src/gui/modals/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/modals/ControllerConnectionDialog.cpp b/src/gui/modals/ControllerConnectionDialog.cpp index cab90a53f..008acbdb5 100644 --- a/src/gui/modals/ControllerConnectionDialog.cpp +++ b/src/gui/modals/ControllerConnectionDialog.cpp @@ -45,6 +45,9 @@ #include "embed.h" +namespace lmms +{ + class AutoDetectMidiController : public MidiController { public: @@ -121,6 +124,8 @@ private: +namespace gui +{ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, const AutomatableModel * _target_model ) : @@ -440,5 +445,6 @@ void ControllerConnectionDialog::enableAutoDetect( QAction * _a ) +} // namespace gui - +} // namespace lmms diff --git a/src/gui/modals/EffectSelectDialog.cpp b/src/gui/modals/EffectSelectDialog.cpp index b4bd3af4a..22f094827 100644 --- a/src/gui/modals/EffectSelectDialog.cpp +++ b/src/gui/modals/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/modals/EffectSelectDialog.ui b/src/gui/modals/EffectSelectDialog.ui index f8e773486..b0433e66c 100644 --- a/src/gui/modals/EffectSelectDialog.ui +++ b/src/gui/modals/EffectSelectDialog.ui @@ -24,7 +24,7 @@ - + 500 diff --git a/src/gui/modals/ExportProjectDialog.cpp b/src/gui/modals/ExportProjectDialog.cpp index 151d25237..fc9113b3f 100644 --- a/src/gui/modals/ExportProjectDialog.cpp +++ b/src/gui/modals/ExportProjectDialog.cpp @@ -31,6 +31,8 @@ #include "MainWindow.h" #include "OutputSettings.h" +namespace lmms::gui +{ ExportProjectDialog::ExportProjectDialog( const QString & _file_name, QWidget * _parent, bool multi_export=false ) : @@ -294,3 +296,5 @@ void ExportProjectDialog::updateTitleBar( int _prog ) getGUI()->mainWindow()->setWindowTitle( tr( "Rendering: %1%" ).arg( _prog ) ); } + +} // namespace lmms::gui diff --git a/src/gui/modals/FileDialog.cpp b/src/gui/modals/FileDialog.cpp index 79f1ca5e0..321397f19 100644 --- a/src/gui/modals/FileDialog.cpp +++ b/src/gui/modals/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/modals/RenameDialog.cpp b/src/gui/modals/RenameDialog.cpp index cb427b2c0..76ae9d6bb 100644 --- a/src/gui/modals/RenameDialog.cpp +++ b/src/gui/modals/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/modals/SetupDialog.cpp b/src/gui/modals/SetupDialog.cpp index 035912a47..33cecedad 100644 --- a/src/gui/modals/SetupDialog.cpp +++ b/src/gui/modals/SetupDialog.cpp @@ -68,6 +68,10 @@ #include "MidiWinMM.h" +namespace lmms::gui +{ + + constexpr int BUFFERSIZE_RESOLUTION = 32; inline void labelWidget(QWidget * w, const QString & txt) @@ -1396,3 +1400,6 @@ void SetupDialog::showRestartWarning() { restartWarningLbl->show(); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/modals/VersionedSaveDialog.cpp b/src/gui/modals/VersionedSaveDialog.cpp index 1bdea502a..06a576ea9 100644 --- a/src/gui/modals/VersionedSaveDialog.cpp +++ b/src/gui/modals/VersionedSaveDialog.cpp @@ -34,6 +34,10 @@ #include "LedCheckBox.h" +namespace lmms::gui +{ + + VersionedSaveDialog::VersionedSaveDialog( QWidget *parent, QWidget *saveOptionsWidget, const QString &caption, @@ -189,3 +193,6 @@ SaveOptionsWidget::SaveOptionsWidget(Song::SaveOptions &saveOptions) { setLayout(layout); } + + +} // namespace lmms::gui diff --git a/src/gui/tracks/AutomationTrackView.cpp b/src/gui/tracks/AutomationTrackView.cpp index ec44ba937..60f00679b 100644 --- a/src/gui/tracks/AutomationTrackView.cpp +++ b/src/gui/tracks/AutomationTrackView.cpp @@ -23,8 +23,7 @@ * */ - #include "AutomationTrackView.h" - +#include "AutomationTrackView.h" #include "AutomationClip.h" #include "AutomationTrack.h" #include "embed.h" @@ -33,7 +32,9 @@ #include "StringPairDrag.h" #include "TrackContainerView.h" #include "TrackLabelButton.h" - + +namespace lmms::gui +{ AutomationTrackView::AutomationTrackView( AutomationTrack * _at, TrackContainerView* tcv ) : TrackView( _at, tcv ) @@ -87,3 +88,6 @@ void AutomationTrackView::dropEvent( QDropEvent * _de ) update(); } + + +} // namespace lmms::gui diff --git a/src/gui/tracks/FadeButton.cpp b/src/gui/tracks/FadeButton.cpp index c40569c21..d4b75cbf1 100644 --- a/src/gui/tracks/FadeButton.cpp +++ b/src/gui/tracks/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/tracks/InstrumentTrackView.cpp b/src/gui/tracks/InstrumentTrackView.cpp index b58144956..b7a2fda61 100644 --- a/src/gui/tracks/InstrumentTrackView.cpp +++ b/src/gui/tracks/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::createMixerMenu(QString title, QString newMixerLabe return mixerMenu; } + +} // namespace lmms::gui diff --git a/src/gui/tracks/PatternTrackView.cpp b/src/gui/tracks/PatternTrackView.cpp index 7571cd1db..41195f5db 100644 --- a/src/gui/tracks/PatternTrackView.cpp +++ b/src/gui/tracks/PatternTrackView.cpp @@ -31,6 +31,9 @@ #include "PatternTrack.h" #include "TrackLabelButton.h" +namespace lmms::gui +{ + PatternTrackView::PatternTrackView(PatternTrack* pt, TrackContainerView* tcv) : TrackView(pt, tcv), m_patternTrack(pt) @@ -74,3 +77,6 @@ void PatternTrackView::clickedTrackLabel() getGUI()->patternEditor()->parentWidget()->show(); getGUI()->patternEditor()->setFocus(Qt::ActiveWindowFocusReason); } + + +} // namespace lmms::gui diff --git a/src/gui/tracks/SampleTrackView.cpp b/src/gui/tracks/SampleTrackView.cpp index a73724911..9897b3309 100644 --- a/src/gui/tracks/SampleTrackView.cpp +++ b/src/gui/tracks/SampleTrackView.cpp @@ -42,6 +42,10 @@ #include "TrackLabelButton.h" +namespace lmms::gui +{ + + SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) : TrackView( _t, tcv ) { @@ -232,3 +236,6 @@ void SampleTrackView::assignMixerLine(int channelIndex) getGUI()->mixerView()->setCurrentMixerLine(channelIndex); } + + +} // namespace lmms::gui diff --git a/src/gui/tracks/TrackContentWidget.cpp b/src/gui/tracks/TrackContentWidget.cpp index 36bbd4096..03e7487a6 100644 --- a/src/gui/tracks/TrackContentWidget.cpp +++ b/src/gui/tracks/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; @@ -68,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() ); @@ -722,3 +725,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/tracks/TrackLabelButton.cpp b/src/gui/tracks/TrackLabelButton.cpp index 3388fe9fb..6f3d13727 100644 --- a/src/gui/tracks/TrackLabelButton.cpp +++ b/src/gui/tracks/TrackLabelButton.cpp @@ -38,7 +38,8 @@ #include "TrackRenameLineEdit.h" #include "TrackView.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/tracks/TrackOperationsWidget.cpp b/src/gui/tracks/TrackOperationsWidget.cpp index 4b56282a6..c529b26e8 100644 --- a/src/gui/tracks/TrackOperationsWidget.cpp +++ b/src/gui/tracks/TrackOperationsWidget.cpp @@ -47,6 +47,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. @@ -103,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() ), @@ -391,3 +394,5 @@ void TrackOperationsWidget::recordingOff() toggleRecording( false ); } + +} // namespace lmms::gui diff --git a/src/gui/tracks/TrackRenameLineEdit.cpp b/src/gui/tracks/TrackRenameLineEdit.cpp index b68af3141..dab827ff9 100644 --- a/src/gui/tracks/TrackRenameLineEdit.cpp +++ b/src/gui/tracks/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/gui/tracks/TrackView.cpp b/src/gui/tracks/TrackView.cpp index 888af3c5f..61d598f6e 100644 --- a/src/gui/tracks/TrackView.cpp +++ b/src/gui/tracks/TrackView.cpp @@ -45,6 +45,9 @@ #include "ClipView.h" +namespace lmms::gui +{ + /*! \brief Create a new track View. * * The track View is handles the actual display of the track, including @@ -87,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() ), @@ -446,3 +449,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/widgets/AutomatableButton.cpp b/src/gui/widgets/AutomatableButton.cpp index 80d127877..29af4af86 100644 --- a/src/gui/widgets/AutomatableButton.cpp +++ b/src/gui/widgets/AutomatableButton.cpp @@ -31,6 +31,8 @@ #include "StringPairDrag.h" +namespace lmms::gui +{ AutomatableButton::AutomatableButton( QWidget * _parent, const QString & _name ) : @@ -266,4 +268,4 @@ void automatableButtonGroup::updateButtons() - +} // namespace lmms::gui diff --git a/src/gui/widgets/AutomatableSlider.cpp b/src/gui/widgets/AutomatableSlider.cpp index f44732de1..b7af54b32 100644 --- a/src/gui/widgets/AutomatableSlider.cpp +++ b/src/gui/widgets/AutomatableSlider.cpp @@ -30,6 +30,8 @@ #include "CaptionMenu.h" +namespace lmms::gui +{ AutomatableSlider::AutomatableSlider( QWidget * _parent, @@ -140,5 +142,5 @@ void AutomatableSlider::updateSlider() - +} // namespace lmms::gui diff --git a/src/gui/widgets/CPULoadWidget.cpp b/src/gui/widgets/CPULoadWidget.cpp index 4cc6bca9f..01c36994e 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 bfd743d0d..032ee10b9 100644 --- a/src/gui/widgets/CaptionMenu.cpp +++ b/src/gui/widgets/CaptionMenu.cpp @@ -26,6 +26,8 @@ #include "CaptionMenu.h" +namespace lmms::gui +{ CaptionMenu::CaptionMenu( const QString & _title, QWidget * _parent ) : @@ -41,3 +43,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 181256b96..ab6b29b9d 100644 --- a/src/gui/widgets/ComboBox.cpp +++ b/src/gui/widgets/ComboBox.cpp @@ -36,6 +36,8 @@ #include "embed.h" #include "gui_templates.h" +namespace lmms::gui +{ QPixmap * ComboBox::s_background = nullptr; QPixmap * ComboBox::s_arrow = nullptr; @@ -249,6 +251,6 @@ void ComboBox::setItem( QAction* item ) } - +} // namespace lmms::gui diff --git a/src/gui/widgets/CustomTextKnob.cpp b/src/gui/widgets/CustomTextKnob.cpp index 149b3494b..9f6e19b90 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/Fader.cpp b/src/gui/widgets/Fader.cpp index f569aa550..d063464a6 100644 --- a/src/gui/widgets/Fader.cpp +++ b/src/gui/widgets/Fader.cpp @@ -56,6 +56,9 @@ #include "ConfigManager.h" #include "TextFloat.h" +namespace lmms::gui +{ + TextFloat * Fader::s_textFloat = nullptr; QPixmap * Fader::s_back = nullptr; @@ -478,3 +481,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/Graph.cpp b/src/gui/widgets/Graph.cpp index 71e8375ee..ed0355a4c 100644 --- a/src/gui/widgets/Graph.cpp +++ b/src/gui/widgets/Graph.cpp @@ -30,6 +30,11 @@ #include "SampleBuffer.h" #include "Oscillator.h" +namespace lmms +{ + +namespace gui +{ Graph::Graph( QWidget * _parent, graphStyle _style, int _width, int _height ) : @@ -451,8 +456,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 ), @@ -744,6 +751,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 b8378d54f..b5187de25 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/Knob.cpp b/src/gui/widgets/Knob.cpp index 96ef6fec8..f6a1163a7 100644 --- a/src/gui/widgets/Knob.cpp +++ b/src/gui/widgets/Knob.cpp @@ -48,6 +48,10 @@ #include "StringPairDrag.h" #include "TextFloat.h" + +namespace lmms::gui +{ + TextFloat * Knob::s_textFloat = nullptr; @@ -864,3 +868,6 @@ void convertPixmapToGrayScale(QPixmap& pixMap) } pixMap.convertFromImage(temp); } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/LcdFloatSpinBox.cpp b/src/gui/widgets/LcdFloatSpinBox.cpp index 22b4d5509..4112c567b 100644 --- a/src/gui/widgets/LcdFloatSpinBox.cpp +++ b/src/gui/widgets/LcdFloatSpinBox.cpp @@ -43,6 +43,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), @@ -241,3 +244,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 ef0d08aae..7dd7fa8e8 100644 --- a/src/gui/widgets/LcdSpinBox.cpp +++ b/src/gui/widgets/LcdSpinBox.cpp @@ -31,6 +31,8 @@ #include "CaptionMenu.h" +namespace lmms::gui +{ LcdSpinBox::LcdSpinBox( int numDigits, QWidget* parent, const QString& name ) : LcdWidget( numDigits, parent, name ), @@ -169,3 +171,4 @@ void LcdSpinBox::enterValue() } } +} // namespace lmms::gui diff --git a/src/gui/widgets/LcdWidget.cpp b/src/gui/widgets/LcdWidget.cpp index c947f7720..a21536bf7 100644 --- a/src/gui/widgets/LcdWidget.cpp +++ b/src/gui/widgets/LcdWidget.cpp @@ -34,7 +34,8 @@ #include "gui_templates.h" - +namespace lmms::gui +{ LcdWidget::LcdWidget(QWidget* parent, const QString& name, bool leadingZero) : LcdWidget(1, parent, name, leadingZero) @@ -290,3 +291,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 832d7da46..f31d03b2c 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 a76b4ec6d..30f7106d3 100644 --- a/src/gui/widgets/LeftRightNav.cpp +++ b/src/gui/widgets/LeftRightNav.cpp @@ -28,6 +28,9 @@ #include "LeftRightNav.h" #include "embed.h" +namespace lmms::gui +{ + LeftRightNav::LeftRightNav(QWidget *parent) : QWidget(parent), @@ -90,3 +93,6 @@ void LeftRightNav::setShortcuts(const QKeySequence &leftShortcut, const QKeySequ m_leftBtn.setToolTip(tr("Previous (%1)").arg(leftShortcut.toString())); m_rightBtn.setToolTip(tr("Next (%1)").arg(rightShortcut.toString())); } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/MeterDialog.cpp b/src/gui/widgets/MeterDialog.cpp index deeeb0599..f60f6bd06 100644 --- a/src/gui/widgets/MeterDialog.cpp +++ b/src/gui/widgets/MeterDialog.cpp @@ -33,6 +33,9 @@ #include "gui_templates.h" #include "LcdSpinBox.h" +namespace lmms::gui +{ + MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : QWidget( _parent ), @@ -114,3 +117,5 @@ void MeterDialog::modelChanged() m_denominator->setModel( &mm->denominatorModel() ); } + +} // namespace lmms::gui diff --git a/src/gui/widgets/MixerLineLcdSpinBox.cpp b/src/gui/widgets/MixerLineLcdSpinBox.cpp index bdf8ac8f9..06eb823c0 100644 --- a/src/gui/widgets/MixerLineLcdSpinBox.cpp +++ b/src/gui/widgets/MixerLineLcdSpinBox.cpp @@ -29,6 +29,10 @@ #include "GuiApplication.h" #include "TrackView.h" +namespace lmms::gui +{ + + void MixerLineLcdSpinBox::setTrackView(TrackView * tv) { m_tv = tv; @@ -64,3 +68,6 @@ void MixerLineLcdSpinBox::contextMenuEvent(QContextMenuEvent* event) addDefaultActions(contextMenu); contextMenu->exec(QCursor::pos()); } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/NStateButton.cpp b/src/gui/widgets/NStateButton.cpp index 41832138b..4fbcc0d65 100644 --- a/src/gui/widgets/NStateButton.cpp +++ b/src/gui/widgets/NStateButton.cpp @@ -28,6 +28,9 @@ #include "NStateButton.h" +namespace lmms::gui +{ + NStateButton::NStateButton( QWidget * _parent ) : ToolButton( _parent ), @@ -92,3 +95,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 30296b805..cd028f637 100644 --- a/src/gui/widgets/Oscilloscope.cpp +++ b/src/gui/widgets/Oscilloscope.cpp @@ -36,6 +36,9 @@ #include "embed.h" #include "BufferManager.h" +namespace lmms::gui +{ + Oscilloscope::Oscilloscope( QWidget * _p ) : QWidget( _p ), @@ -91,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 { @@ -100,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(); @@ -204,4 +207,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 9bedfe1b5..938322b51 100644 --- a/src/gui/widgets/PixmapButton.cpp +++ b/src/gui/widgets/PixmapButton.cpp @@ -30,6 +30,8 @@ #include "PixmapButton.h" #include "embed.h" +namespace lmms::gui +{ PixmapButton::PixmapButton( QWidget * _parent, const QString & _name ) : @@ -142,6 +144,4 @@ QSize PixmapButton::sizeHint() const } - - - +} // namespace lmms::gui diff --git a/src/gui/widgets/TabBar.cpp b/src/gui/widgets/TabBar.cpp index 30822c85f..007f78194 100644 --- a/src/gui/widgets/TabBar.cpp +++ b/src/gui/widgets/TabBar.cpp @@ -28,6 +28,9 @@ #include "gui_templates.h" +namespace lmms::gui +{ + TabBar::TabBar( QWidget * _parent, QBoxLayout::Direction _dir ) : QWidget( _parent ), @@ -229,9 +232,4 @@ bool TabBar::allHidden() } - - - - - - +} // namespace lmms::gui diff --git a/src/gui/widgets/TabWidget.cpp b/src/gui/widgets/TabWidget.cpp index 07889c331..8899625fc 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 bb4faea26..47da424d4 100644 --- a/src/gui/widgets/TempoSyncKnob.cpp +++ b/src/gui/widgets/TempoSyncKnob.cpp @@ -37,6 +37,10 @@ #include "SubWindow.h" +namespace lmms::gui +{ + + TempoSyncKnob::TempoSyncKnob( knobTypes _knob_num, QWidget * _parent, const QString & _name ) : @@ -71,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() ) ); @@ -308,4 +312,4 @@ void TempoSyncKnob::showCustom() - +} // namespace lmms::gui diff --git a/src/gui/widgets/TextFloat.cpp b/src/gui/widgets/TextFloat.cpp index 5a93b55c6..a43c91c80 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 bde9e7dfe..c2cd11b1b 100644 --- a/src/gui/widgets/TimeDisplayWidget.cpp +++ b/src/gui/widgets/TimeDisplayWidget.cpp @@ -31,6 +31,8 @@ #include "Song.h" +namespace lmms::gui +{ TimeDisplayWidget::TimeDisplayWidget() : QWidget(), @@ -127,3 +129,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 6dea411d8..4feb038f0 100644 --- a/src/gui/widgets/ToolButton.cpp +++ b/src/gui/widgets/ToolButton.cpp @@ -25,6 +25,9 @@ #include "ToolButton.h" +namespace lmms::gui +{ + ToolButton::ToolButton( const QPixmap & _pixmap, const QString & _tooltip, QObject * _receiver, const char * _slot, @@ -40,3 +43,6 @@ ToolButton::ToolButton( const QPixmap & _pixmap, const QString & _tooltip, setToolTip(_tooltip); setIcon( _pixmap ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/tracks/AutomationTrack.cpp b/src/tracks/AutomationTrack.cpp index 65d34b884..d7e7f33c1 100644 --- a/src/tracks/AutomationTrack.cpp +++ b/src/tracks/AutomationTrack.cpp @@ -29,6 +29,9 @@ #include "AutomationTrackView.h" #include "AutomationClip.h" +namespace lmms +{ + AutomationTrack::AutomationTrack( TrackContainer* tc, bool _hidden ) : Track( _hidden ? HiddenAutomationTrack : Track::AutomationTrack, tc ) @@ -45,9 +48,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 ); } @@ -79,3 +82,6 @@ void AutomationTrack::loadTrackSpecificSettings( const QDomElement & _this ) setMuted( false ); } } + + +} // namespace lmms diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 2aadfcab2..000318d7b 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -40,6 +40,9 @@ #include "Pitch.h" #include "Song.h" +namespace lmms +{ + InstrumentTrack::InstrumentTrack( TrackContainer* tc ) : Track( Track::InstrumentTrack, tc ), @@ -691,7 +694,7 @@ bool InstrumentTrack::play( const TimePos & _start, const fpp_t _frames, const float frames_per_tick = Engine::framesPerTick(); clipVector clips; - ::PatternTrack * pattern_track = nullptr; + class PatternTrack * pattern_track = nullptr; if( _clip_num >= 0 ) { Clip * clip = getClip( _clip_num ); @@ -796,9 +799,9 @@ Clip* InstrumentTrack::createClip(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 ); } @@ -1075,3 +1078,5 @@ void InstrumentTrack::autoAssignMidiDevice(bool assign) } } + +} // namespace lmms diff --git a/src/tracks/MidiClip.cpp b/src/tracks/MidiClip.cpp index 7a5fb657d..ef693ba5b 100644 --- a/src/tracks/MidiClip.cpp +++ b/src/tracks/MidiClip.cpp @@ -35,10 +35,13 @@ -QPixmap * MidiClipView::s_stepBtnOn0 = nullptr; -QPixmap * MidiClipView::s_stepBtnOn200 = nullptr; -QPixmap * MidiClipView::s_stepBtnOff = nullptr; -QPixmap * MidiClipView::s_stepBtnOffLight = nullptr; +namespace lmms +{ + +QPixmap * gui::MidiClipView::s_stepBtnOn0 = nullptr; +QPixmap * gui::MidiClipView::s_stepBtnOn200 = nullptr; +QPixmap * gui::MidiClipView::s_stepBtnOff = nullptr; +QPixmap * gui::MidiClipView::s_stepBtnOffLight = nullptr; @@ -197,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(); @@ -551,9 +554,9 @@ void MidiClip::removeSteps() -ClipView * MidiClip::createView( TrackView * _tv ) +gui::ClipView * MidiClip::createView( gui::TrackView * _tv ) { - return new MidiClipView( this, _tv ); + return new gui::MidiClipView( this, _tv ); } @@ -566,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(); } } @@ -610,3 +613,6 @@ void MidiClip::changeTimeSignature() last_pos.getBar() * TimePos::stepsPerBar() ); updateLength(); } + + +} // namespace lmms diff --git a/src/tracks/PatternTrack.cpp b/src/tracks/PatternTrack.cpp index 243c9d3af..df7766c57 100644 --- a/src/tracks/PatternTrack.cpp +++ b/src/tracks/PatternTrack.cpp @@ -33,6 +33,9 @@ #include "PlayHandle.h" +namespace lmms +{ + PatternTrack::infoMap PatternTrack::s_infoMap; @@ -126,9 +129,9 @@ bool PatternTrack::play( const TimePos & _start, const fpp_t _frames, -TrackView* PatternTrack::createView(TrackContainerView* tcv) +gui::TrackView* PatternTrack::createView(gui::TrackContainerView* tcv) { - return new PatternTrackView(this, tcv); + return new gui::PatternTrackView(this, tcv); } @@ -240,3 +243,6 @@ void PatternTrack::swapPatternTracks(Track* track1, Track* track2) Engine::patternStore()->setCurrentPattern(s_infoMap[t1]); } } + + +} // namespace lmms \ No newline at end of file diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index b1fd4c406..caed04739 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -40,6 +40,9 @@ #include "volume.h" +namespace lmms +{ + SampleTrack::SampleTrack(TrackContainer* tc) : Track(Track::SampleTrack, tc), @@ -73,8 +76,9 @@ bool SampleTrack::play( const TimePos & _start, const fpp_t _frames, m_audioPort.effects()->startRunning(); bool played_a_note = false; // will be return variable + clipVector clips; - ::PatternTrack * pattern_track = nullptr; + class PatternTrack * pattern_track = nullptr; if( _clip_num >= 0 ) { if (_start > getClip(_clip_num)->length()) @@ -166,9 +170,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 ); } @@ -249,3 +253,6 @@ void SampleTrack::updateMixerChannel() { m_audioPort.setNextMixerChannel( m_mixerChannelModel.value() ); } + + +} // namespace lmms diff --git a/tests/check-strings/check-strings b/tests/check-strings/check-strings index d5b0260db..5504cc588 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 == ','): diff --git a/tests/main.cpp b/tests/main.cpp index b2c21b79a..6d375e6c6 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 d84d89db4..78b9069b5 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 e52088f6f..2d066dca5 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 3f1712e1b..3b5d023d0 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 5adafbb0f..2bf875992 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 5904b249c02640d4a62bdf5e9c86dcf4f642f495 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 19 Jun 2022 23:03:55 +0200 Subject: [PATCH 02/55] clang-tidy: Apply modernize-use-override everywhere (#6439) ... to mark overriding functions `override` instead of `virtual`. --- include/AudioAlsa.h | 2 +- include/AudioAlsaSetupWidget.h | 2 +- include/AudioDeviceSetupWidget.h | 2 +- include/AudioDummy.h | 4 +- include/AudioEngine.h | 2 +- include/AudioEngineWorkerThread.h | 2 +- include/AudioFileDevice.h | 2 +- include/AudioFileFlac.h | 4 +- include/AudioFileMP3.h | 4 +- include/AudioFileOgg.h | 4 +- include/AudioFileWave.h | 4 +- include/AudioJack.h | 18 +++---- include/AudioOss.h | 4 +- include/AudioPortAudio.h | 14 ++--- include/AudioPulseAudio.h | 4 +- include/AudioSampleRecorder.h | 4 +- include/AudioSdl.h | 2 +- include/AudioSndio.h | 4 +- include/AutomatableButton.h | 4 +- include/AutomatableModel.h | 2 +- include/AutomatableModelView.h | 2 +- include/AutomatableSlider.h | 2 +- include/AutomationClip.h | 2 +- include/AutomationClipView.h | 2 +- include/AutomationEditor.h | 4 +- include/AutomationTrack.h | 6 +-- include/AutomationTrackView.h | 2 +- include/CPULoadWidget.h | 2 +- include/CaptionMenu.h | 2 +- include/Clip.h | 2 +- include/ClipView.h | 2 +- include/ComboBox.h | 2 +- include/ComboBoxModel.h | 2 +- include/ConfigManager.h | 2 +- include/Controller.h | 2 +- include/ControllerConnection.h | 2 +- include/ControllerConnectionDialog.h | 2 +- include/ControllerDialog.h | 2 +- include/ControllerRackView.h | 2 +- include/ControllerView.h | 2 +- include/CustomTextKnob.h | 2 +- include/DetuningHelper.h | 2 +- include/DummyEffect.h | 4 +- include/DummyInstrument.h | 2 +- include/DummyPlugin.h | 2 +- include/Editor.h | 2 +- include/Effect.h | 2 +- include/EffectChain.h | 2 +- include/EffectControlDialog.h | 2 +- include/EffectControls.h | 2 +- include/EffectRackView.h | 2 +- include/EffectSelectDialog.h | 2 +- include/EffectView.h | 2 +- include/EnvelopeAndLfoParameters.h | 2 +- include/EnvelopeAndLfoView.h | 2 +- include/ExportFilter.h | 2 +- include/FadeButton.h | 2 +- include/Fader.h | 2 +- include/FileBrowser.h | 4 +- include/Graph.h | 4 +- include/GroupBox.h | 2 +- include/GuiApplication.h | 2 +- include/ImportFilter.h | 2 +- include/InlineAutomation.h | 2 +- include/Instrument.h | 2 +- include/InstrumentFunctionViews.h | 4 +- include/InstrumentFunctions.h | 4 +- include/InstrumentMidiIOView.h | 2 +- include/InstrumentPlayHandle.h | 2 +- include/InstrumentSoundShaping.h | 2 +- include/InstrumentSoundShapingView.h | 2 +- include/InstrumentTrack.h | 6 +-- include/InstrumentTrackView.h | 2 +- include/InstrumentTrackWindow.h | 2 +- include/JournallingObject.h | 4 +- include/Ladspa2LMMS.h | 2 +- include/LadspaControl.h | 2 +- include/LadspaControlView.h | 2 +- include/LcdSpinBox.h | 2 +- include/LcdWidget.h | 2 +- include/LedCheckBox.h | 2 +- include/LfoController.h | 4 +- include/LinkedModelGroupViews.h | 2 +- include/LmmsPalette.h | 2 +- include/LmmsStyle.h | 8 +-- include/LocklessAllocator.h | 2 +- include/Lv2ViewBase.h | 2 +- include/MainWindow.h | 2 +- include/MeterDialog.h | 2 +- include/MeterModel.h | 2 +- include/MidiAlsaRaw.h | 2 +- include/MidiAlsaSeq.h | 12 ++--- include/MidiClient.h | 2 +- include/MidiClip.h | 2 +- include/MidiClipView.h | 2 +- include/MidiController.h | 6 +-- include/MidiDummy.h | 2 +- include/MidiJack.h | 6 +-- include/MidiOss.h | 2 +- include/MidiPort.h | 2 +- include/MidiPortMenu.h | 2 +- include/MidiSndio.h | 2 +- include/Mixer.h | 4 +- include/MixerLine.h | 2 +- include/MixerLineLcdSpinBox.h | 2 +- include/MixerView.h | 2 +- include/Model.h | 2 +- include/NStateButton.h | 2 +- include/Note.h | 2 +- include/NotePlayHandle.h | 2 +- include/Oscilloscope.h | 2 +- include/PatternClip.h | 2 +- include/PatternClipView.h | 2 +- include/PatternStore.h | 2 +- include/PatternTrack.h | 6 +-- include/PatternTrackView.h | 2 +- include/PeakController.h | 4 +- include/PianoRoll.h | 2 +- include/PianoView.h | 2 +- include/PixmapButton.h | 2 +- include/Plugin.h | 2 +- include/PluginBrowser.h | 2 +- include/PresetPreviewPlayHandle.h | 2 +- include/ProjectNotes.h | 2 +- include/ProjectRenderer.h | 2 +- include/RemotePlugin.h | 4 +- include/RemotePluginClient.h | 4 +- include/RenameDialog.h | 2 +- include/RenderManager.h | 2 +- include/RingBuffer.h | 2 +- include/RowTableView.h | 2 +- include/Rubberband.h | 4 +- include/SampleBuffer.h | 2 +- include/SampleClip.h | 2 +- include/SampleClipView.h | 2 +- include/SamplePlayHandle.h | 2 +- include/SampleRecordHandle.h | 2 +- include/SampleTrack.h | 6 +-- include/SampleTrackView.h | 2 +- include/SampleTrackWindow.h | 2 +- include/SetupDialog.h | 2 +- include/SideBar.h | 2 +- include/SideBarWidget.h | 2 +- include/Song.h | 2 +- include/SongEditor.h | 2 +- include/StringPairDrag.h | 2 +- include/TabBar.h | 2 +- include/TabButton.h | 2 +- include/TabWidget.h | 2 +- include/TemplatesMenu.h | 2 +- include/TempoSyncKnob.h | 2 +- include/TextFloat.h | 2 +- include/TimeDisplayWidget.h | 2 +- include/TimeLineWidget.h | 2 +- include/ToolButton.h | 2 +- include/ToolPlugin.h | 2 +- include/Track.h | 2 +- include/TrackContainer.h | 2 +- include/TrackContainerView.h | 4 +- include/TrackContentWidget.h | 2 +- include/TrackLabelButton.h | 2 +- include/TrackOperationsWidget.h | 2 +- include/TrackView.h | 2 +- include/VstSyncController.h | 2 +- include/embed.h | 4 +- plugins/Amplifier/Amplifier.h | 6 +-- plugins/Amplifier/AmplifierControlDialog.h | 2 +- plugins/Amplifier/AmplifierControls.h | 12 ++--- plugins/BassBooster/BassBooster.h | 6 +-- .../BassBooster/BassBoosterControlDialog.h | 2 +- plugins/BassBooster/BassBoosterControls.h | 12 ++--- plugins/BitInvader/BitInvader.h | 24 ++++----- plugins/Bitcrush/Bitcrush.h | 6 +-- plugins/Bitcrush/BitcrushControlDialog.h | 2 +- plugins/Bitcrush/BitcrushControls.h | 12 ++--- plugins/CarlaBase/Carla.h | 36 ++++++------- plugins/CrossoverEQ/CrossoverEQ.h | 6 +-- .../CrossoverEQ/CrossoverEQControlDialog.h | 2 +- plugins/CrossoverEQ/CrossoverEQControls.h | 12 ++--- plugins/Delay/DelayControls.h | 12 ++--- plugins/Delay/DelayControlsDialog.h | 12 ++--- plugins/Delay/DelayEffect.h | 6 +-- plugins/DualFilter/DualFilter.h | 6 +-- plugins/DualFilter/DualFilterControlDialog.h | 2 +- plugins/DualFilter/DualFilterControls.h | 12 ++--- plugins/DynamicsProcessor/DynamicsProcessor.h | 8 +-- .../DynamicsProcessorControlDialog.h | 2 +- .../DynamicsProcessorControls.h | 12 ++--- plugins/Eq/EqControls.h | 12 ++--- plugins/Eq/EqControlsDialog.h | 4 +- plugins/Eq/EqCurve.h | 20 +++---- plugins/Eq/EqEffect.h | 6 +-- plugins/Eq/EqFader.h | 2 +- plugins/Eq/EqFilter.h | 12 ++--- plugins/Eq/EqParameterWidget.h | 2 +- plugins/Eq/EqSpectrumView.h | 4 +- plugins/Flanger/FlangerControls.h | 12 ++--- plugins/Flanger/FlangerControlsDialog.h | 2 +- plugins/Flanger/FlangerEffect.h | 6 +-- plugins/FreeBoy/FreeBoy.h | 22 ++++---- plugins/GigPlayer/GigPlayer.h | 30 +++++------ plugins/GigPlayer/PatchesDialog.cpp | 2 +- plugins/GigPlayer/PatchesDialog.h | 6 +-- plugins/HydrogenImport/HydrogenImport.h | 6 +-- plugins/Kicker/Kicker.h | 24 ++++----- plugins/LadspaBrowser/LadspaBrowser.h | 12 ++--- plugins/LadspaBrowser/LadspaDescription.h | 2 +- plugins/LadspaBrowser/LadspaPortDialog.h | 2 +- plugins/LadspaEffect/LadspaControlDialog.h | 2 +- plugins/LadspaEffect/LadspaControls.h | 12 ++--- plugins/LadspaEffect/LadspaEffect.h | 8 +-- .../LadspaEffect/LadspaSubPluginFeatures.h | 2 +- plugins/Lb302/Lb302.h | 40 +++++++------- plugins/MidiExport/MidiExport.h | 8 +-- plugins/MidiImport/MidiImport.h | 6 +-- plugins/MidiImport/portsmf/allegro.h | 46 ++++++++-------- plugins/MidiImport/portsmf/allegrosmfrd.cpp | 54 +++++++++---------- plugins/Monstro/Monstro.h | 24 ++++----- plugins/MultitapEcho/MultitapEcho.h | 6 +-- .../MultitapEcho/MultitapEchoControlDialog.h | 2 +- plugins/MultitapEcho/MultitapEchoControls.h | 12 ++--- plugins/Nes/Nes.h | 24 ++++----- plugins/OpulenZ/OpulenZ.h | 22 ++++---- plugins/Organic/Organic.h | 22 ++++---- plugins/Patman/Patman.h | 30 +++++------ .../PeakControllerEffect.h | 4 +- .../PeakControllerEffectControlDialog.h | 2 +- .../PeakControllerEffectControls.h | 2 +- plugins/ReverbSC/ReverbSC.h | 6 +-- plugins/ReverbSC/ReverbSCControlDialog.h | 2 +- plugins/ReverbSC/ReverbSCControls.h | 12 ++--- plugins/Sf2Player/PatchesDialog.cpp | 2 +- plugins/Sf2Player/PatchesDialog.h | 6 +-- plugins/Sf2Player/Sf2Player.h | 30 +++++------ plugins/Sfxr/Sfxr.h | 24 ++++----- plugins/Sid/SidInstrument.h | 24 ++++----- plugins/SpectrumAnalyzer/Analyzer.h | 2 +- plugins/SpectrumAnalyzer/SaControls.h | 2 +- plugins/SpectrumAnalyzer/SaControlsDialog.h | 2 +- plugins/SpectrumAnalyzer/SaSpectrumView.h | 2 +- plugins/SpectrumAnalyzer/SaWaterfallView.h | 2 +- plugins/StereoEnhancer/StereoEnhancer.h | 8 +-- .../StereoEnhancerControlDialog.h | 2 +- .../StereoEnhancer/StereoEnhancerControls.h | 12 ++--- plugins/StereoMatrix/StereoMatrix.h | 8 +-- .../StereoMatrix/StereoMatrixControlDialog.h | 2 +- plugins/StereoMatrix/StereoMatrixControls.h | 12 ++--- plugins/Stk/Mallets/Mallets.h | 18 +++---- plugins/TripleOscillator/TripleOscillator.h | 24 ++++----- plugins/Vectorscope/VecControls.h | 2 +- plugins/Vectorscope/VecControlsDialog.h | 2 +- plugins/Vectorscope/VectorView.h | 2 +- plugins/Vectorscope/Vectorscope.h | 2 +- plugins/Vestige/Vestige.cpp | 4 +- plugins/Vibed/NineButtonSelector.h | 6 +-- plugins/Vibed/Vibed.h | 6 +-- plugins/VstBase/VstPlugin.h | 4 +- plugins/VstEffect/VstEffect.h | 8 +-- plugins/VstEffect/VstEffectControlDialog.h | 2 +- plugins/VstEffect/VstEffectControls.h | 14 ++--- plugins/VstEffect/VstSubPluginFeatures.h | 8 +-- plugins/Watsyn/Watsyn.h | 24 ++++----- plugins/WaveShaper/WaveShaper.h | 8 +-- plugins/WaveShaper/WaveShaperControlDialog.h | 2 +- plugins/WaveShaper/WaveShaperControls.h | 12 ++--- plugins/Xpressive/ExprSynth.cpp | 20 +++---- plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp | 12 ++--- src/core/PresetPreviewPlayHandle.cpp | 2 +- src/gui/MixerView.cpp | 2 +- src/gui/RowTableView.cpp | 4 +- src/gui/SideBar.cpp | 2 +- src/gui/modals/ControllerConnectionDialog.cpp | 2 +- tests/QTestSuite.h | 2 +- 273 files changed, 765 insertions(+), 765 deletions(-) diff --git a/include/AudioAlsa.h b/include/AudioAlsa.h index e1024b030..6bbd4aecd 100644 --- a/include/AudioAlsa.h +++ b/include/AudioAlsa.h @@ -69,7 +69,7 @@ public: public: AudioAlsa( bool & _success_ful, AudioEngine* audioEngine ); - virtual ~AudioAlsa(); + ~AudioAlsa() override; inline static QString name() { diff --git a/include/AudioAlsaSetupWidget.h b/include/AudioAlsaSetupWidget.h index 9e168934e..f68d71e8a 100644 --- a/include/AudioAlsaSetupWidget.h +++ b/include/AudioAlsaSetupWidget.h @@ -47,7 +47,7 @@ class AudioAlsaSetupWidget : public AudioDeviceSetupWidget public: AudioAlsaSetupWidget( QWidget * _parent ); - virtual ~AudioAlsaSetupWidget(); + ~AudioAlsaSetupWidget() override; void saveSettings() override; diff --git a/include/AudioDeviceSetupWidget.h b/include/AudioDeviceSetupWidget.h index 6bf656e0a..392cbd3a4 100644 --- a/include/AudioDeviceSetupWidget.h +++ b/include/AudioDeviceSetupWidget.h @@ -36,7 +36,7 @@ class AudioDeviceSetupWidget : public TabWidget public: AudioDeviceSetupWidget( const QString & _caption, QWidget * _parent ); - virtual ~AudioDeviceSetupWidget(); + ~AudioDeviceSetupWidget() override; virtual void saveSettings() = 0; diff --git a/include/AudioDummy.h b/include/AudioDummy.h index f2c198bbc..3677bf451 100644 --- a/include/AudioDummy.h +++ b/include/AudioDummy.h @@ -43,7 +43,7 @@ public: _success_ful = true; } - virtual ~AudioDummy() + ~AudioDummy() override { stopProcessing(); } @@ -62,7 +62,7 @@ public: { } - virtual ~setupWidget() + ~setupWidget() override { } diff --git a/include/AudioEngine.h b/include/AudioEngine.h index 08e03a113..44854c826 100644 --- a/include/AudioEngine.h +++ b/include/AudioEngine.h @@ -387,7 +387,7 @@ private: AudioEngine( bool renderOnly ); - virtual ~AudioEngine(); + ~AudioEngine() override; void startProcessing(bool needsFifo = true); void stopProcessing(); diff --git a/include/AudioEngineWorkerThread.h b/include/AudioEngineWorkerThread.h index 811f75753..87e2791b1 100644 --- a/include/AudioEngineWorkerThread.h +++ b/include/AudioEngineWorkerThread.h @@ -78,7 +78,7 @@ public: AudioEngineWorkerThread( AudioEngine* audioEngine ); - virtual ~AudioEngineWorkerThread(); + ~AudioEngineWorkerThread() override; virtual void quit(); diff --git a/include/AudioFileDevice.h b/include/AudioFileDevice.h index 937cd9d00..a9fbcbc88 100644 --- a/include/AudioFileDevice.h +++ b/include/AudioFileDevice.h @@ -40,7 +40,7 @@ public: AudioFileDevice(OutputSettings const & outputSettings, const ch_cnt_t _channels, const QString & _file, AudioEngine* audioEngine ); - virtual ~AudioFileDevice(); + ~AudioFileDevice() override; QString outputFile() const { diff --git a/include/AudioFileFlac.h b/include/AudioFileFlac.h index 675ab21d9..542a2e717 100644 --- a/include/AudioFileFlac.h +++ b/include/AudioFileFlac.h @@ -43,7 +43,7 @@ public: AudioEngine* audioEngine ); - virtual ~AudioFileFlac(); + ~AudioFileFlac() override; static AudioFileDevice* getInst(QString const& outputFilename, OutputSettings const& outputSettings, @@ -65,7 +65,7 @@ private: SF_INFO m_sfinfo; SNDFILE* m_sf; - virtual void writeBuffer(surroundSampleFrame const* _ab, + void writeBuffer(surroundSampleFrame const* _ab, fpp_t const frames, float master_gain) override; diff --git a/include/AudioFileMP3.h b/include/AudioFileMP3.h index 16c3617a8..290c9ccbf 100644 --- a/include/AudioFileMP3.h +++ b/include/AudioFileMP3.h @@ -45,7 +45,7 @@ public: bool & successful, const QString & _file, AudioEngine* audioEngine ); - virtual ~AudioFileMP3(); + ~AudioFileMP3() override; static AudioFileDevice * getInst( const QString & outputFilename, OutputSettings const & outputSettings, @@ -58,7 +58,7 @@ public: } protected: - virtual void writeBuffer( const surroundSampleFrame * /* _buf*/, + void writeBuffer( const surroundSampleFrame * /* _buf*/, const fpp_t /*_frames*/, const float /*_master_gain*/ ) override; diff --git a/include/AudioFileOgg.h b/include/AudioFileOgg.h index 7e6921015..18617fa5f 100644 --- a/include/AudioFileOgg.h +++ b/include/AudioFileOgg.h @@ -45,7 +45,7 @@ public: bool & _success_ful, const QString & _file, AudioEngine* audioEngine ); - virtual ~AudioFileOgg(); + ~AudioFileOgg() override; static AudioFileDevice * getInst( const QString & outputFilename, OutputSettings const & outputSettings, @@ -58,7 +58,7 @@ public: private: - virtual void writeBuffer( const surroundSampleFrame * _ab, + void writeBuffer( const surroundSampleFrame * _ab, const fpp_t _frames, const float _master_gain ) override; diff --git a/include/AudioFileWave.h b/include/AudioFileWave.h index e9425dd86..8dd3566f4 100644 --- a/include/AudioFileWave.h +++ b/include/AudioFileWave.h @@ -42,7 +42,7 @@ public: bool & successful, const QString & file, AudioEngine* audioEngine ); - virtual ~AudioFileWave(); + ~AudioFileWave() override; static AudioFileDevice * getInst( const QString & outputFilename, OutputSettings const & outputSettings, @@ -56,7 +56,7 @@ public: private: - virtual void writeBuffer( const surroundSampleFrame * _ab, + void writeBuffer( const surroundSampleFrame * _ab, const fpp_t _frames, float _master_gain ) override; diff --git a/include/AudioJack.h b/include/AudioJack.h index 648bb157d..7b6597e86 100644 --- a/include/AudioJack.h +++ b/include/AudioJack.h @@ -58,7 +58,7 @@ class AudioJack : public QObject, public AudioDevice Q_OBJECT public: AudioJack( bool & _success_ful, AudioEngine* audioEngine ); - virtual ~AudioJack(); + ~AudioJack() override; // this is to allow the jack midi connection to use the same jack client connection // the jack callback is handled here, we call the midi client so that it can read @@ -78,9 +78,9 @@ class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); - virtual ~setupWidget(); + ~setupWidget() override; - virtual void saveSettings(); + void saveSettings() override; private: QLineEdit * m_clientName; @@ -96,13 +96,13 @@ private slots: private: bool initJackClient(); - virtual void startProcessing(); - virtual void stopProcessing(); - virtual void applyQualitySettings(); + void startProcessing() override; + void stopProcessing() override; + void applyQualitySettings() override; - virtual void registerPort( AudioPort * _port ); - virtual void unregisterPort( AudioPort * _port ); - virtual void renamePort( AudioPort * _port ); + void registerPort( AudioPort * _port ) override; + void unregisterPort( AudioPort * _port ) override; + void renamePort( AudioPort * _port ) override; int processCallback( jack_nframes_t _nframes, void * _udata ); diff --git a/include/AudioOss.h b/include/AudioOss.h index 4a552040b..71103586a 100644 --- a/include/AudioOss.h +++ b/include/AudioOss.h @@ -51,7 +51,7 @@ class AudioOss : public QThread, public AudioDevice Q_OBJECT public: AudioOss( bool & _success_ful, AudioEngine* audioEngine ); - virtual ~AudioOss(); + ~AudioOss() override; inline static QString name() { @@ -65,7 +65,7 @@ class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); - virtual ~setupWidget(); + ~setupWidget() override; void saveSettings() override; diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index 10dab74eb..2c3aa6bc8 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -77,7 +77,7 @@ class AudioPortAudio : public AudioDevice { public: AudioPortAudio( bool & _success_ful, AudioEngine* audioEngine ); - virtual ~AudioPortAudio(); + ~AudioPortAudio() override; inline static QString name() { @@ -94,10 +94,10 @@ public: { public: setupWidget( QWidget * _parent ); - virtual ~setupWidget(); + ~setupWidget() override; - virtual void saveSettings(); - virtual void show(); + void saveSettings() override; + void show() override; private: gui::ComboBox * m_backend; @@ -107,9 +107,9 @@ public: } ; private: - virtual void startProcessing(); - virtual void stopProcessing(); - virtual void applyQualitySettings(); + void startProcessing() override; + void stopProcessing() override; + void applyQualitySettings() override; #ifdef PORTAUDIO_V19 static int _process_callback( const void *_inputBuffer, void * _outputBuffer, diff --git a/include/AudioPulseAudio.h b/include/AudioPulseAudio.h index 70da08087..a4721dfbd 100644 --- a/include/AudioPulseAudio.h +++ b/include/AudioPulseAudio.h @@ -52,7 +52,7 @@ class AudioPulseAudio : public QThread, public AudioDevice Q_OBJECT public: AudioPulseAudio( bool & _success_ful, AudioEngine* audioEngine ); - virtual ~AudioPulseAudio(); + ~AudioPulseAudio() override; inline static QString name() { @@ -66,7 +66,7 @@ public: { public: setupWidget( QWidget * _parent ); - virtual ~setupWidget(); + ~setupWidget() override; void saveSettings() override; diff --git a/include/AudioSampleRecorder.h b/include/AudioSampleRecorder.h index 294ffa17d..e2f84dad0 100644 --- a/include/AudioSampleRecorder.h +++ b/include/AudioSampleRecorder.h @@ -41,14 +41,14 @@ class AudioSampleRecorder : public AudioDevice { public: AudioSampleRecorder( const ch_cnt_t _channels, bool & _success_ful, AudioEngine* audioEngine ); - virtual ~AudioSampleRecorder(); + ~AudioSampleRecorder() override; f_cnt_t framesRecorded() const; void createSampleBuffer( SampleBuffer** sampleBuffer ); private: - virtual void writeBuffer( const surroundSampleFrame * _ab, + void writeBuffer( const surroundSampleFrame * _ab, const fpp_t _frames, const float _master_gain ) override; diff --git a/include/AudioSdl.h b/include/AudioSdl.h index b49e2ebe9..c3b9d27d3 100644 --- a/include/AudioSdl.h +++ b/include/AudioSdl.h @@ -48,7 +48,7 @@ class AudioSdl : public AudioDevice { public: AudioSdl( bool & _success_ful, AudioEngine* audioEngine ); - virtual ~AudioSdl(); + ~AudioSdl() override; inline static QString name() { diff --git a/include/AudioSndio.h b/include/AudioSndio.h index 5fb7c78fc..ebc443a68 100644 --- a/include/AudioSndio.h +++ b/include/AudioSndio.h @@ -52,7 +52,7 @@ class AudioSndio : public QThread, public AudioDevice Q_OBJECT public: AudioSndio( bool & _success_ful, AudioEngine * _audioEngine ); - virtual ~AudioSndio(); + ~AudioSndio() override; inline static QString name( void ) { @@ -63,7 +63,7 @@ public: { public: setupWidget( QWidget * _parent ); - virtual ~setupWidget(); + ~setupWidget() override; void saveSettings( void ) override; diff --git a/include/AutomatableButton.h b/include/AutomatableButton.h index fefaf70e3..d8c58523c 100644 --- a/include/AutomatableButton.h +++ b/include/AutomatableButton.h @@ -42,7 +42,7 @@ class LMMS_EXPORT AutomatableButton : public QPushButton, public BoolModelView public: AutomatableButton( QWidget * _parent, const QString & _name = QString() ); - virtual ~AutomatableButton(); + ~AutomatableButton() override; inline void setCheckable( bool _on ) { @@ -87,7 +87,7 @@ class LMMS_EXPORT automatableButtonGroup : public QWidget, public IntModelView public: automatableButtonGroup( QWidget * _parent, const QString & _name = QString() ); - virtual ~automatableButtonGroup(); + ~automatableButtonGroup() override; void addButton( AutomatableButton * _btn ); void removeButton( AutomatableButton * _btn ); diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 672abaf81..5e8a17763 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -89,7 +89,7 @@ public: }; - virtual ~AutomatableModel(); + ~AutomatableModel() override; // Implement those by using the MODEL_IS_VISITABLE macro virtual void accept(ModelVisitor& v) = 0; diff --git a/include/AutomatableModelView.h b/include/AutomatableModelView.h index fa8926c0c..1e8ef7398 100644 --- a/include/AutomatableModelView.h +++ b/include/AutomatableModelView.h @@ -39,7 +39,7 @@ class LMMS_EXPORT AutomatableModelView : public ModelView { public: AutomatableModelView( Model* model, QWidget* _this ); - virtual ~AutomatableModelView() = default; + ~AutomatableModelView() override = default; // some basic functions for convenience AutomatableModel* modelUntyped() diff --git a/include/AutomatableSlider.h b/include/AutomatableSlider.h index d6a95f5d8..cadaaf8db 100644 --- a/include/AutomatableSlider.h +++ b/include/AutomatableSlider.h @@ -39,7 +39,7 @@ class AutomatableSlider : public QSlider, public IntModelView Q_OBJECT public: AutomatableSlider( QWidget * _parent, const QString & _name = QString() ); - virtual ~AutomatableSlider(); + ~AutomatableSlider() override; bool showStatus() { diff --git a/include/AutomationClip.h b/include/AutomationClip.h index 376c1e9e7..63c13a120 100644 --- a/include/AutomationClip.h +++ b/include/AutomationClip.h @@ -65,7 +65,7 @@ public: AutomationClip( AutomationTrack * _auto_track ); AutomationClip( const AutomationClip & _clip_to_copy ); - virtual ~AutomationClip() = default; + ~AutomationClip() override = default; bool addObject( AutomatableModel * _obj, bool _search_dup = true ); diff --git a/include/AutomationClipView.h b/include/AutomationClipView.h index 0b80ad2eb..1a2e80248 100644 --- a/include/AutomationClipView.h +++ b/include/AutomationClipView.h @@ -45,7 +45,7 @@ class AutomationClipView : public ClipView public: AutomationClipView( AutomationClip * _clip, TrackView * _parent ); - virtual ~AutomationClipView(); + ~AutomationClipView() override; public slots: /// Opens this view's clip in the global automation editor diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index d9d1b0a10..c710c5007 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -167,7 +167,7 @@ private: AutomationEditor(); AutomationEditor( const AutomationEditor & ); - virtual ~AutomationEditor(); + ~AutomationEditor() override; static QPixmap * s_toolDraw; static QPixmap * s_toolErase; @@ -255,7 +255,7 @@ class AutomationEditorWindow : public Editor static const int INITIAL_HEIGHT = 480; public: AutomationEditorWindow(); - ~AutomationEditorWindow(); + ~AutomationEditorWindow() override; void setCurrentClip(AutomationClip* clip); const AutomationClip* currentClip(); diff --git a/include/AutomationTrack.h b/include/AutomationTrack.h index 1bbc77b1c..1779bf102 100644 --- a/include/AutomationTrack.h +++ b/include/AutomationTrack.h @@ -37,9 +37,9 @@ class AutomationTrack : public Track Q_OBJECT public: AutomationTrack( TrackContainer* tc, bool _hidden = false ); - virtual ~AutomationTrack() = default; + ~AutomationTrack() override = default; - virtual bool play( const TimePos & _start, const fpp_t _frames, + bool play( const TimePos & _start, const fpp_t _frames, const f_cnt_t _frame_base, int _clip_num = -1 ) override; QString nodeName() const override @@ -50,7 +50,7 @@ public: gui::TrackView * createView( gui::TrackContainerView* ) override; Clip* createClip(const TimePos & pos) override; - virtual void saveTrackSpecificSettings( QDomDocument & _doc, + void saveTrackSpecificSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadTrackSpecificSettings( const QDomElement & _this ) override; diff --git a/include/AutomationTrackView.h b/include/AutomationTrackView.h index b5bafe58e..18454bec2 100644 --- a/include/AutomationTrackView.h +++ b/include/AutomationTrackView.h @@ -41,7 +41,7 @@ class AutomationTrackView : public TrackView { public: AutomationTrackView( AutomationTrack* at, TrackContainerView* tcv ); - virtual ~AutomationTrackView() = default; + ~AutomationTrackView() override = default; void dragEnterEvent( QDragEnterEvent * _dee ) override; void dropEvent( QDropEvent * _de ) override; diff --git a/include/CPULoadWidget.h b/include/CPULoadWidget.h index 9cf275fb3..31aecb016 100644 --- a/include/CPULoadWidget.h +++ b/include/CPULoadWidget.h @@ -43,7 +43,7 @@ class CPULoadWidget : public QWidget Q_OBJECT public: CPULoadWidget( QWidget * _parent ); - virtual ~CPULoadWidget(); + ~CPULoadWidget() override; protected: diff --git a/include/CaptionMenu.h b/include/CaptionMenu.h index 2309cec6f..a3724e127 100644 --- a/include/CaptionMenu.h +++ b/include/CaptionMenu.h @@ -41,7 +41,7 @@ class LMMS_EXPORT CaptionMenu : public QMenu Q_OBJECT public: CaptionMenu( const QString & _title, QWidget * _parent = 0 ); - virtual ~CaptionMenu(); + ~CaptionMenu() override; } ; diff --git a/include/Clip.h b/include/Clip.h index 5c70aeaba..14595263e 100644 --- a/include/Clip.h +++ b/include/Clip.h @@ -53,7 +53,7 @@ class LMMS_EXPORT Clip : public Model, public JournallingObject mapPropertyFromModel(bool,isSolo,setSolo,m_soloModel); public: Clip( Track * track ); - virtual ~Clip(); + ~Clip() override; inline Track * getTrack() const { diff --git a/include/ClipView.h b/include/ClipView.h index 00a8b261e..8cfb9e7a4 100644 --- a/include/ClipView.h +++ b/include/ClipView.h @@ -71,7 +71,7 @@ public: const static int BORDER_WIDTH = 2; ClipView( Clip * clip, TrackView * tv ); - virtual ~ClipView(); + ~ClipView() override; bool fixedClips(); diff --git a/include/ComboBox.h b/include/ComboBox.h index 412279d15..9b51d87ab 100644 --- a/include/ComboBox.h +++ b/include/ComboBox.h @@ -40,7 +40,7 @@ class LMMS_EXPORT ComboBox : public QWidget, public IntModelView Q_OBJECT public: ComboBox( QWidget* parent = nullptr, const QString& name = QString() ); - virtual ~ComboBox(); + ~ComboBox() override; ComboBoxModel* model() { diff --git a/include/ComboBoxModel.h b/include/ComboBoxModel.h index faff03620..ef21eb12e 100644 --- a/include/ComboBoxModel.h +++ b/include/ComboBoxModel.h @@ -47,7 +47,7 @@ public: { } - virtual ~ComboBoxModel() + ~ComboBoxModel() override { clear(); } diff --git a/include/ConfigManager.h b/include/ConfigManager.h index 6aa7fc037..52e318508 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -274,7 +274,7 @@ private: ConfigManager(); ConfigManager(const ConfigManager & _c); - ~ConfigManager(); + ~ConfigManager() override; void upgrade_1_1_90(); void upgrade_1_1_91(); diff --git a/include/Controller.h b/include/Controller.h index c2e5205d2..f11294a39 100644 --- a/include/Controller.h +++ b/include/Controller.h @@ -70,7 +70,7 @@ public: Controller( ControllerTypes _type, Model * _parent, const QString & _display_name ); - virtual ~Controller(); + ~Controller() override; virtual float currentValue( int _offset ); // The per-controller get-value-in-buffers function diff --git a/include/ControllerConnection.h b/include/ControllerConnection.h index 50b98539c..54bfaa10d 100644 --- a/include/ControllerConnection.h +++ b/include/ControllerConnection.h @@ -58,7 +58,7 @@ public: ControllerConnection(Controller * _controller); ControllerConnection( int _controllerId ); - virtual ~ControllerConnection(); + ~ControllerConnection() override; inline Controller * getController() { diff --git a/include/ControllerConnectionDialog.h b/include/ControllerConnectionDialog.h index 62980987f..5565c8a67 100644 --- a/include/ControllerConnectionDialog.h +++ b/include/ControllerConnectionDialog.h @@ -61,7 +61,7 @@ class ControllerConnectionDialog : public QDialog public: ControllerConnectionDialog( QWidget * _parent, const AutomatableModel * _target_model ); - virtual ~ControllerConnectionDialog(); + ~ControllerConnectionDialog() override; Controller * chosenController() { diff --git a/include/ControllerDialog.h b/include/ControllerDialog.h index 0592cadf3..351afd66a 100644 --- a/include/ControllerDialog.h +++ b/include/ControllerDialog.h @@ -44,7 +44,7 @@ class ControllerDialog : public QWidget, public ModelView public: ControllerDialog( Controller * _controller, QWidget * _parent ); - virtual ~ControllerDialog(); + ~ControllerDialog() override; signals: diff --git a/include/ControllerRackView.h b/include/ControllerRackView.h index 6d60562f6..a522071c8 100644 --- a/include/ControllerRackView.h +++ b/include/ControllerRackView.h @@ -53,7 +53,7 @@ class ControllerRackView : public QWidget, public SerializingObject Q_OBJECT public: ControllerRackView(); - virtual ~ControllerRackView(); + ~ControllerRackView() override; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/include/ControllerView.h b/include/ControllerView.h index 2e18e1320..8b8db0674 100644 --- a/include/ControllerView.h +++ b/include/ControllerView.h @@ -48,7 +48,7 @@ class ControllerView : public QFrame, public ModelView Q_OBJECT public: ControllerView( Controller * _controller, QWidget * _parent ); - virtual ~ControllerView(); + ~ControllerView() override; inline Controller * getController() { diff --git a/include/CustomTextKnob.h b/include/CustomTextKnob.h index 403799ff0..cde718810 100644 --- a/include/CustomTextKnob.h +++ b/include/CustomTextKnob.h @@ -25,7 +25,7 @@ public: } private: - virtual QString displayValue() const; + QString displayValue() const override; protected: QString m_value_text; diff --git a/include/DetuningHelper.h b/include/DetuningHelper.h index 7444b8b22..c67ae41c6 100644 --- a/include/DetuningHelper.h +++ b/include/DetuningHelper.h @@ -42,7 +42,7 @@ public: { } - virtual ~DetuningHelper() + ~DetuningHelper() override { } diff --git a/include/DummyEffect.h b/include/DummyEffect.h index 8d0f769b6..637feaba1 100644 --- a/include/DummyEffect.h +++ b/include/DummyEffect.h @@ -60,7 +60,7 @@ public: { } - virtual ~DummyEffectControls() + ~DummyEffectControls() override { } @@ -102,7 +102,7 @@ public: setName(); } - virtual ~DummyEffect() + ~DummyEffect() override { } diff --git a/include/DummyInstrument.h b/include/DummyInstrument.h index 27246e6eb..7f85d83b5 100644 --- a/include/DummyInstrument.h +++ b/include/DummyInstrument.h @@ -47,7 +47,7 @@ public: { } - virtual ~DummyInstrument() + ~DummyInstrument() override { } diff --git a/include/DummyPlugin.h b/include/DummyPlugin.h index 313649526..fd98b831c 100644 --- a/include/DummyPlugin.h +++ b/include/DummyPlugin.h @@ -41,7 +41,7 @@ public: { } - virtual ~DummyPlugin() + ~DummyPlugin() override { } diff --git a/include/Editor.h b/include/Editor.h index 88cd84654..60760f2b4 100644 --- a/include/Editor.h +++ b/include/Editor.h @@ -81,7 +81,7 @@ protected: /// \param record If set true, the editor's toolbar will contain record /// buttons in addition to the play and stop buttons. Editor(bool record = false, bool record_step = false); - virtual ~Editor(); + ~Editor() override; DropToolBar* m_toolBar; diff --git a/include/Effect.h b/include/Effect.h index abd65f207..471f031c9 100644 --- a/include/Effect.h +++ b/include/Effect.h @@ -55,7 +55,7 @@ public: Effect( const Plugin::Descriptor * _desc, Model * _parent, const Descriptor::SubPluginFeatures::Key * _key ); - virtual ~Effect(); + ~Effect() override; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/include/EffectChain.h b/include/EffectChain.h index ca7648761..2a0cbc758 100644 --- a/include/EffectChain.h +++ b/include/EffectChain.h @@ -48,7 +48,7 @@ class LMMS_EXPORT EffectChain : public Model, public SerializingObject Q_OBJECT public: EffectChain( Model * _parent ); - virtual ~EffectChain(); + ~EffectChain() override; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/include/EffectControlDialog.h b/include/EffectControlDialog.h index ec0ef3f1d..59e422264 100644 --- a/include/EffectControlDialog.h +++ b/include/EffectControlDialog.h @@ -44,7 +44,7 @@ class LMMS_EXPORT EffectControlDialog : public QWidget, public ModelView Q_OBJECT public: EffectControlDialog( EffectControls * _controls ); - virtual ~EffectControlDialog(); + ~EffectControlDialog() override; virtual bool isResizable() const {return false;} diff --git a/include/EffectControls.h b/include/EffectControls.h index b8e7d0041..95ef0039c 100644 --- a/include/EffectControls.h +++ b/include/EffectControls.h @@ -51,7 +51,7 @@ public: { } - virtual ~EffectControls() + ~EffectControls() override { } diff --git a/include/EffectRackView.h b/include/EffectRackView.h index 014a07dfe..fb68fda68 100644 --- a/include/EffectRackView.h +++ b/include/EffectRackView.h @@ -47,7 +47,7 @@ class EffectRackView : public QWidget, public ModelView Q_OBJECT public: EffectRackView( EffectChain* model, QWidget* parent = nullptr ); - virtual ~EffectRackView(); + ~EffectRackView() override; static constexpr int DEFAULT_WIDTH = 245; diff --git a/include/EffectSelectDialog.h b/include/EffectSelectDialog.h index bf1b6ba04..b0acfb734 100644 --- a/include/EffectSelectDialog.h +++ b/include/EffectSelectDialog.h @@ -43,7 +43,7 @@ class EffectSelectDialog : public QDialog Q_OBJECT public: EffectSelectDialog( QWidget * _parent ); - virtual ~EffectSelectDialog(); + ~EffectSelectDialog() override; Effect * instantiateSelectedPlugin( EffectChain * _parent ); diff --git a/include/EffectView.h b/include/EffectView.h index 9f30575e9..90bb54896 100644 --- a/include/EffectView.h +++ b/include/EffectView.h @@ -49,7 +49,7 @@ class EffectView : public PluginView Q_OBJECT public: EffectView( Effect * _model, QWidget * _parent ); - virtual ~EffectView(); + ~EffectView() override; inline Effect * effect() { diff --git a/include/EnvelopeAndLfoParameters.h b/include/EnvelopeAndLfoParameters.h index 0a4a0d0f2..7b630b1b0 100644 --- a/include/EnvelopeAndLfoParameters.h +++ b/include/EnvelopeAndLfoParameters.h @@ -78,7 +78,7 @@ public: EnvelopeAndLfoParameters( float _value_for_zero_amount, Model * _parent ); - virtual ~EnvelopeAndLfoParameters(); + ~EnvelopeAndLfoParameters() override; static inline float expKnobVal( float _val ) { diff --git a/include/EnvelopeAndLfoView.h b/include/EnvelopeAndLfoView.h index 2067f9291..a82ccf606 100644 --- a/include/EnvelopeAndLfoView.h +++ b/include/EnvelopeAndLfoView.h @@ -54,7 +54,7 @@ class EnvelopeAndLfoView : public QWidget, public ModelView Q_OBJECT public: EnvelopeAndLfoView( QWidget * _parent ); - virtual ~EnvelopeAndLfoView(); + ~EnvelopeAndLfoView() override; protected: diff --git a/include/ExportFilter.h b/include/ExportFilter.h index 29cb1c711..3aaa2f986 100644 --- a/include/ExportFilter.h +++ b/include/ExportFilter.h @@ -40,7 +40,7 @@ class LMMS_EXPORT ExportFilter : public Plugin { public: ExportFilter( const Descriptor * _descriptor ) : Plugin( _descriptor, nullptr ) {} - virtual ~ExportFilter() {} + ~ExportFilter() override {} virtual bool tryExport(const TrackContainer::TrackList &tracks, diff --git a/include/FadeButton.h b/include/FadeButton.h index ee0936ca7..b4a78d5ee 100644 --- a/include/FadeButton.h +++ b/include/FadeButton.h @@ -44,7 +44,7 @@ public: const QColor & _hold_color, QWidget * _parent ); - virtual ~FadeButton(); + ~FadeButton() override; void setActiveColor( const QColor & activated_color ); diff --git a/include/Fader.h b/include/Fader.h index 355684c4a..54acfc57d 100644 --- a/include/Fader.h +++ b/include/Fader.h @@ -72,7 +72,7 @@ public: Fader( FloatModel * _model, const QString & _name, QWidget * _parent ); Fader( FloatModel * _model, const QString & _name, QWidget * _parent, QPixmap * back, QPixmap * leds, QPixmap * knob ); - virtual ~Fader() = default; + ~Fader() override = default; void init(FloatModel * model, QString const & name); diff --git a/include/FileBrowser.h b/include/FileBrowser.h index eb50dd1bb..315248d42 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -68,7 +68,7 @@ public: const QString& userDir = "", const QString& factoryDir = ""); - virtual ~FileBrowser() = default; + ~FileBrowser() override = default; private slots: void reloadTree( void ); @@ -107,7 +107,7 @@ class FileBrowserTreeWidget : public QTreeWidget Q_OBJECT public: FileBrowserTreeWidget( QWidget * parent ); - virtual ~FileBrowserTreeWidget() = default; + ~FileBrowserTreeWidget() override = default; //! This method returns a QList with paths (QString's) of all directories //! that are expanded in the tree. diff --git a/include/Graph.h b/include/Graph.h index 7a9599f12..747fcf29a 100644 --- a/include/Graph.h +++ b/include/Graph.h @@ -67,7 +67,7 @@ public: int _width = 132, int _height = 104 ); - virtual ~Graph() = default; + ~Graph() override = default; void setForeground( const QPixmap & _pixmap ); @@ -151,7 +151,7 @@ public: bool _default_constructed = false, float _step = 0.0 ); - virtual ~graphModel() = default; + ~graphModel() override = default; // TODO: saveSettings, loadSettings? diff --git a/include/GroupBox.h b/include/GroupBox.h index 6a282fedb..e20db80a6 100644 --- a/include/GroupBox.h +++ b/include/GroupBox.h @@ -42,7 +42,7 @@ class GroupBox : public QWidget, public BoolModelView Q_OBJECT public: GroupBox( const QString & _caption, QWidget * _parent = nullptr ); - virtual ~GroupBox(); + ~GroupBox() override; void modelChanged() override; diff --git a/include/GuiApplication.h b/include/GuiApplication.h index 84697175f..e39983138 100644 --- a/include/GuiApplication.h +++ b/include/GuiApplication.h @@ -50,7 +50,7 @@ class LMMS_EXPORT GuiApplication : public QObject Q_OBJECT; public: explicit GuiApplication(); - ~GuiApplication(); + ~GuiApplication() override; static GuiApplication* instance(); #ifdef LMMS_BUILD_WIN32 diff --git a/include/ImportFilter.h b/include/ImportFilter.h index 60eca6f80..9635fedb5 100644 --- a/include/ImportFilter.h +++ b/include/ImportFilter.h @@ -42,7 +42,7 @@ class LMMS_EXPORT ImportFilter : public Plugin public: ImportFilter( const QString & _file_name, const Descriptor * _descriptor ); - virtual ~ImportFilter(); + ~ImportFilter() override; // tries to import given file to given track-container by having all diff --git a/include/InlineAutomation.h b/include/InlineAutomation.h index 453184329..435604506 100644 --- a/include/InlineAutomation.h +++ b/include/InlineAutomation.h @@ -42,7 +42,7 @@ public: { } - virtual ~InlineAutomation() + ~InlineAutomation() override { if( m_autoClip ) { diff --git a/include/Instrument.h b/include/Instrument.h index 7ec3c66be..4e48e2fd6 100644 --- a/include/Instrument.h +++ b/include/Instrument.h @@ -60,7 +60,7 @@ public: Instrument(InstrumentTrack * _instrument_track, const Descriptor * _descriptor, const Descriptor::SubPluginFeatures::Key * key = nullptr); - virtual ~Instrument() = default; + ~Instrument() override = default; // -------------------------------------------------------------------- // functions that can/should be re-implemented: diff --git a/include/InstrumentFunctionViews.h b/include/InstrumentFunctionViews.h index bf4b07668..99ba92031 100644 --- a/include/InstrumentFunctionViews.h +++ b/include/InstrumentFunctionViews.h @@ -50,7 +50,7 @@ class InstrumentFunctionNoteStackingView : public QWidget, public ModelView Q_OBJECT public: InstrumentFunctionNoteStackingView( InstrumentFunctionNoteStacking* cc, QWidget* parent = nullptr ); - virtual ~InstrumentFunctionNoteStackingView(); + ~InstrumentFunctionNoteStackingView() override; private: @@ -73,7 +73,7 @@ class InstrumentFunctionArpeggioView : public QWidget, public ModelView Q_OBJECT public: InstrumentFunctionArpeggioView( InstrumentFunctionArpeggio* arp, QWidget* parent = nullptr ); - virtual ~InstrumentFunctionArpeggioView(); + ~InstrumentFunctionArpeggioView() override; private: diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index ef1d17902..76e522bc5 100644 --- a/include/InstrumentFunctions.h +++ b/include/InstrumentFunctions.h @@ -58,7 +58,7 @@ private: public: InstrumentFunctionNoteStacking( Model * _parent ); - virtual ~InstrumentFunctionNoteStacking(); + ~InstrumentFunctionNoteStacking() override; void processNote( NotePlayHandle* n ); @@ -180,7 +180,7 @@ public: } ; InstrumentFunctionArpeggio( Model * _parent ); - virtual ~InstrumentFunctionArpeggio(); + ~InstrumentFunctionArpeggio() override; void processNote( NotePlayHandle* n ); diff --git a/include/InstrumentMidiIOView.h b/include/InstrumentMidiIOView.h index 399aee890..821488390 100644 --- a/include/InstrumentMidiIOView.h +++ b/include/InstrumentMidiIOView.h @@ -50,7 +50,7 @@ class InstrumentMidiIOView : public QWidget, public ModelView Q_OBJECT public: InstrumentMidiIOView( QWidget* parent ); - virtual ~InstrumentMidiIOView(); + ~InstrumentMidiIOView() override; private: diff --git a/include/InstrumentPlayHandle.h b/include/InstrumentPlayHandle.h index 2d7bfa587..2935d36ba 100644 --- a/include/InstrumentPlayHandle.h +++ b/include/InstrumentPlayHandle.h @@ -38,7 +38,7 @@ class LMMS_EXPORT InstrumentPlayHandle : public PlayHandle public: InstrumentPlayHandle( Instrument * instrument, InstrumentTrack* instrumentTrack ); - virtual ~InstrumentPlayHandle() + ~InstrumentPlayHandle() override { } diff --git a/include/InstrumentSoundShaping.h b/include/InstrumentSoundShaping.h index 00208392d..1df6b858b 100644 --- a/include/InstrumentSoundShaping.h +++ b/include/InstrumentSoundShaping.h @@ -46,7 +46,7 @@ class InstrumentSoundShaping : public Model, public JournallingObject Q_OBJECT public: InstrumentSoundShaping( InstrumentTrack * _instrument_track ); - virtual ~InstrumentSoundShaping(); + ~InstrumentSoundShaping() override; void processAudioBuffer( sampleFrame * _ab, const fpp_t _frames, NotePlayHandle * _n ); diff --git a/include/InstrumentSoundShapingView.h b/include/InstrumentSoundShapingView.h index 9b4efcfab..aa8aff19d 100644 --- a/include/InstrumentSoundShapingView.h +++ b/include/InstrumentSoundShapingView.h @@ -47,7 +47,7 @@ class InstrumentSoundShapingView : public QWidget, public ModelView Q_OBJECT public: InstrumentSoundShapingView( QWidget * _parent ); - virtual ~InstrumentSoundShapingView(); + ~InstrumentSoundShapingView() override; void setFunctionsHidden( bool hidden ); diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index d05da176b..90cd25814 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -64,7 +64,7 @@ class LMMS_EXPORT InstrumentTrack : public Track, public MidiEventProcessor mapPropertyFromModel(int,getVolume,setVolume,m_volumeModel); public: InstrumentTrack( TrackContainer* tc ); - virtual ~InstrumentTrack(); + ~InstrumentTrack() override; // used by instrument void processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, @@ -122,7 +122,7 @@ public: } // play everything in given frame-range - creates note-play-handles - virtual bool play( const TimePos & _start, const fpp_t _frames, + bool play( const TimePos & _start, const fpp_t _frames, const f_cnt_t _frame_base, int _clip_num = -1 ) override; // create new view for me gui::TrackView* createView( gui::TrackContainerView* tcv ) override; @@ -132,7 +132,7 @@ public: // called by track - virtual void saveTrackSpecificSettings( QDomDocument & _doc, + void saveTrackSpecificSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadTrackSpecificSettings( const QDomElement & _this ) override; diff --git a/include/InstrumentTrackView.h b/include/InstrumentTrackView.h index a5297b332..3201f81d6 100644 --- a/include/InstrumentTrackView.h +++ b/include/InstrumentTrackView.h @@ -46,7 +46,7 @@ class InstrumentTrackView : public TrackView Q_OBJECT public: InstrumentTrackView( InstrumentTrack * _it, TrackContainerView* tc ); - virtual ~InstrumentTrackView(); + ~InstrumentTrackView() override; InstrumentTrackWindow * getInstrumentTrackWindow(); diff --git a/include/InstrumentTrackWindow.h b/include/InstrumentTrackWindow.h index cd208c165..68750c0b8 100644 --- a/include/InstrumentTrackWindow.h +++ b/include/InstrumentTrackWindow.h @@ -65,7 +65,7 @@ class InstrumentTrackWindow : public QWidget, public ModelView, Q_OBJECT public: InstrumentTrackWindow( InstrumentTrackView * _tv ); - virtual ~InstrumentTrackWindow(); + ~InstrumentTrackWindow() override; // parent for all internal tab-widgets TabWidget * tabWidgetParent() diff --git a/include/JournallingObject.h b/include/JournallingObject.h index cd853dc7f..41ae65295 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -37,7 +37,7 @@ class LMMS_EXPORT JournallingObject : public SerializingObject { public: JournallingObject(); - virtual ~JournallingObject(); + ~JournallingObject() override; inline jo_id_t id() const { @@ -60,7 +60,7 @@ public: void addJournalCheckPoint(); - virtual QDomElement saveState( QDomDocument & _doc, + QDomElement saveState( QDomDocument & _doc, QDomElement & _parent ) override; void restoreState( const QDomElement & _this ) override; diff --git a/include/Ladspa2LMMS.h b/include/Ladspa2LMMS.h index 63db75cd9..b1a21de70 100644 --- a/include/Ladspa2LMMS.h +++ b/include/Ladspa2LMMS.h @@ -68,7 +68,7 @@ public: private: Ladspa2LMMS(); - virtual ~Ladspa2LMMS(); + ~Ladspa2LMMS() override; l_sortable_plugin_t m_instruments; l_sortable_plugin_t m_validEffects; diff --git a/include/LadspaControl.h b/include/LadspaControl.h index 8b6fe3d19..3a0ea5cc8 100644 --- a/include/LadspaControl.h +++ b/include/LadspaControl.h @@ -52,7 +52,7 @@ class LMMS_EXPORT LadspaControl : public Model, public JournallingObject public: LadspaControl( Model * _parent, port_desc_t * _port, bool _link = false ); - ~LadspaControl(); + ~LadspaControl() override; LADSPA_Data value(); ValueBuffer * valueBuffer(); diff --git a/include/LadspaControlView.h b/include/LadspaControlView.h index 15eb722a7..c36135986 100644 --- a/include/LadspaControlView.h +++ b/include/LadspaControlView.h @@ -43,7 +43,7 @@ class LMMS_EXPORT LadspaControlView : public QWidget, public ModelView Q_OBJECT public: LadspaControlView( QWidget * _parent, LadspaControl * _ctl ); - virtual ~LadspaControlView(); + ~LadspaControlView() override; private: LadspaControl * m_ctl; diff --git a/include/LcdSpinBox.h b/include/LcdSpinBox.h index 1c30bfcf6..f310e46b2 100644 --- a/include/LcdSpinBox.h +++ b/include/LcdSpinBox.h @@ -40,7 +40,7 @@ public: LcdSpinBox( int numDigits, const QString& style, QWidget* parent, const QString& name = QString() ); - virtual ~LcdSpinBox() = default; + ~LcdSpinBox() override = default; void modelChanged() override { diff --git a/include/LcdWidget.h b/include/LcdWidget.h index aad1d189a..d55cfc017 100644 --- a/include/LcdWidget.h +++ b/include/LcdWidget.h @@ -48,7 +48,7 @@ public: LcdWidget(int numDigits, const QString& style, QWidget* parent, const QString& name = QString(), bool leadingZero = false); - virtual ~LcdWidget(); + ~LcdWidget() override; void setValue( int value ); void setLabel( const QString& label ); diff --git a/include/LedCheckBox.h b/include/LedCheckBox.h index 8eac9b562..a215592e6 100644 --- a/include/LedCheckBox.h +++ b/include/LedCheckBox.h @@ -54,7 +54,7 @@ public: const QString & _name = QString(), LedColors _color = Yellow ); - virtual ~LedCheckBox(); + ~LedCheckBox() override; inline const QString & text() diff --git a/include/LfoController.h b/include/LfoController.h index 6ee136a14..48aee3d30 100644 --- a/include/LfoController.h +++ b/include/LfoController.h @@ -57,7 +57,7 @@ class LfoController : public Controller public: LfoController( Model * _parent ); - virtual ~LfoController(); + ~LfoController() override; void saveSettings( QDomDocument & _doc, QDomElement & _this ) override; void loadSettings( const QDomElement & _this ) override; @@ -105,7 +105,7 @@ class LfoControllerDialog : public ControllerDialog Q_OBJECT public: LfoControllerDialog( Controller * _controller, QWidget * _parent ); - virtual ~LfoControllerDialog(); + ~LfoControllerDialog() override; protected: diff --git a/include/LinkedModelGroupViews.h b/include/LinkedModelGroupViews.h index 50ef03596..91a8d53ca 100644 --- a/include/LinkedModelGroupViews.h +++ b/include/LinkedModelGroupViews.h @@ -70,7 +70,7 @@ public: */ LinkedModelGroupView(QWidget* parent, LinkedModelGroup* model, std::size_t colNum); - ~LinkedModelGroupView(); + ~LinkedModelGroupView() override; //! Reconnect models if model changed void modelChanged(LinkedModelGroup* linkedModelGroup); diff --git a/include/LmmsPalette.h b/include/LmmsPalette.h index 87ea18687..1840fb3eb 100644 --- a/include/LmmsPalette.h +++ b/include/LmmsPalette.h @@ -50,7 +50,7 @@ class LMMS_EXPORT LmmsPalette : public QWidget public: LmmsPalette( QWidget * parent, QStyle * stylearg ); - virtual ~LmmsPalette(); + ~LmmsPalette() override; #define ACCESSMET( read, write ) \ QColor read () const; \ diff --git a/include/LmmsStyle.h b/include/LmmsStyle.h index a4c9edd31..72895a102 100644 --- a/include/LmmsStyle.h +++ b/include/LmmsStyle.h @@ -66,23 +66,23 @@ public: }; LmmsStyle(); - virtual ~LmmsStyle() + ~LmmsStyle() override { } QPalette standardPalette( void ) const override; - virtual void drawComplexControl( + void drawComplexControl( ComplexControl control, const QStyleOptionComplex * option, QPainter *painter, const QWidget *widget ) const override; - virtual void drawPrimitive( PrimitiveElement element, + void drawPrimitive( PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget = 0 ) const override; - virtual int pixelMetric( PixelMetric metric, + int pixelMetric( PixelMetric metric, const QStyleOption * option = 0, const QWidget * widget = 0 ) const override; diff --git a/include/LocklessAllocator.h b/include/LocklessAllocator.h index 17f5ebfb5..054bb91e8 100644 --- a/include/LocklessAllocator.h +++ b/include/LocklessAllocator.h @@ -67,7 +67,7 @@ public: { } - virtual ~LocklessAllocatorT() + ~LocklessAllocatorT() override { } diff --git a/include/Lv2ViewBase.h b/include/Lv2ViewBase.h index 74a0bd876..2be5d72a4 100644 --- a/include/Lv2ViewBase.h +++ b/include/Lv2ViewBase.h @@ -58,7 +58,7 @@ class Lv2ViewProc : public LinkedModelGroupView public: //! @param colNum numbers of columns for the controls Lv2ViewProc(QWidget *parent, Lv2Proc *ctrlBase, int colNum); - ~Lv2ViewProc(); + ~Lv2ViewProc() override; private: static AutoLilvNode uri(const char *uriStr); diff --git a/include/MainWindow.h b/include/MainWindow.h index 8fbc20e6a..05aa716b5 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -190,7 +190,7 @@ protected: private: MainWindow(); MainWindow( const MainWindow & ); - virtual ~MainWindow(); + ~MainWindow() override; void finalize(); diff --git a/include/MeterDialog.h b/include/MeterDialog.h index e606a4482..e744ea9d4 100644 --- a/include/MeterDialog.h +++ b/include/MeterDialog.h @@ -41,7 +41,7 @@ class MeterDialog : public QWidget, public ModelView Q_OBJECT public: MeterDialog( QWidget * _parent, bool _simple = false ); - virtual ~MeterDialog(); + ~MeterDialog() override; void modelChanged() override; diff --git a/include/MeterModel.h b/include/MeterModel.h index bcd3fa2b2..8ed4ba1aa 100644 --- a/include/MeterModel.h +++ b/include/MeterModel.h @@ -38,7 +38,7 @@ class MeterModel : public Model mapPropertyFromModel(int,getDenominator,setDenominator,m_denominatorModel); public: MeterModel( Model * _parent ); - ~MeterModel(); + ~MeterModel() override; void saveSettings( QDomDocument & _doc, QDomElement & _this, const QString & _name ); diff --git a/include/MidiAlsaRaw.h b/include/MidiAlsaRaw.h index 3ab2b8af7..57a477264 100644 --- a/include/MidiAlsaRaw.h +++ b/include/MidiAlsaRaw.h @@ -48,7 +48,7 @@ class MidiAlsaRaw : public QThread, public MidiClientRaw Q_OBJECT public: MidiAlsaRaw(); - virtual ~MidiAlsaRaw(); + ~MidiAlsaRaw() override; static QString probeDevice(); diff --git a/include/MidiAlsaSeq.h b/include/MidiAlsaSeq.h index 8a2d3a098..fa287a409 100644 --- a/include/MidiAlsaSeq.h +++ b/include/MidiAlsaSeq.h @@ -51,7 +51,7 @@ class MidiAlsaSeq : public QThread, public MidiClient Q_OBJECT public: MidiAlsaSeq(); - virtual ~MidiAlsaSeq(); + ~MidiAlsaSeq() override; static QString probeDevice(); @@ -70,7 +70,7 @@ public: - virtual void processOutEvent( const MidiEvent & _me, + void processOutEvent( const MidiEvent & _me, const TimePos & _time, const MidiPort * _port ) override; @@ -95,20 +95,20 @@ public: QString sourcePortName( const MidiEvent & ) const override; // (un)subscribe given MidiPort to/from destination-port - virtual void subscribeReadablePort( MidiPort * _port, + void subscribeReadablePort( MidiPort * _port, const QString & _dest, bool _subscribe = true ) override; - virtual void subscribeWritablePort( MidiPort * _port, + void subscribeWritablePort( MidiPort * _port, const QString & _dest, bool _subscribe = true ) override; - virtual void connectRPChanged( QObject * _receiver, + void connectRPChanged( QObject * _receiver, const char * _member ) override { connect( this, SIGNAL( readablePortsChanged() ), _receiver, _member ); } - virtual void connectWPChanged( QObject * _receiver, + void connectWPChanged( QObject * _receiver, const char * _member ) override { connect( this, SIGNAL( writablePortsChanged() ), diff --git a/include/MidiClient.h b/include/MidiClient.h index 835d2e46a..f5efc659a 100644 --- a/include/MidiClient.h +++ b/include/MidiClient.h @@ -125,7 +125,7 @@ class MidiClientRaw : public MidiClient { public: MidiClientRaw(); - virtual ~MidiClientRaw(); + ~MidiClientRaw() override; // we are raw-clients for sure! bool isRaw() const override diff --git a/include/MidiClip.h b/include/MidiClip.h index 173ca5699..6433ba507 100644 --- a/include/MidiClip.h +++ b/include/MidiClip.h @@ -55,7 +55,7 @@ public: MidiClip( InstrumentTrack* instrumentTrack ); MidiClip( const MidiClip& other ); - virtual ~MidiClip(); + ~MidiClip() override; void init(); diff --git a/include/MidiClipView.h b/include/MidiClipView.h index c9f1c3e1e..278e49443 100644 --- a/include/MidiClipView.h +++ b/include/MidiClipView.h @@ -43,7 +43,7 @@ class MidiClipView : public ClipView public: MidiClipView( MidiClip* clip, TrackView* parent ); - virtual ~MidiClipView() = default; + ~MidiClipView() override = default; Q_PROPERTY(QColor noteFillColor READ getNoteFillColor WRITE setNoteFillColor) Q_PROPERTY(QColor noteBorderColor READ getNoteBorderColor WRITE setNoteBorderColor) diff --git a/include/MidiController.h b/include/MidiController.h index 533f8ff03..8b1db0476 100644 --- a/include/MidiController.h +++ b/include/MidiController.h @@ -49,12 +49,12 @@ class MidiController : public Controller, public MidiEventProcessor Q_OBJECT public: MidiController( Model * _parent ); - virtual ~MidiController(); + ~MidiController() override; - virtual void processInEvent( const MidiEvent & _me, + void processInEvent( const MidiEvent & _me, const TimePos & _time, f_cnt_t offset = 0 ) override; - virtual void processOutEvent( const MidiEvent& _me, + void processOutEvent( const MidiEvent& _me, const TimePos & _time, f_cnt_t offset = 0 ) override { // No output yet diff --git a/include/MidiDummy.h b/include/MidiDummy.h index 8744c6aa2..e1c0e3e6a 100644 --- a/include/MidiDummy.h +++ b/include/MidiDummy.h @@ -38,7 +38,7 @@ public: MidiDummy() { } - virtual ~MidiDummy() + ~MidiDummy() override { } diff --git a/include/MidiJack.h b/include/MidiJack.h index 16d09d431..a4a944b81 100644 --- a/include/MidiJack.h +++ b/include/MidiJack.h @@ -53,7 +53,7 @@ class MidiJack : public QThread, public MidiClientRaw Q_OBJECT public: MidiJack(); - virtual ~MidiJack(); + ~MidiJack() override; jack_client_t* jackClient(); @@ -76,8 +76,8 @@ public: protected: - virtual void sendByte( const unsigned char c ); - virtual void run(); + void sendByte( const unsigned char c ) override; + void run() override; private: diff --git a/include/MidiOss.h b/include/MidiOss.h index 30f78bec1..944359055 100644 --- a/include/MidiOss.h +++ b/include/MidiOss.h @@ -44,7 +44,7 @@ class MidiOss : public QThread, public MidiClientRaw Q_OBJECT public: MidiOss(); - virtual ~MidiOss(); + ~MidiOss() override; static QString probeDevice(); diff --git a/include/MidiPort.h b/include/MidiPort.h index 3d3ceffdb..562379ba8 100644 --- a/include/MidiPort.h +++ b/include/MidiPort.h @@ -83,7 +83,7 @@ public: MidiEventProcessor* eventProcessor, Model* parent = nullptr, Mode mode = Disabled ); - virtual ~MidiPort(); + ~MidiPort() override; void setName( const QString& name ); diff --git a/include/MidiPortMenu.h b/include/MidiPortMenu.h index 7f7689edc..eb44ace57 100644 --- a/include/MidiPortMenu.h +++ b/include/MidiPortMenu.h @@ -41,7 +41,7 @@ class MidiPortMenu : public QMenu, public ModelView Q_OBJECT public: MidiPortMenu( MidiPort::Modes _mode ); - virtual ~MidiPortMenu(); + ~MidiPortMenu() override; public slots: diff --git a/include/MidiSndio.h b/include/MidiSndio.h index 07c42186d..1ffbae5ce 100644 --- a/include/MidiSndio.h +++ b/include/MidiSndio.h @@ -46,7 +46,7 @@ class MidiSndio : public QThread, public MidiClientRaw Q_OBJECT public: MidiSndio( void ); - virtual ~MidiSndio(); + ~MidiSndio() override; static QString probeDevice(void); diff --git a/include/Mixer.h b/include/Mixer.h index 36aa9f5d0..e6fdb2b06 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -102,7 +102,7 @@ class MixerRoute : public QObject Q_OBJECT public: MixerRoute( MixerChannel * from, MixerChannel * to, float amount ); - virtual ~MixerRoute(); + ~MixerRoute() override; mix_ch_t senderIndex() const { @@ -143,7 +143,7 @@ class LMMS_EXPORT Mixer : public Model, public JournallingObject Q_OBJECT public: Mixer(); - virtual ~Mixer(); + ~Mixer() override; void mixToChannel( const sampleFrame * _buf, mix_ch_t _ch ); diff --git a/include/MixerLine.h b/include/MixerLine.h index 12ac3df75..decd5f3aa 100644 --- a/include/MixerLine.h +++ b/include/MixerLine.h @@ -50,7 +50,7 @@ public: Q_PROPERTY( QColor strokeInnerActive READ strokeInnerActive WRITE setStrokeInnerActive ) Q_PROPERTY( QColor strokeInnerInactive READ strokeInnerInactive WRITE setStrokeInnerInactive ) MixerLine( QWidget * _parent, MixerView * _mv, int _channelIndex); - ~MixerLine(); + ~MixerLine() override; void paintEvent( QPaintEvent * ) override; void mousePressEvent( QMouseEvent * ) override; diff --git a/include/MixerLineLcdSpinBox.h b/include/MixerLineLcdSpinBox.h index 7e739093d..51c7ab938 100644 --- a/include/MixerLineLcdSpinBox.h +++ b/include/MixerLineLcdSpinBox.h @@ -41,7 +41,7 @@ public: MixerLineLcdSpinBox(int numDigits, QWidget * parent, const QString& name, TrackView * tv = nullptr) : LcdSpinBox(numDigits, parent, name), m_tv(tv) {} - virtual ~MixerLineLcdSpinBox() {} + ~MixerLineLcdSpinBox() override {} void setTrackView(TrackView * tv); diff --git a/include/MixerView.h b/include/MixerView.h index 5e63194c9..a7b1b5191 100644 --- a/include/MixerView.h +++ b/include/MixerView.h @@ -66,7 +66,7 @@ public: MixerView(); - virtual ~MixerView(); + ~MixerView() override; void keyPressEvent(QKeyEvent * e) override; diff --git a/include/Model.h b/include/Model.h index 1c96de21c..1621d77e8 100644 --- a/include/Model.h +++ b/include/Model.h @@ -45,7 +45,7 @@ public: { } - virtual ~Model() + ~Model() override { } diff --git a/include/NStateButton.h b/include/NStateButton.h index ff48593a7..4dac1a436 100644 --- a/include/NStateButton.h +++ b/include/NStateButton.h @@ -41,7 +41,7 @@ class NStateButton : public ToolButton Q_OBJECT public: NStateButton( QWidget * _parent ); - virtual ~NStateButton(); + ~NStateButton() override; void addState( const QPixmap & _pixmap, const QString & _tooltip = "" ); inline void setGeneralToolTip( const QString & _tooltip ) diff --git a/include/Note.h b/include/Note.h index d6e0b85c2..f1c10c0ac 100644 --- a/include/Note.h +++ b/include/Note.h @@ -98,7 +98,7 @@ public: panning_t panning = DefaultPanning, DetuningHelper * detuning = nullptr ); Note( const Note & note ); - virtual ~Note(); + ~Note() override; // used by GUI inline void setSelected( const bool selected ) { m_selected = selected; } diff --git a/include/NotePlayHandle.h b/include/NotePlayHandle.h index 396d00e71..c0980c12b 100644 --- a/include/NotePlayHandle.h +++ b/include/NotePlayHandle.h @@ -74,7 +74,7 @@ public: NotePlayHandle* parent = nullptr, int midiEventChannel = -1, Origin origin = OriginMidiClip ); - virtual ~NotePlayHandle(); + ~NotePlayHandle() override; void * operator new ( size_t size, void * p ) { diff --git a/include/Oscilloscope.h b/include/Oscilloscope.h index 4404fd98b..db4cf2b4a 100644 --- a/include/Oscilloscope.h +++ b/include/Oscilloscope.h @@ -43,7 +43,7 @@ public: Q_PROPERTY( QColor clippingColor READ clippingColor WRITE setClippingColor ) Oscilloscope( QWidget * _parent ); - virtual ~Oscilloscope(); + ~Oscilloscope() override; void setActive( bool _active ); diff --git a/include/PatternClip.h b/include/PatternClip.h index a1beb00f5..f1d0e2557 100644 --- a/include/PatternClip.h +++ b/include/PatternClip.h @@ -39,7 +39,7 @@ class PatternClip : public Clip { public: PatternClip(Track* track); - virtual ~PatternClip() = default; + ~PatternClip() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/include/PatternClipView.h b/include/PatternClipView.h index d66de70f0..d170e4bef 100644 --- a/include/PatternClipView.h +++ b/include/PatternClipView.h @@ -44,7 +44,7 @@ class PatternClipView : public ClipView Q_OBJECT public: PatternClipView(Clip* clip, TrackView* tv); - virtual ~PatternClipView() = default; + ~PatternClipView() override = default; public slots: diff --git a/include/PatternStore.h b/include/PatternStore.h index 39b65d1c1..58791e40d 100644 --- a/include/PatternStore.h +++ b/include/PatternStore.h @@ -68,7 +68,7 @@ class LMMS_EXPORT PatternStore : public TrackContainer mapPropertyFromModel(int, currentPattern, setCurrentPattern, m_patternComboBoxModel); public: PatternStore(); - virtual ~PatternStore(); + ~PatternStore() override; virtual bool play(TimePos start, const fpp_t frames, const f_cnt_t frameBase, int clipNum = -1); diff --git a/include/PatternTrack.h b/include/PatternTrack.h index a8e7a505c..3527b5e49 100644 --- a/include/PatternTrack.h +++ b/include/PatternTrack.h @@ -51,15 +51,15 @@ class LMMS_EXPORT PatternTrack : public Track Q_OBJECT public: PatternTrack(TrackContainer* tc); - virtual ~PatternTrack(); + ~PatternTrack() override; - virtual bool play( const TimePos & _start, const fpp_t _frames, + bool play( const TimePos & _start, const fpp_t _frames, const f_cnt_t _frame_base, int _clip_num = -1 ) override; gui::TrackView * createView( gui::TrackContainerView* tcv ) override; Clip* createClip(const TimePos & pos) override; - virtual void saveTrackSpecificSettings( QDomDocument & _doc, + void saveTrackSpecificSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadTrackSpecificSettings( const QDomElement & _this ) override; diff --git a/include/PatternTrackView.h b/include/PatternTrackView.h index 41f8fac33..b6d33e444 100644 --- a/include/PatternTrackView.h +++ b/include/PatternTrackView.h @@ -45,7 +45,7 @@ class PatternTrackView : public TrackView Q_OBJECT public: PatternTrackView(PatternTrack* pt, TrackContainerView* tcv); - virtual ~PatternTrackView(); + ~PatternTrackView() override; bool close() override; diff --git a/include/PeakController.h b/include/PeakController.h index d50c0b06f..01a8e968c 100644 --- a/include/PeakController.h +++ b/include/PeakController.h @@ -47,7 +47,7 @@ public: PeakControllerEffect *_peak_effect = nullptr ); - virtual ~PeakController(); + ~PeakController() override; void saveSettings( QDomDocument & _doc, QDomElement & _this ) override; void loadSettings( const QDomElement & _this ) override; @@ -92,7 +92,7 @@ class PeakControllerDialog : public ControllerDialog Q_OBJECT public: PeakControllerDialog( Controller * _controller, QWidget * _parent ); - virtual ~PeakControllerDialog(); + ~PeakControllerDialog() override; protected: void contextMenuEvent( QContextMenuEvent * _me ) override; diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 73a2e5b76..3d74a79d6 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -298,7 +298,7 @@ private: PianoRoll(); PianoRoll( const PianoRoll & ); - virtual ~PianoRoll(); + ~PianoRoll() override; void autoScroll(const TimePos & t ); diff --git a/include/PianoView.h b/include/PianoView.h index 7a6ab6479..7f586809d 100644 --- a/include/PianoView.h +++ b/include/PianoView.h @@ -44,7 +44,7 @@ class PianoView : public QWidget, public ModelView Q_OBJECT public: PianoView( QWidget * _parent ); - virtual ~PianoView() = default; + ~PianoView() override = default; static int getKeyFromKeyEvent( QKeyEvent * _ke ); diff --git a/include/PixmapButton.h b/include/PixmapButton.h index f4062826d..ec5ac1b28 100644 --- a/include/PixmapButton.h +++ b/include/PixmapButton.h @@ -40,7 +40,7 @@ class LMMS_EXPORT PixmapButton : public AutomatableButton public: PixmapButton( QWidget * _parent, const QString & _name = QString() ); - virtual ~PixmapButton(); + ~PixmapButton() override; void setActiveGraphic( const QPixmap & _pm ); void setInactiveGraphic( const QPixmap & _pm, bool _update = true ); diff --git a/include/Plugin.h b/include/Plugin.h index b50d81116..7042edb41 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -244,7 +244,7 @@ public: //! See the key() function Plugin(const Descriptor * descriptor, Model * parent, const Descriptor::SubPluginFeatures::Key *key = nullptr); - virtual ~Plugin(); + ~Plugin() override; //! Return display-name out of sub plugin or descriptor QString displayName() const override; diff --git a/include/PluginBrowser.h b/include/PluginBrowser.h index 0b2a59d15..75fa543f4 100644 --- a/include/PluginBrowser.h +++ b/include/PluginBrowser.h @@ -41,7 +41,7 @@ class PluginBrowser : public SideBarWidget Q_OBJECT public: PluginBrowser( QWidget * _parent ); - virtual ~PluginBrowser() = default; + ~PluginBrowser() override = default; private slots: void onFilterChanged( const QString & filter ); diff --git a/include/PresetPreviewPlayHandle.h b/include/PresetPreviewPlayHandle.h index 9dd151330..dfff0fc21 100644 --- a/include/PresetPreviewPlayHandle.h +++ b/include/PresetPreviewPlayHandle.h @@ -40,7 +40,7 @@ class LMMS_EXPORT PresetPreviewPlayHandle : public PlayHandle { public: PresetPreviewPlayHandle( const QString& presetFile, bool loadByPlugin = false, DataFile *dataFile = 0 ); - virtual ~PresetPreviewPlayHandle(); + ~PresetPreviewPlayHandle() override; inline bool affinityMatters() const override { diff --git a/include/ProjectNotes.h b/include/ProjectNotes.h index fda5c9b51..384f24f79 100644 --- a/include/ProjectNotes.h +++ b/include/ProjectNotes.h @@ -44,7 +44,7 @@ class LMMS_EXPORT ProjectNotes : public QMainWindow, public SerializingObject Q_OBJECT public: ProjectNotes(); - virtual ~ProjectNotes(); + ~ProjectNotes() override; void clear(); void setText( const QString & _text ); diff --git a/include/ProjectRenderer.h b/include/ProjectRenderer.h index bd61c4730..9fa0bc507 100644 --- a/include/ProjectRenderer.h +++ b/include/ProjectRenderer.h @@ -64,7 +64,7 @@ public: const OutputSettings & _os, ExportFileFormats _file_format, const QString & _out_file ); - virtual ~ProjectRenderer(); + ~ProjectRenderer() override; bool isReady() const { diff --git a/include/RemotePlugin.h b/include/RemotePlugin.h index ec08896e2..73810150d 100644 --- a/include/RemotePlugin.h +++ b/include/RemotePlugin.h @@ -39,7 +39,7 @@ class ProcessWatcher : public QThread Q_OBJECT public: ProcessWatcher( RemotePlugin * ); - virtual ~ProcessWatcher() = default; + ~ProcessWatcher() override = default; void stop() { @@ -66,7 +66,7 @@ class LMMS_EXPORT RemotePlugin : public QObject, public RemotePluginBase Q_OBJECT public: RemotePlugin(); - virtual ~RemotePlugin(); + ~RemotePlugin() override; inline bool isRunning() { diff --git a/include/RemotePluginClient.h b/include/RemotePluginClient.h index 69a9d41e9..b96b71b85 100644 --- a/include/RemotePluginClient.h +++ b/include/RemotePluginClient.h @@ -51,11 +51,11 @@ public: #else RemotePluginClient( const char * socketPath ); #endif - virtual ~RemotePluginClient(); + ~RemotePluginClient() override; const VstSyncData* getVstSyncData(); - virtual bool processMessage( const message & _m ); + bool processMessage( const message & _m ) override; virtual void process( const sampleFrame * _in_buf, sampleFrame * _out_buf ) = 0; diff --git a/include/RenameDialog.h b/include/RenameDialog.h index c1e30b9d8..f2a289ee0 100644 --- a/include/RenameDialog.h +++ b/include/RenameDialog.h @@ -40,7 +40,7 @@ class RenameDialog : public QDialog Q_OBJECT public: RenameDialog( QString & _string ); - ~RenameDialog(); + ~RenameDialog() override; protected: diff --git a/include/RenderManager.h b/include/RenderManager.h index ff59cb953..9ec4c511e 100644 --- a/include/RenderManager.h +++ b/include/RenderManager.h @@ -46,7 +46,7 @@ public: ProjectRenderer::ExportFileFormats fmt, QString outputPath); - virtual ~RenderManager(); + ~RenderManager() override; /// Export all unmuted tracks into a single file void renderProject(); diff --git a/include/RingBuffer.h b/include/RingBuffer.h index efb5afd39..c7db6b4e5 100644 --- a/include/RingBuffer.h +++ b/include/RingBuffer.h @@ -53,7 +53,7 @@ public: * \param size The size of the buffer in milliseconds. The actual size will be size + period size */ RingBuffer( float size ); - virtual ~RingBuffer(); + ~RingBuffer() override; diff --git a/include/RowTableView.h b/include/RowTableView.h index fc55383a1..9934dbade 100644 --- a/include/RowTableView.h +++ b/include/RowTableView.h @@ -39,7 +39,7 @@ class RowTableView : public QTableView Q_OBJECT public: RowTableView( QWidget * parent = 0 ); - virtual ~RowTableView(); + ~RowTableView() override; void setModel( QAbstractItemModel * model ) override; diff --git a/include/Rubberband.h b/include/Rubberband.h index 1332a932d..b00d10dd6 100644 --- a/include/Rubberband.h +++ b/include/Rubberband.h @@ -44,7 +44,7 @@ public: { } - virtual ~selectableObject() + ~selectableObject() override { } @@ -80,7 +80,7 @@ class RubberBand : public QRubberBand { public: RubberBand( QWidget * _parent ); - virtual ~RubberBand(); + ~RubberBand() override; QVector selectedObjects() const; QVector selectableObjects() const; diff --git a/include/SampleBuffer.h b/include/SampleBuffer.h index b556fccbe..f4d67859e 100644 --- a/include/SampleBuffer.h +++ b/include/SampleBuffer.h @@ -119,7 +119,7 @@ public: friend void swap(SampleBuffer & first, SampleBuffer & second) noexcept; SampleBuffer& operator= (const SampleBuffer that); - virtual ~SampleBuffer(); + ~SampleBuffer() override; bool play( sampleFrame * ab, diff --git a/include/SampleClip.h b/include/SampleClip.h index 52a2d6209..51225ded8 100644 --- a/include/SampleClip.h +++ b/include/SampleClip.h @@ -47,7 +47,7 @@ class SampleClip : public Clip public: SampleClip( Track * _track ); SampleClip( const SampleClip& orig ); - virtual ~SampleClip(); + ~SampleClip() override; SampleClip& operator=( const SampleClip& that ) = delete; diff --git a/include/SampleClipView.h b/include/SampleClipView.h index d5218e28a..74873dca7 100644 --- a/include/SampleClipView.h +++ b/include/SampleClipView.h @@ -44,7 +44,7 @@ class SampleClipView : public ClipView public: SampleClipView( SampleClip * _clip, TrackView * _tv ); - virtual ~SampleClipView() = default; + ~SampleClipView() override = default; public slots: void updateSample(); diff --git a/include/SamplePlayHandle.h b/include/SamplePlayHandle.h index d27591df3..69ee3b38d 100644 --- a/include/SamplePlayHandle.h +++ b/include/SamplePlayHandle.h @@ -46,7 +46,7 @@ public: SamplePlayHandle( SampleBuffer* sampleBuffer , bool ownAudioPort = true ); SamplePlayHandle( const QString& sampleFile ); SamplePlayHandle( SampleClip* clip ); - virtual ~SamplePlayHandle(); + ~SamplePlayHandle() override; inline bool affinityMatters() const override { diff --git a/include/SampleRecordHandle.h b/include/SampleRecordHandle.h index 724f4216d..466e240a8 100644 --- a/include/SampleRecordHandle.h +++ b/include/SampleRecordHandle.h @@ -46,7 +46,7 @@ class SampleRecordHandle : public PlayHandle { public: SampleRecordHandle( SampleClip* clip ); - virtual ~SampleRecordHandle(); + ~SampleRecordHandle() override; void play( sampleFrame * _working_buffer ) override; bool isFinished() const override; diff --git a/include/SampleTrack.h b/include/SampleTrack.h index 677e04889..8f424178a 100644 --- a/include/SampleTrack.h +++ b/include/SampleTrack.h @@ -47,15 +47,15 @@ class SampleTrack : public Track Q_OBJECT public: SampleTrack( TrackContainer* tc ); - virtual ~SampleTrack(); + ~SampleTrack() override; - virtual bool play( const TimePos & _start, const fpp_t _frames, + bool play( const TimePos & _start, const fpp_t _frames, const f_cnt_t _frame_base, int _clip_num = -1 ) override; gui::TrackView * createView( gui::TrackContainerView* tcv ) override; Clip* createClip(const TimePos & pos) override; - virtual void saveTrackSpecificSettings( QDomDocument & _doc, + void saveTrackSpecificSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadTrackSpecificSettings( const QDomElement & _this ) override; diff --git a/include/SampleTrackView.h b/include/SampleTrackView.h index 1223f999d..9921aa735 100644 --- a/include/SampleTrackView.h +++ b/include/SampleTrackView.h @@ -47,7 +47,7 @@ class SampleTrackView : public TrackView Q_OBJECT public: SampleTrackView( SampleTrack* Track, TrackContainerView* tcv ); - virtual ~SampleTrackView(); + ~SampleTrackView() override; SampleTrackWindow * getSampleTrackWindow() { diff --git a/include/SampleTrackWindow.h b/include/SampleTrackWindow.h index dd670fd09..fb4e3f5e8 100644 --- a/include/SampleTrackWindow.h +++ b/include/SampleTrackWindow.h @@ -50,7 +50,7 @@ class SampleTrackWindow : public QWidget, public ModelView, public SerializingOb Q_OBJECT public: SampleTrackWindow(SampleTrackView * tv); - virtual ~SampleTrackWindow(); + ~SampleTrackWindow() override; SampleTrack * model() { diff --git a/include/SetupDialog.h b/include/SetupDialog.h index 28668d8e9..9ce6e043d 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -64,7 +64,7 @@ public: }; SetupDialog(ConfigTabs tab_to_open = GeneralSettings); - virtual ~SetupDialog(); + ~SetupDialog() override; protected slots: diff --git a/include/SideBar.h b/include/SideBar.h index 70bac6385..ba9fe11a6 100644 --- a/include/SideBar.h +++ b/include/SideBar.h @@ -42,7 +42,7 @@ class SideBar : public QToolBar Q_OBJECT public: SideBar( Qt::Orientation _orientation, QWidget * _parent ); - virtual ~SideBar(); + ~SideBar() override; void appendTab( SideBarWidget * _sbw ); diff --git a/include/SideBarWidget.h b/include/SideBarWidget.h index 71a33a3ce..4b7ff4b2d 100644 --- a/include/SideBarWidget.h +++ b/include/SideBarWidget.h @@ -41,7 +41,7 @@ class SideBarWidget : public QWidget public: SideBarWidget( const QString & _title, const QPixmap & _icon, QWidget * _parent ); - virtual ~SideBarWidget(); + ~SideBarWidget() override; inline const QPixmap & icon() const { diff --git a/include/Song.h b/include/Song.h index cfe63a2ea..422e645bf 100644 --- a/include/Song.h +++ b/include/Song.h @@ -406,7 +406,7 @@ private slots: private: Song(); Song( const Song & ); - virtual ~Song(); + ~Song() override; inline bar_t currentBar() const diff --git a/include/SongEditor.h b/include/SongEditor.h index 29a9be0bf..b848fe776 100644 --- a/include/SongEditor.h +++ b/include/SongEditor.h @@ -66,7 +66,7 @@ public: }; SongEditor( Song * song ); - ~SongEditor(); + ~SongEditor() override; void saveSettings( QDomDocument& doc, QDomElement& element ) override; void loadSettings( const QDomElement& element ) override; diff --git a/include/StringPairDrag.h b/include/StringPairDrag.h index 9da2381b0..e58b88f90 100644 --- a/include/StringPairDrag.h +++ b/include/StringPairDrag.h @@ -44,7 +44,7 @@ class LMMS_EXPORT StringPairDrag : public QDrag public: StringPairDrag( const QString & _key, const QString & _value, const QPixmap & _icon, QWidget * _w ); - ~StringPairDrag(); + ~StringPairDrag() override; static bool processDragEnterEvent( QDragEnterEvent * _dee, const QString & _allowed_keys ); diff --git a/include/TabBar.h b/include/TabBar.h index 9239aef94..2395e15f5 100644 --- a/include/TabBar.h +++ b/include/TabBar.h @@ -46,7 +46,7 @@ class LMMS_EXPORT TabBar : public QWidget public: TabBar( QWidget * _parent, QBoxLayout::Direction _dir = QBoxLayout::LeftToRight ); - virtual ~TabBar() = default; + ~TabBar() override = default; TabButton * addTab( QWidget * _w, const QString & _text, int _id, bool _add_stretch = false, diff --git a/include/TabButton.h b/include/TabButton.h index d5d70fcac..6d58cc10e 100644 --- a/include/TabButton.h +++ b/include/TabButton.h @@ -45,7 +45,7 @@ public: SLOT( slotClicked() ) ); } - ~TabButton() + ~TabButton() override { } diff --git a/include/TabWidget.h b/include/TabWidget.h index fdd0123da..0f998e9e2 100644 --- a/include/TabWidget.h +++ b/include/TabWidget.h @@ -43,7 +43,7 @@ public: //! If false, all child widget will be cut down to the TabWidget's size TabWidget( const QString & _caption, QWidget * _parent, bool usePixmap = false, bool resizable = false ); - virtual ~TabWidget() = default; + ~TabWidget() override = default; void addTab( QWidget * w, const QString & name, const char *pixmap = nullptr, int idx = -1 ); diff --git a/include/TemplatesMenu.h b/include/TemplatesMenu.h index 45c7bce4b..7f425bd2f 100644 --- a/include/TemplatesMenu.h +++ b/include/TemplatesMenu.h @@ -37,7 +37,7 @@ class TemplatesMenu : public QMenu Q_OBJECT public: TemplatesMenu(QWidget *parent = nullptr); - virtual ~TemplatesMenu() = default; + ~TemplatesMenu() override = default; private slots: static void createNewProjectFromTemplate(QAction * _action); diff --git a/include/TempoSyncKnob.h b/include/TempoSyncKnob.h index 22a21f3dc..25a3b7e3b 100644 --- a/include/TempoSyncKnob.h +++ b/include/TempoSyncKnob.h @@ -42,7 +42,7 @@ class LMMS_EXPORT TempoSyncKnob : public Knob Q_OBJECT public: TempoSyncKnob( knobTypes knobNum, QWidget* parent = nullptr, const QString& name = QString() ); - virtual ~TempoSyncKnob(); + ~TempoSyncKnob() override; const QString & syncDescription(); void setSyncDescription( const QString & _new_description ); diff --git a/include/TextFloat.h b/include/TextFloat.h index 580c3b979..8a5ad9685 100644 --- a/include/TextFloat.h +++ b/include/TextFloat.h @@ -39,7 +39,7 @@ class LMMS_EXPORT TextFloat : public QWidget Q_OBJECT public: TextFloat(); - virtual ~TextFloat() + ~TextFloat() override { } diff --git a/include/TimeDisplayWidget.h b/include/TimeDisplayWidget.h index d8e38333a..33e23c222 100644 --- a/include/TimeDisplayWidget.h +++ b/include/TimeDisplayWidget.h @@ -39,7 +39,7 @@ class TimeDisplayWidget : public QWidget Q_OBJECT public: TimeDisplayWidget(); - virtual ~TimeDisplayWidget() = default; + ~TimeDisplayWidget() override = default; protected: diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index 4cbddcda4..bada25640 100644 --- a/include/TimeLineWidget.h +++ b/include/TimeLineWidget.h @@ -78,7 +78,7 @@ public: TimeLineWidget(int xoff, int yoff, float ppb, Song::PlayPos & pos, const TimePos & begin, Song::PlayModes mode, QWidget * parent); - virtual ~TimeLineWidget(); + ~TimeLineWidget() override; inline QColor const & getBarLineColor() const { return m_barLineColor; } inline void setBarLineColor(QColor const & barLineColor) { m_barLineColor = barLineColor; } diff --git a/include/ToolButton.h b/include/ToolButton.h index c6e80b4c2..c173a9052 100644 --- a/include/ToolButton.h +++ b/include/ToolButton.h @@ -43,7 +43,7 @@ public: QToolButton(_parent) { } - virtual ~ToolButton() = default; + ~ToolButton() override = default; } ; diff --git a/include/ToolPlugin.h b/include/ToolPlugin.h index 899c31906..311757cf4 100644 --- a/include/ToolPlugin.h +++ b/include/ToolPlugin.h @@ -38,7 +38,7 @@ class LMMS_EXPORT ToolPlugin : public Plugin { public: ToolPlugin( const Descriptor * _descriptor, Model * _parent ); - virtual ~ToolPlugin(); + ~ToolPlugin() override; // instantiate tool-plugin with given name or return NULL // on failure diff --git a/include/Track.h b/include/Track.h index ec069c38f..1cf3f94c2 100644 --- a/include/Track.h +++ b/include/Track.h @@ -85,7 +85,7 @@ public: } ; Track( TrackTypes type, TrackContainer * tc ); - virtual ~Track(); + ~Track() override; static Track * create( TrackTypes tt, TrackContainer * tc ); static Track * create( const QDomElement & element, diff --git a/include/TrackContainer.h b/include/TrackContainer.h index beb7564ad..c2344db85 100644 --- a/include/TrackContainer.h +++ b/include/TrackContainer.h @@ -57,7 +57,7 @@ public: } ; TrackContainer(); - virtual ~TrackContainer(); + ~TrackContainer() override; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index edcffeb2f..7d9a648aa 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -73,7 +73,7 @@ class TrackContainerView : public QWidget, public ModelView, Q_OBJECT public: TrackContainerView( TrackContainer* tc ); - virtual ~TrackContainerView(); + ~TrackContainerView() override; void saveSettings( QDomDocument & _doc, QDomElement & _this ) override; void loadSettings( const QDomElement & _this ) override; @@ -184,7 +184,7 @@ private: { public: scrollArea( TrackContainerView* parent ); - virtual ~scrollArea(); + ~scrollArea() override; protected: void wheelEvent( QWheelEvent * _we ) override; diff --git a/include/TrackContentWidget.h b/include/TrackContentWidget.h index 228a3e739..4fad4ceb0 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -56,7 +56,7 @@ class TrackContentWidget : public QWidget, public JournallingObject public: TrackContentWidget( TrackView * parent ); - virtual ~TrackContentWidget(); + ~TrackContentWidget() override; /*! \brief Updates the background tile pixmap. */ void updateBackground(); diff --git a/include/TrackLabelButton.h b/include/TrackLabelButton.h index 3be64adee..30dd60d59 100644 --- a/include/TrackLabelButton.h +++ b/include/TrackLabelButton.h @@ -41,7 +41,7 @@ class TrackLabelButton : public QToolButton Q_OBJECT public: TrackLabelButton( TrackView * _tv, QWidget * _parent ); - virtual ~TrackLabelButton(); + ~TrackLabelButton() override; public slots: diff --git a/include/TrackOperationsWidget.h b/include/TrackOperationsWidget.h index 92f1a889c..08b3e599e 100644 --- a/include/TrackOperationsWidget.h +++ b/include/TrackOperationsWidget.h @@ -40,7 +40,7 @@ class TrackOperationsWidget : public QWidget Q_OBJECT public: TrackOperationsWidget( TrackView * parent ); - ~TrackOperationsWidget(); + ~TrackOperationsWidget() override; protected: diff --git a/include/TrackView.h b/include/TrackView.h index 2f5c5ed28..f98579201 100644 --- a/include/TrackView.h +++ b/include/TrackView.h @@ -64,7 +64,7 @@ class TrackView : public QWidget, public ModelView, public JournallingObject Q_OBJECT public: TrackView( Track * _track, TrackContainerView* tcv ); - virtual ~TrackView(); + ~TrackView() override; inline const Track * getTrack() const { diff --git a/include/VstSyncController.h b/include/VstSyncController.h index 947a65ea2..d5e6617cd 100644 --- a/include/VstSyncController.h +++ b/include/VstSyncController.h @@ -40,7 +40,7 @@ class VstSyncController : public QObject Q_OBJECT public: VstSyncController(); - ~VstSyncController(); + ~VstSyncController() override; void setAbsolutePosition( double ticks ); diff --git a/include/embed.h b/include/embed.h index 5dd6a41a2..23aebccec 100644 --- a/include/embed.h +++ b/include/embed.h @@ -120,7 +120,7 @@ public: { } - virtual QPixmap pixmap() const + QPixmap pixmap() const override { if( !m_name.isEmpty() ) { @@ -130,7 +130,7 @@ public: return( QPixmap() ); } - virtual QString pixmapName() const + QString pixmapName() const override { return QString( STRINGIFY(PLUGIN_NAME) ) + "::" + m_name; } diff --git a/plugins/Amplifier/Amplifier.h b/plugins/Amplifier/Amplifier.h index 941971ae7..cc973cc27 100644 --- a/plugins/Amplifier/Amplifier.h +++ b/plugins/Amplifier/Amplifier.h @@ -37,10 +37,10 @@ class AmplifierEffect : public Effect { public: AmplifierEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ); - virtual ~AmplifierEffect(); - virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ); + ~AmplifierEffect() override; + bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ) override; - virtual EffectControls* controls() + EffectControls* controls() override { return &m_ampControls; } diff --git a/plugins/Amplifier/AmplifierControlDialog.h b/plugins/Amplifier/AmplifierControlDialog.h index 6362d5f72..fd2c7a338 100644 --- a/plugins/Amplifier/AmplifierControlDialog.h +++ b/plugins/Amplifier/AmplifierControlDialog.h @@ -42,7 +42,7 @@ class AmplifierControlDialog : public EffectControlDialog Q_OBJECT public: AmplifierControlDialog( AmplifierControls* controls ); - virtual ~AmplifierControlDialog() + ~AmplifierControlDialog() override { } diff --git a/plugins/Amplifier/AmplifierControls.h b/plugins/Amplifier/AmplifierControls.h index 7eaa0f099..6382b27fe 100644 --- a/plugins/Amplifier/AmplifierControls.h +++ b/plugins/Amplifier/AmplifierControls.h @@ -45,23 +45,23 @@ class AmplifierControls : public EffectControls Q_OBJECT public: AmplifierControls( AmplifierEffect* effect ); - virtual ~AmplifierControls() + ~AmplifierControls() override { } - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; + inline QString nodeName() const override { return "AmplifierControls"; } - virtual int controlCount() + int controlCount() override { return 4; } - virtual gui::EffectControlDialog* createView() + gui::EffectControlDialog* createView() override { return new gui::AmplifierControlDialog( this ); } diff --git a/plugins/BassBooster/BassBooster.h b/plugins/BassBooster/BassBooster.h index 9edca3b22..19eb9c50e 100644 --- a/plugins/BassBooster/BassBooster.h +++ b/plugins/BassBooster/BassBooster.h @@ -37,10 +37,10 @@ class BassBoosterEffect : public Effect { public: BassBoosterEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ); - virtual ~BassBoosterEffect(); - virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ); + ~BassBoosterEffect() override; + bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ) override; - virtual EffectControls* controls() + EffectControls* controls() override { return &m_bbControls; } diff --git a/plugins/BassBooster/BassBoosterControlDialog.h b/plugins/BassBooster/BassBoosterControlDialog.h index 89a60fa1a..968db7e60 100644 --- a/plugins/BassBooster/BassBoosterControlDialog.h +++ b/plugins/BassBooster/BassBoosterControlDialog.h @@ -40,7 +40,7 @@ class BassBoosterControlDialog : public EffectControlDialog Q_OBJECT public: BassBoosterControlDialog( BassBoosterControls* controls ); - virtual ~BassBoosterControlDialog() + ~BassBoosterControlDialog() override { } diff --git a/plugins/BassBooster/BassBoosterControls.h b/plugins/BassBooster/BassBoosterControls.h index c67ce4d7a..099862a02 100644 --- a/plugins/BassBooster/BassBoosterControls.h +++ b/plugins/BassBooster/BassBoosterControls.h @@ -39,23 +39,23 @@ class BassBoosterControls : public EffectControls Q_OBJECT public: BassBoosterControls( BassBoosterEffect* effect ); - virtual ~BassBoosterControls() + ~BassBoosterControls() override { } - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; + inline QString nodeName() const override { return "bassboostercontrols"; } - virtual int controlCount() + int controlCount() override { return 3; } - virtual gui::EffectControlDialog* createView() + gui::EffectControlDialog* createView() override { return new gui::BassBoosterControlDialog( this ); } diff --git a/plugins/BitInvader/BitInvader.h b/plugins/BitInvader/BitInvader.h index cce524beb..90a5dffa8 100644 --- a/plugins/BitInvader/BitInvader.h +++ b/plugins/BitInvader/BitInvader.h @@ -74,25 +74,25 @@ class BitInvader : public Instrument Q_OBJECT public: BitInvader(InstrumentTrack * _instrument_track ); - virtual ~BitInvader(); + ~BitInvader() override; - 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 f_cnt_t desiredReleaseFrames() const + f_cnt_t desiredReleaseFrames() const override { return( 64 ); } - virtual gui::PluginView * instantiateView( QWidget * _parent ); + gui::PluginView * instantiateView( QWidget * _parent ) override; protected slots: void lengthChanged(); @@ -124,7 +124,7 @@ public: BitInvaderView( Instrument * _instrument, QWidget * _parent ); - virtual ~BitInvaderView() {}; + ~BitInvaderView() override {}; protected slots: //void sampleSizeChanged( float _new_sample_length ); @@ -142,7 +142,7 @@ protected slots: void smoothClicked( void ); private: - virtual void modelChanged(); + void modelChanged() override; Knob * m_sampleLengthKnob; PixmapButton * m_sinWaveBtn; diff --git a/plugins/Bitcrush/Bitcrush.h b/plugins/Bitcrush/Bitcrush.h index 670742e20..a6e5556a2 100644 --- a/plugins/Bitcrush/Bitcrush.h +++ b/plugins/Bitcrush/Bitcrush.h @@ -40,10 +40,10 @@ class BitcrushEffect : public Effect { public: BitcrushEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ); - virtual ~BitcrushEffect(); - virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ); + ~BitcrushEffect() override; + bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ) override; - virtual EffectControls* controls() + EffectControls* controls() override { return &m_controls; } diff --git a/plugins/Bitcrush/BitcrushControlDialog.h b/plugins/Bitcrush/BitcrushControlDialog.h index 49d5bce7e..9649d50f2 100644 --- a/plugins/Bitcrush/BitcrushControlDialog.h +++ b/plugins/Bitcrush/BitcrushControlDialog.h @@ -43,7 +43,7 @@ class BitcrushControlDialog : public EffectControlDialog Q_OBJECT public: BitcrushControlDialog( BitcrushControls * controls ); - virtual ~BitcrushControlDialog() + ~BitcrushControlDialog() override { } }; diff --git a/plugins/Bitcrush/BitcrushControls.h b/plugins/Bitcrush/BitcrushControls.h index ed69dd704..963fb298e 100644 --- a/plugins/Bitcrush/BitcrushControls.h +++ b/plugins/Bitcrush/BitcrushControls.h @@ -40,21 +40,21 @@ class BitcrushControls : public EffectControls Q_OBJECT public: BitcrushControls( BitcrushEffect * eff ); - virtual ~BitcrushControls(); + ~BitcrushControls() override; - virtual void saveSettings( QDomDocument & doc, QDomElement & elem ); - virtual void loadSettings( const QDomElement & elem ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & doc, QDomElement & elem ) override; + void loadSettings( const QDomElement & elem ) override; + inline QString nodeName() const override { return( "bitcrushcontrols" ); } - virtual int controlCount() + int controlCount() override { return( 9 ); } - virtual gui::EffectControlDialog * createView() + gui::EffectControlDialog * createView() override { return( new gui::BitcrushControlDialog( this ) ); } diff --git a/plugins/CarlaBase/Carla.h b/plugins/CarlaBase/Carla.h index 2010ac3c4..e04444f91 100644 --- a/plugins/CarlaBase/Carla.h +++ b/plugins/CarlaBase/Carla.h @@ -93,7 +93,7 @@ public: return !reg.exactMatch(name); } - inline virtual void loadSettings(const QDomElement& element, const QString& name = QString("value")) override + inline void loadSettings(const QDomElement& element, const QString& name = QString("value")) override { AutomatableModel::loadSettings(element, name); bool mustQuote = mustQuoteName(name); @@ -104,7 +104,7 @@ public: } } - inline virtual void saveSettings(QDomDocument& doc, QDomElement& element, + inline void saveSettings(QDomDocument& doc, QDomElement& element, const QString& name = QString( "value" )) override { if (m_isEnabled) @@ -177,7 +177,7 @@ public: static const uint32_t kMaxMidiEvents = 512; CarlaInstrument(InstrumentTrack* const instrumentTrack, const Descriptor* const descriptor, const bool isPatchbay); - virtual ~CarlaInstrument(); + ~CarlaInstrument() override; // Carla NativeHostDescriptor functions uint32_t handleGetBufferSize() const; @@ -189,13 +189,13 @@ public: intptr_t handleDispatcher(const NativeHostDispatcherOpcode opcode, const int32_t index, const intptr_t value, void* const ptr, const float opt); // LMMS functions - virtual Flags flags() const; - virtual QString nodeName() const; - virtual void saveSettings(QDomDocument& doc, QDomElement& parent); - 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 gui::PluginView* instantiateView(QWidget* parent); + Flags flags() const override; + QString nodeName() const override; + void saveSettings(QDomDocument& doc, QDomElement& parent) override; + void loadSettings(const QDomElement& elem) override; + void play(sampleFrame* workingBuffer) override; + bool handleMidiEvent(const MidiEvent& event, const TimePos& time, f_cnt_t offset) override; + gui::PluginView* instantiateView(QWidget* parent) override; signals: void uiClosed(); @@ -255,7 +255,7 @@ public: setWindowFlags(windowFlags); } - virtual void resizeEvent(QResizeEvent * event) override + void resizeEvent(QResizeEvent * event) override { if (mousePress) { resizing = true; @@ -263,13 +263,13 @@ public: SubWindow::resizeEvent(event); } - virtual void mousePressEvent(QMouseEvent * event) override + void mousePressEvent(QMouseEvent * event) override { mousePress = true; SubWindow::mousePressEvent(event); } - virtual void mouseReleaseEvent(QMouseEvent * event) override + void mouseReleaseEvent(QMouseEvent * event) override { if (resizing) { resizing = false; @@ -279,7 +279,7 @@ public: SubWindow::mouseReleaseEvent(event); } - virtual void closeEvent(QCloseEvent * event) override + void closeEvent(QCloseEvent * event) override { emit uiClosed(); event->accept(); @@ -298,7 +298,7 @@ class CarlaInstrumentView : public InstrumentViewFixedSize public: CarlaInstrumentView(CarlaInstrument* const instrument, QWidget* const parent); - virtual ~CarlaInstrumentView(); + ~CarlaInstrumentView() override; private slots: void toggleUI(bool); @@ -307,8 +307,8 @@ private slots: void paramsUiClosed(); private: - virtual void modelChanged(); - virtual void timerEvent(QTimerEvent*); + void modelChanged() override; + void timerEvent(QTimerEvent*) override; NativePluginHandle fHandle; const NativePluginDescriptor* fDescriptor; @@ -333,7 +333,7 @@ class CarlaParamsView : public InstrumentView Q_OBJECT public: CarlaParamsView(CarlaInstrumentView* const instrumentView, QWidget* const parent); - virtual ~CarlaParamsView(); + ~CarlaParamsView() override; signals: void uiClosed(); diff --git a/plugins/CrossoverEQ/CrossoverEQ.h b/plugins/CrossoverEQ/CrossoverEQ.h index 4e5872f0c..fe9b4541b 100644 --- a/plugins/CrossoverEQ/CrossoverEQ.h +++ b/plugins/CrossoverEQ/CrossoverEQ.h @@ -39,10 +39,10 @@ class CrossoverEQEffect : public Effect { public: CrossoverEQEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ); - virtual ~CrossoverEQEffect(); - virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ); + ~CrossoverEQEffect() override; + bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ) override; - virtual EffectControls* controls() + EffectControls* controls() override { return &m_controls; } diff --git a/plugins/CrossoverEQ/CrossoverEQControlDialog.h b/plugins/CrossoverEQ/CrossoverEQControlDialog.h index f28366557..bad64a8bb 100644 --- a/plugins/CrossoverEQ/CrossoverEQControlDialog.h +++ b/plugins/CrossoverEQ/CrossoverEQControlDialog.h @@ -45,7 +45,7 @@ class CrossoverEQControlDialog : public EffectControlDialog Q_OBJECT public: CrossoverEQControlDialog( CrossoverEQControls * controls ); - virtual ~CrossoverEQControlDialog() + ~CrossoverEQControlDialog() override { } diff --git a/plugins/CrossoverEQ/CrossoverEQControls.h b/plugins/CrossoverEQ/CrossoverEQControls.h index 7f9417365..458300d89 100644 --- a/plugins/CrossoverEQ/CrossoverEQControls.h +++ b/plugins/CrossoverEQ/CrossoverEQControls.h @@ -40,21 +40,21 @@ class CrossoverEQControls : public EffectControls Q_OBJECT public: CrossoverEQControls( CrossoverEQEffect * eff ); - virtual ~CrossoverEQControls() {} + ~CrossoverEQControls() override {} - virtual void saveSettings( QDomDocument & doc, QDomElement & elem ); - virtual void loadSettings( const QDomElement & elem ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & doc, QDomElement & elem ) override; + void loadSettings( const QDomElement & elem ) override; + inline QString nodeName() const override { return( "crossoevereqcontrols" ); } - virtual int controlCount() + int controlCount() override { return( 11 ); } - virtual gui::EffectControlDialog * createView() + gui::EffectControlDialog * createView() override { return( new gui::CrossoverEQControlDialog( this ) ); } diff --git a/plugins/Delay/DelayControls.h b/plugins/Delay/DelayControls.h index 4f4b193f4..3d9393b76 100644 --- a/plugins/Delay/DelayControls.h +++ b/plugins/Delay/DelayControls.h @@ -40,19 +40,19 @@ class DelayControls : public EffectControls Q_OBJECT public: DelayControls( DelayEffect* effect ); - virtual ~DelayControls() + ~DelayControls() override { } - virtual void saveSettings( QDomDocument& doc, QDomElement& parent ); - virtual void loadSettings( const QDomElement& _this ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument& doc, QDomElement& parent ) override; + void loadSettings( const QDomElement& _this ) override; + inline QString nodeName() const override { return "Delay"; } - virtual int controlCount(){ + int controlCount() override{ return 5; } - virtual gui::EffectControlDialog* createView() + gui::EffectControlDialog* createView() override { return new gui::DelayControlsDialog( this ); } diff --git a/plugins/Delay/DelayControlsDialog.h b/plugins/Delay/DelayControlsDialog.h index 9ab349d4e..115287cda 100644 --- a/plugins/Delay/DelayControlsDialog.h +++ b/plugins/Delay/DelayControlsDialog.h @@ -42,7 +42,7 @@ class DelayControlsDialog : public EffectControlDialog Q_OBJECT public: DelayControlsDialog( DelayControls* controls ); - virtual ~DelayControlsDialog() + ~DelayControlsDialog() override { } }; @@ -52,13 +52,13 @@ class XyPad : public QWidget Q_OBJECT public: XyPad( QWidget *parent = 0, FloatModel *xModel = 0, FloatModel *yModel = 0 ); - ~XyPad() {} + ~XyPad() override {} protected: - virtual void paintEvent ( QPaintEvent * event ); - virtual void mousePressEvent(QMouseEvent * event ); - virtual void mouseReleaseEvent(QMouseEvent * event); - virtual void mouseMoveEvent(QMouseEvent * event); + void paintEvent ( QPaintEvent * event ) override; + void mousePressEvent(QMouseEvent * event ) override; + void mouseReleaseEvent(QMouseEvent * event) override; + void mouseMoveEvent(QMouseEvent * event) override; private: FloatModel *m_xModel; diff --git a/plugins/Delay/DelayEffect.h b/plugins/Delay/DelayEffect.h index 2757d6cc4..b6c090ff0 100644 --- a/plugins/Delay/DelayEffect.h +++ b/plugins/Delay/DelayEffect.h @@ -38,9 +38,9 @@ class DelayEffect : public Effect { public: DelayEffect(Model* parent , const Descriptor::SubPluginFeatures::Key* key ); - virtual ~DelayEffect(); - virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ); - virtual EffectControls* controls() + ~DelayEffect() override; + bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ) override; + EffectControls* controls() override { return &m_delayControls; } diff --git a/plugins/DualFilter/DualFilter.h b/plugins/DualFilter/DualFilter.h index bfc9dc81b..c179edbcc 100644 --- a/plugins/DualFilter/DualFilter.h +++ b/plugins/DualFilter/DualFilter.h @@ -39,10 +39,10 @@ class DualFilterEffect : public Effect { public: DualFilterEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ); - virtual ~DualFilterEffect(); - virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ); + ~DualFilterEffect() override; + bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ) override; - virtual EffectControls* controls() + EffectControls* controls() override { return &m_dfControls; } diff --git a/plugins/DualFilter/DualFilterControlDialog.h b/plugins/DualFilter/DualFilterControlDialog.h index a6ac46954..88b3fe17a 100644 --- a/plugins/DualFilter/DualFilterControlDialog.h +++ b/plugins/DualFilter/DualFilterControlDialog.h @@ -43,7 +43,7 @@ class DualFilterControlDialog : public EffectControlDialog Q_OBJECT public: DualFilterControlDialog( DualFilterControls* controls ); - virtual ~DualFilterControlDialog() + ~DualFilterControlDialog() override { } diff --git a/plugins/DualFilter/DualFilterControls.h b/plugins/DualFilter/DualFilterControls.h index 586b2d15a..a3676295d 100644 --- a/plugins/DualFilter/DualFilterControls.h +++ b/plugins/DualFilter/DualFilterControls.h @@ -42,23 +42,23 @@ class DualFilterControls : public EffectControls Q_OBJECT public: DualFilterControls( DualFilterEffect* effect ); - virtual ~DualFilterControls() + ~DualFilterControls() override { } - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; + inline QString nodeName() const override { return "DualFilterControls"; } - virtual int controlCount() + int controlCount() override { return 11; } - virtual gui::EffectControlDialog* createView() + gui::EffectControlDialog* createView() override { return new gui::DualFilterControlDialog( this ); } diff --git a/plugins/DynamicsProcessor/DynamicsProcessor.h b/plugins/DynamicsProcessor/DynamicsProcessor.h index 91763e682..576accdcc 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessor.h +++ b/plugins/DynamicsProcessor/DynamicsProcessor.h @@ -41,11 +41,11 @@ class DynProcEffect : public Effect public: DynProcEffect( Model * _parent, const Descriptor::SubPluginFeatures::Key * _key ); - virtual ~DynProcEffect(); - virtual bool processAudioBuffer( sampleFrame * _buf, - const fpp_t _frames ); + ~DynProcEffect() override; + bool processAudioBuffer( sampleFrame * _buf, + const fpp_t _frames ) override; - virtual EffectControls * controls() + EffectControls * controls() override { return( &m_dpControls ); } diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h b/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h index 0b4091b30..8b755620e 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h +++ b/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h @@ -43,7 +43,7 @@ class DynProcControlDialog : public EffectControlDialog Q_OBJECT public: DynProcControlDialog( DynProcControls * _controls ); - virtual ~DynProcControlDialog() + ~DynProcControlDialog() override { } diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControls.h b/plugins/DynamicsProcessor/DynamicsProcessorControls.h index cb9aebb6a..c68bdcc0c 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessorControls.h +++ b/plugins/DynamicsProcessor/DynamicsProcessorControls.h @@ -49,25 +49,25 @@ public: NumStereoModes }; DynProcControls( DynProcEffect * _eff ); - virtual ~DynProcControls() + ~DynProcControls() override { } - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; + inline QString nodeName() const override { return( "dynamicsprocessor_controls" ); } virtual void setDefaultShape(); - virtual int controlCount() + int controlCount() override { return( 6 ); } - virtual gui::EffectControlDialog * createView() + gui::EffectControlDialog * createView() override { return( new gui::DynProcControlDialog( this ) ); } diff --git a/plugins/Eq/EqControls.h b/plugins/Eq/EqControls.h index 8a2061cce..9b0d67742 100644 --- a/plugins/Eq/EqControls.h +++ b/plugins/Eq/EqControls.h @@ -44,25 +44,25 @@ class EqControls : public EffectControls Q_OBJECT public: explicit EqControls( EqEffect* effect ); - virtual ~EqControls() + ~EqControls() override { } - virtual void saveSettings ( QDomDocument& doc, QDomElement& parent ); + void saveSettings ( QDomDocument& doc, QDomElement& parent ) override; - virtual void loadSettings ( const QDomElement &_this ); + void loadSettings ( const QDomElement &_this ) override; - inline virtual QString nodeName() const + inline QString nodeName() const override { return "Eq"; } - virtual int controlCount() + int controlCount() override { return 42; } - virtual gui::EffectControlDialog* createView(); + gui::EffectControlDialog* createView() override; float m_inPeakL; float m_inPeakR; diff --git a/plugins/Eq/EqControlsDialog.h b/plugins/Eq/EqControlsDialog.h index 297737699..1ec7e3e9a 100644 --- a/plugins/Eq/EqControlsDialog.h +++ b/plugins/Eq/EqControlsDialog.h @@ -47,7 +47,7 @@ class EqControlsDialog : public EffectControlDialog Q_OBJECT public: EqControlsDialog( EqControls * controls ); - virtual ~EqControlsDialog() + ~EqControlsDialog() override { } @@ -57,7 +57,7 @@ private: EqControls * m_controls; EqParameterWidget * m_parameterWidget; - virtual void mouseDoubleClickEvent(QMouseEvent *event); + void mouseDoubleClickEvent(QMouseEvent *event) override; EqBand *setBand( int index, BoolModel *active, FloatModel *freq, FloatModel *res, FloatModel *gain, QColor color, QString name, float *peakL, float *peakR, BoolModel *hp12, BoolModel *hp24, BoolModel *hp48, BoolModel *lp12, BoolModel *lp24, BoolModel *lp48 ); diff --git a/plugins/Eq/EqCurve.h b/plugins/Eq/EqCurve.h index c7e7d0688..e01e30841 100644 --- a/plugins/Eq/EqCurve.h +++ b/plugins/Eq/EqCurve.h @@ -55,7 +55,7 @@ public: static float gainToYPixel( float gain, int h, float pixelPerUnitHeight ); static float yPixelToGain( float y, int h, float pixelPerUnitHeight ); - QRectF boundingRect() const; + QRectF boundingRect() const override; QPainterPath getCurvePath(); float getPeakCurve( float x ); float getHighShelfCurve( float x ); @@ -83,13 +83,13 @@ signals: void positionChanged(); protected: - void mousePressEvent( QGraphicsSceneMouseEvent *event ); - void mouseReleaseEvent( QGraphicsSceneMouseEvent *event ); - void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ); - void wheelEvent( QGraphicsSceneWheelEvent *wevent ); - void hoverEnterEvent( QGraphicsSceneHoverEvent *hevent ); - void hoverLeaveEvent( QGraphicsSceneHoverEvent *hevent ); - QVariant itemChange( GraphicsItemChange change, const QVariant &value ); + void mousePressEvent( QGraphicsSceneMouseEvent *event ) override; + void mouseReleaseEvent( QGraphicsSceneMouseEvent *event ) override; + void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ) override; + void wheelEvent( QGraphicsSceneWheelEvent *wevent ) override; + void hoverEnterEvent( QGraphicsSceneHoverEvent *hevent ) override; + void hoverLeaveEvent( QGraphicsSceneHoverEvent *hevent ) override; + QVariant itemChange( GraphicsItemChange change, const QVariant &value ) override; private: double calculateGain( const double freq, const double a1, const double a2, const double b0, const double b1, const double b2 ); @@ -120,11 +120,11 @@ class EqCurve : public QGraphicsObject Q_OBJECT public: EqCurve( QList *handle, int x, int y ); - QRectF boundingRect() const; + QRectF boundingRect() const override; void setModelChanged(bool mc); protected: - void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ); + void paint( QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget ) override; private: QList *m_handle; diff --git a/plugins/Eq/EqEffect.h b/plugins/Eq/EqEffect.h index 3697a11e2..e3bf6fd54 100644 --- a/plugins/Eq/EqEffect.h +++ b/plugins/Eq/EqEffect.h @@ -36,9 +36,9 @@ class EqEffect : public Effect { public: EqEffect( Model * parent , const Descriptor::SubPluginFeatures::Key * key ); - virtual ~EqEffect(); - virtual bool processAudioBuffer( sampleFrame * buf, const fpp_t frames ); - virtual EffectControls * controls() + ~EqEffect() override; + bool processAudioBuffer( sampleFrame * buf, const fpp_t frames ) override; + EffectControls * controls() override { return &m_eqControls; } diff --git a/plugins/Eq/EqFader.h b/plugins/Eq/EqFader.h index 1601081e9..aec6a9e18 100644 --- a/plugins/Eq/EqFader.h +++ b/plugins/Eq/EqFader.h @@ -72,7 +72,7 @@ public: - ~EqFader() + ~EqFader() override { } diff --git a/plugins/Eq/EqFilter.h b/plugins/Eq/EqFilter.h index 7361c751c..c64f6d5c3 100644 --- a/plugins/Eq/EqFilter.h +++ b/plugins/Eq/EqFilter.h @@ -181,7 +181,7 @@ protected: class EqHp12Filter : public EqFilter { public : - virtual void calcCoefficents() + void calcCoefficents() override { // calc intermediate @@ -226,7 +226,7 @@ public : class EqLp12Filter : public EqFilter { public : - virtual void calcCoefficents() + void calcCoefficents() override { // calc intermediate @@ -270,7 +270,7 @@ class EqPeakFilter : public EqFilter public: - virtual void calcCoefficents() + void calcCoefficents() override { // calc intermediate float w0 = F_2PI * m_freq / m_sampleRate; @@ -300,7 +300,7 @@ public: setCoeffs( a1, a2, b0, b1, b2 ); } - virtual inline void setParameters( float sampleRate, float freq, float bw, float gain ) + inline void setParameters( float sampleRate, float freq, float bw, float gain ) override { bool hasChanged = false; if( sampleRate != m_sampleRate ) @@ -334,7 +334,7 @@ public: class EqLowShelfFilter : public EqFilter { public : - virtual void calcCoefficents() + void calcCoefficents() override { // calc intermediate @@ -373,7 +373,7 @@ public : class EqHighShelfFilter : public EqFilter { public : - virtual void calcCoefficents() + void calcCoefficents() override { // calc intermediate diff --git a/plugins/Eq/EqParameterWidget.h b/plugins/Eq/EqParameterWidget.h index abfe5a9bb..f80499395 100644 --- a/plugins/Eq/EqParameterWidget.h +++ b/plugins/Eq/EqParameterWidget.h @@ -74,7 +74,7 @@ class EqParameterWidget : public QWidget Q_OBJECT public: explicit EqParameterWidget( QWidget *parent = 0, EqControls * controls = 0 ); - ~EqParameterWidget(); + ~EqParameterWidget() override; QList *m_handleList; const int bandCount() diff --git a/plugins/Eq/EqSpectrumView.h b/plugins/Eq/EqSpectrumView.h index c9bfebeb5..f0a8fda3c 100644 --- a/plugins/Eq/EqSpectrumView.h +++ b/plugins/Eq/EqSpectrumView.h @@ -74,7 +74,7 @@ class EqSpectrumView : public QWidget Q_OBJECT public: explicit EqSpectrumView( EqAnalyser *b, QWidget *_parent = 0 ); - virtual ~EqSpectrumView() + ~EqSpectrumView() override { } @@ -82,7 +82,7 @@ public: void setColor( const QColor &value ); protected: - virtual void paintEvent( QPaintEvent *event ); + void paintEvent( QPaintEvent *event ) override; private slots: void periodicalUpdate(); diff --git a/plugins/Flanger/FlangerControls.h b/plugins/Flanger/FlangerControls.h index 1d112bc99..b004e5e33 100644 --- a/plugins/Flanger/FlangerControls.h +++ b/plugins/Flanger/FlangerControls.h @@ -39,20 +39,20 @@ class FlangerControls : public EffectControls Q_OBJECT public: FlangerControls( FlangerEffect* effect ); - virtual ~FlangerControls() + ~FlangerControls() override { } - virtual void saveSettings ( QDomDocument& doc, QDomElement& parent ); - virtual void loadSettings ( const QDomElement &_this ); - inline virtual QString nodeName() const + void saveSettings ( QDomDocument& doc, QDomElement& parent ) override; + void loadSettings ( const QDomElement &_this ) override; + inline QString nodeName() const override { return "Flanger"; } - virtual int controlCount() + int controlCount() override { return 7; } - virtual gui::EffectControlDialog* createView() + gui::EffectControlDialog* createView() override { return new gui::FlangerControlsDialog( this ); } diff --git a/plugins/Flanger/FlangerControlsDialog.h b/plugins/Flanger/FlangerControlsDialog.h index 6aed1b6b4..587046ad7 100644 --- a/plugins/Flanger/FlangerControlsDialog.h +++ b/plugins/Flanger/FlangerControlsDialog.h @@ -42,7 +42,7 @@ class FlangerControlsDialog : public EffectControlDialog Q_OBJECT public: FlangerControlsDialog( FlangerControls* controls ); - virtual ~FlangerControlsDialog() + ~FlangerControlsDialog() override { } }; diff --git a/plugins/Flanger/FlangerEffect.h b/plugins/Flanger/FlangerEffect.h index d32429194..45dd5cafd 100644 --- a/plugins/Flanger/FlangerEffect.h +++ b/plugins/Flanger/FlangerEffect.h @@ -44,9 +44,9 @@ class FlangerEffect : public Effect { public: FlangerEffect( Model* parent , const Descriptor::SubPluginFeatures::Key* key ); - virtual ~FlangerEffect(); - virtual bool processAudioBuffer( sampleFrame *buf, const fpp_t frames ); - virtual EffectControls* controls() + ~FlangerEffect() override; + bool processAudioBuffer( sampleFrame *buf, const fpp_t frames ) override; + EffectControls* controls() override { return &m_flangerControls; } diff --git a/plugins/FreeBoy/FreeBoy.h b/plugins/FreeBoy/FreeBoy.h index 6f92b41e9..8b46a5e68 100644 --- a/plugins/FreeBoy/FreeBoy.h +++ b/plugins/FreeBoy/FreeBoy.h @@ -52,21 +52,21 @@ class FreeBoyInstrument : public Instrument public: FreeBoyInstrument( InstrumentTrack * _instrument_track ); - virtual ~FreeBoyInstrument(); + ~FreeBoyInstrument() override; - 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 f_cnt_t desiredReleaseFrames() const; + f_cnt_t desiredReleaseFrames() const override; - virtual gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; /*public slots: @@ -129,10 +129,10 @@ class FreeBoyInstrumentView : public InstrumentViewFixedSize Q_OBJECT public: FreeBoyInstrumentView( Instrument * _instrument, QWidget * _parent ); - virtual ~FreeBoyInstrumentView(); + ~FreeBoyInstrumentView() override; private: - virtual void modelChanged(); + void modelChanged() override; Knob * m_ch1SweepTimeKnob; PixmapButton * m_ch1SweepDirButton; diff --git a/plugins/GigPlayer/GigPlayer.h b/plugins/GigPlayer/GigPlayer.h index c192ee4ae..5adeddc3e 100644 --- a/plugins/GigPlayer/GigPlayer.h +++ b/plugins/GigPlayer/GigPlayer.h @@ -243,35 +243,35 @@ class GigInstrument : public Instrument public: GigInstrument( InstrumentTrack * _instrument_track ); - virtual ~GigInstrument(); + ~GigInstrument() override; - virtual void play( sampleFrame * _working_buffer ); + void play( sampleFrame * _working_buffer ) override; - 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 AutomatableModel * childModel( const QString & _modelName ); + AutomatableModel * childModel( const QString & _modelName ) override; - virtual QString nodeName() const; + QString nodeName() const override; - virtual f_cnt_t desiredReleaseFrames() const + f_cnt_t desiredReleaseFrames() const override { return 0; } - virtual Flags flags() const + Flags flags() const override { return IsSingleStreamed|IsNotBendable; } - virtual gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; QString getCurrentPatchName(); @@ -352,10 +352,10 @@ class GigInstrumentView : public InstrumentViewFixedSize public: GigInstrumentView( Instrument * _instrument, QWidget * _parent ); - virtual ~GigInstrumentView(); + ~GigInstrumentView() override; private: - virtual void modelChanged(); + void modelChanged() override; PixmapButton * m_fileDialogButton; PixmapButton * m_patchDialogButton; diff --git a/plugins/GigPlayer/PatchesDialog.cpp b/plugins/GigPlayer/PatchesDialog.cpp index a5066c2af..3f7035c61 100644 --- a/plugins/GigPlayer/PatchesDialog.cpp +++ b/plugins/GigPlayer/PatchesDialog.cpp @@ -42,7 +42,7 @@ public: : QTreeWidgetItem( pListView, pItemAfter ) {} // Sort/compare overriden method. - bool operator< ( const QTreeWidgetItem& other ) const + bool operator< ( const QTreeWidgetItem& other ) const override { int iColumn = QTreeWidgetItem::treeWidget()->sortColumn(); const QString& s1 = text( iColumn ); diff --git a/plugins/GigPlayer/PatchesDialog.h b/plugins/GigPlayer/PatchesDialog.h index c43b4cb5c..4912f2bc1 100644 --- a/plugins/GigPlayer/PatchesDialog.h +++ b/plugins/GigPlayer/PatchesDialog.h @@ -50,7 +50,7 @@ public: PatchesDialog(QWidget * pParent = 0, Qt::WindowFlags wflags = QFlag(0)); // Destructor. - virtual ~PatchesDialog(); + ~PatchesDialog() override; void setup( GigInstance * pSynth, int iChan, const QString & chanName, @@ -64,8 +64,8 @@ public slots: protected slots: - void accept(); - void reject(); + void accept() override; + void reject() override; protected: diff --git a/plugins/HydrogenImport/HydrogenImport.h b/plugins/HydrogenImport/HydrogenImport.h index 657d61f0c..a9398d18f 100644 --- a/plugins/HydrogenImport/HydrogenImport.h +++ b/plugins/HydrogenImport/HydrogenImport.h @@ -15,14 +15,14 @@ public: HydrogenImport( const QString & _file ); bool readSong(); - virtual ~HydrogenImport(); + ~HydrogenImport() override; - virtual gui::PluginView* instantiateView( QWidget * ) + gui::PluginView* instantiateView( QWidget * ) override { return( nullptr ); } private: - virtual bool tryImport( TrackContainer* tc ); + bool tryImport( TrackContainer* tc ) override; }; diff --git a/plugins/Kicker/Kicker.h b/plugins/Kicker/Kicker.h index f48a5ab12..10c77fe0f 100644 --- a/plugins/Kicker/Kicker.h +++ b/plugins/Kicker/Kicker.h @@ -54,28 +54,28 @@ class KickerInstrument : public Instrument Q_OBJECT public: KickerInstrument( InstrumentTrack * _instrument_track ); - virtual ~KickerInstrument(); + ~KickerInstrument() override; - 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; } - virtual f_cnt_t desiredReleaseFrames() const + f_cnt_t desiredReleaseFrames() const override { return( 512 ); } - virtual gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; private: @@ -109,10 +109,10 @@ class KickerInstrumentView : public InstrumentViewFixedSize Q_OBJECT public: KickerInstrumentView( Instrument * _instrument, QWidget * _parent ); - virtual ~KickerInstrumentView(); + ~KickerInstrumentView() override; private: - virtual void modelChanged(); + void modelChanged() override; Knob * m_startFreqKnob; Knob * m_endFreqKnob; diff --git a/plugins/LadspaBrowser/LadspaBrowser.h b/plugins/LadspaBrowser/LadspaBrowser.h index f1f88872c..93533906e 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.h +++ b/plugins/LadspaBrowser/LadspaBrowser.h @@ -46,7 +46,7 @@ class LadspaBrowserView : public ToolPluginView Q_OBJECT public: LadspaBrowserView( ToolPlugin * _tool ); - virtual ~LadspaBrowserView(); + ~LadspaBrowserView() override; public slots: @@ -69,22 +69,22 @@ class LadspaBrowser : public ToolPlugin { public: LadspaBrowser(); - virtual ~LadspaBrowser(); + ~LadspaBrowser() override; - virtual gui::PluginView* instantiateView( QWidget * ) + gui::PluginView* instantiateView( QWidget * ) override { return new gui::LadspaBrowserView( this ); } - virtual QString nodeName() const; + QString nodeName() const override; - virtual void saveSettings( QDomDocument& doc, QDomElement& element ) + void saveSettings( QDomDocument& doc, QDomElement& element ) override { Q_UNUSED(doc) Q_UNUSED(element) } - virtual void loadSettings( const QDomElement& element ) + void loadSettings( const QDomElement& element ) override { Q_UNUSED(element) } diff --git a/plugins/LadspaBrowser/LadspaDescription.h b/plugins/LadspaBrowser/LadspaDescription.h index 0e54acd32..1d2b03fac 100644 --- a/plugins/LadspaBrowser/LadspaDescription.h +++ b/plugins/LadspaBrowser/LadspaDescription.h @@ -44,7 +44,7 @@ class LadspaDescription : public QWidget Q_OBJECT public: LadspaDescription( QWidget * _parent, LadspaPluginType _type ); - virtual ~LadspaDescription(); + ~LadspaDescription() override; signals: diff --git a/plugins/LadspaBrowser/LadspaPortDialog.h b/plugins/LadspaBrowser/LadspaPortDialog.h index 1473b1ecf..3f7d83df7 100644 --- a/plugins/LadspaBrowser/LadspaPortDialog.h +++ b/plugins/LadspaBrowser/LadspaPortDialog.h @@ -40,7 +40,7 @@ class LadspaPortDialog : public QDialog Q_OBJECT public: LadspaPortDialog( const ladspa_key_t & _key ); - virtual ~LadspaPortDialog(); + ~LadspaPortDialog() override; }; diff --git a/plugins/LadspaEffect/LadspaControlDialog.h b/plugins/LadspaEffect/LadspaControlDialog.h index 3a102599b..25df5ee11 100644 --- a/plugins/LadspaEffect/LadspaControlDialog.h +++ b/plugins/LadspaEffect/LadspaControlDialog.h @@ -50,7 +50,7 @@ class LadspaControlDialog : public EffectControlDialog Q_OBJECT public: LadspaControlDialog( LadspaControls * _ctl ); - ~LadspaControlDialog(); + ~LadspaControlDialog() override; private slots: diff --git a/plugins/LadspaEffect/LadspaControls.h b/plugins/LadspaEffect/LadspaControls.h index e8f8863cf..b84202012 100644 --- a/plugins/LadspaEffect/LadspaControls.h +++ b/plugins/LadspaEffect/LadspaControls.h @@ -43,21 +43,21 @@ class LadspaControls : public EffectControls Q_OBJECT public: LadspaControls( LadspaEffect * _eff ); - virtual ~LadspaControls(); + ~LadspaControls() override; - inline int controlCount() + inline int controlCount() override { return m_controlCount; } - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; + inline QString nodeName() const override { return "ladspacontrols"; } - virtual gui::EffectControlDialog* createView() + gui::EffectControlDialog* createView() override { return new gui::LadspaControlDialog( this ); } diff --git a/plugins/LadspaEffect/LadspaEffect.h b/plugins/LadspaEffect/LadspaEffect.h index 153e2adeb..0bb0f2126 100644 --- a/plugins/LadspaEffect/LadspaEffect.h +++ b/plugins/LadspaEffect/LadspaEffect.h @@ -46,14 +46,14 @@ class LadspaEffect : public Effect public: LadspaEffect( Model * _parent, const Descriptor::SubPluginFeatures::Key * _key ); - virtual ~LadspaEffect(); + ~LadspaEffect() override; - virtual bool processAudioBuffer( sampleFrame * _buf, - const fpp_t _frames ); + bool processAudioBuffer( sampleFrame * _buf, + const fpp_t _frames ) override; void setControl( int _control, LADSPA_Data _data ); - virtual EffectControls * controls() + EffectControls * controls() override { return m_controls; } diff --git a/plugins/LadspaEffect/LadspaSubPluginFeatures.h b/plugins/LadspaEffect/LadspaSubPluginFeatures.h index 36edeebd3..c65dce9fe 100644 --- a/plugins/LadspaEffect/LadspaSubPluginFeatures.h +++ b/plugins/LadspaEffect/LadspaSubPluginFeatures.h @@ -44,7 +44,7 @@ public: void fillDescriptionWidget( QWidget * _parent, const Key * _key ) const override; - virtual void listSubPluginKeys( const Plugin::Descriptor * _desc, + void listSubPluginKeys( const Plugin::Descriptor * _desc, KeyList & _kl ) const override; diff --git a/plugins/Lb302/Lb302.h b/plugins/Lb302/Lb302.h index 550c3d00a..770fb451e 100644 --- a/plugins/Lb302/Lb302.h +++ b/plugins/Lb302/Lb302.h @@ -92,11 +92,11 @@ class Lb302FilterIIR2 : public Lb302Filter { public: Lb302FilterIIR2(Lb302FilterKnobState* p_fs); - virtual ~Lb302FilterIIR2(); + ~Lb302FilterIIR2() override; - virtual void recalc(); - virtual void envRecalc(); - virtual float process(const float& samp); + void recalc() override; + void envRecalc() override; + float process(const float& samp) override; protected: float vcf_d1, // d1 and d2 are added back into the sample with @@ -118,9 +118,9 @@ class Lb302Filter3Pole : public Lb302Filter Lb302Filter3Pole(Lb302FilterKnobState* p_fs); //virtual void recalc(); - virtual void envRecalc(); - virtual void recalc(); - virtual float process(const float& samp); + void envRecalc() override; + void recalc() override; + float process(const float& samp) override; protected: float kfcn, @@ -150,30 +150,30 @@ class Lb302Synth : public Instrument Q_OBJECT public: Lb302Synth( InstrumentTrack * _instrument_track ); - virtual ~Lb302Synth(); + ~Lb302Synth() override; - virtual void play( sampleFrame * _working_buffer ); - virtual void playNote( NotePlayHandle * _n, - sampleFrame * _working_buffer ); - virtual void deleteNotePluginData( NotePlayHandle * _n ); + void play( sampleFrame * _working_buffer ) override; + 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 IsSingleStreamed; } - virtual f_cnt_t desiredReleaseFrames() const + f_cnt_t desiredReleaseFrames() const override { return 0; //4048; } - virtual gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; private: void processNote( NotePlayHandle * n ); @@ -277,10 +277,10 @@ class Lb302SynthView : public InstrumentViewFixedSize public: Lb302SynthView( Instrument * _instrument, QWidget * _parent ); - virtual ~Lb302SynthView(); + ~Lb302SynthView() override; private: - virtual void modelChanged(); + void modelChanged() override; Knob * m_vcfCutKnob; Knob * m_vcfResKnob; diff --git a/plugins/MidiExport/MidiExport.h b/plugins/MidiExport/MidiExport.h index f443c965f..ccbb370ca 100644 --- a/plugins/MidiExport/MidiExport.h +++ b/plugins/MidiExport/MidiExport.h @@ -63,16 +63,16 @@ class MidiExport: public ExportFilter // Q_OBJECT public: MidiExport(); - ~MidiExport(); + ~MidiExport() override; - virtual gui::PluginView* instantiateView(QWidget *) + gui::PluginView* instantiateView(QWidget *) override { return nullptr; } - virtual bool tryExport(const TrackContainer::TrackList &tracks, + bool tryExport(const TrackContainer::TrackList &tracks, const TrackContainer::TrackList &patternTracks, - int tempo, int masterPitch, const QString &filename); + int tempo, int masterPitch, const QString &filename) override; private: void writeMidiClip(MidiNoteVector &midiClip, const QDomNode& n, diff --git a/plugins/MidiImport/MidiImport.h b/plugins/MidiImport/MidiImport.h index a7ab478a2..bb2893116 100644 --- a/plugins/MidiImport/MidiImport.h +++ b/plugins/MidiImport/MidiImport.h @@ -41,16 +41,16 @@ class MidiImport : public ImportFilter Q_OBJECT public: MidiImport( const QString & _file ); - virtual ~MidiImport(); + ~MidiImport() override; - virtual gui::PluginView* instantiateView( QWidget * ) + gui::PluginView* instantiateView( QWidget * ) override { return( nullptr ); } private: - virtual bool tryImport( TrackContainer* tc ); + bool tryImport( TrackContainer* tc ) override; bool readSMF( TrackContainer* tc ); bool readRIFF( TrackContainer* tc ); diff --git a/plugins/MidiImport/portsmf/allegro.h b/plugins/MidiImport/portsmf/allegro.h index 698801f78..e21a8f817 100644 --- a/plugins/MidiImport/portsmf/allegro.h +++ b/plugins/MidiImport/portsmf/allegro.h @@ -293,26 +293,26 @@ public: typedef class Alg_note : public Alg_event { public: - virtual ~Alg_note(); + ~Alg_note() override; Alg_note(Alg_note *); // copy constructor float pitch; // pitch in semitones (69 = A440) float loud; // dynamic corresponding to MIDI velocity double dur; // duration in seconds (normally to release point) Alg_parameters_ptr parameters; // attribute/value pair list Alg_note() { type = 'n'; parameters = nullptr; } - void show(); + void show() override; } *Alg_note_ptr; typedef class Alg_update : public Alg_event { public: - virtual ~Alg_update() {}; + ~Alg_update() override {}; Alg_update(Alg_update *); // copy constructor Alg_parameter parameter; // an update contains one attr/value pair Alg_update() { type = 'u'; } - void show(); + void show() override; } *Alg_update_ptr; @@ -402,7 +402,7 @@ public: // The destructor does not free events because they are owned // by a track or seq structure. - virtual ~Alg_event_list(); + ~Alg_event_list() override; // Returns the duration of the sequence in beats or seconds double get_beat_dur() { return beat_dur; } @@ -548,7 +548,7 @@ public: // setting buffer, but it is not the Serial_read_buffer's responsibility // to delete the buffer (owner might want to reuse it), so the destructor // does nothing. - virtual ~Serial_read_buffer() { } + ~Serial_read_buffer() override { } #if defined(_WIN32) //#pragma warning(disable: 546) // cast to int is OK, we only want low 7 bits //#pragma warning(disable: 4311) // type cast pointer to long warning @@ -588,7 +588,7 @@ typedef class Serial_write_buffer: public Serial_buffer { // This destructor will only run when the program exits, which will only // add overhead to the exit process, but it will eliminate an incorrect // report of memory leakage from automation that doesn't know better. -RBD - virtual ~Serial_write_buffer() { + ~Serial_write_buffer() override { if (buffer) delete [] buffer; } void init_for_write() { ptr = buffer; } @@ -654,7 +654,7 @@ protected: public: void serialize_track(); void unserialize_track(); - virtual Alg_event_ptr const &operator[](int i) { + Alg_event_ptr const &operator[](int i) override { assert(i >= 0 && i < len); return events[i]; } @@ -669,7 +669,7 @@ public: // copy constructor: event_list is copied, map is installed and referenced Alg_track(Alg_event_list_ref event_list, Alg_time_map_ptr map, bool units_are_seconds); - virtual ~Alg_track() { // note: do not call set_time_map(NULL)! + ~Alg_track() override { // note: do not call set_time_map(NULL)! if (time_map) time_map->dereference(); time_map = nullptr; } @@ -1030,11 +1030,11 @@ public: Alg_seq(std::istream &file, bool smf, double *offset_ptr = nullptr); // create from filename Alg_seq(const char *filename, bool smf, double *offset_ptr = nullptr); - virtual ~Alg_seq(); + ~Alg_seq() override; int get_read_error() { return error; } - void serialize(void **buffer, long *bytes); + void serialize(void **buffer, long *bytes) override; void copy_time_sigs_to(Alg_seq *dest); // a utility function - void set_time_map(Alg_time_map *map); + void set_time_map(Alg_time_map *map) override; // encode sequence structure into contiguous, moveable memory block // address of newly allocated memory is assigned to *buffer, which must @@ -1060,22 +1060,22 @@ public: // caller must not delete the result. Alg_track_ptr track(int); - virtual Alg_event_ptr const &operator[](int i); + Alg_event_ptr const &operator[](int i) override; - virtual void convert_to_seconds(); - virtual void convert_to_beats(); + void convert_to_seconds() override; + void convert_to_beats() override; Alg_track_ptr cut_from_track(int track_num, double start, double dur, bool all); - Alg_seq *cut(double t, double len, bool all); + Alg_seq *cut(double t, double len, bool all) override; void insert_silence_in_track(int track_num, double t, double len); - void insert_silence(double t, double len); + void insert_silence(double t, double len) override; Alg_track_ptr copy_track(int track_num, double t, double len, bool all); - Alg_seq *copy(double start, double len, bool all); + Alg_seq *copy(double start, double len, bool all) override; void paste(double start, Alg_seq *seq); - virtual void clear(double t, double len, bool all); - virtual void merge(double t, Alg_event_list_ptr seq); - virtual void silence(double t, double len, bool all); + void clear(double t, double len, bool all) override; + void merge(double t, Alg_event_list_ptr seq) override; + void silence(double t, double len, bool all) override; void clear_track(int track_num, double start, double len, bool all); void silence_track(int track_num, double start, double len, bool all); Alg_event_list_ptr find_in_track(int track_num, double t, double len, @@ -1100,7 +1100,7 @@ public: // add_event takes a pointer to an event on the heap. The event is not // copied, and this Alg_seq becomes the owner and freer of the event. void add_event(Alg_event_ptr event, int track_num); - void add(Alg_event_ptr event) { assert(false); } // call add_event instead + void add(Alg_event_ptr event) override { assert(false); } // call add_event instead // get the tempo starting at beat double get_tempo(double beat); bool set_tempo(double bpm, double start_beat, double end_beat); @@ -1112,7 +1112,7 @@ public: double *num, double *den); // void set_events(Alg_event_ptr *events, long len, long max); void merge_tracks(); // move all track data into one track - void set_in_use(bool flag); // set in_use flag on all tracks + void set_in_use(bool flag) override; // set in_use flag on all tracks } *Alg_seq_ptr, &Alg_seq_ref; diff --git a/plugins/MidiImport/portsmf/allegrosmfrd.cpp b/plugins/MidiImport/portsmf/allegrosmfrd.cpp index a221ca11b..388f4c9c9 100644 --- a/plugins/MidiImport/portsmf/allegrosmfrd.cpp +++ b/plugins/MidiImport/portsmf/allegrosmfrd.cpp @@ -65,36 +65,36 @@ protected: double get_time(); void update(int chan, int key, Alg_parameter_ptr param); - void *Mf_malloc(size_t size) { return malloc(size); } - void Mf_free(void *obj, size_t size) { free(obj); } + void *Mf_malloc(size_t size) override { return malloc(size); } + void Mf_free(void *obj, size_t size) override { free(obj); } /* Methods to be called while processing the MIDI file. */ - void Mf_starttrack(); - void Mf_endtrack(); - int Mf_getc(); - void Mf_chanprefix(int chan); - void Mf_portprefix(int port); - void Mf_eot(); - void Mf_error(char *); + void Mf_starttrack() override; + void Mf_endtrack() override; + int Mf_getc() override; + void Mf_chanprefix(int chan) override; + void Mf_portprefix(int port) override; + void Mf_eot() override; + void Mf_error(char *) override; void Mf_error(const char *); - void Mf_header(int,int,int); - void Mf_on(int,int,int); - void Mf_off(int,int,int); - void Mf_pressure(int,int,int); - void Mf_controller(int,int,int); - void Mf_pitchbend(int,int,int); - void Mf_program(int,int); - void Mf_chanpressure(int,int); + void Mf_header(int,int,int) override; + void Mf_on(int,int,int) override; + void Mf_off(int,int,int) override; + void Mf_pressure(int,int,int) override; + void Mf_controller(int,int,int) override; + void Mf_pitchbend(int,int,int) override; + void Mf_program(int,int) override; + void Mf_chanpressure(int,int) override; void binary_msg(int len, unsigned char *msg, const char *attr_string); - void Mf_sysex(int,unsigned char*); - void Mf_arbitrary(int,unsigned char*); - void Mf_metamisc(int,int,unsigned char*); - void Mf_seqnum(int); - void Mf_smpte(int,int,int,int,int); - void Mf_timesig(int,int,int,int); - void Mf_tempo(int); - void Mf_keysig(int,int); - void Mf_sqspecific(int,unsigned char*); - void Mf_text(int,int,unsigned char*); + void Mf_sysex(int,unsigned char*) override; + void Mf_arbitrary(int,unsigned char*) override; + void Mf_metamisc(int,int,unsigned char*) override; + void Mf_seqnum(int) override; + void Mf_smpte(int,int,int,int,int) override; + void Mf_timesig(int,int,int,int) override; + void Mf_tempo(int) override; + void Mf_keysig(int,int) override; + void Mf_sqspecific(int,unsigned char*) override; + void Mf_text(int,int,unsigned char*) override; }; diff --git a/plugins/Monstro/Monstro.h b/plugins/Monstro/Monstro.h index d6b57cfae..52f607a32 100644 --- a/plugins/Monstro/Monstro.h +++ b/plugins/Monstro/Monstro.h @@ -355,21 +355,21 @@ class MonstroInstrument : public Instrument public: MonstroInstrument( InstrumentTrack * _instrument_track ); - virtual ~MonstroInstrument(); + ~MonstroInstrument() override; - 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 & _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; - virtual f_cnt_t desiredReleaseFrames() const; + f_cnt_t desiredReleaseFrames() const override; - virtual gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; public slots: void updateVolume1(); @@ -593,13 +593,13 @@ class MonstroView : public InstrumentViewFixedSize public: MonstroView( Instrument * _instrument, QWidget * _parent ); - virtual ~MonstroView(); + ~MonstroView() override; protected slots: void updateLayout(); private: - virtual void modelChanged(); + void modelChanged() override; void setWidgetBackground( QWidget * _widget, const QString & _pic ); QWidget * setupOperatorsView( QWidget * _parent ); diff --git a/plugins/MultitapEcho/MultitapEcho.h b/plugins/MultitapEcho/MultitapEcho.h index 3d6772d24..6145b9f86 100644 --- a/plugins/MultitapEcho/MultitapEcho.h +++ b/plugins/MultitapEcho/MultitapEcho.h @@ -39,10 +39,10 @@ class MultitapEchoEffect : public Effect { public: MultitapEchoEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ); - virtual ~MultitapEchoEffect(); - virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ); + ~MultitapEchoEffect() override; + bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ) override; - virtual EffectControls* controls() + EffectControls* controls() override { return &m_controls; } diff --git a/plugins/MultitapEcho/MultitapEchoControlDialog.h b/plugins/MultitapEcho/MultitapEchoControlDialog.h index 6104d433e..0989046c1 100644 --- a/plugins/MultitapEcho/MultitapEchoControlDialog.h +++ b/plugins/MultitapEcho/MultitapEchoControlDialog.h @@ -44,7 +44,7 @@ class MultitapEchoControlDialog : public EffectControlDialog Q_OBJECT public: MultitapEchoControlDialog( MultitapEchoControls * controls ); - virtual ~MultitapEchoControlDialog() + ~MultitapEchoControlDialog() override { } }; diff --git a/plugins/MultitapEcho/MultitapEchoControls.h b/plugins/MultitapEcho/MultitapEchoControls.h index 65311c157..7ded68cc8 100644 --- a/plugins/MultitapEcho/MultitapEchoControls.h +++ b/plugins/MultitapEcho/MultitapEchoControls.h @@ -41,11 +41,11 @@ class MultitapEchoControls : public EffectControls Q_OBJECT public: MultitapEchoControls( MultitapEchoEffect * eff ); - virtual ~MultitapEchoControls(); + ~MultitapEchoControls() override; - virtual void saveSettings( QDomDocument & doc, QDomElement & parent ); - virtual void loadSettings( const QDomElement & elem ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & doc, QDomElement & parent ) override; + void loadSettings( const QDomElement & elem ) override; + inline QString nodeName() const override { return( "multitapechocontrols" ); } @@ -53,12 +53,12 @@ public: void setDefaultAmpShape(); void setDefaultLpShape(); - virtual int controlCount() + int controlCount() override { return( 5 ); } - virtual gui::EffectControlDialog* createView() + gui::EffectControlDialog* createView() override { return( new gui::MultitapEchoControlDialog( this ) ); } diff --git a/plugins/Nes/Nes.h b/plugins/Nes/Nes.h index f57cca9e7..41e7b0d7f 100644 --- a/plugins/Nes/Nes.h +++ b/plugins/Nes/Nes.h @@ -211,25 +211,25 @@ class NesInstrument : public Instrument Q_OBJECT public: NesInstrument( InstrumentTrack * instrumentTrack ); - virtual ~NesInstrument(); + ~NesInstrument() override; - virtual void playNote( NotePlayHandle * n, - sampleFrame * workingBuffer ); - virtual void deleteNotePluginData( NotePlayHandle * n ); + void playNote( NotePlayHandle * n, + sampleFrame * workingBuffer ) override; + void deleteNotePluginData( NotePlayHandle * n ) override; - virtual void saveSettings( QDomDocument & doc, - QDomElement & element ); - virtual void loadSettings( const QDomElement & element ); + void saveSettings( QDomDocument & doc, + QDomElement & element ) override; + void loadSettings( const QDomElement & element ) override; - virtual QString nodeName() const; + QString nodeName() const override; - virtual f_cnt_t desiredReleaseFrames() const + f_cnt_t desiredReleaseFrames() const override { return( 8 ); } - virtual gui::PluginView* instantiateView( QWidget * parent ); + gui::PluginView* instantiateView( QWidget * parent ) override; public slots: void updateFreq1(); @@ -313,10 +313,10 @@ class NesInstrumentView : public InstrumentViewFixedSize public: NesInstrumentView( Instrument * instrument, QWidget * parent ); - virtual ~NesInstrumentView(); + ~NesInstrumentView() override; private: - virtual void modelChanged(); + void modelChanged() override; // channel 1 PixmapButton * m_ch1EnabledBtn; diff --git a/plugins/OpulenZ/OpulenZ.h b/plugins/OpulenZ/OpulenZ.h index f2a13ffe0..1f999252f 100644 --- a/plugins/OpulenZ/OpulenZ.h +++ b/plugins/OpulenZ/OpulenZ.h @@ -59,24 +59,24 @@ class OpulenzInstrument : public Instrument Q_OBJECT public: OpulenzInstrument( InstrumentTrack * _instrument_track ); - virtual ~OpulenzInstrument(); + ~OpulenzInstrument() override; - virtual QString nodeName() const; - virtual gui::PluginView* instantiateView( QWidget * _parent ); + QString nodeName() const override; + gui::PluginView* instantiateView( QWidget * _parent ) override; - virtual Flags flags() const + Flags flags() const override { return IsSingleStreamed | IsMidiBased; } - virtual bool handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset = 0 ); - virtual void play( sampleFrame * _working_buffer ); + bool handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset = 0 ) override; + void play( sampleFrame * _working_buffer ) override; - void saveSettings( QDomDocument & _doc, QDomElement & _this ); - void loadSettings( const QDomElement & _this ); + void saveSettings( QDomDocument & _doc, QDomElement & _this ) override; + void loadSettings( const QDomElement & _this ) override; void loadPatch(const unsigned char inst[14]); void tuneEqual(int center, float Hz); - virtual void loadFile( const QString& file ); + void loadFile( const QString& file ) override; IntModel m_patchModel; @@ -163,9 +163,9 @@ class OpulenzInstrumentView : public InstrumentViewFixedSize Q_OBJECT public: OpulenzInstrumentView( Instrument * _instrument, QWidget * _parent ); - virtual ~OpulenzInstrumentView(); + ~OpulenzInstrumentView() override; LcdSpinBox *m_patch; - void modelChanged(); + void modelChanged() override; Knob *op1_a_kn; Knob *op1_d_kn; diff --git a/plugins/Organic/Organic.h b/plugins/Organic/Organic.h index b2f5ed518..bc951ad49 100644 --- a/plugins/Organic/Organic.h +++ b/plugins/Organic/Organic.h @@ -105,7 +105,7 @@ private: float m_phaseOffsetRight; OscillatorObject( Model * _parent, int _index ); - virtual ~OscillatorObject(); + ~OscillatorObject() override; friend class OrganicInstrument; friend class gui::OrganicInstrumentView; @@ -124,17 +124,17 @@ class OrganicInstrument : public Instrument Q_OBJECT public: OrganicInstrument( InstrumentTrack * _instrument_track ); - virtual ~OrganicInstrument(); + ~OrganicInstrument() override; - 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; int intRand( int min, int max ); @@ -172,7 +172,7 @@ private: FloatModel m_fx1Model; FloatModel m_volModel; - virtual gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; private slots: @@ -190,10 +190,10 @@ class OrganicInstrumentView : public InstrumentViewFixedSize Q_OBJECT public: OrganicInstrumentView( Instrument * _instrument, QWidget * _parent ); - virtual ~OrganicInstrumentView(); + ~OrganicInstrumentView() override; private: - virtual void modelChanged(); + void modelChanged() override; struct OscillatorKnobs { diff --git a/plugins/Patman/Patman.h b/plugins/Patman/Patman.h index 5088068df..206c2e503 100644 --- a/plugins/Patman/Patman.h +++ b/plugins/Patman/Patman.h @@ -57,26 +57,26 @@ class PatmanInstrument : public Instrument Q_OBJECT public: PatmanInstrument( InstrumentTrack * _track ); - virtual ~PatmanInstrument(); + ~PatmanInstrument() override; - 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( void ) const; + QString nodeName( void ) const override; - virtual f_cnt_t desiredReleaseFrames( void ) const + f_cnt_t desiredReleaseFrames( void ) const override { return( 128 ); } - virtual gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; public slots: @@ -131,7 +131,7 @@ class PatmanView : public InstrumentViewFixedSize Q_OBJECT public: PatmanView( Instrument * _instrument, QWidget * _parent ); - virtual ~PatmanView(); + ~PatmanView() override; public slots: @@ -140,13 +140,13 @@ public slots: protected: - virtual void dragEnterEvent( QDragEnterEvent * _dee ); - virtual void dropEvent( QDropEvent * _de ); - virtual void paintEvent( QPaintEvent * ); + void dragEnterEvent( QDragEnterEvent * _dee ) override; + void dropEvent( QDropEvent * _de ) override; + void paintEvent( QPaintEvent * ) override; private: - virtual void modelChanged( void ); + void modelChanged( void ) override; PatmanInstrument * m_pi; QString m_displayFilename; diff --git a/plugins/PeakControllerEffect/PeakControllerEffect.h b/plugins/PeakControllerEffect/PeakControllerEffect.h index 3d944a1a6..f2bafedda 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffect.h +++ b/plugins/PeakControllerEffect/PeakControllerEffect.h @@ -40,8 +40,8 @@ class PeakControllerEffect : public Effect public: PeakControllerEffect( Model * parent, const Descriptor::SubPluginFeatures::Key * _key ); - virtual ~PeakControllerEffect(); - virtual bool processAudioBuffer( sampleFrame * _buf, + ~PeakControllerEffect() override; + bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) override; EffectControls * controls() override diff --git a/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h b/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h index 721167975..7ccb4a14c 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h +++ b/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h @@ -45,7 +45,7 @@ class PeakControllerEffectControlDialog : public EffectControlDialog public: PeakControllerEffectControlDialog( PeakControllerEffectControls * _controls ); - virtual ~PeakControllerEffectControlDialog() + ~PeakControllerEffectControlDialog() override { } diff --git a/plugins/PeakControllerEffect/PeakControllerEffectControls.h b/plugins/PeakControllerEffect/PeakControllerEffectControls.h index 278c2f069..6eb3dad44 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffectControls.h +++ b/plugins/PeakControllerEffect/PeakControllerEffectControls.h @@ -41,7 +41,7 @@ class PeakControllerEffectControls : public EffectControls Q_OBJECT public: PeakControllerEffectControls( PeakControllerEffect * _eff ); - virtual ~PeakControllerEffectControls() + ~PeakControllerEffectControls() override { } diff --git a/plugins/ReverbSC/ReverbSC.h b/plugins/ReverbSC/ReverbSC.h index 0cbeba875..2cb119bff 100644 --- a/plugins/ReverbSC/ReverbSC.h +++ b/plugins/ReverbSC/ReverbSC.h @@ -44,10 +44,10 @@ class ReverbSCEffect : public Effect { public: ReverbSCEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ); - virtual ~ReverbSCEffect(); - virtual bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ); + ~ReverbSCEffect() override; + bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ) override; - virtual EffectControls* controls() + EffectControls* controls() override { return &m_reverbSCControls; } diff --git a/plugins/ReverbSC/ReverbSCControlDialog.h b/plugins/ReverbSC/ReverbSCControlDialog.h index ba373509a..0c02d7865 100644 --- a/plugins/ReverbSC/ReverbSCControlDialog.h +++ b/plugins/ReverbSC/ReverbSCControlDialog.h @@ -42,7 +42,7 @@ class ReverbSCControlDialog : public EffectControlDialog Q_OBJECT public: ReverbSCControlDialog( ReverbSCControls* controls ); - virtual ~ReverbSCControlDialog() + ~ReverbSCControlDialog() override { } diff --git a/plugins/ReverbSC/ReverbSCControls.h b/plugins/ReverbSC/ReverbSCControls.h index 2bd76990a..b58254dcf 100644 --- a/plugins/ReverbSC/ReverbSCControls.h +++ b/plugins/ReverbSC/ReverbSCControls.h @@ -40,23 +40,23 @@ class ReverbSCControls : public EffectControls Q_OBJECT public: ReverbSCControls( ReverbSCEffect* effect ); - virtual ~ReverbSCControls() + ~ReverbSCControls() override { } - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; + inline QString nodeName() const override { return "ReverbSCControls"; } - virtual int controlCount() + int controlCount() override { return 4; } - virtual gui::EffectControlDialog* createView() + gui::EffectControlDialog* createView() override { return new gui::ReverbSCControlDialog( this ); } diff --git a/plugins/Sf2Player/PatchesDialog.cpp b/plugins/Sf2Player/PatchesDialog.cpp index 3cba7561f..e3e882e69 100644 --- a/plugins/Sf2Player/PatchesDialog.cpp +++ b/plugins/Sf2Player/PatchesDialog.cpp @@ -47,7 +47,7 @@ public: : QTreeWidgetItem( pListView, pItemAfter ) {} // Sort/compare overriden method. - bool operator< ( const QTreeWidgetItem& other ) const + bool operator< ( const QTreeWidgetItem& other ) const override { int iColumn = QTreeWidgetItem::treeWidget()->sortColumn(); const QString& s1 = text( iColumn ); diff --git a/plugins/Sf2Player/PatchesDialog.h b/plugins/Sf2Player/PatchesDialog.h index 9f80981df..af1207ce1 100644 --- a/plugins/Sf2Player/PatchesDialog.h +++ b/plugins/Sf2Player/PatchesDialog.h @@ -50,7 +50,7 @@ public: PatchesDialog(QWidget *pParent = 0, Qt::WindowFlags wflags = QFlag(0)); // Destructor. - virtual ~PatchesDialog(); + ~PatchesDialog() override; void setup(fluid_synth_t *pSynth, int iChan, const QString & _chanName, @@ -64,8 +64,8 @@ public slots: protected slots: - void accept(); - void reject(); + void accept() override; + void reject() override; protected: diff --git a/plugins/Sf2Player/Sf2Player.h b/plugins/Sf2Player/Sf2Player.h index 3824595ea..1ce6d0fdd 100644 --- a/plugins/Sf2Player/Sf2Player.h +++ b/plugins/Sf2Player/Sf2Player.h @@ -63,35 +63,35 @@ class Sf2Instrument : public Instrument public: Sf2Instrument( InstrumentTrack * _instrument_track ); - virtual ~Sf2Instrument(); + ~Sf2Instrument() override; - virtual void play( sampleFrame * _working_buffer ); + void play( sampleFrame * _working_buffer ) override; - 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 AutomatableModel * childModel( const QString & _modelName ); + AutomatableModel * childModel( const QString & _modelName ) override; - virtual QString nodeName() const; + QString nodeName() const override; - virtual f_cnt_t desiredReleaseFrames() const + f_cnt_t desiredReleaseFrames() const override { return 0; } - virtual Flags flags() const + Flags flags() const override { return IsSingleStreamed; } - virtual gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; QString getCurrentPatchName(); @@ -203,10 +203,10 @@ class Sf2InstrumentView : public InstrumentViewFixedSize public: Sf2InstrumentView( Instrument * _instrument, QWidget * _parent ); - virtual ~Sf2InstrumentView(); + ~Sf2InstrumentView() override; private: - virtual void modelChanged(); + void modelChanged() override; PixmapButton * m_fileDialogButton; PixmapButton * m_patchDialogButton; diff --git a/plugins/Sfxr/Sfxr.h b/plugins/Sfxr/Sfxr.h index 4c14d33bb..6aafe9961 100644 --- a/plugins/Sfxr/Sfxr.h +++ b/plugins/Sfxr/Sfxr.h @@ -140,7 +140,7 @@ public: { } /* purpose: prevent the initial value of the model from being changed */ - virtual void loadSettings( const QDomElement& element, const QString& name = QString( "value" ) ) + void loadSettings( const QDomElement& element, const QString& name = QString( "value" ) ) override { float oldInitValue = initValue(); FloatModel::loadSettings(element, name); @@ -161,7 +161,7 @@ public: { } /* purpose: prevent the initial value of the model from being changed */ - virtual void loadSettings( const QDomElement& element, const QString& name = QString( "value" ) ) + void loadSettings( const QDomElement& element, const QString& name = QString( "value" ) ) override { float oldInitValue = initValue(); FloatModel::loadSettings(element, name); @@ -176,18 +176,18 @@ class SfxrInstrument : public Instrument Q_OBJECT public: SfxrInstrument(InstrumentTrack * _instrument_track ); - virtual ~SfxrInstrument(); + ~SfxrInstrument() override; - 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 gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; void resetModels(); @@ -240,7 +240,7 @@ public: SfxrInstrumentView( Instrument * _instrument, QWidget * _parent ); - virtual ~SfxrInstrumentView() {}; + ~SfxrInstrumentView() override {}; protected slots: void genPickup(); @@ -256,7 +256,7 @@ protected slots: void previewSound(); private: - virtual void modelChanged(); + void modelChanged() override; Knob * m_attKnob; //Attack Time Knob * m_holdKnob; //Sustain Time diff --git a/plugins/Sid/SidInstrument.h b/plugins/Sid/SidInstrument.h index 3a92605b6..1c8fecc95 100644 --- a/plugins/Sid/SidInstrument.h +++ b/plugins/Sid/SidInstrument.h @@ -58,7 +58,7 @@ public: NumWaveShapes }; VoiceObject( Model * _parent, int _idx ); - virtual ~VoiceObject(); + ~VoiceObject() override; private: @@ -97,21 +97,21 @@ public: SidInstrument( InstrumentTrack * _instrument_track ); - virtual ~SidInstrument(); + ~SidInstrument() override; - 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 f_cnt_t desiredReleaseFrames() const; + f_cnt_t desiredReleaseFrames() const override; - virtual gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; /*public slots: @@ -147,10 +147,10 @@ class SidInstrumentView : public InstrumentViewFixedSize Q_OBJECT public: SidInstrumentView( Instrument * _instrument, QWidget * _parent ); - virtual ~SidInstrumentView(); + ~SidInstrumentView() override; private: - virtual void modelChanged(); + void modelChanged() override; automatableButtonGroup * m_passBtnGrp; automatableButtonGroup * m_sidTypeBtnGrp; diff --git a/plugins/SpectrumAnalyzer/Analyzer.h b/plugins/SpectrumAnalyzer/Analyzer.h index 9013b6745..5be1f9ba8 100644 --- a/plugins/SpectrumAnalyzer/Analyzer.h +++ b/plugins/SpectrumAnalyzer/Analyzer.h @@ -43,7 +43,7 @@ class Analyzer : public Effect { public: Analyzer(Model *parent, const Descriptor::SubPluginFeatures::Key *key); - virtual ~Analyzer(); + ~Analyzer() override; bool processAudioBuffer(sampleFrame *buffer, const fpp_t frame_count) override; EffectControls *controls() override {return &m_controls;} diff --git a/plugins/SpectrumAnalyzer/SaControls.h b/plugins/SpectrumAnalyzer/SaControls.h index 70a7559f2..b2fc1cc87 100644 --- a/plugins/SpectrumAnalyzer/SaControls.h +++ b/plugins/SpectrumAnalyzer/SaControls.h @@ -49,7 +49,7 @@ class SaControls : public EffectControls Q_OBJECT public: explicit SaControls(Analyzer* effect); - virtual ~SaControls() {} + ~SaControls() override {} gui::EffectControlDialog* createView() override; diff --git a/plugins/SpectrumAnalyzer/SaControlsDialog.h b/plugins/SpectrumAnalyzer/SaControlsDialog.h index 1504da3dc..ac28be4bf 100644 --- a/plugins/SpectrumAnalyzer/SaControlsDialog.h +++ b/plugins/SpectrumAnalyzer/SaControlsDialog.h @@ -47,7 +47,7 @@ class SaControlsDialog : public EffectControlDialog Q_OBJECT public: explicit SaControlsDialog(SaControls *controls, SaProcessor *processor); - virtual ~SaControlsDialog() {} + ~SaControlsDialog() override {} bool isResizable() const override {return true;} QSize sizeHint() const override; diff --git a/plugins/SpectrumAnalyzer/SaSpectrumView.h b/plugins/SpectrumAnalyzer/SaSpectrumView.h index 4ac24cbf0..d50c893e5 100644 --- a/plugins/SpectrumAnalyzer/SaSpectrumView.h +++ b/plugins/SpectrumAnalyzer/SaSpectrumView.h @@ -54,7 +54,7 @@ class SaSpectrumView : public QWidget Q_OBJECT public: explicit SaSpectrumView(SaControls *controls, SaProcessor *processor, QWidget *_parent = 0); - virtual ~SaSpectrumView() {} + ~SaSpectrumView() override {} QSize sizeHint() const override {return QSize(400, 200);} diff --git a/plugins/SpectrumAnalyzer/SaWaterfallView.h b/plugins/SpectrumAnalyzer/SaWaterfallView.h index cdfad6ad4..2855eb925 100644 --- a/plugins/SpectrumAnalyzer/SaWaterfallView.h +++ b/plugins/SpectrumAnalyzer/SaWaterfallView.h @@ -49,7 +49,7 @@ class SaWaterfallView : public QWidget Q_OBJECT public: explicit SaWaterfallView(SaControls *controls, SaProcessor *processor, QWidget *_parent = 0); - virtual ~SaWaterfallView() {} + ~SaWaterfallView() override {} QSize sizeHint() const override {return QSize(400, 350);} diff --git a/plugins/StereoEnhancer/StereoEnhancer.h b/plugins/StereoEnhancer/StereoEnhancer.h index a3f4a6de4..5872100d3 100644 --- a/plugins/StereoEnhancer/StereoEnhancer.h +++ b/plugins/StereoEnhancer/StereoEnhancer.h @@ -39,11 +39,11 @@ class StereoEnhancerEffect : public Effect public: StereoEnhancerEffect( Model * parent, const Descriptor::SubPluginFeatures::Key * _key ); - virtual ~StereoEnhancerEffect(); - virtual bool processAudioBuffer( sampleFrame * _buf, - const fpp_t _frames ); + ~StereoEnhancerEffect() override; + bool processAudioBuffer( sampleFrame * _buf, + const fpp_t _frames ) override; - virtual EffectControls * controls() + EffectControls * controls() override { return( &m_bbControls ); } diff --git a/plugins/StereoEnhancer/StereoEnhancerControlDialog.h b/plugins/StereoEnhancer/StereoEnhancerControlDialog.h index 62f78d1cd..3f063ec63 100644 --- a/plugins/StereoEnhancer/StereoEnhancerControlDialog.h +++ b/plugins/StereoEnhancer/StereoEnhancerControlDialog.h @@ -42,7 +42,7 @@ class StereoEnhancerControlDialog : public EffectControlDialog Q_OBJECT public: StereoEnhancerControlDialog( StereoEnhancerControls * _controls ); - virtual ~StereoEnhancerControlDialog() + ~StereoEnhancerControlDialog() override { } diff --git a/plugins/StereoEnhancer/StereoEnhancerControls.h b/plugins/StereoEnhancer/StereoEnhancerControls.h index c9a0f6e61..0b016aa2b 100644 --- a/plugins/StereoEnhancer/StereoEnhancerControls.h +++ b/plugins/StereoEnhancer/StereoEnhancerControls.h @@ -39,23 +39,23 @@ class StereoEnhancerControls : public EffectControls Q_OBJECT public: StereoEnhancerControls( StereoEnhancerEffect( * _eff ) ); - virtual ~StereoEnhancerControls() + ~StereoEnhancerControls() override { } - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; + inline QString nodeName() const override { return( "stereoenhancercontrols" ); } - virtual int controlCount() + int controlCount() override { return( 1 ); } - virtual gui::EffectControlDialog* createView() + gui::EffectControlDialog* createView() override { return new gui::StereoEnhancerControlDialog( this ); } diff --git a/plugins/StereoMatrix/StereoMatrix.h b/plugins/StereoMatrix/StereoMatrix.h index 88d265ad2..a8a373317 100644 --- a/plugins/StereoMatrix/StereoMatrix.h +++ b/plugins/StereoMatrix/StereoMatrix.h @@ -38,11 +38,11 @@ class StereoMatrixEffect : public Effect public: StereoMatrixEffect( Model * parent, const Descriptor::SubPluginFeatures::Key * _key ); - virtual ~StereoMatrixEffect(); - virtual bool processAudioBuffer( sampleFrame * _buf, - const fpp_t _frames ); + ~StereoMatrixEffect() override; + bool processAudioBuffer( sampleFrame * _buf, + const fpp_t _frames ) override; - virtual EffectControls* controls() + EffectControls* controls() override { return( &m_smControls ); } diff --git a/plugins/StereoMatrix/StereoMatrixControlDialog.h b/plugins/StereoMatrix/StereoMatrixControlDialog.h index fd5cf786a..41eb9cdb4 100644 --- a/plugins/StereoMatrix/StereoMatrixControlDialog.h +++ b/plugins/StereoMatrix/StereoMatrixControlDialog.h @@ -41,7 +41,7 @@ class StereoMatrixControlDialog : public EffectControlDialog Q_OBJECT public: StereoMatrixControlDialog( StereoMatrixControls * _controls ); - virtual ~StereoMatrixControlDialog() + ~StereoMatrixControlDialog() override { } diff --git a/plugins/StereoMatrix/StereoMatrixControls.h b/plugins/StereoMatrix/StereoMatrixControls.h index 97f0cf8e1..04a10f237 100644 --- a/plugins/StereoMatrix/StereoMatrixControls.h +++ b/plugins/StereoMatrix/StereoMatrixControls.h @@ -39,23 +39,23 @@ class StereoMatrixControls : public EffectControls Q_OBJECT public: StereoMatrixControls( StereoMatrixEffect( * _eff ) ); - virtual ~StereoMatrixControls() + ~StereoMatrixControls() override { } - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; + inline QString nodeName() const override { return( "stereomatrixcontrols" ); } - virtual int controlCount() + int controlCount() override { return( 1 ); } - virtual gui::EffectControlDialog* createView() + gui::EffectControlDialog* createView() override { return new gui::StereoMatrixControlDialog( this ); } diff --git a/plugins/Stk/Mallets/Mallets.h b/plugins/Stk/Mallets/Mallets.h index 51b0bfb43..e8ec15360 100644 --- a/plugins/Stk/Mallets/Mallets.h +++ b/plugins/Stk/Mallets/Mallets.h @@ -160,17 +160,17 @@ class MalletsInstrument : public Instrument Q_OBJECT public: MalletsInstrument( InstrumentTrack * _instrument_track ); - virtual ~MalletsInstrument(); + ~MalletsInstrument() override; - 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; gui::PluginView* instantiateView( QWidget * _parent ) override; @@ -219,13 +219,13 @@ class MalletsInstrumentView: public InstrumentViewFixedSize public: MalletsInstrumentView( MalletsInstrument * _instrument, QWidget * _parent ); - virtual ~MalletsInstrumentView(); + ~MalletsInstrumentView() override; public slots: void changePreset(); private: - virtual void modelChanged(); + void modelChanged() override; void setWidgetBackground( QWidget * _widget, const QString & _pic ); QWidget * setupModalBarControls( QWidget * _parent ); diff --git a/plugins/TripleOscillator/TripleOscillator.h b/plugins/TripleOscillator/TripleOscillator.h index 1c8871796..0cb0e69a0 100644 --- a/plugins/TripleOscillator/TripleOscillator.h +++ b/plugins/TripleOscillator/TripleOscillator.h @@ -57,7 +57,7 @@ class OscillatorObject : public Model Q_OBJECT public: OscillatorObject( Model * _parent, int _idx ); - virtual ~OscillatorObject(); + ~OscillatorObject() override; private: @@ -108,24 +108,24 @@ class TripleOscillator : public Instrument Q_OBJECT public: TripleOscillator( InstrumentTrack * _track ); - virtual ~TripleOscillator(); + ~TripleOscillator() override; - 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 f_cnt_t desiredReleaseFrames() const + f_cnt_t desiredReleaseFrames() const override { return( 128 ); } - virtual gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; protected slots: @@ -157,11 +157,11 @@ class TripleOscillatorView : public InstrumentViewFixedSize Q_OBJECT public: TripleOscillatorView( Instrument * _instrument, QWidget * _parent ); - virtual ~TripleOscillatorView(); + ~TripleOscillatorView() override; private: - virtual void modelChanged(); + void modelChanged() override; automatableButtonGroup * m_mod1BtnGrp; automatableButtonGroup * m_mod2BtnGrp; diff --git a/plugins/Vectorscope/VecControls.h b/plugins/Vectorscope/VecControls.h index e4aa27b43..76b0f388e 100644 --- a/plugins/Vectorscope/VecControls.h +++ b/plugins/Vectorscope/VecControls.h @@ -47,7 +47,7 @@ class VecControls : public EffectControls Q_OBJECT public: explicit VecControls(Vectorscope *effect); - virtual ~VecControls() {} + ~VecControls() override {} gui::EffectControlDialog* createView() override; diff --git a/plugins/Vectorscope/VecControlsDialog.h b/plugins/Vectorscope/VecControlsDialog.h index 97108cdf4..616e55b44 100644 --- a/plugins/Vectorscope/VecControlsDialog.h +++ b/plugins/Vectorscope/VecControlsDialog.h @@ -43,7 +43,7 @@ class VecControlsDialog : public EffectControlDialog Q_OBJECT public: explicit VecControlsDialog(VecControls *controls); - virtual ~VecControlsDialog() {} + ~VecControlsDialog() override {} bool isResizable() const override {return true;} QSize sizeHint() const override; diff --git a/plugins/Vectorscope/VectorView.h b/plugins/Vectorscope/VectorView.h index 0aae988db..347aa8a18 100644 --- a/plugins/Vectorscope/VectorView.h +++ b/plugins/Vectorscope/VectorView.h @@ -44,7 +44,7 @@ class VectorView : public QWidget Q_OBJECT public: explicit VectorView(VecControls *controls, LocklessRingBuffer *inputBuffer, unsigned short displaySize, QWidget *parent = 0); - virtual ~VectorView() {} + ~VectorView() override {} QSize sizeHint() const override {return QSize(300, 300);} diff --git a/plugins/Vectorscope/Vectorscope.h b/plugins/Vectorscope/Vectorscope.h index 973fecf0e..e3e92b205 100644 --- a/plugins/Vectorscope/Vectorscope.h +++ b/plugins/Vectorscope/Vectorscope.h @@ -37,7 +37,7 @@ class Vectorscope : public Effect { public: Vectorscope(Model *parent, const Descriptor::SubPluginFeatures::Key *key); - virtual ~Vectorscope() {}; + ~Vectorscope() override {}; bool processAudioBuffer(sampleFrame *buffer, const fpp_t frame_count) override; EffectControls *controls() override {return &m_controls;} diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index 9088321cc..150a4f1e4 100644 --- a/plugins/Vestige/Vestige.cpp +++ b/plugins/Vestige/Vestige.cpp @@ -103,11 +103,11 @@ public: setWindowFlags( Qt::WindowCloseButtonHint ); } - virtual ~vstSubWin() + ~vstSubWin() override { } - virtual void closeEvent( QCloseEvent * e ) + void closeEvent( QCloseEvent * e ) override { // ignore close-events - for some reason otherwise the VST GUI // remains hidden when re-opening diff --git a/plugins/Vibed/NineButtonSelector.h b/plugins/Vibed/NineButtonSelector.h index 1c3183055..90c4d53e8 100644 --- a/plugins/Vibed/NineButtonSelector.h +++ b/plugins/Vibed/NineButtonSelector.h @@ -67,7 +67,7 @@ public: int _default, int _x, int _y, QWidget * _parent); - virtual ~NineButtonSelector(); + ~NineButtonSelector() override; // inline int getSelected() { // return( castModel()->value() ); @@ -86,13 +86,13 @@ public slots: void button6Clicked(); void button7Clicked(); void button8Clicked(); - void contextMenuEvent( QContextMenuEvent * ); + void contextMenuEvent( QContextMenuEvent * ) override; signals: void NineButtonSelection( int ); private: - virtual void modelChanged(); + void modelChanged() override; void updateButton( int ); QList m_buttons; diff --git a/plugins/Vibed/Vibed.h b/plugins/Vibed/Vibed.h index f13fd665a..c6fdee385 100644 --- a/plugins/Vibed/Vibed.h +++ b/plugins/Vibed/Vibed.h @@ -97,11 +97,11 @@ class VibedView : public InstrumentViewFixedSize public: VibedView( Instrument * _instrument, QWidget * _parent ); - virtual ~VibedView() {}; + ~VibedView() override {}; public slots: void showString( int _string ); - void contextMenuEvent( QContextMenuEvent * ); + void contextMenuEvent( QContextMenuEvent * ) override; protected slots: void sinWaveClicked(); @@ -114,7 +114,7 @@ protected slots: void normalizeClicked(); private: - virtual void modelChanged(); + void modelChanged() override; // String-related diff --git a/plugins/VstBase/VstPlugin.h b/plugins/VstBase/VstPlugin.h index f73c1c876..c0f8e79e5 100644 --- a/plugins/VstBase/VstPlugin.h +++ b/plugins/VstBase/VstPlugin.h @@ -45,7 +45,7 @@ class VSTBASE_EXPORT VstPlugin : public RemotePlugin, public JournallingObject Q_OBJECT public: VstPlugin( const QString & _plugin ); - virtual ~VstPlugin(); + ~VstPlugin() override; void tryLoad( const QString &remoteVstPluginExecutable ); @@ -112,7 +112,7 @@ public: void loadSettings( const QDomElement & _this ) override; void saveSettings( QDomDocument & _doc, QDomElement & _this ) override; - virtual QString nodeName() const override + QString nodeName() const override { return "vstplugin"; } diff --git a/plugins/VstEffect/VstEffect.h b/plugins/VstEffect/VstEffect.h index 12b15dc49..586d00d3b 100644 --- a/plugins/VstEffect/VstEffect.h +++ b/plugins/VstEffect/VstEffect.h @@ -43,12 +43,12 @@ class VstEffect : public Effect public: VstEffect( Model * _parent, const Descriptor::SubPluginFeatures::Key * _key ); - virtual ~VstEffect(); + ~VstEffect() override; - virtual bool processAudioBuffer( sampleFrame * _buf, - const fpp_t _frames ); + bool processAudioBuffer( sampleFrame * _buf, + const fpp_t _frames ) override; - virtual EffectControls * controls() + EffectControls * controls() override { return &m_vstControls; } diff --git a/plugins/VstEffect/VstEffectControlDialog.h b/plugins/VstEffect/VstEffectControlDialog.h index f54ab750c..1fb538ca5 100644 --- a/plugins/VstEffect/VstEffectControlDialog.h +++ b/plugins/VstEffect/VstEffectControlDialog.h @@ -50,7 +50,7 @@ class VstEffectControlDialog : public EffectControlDialog Q_OBJECT public: VstEffectControlDialog( VstEffectControls * _controls ); - virtual ~VstEffectControlDialog(); + ~VstEffectControlDialog() override; protected: void paintEvent( QPaintEvent * _pe ) override; diff --git a/plugins/VstEffect/VstEffectControls.h b/plugins/VstEffect/VstEffectControls.h index 24d5961ae..6e142b38c 100644 --- a/plugins/VstEffect/VstEffectControls.h +++ b/plugins/VstEffect/VstEffectControls.h @@ -55,18 +55,18 @@ class VstEffectControls : public EffectControls Q_OBJECT public: VstEffectControls( VstEffect * _eff ); - virtual ~VstEffectControls(); + ~VstEffectControls() override; - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; + inline QString nodeName() const override { return "vsteffectcontrols"; } - virtual int controlCount(); + int controlCount() override; - virtual gui::EffectControlDialog* createView(); + gui::EffectControlDialog* createView() override; protected slots: @@ -113,7 +113,7 @@ class ManageVSTEffectView : public QObject Q_OBJECT public: ManageVSTEffectView( VstEffect * _eff, VstEffectControls * m_vi ); - virtual ~ManageVSTEffectView(); + ~ManageVSTEffectView() override; protected slots: diff --git a/plugins/VstEffect/VstSubPluginFeatures.h b/plugins/VstEffect/VstSubPluginFeatures.h index d3b9de58c..c5dc87d14 100644 --- a/plugins/VstEffect/VstSubPluginFeatures.h +++ b/plugins/VstEffect/VstSubPluginFeatures.h @@ -40,11 +40,11 @@ class VstSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures public: VstSubPluginFeatures( Plugin::PluginTypes _type ); - virtual void fillDescriptionWidget( QWidget * _parent, - const Key * _key ) const; + void fillDescriptionWidget( QWidget * _parent, + const Key * _key ) const override; - virtual void listSubPluginKeys( const Plugin::Descriptor * _desc, - KeyList & _kl ) const; + void listSubPluginKeys( const Plugin::Descriptor * _desc, + KeyList & _kl ) const override; private: void addPluginsFromDir(QStringList* filenames, QString path) const; } ; diff --git a/plugins/Watsyn/Watsyn.h b/plugins/Watsyn/Watsyn.h index 454329b57..cee2d807b 100644 --- a/plugins/Watsyn/Watsyn.h +++ b/plugins/Watsyn/Watsyn.h @@ -139,25 +139,25 @@ class WatsynInstrument : public Instrument Q_OBJECT public: WatsynInstrument( InstrumentTrack * _instrument_track ); - virtual ~WatsynInstrument(); + ~WatsynInstrument() override; - 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 & _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; - virtual f_cnt_t desiredReleaseFrames() const + f_cnt_t desiredReleaseFrames() const override { return( 64 ); } - virtual gui::PluginView* instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; public slots: void updateVolumes(); @@ -310,7 +310,7 @@ class WatsynView : public InstrumentViewFixedSize public: WatsynView( Instrument * _instrument, QWidget * _parent ); - virtual ~WatsynView(); + ~WatsynView() override; protected slots: void updateLayout(); @@ -328,7 +328,7 @@ protected slots: void loadClicked(); private: - virtual void modelChanged(); + void modelChanged() override; // knobs Knob * a1_volKnob; diff --git a/plugins/WaveShaper/WaveShaper.h b/plugins/WaveShaper/WaveShaper.h index 7364784bb..075c0ec6b 100644 --- a/plugins/WaveShaper/WaveShaper.h +++ b/plugins/WaveShaper/WaveShaper.h @@ -39,11 +39,11 @@ class WaveShaperEffect : public Effect public: WaveShaperEffect( Model * _parent, const Descriptor::SubPluginFeatures::Key * _key ); - virtual ~WaveShaperEffect(); - virtual bool processAudioBuffer( sampleFrame * _buf, - const fpp_t _frames ); + ~WaveShaperEffect() override; + bool processAudioBuffer( sampleFrame * _buf, + const fpp_t _frames ) override; - virtual EffectControls * controls() + EffectControls * controls() override { return( &m_wsControls ); } diff --git a/plugins/WaveShaper/WaveShaperControlDialog.h b/plugins/WaveShaper/WaveShaperControlDialog.h index 672b55f62..be3838f46 100644 --- a/plugins/WaveShaper/WaveShaperControlDialog.h +++ b/plugins/WaveShaper/WaveShaperControlDialog.h @@ -42,7 +42,7 @@ class WaveShaperControlDialog : public EffectControlDialog Q_OBJECT public: WaveShaperControlDialog( WaveShaperControls * _controls ); - virtual ~WaveShaperControlDialog() + ~WaveShaperControlDialog() override { } diff --git a/plugins/WaveShaper/WaveShaperControls.h b/plugins/WaveShaper/WaveShaperControls.h index f94bc3d9b..2719514f5 100644 --- a/plugins/WaveShaper/WaveShaperControls.h +++ b/plugins/WaveShaper/WaveShaperControls.h @@ -42,25 +42,25 @@ class WaveShaperControls : public EffectControls Q_OBJECT public: WaveShaperControls( WaveShaperEffect * _eff ); - virtual ~WaveShaperControls() + ~WaveShaperControls() override { } - virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); - virtual void loadSettings( const QDomElement & _this ); - inline virtual QString nodeName() const + void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; + void loadSettings( const QDomElement & _this ) override; + inline QString nodeName() const override { return( "waveshapercontrols" ); } virtual void setDefaultShape(); - virtual int controlCount() + int controlCount() override { return( 4 ); } - virtual gui::EffectControlDialog* createView() + gui::EffectControlDialog* createView() override { return( new gui::WaveShaperControlDialog( this ) ); } diff --git a/plugins/Xpressive/ExprSynth.cpp b/plugins/Xpressive/ExprSynth.cpp index ac850bca9..afd6da1f9 100644 --- a/plugins/Xpressive/ExprSynth.cpp +++ b/plugins/Xpressive/ExprSynth.cpp @@ -56,7 +56,7 @@ struct freefunc0 : public exprtk::ifunction freefunc0() : exprtk::ifunction(0) { if (optimize) { exprtk::disable_has_side_effects(*this); } } - inline T operator()() + inline T operator()() override { return Functor::process(); } }; template @@ -67,7 +67,7 @@ struct freefunc1 : public exprtk::ifunction freefunc1() : exprtk::ifunction(1) { if (optimize) { exprtk::disable_has_side_effects(*this); } } - inline T operator()(const T& x) + inline T operator()(const T& x) override { return Functor::process(x); } }; @@ -76,7 +76,7 @@ struct IntegrateFunction : public exprtk::ifunction { using exprtk::ifunction::operator(); - virtual ~IntegrateFunction() + ~IntegrateFunction() override { delete [] m_counters; } @@ -94,7 +94,7 @@ struct IntegrateFunction : public exprtk::ifunction clearArray(m_counters,max_counters); } - inline T operator()(const T& x) + inline T operator()(const T& x) override { if (*m_frame == 0) { @@ -131,7 +131,7 @@ struct LastSampleFunction : public exprtk::ifunction { using exprtk::ifunction::operator(); - virtual ~LastSampleFunction() + ~LastSampleFunction() override { delete [] m_samples; } @@ -145,7 +145,7 @@ struct LastSampleFunction : public exprtk::ifunction clearArray(m_samples, history_size); } - inline T operator()(const T& x) + inline T operator()(const T& x) override { if (!std::isnan(x) && !std::isinf(x)) { @@ -187,7 +187,7 @@ struct WaveValueFunction : public exprtk::ifunction m_size(s) {} - inline T operator()(const T& index) + inline T operator()(const T& index) override { return m_vec[(int) ( positiveFraction(index) * m_size )]; } @@ -205,7 +205,7 @@ struct WaveValueFunctionInterpolate : public exprtk::ifunction m_size(s) {} - inline T operator()(const T& index) + inline T operator()(const T& index) override { const T x = positiveFraction(index) * m_size; const int ix = (int)x; @@ -321,7 +321,7 @@ struct RandomVectorSeedFunction : public exprtk::ifunction return static_cast(res) / (float)(1 << 31); } - inline float operator()(const float& index,const float& seed) + inline float operator()(const float& index,const float& seed) override { int irseed; if (seed < 0 || std::isnan(seed) || std::isinf(seed)) @@ -346,7 +346,7 @@ struct RandomVectorFunction : public exprtk::ifunction m_rseed(seed) { exprtk::disable_has_side_effects(*this); } - inline float operator()(const float& index) + inline float operator()(const float& index) override { return RandomVectorSeedFunction::randv(index,m_rseed); } diff --git a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp index 2d9a2701e..b2e47cade 100644 --- a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp @@ -64,17 +64,17 @@ public: pthread_create( &m_messageThreadHandle, nullptr, messageLoop, this ); } - virtual ~RemoteZynAddSubFx() + ~RemoteZynAddSubFx() override { Nio::stop(); } - virtual void updateSampleRate() + void updateSampleRate() override { LocalZynAddSubFx::setSampleRate( sampleRate() ); } - virtual void updateBufferSize() + void updateBufferSize() override { LocalZynAddSubFx::setBufferSize( bufferSize() ); } @@ -91,7 +91,7 @@ public: m_guiExit = true; } - virtual bool processMessage( const message & _m ) + bool processMessage( const message & _m ) override { switch( _m.id ) { @@ -133,13 +133,13 @@ public: } // all functions are called while m_master->mutex is held - virtual void processMidiEvent( const MidiEvent& event, const f_cnt_t /* _offset */ ) + void processMidiEvent( const MidiEvent& event, const f_cnt_t /* _offset */ ) override { LocalZynAddSubFx::processMidiEvent( event ); } - virtual void process( const sampleFrame * _in, sampleFrame * _out ) + void process( const sampleFrame * _in, sampleFrame * _out ) override { LocalZynAddSubFx::processAudio( _out ); } diff --git a/src/core/PresetPreviewPlayHandle.cpp b/src/core/PresetPreviewPlayHandle.cpp index 0ce248e9c..1734ef497 100644 --- a/src/core/PresetPreviewPlayHandle.cpp +++ b/src/core/PresetPreviewPlayHandle.cpp @@ -53,7 +53,7 @@ public: m_previewInstrumentTrack->setPreviewMode( true ); } - virtual ~PreviewTrackContainer() + ~PreviewTrackContainer() override { } diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index 0a24b32cc..5368fcf7d 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -113,7 +113,7 @@ MixerView::MixerView() : public: ChannelArea( QWidget * parent, MixerView * mv ) : QScrollArea( parent ), m_mv( mv ) {} - ~ChannelArea() {} + ~ChannelArea() override {} void keyPressEvent( QKeyEvent * e ) override { m_mv->keyPressEvent( e ); diff --git a/src/gui/RowTableView.cpp b/src/gui/RowTableView.cpp index cef8b87ea..be4824016 100644 --- a/src/gui/RowTableView.cpp +++ b/src/gui/RowTableView.cpp @@ -41,13 +41,13 @@ public: m_table( table ) { } - virtual void paint( QPainter * painter, + void paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const override; protected: - virtual void initStyleOption( QStyleOptionViewItem * option, + void initStyleOption( QStyleOptionViewItem * option, const QModelIndex & index ) const override; diff --git a/src/gui/SideBar.cpp b/src/gui/SideBar.cpp index 4c6f6abd1..0eca4d9f8 100644 --- a/src/gui/SideBar.cpp +++ b/src/gui/SideBar.cpp @@ -44,7 +44,7 @@ public: { } - virtual ~SideBarButton() = default; + ~SideBarButton() override = default; Qt::Orientation orientation() const { diff --git a/src/gui/modals/ControllerConnectionDialog.cpp b/src/gui/modals/ControllerConnectionDialog.cpp index 008acbdb5..b8d323709 100644 --- a/src/gui/modals/ControllerConnectionDialog.cpp +++ b/src/gui/modals/ControllerConnectionDialog.cpp @@ -60,7 +60,7 @@ public: } - virtual ~AutoDetectMidiController() + ~AutoDetectMidiController() override { } diff --git a/tests/QTestSuite.h b/tests/QTestSuite.h index e0bd164ed..6cd27f5aa 100644 --- a/tests/QTestSuite.h +++ b/tests/QTestSuite.h @@ -10,7 +10,7 @@ class QTestSuite : public QObject Q_OBJECT public: explicit QTestSuite(QObject *parent = 0); - ~QTestSuite(); + ~QTestSuite() override; static QList suites(); From c2fa2375dc4e39535097e8ac771f6324aa5cd51c Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Wed, 22 Jun 2022 10:06:34 +0900 Subject: [PATCH 03/55] Don't send effEditIdle on CLI rendering (#6440) --- plugins/VstBase/RemoteVstPlugin.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/plugins/VstBase/RemoteVstPlugin.cpp b/plugins/VstBase/RemoteVstPlugin.cpp index 7ac0c97e2..520211f68 100644 --- a/plugins/VstBase/RemoteVstPlugin.cpp +++ b/plugins/VstBase/RemoteVstPlugin.cpp @@ -2165,7 +2165,10 @@ void RemoteVstPlugin::idle() return; } setProcessing( true ); - pluginDispatch( effEditIdle ); + if (!HEADLESS && m_window) + { + pluginDispatch( effEditIdle ); + } setShouldGiveIdle( false ); setProcessing( false ); // We might have received a message whilst idling @@ -2213,7 +2216,10 @@ void RemoteVstPlugin::processUIThreadMessages() #endif if( shouldGiveIdle() ) { - pluginDispatch( effEditIdle ); + if (!HEADLESS && m_window) + { + pluginDispatch( effEditIdle ); + } setShouldGiveIdle( false ); } #ifdef NATIVE_LINUX_VST From 96df9b006cc4bc0ef47754f2db554b27be0323b8 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Thu, 23 Jun 2022 12:20:05 +0100 Subject: [PATCH 04/55] Clean up macros a bit (#6444) * Prefix `STRINGIFY` and `STR` macros with `LMMS_` * Fix include guard macro names * Remove unused macros --- include/DrumSynth.h | 6 ++--- include/MicroTimer.h | 6 ++--- include/RemotePluginBase.h | 1 - include/embed.h | 4 ++-- include/lmms_basics.h | 4 ++-- include/versioninfo.h | 2 +- plugins/Amplifier/Amplifier.cpp | 2 +- .../AudioFileProcessor/AudioFileProcessor.cpp | 2 +- plugins/BassBooster/BassBooster.cpp | 2 +- plugins/BitInvader/BitInvader.cpp | 2 +- plugins/Bitcrush/Bitcrush.cpp | 2 +- plugins/CarlaPatchbay/CarlaPatchbay.cpp | 2 +- plugins/CarlaRack/CarlaRack.cpp | 2 +- plugins/Compressor/Compressor.cpp | 2 +- plugins/CrossoverEQ/CrossoverEQ.cpp | 2 +- plugins/Delay/DelayEffect.cpp | 2 +- plugins/DualFilter/DualFilter.cpp | 2 +- .../DynamicsProcessor/DynamicsProcessor.cpp | 2 +- plugins/Eq/EqEffect.cpp | 2 +- plugins/Flanger/FlangerEffect.cpp | 2 +- plugins/FreeBoy/FreeBoy.cpp | 2 +- plugins/GigPlayer/GigPlayer.cpp | 2 +- plugins/HydrogenImport/HydrogenImport.cpp | 2 +- plugins/Kicker/Kicker.cpp | 2 +- plugins/LadspaBrowser/LadspaBrowser.cpp | 2 +- plugins/LadspaEffect/LadspaEffect.cpp | 2 +- plugins/Lb302/Lb302.cpp | 2 +- plugins/Lb302/Lb302.h | 6 ++--- plugins/Lv2Effect/Lv2Effect.cpp | 2 +- plugins/Lv2Instrument/Lv2Instrument.cpp | 2 +- plugins/MidiExport/MidiExport.cpp | 2 +- plugins/MidiImport/MidiImport.cpp | 2 +- plugins/Monstro/Monstro.cpp | 2 +- plugins/MultitapEcho/MultitapEcho.cpp | 2 +- plugins/Nes/Nes.cpp | 2 +- plugins/OpulenZ/OpulenZ.cpp | 2 +- plugins/Organic/Organic.cpp | 2 +- plugins/Patman/Patman.cpp | 2 +- plugins/Patman/Patman.h | 6 ++--- .../PeakControllerEffect.cpp | 2 +- plugins/ReverbSC/ReverbSC.cpp | 2 +- plugins/Sf2Player/Sf2Player.cpp | 2 +- plugins/Sfxr/Sfxr.cpp | 2 +- plugins/Sid/SidInstrument.cpp | 2 +- plugins/StereoEnhancer/StereoEnhancer.cpp | 2 +- plugins/StereoMatrix/StereoMatrix.cpp | 2 +- plugins/Stk/Mallets/Mallets.cpp | 2 +- plugins/TripleOscillator/TripleOscillator.cpp | 2 +- plugins/Vectorscope/Vectorscope.cpp | 2 +- plugins/Vestige/Vestige.cpp | 2 +- plugins/Vibed/Vibed.cpp | 2 +- plugins/VstBase/vst_base.cpp | 2 +- plugins/VstEffect/VstEffect.cpp | 2 +- plugins/Watsyn/Watsyn.cpp | 2 +- plugins/WaveShaper/WaveShaper.cpp | 2 +- plugins/Xpressive/Xpressive.cpp | 2 +- plugins/ZynAddSubFx/ZynAddSubFx.cpp | 2 +- src/gui/instrument/InstrumentMidiIOView.cpp | 5 ----- src/lmmsconfig.h.in | 22 ------------------- 59 files changed, 66 insertions(+), 94 deletions(-) diff --git a/include/DrumSynth.h b/include/DrumSynth.h index 79383a6d4..27941f67d 100644 --- a/include/DrumSynth.h +++ b/include/DrumSynth.h @@ -24,8 +24,8 @@ */ -#ifndef _DRUMSYNTH_H__ -#define _DRUMSYNTH_H__ +#ifndef DRUMSYNTH_H +#define DRUMSYNTH_H #include #include "lmms_basics.h" @@ -57,4 +57,4 @@ class DrumSynth { } // namespace lmms -#endif +#endif // DRUMSYNTH_H diff --git a/include/MicroTimer.h b/include/MicroTimer.h index 2eaf28b97..4daf28edd 100644 --- a/include/MicroTimer.h +++ b/include/MicroTimer.h @@ -22,8 +22,8 @@ * */ -#ifndef MICRO_TIMER -#define MICRO_TIMER +#ifndef MICRO_TIMER_H +#define MICRO_TIMER_H #include @@ -48,4 +48,4 @@ private: } // namespace lmms -#endif +#endif // MICRO_TIMER_H diff --git a/include/RemotePluginBase.h b/include/RemotePluginBase.h index 4d5627a92..2abe59132 100644 --- a/include/RemotePluginBase.h +++ b/include/RemotePluginBase.h @@ -38,7 +38,6 @@ #if !(defined(LMMS_HAVE_SYS_IPC_H) && defined(LMMS_HAVE_SEMAPHORE_H)) #define SYNC_WITH_SHM_FIFO -#define USE_QT_SEMAPHORES #ifdef LMMS_HAVE_PROCESS_H #include diff --git a/include/embed.h b/include/embed.h index 23aebccec..d26fd643a 100644 --- a/include/embed.h +++ b/include/embed.h @@ -61,7 +61,7 @@ namespace PLUGIN_NAME inline QPixmap getIconPixmap( const QString& _name, int _w = -1, int _h = -1, const char** xpm = nullptr ) { - return embed::getIconPixmap(QString("%1/%2").arg(STRINGIFY(PLUGIN_NAME), _name), _w, _h, xpm); + return embed::getIconPixmap(QString("%1/%2").arg(LMMS_STRINGIFY(PLUGIN_NAME), _name), _w, _h, xpm); } //QString getText( const char * _name ); @@ -132,7 +132,7 @@ public: QString pixmapName() const override { - return QString( STRINGIFY(PLUGIN_NAME) ) + "::" + m_name; + return QString( LMMS_STRINGIFY(PLUGIN_NAME) ) + "::" + m_name; } } ; diff --git a/include/lmms_basics.h b/include/lmms_basics.h index 3f7057ef7..31c231c1b 100644 --- a/include/lmms_basics.h +++ b/include/lmms_basics.h @@ -136,8 +136,8 @@ using surroundSampleFrame = std::array; constexpr std::size_t LMMS_ALIGN_SIZE = 16; -#define STRINGIFY(s) STR(s) -#define STR(PN) #PN +#define LMMS_STRINGIFY(s) LMMS_STR(s) +#define LMMS_STR(PN) #PN // Abstract away GUI CTRL key (linux/windows) vs ⌘ (apple) constexpr const char* UI_CTRL_KEY = diff --git a/include/versioninfo.h b/include/versioninfo.h index 1faab6804..2bb74a570 100644 --- a/include/versioninfo.h +++ b/include/versioninfo.h @@ -3,7 +3,7 @@ #ifdef __GNUC__ constexpr const char* LMMS_BUILDCONF_COMPILER_VERSION = "GCC " __VERSION__; #elif defined(_MSC_VER) -constexpr const char* LMMS_BUILDCONF_COMPILER_VERSION = "MSVC " STRINGIFY(_MSC_FULL_VER); +constexpr const char* LMMS_BUILDCONF_COMPILER_VERSION = "MSVC " LMMS_STRINGIFY(_MSC_FULL_VER); #else constexpr const char* LMMS_BUILDCONF_COMPILER_VERSION = "unknown compiler"; #endif diff --git a/plugins/Amplifier/Amplifier.cpp b/plugins/Amplifier/Amplifier.cpp index ced43f1e2..1212bcd6a 100644 --- a/plugins/Amplifier/Amplifier.cpp +++ b/plugins/Amplifier/Amplifier.cpp @@ -36,7 +36,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT amplifier_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Amplifier", QT_TRANSLATE_NOOP( "PluginBrowser", "A native amplifier plugin" ), "Vesa Kivimäki ", diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.cpp b/plugins/AudioFileProcessor/AudioFileProcessor.cpp index b5e991a2c..4ff93132b 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessor.cpp @@ -57,7 +57,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT audiofileprocessor_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "AudioFileProcessor", QT_TRANSLATE_NOOP( "PluginBrowser", "Simple sampler with various settings for " diff --git a/plugins/BassBooster/BassBooster.cpp b/plugins/BassBooster/BassBooster.cpp index b8ea271ee..280accddb 100644 --- a/plugins/BassBooster/BassBooster.cpp +++ b/plugins/BassBooster/BassBooster.cpp @@ -36,7 +36,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT bassbooster_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "BassBooster", QT_TRANSLATE_NOOP( "PluginBrowser", "Boost your bass the fast and simple way" ), "Tobias Doerffel ", diff --git a/plugins/BitInvader/BitInvader.cpp b/plugins/BitInvader/BitInvader.cpp index 55dd97386..0168031fc 100644 --- a/plugins/BitInvader/BitInvader.cpp +++ b/plugins/BitInvader/BitInvader.cpp @@ -54,7 +54,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT bitinvader_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "BitInvader", QT_TRANSLATE_NOOP( "PluginBrowser", "Customizable wavetable synthesizer" ), diff --git a/plugins/Bitcrush/Bitcrush.cpp b/plugins/Bitcrush/Bitcrush.cpp index 13f880623..68724eccd 100644 --- a/plugins/Bitcrush/Bitcrush.cpp +++ b/plugins/Bitcrush/Bitcrush.cpp @@ -43,7 +43,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT bitcrush_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Bitcrush", QT_TRANSLATE_NOOP( "PluginBrowser", "An oversampling bitcrusher" ), "Vesa Kivimäki ", diff --git a/plugins/CarlaPatchbay/CarlaPatchbay.cpp b/plugins/CarlaPatchbay/CarlaPatchbay.cpp index 7f5b2060e..e440d4e3f 100644 --- a/plugins/CarlaPatchbay/CarlaPatchbay.cpp +++ b/plugins/CarlaPatchbay/CarlaPatchbay.cpp @@ -37,7 +37,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT carlapatchbay_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Carla Patchbay", QT_TRANSLATE_NOOP( "PluginBrowser", "Carla Patchbay Instrument" ), diff --git a/plugins/CarlaRack/CarlaRack.cpp b/plugins/CarlaRack/CarlaRack.cpp index ad2dd00b8..5360baf96 100644 --- a/plugins/CarlaRack/CarlaRack.cpp +++ b/plugins/CarlaRack/CarlaRack.cpp @@ -37,7 +37,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT carlarack_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Carla Rack", QT_TRANSLATE_NOOP( "PluginBrowser", "Carla Rack Instrument" ), diff --git a/plugins/Compressor/Compressor.cpp b/plugins/Compressor/Compressor.cpp index 606888633..bf6928e21 100755 --- a/plugins/Compressor/Compressor.cpp +++ b/plugins/Compressor/Compressor.cpp @@ -38,7 +38,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT compressor_plugin_descriptor = { - STRINGIFY(PLUGIN_NAME), + LMMS_STRINGIFY(PLUGIN_NAME), "Compressor", QT_TRANSLATE_NOOP("PluginBrowser", "A dynamic range compressor."), "Lost Robot ", diff --git a/plugins/CrossoverEQ/CrossoverEQ.cpp b/plugins/CrossoverEQ/CrossoverEQ.cpp index d915afc23..641e06b4e 100644 --- a/plugins/CrossoverEQ/CrossoverEQ.cpp +++ b/plugins/CrossoverEQ/CrossoverEQ.cpp @@ -38,7 +38,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT crossovereq_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Crossover Equalizer", QT_TRANSLATE_NOOP( "PluginBrowser", "A 4-band Crossover Equalizer" ), "Vesa Kivimäki ", diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index 5ce29f8ec..1c6a74b86 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -39,7 +39,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT delay_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Delay", QT_TRANSLATE_NOOP( "PluginBrowser", "A native delay plugin" ), "Dave French ", diff --git a/plugins/DualFilter/DualFilter.cpp b/plugins/DualFilter/DualFilter.cpp index 2279ae37d..75a2ab532 100644 --- a/plugins/DualFilter/DualFilter.cpp +++ b/plugins/DualFilter/DualFilter.cpp @@ -38,7 +38,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT dualfilter_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Dual Filter", QT_TRANSLATE_NOOP( "PluginBrowser", "A Dual filter plugin" ), "Vesa Kivimäki ", diff --git a/plugins/DynamicsProcessor/DynamicsProcessor.cpp b/plugins/DynamicsProcessor/DynamicsProcessor.cpp index 85f1d94f4..c8ad9a029 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessor.cpp +++ b/plugins/DynamicsProcessor/DynamicsProcessor.cpp @@ -41,7 +41,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT dynamicsprocessor_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Dynamics Processor", QT_TRANSLATE_NOOP( "PluginBrowser", "plugin for processing dynamics in a flexible way" ), diff --git a/plugins/Eq/EqEffect.cpp b/plugins/Eq/EqEffect.cpp index 7a9b5b15e..12a10061b 100644 --- a/plugins/Eq/EqEffect.cpp +++ b/plugins/Eq/EqEffect.cpp @@ -39,7 +39,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT eq_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Equalizer", QT_TRANSLATE_NOOP( "PluginBrowser", "A native eq plugin" ), "Dave French ", diff --git a/plugins/Flanger/FlangerEffect.cpp b/plugins/Flanger/FlangerEffect.cpp index 71cf96e18..982702ebe 100644 --- a/plugins/Flanger/FlangerEffect.cpp +++ b/plugins/Flanger/FlangerEffect.cpp @@ -37,7 +37,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT flanger_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Flanger", QT_TRANSLATE_NOOP( "PluginBrowser", "A native flanger plugin" ), "Dave French ", diff --git a/plugins/FreeBoy/FreeBoy.cpp b/plugins/FreeBoy/FreeBoy.cpp index 67a7ac019..9f7085444 100644 --- a/plugins/FreeBoy/FreeBoy.cpp +++ b/plugins/FreeBoy/FreeBoy.cpp @@ -52,7 +52,7 @@ extern "C" { Plugin::Descriptor PLUGIN_EXPORT freeboy_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "FreeBoy", QT_TRANSLATE_NOOP( "PluginBrowser", "Emulation of GameBoy (TM) APU" ), diff --git a/plugins/GigPlayer/GigPlayer.cpp b/plugins/GigPlayer/GigPlayer.cpp index e3d37baa9..81a571ac7 100644 --- a/plugins/GigPlayer/GigPlayer.cpp +++ b/plugins/GigPlayer/GigPlayer.cpp @@ -64,7 +64,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT gigplayer_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "GIG Player", QT_TRANSLATE_NOOP( "PluginBrowser", "Player for GIG files" ), "Garrett Wilson ", diff --git a/plugins/HydrogenImport/HydrogenImport.cpp b/plugins/HydrogenImport/HydrogenImport.cpp index 9dc0950fb..657597471 100644 --- a/plugins/HydrogenImport/HydrogenImport.cpp +++ b/plugins/HydrogenImport/HydrogenImport.cpp @@ -24,7 +24,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT hydrogenimport_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Hydrogen Import", QT_TRANSLATE_NOOP( "PluginBrowser", "Filter for importing Hydrogen files into LMMS" ), diff --git a/plugins/Kicker/Kicker.cpp b/plugins/Kicker/Kicker.cpp index 4c5fa77f8..6a3c0823a 100644 --- a/plugins/Kicker/Kicker.cpp +++ b/plugins/Kicker/Kicker.cpp @@ -49,7 +49,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT kicker_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Kicker", QT_TRANSLATE_NOOP( "PluginBrowser", "Versatile drum synthesizer" ), diff --git a/plugins/LadspaBrowser/LadspaBrowser.cpp b/plugins/LadspaBrowser/LadspaBrowser.cpp index d40b855fd..cd10b47fd 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.cpp +++ b/plugins/LadspaBrowser/LadspaBrowser.cpp @@ -50,7 +50,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT ladspabrowser_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "LADSPA Plugin Browser", QT_TRANSLATE_NOOP( "PluginBrowser", "List installed LADSPA plugins" ), diff --git a/plugins/LadspaEffect/LadspaEffect.cpp b/plugins/LadspaEffect/LadspaEffect.cpp index a26e35eb7..c722dbaf3 100644 --- a/plugins/LadspaEffect/LadspaEffect.cpp +++ b/plugins/LadspaEffect/LadspaEffect.cpp @@ -53,7 +53,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT ladspaeffect_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "LADSPA", QT_TRANSLATE_NOOP( "PluginBrowser", "plugin for using arbitrary LADSPA-effects " diff --git a/plugins/Lb302/Lb302.cpp b/plugins/Lb302/Lb302.cpp index 999b66151..c60028520 100644 --- a/plugins/Lb302/Lb302.cpp +++ b/plugins/Lb302/Lb302.cpp @@ -80,7 +80,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT lb302_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "LB302", QT_TRANSLATE_NOOP( "PluginBrowser", "Incomplete monophonic imitation TB-303" ), diff --git a/plugins/Lb302/Lb302.h b/plugins/Lb302/Lb302.h index 770fb451e..57acb9ef3 100644 --- a/plugins/Lb302/Lb302.h +++ b/plugins/Lb302/Lb302.h @@ -29,8 +29,8 @@ */ -#ifndef LB302_H_ -#define LB302_H_ +#ifndef LB302_H +#define LB302_H #include "DspEffectLibrary.h" #include "Instrument.h" @@ -303,4 +303,4 @@ private: } // namespace lmms -#endif +#endif // LB302_H diff --git a/plugins/Lv2Effect/Lv2Effect.cpp b/plugins/Lv2Effect/Lv2Effect.cpp index d3755a2c9..f69ea4a38 100644 --- a/plugins/Lv2Effect/Lv2Effect.cpp +++ b/plugins/Lv2Effect/Lv2Effect.cpp @@ -40,7 +40,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT lv2effect_plugin_descriptor = { - STRINGIFY(PLUGIN_NAME), + LMMS_STRINGIFY(PLUGIN_NAME), "LV2", QT_TRANSLATE_NOOP("PluginBrowser", "plugin for using arbitrary LV2-effects inside LMMS."), diff --git a/plugins/Lv2Instrument/Lv2Instrument.cpp b/plugins/Lv2Instrument/Lv2Instrument.cpp index f7e0a2b37..01ccce15d 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.cpp +++ b/plugins/Lv2Instrument/Lv2Instrument.cpp @@ -49,7 +49,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT lv2instrument_plugin_descriptor = { - STRINGIFY(PLUGIN_NAME), + LMMS_STRINGIFY(PLUGIN_NAME), "LV2", QT_TRANSLATE_NOOP("PluginBrowser", "plugin for using arbitrary LV2 instruments inside LMMS."), diff --git a/plugins/MidiExport/MidiExport.cpp b/plugins/MidiExport/MidiExport.cpp index 6f0f5a11e..1fde83f06 100644 --- a/plugins/MidiExport/MidiExport.cpp +++ b/plugins/MidiExport/MidiExport.cpp @@ -44,7 +44,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT midiexport_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "MIDI Export", QT_TRANSLATE_NOOP( "PluginBrowser", "Filter for exporting MIDI-files from LMMS" ), diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index e6cf644cf..e9962838c 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -65,7 +65,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT midiimport_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "MIDI Import", QT_TRANSLATE_NOOP( "PluginBrowser", "Filter for importing MIDI-files into LMMS" ), diff --git a/plugins/Monstro/Monstro.cpp b/plugins/Monstro/Monstro.cpp index 889a89fb0..d5ad851ee 100644 --- a/plugins/Monstro/Monstro.cpp +++ b/plugins/Monstro/Monstro.cpp @@ -47,7 +47,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT monstro_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Monstro", QT_TRANSLATE_NOOP( "PluginBrowser", "Monstrous 3-oscillator synth with modulation matrix" ), diff --git a/plugins/MultitapEcho/MultitapEcho.cpp b/plugins/MultitapEcho/MultitapEcho.cpp index f3d03740c..05c3f30fe 100644 --- a/plugins/MultitapEcho/MultitapEcho.cpp +++ b/plugins/MultitapEcho/MultitapEcho.cpp @@ -36,7 +36,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT multitapecho_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Multitap Echo", QT_TRANSLATE_NOOP( "PluginBrowser", "A multitap echo delay plugin" ), "Vesa Kivimäki ", diff --git a/plugins/Nes/Nes.cpp b/plugins/Nes/Nes.cpp index b774f7efa..f3537d88c 100644 --- a/plugins/Nes/Nes.cpp +++ b/plugins/Nes/Nes.cpp @@ -45,7 +45,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT nes_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Nescaline", QT_TRANSLATE_NOOP( "PluginBrowser", "A NES-like synthesizer" ), diff --git a/plugins/OpulenZ/OpulenZ.cpp b/plugins/OpulenZ/OpulenZ.cpp index 6abfb4e19..beec8841b 100644 --- a/plugins/OpulenZ/OpulenZ.cpp +++ b/plugins/OpulenZ/OpulenZ.cpp @@ -67,7 +67,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT opulenz_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "OpulenZ", QT_TRANSLATE_NOOP( "PluginBrowser", "2-operator FM Synth" ), diff --git a/plugins/Organic/Organic.cpp b/plugins/Organic/Organic.cpp index 320769200..6271f6c40 100644 --- a/plugins/Organic/Organic.cpp +++ b/plugins/Organic/Organic.cpp @@ -50,7 +50,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT organic_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Organic", QT_TRANSLATE_NOOP( "PluginBrowser", "Additive Synthesizer for organ-like sounds" ), diff --git a/plugins/Patman/Patman.cpp b/plugins/Patman/Patman.cpp index 25b055b9c..c6fb202c9 100644 --- a/plugins/Patman/Patman.cpp +++ b/plugins/Patman/Patman.cpp @@ -55,7 +55,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT patman_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "PatMan", QT_TRANSLATE_NOOP( "PluginBrowser", "GUS-compatible patch instrument" ), diff --git a/plugins/Patman/Patman.h b/plugins/Patman/Patman.h index 206c2e503..eee122129 100644 --- a/plugins/Patman/Patman.h +++ b/plugins/Patman/Patman.h @@ -23,8 +23,8 @@ */ -#ifndef PATMAN_H_ -#define PATMAN_H_ +#ifndef PATMAN_H +#define PATMAN_H #include "Instrument.h" #include "InstrumentView.h" @@ -162,4 +162,4 @@ private: } // namespace lmms -#endif +#endif // PATMAN_H diff --git a/plugins/PeakControllerEffect/PeakControllerEffect.cpp b/plugins/PeakControllerEffect/PeakControllerEffect.cpp index 529437d6e..d32a22320 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffect.cpp +++ b/plugins/PeakControllerEffect/PeakControllerEffect.cpp @@ -42,7 +42,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT peakcontrollereffect_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Peak Controller", QT_TRANSLATE_NOOP( "PluginBrowser", "Plugin for controlling knobs with sound peaks" ), diff --git a/plugins/ReverbSC/ReverbSC.cpp b/plugins/ReverbSC/ReverbSC.cpp index 6faea8c9a..4d72dc319 100644 --- a/plugins/ReverbSC/ReverbSC.cpp +++ b/plugins/ReverbSC/ReverbSC.cpp @@ -37,7 +37,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT reverbsc_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "ReverbSC", QT_TRANSLATE_NOOP( "PluginBrowser", "Reverb algorithm by Sean Costello" ), "Paul Batchelor", diff --git a/plugins/Sf2Player/Sf2Player.cpp b/plugins/Sf2Player/Sf2Player.cpp index 8b17f0bb0..291f7fb76 100644 --- a/plugins/Sf2Player/Sf2Player.cpp +++ b/plugins/Sf2Player/Sf2Player.cpp @@ -58,7 +58,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT sf2player_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Sf2 Player", QT_TRANSLATE_NOOP( "PluginBrowser", "Player for SoundFont files" ), "Paul Giblock ", diff --git a/plugins/Sfxr/Sfxr.cpp b/plugins/Sfxr/Sfxr.cpp index ad7dd26a7..a8bb81219 100644 --- a/plugins/Sfxr/Sfxr.cpp +++ b/plugins/Sfxr/Sfxr.cpp @@ -61,7 +61,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT sfxr_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "sfxr", QT_TRANSLATE_NOOP( "PluginBrowser", "LMMS port of sfxr" ), diff --git a/plugins/Sid/SidInstrument.cpp b/plugins/Sid/SidInstrument.cpp index 450d172cf..e075ed049 100644 --- a/plugins/Sid/SidInstrument.cpp +++ b/plugins/Sid/SidInstrument.cpp @@ -75,7 +75,7 @@ extern "C" { Plugin::Descriptor PLUGIN_EXPORT sid_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "SID", QT_TRANSLATE_NOOP( "PluginBrowser", "Emulation of the MOS6581 and MOS8580 " "SID.\nThis chip was used in the Commodore 64 computer." ), diff --git a/plugins/StereoEnhancer/StereoEnhancer.cpp b/plugins/StereoEnhancer/StereoEnhancer.cpp index bda9c8086..1351ab885 100644 --- a/plugins/StereoEnhancer/StereoEnhancer.cpp +++ b/plugins/StereoEnhancer/StereoEnhancer.cpp @@ -37,7 +37,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT stereoenhancer_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "StereoEnhancer Effect", QT_TRANSLATE_NOOP( "PluginBrowser", "Plugin for enhancing stereo separation of a stereo input file" ), diff --git a/plugins/StereoMatrix/StereoMatrix.cpp b/plugins/StereoMatrix/StereoMatrix.cpp index de15d8370..34b2fc86b 100644 --- a/plugins/StereoMatrix/StereoMatrix.cpp +++ b/plugins/StereoMatrix/StereoMatrix.cpp @@ -37,7 +37,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT stereomatrix_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Stereo Matrix", QT_TRANSLATE_NOOP( "PluginBrowser", "Plugin for freely manipulating stereo output" ), diff --git a/plugins/Stk/Mallets/Mallets.cpp b/plugins/Stk/Mallets/Mallets.cpp index 37ab3f6f1..4adfb5347 100644 --- a/plugins/Stk/Mallets/Mallets.cpp +++ b/plugins/Stk/Mallets/Mallets.cpp @@ -53,7 +53,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT malletsstk_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Mallets", QT_TRANSLATE_NOOP( "PluginBrowser", "Tuneful things to bang on" ), diff --git a/plugins/TripleOscillator/TripleOscillator.cpp b/plugins/TripleOscillator/TripleOscillator.cpp index 2931c3b85..f19754019 100644 --- a/plugins/TripleOscillator/TripleOscillator.cpp +++ b/plugins/TripleOscillator/TripleOscillator.cpp @@ -50,7 +50,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT tripleoscillator_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "TripleOscillator", QT_TRANSLATE_NOOP( "PluginBrowser", "Three powerful oscillators you can modulate " diff --git a/plugins/Vectorscope/Vectorscope.cpp b/plugins/Vectorscope/Vectorscope.cpp index df093f671..b9880691c 100644 --- a/plugins/Vectorscope/Vectorscope.cpp +++ b/plugins/Vectorscope/Vectorscope.cpp @@ -34,7 +34,7 @@ namespace lmms extern "C" { Plugin::Descriptor PLUGIN_EXPORT vectorscope_plugin_descriptor = { - STRINGIFY(PLUGIN_NAME), + LMMS_STRINGIFY(PLUGIN_NAME), "Vectorscope", QT_TRANSLATE_NOOP("PluginBrowser", "A stereo field visualizer."), "Martin Pavelek ", diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index 150a4f1e4..f5ac06e6d 100644 --- a/plugins/Vestige/Vestige.cpp +++ b/plugins/Vestige/Vestige.cpp @@ -71,7 +71,7 @@ extern "C" Plugin::Descriptor Q_DECL_EXPORT vestige_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "VeSTige", QT_TRANSLATE_NOOP( "PluginBrowser", "VST-host for using VST(i)-plugins within LMMS" ), diff --git a/plugins/Vibed/Vibed.cpp b/plugins/Vibed/Vibed.cpp index 87c42b187..b9bcd9f1b 100644 --- a/plugins/Vibed/Vibed.cpp +++ b/plugins/Vibed/Vibed.cpp @@ -52,7 +52,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT vibedstrings_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Vibed", QT_TRANSLATE_NOOP( "PluginBrowser", "Vibrating string modeler" ), diff --git a/plugins/VstBase/vst_base.cpp b/plugins/VstBase/vst_base.cpp index 6885feb97..80cb9d736 100644 --- a/plugins/VstBase/vst_base.cpp +++ b/plugins/VstBase/vst_base.cpp @@ -36,7 +36,7 @@ extern "C" Plugin::Descriptor VSTBASE_EXPORT vstbase_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "VST Base", "library for all LMMS plugins dealing with VST-plugins", "Tobias Doerffel ", diff --git a/plugins/VstEffect/VstEffect.cpp b/plugins/VstEffect/VstEffect.cpp index 4fd66dbb5..eee3919c4 100644 --- a/plugins/VstEffect/VstEffect.cpp +++ b/plugins/VstEffect/VstEffect.cpp @@ -43,7 +43,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT vsteffect_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "VST", QT_TRANSLATE_NOOP( "PluginBrowser", "plugin for using arbitrary VST effects inside LMMS." ), diff --git a/plugins/Watsyn/Watsyn.cpp b/plugins/Watsyn/Watsyn.cpp index 7978dc120..1c363d417 100644 --- a/plugins/Watsyn/Watsyn.cpp +++ b/plugins/Watsyn/Watsyn.cpp @@ -46,7 +46,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT watsyn_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Watsyn", QT_TRANSLATE_NOOP( "PluginBrowser", "4-oscillator modulatable wavetable synth" ), diff --git a/plugins/WaveShaper/WaveShaper.cpp b/plugins/WaveShaper/WaveShaper.cpp index ededa2e0f..7f0cf732f 100644 --- a/plugins/WaveShaper/WaveShaper.cpp +++ b/plugins/WaveShaper/WaveShaper.cpp @@ -40,7 +40,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT waveshaper_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "Waveshaper Effect", QT_TRANSLATE_NOOP( "PluginBrowser", "plugin for waveshaping" ), diff --git a/plugins/Xpressive/Xpressive.cpp b/plugins/Xpressive/Xpressive.cpp index a69343e07..de1140ed1 100644 --- a/plugins/Xpressive/Xpressive.cpp +++ b/plugins/Xpressive/Xpressive.cpp @@ -54,7 +54,7 @@ namespace lmms extern "C" { -Plugin::Descriptor PLUGIN_EXPORT xpressive_plugin_descriptor = { STRINGIFY( +Plugin::Descriptor PLUGIN_EXPORT xpressive_plugin_descriptor = { LMMS_STRINGIFY( PLUGIN_NAME), "Xpressive", QT_TRANSLATE_NOOP("PluginBrowser", "Mathematical expression parser"), "Orr Dvori", 0x0100, Plugin::Instrument, new PluginPixmapLoader("logo"), nullptr, nullptr }; diff --git a/plugins/ZynAddSubFx/ZynAddSubFx.cpp b/plugins/ZynAddSubFx/ZynAddSubFx.cpp index 27cb4728e..d3b1a90ed 100644 --- a/plugins/ZynAddSubFx/ZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/ZynAddSubFx.cpp @@ -60,7 +60,7 @@ extern "C" Plugin::Descriptor PLUGIN_EXPORT zynaddsubfx_plugin_descriptor = { - STRINGIFY( PLUGIN_NAME ), + LMMS_STRINGIFY( PLUGIN_NAME ), "ZynAddSubFX", QT_TRANSLATE_NOOP( "PluginBrowser", "Embedded ZynAddSubFX" ), diff --git a/src/gui/instrument/InstrumentMidiIOView.cpp b/src/gui/instrument/InstrumentMidiIOView.cpp index f42208b51..f98f58f5a 100644 --- a/src/gui/instrument/InstrumentMidiIOView.cpp +++ b/src/gui/instrument/InstrumentMidiIOView.cpp @@ -144,8 +144,6 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : midiOutputLayout->insertWidget( 0, m_wpBtn ); } -#define PROVIDE_CUSTOM_BASE_VELOCITY_UI -#ifdef PROVIDE_CUSTOM_BASE_VELOCITY_UI GroupBox* baseVelocityGroupBox = new GroupBox( tr( "CUSTOM BASE VELOCITY" ) ); layout->addWidget( baseVelocityGroupBox ); @@ -166,7 +164,6 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : connect( baseVelocityGroupBox->ledButton(), SIGNAL( toggled( bool ) ), m_baseVelocitySpinBox, SLOT( setEnabled( bool ) ) ); -#endif layout->addStretch(); } @@ -195,9 +192,7 @@ void InstrumentMidiIOView::modelChanged() m_fixedOutputNoteSpinBox->setModel( &mp->m_fixedOutputNoteModel ); m_outputProgramSpinBox->setModel( &mp->m_outputProgramModel ); -#ifdef PROVIDE_CUSTOM_BASE_VELOCITY_UI m_baseVelocitySpinBox->setModel( &mp->m_baseVelocityModel ); -#endif if( m_rpBtn ) { diff --git a/src/lmmsconfig.h.in b/src/lmmsconfig.h.in index 30fbfdf3f..d130d6fc2 100644 --- a/src/lmmsconfig.h.in +++ b/src/lmmsconfig.h.in @@ -53,25 +53,3 @@ #cmakedefine LMMS_HAVE_STRING_H #cmakedefine LMMS_HAVE_PROCESS_H #cmakedefine LMMS_HAVE_LOCALE_H - -/* defines for libsamplerate */ - - -/* Target processor clips on negative float to int conversion. */ -#cmakedefine CPU_CLIPS_NEGATIVE 1 -#ifndef CPU_CLIPS_NEGATIVE -#define CPU_CLIPS_NEGATIVE 0 -#endif - -/* Target processor clips on positive float to int conversion. */ -#cmakedefine CPU_CLIPS_POSITIVE 1 -#ifndef CPU_CLIPS_POSITIVE -#define CPU_CLIPS_POSITIVE 0 -#endif - -/* Define if you have C99's lrint function. */ -#cmakedefine HAVE_LRINT 1 - -/* Define if you have C99's lrintf function. */ -#cmakedefine HAVE_LRINTF 1 - From 420769a32d94869c3cf926eeadd1dd7aa4c1952e Mon Sep 17 00:00:00 2001 From: sakertooth Date: Fri, 22 Apr 2022 22:04:57 -0400 Subject: [PATCH 05/55] Fix Qt Deprecations (#6386) Co-authored-by: Kevin Zander Co-authored-by: Dominic Clark --- include/AudioEngine.h | 9 +++++++++ include/AutomationClip.h | 7 +++++++ include/FileBrowser.h | 8 ++++++++ include/RemotePlugin.h | 8 ++++++++ src/core/AudioEngine.cpp | 2 ++ src/core/AutomationClip.cpp | 4 ++++ src/core/RemotePlugin.cpp | 4 +++- src/gui/FileBrowser.cpp | 6 ++++-- src/gui/MicrotunerConfig.cpp | 22 +++++++++++++++++++--- src/gui/clips/ClipView.cpp | 2 +- src/gui/tracks/InstrumentTrackView.cpp | 2 +- src/gui/tracks/TrackOperationsWidget.cpp | 2 +- 12 files changed, 67 insertions(+), 9 deletions(-) diff --git a/include/AudioEngine.h b/include/AudioEngine.h index 44854c826..8cadcc0e2 100644 --- a/include/AudioEngine.h +++ b/include/AudioEngine.h @@ -26,6 +26,11 @@ #define AUDIO_ENGINE_H #include + +#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + #include +#endif + #include #include #include @@ -464,7 +469,11 @@ private: bool m_changesSignal; unsigned int m_changes; QMutex m_changesMutex; +#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QRecursiveMutex m_doChangesMutex; +#else QMutex m_doChangesMutex; +#endif QMutex m_waitChangesMutex; QWaitCondition m_changesAudioEngineCondition; QWaitCondition m_changesRequestCondition; diff --git a/include/AutomationClip.h b/include/AutomationClip.h index 63c13a120..575203bc4 100644 --- a/include/AutomationClip.h +++ b/include/AutomationClip.h @@ -29,6 +29,9 @@ #include #include +#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + #include +#endif #include "AutomationNode.h" #include "Clip.h" @@ -189,7 +192,11 @@ private: // Mutex to make methods involving automation clips thread safe // Mutable so we can lock it from const objects +#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + mutable QRecursiveMutex m_clipMutex; +#else mutable QMutex m_clipMutex; +#endif AutomationTrack * m_autoTrack; QVector m_idsToResolve; diff --git a/include/FileBrowser.h b/include/FileBrowser.h index 315248d42..d14533f45 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -29,6 +29,9 @@ #include #include #include +#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + #include +#endif #include @@ -140,7 +143,12 @@ private: //! This should only be accessed or modified when m_pphMutex is held PlayHandle* m_previewPlayHandle; + +#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QRecursiveMutex m_pphMutex; +#else QMutex m_pphMutex; +#endif QList getContextActions(FileItem* item, bool songEditor); diff --git a/include/RemotePlugin.h b/include/RemotePlugin.h index 73810150d..96c910d5d 100644 --- a/include/RemotePlugin.h +++ b/include/RemotePlugin.h @@ -28,6 +28,10 @@ #include "RemotePluginBase.h" #include "SharedMemory.h" +#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + #include +#endif + namespace lmms { @@ -158,7 +162,11 @@ private: QString m_exec; QStringList m_args; +#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QRecursiveMutex m_commMutex; +#else QMutex m_commMutex; +#endif bool m_splitChannels; SharedMemory m_audioBuffer; diff --git a/src/core/AudioEngine.cpp b/src/core/AudioEngine.cpp index 827e8b2e4..d6b0d62b5 100644 --- a/src/core/AudioEngine.cpp +++ b/src/core/AudioEngine.cpp @@ -94,7 +94,9 @@ AudioEngine::AudioEngine( bool renderOnly ) : m_clearSignal( false ), m_changesSignal( false ), m_changes( 0 ), +#if (QT_VERSION < QT_VERSION_CHECK(5,14,0)) m_doChangesMutex( QMutex::Recursive ), +#endif m_waitingForWrite( false ) { for( int i = 0; i < 2; ++i ) diff --git a/src/core/AutomationClip.cpp b/src/core/AutomationClip.cpp index 928cf48a9..feeed3fc2 100644 --- a/src/core/AutomationClip.cpp +++ b/src/core/AutomationClip.cpp @@ -47,7 +47,9 @@ const float AutomationClip::DEFAULT_MAX_VALUE = 1; AutomationClip::AutomationClip( AutomationTrack * _auto_track ) : Clip( _auto_track ), +#if (QT_VERSION < QT_VERSION_CHECK(5,14,0)) m_clipMutex(QMutex::Recursive), +#endif m_autoTrack( _auto_track ), m_objects(), m_tension( 1.0 ), @@ -79,7 +81,9 @@ AutomationClip::AutomationClip( AutomationTrack * _auto_track ) : AutomationClip::AutomationClip( const AutomationClip & _clip_to_copy ) : Clip( _clip_to_copy.m_autoTrack ), +#if (QT_VERSION < QT_VERSION_CHECK(5,14,0)) m_clipMutex(QMutex::Recursive), +#endif m_autoTrack( _clip_to_copy.m_autoTrack ), m_objects( _clip_to_copy.m_objects ), m_tension( _clip_to_copy.m_tension ), diff --git a/src/core/RemotePlugin.cpp b/src/core/RemotePlugin.cpp index ff18fde53..43eed30a7 100644 --- a/src/core/RemotePlugin.cpp +++ b/src/core/RemotePlugin.cpp @@ -138,7 +138,9 @@ RemotePlugin::RemotePlugin() : #endif m_failed( true ), m_watcher( this ), - m_commMutex( QMutex::Recursive ), +#if (QT_VERSION < QT_VERSION_CHECK(5,14,0)) + m_commMutex(QMutex::Recursive), +#endif m_splitChannels( false ), m_audioBufferSize( 0 ), m_inputCount( DEFAULT_CHANNELS ), diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 7f212b10a..c4f68cf28 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -372,8 +372,10 @@ FileBrowserTreeWidget::FileBrowserTreeWidget(QWidget * parent ) : QTreeWidget( parent ), m_mousePressed( false ), m_pressPos(), - m_previewPlayHandle( nullptr ), - m_pphMutex( QMutex::Recursive ) + m_previewPlayHandle( nullptr ) +#if (QT_VERSION < QT_VERSION_CHECK(5,14,0)) + ,m_pphMutex(QMutex::Recursive) +#endif { setColumnCount( 1 ); headerItem()->setHidden( true ); diff --git a/src/gui/MicrotunerConfig.cpp b/src/gui/MicrotunerConfig.cpp index dc0ef4a37..4522da5c5 100644 --- a/src/gui/MicrotunerConfig.cpp +++ b/src/gui/MicrotunerConfig.cpp @@ -317,7 +317,11 @@ bool MicrotunerConfig::validateScaleForm() if (name.contains('\n')) {fail(tr("Scale name cannot contain a new-line character")); return false;} // check intervals - QStringList input = m_scaleTextEdit->toPlainText().split('\n', QString::SkipEmptyParts); + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QStringList input = m_scaleTextEdit->toPlainText().split('\n', Qt::SkipEmptyParts); + #else + QStringList input = m_scaleTextEdit->toPlainText().split('\n', QString::SkipEmptyParts); + #endif for (auto &line: input) { if (line.isEmpty()) {continue;} @@ -361,7 +365,11 @@ bool MicrotunerConfig::validateKeymapForm() if (name.contains('\n')) {fail(tr("Keymap name cannot contain a new-line character")); return false;} // check key mappings - QStringList input = m_keymapTextEdit->toPlainText().split('\n', QString::SkipEmptyParts); + #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QStringList input = m_keymapTextEdit->toPlainText().split('\n', Qt::SkipEmptyParts); + #else + QStringList input = m_keymapTextEdit->toPlainText().split('\n', QString::SkipEmptyParts); + #endif for (auto &line: input) { if (line.isEmpty()) {continue;} @@ -391,7 +399,11 @@ bool MicrotunerConfig::applyScale() std::vector newIntervals; newIntervals.push_back(Interval(1, 1)); - QStringList input = m_scaleTextEdit->toPlainText().split('\n', QString::SkipEmptyParts); +#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QStringList input = m_keymapTextEdit->toPlainText().split('\n', Qt::SkipEmptyParts); +#else + QStringList input = m_keymapTextEdit->toPlainText().split('\n', QString::SkipEmptyParts); +#endif for (auto &line: input) { if (line.isEmpty()) {continue;} @@ -433,7 +445,11 @@ bool MicrotunerConfig::applyKeymap() std::vector newMap; +#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) + QStringList input = m_keymapTextEdit->toPlainText().split('\n', Qt::SkipEmptyParts); +#else QStringList input = m_keymapTextEdit->toPlainText().split('\n', QString::SkipEmptyParts); +#endif for (auto &line: input) { if (line.isEmpty()) {continue;} diff --git a/src/gui/clips/ClipView.cpp b/src/gui/clips/ClipView.cpp index 12603b2e7..a9afca910 100644 --- a/src/gui/clips/ClipView.cpp +++ b/src/gui/clips/ClipView.cpp @@ -755,7 +755,7 @@ void ClipView::mousePressEvent( QMouseEvent * me ) } } } - else if( me->button() == Qt::MidButton ) + else if( me->button() == Qt::MiddleButton ) { if( me->modifiers() & Qt::ControlModifier ) { diff --git a/src/gui/tracks/InstrumentTrackView.cpp b/src/gui/tracks/InstrumentTrackView.cpp index b7a2fda61..4c16287ed 100644 --- a/src/gui/tracks/InstrumentTrackView.cpp +++ b/src/gui/tracks/InstrumentTrackView.cpp @@ -145,7 +145,7 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV this, SLOT(toggleMidiCCRack())); m_activityIndicator = new FadeButton( QApplication::palette().color( QPalette::Active, - QPalette::Background), + QPalette::Window), QApplication::palette().color( QPalette::Active, QPalette::BrightText ), QApplication::palette().color( QPalette::Active, diff --git a/src/gui/tracks/TrackOperationsWidget.cpp b/src/gui/tracks/TrackOperationsWidget.cpp index c529b26e8..2670f891d 100644 --- a/src/gui/tracks/TrackOperationsWidget.cpp +++ b/src/gui/tracks/TrackOperationsWidget.cpp @@ -178,7 +178,7 @@ void TrackOperationsWidget::paintEvent( QPaintEvent * pe ) { QPainter p( this ); - p.fillRect( rect(), palette().brush(QPalette::Background) ); + p.fillRect(rect(), palette().brush(QPalette::Window)); if( m_trackView->getTrack()->useColor() && ! m_trackView->getTrack()->getMutedModel()->value() ) { From 773310384b12ff78d82ba483957ef1520215c805 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Thu, 23 Jun 2022 21:27:23 +0200 Subject: [PATCH 06/55] clang-tidy: Apply modernize-redundant-void-arg everywhere (#6446) --- include/AudioJack.h | 2 +- include/AudioSndio.h | 12 ++++---- include/DrumSynth.h | 4 +-- include/ExportProjectDialog.h | 4 +-- include/FileBrowser.h | 18 ++++++------ include/Graph.h | 2 +- include/LmmsStyle.h | 2 +- include/MainWindow.h | 2 +- include/MidiSndio.h | 8 +++--- include/PeakController.h | 2 +- include/Plugin.h | 2 +- .../AudioFileProcessor/AudioFileProcessor.cpp | 20 ++++++------- plugins/BitInvader/BitInvader.cpp | 4 +-- plugins/BitInvader/BitInvader.h | 2 +- plugins/Eq/EqSpectrumView.cpp | 2 +- plugins/Lb302/Lb302.cpp | 28 +++++++++---------- plugins/Lv2Instrument/Lv2Instrument.cpp | 2 +- plugins/MidiImport/MidiImport.h | 2 +- plugins/Patman/Patman.cpp | 10 +++---- plugins/Patman/Patman.h | 14 +++++----- plugins/Sf2Player/PatchesDialog.cpp | 4 +-- plugins/Vestige/Vestige.cpp | 4 +-- plugins/Vestige/Vestige.h | 26 ++++++++--------- plugins/Vibed/Vibed.cpp | 2 +- plugins/VstBase/VstPlugin.cpp | 4 +-- plugins/VstBase/VstPlugin.h | 4 +-- plugins/VstEffect/VstEffectControls.cpp | 22 +++++++-------- plugins/VstEffect/VstEffectControls.h | 18 ++++++------ plugins/Xpressive/Xpressive.h | 6 ++-- src/core/DrumSynth.cpp | 4 +-- src/core/PeakController.cpp | 6 ++-- src/core/audio/AudioSndio.cpp | 10 +++---- src/core/midi/MidiSndio.cpp | 6 ++-- src/gui/ControllerRackView.cpp | 2 +- src/gui/FileBrowser.cpp | 12 ++++---- src/gui/LmmsStyle.cpp | 2 +- src/gui/instrument/InstrumentView.cpp | 2 +- src/gui/widgets/Graph.cpp | 8 +++--- 38 files changed, 142 insertions(+), 142 deletions(-) diff --git a/include/AudioJack.h b/include/AudioJack.h index 7b6597e86..aed0878ad 100644 --- a/include/AudioJack.h +++ b/include/AudioJack.h @@ -64,7 +64,7 @@ public: // the jack callback is handled here, we call the midi client so that it can read // it's midi data during the callback AudioJack * addMidiClient(MidiJack *midiClient); - void removeMidiClient(void) { m_midiClient = nullptr; } + void removeMidiClient() { m_midiClient = nullptr; } jack_client_t * jackClient() {return m_client;}; inline static QString name() diff --git a/include/AudioSndio.h b/include/AudioSndio.h index ebc443a68..993a44432 100644 --- a/include/AudioSndio.h +++ b/include/AudioSndio.h @@ -54,7 +54,7 @@ public: AudioSndio( bool & _success_ful, AudioEngine * _audioEngine ); ~AudioSndio() override; - inline static QString name( void ) + inline static QString name() { return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "sndio" ); } @@ -65,7 +65,7 @@ public: setupWidget( QWidget * _parent ); ~setupWidget() override; - void saveSettings( void ) override; + void saveSettings() override; private: QLineEdit * m_device; @@ -73,10 +73,10 @@ public: } ; private: - void startProcessing( void ) override; - void stopProcessing( void ) override; - void applyQualitySettings( void ) override; - void run( void ) override; + void startProcessing() override; + void stopProcessing() override; + void applyQualitySettings() override; + void run() override; struct sio_hdl *m_hdl; struct sio_par m_par; diff --git a/include/DrumSynth.h b/include/DrumSynth.h index 27941f67d..28121fc75 100644 --- a/include/DrumSynth.h +++ b/include/DrumSynth.h @@ -41,8 +41,8 @@ class DrumSynth { int GetDSFileSamples(QString dsfile, int16_t *&wave, int channels, sample_rate_t Fs); private: - float LoudestEnv(void); - int LongestEnv(void); + float LoudestEnv(); + int LongestEnv(); void UpdateEnv(int e, long t); void GetEnv(int env, const char *sec, const char *key, QString ini); diff --git a/include/ExportProjectDialog.h b/include/ExportProjectDialog.h index 5e4418a28..56d039afe 100644 --- a/include/ExportProjectDialog.h +++ b/include/ExportProjectDialog.h @@ -45,12 +45,12 @@ public: ExportProjectDialog( const QString & _file_name, QWidget * _parent, bool multi_export ); protected: - void reject( void ) override; + void reject() override; void closeEvent( QCloseEvent * _ce ) override; private slots: - void startBtnClicked( void ); + void startBtnClicked(); void updateTitleBar( int ); void accept() override; void startExport(); diff --git a/include/FileBrowser.h b/include/FileBrowser.h index d14533f45..43a0b3331 100644 --- a/include/FileBrowser.h +++ b/include/FileBrowser.h @@ -74,7 +74,7 @@ public: ~FileBrowser() override = default; private slots: - void reloadTree( void ); + void reloadTree(); void expandItems( QTreeWidgetItem * item=nullptr, QList expandedDirs = QList() ); // call with item=NULL to filter the entire tree bool filterItems( const QString & filter, QTreeWidgetItem * item=nullptr ); @@ -172,7 +172,7 @@ public: Directory( const QString & filename, const QString & path, const QString & filter ); - void update( void ); + void update(); inline QString fullName( QString path = QString() ) { @@ -195,7 +195,7 @@ public: private: - void initPixmaps( void ); + void initPixmaps(); bool addItems( const QString & path ); @@ -256,28 +256,28 @@ public: return QFileInfo(m_path, text(0)).absoluteFilePath(); } - inline FileTypes type( void ) const + inline FileTypes type() const { return( m_type ); } - inline FileHandling handling( void ) const + inline FileHandling handling() const { return( m_handling ); } - inline bool isTrack( void ) const + inline bool isTrack() const { return m_handling == LoadAsPreset || m_handling == LoadByPlugin; } - QString extension( void ); + QString extension(); static QString extension( const QString & file ); private: - void initPixmaps( void ); - void determineFileType( void ); + void initPixmaps(); + void determineFileType(); static QPixmap * s_projectFilePixmap; static QPixmap * s_presetFilePixmap; diff --git a/include/Graph.h b/include/Graph.h index 747fcf29a..178d1b567 100644 --- a/include/Graph.h +++ b/include/Graph.h @@ -197,7 +197,7 @@ public slots: void setWaveToSaw(); void setWaveToSquare(); void setWaveToNoise(); - QString setWaveToUser( ); + QString setWaveToUser(); void smooth(); void smoothNonCyclic(); diff --git a/include/LmmsStyle.h b/include/LmmsStyle.h index 72895a102..cfab2cd66 100644 --- a/include/LmmsStyle.h +++ b/include/LmmsStyle.h @@ -70,7 +70,7 @@ public: { } - QPalette standardPalette( void ) const override; + QPalette standardPalette() const override; void drawComplexControl( ComplexControl control, diff --git a/include/MainWindow.h b/include/MainWindow.h index 05aa716b5..e093d1082 100644 --- a/include/MainWindow.h +++ b/include/MainWindow.h @@ -242,7 +242,7 @@ private: private slots: void browseHelp(); void showTool( QAction * _idx ); - void updateViewMenu( void ); + void updateViewMenu(); void updateConfig( QAction * _who ); void onToggleMetronome(); void onExportProject(); diff --git a/include/MidiSndio.h b/include/MidiSndio.h index 1ffbae5ce..35788131d 100644 --- a/include/MidiSndio.h +++ b/include/MidiSndio.h @@ -45,12 +45,12 @@ class MidiSndio : public QThread, public MidiClientRaw { Q_OBJECT public: - MidiSndio( void ); + MidiSndio(); ~MidiSndio() override; - static QString probeDevice(void); + static QString probeDevice(); - inline static QString name(void) + inline static QString name() { return QT_TRANSLATE_NOOP("MidiSetupWidget", "sndio MIDI"); } @@ -63,7 +63,7 @@ public: protected: void sendByte(const unsigned char c) override; - void run(void) override; + void run() override; private: mio_hdl *m_hdl; diff --git a/include/PeakController.h b/include/PeakController.h index 01a8e968c..2999c5a2b 100644 --- a/include/PeakController.h +++ b/include/PeakController.h @@ -61,7 +61,7 @@ public: public slots: gui::ControllerDialog * createDialog( QWidget * _parent ) override; - void handleDestroyedEffect( ); + void handleDestroyedEffect(); void updateCoeffs(); protected: diff --git a/include/Plugin.h b/include/Plugin.h index 7042edb41..da2deeaed 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -253,7 +253,7 @@ public: const PixmapLoader *logo() const; //! Return plugin type - inline PluginTypes type( void ) const + inline PluginTypes type() const { return m_descriptor->type; } diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.cpp b/plugins/AudioFileProcessor/AudioFileProcessor.cpp index 4ff93132b..3d4319dd3 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessor.cpp @@ -289,7 +289,7 @@ void AudioFileProcessor::loadFile( const QString & _file ) -QString AudioFileProcessor::nodeName( void ) const +QString AudioFileProcessor::nodeName() const { return audiofileprocessor_plugin_descriptor.name; } @@ -339,7 +339,7 @@ void AudioFileProcessor::setAudioFile( const QString & _audio_file, -void AudioFileProcessor::reverseModelChanged( void ) +void AudioFileProcessor::reverseModelChanged() { m_sampleBuffer.setReversed( m_reverseModel.value() ); m_nextPlayStartPoint = m_sampleBuffer.startFrame(); @@ -349,7 +349,7 @@ void AudioFileProcessor::reverseModelChanged( void ) -void AudioFileProcessor::ampModelChanged( void ) +void AudioFileProcessor::ampModelChanged() { m_sampleBuffer.setAmplification( m_ampModel.value() / 100.0f ); } @@ -362,7 +362,7 @@ void AudioFileProcessor::stutterModelChanged() } -void AudioFileProcessor::startPointChanged( void ) +void AudioFileProcessor::startPointChanged() { // check if start is over end and swap values if so if( m_startPointModel.value() > m_endPointModel.value() ) @@ -394,14 +394,14 @@ void AudioFileProcessor::startPointChanged( void ) } -void AudioFileProcessor::endPointChanged( void ) +void AudioFileProcessor::endPointChanged() { // same as start, for now startPointChanged(); } -void AudioFileProcessor::loopPointChanged( void ) +void AudioFileProcessor::loopPointChanged() { // check that loop point is between start-end points and not overlapping with endpoint @@ -424,7 +424,7 @@ void AudioFileProcessor::loopPointChanged( void ) pointChanged(); } -void AudioFileProcessor::pointChanged( void ) +void AudioFileProcessor::pointChanged() { const f_cnt_t f_start = static_cast( m_startPointModel.value() * ( m_sampleBuffer.frames()-1 ) ); const f_cnt_t f_end = static_cast( m_endPointModel.value() * ( m_sampleBuffer.frames()-1 ) ); @@ -677,7 +677,7 @@ void AudioFileProcessorView::paintEvent( QPaintEvent * ) -void AudioFileProcessorView::sampleUpdated( void ) +void AudioFileProcessorView::sampleUpdated() { m_waveView->updateSampleRange(); m_waveView->update(); @@ -688,7 +688,7 @@ void AudioFileProcessorView::sampleUpdated( void ) -void AudioFileProcessorView::openAudioFile( void ) +void AudioFileProcessorView::openAudioFile() { QString af = castModel()->m_sampleBuffer. openAudioFile(); @@ -703,7 +703,7 @@ void AudioFileProcessorView::openAudioFile( void ) -void AudioFileProcessorView::modelChanged( void ) +void AudioFileProcessorView::modelChanged() { AudioFileProcessor * a = castModel(); connect( &a->m_sampleBuffer, SIGNAL( sampleUpdated() ), diff --git a/plugins/BitInvader/BitInvader.cpp b/plugins/BitInvader/BitInvader.cpp index 0168031fc..0bf063461 100644 --- a/plugins/BitInvader/BitInvader.cpp +++ b/plugins/BitInvader/BitInvader.cpp @@ -161,8 +161,8 @@ BitInvader::BitInvader( InstrumentTrack * _instrument_track ) : m_graph.setWaveToSine(); lengthChanged(); - connect( &m_sampleLength, SIGNAL( dataChanged( ) ), - this, SLOT( lengthChanged( ) ), Qt::DirectConnection ); + connect( &m_sampleLength, SIGNAL( dataChanged() ), + this, SLOT( lengthChanged() ), Qt::DirectConnection ); connect( &m_graph, SIGNAL( samplesChanged( int, int ) ), this, SLOT( samplesChanged( int, int ) ) ); diff --git a/plugins/BitInvader/BitInvader.h b/plugins/BitInvader/BitInvader.h index 90a5dffa8..debdd37ea 100644 --- a/plugins/BitInvader/BitInvader.h +++ b/plugins/BitInvader/BitInvader.h @@ -139,7 +139,7 @@ protected slots: void noiseWaveClicked(); void usrWaveClicked(); - void smoothClicked( void ); + void smoothClicked( ); private: void modelChanged() override; diff --git a/plugins/Eq/EqSpectrumView.cpp b/plugins/Eq/EqSpectrumView.cpp index 24e812049..aa556490b 100644 --- a/plugins/Eq/EqSpectrumView.cpp +++ b/plugins/Eq/EqSpectrumView.cpp @@ -193,7 +193,7 @@ EqSpectrumView::EqSpectrumView(EqAnalyser *b, QWidget *_parent) : setAttribute( Qt::WA_TranslucentBackground, true ); m_skipBands = MAX_BANDS * 0.5; float totalLength = log10( 20000 ); - m_pixelsPerUnitWidth = width( ) / totalLength ; + m_pixelsPerUnitWidth = width() / totalLength ; m_scale = 1.5; m_color = QColor( 255, 255, 255, 255 ); for ( int i = 0 ; i < MAX_BANDS ; i++ ) diff --git a/plugins/Lb302/Lb302.cpp b/plugins/Lb302/Lb302.cpp index c60028520..8ebfe2d47 100644 --- a/plugins/Lb302/Lb302.cpp +++ b/plugins/Lb302/Lb302.cpp @@ -293,26 +293,26 @@ Lb302Synth::Lb302Synth( InstrumentTrack * _instrumentTrack ) : vca_mode(never_played) { - connect( Engine::audioEngine(), SIGNAL( sampleRateChanged( ) ), - this, SLOT ( filterChanged( ) ) ); + connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), + this, SLOT ( filterChanged() ) ); - connect( &vcf_cut_knob, SIGNAL( dataChanged( ) ), - this, SLOT ( filterChanged( ) ) ); + connect( &vcf_cut_knob, SIGNAL( dataChanged() ), + this, SLOT ( filterChanged() ) ); - connect( &vcf_res_knob, SIGNAL( dataChanged( ) ), - this, SLOT ( filterChanged( ) ) ); + connect( &vcf_res_knob, SIGNAL( dataChanged() ), + this, SLOT ( filterChanged() ) ); - connect( &vcf_mod_knob, SIGNAL( dataChanged( ) ), - this, SLOT ( filterChanged( ) ) ); + connect( &vcf_mod_knob, SIGNAL( dataChanged() ), + this, SLOT ( filterChanged() ) ); - connect( &vcf_dec_knob, SIGNAL( dataChanged( ) ), - this, SLOT ( filterChanged( ) ) ); + connect( &vcf_dec_knob, SIGNAL( dataChanged() ), + this, SLOT ( filterChanged() ) ); - connect( &db24Toggle, SIGNAL( dataChanged( ) ), - this, SLOT ( db24Toggled( ) ) ); + connect( &db24Toggle, SIGNAL( dataChanged() ), + this, SLOT ( db24Toggled() ) ); - connect( &dist_knob, SIGNAL( dataChanged( ) ), - this, SLOT ( filterChanged( ))); + connect( &dist_knob, SIGNAL( dataChanged() ), + this, SLOT ( filterChanged())); // SYNTH diff --git a/plugins/Lv2Instrument/Lv2Instrument.cpp b/plugins/Lv2Instrument/Lv2Instrument.cpp index 01ccce15d..0057d65a7 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.cpp +++ b/plugins/Lv2Instrument/Lv2Instrument.cpp @@ -251,7 +251,7 @@ void Lv2InsView::dragEnterEvent(QDragEnterEvent *_dee) // For mimeType() and MimeType enum class using namespace Clipboard; - void (QDragEnterEvent::*reaction)(void) = &QDragEnterEvent::ignore; + void (QDragEnterEvent::*reaction)() = &QDragEnterEvent::ignore; if (_dee->mimeData()->hasFormat( mimeType( MimeType::StringPair ))) { diff --git a/plugins/MidiImport/MidiImport.h b/plugins/MidiImport/MidiImport.h index bb2893116..0d7c0e99e 100644 --- a/plugins/MidiImport/MidiImport.h +++ b/plugins/MidiImport/MidiImport.h @@ -56,7 +56,7 @@ private: bool readRIFF( TrackContainer* tc ); bool readTrack( int _track_end, QString & _track_name ); - void error( void ); + void error(); inline int readInt( int _bytes ) diff --git a/plugins/Patman/Patman.cpp b/plugins/Patman/Patman.cpp index c6fb202c9..32e8372eb 100644 --- a/plugins/Patman/Patman.cpp +++ b/plugins/Patman/Patman.cpp @@ -125,7 +125,7 @@ void PatmanInstrument::loadFile( const QString & _file ) -QString PatmanInstrument::nodeName( void ) const +QString PatmanInstrument::nodeName() const { return( patman_plugin_descriptor.name ); } @@ -380,7 +380,7 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch( -void PatmanInstrument::unloadCurrentPatch( void ) +void PatmanInstrument::unloadCurrentPatch() { while( !m_patchSamples.empty() ) { @@ -502,7 +502,7 @@ PatmanView::~PatmanView() -void PatmanView::openFile( void ) +void PatmanView::openFile() { FileDialog ofd( nullptr, tr( "Open patch file" ) ); ofd.setFileMode( FileDialog::ExistingFiles ); @@ -554,7 +554,7 @@ void PatmanView::openFile( void ) -void PatmanView::updateFilename( void ) +void PatmanView::updateFilename() { m_displayFilename = ""; int idx = m_pi->m_patchFile.length(); @@ -638,7 +638,7 @@ void PatmanView::paintEvent( QPaintEvent * ) -void PatmanView::modelChanged( void ) +void PatmanView::modelChanged() { m_pi = castModel(); m_loopButton->setModel( &m_pi->m_loopedModel ); diff --git a/plugins/Patman/Patman.h b/plugins/Patman/Patman.h index eee122129..60276f5aa 100644 --- a/plugins/Patman/Patman.h +++ b/plugins/Patman/Patman.h @@ -69,9 +69,9 @@ public: void loadFile( const QString & _file ) override; - QString nodeName( void ) const override; + QString nodeName() const override; - f_cnt_t desiredReleaseFrames( void ) const override + f_cnt_t desiredReleaseFrames() const override { return( 128 ); } @@ -109,7 +109,7 @@ private: } ; LoadErrors loadPatch( const QString & _filename ); - void unloadCurrentPatch( void ); + void unloadCurrentPatch(); void selectSample( NotePlayHandle * _n ); @@ -117,7 +117,7 @@ private: friend class gui::PatmanView; signals: - void fileChanged( void ); + void fileChanged(); } ; @@ -135,8 +135,8 @@ public: public slots: - void openFile( void ); - void updateFilename( void ); + void openFile(); + void updateFilename(); protected: @@ -146,7 +146,7 @@ protected: private: - void modelChanged( void ) override; + void modelChanged() override; PatmanInstrument * m_pi; QString m_displayFilename; diff --git a/plugins/Sf2Player/PatchesDialog.cpp b/plugins/Sf2Player/PatchesDialog.cpp index e3e882e69..082a15c04 100644 --- a/plugins/Sf2Player/PatchesDialog.cpp +++ b/plugins/Sf2Player/PatchesDialog.cpp @@ -264,7 +264,7 @@ void PatchesDialog::accept() // Reject settings (Cancel button slot). -void PatchesDialog::reject (void) +void PatchesDialog::reject () { // Reset selection to initial selection, if applicable... if (m_dirty > 0) @@ -306,7 +306,7 @@ QTreeWidgetItem *PatchesDialog::findProgItem ( int iProg ) // Bank change slot. -void PatchesDialog::bankChanged (void) +void PatchesDialog::bankChanged () { if (m_pSynth == nullptr) return; diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index f5ac06e6d..30bef7141 100644 --- a/plugins/Vestige/Vestige.cpp +++ b/plugins/Vestige/Vestige.cpp @@ -741,7 +741,7 @@ void VestigeInstrumentView::openPreset() { if ( m_vi->m_plugin != nullptr ) { - m_vi->m_plugin->openPreset( ); + m_vi->m_plugin->openPreset(); bool converted; QString str = m_vi->m_plugin->currentProgramName().section("/", 0, 0); if (str != "") @@ -759,7 +759,7 @@ void VestigeInstrumentView::savePreset() if ( m_vi->m_plugin != nullptr ) { - m_vi->m_plugin->savePreset( ); + m_vi->m_plugin->savePreset(); /* bool converted; QString str = m_vi->m_plugin->presetString().section("/", 0, 0); if (str != "") diff --git a/plugins/Vestige/Vestige.h b/plugins/Vestige/Vestige.h index 5b7b1461d..706e77b00 100644 --- a/plugins/Vestige/Vestige.h +++ b/plugins/Vestige/Vestige.h @@ -66,7 +66,7 @@ public: virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent ); virtual void loadSettings( const QDomElement & _this ); - virtual QString nodeName( void ) const; + virtual QString nodeName() const; virtual void loadFile( const QString & _file ); @@ -85,7 +85,7 @@ protected slots: void reloadPlugin(); private: - void closePlugin( void ); + void closePlugin(); VstPlugin * m_plugin; @@ -117,8 +117,8 @@ public: protected slots: - void syncPlugin( void ); - void displayAutomatedOnly( void ); + void syncPlugin(); + void displayAutomatedOnly(); void setParameter( lmms::Model * action ); void syncParameterText(); void closeWindow(); @@ -154,16 +154,16 @@ public: protected slots: - void updateMenu( void ); - void openPlugin( void ); - void managePlugin( void ); - void openPreset( void ); - void savePreset( void ); + void updateMenu(); + void openPlugin(); + void managePlugin(); + void openPreset(); + void savePreset(); void nextProgram(); void previousProgram(); - void selPreset( void ); - void toggleGUI( void ); - void noteOffAll( void ); + void selPreset(); + void toggleGUI(); + void noteOffAll(); protected: @@ -173,7 +173,7 @@ protected: private: - virtual void modelChanged( void ); + virtual void modelChanged(); static QPixmap * s_artwork; diff --git a/plugins/Vibed/Vibed.cpp b/plugins/Vibed/Vibed.cpp index b9bcd9f1b..7d0c34e55 100644 --- a/plugins/Vibed/Vibed.cpp +++ b/plugins/Vibed/Vibed.cpp @@ -492,7 +492,7 @@ VibedView::VibedView( Instrument * _instrument, m_triangleWaveBtn->setToolTip( tr( "Triangle wave" ) ); connect( m_triangleWaveBtn, SIGNAL ( clicked () ), - this, SLOT ( triangleWaveClicked( ) ) ); + this, SLOT ( triangleWaveClicked() ) ); m_sawWaveBtn = new PixmapButton( this, tr( "Saw wave" ) ); diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index a31cc832c..bba644305 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -505,7 +505,7 @@ QWidget *VstPlugin::editor() } -void VstPlugin::openPreset( ) +void VstPlugin::openPreset() { gui::FileDialog ofd( nullptr, tr( "Open Preset" ), "", @@ -583,7 +583,7 @@ void VstPlugin::loadParameterDisplays() -void VstPlugin::savePreset( ) +void VstPlugin::savePreset() { QString presName = currentProgramName().isEmpty() ? tr(": default") : currentProgramName(); presName.replace("\"", "'"); // QFileDialog unable to handle double quotes properly diff --git a/plugins/VstBase/VstPlugin.h b/plugins/VstBase/VstPlugin.h index c0f8e79e5..03e732970 100644 --- a/plugins/VstBase/VstPlugin.h +++ b/plugins/VstBase/VstPlugin.h @@ -126,13 +126,13 @@ public: public slots: void setTempo( lmms::bpm_t _bpm ); void updateSampleRate(); - void openPreset( void ); + void openPreset(); void setProgram( int index ); void rotateProgram( int offset ); void loadProgramNames(); void loadParameterLabels(); void loadParameterDisplays(); - void savePreset( void ); + void savePreset(); void setParam( int i, float f ); void idleUpdate(); diff --git a/plugins/VstEffect/VstEffectControls.cpp b/plugins/VstEffect/VstEffectControls.cpp index 9def52727..10294b4c2 100644 --- a/plugins/VstEffect/VstEffectControls.cpp +++ b/plugins/VstEffect/VstEffectControls.cpp @@ -167,7 +167,7 @@ gui::EffectControlDialog* VstEffectControls::createView() -void VstEffectControls::managePlugin( void ) +void VstEffectControls::managePlugin() { if ( m_effect->m_plugin != nullptr && m_subWindow == nullptr ) { gui::ManageVSTEffectView * tt = new gui::ManageVSTEffectView( m_effect, this); @@ -187,11 +187,11 @@ void VstEffectControls::managePlugin( void ) -void VstEffectControls::savePreset( void ) +void VstEffectControls::savePreset() { if ( m_effect->m_plugin != nullptr ) { - m_effect->m_plugin->savePreset( ); + m_effect->m_plugin->savePreset(); /* bool converted; QString str = m_vi->m_plugin->currentProgramName().section("/", 0, 0); if (str != "") @@ -204,7 +204,7 @@ void VstEffectControls::savePreset( void ) -void VstEffectControls::updateMenu( void ) +void VstEffectControls::updateMenu() { // get all presets - @@ -239,11 +239,11 @@ void VstEffectControls::updateMenu( void ) -void VstEffectControls::openPreset( void ) +void VstEffectControls::openPreset() { if ( m_effect->m_plugin != nullptr ) { - m_effect->m_plugin->openPreset( ); + m_effect->m_plugin->openPreset(); bool converted; QString str = m_effect->m_plugin->currentProgramName().section("/", 0, 0); if (str != "") @@ -256,7 +256,7 @@ void VstEffectControls::openPreset( void ) -void VstEffectControls::rollPreset( void ) +void VstEffectControls::rollPreset() { if ( m_effect->m_plugin != nullptr ) { @@ -272,7 +272,7 @@ void VstEffectControls::rollPreset( void ) -void VstEffectControls::rolrPreset( void ) +void VstEffectControls::rolrPreset() { if ( m_effect->m_plugin != nullptr ) { @@ -288,7 +288,7 @@ void VstEffectControls::rolrPreset( void ) -void VstEffectControls::selPreset( void ) +void VstEffectControls::selPreset() { QAction *action = qobject_cast(sender()); @@ -438,7 +438,7 @@ void ManageVSTEffectView::closeWindow() -void ManageVSTEffectView::syncPlugin( void ) +void ManageVSTEffectView::syncPlugin() { char paramStr[35]; QStringList s_dumpValues; @@ -464,7 +464,7 @@ void ManageVSTEffectView::syncPlugin( void ) -void ManageVSTEffectView::displayAutomatedOnly( void ) +void ManageVSTEffectView::displayAutomatedOnly() { bool isAuto = QString::compare( m_displayAutomatedOnly->text(), tr( "Automated" ) ) == 0; diff --git a/plugins/VstEffect/VstEffectControls.h b/plugins/VstEffect/VstEffectControls.h index 6e142b38c..42178b5b6 100644 --- a/plugins/VstEffect/VstEffectControls.h +++ b/plugins/VstEffect/VstEffectControls.h @@ -70,13 +70,13 @@ public: protected slots: - void updateMenu( void ); - void managePlugin( void ); - void openPreset( void ); - void savePreset( void ); - void rollPreset( void ); - void rolrPreset( void ); - void selPreset( void ); + void updateMenu(); + void managePlugin(); + void openPreset(); + void savePreset(); + void rollPreset(); + void rolrPreset(); + void selPreset(); void setParameter( lmms::Model * action ); protected: @@ -117,8 +117,8 @@ public: protected slots: - void syncPlugin( void ); - void displayAutomatedOnly( void ); + void syncPlugin(); + void displayAutomatedOnly(); void setParameter( lmms::Model * action ); void syncParameterText(); void closeWindow(); diff --git a/plugins/Xpressive/Xpressive.h b/plugins/Xpressive/Xpressive.h index d075e9088..b91957ac4 100644 --- a/plugins/Xpressive/Xpressive.h +++ b/plugins/Xpressive/Xpressive.h @@ -171,9 +171,9 @@ protected slots: void expWaveClicked(); void usrWaveClicked(); void helpClicked(); - void expressionChanged( ); - void smoothChanged( ); - void graphDrawn( ); + void expressionChanged(); + void smoothChanged(); + void graphDrawn(); private: void modelChanged() override; diff --git a/src/core/DrumSynth.cpp b/src/core/DrumSynth.cpp index 2b7ad9d1b..79630e42d 100644 --- a/src/core/DrumSynth.cpp +++ b/src/core/DrumSynth.cpp @@ -67,7 +67,7 @@ long wavewords, wavemode=0; float mem_t=1.0f, mem_o=1.0f, mem_n=1.0f, mem_b=1.0f, mem_tune=1.0f, mem_time=1.0f; -int DrumSynth::LongestEnv(void) +int DrumSynth::LongestEnv() { long e, eon, p; float l=0.f; @@ -86,7 +86,7 @@ int DrumSynth::LongestEnv(void) } -float DrumSynth::LoudestEnv(void) +float DrumSynth::LoudestEnv() { float loudest=0.f; int i=0; diff --git a/src/core/PeakController.cpp b/src/core/PeakController.cpp index b29295604..129aa83b7 100644 --- a/src/core/PeakController.cpp +++ b/src/core/PeakController.cpp @@ -53,8 +53,8 @@ PeakController::PeakController( Model * _parent, setSampleExact( true ); if( m_peakEffect ) { - connect( m_peakEffect, SIGNAL( destroyed( ) ), - this, SLOT( handleDestroyedEffect( ) ) ); + connect( m_peakEffect, SIGNAL( destroyed() ), + this, SLOT( handleDestroyedEffect() ) ); } connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( updateCoeffs() ) ); connect( m_peakEffect->attackModel(), SIGNAL( dataChanged() ), @@ -127,7 +127,7 @@ void PeakController::updateCoeffs() } -void PeakController::handleDestroyedEffect( ) +void PeakController::handleDestroyedEffect() { // possible race condition... //printf("disconnecting effect\n"); diff --git a/src/core/audio/AudioSndio.cpp b/src/core/audio/AudioSndio.cpp index 52ff1666e..f6c94f32a 100644 --- a/src/core/audio/AudioSndio.cpp +++ b/src/core/audio/AudioSndio.cpp @@ -126,7 +126,7 @@ AudioSndio::~AudioSndio() } -void AudioSndio::startProcessing( void ) +void AudioSndio::startProcessing() { if( !isRunning() ) { @@ -135,13 +135,13 @@ void AudioSndio::startProcessing( void ) } -void AudioSndio::stopProcessing( void ) +void AudioSndio::stopProcessing() { stopProcessingThread( this ); } -void AudioSndio::applyQualitySettings( void ) +void AudioSndio::applyQualitySettings() { if( hqAudio() ) { @@ -154,7 +154,7 @@ void AudioSndio::applyQualitySettings( void ) } -void AudioSndio::run( void ) +void AudioSndio::run() { surroundSampleFrame * temp = new surroundSampleFrame[audioEngine()->framesPerPeriod()]; int_sample_t * outbuf = new int_sample_t[audioEngine()->framesPerPeriod() * channels()]; @@ -210,7 +210,7 @@ AudioSndio::setupWidget::~setupWidget() } -void AudioSndio::setupWidget::saveSettings( void ) +void AudioSndio::setupWidget::saveSettings() { ConfigManager::inst()->setValue( "audiosndio", "device", m_device->text() ); diff --git a/src/core/midi/MidiSndio.cpp b/src/core/midi/MidiSndio.cpp index d09803e86..e7f2362f6 100644 --- a/src/core/midi/MidiSndio.cpp +++ b/src/core/midi/MidiSndio.cpp @@ -38,7 +38,7 @@ namespace lmms { -MidiSndio::MidiSndio( void ) : +MidiSndio::MidiSndio() : MidiClientRaw(), m_quit( false ) { @@ -74,7 +74,7 @@ MidiSndio::~MidiSndio() } -QString MidiSndio::probeDevice( void ) +QString MidiSndio::probeDevice() { QString dev = ConfigManager::inst()->value( "MidiSndio", "device" ); @@ -88,7 +88,7 @@ void MidiSndio::sendByte( const unsigned char c ) } -void MidiSndio::run( void ) +void MidiSndio::run() { struct pollfd pfd; nfds_t nfds; diff --git a/src/gui/ControllerRackView.cpp b/src/gui/ControllerRackView.cpp index 9549b6e0d..f5420111d 100644 --- a/src/gui/ControllerRackView.cpp +++ b/src/gui/ControllerRackView.cpp @@ -42,7 +42,7 @@ namespace lmms::gui { -ControllerRackView::ControllerRackView( ) : +ControllerRackView::ControllerRackView() : QWidget(), m_nextIndex(0) { diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index c4f68cf28..732d6aa48 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -201,7 +201,7 @@ bool FileBrowser::filterItems( const QString & filter, QTreeWidgetItem * item ) } -void FileBrowser::reloadTree( void ) +void FileBrowser::reloadTree() { QList expandedDirs = m_fileBrowserTreeWidget->expandedDirs(); const QString text = m_filterEdit->text(); @@ -959,7 +959,7 @@ Directory::Directory(const QString & filename, const QString & path, -void Directory::initPixmaps( void ) +void Directory::initPixmaps() { if( s_folderPixmap == nullptr ) { @@ -983,7 +983,7 @@ void Directory::initPixmaps( void ) -void Directory::update( void ) +void Directory::update() { if( !isExpanded() ) { @@ -1146,7 +1146,7 @@ FileItem::FileItem(const QString & name, const QString & path ) : -void FileItem::initPixmaps( void ) +void FileItem::initPixmaps() { if( s_projectFilePixmap == nullptr ) { @@ -1221,7 +1221,7 @@ void FileItem::initPixmaps( void ) -void FileItem::determineFileType( void ) +void FileItem::determineFileType() { m_handling = NotSupported; @@ -1289,7 +1289,7 @@ void FileItem::determineFileType( void ) -QString FileItem::extension( void ) +QString FileItem::extension() { return extension( fullName() ); } diff --git a/src/gui/LmmsStyle.cpp b/src/gui/LmmsStyle.cpp index ee62e613d..6c4dd7fae 100644 --- a/src/gui/LmmsStyle.cpp +++ b/src/gui/LmmsStyle.cpp @@ -143,7 +143,7 @@ LmmsStyle::LmmsStyle() : -QPalette LmmsStyle::standardPalette( void ) const +QPalette LmmsStyle::standardPalette() const { if( s_palette != nullptr) { return * s_palette; } diff --git a/src/gui/instrument/InstrumentView.cpp b/src/gui/instrument/InstrumentView.cpp index 06f37feda..2ca3d9329 100644 --- a/src/gui/instrument/InstrumentView.cpp +++ b/src/gui/instrument/InstrumentView.cpp @@ -66,7 +66,7 @@ void InstrumentView::setModel( Model * _model, bool ) -InstrumentTrackWindow * InstrumentView::instrumentTrackWindow( void ) +InstrumentTrackWindow * InstrumentView::instrumentTrackWindow() { return( dynamic_cast( parentWidget()->parentWidget() ) ); diff --git a/src/gui/widgets/Graph.cpp b/src/gui/widgets/Graph.cpp index ed0355a4c..f5639ff70 100644 --- a/src/gui/widgets/Graph.cpp +++ b/src/gui/widgets/Graph.cpp @@ -55,8 +55,8 @@ Graph::Graph( QWidget * _parent, graphStyle _style, int _width, QObject::connect( gModel, SIGNAL( samplesChanged( int, int ) ), this, SLOT( updateGraph( int, int ) ) ); - QObject::connect( gModel, SIGNAL( lengthChanged( ) ), - this, SLOT( updateGraph( ) ) ); + QObject::connect( gModel, SIGNAL( lengthChanged() ), + this, SLOT( updateGraph() ) ); } void Graph::setForeground( const QPixmap &_pixmap ) @@ -438,8 +438,8 @@ void Graph::modelChanged() QObject::connect( gModel, SIGNAL( samplesChanged( int, int ) ), this, SLOT( updateGraph( int, int ) ) ); - QObject::connect( gModel, SIGNAL( lengthChanged( ) ), - this, SLOT( updateGraph( ) ) ); + QObject::connect( gModel, SIGNAL( lengthChanged() ), + this, SLOT( updateGraph() ) ); } From c2592204727410f7082de5a82994433911a29c48 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> Date: Thu, 23 Jun 2022 22:17:44 +0200 Subject: [PATCH 07/55] Fix clazy warning: "Signature is not normalized." (#6445) This only removes whitespace to fix a clazy warning [-Wclazy-connect-not-normalized]. --- src/core/AutomatableModel.cpp | 10 +- src/core/AutomationClip.cpp | 4 +- src/core/ControllerConnection.cpp | 8 +- src/core/EnvelopeAndLfoParameters.cpp | 56 +++++------ src/core/LadspaControl.cpp | 20 ++-- src/core/LfoController.cpp | 24 ++--- src/core/MeterModel.cpp | 8 +- src/core/PeakController.cpp | 14 +-- src/core/RemotePlugin.cpp | 12 +-- src/core/RenderManager.cpp | 12 +-- src/core/RingBuffer.cpp | 4 +- src/core/SampleClip.cpp | 26 ++--- src/core/Song.cpp | 24 ++--- src/core/TempoSyncKnobModel.cpp | 8 +- src/core/VstSyncController.cpp | 2 +- src/core/audio/AudioJack.cpp | 4 +- src/core/audio/AudioPortAudio.cpp | 16 +-- src/core/audio/AudioSoundIo.cpp | 4 +- src/core/main.cpp | 6 +- src/core/midi/MidiAlsaSeq.cpp | 8 +- src/core/midi/MidiController.cpp | 4 +- src/core/midi/MidiPort.cpp | 16 +-- src/gui/AutomatableModelView.cpp | 20 ++-- src/gui/ControllerRackView.cpp | 12 +-- src/gui/ControllerView.cpp | 10 +- src/gui/EffectRackView.cpp | 16 +-- src/gui/EffectView.cpp | 14 +-- src/gui/FileBrowser.cpp | 20 ++-- src/gui/LfoControllerDialog.cpp | 10 +- src/gui/MainWindow.cpp | 98 +++++++++---------- src/gui/MixerLine.cpp | 14 +-- src/gui/MixerView.cpp | 8 +- src/gui/ModelView.cpp | 4 +- src/gui/PluginBrowser.cpp | 4 +- src/gui/ProjectNotes.cpp | 50 +++++----- src/gui/SampleTrackWindow.cpp | 4 +- src/gui/SideBar.cpp | 4 +- src/gui/SubWindow.cpp | 8 +- src/gui/clips/AutomationClipView.cpp | 24 ++--- src/gui/clips/ClipView.cpp | 12 +-- src/gui/clips/MidiClipView.cpp | 24 ++--- src/gui/clips/PatternClipView.cpp | 12 +-- src/gui/clips/SampleClipView.cpp | 2 +- src/gui/editors/AutomationEditor.cpp | 42 ++++---- src/gui/editors/PianoRoll.cpp | 88 ++++++++--------- src/gui/editors/SongEditor.cpp | 84 ++++++++-------- src/gui/editors/TimeLineWidget.cpp | 28 +++--- src/gui/editors/TrackContainerView.cpp | 12 +-- src/gui/instrument/EnvelopeAndLfoView.cpp | 4 +- src/gui/instrument/InstrumentMidiIOView.cpp | 24 ++--- src/gui/instrument/InstrumentTrackWindow.cpp | 26 ++--- src/gui/instrument/InstrumentView.cpp | 2 +- src/gui/instrument/PianoView.cpp | 4 +- src/gui/menus/MidiPortMenu.cpp | 12 +-- src/gui/menus/RecentProjectsMenu.cpp | 8 +- src/gui/menus/TemplatesMenu.cpp | 6 +- src/gui/modals/ControllerConnectionDialog.cpp | 34 +++---- src/gui/modals/EffectSelectDialog.cpp | 24 ++--- src/gui/modals/ExportProjectDialog.cpp | 20 ++-- src/gui/modals/RenameDialog.cpp | 8 +- src/gui/modals/SetupDialog.cpp | 26 ++--- src/gui/modals/VersionedSaveDialog.cpp | 4 +- src/gui/tracks/InstrumentTrackView.cpp | 42 ++++---- src/gui/tracks/PatternTrackView.cpp | 4 +- src/gui/tracks/SampleTrackView.cpp | 2 +- src/gui/tracks/TrackContentWidget.cpp | 4 +- src/gui/tracks/TrackLabelButton.cpp | 6 +- src/gui/tracks/TrackOperationsWidget.cpp | 20 ++-- src/gui/tracks/TrackView.cpp | 16 +-- src/gui/widgets/AutomatableButton.cpp | 4 +- src/gui/widgets/AutomatableSlider.cpp | 12 +-- src/gui/widgets/CPULoadWidget.cpp | 4 +- src/gui/widgets/ComboBox.cpp | 4 +- src/gui/widgets/Graph.cpp | 16 +-- src/gui/widgets/Knob.cpp | 10 +- src/gui/widgets/Oscilloscope.cpp | 12 +-- src/gui/widgets/TabBar.cpp | 2 +- src/gui/widgets/TempoSyncKnob.cpp | 14 +-- src/gui/widgets/TextFloat.cpp | 4 +- src/gui/widgets/TimeDisplayWidget.cpp | 4 +- src/gui/widgets/ToolButton.cpp | 2 +- src/tracks/MidiClip.cpp | 4 +- src/tracks/PatternTrack.cpp | 2 +- 83 files changed, 652 insertions(+), 652 deletions(-) diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index 5463fa482..dc463075c 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -480,8 +480,8 @@ void AutomatableModel::linkModel( AutomatableModel* model ) if( !model->hasLinkedModels() ) { - QObject::connect( this, SIGNAL( dataChanged() ), - model, SIGNAL( dataChanged() ), Qt::DirectConnection ); + QObject::connect( this, SIGNAL(dataChanged()), + model, SIGNAL(dataChanged()), Qt::DirectConnection ); } } } @@ -552,9 +552,9 @@ void AutomatableModel::setControllerConnection( ControllerConnection* c ) m_controllerConnection = c; if( c ) { - QObject::connect( m_controllerConnection, SIGNAL( valueChanged() ), - this, SIGNAL( dataChanged() ), Qt::DirectConnection ); - QObject::connect( m_controllerConnection, SIGNAL( destroyed() ), this, SLOT( unlinkControllerConnection() ) ); + QObject::connect( m_controllerConnection, SIGNAL(valueChanged()), + this, SIGNAL(dataChanged()), Qt::DirectConnection ); + QObject::connect( m_controllerConnection, SIGNAL(destroyed()), this, SLOT(unlinkControllerConnection())); m_valueChanged = true; emit dataChanged(); } diff --git a/src/core/AutomationClip.cpp b/src/core/AutomationClip.cpp index feeed3fc2..f2cb211eb 100644 --- a/src/core/AutomationClip.cpp +++ b/src/core/AutomationClip.cpp @@ -134,8 +134,8 @@ bool AutomationClip::addObject( AutomatableModel * _obj, bool _search_dup ) m_objects += _obj; - connect( _obj, SIGNAL( destroyed( lmms::jo_id_t ) ), - this, SLOT( objectDestroyed( lmms::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/ControllerConnection.cpp b/src/core/ControllerConnection.cpp index a6402227f..c65cd8ae9 100644 --- a/src/core/ControllerConnection.cpp +++ b/src/core/ControllerConnection.cpp @@ -119,8 +119,8 @@ void ControllerConnection::setController( Controller * _controller ) if( _controller->type() != Controller::DummyController ) { _controller->addConnection( this ); - QObject::connect( _controller, SIGNAL( valueChanged() ), - this, SIGNAL( valueChanged() ), Qt::DirectConnection ); + QObject::connect( _controller, SIGNAL(valueChanged()), + this, SIGNAL(valueChanged()), Qt::DirectConnection ); } m_ownsController = @@ -129,8 +129,8 @@ void ControllerConnection::setController( Controller * _controller ) // If we don't own the controller, allow deletion of controller // to delete the connection if( !m_ownsController ) { - QObject::connect( _controller, SIGNAL( destroyed() ), - this, SLOT( deleteConnection() ) ); + QObject::connect( _controller, SIGNAL(destroyed()), + this, SLOT(deleteConnection())); } } diff --git a/src/core/EnvelopeAndLfoParameters.cpp b/src/core/EnvelopeAndLfoParameters.cpp index b80b54946..55d200668 100644 --- a/src/core/EnvelopeAndLfoParameters.cpp +++ b/src/core/EnvelopeAndLfoParameters.cpp @@ -132,36 +132,36 @@ EnvelopeAndLfoParameters::EnvelopeAndLfoParameters( instances()->add( this ); - connect( &m_predelayModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); - connect( &m_attackModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); - connect( &m_holdModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); - connect( &m_decayModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); - connect( &m_sustainModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); - connect( &m_releaseModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); - connect( &m_amountModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); + connect( &m_predelayModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); + connect( &m_attackModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); + connect( &m_holdModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); + connect( &m_decayModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); + connect( &m_sustainModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); + connect( &m_releaseModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); + connect( &m_amountModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); - connect( &m_lfoPredelayModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); - connect( &m_lfoAttackModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); - connect( &m_lfoSpeedModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); - connect( &m_lfoAmountModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); - connect( &m_lfoWaveModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); - connect( &m_x100Model, SIGNAL( dataChanged() ), - this, SLOT( updateSampleVars() ), Qt::DirectConnection ); + connect( &m_lfoPredelayModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); + connect( &m_lfoAttackModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); + connect( &m_lfoSpeedModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); + connect( &m_lfoAmountModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); + connect( &m_lfoWaveModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); + connect( &m_x100Model, SIGNAL(dataChanged()), + this, SLOT(updateSampleVars()), Qt::DirectConnection ); - connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), - this, SLOT( updateSampleVars() ) ); + connect( Engine::audioEngine(), SIGNAL(sampleRateChanged()), + this, SLOT(updateSampleVars())); m_lfoShapeData = diff --git a/src/core/LadspaControl.cpp b/src/core/LadspaControl.cpp index fb6ef9167..b166ccf9e 100644 --- a/src/core/LadspaControl.cpp +++ b/src/core/LadspaControl.cpp @@ -46,8 +46,8 @@ LadspaControl::LadspaControl( Model * _parent, port_desc_t * _port, { if( m_link ) { - connect( &m_linkEnabledModel, SIGNAL( dataChanged() ), - this, SLOT( linkStateChanged() ), + connect( &m_linkEnabledModel, SIGNAL(dataChanged()), + this, SLOT(linkStateChanged()), Qt::DirectConnection ); } @@ -56,8 +56,8 @@ LadspaControl::LadspaControl( Model * _parent, port_desc_t * _port, case TOGGLED: m_toggledModel.setInitValue( static_cast( m_port->def ) ); - connect( &m_toggledModel, SIGNAL( dataChanged() ), - this, SLOT( ledChanged() ) ); + connect( &m_toggledModel, SIGNAL(dataChanged()), + this, SLOT(ledChanged())); if( m_port->def == 1.0f ) { m_toggledModel.setValue( true ); @@ -74,8 +74,8 @@ LadspaControl::LadspaControl( Model * _parent, port_desc_t * _port, m_port->min ) / 400 ); m_knobModel.setInitValue( static_cast( m_port->def ) ); - connect( &m_knobModel, SIGNAL( dataChanged() ), - this, SLOT( knobChanged() ) ); + connect( &m_knobModel, SIGNAL(dataChanged()), + this, SLOT(knobChanged())); // TODO: careful: we must prevent saved scales m_knobModel.setScaleLogarithmic( m_port->suggests_logscale ); break; @@ -87,8 +87,8 @@ LadspaControl::LadspaControl( Model * _parent, port_desc_t * _port, && m_port->max == 10.0f ? 4000.0f : ( m_port->suggests_logscale ? 8000000.0f : 800000.0f ) ) ); m_knobModel.setInitValue( m_port->def ); - connect( &m_knobModel, SIGNAL( dataChanged() ), - this, SLOT( knobChanged() ) ); + connect( &m_knobModel, SIGNAL(dataChanged()), + this, SLOT(knobChanged())); // TODO: careful: we must prevent saved scales m_knobModel.setScaleLogarithmic( m_port->suggests_logscale ); break; @@ -98,8 +98,8 @@ LadspaControl::LadspaControl( Model * _parent, port_desc_t * _port, ( m_port->max - m_port->min ) / 800.0f ); m_tempoSyncKnobModel.setInitValue( m_port->def ); - connect( &m_tempoSyncKnobModel, SIGNAL( dataChanged() ), - this, SLOT( tempoKnobChanged() ) ); + connect( &m_tempoSyncKnobModel, SIGNAL(dataChanged()), + this, SLOT(tempoKnobChanged())); // TODO: careful: we must prevent saved scales m_tempoSyncKnobModel.setScaleLogarithmic( m_port->suggests_logscale ); break; diff --git a/src/core/LfoController.cpp b/src/core/LfoController.cpp index 548da5d7c..495ae54d4 100644 --- a/src/core/LfoController.cpp +++ b/src/core/LfoController.cpp @@ -51,20 +51,20 @@ LfoController::LfoController( Model * _parent ) : m_userDefSampleBuffer( new SampleBuffer ) { setSampleExact( true ); - connect( &m_waveModel, SIGNAL( dataChanged() ), - this, SLOT( updateSampleFunction() ), Qt::DirectConnection ); + connect( &m_waveModel, SIGNAL(dataChanged()), + this, SLOT(updateSampleFunction()), Qt::DirectConnection ); - connect( &m_speedModel, SIGNAL( dataChanged() ), - this, SLOT( updateDuration() ), Qt::DirectConnection ); - connect( &m_multiplierModel, SIGNAL( dataChanged() ), - this, SLOT( updateDuration() ), Qt::DirectConnection ); - connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), - this, SLOT( updateDuration() ) ); + connect( &m_speedModel, SIGNAL(dataChanged()), + this, SLOT(updateDuration()), Qt::DirectConnection ); + connect( &m_multiplierModel, SIGNAL(dataChanged()), + this, SLOT(updateDuration()), Qt::DirectConnection ); + connect( Engine::audioEngine(), SIGNAL(sampleRateChanged()), + this, SLOT(updateDuration())); - connect( Engine::getSong(), SIGNAL( playbackStateChanged() ), - this, SLOT( updatePhase() ) ); - connect( Engine::getSong(), SIGNAL( playbackPositionChanged() ), - this, SLOT( updatePhase() ) ); + connect( Engine::getSong(), SIGNAL(playbackStateChanged()), + this, SLOT(updatePhase())); + connect( Engine::getSong(), SIGNAL(playbackPositionChanged()), + this, SLOT(updatePhase())); updateDuration(); } diff --git a/src/core/MeterModel.cpp b/src/core/MeterModel.cpp index ee5d8bbc8..3e24ae4d1 100644 --- a/src/core/MeterModel.cpp +++ b/src/core/MeterModel.cpp @@ -35,10 +35,10 @@ MeterModel::MeterModel( Model * _parent ) : m_numeratorModel( 4, 1, 32, this, tr( "Numerator" ) ), m_denominatorModel( 4, 1, 32, this, tr( "Denominator" ) ) { - connect( &m_numeratorModel, SIGNAL( dataChanged() ), - this, SIGNAL( dataChanged() ), Qt::DirectConnection ); - connect( &m_denominatorModel, SIGNAL( dataChanged() ), - this, SIGNAL( dataChanged() ), Qt::DirectConnection ); + connect( &m_numeratorModel, SIGNAL(dataChanged()), + this, SIGNAL(dataChanged()), Qt::DirectConnection ); + connect( &m_denominatorModel, SIGNAL(dataChanged()), + this, SIGNAL(dataChanged()), Qt::DirectConnection ); } diff --git a/src/core/PeakController.cpp b/src/core/PeakController.cpp index 129aa83b7..a9215325e 100644 --- a/src/core/PeakController.cpp +++ b/src/core/PeakController.cpp @@ -53,14 +53,14 @@ PeakController::PeakController( Model * _parent, setSampleExact( true ); if( m_peakEffect ) { - connect( m_peakEffect, SIGNAL( destroyed() ), - this, SLOT( handleDestroyedEffect() ) ); + connect( m_peakEffect, SIGNAL(destroyed()), + this, SLOT(handleDestroyedEffect())); } - connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( updateCoeffs() ) ); - connect( m_peakEffect->attackModel(), SIGNAL( dataChanged() ), - this, SLOT( updateCoeffs() ), Qt::DirectConnection ); - connect( m_peakEffect->decayModel(), SIGNAL( dataChanged() ), - this, SLOT( updateCoeffs() ), Qt::DirectConnection ); + connect( Engine::audioEngine(), SIGNAL(sampleRateChanged()), this, SLOT(updateCoeffs())); + connect( m_peakEffect->attackModel(), SIGNAL(dataChanged()), + this, SLOT(updateCoeffs()), Qt::DirectConnection ); + connect( m_peakEffect->decayModel(), SIGNAL(dataChanged()), + this, SLOT(updateCoeffs()), Qt::DirectConnection ); m_coeffNeedsUpdate = true; } diff --git a/src/core/RemotePlugin.cpp b/src/core/RemotePlugin.cpp index 43eed30a7..62ed9b653 100644 --- a/src/core/RemotePlugin.cpp +++ b/src/core/RemotePlugin.cpp @@ -175,14 +175,14 @@ RemotePlugin::RemotePlugin() : } #endif - connect( &m_process, SIGNAL( finished( int, QProcess::ExitStatus ) ), - this, SLOT( processFinished( int, QProcess::ExitStatus ) ), + connect( &m_process, SIGNAL(finished(int,QProcess::ExitStatus)), + this, SLOT(processFinished(int,QProcess::ExitStatus)), Qt::DirectConnection ); - connect( &m_process, SIGNAL( errorOccurred( QProcess::ProcessError ) ), - this, SLOT( processErrored( QProcess::ProcessError ) ), + connect( &m_process, SIGNAL(errorOccurred(QProcess::ProcessError)), + this, SLOT(processErrored(QProcess::ProcessError)), Qt::DirectConnection ); - connect( &m_process, SIGNAL( finished( int, QProcess::ExitStatus ) ), - &m_watcher, SLOT( quit() ), Qt::DirectConnection ); + connect( &m_process, SIGNAL(finished(int,QProcess::ExitStatus)), + &m_watcher, SLOT(quit()), Qt::DirectConnection ); } diff --git a/src/core/RenderManager.cpp b/src/core/RenderManager.cpp index e2f6b9311..ea3f69f47 100644 --- a/src/core/RenderManager.cpp +++ b/src/core/RenderManager.cpp @@ -57,8 +57,8 @@ RenderManager::~RenderManager() void RenderManager::abortProcessing() { if ( m_activeRenderer ) { - disconnect( m_activeRenderer.get(), SIGNAL( finished() ), - this, SLOT( renderNextTrack() ) ); + disconnect( m_activeRenderer.get(), SIGNAL(finished()), + this, SLOT(renderNextTrack())); m_activeRenderer->abortProcessing(); } restoreMutedState(); @@ -151,13 +151,13 @@ void RenderManager::render(QString outputPath) if( m_activeRenderer->isReady() ) { // pass progress signals through - connect( m_activeRenderer.get(), SIGNAL( progressChanged( int ) ), - this, SIGNAL( progressChanged( int ) ) ); + connect( m_activeRenderer.get(), SIGNAL(progressChanged(int)), + this, SIGNAL(progressChanged(int))); // when it is finished, render the next track. // if we have not queued any tracks, renderNextTrack will just clean up - connect( m_activeRenderer.get(), SIGNAL( finished() ), - this, SLOT( renderNextTrack() ) ); + connect( m_activeRenderer.get(), SIGNAL(finished()), + this, SLOT(renderNextTrack())); m_activeRenderer->startProcessing(); } diff --git a/src/core/RingBuffer.cpp b/src/core/RingBuffer.cpp index b2e40f3c0..3f1ee7236 100644 --- a/src/core/RingBuffer.cpp +++ b/src/core/RingBuffer.cpp @@ -91,11 +91,11 @@ void RingBuffer::setSamplerateAware( bool b ) { if( b ) { - connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSamplerate() ), Qt::UniqueConnection ); + connect( Engine::audioEngine(), SIGNAL(sampleRateChanged()), this, SLOT(updateSamplerate()), Qt::UniqueConnection ); } else { - disconnect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSamplerate() ) ); + disconnect( Engine::audioEngine(), SIGNAL(sampleRateChanged()), this, SLOT(updateSamplerate())); } } diff --git a/src/core/SampleClip.cpp b/src/core/SampleClip.cpp index 9ee8e93e4..fc59fa457 100644 --- a/src/core/SampleClip.cpp +++ b/src/core/SampleClip.cpp @@ -47,30 +47,30 @@ 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( lmms::bpm_t ) ), - this, SLOT( updateLength() ), Qt::DirectConnection ); - connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int,int ) ), - this, SLOT( updateLength() ) ); + connect( Engine::getSong(), SIGNAL(tempoChanged(lmms::bpm_t)), + this, SLOT(updateLength()), Qt::DirectConnection ); + connect( Engine::getSong(), SIGNAL(timeSignatureChanged(int,int)), + this, SLOT(updateLength())); //care about positionmarker gui::TimeLineWidget* timeLine = Engine::getSong()->getPlayPos( Engine::getSong()->Mode_PlaySong ).m_timeLine; if( timeLine ) { - connect( timeLine, SIGNAL( positionMarkerMoved() ), this, SLOT( playbackPositionChanged() ) ); + connect( timeLine, SIGNAL(positionMarkerMoved()), this, SLOT(playbackPositionChanged())); } //playbutton clicked or space key / on Export Song set isPlaying to false - connect( Engine::getSong(), SIGNAL( playbackStateChanged() ), - this, SLOT( playbackPositionChanged() ), Qt::DirectConnection ); + connect( Engine::getSong(), SIGNAL(playbackStateChanged()), + this, SLOT(playbackPositionChanged()), Qt::DirectConnection ); //care about loops - connect( Engine::getSong(), SIGNAL( updateSampleTracks() ), - this, SLOT( playbackPositionChanged() ), Qt::DirectConnection ); + connect( Engine::getSong(), SIGNAL(updateSampleTracks()), + this, SLOT(playbackPositionChanged()), Qt::DirectConnection ); //care about mute Clips - connect( this, SIGNAL( dataChanged() ), this, SLOT( playbackPositionChanged() ) ); + connect( this, SIGNAL(dataChanged()), this, SLOT(playbackPositionChanged())); //care about mute track - connect( getTrack()->getMutedModel(), SIGNAL( dataChanged() ), - this, SLOT( playbackPositionChanged() ), Qt::DirectConnection ); + connect( getTrack()->getMutedModel(), SIGNAL(dataChanged()), + this, SLOT(playbackPositionChanged()), Qt::DirectConnection ); //care about Clip position - connect( this, SIGNAL( positionChanged() ), this, SLOT( updateTrackClips() ) ); + connect( this, SIGNAL(positionChanged()), this, SLOT(updateTrackClips())); switch( getTrack()->trackContainer()->type() ) { diff --git a/src/core/Song.cpp b/src/core/Song.cpp index d26eab450..029683f94 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -100,21 +100,21 @@ Song::Song() : m_oldAutomatedValues() { for(int i = 0; i < Mode_Count; ++i) m_elapsedMilliSeconds[i] = 0; - connect( &m_tempoModel, SIGNAL( dataChanged() ), - this, SLOT( setTempo() ), Qt::DirectConnection ); - connect( &m_tempoModel, SIGNAL( dataUnchanged() ), - this, SLOT( setTempo() ), Qt::DirectConnection ); - connect( &m_timeSigModel, SIGNAL( dataChanged() ), - this, SLOT( setTimeSignature() ), Qt::DirectConnection ); + connect( &m_tempoModel, SIGNAL(dataChanged()), + this, SLOT(setTempo()), Qt::DirectConnection ); + connect( &m_tempoModel, SIGNAL(dataUnchanged()), + this, SLOT(setTempo()), Qt::DirectConnection ); + connect( &m_timeSigModel, SIGNAL(dataChanged()), + this, SLOT(setTimeSignature()), Qt::DirectConnection ); - connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, - SLOT( updateFramesPerTick() ) ); + connect( Engine::audioEngine(), SIGNAL(sampleRateChanged()), this, + SLOT(updateFramesPerTick())); - connect( &m_masterVolumeModel, SIGNAL( dataChanged() ), - this, SLOT( masterVolumeChanged() ), Qt::DirectConnection ); -/* connect( &m_masterPitchModel, SIGNAL( dataChanged() ), - this, SLOT( masterPitchChanged() ) );*/ + connect( &m_masterVolumeModel, SIGNAL(dataChanged()), + this, SLOT(masterVolumeChanged()), Qt::DirectConnection ); +/* connect( &m_masterPitchModel, SIGNAL(dataChanged()), + this, SLOT(masterPitchChanged()));*/ qRegisterMetaType( "Note" ); setType( SongContainer ); diff --git a/src/core/TempoSyncKnobModel.cpp b/src/core/TempoSyncKnobModel.cpp index bc7c86db9..58437db24 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( lmms::bpm_t ) ), - this, SLOT( calculateTempoSyncTime( lmms::bpm_t ) ), + connect( Engine::getSong(), SIGNAL(tempoChanged(lmms::bpm_t)), + this, SLOT(calculateTempoSyncTime(lmms::bpm_t)), Qt::DirectConnection ); } @@ -158,8 +158,8 @@ void TempoSyncKnobModel::setSyncMode( TempoSyncMode _new_mode ) m_tempoSyncMode = _new_mode; if( _new_mode == SyncCustom ) { - connect( &m_custom, SIGNAL( dataChanged() ), - this, SLOT( updateCustom() ), + connect( &m_custom, SIGNAL(dataChanged()), + this, SLOT(updateCustom()), Qt::DirectConnection ); } } diff --git a/src/core/VstSyncController.cpp b/src/core/VstSyncController.cpp index 1699905c6..a08831662 100644 --- a/src/core/VstSyncController.cpp +++ b/src/core/VstSyncController.cpp @@ -44,7 +44,7 @@ VstSyncController::VstSyncController() : { if( ConfigManager::inst()->value( "ui", "syncvstplugins" ).toInt() ) { - connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( updateSampleRate() ) ); + connect( Engine::audioEngine(), SIGNAL(sampleRateChanged()), this, SLOT(updateSampleRate())); try { diff --git a/src/core/audio/AudioJack.cpp b/src/core/audio/AudioJack.cpp index f0e606f47..071a6e3c3 100644 --- a/src/core/audio/AudioJack.cpp +++ b/src/core/audio/AudioJack.cpp @@ -61,8 +61,8 @@ AudioJack::AudioJack( bool & _success_ful, AudioEngine* _audioEngine ) : _success_ful = initJackClient(); if( _success_ful ) { - connect( this, SIGNAL( zombified() ), - this, SLOT( restartAfterZombified() ), + connect( this, SIGNAL(zombified()), + this, SLOT(restartAfterZombified()), Qt::QueuedConnection ); } diff --git a/src/core/audio/AudioPortAudio.cpp b/src/core/audio/AudioPortAudio.cpp index cc1e611c9..b1e9cb5c4 100644 --- a/src/core/audio/AudioPortAudio.cpp +++ b/src/core/audio/AudioPortAudio.cpp @@ -444,11 +444,11 @@ AudioPortAudio::setupWidget::setupWidget( QWidget * _parent ) : m_channels->setLabel( tr( "Channels" ) ); m_channels->move( 308, 20 );*/ - connect( &m_setupUtil.m_backendModel, SIGNAL( dataChanged() ), - &m_setupUtil, SLOT( updateDevices() ) ); + connect( &m_setupUtil.m_backendModel, SIGNAL(dataChanged()), + &m_setupUtil, SLOT(updateDevices())); - connect( &m_setupUtil.m_deviceModel, SIGNAL( dataChanged() ), - &m_setupUtil, SLOT( updateChannels() ) ); + connect( &m_setupUtil.m_deviceModel, SIGNAL(dataChanged()), + &m_setupUtil, SLOT(updateChannels())); m_backend->setModel( &m_setupUtil.m_backendModel ); m_device->setModel( &m_setupUtil.m_deviceModel ); @@ -459,11 +459,11 @@ AudioPortAudio::setupWidget::setupWidget( QWidget * _parent ) : AudioPortAudio::setupWidget::~setupWidget() { - disconnect( &m_setupUtil.m_backendModel, SIGNAL( dataChanged() ), - &m_setupUtil, SLOT( updateDevices() ) ); + disconnect( &m_setupUtil.m_backendModel, SIGNAL(dataChanged()), + &m_setupUtil, SLOT(updateDevices())); - disconnect( &m_setupUtil.m_deviceModel, SIGNAL( dataChanged() ), - &m_setupUtil, SLOT( updateChannels() ) ); + disconnect( &m_setupUtil.m_deviceModel, SIGNAL(dataChanged()), + &m_setupUtil, SLOT(updateChannels())); } diff --git a/src/core/audio/AudioSoundIo.cpp b/src/core/audio/AudioSoundIo.cpp index c56d23dc3..a25d968df 100644 --- a/src/core/audio/AudioSoundIo.cpp +++ b/src/core/audio/AudioSoundIo.cpp @@ -492,7 +492,7 @@ AudioSoundIo::setupWidget::setupWidget( QWidget * _parent ) : reconnectSoundIo(); - bool ok = connect( &m_backendModel, SIGNAL( dataChanged() ), &m_setupUtil, SLOT( reconnectSoundIo() ) ); + bool ok = connect( &m_backendModel, SIGNAL(dataChanged()), &m_setupUtil, SLOT(reconnectSoundIo())); assert(ok); m_backend->setModel( &m_backendModel ); @@ -501,7 +501,7 @@ AudioSoundIo::setupWidget::setupWidget( QWidget * _parent ) : AudioSoundIo::setupWidget::~setupWidget() { - bool ok = disconnect( &m_backendModel, SIGNAL( dataChanged() ), &m_setupUtil, SLOT( reconnectSoundIo() ) ); + bool ok = disconnect( &m_backendModel, SIGNAL(dataChanged()), &m_setupUtil, SLOT(reconnectSoundIo())); assert(ok); if (m_soundio) { diff --git a/src/core/main.cpp b/src/core/main.cpp index 5d454dd9b..43e744e5b 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -831,12 +831,12 @@ int main( int argc, char * * argv ) // create renderer RenderManager * r = new RenderManager( qs, os, eff, renderOut ); QCoreApplication::instance()->connect( r, - SIGNAL( finished() ), SLOT( quit() ) ); + SIGNAL(finished()), SLOT(quit())); // timer for progress-updates QTimer * t = new QTimer( r ); - r->connect( t, SIGNAL( timeout() ), - SLOT( updateConsoleProgress() ) ); + r->connect( t, SIGNAL(timeout()), + SLOT(updateConsoleProgress())); t->start( 200 ); if( profilerOutputFile.isEmpty() == false ) diff --git a/src/core/midi/MidiAlsaSeq.cpp b/src/core/midi/MidiAlsaSeq.cpp index 41904812c..b7d46fe4f 100644 --- a/src/core/midi/MidiAlsaSeq.cpp +++ b/src/core/midi/MidiAlsaSeq.cpp @@ -101,14 +101,14 @@ MidiAlsaSeq::MidiAlsaSeq() : snd_seq_start_queue( m_seqHandle, m_queueID, nullptr ); changeQueueTempo( Engine::getSong()->getTempo() ); - connect( Engine::getSong(), SIGNAL( tempoChanged( lmms::bpm_t ) ), - this, SLOT( changeQueueTempo( lmms::bpm_t ) ), Qt::DirectConnection ); + connect( Engine::getSong(), SIGNAL(tempoChanged(lmms::bpm_t)), + this, SLOT(changeQueueTempo(lmms::bpm_t)), Qt::DirectConnection ); // initial list-update updatePortList(); - connect( &m_portListUpdateTimer, SIGNAL( timeout() ), - this, SLOT( updatePortList() ) ); + connect( &m_portListUpdateTimer, SIGNAL(timeout()), + this, SLOT(updatePortList())); // we check for port-changes every second m_portListUpdateTimer.start( 1000 ); diff --git a/src/core/midi/MidiController.cpp b/src/core/midi/MidiController.cpp index 61c85104e..75f548a37 100644 --- a/src/core/midi/MidiController.cpp +++ b/src/core/midi/MidiController.cpp @@ -40,8 +40,8 @@ MidiController::MidiController( Model * _parent ) : m_previousValue( 0.0f ) { setSampleExact( true ); - connect( &m_midiPort, SIGNAL( modeChanged() ), - this, SLOT( updateName() ) ); + connect( &m_midiPort, SIGNAL(modeChanged()), + this, SLOT(updateName())); } diff --git a/src/core/midi/MidiPort.cpp b/src/core/midi/MidiPort.cpp index 9b3f46304..33733398b 100644 --- a/src/core/midi/MidiPort.cpp +++ b/src/core/midi/MidiPort.cpp @@ -69,12 +69,12 @@ MidiPort::MidiPort( const QString& name, m_readableModel.setValue( m_mode == Input || m_mode == Duplex ); m_writableModel.setValue( m_mode == Output || m_mode == Duplex ); - connect( &m_readableModel, SIGNAL( dataChanged() ), - this, SLOT( updateMidiPortMode() ), Qt::DirectConnection ); - connect( &m_writableModel, SIGNAL( dataChanged() ), - this, SLOT( updateMidiPortMode() ), Qt::DirectConnection ); - connect( &m_outputProgramModel, SIGNAL( dataChanged() ), - this, SLOT( updateOutputProgram() ), Qt::DirectConnection ); + connect( &m_readableModel, SIGNAL(dataChanged()), + this, SLOT(updateMidiPortMode()), Qt::DirectConnection ); + connect( &m_writableModel, SIGNAL(dataChanged()), + this, SLOT(updateMidiPortMode()), Qt::DirectConnection ); + connect( &m_outputProgramModel, SIGNAL(dataChanged()), + this, SLOT(updateOutputProgram()), Qt::DirectConnection ); // when using with non-raw-clients we can provide buttons showing @@ -85,8 +85,8 @@ MidiPort::MidiPort( const QString& name, updateWritablePorts(); // we want to get informed about port-changes! - m_midiClient->connectRPChanged( this, SLOT( updateReadablePorts() ) ); - m_midiClient->connectWPChanged( this, SLOT( updateWritablePorts() ) ); + m_midiClient->connectRPChanged( this, SLOT(updateReadablePorts())); + m_midiClient->connectWPChanged( this, SLOT(updateWritablePorts())); } updateMidiPortMode(); diff --git a/src/gui/AutomatableModelView.cpp b/src/gui/AutomatableModelView.cpp index 7ef527cae..365a5749e 100644 --- a/src/gui/AutomatableModelView.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -61,14 +61,14 @@ void AutomatableModelView::addDefaultActions( QMenu* menu ) AutomatableModel::tr( "&Reset (%1%2)" ). arg( model->initValue() * m_conversionFactor ). arg( m_unit ), - model, SLOT( reset() ) ); + model, SLOT(reset())); menu->addSeparator(); menu->addAction( embed::getIconPixmap( "edit_copy" ), AutomatableModel::tr( "&Copy value (%1%2)" ). arg( model->value() * m_conversionFactor ). arg( m_unit ), - amvSlots, SLOT( copyToClipboard() ) ); + amvSlots, SLOT(copyToClipboard())); bool canPaste = true; const float valueToPaste = floatFromClipboard(&canPaste); @@ -78,7 +78,7 @@ void AutomatableModelView::addDefaultActions( QMenu* menu ) arg( m_unit ) : AutomatableModel::tr( "&Paste value"); QAction* pasteAction = menu->addAction( embed::getIconPixmap( "edit_paste" ), - pasteDesc, amvSlots, SLOT( pasteFromClipboard() ) ); + pasteDesc, amvSlots, SLOT(pasteFromClipboard())); pasteAction->setEnabled(canPaste); menu->addSeparator(); @@ -86,12 +86,12 @@ void AutomatableModelView::addDefaultActions( QMenu* menu ) menu->addAction( embed::getIconPixmap( "automation" ), AutomatableModel::tr( "Edit song-global automation" ), amvSlots, - SLOT( editSongGlobalAutomation() ) ); + SLOT(editSongGlobalAutomation())); menu->addAction( QPixmap(), AutomatableModel::tr( "Remove song-global automation" ), amvSlots, - SLOT( removeSongGlobalAutomation() ) ); + SLOT(removeSongGlobalAutomation())); menu->addSeparator(); @@ -99,7 +99,7 @@ void AutomatableModelView::addDefaultActions( QMenu* menu ) { menu->addAction( embed::getIconPixmap( "edit-delete" ), AutomatableModel::tr( "Remove all linked controls" ), - amvSlots, SLOT( unlinkAllModels() ) ); + amvSlots, SLOT(unlinkAllModels())); menu->addSeparator(); } @@ -120,16 +120,16 @@ void AutomatableModelView::addDefaultActions( QMenu* menu ) contMenu->addAction( embed::getIconPixmap( "controller" ), AutomatableModel::tr("Edit connection..."), - amvSlots, SLOT( execConnectionDialog() ) ); + amvSlots, SLOT(execConnectionDialog())); contMenu->addAction( embed::getIconPixmap( "cancel" ), AutomatableModel::tr("Remove connection"), - amvSlots, SLOT( removeConnection() ) ); + amvSlots, SLOT(removeConnection())); } else { menu->addAction( embed::getIconPixmap( "controller" ), AutomatableModel::tr("Connect to controller..."), - amvSlots, SLOT( execConnectionDialog() ) ); + amvSlots, SLOT(execConnectionDialog())); } } @@ -202,7 +202,7 @@ AutomatableModelViewSlots::AutomatableModelViewSlots( AutomatableModelView* amv, QObject(), m_amv( amv ) { - connect( parent, SIGNAL( destroyed() ), this, SLOT( deleteLater() ), Qt::QueuedConnection ); + connect( parent, SIGNAL(destroyed()), this, SLOT(deleteLater()), Qt::QueuedConnection ); } diff --git a/src/gui/ControllerRackView.cpp b/src/gui/ControllerRackView.cpp index f5420111d..e9f23c767 100644 --- a/src/gui/ControllerRackView.cpp +++ b/src/gui/ControllerRackView.cpp @@ -64,12 +64,12 @@ ControllerRackView::ControllerRackView() : m_addButton = new QPushButton( this ); m_addButton->setText( tr( "Add" ) ); - connect( m_addButton, SIGNAL( clicked() ), - this, SLOT( addController() ) ); + connect( m_addButton, SIGNAL(clicked()), + this, SLOT(addController())); Song * song = Engine::getSong(); - connect( song, SIGNAL( controllerAdded( lmms::Controller* ) ), SLOT( onControllerAdded( lmms::Controller* ) ) ); - connect( song, SIGNAL( controllerRemoved( lmms::Controller* ) ), SLOT( onControllerRemoved( lmms::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( lmms::gui::ControllerView * ) ), - this, SLOT( deleteController( lmms::gui::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/ControllerView.cpp b/src/gui/ControllerView.cpp index 7e046b4f2..903c02862 100644 --- a/src/gui/ControllerView.cpp +++ b/src/gui/ControllerView.cpp @@ -67,7 +67,7 @@ ControllerView::ControllerView( Controller * _model, QWidget * _parent ) : hBox->addWidget(label); QPushButton * controlsButton = new QPushButton( tr( "Controls" ), this ); - connect( controlsButton, SIGNAL( clicked() ), SLOT( editControls() ) ); + connect( controlsButton, SIGNAL(clicked()), SLOT(editControls())); hBox->addWidget(controlsButton); @@ -86,8 +86,8 @@ ControllerView::ControllerView( Controller * _model, QWidget * _parent ) : m_subWindow->setWindowIcon( m_controllerDlg->windowIcon() ); - connect( m_controllerDlg, SIGNAL( closed() ), - this, SLOT( closeControls() ) ); + connect( m_controllerDlg, SIGNAL(closed()), + this, SLOT(closeControls())); m_subWindow->hide(); @@ -176,8 +176,8 @@ void ControllerView::contextMenuEvent( QContextMenuEvent * ) QPointer contextMenu = new CaptionMenu( model()->displayName(), this ); contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "&Remove this controller" ), - this, SLOT( deleteController() ) ); - contextMenu->addAction( tr("Re&name this controller"), this, SLOT( renameController() )); + this, SLOT(deleteController())); + contextMenu->addAction( tr("Re&name this controller"), this, SLOT(renameController())); contextMenu->addSeparator(); contextMenu->exec( QCursor::pos() ); delete contextMenu; diff --git a/src/gui/EffectRackView.cpp b/src/gui/EffectRackView.cpp index 27600056e..d946e753d 100644 --- a/src/gui/EffectRackView.cpp +++ b/src/gui/EffectRackView.cpp @@ -65,7 +65,7 @@ EffectRackView::EffectRackView( EffectChain* model, QWidget* parent ) : effectsLayout->addWidget( addButton ); - connect( addButton, SIGNAL( clicked() ), this, SLOT( addEffect() ) ); + connect( addButton, SIGNAL(clicked()), this, SLOT(addEffect())); m_lastY = 0; @@ -171,12 +171,12 @@ void EffectRackView::update() if( i >= m_effectViews.size() ) { EffectView * view = new EffectView( *it, w ); - 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 * ) ), + 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 ); @@ -259,7 +259,7 @@ void EffectRackView::modelChanged() { //clearViews(); m_effectsGroupBox->setModel( &fxChain()->m_enabledModel ); - connect( fxChain(), SIGNAL( aboutToClear() ), this, SLOT( clearViews() ) ); + connect( fxChain(), SIGNAL(aboutToClear()), this, SLOT(clearViews())); update(); } diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index f90283631..820f9907d 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -90,8 +90,8 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : QFont f = ctls_btn->font(); ctls_btn->setFont( pointSize<8>( f ) ); ctls_btn->setGeometry( 150, 14, 50, 20 ); - connect( ctls_btn, SIGNAL( clicked() ), - this, SLOT( editControls() ) ); + connect( ctls_btn, SIGNAL(clicked()), + this, SLOT(editControls())); m_controlView = effect()->controls()->createView(); if( m_controlView ) @@ -111,8 +111,8 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : flags &= ~Qt::WindowMaximizeButtonHint; m_subWindow->setWindowFlags( flags ); - connect( m_controlView, SIGNAL( closed() ), - this, SLOT( closeEffects() ) ); + connect( m_controlView, SIGNAL(closed()), + this, SLOT(closeEffects())); m_subWindow->hide(); } @@ -194,14 +194,14 @@ void EffectView::contextMenuEvent( QContextMenuEvent * ) QPointer contextMenu = new CaptionMenu( model()->displayName(), this ); contextMenu->addAction( embed::getIconPixmap( "arp_up" ), tr( "Move &up" ), - this, SLOT( moveUp() ) ); + this, SLOT(moveUp())); contextMenu->addAction( embed::getIconPixmap( "arp_down" ), tr( "Move &down" ), - this, SLOT( moveDown() ) ); + this, SLOT(moveDown())); contextMenu->addSeparator(); contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "&Remove this plugin" ), - this, SLOT( deletePlugin() ) ); + this, SLOT(deletePlugin())); contextMenu->addSeparator(); contextMenu->exec( QCursor::pos() ); delete contextMenu; diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 732d6aa48..0a6f8a216 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -125,14 +125,14 @@ FileBrowser::FileBrowser(const QString & directories, const QString & filter, m_filterEdit = new QLineEdit( searchWidget ); m_filterEdit->setPlaceholderText( tr("Search") ); m_filterEdit->setClearButtonEnabled( true ); - connect( m_filterEdit, SIGNAL( textEdited( const QString & ) ), - this, SLOT( filterItems( const QString & ) ) ); + connect( m_filterEdit, SIGNAL( textEdited( const QString& ) ), + this, SLOT( filterItems( const QString& ) ) ); QPushButton * reload_btn = new QPushButton( embed::getIconPixmap( "reload" ), QString(), searchWidget ); reload_btn->setToolTip( tr( "Refresh list" ) ); - connect( reload_btn, SIGNAL( clicked() ), this, SLOT( reloadTree() ) ); + connect( reload_btn, SIGNAL(clicked()), this, SLOT(reloadTree())); searchWidgetLayout->addWidget( m_filterEdit ); searchWidgetLayout->addSpacing( 5 ); @@ -144,7 +144,7 @@ FileBrowser::FileBrowser(const QString & directories, const QString & filter, addContentWidget( m_fileBrowserTreeWidget ); // Whenever the FileBrowser has focus, Ctrl+F should direct focus to its filter box. - QShortcut *filterFocusShortcut = new QShortcut( QKeySequence( QKeySequence::Find ), this, SLOT(giveFocusToFilter()) ); + QShortcut *filterFocusShortcut = new QShortcut( QKeySequence( QKeySequence::Find ), this, SLOT(giveFocusToFilter())); filterFocusShortcut->setContext(Qt::WidgetWithChildrenShortcut); reloadTree(); @@ -381,12 +381,12 @@ FileBrowserTreeWidget::FileBrowserTreeWidget(QWidget * parent ) : headerItem()->setHidden( true ); setSortingEnabled( false ); - connect( this, SIGNAL( itemDoubleClicked( QTreeWidgetItem *, int ) ), - SLOT( activateListItem( QTreeWidgetItem *, int ) ) ); - connect( this, SIGNAL( itemCollapsed( QTreeWidgetItem * ) ), - SLOT( updateDirectory( QTreeWidgetItem * ) ) ); - connect( this, SIGNAL( itemExpanded( QTreeWidgetItem * ) ), - SLOT( updateDirectory( QTreeWidgetItem * ) ) ); + connect( this, SIGNAL(itemDoubleClicked(QTreeWidgetItem*,int)), + SLOT(activateListItem(QTreeWidgetItem*,int))); + connect( this, SIGNAL(itemCollapsed(QTreeWidgetItem*)), + SLOT(updateDirectory(QTreeWidgetItem*))); + connect( this, SIGNAL(itemExpanded(QTreeWidgetItem*)), + SLOT(updateDirectory(QTreeWidgetItem*))); #if QT_VERSION < QT_VERSION_CHECK(5, 12, 2) && defined LMMS_BUILD_WIN32 // Set the font for the QTreeWidget to the Windows System font to make sure that diff --git a/src/gui/LfoControllerDialog.cpp b/src/gui/LfoControllerDialog.cpp index 84a3451d8..b0606dfe9 100644 --- a/src/gui/LfoControllerDialog.cpp +++ b/src/gui/LfoControllerDialog.cpp @@ -153,8 +153,8 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent m_userWaveBtn->setInactiveGraphic( embed::getIconPixmap( "usr_wave_inactive" ) ); connect( m_userWaveBtn, - SIGNAL( doubleClicked() ), - this, SLOT( askUserDefWave() ) ); + SIGNAL(doubleClicked()), + this, SLOT(askUserDefWave())); m_userWaveBtn->setToolTip( tr( "User-defined shape.\nDouble click to pick a file." ) ); @@ -244,14 +244,14 @@ void LfoControllerDialog::contextMenuEvent( QContextMenuEvent * ) // should be replaced by Model::displayName contextMenu->addAction( embed::getIconPixmap( "arp_up_on" ), tr( "Move &up" ), - this, SLOT( moveUp() ) ); + this, SLOT(moveUp())); contextMenu->addAction( embed::getIconPixmap( "arp_down_on" ), tr( "Move &down" ), - this, SLOT( moveDown() ) ); + this, SLOT(moveDown())); contextMenu->addSeparator(); contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "&Remove this plugin" ), - this, SLOT( deletePlugin() ) ); + this, SLOT(deletePlugin())); contextMenu->exec( QCursor::pos() ); delete contextMenu; */ diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index bc917f53c..a77094b19 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -251,8 +251,8 @@ MainWindow::MainWindow() : // See autoSaveTimerReset() in MainWindow.h } - connect( Engine::getSong(), SIGNAL( playbackStateChanged() ), - this, SLOT( updatePlayPauseIcons() ) ); + connect( Engine::getSong(), SIGNAL(playbackStateChanged()), + this, SLOT(updatePlayPauseIcons())); connect(Engine::getSong(), SIGNAL(stopped()), SLOT(onSongStopped())); @@ -302,7 +302,7 @@ void MainWindow::finalize() menuBar()->addMenu( project_menu )->setText( tr( "&File" ) ); project_menu->addAction( embed::getIconPixmap( "project_new" ), tr( "&New" ), - this, SLOT( createNewProject() ), + this, SLOT(createNewProject()), QKeySequence::New ); auto templates_menu = new TemplatesMenu( this ); @@ -310,48 +310,48 @@ void MainWindow::finalize() project_menu->addAction( embed::getIconPixmap( "project_open" ), tr( "&Open..." ), - this, SLOT( openProject() ), + this, SLOT(openProject()), QKeySequence::Open ); project_menu->addMenu(new RecentProjectsMenu(this)); project_menu->addAction( embed::getIconPixmap( "project_save" ), tr( "&Save" ), - this, SLOT( saveProject() ), + this, SLOT(saveProject()), QKeySequence::Save ); project_menu->addAction( embed::getIconPixmap( "project_save" ), tr( "Save &As..." ), - this, SLOT( saveProjectAs() ), + this, SLOT(saveProjectAs()), Qt::CTRL + Qt::SHIFT + Qt::Key_S ); project_menu->addAction( embed::getIconPixmap( "project_save" ), tr( "Save as New &Version" ), - this, SLOT( saveProjectAsNewVersion() ), + this, SLOT(saveProjectAsNewVersion()), Qt::CTRL + Qt::ALT + Qt::Key_S ); project_menu->addAction( embed::getIconPixmap( "project_save" ), tr( "Save as default template" ), - this, SLOT( saveProjectAsDefaultTemplate() ) ); + this, SLOT(saveProjectAsDefaultTemplate())); project_menu->addSeparator(); project_menu->addAction( embed::getIconPixmap( "project_import" ), tr( "Import..." ), this, - SLOT( onImportProject() ) ); + SLOT(onImportProject())); project_menu->addAction( embed::getIconPixmap( "project_export" ), tr( "E&xport..." ), this, - SLOT( onExportProject() ), + SLOT(onExportProject()), Qt::CTRL + Qt::Key_E ); project_menu->addAction( embed::getIconPixmap( "project_export" ), tr( "E&xport Tracks..." ), this, - SLOT( onExportProjectTracks() ), + SLOT(onExportProjectTracks()), Qt::CTRL + Qt::SHIFT + Qt::Key_E ); project_menu->addAction( embed::getIconPixmap( "midi_file" ), tr( "Export &MIDI..." ), this, - SLOT( onExportProjectMidi() ), + SLOT(onExportProjectMidi()), Qt::CTRL + Qt::Key_M ); // Prevent dangling separator at end of menu per https://bugreports.qt.io/browse/QTBUG-40071 @@ -359,7 +359,7 @@ void MainWindow::finalize() project_menu->addSeparator(); #endif project_menu->addAction( embed::getIconPixmap( "exit" ), tr( "&Quit" ), - qApp, SLOT( closeAllWindows() ), + qApp, SLOT(closeAllWindows()), Qt::CTRL + Qt::Key_Q ); @@ -367,32 +367,32 @@ void MainWindow::finalize() menuBar()->addMenu( edit_menu )->setText( tr( "&Edit" ) ); m_undoAction = edit_menu->addAction( embed::getIconPixmap( "edit_undo" ), tr( "Undo" ), - this, SLOT( undo() ), + this, SLOT(undo()), QKeySequence::Undo ); m_redoAction = edit_menu->addAction( embed::getIconPixmap( "edit_redo" ), tr( "Redo" ), - this, SLOT( redo() ), + this, SLOT(redo()), QKeySequence::Redo ); // Ensure that both (Ctrl+Y) and (Ctrl+Shift+Z) activate redo shortcut regardless of OS defaults if (QKeySequence(QKeySequence::Redo) != QKeySequence(Qt::CTRL + Qt::Key_Y)) { - new QShortcut( QKeySequence( Qt::CTRL + Qt::Key_Y ), this, SLOT(redo()) ); + new QShortcut( QKeySequence( Qt::CTRL + Qt::Key_Y ), this, SLOT(redo())); } if (QKeySequence(QKeySequence::Redo) != QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_Z )) { - new QShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_Z ), this, SLOT(redo()) ); + new QShortcut( QKeySequence( Qt::CTRL + Qt::SHIFT + Qt::Key_Z ), this, SLOT(redo())); } edit_menu->addSeparator(); edit_menu->addAction( embed::getIconPixmap( "setup_general" ), tr( "Settings" ), - this, SLOT( showSettingsDialog() ) ); - connect( edit_menu, SIGNAL(aboutToShow()), this, SLOT(updateUndoRedoButtons()) ); + this, SLOT(showSettingsDialog())); + connect( edit_menu, SIGNAL(aboutToShow()), this, SLOT(updateUndoRedoButtons())); m_viewMenu = new QMenu( this ); menuBar()->addMenu( m_viewMenu )->setText( tr( "&View" ) ); - connect( m_viewMenu, SIGNAL( aboutToShow() ), - this, SLOT( updateViewMenu() ) ); + connect( m_viewMenu, SIGNAL(aboutToShow()), + this, SLOT(updateViewMenu())); connect( m_viewMenu, SIGNAL(triggered(QAction*)), this, SLOT(updateConfig(QAction*))); @@ -407,8 +407,8 @@ void MainWindow::finalize() if( !m_toolsMenu->isEmpty() ) { menuBar()->addMenu( m_toolsMenu )->setText( tr( "&Tools" ) ); - connect( m_toolsMenu, SIGNAL( triggered( QAction * ) ), - this, SLOT( showTool( QAction * ) ) ); + connect( m_toolsMenu, SIGNAL(triggered(QAction*)), + this, SLOT(showTool(QAction*))); } @@ -420,13 +420,13 @@ void MainWindow::finalize() { help_menu->addAction( embed::getIconPixmap( "help" ), tr( "Online Help" ), - this, SLOT( browseHelp() ) ); + this, SLOT(browseHelp())); } else { help_menu->addAction( embed::getIconPixmap( "help" ), tr( "Help" ), - this, SLOT( help() ) ); + this, SLOT(help())); } // Prevent dangling separator at end of menu per https://bugreports.qt.io/browse/QTBUG-40071 @@ -434,19 +434,19 @@ void MainWindow::finalize() help_menu->addSeparator(); #endif help_menu->addAction( embed::getIconPixmap( "icon_small" ), tr( "About" ), - this, SLOT( aboutLMMS() ) ); + this, SLOT(aboutLMMS())); // create tool-buttons ToolButton * project_new = new ToolButton( embed::getIconPixmap( "project_new" ), tr( "Create new project" ), - this, SLOT( createNewProject() ), + this, SLOT(createNewProject()), m_toolBar ); ToolButton * project_new_from_template = new ToolButton( embed::getIconPixmap( "project_new_from_template" ), tr( "Create new project from template" ), - this, SLOT( emptySlot() ), + this, SLOT(emptySlot()), m_toolBar ); project_new_from_template->setMenu( templates_menu ); project_new_from_template->setPopupMode( ToolButton::InstantPopup ); @@ -454,21 +454,21 @@ void MainWindow::finalize() ToolButton * project_open = new ToolButton( embed::getIconPixmap( "project_open" ), tr( "Open existing project" ), - this, SLOT( openProject() ), + this, SLOT(openProject()), m_toolBar ); ToolButton * project_open_recent = new ToolButton( embed::getIconPixmap( "project_open_recent" ), tr( "Recently opened projects" ), - this, SLOT( emptySlot() ), m_toolBar ); + this, SLOT(emptySlot()), m_toolBar ); project_open_recent->setMenu( new RecentProjectsMenu(this) ); project_open_recent->setPopupMode( ToolButton::InstantPopup ); ToolButton * project_save = new ToolButton( embed::getIconPixmap( "project_save" ), tr( "Save current project" ), - this, SLOT( saveProject() ), + this, SLOT(saveProject()), m_toolBar ); @@ -476,13 +476,13 @@ void MainWindow::finalize() embed::getIconPixmap( "project_export" ), tr( "Export current project" ), this, - SLOT( onExportProject() ), + SLOT(onExportProject()), m_toolBar ); m_metronomeToggle = new ToolButton( embed::getIconPixmap( "metronome" ), tr( "Metronome" ), - this, SLOT( onToggleMetronome() ), + this, SLOT(onToggleMetronome()), m_toolBar ); m_metronomeToggle->setCheckable(true); m_metronomeToggle->setChecked(Engine::audioEngine()->isMetronomeActive()); @@ -501,7 +501,7 @@ void MainWindow::finalize() ToolButton * song_editor_window = new ToolButton( embed::getIconPixmap( "songeditor" ), tr( "Song Editor" ) + " (Ctrl+1)", - this, SLOT( toggleSongEditorWin() ), + this, SLOT(toggleSongEditorWin()), m_toolBar ); song_editor_window->setShortcut( Qt::CTRL + Qt::Key_1 ); @@ -518,7 +518,7 @@ void MainWindow::finalize() embed::getIconPixmap( "piano" ), tr( "Piano Roll" ) + " (Ctrl+3)", - this, SLOT( togglePianoRollWin() ), + this, SLOT(togglePianoRollWin()), m_toolBar ); piano_roll_window->setShortcut( Qt::CTRL + Qt::Key_3 ); @@ -527,14 +527,14 @@ void MainWindow::finalize() tr( "Automation Editor" ) + " (Ctrl+4)", this, - SLOT( toggleAutomationEditorWin() ), + SLOT(toggleAutomationEditorWin()), m_toolBar ); automation_editor_window->setShortcut( Qt::CTRL + Qt::Key_4 ); ToolButton * mixer_window = new ToolButton( embed::getIconPixmap( "mixer" ), tr( "Mixer" ) + " (Ctrl+5)", - this, SLOT( toggleMixerWin() ), + this, SLOT(toggleMixerWin()), m_toolBar ); mixer_window->setShortcut( Qt::CTRL + Qt::Key_5 ); @@ -542,7 +542,7 @@ void MainWindow::finalize() embed::getIconPixmap( "controller" ), tr( "Show/hide controller rack" ) + " (Ctrl+6)", - this, SLOT( toggleControllerRack() ), + this, SLOT(toggleControllerRack()), m_toolBar ); controllers_window->setShortcut( Qt::CTRL + Qt::Key_6 ); @@ -550,7 +550,7 @@ void MainWindow::finalize() embed::getIconPixmap( "project_notes" ), tr( "Show/hide project notes" ) + " (Ctrl+7)", - this, SLOT( toggleProjectNotesWin() ), + this, SLOT(toggleProjectNotesWin()), m_toolBar ); project_notes_window->setShortcut( Qt::CTRL + Qt::Key_7 ); @@ -558,7 +558,7 @@ void MainWindow::finalize() embed::getIconPixmap( "microtuner" ), tr( "Microtuner configuration" ) + " (Ctrl+8)", - this, SLOT( toggleMicrotunerWin() ), + this, SLOT(toggleMicrotunerWin()), m_toolBar ); microtuner_window->setShortcut( Qt::CTRL + Qt::Key_8 ); @@ -616,7 +616,7 @@ void MainWindow::finalize() // reset window title every time we change the state of a subwindow to show the correct title for( const QMdiSubWindow * subWindow : workspace()->subWindowList() ) { - connect( subWindow, SIGNAL( windowStateChanged(Qt::WindowStates,Qt::WindowStates) ), this, SLOT( resetWindowTitle() ) ); + connect( subWindow, SIGNAL(windowStateChanged(Qt::WindowStates,Qt::WindowStates)), this, SLOT(resetWindowTitle())); } } @@ -1146,7 +1146,7 @@ void MainWindow::updateViewMenu() // not on top -> top <-> invisible m_viewMenu->addAction(embed::getIconPixmap( "songeditor" ), tr( "Song Editor" ) + "\tCtrl+1", - this, SLOT( toggleSongEditorWin() ) + this, SLOT(toggleSongEditorWin()) ); m_viewMenu->addAction(embed::getIconPixmap("pattern_track"), tr("Pattern Editor") + "\tCtrl+2", @@ -1154,35 +1154,35 @@ void MainWindow::updateViewMenu() ); m_viewMenu->addAction(embed::getIconPixmap( "piano" ), tr( "Piano Roll" ) + "\tCtrl+3", - this, SLOT( togglePianoRollWin() ) + this, SLOT(togglePianoRollWin()) ); m_viewMenu->addAction(embed::getIconPixmap( "automation" ), tr( "Automation Editor" ) + "\tCtrl+4", this, - SLOT( toggleAutomationEditorWin()) + SLOT(toggleAutomationEditorWin()) ); m_viewMenu->addAction(embed::getIconPixmap( "mixer" ), tr( "Mixer" ) + "\tCtrl+5", - this, SLOT( toggleMixerWin() ) + this, SLOT(toggleMixerWin()) ); m_viewMenu->addAction(embed::getIconPixmap( "controller" ), tr( "Controller Rack" ) + "\tCtrl+6", - this, SLOT( toggleControllerRack() ) + this, SLOT(toggleControllerRack()) ); m_viewMenu->addAction(embed::getIconPixmap( "project_notes" ), tr( "Project Notes" ) + "\tCtrl+7", - this, SLOT( toggleProjectNotesWin() ) + this, SLOT(toggleProjectNotesWin()) ); m_viewMenu->addAction(embed::getIconPixmap( "microtuner" ), tr( "Microtuner" ) + "\tCtrl+8", - this, SLOT( toggleMicrotunerWin() ) + this, SLOT(toggleMicrotunerWin()) ); m_viewMenu->addSeparator(); m_viewMenu->addAction(embed::getIconPixmap( "fullscreen" ), tr( "Fullscreen" ) + "\tF11", - this, SLOT( toggleFullscreen() ) + this, SLOT(toggleFullscreen()) ); m_viewMenu->addSeparator(); diff --git a/src/gui/MixerLine.cpp b/src/gui/MixerLine.cpp index bf63a9035..900298496 100644 --- a/src/gui/MixerLine.cpp +++ b/src/gui/MixerLine.cpp @@ -134,8 +134,8 @@ MixerLine::MixerLine( QWidget * _parent, MixerView * _mv, int _channelIndex ) : proxyWidget->setRotation( -90 ); proxyWidget->setPos( 8, 145 ); - connect( m_renameLineEdit, SIGNAL( editingFinished() ), this, SLOT( renameFinished() ) ); - connect( &Engine::mixer()->mixerChannel( m_channelIndex )->m_muteModel, SIGNAL( dataChanged() ), this, SLOT( update() ) ); + connect( m_renameLineEdit, SIGNAL(editingFinished()), this, SLOT(renameFinished())); + connect( &Engine::mixer()->mixerChannel( m_channelIndex )->m_muteModel, SIGNAL(dataChanged()), this, SLOT(update())); } @@ -251,18 +251,18 @@ void MixerLine::contextMenuEvent( QContextMenuEvent * ) QPointer contextMenu = new CaptionMenu( Engine::mixer()->mixerChannel( m_channelIndex )->m_name, this ); if( m_channelIndex != 0 ) // no move-options in master { - contextMenu->addAction( tr( "Move &left" ), this, SLOT( moveChannelLeft() ) ); - contextMenu->addAction( tr( "Move &right" ), this, SLOT( moveChannelRight() ) ); + contextMenu->addAction( tr( "Move &left" ), this, SLOT(moveChannelLeft())); + contextMenu->addAction( tr( "Move &right" ), this, SLOT(moveChannelRight())); } - contextMenu->addAction( tr( "Rename &channel" ), this, SLOT( renameChannel() ) ); + contextMenu->addAction( tr( "Rename &channel" ), this, SLOT(renameChannel())); contextMenu->addSeparator(); if( m_channelIndex != 0 ) // no remove-option in master { - contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "R&emove channel" ), this, SLOT( removeChannel() ) ); + contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "R&emove channel" ), this, SLOT(removeChannel())); contextMenu->addSeparator(); } - contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "Remove &unused channels" ), this, SLOT( removeUnusedChannels() ) ); + contextMenu->addAction( embed::getIconPixmap( "cancel" ), tr( "Remove &unused channels" ), this, SLOT(removeUnusedChannels())); contextMenu->addSeparator(); QMenu colorMenu(tr("Color"), this); diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index 5368fcf7d..6e3d9f95a 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -134,7 +134,7 @@ MixerView::MixerView() : QPushButton * newChannelBtn = new QPushButton( embed::getIconPixmap( "new_channel" ), QString(), this ); newChannelBtn->setObjectName( "newChannelBtn" ); newChannelBtn->setFixedSize( mixerLineSize ); - connect( newChannelBtn, SIGNAL( clicked() ), this, SLOT( addNewChannel() ) ); + connect( newChannelBtn, SIGNAL(clicked()), this, SLOT(addNewChannel())); ml->addWidget( newChannelBtn, 0, Qt::AlignTop ); @@ -147,8 +147,8 @@ MixerView::MixerView() : updateGeometry(); // timer for updating faders - connect( getGUI()->mainWindow(), SIGNAL( periodicUpdate() ), - this, SLOT( updateFaders() ) ); + connect( getGUI()->mainWindow(), SIGNAL(periodicUpdate()), + this, SLOT(updateFaders())); // add ourself to workspace @@ -311,7 +311,7 @@ MixerView::MixerChannelView::MixerChannelView(QWidget * _parent, MixerView * _mv embed::getIconPixmap( "led_off" ) ); m_soloBtn->setCheckable( true ); m_soloBtn->move( 9, m_fader->y()-21); - connect(&mixerChannel->m_soloModel, SIGNAL( dataChanged() ), + connect(&mixerChannel->m_soloModel, SIGNAL(dataChanged()), _mv, SLOT ( toggledSolo() ), Qt::DirectConnection ); m_soloBtn->setToolTip(tr("Solo this channel")); diff --git a/src/gui/ModelView.cpp b/src/gui/ModelView.cpp index 4ccdffd72..b2536fd9c 100644 --- a/src/gui/ModelView.cpp +++ b/src/gui/ModelView.cpp @@ -90,8 +90,8 @@ void ModelView::doConnections() { if( m_model != nullptr ) { - QObject::connect( m_model, SIGNAL( dataChanged() ), widget(), SLOT( update() ) ); - QObject::connect( m_model, SIGNAL( propertiesChanged() ), widget(), SLOT( update() ) ); + QObject::connect( m_model, SIGNAL(dataChanged()), widget(), SLOT(update())); + QObject::connect( m_model, SIGNAL(propertiesChanged()), widget(), SLOT(update())); } } diff --git a/src/gui/PluginBrowser.cpp b/src/gui/PluginBrowser.cpp index 2fd1374da..d6ba73903 100644 --- a/src/gui/PluginBrowser.cpp +++ b/src/gui/PluginBrowser.cpp @@ -74,8 +74,8 @@ PluginBrowser::PluginBrowser( QWidget * _parent ) : m_descTree->setIndentation( 10 ); m_descTree->setSelectionMode( QAbstractItemView::NoSelection ); - connect( searchBar, SIGNAL( textEdited( const QString & ) ), - this, SLOT( onFilterChanged( const QString & ) ) ); + connect( searchBar, SIGNAL( textEdited( const QString& ) ), + this, SLOT( onFilterChanged( const QString& ) ) ); view_layout->addWidget( hint ); view_layout->addWidget( searchBar ); diff --git a/src/gui/ProjectNotes.cpp b/src/gui/ProjectNotes.cpp index 9a218c571..22e806cdb 100644 --- a/src/gui/ProjectNotes.cpp +++ b/src/gui/ProjectNotes.cpp @@ -61,12 +61,12 @@ ProjectNotes::ProjectNotes() : clear(); connect( m_edit, - SIGNAL( currentCharFormatChanged( const QTextCharFormat & ) ), - this, SLOT( formatChanged( const QTextCharFormat & ) ) ); -// connect( m_edit, SIGNAL( currentAlignmentChanged( int ) ), -// this, SLOT( alignmentChanged( int ) ) ); - connect( m_edit, SIGNAL( textChanged() ), - Engine::getSong(), SLOT( setModified() ) ); + SIGNAL( currentCharFormatChanged( const QTextCharFormat& ) ), + this, SLOT( formatChanged( const QTextCharFormat& ) ) ); +// connect( m_edit, SIGNAL(currentAlignmentChanged(int)), +// this, SLOT(alignmentChanged(int))); + connect( m_edit, SIGNAL(textChanged()), + Engine::getSong(), SLOT(setModified())); setupActions(); @@ -120,31 +120,31 @@ void ProjectNotes::setupActions() a = new QAction( embed::getIconPixmap( "edit_undo" ), tr( "&Undo" ), this ); a->setShortcut( tr( "%1+Z" ).arg(UI_CTRL_KEY) ); - connect( a, SIGNAL( triggered() ), m_edit, SLOT( undo() ) ); + connect( a, SIGNAL(triggered()), m_edit, SLOT(undo())); tb->addAction( a ); a = new QAction( embed::getIconPixmap( "edit_redo" ), tr( "&Redo" ), this ); a->setShortcut( tr( "%1+Y" ).arg(UI_CTRL_KEY) ); - connect( a, SIGNAL( triggered() ), m_edit, SLOT( redo() ) ); + connect( a, SIGNAL(triggered()), m_edit, SLOT(redo())); tb->addAction( a ); a = new QAction( embed::getIconPixmap( "edit_copy" ), tr( "&Copy" ), this ); a->setShortcut( tr( "%1+C" ).arg(UI_CTRL_KEY) ); - connect( a, SIGNAL( triggered() ), m_edit, SLOT( copy() ) ); + connect( a, SIGNAL(triggered()), m_edit, SLOT(copy())); tb->addAction( a ); a = new QAction( embed::getIconPixmap( "edit_cut" ), tr( "Cu&t" ), this ); a->setShortcut( tr( "%1+X" ).arg(UI_CTRL_KEY) ); - connect( a, SIGNAL( triggered() ), m_edit, SLOT( cut() ) ); + connect( a, SIGNAL(triggered()), m_edit, SLOT(cut())); tb->addAction( a ); a = new QAction( embed::getIconPixmap( "edit_paste" ), tr( "&Paste" ), this ); a->setShortcut( tr( "%1+V" ).arg(UI_CTRL_KEY) ); - connect( a, SIGNAL( triggered() ), m_edit, SLOT( paste() ) ); + connect( a, SIGNAL(triggered()), m_edit, SLOT(paste())); tb->addAction( a ); @@ -154,8 +154,8 @@ void ProjectNotes::setupActions() m_comboFont->setEditable( true ); QFontDatabase db; m_comboFont->addItems( db.families() ); - connect( m_comboFont, SIGNAL( activated( const QString & ) ), - m_edit, SLOT( setFontFamily( const QString & ) ) ); + connect( m_comboFont, SIGNAL( activated( const QString& ) ), + m_edit, SLOT( setFontFamily( const QString& ) ) ); m_comboFont->lineEdit()->setText( QApplication::font().family() ); m_comboSize = new QComboBox( tb ); @@ -166,8 +166,8 @@ void ProjectNotes::setupActions() { m_comboSize->addItem( QString::number( *it ) ); } - connect( m_comboSize, SIGNAL( activated( const QString & ) ), - this, SLOT( textSize( const QString & ) ) ); + connect( m_comboSize, SIGNAL( activated( const QString& ) ), + this, SLOT( textSize( const QString& ) ) ); m_comboSize->lineEdit()->setText( QString::number( QApplication::font().pointSize() ) ); @@ -175,28 +175,28 @@ void ProjectNotes::setupActions() tr( "&Bold" ), this ); m_actionTextBold->setShortcut( tr( "%1+B" ).arg(UI_CTRL_KEY) ); m_actionTextBold->setCheckable( true ); - connect( m_actionTextBold, SIGNAL( triggered() ), this, - SLOT( textBold() ) ); + connect( m_actionTextBold, SIGNAL(triggered()), this, + SLOT(textBold())); m_actionTextItalic = new QAction( embed::getIconPixmap( "text_italic" ), tr( "&Italic" ), this ); m_actionTextItalic->setShortcut( tr( "%1+I" ).arg(UI_CTRL_KEY) ); m_actionTextItalic->setCheckable( true ); - connect( m_actionTextItalic, SIGNAL( triggered() ), this, - SLOT( textItalic() ) ); + connect( m_actionTextItalic, SIGNAL(triggered()), this, + SLOT(textItalic())); m_actionTextUnderline = new QAction( embed::getIconPixmap( "text_under" ), tr( "&Underline" ), this ); m_actionTextUnderline->setShortcut( tr( "%1+U" ).arg(UI_CTRL_KEY) ); m_actionTextUnderline->setCheckable( true ); - connect( m_actionTextUnderline, SIGNAL( triggered() ), this, - SLOT( textUnderline() ) ); + connect( m_actionTextUnderline, SIGNAL(triggered()), this, + SLOT(textUnderline())); QActionGroup * grp = new QActionGroup( tb ); - connect( grp, SIGNAL( triggered( QAction * ) ), this, - SLOT( textAlign( QAction * ) ) ); + connect( grp, SIGNAL(triggered(QAction*)), this, + SLOT(textAlign(QAction*))); m_actionAlignLeft = new QAction( embed::getIconPixmap( "text_left" ), tr( "&Left" ), m_edit ); @@ -230,8 +230,8 @@ void ProjectNotes::setupActions() QPixmap pix( 16, 16 ); pix.fill( Qt::black ); m_actionTextColor = new QAction( pix, tr( "&Color..." ), this ); - connect( m_actionTextColor, SIGNAL( triggered() ), this, - SLOT( textColor() ) ); + connect( m_actionTextColor, SIGNAL(triggered()), this, + SLOT(textColor())); tb->addWidget( m_comboFont ); tb->addWidget( m_comboSize ); diff --git a/src/gui/SampleTrackWindow.cpp b/src/gui/SampleTrackWindow.cpp index 1aee88082..c8901dda2 100644 --- a/src/gui/SampleTrackWindow.cpp +++ b/src/gui/SampleTrackWindow.cpp @@ -75,8 +75,8 @@ SampleTrackWindow::SampleTrackWindow(SampleTrackView * tv) : // setup line edit for changing sample track name m_nameLineEdit = new QLineEdit; m_nameLineEdit->setFont(pointSize<9>(m_nameLineEdit->font())); - connect(m_nameLineEdit, SIGNAL(textChanged(const QString &)), - this, SLOT(textChanged(const QString &))); + connect(m_nameLineEdit, SIGNAL(textChanged(const QString&)), + this, SLOT(textChanged(const QString&))); m_nameLineEdit->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred)); nameLayout->addWidget(m_nameLineEdit); diff --git a/src/gui/SideBar.cpp b/src/gui/SideBar.cpp index 0eca4d9f8..e16367a7b 100644 --- a/src/gui/SideBar.cpp +++ b/src/gui/SideBar.cpp @@ -94,8 +94,8 @@ SideBar::SideBar( Qt::Orientation _orientation, QWidget * _parent ) : setIconSize( QSize( 16, 16 ) ); m_btnGroup.setExclusive( false ); - connect( &m_btnGroup, SIGNAL( buttonClicked( QAbstractButton * ) ), - this, SLOT( toggleButton( QAbstractButton * ) ) ); + connect( &m_btnGroup, SIGNAL(buttonClicked(QAbstractButton*)), + this, SLOT(toggleButton(QAbstractButton*))); } diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index add614670..78e4f586c 100644 --- a/src/gui/SubWindow.cpp +++ b/src/gui/SubWindow.cpp @@ -63,7 +63,7 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_closeBtn->setCursor( Qt::ArrowCursor ); m_closeBtn->setAttribute( Qt::WA_NoMousePropagation ); m_closeBtn->setToolTip( tr( "Close" ) ); - connect( m_closeBtn, SIGNAL( clicked( bool ) ), this, SLOT( close() ) ); + connect( m_closeBtn, SIGNAL(clicked(bool)), this, SLOT(close())); m_maximizeBtn = new QPushButton( embed::getIconPixmap( "maximize" ), QString(), this ); m_maximizeBtn->resize( m_buttonSize ); @@ -71,7 +71,7 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_maximizeBtn->setCursor( Qt::ArrowCursor ); m_maximizeBtn->setAttribute( Qt::WA_NoMousePropagation ); m_maximizeBtn->setToolTip( tr( "Maximize" ) ); - connect( m_maximizeBtn, SIGNAL( clicked( bool ) ), this, SLOT( showMaximized() ) ); + connect( m_maximizeBtn, SIGNAL(clicked(bool)), this, SLOT(showMaximized())); m_restoreBtn = new QPushButton( embed::getIconPixmap( "restore" ), QString(), this ); m_restoreBtn->resize( m_buttonSize ); @@ -79,7 +79,7 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : m_restoreBtn->setCursor( Qt::ArrowCursor ); m_restoreBtn->setAttribute( Qt::WA_NoMousePropagation ); m_restoreBtn->setToolTip( tr( "Restore" ) ); - connect( m_restoreBtn, SIGNAL( clicked( bool ) ), this, SLOT( showNormal() ) ); + connect( m_restoreBtn, SIGNAL(clicked(bool)), this, SLOT(showNormal())); // QLabel for the window title and the shadow effect m_shadow = new QGraphicsDropShadowEffect(); @@ -96,7 +96,7 @@ SubWindow::SubWindow( QWidget *parent, Qt::WindowFlags windowFlags ) : setWindowFlags( Qt::SubWindow | Qt::WindowMaximizeButtonHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint | Qt::CustomizeWindowHint ); - connect( mdiArea(), SIGNAL( subWindowActivated( QMdiSubWindow* ) ), this, SLOT( focusChanged( QMdiSubWindow* ) ) ); + connect( mdiArea(), SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(focusChanged(QMdiSubWindow*))); } diff --git a/src/gui/clips/AutomationClipView.cpp b/src/gui/clips/AutomationClipView.cpp index b87e7e097..2bc29184c 100644 --- a/src/gui/clips/AutomationClipView.cpp +++ b/src/gui/clips/AutomationClipView.cpp @@ -52,10 +52,10 @@ AutomationClipView::AutomationClipView( AutomationClip * _clip, m_clip( _clip ), m_paintPixmap() { - connect( m_clip, SIGNAL( dataChanged() ), - this, SLOT( update() ) ); - connect( getGUI()->automationEditor(), SIGNAL( currentClipChanged() ), - this, SLOT( update() ) ); + connect( m_clip, SIGNAL(dataChanged()), + this, SLOT(update())); + connect( getGUI()->automationEditor(), SIGNAL(currentClipChanged()), + this, SLOT(update())); setAttribute( Qt::WA_OpaquePaintEvent, true ); @@ -182,23 +182,23 @@ void AutomationClipView::constructContextMenu( QMenu * _cm ) _cm->addSeparator(); _cm->addAction( embed::getIconPixmap( "edit_erase" ), - tr( "Clear" ), m_clip, SLOT( clear() ) ); + tr( "Clear" ), m_clip, SLOT(clear())); _cm->addSeparator(); _cm->addAction( embed::getIconPixmap( "reload" ), tr( "Reset name" ), - this, SLOT( resetName() ) ); + this, SLOT(resetName())); _cm->addAction( embed::getIconPixmap( "edit_rename" ), tr( "Change name" ), - this, SLOT( changeName() ) ); + this, SLOT(changeName())); _cm->addAction( embed::getIconPixmap( "record" ), tr( "Set/clear record" ), - this, SLOT( toggleRecording() ) ); + this, SLOT(toggleRecording())); _cm->addAction( embed::getIconPixmap( "flip_y" ), tr( "Flip Vertically (Visible)" ), - this, SLOT( flipY() ) ); + this, SLOT(flipY())); _cm->addAction( embed::getIconPixmap( "flip_x" ), tr( "Flip Horizontally (Visible)" ), - this, SLOT( flipX() ) ); + this, SLOT(flipX())); if( !m_clip->m_objects.isEmpty() ) { _cm->addSeparator(); @@ -216,8 +216,8 @@ void AutomationClipView::constructContextMenu( QMenu * _cm ) m->addAction( a ); } } - connect( m, SIGNAL( triggered( QAction * ) ), - this, SLOT( disconnectObject( QAction * ) ) ); + connect( m, SIGNAL(triggered(QAction*)), + this, SLOT(disconnectObject(QAction*))); _cm->addMenu( m ); } } diff --git a/src/gui/clips/ClipView.cpp b/src/gui/clips/ClipView.cpp index a9afca910..4748986ac 100644 --- a/src/gui/clips/ClipView.cpp +++ b/src/gui/clips/ClipView.cpp @@ -121,12 +121,12 @@ ClipView::ClipView( Clip * clip, setAcceptDrops( true ); setMouseTracking( true ); - connect( m_clip, SIGNAL( lengthChanged() ), - this, SLOT( updateLength() ) ); - connect( getGUI()->songEditor()->m_editor->zoomingModel(), SIGNAL( dataChanged() ), this, SLOT( updateLength() ) ); - connect( m_clip, SIGNAL( positionChanged() ), - this, SLOT( updatePosition() ) ); - connect( m_clip, SIGNAL( destroyedClip() ), this, SLOT( close() ) ); + connect( m_clip, SIGNAL(lengthChanged()), + this, SLOT(updateLength())); + connect( getGUI()->songEditor()->m_editor->zoomingModel(), SIGNAL(dataChanged()), this, SLOT(updateLength())); + connect( m_clip, SIGNAL(positionChanged()), + this, SLOT(updatePosition())); + connect( m_clip, SIGNAL(destroyedClip()), this, SLOT(close())); setModel( m_clip ); connect(m_clip, SIGNAL(colorChanged()), this, SLOT(update())); diff --git a/src/gui/clips/MidiClipView.cpp b/src/gui/clips/MidiClipView.cpp index 355363a01..675b350db 100644 --- a/src/gui/clips/MidiClipView.cpp +++ b/src/gui/clips/MidiClipView.cpp @@ -52,8 +52,8 @@ MidiClipView::MidiClipView( MidiClip* clip, TrackView* parent ) : // TODO if this option is ever added to the GUI, rename it to legacysepattern m_legacySEPattern(ConfigManager::inst()->value("ui", "legacysebb", "0").toInt()) { - connect( getGUI()->pianoRoll(), SIGNAL( currentMidiClipChanged() ), - this, SLOT( update() ) ); + connect( getGUI()->pianoRoll(), SIGNAL(currentMidiClipChanged()), + this, SLOT(update())); if( s_stepBtnOn0 == nullptr ) { @@ -149,38 +149,38 @@ void MidiClipView::constructContextMenu( QMenu * _cm ) QAction * a = new QAction( embed::getIconPixmap( "piano" ), tr( "Open in piano-roll" ), _cm ); _cm->insertAction( _cm->actions()[0], a ); - connect( a, SIGNAL( triggered( bool ) ), - this, SLOT( openInPianoRoll() ) ); + connect( a, SIGNAL(triggered(bool)), + this, SLOT(openInPianoRoll())); QAction * b = new QAction( embed::getIconPixmap( "ghost_note" ), tr( "Set as ghost in piano-roll" ), _cm ); if( m_clip->empty() ) { b->setEnabled( false ); } _cm->insertAction( _cm->actions()[1], b ); - connect( b, SIGNAL( triggered( bool ) ), - this, SLOT( setGhostInPianoRoll() ) ); + connect( b, SIGNAL(triggered(bool)), + this, SLOT(setGhostInPianoRoll())); _cm->insertSeparator( _cm->actions()[2] ); _cm->addSeparator(); _cm->addAction( embed::getIconPixmap( "edit_erase" ), - tr( "Clear all notes" ), m_clip, SLOT( clear() ) ); + tr( "Clear all notes" ), m_clip, SLOT(clear())); _cm->addSeparator(); _cm->addAction( embed::getIconPixmap( "reload" ), tr( "Reset name" ), - this, SLOT( resetName() ) ); + this, SLOT(resetName())); _cm->addAction( embed::getIconPixmap( "edit_rename" ), tr( "Change name" ), - this, SLOT( changeName() ) ); + this, SLOT(changeName())); if ( m_clip->type() == MidiClip::BeatClip ) { _cm->addSeparator(); _cm->addAction( embed::getIconPixmap( "step_btn_add" ), - tr( "Add steps" ), m_clip, SLOT( addSteps() ) ); + tr( "Add steps" ), m_clip, SLOT(addSteps())); _cm->addAction( embed::getIconPixmap( "step_btn_remove" ), - tr( "Remove steps" ), m_clip, SLOT( removeSteps() ) ); + tr( "Remove steps" ), m_clip, SLOT(removeSteps())); _cm->addAction( embed::getIconPixmap( "step_btn_duplicate" ), - tr( "Clone Steps" ), m_clip, SLOT( cloneSteps() ) ); + tr( "Clone Steps" ), m_clip, SLOT(cloneSteps())); } } diff --git a/src/gui/clips/PatternClipView.cpp b/src/gui/clips/PatternClipView.cpp index 3884b3eb6..f65595f52 100644 --- a/src/gui/clips/PatternClipView.cpp +++ b/src/gui/clips/PatternClipView.cpp @@ -44,8 +44,8 @@ PatternClipView::PatternClipView(Clip* _clip, TrackView* _tv) : m_patternClip(dynamic_cast(_clip)), m_paintPixmap() { - connect( _clip->getTrack(), SIGNAL( dataChanged() ), - this, SLOT( update() ) ); + connect( _clip->getTrack(), SIGNAL(dataChanged()), + this, SLOT(update())); setStyle( QApplication::style() ); } @@ -56,15 +56,15 @@ void PatternClipView::constructContextMenu(QMenu* _cm) tr("Open in Pattern Editor"), _cm ); _cm->insertAction( _cm->actions()[0], a ); - connect( a, SIGNAL( triggered( bool ) ), - this, SLOT( openInPatternEditor() ) ); + connect( a, SIGNAL(triggered(bool)), + this, SLOT(openInPatternEditor())); _cm->insertSeparator( _cm->actions()[1] ); _cm->addSeparator(); _cm->addAction( embed::getIconPixmap( "reload" ), tr( "Reset name" ), - this, SLOT( resetName() ) ); + this, SLOT(resetName())); _cm->addAction( embed::getIconPixmap( "edit_rename" ), tr( "Change name" ), - this, SLOT( changeName() ) ); + this, SLOT(changeName())); } diff --git a/src/gui/clips/SampleClipView.cpp b/src/gui/clips/SampleClipView.cpp index d2fe7cbaa..5b3228de7 100644 --- a/src/gui/clips/SampleClipView.cpp +++ b/src/gui/clips/SampleClipView.cpp @@ -74,7 +74,7 @@ void SampleClipView::constructContextMenu(QMenu* cm) /*contextMenu.addAction( embed::getIconPixmap( "record" ), tr( "Set/clear record" ), - m_clip, SLOT( toggleRecord() ) );*/ + m_clip, SLOT(toggleRecord()));*/ cm->addAction( embed::getIconPixmap("flip_x"), diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 8f8cdd570..fba88643e 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -110,11 +110,11 @@ AutomationEditor::AutomationEditor() : m_crossColor(0, 0, 0), m_backgroundShade(0, 0, 0) { - connect( this, SIGNAL( currentClipChanged() ), - this, SLOT( updateAfterClipChange() ), + connect( this, SIGNAL(currentClipChanged()), + this, SLOT(updateAfterClipChange()), Qt::QueuedConnection ); - connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), - this, SLOT( update() ) ); + connect( Engine::getSong(), SIGNAL(timeSignatureChanged(int,int)), + this, SLOT(update())); setAttribute( Qt::WA_OpaquePaintEvent, true ); @@ -122,15 +122,15 @@ AutomationEditor::AutomationEditor() : setLayoutDirection( Qt::LeftToRight ); m_tensionModel = new FloatModel(1.0, 0.0, 1.0, 0.01); - connect( m_tensionModel, SIGNAL( dataChanged() ), - this, SLOT( setTension() ) ); + connect( m_tensionModel, SIGNAL(dataChanged()), + this, SLOT(setTension())); for (auto q : Quantizations) { m_quantizeModel.addItem(QString("1/%1").arg(q)); } - connect( &m_quantizeModel, SIGNAL(dataChanged() ), - this, SLOT( setQuantization() ) ); + connect( &m_quantizeModel, SIGNAL(dataChanged()), + this, SLOT(setQuantization())); m_quantizeModel.setValue( m_quantizeModel.findText( "1/8" ) ); if (s_toolYFlip == nullptr) @@ -150,22 +150,22 @@ AutomationEditor::AutomationEditor() : Song::Mode_PlayAutomationClip ), m_currentPosition, Song::Mode_PlayAutomationClip, this ); - 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 & ) ) ); + 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 ); m_leftRightScroll->setSingleStep( 1 ); - connect( m_leftRightScroll, SIGNAL( valueChanged( int ) ), this, - SLOT( horScrolled( int ) ) ); + connect( m_leftRightScroll, SIGNAL(valueChanged(int)), this, + SLOT(horScrolled(int))); m_topBottomScroll = new QScrollBar( Qt::Vertical, this ); m_topBottomScroll->setSingleStep( 1 ); m_topBottomScroll->setPageStep( 20 ); - connect( m_topBottomScroll, SIGNAL( valueChanged( int ) ), this, - SLOT( verScrolled( int ) ) ); + connect( m_topBottomScroll, SIGNAL(valueChanged(int)), this, + SLOT(verScrolled(int))); // init pixmaps if (s_toolDraw == nullptr) @@ -1914,8 +1914,8 @@ AutomationEditorWindow::AutomationEditorWindow() : m_zoomingXComboBox->setModel( &m_editor->m_zoomingXModel ); - connect( &m_editor->m_zoomingXModel, SIGNAL( dataChanged() ), - m_editor, SLOT( zoomingXChanged() ) ); + connect( &m_editor->m_zoomingXModel, SIGNAL(dataChanged()), + m_editor, SLOT(zoomingXChanged())); QLabel * zoom_y_label = new QLabel( zoomToolBar ); @@ -1934,8 +1934,8 @@ AutomationEditorWindow::AutomationEditorWindow() : m_zoomingYComboBox->setModel( &m_editor->m_zoomingYModel ); - connect( &m_editor->m_zoomingYModel, SIGNAL( dataChanged() ), - m_editor, SLOT( zoomingYChanged() ) ); + connect( &m_editor->m_zoomingYModel, SIGNAL(dataChanged()), + m_editor, SLOT(zoomingYChanged())); zoomToolBar->addWidget( zoom_x_label ); zoomToolBar->addWidget( m_zoomingXComboBox ); @@ -2014,7 +2014,7 @@ void AutomationEditorWindow::setCurrentClip(AutomationClip* clip) if (clip) { connect(clip, SIGNAL(dataChanged()), this, SLOT(update())); - connect( clip, SIGNAL( dataChanged() ), this, SLOT( updateWindowTitle() ) ); + connect( clip, SIGNAL(dataChanged()), this, SLOT(updateWindowTitle())); connect(clip, SIGNAL(destroyed()), this, SLOT(clearCurrentClip())); connect(m_flipXAction, SIGNAL(triggered()), clip, SLOT(flipX())); diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index fd1cd0480..b9f0e1397 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -251,8 +251,8 @@ PianoRoll::PianoRoll() : markScaleAction->setEnabled( false ); markChordAction->setEnabled( false ); - connect( this, SIGNAL(semiToneMarkerMenuScaleSetEnabled(bool)), markScaleAction, SLOT(setEnabled(bool)) ); - connect( this, SIGNAL(semiToneMarkerMenuChordSetEnabled(bool)), markChordAction, SLOT(setEnabled(bool)) ); + connect( this, SIGNAL(semiToneMarkerMenuScaleSetEnabled(bool)), markScaleAction, SLOT(setEnabled(bool))); + connect( this, SIGNAL(semiToneMarkerMenuChordSetEnabled(bool)), markChordAction, SLOT(setEnabled(bool))); m_semiToneMarkerMenu->addAction( markSemitoneAction ); m_semiToneMarkerMenu->addAction( markAllOctaveSemitonesAction ); @@ -301,42 +301,42 @@ PianoRoll::PianoRoll() : Song::Mode_PlayMidiClip ), m_currentPosition, Song::Mode_PlayMidiClip, this ); - 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 & ) ) ); + 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 lmms::TimePos & ) ), - this, SLOT( updatePositionStepRecording( const lmms::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 lmms::TimePos & ) ), + SIGNAL( positionChanged( const lmms::TimePos& ) ), this, - SLOT( updatePositionAccompany( const lmms::TimePos & ) ) ); + SLOT( updatePositionAccompany( const lmms::TimePos& ) ) ); // TODO /* connect( engine::getSong()->getPlayPos( Song::Mode_PlayPattern ).m_timeLine, - SIGNAL( positionChanged( const lmms::TimePos & ) ), + SIGNAL( positionChanged( const lmms::TimePos& ) ), this, - SLOT( updatePositionAccompany( const lmms::TimePos & ) ) );*/ + SLOT( updatePositionAccompany( const lmms::TimePos& ) ) );*/ removeSelection(); // init scrollbars m_leftRightScroll = new QScrollBar( Qt::Horizontal, this ); m_leftRightScroll->setSingleStep( 1 ); - connect( m_leftRightScroll, SIGNAL( valueChanged( int ) ), this, - SLOT( horScrolled( int ) ) ); + connect( m_leftRightScroll, SIGNAL(valueChanged(int)), this, + SLOT(horScrolled(int))); m_topBottomScroll = new QScrollBar( Qt::Vertical, this ); m_topBottomScroll->setSingleStep( 1 ); m_topBottomScroll->setPageStep( 20 ); - connect( m_topBottomScroll, SIGNAL( valueChanged( int ) ), this, - SLOT( verScrolled( int ) ) ); + connect( m_topBottomScroll, SIGNAL(valueChanged(int)), this, + SLOT(verScrolled(int))); // setup zooming-stuff for( float const & zoomLevel : m_zoomLevels ) @@ -344,8 +344,8 @@ PianoRoll::PianoRoll() : m_zoomingModel.addItem( QString( "%1\%" ).arg( zoomLevel * 100 ) ); } m_zoomingModel.setValue( m_zoomingModel.findText( "100%" ) ); - connect( &m_zoomingModel, SIGNAL( dataChanged() ), - this, SLOT( zoomingChanged() ) ); + connect( &m_zoomingModel, SIGNAL(dataChanged()), + this, SLOT(zoomingChanged())); // zoom y for (float const & zoomLevel : m_zoomYLevels) @@ -363,8 +363,8 @@ PianoRoll::PianoRoll() : } m_quantizeModel.setValue( m_quantizeModel.findText( "1/16" ) ); - connect( &m_quantizeModel, SIGNAL( dataChanged() ), - this, SLOT( quantizeChanged() ) ); + connect( &m_quantizeModel, SIGNAL(dataChanged()), + this, SLOT(quantizeChanged())); // Set up note length model m_noteLenModel.addItem( tr( "Last note" ), @@ -387,8 +387,8 @@ PianoRoll::PianoRoll() : m_noteLenModel.setValue( 0 ); // Note length change can cause a redraw if Q is set to lock - connect( &m_noteLenModel, SIGNAL( dataChanged() ), - this, SLOT( noteLengthChanged() ) ); + connect( &m_noteLenModel, SIGNAL(dataChanged()), + this, SLOT(noteLengthChanged())); // Set up key selection dropdown m_keyModel.addItem(tr("No key")); @@ -414,8 +414,8 @@ PianoRoll::PianoRoll() : // connect scale change to key change so it auto-highlights with scale as well connect(&m_scaleModel, &ComboBoxModel::dataChanged, this, &PianoRoll::keyChanged); // change can update m_semiToneMarkerMenu - connect( &m_scaleModel, SIGNAL( dataChanged() ), - this, SLOT( updateSemiToneMarkerMenu() ) ); + connect( &m_scaleModel, SIGNAL(dataChanged()), + this, SLOT(updateSemiToneMarkerMenu())); // Set up chord model m_chordModel.addItem( tr("No chord") ); @@ -430,22 +430,22 @@ PianoRoll::PianoRoll() : m_chordModel.setValue( 0 ); // change can update m_semiToneMarkerMenu - connect( &m_chordModel, SIGNAL( dataChanged() ), - this, SLOT( updateSemiToneMarkerMenu() ) ); + connect( &m_chordModel, SIGNAL(dataChanged()), + this, SLOT(updateSemiToneMarkerMenu())); setFocusPolicy( Qt::StrongFocus ); setFocus(); setMouseTracking( true ); - connect( &m_scaleModel, SIGNAL( dataChanged() ), - this, SLOT( updateSemiToneMarkerMenu() ) ); + connect( &m_scaleModel, SIGNAL(dataChanged()), + this, SLOT(updateSemiToneMarkerMenu())); - connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), - this, SLOT( update() ) ); + connect( Engine::getSong(), SIGNAL(timeSignatureChanged(int,int)), + this, SLOT(update())); //connection for selecion from timeline - connect( m_timeLine, SIGNAL( regionSelectedFromPixels( int, int ) ), - this, SLOT( selectRegionFromPixels( int, int ) ) ); + connect( m_timeLine, SIGNAL(regionSelectedFromPixels(int,int)), + this, SLOT(selectRegionFromPixels(int,int))); // Set up snap model m_snapModel.addItem(tr("Nudge")); @@ -913,12 +913,12 @@ void PianoRoll::setCurrentMidiClip( MidiClip* newMidiClip ) resizeEvent( nullptr ); // make sure to always get informed about the MIDI clip being destroyed - connect( m_midiClip, SIGNAL( destroyedMidiClip( lmms::MidiClip* ) ), this, SLOT( hideMidiClip( lmms::MidiClip* ) ) ); + connect( m_midiClip, SIGNAL(destroyedMidiClip(lmms::MidiClip*)), this, SLOT(hideMidiClip(lmms::MidiClip*))); 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() ) ); + connect( m_midiClip->instrumentTrack()->pianoModel(), SIGNAL(dataChanged()), this, SLOT(update())); connect(m_midiClip->instrumentTrack()->firstKeyModel(), SIGNAL(dataChanged()), this, SLOT(update())); connect(m_midiClip->instrumentTrack()->lastKeyModel(), SIGNAL(dataChanged()), this, SLOT(update())); @@ -4756,7 +4756,7 @@ PianoRollWindow::PianoRollWindow() : selectAction->setShortcut( Qt::SHIFT | Qt::Key_S ); pitchBendAction->setShortcut( Qt::SHIFT | Qt::Key_T ); - connect( editModeGroup, SIGNAL( triggered( int ) ), m_editor, SLOT( setEditMode( int ) ) ); + connect( editModeGroup, SIGNAL(triggered(int)), m_editor, SLOT(setEditMode(int))); // Quantize combo button QToolButton* quantizeButton = new QToolButton(notesActionsToolBar); @@ -4822,9 +4822,9 @@ PianoRollWindow::PianoRollWindow() : copyAction->setShortcut( Qt::CTRL | Qt::Key_C ); pasteAction->setShortcut( Qt::CTRL | Qt::Key_V ); - connect( cutAction, SIGNAL( triggered() ), m_editor, SLOT( cutSelectedNotes() ) ); - connect( copyAction, SIGNAL( triggered() ), m_editor, SLOT( copySelectedNotes() ) ); - connect( pasteAction, SIGNAL( triggered() ), m_editor, SLOT( pasteNotes() ) ); + connect( cutAction, SIGNAL(triggered()), m_editor, SLOT(cutSelectedNotes())); + connect( copyAction, SIGNAL(triggered()), m_editor, SLOT(copySelectedNotes())); + connect( pasteAction, SIGNAL(triggered()), m_editor, SLOT(pasteNotes())); copyPasteActionsToolBar->addAction( cutAction ); copyPasteActionsToolBar->addAction( copyAction ); @@ -4949,8 +4949,8 @@ PianoRollWindow::PianoRollWindow() : m_clearGhostButton->setIcon( embed::getIconPixmap( "clear_ghost_note" ) ); m_clearGhostButton->setToolTip( tr( "Clear ghost notes" ) ); m_clearGhostButton->setEnabled( false ); - connect( m_clearGhostButton, SIGNAL( clicked() ), m_editor, SLOT( clearGhostClip() ) ); - connect( m_editor, SIGNAL( ghostClipSet( bool ) ), this, SLOT( ghostClipSet( bool ) ) ); + connect( m_clearGhostButton, SIGNAL(clicked()), m_editor, SLOT(clearGhostClip())); + connect( m_editor, SIGNAL(ghostClipSet(bool)), this, SLOT(ghostClipSet(bool))); // Wrap label icons and comboboxes in a single widget so when // the window is resized smaller in width it hides both @@ -5027,8 +5027,8 @@ PianoRollWindow::PianoRollWindow() : setCurrentMidiClip( nullptr ); // Connections - connect( m_editor, SIGNAL( currentMidiClipChanged() ), this, SIGNAL( currentMidiClipChanged() ) ); - connect( m_editor, SIGNAL( currentMidiClipChanged() ), this, SLOT( updateAfterMidiClipChange() ) ); + connect( m_editor, SIGNAL(currentMidiClipChanged()), this, SIGNAL(currentMidiClipChanged())); + connect( m_editor, SIGNAL(currentMidiClipChanged()), this, SLOT(updateAfterMidiClipChange())); } @@ -5058,8 +5058,8 @@ void PianoRollWindow::setCurrentMidiClip( MidiClip* clip ) { setWindowTitle( tr( "Piano-Roll - %1" ).arg( clip->name() ) ); m_fileToolsButton->setEnabled(true); - connect( clip->instrumentTrack(), SIGNAL( nameChanged() ), this, SLOT( updateAfterMidiClipChange()) ); - connect( clip, SIGNAL( dataChanged() ), this, SLOT( updateAfterMidiClipChange() ) ); + connect( clip->instrumentTrack(), SIGNAL(nameChanged()), this, SLOT(updateAfterMidiClipChange())); + connect( clip, SIGNAL(dataChanged()), this, SLOT(updateAfterMidiClipChange())); } else { diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 9c028feba..eaabf52ea 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -88,23 +88,23 @@ SongEditor::SongEditor( Song * song ) : m_song->m_playPos[Song::Mode_PlaySong], m_currentPosition, Song::Mode_PlaySong, this ); - connect( this, SIGNAL( positionChanged( const lmms::TimePos & ) ), + connect( this, SIGNAL( positionChanged( const lmms::TimePos& ) ), m_song->m_playPos[Song::Mode_PlaySong].m_timeLine, - 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() ), - this, SLOT( stopRubberBand() ) ); + 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()), + this, SLOT(stopRubberBand())); m_positionLine = new PositionLine(this); static_cast( layout() )->insertWidget( 1, m_timeLine ); - connect( m_song, SIGNAL( playbackStateChanged() ), - m_positionLine, SLOT( update() ) ); - connect( this, SIGNAL( zoomingValueChanged( float ) ), - m_positionLine, SLOT( zoomChange( float ) ) ); + connect( m_song, SIGNAL(playbackStateChanged()), + m_positionLine, SLOT(update())); + connect( this, SIGNAL(zoomingValueChanged(float)), + m_positionLine, SLOT(zoomChange(float))); // Ensure loop markers snap to same increments as clips. Zoom & proportional // snap changes are handled in zoomingChanged() and toggleProportionalSnap() @@ -129,8 +129,8 @@ SongEditor::SongEditor( Song * song ) : tr( "High quality mode" ), nullptr, nullptr, tb ); hq_btn->setCheckable( true ); - connect( hq_btn, SIGNAL( toggled( bool ) ), - this, SLOT( setHighQuality( bool ) ) ); + connect( hq_btn, SIGNAL(toggled(bool)), + this, SLOT(setHighQuality(bool))); hq_btn->setFixedWidth( 42 ); getGUI()->mainWindow()->addWidgetToToolBar( hq_btn, 1, col ); #endif @@ -159,14 +159,14 @@ SongEditor::SongEditor( Song * song ) : m_masterVolumeSlider->setTickInterval( 50 ); m_masterVolumeSlider->setToolTip(tr("Master volume")); - connect( m_masterVolumeSlider, SIGNAL( logicValueChanged( int ) ), this, - SLOT( setMasterVolume( int ) ) ); - connect( m_masterVolumeSlider, SIGNAL( sliderPressed() ), this, - SLOT( showMasterVolumeFloat()) ); - connect( m_masterVolumeSlider, SIGNAL( logicSliderMoved( int ) ), this, - SLOT( updateMasterVolumeFloat( int ) ) ); - connect( m_masterVolumeSlider, SIGNAL( sliderReleased() ), this, - SLOT( hideMasterVolumeFloat() ) ); + connect( m_masterVolumeSlider, SIGNAL(logicValueChanged(int)), this, + SLOT(setMasterVolume(int))); + connect( m_masterVolumeSlider, SIGNAL(sliderPressed()), this, + SLOT(showMasterVolumeFloat())); + connect( m_masterVolumeSlider, SIGNAL(logicSliderMoved(int)), this, + SLOT(updateMasterVolumeFloat(int))); + connect( m_masterVolumeSlider, SIGNAL(sliderReleased()), this, + SLOT(hideMasterVolumeFloat())); m_mvsStatus = new TextFloat; m_mvsStatus->setTitle( tr( "Master volume" ) ); @@ -191,14 +191,14 @@ SongEditor::SongEditor( Song * song ) : m_masterPitchSlider->setFixedSize( 26, 60 ); m_masterPitchSlider->setTickInterval( 12 ); m_masterPitchSlider->setToolTip(tr("Master pitch")); - connect( m_masterPitchSlider, SIGNAL( logicValueChanged( int ) ), this, - SLOT( setMasterPitch( int ) ) ); - connect( m_masterPitchSlider, SIGNAL( sliderPressed() ), this, - SLOT( showMasterPitchFloat() ) ); - connect( m_masterPitchSlider, SIGNAL( logicSliderMoved( int ) ), this, - SLOT( updateMasterPitchFloat( int ) ) ); - connect( m_masterPitchSlider, SIGNAL( sliderReleased() ), this, - SLOT( hideMasterPitchFloat() ) ); + connect( m_masterPitchSlider, SIGNAL(logicValueChanged(int)), this, + SLOT(setMasterPitch(int))); + connect( m_masterPitchSlider, SIGNAL(sliderPressed()), this, + SLOT(showMasterPitchFloat())); + connect( m_masterPitchSlider, SIGNAL(logicSliderMoved(int)), this, + SLOT(updateMasterPitchFloat(int))); + connect( m_masterPitchSlider, SIGNAL(sliderReleased()), this, + SLOT(hideMasterPitchFloat())); m_mpsStatus = new TextFloat; m_mpsStatus->setTitle( tr( "Master pitch" ) ); @@ -231,10 +231,10 @@ SongEditor::SongEditor( Song * song ) : m_leftRightScroll->setSingleStep( 1 ); m_leftRightScroll->setPageStep( 20 ); static_cast( layout() )->addWidget( m_leftRightScroll ); - connect( m_leftRightScroll, SIGNAL( valueChanged( int ) ), - this, SLOT( scrolled( int ) ) ); - connect( m_song, SIGNAL( lengthChanged( int ) ), - this, SLOT( updateScrollBar( int ) ) ); + connect( m_leftRightScroll, SIGNAL(valueChanged(int)), + this, SLOT(scrolled(int))); + connect( m_song, SIGNAL(lengthChanged(int)), + this, SLOT(updateScrollBar(int))); connect(m_leftRightScroll, SIGNAL(valueChanged(int)),this, SLOT(updateRubberband())); connect(contentWidget()->verticalScrollBar(), SIGNAL(valueChanged(int)),this, SLOT(updateRubberband())); connect(m_timeLine, SIGNAL(selectionFinished()), this, SLOT(stopSelectRegion())); @@ -247,10 +247,10 @@ SongEditor::SongEditor( Song * song ) : } m_zoomingModel->setInitValue( m_zoomingModel->findText( "100%" ) ); - connect( m_zoomingModel, SIGNAL( dataChanged() ), - this, SLOT( zoomingChanged() ) ); - connect( m_zoomingModel, SIGNAL( dataChanged() ), - m_positionLine, SLOT( update() ) ); + connect( m_zoomingModel, SIGNAL(dataChanged()), + this, SLOT(zoomingChanged())); + connect( m_zoomingModel, SIGNAL(dataChanged()), + m_positionLine, SLOT(update())); //Set up snapping model, 2^i for ( int i = 3; i >= -4; i-- ) @@ -765,9 +765,9 @@ static inline void animateScroll( QScrollBar *scrollBar, int newVal, bool smooth { t = new QTimeLine( 600, scrollBar ); t->setFrameRange( scrollBar->value(), newVal ); - t->connect( t, SIGNAL( finished() ), SLOT( deleteLater() ) ); + t->connect( t, SIGNAL(finished()), SLOT(deleteLater())); - scrollBar->connect( t, SIGNAL( frameChanged( int ) ), SLOT( setValue( int ) ) ); + scrollBar->connect( t, SIGNAL(frameChanged(int)), SLOT(setValue(int))); t->start(); } @@ -1023,7 +1023,7 @@ SongEditorWindow::SongEditorWindow(Song* song) : m_setProportionalSnapAction->setCheckable(true); m_setProportionalSnapAction->setChecked(false); connect(m_setProportionalSnapAction, SIGNAL(triggered()), m_editor, SLOT(toggleProportionalSnap())); - connect(m_setProportionalSnapAction, SIGNAL(triggered()), this, SLOT(updateSnapLabel()) ); + connect(m_setProportionalSnapAction, SIGNAL(triggered()), this, SLOT(updateSnapLabel())); snapToolBar->addWidget( snap_lbl ); snapToolBar->addWidget( m_snappingComboBox ); @@ -1139,7 +1139,7 @@ void SongEditorWindow::adjustUiAfterProjectLoad() // it, it's very annyoing to manually bring up the song editor each time getGUI()->mainWindow()->workspace()->setActiveSubWindow( qobject_cast( parentWidget() ) ); - connect( qobject_cast( parentWidget() ), SIGNAL( focusLost() ), this, SLOT( lostFocus() ) ); + connect( qobject_cast( parentWidget() ), SIGNAL(focusLost()), this, SLOT(lostFocus())); m_editor->scrolled(0); } diff --git a/src/gui/editors/TimeLineWidget.cpp b/src/gui/editors/TimeLineWidget.cpp index b7aa6d94f..0d3de7d2a 100644 --- a/src/gui/editors/TimeLineWidget.cpp +++ b/src/gui/editors/TimeLineWidget.cpp @@ -89,11 +89,11 @@ TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppb, m_pos.m_timeLine = this; QTimer * updateTimer = new QTimer( this ); - connect( updateTimer, SIGNAL( timeout() ), - this, SLOT( updatePosition() ) ); + connect( updateTimer, SIGNAL(timeout()), + this, SLOT(updatePosition())); updateTimer->start( 1000 / 60 ); // 60 fps - connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int,int ) ), - this, SLOT( update() ) ); + connect( Engine::getSong(), SIGNAL(timeSignatureChanged(int,int)), + this, SLOT(update())); } @@ -125,17 +125,17 @@ void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) autoScroll->setGeneralToolTip( tr( "Auto scrolling" ) ); autoScroll->addState( embed::getIconPixmap( "autoscroll_on" ) ); autoScroll->addState( embed::getIconPixmap( "autoscroll_off" ) ); - connect( autoScroll, SIGNAL( changedState( int ) ), this, - SLOT( toggleAutoScroll( int ) ) ); + connect( autoScroll, SIGNAL(changedState(int)), this, + SLOT(toggleAutoScroll(int))); NStateButton * loopPoints = new NStateButton( _tool_bar ); loopPoints->setGeneralToolTip( tr( "Loop points" ) ); loopPoints->addState( embed::getIconPixmap( "loop_points_off" ) ); loopPoints->addState( embed::getIconPixmap( "loop_points_on" ) ); - connect( loopPoints, SIGNAL( changedState( int ) ), this, - SLOT( toggleLoopPoints( int ) ) ); - connect( this, SIGNAL( loopPointStateLoaded( int ) ), loopPoints, - SLOT( changeState( int ) ) ); + connect( loopPoints, SIGNAL(changedState(int)), this, + SLOT(toggleLoopPoints(int))); + connect( this, SIGNAL(loopPointStateLoaded(int)), loopPoints, + SLOT(changeState(int))); NStateButton * behaviourAtStop = new NStateButton( _tool_bar ); behaviourAtStop->addState( embed::getIconPixmap( "back_to_zero" ), @@ -147,10 +147,10 @@ void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) "started" ) ); behaviourAtStop->addState( embed::getIconPixmap( "keep_stop_position" ), tr( "After stopping keep position" ) ); - connect( behaviourAtStop, SIGNAL( changedState( int ) ), this, - SLOT( toggleBehaviourAtStop( int ) ) ); - connect( this, SIGNAL( loadBehaviourAtStop( int ) ), behaviourAtStop, - SLOT( changeState( int ) ) ); + connect( behaviourAtStop, SIGNAL(changedState(int)), this, + SLOT(toggleBehaviourAtStop(int))); + connect( this, SIGNAL(loadBehaviourAtStop(int)), behaviourAtStop, + SLOT(changeState(int))); behaviourAtStop->changeState( BackToStart ); _tool_bar->addWidget( autoScroll ); diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index 6c85cf1a3..43309d96b 100644 --- a/src/gui/editors/TrackContainerView.cpp +++ b/src/gui/editors/TrackContainerView.cpp @@ -108,10 +108,10 @@ TrackContainerView::TrackContainerView( TrackContainer * _tc ) : setAcceptDrops( true ); - connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), - this, SLOT( realignTracks() ) ); - connect( m_tc, SIGNAL( trackAdded( lmms::Track * ) ), - this, SLOT( createTrackView( lmms::Track * ) ), + connect( Engine::getSong(), SIGNAL(timeSignatureChanged(int,int)), + this, SLOT(realignTracks())); + 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 lmms::TimePos & ) ), + connect( this, SIGNAL( positionChanged( const lmms::TimePos& ) ), _tv->getTrackContentWidget(), - SLOT( changePosition( const lmms::TimePos & ) ) ); + SLOT( changePosition( const lmms::TimePos& ) ) ); realignTracks(); return( _tv ); } diff --git a/src/gui/instrument/EnvelopeAndLfoView.cpp b/src/gui/instrument/EnvelopeAndLfoView.cpp index cff230e38..a11910b09 100644 --- a/src/gui/instrument/EnvelopeAndLfoView.cpp +++ b/src/gui/instrument/EnvelopeAndLfoView.cpp @@ -202,8 +202,8 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) : m_userLfoBtn->setInactiveGraphic( embed::getIconPixmap( "usr_wave_inactive" ) ); - connect( m_userLfoBtn, SIGNAL( toggled( bool ) ), - this, SLOT( lfoUserWaveChanged() ) ); + connect( m_userLfoBtn, SIGNAL(toggled(bool)), + this, SLOT(lfoUserWaveChanged())); PixmapButton * random_lfo_btn = new PixmapButton( this, nullptr ); random_lfo_btn->move( LFO_SHAPES_X+60, LFO_SHAPES_Y ); diff --git a/src/gui/instrument/InstrumentMidiIOView.cpp b/src/gui/instrument/InstrumentMidiIOView.cpp index f98f58f5a..68491d6e6 100644 --- a/src/gui/instrument/InstrumentMidiIOView.cpp +++ b/src/gui/instrument/InstrumentMidiIOView.cpp @@ -73,10 +73,10 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : midiInputLayout->addWidget( m_fixedInputVelocitySpinBox ); midiInputLayout->addStretch(); - connect( m_midiInputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), - m_inputChannelSpinBox, SLOT( setEnabled( bool ) ) ); - connect( m_midiInputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), - m_fixedInputVelocitySpinBox, SLOT( setEnabled( bool ) ) ); + connect( m_midiInputGroupBox->ledButton(), SIGNAL(toggled(bool)), + m_inputChannelSpinBox, SLOT(setEnabled(bool))); + connect( m_midiInputGroupBox->ledButton(), SIGNAL(toggled(bool)), + m_fixedInputVelocitySpinBox, SLOT(setEnabled(bool))); @@ -118,12 +118,12 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : midiOutputLayout->addWidget( m_fixedOutputNoteSpinBox ); midiOutputLayout->addStretch(); - connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), - m_fixedOutputVelocitySpinBox, SLOT( setEnabled( bool ) ) ); - connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), - m_outputProgramSpinBox, SLOT( setEnabled( bool ) ) ); - connect( m_midiOutputGroupBox->ledButton(), SIGNAL( toggled( bool ) ), - m_fixedOutputNoteSpinBox, SLOT( setEnabled( bool ) ) ); + connect( m_midiOutputGroupBox->ledButton(), SIGNAL(toggled(bool)), + m_fixedOutputVelocitySpinBox, SLOT(setEnabled(bool))); + connect( m_midiOutputGroupBox->ledButton(), SIGNAL(toggled(bool)), + m_outputProgramSpinBox, SLOT(setEnabled(bool))); + connect( m_midiOutputGroupBox->ledButton(), SIGNAL(toggled(bool)), + m_fixedOutputNoteSpinBox, SLOT(setEnabled(bool))); if( !Engine::audioEngine()->midiClient()->isRaw() ) { @@ -162,8 +162,8 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : m_baseVelocitySpinBox->setEnabled( false ); baseVelocityLayout->addWidget( m_baseVelocitySpinBox ); - connect( baseVelocityGroupBox->ledButton(), SIGNAL( toggled( bool ) ), - m_baseVelocitySpinBox, SLOT( setEnabled( bool ) ) ); + connect( baseVelocityGroupBox->ledButton(), SIGNAL(toggled(bool)), + m_baseVelocitySpinBox, SLOT(setEnabled(bool))); layout->addStretch(); } diff --git a/src/gui/instrument/InstrumentTrackWindow.cpp b/src/gui/instrument/InstrumentTrackWindow.cpp index a457acec8..cead80e7c 100644 --- a/src/gui/instrument/InstrumentTrackWindow.cpp +++ b/src/gui/instrument/InstrumentTrackWindow.cpp @@ -108,8 +108,8 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : // setup line edit for changing instrument track name m_nameLineEdit = new QLineEdit; m_nameLineEdit->setFont( pointSize<9>( m_nameLineEdit->font() ) ); - connect( m_nameLineEdit, SIGNAL( textChanged( const QString & ) ), - this, SLOT( textChanged( const QString & ) ) ); + connect( m_nameLineEdit, SIGNAL( textChanged( const QString& ) ), + this, SLOT( textChanged( const QString& ) ) ); m_nameLineEdit->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred)); nameAndChangeTrackLayout->addWidget(m_nameLineEdit, 1); @@ -117,10 +117,10 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : // set up left/right arrows for changing instrument m_leftRightNav = new LeftRightNav(this); - connect( m_leftRightNav, SIGNAL( onNavLeft() ), this, - SLOT( viewPrevInstrument() ) ); - connect( m_leftRightNav, SIGNAL( onNavRight() ), this, - SLOT( viewNextInstrument() ) ); + connect( m_leftRightNav, SIGNAL(onNavLeft()), this, + SLOT(viewPrevInstrument())); + connect( m_leftRightNav, SIGNAL(onNavRight()), this, + SLOT(viewNextInstrument())); // m_leftRightNav->setShortcuts(); nameAndChangeTrackLayout->addWidget(m_leftRightNav); @@ -221,7 +221,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : QPushButton* saveSettingsBtn = new QPushButton( embed::getIconPixmap( "project_save" ), QString() ); saveSettingsBtn->setMinimumSize( 32, 32 ); - connect( saveSettingsBtn, SIGNAL( clicked() ), this, SLOT( saveSettingsBtnClicked() ) ); + connect( saveSettingsBtn, SIGNAL(clicked()), this, SLOT(saveSettingsBtnClicked())); saveSettingsBtn->setToolTip(tr("Save current instrument track settings in a preset file")); @@ -345,13 +345,13 @@ void InstrumentTrackWindow::modelChanged() m_nameLineEdit->setText( m_track->name() ); - m_track->disconnect( SIGNAL( nameChanged() ), this ); - m_track->disconnect( SIGNAL( instrumentChanged() ), this ); + m_track->disconnect( SIGNAL(nameChanged()), this ); + m_track->disconnect( SIGNAL(instrumentChanged()), this ); - connect( m_track, SIGNAL( nameChanged() ), - this, SLOT( updateName() ) ); - connect( m_track, SIGNAL( instrumentChanged() ), - this, SLOT( updateInstrumentView() ) ); + connect( m_track, SIGNAL(nameChanged()), + this, SLOT(updateName())); + connect( m_track, SIGNAL(instrumentChanged()), + this, SLOT(updateInstrumentView())); m_volumeKnob->setModel( &m_track->m_volumeModel ); m_panningKnob->setModel( &m_track->m_panningModel ); diff --git a/src/gui/instrument/InstrumentView.cpp b/src/gui/instrument/InstrumentView.cpp index 2ca3d9329..23e758cf2 100644 --- a/src/gui/instrument/InstrumentView.cpp +++ b/src/gui/instrument/InstrumentView.cpp @@ -59,7 +59,7 @@ void InstrumentView::setModel( Model * _model, bool ) { ModelView::setModel( _model ); instrumentTrackWindow()->setWindowIcon( model()->logo()->pixmap() ); - connect( model(), SIGNAL( destroyed( QObject * ) ), this, SLOT( close() ) ); + connect( model(), SIGNAL(destroyed(QObject*)), this, SLOT(close())); } } diff --git a/src/gui/instrument/PianoView.cpp b/src/gui/instrument/PianoView.cpp index fa5594c68..b6dec8b4f 100644 --- a/src/gui/instrument/PianoView.cpp +++ b/src/gui/instrument/PianoView.cpp @@ -141,8 +141,8 @@ PianoView::PianoView(QWidget *parent) : m_pianoScroll->setValue(Octave_3 * Piano::WhiteKeysPerOctave); // and connect it to this widget - connect( m_pianoScroll, SIGNAL( valueChanged( int ) ), - this, SLOT( pianoScrolled( int ) ) ); + connect( m_pianoScroll, SIGNAL(valueChanged(int)), + this, SLOT(pianoScrolled(int))); // create a layout for ourselves QVBoxLayout * layout = new QVBoxLayout( this ); diff --git a/src/gui/menus/MidiPortMenu.cpp b/src/gui/menus/MidiPortMenu.cpp index 328efebd1..88e6a4f30 100644 --- a/src/gui/menus/MidiPortMenu.cpp +++ b/src/gui/menus/MidiPortMenu.cpp @@ -35,8 +35,8 @@ MidiPortMenu::MidiPortMenu( MidiPort::Modes _mode ) : m_mode( _mode ) { setFont( pointSize<9>( font() ) ); - connect( this, SIGNAL( triggered( QAction * ) ), - this, SLOT( activatedPort( QAction * ) ) ); + connect( this, SIGNAL(triggered(QAction*)), + this, SLOT(activatedPort(QAction*))); } @@ -54,13 +54,13 @@ void MidiPortMenu::modelChanged() MidiPort * mp = castModel(); if( m_mode == MidiPort::Input ) { - connect( mp, SIGNAL( readablePortsChanged() ), - this, SLOT( updateMenu() ) ); + connect( mp, SIGNAL(readablePortsChanged()), + this, SLOT(updateMenu())); } else if( m_mode == MidiPort::Output ) { - connect( mp, SIGNAL( writablePortsChanged() ), - this, SLOT( updateMenu() ) ); + connect( mp, SIGNAL(writablePortsChanged()), + this, SLOT(updateMenu())); } updateMenu(); } diff --git a/src/gui/menus/RecentProjectsMenu.cpp b/src/gui/menus/RecentProjectsMenu.cpp index bbbf79e86..050450dd0 100644 --- a/src/gui/menus/RecentProjectsMenu.cpp +++ b/src/gui/menus/RecentProjectsMenu.cpp @@ -19,10 +19,10 @@ RecentProjectsMenu::RecentProjectsMenu(QWidget *parent) : { setIcon(embed::getIconPixmap( "project_open_recent" )); - connect( this, SIGNAL( aboutToShow() ), - this, SLOT(fillMenu() ) ); - connect( this, SIGNAL( triggered( QAction * ) ), - this, SLOT(openProject(QAction * ) ) ); + connect( this, SIGNAL(aboutToShow()), + this, SLOT(fillMenu())); + connect( this, SIGNAL(triggered(QAction*)), + this, SLOT(openProject(QAction*))); } diff --git a/src/gui/menus/TemplatesMenu.cpp b/src/gui/menus/TemplatesMenu.cpp index 1a1ef7c84..a73c81071 100644 --- a/src/gui/menus/TemplatesMenu.cpp +++ b/src/gui/menus/TemplatesMenu.cpp @@ -18,9 +18,9 @@ TemplatesMenu::TemplatesMenu(QWidget *parent) : { setIcon(embed::getIconPixmap("project_new")); - connect( this, SIGNAL( aboutToShow() ), SLOT( fillTemplatesMenu() ) ); - connect( this, SIGNAL( triggered( QAction * ) ), - SLOT( createNewProjectFromTemplate( QAction * ) ) ); + connect( this, SIGNAL(aboutToShow()), SLOT(fillTemplatesMenu())); + connect( this, SIGNAL(triggered(QAction*)), + SLOT(createNewProjectFromTemplate(QAction*))); } diff --git a/src/gui/modals/ControllerConnectionDialog.cpp b/src/gui/modals/ControllerConnectionDialog.cpp index b8d323709..fb86328a1 100644 --- a/src/gui/modals/ControllerConnectionDialog.cpp +++ b/src/gui/modals/ControllerConnectionDialog.cpp @@ -143,8 +143,8 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, // Midi stuff m_midiGroupBox = new GroupBox( tr( "MIDI CONTROLLER" ), this ); m_midiGroupBox->setGeometry( 8, 10, 240, 80 ); - connect( m_midiGroupBox->model(), SIGNAL( dataChanged() ), - this, SLOT( midiToggled() ) ); + connect( m_midiGroupBox->model(), SIGNAL(dataChanged()), + this, SLOT(midiToggled())); m_midiChannelSpinBox = new LcdSpinBox( 2, m_midiGroupBox, tr( "Input channel" ) ); @@ -164,16 +164,16 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, m_midiGroupBox, tr("Auto Detect") ); m_midiAutoDetectCheckBox->setModel( &m_midiAutoDetect ); m_midiAutoDetectCheckBox->move( 8, 60 ); - connect( &m_midiAutoDetect, SIGNAL( dataChanged() ), - this, SLOT( autoDetectToggled() ) ); + connect( &m_midiAutoDetect, SIGNAL(dataChanged()), + this, SLOT(autoDetectToggled())); // when using with non-raw-clients we can provide buttons showing // our port-menus when being clicked if( !Engine::audioEngine()->midiClient()->isRaw() ) { m_readablePorts = new MidiPortMenu( MidiPort::Input ); - connect( m_readablePorts, SIGNAL( triggered( QAction * ) ), - this, SLOT( enableAutoDetect( QAction * ) ) ); + connect( m_readablePorts, SIGNAL(triggered(QAction*)), + this, SLOT(enableAutoDetect(QAction*))); ToolButton * rp_btn = new ToolButton( m_midiGroupBox ); rp_btn->setText( tr( "MIDI-devices to receive " "MIDI-events from" ) ); @@ -187,8 +187,8 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, // User stuff m_userGroupBox = new GroupBox( tr( "USER CONTROLLER" ), this ); m_userGroupBox->setGeometry( 8, 100, 240, 60 ); - connect( m_userGroupBox->model(), SIGNAL( dataChanged() ), - this, SLOT( userToggled() ) ); + connect( m_userGroupBox->model(), SIGNAL(dataChanged()), + this, SLOT(userToggled())); m_userController = new ComboBox( m_userGroupBox, "Controller" ); m_userController->setGeometry( 10, 24, 200, ComboBox::DEFAULT_HEIGHT ); @@ -196,10 +196,10 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, { m_userController->model()->addItem( c->name() ); } - connect( m_userController->model(), SIGNAL( dataUnchanged() ), - this, SLOT( userSelected() ) ); - connect( m_userController->model(), SIGNAL( dataChanged() ), - this, SLOT( userSelected() ) ); + connect( m_userController->model(), SIGNAL(dataUnchanged()), + this, SLOT(userSelected())); + connect( m_userController->model(), SIGNAL(dataChanged()), + this, SLOT(userSelected())); // Mapping functions @@ -222,14 +222,14 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, QPushButton * select_btn = new QPushButton( embed::getIconPixmap( "add" ), tr( "OK" ), buttons ); - connect( select_btn, SIGNAL( clicked() ), - this, SLOT( selectController() ) ); + connect( select_btn, SIGNAL(clicked()), + this, SLOT(selectController())); QPushButton * cancel_btn = new QPushButton( embed::getIconPixmap( "cancel" ), tr( "Cancel" ), buttons ); - connect( cancel_btn, SIGNAL( clicked() ), - this, SLOT( reject() ) ); + connect( cancel_btn, SIGNAL(clicked()), + this, SLOT(reject())); btn_layout->addStretch(); btn_layout->addSpacing( 10 ); @@ -376,7 +376,7 @@ void ControllerConnectionDialog::midiToggled() m_readablePorts->setModel( &m_midiController->m_midiPort ); } - connect( m_midiController, SIGNAL( valueChanged() ), this, SLOT( midiValueChanged() ) ); + connect( m_midiController, SIGNAL(valueChanged()), this, SLOT(midiValueChanged())); } } m_midiAutoDetect.setValue( enabled ); diff --git a/src/gui/modals/EffectSelectDialog.cpp b/src/gui/modals/EffectSelectDialog.cpp index 22f094827..2b5c0c58d 100644 --- a/src/gui/modals/EffectSelectDialog.cpp +++ b/src/gui/modals/EffectSelectDialog.cpp @@ -98,27 +98,27 @@ EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) : m_model.setSourceModel( &m_sourceModel ); m_model.setFilterCaseSensitivity( Qt::CaseInsensitive ); - connect( ui->filterEdit, SIGNAL( textChanged( const QString & ) ), - &m_model, SLOT( setFilterFixedString( const QString & ) ) ); - connect( ui->filterEdit, SIGNAL( textChanged( const QString & ) ), - this, SLOT( updateSelection() ) ); - connect( ui->filterEdit, SIGNAL( textChanged( const QString & ) ), - SLOT( sortAgain() ) ); + connect( ui->filterEdit, SIGNAL( textChanged( const QString& ) ), + &m_model, SLOT( setFilterFixedString( const QString& ) ) ); + connect( ui->filterEdit, SIGNAL( textChanged( const QString& ) ), + this, SLOT(updateSelection())); + connect( ui->filterEdit, SIGNAL( textChanged( const QString& ) ), + SLOT(sortAgain())); ui->pluginList->setModel( &m_model ); // setup selection model QItemSelectionModel * selectionModel = new QItemSelectionModel( &m_model ); ui->pluginList->setSelectionModel( selectionModel ); - connect( selectionModel, SIGNAL( currentRowChanged( const QModelIndex &, + connect( selectionModel, SIGNAL( currentRowChanged( const QModelIndex&, const QModelIndex & ) ), - SLOT( rowChanged( const QModelIndex &, const QModelIndex & ) ) ); - connect( ui->pluginList, SIGNAL( doubleClicked( const QModelIndex & ) ), - SLOT( acceptSelection() ) ); + SLOT( rowChanged( const QModelIndex &, const QModelIndex& ) ) ); + connect( ui->pluginList, SIGNAL( doubleClicked( const QModelIndex& ) ), + SLOT(acceptSelection())); // try to accept current selection when pressing "OK" - connect( ui->buttonBox, SIGNAL( accepted() ), - this, SLOT( acceptSelection() ) ); + connect( ui->buttonBox, SIGNAL(accepted()), + this, SLOT(acceptSelection())); ui->filterEdit->setClearButtonEnabled( true ); ui->pluginList->verticalHeader()->setSectionResizeMode( diff --git a/src/gui/modals/ExportProjectDialog.cpp b/src/gui/modals/ExportProjectDialog.cpp index fc9113b3f..7671e031e 100644 --- a/src/gui/modals/ExportProjectDialog.cpp +++ b/src/gui/modals/ExportProjectDialog.cpp @@ -98,8 +98,8 @@ ExportProjectDialog::ExportProjectDialog( const QString & _file_name, compressionWidget->setVisible(false); #endif - connect( startButton, SIGNAL( clicked() ), - this, SLOT( startBtnClicked() ) ); + connect( startButton, SIGNAL(clicked()), + this, SLOT(startBtnClicked())); } @@ -190,14 +190,14 @@ void ExportProjectDialog::startExport() Engine::getSong()->setRenderBetweenMarkers( renderMarkersCB->isChecked() ); Engine::getSong()->setLoopRenderCount(loopCountSB->value()); - connect( m_renderManager.get(), SIGNAL( progressChanged( int ) ), - progressBar, SLOT( setValue( int ) ) ); - connect( m_renderManager.get(), SIGNAL( progressChanged( int ) ), - this, SLOT( updateTitleBar( int ) )); - connect( m_renderManager.get(), SIGNAL( finished() ), - this, SLOT( accept() ) ) ; - connect( m_renderManager.get(), SIGNAL( finished() ), - getGUI()->mainWindow(), SLOT( resetWindowTitle() ) ); + connect( m_renderManager.get(), SIGNAL(progressChanged(int)), + progressBar, SLOT(setValue(int))); + connect( m_renderManager.get(), SIGNAL(progressChanged(int)), + this, SLOT(updateTitleBar(int))); + connect( m_renderManager.get(), SIGNAL(finished()), + this, SLOT(accept())) ; + connect( m_renderManager.get(), SIGNAL(finished()), + getGUI()->mainWindow(), SLOT(resetWindowTitle())); if ( m_multiExport ) { diff --git a/src/gui/modals/RenameDialog.cpp b/src/gui/modals/RenameDialog.cpp index 76ae9d6bb..0028cd1a0 100644 --- a/src/gui/modals/RenameDialog.cpp +++ b/src/gui/modals/RenameDialog.cpp @@ -43,10 +43,10 @@ RenameDialog::RenameDialog( QString & _string ) : m_stringLE->setText( _string ); m_stringLE->setGeometry ( 10, 5, 220, 20 ); m_stringLE->selectAll(); - connect( m_stringLE, SIGNAL( textChanged( const QString & ) ), this, - SLOT( textChanged( const QString & ) ) ); - connect( m_stringLE, SIGNAL( returnPressed() ), this, - SLOT( accept() ) ); + connect( m_stringLE, SIGNAL( textChanged( const QString& ) ), this, + SLOT( textChanged( const QString& ) ) ); + connect( m_stringLE, SIGNAL(returnPressed()), this, + SLOT(accept())); } diff --git a/src/gui/modals/SetupDialog.cpp b/src/gui/modals/SetupDialog.cpp index 33cecedad..9c15f5b53 100644 --- a/src/gui/modals/SetupDialog.cpp +++ b/src/gui/modals/SetupDialog.cpp @@ -545,8 +545,8 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : setCurrentIndex(m_audioInterfaces->findText(audioDevName)); m_audioIfaceSetupWidgets[audioDevName]->show(); - connect(m_audioInterfaces, SIGNAL(activated(const QString &)), - this, SLOT(audioInterfaceChanged(const QString &))); + connect(m_audioInterfaces, SIGNAL(activated(const QString&)), + this, SLOT(audioInterfaceChanged(const QString&))); // Advanced setting, hidden for now if(false) @@ -689,8 +689,8 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : m_midiInterfaces->setCurrentIndex(m_midiInterfaces->findText(midiDevName)); m_midiIfaceSetupWidgets[midiDevName]->show(); - connect(m_midiInterfaces, SIGNAL(activated(const QString &)), - this, SLOT(midiInterfaceChanged(const QString &))); + connect(m_midiInterfaces, SIGNAL(activated(const QString&)), + this, SLOT(midiInterfaceChanged(const QString&))); // MIDI autoassign tab. @@ -761,7 +761,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : lineEdit = new QLineEdit(content, newTw); lineEdit->setGeometry(10, 20, txtLength, 16); - connect(lineEdit, SIGNAL(textChanged(const QString &)), + connect(lineEdit, SIGNAL(textChanged(const QString&)), this, setSlot); QPushButton * selectBtn = new QPushButton( @@ -776,37 +776,37 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : }; addPathEntry(tr("LMMS working directory"), m_workingDir, - SLOT(setWorkingDir(const QString &)), + SLOT(setWorkingDir(const QString&)), SLOT(openWorkingDir()), m_workingDirLineEdit); addPathEntry(tr("VST plugins directory"), m_vstDir, - SLOT(setVSTDir(const QString &)), + SLOT(setVSTDir(const QString&)), SLOT(openVSTDir()), m_vstDirLineEdit); addPathEntry(tr("LADSPA plugins directories"), m_ladspaDir, - SLOT(setLADSPADir(const QString &)), + SLOT(setLADSPADir(const QString&)), SLOT(openLADSPADir()), m_ladspaDirLineEdit, "add_folder"); addPathEntry(tr("SF2 directory"), m_sf2Dir, - SLOT(setSF2Dir(const QString &)), + SLOT(setSF2Dir(const QString&)), SLOT(openSF2Dir()), m_sf2DirLineEdit); #ifdef LMMS_HAVE_FLUIDSYNTH addPathEntry(tr("Default SF2"), m_sf2File, - SLOT(setSF2File(const QString &)), + SLOT(setSF2File(const QString&)), SLOT(openSF2File()), m_sf2FileLineEdit); #endif addPathEntry(tr("GIG directory"), m_gigDir, - SLOT(setGIGDir(const QString &)), + SLOT(setGIGDir(const QString&)), SLOT(openGIGDir()), m_gigDirLineEdit); addPathEntry(tr("Theme directory"), m_themeDir, - SLOT(setThemeDir(const QString &)), + SLOT(setThemeDir(const QString&)), SLOT(openThemeDir()), m_themeDirLineEdit); addPathEntry(tr("Background artwork"), m_backgroundPicFile, - SLOT(setBackgroundPicFile(const QString &)), + SLOT(setBackgroundPicFile(const QString&)), SLOT(openBackgroundPicFile()), m_backgroundPicFileLineEdit); diff --git a/src/gui/modals/VersionedSaveDialog.cpp b/src/gui/modals/VersionedSaveDialog.cpp index 06a576ea9..d93bd948c 100644 --- a/src/gui/modals/VersionedSaveDialog.cpp +++ b/src/gui/modals/VersionedSaveDialog.cpp @@ -80,8 +80,8 @@ VersionedSaveDialog::VersionedSaveDialog( QWidget *parent, } // Connect + and - buttons - connect( plusButton, SIGNAL( clicked() ), this, SLOT( incrementVersion() )); - connect( minusButton, SIGNAL( clicked() ), this, SLOT( decrementVersion() )); + connect( plusButton, SIGNAL(clicked()), this, SLOT(incrementVersion())); + connect( minusButton, SIGNAL(clicked()), this, SLOT(decrementVersion())); } diff --git a/src/gui/tracks/InstrumentTrackView.cpp b/src/gui/tracks/InstrumentTrackView.cpp index 4c16287ed..5d01c8ae0 100644 --- a/src/gui/tracks/InstrumentTrackView.cpp +++ b/src/gui/tracks/InstrumentTrackView.cpp @@ -66,14 +66,14 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV m_tlb->move( 3, 1 ); m_tlb->show(); - connect( m_tlb, SIGNAL( toggled( bool ) ), - this, SLOT( toggleInstrumentWindow( bool ) ) ); + connect( m_tlb, SIGNAL(toggled(bool)), + this, SLOT(toggleInstrumentWindow(bool))); - connect( _it, SIGNAL( nameChanged() ), - m_tlb, SLOT( update() ) ); + connect( _it, SIGNAL(nameChanged()), + m_tlb, SLOT(update())); - connect(ConfigManager::inst(), SIGNAL(valueChanged(QString, QString, QString)), - this, SLOT(handleConfigChange(QString, QString, QString))); + connect(ConfigManager::inst(), SIGNAL(valueChanged(QString,QString,QString)), + this, SLOT(handleConfigChange(QString,QString,QString))); // creation of widgets for track-settings-widget int widgetWidth; @@ -128,12 +128,12 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV m_midiOutputAction = m_midiMenu->addAction( "" ); m_midiInputAction->setCheckable( true ); m_midiOutputAction->setCheckable( true ); - connect( m_midiInputAction, SIGNAL( changed() ), this, - SLOT( midiInSelected() ) ); - connect( m_midiOutputAction, SIGNAL( changed() ), this, - SLOT( midiOutSelected() ) ); - connect( &_it->m_midiPort, SIGNAL( modeChanged() ), - this, SLOT( midiConfigChanged() ) ); + connect( m_midiInputAction, SIGNAL(changed()), this, + SLOT(midiInSelected())); + connect( m_midiOutputAction, SIGNAL(changed()), this, + SLOT(midiOutSelected())); + connect( &_it->m_midiPort, SIGNAL(modeChanged()), + this, SLOT(midiConfigChanged())); } m_midiInputAction->setText( tr( "Input" ) ); @@ -154,14 +154,14 @@ InstrumentTrackView::InstrumentTrackView( InstrumentTrack * _it, TrackContainerV m_activityIndicator->setGeometry( widgetWidth-2*24-11, 2, 8, 28 ); m_activityIndicator->show(); - connect( m_activityIndicator, SIGNAL( pressed() ), - this, SLOT( activityIndicatorPressed() ) ); - connect( m_activityIndicator, SIGNAL( released() ), - this, SLOT( activityIndicatorReleased() ) ); - connect( _it, SIGNAL( newNote() ), - m_activityIndicator, SLOT( activate() ) ); - connect( _it, SIGNAL( endNote() ), - m_activityIndicator, SLOT( noteEnd() ) ); + connect( m_activityIndicator, SIGNAL(pressed()), + this, SLOT(activityIndicatorPressed())); + connect( m_activityIndicator, SIGNAL(released()), + this, SLOT(activityIndicatorReleased())); + connect( _it, SIGNAL(newNote()), + m_activityIndicator, SLOT(activate())); + connect( _it, SIGNAL(endNote()), + m_activityIndicator, SLOT(noteEnd())); setModel( _it ); } @@ -368,7 +368,7 @@ QMenu * InstrumentTrackView::createMixerMenu(QString title, QString newMixerLabe QMenu *mixerMenu = new QMenu( title ); - mixerMenu->addAction( newMixerLabel, this, SLOT( createMixerLine() ) ); + mixerMenu->addAction( newMixerLabel, this, SLOT(createMixerLine())); mixerMenu->addSeparator(); for (int i = 0; i < Engine::mixer()->numChannels(); ++i) diff --git a/src/gui/tracks/PatternTrackView.cpp b/src/gui/tracks/PatternTrackView.cpp index 41195f5db..be039ba79 100644 --- a/src/gui/tracks/PatternTrackView.cpp +++ b/src/gui/tracks/PatternTrackView.cpp @@ -46,8 +46,8 @@ PatternTrackView::PatternTrackView(PatternTrack* pt, TrackContainerView* tcv) : m_trackLabel->setIcon( embed::getIconPixmap("pattern_track")); m_trackLabel->move( 3, 1 ); m_trackLabel->show(); - connect( m_trackLabel, SIGNAL( clicked( bool ) ), - this, SLOT( clickedTrackLabel() ) ); + connect( m_trackLabel, SIGNAL(clicked(bool)), + this, SLOT(clickedTrackLabel())); setModel(pt); } diff --git a/src/gui/tracks/SampleTrackView.cpp b/src/gui/tracks/SampleTrackView.cpp index 9897b3309..83331ad1e 100644 --- a/src/gui/tracks/SampleTrackView.cpp +++ b/src/gui/tracks/SampleTrackView.cpp @@ -53,7 +53,7 @@ SampleTrackView::SampleTrackView( SampleTrack * _t, TrackContainerView* tcv ) : m_tlb = new TrackLabelButton(this, getTrackSettingsWidget()); m_tlb->setCheckable(true); - connect(m_tlb, SIGNAL(clicked( bool )), + connect(m_tlb, SIGNAL(clicked(bool)), this, SLOT(showEffects())); m_tlb->setIcon(embed::getIconPixmap("sample_track")); m_tlb->move(3, 1); diff --git a/src/gui/tracks/TrackContentWidget.cpp b/src/gui/tracks/TrackContentWidget.cpp index 03e7487a6..5e6344ec4 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 lmms::TimePos & ) ), - this, SLOT( changePosition( const lmms::TimePos & ) ) ); + SIGNAL( positionChanged( const lmms::TimePos& ) ), + this, SLOT( changePosition( const lmms::TimePos& ) ) ); setStyle( QApplication::style() ); diff --git a/src/gui/tracks/TrackLabelButton.cpp b/src/gui/tracks/TrackLabelButton.cpp index 6f3d13727..77e678617 100644 --- a/src/gui/tracks/TrackLabelButton.cpp +++ b/src/gui/tracks/TrackLabelButton.cpp @@ -62,12 +62,12 @@ TrackLabelButton::TrackLabelButton( TrackView * _tv, QWidget * _parent ) : setFixedSize( 160, 29 ); m_renameLineEdit->move( 30, ( height() / 2 ) - ( m_renameLineEdit->sizeHint().height() / 2 ) ); m_renameLineEdit->setFixedWidth( width() - 33 ); - connect( m_renameLineEdit, SIGNAL( editingFinished() ), this, SLOT( renameFinished() ) ); + connect( m_renameLineEdit, SIGNAL(editingFinished()), this, SLOT(renameFinished())); } setIconSize( QSize( 24, 24 ) ); - connect( m_trackView->getTrack(), SIGNAL( dataChanged() ), this, SLOT( update() ) ); - connect( m_trackView->getTrack(), SIGNAL( nameChanged() ), this, SLOT( nameChanged() ) ); + connect( m_trackView->getTrack(), SIGNAL(dataChanged()), this, SLOT(update())); + connect( m_trackView->getTrack(), SIGNAL(nameChanged()), this, SLOT(nameChanged())); } diff --git a/src/gui/tracks/TrackOperationsWidget.cpp b/src/gui/tracks/TrackOperationsWidget.cpp index 2670f891d..bef6ddcbf 100644 --- a/src/gui/tracks/TrackOperationsWidget.cpp +++ b/src/gui/tracks/TrackOperationsWidget.cpp @@ -65,7 +65,7 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : QMenu * toMenu = new QMenu( this ); toMenu->setFont( pointSize<9>( toMenu->font() ) ); - connect( toMenu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); + connect( toMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu())); setObjectName( "automationEnabled" ); @@ -106,13 +106,13 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : m_soloBtn->show(); m_soloBtn->setToolTip(tr("Solo")); - connect( this, SIGNAL( trackRemovalScheduled( lmms::gui::TrackView * ) ), + connect( this, SIGNAL(trackRemovalScheduled(lmms::gui::TrackView*)), m_trackView->trackContainerView(), - SLOT( deleteTrackView( lmms::gui::TrackView * ) ), + SLOT(deleteTrackView(lmms::gui::TrackView*)), Qt::QueuedConnection ); - connect( m_trackView->getTrack()->getMutedModel(), SIGNAL( dataChanged() ), - this, SLOT( update() ) ); + connect( m_trackView->getTrack()->getMutedModel(), SIGNAL(dataChanged()), + this, SLOT(update())); connect(m_trackView->getTrack(), SIGNAL(colorChanged()), this, SLOT(update())); } @@ -330,14 +330,14 @@ void TrackOperationsWidget::updateMenu() toMenu->clear(); toMenu->addAction( embed::getIconPixmap( "edit_copy", 16, 16 ), tr( "Clone this track" ), - this, SLOT( cloneTrack() ) ); + this, SLOT(cloneTrack())); toMenu->addAction( embed::getIconPixmap( "cancel", 16, 16 ), tr( "Remove this track" ), - this, SLOT( removeTrack() ) ); + this, SLOT(removeTrack())); if( ! m_trackView->trackContainerView()->fixedClips() ) { - toMenu->addAction( tr( "Clear this track" ), this, SLOT( clearTrack() ) ); + toMenu->addAction( tr( "Clear this track" ), this, SLOT(clearTrack())); } if (QMenu *mixerMenu = m_trackView->createMixerMenu(tr("Channel %1: %2"), tr("Assign to new Mixer Channel"))) { @@ -351,8 +351,8 @@ void TrackOperationsWidget::updateMenu() } if( dynamic_cast( m_trackView ) ) { - toMenu->addAction( tr( "Turn all recording on" ), this, SLOT( recordingOn() ) ); - toMenu->addAction( tr( "Turn all recording off" ), this, SLOT( recordingOff() ) ); + toMenu->addAction( tr( "Turn all recording on" ), this, SLOT(recordingOn())); + toMenu->addAction( tr( "Turn all recording off" ), this, SLOT(recordingOff())); } toMenu->addSeparator(); diff --git a/src/gui/tracks/TrackView.cpp b/src/gui/tracks/TrackView.cpp index 61d598f6e..2065b0b53 100644 --- a/src/gui/tracks/TrackView.cpp +++ b/src/gui/tracks/TrackView.cpp @@ -88,20 +88,20 @@ TrackView::TrackView( Track * track, TrackContainerView * tcv ) : setAttribute( Qt::WA_DeleteOnClose, true ); - connect( m_track, SIGNAL( destroyedTrack() ), this, SLOT( close() ) ); + connect( m_track, SIGNAL(destroyedTrack()), this, SLOT(close())); connect( m_track, - SIGNAL( clipAdded( lmms::Clip * ) ), - this, SLOT( createClipView( lmms::Clip * ) ), + SIGNAL(clipAdded(lmms::Clip*)), + this, SLOT(createClipView(lmms::Clip*)), Qt::QueuedConnection ); - connect( &m_track->m_mutedModel, SIGNAL( dataChanged() ), - &m_trackContentWidget, SLOT( update() ) ); + connect( &m_track->m_mutedModel, SIGNAL(dataChanged()), + &m_trackContentWidget, SLOT(update())); connect(&m_track->m_mutedModel, SIGNAL(dataChanged()), this, SLOT(muteChanged())); - connect( &m_track->m_soloModel, SIGNAL( dataChanged() ), - m_track, SLOT( toggleSolo() ), Qt::DirectConnection ); + connect( &m_track->m_soloModel, SIGNAL(dataChanged()), + m_track, SLOT(toggleSolo()), Qt::DirectConnection ); // create views for already existing clips for( Track::clipVector::iterator it = m_track->m_clips.begin(); it != m_track->m_clips.end(); ++it ) @@ -196,7 +196,7 @@ void TrackView::modelChanged() { m_track = castModel(); Q_ASSERT( m_track != nullptr ); - connect( m_track, SIGNAL( destroyedTrack() ), this, SLOT( close() ) ); + connect( m_track, SIGNAL(destroyedTrack()), this, SLOT(close())); m_trackOperationsWidget.m_muteBtn->setModel( &m_track->m_mutedModel ); m_trackOperationsWidget.m_soloBtn->setModel( &m_track->m_soloModel ); ModelView::modelChanged(); diff --git a/src/gui/widgets/AutomatableButton.cpp b/src/gui/widgets/AutomatableButton.cpp index 29af4af86..49602a24f 100644 --- a/src/gui/widgets/AutomatableButton.cpp +++ b/src/gui/widgets/AutomatableButton.cpp @@ -246,8 +246,8 @@ void automatableButtonGroup::activateButton( AutomatableButton * _btn ) void automatableButtonGroup::modelChanged() { - connect( model(), SIGNAL( dataChanged() ), - this, SLOT( updateButtons() ) ); + connect( model(), SIGNAL(dataChanged()), + this, SLOT(updateButtons())); IntModelView::modelChanged(); updateButtons(); } diff --git a/src/gui/widgets/AutomatableSlider.cpp b/src/gui/widgets/AutomatableSlider.cpp index b7af54b32..13cd9771f 100644 --- a/src/gui/widgets/AutomatableSlider.cpp +++ b/src/gui/widgets/AutomatableSlider.cpp @@ -42,10 +42,10 @@ AutomatableSlider::AutomatableSlider( QWidget * _parent, { setWindowTitle( _name ); - connect( this, SIGNAL( valueChanged( int ) ), - this, SLOT( changeValue( int ) ) ); - connect( this, SIGNAL( sliderMoved( int ) ), - this, SLOT( moveSlider( int ) ) ); + connect( this, SIGNAL(valueChanged(int)), + this, SLOT(changeValue(int))); + connect( this, SIGNAL(sliderMoved(int)), + this, SLOT(moveSlider(int))); } @@ -109,8 +109,8 @@ void AutomatableSlider::modelChanged() { QSlider::setRange( model()->minValue(), model()->maxValue() ); updateSlider(); - connect( model(), SIGNAL( dataChanged() ), - this, SLOT( updateSlider() ) ); + connect( model(), SIGNAL(dataChanged()), + this, SLOT(updateSlider())); } diff --git a/src/gui/widgets/CPULoadWidget.cpp b/src/gui/widgets/CPULoadWidget.cpp index 01c36994e..3f465d347 100644 --- a/src/gui/widgets/CPULoadWidget.cpp +++ b/src/gui/widgets/CPULoadWidget.cpp @@ -51,8 +51,8 @@ CPULoadWidget::CPULoadWidget( QWidget * _parent ) : m_temp = QPixmap( width(), height() ); - connect( &m_updateTimer, SIGNAL( timeout() ), - this, SLOT( updateCpuLoad() ) ); + connect( &m_updateTimer, SIGNAL(timeout()), + this, SLOT(updateCpuLoad())); m_updateTimer.start( 100 ); // update cpu-load at 10 fps } diff --git a/src/gui/widgets/ComboBox.cpp b/src/gui/widgets/ComboBox.cpp index ab6b29b9d..7b6121b23 100644 --- a/src/gui/widgets/ComboBox.cpp +++ b/src/gui/widgets/ComboBox.cpp @@ -72,8 +72,8 @@ ComboBox::ComboBox( QWidget * _parent, const QString & _name ) : setFont( pointSize<9>( font() ) ); m_menu.setFont( pointSize<8>( m_menu.font() ) ); - connect( &m_menu, SIGNAL( triggered( QAction * ) ), - this, SLOT( setItem( QAction * ) ) ); + connect( &m_menu, SIGNAL(triggered(QAction*)), + this, SLOT(setItem(QAction*))); setWindowTitle( _name ); doConnections(); diff --git a/src/gui/widgets/Graph.cpp b/src/gui/widgets/Graph.cpp index f5639ff70..63d295ad1 100644 --- a/src/gui/widgets/Graph.cpp +++ b/src/gui/widgets/Graph.cpp @@ -52,11 +52,11 @@ Graph::Graph( QWidget * _parent, graphStyle _style, int _width, graphModel * gModel = castModel(); - QObject::connect( gModel, SIGNAL( samplesChanged( int, int ) ), - this, SLOT( updateGraph( int, int ) ) ); + QObject::connect( gModel, SIGNAL(samplesChanged(int,int)), + this, SLOT(updateGraph(int,int))); - QObject::connect( gModel, SIGNAL( lengthChanged() ), - this, SLOT( updateGraph() ) ); + QObject::connect( gModel, SIGNAL(lengthChanged()), + this, SLOT(updateGraph())); } void Graph::setForeground( const QPixmap &_pixmap ) @@ -435,11 +435,11 @@ void Graph::modelChanged() { graphModel * gModel = castModel(); - QObject::connect( gModel, SIGNAL( samplesChanged( int, int ) ), - this, SLOT( updateGraph( int, int ) ) ); + QObject::connect( gModel, SIGNAL(samplesChanged(int,int)), + this, SLOT(updateGraph(int,int))); - QObject::connect( gModel, SIGNAL( lengthChanged() ), - this, SLOT( updateGraph() ) ); + QObject::connect( gModel, SIGNAL(lengthChanged()), + this, SLOT(updateGraph())); } diff --git a/src/gui/widgets/Knob.cpp b/src/gui/widgets/Knob.cpp index f6a1163a7..5a3d220ed 100644 --- a/src/gui/widgets/Knob.cpp +++ b/src/gui/widgets/Knob.cpp @@ -515,7 +515,7 @@ void Knob::contextMenuEvent( QContextMenuEvent * ) addDefaultActions( &contextMenu ); contextMenu.addAction( QPixmap(), model()->isScaleLogarithmic() ? tr( "Set linear" ) : tr( "Set logarithmic" ), - this, SLOT( toggleScale() ) ); + this, SLOT(toggleScale())); contextMenu.addSeparator(); contextMenu.exec( QCursor::pos() ); } @@ -829,11 +829,11 @@ void Knob::doConnections() { if( model() != nullptr ) { - QObject::connect( model(), SIGNAL( dataChanged() ), - this, SLOT( friendlyUpdate() ) ); + QObject::connect( model(), SIGNAL(dataChanged()), + this, SLOT(friendlyUpdate())); - QObject::connect( model(), SIGNAL( propertiesChanged() ), - this, SLOT( update() ) ); + QObject::connect( model(), SIGNAL(propertiesChanged()), + this, SLOT(update())); } } diff --git a/src/gui/widgets/Oscilloscope.cpp b/src/gui/widgets/Oscilloscope.cpp index cd028f637..bec45c162 100644 --- a/src/gui/widgets/Oscilloscope.cpp +++ b/src/gui/widgets/Oscilloscope.cpp @@ -91,17 +91,17 @@ void Oscilloscope::setActive( bool _active ) if( m_active ) { connect( getGUI()->mainWindow(), - SIGNAL( periodicUpdate() ), - this, SLOT( update() ) ); + SIGNAL(periodicUpdate()), + this, SLOT(update())); connect( Engine::audioEngine(), - SIGNAL( nextAudioBuffer( const lmms::surroundSampleFrame* ) ), - this, SLOT( updateAudioBuffer( const lmms::surroundSampleFrame* ) ) ); + SIGNAL(nextAudioBuffer(const lmms::surroundSampleFrame*)), + this, SLOT(updateAudioBuffer(const lmms::surroundSampleFrame*)) ); } else { disconnect( getGUI()->mainWindow(), - SIGNAL( periodicUpdate() ), - this, SLOT( update() ) ); + SIGNAL(periodicUpdate()), + this, SLOT(update())); disconnect( Engine::audioEngine(), SIGNAL( nextAudioBuffer( const lmms::surroundSampleFrame* ) ), this, SLOT( updateAudioBuffer( const lmms::surroundSampleFrame* ) ) ); diff --git a/src/gui/widgets/TabBar.cpp b/src/gui/widgets/TabBar.cpp index 007f78194..ccb879db6 100644 --- a/src/gui/widgets/TabBar.cpp +++ b/src/gui/widgets/TabBar.cpp @@ -55,7 +55,7 @@ TabButton * TabBar::addTab( QWidget * _w, const QString & _text, int _id, QString caption = ( _text_is_tooltip ) ? QString( "" ) : _text; // create tab-button TabButton * b = new TabButton( caption, _id, this ); - connect( b, SIGNAL( clicked( int ) ), this, SLOT( tabClicked( int ) ) ); + connect( b, SIGNAL(clicked(int)), this, SLOT(tabClicked(int))); b->setIconSize( QSize( 48, 48 ) ); b->setFixedSize( 64, 64 ); b->show(); diff --git a/src/gui/widgets/TempoSyncKnob.cpp b/src/gui/widgets/TempoSyncKnob.cpp index 47da424d4..86ee6df3c 100644 --- a/src/gui/widgets/TempoSyncKnob.cpp +++ b/src/gui/widgets/TempoSyncKnob.cpp @@ -75,10 +75,10 @@ void TempoSyncKnob::modelChanged() { m_custom->setModel( &model()->m_custom ); } - connect( model(), SIGNAL( syncModeChanged( lmms::TempoSyncKnobModel::TempoSyncMode ) ), - this, SLOT( updateDescAndIcon() ) ); - connect( this, SIGNAL( sliderMoved( float ) ), - model(), SLOT( disableSync() ) ); + connect( model(), SIGNAL(syncModeChanged(lmms::TempoSyncKnobModel::TempoSyncMode)), + this, SLOT(updateDescAndIcon())); + connect( this, SIGNAL(sliderMoved(float)), + model(), SLOT(disableSync())); updateDescAndIcon(); } @@ -101,8 +101,8 @@ void TempoSyncKnob::contextMenuEvent( QContextMenuEvent * ) if( limit / 8.0f <= model()->maxValue() ) { - connect( syncMenu, SIGNAL( triggered( QAction * ) ), - model(), SLOT( setTempoSync( QAction * ) ) ); + connect( syncMenu, SIGNAL(triggered(QAction*)), + model(), SLOT(setTempoSync(QAction*))); syncMenu->addAction( embed::getIconPixmap( "note_none" ), tr( "No Sync" ) )->setData( (int) TempoSyncKnobModel::SyncNone ); if( limit / 0.125f <= model()->maxValue() ) @@ -146,7 +146,7 @@ void TempoSyncKnob::contextMenuEvent( QContextMenuEvent * ) (int) TempoSyncKnobModel::SyncThirtysecondNote ); syncMenu->addAction( embed::getIconPixmap( "dont_know" ), tr( "Custom..." ), - this, SLOT( showCustom() ) + this, SLOT(showCustom()) )->setData( (int) TempoSyncKnobModel::SyncCustom ); contextMenu.addSeparator(); diff --git a/src/gui/widgets/TextFloat.cpp b/src/gui/widgets/TextFloat.cpp index a43c91c80..6b9871d3e 100644 --- a/src/gui/widgets/TextFloat.cpp +++ b/src/gui/widgets/TextFloat.cpp @@ -81,7 +81,7 @@ void TextFloat::setPixmap( const QPixmap & _pixmap ) void TextFloat::setVisibilityTimeOut( int _msecs ) { - QTimer::singleShot( _msecs, this, SLOT( hide() ) ); + QTimer::singleShot( _msecs, this, SLOT(hide())); show(); } @@ -106,7 +106,7 @@ TextFloat * TextFloat::displayMessage( const QString & _msg, int _timeout, if( _timeout > 0 ) { tf->setAttribute( Qt::WA_DeleteOnClose, true ); - QTimer::singleShot( _timeout, tf, SLOT( close() ) ); + QTimer::singleShot( _timeout, tf, SLOT(close())); } return( tf ); } diff --git a/src/gui/widgets/TimeDisplayWidget.cpp b/src/gui/widgets/TimeDisplayWidget.cpp index c2cd11b1b..cefa0fa8f 100644 --- a/src/gui/widgets/TimeDisplayWidget.cpp +++ b/src/gui/widgets/TimeDisplayWidget.cpp @@ -55,8 +55,8 @@ TimeDisplayWidget::TimeDisplayWidget() : // update labels of LCD spinboxes setDisplayMode( m_displayMode ); - connect( getGUI()->mainWindow(), SIGNAL( periodicUpdate() ), - this, SLOT( updateTime() ) ); + connect( getGUI()->mainWindow(), SIGNAL(periodicUpdate()), + this, SLOT(updateTime())); } void TimeDisplayWidget::setDisplayMode( DisplayMode displayMode ) diff --git a/src/gui/widgets/ToolButton.cpp b/src/gui/widgets/ToolButton.cpp index 4feb038f0..366fd21f2 100644 --- a/src/gui/widgets/ToolButton.cpp +++ b/src/gui/widgets/ToolButton.cpp @@ -38,7 +38,7 @@ ToolButton::ToolButton( const QPixmap & _pixmap, const QString & _tooltip, if( _receiver != nullptr && _slot != nullptr ) { - connect( this, SIGNAL( clicked() ), _receiver, _slot ); + connect( this, SIGNAL(clicked()), _receiver, _slot ); } setToolTip(_tooltip); setIcon( _pixmap ); diff --git a/src/tracks/MidiClip.cpp b/src/tracks/MidiClip.cpp index ef693ba5b..5b017a7f9 100644 --- a/src/tracks/MidiClip.cpp +++ b/src/tracks/MidiClip.cpp @@ -132,8 +132,8 @@ void MidiClip::resizeToFirstTrack() void MidiClip::init() { - connect( Engine::getSong(), SIGNAL( timeSignatureChanged( int, int ) ), - this, SLOT( changeTimeSignature() ) ); + connect( Engine::getSong(), SIGNAL(timeSignatureChanged(int,int)), + this, SLOT(changeTimeSignature())); saveJournallingState( false ); updateLength(); diff --git a/src/tracks/PatternTrack.cpp b/src/tracks/PatternTrack.cpp index df7766c57..851db7f6c 100644 --- a/src/tracks/PatternTrack.cpp +++ b/src/tracks/PatternTrack.cpp @@ -51,7 +51,7 @@ PatternTrack::PatternTrack(TrackContainer* tc) : Engine::patternStore()->setCurrentPattern(patternNum); Engine::patternStore()->updateComboBox(); - connect( this, SIGNAL( nameChanged() ), + connect( this, SIGNAL(nameChanged()), Engine::patternStore(), SLOT(updateComboBox())); } From c5cdab2601dd53f45c47e11ddd0f5eb5748b8ad5 Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Fri, 24 Jun 2022 19:38:44 +0200 Subject: [PATCH 08/55] clang-tidy: Apply modernize-use-bool-literals (#6448) ... and remove never-executed code: This removes a condition that was always true and two statements guarded by conditions that were always false. --- plugins/LadspaEffect/caps/Amp.cc | 7 ++----- plugins/LadspaEffect/caps/dsp/Delay.h | 3 --- plugins/MidiImport/MidiImport.cpp | 2 +- plugins/ZynAddSubFx/LocalZynAddSubFx.cpp | 2 +- src/core/audio/AudioOss.cpp | 2 +- 5 files changed, 5 insertions(+), 11 deletions(-) diff --git a/plugins/LadspaEffect/caps/Amp.cc b/plugins/LadspaEffect/caps/Amp.cc index 8bf49fd53..74bde2b75 100644 --- a/plugins/LadspaEffect/caps/Amp.cc +++ b/plugins/LadspaEffect/caps/Amp.cc @@ -388,9 +388,7 @@ AmpV::one_cycle (int frames) v = v * v * .06 + .46; a = filter[0].process (a + normal); - if (0) - a = filter[2].process (a); - + a = g * (a + supply * .001); a = v * tube.transfer_clip (up.upsample (a)); @@ -399,8 +397,7 @@ AmpV::one_cycle (int frames) a = down.process (a); a = filter[1].process (a - normal); - if (1) - a = filter[2].process (a + normal); + a = filter[2].process (a + normal); { for (int o = 1; o < OVERSAMPLE; ++o) diff --git a/plugins/LadspaEffect/caps/dsp/Delay.h b/plugins/LadspaEffect/caps/dsp/Delay.h index ab18d894c..29b03fd78 100644 --- a/plugins/LadspaEffect/caps/dsp/Delay.h +++ b/plugins/LadspaEffect/caps/dsp/Delay.h @@ -154,9 +154,6 @@ class DelayTapA int n; fistp (f, n); /* read: n = (int) f; relies on FPTruncateMode */ f -= n; - if (0 && f < .5) - f += 1, - n -= 1; sample_t x = d[n]; f = (1 - f) / (1 + f); diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index e9962838c..73ea4d8c2 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -605,7 +605,7 @@ invalid_format: } // search for "data" chunk - while( 1 ) + while( true ) { const int id = readID(); const int len = read32LE(); diff --git a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp index fd1d2b838..2b0c0d974 100644 --- a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp @@ -86,7 +86,7 @@ LocalZynAddSubFx::LocalZynAddSubFx() : m_ioEngine = new NulEngine; m_master = new Master(); - m_master->swaplr = 0; + m_master->swaplr = false; } diff --git a/src/core/audio/AudioOss.cpp b/src/core/audio/AudioOss.cpp index 76f10a61e..4480e399c 100644 --- a/src/core/audio/AudioOss.cpp +++ b/src/core/audio/AudioOss.cpp @@ -219,7 +219,7 @@ QString AudioOss::probeDevice() if( QFileInfo( dev ).isWritable() == false ) { int instance = -1; - while( 1 ) + while( true ) { dev = PATH_DEV_DSP + QString::number( ++instance ); if( !QFileInfo( dev ).exists() ) From e72d9d46b8e9d47e46843516fd4b6b1a7db2593e Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sat, 25 Jun 2022 00:53:01 +0200 Subject: [PATCH 09/55] Add missing gui:: prefixes to types in AudioSoundIo (#6447) Fixup of #6174 . --- include/AudioSoundIo.h | 6 +++--- src/core/audio/AudioSoundIo.cpp | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/AudioSoundIo.h b/include/AudioSoundIo.h index 411f4ab22..c85f13252 100644 --- a/include/AudioSoundIo.h +++ b/include/AudioSoundIo.h @@ -70,7 +70,7 @@ public: return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "soundio" ); } - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -84,8 +84,8 @@ public: private: AudioSoundIoSetupUtil m_setupUtil; - ComboBox * m_backend; - ComboBox * m_device; + gui::ComboBox * m_backend; + gui::ComboBox * m_device; ComboBoxModel m_backendModel; ComboBoxModel m_deviceModel; diff --git a/src/core/audio/AudioSoundIo.cpp b/src/core/audio/AudioSoundIo.cpp index a25d968df..165e38cde 100644 --- a/src/core/audio/AudioSoundIo.cpp +++ b/src/core/audio/AudioSoundIo.cpp @@ -455,14 +455,14 @@ AudioSoundIo::setupWidget::setupWidget( QWidget * _parent ) : { m_setupUtil.m_setupWidget = this; - m_backend = new ComboBox( this, "BACKEND" ); + m_backend = new gui::ComboBox( this, "BACKEND" ); m_backend->setGeometry( 64, 15, 260, 20 ); QLabel * backend_lbl = new QLabel( tr( "Backend" ), this ); backend_lbl->setFont( pointSize<7>( backend_lbl->font() ) ); backend_lbl->move( 8, 18 ); - m_device = new ComboBox( this, "DEVICE" ); + m_device = new gui::ComboBox( this, "DEVICE" ); m_device->setGeometry( 64, 35, 260, 20 ); QLabel * dev_lbl = new QLabel( tr( "Device" ), this ); From cd7f26b36c6e2246b9dec0f96f162508c21bbd96 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sat, 25 Jun 2022 01:14:59 +0200 Subject: [PATCH 10/55] Split lines in .clang-tidy [ci skip] See, for example: https://stackoverflow.com/questions/60723010/clang-tidy-file-how-to-list-the-checks-in-multiple-lines --- .clang-tidy | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index 0f978c1de..cc5b8d836 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -1,5 +1,12 @@ --- -Checks: 'bugprone-macro-parentheses,bugprone-macro-repeated-side-effects,modernize-use-override,readability-identifier-naming,readability-misleading-indentation,readability-simplify-boolean-expr,readability-braces-around-statements' +Checks: > + bugprone-macro-parentheses, + bugprone-macro-repeated-side-effects, + modernize-use-override, + readability-identifier-naming, + readability-misleading-indentation, + readability-simplify-boolean-expr, + readability-braces-around-statements WarningsAsErrors: '' HeaderFilterRegex: '' # don't show errors from headers AnalyzeTemporaryDtors: false From 95843759cc60bcabea26f98cda6176ef261fe75c Mon Sep 17 00:00:00 2001 From: Johannes Lorenz Date: Sat, 25 Jun 2022 01:17:35 +0200 Subject: [PATCH 11/55] Update .clang-tidy [ci skip] --- .clang-tidy | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.clang-tidy b/.clang-tidy index cc5b8d836..aff46bba6 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,7 +2,13 @@ Checks: > bugprone-macro-parentheses, bugprone-macro-repeated-side-effects, + modernize-redundant-void-arg, + modernize-use-bool-literals, + modernize-use-emplace, + modernize-use-equals-default, + modernize-use-equals-delete, modernize-use-override, + performance-trivially-destructible, readability-identifier-naming, readability-misleading-indentation, readability-simplify-boolean-expr, From 28ec71f91a37844012a2f2f84729419c73426f3b Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 26 Jun 2022 08:48:24 +0200 Subject: [PATCH 12/55] clang-tidy: Apply modernize-use-equals-default everywhere (#6450) --- include/AudioAlsa.h | 2 +- include/AudioDeviceSetupWidget.h | 2 +- include/AudioDummy.h | 4 +--- include/AudioEngineProfiler.h | 2 +- include/AudioSdl.h | 2 +- include/AudioSndio.h | 2 +- include/AudioSoundIo.h | 2 +- include/AutomatableSlider.h | 2 +- include/AutomationClipView.h | 2 +- include/AutomationEditor.h | 2 +- include/BandLimitedWave.h | 4 ++-- include/BasicFilters.h | 6 +++--- include/CPULoadWidget.h | 2 +- include/CaptionMenu.h | 2 +- include/ColorChooser.h | 2 +- include/ComboBox.h | 2 +- include/ControllerDialog.h | 2 +- include/ControllerRackView.h | 2 +- include/Controls.h | 10 ++++----- include/DataFile.h | 2 +- include/DetuningHelper.h | 4 +--- include/DrumSynth.h | 2 +- include/DummyEffect.h | 8 ++----- include/DummyInstrument.h | 4 +--- include/DummyPlugin.h | 4 +--- include/Editor.h | 2 +- include/EffectControlDialog.h | 2 +- include/EffectControls.h | 4 +--- include/EnvelopeAndLfoParameters.h | 8 ++----- include/ExportFilter.h | 2 +- include/FadeButton.h | 2 +- include/ImportFilter.h | 2 +- include/InstrumentFunctions.h | 4 ++-- include/InstrumentMidiIOView.h | 2 +- include/InstrumentPlayHandle.h | 4 +--- include/InstrumentSoundShaping.h | 2 +- include/InstrumentView.h | 2 +- include/Ladspa2LMMS.h | 2 +- include/LadspaControl.h | 2 +- include/LadspaControlView.h | 2 +- include/LinkedModelGroupViews.h | 2 +- include/LinkedModelGroups.h | 2 +- include/LmmsPalette.h | 2 +- include/LmmsStyle.h | 4 +--- include/LocklessAllocator.h | 4 +--- include/LocklessRingBuffer.h | 2 +- include/Lv2Ports.h | 6 +++--- include/Lv2ViewBase.h | 2 +- include/MeterDialog.h | 2 +- include/MeterModel.h | 4 ++-- include/MicroTimer.h | 2 +- include/MidiClient.h | 6 +++--- include/MidiController.h | 2 +- include/MidiDummy.h | 8 ++----- include/MidiEvent.h | 11 +--------- include/MidiEventProcessor.h | 8 ++----- include/MidiPortMenu.h | 2 +- include/Mixer.h | 2 +- include/MixerLineLcdSpinBox.h | 2 +- include/Model.h | 4 +--- include/ModelVisitor.h | 4 ++-- include/PatternEditor.h | 2 +- include/PatternStore.h | 2 +- include/PeakController.h | 2 +- include/PianoRoll.h | 2 +- include/PixmapButton.h | 2 +- include/Plugin.h | 6 ++---- include/PluginFactory.h | 2 +- include/ProjectJournal.h | 2 +- include/ProjectNotes.h | 2 +- include/ProjectRenderer.h | 2 +- include/RemotePluginBase.h | 6 +----- include/RenameDialog.h | 2 +- include/Rubberband.h | 6 ++---- include/SampleTrackWindow.h | 2 +- include/SideBar.h | 2 +- include/SideBarWidget.h | 2 +- include/SongEditor.h | 2 +- include/SweepOscillator.h | 4 +--- include/TabButton.h | 4 +--- include/TempoSyncKnobModel.h | 2 +- include/TextFloat.h | 4 +--- include/ToolPlugin.h | 2 +- include/TrackContainerView.h | 2 +- include/TrackContentWidget.h | 2 +- include/TrackLabelButton.h | 2 +- include/TrackOperationsWidget.h | 2 +- include/TrackView.h | 2 +- include/ValueBuffer.h | 2 +- include/embed.h | 4 +--- include/shared_object.h | 4 +--- plugins/Amplifier/Amplifier.cpp | 3 --- plugins/Amplifier/Amplifier.h | 2 +- plugins/Amplifier/AmplifierControlDialog.h | 4 +--- plugins/Amplifier/AmplifierControls.h | 4 +--- .../AudioFileProcessor/AudioFileProcessor.cpp | 3 --- .../AudioFileProcessor/AudioFileProcessor.h | 2 +- plugins/BassBooster/BassBooster.cpp | 3 --- plugins/BassBooster/BassBooster.h | 2 +- .../BassBooster/BassBoosterControlDialog.h | 4 +--- plugins/BassBooster/BassBoosterControls.h | 4 +--- plugins/BitInvader/BitInvader.cpp | 4 ---- plugins/BitInvader/BitInvader.h | 4 ++-- plugins/Bitcrush/BitcrushControlDialog.h | 4 +--- plugins/Bitcrush/BitcrushControls.cpp | 3 --- plugins/Bitcrush/BitcrushControls.h | 2 +- plugins/Compressor/Compressor.cpp | 5 ----- plugins/Compressor/Compressor.h | 2 +- .../CrossoverEQ/CrossoverEQControlDialog.h | 4 +--- plugins/CrossoverEQ/CrossoverEQControls.h | 2 +- plugins/Delay/DelayControls.h | 4 +--- plugins/Delay/DelayControlsDialog.h | 6 ++---- plugins/Delay/Lfo.h | 4 +--- plugins/DualFilter/DualFilterControlDialog.h | 4 +--- plugins/DualFilter/DualFilterControls.h | 4 +--- .../DynamicsProcessorControlDialog.h | 4 +--- .../DynamicsProcessorControls.h | 4 +--- plugins/Eq/EqControls.h | 4 +--- plugins/Eq/EqControlsDialog.h | 4 +--- plugins/Eq/EqEffect.cpp | 7 ------- plugins/Eq/EqEffect.h | 2 +- plugins/Eq/EqFader.h | 4 +--- plugins/Eq/EqSpectrumView.h | 4 +--- plugins/Flanger/FlangerControls.h | 4 +--- plugins/Flanger/FlangerControlsDialog.h | 4 +--- plugins/FreeBoy/FreeBoy.cpp | 10 --------- plugins/FreeBoy/FreeBoy.h | 4 ++-- plugins/FreeBoy/Gb_Apu_Buffer.cpp | 3 --- plugins/FreeBoy/Gb_Apu_Buffer.h | 4 ++-- plugins/GigPlayer/GigPlayer.cpp | 7 ------- plugins/GigPlayer/GigPlayer.h | 2 +- plugins/GigPlayer/PatchesDialog.cpp | 8 ------- plugins/GigPlayer/PatchesDialog.h | 2 +- plugins/HydrogenImport/HydrogenImport.cpp | 3 --- plugins/HydrogenImport/HydrogenImport.h | 2 +- plugins/Kicker/Kicker.cpp | 14 ------------- plugins/Kicker/Kicker.h | 4 ++-- plugins/Kicker/KickerOsc.h | 4 +--- plugins/LadspaBrowser/LadspaBrowser.cpp | 14 ------------- plugins/LadspaBrowser/LadspaBrowser.h | 4 ++-- plugins/LadspaBrowser/LadspaDescription.cpp | 7 ------- plugins/LadspaBrowser/LadspaDescription.h | 2 +- plugins/LadspaBrowser/LadspaPortDialog.cpp | 5 ----- plugins/LadspaBrowser/LadspaPortDialog.h | 2 +- plugins/LadspaEffect/LadspaControlDialog.cpp | 7 ------- plugins/LadspaEffect/LadspaControlDialog.h | 2 +- plugins/Lb302/Lb302.cpp | 5 ----- plugins/Lb302/Lb302.h | 4 ++-- plugins/MidiExport/MidiExport.cpp | 6 ------ plugins/MidiExport/MidiExport.h | 2 +- plugins/MidiImport/MidiImport.cpp | 7 ------- plugins/MidiImport/MidiImport.h | 2 +- plugins/MidiImport/portsmf/allegro.h | 10 ++++----- plugins/MidiImport/portsmf/allegrosmfwr.cpp | 7 +------ plugins/Monstro/Monstro.cpp | 15 ------------- plugins/Monstro/Monstro.h | 6 +++--- .../MultitapEcho/MultitapEchoControlDialog.h | 4 +--- plugins/MultitapEcho/MultitapEchoControls.cpp | 5 ----- plugins/MultitapEcho/MultitapEchoControls.h | 2 +- plugins/Nes/Nes.cpp | 15 ------------- plugins/Nes/Nes.h | 6 +++--- plugins/Organic/Organic.cpp | 7 ------- plugins/Organic/Organic.h | 6 ++---- plugins/Patman/Patman.cpp | 7 ------- plugins/Patman/Patman.h | 2 +- .../PeakControllerEffectControlDialog.h | 4 +--- .../PeakControllerEffectControls.h | 4 +--- plugins/ReverbSC/ReverbSCControlDialog.h | 4 +--- plugins/ReverbSC/ReverbSCControls.h | 4 +--- plugins/Sf2Player/PatchesDialog.cpp | 6 ------ plugins/Sf2Player/PatchesDialog.h | 2 +- plugins/Sf2Player/Sf2Player.cpp | 7 ------- plugins/Sf2Player/Sf2Player.h | 2 +- plugins/Sfxr/Sfxr.cpp | 15 ------------- plugins/Sfxr/Sfxr.h | 6 +++--- plugins/Sid/SidInstrument.cpp | 14 ------------- plugins/Sid/SidInstrument.h | 10 ++++----- plugins/SpectrumAnalyzer/SaControls.h | 2 +- plugins/SpectrumAnalyzer/SaControlsDialog.h | 2 +- plugins/SpectrumAnalyzer/SaSpectrumView.h | 2 +- plugins/SpectrumAnalyzer/SaWaterfallView.h | 2 +- .../StereoEnhancerControlDialog.h | 4 +--- .../StereoEnhancer/StereoEnhancerControls.h | 4 +--- plugins/StereoMatrix/StereoMatrix.cpp | 6 ------ plugins/StereoMatrix/StereoMatrix.h | 2 +- .../StereoMatrix/StereoMatrixControlDialog.h | 4 +--- plugins/StereoMatrix/StereoMatrixControls.h | 4 +--- plugins/Stk/Mallets/Mallets.cpp | 13 ------------ plugins/Stk/Mallets/Mallets.h | 4 ++-- plugins/TripleOscillator/TripleOscillator.cpp | 14 ------------- plugins/TripleOscillator/TripleOscillator.h | 8 +++---- plugins/Vectorscope/VecControls.h | 2 +- plugins/Vectorscope/VecControlsDialog.h | 2 +- plugins/Vectorscope/VectorView.h | 2 +- plugins/Vectorscope/Vectorscope.h | 2 +- plugins/Vestige/Vestige.cpp | 11 +--------- plugins/Vestige/Vestige.h | 2 +- plugins/Vibed/Vibed.h | 2 +- plugins/VstEffect/VstEffect.cpp | 7 ------- plugins/VstEffect/VstEffect.h | 2 +- plugins/Watsyn/Watsyn.cpp | 11 ---------- plugins/Watsyn/Watsyn.h | 4 ++-- plugins/WaveShaper/WaveShaper.cpp | 7 ------- plugins/WaveShaper/WaveShaper.h | 2 +- plugins/WaveShaper/WaveShaperControlDialog.h | 4 +--- plugins/WaveShaper/WaveShaperControls.h | 4 +--- src/common/SharedMemory.cpp | 5 ++--- src/core/AudioEngineProfiler.cpp | 5 ----- src/core/DataFile.cpp | 6 ------ src/core/ImportFilter.cpp | 6 ------ src/core/InstrumentFunctions.cpp | 9 -------- src/core/InstrumentSoundShaping.cpp | 5 ----- src/core/Ladspa2LMMS.cpp | 6 ------ src/core/LadspaControl.cpp | 7 ------- src/core/LinkedModelGroups.cpp | 5 ----- src/core/MeterModel.cpp | 9 -------- src/core/MicroTimer.cpp | 4 ---- src/core/Mixer.cpp | 5 ----- src/core/ModelVisitor.cpp | 4 ---- src/core/PatternStore.cpp | 7 ------- src/core/Plugin.cpp | 7 ------- src/core/PluginFactory.cpp | 4 ---- src/core/PresetPreviewPlayHandle.cpp | 4 +--- src/core/ProjectJournal.cpp | 7 ------- src/core/ProjectRenderer.cpp | 7 ------- src/core/TempoSyncKnobModel.cpp | 7 ------- src/core/ToolPlugin.cpp | 7 ------- src/core/ValueBuffer.cpp | 3 --- src/core/audio/AudioSdl.cpp | 7 ------- src/core/audio/AudioSndio.cpp | 6 ------ src/core/audio/AudioSoundIo.cpp | 4 ---- src/core/lv2/Lv2ControlBase.cpp | 2 +- src/core/lv2/Lv2Ports.cpp | 9 -------- src/core/lv2/Lv2Proc.cpp | 4 +--- src/core/midi/MidiClient.cpp | 21 ------------------- src/core/midi/MidiController.cpp | 7 ------- src/gui/AudioDeviceSetupWidget.cpp | 4 ---- src/gui/ControllerDialog.cpp | 6 ------ src/gui/ControllerRackView.cpp | 7 ------- src/gui/Controls.cpp | 16 -------------- src/gui/EffectControlDialog.cpp | 7 ------- src/gui/LadspaControlView.cpp | 6 ------ src/gui/LinkedModelGroupViews.cpp | 5 ----- src/gui/LmmsPalette.cpp | 4 ---- src/gui/Lv2ViewBase.cpp | 5 ----- src/gui/MixerView.cpp | 2 +- src/gui/PeakControllerDialog.cpp | 6 ------ src/gui/ProjectNotes.cpp | 7 ------- src/gui/SampleTrackWindow.cpp | 5 ----- src/gui/SideBar.cpp | 7 ------- src/gui/SideBarWidget.cpp | 7 ------- src/gui/clips/AutomationClipView.cpp | 7 ------- src/gui/editors/AutomationEditor.cpp | 5 ----- src/gui/editors/Editor.cpp | 5 ----- src/gui/editors/PatternEditor.cpp | 5 ----- src/gui/editors/PianoRoll.cpp | 5 ----- src/gui/editors/Rubberband.cpp | 7 ------- src/gui/editors/SongEditor.cpp | 4 ---- src/gui/editors/TrackContainerView.cpp | 7 ------- src/gui/instrument/InstrumentMidiIOView.cpp | 6 ------ src/gui/instrument/InstrumentView.cpp | 4 ---- src/gui/menus/MidiPortMenu.cpp | 6 ------ src/gui/modals/ControllerConnectionDialog.cpp | 4 +--- src/gui/modals/RenameDialog.cpp | 6 ------ src/gui/tracks/FadeButton.cpp | 5 ----- src/gui/tracks/TrackContentWidget.cpp | 8 ------- src/gui/tracks/TrackLabelButton.cpp | 5 ----- src/gui/tracks/TrackOperationsWidget.cpp | 7 ------- src/gui/tracks/TrackView.cpp | 6 ------ src/gui/widgets/AutomatableSlider.cpp | 4 ---- src/gui/widgets/CPULoadWidget.cpp | 4 ---- src/gui/widgets/CaptionMenu.cpp | 4 ---- src/gui/widgets/ComboBox.cpp | 4 ---- src/gui/widgets/MeterDialog.cpp | 4 ---- src/gui/widgets/PixmapButton.cpp | 4 ---- 275 files changed, 223 insertions(+), 1034 deletions(-) diff --git a/include/AudioAlsa.h b/include/AudioAlsa.h index 6bbd4aecd..7149aa320 100644 --- a/include/AudioAlsa.h +++ b/include/AudioAlsa.h @@ -54,7 +54,7 @@ public: m_deviceName(deviceName), m_deviceDescription(deviceDescription) {} - ~DeviceInfo() {} + ~DeviceInfo() = default; QString const & getDeviceName() const { return m_deviceName; } QString const & getDeviceDescription() const { return m_deviceDescription; } diff --git a/include/AudioDeviceSetupWidget.h b/include/AudioDeviceSetupWidget.h index 392cbd3a4..e984651e4 100644 --- a/include/AudioDeviceSetupWidget.h +++ b/include/AudioDeviceSetupWidget.h @@ -36,7 +36,7 @@ class AudioDeviceSetupWidget : public TabWidget public: AudioDeviceSetupWidget( const QString & _caption, QWidget * _parent ); - ~AudioDeviceSetupWidget() override; + ~AudioDeviceSetupWidget() override = default; virtual void saveSettings() = 0; diff --git a/include/AudioDummy.h b/include/AudioDummy.h index 3677bf451..30b125b3a 100644 --- a/include/AudioDummy.h +++ b/include/AudioDummy.h @@ -62,9 +62,7 @@ public: { } - ~setupWidget() override - { - } + ~setupWidget() override = default; void saveSettings() override { diff --git a/include/AudioEngineProfiler.h b/include/AudioEngineProfiler.h index 136c6dbea..38631c6a9 100644 --- a/include/AudioEngineProfiler.h +++ b/include/AudioEngineProfiler.h @@ -37,7 +37,7 @@ class AudioEngineProfiler { public: AudioEngineProfiler(); - ~AudioEngineProfiler(); + ~AudioEngineProfiler() = default; void startPeriod() { diff --git a/include/AudioSdl.h b/include/AudioSdl.h index c3b9d27d3..7e7710a2f 100644 --- a/include/AudioSdl.h +++ b/include/AudioSdl.h @@ -61,7 +61,7 @@ public: { public: setupWidget( QWidget * _parent ); - ~setupWidget() override; + ~setupWidget() override = default; void saveSettings() override; diff --git a/include/AudioSndio.h b/include/AudioSndio.h index 993a44432..b2da8eac0 100644 --- a/include/AudioSndio.h +++ b/include/AudioSndio.h @@ -63,7 +63,7 @@ public: { public: setupWidget( QWidget * _parent ); - ~setupWidget() override; + ~setupWidget() override = default; void saveSettings() override; diff --git a/include/AudioSoundIo.h b/include/AudioSoundIo.h index c85f13252..dc9afe7e4 100644 --- a/include/AudioSoundIo.h +++ b/include/AudioSoundIo.h @@ -51,7 +51,7 @@ class AudioSoundIoSetupUtil : public QObject { Q_OBJECT public: - virtual ~AudioSoundIoSetupUtil(); + virtual ~AudioSoundIoSetupUtil() = default; void *m_setupWidget; public slots: diff --git a/include/AutomatableSlider.h b/include/AutomatableSlider.h index cadaaf8db..1c74a05ad 100644 --- a/include/AutomatableSlider.h +++ b/include/AutomatableSlider.h @@ -39,7 +39,7 @@ class AutomatableSlider : public QSlider, public IntModelView Q_OBJECT public: AutomatableSlider( QWidget * _parent, const QString & _name = QString() ); - ~AutomatableSlider() override; + ~AutomatableSlider() override = default; bool showStatus() { diff --git a/include/AutomationClipView.h b/include/AutomationClipView.h index 1a2e80248..b4de7839c 100644 --- a/include/AutomationClipView.h +++ b/include/AutomationClipView.h @@ -45,7 +45,7 @@ class AutomationClipView : public ClipView public: AutomationClipView( AutomationClip * _clip, TrackView * _parent ); - ~AutomationClipView() override; + ~AutomationClipView() override = default; public slots: /// Opens this view's clip in the global automation editor diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index c710c5007..dfb983e9a 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -255,7 +255,7 @@ class AutomationEditorWindow : public Editor static const int INITIAL_HEIGHT = 480; public: AutomationEditorWindow(); - ~AutomationEditorWindow() override; + ~AutomationEditorWindow() override = default; void setCurrentClip(AutomationClip* clip); const AutomationClip* currentClip(); diff --git a/include/BandLimitedWave.h b/include/BandLimitedWave.h index 30d28d4a1..c65505327 100644 --- a/include/BandLimitedWave.h +++ b/include/BandLimitedWave.h @@ -97,8 +97,8 @@ public: NumBLWaveforms }; - BandLimitedWave() {}; - virtual ~BandLimitedWave() {}; + BandLimitedWave() = default; + virtual ~BandLimitedWave() = default; /*! \brief This method converts frequency to wavelength. The oscillate function takes wavelength as argument so * use this to convert your note frequency to wavelength before using it. diff --git a/include/BasicFilters.h b/include/BasicFilters.h index 10b5b24b7..da64c3bc5 100644 --- a/include/BasicFilters.h +++ b/include/BasicFilters.h @@ -58,7 +58,7 @@ public: m_sampleRate = sampleRate; clearHistory(); } - virtual ~LinkwitzRiley() {} + virtual ~LinkwitzRiley() = default; inline void clearHistory() { @@ -152,7 +152,7 @@ public: { clearHistory(); } - virtual ~BiQuad() {} + virtual ~BiQuad() = default; inline void setCoeffs( float a1, float a2, float b0, float b1, float b2 ) { @@ -200,7 +200,7 @@ public: m_z1[i] = 0.0; } } - virtual ~OnePole() {} + virtual ~OnePole() = default; inline void setCoeffs( float a0, float b1 ) { diff --git a/include/CPULoadWidget.h b/include/CPULoadWidget.h index 31aecb016..dd2747ef2 100644 --- a/include/CPULoadWidget.h +++ b/include/CPULoadWidget.h @@ -43,7 +43,7 @@ class CPULoadWidget : public QWidget Q_OBJECT public: CPULoadWidget( QWidget * _parent ); - ~CPULoadWidget() override; + ~CPULoadWidget() override = default; protected: diff --git a/include/CaptionMenu.h b/include/CaptionMenu.h index a3724e127..f6a2fff25 100644 --- a/include/CaptionMenu.h +++ b/include/CaptionMenu.h @@ -41,7 +41,7 @@ class LMMS_EXPORT CaptionMenu : public QMenu Q_OBJECT public: CaptionMenu( const QString & _title, QWidget * _parent = 0 ); - ~CaptionMenu() override; + ~CaptionMenu() override = default; } ; diff --git a/include/ColorChooser.h b/include/ColorChooser.h index 9b3389c47..5482a9a03 100644 --- a/include/ColorChooser.h +++ b/include/ColorChooser.h @@ -40,7 +40,7 @@ public: ColorChooser(const QColor &initial, QWidget *parent): QColorDialog(initial, parent) {}; ColorChooser(QWidget *parent): QColorDialog(parent) {}; //! For getting a color without having to initialise a color dialog - ColorChooser() {}; + ColorChooser() = default; enum class Palette {Default, Track, Mixer}; //! Set global palette via array, checking bounds void setPalette (QVector); diff --git a/include/ComboBox.h b/include/ComboBox.h index 9b51d87ab..9a0e5a517 100644 --- a/include/ComboBox.h +++ b/include/ComboBox.h @@ -40,7 +40,7 @@ class LMMS_EXPORT ComboBox : public QWidget, public IntModelView Q_OBJECT public: ComboBox( QWidget* parent = nullptr, const QString& name = QString() ); - ~ComboBox() override; + ~ComboBox() override = default; ComboBoxModel* model() { diff --git a/include/ControllerDialog.h b/include/ControllerDialog.h index 351afd66a..4f496ad77 100644 --- a/include/ControllerDialog.h +++ b/include/ControllerDialog.h @@ -44,7 +44,7 @@ class ControllerDialog : public QWidget, public ModelView public: ControllerDialog( Controller * _controller, QWidget * _parent ); - ~ControllerDialog() override; + ~ControllerDialog() override = default; signals: diff --git a/include/ControllerRackView.h b/include/ControllerRackView.h index a522071c8..904e523dd 100644 --- a/include/ControllerRackView.h +++ b/include/ControllerRackView.h @@ -53,7 +53,7 @@ class ControllerRackView : public QWidget, public SerializingObject Q_OBJECT public: ControllerRackView(); - ~ControllerRackView() override; + ~ControllerRackView() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/include/Controls.h b/include/Controls.h index af2a5fa71..9ffed465e 100644 --- a/include/Controls.h +++ b/include/Controls.h @@ -66,7 +66,7 @@ public: virtual AutomatableModel* model() = 0; virtual AutomatableModelView* modelView() = 0; - virtual ~Control(); + virtual ~Control() = default; }; @@ -83,7 +83,7 @@ public: AutomatableModelView* modelView() override; KnobControl(QWidget* parent = nullptr); - ~KnobControl() override; + ~KnobControl() override = default; }; @@ -102,7 +102,7 @@ public: AutomatableModelView* modelView() override; ComboControl(QWidget* parent = nullptr); - ~ComboControl() override; + ~ComboControl() override = default; }; @@ -119,7 +119,7 @@ public: AutomatableModelView* modelView() override; LcdControl(int numDigits, QWidget* parent = nullptr); - ~LcdControl() override; + ~LcdControl() override = default; }; @@ -138,7 +138,7 @@ public: AutomatableModelView* modelView() override; CheckControl(QWidget* parent = nullptr); - ~CheckControl() override; + ~CheckControl() override = default; }; diff --git a/include/DataFile.h b/include/DataFile.h index c17b3546f..42dc2eabd 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -67,7 +67,7 @@ public: DataFile( const QByteArray& data ); DataFile( Type type ); - virtual ~DataFile(); + virtual ~DataFile() = default; /// /// \brief validate diff --git a/include/DetuningHelper.h b/include/DetuningHelper.h index c67ae41c6..f90af3697 100644 --- a/include/DetuningHelper.h +++ b/include/DetuningHelper.h @@ -42,9 +42,7 @@ public: { } - ~DetuningHelper() override - { - } + ~DetuningHelper() override = default; float defaultValue() const override { diff --git a/include/DrumSynth.h b/include/DrumSynth.h index 28121fc75..98574f2d2 100644 --- a/include/DrumSynth.h +++ b/include/DrumSynth.h @@ -37,7 +37,7 @@ namespace lmms class DrumSynth { public: - DrumSynth() {}; + DrumSynth() = default; int GetDSFileSamples(QString dsfile, int16_t *&wave, int channels, sample_rate_t Fs); private: diff --git a/include/DummyEffect.h b/include/DummyEffect.h index 637feaba1..675249865 100644 --- a/include/DummyEffect.h +++ b/include/DummyEffect.h @@ -60,9 +60,7 @@ public: { } - ~DummyEffectControls() override - { - } + ~DummyEffectControls() override = default; int controlCount() override { @@ -102,9 +100,7 @@ public: setName(); } - ~DummyEffect() override - { - } + ~DummyEffect() override = default; EffectControls * controls() override { diff --git a/include/DummyInstrument.h b/include/DummyInstrument.h index 7f85d83b5..a40d8338f 100644 --- a/include/DummyInstrument.h +++ b/include/DummyInstrument.h @@ -47,9 +47,7 @@ public: { } - ~DummyInstrument() override - { - } + ~DummyInstrument() override = default; void playNote( NotePlayHandle *, sampleFrame * buffer ) override { diff --git a/include/DummyPlugin.h b/include/DummyPlugin.h index fd98b831c..cf36d2159 100644 --- a/include/DummyPlugin.h +++ b/include/DummyPlugin.h @@ -41,9 +41,7 @@ public: { } - ~DummyPlugin() override - { - } + ~DummyPlugin() override = default; void saveSettings( QDomDocument &, QDomElement & ) override { diff --git a/include/Editor.h b/include/Editor.h index 60760f2b4..1a39ea72f 100644 --- a/include/Editor.h +++ b/include/Editor.h @@ -81,7 +81,7 @@ protected: /// \param record If set true, the editor's toolbar will contain record /// buttons in addition to the play and stop buttons. Editor(bool record = false, bool record_step = false); - ~Editor() override; + ~Editor() override = default; DropToolBar* m_toolBar; diff --git a/include/EffectControlDialog.h b/include/EffectControlDialog.h index 59e422264..6389db4a3 100644 --- a/include/EffectControlDialog.h +++ b/include/EffectControlDialog.h @@ -44,7 +44,7 @@ class LMMS_EXPORT EffectControlDialog : public QWidget, public ModelView Q_OBJECT public: EffectControlDialog( EffectControls * _controls ); - ~EffectControlDialog() override; + ~EffectControlDialog() override = default; virtual bool isResizable() const {return false;} diff --git a/include/EffectControls.h b/include/EffectControls.h index 95ef0039c..994145a40 100644 --- a/include/EffectControls.h +++ b/include/EffectControls.h @@ -51,9 +51,7 @@ public: { } - ~EffectControls() override - { - } + ~EffectControls() override = default; virtual int controlCount() = 0; virtual gui::EffectControlDialog * createView() = 0; diff --git a/include/EnvelopeAndLfoParameters.h b/include/EnvelopeAndLfoParameters.h index 7b630b1b0..042068cce 100644 --- a/include/EnvelopeAndLfoParameters.h +++ b/include/EnvelopeAndLfoParameters.h @@ -50,13 +50,9 @@ public: class LfoInstances { public: - LfoInstances() - { - } + LfoInstances() = default; - ~LfoInstances() - { - } + ~LfoInstances() = default; inline bool isEmpty() const { diff --git a/include/ExportFilter.h b/include/ExportFilter.h index 3aaa2f986..29efef539 100644 --- a/include/ExportFilter.h +++ b/include/ExportFilter.h @@ -40,7 +40,7 @@ class LMMS_EXPORT ExportFilter : public Plugin { public: ExportFilter( const Descriptor * _descriptor ) : Plugin( _descriptor, nullptr ) {} - ~ExportFilter() override {} + ~ExportFilter() override = default; virtual bool tryExport(const TrackContainer::TrackList &tracks, diff --git a/include/FadeButton.h b/include/FadeButton.h index b4a78d5ee..d33900913 100644 --- a/include/FadeButton.h +++ b/include/FadeButton.h @@ -44,7 +44,7 @@ public: const QColor & _hold_color, QWidget * _parent ); - ~FadeButton() override; + ~FadeButton() override = default; void setActiveColor( const QColor & activated_color ); diff --git a/include/ImportFilter.h b/include/ImportFilter.h index 9635fedb5..b7a910e5d 100644 --- a/include/ImportFilter.h +++ b/include/ImportFilter.h @@ -42,7 +42,7 @@ class LMMS_EXPORT ImportFilter : public Plugin public: ImportFilter( const QString & _file_name, const Descriptor * _descriptor ); - ~ImportFilter() override; + ~ImportFilter() override = default; // tries to import given file to given track-container by having all diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index 76e522bc5..ede54144f 100644 --- a/include/InstrumentFunctions.h +++ b/include/InstrumentFunctions.h @@ -58,7 +58,7 @@ private: public: InstrumentFunctionNoteStacking( Model * _parent ); - ~InstrumentFunctionNoteStacking() override; + ~InstrumentFunctionNoteStacking() override = default; void processNote( NotePlayHandle* n ); @@ -180,7 +180,7 @@ public: } ; InstrumentFunctionArpeggio( Model * _parent ); - ~InstrumentFunctionArpeggio() override; + ~InstrumentFunctionArpeggio() override = default; void processNote( NotePlayHandle* n ); diff --git a/include/InstrumentMidiIOView.h b/include/InstrumentMidiIOView.h index 821488390..81feee082 100644 --- a/include/InstrumentMidiIOView.h +++ b/include/InstrumentMidiIOView.h @@ -50,7 +50,7 @@ class InstrumentMidiIOView : public QWidget, public ModelView Q_OBJECT public: InstrumentMidiIOView( QWidget* parent ); - ~InstrumentMidiIOView() override; + ~InstrumentMidiIOView() override = default; private: diff --git a/include/InstrumentPlayHandle.h b/include/InstrumentPlayHandle.h index 2935d36ba..e9516ab19 100644 --- a/include/InstrumentPlayHandle.h +++ b/include/InstrumentPlayHandle.h @@ -38,9 +38,7 @@ class LMMS_EXPORT InstrumentPlayHandle : public PlayHandle public: InstrumentPlayHandle( Instrument * instrument, InstrumentTrack* instrumentTrack ); - ~InstrumentPlayHandle() override - { - } + ~InstrumentPlayHandle() override = default; void play( sampleFrame * _working_buffer ) override diff --git a/include/InstrumentSoundShaping.h b/include/InstrumentSoundShaping.h index 1df6b858b..11ed4f1c4 100644 --- a/include/InstrumentSoundShaping.h +++ b/include/InstrumentSoundShaping.h @@ -46,7 +46,7 @@ class InstrumentSoundShaping : public Model, public JournallingObject Q_OBJECT public: InstrumentSoundShaping( InstrumentTrack * _instrument_track ); - ~InstrumentSoundShaping() override; + ~InstrumentSoundShaping() override = default; void processAudioBuffer( sampleFrame * _ab, const fpp_t _frames, NotePlayHandle * _n ); diff --git a/include/InstrumentView.h b/include/InstrumentView.h index 695e8c477..ab18465eb 100644 --- a/include/InstrumentView.h +++ b/include/InstrumentView.h @@ -70,7 +70,7 @@ class LMMS_EXPORT InstrumentViewFixedSize : public InstrumentView public: using InstrumentView::InstrumentView; - ~InstrumentViewFixedSize() override; + ~InstrumentViewFixedSize() override = default; } ; diff --git a/include/Ladspa2LMMS.h b/include/Ladspa2LMMS.h index b1a21de70..4b7eb2482 100644 --- a/include/Ladspa2LMMS.h +++ b/include/Ladspa2LMMS.h @@ -68,7 +68,7 @@ public: private: Ladspa2LMMS(); - ~Ladspa2LMMS() override; + ~Ladspa2LMMS() override = default; l_sortable_plugin_t m_instruments; l_sortable_plugin_t m_validEffects; diff --git a/include/LadspaControl.h b/include/LadspaControl.h index 3a0ea5cc8..712c1ba1e 100644 --- a/include/LadspaControl.h +++ b/include/LadspaControl.h @@ -52,7 +52,7 @@ class LMMS_EXPORT LadspaControl : public Model, public JournallingObject public: LadspaControl( Model * _parent, port_desc_t * _port, bool _link = false ); - ~LadspaControl() override; + ~LadspaControl() override = default; LADSPA_Data value(); ValueBuffer * valueBuffer(); diff --git a/include/LadspaControlView.h b/include/LadspaControlView.h index c36135986..5dafa4e5c 100644 --- a/include/LadspaControlView.h +++ b/include/LadspaControlView.h @@ -43,7 +43,7 @@ class LMMS_EXPORT LadspaControlView : public QWidget, public ModelView Q_OBJECT public: LadspaControlView( QWidget * _parent, LadspaControl * _ctl ); - ~LadspaControlView() override; + ~LadspaControlView() override = default; private: LadspaControl * m_ctl; diff --git a/include/LinkedModelGroupViews.h b/include/LinkedModelGroupViews.h index 91a8d53ca..72598281b 100644 --- a/include/LinkedModelGroupViews.h +++ b/include/LinkedModelGroupViews.h @@ -70,7 +70,7 @@ public: */ LinkedModelGroupView(QWidget* parent, LinkedModelGroup* model, std::size_t colNum); - ~LinkedModelGroupView() override; + ~LinkedModelGroupView() override = default; //! Reconnect models if model changed void modelChanged(LinkedModelGroup* linkedModelGroup); diff --git a/include/LinkedModelGroups.h b/include/LinkedModelGroups.h index 9fa0fefa6..84a216f30 100644 --- a/include/LinkedModelGroups.h +++ b/include/LinkedModelGroups.h @@ -155,7 +155,7 @@ private: class LinkedModelGroups { public: - virtual ~LinkedModelGroups(); + virtual ~LinkedModelGroups() = default; void linkAllModels(); diff --git a/include/LmmsPalette.h b/include/LmmsPalette.h index 1840fb3eb..b07aa5c84 100644 --- a/include/LmmsPalette.h +++ b/include/LmmsPalette.h @@ -50,7 +50,7 @@ class LMMS_EXPORT LmmsPalette : public QWidget public: LmmsPalette( QWidget * parent, QStyle * stylearg ); - ~LmmsPalette() override; + ~LmmsPalette() override = default; #define ACCESSMET( read, write ) \ QColor read () const; \ diff --git a/include/LmmsStyle.h b/include/LmmsStyle.h index cfab2cd66..ae5b65f99 100644 --- a/include/LmmsStyle.h +++ b/include/LmmsStyle.h @@ -66,9 +66,7 @@ public: }; LmmsStyle(); - ~LmmsStyle() override - { - } + ~LmmsStyle() override = default; QPalette standardPalette() const override; diff --git a/include/LocklessAllocator.h b/include/LocklessAllocator.h index 054bb91e8..adde5fe6f 100644 --- a/include/LocklessAllocator.h +++ b/include/LocklessAllocator.h @@ -67,9 +67,7 @@ public: { } - ~LocklessAllocatorT() override - { - } + ~LocklessAllocatorT() override = default; T * alloc() { diff --git a/include/LocklessRingBuffer.h b/include/LocklessRingBuffer.h index 60f8ab989..e77c62ccb 100644 --- a/include/LocklessRingBuffer.h +++ b/include/LocklessRingBuffer.h @@ -46,7 +46,7 @@ public: { m_buffer.touch(); // reserve storage space before realtime operation starts } - ~LocklessRingBuffer() {}; + ~LocklessRingBuffer() = default; std::size_t capacity() const {return m_buffer.maximum_eventual_write_space();} std::size_t free() const {return m_buffer.write_space();} diff --git a/include/Lv2Ports.h b/include/Lv2Ports.h index 22a051a21..48c46dfb1 100644 --- a/include/Lv2Ports.h +++ b/include/Lv2Ports.h @@ -92,7 +92,7 @@ struct ConstVisitor virtual void visit(const Lv2Ports::AtomSeq& ) {} virtual void visit(const Lv2Ports::Unknown& ) {} - virtual ~ConstVisitor(); + virtual ~ConstVisitor() = default; }; struct Visitor @@ -104,7 +104,7 @@ struct Visitor virtual void visit(Lv2Ports::AtomSeq& ) {} virtual void visit(Lv2Ports::Unknown& ) {} - virtual ~Visitor(); + virtual ~Visitor() = default; }; struct Meta @@ -139,7 +139,7 @@ struct PortBase : public Meta QString name() const; QString uri() const; - virtual ~PortBase(); + virtual ~PortBase() = default; }; template diff --git a/include/Lv2ViewBase.h b/include/Lv2ViewBase.h index 2be5d72a4..605440814 100644 --- a/include/Lv2ViewBase.h +++ b/include/Lv2ViewBase.h @@ -58,7 +58,7 @@ class Lv2ViewProc : public LinkedModelGroupView public: //! @param colNum numbers of columns for the controls Lv2ViewProc(QWidget *parent, Lv2Proc *ctrlBase, int colNum); - ~Lv2ViewProc() override; + ~Lv2ViewProc() override = default; private: static AutoLilvNode uri(const char *uriStr); diff --git a/include/MeterDialog.h b/include/MeterDialog.h index e744ea9d4..67dca2568 100644 --- a/include/MeterDialog.h +++ b/include/MeterDialog.h @@ -41,7 +41,7 @@ class MeterDialog : public QWidget, public ModelView Q_OBJECT public: MeterDialog( QWidget * _parent, bool _simple = false ); - ~MeterDialog() override; + ~MeterDialog() override = default; void modelChanged() override; diff --git a/include/MeterModel.h b/include/MeterModel.h index 8ed4ba1aa..c2e715b79 100644 --- a/include/MeterModel.h +++ b/include/MeterModel.h @@ -31,14 +31,14 @@ namespace lmms { -class MeterModel : public Model +class LMMS_EXPORT MeterModel : public Model { Q_OBJECT mapPropertyFromModel(int,getNumerator,setNumerator,m_numeratorModel); mapPropertyFromModel(int,getDenominator,setDenominator,m_denominatorModel); public: MeterModel( Model * _parent ); - ~MeterModel() override; + ~MeterModel() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _this, const QString & _name ); diff --git a/include/MicroTimer.h b/include/MicroTimer.h index 4daf28edd..ea74e964d 100644 --- a/include/MicroTimer.h +++ b/include/MicroTimer.h @@ -36,7 +36,7 @@ class MicroTimer public: MicroTimer(); - ~MicroTimer(); + ~MicroTimer() = default; void reset(); int elapsed() const; diff --git a/include/MidiClient.h b/include/MidiClient.h index f5efc659a..954cd5ef5 100644 --- a/include/MidiClient.h +++ b/include/MidiClient.h @@ -45,7 +45,7 @@ class TimePos; class MidiClient { public: - MidiClient(); + MidiClient() = default; virtual ~MidiClient(); // to be implemented by sub-classes @@ -124,8 +124,8 @@ const uint32_t RAW_MIDI_PARSE_BUF_SIZE = 16; class MidiClientRaw : public MidiClient { public: - MidiClientRaw(); - ~MidiClientRaw() override; + MidiClientRaw() = default; + ~MidiClientRaw() override = default; // we are raw-clients for sure! bool isRaw() const override diff --git a/include/MidiController.h b/include/MidiController.h index 8b1db0476..500acc5f8 100644 --- a/include/MidiController.h +++ b/include/MidiController.h @@ -49,7 +49,7 @@ class MidiController : public Controller, public MidiEventProcessor Q_OBJECT public: MidiController( Model * _parent ); - ~MidiController() override; + ~MidiController() override = default; void processInEvent( const MidiEvent & _me, const TimePos & _time, f_cnt_t offset = 0 ) override; diff --git a/include/MidiDummy.h b/include/MidiDummy.h index e1c0e3e6a..67a91e326 100644 --- a/include/MidiDummy.h +++ b/include/MidiDummy.h @@ -35,12 +35,8 @@ namespace lmms class MidiDummy : public MidiClientRaw { public: - MidiDummy() - { - } - ~MidiDummy() override - { - } + MidiDummy() = default; + ~MidiDummy() override = default; inline static QString name() { diff --git a/include/MidiEvent.h b/include/MidiEvent.h index e73a7d1a8..6c2bfdd55 100644 --- a/include/MidiEvent.h +++ b/include/MidiEvent.h @@ -66,16 +66,7 @@ public: m_data.m_sysExDataLen = dataLen; } - MidiEvent( const MidiEvent& other ) : - m_type( other.m_type ), - m_metaEvent( other.m_metaEvent ), - m_channel( other.m_channel ), - m_data( other.m_data ), - m_sysExData( other.m_sysExData ), - m_sourcePort(other.m_sourcePort), - m_source(other.m_source) - { - } + MidiEvent( const MidiEvent& other ) = default; MidiEventTypes type() const { diff --git a/include/MidiEventProcessor.h b/include/MidiEventProcessor.h index 1398f4b6d..132a5fc42 100644 --- a/include/MidiEventProcessor.h +++ b/include/MidiEventProcessor.h @@ -37,13 +37,9 @@ class MidiEventProcessor { MM_OPERATORS public: - MidiEventProcessor() - { - } + MidiEventProcessor() = default; - virtual ~MidiEventProcessor() - { - } + virtual ~MidiEventProcessor() = default; // to be implemented by inheriting classes virtual void processInEvent( const MidiEvent& event, const TimePos& time = TimePos(), f_cnt_t offset = 0 ) = 0; diff --git a/include/MidiPortMenu.h b/include/MidiPortMenu.h index eb44ace57..215a73d06 100644 --- a/include/MidiPortMenu.h +++ b/include/MidiPortMenu.h @@ -41,7 +41,7 @@ class MidiPortMenu : public QMenu, public ModelView Q_OBJECT public: MidiPortMenu( MidiPort::Modes _mode ); - ~MidiPortMenu() override; + ~MidiPortMenu() override = default; public slots: diff --git a/include/Mixer.h b/include/Mixer.h index e6fdb2b06..efc103695 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -102,7 +102,7 @@ class MixerRoute : public QObject Q_OBJECT public: MixerRoute( MixerChannel * from, MixerChannel * to, float amount ); - ~MixerRoute() override; + ~MixerRoute() override = default; mix_ch_t senderIndex() const { diff --git a/include/MixerLineLcdSpinBox.h b/include/MixerLineLcdSpinBox.h index 51c7ab938..bfd6cd5c9 100644 --- a/include/MixerLineLcdSpinBox.h +++ b/include/MixerLineLcdSpinBox.h @@ -41,7 +41,7 @@ public: MixerLineLcdSpinBox(int numDigits, QWidget * parent, const QString& name, TrackView * tv = nullptr) : LcdSpinBox(numDigits, parent, name), m_tv(tv) {} - ~MixerLineLcdSpinBox() override {} + ~MixerLineLcdSpinBox() override = default; void setTrackView(TrackView * tv); diff --git a/include/Model.h b/include/Model.h index 1621d77e8..567d4ffd7 100644 --- a/include/Model.h +++ b/include/Model.h @@ -45,9 +45,7 @@ public: { } - ~Model() override - { - } + ~Model() override = default; bool isDefaultConstructed() { diff --git a/include/ModelVisitor.h b/include/ModelVisitor.h index cf0740b1c..8805e30e2 100644 --- a/include/ModelVisitor.h +++ b/include/ModelVisitor.h @@ -47,7 +47,7 @@ public: virtual void visit(FloatModel& m); virtual void visit(ComboBoxModel& m); virtual void visit(TempoSyncKnobModel& m); - virtual ~ModelVisitor(); + virtual ~ModelVisitor() = default; }; class ConstModelVisitor @@ -62,7 +62,7 @@ public: virtual void visit(const FloatModel& m); virtual void visit(const ComboBoxModel& m); virtual void visit(const TempoSyncKnobModel& m); - virtual ~ConstModelVisitor(); + virtual ~ConstModelVisitor() = default; }; diff --git a/include/PatternEditor.h b/include/PatternEditor.h index 15b141580..ffe08e335 100644 --- a/include/PatternEditor.h +++ b/include/PatternEditor.h @@ -80,7 +80,7 @@ class PatternEditorWindow : public Editor Q_OBJECT public: PatternEditorWindow(PatternStore* ps); - ~PatternEditorWindow(); + ~PatternEditorWindow() = default; QSize sizeHint() const override; diff --git a/include/PatternStore.h b/include/PatternStore.h index 58791e40d..7bd377941 100644 --- a/include/PatternStore.h +++ b/include/PatternStore.h @@ -68,7 +68,7 @@ class LMMS_EXPORT PatternStore : public TrackContainer mapPropertyFromModel(int, currentPattern, setCurrentPattern, m_patternComboBoxModel); public: PatternStore(); - ~PatternStore() override; + ~PatternStore() override = default; virtual bool play(TimePos start, const fpp_t frames, const f_cnt_t frameBase, int clipNum = -1); diff --git a/include/PeakController.h b/include/PeakController.h index 2999c5a2b..d8f721ea7 100644 --- a/include/PeakController.h +++ b/include/PeakController.h @@ -92,7 +92,7 @@ class PeakControllerDialog : public ControllerDialog Q_OBJECT public: PeakControllerDialog( Controller * _controller, QWidget * _parent ); - ~PeakControllerDialog() override; + ~PeakControllerDialog() override = default; protected: void contextMenuEvent( QContextMenuEvent * _me ) override; diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 3d74a79d6..60cf01e1d 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -298,7 +298,7 @@ private: PianoRoll(); PianoRoll( const PianoRoll & ); - ~PianoRoll() override; + ~PianoRoll() override = default; void autoScroll(const TimePos & t ); diff --git a/include/PixmapButton.h b/include/PixmapButton.h index ec5ac1b28..6c37f9112 100644 --- a/include/PixmapButton.h +++ b/include/PixmapButton.h @@ -40,7 +40,7 @@ class LMMS_EXPORT PixmapButton : public AutomatableButton public: PixmapButton( QWidget * _parent, const QString & _name = QString() ); - ~PixmapButton() override; + ~PixmapButton() override = default; void setActiveGraphic( const QPixmap & _pm ); void setInactiveGraphic( const QPixmap & _pm, bool _update = true ); diff --git a/include/Plugin.h b/include/Plugin.h index da2deeaed..43164e0a5 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -187,9 +187,7 @@ public: { } - virtual ~SubPluginFeatures() - { - } + virtual ~SubPluginFeatures() = default; virtual void fillDescriptionWidget( QWidget *, const Key * ) const { @@ -244,7 +242,7 @@ public: //! See the key() function Plugin(const Descriptor * descriptor, Model * parent, const Descriptor::SubPluginFeatures::Key *key = nullptr); - ~Plugin() override; + ~Plugin() override = default; //! Return display-name out of sub plugin or descriptor QString displayName() const override; diff --git a/include/PluginFactory.h b/include/PluginFactory.h index c0e2ff8e0..2aa618f25 100644 --- a/include/PluginFactory.h +++ b/include/PluginFactory.h @@ -57,7 +57,7 @@ public: typedef QMultiMap DescriptorMap; PluginFactory(); - ~PluginFactory(); + ~PluginFactory() = default; static void setupSearchPaths(); diff --git a/include/ProjectJournal.h b/include/ProjectJournal.h index 69e0752cb..25207867b 100644 --- a/include/ProjectJournal.h +++ b/include/ProjectJournal.h @@ -46,7 +46,7 @@ public: static const int MAX_UNDO_STATES; ProjectJournal(); - virtual ~ProjectJournal(); + virtual ~ProjectJournal() = default; void undo(); void redo(); diff --git a/include/ProjectNotes.h b/include/ProjectNotes.h index 384f24f79..4b9476616 100644 --- a/include/ProjectNotes.h +++ b/include/ProjectNotes.h @@ -44,7 +44,7 @@ class LMMS_EXPORT ProjectNotes : public QMainWindow, public SerializingObject Q_OBJECT public: ProjectNotes(); - ~ProjectNotes() override; + ~ProjectNotes() override = default; void clear(); void setText( const QString & _text ); diff --git a/include/ProjectRenderer.h b/include/ProjectRenderer.h index 9fa0bc507..75537ed69 100644 --- a/include/ProjectRenderer.h +++ b/include/ProjectRenderer.h @@ -64,7 +64,7 @@ public: const OutputSettings & _os, ExportFileFormats _file_format, const QString & _out_file ); - ~ProjectRenderer() override; + ~ProjectRenderer() override = default; bool isReady() const { diff --git a/include/RemotePluginBase.h b/include/RemotePluginBase.h index 2abe59132..c5bf35bcb 100644 --- a/include/RemotePluginBase.h +++ b/include/RemotePluginBase.h @@ -390,11 +390,7 @@ public: { } - message( const message & _m ) : - id( _m.id ), - data( _m.data ) - { - } + message( const message & _m ) = default; message( int _id ) : id( _id ), diff --git a/include/RenameDialog.h b/include/RenameDialog.h index f2a289ee0..b543963d7 100644 --- a/include/RenameDialog.h +++ b/include/RenameDialog.h @@ -40,7 +40,7 @@ class RenameDialog : public QDialog Q_OBJECT public: RenameDialog( QString & _string ); - ~RenameDialog() override; + ~RenameDialog() override = default; protected: diff --git a/include/Rubberband.h b/include/Rubberband.h index b00d10dd6..d35233b4f 100644 --- a/include/Rubberband.h +++ b/include/Rubberband.h @@ -44,9 +44,7 @@ public: { } - ~selectableObject() override - { - } + ~selectableObject() override = default; inline void setSelected(bool selected) { @@ -80,7 +78,7 @@ class RubberBand : public QRubberBand { public: RubberBand( QWidget * _parent ); - ~RubberBand() override; + ~RubberBand() override = default; QVector selectedObjects() const; QVector selectableObjects() const; diff --git a/include/SampleTrackWindow.h b/include/SampleTrackWindow.h index fb4e3f5e8..d302b2c44 100644 --- a/include/SampleTrackWindow.h +++ b/include/SampleTrackWindow.h @@ -50,7 +50,7 @@ class SampleTrackWindow : public QWidget, public ModelView, public SerializingOb Q_OBJECT public: SampleTrackWindow(SampleTrackView * tv); - ~SampleTrackWindow() override; + ~SampleTrackWindow() override = default; SampleTrack * model() { diff --git a/include/SideBar.h b/include/SideBar.h index ba9fe11a6..6f1b15770 100644 --- a/include/SideBar.h +++ b/include/SideBar.h @@ -42,7 +42,7 @@ class SideBar : public QToolBar Q_OBJECT public: SideBar( Qt::Orientation _orientation, QWidget * _parent ); - ~SideBar() override; + ~SideBar() override = default; void appendTab( SideBarWidget * _sbw ); diff --git a/include/SideBarWidget.h b/include/SideBarWidget.h index 4b7ff4b2d..5df3ccb7a 100644 --- a/include/SideBarWidget.h +++ b/include/SideBarWidget.h @@ -41,7 +41,7 @@ class SideBarWidget : public QWidget public: SideBarWidget( const QString & _title, const QPixmap & _icon, QWidget * _parent ); - ~SideBarWidget() override; + ~SideBarWidget() override = default; inline const QPixmap & icon() const { diff --git a/include/SongEditor.h b/include/SongEditor.h index b848fe776..ea57cc125 100644 --- a/include/SongEditor.h +++ b/include/SongEditor.h @@ -66,7 +66,7 @@ public: }; SongEditor( Song * song ); - ~SongEditor() override; + ~SongEditor() override = default; void saveSettings( QDomDocument& doc, QDomElement& element ) override; void loadSettings( const QDomElement& element ) override; diff --git a/include/SweepOscillator.h b/include/SweepOscillator.h index 2e795be3b..f113ea0fa 100644 --- a/include/SweepOscillator.h +++ b/include/SweepOscillator.h @@ -41,9 +41,7 @@ public: { } - virtual ~SweepOscillator() - { - } + virtual ~SweepOscillator() = default; void update( sampleFrame* buf, const fpp_t frames, const float freq1, const float freq2, const float sampleRate ) { diff --git a/include/TabButton.h b/include/TabButton.h index 6d58cc10e..938230a91 100644 --- a/include/TabButton.h +++ b/include/TabButton.h @@ -45,9 +45,7 @@ public: SLOT( slotClicked() ) ); } - ~TabButton() override - { - } + ~TabButton() override = default; signals: diff --git a/include/TempoSyncKnobModel.h b/include/TempoSyncKnobModel.h index 1e6decfb9..1a18486ff 100644 --- a/include/TempoSyncKnobModel.h +++ b/include/TempoSyncKnobModel.h @@ -63,7 +63,7 @@ public: const float _max, const float _step, const float _scale, Model * _parent, const QString & _display_name = QString() ); - ~TempoSyncKnobModel() override; + ~TempoSyncKnobModel() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _this, const QString& name ) override; void loadSettings( const QDomElement & _this, const QString& name ) override; diff --git a/include/TextFloat.h b/include/TextFloat.h index 8a5ad9685..9fdabc06b 100644 --- a/include/TextFloat.h +++ b/include/TextFloat.h @@ -39,9 +39,7 @@ class LMMS_EXPORT TextFloat : public QWidget Q_OBJECT public: TextFloat(); - ~TextFloat() override - { - } + ~TextFloat() override = default; void setTitle( const QString & _title ); void setText( const QString & _text ); diff --git a/include/ToolPlugin.h b/include/ToolPlugin.h index 311757cf4..38f4d87b1 100644 --- a/include/ToolPlugin.h +++ b/include/ToolPlugin.h @@ -38,7 +38,7 @@ class LMMS_EXPORT ToolPlugin : public Plugin { public: ToolPlugin( const Descriptor * _descriptor, Model * _parent ); - ~ToolPlugin() override; + ~ToolPlugin() override = default; // instantiate tool-plugin with given name or return NULL // on failure diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index 7d9a648aa..7bc367c37 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -184,7 +184,7 @@ private: { public: scrollArea( TrackContainerView* parent ); - ~scrollArea() override; + ~scrollArea() override = default; protected: void wheelEvent( QWheelEvent * _we ) override; diff --git a/include/TrackContentWidget.h b/include/TrackContentWidget.h index 4fad4ceb0..bde2de33e 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -56,7 +56,7 @@ class TrackContentWidget : public QWidget, public JournallingObject public: TrackContentWidget( TrackView * parent ); - ~TrackContentWidget() override; + ~TrackContentWidget() override = default; /*! \brief Updates the background tile pixmap. */ void updateBackground(); diff --git a/include/TrackLabelButton.h b/include/TrackLabelButton.h index 30dd60d59..1a8d05e71 100644 --- a/include/TrackLabelButton.h +++ b/include/TrackLabelButton.h @@ -41,7 +41,7 @@ class TrackLabelButton : public QToolButton Q_OBJECT public: TrackLabelButton( TrackView * _tv, QWidget * _parent ); - ~TrackLabelButton() override; + ~TrackLabelButton() override = default; public slots: diff --git a/include/TrackOperationsWidget.h b/include/TrackOperationsWidget.h index 08b3e599e..edd9796ac 100644 --- a/include/TrackOperationsWidget.h +++ b/include/TrackOperationsWidget.h @@ -40,7 +40,7 @@ class TrackOperationsWidget : public QWidget Q_OBJECT public: TrackOperationsWidget( TrackView * parent ); - ~TrackOperationsWidget() override; + ~TrackOperationsWidget() override = default; protected: diff --git a/include/TrackView.h b/include/TrackView.h index f98579201..4b02c8015 100644 --- a/include/TrackView.h +++ b/include/TrackView.h @@ -64,7 +64,7 @@ class TrackView : public QWidget, public ModelView, public JournallingObject Q_OBJECT public: TrackView( Track * _track, TrackContainerView* tcv ); - ~TrackView() override; + ~TrackView() override = default; inline const Track * getTrack() const { diff --git a/include/ValueBuffer.h b/include/ValueBuffer.h index 24c8e0daa..950ad06f0 100644 --- a/include/ValueBuffer.h +++ b/include/ValueBuffer.h @@ -39,7 +39,7 @@ class LMMS_EXPORT ValueBuffer : public std::vector { MM_OPERATORS public: - ValueBuffer(); + ValueBuffer() = default; ValueBuffer(int length); void fill(float value); diff --git a/include/embed.h b/include/embed.h index d26fd643a..c8914ba47 100644 --- a/include/embed.h +++ b/include/embed.h @@ -96,9 +96,7 @@ public: return( QPixmap() ); } - virtual ~PixmapLoader() - { - } + virtual ~PixmapLoader() = default; virtual QString pixmapName() const { diff --git a/include/shared_object.h b/include/shared_object.h index e68186336..ac45d6cd7 100644 --- a/include/shared_object.h +++ b/include/shared_object.h @@ -39,9 +39,7 @@ public: { } - virtual ~sharedObject() - { - } + virtual ~sharedObject() = default; template static T* ref( T* object ) diff --git a/plugins/Amplifier/Amplifier.cpp b/plugins/Amplifier/Amplifier.cpp index 1212bcd6a..3fb03d3d9 100644 --- a/plugins/Amplifier/Amplifier.cpp +++ b/plugins/Amplifier/Amplifier.cpp @@ -60,9 +60,6 @@ AmplifierEffect::AmplifierEffect( Model* parent, const Descriptor::SubPluginFeat -AmplifierEffect::~AmplifierEffect() -{ -} diff --git a/plugins/Amplifier/Amplifier.h b/plugins/Amplifier/Amplifier.h index cc973cc27..38fd07c6f 100644 --- a/plugins/Amplifier/Amplifier.h +++ b/plugins/Amplifier/Amplifier.h @@ -37,7 +37,7 @@ class AmplifierEffect : public Effect { public: AmplifierEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ); - ~AmplifierEffect() override; + ~AmplifierEffect() override = default; bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ) override; EffectControls* controls() override diff --git a/plugins/Amplifier/AmplifierControlDialog.h b/plugins/Amplifier/AmplifierControlDialog.h index fd2c7a338..ad0ed50ca 100644 --- a/plugins/Amplifier/AmplifierControlDialog.h +++ b/plugins/Amplifier/AmplifierControlDialog.h @@ -42,9 +42,7 @@ class AmplifierControlDialog : public EffectControlDialog Q_OBJECT public: AmplifierControlDialog( AmplifierControls* controls ); - ~AmplifierControlDialog() override - { - } + ~AmplifierControlDialog() override = default; } ; diff --git a/plugins/Amplifier/AmplifierControls.h b/plugins/Amplifier/AmplifierControls.h index 6382b27fe..573f6f896 100644 --- a/plugins/Amplifier/AmplifierControls.h +++ b/plugins/Amplifier/AmplifierControls.h @@ -45,9 +45,7 @@ class AmplifierControls : public EffectControls Q_OBJECT public: AmplifierControls( AmplifierEffect* effect ); - ~AmplifierControls() override - { - } + ~AmplifierControls() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.cpp b/plugins/AudioFileProcessor/AudioFileProcessor.cpp index 3d4319dd3..9f01a6499 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessor.cpp @@ -559,9 +559,6 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument, -AudioFileProcessorView::~AudioFileProcessorView() -{ -} diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.h b/plugins/AudioFileProcessor/AudioFileProcessor.h index 30fcbc502..18edd2b4a 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.h +++ b/plugins/AudioFileProcessor/AudioFileProcessor.h @@ -130,7 +130,7 @@ class AudioFileProcessorView : public gui::InstrumentViewFixedSize Q_OBJECT public: AudioFileProcessorView( Instrument * _instrument, QWidget * _parent ); - virtual ~AudioFileProcessorView(); + virtual ~AudioFileProcessorView() = default; void newWaveView(); protected slots: diff --git a/plugins/BassBooster/BassBooster.cpp b/plugins/BassBooster/BassBooster.cpp index 280accddb..77667c121 100644 --- a/plugins/BassBooster/BassBooster.cpp +++ b/plugins/BassBooster/BassBooster.cpp @@ -65,9 +65,6 @@ BassBoosterEffect::BassBoosterEffect( Model* parent, const Descriptor::SubPlugin -BassBoosterEffect::~BassBoosterEffect() -{ -} diff --git a/plugins/BassBooster/BassBooster.h b/plugins/BassBooster/BassBooster.h index 19eb9c50e..ea3ba2d98 100644 --- a/plugins/BassBooster/BassBooster.h +++ b/plugins/BassBooster/BassBooster.h @@ -37,7 +37,7 @@ class BassBoosterEffect : public Effect { public: BassBoosterEffect( Model* parent, const Descriptor::SubPluginFeatures::Key* key ); - ~BassBoosterEffect() override; + ~BassBoosterEffect() override = default; bool processAudioBuffer( sampleFrame* buf, const fpp_t frames ) override; EffectControls* controls() override diff --git a/plugins/BassBooster/BassBoosterControlDialog.h b/plugins/BassBooster/BassBoosterControlDialog.h index 968db7e60..6c510282e 100644 --- a/plugins/BassBooster/BassBoosterControlDialog.h +++ b/plugins/BassBooster/BassBoosterControlDialog.h @@ -40,9 +40,7 @@ class BassBoosterControlDialog : public EffectControlDialog Q_OBJECT public: BassBoosterControlDialog( BassBoosterControls* controls ); - ~BassBoosterControlDialog() override - { - } + ~BassBoosterControlDialog() override = default; } ; diff --git a/plugins/BassBooster/BassBoosterControls.h b/plugins/BassBooster/BassBoosterControls.h index 099862a02..bd93a5eb7 100644 --- a/plugins/BassBooster/BassBoosterControls.h +++ b/plugins/BassBooster/BassBoosterControls.h @@ -39,9 +39,7 @@ class BassBoosterControls : public EffectControls Q_OBJECT public: BassBoosterControls( BassBoosterEffect* effect ); - ~BassBoosterControls() override - { - } + ~BassBoosterControls() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/plugins/BitInvader/BitInvader.cpp b/plugins/BitInvader/BitInvader.cpp index 0bf063461..e319a9c24 100644 --- a/plugins/BitInvader/BitInvader.cpp +++ b/plugins/BitInvader/BitInvader.cpp @@ -171,10 +171,6 @@ BitInvader::BitInvader( InstrumentTrack * _instrument_track ) : -BitInvader::~BitInvader() -{ -} - diff --git a/plugins/BitInvader/BitInvader.h b/plugins/BitInvader/BitInvader.h index debdd37ea..a08640e99 100644 --- a/plugins/BitInvader/BitInvader.h +++ b/plugins/BitInvader/BitInvader.h @@ -74,7 +74,7 @@ class BitInvader : public Instrument Q_OBJECT public: BitInvader(InstrumentTrack * _instrument_track ); - ~BitInvader() override; + ~BitInvader() override = default; void playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) override; @@ -124,7 +124,7 @@ public: BitInvaderView( Instrument * _instrument, QWidget * _parent ); - ~BitInvaderView() override {}; + ~BitInvaderView() override = default; protected slots: //void sampleSizeChanged( float _new_sample_length ); diff --git a/plugins/Bitcrush/BitcrushControlDialog.h b/plugins/Bitcrush/BitcrushControlDialog.h index 9649d50f2..ac409c0ab 100644 --- a/plugins/Bitcrush/BitcrushControlDialog.h +++ b/plugins/Bitcrush/BitcrushControlDialog.h @@ -43,9 +43,7 @@ class BitcrushControlDialog : public EffectControlDialog Q_OBJECT public: BitcrushControlDialog( BitcrushControls * controls ); - ~BitcrushControlDialog() override - { - } + ~BitcrushControlDialog() override = default; }; diff --git a/plugins/Bitcrush/BitcrushControls.cpp b/plugins/Bitcrush/BitcrushControls.cpp index 9acd7d7c0..163c2c924 100644 --- a/plugins/Bitcrush/BitcrushControls.cpp +++ b/plugins/Bitcrush/BitcrushControls.cpp @@ -53,9 +53,6 @@ BitcrushControls::BitcrushControls( BitcrushEffect * eff ) : connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), this, SLOT( sampleRateChanged() ) ); } -BitcrushControls::~BitcrushControls() -{ -} void BitcrushControls::saveSettings( QDomDocument & doc, QDomElement & elem ) { diff --git a/plugins/Bitcrush/BitcrushControls.h b/plugins/Bitcrush/BitcrushControls.h index 963fb298e..7514baae9 100644 --- a/plugins/Bitcrush/BitcrushControls.h +++ b/plugins/Bitcrush/BitcrushControls.h @@ -40,7 +40,7 @@ class BitcrushControls : public EffectControls Q_OBJECT public: BitcrushControls( BitcrushEffect * eff ); - ~BitcrushControls() override; + ~BitcrushControls() override = default; void saveSettings( QDomDocument & doc, QDomElement & elem ) override; void loadSettings( const QDomElement & elem ) override; diff --git a/plugins/Compressor/Compressor.cpp b/plugins/Compressor/Compressor.cpp index bf6928e21..312a40d3d 100755 --- a/plugins/Compressor/Compressor.cpp +++ b/plugins/Compressor/Compressor.cpp @@ -97,11 +97,6 @@ CompressorEffect::CompressorEffect(Model* parent, const Descriptor::SubPluginFea -CompressorEffect::~CompressorEffect() -{ -} - - float CompressorEffect::msToCoeff(float ms) { // Convert time in milliseconds to applicable lowpass coefficient diff --git a/plugins/Compressor/Compressor.h b/plugins/Compressor/Compressor.h index 9b81d9b70..121e0b88f 100755 --- a/plugins/Compressor/Compressor.h +++ b/plugins/Compressor/Compressor.h @@ -42,7 +42,7 @@ class CompressorEffect : public Effect Q_OBJECT public: CompressorEffect(Model* parent, const Descriptor::SubPluginFeatures::Key* key); - ~CompressorEffect() override; + ~CompressorEffect() override = default; bool processAudioBuffer(sampleFrame* buf, const fpp_t frames) override; EffectControls* controls() override diff --git a/plugins/CrossoverEQ/CrossoverEQControlDialog.h b/plugins/CrossoverEQ/CrossoverEQControlDialog.h index bad64a8bb..9ddb5d9bf 100644 --- a/plugins/CrossoverEQ/CrossoverEQControlDialog.h +++ b/plugins/CrossoverEQ/CrossoverEQControlDialog.h @@ -45,9 +45,7 @@ class CrossoverEQControlDialog : public EffectControlDialog Q_OBJECT public: CrossoverEQControlDialog( CrossoverEQControls * controls ); - ~CrossoverEQControlDialog() override - { - } + ~CrossoverEQControlDialog() override = default; private: QPixmap m_fader_bg; diff --git a/plugins/CrossoverEQ/CrossoverEQControls.h b/plugins/CrossoverEQ/CrossoverEQControls.h index 458300d89..715311aba 100644 --- a/plugins/CrossoverEQ/CrossoverEQControls.h +++ b/plugins/CrossoverEQ/CrossoverEQControls.h @@ -40,7 +40,7 @@ class CrossoverEQControls : public EffectControls Q_OBJECT public: CrossoverEQControls( CrossoverEQEffect * eff ); - ~CrossoverEQControls() override {} + ~CrossoverEQControls() override = default; void saveSettings( QDomDocument & doc, QDomElement & elem ) override; void loadSettings( const QDomElement & elem ) override; diff --git a/plugins/Delay/DelayControls.h b/plugins/Delay/DelayControls.h index 3d9393b76..b9eb663fc 100644 --- a/plugins/Delay/DelayControls.h +++ b/plugins/Delay/DelayControls.h @@ -40,9 +40,7 @@ class DelayControls : public EffectControls Q_OBJECT public: DelayControls( DelayEffect* effect ); - ~DelayControls() override - { - } + ~DelayControls() override = default; void saveSettings( QDomDocument& doc, QDomElement& parent ) override; void loadSettings( const QDomElement& _this ) override; inline QString nodeName() const override diff --git a/plugins/Delay/DelayControlsDialog.h b/plugins/Delay/DelayControlsDialog.h index 115287cda..c7ab58f45 100644 --- a/plugins/Delay/DelayControlsDialog.h +++ b/plugins/Delay/DelayControlsDialog.h @@ -42,9 +42,7 @@ class DelayControlsDialog : public EffectControlDialog Q_OBJECT public: DelayControlsDialog( DelayControls* controls ); - ~DelayControlsDialog() override - { - } + ~DelayControlsDialog() override = default; }; class XyPad : public QWidget @@ -52,7 +50,7 @@ class XyPad : public QWidget Q_OBJECT public: XyPad( QWidget *parent = 0, FloatModel *xModel = 0, FloatModel *yModel = 0 ); - ~XyPad() override {} + ~XyPad() override = default; protected: void paintEvent ( QPaintEvent * event ) override; diff --git a/plugins/Delay/Lfo.h b/plugins/Delay/Lfo.h index cb2d13f11..ea8435d13 100644 --- a/plugins/Delay/Lfo.h +++ b/plugins/Delay/Lfo.h @@ -36,9 +36,7 @@ class Lfo { public: Lfo( int samplerate ); - ~Lfo() - { - } + ~Lfo() = default; diff --git a/plugins/DualFilter/DualFilterControlDialog.h b/plugins/DualFilter/DualFilterControlDialog.h index 88b3fe17a..629eb2d9a 100644 --- a/plugins/DualFilter/DualFilterControlDialog.h +++ b/plugins/DualFilter/DualFilterControlDialog.h @@ -43,9 +43,7 @@ class DualFilterControlDialog : public EffectControlDialog Q_OBJECT public: DualFilterControlDialog( DualFilterControls* controls ); - ~DualFilterControlDialog() override - { - } + ~DualFilterControlDialog() override = default; } ; diff --git a/plugins/DualFilter/DualFilterControls.h b/plugins/DualFilter/DualFilterControls.h index a3676295d..379f96e32 100644 --- a/plugins/DualFilter/DualFilterControls.h +++ b/plugins/DualFilter/DualFilterControls.h @@ -42,9 +42,7 @@ class DualFilterControls : public EffectControls Q_OBJECT public: DualFilterControls( DualFilterEffect* effect ); - ~DualFilterControls() override - { - } + ~DualFilterControls() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h b/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h index 8b755620e..37608d4a3 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h +++ b/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.h @@ -43,9 +43,7 @@ class DynProcControlDialog : public EffectControlDialog Q_OBJECT public: DynProcControlDialog( DynProcControls * _controls ); - ~DynProcControlDialog() override - { - } + ~DynProcControlDialog() override = default; private: diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControls.h b/plugins/DynamicsProcessor/DynamicsProcessorControls.h index c68bdcc0c..cbe109eaf 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessorControls.h +++ b/plugins/DynamicsProcessor/DynamicsProcessorControls.h @@ -49,9 +49,7 @@ public: NumStereoModes }; DynProcControls( DynProcEffect * _eff ); - ~DynProcControls() override - { - } + ~DynProcControls() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/plugins/Eq/EqControls.h b/plugins/Eq/EqControls.h index 9b0d67742..6db82f3e3 100644 --- a/plugins/Eq/EqControls.h +++ b/plugins/Eq/EqControls.h @@ -44,9 +44,7 @@ class EqControls : public EffectControls Q_OBJECT public: explicit EqControls( EqEffect* effect ); - ~EqControls() override - { - } + ~EqControls() override = default; void saveSettings ( QDomDocument& doc, QDomElement& parent ) override; diff --git a/plugins/Eq/EqControlsDialog.h b/plugins/Eq/EqControlsDialog.h index 1ec7e3e9a..52bb2ae19 100644 --- a/plugins/Eq/EqControlsDialog.h +++ b/plugins/Eq/EqControlsDialog.h @@ -47,9 +47,7 @@ class EqControlsDialog : public EffectControlDialog Q_OBJECT public: EqControlsDialog( EqControls * controls ); - ~EqControlsDialog() override - { - } + ~EqControlsDialog() override = default; EqBand * setBand( EqControls * controls ); diff --git a/plugins/Eq/EqEffect.cpp b/plugins/Eq/EqEffect.cpp index 12a10061b..be74defba 100644 --- a/plugins/Eq/EqEffect.cpp +++ b/plugins/Eq/EqEffect.cpp @@ -64,13 +64,6 @@ EqEffect::EqEffect( Model *parent, const Plugin::Descriptor::SubPluginFeatures:: -EqEffect::~EqEffect() -{ -} - - - - bool EqEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames ) { const int sampleRate = Engine::audioEngine()->processingSampleRate(); diff --git a/plugins/Eq/EqEffect.h b/plugins/Eq/EqEffect.h index e3bf6fd54..2d54c42a2 100644 --- a/plugins/Eq/EqEffect.h +++ b/plugins/Eq/EqEffect.h @@ -36,7 +36,7 @@ class EqEffect : public Effect { public: EqEffect( Model * parent , const Descriptor::SubPluginFeatures::Key * key ); - ~EqEffect() override; + ~EqEffect() override = default; bool processAudioBuffer( sampleFrame * buf, const fpp_t frames ) override; EffectControls * controls() override { diff --git a/plugins/Eq/EqFader.h b/plugins/Eq/EqFader.h index aec6a9e18..9db0fbe2d 100644 --- a/plugins/Eq/EqFader.h +++ b/plugins/Eq/EqFader.h @@ -72,9 +72,7 @@ public: - ~EqFader() override - { - } + ~EqFader() override = default; private slots: diff --git a/plugins/Eq/EqSpectrumView.h b/plugins/Eq/EqSpectrumView.h index f0a8fda3c..947c55434 100644 --- a/plugins/Eq/EqSpectrumView.h +++ b/plugins/Eq/EqSpectrumView.h @@ -74,9 +74,7 @@ class EqSpectrumView : public QWidget Q_OBJECT public: explicit EqSpectrumView( EqAnalyser *b, QWidget *_parent = 0 ); - ~EqSpectrumView() override - { - } + ~EqSpectrumView() override = default; QColor getColor() const; void setColor( const QColor &value ); diff --git a/plugins/Flanger/FlangerControls.h b/plugins/Flanger/FlangerControls.h index b004e5e33..079497962 100644 --- a/plugins/Flanger/FlangerControls.h +++ b/plugins/Flanger/FlangerControls.h @@ -39,9 +39,7 @@ class FlangerControls : public EffectControls Q_OBJECT public: FlangerControls( FlangerEffect* effect ); - ~FlangerControls() override - { - } + ~FlangerControls() override = default; void saveSettings ( QDomDocument& doc, QDomElement& parent ) override; void loadSettings ( const QDomElement &_this ) override; inline QString nodeName() const override diff --git a/plugins/Flanger/FlangerControlsDialog.h b/plugins/Flanger/FlangerControlsDialog.h index 587046ad7..47f746ef3 100644 --- a/plugins/Flanger/FlangerControlsDialog.h +++ b/plugins/Flanger/FlangerControlsDialog.h @@ -42,9 +42,7 @@ class FlangerControlsDialog : public EffectControlDialog Q_OBJECT public: FlangerControlsDialog( FlangerControls* controls ); - ~FlangerControlsDialog() override - { - } + ~FlangerControlsDialog() override = default; }; diff --git a/plugins/FreeBoy/FreeBoy.cpp b/plugins/FreeBoy/FreeBoy.cpp index 9f7085444..3829d691a 100644 --- a/plugins/FreeBoy/FreeBoy.cpp +++ b/plugins/FreeBoy/FreeBoy.cpp @@ -125,11 +125,6 @@ FreeBoyInstrument::FreeBoyInstrument( InstrumentTrack * _instrument_track ) : } -FreeBoyInstrument::~FreeBoyInstrument() -{ -} - - void FreeBoyInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this ) { @@ -684,11 +679,6 @@ FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument, } -FreeBoyInstrumentView::~FreeBoyInstrumentView() -{ -} - - void FreeBoyInstrumentView::modelChanged() { FreeBoyInstrument * p = castModel(); diff --git a/plugins/FreeBoy/FreeBoy.h b/plugins/FreeBoy/FreeBoy.h index 8b46a5e68..aecd2b188 100644 --- a/plugins/FreeBoy/FreeBoy.h +++ b/plugins/FreeBoy/FreeBoy.h @@ -52,7 +52,7 @@ class FreeBoyInstrument : public Instrument public: FreeBoyInstrument( InstrumentTrack * _instrument_track ); - ~FreeBoyInstrument() override; + ~FreeBoyInstrument() override = default; void playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) override; @@ -129,7 +129,7 @@ class FreeBoyInstrumentView : public InstrumentViewFixedSize Q_OBJECT public: FreeBoyInstrumentView( Instrument * _instrument, QWidget * _parent ); - ~FreeBoyInstrumentView() override; + ~FreeBoyInstrumentView() override = default; private: void modelChanged() override; diff --git a/plugins/FreeBoy/Gb_Apu_Buffer.cpp b/plugins/FreeBoy/Gb_Apu_Buffer.cpp index f261bc9c0..ec1a36479 100644 --- a/plugins/FreeBoy/Gb_Apu_Buffer.cpp +++ b/plugins/FreeBoy/Gb_Apu_Buffer.cpp @@ -26,9 +26,6 @@ namespace lmms { -Gb_Apu_Buffer::Gb_Apu_Buffer() {} -Gb_Apu_Buffer::~Gb_Apu_Buffer() {} - void Gb_Apu_Buffer::end_frame(blip_time_t end_time) { Gb_Apu::end_frame(end_time); m_buf.end_frame(end_time); diff --git a/plugins/FreeBoy/Gb_Apu_Buffer.h b/plugins/FreeBoy/Gb_Apu_Buffer.h index 0b025bea0..980dfa3e5 100644 --- a/plugins/FreeBoy/Gb_Apu_Buffer.h +++ b/plugins/FreeBoy/Gb_Apu_Buffer.h @@ -34,8 +34,8 @@ namespace lmms class Gb_Apu_Buffer : public Gb_Apu { MM_OPERATORS public: - Gb_Apu_Buffer(); - ~Gb_Apu_Buffer(); + Gb_Apu_Buffer() = default; + ~Gb_Apu_Buffer() = default; void end_frame(blip_time_t); diff --git a/plugins/GigPlayer/GigPlayer.cpp b/plugins/GigPlayer/GigPlayer.cpp index 81a571ac7..5a6f39cc6 100644 --- a/plugins/GigPlayer/GigPlayer.cpp +++ b/plugins/GigPlayer/GigPlayer.cpp @@ -988,13 +988,6 @@ GigInstrumentView::GigInstrumentView( Instrument * _instrument, QWidget * _paren -GigInstrumentView::~GigInstrumentView() -{ -} - - - - void GigInstrumentView::modelChanged() { GigInstrument * k = castModel(); diff --git a/plugins/GigPlayer/GigPlayer.h b/plugins/GigPlayer/GigPlayer.h index 5adeddc3e..20058424b 100644 --- a/plugins/GigPlayer/GigPlayer.h +++ b/plugins/GigPlayer/GigPlayer.h @@ -352,7 +352,7 @@ class GigInstrumentView : public InstrumentViewFixedSize public: GigInstrumentView( Instrument * _instrument, QWidget * _parent ); - ~GigInstrumentView() override; + ~GigInstrumentView() override = default; private: void modelChanged() override; diff --git a/plugins/GigPlayer/PatchesDialog.cpp b/plugins/GigPlayer/PatchesDialog.cpp index 3f7035c61..c78c99f2c 100644 --- a/plugins/GigPlayer/PatchesDialog.cpp +++ b/plugins/GigPlayer/PatchesDialog.cpp @@ -107,14 +107,6 @@ PatchesDialog::PatchesDialog( QWidget * pParent, Qt::WindowFlags wflags ) -// Destructor. -PatchesDialog::~PatchesDialog() -{ -} - - - - // Dialog setup loader. void PatchesDialog::setup( GigInstance * pSynth, int iChan, const QString & chanName, diff --git a/plugins/GigPlayer/PatchesDialog.h b/plugins/GigPlayer/PatchesDialog.h index 4912f2bc1..c4aed9102 100644 --- a/plugins/GigPlayer/PatchesDialog.h +++ b/plugins/GigPlayer/PatchesDialog.h @@ -50,7 +50,7 @@ public: PatchesDialog(QWidget * pParent = 0, Qt::WindowFlags wflags = QFlag(0)); // Destructor. - ~PatchesDialog() override; + ~PatchesDialog() override = default; void setup( GigInstance * pSynth, int iChan, const QString & chanName, diff --git a/plugins/HydrogenImport/HydrogenImport.cpp b/plugins/HydrogenImport/HydrogenImport.cpp index 657597471..2f3a27e1f 100644 --- a/plugins/HydrogenImport/HydrogenImport.cpp +++ b/plugins/HydrogenImport/HydrogenImport.cpp @@ -134,9 +134,6 @@ HydrogenImport::HydrogenImport( const QString & _file ) : -HydrogenImport::~HydrogenImport() -{ -} Instrument * ins; bool HydrogenImport::readSong() { diff --git a/plugins/HydrogenImport/HydrogenImport.h b/plugins/HydrogenImport/HydrogenImport.h index a9398d18f..de4709051 100644 --- a/plugins/HydrogenImport/HydrogenImport.h +++ b/plugins/HydrogenImport/HydrogenImport.h @@ -15,7 +15,7 @@ public: HydrogenImport( const QString & _file ); bool readSong(); - ~HydrogenImport() override; + ~HydrogenImport() override = default; gui::PluginView* instantiateView( QWidget * ) override { diff --git a/plugins/Kicker/Kicker.cpp b/plugins/Kicker/Kicker.cpp index 6a3c0823a..f9f781aed 100644 --- a/plugins/Kicker/Kicker.cpp +++ b/plugins/Kicker/Kicker.cpp @@ -85,13 +85,6 @@ KickerInstrument::KickerInstrument( InstrumentTrack * _instrument_track ) : -KickerInstrument::~KickerInstrument() -{ -} - - - - void KickerInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this ) { @@ -342,13 +335,6 @@ KickerInstrumentView::KickerInstrumentView( Instrument * _instrument, -KickerInstrumentView::~KickerInstrumentView() -{ -} - - - - void KickerInstrumentView::modelChanged() { KickerInstrument * k = castModel(); diff --git a/plugins/Kicker/Kicker.h b/plugins/Kicker/Kicker.h index 10c77fe0f..22413c4db 100644 --- a/plugins/Kicker/Kicker.h +++ b/plugins/Kicker/Kicker.h @@ -54,7 +54,7 @@ class KickerInstrument : public Instrument Q_OBJECT public: KickerInstrument( InstrumentTrack * _instrument_track ); - ~KickerInstrument() override; + ~KickerInstrument() override = default; void playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) override; @@ -109,7 +109,7 @@ class KickerInstrumentView : public InstrumentViewFixedSize Q_OBJECT public: KickerInstrumentView( Instrument * _instrument, QWidget * _parent ); - ~KickerInstrumentView() override; + ~KickerInstrumentView() override = default; private: void modelChanged() override; diff --git a/plugins/Kicker/KickerOsc.h b/plugins/Kicker/KickerOsc.h index 3a263ffc8..1accb50a4 100644 --- a/plugins/Kicker/KickerOsc.h +++ b/plugins/Kicker/KickerOsc.h @@ -60,9 +60,7 @@ public: { } - virtual ~KickerOsc() - { - } + virtual ~KickerOsc() = default; void update( sampleFrame* buf, const fpp_t frames, const float sampleRate ) { diff --git a/plugins/LadspaBrowser/LadspaBrowser.cpp b/plugins/LadspaBrowser/LadspaBrowser.cpp index cd10b47fd..503aa7443 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.cpp +++ b/plugins/LadspaBrowser/LadspaBrowser.cpp @@ -82,13 +82,6 @@ LadspaBrowser::LadspaBrowser() : -LadspaBrowser::~LadspaBrowser() -{ -} - - - - QString LadspaBrowser::nodeName() const { return ladspabrowser_plugin_descriptor.name; @@ -166,13 +159,6 @@ LadspaBrowserView::LadspaBrowserView( ToolPlugin * _tool ) : -LadspaBrowserView::~LadspaBrowserView() -{ -} - - - - QWidget * LadspaBrowserView::createTab( QWidget * _parent, const QString & _txt, LadspaPluginType _type ) { diff --git a/plugins/LadspaBrowser/LadspaBrowser.h b/plugins/LadspaBrowser/LadspaBrowser.h index 93533906e..faf1136dd 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.h +++ b/plugins/LadspaBrowser/LadspaBrowser.h @@ -46,7 +46,7 @@ class LadspaBrowserView : public ToolPluginView Q_OBJECT public: LadspaBrowserView( ToolPlugin * _tool ); - ~LadspaBrowserView() override; + ~LadspaBrowserView() override = default; public slots: @@ -69,7 +69,7 @@ class LadspaBrowser : public ToolPlugin { public: LadspaBrowser(); - ~LadspaBrowser() override; + ~LadspaBrowser() override = default; gui::PluginView* instantiateView( QWidget * ) override { diff --git a/plugins/LadspaBrowser/LadspaDescription.cpp b/plugins/LadspaBrowser/LadspaDescription.cpp index 5b2364d6f..b94490e52 100644 --- a/plugins/LadspaBrowser/LadspaDescription.cpp +++ b/plugins/LadspaBrowser/LadspaDescription.cpp @@ -116,13 +116,6 @@ LadspaDescription::LadspaDescription( QWidget * _parent, -LadspaDescription::~LadspaDescription() -{ -} - - - - void LadspaDescription::update( const ladspa_key_t & _key ) { QWidget * description = new QWidget; diff --git a/plugins/LadspaBrowser/LadspaDescription.h b/plugins/LadspaBrowser/LadspaDescription.h index 1d2b03fac..14fcf7d62 100644 --- a/plugins/LadspaBrowser/LadspaDescription.h +++ b/plugins/LadspaBrowser/LadspaDescription.h @@ -44,7 +44,7 @@ class LadspaDescription : public QWidget Q_OBJECT public: LadspaDescription( QWidget * _parent, LadspaPluginType _type ); - ~LadspaDescription() override; + ~LadspaDescription() override = default; signals: diff --git a/plugins/LadspaBrowser/LadspaPortDialog.cpp b/plugins/LadspaBrowser/LadspaPortDialog.cpp index ab542ce00..12706ca89 100644 --- a/plugins/LadspaBrowser/LadspaPortDialog.cpp +++ b/plugins/LadspaBrowser/LadspaPortDialog.cpp @@ -168,9 +168,4 @@ LadspaPortDialog::LadspaPortDialog( const ladspa_key_t & _key ) -LadspaPortDialog::~LadspaPortDialog() -{ -} - - } // namespace lmms::gui \ No newline at end of file diff --git a/plugins/LadspaBrowser/LadspaPortDialog.h b/plugins/LadspaBrowser/LadspaPortDialog.h index 3f7d83df7..946531de8 100644 --- a/plugins/LadspaBrowser/LadspaPortDialog.h +++ b/plugins/LadspaBrowser/LadspaPortDialog.h @@ -40,7 +40,7 @@ class LadspaPortDialog : public QDialog Q_OBJECT public: LadspaPortDialog( const ladspa_key_t & _key ); - ~LadspaPortDialog() override; + ~LadspaPortDialog() override = default; }; diff --git a/plugins/LadspaEffect/LadspaControlDialog.cpp b/plugins/LadspaEffect/LadspaControlDialog.cpp index 199982bb0..5774fcc11 100644 --- a/plugins/LadspaEffect/LadspaControlDialog.cpp +++ b/plugins/LadspaEffect/LadspaControlDialog.cpp @@ -67,13 +67,6 @@ LadspaControlDialog::LadspaControlDialog( LadspaControls * _ctl ) : -LadspaControlDialog::~LadspaControlDialog() -{ -} - - - - void LadspaControlDialog::updateEffectView( LadspaControls * _ctl ) { QList list = findChildren(); diff --git a/plugins/LadspaEffect/LadspaControlDialog.h b/plugins/LadspaEffect/LadspaControlDialog.h index 25df5ee11..8b7adb3aa 100644 --- a/plugins/LadspaEffect/LadspaControlDialog.h +++ b/plugins/LadspaEffect/LadspaControlDialog.h @@ -50,7 +50,7 @@ class LadspaControlDialog : public EffectControlDialog Q_OBJECT public: LadspaControlDialog( LadspaControls * _ctl ); - ~LadspaControlDialog() override; + ~LadspaControlDialog() override = default; private slots: diff --git a/plugins/Lb302/Lb302.cpp b/plugins/Lb302/Lb302.cpp index 8ebfe2d47..3621e034c 100644 --- a/plugins/Lb302/Lb302.cpp +++ b/plugins/Lb302/Lb302.cpp @@ -1010,11 +1010,6 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : } -Lb302SynthView::~Lb302SynthView() -{ -} - - void Lb302SynthView::modelChanged() { Lb302Synth * syn = castModel(); diff --git a/plugins/Lb302/Lb302.h b/plugins/Lb302/Lb302.h index 57acb9ef3..3abece98f 100644 --- a/plugins/Lb302/Lb302.h +++ b/plugins/Lb302/Lb302.h @@ -71,7 +71,7 @@ class Lb302Filter { public: Lb302Filter(Lb302FilterKnobState* p_fs); - virtual ~Lb302Filter() {}; + virtual ~Lb302Filter() = default; virtual void recalc(); virtual void envRecalc(); @@ -277,7 +277,7 @@ class Lb302SynthView : public InstrumentViewFixedSize public: Lb302SynthView( Instrument * _instrument, QWidget * _parent ); - ~Lb302SynthView() override; + ~Lb302SynthView() override = default; private: void modelChanged() override; diff --git a/plugins/MidiExport/MidiExport.cpp b/plugins/MidiExport/MidiExport.cpp index 1fde83f06..23164276c 100644 --- a/plugins/MidiExport/MidiExport.cpp +++ b/plugins/MidiExport/MidiExport.cpp @@ -67,12 +67,6 @@ MidiExport::MidiExport() : ExportFilter( &midiexport_plugin_descriptor) -MidiExport::~MidiExport() -{ -} - - - bool MidiExport::tryExport(const TrackContainer::TrackList &tracks, const TrackContainer::TrackList &patternStoreTracks, int tempo, int masterPitch, const QString &filename) diff --git a/plugins/MidiExport/MidiExport.h b/plugins/MidiExport/MidiExport.h index ccbb370ca..29306b903 100644 --- a/plugins/MidiExport/MidiExport.h +++ b/plugins/MidiExport/MidiExport.h @@ -63,7 +63,7 @@ class MidiExport: public ExportFilter // Q_OBJECT public: MidiExport(); - ~MidiExport() override; + ~MidiExport() override = default; gui::PluginView* instantiateView(QWidget *) override { diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index 73ea4d8c2..282bfa03b 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -90,13 +90,6 @@ MidiImport::MidiImport( const QString & _file ) : -MidiImport::~MidiImport() -{ -} - - - - bool MidiImport::tryImport( TrackContainer* tc ) { if( openFile() == false ) diff --git a/plugins/MidiImport/MidiImport.h b/plugins/MidiImport/MidiImport.h index 0d7c0e99e..12cfb46ae 100644 --- a/plugins/MidiImport/MidiImport.h +++ b/plugins/MidiImport/MidiImport.h @@ -41,7 +41,7 @@ class MidiImport : public ImportFilter Q_OBJECT public: MidiImport( const QString & _file ); - ~MidiImport() override; + ~MidiImport() override = default; gui::PluginView* instantiateView( QWidget * ) override { diff --git a/plugins/MidiImport/portsmf/allegro.h b/plugins/MidiImport/portsmf/allegro.h index e21a8f817..ca5859aef 100644 --- a/plugins/MidiImport/portsmf/allegro.h +++ b/plugins/MidiImport/portsmf/allegro.h @@ -287,7 +287,7 @@ public: const char *GetDescription(); // computes a text description of this event // the result is in a static buffer, not thread-safe, just for debugging. Alg_event() { selected = false; } - virtual ~Alg_event() {} + virtual ~Alg_event() = default; } *Alg_event_ptr; @@ -306,7 +306,7 @@ public: typedef class Alg_update : public Alg_event { public: - ~Alg_update() override {}; + ~Alg_update() override = default; Alg_update(Alg_update *); // copy constructor Alg_parameter parameter; // an update contains one attr/value pair @@ -437,7 +437,7 @@ typedef class Alg_beat { public: Alg_beat(double t, double b) { time = t; beat = b; } - Alg_beat() {}; + Alg_beat() = default; double time; double beat; } *Alg_beat_ptr; @@ -535,7 +535,7 @@ class Serial_buffer { ptr = nullptr; len = 0; } - virtual ~Serial_buffer() { } + virtual ~Serial_buffer() = default; long get_posn() { return (long) (ptr - buffer); } long get_len() { return len; } @@ -548,7 +548,7 @@ public: // setting buffer, but it is not the Serial_read_buffer's responsibility // to delete the buffer (owner might want to reuse it), so the destructor // does nothing. - ~Serial_read_buffer() override { } + ~Serial_read_buffer() override = default; #if defined(_WIN32) //#pragma warning(disable: 546) // cast to int is OK, we only want low 7 bits //#pragma warning(disable: 4311) // type cast pointer to long warning diff --git a/plugins/MidiImport/portsmf/allegrosmfwr.cpp b/plugins/MidiImport/portsmf/allegrosmfwr.cpp index fefccf12d..eadb4c3ae 100644 --- a/plugins/MidiImport/portsmf/allegrosmfwr.cpp +++ b/plugins/MidiImport/portsmf/allegrosmfwr.cpp @@ -29,7 +29,7 @@ public: class Alg_smf_write { public: Alg_smf_write(Alg_seq_ptr seq); - ~Alg_smf_write(); + ~Alg_smf_write() = default; long channels_per_track; // used to encode track number into chan field // chan is actual_channel + channels_per_track * track_number // default is 100, set this to 0 to merge all tracks to 16 channels @@ -98,11 +98,6 @@ Alg_smf_write::Alg_smf_write(Alg_seq_ptr a_seq) } -Alg_smf_write::~Alg_smf_write() -{ -} - - // sorting is quite subtle due to rounding // For example, suppose times from a MIDI file are exact, but in // decimal round to TW0.4167 Q0.3333. Since the time in whole notes diff --git a/plugins/Monstro/Monstro.cpp b/plugins/Monstro/Monstro.cpp index d5ad851ee..b5fc5545f 100644 --- a/plugins/Monstro/Monstro.cpp +++ b/plugins/Monstro/Monstro.cpp @@ -111,11 +111,6 @@ MonstroSynth::MonstroSynth( MonstroInstrument * _i, NotePlayHandle * _nph ) : } -MonstroSynth::~MonstroSynth() -{ -} - - void MonstroSynth::renderOutput( fpp_t _frames, sampleFrame * _buf ) { float modtmp; // temp variable for freq modulation @@ -1029,11 +1024,6 @@ MonstroInstrument::MonstroInstrument( InstrumentTrack * _instrument_track ) : } -MonstroInstrument::~MonstroInstrument() -{ -} - - void MonstroInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) { @@ -1490,11 +1480,6 @@ MonstroView::MonstroView( Instrument * _instrument, } -MonstroView::~MonstroView() -{ -} - - void MonstroView::updateLayout() { switch( m_selectedViewGroup->model()->value() ) diff --git a/plugins/Monstro/Monstro.h b/plugins/Monstro/Monstro.h index 52f607a32..319b7e000 100644 --- a/plugins/Monstro/Monstro.h +++ b/plugins/Monstro/Monstro.h @@ -176,7 +176,7 @@ class MonstroSynth MM_OPERATORS public: MonstroSynth( MonstroInstrument * _i, NotePlayHandle * _nph ); - virtual ~MonstroSynth(); + virtual ~MonstroSynth() = default; void renderOutput( fpp_t _frames, sampleFrame * _buf ); @@ -355,7 +355,7 @@ class MonstroInstrument : public Instrument public: MonstroInstrument( InstrumentTrack * _instrument_track ); - ~MonstroInstrument() override; + ~MonstroInstrument() override = default; void playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) override; @@ -593,7 +593,7 @@ class MonstroView : public InstrumentViewFixedSize public: MonstroView( Instrument * _instrument, QWidget * _parent ); - ~MonstroView() override; + ~MonstroView() override = default; protected slots: void updateLayout(); diff --git a/plugins/MultitapEcho/MultitapEchoControlDialog.h b/plugins/MultitapEcho/MultitapEchoControlDialog.h index 0989046c1..e016d1372 100644 --- a/plugins/MultitapEcho/MultitapEchoControlDialog.h +++ b/plugins/MultitapEcho/MultitapEchoControlDialog.h @@ -44,9 +44,7 @@ class MultitapEchoControlDialog : public EffectControlDialog Q_OBJECT public: MultitapEchoControlDialog( MultitapEchoControls * controls ); - ~MultitapEchoControlDialog() override - { - } + ~MultitapEchoControlDialog() override = default; }; diff --git a/plugins/MultitapEcho/MultitapEchoControls.cpp b/plugins/MultitapEcho/MultitapEchoControls.cpp index 4382151af..19564ba8a 100644 --- a/plugins/MultitapEcho/MultitapEchoControls.cpp +++ b/plugins/MultitapEcho/MultitapEchoControls.cpp @@ -58,11 +58,6 @@ MultitapEchoControls::MultitapEchoControls( MultitapEchoEffect * eff ) : } -MultitapEchoControls::~MultitapEchoControls() -{ -} - - void MultitapEchoControls::saveSettings( QDomDocument & doc, QDomElement & parent ) { m_steps.saveSettings( doc, parent, "steps" ); diff --git a/plugins/MultitapEcho/MultitapEchoControls.h b/plugins/MultitapEcho/MultitapEchoControls.h index 7ded68cc8..bd345bfe5 100644 --- a/plugins/MultitapEcho/MultitapEchoControls.h +++ b/plugins/MultitapEcho/MultitapEchoControls.h @@ -41,7 +41,7 @@ class MultitapEchoControls : public EffectControls Q_OBJECT public: MultitapEchoControls( MultitapEchoEffect * eff ); - ~MultitapEchoControls() override; + ~MultitapEchoControls() override = default; void saveSettings( QDomDocument & doc, QDomElement & parent ) override; void loadSettings( const QDomElement & elem ) override; diff --git a/plugins/Nes/Nes.cpp b/plugins/Nes/Nes.cpp index f3537d88c..4e5fdc59a 100644 --- a/plugins/Nes/Nes.cpp +++ b/plugins/Nes/Nes.cpp @@ -103,11 +103,6 @@ NesObject::NesObject( NesInstrument * nes, const sample_rate_t samplerate, NoteP } -NesObject::~NesObject() -{ -} - - void NesObject::renderOutput( sampleFrame * buf, fpp_t frames ) { //////////////////////////////// @@ -551,11 +546,6 @@ NesInstrument::NesInstrument( InstrumentTrack * instrumentTrack ) : -NesInstrument::~NesInstrument() -{ -} - - void NesInstrument::playNote( NotePlayHandle * n, sampleFrame * workingBuffer ) { const fpp_t frames = n->framesLeftForCurrentPeriod(); @@ -854,11 +844,6 @@ NesInstrumentView::NesInstrumentView( Instrument * instrument, QWidget * parent -NesInstrumentView::~NesInstrumentView() -{ -} - - void NesInstrumentView::modelChanged() { NesInstrument * nes = castModel(); diff --git a/plugins/Nes/Nes.h b/plugins/Nes/Nes.h index 41e7b0d7f..91e5e556c 100644 --- a/plugins/Nes/Nes.h +++ b/plugins/Nes/Nes.h @@ -95,7 +95,7 @@ class NesObject MM_OPERATORS public: NesObject( NesInstrument * nes, const sample_rate_t samplerate, NotePlayHandle * nph ); - virtual ~NesObject(); + virtual ~NesObject() = default; void renderOutput( sampleFrame * buf, fpp_t frames ); void updateVibrato( float * freq ); @@ -211,7 +211,7 @@ class NesInstrument : public Instrument Q_OBJECT public: NesInstrument( InstrumentTrack * instrumentTrack ); - ~NesInstrument() override; + ~NesInstrument() override = default; void playNote( NotePlayHandle * n, sampleFrame * workingBuffer ) override; @@ -313,7 +313,7 @@ class NesInstrumentView : public InstrumentViewFixedSize public: NesInstrumentView( Instrument * instrument, QWidget * parent ); - ~NesInstrumentView() override; + ~NesInstrumentView() override = default; private: void modelChanged() override; diff --git a/plugins/Organic/Organic.cpp b/plugins/Organic/Organic.cpp index 6271f6c40..c22a12168 100644 --- a/plugins/Organic/Organic.cpp +++ b/plugins/Organic/Organic.cpp @@ -583,13 +583,6 @@ OscillatorObject::OscillatorObject( Model * _parent, int _index ) : -OscillatorObject::~OscillatorObject() -{ -} - - - - void OscillatorObject::oscButtonChanged() { diff --git a/plugins/Organic/Organic.h b/plugins/Organic/Organic.h index bc951ad49..057a4a5b4 100644 --- a/plugins/Organic/Organic.h +++ b/plugins/Organic/Organic.h @@ -105,7 +105,7 @@ private: float m_phaseOffsetRight; OscillatorObject( Model * _parent, int _index ); - ~OscillatorObject() override; + ~OscillatorObject() override = default; friend class OrganicInstrument; friend class gui::OrganicInstrumentView; @@ -211,9 +211,7 @@ private: m_detuneKnob( dt ) { } - OscillatorKnobs() - { - } + OscillatorKnobs() = default; Knob * m_harmKnob; Knob * m_volKnob; diff --git a/plugins/Patman/Patman.cpp b/plugins/Patman/Patman.cpp index 32e8372eb..8b502e93d 100644 --- a/plugins/Patman/Patman.cpp +++ b/plugins/Patman/Patman.cpp @@ -495,13 +495,6 @@ PatmanView::PatmanView( Instrument * _instrument, QWidget * _parent ) : -PatmanView::~PatmanView() -{ -} - - - - void PatmanView::openFile() { FileDialog ofd( nullptr, tr( "Open patch file" ) ); diff --git a/plugins/Patman/Patman.h b/plugins/Patman/Patman.h index 60276f5aa..89f7f7250 100644 --- a/plugins/Patman/Patman.h +++ b/plugins/Patman/Patman.h @@ -131,7 +131,7 @@ class PatmanView : public InstrumentViewFixedSize Q_OBJECT public: PatmanView( Instrument * _instrument, QWidget * _parent ); - ~PatmanView() override; + ~PatmanView() override = default; public slots: diff --git a/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h b/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h index 7ccb4a14c..9f5f45223 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h +++ b/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.h @@ -45,9 +45,7 @@ class PeakControllerEffectControlDialog : public EffectControlDialog public: PeakControllerEffectControlDialog( PeakControllerEffectControls * _controls ); - ~PeakControllerEffectControlDialog() override - { - } + ~PeakControllerEffectControlDialog() override = default; protected: diff --git a/plugins/PeakControllerEffect/PeakControllerEffectControls.h b/plugins/PeakControllerEffect/PeakControllerEffectControls.h index 6eb3dad44..3bd96b3f9 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffectControls.h +++ b/plugins/PeakControllerEffect/PeakControllerEffectControls.h @@ -41,9 +41,7 @@ class PeakControllerEffectControls : public EffectControls Q_OBJECT public: PeakControllerEffectControls( PeakControllerEffect * _eff ); - ~PeakControllerEffectControls() override - { - } + ~PeakControllerEffectControls() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/plugins/ReverbSC/ReverbSCControlDialog.h b/plugins/ReverbSC/ReverbSCControlDialog.h index 0c02d7865..0abc96896 100644 --- a/plugins/ReverbSC/ReverbSCControlDialog.h +++ b/plugins/ReverbSC/ReverbSCControlDialog.h @@ -42,9 +42,7 @@ class ReverbSCControlDialog : public EffectControlDialog Q_OBJECT public: ReverbSCControlDialog( ReverbSCControls* controls ); - ~ReverbSCControlDialog() override - { - } + ~ReverbSCControlDialog() override = default; } ; diff --git a/plugins/ReverbSC/ReverbSCControls.h b/plugins/ReverbSC/ReverbSCControls.h index b58254dcf..93f974a21 100644 --- a/plugins/ReverbSC/ReverbSCControls.h +++ b/plugins/ReverbSC/ReverbSCControls.h @@ -40,9 +40,7 @@ class ReverbSCControls : public EffectControls Q_OBJECT public: ReverbSCControls( ReverbSCEffect* effect ); - ~ReverbSCControls() override - { - } + ~ReverbSCControls() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/plugins/Sf2Player/PatchesDialog.cpp b/plugins/Sf2Player/PatchesDialog.cpp index 082a15c04..9c9a689a0 100644 --- a/plugins/Sf2Player/PatchesDialog.cpp +++ b/plugins/Sf2Player/PatchesDialog.cpp @@ -111,12 +111,6 @@ PatchesDialog::PatchesDialog( QWidget *pParent, Qt::WindowFlags wflags ) } -// Destructor. -PatchesDialog::~PatchesDialog() -{ -} - - // Dialog setup loader. void PatchesDialog::setup ( fluid_synth_t * pSynth, int iChan, const QString & _chanName, diff --git a/plugins/Sf2Player/PatchesDialog.h b/plugins/Sf2Player/PatchesDialog.h index af1207ce1..5309ce0bf 100644 --- a/plugins/Sf2Player/PatchesDialog.h +++ b/plugins/Sf2Player/PatchesDialog.h @@ -50,7 +50,7 @@ public: PatchesDialog(QWidget *pParent = 0, Qt::WindowFlags wflags = QFlag(0)); // Destructor. - ~PatchesDialog() override; + ~PatchesDialog() override = default; void setup(fluid_synth_t *pSynth, int iChan, const QString & _chanName, diff --git a/plugins/Sf2Player/Sf2Player.cpp b/plugins/Sf2Player/Sf2Player.cpp index 291f7fb76..dae94a332 100644 --- a/plugins/Sf2Player/Sf2Player.cpp +++ b/plugins/Sf2Player/Sf2Player.cpp @@ -1055,13 +1055,6 @@ Sf2InstrumentView::Sf2InstrumentView( Instrument * _instrument, QWidget * _paren -Sf2InstrumentView::~Sf2InstrumentView() -{ -} - - - - void Sf2InstrumentView::modelChanged() { Sf2Instrument * k = castModel(); diff --git a/plugins/Sf2Player/Sf2Player.h b/plugins/Sf2Player/Sf2Player.h index 1ce6d0fdd..275d7494c 100644 --- a/plugins/Sf2Player/Sf2Player.h +++ b/plugins/Sf2Player/Sf2Player.h @@ -203,7 +203,7 @@ class Sf2InstrumentView : public InstrumentViewFixedSize public: Sf2InstrumentView( Instrument * _instrument, QWidget * _parent ); - ~Sf2InstrumentView() override; + ~Sf2InstrumentView() override = default; private: void modelChanged() override; diff --git a/plugins/Sfxr/Sfxr.cpp b/plugins/Sfxr/Sfxr.cpp index a8bb81219..605416520 100644 --- a/plugins/Sfxr/Sfxr.cpp +++ b/plugins/Sfxr/Sfxr.cpp @@ -88,14 +88,6 @@ SfxrSynth::SfxrSynth( const SfxrInstrument * s ): -SfxrSynth::~SfxrSynth() -{ - -} - - - - void SfxrSynth::resetSample( bool restart ) { if(!restart) @@ -362,13 +354,6 @@ SfxrInstrument::SfxrInstrument( InstrumentTrack * _instrument_track ) : -SfxrInstrument::~SfxrInstrument() -{ -} - - - - void SfxrInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this ) { _this.setAttribute( "version", "1" ); diff --git a/plugins/Sfxr/Sfxr.h b/plugins/Sfxr/Sfxr.h index 6aafe9961..2011062d1 100644 --- a/plugins/Sfxr/Sfxr.h +++ b/plugins/Sfxr/Sfxr.h @@ -80,7 +80,7 @@ class SfxrSynth MM_OPERATORS public: SfxrSynth( const SfxrInstrument * s ); - virtual ~SfxrSynth(); + virtual ~SfxrSynth() = default; void resetSample( bool restart ); void update( sampleFrame * buffer, const int32_t frameNum ); @@ -176,7 +176,7 @@ class SfxrInstrument : public Instrument Q_OBJECT public: SfxrInstrument(InstrumentTrack * _instrument_track ); - ~SfxrInstrument() override; + ~SfxrInstrument() override = default; void playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) override; void deleteNotePluginData( NotePlayHandle * _n ) override; @@ -240,7 +240,7 @@ public: SfxrInstrumentView( Instrument * _instrument, QWidget * _parent ); - ~SfxrInstrumentView() override {}; + ~SfxrInstrumentView() override = default; protected slots: void genPickup(); diff --git a/plugins/Sid/SidInstrument.cpp b/plugins/Sid/SidInstrument.cpp index e075ed049..16710f4f9 100644 --- a/plugins/Sid/SidInstrument.cpp +++ b/plugins/Sid/SidInstrument.cpp @@ -116,11 +116,6 @@ VoiceObject::VoiceObject( Model * _parent, int _idx ) : } -VoiceObject::~VoiceObject() -{ -} - - SidInstrument::SidInstrument( InstrumentTrack * _instrument_track ) : Instrument( _instrument_track, &sid_plugin_descriptor ), // filter @@ -140,11 +135,6 @@ SidInstrument::SidInstrument( InstrumentTrack * _instrument_track ) : } -SidInstrument::~SidInstrument() -{ -} - - void SidInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this ) { @@ -662,10 +652,6 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, } -SidInstrumentView::~SidInstrumentView() -{ -} - void SidInstrumentView::updateKnobHint() { SidInstrument * k = castModel(); diff --git a/plugins/Sid/SidInstrument.h b/plugins/Sid/SidInstrument.h index 1c8fecc95..203e52e7b 100644 --- a/plugins/Sid/SidInstrument.h +++ b/plugins/Sid/SidInstrument.h @@ -58,7 +58,7 @@ public: NumWaveShapes }; VoiceObject( Model * _parent, int _idx ); - ~VoiceObject() override; + ~VoiceObject() override = default; private: @@ -97,7 +97,7 @@ public: SidInstrument( InstrumentTrack * _instrument_track ); - ~SidInstrument() override; + ~SidInstrument() override = default; void playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) override; @@ -147,7 +147,7 @@ class SidInstrumentView : public InstrumentViewFixedSize Q_OBJECT public: SidInstrumentView( Instrument * _instrument, QWidget * _parent ); - ~SidInstrumentView() override; + ~SidInstrumentView() override = default; private: void modelChanged() override; @@ -181,9 +181,7 @@ private: m_testButton( testb ) { } - voiceKnobs() - { - } + voiceKnobs() = default; Knob * m_attKnob; Knob * m_decKnob; Knob * m_sustKnob; diff --git a/plugins/SpectrumAnalyzer/SaControls.h b/plugins/SpectrumAnalyzer/SaControls.h index b2fc1cc87..48d8ee96e 100644 --- a/plugins/SpectrumAnalyzer/SaControls.h +++ b/plugins/SpectrumAnalyzer/SaControls.h @@ -49,7 +49,7 @@ class SaControls : public EffectControls Q_OBJECT public: explicit SaControls(Analyzer* effect); - ~SaControls() override {} + ~SaControls() override = default; gui::EffectControlDialog* createView() override; diff --git a/plugins/SpectrumAnalyzer/SaControlsDialog.h b/plugins/SpectrumAnalyzer/SaControlsDialog.h index ac28be4bf..83e12c1bf 100644 --- a/plugins/SpectrumAnalyzer/SaControlsDialog.h +++ b/plugins/SpectrumAnalyzer/SaControlsDialog.h @@ -47,7 +47,7 @@ class SaControlsDialog : public EffectControlDialog Q_OBJECT public: explicit SaControlsDialog(SaControls *controls, SaProcessor *processor); - ~SaControlsDialog() override {} + ~SaControlsDialog() override = default; bool isResizable() const override {return true;} QSize sizeHint() const override; diff --git a/plugins/SpectrumAnalyzer/SaSpectrumView.h b/plugins/SpectrumAnalyzer/SaSpectrumView.h index d50c893e5..e9bb47b1d 100644 --- a/plugins/SpectrumAnalyzer/SaSpectrumView.h +++ b/plugins/SpectrumAnalyzer/SaSpectrumView.h @@ -54,7 +54,7 @@ class SaSpectrumView : public QWidget Q_OBJECT public: explicit SaSpectrumView(SaControls *controls, SaProcessor *processor, QWidget *_parent = 0); - ~SaSpectrumView() override {} + ~SaSpectrumView() override = default; QSize sizeHint() const override {return QSize(400, 200);} diff --git a/plugins/SpectrumAnalyzer/SaWaterfallView.h b/plugins/SpectrumAnalyzer/SaWaterfallView.h index 2855eb925..5de00d7ad 100644 --- a/plugins/SpectrumAnalyzer/SaWaterfallView.h +++ b/plugins/SpectrumAnalyzer/SaWaterfallView.h @@ -49,7 +49,7 @@ class SaWaterfallView : public QWidget Q_OBJECT public: explicit SaWaterfallView(SaControls *controls, SaProcessor *processor, QWidget *_parent = 0); - ~SaWaterfallView() override {} + ~SaWaterfallView() override = default; QSize sizeHint() const override {return QSize(400, 350);} diff --git a/plugins/StereoEnhancer/StereoEnhancerControlDialog.h b/plugins/StereoEnhancer/StereoEnhancerControlDialog.h index 3f063ec63..459b1fa69 100644 --- a/plugins/StereoEnhancer/StereoEnhancerControlDialog.h +++ b/plugins/StereoEnhancer/StereoEnhancerControlDialog.h @@ -42,9 +42,7 @@ class StereoEnhancerControlDialog : public EffectControlDialog Q_OBJECT public: StereoEnhancerControlDialog( StereoEnhancerControls * _controls ); - ~StereoEnhancerControlDialog() override - { - } + ~StereoEnhancerControlDialog() override = default; }; diff --git a/plugins/StereoEnhancer/StereoEnhancerControls.h b/plugins/StereoEnhancer/StereoEnhancerControls.h index 0b016aa2b..dea356fdb 100644 --- a/plugins/StereoEnhancer/StereoEnhancerControls.h +++ b/plugins/StereoEnhancer/StereoEnhancerControls.h @@ -39,9 +39,7 @@ class StereoEnhancerControls : public EffectControls Q_OBJECT public: StereoEnhancerControls( StereoEnhancerEffect( * _eff ) ); - ~StereoEnhancerControls() override - { - } + ~StereoEnhancerControls() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/plugins/StereoMatrix/StereoMatrix.cpp b/plugins/StereoMatrix/StereoMatrix.cpp index 34b2fc86b..2dff69b77 100644 --- a/plugins/StereoMatrix/StereoMatrix.cpp +++ b/plugins/StereoMatrix/StereoMatrix.cpp @@ -64,12 +64,6 @@ StereoMatrixEffect::StereoMatrixEffect( -StereoMatrixEffect::~StereoMatrixEffect() -{ -} - - - bool StereoMatrixEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) { diff --git a/plugins/StereoMatrix/StereoMatrix.h b/plugins/StereoMatrix/StereoMatrix.h index a8a373317..ae7a59724 100644 --- a/plugins/StereoMatrix/StereoMatrix.h +++ b/plugins/StereoMatrix/StereoMatrix.h @@ -38,7 +38,7 @@ class StereoMatrixEffect : public Effect public: StereoMatrixEffect( Model * parent, const Descriptor::SubPluginFeatures::Key * _key ); - ~StereoMatrixEffect() override; + ~StereoMatrixEffect() override = default; bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) override; diff --git a/plugins/StereoMatrix/StereoMatrixControlDialog.h b/plugins/StereoMatrix/StereoMatrixControlDialog.h index 41eb9cdb4..56592aa12 100644 --- a/plugins/StereoMatrix/StereoMatrixControlDialog.h +++ b/plugins/StereoMatrix/StereoMatrixControlDialog.h @@ -41,9 +41,7 @@ class StereoMatrixControlDialog : public EffectControlDialog Q_OBJECT public: StereoMatrixControlDialog( StereoMatrixControls * _controls ); - ~StereoMatrixControlDialog() override - { - } + ~StereoMatrixControlDialog() override = default; }; diff --git a/plugins/StereoMatrix/StereoMatrixControls.h b/plugins/StereoMatrix/StereoMatrixControls.h index 04a10f237..5eb506d16 100644 --- a/plugins/StereoMatrix/StereoMatrixControls.h +++ b/plugins/StereoMatrix/StereoMatrixControls.h @@ -39,9 +39,7 @@ class StereoMatrixControls : public EffectControls Q_OBJECT public: StereoMatrixControls( StereoMatrixEffect( * _eff ) ); - ~StereoMatrixControls() override - { - } + ~StereoMatrixControls() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/plugins/Stk/Mallets/Mallets.cpp b/plugins/Stk/Mallets/Mallets.cpp index 4adfb5347..6dcd8f563 100644 --- a/plugins/Stk/Mallets/Mallets.cpp +++ b/plugins/Stk/Mallets/Mallets.cpp @@ -130,13 +130,6 @@ MalletsInstrument::MalletsInstrument( InstrumentTrack * _instrument_track ): -MalletsInstrument::~MalletsInstrument() -{ -} - - - - void MalletsInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this ) { // ModalBar @@ -435,12 +428,6 @@ MalletsInstrumentView::MalletsInstrumentView( MalletsInstrument * _instrument, -MalletsInstrumentView::~MalletsInstrumentView() -{ -} - - - void MalletsInstrumentView::setWidgetBackground( QWidget * _widget, const QString & _pic ) { _widget->setAutoFillBackground( true ); diff --git a/plugins/Stk/Mallets/Mallets.h b/plugins/Stk/Mallets/Mallets.h index e8ec15360..4d5aed288 100644 --- a/plugins/Stk/Mallets/Mallets.h +++ b/plugins/Stk/Mallets/Mallets.h @@ -160,7 +160,7 @@ class MalletsInstrument : public Instrument Q_OBJECT public: MalletsInstrument( InstrumentTrack * _instrument_track ); - ~MalletsInstrument() override; + ~MalletsInstrument() override = default; void playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) override; @@ -219,7 +219,7 @@ class MalletsInstrumentView: public InstrumentViewFixedSize public: MalletsInstrumentView( MalletsInstrument * _instrument, QWidget * _parent ); - ~MalletsInstrumentView() override; + ~MalletsInstrumentView() override = default; public slots: void changePreset(); diff --git a/plugins/TripleOscillator/TripleOscillator.cpp b/plugins/TripleOscillator/TripleOscillator.cpp index f19754019..5a3a6d1dc 100644 --- a/plugins/TripleOscillator/TripleOscillator.cpp +++ b/plugins/TripleOscillator/TripleOscillator.cpp @@ -238,13 +238,6 @@ TripleOscillator::TripleOscillator( InstrumentTrack * _instrument_track ) : -TripleOscillator::~TripleOscillator() -{ -} - - - - void TripleOscillator::saveSettings( QDomDocument & _doc, QDomElement & _this ) { for( int i = 0; i < NUM_OF_OSCILLATORS; ++i ) @@ -714,13 +707,6 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, -TripleOscillatorView::~TripleOscillatorView() -{ -} - - - - void TripleOscillatorView::modelChanged() { TripleOscillator * t = castModel(); diff --git a/plugins/TripleOscillator/TripleOscillator.h b/plugins/TripleOscillator/TripleOscillator.h index 0cb0e69a0..f3290153b 100644 --- a/plugins/TripleOscillator/TripleOscillator.h +++ b/plugins/TripleOscillator/TripleOscillator.h @@ -108,7 +108,7 @@ class TripleOscillator : public Instrument Q_OBJECT public: TripleOscillator( InstrumentTrack * _track ); - ~TripleOscillator() override; + ~TripleOscillator() override = default; void playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) override; @@ -157,7 +157,7 @@ class TripleOscillatorView : public InstrumentViewFixedSize Q_OBJECT public: TripleOscillatorView( Instrument * _instrument, QWidget * _parent ); - ~TripleOscillatorView() override; + ~TripleOscillatorView() override = default; private: @@ -191,9 +191,7 @@ private: m_multiBandWaveTableButton( wt ) { } - OscillatorKnobs() - { - } + OscillatorKnobs() = default; Knob * m_volKnob; Knob * m_panKnob; Knob * m_coarseKnob; diff --git a/plugins/Vectorscope/VecControls.h b/plugins/Vectorscope/VecControls.h index 76b0f388e..71b1c122e 100644 --- a/plugins/Vectorscope/VecControls.h +++ b/plugins/Vectorscope/VecControls.h @@ -47,7 +47,7 @@ class VecControls : public EffectControls Q_OBJECT public: explicit VecControls(Vectorscope *effect); - ~VecControls() override {} + ~VecControls() override = default; gui::EffectControlDialog* createView() override; diff --git a/plugins/Vectorscope/VecControlsDialog.h b/plugins/Vectorscope/VecControlsDialog.h index 616e55b44..8fee75b4b 100644 --- a/plugins/Vectorscope/VecControlsDialog.h +++ b/plugins/Vectorscope/VecControlsDialog.h @@ -43,7 +43,7 @@ class VecControlsDialog : public EffectControlDialog Q_OBJECT public: explicit VecControlsDialog(VecControls *controls); - ~VecControlsDialog() override {} + ~VecControlsDialog() override = default; bool isResizable() const override {return true;} QSize sizeHint() const override; diff --git a/plugins/Vectorscope/VectorView.h b/plugins/Vectorscope/VectorView.h index 347aa8a18..59ac99a77 100644 --- a/plugins/Vectorscope/VectorView.h +++ b/plugins/Vectorscope/VectorView.h @@ -44,7 +44,7 @@ class VectorView : public QWidget Q_OBJECT public: explicit VectorView(VecControls *controls, LocklessRingBuffer *inputBuffer, unsigned short displaySize, QWidget *parent = 0); - ~VectorView() override {} + ~VectorView() override = default; QSize sizeHint() const override {return QSize(300, 300);} diff --git a/plugins/Vectorscope/Vectorscope.h b/plugins/Vectorscope/Vectorscope.h index e3e92b205..54022ab90 100644 --- a/plugins/Vectorscope/Vectorscope.h +++ b/plugins/Vectorscope/Vectorscope.h @@ -37,7 +37,7 @@ class Vectorscope : public Effect { public: Vectorscope(Model *parent, const Descriptor::SubPluginFeatures::Key *key); - ~Vectorscope() override {}; + ~Vectorscope() override = default; bool processAudioBuffer(sampleFrame *buffer, const fpp_t frame_count) override; EffectControls *controls() override {return &m_controls;} diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index 30bef7141..7441370ec 100644 --- a/plugins/Vestige/Vestige.cpp +++ b/plugins/Vestige/Vestige.cpp @@ -103,9 +103,7 @@ public: setWindowFlags( Qt::WindowCloseButtonHint ); } - ~vstSubWin() override - { - } + ~vstSubWin() override = default; void closeEvent( QCloseEvent * e ) override { @@ -671,13 +669,6 @@ void VestigeInstrumentView::updateMenu( void ) } -VestigeInstrumentView::~VestigeInstrumentView() -{ -} - - - - void VestigeInstrumentView::modelChanged() { m_vi = castModel(); diff --git a/plugins/Vestige/Vestige.h b/plugins/Vestige/Vestige.h index 706e77b00..0a36c4924 100644 --- a/plugins/Vestige/Vestige.h +++ b/plugins/Vestige/Vestige.h @@ -150,7 +150,7 @@ class VestigeInstrumentView : public InstrumentViewFixedSize Q_OBJECT public: VestigeInstrumentView( Instrument * _instrument, QWidget * _parent ); - virtual ~VestigeInstrumentView(); + virtual ~VestigeInstrumentView() = default; protected slots: diff --git a/plugins/Vibed/Vibed.h b/plugins/Vibed/Vibed.h index c6fdee385..75f92157c 100644 --- a/plugins/Vibed/Vibed.h +++ b/plugins/Vibed/Vibed.h @@ -97,7 +97,7 @@ class VibedView : public InstrumentViewFixedSize public: VibedView( Instrument * _instrument, QWidget * _parent ); - ~VibedView() override {}; + ~VibedView() override = default; public slots: void showString( int _string ); diff --git a/plugins/VstEffect/VstEffect.cpp b/plugins/VstEffect/VstEffect.cpp index eee3919c4..c3e40cfa7 100644 --- a/plugins/VstEffect/VstEffect.cpp +++ b/plugins/VstEffect/VstEffect.cpp @@ -76,13 +76,6 @@ VstEffect::VstEffect( Model * _parent, -VstEffect::~VstEffect() -{ -} - - - - bool VstEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) { if( !isEnabled() || !isRunning () ) diff --git a/plugins/VstEffect/VstEffect.h b/plugins/VstEffect/VstEffect.h index 586d00d3b..987b1ecc2 100644 --- a/plugins/VstEffect/VstEffect.h +++ b/plugins/VstEffect/VstEffect.h @@ -43,7 +43,7 @@ class VstEffect : public Effect public: VstEffect( Model * _parent, const Descriptor::SubPluginFeatures::Key * _key ); - ~VstEffect() override; + ~VstEffect() override = default; bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) override; diff --git a/plugins/Watsyn/Watsyn.cpp b/plugins/Watsyn/Watsyn.cpp index 1c363d417..58f472edc 100644 --- a/plugins/Watsyn/Watsyn.cpp +++ b/plugins/Watsyn/Watsyn.cpp @@ -326,11 +326,6 @@ WatsynInstrument::WatsynInstrument( InstrumentTrack * _instrument_track ) : } -WatsynInstrument::~WatsynInstrument() -{ -} - - void WatsynInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) { @@ -947,12 +942,6 @@ WatsynView::WatsynView( Instrument * _instrument, } -WatsynView::~WatsynView() -{ -} - - - void WatsynView::updateLayout() { switch( m_selectedGraphGroup->model()->value() ) diff --git a/plugins/Watsyn/Watsyn.h b/plugins/Watsyn/Watsyn.h index cee2d807b..3c69be06f 100644 --- a/plugins/Watsyn/Watsyn.h +++ b/plugins/Watsyn/Watsyn.h @@ -139,7 +139,7 @@ class WatsynInstrument : public Instrument Q_OBJECT public: WatsynInstrument( InstrumentTrack * _instrument_track ); - ~WatsynInstrument() override; + ~WatsynInstrument() override = default; void playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) override; @@ -310,7 +310,7 @@ class WatsynView : public InstrumentViewFixedSize public: WatsynView( Instrument * _instrument, QWidget * _parent ); - ~WatsynView() override; + ~WatsynView() override = default; protected slots: void updateLayout(); diff --git a/plugins/WaveShaper/WaveShaper.cpp b/plugins/WaveShaper/WaveShaper.cpp index 7f0cf732f..edbcb0ad8 100644 --- a/plugins/WaveShaper/WaveShaper.cpp +++ b/plugins/WaveShaper/WaveShaper.cpp @@ -66,13 +66,6 @@ WaveShaperEffect::WaveShaperEffect( Model * _parent, -WaveShaperEffect::~WaveShaperEffect() -{ -} - - - - bool WaveShaperEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) { diff --git a/plugins/WaveShaper/WaveShaper.h b/plugins/WaveShaper/WaveShaper.h index 075c0ec6b..4c63d5806 100644 --- a/plugins/WaveShaper/WaveShaper.h +++ b/plugins/WaveShaper/WaveShaper.h @@ -39,7 +39,7 @@ class WaveShaperEffect : public Effect public: WaveShaperEffect( Model * _parent, const Descriptor::SubPluginFeatures::Key * _key ); - ~WaveShaperEffect() override; + ~WaveShaperEffect() override = default; bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) override; diff --git a/plugins/WaveShaper/WaveShaperControlDialog.h b/plugins/WaveShaper/WaveShaperControlDialog.h index be3838f46..e76dcfccc 100644 --- a/plugins/WaveShaper/WaveShaperControlDialog.h +++ b/plugins/WaveShaper/WaveShaperControlDialog.h @@ -42,9 +42,7 @@ class WaveShaperControlDialog : public EffectControlDialog Q_OBJECT public: WaveShaperControlDialog( WaveShaperControls * _controls ); - ~WaveShaperControlDialog() override - { - } + ~WaveShaperControlDialog() override = default; private: diff --git a/plugins/WaveShaper/WaveShaperControls.h b/plugins/WaveShaper/WaveShaperControls.h index 2719514f5..9473aae5d 100644 --- a/plugins/WaveShaper/WaveShaperControls.h +++ b/plugins/WaveShaper/WaveShaperControls.h @@ -42,9 +42,7 @@ class WaveShaperControls : public EffectControls Q_OBJECT public: WaveShaperControls( WaveShaperEffect * _eff ); - ~WaveShaperControls() override - { - } + ~WaveShaperControls() override = default; void saveSettings( QDomDocument & _doc, QDomElement & _parent ) override; void loadSettings( const QDomElement & _this ) override; diff --git a/src/common/SharedMemory.cpp b/src/common/SharedMemory.cpp index 5c944dfab..005e726ed 100644 --- a/src/common/SharedMemory.cpp +++ b/src/common/SharedMemory.cpp @@ -177,8 +177,7 @@ private: #endif -SharedMemoryData::SharedMemoryData() noexcept -{ } +SharedMemoryData::SharedMemoryData() noexcept = default; SharedMemoryData::SharedMemoryData(std::string&& key, bool readOnly) : m_key{std::move(key)}, @@ -192,7 +191,7 @@ SharedMemoryData::SharedMemoryData(std::string&& key, std::size_t size, bool rea m_ptr{m_impl->get()} { } -SharedMemoryData::~SharedMemoryData() { } +SharedMemoryData::~SharedMemoryData() = default; SharedMemoryData::SharedMemoryData(SharedMemoryData&& other) noexcept : m_key{std::move(other.m_key)}, diff --git a/src/core/AudioEngineProfiler.cpp b/src/core/AudioEngineProfiler.cpp index 24c4dc5ae..5fd5a813c 100644 --- a/src/core/AudioEngineProfiler.cpp +++ b/src/core/AudioEngineProfiler.cpp @@ -36,11 +36,6 @@ AudioEngineProfiler::AudioEngineProfiler() : -AudioEngineProfiler::~AudioEngineProfiler() -{ -} - - void AudioEngineProfiler::finishPeriod( sample_rate_t sampleRate, fpp_t framesPerPeriod ) { int periodElapsed = m_periodTimer.elapsed(); diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 1cbacc2fd..3ae141281 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -176,12 +176,6 @@ DataFile::DataFile( const QByteArray & _data ) : -DataFile::~DataFile() -{ -} - - - bool DataFile::validate( QString extension ) { diff --git a/src/core/ImportFilter.cpp b/src/core/ImportFilter.cpp index 1caa62e7d..35c34078e 100644 --- a/src/core/ImportFilter.cpp +++ b/src/core/ImportFilter.cpp @@ -48,12 +48,6 @@ ImportFilter::ImportFilter( const QString & _file_name, -ImportFilter::~ImportFilter() -{ -} - - - void ImportFilter::import( const QString & _file_to_import, TrackContainer* tc ) diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index 27c9e4f66..1f49fc80a 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -221,10 +221,6 @@ InstrumentFunctionNoteStacking::InstrumentFunctionNoteStacking( Model * _parent -InstrumentFunctionNoteStacking::~InstrumentFunctionNoteStacking() -{ -} - @@ -334,11 +330,6 @@ InstrumentFunctionArpeggio::InstrumentFunctionArpeggio( Model * _parent ) : -InstrumentFunctionArpeggio::~InstrumentFunctionArpeggio() -{ -} - - void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n ) diff --git a/src/core/InstrumentSoundShaping.cpp b/src/core/InstrumentSoundShaping.cpp index a9765d256..edf3b403c 100644 --- a/src/core/InstrumentSoundShaping.cpp +++ b/src/core/InstrumentSoundShaping.cpp @@ -107,11 +107,6 @@ InstrumentSoundShaping::InstrumentSoundShaping( -InstrumentSoundShaping::~InstrumentSoundShaping() -{ -} - - float InstrumentSoundShaping::volumeLevel( NotePlayHandle* n, const f_cnt_t frame ) diff --git a/src/core/Ladspa2LMMS.cpp b/src/core/Ladspa2LMMS.cpp index e16f5c98c..8ac6c3d86 100644 --- a/src/core/Ladspa2LMMS.cpp +++ b/src/core/Ladspa2LMMS.cpp @@ -82,12 +82,6 @@ Ladspa2LMMS::Ladspa2LMMS() -Ladspa2LMMS::~Ladspa2LMMS() -{ -} - - - QString Ladspa2LMMS::getShortName( const ladspa_key_t & _key ) { QString name = getName( _key ); diff --git a/src/core/LadspaControl.cpp b/src/core/LadspaControl.cpp index b166ccf9e..7e8e92623 100644 --- a/src/core/LadspaControl.cpp +++ b/src/core/LadspaControl.cpp @@ -112,13 +112,6 @@ LadspaControl::LadspaControl( Model * _parent, port_desc_t * _port, -LadspaControl::~LadspaControl() -{ -} - - - - LADSPA_Data LadspaControl::value() { switch( m_port->data_type ) diff --git a/src/core/LinkedModelGroups.cpp b/src/core/LinkedModelGroups.cpp index 4fdf54fc0..83bebc2a0 100644 --- a/src/core/LinkedModelGroups.cpp +++ b/src/core/LinkedModelGroups.cpp @@ -140,11 +140,6 @@ bool LinkedModelGroup::containsModel(const QString &name) const -LinkedModelGroups::~LinkedModelGroups() {} - - - - void LinkedModelGroups::linkAllModels() { LinkedModelGroup* first = getGroup(0); diff --git a/src/core/MeterModel.cpp b/src/core/MeterModel.cpp index 3e24ae4d1..d9e5c0343 100644 --- a/src/core/MeterModel.cpp +++ b/src/core/MeterModel.cpp @@ -42,15 +42,6 @@ MeterModel::MeterModel( Model * _parent ) : } - - -MeterModel::~MeterModel() -{ -} - - - - void MeterModel::reset() { m_numeratorModel.setValue( 4 ); diff --git a/src/core/MicroTimer.cpp b/src/core/MicroTimer.cpp index 44506481e..499ba8dd3 100644 --- a/src/core/MicroTimer.cpp +++ b/src/core/MicroTimer.cpp @@ -14,10 +14,6 @@ MicroTimer::MicroTimer() reset(); } -MicroTimer::~MicroTimer() -{ -} - void MicroTimer::reset() { begin = steady_clock::now(); diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 688190ee2..96d4fc8b2 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -51,11 +51,6 @@ MixerRoute::MixerRoute( MixerChannel * from, MixerChannel * to, float amount ) : } -MixerRoute::~MixerRoute() -{ -} - - void MixerRoute::updateName() { m_amount.setDisplayName( diff --git a/src/core/ModelVisitor.cpp b/src/core/ModelVisitor.cpp index 17e328587..665e16983 100644 --- a/src/core/ModelVisitor.cpp +++ b/src/core/ModelVisitor.cpp @@ -44,8 +44,4 @@ void ConstModelVisitor::visit(const FloatModel &m) { up(m); } void ConstModelVisitor::visit(const ComboBoxModel &m) { up(m); } 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/PatternStore.cpp b/src/core/PatternStore.cpp index af1b9b3bb..f91c42b72 100644 --- a/src/core/PatternStore.cpp +++ b/src/core/PatternStore.cpp @@ -50,13 +50,6 @@ PatternStore::PatternStore() : -PatternStore::~PatternStore() -{ -} - - - - bool PatternStore::play(TimePos start, fpp_t frames, f_cnt_t offset, int clipNum) { bool notePlayed = false; diff --git a/src/core/Plugin.cpp b/src/core/Plugin.cpp index e71df15b8..edc183c23 100644 --- a/src/core/Plugin.cpp +++ b/src/core/Plugin.cpp @@ -74,13 +74,6 @@ Plugin::Plugin(const Descriptor * descriptor, Model * parent, const -Plugin::~Plugin() -{ -} - - - - template T use_this_or(T this_param, T or_param) { diff --git a/src/core/PluginFactory.cpp b/src/core/PluginFactory.cpp index 184dc0b94..81a6122d1 100644 --- a/src/core/PluginFactory.cpp +++ b/src/core/PluginFactory.cpp @@ -58,10 +58,6 @@ PluginFactory::PluginFactory() discoverPlugins(); } -PluginFactory::~PluginFactory() -{ -} - void PluginFactory::setupSearchPaths() { // Adds a search path relative to the main executable if the path exists. diff --git a/src/core/PresetPreviewPlayHandle.cpp b/src/core/PresetPreviewPlayHandle.cpp index 1734ef497..6a5b86424 100644 --- a/src/core/PresetPreviewPlayHandle.cpp +++ b/src/core/PresetPreviewPlayHandle.cpp @@ -53,9 +53,7 @@ public: m_previewInstrumentTrack->setPreviewMode( true ); } - ~PreviewTrackContainer() override - { - } + ~PreviewTrackContainer() override = default; QString nodeName() const override { diff --git a/src/core/ProjectJournal.cpp b/src/core/ProjectJournal.cpp index 2a59a2724..bc1fee5c0 100644 --- a/src/core/ProjectJournal.cpp +++ b/src/core/ProjectJournal.cpp @@ -49,13 +49,6 @@ ProjectJournal::ProjectJournal() : -ProjectJournal::~ProjectJournal() -{ -} - - - - void ProjectJournal::undo() { while( !m_undoCheckPoints.isEmpty() ) diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index bb5020c9b..5af4e428b 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -108,13 +108,6 @@ ProjectRenderer::ProjectRenderer( const AudioEngine::qualitySettings & qualitySe -ProjectRenderer::~ProjectRenderer() -{ -} - - - - // Little help function for getting file format from a file extension // (only for registered file-encoders). ProjectRenderer::ExportFileFormats ProjectRenderer::getFileFormatFromExtension( diff --git a/src/core/TempoSyncKnobModel.cpp b/src/core/TempoSyncKnobModel.cpp index 58437db24..6fb457f2c 100644 --- a/src/core/TempoSyncKnobModel.cpp +++ b/src/core/TempoSyncKnobModel.cpp @@ -53,13 +53,6 @@ TempoSyncKnobModel::TempoSyncKnobModel( const float _val, const float _min, -TempoSyncKnobModel::~TempoSyncKnobModel() -{ -} - - - - void TempoSyncKnobModel::setTempoSync( QAction * _item ) { setTempoSync( _item->data().toInt() ); diff --git a/src/core/ToolPlugin.cpp b/src/core/ToolPlugin.cpp index 99c3e5bec..137029137 100644 --- a/src/core/ToolPlugin.cpp +++ b/src/core/ToolPlugin.cpp @@ -38,13 +38,6 @@ ToolPlugin::ToolPlugin( const Descriptor * _descriptor, Model * _parent ) : -ToolPlugin::~ToolPlugin() -{ -} - - - - ToolPlugin * ToolPlugin::instantiate( const QString & _plugin_name, Model * _parent ) { Plugin * p = Plugin::instantiate( _plugin_name, _parent, nullptr ); diff --git a/src/core/ValueBuffer.cpp b/src/core/ValueBuffer.cpp index 09aee65bd..01003dc3b 100644 --- a/src/core/ValueBuffer.cpp +++ b/src/core/ValueBuffer.cpp @@ -6,9 +6,6 @@ namespace lmms { -ValueBuffer::ValueBuffer() -{} - ValueBuffer::ValueBuffer(int length) : std::vector(length) {} diff --git a/src/core/audio/AudioSdl.cpp b/src/core/audio/AudioSdl.cpp index cb622a941..d321e8566 100644 --- a/src/core/audio/AudioSdl.cpp +++ b/src/core/audio/AudioSdl.cpp @@ -340,13 +340,6 @@ AudioSdl::setupWidget::setupWidget( QWidget * _parent ) : -AudioSdl::setupWidget::~setupWidget() -{ -} - - - - void AudioSdl::setupWidget::saveSettings() { ConfigManager::inst()->setValue( "audiosdl", "device", diff --git a/src/core/audio/AudioSndio.cpp b/src/core/audio/AudioSndio.cpp index f6c94f32a..0ba801585 100644 --- a/src/core/audio/AudioSndio.cpp +++ b/src/core/audio/AudioSndio.cpp @@ -204,12 +204,6 @@ AudioSndio::setupWidget::setupWidget( QWidget * _parent ) : } -AudioSndio::setupWidget::~setupWidget() -{ - -} - - void AudioSndio::setupWidget::saveSettings() { ConfigManager::inst()->setValue( "audiosndio", "device", diff --git a/src/core/audio/AudioSoundIo.cpp b/src/core/audio/AudioSoundIo.cpp index 165e38cde..4d8c48708 100644 --- a/src/core/audio/AudioSoundIo.cpp +++ b/src/core/audio/AudioSoundIo.cpp @@ -345,10 +345,6 @@ void AudioSoundIo::writeCallback(int frameCountMin, int frameCountMax) } } -AudioSoundIoSetupUtil::~AudioSoundIoSetupUtil() -{ -} - void AudioSoundIoSetupUtil::reconnectSoundIo() { ((AudioSoundIo::setupWidget *)m_setupWidget)->reconnectSoundIo(); diff --git a/src/core/lv2/Lv2ControlBase.cpp b/src/core/lv2/Lv2ControlBase.cpp index 6fb5900ea..c1679aaef 100644 --- a/src/core/lv2/Lv2ControlBase.cpp +++ b/src/core/lv2/Lv2ControlBase.cpp @@ -89,7 +89,7 @@ Lv2ControlBase::Lv2ControlBase(Model* that, const QString &uri) : -Lv2ControlBase::~Lv2ControlBase() {} +Lv2ControlBase::~Lv2ControlBase() = default; diff --git a/src/core/lv2/Lv2Ports.cpp b/src/core/lv2/Lv2Ports.cpp index 9e7a9e80c..1ce1d6956 100644 --- a/src/core/lv2/Lv2Ports.cpp +++ b/src/core/lv2/Lv2Ports.cpp @@ -352,15 +352,6 @@ void AtomSeq::Lv2EvbufDeleter::operator()(LV2_Evbuf *n) { lv2_evbuf_free(n); } -// make the compiler happy, give each class with virtuals -// a function (the destructor here) which is in a cpp file -PortBase::~PortBase() {} -ConstVisitor::~ConstVisitor() {} -Visitor::~Visitor() {} - - - - } // namespace lmms::Lv2Ports #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2Proc.cpp b/src/core/lv2/Lv2Proc.cpp index 20987b32f..1276a13b8 100644 --- a/src/core/lv2/Lv2Proc.cpp +++ b/src/core/lv2/Lv2Proc.cpp @@ -756,11 +756,9 @@ struct ConnectPortVisitor : public Lv2Ports::Visitor connectPort((audio.mustBeUsed()) ? audio.m_buffer.data() : nullptr); } void visit(Lv2Ports::Unknown&) override { connectPort(nullptr); } - ~ConnectPortVisitor() override; + ~ConnectPortVisitor() override = default; }; -ConnectPortVisitor::~ConnectPortVisitor() {} - // !This function must be realtime safe! // use createPort to create any port before connecting void Lv2Proc::connectPort(std::size_t num) diff --git a/src/core/midi/MidiClient.cpp b/src/core/midi/MidiClient.cpp index def556170..af7cfee0a 100644 --- a/src/core/midi/MidiClient.cpp +++ b/src/core/midi/MidiClient.cpp @@ -30,13 +30,6 @@ namespace lmms { -MidiClient::MidiClient() -{ -} - - - - MidiClient::~MidiClient() { //TODO: noteOffAll(); / clear all ports @@ -106,20 +99,6 @@ void MidiClient::subscribeWritablePort( MidiPort* , const QString& , bool ) -MidiClientRaw::MidiClientRaw() -{ -} - - - - -MidiClientRaw::~MidiClientRaw() -{ -} - - - - void MidiClientRaw::parseData( const unsigned char c ) { /*********************************************************************/ diff --git a/src/core/midi/MidiController.cpp b/src/core/midi/MidiController.cpp index 75f548a37..fbd48e945 100644 --- a/src/core/midi/MidiController.cpp +++ b/src/core/midi/MidiController.cpp @@ -47,13 +47,6 @@ MidiController::MidiController( Model * _parent ) : -MidiController::~MidiController() -{ -} - - - - void MidiController::updateValueBuffer() { if( m_previousValue != m_lastValue ) diff --git a/src/gui/AudioDeviceSetupWidget.cpp b/src/gui/AudioDeviceSetupWidget.cpp index ae559404c..b78800cec 100644 --- a/src/gui/AudioDeviceSetupWidget.cpp +++ b/src/gui/AudioDeviceSetupWidget.cpp @@ -32,10 +32,6 @@ AudioDeviceSetupWidget::AudioDeviceSetupWidget(const QString & caption, QWidget { } -AudioDeviceSetupWidget::~AudioDeviceSetupWidget() -{ -} - void AudioDeviceSetupWidget::show() { parentWidget()->show(); diff --git a/src/gui/ControllerDialog.cpp b/src/gui/ControllerDialog.cpp index be7d5dbef..344898808 100644 --- a/src/gui/ControllerDialog.cpp +++ b/src/gui/ControllerDialog.cpp @@ -41,12 +41,6 @@ ControllerDialog::ControllerDialog( Controller * _controller, -ControllerDialog::~ControllerDialog() -{ -} - - - void ControllerDialog::closeEvent( QCloseEvent * _ce ) { _ce->ignore(); diff --git a/src/gui/ControllerRackView.cpp b/src/gui/ControllerRackView.cpp index e9f23c767..e110067d6 100644 --- a/src/gui/ControllerRackView.cpp +++ b/src/gui/ControllerRackView.cpp @@ -93,13 +93,6 @@ ControllerRackView::ControllerRackView() : -ControllerRackView::~ControllerRackView() -{ -} - - - - void ControllerRackView::saveSettings( QDomDocument & _doc, QDomElement & _this ) { diff --git a/src/gui/Controls.cpp b/src/gui/Controls.cpp index fa28c695f..088d54657 100644 --- a/src/gui/Controls.cpp +++ b/src/gui/Controls.cpp @@ -38,11 +38,6 @@ namespace lmms::gui { -Control::~Control() {} - - - - void KnobControl::setText(const QString &text) { m_knob->setLabel(text); } QWidget *KnobControl::topWidget() { return m_knob; } @@ -59,10 +54,6 @@ AutomatableModelView* KnobControl::modelView() { return m_knob; } KnobControl::KnobControl(QWidget *parent) : m_knob(new Knob(parent)) {} -KnobControl::~KnobControl() {} - - - void ComboControl::setText(const QString &text) { m_label->setText(text); } @@ -87,9 +78,6 @@ ComboControl::ComboControl(QWidget *parent) : m_combo->repaint(); } -ComboControl::~ComboControl() {} - - void CheckControl::setText(const QString &text) { m_label->setText(text); } @@ -115,8 +103,6 @@ CheckControl::CheckControl(QWidget *parent) : vbox->addWidget(m_label); } -CheckControl::~CheckControl() {} - @@ -138,7 +124,5 @@ LcdControl::LcdControl(int numDigits, QWidget *parent) : { } -LcdControl::~LcdControl() {} - } // namespace lmms::gui diff --git a/src/gui/EffectControlDialog.cpp b/src/gui/EffectControlDialog.cpp index a134435fa..1e0fbb802 100644 --- a/src/gui/EffectControlDialog.cpp +++ b/src/gui/EffectControlDialog.cpp @@ -44,13 +44,6 @@ EffectControlDialog::EffectControlDialog( EffectControls * _controls ) : -EffectControlDialog::~EffectControlDialog() -{ -} - - - - void EffectControlDialog::closeEvent( QCloseEvent * _ce ) { _ce->ignore(); diff --git a/src/gui/LadspaControlView.cpp b/src/gui/LadspaControlView.cpp index a82f2e33e..d8c167a1c 100644 --- a/src/gui/LadspaControlView.cpp +++ b/src/gui/LadspaControlView.cpp @@ -121,10 +121,4 @@ LadspaControlView::LadspaControlView( QWidget * _parent, -LadspaControlView::~LadspaControlView() -{ -} - - - } // namespace lmms::gui diff --git a/src/gui/LinkedModelGroupViews.cpp b/src/gui/LinkedModelGroupViews.cpp index 80b08f384..a16c930d5 100644 --- a/src/gui/LinkedModelGroupViews.cpp +++ b/src/gui/LinkedModelGroupViews.cpp @@ -55,11 +55,6 @@ LinkedModelGroupView::LinkedModelGroupView(QWidget* parent, -LinkedModelGroupView::~LinkedModelGroupView() {} - - - - void LinkedModelGroupView::modelChanged(LinkedModelGroup *group) { // reconnect models diff --git a/src/gui/LmmsPalette.cpp b/src/gui/LmmsPalette.cpp index 769405d3e..48d6de0df 100644 --- a/src/gui/LmmsPalette.cpp +++ b/src/gui/LmmsPalette.cpp @@ -52,10 +52,6 @@ LmmsPalette::LmmsPalette( QWidget * parent, QStyle * stylearg ) : ensurePolished(); } -LmmsPalette::~LmmsPalette() -{ -} - #define ACCESSMET( read, write ) \ QColor LmmsPalette:: read () const \ { return m_##read ; } \ diff --git a/src/gui/Lv2ViewBase.cpp b/src/gui/Lv2ViewBase.cpp index 7f7a06959..9e95fca2e 100644 --- a/src/gui/Lv2ViewBase.cpp +++ b/src/gui/Lv2ViewBase.cpp @@ -126,11 +126,6 @@ Lv2ViewProc::Lv2ViewProc(QWidget* parent, Lv2Proc* ctrlBase, int colNum) : -Lv2ViewProc::~Lv2ViewProc() {} - - - - AutoLilvNode Lv2ViewProc::uri(const char *uriStr) { return Engine::getLv2Manager()->uri(uriStr); diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index 6e3d9f95a..32355edd6 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -113,7 +113,7 @@ MixerView::MixerView() : public: ChannelArea( QWidget * parent, MixerView * mv ) : QScrollArea( parent ), m_mv( mv ) {} - ~ChannelArea() override {} + ~ChannelArea() override = default; void keyPressEvent( QKeyEvent * e ) override { m_mv->keyPressEvent( e ); diff --git a/src/gui/PeakControllerDialog.cpp b/src/gui/PeakControllerDialog.cpp index 62307fc7d..760c42591 100644 --- a/src/gui/PeakControllerDialog.cpp +++ b/src/gui/PeakControllerDialog.cpp @@ -55,12 +55,6 @@ PeakControllerDialog::PeakControllerDialog( Controller * _model, QWidget * _pare -PeakControllerDialog::~PeakControllerDialog() -{ -} - - - /* void effectView::closeEffects() { diff --git a/src/gui/ProjectNotes.cpp b/src/gui/ProjectNotes.cpp index 22e806cdb..15e507889 100644 --- a/src/gui/ProjectNotes.cpp +++ b/src/gui/ProjectNotes.cpp @@ -84,13 +84,6 @@ ProjectNotes::ProjectNotes() : -ProjectNotes::~ProjectNotes() -{ -} - - - - void ProjectNotes::clear() { m_edit->setHtml( tr( "Enter project notes here" ) ); diff --git a/src/gui/SampleTrackWindow.cpp b/src/gui/SampleTrackWindow.cpp index c8901dda2..c12ab1b1a 100644 --- a/src/gui/SampleTrackWindow.cpp +++ b/src/gui/SampleTrackWindow.cpp @@ -163,11 +163,6 @@ SampleTrackWindow::SampleTrackWindow(SampleTrackView * tv) : subWin->hide(); } -SampleTrackWindow::~SampleTrackWindow() -{ -} - - void SampleTrackWindow::setSampleTrackView(SampleTrackView* tv) { diff --git a/src/gui/SideBar.cpp b/src/gui/SideBar.cpp index e16367a7b..d3935024d 100644 --- a/src/gui/SideBar.cpp +++ b/src/gui/SideBar.cpp @@ -101,13 +101,6 @@ SideBar::SideBar( Qt::Orientation _orientation, QWidget * _parent ) : -SideBar::~SideBar() -{ -} - - - - void SideBar::appendTab( SideBarWidget *widget ) { SideBarButton *button = new SideBarButton( orientation(), this ); diff --git a/src/gui/SideBarWidget.cpp b/src/gui/SideBarWidget.cpp index 600ed245c..cf0233af1 100644 --- a/src/gui/SideBarWidget.cpp +++ b/src/gui/SideBarWidget.cpp @@ -55,13 +55,6 @@ SideBarWidget::SideBarWidget( const QString & _title, const QPixmap & _icon, -SideBarWidget::~SideBarWidget() -{ -} - - - - void SideBarWidget::paintEvent( QPaintEvent * ) { QPainter p( this ); diff --git a/src/gui/clips/AutomationClipView.cpp b/src/gui/clips/AutomationClipView.cpp index 2bc29184c..1ecf78155 100644 --- a/src/gui/clips/AutomationClipView.cpp +++ b/src/gui/clips/AutomationClipView.cpp @@ -71,13 +71,6 @@ AutomationClipView::AutomationClipView( AutomationClip * _clip, -AutomationClipView::~AutomationClipView() -{ -} - - - - void AutomationClipView::openInAutomationEditor() { if(getGUI() != nullptr) diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index fba88643e..2cc9a6faf 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -1967,11 +1967,6 @@ AutomationEditorWindow::AutomationEditorWindow() : } -AutomationEditorWindow::~AutomationEditorWindow() -{ -} - - void AutomationEditorWindow::setCurrentClip(AutomationClip* clip) { // Disconnect our old clip diff --git a/src/gui/editors/Editor.cpp b/src/gui/editors/Editor.cpp index 19f64a65c..cd2a23f66 100644 --- a/src/gui/editors/Editor.cpp +++ b/src/gui/editors/Editor.cpp @@ -133,11 +133,6 @@ Editor::Editor(bool record, bool stepRecord) : addButton(m_stopAction, "stopButton"); } -Editor::~Editor() -{ - -} - QAction *Editor::playAction() const { return m_playAction; diff --git a/src/gui/editors/PatternEditor.cpp b/src/gui/editors/PatternEditor.cpp index 86a116dd2..4c00942db 100644 --- a/src/gui/editors/PatternEditor.cpp +++ b/src/gui/editors/PatternEditor.cpp @@ -301,11 +301,6 @@ PatternEditorWindow::PatternEditorWindow(PatternStore* ps) : } -PatternEditorWindow::~PatternEditorWindow() -{ -} - - QSize PatternEditorWindow::sizeHint() const { return {minimumWidth() + 10, 300}; diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index b9f0e1397..0a10fa354 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -625,11 +625,6 @@ void PianoRoll::markSemiTone(int i, bool fromMenu) } -PianoRoll::~PianoRoll() -{ -} - - void PianoRoll::setGhostMidiClip( MidiClip* newMidiClip ) { // Expects a pointer to a MIDI clip or nullptr. diff --git a/src/gui/editors/Rubberband.cpp b/src/gui/editors/Rubberband.cpp index c1ef329f0..cfff787e0 100644 --- a/src/gui/editors/Rubberband.cpp +++ b/src/gui/editors/Rubberband.cpp @@ -38,13 +38,6 @@ RubberBand::RubberBand( QWidget * _parent ) : -RubberBand::~RubberBand() -{ -} - - - - QVector RubberBand::selectedObjects() const { QVector so = selectableObjects(); diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index eaabf52ea..bd1269b2a 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -277,10 +277,6 @@ SongEditor::SongEditor( Song * song ) : -SongEditor::~SongEditor() -{ -} - void SongEditor::saveSettings( QDomDocument& doc, QDomElement& element ) { MainWindow::saveWidgetState( parentWidget(), element ); diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index 43309d96b..e7db85e43 100644 --- a/src/gui/editors/TrackContainerView.cpp +++ b/src/gui/editors/TrackContainerView.cpp @@ -487,13 +487,6 @@ TrackContainerView::scrollArea::scrollArea( TrackContainerView * _parent ) : -TrackContainerView::scrollArea::~scrollArea() -{ -} - - - - void TrackContainerView::scrollArea::wheelEvent( QWheelEvent * _we ) { // always pass wheel-event to parent-widget (song-editor diff --git a/src/gui/instrument/InstrumentMidiIOView.cpp b/src/gui/instrument/InstrumentMidiIOView.cpp index 68491d6e6..31eebca20 100644 --- a/src/gui/instrument/InstrumentMidiIOView.cpp +++ b/src/gui/instrument/InstrumentMidiIOView.cpp @@ -171,12 +171,6 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : -InstrumentMidiIOView::~InstrumentMidiIOView() -{ -} - - - void InstrumentMidiIOView::modelChanged() { diff --git a/src/gui/instrument/InstrumentView.cpp b/src/gui/instrument/InstrumentView.cpp index 23e758cf2..fe2c04cfb 100644 --- a/src/gui/instrument/InstrumentView.cpp +++ b/src/gui/instrument/InstrumentView.cpp @@ -75,9 +75,5 @@ InstrumentTrackWindow * InstrumentView::instrumentTrackWindow() -InstrumentViewFixedSize::~InstrumentViewFixedSize() -{ -} - } // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/menus/MidiPortMenu.cpp b/src/gui/menus/MidiPortMenu.cpp index 88e6a4f30..a7c61fb0c 100644 --- a/src/gui/menus/MidiPortMenu.cpp +++ b/src/gui/menus/MidiPortMenu.cpp @@ -42,12 +42,6 @@ MidiPortMenu::MidiPortMenu( MidiPort::Modes _mode ) : -MidiPortMenu::~MidiPortMenu() -{ -} - - - void MidiPortMenu::modelChanged() { diff --git a/src/gui/modals/ControllerConnectionDialog.cpp b/src/gui/modals/ControllerConnectionDialog.cpp index fb86328a1..12dd7c6ef 100644 --- a/src/gui/modals/ControllerConnectionDialog.cpp +++ b/src/gui/modals/ControllerConnectionDialog.cpp @@ -60,9 +60,7 @@ public: } - ~AutoDetectMidiController() override - { - } + ~AutoDetectMidiController() override = default; void processInEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset = 0 ) override diff --git a/src/gui/modals/RenameDialog.cpp b/src/gui/modals/RenameDialog.cpp index 0028cd1a0..381064f39 100644 --- a/src/gui/modals/RenameDialog.cpp +++ b/src/gui/modals/RenameDialog.cpp @@ -52,12 +52,6 @@ RenameDialog::RenameDialog( QString & _string ) : -RenameDialog::~RenameDialog() -{ -} - - - void RenameDialog::resizeEvent (QResizeEvent * event) { m_stringLE->setGeometry ( 10, 5, width() - 20, 20 ); diff --git a/src/gui/tracks/FadeButton.cpp b/src/gui/tracks/FadeButton.cpp index d4b75cbf1..2f4727e5e 100644 --- a/src/gui/tracks/FadeButton.cpp +++ b/src/gui/tracks/FadeButton.cpp @@ -55,11 +55,6 @@ FadeButton::FadeButton(const QColor & _normal_color, - -FadeButton::~FadeButton() -{ -} - void FadeButton::setActiveColor(const QColor & activated_color) { m_activatedColor = activated_color; diff --git a/src/gui/tracks/TrackContentWidget.cpp b/src/gui/tracks/TrackContentWidget.cpp index 5e6344ec4..e22750ce3 100644 --- a/src/gui/tracks/TrackContentWidget.cpp +++ b/src/gui/tracks/TrackContentWidget.cpp @@ -82,14 +82,6 @@ TrackContentWidget::TrackContentWidget( TrackView * parent ) : -/*! \brief Destroy this trackContentWidget - * - * Destroys the trackContentWidget. - */ -TrackContentWidget::~TrackContentWidget() -{ -} - diff --git a/src/gui/tracks/TrackLabelButton.cpp b/src/gui/tracks/TrackLabelButton.cpp index 77e678617..4e0b2be35 100644 --- a/src/gui/tracks/TrackLabelButton.cpp +++ b/src/gui/tracks/TrackLabelButton.cpp @@ -73,11 +73,6 @@ TrackLabelButton::TrackLabelButton( TrackView * _tv, QWidget * _parent ) : -TrackLabelButton::~TrackLabelButton() -{ -} - - void TrackLabelButton::rename() diff --git a/src/gui/tracks/TrackOperationsWidget.cpp b/src/gui/tracks/TrackOperationsWidget.cpp index bef6ddcbf..b3c8ac379 100644 --- a/src/gui/tracks/TrackOperationsWidget.cpp +++ b/src/gui/tracks/TrackOperationsWidget.cpp @@ -120,13 +120,6 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : -/*! \brief Destroy an existing trackOperationsWidget - * - */ -TrackOperationsWidget::~TrackOperationsWidget() -{ -} - diff --git a/src/gui/tracks/TrackView.cpp b/src/gui/tracks/TrackView.cpp index 2065b0b53..4eece14d4 100644 --- a/src/gui/tracks/TrackView.cpp +++ b/src/gui/tracks/TrackView.cpp @@ -115,12 +115,6 @@ TrackView::TrackView( Track * track, TrackContainerView * tcv ) : -/*! \brief Destroy this track View. - * - */ -TrackView::~TrackView() -{ -} diff --git a/src/gui/widgets/AutomatableSlider.cpp b/src/gui/widgets/AutomatableSlider.cpp index 13cd9771f..7e1be0e06 100644 --- a/src/gui/widgets/AutomatableSlider.cpp +++ b/src/gui/widgets/AutomatableSlider.cpp @@ -51,10 +51,6 @@ AutomatableSlider::AutomatableSlider( QWidget * _parent, -AutomatableSlider::~AutomatableSlider() -{ -} - diff --git a/src/gui/widgets/CPULoadWidget.cpp b/src/gui/widgets/CPULoadWidget.cpp index 3f465d347..799e037ef 100644 --- a/src/gui/widgets/CPULoadWidget.cpp +++ b/src/gui/widgets/CPULoadWidget.cpp @@ -59,10 +59,6 @@ CPULoadWidget::CPULoadWidget( QWidget * _parent ) : -CPULoadWidget::~CPULoadWidget() -{ -} - diff --git a/src/gui/widgets/CaptionMenu.cpp b/src/gui/widgets/CaptionMenu.cpp index 032ee10b9..bfcd3003e 100644 --- a/src/gui/widgets/CaptionMenu.cpp +++ b/src/gui/widgets/CaptionMenu.cpp @@ -40,9 +40,5 @@ 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 7b6121b23..bdf78ccce 100644 --- a/src/gui/widgets/ComboBox.cpp +++ b/src/gui/widgets/ComboBox.cpp @@ -82,10 +82,6 @@ ComboBox::ComboBox( QWidget * _parent, const QString & _name ) : -ComboBox::~ComboBox() -{ -} - void ComboBox::selectNext() diff --git a/src/gui/widgets/MeterDialog.cpp b/src/gui/widgets/MeterDialog.cpp index f60f6bd06..c13fe3802 100644 --- a/src/gui/widgets/MeterDialog.cpp +++ b/src/gui/widgets/MeterDialog.cpp @@ -103,10 +103,6 @@ MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : -MeterDialog::~MeterDialog() -{ -} - diff --git a/src/gui/widgets/PixmapButton.cpp b/src/gui/widgets/PixmapButton.cpp index 938322b51..13c09c52e 100644 --- a/src/gui/widgets/PixmapButton.cpp +++ b/src/gui/widgets/PixmapButton.cpp @@ -47,10 +47,6 @@ PixmapButton::PixmapButton( QWidget * _parent, const QString & _name ) : -PixmapButton::~PixmapButton() -{ -} - From c075ba93fb77b38819a0e536be05c6b0b90e21ed Mon Sep 17 00:00:00 2001 From: Levin Oehlmann Date: Sun, 26 Jun 2022 08:54:59 +0200 Subject: [PATCH 13/55] clang-tidy: Run modernize-use-emplace everywhere (#6451) ... to avoid constructing and copying temp objects --- include/RemotePluginBase.h | 4 ++-- plugins/MidiExport/MidiExport.cpp | 2 +- src/core/Scale.cpp | 2 +- src/gui/MicrotunerConfig.cpp | 6 +++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/RemotePluginBase.h b/include/RemotePluginBase.h index c5bf35bcb..8ecf47087 100644 --- a/include/RemotePluginBase.h +++ b/include/RemotePluginBase.h @@ -408,7 +408,7 @@ public: { char buf[32]; sprintf( buf, "%d", _i ); - data.push_back( std::string( buf ) ); + data.emplace_back( buf ); return *this; } @@ -416,7 +416,7 @@ public: { char buf[32]; sprintf( buf, "%f", _f ); - data.push_back( std::string( buf ) ); + data.emplace_back( buf ); return *this; } diff --git a/plugins/MidiExport/MidiExport.cpp b/plugins/MidiExport/MidiExport.cpp index 23164276c..cb8939778 100644 --- a/plugins/MidiExport/MidiExport.cpp +++ b/plugins/MidiExport/MidiExport.cpp @@ -157,7 +157,7 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks, QDomElement it = n.toElement(); int pos = it.attribute("pos", "0").toInt(); int len = it.attribute("len", "0").toInt(); - plist.push_back(std::pair(pos, pos+len)); + plist.emplace_back(pos, pos+len); } } std::sort(plist.begin(), plist.end()); diff --git a/src/core/Scale.cpp b/src/core/Scale.cpp index 762da4ff8..df0effe6b 100644 --- a/src/core/Scale.cpp +++ b/src/core/Scale.cpp @@ -75,7 +75,7 @@ void Interval::loadSettings(const QDomElement &element) Scale::Scale() : m_description(tr("empty")) { - m_intervals.push_back(Interval(1, 1)); + m_intervals.emplace_back(1, 1); } Scale::Scale(QString description, std::vector intervals) : diff --git a/src/gui/MicrotunerConfig.cpp b/src/gui/MicrotunerConfig.cpp index 4522da5c5..2f0f0edd9 100644 --- a/src/gui/MicrotunerConfig.cpp +++ b/src/gui/MicrotunerConfig.cpp @@ -397,7 +397,7 @@ bool MicrotunerConfig::applyScale() if (!validateScaleForm()) {return false;}; std::vector newIntervals; - newIntervals.push_back(Interval(1, 1)); + newIntervals.emplace_back(1, 1); #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) QStringList input = m_keymapTextEdit->toPlainText().split('\n', Qt::SkipEmptyParts); @@ -411,7 +411,7 @@ bool MicrotunerConfig::applyScale() QString firstSection = line.section(QRegExp("\\s+|/"), 0, 0, QString::SectionSkipEmpty); if (firstSection.contains('.')) // cent mode { - newIntervals.push_back(Interval(firstSection.toFloat())); + newIntervals.emplace_back(firstSection.toFloat()); } else // ratio mode { @@ -421,7 +421,7 @@ bool MicrotunerConfig::applyScale() { den = line.split('/').at(1).section(QRegExp("\\s+"), 0, 0, QString::SectionSkipEmpty).toInt(); } - newIntervals.push_back(Interval(num, den)); + newIntervals.emplace_back(num, den); } } From 29efb5d6ba1e0e342a29a89cb53a1432c16bb09c Mon Sep 17 00:00:00 2001 From: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> Date: Sat, 2 Jul 2022 10:20:46 +0200 Subject: [PATCH 14/55] MidiRawClient: Fix setting useless param (#6431) MidiChannelPressure and MidiProgramChange have only one param, so only set this one param for those. --- src/core/midi/MidiClient.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/midi/MidiClient.cpp b/src/core/midi/MidiClient.cpp index af7cfee0a..1c200bc1b 100644 --- a/src/core/midi/MidiClient.cpp +++ b/src/core/midi/MidiClient.cpp @@ -203,12 +203,15 @@ void MidiClientRaw::parseData( const unsigned char c ) case MidiNoteOff: case MidiNoteOn: case MidiKeyPressure: - case MidiChannelPressure: - case MidiProgramChange: m_midiParseData.m_midiEvent.setKey(m_midiParseData.m_buffer[0]); m_midiParseData.m_midiEvent.setVelocity(m_midiParseData.m_buffer[1]); break; + case MidiChannelPressure: + case MidiProgramChange: + m_midiParseData.m_midiEvent.setParam(0, m_midiParseData.m_buffer[0]); + break; + case MidiControlChange: m_midiParseData.m_midiEvent.setControllerNumber(m_midiParseData.m_buffer[0]); m_midiParseData.m_midiEvent.setControllerValue( m_midiParseData.m_buffer[1]); From 9705c31773fb81d423b4b0bf8a7cf27e723911a9 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 4 Jul 2022 03:16:22 +0200 Subject: [PATCH 15/55] Transpose midi clips in song editor (#6409) * Transpose midi clips in song editor * Fix undo stupidity * Check boundries when transposing clips and move transpose function to NoteVector * Avoid update if nothing has changed * Make getNoteBounds a separate function * Rename getNoteBounds to boundsForNotes * bool operator instead of optional + qobject_cast * Revert "bool operator instead of optional + qobject_cast" This reverts commit 98c56a96cf1538dcdce481c0a1c045b2660a59ee. * qobject_cast and nullopt --- include/MidiClipView.h | 1 + include/Note.h | 13 +++++++ src/core/Note.cpp | 29 +++++++++++++++ src/gui/clips/MidiClipView.cpp | 68 +++++++++++++++++++++++++++++++++- 4 files changed, 109 insertions(+), 2 deletions(-) diff --git a/include/MidiClipView.h b/include/MidiClipView.h index 278e49443..1a9809733 100644 --- a/include/MidiClipView.h +++ b/include/MidiClipView.h @@ -73,6 +73,7 @@ protected slots: void resetName(); void changeName(); + void transposeSelection(); protected: diff --git a/include/Note.h b/include/Note.h index f1c10c0ac..01338be49 100644 --- a/include/Note.h +++ b/include/Note.h @@ -26,6 +26,7 @@ #ifndef NOTE_H #define NOTE_H +#include #include #include "volume.h" @@ -252,6 +253,18 @@ private: typedef QVector NoteVector; +struct NoteBounds +{ + TimePos start; + TimePos end; + int lowest; + int highest; +}; + + +std::optional boundsForNotes(const NoteVector& notes); + + } // namespace lmms #endif diff --git a/src/core/Note.cpp b/src/core/Note.cpp index b730ec1cc..e4e5f0e5d 100644 --- a/src/core/Note.cpp +++ b/src/core/Note.cpp @@ -237,4 +237,33 @@ bool Note::withinRange(int tickStart, int tickEnd) const } + + +/*! \brief Get the start/end/bottom/top positions of notes in a vector + * + * Returns no value if there are no notes + */ +std::optional boundsForNotes(const NoteVector& notes) +{ + if (notes.empty()) { return std::nullopt; } + + TimePos start = notes.front()->pos(); + TimePos end = start; + int lower = notes.front()->key(); + int upper = lower; + + for (const Note* note: notes) + { + // TODO should we assume that NoteVector is always sorted correctly, + // so first() always has the lowest time position? + start = std::min(start, note->pos()); + end = std::max(end, note->endPos()); + lower = std::min(lower, note->key()); + upper = std::max(upper, note->key()); + } + + return NoteBounds{start, end, lower, upper}; +} + + } // namespace lmms diff --git a/src/gui/clips/MidiClipView.cpp b/src/gui/clips/MidiClipView.cpp index 675b350db..720999574 100644 --- a/src/gui/clips/MidiClipView.cpp +++ b/src/gui/clips/MidiClipView.cpp @@ -27,6 +27,7 @@ #include #include +#include #include #include @@ -36,6 +37,7 @@ #include "MidiClip.h" #include "PianoRoll.h" #include "RenameDialog.h" +#include "TrackView.h" namespace lmms::gui { @@ -144,8 +146,66 @@ void MidiClipView::changeName() +void MidiClipView::transposeSelection() +{ + const auto selection = getClickedClips(); + + // Calculate the key boundries for all clips + int highest = 0; + int lowest = NumKeys - 1; + for (ClipView* clipview: selection) + { + if (auto mcv = qobject_cast(clipview)) + { + if (auto bounds = boundsForNotes(mcv->getMidiClip()->notes())) + { + lowest = std::min(bounds->lowest, lowest); + highest = std::max(bounds->highest, highest); + } + } + } + + int semitones = QInputDialog::getInt(this, tr("Transpose"), tr("Semitones to transpose by:"), + /*start*/ 0, /*min*/ -lowest, /*max*/ (NumKeys - 1 - highest)); + + if (semitones == 0) { return; } + + // TODO make this not crash + // Engine::getSong()->addJournalCheckPoint(); + + QSet m_changedTracks; + for (ClipView* clipview: selection) + { + auto mcv = qobject_cast(clipview); + if (!mcv) { continue; } + + auto clip = mcv->getMidiClip(); + if (clip->notes().empty()) { continue; } + + auto track = clipview->getTrackView()->getTrack(); + if (!m_changedTracks.contains(track)) + { + track->addJournalCheckPoint(); + m_changedTracks.insert(track); + } + + for (Note* note: clip->notes()) + { + note->setKey(note->key() + semitones); + } + emit clip->dataChanged(); + } + // At least one clip must have notes to show the transpose dialog, so something *has* changed + Engine::getSong()->setModified(); +} + + + + void MidiClipView::constructContextMenu( QMenu * _cm ) { + bool isBeat = m_clip->type() == MidiClip::BeatClip; + QAction * a = new QAction( embed::getIconPixmap( "piano" ), tr( "Open in piano-roll" ), _cm ); _cm->insertAction( _cm->actions()[0], a ); @@ -163,6 +223,10 @@ void MidiClipView::constructContextMenu( QMenu * _cm ) _cm->addAction( embed::getIconPixmap( "edit_erase" ), tr( "Clear all notes" ), m_clip, SLOT(clear())); + if (!isBeat) + { + _cm->addAction(embed::getIconPixmap("scale"), tr("Transpose"), this, &MidiClipView::transposeSelection); + } _cm->addSeparator(); _cm->addAction( embed::getIconPixmap( "reload" ), tr( "Reset name" ), @@ -171,7 +235,7 @@ void MidiClipView::constructContextMenu( QMenu * _cm ) tr( "Change name" ), this, SLOT(changeName())); - if ( m_clip->type() == MidiClip::BeatClip ) + if (isBeat) { _cm->addSeparator(); @@ -622,4 +686,4 @@ void MidiClipView::paintEvent( QPaintEvent * ) } -} // namespace lmms::gui \ No newline at end of file +} // namespace lmms::gui From 6c3e148fbb3ea1487515fe80838d2accaf22d8f4 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Mon, 4 Jul 2022 17:03:17 +0100 Subject: [PATCH 16/55] Make VST sync always-on and non-global (#6418) --- include/RemotePluginBase.h | 2 +- include/RemotePluginClient.h | 43 +++++------- include/SetupDialog.h | 2 - include/Song.h | 2 + include/VstSyncController.h | 40 +++-------- include/VstSyncData.h | 1 - plugins/VstBase/RemoteVstPlugin.cpp | 103 ++++++++-------------------- src/core/RemotePlugin.cpp | 2 + src/core/VstSyncController.cpp | 95 +++++++++++++++---------- src/gui/modals/SetupDialog.cpp | 13 ---- 10 files changed, 120 insertions(+), 183 deletions(-) diff --git a/include/RemotePluginBase.h b/include/RemotePluginBase.h index 8ecf47087..0a3601d7c 100644 --- a/include/RemotePluginBase.h +++ b/include/RemotePluginBase.h @@ -26,7 +26,6 @@ #define REMOTE_PLUGIN_BASE_H #include "MidiEvent.h" -#include "VstSyncData.h" #include #include @@ -352,6 +351,7 @@ enum RemoteMessageIDs IdHostInfoGotten, IdInitDone, IdQuit, + IdSyncKey, IdSampleRateInformation, IdBufferSizeInformation, IdInformationUpdated, diff --git a/include/RemotePluginClient.h b/include/RemotePluginClient.h index b96b71b85..2d825486e 100644 --- a/include/RemotePluginClient.h +++ b/include/RemotePluginClient.h @@ -39,6 +39,7 @@ #endif #include "SharedMemory.h" +#include "VstSyncData.h" namespace lmms { @@ -124,8 +125,7 @@ private: void doProcessing(); SharedMemory m_audioBuffer; - SharedMemory m_vstSyncShm; - const VstSyncData* m_vstSyncData; + SharedMemory m_vstSyncData; int m_inputCount; int m_outputCount; @@ -182,7 +182,6 @@ RemotePluginClient::RemotePluginClient( const std::string& _shm_in, const std::s RemotePluginClient::RemotePluginClient( const char * socketPath ) : RemotePluginBase(), #endif - m_vstSyncData( nullptr ), m_inputCount( 0 ), m_outputCount( 0 ), m_sampleRate( 44100 ), @@ -211,26 +210,6 @@ RemotePluginClient::RemotePluginClient( const char * socketPath ) : fprintf( stderr, "Could not connect to local server.\n" ); } #endif - - try - { - m_vstSyncShm.attach("usr_bin_lmms"); - m_vstSyncData = m_vstSyncShm.get(); - m_bufferSize = m_vstSyncData->m_bufferSize; - m_sampleRate = m_vstSyncData->m_sampleRate; - } - catch (const std::runtime_error&) - { - // if attaching shared memory fails - sendMessage( IdSampleRateInformation ); - sendMessage( IdBufferSizeInformation ); - if( waitForMessage( IdBufferSizeInformation ).id - != IdBufferSizeInformation ) - { - fprintf( stderr, "Could not get buffer size information\n" ); - } - } - sendMessage( IdHostInfoGotten ); } @@ -253,7 +232,7 @@ RemotePluginClient::~RemotePluginClient() const VstSyncData* RemotePluginClient::getVstSyncData() { - return m_vstSyncData; + return m_vstSyncData.get(); } @@ -268,6 +247,22 @@ bool RemotePluginClient::processMessage( const message & _m ) case IdUndefined: return false; + case IdSyncKey: + try + { + m_vstSyncData.attach(_m.getString(0)); + } + catch (const std::runtime_error& error) + { + debugMessage(std::string{"Failed to attach sync data: "} + error.what() + '\n'); + std::exit(EXIT_FAILURE); + } + m_bufferSize = m_vstSyncData->m_bufferSize; + m_sampleRate = m_vstSyncData->m_sampleRate; + reply_message.id = IdHostInfoGotten; + reply = true; + break; + case IdSampleRateInformation: m_sampleRate = _m.getInt(); updateSampleRate(); diff --git a/include/SetupDialog.h b/include/SetupDialog.h index 9ce6e043d..40d552d63 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -95,7 +95,6 @@ private slots: void toggleRunningAutoSave(bool enabled); void toggleSmoothScroll(bool enabled); void toggleAnimateAFP(bool enabled); - void toggleSyncVSTPlugins(bool enabled); void vstEmbedMethodChanged(); void toggleVSTAlwaysOnTop(bool en); void toggleDisableAutoQuit(bool enabled); @@ -164,7 +163,6 @@ private: QString m_vstEmbedMethod; LedCheckBox * m_vstAlwaysOnTopCheckBox; bool m_vstAlwaysOnTop; - bool m_syncVSTPlugins; bool m_disableAutoQuit; diff --git a/include/Song.h b/include/Song.h index 422e645bf..569b3ad14 100644 --- a/include/Song.h +++ b/include/Song.h @@ -366,6 +366,8 @@ public: void setScale(unsigned int index, std::shared_ptr newScale); void setKeymap(unsigned int index, std::shared_ptr newMap); + const std::string& syncKey() const noexcept { return m_vstSyncController.sharedMemoryKey(); } + public slots: void playSong(); void record(); diff --git a/include/VstSyncController.h b/include/VstSyncController.h index d5e6617cd..c70bc85c8 100644 --- a/include/VstSyncController.h +++ b/include/VstSyncController.h @@ -40,45 +40,23 @@ class VstSyncController : public QObject Q_OBJECT public: VstSyncController(); - ~VstSyncController() override; - - void setAbsolutePosition( double ticks ); - - void setPlaybackState( bool enabled ) - { - m_syncData->isPlaying = enabled; - } - - void setTempo( int newTempo ); - - void setTimeSignature( int num, int denom ) - { - m_syncData->timeSigNumer = num; - m_syncData->timeSigDenom = denom; - } - - void startCycle( int startTick, int endTick ); - - void stopCycle() - { - m_syncData->isCycle = false; - } - - void setPlaybackJumped( bool jumped ) - { - m_syncData->m_playbackJumped = jumped; - } + void setAbsolutePosition(double ticks); + void setPlaybackState(bool enabled); + void setTempo(int newTempo); + void setTimeSignature(int num, int denom); + void startCycle(int startTick, int endTick); + void stopCycle(); + void setPlaybackJumped(bool jumped); void update(); + const std::string& sharedMemoryKey() const noexcept { return m_syncData.key(); } private slots: void updateSampleRate(); - private: - VstSyncData* m_syncData; - SharedMemory m_shm; + SharedMemory m_syncData; }; diff --git a/include/VstSyncData.h b/include/VstSyncData.h index bf4d42b80..baf3fa7a8 100644 --- a/include/VstSyncData.h +++ b/include/VstSyncData.h @@ -46,7 +46,6 @@ struct VstSyncData int timeSigDenom; bool isPlaying; bool isCycle; - bool hasSHM; float cycleStart; float cycleEnd; bool m_playbackJumped; diff --git a/plugins/VstBase/RemoteVstPlugin.cpp b/plugins/VstBase/RemoteVstPlugin.cpp index 520211f68..a94ea5e3a 100644 --- a/plugins/VstBase/RemoteVstPlugin.cpp +++ b/plugins/VstBase/RemoteVstPlugin.cpp @@ -491,10 +491,7 @@ private: } ; in * m_in; - - const VstSyncData* m_vstSyncData; - -} ; +}; @@ -523,29 +520,10 @@ RemoteVstPlugin::RemoteVstPlugin( const char * socketPath ) : m_bpm( 0 ), m_currentSamplePos( 0 ), m_currentProgram( -1 ), - m_in( nullptr ), - m_vstSyncData( nullptr ) + m_in( nullptr ) { __plugin = this; - m_vstSyncData = RemotePluginClient::getVstSyncData(); - if( m_vstSyncData == nullptr ) - { - fprintf(stderr, "RemoteVstPlugin.cpp: " - "Failed to initialize shared memory for VST synchronization.\n" - " (VST-host synchronization will be disabled)\n"); - const auto vstSyncData = (VstSyncData*) malloc( sizeof( VstSyncData ) ); - vstSyncData->isPlaying = true; - vstSyncData->timeSigNumer = 4; - vstSyncData->timeSigDenom = 4; - vstSyncData->ppqPos = 0; - vstSyncData->isCycle = false; - vstSyncData->hasSHM = false; - vstSyncData->m_playbackJumped = false; - vstSyncData->m_sampleRate = sampleRate(); - m_vstSyncData = vstSyncData; - } - m_in = ( in* ) new char[ sizeof( in ) ]; m_in->lastppqPos = 0; m_in->m_Timestamp = -1; @@ -572,12 +550,6 @@ RemoteVstPlugin::~RemoteVstPlugin() setResumed( false ); pluginDispatch( effClose ); - if (!m_vstSyncData->hasSHM) - { - delete m_vstSyncData; - m_vstSyncData = nullptr; - } - if( m_libInst != nullptr ) { #ifndef NATIVE_LINUX_VST @@ -1808,86 +1780,71 @@ intptr_t RemoteVstPlugin::hostCallback( AEffect * _effect, int32_t _opcode, return 0; case audioMasterGetTime: + { SHOW_CALLBACK( "amc: audioMasterGetTime\n" ); // returns const VstTimeInfo* (or 0 if not supported) // should contain a mask indicating which // fields are required (see valid masks above), as some // items may require extensive conversions - // Shared memory was initialised? - see song.cpp - //assert( __plugin->m_vstSyncData != nullptr ); + const auto syncData = __plugin->getVstSyncData(); + assert(syncData != nullptr); memset( &_timeInfo, 0, sizeof( _timeInfo ) ); _timeInfo.samplePos = __plugin->m_currentSamplePos; - _timeInfo.sampleRate = __plugin->m_vstSyncData->hasSHM ? - __plugin->m_vstSyncData->m_sampleRate : - __plugin->sampleRate(); + _timeInfo.sampleRate = syncData->m_sampleRate; _timeInfo.flags = 0; - _timeInfo.tempo = __plugin->m_vstSyncData->hasSHM ? - __plugin->m_vstSyncData->m_bpm : - __plugin->m_bpm; - _timeInfo.timeSigNumerator = __plugin->m_vstSyncData->timeSigNumer; - _timeInfo.timeSigDenominator = __plugin->m_vstSyncData->timeSigDenom; + _timeInfo.tempo = syncData->m_bpm; + _timeInfo.timeSigNumerator = syncData->timeSigNumer; + _timeInfo.timeSigDenominator = syncData->timeSigDenom; _timeInfo.flags |= kVstTempoValid; _timeInfo.flags |= kVstTimeSigValid; - if( __plugin->m_vstSyncData->isCycle ) + if (syncData->isCycle) { - _timeInfo.cycleStartPos = __plugin->m_vstSyncData->cycleStart; - _timeInfo.cycleEndPos = __plugin->m_vstSyncData->cycleEnd; + _timeInfo.cycleStartPos = syncData->cycleStart; + _timeInfo.cycleEndPos = syncData->cycleEnd; _timeInfo.flags |= kVstCyclePosValid; _timeInfo.flags |= kVstTransportCycleActive; } - if( __plugin->m_vstSyncData->ppqPos != - __plugin->m_in->m_Timestamp ) + if (syncData->ppqPos != __plugin->m_in->m_Timestamp) { - _timeInfo.ppqPos = __plugin->m_vstSyncData->ppqPos; - __plugin->m_in->lastppqPos = __plugin->m_vstSyncData->ppqPos; - __plugin->m_in->m_Timestamp = __plugin->m_vstSyncData->ppqPos; + _timeInfo.ppqPos = syncData->ppqPos; + __plugin->m_in->lastppqPos = syncData->ppqPos; + __plugin->m_in->m_Timestamp = syncData->ppqPos; } - else if( __plugin->m_vstSyncData->isPlaying ) + else if (syncData->isPlaying) { - if( __plugin->m_vstSyncData->hasSHM ) - { - __plugin->m_in->lastppqPos += - __plugin->m_vstSyncData->m_bpm / 60.0 - * __plugin->m_vstSyncData->m_bufferSize - / __plugin->m_vstSyncData->m_sampleRate; - } - else - { - __plugin->m_in->lastppqPos += - __plugin->m_bpm / 60.0 - * __plugin->bufferSize() - / __plugin->sampleRate(); - } + __plugin->m_in->lastppqPos += + syncData->m_bpm / 60.0 + * syncData->m_bufferSize + / syncData->m_sampleRate; _timeInfo.ppqPos = __plugin->m_in->lastppqPos; } -// _timeInfo.ppqPos = __plugin->m_vstSyncData->ppqPos; +// _timeInfo.ppqPos = syncData->ppqPos; _timeInfo.flags |= kVstPpqPosValid; - if( __plugin->m_vstSyncData->isPlaying ) + if (syncData->isPlaying) { _timeInfo.flags |= kVstTransportPlaying; } - _timeInfo.barStartPos = ( (int) ( _timeInfo.ppqPos / - ( 4 *__plugin->m_vstSyncData->timeSigNumer - / (float) __plugin->m_vstSyncData->timeSigDenom ) ) ) * - ( 4 * __plugin->m_vstSyncData->timeSigNumer - / (float) __plugin->m_vstSyncData->timeSigDenom ); + _timeInfo.barStartPos = ((int) (_timeInfo.ppqPos + / (4 * syncData->timeSigNumer / (float) syncData->timeSigDenom))) + * (4 * syncData->timeSigNumer / (float) syncData->timeSigDenom); _timeInfo.flags |= kVstBarsValid; - if( ( _timeInfo.flags & ( kVstTransportPlaying | kVstTransportCycleActive ) ) != - ( __plugin->m_in->m_lastFlags & ( kVstTransportPlaying | kVstTransportCycleActive ) ) - || __plugin->m_vstSyncData->m_playbackJumped ) + if ((_timeInfo.flags & (kVstTransportPlaying | kVstTransportCycleActive)) + != (__plugin->m_in->m_lastFlags & (kVstTransportPlaying | kVstTransportCycleActive)) + || syncData->m_playbackJumped) { _timeInfo.flags |= kVstTransportChanged; } __plugin->m_in->m_lastFlags = _timeInfo.flags; return (intptr_t) &_timeInfo; + } case audioMasterProcessEvents: SHOW_CALLBACK( "amc: audioMasterProcessEvents\n" ); diff --git a/src/core/RemotePlugin.cpp b/src/core/RemotePlugin.cpp index 62ed9b653..416767011 100644 --- a/src/core/RemotePlugin.cpp +++ b/src/core/RemotePlugin.cpp @@ -36,6 +36,7 @@ #include "BufferManager.h" #include "AudioEngine.h" #include "Engine.h" +#include "Song.h" #include #include @@ -309,6 +310,7 @@ bool RemotePlugin::init(const QString &pluginExecutable, } #endif + sendMessage(message(IdSyncKey).addString(Engine::getSong()->syncKey())); resizeSharedProcessingMemory(); if( waitForInitDoneMsg ) diff --git a/src/core/VstSyncController.cpp b/src/core/VstSyncController.cpp index a08831662..c4b59eb6f 100644 --- a/src/core/VstSyncController.cpp +++ b/src/core/VstSyncController.cpp @@ -28,6 +28,7 @@ #include #include +#include #include "AudioEngine.h" #include "ConfigManager.h" @@ -39,36 +40,16 @@ namespace lmms { -VstSyncController::VstSyncController() : - m_syncData( nullptr ) +VstSyncController::VstSyncController() { - if( ConfigManager::inst()->value( "ui", "syncvstplugins" ).toInt() ) + try { - connect( Engine::audioEngine(), SIGNAL(sampleRateChanged()), this, SLOT(updateSampleRate())); - - try - { - m_shm.create("usr_bin_lmms"); - m_syncData = m_shm.get(); - } - catch (const std::runtime_error& error) - { - qWarning() << "Failed to allocate shared memory for VST sync:" << error.what(); - } + m_syncData.create(QUuid::createUuid().toString().toStdString()); } - else + catch (const std::runtime_error& error) { - qWarning( "VST sync support disabled in your configuration" ); - } - - if( m_syncData == nullptr ) - { - m_syncData = new VstSyncData; - m_syncData->hasSHM = false; - } - else - { - m_syncData->hasSHM = true; + qCritical() << "Failed to allocate shared memory for VST sync:" << error.what(); + return; } m_syncData->isPlaying = false; @@ -76,23 +57,16 @@ VstSyncController::VstSyncController() : m_syncData->timeSigNumer = 4; m_syncData->timeSigDenom = 4; + connect(Engine::audioEngine(), &AudioEngine::sampleRateChanged, this, &VstSyncController::updateSampleRate); updateSampleRate(); } -VstSyncController::~VstSyncController() +void VstSyncController::setAbsolutePosition(double ticks) { - if( m_syncData->hasSHM == false ) - { - delete m_syncData; - } -} + if (!m_syncData) { return; } - - -void VstSyncController::setAbsolutePosition( double ticks ) -{ #ifdef VST_SNC_LATENCY m_syncData->ppqPos = ( ( ticks + 0 ) / 48.0 ) - m_syncData->m_latency; #else @@ -102,8 +76,19 @@ void VstSyncController::setAbsolutePosition( double ticks ) -void VstSyncController::setTempo( int newTempo ) +void VstSyncController::setPlaybackState(bool enabled) { + if (!m_syncData) { return; } + + m_syncData->isPlaying = enabled; +} + + + +void VstSyncController::setTempo(int newTempo) +{ + if (!m_syncData) { return; } + m_syncData->m_bpm = newTempo; #ifdef VST_SNC_LATENCY @@ -114,8 +99,20 @@ void VstSyncController::setTempo( int newTempo ) -void VstSyncController::startCycle( int startTick, int endTick ) +void VstSyncController::setTimeSignature(int num, int denom) { + if (!m_syncData) { return; } + + m_syncData->timeSigNumer = num; + m_syncData->timeSigDenom = denom; +} + + + +void VstSyncController::startCycle(int startTick, int endTick) +{ + if (!m_syncData) { return; } + m_syncData->isCycle = true; m_syncData->cycleStart = startTick / (float)48; m_syncData->cycleEnd = endTick / (float)48; @@ -123,8 +120,28 @@ void VstSyncController::startCycle( int startTick, int endTick ) +void VstSyncController::stopCycle() +{ + if (!m_syncData) { return; } + + m_syncData->isCycle = false; +} + + + +void VstSyncController::setPlaybackJumped(bool jumped) +{ + if (!m_syncData) { return; } + + m_syncData->m_playbackJumped = jumped; +} + + + void VstSyncController::update() { + if (!m_syncData) { return; } + m_syncData->m_bufferSize = Engine::audioEngine()->framesPerPeriod(); #ifdef VST_SNC_LATENCY @@ -136,6 +153,8 @@ void VstSyncController::update() void VstSyncController::updateSampleRate() { + if (!m_syncData) { return; } + m_syncData->m_sampleRate = Engine::audioEngine()->processingSampleRate(); #ifdef VST_SNC_LATENCY diff --git a/src/gui/modals/SetupDialog.cpp b/src/gui/modals/SetupDialog.cpp index 9c15f5b53..f6b6428d7 100644 --- a/src/gui/modals/SetupDialog.cpp +++ b/src/gui/modals/SetupDialog.cpp @@ -136,8 +136,6 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : m_vstEmbedMethod(ConfigManager::inst()->vstEmbedMethod()), m_vstAlwaysOnTop(ConfigManager::inst()->value( "ui", "vstalwaysontop").toInt()), - m_syncVSTPlugins(ConfigManager::inst()->value( - "ui", "syncvstplugins", "1").toInt()), m_disableAutoQuit(ConfigManager::inst()->value( "ui", "disableautoquit", "1").toInt()), m_NaNHandler(ConfigManager::inst()->value( @@ -433,9 +431,6 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : connect(m_vstAlwaysOnTopCheckBox, SIGNAL(toggled(bool)), this, SLOT(toggleVSTAlwaysOnTop(bool))); - addLedCheckBox(tr("Sync VST plugins to host playback"), plugins_tw, counter, - m_syncVSTPlugins, SLOT(toggleSyncVSTPlugins(bool)), false); - addLedCheckBox(tr("Keep effects running even without input"), plugins_tw, counter, m_disableAutoQuit, SLOT(toggleDisableAutoQuit(bool)), false); @@ -948,8 +943,6 @@ void SetupDialog::accept() m_vstEmbedComboBox->currentData().toString()); ConfigManager::inst()->setValue("ui", "vstalwaysontop", QString::number(m_vstAlwaysOnTop)); - ConfigManager::inst()->setValue("ui", "syncvstplugins", - QString::number(m_syncVSTPlugins)); ConfigManager::inst()->setValue("ui", "disableautoquit", QString::number(m_disableAutoQuit)); ConfigManager::inst()->setValue("audioengine", "audiodev", @@ -1130,12 +1123,6 @@ void SetupDialog::toggleAnimateAFP(bool enabled) } -void SetupDialog::toggleSyncVSTPlugins(bool enabled) -{ - m_syncVSTPlugins = enabled; -} - - void SetupDialog::vstEmbedMethodChanged() { m_vstEmbedMethod = m_vstEmbedComboBox->currentData().toString(); From a6e6afb0ee174a1e311a212a1f4bd2b720509d34 Mon Sep 17 00:00:00 2001 From: Hussam al-Homsi Date: Mon, 4 Jul 2022 22:19:56 -0400 Subject: [PATCH 17/55] Make AFP include the last sample frame (#6399) --- plugins/AudioFileProcessor/AudioFileProcessor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.cpp b/plugins/AudioFileProcessor/AudioFileProcessor.cpp index 9f01a6499..bf43990f7 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessor.cpp @@ -426,9 +426,9 @@ void AudioFileProcessor::loopPointChanged() void AudioFileProcessor::pointChanged() { - const f_cnt_t f_start = static_cast( m_startPointModel.value() * ( m_sampleBuffer.frames()-1 ) ); - const f_cnt_t f_end = static_cast( m_endPointModel.value() * ( m_sampleBuffer.frames()-1 ) ); - const f_cnt_t f_loop = static_cast( m_loopPointModel.value() * ( m_sampleBuffer.frames()-1 ) ); + const f_cnt_t f_start = static_cast( m_startPointModel.value() * m_sampleBuffer.frames() ); + const f_cnt_t f_end = static_cast( m_endPointModel.value() * m_sampleBuffer.frames() ); + const f_cnt_t f_loop = static_cast( m_loopPointModel.value() * m_sampleBuffer.frames() ); m_nextPlayStartPoint = f_start; m_nextPlayBackwards = false; From b451e40b513c92ba388b6fba798485d361e9ce8e Mon Sep 17 00:00:00 2001 From: saker Date: Thu, 7 Jul 2022 04:54:34 -0400 Subject: [PATCH 18/55] clang-tidy: Apply modernize-use-using everywhere (#6453) --- include/AudioAlsa.h | 2 +- include/AudioEngine.h | 2 +- include/AudioFileDevice.h | 9 ++---- include/AudioJack.h | 2 +- include/AudioPortAudio.h | 6 ++-- include/AudioSampleRecorder.h | 2 +- include/AutomatableModel.h | 6 ++-- include/AutomatableSlider.h | 2 +- include/AutomationClip.h | 4 +-- include/AutomationEditor.h | 2 +- include/BandLimitedWave.h | 31 +++++++++--------- include/BasicFilters.h | 10 +++--- include/ComboBoxModel.h | 2 +- include/ConfigManager.h | 4 +-- include/Controller.h | 4 +-- include/ControllerConnection.h | 3 +- include/DataFile.h | 4 +-- include/Delay.h | 17 +++++----- include/DspEffectLibrary.h | 6 ++-- include/Effect.h | 6 ++-- include/EffectChain.h | 2 +- include/EnvelopeAndLfoParameters.h | 2 +- include/InstrumentFunctions.h | 2 +- include/LadspaBase.h | 25 ++++----------- include/LadspaControl.h | 3 +- include/LadspaManager.h | 16 ++++------ include/LcdSpinBox.h | 2 +- include/Lv2Evbuf.h | 7 ++-- include/Lv2Ports.h | 2 +- include/MemoryManager.h | 8 +++-- include/Midi.h | 3 +- include/MidiApple.h | 2 +- include/MidiPort.h | 7 ++-- include/MidiWinMM.h | 2 +- include/Mixer.h | 2 +- include/Note.h | 4 +-- include/NotePlayHandle.h | 7 ++-- include/OscillatorConstants.h | 5 ++- include/PatternTrack.h | 2 +- include/PeakController.h | 3 +- include/Pitch.h | 3 +- include/PlayHandle.h | 7 ++-- include/Plugin.h | 10 +++--- include/PluginBrowser.h | 2 +- include/PluginFactory.h | 4 +-- include/ProjectJournal.h | 4 +-- include/SampleRecordHandle.h | 2 +- include/SetupDialog.h | 7 ++-- include/SideBar.h | 2 +- include/TabWidget.h | 2 +- include/TimeDisplayWidget.h | 2 +- include/Track.h | 2 +- include/TrackContainer.h | 2 +- include/TrackContainerView.h | 2 +- include/TrackContentWidget.h | 2 +- include/aeffectx.h | 4 +-- include/lmms_basics.h | 32 ++++++++----------- include/volume.h | 5 ++- .../AudioFileProcessor/AudioFileProcessor.h | 2 +- plugins/FreeBoy/Gb_Apu_Buffer.h | 2 +- plugins/Kicker/Kicker.cpp | 7 ++-- plugins/LadspaEffect/LadspaControls.h | 2 +- plugins/LadspaEffect/LadspaEffect.cpp | 2 +- plugins/LadspaEffect/LadspaEffect.h | 5 ++- plugins/MidiExport/MidiExport.h | 8 ++--- plugins/MidiImport/MidiImport.h | 3 +- plugins/Patman/Patman.h | 4 +-- plugins/Vibed/NineButtonSelector.h | 3 +- plugins/VstBase/RemoteVstPlugin.cpp | 5 ++- plugins/Xpressive/ExprSynth.cpp | 7 ++-- plugins/Xpressive/ExprSynth.h | 2 +- src/core/AudioEngine.cpp | 4 +-- src/core/BandLimitedWave.cpp | 2 +- src/core/Oscillator.cpp | 2 +- src/gui/clips/ClipView.cpp | 2 +- src/gui/editors/PianoRoll.cpp | 2 +- src/tracks/InstrumentTrack.cpp | 2 +- 77 files changed, 168 insertions(+), 222 deletions(-) diff --git a/include/AudioAlsa.h b/include/AudioAlsa.h index 7149aa320..f96dd01c9 100644 --- a/include/AudioAlsa.h +++ b/include/AudioAlsa.h @@ -65,7 +65,7 @@ public: }; - typedef std::vector DeviceInfoCollection; + using DeviceInfoCollection = std::vector; public: AudioAlsa( bool & _success_ful, AudioEngine* audioEngine ); diff --git a/include/AudioEngine.h b/include/AudioEngine.h index 8cadcc0e2..71751acb8 100644 --- a/include/AudioEngine.h +++ b/include/AudioEngine.h @@ -370,7 +370,7 @@ signals: private: - typedef FifoBuffer Fifo; + using Fifo = FifoBuffer; class fifoWriter : public QThread { diff --git a/include/AudioFileDevice.h b/include/AudioFileDevice.h index a9fbcbc88..beee087e7 100644 --- a/include/AudioFileDevice.h +++ b/include/AudioFileDevice.h @@ -68,13 +68,8 @@ private: OutputSettings m_outputSettings; } ; - -typedef AudioFileDevice * ( * AudioFileDeviceInstantiaton ) - ( const QString & outputFilename, - OutputSettings const & outputSettings, - const ch_cnt_t channels, - AudioEngine* audioEngine, - bool & successful ); +using AudioFileDeviceInstantiaton + = AudioFileDevice* (*)(const QString&, const OutputSettings&, const ch_cnt_t, AudioEngine*, bool&); } // namespace lmms diff --git a/include/AudioJack.h b/include/AudioJack.h index aed0878ad..263399487 100644 --- a/include/AudioJack.h +++ b/include/AudioJack.h @@ -131,7 +131,7 @@ private: jack_port_t * ports[2]; } ; - typedef QMap JackPortMap; + using JackPortMap = QMap; JackPortMap m_portMap; #endif diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index 2c3aa6bc8..e6750e4b4 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -131,10 +131,10 @@ private: unsigned long _framesPerBuffer, PaTimestamp _outTime, void * _arg ); - typedef double PaTime; - typedef PaDeviceID PaDeviceIndex; + using PaTime = double; + using PaDeviceIndex = PaDeviceID; - typedef struct PaStreamParameters + using PaStreamParameters = struct { PaDeviceIndex device; int channelCount; diff --git a/include/AudioSampleRecorder.h b/include/AudioSampleRecorder.h index e2f84dad0..7ad551916 100644 --- a/include/AudioSampleRecorder.h +++ b/include/AudioSampleRecorder.h @@ -52,7 +52,7 @@ private: const fpp_t _frames, const float _master_gain ) override; - typedef QList > BufferList; + using BufferList = QList>; BufferList m_buffers; } ; diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 5e8a17763..c8f2ab548 100644 --- a/include/AutomatableModel.h +++ b/include/AutomatableModel.h @@ -78,8 +78,7 @@ class LMMS_EXPORT AutomatableModel : public Model, public JournallingObject Q_OBJECT MM_OPERATORS public: - - typedef QVector AutoModelVector; + using AutoModelVector = QVector; enum ScaleType { @@ -504,8 +503,7 @@ public: QString displayValue( const float val ) const override; } ; -typedef QMap AutomatedValueMap; - +using AutomatedValueMap = QMap; } // namespace lmms diff --git a/include/AutomatableSlider.h b/include/AutomatableSlider.h index 1c74a05ad..ba11741b5 100644 --- a/include/AutomatableSlider.h +++ b/include/AutomatableSlider.h @@ -73,7 +73,7 @@ private slots: } ; -typedef IntModel sliderModel; +using sliderModel = IntModel; } // namespace lmms::gui diff --git a/include/AutomationClip.h b/include/AutomationClip.h index 575203bc4..3e253d85f 100644 --- a/include/AutomationClip.h +++ b/include/AutomationClip.h @@ -61,8 +61,8 @@ public: CubicHermiteProgression } ; - typedef QMap timeMap; - typedef QVector> objectVector; + using timeMap = QMap; + using objectVector = QVector>; using TimemapIterator = timeMap::const_iterator; diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index dfb983e9a..52609416f 100644 --- a/include/AutomationEditor.h +++ b/include/AutomationEditor.h @@ -99,7 +99,7 @@ public slots: protected: - typedef AutomationClip::timeMap timeMap; + using timeMap = AutomationClip::timeMap; void keyPressEvent(QKeyEvent * ke) override; void leaveEvent(QEvent * e) override; diff --git a/include/BandLimitedWave.h b/include/BandLimitedWave.h index c65505327..588fc4eea 100644 --- a/include/BandLimitedWave.h +++ b/include/BandLimitedWave.h @@ -54,29 +54,30 @@ const int TLENS[MAXTBL+1] = { 2 << 0, 3 << 0, 2 << 1, 3 << 1, 2 << 8, 3 << 8, 2 << 9, 3 << 9, 2 << 10, 3 << 10, 2 << 11, 3 << 11 }; -typedef struct +struct WaveMipMap { public: - inline sample_t sampleAt( int table, int ph ) + inline sample_t sampleAt(int table, int ph) { - if( table % 2 == 0 ) - { return m_data[ TLENS[ table ] + ph ]; } + if (table % 2 == 0) { return m_data[TLENS[table] + ph]; } else - { return m_data3[ TLENS[ table ] + ph ]; } + { + return m_data3[TLENS[table] + ph]; + } } - inline void setSampleAt( int table, int ph, sample_t sample ) + inline void setSampleAt(int table, int ph, sample_t sample) { - if( table % 2 == 0 ) - { m_data[ TLENS[ table ] + ph ] = sample; } + if (table % 2 == 0) { m_data[TLENS[table] + ph] = sample; } else - { m_data3[ TLENS[ table ] + ph ] = sample; } + { + m_data3[TLENS[table] + ph] = sample; + } } + private: - sample_t m_data [ MIPMAPSIZE ]; - sample_t m_data3 [ MIPMAPSIZE3 ]; - -} WaveMipMap; - + sample_t m_data[MIPMAPSIZE]; + sample_t m_data3[MIPMAPSIZE3]; +}; QDataStream& operator<< ( QDataStream &out, WaveMipMap &waveMipMap ); @@ -166,7 +167,7 @@ public: static bool s_wavesGenerated; - static WaveMipMap s_waveforms [NumBLWaveforms]; + static std::array s_waveforms; static QString s_wavetableDir; }; diff --git a/include/BasicFilters.h b/include/BasicFilters.h index da64c3bc5..836d758b6 100644 --- a/include/BasicFilters.h +++ b/include/BasicFilters.h @@ -138,10 +138,10 @@ private: double m_a, m_a0, m_a1, m_a2; double m_b1, m_b2, m_b3, m_b4; - typedef double frame[CHANNELS]; + using frame = std::array; frame m_z1, m_z2, m_z3, m_z4; }; -typedef LinkwitzRiley<2> StereoLinkwitzRiley; +using StereoLinkwitzRiley = LinkwitzRiley<2>; template class BiQuad @@ -184,7 +184,7 @@ private: friend class BasicFilters; // needed for subfilter stuff in BasicFilters }; -typedef BiQuad<2> StereoBiQuad; +using StereoBiQuad = BiQuad<2>; template class OnePole @@ -218,7 +218,7 @@ private: float m_a0, m_b1; float m_z1 [CHANNELS]; }; -typedef OnePole<2> StereoOnePole; +using StereoOnePole = OnePole<2>; template class BasicFilters @@ -889,7 +889,7 @@ private: // coeffs for Lowpass_SV (state-variant lowpass) float m_svf1, m_svf2, m_svq; - typedef sample_t frame[CHANNELS]; + using frame = std::array; // in/out history for moog-filter frame m_y1, m_y2, m_y3, m_y4, m_oldx, m_oldy1, m_oldy2, m_oldy3; diff --git a/include/ComboBoxModel.h b/include/ComboBoxModel.h index ef21eb12e..0c76620d8 100644 --- a/include/ComboBoxModel.h +++ b/include/ComboBoxModel.h @@ -87,7 +87,7 @@ public: private: - typedef std::pair > Item; + using Item = std::pair>; std::vector m_items; diff --git a/include/ConfigManager.h b/include/ConfigManager.h index 52e318508..fd2967b6a 100644 --- a/include/ConfigManager.h +++ b/include/ConfigManager.h @@ -303,8 +303,8 @@ private: unsigned int m_configVersion; QStringList m_recentlyOpenedProjects; - typedef QVector > stringPairVector; - typedef QMap settingsMap; + using stringPairVector = QVector>; + using settingsMap = QMap; settingsMap m_settings; diff --git a/include/Controller.h b/include/Controller.h index f11294a39..d949cf90c 100644 --- a/include/Controller.h +++ b/include/Controller.h @@ -46,9 +46,7 @@ class ControllerDialog; } // namespace gui - -typedef QVector ControllerVector; - +using ControllerVector = QVector; class LMMS_EXPORT Controller : public Model, public JournallingObject { diff --git a/include/ControllerConnection.h b/include/ControllerConnection.h index 54bfaa10d..8230971cc 100644 --- a/include/ControllerConnection.h +++ b/include/ControllerConnection.h @@ -47,8 +47,7 @@ namespace gui class ControllerConnectionDialog; } -typedef QVector ControllerConnectionVector; - +using ControllerConnectionVector = QVector; class LMMS_EXPORT ControllerConnection : public QObject, public JournallingObject { diff --git a/include/DataFile.h b/include/DataFile.h index 42dc2eabd..5eb61a932 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -61,7 +61,7 @@ public: MidiClip, TypeCount } ; - typedef Types Type; + using Type = Types; DataFile( const QString& fileName ); DataFile( const QByteArray& data ); @@ -136,7 +136,7 @@ private: static const std::vector UPGRADE_VERSIONS; // Map with DOM elements that access resources (for making bundles) - typedef std::map> ResourcesMap; + using ResourcesMap = std::map>; static const ResourcesMap ELEMENTS_WITH_RESOURCES; void upgrade(); diff --git a/include/Delay.h b/include/Delay.h index 404782f90..529577d58 100644 --- a/include/Delay.h +++ b/include/Delay.h @@ -66,7 +66,7 @@ template class CombFeedback { public: - typedef double frame[CHANNELS]; + using frame = std::array; CombFeedback( int maxDelay ) : m_size( maxDelay ), @@ -137,7 +137,7 @@ private: template class CombFeedfwd { - typedef double frame[CHANNELS]; + using frame = std::array; CombFeedfwd( int maxDelay ) : m_size( maxDelay ), @@ -208,7 +208,7 @@ private: template class CombFeedbackDualtap { - typedef double frame[CHANNELS]; + using frame = std::array; CombFeedbackDualtap( int maxDelay ) : m_size( maxDelay ), @@ -289,7 +289,7 @@ template class AllpassDelay { public: - typedef double frame[CHANNELS]; + using frame = std::array; AllpassDelay( int maxDelay ) : m_size( maxDelay ), @@ -358,11 +358,10 @@ private: }; // convenience typedefs for stereo effects -typedef CombFeedback<2> StereoCombFeedback; -typedef CombFeedfwd<2> StereoCombFeedfwd; -typedef CombFeedbackDualtap<2> StereoCombFeedbackDualtap; -typedef AllpassDelay<2> StereoAllpassDelay; - +using StereoCombFeedback = CombFeedback<2>; +using StereoCombFeedfwd = CombFeedfwd<2>; +using StereoCombFeedbackDualtap = CombFeedbackDualtap<2>; +using StereoAllpassDelay = AllpassDelay<2>; } // namespace lmms diff --git a/include/DspEffectLibrary.h b/include/DspEffectLibrary.h index df7588116..eb03e1cf0 100644 --- a/include/DspEffectLibrary.h +++ b/include/DspEffectLibrary.h @@ -38,7 +38,7 @@ namespace lmms::DspEffectLibrary class MonoBase { public: - typedef class MonoBypass bypassType; + using bypassType = class MonoBypass; static void process( sample_t * * _buf, const f_cnt_t _frames ) { @@ -53,7 +53,7 @@ namespace lmms::DspEffectLibrary class StereoBase { public: - typedef class StereoBypass bypassType; + using bypassType = class StereoBypass; static void process( sample_t * * _buf, const f_cnt_t _frames ) { @@ -164,7 +164,7 @@ namespace lmms::DspEffectLibrary class Chain : public FX0::bypassType { public: - typedef typename FX0::sample_t sample_t; + using sample_t = typename FX0::sample_t; Chain( const FX0& fx0, const FX1& fx1 = FX1() ) : m_FX0( fx0 ), m_FX1( fx1 ) diff --git a/include/Effect.h b/include/Effect.h index 471f031c9..add1f7158 100644 --- a/include/Effect.h +++ b/include/Effect.h @@ -236,10 +236,8 @@ private: } ; - -typedef Effect::Descriptor::SubPluginFeatures::Key EffectKey; -typedef Effect::Descriptor::SubPluginFeatures::KeyList EffectKeyList; - +using EffectKey = Effect::Descriptor::SubPluginFeatures::Key; +using EffectKeyList = Effect::Descriptor::SubPluginFeatures::KeyList; } // namespace lmms diff --git a/include/EffectChain.h b/include/EffectChain.h index 2a0cbc758..a9da8e530 100644 --- a/include/EffectChain.h +++ b/include/EffectChain.h @@ -69,7 +69,7 @@ public: private: - typedef QVector EffectList; + using EffectList = QVector; EffectList m_effects; BoolModel m_enabledModel; diff --git a/include/EnvelopeAndLfoParameters.h b/include/EnvelopeAndLfoParameters.h index 042068cce..534adcbe5 100644 --- a/include/EnvelopeAndLfoParameters.h +++ b/include/EnvelopeAndLfoParameters.h @@ -67,7 +67,7 @@ public: private: QMutex m_lfoListMutex; - typedef QList LfoList; + using LfoList = QList; LfoList m_lfos; } ; diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index ede54144f..a349ddf9c 100644 --- a/include/InstrumentFunctions.h +++ b/include/InstrumentFunctions.h @@ -54,7 +54,7 @@ public: static const int MAX_CHORD_POLYPHONY = 13; private: - typedef int8_t ChordSemiTones [MAX_CHORD_POLYPHONY]; + using ChordSemiTones = std::array; public: InstrumentFunctionNoteStacking( Model * _parent ); diff --git a/include/LadspaBase.h b/include/LadspaBase.h index 68e91dd7a..3feb7d204 100644 --- a/include/LadspaBase.h +++ b/include/LadspaBase.h @@ -35,30 +35,20 @@ namespace lmms class LadspaControl; - -typedef enum BufferRates -{ +enum buffer_rate_t { CHANNEL_IN, CHANNEL_OUT, AUDIO_RATE_INPUT, AUDIO_RATE_OUTPUT, CONTROL_RATE_INPUT, CONTROL_RATE_OUTPUT -} buffer_rate_t; +}; -typedef enum BufferData -{ - TOGGLED, - ENUM, - INTEGER, - FLOATING, - TIME, - NONE -} buffer_data_t; +enum buffer_data_t { TOGGLED, ENUM, INTEGER, FLOATING, TIME, NONE }; //! This struct is used to hold port descriptions internally //! which where received from the ladspa plugin -typedef struct PortDescription +struct port_desc_t { QString name; ch_cnt_t proc; @@ -74,10 +64,9 @@ typedef struct PortDescription //! This is true iff ladspa suggests logscale //! Note however that the model can still decide to use a linear scale bool suggests_logscale; - LADSPA_Data * buffer; - LadspaControl * control; -} port_desc_t; - + LADSPA_Data* buffer; + LadspaControl* control; +}; inline Plugin::Descriptor::SubPluginFeatures::Key ladspaKeyToSubPluginKey( const Plugin::Descriptor * _desc, diff --git a/include/LadspaControl.h b/include/LadspaControl.h index 712c1ba1e..258a5d8fc 100644 --- a/include/LadspaControl.h +++ b/include/LadspaControl.h @@ -35,8 +35,7 @@ namespace lmms { - -typedef struct PortDescription port_desc_t; +struct port_desc_t; namespace gui { diff --git a/include/LadspaManager.h b/include/LadspaManager.h index 565a7c898..176526193 100644 --- a/include/LadspaManager.h +++ b/include/LadspaManager.h @@ -45,10 +45,10 @@ namespace lmms const float NOHINT = -99342.2243f; -typedef QPair ladspa_key_t; -typedef QPair sortable_plugin_t; -typedef QList l_sortable_plugin_t; -typedef QList l_ladspa_key_t; +using ladspa_key_t = QPair; +using sortable_plugin_t = QPair; +using l_sortable_plugin_t = QList; +using l_ladspa_key_t = QList; /* LadspaManager provides a database of LADSPA plug-ins. Upon instantiation, it loads all of the plug-ins found in the LADSPA_PATH environmental variable @@ -73,15 +73,14 @@ enum LadspaPluginType OTHER }; -typedef struct LadspaManagerStorage +struct LadspaManagerDescription { LADSPA_Descriptor_Function descriptorFunction; uint32_t index; LadspaPluginType type; uint16_t inputChannels; uint16_t outputChannels; -} LadspaManagerDescription; - +}; class LMMS_EXPORT LadspaManager { @@ -342,8 +341,7 @@ private: const LADSPA_PortRangeHint* getPortRangeHint( const ladspa_key_t& _plugin, uint32_t _port ); - typedef QMap - LadspaManagerMapType; + using LadspaManagerMapType = QMap; LadspaManagerMapType m_ladspaManagerMap; l_sortable_plugin_t m_sortedPlugins; diff --git a/include/LcdSpinBox.h b/include/LcdSpinBox.h index f310e46b2..9c8923763 100644 --- a/include/LcdSpinBox.h +++ b/include/LcdSpinBox.h @@ -86,7 +86,7 @@ signals: } ; -typedef IntModel LcdSpinBoxModel; +using LcdSpinBoxModel = IntModel; } // namespace lmms::gui diff --git a/include/Lv2Evbuf.h b/include/Lv2Evbuf.h index 2f569f7d6..9732fc5e1 100644 --- a/include/Lv2Evbuf.h +++ b/include/Lv2Evbuf.h @@ -47,15 +47,16 @@ namespace lmms /** An abstract/opaque LV2 event buffer. */ -typedef struct LV2_Evbuf_Impl LV2_Evbuf; +using LV2_Evbuf = struct LV2_Evbuf_Impl; /** An iterator over an LV2_Evbuf. */ -typedef struct { +struct LV2_Evbuf_Iterator +{ LV2_Evbuf* evbuf; uint32_t offset; -} LV2_Evbuf_Iterator; +}; /** Allocate a new, empty event buffer. diff --git a/include/Lv2Ports.h b/include/Lv2Ports.h index 48c46dfb1..07676fdd4 100644 --- a/include/Lv2Ports.h +++ b/include/Lv2Ports.h @@ -42,7 +42,7 @@ namespace lmms struct ConnectPortVisitor; -typedef struct LV2_Evbuf_Impl LV2_Evbuf; +using LV2_Evbuf = struct LV2_Evbuf_Impl; namespace Lv2Ports { diff --git a/include/MemoryManager.h b/include/MemoryManager.h index 014071617..d50ad173d 100644 --- a/include/MemoryManager.h +++ b/include/MemoryManager.h @@ -52,8 +52,10 @@ public: template struct MmAllocator { - typedef T value_type; - template struct rebind { typedef MmAllocator other; }; + using value_type = T; + template struct rebind { + using other = MmAllocator; + }; T* allocate( std::size_t n ) { @@ -65,7 +67,7 @@ struct MmAllocator MemoryManager::free( p ); } - typedef std::vector > vector; + using vector = std::vector>; }; diff --git a/include/Midi.h b/include/Midi.h index 9a97ae6e4..f75254d84 100644 --- a/include/Midi.h +++ b/include/Midi.h @@ -81,8 +81,7 @@ enum MidiMetaEventTypes MidiMetaCustom = 0x80, MidiNotePanning } ; -typedef MidiMetaEventTypes MidiMetaEventType; - +using MidiMetaEventType = MidiMetaEventTypes; enum MidiStandardControllers { diff --git a/include/MidiApple.h b/include/MidiApple.h index d2a901698..794641e64 100644 --- a/include/MidiApple.h +++ b/include/MidiApple.h @@ -140,7 +140,7 @@ private: QMap m_sourcePortRef; // subscriptions - typedef QMap SubMap; + using SubMap = QMap; SubMap m_inputSubs; SubMap m_outputSubs; diff --git a/include/MidiPort.h b/include/MidiPort.h index 562379ba8..7ef9adf90 100644 --- a/include/MidiPort.h +++ b/include/MidiPort.h @@ -67,7 +67,7 @@ class MidiPort : public Model, public SerializingObject mapPropertyFromModel(bool,isReadable,setReadable,m_readableModel); mapPropertyFromModel(bool,isWritable,setWritable,m_writableModel); public: - typedef QMap Map; + using Map = QMap; enum Modes { @@ -76,7 +76,7 @@ public: Output, // from MIDI-event-processor to MIDI-client Duplex // both directions } ; - typedef Modes Mode; + using Mode = Modes; MidiPort( const QString& name, MidiClient* client, @@ -186,8 +186,7 @@ signals: } ; - -typedef QList MidiPortList; +using MidiPortList = QList; } // namespace lmms diff --git a/include/MidiWinMM.h b/include/MidiWinMM.h index 7cc7f0f77..0f2bd0d5f 100644 --- a/include/MidiWinMM.h +++ b/include/MidiWinMM.h @@ -134,7 +134,7 @@ private: QMap m_outputDevices; // subscriptions - typedef QMap SubMap; + using SubMap = QMap; SubMap m_inputSubs; SubMap m_outputSubs; diff --git a/include/Mixer.h b/include/Mixer.h index efc103695..ecd864ae7 100644 --- a/include/Mixer.h +++ b/include/Mixer.h @@ -39,7 +39,7 @@ namespace lmms class MixerRoute; -typedef QVector MixerRouteVector; +using MixerRouteVector = QVector; class MixerChannel : public ThreadableJob { diff --git a/include/Note.h b/include/Note.h index 01338be49..464f3906f 100644 --- a/include/Note.h +++ b/include/Note.h @@ -249,9 +249,7 @@ private: DetuningHelper * m_detuning; }; - -typedef QVector NoteVector; - +using NoteVector = QVector; struct NoteBounds { diff --git a/include/NotePlayHandle.h b/include/NotePlayHandle.h index c0980c12b..4969fd84a 100644 --- a/include/NotePlayHandle.h +++ b/include/NotePlayHandle.h @@ -42,9 +42,8 @@ namespace lmms class InstrumentTrack; class NotePlayHandle; -typedef QList NotePlayHandleList; -typedef QList ConstNotePlayHandleList; - +using NotePlayHandleList = QList; +using ConstNotePlayHandleList = QList; class LMMS_EXPORT NotePlayHandle : public PlayHandle, public Note { @@ -65,7 +64,7 @@ public: OriginArpeggio, /*! created by arpeggio instrument function */ OriginCount }; - typedef Origins Origin; + using Origin = Origins; NotePlayHandle( InstrumentTrack* instrumentTrack, const f_cnt_t offset, diff --git a/include/OscillatorConstants.h b/include/OscillatorConstants.h index 47b13a875..0450c2f17 100644 --- a/include/OscillatorConstants.h +++ b/include/OscillatorConstants.h @@ -50,9 +50,8 @@ namespace lmms::OscillatorConstants // - wave shape: abstract and precise definition of the graph associated with a given type of wave; // - waveform: digital representations the wave shape, a set of waves optimized for use at varying pitches; // - 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; - + using wavetable_t = std::array; + using waveform_t = std::array; } // namespace lmms::OscillatorConstants diff --git a/include/PatternTrack.h b/include/PatternTrack.h index 3527b5e49..73ddd4766 100644 --- a/include/PatternTrack.h +++ b/include/PatternTrack.h @@ -94,7 +94,7 @@ protected: private: QList m_disabledTracks; - typedef QMap infoMap; + using infoMap = QMap; static infoMap s_infoMap; friend class gui::PatternTrackView; diff --git a/include/PeakController.h b/include/PeakController.h index d8f721ea7..58d666dd0 100644 --- a/include/PeakController.h +++ b/include/PeakController.h @@ -36,8 +36,7 @@ namespace lmms class PeakControllerEffect; -typedef QVector PeakControllerEffectVector; - +using PeakControllerEffectVector = QVector; class LMMS_EXPORT PeakController : public Controller { diff --git a/include/Pitch.h b/include/Pitch.h index 3f58785ea..6213ef374 100644 --- a/include/Pitch.h +++ b/include/Pitch.h @@ -30,8 +30,7 @@ namespace lmms { - -typedef int16_t pitch_t; +using pitch_t = int16_t; constexpr pitch_t CentsPerSemitone = 100; constexpr pitch_t MinPitchDefault = -CentsPerSemitone; diff --git a/include/PlayHandle.h b/include/PlayHandle.h index 53457f916..542d45871 100644 --- a/include/PlayHandle.h +++ b/include/PlayHandle.h @@ -52,7 +52,7 @@ public: TypeSamplePlayHandle = 0x04, TypePresetPreviewHandle = 0x08 } ; - typedef Types Type; + using Type = Types; enum { @@ -161,9 +161,8 @@ private: AudioPort * m_audioPort; } ; - -typedef QList PlayHandleList; -typedef QList ConstPlayHandleList; +using PlayHandleList = QList; +using ConstPlayHandleList = QList; } // namespace lmms diff --git a/include/Plugin.h b/include/Plugin.h index 43164e0a5..6a4d95bb4 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -136,7 +136,7 @@ public: */ struct Key { - typedef QMap AttributeMap; + using AttributeMap = QMap; inline Key( const Plugin::Descriptor * desc = nullptr, const QString & name = QString(), @@ -179,8 +179,7 @@ public: const PixmapLoader* logo() const; } ; - typedef QList KeyList; - + using KeyList = QList; SubPluginFeatures( Plugin::PluginTypes type ) : m_type( type ) @@ -235,7 +234,7 @@ public: } ; // typedef a list so we can easily work with list of plugin descriptors - typedef QList DescriptorList; + using DescriptorList = QList; //! Constructor of a plugin //! @param key Sub plugins must pass a key here, optional otherwise. @@ -307,8 +306,7 @@ private: Descriptor::SubPluginFeatures::Key m_key; // pointer to instantiation-function in plugin - typedef Plugin * ( * InstantiationHook )( Model * , void * ); - + using InstantiationHook = Plugin* (*)(Model*, void*); } ; diff --git a/include/PluginBrowser.h b/include/PluginBrowser.h index 75fa543f4..1f2041cf4 100644 --- a/include/PluginBrowser.h +++ b/include/PluginBrowser.h @@ -62,7 +62,7 @@ class PluginDescWidget : public QWidget { Q_OBJECT public: - typedef Plugin::Descriptor::SubPluginFeatures::Key PluginKey; + using PluginKey = Plugin::Descriptor::SubPluginFeatures::Key; PluginDescWidget( const PluginKey & _pk, QWidget * _parent ); QString name() const; diff --git a/include/PluginFactory.h b/include/PluginFactory.h index 2aa618f25..8b8b88b6e 100644 --- a/include/PluginFactory.h +++ b/include/PluginFactory.h @@ -53,8 +53,8 @@ public: bool isNull() const {return ! library;} }; - typedef QList PluginInfoList; - typedef QMultiMap DescriptorMap; + using PluginInfoList = QList; + using DescriptorMap = QMultiMap; PluginFactory(); ~PluginFactory() = default; diff --git a/include/ProjectJournal.h b/include/ProjectJournal.h index 25207867b..31a61755d 100644 --- a/include/ProjectJournal.h +++ b/include/ProjectJournal.h @@ -100,7 +100,7 @@ public: private: - typedef QHash JoIdMap; + using JoIdMap = QHash; struct CheckPoint { @@ -112,7 +112,7 @@ private: jo_id_t joID; DataFile data; } ; - typedef QStack CheckPointStack; + using CheckPointStack = QStack; JoIdMap m_joIDs; diff --git a/include/SampleRecordHandle.h b/include/SampleRecordHandle.h index 466e240a8..5b23f5345 100644 --- a/include/SampleRecordHandle.h +++ b/include/SampleRecordHandle.h @@ -61,7 +61,7 @@ private: virtual void writeBuffer( const sampleFrame * _ab, const f_cnt_t _frames ); - typedef QList > bufferList; + using bufferList = QList>; bufferList m_buffers; f_cnt_t m_framesRecorded; TimePos m_minLength; diff --git a/include/SetupDialog.h b/include/SetupDialog.h index 40d552d63..8973938bf 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -165,10 +165,9 @@ private: bool m_vstAlwaysOnTop; bool m_disableAutoQuit; - - typedef QMap AswMap; - typedef QMap MswMap; - typedef QMap trMap; + using AswMap = QMap; + using MswMap = QMap; + using trMap = QMap; // Audio settings widgets. QComboBox * m_audioInterfaces; diff --git a/include/SideBar.h b/include/SideBar.h index 6f1b15770..8755c660a 100644 --- a/include/SideBar.h +++ b/include/SideBar.h @@ -53,7 +53,7 @@ private slots: private: QButtonGroup m_btnGroup; - typedef QMap ButtonMap; + using ButtonMap = QMap; ButtonMap m_widgets; } ; diff --git a/include/TabWidget.h b/include/TabWidget.h index 0f998e9e2..27a35d2a8 100644 --- a/include/TabWidget.h +++ b/include/TabWidget.h @@ -91,7 +91,7 @@ private: QString name; // name for widget int nwidth; // width of name when painting (only valid for text tab) } ; - typedef QMap widgetStack; + using widgetStack = QMap; widgetStack m_widgets; diff --git a/include/TimeDisplayWidget.h b/include/TimeDisplayWidget.h index 33e23c222..894666970 100644 --- a/include/TimeDisplayWidget.h +++ b/include/TimeDisplayWidget.h @@ -57,7 +57,7 @@ private: BarsTicks, DisplayModeCount }; - typedef DisplayModes DisplayMode; + using DisplayMode = DisplayModes; void setDisplayMode( DisplayMode displayMode ); diff --git a/include/Track.h b/include/Track.h index 1cf3f94c2..8d756c914 100644 --- a/include/Track.h +++ b/include/Track.h @@ -70,7 +70,7 @@ class LMMS_EXPORT Track : public Model, public JournallingObject mapPropertyFromModel(bool,isMuted,setMuted,m_mutedModel); mapPropertyFromModel(bool,isSolo,setSolo,m_soloModel); public: - typedef QVector clipVector; + using clipVector = QVector; enum TrackTypes { diff --git a/include/TrackContainer.h b/include/TrackContainer.h index c2344db85..d947094f7 100644 --- a/include/TrackContainer.h +++ b/include/TrackContainer.h @@ -49,7 +49,7 @@ class LMMS_EXPORT TrackContainer : public Model, public JournallingObject { Q_OBJECT public: - typedef QVector TrackList; + using TrackList = QVector; enum TrackContainerTypes { PatternContainer, diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index 7bc367c37..116fd68f9 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -196,7 +196,7 @@ private: friend class TrackContainerView::scrollArea; TrackContainer* m_tc; - typedef QList trackViewList; + using trackViewList = QList; trackViewList m_trackViews; scrollArea * m_scrollArea; diff --git a/include/TrackContentWidget.h b/include/TrackContentWidget.h index bde2de33e..f4a44d2a6 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -132,7 +132,7 @@ private: TrackView * m_trackView; - typedef QVector clipViewVector; + using clipViewVector = QVector; clipViewVector m_clipViews; QPixmap m_background; diff --git a/include/aeffectx.h b/include/aeffectx.h index 5ba81e6a0..a06567ba7 100644 --- a/include/aeffectx.h +++ b/include/aeffectx.h @@ -296,8 +296,6 @@ public: } ; - - -typedef intptr_t (VST_CALL_CONV * audioMasterCallback)( AEffect * , int32_t, int32_t, intptr_t, void * , float ); +using audioMasterCallback = intptr_t (VST_CALL_CONV*)(AEffect*, int32_t, int32_t, intptr_t, void*, float); #endif diff --git a/include/lmms_basics.h b/include/lmms_basics.h index 31c231c1b..59a6aa359 100644 --- a/include/lmms_basics.h +++ b/include/lmms_basics.h @@ -38,27 +38,23 @@ namespace lmms { +using bar_t = int32_t; +using tick_t = int32_t; +using volume_t = uint8_t; +using panning_t = int8_t; -typedef int32_t bar_t; -typedef int32_t tick_t; -typedef uint8_t volume_t; -typedef int8_t panning_t; +using sample_t = float; // standard sample-type +using int_sample_t = int16_t; // 16-bit-int-sample +using sample_rate_t = uint32_t; // sample-rate +using fpp_t = int16_t; // frames per period (0-16384) +using f_cnt_t = int32_t; // standard frame-count +using ch_cnt_t = uint8_t; // channel-count (0-SURROUND_CHANNELS) +using bpm_t = uint16_t; // tempo (MIN_BPM to MAX_BPM) +using bitrate_t = uint16_t; // bitrate in kbps +using mix_ch_t = uint16_t; // Mixer-channel (0 to MAX_CHANNEL) -typedef float sample_t; // standard sample-type -typedef int16_t int_sample_t; // 16-bit-int-sample - - -typedef uint32_t sample_rate_t; // sample-rate -typedef int16_t fpp_t; // frames per period (0-16384) -typedef int32_t f_cnt_t; // standard frame-count -typedef uint8_t ch_cnt_t; // channel-count (0-SURROUND_CHANNELS) -typedef uint16_t bpm_t; // tempo (MIN_BPM to MAX_BPM) -typedef uint16_t bitrate_t; // bitrate in kbps -typedef uint16_t mix_ch_t; // Mixer-channel (0 to MAX_CHANNEL) - -typedef uint32_t jo_id_t; // (unique) ID of a journalling object - +using jo_id_t = uint32_t; // (unique) ID of a journalling object // windows headers define "min" and "max" macros, breaking the methods bwloe #undef min diff --git a/include/volume.h b/include/volume.h index eaf5ab9ff..5223bfa09 100644 --- a/include/volume.h +++ b/include/volume.h @@ -36,11 +36,10 @@ constexpr volume_t MinVolume = 0; constexpr volume_t MaxVolume = 200; constexpr volume_t DefaultVolume = 100; -typedef struct +struct StereoVolumeVector { float vol[2]; -} StereoVolumeVector; - +}; } // namespace lmms diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.h b/plugins/AudioFileProcessor/AudioFileProcessor.h index 18edd2b4a..b80954577 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.h +++ b/plugins/AudioFileProcessor/AudioFileProcessor.h @@ -98,7 +98,7 @@ signals: private: - typedef SampleBuffer::handleState handleState; + using handleState = SampleBuffer::handleState; SampleBuffer m_sampleBuffer; diff --git a/plugins/FreeBoy/Gb_Apu_Buffer.h b/plugins/FreeBoy/Gb_Apu_Buffer.h index 980dfa3e5..760e0920d 100644 --- a/plugins/FreeBoy/Gb_Apu_Buffer.h +++ b/plugins/FreeBoy/Gb_Apu_Buffer.h @@ -41,7 +41,7 @@ public: blargg_err_t set_sample_rate(long sample_rate, long clock_rate); long samples_avail() const; - typedef blip_sample_t sample_t; + using sample_t = blip_sample_t; long read_samples(sample_t* out, long count); void bass_freq(int freq); private: diff --git a/plugins/Kicker/Kicker.cpp b/plugins/Kicker/Kicker.cpp index f9f781aed..3f9aa2474 100644 --- a/plugins/Kicker/Kicker.cpp +++ b/plugins/Kicker/Kicker.cpp @@ -154,11 +154,8 @@ QString KickerInstrument::nodeName() const return kicker_plugin_descriptor.name; } - - -typedef DspEffectLibrary::Distortion DistFX; -typedef KickerOsc > SweepOsc; - +using DistFX = DspEffectLibrary::Distortion; +using SweepOsc = KickerOsc>; void KickerInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) diff --git a/plugins/LadspaEffect/LadspaControls.h b/plugins/LadspaEffect/LadspaControls.h index b84202012..2bef0c856 100644 --- a/plugins/LadspaEffect/LadspaControls.h +++ b/plugins/LadspaEffect/LadspaControls.h @@ -33,7 +33,7 @@ namespace lmms class LadspaControl; -typedef QVector control_list_t; +using control_list_t = QVector; class LadspaEffect; diff --git a/plugins/LadspaEffect/LadspaEffect.cpp b/plugins/LadspaEffect/LadspaEffect.cpp index c722dbaf3..68fdf60d0 100644 --- a/plugins/LadspaEffect/LadspaEffect.cpp +++ b/plugins/LadspaEffect/LadspaEffect.cpp @@ -311,7 +311,7 @@ void LadspaEffect::pluginInstantiation() multi_proc_t ports; for( int port = 0; port < m_portCount; port++ ) { - port_desc_t * p = new PortDescription; + port_desc_t * p = new port_desc_t; p->name = manager->getPortName( m_key, port ); p->proc = proc; diff --git a/plugins/LadspaEffect/LadspaEffect.h b/plugins/LadspaEffect/LadspaEffect.h index 0bb0f2126..8ad4f1411 100644 --- a/plugins/LadspaEffect/LadspaEffect.h +++ b/plugins/LadspaEffect/LadspaEffect.h @@ -36,9 +36,8 @@ namespace lmms { - -typedef struct PortDescription port_desc_t; -typedef QVector multi_proc_t; +struct port_desc_t; +using multi_proc_t = QVector; class LadspaEffect : public Effect { diff --git a/plugins/MidiExport/MidiExport.h b/plugins/MidiExport/MidiExport.h index 29306b903..1e355e45a 100644 --- a/plugins/MidiExport/MidiExport.h +++ b/plugins/MidiExport/MidiExport.h @@ -38,7 +38,7 @@ namespace lmms const int BUFFER_SIZE = 50*1024; -typedef MidiFile::MIDITrack MTrack; +using MTrack = MidiFile::MIDITrack; struct MidiNote { @@ -53,10 +53,8 @@ struct MidiNote } } ; -typedef std::vector MidiNoteVector; -typedef std::vector::iterator MidiNoteIterator; - - +using MidiNoteVector = std::vector; +using MidiNoteIterator = std::vector::iterator; class MidiExport: public ExportFilter { diff --git a/plugins/MidiImport/MidiImport.h b/plugins/MidiImport/MidiImport.h index 12cfb46ae..817d06be8 100644 --- a/plugins/MidiImport/MidiImport.h +++ b/plugins/MidiImport/MidiImport.h @@ -120,8 +120,7 @@ private: } } - - typedef QVector > EventVector; + using EventVector = QVector>; EventVector m_events; int m_timingDivision; diff --git a/plugins/Patman/Patman.h b/plugins/Patman/Patman.h index 89f7f7250..acdf4f7ef 100644 --- a/plugins/Patman/Patman.h +++ b/plugins/Patman/Patman.h @@ -84,13 +84,13 @@ public slots: private: - typedef struct + struct handle_data { MM_OPERATORS SampleBuffer::handleState* state; bool tuned; SampleBuffer* sample; - } handle_data; + }; QString m_patchFile; QVector m_patchSamples; diff --git a/plugins/Vibed/NineButtonSelector.h b/plugins/Vibed/NineButtonSelector.h index 90c4d53e8..9c768e996 100644 --- a/plugins/Vibed/NineButtonSelector.h +++ b/plugins/Vibed/NineButtonSelector.h @@ -101,8 +101,7 @@ private: } ; -typedef IntModel NineButtonSelectorModel; - +using NineButtonSelectorModel = IntModel; } // namespace lmms::gui diff --git a/plugins/VstBase/RemoteVstPlugin.cpp b/plugins/VstBase/RemoteVstPlugin.cpp index a94ea5e3a..aaf8aec3d 100644 --- a/plugins/VstBase/RemoteVstPlugin.cpp +++ b/plugins/VstBase/RemoteVstPlugin.cpp @@ -475,7 +475,7 @@ private: std::mutex m_shmLock; bool m_shmValid; - typedef std::vector VstMidiEventList; + using VstMidiEventList = std::vector; VstMidiEventList m_midiEvents; bpm_t m_bpm; @@ -969,8 +969,7 @@ bool RemoteVstPlugin::load( const std::string & _plugin_file ) } #endif - typedef AEffect * ( VST_CALL_CONV * mainEntryPointer ) - ( audioMasterCallback ); + using mainEntryPointer = AEffect* (VST_CALL_CONV*) (audioMasterCallback); #ifndef NATIVE_LINUX_VST mainEntryPointer mainEntry = (mainEntryPointer) GetProcAddress( m_libInst, "VSTPluginMain" ); diff --git a/plugins/Xpressive/ExprSynth.cpp b/plugins/Xpressive/ExprSynth.cpp index afd6da1f9..e7d7e0951 100644 --- a/plugins/Xpressive/ExprSynth.cpp +++ b/plugins/Xpressive/ExprSynth.cpp @@ -43,10 +43,9 @@ namespace lmms { - -typedef exprtk::symbol_table symbol_table_t; -typedef exprtk::expression expression_t; -typedef exprtk::parser parser_t; +using symbol_table_t = exprtk::symbol_table; +using expression_t = exprtk::expression; +using parser_t = exprtk::parser; template struct freefunc0 : public exprtk::ifunction diff --git a/plugins/Xpressive/ExprSynth.h b/plugins/Xpressive/ExprSynth.h index 4ea46e1bb..f338b78fc 100644 --- a/plugins/Xpressive/ExprSynth.h +++ b/plugins/Xpressive/ExprSynth.h @@ -51,7 +51,7 @@ class PixmapButton; class ExprFront { public: - typedef float (*ff1data_functor)(void*, float); + using ff1data_functor = float (*)(void*, float); ExprFront(const char* expr, int last_func_samples); ~ExprFront(); bool compile(); diff --git a/src/core/AudioEngine.cpp b/src/core/AudioEngine.cpp index d6b0d62b5..20a8513d0 100644 --- a/src/core/AudioEngine.cpp +++ b/src/core/AudioEngine.cpp @@ -64,9 +64,7 @@ namespace lmms { - -typedef LocklessList::Element LocklessListElement; - +using LocklessListElement = LocklessList::Element; static thread_local bool s_renderingThread; diff --git a/src/core/BandLimitedWave.cpp b/src/core/BandLimitedWave.cpp index 0f303fe15..a7dd650c0 100644 --- a/src/core/BandLimitedWave.cpp +++ b/src/core/BandLimitedWave.cpp @@ -30,7 +30,7 @@ namespace lmms { -WaveMipMap BandLimitedWave::s_waveforms[4] = { }; +std::array BandLimitedWave::s_waveforms = { }; bool BandLimitedWave::s_wavesGenerated = false; QString BandLimitedWave::s_wavetableDir = ""; diff --git a/src/core/Oscillator.cpp b/src/core/Oscillator.cpp index 2dc7f6910..86a50c814 100644 --- a/src/core/Oscillator.cpp +++ b/src/core/Oscillator.cpp @@ -234,7 +234,7 @@ void Oscillator::generateWaveTables() // Generate tables for simple shaped (constructed by summing sine waves). // Start from the table that contains the least number of bands, and re-use each table in the following // iteration, adding more bands in each step and avoiding repeated computation of earlier bands. - typedef void (*generator_t)(int, sample_t*, int); + using generator_t = void (*)(int, sample_t*, int); auto simpleGen = [](WaveShapes shape, generator_t generator) { const int shapeID = shape - FirstWaveShapeTable; diff --git a/src/gui/clips/ClipView.cpp b/src/gui/clips/ClipView.cpp index 4748986ac..0f362c58d 100644 --- a/src/gui/clips/ClipView.cpp +++ b/src/gui/clips/ClipView.cpp @@ -538,7 +538,7 @@ DataFile ClipView::createClipDataFiles( DataFile dataFile( DataFile::DragNDropData ); QDomElement clipParent = dataFile.createElement("clips"); - typedef QVector clipViewVector; + using clipViewVector = QVector; for( clipViewVector::const_iterator it = clipViews.begin(); it != clipViews.end(); ++it ) { diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 0a10fa354..bcf3fbbc1 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -77,7 +77,7 @@ namespace lmms { -typedef AutomationClip::timeMap timeMap; +using timeMap = AutomationClip::timeMap; namespace gui diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 000318d7b..04786952e 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -922,7 +922,7 @@ void InstrumentTrack::loadTrackSpecificSettings( const QDomElement & thisElement } else if(node.nodeName() == "instrument") { - typedef Plugin::Descriptor::SubPluginFeatures::Key PluginKey; + using PluginKey = Plugin::Descriptor::SubPluginFeatures::Key; PluginKey key(node.toElement().elementsByTagName("key").item(0).toElement()); if (reuseInstrument) From 1246e76a969baf6e20ad651a7fe7ff73db60b5d7 Mon Sep 17 00:00:00 2001 From: Chr L <1664262+CLandel89@users.noreply.github.com> Date: Thu, 7 Jul 2022 18:03:14 +0200 Subject: [PATCH 19/55] Fix a typo in 420769a which breaks the microtuner (#6458) --- src/gui/MicrotunerConfig.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/MicrotunerConfig.cpp b/src/gui/MicrotunerConfig.cpp index 2f0f0edd9..06b777ce9 100644 --- a/src/gui/MicrotunerConfig.cpp +++ b/src/gui/MicrotunerConfig.cpp @@ -400,9 +400,9 @@ bool MicrotunerConfig::applyScale() newIntervals.emplace_back(1, 1); #if (QT_VERSION >= QT_VERSION_CHECK(5,14,0)) - QStringList input = m_keymapTextEdit->toPlainText().split('\n', Qt::SkipEmptyParts); + QStringList input = m_scaleTextEdit->toPlainText().split('\n', Qt::SkipEmptyParts); #else - QStringList input = m_keymapTextEdit->toPlainText().split('\n', QString::SkipEmptyParts); + QStringList input = m_scaleTextEdit->toPlainText().split('\n', QString::SkipEmptyParts); #endif for (auto &line: input) { From f39b3d50224dcf92ec065a9d05bd39b34396a827 Mon Sep 17 00:00:00 2001 From: Kevin Zander Date: Fri, 8 Jul 2022 13:06:25 -0500 Subject: [PATCH 20/55] Use automation track for MIDI program change events (#6308) --- plugins/MidiImport/MidiImport.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index 282bfa03b..1c8851a31 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -319,6 +319,9 @@ bool MidiImport::readSMF( TrackContainer* tc ) // 128 CC + Pitch Bend smfMidiCC ccs[MIDI_CC_COUNT]; + // channel to CC object for program changes + std::unordered_map pcs; + // channels can be set out of 256 range // using unordered_map should fix most invalid loads and crashes while loading std::unordered_map chs; @@ -467,8 +470,12 @@ bool MidiImport::readSMF( TrackContainer* tc ) long prog = evt->get_integer_value(); if( ch->isSF2 ) { - ch->it_inst->childModel( "bank" )->setValue( 0 ); - ch->it_inst->childModel( "patch" )->setValue( prog ); + auto& pc = pcs[evt->chan]; + AutomatableModel* objModel = ch->it_inst->childModel("patch"); + if (pc.at == nullptr) { + pc.create(tc, trackName + " > " + objModel->displayName()); + } + pc.putValue(time, objModel, prog); } else { const QString num = QString::number( prog ); From ee7d312ac9660cc8a5ff387dacb13eeea005692c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Szab=C3=B3?= Date: Tue, 2 Aug 2022 07:48:27 +0200 Subject: [PATCH 21/55] Allow negative value for stereo difference in BitCrush (#6475) --- plugins/Bitcrush/BitcrushControls.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Bitcrush/BitcrushControls.cpp b/plugins/Bitcrush/BitcrushControls.cpp index 163c2c924..348f1288e 100644 --- a/plugins/Bitcrush/BitcrushControls.cpp +++ b/plugins/Bitcrush/BitcrushControls.cpp @@ -42,7 +42,7 @@ BitcrushControls::BitcrushControls( BitcrushEffect * eff ) : m_outGain( 0.0f, -20.0f, 20.0f, 0.1f, this, tr( "Output gain" ) ), m_outClip( 0.0f, -20.0f, 20.0f, 0.1f, this, tr( "Output clip" ) ), m_rate( 44100.f, 20.f, 44100.f, 1.0f, this, tr( "Sample rate" ) ), - m_stereoDiff( 0.f, 0.f, 50.f, 0.1f, this, tr( "Stereo difference" ) ), + m_stereoDiff( 0.f, -50.f, 50.f, 0.1f, this, tr( "Stereo difference" ) ), m_levels( 256.f, 1.f, 256.f, 0.01f, this, tr( "Levels" ) ), m_rateEnabled( true, this, tr( "Rate enabled" ) ), m_depthEnabled( true, this, tr( "Depth enabled" ) ) From fe91a65f03456d0e47481025404f1fc7896e53db Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Wed, 3 Aug 2022 17:29:11 +0100 Subject: [PATCH 22/55] Migrate CI to GitHub Actions (#6476) --- .appveyor.yml | 31 --- .circleci/config.yml | 225 ------------------- .github/workflows/build.yml | 250 +++++++++++++++++++++ .github/workflows/check-strings.yml | 19 -- .github/workflows/checks.yml | 31 +++ .travis.yml | 33 --- .travis/after_script.sh | 7 - .travis/ccache.sha256 | 1 - .travis/debian_pkgs.sha256 | 3 - .travis/install.sh | 11 - .travis/linux..before_install.sh | 8 - .travis/linux..install.sh | 23 -- .travis/linux..script.sh | 15 -- .travis/linux.debian-sid.before_install.sh | 2 - .travis/linux.debian-sid.install.sh | 17 -- .travis/linux.debian-sid.script.sh | 72 ------ .travis/linux.win.download.sh | 16 -- .travis/linux.win32.before_install.sh | 6 - .travis/linux.win32.install.sh | 29 --- .travis/linux.win32.script.sh | 11 - .travis/linux.win64.before_install.sh | 5 - .travis/linux.win64.install.sh | 19 -- .travis/linux.win64.script.sh | 11 - .travis/osx..before_install.sh | 7 - .travis/osx..install.sh | 22 -- .travis/osx..script.sh | 16 -- .travis/script.sh | 48 ---- CMakeLists.txt | 2 + doc/bash-completion/lmms | 1 - 29 files changed, 283 insertions(+), 658 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 .circleci/config.yml create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/check-strings.yml create mode 100644 .github/workflows/checks.yml delete mode 100644 .travis.yml delete mode 100755 .travis/after_script.sh delete mode 100644 .travis/ccache.sha256 delete mode 100644 .travis/debian_pkgs.sha256 delete mode 100755 .travis/install.sh delete mode 100755 .travis/linux..before_install.sh delete mode 100755 .travis/linux..install.sh delete mode 100755 .travis/linux..script.sh delete mode 100755 .travis/linux.debian-sid.before_install.sh delete mode 100755 .travis/linux.debian-sid.install.sh delete mode 100755 .travis/linux.debian-sid.script.sh delete mode 100755 .travis/linux.win.download.sh delete mode 100755 .travis/linux.win32.before_install.sh delete mode 100755 .travis/linux.win32.install.sh delete mode 100755 .travis/linux.win32.script.sh delete mode 100755 .travis/linux.win64.before_install.sh delete mode 100755 .travis/linux.win64.install.sh delete mode 100755 .travis/linux.win64.script.sh delete mode 100755 .travis/osx..before_install.sh delete mode 100755 .travis/osx..install.sh delete mode 100755 .travis/osx..script.sh delete mode 100755 .travis/script.sh diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index c8e18bbb1..000000000 --- a/.appveyor.yml +++ /dev/null @@ -1,31 +0,0 @@ -clone_depth: 1 -version: "{build}" -image: Visual Studio 2017 -platform: - - x86 - - x64 -environment: - matrix: - - compiler: msvc -install: - - cd C:\Tools\vcpkg - - git pull --quiet - - .\bootstrap-vcpkg.bat - - cd %APPVEYOR_BUILD_FOLDER% - - vcpkg install --triplet %PLATFORM%-windows --recurse fftw3 libsamplerate libsndfile lilv lv2 sdl2 - - nuget install clcache -Version 4.1.0 -build_script: - - cd %APPVEYOR_BUILD_FOLDER% - - mkdir build - - cd build - - ps: $env:CMAKE_PLATFORM="$(if ($env:PLATFORM -eq 'x64') { 'x64' } else { '' })" - - ps: $env:QT_SUFFIX="$(if ($env:PLATFORM -eq 'x64') { '_64' } else { '' })" - - cmake -DUSE_COMPILE_CACHE=ON -DCACHE_TOOL=%APPVEYOR_BUILD_FOLDER%/clcache.4.1.0/clcache-4.1.0/clcache.exe -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_PREFIX_PATH=c:/Qt/5.12/msvc2017%QT_SUFFIX% -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_GENERATOR_PLATFORM="%CMAKE_PLATFORM%" .. - - cmake --build . -- /maxcpucount:4 - - cmake --build . --target tests - - cmake --build . --target package -artifacts: - - path: 'build\lmms-*.exe' - name: Installer -cache: - - c:/tools/vcpkg/installed diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 6e879dbee..000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,225 +0,0 @@ -version: 2 - -shared: - restore_cache: &restore_cache - restore_cache: - keys: - - ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }} - - ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }} - - ccache-{{ arch }} - save_cache: &save_cache - save_cache: - key: ccache-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .BuildNum }} - paths: - - ~/.ccache - restore_homebrew_cache: &restore_homebrew_cache - restore_cache: - keys: - - homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }} - - homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }} - - homebrew-{{ arch }} - save_homebrew_cache: &save_homebrew_cache - save_cache: - key: homebrew-{{ arch }}-{{ .Environment.CIRCLE_JOB }}-{{ .Branch }}-{{ .BuildNum }} - paths: - - ~/Library/Caches/Homebrew - - /usr/local/Homebrew - - ccache_stats: &ccache_stats - run: - name: Print ccache statistics - command: | - echo "[ccache config]" - ccache -p - echo "[ccache stats]" - ccache -s - - # Commmon initializing commands - init: &init - run: - name: Initialize - command: | - mkdir -p /tmp/artifacts - # Workaround for failing submodule fetching - git config --global --unset url."ssh://git@github.com".insteadOf || true - if [[ -n "${CIRCLE_PR_NUMBER}" ]] - then - echo "Fetching out merged pull request" - git fetch -u origin refs/pull/${CIRCLE_PR_NUMBER}/merge:pr/merge - git checkout pr/merge - else - echo "Not a pull request" - fi - - # Commmon environment variables - common_environment: &common_environment - QT5: True - CMAKE_OPTS: -DUSE_WERROR=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUSE_CCACHE=ON - CCACHE_MAXSIZE: 500M - CCACHE_LOGFILE: /tmp/artifacts/ccache.log - MAKEFLAGS: -j6 - -jobs: - mingw32: - environment: - <<: *common_environment - docker: - - image: lmmsci/linux.mingw32:18.04 - steps: - - checkout - - *init - - *restore_cache - - run: - name: Building - command: | - mkdir build && cd build - ../cmake/build_win32.sh - make lmms - make - - run: - name: Build tests - command: cd build && make tests - - run: - name: Build installer - command: | - cd build - make package - cp ./lmms-*.exe /tmp/artifacts/ - - store_artifacts: - path: /tmp/artifacts/ - destination: / - - *ccache_stats - - *save_cache - mingw64: - environment: - <<: *common_environment - docker: - - image: lmmsci/linux.mingw64:18.04 - steps: - - checkout - - *init - - *restore_cache - - run: - name: Building - command: | - mkdir build && cd build - ../cmake/build_win64.sh - make - - run: - name: Build tests - command: cd build && make tests - - run: - name: Build installer - command: | - cd build - make package - cp ./lmms-*.exe /tmp/artifacts/ - - store_artifacts: - path: /tmp/artifacts/ - destination: / - - *ccache_stats - - *save_cache - linux.gcc: - docker: - - image: lmmsci/linux.gcc:18.04 - environment: - <<: *common_environment - steps: - - checkout - - *init - - *restore_cache - - run: - name: Configure - command: | - source /opt/qt5*/bin/qt5*-env.sh || true - mkdir build && cd build - cmake .. $CMAKE_OPTS -DCMAKE_INSTALL_PREFIX=./install - - run: - name: Build - command: cd build && make - - run: - name: Build tests - command: cd build && make tests - - run: - name: Run tests - command: build/tests/tests - - *ccache_stats - - run: - name: Build AppImage - command: | - cd build - make install - make appimage || (cat appimage.log && false) - cp ./lmms-*.AppImage /tmp/artifacts/ - - store_artifacts: - path: /tmp/artifacts/ - destination: / - - store_artifacts: - path: build/appimage.log - destination: / - - *save_cache - shellcheck: - docker: - - image: koalaman/shellcheck-alpine:v0.4.6 - steps: - - checkout - - run: - name: Shellcheck - command: shellcheck $(find "./cmake/" -type f -name '*.sh' -o -name "*.sh.in") - macos: - environment: - <<: *common_environment - macos: - xcode: "10.3.0" - steps: - - checkout - - *init - - *restore_homebrew_cache - - *restore_cache - - run: - name: Install Homebrew dependencies - command: | - # uninstall Homebrew's python 2 to prevent errors on brew install - brew uninstall python@2 || true - # Working around for https://github.com/Homebrew/brew/pull/9383 - (git -C "/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core" fetch && git merge FETCH_HEAD --ff-only) || true - (git -C "/usr/local/Homebrew" fetch && git merge FETCH_HEAD --ff-only) || true - brew install ccache fftw cmake pkg-config libogg libvorbis lame libsndfile libsamplerate jack sdl libgig libsoundio lilv lv2 stk fluid-synth portaudio fltk qt5 carla - - run: - name: Install nodejs dependencies - command: npm install -g appdmg - - run: - name: Building - command: | - mkdir build && cd build - cmake .. -DCMAKE_INSTALL_PREFIX="../target" -DCMAKE_PREFIX_PATH="$(brew --prefix qt5)" $CMAKE_OPTS -DUSE_WERROR=OFF - make - - run: - name: Build tests - command: cd build && make tests - - run: - name: Run tests - command: build/tests/tests - - run: - name: Build DMG - command: | - cd build - make install - make dmg - cp ./lmms-*.dmg /tmp/artifacts/ - - store_artifacts: - path: /tmp/artifacts/ - destination: / - - *save_cache - - *save_homebrew_cache - - -workflows: - version: 2 - build-and-test: - jobs: - - macos - - mingw32 - - mingw64 - - linux.gcc - - shellcheck diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 000000000..3d8db8b78 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,250 @@ +--- +name: build +'on': [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + linux: + name: linux + runs-on: ubuntu-latest + container: lmmsci/linux.gcc:18.04 + env: + CMAKE_OPTS: >- + -DUSE_WERROR=ON + -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DUSE_COMPILE_CACHE=ON + CCACHE_MAXSIZE: 500M + MAKEFLAGS: -j2 + steps: + - name: Update and configure Git + run: | + add-apt-repository ppa:git-core/ppa + apt-get update + apt-get --yes install git + git config --global --add safe.directory "$GITHUB_WORKSPACE" + - name: Check out + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + - name: Cache ccache data + uses: actions/cache@v3 + with: + key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }} + restore-keys: | + ccache-${{ github.job }}-${{ github.ref }}- + ccache-${{ github.job }}- + path: ~/.ccache + - name: Configure + run: | + source /opt/qt5*/bin/qt5*-env.sh || true + mkdir build && cd build + cmake .. $CMAKE_OPTS -DCMAKE_INSTALL_PREFIX=./install + - name: Build + run: cmake --build build + - name: Build tests + run: cmake --build build --target tests + - name: Run tests + run: build/tests/tests + - name: Package + run: | + cmake --build build --target install + cmake --build build --target appimage \ + || (cat build/appimage.log && false) + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: linux + path: build/lmms-*.AppImage + - name: Print ccache statistics + run: | + echo "[ccache config]" + ccache -p + echo "[ccache stats]" + ccache -s + macos: + name: macos + runs-on: macos-11 + env: + CMAKE_OPTS: >- + -DUSE_WERROR=ON + -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DUSE_COMPILE_CACHE=ON + CCACHE_MAXSIZE: 500M + MAKEFLAGS: -j3 + DEVELOPER_DIR: /Applications/Xcode_11.7.app/Contents/Developer + steps: + - name: Check out + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + - name: Cache ccache data + uses: actions/cache@v3 + with: + key: ccache-${{ github.job }}-${{ github.ref }}-${{ github.run_id }} + restore-keys: | + ccache-${{ github.job }}-${{ github.ref }}- + ccache-${{ github.job }}- + path: ~/Library/Caches/ccache + - name: Install dependencies + run: | + brew install ccache fftw pkg-config libogg libvorbis lame libsndfile \ + libsamplerate jack sdl libgig libsoundio lilv lv2 stk \ + fluid-synth portaudio fltk qt@5 carla + npm install --location=global appdmg + - name: Configure + run: | + mkdir build + cmake -S . \ + -B build \ + -DCMAKE_INSTALL_PREFIX="../target" \ + -DCMAKE_PREFIX_PATH="$(brew --prefix qt5)" \ + $CMAKE_OPTS \ + -DUSE_WERROR=OFF + - name: Build + run: cmake --build build + - name: Build tests + run: cmake --build build --target tests + - name: Run tests + run: build/tests/tests + - name: Package + run: | + cmake --build build --target install + cmake --build build --target dmg + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: macos + path: build/lmms-*.dmg + - name: Print ccache statistics + run: | + echo "[ccache config]" + ccache -p + echo "[ccache stats]" + ccache -s + mingw: + strategy: + fail-fast: false + matrix: + arch: ['32', '64'] + name: mingw${{ matrix.arch }} + runs-on: ubuntu-latest + container: lmmsci/linux.mingw${{ matrix.arch }}:18.04 + env: + CMAKE_OPTS: >- + -DUSE_WERROR=ON + -DCMAKE_BUILD_TYPE=RelWithDebInfo + -DUSE_COMPILE_CACHE=ON + CCACHE_MAXSIZE: 500M + MAKEFLAGS: -j2 + steps: + - name: Update and configure Git + run: | + add-apt-repository ppa:git-core/ppa + apt-get update + apt-get --yes install git + git config --global --add safe.directory "$GITHUB_WORKSPACE" + - name: Check out + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + - name: Cache ccache data + uses: actions/cache@v3 + with: + key: "ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}\ + -${{ github.run_id }}" + restore-keys: | + ccache-${{ github.job }}-${{ matrix.arch }}-${{ github.ref }}- + ccache-${{ github.job }}-${{ matrix.arch }}- + path: ~/.ccache + - name: Configure + run: | + mkdir build && cd build + ../cmake/build_win${{ matrix.arch }}.sh + - name: Build + run: cmake --build build + - name: Build tests + run: cmake --build build --target tests + - name: Package + run: cmake --build build --target package + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: mingw${{ matrix.arch }} + path: build/lmms-*.exe + - name: Print ccache statistics + run: | + echo "[ccache config]" + ccache -p + echo "[ccache stats]" + ccache -s + msvc: + strategy: + fail-fast: false + matrix: + arch: ['x86', 'x64'] + name: msvc-${{ matrix.arch }} + runs-on: windows-2019 + env: + qt-version: '5.15.2' + steps: + - name: Check out + uses: actions/checkout@v3 + with: + fetch-depth: 0 + submodules: recursive + - name: Cache vcpkg dependencies + uses: actions/cache@v3 + with: + key: vcpkg-${{ matrix.arch }}-${{ github.ref }}-${{ github.run_id }} + restore-keys: | + vcpkg-${{ matrix.arch }}-${{ github.ref }}- + vcpkg-${{ matrix.arch }}- + path: C:\vcpkg\installed + - name: Install 64-bit Qt + if: matrix.arch == 'x64' + # Temporary workaround until upstream install-qt-action is fixed + uses: PhysSong/install-qt-action@v3 + with: + version: ${{ env.qt-version }} + arch: win64_msvc2019_64 + archives: qtbase qtsvg qttools + cache: true + - name: Install 32-bit Qt + uses: PhysSong/install-qt-action@v3 + with: + version: ${{ env.qt-version }} + arch: win32_msvc2019 + archives: qtbase qtsvg qttools + cache: true + set-env: ${{ matrix.arch == 'x86' }} + - name: Install dependencies + run: | + vcpkg install --triplet ${{ matrix.arch }}-windows --recurse ` + fftw3 libsamplerate libsndfile lilv lv2 sdl2 + - name: Set up build environment + uses: ilammy/msvc-dev-cmd@d8610e2b41c6d0f0c3b4c46dad8df0fd826c68e1 + with: + arch: ${{ matrix.arch }} + - name: Configure + run: | + mkdir build + cmake -S . ` + -B build ` + -G Ninja ` + --toolchain C:/vcpkg/scripts/buildsystems/vcpkg.cmake ` + -DCMAKE_BUILD_TYPE=RelWithDebInfo + - name: Build + run: cmake --build build + - name: Build tests + run: cmake --build build --target tests + - name: Package + run: cmake --build build --target package + - name: Upload artifacts + uses: actions/upload-artifact@v3 + with: + name: msvc-${{ matrix.arch }} + path: build\lmms-*.exe diff --git a/.github/workflows/check-strings.yml b/.github/workflows/check-strings.yml deleted file mode 100644 index a19b17b27..000000000 --- a/.github/workflows/check-strings.yml +++ /dev/null @@ -1,19 +0,0 @@ -name: check-strings - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Install python-tinycss2 - run: sudo apt-get install -y python3-tinycss2 - - name: Update submodules - run: git submodule update --init --recursive - - name: Verify check-strings script - run: tests/check-strings/verify - - name: Run check-strings - run: tests/check-strings/check-strings diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml new file mode 100644 index 000000000..89565ccff --- /dev/null +++ b/.github/workflows/checks.yml @@ -0,0 +1,31 @@ +--- +name: checks +'on': [push, pull_request] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + check-strings: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install python-tinycss2 + run: sudo apt-get install -y python3-tinycss2 + - name: Update submodules + run: git submodule update --init --recursive + - name: Verify check-strings script + run: tests/check-strings/verify + - name: Run check-strings + run: tests/check-strings/check-strings + shellcheck: + runs-on: ubuntu-latest + container: koalaman/shellcheck-alpine:v0.4.6 + steps: + - name: Check out + uses: actions/checkout@v3 + - name: Run shellcheck + run: | + shellcheck \ + $(find "./cmake/" -type f -name '*.sh' -o -name "*.sh.in") \ + doc/bash-completion/lmms \ + buildtools/update_locales diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d2d92d897..000000000 --- a/.travis.yml +++ /dev/null @@ -1,33 +0,0 @@ -language: cpp -compiler: gcc -dist: xenial -sudo: required -cache: - directories: - - $HOME/apt_mingw_cache - - $HOME/.ccache - - $HOME/pbuilder-bases -matrix: - include: - - env: TYPE=style - - os: linux - - env: TARGET_OS=debian-sid TARGET_DEPLOY=True - git: - depth: false - - env: TARGET_OS=debian-sid TARGET_ARCH=i386 - git: - depth: false - - compiler: clang - env: TARGET_OS=debian-sid - git: - depth: false - - os: osx - osx_image: xcode10.3 -before_install: - # appdmg doesn't work with old Node.js - - if [ "$TRAVIS_OS_NAME" = osx ]; then nvm install 10; fi -install: ${TRAVIS_BUILD_DIR}/.travis/install.sh -script: ${TRAVIS_BUILD_DIR}/.travis/script.sh -after_script: ${TRAVIS_BUILD_DIR}/.travis/after_script.sh -before_deploy: - - if [ "$TARGET_OS" != debian-sid ]; then make package; fi diff --git a/.travis/after_script.sh b/.travis/after_script.sh deleted file mode 100755 index 6d098b636..000000000 --- a/.travis/after_script.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [ "$TYPE" != 'style' ]; then - ccache -s -fi diff --git a/.travis/ccache.sha256 b/.travis/ccache.sha256 deleted file mode 100644 index e63145466..000000000 --- a/.travis/ccache.sha256 +++ /dev/null @@ -1 +0,0 @@ -0de866bc0ee26de392e037104b174474989a830e2249280a136144baa44557aa ccache_3.2.4-1_amd64.deb diff --git a/.travis/debian_pkgs.sha256 b/.travis/debian_pkgs.sha256 deleted file mode 100644 index ed4e11737..000000000 --- a/.travis/debian_pkgs.sha256 +++ /dev/null @@ -1,3 +0,0 @@ -314ef4af137903dfb13e8c3ef1e6ea56cfdb23808d52ec4f5f50e288c73610c5 pbuilder_0.229.1_all.deb -fa82aa8ed3055c6f6330104deedf080b26778295e589426d4c4dd0f2c2a5defa debootstrap_1.0.95_all.deb -2ef4c09f7841b72f93412803ddd142f72658536dbfabe00e449eb548f432f3f8 debian-archive-keyring_2017.7ubuntu1_all.deb diff --git a/.travis/install.sh b/.travis/install.sh deleted file mode 100755 index a807d032c..000000000 --- a/.travis/install.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [ "$TYPE" = 'style' ]; then - sudo apt-get -yqq update - sudo apt-get install shellcheck -else - "$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.before_install.sh" - "$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.install.sh" -fi diff --git a/.travis/linux..before_install.sh b/.travis/linux..before_install.sh deleted file mode 100755 index 9bf8aac01..000000000 --- a/.travis/linux..before_install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -e - -sudo add-apt-repository ppa:beineri/opt-qt592-xenial -y - -sudo dpkg --add-architecture i386 -sudo apt-get update -qq || true diff --git a/.travis/linux..install.sh b/.travis/linux..install.sh deleted file mode 100755 index d56645603..000000000 --- a/.travis/linux..install.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/usr/bin/env bash - -set -e - -PACKAGES="cmake libsndfile-dev fftw3-dev libvorbis-dev libogg-dev libmp3lame-dev - libasound2-dev libjack-jackd2-dev libsdl-dev libsamplerate0-dev libstk0-dev stk - libfluidsynth-dev portaudio19-dev g++-multilib libfltk1.3-dev fluid - libgig-dev libsoundio-dev qt59base qt59translations qt59tools" - -# swh build dependencies -SWH_PACKAGES="perl libxml2-utils libxml-perl liblist-moreutils-perl" - -# VST dependencies -VST_PACKAGES="wine-dev qt59x11extras qtbase5-private-dev libxcb-util0-dev libxcb-keysyms1-dev" - -# LV2 dependencies; libsuil-dev is not required -LV2_PACKAGES="lv2-dev liblilv-dev" - -# Help with unmet dependencies -PACKAGES="$PACKAGES $SWH_PACKAGES $VST_PACKAGES $LV2_PACKAGES libjack-jackd2-0" - -# shellcheck disable=SC2086 -sudo apt-get install -y $PACKAGES diff --git a/.travis/linux..script.sh b/.travis/linux..script.sh deleted file mode 100755 index e75b827ac..000000000 --- a/.travis/linux..script.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash -unset QTDIR QT_PLUGIN_PATH LD_LIBRARY_PATH -# shellcheck disable=SC1091 -source /opt/qt59/bin/qt59-env.sh - -set -e - -mkdir build -cd build - -# shellcheck disable=SC2086 -cmake -DUSE_WERROR=ON -DCMAKE_INSTALL_PREFIX=../target $CMAKE_FLAGS .. -make -j4 -make tests -./tests/tests diff --git a/.travis/linux.debian-sid.before_install.sh b/.travis/linux.debian-sid.before_install.sh deleted file mode 100755 index 89ee51523..000000000 --- a/.travis/linux.debian-sid.before_install.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -sudo apt-get update -qq diff --git a/.travis/linux.debian-sid.install.sh b/.travis/linux.debian-sid.install.sh deleted file mode 100755 index ef8368822..000000000 --- a/.travis/linux.debian-sid.install.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/sh -set -e - -sudo apt-get install -y \ - dpkg \ - pbuilder - -# work around a pbuilder bug which breaks ccache -# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=666525 -# and also missing signing keys in Trusty's debian-archive-keyring -cd /tmp -wget http://archive.ubuntu.com/ubuntu/pool/main/p/pbuilder/pbuilder_0.229.1_all.deb -wget http://archive.ubuntu.com/ubuntu/pool/main/d/debootstrap/debootstrap_1.0.95_all.deb -wget http://archive.ubuntu.com/ubuntu/pool/universe/d/debian-archive-keyring/debian-archive-keyring_2017.7ubuntu1_all.deb -sha256sum -c "$TRAVIS_BUILD_DIR/.travis/debian_pkgs.sha256" -sudo dpkg -i pbuilder_0.229.1_all.deb debootstrap_1.0.95_all.deb debian-archive-keyring_2017.7ubuntu1_all.deb -cd "$OLDPWD" diff --git a/.travis/linux.debian-sid.script.sh b/.travis/linux.debian-sid.script.sh deleted file mode 100755 index 9b8db416c..000000000 --- a/.travis/linux.debian-sid.script.sh +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash -set -e - -: "${TARGET_ARCH:=amd64}" - -BASETGZ="$HOME/pbuilder-bases/debian-sid-$TARGET_ARCH.tgz" -MIRROR=http://cdn-fastly.deb.debian.org/debian -KEYRING=/usr/share/keyrings/debian-archive-keyring.gpg - -if [ -z "$TRAVIS_TAG" ] -then - sudo \ - sh -c "echo CCACHEDIR=$HOME/.ccache >> /etc/pbuilderrc" -fi - -if [ "$CC" = clang ] -then - sudo sh -c "echo EXTRAPACKAGES=clang >> /etc/pbuilderrc" -fi - -if [ ! -e "$BASETGZ.stamp" ] -then - mkdir -p "$HOME/pbuilder-bases" - sudo pbuilder --create --basetgz "$BASETGZ" --mirror $MIRROR \ - --distribution sid --architecture $TARGET_ARCH \ - --debootstrapopts --variant=buildd \ - --debootstrapopts --keyring=$KEYRING \ - --debootstrapopts --include=perl - touch "$BASETGZ.stamp" -else - sudo pbuilder --update --basetgz "$BASETGZ" -fi - -sync_version() { - local VERSION - local MMR - local STAGE - local EXTRA - - VERSION=$(git describe --tags --match v[0-9].[0-9].[0-9]*) - VERSION=${VERSION#v} - MMR=${VERSION%%-*} - case $VERSION in - *-*-*-*) - VERSION=${VERSION%-*} - STAGE=${VERSION#*-} - STAGE=${STAGE%-*} - EXTRA=${VERSION##*-} - VERSION=$MMR~$STAGE.$EXTRA - ;; - *-*-*) - VERSION=${VERSION%-*} - EXTRA=${VERSION##*-} - VERSION=$MMR.$EXTRA - ;; - *-*) - STAGE=${VERSION#*-} - VERSION=$MMR~$STAGE - ;; - esac - - sed "1 s/@VERSION@/$VERSION/" -i debian/changelog - echo "Set Debian version to $VERSION" -} - -sync_version - -DIR="$PWD" -cd .. -dpkg-source -b "$DIR" -env -i CC="$CC" CXX="$CXX" sudo pbuilder --build --debbuildopts "--jobs=auto" \ - --basetgz "$BASETGZ" ./*.dsc diff --git a/.travis/linux.win.download.sh b/.travis/linux.win.download.sh deleted file mode 100755 index 2f914f94e..000000000 --- a/.travis/linux.win.download.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -set -e - -CACHE_DIR=$HOME/apt_mingw_cache/$1 -mkdir -p "$CACHE_DIR" - -pushd "$CACHE_DIR" - -# shellcheck disable=SC2086 -apt-get --print-uris --yes install $MINGW_PACKAGES | grep ^\' | cut -d\' -f2 > downloads.list -wget -N --input-file downloads.list - -sudo cp ./*.deb /var/cache/apt/archives/ - -popd diff --git a/.travis/linux.win32.before_install.sh b/.travis/linux.win32.before_install.sh deleted file mode 100755 index e0cfcbafb..000000000 --- a/.travis/linux.win32.before_install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -set -e - -sudo add-apt-repository ppa:tobydox/mingw-x-trusty -y -sudo apt-get update -qq diff --git a/.travis/linux.win32.install.sh b/.travis/linux.win32.install.sh deleted file mode 100755 index 6e73e7abe..000000000 --- a/.travis/linux.win32.install.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -set -e - -MINGW_PACKAGES="mingw32-x-sdl mingw32-x-libvorbis mingw32-x-fluidsynth mingw32-x-stk - mingw32-x-glib2 mingw32-x-portaudio mingw32-x-libsndfile mingw32-x-fftw - mingw32-x-flac mingw32-x-fltk mingw32-x-libsamplerate - mingw32-x-pkgconfig mingw32-x-binutils mingw32-x-gcc mingw32-x-runtime - mingw32-x-libgig mingw32-x-libsoundio mingw32-x-lame mingw32-x-qt5base" - -# swh build dependencies -SWH_PACKAGES="perl libxml2-utils libxml-perl liblist-moreutils-perl" - -export MINGW_PACKAGES - -"$TRAVIS_BUILD_DIR/.travis/linux.win.download.sh" win32 - -PACKAGES="nsis cloog-isl libmpc3 qt4-linguist-tools mingw32 $MINGW_PACKAGES $SWH_PACKAGES" - -# shellcheck disable=SC2086 -sudo apt-get install -y $PACKAGES - -# ccache 3.2 is needed because mingw32-x-gcc is version 4.9, which causes cmake -# to use @file command line passing, which in turn ccache 3.1.9 doesn't support -pushd /tmp -wget http://archive.ubuntu.com/ubuntu/pool/main/c/ccache/ccache_3.2.4-1_amd64.deb -sha256sum -c "$TRAVIS_BUILD_DIR/.travis/ccache.sha256" -sudo dpkg -i ccache_3.2.4-1_amd64.deb -popd diff --git a/.travis/linux.win32.script.sh b/.travis/linux.win32.script.sh deleted file mode 100755 index 6e930fd9b..000000000 --- a/.travis/linux.win32.script.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -set -e - -mkdir build -cd build - -export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON" -../cmake/build_win32.sh - -make -j4 -make tests diff --git a/.travis/linux.win64.before_install.sh b/.travis/linux.win64.before_install.sh deleted file mode 100755 index 083039391..000000000 --- a/.travis/linux.win64.before_install.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -e - -"$TRAVIS_BUILD_DIR/.travis/linux.win32.before_install.sh" diff --git a/.travis/linux.win64.install.sh b/.travis/linux.win64.install.sh deleted file mode 100755 index 99ef7187f..000000000 --- a/.travis/linux.win64.install.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -e - -# First, install 32-bit deps -"$TRAVIS_BUILD_DIR/.travis/linux.win32.install.sh" - -MINGW_PACKAGES="mingw64-x-sdl mingw64-x-libvorbis mingw64-x-fluidsynth mingw64-x-stk - mingw64-x-glib2 mingw64-x-portaudio mingw64-x-libsndfile - mingw64-x-fftw mingw64-x-flac mingw64-x-fltk mingw64-x-libsamplerate - mingw64-x-pkgconfig mingw64-x-binutils mingw64-x-gcc mingw64-x-runtime - mingw64-x-libgig mingw64-x-libsoundio mingw64-x-lame mingw64-x-qt5base" - -export MINGW_PACKAGES - -"$TRAVIS_BUILD_DIR/.travis/linux.win.download.sh" win64 - -# shellcheck disable=SC2086 -sudo apt-get install -y $MINGW_PACKAGES diff --git a/.travis/linux.win64.script.sh b/.travis/linux.win64.script.sh deleted file mode 100755 index d81fa9b58..000000000 --- a/.travis/linux.win64.script.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -set -e - -mkdir build -cd build - -export CMAKE_OPTS="$CMAKE_FLAGS -DUSE_WERROR=ON" -../cmake/build_win64.sh - -make -j4 -make tests diff --git a/.travis/osx..before_install.sh b/.travis/osx..before_install.sh deleted file mode 100755 index 61f25af66..000000000 --- a/.travis/osx..before_install.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -e - -brew update -# Python 2 may cause conflicts on dependency installation -brew unlink python@2 || true diff --git a/.travis/osx..install.sh b/.travis/osx..install.sh deleted file mode 100755 index 42bf66aca..000000000 --- a/.travis/osx..install.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -set -e - -PACKAGES="cmake pkg-config libogg libvorbis lame libsndfile libsamplerate lilv lv2 jack sdl libgig libsoundio stk fluid-synth portaudio node fltk qt carla" - -if "${TRAVIS}"; then - PACKAGES="$PACKAGES ccache" -fi - -# removing already installed packages from the list -for p in $(brew list); do - PACKAGES=${PACKAGES//$p/} -done; - -# shellcheck disable=SC2086 -brew install $PACKAGES - -# fftw tries to install gcc which conflicts with travis -brew install fftw --ignore-dependencies - -npm install -g appdmg diff --git a/.travis/osx..script.sh b/.travis/osx..script.sh deleted file mode 100755 index 373e273f4..000000000 --- a/.travis/osx..script.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash -set -e - -mkdir build -cd build - -# Workaround; No FindQt5.cmake module exists -CMAKE_PREFIX_PATH="$(brew --prefix qt5)" -export CMAKE_PREFIX_PATH - -# shellcheck disable=SC2086 -cmake -DUSE_WERROR=OFF -DCMAKE_INSTALL_PREFIX=../target $CMAKE_FLAGS .. - -make -j4 -make tests -./tests/tests diff --git a/.travis/script.sh b/.travis/script.sh deleted file mode 100755 index 21d27b080..000000000 --- a/.travis/script.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash - -set -e - -if [ "$TYPE" = 'style' ]; then - - # SC2185 is disabled because of: https://github.com/koalaman/shellcheck/issues/942 - # once it's fixed, it should be enabled again - # shellcheck disable=SC2185 - # shellcheck disable=SC2046 - shellcheck $(find -O3 . -maxdepth 3 -type f -name '*.sh' -o -name "*.sh.in") - shellcheck doc/bash-completion/lmms - -else - - export CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUNDLE_QT_TRANSLATIONS=ON" - - if [ -z "$TRAVIS_TAG" ]; then - export CMAKE_FLAGS="$CMAKE_FLAGS -DUSE_CCACHE=ON" - fi - - "$TRAVIS_BUILD_DIR/.travis/$TRAVIS_OS_NAME.$TARGET_OS.script.sh" - - # Package and upload non-tagged builds - if [ -n "$TRAVIS_TAG" ]; then - # Skip, handled by travis deploy instead - exit 0 - elif [[ $TARGET_OS == win* ]]; then - cd build - make -j4 package - PACKAGE="$(ls lmms-*win*.exe)" - elif [[ $TRAVIS_OS_NAME == osx ]]; then - cd build - make -j4 install > /dev/null - make dmg - PACKAGE="$(ls lmms-*.dmg)" - elif [[ $TARGET_OS != debian-sid ]]; then - cd build - make -j4 install > /dev/null - make appimage - PACKAGE="$(ls lmms-*.AppImage)" - fi - - echo "Uploading $PACKAGE to transfer.sh..." - # Limit the connection time to 3 minutes and total upload time to 5 minutes - # Otherwise the build may hang - curl --connect-timeout 180 --max-time 300 --upload-file "$PACKAGE" "https://transfer.sh/$PACKAGE" || true -fi diff --git a/CMakeLists.txt b/CMakeLists.txt index a3fcf4050..4a230a937 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -208,6 +208,8 @@ IF(WANT_LV2) PKG_CHECK_MODULES(LILV lilv-0) ENDIF() IF(NOT LV2_FOUND AND NOT LILV_FOUND) + UNSET(LV2_FOUND CACHE) + UNSET(LILV_FOUND CACHE) FIND_PACKAGE(LV2 CONFIG) FIND_PACKAGE(LILV CONFIG) IF(LILV_FOUND) diff --git a/doc/bash-completion/lmms b/doc/bash-completion/lmms index 210f184ee..d6a3b7295 100644 --- a/doc/bash-completion/lmms +++ b/doc/bash-completion/lmms @@ -1,6 +1,5 @@ #!/usr/bin/env bash # lmms(1) completion -*- shell-script -*- -# use shellcheck: "shellcheck -e bash " _lmms_array_contains () { From 7c86331e06ac22648d0691523490aeccef8e11ae Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Tue, 9 Aug 2022 17:37:44 +0900 Subject: [PATCH 23/55] Remove a workaround for broken install-qt-action (#6482) Also uses commit hash to prevents potential issues on upstream updates --- .github/workflows/build.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3d8db8b78..bdcdeb7d7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -206,15 +206,14 @@ jobs: path: C:\vcpkg\installed - name: Install 64-bit Qt if: matrix.arch == 'x64' - # Temporary workaround until upstream install-qt-action is fixed - uses: PhysSong/install-qt-action@v3 + uses: jurplel/install-qt-action@64bdb64f2c14311d23733a8463e5fcbc65e8775e with: version: ${{ env.qt-version }} arch: win64_msvc2019_64 archives: qtbase qtsvg qttools cache: true - name: Install 32-bit Qt - uses: PhysSong/install-qt-action@v3 + uses: jurplel/install-qt-action@64bdb64f2c14311d23733a8463e5fcbc65e8775e with: version: ${{ env.qt-version }} arch: win32_msvc2019 From 9faa1d90c4b2eac2f19ca14f78354405ca9a04dc Mon Sep 17 00:00:00 2001 From: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> Date: Sat, 13 Aug 2022 21:29:15 +0200 Subject: [PATCH 24/55] Fix "check-strings" verification (#6485) PR #6438 does 2 things: 1. Add check-namespace 2. Fix verify script This PR contains only part 2 (and does some preparations for part 1). The goal of the PR is to make CI succeed on master. --- .github/workflows/checks.yml | 6 +- tests/check-strings/README.md | 15 -- tests/check-strings/expectation.txt | 81 --------- tests/check-strings/verify | 60 ------- tests/scripted/README.md | 24 +++ .../{check-strings => scripted}/check-strings | 0 tests/scripted/verify | 162 ++++++++++++++++++ 7 files changed, 189 insertions(+), 159 deletions(-) delete mode 100644 tests/check-strings/README.md delete mode 100644 tests/check-strings/expectation.txt delete mode 100755 tests/check-strings/verify create mode 100644 tests/scripted/README.md rename tests/{check-strings => scripted}/check-strings (100%) create mode 100755 tests/scripted/verify diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 89565ccff..05d078205 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -13,10 +13,10 @@ jobs: run: sudo apt-get install -y python3-tinycss2 - name: Update submodules run: git submodule update --init --recursive - - name: Verify check-strings script - run: tests/check-strings/verify + - name: Verify scripted tests + run: tests/scripted/verify - name: Run check-strings - run: tests/check-strings/check-strings + run: tests/scripted/check-strings shellcheck: runs-on: ubuntu-latest container: koalaman/shellcheck-alpine:v0.4.6 diff --git a/tests/check-strings/README.md b/tests/check-strings/README.md deleted file mode 100644 index 94828b770..000000000 --- a/tests/check-strings/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Check strings - -This tool checks for invalid strings not necessarily in the code. - -Background: When you move a lot of classes and files, the code may be OK, but -many strings outside the code (translations, style.css, .gitmodules etc.) may -still need to be updated. This script checks whether these strings are still -matching the code. - -Content: - -* `check-strings`: Script to check for invalid strings -* `verify`: Script verifying `check-strings` -* expectation.txt: Expectation file for verify script - diff --git a/tests/check-strings/expectation.txt b/tests/check-strings/expectation.txt deleted file mode 100644 index 53b9ae65e..000000000 --- a/tests/check-strings/expectation.txt +++ /dev/null @@ -1,81 +0,0 @@ - -# .gitmodules - -Error: .gitmodules: Directory does not exist: plugins/sid/resid - -# locale - -Error: data/locale: Source file does not exist: ../../src/gui/BBClipView.cpp -Error: data/locale: Source file does not exist: ../../src/gui/editors/BBEditor.cpp -Error: data/locale: Source file does not exist: ../../src/tracks/BBTrack.cpp -Error: data/locale: Source file does not exist: plugins/SpectrumAnalyzer/SpectrumAnalyzer.cpp -Error: data/locale: Source file does not exist: plugins/SpectrumAnalyzer/SpectrumAnalyzerControlDialog.cpp -Error: data/locale: Source file does not exist: plugins/SpectrumAnalyzer/SpectrumAnalyzerControls.cpp -Error: data/locale: Source file does not exist: plugins/flp_import/FlpImport.cpp -Error: data/locale: Source file does not exist: plugins/opl2/opl2instrument.cpp -Error: data/locale: Source file does not exist: plugins/papu/papu_instrument.cpp -Error: data/locale: Source file does not exist: plugins/sid/sid_instrument.cpp -Error: data/locale: Source file does not exist: src/gui/editors/BBEditor.cpp -Error: data/locale: Source file does not exist: src/gui/widgets/VisualizationWidget.cpp -Error: data/locale: Source file does not exist: src/tracks/BBTrack.cpp -Error: data/locale: Class does not exist in source code: BBClipView -Error: data/locale: Class does not exist in source code: BBEditor -Error: data/locale: Class does not exist in source code: BBTrack -Error: data/locale: Class does not exist in source code: SpectrumAnalyzerControlDialog -Error: data/locale: Class does not exist in source code: SpectrumAnalyzerControls -Error: data/locale: Class does not exist in source code: VisualizationWidget -Error: data/locale: Class does not exist in source code: mixerLineLcdSpinBox -Error: data/locale: Class does not exist in source code: opl2instrument -Error: data/locale: Class does not exist in source code: opl2instrumentView -Error: data/locale: Class does not exist in source code: papuInstrument -Error: data/locale: Class does not exist in source code: papuInstrumentView -Error: data/locale: Class does not exist in source code: pluginBrowser -Error: data/locale: Class does not exist in source code: sidInstrument -Error: data/locale: Class does not exist in source code: sidInstrumentView - -# themes - -Error: data/themes/classic/style.css: Class does not exist in source code: PluginDescList -Error: data/themes/classic/style.css: Class does not exist in source code: effectLabel -Error: data/themes/classic/style.css: Class does not exist in source code: nameLabel -Error: data/themes/classic/style.css: Class does not exist in source code: opl2instrumentView -Error: data/themes/classic/style.css: Class does not exist in source code: sidInstrumentView -Error: data/themes/default/style.css: Class does not exist in source code: PluginDescList -Error: data/themes/default/style.css: Class does not exist in source code: effectLabel -Error: data/themes/default/style.css: Class does not exist in source code: nameLabel -Error: data/themes/default/style.css: Class does not exist in source code: opl2instrumentView -Error: data/themes/default/style.css: Class does not exist in source code: sidInstrumentView - -# patches (checks only plugins/) - -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/calf/src/calf/metadata.h -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/calf/src/calf/modules_comp.h -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/calf/src/calf/modules_limit.h -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/calf/src/calf/modules_mod.h -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/calf/src/calf/organ.h -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/calf/src/calf/preset.h -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/calf/src/calf/primitives.h -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/calf/src/metadata.cpp -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/swh/flanger_1191.c -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/swh/gsm/short_term.c -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/swh/multivoice_chorus_1201.c -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/swh/retro_flange_1208.c -Error: debian/patches/clang.patch: Source file does not exist: plugins/LadspaEffect/swh/vynil_1905.c -Error: debian/patches/clang.patch: Source file does not exist: plugins/delay/stereodelay.cpp -Error: debian/patches/clang.patch: Source file does not exist: plugins/opl2/fmopl.c - -# debian docs (only one string) - - -# debian/copyright - -Error: debian/copyright: Glob/Path does not exist: data/projects/CoolSongs/Saber-* -Error: debian/copyright: Glob/Path does not exist: plugins/LadspaEffect/calf/src/calf/vumeter.h -Error: debian/copyright: Glob/Path does not exist: plugins/LadspaEffect/swh/gsm/* -Error: debian/copyright: Glob/Path does not exist: plugins/LadspaEffect/swh/util/pitchscale.c -Error: debian/copyright: Glob/Path does not exist: plugins/LadspaEffect/swh/vocoder_1337.c -Error: debian/copyright: Glob/Path does not exist: plugins/opl2/fmopl.* - -# summary - -59 errors. diff --git a/tests/check-strings/verify b/tests/check-strings/verify deleted file mode 100755 index bffcc1a59..000000000 --- a/tests/check-strings/verify +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/python3 - -import subprocess -from pathlib import Path -import tempfile -import os - -lmms_main_path = Path(__file__).resolve().parent.parent.parent - -res = subprocess.run(['git', 'rev-parse', 'HEAD'], capture_output=True, text=True, check=True) -head = res.stdout.rstrip() - -# test with a stable LMMS ref to always get the same expectations -ref = 'f56fc68b669b59f525ad133a0376feaba2a1a4ec' - -# find out a remote URL where we can fetch "ref" from -res = subprocess.run(['git', 'rev-parse', '-q', '--verify', ref+'^{commit}'], capture_output=True, text=True) -if res.returncode == 0: - remote = str(lmms_main_path) -else: - res = subprocess.run(['git', 'remote', 'get-url', 'origin'], capture_output=True, text=True) - if res.returncode == 0: - remote = res.stdout.rstrip() - else: - res = subprocess.run(['git', 'remote', 'get-url', 'upstream'], capture_output=True, text=True) - if res.returncode == 0: - remote = res.stdout.rstrip() - else: - raise RuntimeError( - "Sorry, I can find ref " + ref + " neither in the repo nor in the remotes \"origin\" and \"upstream\"") - -with tempfile.TemporaryDirectory() as tmpdir: - os.chdir(tmpdir) - # get the repo and its submodules - subprocess.run(['git', 'init'], check=True) - subprocess.run(['git', 'remote', 'add', 'origin', remote], check=True) - subprocess.run(['git', 'fetch', '--depth=1', 'origin', ref, head], check=True) - subprocess.run(['git', 'checkout', ref], check=True) - subprocess.run(['git', 'submodule', 'update', '--depth=1', '--init'], check=True) - # checkout the CURRENT check-strings, because it is subject-under-test - subprocess.run(['git', 'checkout', head, 'tests/check-strings/check-strings'], check=True) - # run script - res = subprocess.run([str(lmms_main_path / 'tests' / 'check-strings' / 'check-strings')], - capture_output=True, text=True) - print('--->8--- Script output BEGIN --->8---') - print(res.stdout) - print('--->8--- Script output END --->8---') - if res.stderr: - print('--->8--- Script error output BEGIN --->8---') - print(res.stderr) - print('--->8--- Script error output END --->8---') - # make sure script returned "error" (because we test for errors) and that the output is as expected - if res.returncode == 0: - raise RuntimeError("Script \"check-strings\" no errors, but errors were expected") - else: - if res.stdout != open(str(lmms_main_path / 'tests' / 'check-strings' / 'expectation.txt')).read(): - raise RuntimeError("Script \"check-strings\" returned with different output than in expectation.txt") - -# if we made it until here without an exception, all tests have been passed -print("SUCCESS") diff --git a/tests/scripted/README.md b/tests/scripted/README.md new file mode 100644 index 000000000..7d0c11162 --- /dev/null +++ b/tests/scripted/README.md @@ -0,0 +1,24 @@ +# Scripted checks + +The checks in this directory are not C++ unit tests, but simple scripts that +check the code for issues. + +## Verify + +[verify](verify) is a verification script for the scripts in this folder. + +## Check strings + +[check-strings](check-strings) checks for invalid strings not necessarily in +the code. + +Background: When you move a lot of classes and files, the code may be OK, but +many strings outside the code (translations, style.css, .gitmodules etc.) may +still need to be updated. This script checks whether these strings are still +matching the code. + +## Check namespace + +[check-namespace](check-namespace) checks namespaces and a few related things +like `#ifdef`s. + diff --git a/tests/check-strings/check-strings b/tests/scripted/check-strings similarity index 100% rename from tests/check-strings/check-strings rename to tests/scripted/check-strings diff --git a/tests/scripted/verify b/tests/scripted/verify new file mode 100755 index 000000000..5c27ef898 --- /dev/null +++ b/tests/scripted/verify @@ -0,0 +1,162 @@ +#!/usr/bin/python3 + +import subprocess +from pathlib import Path +import tempfile +import os + + +def set_git_identity(): + """Set local git identity, but only in local repo (to not overwrite user settings)""" + subprocess.run(['git', 'config', 'user.name', 'James Bond']) + subprocess.run(['git', 'config', 'user.email', '007@sis.gov.uk']) + + +def create_file(filename: str, file_content: str): + """Create a file in the current directory and adds it to git""" + Path(filename).parent.mkdir(parents=True, exist_ok=True) + with open(filename, "w") as textfile: + print(file_content, file=textfile) + subprocess.run(['git', 'add', filename], check=True) + + +class ScriptTest(): + def __init__(self, scriptpath: Path): + self.scriptpath = Path(scriptpath) + + def __enter__(self): + """Create temporary, minimal test environment, and change to it""" + self.lmms_tmpdir = tempfile.TemporaryDirectory(dir='.') + os.chdir(self.lmms_tmpdir.name) + # prerequirements + Path('data/themes').mkdir(parents=True) + subprocess.run(['git', 'init', '-b', 'main'], check=True) + set_git_identity() + subprocess.run(['git', 'submodule', 'add', '../../carla', 'plugins/CarlaBase/carla'], check=True) + create_file('src/core/classes.cpp', 'namespace lmms {\nclass TestClass\n}') + create_file('debian/lmms-common.docs', '') + create_file('debian/copyright', '') + create_file('data/locale/de.ts', + '\n' + ' \n' + ' TestClass\n' + ' \n' + ' \n' + ' About LMMS\n' + ' Über LMMS\n' + ' \n' + '\n' + '\n') + subprocess.run(['git', 'commit', '-m', 'Initial commit'], check=True) + return self + + def __exit__(self, type, value, traceback): + """Leave and destroy temporary test environment""" + os.chdir('..') + self.lmms_tmpdir.cleanup() + + def expect(self, expectation: str): + """Check if "expectation" is in the output""" + if expectation not in self.result.stdout: + raise RuntimeError(f'Expected "{expectation}" in script output') + + def run(self, expected_returncode: int = 1): # default: something goes wrong ("to the safe side") + """Run the script, check the exit code and store the result""" + self.result = subprocess.run([str(self.scriptpath)], capture_output=True, text=True) + print('--->8--- Script output BEGIN --->8---') + print(self.result.stdout) + print('--->8--- Script output END --->8---') + if self.result.stderr: + print('--->8--- Script error output BEGIN --->8---') + print(self.result.stderr) + print('--->8--- Script error output END --->8---') + # make sure script returned "error" (because we test for errors) and that the output is as expected + if self.result.returncode != expected_returncode: + raise RuntimeError(f"Script \"check-strings\" returned {self.result.returncode}, " + f"but {expected_returncode} expected") + + +lmms_main_path = Path(__file__).resolve().parent.parent.parent + +with tempfile.TemporaryDirectory() as tmpdir: + os.chdir(tmpdir) + check_strings = lmms_main_path / 'tests' / 'scripted' / 'check-strings' + + # create dummy carla repo + Path('carla').mkdir() + os.chdir('carla') + subprocess.run(['git', 'init', '-b', 'main'], check=True) + set_git_identity() + create_file('README.md', 'hello world') + subprocess.run(['git', 'commit', '-m', 'Initial commit'], check=True) + os.chdir('..') + + Path('lmms').mkdir() + os.chdir('lmms') + + # minimal working example + with ScriptTest(check_strings) as test: + test.run(0) # exitcode 0 - no errors expected + test.expect('0 errors') + + with ScriptTest(check_strings) as test: + create_file('data/locale/fr.ts', + '\n' + ' \n' + ' TestClass\n' + ' \n' + ' \n' + ' About LMMS\n' + ' À propos de LMMS\n' + ' \n' + '\n' + '\n') + test.run() + test.expect('Error: data/locale: Source file does not exist: ../../src/core/non-existent.cpp') + test.expect('1 errors') + + with ScriptTest(check_strings) as test: + create_file('data/locale/fr.ts', + '\n' + ' \n' + ' NonExistentClass\n' + ' \n' + ' \n' + ' About LMMS\n' + ' À propos de LMMS\n' + ' \n' + '\n' + '\n') + test.run() + test.expect('Error: data/locale: Class does not exist in source code: NonExistentClass') + test.expect('1 errors') + + with ScriptTest(check_strings) as test: + create_file('data/themes/classic/style.css', + 'lmms--gui--NonExistentClass {' + '\tcolor: #d1d8e4;\n' + '}') + test.run() + test.expect('Error: data/themes/classic/style.css: Class does not exist in source code: NonExistentClass') + test.expect('1 errors') + + with ScriptTest(check_strings) as test: + create_file('debian/patches/clang.patch', '/plugins/non-existent-file') + test.run() + test.expect('Error: debian/patches/clang.patch: Source file does not exist: plugins/non-existent-file') + test.expect('1 errors') + + with ScriptTest(check_strings) as test: + create_file('debian/lmms-common.docs', '/plugins/caps.html') + test.run() + test.expect('Error: debian/lmms-common.docs: Path does not exist: /plugins/caps.html') + test.expect('1 errors') + + with ScriptTest(check_strings) as test: + create_file('debian/copyright', 'Files: NonExistent') + test.run() + test.expect('Error: debian/copyright: Glob/Path does not exist: NonExistent') + test.expect('1 errors') + +# if we made it until here without an exception, all tests have been passed +print("SUCCESS") From 4821606465a5c46109f048466f84e55aeeb31d6e Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Sat, 20 Aug 2022 10:28:25 +0200 Subject: [PATCH 25/55] Blacklisting Lv2 plugins depending on gui (#6486) --- src/core/lv2/Lv2Manager.cpp | 72 ++++++++++++++++++++++++++++++++++++- src/core/lv2/Lv2Proc.cpp | 2 +- 2 files changed, 72 insertions(+), 2 deletions(-) diff --git a/src/core/lv2/Lv2Manager.cpp b/src/core/lv2/Lv2Manager.cpp index 1622d4c1b..b1391b065 100644 --- a/src/core/lv2/Lv2Manager.cpp +++ b/src/core/lv2/Lv2Manager.cpp @@ -58,7 +58,77 @@ const std::set Lv2Manager::pluginBlacklist = "http://calf.sourceforge.net/plugins/StereoTools", "http://calf.sourceforge.net/plugins/TapeSimulator", "http://calf.sourceforge.net/plugins/TransientDesigner", - "http://calf.sourceforge.net/plugins/Vinyl" + "http://calf.sourceforge.net/plugins/Vinyl", + + // Visualization, meters, and scopes etc., won't work until we have gui support + "http://distrho.sf.net/plugins/ProM", + "http://distrho.sf.net/plugins/glBars", + "http://gareus.org/oss/lv2/meters#spectr30mono", + "http://gareus.org/oss/lv2/meters#spectr30stereo", + "http://gareus.org/oss/lv2/meters#bitmeter", + "http://gareus.org/oss/lv2/meters#BBCM6", + "http://gareus.org/oss/lv2/meters#BBCmono", + "http://gareus.org/oss/lv2/meters#BBCstereo", + "http://gareus.org/oss/lv2/meters#DINmono", + "http://gareus.org/oss/lv2/meters#DINstereo", + "http://gareus.org/oss/lv2/meters#EBUmono", + "http://gareus.org/oss/lv2/meters#EBUstereo", + "http://gareus.org/oss/lv2/meters#EBUr128", + "http://gareus.org/oss/lv2/meters#BBCM6", + "http://gareus.org/oss/lv2/meters#dr14mono", + "http://gareus.org/oss/lv2/meters#dr14stereo", + "http://gareus.org/oss/lv2/meters#K12mono", + "http://gareus.org/oss/lv2/meters#K12stereo", + "http://gareus.org/oss/lv2/meters#K14mono", + "http://gareus.org/oss/lv2/meters#K14stereo", + "http://gareus.org/oss/lv2/meters#K20mono", + "http://gareus.org/oss/lv2/meters#K20stereo", + "http://gareus.org/oss/lv2/meters#NORmono", + "http://gareus.org/oss/lv2/meters#NORstereo", + "http://gareus.org/oss/lv2/meters#COR", + "http://gareus.org/oss/lv2/meters#dBTPmono", + "http://gareus.org/oss/lv2/meters#dBTPstereo", + "http://gareus.org/oss/lv2/meters#TPnRMSmono", + "http://gareus.org/oss/lv2/meters#TPnRMSstereo", + "http://gareus.org/oss/lv2/meters#VUmono", + "http://gareus.org/oss/lv2/meters#VUstereo", + "http://gareus.org/oss/lv2/meters#goniometer", + "http://gareus.org/oss/lv2/meters#stereoscope", + "http://gareus.org/oss/lv2/meters#SigDistHist", + "http://gareus.org/oss/lv2/tuna#one", + "http://gareus.org/oss/lv2/tuna#two", + "http://gareus.org/oss/lv2/sisco#Mono", + "http://gareus.org/oss/lv2/sisco#Stereo", + "http://gareus.org/oss/lv2/spectra#Mono", + "http://gareus.org/oss/lv2/convoLV2#Mono", + "http://gareus.org/oss/lv2/convoLV2#MonoToStereo", + "http://gareus.org/oss/lv2/convoLV2#Stereo", + "http://gareus.org/oss/lv2/zeroconvolv#CfgMono", + "http://gareus.org/oss/lv2/zeroconvolv#CfgMonoToStereo", + "http://gareus.org/oss/lv2/zeroconvolv#CfgStereo", + "http://gareus.org/oss/lv2/zeroconvolv#Mono", + "http://gareus.org/oss/lv2/zeroconvolv#MonoToStereo", + "http://gareus.org/oss/lv2/zeroconvolv#Stereo", + "http://lsp-plug.in/plugins/lv2/latency_meter", + "http://lsp-plug.in/plugins/lv2/spectrum_analyzer_x1", + "http://lsp-plug.in/plugins/lv2/spectrum_analyzer_x2", + "http://lsp-plug.in/plugins/lv2/phase_detector", + "http://lsp-plug.in/plugins/lv2/profiler_mono", + "http://lsp-plug.in/plugins/lv2/profiler_stereo", + "http://invadarecords.com/plugins/lv2/meter", + "http://guitarix.sourceforge.net/plugins/gxtuner#tuner", + "https://github.com/jpcima/ADLplug", + "https://github.com/HiFi-LoFi/KlangFalter", + "https://github.com/klangfreund/SpectrumAnalyser", + "https://github.com/klangfreund/lufsmeter", + "https://github.com/laixinyuan/StereoSourceSepartion", + "urn:juce:TalFilter2", + "urn:juce:Vex", + "http://zynaddsubfx.sourceforge.net", + "http://geontime.com/geonkick/single", + + // unstable + "urn:juced:DrumSynth" }; diff --git a/src/core/lv2/Lv2Proc.cpp b/src/core/lv2/Lv2Proc.cpp index 1276a13b8..4a2826752 100644 --- a/src/core/lv2/Lv2Proc.cpp +++ b/src/core/lv2/Lv2Proc.cpp @@ -365,7 +365,7 @@ void Lv2Proc::handleMidiInputEvent(const MidiEvent &event, const TimePos &time, else { qWarning() << "Warning: Caught MIDI event for an Lv2 instrument" - << "that can not hande MIDI... Ignoring"; + << "that can not handle MIDI... Ignoring"; } } From 17f597695bddb5db7933815e685026a4d9fc84ab Mon Sep 17 00:00:00 2001 From: Craig Raslawski Date: Sat, 27 Aug 2022 23:09:52 -0400 Subject: [PATCH 26/55] Fix wrong cursor for selected resizeable clips in song editor (#5996) Fixes #879. --- include/Clip.h | 6 ++++++ src/gui/clips/ClipView.cpp | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/Clip.h b/include/Clip.h index 14595263e..204a071a7 100644 --- a/include/Clip.h +++ b/include/Clip.h @@ -93,6 +93,12 @@ public: return m_length; } + /*! \brief Specify whether or not a TCO automatically resizes. + * + * If a TCO does automatically resize, it cannot be manually + * resized by clicking and dragging its edge. + * + */ inline void setAutoResize( const bool r ) { m_autoResize = r; diff --git a/src/gui/clips/ClipView.cpp b/src/gui/clips/ClipView.cpp index 0f362c58d..e41431314 100644 --- a/src/gui/clips/ClipView.cpp +++ b/src/gui/clips/ClipView.cpp @@ -504,13 +504,13 @@ void ClipView::updateCursor(QMouseEvent * me) SampleClip * sClip = dynamic_cast(m_clip); // If we are at the edges, use the resize cursor - if ((me->x() > width() - RESIZE_GRIP_WIDTH && !me->buttons() && !m_clip->getAutoResize()) - || (me->x() < RESIZE_GRIP_WIDTH && !me->buttons() && sClip && !m_clip->getAutoResize())) + if (!me->buttons() && !m_clip->getAutoResize() && !isSelected() + && ((me->x() > width() - RESIZE_GRIP_WIDTH) || (me->x() < RESIZE_GRIP_WIDTH && sClip))) { setCursor(Qt::SizeHorCursor); } // If we are in the middle on knife mode, use the knife cursor - else if (sClip && m_trackView->trackContainerView()->knifeMode()) + else if (sClip && m_trackView->trackContainerView()->knifeMode() && !isSelected()) { setCursor(m_cursorKnife); } @@ -1507,4 +1507,4 @@ QColor ClipView::getColorForDisplay( QColor defaultColor ) } -} // namespace lmms::gui \ No newline at end of file +} // namespace lmms::gui From 3cc5ec7282b12fafe1d15dc3fc86edb58e981d0e Mon Sep 17 00:00:00 2001 From: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> Date: Tue, 30 Aug 2022 02:19:07 +0200 Subject: [PATCH 27/55] Add check-namespace script (#6438) This also fixes a lot of code files to be conforming to the script. Co-authored-by: allejok96 --- .github/workflows/checks.yml | 4 +- include/AudioPortAudio.h | 2 +- include/AudioPulseAudio.h | 2 +- include/AudioSndio.h | 4 +- include/DummyEffect.h | 2 +- include/DummyPlugin.h | 2 +- include/IoHelper.h | 8 +- include/LmmsPalette.h | 6 +- include/MidiSndio.h | 4 +- include/RemotePluginBase.h | 8 +- include/RemotePluginClient.h | 2 +- include/debug.h | 2 +- include/embed.h | 2 +- include/lmms_math.h | 6 +- include/versioninfo.h | 5 + plugins/Lv2Effect/Lv2Effect.h | 2 +- plugins/VstBase/RemoteVstPlugin.cpp | 16 +- plugins/VstBase/VstPlugin.cpp | 2 +- plugins/Xpressive/ExprSynth.cpp | 2 +- plugins/ZynAddSubFx/LocalZynAddSubFx.cpp | 2 +- plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp | 4 +- src/core/ConfigManager.cpp | 2 +- src/core/DrumSynth.cpp | 2 +- src/core/SampleBuffer.cpp | 12 +- src/core/audio/AudioAlsa.cpp | 2 +- src/core/audio/AudioFileMP3.cpp | 2 +- src/core/audio/AudioFileOgg.cpp | 2 +- src/core/audio/AudioJack.cpp | 4 +- src/core/audio/AudioOss.cpp | 2 +- src/core/audio/AudioPortAudio.cpp | 2 +- src/core/audio/AudioPulseAudio.cpp | 2 +- src/core/audio/AudioSdl.cpp | 4 +- src/core/audio/AudioSndio.cpp | 2 +- src/core/audio/AudioSoundIo.cpp | 2 +- src/core/main.cpp | 4 +- src/core/midi/MidiSndio.cpp | 2 +- src/gui/AudioAlsaSetupWidget.cpp | 2 +- src/gui/MainApplication.cpp | 2 +- src/gui/MixerView.cpp | 2 +- src/gui/instrument/PianoView.cpp | 4 +- tests/scripted/check-namespace | 195 ++++++++++++++++++++++ tests/scripted/verify | 88 ++++++++++ 42 files changed, 360 insertions(+), 66 deletions(-) create mode 100755 tests/scripted/check-namespace diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 05d078205..1d893989e 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -5,7 +5,7 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - check-strings: + scripted-checks: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 @@ -17,6 +17,8 @@ jobs: run: tests/scripted/verify - name: Run check-strings run: tests/scripted/check-strings + - name: Run check-namespace + run: tests/scripted/check-namespace shellcheck: runs-on: ubuntu-latest container: koalaman/shellcheck-alpine:v0.4.6 diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index e6750e4b4..3fd32a7ac 100644 --- a/include/AudioPortAudio.h +++ b/include/AudioPortAudio.h @@ -143,7 +143,7 @@ private: void *hostApiSpecificStreamInfo; } PaStreamParameters; -#endif +#endif // PORTAUDIO_V19 PaStream * m_paStream; PaStreamParameters m_outputParameters; diff --git a/include/AudioPulseAudio.h b/include/AudioPulseAudio.h index a4721dfbd..789296e27 100644 --- a/include/AudioPulseAudio.h +++ b/include/AudioPulseAudio.h @@ -102,6 +102,6 @@ private: } // namespace lmms -#endif +#endif // LMMS_HAVE_PULSEAUDIO #endif diff --git a/include/AudioSndio.h b/include/AudioSndio.h index b2da8eac0..606850105 100644 --- a/include/AudioSndio.h +++ b/include/AudioSndio.h @@ -87,6 +87,6 @@ private: } // namespace lmms -#endif /* LMMS_HAVE_SNDIO */ +#endif // LMMS_HAVE_SNDIO -#endif /* _AUDIO_SNDIO_H */ +#endif // _AUDIO_SNDIO_H diff --git a/include/DummyEffect.h b/include/DummyEffect.h index 675249865..9db45a3e1 100644 --- a/include/DummyEffect.h +++ b/include/DummyEffect.h @@ -50,7 +50,7 @@ public: } ; -} +} // namespace gui class DummyEffectControls : public EffectControls { diff --git a/include/DummyPlugin.h b/include/DummyPlugin.h index cf36d2159..1c763ec3e 100644 --- a/include/DummyPlugin.h +++ b/include/DummyPlugin.h @@ -66,6 +66,6 @@ protected: } ; -} // namesplace lmms +} // namespace lmms #endif diff --git a/include/IoHelper.h b/include/IoHelper.h index 4f08f5087..c7d65c917 100644 --- a/include/IoHelper.h +++ b/include/IoHelper.h @@ -22,6 +22,8 @@ * */ +#ifndef IO_HELPER_H +#define IO_HELPER_H #include "lmmsconfig.h" @@ -37,7 +39,7 @@ #ifdef LMMS_HAVE_UNISTD_H #include #endif -#endif +#endif // LMMS_BUILD_WIN32 namespace lmms { @@ -87,4 +89,6 @@ int fileToDescriptor(FILE* f, bool closeFile = true) } -} // namespace lmms \ No newline at end of file +} // namespace lmms + +#endif diff --git a/include/LmmsPalette.h b/include/LmmsPalette.h index b07aa5c84..023872254 100644 --- a/include/LmmsPalette.h +++ b/include/LmmsPalette.h @@ -23,12 +23,12 @@ * */ -#include -#include "lmms_export.h" - #ifndef LMMSPALETTE_H #define LMMSPALETTE_H +#include +#include "lmms_export.h" + namespace lmms::gui { diff --git a/include/MidiSndio.h b/include/MidiSndio.h index 35788131d..3ebd14d05 100644 --- a/include/MidiSndio.h +++ b/include/MidiSndio.h @@ -73,6 +73,6 @@ private: } // namespace lmms -#endif /* LMMS_HAVE_SNDIO */ +#endif // LMMS_HAVE_SNDIO -#endif /* _MIDI_SNDIO_H */ +#endif // _MIDI_SNDIO_H diff --git a/include/RemotePluginBase.h b/include/RemotePluginBase.h index 0a3601d7c..e309496bc 100644 --- a/include/RemotePluginBase.h +++ b/include/RemotePluginBase.h @@ -341,7 +341,7 @@ private: std::atomic_int m_lockDepth; } ; -#endif +#endif // SYNC_WITH_SHM_FIFO @@ -530,7 +530,7 @@ public: writeInt( len ); write( _s.c_str(), len ); } -#endif +#endif // SYNC_WITH_SHM_FIFO #ifndef BUILD_REMOTE_PLUGIN_CLIENT inline bool messagesLeft() @@ -562,7 +562,7 @@ public: { return waitDepthCounter() > 0; } -#endif +#endif // BUILD_REMOTE_PLUGIN_CLIENT virtual bool processMessage( const message & _m ) = 0; @@ -667,7 +667,7 @@ private: pthread_mutex_t m_receiveMutex; pthread_mutex_t m_sendMutex; -#endif +#endif // SYNC_WITH_SHM_FIFO } ; diff --git a/include/RemotePluginClient.h b/include/RemotePluginClient.h index 2d825486e..4c5fcc060 100644 --- a/include/RemotePluginClient.h +++ b/include/RemotePluginClient.h @@ -173,7 +173,7 @@ private: std::condition_variable m_cv; std::thread m_thread; }; -#endif +#endif // LMMS_BUILD_WIN32 #ifdef SYNC_WITH_SHM_FIFO RemotePluginClient::RemotePluginClient( const std::string& _shm_in, const std::string& _shm_out ) : diff --git a/include/debug.h b/include/debug.h index f619da666..f2ea29cc1 100644 --- a/include/debug.h +++ b/include/debug.h @@ -33,7 +33,7 @@ #ifndef NDEBUG #define NDEBUG #endif -#endif +#endif // LMMS_DEBUG #include #include diff --git a/include/embed.h b/include/embed.h index c8914ba47..03d767b43 100644 --- a/include/embed.h +++ b/include/embed.h @@ -65,7 +65,7 @@ inline QPixmap getIconPixmap( const QString& _name, } //QString getText( const char * _name ); -} +} // namespace PLUGIN_NAME #endif // PLUGIN_NAME diff --git a/include/lmms_math.h b/include/lmms_math.h index e1de09936..db4502f1c 100644 --- a/include/lmms_math.h +++ b/include/lmms_math.h @@ -118,7 +118,7 @@ static inline float absFraction( float _x ) } #endif -#endif +#endif // __INTEL_COMPILER @@ -153,7 +153,7 @@ static inline long double fastFmal( long double a, long double b, long double c #endif #else return a * b + c; -#endif +#endif // FP_FAST_FMAL } //! @brief Takes advantage of fmaf() function if present in hardware @@ -167,7 +167,7 @@ static inline float fastFmaf( float a, float b, float c ) #endif #else return a * b + c; -#endif +#endif // FP_FAST_FMAF } //! @brief Takes advantage of fma() function if present in hardware diff --git a/include/versioninfo.h b/include/versioninfo.h index 2bb74a570..29bf3bea9 100644 --- a/include/versioninfo.h +++ b/include/versioninfo.h @@ -1,3 +1,6 @@ +#ifndef VERSION_INFO_H +#define VERSION_INFO_H + #include "lmms_basics.h" #ifdef __GNUC__ @@ -47,3 +50,5 @@ constexpr const char* LMMS_BUILDCONF_PLATFORM = "win32"; #ifdef LMMS_BUILD_HAIKU constexpr const char* LMMS_BUILDCONF_PLATFORM = "Haiku"; #endif + +#endif diff --git a/plugins/Lv2Effect/Lv2Effect.h b/plugins/Lv2Effect/Lv2Effect.h index 7e1457777..521a7df74 100644 --- a/plugins/Lv2Effect/Lv2Effect.h +++ b/plugins/Lv2Effect/Lv2Effect.h @@ -58,4 +58,4 @@ private: } // namespace lmms -#endif // LMMS_HAVE_LV2 +#endif diff --git a/plugins/VstBase/RemoteVstPlugin.cpp b/plugins/VstBase/RemoteVstPlugin.cpp index aaf8aec3d..2b035eca7 100644 --- a/plugins/VstBase/RemoteVstPlugin.cpp +++ b/plugins/VstBase/RemoteVstPlugin.cpp @@ -57,7 +57,7 @@ #include #endif -#endif +#endif // LMMS_BUILD_LINUX #ifndef NATIVE_LINUX_VST #define USE_WS_PREFIX @@ -883,7 +883,7 @@ void RemoteVstPlugin::initEditor() pluginDispatch(effEditTop); m_x11WindowVisible = true; -#endif +#endif // NATIVE_LINUX_VST } @@ -1090,16 +1090,16 @@ void RemoteVstPlugin::process( const sampleFrame * _in, sampleFrame * _out ) #ifdef OLD_VST_SDK if( m_plugin->flags & effFlagsCanReplacing ) { -#endif m_plugin->processReplacing( m_plugin, m_inputs, m_outputs, bufferSize() ); -#ifdef OLD_VST_SDK } else { m_plugin->process( m_plugin, m_inputs, m_outputs, bufferSize() ); } +#else + m_plugin->processReplacing(m_plugin, m_inputs, m_outputs, bufferSize()); #endif unlockShm(); @@ -1937,7 +1937,7 @@ intptr_t RemoteVstPlugin::hostCallback( AEffect * _effect, int32_t _opcode, // TODO // close window, platform specific handle in return 0; -#endif +#endif // OLD_VST_SDK case audioMasterSizeWindow: { @@ -2334,7 +2334,7 @@ void RemoteVstPlugin::guiEventLoop() } } } -#endif +#endif // NATIVE_LINUX_VST #ifndef NATIVE_LINUX_VST @@ -2385,7 +2385,7 @@ LRESULT CALLBACK RemoteVstPlugin::wndProc( HWND hwnd, UINT uMsg, } -#endif +#endif // NATIVE_LINUX_VST } // namespace lmms @@ -2421,7 +2421,7 @@ int main( int _argc, char * * _argv ) sched_get_priority_min( SCHED_FIFO ) ) / 2; sched_setscheduler( 0, SCHED_FIFO, &sparam ); #endif -#endif +#endif // LMMS_BUILD_LINUX #ifdef LMMS_BUILD_WIN32 if( !SetPriorityClass( GetCurrentProcess(), HIGH_PRIORITY_CLASS ) ) diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index bba644305..46d2057dd 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -111,7 +111,7 @@ private: uchar* m_map; }; -} +} // namespace PE namespace lmms { diff --git a/plugins/Xpressive/ExprSynth.cpp b/plugins/Xpressive/ExprSynth.cpp index e7d7e0951..0a1454345 100644 --- a/plugins/Xpressive/ExprSynth.cpp +++ b/plugins/Xpressive/ExprSynth.cpp @@ -363,7 +363,7 @@ namespace SimpleRandom { return dist(generator); } }; -} +} // namespace SimpleRandom static freefunc0 simple_rand; diff --git a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp index 2b0c0d974..36f7ce48c 100644 --- a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp @@ -64,7 +64,7 @@ LocalZynAddSubFx::LocalZynAddSubFx() : pthread_win32_process_attach_np(); pthread_win32_thread_attach_np(); #endif -#endif +#endif // LMMS_BUILD_WIN32 initConfig(); diff --git a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp index b2e47cade..1de5fb97d 100644 --- a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp @@ -278,7 +278,7 @@ int main( int _argc, char * * _argv ) pthread_win32_process_attach_np(); pthread_win32_thread_attach_np(); #endif -#endif +#endif // LMMS_BUILD_WIN32 #ifdef SYNC_WITH_SHM_FIFO @@ -298,7 +298,7 @@ int main( int _argc, char * * _argv ) pthread_win32_thread_detach_np(); pthread_win32_process_detach_np(); #endif -#endif +#endif // LMMS_BUILD_WIN32 return 0; } diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index 59987de97..dbad06784 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -566,7 +566,7 @@ void ConfigManager::loadConfigFile(const QString & configFile) } #endif } -#endif +#endif // LMMS_HAVE_STK upgrade(); diff --git a/src/core/DrumSynth.cpp b/src/core/DrumSynth.cpp index 79630e42d..bc5455c96 100644 --- a/src/core/DrumSynth.cpp +++ b/src/core/DrumSynth.cpp @@ -37,7 +37,7 @@ #ifdef _MSC_VER //not #if LMMS_BUILD_WIN32 because we have strncasecmp in mingw #define strcasecmp _stricmp -#endif +#endif // _MSC_VER namespace lmms { diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index b931b27b5..68d9af2c9 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -672,7 +672,7 @@ f_cnt_t SampleBuffer::decodeSampleOGGVorbis( return frames; } -#endif +#endif // LMMS_HAVE_OGGVORBIS @@ -1258,7 +1258,7 @@ void flacStreamEncoderMetadataCallback( b->write((const char *) metadata, sizeof(*metadata)); } -#endif +#endif // LMMS_HAVE_FLAC_STREAM_ENCODER_H @@ -1314,12 +1314,12 @@ QString & SampleBuffer::toBase64(QString & dst) const base64::encode(baWriter.buffer().data(), baWriter.buffer().size(), dst); -#else /* LMMS_HAVE_FLAC_STREAM_ENCODER_H */ +#else // LMMS_HAVE_FLAC_STREAM_ENCODER_H base64::encode((const char *) m_data, m_frames * sizeof(sampleFrame), dst); -#endif /* LMMS_HAVE_FLAC_STREAM_ENCODER_H */ +#endif // LMMS_HAVE_FLAC_STREAM_ENCODER_H return dst; } @@ -1461,7 +1461,7 @@ void flacStreamDecoderErrorCallback( // what to do now?? } -#endif +#endif // LMMS_HAVE_FLAC_STREAM_DECODER_H void SampleBuffer::loadFromBase64(const QString & data) @@ -1517,7 +1517,7 @@ void SampleBuffer::loadFromBase64(const QString & data) m_origData = MM_ALLOC( m_origFrames); memcpy(m_origData, dst, dsize); -#endif +#endif // LMMS_HAVE_FLAC_STREAM_DECODER_H delete[] dst; diff --git a/src/core/audio/AudioAlsa.cpp b/src/core/audio/AudioAlsa.cpp index 0cf95f895..1a22413d8 100644 --- a/src/core/audio/AudioAlsa.cpp +++ b/src/core/audio/AudioAlsa.cpp @@ -542,4 +542,4 @@ int AudioAlsa::setSWParams() } // namespace lmms -#endif +#endif // LMMS_HAVE_ALSA diff --git a/src/core/audio/AudioFileMP3.cpp b/src/core/audio/AudioFileMP3.cpp index 75084460f..4930e9ad6 100644 --- a/src/core/audio/AudioFileMP3.cpp +++ b/src/core/audio/AudioFileMP3.cpp @@ -134,4 +134,4 @@ void AudioFileMP3::tearDownEncoder() } // namespace lmms -#endif +#endif // LMMS_HAVE_MP3LAME diff --git a/src/core/audio/AudioFileOgg.cpp b/src/core/audio/AudioFileOgg.cpp index 1f40f456e..d61e27da8 100644 --- a/src/core/audio/AudioFileOgg.cpp +++ b/src/core/audio/AudioFileOgg.cpp @@ -272,6 +272,6 @@ void AudioFileOgg::finishEncoding() } // namespace lmms -#endif +#endif // LMMS_HAVE_OGGVORBIS diff --git a/src/core/audio/AudioJack.cpp b/src/core/audio/AudioJack.cpp index 071a6e3c3..daf5bbd10 100644 --- a/src/core/audio/AudioJack.cpp +++ b/src/core/audio/AudioJack.cpp @@ -339,7 +339,7 @@ void AudioJack::renamePort( AudioPort * _port ) #endif } } -#endif +#endif // AUDIO_PORT_SUPPORT } @@ -502,4 +502,4 @@ void AudioJack::setupWidget::saveSettings() } // namespace lmms -#endif +#endif // LMMS_HAVE_JACK diff --git a/src/core/audio/AudioOss.cpp b/src/core/audio/AudioOss.cpp index 4480e399c..d79ed939d 100644 --- a/src/core/audio/AudioOss.cpp +++ b/src/core/audio/AudioOss.cpp @@ -362,5 +362,5 @@ void AudioOss::setupWidget::saveSettings() } // namespace lmms -#endif +#endif // LMMS_HAVE_OSS diff --git a/src/core/audio/AudioPortAudio.cpp b/src/core/audio/AudioPortAudio.cpp index b1e9cb5c4..03bceaa89 100644 --- a/src/core/audio/AudioPortAudio.cpp +++ b/src/core/audio/AudioPortAudio.cpp @@ -511,7 +511,7 @@ void AudioPortAudio::setupWidget::show() } // namespace lmms -#endif +#endif // LMMS_HAVE_PORTAUDIO diff --git a/src/core/audio/AudioPulseAudio.cpp b/src/core/audio/AudioPulseAudio.cpp index 40c955434..d1476f836 100644 --- a/src/core/audio/AudioPulseAudio.cpp +++ b/src/core/audio/AudioPulseAudio.cpp @@ -353,5 +353,5 @@ void AudioPulseAudio::setupWidget::saveSettings() } // namespace lmms -#endif +#endif // LMMS_HAVE_PULSEAUDIO diff --git a/src/core/audio/AudioSdl.cpp b/src/core/audio/AudioSdl.cpp index d321e8566..8d4687518 100644 --- a/src/core/audio/AudioSdl.cpp +++ b/src/core/audio/AudioSdl.cpp @@ -304,7 +304,7 @@ void AudioSdl::sdlAudioCallback( Uint8 * _buf, int _len ) m_convertedBufPos += min_len; m_convertedBufPos %= m_convertedBufSize; } -#endif +#endif // LMMS_HAVE_SDL2 } #ifdef LMMS_HAVE_SDL2 @@ -349,5 +349,5 @@ void AudioSdl::setupWidget::saveSettings() } // namespace lmms -#endif +#endif // LMMS_HAVE_SDL diff --git a/src/core/audio/AudioSndio.cpp b/src/core/audio/AudioSndio.cpp index 0ba801585..a8ea34ce1 100644 --- a/src/core/audio/AudioSndio.cpp +++ b/src/core/audio/AudioSndio.cpp @@ -215,4 +215,4 @@ void AudioSndio::setupWidget::saveSettings() } // namespace lmms -#endif /* LMMS_HAVE_SNDIO */ +#endif // LMMS_HAVE_SNDIO diff --git a/src/core/audio/AudioSoundIo.cpp b/src/core/audio/AudioSoundIo.cpp index 4d8c48708..633808204 100644 --- a/src/core/audio/AudioSoundIo.cpp +++ b/src/core/audio/AudioSoundIo.cpp @@ -521,4 +521,4 @@ void AudioSoundIo::setupWidget::saveSettings() } // namespace lmms -#endif +#endif // LMMS_HAVE_SOUNDIO diff --git a/src/core/main.cpp b/src/core/main.cpp index 43e744e5b..58758c2b1 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -120,7 +120,7 @@ void consoleMessageHandler(QtMsgType type, QByteArray localMsg = msg.toLocal8Bit(); fprintf(stderr, "%s\n", localMsg.constData()); } -#endif +#endif // LMMS_BUILD_WIN32 inline void loadTranslation( const QString & tname, @@ -776,7 +776,7 @@ int main( int argc, char * * argv ) printf( "Notice: could not set realtime priority.\n" ); } #endif -#endif +#endif // LMMS_HAVE_SCHED_H #endif #ifdef LMMS_BUILD_WIN32 diff --git a/src/core/midi/MidiSndio.cpp b/src/core/midi/MidiSndio.cpp index e7f2362f6..e644113b2 100644 --- a/src/core/midi/MidiSndio.cpp +++ b/src/core/midi/MidiSndio.cpp @@ -118,4 +118,4 @@ void MidiSndio::run() } // namespace lmms -#endif /* LMMS_HAVE_SNDIO */ +#endif // LMMS_HAVE_SNDIO diff --git a/src/gui/AudioAlsaSetupWidget.cpp b/src/gui/AudioAlsaSetupWidget.cpp index f6e91f8e3..8a253c75a 100644 --- a/src/gui/AudioAlsaSetupWidget.cpp +++ b/src/gui/AudioAlsaSetupWidget.cpp @@ -120,4 +120,4 @@ void AudioAlsaSetupWidget::onCurrentIndexChanged(int index) } // namespace lmms::gui -#endif +#endif // LMMS_HAVE_ALSA diff --git a/src/gui/MainApplication.cpp b/src/gui/MainApplication.cpp index a08df0f09..af8a71684 100644 --- a/src/gui/MainApplication.cpp +++ b/src/gui/MainApplication.cpp @@ -105,7 +105,7 @@ bool MainApplication::nativeEventFilter(const QByteArray& eventType, } return false; } -#endif +#endif // LMMS_BUILD_WIN32 } // namespace lmms::gui diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index 32355edd6..9103a5584 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -624,4 +624,4 @@ void MixerView::updateFaders() } -} // namesapce lmms::gui +} // namespace lmms::gui diff --git a/src/gui/instrument/PianoView.cpp b/src/gui/instrument/PianoView.cpp index b6dec8b4f..87a356afc 100644 --- a/src/gui/instrument/PianoView.cpp +++ b/src/gui/instrument/PianoView.cpp @@ -211,7 +211,7 @@ int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke ) case 13: return 30; // = case 27: return 31; // ] } -#endif +#endif // LMMS_BUILD_WIN32 #if defined(LMMS_BUILD_LINUX) || defined(LMMS_BUILD_OPENBSD) || defined(LMMS_BUILD_FREEBSD) switch( k ) { @@ -292,7 +292,7 @@ int PianoView::getKeyFromKeyEvent( QKeyEvent * _ke ) case 29: return 27; // 0 = d'# case 35: return 28; // P = e' } -#endif +#endif // LMMS_BUILD_APPLE return -100; } diff --git a/tests/scripted/check-namespace b/tests/scripted/check-namespace new file mode 100755 index 000000000..8c1b405ad --- /dev/null +++ b/tests/scripted/check-namespace @@ -0,0 +1,195 @@ +#!/usr/bin/python3 + +# This script checks the code for namespace related issues +# Note: This script is not perfect. It can not parse all LMMS files, +# and does not contain a complete C++ parser. If you encounter +# difficulties with this tests, it could be a fault of your +# changes, but it could also be a fault of this script. + +import re +import subprocess +import sys +from pathlib import Path +from typing import NamedTuple + + +# types + +class BlockType: + pass + + +IF_MACRO = BlockType() +HEADER_GUARD = BlockType() +CODE_BLOCK = BlockType() +EXTERN = BlockType() + + +class Expectation(NamedTuple): + type: BlockType + statement: str # expected end statement + name: str # expected name in comment + + +# global variables + +errors = 0 + + +# functions + +def caption(my_str): + print(f'\n# {my_str}\n') + + +def error(where, match, my_str): + global errors + errors += 1 + if match: + line = match.string[:match.start()].count('\n') + 1 # first line is 1 + where = f'{where}:{line}' + print(f'Error: {where}: {my_str}') + + +if not Path('.gitmodules').is_file(): + print('You need to call this script from the LMMS top directory') + exit(1) + +result = subprocess.run(['git', 'ls-files', '*.[ch]', '*.[ch]pp', ':!tests/*'], + capture_output=True, text=True, check=True) + +known_no_namespace_lmms = { + # main.cpp + 'src/core/main.cpp', + # nothing to set under a namespace + 'include/debug.h', + 'include/versioninfo.h', + 'plugins/CarlaBase/CarlaConfig/config.h', + 'plugins/CarlaBase/DummyCarla.cpp', + # unclear why it has no namespace + 'plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp', +} + +exclude_files = re.compile( + # not ours: + 'include/(aeffectx|fenv|ladspa).h|' + 'plugins/LadspaEffect/(calf|caps|cmt|swh|tap)/|' + 'plugins/MidiExport/MidiFile.hpp|' + 'plugins/ReverbSC/[a-z]|' + 'plugins/Sf2Player/fluidsynthshims.h|' + '/portsmf/' +) + +files = [Path(f) for f in result.stdout.splitlines() if not exclude_files.search(f)] + +# Debug argument +if len(sys.argv) > 1: + files = [Path(arg) for arg in sys.argv[1:]] + +statement_pattern = re.compile( + # Capture comments first to prevent them from matching any other regex + # Include next line if line ends with backslash + r'/[*](.|\n)*?[*]/|//(.*\\\n)*.*|' + + # Macro with <30 lines and no other #if inside needs no end comment + # Match here to prevent from matching next regex + # With a (?!negative lookahead) we can allow all # except the ones followed by "if" + r'^ *# *(?Pifn?def)(?=(([^#\n]|#(?!if|endif))*\n){,30} *# *endif)|' + # Macro followed by name or comment + # With (?P...) you can do a backreference to \name later + r'^ *# *(?Pifn?def|endif)(( *// *| +)(?P\w+))?|' + # Other macros where we don't want the argument + r'^ *# *(?Pinclude|if|el(se|if))|' + + # Namespace that contains no other braces needs no end comment + # With a (?=lookahead) we can let the "namespace" part be eaten by the parser + # but save the braces and their content for later so they can be matched again + r'^ *namespace *[\w:]*\s*(?={[^{}]*})|' + # Start of named namespace, extern "C" or just a opening brace + r'(^ *(namespace +(?P[\w:]+)|(?Pextern *"C"))\s*)?(?P{)|' + # End of namespace including comment, or just a closing brace + r'(?P})( *// *namespace +(?P[\w:]+))?' + + # In all the regexes above match both tab and space when a space is used + r''.replace(' ', r'[\t ]'), + # Make ^ match on every line, not just beginning of file + re.MULTILINE) + +# Comments and whitespace followed by header guard +header_guard_pattern = re.compile(r'^(/[*](.|\n)*?[*]/|//.*|\s)*#\s*(ifndef|pragma\s+once)') + +# Namespace lmms +namespace_pattern = re.compile(r'^\s*namespace\s+lmms', re.MULTILINE) + +# +# the real code +# + +caption('namespace checks') + +for cur_file in files: + if cur_file.is_file(): + cur_text = cur_file.read_text(errors='replace') + + if str(cur_file) not in known_no_namespace_lmms: + namespace_pattern.search(cur_text) or error(cur_file, None, f'File has no namespace lmms') + + header_guard = str(cur_file).endswith('.h') + expectations = [] # type: list[Expectation] + + if header_guard: + if not header_guard_pattern.match(cur_text): + error(cur_file, None, 'First statement should be header guard') + header_guard = False + + for m in statement_pattern.finditer(cur_text): + # Find the matched regex group + statement = m.group('opening_brace') or m.group('closing_brace') + if not statement: + statement = '#' + (m.group('macro') or m.group('named_macro') or m.group('short_macro') or '') + if not statement: + continue + + # Start statements + if statement == '{': + etype = EXTERN if m.group('extern') else CODE_BLOCK + expectations.append(Expectation(etype, '}', m.group('namespace'))) + elif statement.startswith('#if'): + etype = HEADER_GUARD if header_guard else IF_MACRO + expectations.append(Expectation(etype, '#endif', m.group('macro_name'))) + header_guard = False + + # End statements + elif statement == '#endif' or statement.startswith('#el') or statement == '}': + if not expectations: + error(cur_file, m, f'Unexpected {statement}') + break + # Don't pop the expectation for an #else tag, we are still waiting for the #endif + if statement.startswith('#el') and expectations[-1].statement == '#endif': + continue + exp = expectations.pop() + name = m.group('macro_name') or m.group('namespace_end') or '' + if statement != exp.statement: + error(cur_file, m, f'Expected {exp.statement} before {statement}') + break + # Require no end comment for header guard + elif exp.type is HEADER_GUARD and not name: + continue + elif exp.name and name != exp.name: + comment = 'namespace ' if exp.type is CODE_BLOCK else '' + error(cur_file, m, f'Missing comment // {comment}{exp.name}') + + # Extra checks + elif statement == '#include': + if any(True for e in expectations if e.type is CODE_BLOCK): + error(cur_file, m, '#include inside a code block') + + else: + # Leftover expected statements + for exp in reversed(expectations): + error(cur_file, None, f'Expected {exp.statement} before end of file') + +caption('summary') + +print(f'{str(errors)} errors.') +exit(1 if errors > 0 else 0) diff --git a/tests/scripted/verify b/tests/scripted/verify index 5c27ef898..20a26a303 100755 --- a/tests/scripted/verify +++ b/tests/scripted/verify @@ -81,6 +81,7 @@ lmms_main_path = Path(__file__).resolve().parent.parent.parent with tempfile.TemporaryDirectory() as tmpdir: os.chdir(tmpdir) check_strings = lmms_main_path / 'tests' / 'scripted' / 'check-strings' + check_namespace = lmms_main_path / 'tests' / 'scripted' / 'check-namespace' # create dummy carla repo Path('carla').mkdir() @@ -158,5 +159,92 @@ with tempfile.TemporaryDirectory() as tmpdir: test.expect('Error: debian/copyright: Glob/Path does not exist: NonExistent') test.expect('1 errors') + with ScriptTest(check_namespace) as test: + # minimal working example + test.run(0) # exitcode 0 - no errors expected + test.expect('0 errors') + + create_file('01_OddBraceWithinMacro.cpp', ''' + #if HAS_EVEN_BRACES + namespace lmms {} + #endif + namespace lmms { + #if HAS_ODD_BRACE + } + #endif + ''') + create_file('02_IncludeInCodeBlock.cpp', ''' + #include + extern "C" { + #include "alright.c" + } + namespace lmms { + #include + } + ''') + create_file('03_MacroComments.h', ''' + #ifndef HEADER_GUARD_NEEDS_NO_COMMENT + #define HEADER_GUARD_NEEDS_NO_COMMENT + #ifdef HAS_NESTED_NEEDS_COMMENT + #ifdef SHORT_NO_NESTED_NEEDS_NO_COMMENT + namespace lmms {} + #endif + #endif + #ifdef HAS_COMMENT + #ifdef SHORT_NO_NESTED_NEEDS_NO_COMMENT + #else + #endif + #endif // HAS_COMMENT + #endif + ''') + create_file('04_NamespaceComments.cpp', ''' + namespace lmms { + namespace ShortNamespace { + class WithDeclarationsOnly; + } + namespace LongNamespace { + class WithDefinition { + int x; + }; + } + } // namespace lmms + ''') + create_file('05_NoHeaderGuard.h', ''' + #include + namespace lmms {} + ''') + create_file('06_PragmaButNoLmms.h', ''' + // should not cause header guard warning + #pragma once + namespace not_lmms {} + ''') + create_file('07_MismatchingEndifName.h', ''' + #ifndef ABC_H + namespace lmms { + \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n + } + #endif // XYZ_H + ''') + create_file('08_MismatchingNamespaceEndName.h', ''' + #ifndef ABC_H + namespace lmms { + {} + } // namespace smml + #endif // ABC_H + ''') + test.run() + test.expect('8 errors') + test.expect(''' +Error: 01_OddBraceWithinMacro.cpp:7: Expected #endif before } +Error: 02_IncludeInCodeBlock.cpp:7: #include inside a code block +Error: 03_MacroComments.h:8: Missing comment // HAS_NESTED_NEEDS_COMMENT +Error: 04_NamespaceComments.cpp:10: Missing comment // namespace LongNamespace +Error: 05_NoHeaderGuard.h: First statement should be header guard +Error: 06_PragmaButNoLmms.h: File has no namespace lmms +Error: 07_MismatchingEndifName.h:36: Missing comment // ABC_H +Error: 08_MismatchingNamespaceEndName.h:5: Missing comment // namespace lmms +''') + + # if we made it until here without an exception, all tests have been passed print("SUCCESS") From 550c7bf82e4a7658caf2491fb0e3a37bdce8d046 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Tue, 6 Sep 2022 17:25:59 +0100 Subject: [PATCH 28/55] Improve use of strip command (#6505) --- CMakeLists.txt | 10 +++++++++ cmake/modules/BuildPlugin.cmake | 10 ++++++--- plugins/LadspaEffect/calf/CMakeLists.txt | 13 +++++++---- plugins/LadspaEffect/caps/CMakeLists.txt | 8 ++++++- plugins/LadspaEffect/cmt/CMakeLists.txt | 18 ++++++++++----- plugins/LadspaEffect/swh/CMakeLists.txt | 10 +++++++++ plugins/LadspaEffect/tap/CMakeLists.txt | 13 +++++++---- .../VstBase/RemoteVstPlugin/CMakeLists.txt | 22 ++++++++++++++++--- plugins/ZynAddSubFx/CMakeLists.txt | 16 ++++++++++++-- 9 files changed, 98 insertions(+), 22 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a230a937..0453c169b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -604,6 +604,16 @@ SET(CMAKE_CXX_FLAGS "${WERROR_FLAGS} ${CMAKE_CXX_FLAGS}") SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DLMMS_DEBUG") SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DLMMS_DEBUG") +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16") + set(NOOP_COMMAND "${CMAKE_COMMAND}" "-E" "true") +else() + set(NOOP_COMMAND "${CMAKE_COMMAND}" "-E" "echo") +endif() +if(STRIP) + set(STRIP_COMMAND "$,${NOOP_COMMAND},${STRIP}>") +else() + set(STRIP_COMMAND "${NOOP_COMMAND}") +endif() # people simply updating git will still have this and mess up build with it FILE(REMOVE include/lmmsconfig.h) diff --git a/cmake/modules/BuildPlugin.cmake b/cmake/modules/BuildPlugin.cmake index 675433e63..f8b3d3153 100644 --- a/cmake/modules/BuildPlugin.cmake +++ b/cmake/modules/BuildPlugin.cmake @@ -76,9 +76,13 @@ MACRO(BUILD_PLUGIN PLUGIN_NAME) ADD_DEPENDENCIES(${PLUGIN_NAME} lmms) ENDIF(LMMS_BUILD_APPLE) IF(LMMS_BUILD_WIN32) - IF(STRIP) - ADD_CUSTOM_COMMAND(TARGET ${PLUGIN_NAME} POST_BUILD COMMAND ${STRIP} "$") - ENDIF() + add_custom_command( + TARGET "${PLUGIN_NAME}" + POST_BUILD + COMMAND "${STRIP_COMMAND}" "$" + VERBATIM + COMMAND_EXPAND_LISTS + ) SET_TARGET_PROPERTIES(${PLUGIN_NAME} PROPERTIES PREFIX "") ENDIF() diff --git a/plugins/LadspaEffect/calf/CMakeLists.txt b/plugins/LadspaEffect/calf/CMakeLists.txt index f5fb632f6..90f506417 100644 --- a/plugins/LadspaEffect/calf/CMakeLists.txt +++ b/plugins/LadspaEffect/calf/CMakeLists.txt @@ -40,10 +40,15 @@ IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") ENDIF() SET_TARGET_PROPERTIES(veal PROPERTIES COMPILE_FLAGS "-fexceptions -O2 -finline-functions ${INLINE_FLAGS}") -# Don't strip if "Debug" or "RelWithDebInfo" -IF(LMMS_BUILD_WIN32 AND NOT CMAKE_BUILD_TYPE MATCHES "Deb") - ADD_CUSTOM_COMMAND(TARGET veal POST_BUILD COMMAND "${STRIP}" "$") -ENDIF() +if(LMMS_BUILD_WIN32) + add_custom_command( + TARGET veal + POST_BUILD + COMMAND "${STRIP_COMMAND}" "$" + VERBATIM + COMMAND_EXPAND_LISTS + ) +endif() IF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD) SET_TARGET_PROPERTIES(veal PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined") ENDIF() diff --git a/plugins/LadspaEffect/caps/CMakeLists.txt b/plugins/LadspaEffect/caps/CMakeLists.txt index 0eff4d5cd..bdcf3a96a 100644 --- a/plugins/LadspaEffect/caps/CMakeLists.txt +++ b/plugins/LadspaEffect/caps/CMakeLists.txt @@ -10,7 +10,13 @@ SET_TARGET_PROPERTIES(caps PROPERTIES PREFIX "") SET_TARGET_PROPERTIES(caps PROPERTIES COMPILE_FLAGS "-O2 -funroll-loops -Wno-write-strings") IF(LMMS_BUILD_WIN32) - ADD_CUSTOM_COMMAND(TARGET caps POST_BUILD COMMAND "${STRIP}" \"$\") + add_custom_command( + TARGET caps + POST_BUILD + COMMAND "${STRIP_COMMAND}" "$" + VERBATIM + COMMAND_EXPAND_LISTS + ) ENDIF(LMMS_BUILD_WIN32) IF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD) SET_TARGET_PROPERTIES(caps PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined") diff --git a/plugins/LadspaEffect/cmt/CMakeLists.txt b/plugins/LadspaEffect/cmt/CMakeLists.txt index 7aae5a683..ded7b8958 100644 --- a/plugins/LadspaEffect/cmt/CMakeLists.txt +++ b/plugins/LadspaEffect/cmt/CMakeLists.txt @@ -7,11 +7,19 @@ INSTALL(TARGETS cmt LIBRARY DESTINATION "${PLUGIN_DIR}/ladspa") SET_TARGET_PROPERTIES(cmt PROPERTIES PREFIX "") SET_TARGET_PROPERTIES(cmt PROPERTIES COMPILE_FLAGS "-Wall -O3 -fno-strict-aliasing") -IF(LMMS_BUILD_WIN32 AND NOT CMAKE_BUILD_TYPE MATCHES "Deb") - ADD_CUSTOM_COMMAND(TARGET cmt POST_BUILD COMMAND "${STRIP}" "$") -ELSE() - SET_TARGET_PROPERTIES(cmt PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -fPIC") -ENDIF() +if(LMMS_BUILD_WIN32) + add_custom_command( + TARGET cmt + POST_BUILD + COMMAND "${STRIP_COMMAND}" "$" + VERBATIM + COMMAND_EXPAND_LISTS + ) +endif() + +if(NOT LMMS_BUILD_WIN32) + set_target_properties(cmt PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS} -fPIC") +endif() IF(NOT LMMS_BUILD_APPLE AND NOT LMMS_BUILD_OPENBSD) SET_TARGET_PROPERTIES(cmt PROPERTIES LINK_FLAGS "${LINK_FLAGS} -shared -Wl,-no-undefined") diff --git a/plugins/LadspaEffect/swh/CMakeLists.txt b/plugins/LadspaEffect/swh/CMakeLists.txt index 131e60373..aec01c22f 100644 --- a/plugins/LadspaEffect/swh/CMakeLists.txt +++ b/plugins/LadspaEffect/swh/CMakeLists.txt @@ -41,6 +41,16 @@ FOREACH(_item ${XML_SOURCES}) TARGET_LINK_LIBRARIES("${_plugin}" m) ENDIF() + if(LMMS_BUILD_WIN32) + add_custom_command( + TARGET "${_plugin}" + POST_BUILD + COMMAND "${STRIP_COMMAND}" "$" + VERBATIM + COMMAND_EXPAND_LISTS + ) + endif(LMMS_BUILD_WIN32) + SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES PREFIX "") SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES COMPILE_FLAGS "${COMPILE_FLAGS}") SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES LINK_FLAGS "${LINK_FLAGS}") diff --git a/plugins/LadspaEffect/tap/CMakeLists.txt b/plugins/LadspaEffect/tap/CMakeLists.txt index e0740bd5e..c8d0a4eb8 100644 --- a/plugins/LadspaEffect/tap/CMakeLists.txt +++ b/plugins/LadspaEffect/tap/CMakeLists.txt @@ -11,10 +11,15 @@ FOREACH(_item ${PLUGIN_SOURCES}) ENDIF() INSTALL(TARGETS "${_plugin}" LIBRARY DESTINATION "${PLUGIN_DIR}/ladspa") SET_TARGET_PROPERTIES("${_plugin}" PROPERTIES PREFIX "") - # Don't strip if "Debug" or "RelWithDebInfo" - IF(LMMS_BUILD_WIN32 AND NOT CMAKE_BUILD_TYPE MATCHES "Deb") - ADD_CUSTOM_COMMAND(TARGET "${_plugin}" POST_BUILD COMMAND "${STRIP}" \"$\") - ENDIF() + if(LMMS_BUILD_WIN32) + add_custom_command( + TARGET "${_plugin}" + POST_BUILD + COMMAND "${STRIP_COMMAND}" "$" + VERBATIM + COMMAND_EXPAND_LISTS + ) + endif() IF(NOT MSVC) TARGET_LINK_LIBRARIES("${_plugin}" m) ENDIF() diff --git a/plugins/VstBase/RemoteVstPlugin/CMakeLists.txt b/plugins/VstBase/RemoteVstPlugin/CMakeLists.txt index 43e67f7de..3356ae596 100644 --- a/plugins/VstBase/RemoteVstPlugin/CMakeLists.txt +++ b/plugins/VstBase/RemoteVstPlugin/CMakeLists.txt @@ -89,9 +89,25 @@ if(IS_MINGW) endif() endif() -IF(STRIP) - ADD_CUSTOM_COMMAND(TARGET ${EXE_NAME} POST_BUILD COMMAND "${STRIP}" "$") -ENDIF() +if(LMMS_BUILD_WIN32) + if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.16") + set(NOOP_COMMAND "${CMAKE_COMMAND}" "-E" "true") + else() + set(NOOP_COMMAND "${CMAKE_COMMAND}" "-E" "echo") + endif() + if(STRIP) + set(STRIP_COMMAND "$,${NOOP_COMMAND},${STRIP}>") + else() + set(STRIP_COMMAND "${NOOP_COMMAND}") + endif() + add_custom_command( + TARGET "${EXE_NAME}" + POST_BUILD + COMMAND "${STRIP_COMMAND}" "$" + VERBATIM + COMMAND_EXPAND_LISTS + ) +endif() if(BITNESS EQUAL 32) INSTALL(TARGETS ${EXE_NAME} RUNTIME DESTINATION "${PLUGIN_DIR}/32") diff --git a/plugins/ZynAddSubFx/CMakeLists.txt b/plugins/ZynAddSubFx/CMakeLists.txt index 0c8fa8681..b184162a3 100644 --- a/plugins/ZynAddSubFx/CMakeLists.txt +++ b/plugins/ZynAddSubFx/CMakeLists.txt @@ -199,6 +199,18 @@ ENDIF(LMMS_BUILD_WIN32) IF(LMMS_BUILD_WIN32) - ADD_CUSTOM_COMMAND(TARGET ZynAddSubFxCore POST_BUILD COMMAND "${STRIP}" \"$\") - ADD_CUSTOM_COMMAND(TARGET RemoteZynAddSubFx POST_BUILD COMMAND "${STRIP}" \"$\") + add_custom_command( + TARGET ZynAddSubFxCore + POST_BUILD + COMMAND "${STRIP_COMMAND}" "$" + VERBATIM + COMMAND_EXPAND_LISTS + ) + add_custom_command( + TARGET RemoteZynAddSubFx + POST_BUILD + COMMAND "${STRIP_COMMAND}" "$" + VERBATIM + COMMAND_EXPAND_LISTS + ) ENDIF(LMMS_BUILD_WIN32) From 0b27497be2ac93551c4e243e43d7f0811ac0b889 Mon Sep 17 00:00:00 2001 From: saker Date: Wed, 14 Sep 2022 17:27:53 +0000 Subject: [PATCH 29/55] clang-tidy: Apply modernize-use-auto everywhere (#6480) Note: clang-tidy was run with `--format-style=file`. --- plugins/Amplifier/AmplifierControlDialog.cpp | 8 +- .../AudioFileProcessor/AudioFileProcessor.cpp | 19 ++- .../BassBooster/BassBoosterControlDialog.cpp | 10 +- plugins/BitInvader/BitInvader.cpp | 8 +- plugins/Bitcrush/BitcrushControlDialog.cpp | 32 ++--- plugins/CarlaBase/Carla.cpp | 32 ++--- .../CrossoverEQ/CrossoverEQControlDialog.cpp | 42 +++--- plugins/Delay/DelayControlsDialog.cpp | 14 +- .../DualFilter/DualFilterControlDialog.cpp | 10 +- .../DynamicsProcessorControlDialog.cpp | 32 ++--- plugins/Eq/EqControlsDialog.cpp | 45 +++--- plugins/Eq/EqParameterWidget.cpp | 4 +- plugins/Flanger/FlangerControlsDialog.cpp | 14 +- plugins/FreeBoy/FreeBoy.cpp | 6 +- plugins/GigPlayer/GigPlayer.cpp | 22 +-- plugins/HydrogenImport/HydrogenImport.cpp | 2 +- plugins/Kicker/Kicker.cpp | 4 +- plugins/LadspaBrowser/LadspaBrowser.cpp | 12 +- plugins/LadspaBrowser/LadspaDescription.cpp | 42 +++--- plugins/LadspaBrowser/LadspaPortDialog.cpp | 6 +- plugins/LadspaEffect/LadspaControlDialog.cpp | 6 +- plugins/LadspaEffect/LadspaEffect.cpp | 2 +- .../LadspaEffect/LadspaSubPluginFeatures.cpp | 30 ++-- plugins/Lb302/Lb302.cpp | 38 ++--- plugins/Lv2Effect/Lv2Effect.cpp | 6 +- plugins/Lv2Instrument/Lv2Instrument.cpp | 7 +- plugins/MidiImport/MidiImport.cpp | 16 +-- plugins/Monstro/Monstro.cpp | 73 +++++----- .../MultitapEchoControlDialog.cpp | 24 ++-- plugins/Nes/Nes.cpp | 21 ++- plugins/OpulenZ/OpulenZ.cpp | 7 +- plugins/Organic/Organic.cpp | 10 +- plugins/Patman/Patman.cpp | 10 +- .../PeakControllerEffectControlDialog.cpp | 6 +- plugins/ReverbSC/ReverbSC.cpp | 10 +- plugins/ReverbSC/ReverbSCControlDialog.cpp | 10 +- plugins/Sf2Player/Sf2Player.cpp | 59 ++++---- plugins/Sfxr/Sfxr.cpp | 24 ++-- plugins/Sid/SidInstrument.cpp | 37 +++-- plugins/SpectrumAnalyzer/SaControlsDialog.cpp | 96 +++++++------ plugins/SpectrumAnalyzer/SaProcessor.cpp | 2 +- .../StereoEnhancerControlDialog.cpp | 4 +- .../StereoMatrixControlDialog.cpp | 9 +- plugins/Stk/Mallets/Mallets.cpp | 12 +- plugins/TripleOscillator/TripleOscillator.cpp | 49 +++---- plugins/Vectorscope/VecControlsDialog.cpp | 16 +-- plugins/Vectorscope/VectorView.cpp | 2 +- plugins/Vestige/Vestige.cpp | 20 +-- plugins/Vibed/Vibed.cpp | 7 +- plugins/Vibed/VibratingString.cpp | 2 +- plugins/VstBase/RemoteVstPlugin.cpp | 18 +-- plugins/VstBase/VstPlugin.cpp | 2 +- plugins/VstEffect/VstEffectControlDialog.cpp | 14 +- plugins/VstEffect/VstEffectControls.cpp | 19 ++- plugins/VstEffect/VstSubPluginFeatures.cpp | 2 +- plugins/Watsyn/Watsyn.cpp | 42 +++--- .../WaveShaper/WaveShaperControlDialog.cpp | 17 ++- plugins/Xpressive/ExprSynth.cpp | 6 +- plugins/Xpressive/Xpressive.cpp | 28 ++-- plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp | 5 +- plugins/ZynAddSubFx/ZynAddSubFx.cpp | 8 +- src/core/AudioEngine.cpp | 14 +- src/core/AutomatableModel.cpp | 2 +- src/core/AutomationClip.cpp | 26 ++-- src/core/Clipboard.cpp | 4 +- src/core/Controller.cpp | 4 +- src/core/DataFile.cpp | 11 +- src/core/Effect.cpp | 2 +- src/core/EffectChain.cpp | 5 +- src/core/EnvelopeAndLfoParameters.cpp | 7 +- src/core/InstrumentFunctions.cpp | 4 +- src/core/LadspaManager.cpp | 7 +- src/core/Mixer.cpp | 10 +- src/core/NotePlayHandle.cpp | 10 +- src/core/ProjectRenderer.cpp | 2 +- src/core/RemotePlugin.cpp | 5 +- src/core/SampleBuffer.cpp | 12 +- src/core/SampleClip.cpp | 6 +- src/core/SampleRecordHandle.cpp | 4 +- src/core/Song.cpp | 6 +- src/core/audio/AudioAlsa.cpp | 6 +- src/core/audio/AudioFileWave.cpp | 4 +- src/core/audio/AudioJack.cpp | 6 +- src/core/audio/AudioOss.cpp | 8 +- src/core/audio/AudioPortAudio.cpp | 6 +- src/core/audio/AudioPulseAudio.cpp | 12 +- src/core/audio/AudioSampleRecorder.cpp | 4 +- src/core/audio/AudioSdl.cpp | 8 +- src/core/lv2/Lv2Evbuf.cpp | 9 +- src/core/lv2/Lv2Proc.cpp | 16 +-- src/core/lv2/Lv2SubPluginFeatures.cpp | 18 +-- src/core/lv2/Lv2UridMap.cpp | 4 +- src/core/main.cpp | 6 +- src/core/midi/MidiAlsaSeq.cpp | 7 +- src/core/midi/MidiJack.cpp | 2 +- src/gui/AudioAlsaSetupWidget.cpp | 4 +- src/gui/AutomatableModelView.cpp | 4 +- src/gui/ControlLayout.cpp | 2 +- src/gui/ControllerRackView.cpp | 6 +- src/gui/ControllerView.cpp | 10 +- src/gui/Controls.cpp | 4 +- src/gui/EffectRackView.cpp | 8 +- src/gui/EffectView.cpp | 3 +- src/gui/FileBrowser.cpp | 70 ++++----- src/gui/GuiApplication.cpp | 6 +- src/gui/LadspaControlView.cpp | 5 +- src/gui/LfoControllerDialog.cpp | 23 ++- src/gui/LinkedModelGroupViews.cpp | 6 +- src/gui/LmmsStyle.cpp | 3 +- src/gui/Lv2ViewBase.cpp | 6 +- src/gui/MainApplication.cpp | 2 +- src/gui/MainWindow.cpp | 135 ++++++------------ src/gui/MicrotunerConfig.cpp | 34 ++--- src/gui/MidiCCRackView.cpp | 10 +- src/gui/MidiSetupWidget.cpp | 2 +- src/gui/MixerLine.cpp | 4 +- src/gui/MixerView.cpp | 12 +- src/gui/PeakControllerDialog.cpp | 2 +- src/gui/PluginBrowser.cpp | 7 +- src/gui/ProjectNotes.cpp | 3 +- src/gui/SampleTrackWindow.cpp | 15 +- src/gui/SideBar.cpp | 2 +- src/gui/StringPairDrag.cpp | 2 +- src/gui/clips/AutomationClipView.cpp | 16 +-- src/gui/clips/ClipView.cpp | 38 +++-- src/gui/clips/MidiClipView.cpp | 6 +- src/gui/clips/PatternClipView.cpp | 4 +- src/gui/clips/SampleClipView.cpp | 6 +- src/gui/editors/AutomationEditor.cpp | 20 ++- src/gui/editors/Editor.cpp | 2 +- src/gui/editors/PatternEditor.cpp | 13 +- src/gui/editors/PianoRoll.cpp | 121 ++++++++-------- src/gui/editors/PositionLine.cpp | 2 +- src/gui/editors/SongEditor.cpp | 21 ++- src/gui/editors/TimeLineWidget.cpp | 8 +- src/gui/editors/TrackContainerView.cpp | 19 +-- src/gui/instrument/EnvelopeAndLfoView.cpp | 11 +- .../instrument/InstrumentFunctionViews.cpp | 17 ++- src/gui/instrument/InstrumentMidiIOView.cpp | 15 +- src/gui/instrument/InstrumentMiscView.cpp | 12 +- src/gui/instrument/InstrumentTrackWindow.cpp | 22 ++- src/gui/instrument/PianoView.cpp | 2 +- src/gui/menus/MidiPortMenu.cpp | 4 +- src/gui/modals/ControllerConnectionDialog.cpp | 24 ++-- src/gui/modals/EffectSelectDialog.cpp | 16 +-- src/gui/modals/FileDialog.cpp | 2 +- src/gui/modals/SetupDialog.cpp | 133 +++++++---------- src/gui/modals/VersionedSaveDialog.cpp | 8 +- src/gui/tracks/AutomationTrackView.cpp | 17 +-- src/gui/tracks/InstrumentTrackView.cpp | 2 +- src/gui/tracks/SampleTrackView.cpp | 6 +- src/gui/tracks/TrackContentWidget.cpp | 2 +- src/gui/tracks/TrackLabelButton.cpp | 3 +- src/gui/tracks/TrackOperationsWidget.cpp | 10 +- src/gui/tracks/TrackView.cpp | 2 +- src/gui/widgets/AutomatableButton.cpp | 2 +- src/gui/widgets/Fader.cpp | 2 +- src/gui/widgets/Graph.cpp | 6 +- src/gui/widgets/Knob.cpp | 6 +- src/gui/widgets/LcdFloatSpinBox.cpp | 6 +- src/gui/widgets/LcdSpinBox.cpp | 2 +- src/gui/widgets/MeterDialog.cpp | 18 ++- src/gui/widgets/TabBar.cpp | 2 +- src/gui/widgets/TabWidget.cpp | 2 +- src/gui/widgets/TextFloat.cpp | 2 +- src/tracks/AutomationTrack.cpp | 2 +- src/tracks/InstrumentTrack.cpp | 10 +- src/tracks/MidiClip.cpp | 4 +- src/tracks/PatternTrack.cpp | 6 +- src/tracks/SampleTrack.cpp | 12 +- 170 files changed, 1112 insertions(+), 1341 deletions(-) mode change 100755 => 100644 plugins/Bitcrush/BitcrushControlDialog.cpp mode change 100755 => 100644 plugins/Delay/DelayControlsDialog.cpp mode change 100755 => 100644 plugins/DualFilter/DualFilterControlDialog.cpp diff --git a/plugins/Amplifier/AmplifierControlDialog.cpp b/plugins/Amplifier/AmplifierControlDialog.cpp index 34114e90b..226130fcd 100644 --- a/plugins/Amplifier/AmplifierControlDialog.cpp +++ b/plugins/Amplifier/AmplifierControlDialog.cpp @@ -43,27 +43,27 @@ AmplifierControlDialog::AmplifierControlDialog( AmplifierControls* controls ) : setPalette( pal ); setFixedSize( 100, 110 ); - Knob * volumeKnob = new Knob( knobBright_26, this); + auto volumeKnob = new Knob(knobBright_26, this); volumeKnob -> move( 16, 10 ); volumeKnob -> setVolumeKnob( true ); volumeKnob->setModel( &controls->m_volumeModel ); volumeKnob->setLabel( tr( "VOL" ) ); volumeKnob->setHintText( tr( "Volume:" ) , "%" ); - Knob * panKnob = new Knob( knobBright_26, this); + auto panKnob = new Knob(knobBright_26, this); panKnob -> move( 57, 10 ); panKnob->setModel( &controls->m_panModel ); panKnob->setLabel( tr( "PAN" ) ); panKnob->setHintText( tr( "Panning:" ) , "" ); - Knob * leftKnob = new Knob( knobBright_26, this); + auto leftKnob = new Knob(knobBright_26, this); leftKnob -> move( 16, 65 ); leftKnob -> setVolumeKnob( true ); leftKnob->setModel( &controls->m_leftModel ); leftKnob->setLabel( tr( "LEFT" ) ); leftKnob->setHintText( tr( "Left gain:" ) , "%" ); - Knob * rightKnob = new Knob( knobBright_26, this); + auto rightKnob = new Knob(knobBright_26, this); rightKnob -> move( 57, 65 ); rightKnob -> setVolumeKnob( true ); rightKnob->setModel( &controls->m_rightModel ); diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.cpp b/plugins/AudioFileProcessor/AudioFileProcessor.cpp index bf43990f7..8126d4c08 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessor.cpp @@ -426,9 +426,9 @@ void AudioFileProcessor::loopPointChanged() void AudioFileProcessor::pointChanged() { - const f_cnt_t f_start = static_cast( m_startPointModel.value() * m_sampleBuffer.frames() ); - const f_cnt_t f_end = static_cast( m_endPointModel.value() * m_sampleBuffer.frames() ); - const f_cnt_t f_loop = static_cast( m_loopPointModel.value() * m_sampleBuffer.frames() ); + const auto f_start = static_cast(m_startPointModel.value() * m_sampleBuffer.frames()); + const auto f_end = static_cast(m_endPointModel.value() * m_sampleBuffer.frames()); + const auto f_loop = static_cast(m_loopPointModel.value() * m_sampleBuffer.frames()); m_nextPlayStartPoint = f_start; m_nextPlayBackwards = false; @@ -479,7 +479,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument, // loop button group - PixmapButton * m_loopOffButton = new PixmapButton( this ); + auto m_loopOffButton = new PixmapButton(this); m_loopOffButton->setCheckable( true ); m_loopOffButton->move( 190, 105 ); m_loopOffButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( @@ -488,8 +488,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument, "loop_off_off" ) ); m_loopOffButton->setToolTip(tr("Disable loop")); - - PixmapButton * m_loopOnButton = new PixmapButton( this ); + auto m_loopOnButton = new PixmapButton(this); m_loopOnButton->setCheckable( true ); m_loopOnButton->move( 190, 124 ); m_loopOnButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( @@ -498,7 +497,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument, "loop_on_off" ) ); m_loopOnButton->setToolTip(tr("Enable loop")); - PixmapButton * m_loopPingPongButton = new PixmapButton( this ); + auto m_loopPingPongButton = new PixmapButton(this); m_loopPingPongButton->setCheckable( true ); m_loopPingPongButton->move( 216, 124 ); m_loopPingPongButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( @@ -645,9 +644,9 @@ void AudioFileProcessorView::paintEvent( QPaintEvent * ) p.drawPixmap( 0, 0, *s_artwork ); - AudioFileProcessor * a = castModel(); + auto a = castModel(); - QString file_name = ""; + QString file_name = ""; int idx = a->m_sampleBuffer.audioFile().length(); p.setFont( pointSize<8>( font() ) ); @@ -702,7 +701,7 @@ void AudioFileProcessorView::openAudioFile() void AudioFileProcessorView::modelChanged() { - AudioFileProcessor * a = castModel(); + auto a = castModel(); connect( &a->m_sampleBuffer, SIGNAL( sampleUpdated() ), this, SLOT( sampleUpdated() ) ); m_ampKnob->setModel( &a->m_ampModel ); diff --git a/plugins/BassBooster/BassBoosterControlDialog.cpp b/plugins/BassBooster/BassBoosterControlDialog.cpp index f1e60c3ff..21aacb0f2 100644 --- a/plugins/BassBooster/BassBoosterControlDialog.cpp +++ b/plugins/BassBooster/BassBoosterControlDialog.cpp @@ -45,22 +45,22 @@ BassBoosterControlDialog::BassBoosterControlDialog( BassBoosterControls* control setPalette( pal ); setFixedSize( 120, 60 ); - QVBoxLayout * tl = new QVBoxLayout( this ); + auto tl = new QVBoxLayout(this); tl->addSpacing( 4 ); - QHBoxLayout * l = new QHBoxLayout; + auto l = new QHBoxLayout; - Knob * freqKnob = new Knob( knobBright_26, this); + auto freqKnob = new Knob(knobBright_26, this); freqKnob->setModel( &controls->m_freqModel ); freqKnob->setLabel( tr( "FREQ" ) ); freqKnob->setHintText( tr( "Frequency:" ) , "Hz" ); - Knob * gainKnob = new Knob( knobBright_26, this ); + auto gainKnob = new Knob(knobBright_26, this); gainKnob->setModel( &controls->m_gainModel ); gainKnob->setLabel( tr( "GAIN" ) ); gainKnob->setHintText( tr( "Gain:" ) , "" ); - Knob * ratioKnob = new Knob( knobBright_26, this ); + auto ratioKnob = new Knob(knobBright_26, this); ratioKnob->setModel( &controls->m_ratioModel ); ratioKnob->setLabel( tr( "RATIO" ) ); ratioKnob->setHintText( tr( "Ratio:" ) , "" ); diff --git a/plugins/BitInvader/BitInvader.cpp b/plugins/BitInvader/BitInvader.cpp index e319a9c24..947c6f5d6 100644 --- a/plugins/BitInvader/BitInvader.cpp +++ b/plugins/BitInvader/BitInvader.cpp @@ -103,10 +103,8 @@ BSynth::~BSynth() sample_t BSynth::nextStringSample( float sample_length ) { - float sample_step = - static_cast( sample_length / ( sample_rate / nph->frequency() ) ); + auto sample_step = static_cast(sample_length / (sample_rate / nph->frequency())); - // check overflow while (sample_realindex >= sample_length) { sample_realindex -= sample_length; @@ -299,7 +297,7 @@ void BitInvader::playNote( NotePlayHandle * _n, const fpp_t frames = _n->framesLeftForCurrentPeriod(); const f_cnt_t offset = _n->noteOffset(); - BSynth * ps = static_cast( _n->m_pluginData ); + auto ps = static_cast(_n->m_pluginData); for( fpp_t frame = offset; frame < frames + offset; ++frame ) { const sample_t cur = ps->nextStringSample( m_graph.length() ); @@ -472,7 +470,7 @@ BitInvaderView::BitInvaderView( Instrument * _instrument, void BitInvaderView::modelChanged() { - BitInvader * b = castModel(); + auto b = castModel(); m_graph->setModel( &b->m_graph ); m_sampleLengthKnob->setModel( &b->m_sampleLength ); diff --git a/plugins/Bitcrush/BitcrushControlDialog.cpp b/plugins/Bitcrush/BitcrushControlDialog.cpp old mode 100755 new mode 100644 index ddf41508a..f3dc85470 --- a/plugins/Bitcrush/BitcrushControlDialog.cpp +++ b/plugins/Bitcrush/BitcrushControlDialog.cpp @@ -46,20 +46,20 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) : setFixedSize( 181, 128 ); // labels - QLabel * inLabel = new QLabel( tr( "IN" ), this ); + auto inLabel = new QLabel(tr("IN"), this); inLabel->move( 24, 15 ); - - QLabel * outLabel = new QLabel( tr( "OUT" ), this ); + + auto outLabel = new QLabel(tr("OUT"), this); outLabel->move( 139, 15 ); // input knobs - Knob * inGain = new Knob( knobBright_26, this ); + auto inGain = new Knob(knobBright_26, this); inGain->move( 16, 32 ); inGain->setModel( & controls->m_inGain ); inGain->setLabel( tr( "GAIN" ) ); inGain->setHintText( tr( "Input gain:" ) , " dBFS" ); - - Knob * inNoise = new Knob( knobBright_26, this ); + + auto inNoise = new Knob(knobBright_26, this); inNoise->move( 14, 76 ); inNoise->setModel( & controls->m_inNoise ); inNoise->setLabel( tr( "NOISE" ) ); @@ -67,13 +67,13 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) : // output knobs - Knob * outGain = new Knob( knobBright_26, this ); + auto outGain = new Knob(knobBright_26, this); outGain->move( 138, 32 ); outGain->setModel( & controls->m_outGain ); outGain->setLabel( tr( "GAIN" ) ); outGain->setHintText( tr( "Output gain:" ) , " dBFS" ); - - Knob * outClip = new Knob( knobBright_26, this ); + + auto outClip = new Knob(knobBright_26, this); outClip->move( 138, 76 ); outClip->setModel( & controls->m_outClip ); outClip->setLabel( tr( "CLIP" ) ); @@ -82,25 +82,25 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) : // leds - LedCheckBox * rateEnabled = new LedCheckBox( "", this, tr( "Rate enabled" ), LedCheckBox::Green ); + auto rateEnabled = new LedCheckBox("", this, tr("Rate enabled"), LedCheckBox::Green); rateEnabled->move( 64, 14 ); rateEnabled->setModel( & controls->m_rateEnabled ); rateEnabled->setToolTip(tr("Enable sample-rate crushing")); - - LedCheckBox * depthEnabled = new LedCheckBox( "", this, tr( "Depth enabled" ), LedCheckBox::Green ); + + auto depthEnabled = new LedCheckBox("", this, tr("Depth enabled"), LedCheckBox::Green); depthEnabled->move( 101, 14 ); depthEnabled->setModel( & controls->m_depthEnabled ); depthEnabled->setToolTip(tr("Enable bit-depth crushing")); // rate crushing knobs - Knob * rate = new Knob( knobBright_26, this ); + auto rate = new Knob(knobBright_26, this); rate->move( 59, 32 ); rate->setModel( & controls->m_rate ); rate->setLabel( tr( "FREQ" ) ); rate->setHintText( tr( "Sample rate:" ) , " Hz" ); - - Knob * stereoDiff = new Knob( knobBright_26, this ); + + auto stereoDiff = new Knob(knobBright_26, this); stereoDiff->move( 72, 76 ); stereoDiff->setModel( & controls->m_stereoDiff ); stereoDiff->setLabel( tr( "STEREO" ) ); @@ -108,7 +108,7 @@ BitcrushControlDialog::BitcrushControlDialog( BitcrushControls * controls ) : // depth crushing knob - Knob * levels = new Knob( knobBright_26, this ); + auto levels = new Knob(knobBright_26, this); levels->move( 92, 32 ); levels->setModel( & controls->m_levels ); levels->setLabel( tr( "QUANT" ) ); diff --git a/plugins/CarlaBase/Carla.cpp b/plugins/CarlaBase/Carla.cpp index 6082f00da..ef14b7aa4 100644 --- a/plugins/CarlaBase/Carla.cpp +++ b/plugins/CarlaBase/Carla.cpp @@ -194,8 +194,8 @@ CarlaInstrument::CarlaInstrument(InstrumentTrack* const instrumentTrack, const D fDescriptor->activate(fHandle); // we need a play-handle which cares for calling play() - InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, instrumentTrack ); - Engine::audioEngine()->addPlayHandle( iph ); + auto iph = new InstrumentPlayHandle(this, instrumentTrack); + Engine::audioEngine()->addPlayHandle( iph ); #if CARLA_VERSION_HEX >= CARLA_MIN_PARAM_VERSION // text filter completion @@ -625,8 +625,8 @@ CarlaInstrumentView::CarlaInstrumentView(CarlaInstrument* const instrument, QWid pal.setBrush(backgroundRole(), instrument->kIsPatchbay ? PLUGIN_NAME::getIconPixmap("artwork-patchbay") : PLUGIN_NAME::getIconPixmap("artwork-rack")); setPalette(pal); - QHBoxLayout* l = new QHBoxLayout(this); - l->setContentsMargins( 20, 180, 10, 10 ); + auto l = new QHBoxLayout(this); + l->setContentsMargins( 20, 180, 10, 10 ); l->setSpacing(3); l->setAlignment(Qt::AlignTop); @@ -750,8 +750,8 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid m_curOutColumn(0), m_curOutRow(0) { - QWidget* centralWidget = new QWidget(this); - QVBoxLayout* verticalLayout = new QVBoxLayout(centralWidget); + auto centralWidget = new QWidget(this); + auto verticalLayout = new QVBoxLayout(centralWidget); // -- Toolbar m_toolBarLayout = new QHBoxLayout(); @@ -794,9 +794,9 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid m_toolBarLayout->addWidget(m_groupFilterCombo); // -- Input params - QFrame* inputFrame = new QFrame(this); - QVBoxLayout* inputLayout = new QVBoxLayout(inputFrame); - QLabel* inputLabel = new QLabel("Input parameters", inputFrame); + auto inputFrame = new QFrame(this); + auto inputLayout = new QVBoxLayout(inputFrame); + auto inputLabel = new QLabel("Input parameters", inputFrame); m_inputScrollArea = new QScrollArea(inputFrame); m_inputScrollAreaWidgetContent = new QWidget(); @@ -820,9 +820,9 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid inputLayout->addWidget(m_inputScrollArea); // -- Output params - QFrame* outputFrame = new QFrame(this); - QVBoxLayout* outputLayout = new QVBoxLayout(outputFrame); - QLabel* outputLabel = new QLabel("Output parameters", outputFrame); + auto outputFrame = new QFrame(this); + auto outputLayout = new QVBoxLayout(outputFrame); + auto outputLabel = new QLabel("Output parameters", outputFrame); m_outputScrollArea = new QScrollArea(outputFrame); m_outputScrollAreaWidgetContent = new QWidget(); @@ -846,7 +846,7 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid outputLayout->addWidget(m_outputScrollArea); // -- QSplitter - QSplitter* splitter = new QSplitter(Qt::Vertical, this); + auto splitter = new QSplitter(Qt::Vertical, this); // -- Add layout and widgets. verticalLayout->addLayout(m_toolBarLayout); @@ -866,8 +866,8 @@ CarlaParamsView::CarlaParamsView(CarlaInstrumentView* const instrumentView, QWid #endif // -- Sub window - CarlaParamsSubWindow* win = new CarlaParamsSubWindow(getGUI()->mainWindow()->workspace()->viewport(), Qt::SubWindow | - Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint); + auto win = new CarlaParamsSubWindow(getGUI()->mainWindow()->workspace()->viewport(), + Qt::SubWindow | Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint); m_carlaInstrumentView->m_paramsSubWindow = getGUI()->mainWindow()->workspace()->addSubWindow(win); m_carlaInstrumentView->m_paramsSubWindow->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); @@ -976,7 +976,7 @@ void CarlaParamsView::filterKnobs() } // Add spacer so all knobs go to top - QSpacerItem* verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); + auto verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); m_inputScrollAreaLayout->addItem(verticalSpacer, m_curRow+1, 0, 1, 1); } diff --git a/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp b/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp index 225068177..ba32e9dfc 100644 --- a/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp +++ b/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp @@ -46,19 +46,19 @@ CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * contro setFixedSize( 167, 178 ); // knobs - Knob * xover12 = new Knob( knobBright_26, this ); + auto xover12 = new Knob(knobBright_26, this); xover12->move( 29, 11 ); xover12->setModel( & controls->m_xover12 ); xover12->setLabel( "1/2" ); xover12->setHintText( tr( "Band 1/2 crossover:" ), " Hz" ); - - Knob * xover23 = new Knob( knobBright_26, this ); + + auto xover23 = new Knob(knobBright_26, this); xover23->move( 69, 11 ); xover23->setModel( & controls->m_xover23 ); xover23->setLabel( "2/3" ); xover23->setHintText( tr( "Band 2/3 crossover:" ), " Hz" ); - - Knob * xover34 = new Knob( knobBright_26, this ); + + auto xover34 = new Knob(knobBright_26, this); xover34->move( 109, 11 ); xover34->setModel( & controls->m_xover34 ); xover34->setLabel( "3/4" ); @@ -69,47 +69,43 @@ CrossoverEQControlDialog::CrossoverEQControlDialog( CrossoverEQControls * contro m_fader_knob = QPixmap( PLUGIN_NAME::getIconPixmap( "fader_knob2" ) ); // faders - Fader * gain1 = new Fader( &controls->m_gain1, tr( "Band 1 gain" ), this, - &m_fader_bg, &m_fader_empty, &m_fader_knob ); + auto gain1 = new Fader(&controls->m_gain1, tr("Band 1 gain"), this, &m_fader_bg, &m_fader_empty, &m_fader_knob); gain1->move( 7, 56 ); gain1->setDisplayConversion( false ); gain1->setHintText( tr( "Band 1 gain:" ), " dBFS" ); - - Fader * gain2 = new Fader( &controls->m_gain2, tr( "Band 2 gain" ), this, - &m_fader_bg, &m_fader_empty, &m_fader_knob ); + + auto gain2 = new Fader(&controls->m_gain2, tr("Band 2 gain"), this, &m_fader_bg, &m_fader_empty, &m_fader_knob); gain2->move( 47, 56 ); gain2->setDisplayConversion( false ); gain2->setHintText( tr( "Band 2 gain:" ), " dBFS" ); - - Fader * gain3 = new Fader( &controls->m_gain3, tr( "Band 3 gain" ), this, - &m_fader_bg, &m_fader_empty, &m_fader_knob ); + + auto gain3 = new Fader(&controls->m_gain3, tr("Band 3 gain"), this, &m_fader_bg, &m_fader_empty, &m_fader_knob); gain3->move( 87, 56 ); gain3->setDisplayConversion( false ); gain3->setHintText( tr( "Band 3 gain:" ), " dBFS" ); - - Fader * gain4 = new Fader( &controls->m_gain4, tr( "Band 4 gain" ), this, - &m_fader_bg, &m_fader_empty, &m_fader_knob ); + + auto gain4 = new Fader(&controls->m_gain4, tr("Band 4 gain"), this, &m_fader_bg, &m_fader_empty, &m_fader_knob); gain4->move( 127, 56 ); gain4->setDisplayConversion( false ); gain4->setHintText( tr( "Band 4 gain:" ), " dBFS" ); // leds - LedCheckBox * mute1 = new LedCheckBox( "", this, tr( "Band 1 mute" ), LedCheckBox::Green ); + auto mute1 = new LedCheckBox("", this, tr("Band 1 mute"), LedCheckBox::Green); mute1->move( 15, 154 ); mute1->setModel( & controls->m_mute1 ); mute1->setToolTip(tr("Mute band 1")); - - LedCheckBox * mute2 = new LedCheckBox( "", this, tr( "Band 2 mute" ), LedCheckBox::Green ); + + auto mute2 = new LedCheckBox("", this, tr("Band 2 mute"), LedCheckBox::Green); mute2->move( 55, 154 ); mute2->setModel( & controls->m_mute2 ); mute2->setToolTip(tr("Mute band 2")); - - LedCheckBox * mute3 = new LedCheckBox( "", this, tr( "Band 3 mute" ), LedCheckBox::Green ); + + auto mute3 = new LedCheckBox("", this, tr("Band 3 mute"), LedCheckBox::Green); mute3->move( 95, 154 ); mute3->setModel( & controls->m_mute3 ); mute3->setToolTip(tr("Mute band 3")); - - LedCheckBox * mute4 = new LedCheckBox( "", this, tr( "Band 4 mute" ), LedCheckBox::Green ); + + auto mute4 = new LedCheckBox("", this, tr("Band 4 mute"), LedCheckBox::Green); mute4->move( 135, 154 ); mute4->setModel( & controls->m_mute4 ); mute4->setToolTip(tr("Mute band 4")); diff --git a/plugins/Delay/DelayControlsDialog.cpp b/plugins/Delay/DelayControlsDialog.cpp old mode 100755 new mode 100644 index 0354667f5..9a9dea0d4 --- a/plugins/Delay/DelayControlsDialog.cpp +++ b/plugins/Delay/DelayControlsDialog.cpp @@ -44,42 +44,42 @@ DelayControlsDialog::DelayControlsDialog( DelayControls *controls ) : setPalette( pal ); setFixedSize( 300, 208 ); - TempoSyncKnob* sampleDelayKnob = new TempoSyncKnob( knobBright_26, this ); + auto sampleDelayKnob = new TempoSyncKnob(knobBright_26, this); sampleDelayKnob->move( 10,14 ); sampleDelayKnob->setVolumeKnob( false ); sampleDelayKnob->setModel( &controls->m_delayTimeModel ); sampleDelayKnob->setLabel( tr( "DELAY" ) ); sampleDelayKnob->setHintText( tr( "Delay time" ) + " ", " s" ); - Knob * feedbackKnob = new Knob( knobBright_26, this ); + auto feedbackKnob = new Knob(knobBright_26, this); feedbackKnob->move( 11, 58 ); feedbackKnob->setVolumeKnob( true) ; feedbackKnob->setModel( &controls->m_feedbackModel); feedbackKnob->setLabel( tr( "FDBK" ) ); feedbackKnob->setHintText( tr ( "Feedback amount" ) + " " , "" ); - TempoSyncKnob * lfoFreqKnob = new TempoSyncKnob( knobBright_26, this ); + auto lfoFreqKnob = new TempoSyncKnob(knobBright_26, this); lfoFreqKnob->move( 11, 119 ); lfoFreqKnob->setVolumeKnob( false ); lfoFreqKnob->setModel( &controls->m_lfoTimeModel ); lfoFreqKnob->setLabel( tr( "RATE" ) ); lfoFreqKnob->setHintText( tr ( "LFO frequency") + " ", " s" ); - TempoSyncKnob * lfoAmtKnob = new TempoSyncKnob( knobBright_26, this ); + auto lfoAmtKnob = new TempoSyncKnob(knobBright_26, this); lfoAmtKnob->move( 11, 159 ); lfoAmtKnob->setVolumeKnob( false ); lfoAmtKnob->setModel( &controls->m_lfoAmountModel ); lfoAmtKnob->setLabel( tr( "AMNT" ) ); lfoAmtKnob->setHintText( tr ( "LFO amount" ) + " " , " s" ); - EqFader * outFader = new EqFader( &controls->m_outGainModel,tr( "Out gain" ), - this, &controls->m_outPeakL, &controls->m_outPeakR ); + auto outFader + = new EqFader(&controls->m_outGainModel, tr("Out gain"), this, &controls->m_outPeakL, &controls->m_outPeakR); outFader->setMaximumHeight( 196 ); outFader->move( 263, 45 ); outFader->setDisplayConversion( false ); outFader->setHintText( tr( "Gain" ), "dBFS" ); - XyPad * pad = new XyPad( this, &controls->m_feedbackModel, &controls->m_delayTimeModel ); + auto pad = new XyPad(this, &controls->m_feedbackModel, &controls->m_delayTimeModel); pad->resize( 200, 200 ); pad->move( 50, 5 ); } diff --git a/plugins/DualFilter/DualFilterControlDialog.cpp b/plugins/DualFilter/DualFilterControlDialog.cpp old mode 100755 new mode 100644 index 0b23f4b8a..81a835901 --- a/plugins/DualFilter/DualFilterControlDialog.cpp +++ b/plugins/DualFilter/DualFilterControlDialog.cpp @@ -64,10 +64,8 @@ DualFilterControlDialog::DualFilterControlDialog( DualFilterControls* controls ) gain1Knob-> setVolumeKnob( true ); gain2Knob-> setVolumeKnob( true ); - LedCheckBox * enabled1Toggle = new LedCheckBox( "", this, - tr( "Filter 1 enabled" ), LedCheckBox::Green ); - LedCheckBox * enabled2Toggle = new LedCheckBox( "", this, - tr( "Filter 2 enabled" ), LedCheckBox::Green ); + auto enabled1Toggle = new LedCheckBox("", this, tr("Filter 1 enabled"), LedCheckBox::Green); + auto enabled2Toggle = new LedCheckBox("", this, tr("Filter 2 enabled"), LedCheckBox::Green); enabled1Toggle -> move( 12, 11 ); enabled1Toggle -> setModel( &controls -> m_enabled1Model ); @@ -76,12 +74,12 @@ DualFilterControlDialog::DualFilterControlDialog( DualFilterControls* controls ) enabled2Toggle -> setModel( &controls -> m_enabled2Model ); enabled2Toggle->setToolTip(tr("Enable/disable filter 2")); - ComboBox * m_filter1ComboBox = new ComboBox( this ); + auto m_filter1ComboBox = new ComboBox(this); m_filter1ComboBox->setGeometry( 19, 70, 137, ComboBox::DEFAULT_HEIGHT ); m_filter1ComboBox->setFont( pointSize<8>( m_filter1ComboBox->font() ) ); m_filter1ComboBox->setModel( &controls->m_filter1Model ); - ComboBox * m_filter2ComboBox = new ComboBox( this ); + auto m_filter2ComboBox = new ComboBox(this); m_filter2ComboBox->setGeometry( 217, 70, 137, ComboBox::DEFAULT_HEIGHT ); m_filter2ComboBox->setFont( pointSize<8>( m_filter2ComboBox->font() ) ); m_filter2ComboBox->setModel( &controls->m_filter2Model ); diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.cpp b/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.cpp index fb0fee445..4d8758e03 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.cpp +++ b/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.cpp @@ -47,7 +47,7 @@ DynProcControlDialog::DynProcControlDialog( setPalette( pal ); setFixedSize( 224, 319 ); - Graph * waveGraph = new Graph( this, Graph::LinearNonCyclicStyle, 204, 205 ); + auto waveGraph = new Graph(this, Graph::LinearNonCyclicStyle, 204, 205); waveGraph -> move( 10, 6 ); waveGraph -> setModel( &_controls -> m_wavegraphModel ); waveGraph -> setAutoFillBackground( true ); @@ -58,7 +58,7 @@ DynProcControlDialog::DynProcControlDialog( waveGraph->setGraphColor( QColor( 85, 204, 145 ) ); waveGraph -> setMaximumSize( 204, 205 ); - Knob * inputKnob = new Knob( knobBright_26, this); + auto inputKnob = new Knob(knobBright_26, this); inputKnob -> setVolumeKnob( true ); inputKnob -> setVolumeRatio( 1.0 ); inputKnob -> move( 26, 223 ); @@ -66,21 +66,21 @@ DynProcControlDialog::DynProcControlDialog( inputKnob->setLabel( tr( "INPUT" ) ); inputKnob->setHintText( tr( "Input gain:" ) , "" ); - Knob * outputKnob = new Knob( knobBright_26, this ); + auto outputKnob = new Knob(knobBright_26, this); outputKnob -> setVolumeKnob( true ); outputKnob -> setVolumeRatio( 1.0 ); outputKnob -> move( 76, 223 ); outputKnob->setModel( &_controls->m_outputModel ); outputKnob->setLabel( tr( "OUTPUT" ) ); outputKnob->setHintText( tr( "Output gain:" ) , "" ); - - Knob * attackKnob = new Knob( knobBright_26, this); + + auto attackKnob = new Knob(knobBright_26, this); attackKnob -> move( 24, 268 ); attackKnob->setModel( &_controls->m_attackModel ); attackKnob->setLabel( tr( "ATTACK" ) ); attackKnob->setHintText( tr( "Peak attack time:" ) , "ms" ); - Knob * releaseKnob = new Knob( knobBright_26, this ); + auto releaseKnob = new Knob(knobBright_26, this); releaseKnob -> move( 74, 268 ); releaseKnob->setModel( &_controls->m_releaseModel ); releaseKnob->setLabel( tr( "RELEASE" ) ); @@ -88,28 +88,28 @@ DynProcControlDialog::DynProcControlDialog( //wavegraph control buttons - PixmapButton * resetButton = new PixmapButton( this, tr("Reset wavegraph") ); + auto resetButton = new PixmapButton(this, tr("Reset wavegraph")); resetButton -> move( 162, 223 ); resetButton -> resize( 13, 48 ); resetButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "reset_active" ) ); resetButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "reset_inactive" ) ); resetButton->setToolTip(tr("Reset wavegraph")); - PixmapButton * smoothButton = new PixmapButton( this, tr("Smooth wavegraph") ); + auto smoothButton = new PixmapButton(this, tr("Smooth wavegraph")); smoothButton -> move( 162, 239 ); smoothButton -> resize( 13, 48 ); smoothButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth_active" ) ); smoothButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth_inactive" ) ); smoothButton->setToolTip(tr("Smooth wavegraph")); - PixmapButton * addOneButton = new PixmapButton( this, tr("Increase wavegraph amplitude by 1 dB") ); + auto addOneButton = new PixmapButton(this, tr("Increase wavegraph amplitude by 1 dB")); addOneButton -> move( 131, 223 ); addOneButton -> resize( 13, 29 ); addOneButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "add1_active" ) ); addOneButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "add1_inactive" ) ); addOneButton->setToolTip(tr("Increase wavegraph amplitude by 1 dB")); - PixmapButton * subOneButton = new PixmapButton( this, tr("Decrease wavegraph amplitude by 1 dB") ); + auto subOneButton = new PixmapButton(this, tr("Decrease wavegraph amplitude by 1 dB")); subOneButton -> move( 131, 239 ); subOneButton -> resize( 13, 29 ); subOneButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sub1_active" ) ); @@ -117,28 +117,28 @@ DynProcControlDialog::DynProcControlDialog( subOneButton->setToolTip(tr("Decrease wavegraph amplitude by 1 dB")); //stereomode switches - PixmapButton * smMaxButton = new PixmapButton( this, tr( "Stereo mode: maximum" ) ); + auto smMaxButton = new PixmapButton(this, tr("Stereo mode: maximum")); smMaxButton -> move( 131, 257 ); smMaxButton -> resize( 78, 17 ); smMaxButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "max_active" ) ); smMaxButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "max_inactive" ) ); smMaxButton->setToolTip(tr("Process based on the maximum of both stereo channels")); - - PixmapButton * smAvgButton = new PixmapButton( this, tr( "Stereo mode: average" ) ); + + auto smAvgButton = new PixmapButton(this, tr("Stereo mode: average")); smAvgButton -> move( 131, 274 ); smAvgButton -> resize( 78, 16 ); smAvgButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "avg_active" ) ); smAvgButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "avg_inactive" ) ); smAvgButton->setToolTip(tr("Process based on the average of both stereo channels")); - PixmapButton * smUnlButton = new PixmapButton( this, tr( "Stereo mode: unlinked" ) ); + auto smUnlButton = new PixmapButton(this, tr("Stereo mode: unlinked")); smUnlButton -> move( 131, 290 ); smUnlButton -> resize( 78, 17 ); smUnlButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "unl_active" ) ); smUnlButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "unl_inactive" ) ); smUnlButton->setToolTip(tr("Process each stereo channel independently")); - - automatableButtonGroup * smGroup = new automatableButtonGroup( this ); + + auto smGroup = new automatableButtonGroup(this); smGroup -> addButton( smMaxButton ); smGroup -> addButton( smAvgButton ); smGroup -> addButton( smUnlButton ); diff --git a/plugins/Eq/EqControlsDialog.cpp b/plugins/Eq/EqControlsDialog.cpp index c044e2b80..6535b61f3 100644 --- a/plugins/Eq/EqControlsDialog.cpp +++ b/plugins/Eq/EqControlsDialog.cpp @@ -52,11 +52,11 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) : setPalette( pal ); setFixedSize( 500, 500 ); - EqSpectrumView * inSpec = new EqSpectrumView( &controls->m_inFftBands, this ); + auto inSpec = new EqSpectrumView(&controls->m_inFftBands, this); inSpec->move( 26, 17 ); inSpec->setColor( QColor( 77, 101, 242, 150 ) ); - EqSpectrumView * outSpec = new EqSpectrumView( &controls->m_outFftBands, this ); + auto outSpec = new EqSpectrumView(&controls->m_outFftBands, this); outSpec->setColor( QColor( 0, 255, 239, 150 ) ); outSpec->move( 26, 17 ); @@ -72,16 +72,18 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) : setBand( 6, &controls->m_highShelfActiveModel, &controls->m_highShelfFreqModel, &controls->m_highShelfResModel, &controls->m_highShelfGainModel, QColor(255 ,255, 255), tr( "High-shelf" ), &controls->m_highShelfPeakL, &controls->m_highShelfPeakR,0,0,0,0,0,0 ); setBand( 7, &controls->m_lpActiveModel, &controls->m_lpFreqModel, &controls->m_lpResModel, 0, QColor(255 ,255, 255), tr( "LP" ) ,0,0,0,0,0, &controls->m_lp12Model, &controls->m_lp24Model, &controls->m_lp48Model); - QPixmap * faderBg = new QPixmap( PLUGIN_NAME::getIconPixmap( "faderback" ) ); - QPixmap * faderLeds = new QPixmap( PLUGIN_NAME::getIconPixmap( "faderleds" ) ); - QPixmap * faderKnob = new QPixmap( PLUGIN_NAME::getIconPixmap( "faderknob" ) ); + auto faderBg = new QPixmap(PLUGIN_NAME::getIconPixmap("faderback")); + auto faderLeds = new QPixmap(PLUGIN_NAME::getIconPixmap("faderleds")); + auto faderKnob = new QPixmap(PLUGIN_NAME::getIconPixmap("faderknob")); - EqFader * GainFaderIn = new EqFader( &controls->m_inGainModel, tr( "Input gain" ), this, faderBg, faderLeds, faderKnob, &controls->m_inPeakL, &controls->m_inPeakR ); + auto GainFaderIn = new EqFader(&controls->m_inGainModel, tr("Input gain"), this, faderBg, faderLeds, faderKnob, + &controls->m_inPeakL, &controls->m_inPeakR); GainFaderIn->move( 23, 295 ); GainFaderIn->setDisplayConversion( false ); GainFaderIn->setHintText( tr( "Gain" ), "dBv"); - EqFader * GainFaderOut = new EqFader( &controls->m_outGainModel, tr( "Output gain" ), this, faderBg, faderLeds, faderKnob, &controls->m_outPeakL, &controls->m_outPeakR ); + auto GainFaderOut = new EqFader(&controls->m_outGainModel, tr("Output gain"), this, faderBg, faderLeds, faderKnob, + &controls->m_outPeakL, &controls->m_outPeakR); GainFaderOut->move( 453, 295); GainFaderOut->setDisplayConversion( false ); GainFaderOut->setHintText( tr( "Gain" ), "dBv" ); @@ -90,7 +92,8 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) : int distance = 126; for( int i = 1; i < m_parameterWidget->bandCount() - 1; i++ ) { - EqFader * gainFader = new EqFader( m_parameterWidget->getBandModels( i )->gain, tr( "" ), this, faderBg, faderLeds, faderKnob, m_parameterWidget->getBandModels( i )->peakL, m_parameterWidget->getBandModels( i )->peakR ); + auto gainFader = new EqFader(m_parameterWidget->getBandModels(i)->gain, tr(""), this, faderBg, faderLeds, + faderKnob, m_parameterWidget->getBandModels(i)->peakL, m_parameterWidget->getBandModels(i)->peakR); gainFader->move( distance, 295 ); distance += 44; gainFader->setMinimumHeight(80); @@ -103,21 +106,21 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) : distance = 81; for( int i = 0; i < m_parameterWidget->bandCount() ; i++ ) { - Knob * resKnob = new Knob( knobBright_26, this ); + auto resKnob = new Knob(knobBright_26, this); resKnob->move( distance, 440 ); resKnob->setVolumeKnob(false); resKnob->setModel( m_parameterWidget->getBandModels( i )->res ); if(i > 1 && i < 6) { resKnob->setHintText( tr( "Bandwidth: " ) , tr( " Octave" ) ); } else { resKnob->setHintText( tr( "Resonance : " ) , "" ); } - Knob * freqKnob = new Knob( knobBright_26, this ); + auto freqKnob = new Knob(knobBright_26, this); freqKnob->move( distance, 396 ); freqKnob->setVolumeKnob( false ); freqKnob->setModel( m_parameterWidget->getBandModels( i )->freq ); freqKnob->setHintText( tr( "Frequency:" ), "Hz" ); // adds the Number Active buttons - PixmapButton * activeButton = new PixmapButton( this, nullptr ); + auto activeButton = new PixmapButton(this, nullptr); activeButton->setCheckable(true); activeButton->setModel( m_parameterWidget->getBandModels( i )->active ); @@ -140,48 +143,48 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) : // adds the buttons for Spectrum analyser on/off - LedCheckBox * inSpecButton = new LedCheckBox( this ); + auto inSpecButton = new LedCheckBox(this); inSpecButton->setCheckable(true); inSpecButton->setModel( &controls->m_analyseInModel ); inSpecButton->move( 172, 240 ); - LedCheckBox * outSpecButton = new LedCheckBox( this ); + auto outSpecButton = new LedCheckBox(this); outSpecButton->setCheckable(true); outSpecButton->setModel( &controls->m_analyseOutModel ); outSpecButton->move( 302, 240 ); //hp filter type - PixmapButton * hp12Button = new PixmapButton( this , nullptr ); + auto hp12Button = new PixmapButton(this, nullptr); hp12Button->setModel( m_parameterWidget->getBandModels( 0 )->hp12 ); hp12Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "12dB" ) ); hp12Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "12dBoff" ) ); hp12Button->move( 79, 298 ); - PixmapButton * hp24Button = new PixmapButton( this , nullptr ); + auto hp24Button = new PixmapButton(this, nullptr); hp24Button->setModel(m_parameterWidget->getBandModels( 0 )->hp24 ); hp24Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "24dB" ) ); hp24Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "24dBoff" ) ); hp24Button->move( 79 , 328 ); - PixmapButton * hp48Button = new PixmapButton( this , nullptr ); + auto hp48Button = new PixmapButton(this, nullptr); hp48Button->setModel( m_parameterWidget->getBandModels(0)->hp48 ); hp48Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "48dB" ) ); hp48Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "48dBoff" ) ); hp48Button->move( 79, 358 ); //LP filter type - PixmapButton * lp12Button = new PixmapButton( this , nullptr ); + auto lp12Button = new PixmapButton(this, nullptr); lp12Button->setModel( m_parameterWidget->getBandModels( 7 )->lp12 ); lp12Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "12dB" ) ); lp12Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "12dBoff" ) ); lp12Button->move( 387, 298 ); - PixmapButton * lp24Button = new PixmapButton( this , nullptr ); + auto lp24Button = new PixmapButton(this, nullptr); lp24Button->setModel( m_parameterWidget->getBandModels( 7 )->lp24 ); lp24Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "24dB" ) ); lp24Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "24dBoff" ) ); lp24Button->move( 387, 328 ); - PixmapButton * lp48Button = new PixmapButton( this , nullptr ); + auto lp48Button = new PixmapButton(this, nullptr); lp48Button->setModel( m_parameterWidget->getBandModels( 7 )->lp48 ); lp48Button->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "48dB" ) ); lp48Button->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "48dBoff" ) ); @@ -196,13 +199,13 @@ EqControlsDialog::EqControlsDialog( EqControls *controls ) : QObject::connect( m_parameterWidget->getBandModels( 7 )->lp24 , SIGNAL ( dataChanged() ), m_parameterWidget, SLOT( updateHandle())); QObject::connect( m_parameterWidget->getBandModels( 7 )->lp48 , SIGNAL ( dataChanged() ), m_parameterWidget, SLOT( updateHandle())); - automatableButtonGroup *lpBtnGrp = new automatableButtonGroup( this, tr( "LP group" ) ); + auto lpBtnGrp = new automatableButtonGroup(this, tr("LP group")); lpBtnGrp->addButton( lp12Button ); lpBtnGrp->addButton( lp24Button ); lpBtnGrp->addButton( lp48Button ); lpBtnGrp->setModel(&m_controls->m_lpTypeModel); - automatableButtonGroup *hpBtnGrp = new automatableButtonGroup( this, tr( "HP group" ) ); + auto hpBtnGrp = new automatableButtonGroup(this, tr("HP group")); hpBtnGrp->addButton( hp12Button ); hpBtnGrp->addButton( hp24Button ); hpBtnGrp->addButton( hp48Button ); diff --git a/plugins/Eq/EqParameterWidget.cpp b/plugins/Eq/EqParameterWidget.cpp index 393421291..fb60322a1 100644 --- a/plugins/Eq/EqParameterWidget.cpp +++ b/plugins/Eq/EqParameterWidget.cpp @@ -56,9 +56,9 @@ EqParameterWidget::EqParameterWidget( QWidget *parent, EqControls * controls ) : m_pixelsPerOctave = EqHandle::freqToXPixel( 10000, m_displayWidth ) - EqHandle::freqToXPixel( 5000, m_displayWidth ); //GraphicsScene and GraphicsView stuff - QGraphicsScene *scene = new QGraphicsScene(); + auto scene = new QGraphicsScene(); scene->setSceneRect( 0, 0, m_displayWidth, m_displayHeigth ); - QGraphicsView *view = new QGraphicsView( this ); + auto view = new QGraphicsView(this); view->setStyleSheet( "border-style: none; background: transparent;" ); view->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); view->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); diff --git a/plugins/Flanger/FlangerControlsDialog.cpp b/plugins/Flanger/FlangerControlsDialog.cpp index 5edab2894..f35aabfd4 100644 --- a/plugins/Flanger/FlangerControlsDialog.cpp +++ b/plugins/Flanger/FlangerControlsDialog.cpp @@ -42,49 +42,49 @@ FlangerControlsDialog::FlangerControlsDialog( FlangerControls *controls ) : setPalette( pal ); setFixedSize( 233, 75 ); - Knob* delayKnob = new Knob( knobBright_26, this ); + auto delayKnob = new Knob(knobBright_26, this); delayKnob->move( 10,10 ); delayKnob->setVolumeKnob( false ); delayKnob->setModel( &controls->m_delayTimeModel ); delayKnob->setLabel( tr( "DELAY" ) ); delayKnob->setHintText( tr( "Delay time:" ) + " ", "s" ); - TempoSyncKnob * lfoFreqKnob = new TempoSyncKnob( knobBright_26, this ); + auto lfoFreqKnob = new TempoSyncKnob(knobBright_26, this); lfoFreqKnob->move( 48,10 ); lfoFreqKnob->setVolumeKnob( false ); lfoFreqKnob->setModel( &controls->m_lfoFrequencyModel ); lfoFreqKnob->setLabel( tr( "RATE" ) ); lfoFreqKnob->setHintText( tr( "Period:" ) , " Sec" ); - Knob * lfoAmtKnob = new Knob( knobBright_26, this ); + auto lfoAmtKnob = new Knob(knobBright_26, this); lfoAmtKnob->move( 85,10 ); lfoAmtKnob->setVolumeKnob( false ); lfoAmtKnob->setModel( &controls->m_lfoAmountModel ); lfoAmtKnob->setLabel( tr( "AMNT" ) ); lfoAmtKnob->setHintText( tr( "Amount:" ) , "" ); - Knob * lfoPhaseKnob = new Knob( knobBright_26, this ); + auto lfoPhaseKnob = new Knob(knobBright_26, this); lfoPhaseKnob->move( 123,10 ); lfoPhaseKnob->setVolumeKnob( false ); lfoPhaseKnob->setModel( &controls->m_lfoPhaseModel ); lfoPhaseKnob->setLabel( tr( "PHASE" ) ); lfoPhaseKnob->setHintText( tr( "Phase:" ) , " degrees" ); - Knob * feedbackKnob = new Knob( knobBright_26, this ); + auto feedbackKnob = new Knob(knobBright_26, this); feedbackKnob->move( 160,10 ); feedbackKnob->setVolumeKnob( true) ; feedbackKnob->setModel( &controls->m_feedbackModel ); feedbackKnob->setLabel( tr( "FDBK" ) ); feedbackKnob->setHintText( tr( "Feedback amount:" ) , "" ); - Knob * whiteNoiseKnob = new Knob( knobBright_26, this ); + auto whiteNoiseKnob = new Knob(knobBright_26, this); whiteNoiseKnob->move( 196,10 ); whiteNoiseKnob->setVolumeKnob( true) ; whiteNoiseKnob->setModel( &controls->m_whiteNoiseAmountModel ); whiteNoiseKnob->setLabel( tr( "NOISE" ) ); whiteNoiseKnob->setHintText( tr( "White noise amount:" ) , "" ); - LedCheckBox * invertCb = new LedCheckBox( tr( "Invert" ), this ); + auto invertCb = new LedCheckBox(tr("Invert"), this); invertCb->move( 10,53 ); diff --git a/plugins/FreeBoy/FreeBoy.cpp b/plugins/FreeBoy/FreeBoy.cpp index 3829d691a..e5ded87ee 100644 --- a/plugins/FreeBoy/FreeBoy.cpp +++ b/plugins/FreeBoy/FreeBoy.cpp @@ -251,7 +251,7 @@ void FreeBoyInstrument::playNote( NotePlayHandle * _n, if ( tfp == 0 ) { - Gb_Apu_Buffer *papu = new Gb_Apu_Buffer(); + auto papu = new Gb_Apu_Buffer(); papu->set_sample_rate( samplerate, CLOCK_RATE ); // Master sound circuitry power control @@ -282,7 +282,7 @@ void FreeBoyInstrument::playNote( NotePlayHandle * _n, _n->m_pluginData = papu; } - Gb_Apu_Buffer *papu = static_cast( _n->m_pluginData ); + auto papu = static_cast(_n->m_pluginData); papu->treble_eq( m_trebleModel.value() ); papu->bass_freq( m_bassModel.value() ); @@ -681,7 +681,7 @@ FreeBoyInstrumentView::FreeBoyInstrumentView( Instrument * _instrument, void FreeBoyInstrumentView::modelChanged() { - FreeBoyInstrument * p = castModel(); + auto p = castModel(); m_ch1SweepTimeKnob->setModel( &p->m_ch1SweepTimeModel ); m_ch1SweepDirButton->setModel( &p->m_ch1SweepDirModel ); diff --git a/plugins/GigPlayer/GigPlayer.cpp b/plugins/GigPlayer/GigPlayer.cpp index 5a6f39cc6..6940be9e6 100644 --- a/plugins/GigPlayer/GigPlayer.cpp +++ b/plugins/GigPlayer/GigPlayer.cpp @@ -92,7 +92,7 @@ GigInstrument::GigInstrument( InstrumentTrack * _instrument_track ) : m_RandomSeed( 0 ), m_currentKeyDimension( 0 ) { - InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track ); + auto iph = new InstrumentPlayHandle(this, _instrument_track); Engine::audioEngine()->addPlayHandle( iph ); updateSampleRate(); @@ -305,7 +305,7 @@ void GigInstrument::playNote( NotePlayHandle * _n, sampleFrame * ) if( tfp == 0 ) { - GIGPluginData * pluginData = new GIGPluginData; + auto pluginData = new GIGPluginData; pluginData->midiNote = midiNote; _n->m_pluginData = pluginData; @@ -593,7 +593,7 @@ void GigInstrument::loadSample( GigSample& sample, sampleFrame* sampleData, f_cn // Convert from 16 or 24 bit into 32-bit float if( sample.sample->BitDepth == 24 ) // 24 bit { - uint8_t * pInt = reinterpret_cast( &buffer ); + auto pInt = reinterpret_cast(&buffer); for( f_cnt_t i = 0; i < samples; ++i ) { @@ -625,7 +625,7 @@ void GigInstrument::loadSample( GigSample& sample, sampleFrame* sampleData, f_cn } else // 16 bit { - int16_t * pInt = reinterpret_cast( &buffer ); + auto pInt = reinterpret_cast(&buffer); for( f_cnt_t i = 0; i < samples; ++i ) { @@ -684,7 +684,7 @@ f_cnt_t GigInstrument::getPingPongIndex( f_cnt_t index, f_cnt_t startf, f_cnt_t // A key has been released void GigInstrument::deleteNotePluginData( NotePlayHandle * _n ) { - GIGPluginData * pluginData = static_cast( _n->m_pluginData ); + auto pluginData = static_cast(_n->m_pluginData); QMutexLocker locker( &m_notesMutex ); // Mark the note as being released, but only if it was playing or was just @@ -931,7 +931,7 @@ public: GigInstrumentView::GigInstrumentView( Instrument * _instrument, QWidget * _parent ) : InstrumentViewFixedSize( _instrument, _parent ) { - GigInstrument * k = castModel(); + auto k = castModel(); connect( &k->m_bankNum, SIGNAL( dataChanged() ), this, SLOT( updatePatchName() ) ); connect( &k->m_patchNum, SIGNAL( dataChanged() ), this, SLOT( updatePatchName() ) ); @@ -990,7 +990,7 @@ GigInstrumentView::GigInstrumentView( Instrument * _instrument, QWidget * _paren void GigInstrumentView::modelChanged() { - GigInstrument * k = castModel(); + auto k = castModel(); m_bankNumLcd->setModel( &k->m_bankNum ); m_patchNumLcd->setModel( &k->m_patchNum ); @@ -1007,7 +1007,7 @@ void GigInstrumentView::modelChanged() void GigInstrumentView::updateFilename() { - GigInstrument * i = castModel(); + auto i = castModel(); QFontMetrics fm( m_filenameLabel->font() ); QString file = i->m_filename.endsWith( ".gig", Qt::CaseInsensitive ) ? i->m_filename.left( i->m_filename.length() - 4 ) : @@ -1025,7 +1025,7 @@ void GigInstrumentView::updateFilename() void GigInstrumentView::updatePatchName() { - GigInstrument * i = castModel(); + auto i = castModel(); QFontMetrics fm( font() ); QString patch = i->getCurrentPatchName(); m_patchLabel->setText( fm.elidedText( patch, Qt::ElideLeft, m_patchLabel->width() ) ); @@ -1046,7 +1046,7 @@ void GigInstrumentView::invalidateFile() void GigInstrumentView::showFileDialog() { - GigInstrument * k = castModel(); + auto k = castModel(); FileDialog ofd( nullptr, tr( "Open GIG file" ) ); ofd.setFileMode( FileDialog::ExistingFiles ); @@ -1087,7 +1087,7 @@ void GigInstrumentView::showFileDialog() void GigInstrumentView::showPatchDialog() { - GigInstrument * k = castModel(); + auto k = castModel(); PatchesDialog pd( this ); pd.setup( k->m_instance, 1, k->instrumentTrack()->name(), &k->m_bankNum, &k->m_patchNum, m_patchLabel ); pd.exec(); diff --git a/plugins/HydrogenImport/HydrogenImport.cpp b/plugins/HydrogenImport/HydrogenImport.cpp index 2f3a27e1f..d8f76071a 100644 --- a/plugins/HydrogenImport/HydrogenImport.cpp +++ b/plugins/HydrogenImport/HydrogenImport.cpp @@ -276,7 +276,7 @@ bool HydrogenImport::readSong() QString instrId = LocalFileMng::readXmlString( noteNode, "instrument", 0,false, false ); int i = pattern_count - 1 + existing_patterns; pattern_id[sName] = pattern_count - 1; - MidiClip*p = dynamic_cast( drum_track[instrId]->getClip( i ) ); + auto p = dynamic_cast(drum_track[instrId]->getClip(i)); Note n; n.setPos( nPosition ); if ( (nPosition + 48) <= nSize ) diff --git a/plugins/Kicker/Kicker.cpp b/plugins/Kicker/Kicker.cpp index 3f9aa2474..7d4c6fbb0 100644 --- a/plugins/Kicker/Kicker.cpp +++ b/plugins/Kicker/Kicker.cpp @@ -185,7 +185,7 @@ void KickerInstrument::playNote( NotePlayHandle * _n, _n->noteOff(); } - SweepOsc * so = static_cast( _n->m_pluginData ); + auto so = static_cast(_n->m_pluginData); so->update( _working_buffer + offset, frames, Engine::audioEngine()->processingSampleRate() ); if( _n->isReleased() ) @@ -334,7 +334,7 @@ KickerInstrumentView::KickerInstrumentView( Instrument * _instrument, void KickerInstrumentView::modelChanged() { - KickerInstrument * k = castModel(); + auto k = castModel(); m_startFreqKnob->setModel( &k->m_startFreqModel ); m_endFreqKnob->setModel( &k->m_endFreqModel ); m_decayKnob->setModel( &k->m_decayModel ); diff --git a/plugins/LadspaBrowser/LadspaBrowser.cpp b/plugins/LadspaBrowser/LadspaBrowser.cpp index 503aa7443..714b3887c 100644 --- a/plugins/LadspaBrowser/LadspaBrowser.cpp +++ b/plugins/LadspaBrowser/LadspaBrowser.cpp @@ -96,7 +96,7 @@ namespace gui LadspaBrowserView::LadspaBrowserView( ToolPlugin * _tool ) : ToolPluginView( _tool ) { - QHBoxLayout * hlayout = new QHBoxLayout( this ); + auto hlayout = new QHBoxLayout(this); hlayout->setSpacing( 0 ); hlayout->setMargin( 0 ); @@ -104,7 +104,7 @@ LadspaBrowserView::LadspaBrowserView( ToolPlugin * _tool ) : m_tabBar->setExclusive( true ); m_tabBar->setFixedWidth( 72 ); - QWidget * ws = new QWidget( this ); + auto ws = new QWidget(this); ws->setFixedSize( 500, 480 ); QWidget * available = createTab( ws, tr( "Available Effects" ), VALID ); @@ -162,14 +162,14 @@ LadspaBrowserView::LadspaBrowserView( ToolPlugin * _tool ) : QWidget * LadspaBrowserView::createTab( QWidget * _parent, const QString & _txt, LadspaPluginType _type ) { - QWidget * tab = new QWidget( _parent ); + auto tab = new QWidget(_parent); tab->setFixedSize( 500, 400 ); - QVBoxLayout * layout = new QVBoxLayout( tab ); + auto layout = new QVBoxLayout(tab); layout->setSpacing( 0 ); layout->setMargin( 0 ); const QString type = "" + tr( "Type:" ) + " "; - QLabel * title = new QLabel( type + _txt, tab ); + auto title = new QLabel(type + _txt, tab); QFont f = title->font(); f.setBold( true ); title->setFont( pointSize<12>( f ) ); @@ -178,7 +178,7 @@ QWidget * LadspaBrowserView::createTab( QWidget * _parent, const QString & _txt, layout->addWidget( title ); layout->addSpacing( 10 ); - LadspaDescription * description = new LadspaDescription( tab, _type ); + auto description = new LadspaDescription(tab, _type); connect( description, SIGNAL( doubleClicked( const ::lmms::ladspa_key_t & ) ), SLOT( showPorts( const ::lmms::ladspa_key_t & ) ) ); layout->addWidget( description, 1 ); diff --git a/plugins/LadspaBrowser/LadspaDescription.cpp b/plugins/LadspaBrowser/LadspaDescription.cpp index b94490e52..e1c208fad 100644 --- a/plugins/LadspaBrowser/LadspaDescription.cpp +++ b/plugins/LadspaBrowser/LadspaDescription.cpp @@ -84,8 +84,8 @@ LadspaDescription::LadspaDescription( QWidget * _parent, } } - QGroupBox * pluginsBox = new QGroupBox( tr( "Plugins" ), this ); - QListWidget * pluginList = new QListWidget( pluginsBox ); + auto pluginsBox = new QGroupBox(tr("Plugins"), this); + auto pluginList = new QListWidget(pluginsBox); pluginList->addItems( pluginNames ); connect( pluginList, SIGNAL( currentRowChanged( int ) ), SLOT( rowChanged( int ) ) ); @@ -93,15 +93,15 @@ LadspaDescription::LadspaDescription( QWidget * _parent, SLOT( onDoubleClicked( QListWidgetItem * ) ) ); ( new QVBoxLayout( pluginsBox ) )->addWidget( pluginList ); - QGroupBox * descriptionBox = new QGroupBox( tr( "Description" ), this ); - QVBoxLayout * descriptionLayout = new QVBoxLayout( descriptionBox ); + auto descriptionBox = new QGroupBox(tr("Description"), this); + auto descriptionLayout = new QVBoxLayout(descriptionBox); descriptionLayout->setSpacing( 0 ); descriptionLayout->setMargin( 0 ); m_scrollArea = new QScrollArea( descriptionBox ); descriptionLayout->addWidget( m_scrollArea ); - QVBoxLayout * layout = new QVBoxLayout( this ); + auto layout = new QVBoxLayout(this); layout->addWidget( pluginsBox ); layout->addWidget( descriptionBox ); @@ -118,76 +118,76 @@ LadspaDescription::LadspaDescription( QWidget * _parent, void LadspaDescription::update( const ladspa_key_t & _key ) { - QWidget * description = new QWidget; + auto description = new QWidget; m_scrollArea->setWidget( description ); - QVBoxLayout * layout = new QVBoxLayout( description ); + auto layout = new QVBoxLayout(description); layout->setSizeConstraint( QLayout::SetFixedSize ); Ladspa2LMMS * manager = Engine::getLADSPAManager(); - QLabel * name = new QLabel( description ); + auto name = new QLabel(description); name->setText( QWidget::tr( "Name: " ) + manager->getName( _key ) ); layout->addWidget( name ); - QWidget * maker = new QWidget( description ); - QHBoxLayout * makerLayout = new QHBoxLayout( maker ); + auto maker = new QWidget(description); + auto makerLayout = new QHBoxLayout(maker); makerLayout->setMargin( 0 ); makerLayout->setSpacing( 0 ); layout->addWidget( maker ); - QLabel * maker_label = new QLabel( maker ); + auto maker_label = new QLabel(maker); maker_label->setText( QWidget::tr( "Maker: " ) ); maker_label->setAlignment( Qt::AlignTop ); - QLabel * maker_content = new QLabel( maker ); + auto maker_content = new QLabel(maker); maker_content->setText( manager->getMaker( _key ) ); maker_content->setWordWrap( true ); makerLayout->addWidget( maker_label ); makerLayout->addWidget( maker_content, 1 ); - QWidget * copyright = new QWidget( description ); - QHBoxLayout * copyrightLayout = new QHBoxLayout( copyright ); + auto copyright = new QWidget(description); + auto copyrightLayout = new QHBoxLayout(copyright); copyrightLayout->setMargin( 0 ); copyrightLayout->setSpacing( 0 ); layout->addWidget( copyright ); - QLabel * copyright_label = new QLabel( copyright ); + auto copyright_label = new QLabel(copyright); copyright_label->setText( QWidget::tr( "Copyright: " ) ); copyright_label->setAlignment( Qt::AlignTop ); - QLabel * copyright_content = new QLabel( copyright ); + auto copyright_content = new QLabel(copyright); copyright_content->setText( manager->getCopyright( _key ) ); copyright_content->setWordWrap( true ); copyrightLayout->addWidget( copyright_label ); copyrightLayout->addWidget( copyright_content, 1 ); - QLabel * requiresRealTime = new QLabel( description ); + auto requiresRealTime = new QLabel(description); requiresRealTime->setText( QWidget::tr( "Requires Real Time: " ) + ( manager->hasRealTimeDependency( _key ) ? QWidget::tr( "Yes" ) : QWidget::tr( "No" ) ) ); layout->addWidget( requiresRealTime ); - QLabel * realTimeCapable = new QLabel( description ); + auto realTimeCapable = new QLabel(description); realTimeCapable->setText( QWidget::tr( "Real Time Capable: " ) + ( manager->isRealTimeCapable( _key ) ? QWidget::tr( "Yes" ) : QWidget::tr( "No" ) ) ); layout->addWidget( realTimeCapable ); - QLabel * inplaceBroken = new QLabel( description ); + auto inplaceBroken = new QLabel(description); inplaceBroken->setText( QWidget::tr( "In Place Broken: " ) + ( manager->isInplaceBroken( _key ) ? QWidget::tr( "Yes" ) : QWidget::tr( "No" ) ) ); layout->addWidget( inplaceBroken ); - QLabel * channelsIn = new QLabel( description ); + auto channelsIn = new QLabel(description); channelsIn->setText( QWidget::tr( "Channels In: " ) + QString::number( manager->getDescription( _key )->inputChannels ) ); layout->addWidget( channelsIn ); - QLabel * channelsOut = new QLabel( description ); + auto channelsOut = new QLabel(description); channelsOut->setText( QWidget::tr( "Channels Out: " ) + QString::number( manager->getDescription( _key )->outputChannels ) ); layout->addWidget( channelsOut ); diff --git a/plugins/LadspaBrowser/LadspaPortDialog.cpp b/plugins/LadspaBrowser/LadspaPortDialog.cpp index 12706ca89..3c0dbabd5 100644 --- a/plugins/LadspaBrowser/LadspaPortDialog.cpp +++ b/plugins/LadspaBrowser/LadspaPortDialog.cpp @@ -45,13 +45,13 @@ LadspaPortDialog::LadspaPortDialog( const ladspa_key_t & _key ) setWindowTitle( tr( "Ports" ) ); setModal( true ); - QVBoxLayout * vlayout = new QVBoxLayout( this ); + auto vlayout = new QVBoxLayout(this); vlayout->setSpacing( 0 ); vlayout->setMargin( 0 ); int pc = manager->getPortCount( _key ); - QTableWidget * settings = new QTableWidget( pc, 7, this ); + auto settings = new QTableWidget(pc, 7, this); QStringList ports; ports.append( tr( "Name" ) ); @@ -67,7 +67,7 @@ LadspaPortDialog::LadspaPortDialog( const ladspa_key_t & _key ) { for( int col = 0; col < 7; ++col ) { - QTableWidgetItem * item = new QTableWidgetItem; + auto item = new QTableWidgetItem; item->setFlags(QFlag(0)); settings->setItem( row, col, item ); } diff --git a/plugins/LadspaEffect/LadspaControlDialog.cpp b/plugins/LadspaEffect/LadspaControlDialog.cpp index 5774fcc11..0afc06355 100644 --- a/plugins/LadspaEffect/LadspaControlDialog.cpp +++ b/plugins/LadspaEffect/LadspaControlDialog.cpp @@ -46,7 +46,7 @@ LadspaControlDialog::LadspaControlDialog( LadspaControls * _ctl ) : m_effectLayout( nullptr ), m_stereoLink( nullptr ) { - QVBoxLayout * mainLay = new QVBoxLayout( this ); + auto mainLay = new QVBoxLayout(this); m_effectLayout = new QHBoxLayout(); mainLay->addLayout( m_effectLayout ); @@ -56,7 +56,7 @@ LadspaControlDialog::LadspaControlDialog( LadspaControls * _ctl ) : if( _ctl->m_processors > 1 ) { mainLay->addSpacing( 3 ); - QHBoxLayout * center = new QHBoxLayout(); + auto center = new QHBoxLayout(); mainLay->addLayout( center ); m_stereoLink = new LedCheckBox( tr( "Link Channels" ), this ); m_stereoLink->setModel( &_ctl->m_stereoLinkModel ); @@ -101,7 +101,7 @@ void LadspaControlDialog::updateEffectView( LadspaControls * _ctl ) grouper = new QGroupBox( this ); } - QGridLayout * gl = new QGridLayout( grouper ); + auto gl = new QGridLayout(grouper); grouper->setLayout( gl ); grouper->setAlignment( Qt::Vertical ); diff --git a/plugins/LadspaEffect/LadspaEffect.cpp b/plugins/LadspaEffect/LadspaEffect.cpp index 68fdf60d0..572d60cd8 100644 --- a/plugins/LadspaEffect/LadspaEffect.cpp +++ b/plugins/LadspaEffect/LadspaEffect.cpp @@ -311,7 +311,7 @@ void LadspaEffect::pluginInstantiation() multi_proc_t ports; for( int port = 0; port < m_portCount; port++ ) { - port_desc_t * p = new port_desc_t; + auto p = new port_desc_t; p->name = manager->getPortName( m_key, port ); p->proc = proc; diff --git a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp index 15b3edf68..8ab50858a 100644 --- a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp +++ b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp @@ -63,65 +63,65 @@ void LadspaSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, const ladspa_key_t & lkey = subPluginKeyToLadspaKey( _key ); Ladspa2LMMS * lm = Engine::getLADSPAManager(); - QLabel * label = new QLabel( _parent ); + auto label = new QLabel(_parent); label->setText( QWidget::tr( "Name: " ) + lm->getName( lkey ) ); - QLabel* fileInfo = new QLabel( _parent ); + auto fileInfo = new QLabel(_parent); fileInfo->setText( QWidget::tr( "File: %1" ).arg( lkey.first ) ); - QWidget * maker = new QWidget( _parent ); - QHBoxLayout * l = new QHBoxLayout( maker ); + auto maker = new QWidget(_parent); + auto l = new QHBoxLayout(maker); l->setMargin( 0 ); l->setSpacing( 0 ); - QLabel * maker_label = new QLabel( maker ); + auto maker_label = new QLabel(maker); maker_label->setText( QWidget::tr( "Maker: " ) ); maker_label->setAlignment( Qt::AlignTop ); - QLabel * maker_content = new QLabel( maker ); + auto maker_content = new QLabel(maker); maker_content->setText( lm->getMaker( lkey ) ); maker_content->setWordWrap( true ); l->addWidget( maker_label ); l->addWidget( maker_content, 1 ); - QWidget * copyright = new QWidget( _parent ); + auto copyright = new QWidget(_parent); l = new QHBoxLayout( copyright ); l->setMargin( 0 ); l->setSpacing( 0 ); copyright->setMinimumWidth( _parent->minimumWidth() ); - QLabel * copyright_label = new QLabel( copyright ); + auto copyright_label = new QLabel(copyright); copyright_label->setText( QWidget::tr( "Copyright: " ) ); copyright_label->setAlignment( Qt::AlignTop ); - QLabel * copyright_content = new QLabel( copyright ); + auto copyright_content = new QLabel(copyright); copyright_content->setText( lm->getCopyright( lkey ) ); copyright_content->setWordWrap( true ); l->addWidget( copyright_label ); l->addWidget( copyright_content, 1 ); - QLabel * requiresRealTime = new QLabel( _parent ); + auto requiresRealTime = new QLabel(_parent); requiresRealTime->setText( QWidget::tr( "Requires Real Time: " ) + ( lm->hasRealTimeDependency( lkey ) ? QWidget::tr( "Yes" ) : QWidget::tr( "No" ) ) ); - QLabel * realTimeCapable = new QLabel( _parent ); + auto realTimeCapable = new QLabel(_parent); realTimeCapable->setText( QWidget::tr( "Real Time Capable: " ) + ( lm->isRealTimeCapable( lkey ) ? QWidget::tr( "Yes" ) : QWidget::tr( "No" ) ) ); - QLabel * inplaceBroken = new QLabel( _parent ); + auto inplaceBroken = new QLabel(_parent); inplaceBroken->setText( QWidget::tr( "In Place Broken: " ) + ( lm->isInplaceBroken( lkey ) ? QWidget::tr( "Yes" ) : QWidget::tr( "No" ) ) ); - - QLabel * channelsIn = new QLabel( _parent ); + + auto channelsIn = new QLabel(_parent); channelsIn->setText( QWidget::tr( "Channels In: " ) + QString::number( lm->getDescription( lkey )->inputChannels ) ); - QLabel * channelsOut = new QLabel( _parent ); + auto channelsOut = new QLabel(_parent); channelsOut->setText( QWidget::tr( "Channels Out: " ) + QString::number( lm->getDescription( lkey )->outputChannels ) ); } diff --git a/plugins/Lb302/Lb302.cpp b/plugins/Lb302/Lb302.cpp index 3621e034c..7db133f1f 100644 --- a/plugins/Lb302/Lb302.cpp +++ b/plugins/Lb302/Lb302.cpp @@ -349,7 +349,7 @@ Lb302Synth::Lb302Synth( InstrumentTrack * _instrumentTrack ) : filterChanged(); - InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrumentTrack ); + auto iph = new InstrumentPlayHandle(this, _instrumentTrack); Engine::audioEngine()->addPlayHandle( iph ); } @@ -869,7 +869,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : // move to 120,75 const int waveBtnX = 10; const int waveBtnY = 96; - PixmapButton * sawWaveBtn = new PixmapButton( this, tr( "Saw wave" ) ); + auto sawWaveBtn = new PixmapButton(this, tr("Saw wave")); sawWaveBtn->move( waveBtnX, waveBtnY ); sawWaveBtn->setActiveGraphic( embed::getIconPixmap( "saw_wave_active" ) ); @@ -878,8 +878,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : sawWaveBtn->setToolTip( tr( "Click here for a saw-wave." ) ); - PixmapButton * triangleWaveBtn = - new PixmapButton( this, tr( "Triangle wave" ) ); + auto triangleWaveBtn = new PixmapButton(this, tr("Triangle wave")); triangleWaveBtn->move( waveBtnX+(16*1), waveBtnY ); triangleWaveBtn->setActiveGraphic( embed::getIconPixmap( "triangle_wave_active" ) ); @@ -888,7 +887,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : triangleWaveBtn->setToolTip( tr( "Click here for a triangle-wave." ) ); - PixmapButton * sqrWaveBtn = new PixmapButton( this, tr( "Square wave" ) ); + auto sqrWaveBtn = new PixmapButton(this, tr("Square wave")); sqrWaveBtn->move( waveBtnX+(16*2), waveBtnY ); sqrWaveBtn->setActiveGraphic( embed::getIconPixmap( "square_wave_active" ) ); @@ -897,8 +896,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : sqrWaveBtn->setToolTip( tr( "Click here for a square-wave." ) ); - PixmapButton * roundSqrWaveBtn = - new PixmapButton( this, tr( "Rounded square wave" ) ); + auto roundSqrWaveBtn = new PixmapButton(this, tr("Rounded square wave")); roundSqrWaveBtn->move( waveBtnX+(16*3), waveBtnY ); roundSqrWaveBtn->setActiveGraphic( embed::getIconPixmap( "round_square_wave_active" ) ); @@ -907,8 +905,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : roundSqrWaveBtn->setToolTip( tr( "Click here for a square-wave with a rounded end." ) ); - PixmapButton * moogWaveBtn = - new PixmapButton( this, tr( "Moog wave" ) ); + auto moogWaveBtn = new PixmapButton(this, tr("Moog wave")); moogWaveBtn->move( waveBtnX+(16*4), waveBtnY ); moogWaveBtn->setActiveGraphic( embed::getIconPixmap( "moog_saw_wave_active" ) ); @@ -917,7 +914,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : moogWaveBtn->setToolTip( tr( "Click here for a moog-like wave." ) ); - PixmapButton * sinWaveBtn = new PixmapButton( this, tr( "Sine wave" ) ); + auto sinWaveBtn = new PixmapButton(this, tr("Sine wave")); sinWaveBtn->move( waveBtnX+(16*5), waveBtnY ); sinWaveBtn->setActiveGraphic( embed::getIconPixmap( "sin_wave_active" ) ); @@ -926,8 +923,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : sinWaveBtn->setToolTip( tr( "Click for a sine-wave." ) ); - PixmapButton * exponentialWaveBtn = - new PixmapButton( this, tr( "White noise wave" ) ); + auto exponentialWaveBtn = new PixmapButton(this, tr("White noise wave")); exponentialWaveBtn->move( waveBtnX+(16*6), waveBtnY ); exponentialWaveBtn->setActiveGraphic( embed::getIconPixmap( "exp_wave_active" ) ); @@ -936,9 +932,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : exponentialWaveBtn->setToolTip( tr( "Click here for an exponential wave." ) ); - - PixmapButton * whiteNoiseWaveBtn = - new PixmapButton( this, tr( "White noise wave" ) ); + auto whiteNoiseWaveBtn = new PixmapButton(this, tr("White noise wave")); whiteNoiseWaveBtn->move( waveBtnX+(16*7), waveBtnY ); whiteNoiseWaveBtn->setActiveGraphic( embed::getIconPixmap( "white_noise_wave_active" ) ); @@ -947,8 +941,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : whiteNoiseWaveBtn->setToolTip( tr( "Click here for white-noise." ) ); - PixmapButton * blSawWaveBtn = - new PixmapButton( this, tr( "Bandlimited saw wave" ) ); + auto blSawWaveBtn = new PixmapButton(this, tr("Bandlimited saw wave")); blSawWaveBtn->move( waveBtnX+(16*9)-8, waveBtnY ); blSawWaveBtn->setActiveGraphic( embed::getIconPixmap( "saw_wave_active" ) ); @@ -957,8 +950,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : blSawWaveBtn->setToolTip( tr( "Click here for bandlimited saw wave." ) ); - PixmapButton * blSquareWaveBtn = - new PixmapButton( this, tr( "Bandlimited square wave" ) ); + auto blSquareWaveBtn = new PixmapButton(this, tr("Bandlimited square wave")); blSquareWaveBtn->move( waveBtnX+(16*10)-8, waveBtnY ); blSquareWaveBtn->setActiveGraphic( embed::getIconPixmap( "square_wave_active" ) ); @@ -967,8 +959,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : blSquareWaveBtn->setToolTip( tr( "Click here for bandlimited square wave." ) ); - PixmapButton * blTriangleWaveBtn = - new PixmapButton( this, tr( "Bandlimited triangle wave" ) ); + auto blTriangleWaveBtn = new PixmapButton(this, tr("Bandlimited triangle wave")); blTriangleWaveBtn->move( waveBtnX+(16*11)-8, waveBtnY ); blTriangleWaveBtn->setActiveGraphic( embed::getIconPixmap( "triangle_wave_active" ) ); @@ -977,8 +968,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : blTriangleWaveBtn->setToolTip( tr( "Click here for bandlimited triangle wave." ) ); - PixmapButton * blMoogWaveBtn = - new PixmapButton( this, tr( "Bandlimited moog saw wave" ) ); + auto blMoogWaveBtn = new PixmapButton(this, tr("Bandlimited moog saw wave")); blMoogWaveBtn->move( waveBtnX+(16*12)-8, waveBtnY ); blMoogWaveBtn->setActiveGraphic( embed::getIconPixmap( "moog_saw_wave_active" ) ); @@ -1012,7 +1002,7 @@ Lb302SynthView::Lb302SynthView( Instrument * _instrument, QWidget * _parent ) : void Lb302SynthView::modelChanged() { - Lb302Synth * syn = castModel(); + auto syn = castModel(); m_vcfCutKnob->setModel( &syn->vcf_cut_knob ); m_vcfResKnob->setModel( &syn->vcf_res_knob ); diff --git a/plugins/Lv2Effect/Lv2Effect.cpp b/plugins/Lv2Effect/Lv2Effect.cpp index f69ea4a38..1a25c718a 100644 --- a/plugins/Lv2Effect/Lv2Effect.cpp +++ b/plugins/Lv2Effect/Lv2Effect.cpp @@ -90,8 +90,8 @@ bool Lv2Effect::processAudioBuffer(sampleFrame *buf, const fpp_t frames) { buf[f][0] = d * buf[f][0] + w * m_tmpOutputSmps[f][0]; buf[f][1] = d * buf[f][1] + w * m_tmpOutputSmps[f][1]; - double l = static_cast(buf[f][0]); - double r = static_cast(buf[f][1]); + auto l = static_cast(buf[f][0]); + auto r = static_cast(buf[f][1]); outSum += l*l + r*r; } checkGate(outSum / frames); @@ -109,7 +109,7 @@ extern "C" PLUGIN_EXPORT Plugin *lmms_plugin_main(Model *_parent, void *_data) { using KeyType = Plugin::Descriptor::SubPluginFeatures::Key; - Lv2Effect* eff = new Lv2Effect(_parent, static_cast(_data)); + auto eff = new Lv2Effect(_parent, static_cast(_data)); if (!eff->isValid()) { delete eff; eff = nullptr; } return eff; } diff --git a/plugins/Lv2Instrument/Lv2Instrument.cpp b/plugins/Lv2Instrument/Lv2Instrument.cpp index 0057d65a7..4fae23488 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.cpp +++ b/plugins/Lv2Instrument/Lv2Instrument.cpp @@ -87,8 +87,7 @@ Lv2Instrument::Lv2Instrument(InstrumentTrack *instrumentTrackArg, this, [this](){Lv2ControlBase::reloadPlugin();}); // now we need a play-handle which cares for calling play() - InstrumentPlayHandle *iph = - new InstrumentPlayHandle(this, instrumentTrackArg); + auto iph = new InstrumentPlayHandle(this, instrumentTrackArg); Engine::audioEngine()->addPlayHandle(iph); } } @@ -299,9 +298,7 @@ extern "C" PLUGIN_EXPORT Plugin *lmms_plugin_main(Model *_parent, void *_data) { using KeyType = Plugin::Descriptor::SubPluginFeatures::Key; - Lv2Instrument* ins = new Lv2Instrument( - static_cast(_parent), - static_cast(_data )); + auto ins = new Lv2Instrument(static_cast(_parent), static_cast(_data)); if (!ins->isValid()) { delete ins; ins = nullptr; } return ins; } diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index 1c8851a31..a2686a1c9 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -310,7 +310,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) pd.setValue( 0 ); std::istringstream stream(readAllData().toStdString()); - Alg_seq_ptr seq = new Alg_seq(stream, true); + auto seq = new Alg_seq(stream, true); seq->convert_to_beats(); pd.setMaximum( seq->tracks() + preTrackSteps ); @@ -328,18 +328,14 @@ bool MidiImport::readSMF( TrackContainer* tc ) // NOTE: unordered_map::operator[] creates a new element if none exists MeterModel & timeSigMM = Engine::getSong()->getTimeSigModel(); - AutomationTrack * nt = dynamic_cast( - Track::create(Track::AutomationTrack, Engine::getSong())); + auto nt = dynamic_cast(Track::create(Track::AutomationTrack, Engine::getSong())); nt->setName(tr("MIDI Time Signature Numerator")); - AutomationTrack * dt = dynamic_cast( - Track::create(Track::AutomationTrack, Engine::getSong())); + auto dt = dynamic_cast(Track::create(Track::AutomationTrack, Engine::getSong())); dt->setName(tr("MIDI Time Signature Denominator")); - AutomationClip * timeSigNumeratorPat = - new AutomationClip(nt); + auto timeSigNumeratorPat = new AutomationClip(nt); timeSigNumeratorPat->setDisplayName(tr("Numerator")); timeSigNumeratorPat->addObject(&timeSigMM.numeratorModel()); - AutomationClip * timeSigDenominatorPat = - new AutomationClip(dt); + auto timeSigDenominatorPat = new AutomationClip(dt); timeSigDenominatorPat->setDisplayName(tr("Denominator")); timeSigDenominatorPat->addObject(&timeSigMM.denominatorModel()); @@ -448,7 +444,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) else if (evt->is_note()) { smfMidiChannel * ch = chs[evt->chan].create( tc, trackName ); - Alg_note_ptr noteEvt = dynamic_cast( evt ); + auto noteEvt = dynamic_cast(evt); int ticks = noteEvt->get_duration() * ticksPerBeat; Note n( (ticks < 1 ? 1 : ticks ), noteEvt->get_start_time() * ticksPerBeat, diff --git a/plugins/Monstro/Monstro.cpp b/plugins/Monstro/Monstro.cpp index b5fc5545f..51205c660 100644 --- a/plugins/Monstro/Monstro.cpp +++ b/plugins/Monstro/Monstro.cpp @@ -87,7 +87,7 @@ MonstroSynth::MonstroSynth( MonstroInstrument * _i, NotePlayHandle * _nph ) : m_lfo_next[0] = Oscillator::noiseSample( 0.0f ); m_lfo_next[1] = Oscillator::noiseSample( 0.0f ); - + m_osc1l_last = 0.0f; m_osc1r_last = 0.0f; @@ -652,14 +652,14 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float * { // frames played before const f_cnt_t tfp = m_nph->totalFramesPlayed(); - + float * lfo [2]; float * env [2]; lfo[0] = lfo1; lfo[1] = lfo2; env[0] = env1; env[1] = env2; - + for( int i = 0; i < 2; ++i ) { switch( m_lfovalue[i] ) @@ -740,7 +740,7 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float * { const f_cnt_t tm = ( tfp + f ) % static_cast( m_lfo_rate[i] ); if( tm == 0 ) - { + { m_lfo_last[i] = m_lfo_next[i]; m_lfo_next[i] = Oscillator::noiseSample( 0.0f ); } @@ -755,9 +755,9 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float * { if( tfp + f < m_lfoatt[i] ) lfo[i][f] *= ( static_cast( tfp ) / m_lfoatt[i] ); } - - - + + + ///////////////////////////////////////////// // // // // @@ -765,7 +765,7 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float * // // // // ///////////////////////////////////////////// - + for( f_cnt_t f = 0; f < frames; ++f ) { if( m_env_phase[i] < 4.0f && m_nph->isReleased() && f >= m_nph->framesBeforeRelease() ) @@ -1035,7 +1035,7 @@ void MonstroInstrument::playNote( NotePlayHandle * _n, _n->m_pluginData = new MonstroSynth( this, _n ); } - MonstroSynth * ms = static_cast( _n->m_pluginData ); + auto ms = static_cast(_n->m_pluginData); ms->renderOutput( frames, _working_buffer + offset ); @@ -1414,7 +1414,7 @@ void MonstroInstrument::updateLFOAtts() void MonstroInstrument::updateSamplerate() { m_samplerate = Engine::audioEngine()->processingSampleRate(); - + m_integrator = 0.5f - ( 0.5f - INTEGRATOR ) * 44100.0f / m_samplerate; m_fmCorrection = 44100.f / m_samplerate * FM_AMOUNT; m_counterMax = ( m_samplerate * 5 ) / 44100; @@ -1459,13 +1459,13 @@ MonstroView::MonstroView( Instrument * _instrument, // "tab buttons" - PixmapButton * m_opViewButton = new PixmapButton( this, nullptr ); + auto m_opViewButton = new PixmapButton(this, nullptr); m_opViewButton -> move( 0,0 ); m_opViewButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "opview_active" ) ); m_opViewButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "opview_inactive" ) ); m_opViewButton->setToolTip(tr("Operators view")); - PixmapButton * m_matViewButton = new PixmapButton( this, nullptr ); + auto m_matViewButton = new PixmapButton(this, nullptr); m_matViewButton -> move( 125,0 ); m_matViewButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "matview_active" ) ); m_matViewButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "matview_inactive" ) ); @@ -1498,7 +1498,7 @@ void MonstroView::updateLayout() void MonstroView::modelChanged() { - MonstroInstrument * m = castModel(); + auto m = castModel(); m_osc1VolKnob-> setModel( &m-> m_osc1Vol ); m_osc1PanKnob-> setModel( &m-> m_osc1Pan ); @@ -1631,7 +1631,7 @@ QWidget * MonstroView::setupOperatorsView( QWidget * _parent ) { // operators view - QWidget * view = new QWidget( _parent ); + auto view = new QWidget(_parent); view-> setFixedSize( 250, 250 ); makeknob( m_osc1VolKnob, KNOBCOL1, O1ROW, tr( "Volume" ), "%", "osc1Knob" ) @@ -1694,46 +1694,47 @@ QWidget * MonstroView::setupOperatorsView( QWidget * _parent ) m_lfo2WaveBox -> setGeometry( 127, LFOROW + 7, 42, ComboBox::DEFAULT_HEIGHT ); m_lfo2WaveBox->setFont( pointSize<8>( m_lfo2WaveBox->font() ) ); - maketsknob( m_lfo2AttKnob, LFOCOL4, LFOROW, tr( "Attack" ), " ms", "lfoKnob" ) - maketsknob( m_lfo2RateKnob, LFOCOL5, LFOROW, tr( "Rate" ), " ms", "lfoKnob" ) - makeknob( m_lfo2PhsKnob, LFOCOL6, LFOROW, tr( "Phase" ), tr( " deg" ), "lfoKnob" ) + maketsknob(m_lfo2AttKnob, LFOCOL4, LFOROW, tr("Attack"), " ms", "lfoKnob") + maketsknob(m_lfo2RateKnob, LFOCOL5, LFOROW, tr("Rate"), " ms", "lfoKnob") + makeknob(m_lfo2PhsKnob, LFOCOL6, LFOROW, tr("Phase"), tr(" deg"), "lfoKnob") - maketsknob( m_env1PreKnob, KNOBCOL1, E1ROW, tr( "Pre-delay" ), " ms", "envKnob" ) - maketsknob( m_env1AttKnob, KNOBCOL2, E1ROW, tr( "Attack" ), " ms", "envKnob" ) - maketsknob( m_env1HoldKnob, KNOBCOL3, E1ROW, tr( "Hold" ), " ms", "envKnob" ) - maketsknob( m_env1DecKnob, KNOBCOL4, E1ROW, tr( "Decay" ), " ms", "envKnob" ) - makeknob( m_env1SusKnob, KNOBCOL5, E1ROW, tr( "Sustain" ), "", "envKnob" ) - maketsknob( m_env1RelKnob, KNOBCOL6, E1ROW, tr( "Release" ), " ms", "envKnob" ) - makeknob( m_env1SlopeKnob, KNOBCOL7, E1ROW, tr( "Slope" ), "", "envKnob" ) + maketsknob(m_env1PreKnob, KNOBCOL1, E1ROW, tr("Pre-delay"), " ms", "envKnob") + maketsknob(m_env1AttKnob, KNOBCOL2, E1ROW, tr("Attack"), " ms", "envKnob") + maketsknob(m_env1HoldKnob, KNOBCOL3, E1ROW, tr("Hold"), " ms", "envKnob") + maketsknob(m_env1DecKnob, KNOBCOL4, E1ROW, tr("Decay"), " ms", "envKnob") - maketsknob( m_env2PreKnob, KNOBCOL1, E2ROW, tr( "Pre-delay" ), " ms", "envKnob" ) - maketsknob( m_env2AttKnob, KNOBCOL2, E2ROW, tr( "Attack" ), " ms", "envKnob" ) - maketsknob( m_env2HoldKnob, KNOBCOL3, E2ROW, tr( "Hold" ), " ms", "envKnob" ) - maketsknob( m_env2DecKnob, KNOBCOL4, E2ROW, tr( "Decay" ), " ms", "envKnob" ) - makeknob( m_env2SusKnob, KNOBCOL5, E2ROW, tr( "Sustain" ), "", "envKnob" ) - maketsknob( m_env2RelKnob, KNOBCOL6, E2ROW, tr( "Release" ), " ms", "envKnob" ) - makeknob( m_env2SlopeKnob, KNOBCOL7, E2ROW, tr( "Slope" ), "", "envKnob" ) + makeknob(m_env1SusKnob, KNOBCOL5, E1ROW, tr("Sustain"), "", "envKnob") + maketsknob(m_env1RelKnob, KNOBCOL6, E1ROW, tr("Release"), " ms", "envKnob") + makeknob(m_env1SlopeKnob, KNOBCOL7, E1ROW, tr("Slope"), "", "envKnob") + + maketsknob(m_env2PreKnob, KNOBCOL1, E2ROW, tr("Pre-delay"), " ms", "envKnob") + maketsknob(m_env2AttKnob, KNOBCOL2, E2ROW, tr("Attack"), " ms", "envKnob") + maketsknob(m_env2HoldKnob, KNOBCOL3, E2ROW, tr("Hold"), " ms", "envKnob") + maketsknob(m_env2DecKnob, KNOBCOL4, E2ROW, tr("Decay"), " ms", "envKnob") + makeknob(m_env2SusKnob, KNOBCOL5, E2ROW, tr("Sustain"), "", "envKnob") + maketsknob(m_env2RelKnob, KNOBCOL6, E2ROW, tr("Release"), " ms", "envKnob") + makeknob(m_env2SlopeKnob, KNOBCOL7, E2ROW, tr("Slope"), "", "envKnob") // mod selector - PixmapButton * m_mixButton = new PixmapButton( view, nullptr ); + auto m_mixButton = new PixmapButton(view, nullptr); m_mixButton -> move( 225, 185 ); m_mixButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_active" ) ); m_mixButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_inactive" ) ); m_mixButton->setToolTip(tr("Mix osc 2 with osc 3")); - PixmapButton * m_amButton = new PixmapButton( view, nullptr ); + auto m_amButton = new PixmapButton(view, nullptr); m_amButton -> move( 225, 185 + 15 ); m_amButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "am_active" ) ); m_amButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "am_inactive" ) ); m_amButton->setToolTip(tr("Modulate amplitude of osc 3 by osc 2")); - PixmapButton * m_fmButton = new PixmapButton( view, nullptr ); + auto m_fmButton = new PixmapButton(view, nullptr); m_fmButton -> move( 225, 185 + 15*2 ); m_fmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_active" ) ); m_fmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_inactive" ) ); m_fmButton->setToolTip(tr("Modulate frequency of osc 3 by osc 2")); - PixmapButton * m_pmButton = new PixmapButton( view, nullptr ); + auto m_pmButton = new PixmapButton(view, nullptr); m_pmButton -> move( 225, 185 + 15*3 ); m_pmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "pm_active" ) ); m_pmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "pm_inactive" ) ); @@ -1755,7 +1756,7 @@ QWidget * MonstroView::setupMatrixView( QWidget * _parent ) { // matrix view - QWidget * view = new QWidget( _parent ); + auto view = new QWidget(_parent); view-> setFixedSize( 250, 250 ); makeknob( m_vol1env1Knob, MATCOL1, MATROW1, tr( "Modulation amount" ), "", "matrixKnob" ) diff --git a/plugins/MultitapEcho/MultitapEchoControlDialog.cpp b/plugins/MultitapEcho/MultitapEchoControlDialog.cpp index f96ea46ec..dbf428e5f 100644 --- a/plugins/MultitapEcho/MultitapEchoControlDialog.cpp +++ b/plugins/MultitapEcho/MultitapEchoControlDialog.cpp @@ -47,10 +47,10 @@ MultitapEchoControlDialog::MultitapEchoControlDialog( MultitapEchoControls * con setFixedSize( 245, 300 ); // graph widgets - - Graph * ampGraph = new Graph( this, Graph::BarStyle, 204, 105 ); - Graph * lpGraph = new Graph( this, Graph::BarStyle, 204, 105 ); - + + auto ampGraph = new Graph(this, Graph::BarStyle, 204, 105); + auto lpGraph = new Graph(this, Graph::BarStyle, 204, 105); + ampGraph->move( 30, 10 ); lpGraph->move( 30, 125 ); @@ -71,33 +71,33 @@ MultitapEchoControlDialog::MultitapEchoControlDialog( MultitapEchoControls * con lpGraph -> setMaximumSize( 204, 105 ); // steps spinbox - - LcdSpinBox * steps = new LcdSpinBox( 2, this, "Steps" ); + + auto steps = new LcdSpinBox(2, this, "Steps"); steps->move( 20, 245 ); steps->setModel( & controls->m_steps ); // knobs - TempoSyncKnob * stepLength = new TempoSyncKnob( knobBright_26, this ); + auto stepLength = new TempoSyncKnob(knobBright_26, this); stepLength->move( 100, 245 ); stepLength->setModel( & controls->m_stepLength ); stepLength->setLabel( tr( "Length" ) ); stepLength->setHintText( tr( "Step length:" ) , " ms" ); - - Knob * dryGain = new Knob( knobBright_26, this ); + + auto dryGain = new Knob(knobBright_26, this); dryGain->move( 150, 245 ); dryGain->setModel( & controls->m_dryGain ); dryGain->setLabel( tr( "Dry" ) ); dryGain->setHintText( tr( "Dry gain:" ) , " dBFS" ); - Knob * stages = new Knob( knobBright_26, this ); + auto stages = new Knob(knobBright_26, this); stages->move( 200, 245 ); stages->setModel( & controls->m_stages ); stages->setLabel( tr( "Stages" ) ); stages->setHintText( tr( "Low-pass stages:" ) , "x" ); // switch led - - LedCheckBox * swapInputs = new LedCheckBox( "Swap inputs", this, tr( "Swap inputs" ), LedCheckBox::Green ); + + auto swapInputs = new LedCheckBox("Swap inputs", this, tr("Swap inputs"), LedCheckBox::Green); swapInputs->move( 20, 275 ); swapInputs->setModel( & controls->m_swapInputs ); swapInputs->setToolTip(tr("Swap left and right input channels for reflections")); diff --git a/plugins/Nes/Nes.cpp b/plugins/Nes/Nes.cpp index 4e5fdc59a..d47ebd728 100644 --- a/plugins/Nes/Nes.cpp +++ b/plugins/Nes/Nes.cpp @@ -385,9 +385,9 @@ void NesObject::renderOutput( sampleFrame * buf, fpp_t frames ) // // // final stage - mixing // // // - //////////////////////////////// - - float pin1 = static_cast( ch1 + ch2 ); + //////////////////////////////// + + auto pin1 = static_cast(ch1 + ch2); // add dithering noise pin1 *= 1.0 + ( Oscillator::noiseSample( 0.0f ) * DITHER_AMP ); pin1 = pin1 / 30.0f; @@ -405,8 +405,7 @@ void NesObject::renderOutput( sampleFrame * buf, fpp_t frames ) pin1 *= NES_MIXING_12; - - float pin2 = static_cast( ch3 + ch4 ); + auto pin2 = static_cast(ch3 + ch4); // add dithering noise pin2 *= 1.0 + ( Oscillator::noiseSample( 0.0f ) * DITHER_AMP ); pin2 = pin2 / 30.0f; @@ -552,13 +551,13 @@ void NesInstrument::playNote( NotePlayHandle * n, sampleFrame * workingBuffer ) const f_cnt_t offset = n->noteOffset(); if ( n->totalFramesPlayed() == 0 || n->m_pluginData == nullptr ) - { - NesObject * nes = new NesObject( this, Engine::audioEngine()->processingSampleRate(), n ); + { + auto nes = new NesObject(this, Engine::audioEngine()->processingSampleRate(), n); n->m_pluginData = nes; } - - NesObject * nes = static_cast( n->m_pluginData ); - + + auto nes = static_cast(n->m_pluginData); + nes->renderOutput( workingBuffer + offset, frames ); applyRelease( workingBuffer, n ); @@ -846,7 +845,7 @@ NesInstrumentView::NesInstrumentView( Instrument * instrument, QWidget * parent void NesInstrumentView::modelChanged() { - NesInstrument * nes = castModel(); + auto nes = castModel(); m_ch1EnabledBtn->setModel( &nes->m_ch1Enabled ); m_ch1CrsKnob->setModel( &nes->m_ch1Crs ); diff --git a/plugins/OpulenZ/OpulenZ.cpp b/plugins/OpulenZ/OpulenZ.cpp index beec8841b..67349e48b 100644 --- a/plugins/OpulenZ/OpulenZ.cpp +++ b/plugins/OpulenZ/OpulenZ.cpp @@ -215,7 +215,7 @@ OpulenzInstrument::OpulenzInstrument( InstrumentTrack * _instrument_track ) : MOD_CON( trem_depth_mdl ); // Connect the plugin to the audio engine... - InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track ); + auto iph = new InstrumentPlayHandle(this, _instrument_track); Engine::audioEngine()->addPlayHandle( iph ); } @@ -798,8 +798,7 @@ void OpulenzInstrumentView::updateKnobHints() -12, 0, 12, 19, 24, 28, 31, 34, 36, 38, 40, 40, 43, 43, 47, 47 }; - OpulenzInstrument * m = castModel(); - + auto m = castModel(); op1_a_kn->setHintText( tr( "Attack" ), " (" + knobHintHelper(attack_times[(int)m->op1_a_mdl.value()]) + ")"); @@ -821,7 +820,7 @@ void OpulenzInstrumentView::updateKnobHints() void OpulenzInstrumentView::modelChanged() { - OpulenzInstrument * m = castModel(); + auto m = castModel(); // m_patch->setModel( &m->m_patchModel ); op1_a_kn->setModel( &m->op1_a_mdl ); diff --git a/plugins/Organic/Organic.cpp b/plugins/Organic/Organic.cpp index c22a12168..cd18fc555 100644 --- a/plugins/Organic/Organic.cpp +++ b/plugins/Organic/Organic.cpp @@ -422,7 +422,7 @@ OrganicInstrumentView::OrganicInstrumentView( Instrument * _instrument, InstrumentViewFixedSize( _instrument, _parent ), m_oscKnobs( nullptr ) { - OrganicInstrument * oi = castModel(); + auto oi = castModel(); setAutoFillBackground( true ); QPalette pal; @@ -474,8 +474,8 @@ OrganicInstrumentView::~OrganicInstrumentView() void OrganicInstrumentView::modelChanged() { - OrganicInstrument * oi = castModel(); - + auto oi = castModel(); + const float y=91.0f; const float rowHeight = 26.0f; const float x=53.0f; @@ -512,7 +512,7 @@ void OrganicInstrumentView::modelChanged() oscKnob->setHintText( tr( "Osc %1 waveform:" ).arg( i + 1 ), QString() ); // setup volume-knob - Knob * volKnob = new Knob( knobStyled, this ); + auto volKnob = new Knob(knobStyled, this); volKnob->setVolumeKnob( true ); volKnob->move( x + i * colWidth, y + rowHeight*1 ); volKnob->setFixedSize( 21, 21 ); @@ -547,7 +547,7 @@ void OrganicInstrumentView::modelChanged() void OrganicInstrumentView::updateKnobHint() { - OrganicInstrument * oi = castModel(); + auto oi = castModel(); for( int i = 0; i < m_numOscillators; ++i ) { const float harm = oi->m_osc[i]->m_harmModel.value(); diff --git a/plugins/Patman/Patman.cpp b/plugins/Patman/Patman.cpp index 8b502e93d..341cd9f27 100644 --- a/plugins/Patman/Patman.cpp +++ b/plugins/Patman/Patman.cpp @@ -148,7 +148,7 @@ void PatmanInstrument::playNote( NotePlayHandle * _n, { selectSample( _n ); } - handle_data * hdata = (handle_data *)_n->m_pluginData; + auto hdata = (handle_data*)_n->m_pluginData; float play_freq = hdata->tuned ? _n->frequency() : hdata->sample->frequency(); @@ -171,7 +171,7 @@ void PatmanInstrument::playNote( NotePlayHandle * _n, void PatmanInstrument::deleteNotePluginData( NotePlayHandle * _n ) { - handle_data * hdata = (handle_data *)_n->m_pluginData; + auto hdata = (handle_data*)_n->m_pluginData; sharedObject::unref( hdata->sample ); delete hdata->state; delete hdata; @@ -347,7 +347,7 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch( } } - sampleFrame * data = new sampleFrame[frames]; + auto data = new sampleFrame[frames]; for( f_cnt_t frame = 0; frame < frames; ++frame ) { @@ -358,7 +358,7 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch( } } - SampleBuffer* psample = new SampleBuffer( data, frames ); + auto psample = new SampleBuffer(data, frames); psample->setFrequency( root_freq / 1000.0f ); psample->setSampleRate( sample_rate ); @@ -412,7 +412,7 @@ void PatmanInstrument::selectSample( NotePlayHandle * _n ) } } - handle_data * hdata = new handle_data; + auto hdata = new handle_data; hdata->tuned = m_tunedModel.value(); if( sample ) { diff --git a/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.cpp b/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.cpp index b0d6fafc6..69566a86c 100644 --- a/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.cpp +++ b/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.cpp @@ -85,9 +85,9 @@ PeakControllerEffectControlDialog::PeakControllerEffectControlDialog( m_absLed = new LedCheckBox( tr( "Absolute value" ), this ); m_absLed->setModel( &_controls->m_absModel ); - QVBoxLayout * mainLayout = new QVBoxLayout(); - QHBoxLayout * knobLayout = new QHBoxLayout(); - QHBoxLayout * ledLayout = new QHBoxLayout(); + auto mainLayout = new QVBoxLayout(); + auto knobLayout = new QHBoxLayout(); + auto ledLayout = new QHBoxLayout(); knobLayout->addWidget( m_baseKnob ); knobLayout->addWidget( m_amountKnob ); diff --git a/plugins/ReverbSC/ReverbSC.cpp b/plugins/ReverbSC/ReverbSC.cpp index 4d72dc319..a13f7eee8 100644 --- a/plugins/ReverbSC/ReverbSC.cpp +++ b/plugins/ReverbSC/ReverbSC.cpp @@ -98,12 +98,10 @@ bool ReverbSCEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) { sample_t s[2] = { buf[f][0], buf[f][1] }; - const SPFLOAT inGain = (SPFLOAT)DB2LIN((inGainBuf ? - inGainBuf->values()[f] - : m_reverbSCControls.m_inputGainModel.value())); - const SPFLOAT outGain = (SPFLOAT)DB2LIN((outGainBuf ? - outGainBuf->values()[f] - : m_reverbSCControls.m_outputGainModel.value())); + const auto inGain + = (SPFLOAT)DB2LIN((inGainBuf ? inGainBuf->values()[f] : m_reverbSCControls.m_inputGainModel.value())); + const auto outGain + = (SPFLOAT)DB2LIN((outGainBuf ? outGainBuf->values()[f] : m_reverbSCControls.m_outputGainModel.value())); s[0] *= inGain; s[1] *= inGain; diff --git a/plugins/ReverbSC/ReverbSCControlDialog.cpp b/plugins/ReverbSC/ReverbSCControlDialog.cpp index 38b93e234..c9ddef384 100644 --- a/plugins/ReverbSC/ReverbSCControlDialog.cpp +++ b/plugins/ReverbSC/ReverbSCControlDialog.cpp @@ -41,26 +41,26 @@ ReverbSCControlDialog::ReverbSCControlDialog( ReverbSCControls* controls ) : pal.setBrush( backgroundRole(), PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); setFixedSize( 185, 55 ); - - Knob * inputGainKnob = new Knob( knobBright_26, this); + + auto inputGainKnob = new Knob(knobBright_26, this); inputGainKnob -> move( 16, 10 ); inputGainKnob->setModel( &controls->m_inputGainModel ); inputGainKnob->setLabel( tr( "Input" ) ); inputGainKnob->setHintText( tr( "Input gain:" ) , "dB" ); - Knob * sizeKnob = new Knob( knobBright_26, this); + auto sizeKnob = new Knob(knobBright_26, this); sizeKnob -> move( 57, 10 ); sizeKnob->setModel( &controls->m_sizeModel ); sizeKnob->setLabel( tr( "Size" ) ); sizeKnob->setHintText( tr( "Size:" ) , "" ); - Knob * colorKnob = new Knob( knobBright_26, this); + auto colorKnob = new Knob(knobBright_26, this); colorKnob -> move( 98, 10 ); colorKnob->setModel( &controls->m_colorModel ); colorKnob->setLabel( tr( "Color" ) ); colorKnob->setHintText( tr( "Color:" ) , "" ); - Knob * outputGainKnob = new Knob( knobBright_26, this); + auto outputGainKnob = new Knob(knobBright_26, this); outputGainKnob -> move( 139, 10 ); outputGainKnob->setModel( &controls->m_outputGainModel ); outputGainKnob->setLabel( tr( "Output" ) ); diff --git a/plugins/Sf2Player/Sf2Player.cpp b/plugins/Sf2Player/Sf2Player.cpp index dae94a332..152aeb583 100644 --- a/plugins/Sf2Player/Sf2Player.cpp +++ b/plugins/Sf2Player/Sf2Player.cpp @@ -186,7 +186,7 @@ Sf2Instrument::Sf2Instrument( InstrumentTrack * _instrument_track ) : connect( &m_chorusSpeed, SIGNAL( dataChanged() ), this, SLOT( updateChorus() ) ); connect( &m_chorusDepth, SIGNAL( dataChanged() ), this, SLOT( updateChorus() ) ); - InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track ); + auto iph = new InstrumentPlayHandle(this, _instrument_track); Engine::audioEngine()->addPlayHandle( iph ); } @@ -640,7 +640,7 @@ void Sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * ) } const int baseVelocity = instrumentTrack()->midiPort()->baseVelocity(); - Sf2PluginData * pluginData = new Sf2PluginData; + auto pluginData = new Sf2PluginData; pluginData->midiNote = midiNote; pluginData->lastPanning = 0; pluginData->lastVelocity = _n->midiVelocity( baseVelocity ); @@ -658,7 +658,7 @@ void Sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * ) } else if( _n->isReleased() && ! _n->instrumentTrack()->isSustainPedalPressed() ) // note is released during this period { - Sf2PluginData * pluginData = static_cast( _n->m_pluginData ); + auto pluginData = static_cast(_n->m_pluginData); pluginData->offset = _n->framesBeforeRelease(); pluginData->isNew = false; @@ -766,8 +766,8 @@ void Sf2Instrument::play( sampleFrame * _working_buffer ) NotePlayHandle * currentNote = m_playingNotes[0]; for( int i = 1; i < m_playingNotes.size(); ++i ) { - Sf2PluginData * currentData = static_cast( currentNote->m_pluginData ); - Sf2PluginData * iData = static_cast( m_playingNotes[i]->m_pluginData ); + auto currentData = static_cast(currentNote->m_pluginData); + auto iData = static_cast(m_playingNotes[i]->m_pluginData); if( currentData->offset > iData->offset ) { currentNote = m_playingNotes[i]; @@ -776,7 +776,7 @@ void Sf2Instrument::play( sampleFrame * _working_buffer ) // process the current note: // first see if we're synced in frame count - Sf2PluginData * currentData = static_cast( currentNote->m_pluginData ); + auto currentData = static_cast(currentNote->m_pluginData); if( currentData->offset > currentFrame ) { renderFrames( currentData->offset - currentFrame, _working_buffer + currentFrame ); @@ -860,7 +860,7 @@ void Sf2Instrument::renderFrames( f_cnt_t frames, sampleFrame * buf ) void Sf2Instrument::deleteNotePluginData( NotePlayHandle * _n ) { - Sf2PluginData * pluginData = static_cast( _n->m_pluginData ); + auto pluginData = static_cast(_n->m_pluginData); if( ! pluginData->noteOffSent ) // if we for some reason haven't noteoffed the note before it gets deleted, // do it here { @@ -908,37 +908,36 @@ Sf2InstrumentView::Sf2InstrumentView( Instrument * _instrument, QWidget * _paren // QVBoxLayout * vl = new QVBoxLayout( this ); // QHBoxLayout * hl = new QHBoxLayout(); - Sf2Instrument* k = castModel(); + auto k = castModel(); - connect( &k->m_bankNum, SIGNAL( dataChanged() ), this, SLOT( updatePatchName() ) ); - connect( &k->m_patchNum, SIGNAL( dataChanged() ), this, SLOT( updatePatchName() ) ); + connect(&k->m_bankNum, SIGNAL(dataChanged()), this, SLOT(updatePatchName())); + connect(&k->m_patchNum, SIGNAL(dataChanged()), this, SLOT(updatePatchName())); // File Button - m_fileDialogButton = new PixmapButton( this ); - m_fileDialogButton->setCursor( QCursor( Qt::PointingHandCursor ) ); - m_fileDialogButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fileselect_on" ) ); - m_fileDialogButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "fileselect_off" ) ); - m_fileDialogButton->move( 217, 107 ); + m_fileDialogButton = new PixmapButton(this); + m_fileDialogButton->setCursor(QCursor(Qt::PointingHandCursor)); + m_fileDialogButton->setActiveGraphic(PLUGIN_NAME::getIconPixmap("fileselect_on")); + m_fileDialogButton->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("fileselect_off")); + m_fileDialogButton->move(217, 107); - connect( m_fileDialogButton, SIGNAL( clicked() ), this, SLOT( showFileDialog() ) ); + connect(m_fileDialogButton, SIGNAL(clicked()), this, SLOT(showFileDialog())); m_fileDialogButton->setToolTip(tr("Open SoundFont file")); // Patch Button - m_patchDialogButton = new PixmapButton( this ); - m_patchDialogButton->setCursor( QCursor( Qt::PointingHandCursor ) ); - m_patchDialogButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "patches_on" ) ); - m_patchDialogButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "patches_off" ) ); - m_patchDialogButton->setEnabled( false ); - m_patchDialogButton->move( 217, 125 ); + m_patchDialogButton = new PixmapButton(this); + m_patchDialogButton->setCursor(QCursor(Qt::PointingHandCursor)); + m_patchDialogButton->setActiveGraphic(PLUGIN_NAME::getIconPixmap("patches_on")); + m_patchDialogButton->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("patches_off")); + m_patchDialogButton->setEnabled(false); + m_patchDialogButton->move(217, 125); - connect( m_patchDialogButton, SIGNAL( clicked() ), this, SLOT( showPatchDialog() ) ); + connect(m_patchDialogButton, SIGNAL(clicked()), this, SLOT(showPatchDialog())); m_patchDialogButton->setToolTip(tr("Choose patch")); - // LCDs - m_bankNumLcd = new LcdSpinBox( 3, "21pink", this ); + m_bankNumLcd = new LcdSpinBox(3, "21pink", this); m_bankNumLcd->move(131, 62); // m_bankNumLcd->addTextForValue( -1, "---" ); // m_bankNumLcd->setEnabled( false ); @@ -1057,7 +1056,7 @@ Sf2InstrumentView::Sf2InstrumentView( Instrument * _instrument, QWidget * _paren void Sf2InstrumentView::modelChanged() { - Sf2Instrument * k = castModel(); + auto k = castModel(); m_bankNumLcd->setModel( &k->m_bankNum ); m_patchNumLcd->setModel( &k->m_patchNum ); @@ -1088,7 +1087,7 @@ void Sf2InstrumentView::modelChanged() void Sf2InstrumentView::updateFilename() { - Sf2Instrument * i = castModel(); + auto i = castModel(); QFontMetrics fm( m_filenameLabel->font() ); QString file = i->m_filename.endsWith( ".sf2", Qt::CaseInsensitive ) ? i->m_filename.left( i->m_filename.length() - 4 ) : @@ -1108,7 +1107,7 @@ void Sf2InstrumentView::updateFilename() void Sf2InstrumentView::updatePatchName() { - Sf2Instrument * i = castModel(); + auto i = castModel(); QFontMetrics fm( font() ); QString patch = i->getCurrentPatchName(); m_patchLabel->setText( fm.elidedText( patch, Qt::ElideLeft, m_patchLabel->width() ) ); @@ -1130,7 +1129,7 @@ void Sf2InstrumentView::invalidateFile() void Sf2InstrumentView::showFileDialog() { - Sf2Instrument * k = castModel(); + auto k = castModel(); FileDialog ofd( nullptr, tr( "Open SoundFont file" ) ); ofd.setFileMode( FileDialog::ExistingFiles ); @@ -1170,7 +1169,7 @@ void Sf2InstrumentView::showFileDialog() void Sf2InstrumentView::showPatchDialog() { - Sf2Instrument * k = castModel(); + auto k = castModel(); PatchesDialog pd( this ); diff --git a/plugins/Sfxr/Sfxr.cpp b/plugins/Sfxr/Sfxr.cpp index 605416520..cb5e22c1d 100644 --- a/plugins/Sfxr/Sfxr.cpp +++ b/plugins/Sfxr/Sfxr.cpp @@ -464,7 +464,7 @@ void SfxrInstrument::playNote( NotePlayHandle * _n, sampleFrame * _working_buffe // debug code // qDebug( "pFN %d", pitchedFrameNum ); - sampleFrame * pitchedBuffer = new sampleFrame[pitchedFrameNum]; + auto pitchedBuffer = new sampleFrame[pitchedFrameNum]; static_cast(_n->m_pluginData)->update( pitchedBuffer, pitchedFrameNum ); for( fpp_t i=0; i(); + auto s = castModel(); m_attKnob->setModel( &s->m_attModel ); m_holdKnob->setModel( &s->m_holdModel ); @@ -748,7 +748,7 @@ void SfxrInstrumentView::modelChanged() void SfxrInstrumentView::genPickup() { - SfxrInstrument * s = castModel(); + auto s = castModel(); s->resetModels(); s->m_startFreqModel.setValue( 0.4f+frnd(0.5f) ); s->m_attModel.setValue( 0.0f ); @@ -768,7 +768,7 @@ void SfxrInstrumentView::genPickup() void SfxrInstrumentView::genLaser() { - SfxrInstrument * s = castModel(); + auto s = castModel(); s->resetModels(); s->m_waveFormModel.setValue( rnd(2) ); @@ -827,7 +827,7 @@ void SfxrInstrumentView::genLaser() void SfxrInstrumentView::genExplosion() { - SfxrInstrument * s = castModel(); + auto s = castModel(); s->resetModels(); s->m_waveFormModel.setValue( 3 ); @@ -882,7 +882,7 @@ void SfxrInstrumentView::genExplosion() void SfxrInstrumentView::genPowerup() { - SfxrInstrument * s = castModel(); + auto s = castModel(); s->resetModels(); if(rnd(1)) @@ -916,7 +916,7 @@ void SfxrInstrumentView::genPowerup() void SfxrInstrumentView::genHit() { - SfxrInstrument * s = castModel(); + auto s = castModel(); s->resetModels(); s->m_waveFormModel.setValue( rnd(2) ); @@ -946,7 +946,7 @@ void SfxrInstrumentView::genHit() void SfxrInstrumentView::genJump() { - SfxrInstrument * s = castModel(); + auto s = castModel(); s->resetModels(); s->m_waveFormModel.setValue( 0 ); @@ -976,7 +976,7 @@ void SfxrInstrumentView::genJump() void SfxrInstrumentView::genBlip() { - SfxrInstrument * s = castModel(); + auto s = castModel(); s->resetModels(); s->m_waveFormModel.setValue( rnd(1) ); @@ -998,7 +998,7 @@ void SfxrInstrumentView::genBlip() void SfxrInstrumentView::randomize() { - SfxrInstrument * s = castModel(); + auto s = castModel(); s->m_startFreqModel.setValue( pow(frnd(2.0f)-1.0f, 2.0f) ); if(rnd(1)) @@ -1059,7 +1059,7 @@ void SfxrInstrumentView::randomize() void SfxrInstrumentView::mutate() { - SfxrInstrument * s = castModel(); + auto s = castModel(); if(rnd(1)) s->m_startFreqModel.setValue( s->m_startFreqModel.value()+frnd(0.1f)-0.05f ); // if(rnd(1)) s->m_minFreqModel.setValue( s->m_minFreqModel.value()+frnd(0.1f)-0.05f ); @@ -1099,7 +1099,7 @@ void SfxrInstrumentView::mutate() void SfxrInstrumentView::previewSound() { - SfxrInstrument* s = castModel(); + auto s = castModel(); InstrumentTrack* it = s->instrumentTrack(); it->silenceAllNotes(); it->processInEvent( MidiEvent( MidiNoteOn, 0, it->baseNoteModel()->value(), MidiDefaultVelocity ) ); diff --git a/plugins/Sid/SidInstrument.cpp b/plugins/Sid/SidInstrument.cpp index 16710f4f9..c1a62e0f6 100644 --- a/plugins/Sid/SidInstrument.cpp +++ b/plugins/Sid/SidInstrument.cpp @@ -317,7 +317,7 @@ void SidInstrument::playNote( NotePlayHandle * _n, SID *sid = static_cast( _n->m_pluginData ); int delta_t = clockrate * frames / samplerate + 4; // avoid variable length array for msvc compat - short* buf = reinterpret_cast(_working_buffer + offset); + auto buf = reinterpret_cast(_working_buffer + offset); unsigned char sidreg[NUMSIDREGS]; for (int c = 0; c < NUMSIDREGS; c++) @@ -498,19 +498,19 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, m_cutKnob->setHintText( tr( "Cutoff frequency:" ), " Hz" ); m_cutKnob->move( 7 + 2*28, 64 ); - PixmapButton * hp_btn = new PixmapButton( this, nullptr ); + auto hp_btn = new PixmapButton(this, nullptr); hp_btn->move( 140, 77 ); hp_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "hpred" ) ); hp_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "hp" ) ); hp_btn->setToolTip(tr("High-pass filter ")); - PixmapButton * bp_btn = new PixmapButton( this, nullptr ); + auto bp_btn = new PixmapButton(this, nullptr); bp_btn->move( 164, 77 ); bp_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "bpred" ) ); bp_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "bp" ) ); bp_btn->setToolTip(tr("Band-pass filter ")); - PixmapButton * lp_btn = new PixmapButton( this, nullptr ); + auto lp_btn = new PixmapButton(this, nullptr); lp_btn->move( 185, 77 ); lp_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "lpred" ) ); lp_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "lp" ) ); @@ -528,13 +528,13 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, m_offButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "3off" ) ); m_offButton->setToolTip(tr("Voice 3 off ")); - PixmapButton * mos6581_btn = new PixmapButton( this, nullptr ); + auto mos6581_btn = new PixmapButton(this, nullptr); mos6581_btn->move( 170, 59 ); mos6581_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "6581red" ) ); mos6581_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "6581" ) ); mos6581_btn->setToolTip(tr("MOS6581 SID ")); - PixmapButton * mos8580_btn = new PixmapButton( this, nullptr ); + auto mos8580_btn = new PixmapButton(this, nullptr); mos8580_btn->move( 207, 59 ); mos8580_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "8580red" ) ); mos8580_btn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "8580" ) ); @@ -570,7 +570,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, crsk->setHintText( tr("Coarse:"), " semitones" ); crsk->move( 147, 114 + i*50 ); - PixmapButton * pulse_btn = new PixmapButton( this, nullptr ); + auto pulse_btn = new PixmapButton(this, nullptr); pulse_btn->move( 187, 101 + i*50 ); pulse_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "pulsered" ) ); @@ -578,7 +578,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, PLUGIN_NAME::getIconPixmap( "pulse" ) ); pulse_btn->setToolTip(tr("Pulse wave")); - PixmapButton * triangle_btn = new PixmapButton( this, nullptr ); + auto triangle_btn = new PixmapButton(this, nullptr); triangle_btn->move( 168, 101 + i*50 ); triangle_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "trianglered" ) ); @@ -586,7 +586,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, PLUGIN_NAME::getIconPixmap( "triangle" ) ); triangle_btn->setToolTip(tr("Triangle wave")); - PixmapButton * saw_btn = new PixmapButton( this, nullptr ); + auto saw_btn = new PixmapButton(this, nullptr); saw_btn->move( 207, 101 + i*50 ); saw_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sawred" ) ); @@ -594,7 +594,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, PLUGIN_NAME::getIconPixmap( "saw" ) ); saw_btn->setToolTip(tr("Saw wave")); - PixmapButton * noise_btn = new PixmapButton( this, nullptr ); + auto noise_btn = new PixmapButton(this, nullptr); noise_btn->move( 226, 101 + i*50 ); noise_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "noisered" ) ); @@ -602,15 +602,14 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, PLUGIN_NAME::getIconPixmap( "noise" ) ); noise_btn->setToolTip(tr("Noise")); - automatableButtonGroup * wfbg = - new automatableButtonGroup( this ); + auto wfbg = new automatableButtonGroup(this); wfbg->addButton( pulse_btn ); wfbg->addButton( triangle_btn ); wfbg->addButton( saw_btn ); wfbg->addButton( noise_btn ); - PixmapButton * sync_btn = new PixmapButton( this, nullptr ); + auto sync_btn = new PixmapButton(this, nullptr); sync_btn->setCheckable( true ); sync_btn->move( 207, 134 + i*50 ); sync_btn->setActiveGraphic( @@ -619,7 +618,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, PLUGIN_NAME::getIconPixmap( "sync" ) ); sync_btn->setToolTip(tr("Sync")); - PixmapButton * ringMod_btn = new PixmapButton( this, nullptr ); + auto ringMod_btn = new PixmapButton(this, nullptr); ringMod_btn->setCheckable( true ); ringMod_btn->move( 170, 116 + i*50 ); ringMod_btn->setActiveGraphic( @@ -628,7 +627,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, PLUGIN_NAME::getIconPixmap( "ring" ) ); ringMod_btn->setToolTip(tr("Ring modulation")); - PixmapButton * filter_btn = new PixmapButton( this, nullptr ); + auto filter_btn = new PixmapButton(this, nullptr); filter_btn->setCheckable( true ); filter_btn->move( 207, 116 + i*50 ); filter_btn->setActiveGraphic( @@ -637,7 +636,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, PLUGIN_NAME::getIconPixmap( "filter" ) ); filter_btn->setToolTip(tr("Filtered")); - PixmapButton * test_btn = new PixmapButton( this, nullptr ); + auto test_btn = new PixmapButton(this, nullptr); test_btn->setCheckable( true ); test_btn->move( 170, 134 + i*50 ); test_btn->setActiveGraphic( @@ -654,7 +653,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, void SidInstrumentView::updateKnobHint() { - SidInstrument * k = castModel(); + auto k = castModel(); for( int i = 0; i < 3; ++i ) { @@ -695,7 +694,7 @@ void SidInstrumentView::updateKnobHint() void SidInstrumentView::updateKnobToolTip() { - SidInstrument * k = castModel(); + auto k = castModel(); for( int i = 0; i < 3; ++i ) { m_voiceKnobs[i].m_sustKnob->setToolTip( @@ -715,7 +714,7 @@ void SidInstrumentView::updateKnobToolTip() void SidInstrumentView::modelChanged() { - SidInstrument * k = castModel(); + auto k = castModel(); m_volKnob->setModel( &k->m_volumeModel ); m_resKnob->setModel( &k->m_filterResonanceModel ); diff --git a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp index e8344ead5..4a1cb8a79 100644 --- a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp +++ b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp @@ -52,15 +52,15 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) m_processor(processor) { // Top level placement of sections is handled by QSplitter widget. - QHBoxLayout *master_layout = new QHBoxLayout; - QSplitter *display_splitter = new QSplitter(Qt::Vertical); + auto master_layout = new QHBoxLayout; + auto display_splitter = new QSplitter(Qt::Vertical); master_layout->addWidget(display_splitter); master_layout->setContentsMargins(2, 6, 2, 8); setLayout(master_layout); // Display splitter top: controls section - QWidget *controls_widget = new QWidget; - QHBoxLayout *controls_layout = new QHBoxLayout; + auto controls_widget = new QWidget; + auto controls_layout = new QHBoxLayout; controls_layout->setContentsMargins(0, 0, 0, 0); controls_widget->setLayout(controls_layout); controls_widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); @@ -69,8 +69,8 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) // Basic configuration - QWidget *config_widget = new QWidget; - QGridLayout *config_layout = new QGridLayout; + auto config_widget = new QWidget; + auto config_layout = new QGridLayout; config_widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); config_widget->setMaximumHeight(m_configHeight); config_widget->setLayout(config_layout); @@ -87,10 +87,12 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) // pause and freeze buttons - PixmapButton *pauseButton = new PixmapButton(this, tr("Pause")); + auto pauseButton = new PixmapButton(this, tr("Pause")); pauseButton->setToolTip(tr("Pause data acquisition")); - QPixmap *pauseOnPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("play").scaled(buttonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - QPixmap *pauseOffPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("pause").scaled(buttonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + auto pauseOnPixmap = new QPixmap( + PLUGIN_NAME::getIconPixmap("play").scaled(buttonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + auto pauseOffPixmap = new QPixmap( + PLUGIN_NAME::getIconPixmap("pause").scaled(buttonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); pauseOnPixmap->setDevicePixelRatio(devicePixelRatio()); pauseOffPixmap->setDevicePixelRatio(devicePixelRatio()); pauseButton->setActiveGraphic(*pauseOnPixmap); @@ -99,10 +101,12 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) pauseButton->setModel(&controls->m_pauseModel); config_layout->addWidget(pauseButton, 0, 0, 2, 1, Qt::AlignHCenter); - PixmapButton *refFreezeButton = new PixmapButton(this, tr("Reference freeze")); + auto refFreezeButton = new PixmapButton(this, tr("Reference freeze")); refFreezeButton->setToolTip(tr("Freeze current input as a reference / disable falloff in peak-hold mode.")); - QPixmap *freezeOnPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("freeze").scaled(buttonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - QPixmap *freezeOffPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("freeze_off").scaled(buttonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + auto freezeOnPixmap = new QPixmap( + PLUGIN_NAME::getIconPixmap("freeze").scaled(buttonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + auto freezeOffPixmap = new QPixmap( + PLUGIN_NAME::getIconPixmap("freeze_off").scaled(buttonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); freezeOnPixmap->setDevicePixelRatio(devicePixelRatio()); freezeOffPixmap->setDevicePixelRatio(devicePixelRatio()); refFreezeButton->setActiveGraphic(*freezeOnPixmap); @@ -112,28 +116,28 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) config_layout->addWidget(refFreezeButton, 2, 0, 2, 1, Qt::AlignHCenter); // misc configuration switches - LedCheckBox *waterfallButton = new LedCheckBox(tr("Waterfall"), this); + auto waterfallButton = new LedCheckBox(tr("Waterfall"), this); waterfallButton->setToolTip(tr("Display real-time spectrogram")); waterfallButton->setCheckable(true); waterfallButton->setMinimumSize(70, 12); waterfallButton->setModel(&controls->m_waterfallModel); config_layout->addWidget(waterfallButton, 0, 1); - LedCheckBox *smoothButton = new LedCheckBox(tr("Averaging"), this); + auto smoothButton = new LedCheckBox(tr("Averaging"), this); smoothButton->setToolTip(tr("Enable exponential moving average")); smoothButton->setCheckable(true); smoothButton->setMinimumSize(70, 12); smoothButton->setModel(&controls->m_smoothModel); config_layout->addWidget(smoothButton, 1, 1); - LedCheckBox *stereoButton = new LedCheckBox(tr("Stereo"), this); + auto stereoButton = new LedCheckBox(tr("Stereo"), this); stereoButton->setToolTip(tr("Display stereo channels separately")); stereoButton->setCheckable(true); stereoButton->setMinimumSize(70, 12); stereoButton->setModel(&controls->m_stereoModel); config_layout->addWidget(stereoButton, 2, 1); - LedCheckBox *peakHoldButton = new LedCheckBox(tr("Peak hold"), this); + auto peakHoldButton = new LedCheckBox(tr("Peak hold"), this); peakHoldButton->setToolTip(tr("Display envelope of peak values")); peakHoldButton->setCheckable(true); peakHoldButton->setMinimumSize(70, 12); @@ -141,10 +145,12 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) config_layout->addWidget(peakHoldButton, 3, 1); // frequency: linear / log. switch and range selector - PixmapButton *logXButton = new PixmapButton(this, tr("Logarithmic frequency")); + auto logXButton = new PixmapButton(this, tr("Logarithmic frequency")); logXButton->setToolTip(tr("Switch between logarithmic and linear frequency scale")); - QPixmap *logXOnPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("x_log").scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - QPixmap *logXOffPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("x_linear").scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + auto logXOnPixmap = new QPixmap( + PLUGIN_NAME::getIconPixmap("x_log").scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + auto logXOffPixmap = new QPixmap( + PLUGIN_NAME::getIconPixmap("x_linear").scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); logXOnPixmap->setDevicePixelRatio(devicePixelRatio()); logXOffPixmap->setDevicePixelRatio(devicePixelRatio()); logXButton->setActiveGraphic(*logXOnPixmap); @@ -153,7 +159,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) logXButton->setModel(&controls->m_logXModel); config_layout->addWidget(logXButton, 0, 2, 2, 1, Qt::AlignRight); - ComboBox *freqRangeCombo = new ComboBox(this, tr("Frequency range")); + auto freqRangeCombo = new ComboBox(this, tr("Frequency range")); freqRangeCombo->setToolTip(tr("Frequency range")); freqRangeCombo->setMinimumSize(100, ComboBox::DEFAULT_HEIGHT); freqRangeCombo->setMaximumSize(200, ComboBox::DEFAULT_HEIGHT); @@ -161,10 +167,12 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) config_layout->addWidget(freqRangeCombo, 0, 3, 2, 1); // amplitude: linear / log switch and range selector - PixmapButton *logYButton = new PixmapButton(this, tr("Logarithmic amplitude")); + auto logYButton = new PixmapButton(this, tr("Logarithmic amplitude")); logYButton->setToolTip(tr("Switch between logarithmic and linear amplitude scale")); - QPixmap *logYOnPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("y_log").scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - QPixmap *logYOffPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("y_linear").scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + auto logYOnPixmap = new QPixmap( + PLUGIN_NAME::getIconPixmap("y_log").scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + auto logYOffPixmap = new QPixmap( + PLUGIN_NAME::getIconPixmap("y_linear").scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); logYOnPixmap->setDevicePixelRatio(devicePixelRatio()); logYOffPixmap->setDevicePixelRatio(devicePixelRatio()); logYButton->setActiveGraphic(*logYOnPixmap); @@ -173,7 +181,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) logYButton->setModel(&controls->m_logYModel); config_layout->addWidget(logYButton, 2, 2, 2, 1, Qt::AlignRight); - ComboBox *ampRangeCombo = new ComboBox(this, tr("Amplitude range")); + auto ampRangeCombo = new ComboBox(this, tr("Amplitude range")); ampRangeCombo->setToolTip(tr("Amplitude range")); ampRangeCombo->setMinimumSize(100, ComboBox::DEFAULT_HEIGHT); ampRangeCombo->setMaximumSize(200, ComboBox::DEFAULT_HEIGHT); @@ -181,13 +189,13 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) config_layout->addWidget(ampRangeCombo, 2, 3, 2, 1); // FFT: block size: icon and selector - QLabel *blockSizeLabel = new QLabel("", this); - QPixmap *blockSizeIcon = new QPixmap(PLUGIN_NAME::getIconPixmap("block_size")); + auto blockSizeLabel = new QLabel("", this); + auto blockSizeIcon = new QPixmap(PLUGIN_NAME::getIconPixmap("block_size")); blockSizeIcon->setDevicePixelRatio(devicePixelRatio()); blockSizeLabel->setPixmap(blockSizeIcon->scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); config_layout->addWidget(blockSizeLabel, 0, 4, 2, 1, Qt::AlignRight); - ComboBox *blockSizeCombo = new ComboBox(this, tr("FFT block size")); + auto blockSizeCombo = new ComboBox(this, tr("FFT block size")); blockSizeCombo->setToolTip(tr("FFT block size")); blockSizeCombo->setMinimumSize(100, 22); blockSizeCombo->setMaximumSize(200, 22); @@ -197,13 +205,13 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) connect(&controls->m_blockSizeModel, &ComboBoxModel::dataChanged, [=] {processor->reallocateBuffers();}); // FFT: window type: icon and selector - QLabel *windowLabel = new QLabel("", this); - QPixmap *windowIcon = new QPixmap(PLUGIN_NAME::getIconPixmap("window")); + auto windowLabel = new QLabel("", this); + auto windowIcon = new QPixmap(PLUGIN_NAME::getIconPixmap("window")); windowIcon->setDevicePixelRatio(devicePixelRatio()); windowLabel->setPixmap(windowIcon->scaled(iconSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); config_layout->addWidget(windowLabel, 2, 4, 2, 1, Qt::AlignRight); - ComboBox *windowCombo = new ComboBox(this, tr("FFT window type")); + auto windowCombo = new ComboBox(this, tr("FFT window type")); windowCombo->setToolTip(tr("FFT window type")); windowCombo->setMinimumSize(100, ComboBox::DEFAULT_HEIGHT); windowCombo->setMaximumSize(200, ComboBox::DEFAULT_HEIGHT); @@ -218,8 +226,8 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) // Advanced configuration - QWidget *advanced_widget = new QWidget; - QGridLayout *advanced_layout = new QGridLayout; + auto advanced_widget = new QWidget; + auto advanced_layout = new QGridLayout; advanced_widget->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); advanced_widget->setMaximumHeight(m_configHeight); advanced_widget->setLayout(advanced_layout); @@ -228,7 +236,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) controls_layout->setStretchFactor(advanced_widget, 10); // Peak envelope resolution - Knob *envelopeResolutionKnob = new Knob(knobSmall_17, this); + auto envelopeResolutionKnob = new Knob(knobSmall_17, this); envelopeResolutionKnob->setModel(&controls->m_envelopeResolutionModel); envelopeResolutionKnob->setLabel(tr("Envelope res.")); envelopeResolutionKnob->setToolTip(tr("Increase envelope resolution for better details, decrease for better GUI performance.")); @@ -236,7 +244,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) advanced_layout->addWidget(envelopeResolutionKnob, 0, 0, 1, 1, Qt::AlignCenter); // Spectrum graph resolution - Knob *spectrumResolutionKnob = new Knob(knobSmall_17, this); + auto spectrumResolutionKnob = new Knob(knobSmall_17, this); spectrumResolutionKnob->setModel(&controls->m_spectrumResolutionModel); spectrumResolutionKnob->setLabel(tr("Spectrum res.")); spectrumResolutionKnob->setToolTip(tr("Increase spectrum resolution for better details, decrease for better GUI performance.")); @@ -244,7 +252,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) advanced_layout->addWidget(spectrumResolutionKnob, 1, 0, 1, 1, Qt::AlignCenter); // Peak falloff speed - Knob *peakDecayFactorKnob = new Knob(knobSmall_17, this); + auto peakDecayFactorKnob = new Knob(knobSmall_17, this); peakDecayFactorKnob->setModel(&controls->m_peakDecayFactorModel); peakDecayFactorKnob->setLabel(tr("Falloff factor")); peakDecayFactorKnob->setToolTip(tr("Decrease to make peaks fall faster.")); @@ -252,7 +260,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) advanced_layout->addWidget(peakDecayFactorKnob, 0, 1, 1, 1, Qt::AlignCenter); // Averaging weight - Knob *averagingWeightKnob = new Knob(knobSmall_17, this); + auto averagingWeightKnob = new Knob(knobSmall_17, this); averagingWeightKnob->setModel(&controls->m_averagingWeightModel); averagingWeightKnob->setLabel(tr("Averaging weight")); averagingWeightKnob->setToolTip(tr("Decrease to make averaging slower and smoother.")); @@ -260,7 +268,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) advanced_layout->addWidget(averagingWeightKnob, 1, 1, 1, 1, Qt::AlignCenter); // Waterfall history size - Knob *waterfallHeightKnob = new Knob(knobSmall_17, this); + auto waterfallHeightKnob = new Knob(knobSmall_17, this); waterfallHeightKnob->setModel(&controls->m_waterfallHeightModel); waterfallHeightKnob->setLabel(tr("Waterfall height")); waterfallHeightKnob->setToolTip(tr("Increase to get slower scrolling, decrease to see fast transitions better. Warning: medium CPU usage.")); @@ -270,7 +278,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) connect(&controls->m_waterfallHeightModel, &FloatModel::dataChanged, [=] {processor->reallocateBuffers();}); // Waterfall gamma correction - Knob *waterfallGammaKnob = new Knob(knobSmall_17, this); + auto waterfallGammaKnob = new Knob(knobSmall_17, this); waterfallGammaKnob->setModel(&controls->m_waterfallGammaModel); waterfallGammaKnob->setLabel(tr("Waterfall gamma")); waterfallGammaKnob->setToolTip(tr("Decrease to see very weak signals, increase to get better contrast.")); @@ -278,7 +286,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) advanced_layout->addWidget(waterfallGammaKnob, 1, 2, 1, 1, Qt::AlignCenter); // FFT window overlap - Knob *windowOverlapKnob = new Knob(knobSmall_17, this); + auto windowOverlapKnob = new Knob(knobSmall_17, this); windowOverlapKnob->setModel(&controls->m_windowOverlapModel); windowOverlapKnob->setLabel(tr("Window overlap")); windowOverlapKnob->setToolTip(tr("Increase to prevent missing fast transitions arriving near FFT window edges. Warning: high CPU usage.")); @@ -286,7 +294,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) advanced_layout->addWidget(windowOverlapKnob, 0, 3, 1, 1, Qt::AlignCenter); // FFT zero padding - Knob *zeroPaddingKnob = new Knob(knobSmall_17, this); + auto zeroPaddingKnob = new Knob(knobSmall_17, this); zeroPaddingKnob->setModel(&controls->m_zeroPaddingModel); zeroPaddingKnob->setLabel(tr("Zero padding")); zeroPaddingKnob->setToolTip(tr("Increase to get smoother-looking spectrum. Warning: high CPU usage.")); @@ -297,10 +305,12 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) // Advanced settings button - PixmapButton *advancedButton = new PixmapButton(this, tr("Advanced settings")); + auto advancedButton = new PixmapButton(this, tr("Advanced settings")); advancedButton->setToolTip(tr("Access advanced settings")); - QPixmap *advancedOnPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("advanced_on").scaled(advButtonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); - QPixmap *advancedOffPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("advanced_off").scaled(advButtonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + auto advancedOnPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("advanced_on") + .scaled(advButtonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + auto advancedOffPixmap = new QPixmap(PLUGIN_NAME::getIconPixmap("advanced_off") + .scaled(advButtonSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); advancedOnPixmap->setDevicePixelRatio(devicePixelRatio()); advancedOffPixmap->setDevicePixelRatio(devicePixelRatio()); advancedButton->setActiveGraphic(*advancedOnPixmap); diff --git a/plugins/SpectrumAnalyzer/SaProcessor.cpp b/plugins/SpectrumAnalyzer/SaProcessor.cpp index 02fd3d770..d7a1dd5fb 100644 --- a/plugins/SpectrumAnalyzer/SaProcessor.cpp +++ b/plugins/SpectrumAnalyzer/SaProcessor.cpp @@ -199,7 +199,7 @@ void SaProcessor::analyze(LocklessRingBuffer &ring_buffer) if (m_waterfallActive && m_waterfallNotEmpty) { // move waterfall history one line down and clear the top line - QRgb *pixel = (QRgb *)m_history_work.data(); + auto pixel = (QRgb*)m_history_work.data(); std::copy(pixel, pixel + waterfallWidth() * m_waterfallHeight - waterfallWidth(), pixel + waterfallWidth()); diff --git a/plugins/StereoEnhancer/StereoEnhancerControlDialog.cpp b/plugins/StereoEnhancer/StereoEnhancerControlDialog.cpp index f024ab33f..3f7841706 100644 --- a/plugins/StereoEnhancer/StereoEnhancerControlDialog.cpp +++ b/plugins/StereoEnhancer/StereoEnhancerControlDialog.cpp @@ -38,9 +38,9 @@ StereoEnhancerControlDialog::StereoEnhancerControlDialog( StereoEnhancerControls * _controls ) : EffectControlDialog( _controls ) { - QHBoxLayout * l = new QHBoxLayout( this ); + auto l = new QHBoxLayout(this); - Knob * widthKnob = new Knob( knobBright_26, this ); + auto widthKnob = new Knob(knobBright_26, this); widthKnob->setModel( &_controls->m_widthModel ); widthKnob->setLabel( tr( "WIDTH" ) ); widthKnob->setHintText( tr( "Width:" ) , " samples" ); diff --git a/plugins/StereoMatrix/StereoMatrixControlDialog.cpp b/plugins/StereoMatrix/StereoMatrixControlDialog.cpp index 5bf62b9ce..06ff2a03b 100644 --- a/plugins/StereoMatrix/StereoMatrixControlDialog.cpp +++ b/plugins/StereoMatrix/StereoMatrixControlDialog.cpp @@ -48,23 +48,22 @@ StereoMatrixControlDialog::StereoMatrixControlDialog( PLUGIN_NAME::getIconPixmap( "artwork" ) ); setPalette( pal ); - - Knob * llKnob = new Knob( knobBright_26, this ); + auto llKnob = new Knob(knobBright_26, this); llKnob->setModel( &_controls->m_llModel ); llKnob->setHintText( tr( "Left to Left Vol:" ) , "" ); llKnob->move( 10, 79 ); - Knob * lrKnob = new Knob( knobBright_26, this ); + auto lrKnob = new Knob(knobBright_26, this); lrKnob->setModel( &_controls->m_lrModel ); lrKnob->setHintText( tr( "Left to Right Vol:" ) , "" ); lrKnob->move( 48, 79 ); - Knob * rlKnob = new Knob( knobBright_26, this ); + auto rlKnob = new Knob(knobBright_26, this); rlKnob->setModel( &_controls->m_rlModel ); rlKnob->setHintText( tr( "Right to Left Vol:" ) , "" ); rlKnob->move( 85, 79 ); - Knob * rrKnob = new Knob( knobBright_26, this ); + auto rrKnob = new Knob(knobBright_26, this); rrKnob->setModel( &_controls->m_rrModel ); rrKnob->setHintText( tr( "Right to Right Vol:" ) , "" ); rrKnob->move( 123, 79 ); diff --git a/plugins/Stk/Mallets/Mallets.cpp b/plugins/Stk/Mallets/Mallets.cpp index 6dcd8f563..0de1a8550 100644 --- a/plugins/Stk/Mallets/Mallets.cpp +++ b/plugins/Stk/Mallets/Mallets.cpp @@ -342,7 +342,7 @@ void MalletsInstrument::playNote( NotePlayHandle * _n, const fpp_t frames = _n->framesLeftForCurrentPeriod(); const f_cnt_t offset = _n->noteOffset(); - MalletsSynth * ps = static_cast( _n->m_pluginData ); + auto ps = static_cast(_n->m_pluginData); ps->setFrequency( freq ); p = ps->presetIndex(); @@ -442,7 +442,7 @@ void MalletsInstrumentView::setWidgetBackground( QWidget * _widget, const QStrin QWidget * MalletsInstrumentView::setupModalBarControls( QWidget * _parent ) { - QWidget * widget = new QWidget( _parent ); + auto widget = new QWidget(_parent); widget->setFixedSize( 250, 250 ); m_hardnessKnob = new Knob( knobVintage_32, widget ); @@ -478,7 +478,7 @@ QWidget * MalletsInstrumentView::setupModalBarControls( QWidget * _parent ) QWidget * MalletsInstrumentView::setupTubeBellControls( QWidget * _parent ) { - QWidget * widget = new QWidget( _parent ); + auto widget = new QWidget(_parent); widget->setFixedSize( 250, 250 ); m_modulatorKnob = new Knob( knobVintage_32, widget ); @@ -515,7 +515,7 @@ QWidget * MalletsInstrumentView::setupTubeBellControls( QWidget * _parent ) QWidget * MalletsInstrumentView::setupBandedWGControls( QWidget * _parent ) { // BandedWG - QWidget * widget = new QWidget( _parent ); + auto widget = new QWidget(_parent); widget->setFixedSize( 250, 250 ); /* m_strikeLED = new LedCheckBox( tr( "Bowed" ), widget ); @@ -549,7 +549,7 @@ QWidget * MalletsInstrumentView::setupBandedWGControls( QWidget * _parent ) void MalletsInstrumentView::modelChanged() { - MalletsInstrument * inst = castModel(); + auto inst = castModel(); m_hardnessKnob->setModel( &inst->m_hardnessModel ); m_positionKnob->setModel( &inst->m_positionModel ); m_vibratoGainKnob->setModel( &inst->m_vibratoGainModel ); @@ -574,7 +574,7 @@ void MalletsInstrumentView::modelChanged() void MalletsInstrumentView::changePreset() { - MalletsInstrument * inst = castModel(); + auto inst = castModel(); int _preset = inst->m_presetsModel.value(); if( _preset < 9 ) diff --git a/plugins/TripleOscillator/TripleOscillator.cpp b/plugins/TripleOscillator/TripleOscillator.cpp index 5a3a6d1dc..78a43a376 100644 --- a/plugins/TripleOscillator/TripleOscillator.cpp +++ b/plugins/TripleOscillator/TripleOscillator.cpp @@ -452,7 +452,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, const int osc_h = 52; // TODO: clean rewrite using layouts and all that... - PixmapButton * pm_osc1_btn = new PixmapButton( this, nullptr ); + auto pm_osc1_btn = new PixmapButton(this, nullptr); pm_osc1_btn->move( mod_x, mod1_y ); pm_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "pm_active" ) ); @@ -460,7 +460,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, "pm_inactive" ) ); pm_osc1_btn->setToolTip(tr("Modulate phase of oscillator 1 by oscillator 2")); - PixmapButton * am_osc1_btn = new PixmapButton( this, nullptr ); + auto am_osc1_btn = new PixmapButton(this, nullptr); am_osc1_btn->move( mod_x + 35, mod1_y ); am_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "am_active" ) ); @@ -468,7 +468,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, "am_inactive" ) ); am_osc1_btn->setToolTip(tr("Modulate amplitude of oscillator 1 by oscillator 2")); - PixmapButton * mix_osc1_btn = new PixmapButton( this, nullptr ); + auto mix_osc1_btn = new PixmapButton(this, nullptr); mix_osc1_btn->move( mod_x + 70, mod1_y ); mix_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_active" ) ); @@ -476,7 +476,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, "mix_inactive" ) ); mix_osc1_btn->setToolTip(tr("Mix output of oscillators 1 & 2")); - PixmapButton * sync_osc1_btn = new PixmapButton( this, nullptr ); + auto sync_osc1_btn = new PixmapButton(this, nullptr); sync_osc1_btn->move( mod_x + 105, mod1_y ); sync_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sync_active" ) ); @@ -485,7 +485,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, sync_osc1_btn->setToolTip(tr("Synchronize oscillator 1 with " "oscillator 2" ) ); - PixmapButton * fm_osc1_btn = new PixmapButton( this, nullptr ); + auto fm_osc1_btn = new PixmapButton(this, nullptr); fm_osc1_btn->move( mod_x + 140, mod1_y ); fm_osc1_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_active" ) ); @@ -500,9 +500,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, m_mod1BtnGrp->addButton( sync_osc1_btn ); m_mod1BtnGrp->addButton( fm_osc1_btn ); - - - PixmapButton * pm_osc2_btn = new PixmapButton( this, nullptr ); + auto pm_osc2_btn = new PixmapButton(this, nullptr); pm_osc2_btn->move( mod_x, mod2_y ); pm_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "pm_active" ) ); @@ -510,7 +508,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, "pm_inactive" ) ); pm_osc2_btn->setToolTip(tr("Modulate phase of oscillator 2 by oscillator 3")); - PixmapButton * am_osc2_btn = new PixmapButton( this, nullptr ); + auto am_osc2_btn = new PixmapButton(this, nullptr); am_osc2_btn->move( mod_x + 35, mod2_y ); am_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "am_active" ) ); @@ -518,7 +516,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, "am_inactive" ) ); am_osc2_btn->setToolTip(tr("Modulate amplitude of oscillator 2 by oscillator 3")); - PixmapButton * mix_osc2_btn = new PixmapButton( this, nullptr ); + auto mix_osc2_btn = new PixmapButton(this, nullptr); mix_osc2_btn->move( mod_x + 70, mod2_y ); mix_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "mix_active" ) ); @@ -526,7 +524,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, "mix_inactive" ) ); mix_osc2_btn->setToolTip(tr("Mix output of oscillators 2 & 3")); - PixmapButton * sync_osc2_btn = new PixmapButton( this, nullptr ); + auto sync_osc2_btn = new PixmapButton(this, nullptr); sync_osc2_btn->move( mod_x + 105, mod2_y ); sync_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sync_active" ) ); @@ -534,7 +532,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, "sync_inactive" ) ); sync_osc2_btn->setToolTip(tr("Synchronize oscillator 2 with oscillator 3")); - PixmapButton * fm_osc2_btn = new PixmapButton( this, nullptr ); + auto fm_osc2_btn = new PixmapButton(this, nullptr); fm_osc2_btn->move( mod_x + 140, mod2_y ); fm_osc2_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "fm_active" ) ); @@ -556,7 +554,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, int knob_y = osc_y + i * osc_h; // setup volume-knob - Knob * vk = new Knob( knobStyled, this ); + auto vk = new Knob(knobStyled, this); vk->setVolumeKnob( true ); vk->setFixedSize( 28, 35 ); vk->move( 6, knob_y ); @@ -604,7 +602,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, int btn_y = 96 + i * osc_h; - PixmapButton * sin_wave_btn = new PixmapButton( this, nullptr ); + auto sin_wave_btn = new PixmapButton(this, nullptr); sin_wave_btn->move( 128, btn_y ); sin_wave_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sin_shape_active" ) ); @@ -613,8 +611,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, sin_wave_btn->setToolTip( tr( "Sine wave" ) ); - PixmapButton * triangle_wave_btn = - new PixmapButton( this, nullptr ); + auto triangle_wave_btn = new PixmapButton(this, nullptr); triangle_wave_btn->move( 143, btn_y ); triangle_wave_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "triangle_shape_active" ) ); @@ -623,7 +620,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, triangle_wave_btn->setToolTip( tr( "Triangle wave") ); - PixmapButton * saw_wave_btn = new PixmapButton( this, nullptr ); + auto saw_wave_btn = new PixmapButton(this, nullptr); saw_wave_btn->move( 158, btn_y ); saw_wave_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "saw_shape_active" ) ); @@ -632,7 +629,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, saw_wave_btn->setToolTip( tr( "Saw wave" ) ); - PixmapButton * sqr_wave_btn = new PixmapButton( this, nullptr ); + auto sqr_wave_btn = new PixmapButton(this, nullptr); sqr_wave_btn->move( 173, btn_y ); sqr_wave_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "square_shape_active" ) ); @@ -641,8 +638,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, sqr_wave_btn->setToolTip( tr( "Square wave" ) ); - PixmapButton * moog_saw_wave_btn = - new PixmapButton( this, nullptr ); + auto moog_saw_wave_btn = new PixmapButton(this, nullptr); moog_saw_wave_btn->move( 188, btn_y ); moog_saw_wave_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "moog_saw_shape_active" ) ); @@ -651,7 +647,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, moog_saw_wave_btn->setToolTip( tr( "Moog-like saw wave" ) ); - PixmapButton * exp_wave_btn = new PixmapButton( this, nullptr ); + auto exp_wave_btn = new PixmapButton(this, nullptr); exp_wave_btn->move( 203, btn_y ); exp_wave_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "exp_shape_active" ) ); @@ -660,7 +656,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, exp_wave_btn->setToolTip( tr( "Exponential wave" ) ); - PixmapButton * white_noise_btn = new PixmapButton( this, nullptr ); + auto white_noise_btn = new PixmapButton(this, nullptr); white_noise_btn->move( 218, btn_y ); white_noise_btn->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "white_noise_shape_active" ) ); @@ -669,7 +665,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, white_noise_btn->setToolTip( tr( "White noise" ) ); - PixmapButton * uwb = new PixmapButton( this, nullptr ); + auto uwb = new PixmapButton(this, nullptr); uwb->move( 233, btn_y ); uwb->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "usr_shape_active" ) ); @@ -677,7 +673,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, "usr_shape_inactive" ) ); uwb->setToolTip(tr("User-defined wave")); - PixmapButton * uwt = new PixmapButton( this, nullptr ); + auto uwt = new PixmapButton(this, nullptr); uwt->move( 110, btn_y ); uwt->setActiveGraphic( PLUGIN_NAME::getIconPixmap( "wavetable_active" ) ); @@ -686,8 +682,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, uwt->setCheckable(true); uwt->setToolTip(tr("Use alias-free wavetable oscillators.")); - automatableButtonGroup * wsbg = - new automatableButtonGroup( this ); + auto wsbg = new automatableButtonGroup(this); wsbg->addButton( sin_wave_btn ); wsbg->addButton( triangle_wave_btn ); @@ -709,7 +704,7 @@ TripleOscillatorView::TripleOscillatorView( Instrument * _instrument, void TripleOscillatorView::modelChanged() { - TripleOscillator * t = castModel(); + auto t = castModel(); m_mod1BtnGrp->setModel( &t->m_osc[0]->m_modulationAlgoModel ); m_mod2BtnGrp->setModel( &t->m_osc[1]->m_modulationAlgoModel ); diff --git a/plugins/Vectorscope/VecControlsDialog.cpp b/plugins/Vectorscope/VecControlsDialog.cpp index 72b072823..97898fe70 100644 --- a/plugins/Vectorscope/VecControlsDialog.cpp +++ b/plugins/Vectorscope/VecControlsDialog.cpp @@ -43,25 +43,25 @@ VecControlsDialog::VecControlsDialog(VecControls *controls) : EffectControlDialog(controls), m_controls(controls) { - QVBoxLayout *master_layout = new QVBoxLayout; + auto master_layout = new QVBoxLayout; master_layout->setContentsMargins(0, 2, 0, 0); setLayout(master_layout); // Visualizer widget // The size of 768 pixels seems to offer a good balance of speed, accuracy and trace thickness. - VectorView *display = new VectorView(controls, m_controls->m_effect->getBuffer(), 768, this); + auto display = new VectorView(controls, m_controls->m_effect->getBuffer(), 768, this); master_layout->addWidget(display); // Config area located inside visualizer - QVBoxLayout *internal_layout = new QVBoxLayout(display); - QHBoxLayout *config_layout = new QHBoxLayout(); - QVBoxLayout *switch_layout = new QVBoxLayout(); + auto internal_layout = new QVBoxLayout(display); + auto config_layout = new QHBoxLayout(); + auto switch_layout = new QVBoxLayout(); internal_layout->addStretch(); internal_layout->addLayout(config_layout); config_layout->addLayout(switch_layout); // High-quality switch - LedCheckBox *highQualityButton = new LedCheckBox(tr("HQ"), this); + auto highQualityButton = new LedCheckBox(tr("HQ"), this); highQualityButton->setToolTip(tr("Double the resolution and simulate continuous analog-like trace.")); highQualityButton->setCheckable(true); highQualityButton->setMinimumSize(70, 12); @@ -69,7 +69,7 @@ VecControlsDialog::VecControlsDialog(VecControls *controls) : switch_layout->addWidget(highQualityButton); // Log. scale switch - LedCheckBox *logarithmicButton = new LedCheckBox(tr("Log. scale"), this); + auto logarithmicButton = new LedCheckBox(tr("Log. scale"), this); logarithmicButton->setToolTip(tr("Display amplitude on logarithmic scale to better see small values.")); logarithmicButton->setCheckable(true); logarithmicButton->setMinimumSize(70, 12); @@ -79,7 +79,7 @@ VecControlsDialog::VecControlsDialog(VecControls *controls) : config_layout->addStretch(); // Persistence knob - Knob *persistenceKnob = new Knob(knobSmall_17, this); + auto persistenceKnob = new Knob(knobSmall_17, this); persistenceKnob->setModel(&controls->m_persistenceModel); persistenceKnob->setLabel(tr("Persist.")); persistenceKnob->setToolTip(tr("Trace persistence: higher amount means the trace will stay bright for longer time.")); diff --git a/plugins/Vectorscope/VectorView.cpp b/plugins/Vectorscope/VectorView.cpp index ed57f64a4..f856f6429 100644 --- a/plugins/Vectorscope/VectorView.cpp +++ b/plugins/Vectorscope/VectorView.cpp @@ -307,7 +307,7 @@ void VectorView::periodicUpdate() // More of an Easter egg, to avoid cluttering the interface with non-essential functionality. void VectorView::mouseDoubleClickEvent(QMouseEvent *event) { - ColorChooser *colorDialog = new ColorChooser(m_controls->m_colorFG, this); + auto colorDialog = new ColorChooser(m_controls->m_colorFG, this); if (colorDialog->exec()) { m_controls->m_colorFG = colorDialog->currentColor(); diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index 7441370ec..593712c14 100644 --- a/plugins/Vestige/Vestige.cpp +++ b/plugins/Vestige/Vestige.cpp @@ -161,7 +161,7 @@ VestigeInstrument::VestigeInstrument( InstrumentTrack * _instrument_track ) : p_subWindow( nullptr ) { // now we need a play-handle which cares for calling play() - InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrument_track ); + auto iph = new InstrumentPlayHandle(this, _instrument_track); Engine::audioEngine()->addPlayHandle( iph ); connect( ConfigManager::inst(), SIGNAL( valueChanged(QString,QString,QString) ), @@ -588,7 +588,7 @@ VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument, m_selPresetButton = new QPushButton( tr( "" ), this ); m_selPresetButton->setGeometry( 228, 201, 16, 16 ); - QMenu *menu = new QMenu; + auto menu = new QMenu; connect( menu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); @@ -605,8 +605,9 @@ VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument, connect( m_toggleGUIButton, SIGNAL( clicked() ), this, SLOT( toggleGUI() ) ); - QPushButton * note_off_all_btn = new QPushButton( tr( "Turn off all " - "notes" ), this ); + auto note_off_all_btn = new QPushButton(tr("Turn off all " + "notes"), + this); note_off_all_btn->setGeometry( 20, 160, 200, 24 ); note_off_all_btn->setIcon( embed::getIconPixmap( "stop" ) ); note_off_all_btn->setFont( pointSize<8>( note_off_all_btn->font() ) ); @@ -797,14 +798,13 @@ void VestigeInstrumentView::previousProgram() void VestigeInstrumentView::selPreset( void ) { - - QAction *action = qobject_cast(sender()); - if (action) - if ( m_vi->m_plugin != nullptr ) { + auto action = qobject_cast(sender()); + if (action && m_vi->m_plugin != nullptr) + { lastPosInMenu = action->data().toInt(); - m_vi->m_plugin->setProgram( action->data().toInt() ); + m_vi->m_plugin->setProgram(action->data().toInt()); QWidget::update(); - } + } } diff --git a/plugins/Vibed/Vibed.cpp b/plugins/Vibed/Vibed.cpp index 7d0c34e55..9f119aa6e 100644 --- a/plugins/Vibed/Vibed.cpp +++ b/plugins/Vibed/Vibed.cpp @@ -301,8 +301,7 @@ void Vibed::playNote( NotePlayHandle * _n, sampleFrame * _working_buffer ) const fpp_t frames = _n->framesLeftForCurrentPeriod(); const f_cnt_t offset = _n->noteOffset(); - StringContainer * ps = static_cast( - _n->m_pluginData ); + auto ps = static_cast(_n->m_pluginData); for( fpp_t i = offset; i < frames + offset; ++i ) { @@ -583,8 +582,8 @@ void VibedView::modelChanged() void VibedView::showString( int _string ) { - Vibed * v = castModel(); - + auto v = castModel(); + m_pickKnob->setModel( v->m_pickKnobs[_string] ); m_pickupKnob->setModel( v->m_pickupKnobs[_string] ); m_stiffnessKnob->setModel( v->m_stiffnessKnobs[_string] ); diff --git a/plugins/Vibed/VibratingString.cpp b/plugins/Vibed/VibratingString.cpp index 4a9e740fb..e33ef0582 100644 --- a/plugins/Vibed/VibratingString.cpp +++ b/plugins/Vibed/VibratingString.cpp @@ -95,7 +95,7 @@ VibratingString::VibratingString( float _pitch, VibratingString::delayLine * VibratingString::initDelayLine( int _len, int _pick ) { - delayLine * dl = new VibratingString::delayLine[_len]; + auto dl = new VibratingString::delayLine[_len]; dl->length = _len; if( _len > 0 ) { diff --git a/plugins/VstBase/RemoteVstPlugin.cpp b/plugins/VstBase/RemoteVstPlugin.cpp index 2b035eca7..aaa88f6c8 100644 --- a/plugins/VstBase/RemoteVstPlugin.cpp +++ b/plugins/VstBase/RemoteVstPlugin.cpp @@ -1048,7 +1048,7 @@ void RemoteVstPlugin::process( const sampleFrame * _in, sampleFrame * _out ) return a.deltaFrames < b.deltaFrames; } ); - VstEvents* events = (VstEvents *) eventsBuffer; + auto events = (VstEvents*)eventsBuffer; events->reserved = 0; events->numEvents = m_midiEvents.size(); @@ -1425,7 +1425,7 @@ struct sBank void RemoteVstPlugin::savePreset( const std::string & _file ) { unsigned int chunk_size = 0; - sBank * pBank = ( sBank* ) new char[ sizeof( sBank ) ]; + auto pBank = (sBank*)new char[sizeof(sBank)]; char progName[ 128 ] = { 0 }; char* data = nullptr; const bool chunky = ( m_plugin->flags & ( 1 << 5 ) ) != 0; @@ -1444,11 +1444,11 @@ void RemoteVstPlugin::savePreset( const std::string & _file ) if (isPreset) { chunk_size = m_plugin->numParams * sizeof( float ); data = new char[ chunk_size ]; - unsigned int* toUIntArray = reinterpret_cast( data ); + auto toUIntArray = reinterpret_cast(data); for ( int i = 0; i < m_plugin->numParams; i++ ) { float value = m_plugin->getParameter( m_plugin, i ); - unsigned int * pValue = ( unsigned int * ) &value; + auto pValue = (unsigned int*)&value; toUIntArray[ i ] = endian_swap( *pValue ); } } else chunk_size = (((m_plugin->numParams * sizeof( float )) + 56)*m_plugin->numPrograms); @@ -1463,7 +1463,7 @@ void RemoteVstPlugin::savePreset( const std::string & _file ) if (!isPreset &&!chunky) pBank->fxMagic = 0x6B427846; pBank->version = 0x01000000; - unsigned int uIntToFile = (unsigned int) m_plugin->uniqueID; + auto uIntToFile = (unsigned int)m_plugin->uniqueID; pBank->fxID = endian_swap( uIntToFile ); uIntToFile = (unsigned int) pluginVersion(); pBank->fxVersion = endian_swap( uIntToFile ); @@ -1526,9 +1526,9 @@ void RemoteVstPlugin::savePreset( const std::string & _file ) void RemoteVstPlugin::loadPresetFile( const std::string & _file ) { void * chunk = nullptr; - unsigned int * pLen = new unsigned int[ 1 ]; + auto pLen = new unsigned int[1]; unsigned int len = 0; - sBank * pBank = (sBank*) new char[ sizeof( sBank ) ]; + auto pBank = (sBank*)new char[sizeof(sBank)]; FILE * stream = F_OPEN_UTF8( _file, "rb" ); if (!stream) { @@ -1580,7 +1580,7 @@ void RemoteVstPlugin::loadPresetFile( const std::string & _file ) pluginDispatch( 24, 1, len, chunk ); else { - unsigned int* toUIntArray = reinterpret_cast( chunk ); + auto toUIntArray = reinterpret_cast(chunk); for (int i = 0; i < pBank->numPrograms; i++ ) { toUInt = endian_swap( toUIntArray[ i ] ); @@ -1634,7 +1634,7 @@ void RemoteVstPlugin::loadPresetFile( const std::string & _file ) void RemoteVstPlugin::loadChunkFromFile( const std::string & _file, int _len ) { - char * chunk = new char[_len]; + auto chunk = new char[_len]; FILE* fp = F_OPEN_UTF8( _file, "rb" ); if (!fp) diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index 46d2057dd..a7001da68 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -791,7 +791,7 @@ void VstPlugin::createUI( QWidget * parent ) { parent->setAttribute(Qt::WA_NativeWindow); } - QX11EmbedContainer * embedContainer = new QX11EmbedContainer( parent ); + auto embedContainer = new QX11EmbedContainer(parent); connect(embedContainer, SIGNAL(clientIsEmbedded()), this, SLOT(handleClientEmbed())); embedContainer->embedClient( m_pluginWindowID ); container = embedContainer; diff --git a/plugins/VstEffect/VstEffectControlDialog.cpp b/plugins/VstEffect/VstEffectControlDialog.cpp index ba7d58ffa..52160af57 100644 --- a/plugins/VstEffect/VstEffectControlDialog.cpp +++ b/plugins/VstEffect/VstEffectControlDialog.cpp @@ -48,7 +48,7 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) : m_plugin( nullptr ), tbLabel( nullptr ) { - QGridLayout * l = new QGridLayout( this ); + auto l = new QGridLayout(this); l->setContentsMargins( 10, 10, 10, 10 ); l->setVerticalSpacing( 2 ); l->setHorizontalSpacing( 2 ); @@ -73,7 +73,7 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) : { setWindowTitle( m_plugin->name() ); - QPushButton * btn = new QPushButton( tr( "Show/hide" )); + auto btn = new QPushButton(tr("Show/hide")); if (embed_vst) { btn->setCheckable( true ); @@ -173,7 +173,7 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) : _ctl->m_selPresetButton->setCursor( Qt::PointingHandCursor ); _ctl->m_selPresetButton->setIcon( embed::getIconPixmap( "stepper-down" ) ); - QMenu * menu = new QMenu; + auto menu = new QMenu; connect( menu, SIGNAL( aboutToShow() ), _ctl, SLOT( updateMenu() ) ); _ctl->m_selPresetButton->setMenu(menu); @@ -206,11 +206,11 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) : } newSize = std::max(newSize, 250); - QWidget* resize = new QWidget(this); + auto resize = new QWidget(this); resize->resize( newSize, 10 ); - QWidget* space0 = new QWidget(this); + auto space0 = new QWidget(this); space0->resize(8, 10); - QWidget* space1 = new QWidget(this); + auto space1 = new QWidget(this); space1->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); QFont f( "Arial", 10 ); @@ -223,7 +223,7 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) : l->setRowStretch( 5, 1 ); l->setColumnStretch( 1, 1 ); - QToolBar * tb = new QToolBar( this ); + auto tb = new QToolBar(this); tb->resize( newSize , 32 ); tb->addWidget(space0); tb->addWidget( m_rolLPresetButton ); diff --git a/plugins/VstEffect/VstEffectControls.cpp b/plugins/VstEffect/VstEffectControls.cpp index 10294b4c2..f35a1c00d 100644 --- a/plugins/VstEffect/VstEffectControls.cpp +++ b/plugins/VstEffect/VstEffectControls.cpp @@ -170,7 +170,7 @@ gui::EffectControlDialog* VstEffectControls::createView() void VstEffectControls::managePlugin() { if ( m_effect->m_plugin != nullptr && m_subWindow == nullptr ) { - gui::ManageVSTEffectView * tt = new gui::ManageVSTEffectView( m_effect, this); + auto tt = new gui::ManageVSTEffectView(m_effect, this); ctrHandle = (QObject *)tt; } else if (m_subWindow != nullptr) { if (m_subWindow->widget()->isVisible() == false ) { @@ -221,8 +221,8 @@ void VstEffectControls::updateMenu() to_menu->clear(); for (int i = 0; i < list1.size(); i++) { - QAction* presetAction = new QAction(this); - connect(presetAction, SIGNAL(triggered()), this, SLOT(selPreset())); + auto presetAction = new QAction(this); + connect(presetAction, SIGNAL(triggered()), this, SLOT(selPreset())); presetAction->setText(QString("%1. %2").arg(QString::number(i+1), list1.at(i))); presetAction->setData(i); @@ -290,14 +290,13 @@ void VstEffectControls::rolrPreset() void VstEffectControls::selPreset() { - - QAction *action = qobject_cast(sender()); - if (action) - if ( m_effect->m_plugin != nullptr ) { + auto action = qobject_cast(sender()); + if (action && m_effect->m_plugin != nullptr) + { lastPosInMenu = action->data().toInt(); - m_effect->m_plugin->setProgram( lastPosInMenu ); - //QWidget::update(); - } + m_effect->m_plugin->setProgram(lastPosInMenu); + // QWidget::update(); + } } diff --git a/plugins/VstEffect/VstSubPluginFeatures.cpp b/plugins/VstEffect/VstSubPluginFeatures.cpp index d69a53e4e..e60fee0c1 100644 --- a/plugins/VstEffect/VstSubPluginFeatures.cpp +++ b/plugins/VstEffect/VstSubPluginFeatures.cpp @@ -55,7 +55,7 @@ void VstSubPluginFeatures::fillDescriptionWidget( QWidget * _parent, void VstSubPluginFeatures::listSubPluginKeys( const Plugin::Descriptor * _desc, KeyList & _kl ) const { - QStringList *dlls = new QStringList(); + auto dlls = new QStringList(); const QString path = QString(""); addPluginsFromDir(dlls, path ); // TODO: eval m_type diff --git a/plugins/Watsyn/Watsyn.cpp b/plugins/Watsyn/Watsyn.cpp index 58f472edc..9ceaaddb8 100644 --- a/plugins/Watsyn/Watsyn.cpp +++ b/plugins/Watsyn/Watsyn.cpp @@ -331,14 +331,8 @@ void WatsynInstrument::playNote( NotePlayHandle * _n, { if ( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr ) { - WatsynObject * w = new WatsynObject( - &A1_wave[0], - &A2_wave[0], - &B1_wave[0], - &B2_wave[0], - m_amod.value(), m_bmod.value(), - Engine::audioEngine()->processingSampleRate(), _n, - Engine::audioEngine()->framesPerPeriod(), this ); + auto w = new WatsynObject(&A1_wave[0], &A2_wave[0], &B1_wave[0], &B2_wave[0], m_amod.value(), m_bmod.value(), + Engine::audioEngine()->processingSampleRate(), _n, Engine::audioEngine()->framesPerPeriod(), this); _n->m_pluginData = w; } @@ -347,7 +341,7 @@ void WatsynInstrument::playNote( NotePlayHandle * _n, const f_cnt_t offset = _n->noteOffset(); sampleFrame * buffer = _working_buffer + offset; - WatsynObject * w = static_cast( _n->m_pluginData ); + auto w = static_cast(_n->m_pluginData); sampleFrame * abuf = w->abuf(); sampleFrame * bbuf = w->bbuf(); @@ -360,7 +354,7 @@ void WatsynInstrument::playNote( NotePlayHandle * _n, const float envHold = ( m_envHold.value() * w->samplerate() ) / 1000.0f; const float envDec = ( m_envDec.value() * w->samplerate() ) / 1000.0f; const float envLen = envAtt + envDec + envHold; - const float tfp_ = static_cast( _n->totalFramesPlayed() ); + const auto tfp_ = static_cast(_n->totalFramesPlayed()); // if sample-exact is enabled, use sample-exact calculations... // disabled pending proper implementation of sample-exactness @@ -723,25 +717,25 @@ WatsynView::WatsynView( Instrument * _instrument, // button groups next. // graph select buttons - PixmapButton * a1_selectButton = new PixmapButton( this, nullptr ); + auto a1_selectButton = new PixmapButton(this, nullptr); a1_selectButton -> move( 4, 121 ); a1_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "a1_active" ) ); a1_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "a1_inactive" ) ); a1_selectButton->setToolTip(tr("Select oscillator A1")); - PixmapButton * a2_selectButton = new PixmapButton( this, nullptr ); + auto a2_selectButton = new PixmapButton(this, nullptr); a2_selectButton -> move( 44, 121 ); a2_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "a2_active" ) ); a2_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "a2_inactive" ) ); a2_selectButton->setToolTip(tr("Select oscillator A2")); - PixmapButton * b1_selectButton = new PixmapButton( this, nullptr ); + auto b1_selectButton = new PixmapButton(this, nullptr); b1_selectButton -> move( 84, 121 ); b1_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "b1_active" ) ); b1_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "b1_inactive" ) ); b1_selectButton->setToolTip(tr("Select oscillator B1")); - PixmapButton * b2_selectButton = new PixmapButton( this, nullptr ); + auto b2_selectButton = new PixmapButton(this, nullptr); b2_selectButton -> move( 124, 121 ); b2_selectButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "b2_active" ) ); b2_selectButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "b2_inactive" ) ); @@ -752,29 +746,29 @@ WatsynView::WatsynView( Instrument * _instrument, m_selectedGraphGroup -> addButton( a2_selectButton ); m_selectedGraphGroup -> addButton( b1_selectButton ); m_selectedGraphGroup -> addButton( b2_selectButton ); - WatsynInstrument * w = castModel(); + auto w = castModel(); m_selectedGraphGroup -> setModel( &w -> m_selectedGraph); // A-modulation button group - PixmapButton * amod_mixButton = new PixmapButton( this, nullptr ); + auto amod_mixButton = new PixmapButton(this, nullptr); amod_mixButton -> move( 4, 50 ); amod_mixButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "amix_active" ) ); amod_mixButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "amix_inactive" ) ); amod_mixButton->setToolTip(tr("Mix output of A2 to A1")); - PixmapButton * amod_amButton = new PixmapButton( this, nullptr ); + auto amod_amButton = new PixmapButton(this, nullptr); amod_amButton -> move( 4, 66 ); amod_amButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "aam_active" ) ); amod_amButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "aam_inactive" ) ); amod_amButton->setToolTip(tr("Modulate amplitude of A1 by output of A2")); - PixmapButton * amod_rmButton = new PixmapButton( this, nullptr ); + auto amod_rmButton = new PixmapButton(this, nullptr); amod_rmButton -> move( 4, 82 ); amod_rmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "arm_active" ) ); amod_rmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "arm_inactive" ) ); amod_rmButton->setToolTip(tr("Ring modulate A1 and A2")); - PixmapButton * amod_pmButton = new PixmapButton( this, nullptr ); + auto amod_pmButton = new PixmapButton(this, nullptr); amod_pmButton -> move( 4, 98 ); amod_pmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "apm_active" ) ); amod_pmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "apm_inactive" ) ); @@ -787,25 +781,25 @@ WatsynView::WatsynView( Instrument * _instrument, m_aModGroup -> addButton( amod_pmButton ); // B-modulation button group - PixmapButton * bmod_mixButton = new PixmapButton( this, nullptr ); + auto bmod_mixButton = new PixmapButton(this, nullptr); bmod_mixButton -> move( 44, 50 ); bmod_mixButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "bmix_active" ) ); bmod_mixButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "bmix_inactive" ) ); bmod_mixButton->setToolTip(tr("Mix output of B2 to B1")); - PixmapButton * bmod_amButton = new PixmapButton( this, nullptr ); + auto bmod_amButton = new PixmapButton(this, nullptr); bmod_amButton -> move( 44, 66 ); bmod_amButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "bam_active" ) ); bmod_amButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "bam_inactive" ) ); bmod_amButton->setToolTip(tr("Modulate amplitude of B1 by output of B2")); - PixmapButton * bmod_rmButton = new PixmapButton( this, nullptr ); + auto bmod_rmButton = new PixmapButton(this, nullptr); bmod_rmButton -> move( 44, 82 ); bmod_rmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "brm_active" ) ); bmod_rmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "brm_inactive" ) ); bmod_rmButton->setToolTip(tr("Ring modulate B1 and B2")); - PixmapButton * bmod_pmButton = new PixmapButton( this, nullptr ); + auto bmod_pmButton = new PixmapButton(this, nullptr); bmod_pmButton -> move( 44, 98 ); bmod_pmButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "bpm_active" ) ); bmod_pmButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "bpm_inactive" ) ); @@ -1218,7 +1212,7 @@ void WatsynView::loadClicked() void WatsynView::modelChanged() { - WatsynInstrument * w = castModel(); + auto w = castModel(); a1_volKnob -> setModel( &w -> a1_vol ); a2_volKnob -> setModel( &w -> a2_vol ); diff --git a/plugins/WaveShaper/WaveShaperControlDialog.cpp b/plugins/WaveShaper/WaveShaperControlDialog.cpp index e4fae0c92..5ef061fdb 100644 --- a/plugins/WaveShaper/WaveShaperControlDialog.cpp +++ b/plugins/WaveShaper/WaveShaperControlDialog.cpp @@ -48,7 +48,7 @@ WaveShaperControlDialog::WaveShaperControlDialog( setPalette( pal ); setFixedSize( 224, 274 ); - Graph * waveGraph = new Graph( this, Graph::LinearNonCyclicStyle, 204, 205 ); + auto waveGraph = new Graph(this, Graph::LinearNonCyclicStyle, 204, 205); waveGraph -> move( 10, 6 ); waveGraph -> setModel( &_controls -> m_wavegraphModel ); waveGraph -> setAutoFillBackground( true ); @@ -59,7 +59,7 @@ WaveShaperControlDialog::WaveShaperControlDialog( waveGraph->setGraphColor( QColor( 85, 204, 145 ) ); waveGraph -> setMaximumSize( 204, 205 ); - Knob * inputKnob = new Knob( knobBright_26, this); + auto inputKnob = new Knob(knobBright_26, this); inputKnob -> setVolumeKnob( true ); inputKnob -> setVolumeRatio( 1.0 ); inputKnob -> move( 26, 225 ); @@ -67,7 +67,7 @@ WaveShaperControlDialog::WaveShaperControlDialog( inputKnob->setLabel( tr( "INPUT" ) ); inputKnob->setHintText( tr( "Input gain:" ) , "" ); - Knob * outputKnob = new Knob( knobBright_26, this ); + auto outputKnob = new Knob(knobBright_26, this); outputKnob -> setVolumeKnob( true ); outputKnob -> setVolumeRatio( 1.0 ); outputKnob -> move( 76, 225 ); @@ -75,36 +75,35 @@ WaveShaperControlDialog::WaveShaperControlDialog( outputKnob->setLabel( tr( "OUTPUT" ) ); outputKnob->setHintText( tr( "Output gain:" ), "" ); - PixmapButton * resetButton = new PixmapButton( this, tr("Reset wavegraph") ); + auto resetButton = new PixmapButton(this, tr("Reset wavegraph")); resetButton -> move( 162, 221 ); resetButton -> resize( 13, 46 ); resetButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "reset_active" ) ); resetButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "reset_inactive" ) ); resetButton->setToolTip(tr("Reset wavegraph")); - PixmapButton * smoothButton = new PixmapButton( this, tr("Smooth wavegraph") ); + auto smoothButton = new PixmapButton(this, tr("Smooth wavegraph")); smoothButton -> move( 162, 237 ); smoothButton -> resize( 13, 46 ); smoothButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth_active" ) ); smoothButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "smooth_inactive" ) ); smoothButton->setToolTip(tr("Smooth wavegraph")); - PixmapButton * addOneButton = new PixmapButton( this, tr("Increase wavegraph amplitude by 1 dB") ); + auto addOneButton = new PixmapButton(this, tr("Increase wavegraph amplitude by 1 dB")); addOneButton -> move( 131, 221 ); addOneButton -> resize( 13, 29 ); addOneButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "add1_active" ) ); addOneButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "add1_inactive" ) ); addOneButton->setToolTip(tr("Increase wavegraph amplitude by 1 dB")); - PixmapButton * subOneButton = new PixmapButton( this, tr("Decrease wavegraph amplitude by 1 dB") ); + auto subOneButton = new PixmapButton(this, tr("Decrease wavegraph amplitude by 1 dB")); subOneButton -> move( 131, 237 ); subOneButton -> resize( 13, 29 ); subOneButton -> setActiveGraphic( PLUGIN_NAME::getIconPixmap( "sub1_active" ) ); subOneButton -> setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "sub1_inactive" ) ); subOneButton->setToolTip(tr("Decrease wavegraph amplitude by 1 dB")); - LedCheckBox * clipInputToggle = new LedCheckBox( "Clip input", this, - tr( "Clip input" ), LedCheckBox::Green ); + auto clipInputToggle = new LedCheckBox("Clip input", this, tr("Clip input"), LedCheckBox::Green); clipInputToggle -> move( 131, 252 ); clipInputToggle -> setModel( &_controls -> m_clipModel ); clipInputToggle->setToolTip(tr("Clip input signal to 0 dB")); diff --git a/plugins/Xpressive/ExprSynth.cpp b/plugins/Xpressive/ExprSynth.cpp index 0a1454345..6c82b0885 100644 --- a/plugins/Xpressive/ExprSynth.cpp +++ b/plugins/Xpressive/ExprSynth.cpp @@ -312,7 +312,7 @@ struct RandomVectorSeedFunction : public exprtk::ifunction { return 0; } - const unsigned int xi = (unsigned int)index; + const auto xi = (unsigned int)index; const unsigned int si = irseed % data_size; const unsigned int sa = irseed / data_size; unsigned int res=rotateLeft(random_data[(xi + 23 * si + 1) % data_size] ^ random_data[(xi / data_size + sa) % data_size],sa % 31 + 1); @@ -634,13 +634,13 @@ bool ExprFront::add_cyclic_vector(const char* name, const float* data, size_t le { if (interp) { - WaveValueFunctionInterpolate *wvf = new WaveValueFunctionInterpolate(data, length); + auto wvf = new WaveValueFunctionInterpolate(data, length); m_data->m_cyclics_interp.push_back(wvf); return m_data->m_symbol_table.add_function(name, *wvf); } else { - WaveValueFunction *wvf = new WaveValueFunction(data, length); + auto wvf = new WaveValueFunction(data, length); m_data->m_cyclics.push_back(wvf); return m_data->m_symbol_table.add_function(name, *wvf); } diff --git a/plugins/Xpressive/Xpressive.cpp b/plugins/Xpressive/Xpressive.cpp index de1140ed1..18ac8c052 100644 --- a/plugins/Xpressive/Xpressive.cpp +++ b/plugins/Xpressive/Xpressive.cpp @@ -203,8 +203,9 @@ void Xpressive::playNote(NotePlayHandle* nph, sampleFrame* working_buffer) { if (nph->totalFramesPlayed() == 0 || nph->m_pluginData == nullptr) { - ExprFront *exprO1 = new ExprFront(m_outputExpression[0].constData(),Engine::audioEngine()->processingSampleRate());//give the "last" function a whole second - ExprFront *exprO2 = new ExprFront(m_outputExpression[1].constData(),Engine::audioEngine()->processingSampleRate()); + auto exprO1 = new ExprFront(m_outputExpression[0].constData(), + Engine::audioEngine()->processingSampleRate()); // give the "last" function a whole second + auto exprO2 = new ExprFront(m_outputExpression[1].constData(), Engine::audioEngine()->processingSampleRate()); auto init_expression_step1 = [this, nph](ExprFront* e) { //lambda function to init exprO1 and exprO2 //add the constants and the variables to the expression. @@ -227,10 +228,7 @@ void Xpressive::playNote(NotePlayHandle* nph, sampleFrame* working_buffer) { Engine::audioEngine()->processingSampleRate(), &m_panning1, &m_panning2, m_relTransition.value()); } - - - - ExprSynth *ps = static_cast(nph->m_pluginData); + auto ps = static_cast(nph->m_pluginData); const fpp_t frames = nph->framesLeftForCurrentPeriod(); const f_cnt_t offset = nph->noteOffset(); @@ -257,7 +255,7 @@ void Xpressive::smooth(float smoothness,const graphModel * in,graphModel * out) 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]; + auto const guassian = new float[guass_size]; float sum = 0.0f; float temp = 0.0f; int i; @@ -390,7 +388,7 @@ XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) : m_selectedGraphGroup->addButton(m_o1Btn); m_selectedGraphGroup->addButton(m_o2Btn); - Xpressive *e = castModel(); + auto e = castModel(); m_selectedGraphGroup->setModel(&e->selectedGraph()); m_sinWaveBtn = new PixmapButton(this, tr("Sine wave")); @@ -536,7 +534,7 @@ XpressiveView::XpressiveView(Instrument * _instrument, QWidget * _parent) : void XpressiveView::expressionChanged() { - Xpressive * e = castModel(); + auto e = castModel(); QByteArray text = m_expressionEditor->toPlainText().toLatin1(); switch (m_selectedGraphGroup->model()->value()) { @@ -592,7 +590,7 @@ void XpressiveView::expressionChanged() { if (parse_ok) { e->exprValid().setValue(0); const int length = m_raw_graph->length(); - float * const samples = new float[length]; + auto const samples = new float[length]; for (i = 0; i < length; i++) { t = i / (float) length; samples[i] = expr.evaluate(); @@ -627,8 +625,8 @@ void XpressiveView::expressionChanged() { void XpressiveView::smoothChanged() { - - Xpressive * e = castModel(); + + auto e = castModel(); float smoothness=0; switch (m_selectedGraphGroup->model()->value()) { case W1_EXPR: @@ -660,7 +658,7 @@ void XpressiveView::smoothChanged() void XpressiveView::graphDrawn() { m_raw_graph->setSamples(m_graph->model()->samples()); - Xpressive * e = castModel(); + auto e = castModel(); switch (m_selectedGraphGroup->model()->value()) { case W1_EXPR: e->W1().copyFrom(m_graph->model()); @@ -676,7 +674,7 @@ void XpressiveView::graphDrawn() } void XpressiveView::modelChanged() { - Xpressive * b = castModel(); + auto b = castModel(); m_expressionValidToggle->setModel( &b->exprValid() ); m_generalPurposeKnob[0]->setModel( &b->parameterA1() ); @@ -692,7 +690,7 @@ void XpressiveView::modelChanged() { } void XpressiveView::updateLayout() { - Xpressive * e = castModel(); + auto e = castModel(); m_output_expr=false; m_wave_expr=false; switch (m_selectedGraphGroup->model()->value()) { diff --git a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp index 1de5fb97d..4c69beed0 100644 --- a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp @@ -146,8 +146,7 @@ public: static void * messageLoop( void * _arg ) { - RemoteZynAddSubFx * _this = - static_cast( _arg ); + auto _this = static_cast(_arg); _this->messageLoop(); @@ -285,7 +284,7 @@ int main( int _argc, char * * _argv ) RemoteZynAddSubFx * remoteZASF = new RemoteZynAddSubFx( _argv[1], _argv[2] ); #else - RemoteZynAddSubFx * remoteZASF = new RemoteZynAddSubFx( _argv[1] ); + auto remoteZASF = new RemoteZynAddSubFx(_argv[1]); #endif remoteZASF->guiLoop(); diff --git a/plugins/ZynAddSubFx/ZynAddSubFx.cpp b/plugins/ZynAddSubFx/ZynAddSubFx.cpp index d3b1a90ed..d3d23c65f 100644 --- a/plugins/ZynAddSubFx/ZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/ZynAddSubFx.cpp @@ -135,7 +135,7 @@ ZynAddSubFxInstrument::ZynAddSubFxInstrument( this, SLOT( updateResBandwidth() ), Qt::DirectConnection ); // now we need a play-handle which cares for calling play() - InstrumentPlayHandle * iph = new InstrumentPlayHandle( this, _instrumentTrack ); + auto iph = new InstrumentPlayHandle(this, _instrumentTrack); Engine::audioEngine()->addPlayHandle( iph ); connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), @@ -503,7 +503,7 @@ ZynAddSubFxView::ZynAddSubFxView( Instrument * _instrument, QWidget * _parent ) "artwork" ) ); setPalette( pal ); - QGridLayout * l = new QGridLayout( this ); + auto l = new QGridLayout(this); l->setContentsMargins( 20, 80, 10, 10 ); l->setVerticalSpacing( 16 ); l->setHorizontalSpacing( 10 ); @@ -611,7 +611,7 @@ void ZynAddSubFxView::dropEvent( QDropEvent * _de ) void ZynAddSubFxView::modelChanged() { - ZynAddSubFxInstrument * m = castModel(); + auto m = castModel(); // set models for controller knobs m_portamento->setModel( &m->m_portamentoModel ); @@ -632,7 +632,7 @@ void ZynAddSubFxView::modelChanged() void ZynAddSubFxView::toggleUI() { - ZynAddSubFxInstrument * model = castModel(); + auto model = castModel(); if( model->m_hasGUI != m_toggleUIButton->isChecked() ) { model->m_hasGUI = m_toggleUIButton->isChecked(); diff --git a/src/core/AudioEngine.cpp b/src/core/AudioEngine.cpp index 20a8513d0..11def2a2e 100644 --- a/src/core/AudioEngine.cpp +++ b/src/core/AudioEngine.cpp @@ -148,7 +148,7 @@ AudioEngine::AudioEngine( bool renderOnly ) : for( int i = 0; i < m_numWorkers+1; ++i ) { - AudioEngineWorkerThread * wt = new AudioEngineWorkerThread( this ); + auto wt = new AudioEngineWorkerThread(this); if( i < m_numWorkers ) { wt->start( QThread::TimeCriticalPriority ); @@ -315,7 +315,7 @@ void AudioEngine::pushInputFrames( sampleFrame * _ab, const f_cnt_t _frames ) if( frames + _frames > size ) { size = qMax( size * 2, frames + _frames ); - sampleFrame * ab = new sampleFrame[ size ]; + auto ab = new sampleFrame[size]; memcpy( ab, buf, frames * sizeof( sampleFrame ) ); delete [] buf; @@ -1113,7 +1113,7 @@ MidiClient * AudioEngine::tryMidiClients() #ifdef LMMS_HAVE_ALSA if( client_name == MidiAlsaSeq::name() || client_name == "" ) { - MidiAlsaSeq * malsas = new MidiAlsaSeq; + auto malsas = new MidiAlsaSeq; if( malsas->isRunning() ) { m_midiClientName = MidiAlsaSeq::name(); @@ -1124,7 +1124,7 @@ MidiClient * AudioEngine::tryMidiClients() if( client_name == MidiAlsaRaw::name() || client_name == "" ) { - MidiAlsaRaw * malsar = new MidiAlsaRaw; + auto malsar = new MidiAlsaRaw; if( malsar->isRunning() ) { m_midiClientName = MidiAlsaRaw::name(); @@ -1137,7 +1137,7 @@ MidiClient * AudioEngine::tryMidiClients() #ifdef LMMS_HAVE_JACK if( client_name == MidiJack::name() || client_name == "" ) { - MidiJack * mjack = new MidiJack; + auto mjack = new MidiJack; if( mjack->isRunning() ) { m_midiClientName = MidiJack::name(); @@ -1150,7 +1150,7 @@ MidiClient * AudioEngine::tryMidiClients() #ifdef LMMS_HAVE_OSS if( client_name == MidiOss::name() || client_name == "" ) { - MidiOss * moss = new MidiOss; + auto moss = new MidiOss; if( moss->isRunning() ) { m_midiClientName = MidiOss::name(); @@ -1261,7 +1261,7 @@ void AudioEngine::fifoWriter::run() const fpp_t frames = m_audioEngine->framesPerPeriod(); while( m_writing ) { - surroundSampleFrame * buffer = new surroundSampleFrame[frames]; + auto buffer = new surroundSampleFrame[frames]; const surroundSampleFrame * b = m_audioEngine->renderNextBuffer(); memcpy( buffer, b, frames * sizeof( surroundSampleFrame ) ); write( buffer ); diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index dc463075c..06f1938ca 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -801,7 +801,7 @@ float FloatModel::getRoundedValue() const int FloatModel::getDigitCount() const { - float steptemp = step(); + auto steptemp = step(); int digits = 0; while ( steptemp < 1 ) { diff --git a/src/core/AutomationClip.cpp b/src/core/AutomationClip.cpp index f2cb211eb..1447e2629 100644 --- a/src/core/AutomationClip.cpp +++ b/src/core/AutomationClip.cpp @@ -211,7 +211,7 @@ TimePos AutomationClip::timeMapLength() const if (m_timeMap.isEmpty()) { return one_bar; } timeMap::const_iterator it = m_timeMap.end(); - tick_t last_tick = static_cast(POS(it - 1)); + auto last_tick = static_cast(POS(it - 1)); // if last_tick is 0 (single item at tick 0) // return length as a whole bar to prevent disappearing Clip if (last_tick == 0) { return one_bar; } @@ -374,8 +374,8 @@ void AutomationClip::removeNodes(const int tick0, const int tick1) return; } - TimePos start = TimePos(qMin(tick0, tick1)); - TimePos end = TimePos(qMax(tick0, tick1)); + auto start = TimePos(qMin(tick0, tick1)); + auto end = TimePos(qMax(tick0, tick1)); // Make a list of TimePos with nodes to be removed // because we can't simply remove the nodes from @@ -410,8 +410,8 @@ void AutomationClip::resetNodes(const int tick0, const int tick1) return; } - TimePos start = TimePos(qMin(tick0, tick1)); - TimePos end = TimePos(qMax(tick0, tick1)); + auto start = TimePos(qMin(tick0, tick1)); + auto end = TimePos(qMax(tick0, tick1)); for (auto it = m_timeMap.lowerBound(start), endIt = m_timeMap.upperBound(end); it != endIt; ++it) { @@ -610,7 +610,7 @@ float *AutomationClip::valuesAfter( const TimePos & _time ) const } int numValues = POS(v + 1) - POS(v); - float *ret = new float[numValues]; + auto ret = new float[numValues]; for( int i = 0; i < numValues; i++ ) { @@ -698,7 +698,7 @@ void AutomationClip::flipX(int length) // We swap the inValue and outValue when flipping horizontally tempValue = OUTVAL(it); tempOutValue = INVAL(it); - TimePos newTime = TimePos(length - POS(it)); + auto newTime = TimePos(length - POS(it)); tempMap[newTime] = AutomationNode(this, tempValue, tempOutValue, newTime); @@ -740,7 +740,7 @@ void AutomationClip::flipX(int length) tempValue = OUTVAL(it); tempOutValue = INVAL(it); - TimePos newTime = TimePos(realLength - POS(it)); + auto newTime = TimePos(realLength - POS(it)); tempMap[newTime] = AutomationNode(this, tempValue, tempOutValue, newTime); ++it; @@ -903,7 +903,7 @@ bool AutomationClip::isAutomated( const AutomatableModel * _m ) const Track::clipVector & v = ( *it )->getClips(); for( Track::clipVector::ConstIterator j = v.begin(); j != v.end(); ++j ) { - const AutomationClip * a = dynamic_cast( *j ); + const auto a = dynamic_cast(*j); if( a && a->hasAutomation() ) { for( objectVector::const_iterator k = a->m_objects.begin(); k != a->m_objects.end(); ++k ) @@ -945,7 +945,7 @@ QVector AutomationClip::clipsForModel( const AutomatableModel // go through all the clips... for( Track::clipVector::ConstIterator j = v.begin(); j != v.end(); ++j ) { - AutomationClip * a = dynamic_cast( *j ); + auto a = dynamic_cast(*j); // check that the clip has automation if( a && a->hasAutomation() ) { @@ -977,7 +977,7 @@ AutomationClip * AutomationClip::globalAutomationClip( Track::clipVector v = t->getClips(); for( Track::clipVector::const_iterator j = v.begin(); j != v.end(); ++j ) { - AutomationClip * a = dynamic_cast( *j ); + auto a = dynamic_cast(*j); if( a ) { for( objectVector::const_iterator k = a->m_objects.begin(); @@ -991,7 +991,7 @@ AutomationClip * AutomationClip::globalAutomationClip( } } - AutomationClip * a = new AutomationClip( t ); + auto a = new AutomationClip(t); a->addObject( _m, false ); return a; } @@ -1014,7 +1014,7 @@ void AutomationClip::resolveAllIDs() for( Track::clipVector::iterator j = v.begin(); j != v.end(); ++j ) { - AutomationClip * a = dynamic_cast( *j ); + auto a = dynamic_cast(*j); if( a ) { for( QVector::Iterator k = a->m_idsToResolve.begin(); diff --git a/src/core/Clipboard.cpp b/src/core/Clipboard.cpp index 6e1503b2f..1dd78f69c 100644 --- a/src/core/Clipboard.cpp +++ b/src/core/Clipboard.cpp @@ -50,7 +50,7 @@ namespace lmms::Clipboard void copyString( const QString & str, MimeType mT ) { - QMimeData *content = new QMimeData; + auto content = new QMimeData; content->setData( mimeType( mT ), str.toUtf8() ); QApplication::clipboard()->setMimeData( content, QClipboard::Clipboard ); @@ -71,7 +71,7 @@ namespace lmms::Clipboard { QString finalString = key + ":" + value; - QMimeData *content = new QMimeData; + auto content = new QMimeData; content->setData( mimeType( MimeType::StringPair ), finalString.toUtf8() ); QApplication::clipboard()->setMimeData( content, QClipboard::Clipboard ); } diff --git a/src/core/Controller.cpp b/src/core/Controller.cpp index 4ff9c4c93..aee6481cc 100644 --- a/src/core/Controller.cpp +++ b/src/core/Controller.cpp @@ -246,7 +246,7 @@ bool Controller::hasModel( const Model * m ) const { for (QObject * c : children()) { - AutomatableModel * am = qobject_cast(c); + auto am = qobject_cast(c); if( am != nullptr ) { if( am == m ) @@ -296,7 +296,7 @@ QString Controller::nodeName() const gui::ControllerDialog * Controller::createDialog( QWidget * _parent ) { - gui::ControllerDialog * d = new gui::ControllerDialog( this, _parent ); + auto d = new gui::ControllerDialog(this, _parent); return d; } diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 3ae141281..14024fe90 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -427,7 +427,7 @@ bool DataFile::copyResources(const QString& resourcesDir) // repeating filenames std::list namesList; - ResourcesMap::const_iterator it = ELEMENTS_WITH_RESOURCES.begin(); + auto it = ELEMENTS_WITH_RESOURCES.begin(); // Copy resources and manipulate the DataFile to have local paths to them while (it != ELEMENTS_WITH_RESOURCES.end()) @@ -439,7 +439,7 @@ bool DataFile::copyResources(const QString& resourcesDir) { QDomElement el = list.item(i).toElement(); - std::vector::const_iterator res = it->second.begin(); + auto res = it->second.begin(); // Search for attributes that point to resources while (res != it->second.end()) @@ -533,12 +533,7 @@ bool DataFile::hasLocalPlugins(QDomElement parent /* = QDomElement()*/, bool fir bool skipNode = false; // Skip the nodes allowed to have "local:" attributes, but // still check its children - for - ( - ResourcesMap::const_iterator it = ELEMENTS_WITH_RESOURCES.begin(); - it != ELEMENTS_WITH_RESOURCES.end(); - ++it - ) + for (auto it = ELEMENTS_WITH_RESOURCES.begin(); it != ELEMENTS_WITH_RESOURCES.end(); ++it) { if (childElement.tagName() == it->first) { diff --git a/src/core/Effect.cpp b/src/core/Effect.cpp index 78f093773..1b6220463 100644 --- a/src/core/Effect.cpp +++ b/src/core/Effect.cpp @@ -124,7 +124,7 @@ Effect * Effect::instantiate( const QString& pluginName, if( dynamic_cast( p ) != nullptr ) { // everything ok, so return pointer - Effect * effect = dynamic_cast( p ); + auto effect = dynamic_cast(p); effect->m_parent = dynamic_cast(_parent); return effect; } diff --git a/src/core/EffectChain.cpp b/src/core/EffectChain.cpp index 6d16bb19e..e165e7391 100644 --- a/src/core/EffectChain.cpp +++ b/src/core/EffectChain.cpp @@ -60,10 +60,7 @@ void EffectChain::saveSettings( QDomDocument & _doc, QDomElement & _this ) for( Effect* effect : m_effects) { - if( DummyEffect* dummy = dynamic_cast(effect) ) - { - _this.appendChild( dummy->originalPluginData() ); - } + if (auto dummy = dynamic_cast(effect)) { _this.appendChild(dummy->originalPluginData()); } else { QDomElement ef = effect->saveState( _doc, _this ); diff --git a/src/core/EnvelopeAndLfoParameters.cpp b/src/core/EnvelopeAndLfoParameters.cpp index 55d200668..2f41b7e64 100644 --- a/src/core/EnvelopeAndLfoParameters.cpp +++ b/src/core/EnvelopeAndLfoParameters.cpp @@ -404,16 +404,13 @@ void EnvelopeAndLfoParameters::updateSampleVars() Engine::audioEngine()->processingSampleRate(); // TODO: Remove the expKnobVals, time should be linear - const f_cnt_t predelay_frames = static_cast( - frames_per_env_seg * - expKnobVal( m_predelayModel.value() ) ); + const auto predelay_frames = static_cast(frames_per_env_seg * expKnobVal(m_predelayModel.value())); const f_cnt_t attack_frames = qMax( minimumFrames, static_cast( frames_per_env_seg * expKnobVal( m_attackModel.value() ) ) ); - const f_cnt_t hold_frames = static_cast( frames_per_env_seg * - expKnobVal( m_holdModel.value() ) ); + const auto hold_frames = static_cast(frames_per_env_seg * expKnobVal(m_holdModel.value())); const f_cnt_t decay_frames = qMax( minimumFrames, static_cast( frames_per_env_seg * diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index 1f49fc80a..75e6c53d1 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -368,8 +368,8 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n ) const int total_range = range * cnphv.size(); // number of frames that every note should be played - const f_cnt_t arp_frames = (f_cnt_t)( m_arpTimeModel.value() / 1000.0f * Engine::audioEngine()->processingSampleRate() ); - const f_cnt_t gated_frames = (f_cnt_t)( m_arpGateModel.value() * arp_frames / 100.0f ); + const auto arp_frames = (f_cnt_t)(m_arpTimeModel.value() / 1000.0f * Engine::audioEngine()->processingSampleRate()); + const auto gated_frames = (f_cnt_t)(m_arpGateModel.value() * arp_frames / 100.0f); // used for calculating remaining frames for arp-note, we have to add // arp_frames-1, otherwise the first arp-note will not be setup diff --git a/src/core/LadspaManager.cpp b/src/core/LadspaManager.cpp index 875a4f132..156b50aeb 100644 --- a/src/core/LadspaManager.cpp +++ b/src/core/LadspaManager.cpp @@ -86,9 +86,7 @@ LadspaManager::LadspaManager() if( plugin_lib.load() == true ) { - LADSPA_Descriptor_Function descriptorFunction = - ( LADSPA_Descriptor_Function ) plugin_lib.resolve( - "ladspa_descriptor" ); + auto descriptorFunction = (LADSPA_Descriptor_Function)plugin_lib.resolve("ladspa_descriptor"); if( descriptorFunction != nullptr ) { addPlugins( descriptorFunction, @@ -158,8 +156,7 @@ void LadspaManager::addPlugins( continue; } - LadspaManagerDescription * plugIn = - new LadspaManagerDescription; + auto plugIn = new LadspaManagerDescription; plugIn->descriptorFunction = _descriptor_func; plugIn->index = pluginIndex; plugIn->inputChannels = getPluginInputs( descriptor ); diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 96d4fc8b2..11e51fee7 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -293,7 +293,7 @@ void Mixer::deleteChannel( int index ) { if( t->type() == Track::InstrumentTrack ) { - InstrumentTrack* inst = dynamic_cast( t ); + auto inst = dynamic_cast(t); int val = inst->mixerChannelModel()->value(0); if( val == index ) { @@ -309,7 +309,7 @@ void Mixer::deleteChannel( int index ) } else if( t->type() == Track::SampleTrack ) { - SampleTrack* strk = dynamic_cast( t ); + auto strk = dynamic_cast(t); int val = strk->mixerChannelModel()->value(0); if( val == index ) { @@ -395,7 +395,7 @@ void Mixer::moveChannelLeft( int index ) { if( trackList[i]->type() == Track::InstrumentTrack ) { - InstrumentTrack * inst = (InstrumentTrack *) trackList[i]; + auto inst = (InstrumentTrack*)trackList[i]; int val = inst->mixerChannelModel()->value(0); if( val == a ) { @@ -408,7 +408,7 @@ void Mixer::moveChannelLeft( int index ) } else if( trackList[i]->type() == Track::SampleTrack ) { - SampleTrack * strk = (SampleTrack *) trackList[i]; + auto strk = (SampleTrack*)trackList[i]; int val = strk->mixerChannelModel()->value(0); if( val == a ) { @@ -469,7 +469,7 @@ MixerRoute * Mixer::createRoute( MixerChannel * from, MixerChannel * to, float a return nullptr; } Engine::audioEngine()->requestChangeInModel(); - MixerRoute * route = new MixerRoute( from, to, amount ); + auto route = new MixerRoute(from, to, amount); // add us to from's sends from->m_sends.append( route ); diff --git a/src/core/NotePlayHandle.cpp b/src/core/NotePlayHandle.cpp index e31299eda..8d81b473a 100644 --- a/src/core/NotePlayHandle.cpp +++ b/src/core/NotePlayHandle.cpp @@ -459,7 +459,7 @@ int NotePlayHandle::index() const int idx = 0; for( PlayHandleList::ConstIterator it = playHandles.begin(); it != playHandles.end(); ++it ) { - const NotePlayHandle * nph = dynamic_cast( *it ); + const auto nph = dynamic_cast(*it); if( nph == nullptr || nph->m_instrumentTrack != m_instrumentTrack || nph->isReleased() || nph->hasParent() ) { continue; @@ -483,7 +483,7 @@ ConstNotePlayHandleList NotePlayHandle::nphsOfInstrumentTrack( const InstrumentT for( PlayHandleList::ConstIterator it = playHandles.begin(); it != playHandles.end(); ++it ) { - const NotePlayHandle * nph = dynamic_cast( *it ); + const auto nph = dynamic_cast(*it); if( nph != nullptr && nph->m_instrumentTrack == _it && ( ( nph->isReleased() == false && nph->hasParent() == false ) || _all_ph == true ) ) { cnphv.push_back( nph ); @@ -606,7 +606,7 @@ void NotePlayHandleManager::init() { s_available = MM_ALLOC( INITIAL_NPH_CACHE ); - NotePlayHandle * n = MM_ALLOC( INITIAL_NPH_CACHE ); + auto n = MM_ALLOC(INITIAL_NPH_CACHE); for( int i=0; i < INITIAL_NPH_CACHE; ++i ) { @@ -649,11 +649,11 @@ void NotePlayHandleManager::release( NotePlayHandle * nph ) void NotePlayHandleManager::extend( int c ) { s_size += c; - NotePlayHandle ** tmp = MM_ALLOC( s_size ); + auto tmp = MM_ALLOC(s_size); MM_FREE( s_available ); s_available = tmp; - NotePlayHandle * n = MM_ALLOC( c ); + auto n = MM_ALLOC(c); for( int i=0; i < c; ++i ) { diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index 5af4e428b..ca553003d 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -233,7 +233,7 @@ void ProjectRenderer::updateConsoleProgress() } prog[cols] = 0; - const char * activity = (const char *) "|/-\\"; + const auto activity = (const char*)"|/-\\"; memset( buf, 0, sizeof( buf ) ); sprintf( buf, "\r|%s| %3d%% %c ", prog, m_progress, activity[rot] ); diff --git a/src/core/RemotePlugin.cpp b/src/core/RemotePlugin.cpp index 416767011..14c6f3f32 100644 --- a/src/core/RemotePlugin.cpp +++ b/src/core/RemotePlugin.cpp @@ -380,7 +380,7 @@ bool RemotePlugin::process( const sampleFrame * _in_buf, sampleFrame * _out_buf } else { - sampleFrame * o = (sampleFrame *) m_audioBuffer.get(); + auto o = (sampleFrame*)m_audioBuffer.get(); for( ch_cnt_t ch = 0; ch < inputs; ++ch ) { for( fpp_t frame = 0; frame < frames; ++frame ) @@ -423,8 +423,7 @@ bool RemotePlugin::process( const sampleFrame * _in_buf, sampleFrame * _out_buf } else { - sampleFrame * o = (sampleFrame *) ( m_audioBuffer.get() + - m_inputCount*frames ); + auto o = (sampleFrame*)(m_audioBuffer.get() + m_inputCount * frames); // clear buffer, if plugin didn't fill up both channels BufferManager::clear( _out_buf, frames ); diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index 68d9af2c9..92f3e2156 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -538,7 +538,7 @@ size_t qfileReadCallback(void * ptr, size_t size, size_t n, void * udata ) int qfileSeekCallback(void * udata, ogg_int64_t offset, int whence) { - QFile * f = static_cast(udata); + auto f = static_cast(udata); if (whence == SEEK_CUR) { @@ -594,7 +594,7 @@ f_cnt_t SampleBuffer::decodeSampleOGGVorbis( f_cnt_t frames = 0; - QFile * f = new QFile(fileName); + auto f = new QFile(fileName); if (f->open(QFile::ReadOnly) == false) { delete f; @@ -727,9 +727,7 @@ bool SampleBuffer::play( m_sampleRate / Engine::audioEngine()->processingSampleRate(); // calculate how many frames we have in requested pitch - const f_cnt_t totalFramesForCurrentPitch = static_cast( - (endFrame - startFrame) / freqFactor - ); + const auto totalFramesForCurrentPitch = static_cast((endFrame - startFrame) / freqFactor); if (totalFramesForCurrentPitch == 0) { @@ -1331,8 +1329,8 @@ SampleBuffer * SampleBuffer::resample(const sample_rate_t srcSR, const sample_ra { sampleFrame * data = m_data; const f_cnt_t frames = m_frames; - const f_cnt_t dstFrames = static_cast((frames / (float) srcSR) * (float) dstSR); - SampleBuffer * dstSB = new SampleBuffer(dstFrames); + const auto dstFrames = static_cast((frames / (float)srcSR) * (float)dstSR); + auto dstSB = new SampleBuffer(dstFrames); sampleFrame * dstBuf = dstSB->m_origData; // yeah, libsamplerate, let's rock with sinc-interpolation! diff --git a/src/core/SampleClip.cpp b/src/core/SampleClip.cpp index fc59fa457..1d173d78e 100644 --- a/src/core/SampleClip.cpp +++ b/src/core/SampleClip.cpp @@ -102,7 +102,7 @@ SampleClip::SampleClip(const SampleClip& orig) : SampleClip::~SampleClip() { - SampleTrack * sampletrack = dynamic_cast( getTrack() ); + auto sampletrack = dynamic_cast(getTrack()); if ( sampletrack ) { sampletrack->updateClips(); @@ -180,7 +180,7 @@ void SampleClip::toggleRecord() void SampleClip::playbackPositionChanged() { Engine::audioEngine()->removePlayHandlesOfTypes( getTrack(), PlayHandle::TypeSamplePlayHandle ); - SampleTrack * st = dynamic_cast( getTrack() ); + auto st = dynamic_cast(getTrack()); st->setPlayingClips( false ); } @@ -189,7 +189,7 @@ void SampleClip::playbackPositionChanged() void SampleClip::updateTrackClips() { - SampleTrack * sampletrack = dynamic_cast( getTrack() ); + auto sampletrack = dynamic_cast(getTrack()); if( sampletrack) { sampletrack->updateClips(); diff --git a/src/core/SampleRecordHandle.cpp b/src/core/SampleRecordHandle.cpp index 76d71c9f3..edebd27fd 100644 --- a/src/core/SampleRecordHandle.cpp +++ b/src/core/SampleRecordHandle.cpp @@ -115,7 +115,7 @@ void SampleRecordHandle::createSampleBuffer( SampleBuffer** sampleBuf ) { const f_cnt_t frames = framesRecorded(); // create buffer to store all recorded buffers in - sampleFrame * data = new sampleFrame[frames]; + auto data = new sampleFrame[frames]; // make sure buffer is cleaned up properly at the end... sampleFrame * data_ptr = data; @@ -140,7 +140,7 @@ void SampleRecordHandle::createSampleBuffer( SampleBuffer** sampleBuf ) void SampleRecordHandle::writeBuffer( const sampleFrame * _ab, const f_cnt_t _frames ) { - sampleFrame * buf = new sampleFrame[_frames]; + auto buf = new sampleFrame[_frames]; for( f_cnt_t frame = 0; frame < _frames; ++frame ) { for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl ) diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 029683f94..3981ebc64 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -146,12 +146,12 @@ void Song::masterVolumeChanged() void Song::setTempo() { Engine::audioEngine()->requestChangeInModel(); - const bpm_t tempo = ( bpm_t ) m_tempoModel.value(); + const auto tempo = (bpm_t)m_tempoModel.value(); PlayHandleList & playHandles = Engine::audioEngine()->playHandles(); for( PlayHandleList::Iterator it = playHandles.begin(); it != playHandles.end(); ++it ) { - NotePlayHandle * nph = dynamic_cast( *it ); + auto nph = dynamic_cast(*it); if( nph && !nph->isReleased() ) { nph->lock(); @@ -321,7 +321,7 @@ void Song::processNextBuffer() } const f_cnt_t framesUntilNextPeriod = framesPerPeriod - frameOffsetInPeriod; - const f_cnt_t framesUntilNextTick = static_cast(std::ceil(framesPerTick - frameOffsetInTick)); + const auto framesUntilNextTick = static_cast(std::ceil(framesPerTick - frameOffsetInTick)); // We want to proceed to the next buffer or tick, whichever is closer const auto framesToPlay = std::min(framesUntilNextPeriod, framesUntilNextTick); diff --git a/src/core/audio/AudioAlsa.cpp b/src/core/audio/AudioAlsa.cpp index 1a22413d8..8b3eb32be 100644 --- a/src/core/audio/AudioAlsa.cpp +++ b/src/core/audio/AudioAlsa.cpp @@ -295,9 +295,9 @@ void AudioAlsa::applyQualitySettings() void AudioAlsa::run() { - surroundSampleFrame * temp = new surroundSampleFrame[audioEngine()->framesPerPeriod()]; - int_sample_t * outbuf = new int_sample_t[audioEngine()->framesPerPeriod() * channels()]; - int_sample_t * pcmbuf = new int_sample_t[m_periodSize * channels()]; + auto temp = new surroundSampleFrame[audioEngine()->framesPerPeriod()]; + auto outbuf = new int_sample_t[audioEngine()->framesPerPeriod() * channels()]; + auto pcmbuf = new int_sample_t[m_periodSize * channels()]; int outbuf_size = audioEngine()->framesPerPeriod() * channels(); int outbuf_pos = 0; diff --git a/src/core/audio/AudioFileWave.cpp b/src/core/audio/AudioFileWave.cpp index 6f1a425b9..b78b04403 100644 --- a/src/core/audio/AudioFileWave.cpp +++ b/src/core/audio/AudioFileWave.cpp @@ -104,7 +104,7 @@ void AudioFileWave::writeBuffer( const surroundSampleFrame * _ab, if( bitDepth == OutputSettings::Depth_32Bit || bitDepth == OutputSettings::Depth_24Bit ) { - float * buf = new float[_frames*channels()]; + auto buf = new float[_frames * channels()]; for( fpp_t frame = 0; frame < _frames; ++frame ) { for( ch_cnt_t chnl = 0; chnl < channels(); ++chnl ) @@ -118,7 +118,7 @@ void AudioFileWave::writeBuffer( const surroundSampleFrame * _ab, } else { - int_sample_t * buf = new int_sample_t[_frames * channels()]; + auto buf = new int_sample_t[_frames * channels()]; convertToS16( _ab, _frames, _master_gain, buf, !isLittleEndian() ); diff --git a/src/core/audio/AudioJack.cpp b/src/core/audio/AudioJack.cpp index daf5bbd10..222ebf10d 100644 --- a/src/core/audio/AudioJack.cpp +++ b/src/core/audio/AudioJack.cpp @@ -442,7 +442,7 @@ int AudioJack::staticProcessCallback( jack_nframes_t _nframes, void * _udata ) void AudioJack::shutdownCallback( void * _udata ) { - AudioJack * _this = static_cast( _udata ); + auto _this = static_cast(_udata); _this->m_client = nullptr; _this->zombified(); } @@ -462,11 +462,11 @@ AudioJack::setupWidget::setupWidget( QWidget * _parent ) : m_clientName = new QLineEdit( cn, this ); m_clientName->setGeometry( 10, 20, 160, 20 ); - QLabel * cn_lbl = new QLabel( tr( "Client name" ), this ); + auto cn_lbl = new QLabel(tr("Client name"), this); cn_lbl->setFont( pointSize<7>( cn_lbl->font() ) ); cn_lbl->setGeometry( 10, 40, 160, 10 ); - gui::LcdSpinBoxModel * m = new gui::LcdSpinBoxModel( /* this */ ); + auto m = new gui::LcdSpinBoxModel(/* this */); m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS ); m->setStep( 2 ); m->setValue( ConfigManager::inst()->value( "audiojack", diff --git a/src/core/audio/AudioOss.cpp b/src/core/audio/AudioOss.cpp index d79ed939d..5166bad79 100644 --- a/src/core/audio/AudioOss.cpp +++ b/src/core/audio/AudioOss.cpp @@ -292,8 +292,8 @@ void AudioOss::applyQualitySettings() void AudioOss::run() { - surroundSampleFrame * temp = new surroundSampleFrame[audioEngine()->framesPerPeriod()]; - int_sample_t * outbuf = new int_sample_t[audioEngine()->framesPerPeriod() * channels()]; + auto temp = new surroundSampleFrame[audioEngine()->framesPerPeriod()]; + auto outbuf = new int_sample_t[audioEngine()->framesPerPeriod() * channels()]; while( true ) { @@ -323,11 +323,11 @@ AudioOss::setupWidget::setupWidget( QWidget * _parent ) : m_device = new QLineEdit( probeDevice(), this ); m_device->setGeometry( 10, 20, 160, 20 ); - QLabel * dev_lbl = new QLabel( tr( "Device" ), this ); + auto dev_lbl = new QLabel(tr("Device"), this); dev_lbl->setFont( pointSize<7>( dev_lbl->font() ) ); dev_lbl->setGeometry( 10, 40, 160, 10 ); - gui::LcdSpinBoxModel * m = new gui::LcdSpinBoxModel( /* this */ ); + auto m = new gui::LcdSpinBoxModel(/* this */); m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS ); m->setStep( 2 ); m->setValue( ConfigManager::inst()->value( "audiooss", diff --git a/src/core/audio/AudioPortAudio.cpp b/src/core/audio/AudioPortAudio.cpp index 03bceaa89..0f5a4122f 100644 --- a/src/core/audio/AudioPortAudio.cpp +++ b/src/core/audio/AudioPortAudio.cpp @@ -332,7 +332,7 @@ int AudioPortAudio::_process_callback( Q_UNUSED(_timeInfo); Q_UNUSED(_statusFlags); - AudioPortAudio * _this = static_cast (_arg); + auto _this = static_cast(_arg); return _this->process_callback( (const float*)_inputBuffer, (float*)_outputBuffer, _framesPerBuffer ); } @@ -422,14 +422,14 @@ AudioPortAudio::setupWidget::setupWidget( QWidget * _parent ) : m_backend = new ComboBox( this, "BACKEND" ); m_backend->setGeometry( 64, 15, 260, ComboBox::DEFAULT_HEIGHT ); - QLabel * backend_lbl = new QLabel( tr( "Backend" ), this ); + auto backend_lbl = new QLabel(tr("Backend"), this); backend_lbl->setFont( pointSize<7>( backend_lbl->font() ) ); backend_lbl->move( 8, 18 ); m_device = new ComboBox( this, "DEVICE" ); m_device->setGeometry( 64, 35, 260, ComboBox::DEFAULT_HEIGHT ); - QLabel * dev_lbl = new QLabel( tr( "Device" ), this ); + auto dev_lbl = new QLabel(tr("Device"), this); dev_lbl->setFont( pointSize<7>( dev_lbl->font() ) ); dev_lbl->move( 8, 38 ); diff --git a/src/core/audio/AudioPulseAudio.cpp b/src/core/audio/AudioPulseAudio.cpp index d1476f836..bac997075 100644 --- a/src/core/audio/AudioPulseAudio.cpp +++ b/src/core/audio/AudioPulseAudio.cpp @@ -152,7 +152,7 @@ static void stream_state_callback( pa_stream *s, void * userdata ) /* This is called whenever the context status changes */ static void context_state_callback(pa_context *c, void *userdata) { - AudioPulseAudio * _this = static_cast( userdata ); + auto _this = static_cast(userdata); switch( pa_context_get_state( c ) ) { case PA_CONTEXT_CONNECTING: @@ -247,7 +247,7 @@ void AudioPulseAudio::run() else { const fpp_t fpp = audioEngine()->framesPerPeriod(); - surroundSampleFrame * temp = new surroundSampleFrame[fpp]; + auto temp = new surroundSampleFrame[fpp]; while( getNextBuffer( temp ) ) { } @@ -266,8 +266,8 @@ void AudioPulseAudio::run() void AudioPulseAudio::streamWriteCallback( pa_stream *s, size_t length ) { const fpp_t fpp = audioEngine()->framesPerPeriod(); - surroundSampleFrame * temp = new surroundSampleFrame[fpp]; - int_sample_t* pcmbuf = (int_sample_t *)pa_xmalloc( fpp * channels() * sizeof(int_sample_t) ); + auto temp = new surroundSampleFrame[fpp]; + auto pcmbuf = (int_sample_t*)pa_xmalloc(fpp * channels() * sizeof(int_sample_t)); size_t fd = 0; while( fd < length/4 && m_quit == false ) @@ -315,11 +315,11 @@ AudioPulseAudio::setupWidget::setupWidget( QWidget * _parent ) : m_device = new QLineEdit( AudioPulseAudio::probeDevice(), this ); m_device->setGeometry( 10, 20, 160, 20 ); - QLabel * dev_lbl = new QLabel( tr( "Device" ), this ); + auto dev_lbl = new QLabel(tr("Device"), this); dev_lbl->setFont( pointSize<7>( dev_lbl->font() ) ); dev_lbl->setGeometry( 10, 40, 160, 10 ); - gui::LcdSpinBoxModel * m = new gui::LcdSpinBoxModel( /* this */ ); + auto m = new gui::LcdSpinBoxModel(/* this */); m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS ); m->setStep( 2 ); m->setValue( ConfigManager::inst()->value( "audiopa", diff --git a/src/core/audio/AudioSampleRecorder.cpp b/src/core/audio/AudioSampleRecorder.cpp index 358a9b897..a380ae121 100644 --- a/src/core/audio/AudioSampleRecorder.cpp +++ b/src/core/audio/AudioSampleRecorder.cpp @@ -75,7 +75,7 @@ void AudioSampleRecorder::createSampleBuffer( SampleBuffer** sampleBuf ) { const f_cnt_t frames = framesRecorded(); // create buffer to store all recorded buffers in - sampleFrame * data = new sampleFrame[frames]; + auto data = new sampleFrame[frames]; // make sure buffer is cleaned up properly at the end... sampleFrame * data_ptr = data; @@ -102,7 +102,7 @@ void AudioSampleRecorder::createSampleBuffer( SampleBuffer** sampleBuf ) void AudioSampleRecorder::writeBuffer( const surroundSampleFrame * _ab, const fpp_t _frames, const float ) { - sampleFrame * buf = new sampleFrame[_frames]; + auto buf = new sampleFrame[_frames]; for( fpp_t frame = 0; frame < _frames; ++frame ) { for( ch_cnt_t chnl = 0; chnl < DEFAULT_CHANNELS; ++chnl ) diff --git a/src/core/audio/AudioSdl.cpp b/src/core/audio/AudioSdl.cpp index 8d4687518..e73ccadc1 100644 --- a/src/core/audio/AudioSdl.cpp +++ b/src/core/audio/AudioSdl.cpp @@ -225,7 +225,7 @@ void AudioSdl::applyQualitySettings() void AudioSdl::sdlAudioCallback( void * _udata, Uint8 * _buf, int _len ) { - AudioSdl * _this = static_cast( _udata ); + auto _this = static_cast(_udata); _this->sdlAudioCallback( _buf, _len ); } @@ -310,13 +310,13 @@ void AudioSdl::sdlAudioCallback( Uint8 * _buf, int _len ) #ifdef LMMS_HAVE_SDL2 void AudioSdl::sdlInputAudioCallback(void *_udata, Uint8 *_buf, int _len) { - AudioSdl * _this = static_cast( _udata ); + auto _this = static_cast(_udata); _this->sdlInputAudioCallback( _buf, _len ); } void AudioSdl::sdlInputAudioCallback(Uint8 *_buf, int _len) { - sampleFrame *samples_buffer = (sampleFrame *) _buf; + auto samples_buffer = (sampleFrame*)_buf; fpp_t frames = _len / sizeof ( sampleFrame ); audioEngine()->pushInputFrames (samples_buffer, frames); @@ -331,7 +331,7 @@ AudioSdl::setupWidget::setupWidget( QWidget * _parent ) : m_device = new QLineEdit( dev, this ); m_device->setGeometry( 10, 20, 160, 20 ); - QLabel * dev_lbl = new QLabel( tr( "Device" ), this ); + auto dev_lbl = new QLabel(tr("Device"), this); dev_lbl->setFont( pointSize<7>( dev_lbl->font() ) ); dev_lbl->setGeometry( 10, 40, 160, 10 ); diff --git a/src/core/lv2/Lv2Evbuf.cpp b/src/core/lv2/Lv2Evbuf.cpp index 2d2ad0517..acfb9b8aa 100644 --- a/src/core/lv2/Lv2Evbuf.cpp +++ b/src/core/lv2/Lv2Evbuf.cpp @@ -57,8 +57,7 @@ LV2_Evbuf* lv2_evbuf_new(uint32_t capacity, uint32_t atom_Chunk, uint32_t atom_Sequence) { // FIXME: memory must be 64-bit aligned - LV2_Evbuf* evbuf = (LV2_Evbuf*)malloc( - sizeof(LV2_Evbuf) + sizeof(LV2_Atom_Sequence) + capacity); + auto evbuf = (LV2_Evbuf*)malloc(sizeof(LV2_Evbuf) + sizeof(LV2_Atom_Sequence) + capacity); evbuf->capacity = capacity; evbuf->atom_Chunk = atom_Chunk; evbuf->atom_Sequence = atom_Sequence; @@ -155,8 +154,7 @@ lv2_evbuf_get(LV2_Evbuf_Iterator iter, } LV2_Atom_Sequence* aseq = &iter.evbuf->buf; - LV2_Atom_Event* aev = (LV2_Atom_Event*)( - (char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, aseq) + iter.offset); + auto aev = (LV2_Atom_Event*)((char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, aseq) + iter.offset); *frames = aev->time.frames; *type = aev->body.type; @@ -179,8 +177,7 @@ lv2_evbuf_write(LV2_Evbuf_Iterator* iter, return false; } - LV2_Atom_Event* aev = (LV2_Atom_Event*)( - (char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, aseq) + iter->offset); + auto aev = (LV2_Atom_Event*)((char*)LV2_ATOM_CONTENTS(LV2_Atom_Sequence, aseq) + iter->offset); aev->time.frames = frames; aev->body.type = type; diff --git a/src/core/lv2/Lv2Proc.cpp b/src/core/lv2/Lv2Proc.cpp index 4a2826752..f319f3b57 100644 --- a/src/core/lv2/Lv2Proc.cpp +++ b/src/core/lv2/Lv2Proc.cpp @@ -500,7 +500,7 @@ void Lv2Proc::createPort(std::size_t portNum) { case Lv2Ports::Type::Control: { - Lv2Ports::Control* ctrl = new Lv2Ports::Control; + auto ctrl = new Lv2Ports::Control; if (meta.m_flow == Lv2Ports::Flow::Input) { AutoLilvNode node(lilv_port_get_name(m_plugin, lilvPort)); @@ -542,9 +542,7 @@ void Lv2Proc::createPort(std::size_t portNum) break; case Lv2Ports::Vis::Enumeration: { - ComboBoxModel* comboModel - = new ComboBoxModel( - nullptr, dispName); + auto comboModel = new ComboBoxModel(nullptr, dispName); LilvScalePoints* sps = lilv_port_get_scale_points(m_plugin, lilvPort); LILV_FOREACH(scale_points, i, sps) @@ -578,18 +576,14 @@ void Lv2Proc::createPort(std::size_t portNum) } case Lv2Ports::Type::Audio: { - Lv2Ports::Audio* audio = - new Lv2Ports::Audio( - static_cast( - Engine::audioEngine()->framesPerPeriod()), - portIsSideChain(m_plugin, lilvPort) - ); + auto audio = new Lv2Ports::Audio(static_cast(Engine::audioEngine()->framesPerPeriod()), + portIsSideChain(m_plugin, lilvPort)); port = audio; break; } case Lv2Ports::Type::AtomSeq: { - Lv2Ports::AtomSeq* atomPort = new Lv2Ports::AtomSeq; + auto atomPort = new Lv2Ports::AtomSeq; { AutoLilvNode uriAtomSupports(Engine::getLv2Manager()->uri(LV2_ATOM__supports)); diff --git a/src/core/lv2/Lv2SubPluginFeatures.cpp b/src/core/lv2/Lv2SubPluginFeatures.cpp index ce950c6ba..4fb377b1c 100644 --- a/src/core/lv2/Lv2SubPluginFeatures.cpp +++ b/src/core/lv2/Lv2SubPluginFeatures.cpp @@ -72,23 +72,23 @@ void Lv2SubPluginFeatures::fillDescriptionWidget(QWidget *parent, { const LilvPlugin *plug = getPlugin(*k); - QLabel *label = new QLabel(parent); + auto label = new QLabel(parent); label->setText(QWidget::tr("Name: ") + pluginName(plug)); - QLabel *label2 = new QLabel(parent); + auto label2 = new QLabel(parent); label2->setText(QWidget::tr("URI: ") + lilv_node_as_uri(lilv_plugin_get_uri(plug))); - QWidget *maker = new QWidget(parent); - QHBoxLayout *l = new QHBoxLayout(maker); + auto maker = new QWidget(parent); + auto l = new QHBoxLayout(maker); l->setMargin(0); l->setSpacing(0); - QLabel *maker_label = new QLabel(maker); + auto maker_label = new QLabel(maker); maker_label->setText(QWidget::tr("Maker: ")); maker_label->setAlignment(Qt::AlignTop); - QLabel *maker_content = new QLabel(maker); + auto maker_content = new QLabel(maker); maker_content->setText( qStringFromPluginNode(plug, lilv_plugin_get_author_name)); maker_content->setWordWrap(true); @@ -96,17 +96,17 @@ void Lv2SubPluginFeatures::fillDescriptionWidget(QWidget *parent, l->addWidget(maker_label); l->addWidget(maker_content, 1); - QWidget *copyright = new QWidget(parent); + auto copyright = new QWidget(parent); l = new QHBoxLayout(copyright); l->setMargin(0); l->setSpacing(0); copyright->setMinimumWidth(parent->minimumWidth()); - QLabel *copyright_label = new QLabel(copyright); + auto copyright_label = new QLabel(copyright); copyright_label->setText(QWidget::tr("Copyright: ")); copyright_label->setAlignment(Qt::AlignTop); - QLabel *copyright_content = new QLabel(copyright); + auto copyright_content = new QLabel(copyright); copyright_content->setText(""); copyright_content->setWordWrap(true); l->addWidget(copyright_label); diff --git a/src/core/lv2/Lv2UridMap.cpp b/src/core/lv2/Lv2UridMap.cpp index 4709f4898..ecc28693f 100644 --- a/src/core/lv2/Lv2UridMap.cpp +++ b/src/core/lv2/Lv2UridMap.cpp @@ -33,13 +33,13 @@ namespace lmms static LV2_URID staticMap(LV2_URID_Map_Handle handle, const char* uri) { - UridMap* map = static_cast(handle); + auto map = static_cast(handle); return map->map(uri); } static const char* staticUnmap(LV2_URID_Unmap_Handle handle, LV2_URID urid) { - UridMap* map = static_cast(handle); + auto map = static_cast(handle); return map->unmap(urid); } diff --git a/src/core/main.cpp b/src/core/main.cpp index 58758c2b1..da13181fe 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -126,7 +126,7 @@ void consoleMessageHandler(QtMsgType type, inline void loadTranslation( const QString & tname, const QString & dir = lmms::ConfigManager::inst()->localeDir() ) { - QTranslator * t = new QTranslator( QCoreApplication::instance() ); + auto t = new QTranslator(QCoreApplication::instance()); QString name = tname + ".qm"; if (t->load(name, dir)) @@ -829,12 +829,12 @@ int main( int argc, char * * argv ) } // create renderer - RenderManager * r = new RenderManager( qs, os, eff, renderOut ); + auto r = new RenderManager(qs, os, eff, renderOut); QCoreApplication::instance()->connect( r, SIGNAL(finished()), SLOT(quit())); // timer for progress-updates - QTimer * t = new QTimer( r ); + auto t = new QTimer(r); r->connect( t, SIGNAL(timeout()), SLOT(updateConsoleProgress())); t->start( 200 ); diff --git a/src/core/midi/MidiAlsaSeq.cpp b/src/core/midi/MidiAlsaSeq.cpp index b7d46fe4f..b770d914c 100644 --- a/src/core/midi/MidiAlsaSeq.cpp +++ b/src/core/midi/MidiAlsaSeq.cpp @@ -164,7 +164,7 @@ void MidiAlsaSeq::processOutEvent( const MidiEvent& event, const TimePos& time, // HACK!!! - need a better solution which isn't that easy since we // cannot store const-ptrs in our map because we need to call non-const // methods of MIDI-port - it's a mess... - MidiPort* p = const_cast( port ); + auto p = const_cast(port); snd_seq_event_t ev; snd_seq_ev_clear( &ev ); @@ -353,8 +353,7 @@ QString MidiAlsaSeq::sourcePortName( const MidiEvent & _event ) const { if( _event.sourcePort() ) { - const snd_seq_addr_t * addr = - static_cast( _event.sourcePort() ); + const auto addr = static_cast(_event.sourcePort()); return portName( m_seqHandle, addr ); } return MidiClient::sourcePortName( _event ); @@ -462,7 +461,7 @@ void MidiAlsaSeq::run() // watch the pipe and sequencer input events int pollfd_count = snd_seq_poll_descriptors_count( m_seqHandle, POLLIN ); - struct pollfd * pollfd_set = new struct pollfd[pollfd_count + 1]; + auto pollfd_set = new struct pollfd[pollfd_count + 1]; snd_seq_poll_descriptors( m_seqHandle, pollfd_set + 1, pollfd_count, POLLIN ); pollfd_set[0].fd = m_pipe[0]; diff --git a/src/core/midi/MidiJack.cpp b/src/core/midi/MidiJack.cpp index 1ad4da09d..145a72ecc 100644 --- a/src/core/midi/MidiJack.cpp +++ b/src/core/midi/MidiJack.cpp @@ -41,7 +41,7 @@ namespace lmms /* callback functions for jack */ static int JackMidiProcessCallback(jack_nframes_t nframes, void *arg) { - MidiJack *jmd = (MidiJack *)arg; + auto jmd = (MidiJack*)arg; if (nframes <= 0) return (0); diff --git a/src/gui/AudioAlsaSetupWidget.cpp b/src/gui/AudioAlsaSetupWidget.cpp index 8a253c75a..4ea6d4c58 100644 --- a/src/gui/AudioAlsaSetupWidget.cpp +++ b/src/gui/AudioAlsaSetupWidget.cpp @@ -67,11 +67,11 @@ AudioAlsaSetupWidget::AudioAlsaSetupWidget( QWidget * _parent ) : SIGNAL(currentIndexChanged(int)), SLOT(onCurrentIndexChanged(int))); - QLabel * dev_lbl = new QLabel( tr( "DEVICE" ), this ); + auto dev_lbl = new QLabel(tr("DEVICE"), this); dev_lbl->setFont( pointSize<7>( dev_lbl->font() ) ); dev_lbl->setGeometry( 10, 40, 160, 10 ); - LcdSpinBoxModel * m = new LcdSpinBoxModel( /* this */ ); + auto m = new LcdSpinBoxModel(/* this */); m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS ); m->setStep( 2 ); m->setValue( ConfigManager::inst()->value( "audioalsa", diff --git a/src/gui/AutomatableModelView.cpp b/src/gui/AutomatableModelView.cpp index 365a5749e..52ee1ed7e 100644 --- a/src/gui/AutomatableModelView.cpp +++ b/src/gui/AutomatableModelView.cpp @@ -55,7 +55,7 @@ void AutomatableModelView::addDefaultActions( QMenu* menu ) { AutomatableModel* model = modelUntyped(); - AutomatableModelViewSlots* amvSlots = new AutomatableModelViewSlots( this, menu ); + auto amvSlots = new AutomatableModelViewSlots(this, menu); menu->addAction( embed::getIconPixmap( "reload" ), AutomatableModel::tr( "&Reset (%1%2)" ). @@ -230,7 +230,7 @@ void AutomatableModelViewSlots::execConnectionDialog() // New else { - ControllerConnection* cc = new ControllerConnection(d.chosenController()); + auto cc = new ControllerConnection(d.chosenController()); m->setControllerConnection( cc ); //cc->setTargetName( m->displayName() ); } diff --git a/src/gui/ControlLayout.cpp b/src/gui/ControlLayout.cpp index 356d608e3..7e0976c94 100644 --- a/src/gui/ControlLayout.cpp +++ b/src/gui/ControlLayout.cpp @@ -309,7 +309,7 @@ int ControlLayout::smartSpacing(QStyle::PixelMetric pm) const if (!parent) { return -1; } else if (parent->isWidgetType()) { - QWidget *pw = static_cast(parent); + auto pw = static_cast(parent); return pw->style()->pixelMetric(pm, nullptr, pw); } else { return static_cast(parent)->spacing(); } diff --git a/src/gui/ControllerRackView.cpp b/src/gui/ControllerRackView.cpp index e110067d6..54c325dc6 100644 --- a/src/gui/ControllerRackView.cpp +++ b/src/gui/ControllerRackView.cpp @@ -53,7 +53,7 @@ ControllerRackView::ControllerRackView() : m_scrollArea->setPalette( QApplication::palette( m_scrollArea ) ); m_scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); - QWidget * scrollAreaWidget = new QWidget( m_scrollArea ); + auto scrollAreaWidget = new QWidget(m_scrollArea); m_scrollAreaLayout = new QVBoxLayout( scrollAreaWidget ); m_scrollAreaLayout->addStretch(); scrollAreaWidget->setLayout( m_scrollAreaLayout ); @@ -71,7 +71,7 @@ ControllerRackView::ControllerRackView() : connect( song, SIGNAL(controllerAdded(lmms::Controller*)), SLOT(onControllerAdded(lmms::Controller*))); connect( song, SIGNAL(controllerRemoved(lmms::Controller*)), SLOT(onControllerRemoved(lmms::Controller*))); - QVBoxLayout * layout = new QVBoxLayout(); + auto layout = new QVBoxLayout(); layout->addWidget( m_scrollArea ); layout->addWidget( m_addButton ); this->setLayout( layout ); @@ -139,7 +139,7 @@ void ControllerRackView::onControllerAdded( Controller * controller ) { QWidget * scrollAreaWidget = m_scrollArea->widget(); - ControllerView * controllerView = new ControllerView( controller, scrollAreaWidget ); + auto controllerView = new ControllerView(controller, scrollAreaWidget); connect( controllerView, SIGNAL(deleteController(lmms::gui::ControllerView*)), this, SLOT(deleteController(lmms::gui::ControllerView*)), Qt::QueuedConnection ); diff --git a/src/gui/ControllerView.cpp b/src/gui/ControllerView.cpp index 903c02862..3e3f4b9d1 100644 --- a/src/gui/ControllerView.cpp +++ b/src/gui/ControllerView.cpp @@ -54,19 +54,19 @@ ControllerView::ControllerView( Controller * _model, QWidget * _parent ) : this->setFrameStyle( QFrame::StyledPanel ); this->setFrameShadow( QFrame::Raised ); - QVBoxLayout *vBoxLayout = new QVBoxLayout(this); + auto vBoxLayout = new QVBoxLayout(this); - QHBoxLayout *hBox = new QHBoxLayout(); + auto hBox = new QHBoxLayout(); vBoxLayout->addLayout(hBox); - QLabel *label = new QLabel( "" + _model->displayName() + "", this); + auto label = new QLabel("" + _model->displayName() + "", this); QSizePolicy sizePolicy = label->sizePolicy(); sizePolicy.setHorizontalStretch(1); label->setSizePolicy(sizePolicy); hBox->addWidget(label); - QPushButton * controlsButton = new QPushButton( tr( "Controls" ), this ); + auto controlsButton = new QPushButton(tr("Controls"), this); connect( controlsButton, SIGNAL(clicked()), SLOT(editControls())); hBox->addWidget(controlsButton); @@ -141,7 +141,7 @@ void ControllerView::deleteController() void ControllerView::renameController() { bool ok; - Controller * c = castModel(); + auto c = castModel(); QString new_name = QInputDialog::getText( this, tr( "Rename controller" ), tr( "Enter the new name for this controller" ), diff --git a/src/gui/Controls.cpp b/src/gui/Controls.cpp index 088d54657..8c007ee99 100644 --- a/src/gui/Controls.cpp +++ b/src/gui/Controls.cpp @@ -72,7 +72,7 @@ ComboControl::ComboControl(QWidget *parent) : m_label(new QLabel(m_widget)) { m_combo->setFixedSize(64, ComboBox::DEFAULT_HEIGHT); - QVBoxLayout* vbox = new QVBoxLayout(m_widget); + auto vbox = new QVBoxLayout(m_widget); vbox->addWidget(m_combo); vbox->addWidget(m_label); m_combo->repaint(); @@ -98,7 +98,7 @@ CheckControl::CheckControl(QWidget *parent) : m_checkBox(new LedCheckBox(nullptr, QString(), LedCheckBox::Green)), m_label(new QLabel(m_widget)) { - QVBoxLayout* vbox = new QVBoxLayout(m_widget); + auto vbox = new QVBoxLayout(m_widget); vbox->addWidget(m_checkBox); vbox->addWidget(m_label); } diff --git a/src/gui/EffectRackView.cpp b/src/gui/EffectRackView.cpp index d946e753d..7bcef202c 100644 --- a/src/gui/EffectRackView.cpp +++ b/src/gui/EffectRackView.cpp @@ -41,13 +41,13 @@ EffectRackView::EffectRackView( EffectChain* model, QWidget* parent ) : QWidget( parent ), ModelView( nullptr, this ) { - QVBoxLayout* mainLayout = new QVBoxLayout( this ); + auto mainLayout = new QVBoxLayout(this); mainLayout->setMargin( 5 ); m_effectsGroupBox = new GroupBox( tr( "EFFECTS CHAIN" ) ); mainLayout->addWidget( m_effectsGroupBox ); - QVBoxLayout* effectsLayout = new QVBoxLayout( m_effectsGroupBox ); + auto effectsLayout = new QVBoxLayout(m_effectsGroupBox); effectsLayout->setSpacing( 0 ); effectsLayout->setContentsMargins( 2, m_effectsGroupBox->titleBarHeight() + 2, 2, 2 ); @@ -60,7 +60,7 @@ EffectRackView::EffectRackView( EffectChain* model, QWidget* parent ) : effectsLayout->addWidget( m_scrollArea ); - QPushButton* addButton = new QPushButton; + auto addButton = new QPushButton; addButton->setText( tr( "Add effect" ) ); effectsLayout->addWidget( addButton ); @@ -170,7 +170,7 @@ void EffectRackView::update() } if( i >= m_effectViews.size() ) { - EffectView * view = new EffectView( *it, w ); + auto view = new EffectView(*it, w); connect( view, SIGNAL(moveUp(lmms::gui::EffectView*)), this, SLOT(moveUp(lmms::gui::EffectView*))); connect( view, SIGNAL(moveDown(lmms::gui::EffectView*)), diff --git a/src/gui/EffectView.cpp b/src/gui/EffectView.cpp index 820f9907d..fed1ce4e9 100644 --- a/src/gui/EffectView.cpp +++ b/src/gui/EffectView.cpp @@ -85,8 +85,7 @@ EffectView::EffectView( Effect * _model, QWidget * _parent ) : if( effect()->controls()->controlCount() > 0 ) { - QPushButton * ctls_btn = new QPushButton( tr( "Controls" ), - this ); + auto ctls_btn = new QPushButton(tr("Controls"), this); QFont f = ctls_btn->font(); ctls_btn->setFont( pointSize<8>( f ) ); ctls_btn->setGeometry( 150, 14, 50, 20 ); diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index 0a6f8a216..dd987b93a 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -115,10 +115,10 @@ FileBrowser::FileBrowser(const QString & directories, const QString & filter, addContentCheckBox(); } - QWidget * searchWidget = new QWidget( contentParent() ); + auto searchWidget = new QWidget(contentParent()); searchWidget->setFixedHeight( 24 ); - QHBoxLayout * searchWidgetLayout = new QHBoxLayout( searchWidget ); + auto searchWidgetLayout = new QHBoxLayout(searchWidget); searchWidgetLayout->setMargin( 0 ); searchWidgetLayout->setSpacing( 0 ); @@ -128,9 +128,7 @@ FileBrowser::FileBrowser(const QString & directories, const QString & filter, connect( m_filterEdit, SIGNAL( textEdited( const QString& ) ), this, SLOT( filterItems( const QString& ) ) ); - QPushButton * reload_btn = new QPushButton( - embed::getIconPixmap( "reload" ), - QString(), searchWidget ); + auto reload_btn = new QPushButton(embed::getIconPixmap("reload"), QString(), searchWidget); reload_btn->setToolTip( tr( "Refresh list" ) ); connect( reload_btn, SIGNAL(clicked()), this, SLOT(reloadTree())); @@ -144,7 +142,7 @@ FileBrowser::FileBrowser(const QString & directories, const QString & filter, addContentWidget( m_fileBrowserTreeWidget ); // Whenever the FileBrowser has focus, Ctrl+F should direct focus to its filter box. - QShortcut *filterFocusShortcut = new QShortcut( QKeySequence( QKeySequence::Find ), this, SLOT(giveFocusToFilter())); + auto filterFocusShortcut = new QShortcut(QKeySequence(QKeySequence::Find), this, SLOT(giveFocusToFilter())); filterFocusShortcut->setContext(Qt::WidgetWithChildrenShortcut); reloadTree(); @@ -241,7 +239,7 @@ void FileBrowser::expandItems( QTreeWidgetItem * item, QList expandedDi { it->setExpanded( true ); } - Directory *d = dynamic_cast ( it ); + auto d = dynamic_cast(it); if (d) { d->update(); @@ -290,13 +288,11 @@ void FileBrowser::addItems(const QString & path ) bool orphan = true; for( int i = 0; i < m_fileBrowserTreeWidget->topLevelItemCount(); ++i ) { - Directory * d = dynamic_cast( - m_fileBrowserTreeWidget->topLevelItem( i ) ); + auto d = dynamic_cast(m_fileBrowserTreeWidget->topLevelItem(i)); if( d == nullptr || cur_file < d->text( 0 ) ) { // insert before item, we're done - Directory *dd = new Directory( cur_file, path, - m_filter ); + auto dd = new Directory(cur_file, path, m_filter); m_fileBrowserTreeWidget->insertTopLevelItem( i,dd ); dd->update(); // add files to the directory orphan = false; @@ -319,8 +315,7 @@ void FileBrowser::addItems(const QString & path ) { // it has not yet been added yet, so it's (lexically) // larger than all other dirs => append it at the bottom - Directory *d = new Directory( cur_file, - path, m_filter ); + auto d = new Directory(cur_file, path, m_filter); d->update(); m_fileBrowserTreeWidget->addTopLevelItem( d ); } @@ -411,7 +406,7 @@ QList FileBrowserTreeWidget::expandedDirs( QTreeWidgetItem * item ) con // Add expanded top level directories. if (it->isExpanded() && (it->type() == TypeDirectoryItem)) { - Directory *d = static_cast ( it ); + auto d = static_cast(it); dirs.append( d->fullName() ); } @@ -444,7 +439,7 @@ void FileBrowserTreeWidget::keyPressEvent(QKeyEvent * ke ) else if (vertical || horizontal || preview || insert) { stopPreview(); } // Try to get the currently selected item as a FileItem - FileItem * file = dynamic_cast(currentItem()); + auto file = dynamic_cast(currentItem()); // If it's null (folder, separator, etc.), there's nothing left for us to do if (file == nullptr) { return; } @@ -505,7 +500,7 @@ void FileBrowserTreeWidget::focusOutEvent(QFocusEvent* fe) void FileBrowserTreeWidget::contextMenuEvent(QContextMenuEvent * e ) { - FileItem * file = dynamic_cast( itemAt( e->pos() ) ); + auto file = dynamic_cast(itemAt(e->pos())); if( file != nullptr && file->isTrack() ) { QMenu contextMenu( this ); @@ -523,12 +518,12 @@ void FileBrowserTreeWidget::contextMenuEvent(QContextMenuEvent * e ) [=]{ openContainingFolder(file); } ); - QAction* songEditorHeader = new QAction( tr("Song Editor"), nullptr ); + auto songEditorHeader = new QAction(tr("Song Editor"), nullptr); songEditorHeader->setDisabled(true); contextMenu.addAction( songEditorHeader ); contextMenu.addActions( getContextActions(file, true) ); - QAction* patternEditorHeader = new QAction(tr("Pattern Editor"), nullptr); + auto patternEditorHeader = new QAction(tr("Pattern Editor"), nullptr); patternEditorHeader->setDisabled(true); contextMenu.addAction(patternEditorHeader); contextMenu.addActions( getContextActions(file, false) ); @@ -551,20 +546,14 @@ QList FileBrowserTreeWidget::getContextActions(FileItem* file, bool so tr("Send to new instrument track"); QString shortcutMod = songEditor ? "" : UI_CTRL_KEY + QString(" + "); - QAction* toInstrument = new QAction( - instrumentAction + tr(" (%2Enter)").arg(shortcutMod), - nullptr - ); + auto toInstrument = new QAction(instrumentAction + tr(" (%2Enter)").arg(shortcutMod), nullptr); connect(toInstrument, &QAction::triggered, [=]{ openInNewInstrumentTrack(file, songEditor); }); result.append(toInstrument); if (songEditor && fileIsSample) { - QAction* toSampleTrack = new QAction( - tr("Send to new sample track (Shift + Enter)"), - nullptr - ); + auto toSampleTrack = new QAction(tr("Send to new sample track (Shift + Enter)"), nullptr); connect(toSampleTrack, &QAction::triggered, [=]{ openInNewSampleTrack(file); }); result.append(toSampleTrack); @@ -598,7 +587,7 @@ void FileBrowserTreeWidget::mousePressEvent(QMouseEvent * me ) // } } - FileItem * f = dynamic_cast(i); + auto f = dynamic_cast(i); if(f != nullptr) { previewFileItem(f); } } @@ -626,7 +615,7 @@ void FileBrowserTreeWidget::previewFileItem(FileItem* file) embed::getIconPixmap("sample_file", 24, 24), 0); // TODO: this can be removed once we do this outside the event thread qApp->processEvents(QEventLoop::ExcludeUserInputEvents); - SamplePlayHandle* s = new SamplePlayHandle(fileName); + auto s = new SamplePlayHandle(fileName); s->setDoneMayReturnTrue(false); newPPH = s; delete tf; @@ -691,7 +680,7 @@ void FileBrowserTreeWidget::mouseMoveEvent( QMouseEvent * me ) // make sure any playback is stopped mouseReleaseEvent( nullptr ); - FileItem * f = dynamic_cast( itemAt( m_pressPos ) ); + auto f = dynamic_cast(itemAt(m_pressPos)); if( f != nullptr ) { switch( f->type() ) @@ -808,7 +797,7 @@ void FileBrowserTreeWidget::handleFile(FileItem * f, InstrumentTrack * it) void FileBrowserTreeWidget::activateListItem(QTreeWidgetItem * item, int column ) { - FileItem * f = dynamic_cast( item ); + auto f = dynamic_cast(item); if( f == nullptr ) { return; @@ -821,9 +810,7 @@ void FileBrowserTreeWidget::activateListItem(QTreeWidgetItem * item, } else if( f->handling() != FileItem::NotSupported ) { - InstrumentTrack * it = dynamic_cast( - Track::create(Track::InstrumentTrack, Engine::patternStore()) - ); + auto it = dynamic_cast(Track::create(Track::InstrumentTrack, Engine::patternStore())); handleFile( f, it ); } } @@ -835,8 +822,7 @@ void FileBrowserTreeWidget::openInNewInstrumentTrack(TrackContainer* tc, FileIte { if(item->isTrack()) { - InstrumentTrack * it = dynamic_cast( - Track::create(Track::InstrumentTrack, tc)); + auto it = dynamic_cast(Track::create(Track::InstrumentTrack, tc)); handleFile(item, it); } } @@ -861,8 +847,7 @@ bool FileBrowserTreeWidget::openInNewSampleTrack(FileItem* item) if (item->type() != FileItem::SampleFile) { return false; } // Create a new sample track for this sample - SampleTrack* sampleTrack = static_cast( - Track::create(Track::SampleTrack, Engine::getSong())); + auto sampleTrack = static_cast(Track::create(Track::SampleTrack, Engine::getSong())); // Add the sample clip to the track Engine::audioEngine()->requestChangeInModel(); @@ -902,9 +887,7 @@ void FileBrowserTreeWidget::sendToActiveInstrumentTrack( FileItem* item ) // instrument-track while( w.hasPrevious() ) { - InstrumentTrackWindow * itw = - dynamic_cast( - w.previous()->widget() ); + auto itw = dynamic_cast(w.previous()->widget()); if( itw != nullptr && itw->isHidden() == false ) { handleFile( item, itw->model() ); @@ -918,7 +901,7 @@ void FileBrowserTreeWidget::sendToActiveInstrumentTrack( FileItem* item ) void FileBrowserTreeWidget::updateDirectory(QTreeWidgetItem * item ) { - Directory * dir = dynamic_cast( item ); + auto dir = dynamic_cast(item); if( dir != nullptr ) { dir->update(); @@ -1009,7 +992,7 @@ void Directory::update() int filesNow = childCount() - m_dirCount; if(filesNow > filesBeforeAdd) // any file appended? { - QTreeWidgetItem * sep = new QTreeWidgetItem; + auto sep = new QTreeWidgetItem; sep->setText( 0, FileBrowserTreeWidget::tr( "--- Factory files ---" ) ); @@ -1049,8 +1032,7 @@ bool Directory::addItems(const QString & path ) bool orphan = true; for( int i = 0; i < childCount(); ++i ) { - Directory * d = dynamic_cast( - child( i ) ); + auto d = dynamic_cast(child(i)); if( d == nullptr || cur_file < d->text( 0 ) ) { // insert before item, we're done diff --git a/src/gui/GuiApplication.cpp b/src/gui/GuiApplication.cpp index a016aaea5..3370cbc6e 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -91,11 +91,11 @@ GuiApplication::GuiApplication() QDir::addSearchPath("artwork", ConfigManager::inst()->defaultThemeDir()); QDir::addSearchPath("artwork", ":/artwork"); - LmmsStyle* lmmsstyle = new LmmsStyle(); + auto lmmsstyle = new LmmsStyle(); QApplication::setStyle(lmmsstyle); - LmmsPalette* lmmspal = new LmmsPalette(nullptr, lmmsstyle); - QPalette* lpal = new QPalette(lmmspal->palette()); + auto lmmspal = new LmmsPalette(nullptr, lmmsstyle); + auto lpal = new QPalette(lmmspal->palette()); QApplication::setPalette( *lpal ); LmmsStyle::s_palette = lpal; diff --git a/src/gui/LadspaControlView.cpp b/src/gui/LadspaControlView.cpp index d8c167a1c..38ad4a146 100644 --- a/src/gui/LadspaControlView.cpp +++ b/src/gui/LadspaControlView.cpp @@ -42,7 +42,7 @@ LadspaControlView::LadspaControlView( QWidget * _parent, ModelView( _ctl, this ), m_ctl( _ctl ) { - QHBoxLayout * layout = new QHBoxLayout( this ); + auto layout = new QHBoxLayout(this); layout->setMargin( 0 ); layout->setSpacing( 0 ); @@ -62,8 +62,7 @@ LadspaControlView::LadspaControlView( QWidget * _parent, { case TOGGLED: { - LedCheckBox * toggle = new LedCheckBox( - m_ctl->port()->name, this, QString(), LedCheckBox::Green ); + auto toggle = new LedCheckBox(m_ctl->port()->name, this, QString(), LedCheckBox::Green); toggle->setModel( m_ctl->toggledModel() ); layout->addWidget( toggle ); if( link != nullptr ) diff --git a/src/gui/LfoControllerDialog.cpp b/src/gui/LfoControllerDialog.cpp index b0606dfe9..9e58d3e18 100644 --- a/src/gui/LfoControllerDialog.cpp +++ b/src/gui/LfoControllerDialog.cpp @@ -81,7 +81,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent m_phaseKnob->move( CD_LFO_PHASE_CD_KNOB_X, CD_LFO_CD_KNOB_Y ); m_phaseKnob->setHintText( tr( "Phase offset:" ) , "" + tr( " degrees" ) ); - PixmapButton * sin_wave_btn = new PixmapButton( this, nullptr ); + auto sin_wave_btn = new PixmapButton(this, nullptr); sin_wave_btn->move( CD_LFO_SHAPES_X, CD_LFO_SHAPES_Y ); sin_wave_btn->setActiveGraphic( embed::getIconPixmap( "sin_wave_active" ) ); @@ -90,8 +90,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent sin_wave_btn->setToolTip( tr( "Sine wave" ) ); - PixmapButton * triangle_wave_btn = - new PixmapButton( this, nullptr ); + auto triangle_wave_btn = new PixmapButton(this, nullptr); triangle_wave_btn->move( CD_LFO_SHAPES_X + 15, CD_LFO_SHAPES_Y ); triangle_wave_btn->setActiveGraphic( embed::getIconPixmap( "triangle_wave_active" ) ); @@ -100,7 +99,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent triangle_wave_btn->setToolTip( tr( "Triangle wave" ) ); - PixmapButton * saw_wave_btn = new PixmapButton( this, nullptr ); + auto saw_wave_btn = new PixmapButton(this, nullptr); saw_wave_btn->move( CD_LFO_SHAPES_X + 30, CD_LFO_SHAPES_Y ); saw_wave_btn->setActiveGraphic( embed::getIconPixmap( "saw_wave_active" ) ); @@ -109,7 +108,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent saw_wave_btn->setToolTip( tr( "Saw wave" ) ); - PixmapButton * sqr_wave_btn = new PixmapButton( this, nullptr ); + auto sqr_wave_btn = new PixmapButton(this, nullptr); sqr_wave_btn->move( CD_LFO_SHAPES_X + 45, CD_LFO_SHAPES_Y ); sqr_wave_btn->setActiveGraphic( embed::getIconPixmap( "square_wave_active" ) ); @@ -118,8 +117,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent sqr_wave_btn->setToolTip( tr( "Square wave" ) ); - PixmapButton * moog_saw_wave_btn = - new PixmapButton( this, nullptr ); + auto moog_saw_wave_btn = new PixmapButton(this, nullptr); moog_saw_wave_btn->move( CD_LFO_SHAPES_X, CD_LFO_SHAPES_Y + 15 ); moog_saw_wave_btn->setActiveGraphic( embed::getIconPixmap( "moog_saw_wave_active" ) ); @@ -128,7 +126,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent moog_saw_wave_btn->setToolTip( tr( "Moog saw wave" ) ); - PixmapButton * exp_wave_btn = new PixmapButton( this, nullptr ); + auto exp_wave_btn = new PixmapButton(this, nullptr); exp_wave_btn->move( CD_LFO_SHAPES_X + 15, CD_LFO_SHAPES_Y + 15 ); exp_wave_btn->setActiveGraphic( embed::getIconPixmap( "exp_wave_active" ) ); @@ -137,7 +135,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent exp_wave_btn->setToolTip( tr( "Exponential wave" ) ); - PixmapButton * white_noise_btn = new PixmapButton( this, nullptr ); + auto white_noise_btn = new PixmapButton(this, nullptr); white_noise_btn->move( CD_LFO_SHAPES_X + 30, CD_LFO_SHAPES_Y + 15 ); white_noise_btn->setActiveGraphic( embed::getIconPixmap( "white_noise_wave_active" ) ); @@ -168,8 +166,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent m_waveBtnGrp->addButton( white_noise_btn ); m_waveBtnGrp->addButton( m_userWaveBtn ); - - PixmapButton * x1 = new PixmapButton( this, nullptr ); + auto x1 = new PixmapButton(this, nullptr); x1->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y +7); x1->setActiveGraphic( embed::getIconPixmap( "lfo_x1_active" ) ); @@ -178,7 +175,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent x1->setToolTip( tr( "Mutliply modulation frequency by 1" )); - PixmapButton * x100 = new PixmapButton( this, nullptr ); + auto x100 = new PixmapButton(this, nullptr); x100->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y - 8 ); x100->setActiveGraphic( embed::getIconPixmap( "lfo_x100_active" ) ); @@ -187,7 +184,7 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent x100->setToolTip( tr( "Mutliply modulation frequency by 100" )); - PixmapButton * d100 = new PixmapButton( this, nullptr ); + auto d100 = new PixmapButton(this, nullptr); d100->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y + 22 ); d100->setActiveGraphic( embed::getIconPixmap( "lfo_d100_active" ) ); diff --git a/src/gui/LinkedModelGroupViews.cpp b/src/gui/LinkedModelGroupViews.cpp index a16c930d5..f77edcdb9 100644 --- a/src/gui/LinkedModelGroupViews.cpp +++ b/src/gui/LinkedModelGroupViews.cpp @@ -86,13 +86,13 @@ void LinkedModelGroupView::addControl(Control* ctrl, const std::string& id, { if (ctrl) { - QWidget* box = new QWidget(this); - QHBoxLayout* boxLayout = new QHBoxLayout(box); + auto box = new QWidget(this); + auto boxLayout = new QHBoxLayout(box); boxLayout->addWidget(ctrl->topWidget()); if (removable) { - QPushButton* removeBtn = new QPushButton; + auto removeBtn = new QPushButton; removeBtn->setIcon( embed::getIconPixmap( "discard" ) ); QObject::connect(removeBtn, &QPushButton::clicked, this, [this,ctrl](bool){ diff --git a/src/gui/LmmsStyle.cpp b/src/gui/LmmsStyle.cpp index 6c4dd7fae..ee1824783 100644 --- a/src/gui/LmmsStyle.cpp +++ b/src/gui/LmmsStyle.cpp @@ -161,8 +161,7 @@ void LmmsStyle::drawComplexControl( ComplexControl control, // fix broken titlebar styling on win32 if( control == CC_TitleBar ) { - const QStyleOptionTitleBar * titleBar = - qstyleoption_cast(option ); + const auto titleBar = qstyleoption_cast(option); if( titleBar ) { QStyleOptionTitleBar so( *titleBar ); diff --git a/src/gui/Lv2ViewBase.cpp b/src/gui/Lv2ViewBase.cpp index 9e95fca2e..4347c37cd 100644 --- a/src/gui/Lv2ViewBase.cpp +++ b/src/gui/Lv2ViewBase.cpp @@ -136,9 +136,9 @@ AutoLilvNode Lv2ViewProc::uri(const char *uriStr) Lv2ViewBase::Lv2ViewBase(QWidget* meAsWidget, Lv2ControlBase *ctrlBase) { - QGridLayout* grid = new QGridLayout(meAsWidget); + auto grid = new QGridLayout(meAsWidget); - QHBoxLayout* btnBox = new QHBoxLayout(); + auto btnBox = new QHBoxLayout(); if (/* DISABLES CODE */ (false)) { m_reloadPluginButton = new QPushButton(QObject::tr("Reload Plugin"), @@ -169,7 +169,7 @@ Lv2ViewBase::Lv2ViewBase(QWidget* meAsWidget, Lv2ControlBase *ctrlBase) LILV_FOREACH(nodes, itr, props.get()) { const LilvNode* node = lilv_nodes_get(props.get(), itr); - QLabel* infoLabel = new QLabel(lilv_node_as_string(node)); + auto infoLabel = new QLabel(lilv_node_as_string(node)); infoLabel->setWordWrap(true); infoLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Expanding); diff --git a/src/gui/MainApplication.cpp b/src/gui/MainApplication.cpp index af8a71684..ab45ce304 100644 --- a/src/gui/MainApplication.cpp +++ b/src/gui/MainApplication.cpp @@ -50,7 +50,7 @@ bool MainApplication::event(QEvent* event) { case QEvent::FileOpen: { - QFileOpenEvent * fileEvent = static_cast(event); + auto fileEvent = static_cast(event); // Handle the project file m_queuedFile = fileEvent->file(); if(Engine::getSong()) diff --git a/src/gui/MainWindow.cpp b/src/gui/MainWindow.cpp index a77094b19..706d63e27 100644 --- a/src/gui/MainWindow.cpp +++ b/src/gui/MainWindow.cpp @@ -84,8 +84,8 @@ void disableAutoKeyAccelerators(QWidget* mainWindow) { using DisablerFunc = void(*)(QWidget*); QLibrary kf5WidgetsAddon("KF5WidgetsAddons", 5); - DisablerFunc setNoAccelerators = - reinterpret_cast(kf5WidgetsAddon.resolve("_ZN19KAcceleratorManager10setNoAccelEP7QWidget")); + auto setNoAccelerators + = reinterpret_cast(kf5WidgetsAddon.resolve("_ZN19KAcceleratorManager10setNoAccelEP7QWidget")); if(setNoAccelerators) { setNoAccelerators(mainWindow); @@ -108,19 +108,19 @@ MainWindow::MainWindow() : #endif setAttribute( Qt::WA_DeleteOnClose ); - QWidget * main_widget = new QWidget( this ); - QVBoxLayout * vbox = new QVBoxLayout( main_widget ); + auto main_widget = new QWidget(this); + auto vbox = new QVBoxLayout(main_widget); vbox->setSpacing( 0 ); vbox->setMargin( 0 ); - QWidget * w = new QWidget( main_widget ); - QHBoxLayout * hbox = new QHBoxLayout( w ); + auto w = new QWidget(main_widget); + auto hbox = new QHBoxLayout(w); hbox->setSpacing( 0 ); hbox->setMargin( 0 ); - SideBar * sideBar = new SideBar( Qt::Vertical, w ); + auto sideBar = new SideBar(Qt::Vertical, w); - QSplitter * splitter = new QSplitter( Qt::Horizontal, w ); + auto splitter = new QSplitter(Qt::Horizontal, w); splitter->setChildrenCollapsible( false ); ConfigManager* confMgr = ConfigManager::inst(); @@ -298,7 +298,7 @@ void MainWindow::finalize() // project-popup-menu - QMenu * project_menu = new QMenu( this ); + auto project_menu = new QMenu(this); menuBar()->addMenu( project_menu )->setText( tr( "&File" ) ); project_menu->addAction( embed::getIconPixmap( "project_new" ), tr( "&New" ), @@ -362,8 +362,7 @@ void MainWindow::finalize() qApp, SLOT(closeAllWindows()), Qt::CTRL + Qt::Key_Q ); - - QMenu * edit_menu = new QMenu( this ); + auto edit_menu = new QMenu(this); menuBar()->addMenu( edit_menu )->setText( tr( "&Edit" ) ); m_undoAction = edit_menu->addAction( embed::getIconPixmap( "edit_undo" ), tr( "Undo" ), @@ -413,7 +412,7 @@ void MainWindow::finalize() // help-popup-menu - QMenu * help_menu = new QMenu( this ); + auto help_menu = new QMenu(this); menuBar()->addMenu( help_menu )->setText( tr( "&Help" ) ); // May use offline help if( true ) @@ -437,47 +436,27 @@ void MainWindow::finalize() this, SLOT(aboutLMMS())); // create tool-buttons - ToolButton * project_new = new ToolButton( - embed::getIconPixmap( "project_new" ), - tr( "Create new project" ), - this, SLOT(createNewProject()), - m_toolBar ); + auto project_new = new ToolButton( + embed::getIconPixmap("project_new"), tr("Create new project"), this, SLOT(createNewProject()), m_toolBar); - ToolButton * project_new_from_template = new ToolButton( - embed::getIconPixmap( "project_new_from_template" ), - tr( "Create new project from template" ), - this, SLOT(emptySlot()), - m_toolBar ); + auto project_new_from_template = new ToolButton(embed::getIconPixmap("project_new_from_template"), + tr("Create new project from template"), this, SLOT(emptySlot()), m_toolBar); project_new_from_template->setMenu( templates_menu ); project_new_from_template->setPopupMode( ToolButton::InstantPopup ); - ToolButton * project_open = new ToolButton( - embed::getIconPixmap( "project_open" ), - tr( "Open existing project" ), - this, SLOT(openProject()), - m_toolBar ); + auto project_open = new ToolButton( + embed::getIconPixmap("project_open"), tr("Open existing project"), this, SLOT(openProject()), m_toolBar); - - ToolButton * project_open_recent = new ToolButton( - embed::getIconPixmap( "project_open_recent" ), - tr( "Recently opened projects" ), - this, SLOT(emptySlot()), m_toolBar ); + auto project_open_recent = new ToolButton(embed::getIconPixmap("project_open_recent"), + tr("Recently opened projects"), this, SLOT(emptySlot()), m_toolBar); project_open_recent->setMenu( new RecentProjectsMenu(this) ); project_open_recent->setPopupMode( ToolButton::InstantPopup ); - ToolButton * project_save = new ToolButton( - embed::getIconPixmap( "project_save" ), - tr( "Save current project" ), - this, SLOT(saveProject()), - m_toolBar ); + auto project_save = new ToolButton( + embed::getIconPixmap("project_save"), tr("Save current project"), this, SLOT(saveProject()), m_toolBar); - - ToolButton * project_export = new ToolButton( - embed::getIconPixmap( "project_export" ), - tr( "Export current project" ), - this, - SLOT(onExportProject()), - m_toolBar ); + auto project_export = new ToolButton( + embed::getIconPixmap("project_export"), tr("Export current project"), this, SLOT(onExportProject()), m_toolBar); m_metronomeToggle = new ToolButton( embed::getIconPixmap( "metronome" ), @@ -498,68 +477,36 @@ void MainWindow::finalize() // window-toolbar - ToolButton * song_editor_window = new ToolButton( - embed::getIconPixmap( "songeditor" ), - tr( "Song Editor" ) + " (Ctrl+1)", - this, SLOT(toggleSongEditorWin()), - m_toolBar ); + auto song_editor_window = new ToolButton(embed::getIconPixmap("songeditor"), tr("Song Editor") + " (Ctrl+1)", this, + SLOT(toggleSongEditorWin()), m_toolBar); song_editor_window->setShortcut( Qt::CTRL + Qt::Key_1 ); - - ToolButton* pattern_editor_window = new ToolButton( - embed::getIconPixmap("pattern_track_btn"), - tr("Pattern Editor") + " (Ctrl+2)", - this, SLOT(togglePatternEditorWin()), - m_toolBar); + auto pattern_editor_window = new ToolButton(embed::getIconPixmap("pattern_track_btn"), + tr("Pattern Editor") + " (Ctrl+2)", this, SLOT(togglePatternEditorWin()), m_toolBar); pattern_editor_window->setShortcut(Qt::CTRL + Qt::Key_2); - - ToolButton * piano_roll_window = new ToolButton( - embed::getIconPixmap( "piano" ), - tr( "Piano Roll" ) + - " (Ctrl+3)", - this, SLOT(togglePianoRollWin()), - m_toolBar ); + auto piano_roll_window = new ToolButton( + embed::getIconPixmap("piano"), tr("Piano Roll") + " (Ctrl+3)", this, SLOT(togglePianoRollWin()), m_toolBar); piano_roll_window->setShortcut( Qt::CTRL + Qt::Key_3 ); - ToolButton * automation_editor_window = new ToolButton( - embed::getIconPixmap( "automation" ), - tr( "Automation Editor" ) + - " (Ctrl+4)", - this, - SLOT(toggleAutomationEditorWin()), - m_toolBar ); + auto automation_editor_window = new ToolButton(embed::getIconPixmap("automation"), + tr("Automation Editor") + " (Ctrl+4)", this, SLOT(toggleAutomationEditorWin()), m_toolBar); automation_editor_window->setShortcut( Qt::CTRL + Qt::Key_4 ); - ToolButton * mixer_window = new ToolButton( - embed::getIconPixmap( "mixer" ), - tr( "Mixer" ) + " (Ctrl+5)", - this, SLOT(toggleMixerWin()), - m_toolBar ); + auto mixer_window = new ToolButton( + embed::getIconPixmap("mixer"), tr("Mixer") + " (Ctrl+5)", this, SLOT(toggleMixerWin()), m_toolBar); mixer_window->setShortcut( Qt::CTRL + Qt::Key_5 ); - ToolButton * controllers_window = new ToolButton( - embed::getIconPixmap( "controller" ), - tr( "Show/hide controller rack" ) + - " (Ctrl+6)", - this, SLOT(toggleControllerRack()), - m_toolBar ); + auto controllers_window = new ToolButton(embed::getIconPixmap("controller"), + tr("Show/hide controller rack") + " (Ctrl+6)", this, SLOT(toggleControllerRack()), m_toolBar); controllers_window->setShortcut( Qt::CTRL + Qt::Key_6 ); - ToolButton * project_notes_window = new ToolButton( - embed::getIconPixmap( "project_notes" ), - tr( "Show/hide project notes" ) + - " (Ctrl+7)", - this, SLOT(toggleProjectNotesWin()), - m_toolBar ); + auto project_notes_window = new ToolButton(embed::getIconPixmap("project_notes"), + tr("Show/hide project notes") + " (Ctrl+7)", this, SLOT(toggleProjectNotesWin()), m_toolBar); project_notes_window->setShortcut( Qt::CTRL + Qt::Key_7 ); - ToolButton * microtuner_window = new ToolButton( - embed::getIconPixmap( "microtuner" ), - tr( "Microtuner configuration" ) + - " (Ctrl+8)", - this, SLOT(toggleMicrotunerWin()), - m_toolBar ); + auto microtuner_window = new ToolButton(embed::getIconPixmap("microtuner"), + tr("Microtuner configuration") + " (Ctrl+8)", this, SLOT(toggleMicrotunerWin()), m_toolBar); microtuner_window->setShortcut( Qt::CTRL + Qt::Key_8 ); m_toolBarLayout->addWidget( song_editor_window, 1, 1 ); @@ -649,7 +596,7 @@ void MainWindow::addSpacingToToolBar( int _size ) SubWindow* MainWindow::addWindowedWidget(QWidget *w, Qt::WindowFlags windowFlags) { // wrap the widget in our own *custom* window that patches some errors in QMdiSubWindow - SubWindow *win = new SubWindow(m_workspace->viewport(), windowFlags); + auto win = new SubWindow(m_workspace->viewport(), windowFlags); win->setAttribute(Qt::WA_DeleteOnClose); win->setWidget(w); if (w && w->sizeHint().isValid()) {win->resize(w->sizeHint());} @@ -760,7 +707,7 @@ void MainWindow::saveWidgetState( QWidget * _w, QDomElement & _de ) // If the widget is a SubWindow, then we can make use of the getTrueNormalGeometry() method that // performs the same as normalGeometry, but isn't broken on X11 ( see https://bugreports.qt.io/browse/QTBUG-256 ) - SubWindow *asSubWindow = qobject_cast(_w); + auto asSubWindow = qobject_cast(_w); QRect normalGeom = asSubWindow != nullptr ? asSubWindow->getTrueNormalGeometry() : _w->normalGeometry(); bool visible = _w->isVisible(); diff --git a/src/gui/MicrotunerConfig.cpp b/src/gui/MicrotunerConfig.cpp index 06b777ce9..d400be341 100644 --- a/src/gui/MicrotunerConfig.cpp +++ b/src/gui/MicrotunerConfig.cpp @@ -68,20 +68,20 @@ MicrotunerConfig::MicrotunerConfig() : setWindowTitle(tr("Microtuner")); // Organize into 2 main columns: scales and keymaps - QGridLayout *microtunerLayout = new QGridLayout(); + auto microtunerLayout = new QGridLayout(); microtunerLayout->setSpacing(2); // ---------------------------------- // Scale sub-column // - QLabel *scaleLabel = new QLabel(tr("Scale:")); + auto scaleLabel = new QLabel(tr("Scale:")); microtunerLayout->addWidget(scaleLabel, 0, 0, 1, 2, Qt::AlignBottom); for (unsigned int i = 0; i < MaxScaleCount; i++) { m_scaleComboModel.addItem(QString::number(i) + ": " + Engine::getSong()->getScale(i)->getDescription()); } - ComboBox *scaleCombo = new ComboBox(); + auto scaleCombo = new ComboBox(); scaleCombo->setModel(&m_scaleComboModel); microtunerLayout->addWidget(scaleCombo, 1, 0, 1, 2); connect(&m_scaleComboModel, &ComboBoxModel::dataChanged, [=] {updateScaleForm();}); @@ -90,8 +90,8 @@ MicrotunerConfig::MicrotunerConfig() : m_scaleNameEdit->setToolTip(tr("Scale description. Cannot start with \"!\" and cannot contain a newline character.")); microtunerLayout->addWidget(m_scaleNameEdit, 2, 0, 1, 2); - QPushButton *loadScaleButton = new QPushButton(tr("Load")); - QPushButton *saveScaleButton = new QPushButton(tr("Save")); + auto loadScaleButton = new QPushButton(tr("Load")); + auto saveScaleButton = new QPushButton(tr("Save")); microtunerLayout->addWidget(loadScaleButton, 3, 0, 1, 1); microtunerLayout->addWidget(saveScaleButton, 3, 1, 1, 1); connect(loadScaleButton, &QPushButton::clicked, [=] {loadScaleFromFile();}); @@ -102,21 +102,21 @@ MicrotunerConfig::MicrotunerConfig() : m_scaleTextEdit->setToolTip(tr("Enter intervals on separate lines. Numbers containing a decimal point are treated as cents.\nOther inputs are treated as integer ratios and must be in the form of \'a/b\' or \'a\'.\nUnity (0.0 cents or ratio 1/1) is always present as a hidden first value; do not enter it manually.")); microtunerLayout->addWidget(m_scaleTextEdit, 4, 0, 2, 2); - QPushButton *applyScaleButton = new QPushButton(tr("Apply scale")); + auto applyScaleButton = new QPushButton(tr("Apply scale")); microtunerLayout->addWidget(applyScaleButton, 6, 0, 1, 2); connect(applyScaleButton, &QPushButton::clicked, [=] {applyScale();}); // ---------------------------------- // Mapping sub-column // - QLabel *keymapLabel = new QLabel(tr("Keymap:")); + auto keymapLabel = new QLabel(tr("Keymap:")); microtunerLayout->addWidget(keymapLabel, 0, 2, 1, 2, Qt::AlignBottom); for (unsigned int i = 0; i < MaxKeymapCount; i++) { m_keymapComboModel.addItem(QString::number(i) + ": " + Engine::getSong()->getKeymap(i)->getDescription()); } - ComboBox *keymapCombo = new ComboBox(); + auto keymapCombo = new ComboBox(); keymapCombo->setModel(&m_keymapComboModel); microtunerLayout->addWidget(keymapCombo, 1, 2, 1, 2); connect(&m_keymapComboModel, &ComboBoxModel::dataChanged, [=] {updateKeymapForm();}); @@ -125,8 +125,8 @@ MicrotunerConfig::MicrotunerConfig() : m_keymapNameEdit->setToolTip(tr("Keymap description. Cannot start with \"!\" and cannot contain a newline character.")); microtunerLayout->addWidget(m_keymapNameEdit, 2, 2, 1, 2); - QPushButton *loadKeymapButton = new QPushButton(tr("Load")); - QPushButton *saveKeymapButton = new QPushButton(tr("Save")); + auto loadKeymapButton = new QPushButton(tr("Load")); + auto saveKeymapButton = new QPushButton(tr("Save")); microtunerLayout->addWidget(loadKeymapButton, 3, 2, 1, 1); microtunerLayout->addWidget(saveKeymapButton, 3, 3, 1, 1); connect(loadKeymapButton, &QPushButton::clicked, [=] {loadKeymapFromFile();}); @@ -138,40 +138,40 @@ MicrotunerConfig::MicrotunerConfig() : microtunerLayout->addWidget(m_keymapTextEdit, 4, 2, 1, 2); // Mapping ranges - QGridLayout *keymapRangeLayout = new QGridLayout(); + auto keymapRangeLayout = new QGridLayout(); microtunerLayout->addLayout(keymapRangeLayout, 5, 2, 1, 2, Qt::AlignCenter | Qt::AlignTop); - LcdSpinBox *firstKeySpin = new LcdSpinBox(3, nullptr, tr("First key")); + auto firstKeySpin = new LcdSpinBox(3, nullptr, tr("First key")); firstKeySpin->setLabel(tr("FIRST")); firstKeySpin->setToolTip(tr("First MIDI key that will be mapped")); firstKeySpin->setModel(&m_firstKeyModel); keymapRangeLayout->addWidget(firstKeySpin, 0, 0); - LcdSpinBox *lastKeySpin = new LcdSpinBox(3, nullptr, tr("Last key")); + auto lastKeySpin = new LcdSpinBox(3, nullptr, tr("Last key")); lastKeySpin->setLabel(tr("LAST")); lastKeySpin->setToolTip(tr("Last MIDI key that will be mapped")); lastKeySpin->setModel(&m_lastKeyModel); keymapRangeLayout->addWidget(lastKeySpin, 0, 1); - LcdSpinBox *middleKeySpin = new LcdSpinBox(3, nullptr, tr("Middle key")); + auto middleKeySpin = new LcdSpinBox(3, nullptr, tr("Middle key")); middleKeySpin->setLabel(tr("MIDDLE")); middleKeySpin->setToolTip(tr("First line in the keymap refers to this MIDI key")); middleKeySpin->setModel(&m_middleKeyModel); keymapRangeLayout->addWidget(middleKeySpin, 0, 2); - LcdSpinBox *baseKeySpin = new LcdSpinBox(3, nullptr, tr("Base key")); + auto baseKeySpin = new LcdSpinBox(3, nullptr, tr("Base key")); baseKeySpin->setLabel(tr("BASE N.")); baseKeySpin->setToolTip(tr("Base note frequency will be assigned to this MIDI key")); baseKeySpin->setModel(&m_baseKeyModel); keymapRangeLayout->addWidget(baseKeySpin, 1, 0); - LcdFloatSpinBox *baseFreqSpin = new LcdFloatSpinBox(4, 3, tr("Base note frequency")); + auto baseFreqSpin = new LcdFloatSpinBox(4, 3, tr("Base note frequency")); baseFreqSpin->setLabel(tr("BASE NOTE FREQ")); baseFreqSpin->setModel(&m_baseFreqModel); baseFreqSpin->setToolTip(tr("Base note frequency")); keymapRangeLayout->addWidget(baseFreqSpin, 1, 1, 1, 2); - QPushButton *applyKeymapButton = new QPushButton(tr("Apply keymap")); + auto applyKeymapButton = new QPushButton(tr("Apply keymap")); microtunerLayout->addWidget(applyKeymapButton, 6, 2, 1, 2); connect(applyKeymapButton, &QPushButton::clicked, [=] {applyKeymap();}); diff --git a/src/gui/MidiCCRackView.cpp b/src/gui/MidiCCRackView.cpp index ac9e45244..7e0d71f78 100644 --- a/src/gui/MidiCCRackView.cpp +++ b/src/gui/MidiCCRackView.cpp @@ -64,21 +64,21 @@ MidiCCRackView::MidiCCRackView(InstrumentTrack * track) : subWin->hide(); // Main window layout - QVBoxLayout *mainLayout = new QVBoxLayout(this); + auto mainLayout = new QVBoxLayout(this); // Knobs GroupBox - Here we have the MIDI CC controller knobs for the selected track m_midiCCGroupBox = new GroupBox(tr("MIDI CC Knobs:")); // Layout to keep scrollable area under the GroupBox header - QVBoxLayout *knobsGroupBoxLayout = new QVBoxLayout(); + auto knobsGroupBoxLayout = new QVBoxLayout(); knobsGroupBoxLayout->setContentsMargins(5, 16, 5, 5); m_midiCCGroupBox->setLayout(knobsGroupBoxLayout); // Scrollable area + widget + its layout that will have all the knobs - QScrollArea *knobsScrollArea = new QScrollArea(); - QWidget *knobsArea = new QWidget(); - QGridLayout *knobsAreaLayout = new QGridLayout(); + auto knobsScrollArea = new QScrollArea(); + auto knobsArea = new QWidget(); + auto knobsAreaLayout = new QGridLayout(); knobsArea->setLayout(knobsAreaLayout); knobsScrollArea->setWidget(knobsArea); diff --git a/src/gui/MidiSetupWidget.cpp b/src/gui/MidiSetupWidget.cpp index fed63f5bb..4f620fb0e 100644 --- a/src/gui/MidiSetupWidget.cpp +++ b/src/gui/MidiSetupWidget.cpp @@ -48,7 +48,7 @@ MidiSetupWidget::MidiSetupWidget(const QString & caption, const QString & config m_device = new QLineEdit(devName, this); m_device->setGeometry(10, 20, 160, 20); - QLabel * dev_lbl = new QLabel(tr("Device"), this); + auto dev_lbl = new QLabel(tr("Device"), this); dev_lbl->setFont(pointSize<7>(dev_lbl->font())); dev_lbl->setGeometry(10, 40, 160, 10); } diff --git a/src/gui/MixerLine.cpp b/src/gui/MixerLine.cpp index 900298496..030ea892e 100644 --- a/src/gui/MixerLine.cpp +++ b/src/gui/MixerLine.cpp @@ -53,7 +53,7 @@ bool MixerLine::eventFilter( QObject *dist, QEvent *event ) // If we are in a rename, capture the enter/return events and handle them if ( event->type() == QEvent::KeyPress ) { - QKeyEvent * keyEvent = static_cast(event); + auto keyEvent = static_cast(event); if( keyEvent->key() == Qt::Key_Enter || keyEvent->key() == Qt::Key_Return ) { if( m_inRename ) @@ -120,7 +120,7 @@ MixerLine::MixerLine( QWidget * _parent, MixerView * _mv, int _channelIndex ) : m_renameLineEdit->setReadOnly( true ); m_renameLineEdit->installEventFilter( this ); - QGraphicsScene * scene = new QGraphicsScene(); + auto scene = new QGraphicsScene(); scene->setSceneRect( 0, 0, 33, MixerLineHeight ); m_view = new QGraphicsView( this ); diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index 9103a5584..3fc7be316 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -69,7 +69,7 @@ MixerView::MixerView() : setWindowIcon( embed::getIconPixmap( "mixer" ) ); // main-layout - QHBoxLayout * ml = new QHBoxLayout; + auto ml = new QHBoxLayout; // Set margins ml->setContentsMargins( 0, 4, 0, 0 ); @@ -131,7 +131,7 @@ MixerView::MixerView() : ml->addWidget( channelArea, 1, Qt::AlignTop ); // show the add new mixer channel button - QPushButton * newChannelBtn = new QPushButton( embed::getIconPixmap( "new_channel" ), QString(), this ); + auto newChannelBtn = new QPushButton(embed::getIconPixmap("new_channel"), QString(), this); newChannelBtn->setObjectName( "newChannelBtn" ); newChannelBtn->setFixedSize( mixerLineSize ); connect( newChannelBtn, SIGNAL(clicked()), this, SLOT(addNewChannel())); @@ -247,13 +247,13 @@ void MixerView::updateMaxChannelSelector() { if( trackList[i]->type() == Track::InstrumentTrack ) { - InstrumentTrack * inst = (InstrumentTrack *) trackList[i]; + auto inst = (InstrumentTrack*)trackList[i]; inst->mixerChannelModel()->setRange(0, m_mixerChannelViews.size()-1,1); } else if( trackList[i]->type() == Track::SampleTrack ) { - SampleTrack * strk = (SampleTrack *) trackList[i]; + auto strk = (SampleTrack*)trackList[i]; strk->mixerChannelModel()->setRange(0, m_mixerChannelViews.size()-1,1); } @@ -445,12 +445,12 @@ void MixerView::deleteUnusedChannels() int channel = 0; if (t->type() == Track::InstrumentTrack) { - InstrumentTrack* inst = dynamic_cast(t); + auto inst = dynamic_cast(t); channel = inst->mixerChannelModel()->value(); } else if (t->type() == Track::SampleTrack) { - SampleTrack *strack = dynamic_cast(t); + auto strack = dynamic_cast(t); channel = strack->mixerChannelModel()->value(); } inUse[channel] = true; diff --git a/src/gui/PeakControllerDialog.cpp b/src/gui/PeakControllerDialog.cpp index 760c42591..11564a2d3 100644 --- a/src/gui/PeakControllerDialog.cpp +++ b/src/gui/PeakControllerDialog.cpp @@ -45,7 +45,7 @@ PeakControllerDialog::PeakControllerDialog( Controller * _model, QWidget * _pare setToolTip(tr("LFO Controller")); - QLabel * l = new QLabel( this ); + auto l = new QLabel(this); l->setText( "Use FX's controls" ); l->move(10, 10); diff --git a/src/gui/PluginBrowser.cpp b/src/gui/PluginBrowser.cpp index d6ba73903..a19c80df0 100644 --- a/src/gui/PluginBrowser.cpp +++ b/src/gui/PluginBrowser.cpp @@ -51,7 +51,7 @@ PluginBrowser::PluginBrowser( QWidget * _parent ) : addContentWidget( m_view ); - QVBoxLayout * view_layout = new QVBoxLayout( m_view ); + auto view_layout = new QVBoxLayout(m_view); view_layout->setMargin( 5 ); view_layout->setSpacing( 5 ); @@ -63,7 +63,7 @@ PluginBrowser::PluginBrowser( QWidget * _parent ) : m_view ); hint->setWordWrap( true ); - QLineEdit * searchBar = new QLineEdit( m_view ); + auto searchBar = new QLineEdit(m_view); searchBar->setPlaceholderText( "Search" ); searchBar->setMaxLength( 64 ); searchBar->setClearButtonEnabled( true ); @@ -120,8 +120,7 @@ void PluginBrowser::onFilterChanged( const QString & filter ) for (int itemIndex = 0; itemIndex < itemCount; ++itemIndex) { QTreeWidgetItem * item = root->child( itemIndex ); - PluginDescWidget * descWidget = static_cast - (m_descTree->itemWidget( item, 0)); + auto descWidget = static_cast(m_descTree->itemWidget(item, 0)); if (descWidget->name().contains(filter, Qt::CaseInsensitive)) { item->setHidden( false ); diff --git a/src/gui/ProjectNotes.cpp b/src/gui/ProjectNotes.cpp index 15e507889..f131a017c 100644 --- a/src/gui/ProjectNotes.cpp +++ b/src/gui/ProjectNotes.cpp @@ -186,8 +186,7 @@ void ProjectNotes::setupActions() connect( m_actionTextUnderline, SIGNAL(triggered()), this, SLOT(textUnderline())); - - QActionGroup * grp = new QActionGroup( tb ); + auto grp = new QActionGroup(tb); connect( grp, SIGNAL(triggered(QAction*)), this, SLOT(textAlign(QAction*))); diff --git a/src/gui/SampleTrackWindow.cpp b/src/gui/SampleTrackWindow.cpp index c12ab1b1a..78b899a09 100644 --- a/src/gui/SampleTrackWindow.cpp +++ b/src/gui/SampleTrackWindow.cpp @@ -56,19 +56,19 @@ SampleTrackWindow::SampleTrackWindow(SampleTrackView * tv) : { // init own layout + widgets setFocusPolicy(Qt::StrongFocus); - QVBoxLayout * vlayout = new QVBoxLayout(this); + auto vlayout = new QVBoxLayout(this); vlayout->setMargin(0); vlayout->setSpacing(0); - TabWidget* generalSettingsWidget = new TabWidget(tr("GENERAL SETTINGS"), this); + auto generalSettingsWidget = new TabWidget(tr("GENERAL SETTINGS"), this); - QVBoxLayout* generalSettingsLayout = new QVBoxLayout(generalSettingsWidget); + auto generalSettingsLayout = new QVBoxLayout(generalSettingsWidget); generalSettingsLayout->setContentsMargins(8, 18, 8, 8); generalSettingsLayout->setSpacing(6); - QWidget* nameWidget = new QWidget(generalSettingsWidget); - QHBoxLayout* nameLayout = new QHBoxLayout(nameWidget); + auto nameWidget = new QWidget(generalSettingsWidget); + auto nameLayout = new QHBoxLayout(nameWidget); nameLayout->setContentsMargins(0, 0, 0, 0); nameLayout->setSpacing(2); @@ -84,8 +84,7 @@ SampleTrackWindow::SampleTrackWindow(SampleTrackView * tv) : generalSettingsLayout->addWidget(nameWidget); - - QGridLayout* basicControlsLayout = new QGridLayout; + auto basicControlsLayout = new QGridLayout; basicControlsLayout->setHorizontalSpacing(3); basicControlsLayout->setVerticalSpacing(0); basicControlsLayout->setContentsMargins(0, 0, 0, 0); @@ -102,7 +101,7 @@ SampleTrackWindow::SampleTrackWindow(SampleTrackView * tv) : basicControlsLayout->addWidget(m_volumeKnob, 0, 0); basicControlsLayout->setAlignment(m_volumeKnob, widgetAlignment); - QLabel *label = new QLabel(tr("VOL"), this); + auto label = new QLabel(tr("VOL"), this); label->setStyleSheet(labelStyleSheet); basicControlsLayout->addWidget(label, 1, 0); basicControlsLayout->setAlignment(label, labelAlignment); diff --git a/src/gui/SideBar.cpp b/src/gui/SideBar.cpp index d3935024d..e03b38b43 100644 --- a/src/gui/SideBar.cpp +++ b/src/gui/SideBar.cpp @@ -103,7 +103,7 @@ SideBar::SideBar( Qt::Orientation _orientation, QWidget * _parent ) : void SideBar::appendTab( SideBarWidget *widget ) { - SideBarButton *button = new SideBarButton( orientation(), this ); + auto button = new SideBarButton(orientation(), this); button->setText( " " + widget->title() ); button->setIcon( widget->icon() ); button->setLayoutDirection( Qt::RightToLeft ); diff --git a/src/gui/StringPairDrag.cpp b/src/gui/StringPairDrag.cpp index e9eef0b88..54f52c784 100644 --- a/src/gui/StringPairDrag.cpp +++ b/src/gui/StringPairDrag.cpp @@ -58,7 +58,7 @@ StringPairDrag::StringPairDrag( const QString & _key, const QString & _value, setPixmap( _icon ); } QString txt = _key + ":" + _value; - QMimeData * m = new QMimeData(); + auto m = new QMimeData(); m->setData( mimeType( MimeType::StringPair ), txt.toUtf8() ); setMimeData( m ); exec( Qt::LinkAction, Qt::LinkAction ); diff --git a/src/gui/clips/AutomationClipView.cpp b/src/gui/clips/AutomationClipView.cpp index 1ecf78155..c32b62eb2 100644 --- a/src/gui/clips/AutomationClipView.cpp +++ b/src/gui/clips/AutomationClipView.cpp @@ -166,8 +166,7 @@ void AutomationClipView::flipX() void AutomationClipView::constructContextMenu( QMenu * _cm ) { - QAction * a = new QAction( embed::getIconPixmap( "automation" ), - tr( "Open in Automation editor" ), _cm ); + auto a = new QAction(embed::getIconPixmap("automation"), tr("Open in Automation editor"), _cm); _cm->insertAction( _cm->actions()[0], a ); connect(a, SIGNAL(triggered()), this, SLOT(openInAutomationEditor())); _cm->insertSeparator( _cm->actions()[1] ); @@ -195,8 +194,7 @@ void AutomationClipView::constructContextMenu( QMenu * _cm ) if( !m_clip->m_objects.isEmpty() ) { _cm->addSeparator(); - QMenu * m = new QMenu( tr( "%1 Connections" ). - arg( m_clip->m_objects.count() ), _cm ); + auto m = new QMenu(tr("%1 Connections").arg(m_clip->m_objects.count()), _cm); for( AutomationClip::objectVector::iterator it = m_clip->m_objects.begin(); it != m_clip->m_objects.end(); ++it ) @@ -276,8 +274,8 @@ void AutomationClipView::paintEvent( QPaintEvent * ) / (float) m_clip->timeMapLength().getBar() : pixelsPerBar(); - const float min = m_clip->firstObject()->minValue(); - const float max = m_clip->firstObject()->maxValue(); + const auto min = m_clip->firstObject()->minValue(); + const auto max = m_clip->firstObject()->maxValue(); const float y_scale = max - min; const float h = ( height() - 2 * BORDER_WIDTH ) / y_scale; @@ -303,7 +301,7 @@ void AutomationClipView::paintEvent( QPaintEvent * ) if( it+1 == m_clip->getTimeMap().end() ) { const float x1 = POS(it) * ppTick; - const float x2 = (float)( width() - BORDER_WIDTH ); + const auto x2 = (float)(width() - BORDER_WIDTH); if( x1 > ( width() - BORDER_WIDTH ) ) break; // We are drawing the space after the last node, so we use the outValue if( gradient() ) @@ -434,9 +432,7 @@ void AutomationClipView::dropEvent( QDropEvent * _de ) QString val = StringPairDrag::decodeValue( _de ); if( type == "automatable_model" ) { - AutomatableModel * mod = dynamic_cast( - Engine::projectJournal()-> - journallingObject( val.toInt() ) ); + auto mod = dynamic_cast(Engine::projectJournal()->journallingObject(val.toInt())); if( mod != nullptr ) { bool added = m_clip->addObject( mod ); diff --git a/src/gui/clips/ClipView.cpp b/src/gui/clips/ClipView.cpp index e41431314..4c2dd5d69 100644 --- a/src/gui/clips/ClipView.cpp +++ b/src/gui/clips/ClipView.cpp @@ -425,7 +425,7 @@ void ClipView::setColor(const QColor* color) void ClipView::dragEnterEvent( QDragEnterEvent * dee ) { TrackContentWidget * tcw = getTrackView()->getTrackContentWidget(); - TimePos clipPos = TimePos( m_clip->startPosition() ); + TimePos clipPos{m_clip->startPosition()}; if( tcw->canPasteSelection( clipPos, dee ) == false ) { @@ -465,7 +465,7 @@ void ClipView::dropEvent( QDropEvent * de ) if( m_trackView->trackContainerView()->allowRubberband() == true ) { TrackContentWidget * tcw = getTrackView()->getTrackContentWidget(); - TimePos clipPos = TimePos( m_clip->startPosition() ); + TimePos clipPos{m_clip->startPosition()}; if( tcw->pasteSelection( clipPos, de ) == true ) { @@ -501,7 +501,7 @@ void ClipView::dropEvent( QDropEvent * de ) */ void ClipView::updateCursor(QMouseEvent * me) { - SampleClip * sClip = dynamic_cast(m_clip); + auto sClip = dynamic_cast(m_clip); // If we are at the edges, use the resize cursor if (!me->buttons() && !m_clip->getAutoResize() && !isSelected() @@ -634,7 +634,7 @@ void ClipView::mousePressEvent( QMouseEvent * me ) setInitialOffsets(); if( !fixedClips() && me->button() == Qt::LeftButton ) { - SampleClip * sClip = dynamic_cast( m_clip ); + auto sClip = dynamic_cast(m_clip); const bool knifeMode = m_trackView->trackContainerView()->knifeMode(); if ( me->modifiers() & Qt::ControlModifier && !(sClip && knifeMode) ) @@ -747,7 +747,7 @@ void ClipView::mousePressEvent( QMouseEvent * me ) if (m_action == Split) { m_action = NoAction; - SampleClip * sClip = dynamic_cast( m_clip ); + auto sClip = dynamic_cast(m_clip); if (sClip) { setMarkerEnabled( false ); @@ -798,8 +798,7 @@ void ClipView::mouseMoveEvent( QMouseEvent * me ) m_trackView->trackContainerView()->selectedObjects(); for( auto it = so.begin(); it != so.end(); ++it ) { - ClipView * clipv = - dynamic_cast( *it ); + auto clipv = dynamic_cast(*it); if( clipv != nullptr ) { clipViews.push_back( clipv ); @@ -863,8 +862,7 @@ void ClipView::mouseMoveEvent( QMouseEvent * me ) for( QVector::iterator it = so.begin(); it != so.end(); ++it ) { - ClipView* clipv = - dynamic_cast( *it ); + auto clipv = dynamic_cast(*it); if( clipv == nullptr ) { continue; } clips.push_back( clipv->m_clip ); int index = std::distance( so.begin(), it ); @@ -912,14 +910,14 @@ void ClipView::mouseMoveEvent( QMouseEvent * me ) TimePos initialLength = m_initialClipEnd - m_initialClipPos; TimePos offset = TimePos( l - initialLength ).quantize( snapSize ); // Don't resize to less than 1 tick - TimePos min = TimePos( initialLength % snapLength ); + auto min = TimePos(initialLength % snapLength); if (min < 1) min += snapLength; m_clip->changeLength( qMax( min, initialLength + offset) ); } } else { - SampleClip * sClip = dynamic_cast( m_clip ); + auto sClip = dynamic_cast(m_clip); if( sClip ) { const int x = mapToParent( me->pos() ).x() - m_initialMousePos.x(); @@ -946,7 +944,7 @@ void ClipView::mouseMoveEvent( QMouseEvent * me ) { // Otherwise, resize in fixed increments // Don't resize to less than 1 tick TimePos initialLength = m_initialClipEnd - m_initialClipPos; - TimePos minLength = TimePos( initialLength % snapLength ); + auto minLength = TimePos(initialLength % snapLength); if (minLength < 1) minLength += snapLength; TimePos offset = TimePos(t - m_initialClipPos).quantize( snapSize ); t = qMin( m_initialClipEnd - minLength, m_initialClipPos + offset ); @@ -975,7 +973,7 @@ void ClipView::mouseMoveEvent( QMouseEvent * me ) } else if( m_action == Split ) { - SampleClip * sClip = dynamic_cast( m_clip ); + auto sClip = dynamic_cast(m_clip); if (sClip) { setCursor( m_cursorKnife ); setMarkerPos( knifeMarkerPos( me ) ); @@ -1157,7 +1155,7 @@ QVector ClipView::getClickedClips() selection.reserve( sos.size() ); for( auto so: sos ) { - ClipView *clipv = dynamic_cast ( so ); + auto clipv = dynamic_cast(so); if( clipv != nullptr ) { selection.append( clipv ); @@ -1207,7 +1205,7 @@ void ClipView::paste() using namespace Clipboard; // If possible, paste the selection on the TimePos of the selected Track and remove it - TimePos clipPos = TimePos( m_clip->startPosition() ); + TimePos clipPos{m_clip->startPosition()}; TrackContentWidget *tcw = getTrackView()->getTrackContentWidget(); @@ -1246,8 +1244,7 @@ bool ClipView::canMergeSelection(QVector clipvs) void ClipView::mergeClips(QVector clipvs) { // Get the track that we are merging Clips in - InstrumentTrack* track = - dynamic_cast(clipvs.at(0)->getTrackView()->getTrack()); + auto track = dynamic_cast(clipvs.at(0)->getTrackView()->getTrack()); if (!track) { @@ -1271,7 +1268,7 @@ void ClipView::mergeClips(QVector clipvs) const TimePos earliestPos = (*earliestClipV)->getClip()->startPosition(); // Create a clip where all notes will be added - MidiClip* newMidiClip = dynamic_cast(track->createClip(earliestPos)); + auto newMidiClip = dynamic_cast(track->createClip(earliestPos)); if (!newMidiClip) { qWarning("Warning: Failed to convert Clip to MidiClip on mergeClips"); @@ -1284,7 +1281,7 @@ void ClipView::mergeClips(QVector clipvs) for (auto clipv: clipvs) { // Convert ClipV to MidiClipView - MidiClipView* mcView = dynamic_cast(clipv); + auto mcView = dynamic_cast(clipv); if (!mcView) { @@ -1342,8 +1339,7 @@ void ClipView::setInitialOffsets() for( QVector::iterator it = so.begin(); it != so.end(); ++it ) { - ClipView * clipv = - dynamic_cast( *it ); + auto clipv = dynamic_cast(*it); if( clipv == nullptr ) { continue; diff --git a/src/gui/clips/MidiClipView.cpp b/src/gui/clips/MidiClipView.cpp index 720999574..e3ef9fd20 100644 --- a/src/gui/clips/MidiClipView.cpp +++ b/src/gui/clips/MidiClipView.cpp @@ -206,14 +206,12 @@ void MidiClipView::constructContextMenu( QMenu * _cm ) { bool isBeat = m_clip->type() == MidiClip::BeatClip; - QAction * a = new QAction( embed::getIconPixmap( "piano" ), - tr( "Open in piano-roll" ), _cm ); + auto a = new QAction(embed::getIconPixmap("piano"), tr("Open in piano-roll"), _cm); _cm->insertAction( _cm->actions()[0], a ); connect( a, SIGNAL(triggered(bool)), this, SLOT(openInPianoRoll())); - QAction * b = new QAction( embed::getIconPixmap( "ghost_note" ), - tr( "Set as ghost in piano-roll" ), _cm ); + auto b = new QAction(embed::getIconPixmap("ghost_note"), tr("Set as ghost in piano-roll"), _cm); if( m_clip->empty() ) { b->setEnabled( false ); } _cm->insertAction( _cm->actions()[1], b ); connect( b, SIGNAL(triggered(bool)), diff --git a/src/gui/clips/PatternClipView.cpp b/src/gui/clips/PatternClipView.cpp index f65595f52..477a90052 100644 --- a/src/gui/clips/PatternClipView.cpp +++ b/src/gui/clips/PatternClipView.cpp @@ -52,9 +52,7 @@ PatternClipView::PatternClipView(Clip* _clip, TrackView* _tv) : void PatternClipView::constructContextMenu(QMenu* _cm) { - QAction* a = new QAction(embed::getIconPixmap("pattern_track"), - tr("Open in Pattern Editor"), - _cm ); + auto a = new QAction(embed::getIconPixmap("pattern_track"), tr("Open in Pattern Editor"), _cm); _cm->insertAction( _cm->actions()[0], a ); connect( a, SIGNAL(triggered(bool)), this, SLOT(openInPatternEditor())); diff --git a/src/gui/clips/SampleClipView.cpp b/src/gui/clips/SampleClipView.cpp index 5b3228de7..e21a7e30b 100644 --- a/src/gui/clips/SampleClipView.cpp +++ b/src/gui/clips/SampleClipView.cpp @@ -140,7 +140,7 @@ void SampleClipView::mousePressEvent( QMouseEvent * _me ) { if( _me->button() == Qt::MiddleButton && _me->modifiers() == Qt::ControlModifier ) { - SampleClip * sClip = dynamic_cast( getClip() ); + auto sClip = dynamic_cast(getClip()); if( sClip ) { sClip->updateTrackClips(); @@ -157,7 +157,7 @@ void SampleClipView::mouseReleaseEvent(QMouseEvent *_me) { if( _me->button() == Qt::MiddleButton && !_me->modifiers() ) { - SampleClip * sClip = dynamic_cast( getClip() ); + auto sClip = dynamic_cast(getClip()); if( sClip ) { sClip->playbackPositionChanged(); @@ -342,7 +342,7 @@ bool SampleClipView::splitClip( const TimePos pos ) m_clip->getTrack()->addJournalCheckPoint(); m_clip->getTrack()->saveJournallingState( false ); - SampleClip * rightClip = new SampleClip ( *m_clip ); + auto rightClip = new SampleClip(*m_clip); m_clip->changeLength( splitPos - m_initialClipPos ); diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index 2cc9a6faf..e296301ec 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -348,7 +348,7 @@ void AutomationEditor::drawLine( int x0In, float y0, int x1In, float y1 ) int x0 = Note::quantized( x0In, AutomationClip::quantization() ); int x1 = Note::quantized( x1In, AutomationClip::quantization() ); int deltax = qAbs( x1 - x0 ); - float deltay = qAbs( y1 - y0 ); + auto deltay = qAbs(y1 - y0); int x = x0; float y = y0; int xstep; @@ -962,8 +962,7 @@ void AutomationEditor::paintEvent(QPaintEvent * pe ) // print value numbers int font_height = p.fontMetrics().height(); - Qt::Alignment text_flags = - (Qt::Alignment)( Qt::AlignRight | Qt::AlignVCenter ); + auto text_flags = (Qt::Alignment)(Qt::AlignRight | Qt::AlignVCenter); if( validClip() ) { @@ -1839,7 +1838,7 @@ AutomationEditorWindow::AutomationEditorWindow() : // Edit mode buttons DropToolBar *editActionsToolBar = addDropToolBarToTop(tr("Edit actions")); - ActionGroup* editModeGroup = new ActionGroup(this); + auto editModeGroup = new ActionGroup(this); QAction* drawAction = editModeGroup->addAction(embed::getIconPixmap("edit_draw"), tr("Draw mode (Shift+D)")); drawAction->setShortcut(Qt::SHIFT | Qt::Key_D); drawAction->setChecked(true); @@ -1864,7 +1863,7 @@ AutomationEditorWindow::AutomationEditorWindow() : // Interpolation actions DropToolBar *interpolationActionsToolBar = addDropToolBarToTop(tr("Interpolation controls")); - ActionGroup* progression_type_group = new ActionGroup(this); + auto progression_type_group = new ActionGroup(this); m_discreteAction = progression_type_group->addAction( embed::getIconPixmap("progression_discrete"), tr("Discrete progression")); @@ -1899,7 +1898,7 @@ AutomationEditorWindow::AutomationEditorWindow() : // Zoom controls DropToolBar *zoomToolBar = addDropToolBarToTop(tr("Zoom controls")); - QLabel * zoom_x_label = new QLabel( zoomToolBar ); + auto zoom_x_label = new QLabel(zoomToolBar); zoom_x_label->setPixmap( embed::getIconPixmap( "zoom_x" ) ); m_zoomingXComboBox = new ComboBox( zoomToolBar ); @@ -1917,8 +1916,7 @@ AutomationEditorWindow::AutomationEditorWindow() : connect( &m_editor->m_zoomingXModel, SIGNAL(dataChanged()), m_editor, SLOT(zoomingXChanged())); - - QLabel * zoom_y_label = new QLabel( zoomToolBar ); + auto zoom_y_label = new QLabel(zoomToolBar); zoom_y_label->setPixmap( embed::getIconPixmap( "zoom_y" ) ); m_zoomingYComboBox = new ComboBox( zoomToolBar ); @@ -1946,7 +1944,7 @@ AutomationEditorWindow::AutomationEditorWindow() : // Quantization controls DropToolBar *quantizationActionsToolBar = addDropToolBarToTop(tr("Quantization controls")); - QLabel * quantize_lbl = new QLabel( m_toolBar ); + auto quantize_lbl = new QLabel(m_toolBar); quantize_lbl->setPixmap( embed::getIconPixmap( "quantize" ) ); m_quantizeComboBox = new ComboBox( m_toolBar ); @@ -2031,9 +2029,7 @@ void AutomationEditorWindow::dropEvent( QDropEvent *_de ) QString val = StringPairDrag::decodeValue( _de ); if( type == "automatable_model" ) { - AutomatableModel * mod = dynamic_cast( - Engine::projectJournal()-> - journallingObject( val.toInt() ) ); + auto mod = dynamic_cast(Engine::projectJournal()->journallingObject(val.toInt())); if (mod != nullptr) { bool added = m_editor->m_clip->addObject( mod ); diff --git a/src/gui/editors/Editor.cpp b/src/gui/editors/Editor.cpp index cd2a23f66..7091c094b 100644 --- a/src/gui/editors/Editor.cpp +++ b/src/gui/editors/Editor.cpp @@ -58,7 +58,7 @@ DropToolBar * Editor::addDropToolBar(Qt::ToolBarArea whereToAdd, QString const & DropToolBar * Editor::addDropToolBar(QWidget * parent, Qt::ToolBarArea whereToAdd, QString const & windowTitle) { - DropToolBar *toolBar = new DropToolBar(parent); + auto toolBar = new DropToolBar(parent); addToolBar(whereToAdd, toolBar); toolBar->setMovable(false); toolBar->setFloatable(false); diff --git a/src/gui/editors/PatternEditor.cpp b/src/gui/editors/PatternEditor.cpp index 4c00942db..699d6599a 100644 --- a/src/gui/editors/PatternEditor.cpp +++ b/src/gui/editors/PatternEditor.cpp @@ -76,7 +76,7 @@ void PatternEditor::removeSteps() { if( ( *it )->type() == Track::InstrumentTrack ) { - MidiClip* p = static_cast((*it)->getClip(m_ps->currentPattern())); + auto p = static_cast((*it)->getClip(m_ps->currentPattern())); p->removeSteps(); } } @@ -184,7 +184,7 @@ void PatternEditor::makeSteps( bool clone ) { if( ( *it )->type() == Track::InstrumentTrack ) { - MidiClip* p = static_cast((*it)->getClip(m_ps->currentPattern())); + auto p = static_cast((*it)->getClip(m_ps->currentPattern())); if( clone ) { p->cloneSteps(); @@ -201,7 +201,7 @@ void PatternEditor::makeSteps( bool clone ) void PatternEditor::cloneClip() { // Get the current PatternTrack id - PatternStore* ps = static_cast(model()); + auto ps = static_cast(model()); const int currentPattern = ps->currentPattern(); PatternTrack* pt = PatternTrack::findPatternTrack(currentPattern); @@ -272,7 +272,7 @@ PatternEditorWindow::PatternEditorWindow(PatternStore* ps) : trackAndStepActionsToolBar->addAction(embed::getIconPixmap("add_automation"), tr("Add automation-track"), m_editor, SLOT(addAutomationTrack())); - QWidget* stretch = new QWidget(m_toolBar); + auto stretch = new QWidget(m_toolBar); stretch->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); trackAndStepActionsToolBar->addWidget(stretch); @@ -288,13 +288,12 @@ PatternEditorWindow::PatternEditorWindow(PatternStore* ps) : connect(&ps->m_patternComboBoxModel, SIGNAL(dataChanged()), m_editor, SLOT(updatePosition())); - - QAction* viewNext = new QAction(this); + auto viewNext = new QAction(this); connect(viewNext, SIGNAL(triggered()), m_patternComboBox, SLOT(selectNext())); viewNext->setShortcut(Qt::Key_Plus); addAction(viewNext); - QAction* viewPrevious = new QAction(this); + auto viewPrevious = new QAction(this); connect(viewPrevious, SIGNAL(triggered()), m_patternComboBox, SLOT(selectPrevious())); viewPrevious->setShortcut(Qt::Key_Minus); addAction(viewPrevious); diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index bcf3fbbc1..60d5859e3 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -227,19 +227,19 @@ PianoRoll::PianoRoll() : m_noteEditMenu->clear(); for( int i = 0; i < m_nemStr.size(); ++i ) { - QAction * act = new QAction( m_nemStr.at(i), this ); + auto act = new QAction(m_nemStr.at(i), this); connect( act, &QAction::triggered, [this, i](){ changeNoteEditMode(i); } ); m_noteEditMenu->addAction( act ); } m_semiToneMarkerMenu = new QMenu( this ); - QAction* markSemitoneAction = new QAction( tr("Mark/unmark current semitone"), this ); - QAction* markAllOctaveSemitonesAction = new QAction( tr("Mark/unmark all corresponding octave semitones"), this ); - QAction* markScaleAction = new QAction( tr("Mark current scale"), this ); - QAction* markChordAction = new QAction( tr("Mark current chord"), this ); - QAction* unmarkAllAction = new QAction( tr("Unmark all"), this ); - QAction* copyAllNotesAction = new QAction( tr("Select all notes on this key"), this); + auto markSemitoneAction = new QAction(tr("Mark/unmark current semitone"), this); + auto markAllOctaveSemitonesAction = new QAction(tr("Mark/unmark all corresponding octave semitones"), this); + auto markScaleAction = new QAction(tr("Mark current scale"), this); + auto markChordAction = new QAction(tr("Mark current chord"), this); + auto unmarkAllAction = new QAction(tr("Unmark all"), this); + auto copyAllNotesAction = new QAction(tr("Select all notes on this key"), this); connect( markSemitoneAction, &QAction::triggered, [this](){ markSemiTone(stmaMarkCurrentSemiTone); }); connect( markAllOctaveSemitonesAction, &QAction::triggered, [this](){ markSemiTone(stmaMarkAllOctaveSemiTones); }); @@ -633,7 +633,7 @@ void PianoRoll::setGhostMidiClip( MidiClip* newMidiClip ) { for( Note *note : newMidiClip->notes() ) { - Note * new_note = new Note( note->length(), note->pos(), note->key() ); + auto new_note = new Note(note->length(), note->pos(), note->key()); m_ghostNotes.push_back( new_note ); } emit ghostClipSet( true ); @@ -649,7 +649,7 @@ void PianoRoll::loadGhostNotes( const QDomElement & de ) QDomNode node = de.firstChild(); while( !node.isNull() ) { - Note * n = new Note; + auto n = new Note; n->restoreState( node.toElement() ); n->setVolume(DefaultVolume); m_ghostNotes.push_back( n ); @@ -988,20 +988,20 @@ void PianoRoll::drawNoteRect( QPainter & p, int x, int y, } // Volume - float const volumeRange = static_cast(MaxVolume - MinVolume); - float const volumeSpan = static_cast(n->getVolume() - MinVolume); + auto const volumeRange = static_cast(MaxVolume - MinVolume); + auto const volumeSpan = static_cast(n->getVolume() - MinVolume); float const volumeRatio = volumeSpan / volumeRange; int volVal = qMin( 255, 100 + static_cast( volumeRatio * 155.0f) ); // Panning - float const panningRange = static_cast(PanningRight - PanningLeft); - float const leftPanSpan = static_cast(PanningRight - n->getPanning()); - float const rightPanSpan = static_cast(n->getPanning() - PanningLeft); + auto const panningRange = static_cast(PanningRight - PanningLeft); + auto const leftPanSpan = static_cast(PanningRight - n->getPanning()); + auto const rightPanSpan = static_cast(n->getPanning() - PanningLeft); float leftPercent = qMin( 1.0f, leftPanSpan / panningRange * 2.0f ); float rightPercent = qMin( 1.0f, rightPanSpan / panningRange * 2.0f ); - QColor col = QColor( noteCol ); + QColor col{noteCol}; QPen pen; if( n->selected() ) @@ -3651,8 +3651,8 @@ void PianoRoll::paintEvent(QPaintEvent * pe ) } // set line colors - QColor editAreaCol = QColor(m_lineColor); - QColor currentKeyCol = QColor(m_beatLineColor); + auto editAreaCol = QColor(m_lineColor); + auto currentKeyCol = QColor(m_beatLineColor); editAreaCol.setAlpha( 64 ); currentKeyCol.setAlpha( 64 ); @@ -4738,7 +4738,7 @@ PianoRollWindow::PianoRollWindow() : DropToolBar *notesActionsToolBar = addDropToolBarToTop( tr( "Edit actions" ) ); // init edit-buttons at the top - ActionGroup* editModeGroup = new ActionGroup( this ); + auto editModeGroup = new ActionGroup(this); QAction* drawAction = editModeGroup->addAction( embed::getIconPixmap( "edit_draw" ), tr( "Draw mode (Shift+D)" ) ); QAction* eraseAction = editModeGroup->addAction( embed::getIconPixmap( "edit_erase" ), tr("Erase mode (Shift+E)" ) ); QAction* selectAction = editModeGroup->addAction( embed::getIconPixmap( "edit_select" ), tr( "Select mode (Shift+S)" ) ); @@ -4754,12 +4754,12 @@ PianoRollWindow::PianoRollWindow() : connect( editModeGroup, SIGNAL(triggered(int)), m_editor, SLOT(setEditMode(int))); // Quantize combo button - QToolButton* quantizeButton = new QToolButton(notesActionsToolBar); - QMenu* quantizeButtonMenu = new QMenu(quantizeButton); + auto quantizeButton = new QToolButton(notesActionsToolBar); + auto quantizeButtonMenu = new QMenu(quantizeButton); - QAction* quantizeAction = new QAction(embed::getIconPixmap("quantize"), tr("Quantize"), this); - QAction* quantizePosAction = new QAction(tr("Quantize positions"), this); - QAction* quantizeLengthAction = new QAction(tr("Quantize lengths"), this); + auto quantizeAction = new QAction(embed::getIconPixmap("quantize"), tr("Quantize"), this); + auto quantizePosAction = new QAction(tr("Quantize positions"), this); + auto quantizeLengthAction = new QAction(tr("Quantize lengths"), this); connect(quantizeAction, &QAction::triggered, [this](){ m_editor->quantizeNotes(); }); connect(quantizePosAction, &QAction::triggered, [this](){ m_editor->quantizeNotes(PianoRoll::QuantizePos); }); @@ -4787,11 +4787,9 @@ PianoRollWindow::PianoRollWindow() : m_fileToolsButton->setPopupMode(QToolButton::InstantPopup); // Import / export - QAction* importAction = new QAction(embed::getIconPixmap("project_import"), - tr("Import clip"), m_fileToolsButton); + auto importAction = new QAction(embed::getIconPixmap("project_import"), tr("Import clip"), m_fileToolsButton); - QAction* exportAction = new QAction(embed::getIconPixmap("project_export"), - tr("Export clip"), m_fileToolsButton); + auto exportAction = new QAction(embed::getIconPixmap("project_export"), tr("Export clip"), m_fileToolsButton); m_fileToolsButton->addAction(importAction); m_fileToolsButton->addAction(exportAction); @@ -4804,14 +4802,11 @@ PianoRollWindow::PianoRollWindow() : // Copy + paste actions DropToolBar *copyPasteActionsToolBar = addDropToolBarToTop( tr( "Copy paste controls" ) ); - QAction* cutAction = new QAction(embed::getIconPixmap( "edit_cut" ), - tr( "Cut (%1+X)" ).arg(UI_CTRL_KEY), this ); + auto cutAction = new QAction(embed::getIconPixmap("edit_cut"), tr("Cut (%1+X)").arg(UI_CTRL_KEY), this); - QAction* copyAction = new QAction(embed::getIconPixmap( "edit_copy" ), - tr( "Copy (%1+C)" ).arg(UI_CTRL_KEY), this ); + auto copyAction = new QAction(embed::getIconPixmap("edit_copy"), tr("Copy (%1+C)").arg(UI_CTRL_KEY), this); - QAction* pasteAction = new QAction(embed::getIconPixmap( "edit_paste" ), - tr( "Paste (%1+V)" ).arg(UI_CTRL_KEY), this ); + auto pasteAction = new QAction(embed::getIconPixmap("edit_paste"), tr("Paste (%1+V)").arg(UI_CTRL_KEY), this); cutAction->setShortcut( Qt::CTRL | Qt::Key_X ); copyAction->setShortcut( Qt::CTRL | Qt::Key_C ); @@ -4830,32 +4825,30 @@ PianoRollWindow::PianoRollWindow() : m_editor->m_timeLine->addToolButtons( timeLineToolBar ); // -- Note modifier tools - QToolButton * noteToolsButton = new QToolButton(m_toolBar); + auto noteToolsButton = new QToolButton(m_toolBar); noteToolsButton->setIcon(embed::getIconPixmap("tool")); noteToolsButton->setPopupMode(QToolButton::InstantPopup); - QAction * glueAction = new QAction(embed::getIconPixmap("glue"), - tr("Glue"), noteToolsButton); + auto glueAction = new QAction(embed::getIconPixmap("glue"), tr("Glue"), noteToolsButton); connect(glueAction, SIGNAL(triggered()), m_editor, SLOT(glueNotes())); glueAction->setShortcut( Qt::SHIFT | Qt::Key_G ); - QAction * knifeAction = new QAction(embed::getIconPixmap("edit_knife"), - tr("Knife"), noteToolsButton); + auto knifeAction = new QAction(embed::getIconPixmap("edit_knife"), tr("Knife"), noteToolsButton); connect(knifeAction, &QAction::triggered, m_editor, &PianoRoll::setKnifeAction); knifeAction->setShortcut( Qt::SHIFT | Qt::Key_K ); - - QAction* fillAction = new QAction(embed::getIconPixmap("fill"), tr("Fill"), noteToolsButton); + + auto fillAction = new QAction(embed::getIconPixmap("fill"), tr("Fill"), noteToolsButton); connect(fillAction, &QAction::triggered, [this](){ m_editor->fitNoteLengths(true); }); fillAction->setShortcut(Qt::SHIFT | Qt::Key_F); - QAction* cutOverlapsAction = new QAction(embed::getIconPixmap("cut_overlaps"), tr("Cut overlaps"), noteToolsButton); + auto cutOverlapsAction = new QAction(embed::getIconPixmap("cut_overlaps"), tr("Cut overlaps"), noteToolsButton); connect(cutOverlapsAction, &QAction::triggered, [this](){ m_editor->fitNoteLengths(false); }); cutOverlapsAction->setShortcut(Qt::SHIFT | Qt::Key_C); - QAction* minLengthAction = new QAction(embed::getIconPixmap("min_length"), tr("Min length as last"), noteToolsButton); + auto minLengthAction = new QAction(embed::getIconPixmap("min_length"), tr("Min length as last"), noteToolsButton); connect(minLengthAction, &QAction::triggered, [this](){ m_editor->constrainNoteLengths(false); }); - QAction* maxLengthAction = new QAction(embed::getIconPixmap("max_length"), tr("Max length as last"), noteToolsButton); + auto maxLengthAction = new QAction(embed::getIconPixmap("max_length"), tr("Max length as last"), noteToolsButton); connect(maxLengthAction, &QAction::triggered, [this](){ m_editor->constrainNoteLengths(true); }); noteToolsButton->addAction(glueAction); @@ -4872,7 +4865,7 @@ PianoRollWindow::PianoRollWindow() : DropToolBar *zoomAndNotesToolBar = addDropToolBarToTop( tr( "Zoom and note controls" ) ); - QLabel * zoom_lbl = new QLabel( m_toolBar ); + auto zoom_lbl = new QLabel(m_toolBar); zoom_lbl->setPixmap( embed::getIconPixmap( "zoom_x" ) ); m_zoomingComboBox = new ComboBox( m_toolBar ); @@ -4880,7 +4873,7 @@ PianoRollWindow::PianoRollWindow() : m_zoomingComboBox->setFixedSize( 64, ComboBox::DEFAULT_HEIGHT ); m_zoomingComboBox->setToolTip( tr( "Horizontal zooming") ); - QLabel * zoom_y_lbl = new QLabel(m_toolBar); + auto zoom_y_lbl = new QLabel(m_toolBar); zoom_y_lbl->setPixmap(embed::getIconPixmap("zoom_y")); m_zoomingYComboBox = new ComboBox(m_toolBar); @@ -4889,7 +4882,7 @@ PianoRollWindow::PianoRollWindow() : m_zoomingYComboBox->setToolTip(tr("Vertical zooming")); // setup quantize-stuff - QLabel * quantize_lbl = new QLabel( m_toolBar ); + auto quantize_lbl = new QLabel(m_toolBar); quantize_lbl->setPixmap( embed::getIconPixmap( "quantize" ) ); m_quantizeComboBox = new ComboBox( m_toolBar ); @@ -4898,7 +4891,7 @@ PianoRollWindow::PianoRollWindow() : m_quantizeComboBox->setToolTip( tr( "Quantization") ); // setup note-len-stuff - QLabel * note_len_lbl = new QLabel( m_toolBar ); + auto note_len_lbl = new QLabel(m_toolBar); note_len_lbl->setPixmap( embed::getIconPixmap( "note" ) ); m_noteLenComboBox = new ComboBox( m_toolBar ); @@ -4913,7 +4906,7 @@ PianoRollWindow::PianoRollWindow() : m_keyComboBox->setToolTip(tr("Key")); // setup scale-stuff - QLabel * scale_lbl = new QLabel( m_toolBar ); + auto scale_lbl = new QLabel(m_toolBar); scale_lbl->setPixmap( embed::getIconPixmap( "scale" ) ); m_scaleComboBox = new ComboBox( m_toolBar ); @@ -4922,7 +4915,7 @@ PianoRollWindow::PianoRollWindow() : m_scaleComboBox->setToolTip( tr( "Scale") ); // setup chord-stuff - QLabel * chord_lbl = new QLabel( m_toolBar ); + auto chord_lbl = new QLabel(m_toolBar); chord_lbl->setPixmap( embed::getIconPixmap( "chord" ) ); m_chordComboBox = new ComboBox( m_toolBar ); @@ -4931,7 +4924,7 @@ PianoRollWindow::PianoRollWindow() : m_chordComboBox->setToolTip( tr( "Chord" ) ); // setup snap-stuff - QLabel* snapLbl = new QLabel(m_toolBar); + auto snapLbl = new QLabel(m_toolBar); snapLbl->setPixmap(embed::getIconPixmap("gridmode")); m_snapComboBox = new ComboBox(m_toolBar); @@ -4949,24 +4942,24 @@ PianoRollWindow::PianoRollWindow() : // Wrap label icons and comboboxes in a single widget so when // the window is resized smaller in width it hides both - QWidget * zoom_widget = new QWidget(); - QHBoxLayout * zoom_hbox = new QHBoxLayout(); + auto zoom_widget = new QWidget(); + auto zoom_hbox = new QHBoxLayout(); zoom_hbox->setContentsMargins(0, 0, 0, 0); zoom_hbox->addWidget(zoom_lbl); zoom_hbox->addWidget(m_zoomingComboBox); zoom_widget->setLayout(zoom_hbox); zoomAndNotesToolBar->addWidget(zoom_widget); - QWidget * zoomY_widget = new QWidget(); - QHBoxLayout * zoomY_hbox = new QHBoxLayout(); + auto zoomY_widget = new QWidget(); + auto zoomY_hbox = new QHBoxLayout(); zoomY_hbox->setContentsMargins(0, 0, 0, 0); zoomY_hbox->addWidget(zoom_y_lbl); zoomY_hbox->addWidget(m_zoomingYComboBox); zoomY_widget->setLayout(zoomY_hbox); zoomAndNotesToolBar->addWidget(zoomY_widget); - QWidget * quantize_widget = new QWidget(); - QHBoxLayout * quantize_hbox = new QHBoxLayout(); + auto quantize_widget = new QWidget(); + auto quantize_hbox = new QHBoxLayout(); quantize_hbox->setContentsMargins(0, 0, 0, 0); quantize_hbox->addWidget(quantize_lbl); quantize_hbox->addWidget(m_quantizeComboBox); @@ -4974,8 +4967,8 @@ PianoRollWindow::PianoRollWindow() : zoomAndNotesToolBar->addSeparator(); zoomAndNotesToolBar->addWidget(quantize_widget); - QWidget * note_widget = new QWidget(); - QHBoxLayout * note_hbox = new QHBoxLayout(); + auto note_widget = new QWidget(); + auto note_hbox = new QHBoxLayout(); note_hbox->setContentsMargins(0, 0, 0, 0); note_hbox->addWidget(note_len_lbl); note_hbox->addWidget(m_noteLenComboBox); @@ -4983,8 +4976,8 @@ PianoRollWindow::PianoRollWindow() : zoomAndNotesToolBar->addSeparator(); zoomAndNotesToolBar->addWidget(note_widget); - QWidget * scale_widget = new QWidget(); - QHBoxLayout * scale_hbox = new QHBoxLayout(); + auto scale_widget = new QWidget(); + auto scale_hbox = new QHBoxLayout(); scale_hbox->setContentsMargins(0, 0, 0, 0); scale_hbox->addWidget(scale_lbl); // Add the key selection between scale label and key @@ -4994,8 +4987,8 @@ PianoRollWindow::PianoRollWindow() : zoomAndNotesToolBar->addSeparator(); zoomAndNotesToolBar->addWidget(scale_widget); - QWidget * chord_widget = new QWidget(); - QHBoxLayout * chord_hbox = new QHBoxLayout(); + auto chord_widget = new QWidget(); + auto chord_hbox = new QHBoxLayout(); chord_hbox->setContentsMargins(0, 0, 0, 0); chord_hbox->addWidget(chord_lbl); chord_hbox->addWidget(m_chordComboBox); @@ -5006,8 +4999,8 @@ PianoRollWindow::PianoRollWindow() : zoomAndNotesToolBar->addSeparator(); zoomAndNotesToolBar->addWidget( m_clearGhostButton ); - QWidget* snapWidget = new QWidget(); - QHBoxLayout* snapHbox = new QHBoxLayout(); + auto snapWidget = new QWidget(); + auto snapHbox = new QHBoxLayout(); snapHbox->setContentsMargins(0, 0, 0, 0); snapHbox->addWidget(snapLbl); snapHbox->addWidget(m_snapComboBox); diff --git a/src/gui/editors/PositionLine.cpp b/src/gui/editors/PositionLine.cpp index e340a1c8c..7dd8b3b13 100644 --- a/src/gui/editors/PositionLine.cpp +++ b/src/gui/editors/PositionLine.cpp @@ -46,7 +46,7 @@ PositionLine::PositionLine(QWidget* parent) : void PositionLine::paintEvent(QPaintEvent* pe) { QPainter p(this); - QColor c = QColor(m_lineColor); + auto c = QColor(m_lineColor); // If width is 1, we don't need a gradient if (width() == 1) diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index bd1269b2a..3b13a96e9 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -145,8 +145,7 @@ SongEditor::SongEditor( Song * song ) : getGUI()->mainWindow()->addSpacingToToolBar( 10 ); - - QLabel * master_vol_lbl = new QLabel( tb ); + auto master_vol_lbl = new QLabel(tb); master_vol_lbl->setPixmap( embed::getIconPixmap( "master_volume" ) ); m_masterVolumeSlider = new AutomatableSlider( tb, @@ -178,8 +177,7 @@ SongEditor::SongEditor( Song * song ) : getGUI()->mainWindow()->addSpacingToToolBar( 10 ); - - QLabel * master_pitch_lbl = new QLabel( tb ); + auto master_pitch_lbl = new QLabel(tb); master_pitch_lbl->setPixmap( embed::getIconPixmap( "master_pitch" ) ); master_pitch_lbl->setFixedHeight( 64 ); @@ -210,8 +208,8 @@ SongEditor::SongEditor( Song * song ) : getGUI()->mainWindow()->addSpacingToToolBar( 10 ); // create widget for oscilloscope- and cpu-load-widget - QWidget * vc_w = new QWidget( tb ); - QVBoxLayout * vcw_layout = new QVBoxLayout( vc_w ); + auto vc_w = new QWidget(tb); + auto vcw_layout = new QVBoxLayout(vc_w); vcw_layout->setMargin( 0 ); vcw_layout->setSpacing( 0 ); @@ -427,7 +425,7 @@ void SongEditor::updateRubberband() //are clips in the rect of selection? for (auto &it : findChildren()) { - ClipView * clip = dynamic_cast(it); + auto clip = dynamic_cast(it); if (clip) { auto indexOfTrackView = trackViews().indexOf(clip->getTrackView()); @@ -512,8 +510,7 @@ void SongEditor::keyPressEvent( QKeyEvent * ke ) for( QVector::iterator it = so.begin(); it != so.end(); ++it ) { - ClipView * clipv = - dynamic_cast( *it ); + auto clipv = dynamic_cast(*it); clipv->remove(); } } @@ -756,7 +753,7 @@ static inline void animateScroll( QScrollBar *scrollBar, int newVal, bool smooth else { // do smooth scroll animation using QTimeLine - QTimeLine *t = scrollBar->findChild(); + auto t = scrollBar->findChild(); if( t == nullptr ) { t = new QTimeLine( 600, scrollBar ); @@ -989,7 +986,7 @@ SongEditorWindow::SongEditorWindow(Song* song) : DropToolBar *zoomToolBar = addDropToolBarToTop(tr("Zoom controls")); - QLabel * zoom_lbl = new QLabel( m_toolBar ); + auto zoom_lbl = new QLabel(m_toolBar); zoom_lbl->setPixmap( embed::getIconPixmap( "zoom" ) ); //Set up zooming-stuff @@ -1004,7 +1001,7 @@ SongEditorWindow::SongEditorWindow(Song* song) : zoomToolBar->addWidget( m_zoomingComboBox ); DropToolBar *snapToolBar = addDropToolBarToTop(tr("Snap controls")); - QLabel * snap_lbl = new QLabel( m_toolBar ); + auto snap_lbl = new QLabel(m_toolBar); snap_lbl->setPixmap( embed::getIconPixmap( "quantize" ) ); //Set up quantization/snapping selector diff --git a/src/gui/editors/TimeLineWidget.cpp b/src/gui/editors/TimeLineWidget.cpp index 0d3de7d2a..12b6a11f5 100644 --- a/src/gui/editors/TimeLineWidget.cpp +++ b/src/gui/editors/TimeLineWidget.cpp @@ -88,7 +88,7 @@ TimeLineWidget::TimeLineWidget( const int xoff, const int yoff, const float ppb, setMouseTracking(true); m_pos.m_timeLine = this; - QTimer * updateTimer = new QTimer( this ); + auto updateTimer = new QTimer(this); connect( updateTimer, SIGNAL(timeout()), this, SLOT(updatePosition())); updateTimer->start( 1000 / 60 ); // 60 fps @@ -121,14 +121,14 @@ void TimeLineWidget::setXOffset(const int x) void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) { - NStateButton * autoScroll = new NStateButton( _tool_bar ); + auto autoScroll = new NStateButton(_tool_bar); autoScroll->setGeneralToolTip( tr( "Auto scrolling" ) ); autoScroll->addState( embed::getIconPixmap( "autoscroll_on" ) ); autoScroll->addState( embed::getIconPixmap( "autoscroll_off" ) ); connect( autoScroll, SIGNAL(changedState(int)), this, SLOT(toggleAutoScroll(int))); - NStateButton * loopPoints = new NStateButton( _tool_bar ); + auto loopPoints = new NStateButton(_tool_bar); loopPoints->setGeneralToolTip( tr( "Loop points" ) ); loopPoints->addState( embed::getIconPixmap( "loop_points_off" ) ); loopPoints->addState( embed::getIconPixmap( "loop_points_on" ) ); @@ -137,7 +137,7 @@ void TimeLineWidget::addToolButtons( QToolBar * _tool_bar ) connect( this, SIGNAL(loopPointStateLoaded(int)), loopPoints, SLOT(changeState(int))); - NStateButton * behaviourAtStop = new NStateButton( _tool_bar ); + auto behaviourAtStop = new NStateButton(_tool_bar); behaviourAtStop->addState( embed::getIconPixmap( "back_to_zero" ), tr( "After stopping go back to beginning" ) ); diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index e7db85e43..d5c7496c1 100644 --- a/src/gui/editors/TrackContainerView.cpp +++ b/src/gui/editors/TrackContainerView.cpp @@ -89,12 +89,12 @@ TrackContainerView::TrackContainerView( TrackContainer * _tc ) : m_tc->setHook( this ); //keeps the direction of the widget, undepended on the locale setLayoutDirection( Qt::LeftToRight ); - QVBoxLayout * layout = new QVBoxLayout( this ); + auto layout = new QVBoxLayout(this); layout->setMargin( 0 ); layout->setSpacing( 0 ); layout->addWidget( m_scrollArea ); - QWidget * scrollContent = new QWidget; + auto scrollContent = new QWidget; m_scrollLayout = new QVBoxLayout( scrollContent ); m_scrollLayout->setMargin( 0 ); m_scrollLayout->setSpacing( 0 ); @@ -399,11 +399,8 @@ void TrackContainerView::dropEvent( QDropEvent * _de ) QString value = StringPairDrag::decodeValue( _de ); if( type == "instrument" ) { - InstrumentTrack * it = dynamic_cast( - Track::create( Track::InstrumentTrack, - m_tc ) ); - InstrumentLoaderThread *ilt = new InstrumentLoaderThread( - this, it, value ); + auto it = dynamic_cast(Track::create(Track::InstrumentTrack, m_tc)); + auto ilt = new InstrumentLoaderThread(this, it, value); ilt->start(); //it->toggledInstrumentTrackButton( true ); _de->accept(); @@ -412,9 +409,7 @@ void TrackContainerView::dropEvent( QDropEvent * _de ) || type == "soundfontfile" || type == "vstpluginfile" || type == "patchfile" ) { - InstrumentTrack * it = dynamic_cast( - Track::create( Track::InstrumentTrack, - m_tc ) ); + auto it = dynamic_cast(Track::create(Track::InstrumentTrack, m_tc)); PluginFactory::PluginInfoAndKey piakn = getPluginFactory()->pluginSupportingExtension(FileItem::extension(value)); Instrument * i = it->loadInstrument(piakn.info.name(), &piakn.key); @@ -425,9 +420,7 @@ void TrackContainerView::dropEvent( QDropEvent * _de ) else if( type == "presetfile" ) { DataFile dataFile( value ); - InstrumentTrack * it = dynamic_cast( - Track::create( Track::InstrumentTrack, - m_tc ) ); + auto it = dynamic_cast(Track::create(Track::InstrumentTrack, m_tc)); it->setSimpleSerializing(); it->loadSettings( dataFile.content().toElement() ); //it->toggledInstrumentTrackButton( true ); diff --git a/src/gui/instrument/EnvelopeAndLfoView.cpp b/src/gui/instrument/EnvelopeAndLfoView.cpp index a11910b09..df0e1120d 100644 --- a/src/gui/instrument/EnvelopeAndLfoView.cpp +++ b/src/gui/instrument/EnvelopeAndLfoView.cpp @@ -166,29 +166,28 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) : m_lfoAmountKnob->move( LFO_AMOUNT_KNOB_X, LFO_KNOB_Y ); m_lfoAmountKnob->setHintText( tr( "Modulation amount:" ), "" ); - - PixmapButton * sin_lfo_btn = new PixmapButton( this, nullptr ); + auto sin_lfo_btn = new PixmapButton(this, nullptr); sin_lfo_btn->move( LFO_SHAPES_X, LFO_SHAPES_Y ); sin_lfo_btn->setActiveGraphic( embed::getIconPixmap( "sin_wave_active" ) ); sin_lfo_btn->setInactiveGraphic( embed::getIconPixmap( "sin_wave_inactive" ) ); - PixmapButton * triangle_lfo_btn = new PixmapButton( this, nullptr ); + auto triangle_lfo_btn = new PixmapButton(this, nullptr); triangle_lfo_btn->move( LFO_SHAPES_X+15, LFO_SHAPES_Y ); triangle_lfo_btn->setActiveGraphic( embed::getIconPixmap( "triangle_wave_active" ) ); triangle_lfo_btn->setInactiveGraphic( embed::getIconPixmap( "triangle_wave_inactive" ) ); - PixmapButton * saw_lfo_btn = new PixmapButton( this, nullptr ); + auto saw_lfo_btn = new PixmapButton(this, nullptr); saw_lfo_btn->move( LFO_SHAPES_X+30, LFO_SHAPES_Y ); saw_lfo_btn->setActiveGraphic( embed::getIconPixmap( "saw_wave_active" ) ); saw_lfo_btn->setInactiveGraphic( embed::getIconPixmap( "saw_wave_inactive" ) ); - PixmapButton * sqr_lfo_btn = new PixmapButton( this, nullptr ); + auto sqr_lfo_btn = new PixmapButton(this, nullptr); sqr_lfo_btn->move( LFO_SHAPES_X+45, LFO_SHAPES_Y ); sqr_lfo_btn->setActiveGraphic( embed::getIconPixmap( "square_wave_active" ) ); @@ -205,7 +204,7 @@ EnvelopeAndLfoView::EnvelopeAndLfoView( QWidget * _parent ) : connect( m_userLfoBtn, SIGNAL(toggled(bool)), this, SLOT(lfoUserWaveChanged())); - PixmapButton * random_lfo_btn = new PixmapButton( this, nullptr ); + auto random_lfo_btn = new PixmapButton(this, nullptr); random_lfo_btn->move( LFO_SHAPES_X+60, LFO_SHAPES_Y ); random_lfo_btn->setActiveGraphic( embed::getIconPixmap( "random_wave_active" ) ); diff --git a/src/gui/instrument/InstrumentFunctionViews.cpp b/src/gui/instrument/InstrumentFunctionViews.cpp index 639e9e7c3..99c68a5ed 100644 --- a/src/gui/instrument/InstrumentFunctionViews.cpp +++ b/src/gui/instrument/InstrumentFunctionViews.cpp @@ -46,17 +46,17 @@ InstrumentFunctionNoteStackingView::InstrumentFunctionNoteStackingView( Instrume m_chordsComboBox( new ComboBox() ), m_chordRangeKnob( new Knob( knobBright_26 ) ) { - QHBoxLayout* topLayout = new QHBoxLayout( this ); + auto topLayout = new QHBoxLayout(this); topLayout->setMargin( 0 ); topLayout->addWidget( m_chordsGroupBox ); - QGridLayout* mainLayout = new QGridLayout( m_chordsGroupBox ); + auto mainLayout = new QGridLayout(m_chordsGroupBox); mainLayout->setContentsMargins( 8, 18, 8, 8 ); mainLayout->setColumnStretch( 0, 1 ); mainLayout->setHorizontalSpacing( 20 ); mainLayout->setVerticalSpacing( 1 ); - QLabel* chordLabel = new QLabel( tr( "Chord:" ) ); + auto chordLabel = new QLabel(tr("Chord:")); chordLabel->setFont( pointSize<8>( chordLabel->font() ) ); m_chordRangeKnob->setLabel( tr( "RANGE" ) ); @@ -108,11 +108,11 @@ InstrumentFunctionArpeggioView::InstrumentFunctionArpeggioView( InstrumentFuncti m_arpDirectionComboBox( new ComboBox() ), m_arpModeComboBox( new ComboBox() ) { - QHBoxLayout* topLayout = new QHBoxLayout( this ); + auto topLayout = new QHBoxLayout(this); topLayout->setMargin( 0 ); topLayout->addWidget( m_arpGroupBox ); - QGridLayout* mainLayout = new QGridLayout( m_arpGroupBox ); + auto mainLayout = new QGridLayout(m_arpGroupBox); mainLayout->setContentsMargins( 8, 18, 8, 8 ); mainLayout->setColumnStretch( 0, 1 ); mainLayout->setHorizontalSpacing( 20 ); @@ -145,14 +145,13 @@ InstrumentFunctionArpeggioView::InstrumentFunctionArpeggioView( InstrumentFuncti m_arpGateKnob->setLabel( tr( "GATE" ) ); m_arpGateKnob->setHintText( tr( "Arpeggio gate:" ), tr( "%" ) ); - - QLabel* arpChordLabel = new QLabel( tr( "Chord:" ) ); + auto arpChordLabel = new QLabel(tr("Chord:")); arpChordLabel->setFont( pointSize<8>( arpChordLabel->font() ) ); - QLabel* arpDirectionLabel = new QLabel( tr( "Direction:" ) ); + auto arpDirectionLabel = new QLabel(tr("Direction:")); arpDirectionLabel->setFont( pointSize<8>( arpDirectionLabel->font() ) ); - QLabel* arpModeLabel = new QLabel( tr( "Mode:" ) ); + auto arpModeLabel = new QLabel(tr("Mode:")); arpModeLabel->setFont( pointSize<8>( arpModeLabel->font() ) ); mainLayout->addWidget( arpChordLabel, 0, 0 ); diff --git a/src/gui/instrument/InstrumentMidiIOView.cpp b/src/gui/instrument/InstrumentMidiIOView.cpp index 31eebca20..8d7cf9dda 100644 --- a/src/gui/instrument/InstrumentMidiIOView.cpp +++ b/src/gui/instrument/InstrumentMidiIOView.cpp @@ -47,12 +47,12 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : m_rpBtn( nullptr ), m_wpBtn( nullptr ) { - QVBoxLayout* layout = new QVBoxLayout( this ); + auto layout = new QVBoxLayout(this); layout->setMargin( 5 ); m_midiInputGroupBox = new GroupBox( tr( "ENABLE MIDI INPUT" ) ); layout->addWidget( m_midiInputGroupBox ); - QHBoxLayout* midiInputLayout = new QHBoxLayout( m_midiInputGroupBox ); + auto midiInputLayout = new QHBoxLayout(m_midiInputGroupBox); midiInputLayout->setContentsMargins( 8, 18, 8, 8 ); midiInputLayout->setSpacing( 4 ); @@ -83,7 +83,7 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : m_midiOutputGroupBox = new GroupBox( tr( "ENABLE MIDI OUTPUT" ) ); layout->addWidget( m_midiOutputGroupBox ); - QHBoxLayout* midiOutputLayout = new QHBoxLayout( m_midiOutputGroupBox ); + auto midiOutputLayout = new QHBoxLayout(m_midiOutputGroupBox); midiOutputLayout->setContentsMargins( 8, 18, 8, 8 ); midiOutputLayout->setSpacing( 4 ); @@ -144,14 +144,15 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : midiOutputLayout->insertWidget( 0, m_wpBtn ); } - GroupBox* baseVelocityGroupBox = new GroupBox( tr( "CUSTOM BASE VELOCITY" ) ); + auto baseVelocityGroupBox = new GroupBox(tr("CUSTOM BASE VELOCITY")); layout->addWidget( baseVelocityGroupBox ); - QVBoxLayout* baseVelocityLayout = new QVBoxLayout( baseVelocityGroupBox ); + auto baseVelocityLayout = new QVBoxLayout(baseVelocityGroupBox); baseVelocityLayout->setContentsMargins( 8, 18, 8, 8 ); baseVelocityLayout->setSpacing( 6 ); - QLabel* baseVelocityHelp = new QLabel( tr( "Specify the velocity normalization base for MIDI-based instruments at 100% note velocity." ) ); + auto baseVelocityHelp + = new QLabel(tr("Specify the velocity normalization base for MIDI-based instruments at 100% note velocity.")); baseVelocityHelp->setWordWrap( true ); baseVelocityHelp->setFont( pointSize<8>( baseVelocityHelp->font() ) ); @@ -174,7 +175,7 @@ InstrumentMidiIOView::InstrumentMidiIOView( QWidget* parent ) : void InstrumentMidiIOView::modelChanged() { - MidiPort * mp = castModel(); + auto mp = castModel(); m_midiInputGroupBox->setModel( &mp->m_readableModel ); m_inputChannelSpinBox->setModel( &mp->m_inputChannelModel ); diff --git a/src/gui/instrument/InstrumentMiscView.cpp b/src/gui/instrument/InstrumentMiscView.cpp index be79db788..400b3aa60 100644 --- a/src/gui/instrument/InstrumentMiscView.cpp +++ b/src/gui/instrument/InstrumentMiscView.cpp @@ -43,7 +43,7 @@ namespace lmms::gui InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) : QWidget(parent) { - QVBoxLayout *layout = new QVBoxLayout(this); + auto layout = new QVBoxLayout(this); layout->setMargin(5); // Master pitch toggle @@ -51,10 +51,10 @@ InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) : m_pitchGroupBox->setModel(&it->m_useMasterPitchModel); layout->addWidget(m_pitchGroupBox); - QHBoxLayout *masterPitchLayout = new QHBoxLayout(m_pitchGroupBox); + auto masterPitchLayout = new QHBoxLayout(m_pitchGroupBox); masterPitchLayout->setContentsMargins(8, 18, 8, 8); - QLabel *tlabel = new QLabel(tr("Enables the use of master pitch")); + auto tlabel = new QLabel(tr("Enables the use of master pitch")); tlabel->setFont(pointSize<8>(tlabel->font())); masterPitchLayout->addWidget(tlabel); @@ -63,17 +63,17 @@ InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) : m_microtunerGroupBox->setModel(it->m_microtuner.enabledModel()); layout->addWidget(m_microtunerGroupBox); - QVBoxLayout *microtunerLayout = new QVBoxLayout(m_microtunerGroupBox); + auto microtunerLayout = new QVBoxLayout(m_microtunerGroupBox); microtunerLayout->setContentsMargins(8, 18, 8, 8); - QLabel *scaleLabel = new QLabel(tr("Active scale:")); + auto scaleLabel = new QLabel(tr("Active scale:")); microtunerLayout->addWidget(scaleLabel); m_scaleCombo = new ComboBox(); m_scaleCombo->setModel(it->m_microtuner.scaleModel()); microtunerLayout->addWidget(m_scaleCombo); - QLabel *keymapLabel = new QLabel(tr("Active keymap:")); + auto keymapLabel = new QLabel(tr("Active keymap:")); microtunerLayout->addWidget(keymapLabel); m_keymapCombo = new ComboBox(); diff --git a/src/gui/instrument/InstrumentTrackWindow.cpp b/src/gui/instrument/InstrumentTrackWindow.cpp index cead80e7c..70c11976a 100644 --- a/src/gui/instrument/InstrumentTrackWindow.cpp +++ b/src/gui/instrument/InstrumentTrackWindow.cpp @@ -89,19 +89,19 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : // init own layout + widgets setFocusPolicy( Qt::StrongFocus ); - QVBoxLayout * vlayout = new QVBoxLayout( this ); + auto vlayout = new QVBoxLayout(this); vlayout->setMargin( 0 ); vlayout->setSpacing( 0 ); - TabWidget* generalSettingsWidget = new TabWidget( tr( "GENERAL SETTINGS" ), this ); + auto generalSettingsWidget = new TabWidget(tr("GENERAL SETTINGS"), this); - QVBoxLayout* generalSettingsLayout = new QVBoxLayout( generalSettingsWidget ); + auto generalSettingsLayout = new QVBoxLayout(generalSettingsWidget); generalSettingsLayout->setContentsMargins( 8, 18, 8, 8 ); generalSettingsLayout->setSpacing( 6 ); - QWidget* nameAndChangeTrackWidget = new QWidget( generalSettingsWidget ); - QHBoxLayout* nameAndChangeTrackLayout = new QHBoxLayout( nameAndChangeTrackWidget ); + auto nameAndChangeTrackWidget = new QWidget(generalSettingsWidget); + auto nameAndChangeTrackLayout = new QHBoxLayout(nameAndChangeTrackWidget); nameAndChangeTrackLayout->setContentsMargins( 0, 0, 0, 0 ); nameAndChangeTrackLayout->setSpacing( 2 ); @@ -127,9 +127,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : generalSettingsLayout->addWidget( nameAndChangeTrackWidget ); - - - QGridLayout* basicControlsLayout = new QGridLayout; + auto basicControlsLayout = new QGridLayout; basicControlsLayout->setHorizontalSpacing(3); basicControlsLayout->setVerticalSpacing(0); basicControlsLayout->setContentsMargins(0, 0, 0, 0); @@ -157,7 +155,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : basicControlsLayout->addWidget( m_volumeKnob, 0, 0 ); basicControlsLayout->setAlignment( m_volumeKnob, widgetAlignment ); - QLabel *label = new QLabel( tr( "VOL" ), this ); + auto label = new QLabel(tr("VOL"), this); label->setStyleSheet( labelStyleSheet ); basicControlsLayout->addWidget( label, 1, 0); basicControlsLayout->setAlignment( label, labelAlignment ); @@ -218,7 +216,7 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : basicControlsLayout->addWidget( label, 1, 6); basicControlsLayout->setAlignment( label, labelAlignment ); - QPushButton* saveSettingsBtn = new QPushButton( embed::getIconPixmap( "project_save" ), QString() ); + auto saveSettingsBtn = new QPushButton(embed::getIconPixmap("project_save"), QString()); saveSettingsBtn->setMinimumSize( 32, 32 ); connect( saveSettingsBtn, SIGNAL(clicked()), this, SLOT(saveSettingsBtnClicked())); @@ -246,8 +244,8 @@ InstrumentTrackWindow::InstrumentTrackWindow( InstrumentTrackView * _itv ) : m_ssView = new InstrumentSoundShapingView( m_tabWidget ); // FUNC tab - QWidget* instrumentFunctions = new QWidget( m_tabWidget ); - QVBoxLayout* instrumentFunctionsLayout = new QVBoxLayout( instrumentFunctions ); + auto instrumentFunctions = new QWidget(m_tabWidget); + auto instrumentFunctionsLayout = new QVBoxLayout(instrumentFunctions); instrumentFunctionsLayout->setMargin( 5 ); m_noteStackingView = new InstrumentFunctionNoteStackingView( &m_track->m_noteStacking ); m_arpeggioView = new InstrumentFunctionArpeggioView( &m_track->m_arpeggio ); diff --git a/src/gui/instrument/PianoView.cpp b/src/gui/instrument/PianoView.cpp index 87a356afc..a64b22095 100644 --- a/src/gui/instrument/PianoView.cpp +++ b/src/gui/instrument/PianoView.cpp @@ -145,7 +145,7 @@ PianoView::PianoView(QWidget *parent) : this, SLOT(pianoScrolled(int))); // create a layout for ourselves - QVBoxLayout * layout = new QVBoxLayout( this ); + auto layout = new QVBoxLayout(this); layout->setSpacing( 0 ); layout->setMargin( 0 ); layout->addSpacing( PIANO_BASE+PW_WHITE_KEY_HEIGHT ); diff --git a/src/gui/menus/MidiPortMenu.cpp b/src/gui/menus/MidiPortMenu.cpp index a7c61fb0c..b1ddf71c9 100644 --- a/src/gui/menus/MidiPortMenu.cpp +++ b/src/gui/menus/MidiPortMenu.cpp @@ -45,7 +45,7 @@ MidiPortMenu::MidiPortMenu( MidiPort::Modes _mode ) : void MidiPortMenu::modelChanged() { - MidiPort * mp = castModel(); + auto mp = castModel(); if( m_mode == MidiPort::Input ) { connect( mp, SIGNAL(readablePortsChanged()), @@ -81,7 +81,7 @@ void MidiPortMenu::activatedPort( QAction * _item ) void MidiPortMenu::updateMenu() { - MidiPort * mp = castModel(); + auto mp = castModel(); const MidiPort::Map & map = ( m_mode == MidiPort::Input ) ? mp->readablePorts() : mp->writablePorts(); clear(); diff --git a/src/gui/modals/ControllerConnectionDialog.cpp b/src/gui/modals/ControllerConnectionDialog.cpp index 12dd7c6ef..149303da8 100644 --- a/src/gui/modals/ControllerConnectionDialog.cpp +++ b/src/gui/modals/ControllerConnectionDialog.cpp @@ -81,7 +81,7 @@ public: // model has none. MidiController* copyToMidiController( Model* parent ) { - MidiController* c = new MidiController( parent ); + auto c = new MidiController(parent); c->m_midiPort.setInputChannel( m_midiPort.inputChannel() ); c->m_midiPort.setInputController( m_midiPort.inputController() ); c->subscribeReadablePorts( m_midiPort.readablePorts() ); @@ -172,7 +172,7 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, m_readablePorts = new MidiPortMenu( MidiPort::Input ); connect( m_readablePorts, SIGNAL(triggered(QAction*)), this, SLOT(enableAutoDetect(QAction*))); - ToolButton * rp_btn = new ToolButton( m_midiGroupBox ); + auto rp_btn = new ToolButton(m_midiGroupBox); rp_btn->setText( tr( "MIDI-devices to receive " "MIDI-events from" ) ); rp_btn->setIcon( embed::getIconPixmap( "piano" ) ); @@ -210,22 +210,18 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, // Buttons - QWidget * buttons = new QWidget( this ); + auto buttons = new QWidget(this); buttons->setGeometry( 8, 240, 240, 32 ); - QHBoxLayout * btn_layout = new QHBoxLayout( buttons ); + auto btn_layout = new QHBoxLayout(buttons); btn_layout->setSpacing( 0 ); btn_layout->setMargin( 0 ); - - QPushButton * select_btn = new QPushButton( - embed::getIconPixmap( "add" ), - tr( "OK" ), buttons ); + + auto select_btn = new QPushButton(embed::getIconPixmap("add"), tr("OK"), buttons); connect( select_btn, SIGNAL(clicked()), this, SLOT(selectController())); - - QPushButton * cancel_btn = new QPushButton( - embed::getIconPixmap( "cancel" ), - tr( "Cancel" ), buttons ); + + auto cancel_btn = new QPushButton(embed::getIconPixmap("cancel"), tr("Cancel"), buttons); connect( cancel_btn, SIGNAL(clicked()), this, SLOT(reject())); @@ -253,8 +249,8 @@ ControllerConnectionDialog::ControllerConnectionDialog( QWidget * _parent, m_midiGroupBox->model()->setValue( true ); // ensure controller is created midiToggled(); - - MidiController * cont = (MidiController*)( cc->getController() ); + + auto cont = (MidiController*)(cc->getController()); m_midiChannelSpinBox->model()->setValue( cont->m_midiPort.inputChannel() ); m_midiControllerSpinBox->model()->setValue( cont->m_midiPort.inputController() ); diff --git a/src/gui/modals/EffectSelectDialog.cpp b/src/gui/modals/EffectSelectDialog.cpp index 2b5c0c58d..9ce3f90b6 100644 --- a/src/gui/modals/EffectSelectDialog.cpp +++ b/src/gui/modals/EffectSelectDialog.cpp @@ -108,7 +108,7 @@ EffectSelectDialog::EffectSelectDialog( QWidget * _parent ) : ui->pluginList->setModel( &m_model ); // setup selection model - QItemSelectionModel * selectionModel = new QItemSelectionModel( &m_model ); + auto selectionModel = new QItemSelectionModel(&m_model); ui->pluginList->setSelectionModel( selectionModel ); connect( selectionModel, SIGNAL( currentRowChanged( const QModelIndex&, const QModelIndex & ) ), @@ -193,14 +193,14 @@ void EffectSelectDialog::rowChanged( const QModelIndex & _idx, { m_descriptionWidget = new QWidget; - QHBoxLayout *hbox = new QHBoxLayout( m_descriptionWidget ); + auto hbox = new QHBoxLayout(m_descriptionWidget); Plugin::Descriptor const & descriptor = *( m_currentSelection.desc ); const PixmapLoader* pixLoa = m_currentSelection.logo(); if (pixLoa) { - QLabel *logoLabel = new QLabel( m_descriptionWidget ); + auto logoLabel = new QLabel(m_descriptionWidget); logoLabel->setPixmap(pixLoa->pixmap()); logoLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); @@ -208,18 +208,18 @@ void EffectSelectDialog::rowChanged( const QModelIndex & _idx, hbox->setAlignment( logoLabel, Qt::AlignTop); } - QWidget *textualInfoWidget = new QWidget( m_descriptionWidget ); + auto textualInfoWidget = new QWidget(m_descriptionWidget); hbox->addWidget(textualInfoWidget); - QVBoxLayout * textWidgetLayout = new QVBoxLayout( textualInfoWidget); + auto textWidgetLayout = new QVBoxLayout(textualInfoWidget); textWidgetLayout->setMargin( 4 ); textWidgetLayout->setSpacing( 0 ); if ( m_currentSelection.desc->subPluginFeatures ) { - QWidget *subWidget = new QWidget(textualInfoWidget); - QVBoxLayout * subLayout = new QVBoxLayout( subWidget ); + auto subWidget = new QWidget(textualInfoWidget); + auto subLayout = new QVBoxLayout(subWidget); subLayout->setMargin( 4 ); subLayout->setSpacing( 0 ); m_currentSelection.desc->subPluginFeatures-> @@ -236,7 +236,7 @@ void EffectSelectDialog::rowChanged( const QModelIndex & _idx, } else { - QLabel *label = new QLabel(m_descriptionWidget); + auto label = new QLabel(m_descriptionWidget); QString labelText = "

" + tr("Name") + ": " + QString::fromUtf8(descriptor.displayName) + "

"; labelText += "

" + tr("Description") + ": " + qApp->translate( "PluginBrowser", descriptor.description ) + "

"; labelText += "

" + tr("Author") + ": " + QString::fromUtf8(descriptor.author) + "

"; diff --git a/src/gui/modals/FileDialog.cpp b/src/gui/modals/FileDialog.cpp index 321397f19..512d7179f 100644 --- a/src/gui/modals/FileDialog.cpp +++ b/src/gui/modals/FileDialog.cpp @@ -104,7 +104,7 @@ QString FileDialog::getOpenFileName(QWidget *parent, void FileDialog::clearSelection() { - QListView *view = findChild(); + auto view = findChild(); Q_ASSERT( view ); view->clearSelection(); } diff --git a/src/gui/modals/SetupDialog.cpp b/src/gui/modals/SetupDialog.cpp index f6b6428d7..d29608653 100644 --- a/src/gui/modals/SetupDialog.cpp +++ b/src/gui/modals/SetupDialog.cpp @@ -76,7 +76,7 @@ constexpr int BUFFERSIZE_RESOLUTION = 32; inline void labelWidget(QWidget * w, const QString & txt) { - QLabel * title = new QLabel(txt, w); + auto title = new QLabel(txt, w); QFont f = title->font(); f.setBold(true); title->setFont(pointSize<12>(f)); @@ -170,16 +170,15 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : const int YDelta = 18; // Main widget. - QWidget * main_w = new QWidget(this); - + auto main_w = new QWidget(this); // Vertical layout. - QVBoxLayout * vlayout = new QVBoxLayout(this); + auto vlayout = new QVBoxLayout(this); vlayout->setSpacing(0); vlayout->setMargin(0); // Horizontal layout. - QHBoxLayout * hlayout = new QHBoxLayout(main_w); + auto hlayout = new QHBoxLayout(main_w); hlayout->setSpacing(0); hlayout->setMargin(0); @@ -189,26 +188,19 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : m_tabBar->setFixedWidth(72); // Settings widget. - QWidget * settings_w = new QWidget(main_w); + auto settings_w = new QWidget(main_w); settings_w->setFixedSize(360, 360); // General widget. - QWidget * general_w = new QWidget(settings_w); - QVBoxLayout * general_layout = new QVBoxLayout(general_w); + auto general_w = new QWidget(settings_w); + auto general_layout = new QVBoxLayout(general_w); general_layout->setSpacing(10); general_layout->setMargin(0); labelWidget(general_w, tr("General")); - - auto addLedCheckBox = [&XDelta, &YDelta, this]( - const QString &ledText, - TabWidget* tw, - int& counter, - bool initialState, - const char* toggledSlot, - bool showRestartWarning - ){ - LedCheckBox * checkBox = new LedCheckBox(ledText, tw); + auto addLedCheckBox = [&XDelta, &YDelta, this](const QString& ledText, TabWidget* tw, int& counter, + bool initialState, const char* toggledSlot, bool showRestartWarning) { + auto checkBox = new LedCheckBox(ledText, tw); counter++; checkBox->move(XDelta, YDelta * counter); checkBox->setChecked(initialState); @@ -219,13 +211,10 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : } }; - int counter = 0; // GUI tab. - TabWidget * gui_tw = new TabWidget( - tr("Graphical user interface (GUI)"), general_w); - + auto gui_tw = new TabWidget(tr("Graphical user interface (GUI)"), general_w); addLedCheckBox(tr("Display volume as dBFS "), gui_tw, counter, m_displaydBFS, SLOT(toggleDisplaydBFS(bool)), true); @@ -254,9 +243,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : counter = 0; // Projects tab. - TabWidget * projects_tw = new TabWidget( - tr("Projects"), general_w); - + auto projects_tw = new TabWidget(tr("Projects"), general_w); addLedCheckBox(tr("Compress project files by default"), projects_tw, counter, m_MMPZ, SLOT(toggleMMPZ(bool)), true); @@ -268,10 +255,9 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : projects_tw->setFixedHeight(YDelta + YDelta * counter); // Language tab. - TabWidget * lang_tw = new TabWidget( - tr("Language"), general_w); + auto lang_tw = new TabWidget(tr("Language"), general_w); lang_tw->setFixedHeight(48); - QComboBox * changeLang = new QComboBox(lang_tw); + auto changeLang = new QComboBox(lang_tw); changeLang->move(XDelta, 20); QDir dir(ConfigManager::inst()->localeDir()); @@ -324,8 +310,8 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // Performance widget. - QWidget * performance_w = new QWidget(settings_w); - QVBoxLayout * performance_layout = new QVBoxLayout(performance_w); + auto performance_w = new QWidget(settings_w); + auto performance_layout = new QVBoxLayout(performance_w); performance_layout->setSpacing(10); performance_layout->setMargin(0); labelWidget(performance_w, @@ -333,8 +319,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // Autosave tab. - TabWidget * auto_save_tw = new TabWidget( - tr("Autosave"), performance_w); + auto auto_save_tw = new TabWidget(tr("Autosave"), performance_w); auto_save_tw->setFixedHeight(106); m_saveIntervalSlider = new QSlider(Qt::Horizontal, auto_save_tw); @@ -366,8 +351,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : connect(m_runningAutoSave, SIGNAL(toggled(bool)), this, SLOT(toggleRunningAutoSave(bool))); - QPushButton * autoSaveResetBtn = new QPushButton( - embed::getIconPixmap("reload"), "", auto_save_tw); + auto autoSaveResetBtn = new QPushButton(embed::getIconPixmap("reload"), "", auto_save_tw); autoSaveResetBtn->setGeometry(320, 70, 28, 28); connect(autoSaveResetBtn, SIGNAL(clicked()), this, SLOT(resetAutoSave())); @@ -379,8 +363,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : counter = 0; // UI effect vs. performance tab. - TabWidget * ui_fx_tw = new TabWidget( - tr("User interface (UI) effects vs. performance"), performance_w); + auto ui_fx_tw = new TabWidget(tr("User interface (UI) effects vs. performance"), performance_w); addLedCheckBox(tr("Smooth scroll in song editor"), ui_fx_tw, counter, m_smoothScroll, SLOT(toggleSmoothScroll(bool)), false); @@ -393,8 +376,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : counter = 0; // Plugins tab. - TabWidget * plugins_tw = new TabWidget( - tr("Plugins"), performance_w); + auto plugins_tw = new TabWidget(tr("Plugins"), performance_w); m_vstEmbedLbl = new QLabel(plugins_tw); m_vstEmbedLbl->move(XDelta, YDelta * ++counter); @@ -446,16 +428,15 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // Audio widget. - QWidget * audio_w = new QWidget(settings_w); - QVBoxLayout * audio_layout = new QVBoxLayout(audio_w); + auto audio_w = new QWidget(settings_w); + auto audio_layout = new QVBoxLayout(audio_w); audio_layout->setSpacing(10); audio_layout->setMargin(0); labelWidget(audio_w, tr("Audio")); // Audio interface tab. - TabWidget * audioiface_tw = new TabWidget( - tr("Audio interface"), audio_w); + auto audioiface_tw = new TabWidget(tr("Audio interface"), audio_w); audioiface_tw->setFixedHeight(56); m_audioInterfaces = new QComboBox(audioiface_tw); @@ -463,10 +444,10 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // Ifaces-settings-widget. - QWidget * as_w = new QWidget(audio_w); + auto as_w = new QWidget(audio_w); as_w->setFixedHeight(60); - QHBoxLayout * as_w_layout = new QHBoxLayout(as_w); + auto as_w_layout = new QHBoxLayout(as_w); as_w_layout->setSpacing(0); as_w_layout->setMargin(0); @@ -546,14 +527,12 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // Advanced setting, hidden for now if(false) { - LedCheckBox * useNaNHandler = new LedCheckBox( - tr("Use built-in NaN handler"), audio_w); + auto useNaNHandler = new LedCheckBox(tr("Use built-in NaN handler"), audio_w); useNaNHandler->setChecked(m_NaNHandler); } // HQ mode LED. - LedCheckBox * hqaudio = new LedCheckBox( - tr("HQ mode for output audio device"), audio_w); + auto hqaudio = new LedCheckBox(tr("HQ mode for output audio device"), audio_w); hqaudio->move(10, 0); hqaudio->setChecked(m_hqAudioDev); connect(hqaudio, SIGNAL(toggled(bool)), @@ -561,8 +540,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // Buffer size tab. - TabWidget * bufferSize_tw = new TabWidget( - tr("Buffer size"), audio_w); + auto bufferSize_tw = new TabWidget(tr("Buffer size"), audio_w); bufferSize_tw->setFixedHeight(76); m_bufferSizeSlider = new QSlider(Qt::Horizontal, bufferSize_tw); @@ -582,8 +560,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : m_bufferSizeLbl->setGeometry(10, 40, 200, 24); setBufferSize(m_bufferSizeSlider->value()); - QPushButton * bufferSize_reset_btn = new QPushButton( - embed::getIconPixmap("reload"), "", bufferSize_tw); + auto bufferSize_reset_btn = new QPushButton(embed::getIconPixmap("reload"), "", bufferSize_tw); bufferSize_reset_btn->setGeometry(320, 40, 28, 28); connect(bufferSize_reset_btn, SIGNAL(clicked()), this, SLOT(resetBufferSize())); @@ -601,26 +578,25 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // MIDI widget. - QWidget * midi_w = new QWidget(settings_w); - QVBoxLayout * midi_layout = new QVBoxLayout(midi_w); + auto midi_w = new QWidget(settings_w); + auto midi_layout = new QVBoxLayout(midi_w); midi_layout->setSpacing(10); midi_layout->setMargin(0); labelWidget(midi_w, tr("MIDI")); // MIDI interface tab. - TabWidget * midiiface_tw = new TabWidget( - tr("MIDI interface"), midi_w); + auto midiiface_tw = new TabWidget(tr("MIDI interface"), midi_w); midiiface_tw->setFixedHeight(56); m_midiInterfaces = new QComboBox(midiiface_tw); m_midiInterfaces->setGeometry(10, 20, 240, 28); // Ifaces-settings-widget. - QWidget * ms_w = new QWidget(midi_w); + auto ms_w = new QWidget(midi_w); ms_w->setFixedHeight(60); - QHBoxLayout * ms_w_layout = new QHBoxLayout(ms_w); + auto ms_w_layout = new QHBoxLayout(ms_w); ms_w_layout->setSpacing(0); ms_w_layout->setMargin(0); @@ -689,8 +665,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // MIDI autoassign tab. - TabWidget * midiAutoAssign_tw = new TabWidget( - tr("Automatically assign MIDI controller to selected track"), midi_w); + auto midiAutoAssign_tw = new TabWidget(tr("Automatically assign MIDI controller to selected track"), midi_w); midiAutoAssign_tw->setFixedHeight(56); m_assignableMidiDevices = new QComboBox(midiAutoAssign_tw); @@ -719,9 +694,9 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // Paths widget. - QWidget * paths_w = new QWidget(settings_w); + auto paths_w = new QWidget(settings_w); - QVBoxLayout * paths_layout = new QVBoxLayout(paths_w); + auto paths_layout = new QVBoxLayout(paths_w); paths_layout->setSpacing(10); paths_layout->setMargin(0); @@ -729,29 +704,23 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : // Paths scroll area. - QScrollArea * pathsScroll = new QScrollArea(paths_w); + auto pathsScroll = new QScrollArea(paths_w); pathsScroll->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn); pathsScroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Path selectors widget. - QWidget * pathSelectors = new QWidget(paths_w); + auto pathSelectors = new QWidget(paths_w); const int txtLength = 284; const int btnStart = 300; // Path selectors layout. - QVBoxLayout * pathSelectorsLayout = new QVBoxLayout; + auto pathSelectorsLayout = new QVBoxLayout; pathSelectorsLayout->setSpacing(10); - auto addPathEntry = [&](const QString &caption, - const QString& content, - const char* setSlot, - const char* openSlot, - QLineEdit*& lineEdit, - const char* pixmap = "project_open") - { - TabWidget * newTw = new TabWidget(caption, - pathSelectors); + auto addPathEntry = [&](const QString& caption, const QString& content, const char* setSlot, const char* openSlot, + QLineEdit*& lineEdit, const char* pixmap = "project_open") { + auto newTw = new TabWidget(caption, pathSelectors); newTw->setFixedHeight(48); lineEdit = new QLineEdit(content, newTw); @@ -759,9 +728,7 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : connect(lineEdit, SIGNAL(textChanged(const QString&)), this, setSlot); - QPushButton * selectBtn = new QPushButton( - embed::getIconPixmap(pixmap, 16, 16), - "", newTw); + auto selectBtn = new QPushButton(embed::getIconPixmap(pixmap, 16, 16), "", newTw); selectBtn->setFixedSize(24, 24); selectBtn->move(btnStart, 16); connect(selectBtn, SIGNAL(clicked()), this, openSlot); @@ -842,8 +809,8 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : hlayout->addSpacing(10); // Extras widget and layout. - QWidget * extras_w = new QWidget(this); - QHBoxLayout * extras_layout = new QHBoxLayout(extras_w); + auto extras_w = new QWidget(this); + auto extras_layout = new QHBoxLayout(extras_w); extras_layout->setSpacing(0); extras_layout->setMargin(0); @@ -853,16 +820,12 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : restartWarningLbl->hide(); // OK button. - QPushButton * ok_btn = new QPushButton( - embed::getIconPixmap("apply"), - tr("OK"), extras_w); + auto ok_btn = new QPushButton(embed::getIconPixmap("apply"), tr("OK"), extras_w); connect(ok_btn, SIGNAL(clicked()), this, SLOT(accept())); // Cancel button. - QPushButton * cancel_btn = new QPushButton( - embed::getIconPixmap("cancel"), - tr("Cancel"), extras_w); + auto cancel_btn = new QPushButton(embed::getIconPixmap("cancel"), tr("Cancel"), extras_w); connect(cancel_btn, SIGNAL(clicked()), this, SLOT(reject())); diff --git a/src/gui/modals/VersionedSaveDialog.cpp b/src/gui/modals/VersionedSaveDialog.cpp index d93bd948c..0c61df9f2 100644 --- a/src/gui/modals/VersionedSaveDialog.cpp +++ b/src/gui/modals/VersionedSaveDialog.cpp @@ -49,20 +49,20 @@ VersionedSaveDialog::VersionedSaveDialog( QWidget *parent, setFileMode( QFileDialog::AnyFile ); // Create + and - buttons - QPushButton *plusButton( new QPushButton( "+", this) ); + auto plusButton(new QPushButton("+", this)); plusButton->setToolTip( tr( "Increment version number" ) ); - QPushButton *minusButton( new QPushButton( "-", this ) ); + auto minusButton(new QPushButton("-", this)); minusButton->setToolTip( tr( "Decrement version number" ) ); plusButton->setFixedWidth(horizontalAdvance(plusButton->fontMetrics(), "+") + 30); minusButton->setFixedWidth(horizontalAdvance(minusButton->fontMetrics(), "+") + 30); // Add buttons to grid layout. For doing this, remove the lineEdit and // replace it with a HBox containing lineEdit and the buttons. - QGridLayout *layout = dynamic_cast( this->layout() ); + auto layout = dynamic_cast(this->layout()); QWidget *lineEdit = findChild(); layout->removeWidget( lineEdit ); - QHBoxLayout* hLayout( new QHBoxLayout() ); + auto hLayout(new QHBoxLayout()); hLayout->addWidget( lineEdit ); hLayout->addWidget( plusButton ); hLayout->addWidget( minusButton ); diff --git a/src/gui/tracks/AutomationTrackView.cpp b/src/gui/tracks/AutomationTrackView.cpp index 60f00679b..53e022c15 100644 --- a/src/gui/tracks/AutomationTrackView.cpp +++ b/src/gui/tracks/AutomationTrackView.cpp @@ -40,12 +40,11 @@ AutomationTrackView::AutomationTrackView( AutomationTrack * _at, TrackContainerV TrackView( _at, tcv ) { setFixedHeight( 32 ); - TrackLabelButton * tlb = new TrackLabelButton( this, - getTrackSettingsWidget() ); - tlb->setIcon( embed::getIconPixmap( "automation_track" ) ); - tlb->move( 3, 1 ); - tlb->show(); - setModel( _at ); + auto tlb = new TrackLabelButton(this, getTrackSettingsWidget()); + tlb->setIcon(embed::getIconPixmap("automation_track")); + tlb->move(3, 1); + tlb->show(); + setModel(_at); } void AutomationTrackView::dragEnterEvent( QDragEnterEvent * _dee ) @@ -62,9 +61,7 @@ void AutomationTrackView::dropEvent( QDropEvent * _de ) QString val = StringPairDrag::decodeValue( _de ); if( type == "automatable_model" ) { - AutomatableModel * mod = dynamic_cast( - Engine::projectJournal()-> - journallingObject( val.toInt() ) ); + auto mod = dynamic_cast(Engine::projectJournal()->journallingObject(val.toInt())); if( mod != nullptr ) { TimePos pos = TimePos( trackContainerView()-> @@ -81,7 +78,7 @@ void AutomationTrackView::dropEvent( QDropEvent * _de ) } Clip * clip = getTrack()->createClip( pos ); - AutomationClip * autoClip = dynamic_cast( clip ); + auto autoClip = dynamic_cast(clip); autoClip->addObject( mod ); } } diff --git a/src/gui/tracks/InstrumentTrackView.cpp b/src/gui/tracks/InstrumentTrackView.cpp index 5d01c8ae0..5daa51381 100644 --- a/src/gui/tracks/InstrumentTrackView.cpp +++ b/src/gui/tracks/InstrumentTrackView.cpp @@ -366,7 +366,7 @@ QMenu * InstrumentTrackView::createMixerMenu(QString title, QString newMixerLabe title = title.arg( channelIndex ).arg( mixerChannel->m_name ); } - QMenu *mixerMenu = new QMenu( title ); + auto mixerMenu = new QMenu(title); mixerMenu->addAction( newMixerLabel, this, SLOT(createMixerLine())); mixerMenu->addSeparator(); diff --git a/src/gui/tracks/SampleTrackView.cpp b/src/gui/tracks/SampleTrackView.cpp index 83331ad1e..08ddee863 100644 --- a/src/gui/tracks/SampleTrackView.cpp +++ b/src/gui/tracks/SampleTrackView.cpp @@ -134,7 +134,7 @@ QMenu * SampleTrackView::createMixerMenu(QString title, QString newMixerLabel) title = title.arg(channelIndex).arg(mixerChannel->m_name); } - QMenu *mixerMenu = new QMenu(title); + auto mixerMenu = new QMenu(title); mixerMenu->addAction(newMixerLabel, this, SLOT(createMixerLine())); mixerMenu->addSeparator(); @@ -168,7 +168,7 @@ void SampleTrackView::showEffects() void SampleTrackView::modelChanged() { - SampleTrack * st = castModel(); + auto st = castModel(); m_volumeKnob->setModel(&st->m_volumeModel); TrackView::modelChanged(); @@ -206,7 +206,7 @@ void SampleTrackView::dropEvent(QDropEvent *de) * TimePos::ticksPerBar()) + trackContainerView()->currentPosition() ).quantize(1.0); - SampleClip * sClip = static_cast(getTrack()->createClip(clipPos)); + auto sClip = static_cast(getTrack()->createClip(clipPos)); if (sClip) { sClip->setSampleFile(value); } } } diff --git a/src/gui/tracks/TrackContentWidget.cpp b/src/gui/tracks/TrackContentWidget.cpp index e22750ce3..220a1334f 100644 --- a/src/gui/tracks/TrackContentWidget.cpp +++ b/src/gui/tracks/TrackContentWidget.cpp @@ -468,7 +468,7 @@ bool TrackContentWidget::pasteSelection( TimePos clipPos, const QMimeData * md, float snapSize = getGUI()->songEditor()->m_editor->getSnapSize(); // All clips should be offset the same amount as the grabbed clip - TimePos offset = TimePos(clipPos - grabbedClipPos); + auto offset = TimePos(clipPos - grabbedClipPos); // Users expect clips to "fall" backwards, so bias the offset offset -= TimePos::ticksPerBar() * snapSize / 2; // The offset is quantized (rather than the positions) to preserve fine adjustments diff --git a/src/gui/tracks/TrackLabelButton.cpp b/src/gui/tracks/TrackLabelButton.cpp index 4e0b2be35..b82c8cf6e 100644 --- a/src/gui/tracks/TrackLabelButton.cpp +++ b/src/gui/tracks/TrackLabelButton.cpp @@ -188,8 +188,7 @@ void TrackLabelButton::paintEvent( QPaintEvent * _pe ) { if( m_trackView->getTrack()->type() == Track::InstrumentTrack ) { - InstrumentTrack * it = - dynamic_cast( m_trackView->getTrack() ); + auto it = dynamic_cast(m_trackView->getTrack()); const PixmapLoader * pl; auto get_logo = [](InstrumentTrack* it) -> const PixmapLoader* { diff --git a/src/gui/tracks/TrackOperationsWidget.cpp b/src/gui/tracks/TrackOperationsWidget.cpp index b3c8ac379..ddbd2eacd 100644 --- a/src/gui/tracks/TrackOperationsWidget.cpp +++ b/src/gui/tracks/TrackOperationsWidget.cpp @@ -63,7 +63,7 @@ TrackOperationsWidget::TrackOperationsWidget( TrackView * parent ) : setToolTip(tr("Press <%1> while clicking on move-grip " "to begin a new drag'n'drop action." ).arg(UI_CTRL_KEY) ); - QMenu * toMenu = new QMenu( this ); + auto toMenu = new QMenu(this); toMenu->setFont( pointSize<9>( toMenu->font() ) ); connect( toMenu, SIGNAL(aboutToShow()), this, SLOT(updateMenu())); @@ -195,7 +195,7 @@ bool TrackOperationsWidget::confirmRemoval() .arg(m_trackView->getTrack()->name()); QString messageTitleRemoveTrack = tr("Confirm removal"); QString askAgainText = tr("Don't ask again"); - QCheckBox* askAgainCheckBox = new QCheckBox(askAgainText, nullptr); + auto askAgainCheckBox = new QCheckBox(askAgainText, nullptr); connect(askAgainCheckBox, &QCheckBox::stateChanged, [this](int state){ // Invert button state, if it's checked we *shouldn't* ask again ConfigManager::inst()->setValue("ui", "trackdeletionwarning", state ? "0" : "1"); @@ -337,7 +337,7 @@ void TrackOperationsWidget::updateMenu() toMenu->addMenu(mixerMenu); } - if (InstrumentTrackView * trackView = dynamic_cast(m_trackView)) + if (auto trackView = dynamic_cast(m_trackView)) { toMenu->addSeparator(); toMenu->addMenu(trackView->midiMenu()); @@ -362,12 +362,12 @@ void TrackOperationsWidget::updateMenu() void TrackOperationsWidget::toggleRecording( bool on ) { - AutomationTrackView * atv = dynamic_cast( m_trackView ); + auto atv = dynamic_cast(m_trackView); if( atv ) { for( Clip * clip : atv->getTrack()->getClips() ) { - AutomationClip * ap = dynamic_cast( clip ); + auto ap = dynamic_cast(clip); if( ap ) { ap->setRecording( on ); } } atv->update(); diff --git a/src/gui/tracks/TrackView.cpp b/src/gui/tracks/TrackView.cpp index 4eece14d4..6d1c8f510 100644 --- a/src/gui/tracks/TrackView.cpp +++ b/src/gui/tracks/TrackView.cpp @@ -74,7 +74,7 @@ TrackView::TrackView( Track * track, TrackContainerView * tcv ) : m_trackSettingsWidget.setAutoFillBackground( true ); - QHBoxLayout * layout = new QHBoxLayout( this ); + auto layout = new QHBoxLayout(this); layout->setMargin( 0 ); layout->setSpacing( 0 ); layout->addWidget( &m_trackOperationsWidget ); diff --git a/src/gui/widgets/AutomatableButton.cpp b/src/gui/widgets/AutomatableButton.cpp index 49602a24f..5fbe211f8 100644 --- a/src/gui/widgets/AutomatableButton.cpp +++ b/src/gui/widgets/AutomatableButton.cpp @@ -126,7 +126,7 @@ void AutomatableButton::mousePressEvent( QMouseEvent * _me ) if( m_group ) { // A group, we must get process it instead - AutomatableModelView* groupView = (AutomatableModelView*)m_group; + auto groupView = (AutomatableModelView*)m_group; new StringPairDrag( "automatable_model", QString::number( groupView->modelUntyped()->id() ), QPixmap(), widget() ); diff --git a/src/gui/widgets/Fader.cpp b/src/gui/widgets/Fader.cpp index d063464a6..f853ff707 100644 --- a/src/gui/widgets/Fader.cpp +++ b/src/gui/widgets/Fader.cpp @@ -168,7 +168,7 @@ void Fader::mouseMoveEvent( QMouseEvent *mouseEvent ) float delta = dy * ( model()->maxValue() - model()->minValue() ) / (float) ( height() - ( *m_knob ).height() ); - const float step = model()->step(); + const auto step = model()->step(); float newValue = static_cast( static_cast( ( m_startValue + delta ) / step + 0.5 ) ) * step; model()->setValue( newValue ); diff --git a/src/gui/widgets/Graph.cpp b/src/gui/widgets/Graph.cpp index 63d295ad1..53a0a130d 100644 --- a/src/gui/widgets/Graph.cpp +++ b/src/gui/widgets/Graph.cpp @@ -50,7 +50,7 @@ Graph::Graph( QWidget * _parent, graphStyle _style, int _width, setAcceptDrops( true ); setCursor( Qt::CrossCursor ); - graphModel * gModel = castModel(); + auto gModel = castModel(); QObject::connect( gModel, SIGNAL(samplesChanged(int,int)), this, SLOT(updateGraph(int,int))); @@ -433,7 +433,7 @@ void Graph::dragEnterEvent( QDragEnterEvent * _dee ) void Graph::modelChanged() { - graphModel * gModel = castModel(); + auto gModel = castModel(); QObject::connect( gModel, SIGNAL(samplesChanged(int,int)), this, SLOT(updateGraph(int,int))); @@ -588,7 +588,7 @@ void graphModel::setWaveToNoise() QString graphModel::setWaveToUser() { - SampleBuffer * sampleBuffer = new SampleBuffer; + auto sampleBuffer = new SampleBuffer; QString fileName = sampleBuffer->openAndSetWaveformFile(); if( fileName.isEmpty() == false ) { diff --git a/src/gui/widgets/Knob.cpp b/src/gui/widgets/Knob.cpp index 5a3d220ed..049a86be1 100644 --- a/src/gui/widgets/Knob.cpp +++ b/src/gui/widgets/Knob.cpp @@ -549,9 +549,7 @@ void Knob::dropEvent( QDropEvent * _de ) } else if( type == "automatable_model" ) { - AutomatableModel * mod = dynamic_cast( - Engine::projectJournal()-> - journallingObject( val.toInt() ) ); + auto mod = dynamic_cast(Engine::projectJournal()->journallingObject(val.toInt())); if( mod != nullptr ) { AutomatableModel::linkModels( model(), mod ); @@ -709,7 +707,7 @@ void Knob::wheelEvent(QWheelEvent * we) void Knob::setPosition( const QPoint & _p ) { const float value = getValue( _p ) + m_leftOver; - const float step = model()->step(); + const auto step = model()->step(); const float oldValue = model()->value(); diff --git a/src/gui/widgets/LcdFloatSpinBox.cpp b/src/gui/widgets/LcdFloatSpinBox.cpp index 4112c567b..e57012e10 100644 --- a/src/gui/widgets/LcdFloatSpinBox.cpp +++ b/src/gui/widgets/LcdFloatSpinBox.cpp @@ -76,14 +76,14 @@ LcdFloatSpinBox::LcdFloatSpinBox(int numWhole, int numFrac, const QString& style void LcdFloatSpinBox::layoutSetup(const QString &style) { // Assemble the LCD parts - QHBoxLayout *lcdLayout = new QHBoxLayout(); + auto lcdLayout = new QHBoxLayout(); m_wholeDisplay.setSeamless(false, true); m_fractionDisplay.setSeamless(true, false); lcdLayout->addWidget(&m_wholeDisplay); - QLabel *dotLabel = new QLabel("", this); + auto dotLabel = new QLabel("", this); QPixmap dotPixmap(embed::getIconPixmap(QString("lcd_" + style + "_dot").toUtf8().constData())); dotLabel->setPixmap(dotPixmap.copy(0, 0, dotPixmap.size().width(), dotPixmap.size().height() / 2)); lcdLayout->addWidget(dotLabel); @@ -94,7 +94,7 @@ void LcdFloatSpinBox::layoutSetup(const QString &style) lcdLayout->setSpacing(0); // Add space for label - QVBoxLayout *outerLayout = new QVBoxLayout(); + auto outerLayout = new QVBoxLayout(); outerLayout->addLayout(lcdLayout); outerLayout->addSpacing(9); outerLayout->setContentsMargins(0, 0, 0, 0); diff --git a/src/gui/widgets/LcdSpinBox.cpp b/src/gui/widgets/LcdSpinBox.cpp index 7dd7fa8e8..b53d7ddb5 100644 --- a/src/gui/widgets/LcdSpinBox.cpp +++ b/src/gui/widgets/LcdSpinBox.cpp @@ -108,7 +108,7 @@ void LcdSpinBox::mouseMoveEvent( QMouseEvent* event ) int dy = event->globalY() - m_lastMousePos.y(); if( dy ) { - float fdy = static_cast(dy); + auto fdy = static_cast(dy); if( event->modifiers() & Qt::ShiftModifier ) { fdy = qBound( -4.f, fdy/4.f, 4.f ); } diff --git a/src/gui/widgets/MeterDialog.cpp b/src/gui/widgets/MeterDialog.cpp index c13fe3802..938177dce 100644 --- a/src/gui/widgets/MeterDialog.cpp +++ b/src/gui/widgets/MeterDialog.cpp @@ -41,12 +41,12 @@ MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : QWidget( _parent ), ModelView( nullptr, this ) { - QVBoxLayout * vlayout = new QVBoxLayout( this ); + auto vlayout = new QVBoxLayout(this); vlayout->setSpacing( 0 ); vlayout->setMargin( 0 ); - QWidget * num = new QWidget( this ); - QHBoxLayout * num_layout = new QHBoxLayout( num ); + auto num = new QWidget(this); + auto num_layout = new QHBoxLayout(num); num_layout->setSpacing( 0 ); num_layout->setMargin( 0 ); @@ -58,7 +58,7 @@ MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : if( !_simple ) { - QLabel * num_label = new QLabel( tr( "Meter Numerator" ), num ); + auto num_label = new QLabel(tr("Meter Numerator"), num); QFont f = num_label->font(); num_label->setFont( pointSize<7>( f ) ); num_layout->addSpacing( 5 ); @@ -66,9 +66,8 @@ MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : } num_layout->addStretch(); - - QWidget * den = new QWidget( this ); - QHBoxLayout * den_layout = new QHBoxLayout( den ); + auto den = new QWidget(this); + auto den_layout = new QHBoxLayout(den); den_layout->setSpacing( 0 ); den_layout->setMargin( 0 ); @@ -83,8 +82,7 @@ MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : if( !_simple ) { - QLabel * den_label = new QLabel( tr( "Meter Denominator" ), - den ); + auto den_label = new QLabel(tr("Meter Denominator"), den); QFont f = den_label->font(); den_label->setFont( pointSize<7>( f ) ); den_layout->addSpacing( 5 ); @@ -108,7 +106,7 @@ MeterDialog::MeterDialog( QWidget * _parent, bool _simple ) : void MeterDialog::modelChanged() { - MeterModel * mm = castModel(); + auto mm = castModel(); m_numerator->setModel( &mm->numeratorModel() ); m_denominator->setModel( &mm->denominatorModel() ); } diff --git a/src/gui/widgets/TabBar.cpp b/src/gui/widgets/TabBar.cpp index ccb879db6..d3c1fa0c5 100644 --- a/src/gui/widgets/TabBar.cpp +++ b/src/gui/widgets/TabBar.cpp @@ -54,7 +54,7 @@ TabButton * TabBar::addTab( QWidget * _w, const QString & _text, int _id, } QString caption = ( _text_is_tooltip ) ? QString( "" ) : _text; // create tab-button - TabButton * b = new TabButton( caption, _id, this ); + auto b = new TabButton(caption, _id, this); connect( b, SIGNAL(clicked(int)), this, SLOT(tabClicked(int))); b->setIconSize( QSize( 48, 48 ) ); b->setFixedSize( 64, 64 ); diff --git a/src/gui/widgets/TabWidget.cpp b/src/gui/widgets/TabWidget.cpp index 8899625fc..d8bb70a42 100644 --- a/src/gui/widgets/TabWidget.cpp +++ b/src/gui/widgets/TabWidget.cpp @@ -152,7 +152,7 @@ bool TabWidget::event(QEvent *event) if ( event->type() == QEvent::ToolTip ) { - QHelpEvent *helpEvent = static_cast(event); + auto helpEvent = static_cast(event); int idx = findTabAtPos( & helpEvent->pos() ); diff --git a/src/gui/widgets/TextFloat.cpp b/src/gui/widgets/TextFloat.cpp index 6b9871d3e..99eb5531f 100644 --- a/src/gui/widgets/TextFloat.cpp +++ b/src/gui/widgets/TextFloat.cpp @@ -92,7 +92,7 @@ TextFloat * TextFloat::displayMessage( const QString & _msg, int _timeout, QWidget * _parent, int _add_y_margin ) { QWidget * mw = getGUI()->mainWindow(); - TextFloat * tf = new TextFloat; + auto tf = new TextFloat; if( _parent != nullptr ) { tf->moveGlobal( _parent, QPoint( _parent->width() + 2, 0 ) ); diff --git a/src/tracks/AutomationTrack.cpp b/src/tracks/AutomationTrack.cpp index d7e7f33c1..deb6f763c 100644 --- a/src/tracks/AutomationTrack.cpp +++ b/src/tracks/AutomationTrack.cpp @@ -58,7 +58,7 @@ gui::TrackView* AutomationTrack::createView( gui::TrackContainerView* tcv ) Clip* AutomationTrack::createClip(const TimePos & pos) { - AutomationClip* p = new AutomationClip(this); + auto p = new AutomationClip(this); p->movePosition(pos); return p; } diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index 04786952e..c4ba36f33 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -304,9 +304,9 @@ void InstrumentTrack::processCCEvent(int controller) // Does nothing if the LED is disabled if (!m_midiCCEnable->value()) { return; } - uint8_t channel = static_cast(midiPort()->realOutputChannel()); - uint16_t cc = static_cast(controller); - uint16_t value = static_cast(m_midiCCModel[controller]->value()); + auto channel = static_cast(midiPort()->realOutputChannel()); + auto cc = static_cast(controller); + auto value = static_cast(m_midiCCModel[controller]->value()); // Process the MIDI CC event as an input event but with source set to Internal // so we can know LMMS generated the event, not a controller, and can process it during @@ -727,7 +727,7 @@ bool InstrumentTrack::play( const TimePos & _start, const fpp_t _frames, for( clipVector::Iterator it = clips.begin(); it != clips.end(); ++it ) { - MidiClip* c = dynamic_cast( *it ); + auto c = dynamic_cast(*it); // everything which is not a MIDI clip won't be played // A MIDI clip playing in the Piano Roll window will always play if(c == nullptr || @@ -791,7 +791,7 @@ bool InstrumentTrack::play( const TimePos & _start, const fpp_t _frames, Clip* InstrumentTrack::createClip(const TimePos & pos) { - MidiClip* p = new MidiClip(this); + auto p = new MidiClip(this); p->movePosition(pos); return p; } diff --git a/src/tracks/MidiClip.cpp b/src/tracks/MidiClip.cpp index 5b017a7f9..5c5322796 100644 --- a/src/tracks/MidiClip.cpp +++ b/src/tracks/MidiClip.cpp @@ -199,7 +199,7 @@ TimePos MidiClip::beatClipLength() const Note * MidiClip::addNote( const Note & _new_note, const bool _quant_pos ) { - Note * new_note = new Note( _new_note ); + auto new_note = new Note(_new_note); if (_quant_pos && gui::getGUI()->pianoRoll()) { new_note->quantizePos(gui::getGUI()->pianoRoll()->quantization()); @@ -448,7 +448,7 @@ void MidiClip::loadSettings( const QDomElement & _this ) if( node.isElement() && !node.toElement().attribute( "metadata" ).toInt() ) { - Note * n = new Note; + auto n = new Note; n->restoreState( node.toElement() ); m_notes.push_back( n ); } diff --git a/src/tracks/PatternTrack.cpp b/src/tracks/PatternTrack.cpp index 851db7f6c..f2369e15b 100644 --- a/src/tracks/PatternTrack.cpp +++ b/src/tracks/PatternTrack.cpp @@ -139,7 +139,7 @@ gui::TrackView* PatternTrack::createView(gui::TrackContainerView* tcv) Clip* PatternTrack::createClip(const TimePos & pos) { - PatternClip* pc = new PatternClip(this); + auto pc = new PatternClip(this); pc->movePosition(pos); return pc; } @@ -234,8 +234,8 @@ PatternTrack* PatternTrack::findPatternTrack(int pattern_num) void PatternTrack::swapPatternTracks(Track* track1, Track* track2) { - PatternTrack* t1 = dynamic_cast(track1); - PatternTrack* t2 = dynamic_cast(track2); + auto t1 = dynamic_cast(track1); + auto t2 = dynamic_cast(track2); if( t1 != nullptr && t2 != nullptr ) { qSwap( s_infoMap[t1], s_infoMap[t2] ); diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index caed04739..099dbdab6 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -102,7 +102,7 @@ bool SampleTrack::play( const TimePos & _start, const fpp_t _frames, for( int i = 0; i < numOfClips(); ++i ) { Clip * clip = getClip( i ); - SampleClip * sClip = dynamic_cast( clip ); + auto sClip = dynamic_cast(clip); if( _start >= sClip->startPosition() && _start < sClip->endPosition() ) { @@ -137,7 +137,7 @@ bool SampleTrack::play( const TimePos & _start, const fpp_t _frames, for( clipVector::Iterator it = clips.begin(); it != clips.end(); ++it ) { - SampleClip * st = dynamic_cast( *it ); + auto st = dynamic_cast(*it); if( !st->isMuted() ) { PlayHandle* handle; @@ -147,12 +147,12 @@ bool SampleTrack::play( const TimePos & _start, const fpp_t _frames, { return played_a_note; } - SampleRecordHandle* smpHandle = new SampleRecordHandle( st ); + auto smpHandle = new SampleRecordHandle(st); handle = smpHandle; } else { - SamplePlayHandle* smpHandle = new SamplePlayHandle( st ); + auto smpHandle = new SamplePlayHandle(st); smpHandle->setVolumeModel( &m_volumeModel ); smpHandle->setPatternTrack(pattern_track); handle = smpHandle; @@ -180,7 +180,7 @@ gui::TrackView * SampleTrack::createView( gui::TrackContainerView* tcv ) Clip * SampleTrack::createClip(const TimePos & pos) { - SampleClip * sClip = new SampleClip(this); + auto sClip = new SampleClip(this); sClip->movePosition(pos); return sClip; } @@ -241,7 +241,7 @@ void SampleTrack::setPlayingClips( bool isPlaying ) for( int i = 0; i < numOfClips(); ++i ) { Clip * clip = getClip( i ); - SampleClip * sClip = dynamic_cast( clip ); + auto sClip = dynamic_cast(clip); sClip->setIsPlaying( isPlaying ); } } From 5bfd7fba4e7972830ce751ba4b44c8c200bb9f2e Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Mon, 19 Sep 2022 14:46:38 +0100 Subject: [PATCH 30/55] Support Sf2 Player, Mallets, PortAudio, and Lame with MSVC (#6507) --- .github/workflows/build.yml | 8 +- CMakeLists.txt | 35 ++-- cmake/modules/FindFluidSynth.cmake | 73 +++++++ cmake/modules/FindLame.cmake | 41 +++- cmake/modules/FindPortaudio.cmake | 64 +++--- cmake/modules/FindSDL2.cmake | 231 ++++++++-------------- cmake/modules/FindSTK.cmake | 44 +++-- cmake/modules/ImportedTargetHelpers.cmake | 57 ++++++ plugins/Sf2Player/CMakeLists.txt | 19 +- plugins/Sf2Player/Sf2Player.cpp | 11 +- plugins/Stk/Mallets/CMakeLists.txt | 12 +- plugins/Stk/Mallets/Mallets.cpp | 6 +- plugins/Stk/Mallets/Mallets.h | 2 +- src/CMakeLists.txt | 20 +- 14 files changed, 374 insertions(+), 249 deletions(-) create mode 100644 cmake/modules/FindFluidSynth.cmake create mode 100644 cmake/modules/ImportedTargetHelpers.cmake diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bdcdeb7d7..b28f9690c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -222,8 +222,12 @@ jobs: set-env: ${{ matrix.arch == 'x86' }} - name: Install dependencies run: | - vcpkg install --triplet ${{ matrix.arch }}-windows --recurse ` - fftw3 libsamplerate libsndfile lilv lv2 sdl2 + vcpkg install ` + --triplet=${{ matrix.arch }}-windows ` + --host-triplet=${{ matrix.arch }}-windows ` + --recurse ` + fftw3 fluidsynth[sndfile] libsamplerate libsndfile libstk lilv lv2 ` + portaudio sdl2 - name: Set up build environment uses: ilammy/msvc-dev-cmd@d8610e2b41c6d0f0c3b4c46dad8df0fd826c68e1 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 0453c169b..ad419e2cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,14 @@ ENDIF(COMMAND CMAKE_POLICY) # Import of windows.h breaks min()/max() ADD_DEFINITIONS(-DNOMINMAX) +# CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES is not set correctly for MinGW until +# CMake 3.14.1, so avoid specifying system include directories on affected +# versions. Normal include directories are safe, since GCC ignores them if they +# are already in the built-in search path. +if(MINGW AND CMAKE_VERSION VERSION_LESS "3.14.1") + set(CMAKE_NO_SYSTEM_FROM_IMPORTED TRUE) +endif() + INCLUDE(PluginList) INCLUDE(CheckSubmodules) INCLUDE(AddFileDependencies) @@ -110,6 +118,7 @@ IF(LMMS_BUILD_WIN32) SET(STATUS_ALSA "") SET(STATUS_PULSEAUDIO "") SET(STATUS_SOUNDIO "") + SET(STATUS_SNDIO "") SET(STATUS_WINMM "OK") SET(STATUS_APPLEMIDI "") ELSE(LMMS_BUILD_WIN32) @@ -297,17 +306,7 @@ ENDIF(WANT_CARLA) # check for SDL2 IF(WANT_SDL) - # Don't look for SDL2main - SET(SDL2_BUILDING_LIBRARY TRUE) - - # Search for SDL2 using config mode first, then fall back to module mode. - # This allows us to use SDL2's own CMake configuration files if available. - FIND_PACKAGE(SDL2 CONFIG QUIET) - IF(NOT TARGET SDL2::SDL2) - UNSET(SDL2_FOUND) - FIND_PACKAGE(SDL2 MODULE) - ENDIF() - + FIND_PACKAGE(SDL2) IF(SDL2_FOUND) SET(LMMS_HAVE_SDL TRUE) SET(LMMS_HAVE_SDL2 TRUE) @@ -358,13 +357,13 @@ ENDIF(WANT_STK) # check for PortAudio IF(WANT_PORTAUDIO) FIND_PACKAGE(Portaudio) - IF(PORTAUDIO_FOUND) + IF(Portaudio_FOUND) SET(LMMS_HAVE_PORTAUDIO TRUE) SET(STATUS_PORTAUDIO "OK") - ELSE(PORTAUDIO_FOUND) + ELSE() SET(STATUS_PORTAUDIO "not found, please install portaudio19-dev (or similar, version >= 1.9) " "if you require PortAudio support") - ENDIF(PORTAUDIO_FOUND) + ENDIF() ENDIF(WANT_PORTAUDIO) # check for libsoundio @@ -496,14 +495,14 @@ ENDIF() # check for Fluidsynth IF(WANT_SF2) - PKG_CHECK_MODULES(FLUIDSYNTH fluidsynth>=1.0.7) - IF(FLUIDSYNTH_FOUND) + find_package(FluidSynth 1.0.7) + if(FluidSynth_FOUND) SET(LMMS_HAVE_FLUIDSYNTH TRUE) SET(STATUS_FLUIDSYNTH "OK") - ELSE(FLUIDSYNTH_FOUND) + else() SET(STATUS_FLUIDSYNTH "not found, libfluidsynth-dev (or similar)" "is highly recommended") - ENDIF(FLUIDSYNTH_FOUND) + endif() ENDIF(WANT_SF2) # check for libgig diff --git a/cmake/modules/FindFluidSynth.cmake b/cmake/modules/FindFluidSynth.cmake new file mode 100644 index 000000000..fcc00cd7d --- /dev/null +++ b/cmake/modules/FindFluidSynth.cmake @@ -0,0 +1,73 @@ +# Copyright (c) 2022 Dominic Clark +# +# Redistribution and use is allowed according to the terms of the New BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +# Return if we already have FluidSynth +if(TARGET fluidsynth) + set(FluidSynth_FOUND 1) + return() +endif() + +# Attempt to find FluidSynth using PkgConfig +find_package(PkgConfig QUIET) +if(PKG_CONFIG_FOUND) + pkg_check_modules(FLUIDSYNTH_PKG fluidsynth) +endif() + +# Find the library and headers using the results from PkgConfig as a guide +find_path(FluidSynth_INCLUDE_DIR + NAMES "fluidsynth.h" + HINTS ${FLUIDSYNTH_PKG_INCLUDE_DIRS} +) + +find_library(FluidSynth_LIBRARY + NAMES "fluidsynth" + HINTS ${FLUIDSYNTH_PKG_LIBRARY_DIRS} +) + +if(FluidSynth_INCLUDE_DIR AND FluidSynth_LIBRARY) + add_library(fluidsynth UNKNOWN IMPORTED) + set_target_properties(fluidsynth PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${FluidSynth_INCLUDE_DIR}" + ) + + if(VCPKG_INSTALLED_DIR) + include(ImportedTargetHelpers) + _get_vcpkg_library_configs(FluidSynth_IMPLIB_RELEASE FluidSynth_IMPLIB_DEBUG "${FluidSynth_LIBRARY}") + else() + set(FluidSynth_IMPLIB_RELEASE "${FluidSynth_LIBRARY}") + endif() + + if(FluidSynth_IMPLIB_DEBUG) + set_target_properties(fluidsynth PROPERTIES + IMPORTED_LOCATION_RELEASE "${FluidSynth_IMPLIB_RELEASE}" + IMPORTED_LOCATION_DEBUG "${FluidSynth_IMPLIB_DEBUG}" + ) + else() + set_target_properties(fluidsynth PROPERTIES + IMPORTED_LOCATION "${FluidSynth_IMPLIB_RELEASE}" + ) + endif() + + if(EXISTS "${FluidSynth_INCLUDE_DIR}/fluidsynth/version.h") + file(STRINGS + "${FluidSynth_INCLUDE_DIR}/fluidsynth/version.h" + _version_string + REGEX "^#[\t ]*define[\t ]+FLUIDSYNTH_VERSION[\t ]+\".*\"" + ) + string(REGEX REPLACE + "^.*FLUIDSYNTH_VERSION[\t ]+\"([^\"]*)\".*$" + "\\1" + FluidSynth_VERSION_STRING + "${_version_string}" + ) + unset(_version_string) + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FluidSynth + REQUIRED_VARS FluidSynth_LIBRARY FluidSynth_INCLUDE_DIR + VERSION_VAR FluidSynth_VERSION_STRING +) diff --git a/cmake/modules/FindLame.cmake b/cmake/modules/FindLame.cmake index e5dc93bd5..c3fb09c5b 100644 --- a/cmake/modules/FindLame.cmake +++ b/cmake/modules/FindLame.cmake @@ -1,16 +1,37 @@ # - Try to find LAME # Once done this will define # -# LAME_FOUND - system has liblame -# LAME_INCLUDE_DIRS - the liblame include directory -# LAME_LIBRARIES - The liblame libraries +# Lame_FOUND - system has liblame +# Lame_INCLUDE_DIRS - the liblame include directory +# Lame_LIBRARIES - The liblame libraries +# mp3lame::mp3lame - an imported target providing lame -find_path(LAME_INCLUDE_DIRS lame/lame.h) -find_library(LAME_LIBRARIES mp3lame) +find_package(mp3lame CONFIG QUIET) + +if(TARGET mp3lame::mp3lame) + # Extract details for find_package_handle_standard_args + get_target_property(Lame_LIBRARIES mp3lame::mp3lame LOCATION) + get_target_property(Lame_INCLUDE_DIRS mp3lame::mp3lame INTERFACE_INCLUDE_DIRECTORIES) +else() + find_path(Lame_INCLUDE_DIRS lame/lame.h) + find_library(Lame_LIBRARIES mp3lame) + + list(APPEND Lame_DEFINITIONS HAVE_LIBMP3LAME=1) + + mark_as_advanced(Lame_INCLUDE_DIRS Lame_LIBRARIES Lame_DEFINITIONS) + + if(Lame_LIBRARIES AND Lame_INCLUDE_DIRS) + add_library(mp3lame::mp3lame UNKNOWN IMPORTED) + + set_target_properties(mp3lame::mp3lame PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${Lame_INCLUDE_DIRS}" + INTERFACE_COMPILE_DEFINITIONS "${Lame_DEFINITIONS}" + IMPORTED_LOCATION "${Lame_LIBRARIES}" + ) + endif() +endif() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Lame DEFAULT_MSG LAME_INCLUDE_DIRS LAME_LIBRARIES) - -list(APPEND LAME_DEFINITIONS -DHAVE_LIBMP3LAME=1) - -mark_as_advanced(LAME_INCLUDE_DIRS LAME_LIBRARIES LAME_DEFINITIONS) +find_package_handle_standard_args(Lame + REQUIRED_VARS Lame_LIBRARIES Lame_INCLUDE_DIRS +) diff --git a/cmake/modules/FindPortaudio.cmake b/cmake/modules/FindPortaudio.cmake index bb6bdf48b..f9c7699f4 100644 --- a/cmake/modules/FindPortaudio.cmake +++ b/cmake/modules/FindPortaudio.cmake @@ -1,36 +1,44 @@ -# - Try to find Portaudio -# Once done this will define -# -# PORTAUDIO_FOUND - system has Portaudio -# PORTAUDIO_INCLUDE_DIRS - the Portaudio include directory -# PORTAUDIO_LIBRARIES - Link these to use Portaudio -# PORTAUDIO_DEFINITIONS - Compiler switches required for using Portaudio -# -# Copyright (c) 2006 Andreas Schneider +# Copyright (c) 2022 Dominic Clark # # Redistribution and use is allowed according to the terms of the New BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# +# Try config mode if possible +find_package(portaudio CONFIG QUIET) -if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS) - # in cache already - set(PORTAUDIO_FOUND TRUE) -else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS) - include(FindPkgConfig) - pkg_check_modules(PORTAUDIO portaudio-2.0) - if (PORTAUDIO_FOUND) - if (NOT Portaudio_FIND_QUIETLY) - message(STATUS "Found Portaudio: ${PORTAUDIO_LIBRARIES}") - endif (NOT Portaudio_FIND_QUIETLY) - else (PORTAUDIO_FOUND) - if (Portaudio_FIND_REQUIRED) - message(FATAL_ERROR "Could not find Portaudio") - endif (Portaudio_FIND_REQUIRED) - endif (PORTAUDIO_FOUND) +if(TARGET portaudio) + # Extract details for find_package_handle_standard_args + get_target_property(Portaudio_LIBRARY portaudio LOCATION) + get_target_property(Portaudio_INCLUDE_DIR portaudio INTERFACE_INCLUDE_DIRECTORIES) +else() + # Attempt to find PortAudio using PkgConfig, if we have it + find_package(PkgConfig QUIET) + if(PKG_CONFIG_FOUND) + pkg_check_modules(PORTAUDIO_PKG portaudio-2.0) + endif() - # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view - mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES) + # Find the library and headers using the results from PkgConfig as a guide + find_library(Portaudio_LIBRARY + NAMES "portaudio" + HINTS ${PORTAUDIO_PKG_LIBRARY_DIRS} + ) -endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS) + find_path(Portaudio_INCLUDE_DIR + NAMES "portaudio.h" + HINTS ${PORTAUDIO_PKG_INCLUDE_DIRS} + ) + # Create an imported target for PortAudio if we succeeded in finding it. + if(Portaudio_LIBRARY AND Portaudio_INCLUDE_DIR) + add_library(portaudio UNKNOWN IMPORTED) + set_target_properties(portaudio PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${Portaudio_INCLUDE_DIR}" + IMPORTED_LOCATION "${Portaudio_LIBRARY}" + ) + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Portaudio + REQUIRED_VARS Portaudio_LIBRARY Portaudio_INCLUDE_DIR +) diff --git a/cmake/modules/FindSDL2.cmake b/cmake/modules/FindSDL2.cmake index 513578813..3bad1002e 100644 --- a/cmake/modules/FindSDL2.cmake +++ b/cmake/modules/FindSDL2.cmake @@ -1,60 +1,20 @@ # This module defines # SDL2::SDL2, a target providing SDL2 itself -# SDL2::SDL2main, a target providing an entry point for applications # SDL2_LIBRARY, the name of the library to link against # SDL2_FOUND, if false, do not try to link to SDL2 # SDL2_INCLUDE_DIR, where to find SDL.h # -# This module responds to the the flag: -# SDL2_BUILDING_LIBRARY -# If this is defined, then no SDL2::SDL2main target will be created because -# only applications need main(). -# Otherwise, it is assumed you are building an application and this -# module will attempt to locate and set the the proper link flags -# as part of the SDL2::SDL2main target. -# -# Don't forget to include SDLmain.h and SDLmain.m your project for the -# OS X framework based version. (Other versions link to -lSDL2main which -# this module will try to find on your behalf.) Also for OS X, this -# module will automatically add the -framework Cocoa on your behalf. -# -# -# Additional Note: If you see an empty SDL2_LIBRARY in your configuration, it -# means CMake did not find your SDL2 library (SDL2.dll, libsdl2.so, -# SDL2.framework, etc). -# Set SDL2_LIBRARY to point to your SDL2 library, and configure again. -# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value -# as appropriate. -# -# -# Modified by Dominic Clark. -# Added modern CMake targets to match those SDL2 itself uses. -# -# $SDL2DIR is an environment variable that would -# correspond to the ./configure --prefix=$SDL2DIR -# used in building SDL2. -# l.e.galup 9-20-02 -# -# Modified by Eric Wing. -# Added code to assist with automated building by using environmental variables -# and providing a more controlled/consistent search behavior. -# Added new modifications to recognize OS X frameworks and -# additional Unix paths (FreeBSD, etc). -# Also corrected the header search path to follow "proper" SDL guidelines. -# Added a search for SDL2main which is needed by some platforms. -# Added a search for threads which is needed by some platforms. -# Added needed compile switches for MinGW. -# # On OSX, this will prefer the Framework version (if found) over others. # People will have to manually change the cache values of # SDL2_LIBRARY to override this selection or set the CMake environment # CMAKE_INCLUDE_PATH to modify the search paths. # -# Note that the header path has changed from SDL2/SDL.h to just SDL.h -# This needed to change because "proper" SDL convention -# is #include "SDL.h", not . This is done for portability -# reasons because not all systems place things in SDL2/ (see FreeBSD). - +# $SDL2DIR is an environment variable that would +# correspond to the ./configure --prefix=$SDL2DIR +# used in building SDL2. +# +# Modified by Eric Wing, l.e.galup, and Dominic Clark +# #============================================================================= # Copyright 2003-2009 Kitware, Inc. # @@ -68,110 +28,91 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -# message("") +# Try config mode first - anything SDL2 itself provides is likely to be more +# reliable than our guesses. +find_package(SDL2 CONFIG QUIET) -SET(SDL2_SEARCH_PATHS - ~/Library/Frameworks - /Library/Frameworks - /usr/local - /usr - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave - /opt - ${SDL2_PATH} -) - -FIND_PATH(SDL2_INCLUDE_DIR SDL.h - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES SDL2 include/SDL2 include - PATHS ${SDL2_SEARCH_PATHS} -) - -if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(PATH_SUFFIXES lib64 lib/x64 lib) -else() - set(PATH_SUFFIXES lib/x86 lib) -endif() - -FIND_LIBRARY(SDL2_LIBRARY - NAMES SDL2 - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES ${PATH_SUFFIXES} - PATHS ${SDL2_SEARCH_PATHS} -) - -IF(NOT SDL2_BUILDING_LIBRARY) - IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework") - # Non-OS X framework versions expect you to also dynamically link to - # SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms - # seem to provide SDL2main for compatibility even though they don't - # necessarily need it. - FIND_LIBRARY(SDL2MAIN_LIBRARY - NAMES SDL2main - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES ${PATH_SUFFIXES} - PATHS ${SDL2_SEARCH_PATHS} - ) - ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework") -ENDIF(NOT SDL2_BUILDING_LIBRARY) - -# SDL2 may require threads on your system. -# The Apple build may not need an explicit flag because one of the -# frameworks may already provide it. -# But for non-OSX systems, I will use the CMake Threads package. -IF(NOT APPLE) - FIND_PACKAGE(Threads) -ENDIF(NOT APPLE) - -# MinGW needs an additional link flag, -mwindows -# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -mwindows -IF(MINGW) - SET(MINGW32_LIBRARY mingw32 "-mwindows" CACHE STRING "mwindows for MinGW") -ENDIF(MINGW) - -IF(SDL2_LIBRARY) - ADD_LIBRARY(SDL2::SDL2 UNKNOWN IMPORTED) - SET_TARGET_PROPERTIES(SDL2::SDL2 PROPERTIES - IMPORTED_LOCATION "${SDL2_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" +if(TARGET SDL2::SDL2) + # Extract details for find_package_handle_standard_args + get_target_property(SDL2_LIBRARY SDL2::SDL2 LOCATION) + get_target_property(SDL2_INCLUDE_DIR SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES) +else() + set(SDL2_SEARCH_PATHS + ~/Library/Frameworks + /Library/Frameworks + /usr/local + /usr + /sw # Fink + /opt/local # DarwinPorts + /opt/csw # Blastwave + /opt + ${SDL2_PATH} ) - # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa. - IF(APPLE) - SET_PROPERTY(TARGET SDL2::SDL2 APPEND PROPERTY - INTERFACE_LINK_OPTIONS "-framework Cocoa" - ) - ENDIF(APPLE) - - # For threads, as mentioned Apple doesn't need this. - # In fact, there seems to be a problem if I used the Threads package - # and try using this line, so I'm just skipping it entirely for OS X. - IF(NOT APPLE AND Threads_FOUND) - SET_PROPERTY(TARGET SDL2::SDL2 APPEND PROPERTY - INTERFACE_LINK_LIBRARIES "Threads::Threads" - ) - ENDIF(NOT APPLE AND Threads_FOUND) -ENDIF(SDL2_LIBRARY) - -IF(NOT SDL2_BUILDING_LIBRARY AND SDL2MAIN_LIBRARY) - ADD_LIBRARY(SDL2::SDL2main STATIC IMPORTED) - SET_TARGET_PROPERTIES(SDL2::SDL2main PROPERTIES - IMPORTED_LOCATION "${SDL2MAIN_LIBRARY}" - INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" + find_path(SDL2_INCLUDE_DIR + NAMES SDL.h + HINTS $ENV{SDL2DIR} ${SDL2_INCLUDE_DIRS} + PATH_SUFFIXES SDL2 include/SDL2 include + PATHS ${SDL2_SEARCH_PATHS} ) - IF(MINGW) - SET_PROPERTY(TARGET SDL2::SDL2main APPEND PROPERTY - INTERFACE_LINK_OPTIONS "${MINGW32_LIBRARY}" + + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(PATH_SUFFIXES lib64 lib/x64 lib) + else() + set(PATH_SUFFIXES lib/x86 lib) + endif() + + find_library(SDL2_LIBRARY + NAMES SDL2 + HINTS $ENV{SDL2DIR} ${SDL2_LIBDIR} + PATH_SUFFIXES ${PATH_SUFFIXES} + PATHS ${SDL2_SEARCH_PATHS} + ) + + # SDL2 may require threads on your system. + # The Apple build may not need an explicit flag because one of the + # frameworks may already provide it. + # But for non-OSX systems, I will use the CMake Threads package. + if(NOT APPLE) + find_package(Threads) + endif() + + if(SDL2_LIBRARY AND SDL2_INCLUDE_DIR) + add_library(SDL2::SDL2 UNKNOWN IMPORTED) + set_target_properties(SDL2::SDL2 PROPERTIES + IMPORTED_LOCATION "${SDL2_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}" ) - ENDIF(MINGW) -ENDIF(NOT SDL2_BUILDING_LIBRARY AND SDL2MAIN_LIBRARY) -# message("") + # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa. + if(APPLE) + set_property(TARGET SDL2::SDL2 APPEND PROPERTY + INTERFACE_LINK_OPTIONS "-framework Cocoa" + ) + endif() -INCLUDE(FindPackageHandleStandardArgs) + # For threads, as mentioned Apple doesn't need this. + # In fact, there seems to be a problem if I used the Threads package + # and try using this line, so I'm just skipping it entirely for OS X. + if(NOT APPLE AND Threads_FOUND) + set_property(TARGET SDL2::SDL2 APPEND PROPERTY + INTERFACE_LINK_LIBRARIES "Threads::Threads" + ) + endif() -FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR) + if(EXISTS "${SDL2_INCLUDE_DIR}/SDL_version.h") + file(READ "${SDL2_INCLUDE_DIR}/SDL_version.h" _sdl_version_h) + string(REGEX REPLACE ".*#[\t ]*define[\t ]+SDL_MAJOR_VERSION[\t ]+([0-9]+).*" "\\1" SDL2_VERSION_MAJOR "${_sdl_version_h}") + string(REGEX REPLACE ".*#[\t ]*define[\t ]+SDL_MINOR_VERSION[\t ]+([0-9]+).*" "\\1" SDL2_VERSION_MINOR "${_sdl_version_h}") + string(REGEX REPLACE ".*#[\t ]*define[\t ]+SDL_PATCHLEVEL[\t ]+([0-9]+).*" "\\1" SDL2_VERSION_PATCH "${_sdl_version_h}") + set(SDL2_VERSION "${SDL2_VERSION_MAJOR}.${SDL2_VERSION_MINOR}.${SDL2_VERSION_PATCH}") + unset(_sdl_version_h) + endif() + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SDL2 + REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR + VERSION_VAR SDL2_VERSION +) diff --git a/cmake/modules/FindSTK.cmake b/cmake/modules/FindSTK.cmake index 6c2f16de4..80ed0da42 100644 --- a/cmake/modules/FindSTK.cmake +++ b/cmake/modules/FindSTK.cmake @@ -1,20 +1,32 @@ -FIND_PATH(STK_INCLUDE_DIR Stk.h /usr/include/stk /usr/local/include/stk ${CMAKE_INSTALL_PREFIX}/include/stk ${CMAKE_FIND_ROOT_PATH}/include/stk) +# Try config mode first +find_package(unofficial-libstk CONFIG QUIET) -FIND_LIBRARY(STK_LIBRARY NAMES stk PATH /usr/lib /usr/local/lib ${CMAKE_INSTALL_PREFIX}/lib ${CMAKE_FIND_ROOT_PATH}/lib) +if(TARGET unofficial::libstk::libstk) + # Extract details for find_package_handle_standard_args + get_target_property(STK_LIBRARY unofficial::libstk::libstk LOCATION) + get_target_property(STK_INCLUDE_DIR unofficial::libstk::libstk INTERFACE_INCLUDE_DIRECTORIES) +else() + find_path(STK_INCLUDE_DIR + NAMES stk/Stk.h + PATH /usr/include /usr/local/include "${CMAKE_INSTALL_PREFIX}/include" "${CMAKE_FIND_ROOT_PATH}/include" + ) -IF (STK_INCLUDE_DIR AND STK_LIBRARY) - SET(STK_FOUND TRUE) -ENDIF (STK_INCLUDE_DIR AND STK_LIBRARY) + find_library(STK_LIBRARY + NAMES stk + PATH /usr/lib /usr/local/lib "${CMAKE_INSTALL_PREFIX}/lib" "${CMAKE_FIND_ROOT_PATH}/lib" + ) + if(STK_INCLUDE_DIR AND STK_LIBRARY) + # Yes, this target name is hideous, but it matches that provided by vcpkg + add_library(unofficial::libstk::libstk UNKNOWN IMPORTED) + set_target_properties(unofficial::libstk::libstk PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${STK_INCLUDE_DIR}" + IMPORTED_LOCATION "${STK_LIBRARY}" + ) + endif() +endif() -IF (STK_FOUND) - IF (NOT STK_FIND_QUIETLY) - MESSAGE(STATUS "Found STK: ${STK_LIBRARY}") - SET(HAVE_STK TRUE) - ENDIF (NOT STK_FIND_QUIETLY) -ELSE (STK_FOUND) - IF (STK_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Could not find STK") - ENDIF (STK_FIND_REQUIRED) -ENDIF (STK_FOUND) - +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(STK + REQUIRED_VARS STK_LIBRARY STK_INCLUDE_DIR +) diff --git a/cmake/modules/ImportedTargetHelpers.cmake b/cmake/modules/ImportedTargetHelpers.cmake new file mode 100644 index 000000000..87b3aeedc --- /dev/null +++ b/cmake/modules/ImportedTargetHelpers.cmake @@ -0,0 +1,57 @@ +# Given a library in vcpkg, find appropriate debug and release versions. If only +# one version exists, it is used as the release version, and the debug version +# is not set. +function(_get_vcpkg_library_configs _release_out _debug_out _library) + # We want to do all operations within the vcpkg directory + file(RELATIVE_PATH _lib_relative "${VCPKG_INSTALLED_DIR}" "${_library}") + + # Return early if we're not using vcpkg + if(IS_ABSOLUTE _lib_relative OR _lib_relative MATCHES "^\\.\\./") + set("${_release_out}" "${_library}" PARENT_SCOPE) + return() + endif() + + string(REPLACE "/" ";" _path_bits "${_lib_relative}") + + # Determine whether we were given the debug or release version + list(FIND _path_bits "debug" _debug_index) + if(_debug_index EQUAL -1) + # We have the release version, so use it + set(_release_lib "${_library}") + + # Try to find a debug version too + list(FIND _path_bits "lib" _lib_index) + if(_lib_index GREATER_EQUAL 0) + list(INSERT _path_bits "${_lib_index}" "debug") + list(INSERT _path_bits 0 "${VCPKG_INSTALLED_DIR}") + string(REPLACE ";" "/" _debug_lib "${_path_bits}") + + if(NOT EXISTS "${_debug_lib}") + # Debug version does not exist - only use given version + unset(_debug_lib) + endif() + endif() + else() + # We have the debug version, so try to find a release version too + list(REMOVE_AT _path_bits "${_debug_index}") + list(INSERT _path_bits 0 "${VCPKG_INSTALLED_DIR}") + string(REPLACE ";" "/" _release_lib "${_path_bits}") + + if(NOT EXISTS "${_release_lib}") + # Release version does not exist - only use given version + set(_release_lib "${_library}") + else() + # Release version exists, so use given version as debug + set(_debug_lib "${_library}") + endif() + endif() + + # Set output variables appropriately + if(_debug_lib) + set("${_release_out}" "${_release_lib}" PARENT_SCOPE) + set("${_debug_out}" "${_debug_lib}" PARENT_SCOPE) + else() + set("${_release_out}" "${_release_lib}" PARENT_SCOPE) + unset("${_debug_out}" PARENT_SCOPE) + endif() +endfunction() diff --git a/plugins/Sf2Player/CMakeLists.txt b/plugins/Sf2Player/CMakeLists.txt index be21c0cf2..4679a94bd 100644 --- a/plugins/Sf2Player/CMakeLists.txt +++ b/plugins/Sf2Player/CMakeLists.txt @@ -1,8 +1,13 @@ if(LMMS_HAVE_FLUIDSYNTH) - INCLUDE(BuildPlugin) - INCLUDE_DIRECTORIES(${FLUIDSYNTH_INCLUDE_DIRS} ${SAMPLERATE_INCLUDE_DIRS}) - LINK_DIRECTORIES(${FLUIDSYNTH_LIBRARY_DIRS} ${SAMPLERATE_LIBRARY_DIRS}) - LINK_LIBRARIES(${FLUIDSYNTH_LIBRARIES} ${SAMPLERATE_LIBRARIES}) - BUILD_PLUGIN(sf2player Sf2Player.cpp Sf2Player.h PatchesDialog.cpp PatchesDialog.h PatchesDialog.ui MOCFILES Sf2Player.h PatchesDialog.h UICFILES PatchesDialog.ui EMBEDDED_RESOURCES *.png) -endif(LMMS_HAVE_FLUIDSYNTH) - + include(BuildPlugin) + include_directories(${SAMPLERATE_INCLUDE_DIRS}) + link_directories(${SAMPLERATE_LIBRARY_DIRS}) + link_libraries(${SAMPLERATE_LIBRARIES}) + build_plugin(sf2player + Sf2Player.cpp Sf2Player.h PatchesDialog.cpp PatchesDialog.h PatchesDialog.ui + MOCFILES Sf2Player.h PatchesDialog.h + UICFILES PatchesDialog.ui + EMBEDDED_RESOURCES *.png + ) + target_link_libraries(sf2player fluidsynth) +endif() diff --git a/plugins/Sf2Player/Sf2Player.cpp b/plugins/Sf2Player/Sf2Player.cpp index 152aeb583..cd147abda 100644 --- a/plugins/Sf2Player/Sf2Player.cpp +++ b/plugins/Sf2Player/Sf2Player.cpp @@ -282,7 +282,7 @@ void Sf2Instrument::loadFile( const QString & _file ) fluid_preset_t preset; fluid_preset_t *pCurPreset = &preset; #else - fluid_preset_t *pCurPreset; + fluid_preset_t *pCurPreset = nullptr; #endif if ( ( pCurPreset = fluid_sfont_iteration_next_wrapper( pSoundFont, pCurPreset ) ) ) { @@ -475,7 +475,7 @@ QString Sf2Instrument::getCurrentPatchName() fluid_preset_t preset; fluid_preset_t *pCurPreset = &preset; #else - fluid_preset_t *pCurPreset; + fluid_preset_t *pCurPreset = nullptr; #endif while ((pCurPreset = fluid_sfont_iteration_next_wrapper(pSoundFont, pCurPreset))) { @@ -676,8 +676,13 @@ void Sf2Instrument::noteOn( Sf2PluginData * n ) // get list of current voice IDs so we can easily spot the new // voice after the fluid_synth_noteon() call const int poly = fluid_synth_get_polyphony( m_synth ); - fluid_voice_t * voices[poly]; +#ifndef _MSC_VER + fluid_voice_t* voices[poly]; unsigned int id[poly]; +#else + const auto voices = static_cast(_alloca(poly * sizeof(fluid_voice_t*))); + const auto id = static_cast(_alloca(poly * sizeof(unsigned int))); +#endif fluid_synth_get_voicelist( m_synth, voices, poly, -1 ); for( int i = 0; i < poly; ++i ) { diff --git a/plugins/Stk/Mallets/CMakeLists.txt b/plugins/Stk/Mallets/CMakeLists.txt index a2b5ddf1d..77b7afff2 100644 --- a/plugins/Stk/Mallets/CMakeLists.txt +++ b/plugins/Stk/Mallets/CMakeLists.txt @@ -1,5 +1,7 @@ -INCLUDE(BuildPlugin) -INCLUDE_DIRECTORIES("${STK_INCLUDE_DIR}") -LINK_LIBRARIES(${STK_LIBRARY}) -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions") -BUILD_PLUGIN(malletsstk Mallets.cpp Mallets.h MOCFILES Mallets.h EMBEDDED_RESOURCES artwork.png logo.png) +include(BuildPlugin) +build_plugin(malletsstk + Mallets.cpp Mallets.h + MOCFILES Mallets.h + EMBEDDED_RESOURCES artwork.png logo.png +) +target_link_libraries(malletsstk unofficial::libstk::libstk) diff --git a/plugins/Stk/Mallets/Mallets.cpp b/plugins/Stk/Mallets/Mallets.cpp index 0de1a8550..8aa71d62e 100644 --- a/plugins/Stk/Mallets/Mallets.cpp +++ b/plugins/Stk/Mallets/Mallets.cpp @@ -30,9 +30,9 @@ #include #include -#include "BandedWG.h" -#include "ModalBar.h" -#include "TubeBell.h" +#include +#include +#include #include "AudioEngine.h" #include "ConfigManager.h" diff --git a/plugins/Stk/Mallets/Mallets.h b/plugins/Stk/Mallets/Mallets.h index 4d5aed288..f66ac25d0 100644 --- a/plugins/Stk/Mallets/Mallets.h +++ b/plugins/Stk/Mallets/Mallets.h @@ -27,7 +27,7 @@ #ifndef _MALLET_H #define _MALLET_H -#include "Instrmnt.h" +#include #include "ComboBox.h" #include "Instrument.h" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7f8a0dfcb..bd543779f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -55,7 +55,7 @@ ADD_GEN_QRC(LMMS_RCC_OUT lmms.qrc # Paths relative to lmms executable FILE(RELATIVE_PATH LIB_DIR_RELATIVE "/${BIN_DIR}" "/${LIB_DIR}") FILE(RELATIVE_PATH PLUGIN_DIR_RELATIVE "/${BIN_DIR}" "/${PLUGIN_DIR}") -ADD_DEFINITIONS(-DLIB_DIR="${LIB_DIR_RELATIVE}" -DPLUGIN_DIR="${PLUGIN_DIR_RELATIVE}" ${PULSEAUDIO_DEFINITIONS} ${PORTAUDIO_DEFINITIONS}) +ADD_DEFINITIONS(-DLIB_DIR="${LIB_DIR_RELATIVE}" -DPLUGIN_DIR="${PLUGIN_DIR_RELATIVE}" ${PULSEAUDIO_DEFINITIONS}) INCLUDE_DIRECTORIES( ${JACK_INCLUDE_DIRS} ${SAMPLERATE_INCLUDE_DIRS} @@ -75,10 +75,6 @@ IF(LMMS_HAVE_WEAKJACK) ADD_DEFINITIONS(-DUSE_WEAK_JACK=1 -DNO_JACK_METADATA=1) ENDIF() -IF(NOT ("${PORTAUDIO_INCLUDE_DIR}" STREQUAL "")) - INCLUDE_DIRECTORIES("${PORTAUDIO_INCLUDE_DIR}") -ENDIF() - IF(NOT ("${PULSEAUDIO_INCLUDE_DIR}" STREQUAL "")) INCLUDE_DIRECTORIES("${PULSEAUDIO_INCLUDE_DIR}") ENDIF() @@ -87,10 +83,6 @@ IF(NOT ("${OGGVORBIS_INCLUDE_DIR}" STREQUAL "")) INCLUDE_DIRECTORIES("${OGGVORBIS_INCLUDE_DIR}") ENDIF() -IF(NOT ("${LAME_INCLUDE_DIRS}" STREQUAL "")) - INCLUDE_DIRECTORIES("${LAME_INCLUDE_DIRS}") -ENDIF() - IF(NOT ("${LV2_INCLUDE_DIRS}" STREQUAL "")) INCLUDE_DIRECTORIES(${LV2_INCLUDE_DIRS}) ENDIF() @@ -170,19 +162,25 @@ if(LMMS_HAVE_LIBRT) list(APPEND EXTRA_LIBRARIES "rt") endif() +if(LMMS_HAVE_PORTAUDIO) + list(APPEND EXTRA_LIBRARIES portaudio) +endif() + +if(LMMS_HAVE_MP3LAME) + list(APPEND EXTRA_LIBRARIES mp3lame::mp3lame) +endif() + SET(LMMS_REQUIRED_LIBS ${LMMS_REQUIRED_LIBS} ${CMAKE_THREAD_LIBS_INIT} ${QT_LIBRARIES} ${ASOUND_LIBRARY} ${SDL_LIBRARY} ${SDL2_LIBRARY} - ${PORTAUDIO_LIBRARIES} ${SOUNDIO_LIBRARY} ${SNDIO_LIBRARIES} ${PULSEAUDIO_LIBRARIES} ${JACK_LIBRARIES} ${OGGVORBIS_LIBRARIES} - ${LAME_LIBRARIES} ${LV2_LIBRARIES} ${SUIL_LIBRARIES} ${LILV_LIBRARIES} From e407e73e241c1e1eb1375387986578fa1c287168 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 19 Sep 2022 17:45:44 +0200 Subject: [PATCH 31/55] check-namespace: don't require comment after #else (#6513) --- tests/scripted/check-namespace | 4 +++- tests/scripted/verify | 11 +++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/scripted/check-namespace b/tests/scripted/check-namespace index 8c1b405ad..5f71505b2 100755 --- a/tests/scripted/check-namespace +++ b/tests/scripted/check-namespace @@ -164,8 +164,10 @@ for cur_file in files: if not expectations: error(cur_file, m, f'Unexpected {statement}') break - # Don't pop the expectation for an #else tag, we are still waiting for the #endif if statement.startswith('#el') and expectations[-1].statement == '#endif': + # After an #else or #elif the comment is no longer mandatory, since it's hard to define + expectations[-1] = Expectation(IF_MACRO, '#endif', '') + # Don't pop the expectations, we are still waiting for the #endif continue exp = expectations.pop() name = m.group('macro_name') or m.group('namespace_end') or '' diff --git a/tests/scripted/verify b/tests/scripted/verify index 20a26a303..4072aaf9f 100755 --- a/tests/scripted/verify +++ b/tests/scripted/verify @@ -232,6 +232,17 @@ with tempfile.TemporaryDirectory() as tmpdir: } // namespace smml #endif // ABC_H ''') + create_file('09_NoEndifAfterElseIsOk.cpp', ''' + #ifdef XYZ + namespace lmms { + \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n + } + #else + namespace lmms { + \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n + } + #endif + ''') test.run() test.expect('8 errors') test.expect(''' From 2f7a6558a120ecdd97faec2bfa8bccc2d684c8d4 Mon Sep 17 00:00:00 2001 From: saker Date: Tue, 27 Sep 2022 04:27:35 -0400 Subject: [PATCH 32/55] clang-tidy: Apply modernize-loop-convert everywhere (#6481) Co-authored-by: allejok96 Co-authored-by: Dominic Clark --- include/Piano.h | 2 +- plugins/GigPlayer/GigPlayer.cpp | 45 ++++------ plugins/LadspaBrowser/LadspaDescription.cpp | 14 ++-- plugins/LadspaEffect/LadspaControlDialog.cpp | 18 ++-- plugins/LadspaEffect/LadspaControls.cpp | 40 ++++----- plugins/Lb302/Lb302.cpp | 5 +- plugins/Lv2Instrument/Lv2Instrument.cpp | 3 - plugins/Lv2Instrument/Lv2Instrument.h | 2 +- plugins/MidiExport/MidiExport.cpp | 32 +++---- plugins/MidiImport/MidiImport.cpp | 4 +- plugins/Patman/Patman.cpp | 6 +- plugins/Sf2Player/Sf2Player.cpp | 5 -- plugins/Sf2Player/Sf2Player.h | 2 +- plugins/Sfxr/Sfxr.cpp | 17 ++-- plugins/Sfxr/Sfxr.h | 2 +- plugins/Sid/SidInstrument.cpp | 30 +++---- plugins/TripleOscillator/TripleOscillator.cpp | 6 +- plugins/VstBase/VstPlugin.cpp | 9 +- plugins/Xpressive/ExprSynth.cpp | 8 +- plugins/ZynAddSubFx/LocalZynAddSubFx.cpp | 17 ++-- plugins/ZynAddSubFx/LocalZynAddSubFx.h | 2 +- src/common/RemotePluginBase.cpp | 6 +- src/core/AudioEngine.cpp | 4 +- src/core/AutomatableModel.cpp | 35 ++++---- src/core/AutomationClip.cpp | 84 ++++++++----------- src/core/ConfigManager.cpp | 21 ++--- src/core/DataFile.cpp | 4 +- src/core/Effect.cpp | 18 ++-- src/core/EffectChain.cpp | 13 ++- src/core/EnvelopeAndLfoParameters.cpp | 14 ++-- src/core/InstrumentFunctions.cpp | 6 +- src/core/Keymap.cpp | 4 +- src/core/Ladspa2LMMS.cpp | 5 +- src/core/LadspaManager.cpp | 19 ++--- src/core/Mixer.cpp | 38 ++++----- src/core/NotePlayHandle.cpp | 16 ++-- src/core/Piano.cpp | 5 -- src/core/RenderManager.cpp | 6 +- src/core/Song.cpp | 23 +++-- src/core/Track.cpp | 60 ++++++------- src/core/TrackContainer.cpp | 13 ++- src/core/audio/AudioSampleRecorder.cpp | 5 +- src/core/lv2/Lv2ControlBase.cpp | 11 +-- src/core/lv2/Lv2Features.cpp | 4 +- src/core/midi/MidiClient.cpp | 4 +- src/core/midi/MidiPort.cpp | 8 +- src/gui/EffectRackView.cpp | 18 ++-- src/gui/FileBrowser.cpp | 11 +-- src/gui/LmmsStyle.cpp | 7 +- src/gui/MicrotunerConfig.cpp | 4 +- src/gui/MixerView.cpp | 18 ++-- src/gui/clips/AutomationClipView.cpp | 11 +-- src/gui/clips/ClipView.cpp | 17 ++-- src/gui/editors/PatternEditor.cpp | 14 ++-- src/gui/editors/PianoRoll.cpp | 13 +-- src/gui/editors/Rubberband.cpp | 5 +- src/gui/editors/SongEditor.cpp | 5 +- src/gui/editors/TrackContainerView.cpp | 27 +++--- src/gui/tracks/TrackContentWidget.cpp | 52 +++++------- src/gui/tracks/TrackView.cpp | 4 +- src/gui/widgets/AutomatableButton.cpp | 5 +- src/gui/widgets/LcdWidget.cpp | 7 +- src/gui/widgets/TabWidget.cpp | 19 ++--- src/tracks/InstrumentTrack.cpp | 18 ++-- src/tracks/MidiClip.cpp | 68 ++++++--------- src/tracks/PatternTrack.cpp | 17 ++-- src/tracks/SampleTrack.cpp | 4 +- 67 files changed, 441 insertions(+), 598 deletions(-) diff --git a/include/Piano.h b/include/Piano.h index b9f5e9797..01a20046d 100644 --- a/include/Piano.h +++ b/include/Piano.h @@ -82,7 +82,7 @@ private: InstrumentTrack* m_instrumentTrack; MidiEventProcessor* m_midiEvProc; - bool m_pressedKeys[NumKeys]; + std::array m_pressedKeys = {}; } ; diff --git a/plugins/GigPlayer/GigPlayer.cpp b/plugins/GigPlayer/GigPlayer.cpp index 6940be9e6..24073ceea 100644 --- a/plugins/GigPlayer/GigPlayer.cpp +++ b/plugins/GigPlayer/GigPlayer.cpp @@ -355,10 +355,9 @@ void GigInstrument::play( sampleFrame * _working_buffer ) it->state = PlayingKeyUp; // Notify each sample that the key has been released - for( QList::iterator sample = it->samples.begin(); - sample != it->samples.end(); ++sample ) + for (auto& sample : it->samples) { - sample->adsr.keyup(); + sample.adsr.keyup(); } // Add release samples if available @@ -408,22 +407,17 @@ void GigInstrument::play( sampleFrame * _working_buffer ) } // Fill buffer with portions of the note samples - for( QList::iterator it = m_notes.begin(); it != m_notes.end(); ++it ) + for (auto& note : m_notes) { // Only process the notes if we're in a playing state - if( !( it->state == PlayingKeyDown || - it->state == PlayingKeyUp ) ) + if (!(note.state == PlayingKeyDown || note.state == PlayingKeyUp )) { continue; } - for( QList::iterator sample = it->samples.begin(); - sample != it->samples.end(); ++sample ) + for (auto& sample : note.samples) { - if( sample->sample == nullptr || sample->region == nullptr ) - { - continue; - } + if (sample.sample == nullptr || sample.region == nullptr) { continue; } // Will change if resampling bool resample = false; @@ -434,18 +428,15 @@ void GigInstrument::play( sampleFrame * _working_buffer ) // Resample to be the correct pitch when the sample provided isn't // solely for this one note (e.g. one or two samples per octave) or // we are processing at a different sample rate - if( sample->region->PitchTrack == true || rate != sample->sample->SamplesPerSecond ) + if (sample.region->PitchTrack == true || rate != sample.sample->SamplesPerSecond) { resample = true; // Factor just for resampling - freq_factor = 1.0 * rate / sample->sample->SamplesPerSecond; + freq_factor = 1.0 * rate / sample.sample->SamplesPerSecond; // Factor for pitch shifting as well as resampling - if( sample->region->PitchTrack == true ) - { - freq_factor *= sample->freqFactor; - } + if (sample.region->PitchTrack == true) { freq_factor *= sample.freqFactor; } // We need a bit of margin so we don't get glitching samples = frames / freq_factor + MARGIN[m_interpolation]; @@ -453,11 +444,11 @@ void GigInstrument::play( sampleFrame * _working_buffer ) // Load this note's data sampleFrame sampleData[samples]; - loadSample( *sample, sampleData, samples ); + loadSample(sample, sampleData, samples); // Apply ADSR using a copy so if we don't use these samples when // resampling, the ADSR doesn't get messed up - ADSR copy = sample->adsr; + ADSR copy = sample.adsr; for( f_cnt_t i = 0; i < samples; ++i ) { @@ -472,8 +463,7 @@ void GigInstrument::play( sampleFrame * _working_buffer ) sampleFrame convertBuf[frames]; // Only output if resampling is successful (note that "used" is output) - if( sample->convertSampleRate( *sampleData, *convertBuf, samples, frames, - freq_factor, used ) ) + if (sample.convertSampleRate(*sampleData, *convertBuf, samples, frames, freq_factor, used)) { for( f_cnt_t i = 0; i < frames; ++i ) { @@ -492,8 +482,8 @@ void GigInstrument::play( sampleFrame * _working_buffer ) } // Update note position with how many samples we actually used - sample->pos += used; - sample->adsr.inc( used ); + sample.pos += used; + sample.adsr.inc(used); } } @@ -689,13 +679,12 @@ void GigInstrument::deleteNotePluginData( NotePlayHandle * _n ) // Mark the note as being released, but only if it was playing or was just // pressed (i.e., not if the key was already released) - for( QList::iterator i = m_notes.begin(); i != m_notes.end(); ++i ) + for (auto& note : m_notes) { // Find the note by matching pointers to the plugin data - if( i->handle == pluginData && - ( i->state == KeyDown || i->state == PlayingKeyDown ) ) + if (note.handle == pluginData && (note.state == KeyDown || note.state == PlayingKeyDown)) { - i->state = KeyUp; + note.state = KeyUp; } } diff --git a/plugins/LadspaBrowser/LadspaDescription.cpp b/plugins/LadspaBrowser/LadspaDescription.cpp index e1c208fad..ff4d74867 100644 --- a/plugins/LadspaBrowser/LadspaDescription.cpp +++ b/plugins/LadspaBrowser/LadspaDescription.cpp @@ -72,15 +72,13 @@ LadspaDescription::LadspaDescription( QWidget * _parent, } QList pluginNames; - for( l_sortable_plugin_t::iterator it = plugins.begin(); - it != plugins.end(); ++it ) + for (const auto& plugin : plugins) { - if( _type != VALID || - manager->getDescription( ( *it ).second )->inputChannels - <= Engine::audioEngine()->audioDev()->channels() ) - { - pluginNames.push_back( ( *it ).first ); - m_pluginKeys.push_back( ( *it ).second ); + ch_cnt_t audioDeviceChannels = Engine::audioEngine()->audioDev()->channels(); + if (_type != VALID || manager->getDescription(plugin.second)->inputChannels <= audioDeviceChannels) + { + pluginNames.push_back(plugin.first); + m_pluginKeys.push_back(plugin.second); } } diff --git a/plugins/LadspaEffect/LadspaControlDialog.cpp b/plugins/LadspaEffect/LadspaControlDialog.cpp index 0afc06355..571dbd454 100644 --- a/plugins/LadspaEffect/LadspaControlDialog.cpp +++ b/plugins/LadspaEffect/LadspaControlDialog.cpp @@ -69,11 +69,10 @@ LadspaControlDialog::LadspaControlDialog( LadspaControls * _ctl ) : void LadspaControlDialog::updateEffectView( LadspaControls * _ctl ) { - QList list = findChildren(); - for( QList::iterator it = list.begin(); it != list.end(); - ++it ) + QList groupBoxes = findChildren(); + for (const auto& groupBox : groupBoxes) { - delete *it; + delete groupBox; } m_effectControls = _ctl; @@ -105,12 +104,11 @@ void LadspaControlDialog::updateEffectView( LadspaControls * _ctl ) grouper->setLayout( gl ); grouper->setAlignment( Qt::Vertical ); - for( control_list_t::iterator it = controls.begin(); - it != controls.end(); ++it ) + for (const auto& control : controls) { - if( (*it)->port()->proc == proc ) + if (control->port()->proc == proc) { - buffer_data_t this_port = (*it)->port()->data_type; + buffer_data_t this_port = control->port()->data_type; if( last_port != NONE && ( this_port == TOGGLED || this_port == ENUM ) && ( last_port != TOGGLED && last_port != ENUM ) ) @@ -118,13 +116,13 @@ void LadspaControlDialog::updateEffectView( LadspaControls * _ctl ) ++row; col = 0; } - gl->addWidget( new LadspaControlView( grouper, *it ), row, col ); + gl->addWidget(new LadspaControlView(grouper, control), row, col); if( ++col == cols ) { ++row; col = 0; } - last_port = (*it)->port()->data_type; + last_port = control->port()->data_type; } } diff --git a/plugins/LadspaEffect/LadspaControls.cpp b/plugins/LadspaEffect/LadspaControls.cpp index 1480da743..009e21bf7 100644 --- a/plugins/LadspaEffect/LadspaControls.cpp +++ b/plugins/LadspaEffect/LadspaControls.cpp @@ -53,20 +53,19 @@ LadspaControls::LadspaControls( LadspaEffect * _eff ) : const bool linked_control = ( m_processors > 1 && proc == 0 ); - for( multi_proc_t::Iterator it = controls.begin(); it != controls.end(); it++ ) + for (const auto& control : controls) { - if( (*it)->proc == proc ) + if (control->proc == proc) { - (*it)->control = new LadspaControl( this, *it, - linked_control ); + control->control = new LadspaControl(this, control, linked_control); - p.append( (*it)->control ); + p.append(control->control); - if( linked_control ) + if (linked_control) { - connect( (*it)->control, SIGNAL( linkChanged( int, bool ) ), - this, SLOT( linkPort( int, bool ) ), - Qt::DirectConnection ); + connect(control->control, SIGNAL(linkChanged(int, bool)), + this, SLOT(linkPort(int, bool)), + Qt::DirectConnection); } } } @@ -77,12 +76,11 @@ LadspaControls::LadspaControls( LadspaEffect * _eff ) : // now link all controls if( m_processors > 1 ) { - for( multi_proc_t::Iterator it = controls.begin(); - it != controls.end(); it++ ) + for (const auto& control : controls) { - if( (*it)->proc == 0 ) + if (control->proc == 0) { - linkPort( ( *it )->control_id, true ); + linkPort(control->control_id, true); } } } @@ -112,12 +110,10 @@ void LadspaControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) multi_proc_t controls = m_effect->getPortControls(); _this.setAttribute( "ports", controls.count() ); - for( multi_proc_t::Iterator it = controls.begin(); - it != controls.end(); it++ ) + for (const auto& control : controls) { - QString n = "port" + QString::number( (*it)->proc ) + - QString::number( (*it)->port_id ); - (*it)->control->saveSettings( _doc, _this, n ); + QString n = "port" + QString::number(control->proc) + QString::number(control->port_id); + control->control->saveSettings(_doc, _this, n); } } @@ -132,12 +128,10 @@ void LadspaControls::loadSettings( const QDomElement & _this ) } multi_proc_t controls = m_effect->getPortControls(); - for( multi_proc_t::Iterator it = controls.begin(); - it != controls.end(); it++ ) + for (const auto& control : controls) { - QString n = "port" + QString::number( (*it)->proc ) + - QString::number( (*it)->port_id ); - (*it)->control->loadSettings( _this, n ); + QString n = "port" + QString::number(control->proc) + QString::number(control->port_id); + control->control->loadSettings(_this, n); } } diff --git a/plugins/Lb302/Lb302.cpp b/plugins/Lb302/Lb302.cpp index 7db133f1f..140b84189 100644 --- a/plugins/Lb302/Lb302.cpp +++ b/plugins/Lb302/Lb302.cpp @@ -356,8 +356,9 @@ Lb302Synth::Lb302Synth( InstrumentTrack * _instrumentTrack ) : Lb302Synth::~Lb302Synth() { - for (int i=0; ipitchRangeModel(), SIGNAL(dataChanged()), this, SLOT(updatePitchRange()), Qt::DirectConnection); connect(Engine::audioEngine(), &AudioEngine::sampleRateChanged, diff --git a/plugins/Lv2Instrument/Lv2Instrument.h b/plugins/Lv2Instrument/Lv2Instrument.h index 116b3ce05..e9a6cc2fd 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.h +++ b/plugins/Lv2Instrument/Lv2Instrument.h @@ -101,7 +101,7 @@ private: void setNameFromFile(const QString &name) override; #ifdef LV2_INSTRUMENT_USE_MIDI - int m_runningNotes[NumKeys]; + std::array m_runningNotes = {}; #endif friend class gui::Lv2InsView; diff --git a/plugins/MidiExport/MidiExport.cpp b/plugins/MidiExport/MidiExport.cpp index cb8939778..cbbdc0100 100644 --- a/plugins/MidiExport/MidiExport.cpp +++ b/plugins/MidiExport/MidiExport.cpp @@ -216,27 +216,28 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks, int len = n.toElement().attribute("steps", "1").toInt() * 12; // for each pattern clip of the current pattern track (in song editor) - for (auto it = plist.begin(); it != plist.end(); ++it) + for (const auto& position : plist) { - while (!st.empty() && st.back().second <= it->first) + const auto& [start, end] = position; + while (!st.empty() && st.back().second <= start) { writePatternClip(midiClip, nv, len, st.back().first, pos, st.back().second); pos = st.back().second; st.pop_back(); } - if (!st.empty() && st.back().second <= it->second) + if (!st.empty() && st.back().second <= end) { - writePatternClip(midiClip, nv, len, st.back().first, pos, it->first); - pos = it->first; - while (!st.empty() && st.back().second <= it->second) + writePatternClip(midiClip, nv, len, st.back().first, pos, start); + pos = start; + while (!st.empty() && st.back().second <= end) { st.pop_back(); } } - st.push_back(*it); - pos = it->first; + st.push_back(position); + pos = start; } while (!st.empty()) @@ -286,9 +287,9 @@ void MidiExport::writeMidiClip(MidiNoteVector &midiClip, const QDomNode& n, void MidiExport::writeMidiClipToTrack(MTrack &mtrack, MidiNoteVector &nv) { - for (auto it = nv.begin(); it != nv.end(); ++it) + for (const auto& note : nv) { - mtrack.addNote(it->pitch, it->volume, it->time / 48.0, it->duration / 48.0); + mtrack.addNote(note.pitch, note.volume, note.time / 48.0, note.duration / 48.0); } } @@ -301,16 +302,15 @@ void MidiExport::writePatternClip(MidiNoteVector& src, MidiNoteVector& dst, start -= base; end -= base; std::sort(src.begin(), src.end()); - for (auto it = src.begin(); it != src.end(); ++it) + for (const auto& srcNote : src) { - for (int time = it->time + ceil((start - it->time) / len) - * len; time < end; time += len) + for (int time = srcNote.time + ceil((start - srcNote.time) / len) * len; time < end; time += len) { MidiNote note; - note.duration = it->duration; - note.pitch = it->pitch; + note.duration = srcNote.duration; + note.pitch = srcNote.pitch; note.time = base + time; - note.volume = it->volume; + note.volume = srcNote.volume; dst.push_back(note); } } diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index a2686a1c9..c669b02b7 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -401,9 +401,9 @@ bool MidiImport::readSMF( TrackContainer* tc ) Alg_track_ptr trk = seq->track( t ); pd.setValue( t + preTrackSteps ); - for( int c = 0; c < MIDI_CC_COUNT; c++ ) + for (auto& cc : ccs) { - ccs[c].clear(); + cc.clear(); } // Now look at events diff --git a/plugins/Patman/Patman.cpp b/plugins/Patman/Patman.cpp index 341cd9f27..34545f557 100644 --- a/plugins/Patman/Patman.cpp +++ b/plugins/Patman/Patman.cpp @@ -399,16 +399,16 @@ void PatmanInstrument::selectSample( NotePlayHandle * _n ) float min_dist = HUGE_VALF; SampleBuffer* sample = nullptr; - for( QVector::iterator it = m_patchSamples.begin(); it != m_patchSamples.end(); ++it ) + for (const auto& patchSample : m_patchSamples) { - float patch_freq = ( *it )->frequency(); + float patch_freq = patchSample->frequency(); float dist = freq >= patch_freq ? freq / patch_freq : patch_freq / freq; if( dist < min_dist ) { min_dist = dist; - sample = *it; + sample = patchSample; } } diff --git a/plugins/Sf2Player/Sf2Player.cpp b/plugins/Sf2Player/Sf2Player.cpp index cd147abda..bd9788bf1 100644 --- a/plugins/Sf2Player/Sf2Player.cpp +++ b/plugins/Sf2Player/Sf2Player.cpp @@ -115,10 +115,6 @@ Sf2Instrument::Sf2Instrument( InstrumentTrack * _instrument_track ) : m_chorusSpeed( FLUID_CHORUS_DEFAULT_SPEED, 0.29, 5.0, 0.01, this, tr( "Chorus speed" ) ), m_chorusDepth( FLUID_CHORUS_DEFAULT_DEPTH, 0, 46.0, 0.05, this, tr( "Chorus depth" ) ) { - for( int i = 0; i < 128; ++i ) - { - m_notesRunning[i] = 0; - } #if QT_VERSION_CHECK(FLUIDSYNTH_VERSION_MAJOR, FLUIDSYNTH_VERSION_MINOR, FLUIDSYNTH_VERSION_MICRO) >= QT_VERSION_CHECK(1,1,9) @@ -1194,7 +1190,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) { return new Sf2Instrument( static_cast( m ) ); } - } diff --git a/plugins/Sf2Player/Sf2Player.h b/plugins/Sf2Player/Sf2Player.h index 275d7494c..7cad284c0 100644 --- a/plugins/Sf2Player/Sf2Player.h +++ b/plugins/Sf2Player/Sf2Player.h @@ -135,7 +135,7 @@ private: QMutex m_synthMutex; QMutex m_loadMutex; - int m_notesRunning[128]; + std::array m_notesRunning = {}; sample_rate_t m_internalSampleRate; int m_lastMidiPitch; int m_lastMidiPitchRange; diff --git a/plugins/Sfxr/Sfxr.cpp b/plugins/Sfxr/Sfxr.cpp index cb5e22c1d..d97217446 100644 --- a/plugins/Sfxr/Sfxr.cpp +++ b/plugins/Sfxr/Sfxr.cpp @@ -140,11 +140,12 @@ void SfxrSynth::resetSample( bool restart ) if(s->m_phaserSweepModel.value()<0.0f) fdphase=-fdphase; iphase=abs((int)fphase); ipp=0; - for(int i=0;i<1024;i++) - phaser_buffer[i]=0.0f; - - for(int i=0;i<32;i++) - noise_buffer[i]=frnd(2.0f)-1.0f; + + phaser_buffer.fill(0.0f); + for (auto& noiseSample : noise_buffer) + { + noiseSample = frnd(2.0f) - 1.0f; + } rep_time=0; rep_limit=(int)(pow(1.0f-s->m_repeatSpeedModel.value(), 2.0f)*20000+32); @@ -239,8 +240,10 @@ void SfxrSynth::update( sampleFrame * buffer, const int32_t frameNum ) // phase=0; phase%=period; if(s->m_waveFormModel.value()==3) - for(int i=0;i<32;i++) - noise_buffer[i]=frnd(2.0f)-1.0f; + for (auto& noiseSample : noise_buffer) + { + noiseSample = frnd(2.0f) - 1.0f; + } } // base waveform float fp=(float)phase/period; diff --git a/plugins/Sfxr/Sfxr.h b/plugins/Sfxr/Sfxr.h index 2011062d1..632ccfebd 100644 --- a/plugins/Sfxr/Sfxr.h +++ b/plugins/Sfxr/Sfxr.h @@ -105,7 +105,7 @@ private: float fphase; float fdphase; int iphase; - float phaser_buffer[1024]; + std::array phaser_buffer; int ipp; float noise_buffer[32]; float fltp; diff --git a/plugins/Sid/SidInstrument.cpp b/plugins/Sid/SidInstrument.cpp index c1a62e0f6..73c571b72 100644 --- a/plugins/Sid/SidInstrument.cpp +++ b/plugins/Sid/SidInstrument.cpp @@ -227,10 +227,10 @@ f_cnt_t SidInstrument::desiredReleaseFrames() const { const float samplerate = Engine::audioEngine()->processingSampleRate(); int maxrel = 0; - for( int i = 0 ; i < 3 ; ++i ) + for (const auto& voice : m_voice) { - if( maxrel < m_voice[i]->m_releaseModel.value() ) - maxrel = (int)m_voice[i]->m_releaseModel.value(); + if( maxrel < voice->m_releaseModel.value() ) + maxrel = (int)voice->m_releaseModel.value(); } return f_cnt_t( float(relTime[maxrel])*samplerate/1000.0 ); @@ -320,9 +320,9 @@ void SidInstrument::playNote( NotePlayHandle * _n, auto buf = reinterpret_cast(_working_buffer + offset); unsigned char sidreg[NUMSIDREGS]; - for (int c = 0; c < NUMSIDREGS; c++) + for (auto& reg : sidreg) { - sidreg[c] = 0x00; + reg = 0x00; } if( (ChipModel)m_chipModel.value() == sidMOS6581 ) @@ -749,20 +749,14 @@ void SidInstrumentView::modelChanged() &k->m_voice[i]->m_testModel ); } - for( int i = 0; i < 3; ++i ) + for (const auto& voice : k->m_voice) { - connect( &k->m_voice[i]->m_attackModel, SIGNAL( dataChanged() ), - this, SLOT( updateKnobHint() ) ); - connect( &k->m_voice[i]->m_decayModel, SIGNAL( dataChanged() ), - this, SLOT( updateKnobHint() ) ); - connect( &k->m_voice[i]->m_releaseModel, SIGNAL( dataChanged() ), - this, SLOT( updateKnobHint() ) ); - connect( &k->m_voice[i]->m_pulseWidthModel, SIGNAL( dataChanged() ), - this, SLOT( updateKnobHint() ) ); - connect( &k->m_voice[i]->m_sustainModel, SIGNAL( dataChanged() ), - this, SLOT( updateKnobToolTip() ) ); - connect( &k->m_voice[i]->m_coarseModel, SIGNAL( dataChanged() ), - this, SLOT( updateKnobToolTip() ) ); + connect(&voice->m_attackModel, SIGNAL(dataChanged()), this, SLOT(updateKnobHint())); + connect(&voice->m_decayModel, SIGNAL(dataChanged()), this, SLOT(updateKnobHint())); + connect(&voice->m_releaseModel, SIGNAL(dataChanged()), this, SLOT(updateKnobHint())); + connect(&voice->m_pulseWidthModel, SIGNAL(dataChanged()), this, SLOT(updateKnobHint())); + connect(&voice->m_sustainModel, SIGNAL(dataChanged()), this, SLOT(updateKnobToolTip())); + connect(&voice->m_coarseModel, SIGNAL(dataChanged()), this, SLOT(updateKnobToolTip())); } connect( &k->m_volumeModel, SIGNAL( dataChanged() ), diff --git a/plugins/TripleOscillator/TripleOscillator.cpp b/plugins/TripleOscillator/TripleOscillator.cpp index 78a43a376..bbc95683b 100644 --- a/plugins/TripleOscillator/TripleOscillator.cpp +++ b/plugins/TripleOscillator/TripleOscillator.cpp @@ -409,10 +409,10 @@ gui::PluginView* TripleOscillator::instantiateView( QWidget * _parent ) void TripleOscillator::updateAllDetuning() { - for( int i = 0; i < NUM_OF_OSCILLATORS; ++i ) + for (const auto& osc : m_osc) { - m_osc[i]->updateDetuningLeft(); - m_osc[i]->updateDetuningRight(); + osc->updateDetuningLeft(); + osc->updateDetuningRight(); } } diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index a7001da68..488931e6d 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -375,15 +375,12 @@ void VstPlugin::setParameterDump( const QMap & _pdump ) { message m( IdVstSetParameterDump ); m.addInt( _pdump.size() ); - for( QMap::ConstIterator it = _pdump.begin(); - it != _pdump.end(); ++it ) + for (const auto& str : _pdump) { const VstParameterDumpItem item = { - ( *it ).section( ':', 0, 0 ).toInt(), - "", - LocaleHelper::toFloat((*it).section(':', 2, -1)) - } ; + str.section(':', 0, 0).toInt(), "", LocaleHelper::toFloat(str.section(':', 2, -1)) + }; m.addInt( item.index ); m.addString( item.shortLabel ); m.addFloat( item.value ); diff --git a/plugins/Xpressive/ExprSynth.cpp b/plugins/Xpressive/ExprSynth.cpp index 6c82b0885..47b778ae0 100644 --- a/plugins/Xpressive/ExprSynth.cpp +++ b/plugins/Xpressive/ExprSynth.cpp @@ -377,13 +377,13 @@ public: {} ~ExprFrontData() { - for (int i = 0; i < m_cyclics.size() ; ++i) + for (const auto& cyclic : m_cyclics) { - delete m_cyclics[i]; + delete cyclic; } - for (int i = 0; i < m_cyclics_interp.size() ; ++i) + for (const auto& cyclic : m_cyclics_interp) { - delete m_cyclics_interp[i]; + delete cyclic; } if (m_integ_func) { diff --git a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp index 36f7ce48c..f09cb6662 100644 --- a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp @@ -51,11 +51,6 @@ LocalZynAddSubFx::LocalZynAddSubFx() : m_master( nullptr ), m_ioEngine( nullptr ) { - for( int i = 0; i < NumKeys; ++i ) - { - m_runningNotes[i] = 0; - } - if( s_instanceCount == 0 ) { #ifdef LMMS_BUILD_WIN32 @@ -182,14 +177,14 @@ void LocalZynAddSubFx::loadPreset( const std::string & _filename, int _part ) void LocalZynAddSubFx::setPresetDir( const std::string & _dir ) { m_presetsDir = _dir; - for( int i = 0; i < MAX_BANK_ROOT_DIRS; ++i ) + for (auto& bankRootDir : config.cfg.bankRootDirList) { - if( config.cfg.bankRootDirList[i].empty() ) + if (bankRootDir.empty()) { - config.cfg.bankRootDirList[i] = m_presetsDir; + bankRootDir = m_presetsDir; break; } - else if( config.cfg.bankRootDirList[i] == m_presetsDir ) + else if (bankRootDir == m_presetsDir) { break; } @@ -214,9 +209,9 @@ void LocalZynAddSubFx::setLmmsWorkingDir( const std::string & _dir ) void LocalZynAddSubFx::setPitchWheelBendRange( int semitones ) { - for( int i = 0; i < NUM_MIDI_PARTS; ++i ) + for (const auto& part : m_master->part) { - m_master->part[i]->ctl.setpitchwheelbendrange( semitones * 100 ); + part->ctl.setpitchwheelbendrange(semitones * 100); } } diff --git a/plugins/ZynAddSubFx/LocalZynAddSubFx.h b/plugins/ZynAddSubFx/LocalZynAddSubFx.h index 81da0f9ce..f37a3e0f4 100644 --- a/plugins/ZynAddSubFx/LocalZynAddSubFx.h +++ b/plugins/ZynAddSubFx/LocalZynAddSubFx.h @@ -72,7 +72,7 @@ protected: std::string m_presetsDir; - int m_runningNotes[NumKeys]; + std::array m_runningNotes = {}; Master * m_master; NulEngine* m_ioEngine; diff --git a/src/common/RemotePluginBase.cpp b/src/common/RemotePluginBase.cpp index 10775ed5e..a4739a63c 100644 --- a/src/common/RemotePluginBase.cpp +++ b/src/common/RemotePluginBase.cpp @@ -90,10 +90,10 @@ int RemotePluginBase::sendMessage( const message & _m ) writeInt( _m.id ); writeInt( _m.data.size() ); int j = 8; - for( unsigned int i = 0; i < _m.data.size(); ++i ) + for (const auto& str : _m.data) { - writeString( _m.data[i] ); - j += 4 + _m.data[i].size(); + writeString(str); + j += 4 + str.size(); } pthread_mutex_unlock( &m_sendMutex ); #endif diff --git a/src/core/AudioEngine.cpp b/src/core/AudioEngine.cpp index 11def2a2e..a91e88f38 100644 --- a/src/core/AudioEngine.cpp +++ b/src/core/AudioEngine.cpp @@ -188,9 +188,9 @@ AudioEngine::~AudioEngine() MemoryHelper::alignedFree(m_outputBufferRead); MemoryHelper::alignedFree(m_outputBufferWrite); - for( int i = 0; i < 2; ++i ) + for (const auto& input : m_inputBuffer) { - delete[] m_inputBuffer[i]; + delete[] input; } } diff --git a/src/core/AutomatableModel.cpp b/src/core/AutomatableModel.cpp index 06f1938ca..378ccd91e 100644 --- a/src/core/AutomatableModel.cpp +++ b/src/core/AutomatableModel.cpp @@ -305,13 +305,13 @@ void AutomatableModel::setValue( const float value ) addJournalCheckPoint(); // notify linked models - for( AutoModelVector::Iterator it = m_linkedModels.begin(); it != m_linkedModels.end(); ++it ) + for (const auto& linkedModel : m_linkedModels) { - if( (*it)->m_setValueDepth < 1 && (*it)->fittedValue( value ) != (*it)->m_value ) + if (linkedModel->m_setValueDepth < 1 && linkedModel->fittedValue(value) != linkedModel->m_value) { - bool journalling = (*it)->testAndSetJournalling( isJournalling() ); - (*it)->setValue( value ); - (*it)->setJournalling( journalling ); + bool journalling = linkedModel->testAndSetJournalling(isJournalling()); + linkedModel->setValue(value); + linkedModel->setJournalling(journalling); } } m_valueChanged = true; @@ -388,13 +388,12 @@ void AutomatableModel::setAutomatedValue( const float value ) if( oldValue != m_value ) { // notify linked models - for (AutoModelVector::Iterator it = m_linkedModels.begin(); - it != m_linkedModels.end(); ++it) + for (const auto& linkedModel : m_linkedModels) { - if (!((*it)->controllerConnection()) && (*it)->m_setValueDepth < 1 && - (*it)->fittedValue(m_value) != (*it)->m_value) + if (!(linkedModel->controllerConnection()) && linkedModel->m_setValueDepth < 1 && + linkedModel->fittedValue(m_value) != linkedModel->m_value) { - (*it)->setAutomatedValue(value); + linkedModel->setAutomatedValue(value); } } m_valueChanged = true; @@ -733,11 +732,11 @@ float AutomatableModel::globalAutomationValueAt( const TimePos& time ) // of those clips: // find the clips which overlap with the time position QVector clipsInRange; - for( QVector::ConstIterator it = clips.begin(); it != clips.end(); it++ ) + for (const auto& clip : clips) { - int s = ( *it )->startPosition(); - int e = ( *it )->endPosition(); - if( s <= time && e >= time ) { clipsInRange += ( *it ); } + int s = clip->startPosition(); + int e = clip->endPosition(); + if (s <= time && e >= time) { clipsInRange += clip; } } AutomationClip * latestClip = nullptr; @@ -753,13 +752,13 @@ float AutomatableModel::globalAutomationValueAt( const TimePos& time ) { int latestPosition = 0; - for( QVector::ConstIterator it = clips.begin(); it != clips.end(); it++ ) + for (const auto& clip : clips) { - int e = ( *it )->endPosition(); - if( e <= time && e > latestPosition ) + int e = clip->endPosition(); + if (e <= time && e > latestPosition) { latestPosition = e; - latestClip = ( *it ); + latestClip = clip; } } } diff --git a/src/core/AutomationClip.cpp b/src/core/AutomationClip.cpp index 1447e2629..fb2d7dbb0 100644 --- a/src/core/AutomationClip.cpp +++ b/src/core/AutomationClip.cpp @@ -786,15 +786,13 @@ void AutomationClip::saveSettings( QDomDocument & _doc, QDomElement & _this ) _this.appendChild( element ); } - for( objectVector::const_iterator it = m_objects.begin(); - it != m_objects.end(); ++it ) + for (const auto& object : m_objects) { - if( *it ) + if (object) { QDomElement element = _doc.createElement( "object" ); - element.setAttribute( "id", - ProjectJournal::idToSave( ( *it )->id() ) ); - _this.appendChild( element ); + element.setAttribute("id", ProjectJournal::idToSave(object->id())); + _this.appendChild(element); } } } @@ -895,20 +893,18 @@ bool AutomationClip::isAutomated( const AutomatableModel * _m ) l += Engine::patternStore()->tracks(); l += Engine::getSong()->globalAutomationTrack(); - for( TrackContainer::TrackList::ConstIterator it = l.begin(); it != l.end(); ++it ) + for (const auto& track : l) { - if( ( *it )->type() == Track::AutomationTrack || - ( *it )->type() == Track::HiddenAutomationTrack ) + if (track->type() == Track::AutomationTrack || track->type() == Track::HiddenAutomationTrack) { - const Track::clipVector & v = ( *it )->getClips(); - for( Track::clipVector::ConstIterator j = v.begin(); j != v.end(); ++j ) + for (const auto& clip : track->getClips()) { - const auto a = dynamic_cast(*j); + const auto a = dynamic_cast(clip); if( a && a->hasAutomation() ) { - for( objectVector::const_iterator k = a->m_objects.begin(); k != a->m_objects.end(); ++k ) + for (const auto& object : a->m_objects) { - if( *k == _m ) + if (object == _m) { return true; } @@ -927,34 +923,31 @@ bool AutomationClip::isAutomated( const AutomatableModel * _m ) */ QVector AutomationClip::clipsForModel( const AutomatableModel * _m ) { - QVector clips; - TrackContainer::TrackList l; - l += Engine::getSong()->tracks(); - l += Engine::patternStore()->tracks(); - l += Engine::getSong()->globalAutomationTrack(); + QVector clips; + TrackContainer::TrackList tracks; + tracks += Engine::getSong()->tracks(); + tracks += Engine::patternStore()->tracks(); + tracks += Engine::getSong()->globalAutomationTrack(); // go through all tracks... - for( TrackContainer::TrackList::ConstIterator it = l.begin(); it != l.end(); ++it ) + for (const auto& track : tracks) { // we want only automation tracks... - if( ( *it )->type() == Track::AutomationTrack || - ( *it )->type() == Track::HiddenAutomationTrack ) + if (track->type() == Track::AutomationTrack || track->type() == Track::HiddenAutomationTrack ) { - // get clips in those tracks.... - const Track::clipVector & v = ( *it )->getClips(); // go through all the clips... - for( Track::clipVector::ConstIterator j = v.begin(); j != v.end(); ++j ) + for (const auto& trackClip : track->getClips()) { - auto a = dynamic_cast(*j); + auto a = dynamic_cast(trackClip); // check that the clip has automation if( a && a->hasAutomation() ) { // now check is the clip is connected to the model we want by going through all the connections // of the clip bool has_object = false; - for( objectVector::const_iterator k = a->m_objects.begin(); k != a->m_objects.end(); ++k ) + for (const auto& object : a->m_objects) { - if( *k == _m ) + if (object == _m) { has_object = true; } @@ -974,19 +967,14 @@ AutomationClip * AutomationClip::globalAutomationClip( AutomatableModel * _m ) { AutomationTrack * t = Engine::getSong()->globalAutomationTrack(); - Track::clipVector v = t->getClips(); - for( Track::clipVector::const_iterator j = v.begin(); j != v.end(); ++j ) + for (const auto& clip : t->getClips()) { - auto a = dynamic_cast(*j); + auto a = dynamic_cast(clip); if( a ) { - for( objectVector::const_iterator k = a->m_objects.begin(); - k != a->m_objects.end(); ++k ) + for (const auto& object : a->m_objects) { - if( *k == _m ) - { - return a; - } + if (object == _m) { return a; } } } } @@ -1004,24 +992,18 @@ void AutomationClip::resolveAllIDs() TrackContainer::TrackList l = Engine::getSong()->tracks() + Engine::patternStore()->tracks(); l += Engine::getSong()->globalAutomationTrack(); - for( TrackContainer::TrackList::iterator it = l.begin(); - it != l.end(); ++it ) + for (const auto& track : l) { - if( ( *it )->type() == Track::AutomationTrack || - ( *it )->type() == Track::HiddenAutomationTrack ) + if (track->type() == Track::AutomationTrack || track->type() == Track::HiddenAutomationTrack) { - Track::clipVector v = ( *it )->getClips(); - for( Track::clipVector::iterator j = v.begin(); - j != v.end(); ++j ) + for (const auto& clip : track->getClips()) { - auto a = dynamic_cast(*j); + auto a = dynamic_cast(clip); if( a ) { - for( QVector::Iterator k = a->m_idsToResolve.begin(); - k != a->m_idsToResolve.end(); ++k ) + for (const auto& id : a->m_idsToResolve) { - JournallingObject * o = Engine::projectJournal()-> - journallingObject( *k ); + JournallingObject* o = Engine::projectJournal()->journallingObject(id); if( o && dynamic_cast( o ) ) { a->addObject( dynamic_cast( o ), false ); @@ -1030,7 +1012,7 @@ void AutomationClip::resolveAllIDs() { // FIXME: Remove this block once the automation system gets fixed // This is a temporary fix for https://github.com/LMMS/lmms/issues/3781 - o = Engine::projectJournal()->journallingObject(ProjectJournal::idFromSave(*k)); + o = Engine::projectJournal()->journallingObject(ProjectJournal::idFromSave(id)); if( o && dynamic_cast( o ) ) { a->addObject( dynamic_cast( o ), false ); @@ -1039,7 +1021,7 @@ void AutomationClip::resolveAllIDs() { // FIXME: Remove this block once the automation system gets fixed // This is a temporary fix for https://github.com/LMMS/lmms/issues/4781 - o = Engine::projectJournal()->journallingObject(ProjectJournal::idToSave(*k)); + o = Engine::projectJournal()->journallingObject(ProjectJournal::idToSave(id)); if( o && dynamic_cast( o ) ) { a->addObject( dynamic_cast( o ), false ); diff --git a/src/core/ConfigManager.cpp b/src/core/ConfigManager.cpp index dbad06784..bfe9e31f1 100644 --- a/src/core/ConfigManager.cpp +++ b/src/core/ConfigManager.cpp @@ -339,13 +339,11 @@ const QString & ConfigManager::value(const QString & cls, { if(m_settings.contains(cls)) { - for(stringPairVector::const_iterator it = - m_settings[cls].begin(); - it != m_settings[cls].end(); ++it) + for (const auto& setting : m_settings[cls]) { - if((*it).first == attribute) + if (setting.first == attribute) { - return (*it).second ; + return setting.second; } } } @@ -609,25 +607,22 @@ void ConfigManager::saveConfigFile() lmms_config.setAttribute("configversion", m_configVersion); doc.appendChild(lmms_config); - for(settingsMap::iterator it = m_settings.begin(); - it != m_settings.end(); ++it) + for (auto it = m_settings.begin(); it != m_settings.end(); ++it) { QDomElement n = doc.createElement(it.key()); - for(stringPairVector::iterator it2 = (*it).begin(); - it2 != (*it).end(); ++it2) + for (const auto& [first, second] : *it) { - n.setAttribute((*it2).first, (*it2).second); + n.setAttribute(first, second); } lmms_config.appendChild(n); } QDomElement recent_files = doc.createElement("recentfiles"); - for(QStringList::iterator it = m_recentlyOpenedProjects.begin(); - it != m_recentlyOpenedProjects.end(); ++it) + for (const auto& recentlyOpenedProject : m_recentlyOpenedProjects) { QDomElement n = doc.createElement("file"); - n.setAttribute("path", *it); + n.setAttribute("path", recentlyOpenedProject); recent_files.appendChild(n); } lmms_config.appendChild(recent_files); diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 14024fe90..635c4c6a4 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -533,9 +533,9 @@ bool DataFile::hasLocalPlugins(QDomElement parent /* = QDomElement()*/, bool fir bool skipNode = false; // Skip the nodes allowed to have "local:" attributes, but // still check its children - for (auto it = ELEMENTS_WITH_RESOURCES.begin(); it != ELEMENTS_WITH_RESOURCES.end(); ++it) + for (const auto& element : ELEMENTS_WITH_RESOURCES) { - if (childElement.tagName() == it->first) + if (childElement.tagName() == element.first) { skipNode = true; break; diff --git a/src/core/Effect.cpp b/src/core/Effect.cpp index 1b6220463..151eaf13e 100644 --- a/src/core/Effect.cpp +++ b/src/core/Effect.cpp @@ -66,11 +66,11 @@ Effect::Effect( const Plugin::Descriptor * _desc, Effect::~Effect() { - for( int i = 0; i < 2; ++i ) + for (const auto& state : m_srcState) { - if( m_srcState[i] != nullptr ) + if (state != nullptr) { - src_delete( m_srcState[i] ); + src_delete(state); } } } @@ -175,17 +175,15 @@ gui::PluginView * Effect::instantiateView( QWidget * _parent ) void Effect::reinitSRC() { - for( int i = 0; i < 2; ++i ) + for (auto& state : m_srcState) { - if( m_srcState[i] != nullptr ) + if (state != nullptr) { - src_delete( m_srcState[i] ); + src_delete(state); } int error; - if( ( m_srcState[i] = src_new( - Engine::audioEngine()->currentQualitySettings(). - libsrcInterpolation(), - DEFAULT_CHANNELS, &error ) ) == nullptr ) + const int currentInterpolation = Engine::audioEngine()->currentQualitySettings().libsrcInterpolation(); + if((state = src_new(currentInterpolation, DEFAULT_CHANNELS, &error)) == nullptr) { qFatal( "Error: src_new() failed in effect.cpp!\n" ); } diff --git a/src/core/EffectChain.cpp b/src/core/EffectChain.cpp index e165e7391..024ddab64 100644 --- a/src/core/EffectChain.cpp +++ b/src/core/EffectChain.cpp @@ -191,12 +191,12 @@ bool EffectChain::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames, b MixHelpers::sanitize( _buf, _frames ); bool moreEffects = false; - for( EffectList::Iterator it = m_effects.begin(); it != m_effects.end(); ++it ) + for (const auto& effect : m_effects) { - if( hasInputNoise || ( *it )->isRunning() ) + if (hasInputNoise || effect->isRunning()) { - moreEffects |= ( *it )->processAudioBuffer( _buf, _frames ); - MixHelpers::sanitize( _buf, _frames ); + moreEffects |= effect->processAudioBuffer(_buf, _frames); + MixHelpers::sanitize(_buf, _frames); } } @@ -213,10 +213,9 @@ void EffectChain::startRunning() return; } - for( EffectList::Iterator it = m_effects.begin(); - it != m_effects.end(); it++ ) + for (const auto& effect : m_effects) { - ( *it )->startRunning(); + effect->startRunning(); } } diff --git a/src/core/EnvelopeAndLfoParameters.cpp b/src/core/EnvelopeAndLfoParameters.cpp index 2f41b7e64..2aa77e6aa 100644 --- a/src/core/EnvelopeAndLfoParameters.cpp +++ b/src/core/EnvelopeAndLfoParameters.cpp @@ -47,11 +47,10 @@ EnvelopeAndLfoParameters::LfoInstances * EnvelopeAndLfoParameters::s_lfoInstance void EnvelopeAndLfoParameters::LfoInstances::trigger() { QMutexLocker m( &m_lfoListMutex ); - for( LfoList::Iterator it = m_lfos.begin(); - it != m_lfos.end(); ++it ) + for (const auto& lfo : m_lfos) { - ( *it )->m_lfoFrame += Engine::audioEngine()->framesPerPeriod(); - ( *it )->m_bad_lfoShapeData = true; + lfo->m_lfoFrame += Engine::audioEngine()->framesPerPeriod(); + lfo->m_bad_lfoShapeData = true; } } @@ -61,11 +60,10 @@ void EnvelopeAndLfoParameters::LfoInstances::trigger() void EnvelopeAndLfoParameters::LfoInstances::reset() { QMutexLocker m( &m_lfoListMutex ); - for( LfoList::Iterator it = m_lfos.begin(); - it != m_lfos.end(); ++it ) + for (const auto& lfo : m_lfos) { - ( *it )->m_lfoFrame = 0; - ( *it )->m_bad_lfoShapeData = true; + lfo->m_lfoFrame = 0; + lfo->m_bad_lfoShapeData = true; } } diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index 75e6c53d1..4a5e29bd7 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -179,11 +179,9 @@ bool InstrumentFunctionNoteStacking::Chord::hasSemiTone( int8_t semi_tone ) cons InstrumentFunctionNoteStacking::ChordTable::ChordTable() : QVector() { - for( int i = 0; - i < static_cast( sizeof s_initTable / sizeof *s_initTable ); - i++ ) + for (const auto& chord : s_initTable) { - push_back( Chord( s_initTable[i].m_name, s_initTable[i].m_semiTones ) ); + push_back(Chord(chord.m_name, chord.m_semiTones)); } } diff --git a/src/core/Keymap.cpp b/src/core/Keymap.cpp index 5dfdd9186..6683919fe 100644 --- a/src/core/Keymap.cpp +++ b/src/core/Keymap.cpp @@ -125,11 +125,11 @@ void Keymap::saveSettings(QDomDocument &document, QDomElement &element) element.setAttribute("base_key", m_baseKey); element.setAttribute("base_freq", m_baseFreq); - for (int i = 0; i < m_map.size(); i++) + for (int value : m_map) { QDomElement degree = document.createElement("degree"); element.appendChild(degree); - degree.setAttribute("value", m_map[i]); + degree.setAttribute("value", value); } } diff --git a/src/core/Ladspa2LMMS.cpp b/src/core/Ladspa2LMMS.cpp index 8ac6c3d86..24dfc76f1 100644 --- a/src/core/Ladspa2LMMS.cpp +++ b/src/core/Ladspa2LMMS.cpp @@ -35,10 +35,9 @@ Ladspa2LMMS::Ladspa2LMMS() { l_sortable_plugin_t plugins = getSortedPlugins(); - for( l_sortable_plugin_t::iterator it = plugins.begin(); - it != plugins.end(); ++it ) + for (const auto& plugin : plugins) { - ladspa_key_t key = (*it).second; + ladspa_key_t key = plugin.second; LadspaManagerDescription * desc = getDescription( key ); if( desc->type == SOURCE ) diff --git a/src/core/LadspaManager.cpp b/src/core/LadspaManager.cpp index 156b50aeb..8c3ab8f97 100644 --- a/src/core/LadspaManager.cpp +++ b/src/core/LadspaManager.cpp @@ -59,19 +59,15 @@ LadspaManager::LadspaManager() ladspaDirectories.push_back( "/Library/Audio/Plug-Ins/LADSPA" ); #endif - for( QStringList::iterator it = ladspaDirectories.begin(); - it != ladspaDirectories.end(); ++it ) + for (const auto& ladspaDirectory : ladspaDirectories) { // Skip empty entries as QDir will interpret it as the working directory - if ((*it).isEmpty()) { continue; } - QDir directory( ( *it ) ); + if (ladspaDirectory.isEmpty()) { continue; } + QDir directory(ladspaDirectory); QFileInfoList list = directory.entryInfoList(); - for( QFileInfoList::iterator file = list.begin(); - file != list.end(); ++file ) + for (const auto& f : list) { - const QFileInfo & f = *file; - if( !f.isFile() || - f.fileName().right( 3 ).toLower() != + if(!f.isFile() || f.fileName().right( 3 ).toLower() != #ifdef LMMS_BUILD_WIN32 "dll" #else @@ -101,10 +97,9 @@ LadspaManager::LadspaManager() } l_ladspa_key_t keys = m_ladspaManagerMap.keys(); - for( l_ladspa_key_t::iterator it = keys.begin(); - it != keys.end(); ++it ) + for (const auto& key : keys) { - m_sortedPlugins.append( qMakePair( getName( *it ), *it ) ); + m_sortedPlugins.append(qMakePair(getName(key), key)); } std::sort( m_sortedPlugins.begin(), m_sortedPlugins.end() ); } diff --git a/src/core/Mixer.cpp b/src/core/Mixer.cpp index 11e51fee7..52ce2732c 100644 --- a/src/core/Mixer.cpp +++ b/src/core/Mixer.cpp @@ -387,15 +387,13 @@ void Mixer::moveChannelLeft( int index ) TrackContainer::TrackList songTrackList = Engine::getSong()->tracks(); TrackContainer::TrackList patternTrackList = Engine::patternStore()->tracks(); - TrackContainer::TrackList trackLists[] = {songTrackList, patternTrackList}; - for(int tl=0; tl<2; ++tl) + for (const auto& trackList : {songTrackList, patternTrackList}) { - TrackContainer::TrackList trackList = trackLists[tl]; - for(int i=0; itype() == Track::InstrumentTrack ) + if (track->type() == Track::InstrumentTrack) { - auto inst = (InstrumentTrack*)trackList[i]; + auto inst = (InstrumentTrack*)track; int val = inst->mixerChannelModel()->value(0); if( val == a ) { @@ -406,9 +404,9 @@ void Mixer::moveChannelLeft( int index ) inst->mixerChannelModel()->setValue(a); } } - else if( trackList[i]->type() == Track::SampleTrack ) + else if (track->type() == Track::SampleTrack) { - auto strk = (SampleTrack*)trackList[i]; + auto strk = (SampleTrack*)track; int val = strk->mixerChannelModel()->value(0); if( val == a ) { @@ -447,13 +445,13 @@ MixerRoute * Mixer::createChannelSend( mix_ch_t fromChannel, mix_ch_t toChannel, MixerChannel * from = m_mixerChannels[fromChannel]; MixerChannel * to = m_mixerChannels[toChannel]; - for( int i=0; im_sends.size(); ++i ) + for (const auto& send : from->m_sends) { - if( from->m_sends[i]->receiver() == to ) + if (send->receiver() == to) { // simply adjust the amount - from->m_sends[i]->amount()->setValue( amount ); - return from->m_sends[i]; + send->amount()->setValue(amount); + return send; } } @@ -493,11 +491,11 @@ void Mixer::deleteChannelSend( mix_ch_t fromChannel, mix_ch_t toChannel ) MixerChannel * to = m_mixerChannels[toChannel]; // find and delete the send entry - for( int i = 0; i < from->m_sends.size(); ++i ) + for (const auto& send : from->m_sends) { - if( from->m_sends[i]->receiver() == to ) + if (send->receiver() == to) { - deleteChannelSend( from->m_sends[i] ); + deleteChannelSend(send); break; } } @@ -544,9 +542,9 @@ bool Mixer::checkInfiniteLoop( MixerChannel * from, MixerChannel * to ) // follow sendTo's outputs recursively looking for something that sends // to sendFrom - for( int i=0; i < to->m_sends.size(); ++i ) + for (const auto& send : to->m_sends) { - if( checkInfiniteLoop( from, to->m_sends[i]->receiver() ) ) + if (checkInfiniteLoop(from, send->receiver())) { return true; } @@ -744,13 +742,13 @@ void Mixer::saveSettings( QDomDocument & _doc, QDomElement & _this ) if( ch->m_hasColor ) mixch.setAttribute( "color", ch->m_color.name() ); // add the channel sends - for( int si = 0; si < ch->m_sends.size(); ++si ) + for (const auto& send : ch->m_sends) { QDomElement sendsDom = _doc.createElement( QString( "send" ) ); mixch.appendChild( sendsDom ); - sendsDom.setAttribute( "channel", ch->m_sends[si]->receiverIndex() ); - ch->m_sends[si]->amount()->saveSettings( _doc, sendsDom, "amount" ); + sendsDom.setAttribute("channel", send->receiverIndex()); + send->amount()->saveSettings(_doc, sendsDom, "amount"); } } } diff --git a/src/core/NotePlayHandle.cpp b/src/core/NotePlayHandle.cpp index 8d81b473a..06d584a14 100644 --- a/src/core/NotePlayHandle.cpp +++ b/src/core/NotePlayHandle.cpp @@ -443,9 +443,9 @@ float NotePlayHandle::volumeLevel( const f_cnt_t _frame ) void NotePlayHandle::mute() { // mute all sub-notes - for( NotePlayHandleList::Iterator it = m_subNotes.begin(); it != m_subNotes.end(); ++it ) + for (const auto& subNote : m_subNotes) { - ( *it )->mute(); + subNote->mute(); } m_muted = true; } @@ -457,9 +457,9 @@ int NotePlayHandle::index() const { const PlayHandleList & playHandles = Engine::audioEngine()->playHandles(); int idx = 0; - for( PlayHandleList::ConstIterator it = playHandles.begin(); it != playHandles.end(); ++it ) + for (const auto& playHandle : playHandles) { - const auto nph = dynamic_cast(*it); + const auto nph = dynamic_cast(playHandle); if( nph == nullptr || nph->m_instrumentTrack != m_instrumentTrack || nph->isReleased() || nph->hasParent() ) { continue; @@ -481,9 +481,9 @@ ConstNotePlayHandleList NotePlayHandle::nphsOfInstrumentTrack( const InstrumentT const PlayHandleList & playHandles = Engine::audioEngine()->playHandles(); ConstNotePlayHandleList cnphv; - for( PlayHandleList::ConstIterator it = playHandles.begin(); it != playHandles.end(); ++it ) + for (const auto& playHandle : playHandles) { - const auto nph = dynamic_cast(*it); + const auto nph = dynamic_cast(playHandle); if( nph != nullptr && nph->m_instrumentTrack == _it && ( ( nph->isReleased() == false && nph->hasParent() == false ) || _all_ph == true ) ) { cnphv.push_back( nph ); @@ -589,9 +589,9 @@ void NotePlayHandle::resize( const bpm_t _new_tempo ) m_frames = (f_cnt_t)new_frames; m_totalFramesPlayed = (f_cnt_t)( completed * new_frames ); - for( NotePlayHandleList::Iterator it = m_subNotes.begin(); it != m_subNotes.end(); ++it ) + for (const auto& subNote : m_subNotes) { - ( *it )->resize( _new_tempo ); + subNote->resize(_new_tempo); } } diff --git a/src/core/Piano.cpp b/src/core/Piano.cpp index 8cf1917e3..21ef7217d 100644 --- a/src/core/Piano.cpp +++ b/src/core/Piano.cpp @@ -67,11 +67,6 @@ Piano::Piano( InstrumentTrack* track ) : m_instrumentTrack( track ), m_midiEvProc( track ) /*!< the InstrumentTrack Model */ { - for( int i = 0; i < NumKeys; ++i ) - { - m_pressedKeys[i] = false; - } - } /*! \brief Turn a key on or off diff --git a/src/core/RenderManager.cpp b/src/core/RenderManager.cpp index ea3f69f47..56b4ce9d7 100644 --- a/src/core/RenderManager.cpp +++ b/src/core/RenderManager.cpp @@ -100,9 +100,8 @@ void RenderManager::renderTracks() const TrackContainer::TrackList & tl = Engine::getSong()->tracks(); // find all currently unnmuted tracks -- we want to render these. - for( auto it = tl.begin(); it != tl.end(); ++it ) + for (const auto& tk : tl) { - Track* tk = (*it); Track::TrackTypes type = tk->type(); // Don't render automation tracks @@ -114,9 +113,8 @@ void RenderManager::renderTracks() } const TrackContainer::TrackList t2 = Engine::patternStore()->tracks(); - for( auto it = t2.begin(); it != t2.end(); ++it ) + for (const auto& tk : t2) { - Track* tk = (*it); Track::TrackTypes type = tk->type(); // Don't render automation tracks diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 3981ebc64..7ecccf56d 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -99,7 +99,7 @@ Song::Song() : m_loopRenderRemaining(1), m_oldAutomatedValues() { - for(int i = 0; i < Mode_Count; ++i) m_elapsedMilliSeconds[i] = 0; + for (double& millisecondsElapsed : m_elapsedMilliSeconds) { millisecondsElapsed = 0; } connect( &m_tempoModel, SIGNAL(dataChanged()), this, SLOT(setTempo()), Qt::DirectConnection ); connect( &m_tempoModel, SIGNAL(dataUnchanged()), @@ -119,8 +119,8 @@ Song::Song() : qRegisterMetaType( "Note" ); setType( SongContainer ); - for (int i = 0; i < MaxScaleCount; i++) {m_scales[i] = std::make_shared();} - for (int i = 0; i < MaxKeymapCount; i++) {m_keymaps[i] = std::make_shared();} + for (auto& scale : m_scales) {scale = std::make_shared();} + for (auto& keymap : m_keymaps) {keymap = std::make_shared();} } @@ -148,10 +148,9 @@ void Song::setTempo() Engine::audioEngine()->requestChangeInModel(); const auto tempo = (bpm_t)m_tempoModel.value(); PlayHandleList & playHandles = Engine::audioEngine()->playHandles(); - for( PlayHandleList::Iterator it = playHandles.begin(); - it != playHandles.end(); ++it ) + for (const auto& playHandle : playHandles) { - auto nph = dynamic_cast(*it); + auto nph = dynamic_cast(playHandle); if( nph && !nph->isReleased() ) { nph->lock(); @@ -1310,9 +1309,9 @@ void Song::saveControllerStates( QDomDocument & doc, QDomElement & element ) // save settings of controllers QDomElement controllersNode = doc.createElement( "controllers" ); element.appendChild( controllersNode ); - for( int i = 0; i < m_controllers.size(); ++i ) + for (const auto& controller : m_controllers) { - m_controllers[i]->saveState( doc, controllersNode ); + controller->saveState(doc, controllersNode); } } @@ -1356,9 +1355,9 @@ void Song::saveScaleStates(QDomDocument &doc, QDomElement &element) QDomElement scalesNode = doc.createElement("scales"); element.appendChild(scalesNode); - for (int i = 0; i < MaxScaleCount; i++) + for (const auto& scale : m_scales) { - m_scales[i]->saveState(doc, scalesNode); + scale->saveState(doc, scalesNode); } } @@ -1381,9 +1380,9 @@ void Song::saveKeymapStates(QDomDocument &doc, QDomElement &element) QDomElement keymapsNode = doc.createElement("keymaps"); element.appendChild(keymapsNode); - for (int i = 0; i < MaxKeymapCount; i++) + for (const auto& keymap : m_keymaps) { - m_keymaps[i]->saveState(doc, keymapsNode); + keymap->saveState(doc, keymapsNode); } } diff --git a/src/core/Track.cpp b/src/core/Track.cpp index 1bb1b8e8b..084f302f8 100644 --- a/src/core/Track.cpp +++ b/src/core/Track.cpp @@ -226,10 +226,9 @@ void Track::saveSettings( QDomDocument & doc, QDomElement & element ) } // now save settings of all Clip's - for( clipVector::const_iterator it = m_clips.begin(); - it != m_clips.end(); ++it ) + for (const auto& clip : m_clips) { - ( *it )->saveState( doc, element ); + clip->saveState(doc, element); } } @@ -512,13 +511,11 @@ void Track::insertBar( const TimePos & pos ) { // we'll increase the position of every Clip, positioned behind pos, by // one bar - for( clipVector::iterator it = m_clips.begin(); - it != m_clips.end(); ++it ) + for (const auto& clip : m_clips) { - if( ( *it )->startPosition() >= pos ) + if (clip->startPosition() >= pos) { - ( *it )->movePosition( (*it)->startPosition() + - TimePos::ticksPerBar() ); + clip->movePosition(clip->startPosition() + TimePos::ticksPerBar()); } } } @@ -534,11 +531,11 @@ void Track::removeBar( const TimePos & pos ) { // we'll decrease the position of every Clip, positioned behind pos, by // one bar - for( clipVector::iterator it = m_clips.begin(); it != m_clips.end(); ++it ) + for (const auto& clip : m_clips) { - if( ( *it )->startPosition() >= pos ) + if (clip->startPosition() >= pos) { - (*it)->movePosition((*it)->startPosition() - TimePos::ticksPerBar()); + clip->movePosition(clip->startPosition() - TimePos::ticksPerBar()); } } } @@ -556,15 +553,14 @@ bar_t Track::length() const { // find last end-position tick_t last = 0; - for( clipVector::const_iterator it = m_clips.begin(); it != m_clips.end(); ++it ) + for (const auto& clip : m_clips) { - if( Engine::getSong()->isExporting() && - ( *it )->isMuted() ) + if (Engine::getSong()->isExporting() && clip->isMuted()) { continue; } - const tick_t cur = ( *it )->endPosition(); + const tick_t cur = clip->endPosition(); if( cur > last ) { last = cur; @@ -587,12 +583,11 @@ void Track::toggleSolo() const TrackContainer::TrackList & tl = m_trackContainer->tracks(); bool soloBefore = false; - for( TrackContainer::TrackList::const_iterator it = tl.begin(); - it != tl.end(); ++it ) + for (const auto& track : tl) { - if( *it != this ) + if (track != this) { - if( ( *it )->m_soloModel.value() ) + if (track->m_soloModel.value()) { soloBefore = true; break; @@ -604,37 +599,36 @@ void Track::toggleSolo() // Should we use the new behavior of solo or the older/legacy one? const bool soloLegacyBehavior = ConfigManager::inst()->value("app", "sololegacybehavior", "0").toInt(); - for( TrackContainer::TrackList::const_iterator it = tl.begin(); - it != tl.end(); ++it ) + for (const auto& track : tl) { - if( solo ) + if (solo) { // save mute-state in case no track was solo before - if( !soloBefore ) + if (!soloBefore) { - ( *it )->m_mutedBeforeSolo = ( *it )->isMuted(); + track->m_mutedBeforeSolo = track->isMuted(); } // Don't mute AutomationTracks (keep their original state) unless we are on the sololegacybehavior mode - if( *it == this ) + if (track == this) { - ( *it )->setMuted( false ); + track->setMuted(false); } - else if( soloLegacyBehavior || ( *it )->type() != AutomationTrack ) + else if (soloLegacyBehavior || track->type() != AutomationTrack) { - ( *it )->setMuted( true ); + track->setMuted(true); } - if( *it != this ) + if (track != this) { - ( *it )->m_soloModel.setValue( false ); + track->m_soloModel.setValue(false); } } - else if( !soloBefore ) + else if (!soloBefore) { // Unless we are on the sololegacybehavior mode, only restores the // mute state if the track isn't an Automation Track - if( soloLegacyBehavior || ( *it )->type() != AutomationTrack ) + if (soloLegacyBehavior || track->type() != AutomationTrack) { - ( *it )->setMuted( ( *it )->m_mutedBeforeSolo ); + track->setMuted(track->m_mutedBeforeSolo); } } } diff --git a/src/core/TrackContainer.cpp b/src/core/TrackContainer.cpp index ce8fdd400..0347773ed 100644 --- a/src/core/TrackContainer.cpp +++ b/src/core/TrackContainer.cpp @@ -71,9 +71,9 @@ void TrackContainer::saveSettings( QDomDocument & _doc, QDomElement & _this ) // save settings of each track m_tracksMutex.lockForRead(); - for( int i = 0; i < m_tracks.size(); ++i ) + for (const auto& track : m_tracks) { - m_tracks[i]->saveState( _doc, _this ); + track->saveState(_doc, _this); } m_tracksMutex.unlock(); } @@ -160,9 +160,9 @@ int TrackContainer::countTracks( Track::TrackTypes _tt ) const { int cnt = 0; m_tracksMutex.lockForRead(); - for( int i = 0; i < m_tracks.size(); ++i ) + for (const auto& track : m_tracks) { - if( m_tracks[i]->type() == _tt || _tt == Track::NumTrackTypes ) + if (track->type() == _tt || _tt == Track::NumTrackTypes) { ++cnt; } @@ -238,10 +238,9 @@ void TrackContainer::clearAllTracks() bool TrackContainer::isEmpty() const { - for( TrackList::const_iterator it = m_tracks.begin(); - it != m_tracks.end(); ++it ) + for (const auto& track : m_tracks) { - if( !( *it )->getClips().isEmpty() ) + if (!track->getClips().isEmpty()) { return false; } diff --git a/src/core/audio/AudioSampleRecorder.cpp b/src/core/audio/AudioSampleRecorder.cpp index a380ae121..f60248c50 100644 --- a/src/core/audio/AudioSampleRecorder.cpp +++ b/src/core/audio/AudioSampleRecorder.cpp @@ -60,10 +60,9 @@ AudioSampleRecorder::~AudioSampleRecorder() f_cnt_t AudioSampleRecorder::framesRecorded() const { f_cnt_t frames = 0; - for( BufferList::ConstIterator it = m_buffers.begin(); - it != m_buffers.end(); ++it ) + for (const auto& buffer : m_buffers) { - frames += ( *it ).second; + frames += buffer.second; } return frames; } diff --git a/src/core/lv2/Lv2ControlBase.cpp b/src/core/lv2/Lv2ControlBase.cpp index c1679aaef..3ab8b278c 100644 --- a/src/core/lv2/Lv2ControlBase.cpp +++ b/src/core/lv2/Lv2ControlBase.cpp @@ -111,7 +111,7 @@ const LinkedModelGroup *Lv2ControlBase::getGroup(std::size_t idx) const void Lv2ControlBase::copyModelsFromLmms() { - for (auto& c : m_procs) { c->copyModelsFromCore(); } + for (const auto& c : m_procs) { c->copyModelsFromCore(); } } @@ -119,7 +119,7 @@ void Lv2ControlBase::copyModelsFromLmms() { void Lv2ControlBase::copyModelsToLmms() const { - for (auto& c : m_procs) { c->copyModelsToCore(); } + for (const auto& c : m_procs) { c->copyModelsToCore(); } } @@ -127,7 +127,8 @@ void Lv2ControlBase::copyModelsToLmms() const void Lv2ControlBase::copyBuffersFromLmms(const sampleFrame *buf, fpp_t frames) { unsigned firstChan = 0; // tell the procs which channels they shall read from - for (auto& c : m_procs) { + for (const auto& c : m_procs) + { c->copyBuffersFromCore(buf, firstChan, m_channelsPerProc, frames); firstChan += m_channelsPerProc; } @@ -148,7 +149,7 @@ void Lv2ControlBase::copyBuffersToLmms(sampleFrame *buf, fpp_t frames) const { void Lv2ControlBase::run(fpp_t frames) { - for (auto& c : m_procs) { c->run(frames); } + for (const auto& c : m_procs) { c->run(frames); } } @@ -211,7 +212,7 @@ bool Lv2ControlBase::hasNoteInput() const void Lv2ControlBase::handleMidiInputEvent(const MidiEvent &event, const TimePos &time, f_cnt_t offset) { - for (auto& c : m_procs) { c->handleMidiInputEvent(event, time, offset); } + for (const auto& c : m_procs) { c->handleMidiInputEvent(event, time, offset); } } diff --git a/src/core/lv2/Lv2Features.cpp b/src/core/lv2/Lv2Features.cpp index 60c1b4324..be7fb6e28 100644 --- a/src/core/lv2/Lv2Features.cpp +++ b/src/core/lv2/Lv2Features.cpp @@ -87,9 +87,9 @@ void Lv2Features::createFeatureVectors() // create pointer vector (for lilv_plugin_instantiate) m_featurePointers.reserve(m_features.size() + 1); - for(std::size_t i = 0; i < m_features.size(); ++i) + for (const auto& feature : m_features) { - m_featurePointers.push_back(&m_features[i]); + m_featurePointers.push_back(&feature); } m_featurePointers.push_back(nullptr); } diff --git a/src/core/midi/MidiClient.cpp b/src/core/midi/MidiClient.cpp index 1c200bc1b..5b008c54b 100644 --- a/src/core/midi/MidiClient.cpp +++ b/src/core/midi/MidiClient.cpp @@ -237,9 +237,9 @@ void MidiClientRaw::parseData( const unsigned char c ) void MidiClientRaw::processParsedEvent() { - for( int i = 0; i < m_midiPorts.size(); ++i ) + for (const auto& midiPort : m_midiPorts) { - m_midiPorts[i]->processInEvent( m_midiParseData.m_midiEvent ); + midiPort->processInEvent(m_midiParseData.m_midiEvent); } } diff --git a/src/core/midi/MidiPort.cpp b/src/core/midi/MidiPort.cpp index 33733398b..63ca817e0 100644 --- a/src/core/midi/MidiPort.cpp +++ b/src/core/midi/MidiPort.cpp @@ -378,9 +378,9 @@ void MidiPort::updateReadablePorts() m_readablePorts.clear(); const QStringList& wp = m_midiClient->readablePorts(); // now insert new ports and restore selections - for( QStringList::ConstIterator it = wp.begin(); it != wp.end(); ++it ) + for (const auto& port : wp) { - m_readablePorts[*it] = ( selectedPorts.indexOf( *it ) != -1 ); + m_readablePorts[port] = (selectedPorts.indexOf(port) != -1); } emit readablePortsChanged(); @@ -404,9 +404,9 @@ void MidiPort::updateWritablePorts() m_writablePorts.clear(); const QStringList & wp = m_midiClient->writablePorts(); // now insert new ports and restore selections - for( QStringList::ConstIterator it = wp.begin(); it != wp.end(); ++it ) + for (const auto& port : wp) { - m_writablePorts[*it] = ( selectedPorts.indexOf( *it ) != -1 ); + m_writablePorts[port] = (selectedPorts.indexOf(port) != -1); } emit writablePortsChanged(); diff --git a/src/gui/EffectRackView.cpp b/src/gui/EffectRackView.cpp index 7bcef202c..27da96877 100644 --- a/src/gui/EffectRackView.cpp +++ b/src/gui/EffectRackView.cpp @@ -155,14 +155,12 @@ void EffectRackView::update() QVector view_map( qMax( fxChain()->m_effects.size(), m_effectViews.size() ), false ); - for( QVector::Iterator it = fxChain()->m_effects.begin(); - it != fxChain()->m_effects.end(); ++it ) + for (const auto& effect : fxChain()->m_effects) { int i = 0; - for( QVector::Iterator vit = m_effectViews.begin(); - vit != m_effectViews.end(); ++vit, ++i ) + for (const auto& effectView : m_effectViews) { - if( ( *vit )->model() == *it ) + if (effectView->model() == effect) { view_map[i] = true; break; @@ -170,7 +168,7 @@ void EffectRackView::update() } if( i >= m_effectViews.size() ) { - auto view = new EffectView(*it, w); + auto view = new EffectView(effect, w); connect( view, SIGNAL(moveUp(lmms::gui::EffectView*)), this, SLOT(moveUp(lmms::gui::EffectView*))); connect( view, SIGNAL(moveDown(lmms::gui::EffectView*)), @@ -238,13 +236,11 @@ void EffectRackView::addEffect() update(); // Find the effectView, and show the controls - for( QVector::Iterator vit = m_effectViews.begin(); - vit != m_effectViews.end(); ++vit ) + for (const auto& effectView : m_effectViews) { - if( ( *vit )->effect() == fx ) + if (effectView->effect() == fx) { - ( *vit )->editControls(); - + effectView->editControls(); break; } } diff --git a/src/gui/FileBrowser.cpp b/src/gui/FileBrowser.cpp index dd987b93a..4ef41217d 100644 --- a/src/gui/FileBrowser.cpp +++ b/src/gui/FileBrowser.cpp @@ -217,9 +217,9 @@ void FileBrowser::reloadTree() if (!paths.isEmpty()) { - for (QStringList::iterator it = paths.begin(); it != paths.end(); ++it) + for (const auto& path : paths) { - addItems(*it); + addItems(path); } } expandItems(nullptr, expandedDirs); @@ -979,13 +979,10 @@ void Directory::update() { m_dirCount = 0; // for all paths leading here, add their items - for( QStringList::iterator it = m_directories.begin(); - it != m_directories.end(); ++it ) + for (const auto& directory : m_directories) { int filesBeforeAdd = childCount() - m_dirCount; - if( addItems( fullName( *it ) ) && - ( *it ).contains( - ConfigManager::inst()->dataDir() ) ) + if(addItems(fullName(directory)) && directory.contains(ConfigManager::inst()->dataDir())) { // factory file directory is added // note: those are always added last diff --git a/src/gui/LmmsStyle.cpp b/src/gui/LmmsStyle.cpp index ee1824783..64c1c1614 100644 --- a/src/gui/LmmsStyle.cpp +++ b/src/gui/LmmsStyle.cpp @@ -71,9 +71,10 @@ QLinearGradient getGradient( const QColor & _col, const QRectF & _rect ) QLinearGradient darken( const QLinearGradient & _gradient ) { QGradientStops stops = _gradient.stops(); - for (int i = 0; i < stops.size(); ++i) { - QColor color = stops.at(i).second; - stops[i].second = color.lighter(133); + for (auto& stop : stops) + { + QColor color = stop.second; + stop.second = color.lighter(133); } QLinearGradient g = _gradient; diff --git a/src/gui/MicrotunerConfig.cpp b/src/gui/MicrotunerConfig.cpp index d400be341..316bf54d6 100644 --- a/src/gui/MicrotunerConfig.cpp +++ b/src/gui/MicrotunerConfig.cpp @@ -286,9 +286,9 @@ void MicrotunerConfig::updateKeymapForm() m_keymapTextEdit->setPlainText(""); const std::vector &map = newMap->getMap(); - for (std::size_t i = 0; i < map.size(); i++) + for (int value : map) { - if (map[i] >= 0) {m_keymapTextEdit->appendPlainText(QString::number(map[i]));} + if (value >= 0) {m_keymapTextEdit->appendPlainText(QString::number(value));} else {m_keymapTextEdit->appendPlainText("x");} } QTextCursor tmp = m_keymapTextEdit->textCursor(); diff --git a/src/gui/MixerView.cpp b/src/gui/MixerView.cpp index 3fc7be316..62d4cb7ce 100644 --- a/src/gui/MixerView.cpp +++ b/src/gui/MixerView.cpp @@ -168,9 +168,9 @@ MixerView::MixerView() : MixerView::~MixerView() { - for (int i=0; itracks(); TrackContainer::TrackList patternStoreTracks = Engine::patternStore()->tracks(); - TrackContainer::TrackList trackLists[] = {songTracks, patternStoreTracks}; - for(int tl=0; tl<2; ++tl) + for (const auto& trackList : {songTracks, patternStoreTracks}) { - TrackContainer::TrackList trackList = trackLists[tl]; - for(int i=0; itype() == Track::InstrumentTrack ) + if (track->type() == Track::InstrumentTrack) { - auto inst = (InstrumentTrack*)trackList[i]; + auto inst = (InstrumentTrack*)track; inst->mixerChannelModel()->setRange(0, m_mixerChannelViews.size()-1,1); } - else if( trackList[i]->type() == Track::SampleTrack ) + else if (track->type() == Track::SampleTrack) { - auto strk = (SampleTrack*)trackList[i]; + auto strk = (SampleTrack*)track; strk->mixerChannelModel()->setRange(0, m_mixerChannelViews.size()-1,1); } diff --git a/src/gui/clips/AutomationClipView.cpp b/src/gui/clips/AutomationClipView.cpp index c32b62eb2..6fa91efdb 100644 --- a/src/gui/clips/AutomationClipView.cpp +++ b/src/gui/clips/AutomationClipView.cpp @@ -195,15 +195,12 @@ void AutomationClipView::constructContextMenu( QMenu * _cm ) { _cm->addSeparator(); auto m = new QMenu(tr("%1 Connections").arg(m_clip->m_objects.count()), _cm); - for( AutomationClip::objectVector::iterator it = - m_clip->m_objects.begin(); - it != m_clip->m_objects.end(); ++it ) + for (const auto& object : m_clip->m_objects) { - if( *it ) + if (object) { - a = new QAction( tr( "Disconnect \"%1\"" ). - arg( ( *it )->fullDisplayName() ), m ); - a->setData( ( *it )->id() ); + a = new QAction(tr("Disconnect \"%1\"").arg(object->fullDisplayName()), m); + a->setData(object->id()); m->addAction( a ); } } diff --git a/src/gui/clips/ClipView.cpp b/src/gui/clips/ClipView.cpp index 4c2dd5d69..e2da11439 100644 --- a/src/gui/clips/ClipView.cpp +++ b/src/gui/clips/ClipView.cpp @@ -538,18 +538,16 @@ DataFile ClipView::createClipDataFiles( DataFile dataFile( DataFile::DragNDropData ); QDomElement clipParent = dataFile.createElement("clips"); - using clipViewVector = QVector; - for( clipViewVector::const_iterator it = clipViews.begin(); - it != clipViews.end(); ++it ) + for (const auto& clipView : clipViews) { // Insert into the dom under the "clips" element - Track* clipTrack = ( *it )->m_trackView->getTrack(); + Track* clipTrack = clipView->m_trackView->getTrack(); int trackIndex = tc->tracks().indexOf( clipTrack ); QDomElement clipElement = dataFile.createElement("clip"); clipElement.setAttribute( "trackIndex", trackIndex ); clipElement.setAttribute( "trackType", clipTrack->type() ); clipElement.setAttribute( "trackName", clipTrack->name() ); - ( *it )->m_clip->saveState( dataFile, clipElement ); + clipView->m_clip->saveState(dataFile, clipElement); clipParent.appendChild( clipElement ); } @@ -796,9 +794,9 @@ void ClipView::mouseMoveEvent( QMouseEvent * me ) // Collect all selected Clips QVector so = m_trackView->trackContainerView()->selectedObjects(); - for( auto it = so.begin(); it != so.end(); ++it ) + for (const auto& selectedClip : so) { - auto clipv = dynamic_cast(*it); + auto clipv = dynamic_cast(selectedClip); if( clipv != nullptr ) { clipViews.push_back( clipv ); @@ -1336,10 +1334,9 @@ void ClipView::setInitialOffsets() { QVector so = m_trackView->trackContainerView()->selectedObjects(); QVector offsets; - for( QVector::iterator it = so.begin(); - it != so.end(); ++it ) + for (const auto& selectedClip : so) { - auto clipv = dynamic_cast(*it); + auto clipv = dynamic_cast(selectedClip); if( clipv == nullptr ) { continue; diff --git a/src/gui/editors/PatternEditor.cpp b/src/gui/editors/PatternEditor.cpp index 699d6599a..b2d2f5c3f 100644 --- a/src/gui/editors/PatternEditor.cpp +++ b/src/gui/editors/PatternEditor.cpp @@ -71,12 +71,11 @@ void PatternEditor::removeSteps() { TrackContainer::TrackList tl = model()->tracks(); - for( TrackContainer::TrackList::iterator it = tl.begin(); - it != tl.end(); ++it ) + for (const auto& track : tl) { - if( ( *it )->type() == Track::InstrumentTrack ) + if (track->type() == Track::InstrumentTrack) { - auto p = static_cast((*it)->getClip(m_ps->currentPattern())); + auto p = static_cast(track->getClip(m_ps->currentPattern())); p->removeSteps(); } } @@ -179,12 +178,11 @@ void PatternEditor::makeSteps( bool clone ) { TrackContainer::TrackList tl = model()->tracks(); - for( TrackContainer::TrackList::iterator it = tl.begin(); - it != tl.end(); ++it ) + for (const auto& track : tl) { - if( ( *it )->type() == Track::InstrumentTrack ) + if (track->type() == Track::InstrumentTrack) { - auto p = static_cast((*it)->getClip(m_ps->currentPattern())); + auto p = static_cast(track->getClip(m_ps->currentPattern())); if( clone ) { p->cloneSteps(); diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 60d5859e3..bc1245615 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -393,7 +393,10 @@ PianoRoll::PianoRoll() : // Set up key selection dropdown m_keyModel.addItem(tr("No key")); // Use piano roll note strings for key dropdown - for (int i = 0; i < 12; i++) { m_keyModel.addItem(s_noteStrings[i]); } + for (const auto& noteString : s_noteStrings) + { + m_keyModel.addItem(noteString); + } m_keyModel.setValue(0); // start with "No key" connect(&m_keyModel, &ComboBoxModel::dataChanged, this, &PianoRoll::keyChanged); @@ -558,9 +561,9 @@ void PianoRoll::markSemiTone(int i, bool fromMenu) { // lets erase all of the ones that match this by octave QList::iterator i; - for (int ix = 0; ix < aok.size(); ++ix) + for (int octave : aok) { - i = std::find(m_markedSemiTones.begin(), m_markedSemiTones.end(), aok.at(ix)); + i = std::find(m_markedSemiTones.begin(), m_markedSemiTones.end(), octave); if (i != m_markedSemiTones.end()) { m_markedSemiTones.erase(i); @@ -5159,10 +5162,10 @@ void PianoRollWindow::saveSettings( QDomDocument & doc, QDomElement & de ) if (m_editor->m_markedSemiTones.length() > 0) { QDomElement markedSemiTonesRoot = doc.createElement("markedSemiTones"); - for (int ix = 0; ix < m_editor->m_markedSemiTones.size(); ++ix) + for (int markedSemiTone : m_editor->m_markedSemiTones) { QDomElement semiToneNode = doc.createElement("semiTone"); - semiToneNode.setAttribute("key", m_editor->m_markedSemiTones.at(ix)); + semiToneNode.setAttribute("key", markedSemiTone); markedSemiTonesRoot.appendChild(semiToneNode); } de.appendChild(markedSemiTonesRoot); diff --git a/src/gui/editors/Rubberband.cpp b/src/gui/editors/Rubberband.cpp index cfff787e0..9c5e9c0dc 100644 --- a/src/gui/editors/Rubberband.cpp +++ b/src/gui/editors/Rubberband.cpp @@ -77,10 +77,9 @@ QVector RubberBand::selectableObjects() const QList l = parentWidget()->findChildren(); - for( QList::iterator it = l.begin(); it != l.end(); - ++it ) + for (const auto& obj : l) { - so.push_back( *it ); + so.push_back(obj); } return( so ); } diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 3b13a96e9..330216e43 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -507,10 +507,9 @@ void SongEditor::keyPressEvent( QKeyEvent * ke ) else if( ke->key() == Qt::Key_Delete || ke->key() == Qt::Key_Backspace ) { QVector so = selectedObjects(); - for( QVector::iterator it = so.begin(); - it != so.end(); ++it ) + for (const auto& selectedClip : so) { - auto clipv = dynamic_cast(*it); + auto clipv = dynamic_cast(selectedClip); clipv->remove(); } } diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index d5c7496c1..966228ac8 100644 --- a/src/gui/editors/TrackContainerView.cpp +++ b/src/gui/editors/TrackContainerView.cpp @@ -258,11 +258,10 @@ void TrackContainerView::realignTracks() m_scrollArea->widget()->setFixedHeight( m_scrollArea->widget()->minimumSizeHint().height()); - for( trackViewList::iterator it = m_trackViews.begin(); - it != m_trackViews.end(); ++it ) + for (const auto& trackView : m_trackViews) { - ( *it )->show(); - ( *it )->update(); + trackView->show(); + trackView->update(); } } @@ -274,10 +273,9 @@ TrackView * TrackContainerView::createTrackView( Track * _t ) //m_tc->addJournalCheckPoint(); // Avoid duplicating track views - for( trackViewList::iterator it = m_trackViews.begin(); - it != m_trackViews.end(); ++it ) + for (const auto& trackView : m_trackViews) { - if ( ( *it )->getTrack() == _t ) { return ( *it ); } + if (trackView->getTrack() == _t) { return trackView; } } return _t->createView( this ); @@ -310,15 +308,11 @@ const TrackView * TrackContainerView::trackViewAt( const int _y ) const // debug code // qDebug( "abs_y %d", abs_y ); - for( trackViewList::const_iterator it = m_trackViews.begin(); - it != m_trackViews.end(); ++it ) + for (const auto& trackView : m_trackViews) { const int y_cnt1 = y_cnt; - y_cnt += ( *it )->height(); - if( abs_y >= y_cnt1 && abs_y < y_cnt ) - { - return( *it ); - } + y_cnt += trackView->height(); + if (abs_y >= y_cnt1 && abs_y < y_cnt) { return trackView; } } return( nullptr ); } @@ -347,10 +341,9 @@ void TrackContainerView::setPixelsPerBar( int ppb ) m_ppb = ppb; // tell all TrackContentWidgets to update their background tile pixmap - for( trackViewList::Iterator it = m_trackViews.begin(); - it != m_trackViews.end(); ++it ) + for (const auto& trackView : m_trackViews) { - ( *it )->getTrackContentWidget()->updateBackground(); + trackView->getTrackContentWidget()->updateBackground(); } } diff --git a/src/gui/tracks/TrackContentWidget.cpp b/src/gui/tracks/TrackContentWidget.cpp index 220a1334f..74ab016ea 100644 --- a/src/gui/tracks/TrackContentWidget.cpp +++ b/src/gui/tracks/TrackContentWidget.cpp @@ -174,11 +174,10 @@ void TrackContentWidget::removeClipView( ClipView * clipv ) */ void TrackContentWidget::update() { - for( clipViewVector::iterator it = m_clipViews.begin(); - it != m_clipViews.end(); ++it ) + for (const auto& clipView : m_clipViews) { - ( *it )->setFixedHeight( height() - 1 ); - ( *it )->update(); + clipView->setFixedHeight(height() - 1); + clipView->update(); } QWidget::update(); } @@ -200,28 +199,20 @@ void TrackContentWidget::changePosition( const TimePos & newPos ) setUpdatesEnabled( false ); // first show clip for current pattern... - for( clipViewVector::iterator it = m_clipViews.begin(); - it != m_clipViews.end(); ++it ) + for (const auto& clipView : m_clipViews) { - if ((*it)->getClip()->startPosition().getBar() == curPattern) + if (clipView->getClip()->startPosition().getBar() == curPattern) { - ( *it )->move( 0, ( *it )->y() ); - ( *it )->raise(); - ( *it )->show(); - } - else - { - ( *it )->lower(); + clipView->move(0, clipView->y()); + clipView->raise(); + clipView->show(); } + else { clipView->lower(); } } // ...then hide others to avoid flickering - for( clipViewVector::iterator it = m_clipViews.begin(); - it != m_clipViews.end(); ++it ) + for (const auto& clipView : m_clipViews) { - if ((*it)->getClip()->startPosition().getBar() != curPattern) - { - ( *it )->hide(); - } + if (clipView->getClip()->startPosition().getBar() != curPattern) { clipView->hide(); } } setUpdatesEnabled( true ); return; @@ -238,11 +229,9 @@ void TrackContentWidget::changePosition( const TimePos & newPos ) const float ppb = m_trackView->trackContainerView()->pixelsPerBar(); setUpdatesEnabled( false ); - for( clipViewVector::iterator it = m_clipViews.begin(); - it != m_clipViews.end(); ++it ) + for (const auto& clipView : m_clipViews) { - ClipView * clipv = *it; - Clip * clip = clipv->getClip(); + Clip* clip = clipView->getClip(); clip->changeLength( clip->length() ); @@ -252,17 +241,15 @@ void TrackContentWidget::changePosition( const TimePos & newPos ) ( te >= begin && te <= end ) || ( ts <= begin && te >= end ) ) { - clipv->move( static_cast( ( ts - begin ) * ppb / - TimePos::ticksPerBar() ), - clipv->y() ); - if( !clipv->isVisible() ) + clipView->move(static_cast((ts - begin) * ppb / TimePos::ticksPerBar()), clipView->y()); + if (!clipView->isVisible()) { - clipv->show(); + clipView->show(); } } else { - clipv->move( -clipv->width()-10, clipv->y() ); + clipView->move(-clipView->width() - 10, clipView->y()); } } setUpdatesEnabled( true ); @@ -456,10 +443,9 @@ bool TrackContentWidget::pasteSelection( TimePos clipPos, const QMimeData * md, // Unselect the old group const QVector so = m_trackView->trackContainerView()->selectedObjects(); - for( QVector::const_iterator it = so.begin(); - it != so.end(); ++it ) + for (const auto& obj : so) { - ( *it )->setSelected( false ); + obj->setSelected(false); } diff --git a/src/gui/tracks/TrackView.cpp b/src/gui/tracks/TrackView.cpp index 6d1c8f510..0aabc705d 100644 --- a/src/gui/tracks/TrackView.cpp +++ b/src/gui/tracks/TrackView.cpp @@ -104,9 +104,9 @@ TrackView::TrackView( Track * track, TrackContainerView * tcv ) : m_track, SLOT(toggleSolo()), Qt::DirectConnection ); // create views for already existing clips - for( Track::clipVector::iterator it = m_track->m_clips.begin(); it != m_track->m_clips.end(); ++it ) + for (const auto& clip : m_track->m_clips) { - createClipView( *it ); + createClipView(clip); } m_trackContainerView->addTrackView( this ); diff --git a/src/gui/widgets/AutomatableButton.cpp b/src/gui/widgets/AutomatableButton.cpp index 5fbe211f8..6e9cd23e4 100644 --- a/src/gui/widgets/AutomatableButton.cpp +++ b/src/gui/widgets/AutomatableButton.cpp @@ -192,10 +192,9 @@ automatableButtonGroup::automatableButtonGroup( QWidget * _parent, automatableButtonGroup::~automatableButtonGroup() { - for( QList::iterator it = m_buttons.begin(); - it != m_buttons.end(); ++it ) + for (const auto& button : m_buttons) { - ( *it )->m_group = nullptr; + button->m_group = nullptr; } } diff --git a/src/gui/widgets/LcdWidget.cpp b/src/gui/widgets/LcdWidget.cpp index a21536bf7..0f5e13466 100644 --- a/src/gui/widgets/LcdWidget.cpp +++ b/src/gui/widgets/LcdWidget.cpp @@ -164,13 +164,12 @@ void LcdWidget::paintEvent( QPaintEvent* ) } // Digits - for( int i=0; i < m_display.length(); i++ ) + for (const auto& digit : m_display) { - int val = m_display[i].digitValue(); + int val = digit.digitValue(); if( val < 0 ) { - if( m_display[i] == '-' ) - val = 11; + if (digit == '-') val = 11; else val = 10; } diff --git a/src/gui/widgets/TabWidget.cpp b/src/gui/widgets/TabWidget.cpp index d8bb70a42..106387e42 100644 --- a/src/gui/widgets/TabWidget.cpp +++ b/src/gui/widgets/TabWidget.cpp @@ -200,10 +200,9 @@ void TabWidget::resizeEvent( QResizeEvent * ) { if (!m_resizable) { - for ( widgetStack::iterator it = m_widgets.begin(); - it != m_widgets.end(); ++it ) + for (const auto& widget : m_widgets) { - ( *it ).w->setFixedSize( width() - 4, height() - m_tabbarHeight ); + widget.w->setFixedSize(width() - 4, height() - m_tabbarHeight); } } } @@ -320,11 +319,10 @@ QSize TabWidget::minimumSizeHint() const if (m_resizable) { int maxWidth = 0, maxHeight = 0; - for ( widgetStack::const_iterator it = m_widgets.begin(); - it != m_widgets.end(); ++it ) + for (const auto& widget : m_widgets) { - maxWidth = std::max(maxWidth, it->w->minimumSizeHint().width()); - maxHeight = std::max(maxHeight, it->w->minimumSizeHint().height()); + maxWidth = std::max(maxWidth, widget.w->minimumSizeHint().width()); + maxHeight = std::max(maxHeight, widget.w->minimumSizeHint().height()); } // "-1" : // in "addTab", under "Position tab's window", the widget is @@ -342,11 +340,10 @@ QSize TabWidget::sizeHint() const if (m_resizable) { int maxWidth = 0, maxHeight = 0; - for ( widgetStack::const_iterator it = m_widgets.begin(); - it != m_widgets.end(); ++it ) + for (const auto& widget : m_widgets) { - maxWidth = std::max(maxWidth, it->w->sizeHint().width()); - maxHeight = std::max(maxHeight, it->w->sizeHint().height()); + maxWidth = std::max(maxWidth, widget.w->sizeHint().width()); + maxHeight = std::max(maxHeight, widget.w->sizeHint().height()); } // "-1" : // in "addTab", under "Position tab's window", the widget is diff --git a/src/tracks/InstrumentTrack.cpp b/src/tracks/InstrumentTrack.cpp index c4ba36f33..0e75c990a 100644 --- a/src/tracks/InstrumentTrack.cpp +++ b/src/tracks/InstrumentTrack.cpp @@ -621,10 +621,9 @@ void InstrumentTrack::setName( const QString & _new_name ) void InstrumentTrack::updateBaseNote() { Engine::audioEngine()->requestChangeInModel(); - for( NotePlayHandleList::Iterator it = m_processHandles.begin(); - it != m_processHandles.end(); ++it ) + for (const auto& processHandle : m_processHandles) { - ( *it )->setFrequencyUpdate(); + processHandle->setFrequencyUpdate(); } Engine::audioEngine()->doneChangeInModel(); } @@ -711,10 +710,9 @@ bool InstrumentTrack::play( const TimePos & _start, const fpp_t _frames, } // Handle automation: detuning - for( NotePlayHandleList::Iterator it = m_processHandles.begin(); - it != m_processHandles.end(); ++it ) + for (const auto& processHandle : m_processHandles) { - ( *it )->processTimePos( _start ); + processHandle->processTimePos(_start); } if ( clips.size() == 0 ) @@ -725,14 +723,12 @@ bool InstrumentTrack::play( const TimePos & _start, const fpp_t _frames, bool played_a_note = false; // will be return variable - for( clipVector::Iterator it = clips.begin(); it != clips.end(); ++it ) + for (const auto& clip : clips) { - auto c = dynamic_cast(*it); + auto c = dynamic_cast(clip); // everything which is not a MIDI clip won't be played // A MIDI clip playing in the Piano Roll window will always play - if(c == nullptr || - (Engine::getSong()->playMode() != Song::Mode_PlayMidiClip - && (*it)->isMuted())) + if (c == nullptr || (Engine::getSong()->playMode() != Song::Mode_PlayMidiClip && clip->isMuted())) { continue; } diff --git a/src/tracks/MidiClip.cpp b/src/tracks/MidiClip.cpp index 5c5322796..e5bff8b6f 100644 --- a/src/tracks/MidiClip.cpp +++ b/src/tracks/MidiClip.cpp @@ -68,9 +68,9 @@ MidiClip::MidiClip( const MidiClip& other ) : m_clipType( other.m_clipType ), m_steps( other.m_steps ) { - for( NoteVector::ConstIterator it = other.m_notes.begin(); it != other.m_notes.end(); ++it ) + for (const auto& note : other.m_notes) { - m_notes.push_back( new Note( **it ) ); + m_notes.push_back(new Note(*note)); } init(); @@ -93,10 +93,9 @@ MidiClip::~MidiClip() { emit destroyedMidiClip( this ); - for( NoteVector::Iterator it = m_notes.begin(); - it != m_notes.end(); ++it ) + for (const auto& note : m_notes) { - delete *it; + delete note; } m_notes.clear(); @@ -110,16 +109,16 @@ void MidiClip::resizeToFirstTrack() // Resize this track to be the same as existing tracks in the pattern const TrackContainer::TrackList & tracks = m_instrumentTrack->trackContainer()->tracks(); - for(unsigned int trackID = 0; trackID < tracks.size(); ++trackID) + for (const auto& track : tracks) { - if(tracks.at(trackID)->type() == Track::InstrumentTrack) + if (track->type() == Track::InstrumentTrack) { - if(tracks.at(trackID) != m_instrumentTrack) + if (track != m_instrumentTrack) { unsigned int currentClip = m_instrumentTrack-> getClips().indexOf(this); m_steps = static_cast - (tracks.at(trackID)->getClip(currentClip)) + (track->getClip(currentClip)) ->m_steps; } break; @@ -154,13 +153,11 @@ void MidiClip::updateLength() tick_t max_length = TimePos::ticksPerBar(); - for( NoteVector::ConstIterator it = m_notes.begin(); - it != m_notes.end(); ++it ) + for (const auto& note : m_notes) { - if( ( *it )->length() > 0 ) + if (note->length() > 0) { - max_length = qMax( max_length, - ( *it )->endPos() ); + max_length = qMax(max_length, note->endPos()); } } changeLength( TimePos( max_length ).nextFullBar() * @@ -175,13 +172,11 @@ TimePos MidiClip::beatClipLength() const { tick_t max_length = TimePos::ticksPerBar(); - for( NoteVector::ConstIterator it = m_notes.begin(); - it != m_notes.end(); ++it ) + for (const auto& note : m_notes) { - if( ( *it )->length() < 0 ) + if (note->length() < 0) { - max_length = qMax( max_length, - ( *it )->pos() + 1 ); + max_length = qMax(max_length, note->pos() + 1); } } @@ -247,13 +242,11 @@ void MidiClip::removeNote( Note * _note_to_del ) Note * MidiClip::noteAtStep( int _step ) { - for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end(); - ++it ) + for (const auto& note : m_notes) { - if( ( *it )->pos() == TimePos::stepPosition( _step ) - && ( *it )->length() < 0 ) + if (note->pos() == TimePos::stepPosition(_step) && note->length() < 0) { - return *it; + return note; } } return nullptr; @@ -272,10 +265,9 @@ void MidiClip::rearrangeAllNotes() void MidiClip::clearNotes() { instrumentTrack()->lock(); - for( NoteVector::Iterator it = m_notes.begin(); it != m_notes.end(); - ++it ) + for (const auto& note : m_notes) { - delete *it; + delete note; } m_notes.clear(); instrumentTrack()->unlock(); @@ -322,10 +314,8 @@ void MidiClip::splitNotes(NoteVector notes, TimePos pos) addJournalCheckPoint(); - for (int i = 0; i < notes.size(); ++i) + for (const auto& note : notes) { - Note* note = notes.at(i); - int leftLength = pos.getTicks() - note->pos(); int rightLength = note->length() - leftLength; @@ -405,10 +395,9 @@ void MidiClip::saveSettings( QDomDocument & _doc, QDomElement & _this ) _this.setAttribute( "steps", m_steps ); // now save settings of all notes - for( NoteVector::Iterator it = m_notes.begin(); - it != m_notes.end(); ++it ) + for (const auto& note : m_notes) { - ( *it )->saveState( _doc, _this ); + note->saveState( _doc, _this ); } } @@ -582,10 +571,9 @@ void MidiClip::updatePatternTrack() bool MidiClip::empty() { - for( NoteVector::ConstIterator it = m_notes.begin(); - it != m_notes.end(); ++it ) + for (const auto& note : m_notes) { - if( ( *it )->length() != 0 ) + if (note->length() != 0) { return false; } @@ -599,13 +587,11 @@ bool MidiClip::empty() void MidiClip::changeTimeSignature() { TimePos last_pos = TimePos::ticksPerBar() - 1; - for( NoteVector::ConstIterator cit = m_notes.begin(); - cit != m_notes.end(); ++cit ) + for (const auto& note : m_notes) { - if( ( *cit )->length() < 0 && ( *cit )->pos() > last_pos ) + if (note->length() < 0 && note->pos() > last_pos) { - last_pos = ( *cit )->pos()+TimePos::ticksPerBar() / - TimePos::stepsPerBar(); + last_pos = note->pos() + TimePos::ticksPerBar() / TimePos::stepsPerBar(); } } last_pos = last_pos.nextFullBar() * TimePos::ticksPerBar(); diff --git a/src/tracks/PatternTrack.cpp b/src/tracks/PatternTrack.cpp index f2369e15b..9fcc2c831 100644 --- a/src/tracks/PatternTrack.cpp +++ b/src/tracks/PatternTrack.cpp @@ -109,13 +109,12 @@ bool PatternTrack::play( const TimePos & _start, const fpp_t _frames, TimePos lastPosition; TimePos lastLen; - for( clipVector::iterator it = clips.begin(); it != clips.end(); ++it ) + for (const auto& clip : clips) { - if( !( *it )->isMuted() && - ( *it )->startPosition() >= lastPosition ) + if (!clip->isMuted() && clip->startPosition() >= lastPosition) { - lastPosition = ( *it )->startPosition(); - lastLen = ( *it )->length(); + lastPosition = clip->startPosition(); + lastLen = clip->length(); } } @@ -181,15 +180,11 @@ void PatternTrack::loadTrackSpecificSettings(const QDomElement& _this) { const int src = _this.attribute("sourcepattern").toInt(); const int dst = s_infoMap[this]; - TrackContainer::TrackList tl = - Engine::patternStore()->tracks(); // copy clips of all tracks from source pattern (at bar "src") to destination // clips (which are created if they do not exist yet) - for( TrackContainer::TrackList::iterator it = tl.begin(); - it != tl.end(); ++it ) + for (const auto& track : Engine::patternStore()->tracks()) { - Clip::copyStateTo( ( *it )->getClip( src ), - ( *it )->getClip( dst ) ); + Clip::copyStateTo(track->getClip(src), track->getClip(dst)); } setName( tr( "Clone of %1" ).arg( _this.parentNode().toElement().attribute( "name" ) ) ); diff --git a/src/tracks/SampleTrack.cpp b/src/tracks/SampleTrack.cpp index 099dbdab6..af5cbef6d 100644 --- a/src/tracks/SampleTrack.cpp +++ b/src/tracks/SampleTrack.cpp @@ -135,9 +135,9 @@ bool SampleTrack::play( const TimePos & _start, const fpp_t _frames, setPlaying(nowPlaying); } - for( clipVector::Iterator it = clips.begin(); it != clips.end(); ++it ) + for (const auto& clip : clips) { - auto st = dynamic_cast(*it); + auto st = dynamic_cast(clip); if( !st->isMuted() ) { PlayHandle* handle; From 8459d6d679650e3480a100a56ea93f6c417d6156 Mon Sep 17 00:00:00 2001 From: saker Date: Fri, 30 Sep 2022 22:28:44 -0400 Subject: [PATCH 33/55] Fix regression from #6481 (#6522) Fix bug that shows only one effect in the effect chain --- src/gui/EffectRackView.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/EffectRackView.cpp b/src/gui/EffectRackView.cpp index 27da96877..75cac67dc 100644 --- a/src/gui/EffectRackView.cpp +++ b/src/gui/EffectRackView.cpp @@ -165,6 +165,7 @@ void EffectRackView::update() view_map[i] = true; break; } + ++i; } if( i >= m_effectViews.size() ) { From 6ae075edf3c052a923074b46ae1115718a621acd Mon Sep 17 00:00:00 2001 From: Rossmaxx <74815851+Rossmaxx@users.noreply.github.com> Date: Sat, 1 Oct 2022 10:43:35 +0530 Subject: [PATCH 34/55] Fix Visual Studio 2022 detection (#6520) Adds Visual Studio 2022 detection to DetectMachine --- cmake/modules/DetectMachine.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/modules/DetectMachine.cmake b/cmake/modules/DetectMachine.cmake index 8ac7dacaa..388efeb82 100644 --- a/cmake/modules/DetectMachine.cmake +++ b/cmake/modules/DetectMachine.cmake @@ -63,7 +63,10 @@ IF(WIN32) MESSAGE(WARNING "Unknown target architecture: ${MSVC_TARGET_PLATFORM}") ENDIF() - IF(MSVC_VER VERSION_GREATER 19.20 OR MSVC_VER VERSION_EQUAL 19.20) + IF(MSVC_VER VERSION_GREATER 19.30 OR MSVC_VER VERSION_EQUAL 19.30) + SET(LMMS_MSVC_GENERATOR "Visual Studio 17 2022") + SET(LMMS_MSVC_YEAR 2022) + ELSEIF(MSVC_VER VERSION_GREATER 19.20 OR MSVC_VER VERSION_EQUAL 19.20) SET(LMMS_MSVC_GENERATOR "Visual Studio 16 2019") SET(LMMS_MSVC_YEAR 2019) # Qt only provides binaries for MSVC 2017, but 2019 is binary compatible ELSEIF(MSVC_VER VERSION_GREATER 19.10 OR MSVC_VER VERSION_EQUAL 19.10) From a57265cf8dad3c341793e87177620b1531589941 Mon Sep 17 00:00:00 2001 From: Michael Fulghum <83775891+mrf7777@users.noreply.github.com> Date: Tue, 4 Oct 2022 00:43:23 -0500 Subject: [PATCH 35/55] Limit height of while position line to height of all tracks (#6509) * Position line height fits all tracks when line is moved or updated * Refactor track height calculation; create connection to update position line height --- include/TrackContainerView.h | 4 ++-- src/gui/editors/SongEditor.cpp | 7 +++++-- src/gui/editors/TrackContainerView.cpp | 16 +++++++++++++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index 116fd68f9..444420d98 100644 --- a/include/TrackContainerView.h +++ b/include/TrackContainerView.h @@ -148,6 +148,7 @@ public: return "trackcontainerview"; } + unsigned int totalHeightOfTracks() const; RubberBand *rubberBand() const; @@ -206,10 +207,9 @@ private: RubberBand * m_rubberBand; - - signals: void positionChanged( const lmms::TimePos & _pos ); + void tracksRealigned(); } ; diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 330216e43..5fb11ee32 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -98,6 +98,9 @@ SongEditor::SongEditor( Song * song ) : connect( m_timeLine, SIGNAL(selectionFinished()), this, SLOT(stopRubberBand())); + // when tracks realign, adjust height of position line + connect(this, &TrackContainerView::tracksRealigned, this, &SongEditor::updatePositionLine); + m_positionLine = new PositionLine(this); static_cast( layout() )->insertWidget( 1, m_timeLine ); @@ -820,7 +823,7 @@ void SongEditor::updatePosition( const TimePos & t ) m_positionLine->hide(); } - m_positionLine->setFixedHeight( height() ); + updatePositionLine(); } @@ -828,7 +831,7 @@ void SongEditor::updatePosition( const TimePos & t ) void SongEditor::updatePositionLine() { - m_positionLine->setFixedHeight( height() ); + m_positionLine->setFixedHeight(totalHeightOfTracks()); } diff --git a/src/gui/editors/TrackContainerView.cpp b/src/gui/editors/TrackContainerView.cpp index 966228ac8..351fe8295 100644 --- a/src/gui/editors/TrackContainerView.cpp +++ b/src/gui/editors/TrackContainerView.cpp @@ -263,6 +263,8 @@ void TrackContainerView::realignTracks() trackView->show(); trackView->update(); } + + emit tracksRealigned(); } @@ -487,7 +489,19 @@ void TrackContainerView::scrollArea::wheelEvent( QWheelEvent * _we ) } + + +unsigned int TrackContainerView::totalHeightOfTracks() const +{ + unsigned int heightSum = 0; + for (auto & trackView : m_trackViews) + { + heightSum += trackView->getTrack()->getHeight(); + } + return heightSum; +} + } // namespace gui -} // namespace lmms \ No newline at end of file +} // namespace lmms From a0e8db37f0a1ba942ee7c4857c8283e92e931192 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 10 Oct 2022 03:02:08 +0200 Subject: [PATCH 36/55] Fix blank lines in language dropdown menu (#6512) Discards invalid languages from language list and falls back to English if there is no native language name. --- src/gui/modals/SetupDialog.cpp | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/gui/modals/SetupDialog.cpp b/src/gui/modals/SetupDialog.cpp index d29608653..5140a63b5 100644 --- a/src/gui/modals/SetupDialog.cpp +++ b/src/gui/modals/SetupDialog.cpp @@ -264,11 +264,22 @@ SetupDialog::SetupDialog(ConfigTabs tab_to_open) : QStringList fileNames = dir.entryList(QStringList("*.qm")); for(int i = 0; i < fileNames.size(); ++i) { - // Get locale extracted by filename. + // Extract ISO-639 language code from filename fileNames[i].truncate(fileNames[i].lastIndexOf('.')); + // Skip invalid language codes + QLocale locale(fileNames[i]); + if (locale.language() == QLocale::C) + { + continue; + } + // Display the native language name or fallback to the English name + QString langName = locale.nativeLanguageName(); + if (langName.isEmpty()) + { + langName = QLocale::languageToString(locale.language()); + } m_languages.append(fileNames[i]); - QString lang = QLocale(m_languages.last()).nativeLanguageName(); - changeLang->addItem(lang); + changeLang->addItem(langName); } // If language unset, fallback to system language when available. @@ -1352,4 +1363,4 @@ void SetupDialog::showRestartWarning() } -} // namespace lmms::gui \ No newline at end of file +} // namespace lmms::gui From 6088ac6102cc0a0c9552ebe123db8cd9ae8c2e41 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 10 Oct 2022 08:30:46 +0200 Subject: [PATCH 37/55] Support building AppImage on non-ubuntu systems (#6510) * Use uname -m instead of uname -p and arch * Various logging improvements Co-authored-by: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> --- .github/workflows/build.yml | 3 +- cmake/linux/package_linux.sh.in | 71 ++++++++++++++++++++------------- 2 files changed, 44 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b28f9690c..b51857402 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,8 +50,7 @@ jobs: - name: Package run: | cmake --build build --target install - cmake --build build --target appimage \ - || (cat build/appimage.log && false) + cmake --build build --target appimage - name: Upload artifacts uses: actions/upload-artifact@v3 with: diff --git a/cmake/linux/package_linux.sh.in b/cmake/linux/package_linux.sh.in index a1f9ff865..89e500060 100644 --- a/cmake/linux/package_linux.sh.in +++ b/cmake/linux/package_linux.sh.in @@ -6,9 +6,6 @@ # Notes: Will attempt to fetch linuxdeployqt automatically (x86_64 only) # See Also: https://github.com/probonopd/linuxdeployqt/blob/master/BUILDING.md -set -e - -LINUXDEPLOYQT="@CMAKE_BINARY_DIR@/linuxdeployqt" VERBOSITY=2 # 3=debug LOGFILE="@CMAKE_BINARY_DIR@/appimage.log" APPDIR="@CMAKE_BINARY_DIR@/@PROJECT_NAME_UCASE@.AppDir/" @@ -40,8 +37,21 @@ function skipped { echo -e " ${PLAIN}[${YELLOW}skipped${PLAIN}] ${1}" } +# Exit with error message if any command fails +trap "error 'Failed to generate AppImage'; exit 1" ERR + +# Run a command silently, but print output if it fails +function run_and_log { + echo -e "\n\n>>>>> $1" >> "$LOGFILE" + output="$("$@" 2>&1)" + status=$? + echo "$output" >> "$LOGFILE" + [[ $status != 0 ]] && echo "$output" + return $status +} + # Blindly assume system arch is appimage arch -ARCH=$(arch) +ARCH=$(uname -m) export ARCH # Check for problematic install locations @@ -50,35 +60,39 @@ if [ "$INSTALL" == "/usr/local" ] || [ "$INSTALL" == "/usr" ] ; then error "Incompatible CMAKE_INSTALL_PREFIX for creating AppImage: @CMAKE_INSTALL_PREFIX@" fi -echo -e "\nWriting verbose output to \"${LOGFILE}\"" - # Ensure linuxdeployqt uses the same qmake version as cmake -PATH="$(pwd -P)/squashfs-root/usr/bin:$(dirname "@QT_QMAKE_EXECUTABLE@")":$PATH +PATH="$(dirname "@QT_QMAKE_EXECUTABLE@"):$PATH" export PATH +# Use linuxdeployqt from env or in PATH +[[ $LINUXDEPLOYQT ]] || LINUXDEPLOYQT="$(which linuxdeployqt 2>/dev/null)" || true +[[ $APPIMAGETOOL ]] || APPIMAGETOOL="$(which appimagetool 2>/dev/null)" || true + # Fetch portable linuxdeployqt if not in PATH -APPIMAGETOOL="squashfs-root/usr/bin/appimagetool" -echo -e "\nDownloading linuxdeployqt to ${LINUXDEPLOYQT}..." -if env -i which linuxdeployqt > /dev/null 2>&1; then - skipped "System already provides this utility" -else - filename="linuxdeployqt-continuous-$(uname -p).AppImage" +if [[ -z $LINUXDEPLOYQT || -z $APPIMAGETOOL ]]; then + filename="linuxdeployqt-continuous-$ARCH.AppImage" url="https://github.com/probonopd/linuxdeployqt/releases/download/continuous/$filename" - down_file="$(pwd)/$filename" - if [ ! -f "$LINUXDEPLOYQT" ]; then - ln -s "$down_file" "$LINUXDEPLOYQT" - fi - echo " [.......] Downloading ($(uname -p)): ${url}" - wget -N -q "$url" || (rm "$filename" && false) - chmod +x "$LINUXDEPLOYQT" - success "Downloaded $LINUXDEPLOYQT" + echo " [.......] Downloading: ${url}" + wget -N -q "$url" && err=0 || err=$? + case "$err" in + 0) success "Downloaded $PWD/$filename" ;; + # 8 == server issued 4xx error + 8) error "Download failed (perhaps no package available for $ARCH)" ;; + *) error "Download failed" ;; + esac + # Extract AppImage and replace LINUXDEPLOYQT variable with extracted binary # to support systems without fuse # Also, we need to set LD_LIBRARY_PATH, but linuxdepoyqt's AppRun unsets it # See https://github.com/probonopd/linuxdeployqt/pull/370/ - "$LINUXDEPLOYQT" --appimage-extract > /dev/null 2>&1 - LINUXDEPLOYQT="squashfs-root/usr/bin/linuxdeployqt" - success "Extracted $APPIMAGETOOL" + chmod +x "$filename" + ./"$filename" --appimage-extract >/dev/null + success "Extracted $filename" + + # Use the extracted linuxdeployqt and appimagetool + PATH="$(pwd -P)/squashfs-root/usr/bin:$PATH" + [[ $LINUXDEPLOYQT ]] || LINUXDEPLOYQT="$(which linuxdeployqt)" + [[ $APPIMAGETOOL ]] || APPIMAGETOOL="$(which appimagetool)" fi # Make skeleton AppDir @@ -149,12 +163,14 @@ executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/imbeq_1197. executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1193.so" executables="${executables} -executable=${APPDIR}usr/lib/lmms/ladspa/pitch_scale_1194.so" +echo -e "\nWriting verbose output to \"${LOGFILE}\"" +echo -n > "$LOGFILE" + # Bundle both qt and non-qt dependencies into appimage format echo -e "\nBundling and relinking system dependencies..." -echo -e ">>>>> linuxdeployqt" > "$LOGFILE" # shellcheck disable=SC2086 -"$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP >> "$LOGFILE" 2>&1 +run_and_log "$LINUXDEPLOYQT" "$DESKTOPFILE" $executables -bundle-non-qt-libs -verbose=$VERBOSITY $STRIP success "Bundled and relinked dependencies" # Link to original location so lmms can find them @@ -187,8 +203,7 @@ ln -sr "${APPDIR}/usr/bin/lmms" "${APPDIR}/AppRun" # Create AppImage echo -e "\nFinishing the AppImage..." -echo -e "\n\n>>>>> appimagetool" >> "$LOGFILE" -"$APPIMAGETOOL" "${APPDIR}" "@APPIMAGE_FILE@" >> "$LOGFILE" 2>&1 +run_and_log "$APPIMAGETOOL" "${APPDIR}" "@APPIMAGE_FILE@" success "Created @APPIMAGE_FILE@" echo -e "\nFinished" From 993c09fd4b238ea5e719942a7a68545841d822b0 Mon Sep 17 00:00:00 2001 From: Johannes Lorenz <1042576+JohannesLorenz@users.noreply.github.com> Date: Wed, 2 Nov 2022 23:17:57 +0100 Subject: [PATCH 38/55] Fix CI error: fatal: transport 'file' not allowed (#6557) --- tests/scripted/verify | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/scripted/verify b/tests/scripted/verify index 4072aaf9f..3f6d60103 100755 --- a/tests/scripted/verify +++ b/tests/scripted/verify @@ -6,10 +6,12 @@ import tempfile import os -def set_git_identity(): +def set_git_config(): """Set local git identity, but only in local repo (to not overwrite user settings)""" + """Also, fix git issue: fatal: transport 'file' not allowed""" subprocess.run(['git', 'config', 'user.name', 'James Bond']) subprocess.run(['git', 'config', 'user.email', '007@sis.gov.uk']) + subprocess.run(['git', 'config', '--global', 'protocol.file.allow', 'always']) def create_file(filename: str, file_content: str): @@ -31,7 +33,7 @@ class ScriptTest(): # prerequirements Path('data/themes').mkdir(parents=True) subprocess.run(['git', 'init', '-b', 'main'], check=True) - set_git_identity() + set_git_config() subprocess.run(['git', 'submodule', 'add', '../../carla', 'plugins/CarlaBase/carla'], check=True) create_file('src/core/classes.cpp', 'namespace lmms {\nclass TestClass\n}') create_file('debian/lmms-common.docs', '') @@ -87,7 +89,7 @@ with tempfile.TemporaryDirectory() as tmpdir: Path('carla').mkdir() os.chdir('carla') subprocess.run(['git', 'init', '-b', 'main'], check=True) - set_git_identity() + set_git_config() create_file('README.md', 'hello world') subprocess.run(['git', 'commit', '-m', 'Initial commit'], check=True) os.chdir('..') From 8bf86573f610c4bd95298f67ae1f64da1b746494 Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Sat, 5 Nov 2022 15:42:33 -0700 Subject: [PATCH 39/55] Fix master pitch behavior to transpose instead of detune (#6544) --- src/core/NotePlayHandle.cpp | 12 ++++++------ src/gui/editors/SongEditor.cpp | 8 ++++---- src/gui/instrument/InstrumentMiscView.cpp | 7 ++++--- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/core/NotePlayHandle.cpp b/src/core/NotePlayHandle.cpp index 06d584a14..e87637476 100644 --- a/src/core/NotePlayHandle.cpp +++ b/src/core/NotePlayHandle.cpp @@ -527,13 +527,13 @@ void NotePlayHandle::updateFrequency() if (m_instrumentTrack->m_microtuner.enabled()) { // custom key mapping and scale: get frequency from the microtuner - const float detuneMaster = detune + masterPitch; + const auto transposedKey = key() + masterPitch; - if (m_instrumentTrack->isKeyMapped(key())) + if (m_instrumentTrack->isKeyMapped(transposedKey)) { - const auto frequency = m_instrumentTrack->m_microtuner.keyToFreq(key(), baseNote); - m_frequency = frequency * powf(2.f, (detuneMaster + instrumentPitch / 100) / 12.f); - m_unpitchedFrequency = frequency * powf(2.f, detuneMaster / 12.f); + const auto frequency = m_instrumentTrack->m_microtuner.keyToFreq(transposedKey, baseNote); + m_frequency = frequency * powf(2.f, (detune + instrumentPitch / 100) / 12.f); + m_unpitchedFrequency = frequency * powf(2.f, detune / 12.f); } else { @@ -668,4 +668,4 @@ void NotePlayHandleManager::free() } -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/src/gui/editors/SongEditor.cpp b/src/gui/editors/SongEditor.cpp index 5fb11ee32..40be52319 100644 --- a/src/gui/editors/SongEditor.cpp +++ b/src/gui/editors/SongEditor.cpp @@ -184,14 +184,14 @@ SongEditor::SongEditor( Song * song ) : master_pitch_lbl->setPixmap( embed::getIconPixmap( "master_pitch" ) ); master_pitch_lbl->setFixedHeight( 64 ); - m_masterPitchSlider = new AutomatableSlider( tb, tr( "Master pitch" ) ); + m_masterPitchSlider = new AutomatableSlider( tb, tr( "Global transposition" ) ); m_masterPitchSlider->setModel( &m_song->m_masterPitchModel ); m_masterPitchSlider->setOrientation( Qt::Vertical ); m_masterPitchSlider->setPageStep( 1 ); m_masterPitchSlider->setTickPosition( QSlider::TicksLeft ); m_masterPitchSlider->setFixedSize( 26, 60 ); m_masterPitchSlider->setTickInterval( 12 ); - m_masterPitchSlider->setToolTip(tr("Master pitch")); + m_masterPitchSlider->setToolTip(tr("Global transposition")); connect( m_masterPitchSlider, SIGNAL(logicValueChanged(int)), this, SLOT(setMasterPitch(int))); connect( m_masterPitchSlider, SIGNAL(sliderPressed()), this, @@ -202,7 +202,7 @@ SongEditor::SongEditor( Song * song ) : SLOT(hideMasterPitchFloat())); m_mpsStatus = new TextFloat; - m_mpsStatus->setTitle( tr( "Master pitch" ) ); + m_mpsStatus->setTitle( tr( "Global transposition" ) ); m_mpsStatus->setPixmap( embed::getIconPixmap( "master_pitch" ) ); getGUI()->mainWindow()->addWidgetToToolBar( master_pitch_lbl ); @@ -723,7 +723,7 @@ void SongEditor::showMasterPitchFloat( void ) void SongEditor::updateMasterPitchFloat( int new_val ) { - m_mpsStatus->setText( tr( "Value: %1 semitones").arg( new_val ) ); + m_mpsStatus->setText( tr( "Value: %1 keys").arg( new_val ) ); } diff --git a/src/gui/instrument/InstrumentMiscView.cpp b/src/gui/instrument/InstrumentMiscView.cpp index 400b3aa60..1b4f82333 100644 --- a/src/gui/instrument/InstrumentMiscView.cpp +++ b/src/gui/instrument/InstrumentMiscView.cpp @@ -47,14 +47,15 @@ InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) : layout->setMargin(5); // Master pitch toggle - m_pitchGroupBox = new GroupBox(tr("MASTER PITCH")); + m_pitchGroupBox = new GroupBox(tr("GLOBAL TRANSPOSITION")); m_pitchGroupBox->setModel(&it->m_useMasterPitchModel); layout->addWidget(m_pitchGroupBox); auto masterPitchLayout = new QHBoxLayout(m_pitchGroupBox); masterPitchLayout->setContentsMargins(8, 18, 8, 8); - auto tlabel = new QLabel(tr("Enables the use of master pitch")); + auto tlabel = new QLabel(tr("Enables the use of global transposition")); + tlabel->setWordWrap(true); tlabel->setFont(pointSize<8>(tlabel->font())); masterPitchLayout->addWidget(tlabel); @@ -91,4 +92,4 @@ InstrumentMiscView::InstrumentMiscView(InstrumentTrack *it, QWidget *parent) : } -} // namespace lmms::gui \ No newline at end of file +} // namespace lmms::gui From ae554501554dfbe379cb9d73ec3f480333a16a30 Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Sat, 5 Nov 2022 15:42:56 -0700 Subject: [PATCH 40/55] Make shifting notes by octaves respect microtuning (#6545) --- include/Microtuner.h | 1 + src/core/Microtuner.cpp | 13 ++++++++++++- src/gui/editors/PianoRoll.cpp | 15 ++++++++++++--- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/include/Microtuner.h b/include/Microtuner.h index 934739ff5..dff8f5773 100644 --- a/include/Microtuner.h +++ b/include/Microtuner.h @@ -54,6 +54,7 @@ public: float baseFreq() const; float keyToFreq(int key, int userBaseNote) const; + int octaveSize() const; QString nodeName() const override {return "microtuner";} void saveSettings(QDomDocument & document, QDomElement &element) override; diff --git a/src/core/Microtuner.cpp b/src/core/Microtuner.cpp index f8de21267..9c5ab871b 100644 --- a/src/core/Microtuner.cpp +++ b/src/core/Microtuner.cpp @@ -108,6 +108,17 @@ float Microtuner::keyToFreq(int key, int userBaseNote) const return middleFreq * intervals[scaleDegree].getRatio() * pow(octaveRatio, keymapOctave + scaleOctave); } +int Microtuner::octaveSize() const +{ + const int keymapSize = Engine::getSong()->getKeymap(currentKeymap())->getSize(); + if (keymapSize > 0) + { + return keymapSize; + } + + // Determine octave size from the scale if the keymap isn't in use. + return Engine::getSong()->getScale(currentScale())->getIntervals().size() - 1; +} /** * \brief Update scale name displayed in the microtuner scale list. @@ -170,4 +181,4 @@ void Microtuner::loadSettings(const QDomElement &element) } -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index bc1245615..92c5ba72a 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -1310,16 +1310,25 @@ void PianoRoll::keyPressEvent(QKeyEvent* ke) int direction = (ke->key() == Qt::Key_Up ? +1 : -1); if( ( ke->modifiers() & Qt::ControlModifier ) && m_action == ActionNone ) { - // shift selection up an octave + // shift selection by one octave // if nothing selected, shift _everything_ if (hasValidMidiClip()) { - shiftSemiTone( 12 * direction ); + // An octave could potentially be greater or less than twelve semitones if the microtuner is in use. + const auto microtuner = m_midiClip->instrumentTrack()->microtuner(); + if (microtuner->enabled()) + { + shiftSemiTone(microtuner->octaveSize() * direction); + } + else + { + shiftSemiTone(12 * direction); + } } } else if((ke->modifiers() & Qt::ShiftModifier) && m_action == ActionNone) { - // Move selected notes up by one semitone + // Move selected notes by one semitone if (hasValidMidiClip()) { shiftSemiTone( 1 * direction ); From edb379eafdb11021a51ede9265d51b7e8368769c Mon Sep 17 00:00:00 2001 From: Dalton Messmer <33463986+messmerd@users.noreply.github.com> Date: Sun, 6 Nov 2022 23:33:30 -0500 Subject: [PATCH 41/55] Fix pattern clip colors from pre-1.3 versions (#6563) --- src/core/PatternClip.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/core/PatternClip.cpp b/src/core/PatternClip.cpp index 7ea56cd48..9af9bda6a 100644 --- a/src/core/PatternClip.cpp +++ b/src/core/PatternClip.cpp @@ -83,19 +83,20 @@ void PatternClip::loadSettings(const QDomElement& element) toggleMute(); } - // for colors saved in 1.3-onwards - if( element.hasAttribute( "color" ) && !element.hasAttribute( "usestyle" ) ) + if (element.hasAttribute("color")) { - useCustomClipColor( true ); - setColor( element.attribute( "color" ) ); - } - - // for colors saved before 1.3 - else if(element.hasAttribute("color")) - { - setColor(QColor(element.attribute("color").toUInt())); - - // usestyle attribute is no longer used + if (!element.hasAttribute("usestyle")) + { + // for colors saved in 1.3-onwards + setColor(element.attribute("color")); + useCustomClipColor(true); + } + else + { + // for colors saved before 1.3 + setColor(QColor(element.attribute("color").toUInt())); + useCustomClipColor(element.attribute("usestyle").toUInt() == 0); + } } else { From 20baf96db345d8740d29fab6527f79cf33c80459 Mon Sep 17 00:00:00 2001 From: Martin Pavelek Date: Sat, 19 Nov 2022 17:16:44 +0100 Subject: [PATCH 42/55] Fix several issues raised at Transifex (#6568) Make strings independent on word order, fix capitalization and typos --- plugins/SpectrumAnalyzer/SaControlsDialog.cpp | 10 ++-- plugins/VstBase/VstPlugin.cpp | 50 ++++++++----------- src/gui/LfoControllerDialog.cpp | 33 +++++------- 3 files changed, 39 insertions(+), 54 deletions(-) diff --git a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp index 4a1cb8a79..c4fc431b1 100644 --- a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp +++ b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp @@ -240,7 +240,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) envelopeResolutionKnob->setModel(&controls->m_envelopeResolutionModel); envelopeResolutionKnob->setLabel(tr("Envelope res.")); envelopeResolutionKnob->setToolTip(tr("Increase envelope resolution for better details, decrease for better GUI performance.")); - envelopeResolutionKnob->setHintText(tr("Draw at most"), tr(" envelope points per pixel")); + envelopeResolutionKnob->setHintText(tr("Maximum number of envelope points drawn per pixel:"), ""); advanced_layout->addWidget(envelopeResolutionKnob, 0, 0, 1, 1, Qt::AlignCenter); // Spectrum graph resolution @@ -248,7 +248,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) spectrumResolutionKnob->setModel(&controls->m_spectrumResolutionModel); spectrumResolutionKnob->setLabel(tr("Spectrum res.")); spectrumResolutionKnob->setToolTip(tr("Increase spectrum resolution for better details, decrease for better GUI performance.")); - spectrumResolutionKnob->setHintText(tr("Draw at most"), tr(" spectrum points per pixel")); + spectrumResolutionKnob->setHintText(tr("Maximum number of spectrum points drawn per pixel:"), ""); advanced_layout->addWidget(spectrumResolutionKnob, 1, 0, 1, 1, Qt::AlignCenter); // Peak falloff speed @@ -272,7 +272,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) waterfallHeightKnob->setModel(&controls->m_waterfallHeightModel); waterfallHeightKnob->setLabel(tr("Waterfall height")); waterfallHeightKnob->setToolTip(tr("Increase to get slower scrolling, decrease to see fast transitions better. Warning: medium CPU usage.")); - waterfallHeightKnob->setHintText(tr("Keep"), tr(" lines")); + waterfallHeightKnob->setHintText(tr("Number of lines to keep:"), ""); advanced_layout->addWidget(waterfallHeightKnob, 0, 2, 1, 1, Qt::AlignCenter); processor->reallocateBuffers(); connect(&controls->m_waterfallHeightModel, &FloatModel::dataChanged, [=] {processor->reallocateBuffers();}); @@ -290,7 +290,7 @@ SaControlsDialog::SaControlsDialog(SaControls *controls, SaProcessor *processor) windowOverlapKnob->setModel(&controls->m_windowOverlapModel); windowOverlapKnob->setLabel(tr("Window overlap")); windowOverlapKnob->setToolTip(tr("Increase to prevent missing fast transitions arriving near FFT window edges. Warning: high CPU usage.")); - windowOverlapKnob->setHintText(tr("Each sample processed"), tr(" times")); + windowOverlapKnob->setHintText(tr("Number of times each sample is processed:"), ""); advanced_layout->addWidget(windowOverlapKnob, 0, 3, 1, 1, Qt::AlignCenter); // FFT zero padding @@ -365,4 +365,4 @@ QSize SaControlsDialog::sizeHint() const } -} // namespace lmms::gui \ No newline at end of file +} // namespace lmms::gui diff --git a/plugins/VstBase/VstPlugin.cpp b/plugins/VstBase/VstPlugin.cpp index 488931e6d..700a14ac7 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -504,20 +504,14 @@ QWidget *VstPlugin::editor() void VstPlugin::openPreset() { - - gui::FileDialog ofd( nullptr, tr( "Open Preset" ), "", - tr( "Vst Plugin Preset (*.fxp *.fxb)" ) ); - ofd.setFileMode( gui::FileDialog::ExistingFiles ); - if( ofd.exec () == QDialog::Accepted && - !ofd.selectedFiles().isEmpty() ) + gui::FileDialog ofd(nullptr, tr("Open Preset"), "", tr("VST Plugin Preset (*.fxp *.fxb)")); + ofd.setFileMode(gui::FileDialog::ExistingFiles); + if (ofd.exec() == QDialog::Accepted && !ofd.selectedFiles().isEmpty()) { lock(); - sendMessage( message( IdLoadPresetFile ). - addString( - QSTR_TO_STDSTR( - QDir::toNativeSeparators( ofd.selectedFiles()[0] ) ) ) - ); - waitForMessage( IdLoadPresetFile, true ); + sendMessage(message(IdLoadPresetFile).addString(QSTR_TO_STDSTR( + QDir::toNativeSeparators(ofd.selectedFiles()[0])))); + waitForMessage(IdLoadPresetFile, true); unlock(); } } @@ -585,32 +579,32 @@ void VstPlugin::savePreset() QString presName = currentProgramName().isEmpty() ? tr(": default") : currentProgramName(); presName.replace("\"", "'"); // QFileDialog unable to handle double quotes properly - gui::FileDialog sfd( nullptr, tr( "Save Preset" ), presName.section(": ", 1, 1) + tr(".fxp"), - tr( "Vst Plugin Preset (*.fxp *.fxb)" ) ); + 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 + if (p_name != "") // remember last directory { - sfd.setDirectory( QFileInfo( p_name ).absolutePath() ); + sfd.setDirectory(QFileInfo(p_name).absolutePath()); } - sfd.setAcceptMode( gui::FileDialog::AcceptSave ); - sfd.setFileMode( gui::FileDialog::AnyFile ); - if( sfd.exec () == QDialog::Accepted && - !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" ) + sfd.setAcceptMode(gui::FileDialog::AcceptSave); + sfd.setFileMode(gui::FileDialog::AnyFile); + if (sfd.exec() == QDialog::Accepted && !sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "") { QString fns = sfd.selectedFiles()[0]; p_name = fns; if ((fns.toUpper().indexOf(tr(".FXP")) == -1) && (fns.toUpper().indexOf(tr(".FXB")) == -1)) + { fns = fns + tr(".fxb"); - else fns = fns.left(fns.length() - 4) + (fns.right( 4 )).toLower(); + } + else + { + fns = fns.left(fns.length() - 4) + (fns.right(4)).toLower(); + } lock(); - sendMessage( message( IdSavePresetFile ). - addString( - QSTR_TO_STDSTR( - QDir::toNativeSeparators( fns ) ) ) - ); - waitForMessage( IdSavePresetFile, true ); + sendMessage(message(IdSavePresetFile).addString(QSTR_TO_STDSTR(QDir::toNativeSeparators(fns)))); + waitForMessage(IdSavePresetFile, true); unlock(); } } @@ -825,4 +819,4 @@ QString VstPlugin::embedMethod() const } -} // namespace lmms \ No newline at end of file +} // namespace lmms diff --git a/src/gui/LfoControllerDialog.cpp b/src/gui/LfoControllerDialog.cpp index 9e58d3e18..64602cd74 100644 --- a/src/gui/LfoControllerDialog.cpp +++ b/src/gui/LfoControllerDialog.cpp @@ -167,31 +167,22 @@ LfoControllerDialog::LfoControllerDialog( Controller * _model, QWidget * _parent m_waveBtnGrp->addButton( m_userWaveBtn ); auto x1 = new PixmapButton(this, nullptr); - x1->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y +7); - x1->setActiveGraphic( embed::getIconPixmap( - "lfo_x1_active" ) ); - x1->setInactiveGraphic( embed::getIconPixmap( - "lfo_x1_inactive" ) ); - x1->setToolTip( - tr( "Mutliply modulation frequency by 1" )); + x1->move(CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y + 7); + x1->setActiveGraphic(embed::getIconPixmap("lfo_x1_active")); + x1->setInactiveGraphic(embed::getIconPixmap("lfo_x1_inactive")); + x1->setToolTip(tr("Multiply modulation frequency by 1")); auto x100 = new PixmapButton(this, nullptr); - x100->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y - 8 ); - x100->setActiveGraphic( embed::getIconPixmap( - "lfo_x100_active" ) ); - x100->setInactiveGraphic( embed::getIconPixmap( - "lfo_x100_inactive" ) ); - x100->setToolTip( - tr( "Mutliply modulation frequency by 100" )); + x100->move(CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y - 8); + x100->setActiveGraphic(embed::getIconPixmap("lfo_x100_active")); + x100->setInactiveGraphic(embed::getIconPixmap("lfo_x100_inactive")); + x100->setToolTip(tr("Multiply modulation frequency by 100")); auto d100 = new PixmapButton(this, nullptr); - d100->move( CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y + 22 ); - d100->setActiveGraphic( embed::getIconPixmap( - "lfo_d100_active" ) ); - d100->setInactiveGraphic( embed::getIconPixmap( - "lfo_d100_inactive" ) ); - d100->setToolTip( - tr( "Divide modulation frequency by 100" )); + d100->move(CD_LFO_MULTIPLIER_X, CD_LFO_SHAPES_Y + 22); + d100->setActiveGraphic(embed::getIconPixmap("lfo_d100_active")); + d100->setInactiveGraphic(embed::getIconPixmap("lfo_d100_inactive")); + d100->setToolTip(tr("Divide modulation frequency by 100")); m_multiplierBtnGrp = new automatableButtonGroup( this ); m_multiplierBtnGrp->addButton( x1 ); From 17aa7dbef5f4b1dbf8c7c335ef6f2a7759600f21 Mon Sep 17 00:00:00 2001 From: saker Date: Sat, 10 Dec 2022 13:48:17 -0500 Subject: [PATCH 43/55] Fix unwanted scrolling when changing track name (#6583) --- src/gui/tracks/TrackLabelButton.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/tracks/TrackLabelButton.cpp b/src/gui/tracks/TrackLabelButton.cpp index b82c8cf6e..3f1b45871 100644 --- a/src/gui/tracks/TrackLabelButton.cpp +++ b/src/gui/tracks/TrackLabelButton.cpp @@ -105,6 +105,7 @@ void TrackLabelButton::renameFinished() { if( !( ConfigManager::inst()->value( "ui", "compacttrackbuttons" ).toInt() ) ) { + m_renameLineEdit->clearFocus(); m_renameLineEdit->hide(); if( m_renameLineEdit->text() != "" ) { From e92561265c573bd781b1f7a683f5639d660d8849 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Sun, 18 Dec 2022 18:04:37 +0000 Subject: [PATCH 44/55] Only rebuild translations when ts files change (#6566) --- data/locale/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/data/locale/CMakeLists.txt b/data/locale/CMakeLists.txt index 4ce666dcf..f7f9071e7 100644 --- a/data/locale/CMakeLists.txt +++ b/data/locale/CMakeLists.txt @@ -29,9 +29,14 @@ FOREACH(_ts_file ${lmms_LOCALES}) ADD_CUSTOM_TARGET(${_ts_target} COMMAND "${QT_LUPDATE_EXECUTABLE}" -locations none -no-obsolete -I ${CMAKE_SOURCE_DIR}/include/ ${LMMS_SRCS} ${LMMS_UIS} ${CMAKE_SOURCE_DIR}/plugins -ts "\"${_ts_file}\"" WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - ADD_CUSTOM_TARGET(${_qm_target} + add_custom_command( + OUTPUT "${_qm_file}" COMMAND "${QT_LRELEASE_EXECUTABLE}" "${_ts_file}" -qm "${_qm_file}" - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + MAIN_DEPENDENCY "${_ts_file}" + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + VERBATIM + ) + add_custom_target("${_qm_target}" DEPENDS "${_qm_file}") LIST(APPEND ts_targets "${_ts_target}") LIST(APPEND qm_targets "${_qm_target}") LIST(APPEND QM_FILES "${_qm_file}") From ff5f092a631af11a241739adb6f0841e29c6a24c Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Sun, 18 Dec 2022 18:37:53 +0000 Subject: [PATCH 45/55] Show pull request number in version string (#6565) --- CMakeLists.txt | 2 +- cmake/modules/VersionInfo.cmake | 40 +++++++++++++++++++++++++-------- 2 files changed, 32 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad419e2cb..dae43e573 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 3.8) +CMAKE_MINIMUM_REQUIRED(VERSION 3.9) PROJECT(lmms) diff --git a/cmake/modules/VersionInfo.cmake b/cmake/modules/VersionInfo.cmake index 9571514a6..6f4c371f1 100644 --- a/cmake/modules/VersionInfo.cmake +++ b/cmake/modules/VersionInfo.cmake @@ -3,6 +3,13 @@ IF(GIT_FOUND AND NOT FORCE_VERSION) SET(MAJOR_VERSION 0) SET(MINOR_VERSION 0) SET(PATCH_VERSION 0) + + # If this is a GitHub Actions pull request build, get the pull request + # number from the environment and add it to the build metadata + if("$ENV{GITHUB_REF}" MATCHES "refs/pull/([0-9]+)/merge") + list(APPEND BUILD_METADATA "pr${CMAKE_MATCH_1}") + endif() + # Look for git tag information (e.g. Tagged: "v1.0.0", Untagged: "v1.0.0-123-a1b2c3d") # Untagged format: [latest tag]-[number of commits]-[latest commit hash] EXECUTE_PROCESS( @@ -30,28 +37,43 @@ IF(GIT_FOUND AND NOT FORCE_VERSION) ENDIF() # 1 dash total: Dash in latest tag, no additional commits => pre-release IF(TAG_LIST_LENGTH EQUAL 2) + # Get the pre-release stage LIST(GET TAG_LIST 1 VERSION_STAGE) - SET(FORCE_VERSION "${FORCE_VERSION}-${VERSION_STAGE}") + list(APPEND PRERELEASE_DATA "${VERSION_STAGE}") # 2 dashes: Assume untagged with no dashes in latest tag name => stable + commits ELSEIF(TAG_LIST_LENGTH EQUAL 3) # Get the number of commits and latest commit hash LIST(GET TAG_LIST 1 EXTRA_COMMITS) LIST(GET TAG_LIST 2 COMMIT_HASH) - # Bump the patch version + list(APPEND PRERELEASE_DATA "${EXTRA_COMMITS}") + list(APPEND BUILD_METADATA "${COMMIT_HASH}") + # Bump the patch version, since a pre-release (as specified by the extra + # commits) compares lower than the main version alone MATH(EXPR PATCH_VERSION "${PATCH_VERSION}+1") - # Set the version to MAJOR.MINOR.PATCH-EXTRA_COMMITS+COMMIT_HASH - SET(FORCE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") - SET(FORCE_VERSION "${FORCE_VERSION}-${EXTRA_COMMITS}+${COMMIT_HASH}") + # Reassemble the main version using the new patch version + set(FORCE_VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${PATCH_VERSION}") # 3 dashes: Assume untagged with 1 dash in latest tag name => pre-release + commits ELSEIF(TAG_LIST_LENGTH EQUAL 4) - # Get pre-release stage, number of commits, and latest commit hash + # Get the pre-release stage, number of commits, and latest commit hash LIST(GET TAG_LIST 1 VERSION_STAGE) LIST(GET TAG_LIST 2 EXTRA_COMMITS) LIST(GET TAG_LIST 3 COMMIT_HASH) - # Set the version to MAJOR.MINOR.PATCH-VERSION_STAGE.EXTRA_COMMITS+COMMIT_HASH - SET(FORCE_VERSION "${FORCE_VERSION}-${VERSION_STAGE}") - SET(FORCE_VERSION "${FORCE_VERSION}.${EXTRA_COMMITS}+${COMMIT_HASH}") + list(APPEND PRERELEASE_DATA "${VERSION_STAGE}") + list(APPEND PRERELEASE_DATA "${EXTRA_COMMITS}") + list(APPEND BUILD_METADATA "${COMMIT_HASH}") ENDIF() + + # If there is any pre-release data, append it after a hyphen + if(PRERELEASE_DATA) + string(REPLACE ";" "." PRERELEASE_DATA "${PRERELEASE_DATA}") + set(FORCE_VERSION "${FORCE_VERSION}-${PRERELEASE_DATA}") + endif() + + # If there is any build metadata, append it after a plus + if(BUILD_METADATA) + string(REPLACE ";" "." BUILD_METADATA "${BUILD_METADATA}") + set(FORCE_VERSION "${FORCE_VERSION}+${BUILD_METADATA}") + endif() ENDIF() IF(FORCE_VERSION STREQUAL "internal") From edd759b51176b558f8acb20fc83555fba3ad28dd Mon Sep 17 00:00:00 2001 From: Veratil Date: Sun, 25 Dec 2022 22:13:09 -0600 Subject: [PATCH 46/55] Fix deprecated QString.sprintf with QString.arg --- include/Scale.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/Scale.h b/include/Scale.h index 3a92dd689..96159a53c 100644 --- a/include/Scale.h +++ b/include/Scale.h @@ -47,7 +47,7 @@ public: QString getString() const { if (m_denominator) {return QString::number(m_numerator) + "/" + QString::number(m_denominator);} - else {return QString().sprintf("%.4f", m_cents);} + else {return QString("%1").arg(m_cents, 0, 'f', 4);} } void saveSettings(QDomDocument &doc, QDomElement &element) override; From a876cf9d0058ed4c5e20d9b4cf713eec6a6aa086 Mon Sep 17 00:00:00 2001 From: saker Date: Fri, 30 Dec 2022 17:18:14 -0500 Subject: [PATCH 47/55] clang-tidy: Apply modernize-avoid-c-arrays everywhere (#6564) Co-authored-by: Dominic Clark Co-authored-by: Hyunjin Song --- include/DataFile.h | 8 -- include/InstrumentFunctions.h | 3 +- include/Oscillator.h | 2 +- include/PianoRoll.h | 2 +- include/ProjectRenderer.h | 2 +- plugins/Amplifier/Amplifier.cpp | 16 ++-- plugins/BassBooster/BassBooster.cpp | 2 +- plugins/Bitcrush/Bitcrush.cpp | 40 +++++----- plugins/Compressor/Compressor.cpp | 12 +-- .../Compressor/CompressorControlDialog.cpp | 10 +-- plugins/Delay/DelayEffect.cpp | 2 +- plugins/DualFilter/DualFilter.cpp | 10 +-- .../DynamicsProcessor/DynamicsProcessor.cpp | 10 +-- .../DynamicsProcessorControls.cpp | 2 +- plugins/Eq/EqEffect.cpp | 2 +- plugins/Flanger/FlangerEffect.cpp | 2 +- plugins/FreeBoy/FreeBoy.cpp | 6 +- plugins/LadspaEffect/LadspaEffect.cpp | 32 ++++---- plugins/MidiExport/MidiExport.cpp | 16 ++-- plugins/MidiImport/MidiImport.cpp | 46 ++++++------ plugins/Monstro/Monstro.cpp | 8 +- plugins/OpulenZ/OpulenZ.cpp | 38 +++++----- plugins/Organic/Organic.cpp | 74 +++++++++---------- plugins/Patman/Patman.cpp | 8 +- plugins/ReverbSC/ReverbSC.cpp | 24 +++--- plugins/Sid/SidInstrument.cpp | 44 +++++------ plugins/SpectrumAnalyzer/SaSpectrumView.cpp | 4 +- plugins/StereoEnhancer/StereoEnhancer.cpp | 14 ++-- plugins/TripleOscillator/TripleOscillator.cpp | 12 +-- plugins/Vestige/Vestige.cpp | 34 ++++----- plugins/VstEffect/VstEffectControls.cpp | 44 +++++------ plugins/WaveShaper/WaveShaper.cpp | 8 +- plugins/WaveShaper/WaveShaperControls.cpp | 4 +- plugins/Xpressive/ExprSynth.cpp | 16 ++-- src/core/DataFile.cpp | 32 +++++--- src/core/Instrument.cpp | 2 +- src/core/InstrumentFunctions.cpp | 9 ++- src/core/MixHelpers.cpp | 4 +- src/core/Oscillator.cpp | 8 +- src/core/PathUtil.cpp | 4 +- src/core/Piano.cpp | 2 +- src/core/ProjectRenderer.cpp | 22 +++--- src/core/SampleBuffer.cpp | 2 +- src/core/audio/AudioFileFlac.cpp | 10 +-- src/core/lv2/Lv2Proc.cpp | 10 +-- src/core/midi/MidiAlsaRaw.cpp | 4 +- src/core/midi/MidiAlsaSeq.cpp | 2 +- src/core/midi/MidiClient.cpp | 20 ++--- src/gui/LmmsStyle.cpp | 23 +++--- src/gui/editors/AutomationEditor.cpp | 4 +- src/gui/editors/PianoRoll.cpp | 8 +- src/gui/instrument/PianoView.cpp | 2 +- src/gui/modals/ExportProjectDialog.cpp | 8 +- src/gui/widgets/LedCheckBox.cpp | 2 +- 54 files changed, 369 insertions(+), 366 deletions(-) diff --git a/include/DataFile.h b/include/DataFile.h index 5eb61a932..fb8b2ae3e 100644 --- a/include/DataFile.h +++ b/include/DataFile.h @@ -143,14 +143,6 @@ private: void loadData( const QByteArray & _data, const QString & _sourceFile ); - - struct LMMS_EXPORT typeDescStruct - { - Type m_type; - QString m_name; - } ; - static typeDescStruct s_types[TypeCount]; - QString m_fileName; //!< The origin file name or "" if this DataFile didn't originate from a file QDomElement m_content; QDomElement m_head; diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index a349ddf9c..5dcb1114b 100644 --- a/include/InstrumentFunctions.h +++ b/include/InstrumentFunctions.h @@ -52,6 +52,7 @@ class InstrumentFunctionNoteStacking : public Model, public JournallingObject public: static const int MAX_CHORD_POLYPHONY = 13; + static const int NUM_CHORD_TABLES = 95; private: using ChordSemiTones = std::array; @@ -129,7 +130,7 @@ public: ChordSemiTones m_semiTones; }; - static Init s_initTable[]; + static std::array s_initTable; public: static const ChordTable & getInstance() diff --git a/include/Oscillator.h b/include/Oscillator.h index e9f64008c..8727ee39c 100644 --- a/include/Oscillator.h +++ b/include/Oscillator.h @@ -255,7 +255,7 @@ private: static fftwf_plan s_fftPlan; static fftwf_plan s_ifftPlan; static fftwf_complex * s_specBuf; - static float s_sampleBuffer[OscillatorConstants::WAVETABLE_LENGTH]; + static std::array s_sampleBuffer; static void generateSawWaveTable(int bands, sample_t* table, int firstBand = 1); static void generateTriangleWaveTable(int bands, sample_t* table, int firstBand = 1); diff --git a/include/PianoRoll.h b/include/PianoRoll.h index 60cf01e1d..c1973f407 100644 --- a/include/PianoRoll.h +++ b/include/PianoRoll.h @@ -343,7 +343,7 @@ private: static QPixmap * s_toolOpen; static QPixmap* s_toolKnife; - static PianoRollKeyTypes prKeyOrder[]; + static std::array prKeyOrder; static TextFloat * s_textFloat; diff --git a/include/ProjectRenderer.h b/include/ProjectRenderer.h index 75537ed69..2ca20569b 100644 --- a/include/ProjectRenderer.h +++ b/include/ProjectRenderer.h @@ -76,7 +76,7 @@ public: static QString getFileExtensionFromFormat( ExportFileFormats fmt ); - static const FileEncodeDevice fileEncodeDevices[]; + static const std::array fileEncodeDevices; public slots: void startProcessing(); diff --git a/plugins/Amplifier/Amplifier.cpp b/plugins/Amplifier/Amplifier.cpp index 3fb03d3d9..9344807c4 100644 --- a/plugins/Amplifier/Amplifier.cpp +++ b/plugins/Amplifier/Amplifier.cpp @@ -74,7 +74,7 @@ bool AmplifierEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) double outSum = 0.0; const float d = dryLevel(); const float w = wetLevel(); - + const ValueBuffer * volBuf = m_ampControls.m_volumeModel.valueBuffer(); const ValueBuffer * panBuf = m_ampControls.m_panModel.valueBuffer(); const ValueBuffer * leftBuf = m_ampControls.m_leftModel.valueBuffer(); @@ -83,8 +83,8 @@ bool AmplifierEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) for( fpp_t f = 0; f < frames; ++f ) { // qDebug( "offset %d, value %f", f, m_ampControls.m_volumeModel.value( f ) ); - - sample_t s[2] = { buf[f][0], buf[f][1] }; + + auto s = std::array{buf[f][0], buf[f][1]}; // vol knob if( volBuf ) @@ -99,8 +99,8 @@ bool AmplifierEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) } // convert pan values to left/right values - const float pan = panBuf - ? panBuf->value( f ) + const float pan = panBuf + ? panBuf->value( f ) : m_ampControls.m_panModel.value(); const float left1 = pan <= 0 ? 1.0 @@ -111,12 +111,12 @@ bool AmplifierEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) // second stage amplification const float left2 = leftBuf - ? leftBuf->value( f ) + ? leftBuf->value( f ) : m_ampControls.m_leftModel.value(); const float right2 = rightBuf - ? rightBuf->value( f ) + ? rightBuf->value( f ) : m_ampControls.m_rightModel.value(); - + s[0] *= left1 * left2 * 0.01; s[1] *= right1 * right2 * 0.01; diff --git a/plugins/BassBooster/BassBooster.cpp b/plugins/BassBooster/BassBooster.cpp index 77667c121..48e265911 100644 --- a/plugins/BassBooster/BassBooster.cpp +++ b/plugins/BassBooster/BassBooster.cpp @@ -102,7 +102,7 @@ bool BassBoosterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames m_bbFX.leftFX().setGain( gain ); m_bbFX.rightFX().setGain( gain); - sample_t s[2] = { buf[f][0], buf[f][1] }; + auto s = std::array{buf[f][0], buf[f][1]}; m_bbFX.nextSample( s[0], s[1] ); buf[f][0] = d * buf[f][0] + w * s[0]; diff --git a/plugins/Bitcrush/Bitcrush.cpp b/plugins/Bitcrush/Bitcrush.cpp index 68724eccd..963e970db 100644 --- a/plugins/Bitcrush/Bitcrush.cpp +++ b/plugins/Bitcrush/Bitcrush.cpp @@ -35,8 +35,8 @@ const int OS_RATE = 5; const float OS_RATIO = 1.0f / OS_RATE; const float CUTOFF_RATIO = 0.353553391f; const int SILENCEFRAMES = 10; -const float OS_RESAMPLE [5] = { 0.0001490062883964112, 0.1645978376763992, 0.6705063120704088, - 0.1645978376763992, 0.0001490062883964112 }; +const auto OS_RESAMPLE = std::array{0.0001490062883964112f, 0.1645978376763992f, 0.6705063120704088f, + 0.1645978376763992f, 0.0001490062883964112f }; extern "C" { @@ -65,13 +65,13 @@ BitcrushEffect::BitcrushEffect( Model * parent, const Descriptor::SubPluginFeatu m_buffer = MM_ALLOC( Engine::audioEngine()->framesPerPeriod() * OS_RATE ); m_filter.setLowpass( m_sampleRate * ( CUTOFF_RATIO * OS_RATIO ) ); m_needsUpdate = true; - + m_bitCounterL = 0.0f; m_bitCounterR = 0.0f; - + m_left = 0.0f; m_right = 0.0f; - + m_silenceCounter = 0; } @@ -125,7 +125,7 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) m_rateCoeffL = ( m_sampleRate * OS_RATE ) / ( rate - diff ); m_rateCoeffR = ( m_sampleRate * OS_RATE ) / ( rate + diff ); - + m_bitCounterL = 0.0f; m_bitCounterR = 0.0f; } @@ -147,9 +147,9 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) m_outClip = dbfsToAmp( m_controls.m_outClip.value() ); } m_needsUpdate = false; - + const float noiseAmt = m_controls.m_inNoise.value() * 0.01f; - + // read input buffer and write it to oversampled buffer if( m_rateEnabled ) // rate crushing enabled so do that { @@ -164,15 +164,15 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) if( m_bitCounterL > m_rateCoeffL ) { m_bitCounterL -= m_rateCoeffL; - m_left = m_depthEnabled - ? depthCrush( buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ) ) + m_left = m_depthEnabled + ? depthCrush( buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ) ) : buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ); } if( m_bitCounterR > m_rateCoeffR ) { m_bitCounterR -= m_rateCoeffR; - m_right = m_depthEnabled - ? depthCrush( buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ) ) + m_right = m_depthEnabled + ? depthCrush( buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ) ) : buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ); } } @@ -185,17 +185,17 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) for( int o = 0; o < OS_RATE; ++o ) { m_buffer[f * OS_RATE + o][0] = m_depthEnabled - ? depthCrush( buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ) ) + ? depthCrush( buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ) ) : buf[f][0] * m_inGain + noise( buf[f][0] * noiseAmt ); m_buffer[f * OS_RATE + o][1] = m_depthEnabled - ? depthCrush( buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ) ) + ? depthCrush( buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ) ) : buf[f][1] * m_inGain + noise( buf[f][1] * noiseAmt ); } } } - + // the oversampled buffer is now written, so filter it to reduce aliasing - + for( int f = 0; f < frames * OS_RATE; ++f ) { if( qMax( qAbs( m_buffer[f][0] ), qAbs( m_buffer[f][1] ) ) >= 1.0e-10f ) @@ -218,10 +218,10 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) } } } - - + + // now downsample and write it back to main buffer - + double outSum = 0.0; const float d = dryLevel(); const float w = wetLevel(); @@ -238,7 +238,7 @@ bool BitcrushEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) buf[f][1] = d * buf[f][1] + w * qBound( -m_outClip, rsum, m_outClip ) * m_outGain; outSum += buf[f][0]*buf[f][0] + buf[f][1]*buf[f][1]; } - + checkGate( outSum / frames ); return isRunning(); diff --git a/plugins/Compressor/Compressor.cpp b/plugins/Compressor/Compressor.cpp index 312a40d3d..92123ffd9 100755 --- a/plugins/Compressor/Compressor.cpp +++ b/plugins/Compressor/Compressor.cpp @@ -276,7 +276,7 @@ bool CompressorEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames) float rOutPeak = 0.0; float lInPeak = 0.0; float rInPeak = 0.0; - + const bool midside = m_compressorControls.m_midsideModel.value(); const bool peakmode = m_compressorControls.m_peakmodeModel.value(); const float inBalance = m_compressorControls.m_inBalanceModel.value(); @@ -292,8 +292,8 @@ bool CompressorEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames) for(fpp_t f = 0; f < frames; ++f) { - sample_t drySignal[2] = {buf[f][0], buf[f][1]}; - sample_t s[2] = {drySignal[0] * m_inGainVal, drySignal[1] * m_inGainVal}; + auto drySignal = std::array{buf[f][0], buf[f][1]}; + auto s = std::array{drySignal[0] * m_inGainVal, drySignal[1] * m_inGainVal}; // Calculate tilt filters, to bias the sidechain to the low or high frequencies if (m_tiltVal) @@ -512,7 +512,7 @@ bool CompressorEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames) m_inputBufLoc = 0; } - const float temp[2] = {drySignal[0], drySignal[1]}; + const auto temp = std::array{drySignal[0], drySignal[1]}; s[0] = m_inputBuf[0][m_inputBufLoc]; s[1] = m_inputBuf[1][m_inputBufLoc]; @@ -525,8 +525,8 @@ bool CompressorEffect::processAudioBuffer(sampleFrame* buf, const fpp_t frames) s[1] = drySignal[1]; } - float delayedDrySignal[2] = {s[0], s[1]}; - + auto delayedDrySignal = std::array{s[0], s[1]}; + if (midside)// Convert left/right to mid/side { const float temp = s[0]; diff --git a/plugins/Compressor/CompressorControlDialog.cpp b/plugins/Compressor/CompressorControlDialog.cpp index 2f9fed9c2..8c6f61bec 100755 --- a/plugins/Compressor/CompressorControlDialog.cpp +++ b/plugins/Compressor/CompressorControlDialog.cpp @@ -206,7 +206,7 @@ CompressorControlDialog::CompressorControlDialog(CompressorControls* controls) : peakButton->setActiveGraphic(PLUGIN_NAME::getIconPixmap("peak_sel")); peakButton->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("peak_unsel")); peakButton->setToolTip(tr("Use absolute value of the input")); - + rmsPeakGroup = new automatableButtonGroup(this); rmsPeakGroup->addButton(rmsButton); rmsPeakGroup->addButton(peakButton); @@ -221,7 +221,7 @@ CompressorControlDialog::CompressorControlDialog(CompressorControls* controls) : midSideButton->setActiveGraphic(PLUGIN_NAME::getIconPixmap("midside_sel")); midSideButton->setInactiveGraphic(PLUGIN_NAME::getIconPixmap("midside_unsel")); midSideButton->setToolTip(tr("Compress mid and side audio")); - + leftRightMidSideGroup = new automatableButtonGroup(this); leftRightMidSideGroup->addButton(leftRightButton); leftRightMidSideGroup->addButton(midSideButton); @@ -514,8 +514,8 @@ void CompressorControlDialog::redrawKnee() { m_p.setPen(QPen(m_kneeColor2, 3)); - float prevPoint[2] = {kneePoint1, kneePoint1}; - float newPoint[2] = {0, 0}; + auto prevPoint = std::array{kneePoint1, kneePoint1}; + auto newPoint = std::array{0.f, 0.f}; // Draw knee curve using many straight lines. for (int i = 0; i < COMP_KNEE_LINES; ++i) @@ -542,7 +542,7 @@ void CompressorControlDialog::redrawKnee() m_p.end(); m_p.begin(&m_kneePixmap2); - + m_p.setCompositionMode(QPainter::CompositionMode_Source); m_p.fillRect(0, 0, m_windowSizeX, m_kneeWindowSizeY, QColor("transparent")); m_p.setCompositionMode(QPainter::CompositionMode_SourceOver); diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index 1c6a74b86..6db2f38e3 100644 --- a/plugins/Delay/DelayEffect.cpp +++ b/plugins/Delay/DelayEffect.cpp @@ -91,7 +91,7 @@ bool DelayEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) const float sr = Engine::audioEngine()->processingSampleRate(); const float d = dryLevel(); const float w = wetLevel(); - sample_t dryS[2]; + auto dryS = std::array{}; float lPeak = 0.0; float rPeak = 0.0; float length = m_delayControls.m_delayTimeModel.value(); diff --git a/plugins/DualFilter/DualFilter.cpp b/plugins/DualFilter/DualFilter.cpp index 75a2ab532..e510109e9 100644 --- a/plugins/DualFilter/DualFilter.cpp +++ b/plugins/DualFilter/DualFilter.cpp @@ -134,8 +134,8 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames const bool enabled1 = m_dfControls.m_enabled1Model.value(); const bool enabled2 = m_dfControls.m_enabled2Model.value(); - - + + // buffer processing loop for( fpp_t f = 0; f < frames; ++f ) @@ -145,9 +145,9 @@ bool DualFilterEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames const float mix1 = 1.0f - mix2; const float gain1 = *gain1Ptr * 0.01f; const float gain2 = *gain2Ptr * 0.01f; - sample_t s[2] = { 0.0f, 0.0f }; // mix - sample_t s1[2] = { buf[f][0], buf[f][1] }; // filter 1 - sample_t s2[2] = { buf[f][0], buf[f][1] }; // filter 2 + auto s = std::array{0.0f, 0.0f}; // mix + auto s1 = std::array{buf[f][0], buf[f][1]}; // filter 1 + auto s2 = std::array{buf[f][0], buf[f][1]}; // filter 2 // update filter 1 if( enabled1 ) diff --git a/plugins/DynamicsProcessor/DynamicsProcessor.cpp b/plugins/DynamicsProcessor/DynamicsProcessor.cpp index c8ad9a029..54f1f0c50 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessor.cpp +++ b/plugins/DynamicsProcessor/DynamicsProcessor.cpp @@ -105,17 +105,17 @@ bool DynProcEffect::processAudioBuffer( sampleFrame * _buf, // variables for effect int i = 0; - float sm_peak[2] = { 0.0f, 0.0f }; + auto sm_peak = std::array{0.0f, 0.0f}; float gain; double out_sum = 0.0; const float d = dryLevel(); const float w = wetLevel(); - + const int stereoMode = m_dpControls.m_stereomodeModel.value(); const float inputGain = m_dpControls.m_inputModel.value(); const float outputGain = m_dpControls.m_outputModel.value(); - + const float * samples = m_dpControls.m_wavegraphModel.samples(); // debug code @@ -143,7 +143,7 @@ bool DynProcEffect::processAudioBuffer( sampleFrame * _buf, for( fpp_t f = 0; f < _frames; ++f ) { - double s[2] = { _buf[f][0], _buf[f][1] }; + auto s = std::array{_buf[f][0], _buf[f][1]}; // apply input gain s[0] *= inputGain; @@ -211,7 +211,7 @@ bool DynProcEffect::processAudioBuffer( sampleFrame * _buf, gain = samples[199]; }; - s[i] *= gain; + s[i] *= gain; s[i] /= sm_peak[i]; } } diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp b/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp index f4bd8c77a..541031a3f 100644 --- a/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp +++ b/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp @@ -116,7 +116,7 @@ void DynProcControls::saveSettings( QDomDocument & _doc, void DynProcControls::setDefaultShape() { - float shp [200] = { }; + auto shp = std::array{}; for ( int i = 0; i<200; i++) { shp[i] = ((float)i + 1.0f) / 200.0f; diff --git a/plugins/Eq/EqEffect.cpp b/plugins/Eq/EqEffect.cpp index be74defba..eb168a9f9 100644 --- a/plugins/Eq/EqEffect.cpp +++ b/plugins/Eq/EqEffect.cpp @@ -71,7 +71,7 @@ bool EqEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames ) //wet/dry controls const float dry = dryLevel(); const float wet = wetLevel(); - sample_t dryS[2]; + auto dryS = std::array{}; // setup sample exact controls float hpRes = m_eqControls.m_hpResModel.value(); float lowShelfRes = m_eqControls.m_lowShelfResModel.value(); diff --git a/plugins/Flanger/FlangerEffect.cpp b/plugins/Flanger/FlangerEffect.cpp index 982702ebe..562badc0a 100644 --- a/plugins/Flanger/FlangerEffect.cpp +++ b/plugins/Flanger/FlangerEffect.cpp @@ -104,7 +104,7 @@ bool FlangerEffect::processAudioBuffer( sampleFrame *buf, const fpp_t frames ) m_lfo->setOffset( m_flangerControls.m_lfoPhaseModel.value() / 180 * D_PI ); m_lDelay->setFeedback( m_flangerControls.m_feedbackModel.value() ); m_rDelay->setFeedback( m_flangerControls.m_feedbackModel.value() ); - sample_t dryS[2]; + auto dryS = std::array{}; float leftLfo; float rightLfo; for( fpp_t f = 0; f < frames; ++f ) diff --git a/plugins/FreeBoy/FreeBoy.cpp b/plugins/FreeBoy/FreeBoy.cpp index e5ded87ee..0d639d3a6 100644 --- a/plugins/FreeBoy/FreeBoy.cpp +++ b/plugins/FreeBoy/FreeBoy.cpp @@ -311,7 +311,7 @@ void FreeBoyInstrument::playNote( NotePlayHandle * _n, data = 128; papu->write_register( fakeClock(), 0xff1a, data ); - int ch3voldata[4] = { 0, 3, 2, 1 }; + auto ch3voldata = std::array{0, 3, 2, 1}; data = ch3voldata[(int)m_ch3VolumeModel.value()]; data = data<<5; papu->write_register( fakeClock(), 0xff1c, data ); @@ -388,7 +388,7 @@ void FreeBoyInstrument::playNote( NotePlayHandle * _n, int const buf_size = 2048; int framesleft = frames; int datalen = 0; - blip_sample_t buf [buf_size*2]; + auto buf = std::array{}; while( framesleft > 0 ) { int avail = papu->samples_avail(); @@ -401,7 +401,7 @@ void FreeBoyInstrument::playNote( NotePlayHandle * _n, datalen = framesleft>avail?avail:framesleft; datalen = datalen>buf_size?buf_size:datalen; - long count = papu->read_samples( buf, datalen*2)/2; + long count = papu->read_samples(buf.data(), datalen * 2) / 2; for( fpp_t frame = 0; frame < count; ++frame ) { diff --git a/plugins/LadspaEffect/LadspaEffect.cpp b/plugins/LadspaEffect/LadspaEffect.cpp index 572d60cd8..e5d1c5d69 100644 --- a/plugins/LadspaEffect/LadspaEffect.cpp +++ b/plugins/LadspaEffect/LadspaEffect.cpp @@ -130,7 +130,7 @@ void LadspaEffect::changeSampleRate() -bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, +bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) { m_pluginMutex.lock(); @@ -154,7 +154,7 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, } // Copy the LMMS audio buffer to the LADSPA input buffer and initialize - // the control ports. + // the control ports. ch_cnt_t channel = 0; for( ch_cnt_t proc = 0; proc < processorCount(); ++proc ) { @@ -164,10 +164,10 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, switch( pp->rate ) { case CHANNEL_IN: - for( fpp_t frame = 0; + for( fpp_t frame = 0; frame < frames; ++frame ) { - pp->buffer[frame] = + pp->buffer[frame] = _buf[frame][channel]; } ++channel; @@ -181,15 +181,15 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, } else { - pp->value = static_cast( + pp->value = static_cast( pp->control->value() / pp->scale ); // This only supports control rate ports, so the audio rates are // treated as though they were control rate by setting the // port buffer to all the same value. - for( fpp_t frame = 0; + for( fpp_t frame = 0; frame < frames; ++frame ) { - pp->buffer[frame] = + pp->buffer[frame] = pp->value; } } @@ -200,9 +200,9 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, { break; } - pp->value = static_cast( + pp->value = static_cast( pp->control->value() / pp->scale ); - pp->buffer[0] = + pp->buffer[0] = pp->value; break; case CHANNEL_OUT: @@ -239,7 +239,7 @@ bool LadspaEffect::processAudioBuffer( sampleFrame * _buf, case CONTROL_RATE_INPUT: break; case CHANNEL_OUT: - for( fpp_t frame = 0; + for( fpp_t frame = 0; frame < frames; ++frame ) { _buf[frame][channel] = d * _buf[frame][channel] + w * pp->buffer[frame]; @@ -303,7 +303,7 @@ void LadspaEffect::pluginInstantiation() int inputch = 0; int outputch = 0; - LADSPA_Data * inbuf [2]; + std::array inbuf; inbuf[0] = nullptr; inbuf[1] = nullptr; for( ch_cnt_t proc = 0; proc < processorCount(); proc++ ) @@ -463,9 +463,9 @@ void LadspaEffect::pluginInstantiation() ports.append( p ); - // For convenience, keep a separate list of the ports that are used + // For convenience, keep a separate list of the ports that are used // to control the processors. - if( p->rate == AUDIO_RATE_INPUT || + if( p->rate == AUDIO_RATE_INPUT || p->rate == CONTROL_RATE_INPUT ) { p->control_id = m_portControls.count(); @@ -479,7 +479,7 @@ void LadspaEffect::pluginInstantiation() m_descriptor = manager->getDescriptor( m_key ); if( m_descriptor == nullptr ) { - QMessageBox::warning( 0, "Effect", + QMessageBox::warning( 0, "Effect", "Can't get LADSPA descriptor function: " + m_key.second, QMessageBox::Ok, QMessageBox::NoButton ); setOkay( false ); @@ -518,8 +518,8 @@ void LadspaEffect::pluginInstantiation() port, pp->buffer ) ) { - QMessageBox::warning( 0, "Effect", - "Failed to connect port: " + m_key.second, + QMessageBox::warning( 0, "Effect", + "Failed to connect port: " + m_key.second, QMessageBox::Ok, QMessageBox::NoButton ); setDontRun( true ); return; diff --git a/plugins/MidiExport/MidiExport.cpp b/plugins/MidiExport/MidiExport.cpp index cbbdc0100..0d18d8ae1 100644 --- a/plugins/MidiExport/MidiExport.cpp +++ b/plugins/MidiExport/MidiExport.cpp @@ -5,7 +5,7 @@ * Copyright (c) 2017 Hyunjin Song * * 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 @@ -81,7 +81,7 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks, int nTracks = 0; - uint8_t buffer[BUFFER_SIZE]; + auto buffer = std::array{}; uint32_t size; for (const Track* track : tracks) if (track->type() == Track::InstrumentTrack) nTracks++; @@ -89,8 +89,8 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks, // midi header MidiFile::MIDIHeader header(nTracks); - size = header.writeToBuffer(buffer); - midiout.writeRawData((char *)buffer, size); + size = header.writeToBuffer(buffer.data()); + midiout.writeRawData((char *)buffer.data(), size); std::vector>> plists; @@ -139,8 +139,8 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks, } processPatternNotes(midiClip, INT_MAX); writeMidiClipToTrack(mtrack, midiClip); - size = mtrack.writeToBuffer(buffer); - midiout.writeRawData((char *)buffer, size); + size = mtrack.writeToBuffer(buffer.data()); + midiout.writeRawData((char *)buffer.data(), size); } if (track->type() == Track::PatternTrack) @@ -254,8 +254,8 @@ bool MidiExport::tryExport(const TrackContainer::TrackList &tracks, ++itr; } } - size = mtrack.writeToBuffer(buffer); - midiout.writeRawData((char *)buffer, size); + size = mtrack.writeToBuffer(buffer.data()); + midiout.writeRawData((char *)buffer.data(), size); } return true; diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index c669b02b7..6a0314966 100644 --- a/plugins/MidiImport/MidiImport.cpp +++ b/plugins/MidiImport/MidiImport.cpp @@ -4,7 +4,7 @@ * Copyright (c) 2005-2014 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 @@ -152,17 +152,17 @@ public: ap( nullptr ), lastPos( 0 ) { } - + AutomationTrack * at; AutomationClip * ap; TimePos lastPos; - + smfMidiCC & create( TrackContainer* tc, QString tn ) { if( !at ) { - // Keep LMMS responsive, for now the import runs - // in the main thread. This should probably be + // Keep LMMS responsive, for now the import runs + // in the main thread. This should probably be // removed if that ever changes. qApp->processEvents(); at = dynamic_cast( Track::create( Track::AutomationTrack, tc ) ); @@ -195,7 +195,7 @@ public: lastPos = time; time = time - ap->startPosition(); ap->putValue( time, value, false ); - ap->changeLength( TimePos( time.getBar() + 1, 0 ) ); + ap->changeLength( TimePos( time.getBar() + 1, 0 ) ); return *this; } @@ -214,14 +214,14 @@ public: isSF2( false ), hasNotes( false ) { } - + InstrumentTrack * it; MidiClip* p; Instrument * it_inst; - bool isSF2; + bool isSF2; bool hasNotes; QString trackName; - + smfMidiChannel * create( TrackContainer* tc, QString tn ) { if( !it ) { @@ -231,7 +231,7 @@ public: #ifdef LMMS_HAVE_FLUIDSYNTH it_inst = it->loadInstrument( "sf2player" ); - + if( it_inst ) { isSF2 = true; @@ -242,7 +242,7 @@ public: else { it_inst = it->loadInstrument( "patman" ); - } + } #else it_inst = it->loadInstrument( "patman" ); #endif @@ -315,9 +315,9 @@ bool MidiImport::readSMF( TrackContainer* tc ) pd.setMaximum( seq->tracks() + preTrackSteps ); pd.setValue( 1 ); - + // 128 CC + Pitch Bend - smfMidiCC ccs[MIDI_CC_COUNT]; + auto ccs = std::array{}; // channel to CC object for program changes std::unordered_map pcs; @@ -338,9 +338,9 @@ bool MidiImport::readSMF( TrackContainer* tc ) auto timeSigDenominatorPat = new AutomationClip(dt); timeSigDenominatorPat->setDisplayName(tr("Denominator")); timeSigDenominatorPat->addObject(&timeSigMM.denominatorModel()); - + // TODO: adjust these to Time.Sig changes - double beatsPerBar = 4; + double beatsPerBar = 4; double ticksPerBeat = DefaultTicksPerBar / beatsPerBar; // Time-sig changes @@ -389,7 +389,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) if( evt->is_update() ) { - printf("Unhandled SONG update: %d %f %s\n", + printf("Unhandled SONG update: %d %f %s\n", evt->get_type_code(), evt->time, evt->get_attribute() ); } } @@ -451,9 +451,9 @@ bool MidiImport::readSMF( TrackContainer* tc ) noteEvt->get_identifier(), noteEvt->get_loud() * (200.f / 127.f)); // Map from MIDI velocity to LMMS volume ch->addNote( n ); - + } - + else if( evt->is_update() ) { smfMidiChannel * ch = chs[evt->chan].create( tc, trackName ); @@ -499,7 +499,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) double cc = evt->get_real_value(); AutomatableModel * objModel = nullptr; - switch( ccid ) + switch( ccid ) { case 0: if( ch->isSF2 && ch->it_inst ) @@ -540,7 +540,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) if( ccs[ccid].at == nullptr ) { ccs[ccid].create( tc, trackName + " > " + ( objModel != nullptr ? - objModel->displayName() : + objModel->displayName() : QString("CC %1").arg(ccid) ) ); } ccs[ccid].putValue( time, objModel, cc ); @@ -549,7 +549,7 @@ bool MidiImport::readSMF( TrackContainer* tc ) } } else { - printf("Unhandled update: %d %d %f %s\n", (int) evt->chan, + printf("Unhandled update: %d %d %f %s\n", (int) evt->chan, evt->get_type_code(), evt->time, evt->get_attribute() ); } } @@ -557,8 +557,8 @@ bool MidiImport::readSMF( TrackContainer* tc ) } delete seq; - - + + for( auto& c: chs ) { if (c.second.hasNotes) diff --git a/plugins/Monstro/Monstro.cpp b/plugins/Monstro/Monstro.cpp index 51205c660..3a9737fdb 100644 --- a/plugins/Monstro/Monstro.cpp +++ b/plugins/Monstro/Monstro.cpp @@ -653,8 +653,8 @@ inline void MonstroSynth::updateModulators( float * env1, float * env2, float * // frames played before const f_cnt_t tfp = m_nph->totalFramesPlayed(); - float * lfo [2]; - float * env [2]; + auto lfo = std::array{}; + auto env = std::array{}; lfo[0] = lfo1; lfo[1] = lfo2; env[0] = env1; @@ -1694,8 +1694,8 @@ QWidget * MonstroView::setupOperatorsView( QWidget * _parent ) m_lfo2WaveBox -> setGeometry( 127, LFOROW + 7, 42, ComboBox::DEFAULT_HEIGHT ); m_lfo2WaveBox->setFont( pointSize<8>( m_lfo2WaveBox->font() ) ); - maketsknob(m_lfo2AttKnob, LFOCOL4, LFOROW, tr("Attack"), " ms", "lfoKnob") - maketsknob(m_lfo2RateKnob, LFOCOL5, LFOROW, tr("Rate"), " ms", "lfoKnob") + maketsknob(m_lfo2AttKnob, LFOCOL4, LFOROW, tr("Attack"), " ms", "lfoKnob") + maketsknob(m_lfo2RateKnob, LFOCOL5, LFOROW, tr("Rate"), " ms", "lfoKnob") makeknob(m_lfo2PhsKnob, LFOCOL6, LFOROW, tr("Phase"), tr(" deg"), "lfoKnob") maketsknob(m_env1PreKnob, KNOBCOL1, E1ROW, tr("Pre-delay"), " ms", "envKnob") diff --git a/plugins/OpulenZ/OpulenZ.cpp b/plugins/OpulenZ/OpulenZ.cpp index 67349e48b..3a18c1e3f 100644 --- a/plugins/OpulenZ/OpulenZ.cpp +++ b/plugins/OpulenZ/OpulenZ.cpp @@ -92,7 +92,7 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) QMutex OpulenzInstrument::emulatorMutex; // Weird ordering of voice parameters -const unsigned int adlib_opadd[OPL2_VOICES] = {0x00, 0x01, 0x02, 0x08, 0x09, 0x0A, 0x10, 0x11, 0x12}; +const auto adlib_opadd = std::array{0x00, 0x01, 0x02, 0x08, 0x09, 0x0A, 0x10, 0x11, 0x12}; OpulenzInstrument::OpulenzInstrument( InstrumentTrack * _instrument_track ) : Instrument( _instrument_track, &opulenz_plugin_descriptor ), @@ -371,7 +371,7 @@ bool OpulenzInstrument::handleMidiEvent( const MidiEvent& event, const TimePos& } break; default: -#ifdef LMMS_DEBUG +#ifdef LMMS_DEBUG printf("Midi CC %02x %02x\n", event.controllerNumber(), event.controllerValue() ); #endif break; @@ -534,7 +534,7 @@ void OpulenzInstrument::loadGMPatch() { // Update patch from the models to the chip emulation void OpulenzInstrument::updatePatch() { - unsigned char inst[14] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; + auto inst = std::array{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; inst[0] = ( op1_trem_mdl.value() ? 128 : 0 ) + ( op1_vib_mdl.value() ? 64 : 0 ) + ( op1_perc_mdl.value() ? 0 : 32 ) + // NB. This envelope mode is "perc", not "sus" @@ -583,7 +583,7 @@ void OpulenzInstrument::updatePatch() { #endif - loadPatch(inst); + loadPatch(inst.data()); } // Load an SBI file into the knob models @@ -763,7 +763,7 @@ OpulenzInstrumentView::OpulenzInstrumentView( Instrument * _instrument, setPalette( pal ); } OpulenzInstrumentView::~OpulenzInstrumentView() { - // Knobs are QWidgets and our children, so they're + // Knobs are QWidgets and our children, so they're // destroyed automagically } @@ -782,20 +782,20 @@ void OpulenzInstrumentView::updateKnobHints() { // Envelope times in ms: t[0] = 0, t[n] = ( 1<{ + 0.0, 0.2, 0.4, 0.9, 1.8, 3.7, 7.4, 15.0, 30.0, 60.0, 120.0, 240.0, 480.0, - 950.0, 1900.0, 3800.0 + 950.0, 1900.0, 3800.0 }; - const float dr_times[16] = { - 0.0, 1.2, 2.5, 5.0, 10.0, 20.0, 40.0, - 80.0, 160.0, 320.0, 640.0, 1300.0, 2600.0, - 5200.0, 10000.0, 20000.0 + const auto dr_times = std::array{ + 0.0, 1.2, 2.5, 5.0, 10.0, 20.0, 40.0, + 80.0, 160.0, 320.0, 640.0, 1300.0, 2600.0, + 5200.0, 10000.0, 20000.0 }; - - const int fmultipliers[16] = { - -12, 0, 12, 19, 24, 28, 31, 34, 36, 38, 40, 40, 43, 43, 47, 47 + + const auto fmultipliers = std::array{ + -12, 0, 12, 19, 24, 28, 31, 34, 36, 38, 40, 40, 43, 43, 47, 47 }; auto m = castModel(); @@ -863,11 +863,11 @@ void OpulenzInstrumentView::modelChanged() connect( &m->op1_d_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); connect( &m->op2_d_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); - connect( &m->op1_r_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); - connect( &m->op2_r_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); + connect( &m->op1_r_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); + connect( &m->op2_r_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); - connect( &m->op1_mul_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); - connect( &m->op2_mul_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); + connect( &m->op1_mul_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); + connect( &m->op2_mul_mdl, SIGNAL( dataChanged() ), this, SLOT( updateKnobHints() ) ); updateKnobHints(); diff --git a/plugins/Organic/Organic.cpp b/plugins/Organic/Organic.cpp index cd18fc555..6c2cde773 100644 --- a/plugins/Organic/Organic.cpp +++ b/plugins/Organic/Organic.cpp @@ -2,7 +2,7 @@ * Organic.cpp - additive synthesizer for organ-like sounds * * Copyright (c) 2006-2008 Andreas Brandmaier - * + * * This file is part of LMMS - https://lmms.io * * This program is free software; you can redistribute it and/or @@ -71,7 +71,7 @@ float * OrganicInstrument::s_harmonics = nullptr; * * class OrganicInstrument * -* lmms - plugin +* lmms - plugin * ***********************************************************************/ @@ -90,7 +90,7 @@ OrganicInstrument::OrganicInstrument( InstrumentTrack * _instrument_track ) : m_osc[i] = new OscillatorObject( this, i ); m_osc[i]->m_numOscillators = m_numOscillators; - // Connect events + // Connect events connect( &m_osc[i]->m_oscModel, SIGNAL( dataChanged() ), m_osc[i], SLOT ( oscButtonChanged() ) ); connect( &m_osc[i]->m_harmModel, SIGNAL( dataChanged() ), @@ -114,7 +114,7 @@ OrganicInstrument::OrganicInstrument( InstrumentTrack * _instrument_track ) : m_osc[5]->m_harmonic = log2f( 4.0f ); // . m_osc[6]->m_harmonic = log2f( 5.0f ); // . m_osc[7]->m_harmonic = log2f( 6.0f ); // .*/ - + if( s_harmonics == nullptr ) { s_harmonics = new float[ NUM_HARMONICS ]; @@ -142,10 +142,10 @@ OrganicInstrument::OrganicInstrument( InstrumentTrack * _instrument_track ) : m_osc[i]->updateVolume(); m_osc[i]->updateDetuning(); } - + connect( Engine::audioEngine(), SIGNAL( sampleRateChanged() ), - this, SLOT( updateAllDetuning() ) ); + this, SLOT( updateAllDetuning() ) ); } @@ -193,7 +193,7 @@ void OrganicInstrument::loadSettings( const QDomElement & _this ) m_osc[i]->m_volModel.loadSettings( _this, "vol" + is ); if( _this.hasAttribute( "detune" + is ) ) { - m_osc[i]->m_detuneModel.setValue( _this.attribute( "detune" ).toInt() * 12 ); + m_osc[i]->m_detuneModel.setValue( _this.attribute( "detune" ).toInt() * 12 ); } else { @@ -201,7 +201,7 @@ void OrganicInstrument::loadSettings( const QDomElement & _this ) } m_osc[i]->m_panModel.loadSettings( _this, "pan" + is ); m_osc[i]->m_oscModel.loadSettings( _this, "wavetype" + is ); - + if( _this.hasAttribute( "newharmonic" + is ) ) { m_osc[i]->m_harmModel.loadSettings( _this, "newharmonic" + is ); @@ -211,7 +211,7 @@ void OrganicInstrument::loadSettings( const QDomElement & _this ) m_osc[i]->m_harmModel.setValue( static_cast( i ) ); } } - + m_volModel.loadSettings( _this, "vol" ); m_fx1Model.loadSettings( _this, "foldback" ); } @@ -230,23 +230,23 @@ void OrganicInstrument::playNote( NotePlayHandle * _n, { const fpp_t frames = _n->framesLeftForCurrentPeriod(); const f_cnt_t offset = _n->noteOffset(); - + if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr ) { - Oscillator * oscs_l[NUM_OSCILLATORS]; - Oscillator * oscs_r[NUM_OSCILLATORS]; + auto oscs_l = std::array{}; + auto oscs_r = std::array{}; _n->m_pluginData = new oscPtr; for( int i = m_numOscillators - 1; i >= 0; --i ) { - static_cast( _n->m_pluginData )->phaseOffsetLeft[i] + static_cast( _n->m_pluginData )->phaseOffsetLeft[i] = rand() / ( RAND_MAX + 1.0f ); - static_cast( _n->m_pluginData )->phaseOffsetRight[i] + static_cast( _n->m_pluginData )->phaseOffsetRight[i] = rand() / ( RAND_MAX + 1.0f ); - + // initialise ocillators - + if( i == m_numOscillators - 1 ) { // create left oscillator @@ -287,8 +287,8 @@ void OrganicInstrument::playNote( NotePlayHandle * _n, m_osc[i]->m_volumeRight, oscs_r[i + 1] ); } - - + + } static_cast( _n->m_pluginData )->oscLeft = oscs_l[0]; @@ -303,10 +303,10 @@ void OrganicInstrument::playNote( NotePlayHandle * _n, // -- fx section -- - + // fxKnob is [0;1] float t = m_fx1Model.value(); - + for (int i=0 ; i < frames + offset ; i++) { _working_buffer[i][0] = waveshape( _working_buffer[i][0], t ) * @@ -314,7 +314,7 @@ void OrganicInstrument::playNote( NotePlayHandle * _n, _working_buffer[i][1] = waveshape( _working_buffer[i][1], t ) * m_volModel.value() / 100.0f; } - + // -- -- instrumentTrack()->processAudioBuffer( _working_buffer, frames + offset, _n ); @@ -329,7 +329,7 @@ void OrganicInstrument::deleteNotePluginData( NotePlayHandle * _n ) _n->m_pluginData )->oscLeft ); delete static_cast( static_cast( _n->m_pluginData )->oscRight ); - + delete static_cast( _n->m_pluginData ); } @@ -388,7 +388,7 @@ void OrganicInstrument::updateAllDetuning() int OrganicInstrument::intRand( int min, int max ) { -// int randn = min+int((max-min)*rand()/(RAND_MAX + 1.0)); +// int randn = min+int((max-min)*rand()/(RAND_MAX + 1.0)); // cout << randn << endl; int randn = ( rand() % (max - min) ) + min; return( randn ); @@ -452,7 +452,7 @@ OrganicInstrumentView::OrganicInstrumentView( Instrument * _instrument, "randomise_pressed" ) ); m_randBtn->setInactiveGraphic( PLUGIN_NAME::getIconPixmap( "randomise" ) ); - + connect( m_randBtn, SIGNAL ( clicked() ), oi, SLOT( randomiseSettings() ) ); @@ -479,10 +479,10 @@ void OrganicInstrumentView::modelChanged() const float y=91.0f; const float rowHeight = 26.0f; const float x=53.0f; - const float colWidth = 24.0f; + const float colWidth = 24.0f; m_numOscillators = oi->m_numOscillators; - + m_fx1Knob->setModel( &oi->m_fx1Model ); m_volKnob->setModel( &oi->m_volModel ); @@ -490,7 +490,7 @@ void OrganicInstrumentView::modelChanged() { delete[] m_oscKnobs; } - + m_oscKnobs = new OscillatorKnobs[ m_numOscillators ]; // Create knobs, now that we know how many to make @@ -502,7 +502,7 @@ void OrganicInstrumentView::modelChanged() harmKnob->setObjectName( "harmKnob" ); connect( &oi->m_osc[i]->m_harmModel, SIGNAL( dataChanged() ), this, SLOT( updateKnobHint() ) ); - + // setup waveform-knob Knob * oscKnob = new OrganicKnob( this ); oscKnob->move( x + i * colWidth, y ); @@ -510,7 +510,7 @@ void OrganicInstrumentView::modelChanged() this, SLOT( updateKnobHint() ) ); oscKnob->setHintText( tr( "Osc %1 waveform:" ).arg( i + 1 ), QString() ); - + // setup volume-knob auto volKnob = new Knob(knobStyled, this); volKnob->setVolumeKnob( true ); @@ -518,13 +518,13 @@ void OrganicInstrumentView::modelChanged() volKnob->setFixedSize( 21, 21 ); volKnob->setHintText( tr( "Osc %1 volume:" ).arg( i + 1 ), "%" ); - + // setup panning-knob Knob * panKnob = new OrganicKnob( this ); panKnob->move( x + i * colWidth, y + rowHeight*2 ); panKnob->setHintText( tr("Osc %1 panning:").arg( i + 1 ), "" ); - + // setup knob for fine-detuning Knob * detuneKnob = new OrganicKnob( this ); detuneKnob->move( x + i * colWidth, y + rowHeight*3 ); @@ -552,7 +552,7 @@ void OrganicInstrumentView::updateKnobHint() { const float harm = oi->m_osc[i]->m_harmModel.value(); const float wave = oi->m_osc[i]->m_oscModel.value(); - + m_oscKnobs[i].m_harmKnob->setHintText( tr( "Osc %1 harmonic:" ).arg( i + 1 ), " (" + HARMONIC_NAMES[ static_cast( harm ) ] + ")" ); m_oscKnobs[i].m_oscKnob->setHintText( tr( "Osc %1 waveform:" ).arg( i + 1 ), " (" + @@ -575,7 +575,7 @@ OscillatorObject::OscillatorObject( Model * _parent, int _index ) : this, tr( "Osc %1 volume" ).arg( _index + 1 ) ), m_panModel( DefaultPanning, PanningLeft, PanningRight, 1.0f, this, tr( "Osc %1 panning" ).arg( _index + 1 ) ), - m_detuneModel( 0.0f, -1200.0f, 1200.0f, 1.0f, + m_detuneModel( 0.0f, -1200.0f, 1200.0f, 1.0f, this, tr( "Osc %1 fine detuning left" ).arg( _index + 1 ) ) { } @@ -586,7 +586,7 @@ OscillatorObject::OscillatorObject( Model * _parent, int _index ) : void OscillatorObject::oscButtonChanged() { - static Oscillator::WaveShapes shapes[] = + static auto shapes = std::array { Oscillator::SineWave, Oscillator::SawWave, @@ -639,12 +639,12 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model *m, void * ) /* * some notes & ideas for the future of this plugin: - * + * * - 32.692 Hz in the bass to 5919.85 Hz of treble in a Hammond organ * => implement harmonic foldback - * + * m_osc[i].m_oscModel->setInitValue( 0.0f ); - * - randomize preset + * - randomize preset */ diff --git a/plugins/Patman/Patman.cpp b/plugins/Patman/Patman.cpp index 34545f557..a8f75db60 100644 --- a/plugins/Patman/Patman.cpp +++ b/plugins/Patman/Patman.cpp @@ -225,11 +225,11 @@ PatmanInstrument::LoadErrors PatmanInstrument::loadPatch( return( LoadOpen ); } - unsigned char header[239]; + auto header = std::array{}; - if( fread( header, 1, 239, fd ) != 239 || - ( memcmp( header, "GF1PATCH110\0ID#000002", 22 ) - && memcmp( header, "GF1PATCH100\0ID#000002", 22 ) ) ) + if (fread(header.data(), 1, 239, fd ) != 239 || + (memcmp(header.data(), "GF1PATCH110\0ID#000002", 22) + && memcmp(header.data(), "GF1PATCH100\0ID#000002", 22))) { fclose( fd ); return( LoadNotGUS ); diff --git a/plugins/ReverbSC/ReverbSC.cpp b/plugins/ReverbSC/ReverbSC.cpp index a13f7eee8..e8dec8fd7 100644 --- a/plugins/ReverbSC/ReverbSC.cpp +++ b/plugins/ReverbSC/ReverbSC.cpp @@ -62,7 +62,7 @@ ReverbSCEffect::ReverbSCEffect( Model* parent, const Descriptor::SubPluginFeatur sp_dcblock_create(&dcblk[0]); sp_dcblock_create(&dcblk[1]); - + sp_dcblock_init(sp, dcblk[0], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() ); sp_dcblock_init(sp, dcblk[1], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() ); } @@ -88,7 +88,7 @@ bool ReverbSCEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) SPFLOAT tmpL, tmpR; SPFLOAT dcblkL, dcblkR; - + ValueBuffer * inGainBuf = m_reverbSCControls.m_inputGainModel.valueBuffer(); ValueBuffer * sizeBuf = m_reverbSCControls.m_sizeModel.valueBuffer(); ValueBuffer * colorBuf = m_reverbSCControls.m_colorModel.valueBuffer(); @@ -96,7 +96,7 @@ bool ReverbSCEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) for( fpp_t f = 0; f < frames; ++f ) { - sample_t s[2] = { buf[f][0], buf[f][1] }; + auto s = std::array{buf[f][0], buf[f][1]}; const auto inGain = (SPFLOAT)DB2LIN((inGainBuf ? inGainBuf->values()[f] : m_reverbSCControls.m_inputGainModel.value())); @@ -105,12 +105,12 @@ bool ReverbSCEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) s[0] *= inGain; s[1] *= inGain; - revsc->feedback = (SPFLOAT)(sizeBuf ? - sizeBuf->values()[f] + revsc->feedback = (SPFLOAT)(sizeBuf ? + sizeBuf->values()[f] : m_reverbSCControls.m_sizeModel.value()); - revsc->lpfreq = (SPFLOAT)(colorBuf ? - colorBuf->values()[f] + revsc->lpfreq = (SPFLOAT)(colorBuf ? + colorBuf->values()[f] : m_reverbSCControls.m_colorModel.value()); @@ -128,7 +128,7 @@ bool ReverbSCEffect::processAudioBuffer( sampleFrame* buf, const fpp_t frames ) return isRunning(); } - + void ReverbSCEffect::changeSampleRate() { // Change sr variable in Soundpipe. does not need to be destroyed @@ -144,7 +144,7 @@ void ReverbSCEffect::changeSampleRate() sp_dcblock_create(&dcblk[0]); sp_dcblock_create(&dcblk[1]); - + sp_dcblock_init(sp, dcblk[0], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() ); sp_dcblock_init(sp, dcblk[1], Engine::audioEngine()->currentQualitySettings().sampleRateMultiplier() ); mutex.unlock(); @@ -156,9 +156,9 @@ extern "C" // necessary for getting instance out of shared lib PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) { - return new ReverbSCEffect( - parent, - static_cast(data) + return new ReverbSCEffect( + parent, + static_cast(data) ); } diff --git a/plugins/Sid/SidInstrument.cpp b/plugins/Sid/SidInstrument.cpp index 73c571b72..6e7473492 100644 --- a/plugins/Sid/SidInstrument.cpp +++ b/plugins/Sid/SidInstrument.cpp @@ -3,7 +3,7 @@ * * Copyright (c) 2008 Csaba Hruska * Attila Herman - * + * * This file is part of LMMS - https://lmms.io * * This program is free software; you can redistribute it and/or @@ -52,22 +52,22 @@ namespace lmms #define SIDWRITEDELAY 9 // lda $xxxx,x 4 cycles, sta $d400,x 5 cycles #define SIDWAVEDELAY 4 // and $xxxx,x 4 cycles extra -unsigned char sidorder[] = +auto sidorder = std::array {0x15,0x16,0x18,0x17, 0x05,0x06,0x02,0x03,0x00,0x01,0x04, 0x0c,0x0d,0x09,0x0a,0x07,0x08,0x0b, 0x13,0x14,0x10,0x11,0x0e,0x0f,0x12}; -static const char *attackTime[16] = { "2 ms", "8 ms", "16 ms", "24 ms", +static auto attackTime = std::array{ "2 ms", "8 ms", "16 ms", "24 ms", "38 ms", "56 ms", "68 ms", "80 ms", "100 ms", "250 ms", "500 ms", "800 ms", "1 s", "3 s", "5 s", "8 s" }; -static const char *decRelTime[16] = { "6 ms", "24 ms", "48 ms", "72 ms", +static auto decRelTime = std::array{ "6 ms", "24 ms", "48 ms", "72 ms", "114 ms", "168 ms", "204 ms", "240 ms", "300 ms", "750 ms", "1.5 s", "2.4 s", "3 s", "9 s", "15 s", "24 s" }; // release time time in ms -static const int relTime[16] = { 6, 24, 48, 72, 114, 168, 204, 240, 300, 750, +static const auto relTime = std::array{ 6, 24, 48, 72, 114, 168, 204, 240, 300, 750, 1500, 2400, 3000, 9000, 15000, 24000 }; @@ -118,11 +118,11 @@ VoiceObject::VoiceObject( Model * _parent, int _idx ) : SidInstrument::SidInstrument( InstrumentTrack * _instrument_track ) : Instrument( _instrument_track, &sid_plugin_descriptor ), - // filter + // filter m_filterFCModel( 1024.0f, 0.0f, 2047.0f, 1.0f, this, tr( "Cutoff frequency" ) ), m_filterResonanceModel( 8.0f, 0.0f, 15.0f, 1.0f, this, tr( "Resonance" ) ), m_filterModeModel( LowPass, 0, NumFilterTypes-1, this, tr( "Filter type" )), - + // misc m_voice3OffModel( false, this, tr( "Voice 3 off" ) ), m_volumeModel( 15.0f, 0.0f, 15.0f, 1.0f, this, tr( "Volume" ) ), @@ -167,11 +167,11 @@ void SidInstrument::saveSettings( QDomDocument & _doc, _doc, _this, "test" + is ); } - // filter + // filter m_filterFCModel.saveSettings( _doc, _this, "filterFC" ); m_filterResonanceModel.saveSettings( _doc, _this, "filterResonance" ); m_filterModeModel.saveSettings( _doc, _this, "filterMode" ); - + // misc m_voice3OffModel.saveSettings( _doc, _this, "voice3Off" ); m_volumeModel.saveSettings( _doc, _this, "volume" ); @@ -200,12 +200,12 @@ void SidInstrument::loadSettings( const QDomElement & _this ) m_voice[i]->m_filteredModel.loadSettings( _this, "filtered" + is ); m_voice[i]->m_testModel.loadSettings( _this, "test" + is ); } - - // filter + + // filter m_filterFCModel.loadSettings( _this, "filterFC" ); m_filterResonanceModel.loadSettings( _this, "filterResonance" ); m_filterModeModel.loadSettings( _this, "filterMode" ); - + // misc m_voice3OffModel.loadSettings( _this, "voice3Off" ); m_volumeModel.loadSettings( _this, "volume" ); @@ -318,7 +318,7 @@ void SidInstrument::playNote( NotePlayHandle * _n, int delta_t = clockrate * frames / samplerate + 4; // avoid variable length array for msvc compat auto buf = reinterpret_cast(_working_buffer + offset); - unsigned char sidreg[NUMSIDREGS]; + auto sidreg = std::array{}; for (auto& reg : sidreg) { @@ -354,7 +354,7 @@ void SidInstrument::playNote( NotePlayHandle * _n, sidreg[base+1] = (data16>>8)&0x00FF; // pw data16 = (int)m_voice[i]->m_pulseWidthModel.value(); - + sidreg[base+2] = data16&0x00FF; sidreg[base+3] = (data16>>8)&0x000F; // control: wave form, (test), ringmod, sync, gate @@ -363,7 +363,7 @@ void SidInstrument::playNote( NotePlayHandle * _n, data8 += m_voice[i]->m_ringModModel.value()?4:0; data8 += m_voice[i]->m_testModel.value()?8:0; switch( m_voice[i]->m_waveFormModel.value() ) - { + { default: break; case VoiceObject::NoiseWave: data8 += 128; break; case VoiceObject::SquareWave: data8 += 64; break; @@ -394,7 +394,7 @@ void SidInstrument::playNote( NotePlayHandle * _n, data16 = (int)m_filterFCModel.value(); sidreg[21] = data16&0x0007; sidreg[22] = (data16>>3)&0x00FF; - + // res, filt ex,3,2,1 data16 = (int)m_filterResonanceModel.value(); data8 = (data16&0x000F)<<4; @@ -409,7 +409,7 @@ void SidInstrument::playNote( NotePlayHandle * _n, data8 += m_voice3OffModel.value()?128:0; switch( m_filterModeModel.value() ) - { + { default: break; case LowPass: data8 += 16; break; case BandPass: data8 += 32; break; @@ -417,8 +417,8 @@ void SidInstrument::playNote( NotePlayHandle * _n, } sidreg[24] = data8&0x00FF; - - int num = sid_fillbuffer(sidreg, sid,delta_t,buf, frames); + + int num = sid_fillbuffer(sidreg.data(), sid, delta_t, buf, frames); if(num!=frames) printf("!!!Not enough samples\n"); @@ -544,7 +544,7 @@ SidInstrumentView::SidInstrumentView( Instrument * _instrument, m_sidTypeBtnGrp->addButton( mos6581_btn ); m_sidTypeBtnGrp->addButton( mos8580_btn ); - for( int i = 0; i < 3; i++ ) + for( int i = 0; i < 3; i++ ) { Knob *ak = new sidKnob( this ); ak->setHintText( tr("Attack:"), "" ); @@ -674,7 +674,7 @@ void SidInstrumentView::updateKnobHint() m_releaseModel.value()] ) + ")" ); m_voiceKnobs[i].m_relKnob->setToolTip( decRelTime[(int)k->m_voice[i]->m_releaseModel.value()]); - + m_voiceKnobs[i].m_pwKnob->setHintText( tr( "Pulse width:" )+ " ", " (" + QString::number( (double)k->m_voice[i]-> m_pulseWidthModel.value() / 40.95 ) + "%)" ); @@ -758,7 +758,7 @@ void SidInstrumentView::modelChanged() connect(&voice->m_sustainModel, SIGNAL(dataChanged()), this, SLOT(updateKnobToolTip())); connect(&voice->m_coarseModel, SIGNAL(dataChanged()), this, SLOT(updateKnobToolTip())); } - + connect( &k->m_volumeModel, SIGNAL( dataChanged() ), this, SLOT( updateKnobToolTip() ) ); connect( &k->m_filterResonanceModel, SIGNAL( dataChanged() ), diff --git a/plugins/SpectrumAnalyzer/SaSpectrumView.cpp b/plugins/SpectrumAnalyzer/SaSpectrumView.cpp index 8c3d7a82d..0d9c2af87 100644 --- a/plugins/SpectrumAnalyzer/SaSpectrumView.cpp +++ b/plugins/SpectrumAnalyzer/SaSpectrumView.cpp @@ -648,8 +648,8 @@ std::vector> SaSpectrumView::makeLogFreqTics(int low { std::vector> result; int i, j; - int a[] = {10, 20, 50}; // sparse series multipliers - int b[] = {14, 30, 70}; // additional (denser) series + auto a = std::array{10, 20, 50}; // sparse series multipliers + auto b = std::array{14, 30, 70}; // additional (denser) series // generate main steps (powers of 10); use the series to specify smaller steps for (i = 1; i <= high; i *= 10) diff --git a/plugins/StereoEnhancer/StereoEnhancer.cpp b/plugins/StereoEnhancer/StereoEnhancer.cpp index 1351ab885..01e55f2de 100644 --- a/plugins/StereoEnhancer/StereoEnhancer.cpp +++ b/plugins/StereoEnhancer/StereoEnhancer.cpp @@ -85,15 +85,15 @@ StereoEnhancerEffect::~StereoEnhancerEffect() bool StereoEnhancerEffect::processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ) { - + // This appears to be used for determining whether or not to continue processing - // audio with this effect + // audio with this effect double out_sum = 0.0; - + float width; int frameIndex = 0; - - + + if( !isEnabled() || !isRunning() ) { return( false ); @@ -104,7 +104,7 @@ bool StereoEnhancerEffect::processAudioBuffer( sampleFrame * _buf, for( fpp_t f = 0; f < _frames; ++f ) { - + // copy samples into the delay buffer m_delayBuffer[m_currFrame][0] = _buf[f][0]; m_delayBuffer[m_currFrame][1] = _buf[f][1]; @@ -122,7 +122,7 @@ bool StereoEnhancerEffect::processAudioBuffer( sampleFrame * _buf, } //sample_t s[2] = { _buf[f][0], _buf[f][1] }; //Vanilla - sample_t s[2] = { _buf[f][0], m_delayBuffer[frameIndex][1] }; //Chocolate + auto s = std::array{_buf[f][0], m_delayBuffer[frameIndex][1]}; //Chocolate m_seFX.nextSample( s[0], s[1] ); diff --git a/plugins/TripleOscillator/TripleOscillator.cpp b/plugins/TripleOscillator/TripleOscillator.cpp index bbc95683b..25baea208 100644 --- a/plugins/TripleOscillator/TripleOscillator.cpp +++ b/plugins/TripleOscillator/TripleOscillator.cpp @@ -21,7 +21,7 @@ * Boston, MA 02110-1301 USA. * */ - + #include @@ -81,10 +81,10 @@ OscillatorObject::OscillatorObject( Model * _parent, int _idx ) : m_fineRightModel( 0.0f, -100.0f, 100.0f, 1.0f, this, tr( "Osc %1 fine detuning right" ).arg( _idx + 1 ) ), m_phaseOffsetModel( 0.0f, 0.0f, 360.0f, 1.0f, this, - tr( "Osc %1 phase-offset" ).arg( _idx+1 ) ), + tr( "Osc %1 phase-offset" ).arg( _idx+1 ) ), m_stereoPhaseDetuningModel( 0.0f, 0.0f, 360.0f, 1.0f, this, tr( "Osc %1 stereo phase-detuning" ).arg( _idx+1 ) ), - m_waveShapeModel( Oscillator::SineWave, 0, + m_waveShapeModel( Oscillator::SineWave, 0, Oscillator::NumWaveShapes-1, this, tr( "Osc %1 wave shape" ).arg( _idx+1 ) ), m_modulationAlgoModel( Oscillator::SignalMix, 0, @@ -220,7 +220,7 @@ void OscillatorObject::updateUseWaveTable() } - + TripleOscillator::TripleOscillator( InstrumentTrack * _instrument_track ) : Instrument( _instrument_track, &tripleoscillator_plugin_descriptor ) @@ -310,8 +310,8 @@ void TripleOscillator::playNote( NotePlayHandle * _n, { if( _n->totalFramesPlayed() == 0 || _n->m_pluginData == nullptr ) { - Oscillator * oscs_l[NUM_OF_OSCILLATORS]; - Oscillator * oscs_r[NUM_OF_OSCILLATORS]; + auto oscs_l = std::array{}; + auto oscs_r = std::array{}; for( int i = NUM_OF_OSCILLATORS - 1; i >= 0; --i ) { diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index 593712c14..eab3693b8 100644 --- a/plugins/Vestige/Vestige.cpp +++ b/plugins/Vestige/Vestige.cpp @@ -221,16 +221,16 @@ void VestigeInstrument::loadSettings( const QDomElement & _this ) const QMap & dump = m_plugin->parameterDump(); paramCount = dump.size(); - char paramStr[35]; + auto paramStr = std::array{}; knobFModel = new FloatModel *[ paramCount ]; QStringList s_dumpValues; for( int i = 0; i < paramCount; i++ ) { - sprintf( paramStr, "param%d", i ); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); knobFModel[i] = new FloatModel( 0.0f, 0.0f, 1.0f, 0.01f, this, QString::number(i) ); - knobFModel[i]->loadSettings( _this, paramStr ); + knobFModel[i]->loadSettings(_this, paramStr.data()); if( !( knobFModel[ i ]->isAutomated() || knobFModel[ i ]->controllerConnection() ) ) { @@ -286,12 +286,12 @@ void VestigeInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this ) if (knobFModel != nullptr) { const QMap & dump = m_plugin->parameterDump(); paramCount = dump.size(); - char paramStr[35]; + auto paramStr = std::array{}; for( int i = 0; i < paramCount; i++ ) { if (knobFModel[i]->isAutomated() || knobFModel[i]->controllerConnection()) { - sprintf( paramStr, "param%d", i); - knobFModel[i]->saveSettings( _doc, _this, paramStr ); + sprintf(paramStr.data(), "param%d", i); + knobFModel[i]->saveSettings(_doc, _this, paramStr.data()); } /* QDomElement me = _doc.createElement( paramStr ); @@ -938,7 +938,7 @@ ManageVestigeInstrumentView::ManageVestigeInstrumentView( Instrument * _instrume using ::operator|; #endif - + m_vi = m_vi2; m_vi->m_scrollArea = new QScrollArea( this ); widget = new QWidget(this); @@ -996,13 +996,13 @@ ManageVestigeInstrumentView::ManageVestigeInstrumentView( Instrument * _instrume hasKnobModel = false; } - char paramStr[35]; + auto paramStr = std::array{}; QStringList s_dumpValues; for( int i = 0; i < m_vi->paramCount; i++ ) { - sprintf( paramStr, "param%d", i); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); vstKnobs[ i ] = new CustomTextKnob( knobBright_26, this, s_dumpValues.at( 1 ) ); vstKnobs[ i ]->setDescription( s_dumpValues.at( 1 ) + ":" ); @@ -1010,9 +1010,9 @@ ManageVestigeInstrumentView::ManageVestigeInstrumentView( Instrument * _instrume if( !hasKnobModel ) { - sprintf( paramStr, "%d", i); - m_vi->knobFModel[ i ] = new FloatModel( LocaleHelper::toFloat(s_dumpValues.at(2)), - 0.0f, 1.0f, 0.01f, castModel(), paramStr ); + sprintf(paramStr.data(), "%d", i); + m_vi->knobFModel[i] = new FloatModel(LocaleHelper::toFloat(s_dumpValues.at(2)), + 0.0f, 1.0f, 0.01f, castModel(), paramStr.data()); } FloatModel * model = m_vi->knobFModel[i]; @@ -1063,7 +1063,7 @@ void ManageVestigeInstrumentView::closeWindow() void ManageVestigeInstrumentView::syncPlugin( void ) { - char paramStr[35]; + auto paramStr = std::array{}; QStringList s_dumpValues; const QMap & dump = m_vi->m_plugin->parameterDump(); float f_value; @@ -1074,8 +1074,8 @@ void ManageVestigeInstrumentView::syncPlugin( void ) // those auto-setted values are not jurnaled, tracked for undo / redo if( !( m_vi->knobFModel[ i ]->isAutomated() || m_vi->knobFModel[ i ]->controllerConnection() ) ) { - sprintf( paramStr, "param%d", i ); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); f_value = LocaleHelper::toFloat(s_dumpValues.at(2)); m_vi->knobFModel[ i ]->setAutomatedValue( f_value ); m_vi->knobFModel[ i ]->setInitValue( f_value ); diff --git a/plugins/VstEffect/VstEffectControls.cpp b/plugins/VstEffect/VstEffectControls.cpp index f35a1c00d..e73530a09 100644 --- a/plugins/VstEffect/VstEffectControls.cpp +++ b/plugins/VstEffect/VstEffectControls.cpp @@ -83,16 +83,16 @@ void VstEffectControls::loadSettings( const QDomElement & _this ) const QMap & dump = m_effect->m_plugin->parameterDump(); paramCount = dump.size(); - char paramStr[35]; + auto paramStr = std::array{}; knobFModel = new FloatModel *[ paramCount ]; QStringList s_dumpValues; for( int i = 0; i < paramCount; i++ ) { - sprintf( paramStr, "param%d", i ); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); knobFModel[i] = new FloatModel( 0.0f, 0.0f, 1.0f, 0.01f, this, QString::number(i) ); - knobFModel[i]->loadSettings( _this, paramStr ); + knobFModel[i]->loadSettings(_this, paramStr.data()); if( !( knobFModel[ i ]->isAutomated() || knobFModel[ i ]->controllerConnection() ) ) @@ -134,12 +134,12 @@ void VstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this ) if (knobFModel != nullptr) { const QMap & dump = m_effect->m_plugin->parameterDump(); paramCount = dump.size(); - char paramStr[35]; + auto paramStr = std::array{}; for( int i = 0; i < paramCount; i++ ) { if (knobFModel[i]->isAutomated() || knobFModel[i]->controllerConnection()) { - sprintf( paramStr, "param%d", i); - knobFModel[i]->saveSettings( _doc, _this, paramStr ); + sprintf(paramStr.data(), "param%d", i); + knobFModel[i]->saveSettings(_doc, _this, paramStr.data()); } } } @@ -173,7 +173,7 @@ void VstEffectControls::managePlugin() auto tt = new gui::ManageVSTEffectView(m_effect, this); ctrHandle = (QObject *)tt; } else if (m_subWindow != nullptr) { - if (m_subWindow->widget()->isVisible() == false ) { + if (m_subWindow->widget()->isVisible() == false ) { m_scrollArea->show(); m_subWindow->show(); } else { @@ -371,13 +371,13 @@ ManageVSTEffectView::ManageVSTEffectView( VstEffect * _eff, VstEffectControls * hasKnobModel = false; } - char paramStr[35]; + auto paramStr = std::array{}; QStringList s_dumpValues; for( int i = 0; i < m_vi->paramCount; i++ ) { - sprintf( paramStr, "param%d", i); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); vstKnobs[ i ] = new CustomTextKnob( knobBright_26, widget, s_dumpValues.at( 1 ) ); vstKnobs[ i ]->setDescription( s_dumpValues.at( 1 ) + ":" ); @@ -385,9 +385,9 @@ ManageVSTEffectView::ManageVSTEffectView( VstEffect * _eff, VstEffectControls * if( !hasKnobModel ) { - sprintf( paramStr, "%d", i); - m_vi->knobFModel[ i ] = new FloatModel( LocaleHelper::toFloat(s_dumpValues.at(2)), - 0.0f, 1.0f, 0.01f, _eff, paramStr ); + sprintf(paramStr.data(), "%d", i); + m_vi->knobFModel[i] = new FloatModel(LocaleHelper::toFloat(s_dumpValues.at(2)), + 0.0f, 1.0f, 0.01f, _eff, paramStr.data()); } FloatModel * model = m_vi->knobFModel[i]; @@ -439,7 +439,7 @@ void ManageVSTEffectView::closeWindow() void ManageVSTEffectView::syncPlugin() { - char paramStr[35]; + auto paramStr = std::array{}; QStringList s_dumpValues; const QMap & dump = m_effect->m_plugin->parameterDump(); float f_value; @@ -451,8 +451,8 @@ void ManageVSTEffectView::syncPlugin() if( !( m_vi2->knobFModel[ i ]->isAutomated() || m_vi2->knobFModel[ i ]->controllerConnection() ) ) { - sprintf( paramStr, "param%d", i ); - s_dumpValues = dump[ paramStr ].split( ":" ); + sprintf(paramStr.data(), "param%d", i); + s_dumpValues = dump[paramStr.data()].split(":"); f_value = LocaleHelper::toFloat(s_dumpValues.at(2)); m_vi2->knobFModel[ i ]->setAutomatedValue( f_value ); m_vi2->knobFModel[ i ]->setInitValue( f_value ); @@ -477,7 +477,7 @@ void ManageVSTEffectView::displayAutomatedOnly() { vstKnobs[ i ]->hide(); m_displayAutomatedOnly->setText( "All" ); - } else { + } else { vstKnobs[ i ]->show(); m_displayAutomatedOnly->setText( "Automated" ); } @@ -534,7 +534,7 @@ void ManageVSTEffectView::syncParameterText() ManageVSTEffectView::~ManageVSTEffectView() { if( m_vi2->knobFModel != nullptr ) - { + { for( int i = 0; i < m_vi2->paramCount; i++ ) { delete m_vi2->knobFModel[ i ]; @@ -553,18 +553,18 @@ ManageVSTEffectView::~ManageVSTEffectView() delete [] m_vi2->knobFModel; m_vi2->knobFModel = nullptr; } - + if( m_vi2->m_scrollArea != nullptr ) { delete m_vi2->m_scrollArea; m_vi2->m_scrollArea = nullptr; } - + if( m_vi2->m_subWindow != nullptr ) { m_vi2->m_subWindow->setAttribute( Qt::WA_DeleteOnClose ); m_vi2->m_subWindow->close(); - + if( m_vi2->m_subWindow != nullptr ) { delete m_vi2->m_subWindow; diff --git a/plugins/WaveShaper/WaveShaper.cpp b/plugins/WaveShaper/WaveShaper.cpp index edbcb0ad8..94845e672 100644 --- a/plugins/WaveShaper/WaveShaper.cpp +++ b/plugins/WaveShaper/WaveShaper.cpp @@ -96,7 +96,7 @@ bool WaveShaperEffect::processAudioBuffer( sampleFrame * _buf, for( fpp_t f = 0; f < _frames; ++f ) { - float s[2] = { _buf[f][0], _buf[f][1] }; + auto s = std::array{_buf[f][0], _buf[f][1]}; // apply input gain s[0] *= *inputPtr; @@ -114,7 +114,7 @@ bool WaveShaperEffect::processAudioBuffer( sampleFrame * _buf, for( i=0; i <= 1; ++i ) { const int lookup = static_cast( qAbs( s[i] ) * 200.0f ); - const float frac = fraction( qAbs( s[i] ) * 200.0f ); + const float frac = fraction( qAbs( s[i] ) * 200.0f ); const float posneg = s[i] < 0 ? -1.0f : 1.0f; if( lookup < 1 ) @@ -122,8 +122,8 @@ bool WaveShaperEffect::processAudioBuffer( sampleFrame * _buf, s[i] = frac * samples[0] * posneg; } else if( lookup < 200 ) - { - s[i] = linearInterpolate( samples[ lookup - 1 ], + { + s[i] = linearInterpolate( samples[ lookup - 1 ], samples[ lookup ], frac ) * posneg; } diff --git a/plugins/WaveShaper/WaveShaperControls.cpp b/plugins/WaveShaper/WaveShaperControls.cpp index 40e20055a..a03abc2ef 100644 --- a/plugins/WaveShaper/WaveShaperControls.cpp +++ b/plugins/WaveShaper/WaveShaperControls.cpp @@ -69,7 +69,7 @@ void WaveShaperControls::loadSettings( const QDomElement & _this ) //load input, output knobs m_inputModel.loadSettings( _this, "inputGain" ); m_outputModel.loadSettings( _this, "outputGain" ); - + m_clipModel.loadSettings( _this, "clipInput" ); //load waveshape @@ -105,7 +105,7 @@ void WaveShaperControls::saveSettings( QDomDocument & _doc, void WaveShaperControls::setDefaultShape() { - float shp [200] = { }; + auto shp = std::array{}; for ( int i = 0; i<200; i++) { shp[i] = ((float)i + 1.0f) / 200.0f; diff --git a/plugins/Xpressive/ExprSynth.cpp b/plugins/Xpressive/ExprSynth.cpp index 47b778ae0..991e0d3e6 100644 --- a/plugins/Xpressive/ExprSynth.cpp +++ b/plugins/Xpressive/ExprSynth.cpp @@ -214,7 +214,7 @@ struct WaveValueFunctionInterpolate : public exprtk::ifunction const T *m_vec; const std::size_t m_size; }; -static const unsigned int random_data[257]={ +static const auto random_data = std::array{ 0xd76a33ec, 0x4a767724, 0xb34ebd08 ,0xf4024196, 0x17b426e2, 0x8dc6389a, 0x1b5dcb93 ,0xa771bd3f, 0x078d502e, 0x8980988a, 0x1f64f846 ,0xb5b48ed7, @@ -526,14 +526,14 @@ ExprFront::ExprFront(const char * expr, int last_func_samples) try { m_data = new ExprFrontData(last_func_samples); - + m_data->m_expression_string = expr; m_data->m_symbol_table.add_pi(); - + m_data->m_symbol_table.add_constant("e", F_E); m_data->m_symbol_table.add_constant("seed", SimpleRandom::generator() & max_float_integer_mask); - + m_data->m_symbol_table.add_function("sinew", sin_wave_func); m_data->m_symbol_table.add_function("squarew", square_wave_func); m_data->m_symbol_table.add_function("trianglew", triangle_wave_func); @@ -577,7 +577,7 @@ bool ExprFront::compile() sstore.disable_all_assignment_ops(); sstore.disable_all_control_structures(); parser_t parser(sstore); - + m_valid=parser.compile(m_data->m_expression_string, m_data->m_expression); } catch(...) @@ -600,7 +600,7 @@ float ExprFront::evaluate() WARN_EXPRTK; } return 0; - + } bool ExprFront::add_variable(const char* name, float& ref) { @@ -757,7 +757,7 @@ void ExprSynth::renderOutput(fpp_t frames, sampleFrame *buf) const float new_freq = m_nph->frequency(); const float freq_inc = (new_freq - m_frequency) / frames; const bool is_released = m_nph->isReleased(); - + expression_t *o1_rawExpr = &(m_exprO1->getData()->m_expression); expression_t *o2_rawExpr = &(m_exprO2->getData()->m_expression); LastSampleFunction * last_func1 = &m_exprO1->getData()->m_last_func; @@ -791,7 +791,7 @@ void ExprSynth::renderOutput(fpp_t frames, sampleFrame *buf) } else { - + if (o2_valid) { o1_rawExpr = o2_rawExpr; diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 635c4c6a4..b6b9452f5 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -89,19 +89,27 @@ const std::vector DataFile::UPGRADE_VERSIONS = { "1.2.0-rc3" , "1.3.0" }; -DataFile::typeDescStruct - DataFile::s_types[DataFile::TypeCount] = +namespace { - { DataFile::UnknownType, "unknown" }, - { DataFile::SongProject, "song" }, - { DataFile::SongProjectTemplate, "songtemplate" }, - { DataFile::InstrumentTrackSettings, "instrumenttracksettings" }, - { DataFile::DragNDropData, "dnddata" }, - { DataFile::ClipboardData, "clipboard-data" }, - { DataFile::JournalData, "journaldata" }, - { DataFile::EffectSettings, "effectsettings" }, - { DataFile::MidiClip, "midiclip" } -} ; + struct TypeDescStruct + { + DataFile::Type m_type; + QString m_name; + }; + + const auto s_types = std::array + { + TypeDescStruct{ DataFile::UnknownType, "unknown" }, + TypeDescStruct{ DataFile::SongProject, "song" }, + TypeDescStruct{ DataFile::SongProjectTemplate, "songtemplate" }, + TypeDescStruct{ DataFile::InstrumentTrackSettings, "instrumenttracksettings" }, + TypeDescStruct{ DataFile::DragNDropData, "dnddata" }, + TypeDescStruct{ DataFile::ClipboardData, "clipboard-data" }, + TypeDescStruct{ DataFile::JournalData, "journaldata" }, + TypeDescStruct{ DataFile::EffectSettings, "effectsettings" }, + TypeDescStruct{ DataFile::MidiClip, "midiclip" } + }; +} diff --git a/src/core/Instrument.cpp b/src/core/Instrument.cpp index a7d3f73e8..dde260fdc 100644 --- a/src/core/Instrument.cpp +++ b/src/core/Instrument.cpp @@ -90,7 +90,7 @@ bool Instrument::isFromTrack( const Track * _track ) const static int countZeroCrossings(sampleFrame *buf, fpp_t start, fpp_t frames) { // zero point crossing counts of all channels - int zeroCrossings[DEFAULT_CHANNELS] = {0}; + auto zeroCrossings = std::array{}; // maximum zero point crossing of all channels int maxZeroCrossings = 0; diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index 4a5e29bd7..06e56666c 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -34,9 +34,10 @@ namespace lmms { - -InstrumentFunctionNoteStacking::ChordTable::Init InstrumentFunctionNoteStacking::ChordTable::s_initTable[] = -{ +std::array + InstrumentFunctionNoteStacking::ChordTable::s_initTable = + std::array +{{ { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "octave" ), { 0, -1 } }, { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "Major" ), { 0, 4, 7, -1 } }, { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "Majb5" ), { 0, 4, 6, -1 } }, @@ -139,7 +140,7 @@ InstrumentFunctionNoteStacking::ChordTable::Init InstrumentFunctionNoteStacking: { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "5" ), { 0, 7, -1 } }, { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "Phrygian dominant" ), { 0, 1, 4, 5, 7, 8, 10, -1 } }, { QT_TRANSLATE_NOOP( "InstrumentFunctionNoteStacking", "Persian" ), { 0, 1, 4, 5, 6, 8, 11, -1 } } -} ; +}}; diff --git a/src/core/MixHelpers.cpp b/src/core/MixHelpers.cpp index 2b2b5952f..02f3d8775 100644 --- a/src/core/MixHelpers.cpp +++ b/src/core/MixHelpers.cpp @@ -281,7 +281,7 @@ struct AddMultipliedStereoOp dst[1] += src[1] * m_coeffs[1]; } - float m_coeffs[2]; + std::array m_coeffs; } ; @@ -309,7 +309,7 @@ struct MultiplyAndAddMultipliedOp dst[1] = dst[1]*m_coeffs[0] + src[1]*m_coeffs[1]; } - float m_coeffs[2]; + std::array m_coeffs; } ; diff --git a/src/core/Oscillator.cpp b/src/core/Oscillator.cpp index 86a50c814..189dede6e 100644 --- a/src/core/Oscillator.cpp +++ b/src/core/Oscillator.cpp @@ -178,7 +178,7 @@ void Oscillator::generateFromFFT(int bands, sample_t* table) //ifft fftwf_execute(s_ifftPlan); //normalize and copy to result buffer - normalize(s_sampleBuffer, table, OscillatorConstants::WAVETABLE_LENGTH, 2*OscillatorConstants::WAVETABLE_LENGTH + 1); + normalize(s_sampleBuffer.data(), table, OscillatorConstants::WAVETABLE_LENGTH, 2*OscillatorConstants::WAVETABLE_LENGTH + 1); } void Oscillator::generateAntiAliasUserWaveTable(SampleBuffer *sampleBuffer) @@ -205,15 +205,15 @@ sample_t Oscillator::s_waveTables fftwf_plan Oscillator::s_fftPlan; fftwf_plan Oscillator::s_ifftPlan; fftwf_complex * Oscillator::s_specBuf; -float Oscillator::s_sampleBuffer[OscillatorConstants::WAVETABLE_LENGTH]; +std::array Oscillator::s_sampleBuffer; void Oscillator::createFFTPlans() { Oscillator::s_specBuf = ( fftwf_complex * ) fftwf_malloc( ( OscillatorConstants::WAVETABLE_LENGTH * 2 + 1 ) * sizeof( fftwf_complex ) ); - Oscillator::s_fftPlan = fftwf_plan_dft_r2c_1d(OscillatorConstants::WAVETABLE_LENGTH, s_sampleBuffer, s_specBuf, FFTW_MEASURE ); - Oscillator::s_ifftPlan = fftwf_plan_dft_c2r_1d(OscillatorConstants::WAVETABLE_LENGTH, s_specBuf, s_sampleBuffer, FFTW_MEASURE); + Oscillator::s_fftPlan = fftwf_plan_dft_r2c_1d(OscillatorConstants::WAVETABLE_LENGTH, s_sampleBuffer.data(), s_specBuf, FFTW_MEASURE ); + Oscillator::s_ifftPlan = fftwf_plan_dft_c2r_1d(OscillatorConstants::WAVETABLE_LENGTH, s_specBuf, s_sampleBuffer.data(), FFTW_MEASURE); // initialize s_specBuf content to zero, since the values are used in a condition inside generateFromFFT() for (int i = 0; i < OscillatorConstants::WAVETABLE_LENGTH * 2 + 1; i++) { diff --git a/src/core/PathUtil.cpp b/src/core/PathUtil.cpp index 299993673..03ec465a9 100644 --- a/src/core/PathUtil.cpp +++ b/src/core/PathUtil.cpp @@ -9,7 +9,7 @@ namespace lmms::PathUtil { - Base relativeBases[] = { Base::ProjectDir, Base::FactorySample, Base::UserSample, Base::UserVST, Base::Preset, + auto relativeBases = std::array{ Base::ProjectDir, Base::FactorySample, Base::UserSample, Base::UserVST, Base::Preset, Base::UserLADSPA, Base::DefaultLADSPA, Base::UserSoundfont, Base::DefaultSoundfont, Base::UserGIG, Base::DefaultGIG, Base::LocalDir }; @@ -121,7 +121,7 @@ namespace lmms::PathUtil //Check if it's a factory sample QString factoryPath = baseLocation(Base::FactorySample) + input; QFileInfo factoryInfo(factoryPath); - if (factoryInfo.exists()) { assumedBase = Base::FactorySample; } + if (factoryInfo.exists()) { assumedBase = Base::FactorySample; } //Check if it's a VST QString vstPath = baseLocation(Base::UserVST) + input; diff --git a/src/core/Piano.cpp b/src/core/Piano.cpp index 21ef7217d..0f59dd905 100644 --- a/src/core/Piano.cpp +++ b/src/core/Piano.cpp @@ -47,7 +47,7 @@ namespace lmms /*! The black / white order of keys as they appear on the keyboard. */ -static const Piano::KeyTypes KEY_ORDER[] = +static const auto KEY_ORDER = std::array { // C CIS D DIS Piano::WhiteKey, Piano::BlackKey, Piano::WhiteKey, Piano::BlackKey, diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index ca553003d..da6c729c8 100644 --- a/src/core/ProjectRenderer.cpp +++ b/src/core/ProjectRenderer.cpp @@ -39,18 +39,18 @@ namespace lmms { -const ProjectRenderer::FileEncodeDevice ProjectRenderer::fileEncodeDevices[] = +const std::array ProjectRenderer::fileEncodeDevices { - { ProjectRenderer::WaveFile, + FileEncodeDevice{ ProjectRenderer::WaveFile, QT_TRANSLATE_NOOP( "ProjectRenderer", "WAV (*.wav)" ), ".wav", &AudioFileWave::getInst }, - { ProjectRenderer::FlacFile, + FileEncodeDevice{ ProjectRenderer::FlacFile, QT_TRANSLATE_NOOP("ProjectRenderer", "FLAC (*.flac)"), ".flac", &AudioFileFlac::getInst }, - { ProjectRenderer::OggFile, + FileEncodeDevice{ ProjectRenderer::OggFile, QT_TRANSLATE_NOOP( "ProjectRenderer", "OGG (*.ogg)" ), ".ogg", #ifdef LMMS_HAVE_OGGVORBIS @@ -59,7 +59,7 @@ const ProjectRenderer::FileEncodeDevice ProjectRenderer::fileEncodeDevices[] = nullptr #endif }, - { ProjectRenderer::MP3File, + FileEncodeDevice{ ProjectRenderer::MP3File, QT_TRANSLATE_NOOP( "ProjectRenderer", "MP3 (*.mp3)" ), ".mp3", #ifdef LMMS_HAVE_MP3LAME @@ -71,7 +71,7 @@ const ProjectRenderer::FileEncodeDevice ProjectRenderer::fileEncodeDevices[] = // Insert your own file-encoder infos here. // Maybe one day the user can add own encoders inside the program. - { ProjectRenderer::NumFileFormats, nullptr, nullptr, nullptr } + FileEncodeDevice{ ProjectRenderer::NumFileFormats, nullptr, nullptr, nullptr } } ; @@ -224,8 +224,8 @@ void ProjectRenderer::updateConsoleProgress() { const int cols = 50; static int rot = 0; - char buf[80]; - char prog[cols+1]; + auto buf = std::array{}; + auto prog = std::array{}; for( int i = 0; i < cols; ++i ) { @@ -234,12 +234,12 @@ void ProjectRenderer::updateConsoleProgress() prog[cols] = 0; const auto activity = (const char*)"|/-\\"; - memset( buf, 0, sizeof( buf ) ); - sprintf( buf, "\r|%s| %3d%% %c ", prog, m_progress, + std::fill(buf.begin(), buf.end(), 0); + sprintf(buf.data(), "\r|%s| %3d%% %c ", prog.data(), m_progress, activity[rot] ); rot = ( rot+1 ) % 4; - fprintf( stderr, "%s", buf ); + fprintf( stderr, "%s", buf.data() ); fflush( stderr ); } diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index 92f3e2156..677366fdb 100644 --- a/src/core/SampleBuffer.cpp +++ b/src/core/SampleBuffer.cpp @@ -1067,7 +1067,7 @@ void SampleBuffer::visualize( float maxData = -1; float minData = 1; - float rmsData[2] = {0, 0}; + auto rmsData = std::array{}; // Find maximum and minimum samples within range for (int i = 0; i < fpp && frame + i <= last; ++i) diff --git a/src/core/audio/AudioFileFlac.cpp b/src/core/audio/AudioFileFlac.cpp index 4e40257cd..6af063683 100644 --- a/src/core/audio/AudioFileFlac.cpp +++ b/src/core/audio/AudioFileFlac.cpp @@ -96,7 +96,7 @@ void AudioFileFlac::writeBuffer(surroundSampleFrame const* _ab, fpp_t const fram if (depth == OutputSettings::Depth_24Bit || depth == OutputSettings::Depth_32Bit) // Float encoding { - std::unique_ptr buf{ new sample_t[frames*channels()] }; + auto buf = std::vector(frames * channels()); for(fpp_t frame = 0; frame < frames; ++frame) { for(ch_cnt_t channel=0; channel(buf.get()),frames); + sf_writef_float(m_sf, static_cast(buf.data()), frames); } else // integer PCM encoding { - std::unique_ptr buf{ new int_sample_t[frames*channels()] }; - convertToS16(_ab, frames, master_gain, buf.get(), !isLittleEndian()); - sf_writef_short(m_sf, static_cast(buf.get()), frames); + auto buf = std::vector(frames * channels()); + convertToS16(_ab, frames, master_gain, buf.data(), !isLittleEndian()); + sf_writef_short(m_sf, static_cast(buf.data()), frames); } } diff --git a/src/core/lv2/Lv2Proc.cpp b/src/core/lv2/Lv2Proc.cpp index f319f3b57..cbb4be2d2 100644 --- a/src/core/lv2/Lv2Proc.cpp +++ b/src/core/lv2/Lv2Proc.cpp @@ -65,8 +65,8 @@ Plugin::PluginTypes Lv2Proc::check(const LilvPlugin *plugin, { unsigned maxPorts = lilv_plugin_get_num_ports(plugin); enum { inCount, outCount, maxCount }; - unsigned audioChannels[maxCount] = { 0, 0 }; // audio input and output count - unsigned midiChannels[maxCount] = { 0, 0 }; // MIDI input and output count + auto audioChannels = std::array{}; // audio input and output count + auto midiChannels = std::array{}; // MIDI input and output count const char* pluginUri = lilv_node_as_uri(lilv_plugin_get_uri(plugin)); //qDebug() << "Checking plugin" << pluginUri << "..."; @@ -247,11 +247,11 @@ void Lv2Proc::copyModelsFromCore() ev.time.frames(Engine::framesPerTick()) + ev.offset; uint32_t type = Engine::getLv2Manager()-> uridCache()[Lv2UridCache::Id::midi_MidiEvent]; - uint8_t buf[4]; - std::size_t bufsize = writeToByteSeq(ev.ev, buf, sizeof(buf)); + auto buf = std::array{}; + std::size_t bufsize = writeToByteSeq(ev.ev, buf.data(), buf.size()); if(bufsize) { - lv2_evbuf_write(&iter, atomStamp, type, bufsize, buf); + lv2_evbuf_write(&iter, atomStamp, type, bufsize, buf.data()); } } } diff --git a/src/core/midi/MidiAlsaRaw.cpp b/src/core/midi/MidiAlsaRaw.cpp index 04ef5c1ce..23364fc01 100644 --- a/src/core/midi/MidiAlsaRaw.cpp +++ b/src/core/midi/MidiAlsaRaw.cpp @@ -105,7 +105,7 @@ void MidiAlsaRaw::sendByte( unsigned char c ) void MidiAlsaRaw::run() { - unsigned char buf[128]; + auto buf = std::array{}; //int cnt = 0; while( m_quit == false ) { @@ -149,7 +149,7 @@ void MidiAlsaRaw::run() { continue; } - err = snd_rawmidi_read( m_input, buf, sizeof( buf ) ); + err = snd_rawmidi_read(m_input, buf.data(), buf.size()); if( err == -EAGAIN ) { continue; diff --git a/src/core/midi/MidiAlsaSeq.cpp b/src/core/midi/MidiAlsaSeq.cpp index b770d914c..760840c77 100644 --- a/src/core/midi/MidiAlsaSeq.cpp +++ b/src/core/midi/MidiAlsaSeq.cpp @@ -241,7 +241,7 @@ void MidiAlsaSeq::applyPortMode( MidiPort * _port ) m_seqMutex.lock(); // determine port-capabilities - unsigned int caps[2] = { 0, 0 }; + auto caps = std::array{}; switch( _port->mode() ) { diff --git a/src/core/midi/MidiClient.cpp b/src/core/midi/MidiClient.cpp index 5b008c54b..78691de6f 100644 --- a/src/core/midi/MidiClient.cpp +++ b/src/core/midi/MidiClient.cpp @@ -105,10 +105,10 @@ void MidiClientRaw::parseData( const unsigned char c ) /* 'Process' system real-time messages */ /*********************************************************************/ /* There are not too many real-time messages that are of interest here. - * They can occur anywhere, even in the middle of a noteon message! + * They can occur anywhere, even in the middle of a noteon message! * Real-time range: 0xF8 .. 0xFF * Note: Real-time does not affect (running) status. - */ + */ if( c >= 0xF8 ) { if( c == MidiSystemReset ) @@ -124,13 +124,13 @@ void MidiClientRaw::parseData( const unsigned char c ) /* 'Process' system common messages (again, just skip them) */ /*********************************************************************/ /* There are no system common messages that are of interest here. - * System common range: 0xF0 .. 0xF7 + * System common range: 0xF0 .. 0xF7 */ if( c > 0xF0 ) { /* MIDI spec say: To ignore a non-real-time message, just discard all * data up to the next status byte. And our parser will ignore data - * that is received without a valid status. + * that is received without a valid status. * Note: system common cancels running status. */ m_midiParseData.m_status = 0; return; @@ -186,14 +186,14 @@ void MidiClientRaw::parseData( const unsigned char c ) /*********************************************************************/ /* Send the event */ /*********************************************************************/ - /* The event is ready-to-go. About 'running status': - * + /* The event is ready-to-go. About 'running status': + * * The MIDI protocol has a built-in compression mechanism. If several * similar events are sent in-a-row, for example note-ons, then the * event type is only sent once. For this case, the last event type * (status) is remembered. * We simply keep the status as it is, just reset the parameter counter. - * If another status byte comes in, it will overwrite the status. + * If another status byte comes in, it will overwrite the status. */ m_midiParseData.m_midiEvent.setType(static_cast(m_midiParseData.m_status)); m_midiParseData.m_midiEvent.setChannel(m_midiParseData.m_channel); @@ -224,7 +224,7 @@ void MidiClientRaw::parseData( const unsigned char c ) m_midiParseData.m_midiEvent.setPitchBend((m_midiParseData.m_buffer[1] * 128) | m_midiParseData.m_buffer[0]); break; - default: + default: // Unlikely return; } @@ -271,7 +271,7 @@ void MidiClientRaw::processOutEvent(const MidiEvent& event, const TimePos&, cons // Taken from Nagano Daisuke's USB-MIDI driver -static const unsigned char REMAINS_F0F6[] = +static const auto REMAINS_F0F6 = std::array { 0, /* 0xF0 */ 2, /* 0XF1 */ @@ -282,7 +282,7 @@ static const unsigned char REMAINS_F0F6[] = 1 /* 0XF6 */ } ; -static const unsigned char REMAINS_80E0[] = +static const auto REMAINS_80E0 = std::array { 3, /* 0x8X Note Off */ 3, /* 0x9X Note On */ diff --git a/src/gui/LmmsStyle.cpp b/src/gui/LmmsStyle.cpp index 64c1c1614..060a97811 100644 --- a/src/gui/LmmsStyle.cpp +++ b/src/gui/LmmsStyle.cpp @@ -23,6 +23,7 @@ * */ +#include #include #include @@ -71,7 +72,7 @@ QLinearGradient getGradient( const QColor & _col, const QRectF & _rect ) QLinearGradient darken( const QLinearGradient & _gradient ) { QGradientStops stops = _gradient.stops(); - for (auto& stop : stops) + for (auto& stop : stops) { QColor color = stop.second; stop.second = color.lighter(133); @@ -216,8 +217,8 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, int a50 = static_cast( a100 * .6 ); int a25 = static_cast( a100 * .33 ); - QLine lines[4]; - QPoint points[4]; + auto lines = std::array{}; + auto points = std::array{}; // black inside lines // 50% @@ -231,7 +232,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, rect.left() + 1, rect.bottom() - 2); lines[3] = QLine(rect.right() - 1, rect.top() + 2, rect.right() - 1, rect.bottom() - 2); - painter->drawLines(lines, 4); + painter->drawLines(lines.data(), 4); // black inside dots black.setAlpha(a50); @@ -240,7 +241,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, points[1] = QPoint(rect.left() + 2, rect.bottom() - 2); points[2] = QPoint(rect.right() - 2, rect.top() + 2); points[3] = QPoint(rect.right() - 2, rect.bottom() - 2); - painter->drawPoints(points, 4); + painter->drawPoints(points.data(), 4); // outside lines - shadow @@ -251,7 +252,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, rect.right() - 2, rect.top()); lines[1] = QLine(rect.left(), rect.top() + 2, rect.left(), rect.bottom() - 2); - painter->drawLines(lines, 2); + painter->drawLines(lines.data(), 2); // outside corner dots - shadow // 75% @@ -259,7 +260,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, painter->setPen(QPen(shadow, 0)); points[0] = QPoint(rect.left() + 1, rect.top() + 1); points[1] = QPoint(rect.right() - 1, rect.top() + 1); - painter->drawPoints(points, 2); + painter->drawPoints(points.data(), 2); // outside end dots - shadow // 50% @@ -269,7 +270,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, points[1] = QPoint(rect.left(), rect.top() + 1); points[2] = QPoint(rect.right() - 1, rect.top()); points[3] = QPoint(rect.left(), rect.bottom() - 1); - painter->drawPoints(points, 4); + painter->drawPoints(points.data(), 4); // outside lines - highlight @@ -280,7 +281,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, rect.right() - 2, rect.bottom()); lines[1] = QLine(rect.right(), rect.top() + 2, rect.right(), rect.bottom() - 2); - painter->drawLines(lines, 2); + painter->drawLines(lines.data(), 2); // outside corner dots - highlight // 75% @@ -288,7 +289,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, painter->setPen(QPen(highlight, 0)); points[0] = QPoint(rect.left() + 1, rect.bottom() - 1); points[1] = QPoint(rect.right() - 1, rect.bottom() - 1); - painter->drawPoints(points, 2); + painter->drawPoints(points.data(), 2); // outside end dots - highlight // 50% @@ -298,7 +299,7 @@ void LmmsStyle::drawPrimitive( PrimitiveElement element, points[1] = QPoint(rect.right(), rect.bottom() - 1); points[2] = QPoint(rect.left() + 1, rect.bottom()); points[3] = QPoint(rect.right(), rect.top() + 1); - painter->drawPoints(points, 4); + painter->drawPoints(points.data(), 4); } else { diff --git a/src/gui/editors/AutomationEditor.cpp b/src/gui/editors/AutomationEditor.cpp index e296301ec..db56557a4 100644 --- a/src/gui/editors/AutomationEditor.cpp +++ b/src/gui/editors/AutomationEditor.cpp @@ -968,8 +968,8 @@ void AutomationEditor::paintEvent(QPaintEvent * pe ) { if( m_y_auto ) { - int y[] = { grid_bottom, TOP_MARGIN + font_height / 2 }; - float level[] = { m_minLevel, m_maxLevel }; + auto y = std::array{grid_bottom, TOP_MARGIN + font_height / 2}; + auto level = std::array{m_minLevel, m_maxLevel}; for( int i = 0; i < 2; ++i ) { const QString & label = m_clip->firstObject() diff --git a/src/gui/editors/PianoRoll.cpp b/src/gui/editors/PianoRoll.cpp index 92c5ba72a..5f294d6e8 100644 --- a/src/gui/editors/PianoRoll.cpp +++ b/src/gui/editors/PianoRoll.cpp @@ -129,7 +129,7 @@ QPixmap* PianoRoll::s_toolKnife = nullptr; TextFloat * PianoRoll::s_textFloat = nullptr; -static QString s_noteStrings[12] = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"}; +static std::array s_noteStrings {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"}; static QString getNoteString(int key) { @@ -137,7 +137,7 @@ static QString getNoteString(int key) } // used for drawing of piano -PianoRoll::PianoRollKeyTypes PianoRoll::prKeyOrder[] = +std::array PianoRoll::prKeyOrder { PR_WHITE_KEY_SMALL, PR_BLACK_KEY, PR_WHITE_KEY_BIG, PR_BLACK_KEY, PR_WHITE_KEY_SMALL, PR_WHITE_KEY_SMALL, PR_BLACK_KEY, PR_WHITE_KEY_BIG, @@ -369,10 +369,10 @@ PianoRoll::PianoRoll() : // Set up note length model m_noteLenModel.addItem( tr( "Last note" ), std::make_unique( "edit_draw" ) ); - const QString pixmaps[] = { "whole", "half", "quarter", "eighth", + const auto pixmaps = std::array{"whole", "half", "quarter", "eighth", "sixteenth", "thirtysecond", "triplethalf", "tripletquarter", "tripleteighth", - "tripletsixteenth", "tripletthirtysecond" } ; + "tripletsixteenth", "tripletthirtysecond"}; for( int i = 0; i < NUM_EVEN_LENGTHS; ++i ) { diff --git a/src/gui/instrument/PianoView.cpp b/src/gui/instrument/PianoView.cpp index a64b22095..7478c8204 100644 --- a/src/gui/instrument/PianoView.cpp +++ b/src/gui/instrument/PianoView.cpp @@ -62,7 +62,7 @@ namespace lmms::gui /*! The scale of C Major - white keys only. */ -Keys WhiteKeys[] = +auto WhiteKeys = std::array { Key_C, Key_D, Key_E, Key_F, Key_G, Key_A, Key_H } ; diff --git a/src/gui/modals/ExportProjectDialog.cpp b/src/gui/modals/ExportProjectDialog.cpp index 7671e031e..1f937c374 100644 --- a/src/gui/modals/ExportProjectDialog.cpp +++ b/src/gui/modals/ExportProjectDialog.cpp @@ -79,14 +79,14 @@ ExportProjectDialog::ExportProjectDialog( const QString & _file_name, cbIndex++; } } - + int const MAX_LEVEL=8; for(int i=0; i<=MAX_LEVEL; ++i) { QString info=""; if ( i==0 ){ info = tr( "( Fastest - biggest )" ); } else if ( i==MAX_LEVEL ){ info = tr( "( Slowest - smallest )" ); } - + compLevelCB->addItem( QString::number(i)+" "+info, QVariant(i/static_cast(MAX_LEVEL)) @@ -159,8 +159,8 @@ void ExportProjectDialog::startExport() static_cast(interpolationCB->currentIndex()), static_cast(oversamplingCB->currentIndex()) ); - const int samplerates[5] = { 44100, 48000, 88200, 96000, 192000 }; - const bitrate_t bitrates[6] = { 64, 128, 160, 192, 256, 320 }; + const auto samplerates = std::array{44100, 48000, 88200, 96000, 192000}; + const auto bitrates = std::array{64, 128, 160, 192, 256, 320}; bool useVariableBitRate = checkBoxVariableBitRate->isChecked(); diff --git a/src/gui/widgets/LedCheckBox.cpp b/src/gui/widgets/LedCheckBox.cpp index f31d03b2c..1be072815 100644 --- a/src/gui/widgets/LedCheckBox.cpp +++ b/src/gui/widgets/LedCheckBox.cpp @@ -35,7 +35,7 @@ namespace lmms::gui { -static const QString names[LedCheckBox::NumColors] = +static const auto names = std::array { "led_yellow", "led_green", "led_red" } ; From 757146cc6870dac64e3aec73b6b1a5a4df9daad8 Mon Sep 17 00:00:00 2001 From: Alex Date: Sat, 31 Dec 2022 14:38:48 +0100 Subject: [PATCH 48/55] Move Flanger class declarations into namespace lmms --- plugins/Flanger/FlangerEffect.cpp | 3 +++ plugins/Flanger/FlangerEffect.h | 9 +++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/Flanger/FlangerEffect.cpp b/plugins/Flanger/FlangerEffect.cpp index 562badc0a..9f7200f0e 100644 --- a/plugins/Flanger/FlangerEffect.cpp +++ b/plugins/Flanger/FlangerEffect.cpp @@ -24,6 +24,9 @@ #include "FlangerEffect.h" #include "Engine.h" +#include "MonoDelay.h" +#include "Noise.h" +#include "QuadratureLfo.h" #include "embed.h" #include "plugin_export.h" diff --git a/plugins/Flanger/FlangerEffect.h b/plugins/Flanger/FlangerEffect.h index 45dd5cafd..8428d89a3 100644 --- a/plugins/Flanger/FlangerEffect.h +++ b/plugins/Flanger/FlangerEffect.h @@ -28,17 +28,14 @@ #include "Effect.h" #include "FlangerControls.h" -#include "MonoDelay.h" -#include "Noise.h" -#include "QuadratureLfo.h" + +namespace lmms +{ class MonoDelay; class Noise; class QuadratureLfo; -namespace lmms -{ - class FlangerEffect : public Effect { From 2f28c2bcc24ebd4c9fbfd37c2b363817c779598b Mon Sep 17 00:00:00 2001 From: localhost-127 <77588653+localhost-127@users.noreply.github.com> Date: Sun, 1 Jan 2023 11:49:40 +0530 Subject: [PATCH 49/55] Fix recording not possible with MIDI keyboard in PianoRoll (#6593) Co-authored-by: volumie --- src/core/Song.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Song.cpp b/src/core/Song.cpp index 7ecccf56d..ab4ac940b 100644 --- a/src/core/Song.cpp +++ b/src/core/Song.cpp @@ -116,7 +116,7 @@ Song::Song() : /* connect( &m_masterPitchModel, SIGNAL(dataChanged()), this, SLOT(masterPitchChanged()));*/ - qRegisterMetaType( "Note" ); + qRegisterMetaType( "lmms::Note" ); setType( SongContainer ); for (auto& scale : m_scales) {scale = std::make_shared();} From bf00a675cced4653f663bbf292a6d13b14512009 Mon Sep 17 00:00:00 2001 From: Hyunjin Song Date: Sun, 1 Jan 2023 18:53:30 +0900 Subject: [PATCH 50/55] Fix broken "Display playback cursor in AudioFileProcessor" (#6601) Adds missing `lmms` namespace for `f_cnt_t` to qRegisterMetaType. --- plugins/AudioFileProcessor/AudioFileProcessor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/AudioFileProcessor/AudioFileProcessor.cpp b/plugins/AudioFileProcessor/AudioFileProcessor.cpp index 8126d4c08..2e2d7163b 100644 --- a/plugins/AudioFileProcessor/AudioFileProcessor.cpp +++ b/plugins/AudioFileProcessor/AudioFileProcessor.cpp @@ -550,7 +550,7 @@ AudioFileProcessorView::AudioFileProcessorView( Instrument * _instrument, connect( castModel(), SIGNAL( isPlaying( lmms::f_cnt_t ) ), m_waveView, SLOT( isPlaying( lmms::f_cnt_t ) ) ); - qRegisterMetaType( "f_cnt_t" ); + qRegisterMetaType( "lmms::f_cnt_t" ); setAcceptDrops( true ); } @@ -1287,4 +1287,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main(Model * model, void *) } -} // namespace lmms \ No newline at end of file +} // namespace lmms From 6c7d2da9c4953e75c1d7eea9c1204cfd0d267314 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 1 Jan 2023 11:09:31 +0100 Subject: [PATCH 51/55] Fix AM pitch shift compatibility with 1.2 projects (#6554) and shorten some of the upgrade code --- src/core/DataFile.cpp | 95 ++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 46 deletions(-) diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index b6b9452f5..2e7b21e8b 100644 --- a/src/core/DataFile.cpp +++ b/src/core/DataFile.cpp @@ -1322,44 +1322,32 @@ void DataFile::upgrade_1_3_0() // Effect name changes QDomElement attribute = attributes.item( k ).toElement(); - if( attribute.attribute( "name" ) == "file" && - ( attribute.attribute( "value" ) == "calf" || - attribute.attribute( "value" ) == "calf.so" ) ) + const QString attrName = attribute.attribute("name"); + const QString attrVal = attribute.attribute("value"); + const QString plugin = attrName == "plugin" ? attrVal : ""; + + static const std::map pluginNames = { + {"Sidechaincompressor", "SidechainCompressor"}, + {"Sidechaingate", "SidechainGate"}, + {"Multibandcompressor", "MultibandCompressor"}, + {"Multibandgate", "MultibandGate"}, + {"Multibandlimiter", "MultibandLimiter"}, + }; + + if (attrName == "file" && (attrVal == "calf" || attrVal == "calf.so" )) { attribute.setAttribute( "value", "veal" ); } - else if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Sidechaincompressor" ) + + const auto newName = pluginNames.find(plugin); + if (newName != pluginNames.end()) { - attribute.setAttribute( "value", "SidechainCompressor" ); - } - else if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Sidechaingate" ) - { - attribute.setAttribute( "value", "SidechainGate" ); - } - else if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Multibandcompressor" ) - { - attribute.setAttribute( "value", "MultibandCompressor" ); - } - else if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Multibandgate" ) - { - attribute.setAttribute( "value", "MultibandGate" ); - } - else if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Multibandlimiter" ) - { - attribute.setAttribute( "value", "MultibandLimiter" ); + attribute.setAttribute("value", newName->second); } // Handle port changes - if( attribute.attribute( "name" ) == "plugin" && - ( attribute.attribute( "value" ) == "MultibandLimiter" || - attribute.attribute( "value" ) == "MultibandCompressor" || - attribute.attribute( "value" ) == "MultibandGate" ) ) + if (plugin == "MultibandLimiter" || plugin == "MultibandCompressor" || plugin == "MultibandGate") { auto fn = [&](QDomElement& port, int num, QList&, QList& removeList) { @@ -1380,8 +1368,7 @@ void DataFile::upgrade_1_3_0() iterate_ladspa_ports(effect, fn); } - if( attribute.attribute( "name" ) == "plugin" && - ( attribute.attribute( "value" ) == "Pulsator" ) ) + else if (plugin == "Pulsator") { auto fn = [&](QDomElement& port, int num, QList& addList, QList& removeList) { @@ -1424,9 +1411,7 @@ void DataFile::upgrade_1_3_0() iterate_ladspa_ports(effect, fn); } - - if( attribute.attribute( "name" ) == "plugin" && - ( attribute.attribute( "value" ) == "VintageDelay" ) ) + else if (plugin == "VintageDelay") { auto fn = [&](QDomElement& port, int num, QList& addList, QList& ) { @@ -1463,23 +1448,20 @@ void DataFile::upgrade_1_3_0() iterate_ladspa_ports(effect, fn); } - if( attribute.attribute( "name" ) == "plugin" && - ( ( attribute.attribute( "value" ) == "Equalizer5Band" ) - || ( attribute.attribute( "value" ) == "Equalizer8Band" ) - || ( attribute.attribute( "value" ) == "Equalizer12Band" ) ) ) + else if (plugin == "Equalizer5Band" || plugin == "Equalizer8Band" || plugin == "Equalizer12Band") { // NBand equalizers got 4 q nobs inserted. We need to shift everything else... // HOWEVER: 5 band eq has only 2 q nobs inserted (no LS/HS filters) - bool band5 = ( attribute.attribute( "value" ) == "Equalizer5Band" ); + bool band5 = plugin == "Equalizer5Band"; auto fn = [&](QDomElement& port, int num, QList& addList, QList& ) { if(num == 4) { // don't modify port 4, but some other ones: int zoom_port; - if(attribute.attribute( "value" ) == "Equalizer5Band") + if (plugin == "Equalizer5Band") zoom_port = 36; - else if(attribute.attribute( "value" ) == "Equalizer8Band") + else if (plugin == "Equalizer8Band") zoom_port = 48; else // 12 band zoom_port = 64; @@ -1560,8 +1542,7 @@ void DataFile::upgrade_1_3_0() iterate_ladspa_ports(effect, fn); } - if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "Saturator" ) + else if (plugin == "Saturator") { auto fn = [&](QDomElement& port, int num, QList&, QList& ) { @@ -1588,8 +1569,7 @@ void DataFile::upgrade_1_3_0() iterate_ladspa_ports(effect, fn); } - if( attribute.attribute( "name" ) == "plugin" && - attribute.attribute( "value" ) == "StereoTools" ) + else if (plugin == "StereoTools") { auto fn = [&](QDomElement& port, int num, QList&, QList& ) { @@ -1605,6 +1585,29 @@ void DataFile::upgrade_1_3_0() }; iterate_ladspa_ports(effect, fn); } + + else if (plugin == "amPitchshift") + { + auto fn = [&](QDomElement& port, int num, QList&, QList& removeList) + { + switch (num) + { + case 0: + port.setTagName("port01"); + break; + case 1: + port.setTagName("port03"); + break; + case 10: + port.setTagName("port11"); + break; + case 11: + port.setTagName("port13"); + break; + } + }; + iterate_ladspa_ports(effect, fn); + } } } } From 2f2ba41f2830c5a111957b875a464218e199f29c Mon Sep 17 00:00:00 2001 From: Lost Robot <34612565+LostRobotMusic@users.noreply.github.com> Date: Sun, 1 Jan 2023 02:28:30 -0800 Subject: [PATCH 52/55] Microtonality for SF2Player (#6580) Co-authored-by: Hyunjin Song --- CMakeLists.txt | 2 +- include/InstrumentTrack.h | 5 +++ plugins/Sf2Player/Sf2Player.cpp | 61 ++++++++++++++++++++++++++++----- plugins/Sf2Player/Sf2Player.h | 2 +- 4 files changed, 59 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dae43e573..2d5730bdf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -495,7 +495,7 @@ ENDIF() # check for Fluidsynth IF(WANT_SF2) - find_package(FluidSynth 1.0.7) + find_package(FluidSynth 1.1.0) if(FluidSynth_FOUND) SET(LMMS_HAVE_FLUIDSYNTH TRUE) SET(STATUS_FLUIDSYNTH "OK") diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index 90cd25814..129969292 100644 --- a/include/InstrumentTrack.h +++ b/include/InstrumentTrack.h @@ -224,6 +224,11 @@ public: return &m_mixerChannelModel; } + BoolModel* useMasterPitchModel() + { + return &m_useMasterPitchModel; + } + void setPreviewMode( const bool ); bool isPreviewMode() const diff --git a/plugins/Sf2Player/Sf2Player.cpp b/plugins/Sf2Player/Sf2Player.cpp index bd9788bf1..ab3729f7d 100644 --- a/plugins/Sf2Player/Sf2Player.cpp +++ b/plugins/Sf2Player/Sf2Player.cpp @@ -181,6 +181,15 @@ Sf2Instrument::Sf2Instrument( InstrumentTrack * _instrument_track ) : connect( &m_chorusLevel, SIGNAL( dataChanged() ), this, SLOT( updateChorus() ) ); connect( &m_chorusSpeed, SIGNAL( dataChanged() ), this, SLOT( updateChorus() ) ); connect( &m_chorusDepth, SIGNAL( dataChanged() ), this, SLOT( updateChorus() ) ); + + // Microtuning + connect(Engine::getSong(), &Song::scaleListChanged, this, &Sf2Instrument::updateTuning); + connect(Engine::getSong(), &Song::keymapListChanged, this, &Sf2Instrument::updateTuning); + connect(instrumentTrack()->microtuner()->enabledModel(), &Model::dataChanged, this, &Sf2Instrument::updateTuning, Qt::DirectConnection); + connect(instrumentTrack()->microtuner()->scaleModel(), &Model::dataChanged, this, &Sf2Instrument::updateTuning, Qt::DirectConnection); + connect(instrumentTrack()->microtuner()->keymapModel(), &Model::dataChanged, this, &Sf2Instrument::updateTuning, Qt::DirectConnection); + connect(instrumentTrack()->microtuner()->keyRangeImportModel(), &Model::dataChanged, this, &Sf2Instrument::updateTuning, Qt::DirectConnection); + connect(instrumentTrack()->baseNoteModel(), &Model::dataChanged, this, &Sf2Instrument::updateTuning, Qt::DirectConnection); auto iph = new InstrumentPlayHandle(this, _instrument_track); Engine::audioEngine()->addPlayHandle( iph ); @@ -537,6 +546,38 @@ void Sf2Instrument::updateChorus() +void Sf2Instrument::updateTuning() +{ + if (instrumentTrack()->microtuner()->enabledModel()->value()) + { + auto centArray = std::array{}; + double lowestHz = pow(2., -69. / 12.) * 440.;// Frequency of MIDI note 0, which is approximately 8.175798916 Hz + for (int i = 0; i < 128; ++i) + { + // Get desired Hz of note + double noteHz = instrumentTrack()->microtuner()->keyToFreq(i, DefaultBaseKey); + // Convert Hz to cents + centArray[i] = noteHz == 0. ? 0. : 1200. * log2(noteHz / lowestHz); + } + + fluid_synth_activate_key_tuning(m_synth, 0, 0, "", centArray.data(), true); + for (int chan = 0; chan < 16; chan++) + { + fluid_synth_activate_tuning(m_synth, chan, 0, 0, true); + } + } + else + { + fluid_synth_activate_key_tuning(m_synth, 0, 0, "", nullptr, true); + for (int chan = 0; chan < 16; chan++) + { + fluid_synth_activate_tuning(m_synth, chan, 0, 0, true); + } + } +} + + + void Sf2Instrument::reloadSynth() { double tempRate; @@ -604,6 +645,7 @@ void Sf2Instrument::reloadSynth() updateReverbOn(); updateChorusOn(); updateGain(); + updateTuning(); // Reset last MIDI pitch properties, which will be set to the correct values // upon playing the next note @@ -622,18 +664,19 @@ void Sf2Instrument::playNote( NotePlayHandle * _n, sampleFrame * ) } const f_cnt_t tfp = _n->totalFramesPlayed(); + + int masterPitch = instrumentTrack()->useMasterPitchModel()->value() ? Engine::getSong()->masterPitch() : 0; + int baseNote = instrumentTrack()->baseNoteModel()->value(); + int midiNote = _n->midiKey() - baseNote + DefaultBaseKey + masterPitch; - if( tfp == 0 ) + // out of range? + if (midiNote < 0 || midiNote >= 128) { - const float LOG440 = 2.643452676f; + return; + } - int midiNote = (int)floor( 12.0 * ( log2( _n->unpitchedFrequency() ) - LOG440 ) - 4.0 ); - - // out of range? - if( midiNote <= 0 || midiNote >= 128 ) - { - return; - } + if (tfp == 0) + { const int baseVelocity = instrumentTrack()->midiPort()->baseVelocity(); auto pluginData = new Sf2PluginData; diff --git a/plugins/Sf2Player/Sf2Player.h b/plugins/Sf2Player/Sf2Player.h index 7cad284c0..5a88d0f95 100644 --- a/plugins/Sf2Player/Sf2Player.h +++ b/plugins/Sf2Player/Sf2Player.h @@ -111,7 +111,7 @@ public slots: void updateChorusOn(); void updateChorus(); void updateGain(); - + void updateTuning(); private: static QMutex s_fontsMutex; From 79def0c3b544826ceb7c72fbd3dd9e602c75a058 Mon Sep 17 00:00:00 2001 From: PrestonXPitzer Date: Wed, 23 Nov 2022 12:18:48 -0500 Subject: [PATCH 53/55] Changed Whitespace removed whitespace in Piano.cpp and Piano.h to comply with LMMS coding convetions --- include/Piano.h | 12 ++++++------ src/core/Piano.cpp | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/include/Piano.h b/include/Piano.h index 01a20046d..531bb65a6 100644 --- a/include/Piano.h +++ b/include/Piano.h @@ -44,17 +44,17 @@ public: BlackKey } ; - Piano( InstrumentTrack* track ); + Piano(InstrumentTrack* track); - void setKeyState( int key, bool state ); + void setKeyState(int key, bool state); - bool isKeyPressed( int key ) const + bool isKeyPressed(int key) const { return m_pressedKeys[key]; } - void handleKeyPress( int key, int midiVelocity = -1 ); - void handleKeyRelease( int key ); + void handleKeyPress(int key, int midiVelocity = -1); + void handleKeyRelease(int key); InstrumentTrack* instrumentTrack() const { @@ -75,7 +75,7 @@ public: static const unsigned int NumBlackKeys = 53; private: - static bool isValidKey( int key ) + static bool isValidKey(int key) { return key >= 0 && key < NumKeys; } diff --git a/src/core/Piano.cpp b/src/core/Piano.cpp index 0f59dd905..82323526e 100644 --- a/src/core/Piano.cpp +++ b/src/core/Piano.cpp @@ -62,10 +62,10 @@ static const auto KEY_ORDER = std::array * * \param _it the InstrumentTrack window to attach to */ -Piano::Piano( InstrumentTrack* track ) : - Model( nullptr ), /*!< base class ctor */ - m_instrumentTrack( track ), - m_midiEvProc( track ) /*!< the InstrumentTrack Model */ +Piano::Piano(InstrumentTrack* track) : + Model(nullptr), /*!< base class ctor */ + m_instrumentTrack(track), + m_midiEvProc(track) /*!< the InstrumentTrack Model */ { } @@ -74,9 +74,9 @@ Piano::Piano( InstrumentTrack* track ) : * \param key the key number to change * \param state the state to set the key to */ -void Piano::setKeyState( int key, bool state ) +void Piano::setKeyState(int key, bool state) { - if( isValidKey( key ) ) + if (isValidKey(key)) { m_pressedKeys[key] = state; @@ -91,15 +91,15 @@ void Piano::setKeyState( int key, bool state ) * * \param key the key being pressed */ -void Piano::handleKeyPress( int key, int midiVelocity ) +void Piano::handleKeyPress(int key, int midiVelocity) { - if( midiVelocity == -1 ) + if (midiVelocity == -1) { midiVelocity = m_instrumentTrack->midiPort()->baseVelocity(); } - if( isValidKey( key ) ) + if (isValidKey(key)) { - m_midiEvProc->processInEvent( MidiEvent( MidiNoteOn, -1, key, midiVelocity ) ); + m_midiEvProc->processInEvent(MidiEvent(MidiNoteOn, -1, key, midiVelocity)); m_pressedKeys[key] = true; } } @@ -112,18 +112,18 @@ void Piano::handleKeyPress( int key, int midiVelocity ) * * \param key the key being releassed */ -void Piano::handleKeyRelease( int key ) +void Piano::handleKeyRelease(int key) { - if( isValidKey( key ) ) + if (isValidKey(key)) { - m_midiEvProc->processInEvent( MidiEvent( MidiNoteOff, -1, key, 0 ) ); + m_midiEvProc->processInEvent(MidiEvent(MidiNoteOff, -1, key, 0)); m_pressedKeys[key] = false; } } -bool Piano::isBlackKey( int key ) +bool Piano::isBlackKey(int key) { int keyCode = key % KeysPerOctave; @@ -131,9 +131,9 @@ bool Piano::isBlackKey( int key ) } -bool Piano::isWhiteKey( int key ) +bool Piano::isWhiteKey(int key) { - return !isBlackKey( key ); + return !isBlackKey(key); } From d95c89760aad13a2b3b12ff5210effe4aea81e15 Mon Sep 17 00:00:00 2001 From: Dominic Clark Date: Mon, 2 Jan 2023 23:42:46 +0000 Subject: [PATCH 54/55] Support ZynAddSubFx with MSVC (#6561) --- .github/workflows/build.yml | 4 +- CMakeLists.txt | 7 ++ cmake/modules/PluginList.cmake | 1 - include/IoHelper.h | 6 +- plugins/ZynAddSubFx/CMakeLists.txt | 110 ++++++++++------------ plugins/ZynAddSubFx/LocalZynAddSubFx.cpp | 50 ++++++---- plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp | 60 ++++-------- plugins/ZynAddSubFx/ThreadShims.h | 9 ++ plugins/ZynAddSubFx/zynaddsubfx | 2 +- tests/scripted/check-namespace | 6 +- 10 files changed, 120 insertions(+), 135 deletions(-) create mode 100644 plugins/ZynAddSubFx/ThreadShims.h diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b51857402..007842b82 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -225,8 +225,8 @@ jobs: --triplet=${{ matrix.arch }}-windows ` --host-triplet=${{ matrix.arch }}-windows ` --recurse ` - fftw3 fluidsynth[sndfile] libsamplerate libsndfile libstk lilv lv2 ` - portaudio sdl2 + fftw3 fltk fluidsynth[sndfile] libsamplerate libsndfile libstk ` + lilv lv2 portaudio sdl2 - name: Set up build environment uses: ilammy/msvc-dev-cmd@d8610e2b41c6d0f0c3b4c46dad8df0fd826c68e1 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 2d5730bdf..c5de064a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -486,6 +486,13 @@ ENDIF(WANT_JACK) FIND_PACKAGE(FFTW COMPONENTS fftw3f REQUIRED) # check for FLTK +set(FLTK_SKIP_OPENGL TRUE) +set(FLTK_SKIP_FORMS TRUE) +set(FLTK_SKIP_IMAGES TRUE) +set(FLTK_SKIP_MATH TRUE) +if(MINGW_PREFIX) + set(FLTK_SKIP_FLUID TRUE) +endif() FIND_PACKAGE(FLTK) IF(FLTK_FOUND) SET(STATUS_ZYN "OK") diff --git a/cmake/modules/PluginList.cmake b/cmake/modules/PluginList.cmake index 151c5bd66..fe98a64b4 100644 --- a/cmake/modules/PluginList.cmake +++ b/cmake/modules/PluginList.cmake @@ -100,7 +100,6 @@ ENDIF() IF(MSVC) SET(MSVC_INCOMPATIBLE_PLUGINS LadspaEffect - ZynAddSubFx ) message(WARNING "Compiling with MSVC. The following plugins are not available: ${MSVC_INCOMPATIBLE_PLUGINS}") LIST(REMOVE_ITEM PLUGIN_LIST ${MSVC_INCOMPATIBLE_PLUGINS}) diff --git a/include/IoHelper.h b/include/IoHelper.h index c7d65c917..96d6aa144 100644 --- a/include/IoHelper.h +++ b/include/IoHelper.h @@ -47,7 +47,7 @@ namespace lmms #ifdef _WIN32 -std::wstring toWString(const std::string& s) +inline std::wstring toWString(const std::string& s) { std::wstring ret; int len = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, s.data(), @@ -64,7 +64,7 @@ std::wstring toWString(const std::string& s) #endif -FILE* F_OPEN_UTF8(std::string const& fname, const char* mode){ +inline FILE* F_OPEN_UTF8(std::string const& fname, const char* mode){ #ifdef LMMS_BUILD_WIN32 return _wfopen(toWString(fname).data(), toWString(mode).data()); #else @@ -73,7 +73,7 @@ FILE* F_OPEN_UTF8(std::string const& fname, const char* mode){ } -int fileToDescriptor(FILE* f, bool closeFile = true) +inline int fileToDescriptor(FILE* f, bool closeFile = true) { int fh; if (f == nullptr) {return -1;} diff --git a/plugins/ZynAddSubFx/CMakeLists.txt b/plugins/ZynAddSubFx/CMakeLists.txt index b184162a3..3369a7938 100644 --- a/plugins/ZynAddSubFx/CMakeLists.txt +++ b/plugins/ZynAddSubFx/CMakeLists.txt @@ -1,5 +1,12 @@ +if(NOT FLTK_FOUND) + return() +endif() + INCLUDE(BuildPlugin) +find_package(Threads REQUIRED) +find_package(ZLIB REQUIRED) + set(CMAKE_POSITION_INDEPENDENT_CODE ON) # definitions for ZynAddSubFX @@ -11,40 +18,20 @@ ELSE() ADD_DEFINITIONS(-DOS_WINDOWS) ENDIF() -# do not conflict with LMMS' Controller class -ADD_DEFINITIONS(-DController=ZynController) - # use asm optimizations when on x86 or x86_64 -IF(LMMS_HOST_X86 OR LMMS_HOST_X86_64) +if(NOT MSVC AND (LMMS_HOST_X86 OR LMMS_HOST_X86_64)) ADD_DEFINITIONS(-DASM_F2I_YES) -ENDIF(LMMS_HOST_X86 OR LMMS_HOST_X86_64) +endif() # build ZynAddSubFX with full optimizations -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wno-write-strings -Wno-deprecated-declarations -fpermissive") +if(NOT MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wno-write-strings -Wno-deprecated-declarations -fpermissive") +endif() IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND NOT "${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "6.0.0") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-misleading-indentation") ENDIF() -IF(LMMS_BUILD_WIN32) - # link system-libraries - ADD_DEFINITIONS(-DPTW32_STATIC_LIB) - # fix X11 headers errors caused by bug with mingw + c++11 (enable -std=gnu++0x) - SET(CMAKE_CXX_EXTENSIONS ON) -ENDIF(LMMS_BUILD_WIN32) - -SET(FLTK_SKIP_OPENGL TRUE) -SET(FLTK_SKIP_FORMS TRUE) -SET(FLTK_SKIP_IMAGES TRUE) -SET(FLTK_SKIP_MATH TRUE) -IF(MINGW_PREFIX) - SET(FLTK_SKIP_FLUID TRUE) -ENDIF() - -IF(NOT FLTK_FOUND) - RETURN() -ENDIF() - IF(MINGW_PREFIX) SET(FLTK_FLUID_EXECUTABLE "${MINGW_PREFIX}/bin/fluid") ENDIF() @@ -57,13 +44,15 @@ IF(NOT EXISTS ${FLTK_FLUID_EXECUTABLE}) ENDIF() ENDIF() -INCLUDE_DIRECTORIES("${FLTK_INCLUDE_DIR}" - "${CMAKE_CURRENT_SOURCE_DIR}" - ${FFTW3F_INCLUDE_DIRS} - "${CMAKE_CURRENT_BINARY_DIR}" - "${CMAKE_BINARY_DIR}") - -include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/zynaddsubfx/src/UI) +include_directories( + "${FLTK_INCLUDE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}" + ${FFTW3F_INCLUDE_DIRS} + "${CMAKE_CURRENT_BINARY_DIR}" + "${CMAKE_BINARY_DIR}" + "${CMAKE_SOURCE_DIR}/src/3rdparty/mingw-std-threads" + "${CMAKE_CURRENT_SOURCE_DIR}/zynaddsubfx/src/UI" +) ADD_DEFINITIONS(-DPLUGINVERSION) # removes exit confirmation dialogs etc. in MasterUI.fl add_subdirectory(zynaddsubfx/src/Nio) @@ -116,24 +105,23 @@ SET(zynaddsubfx_core_SRCS zynaddsubfx/src/Synth/PADnote.cpp zynaddsubfx/src/Synth/Resonance.cpp zynaddsubfx/src/Synth/SUBnote.cpp - ) +) +add_library(ZynAddSubFxCoreObjs OBJECT LocalZynAddSubFx.cpp ${zynaddsubfx_core_SRCS}) +add_library(ZynAddSubFxCore INTERFACE) +target_sources(ZynAddSubFxCore INTERFACE + $ + $ +) -IF(LMMS_BUILD_LINUX) - ADD_LIBRARY(ZynAddSubFxCore MODULE LocalZynAddSubFx.cpp ${zynaddsubfx_core_SRCS}) -ELSE() - ADD_LIBRARY(ZynAddSubFxCore SHARED LocalZynAddSubFx.cpp ${zynaddsubfx_core_SRCS}) -ENDIF() -TARGET_LINK_LIBRARIES(ZynAddSubFxCore zynaddsubfx_nio ${FFTW3F_LIBRARIES} ${QT_LIBRARIES} -lz -lpthread) - -TARGET_LINK_LIBRARIES(ZynAddSubFxCore Qt5::Widgets Qt5::Xml) - -IF(LMMS_BUILD_WIN32) - TARGET_LINK_LIBRARIES(ZynAddSubFxCore -lws2_32) - INSTALL(TARGETS ZynAddSubFxCore RUNTIME DESTINATION "${PLUGIN_DIR}") -ELSE(LMMS_BUILD_WIN32) - INSTALL(TARGETS ZynAddSubFxCore LIBRARY DESTINATION "${PLUGIN_DIR}") -ENDIF(LMMS_BUILD_WIN32) +target_link_libraries(ZynAddSubFxCore INTERFACE + ${FFTW3F_LIBRARIES} + ${QT_LIBRARIES} + Qt5::Widgets + Qt5::Xml + Threads::Threads + ZLIB::ZLIB +) LINK_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}/..") IF(LMMS_BUILD_LINUX) @@ -144,10 +132,11 @@ ELSE() SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${PLUGIN_DIR}") ENDIF() BUILD_PLUGIN(zynaddsubfx ZynAddSubFx.cpp ZynAddSubFx.h MOCFILES ZynAddSubFx.h EMBEDDED_RESOURCES artwork.png logo.png) -TARGET_LINK_LIBRARIES(zynaddsubfx -lZynAddSubFxCore) -ADD_DEPENDENCIES(zynaddsubfx ZynAddSubFxCore) +target_link_libraries(zynaddsubfx ZynAddSubFxCore) -IF(WIN32) +if(MSVC) + set(WINRC "${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfx.rc") +elseif(WIN32) SET(WINRC "${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfxrc.obj") ADD_CUSTOM_COMMAND(OUTPUT "${WINRC}" COMMAND "${CMAKE_RC_COMPILER}" @@ -155,14 +144,19 @@ IF(WIN32) "-o\"${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfxrc.obj\"" "-i\"${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfx.rc\"" DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/zynaddsubfx.rc") -ENDIF(WIN32) +endif() # Use libraries in non-standard directories (e.g., another version of Qt) SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) ADD_SUBDIRECTORY("${LMMS_SOURCE_DIR}/src/common" common) -ADD_EXECUTABLE(RemoteZynAddSubFx RemoteZynAddSubFx.cpp ${LMMS_COMMON_SRCS} "${WINRC}") +add_executable(RemoteZynAddSubFx + RemoteZynAddSubFx.cpp + ${LMMS_COMMON_SRCS} + "${WINRC}" + $ +) INSTALL(TARGETS RemoteZynAddSubFx RUNTIME DESTINATION "${PLUGIN_DIR}") # Needed to deploy dependencies of RemoteZynAddSubFx SET_PROPERTY(GLOBAL APPEND PROPERTY PLUGINS_BUILT "RemoteZynAddSubFx") @@ -182,8 +176,7 @@ IF(FLTK_CONFIG AND NOT (LMMS_BUILD_APPLE OR LMMS_BUILD_WIN32)) STRING(REPLACE " " ";" FLTK_FILTERED_LDFLAGS ${FLTK_FILTERED_LDFLAGS}) LIST(REMOVE_ITEM FLTK_FILTERED_LDFLAGS -lX11) ENDIF() -TARGET_LINK_LIBRARIES(RemoteZynAddSubFx zynaddsubfx_gui -lZynAddSubFxCore ${FLTK_FILTERED_LDFLAGS} -lpthread ) -ADD_DEPENDENCIES(RemoteZynAddSubFx ZynAddSubFxCore) +target_link_libraries(RemoteZynAddSubFx ZynAddSubFxCore ${FLTK_FILTERED_LDFLAGS}) if(LMMS_HAVE_LIBRT) target_link_libraries(RemoteZynAddSubFx rt) @@ -199,13 +192,6 @@ ENDIF(LMMS_BUILD_WIN32) IF(LMMS_BUILD_WIN32) - add_custom_command( - TARGET ZynAddSubFxCore - POST_BUILD - COMMAND "${STRIP_COMMAND}" "$" - VERBATIM - COMMAND_EXPAND_LISTS - ) add_custom_command( TARGET RemoteZynAddSubFx POST_BUILD diff --git a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp index f09cb6662..83ef3e9a2 100644 --- a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp @@ -22,19 +22,25 @@ * */ -#include +#include "LocalZynAddSubFx.h" -#include "zynaddsubfx/src/Misc/Util.h" -#include #include -#include "LocalZynAddSubFx.h" +#include "lmmsconfig.h" + +#ifdef LMMS_BUILD_WIN32 +# include +# include "IoHelper.h" +#else +# include +#endif #include "MidiEvent.h" #include "zynaddsubfx/src/Nio/NulEngine.h" #include "zynaddsubfx/src/Misc/Master.h" #include "zynaddsubfx/src/Misc/Part.h" +#include "zynaddsubfx/src/Misc/Util.h" // Global variable in zynaddsubfx/src/globals.h SYNTH_T* synth = nullptr; @@ -53,14 +59,6 @@ LocalZynAddSubFx::LocalZynAddSubFx() : { if( s_instanceCount == 0 ) { -#ifdef LMMS_BUILD_WIN32 -#ifndef __WINPTHREADS_VERSION - // (non-portable) initialization of statically linked pthread library - pthread_win32_process_attach_np(); - pthread_win32_thread_attach_np(); -#endif -#endif // LMMS_BUILD_WIN32 - initConfig(); synth = new SYNTH_T; @@ -143,14 +141,20 @@ void LocalZynAddSubFx::loadXML( const std::string & _filename ) { char * f = strdup( _filename.c_str() ); - pthread_mutex_lock( &m_master->mutex ); - m_master->defaults(); - m_master->loadXML( f ); - pthread_mutex_unlock( &m_master->mutex ); + { + const auto lock = std::lock_guard{m_master->mutex}; + m_master->defaults(); + m_master->loadXML( f ); + } m_master->applyparameters(); +#ifdef LMMS_BUILD_WIN32 + _wunlink(toWString(_filename).c_str()); +#else unlink( f ); +#endif + free( f ); } @@ -161,10 +165,11 @@ void LocalZynAddSubFx::loadPreset( const std::string & _filename, int _part ) { char * f = strdup( _filename.c_str() ); - pthread_mutex_lock( &m_master->mutex ); - m_master->part[_part]->defaultsinstrument(); - m_master->part[_part]->loadXMLinstrument( f ); - pthread_mutex_unlock( &m_master->mutex ); + { + const auto lock = std::lock_guard{m_master->mutex}; + m_master->part[_part]->defaultsinstrument(); + m_master->part[_part]->loadXMLinstrument( f ); + } m_master->applyparameters(); @@ -262,8 +267,13 @@ void LocalZynAddSubFx::processMidiEvent( const MidiEvent& event ) void LocalZynAddSubFx::processAudio( sampleFrame * _out ) { +#ifdef _MSC_VER + const auto outputl = static_cast(_alloca(synth->buffersize * sizeof(float))); + const auto outputr = static_cast(_alloca(synth->buffersize * sizeof(float))); +#else float outputl[synth->buffersize]; float outputr[synth->buffersize]; +#endif m_master->GetAudioOutSamples( synth->buffersize, synth->samplerate, outputl, outputr ); diff --git a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp index 4c69beed0..c4d6b71a1 100644 --- a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp +++ b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp @@ -22,17 +22,19 @@ * */ +#include "RemoteZynAddSubFx.h" + #include #ifdef LMMS_BUILD_WIN32 #include #endif #include +#include "ThreadShims.h" #undef CursorShape // is, by mistake, not undefed in FL #include "RemotePluginClient.h" -#include "RemoteZynAddSubFx.h" #include "LocalZynAddSubFx.h" #include "zynaddsubfx/src/Nio/Nio.h" @@ -60,12 +62,12 @@ public: sendMessage( IdInitDone ); waitForMessage( IdInitDone ); - pthread_mutex_init( &m_guiMutex, nullptr ); - pthread_create( &m_messageThreadHandle, nullptr, messageLoop, this ); + m_messageThread = std::thread{&RemoteZynAddSubFx::messageLoop, this}; } ~RemoteZynAddSubFx() override { + m_messageThread.join(); Nio::stop(); } @@ -84,9 +86,8 @@ public: message m; while( ( m = receiveMessage() ).id != IdQuit ) { - pthread_mutex_lock( &m_master->mutex ); + const auto lock = std::lock_guard{m_master->mutex}; processMessage( m ); - pthread_mutex_unlock( &m_master->mutex ); } m_guiExit = true; } @@ -102,9 +103,10 @@ public: case IdHideUI: case IdLoadSettingsFromFile: case IdLoadPresetFile: - pthread_mutex_lock( &m_guiMutex ); - m_guiMessages.push( _m ); - pthread_mutex_unlock( &m_guiMutex ); + { + const auto lock = std::lock_guard{m_guiMutex}; + m_guiMessages.push( _m ); + } break; case IdSaveSettingsToFile: @@ -144,22 +146,13 @@ public: LocalZynAddSubFx::processAudio( _out ); } - static void * messageLoop( void * _arg ) - { - auto _this = static_cast(_arg); - - _this->messageLoop(); - - return nullptr; - } - void guiLoop(); private: const int m_guiSleepTime; - pthread_t m_messageThreadHandle; - pthread_mutex_t m_guiMutex; + std::thread m_messageThread; + std::mutex m_guiMutex; std::queue m_guiMessages; bool m_guiExit; @@ -189,12 +182,11 @@ void RemoteZynAddSubFx::guiLoop() } if( exitProgram == 1 ) { - pthread_mutex_lock( &m_master->mutex ); + const auto lock = std::lock_guard{m_master->mutex}; sendMessage( IdHideUI ); exitProgram = 0; - pthread_mutex_unlock( &m_master->mutex ); } - pthread_mutex_lock( &m_guiMutex ); + const auto lock = std::lock_guard{m_guiMutex}; while( m_guiMessages.size() ) { RemotePluginClient::message m = m_guiMessages.front(); @@ -219,9 +211,8 @@ void RemoteZynAddSubFx::guiLoop() { ui->refresh_master_ui(); } - pthread_mutex_lock( &m_master->mutex ); + const auto lock = std::lock_guard{m_master->mutex}; sendMessage( IdLoadSettingsFromFile ); - pthread_mutex_unlock( &m_master->mutex ); break; } @@ -235,9 +226,8 @@ void RemoteZynAddSubFx::guiLoop() ui->updatepanel(); ui->refresh_master_ui(); } - pthread_mutex_lock( &m_master->mutex ); + const auto lock = std::lock_guard{m_master->mutex}; sendMessage( IdLoadPresetFile ); - pthread_mutex_unlock( &m_master->mutex ); break; } @@ -245,7 +235,6 @@ void RemoteZynAddSubFx::guiLoop() break; } } - pthread_mutex_unlock( &m_guiMutex ); } Fl::flush(); @@ -271,15 +260,6 @@ int main( int _argc, char * * _argv ) const auto pollParentThread = PollParentThread{}; #endif -#ifdef LMMS_BUILD_WIN32 -#ifndef __WINPTHREADS_VERSION - // (non-portable) initialization of statically linked pthread library - pthread_win32_process_attach_np(); - pthread_win32_thread_attach_np(); -#endif -#endif // LMMS_BUILD_WIN32 - - #ifdef SYNC_WITH_SHM_FIFO RemoteZynAddSubFx * remoteZASF = new RemoteZynAddSubFx( _argv[1], _argv[2] ); @@ -291,14 +271,6 @@ int main( int _argc, char * * _argv ) delete remoteZASF; - -#ifdef LMMS_BUILD_WIN32 -#ifndef __WINPTHREADS_VERSION - pthread_win32_thread_detach_np(); - pthread_win32_process_detach_np(); -#endif -#endif // LMMS_BUILD_WIN32 - return 0; } diff --git a/plugins/ZynAddSubFx/ThreadShims.h b/plugins/ZynAddSubFx/ThreadShims.h new file mode 100644 index 000000000..843b50fb5 --- /dev/null +++ b/plugins/ZynAddSubFx/ThreadShims.h @@ -0,0 +1,9 @@ +#include +#include +#include + +#if defined(__MINGW32__) && !defined(_GLIBCXX_HAS_GTHREADS) +# include +# include +# include +#endif diff --git a/plugins/ZynAddSubFx/zynaddsubfx b/plugins/ZynAddSubFx/zynaddsubfx index b9855dbe1..551e816a6 160000 --- a/plugins/ZynAddSubFx/zynaddsubfx +++ b/plugins/ZynAddSubFx/zynaddsubfx @@ -1 +1 @@ -Subproject commit b9855dbe16424edc528a6796ddbc50b1042482c7 +Subproject commit 551e816a6334fd190c74ce971378063b2757b47b diff --git a/tests/scripted/check-namespace b/tests/scripted/check-namespace index 5f71505b2..a816f0d7b 100755 --- a/tests/scripted/check-namespace +++ b/tests/scripted/check-namespace @@ -77,7 +77,9 @@ exclude_files = re.compile( 'plugins/MidiExport/MidiFile.hpp|' 'plugins/ReverbSC/[a-z]|' 'plugins/Sf2Player/fluidsynthshims.h|' - '/portsmf/' + '/portsmf/|' + # only forward to headers that are not ours: + 'plugins/ZynAddSubFx/ThreadShims.h' ) files = [Path(f) for f in result.stdout.splitlines() if not exclude_files.search(f)] @@ -131,7 +133,7 @@ for cur_file in files: if cur_file.is_file(): cur_text = cur_file.read_text(errors='replace') - if str(cur_file) not in known_no_namespace_lmms: + if cur_file.as_posix() not in known_no_namespace_lmms: namespace_pattern.search(cur_text) or error(cur_file, None, f'File has no namespace lmms') header_guard = str(cur_file).endswith('.h') From 679d63224a89203280d65e3d8995a931cec519ff Mon Sep 17 00:00:00 2001 From: saker Date: Tue, 3 Jan 2023 18:26:57 -0500 Subject: [PATCH 55/55] Resample SampleBuffer only once when loading from SampleClip (#6594) The SampleBuffer's sample rate in SampleClip was altered twice during SampleClip::loadSettings: first when setSampleFile was called, which set the sample rate of the SampleBuffer to the AudioEngine's sample rate (good), and a second time when calling setSampleRate, which set it to the sample rate specified within the project file (bad). This led to the sample rate of the buffer being different than that of the project, resulting in it being pitched incorrectly on playback. --- src/core/SampleClip.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/SampleClip.cpp b/src/core/SampleClip.cpp index 1d173d78e..6396d49f3 100644 --- a/src/core/SampleClip.cpp +++ b/src/core/SampleClip.cpp @@ -292,15 +292,15 @@ void SampleClip::loadSettings( const QDomElement & _this ) if( sampleFile().isEmpty() && _this.hasAttribute( "data" ) ) { m_sampleBuffer->loadFromBase64( _this.attribute( "data" ) ); + if (_this.hasAttribute("sample_rate")) + { + m_sampleBuffer->setSampleRate(_this.attribute("sample_rate").toInt()); + } } changeLength( _this.attribute( "len" ).toInt() ); setMuted( _this.attribute( "muted" ).toInt() ); setStartTimeOffset( _this.attribute( "off" ).toInt() ); - if ( _this.hasAttribute( "sample_rate" ) ) { - m_sampleBuffer->setSampleRate( _this.attribute( "sample_rate" ).toInt() ); - } - if( _this.hasAttribute( "color" ) ) { useCustomClipColor( true );