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)