diff --git a/data/locale/ar.ts b/data/locale/ar.ts index 8e989509dab..1f159c42a2a 100644 --- a/data/locale/ar.ts +++ b/data/locale/ar.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/bs.ts b/data/locale/bs.ts index 013585b5fac..506b401bd61 100644 --- a/data/locale/bs.ts +++ b/data/locale/bs.ts @@ -4416,7 +4416,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ca.ts b/data/locale/ca.ts index 3512b48716d..765cf3b6081 100644 --- a/data/locale/ca.ts +++ b/data/locale/ca.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/cs.ts b/data/locale/cs.ts index 7951c75b9a6..0ed175022be 100644 --- a/data/locale/cs.ts +++ b/data/locale/cs.ts @@ -7157,7 +7157,7 @@ Poklepejte pro výběr souboru. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/de.ts b/data/locale/de.ts index ef4d946341b..51ca7d56204 100644 --- a/data/locale/de.ts +++ b/data/locale/de.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/el.ts b/data/locale/el.ts index b543854d399..320a6657f61 100644 --- a/data/locale/el.ts +++ b/data/locale/el.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/en.ts b/data/locale/en.ts index b58d27f3093..e52ae39ab7e 100644 --- a/data/locale/en.ts +++ b/data/locale/en.ts @@ -7157,7 +7157,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/eo.ts b/data/locale/eo.ts index b133d802952..005ee8100bf 100644 --- a/data/locale/eo.ts +++ b/data/locale/eo.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/es.ts b/data/locale/es.ts index 8fb16442157..4fc4951ef92 100644 --- a/data/locale/es.ts +++ b/data/locale/es.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/eu.ts b/data/locale/eu.ts index 9642a3ff269..25c165f81f8 100644 --- a/data/locale/eu.ts +++ b/data/locale/eu.ts @@ -7436,7 +7436,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/fa.ts b/data/locale/fa.ts index 4e72345fd8b..181ca0ca1ff 100644 --- a/data/locale/fa.ts +++ b/data/locale/fa.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/fr.ts b/data/locale/fr.ts index 85f4433094c..2c65444a8e0 100644 --- a/data/locale/fr.ts +++ b/data/locale/fr.ts @@ -7448,7 +7448,7 @@ Double-cliquez pour choisir un fichier. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/gl.ts b/data/locale/gl.ts index 38a80a5da97..cf04fd5d428 100644 --- a/data/locale/gl.ts +++ b/data/locale/gl.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/he.ts b/data/locale/he.ts index 783b473b7e0..ee5a23613b2 100644 --- a/data/locale/he.ts +++ b/data/locale/he.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/hi_IN.ts b/data/locale/hi_IN.ts index 5ba65acd64f..15550231f85 100644 --- a/data/locale/hi_IN.ts +++ b/data/locale/hi_IN.ts @@ -7157,7 +7157,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/hu_HU.ts b/data/locale/hu_HU.ts index f82ff12c496..83605994674 100644 --- a/data/locale/hu_HU.ts +++ b/data/locale/hu_HU.ts @@ -7162,7 +7162,7 @@ Kattints duplán egy fájl kiválasztásához. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/id.ts b/data/locale/id.ts index b55f6c98c2b..e381ea726d8 100644 --- a/data/locale/id.ts +++ b/data/locale/id.ts @@ -7160,7 +7160,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/it.ts b/data/locale/it.ts index 29865352a15..ff146d47120 100644 --- a/data/locale/it.ts +++ b/data/locale/it.ts @@ -7169,7 +7169,7 @@ Fai doppio click per scegliere un file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ja.ts b/data/locale/ja.ts index 28fda3123f8..e10ca511818 100644 --- a/data/locale/ja.ts +++ b/data/locale/ja.ts @@ -7157,7 +7157,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ka.ts b/data/locale/ka.ts index b48b3f2b07d..1956d8d04e5 100644 --- a/data/locale/ka.ts +++ b/data/locale/ka.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ko.ts b/data/locale/ko.ts index 78cfbdd5c2f..7373b5ca9a7 100644 --- a/data/locale/ko.ts +++ b/data/locale/ko.ts @@ -7160,7 +7160,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ms_MY.ts b/data/locale/ms_MY.ts index 533efdcad66..209d51d108c 100644 --- a/data/locale/ms_MY.ts +++ b/data/locale/ms_MY.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/nb.ts b/data/locale/nb.ts index 41865ef0c73..3675b7f589c 100644 --- a/data/locale/nb.ts +++ b/data/locale/nb.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/nl.ts b/data/locale/nl.ts index 2eaa6b15431..ad630a249c9 100644 --- a/data/locale/nl.ts +++ b/data/locale/nl.ts @@ -7158,7 +7158,7 @@ Dubbelklikken om een bestand te kiezen. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/oc.ts b/data/locale/oc.ts index 8df1aa1a117..58c81c96453 100644 --- a/data/locale/oc.ts +++ b/data/locale/oc.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/pl.ts b/data/locale/pl.ts index 340be33d81a..bb0c64edec0 100644 --- a/data/locale/pl.ts +++ b/data/locale/pl.ts @@ -7441,7 +7441,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/pt.ts b/data/locale/pt.ts index f94f22920e6..b375e289f38 100644 --- a/data/locale/pt.ts +++ b/data/locale/pt.ts @@ -7158,7 +7158,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ro.ts b/data/locale/ro.ts index ca148f452b5..eceb45a6485 100644 --- a/data/locale/ro.ts +++ b/data/locale/ro.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/ru.ts b/data/locale/ru.ts index 40e385d2c3f..8235f291f34 100644 --- a/data/locale/ru.ts +++ b/data/locale/ru.ts @@ -7178,7 +7178,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/sl.ts b/data/locale/sl.ts index dd96809765d..3ad55a4c044 100644 --- a/data/locale/sl.ts +++ b/data/locale/sl.ts @@ -7155,7 +7155,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/sr.ts b/data/locale/sr.ts index a8c1fd96dc1..9b90164ab3b 100644 --- a/data/locale/sr.ts +++ b/data/locale/sr.ts @@ -3550,7 +3550,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/sv.ts b/data/locale/sv.ts index 882524c50a8..4963b07a9ad 100644 --- a/data/locale/sv.ts +++ b/data/locale/sv.ts @@ -7447,7 +7447,7 @@ Dubbelklicka för att välja en fil. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/tr.ts b/data/locale/tr.ts index fa4ccb696cd..387be6d8b96 100644 --- a/data/locale/tr.ts +++ b/data/locale/tr.ts @@ -7449,7 +7449,7 @@ Bir dosya seçmek için çift tıklayın. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/uk.ts b/data/locale/uk.ts index 84cc8189910..50df10e4b72 100644 --- a/data/locale/uk.ts +++ b/data/locale/uk.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/zh_CN.ts b/data/locale/zh_CN.ts index 301d54362f0..63b22df9902 100644 --- a/data/locale/zh_CN.ts +++ b/data/locale/zh_CN.ts @@ -7166,7 +7166,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/locale/zh_TW.ts b/data/locale/zh_TW.ts index a190c831cda..791a45599f9 100644 --- a/data/locale/zh_TW.ts +++ b/data/locale/zh_TW.ts @@ -7156,7 +7156,7 @@ Double click to pick a file. - LmmsCore + Engine Generating wavetables diff --git a/data/themes/classic/style.css b/data/themes/classic/style.css index ea3cbf4a2d9..58ec5dc0927 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 b10e493e71a..f4c651c9e65 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 93aca988d59..c7d65023fe2 100644 --- a/include/AboutDialog.h +++ b/include/AboutDialog.h @@ -30,6 +30,8 @@ #include "ui_about_dialog.h" +namespace lmms::gui +{ class AboutDialog : public QDialog, public Ui::AboutDialog { @@ -38,6 +40,7 @@ class AboutDialog : public QDialog, public Ui::AboutDialog } ; +} // namespace lmms::gui #endif diff --git a/include/ActionGroup.h b/include/ActionGroup.h index 226e3913625..0fe9d78ed41 100644 --- a/include/ActionGroup.h +++ b/include/ActionGroup.h @@ -28,6 +28,9 @@ #include +namespace lmms::gui +{ + /// \brief Convenience subclass of QActionGroup /// /// This class provides the same functionality as QActionGroup, but in addition @@ -54,4 +57,6 @@ private slots: QList m_actions; }; +} // namespace lmms::gui + #endif diff --git a/include/AudioAlsa.h b/include/AudioAlsa.h index c8452d003e5..e1024b030a5 100644 --- a/include/AudioAlsa.h +++ b/include/AudioAlsa.h @@ -37,6 +37,8 @@ #include "AudioDevice.h" +namespace lmms +{ class AudioAlsa : public QThread, public AudioDevice { @@ -102,6 +104,8 @@ class AudioAlsa : public QThread, public AudioDevice } ; -#endif +} // namespace lmms + +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/AudioAlsaSetupWidget.h b/include/AudioAlsaSetupWidget.h index db88558a75b..9e168934e68 100644 --- a/include/AudioAlsaSetupWidget.h +++ b/include/AudioAlsaSetupWidget.h @@ -35,8 +35,11 @@ class QComboBox; -class LcdSpinBox; +namespace lmms::gui +{ + +class LcdSpinBox; class AudioAlsaSetupWidget : public AudioDeviceSetupWidget { @@ -59,6 +62,8 @@ public slots: AudioAlsa::DeviceInfoCollection m_deviceInfos; }; -#endif +} // namespace lmms::gui + +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/AudioDevice.h b/include/AudioDevice.h index 627ba470cba..6b4e9939aee 100644 --- a/include/AudioDevice.h +++ b/include/AudioDevice.h @@ -30,10 +30,13 @@ #include "lmms_basics.h" +class QThread; + +namespace lmms +{ class AudioEngine; class AudioPort; -class QThread; class AudioDevice @@ -153,7 +156,8 @@ class AudioDevice surroundSampleFrame * m_buffer; -} ; +}; +} // namespace lmms #endif diff --git a/include/AudioDeviceSetupWidget.h b/include/AudioDeviceSetupWidget.h index 9b82300bbc0..6bf656e0a7f 100644 --- a/include/AudioDeviceSetupWidget.h +++ b/include/AudioDeviceSetupWidget.h @@ -27,6 +27,8 @@ #include "TabWidget.h" +namespace lmms::gui +{ class AudioDeviceSetupWidget : public TabWidget { @@ -41,5 +43,6 @@ class AudioDeviceSetupWidget : public TabWidget virtual void show(); }; +} // namespace lmms::gui #endif diff --git a/include/AudioDummy.h b/include/AudioDummy.h index a0f2c528e8e..f2c198bbc33 100644 --- a/include/AudioDummy.h +++ b/include/AudioDummy.h @@ -30,6 +30,8 @@ #include "AudioEngine.h" #include "MicroTimer.h" +namespace lmms +{ class AudioDummy : public QThread, public AudioDevice { @@ -52,11 +54,11 @@ class AudioDummy : public QThread, public AudioDevice } - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ) : - AudioDeviceSetupWidget( AudioDummy::name(), _parent ) + gui::AudioDeviceSetupWidget( AudioDummy::name(), _parent ) { } @@ -114,5 +116,6 @@ class AudioDummy : public QThread, public AudioDevice } ; +} // namespace lmms #endif diff --git a/include/AudioEngine.h b/include/AudioEngine.h index 9cf01042685..034988c2968 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 @@ -316,7 +316,7 @@ class LMMS_EXPORT AudioEngine : public QObject signals: void qualitySettingsChanged(); void sampleRateChanged(); - void nextAudioBuffer( const surroundSampleFrame * buffer ); + void nextAudioBuffer( const lmms::surroundSampleFrame * buffer ); private: @@ -426,9 +426,11 @@ class LMMS_EXPORT AudioEngine : public QObject 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 19f0b612b38..136c6dbea1e 100644 --- a/include/AudioEngineProfiler.h +++ b/include/AudioEngineProfiler.h @@ -30,6 +30,9 @@ #include "lmms_basics.h" #include "MicroTimer.h" +namespace lmms +{ + class AudioEngineProfiler { public: @@ -57,4 +60,6 @@ class AudioEngineProfiler QFile m_outputFile; }; +} // namespace lmms + #endif diff --git a/include/AudioEngineWorkerThread.h b/include/AudioEngineWorkerThread.h index f86d41c9aec..811f75753e6 100644 --- a/include/AudioEngineWorkerThread.h +++ b/include/AudioEngineWorkerThread.h @@ -29,8 +29,12 @@ #include -class AudioEngine; class QWaitCondition; + +namespace lmms +{ + +class AudioEngine; class ThreadableJob; class AudioEngineWorkerThread : public QThread @@ -115,5 +119,6 @@ class AudioEngineWorkerThread : public QThread volatile bool m_quit; } ; +} // namespace lmms #endif diff --git a/include/AudioFileDevice.h b/include/AudioFileDevice.h index c21a55c4cbe..937cd9d0032 100644 --- a/include/AudioFileDevice.h +++ b/include/AudioFileDevice.h @@ -31,6 +31,8 @@ #include "AudioDevice.h" #include "OutputSettings.h" +namespace lmms +{ class AudioFileDevice : public AudioDevice { @@ -74,5 +76,6 @@ typedef AudioFileDevice * ( * AudioFileDeviceInstantiaton ) AudioEngine* audioEngine, bool & successful ); +} // namespace lmms #endif diff --git a/include/AudioFileFlac.h b/include/AudioFileFlac.h index 75e86d36827..675ab21d9ec 100644 --- a/include/AudioFileFlac.h +++ b/include/AudioFileFlac.h @@ -30,6 +30,9 @@ #include "AudioFileDevice.h" #include +namespace lmms +{ + class AudioFileFlac: public AudioFileDevice { public: @@ -71,4 +74,7 @@ class AudioFileFlac: public AudioFileDevice }; + +} // namespace lmms + #endif //AUDIO_FILE_FLAC_H diff --git a/include/AudioFileMP3.h b/include/AudioFileMP3.h index ab72ed68918..16c3617a88d 100644 --- a/include/AudioFileMP3.h +++ b/include/AudioFileMP3.h @@ -34,6 +34,8 @@ #include "lame/lame.h" +namespace lmms +{ class AudioFileMP3 : public AudioFileDevice { @@ -69,6 +71,8 @@ class AudioFileMP3 : public AudioFileDevice lame_t m_lame; }; -#endif +} // namespace lmms + +#endif // LMMS_HAVE_MP3LAME #endif diff --git a/include/AudioFileOgg.h b/include/AudioFileOgg.h index 9c7337e9cd5..7e6921015d1 100644 --- a/include/AudioFileOgg.h +++ b/include/AudioFileOgg.h @@ -34,6 +34,8 @@ #include "AudioFileDevice.h" +namespace lmms +{ class AudioFileOgg : public AudioFileDevice { @@ -107,6 +109,8 @@ class AudioFileOgg : public AudioFileDevice } ; -#endif +} // namespace lmms + +#endif // LMMS_HAVE_OGGVORBIS #endif diff --git a/include/AudioFileWave.h b/include/AudioFileWave.h index d8e537859f8..e9425dd86aa 100644 --- a/include/AudioFileWave.h +++ b/include/AudioFileWave.h @@ -31,6 +31,8 @@ #include +namespace lmms +{ class AudioFileWave : public AudioFileDevice { @@ -66,4 +68,7 @@ class AudioFileWave : public AudioFileDevice SNDFILE * m_sf; } ; + +} // namespace lmms + #endif diff --git a/include/AudioJack.h b/include/AudioJack.h index e74ac4782b9..648bb157df4 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 @@ class AudioJack : public QObject, public AudioDevice } - class setupWidget : public AudioDeviceSetupWidget +class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -76,7 +84,7 @@ class AudioJack : public QObject, public AudioDevice private: QLineEdit * m_clientName; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; @@ -132,6 +140,8 @@ private slots: } ; -#endif +} // namespace lmms + +#endif // LMMS_HAVE_JACK #endif diff --git a/include/AudioOss.h b/include/AudioOss.h index b1b5d839ccd..4a552040ba5 100644 --- a/include/AudioOss.h +++ b/include/AudioOss.h @@ -34,9 +34,16 @@ #include "AudioDevice.h" #include "AudioDeviceSetupWidget.h" +class QLineEdit; + +namespace lmms +{ +namespace gui +{ class LcdSpinBox; -class QLineEdit; +} + class AudioOss : public QThread, public AudioDevice @@ -54,7 +61,7 @@ class AudioOss : public QThread, public AudioDevice static QString probeDevice(); - class setupWidget : public AudioDeviceSetupWidget +class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -64,7 +71,7 @@ class AudioOss : public QThread, public AudioDevice private: QLineEdit * m_device; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; @@ -81,7 +88,8 @@ class AudioOss : public QThread, public AudioDevice } ; +} // namespace lmms -#endif +#endif // LMMS_HAVE_OSS #endif diff --git a/include/AudioPort.h b/include/AudioPort.h index 0f6c931d9f8..5a2645784da 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 @@ class AudioPort : public ThreadableJob } ; +} // namespace lmms #endif diff --git a/include/AudioPortAudio.h b/include/AudioPortAudio.h index 2d78af1c4fa..10dab74eb2c 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 @@ class AudioPortAudio : public AudioDevice unsigned long _framesPerBuffer ); - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -90,8 +100,8 @@ class AudioPortAudio : public AudioDevice virtual void show(); private: - ComboBox * m_backend; - ComboBox * m_device; + gui::ComboBox * m_backend; + gui::ComboBox * m_device; AudioPortAudioSetupUtil m_setupUtil; } ; @@ -149,6 +159,8 @@ class AudioPortAudio : public AudioDevice } ; -#endif +#endif // LMMS_HAVE_PORTAUDIO + +} // namespace lmms #endif diff --git a/include/AudioPulseAudio.h b/include/AudioPulseAudio.h index 3fe098d689e..70da0808763 100644 --- a/include/AudioPulseAudio.h +++ b/include/AudioPulseAudio.h @@ -36,9 +36,15 @@ #include "AudioDevice.h" #include "AudioDeviceSetupWidget.h" +class QLineEdit; + +namespace lmms +{ +namespace gui +{ class LcdSpinBox; -class QLineEdit; +} class AudioPulseAudio : public QThread, public AudioDevice @@ -56,7 +62,7 @@ class AudioPulseAudio : public QThread, public AudioDevice static QString probeDevice(); - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -66,7 +72,7 @@ class AudioPulseAudio : public QThread, public AudioDevice private: QLineEdit * m_device; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; @@ -94,6 +100,8 @@ class AudioPulseAudio : public QThread, public AudioDevice } ; +} // namespace lmms + #endif #endif diff --git a/include/AudioSampleRecorder.h b/include/AudioSampleRecorder.h index f5d5985c14a..294ffa17d99 100644 --- a/include/AudioSampleRecorder.h +++ b/include/AudioSampleRecorder.h @@ -31,6 +31,9 @@ #include "AudioDevice.h" +namespace lmms +{ + class SampleBuffer; @@ -54,5 +57,6 @@ class AudioSampleRecorder : public AudioDevice } ; +} // namespace lmms #endif diff --git a/include/AudioSdl.h b/include/AudioSdl.h index 30797301316..b49e2ebe97e 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 @@ class AudioSdl : public AudioDevice } - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -108,6 +110,9 @@ class AudioSdl : public AudioDevice } ; -#endif + +} // namespace lmms + +#endif // LMMS_HAVE_SDL #endif diff --git a/include/AudioSndio.h b/include/AudioSndio.h index 94fcfa93b66..5fb7c78fce4 100644 --- a/include/AudioSndio.h +++ b/include/AudioSndio.h @@ -36,9 +36,16 @@ #include "AudioDevice.h" #include "AudioDeviceSetupWidget.h" -class LcdSpinBox; class QLineEdit; +namespace lmms +{ + +namespace gui +{ +class LcdSpinBox; +} + class AudioSndio : public QThread, public AudioDevice { @@ -52,7 +59,7 @@ class AudioSndio : public QThread, public AudioDevice return QT_TRANSLATE_NOOP( "AudioDeviceSetupWidget", "sndio" ); } - class setupWidget : public AudioDeviceSetupWidget + class setupWidget : public gui::AudioDeviceSetupWidget { public: setupWidget( QWidget * _parent ); @@ -62,7 +69,7 @@ class AudioSndio : public QThread, public AudioDevice private: QLineEdit * m_device; - LcdSpinBox * m_channels; + gui::LcdSpinBox * m_channels; } ; private: @@ -78,6 +85,8 @@ class AudioSndio : public QThread, public AudioDevice } ; +} // namespace lmms + #endif /* LMMS_HAVE_SNDIO */ #endif /* _AUDIO_SNDIO_H */ diff --git a/include/AudioSoundIo.h b/include/AudioSoundIo.h index 5dbd352508a..411f4ab225d 100644 --- a/include/AudioSoundIo.h +++ b/include/AudioSoundIo.h @@ -37,8 +37,14 @@ #include "AudioDevice.h" #include "AudioDeviceSetupWidget.h" +namespace lmms +{ + +namespace gui +{ class ComboBox; class LcdSpinBox; +} // Exists only to work around "Error: Meta object features not supported for nested classes" class AudioSoundIoSetupUtil : public QObject @@ -134,6 +140,9 @@ class AudioSoundIo : public AudioDevice }; -#endif + +} // namespace lmms + +#endif // LMMS_HAVE_SOUNDIO #endif diff --git a/include/AutomatableButton.h b/include/AutomatableButton.h index d7859a10c15..fefaf70e398 100644 --- a/include/AutomatableButton.h +++ b/include/AutomatableButton.h @@ -30,6 +30,8 @@ #include "AutomatableModelView.h" +namespace lmms::gui +{ class automatableButtonGroup; @@ -105,5 +107,6 @@ private slots: } ; +} // namespace lmms::gui #endif diff --git a/include/AutomatableModel.h b/include/AutomatableModel.h index 2f4b31467a8..672abaf818e 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 @@ public slots: signals: void initValueChanged( float val ); - void destroyed( jo_id_t id ); + void destroyed( lmms::jo_id_t id ); } ; @@ -502,5 +506,8 @@ class LMMS_EXPORT BoolModel : public TypedAutomatableModel typedef QMap AutomatedValueMap; + +} // namespace lmms + #endif diff --git a/include/AutomatableModelView.h b/include/AutomatableModelView.h index a5996118595..fa8926c0c1b 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 b51ef1e3ff2..d6a95f5d8ea 100644 --- a/include/AutomatableSlider.h +++ b/include/AutomatableSlider.h @@ -31,6 +31,8 @@ #include "AutomatableModelView.h" +namespace lmms::gui +{ class AutomatableSlider : public QSlider, public IntModelView { @@ -73,5 +75,6 @@ private slots: typedef IntModel sliderModel; +} // namespace lmms::gui #endif diff --git a/include/AutomationClip.h b/include/AutomationClip.h index 22af90ed17a..376c1e9e79a 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 @@ class LMMS_EXPORT AutomationClip : public Clip 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 @@ class LMMS_EXPORT AutomationClip : public Clip public slots: void clear(); - void objectDestroyed( jo_id_t ); + void objectDestroyed( lmms::jo_id_t ); void flipY( int min, int max ); void flipY(); void flipX( int length = -1 ); @@ -204,7 +212,7 @@ public slots: 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 641a5869990..0b80ad2eb11 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 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/AutomationEditor.h b/include/AutomationEditor.h index c655ffcdf17..d9d1b0a10be 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 @@ protected slots: signals: void currentClipChanged(); - void positionChanged( const TimePos & ); + void positionChanged( const lmms::TimePos & ); } ; @@ -293,5 +300,8 @@ private slots: ComboBox * m_quantizeComboBox; }; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/AutomationNode.h b/include/AutomationNode.h index 6cd44566238..11bd6d57d58 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 @@ class AutomationNode float m_outTangent; }; +} // namespace lmms #endif diff --git a/include/AutomationTrack.h b/include/AutomationTrack.h index dc33f76c3c9..1bbc77b1c9d 100644 --- a/include/AutomationTrack.h +++ b/include/AutomationTrack.h @@ -29,6 +29,8 @@ #include "Track.h" +namespace lmms +{ class AutomationTrack : public Track { @@ -45,7 +47,7 @@ class AutomationTrack : public Track return "automationtrack"; } - TrackView * createView( TrackContainerView* ) override; + gui::TrackView * createView( gui::TrackContainerView* ) override; Clip* createClip(const TimePos & pos) override; virtual void saveTrackSpecificSettings( QDomDocument & _doc, @@ -58,4 +60,6 @@ class AutomationTrack : public Track } ; +} // namespace lmms + #endif diff --git a/include/AutomationTrackView.h b/include/AutomationTrackView.h index 5ed993213ee..b5bafe58ee0 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 @@ class AutomationTrackView : public TrackView } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/BandLimitedWave.h b/include/BandLimitedWave.h index 1cd8d69ed47..30d28d4a126 100644 --- a/include/BandLimitedWave.h +++ b/include/BandLimitedWave.h @@ -36,6 +36,9 @@ class QString; #include "Engine.h" #include "AudioEngine.h" +namespace lmms +{ + constexpr int MAXLEN = 11; constexpr int MIPMAPSIZE = 2 << ( MAXLEN + 1 ); constexpr int MIPMAPSIZE3 = 3 << ( MAXLEN + 1 ); @@ -168,5 +171,6 @@ class LMMS_EXPORT BandLimitedWave static QString s_wavetableDir; }; +} // namespace lmms #endif diff --git a/include/BasicFilters.h b/include/BasicFilters.h index 07cdda06bd7..10b5b24b7b7 100644 --- a/include/BasicFilters.h +++ b/include/BasicFilters.h @@ -43,6 +43,9 @@ #include "interpolation.h" #include "MemoryManager.h" +namespace lmms +{ + template class BasicFilters; template @@ -913,4 +916,6 @@ class BasicFilters } ; +} // namespace lmms + #endif diff --git a/include/BufferManager.h b/include/BufferManager.h index 20390644b95..57729918ec6 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 @@ class LMMS_EXPORT BufferManager 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 a5da11663ea..9cf275fb3ea 100644 --- a/include/CPULoadWidget.h +++ b/include/CPULoadWidget.h @@ -34,6 +34,10 @@ #include "lmms_basics.h" +namespace lmms::gui +{ + + class CPULoadWidget : public QWidget { Q_OBJECT @@ -64,4 +68,6 @@ protected slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/CaptionMenu.h b/include/CaptionMenu.h index e6531fe3166..2309cec6fd4 100644 --- a/include/CaptionMenu.h +++ b/include/CaptionMenu.h @@ -30,6 +30,9 @@ #include "lmms_export.h" +namespace lmms::gui +{ + /// /// \brief A context menu with a caption /// @@ -42,6 +45,6 @@ class LMMS_EXPORT CaptionMenu : public QMenu } ; - +} // namespace lmms::gui #endif diff --git a/include/Clip.h b/include/Clip.h index 7b42fc91b2c..5c70aeaba6b 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 @@ class LMMS_EXPORT Clip : public Model, public JournallingObject 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 @@ public slots: } ; +} // namespace lmms + #endif diff --git a/include/ClipView.h b/include/ClipView.h index b3fd20920a9..00a8b261e78 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 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/Clipboard.h b/include/Clipboard.h index 168134e9db2..1c2dcb647cd 100644 --- a/include/Clipboard.h +++ b/include/Clipboard.h @@ -30,8 +30,9 @@ class QMimeData; -namespace Clipboard +namespace lmms::Clipboard { + enum class MimeType { StringPair, @@ -64,6 +65,7 @@ namespace Clipboard break; } } -} ; + +} // namespace lmms::Clipboard #endif diff --git a/include/ColorChooser.h b/include/ColorChooser.h index ac2a1b62d4a..9b3389c477c 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 @@ class ColorChooser: public QColorDialog //! 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 1f7dd43ffcd..412279d15bb 100644 --- a/include/ComboBox.h +++ b/include/ComboBox.h @@ -32,6 +32,9 @@ #include "ComboBoxModel.h" #include "AutomatableModelView.h" +namespace lmms::gui +{ + class LMMS_EXPORT ComboBox : public QWidget, public IntModelView { Q_OBJECT @@ -78,4 +81,6 @@ private slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/ComboBoxModel.h b/include/ComboBoxModel.h index a3c2a082b24..faff036206a 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 @@ class LMMS_EXPORT ComboBoxModel : public IntModel } ; +} // namespace lmms #endif diff --git a/include/ConfigManager.h b/include/ConfigManager.h index e9b2783abbe..6aa7fc03777 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 @@ class LMMS_EXPORT ConfigManager : public QObject settingsMap m_settings; - friend class LmmsCore; + friend class Engine; }; + + +} // namespace lmms + #endif diff --git a/include/ControlLayout.h b/include/ControlLayout.h index 60182010792..8c629f8e1cd 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 slots: // relevant dimension is width, as later, heightForWidth() will be called // 400 looks good and is ~4 knobs in a row constexpr const static int m_minWidth = 400; - class QLineEdit* m_searchBar; + QLineEdit* m_searchBar; //! name of search bar, must be ASCII sorted before any alpha numerics static constexpr const char* s_searchBarName = "!!searchBar!!"; }; +} // namespace lmms::gui + #endif // CONTROLLAYOUT_H diff --git a/include/Controller.h b/include/Controller.h index 092c684e06f..c2e5205d284 100644 --- a/include/Controller.h +++ b/include/Controller.h @@ -33,10 +33,20 @@ #include "JournallingObject.h" #include "ValueBuffer.h" -class ControllerDialog; +namespace lmms +{ + class Controller; class ControllerConnection; +namespace gui +{ + +class ControllerDialog; + +} // namespace gui + + typedef QVector ControllerVector; @@ -132,7 +142,7 @@ class LMMS_EXPORT Controller : public Model, public JournallingObject bool hasModel( const Model * m ) const; public slots: - virtual ControllerDialog * createDialog( QWidget * _parent ); + virtual gui::ControllerDialog * createDialog( QWidget * _parent ); virtual void setName( const QString & _new_name ) { @@ -169,9 +179,12 @@ public slots: // The value changed while the audio engine isn't running (i.e: MIDI CC) void valueChanged(); - friend class ControllerDialog; + friend class gui::ControllerDialog; } ; + +} // namespace lmms + #endif diff --git a/include/ControllerConnection.h b/include/ControllerConnection.h index 68fd2dc8921..50b98539cf2 100644 --- a/include/ControllerConnection.h +++ b/include/ControllerConnection.h @@ -37,8 +37,16 @@ #include "JournallingObject.h" #include "ValueBuffer.h" +namespace lmms +{ + class ControllerConnection; +namespace gui +{ +class ControllerConnectionDialog; +} + typedef QVector ControllerConnectionVector; @@ -115,8 +123,11 @@ public slots: // The value changed while the audio engine isn't running (i.e: MIDI CC) void valueChanged(); - friend class ControllerConnectionDialog; + friend class gui::ControllerConnectionDialog; }; + +} // namespace lmms + #endif diff --git a/include/ControllerConnectionDialog.h b/include/ControllerConnectionDialog.h index 95e55ce79d8..62980987f1b 100644 --- a/include/ControllerConnectionDialog.h +++ b/include/ControllerConnectionDialog.h @@ -38,7 +38,15 @@ class QLineEdit; class QListView; class QScrollArea; + +namespace lmms +{ + class AutoDetectMidiController; + +namespace gui +{ + class ComboBox; class GroupBox; class TabWidget; @@ -47,7 +55,6 @@ class LedCheckBox; class MidiPortMenu; - class ControllerConnectionDialog : public QDialog { Q_OBJECT @@ -99,4 +106,9 @@ protected slots: AutoDetectMidiController * m_midiController; } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ControllerDialog.h b/include/ControllerDialog.h index 05e8f3bfedb..0592cadf34d 100644 --- a/include/ControllerDialog.h +++ b/include/ControllerDialog.h @@ -30,8 +30,13 @@ #include "ModelView.h" +namespace lmms +{ + class Controller; +namespace gui +{ class ControllerDialog : public QWidget, public ModelView { @@ -51,4 +56,9 @@ class ControllerDialog : public QWidget, public ModelView } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ControllerRackView.h b/include/ControllerRackView.h index 9ef2d9b7ff4..6d60562f615 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 @@ class ControllerRackView : public QWidget, public SerializingObject public slots: - void deleteController( ControllerView * _view ); - void onControllerAdded( Controller * ); - void onControllerRemoved( Controller * ); + void deleteController( lmms::gui::ControllerView * _view ); + void onControllerAdded( lmms::Controller * ); + void onControllerRemoved( lmms::Controller * ); protected: void closeEvent( QCloseEvent * _ce ) override; @@ -80,4 +88,8 @@ private slots: int m_nextIndex; } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ControllerView.h b/include/ControllerView.h index d1284845eee..2e18e13205e 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 @@ public slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Controls.h b/include/Controls.h index 41425836861..af2a5fa716d 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 @@ class Control 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 @@ class Control class KnobControl : public Control { - class Knob* m_knob; + Knob* m_knob; public: void setText(const QString& text) override; @@ -68,7 +80,7 @@ class KnobControl : public Control void setModel(AutomatableModel* model) override; FloatModel* model() override; - class AutomatableModelView* modelView() override; + AutomatableModelView* modelView() override; KnobControl(QWidget* parent = nullptr); ~KnobControl() override; @@ -78,8 +90,8 @@ class KnobControl : public Control class ComboControl : public Control { QWidget* m_widget; - class ComboBox* m_combo; - class QLabel* m_label; + ComboBox* m_combo; + QLabel* m_label; public: void setText(const QString& text) override; @@ -87,7 +99,7 @@ class ComboControl : public Control void setModel(AutomatableModel* model) override; ComboBoxModel* model() override; - class AutomatableModelView* modelView() override; + AutomatableModelView* modelView() override; ComboControl(QWidget* parent = nullptr); ~ComboControl() override; @@ -104,7 +116,7 @@ class LcdControl : public Control void setModel(AutomatableModel* model) override; IntModel* model() override; - class AutomatableModelView* modelView() override; + AutomatableModelView* modelView() override; LcdControl(int numDigits, QWidget* parent = nullptr); ~LcdControl() override; @@ -114,7 +126,7 @@ class LcdControl : public Control class CheckControl : public Control { QWidget* m_widget; - class LedCheckBox* m_checkBox; + LedCheckBox* m_checkBox; QLabel* m_label; public: @@ -122,12 +134,16 @@ class CheckControl : public Control QWidget* topWidget() override; void setModel(AutomatableModel* model) override; - BoolModel *model() override; - class AutomatableModelView* modelView() override; + BoolModel* model() override; + AutomatableModelView* modelView() override; CheckControl(QWidget* parent = nullptr); ~CheckControl() override; }; +} // namespace gui + +} // namespace lmms + #endif // CONTROLS_H diff --git a/include/CustomTextKnob.h b/include/CustomTextKnob.h index aa7b9d57339..403799ff018 100644 --- a/include/CustomTextKnob.h +++ b/include/CustomTextKnob.h @@ -4,6 +4,10 @@ #include "Knob.h" +namespace lmms::gui +{ + + class LMMS_EXPORT CustomTextKnob : public Knob { protected: @@ -27,4 +31,7 @@ class LMMS_EXPORT CustomTextKnob : public Knob QString m_value_text; } ; + +} // namespace lmms::gui + #endif diff --git a/include/DataFile.h b/include/DataFile.h index 0600e85d4ed..c17b3546ff1 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 @@ class LMMS_EXPORT DataFile : public QDomDocument } ; +} // namespace lmms + #endif diff --git a/include/Delay.h b/include/Delay.h index 5be1ac183ad..404782f90b6 100644 --- a/include/Delay.h +++ b/include/Delay.h @@ -32,6 +32,9 @@ #include "interpolation.h" #include "MemoryManager.h" +namespace lmms +{ + // brief usage // Classes: @@ -360,4 +363,7 @@ typedef CombFeedfwd<2> StereoCombFeedfwd; typedef CombFeedbackDualtap<2> StereoCombFeedbackDualtap; typedef AllpassDelay<2> StereoAllpassDelay; + +} // namespace lmms + #endif diff --git a/include/DeprecationHelper.h b/include/DeprecationHelper.h index bef4ea9b954..7786665a30f 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 2157b6ba828..7444b8b22e5 100644 --- a/include/DetuningHelper.h +++ b/include/DetuningHelper.h @@ -29,6 +29,9 @@ #include "InlineAutomation.h" #include "MemoryManager.h" +namespace lmms +{ + class DetuningHelper : public InlineAutomation { Q_OBJECT @@ -61,4 +64,6 @@ class DetuningHelper : public InlineAutomation } ; +} // namespace lmms + #endif diff --git a/include/DrumSynth.h b/include/DrumSynth.h index f7e9b1d4c3e..79383a6d49b 100644 --- a/include/DrumSynth.h +++ b/include/DrumSynth.h @@ -32,6 +32,9 @@ class QString; +namespace lmms +{ + class DrumSynth { public: DrumSynth() {}; @@ -51,4 +54,7 @@ class DrumSynth { }; + +} // namespace lmms + #endif diff --git a/include/DspEffectLibrary.h b/include/DspEffectLibrary.h index bf175df6d7c..df758811611 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 6bb8c873e98..8d0f769b637 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 @@ class DummyEffectControlDialog : public EffectControlDialog } ; +} class DummyEffectControls : public EffectControls { @@ -75,9 +82,9 @@ class DummyEffectControls : public EffectControls return "DummyControls"; } - EffectControlDialog * createView() override + gui::EffectControlDialog * createView() override { - return new DummyEffectControlDialog( this ); + return new gui::DummyEffectControlDialog( this ); } } ; @@ -144,4 +151,6 @@ class DummyEffect : public Effect } ; +} // namespace lmms + #endif diff --git a/include/DummyInstrument.h b/include/DummyInstrument.h index ebfcfbefe9c..27246e6eb40 100644 --- a/include/DummyInstrument.h +++ b/include/DummyInstrument.h @@ -35,6 +35,10 @@ #include "AudioEngine.h" +namespace lmms +{ + + class DummyInstrument : public Instrument { public: @@ -66,11 +70,13 @@ class DummyInstrument : public Instrument return "dummyinstrument"; } - PluginView * instantiateView( QWidget * _parent ) override + gui::PluginView * instantiateView( QWidget * _parent ) override { - return new InstrumentViewFixedSize( this, _parent ); + return new gui::InstrumentViewFixedSize( this, _parent ); } } ; +} // namespace lmms + #endif diff --git a/include/DummyPlugin.h b/include/DummyPlugin.h index 61a399889b1..313649526d9 100644 --- a/include/DummyPlugin.h +++ b/include/DummyPlugin.h @@ -30,6 +30,9 @@ #include "PluginView.h" +namespace lmms +{ + class DummyPlugin : public Plugin { public: @@ -57,12 +60,14 @@ class DummyPlugin : public Plugin protected: - PluginView * instantiateView( QWidget * _parent ) override + gui::PluginView * instantiateView( QWidget * _parent ) override { - return new PluginView( this, _parent ); + return new gui::PluginView( this, _parent ); } } ; +} // namesplace lmms + #endif diff --git a/include/Editor.h b/include/Editor.h index d755608a6c9..88cd84654ab 100644 --- a/include/Editor.h +++ b/include/Editor.h @@ -28,14 +28,17 @@ #include #include +class QAction; + +namespace lmms::gui +{ + static const int Quantizations[] = { 1, 2, 4, 8, 16, 32, 64, 3, 6, 12, 24, 48, 96, 192 }; -class QAction; - class DropToolBar; /// \brief Superclass for editors with a toolbar. @@ -108,4 +111,6 @@ class DropToolBar : public QToolBar }; +} // namespace lmms::gui + #endif diff --git a/include/Effect.h b/include/Effect.h index 6d1fea6bf2e..abd65f2070e 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 @@ class LMMS_EXPORT Effect : public Plugin */ void checkGate( double _out_sum ); - PluginView * instantiateView( QWidget * ) override; + gui::PluginView* instantiateView( QWidget * ) override; // some effects might not be capable of higher sample-rates so they can // sample it down before processing and back after processing @@ -221,7 +231,7 @@ class LMMS_EXPORT Effect : public Plugin 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 9ebc4d534b3..ca764876190 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 @@ class LMMS_EXPORT EffectChain : public Model, public SerializingObject BoolModel m_enabledModel; - friend class EffectRackView; + friend class gui::EffectRackView; signals: @@ -73,5 +83,7 @@ class LMMS_EXPORT EffectChain : public Model, public SerializingObject } ; +} // namespace lmms + #endif diff --git a/include/EffectControlDialog.h b/include/EffectControlDialog.h index 4a59489da20..ec0ef3f1d77 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 @@ class LMMS_EXPORT EffectControlDialog : public QWidget, public ModelView } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/EffectControls.h b/include/EffectControls.h index 6af7a7d6c47..b8e7d0041ef 100644 --- a/include/EffectControls.h +++ b/include/EffectControls.h @@ -29,8 +29,16 @@ #include "JournallingObject.h" #include "Effect.h" +namespace lmms +{ + + +namespace gui +{ + class EffectControlDialog; +} // namespace gui class EffectControls : public JournallingObject, public Model { @@ -48,7 +56,7 @@ class EffectControls : public JournallingObject, public Model } virtual int controlCount() = 0; - virtual EffectControlDialog * createView() = 0; + virtual gui::EffectControlDialog * createView() = 0; void setViewVisible( bool _visible ) @@ -73,4 +81,7 @@ class EffectControls : public JournallingObject, public Model } ; + +} // namespace lmms + #endif diff --git a/include/EffectRackView.h b/include/EffectRackView.h index b590d8eb13d..014a07dfe2f 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 @@ class EffectRackView : public QWidget, public ModelView public slots: void clearViews(); - void moveUp( EffectView* view ); - void moveDown( EffectView* view ); - void deletePlugin( EffectView* view ); + void moveUp( lmms::gui::EffectView* view ); + void moveDown( lmms::gui::EffectView* view ); + void deletePlugin( lmms::gui::EffectView* view ); private slots: @@ -83,4 +86,6 @@ private slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/EffectSelectDialog.h b/include/EffectSelectDialog.h index 19e0ca05fe8..bf1b6ba04a7 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 @@ protected slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/EffectView.h b/include/EffectView.h index a2509dc5b1f..9f30575e9a8 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 @@ public slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Engine.h b/include/Engine.h index 531e2422037..b63308cde35 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 @@ class LMMS_EXPORT LmmsCore : public QObject static void updateFramesPerTick(); - static inline LmmsCore * inst() + static inline Engine * inst() { if( s_instanceOfMe == nullptr ) { - s_instanceOfMe = new LmmsCore(); + s_instanceOfMe = new Engine(); } return s_instanceOfMe; } @@ -130,9 +126,9 @@ class LMMS_EXPORT LmmsCore : public QObject // small helper function which sets the pointer to NULL before actually deleting // the object it refers to template - static inline void deleteHelper( T * * ptr ) + static inline void deleteHelper(T** ptr) { - T * tmp = *ptr; + T* tmp = *ptr; *ptr = nullptr; delete tmp; } @@ -149,15 +145,17 @@ class LMMS_EXPORT LmmsCore : public QObject #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 42502800e25..0a4a0d0f249 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 @@ public slots: void updateLfoShapeData(); - friend class EnvelopeAndLfoView; + friend class gui::EnvelopeAndLfoView; } ; +} // namespace lmms + #endif diff --git a/include/EnvelopeAndLfoView.h b/include/EnvelopeAndLfoView.h index f6d4fd0a8e7..2067f929185 100644 --- a/include/EnvelopeAndLfoView.h +++ b/include/EnvelopeAndLfoView.h @@ -33,8 +33,14 @@ class QPaintEvent; class QPixmap; +namespace lmms +{ + class EnvelopeAndLfoParameters; +namespace gui +{ + class automatableButtonGroup; class Knob; class LedCheckBox; @@ -94,4 +100,8 @@ protected slots: float m_randomGraph; } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/ExportFilter.h b/include/ExportFilter.h index e60faef3af8..29cb1c7115b 100644 --- a/include/ExportFilter.h +++ b/include/ExportFilter.h @@ -32,6 +32,10 @@ #include "Plugin.h" +namespace lmms +{ + + class LMMS_EXPORT ExportFilter : public Plugin { public: @@ -63,4 +67,6 @@ class LMMS_EXPORT ExportFilter : public Plugin } ; +} // namespace lmms + #endif diff --git a/include/ExportProjectDialog.h b/include/ExportProjectDialog.h index 06c1e3011d1..5e4418a2853 100644 --- a/include/ExportProjectDialog.h +++ b/include/ExportProjectDialog.h @@ -34,6 +34,10 @@ #include "ProjectRenderer.h" #include "RenderManager.h" +namespace lmms::gui +{ + + class ExportProjectDialog : public QDialog, public Ui::ExportProjectDialog { Q_OBJECT @@ -63,4 +67,8 @@ private slots: std::unique_ptr m_renderManager; } ; + +} // namespace lmms::gui + + #endif diff --git a/include/FadeButton.h b/include/FadeButton.h index dfffe93a284..ee0936ca726 100644 --- a/include/FadeButton.h +++ b/include/FadeButton.h @@ -31,6 +31,10 @@ #include +namespace lmms::gui +{ + + class FadeButton : public QAbstractButton { Q_OBJECT @@ -71,4 +75,6 @@ public slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/Fader.h b/include/Fader.h index 86d7f0b965b..355684c4ae8 100644 --- a/include/Fader.h +++ b/include/Fader.h @@ -55,6 +55,9 @@ #include "AutomatableModelView.h" +namespace lmms::gui +{ + class TextFloat; @@ -169,4 +172,7 @@ class LMMS_EXPORT Fader : public QWidget, public FloatModelView } ; +} // namespace lmms::gui + + #endif diff --git a/include/FifoBuffer.h b/include/FifoBuffer.h index 5bbf8b7022b..d49e367c04c 100644 --- a/include/FifoBuffer.h +++ b/include/FifoBuffer.h @@ -28,6 +28,10 @@ #include +namespace lmms +{ + + template class FifoBuffer { @@ -88,4 +92,6 @@ class FifoBuffer } ; +} // namespace lmms + #endif diff --git a/include/FileBrowser.h b/include/FileBrowser.h index d99c619e97a..eb50dd1bb39 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 @@ class FileBrowserTreeWidget : public QTreeWidget private slots: void activateListItem( QTreeWidgetItem * item, int column ); - void openInNewInstrumentTrack( FileItem* item, bool songEditor ); - bool openInNewSampleTrack( FileItem* item ); - void sendToActiveInstrumentTrack( FileItem* item ); + void openInNewInstrumentTrack( lmms::gui::FileItem* item, bool songEditor ); + bool openInNewSampleTrack( lmms::gui::FileItem* item ); + void sendToActiveInstrumentTrack( lmms::gui::FileItem* item ); void updateDirectory( QTreeWidgetItem * item ); - void openContainingFolder( FileItem* item ); + void openContainingFolder( lmms::gui::FileItem* item ); } ; @@ -281,4 +286,8 @@ class FileItem : public QTreeWidgetItem } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/FileDialog.h b/include/FileDialog.h index 6e29703b8a1..ed5d2f231bb 100644 --- a/include/FileDialog.h +++ b/include/FileDialog.h @@ -30,6 +30,10 @@ #include "lmms_export.h" +namespace lmms::gui +{ + + class LMMS_EXPORT FileDialog : public QFileDialog { Q_OBJECT @@ -50,4 +54,7 @@ class LMMS_EXPORT FileDialog : public QFileDialog void clearSelection(); }; -#endif // FILEDIALOG_HPP + +} // namespace lmms::gui + +#endif // FILEDIALOG_H diff --git a/include/Graph.h b/include/Graph.h index 2a6fc4f8a15..7a9599f12cd 100644 --- a/include/Graph.h +++ b/include/Graph.h @@ -35,8 +35,15 @@ #include "ModelView.h" #include "lmms_basics.h" +namespace lmms +{ + + class graphModel; +namespace gui +{ + class LMMS_EXPORT Graph : public QWidget, public ModelView { @@ -116,6 +123,9 @@ protected slots: } ; +} // namespace gui + + /** @brief 2 dimensional function plot @@ -137,7 +147,7 @@ class LMMS_EXPORT graphModel : public Model graphModel( float _min, float _max, int _size, - :: Model * _parent, + Model * _parent, bool _default_constructed = false, float _step = 0.0 ); @@ -211,8 +221,11 @@ public slots: float m_maxValue; float m_step; - friend class Graph; + friend class gui::Graph; }; + +} // namespace lmms + #endif diff --git a/include/GroupBox.h b/include/GroupBox.h index 77b0ec578e1..6a282fedbfe 100644 --- a/include/GroupBox.h +++ b/include/GroupBox.h @@ -34,6 +34,8 @@ class QPixmap; +namespace lmms::gui +{ class GroupBox : public QWidget, public BoolModelView { @@ -70,6 +72,7 @@ class GroupBox : public QWidget, public BoolModelView } ; +} // namespace lmms::gui #endif diff --git a/include/GuiApplication.h b/include/GuiApplication.h index ee5e83e2b99..84697175fcf 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 slots: // Short-hand function LMMS_EXPORT GuiApplication* getGUI(); +} // namespace lmms::gui + #endif // GUIAPPLICATION_H diff --git a/include/ImportFilter.h b/include/ImportFilter.h index ef58cce248d..60eca6f80b0 100644 --- a/include/ImportFilter.h +++ b/include/ImportFilter.h @@ -30,6 +30,9 @@ #include "Plugin.h" +namespace lmms +{ + class TrackContainer; @@ -109,4 +112,6 @@ class LMMS_EXPORT ImportFilter : public Plugin } ; +} // namespace lmms + #endif diff --git a/include/InlineAutomation.h b/include/InlineAutomation.h index 1ce486fded9..4531843293e 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 @@ class InlineAutomation : public FloatModel, public sharedObject } ; +} // namespace lmms + #endif diff --git a/include/Instrument.h b/include/Instrument.h index c3cd56272c1..7ec3c66be6c 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 @@ class LMMS_EXPORT Instrument : public Plugin } ; + Q_DECLARE_OPERATORS_FOR_FLAGS(Instrument::Flags) + +} // namespace lmms + #endif diff --git a/include/InstrumentFunctionViews.h b/include/InstrumentFunctionViews.h index 6536a8db7df..bf4b07668ef 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 @@ class InstrumentFunctionArpeggioView : public QWidget, public ModelView } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/InstrumentFunctions.h b/include/InstrumentFunctions.h index e1591ea2703..ef1d17902b2 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 @@ class InstrumentFunctionNoteStacking : public Model, public JournallingObject FloatModel m_chordRangeModel; - friend class InstrumentFunctionNoteStackingView; + friend class gui::InstrumentFunctionNoteStackingView; } ; @@ -207,9 +216,11 @@ class InstrumentFunctionArpeggio : public Model, public JournallingObject friend class InstrumentTrack; - friend class InstrumentFunctionArpeggioView; + friend class gui::InstrumentFunctionArpeggioView; } ; +} // namespace lmms + #endif diff --git a/include/InstrumentMidiIOView.h b/include/InstrumentMidiIOView.h index 9b1e5adfdb2..399aee890b1 100644 --- a/include/InstrumentMidiIOView.h +++ b/include/InstrumentMidiIOView.h @@ -30,12 +30,19 @@ #include "ModelView.h" +class QToolButton; + +namespace lmms +{ + +class InstrumentTrack; + +namespace gui +{ class GroupBox; class LcdSpinBox; -class QToolButton; class LedCheckBox; -class InstrumentTrack; class InstrumentMidiIOView : public QWidget, public ModelView @@ -65,4 +72,9 @@ class InstrumentMidiIOView : public QWidget, public ModelView } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/InstrumentMiscView.h b/include/InstrumentMiscView.h index 6024436e8b5..25e16395d96 100644 --- a/include/InstrumentMiscView.h +++ b/include/InstrumentMiscView.h @@ -29,10 +29,16 @@ #include +namespace lmms +{ + +class InstrumentTrack; + +namespace gui +{ class ComboBox; class GroupBox; -class InstrumentTrack; class LedCheckBox; @@ -60,4 +66,9 @@ class InstrumentMiscView : public QWidget LedCheckBox *m_rangeImportCheckbox; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/InstrumentPlayHandle.h b/include/InstrumentPlayHandle.h index ac5fc322240..2d7bfa58732 100644 --- a/include/InstrumentPlayHandle.h +++ b/include/InstrumentPlayHandle.h @@ -30,6 +30,9 @@ #include "NotePlayHandle.h" #include "lmms_export.h" +namespace lmms +{ + class LMMS_EXPORT InstrumentPlayHandle : public PlayHandle { public: @@ -81,4 +84,7 @@ class LMMS_EXPORT InstrumentPlayHandle : public PlayHandle } ; + +} // namespace lmms + #endif diff --git a/include/InstrumentSoundShaping.h b/include/InstrumentSoundShaping.h index b037f615a77..00208392d09 100644 --- a/include/InstrumentSoundShaping.h +++ b/include/InstrumentSoundShaping.h @@ -27,11 +27,19 @@ #include "ComboBoxModel.h" +namespace lmms +{ + class InstrumentTrack; class EnvelopeAndLfoParameters; class NotePlayHandle; +namespace gui +{ +class InstrumentSoundShapingView; +} + class InstrumentSoundShaping : public Model, public JournallingObject { @@ -77,9 +85,11 @@ class InstrumentSoundShaping : public Model, public JournallingObject static const char *const targetNames[InstrumentSoundShaping::NumTargets][3]; - friend class InstrumentSoundShapingView; + friend class gui::InstrumentSoundShapingView; } ; +} // namespace lmms + #endif diff --git a/include/InstrumentSoundShapingView.h b/include/InstrumentSoundShapingView.h index 06d53232ce3..9b4efcfab04 100644 --- a/include/InstrumentSoundShapingView.h +++ b/include/InstrumentSoundShapingView.h @@ -32,6 +32,9 @@ class QLabel; +namespace lmms::gui +{ + class EnvelopeAndLfoView; class ComboBox; class GroupBox; @@ -67,4 +70,7 @@ class InstrumentSoundShapingView : public QWidget, public ModelView } ; + +} // namespace lmms::gui + #endif diff --git a/include/InstrumentTrack.h b/include/InstrumentTrack.h index 95288482902..d05da176bd8 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 @@ class LMMS_EXPORT InstrumentTrack : public Track, public MidiEventProcessor virtual bool play( const TimePos & _start, const fpp_t _frames, const f_cnt_t _frame_base, int _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 @@ class LMMS_EXPORT InstrumentTrack : public Track, public MidiEventProcessor signals: void instrumentChanged(); - void midiNoteOn( const Note& ); - void midiNoteOff( const Note& ); + void midiNoteOn( const lmms::Note& ); + void midiNoteOff( const lmms::Note& ); void nameChanged(); void newNote(); void endNote(); @@ -294,12 +308,16 @@ protected slots: std::unique_ptr m_midiCCEnable; std::unique_ptr m_midiCCModel[MidiControllerCount]; - friend class InstrumentTrackView; - friend class InstrumentTrackWindow; + friend class gui::InstrumentTrackView; + friend class gui::InstrumentTrackWindow; friend class NotePlayHandle; - friend class InstrumentMiscView; - friend class MidiCCRackView; + friend class gui::InstrumentMiscView; + friend class gui::MidiCCRackView; } ; + + +} // namespace lmms + #endif diff --git a/include/InstrumentTrackView.h b/include/InstrumentTrackView.h index d863d6c1926..a5297b332f4 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 slots: friend class InstrumentTrackWindow; } ; -#endif +} // namespace lmms::gui + +#endif diff --git a/include/InstrumentTrackWindow.h b/include/InstrumentTrackWindow.h index a215e08f95f..cd208c165e4 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 @@ protected slots: friend class InstrumentTrackView; } ; -#endif +} // namespace gui + +} // namespace lmms + +#endif diff --git a/include/InstrumentView.h b/include/InstrumentView.h index 838ed2d9121..695e8c47770 100644 --- a/include/InstrumentView.h +++ b/include/InstrumentView.h @@ -29,6 +29,10 @@ #include "Instrument.h" #include "PluginView.h" + +namespace lmms::gui +{ + class InstrumentTrackWindow; @@ -70,4 +74,6 @@ class LMMS_EXPORT InstrumentViewFixedSize : public InstrumentView } ; +} // namespace lmms::gui + #endif diff --git a/include/IoHelper.h b/include/IoHelper.h index 35ee8cb8721..4f08f5087dc 100644 --- a/include/IoHelper.h +++ b/include/IoHelper.h @@ -27,9 +27,23 @@ #include - #ifdef _WIN32 #include +#endif + +#ifdef LMMS_BUILD_WIN32 +#include +#else +#ifdef LMMS_HAVE_UNISTD_H +#include +#endif +#endif + +namespace lmms +{ + + +#ifdef _WIN32 std::wstring toWString(const std::string& s) { @@ -44,16 +58,10 @@ std::wstring toWString(const std::string& s) MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, s.data(), s.length(), &ret[0], len); return ret; } -#endif -#ifdef LMMS_BUILD_WIN32 -#include -#else -#ifdef LMMS_HAVE_UNISTD_H -#include -#endif #endif + FILE* F_OPEN_UTF8(std::string const& fname, const char* mode){ #ifdef LMMS_BUILD_WIN32 return _wfopen(toWString(fname).data(), toWString(mode).data()); @@ -62,6 +70,7 @@ FILE* F_OPEN_UTF8(std::string const& fname, const char* mode){ #endif } + int fileToDescriptor(FILE* f, bool closeFile = true) { int fh; @@ -76,3 +85,6 @@ int fileToDescriptor(FILE* f, bool closeFile = true) if (closeFile) {fclose(f);} return fh; } + + +} // namespace lmms \ No newline at end of file diff --git a/include/JournallingObject.h b/include/JournallingObject.h index 9e03225911a..cd853dc7f93 100644 --- a/include/JournallingObject.h +++ b/include/JournallingObject.h @@ -30,6 +30,8 @@ #include "lmms_basics.h" #include "SerializingObject.h" +namespace lmms +{ class LMMS_EXPORT JournallingObject : public SerializingObject { @@ -99,5 +101,7 @@ class LMMS_EXPORT JournallingObject : public SerializingObject } ; +} // namespace lmms + #endif diff --git a/include/Keymap.h b/include/Keymap.h index 08a27c47380..6286f8362d1 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 @@ class Keymap : public QObject, public SerializingObject float m_baseFreq; //!< frequency of the base note (usually A4 @440 Hz) }; +} // namespace lmms + #endif diff --git a/include/Knob.h b/include/Knob.h index f27328aa952..16ac7ed011a 100644 --- a/include/Knob.h +++ b/include/Knob.h @@ -36,6 +36,11 @@ class QPixmap; + +namespace lmms::gui +{ + + class TextFloat; enum knobTypes @@ -206,4 +211,7 @@ private slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Ladspa2LMMS.h b/include/Ladspa2LMMS.h index 28fa25b894c..63db75cd94a 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 @@ class LMMS_EXPORT Ladspa2LMMS : public LadspaManager 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 be4576f5503..68e91dd7a76 100644 --- a/include/LadspaBase.h +++ b/include/LadspaBase.h @@ -29,6 +29,10 @@ #include "LadspaManager.h" #include "Plugin.h" +namespace lmms +{ + + class LadspaControl; @@ -88,4 +92,6 @@ inline Plugin::Descriptor::SubPluginFeatures::Key ladspaKeyToSubPluginKey( } +} // namespace lmms + #endif diff --git a/include/LadspaControl.h b/include/LadspaControl.h index 34f6c9ae218..8b6fe3d1999 100644 --- a/include/LadspaControl.h +++ b/include/LadspaControl.h @@ -32,9 +32,19 @@ #include "TempoSyncKnobModel.h" #include "ValueBuffer.h" +namespace lmms +{ + typedef struct PortDescription port_desc_t; +namespace gui +{ + +class LadspaControlView; + +} // namespace gui + class LMMS_EXPORT LadspaControl : public Model, public JournallingObject { @@ -115,8 +125,11 @@ protected slots: TempoSyncKnobModel m_tempoSyncKnobModel; - friend class LadspaControlView; + friend class gui::LadspaControlView; } ; + +} // namespace lmms + #endif diff --git a/include/LadspaControlView.h b/include/LadspaControlView.h index d2d0ca44d85..15eb722a7a3 100644 --- a/include/LadspaControlView.h +++ b/include/LadspaControlView.h @@ -30,8 +30,13 @@ #include "ModelView.h" +namespace lmms +{ + class LadspaControl; +namespace gui +{ class LMMS_EXPORT LadspaControlView : public QWidget, public ModelView { @@ -45,4 +50,9 @@ class LMMS_EXPORT LadspaControlView : public QWidget, public ModelView } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/LadspaManager.h b/include/LadspaManager.h index a87511161b5..565a7c89803 100644 --- a/include/LadspaManager.h +++ b/include/LadspaManager.h @@ -40,6 +40,9 @@ #include "lmms_basics.h" +namespace lmms +{ + const float NOHINT = -99342.2243f; typedef QPair ladspa_key_t; @@ -346,4 +349,7 @@ class LMMS_EXPORT LadspaManager } ; + +} // namespace lmms + #endif diff --git a/include/LcdFloatSpinBox.h b/include/LcdFloatSpinBox.h index 034168fbb9e..ab0de304e0f 100644 --- a/include/LcdFloatSpinBox.h +++ b/include/LcdFloatSpinBox.h @@ -32,6 +32,9 @@ #include "LcdWidget.h" #include "AutomatableModelView.h" +namespace lmms::gui +{ + class LMMS_EXPORT LcdFloatSpinBox : public QWidget, public FloatModelView { @@ -80,4 +83,6 @@ public slots: using LcdFloatSpinBoxModel = FloatModel; +} // namespace lmms::gui + #endif diff --git a/include/LcdSpinBox.h b/include/LcdSpinBox.h index 91ac8b4a78c..1c30bfcf631 100644 --- a/include/LcdSpinBox.h +++ b/include/LcdSpinBox.h @@ -29,6 +29,8 @@ #include "LcdWidget.h" #include "AutomatableModelView.h" +namespace lmms::gui +{ class LMMS_EXPORT LcdSpinBox : public LcdWidget, public IntModelView { @@ -86,4 +88,6 @@ public slots: typedef IntModel LcdSpinBoxModel; +} // namespace lmms::gui + #endif diff --git a/include/LcdWidget.h b/include/LcdWidget.h index a04e7ae9148..aad1d189a85 100644 --- a/include/LcdWidget.h +++ b/include/LcdWidget.h @@ -31,6 +31,9 @@ #include "lmms_export.h" +namespace lmms::gui +{ + class LMMS_EXPORT LcdWidget : public QWidget { Q_OBJECT @@ -112,4 +115,6 @@ public slots: }; +} // namespace lmms::gui + #endif diff --git a/include/LedCheckBox.h b/include/LedCheckBox.h index f5477704f1b..8eac9b56242 100644 --- a/include/LedCheckBox.h +++ b/include/LedCheckBox.h @@ -32,6 +32,9 @@ class QPixmap; +namespace lmms::gui +{ + class LMMS_EXPORT LedCheckBox : public AutomatableButton { Q_OBJECT @@ -78,4 +81,7 @@ class LMMS_EXPORT LedCheckBox : public AutomatableButton } ; + +} // namespace lmms::gui + #endif diff --git a/include/LeftRightNav.h b/include/LeftRightNav.h index 4f3f4ecbb65..df72193dcd5 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 @@ class LeftRightNav : public QWidget PixmapButton m_rightBtn; }; + +} // namespace lmms::gui + #endif \ No newline at end of file diff --git a/include/LfoController.h b/include/LfoController.h index 8fc35fd0903..6ee136a1469 100644 --- a/include/LfoController.h +++ b/include/LfoController.h @@ -34,11 +34,21 @@ #include "TempoSyncKnobModel.h" #include "Oscillator.h" +namespace lmms +{ + +namespace gui +{ + class automatableButtonGroup; -class Knob; class LedCheckBox; -class TempoSyncKnob; class PixmapButton; +class Knob; +class TempoSyncKnob; + +class LfoControllerDialog; + +} class LfoController : public Controller @@ -55,7 +65,7 @@ class LfoController : public Controller public slots: - ControllerDialog * createDialog( QWidget * _parent ) override; + gui::ControllerDialog * createDialog( QWidget * _parent ) override; protected: @@ -83,11 +93,12 @@ protected slots: void updateSampleFunction(); void updateDuration(); - friend class LfoControllerDialog; + friend class gui::LfoControllerDialog; } ; - +namespace gui +{ class LfoControllerDialog : public ControllerDialog { @@ -120,4 +131,9 @@ private slots: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/LinkedModelGroupViews.h b/include/LinkedModelGroupViews.h index a70480d5c0f..50ef03596f3 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 @@ class LinkedModelGroupView : public QWidget @param colNum numbers of columns for the controls (link LEDs not counted) */ - LinkedModelGroupView(QWidget *parent, class LinkedModelGroup* model, + LinkedModelGroupView(QWidget* parent, LinkedModelGroup* model, std::size_t colNum); ~LinkedModelGroupView(); //! Reconnect models if model changed - void modelChanged(class LinkedModelGroup *linkedModelGroup); + void modelChanged(LinkedModelGroup* linkedModelGroup); protected: //! Add a control to this widget //! @warning This widget will own this control, do not free it - void addControl(class Control *ctrl, const std::string &id, + void addControl(Control* ctrl, const std::string &id, const std::string& display, bool removable); void removeControl(const QString &key); @@ -94,7 +107,7 @@ class LinkedModelGroupsView ~LinkedModelGroupsView() = default; //! Reconnect models if model changed; to be called by child virtuals - void modelChanged(class LinkedModelGroups* ctrlBase); + void modelChanged(LinkedModelGroups* ctrlBase); private: //! The base class must return the addressed group view, @@ -103,4 +116,8 @@ class LinkedModelGroupsView }; +} // namespace gui + +} // namespace lmms + #endif // LINKEDMODELGROUPVIEWS_H diff --git a/include/LinkedModelGroups.h b/include/LinkedModelGroups.h index 770518076d4..9fa0fefa6de 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 @@ class LinkedModelGroup : public Model // (who would kno if the client is Qt, i.e. it may not have slots at all) // In this case you'd e.g. send the UI something like // "/added " - void modelAdded(AutomatableModel* added); - void modelRemoved(AutomatableModel* removed); + void modelAdded(lmms::AutomatableModel* added); + void modelRemoved(lmms::AutomatableModel* removed); public: AutomatableModel* getModel(const std::string& s) @@ -170,4 +176,6 @@ class LinkedModelGroups }; +} // namespace lmms + #endif // LINKEDMODELGROUPS_H diff --git a/include/LmmsPalette.h b/include/LmmsPalette.h index a8ee5d1c8ab..87ea186879a 100644 --- a/include/LmmsPalette.h +++ b/include/LmmsPalette.h @@ -30,6 +30,10 @@ #define LMMSPALETTE_H +namespace lmms::gui +{ + + class LMMS_EXPORT LmmsPalette : public QWidget { Q_OBJECT @@ -83,5 +87,6 @@ class LMMS_EXPORT LmmsPalette : public QWidget +} // namespace lmms::gui #endif diff --git a/include/LmmsStyle.h b/include/LmmsStyle.h index ccf14396c8f..a4c9edd31aa 100644 --- a/include/LmmsStyle.h +++ b/include/LmmsStyle.h @@ -30,6 +30,9 @@ #include +namespace lmms::gui +{ + class LmmsStyle : public QProxyStyle { @@ -92,4 +95,7 @@ class LmmsStyle : public QProxyStyle }; + +} // namespace lmms::gui + #endif diff --git a/include/LocaleHelper.h b/include/LocaleHelper.h index c5d9d4c46c5..b071a1596c1 100644 --- a/include/LocaleHelper.h +++ b/include/LocaleHelper.h @@ -33,8 +33,9 @@ #include #include -namespace LocaleHelper +namespace lmms::LocaleHelper { + inline double toDouble(QString str, bool* ok = nullptr) { bool isOkay; @@ -62,6 +63,8 @@ inline float toFloat(QString str, bool* ok = nullptr) } return static_cast(d); } -} + + +} // namespace lmms::LocaleHelper #endif // LOCALEHELPER_H diff --git a/include/LocklessAllocator.h b/include/LocklessAllocator.h index d7977480ed4..17f5ebfb559 100644 --- a/include/LocklessAllocator.h +++ b/include/LocklessAllocator.h @@ -28,6 +28,11 @@ #include #include + +namespace lmms +{ + + class LocklessAllocator { public: @@ -79,4 +84,6 @@ class LocklessAllocatorT : private LocklessAllocator } ; +} // namespace lmms + #endif diff --git a/include/LocklessList.h b/include/LocklessList.h index 05df56f41af..44b71805954 100644 --- a/include/LocklessList.h +++ b/include/LocklessList.h @@ -29,6 +29,9 @@ #include +namespace lmms +{ + template class LocklessList { @@ -92,4 +95,6 @@ class LocklessList } ; +} // namespace lmms + #endif diff --git a/include/LocklessRingBuffer.h b/include/LocklessRingBuffer.h index 5950b842fce..60f8ab98996 100644 --- a/include/LocklessRingBuffer.h +++ b/include/LocklessRingBuffer.h @@ -32,6 +32,9 @@ #include "../src/3rdparty/ringbuffer/include/ringbuffer/ringbuffer.h" +namespace lmms +{ + //! A convenience layer for a realtime-safe and thread-safe multi-reader ringbuffer template class LocklessRingBuffer @@ -83,4 +86,7 @@ class LocklessRingBufferReader : public ringbuffer_reader_t QWaitCondition *m_notifier; }; + +} // namespace lmms + #endif //LOCKLESSRINGBUFFER_H diff --git a/include/Lv2Basics.h b/include/Lv2Basics.h index 0003f83e814..b935e6a02f9 100644 --- a/include/Lv2Basics.h +++ b/include/Lv2Basics.h @@ -36,6 +36,9 @@ #include #include +namespace lmms +{ + struct LilvNodeDeleter { void operator()(LilvNode* n) { lilv_node_free(n); } @@ -63,5 +66,7 @@ QString qStringFromPortName(const LilvPlugin* plug, const LilvPort* port); //! Return port name as std::string, everything will be freed automatically std::string stdStringFromPortName(const LilvPlugin* plug, const LilvPort* port); +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2BASICS_H diff --git a/include/Lv2ControlBase.h b/include/Lv2ControlBase.h index 6b72bec5de5..c6b08db8cf6 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 @@ class LMMS_EXPORT Lv2ControlBase : public LinkedModelGroups const LilvPlugin* m_plugin; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2_CONTROL_BASE_H diff --git a/include/Lv2Evbuf.h b/include/Lv2Evbuf.h index 9cf6a6801fe..2f569f7d6ce 100644 --- a/include/Lv2Evbuf.h +++ b/include/Lv2Evbuf.h @@ -39,6 +39,11 @@ #include + +namespace lmms +{ + + /** An abstract/opaque LV2 event buffer. */ @@ -144,6 +149,9 @@ lv2_evbuf_write( LV2_Evbuf_Iterator* iter, uint32_t size, const uint8_t* data); + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2_EVBUF_H diff --git a/include/Lv2Features.h b/include/Lv2Features.h index 272bb3a4d29..033273f3148 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 @@ class Lv2Features std::map m_featureByUri; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2FEATURES_H diff --git a/include/Lv2Manager.h b/include/Lv2Manager.h index dbea510ce39..7c4a4bcb799 100644 --- a/include/Lv2Manager.h +++ b/include/Lv2Manager.h @@ -39,6 +39,9 @@ #include "Plugin.h" +namespace lmms +{ + /* all Lv2 classes in relation (use our "4 spaces per tab rule" to view): @@ -158,6 +161,9 @@ class Lv2Manager bool isSubclassOf(const LilvPluginClass *clvss, const char *uriStr); }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2MANAGER_H diff --git a/include/Lv2Options.h b/include/Lv2Options.h index 1453de2ea10..32225ea8918 100644 --- a/include/Lv2Options.h +++ b/include/Lv2Options.h @@ -41,6 +41,9 @@ #include "Lv2Manager.h" #include "Lv2UridCache.h" +namespace lmms +{ + /** Option container @@ -99,6 +102,9 @@ class Lv2Options std::map> m_optionValues; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2OPTIONS_H diff --git a/include/Lv2Ports.h b/include/Lv2Ports.h index 529200793ad..22a051a21b4 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 @@ struct Audio : public VisitablePort bool m_sidechain; // the only case when data of m_buffer may be referenced: - friend struct ::ConnectPortVisitor; + friend struct lmms::ConnectPortVisitor; }; struct AtomSeq : public VisitablePort @@ -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 06185a9ac58..31a69404437 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 @@ class Lv2Proc : public LinkedModelGroup static AutoLilvNode uri(const char* uriStr); }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2PROC_H diff --git a/include/Lv2SubPluginFeatures.h b/include/Lv2SubPluginFeatures.h index fee3c381216..9ba2c76cb9d 100644 --- a/include/Lv2SubPluginFeatures.h +++ b/include/Lv2SubPluginFeatures.h @@ -36,6 +36,10 @@ #include "lmms_export.h" #include "Plugin.h" +namespace lmms +{ + + class LMMS_EXPORT Lv2SubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures { private: @@ -57,6 +61,9 @@ class LMMS_EXPORT Lv2SubPluginFeatures : public Plugin::Descriptor::SubPluginFea const Plugin::Descriptor *desc, KeyList &kl) const override; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif diff --git a/include/Lv2UridCache.h b/include/Lv2UridCache.h index e50fd4bab1f..bae42d3186c 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 @@ class Lv2UridCache template<> struct Lv2UridCache::IdForType { static constexpr auto value = Id::atom_Float; }; template<> struct Lv2UridCache::IdForType { static constexpr auto value = Id::atom_Int; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2URIDCACHE_H diff --git a/include/Lv2UridMap.h b/include/Lv2UridMap.h index 39cfcc44fb2..9db9cb0c2ae 100644 --- a/include/Lv2UridMap.h +++ b/include/Lv2UridMap.h @@ -35,6 +35,11 @@ #include #include + +namespace lmms +{ + + /** * Complete implementation of the Lv2 Urid Map extension */ @@ -66,5 +71,8 @@ class UridMap LV2_URID_Unmap* unmapFeature() { return &m_unmapFeature; } }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2URIDMAP_H diff --git a/include/Lv2ViewBase.h b/include/Lv2ViewBase.h index 6eafbde8872..74a0bd87618 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 @@ class LMMS_EXPORT Lv2ViewBase : public LinkedModelGroupsView ~Lv2ViewBase(); // these widgets must be connected by child widgets - class QPushButton *m_reloadPluginButton = nullptr; - class QPushButton *m_toggleUIButton = nullptr; - class QPushButton *m_helpButton = nullptr; + QPushButton* m_reloadPluginButton = nullptr; + QPushButton* m_toggleUIButton = nullptr; + QPushButton* m_helpButton = nullptr; void toggleUI(); void toggleHelp(bool visible); @@ -87,10 +100,13 @@ class LMMS_EXPORT Lv2ViewBase : public LinkedModelGroupsView //! Numbers of controls per row; must be multiple of 2 for mono effects const int m_colNum = 6; - class QMdiSubWindow* m_helpWindow = nullptr; - class LedCheckBox *m_multiChannelLink; + QMdiSubWindow* m_helpWindow = nullptr; }; +} // namespace gui + +} // namespace lmms + #endif // LMMS_HAVE_LV2 #endif // LV2VIEWBASE_H diff --git a/include/MainApplication.h b/include/MainApplication.h index d28900213c9..04bc82226de 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 @@ class MainApplication : public QApplication QString m_queuedFile; }; + +} // namespace lmms::gui + #endif // MAINAPPLICATION_H diff --git a/include/MainWindow.h b/include/MainWindow.h index 145023161ef..8fbc20e6a55 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 @@ private slots: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/MemoryHelper.h b/include/MemoryHelper.h index f5c5bf11b1b..1def9d9c4dc 100644 --- a/include/MemoryHelper.h +++ b/include/MemoryHelper.h @@ -27,6 +27,10 @@ #include +namespace lmms +{ + + /** * Helper class to alocate aligned memory and free it. */ @@ -40,5 +44,8 @@ class MemoryHelper { private: }; + +} // namespace lmms + #endif diff --git a/include/MemoryManager.h b/include/MemoryManager.h index a5899d922af..014071617f8 100644 --- a/include/MemoryManager.h +++ b/include/MemoryManager.h @@ -32,6 +32,10 @@ #include "lmms_export.h" +namespace lmms +{ + + class LMMS_EXPORT MemoryManager { public: @@ -99,4 +103,7 @@ void MM_FREE(T* ptr) MemoryManager::free(ptr); } + +} // namespace lmms + #endif diff --git a/include/MeterDialog.h b/include/MeterDialog.h index da254c7c7cb..e606a448231 100644 --- a/include/MeterDialog.h +++ b/include/MeterDialog.h @@ -30,6 +30,9 @@ #include "ModelView.h" +namespace lmms::gui +{ + class LcdSpinBox; @@ -49,4 +52,6 @@ class MeterDialog : public QWidget, public ModelView } ; +} // namespace lmms::gui + #endif diff --git a/include/MeterModel.h b/include/MeterModel.h index 2b98bed0b85..bcd3fa2b2e7 100644 --- a/include/MeterModel.h +++ b/include/MeterModel.h @@ -27,6 +27,9 @@ #include "AutomatableModel.h" +namespace lmms +{ + class MeterModel : public Model { @@ -62,4 +65,7 @@ class MeterModel : public Model } ; + +} // namespace lmms + #endif diff --git a/include/MicroTimer.h b/include/MicroTimer.h index 2026619e2b0..2eaf28b97ad 100644 --- a/include/MicroTimer.h +++ b/include/MicroTimer.h @@ -27,6 +27,9 @@ #include +namespace lmms +{ + class MicroTimer { using time_point = std::chrono::steady_clock::time_point; @@ -43,4 +46,6 @@ class MicroTimer } ; +} // namespace lmms + #endif diff --git a/include/Microtuner.h b/include/Microtuner.h index 9ac732817dd..934739ff539 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 @@ protected slots: }; +} // namespace lmms + #endif diff --git a/include/MicrotunerConfig.h b/include/MicrotunerConfig.h index 58752026ce2..690587dd55a 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 slots: FloatModel m_baseFreqModel; //!< model for spinbox of currently edited base note frequency }; + +} // namespace lmms::gui + #endif diff --git a/include/Midi.h b/include/Midi.h index b922ac41f47..9a97ae6e44b 100644 --- a/include/Midi.h +++ b/include/Midi.h @@ -28,6 +28,10 @@ #include "lmms_basics.h" +namespace lmms +{ + + enum MidiEventTypes { // messages @@ -137,4 +141,7 @@ const int MidiMinPanning = -128; const int MidiMinPitchBend = 0; const int MidiMaxPitchBend = 16383; + +} // namespace lmms + #endif diff --git a/include/MidiAlsaRaw.h b/include/MidiAlsaRaw.h index 60bf1e6852e..3ab2b8af7f8 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 @@ class MidiAlsaRaw : public QThread, public MidiClientRaw } ; -#endif + +} // namespace lmms + +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/MidiAlsaSeq.h b/include/MidiAlsaSeq.h index bbb3f724211..8a2d3a0987e 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 @@ class MidiAlsaSeq : public QThread, public MidiClient private slots: - void changeQueueTempo( bpm_t _bpm ); + void changeQueueTempo( lmms::bpm_t _bpm ); void updatePortList(); @@ -149,7 +153,10 @@ private slots: } ; -#endif + +} // namespace lmms + +#endif // LMMS_HAVE_ALSA #endif diff --git a/include/MidiApple.h b/include/MidiApple.h index 4ea4805e5a8..d2a90169868 100644 --- a/include/MidiApple.h +++ b/include/MidiApple.h @@ -38,6 +38,10 @@ class QLineEdit; +namespace lmms +{ + + class MidiApple : public QObject, public MidiClient { Q_OBJECT @@ -146,7 +150,10 @@ class MidiApple : public QObject, public MidiClient } ; -#endif + +} // namespace lmms + +#endif // LMMS_BUILD_APPLE #endif diff --git a/include/MidiCCRackView.h b/include/MidiCCRackView.h index 982e06048ee..59f1de020eb 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 slots: }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/MidiClient.h b/include/MidiClient.h index 384a664ce36..835d2e46a40 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 @@ class MidiClientRaw : public MidiClient } ; +} // namespace lmms #endif diff --git a/include/MidiClip.h b/include/MidiClip.h index 036f2771c69..173ca569955 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 @@ class LMMS_EXPORT MidiClip : public Clip bool empty(); - ClipView * createView( TrackView * _tv ) override; + gui::ClipView * createView( gui::TrackView * _tv ) override; using Model::dataChanged; @@ -136,13 +145,14 @@ protected slots: 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 82e552a8c5a..c9f1c3e1e95 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 @@ class MidiClipView : public ClipView void setMutedNoteBorderColor(QColor const & color) { m_mutedNoteBorderColor = color; } public slots: - MidiClip* getMidiClip(); + lmms::MidiClip* getMidiClip(); void update() override; @@ -96,7 +101,10 @@ protected slots: bool m_legacySEPattern; } ; - - + + +} // namespace gui + +} // namespace lmms #endif diff --git a/include/MidiController.h b/include/MidiController.h index 74b408f867d..533f8ff032b 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 @@ class MidiController : public Controller, public MidiEventProcessor public slots: - ControllerDialog * createDialog( QWidget * _parent ) override; + gui::ControllerDialog* createDialog( QWidget * _parent ) override; void updateName(); @@ -76,10 +84,12 @@ public slots: 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 f809d3c3630..8744c6aa2fb 100644 --- a/include/MidiDummy.h +++ b/include/MidiDummy.h @@ -28,6 +28,10 @@ #include "MidiClient.h" +namespace lmms +{ + + class MidiDummy : public MidiClientRaw { public: @@ -63,4 +67,6 @@ class MidiDummy : public MidiClientRaw } ; +} // namespace lmms + #endif diff --git a/include/MidiEvent.h b/include/MidiEvent.h index 29a3c5df6c2..e73a7d1a884 100644 --- a/include/MidiEvent.h +++ b/include/MidiEvent.h @@ -30,6 +30,9 @@ #include "panning_constants.h" #include "volume.h" +namespace lmms +{ + class MidiEvent { public: @@ -225,4 +228,6 @@ class MidiEvent Source m_source; } ; +} // namespace lmms + #endif diff --git a/include/MidiEventProcessor.h b/include/MidiEventProcessor.h index 3ded20430d2..1398f4b6d16 100644 --- a/include/MidiEventProcessor.h +++ b/include/MidiEventProcessor.h @@ -29,6 +29,9 @@ #include "MemoryManager.h" #include "TimePos.h" +namespace lmms +{ + // all classes being able to process MIDI-events should inherit from this class MidiEventProcessor { @@ -48,4 +51,6 @@ class MidiEventProcessor } ; +} // namespace lmms + #endif diff --git a/include/MidiEventToByteSeq.h b/include/MidiEventToByteSeq.h index fba8cdeb414..f2e36f50a29 100644 --- a/include/MidiEventToByteSeq.h +++ b/include/MidiEventToByteSeq.h @@ -30,6 +30,10 @@ #include "lmms_export.h" + +namespace lmms +{ + /** Write MIDI event into byte sequence. @@ -44,4 +48,7 @@ std::size_t LMMS_EXPORT writeToByteSeq( const class MidiEvent& ev, uint8_t* data, std::size_t bufsize ); + +} // namespace lmms + #endif // MIDIEVENTTOBYTESEQ_H diff --git a/include/MidiJack.h b/include/MidiJack.h index f12f9cebf99..16d09d431e3 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 @@ class MidiJack : public QThread, public MidiClientRaw }; + +} // namespace lmms + #endif // LMMS_HAVE_JACK #endif // MIDIJACK_H diff --git a/include/MidiOss.h b/include/MidiOss.h index 68b970bc5e9..30f78bec117 100644 --- a/include/MidiOss.h +++ b/include/MidiOss.h @@ -35,6 +35,9 @@ #include "MidiClient.h" +namespace lmms +{ + class MidiOss : public QThread, public MidiClientRaw { @@ -69,7 +72,11 @@ class MidiOss : public QThread, public MidiClientRaw } ; -#endif + +} // namespace lmms + + +#endif // LMMS_HAVE_OSS #endif diff --git a/include/MidiPort.h b/include/MidiPort.h index b057f5d6c34..3d3ceffdb35 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 @@ class MidiPort : public Model, public SerializingObject void invalidateCilent(); - MidiPortMenu* m_readablePortsMenu; - MidiPortMenu* m_writablePortsMenu; + gui::MidiPortMenu* m_readablePortsMenu; + gui::MidiPortMenu* m_writablePortsMenu; public slots: @@ -165,8 +175,8 @@ private slots: Map m_writablePorts; - friend class ControllerConnectionDialog; - friend class InstrumentMidiIOView; + friend class gui::ControllerConnectionDialog; + friend class gui::InstrumentMidiIOView; signals: @@ -179,5 +189,6 @@ private slots: typedef QList MidiPortList; +} // namespace lmms #endif diff --git a/include/MidiPortMenu.h b/include/MidiPortMenu.h index ce39c4aace0..7f7689edc2e 100644 --- a/include/MidiPortMenu.h +++ b/include/MidiPortMenu.h @@ -33,6 +33,8 @@ class QAction; +namespace lmms::gui +{ class MidiPortMenu : public QMenu, public ModelView { @@ -57,5 +59,6 @@ protected slots: } ; +} // namespace lmms::gui #endif diff --git a/include/MidiSetupWidget.h b/include/MidiSetupWidget.h index fcaa294080c..4021db1420d 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 @@ class MidiSetupWidget : public TabWidget }; + +} // namespace lmms::gui + #endif diff --git a/include/MidiSndio.h b/include/MidiSndio.h index 2042a16adc6..07c42186dec 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 @@ class MidiSndio : public QThread, public MidiClientRaw 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 cbb13998313..7cc7f0f7721 100644 --- a/include/MidiWinMM.h +++ b/include/MidiWinMM.h @@ -38,6 +38,10 @@ class QLineEdit; +namespace lmms +{ + + class MidiWinMM : public QObject, public MidiClient { Q_OBJECT @@ -141,7 +145,10 @@ class MidiWinMM : public QObject, public MidiClient } ; -#endif + +} // namespace lmms + +#endif // LMMS_BUILD_WIN32 #endif diff --git a/include/MixHelpers.h b/include/MixHelpers.h index 872319f82df..6599b40ec0a 100644 --- a/include/MixHelpers.h +++ b/include/MixHelpers.h @@ -27,6 +27,9 @@ #include "lmms_basics.h" +namespace lmms +{ + class ValueBuffer; namespace MixHelpers { @@ -73,7 +76,10 @@ void multiplyAndAddMultiplied( sampleFrame* dst, const sampleFrame* src, float c /*! \brief Multiply dst by coeffDst and add samples from srcLeft/srcRight multiplied by coeffSrc */ void multiplyAndAddMultipliedJoined( sampleFrame* dst, const sample_t* srcLeft, const sample_t* srcRight, float coeffDst, float coeffSrc, int frames ); -} +} // namespace MixHelpers + + +} // namespace lmms #endif diff --git a/include/Mixer.h b/include/Mixer.h index 7a6e3d0ff56..36aa9f5d0b3 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 @@ class LMMS_EXPORT Mixer : public Model, public JournallingObject } ; +} // namespace lmms + #endif diff --git a/include/MixerLine.h b/include/MixerLine.h index 4f7f7242fea..12ac3df7530 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 QGraphicsView; -class QLineEdit; 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 6de8fcb47d1..7e739093d50 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 @@ class MixerLineLcdSpinBox : public LcdSpinBox TrackView * m_tv; }; + +} // namespace lmms::gui + #endif diff --git a/include/MixerView.h b/include/MixerView.h index 6c586a607f1..5e63194c968 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 slots: friend class MixerChannelView; } ; + +} // namespace lmms::gui + #endif diff --git a/include/Model.h b/include/Model.h index 623d3a9f900..1c96de21c1a 100644 --- a/include/Model.h +++ b/include/Model.h @@ -30,6 +30,8 @@ #include "lmms_export.h" +namespace lmms +{ class LMMS_EXPORT Model : public QObject { @@ -88,5 +90,7 @@ class LMMS_EXPORT Model : public QObject } ; +} // namespace lmms + #endif diff --git a/include/ModelView.h b/include/ModelView.h index 7aad9ce7fe4..a858dc7ec1d 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 @@ class LMMS_EXPORT ModelView } ; +} // namespace lmms::gui #endif diff --git a/include/ModelVisitor.h b/include/ModelVisitor.h index f9d156e30f4..cf0740b1c1f 100644 --- a/include/ModelVisitor.h +++ b/include/ModelVisitor.h @@ -25,6 +25,10 @@ #ifndef MODELVISITOR_H #define MODELVISITOR_H +namespace lmms +{ + + class AutomatableModel; class BoolModel; class IntModel; @@ -61,4 +65,7 @@ class ConstModelVisitor virtual ~ConstModelVisitor(); }; + +} // namespace lmms + #endif // MODELVISITOR_H diff --git a/include/NStateButton.h b/include/NStateButton.h index 10cb151ae93..ff48593a7e4 100644 --- a/include/NStateButton.h +++ b/include/NStateButton.h @@ -32,6 +32,9 @@ #include "ToolButton.h" +namespace lmms::gui +{ + class NStateButton : public ToolButton { @@ -72,4 +75,7 @@ public slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/Note.h b/include/Note.h index 31ba6995e81..d6e0b85c254 100644 --- a/include/Note.h +++ b/include/Note.h @@ -33,6 +33,11 @@ #include "SerializingObject.h" #include "TimePos.h" + +namespace lmms +{ + + class DetuningHelper; @@ -247,4 +252,6 @@ class LMMS_EXPORT Note : public SerializingObject typedef QVector NoteVector; +} // namespace lmms + #endif diff --git a/include/NotePlayHandle.h b/include/NotePlayHandle.h index 778acd46e5c..396d00e719a 100644 --- a/include/NotePlayHandle.h +++ b/include/NotePlayHandle.h @@ -35,6 +35,10 @@ #include "MemoryManager.h" class QReadWriteLock; + +namespace lmms +{ + class InstrumentTrack; class NotePlayHandle; @@ -359,4 +363,6 @@ class NotePlayHandleManager }; +} // namespace lmms + #endif diff --git a/include/Oscillator.h b/include/Oscillator.h index da9bea4eb04..e9f64008cc3 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 @@ class LMMS_EXPORT Oscillator } ; +} // namespace lmms + #endif diff --git a/include/OscillatorConstants.h b/include/OscillatorConstants.h index dcdad8dc4f5..47b13a87563 100644 --- a/include/OscillatorConstants.h +++ b/include/OscillatorConstants.h @@ -30,8 +30,9 @@ #include "lmms_basics.h" -namespace OscillatorConstants +namespace lmms::OscillatorConstants { + // Limit wavetables to the audible audio spectrum const int MAX_FREQ = 20000; // Minimum size of table to have all audible bands for midi note 1 (i.e. 20 000 Hz / 8.176 Hz) @@ -51,7 +52,8 @@ namespace OscillatorConstants // - wavetable: a table containing one period of a wave, with frequency content optimized for a specific pitch. typedef std::array wavetable_t; typedef std::array waveform_t; -}; +} // namespace lmms::OscillatorConstants + #endif // OSCILLATORCONSTANTS_H diff --git a/include/Oscilloscope.h b/include/Oscilloscope.h index 4072df47856..4404fd98bb0 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 @@ class Oscilloscope : public QWidget protected slots: - void updateAudioBuffer( const surroundSampleFrame * buffer ); + void updateAudioBuffer( const lmms::surroundSampleFrame * buffer ); private: QColor const & determineLineColor(float level) const; @@ -73,4 +76,7 @@ protected slots: QColor m_clippingColor; } ; + +} // namespace lmms::gui + #endif // OSCILLOSCOPE_H diff --git a/include/OutputSettings.h b/include/OutputSettings.h index 4a375d244e2..03e3333acdf 100644 --- a/include/OutputSettings.h +++ b/include/OutputSettings.h @@ -28,6 +28,11 @@ #include "lmms_basics.h" + +namespace lmms +{ + + class OutputSettings { public: @@ -112,4 +117,7 @@ class OutputSettings double m_compressionLevel; }; + +} // namespace lmms + #endif diff --git a/include/PathUtil.h b/include/PathUtil.h index b1eec517e0b..8b1ef10970b 100644 --- a/include/PathUtil.h +++ b/include/PathUtil.h @@ -1,3 +1,27 @@ +/* + * PathUtil.h + * + * Copyright (c) 2019-2022 Spekular + * + * This file is part of LMMS - https://lmms.io + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301 USA. + * + */ + #ifndef PATHUTIL_H #define PATHUTIL_H @@ -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 a6543267bed..a1beb00f51b 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 @@ class PatternClip : public Clip 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 9cda176880a..d66de70f0ee 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 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/PatternEditor.h b/include/PatternEditor.h index 03861c1b0ec..15b141580c0 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 @@ protected slots: }; - - class PatternEditorWindow : public Editor { - Q_OBJECT +Q_OBJECT public: PatternEditorWindow(PatternStore* ps); ~PatternEditorWindow(); @@ -90,4 +94,9 @@ public slots: ComboBox* m_patternComboBox; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/PatternStore.h b/include/PatternStore.h index e11328c1676..39b65d1c1c9 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 @@ public slots: // 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 c594b4cf5fb..a8e7a505c9b 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 @@ class LMMS_EXPORT PatternTrack : public Track 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 @@ class LMMS_EXPORT PatternTrack : public Track 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 ecc209f0467..41f8fac333a 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 @@ public slots: +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/PeakController.h b/include/PeakController.h index 341d4f47a46..d50c0b06fe6 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 @@ class LMMS_EXPORT PeakController : public Controller public slots: - ControllerDialog * createDialog( QWidget * _parent ) override; + gui::ControllerDialog * createDialog( QWidget * _parent ) override; void handleDestroyedEffect( ); void updateCoeffs(); @@ -80,7 +84,8 @@ public slots: bool m_coeffNeedsUpdate; } ; - +namespace gui +{ class PeakControllerDialog : public ControllerDialog { @@ -96,6 +101,11 @@ class PeakControllerDialog : public ControllerDialog PeakController * m_peakController; -} ; +}; + + +} // namespace gui + +} // namespace lmms #endif diff --git a/include/PerfLog.h b/include/PerfLog.h index 5d1efc14cc3..b8cc35f45b3 100644 --- a/include/PerfLog.h +++ b/include/PerfLog.h @@ -28,6 +28,10 @@ #include #include +namespace lmms +{ + + /// \brief CPU time point /// /// Represents a point in CPU time (not wall-clock time) intended for measuring @@ -70,4 +74,7 @@ class PerfLogTimer PerfTime begin_time; }; + +} // namespace lmms + #endif diff --git a/include/Piano.h b/include/Piano.h index ece3abb0631..b9f5e979705 100644 --- a/include/Piano.h +++ b/include/Piano.h @@ -28,6 +28,10 @@ #include "Note.h" #include "Model.h" +namespace lmms +{ + + class InstrumentTrack; class MidiEventProcessor; @@ -82,5 +86,8 @@ class Piano final : public Model } ; + +} // namespace lmms + #endif diff --git a/include/PianoRoll.h b/include/PianoRoll.h index f00e8a79c3d..73a2e5b7693 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 @@ protected slots: QBrush m_blackKeyDisabledBackground; signals: - void positionChanged( const TimePos & ); + void positionChanged( const lmms::TimePos & ); } ; @@ -559,4 +569,8 @@ private slots: }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/PianoView.h b/include/PianoView.h index 88854943176..7a6ab647953 100644 --- a/include/PianoView.h +++ b/include/PianoView.h @@ -31,8 +31,13 @@ #include "AutomatableModel.h" #include "ModelView.h" +namespace lmms +{ + class Piano; +namespace gui +{ class PianoView : public QWidget, public ModelView { @@ -94,4 +99,8 @@ private slots: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/Pitch.h b/include/Pitch.h index 17de48b940b..3f58785eae0 100644 --- a/include/Pitch.h +++ b/include/Pitch.h @@ -27,6 +27,10 @@ #include +namespace lmms +{ + + typedef int16_t pitch_t; constexpr pitch_t CentsPerSemitone = 100; @@ -34,4 +38,7 @@ constexpr pitch_t MinPitchDefault = -CentsPerSemitone; constexpr pitch_t MaxPitchDefault = CentsPerSemitone; constexpr pitch_t DefaultPitch = 0; + +} // namespace lmms + #endif diff --git a/include/PixmapButton.h b/include/PixmapButton.h index e2fb5888508..f4062826d01 100644 --- a/include/PixmapButton.h +++ b/include/PixmapButton.h @@ -30,6 +30,9 @@ #include "AutomatableButton.h" +namespace lmms::gui +{ + class LMMS_EXPORT PixmapButton : public AutomatableButton { @@ -62,4 +65,7 @@ class LMMS_EXPORT PixmapButton : public AutomatableButton } ; + +} // namespace lmms::gui + #endif diff --git a/include/PlayHandle.h b/include/PlayHandle.h index 6de358acd5a..53457f916fa 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 @@ class LMMS_EXPORT PlayHandle : public ThreadableJob typedef QList PlayHandleList; typedef QList ConstPlayHandleList; +} // namespace lmms #endif diff --git a/include/Plugin.h b/include/Plugin.h index fb9ebd567bf..b50d81116b4 100644 --- a/include/Plugin.h +++ b/include/Plugin.h @@ -35,9 +35,18 @@ class QWidget; +namespace lmms +{ + +class AutomatableModel; class PixmapLoader; + +namespace gui +{ + class PluginView; -class AutomatableModel; + +} /** Abstract representation of a plugin @@ -286,11 +295,11 @@ class LMMS_EXPORT Plugin : public Model, public JournallingObject static Plugin * instantiate(const QString& pluginName, Model * parent, void *data); //! Create a view for the model - PluginView * createView( QWidget * parent ); + gui::PluginView * createView( QWidget * parent ); protected: //! Create a view for the model - virtual PluginView* instantiateView( QWidget * ) = 0; + virtual gui::PluginView* instantiateView( QWidget * ) = 0; void collectErrorForUI( QString errMsg ); @@ -305,4 +314,6 @@ class LMMS_EXPORT Plugin : public Model, public JournallingObject } ; +} // namespace lmms + #endif diff --git a/include/PluginBrowser.h b/include/PluginBrowser.h index 9c74ed643fa..0b2a59d15f1 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 @@ class PluginDescWidget : public QWidget }; +} // namespace lmms::gui + #endif diff --git a/include/PluginFactory.h b/include/PluginFactory.h index 80627f35175..c0e2ff8e0fc 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 @@ public slots: //Short-hand function LMMS_EXPORT PluginFactory* getPluginFactory(); + +} // namespace lmms + #endif // PLUGINFACTORY_H diff --git a/include/PluginIssue.h b/include/PluginIssue.h index 8bfad5bf10f..f0fa275f378 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 @@ class PluginIssue QDebug operator<<(QDebug stream, const PluginIssue& iss); +} // namespace lmms + + #endif // PLUGINISSUE_H diff --git a/include/PluginView.h b/include/PluginView.h index 476d65acf49..2c06b9ba23d 100644 --- a/include/PluginView.h +++ b/include/PluginView.h @@ -30,6 +30,8 @@ #include "Plugin.h" #include "ModelView.h" +namespace lmms::gui +{ class LMMS_EXPORT PluginView : public QWidget, public ModelView { @@ -43,4 +45,6 @@ class LMMS_EXPORT PluginView : public QWidget, public ModelView } ; +} // namespace lmms::gui + #endif diff --git a/include/PositionLine.h b/include/PositionLine.h index e9ec8c3d529..cc1313e578e 100644 --- a/include/PositionLine.h +++ b/include/PositionLine.h @@ -28,6 +28,9 @@ #include +namespace lmms::gui +{ + class PositionLine : public QWidget { Q_OBJECT @@ -46,4 +49,6 @@ public slots: QColor m_lineColor; }; +} // namespace lmms::gui + #endif diff --git a/include/PresetPreviewPlayHandle.h b/include/PresetPreviewPlayHandle.h index fcdecf6b8bb..9dd15133030 100644 --- a/include/PresetPreviewPlayHandle.h +++ b/include/PresetPreviewPlayHandle.h @@ -28,6 +28,9 @@ #include "NotePlayHandle.h" +namespace lmms +{ + class DataFile; class InstrumentTrack; @@ -64,4 +67,6 @@ class LMMS_EXPORT PresetPreviewPlayHandle : public PlayHandle } ; +} // namespace lmms + #endif diff --git a/include/ProjectJournal.h b/include/ProjectJournal.h index f8b9e642baf..69e0752cbb6 100644 --- a/include/ProjectJournal.h +++ b/include/ProjectJournal.h @@ -31,6 +31,11 @@ #include "lmms_basics.h" #include "DataFile.h" + +namespace lmms +{ + + class JournallingObject; @@ -119,5 +124,7 @@ class ProjectJournal } ; +} // namespace lmms + #endif diff --git a/include/ProjectNotes.h b/include/ProjectNotes.h index 03add4b04c9..fda5c9b5173 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 slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/ProjectRenderer.h b/include/ProjectRenderer.h index ce5d6af3c61..bd61c4730b2 100644 --- a/include/ProjectRenderer.h +++ b/include/ProjectRenderer.h @@ -32,6 +32,10 @@ #include "lmms_export.h" +namespace lmms +{ + + class LMMS_EXPORT ProjectRenderer : public QThread { Q_OBJECT @@ -96,4 +100,7 @@ public slots: } ; + +} // namespace lmms + #endif diff --git a/include/ProjectVersion.h b/include/ProjectVersion.h index d72704ba3ce..5be259c9746 100644 --- a/include/ProjectVersion.h +++ b/include/ProjectVersion.h @@ -32,6 +32,10 @@ #include +namespace lmms +{ + + /*! \brief Version number parsing and comparison * * Parses and compares version information. i.e. "1.0.3" < "1.0.10" @@ -75,4 +79,7 @@ inline bool operator>=(const ProjectVersion & v1, const ProjectVersion & v2) { r inline bool operator==(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) == 0; } inline bool operator!=(const ProjectVersion & v1, const ProjectVersion & v2) { return ProjectVersion::compare(v1, v2) != 0; } + +} // namespace lmms + #endif diff --git a/include/QuadratureLfo.h b/include/QuadratureLfo.h index b530937b0f9..42d4d32c03d 100644 --- a/include/QuadratureLfo.h +++ b/include/QuadratureLfo.h @@ -27,6 +27,10 @@ #include "lmms_math.h" +namespace lmms +{ + + class QuadratureLfo { public: @@ -93,4 +97,7 @@ class QuadratureLfo }; + +} // namespace lmms + #endif // QUADRATURELFO_H diff --git a/include/RaiiHelpers.h b/include/RaiiHelpers.h index bebd91ff911..0cfa2c4acbb 100644 --- a/include/RaiiHelpers.h +++ b/include/RaiiHelpers.h @@ -27,6 +27,10 @@ #include #include + +namespace lmms +{ + template class NullableResource { @@ -57,4 +61,6 @@ struct NullableResourceDeleter template using UniqueNullableResource = std::unique_ptr>; +} // namespace lmms + #endif // RAII_HELPERS_H diff --git a/include/RecentProjectsMenu.h b/include/RecentProjectsMenu.h index b3837ee2e31..ac363829843 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 615cce2c853..ec08896e22f 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 @@ class LMMS_EXPORT RemotePlugin : public QObject, public RemotePluginBase return true; #else return m_process.state() != QProcess::NotRunning; -#endif +#endif // DEBUG_REMOTE_PLUGIN } bool init( const QString &pluginExecutable, bool waitForInitDoneMsg, QStringList extraArgs = {} ); @@ -166,7 +170,7 @@ public slots: #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 a5646ad1190..4d5627a92a4 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 +#endif // SYNC_WITH_SHM_FIFO + +#endif // BUILD_REMOTE_PLUGIN_CLIENT +#ifdef SYNC_WITH_SHM_FIFO +#include "SharedMemory.h" #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 @@ class LMMS_EXPORT RemotePluginBase } ; +} // namespace lmms + #endif // REMOTE_PLUGIN_BASE_H diff --git a/include/RemotePluginClient.h b/include/RemotePluginClient.h index 94f05af0ffa..69a9d41e980 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 8f526baddad..c1e30b9d866 100644 --- a/include/RenameDialog.h +++ b/include/RenameDialog.h @@ -32,6 +32,8 @@ class QLineEdit; +namespace lmms::gui +{ class RenameDialog : public QDialog { @@ -58,4 +60,6 @@ protected slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/RenderManager.h b/include/RenderManager.h index 93598370241..ff59cb95377 100644 --- a/include/RenderManager.h +++ b/include/RenderManager.h @@ -32,6 +32,10 @@ #include "OutputSettings.h" +namespace lmms +{ + + class RenderManager : public QObject { Q_OBJECT @@ -78,4 +82,7 @@ private slots: QVector m_unmuted; } ; + +} // namespace lmms + #endif diff --git a/include/RingBuffer.h b/include/RingBuffer.h index 46539c0eab2..efb5afd3995 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 @@ protected slots: volatile unsigned int m_position; }; + + +} // namespace lmms + #endif diff --git a/include/RmsHelper.h b/include/RmsHelper.h index f5f2770fa2e..19b7da89cfc 100644 --- a/include/RmsHelper.h +++ b/include/RmsHelper.h @@ -28,6 +28,11 @@ #include "lmms_math.h" + +namespace lmms +{ + + class RmsHelper { public: @@ -91,4 +96,6 @@ class RmsHelper }; +} // namespace lmms + #endif diff --git a/include/RowTableView.h b/include/RowTableView.h index a7b07c2c893..fc55383a1c1 100644 --- a/include/RowTableView.h +++ b/include/RowTableView.h @@ -27,6 +27,9 @@ #include +namespace lmms::gui +{ + class RowDelegate; @@ -51,5 +54,6 @@ class RowTableView : public QTableView } ; +} // namespace lmms::gui #endif diff --git a/include/Rubberband.h b/include/Rubberband.h index 21e699d851c..1332a932d2f 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 @@ class RubberBand : public QRubberBand }; +} // namespace lmms::gui + #endif diff --git a/include/SampleBuffer.h b/include/SampleBuffer.h index 991d9d14021..b556fccbe61 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 @@ class LMMS_EXPORT SampleBuffer : public QObject, public sharedObject public slots: void setAudioFile(const QString & audioFile); void loadFromBase64(const QString & data); - void setStartFrame(const f_cnt_t s); - void setEndFrame(const f_cnt_t e); + void setStartFrame(const lmms::f_cnt_t s); + void setEndFrame(const lmms::f_cnt_t e); void setAmplification(float a); void setReversed(bool on); void sampleRateChanged(); @@ -351,5 +354,6 @@ public slots: } ; +} // namespace lmms #endif diff --git a/include/SampleClip.h b/include/SampleClip.h index 7c4f9cf606a..52a2d6209e4 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 @@ class SampleClip : public Clip 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 @@ public slots: BoolModel m_recordModel; bool m_isPlaying; - friend class SampleClipView; + friend class gui::SampleClipView; signals: @@ -88,5 +98,6 @@ public slots: } ; +} // namespace lmms #endif diff --git a/include/SampleClipView.h b/include/SampleClipView.h index c18e6ab5a83..d5218e28a93 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 @@ public slots: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/SamplePlayHandle.h b/include/SamplePlayHandle.h index 04360a26e83..d27591df35c 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 @@ class SamplePlayHandle : public PlayHandle } ; +} // namespace lmms + #endif diff --git a/include/SampleRecordHandle.h b/include/SampleRecordHandle.h index f5ebb2201e0..724f4216d0e 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 @@ class SampleRecordHandle : public PlayHandle } ; +} // namespace lmms + #endif diff --git a/include/SampleTrack.h b/include/SampleTrack.h index 5ca5741b818..677e048892f 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 @@ class SampleTrack : public Track 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 @@ public slots: - 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 7d3e550c226..1223f999d45 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 slots: } ; +} // namespace gui + +} // namespace lmms #endif \ No newline at end of file diff --git a/include/SampleTrackWindow.h b/include/SampleTrackWindow.h index 85c175564c9..dd670fd091e 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 @@ public slots: +} // namespace lmms::gui + + #endif diff --git a/include/Scale.h b/include/Scale.h index a9321fe40ff..3a92dd6899c 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 @@ class Scale : public QObject, public SerializingObject }; + +} // namespace lmms + #endif diff --git a/include/SendButtonIndicator.h b/include/SendButtonIndicator.h index 33d8cac6443..ec4a90db37a 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 @@ class SendButtonIndicator : public QLabel FloatModel * getSendModel(); }; + +} // namespace gui + +} // namespace lmms + #endif // SENDBUTTONINDICATOR_H diff --git a/include/SerializingObject.h b/include/SerializingObject.h index aba8c7b0f4f..e32d5d04663 100644 --- a/include/SerializingObject.h +++ b/include/SerializingObject.h @@ -33,6 +33,9 @@ class QDomDocument; class QDomElement; +namespace lmms +{ + class SerializingObjectHook; @@ -96,5 +99,7 @@ class SerializingObjectHook } ; +} // namespace lmms + #endif diff --git a/include/SetupDialog.h b/include/SetupDialog.h index d0878e46231..28668d8e9df 100644 --- a/include/SetupDialog.h +++ b/include/SetupDialog.h @@ -42,6 +42,11 @@ class QLabel; class QLineEdit; class QSlider; + +namespace lmms::gui +{ + + class TabBar; class SetupDialog : public QDialog @@ -208,4 +213,8 @@ private slots: QLabel * restartWarningLbl; }; + + +} // namespace lmms::gui + #endif diff --git a/include/SharedMemory.h b/include/SharedMemory.h index bc649110bb7..32a40ff2590 100644 --- a/include/SharedMemory.h +++ b/include/SharedMemory.h @@ -28,7 +28,12 @@ #include #include -namespace detail { + +namespace lmms +{ + +namespace detail +{ class SharedMemoryImpl; @@ -67,6 +72,7 @@ class SharedMemoryData } // namespace detail + template class SharedMemory { @@ -140,4 +146,6 @@ class SharedMemory detail::SharedMemoryData m_data; }; +} // namespace lmms + #endif // SHARED_MEMORY_H diff --git a/include/SideBar.h b/include/SideBar.h index 7ed52efc3f8..70bac6385f5 100644 --- a/include/SideBar.h +++ b/include/SideBar.h @@ -30,6 +30,10 @@ #include class QToolButton; + +namespace lmms::gui +{ + class SideBarWidget; @@ -54,4 +58,6 @@ private slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/SideBarWidget.h b/include/SideBarWidget.h index 95c6ab9edda..71a33a3cee4 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 @@ class SideBarWidget : public QWidget } ; + +} // namespace lmms::gui + #endif diff --git a/include/Song.h b/include/Song.h index ae8c697b53e..cfe63a2ea41 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 @@ class LMMS_EXPORT Song : public TrackContainer { 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 slots: 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 @@ private slots: } ; +} // namespace lmms + #endif diff --git a/include/SongEditor.h b/include/SongEditor.h index db52f7352c8..29a9be0bfba 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 @@ protected slots: QAction* m_removeBarAction; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/StepRecorder.h b/include/StepRecorder.h index 864faef4bd0..b89fadb1544 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 512ab5b3532..4067b00011c 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 @@ class StepRecorderWidget : public QWidget 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 969a12eec4e..9da2381b033 100644 --- a/include/StringPairDrag.h +++ b/include/StringPairDrag.h @@ -35,6 +35,9 @@ class QPixmap; +namespace lmms::gui +{ + class LMMS_EXPORT StringPairDrag : public QDrag { @@ -50,4 +53,6 @@ class LMMS_EXPORT StringPairDrag : public QDrag } ; +} // namespace lmms::gui + #endif diff --git a/include/SubWindow.h b/include/SubWindow.h index 113db636abf..3c73a9ddefa 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 0e54e6cce81..2e795be3b42 100644 --- a/include/SweepOscillator.h +++ b/include/SweepOscillator.h @@ -28,6 +28,8 @@ #include "Oscillator.h" #include "DspEffectLibrary.h" +namespace lmms +{ template class SweepOscillator @@ -67,4 +69,6 @@ class SweepOscillator } ; +} // namespace lmms + #endif diff --git a/include/TabBar.h b/include/TabBar.h index 46226618b4a..9239aef9451 100644 --- a/include/TabBar.h +++ b/include/TabBar.h @@ -33,6 +33,10 @@ #include "lmms_export.h" +namespace lmms::gui +{ + + class TabButton; @@ -85,4 +89,6 @@ protected slots: } ; +} // namespace lmms::gui + #endif diff --git a/include/TabButton.h b/include/TabButton.h index ffb425d710d..d5d70fcac82 100644 --- a/include/TabButton.h +++ b/include/TabButton.h @@ -28,6 +28,9 @@ #include +namespace lmms::gui +{ + class TabButton : public QPushButton { @@ -63,4 +66,7 @@ protected slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/TabWidget.h b/include/TabWidget.h index d4a3ec3c9a2..fdd0123da2e 100644 --- a/include/TabWidget.h +++ b/include/TabWidget.h @@ -29,6 +29,9 @@ #include #include +namespace lmms::gui +{ + const int TEXT_TAB_HEIGHT = 14; const int GRAPHIC_TAB_HEIGHT = 17; @@ -106,4 +109,7 @@ class TabWidget : public QWidget QColor m_tabBorder; // The TabWidget's borders color. } ; + +} // namespace lmms::gui + #endif diff --git a/include/TemplatesMenu.h b/include/TemplatesMenu.h index 049f1f47eeb..45c7bce4be0 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 3e9fc973801..22a21f3dc52 100644 --- a/include/TempoSyncKnob.h +++ b/include/TempoSyncKnob.h @@ -32,6 +32,9 @@ #include "Knob.h" #include "TempoSyncKnobModel.h" +namespace lmms::gui +{ + class MeterDialog; class LMMS_EXPORT TempoSyncKnob : public Knob @@ -79,4 +82,6 @@ protected slots: +} // namespace lmms::gui + #endif diff --git a/include/TempoSyncKnobModel.h b/include/TempoSyncKnobModel.h index b9512aa1a93..1e6decfb9ad 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 @@ class LMMS_EXPORT TempoSyncKnobModel : public FloatModel void setScale( float _new_scale ); signals: - void syncModeChanged( TempoSyncMode _new_mode ); + void syncModeChanged( lmms::TempoSyncKnobModel::TempoSyncMode _new_mode ); void scaleChanged( float _new_scale ); @@ -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 @@ protected slots: MeterModel m_custom; - friend class TempoSyncKnob; + friend class gui::TempoSyncKnob; } ; +} // namespace lmms + #endif diff --git a/include/TextFloat.h b/include/TextFloat.h index 1df7ed46ac6..580c3b9792a 100644 --- a/include/TextFloat.h +++ b/include/TextFloat.h @@ -31,6 +31,8 @@ #include "lmms_export.h" +namespace lmms::gui +{ class LMMS_EXPORT TextFloat : public QWidget { @@ -79,4 +81,7 @@ class LMMS_EXPORT TextFloat : public QWidget }; + +} // namespace lmms::gui + #endif diff --git a/include/ThreadableJob.h b/include/ThreadableJob.h index b2b20e9be95..8e714ae19cf 100644 --- a/include/ThreadableJob.h +++ b/include/ThreadableJob.h @@ -29,6 +29,9 @@ #include +namespace lmms +{ + class ThreadableJob { public: @@ -85,4 +88,6 @@ class ThreadableJob std::atomic m_state; } ; +} // namespace lmms + #endif diff --git a/include/TimeDisplayWidget.h b/include/TimeDisplayWidget.h index 303ce6d5eb4..d8e38333a89 100644 --- a/include/TimeDisplayWidget.h +++ b/include/TimeDisplayWidget.h @@ -31,6 +31,8 @@ #include "LcdWidget.h" +namespace lmms::gui +{ class TimeDisplayWidget : public QWidget { @@ -67,4 +69,6 @@ private slots: } ; +} // namespace lmms::gui + #endif // TIME_DISPLAY_WIDGET_H diff --git a/include/TimeLineWidget.h b/include/TimeLineWidget.h index 7809c042ebb..4cbddcda4b1 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 @@ class TimeLineWidget : public QWidget, public JournallingObject public slots: - void updatePosition( const TimePos & ); + void updatePosition( const lmms::TimePos & ); void updatePosition() { updatePosition( TimePos() ); @@ -247,7 +251,7 @@ public slots: signals: - void positionChanged( const TimePos & _t ); + void positionChanged( const lmms::TimePos & _t ); void loopPointStateLoaded( int _n ); void positionMarkerMoved(); void loadBehaviourAtStop( int _n ); @@ -255,4 +259,7 @@ public slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/TimePos.h b/include/TimePos.h index 8b758d9b421..808eede2587 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 @@ class LMMS_EXPORT TimePos } ; +} // namespace lmms + #endif diff --git a/include/ToolButton.h b/include/ToolButton.h index 2f64d45b8b2..c6e80b4c241 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 @@ class ToolButton : public QToolButton } ; +} // namespace lmms::gui + #endif diff --git a/include/ToolPlugin.h b/include/ToolPlugin.h index 8a65147ac80..899c3190605 100644 --- a/include/ToolPlugin.h +++ b/include/ToolPlugin.h @@ -29,6 +29,11 @@ #include "Plugin.h" + +namespace lmms +{ + + class LMMS_EXPORT ToolPlugin : public Plugin { public: @@ -42,4 +47,7 @@ class LMMS_EXPORT ToolPlugin : public Plugin } ; + +} // namespace lmms + #endif diff --git a/include/ToolPluginView.h b/include/ToolPluginView.h index 2b64caaafd3..0b702fd1bf7 100644 --- a/include/ToolPluginView.h +++ b/include/ToolPluginView.h @@ -28,8 +28,15 @@ #include "PluginView.h" +namespace lmms +{ + class ToolPlugin; +namespace gui +{ + + class LMMS_EXPORT ToolPluginView : public PluginView { public: @@ -38,4 +45,8 @@ class LMMS_EXPORT ToolPluginView : public PluginView } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/include/Track.h b/include/Track.h index d00ac378396..ec069c38f9c 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 @@ class LMMS_EXPORT Track : public Model, public JournallingObject 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 @@ public slots: 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 18139a0da95..beb7564adb3 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 @@ class LMMS_EXPORT TrackContainer : public Model, public JournallingObject virtual AutomatedValueMap automatedValuesAt(TimePos time, int clipNum = -1) const; signals: - void trackAdded( Track * _track ); + void trackAdded( lmms::Track * _track ); protected: static AutomatedValueMap automatedValuesFromTracks(const TrackList &tracks, TimePos timeStart, int clipNum = -1); @@ -109,10 +117,11 @@ class LMMS_EXPORT TrackContainer : public Model, public JournallingObject TrackContainerTypes m_TrackContainerType; - friend class TrackContainerView; + friend class gui::TrackContainerView; friend class Track; } ; +} // namespace lmms #endif diff --git a/include/TrackContainerView.h b/include/TrackContainerView.h index 00267bfe8af..edcffeb2fa0 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 @@ class TrackContainerView : public QWidget, public ModelView, public slots: void realignTracks(); - TrackView * createTrackView( Track * _t ); - void deleteTrackView( TrackView * _tv ); + lmms::gui::TrackView * createTrackView( lmms::Track * _t ); + void deleteTrackView( lmms::gui::TrackView * _tv ); void dropEvent( QDropEvent * _de ) override; void dragEnterEvent( QDragEnterEvent * _dee ) override; @@ -188,24 +209,14 @@ public slots: 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 d3bf60488f0..228a3e7395d 100644 --- a/include/TrackContentWidget.h +++ b/include/TrackContentWidget.h @@ -33,10 +33,16 @@ class QMimeData; +namespace lmms +{ + class Track; -class ClipView; -class TrackView; +namespace gui +{ + +class TrackView; +class ClipView; class TrackContentWidget : public QWidget, public JournallingObject { @@ -86,7 +92,7 @@ class TrackContentWidget : public QWidget, public JournallingObject public slots: void update(); - void changePosition( const TimePos & newPos = TimePos( -1 ) ); + void changePosition( const lmms::TimePos & newPos = TimePos( -1 ) ); protected: enum ContextMenuAction @@ -139,5 +145,8 @@ public slots: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/include/TrackLabelButton.h b/include/TrackLabelButton.h index a46f418e9f7..3be64adeee0 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 @@ public slots: } ; + +} // namespace lmms::gui + #endif diff --git a/include/TrackOperationsWidget.h b/include/TrackOperationsWidget.h index 7680aa7b492..92f1a889cc5 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 slots: 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 e681a2d212c..4b13ff9b749 100644 --- a/include/TrackRenameLineEdit.h +++ b/include/TrackRenameLineEdit.h @@ -29,6 +29,9 @@ #include +namespace lmms::gui +{ + class TrackRenameLineEdit : public QLineEdit { Q_OBJECT @@ -43,4 +46,6 @@ class TrackRenameLineEdit : public QLineEdit QString m_oldName; } ; +} // namespace lmms::gui + #endif diff --git a/include/TrackView.h b/include/TrackView.h index 4467ecbdbde..2f5c5ed2880 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 @@ public slots: 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 f9869de8888..24c8e0daa19 100644 --- a/include/ValueBuffer.h +++ b/include/ValueBuffer.h @@ -31,6 +31,10 @@ #include "MemoryManager.h" #include "lmms_export.h" +namespace lmms +{ + + class LMMS_EXPORT ValueBuffer : public std::vector { MM_OPERATORS @@ -50,4 +54,7 @@ class LMMS_EXPORT ValueBuffer : public std::vector void interpolate(float start, float end); }; + +} // namespace lmms + #endif diff --git a/include/VersionedSaveDialog.h b/include/VersionedSaveDialog.h index bb4894500f7..79ab516b0c2 100644 --- a/include/VersionedSaveDialog.h +++ b/include/VersionedSaveDialog.h @@ -32,6 +32,10 @@ #include "Song.h" class QLineEdit; + +namespace lmms::gui +{ + class LedCheckBox; class SaveOptionsWidget : public QWidget { @@ -62,4 +66,7 @@ public slots: void decrementVersion(); }; + +} // namespace lmms::gui + #endif // VERSIONEDSAVEDIALOG_H diff --git a/include/VstSyncController.h b/include/VstSyncController.h index ec7d9820c38..947a65ea2e3 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 slots: SharedMemory m_shm; }; + +} // namespace lmms + #endif diff --git a/include/VstSyncData.h b/include/VstSyncData.h index ac1bed218a6..bf4d42b808d 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 7cdfcfe7d08..5ba81e6a0a7 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 @@ class VstTimeInfo 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 a0557fe0db4..f52d90d136e 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 e08669b2bcb..e99e767a39c 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 ea3e3417e51..5dd6a41a271 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 @@ class PluginPixmapLoader : public PixmapLoader } } ; -#endif +#endif // PLUGIN_NAME +} // namespace lmms #endif diff --git a/include/endian_handling.h b/include/endian_handling.h index 09953a0ac67..b3d122fa359 100644 --- a/include/endian_handling.h +++ b/include/endian_handling.h @@ -30,6 +30,10 @@ #include "lmms_basics.h" +namespace lmms +{ + + inline bool isLittleEndian() { return( QSysInfo::ByteOrder == QSysInfo::LittleEndian ); @@ -50,4 +54,7 @@ inline int32_t swap32IfBE( int32_t i ) ( ( i & 0x000000ff ) << 24 ) ); } + +} // namespace lmms + #endif diff --git a/include/fft_helpers.h b/include/fft_helpers.h index 88183fb1969..8ba0fc7a0b6 100644 --- a/include/fft_helpers.h +++ b/include/fft_helpers.h @@ -32,6 +32,9 @@ #include #include +namespace lmms +{ + // NOTE: FFT_BUFFER_SIZE should be considered deprecated! // It is used by Eq plugin and some older code here, but this should be a user // switchable parameter, not a constant. Use a value from FFT_BLOCK_SIZES @@ -103,4 +106,7 @@ int LMMS_EXPORT absspec(const fftwf_complex *complex_buffer, float *absspec_buff int LMMS_EXPORT compressbands(const float * _absspec_buffer, float * _compressedband, int _num_old, int _num_new, int _bottom, int _top); + +} // namespace lmms + #endif diff --git a/include/gui_templates.h b/include/gui_templates.h index 073cb50f1c1..ee0ccdbf674 100644 --- a/include/gui_templates.h +++ b/include/gui_templates.h @@ -32,6 +32,8 @@ #include #include +namespace lmms +{ // return DPI-independent font-size - font with returned font-size has always @@ -65,4 +67,6 @@ inline QFont pointSizeF( QFont _f, float SIZE ) } +} // namespace lmms + #endif diff --git a/include/interpolation.h b/include/interpolation.h index cb324cd763f..3a74334e423 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 cda591c0d5c..3f7057ef7d4 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 f5a86bc880c..7796f6bdfc1 100644 --- a/include/lmms_constants.h +++ b/include/lmms_constants.h @@ -25,6 +25,10 @@ #ifndef LMMS_CONSTANTS_H #define LMMS_CONSTANTS_H +namespace lmms +{ + + constexpr long double LD_PI = 3.14159265358979323846264338327950288419716939937510; constexpr long double LD_2PI = LD_PI * 2.0; constexpr long double LD_PI_2 = LD_PI * 0.5; @@ -96,4 +100,7 @@ constexpr int ARANGE_LOUD_END = 0; constexpr int ARANGE_SILENT_START = -60; constexpr int ARANGE_SILENT_END = -10; + +} // namespace lmms + #endif diff --git a/include/lmms_math.h b/include/lmms_math.h index aa043170ca0..e1de0993692 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 6f65c8295af..1521ec984b3 100644 --- a/include/panning.h +++ b/include/panning.h @@ -31,6 +31,10 @@ #include "Midi.h" #include "volume.h" +namespace lmms +{ + + inline StereoVolumeVector panningToVolumeVector( panning_t _p, float _scale = 1.0f ) { @@ -49,4 +53,7 @@ inline int panningToMidi( panning_t _p ) ( (float)( MidiMaxPanning - MidiMinPanning ) ) ); } + +} // namespace lmms + #endif diff --git a/include/panning_constants.h b/include/panning_constants.h index cf335ccfb36..00a5c3291da 100644 --- a/include/panning_constants.h +++ b/include/panning_constants.h @@ -26,9 +26,16 @@ #ifndef PANNING_CONSTANTS_H #define PANNING_CONSTANTS_H +namespace lmms +{ + + constexpr panning_t PanningRight = ( 0 + 100 ); constexpr panning_t PanningLeft = - PanningRight; constexpr panning_t PanningCenter = 0; constexpr panning_t DefaultPanning = PanningCenter; + +} // namespace lmms + #endif diff --git a/include/shared_object.h b/include/shared_object.h index efb8ba5d69a..e68186336a6 100644 --- a/include/shared_object.h +++ b/include/shared_object.h @@ -28,6 +28,9 @@ #include +namespace lmms +{ + class sharedObject { public: @@ -82,4 +85,7 @@ class sharedObject std::atomic_int m_referenceCount; } ; + +} // namespace lmms + #endif diff --git a/include/volume.h b/include/volume.h index bb9fff228ac..eaf5ab9ffb1 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 2dfdc9d8c80..ced43f1e263 100644 --- a/plugins/Amplifier/Amplifier.cpp +++ b/plugins/Amplifier/Amplifier.cpp @@ -28,6 +28,9 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + extern "C" { @@ -145,3 +148,4 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } +} // namespace lmms \ No newline at end of file diff --git a/plugins/Amplifier/Amplifier.h b/plugins/Amplifier/Amplifier.h index 843c25bdbbc..941971ae7e2 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 @@ class AmplifierEffect : public Effect } ; + +} // namespace lmms + #endif diff --git a/plugins/Amplifier/AmplifierControlDialog.cpp b/plugins/Amplifier/AmplifierControlDialog.cpp index ad2846edb12..34114e90bde 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 d0d7d0aa325..6362d5f72a6 100644 --- a/plugins/Amplifier/AmplifierControlDialog.h +++ b/plugins/Amplifier/AmplifierControlDialog.h @@ -28,10 +28,15 @@ #include "EffectControlDialog.h" +namespace lmms +{ class AmplifierControls; +namespace gui +{ + class AmplifierControlDialog : public EffectControlDialog { Q_OBJECT @@ -43,4 +48,9 @@ class AmplifierControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Amplifier/AmplifierControls.cpp b/plugins/Amplifier/AmplifierControls.cpp index 70876be1133..30773046044 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 f0f950fd119..7eaa0f099da 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 @@ class AmplifierControls : public EffectControls return 4; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new AmplifierControlDialog( this ); + return new gui::AmplifierControlDialog( this ); } @@ -70,9 +77,12 @@ private slots: 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 d3c13511ba3..b5e991a2ca4 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 532a1611440..30fcbc50213 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 slots: f_cnt_t m_nextPlayStartPoint; bool m_nextPlayBackwards; - friend class AudioFileProcessorView; + friend class gui::AudioFileProcessorView; } ; +namespace gui +{ class AudioFileProcessorWaveView; -class AudioFileProcessorView : public InstrumentViewFixedSize +class AudioFileProcessorView : public gui::InstrumentViewFixedSize { Q_OBJECT public: @@ -143,7 +155,7 @@ protected slots: Knob * m_endKnob; Knob * m_loopKnob; - PixmapButton * m_openAudioFileButton; + gui::PixmapButton * m_openAudioFileButton; PixmapButton * m_reverseButton; automatableButtonGroup * m_loopGroup; PixmapButton * m_stutterButton; @@ -174,7 +186,7 @@ class AudioFileProcessorWaveView : public QWidget loop } ; - class knob : public ::Knob + class knob : public Knob { const AudioFileProcessorWaveView * m_waveView; const Knob * m_relatedKnob; @@ -182,7 +194,7 @@ class AudioFileProcessorWaveView : public QWidget 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 @@ public slots: } ; +} // namespace gui +} // namespace lmms #endif diff --git a/plugins/BassBooster/BassBooster.cpp b/plugins/BassBooster/BassBooster.cpp index f01e70720ad..b8ea271ee36 100644 --- a/plugins/BassBooster/BassBooster.cpp +++ b/plugins/BassBooster/BassBooster.cpp @@ -27,6 +27,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -155,3 +159,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } + +} // namespace lmms \ No newline at end of file diff --git a/plugins/BassBooster/BassBooster.h b/plugins/BassBooster/BassBooster.h index d3db6e2205d..9edca3b2220 100644 --- a/plugins/BassBooster/BassBooster.h +++ b/plugins/BassBooster/BassBooster.h @@ -30,6 +30,8 @@ #include "DspEffectLibrary.h" #include "BassBoosterControls.h" +namespace lmms +{ class BassBoosterEffect : public Effect { @@ -60,4 +62,7 @@ class BassBoosterEffect : public Effect } ; + +} // namespace lmms + #endif diff --git a/plugins/BassBooster/BassBoosterControlDialog.cpp b/plugins/BassBooster/BassBoosterControlDialog.cpp index f7513e13e01..f1e60c3ff5a 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 ec636e808e7..89a60fa1a7d 100644 --- a/plugins/BassBooster/BassBoosterControlDialog.h +++ b/plugins/BassBooster/BassBoosterControlDialog.h @@ -27,9 +27,13 @@ #include "EffectControlDialog.h" +namespace lmms +{ class BassBoosterControls; +namespace gui +{ class BassBoosterControlDialog : public EffectControlDialog { @@ -42,4 +46,9 @@ class BassBoosterControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/BassBooster/BassBoosterControls.cpp b/plugins/BassBooster/BassBoosterControls.cpp index 195f00801db..cda00043bc3 100644 --- a/plugins/BassBooster/BassBoosterControls.cpp +++ b/plugins/BassBooster/BassBoosterControls.cpp @@ -28,6 +28,8 @@ #include "BassBoosterControls.h" #include "BassBooster.h" +namespace lmms +{ BassBoosterControls::BassBoosterControls( BassBoosterEffect* effect ) : @@ -66,6 +68,4 @@ void BassBoosterControls::saveSettings( QDomDocument& doc, QDomElement& _this ) } - - - +} // namespace lmms diff --git a/plugins/BassBooster/BassBoosterControls.h b/plugins/BassBooster/BassBoosterControls.h index e7b61348a22..c67ce4d7a81 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 @@ class BassBoosterControls : public EffectControls return 3; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new BassBoosterControlDialog( this ); + return new gui::BassBoosterControlDialog( this ); } @@ -68,8 +70,11 @@ private slots: 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 60c933949aa..55dd973863e 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 64d5bbfdad9..cce524beb90 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 @@ class BitInvader : public Instrument return( 64 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView * instantiateView( QWidget * _parent ); protected slots: void lengthChanged(); @@ -103,10 +110,12 @@ protected slots: float m_normalizeFactor; - friend class BitInvaderView; + friend class gui::BitInvaderView; } ; +namespace gui +{ class BitInvaderView : public InstrumentViewFixedSize { @@ -153,5 +162,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/Bitcrush/Bitcrush.cpp b/plugins/Bitcrush/Bitcrush.cpp index 206f6307d4f..13f8806232f 100644 --- a/plugins/Bitcrush/Bitcrush.cpp +++ b/plugins/Bitcrush/Bitcrush.cpp @@ -27,6 +27,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + const int OS_RATE = 5; const float OS_RATIO = 1.0f / OS_RATE; const float CUTOFF_RATIO = 0.353553391f; @@ -251,3 +255,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/Bitcrush/Bitcrush.h b/plugins/Bitcrush/Bitcrush.h index f309021e12c..670742e205f 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 @@ class BitcrushEffect : public Effect friend class BitcrushControls; }; + +} // namespace lmms + #endif diff --git a/plugins/Bitcrush/BitcrushControlDialog.cpp b/plugins/Bitcrush/BitcrushControlDialog.cpp index 43117f00b0d..ddf41508adb 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 c56b94c5ae8..49d5bce7e30 100644 --- a/plugins/Bitcrush/BitcrushControlDialog.h +++ b/plugins/Bitcrush/BitcrushControlDialog.h @@ -29,8 +29,15 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class BitcrushControls; + +namespace gui +{ + class BitcrushControlDialog : public EffectControlDialog { Q_OBJECT @@ -41,4 +48,9 @@ class BitcrushControlDialog : public EffectControlDialog } }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Bitcrush/BitcrushControls.cpp b/plugins/Bitcrush/BitcrushControls.cpp index 19886aa750d..9acd7d7c0da 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 02c96919699..ed69dd704c2 100644 --- a/plugins/Bitcrush/BitcrushControls.h +++ b/plugins/Bitcrush/BitcrushControls.h @@ -29,6 +29,10 @@ #include "EffectControls.h" #include "BitcrushControlDialog.h" +namespace lmms +{ + + class BitcrushEffect; class BitcrushControls : public EffectControls @@ -50,9 +54,9 @@ class BitcrushControls : public EffectControls return( 9 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog * createView() { - return( new BitcrushControlDialog( this ) ); + return( new gui::BitcrushControlDialog( this ) ); } private slots: @@ -75,8 +79,11 @@ private slots: BoolModel m_rateEnabled; BoolModel m_depthEnabled; - friend class BitcrushControlDialog; + friend class gui::BitcrushControlDialog; friend class BitcrushEffect; }; + +} // namespace lmms + #endif diff --git a/plugins/CarlaBase/Carla.cpp b/plugins/CarlaBase/Carla.cpp index a09b2367d40..6082f00da0a 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 98662014b4e..2010ac3c450 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,59 +169,6 @@ class CarlaParamFloatModel : public FloatModel // ------------------------------------------------------------------- -class CarlaParamsSubWindow : public SubWindow -{ - Q_OBJECT - -signals: - void uiClosed(); - void resized(); - -public: - CarlaParamsSubWindow(QWidget * _parent, Qt::WindowFlags windowFlags) : - SubWindow(_parent) - { - setAttribute(Qt::WA_DeleteOnClose, false); - setWindowFlags(windowFlags); - } - - virtual void resizeEvent(QResizeEvent * event) override - { - if (mousePress) { - resizing = true; - } - SubWindow::resizeEvent(event); - } - - virtual void mousePressEvent(QMouseEvent * event) override - { - mousePress = true; - SubWindow::mousePressEvent(event); - } - - virtual void mouseReleaseEvent(QMouseEvent * event) override - { - if (resizing) { - resizing = false; - mousePress = false; - emit resized(); - } - SubWindow::mouseReleaseEvent(event); - } - - virtual void closeEvent(QCloseEvent * event) override - { - emit uiClosed(); - event->accept(); - } - -private: - bool resizing = false; - bool mousePress = false; -}; - -// ------------------------------------------------------------------- - class CARLABASE_EXPORT CarlaInstrument : public Instrument { Q_OBJECT @@ -240,7 +195,7 @@ class CARLABASE_EXPORT CarlaInstrument : public Instrument virtual void loadSettings(const QDomElement& elem); virtual void play(sampleFrame* workingBuffer); virtual bool handleMidiEvent(const MidiEvent& event, const TimePos& time, f_cnt_t offset); - virtual PluginView* instantiateView(QWidget* parent); + virtual gui::PluginView* instantiateView(QWidget* parent); signals: void uiClosed(); @@ -274,11 +229,67 @@ private slots: QCompleter* m_paramsCompleter; QStringListModel* m_completerModel; - friend class CarlaInstrumentView; - friend class CarlaParamsView; + friend class gui::CarlaInstrumentView; + friend class gui::CarlaParamsView; }; +// ------------------------------------------------------------------- + +namespace gui +{ + +class CarlaParamsSubWindow : public SubWindow +{ +Q_OBJECT + +signals: + void uiClosed(); + void resized(); + +public: + CarlaParamsSubWindow(QWidget * _parent, Qt::WindowFlags windowFlags) : + SubWindow(_parent) + { + setAttribute(Qt::WA_DeleteOnClose, false); + setWindowFlags(windowFlags); + } + + virtual void resizeEvent(QResizeEvent * event) override + { + if (mousePress) { + resizing = true; + } + SubWindow::resizeEvent(event); + } + + virtual void mousePressEvent(QMouseEvent * event) override + { + mousePress = true; + SubWindow::mousePressEvent(event); + } + + virtual void mouseReleaseEvent(QMouseEvent * event) override + { + if (resizing) { + resizing = false; + mousePress = false; + emit resized(); + } + SubWindow::mouseReleaseEvent(event); + } + + virtual void closeEvent(QCloseEvent * event) override + { + emit uiClosed(); + event->accept(); + } + +private: + bool resizing = false; + bool mousePress = false; +}; + // ------------------------------------------------------------------- class CarlaInstrumentView : public InstrumentViewFixedSize @@ -365,4 +376,9 @@ private slots: QStringListModel* m_groupFilterModel; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/CarlaPatchbay/CarlaPatchbay.cpp b/plugins/CarlaPatchbay/CarlaPatchbay.cpp index 0c9ca9f01d1..7f5b2060edf 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 d8f0ac978e1..ad2dd00b8b1 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 6728f403f30..60688863334 100755 --- a/plugins/Compressor/Compressor.cpp +++ b/plugins/Compressor/Compressor.cpp @@ -29,6 +29,10 @@ #include "lmms_math.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -662,3 +666,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main(Model* parent, void* data) } + +} // namespace lmms diff --git a/plugins/Compressor/Compressor.h b/plugins/Compressor/Compressor.h index 374f3f8b6c1..9b81d9b707d 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 slots: bool m_redrawThreshold = true; friend class CompressorControls; - friend class CompressorControlDialog; + friend class gui::CompressorControlDialog; } ; + +} // namespace lmms + #endif diff --git a/plugins/Compressor/CompressorControlDialog.cpp b/plugins/Compressor/CompressorControlDialog.cpp index 106aa7a1dfa..2f9fed9c232 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 f20a1d220ab..1324d7e2653 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 slots: friend class CompressorControls; } ; + + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Compressor/CompressorControls.cpp b/plugins/Compressor/CompressorControls.cpp index 01d44c2459b..81247e900a5 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 233b89ddfd1..852781f387f 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 @@ class CompressorControls : public EffectControls return 28; } - EffectControlDialog* createView() override + gui::EffectControlDialog* createView() override { - return new CompressorControlDialog(this); + return new gui::CompressorControlDialog(this); } private: @@ -93,9 +95,12 @@ class CompressorControls : public EffectControls 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 92a3f6a6d1b..d915afc23a3 100644 --- a/plugins/CrossoverEQ/CrossoverEQ.cpp +++ b/plugins/CrossoverEQ/CrossoverEQ.cpp @@ -29,6 +29,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -222,3 +226,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/CrossoverEQ/CrossoverEQ.h b/plugins/CrossoverEQ/CrossoverEQ.h index d1f76c1e6a6..4e5872f0c83 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 @@ class CrossoverEQEffect : public Effect friend class CrossoverEQControls; }; + +} // namespace lmms + #endif diff --git a/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp b/plugins/CrossoverEQ/CrossoverEQControlDialog.cpp index 7cf2d0c5b1a..22506817711 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 e1e9f013dfd..f2836655712 100644 --- a/plugins/CrossoverEQ/CrossoverEQControlDialog.h +++ b/plugins/CrossoverEQ/CrossoverEQControlDialog.h @@ -30,8 +30,16 @@ #include #include "EffectControlDialog.h" +namespace lmms +{ + + class CrossoverEQControls; + +namespace gui +{ + class CrossoverEQControlDialog : public EffectControlDialog { Q_OBJECT @@ -47,4 +55,9 @@ class CrossoverEQControlDialog : public EffectControlDialog QPixmap m_fader_knob; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/CrossoverEQ/CrossoverEQControls.cpp b/plugins/CrossoverEQ/CrossoverEQControls.cpp index 19c1163a32d..9758d804a86 100644 --- a/plugins/CrossoverEQ/CrossoverEQControls.cpp +++ b/plugins/CrossoverEQ/CrossoverEQControls.cpp @@ -27,6 +27,10 @@ #include "CrossoverEQControls.h" #include "CrossoverEQ.h" +namespace lmms +{ + + CrossoverEQControls::CrossoverEQControls( CrossoverEQEffect * eff ) : EffectControls( eff ), m_effect( eff ), @@ -115,3 +119,6 @@ void CrossoverEQControls::sampleRateChanged() { m_effect->sampleRateChanged(); } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/CrossoverEQ/CrossoverEQControls.h b/plugins/CrossoverEQ/CrossoverEQControls.h index 3823a8370ba..7f941736588 100644 --- a/plugins/CrossoverEQ/CrossoverEQControls.h +++ b/plugins/CrossoverEQ/CrossoverEQControls.h @@ -30,6 +30,9 @@ #include "EffectControls.h" #include "CrossoverEQControlDialog.h" +namespace lmms +{ + class CrossoverEQEffect; class CrossoverEQControls : public EffectControls @@ -51,9 +54,9 @@ class CrossoverEQControls : public EffectControls return( 11 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog * createView() { - return( new CrossoverEQControlDialog( this ) ); + return( new gui::CrossoverEQControlDialog( this ) ); } private slots: @@ -79,8 +82,11 @@ private slots: BoolModel m_mute3; BoolModel m_mute4; - friend class CrossoverEQControlDialog; + friend class gui::CrossoverEQControlDialog; friend class CrossoverEQEffect; }; + +} // namespace lmms + #endif diff --git a/plugins/Delay/DelayControls.cpp b/plugins/Delay/DelayControls.cpp index d4b3220a920..b31488f721d 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 c912a453e41..4f4b193f436 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 @@ class DelayControls : public EffectControls virtual int controlCount(){ return 5; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new DelayControlsDialog( this ); + return new gui::DelayControlsDialog( this ); } float m_outPeakL; @@ -69,8 +72,11 @@ private slots: TempoSyncKnobModel m_lfoAmountModel; FloatModel m_outGainModel; - friend class DelayControlsDialog; + friend class gui::DelayControlsDialog; friend class DelayEffect; }; + +} // namespace lmms + #endif // DELAYCONTROLS_H diff --git a/plugins/Delay/DelayControlsDialog.cpp b/plugins/Delay/DelayControlsDialog.cpp index db59b3f394c..0354667f59d 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 4b2c0af4153..9ab349d4eb4 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 @@ class XyPad : public QWidget bool m_acceptInput; }; + +} // namespace gui + +} // namespace lmms + #endif // DELAYCONTROLSDIALOG_H diff --git a/plugins/Delay/DelayEffect.cpp b/plugins/Delay/DelayEffect.cpp index 1377498b048..5ce29f8ec47 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 c409458edcd..2757d6cc4d7 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 @@ class DelayEffect : public Effect float m_currentLength; }; + +} // namespace lmms + #endif // DELAYEFFECT_H diff --git a/plugins/Delay/Lfo.cpp b/plugins/Delay/Lfo.cpp index 0360263efc9..5a449243a47 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 10b7e2fc065..cb2d13f118f 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 @@ class Lfo int m_samplerate; }; + +} // namespace lmms + #endif // LFO_H diff --git a/plugins/Delay/StereoDelay.cpp b/plugins/Delay/StereoDelay.cpp index bdbd6340433..e4b8b5641d0 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 afea59b9af1..0ea0efeed06 100644 --- a/plugins/Delay/StereoDelay.h +++ b/plugins/Delay/StereoDelay.h @@ -27,6 +27,10 @@ #include "lmms_basics.h" + +namespace lmms +{ + class StereoDelay { public: @@ -57,4 +61,7 @@ class StereoDelay float m_maxTime; }; + +} // namespace lmms + #endif // STEREODELAY_H diff --git a/plugins/DualFilter/DualFilter.cpp b/plugins/DualFilter/DualFilter.cpp index 19bed543623..2279ae37dec 100644 --- a/plugins/DualFilter/DualFilter.cpp +++ b/plugins/DualFilter/DualFilter.cpp @@ -29,6 +29,10 @@ #include "BasicFilters.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -229,3 +233,5 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } + +} // namespace lmms diff --git a/plugins/DualFilter/DualFilter.h b/plugins/DualFilter/DualFilter.h index a8eb82075d1..bfc9dc81be1 100644 --- a/plugins/DualFilter/DualFilter.h +++ b/plugins/DualFilter/DualFilter.h @@ -31,6 +31,10 @@ #include "DualFilterControls.h" #include "BasicFilters.h" +namespace lmms +{ + + class DualFilterEffect : public Effect { public: @@ -62,4 +66,7 @@ class DualFilterEffect : public Effect } ; + +} // namespace lmms + #endif diff --git a/plugins/DualFilter/DualFilterControlDialog.cpp b/plugins/DualFilter/DualFilterControlDialog.cpp index c6c56befdf2..0b23f4b8a44 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 f839864d87f..a6ac469549f 100644 --- a/plugins/DualFilter/DualFilterControlDialog.h +++ b/plugins/DualFilter/DualFilterControlDialog.h @@ -28,9 +28,15 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class DualFilterControls; +namespace gui +{ + class DualFilterControlDialog : public EffectControlDialog { @@ -43,4 +49,9 @@ class DualFilterControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/DualFilter/DualFilterControls.cpp b/plugins/DualFilter/DualFilterControls.cpp index 7d54c7c7891..e862e6ae149 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 9713f657a2d..586b2d15a3e 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 @@ class DualFilterControls : public EffectControls return 11; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new DualFilterControlDialog( this ); + return new gui::DualFilterControlDialog( this ); } @@ -80,9 +84,12 @@ private slots: 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 5ead265b26f..85f1d94f47b 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 34e10287c08..91763e68289 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 @@ class DynProcEffect : public Effect } ; - - +} // namespace lmms #endif diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.cpp b/plugins/DynamicsProcessor/DynamicsProcessorControlDialog.cpp index e8ac87ab5f8..fb0fee445cc 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 29f8288c82a..0b4091b303e 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 @@ class DynProcControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp b/plugins/DynamicsProcessor/DynamicsProcessorControls.cpp index 263a2a79310..f4bd8c77a34 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 a292b3f9a12..cb9aebb6a93 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 @@ class DynProcControls : public EffectControls return( 6 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog * createView() { - return( new DynProcControlDialog( this ) ); + return( new gui::DynProcControlDialog( this ) ); } @@ -89,9 +93,12 @@ private slots: 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 f33a646754b..ad1ffa2ac13 100644 --- a/plugins/Eq/EqControls.cpp +++ b/plugins/Eq/EqControls.cpp @@ -30,6 +30,9 @@ #include "EqEffect.h" +namespace lmms +{ + EqControls::EqControls( EqEffect *effect ) : EffectControls( effect ), @@ -149,9 +152,9 @@ void EqControls::loadSettings( const QDomElement &_this ) m_analyseOutModel.loadSettings( _this, "AnalyseOut" ); } -EffectControlDialog*EqControls::createView() +gui::EffectControlDialog* EqControls::createView() { - return new EqControlsDialog( this ); + return new gui::EqControlsDialog( this ); } @@ -202,3 +205,6 @@ void EqControls::saveSettings( QDomDocument &doc, QDomElement &parent ) m_analyseInModel.saveSettings( doc, parent, "AnalyseIn" ); m_analyseOutModel.saveSettings( doc, parent, "AnalyseOut" ); } + + +} // namespace lmms diff --git a/plugins/Eq/EqControls.h b/plugins/Eq/EqControls.h index b314454ea88..8a2061cce0c 100644 --- a/plugins/Eq/EqControls.h +++ b/plugins/Eq/EqControls.h @@ -28,9 +28,17 @@ #include "EffectControls.h" #include "EqSpectrumView.h" +namespace lmms +{ + class EqEffect; +namespace gui +{ +class EqControlsDialog; +} + class EqControls : public EffectControls { Q_OBJECT @@ -54,7 +62,7 @@ class EqControls : public EffectControls return 42; } - virtual EffectControlDialog* createView(); + virtual gui::EffectControlDialog* createView(); float m_inPeakL; float m_inPeakR; @@ -126,7 +134,11 @@ class EqControls : public EffectControls BoolModel m_analyseInModel; BoolModel m_analyseOutModel; - friend class EqControlsDialog; + friend class gui::EqControlsDialog; friend class EqEffect; }; + + +} // namespace lmms + #endif // EQCONTROLS_H diff --git a/plugins/Eq/EqControlsDialog.cpp b/plugins/Eq/EqControlsDialog.cpp index 57fdee6f38b..c044e2b80ae 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 b793543558e..29773769905 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 @@ class EqControlsDialog : public EffectControlDialog int m_originalHeight; }; + +} // namespace gui + +} // namespace lmms + #endif // EQCONTROLSDIALOG_H diff --git a/plugins/Eq/EqCurve.cpp b/plugins/Eq/EqCurve.cpp index be664b7742d..7042312840e 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 6bc3f887177..c7e7d0688df 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 @@ class EqCurve : public QGraphicsObject float m_scale; }; + +} // namespace lmms::gui + #endif // EQCURVE_H diff --git a/plugins/Eq/EqEffect.cpp b/plugins/Eq/EqEffect.cpp index 3b46143e6d1..7a9b5b15e3b 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 b94ddef2684..3697a11e26a 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 @@ class EqEffect : public Effect void setBandPeaks( EqAnalyser * fft , int ); }; + +} // namespace lmms + #endif // EQEFFECT_H diff --git a/plugins/Eq/EqFader.h b/plugins/Eq/EqFader.h index 0df66f7b7bb..1601081e986 100644 --- a/plugins/Eq/EqFader.h +++ b/plugins/Eq/EqFader.h @@ -32,6 +32,9 @@ #include "MainWindow.h" #include "TextFloat.h" +namespace lmms::gui +{ + class EqFader : public Fader { @@ -112,4 +115,8 @@ private slots: FloatModel* m_model; }; + + +} // namespace lmms::gui + #endif // EQFADER_H diff --git a/plugins/Eq/EqFilter.h b/plugins/Eq/EqFilter.h index 5223fdeda39..7361c751cb4 100644 --- a/plugins/Eq/EqFilter.h +++ b/plugins/Eq/EqFilter.h @@ -28,6 +28,10 @@ #include "BasicFilters.h" #include "lmms_math.h" +namespace lmms +{ + + /// /// \brief The EqFilter class. /// A wrapper for the StereoBiQuad class, giving it freq, res, and gain controls. @@ -454,6 +458,7 @@ class EqLinkwitzRiley : public StereoLinkwitzRiley }; +} // namespace lmms #endif // EQFILTER_H diff --git a/plugins/Eq/EqParameterWidget.cpp b/plugins/Eq/EqParameterWidget.cpp index a919f277348..39342129112 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 28d01efbed4..abfe5a9bb8b 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 e65a12ea96f..24e8120491e 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 40a24868d15..c9bfebeb5c2 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 @@ class EqAnalyser }; - +namespace gui +{ class EqSpectrumView : public QWidget { @@ -96,4 +100,10 @@ private slots: float bandToFreq ( int index ); }; + + +} // namespace gui + +} // namespace lmms + #endif // EQSPECTRUMVIEW_H diff --git a/plugins/Flanger/FlangerControls.cpp b/plugins/Flanger/FlangerControls.cpp index 1b4007b387a..7402216ee23 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 54ef38a1c81..1d112bc99b5 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 @@ class FlangerControls : public EffectControls { 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 slots: FloatModel m_whiteNoiseAmountModel; BoolModel m_invertFeedbackModel; - friend class FlangerControlsDialog; + friend class gui::FlangerControlsDialog; friend class FlangerEffect; }; + +} // namespace lmms + #endif // FLANGERCONTROLS_H diff --git a/plugins/Flanger/FlangerControlsDialog.cpp b/plugins/Flanger/FlangerControlsDialog.cpp index 3c9b463fb21..5edab289401 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 3e27bda4751..6aed1b6b4ad 100644 --- a/plugins/Flanger/FlangerControlsDialog.h +++ b/plugins/Flanger/FlangerControlsDialog.h @@ -27,8 +27,16 @@ #include "EffectControlDialog.h" +namespace lmms +{ + + class FlangerControls; +namespace gui +{ + + class FlangerControlsDialog : public EffectControlDialog { Q_OBJECT @@ -39,4 +47,9 @@ class FlangerControlsDialog : public EffectControlDialog } }; + +} // namespace gui + +} // namespace lmms + #endif // FLANGERCONTROLSDIALOG_H diff --git a/plugins/Flanger/FlangerEffect.cpp b/plugins/Flanger/FlangerEffect.cpp index 2668b63c501..71cf96e186a 100644 --- a/plugins/Flanger/FlangerEffect.cpp +++ b/plugins/Flanger/FlangerEffect.cpp @@ -28,6 +28,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -161,3 +165,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } }} + + +} // namespace lmms diff --git a/plugins/Flanger/FlangerEffect.h b/plugins/Flanger/FlangerEffect.h index 630513ade78..d32429194a2 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 @@ class FlangerEffect : public Effect }; + +} // namespace lmms + #endif // FLANGEREFFECT_H diff --git a/plugins/Flanger/MonoDelay.cpp b/plugins/Flanger/MonoDelay.cpp index d43e5b99d23..3ec0289684f 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 52898bfe45d..2e9324a7df5 100644 --- a/plugins/Flanger/MonoDelay.h +++ b/plugins/Flanger/MonoDelay.h @@ -27,6 +27,10 @@ #include "lmms_basics.h" +namespace lmms +{ + + class MonoDelay { public: @@ -57,4 +61,7 @@ class MonoDelay float m_maxTime; }; + +} // namespace lmms + #endif // MONODELAY_H diff --git a/plugins/Flanger/Noise.cpp b/plugins/Flanger/Noise.cpp index f2acb16fea4..263fb7c458f 100644 --- a/plugins/Flanger/Noise.cpp +++ b/plugins/Flanger/Noise.cpp @@ -25,6 +25,10 @@ #include "Noise.h" #include "lmms_math.h" +namespace lmms +{ + + Noise::Noise() { inv_randmax = 1.0/FAST_RAND_MAX; /* for range of 0 - 1.0 */ @@ -37,3 +41,6 @@ float Noise::tick() { return (float) ((2.0 * fast_rand() * inv_randmax) - 1.0); } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/Flanger/Noise.h b/plugins/Flanger/Noise.h index 9a3106f3ef1..9f6e2f2e1eb 100644 --- a/plugins/Flanger/Noise.h +++ b/plugins/Flanger/Noise.h @@ -25,6 +25,10 @@ #ifndef NOISE_H #define NOISE_H +namespace lmms +{ + + class Noise { public: @@ -34,4 +38,7 @@ class Noise double inv_randmax; }; + +} // namespace lmms + #endif // NOISE_H diff --git a/plugins/FreeBoy/FreeBoy.cpp b/plugins/FreeBoy/FreeBoy.cpp index 55c7dd79bb6..67a7ac019ae 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 a6bef0af2bc..6f92b41e908 100644 --- a/plugins/FreeBoy/FreeBoy.h +++ b/plugins/FreeBoy/FreeBoy.h @@ -32,10 +32,19 @@ #include "InstrumentView.h" #include "Graph.h" -class FreeBoyInstrumentView; -class Knob; +namespace lmms +{ + class NotePlayHandle; + + +namespace gui +{ class PixmapButton; +class FreeBoyInstrumentView; +class Knob; +} + class FreeBoyInstrument : public Instrument { @@ -57,7 +66,7 @@ class FreeBoyInstrument : public Instrument virtual f_cnt_t desiredReleaseFrames() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); /*public slots: @@ -107,10 +116,14 @@ class FreeBoyInstrument : public Instrument blip_time_t m_time; blip_time_t fakeClock() { return m_time += 4; } - friend class FreeBoyInstrumentView; + friend class gui::FreeBoyInstrumentView; } ; +namespace gui +{ + + class FreeBoyInstrumentView : public InstrumentViewFixedSize { Q_OBJECT @@ -162,4 +175,8 @@ class FreeBoyInstrumentView : public InstrumentViewFixedSize } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/FreeBoy/Gb_Apu_Buffer.cpp b/plugins/FreeBoy/Gb_Apu_Buffer.cpp index 0cd8662ac29..f261bc9c043 100644 --- a/plugins/FreeBoy/Gb_Apu_Buffer.cpp +++ b/plugins/FreeBoy/Gb_Apu_Buffer.cpp @@ -22,6 +22,10 @@ */ #include "Gb_Apu_Buffer.h" +namespace lmms +{ + + Gb_Apu_Buffer::Gb_Apu_Buffer() {} Gb_Apu_Buffer::~Gb_Apu_Buffer() {} @@ -51,3 +55,5 @@ void Gb_Apu_Buffer::bass_freq(int freq) { m_buf.bass_freq(freq); } + +} // namespace lmms diff --git a/plugins/FreeBoy/Gb_Apu_Buffer.h b/plugins/FreeBoy/Gb_Apu_Buffer.h index 5228b7b8afd..0b025bea003 100644 --- a/plugins/FreeBoy/Gb_Apu_Buffer.h +++ b/plugins/FreeBoy/Gb_Apu_Buffer.h @@ -27,6 +27,10 @@ #include "Multi_Buffer.h" #include "MemoryManager.h" +namespace lmms +{ + + class Gb_Apu_Buffer : public Gb_Apu { MM_OPERATORS public: @@ -44,5 +48,8 @@ class Gb_Apu_Buffer : public Gb_Apu { Stereo_Buffer m_buf; }; + +} // namespace lmms + #endif diff --git a/plugins/GigPlayer/GigPlayer.cpp b/plugins/GigPlayer/GigPlayer.cpp index b2239d8954f..e3d37baa90d 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 288146b603d..c192ee4ae24 100644 --- a/plugins/GigPlayer/GigPlayer.h +++ b/plugins/GigPlayer/GigPlayer.h @@ -41,11 +41,21 @@ #include "MemoryManager.h" #include "gig.h" -class GigInstrumentView; + +class QLabel; + + +namespace lmms +{ + + class NotePlayHandle; +namespace gui +{ class PatchesDialog; -class QLabel; +class GigInstrumentView; +} @@ -261,7 +271,7 @@ class GigInstrument : public Instrument return IsSingleStreamed|IsNotBendable; } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); QString getCurrentPatchName(); @@ -283,8 +293,8 @@ public slots: // Part of the UI QString m_filename; - LcdSpinBoxModel m_bankNum; - LcdSpinBoxModel m_patchNum; + gui::LcdSpinBoxModel m_bankNum; + gui::LcdSpinBoxModel m_patchNum; FloatModel m_gain; @@ -322,7 +332,7 @@ public slots: // samples void addSamples( GigNote & gignote, bool wantReleaseSample ); - friend class GigInstrumentView; + friend class gui::GigInstrumentView; signals: void fileLoading(); @@ -332,6 +342,8 @@ public slots: } ; +namespace gui +{ class GigInstrumentView : public InstrumentViewFixedSize @@ -367,4 +379,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/GigPlayer/PatchesDialog.cpp b/plugins/GigPlayer/PatchesDialog.cpp index 3d75dd21671..a5066c2af8f 100644 --- a/plugins/GigPlayer/PatchesDialog.cpp +++ b/plugins/GigPlayer/PatchesDialog.cpp @@ -27,6 +27,9 @@ #include +namespace lmms::gui +{ + // Custom list-view item (as for numerical sort purposes...) class PatchItem : public QTreeWidgetItem @@ -408,3 +411,6 @@ void PatchesDialog::progChanged( QTreeWidgetItem * curr, QTreeWidgetItem * prev // Stabilize the form. stabilizeForm(); } + + +} // namespace lmms::gui diff --git a/plugins/GigPlayer/PatchesDialog.h b/plugins/GigPlayer/PatchesDialog.h index ae00f660aaf..c43b4cb5c9f 100644 --- a/plugins/GigPlayer/PatchesDialog.h +++ b/plugins/GigPlayer/PatchesDialog.h @@ -36,6 +36,10 @@ //---------------------------------------------------------------------------- // qsynthPresetForm -- UI wrapper form. +namespace lmms::gui +{ + + class PatchesDialog : public QDialog, private Ui::PatchesDialog { Q_OBJECT @@ -88,4 +92,7 @@ protected slots: QLabel * m_patchLabel; }; + +} // namespace lmms::gui + #endif diff --git a/plugins/HydrogenImport/HydrogenImport.cpp b/plugins/HydrogenImport/HydrogenImport.cpp index 7e13d235192..9dc0950fba9 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 d19d1e8dda8..657d61f0c15 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 @@ class HydrogenImport : public ImportFilter virtual ~HydrogenImport(); - virtual PluginView * instantiateView( QWidget * ) + virtual gui::PluginView* instantiateView( QWidget * ) { return( nullptr ); } private: virtual bool tryImport( TrackContainer* tc ); }; + + +} // namespace lmms + #endif diff --git a/plugins/HydrogenImport/LocalFileMng.h b/plugins/HydrogenImport/LocalFileMng.h index 217f95f346f..0aaf7d1c855 100644 --- a/plugins/HydrogenImport/LocalFileMng.h +++ b/plugins/HydrogenImport/LocalFileMng.h @@ -7,6 +7,10 @@ #include #include +namespace lmms +{ + + class LocalFileMng { public: @@ -25,5 +29,9 @@ class LocalFileMng static QDomDocument openXmlDocument( const QString& filename ); std::vector m_allPatternList; }; + + +} // namespace lmms + #endif //LFILEMNG_H diff --git a/plugins/HydrogenImport/local_file_mgr.cpp b/plugins/HydrogenImport/local_file_mgr.cpp index 3ca6572a9a4..22744050157 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 de14f4af7d4..4c5fa77f89f 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 f63f68c9c9b..f48a5ab1200 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 @@ class KickerInstrument : public Instrument return( 512 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); private: @@ -90,11 +95,14 @@ class KickerInstrument : public Instrument IntModel m_versionModel; - friend class KickerInstrumentView; + friend class gui::KickerInstrumentView; } ; +namespace gui +{ + class KickerInstrumentView : public InstrumentViewFixedSize { @@ -123,5 +131,8 @@ class KickerInstrumentView : public InstrumentViewFixedSize } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/Kicker/KickerOsc.h b/plugins/Kicker/KickerOsc.h index 1375725b32e..3a263ffc878 100644 --- a/plugins/Kicker/KickerOsc.h +++ b/plugins/Kicker/KickerOsc.h @@ -33,6 +33,9 @@ #include "interpolation.h" #include "MemoryManager.h" +namespace lmms +{ + template class KickerOsc @@ -107,4 +110,6 @@ class KickerOsc }; +} // namespace lmms + #endif diff --git a/plugins/LadspaBrowser/LadspaBrowser.cpp b/plugins/LadspaBrowser/LadspaBrowser.cpp index 97282c30970..d40b855fd33 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 69c9d626309..f1f88872cab 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 @@ class LadspaBrowserView : public ToolPluginView public slots: - void showPorts( const ladspa_key_t & _key ); + void showPorts( const ::lmms::ladspa_key_t & _key ); private: @@ -52,7 +59,10 @@ public slots: QWidget * createTab( QWidget * _parent, const QString & _txt, LadspaPluginType _type ); -} ; +}; + + +} // namespace gui class LadspaBrowser : public ToolPlugin @@ -61,9 +71,9 @@ class LadspaBrowser : public ToolPlugin LadspaBrowser(); virtual ~LadspaBrowser(); - virtual PluginView * instantiateView( QWidget * ) + virtual gui::PluginView* instantiateView( QWidget * ) { - return new LadspaBrowserView( this ); + return new gui::LadspaBrowserView( this ); } virtual QString nodeName() const; @@ -83,4 +93,6 @@ class LadspaBrowser : public ToolPlugin } ; +} // namespace lmms + #endif diff --git a/plugins/LadspaBrowser/LadspaDescription.cpp b/plugins/LadspaBrowser/LadspaDescription.cpp index 49c16a6953f..5b2364d6f5d 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 01495663a16..0e54acd323e 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 @@ class LadspaDescription : public QWidget 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 20f25ece29f..ab542ce00c5 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 3b66e7ec6be..1473b1ecf53 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 @@ class LadspaPortDialog : public QDialog }; - +} // namespace lmms::gui #endif diff --git a/plugins/LadspaEffect/LadspaControlDialog.cpp b/plugins/LadspaEffect/LadspaControlDialog.cpp index a5be83d803e..199982bb0da 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 86468112ddf..3a102599b4e 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 @@ class LadspaControlDialog : public EffectControlDialog private slots: - void updateEffectView( LadspaControls * _ctl ); + void updateEffectView( lmms::LadspaControls * _ctl ); private: @@ -53,4 +63,9 @@ private slots: } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/LadspaEffect/LadspaControls.cpp b/plugins/LadspaEffect/LadspaControls.cpp index 9399fce038e..1480da743ec 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 0a157009cfb..e8f8863cfe8 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 @@ class LadspaControls : public EffectControls return "ladspacontrols"; } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return new LadspaControlDialog( this ); + return new gui::LadspaControlDialog( this ); } @@ -75,13 +78,16 @@ protected slots: 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 b2e119af7b0..a26e35eb72e 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 a46099f9378..153e2adeb99 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 slots: } ; + +} // namespace lmms + #endif diff --git a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp index dfd302d6ce5..15b3edf684b 100644 --- a/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp +++ b/plugins/LadspaEffect/LadspaSubPluginFeatures.cpp @@ -35,6 +35,9 @@ #include "Ladspa2LMMS.h" #include "LadspaBase.h" +namespace lmms +{ + LadspaSubPluginFeatures::LadspaSubPluginFeatures( Plugin::PluginTypes _type ) : SubPluginFeatures( _type ) @@ -178,3 +181,5 @@ ladspa_key_t LadspaSubPluginFeatures::subPluginKeyToLadspaKey( , _key->attributes["plugin"] ) ); } + +} // namespace lmms diff --git a/plugins/LadspaEffect/LadspaSubPluginFeatures.h b/plugins/LadspaEffect/LadspaSubPluginFeatures.h index 3f47734f9c8..36edeebd36d 100644 --- a/plugins/LadspaEffect/LadspaSubPluginFeatures.h +++ b/plugins/LadspaEffect/LadspaSubPluginFeatures.h @@ -31,6 +31,9 @@ #include "LadspaManager.h" #include "Plugin.h" +namespace lmms +{ + class LadspaSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures { @@ -47,6 +50,9 @@ class LadspaSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures static ladspa_key_t subPluginKeyToLadspaKey( const Key * _key ); -} ; +}; + + +} // namespace lmms #endif diff --git a/plugins/Lb302/Lb302.cpp b/plugins/Lb302/Lb302.cpp index 949f8551012..999b6615128 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 f7fa9ea84d6..550c3d00ace 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 @@ class Lb302Synth : public Instrument return 0; //4048; } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); private: void processNote( NotePlayHandle * n ); @@ -249,7 +259,7 @@ public slots: int process(sampleFrame *outbuf, const int size); - friend class Lb302SynthView; + friend class gui::Lb302SynthView; NotePlayHandle * m_playingNote; NotePlayHandleList m_notes; @@ -257,6 +267,10 @@ public slots: } ; +namespace gui +{ + + class Lb302SynthView : public InstrumentViewFixedSize { Q_OBJECT @@ -284,4 +298,9 @@ class Lb302SynthView : public InstrumentViewFixedSize } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Lv2Effect/Lv2Effect.cpp b/plugins/Lv2Effect/Lv2Effect.cpp index 3d6a114d182..d3755a2c9e6 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 b9e4e06b028..7e14577770a 100644 --- a/plugins/Lv2Effect/Lv2Effect.h +++ b/plugins/Lv2Effect/Lv2Effect.h @@ -28,6 +28,10 @@ #include "Effect.h" #include "Lv2FxControls.h" +namespace lmms +{ + + class Lv2Effect : public Effect { Q_OBJECT @@ -51,4 +55,7 @@ class Lv2Effect : public Effect std::vector m_tmpOutputSmps; }; + +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/plugins/Lv2Effect/Lv2FxControlDialog.cpp b/plugins/Lv2Effect/Lv2FxControlDialog.cpp index 26792356156..d10c01cd42d 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 3abdb300d4d..c749dc12413 100644 --- a/plugins/Lv2Effect/Lv2FxControlDialog.h +++ b/plugins/Lv2Effect/Lv2FxControlDialog.h @@ -28,8 +28,13 @@ #include "EffectControlDialog.h" #include "Lv2ViewBase.h" +namespace lmms +{ + class Lv2FxControls; +namespace gui +{ class Lv2FxControlDialog : public EffectControlDialog, public Lv2ViewBase { @@ -44,4 +49,8 @@ class Lv2FxControlDialog : public EffectControlDialog, public Lv2ViewBase }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Lv2Effect/Lv2FxControls.cpp b/plugins/Lv2Effect/Lv2FxControls.cpp index 99d4162d810..a865151dd77 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 e5449a4f7fe..952e4db6c11 100644 --- a/plugins/Lv2Effect/Lv2FxControls.h +++ b/plugins/Lv2Effect/Lv2FxControls.h @@ -28,8 +28,17 @@ #include "EffectControls.h" #include "Lv2ControlBase.h" +namespace lmms +{ + + class Lv2Effect; +namespace gui +{ +class Lv2FxControlDialog; +} + class Lv2FxControls : public EffectControls, public Lv2ControlBase { @@ -45,7 +54,7 @@ class Lv2FxControls : public EffectControls, public Lv2ControlBase } int controlCount() override; - EffectControlDialog *createView() override; + gui::EffectControlDialog* createView() override; private slots: void changeControl(); @@ -54,8 +63,11 @@ private slots: DataFile::Types settingsType() override; void setNameFromFile(const QString &name) override; - friend class Lv2FxControlDialog; + friend class gui::Lv2FxControlDialog; friend class Lv2Effect; }; + +} // namespace lmms + #endif diff --git a/plugins/Lv2Instrument/Lv2Instrument.cpp b/plugins/Lv2Instrument/Lv2Instrument.cpp index b94e30aef02..f7e0a2b37ea 100644 --- a/plugins/Lv2Instrument/Lv2Instrument.cpp +++ b/plugins/Lv2Instrument/Lv2Instrument.cpp @@ -40,6 +40,8 @@ #include "plugin_export.h" +namespace lmms +{ extern "C" @@ -173,9 +175,9 @@ void Lv2Instrument::play(sampleFrame *buf) -PluginView *Lv2Instrument::instantiateView(QWidget *parent) +gui::PluginView* Lv2Instrument::instantiateView(QWidget *parent) { - return new Lv2InsView(this, parent); + return new gui::Lv2InsView(this, parent); } @@ -213,6 +215,9 @@ void Lv2Instrument::setNameFromFile(const QString &name) +namespace gui +{ + /* Lv2InsView @@ -285,7 +290,7 @@ void Lv2InsView::modelChanged() } - +} // namespace gui extern "C" { @@ -302,3 +307,6 @@ PLUGIN_EXPORT Plugin *lmms_plugin_main(Model *_parent, void *_data) } } + + +} // namespace lmms diff --git a/plugins/Lv2Instrument/Lv2Instrument.h b/plugins/Lv2Instrument/Lv2Instrument.h index bb4f797fa08..116b3ce0535 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 @@ class Lv2Instrument : public Instrument, public Lv2ControlBase return IsSingleStreamed; #endif } - PluginView *instantiateView(QWidget *parent) override; + gui::PluginView* instantiateView(QWidget *parent) override; private slots: void updatePitchRange(); @@ -95,13 +104,17 @@ private slots: 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 @@ class Lv2InsView : public InstrumentView, public Lv2ViewBase }; +} // namespace gui + + +} // namespace lmms + #endif // LV2_INSTRUMENT_H diff --git a/plugins/MidiExport/MidiExport.cpp b/plugins/MidiExport/MidiExport.cpp index a150b424adf..6f0f5a11ee2 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 fd73442b55d..f443c965fa1 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 @@ class MidiExport: public ExportFilter MidiExport(); ~MidiExport(); - virtual PluginView *instantiateView(QWidget *) + virtual gui::PluginView* instantiateView(QWidget *) { return nullptr; } @@ -85,4 +88,6 @@ class MidiExport: public ExportFilter } ; +} // namespace lmms + #endif diff --git a/plugins/MidiImport/MidiImport.cpp b/plugins/MidiImport/MidiImport.cpp index a57a425a241..e6cf644cf39 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 2edcbe9267e..a7ab478a2b7 100644 --- a/plugins/MidiImport/MidiImport.h +++ b/plugins/MidiImport/MidiImport.h @@ -32,6 +32,9 @@ #include "MidiEvent.h" #include "ImportFilter.h" +namespace lmms +{ + class MidiImport : public ImportFilter { @@ -40,7 +43,7 @@ class MidiImport : public ImportFilter MidiImport( const QString & _file ); virtual ~MidiImport(); - virtual PluginView * instantiateView( QWidget * ) + virtual gui::PluginView* instantiateView( QWidget * ) { return( nullptr ); } @@ -125,4 +128,6 @@ class MidiImport : public ImportFilter } ; +} // namespace lmms + #endif diff --git a/plugins/Monstro/Monstro.cpp b/plugins/Monstro/Monstro.cpp index e95b05030d7..889a89fb016 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 98c5d66004e..d6b57cfae6c 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 @@ class MonstroInstrument : public Instrument virtual f_cnt_t desiredReleaseFrames() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); public slots: void updateVolume1(); @@ -564,10 +578,15 @@ public slots: FloatModel m_sub3lfo2; friend class MonstroSynth; - friend class MonstroView; + friend class gui::MonstroView; }; + +namespace gui +{ + + class MonstroView : public InstrumentViewFixedSize { Q_OBJECT @@ -719,4 +738,8 @@ protected slots: }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/MultitapEcho/MultitapEcho.cpp b/plugins/MultitapEcho/MultitapEcho.cpp index 4134436bb42..f3d03740c20 100644 --- a/plugins/MultitapEcho/MultitapEcho.cpp +++ b/plugins/MultitapEcho/MultitapEcho.cpp @@ -27,6 +27,10 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + + extern "C" { @@ -170,3 +174,6 @@ PLUGIN_EXPORT Plugin * lmms_plugin_main( Model* parent, void* data ) } } + + +} // namespace lmms \ No newline at end of file diff --git a/plugins/MultitapEcho/MultitapEcho.h b/plugins/MultitapEcho/MultitapEcho.h index 539ae9475d9..3d6772d248b 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 @@ class MultitapEchoEffect : public Effect }; +} // namespace lmms + #endif diff --git a/plugins/MultitapEcho/MultitapEchoControlDialog.cpp b/plugins/MultitapEcho/MultitapEchoControlDialog.cpp index ac8f480da1f..f96ea46ec5b 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 5ea09877e9f..6104d433eea 100644 --- a/plugins/MultitapEcho/MultitapEchoControlDialog.h +++ b/plugins/MultitapEcho/MultitapEchoControlDialog.h @@ -29,8 +29,16 @@ #include "EffectControlDialog.h" +namespace lmms +{ + + class MultitapEchoControls; +namespace gui +{ + + class MultitapEchoControlDialog : public EffectControlDialog { Q_OBJECT @@ -41,4 +49,9 @@ class MultitapEchoControlDialog : public EffectControlDialog } }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/MultitapEcho/MultitapEchoControls.cpp b/plugins/MultitapEcho/MultitapEchoControls.cpp index 4f2fe63fe4d..4382151af8b 100644 --- a/plugins/MultitapEcho/MultitapEchoControls.cpp +++ b/plugins/MultitapEcho/MultitapEchoControls.cpp @@ -31,6 +31,9 @@ #include "lmms_math.h" #include "base64.h" +namespace lmms +{ + MultitapEchoControls::MultitapEchoControls( MultitapEchoEffect * eff ) : EffectControls( eff ), @@ -178,3 +181,6 @@ void MultitapEchoControls::sampleRateChanged() m_effect->m_sampleRatio = 1.0f / m_effect->m_sampleRate; m_effect->updateFilters( 0, 19 ); } + + +} // namespace lmms diff --git a/plugins/MultitapEcho/MultitapEchoControls.h b/plugins/MultitapEcho/MultitapEchoControls.h index 4696f46d96d..65311c15777 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 @@ class MultitapEchoControls : public EffectControls 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 slots: 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 a84f6e6a45a..b774f7efafd 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 f17265c14bc..f57cca9e7db 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 @@ class NesInstrument : public Instrument return( 8 ); } - virtual PluginView * instantiateView( QWidget * parent ); + virtual gui::PluginView* instantiateView( QWidget * parent ); public slots: void updateFreq1(); @@ -288,10 +299,14 @@ public slots: friend class NesObject; - friend class NesInstrumentView; + friend class gui::NesInstrumentView; }; +namespace gui +{ + + class NesInstrumentView : public InstrumentViewFixedSize { Q_OBJECT @@ -360,4 +375,9 @@ class NesInstrumentView : public InstrumentViewFixedSize static QPixmap * s_artwork; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/OpulenZ/OpulenZ.cpp b/plugins/OpulenZ/OpulenZ.cpp index da85e2d0211..6abfb4e19da 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 7b4868b4f64..f2a13ffe0cc 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 @@ class OpulenzInstrument : public Instrument virtual ~OpulenzInstrument(); virtual QString nodeName() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); virtual Flags flags() const { @@ -146,6 +154,9 @@ private slots: }; +namespace gui +{ + class OpulenzInstrumentView : public InstrumentViewFixedSize { @@ -205,4 +216,9 @@ class OpulenzInstrumentView : public InstrumentViewFixedSize }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Organic/Organic.cpp b/plugins/Organic/Organic.cpp index c2a6fcce4f2..3207692002c 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 @@ class OrganicKnob : public Knob - 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 b16b2ef9a9b..b2f5ed51842 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 @@ class OscillatorObject : public Model virtual ~OscillatorObject(); friend class OrganicInstrument; - friend class OrganicInstrumentView; + friend class gui::OrganicInstrumentView; private slots: @@ -163,15 +172,18 @@ public slots: FloatModel m_fx1Model; FloatModel m_volModel; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); private slots: void updateAllDetuning(); - friend class OrganicInstrumentView; + friend class gui::OrganicInstrumentView; } ; +namespace gui +{ + class OrganicInstrumentView : public InstrumentViewFixedSize { @@ -225,4 +237,8 @@ protected slots: }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Patman/Patman.cpp b/plugins/Patman/Patman.cpp index 9268b2919a5..25b055b9c8b 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 6aa6497aa4d..5088068df48 100644 --- a/plugins/Patman/Patman.h +++ b/plugins/Patman/Patman.h @@ -32,7 +32,14 @@ #include "AutomatableModel.h" #include "MemoryManager.h" +namespace lmms +{ + +namespace gui +{ class PixmapButton; +class PatmanView; +} // namespace gui #define MODES_16BIT ( 1 << 0 ) @@ -69,7 +76,7 @@ class PatmanInstrument : public Instrument return( 128 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); public slots: @@ -107,7 +114,7 @@ public slots: void selectSample( NotePlayHandle * _n ); - friend class PatmanView; + friend class gui::PatmanView; signals: void fileChanged( void ); @@ -115,6 +122,9 @@ public slots: } ; +namespace gui +{ + class PatmanView : public InstrumentViewFixedSize { @@ -148,5 +158,8 @@ public slots: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/PeakControllerEffect/PeakControllerEffect.cpp b/plugins/PeakControllerEffect/PeakControllerEffect.cpp index 672e020c407..529437d6ea4 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 4eeddf45d3c..3d944a1a637 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 @@ class PeakControllerEffect : public Effect } ; + +} // namespace lmms + #endif diff --git a/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.cpp b/plugins/PeakControllerEffect/PeakControllerEffectControlDialog.cpp index 044a4c60c80..b0d6fafc655 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 cd6a99d2b37..7211679759e 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 @@ class PeakControllerEffectControlDialog : public EffectControlDialog } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/PeakControllerEffect/PeakControllerEffectControls.cpp b/plugins/PeakControllerEffect/PeakControllerEffectControls.cpp index d19b15d3752..070c9fbb8fd 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 7706784f0bc..278c2f0691e 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 @@ class PeakControllerEffectControls : public EffectControls { return 1; } - EffectControlDialog * createView() override + gui::EffectControlDialog * createView() override { - return new PeakControllerEffectControlDialog( this ); + return new gui::PeakControllerEffectControlDialog( this ); } @@ -69,10 +74,12 @@ class PeakControllerEffectControls : public EffectControls 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 2d56d7f4855..6faea8c9a2b 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 3a7a81e8d36..0cbeba87521 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 @@ class ReverbSCEffect : public Effect friend class ReverbSCControls; } ; + +} // namespace lmms + #endif diff --git a/plugins/ReverbSC/ReverbSCControlDialog.cpp b/plugins/ReverbSC/ReverbSCControlDialog.cpp index 9c5ae7eabea..38b93e23491 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 0d9c1f51a45..ba373509a89 100644 --- a/plugins/ReverbSC/ReverbSCControlDialog.h +++ b/plugins/ReverbSC/ReverbSCControlDialog.h @@ -28,9 +28,15 @@ #include "EffectControlDialog.h" +namespace lmms +{ + class ReverbSCControls; +namespace gui +{ + class ReverbSCControlDialog : public EffectControlDialog { Q_OBJECT @@ -42,4 +48,9 @@ class ReverbSCControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/ReverbSC/ReverbSCControls.cpp b/plugins/ReverbSC/ReverbSCControls.cpp index 11c99f66547..4784d416dfd 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 78423ae8d2b..2bd76990a12 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 @@ class ReverbSCControls : public EffectControls return 4; } - virtual EffectControlDialog* createView() + virtual gui::EffectControlDialog* createView() { - return new ReverbSCControlDialog( this ); + return new gui::ReverbSCControlDialog( this ); } @@ -69,9 +73,12 @@ private slots: 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 f9c414ac0d0..3cba7561f71 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 73b649a2a6b..9f80981df5a 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 @@ protected slots: }; +} // namespace lmms::gui + #endif diff --git a/plugins/Sf2Player/Sf2Player.cpp b/plugins/Sf2Player/Sf2Player.cpp index ee9156a0b41..8b17f0bb0ed 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 aeea1a55372..3824595eacf 100644 --- a/plugins/Sf2Player/Sf2Player.h +++ b/plugins/Sf2Player/Sf2Player.h @@ -36,16 +36,24 @@ #include "LcdSpinBox.h" #include "MemoryManager.h" -class Sf2InstrumentView; +class QLabel; + +namespace lmms +{ + + class Sf2Font; -class Knob; +struct Sf2PluginData; class NotePlayHandle; -class PixmapButton; +namespace gui +{ +class Knob; +class PixmapButton; +class Sf2InstrumentView; class PatchesDialog; -class QLabel; +} // namespace gui -struct Sf2PluginData; class Sf2Instrument : public Instrument { @@ -83,7 +91,7 @@ class Sf2Instrument : public Instrument return IsSingleStreamed; } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); QString getCurrentPatchName(); @@ -133,8 +141,8 @@ public slots: int m_lastMidiPitchRange; int m_channel; - LcdSpinBoxModel m_bankNum; - LcdSpinBoxModel m_patchNum; + gui::LcdSpinBoxModel m_bankNum; + gui::LcdSpinBoxModel m_patchNum; FloatModel m_gain; @@ -159,7 +167,7 @@ public slots: void noteOff( Sf2PluginData * n ); void renderFrames( f_cnt_t frames, sampleFrame * buf ); - friend class Sf2InstrumentView; + friend class gui::Sf2InstrumentView; signals: void fileLoading(); @@ -185,6 +193,9 @@ class Sf2Font }; +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 4302256ba38..2ccadce8d96 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 cdce504308d..ad7dd26a7bc 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 a8ce12efeab..4c14d33bb78 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 @@ class SfxrInstrument : public Instrument virtual QString nodeName() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); void resetModels(); @@ -217,11 +224,14 @@ class SfxrInstrument : public Instrument IntModel m_waveFormModel; - friend class SfxrInstrumentView; + friend class gui::SfxrInstrumentView; friend class SfxrSynth; }; +namespace gui +{ + class SfxrInstrumentView : public InstrumentViewFixedSize { @@ -300,5 +310,8 @@ protected slots: }; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/Sid/SidInstrument.cpp b/plugins/Sid/SidInstrument.cpp index 32b0d7a2411..450d172cfdc 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 5f2fa715780..3a92605b6a4 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 @@ class VoiceObject : public Model BoolModel m_testModel; friend class SidInstrument; - friend class SidInstrumentView; + friend class gui::SidInstrumentView; } ; class SidInstrument : public Instrument @@ -104,7 +111,7 @@ class SidInstrument : public Instrument virtual f_cnt_t desiredReleaseFrames() const; - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); /*public slots: @@ -126,11 +133,14 @@ class SidInstrument : public Instrument IntModel m_chipModel; - friend class SidInstrumentView; + friend class gui::SidInstrumentView; } ; +namespace gui +{ + class SidInstrumentView : public InstrumentViewFixedSize { @@ -200,4 +210,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/SpectrumAnalyzer/Analyzer.cpp b/plugins/SpectrumAnalyzer/Analyzer.cpp index e7b23d7b035..de4ac8c681c 100644 --- a/plugins/SpectrumAnalyzer/Analyzer.cpp +++ b/plugins/SpectrumAnalyzer/Analyzer.cpp @@ -36,6 +36,9 @@ #include "lmms_basics.h" #include "plugin_export.h" +namespace lmms +{ + extern "C" { Plugin::Descriptor PLUGIN_EXPORT analyzer_plugin_descriptor = @@ -116,3 +119,5 @@ extern "C" { } } + +} // namespace lmms diff --git a/plugins/SpectrumAnalyzer/Analyzer.h b/plugins/SpectrumAnalyzer/Analyzer.h index 57a11d30a3e..9013b6745ac 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 @@ class Analyzer : public Effect #endif }; + +} // namespace lmms + #endif // ANALYZER_H diff --git a/plugins/SpectrumAnalyzer/DataprocLauncher.h b/plugins/SpectrumAnalyzer/DataprocLauncher.h index d91e0bedfcc..4325284c9cd 100644 --- a/plugins/SpectrumAnalyzer/DataprocLauncher.h +++ b/plugins/SpectrumAnalyzer/DataprocLauncher.h @@ -30,6 +30,10 @@ #include "SaProcessor.h" #include "LocklessRingBuffer.h" +namespace lmms +{ + + class DataprocLauncher : public QThread { public: @@ -49,4 +53,7 @@ class DataprocLauncher : public QThread LocklessRingBuffer *m_inputBuffer; }; + +} // namespace lmms + #endif // DATAPROCLAUNCHER_H diff --git a/plugins/SpectrumAnalyzer/SaControls.cpp b/plugins/SpectrumAnalyzer/SaControls.cpp index 45490f6b326..1ebfcdca346 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 d75156f7431..70a7559f284 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 @@ class SaControls : public EffectControls explicit SaControls(Analyzer* effect); virtual ~SaControls() {} - EffectControlDialog* createView() override; + gui::EffectControlDialog* createView() override; void saveSettings (QDomDocument& doc, QDomElement& parent) override; void loadSettings (const QDomElement &_this) override; @@ -88,9 +98,13 @@ class SaControls : public EffectControls QColor m_colorGrid; //!< color of grid lines QColor m_colorLabels; //!< color of axis labels - friend class SaControlsDialog; - friend class SaSpectrumView; - friend class SaWaterfallView; + friend class gui::SaControlsDialog; + friend class gui::SaSpectrumView; + friend class gui::SaWaterfallView; friend class SaProcessor; }; + + +} // namespace lmms + #endif // SACONTROLS_H diff --git a/plugins/SpectrumAnalyzer/SaControlsDialog.cpp b/plugins/SpectrumAnalyzer/SaControlsDialog.cpp index 7b6adeb1cbb..e8344ead5e5 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 8cbb0ecaaa4..1504da3dc6d 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 @@ class SaControlsDialog : public EffectControlDialog SaWaterfallView *m_waterfall; }; + +} // namespace lmms::gui + #endif // SACONTROLSDIALOG_H diff --git a/plugins/SpectrumAnalyzer/SaProcessor.cpp b/plugins/SpectrumAnalyzer/SaProcessor.cpp index 8430679889b..02fd3d770f8 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 b331a9c095d..66b79788d26 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 @@ class SaProcessor float m_max_execution; #endif }; + + +} // namespace lmms + #endif // SAPROCESSOR_H diff --git a/plugins/SpectrumAnalyzer/SaSpectrumView.cpp b/plugins/SpectrumAnalyzer/SaSpectrumView.cpp index 1feee5cef4a..8c3d7a82d02 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 70606cc34b1..4ac24cbf0c6 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 slots: float m_draw_avg; #endif }; + + +} // namespace gui + +} // namespace lmms + #endif // SASPECTRUMVIEW_H diff --git a/plugins/SpectrumAnalyzer/SaWaterfallView.cpp b/plugins/SpectrumAnalyzer/SaWaterfallView.cpp index 36fcbf3bc4f..598bad72551 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 b2f81520335..cdfad6ad45e 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 slots: float m_execution_avg; #endif }; + + +} // namespace lmms::gui + #endif // SAWATERFALLVIEW_H diff --git a/plugins/StereoEnhancer/StereoEnhancer.cpp b/plugins/StereoEnhancer/StereoEnhancer.cpp index 6e8661dcb11..bda9c808682 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 4c7ea6ac69a..a3f4a6de4ca 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 @@ class StereoEnhancerEffect : public Effect } ; +} // namespace lmms #endif diff --git a/plugins/StereoEnhancer/StereoEnhancerControlDialog.cpp b/plugins/StereoEnhancer/StereoEnhancerControlDialog.cpp index d86fbc6d7dc..f024ab33fdc 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 3d1d82bae95..62f78d1cdb3 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 @@ class StereoEnhancerControlDialog : public EffectControlDialog }; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/StereoEnhancer/StereoEnhancerControls.cpp b/plugins/StereoEnhancer/StereoEnhancerControls.cpp index a844e74f53b..3cad94f91d5 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 cefed77f9b3..c9a0f6e6166 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 @@ class StereoEnhancerControls : public EffectControls return( 1 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return new StereoEnhancerControlDialog( this ); + return new gui::StereoEnhancerControlDialog( this ); } @@ -65,9 +69,11 @@ private slots: 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 c8a743fe3b5..de15d83701f 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 39ed4a1ad1d..88d265ad2be 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 @@ class StereoMatrixEffect : public Effect virtual bool processAudioBuffer( sampleFrame * _buf, const fpp_t _frames ); - virtual EffectControls * controls() + virtual EffectControls* controls() { return( &m_smControls ); } @@ -51,5 +55,6 @@ class StereoMatrixEffect : public Effect } ; +} // namespace lmms #endif diff --git a/plugins/StereoMatrix/StereoMatrixControlDialog.cpp b/plugins/StereoMatrix/StereoMatrixControlDialog.cpp index 3899219ddfd..5bf62b9ceb4 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 4de00ec707e..fd5cf786a0e 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 @@ class StereoMatrixControlDialog : public EffectControlDialog }; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/StereoMatrix/StereoMatrixControls.cpp b/plugins/StereoMatrix/StereoMatrixControls.cpp index 75f513a6018..e60b02a8dc6 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 3b89d74d271..97f0cf8e167 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 @@ class StereoMatrixControls : public EffectControls return( 1 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return new StereoMatrixControlDialog( this ); + return new gui::StereoMatrixControlDialog( this ); } @@ -69,10 +73,12 @@ private slots: 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 9a4d9ea3a9d..37ab3f6f19d 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 fb35abb738e..51b0bfb43e6 100644 --- a/plugins/Stk/Mallets/Mallets.h +++ b/plugins/Stk/Mallets/Mallets.h @@ -40,10 +40,22 @@ // However in older versions this namespace does not exist, therefore declare it // so this plugin builds with all versions of Stk. namespace stk { } ; + +namespace lmms +{ + + using namespace stk; static const int MALLETS_PRESET_VERSION = 1; + +namespace gui +{ +class MalletsInstrumentView; +} // namespace gui + + class MalletsSynth { public: @@ -160,7 +172,7 @@ class MalletsInstrument : public Instrument virtual QString nodeName() const; - virtual PluginView * instantiateView( QWidget * _parent ); + gui::PluginView* instantiateView( QWidget * _parent ) override; private: @@ -193,10 +205,13 @@ class MalletsInstrument : public Instrument bool m_filesMissing; - friend class MalletsInstrumentView; + friend class gui::MalletsInstrumentView; } ; +namespace gui +{ + class MalletsInstrumentView: public InstrumentViewFixedSize { @@ -242,4 +257,9 @@ public slots: Knob * m_spreadKnob; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/TripleOscillator/TripleOscillator.cpp b/plugins/TripleOscillator/TripleOscillator.cpp index 897b03586a1..2931c3b85db 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 9448344172f..1c8871796a0 100644 --- a/plugins/TripleOscillator/TripleOscillator.h +++ b/plugins/TripleOscillator/TripleOscillator.h @@ -30,13 +30,23 @@ #include "InstrumentView.h" #include "AutomatableModel.h" +namespace lmms +{ + -class automatableButtonGroup; -class Knob; class NotePlayHandle; +class SampleBuffer; class Oscillator; + + +namespace gui +{ +class automatableButtonGroup; +class Knob; class PixmapButton; -class SampleBuffer; +class TripleOscillatorView; +} // namespace gui + const int NUM_OF_OSCILLATORS = 3; @@ -75,7 +85,7 @@ class OscillatorObject : public Model bool m_useWaveTable; friend class TripleOscillator; - friend class TripleOscillatorView; + friend class gui::TripleOscillatorView; private slots: @@ -115,7 +125,7 @@ class TripleOscillator : public Instrument return( 128 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); protected slots: @@ -133,11 +143,14 @@ protected slots: } ; - friend class TripleOscillatorView; + friend class gui::TripleOscillatorView; } ; +namespace gui +{ + class TripleOscillatorView : public InstrumentViewFixedSize { @@ -198,5 +211,8 @@ class TripleOscillatorView : public InstrumentViewFixedSize } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/Vectorscope/VecControls.cpp b/plugins/Vectorscope/VecControls.cpp index ede9c77b25a..cd0f21f61f8 100644 --- a/plugins/Vectorscope/VecControls.cpp +++ b/plugins/Vectorscope/VecControls.cpp @@ -29,6 +29,9 @@ #include "VecControlsDialog.h" #include "Vectorscope.h" +namespace lmms +{ + VecControls::VecControls(Vectorscope *effect) : EffectControls(effect), @@ -48,9 +51,9 @@ VecControls::VecControls(Vectorscope *effect) : // Create the VecControlDialog widget which handles display of GUI elements. -EffectControlDialog* VecControls::createView() +gui::EffectControlDialog* VecControls::createView() { - return new VecControlsDialog(this); + return new gui::VecControlsDialog(this); } @@ -68,3 +71,6 @@ void VecControls::saveSettings(QDomDocument &document, QDomElement &element) m_logarithmicModel.saveSettings(document, element, "Logarithmic"); m_highQualityModel.saveSettings(document, element, "HighQuality"); } + + +} // namespace lmms diff --git a/plugins/Vectorscope/VecControls.h b/plugins/Vectorscope/VecControls.h index 04b688e5a5b..e4aa27b435c 100644 --- a/plugins/Vectorscope/VecControls.h +++ b/plugins/Vectorscope/VecControls.h @@ -29,9 +29,18 @@ #include "EffectControls.h" +namespace lmms +{ + class Vectorscope; +namespace gui +{ +class VecControlsDialog; +class VectorView; +} + // Holds all the configuration values class VecControls : public EffectControls { @@ -40,7 +49,7 @@ class VecControls : public EffectControls explicit VecControls(Vectorscope *effect); virtual ~VecControls() {} - EffectControlDialog *createView() override; + gui::EffectControlDialog* createView() override; void saveSettings (QDomDocument &document, QDomElement &element) override; void loadSettings (const QDomElement &element) override; @@ -60,7 +69,11 @@ class VecControls : public EffectControls QColor m_colorLabels; QColor m_colorOutline; - friend class VecControlsDialog; - friend class VectorView; + friend class gui::VecControlsDialog; + friend class gui::VectorView; }; + + +} // namespace lmms + #endif // VECCONTROLS_H diff --git a/plugins/Vectorscope/VecControlsDialog.cpp b/plugins/Vectorscope/VecControlsDialog.cpp index f5e74088734..72b072823a4 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 b76c06ad001..97108cdf409 100644 --- a/plugins/Vectorscope/VecControlsDialog.h +++ b/plugins/Vectorscope/VecControlsDialog.h @@ -27,8 +27,16 @@ #include "EffectControlDialog.h" +namespace lmms +{ + + class VecControls; +namespace gui +{ + + //! Top-level widget holding the configuration GUI and vector display class VecControlsDialog : public EffectControlDialog { @@ -44,4 +52,9 @@ class VecControlsDialog : public EffectControlDialog VecControls *m_controls; }; + +} // namespace gui + +} // namespace lmms + #endif // VECCONTROLSDIALOG_H diff --git a/plugins/Vectorscope/VectorView.cpp b/plugins/Vectorscope/VectorView.cpp index 93a384891ee..ed57f64a452 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 8e88847ab9b..0aae988db7e 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 slots: float m_executionAvg = 0; #endif }; + + +} // namespace lmms::gui + #endif // VECTORVIEW_H diff --git a/plugins/Vectorscope/Vectorscope.cpp b/plugins/Vectorscope/Vectorscope.cpp index b3c2b2dda6f..df093f6715a 100644 --- a/plugins/Vectorscope/Vectorscope.cpp +++ b/plugins/Vectorscope/Vectorscope.cpp @@ -27,6 +27,9 @@ #include "embed.h" #include "plugin_export.h" +namespace lmms +{ + extern "C" { Plugin::Descriptor PLUGIN_EXPORT vectorscope_plugin_descriptor = @@ -78,3 +81,5 @@ extern "C" { } } + +} // namespace lmms diff --git a/plugins/Vectorscope/Vectorscope.h b/plugins/Vectorscope/Vectorscope.h index b45ff6de4ab..973fecf0e11 100644 --- a/plugins/Vectorscope/Vectorscope.h +++ b/plugins/Vectorscope/Vectorscope.h @@ -28,6 +28,9 @@ #include "LocklessRingBuffer.h" #include "VecControls.h" +namespace lmms +{ + //! Top level class; handles LMMS interface and accumulates data for processing. class Vectorscope : public Effect @@ -48,5 +51,8 @@ class Vectorscope : public Effect LocklessRingBuffer m_inputBuffer; }; + +} // namespace lmms + #endif // VECTORSCOPE_H diff --git a/plugins/Vestige/Vestige.cpp b/plugins/Vestige/Vestige.cpp index cb1902c6628..9088321cc2d 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 @@ class vstSubWin : public SubWindow }; +} // namespace gui + + class VstInstrumentPlugin : public VstPlugin { public: @@ -124,7 +132,7 @@ class VstInstrumentPlugin : public VstPlugin 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 @@ class VstInstrumentPlugin : public VstPlugin }; -QPixmap * VestigeInstrumentView::s_artwork = nullptr; -QPixmap * ManageVestigeInstrumentView::s_artwork = nullptr; - VestigeInstrument::VestigeInstrument( InstrumentTrack * _instrument_track ) : Instrument( _instrument_track, &vestige_plugin_descriptor ), @@ -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 934c2608824..5b7b1461de5 100644 --- a/plugins/Vestige/Vestige.h +++ b/plugins/Vestige/Vestige.h @@ -37,13 +37,22 @@ class QPixmap; class QPushButton; class QScrollArea; +class QGridLayout; + +namespace lmms +{ -class CustomTextKnob; class FloatModel; -class QGridLayout; -class PixmapButton; class VstPlugin; +namespace gui +{ +class PixmapButton; +class CustomTextKnob; +class VestigeInstrumentView; +class ManageVestigeInstrumentView; +} // namespace gui + class VestigeInstrument : public Instrument { @@ -68,10 +77,10 @@ class VestigeInstrument : public Instrument virtual bool handleMidiEvent( const MidiEvent& event, const TimePos& time, f_cnt_t offset = 0 ); - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); protected slots: - void setParameter( Model * action ); + void setParameter( lmms::Model * action ); void handleConfigChange( QString cls, QString attr, QString value ); void reloadPlugin(); @@ -90,12 +99,15 @@ protected slots: int paramCount; - friend class VestigeInstrumentView; - friend class ManageVestigeInstrumentView; + friend class gui::VestigeInstrumentView; + friend class gui::ManageVestigeInstrumentView; } ; +namespace gui +{ + class ManageVestigeInstrumentView : public InstrumentViewFixedSize { Q_OBJECT @@ -107,7 +119,7 @@ class ManageVestigeInstrumentView : public InstrumentViewFixedSize protected slots: void syncPlugin( void ); void displayAutomatedOnly( void ); - void setParameter( Model * action ); + void setParameter( lmms::Model * action ); void syncParameterText(); void closeWindow(); @@ -184,5 +196,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms #endif diff --git a/plugins/Vibed/NineButtonSelector.cpp b/plugins/Vibed/NineButtonSelector.cpp index 618a8e09da3..431dbec8b55 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 96b441031f4..1c318305532 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 @@ public slots: typedef IntModel NineButtonSelectorModel; + +} // namespace lmms::gui + #endif diff --git a/plugins/Vibed/StringContainer.cpp b/plugins/Vibed/StringContainer.cpp index 0ec38c94f3e..36dee6da038 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 503b7c16c77..96408c56a1e 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 @@ class StringContainer QVector m_exists; } ; + +} // namespace lmms + #endif diff --git a/plugins/Vibed/Vibed.cpp b/plugins/Vibed/Vibed.cpp index 0a6f14c2a20..87c42b187a8 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 2fee8eaedb6..f13fd665aed 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 @@ class Vibed : public Instrument QList m_powerButtons; QList m_graphs; QList m_impulses; - QList m_harmonics; + QList m_harmonics; static const int __sampleLength = 128; - friend class VibedView; + friend class gui::VibedView; } ; +namespace gui +{ + class VibedView : public InstrumentViewFixedSize { @@ -136,4 +147,9 @@ protected slots: }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/Vibed/VibratingString.cpp b/plugins/Vibed/VibratingString.cpp index fda5c0c5d04..4a9e740fb38 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 254e2ebd56c..ed7cbe38cce 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 @@ class VibratingString } ; + +} // namespace lmms + #endif diff --git a/plugins/VstBase/RemoteVstPlugin.cpp b/plugins/VstBase/RemoteVstPlugin.cpp index f2199893aa7..7ac0c97e21c 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 61d7346751f..a31cc832c8c 100644 --- a/plugins/VstBase/VstPlugin.cpp +++ b/plugins/VstBase/VstPlugin.cpp @@ -113,6 +113,9 @@ class FileInfo } +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 2317cf3adb2..f73c1c87633 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 @@ class VSTBASE_EXPORT VstPlugin : public RemotePlugin, public JournallingObject QString embedMethod() const; public slots: - void setTempo( bpm_t _bpm ); + void setTempo( lmms::bpm_t _bpm ); void updateSampleRate(); void openPreset( void ); void setProgram( int index ); @@ -173,4 +174,6 @@ public slots: } ; +} // namespace lmms + #endif diff --git a/plugins/VstBase/communication.h b/plugins/VstBase/communication.h index c25b213d18d..1f32dd1354d 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 67217390a33..6885feb970f 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 df5b18eb90d..4fd66dbb506 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 7070ffc2f8e..12b15dc49eb 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 @@ class VstEffect : public Effect friend class VstEffectControls; - friend class VstEffectControlDialog; - friend class ManageVSTEffectView; + friend class gui::VstEffectControlDialog; + friend class gui::ManageVSTEffectView; } ; +} // namespace lmms #endif diff --git a/plugins/VstEffect/VstEffectControlDialog.cpp b/plugins/VstEffect/VstEffectControlDialog.cpp index 4e86cc71db0..ba7d58ffa65 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 dad68ae0418..f54ab750cb1 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 21de98faba7..9def527279d 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 c9bd626cdac..24d5961ae95 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 @@ class VstEffectControls : public EffectControls 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 @@ protected slots: int lastPosInMenu; // QLabel * m_presetLabel; - friend class VstEffectControlDialog; - friend class ManageVSTEffectView; + friend class gui::VstEffectControlDialog; + friend class gui::ManageVSTEffectView; bool m_vstGuiVisible; } ; +namespace gui +{ class ManageVSTEffectView : public QObject @@ -107,7 +119,7 @@ class ManageVSTEffectView : public QObject protected slots: void syncPlugin( void ); void displayAutomatedOnly( void ); - void setParameter( Model * action ); + void setParameter( lmms::Model * action ); void syncParameterText(); void closeWindow(); @@ -132,4 +144,8 @@ protected slots: } ; +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/VstEffect/VstSubPluginFeatures.cpp b/plugins/VstEffect/VstSubPluginFeatures.cpp index b2141cd70f0..d69a53e4e82 100644 --- a/plugins/VstEffect/VstSubPluginFeatures.cpp +++ b/plugins/VstEffect/VstSubPluginFeatures.cpp @@ -30,6 +30,8 @@ #include "VstSubPluginFeatures.h" #include "ConfigManager.h" +namespace lmms +{ VstSubPluginFeatures::VstSubPluginFeatures( Plugin::PluginTypes _type ) : @@ -90,3 +92,5 @@ void VstSubPluginFeatures::addPluginsFromDir( QStringList* filenames, QString pa } } + +} // namespace lmms diff --git a/plugins/VstEffect/VstSubPluginFeatures.h b/plugins/VstEffect/VstSubPluginFeatures.h index 1c6d9cc2a35..d3b9de58c53 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 @@ class VstSubPluginFeatures : public Plugin::Descriptor::SubPluginFeatures } ; - - +} // namespace lmms #endif diff --git a/plugins/Watsyn/Watsyn.cpp b/plugins/Watsyn/Watsyn.cpp index 0be4af29ad6..7978dc12055 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 b957faef716..454329b5749 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 @@ class WatsynInstrument : public Instrument return( 64 ); } - virtual PluginView * instantiateView( QWidget * _parent ); + virtual gui::PluginView* instantiateView( QWidget * _parent ); public slots: void updateVolumes(); @@ -288,10 +296,14 @@ public slots: float B2_wave [WAVELEN]; friend class WatsynObject; - friend class WatsynView; + friend class gui::WatsynView; }; +namespace gui +{ + + class WatsynView : public InstrumentViewFixedSize { Q_OBJECT @@ -376,4 +388,9 @@ protected slots: }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/WaveShaper/WaveShaper.cpp b/plugins/WaveShaper/WaveShaper.cpp index be3e943bc17..ededa2e0fca 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 4763c40b7fb..7364784bba9 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 @@ class WaveShaperEffect : public Effect } ; - +} // namespace lmms #endif diff --git a/plugins/WaveShaper/WaveShaperControlDialog.cpp b/plugins/WaveShaper/WaveShaperControlDialog.cpp index aede7317eb4..e4fae0c92fe 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 be0f1021230..672b55f625e 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 @@ class WaveShaperControlDialog : public EffectControlDialog } ; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/WaveShaper/WaveShaperControls.cpp b/plugins/WaveShaper/WaveShaperControls.cpp index 529cc428995..40e20055af5 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 fa0768afd44..f94bc3d9b03 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 @@ class WaveShaperControls : public EffectControls return( 4 ); } - virtual EffectControlDialog * createView() + virtual gui::EffectControlDialog* createView() { - return( new WaveShaperControlDialog( this ) ); + return( new gui::WaveShaperControlDialog( this ) ); } @@ -78,9 +82,12 @@ private slots: 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 ceb79138ead..ac850bca995 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 1246058caff..4ea46e1bbf5 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 bf543c695d8..a69343e07f7 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 @@ class XpressiveKnob: public Knob { setLineWidth(3); } XpressiveKnob(QWidget * _parent, const QString & _name) : - Knob(knobStyled, _parent,_name) { + Knob(knobStyled, _parent,_name) { setStyle(); } XpressiveKnob(QWidget * _parent) : - Knob(knobStyled, _parent) { + Knob(knobStyled, _parent) { setStyle(); } @@ -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 651660cfe71..d075e908839 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 @@ protected slots: } ; +namespace gui +{ + class XpressiveView : public InstrumentViewFixedSize { @@ -145,7 +156,6 @@ class XpressiveView : public InstrumentViewFixedSize 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 @@ class XpressiveHelpView: public QTextEdit static QString s_helpText; }; + +} // namespace gui + +} // namespace lmms + #endif diff --git a/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp b/plugins/ZynAddSubFx/LocalZynAddSubFx.cpp index ed32339eb74..fd1d2b838d5 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 397fbbe82fe..81da0f9cef8 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 @@ class LocalZynAddSubFx } ; + +} // namespace lmms + #endif diff --git a/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp b/plugins/ZynAddSubFx/RemoteZynAddSubFx.cpp index 0c0c0af3934..2d9a2701ee8 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 edeb424271d..6745cb84634 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 b83f055efdd..27cb4728e30 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 10243e3731e..996c187ee45 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 slots: QMap m_modifiedControllers; - friend class ZynAddSubFxView; + friend class gui::ZynAddSubFxView; signals: @@ -131,22 +137,24 @@ private slots: } ; +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 5a8328bc43c..b9855dbe164 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 9dc2ebec5eb..10775ed5e59 100644 --- a/src/common/RemotePluginBase.cpp +++ b/src/common/RemotePluginBase.cpp @@ -29,6 +29,10 @@ #endif +namespace lmms +{ + + #ifdef SYNC_WITH_SHM_FIFO RemotePluginBase::RemotePluginBase( shmFifo * _in, shmFifo * _out ) : m_in( _in ), @@ -186,3 +190,5 @@ RemotePluginBase::message RemotePluginBase::waitForMessage( return message(); } + +} // namespace lmms diff --git a/src/common/SharedMemory.cpp b/src/common/SharedMemory.cpp index 3c546ac32e8..5c944dfab64 100644 --- a/src/common/SharedMemory.cpp +++ b/src/common/SharedMemory.cpp @@ -44,10 +44,12 @@ # include #endif -namespace detail { + +namespace lmms::detail { #if _POSIX_SHARED_MEMORY_OBJECTS > 0 + namespace { template @@ -198,4 +200,4 @@ SharedMemoryData::SharedMemoryData(SharedMemoryData&& other) noexcept : m_ptr{other.m_ptr} { } -} // namespace detail +} // namespace lmms::detail diff --git a/src/core/AudioEngine.cpp b/src/core/AudioEngine.cpp index eae7c6f2058..827e8b2e422 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 837894c7937..24c4dc5aee9 100644 --- a/src/core/AudioEngineProfiler.cpp +++ b/src/core/AudioEngineProfiler.cpp @@ -24,6 +24,8 @@ #include "AudioEngineProfiler.h" +namespace lmms +{ AudioEngineProfiler::AudioEngineProfiler() : m_periodTimer(), @@ -61,3 +63,4 @@ void AudioEngineProfiler::setOutputFile( const QString& outputFile ) m_outputFile.open( QFile::WriteOnly | QFile::Truncate ); } +} // namespace lmms diff --git a/src/core/AudioEngineWorkerThread.cpp b/src/core/AudioEngineWorkerThread.cpp index 3d45cbccb0b..129b3accf77 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 51733936f94..5463fa48294 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 3009444164c..928cf48a964 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 a2906b0d009..eee4df8d21e 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 0f83badcf63..0f303fe1542 100644 --- a/src/core/BandLimitedWave.cpp +++ b/src/core/BandLimitedWave.cpp @@ -27,6 +27,9 @@ #include +namespace lmms +{ + WaveMipMap BandLimitedWave::s_waveforms[4] = { }; bool BandLimitedWave::s_wavesGenerated = false; QString BandLimitedWave::s_wavetableDir = ""; @@ -270,3 +273,5 @@ moogfile.close(); */ } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/BufferManager.cpp b/src/core/BufferManager.cpp index 248434cf9b4..ff35e6a194e 100644 --- a/src/core/BufferManager.cpp +++ b/src/core/BufferManager.cpp @@ -30,17 +30,20 @@ #include "MemoryManager.h" -static fpp_t framesPerPeriod; +namespace lmms +{ + +fpp_t BufferManager::s_framesPerPeriod; -void BufferManager::init( fpp_t framesPerPeriod ) +void BufferManager::init( fpp_t fpp ) { - ::framesPerPeriod = framesPerPeriod; + 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 f247b967e64..74a168fbdf7 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 c30b657bb57..6e1503b2f4e 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 19d4f576f8c..f1b1c6b2e0f 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 5444ea83439..59987de97aa 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 5cb3218a953..4ff9c4c93ca 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 03b05462982..a6402227f78 100644 --- a/src/core/ControllerConnection.cpp +++ b/src/core/ControllerConnection.cpp @@ -31,6 +31,9 @@ #include "Song.h" #include "ControllerConnection.h" +namespace lmms +{ + ControllerConnectionVector ControllerConnection::s_connections; @@ -233,4 +236,4 @@ void ControllerConnection::deleteConnection() - +} // namespace lmms diff --git a/src/core/DataFile.cpp b/src/core/DataFile.cpp index 8248be8f3cc..da19b4b619e 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,6 +1926,8 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile ) if (root.hasAttribute("creatorversion")) { + using gui::SongEditor; + // compareType defaults to All, so it doesn't have to be set here ProjectVersion createdWith = root.attribute("creatorversion"); ProjectVersion openedWith = LMMS_VERSION; @@ -1926,12 +1936,12 @@ void DataFile::loadData( const QByteArray & _data, const QString & _sourceFile ) if (createdWith.setCompareType(ProjectVersion::Minor) != openedWith.setCompareType(ProjectVersion::Minor) - && getGUI() != nullptr && root.attribute("type") == "song" + && gui::getGUI() != nullptr && root.attribute("type") == "song" ){ auto projectType = _sourceFile.endsWith(".mpt") ? SongEditor::tr("template") : SongEditor::tr("project"); - TextFloat::displayMessage( + gui::TextFloat::displayMessage( SongEditor::tr("Version difference"), SongEditor::tr("This %1 was created with LMMS %2") .arg(projectType).arg(createdWith.getVersion()), @@ -1972,3 +1982,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 d4f9fe16747..2b7ad9d1b0c 100644 --- a/src/core/DrumSynth.cpp +++ b/src/core/DrumSynth.cpp @@ -39,6 +39,9 @@ #define strcasecmp _stricmp #endif +namespace lmms +{ + using namespace std; @@ -741,3 +744,5 @@ int DrumSynth::GetDSFileSamples(QString dsfile, int16_t *&wave, int channels, sa return Length; } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Effect.cpp b/src/core/Effect.cpp index e730db5a57e..78f0937737d 100644 --- a/src/core/Effect.cpp +++ b/src/core/Effect.cpp @@ -32,6 +32,9 @@ #include "ConfigManager.h" +namespace lmms +{ + Effect::Effect( const Plugin::Descriptor * _desc, Model * _parent, @@ -162,9 +165,9 @@ void Effect::checkGate( double _out_sum ) -PluginView * Effect::instantiateView( QWidget * _parent ) +gui::PluginView * Effect::instantiateView( QWidget * _parent ) { - return new EffectView( this, _parent ); + return new gui::EffectView( this, _parent ); } @@ -215,3 +218,4 @@ void Effect::resample( int _i, const sampleFrame * _src_buf, } } +} // namespace lmms diff --git a/src/core/EffectChain.cpp b/src/core/EffectChain.cpp index 7b9b3b2db08..6d16bb19e7b 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 a465901883e..6c810472179 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; +namespace lmms +{ + +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 * LmmsCore::s_lv2Manager = nullptr; +Lv2Manager * Engine::s_lv2Manager = nullptr; #endif -Ladspa2LMMS * LmmsCore::s_ladspaManager = nullptr; -void* LmmsCore::s_dndPluginKey = nullptr; +Ladspa2LMMS * Engine::s_ladspaManager = nullptr; +void* Engine::s_dndPluginKey = nullptr; -void LmmsCore::init( bool renderOnly ) +void Engine::init( bool renderOnly ) { - LmmsCore *engine = inst(); + Engine *engine = inst(); emit engine->initProgress(tr("Generating wavetables")); // generate (load from file) bandlimited wavetables @@ -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 7dc948e3b70..b80b5494683 100644 --- a/src/core/EnvelopeAndLfoParameters.cpp +++ b/src/core/EnvelopeAndLfoParameters.cpp @@ -30,6 +30,9 @@ #include "Oscillator.h" +namespace lmms +{ + // how long should be each envelope-segment maximal (e.g. attack)? extern const float SECS_PER_ENV_SEGMENT = 5.0f; // how long should be one LFO-oscillation maximal? @@ -540,4 +543,4 @@ void EnvelopeAndLfoParameters::updateSampleVars() - +} // namespace lmms diff --git a/src/core/ImportFilter.cpp b/src/core/ImportFilter.cpp index 6f41756a6f1..1caa62e7da4 100644 --- a/src/core/ImportFilter.cpp +++ b/src/core/ImportFilter.cpp @@ -33,6 +33,9 @@ #include "ProjectJournal.h" +namespace lmms +{ + using std::unique_ptr; ImportFilter::ImportFilter( const QString & _file_name, @@ -117,3 +120,4 @@ bool ImportFilter::openFile() +} // namespace lmms \ No newline at end of file diff --git a/src/core/InlineAutomation.cpp b/src/core/InlineAutomation.cpp index 7df6a2d75e8..bbea1becb4f 100644 --- a/src/core/InlineAutomation.cpp +++ b/src/core/InlineAutomation.cpp @@ -27,6 +27,9 @@ #include "InlineAutomation.h" +namespace lmms +{ + void InlineAutomation::saveSettings( QDomDocument & _doc, QDomElement & _parent ) { @@ -58,3 +61,5 @@ void InlineAutomation::loadSettings( const QDomElement & _this ) } } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Instrument.cpp b/src/core/Instrument.cpp index 9b7267c0d00..a7d3f73e85e 100644 --- a/src/core/Instrument.cpp +++ b/src/core/Instrument.cpp @@ -31,6 +31,10 @@ #include "lmms_constants.h" +namespace lmms +{ + + Instrument::Instrument(InstrumentTrack * _instrument_track, const Descriptor * _descriptor, const Descriptor::SubPluginFeatures::Key *key) : @@ -201,3 +205,6 @@ QString Instrument::fullDisplayName() const { return instrumentTrack()->displayName(); } + + +} // namespace lmms diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index 1295ed6d20e..27c9e4f6624 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -31,6 +31,9 @@ #include "InstrumentTrack.h" #include "PresetPreviewPlayHandle.h" +namespace lmms +{ + InstrumentFunctionNoteStacking::ChordTable::Init InstrumentFunctionNoteStacking::ChordTable::s_initTable[] = { @@ -556,3 +559,6 @@ void InstrumentFunctionArpeggio::loadSettings( const QDomElement & _this ) m_arpDirectionModel.loadSettings( _this, "arpdir" ); m_arpModeModel.loadSettings( _this, "arpmode" ); } + + +} // namespace lmms diff --git a/src/core/InstrumentPlayHandle.cpp b/src/core/InstrumentPlayHandle.cpp index 71ac555b35e..8c272cd475e 100644 --- a/src/core/InstrumentPlayHandle.cpp +++ b/src/core/InstrumentPlayHandle.cpp @@ -26,9 +26,16 @@ #include "InstrumentPlayHandle.h" #include "InstrumentTrack.h" +namespace lmms +{ + + InstrumentPlayHandle::InstrumentPlayHandle( Instrument * instrument, InstrumentTrack* instrumentTrack ) : PlayHandle( TypeInstrumentPlayHandle ), m_instrument( instrument ) { setAudioPort( instrumentTrack->audioPort() ); } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/InstrumentSoundShaping.cpp b/src/core/InstrumentSoundShaping.cpp index e3ab82c0e1a..a9765d25671 100644 --- a/src/core/InstrumentSoundShaping.cpp +++ b/src/core/InstrumentSoundShaping.cpp @@ -34,6 +34,9 @@ #include "Instrument.h" #include "InstrumentTrack.h" +namespace lmms +{ + const float CUT_FREQ_MULTIPLIER = 6000.0f; const float RES_MULTIPLIER = 2.0f; @@ -377,4 +380,4 @@ void InstrumentSoundShaping::loadSettings( const QDomElement & _this ) - +} // namespace lmms diff --git a/src/core/JournallingObject.cpp b/src/core/JournallingObject.cpp index 729303c67d7..802f4291ecd 100644 --- a/src/core/JournallingObject.cpp +++ b/src/core/JournallingObject.cpp @@ -29,6 +29,8 @@ #include "ProjectJournal.h" #include "Engine.h" +namespace lmms +{ JournallingObject::JournallingObject() : @@ -140,3 +142,4 @@ void JournallingObject::changeID( jo_id_t _id ) } +} // namespace lmms diff --git a/src/core/Keymap.cpp b/src/core/Keymap.cpp index a50abfaf24d..5dfdd9186f3 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 950e4bf0dd5..e16f5c98c34 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 4d3faeda751..fb6ef91670d 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 851ae007efe..875a4f132f9 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 947fd5e22a3..548da5d7c2a 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 d0bcd8cfd11..4fdf54fc0c2 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 07aaa0c1439..919093906c3 100644 --- a/src/core/LocklessAllocator.cpp +++ b/src/core/LocklessAllocator.cpp @@ -33,6 +33,9 @@ #include #endif +namespace lmms +{ + static const size_t SIZEOF_SET = sizeof( int ) * 8; @@ -162,3 +165,6 @@ void LocklessAllocator::free( void * ptr ) } ++m_available; } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/MemoryHelper.cpp b/src/core/MemoryHelper.cpp index 8ac2700f3c4..de80ef7701d 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 01fdfd5d6e2..bd3168f1487 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 7bf61958dcb..ee5d8bbc8e0 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 ba94f1c9a72..44506481e96 100644 --- a/src/core/MicroTimer.cpp +++ b/src/core/MicroTimer.cpp @@ -1,5 +1,8 @@ #include "MicroTimer.h" +namespace lmms +{ + using namespace std; using namespace std::chrono; @@ -25,3 +28,5 @@ int MicroTimer::elapsed() const auto now = steady_clock::now(); return std::chrono::duration_cast>(now - begin).count(); } + +} // namespace lmms diff --git a/src/core/Microtuner.cpp b/src/core/Microtuner.cpp index b384cf390bd..f8de2126715 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 81610406144..2b2b5952f02 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 bf72c42a4ef..688190ee2dc 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 597d0340d0b..dd277bc4e80 100644 --- a/src/core/Model.cpp +++ b/src/core/Model.cpp @@ -24,6 +24,8 @@ #include "Model.h" +namespace lmms +{ QString Model::fullDisplayName() const { @@ -46,5 +48,5 @@ QString Model::fullDisplayName() const - +} // namespace lmms diff --git a/src/core/ModelVisitor.cpp b/src/core/ModelVisitor.cpp index 4036f56e0a3..17e32858777 100644 --- a/src/core/ModelVisitor.cpp +++ b/src/core/ModelVisitor.cpp @@ -28,6 +28,10 @@ #include "ComboBoxModel.h" #include "TempoSyncKnobModel.h" +namespace lmms +{ + + void ModelVisitor::visit(BoolModel &m) { up(m); } void ModelVisitor::visit(IntModel &m) { up(m); } void ModelVisitor::visit(FloatModel &m) { up(m); } @@ -42,3 +46,6 @@ void ConstModelVisitor::visit(const TempoSyncKnobModel &m) { up(m); ModelVisitor::~ModelVisitor() {} ConstModelVisitor::~ConstModelVisitor() {} + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Note.cpp b/src/core/Note.cpp index cba02ee9e29..b730ec1cce3 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 2a4cf8f12ec..e31299eda0c 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 16b99bb5f6b..2dc7f691009 100644 --- a/src/core/Oscillator.cpp +++ b/src/core/Oscillator.cpp @@ -38,6 +38,9 @@ #include "fft_helpers.h" +namespace lmms +{ + void Oscillator::waveTableInit() { @@ -814,4 +817,4 @@ inline sample_t Oscillator::getSample( } - +} // namespace lmms diff --git a/src/core/PathUtil.cpp b/src/core/PathUtil.cpp index 24d9c8992fb..2999936737d 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 d88ef5224fa..7ea56cd4872 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 c16726777d3..af1b9b3bb0c 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 c46123507bb..b29295604a3 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 951c6d8428c..49056744863 100644 --- a/src/core/PerfLog.cpp +++ b/src/core/PerfLog.cpp @@ -35,6 +35,11 @@ # include #endif + +namespace lmms +{ + + PerfTime::PerfTime() : m_real(-1) { @@ -129,3 +134,6 @@ void PerfLogTimer::end() // Invalidate so destructor won't call print another log entry begin_time = PerfTime(); } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Piano.cpp b/src/core/Piano.cpp index 62680efa775..8cf1917e341 100644 --- a/src/core/Piano.cpp +++ b/src/core/Piano.cpp @@ -41,6 +41,10 @@ #include "InstrumentTrack.h" +namespace lmms +{ + + /*! The black / white order of keys as they appear on the keyboard. */ static const Piano::KeyTypes KEY_ORDER[] = @@ -137,3 +141,5 @@ bool Piano::isWhiteKey( int key ) return !isBlackKey( key ); } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/PlayHandle.cpp b/src/core/PlayHandle.cpp index 1c5f90ef052..168121e0f58 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 7772bffde7c..e71df15b89f 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 879af542cd0..184dc0b9467 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 7d43586f5b6..f8ae06bc71d 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 a0e5da44560..0ce248e9cae 100644 --- a/src/core/PresetPreviewPlayHandle.cpp +++ b/src/core/PresetPreviewPlayHandle.cpp @@ -35,6 +35,9 @@ #include +namespace lmms +{ + // invisible track-container which is needed as parent for preview-channels class PreviewTrackContainer : public TrackContainer { @@ -274,4 +277,4 @@ bool PresetPreviewPlayHandle::isPreviewing() } - +} // namespace lmms diff --git a/src/core/ProjectJournal.cpp b/src/core/ProjectJournal.cpp index 3d1e9078a21..2a59a2724cb 100644 --- a/src/core/ProjectJournal.cpp +++ b/src/core/ProjectJournal.cpp @@ -29,6 +29,9 @@ #include "JournallingObject.h" #include "Song.h" +namespace lmms +{ + //! Avoid clashes between loaded IDs (have the bit cleared) //! and newly created IDs (have the bit set) static const int EO_ID_MSB = 1 << 23; @@ -206,3 +209,4 @@ void ProjectJournal::stopAllJournalling() +} // namespace lmms diff --git a/src/core/ProjectRenderer.cpp b/src/core/ProjectRenderer.cpp index 323fdd6c96a..bb5020c9bd6 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 6f3dcddbeb1..b6ee2843f94 100644 --- a/src/core/ProjectVersion.cpp +++ b/src/core/ProjectVersion.cpp @@ -28,6 +28,8 @@ #include "ProjectVersion.h" +namespace lmms +{ ProjectVersion::ProjectVersion(QString version, CompareType c) : @@ -135,3 +137,6 @@ int ProjectVersion::compare(ProjectVersion v1, ProjectVersion v2) { return compare(v1, v2, std::min(v1.getCompareType(), v2.getCompareType())); } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/RemotePlugin.cpp b/src/core/RemotePlugin.cpp index a70ce0a313e..ff18fde538b 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 a0de888f4ba..e2f6b9311cc 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 3fe1feeb7e8..b2e40f3c0ad 100644 --- a/src/core/RingBuffer.cpp +++ b/src/core/RingBuffer.cpp @@ -28,6 +28,9 @@ #include "Engine.h" #include "MixHelpers.h" +namespace lmms +{ + RingBuffer::RingBuffer( f_cnt_t size ) : m_fpp( Engine::audioEngine()->framesPerPeriod() ), @@ -314,3 +317,4 @@ void RingBuffer::updateSamplerate() } +} // namespace lmms diff --git a/src/core/SampleBuffer.cpp b/src/core/SampleBuffer.cpp index e09dd5198a3..b931b27b5a9 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 46bb6e6b70c..9ee8e93e458 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 f82f5dbf462..77658e1d896 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 cc0ce163517..76d71c9f337 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 394377e2831..762da4ff88b 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 bc79eb92082..9487ebef558 100644 --- a/src/core/SerializingObject.cpp +++ b/src/core/SerializingObject.cpp @@ -26,7 +26,8 @@ #include "SerializingObject.h" - +namespace lmms +{ SerializingObject::SerializingObject() : m_hook( nullptr ) @@ -110,4 +111,4 @@ void SerializingObject::loadSettings( const QDomElement& element ) Q_UNUSED(element) } - +} // namespace lmms diff --git a/src/core/Song.cpp b/src/core/Song.cpp index c52a1fa6fbe..d26eab45052 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 29675d5b2d1..e8f31f6449a 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 a85ca2e9ff8..bc7c86db956 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 4a22a1eb999..f3b09474dad 100644 --- a/src/core/TimePos.cpp +++ b/src/core/TimePos.cpp @@ -27,6 +27,9 @@ #include "MeterModel.h" +namespace lmms +{ + TimeSig::TimeSig( int num, int denom ) : m_num(num), m_denom(denom) @@ -216,3 +219,6 @@ double TimePos::ticksToMilliseconds(double ticks, bpm_t beatsPerMinute) // 60 * 1000 / 48 = 1250 return ( ticks * 1250 ) / beatsPerMinute; } + + +} // namespace lmms \ No newline at end of file diff --git a/src/core/ToolPlugin.cpp b/src/core/ToolPlugin.cpp index 6c2b0fed77a..99c3e5bec5f 100644 --- a/src/core/ToolPlugin.cpp +++ b/src/core/ToolPlugin.cpp @@ -26,6 +26,10 @@ #include "ToolPlugin.h" +namespace lmms +{ + + ToolPlugin::ToolPlugin( const Descriptor * _descriptor, Model * _parent ) : Plugin( _descriptor, _parent ) { @@ -56,3 +60,5 @@ ToolPlugin * ToolPlugin::instantiate( const QString & _plugin_name, Model * _par return nullptr; } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/Track.cpp b/src/core/Track.cpp index d3418ea3324..1bb1b8e8b88 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 6c52b41afc3..ce8fdd4005d 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 687bd3c1569..09aee65bdfc 100644 --- a/src/core/ValueBuffer.cpp +++ b/src/core/ValueBuffer.cpp @@ -2,6 +2,10 @@ #include "interpolation.h" +namespace lmms +{ + + ValueBuffer::ValueBuffer() {} @@ -41,3 +45,6 @@ void ValueBuffer::interpolate(float start, float end_) return linearInterpolate( start, end_, i++ / length()); }); } + + +} // namespace lmms diff --git a/src/core/VstSyncController.cpp b/src/core/VstSyncController.cpp index efe295d7a74..1699905c67a 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 1cea301b91e..0cf95f895c7 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 145e6b471b4..5fb58a1b0bc 100644 --- a/src/core/audio/AudioDevice.cpp +++ b/src/core/audio/AudioDevice.cpp @@ -29,7 +29,8 @@ #include "ConfigManager.h" #include "debug.h" - +namespace lmms +{ AudioDevice::AudioDevice( const ch_cnt_t _channels, AudioEngine* _audioEngine ) : m_supportsCapture( false ), @@ -267,3 +268,4 @@ bool AudioDevice::hqAudio() const } +} // namespace lmms \ No newline at end of file diff --git a/src/core/audio/AudioFileDevice.cpp b/src/core/audio/AudioFileDevice.cpp index e7d78bc3611..f80d4a00f91 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 aa6d8e21400..4e40257cd7f 100644 --- a/src/core/audio/AudioFileFlac.cpp +++ b/src/core/audio/AudioFileFlac.cpp @@ -31,6 +31,9 @@ #include "endian_handling.h" #include "AudioEngine.h" +namespace lmms +{ + AudioFileFlac::AudioFileFlac(OutputSettings const& outputSettings, ch_cnt_t const channels, bool& successful, QString const& file, AudioEngine* audioEngine): AudioFileDevice(outputSettings,channels,file,audioEngine), m_sf(nullptr) @@ -124,3 +127,5 @@ void AudioFileFlac::finishEncoding() sf_close(m_sf); } } + +} // namespace lmms \ No newline at end of file diff --git a/src/core/audio/AudioFileMP3.cpp b/src/core/audio/AudioFileMP3.cpp index 088cd6edab1..75084460f37 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 d9aa8b4f08e..1f40f456e02 100644 --- a/src/core/audio/AudioFileOgg.cpp +++ b/src/core/audio/AudioFileOgg.cpp @@ -38,6 +38,8 @@ #include "AudioEngine.h" +namespace lmms +{ AudioFileOgg::AudioFileOgg( OutputSettings const & outputSettings, const ch_cnt_t channels, @@ -268,6 +270,8 @@ void AudioFileOgg::finishEncoding() } +} // namespace lmms + #endif diff --git a/src/core/audio/AudioFileWave.cpp b/src/core/audio/AudioFileWave.cpp index 1fce2fe4852..6f1a425b906 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 6bc039a5007..f0e606f4783 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 76df85adc43..76f10a61eac 100644 --- a/src/core/audio/AudioOss.cpp +++ b/src/core/audio/AudioOss.cpp @@ -57,6 +57,8 @@ #include "ConfigManager.h" +namespace lmms +{ static const QString PATH_DEV_DSP = #if defined(__NetBSD__) || defined(__OpenBSD__) @@ -325,13 +327,13 @@ AudioOss::setupWidget::setupWidget( QWidget * _parent ) : dev_lbl->setFont( pointSize<7>( dev_lbl->font() ) ); dev_lbl->setGeometry( 10, 40, 160, 10 ); - LcdSpinBoxModel * m = new LcdSpinBoxModel( /* this */ ); + gui::LcdSpinBoxModel * m = new gui::LcdSpinBoxModel( /* this */ ); m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS ); m->setStep( 2 ); m->setValue( ConfigManager::inst()->value( "audiooss", "channels" ).toInt() ); - m_channels = new LcdSpinBox( 1, this ); + m_channels = new gui::LcdSpinBox( 1, this ); m_channels->setModel( m ); m_channels->setLabel( tr( "Channels" ) ); m_channels->move( 180, 20 ); @@ -358,5 +360,7 @@ void AudioOss::setupWidget::saveSettings() } +} // namespace lmms + #endif diff --git a/src/core/audio/AudioPort.cpp b/src/core/audio/AudioPort.cpp index b83e6b418eb..4bbf509d8c3 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 1bc137dac66..cc1e611c91c 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 5f82b64dc86..40c955434ab 100644 --- a/src/core/audio/AudioPulseAudio.cpp +++ b/src/core/audio/AudioPulseAudio.cpp @@ -35,6 +35,8 @@ #include "gui_templates.h" #include "Engine.h" +namespace lmms +{ static void stream_write_callback(pa_stream *s, size_t length, void *userdata) { @@ -317,13 +319,13 @@ AudioPulseAudio::setupWidget::setupWidget( QWidget * _parent ) : dev_lbl->setFont( pointSize<7>( dev_lbl->font() ) ); dev_lbl->setGeometry( 10, 40, 160, 10 ); - LcdSpinBoxModel * m = new LcdSpinBoxModel( /* this */ ); + gui::LcdSpinBoxModel * m = new gui::LcdSpinBoxModel( /* this */ ); m->setRange( DEFAULT_CHANNELS, SURROUND_CHANNELS ); m->setStep( 2 ); m->setValue( ConfigManager::inst()->value( "audiopa", "channels" ).toInt() ); - m_channels = new LcdSpinBox( 1, this ); + m_channels = new gui::LcdSpinBox( 1, this ); m_channels->setModel( m ); m_channels->setLabel( tr( "Channels" ) ); m_channels->move( 180, 20 ); @@ -349,6 +351,7 @@ void AudioPulseAudio::setupWidget::saveSettings() QString::number( m_channels->value() ) ); } +} // namespace lmms #endif diff --git a/src/core/audio/AudioSampleRecorder.cpp b/src/core/audio/AudioSampleRecorder.cpp index a33308c99c7..358a9b89736 100644 --- a/src/core/audio/AudioSampleRecorder.cpp +++ b/src/core/audio/AudioSampleRecorder.cpp @@ -29,6 +29,9 @@ #include "debug.h" +namespace lmms +{ + AudioSampleRecorder::AudioSampleRecorder( const ch_cnt_t _channels, bool & _success_ful, @@ -111,4 +114,4 @@ void AudioSampleRecorder::writeBuffer( const surroundSampleFrame * _ab, } - +} // namespace lmms diff --git a/src/core/audio/AudioSdl.cpp b/src/core/audio/AudioSdl.cpp index d62678b49db..cb622a9410a 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 114e01460b6..52ff1666e5c 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 c8ef045428e..c56d23dc342 100644 --- a/src/core/audio/AudioSoundIo.cpp +++ b/src/core/audio/AudioSoundIo.cpp @@ -36,6 +36,9 @@ #include "ComboBox.h" #include "AudioEngine.h" +namespace lmms +{ + AudioSoundIo::AudioSoundIo( bool & outSuccessful, AudioEngine * _audioEngine ) : AudioDevice( qBound( DEFAULT_CHANNELS, @@ -519,4 +522,7 @@ void AudioSoundIo::setupWidget::saveSettings() ConfigManager::inst()->setValue( "audiosoundio", "out_device_raw", configDeviceRaw); } + +} // namespace lmms + #endif diff --git a/src/core/base64.cpp b/src/core/base64.cpp index c04300dcf25..b1c26b610ba 100644 --- a/src/core/base64.cpp +++ b/src/core/base64.cpp @@ -28,7 +28,7 @@ #include #include -namespace base64 +namespace lmms::base64 { @@ -54,5 +54,4 @@ QVariant decode( const QString & _b64, QVariant::Type _force_type ) } -} ; - +} // namespace lmms::base64 diff --git a/src/core/fft_helpers.cpp b/src/core/fft_helpers.cpp index 9e49c554403..63088f655b9 100644 --- a/src/core/fft_helpers.cpp +++ b/src/core/fft_helpers.cpp @@ -29,6 +29,10 @@ #include #include "lmms_constants.h" +namespace lmms +{ + + /* Returns biggest value from abs_spectrum[spec_size] array. * * return -1 on error, otherwise the maximum value @@ -212,3 +216,6 @@ int compressbands(const float *absspec_buffer, float *compressedband, int num_ol return 0; } + + +} // namespace lmms diff --git a/src/core/lv2/Lv2Basics.cpp b/src/core/lv2/Lv2Basics.cpp index b6be53a2cf6..ab5db6ef106 100644 --- a/src/core/lv2/Lv2Basics.cpp +++ b/src/core/lv2/Lv2Basics.cpp @@ -26,6 +26,9 @@ #ifdef LMMS_HAVE_LV2 +namespace lmms +{ + QString qStringFromPluginNode(const LilvPlugin* plug, LilvNode* (*getFunc)(const LilvPlugin*)) { @@ -45,5 +48,7 @@ std::string stdStringFromPortName(const LilvPlugin* plug, const LilvPort* port) lilv_node_as_string(AutoLilvNode(lilv_port_get_name(plug, port)).get())); } +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2ControlBase.cpp b/src/core/lv2/Lv2ControlBase.cpp index 3c8ccbf8a2d..6fb5900ead5 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 0c908181571..2d2ad0517e7 100644 --- a/src/core/lv2/Lv2Evbuf.cpp +++ b/src/core/lv2/Lv2Evbuf.cpp @@ -36,6 +36,10 @@ #include +namespace lmms +{ + + struct LV2_Evbuf_Impl { uint32_t capacity; uint32_t atom_Chunk; @@ -190,4 +194,7 @@ lv2_evbuf_write(LV2_Evbuf_Iterator* iter, return true; } + +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2Features.cpp b/src/core/lv2/Lv2Features.cpp index 74d2415b0f6..60c1b43249a 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 09870a90b8e..1622d4c1b2d 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 e941165f090..36281ee6345 100644 --- a/src/core/lv2/Lv2Options.cpp +++ b/src/core/lv2/Lv2Options.cpp @@ -29,6 +29,10 @@ #include +namespace lmms +{ + + std::set Lv2Options::s_supportedOptions; @@ -90,4 +94,6 @@ void Lv2Options::initOption(LV2_URID key, uint32_t size, LV2_URID type, } +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2Ports.cpp b/src/core/lv2/Lv2Ports.cpp index 4db7f3e2a5a..9e7a9e80cfa 100644 --- a/src/core/lv2/Lv2Ports.cpp +++ b/src/core/lv2/Lv2Ports.cpp @@ -35,7 +35,9 @@ #include "Lv2Manager.h" #include "Lv2Evbuf.h" -namespace Lv2Ports { + +namespace lmms::Lv2Ports +{ @@ -359,7 +361,7 @@ Visitor::~Visitor() {} -} // namespace Lv2Ports +} // namespace lmms::Lv2Ports #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2Proc.cpp b/src/core/lv2/Lv2Proc.cpp index 59f84befe0f..20987b32fe4 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 8fb908cb17b..ce950c6bad6 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 3392f9bd2f7..746878afb96 100644 --- a/src/core/lv2/Lv2UridCache.cpp +++ b/src/core/lv2/Lv2UridCache.cpp @@ -39,6 +39,10 @@ #define LV2_BUF_SIZE__nominalBlockLength LV2_BUF_SIZE_PREFIX "nominalBlockLength" #endif +namespace lmms +{ + + uint32_t Lv2UridCache::operator[](Lv2UridCache::Id id) const { Q_ASSERT(id != Id::size); @@ -67,6 +71,9 @@ Lv2UridCache::Lv2UridCache(UridMap &mapper) for(uint32_t urid : m_cache) { Q_ASSERT(urid != noIdYet); } } + +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/lv2/Lv2UridMap.cpp b/src/core/lv2/Lv2UridMap.cpp index 7e4fa864f1e..4709f4898ff 100644 --- a/src/core/lv2/Lv2UridMap.cpp +++ b/src/core/lv2/Lv2UridMap.cpp @@ -27,6 +27,10 @@ #ifdef LMMS_HAVE_LV2 +namespace lmms +{ + + static LV2_URID staticMap(LV2_URID_Map_Handle handle, const char* uri) { UridMap* map = static_cast(handle); @@ -95,5 +99,8 @@ const char *UridMap::unmap(LV2_URID urid) return (idx < m_unMap.size()) ? m_unMap[idx] : nullptr; } + +} // namespace lmms + #endif // LMMS_HAVE_LV2 diff --git a/src/core/main.cpp b/src/core/main.cpp index 953995b673b..5d454dd9b04 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 883d31e96a8..04ef5c1ced1 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 b0496484354..41904812c3b 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 66a996d0fec..01836c50b3e 100644 --- a/src/core/midi/MidiApple.cpp +++ b/src/core/midi/MidiApple.cpp @@ -36,6 +36,11 @@ #include + +namespace lmms +{ + + const unsigned int SYSEX_LENGTH=1024; MidiApple::MidiApple() : @@ -625,6 +630,6 @@ char * MidiApple::getFullName(MIDIEndpointRef &endpoint_ref) } -#endif - +} // namespace lmms +#endif // LMMS_BUILD_APPLE diff --git a/src/core/midi/MidiClient.cpp b/src/core/midi/MidiClient.cpp index 109e01fd60c..def5561707a 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 91d0dd782fa..61c85104e5e 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 98f0541d032..6ef302c309b 100644 --- a/src/core/midi/MidiEventToByteSeq.cpp +++ b/src/core/midi/MidiEventToByteSeq.cpp @@ -29,6 +29,10 @@ #include "MidiEvent.h" +namespace lmms +{ + + std::size_t writeToByteSeq( const MidiEvent& ev, uint8_t *data, std::size_t bufsize) { @@ -105,3 +109,5 @@ std::size_t writeToByteSeq( return size; } + +} // namespace lmms diff --git a/src/core/midi/MidiJack.cpp b/src/core/midi/MidiJack.cpp index fdf19488963..1ad4da09deb 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 faf6453a2a8..848bac705ee 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 40460f4340d..9b3f4630477 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 4acd2827eaa..d09803e8609 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 80ebea964de..811e0842cee 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 5b40bd2040a..053bb556d1e 100644 --- a/src/gui/ActionGroup.cpp +++ b/src/gui/ActionGroup.cpp @@ -24,6 +24,9 @@ #include "ActionGroup.h" +namespace lmms::gui +{ + ActionGroup::ActionGroup(QObject* parent) : QActionGroup(parent) { connect(this, SIGNAL(triggered(QAction*)), this, SLOT(actionTriggered_(QAction*))); @@ -53,3 +56,5 @@ void ActionGroup::actionTriggered_(QAction* action) emit triggered(actions().indexOf(action)); } + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/AudioAlsaSetupWidget.cpp b/src/gui/AudioAlsaSetupWidget.cpp index 26da660dae9..f6e91f8e34b 100644 --- a/src/gui/AudioAlsaSetupWidget.cpp +++ b/src/gui/AudioAlsaSetupWidget.cpp @@ -33,6 +33,8 @@ #include "LcdSpinBox.h" #include "gui_templates.h" +namespace lmms::gui +{ AudioAlsaSetupWidget::AudioAlsaSetupWidget( QWidget * _parent ) : AudioDeviceSetupWidget( AudioAlsa::name(), _parent ), @@ -116,4 +118,6 @@ void AudioAlsaSetupWidget::onCurrentIndexChanged(int index) } +} // namespace lmms::gui + #endif diff --git a/src/gui/AudioDeviceSetupWidget.cpp b/src/gui/AudioDeviceSetupWidget.cpp index feba3f1b0fb..ae559404c72 100644 --- a/src/gui/AudioDeviceSetupWidget.cpp +++ b/src/gui/AudioDeviceSetupWidget.cpp @@ -24,6 +24,8 @@ #include "AudioDeviceSetupWidget.h" +namespace lmms::gui +{ AudioDeviceSetupWidget::AudioDeviceSetupWidget(const QString & caption, QWidget * parent) : TabWidget(TabWidget::tr("Settings for %1").arg(tr(caption.toUtf8())), parent) @@ -39,3 +41,5 @@ void AudioDeviceSetupWidget::show() parentWidget()->show(); QWidget::show(); } + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/AutomatableModelView.cpp b/src/gui/AutomatableModelView.cpp index 082022d35fd..7ef527cae2b 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 0885c3c449e..356d608e38a 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 f854ab1b94e..be7d5dbef6d 100644 --- a/src/gui/ControllerDialog.cpp +++ b/src/gui/ControllerDialog.cpp @@ -28,6 +28,9 @@ #include "ControllerDialog.h" #include "Controller.h" +namespace lmms::gui +{ + ControllerDialog::ControllerDialog( Controller * _controller, QWidget * _parent ) : @@ -52,4 +55,4 @@ void ControllerDialog::closeEvent( QCloseEvent * _ce ) - +} // namespace lmms::gui diff --git a/src/gui/ControllerRackView.cpp b/src/gui/ControllerRackView.cpp index 2b597e1c21e..9549b6e0dc8 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 a3b1a793415..7e046b4f29b 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 246b087342d..fa28c695f87 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 d7d5b4054a3..a134435facf 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 f6bac18e2de..27600056e93 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 11d95cb2e4e..f9028363128 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 a67dc52eeba..7f212b10ae3 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 0829bfd809d..a016aaea53d 100644 --- a/src/gui/GuiApplication.cpp +++ b/src/gui/GuiApplication.cpp @@ -51,18 +51,28 @@ #include #endif -GuiApplication* GuiApplication::s_instance = nullptr; +namespace lmms +{ -GuiApplication* GuiApplication::instance() + +namespace gui { - return s_instance; -} GuiApplication* getGUI() { return GuiApplication::instance(); } + +GuiApplication* GuiApplication::s_instance = nullptr; + +GuiApplication* GuiApplication::instance() +{ + return s_instance; +} + + + GuiApplication::GuiApplication() { // prompt the user to create the LMMS working directory (e.g. ~/Documents/lmms) if it doesn't exist @@ -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 9b539ff2189..a82f2e33ecb 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 672e22ed57e..84a3451d8ed 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 8cac826ebe0..80b08f384e1 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 e0b356d7a25..769405d3e7f 100644 --- a/src/gui/LmmsPalette.cpp +++ b/src/gui/LmmsPalette.cpp @@ -28,6 +28,9 @@ #include "LmmsPalette.h" +namespace lmms::gui +{ + LmmsPalette::LmmsPalette( QWidget * parent, QStyle * stylearg ) : QWidget( parent ), @@ -90,4 +93,4 @@ QPalette LmmsPalette::palette() const } - +} // namespace lmms::gui diff --git a/src/gui/LmmsStyle.cpp b/src/gui/LmmsStyle.cpp index 2882b9572b6..ee62e613dc1 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 1ae12beed38..7f7a069596d 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 64aeb73a583..a08df0f0927 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 2bb1ae59907..bc917f53c33 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 307369a19e6..dc0ef4a37dd 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 f7bf98e8127..ac9e4524455 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 7298eb558dc..fed63f5bb57 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 6c0cc5bc3e8..bf63a903559 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 15a24721f44..0a24b32ccb3 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 055f0846dcf..4ccdffd7251 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 923467d7ea8..62307fc7db1 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 649d6bb5681..2fd1374daca 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 428720ee959..9a218c571be 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 9830354beb2..cef8b87ea6e 100644 --- a/src/gui/RowTableView.cpp +++ b/src/gui/RowTableView.cpp @@ -29,6 +29,10 @@ #include +namespace lmms::gui +{ + + class RowDelegate : public QStyledItemDelegate { public: @@ -135,5 +139,4 @@ void RowTableView::keyPressEvent( QKeyEvent * event ) } - - +} // namespace lmms::gui diff --git a/src/gui/SampleTrackWindow.cpp b/src/gui/SampleTrackWindow.cpp index 0ef22a01d92..1aee880825a 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 6772f62898c..cd1996c4564 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 92b7d888465..4c6f6abd129 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 ab827f8d155..600ed245c60 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 6aa5da170ca..e9eef0b88fc 100644 --- a/src/gui/StringPairDrag.cpp +++ b/src/gui/StringPairDrag.cpp @@ -35,6 +35,10 @@ #include "Clipboard.h" +namespace lmms::gui +{ + + StringPairDrag::StringPairDrag( const QString & _key, const QString & _value, const QPixmap & _icon, QWidget * _w ) : QDrag( _w ) @@ -111,3 +115,6 @@ QString StringPairDrag::decodeValue( QDropEvent * _de ) { return Clipboard::decodeValue( _de->mimeData() ); } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/SubWindow.cpp b/src/gui/SubWindow.cpp index df3fe004761..add61467021 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 a85a7ff6d34..de553519c23 100644 --- a/src/gui/ToolPluginView.cpp +++ b/src/gui/ToolPluginView.cpp @@ -32,6 +32,9 @@ #include "GuiApplication.h" #include "MainWindow.h" +namespace lmms::gui +{ + ToolPluginView::ToolPluginView( ToolPlugin * _toolPlugin ) : PluginView( _toolPlugin, nullptr ) @@ -44,3 +47,4 @@ ToolPluginView::ToolPluginView( ToolPlugin * _toolPlugin ) : } +} // namespace lmms::gui diff --git a/src/gui/clips/AutomationClipView.cpp b/src/gui/clips/AutomationClipView.cpp index f11885893d4..b87e7e09755 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 1e154f155a9..12603b2e758 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 987d1fe148b..355363a018e 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 f865f778bfe..3884b3eb6f3 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 80b0e6ef2f3..d2fe7cbaa97 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 998af4be8d2..8f8cdd57074 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 f9ab600bfaf..19f64a65cc9 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 818c454f617..86a116dd298 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 bafede41516..fd1cd0480ab 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 c91a82abeed..e340a1c8cb8 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 b0bd5cc06ce..c1ef329f09d 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 c70705aaf75..9c028feba49 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 679901b0e30..ffb45aa5394 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 f5159d6409e..b7aa6d94f46 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 04034074ec8..6c85cf1a3b2 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 6ce4b5bd725..d934adcde64 100644 --- a/src/gui/embed.cpp +++ b/src/gui/embed.cpp @@ -28,7 +28,7 @@ #include #include "embed.h" -namespace embed +namespace lmms::embed { QPixmap getIconPixmap(const QString& pixmapName, @@ -86,6 +86,4 @@ QString getText( const char * name ) } -} - - +} // namespace lmms::embed diff --git a/src/gui/instrument/EnvelopeAndLfoView.cpp b/src/gui/instrument/EnvelopeAndLfoView.cpp index 3ca55c9a8d9..cff230e38c8 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 c10b7d349f0..639e9e7c30f 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 c85ee75be5d..f42208b5175 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 5fcd4dc41fa..be79db7882c 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 47dc389aaa7..dd5c14a093d 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 6c4acbfa1f1..a457acec85b 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 eaa49df10cd..06f37fedad2 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 78962d93817..fa5594c68d6 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 1cdb43f687b..328efebd144 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 dc7b3bd2b4f..bbbf79e86c0 100644 --- a/src/gui/menus/RecentProjectsMenu.cpp +++ b/src/gui/menus/RecentProjectsMenu.cpp @@ -10,6 +10,10 @@ #include "GuiApplication.h" #include "MainWindow.h" +namespace lmms::gui +{ + + RecentProjectsMenu::RecentProjectsMenu(QWidget *parent) : QMenu(tr( "&Recently Opened Projects" ), parent) { @@ -76,3 +80,6 @@ void RecentProjectsMenu::openProject(QAction * _action ) mainWindow->setCursor( Qt::ArrowCursor ); } } + + +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/menus/TemplatesMenu.cpp b/src/gui/menus/TemplatesMenu.cpp index 9f89e3a9f05..1a1ef7c843a 100644 --- a/src/gui/menus/TemplatesMenu.cpp +++ b/src/gui/menus/TemplatesMenu.cpp @@ -8,6 +8,11 @@ #include "GuiApplication.h" #include "MainWindow.h" + +namespace lmms::gui +{ + + TemplatesMenu::TemplatesMenu(QWidget *parent) : QMenu(tr("New from template"), parent) { @@ -67,3 +72,6 @@ void TemplatesMenu::addTemplatesFromDir( const QDir& dir ) { #endif } } + + +} // namespace lmms::gui diff --git a/src/gui/modals/AboutDialog.cpp b/src/gui/modals/AboutDialog.cpp index e3f016b5eb8..6c6b435eb8b 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 b25aa97be6c..d178debe5e3 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 cab90a53ff3..008acbdb5e3 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 @@ public slots: +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 b4bd3af4ae7..22f0948278b 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 f8e7734862a..b0433e66cef 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 151d252376a..fc9113b3f49 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 79f1ca5e036..321397f1970 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 cb427b2c0d4..76ae9d6bbbc 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 035912a4789..33cecedad14 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 1bdea502a36..06a576ea9f7 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 ec44ba93740..60f00679ba0 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 c40569c2181..d4b75cbf11a 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 b581449568b..b7a2fda614d 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 7571cd1db18..41195f5dbca 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 a73724911b1..9897b3309e6 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 36bbd4096fa..03e7487a6c0 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 3388fe9fb9c..6f3d1372741 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 4b56282a6cb..c529b26e8e2 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 b68af31417f..dab827ff934 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 888af3c5f8b..61d598f6ed6 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 80d127877b6..29af4af8630 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 f44732de143..b7af54b3284 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 4cc6bca9fe5..01c36994e94 100644 --- a/src/gui/widgets/CPULoadWidget.cpp +++ b/src/gui/widgets/CPULoadWidget.cpp @@ -32,6 +32,10 @@ #include "Engine.h" +namespace lmms::gui +{ + + CPULoadWidget::CPULoadWidget( QWidget * _parent ) : QWidget( _parent ), m_currentLoad( 0 ), @@ -102,7 +106,4 @@ void CPULoadWidget::updateCpuLoad() } - - - - +} // namespace lmms::gui \ No newline at end of file diff --git a/src/gui/widgets/CaptionMenu.cpp b/src/gui/widgets/CaptionMenu.cpp index bfd743d0db0..032ee10b989 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 181256b9695..ab6b29b9de8 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 149b3494be6..9f6e19b90d5 100644 --- a/src/gui/widgets/CustomTextKnob.cpp +++ b/src/gui/widgets/CustomTextKnob.cpp @@ -1,5 +1,9 @@ #include "CustomTextKnob.h" +namespace lmms::gui +{ + + CustomTextKnob::CustomTextKnob( knobTypes _knob_num, QWidget * _parent, const QString & _name, const QString & _value_text ) : Knob( _knob_num, _parent, _name ), m_value_text( _value_text ) {} @@ -12,3 +16,6 @@ QString CustomTextKnob::displayValue() const { return m_description.trimmed() + m_value_text; } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/Fader.cpp b/src/gui/widgets/Fader.cpp index f569aa550c3..d063464a688 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 71e8375eec4..ed0355a4c3e 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 b8378d54f70..b5187de2572 100644 --- a/src/gui/widgets/GroupBox.cpp +++ b/src/gui/widgets/GroupBox.cpp @@ -34,6 +34,9 @@ #include "gui_templates.h" +namespace lmms::gui +{ + GroupBox::GroupBox( const QString & _caption, QWidget * _parent ) : QWidget( _parent ), @@ -101,3 +104,6 @@ void GroupBox::paintEvent( QPaintEvent * pe ) p.setFont( pointSize<8>( font() ) ); p.drawText( 22, m_titleBarHeight, m_caption ); } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/Knob.cpp b/src/gui/widgets/Knob.cpp index 96ef6fec846..f6a1163a73d 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 22b4d550974..4112c567b79 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 ef0d08aaeea..7dd7fa8e8c2 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 c947f772027..a21536bf7e4 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 832d7da46fd..f31d03b2c43 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 a76b4ec6d3f..30f7106d312 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 deeeb0599d3..f60f6bd0653 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 bdf8ac8f98b..06eb823c01c 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 41832138bda..4fbcc0d6563 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 30296b80554..cd028f63770 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 9bedfe1b5f1..938322b51a8 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 30822c85f1c..007f781941c 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 07889c331f5..8899625fc8d 100644 --- a/src/gui/widgets/TabWidget.cpp +++ b/src/gui/widgets/TabWidget.cpp @@ -35,6 +35,9 @@ #include "embed.h" #include "gui_templates.h" +namespace lmms::gui +{ + TabWidget::TabWidget(const QString & caption, QWidget * parent, bool usePixmap, bool resizable) : QWidget( parent ), @@ -415,3 +418,6 @@ void TabWidget::setTabBorder( const QColor & c ) { m_tabBorder = c; } + + +} // namespace lmms::gui diff --git a/src/gui/widgets/TempoSyncKnob.cpp b/src/gui/widgets/TempoSyncKnob.cpp index bb4faea26f9..47da424d4bc 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 5a93b55c6e7..a43c91c80c2 100644 --- a/src/gui/widgets/TextFloat.cpp +++ b/src/gui/widgets/TextFloat.cpp @@ -31,6 +31,9 @@ #include "GuiApplication.h" #include "MainWindow.h" +namespace lmms::gui +{ + TextFloat::TextFloat() : QWidget( getGUI()->mainWindow(), Qt::ToolTip ), @@ -199,4 +202,4 @@ void TextFloat::updateSize() - +} // namespace lmms::gui diff --git a/src/gui/widgets/TimeDisplayWidget.cpp b/src/gui/widgets/TimeDisplayWidget.cpp index bde9e7dfe83..c2cd11b1b99 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 6dea411d899..4feb038f02d 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 65d34b884d0..d7e7f33c1f1 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 2aadfcab2db..000318d7b33 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 7a5fb657d71..ef693ba5b47 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 243c9d3af74..df7766c57cd 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 b1fd4c406d1..caed047396a 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 d5b0260db99..5504cc588d9 100755 --- a/tests/check-strings/check-strings +++ b/tests/check-strings/check-strings @@ -91,6 +91,21 @@ for c in sorted(classes_found): caption('themes') + +GUI_NAMESPACE_PREFIX = "lmms--gui" + + +def unscope_classname(stylesheet, cname): + # Strip the namespace part from the given class name, + # while expecting it to have one in the first place. + SCOPE_TOKEN = "--" + i = cname.rfind(SCOPE_TOKEN) + len(SCOPE_TOKEN) + + assert i>=0 + + return cname[i:] + + for theme in sorted([d for d in Path('data/themes').iterdir() if d.is_dir()]): classes_in_sheet = set() stylesheet = theme / 'style.css' @@ -101,7 +116,10 @@ for theme in sorted([d for d in Path('data/themes').iterdir() if d.is_dir()]): for c in rule.prelude: if c.type == 'ident' and not class_found: if is_our_class(c.value): - classes_in_sheet.add(c.value) + if str(c.value).startswith(GUI_NAMESPACE_PREFIX): + classes_in_sheet.add(unscope_classname(stylesheet, c.value)) + else: + error(str(stylesheet), f"Namespace prefix missing from class {c.value}") class_found = True # After whitespace or comma comes a new class elif c.type == 'whitespace' or (c.type == 'literal' and c.value == ','): diff --git a/tests/main.cpp b/tests/main.cpp index b2c21b79ab8..6d375e6c657 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -9,7 +9,7 @@ int main(int argc, char* argv[]) { new QCoreApplication(argc, argv); - Engine::init(true); + lmms::Engine::init(true); int numsuites = QTestSuite::suites().size(); qDebug() << ">> Will run" << numsuites << "test suites"; diff --git a/tests/src/core/AutomatableModelTest.cpp b/tests/src/core/AutomatableModelTest.cpp index d84d89db4a6..78b9069b5e8 100644 --- a/tests/src/core/AutomatableModelTest.cpp +++ b/tests/src/core/AutomatableModelTest.cpp @@ -43,6 +43,8 @@ private slots: // tests //! but no downcast or any other casts void CastTests() { + using namespace lmms; + ComboBoxModel comboModel; AutomatableModel* amPtr = &comboModel; QVERIFY(nullptr == amPtr->dynamicCast()); // not a parent class @@ -60,6 +62,8 @@ private slots: // tests void LinkTests() { + using namespace lmms; + BoolModel m1(false), m2(false); QObject::connect(&m1, SIGNAL(dataChanged()), diff --git a/tests/src/core/ProjectVersionTest.cpp b/tests/src/core/ProjectVersionTest.cpp index e52088f6f8c..2d066dca543 100644 --- a/tests/src/core/ProjectVersionTest.cpp +++ b/tests/src/core/ProjectVersionTest.cpp @@ -32,6 +32,8 @@ class ProjectVersionTest : QTestSuite private slots: void ProjectVersionComparisonTests() { + using namespace lmms; + QVERIFY(ProjectVersion("1.1.0", ProjectVersion::Minor) > "1.0.3"); QVERIFY(ProjectVersion("1.1.0", ProjectVersion::Major) < "2.1.0"); QVERIFY(ProjectVersion("1.1.0", ProjectVersion::Release) > "0.2.1"); diff --git a/tests/src/core/RelativePathsTest.cpp b/tests/src/core/RelativePathsTest.cpp index 3f1712e1b5a..3b5d023d041 100644 --- a/tests/src/core/RelativePathsTest.cpp +++ b/tests/src/core/RelativePathsTest.cpp @@ -36,6 +36,8 @@ class RelativePathsTest : QTestSuite private slots: void PathUtilComparisonTests() { + using namespace lmms; + QFileInfo fi(ConfigManager::inst()->factorySamplesDir() + "/drums/kick01.ogg"); QVERIFY(fi.exists()); diff --git a/tests/src/tracks/AutomationTrackTest.cpp b/tests/src/tracks/AutomationTrackTest.cpp index 5adafbb0fc4..2bf8759920b 100644 --- a/tests/src/tracks/AutomationTrackTest.cpp +++ b/tests/src/tracks/AutomationTrackTest.cpp @@ -49,6 +49,8 @@ private slots: void testClipLinear() { + using namespace lmms; + AutomationClip c(nullptr); c.setProgressionType(AutomationClip::LinearProgression); c.putValue(0, 0.0, false); @@ -64,6 +66,8 @@ private slots: void testClipDiscrete() { + using namespace lmms; + AutomationClip c(nullptr); c.setProgressionType(AutomationClip::DiscreteProgression); c.putValue(0, 0.0, false); @@ -77,6 +81,8 @@ private slots: void testClips() { + using namespace lmms; + FloatModel model; auto song = Engine::getSong(); @@ -111,6 +117,8 @@ private slots: void testLengthRespected() { + using namespace lmms; + FloatModel model; auto song = Engine::getSong(); @@ -136,6 +144,8 @@ private slots: void testInlineAutomation() { + using namespace lmms; + auto song = Engine::getSong(); InstrumentTrack* instrumentTrack = @@ -160,6 +170,8 @@ private slots: void testPatternTrack() { + using namespace lmms; + auto song = Engine::getSong(); auto patternStore = Engine::patternStore(); PatternTrack patternTrack(song); @@ -197,6 +209,8 @@ private slots: void testGlobalAutomation() { + using namespace lmms; + // Global automation should not have priority, see https://github.com/LMMS/lmms/issues/4268 // Tests regression caused by 75077f6200a5aee3a5821aae48a3b8466ed8714a auto song = Engine::getSong();