summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--muse2/CMakeLists.txt11
-rw-r--r--muse2/COPYING10
-rw-r--r--muse2/ChangeLog38
-rw-r--r--muse2/README.effects-rack11
-rw-r--r--muse2/al/CMakeLists.txt11
-rw-r--r--muse2/al/al.cpp8
-rw-r--r--muse2/al/al.h8
-rw-r--r--muse2/al/dsp.cpp10
-rw-r--r--muse2/al/dsp.h8
-rw-r--r--muse2/al/dspSSE.cpp6
-rw-r--r--muse2/al/dspXMM.cpp6
-rw-r--r--muse2/al/sig.cpp10
-rw-r--r--muse2/al/sig.h8
-rw-r--r--muse2/al/xml.cpp8
-rw-r--r--muse2/al/xml.h8
-rw-r--r--muse2/all.h17
-rw-r--r--muse2/awl/CMakeLists.txt11
-rw-r--r--muse2/awl/aslider.cpp8
-rw-r--r--muse2/awl/aslider.h8
-rw-r--r--muse2/awl/awl.cpp8
-rw-r--r--muse2/awl/awl.h8
-rw-r--r--muse2/awl/awlplugin.cpp8
-rw-r--r--muse2/awl/awlplugin.h8
-rw-r--r--muse2/awl/checkbox.cpp8
-rw-r--r--muse2/awl/checkbox.h8
-rw-r--r--muse2/awl/combobox.cpp8
-rw-r--r--muse2/awl/combobox.h8
-rw-r--r--muse2/awl/drawbar.cpp8
-rw-r--r--muse2/awl/drawbar.h8
-rw-r--r--muse2/awl/floatentry.cpp8
-rw-r--r--muse2/awl/floatentry.h8
-rw-r--r--muse2/awl/knob.cpp8
-rw-r--r--muse2/awl/knob.h8
-rw-r--r--muse2/awl/ltest.cpp22
-rw-r--r--muse2/awl/midimeter.cpp8
-rw-r--r--muse2/awl/midimeter.h8
-rw-r--r--muse2/awl/midimslider.cpp8
-rw-r--r--muse2/awl/midimslider.h8
-rw-r--r--muse2/awl/midipanentry.cpp8
-rw-r--r--muse2/awl/midipanentry.h8
-rw-r--r--muse2/awl/midipanknob.cpp8
-rw-r--r--muse2/awl/midipanknob.h8
-rw-r--r--muse2/awl/midivolentry.cpp8
-rw-r--r--muse2/awl/midivolentry.h8
-rw-r--r--muse2/awl/mslider.cpp8
-rw-r--r--muse2/awl/mslider.h8
-rw-r--r--muse2/awl/panentry.cpp8
-rw-r--r--muse2/awl/panentry.h8
-rw-r--r--muse2/awl/panknob.cpp8
-rw-r--r--muse2/awl/panknob.h8
-rw-r--r--muse2/awl/pitchedit.cpp8
-rw-r--r--muse2/awl/pitchedit.h8
-rw-r--r--muse2/awl/pitchlabel.cpp8
-rw-r--r--muse2/awl/pitchlabel.h8
-rw-r--r--muse2/awl/posedit.cpp8
-rw-r--r--muse2/awl/posedit.h8
-rw-r--r--muse2/awl/poslabel.cpp8
-rw-r--r--muse2/awl/poslabel.h8
-rw-r--r--muse2/awl/sigedit.cpp8
-rw-r--r--muse2/awl/sigedit.h8
-rw-r--r--muse2/awl/slider.cpp8
-rw-r--r--muse2/awl/slider.h8
-rw-r--r--muse2/awl/tcanvas.cpp8
-rw-r--r--muse2/awl/tcanvas.h8
-rw-r--r--muse2/awl/tempoedit.cpp8
-rw-r--r--muse2/awl/tempoedit.h8
-rw-r--r--muse2/awl/tempolabel.cpp8
-rw-r--r--muse2/awl/tempolabel.h8
-rw-r--r--muse2/awl/utils.cpp8
-rw-r--r--muse2/awl/utils.h8
-rw-r--r--muse2/awl/volentry.cpp8
-rw-r--r--muse2/awl/volentry.h8
-rw-r--r--muse2/awl/volknob.cpp8
-rw-r--r--muse2/awl/volknob.h8
-rw-r--r--muse2/awl/volslider.cpp8
-rw-r--r--muse2/awl/volslider.h8
-rwxr-xr-xmuse2/compile_muse.sh22
-rw-r--r--muse2/config.h.in6
-rw-r--r--muse2/demos/CMakeLists.txt11
-rw-r--r--muse2/grepmidi/CMakeLists.txt11
-rw-r--r--muse2/grepmidi/grepmidi.cpp15
-rw-r--r--muse2/man/CMakeLists.txt11
-rw-r--r--muse2/muse/CMakeLists.txt11
-rw-r--r--muse2/muse/app.cpp484
-rw-r--r--muse2/muse/app.h50
-rw-r--r--muse2/muse/appearance.cpp50
-rw-r--r--muse2/muse/appearance.h26
-rw-r--r--muse2/muse/arranger/CMakeLists.txt11
-rw-r--r--muse2/muse/arranger/alayout.cpp15
-rw-r--r--muse2/muse/arranger/alayout.h15
-rw-r--r--muse2/muse/arranger/arranger.cpp71
-rw-r--r--muse2/muse/arranger/arranger.h53
-rw-r--r--muse2/muse/arranger/arrangerview.cpp16
-rw-r--r--muse2/muse/arranger/arrangerview.h6
-rw-r--r--muse2/muse/arranger/pcanvas.cpp256
-rw-r--r--muse2/muse/arranger/pcanvas.h45
-rw-r--r--muse2/muse/arranger/tlist.cpp68
-rw-r--r--muse2/muse/arranger/tlist.h26
-rw-r--r--muse2/muse/arranger/trackautomationview.cpp22
-rw-r--r--muse2/muse/arranger/trackautomationview.h22
-rw-r--r--muse2/muse/audio.cpp632
-rw-r--r--muse2/muse/audio.h33
-rw-r--r--muse2/muse/audioconvert.cpp48
-rw-r--r--muse2/muse/audioconvert.h15
-rw-r--r--muse2/muse/audioprefetch.cpp29
-rw-r--r--muse2/muse/audioprefetch.h15
-rw-r--r--muse2/muse/audiotrack.cpp96
-rw-r--r--muse2/muse/cleftypes.h15
-rw-r--r--muse2/muse/cliplist/CMakeLists.txt11
-rw-r--r--muse2/muse/cliplist/cliplist.cpp21
-rw-r--r--muse2/muse/cliplist/cliplist.h15
-rw-r--r--muse2/muse/cobject.cpp22
-rw-r--r--muse2/muse/cobject.h15
-rw-r--r--muse2/muse/conf.cpp726
-rw-r--r--muse2/muse/conf.h15
-rw-r--r--muse2/muse/confmport.cpp56
-rw-r--r--muse2/muse/confmport.h22
-rw-r--r--muse2/muse/controlfifo.cpp8
-rw-r--r--muse2/muse/controlfifo.h10
-rw-r--r--muse2/muse/ctrl.cpp38
-rw-r--r--muse2/muse/ctrl.h19
-rw-r--r--muse2/muse/ctrl/CMakeLists.txt11
-rw-r--r--muse2/muse/ctrl/ctrlcanvas.cpp69
-rw-r--r--muse2/muse/ctrl/ctrlcanvas.h19
-rw-r--r--muse2/muse/ctrl/ctrledit.cpp19
-rw-r--r--muse2/muse/ctrl/ctrledit.h15
-rw-r--r--muse2/muse/ctrl/ctrlpanel.cpp49
-rw-r--r--muse2/muse/ctrl/ctrlpanel.h24
-rw-r--r--muse2/muse/debug.h16
-rw-r--r--muse2/muse/default_click.h2
-rw-r--r--muse2/muse/device.h15
-rw-r--r--muse2/muse/dialogs.cpp44
-rw-r--r--muse2/muse/dialogs.h47
-rw-r--r--muse2/muse/driver/CMakeLists.txt11
-rw-r--r--muse2/muse/driver/alsamidi.cpp392
-rw-r--r--muse2/muse/driver/alsamidi.h35
-rw-r--r--muse2/muse/driver/alsatimer.cpp15
-rw-r--r--muse2/muse/driver/alsatimer.h15
-rw-r--r--muse2/muse/driver/audiodev.h15
-rw-r--r--muse2/muse/driver/dummyaudio.cpp77
-rw-r--r--muse2/muse/driver/jack.cpp137
-rw-r--r--muse2/muse/driver/jackaudio.h20
-rw-r--r--muse2/muse/driver/jackmidi.cpp898
-rw-r--r--muse2/muse/driver/jackmidi.h104
-rw-r--r--muse2/muse/driver/rtctimer.cpp25
-rw-r--r--muse2/muse/driver/rtctimer.h17
-rw-r--r--muse2/muse/driver/timerdev.h15
-rw-r--r--muse2/muse/dssihost.cpp102
-rw-r--r--muse2/muse/dssihost.h10
-rw-r--r--muse2/muse/evdata.h15
-rw-r--r--muse2/muse/event.cpp15
-rw-r--r--muse2/muse/event.h15
-rw-r--r--muse2/muse/eventbase.h15
-rw-r--r--muse2/muse/eventlist.cpp15
-rw-r--r--muse2/muse/exportmidi.cpp32
-rw-r--r--muse2/muse/fastlog.h22
-rw-r--r--muse2/muse/functions.cpp26
-rw-r--r--muse2/muse/functions.h15
-rw-r--r--muse2/muse/gconfig.cpp18
-rw-r--r--muse2/muse/gconfig.h19
-rw-r--r--muse2/muse/globaldefs.h15
-rw-r--r--muse2/muse/globals.cpp21
-rw-r--r--muse2/muse/globals.h28
-rw-r--r--muse2/muse/gui.h13
-rw-r--r--muse2/muse/help.cpp21
-rw-r--r--muse2/muse/helper.cpp20
-rw-r--r--muse2/muse/helper.h15
-rw-r--r--muse2/muse/icons.cpp15
-rw-r--r--muse2/muse/icons.h15
-rw-r--r--muse2/muse/importmidi.cpp34
-rw-r--r--muse2/muse/instruments/CMakeLists.txt11
-rw-r--r--muse2/muse/instruments/editinstrument.cpp73
-rw-r--r--muse2/muse/instruments/editinstrument.h15
-rw-r--r--muse2/muse/instruments/midictrledit.cpp15
-rw-r--r--muse2/muse/instruments/midictrledit.h15
-rw-r--r--muse2/muse/instruments/minstrument.cpp49
-rw-r--r--muse2/muse/instruments/minstrument.h26
-rw-r--r--muse2/muse/key.cpp15
-rw-r--r--muse2/muse/key.h15
-rw-r--r--muse2/muse/keyevent.cpp15
-rw-r--r--muse2/muse/keyevent.h15
-rw-r--r--muse2/muse/liste/CMakeLists.txt11
-rw-r--r--muse2/muse/liste/editevent.cpp29
-rw-r--r--muse2/muse/liste/editevent.h26
-rw-r--r--muse2/muse/liste/listedit.cpp27
-rw-r--r--muse2/muse/liste/listedit.h15
-rw-r--r--muse2/muse/main.cpp205
-rw-r--r--muse2/muse/marker/CMakeLists.txt11
-rw-r--r--muse2/muse/marker/marker.cpp15
-rw-r--r--muse2/muse/marker/marker.h15
-rw-r--r--muse2/muse/marker/markerview.cpp23
-rw-r--r--muse2/muse/marker/markerview.h15
-rw-r--r--muse2/muse/master/CMakeLists.txt11
-rw-r--r--muse2/muse/master/lmaster.cpp29
-rw-r--r--muse2/muse/master/lmaster.h15
-rw-r--r--muse2/muse/master/master.cpp29
-rw-r--r--muse2/muse/master/master.h19
-rw-r--r--muse2/muse/master/masteredit.cpp57
-rw-r--r--muse2/muse/master/masteredit.h50
-rw-r--r--muse2/muse/master/tscale.cpp23
-rw-r--r--muse2/muse/master/tscale.h17
-rw-r--r--muse2/muse/memory.cpp15
-rw-r--r--muse2/muse/memory.h15
-rw-r--r--muse2/muse/midi.cpp803
-rw-r--r--muse2/muse/midi.h17
-rw-r--r--muse2/muse/midictrl.cpp17
-rw-r--r--muse2/muse/midictrl.h15
-rw-r--r--muse2/muse/mididev.cpp62
-rw-r--r--muse2/muse/mididev.h37
-rw-r--r--muse2/muse/midiedit/CMakeLists.txt11
-rw-r--r--muse2/muse/midiedit/cmd.h15
-rw-r--r--muse2/muse/midiedit/dcanvas.cpp99
-rw-r--r--muse2/muse/midiedit/dcanvas.h41
-rw-r--r--muse2/muse/midiedit/dlist.cpp21
-rw-r--r--muse2/muse/midiedit/dlist.h17
-rw-r--r--muse2/muse/midiedit/drumedit.cpp103
-rw-r--r--muse2/muse/midiedit/drumedit.h39
-rw-r--r--muse2/muse/midiedit/drummap.cpp15
-rw-r--r--muse2/muse/midiedit/drummap.h15
-rw-r--r--muse2/muse/midiedit/ecanvas.cpp49
-rw-r--r--muse2/muse/midiedit/ecanvas.h23
-rw-r--r--muse2/muse/midiedit/piano.cpp17
-rw-r--r--muse2/muse/midiedit/piano.h17
-rw-r--r--muse2/muse/midiedit/pianoroll.cpp103
-rw-r--r--muse2/muse/midiedit/pianoroll.h40
-rw-r--r--muse2/muse/midiedit/prcanvas.cpp89
-rw-r--r--muse2/muse/midiedit/prcanvas.h43
-rw-r--r--muse2/muse/midiedit/scoreedit.cpp251
-rw-r--r--muse2/muse/midiedit/scoreedit.h26
-rw-r--r--muse2/muse/midieditor.cpp23
-rw-r--r--muse2/muse/midieditor.h28
-rw-r--r--muse2/muse/midievent.cpp15
-rw-r--r--muse2/muse/midievent.h15
-rw-r--r--muse2/muse/midifile.cpp23
-rw-r--r--muse2/muse/midifile.h15
-rw-r--r--muse2/muse/midiport.cpp33
-rw-r--r--muse2/muse/midiport.h15
-rw-r--r--muse2/muse/midiseq.cpp135
-rw-r--r--muse2/muse/midiseq.h23
-rw-r--r--muse2/muse/miditransform.cpp17
-rw-r--r--muse2/muse/miditransform.h15
-rw-r--r--muse2/muse/mixer/CMakeLists.txt13
-rw-r--r--muse2/muse/mixer/amixer.cpp22
-rw-r--r--muse2/muse/mixer/amixer.h21
-rw-r--r--muse2/muse/mixer/astrip.cpp166
-rw-r--r--muse2/muse/mixer/astrip.h38
-rw-r--r--muse2/muse/mixer/auxknob.cpp24
-rw-r--r--muse2/muse/mixer/auxknob.h19
-rw-r--r--muse2/muse/mixer/mstrip.cpp73
-rw-r--r--muse2/muse/mixer/mstrip.h42
-rw-r--r--muse2/muse/mixer/panknob.cpp31
-rw-r--r--muse2/muse/mixer/panknob.h15
-rw-r--r--muse2/muse/mixer/rack.cpp143
-rw-r--r--muse2/muse/mixer/rack.h17
-rw-r--r--muse2/muse/mixer/routedialog.cpp17
-rw-r--r--muse2/muse/mixer/routedialog.h15
-rw-r--r--muse2/muse/mixer/strip.cpp39
-rw-r--r--muse2/muse/mixer/strip.h24
-rw-r--r--muse2/muse/mpevent.cpp15
-rw-r--r--muse2/muse/mpevent.h19
-rw-r--r--muse2/muse/mplugins/CMakeLists.txt11
-rw-r--r--muse2/muse/mplugins/midifilter.ui10
-rw-r--r--muse2/muse/mplugins/midifilterimpl.cpp93
-rw-r--r--muse2/muse/mplugins/midifilterimpl.h27
-rw-r--r--muse2/muse/mplugins/midiitransform.cpp21
-rw-r--r--muse2/muse/mplugins/midiitransform.h15
-rw-r--r--muse2/muse/mplugins/mitplugin.cpp37
-rw-r--r--muse2/muse/mplugins/mitplugin.h15
-rw-r--r--muse2/muse/mplugins/mittranspose.cpp17
-rw-r--r--muse2/muse/mplugins/mittranspose.h15
-rw-r--r--muse2/muse/mplugins/mrconfig.cpp39
-rw-r--r--muse2/muse/mplugins/mrconfig.h15
-rw-r--r--muse2/muse/mplugins/random.cpp15
-rw-r--r--muse2/muse/mplugins/random.h15
-rw-r--r--muse2/muse/mplugins/rhythm.cpp15
-rw-r--r--muse2/muse/mplugins/rhythm.h15
-rw-r--r--muse2/muse/mtc.cpp15
-rw-r--r--muse2/muse/mtc.h15
-rw-r--r--muse2/muse/node.cpp93
-rw-r--r--muse2/muse/node.h15
-rw-r--r--muse2/muse/osc.cpp14
-rw-r--r--muse2/muse/osc.h8
-rw-r--r--muse2/muse/part.cpp17
-rw-r--r--muse2/muse/part.h15
-rw-r--r--muse2/muse/plugin.cpp255
-rw-r--r--muse2/muse/plugin.h22
-rw-r--r--muse2/muse/pos.cpp19
-rw-r--r--muse2/muse/pos.h15
-rw-r--r--muse2/muse/remote/CMakeLists.txt11
-rw-r--r--muse2/muse/remote/pyapi.cpp15
-rw-r--r--muse2/muse/remote/pyapi.h15
-rw-r--r--muse2/muse/route.cpp29
-rw-r--r--muse2/muse/route.h15
-rw-r--r--muse2/muse/seqmsg.cpp43
-rw-r--r--muse2/muse/shortcuts.cpp31
-rw-r--r--muse2/muse/shortcuts.h33
-rw-r--r--muse2/muse/sig.cpp17
-rw-r--r--muse2/muse/sig.h15
-rw-r--r--muse2/muse/song.cpp244
-rw-r--r--muse2/muse/song.h15
-rw-r--r--muse2/muse/songfile.cpp221
-rw-r--r--muse2/muse/steprec.cpp21
-rw-r--r--muse2/muse/steprec.h15
-rw-r--r--muse2/muse/stringparam.cpp8
-rw-r--r--muse2/muse/stringparam.h10
-rw-r--r--muse2/muse/structure.cpp16
-rw-r--r--muse2/muse/sync.cpp95
-rw-r--r--muse2/muse/sync.h15
-rw-r--r--muse2/muse/synth.cpp85
-rw-r--r--muse2/muse/synth.h24
-rw-r--r--muse2/muse/tempo.cpp61
-rw-r--r--muse2/muse/tempo.h15
-rw-r--r--muse2/muse/thread.cpp35
-rw-r--r--muse2/muse/thread.h15
-rw-r--r--muse2/muse/ticksynth.cpp19
-rw-r--r--muse2/muse/ticksynth.h15
-rw-r--r--muse2/muse/track.cpp17
-rw-r--r--muse2/muse/track.h15
-rw-r--r--muse2/muse/transport.cpp57
-rw-r--r--muse2/muse/transport.h22
-rw-r--r--muse2/muse/undo.cpp21
-rw-r--r--muse2/muse/undo.h15
-rw-r--r--muse2/muse/value.cpp15
-rw-r--r--muse2/muse/value.h15
-rw-r--r--muse2/muse/vst.cpp15
-rw-r--r--muse2/muse/vst.h15
-rw-r--r--muse2/muse/wave.cpp42
-rw-r--r--muse2/muse/wave.h15
-rw-r--r--muse2/muse/waveedit/CMakeLists.txt11
-rw-r--r--muse2/muse/waveedit/editgain.cpp30
-rw-r--r--muse2/muse/waveedit/editgain.h30
-rw-r--r--muse2/muse/waveedit/waveedit.cpp47
-rw-r--r--muse2/muse/waveedit/waveedit.h24
-rw-r--r--muse2/muse/waveedit/waveview.cpp25
-rw-r--r--muse2/muse/waveedit/waveview.h17
-rw-r--r--muse2/muse/waveevent.cpp23
-rw-r--r--muse2/muse/waveevent.h15
-rw-r--r--muse2/muse/wavetrack.cpp33
-rw-r--r--muse2/muse/widgets/CMakeLists.txt13
-rw-r--r--muse2/muse/widgets/aboutbox_impl.cpp26
-rw-r--r--muse2/muse/widgets/aboutbox_impl.h26
-rw-r--r--muse2/muse/widgets/action.h18
-rw-r--r--muse2/muse/widgets/bigtime.cpp35
-rw-r--r--muse2/muse/widgets/bigtime.h30
-rw-r--r--muse2/muse/widgets/canvas.cpp19
-rw-r--r--muse2/muse/widgets/canvas.h20
-rw-r--r--muse2/muse/widgets/checkbox.cpp19
-rw-r--r--muse2/muse/widgets/checkbox.h18
-rw-r--r--muse2/muse/widgets/citem.cpp18
-rw-r--r--muse2/muse/widgets/citem.h19
-rw-r--r--muse2/muse/widgets/comboQuant.cpp18
-rw-r--r--muse2/muse/widgets/comboQuant.h19
-rw-r--r--muse2/muse/widgets/combobox.cpp18
-rw-r--r--muse2/muse/widgets/combobox.h19
-rw-r--r--muse2/muse/widgets/comment.cpp18
-rw-r--r--muse2/muse/widgets/comment.h19
-rw-r--r--muse2/muse/widgets/ctrlcombo.cpp18
-rw-r--r--muse2/muse/widgets/ctrlcombo.h18
-rw-r--r--muse2/muse/widgets/dentry.cpp18
-rw-r--r--muse2/muse/widgets/dentry.h20
-rw-r--r--muse2/muse/widgets/didyouknow.h10
-rw-r--r--muse2/muse/widgets/dimap.cpp35
-rw-r--r--muse2/muse/widgets/dimap.h23
-rw-r--r--muse2/muse/widgets/doublelabel.cpp19
-rw-r--r--muse2/muse/widgets/doublelabel.h19
-rw-r--r--muse2/muse/widgets/drange.cpp34
-rw-r--r--muse2/muse/widgets/drange.h23
-rw-r--r--muse2/muse/widgets/editnotedialogbase.ui4
-rw-r--r--muse2/muse/widgets/filedialog.cpp32
-rw-r--r--muse2/muse/widgets/filedialog.h18
-rw-r--r--muse2/muse/widgets/function_dialogs/CMakeLists.txt11
-rw-r--r--muse2/muse/widgets/function_dialogs/crescendo.cpp19
-rw-r--r--muse2/muse/widgets/function_dialogs/crescendo.h19
-rw-r--r--muse2/muse/widgets/function_dialogs/deloverlaps.cpp18
-rw-r--r--muse2/muse/widgets/function_dialogs/deloverlaps.h19
-rw-r--r--muse2/muse/widgets/function_dialogs/gatetime.cpp19
-rw-r--r--muse2/muse/widgets/function_dialogs/gatetime.h19
-rw-r--r--muse2/muse/widgets/function_dialogs/legato.cpp19
-rw-r--r--muse2/muse/widgets/function_dialogs/legato.h19
-rw-r--r--muse2/muse/widgets/function_dialogs/move.cpp19
-rw-r--r--muse2/muse/widgets/function_dialogs/move.h19
-rw-r--r--muse2/muse/widgets/function_dialogs/quantize.cpp20
-rw-r--r--muse2/muse/widgets/function_dialogs/quantize.h19
-rw-r--r--muse2/muse/widgets/function_dialogs/remove.cpp20
-rw-r--r--muse2/muse/widgets/function_dialogs/remove.h19
-rw-r--r--muse2/muse/widgets/function_dialogs/setlen.cpp19
-rw-r--r--muse2/muse/widgets/function_dialogs/setlen.h19
-rw-r--r--muse2/muse/widgets/function_dialogs/transpose.cpp19
-rw-r--r--muse2/muse/widgets/function_dialogs/transpose.h19
-rw-r--r--muse2/muse/widgets/function_dialogs/velocity.cpp19
-rw-r--r--muse2/muse/widgets/function_dialogs/velocity.h19
-rw-r--r--muse2/muse/widgets/genset.cpp449
-rw-r--r--muse2/muse/widgets/genset.h19
-rw-r--r--muse2/muse/widgets/header.cpp19
-rw-r--r--muse2/muse/widgets/header.h19
-rw-r--r--muse2/muse/widgets/hitscale.cpp18
-rw-r--r--muse2/muse/widgets/hitscale.h20
-rw-r--r--muse2/muse/widgets/intlabel.cpp22
-rw-r--r--muse2/muse/widgets/intlabel.h19
-rw-r--r--muse2/muse/widgets/itransformbase.ui10
-rw-r--r--muse2/muse/widgets/knob.cpp33
-rw-r--r--muse2/muse/widgets/knob.h25
-rw-r--r--muse2/muse/widgets/lcombo.cpp18
-rw-r--r--muse2/muse/widgets/lcombo.h18
-rw-r--r--muse2/muse/widgets/menutitleitem.cpp11
-rw-r--r--muse2/muse/widgets/menutitleitem.h18
-rw-r--r--muse2/muse/widgets/meter.cpp31
-rw-r--r--muse2/muse/widgets/meter.h20
-rw-r--r--muse2/muse/widgets/metronome.cpp58
-rw-r--r--muse2/muse/widgets/metronome.h20
-rw-r--r--muse2/muse/widgets/midisyncimpl.cpp24
-rw-r--r--muse2/muse/widgets/midisyncimpl.h19
-rw-r--r--muse2/muse/widgets/mittransposebase.ui4
-rw-r--r--muse2/muse/widgets/mixdowndialog.cpp22
-rw-r--r--muse2/muse/widgets/mixdowndialog.h19
-rw-r--r--muse2/muse/widgets/mlabel.cpp17
-rw-r--r--muse2/muse/widgets/mlabel.h20
-rw-r--r--muse2/muse/widgets/mmath.cpp25
-rw-r--r--muse2/muse/widgets/mmath.h19
-rw-r--r--muse2/muse/widgets/moc_ttoolbar.cpp22
-rw-r--r--muse2/muse/widgets/mtrackinfo.cpp50
-rw-r--r--muse2/muse/widgets/mtrackinfo.h19
-rw-r--r--muse2/muse/widgets/mtrackinfobase.ui24
-rw-r--r--muse2/muse/widgets/mtscale.cpp26
-rw-r--r--muse2/muse/widgets/mtscale.h20
-rw-r--r--muse2/muse/widgets/mtscale_flo.cpp27
-rw-r--r--muse2/muse/widgets/mtscale_flo.h20
-rw-r--r--muse2/muse/widgets/musewidgetsplug.cpp15
-rw-r--r--muse2/muse/widgets/nentry.cpp18
-rw-r--r--muse2/muse/widgets/nentry.h20
-rw-r--r--muse2/muse/widgets/noteinfo.cpp18
-rw-r--r--muse2/muse/widgets/noteinfo.h23
-rw-r--r--muse2/muse/widgets/pastedialog.cpp2
-rw-r--r--muse2/muse/widgets/pitchedit.cpp18
-rw-r--r--muse2/muse/widgets/pitchedit.h21
-rw-r--r--muse2/muse/widgets/pitchlabel.cpp18
-rw-r--r--muse2/muse/widgets/pitchlabel.h18
-rw-r--r--muse2/muse/widgets/popupmenu.cpp24
-rw-r--r--muse2/muse/widgets/popupmenu.h18
-rw-r--r--muse2/muse/widgets/posedit.cpp19
-rw-r--r--muse2/muse/widgets/posedit.h19
-rw-r--r--muse2/muse/widgets/poslabel.cpp20
-rw-r--r--muse2/muse/widgets/poslabel.h18
-rw-r--r--muse2/muse/widgets/projectcreateimpl.cpp36
-rw-r--r--muse2/muse/widgets/projectcreateimpl.h26
-rw-r--r--muse2/muse/widgets/routepopup.cpp17
-rw-r--r--muse2/muse/widgets/routepopup.h15
-rw-r--r--muse2/muse/widgets/scldiv.cpp79
-rw-r--r--muse2/muse/widgets/scldiv.h23
-rw-r--r--muse2/muse/widgets/scldraw.cpp73
-rw-r--r--muse2/muse/widgets/scldraw.h23
-rw-r--r--muse2/muse/widgets/sclif.cpp22
-rw-r--r--muse2/muse/widgets/sclif.h23
-rw-r--r--muse2/muse/widgets/scrollscale.cpp18
-rw-r--r--muse2/muse/widgets/scrollscale.h19
-rw-r--r--muse2/muse/widgets/section.h19
-rw-r--r--muse2/muse/widgets/shortcutcapturedialog.cpp34
-rw-r--r--muse2/muse/widgets/shortcutcapturedialog.h33
-rw-r--r--muse2/muse/widgets/shortcutconfig.cpp35
-rw-r--r--muse2/muse/widgets/shortcutconfig.h38
-rw-r--r--muse2/muse/widgets/sigedit.cpp19
-rw-r--r--muse2/muse/widgets/sigedit.h19
-rw-r--r--muse2/muse/widgets/siglabel.cpp19
-rw-r--r--muse2/muse/widgets/siglabel.h20
-rw-r--r--muse2/muse/widgets/sigscale.cpp21
-rw-r--r--muse2/muse/widgets/sigscale.h20
-rw-r--r--muse2/muse/widgets/slider.cpp668
-rw-r--r--muse2/muse/widgets/slider.h41
-rw-r--r--muse2/muse/widgets/sliderbase.cpp24
-rw-r--r--muse2/muse/widgets/sliderbase.h23
-rw-r--r--muse2/muse/widgets/songinfo.h12
-rw-r--r--muse2/muse/widgets/spinbox.cpp18
-rw-r--r--muse2/muse/widgets/spinbox.h19
-rw-r--r--muse2/muse/widgets/spinboxFP.cpp21
-rw-r--r--muse2/muse/widgets/spinboxFP.h19
-rw-r--r--muse2/muse/widgets/splitter.cpp19
-rw-r--r--muse2/muse/widgets/splitter.h19
-rw-r--r--muse2/muse/widgets/swidget.cpp18
-rw-r--r--muse2/muse/widgets/swidget.h19
-rw-r--r--muse2/muse/widgets/tb1.cpp18
-rw-r--r--muse2/muse/widgets/tb1.h24
-rw-r--r--muse2/muse/widgets/tempolabel.cpp19
-rw-r--r--muse2/muse/widgets/tempolabel.h19
-rw-r--r--muse2/muse/widgets/tools.cpp18
-rw-r--r--muse2/muse/widgets/tools.h22
-rw-r--r--muse2/muse/widgets/transformbase.ui18
-rw-r--r--muse2/muse/widgets/ttoolbar.cpp25
-rw-r--r--muse2/muse/widgets/ttoolbar.h15
-rw-r--r--muse2/muse/widgets/ttoolbutton.cpp19
-rw-r--r--muse2/muse/widgets/ttoolbutton.h19
-rw-r--r--muse2/muse/widgets/unusedwavefiles.cpp46
-rw-r--r--muse2/muse/widgets/unusedwavefiles.h26
-rw-r--r--muse2/muse/widgets/utils.cpp21
-rw-r--r--muse2/muse/widgets/utils.h18
-rw-r--r--muse2/muse/widgets/verticalmeter.cpp21
-rw-r--r--muse2/muse/widgets/verticalmeter.h20
-rw-r--r--muse2/muse/widgets/view.cpp19
-rw-r--r--muse2/muse/widgets/view.h19
-rw-r--r--muse2/muse/widgets/visibletracks.cpp18
-rw-r--r--muse2/muse/widgets/visibletracks.h23
-rw-r--r--muse2/muse/widgets/vscale.cpp18
-rw-r--r--muse2/muse/widgets/vscale.h19
-rw-r--r--muse2/muse/widgets/wtscale.cpp19
-rw-r--r--muse2/muse/widgets/wtscale.h20
-rw-r--r--muse2/muse/xml.cpp15
-rw-r--r--muse2/muse/xml.h15
-rw-r--r--muse2/packaging/CMakeLists.txt11
-rw-r--r--muse2/plugins/CMakeLists.txt11
-rw-r--r--muse2/plugins/doublechorus/CMakeLists.txt11
-rw-r--r--muse2/plugins/doublechorus/doublechorus.cpp15
-rw-r--r--muse2/plugins/doublechorus/doublechorusmodel.cpp4
-rw-r--r--muse2/plugins/doublechorus/doublechorusmodel.h4
-rw-r--r--muse2/plugins/doublechorus/simplechorusmodel.cpp4
-rw-r--r--muse2/plugins/doublechorus/simplechorusmodel.h4
-rw-r--r--muse2/plugins/freeverb/CMakeLists.txt11
-rw-r--r--muse2/plugins/freeverb/allpass.h9
-rw-r--r--muse2/plugins/freeverb/comb.h9
-rw-r--r--muse2/plugins/freeverb/denormals.h9
-rw-r--r--muse2/plugins/freeverb/freeverb.cpp15
-rw-r--r--muse2/plugins/freeverb/revmodel.cpp9
-rw-r--r--muse2/plugins/freeverb/revmodel.h9
-rw-r--r--muse2/plugins/freeverb/tuning.h7
-rw-r--r--muse2/plugins/pandelay/CMakeLists.txt11
-rw-r--r--muse2/plugins/pandelay/ladspapandelay.cpp4
-rw-r--r--muse2/plugins/pandelay/ladspapandelay.h4
-rw-r--r--muse2/plugins/pandelay/pandelay.cpp15
-rw-r--r--muse2/plugins/pandelay/pandelaymodel.cpp4
-rw-r--r--muse2/plugins/pandelay/pandelaymodel.h4
-rw-r--r--muse2/share/CMakeLists.txt11
-rw-r--r--muse2/share/drummaps/CMakeLists.txt11
-rw-r--r--muse2/share/html/CMakeLists.txt11
-rw-r--r--muse2/share/html/COPYING.html2
-rw-r--r--muse2/share/instruments/CMakeLists.txt11
-rw-r--r--muse2/share/locale/CMakeLists.txt11
-rw-r--r--muse2/share/plugins/CMakeLists.txt11
-rw-r--r--muse2/share/pybridge/CMakeLists.txt11
-rw-r--r--muse2/share/pybridge/examples/addpartexample.py15
-rw-r--r--muse2/share/pybridge/examples/addtrack.py15
-rw-r--r--muse2/share/pybridge/examples/ctrlexample.py15
-rw-r--r--muse2/share/pybridge/examples/effecttoggle.py15
-rw-r--r--muse2/share/pybridge/examples/mute.py15
-rw-r--r--muse2/share/pybridge/examples/repeatpart.py15
-rw-r--r--muse2/share/pybridge/examples/setpositionexample.py15
-rw-r--r--muse2/share/pybridge/examples/tempoexample.py23
-rw-r--r--muse2/share/pybridge/examples/trackparamchangeexample.py15
-rw-r--r--muse2/share/pybridge/musepclient.py23
-rw-r--r--muse2/share/pybridge/museplauncher.py15
-rw-r--r--muse2/share/pybridge/parter/main.py23
-rw-r--r--muse2/share/pybridge/parter/parter.py23
-rw-r--r--muse2/share/pybridge/robert.py22
-rw-r--r--muse2/share/scoreglyphs/CMakeLists.txt11
-rw-r--r--muse2/share/scripts/CMakeLists.txt11
-rwxr-xr-xmuse2/share/scripts/ConstantLength22
-rwxr-xr-xmuse2/share/scripts/DoNothing23
-rwxr-xr-xmuse2/share/scripts/DoubleSpeed22
-rwxr-xr-xmuse2/share/scripts/RemoveShortEvents23
-rwxr-xr-xmuse2/share/scripts/SwingQuantize123
-rw-r--r--muse2/share/templates/CMakeLists.txt11
-rw-r--r--muse2/share/wallpapers/CMakeLists.txt11
-rw-r--r--muse2/synti/CMakeLists.txt11
-rw-r--r--muse2/synti/deicsonze/CMakeLists.txt11
-rw-r--r--muse2/synti/deicsonze/common_defs.h22
-rw-r--r--muse2/synti/deicsonze/deicsonze.cpp8
-rw-r--r--muse2/synti/deicsonze/deicsonze.h4
-rw-r--r--muse2/synti/deicsonze/deicsonzefilter.cpp4
-rw-r--r--muse2/synti/deicsonze/deicsonzefilter.h4
-rw-r--r--muse2/synti/deicsonze/deicsonzegui.cpp8
-rw-r--r--muse2/synti/deicsonze/deicsonzegui.h4
-rw-r--r--muse2/synti/deicsonze/deicsonzeplugin.cpp4
-rw-r--r--muse2/synti/deicsonze/deicsonzeplugin.h4
-rw-r--r--muse2/synti/deicsonze/deicsonzepreset.cpp4
-rw-r--r--muse2/synti/deicsonze/deicsonzepreset.h4
-rw-r--r--muse2/synti/fluid/CMakeLists.txt11
-rw-r--r--muse2/synti/fluid/common_defs.h22
-rw-r--r--muse2/synti/fluid/fluid.cpp15
-rw-r--r--muse2/synti/fluid/fluid.h15
-rw-r--r--muse2/synti/fluid/fluidgui.cpp15
-rw-r--r--muse2/synti/fluid/fluidgui.h15
-rw-r--r--muse2/synti/fluidsynth/CMakeLists.txt11
-rw-r--r--muse2/synti/fluidsynth/common_defs.h22
-rw-r--r--muse2/synti/fluidsynth/fluidsynthgui.cpp22
-rw-r--r--muse2/synti/fluidsynth/fluidsynthgui.h22
-rw-r--r--muse2/synti/fluidsynth/fluidsynti.cpp22
-rw-r--r--muse2/synti/fluidsynth/fluidsynti.h22
-rw-r--r--muse2/synti/libsynti/CMakeLists.txt11
-rw-r--r--muse2/synti/libsynti/gui.cpp15
-rw-r--r--muse2/synti/libsynti/gui.h15
-rw-r--r--muse2/synti/libsynti/mess.cpp15
-rw-r--r--muse2/synti/libsynti/mess.h15
-rw-r--r--muse2/synti/libsynti/mono.cpp15
-rw-r--r--muse2/synti/libsynti/mono.h15
-rw-r--r--muse2/synti/libsynti/poly.cpp15
-rw-r--r--muse2/synti/libsynti/poly.h15
-rw-r--r--muse2/synti/organ/CMakeLists.txt11
-rw-r--r--muse2/synti/organ/common_defs.h22
-rw-r--r--muse2/synti/organ/organ.cpp15
-rw-r--r--muse2/synti/organ/organ.h15
-rw-r--r--muse2/synti/organ/organgui.cpp15
-rw-r--r--muse2/synti/organ/organgui.h15
-rw-r--r--muse2/synti/s1/CMakeLists.txt11
-rw-r--r--muse2/synti/s1/s1.cpp15
-rw-r--r--muse2/synti/simpledrums2/CMakeLists.txt11
-rw-r--r--muse2/synti/simpledrums2/common.h26
-rw-r--r--muse2/synti/simpledrums2/common_defs.h22
-rw-r--r--muse2/synti/simpledrums2/simpledrums.cpp14
-rw-r--r--muse2/synti/simpledrums2/simpledrums.h15
-rw-r--r--muse2/synti/simpledrums2/simpledrumsgui.cpp15
-rw-r--r--muse2/synti/simpledrums2/simpledrumsgui.h15
-rw-r--r--muse2/synti/simpledrums2/ssplugin.cpp18
-rw-r--r--muse2/synti/simpledrums2/ssplugin.h15
-rw-r--r--muse2/synti/simpledrums2/ssplugingui.cpp15
-rw-r--r--muse2/synti/simpledrums2/ssplugingui.h15
-rw-r--r--muse2/synti/vam/CMakeLists.txt11
-rw-r--r--muse2/synti/vam/common_defs.h22
-rw-r--r--muse2/synti/vam/vam.cpp4
-rw-r--r--muse2/synti/vam/vam.h4
-rw-r--r--muse2/synti/vam/vamgui.cpp10
-rw-r--r--muse2/synti/vam/vamgui.h4
-rw-r--r--muse2/utils/CMakeLists.txt11
-rwxr-xr-xmuse2/utils/muse-find-unused-wavs23
-rwxr-xr-xmuse2/utils/muse-song-convert.py24
621 files changed, 13016 insertions, 6257 deletions
diff --git a/muse2/CMakeLists.txt b/muse2/CMakeLists.txt
index 9a19e4ea..9d438d0c 100644
--- a/muse2/CMakeLists.txt
+++ b/muse2/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2008 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
include(FindPkgConfig)
diff --git a/muse2/COPYING b/muse2/COPYING
index 5a965fbc..e2eaa721 100644
--- a/muse2/COPYING
+++ b/muse2/COPYING
@@ -1,8 +1,16 @@
+This program (MusE) 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.
+
+
+
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
diff --git a/muse2/ChangeLog b/muse2/ChangeLog
index 5d2129f9..b4e2d8e5 100644
--- a/muse2/ChangeLog
+++ b/muse2/ChangeLog
@@ -1,4 +1,34 @@
+09.09.2011:
+ - Removed sending of SEQM_ADD_TRACK, SEQM_REMOVE_TRACK, SEQM_CHANGE_TRACK, SEQM_REMOVE_PART, and
+ SEQM_CHANGE_PART to ALSA midi thread (which waits) from inside Audio::processMsg.
+ Replaced with hand-offs to Song::processMsg. TODO: SEQM_SET_TRACK_OUT_CHAN etc. (Tim)
+ - MidiDevice play and stuck event lists no longer directly accessible from outside -
+ replaced with ::addScheduledEvent and ::addStuckNote. (Tim)
+ - Installed a ring buffer for ALSA MidiDevice play/stuck notes event lists, filled by ::addScheduledEvent
+ and ::addStuckNote, because ALSA midi is processed in a thread other than audio. (Tim)
+ TODO: processMidi could do stuck notes better by bypassing their insertion in the play event list,
+ also applies to seek/stop handler block, but I'm not sure about the time comparisons.
+ - Some more separation of ALSA and Jack Midi, one step closer to configurable choice of either/or. (Tim)
+ - Massive cleanup of audio, midi, mididev, alsamidi, jackmidi modules. Moved some stuff from Audio::processMidi
+ into MidiDevice. (Tim)
+ - Test OK here so far, with stress files and complete pre-existing songs, ALSA, Jack, and Synth midi. (Tim)
+ TODO: Restoration of sustain upon play seems broken for a while - try putEvent instead of addScheduledEvent
+ in Audio::startRolling().
+08.09.2011:
+ - Finished namespace MusEWidget. Added namespaces MusEUtil, MusEDialog. (Orcan)
+07.09.2011:
+ - Introducing namespaces. So far, we have MusEApp, MusEGlobal, MusEConfig, and I just started
+ MusEWidget. zynaddsubfx does not crash anymore. (Orcan)
+06.09.2011:
+ - Add licensing information (GPLv2 or later) to source code files. Update FSF mailing address
+ to the most recent one in the existing copyright notices. (Orcan)
+05.09.2011:
+ - Remodel the EffectRack. There is still an ongoing issue with the minimumSizeHint, which I worked
+ around by adding a fixed offset. (Orcan)
+ - Fall back to using Meter's own size functions rather than the event rectangle's size functions
+ in paintEvent(). The latter caused corruption when toggling mono/stereo. (Orcan)
04.09.2011:
+ - Remodel the Slider (Orcan)
- moved and changed muse.pro file (flo93)
- added update_pro.sh and update_translations.sh (flo93)
- added paste dialog (flo93)
@@ -6,6 +36,14 @@
- moved stuff from functions.cpp out to dialogs.cpp (flo93)
- fixed behaviour of movePartsTotheRight(): parts which
begin at "start of move" aren't expanded, but moved now (flo93)
+01.09.2011:
+ - Fixed tough old skeleton: Selecting 'previous/next event' in Song::execAutomationCtlPopup now moves cursor
+ with exact frame resolution, all the way through via proper song->setPos > audio->msgSeek rather than
+ song->setPos > set pos[0] etc. There was a bug that it got stuck on too-close points on the graphs. (Tim)
+ - Reverted controls to full speed (again): Removed too-cautious msgSetVolume, msgSetPan, msgSetPluginCtrlVal. (Tim)
+ Reviewing some other possibly unneeded too-cautious msgXXX audio messages :)
+ TODO: Fix current automation values (the 'off' value).
+ - Removed unused PanKnob from mixer CMakeLists. (Tim)
29.08.2011:
- Fixed Robert's fixes (flo93)
- Fixed audio automation graph editing. And now 'snaps' to discrete integer or bool types. (Tim p4.0.32)
diff --git a/muse2/README.effects-rack b/muse2/README.effects-rack
index 823ae74c..071ba08e 100644
--- a/muse2/README.effects-rack
+++ b/muse2/README.effects-rack
@@ -1,4 +1,4 @@
-May 6, 2010 v0.0.2 by Tim.
+Sept 1, 2011 v0.0.3 by Tim.
Understanding the Effects Rack
------------------------------
@@ -48,15 +48,12 @@ These same rules apply to inter-plugin audio when more than one plugin
is in the rack chain. Extra audio outputs of one plugin may be ignored
by the next plugin if not used.
-Currently plugins with no audio outputs are not really useful in MusE,
- chiefly because plugin control outputs are not used or displayed.
-Nor are specialized plugins with many inputs and/or outputs.
+Currently specialized plugins with many inputs and/or outputs are not
+ really useful in MusE.
Nor are so-called 'realtime' control plugins which use audio inputs
and outputs for control signals.
-<<<
- Loud noise alert! Beware of using such plugins in an audio effects rack.
->>>
+Loud noise alert! Beware of using such plugins in an audio effects rack.
Example: Consider a stereo Audio Input track with these effect rack
diff --git a/muse2/al/CMakeLists.txt b/muse2/al/CMakeLists.txt
index 55e729ab..12d52746 100644
--- a/muse2/al/CMakeLists.txt
+++ b/muse2/al/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
include(${PROJECT_SOURCE_DIR}/pch.txt)
diff --git a/muse2/al/al.cpp b/muse2/al/al.cpp
index 38cc301a..3d9044c7 100644
--- a/muse2/al/al.cpp
+++ b/muse2/al/al.cpp
@@ -3,10 +3,12 @@
// Audio Utility Library
// $Id: al.cpp,v 1.1.2.2 2009/12/06 01:39:33 terminator356 Exp $
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "al.h"
diff --git a/muse2/al/al.h b/muse2/al/al.h
index 6f4a07cb..71550def 100644
--- a/muse2/al/al.h
+++ b/muse2/al/al.h
@@ -3,10 +3,12 @@
// Audio Utility Library
// $Id: al.h,v 1.1.2.2 2009/12/06 01:39:33 terminator356 Exp $
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AL_H__
diff --git a/muse2/al/dsp.cpp b/muse2/al/dsp.cpp
index fa9fa18b..5c23a458 100644
--- a/muse2/al/dsp.cpp
+++ b/muse2/al/dsp.cpp
@@ -3,10 +3,12 @@
// Audio Utility Library
// $Id: dsp.cpp,v 1.1.2.1 2009/12/06 01:39:33 terminator356 Exp $
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include <stdio.h>
@@ -135,7 +137,7 @@ void initDsp()
}
// fall through to not hardware optimized routines
#endif
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("Muse: using unoptimized non-SSE dsp routines\n");
dsp = new Dsp();
}
diff --git a/muse2/al/dsp.h b/muse2/al/dsp.h
index f88a0122..a0056772 100644
--- a/muse2/al/dsp.h
+++ b/muse2/al/dsp.h
@@ -3,10 +3,12 @@
// Audio Utility Library
// $Id: dsp.h,v 1.1.2.1 2009/12/06 01:39:33 terminator356 Exp $
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __DSP_H__
diff --git a/muse2/al/dspSSE.cpp b/muse2/al/dspSSE.cpp
index a345e308..996fa5eb 100644
--- a/muse2/al/dspSSE.cpp
+++ b/muse2/al/dspSSE.cpp
@@ -9,7 +9,9 @@
// Original author Sampo Savolainen
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -18,7 +20,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//======================================================================
#; void x86_sse_mix_buffers_with_gain (float *dst, float *src, long nframes, float gain);
diff --git a/muse2/al/dspXMM.cpp b/muse2/al/dspXMM.cpp
index 99893c3f..b6e071d4 100644
--- a/muse2/al/dspXMM.cpp
+++ b/muse2/al/dspXMM.cpp
@@ -9,7 +9,9 @@
// Original author Sampo Savolainen
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -18,7 +20,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//======================================================================
diff --git a/muse2/al/sig.cpp b/muse2/al/sig.cpp
index 293a5b3e..8521fb5b 100644
--- a/muse2/al/sig.cpp
+++ b/muse2/al/sig.cpp
@@ -3,10 +3,12 @@
// Audio Utility Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
@@ -260,7 +262,7 @@ int SigList::ticks_beat(int n) const
{
///int m = AL::division;
- int m = config.division;
+ int m = MusEConfig::config.division;
switch (n) {
case 1: m <<= 2; break; // 1536
diff --git a/muse2/al/sig.h b/muse2/al/sig.h
index 618cd53c..f5010822 100644
--- a/muse2/al/sig.h
+++ b/muse2/al/sig.h
@@ -3,10 +3,12 @@
// Audio Utility Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __SIG_H__
diff --git a/muse2/al/xml.cpp b/muse2/al/xml.cpp
index 96489307..ac8cb4c4 100644
--- a/muse2/al/xml.cpp
+++ b/muse2/al/xml.cpp
@@ -3,10 +3,12 @@
// Audio Utility Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "xml.h"
diff --git a/muse2/al/xml.h b/muse2/al/xml.h
index a72c1ac5..98d55cbb 100644
--- a/muse2/al/xml.h
+++ b/muse2/al/xml.h
@@ -3,10 +3,12 @@
// Audio Utility Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __XML_H__
diff --git a/muse2/all.h b/muse2/all.h
index 2b27adfa..e0131593 100644
--- a/muse2/all.h
+++ b/muse2/all.h
@@ -1,12 +1,14 @@
-//=============================================================================
+//=========================================================
// MusE
// Linux Music Editor
-// $Id:$
+// $Id: ./all.h $
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// 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; 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
@@ -15,8 +17,9 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-//=============================================================================
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef __ALLQT_H__
#define __ALLQT_H__
diff --git a/muse2/awl/CMakeLists.txt b/muse2/awl/CMakeLists.txt
index 21772470..f84194a8 100644
--- a/muse2/awl/CMakeLists.txt
+++ b/muse2/awl/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/awl/aslider.cpp b/muse2/awl/aslider.cpp
index b48ccbe0..900a7200 100644
--- a/muse2/awl/aslider.cpp
+++ b/muse2/awl/aslider.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "fastlog.h"
diff --git a/muse2/awl/aslider.h b/muse2/awl/aslider.h
index 9354e6c7..4b767810 100644
--- a/muse2/awl/aslider.h
+++ b/muse2/awl/aslider.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLASLIDER_H__
diff --git a/muse2/awl/awl.cpp b/muse2/awl/awl.cpp
index 87aac3e7..44a9b7c9 100644
--- a/muse2/awl/awl.cpp
+++ b/muse2/awl/awl.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "awl.h"
diff --git a/muse2/awl/awl.h b/muse2/awl/awl.h
index 2019c4bd..8c1a7c9d 100644
--- a/muse2/awl/awl.h
+++ b/muse2/awl/awl.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWL_H__
diff --git a/muse2/awl/awlplugin.cpp b/muse2/awl/awlplugin.cpp
index 43435f5e..1e287d84 100644
--- a/muse2/awl/awlplugin.cpp
+++ b/muse2/awl/awlplugin.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "volknob.h"
diff --git a/muse2/awl/awlplugin.h b/muse2/awl/awlplugin.h
index 79b180fd..37b6d415 100644
--- a/muse2/awl/awlplugin.h
+++ b/muse2/awl/awlplugin.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLPLUGIN_H__
diff --git a/muse2/awl/checkbox.cpp b/muse2/awl/checkbox.cpp
index 6ef74386..4e130a9d 100644
--- a/muse2/awl/checkbox.cpp
+++ b/muse2/awl/checkbox.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "checkbox.h"
diff --git a/muse2/awl/checkbox.h b/muse2/awl/checkbox.h
index 94cc3db3..caca92fa 100644
--- a/muse2/awl/checkbox.h
+++ b/muse2/awl/checkbox.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLCHECKBOX_H__
diff --git a/muse2/awl/combobox.cpp b/muse2/awl/combobox.cpp
index 58c82c54..e5322a98 100644
--- a/muse2/awl/combobox.cpp
+++ b/muse2/awl/combobox.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "combobox.h"
diff --git a/muse2/awl/combobox.h b/muse2/awl/combobox.h
index 1754338b..5df5dbd4 100644
--- a/muse2/awl/combobox.h
+++ b/muse2/awl/combobox.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLCOMBOBOX_H__
diff --git a/muse2/awl/drawbar.cpp b/muse2/awl/drawbar.cpp
index a82ed248..7352218c 100644
--- a/muse2/awl/drawbar.cpp
+++ b/muse2/awl/drawbar.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2007 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "drawbar.h"
diff --git a/muse2/awl/drawbar.h b/muse2/awl/drawbar.h
index 4794b784..8ad0aff3 100644
--- a/muse2/awl/drawbar.h
+++ b/muse2/awl/drawbar.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2007 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLDRAWBAR_H__
diff --git a/muse2/awl/floatentry.cpp b/muse2/awl/floatentry.cpp
index 471ec5a0..44739944 100644
--- a/muse2/awl/floatentry.cpp
+++ b/muse2/awl/floatentry.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "floatentry.h"
diff --git a/muse2/awl/floatentry.h b/muse2/awl/floatentry.h
index 16aa7c8c..53d53bff 100644
--- a/muse2/awl/floatentry.h
+++ b/muse2/awl/floatentry.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __FLOATLABEL_H__
diff --git a/muse2/awl/knob.cpp b/muse2/awl/knob.cpp
index 00665d21..2a2ced12 100644
--- a/muse2/awl/knob.cpp
+++ b/muse2/awl/knob.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include <cmath>
diff --git a/muse2/awl/knob.h b/muse2/awl/knob.h
index b7be932b..da22ce8f 100644
--- a/muse2/awl/knob.h
+++ b/muse2/awl/knob.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLKNOB_H__
diff --git a/muse2/awl/ltest.cpp b/muse2/awl/ltest.cpp
index 55fe1749..67ceb66e 100644
--- a/muse2/awl/ltest.cpp
+++ b/muse2/awl/ltest.cpp
@@ -1,3 +1,25 @@
+//=============================================================================
+// Awl
+// Audio Widget Library
+// $Id:$
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//=============================================================================
+
#include <stdio.h>
#include "awlplugin.h"
diff --git a/muse2/awl/midimeter.cpp b/muse2/awl/midimeter.cpp
index 255232d7..e20d4902 100644
--- a/muse2/awl/midimeter.cpp
+++ b/muse2/awl/midimeter.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "fastlog.h"
diff --git a/muse2/awl/midimeter.h b/muse2/awl/midimeter.h
index 929e648c..aa58550f 100644
--- a/muse2/awl/midimeter.h
+++ b/muse2/awl/midimeter.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLMIDIMETER_H__
diff --git a/muse2/awl/midimslider.cpp b/muse2/awl/midimslider.cpp
index a4867044..6aad7ab7 100644
--- a/muse2/awl/midimslider.cpp
+++ b/muse2/awl/midimslider.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "fastlog.h"
diff --git a/muse2/awl/midimslider.h b/muse2/awl/midimslider.h
index a363348a..623fdb0e 100644
--- a/muse2/awl/midimslider.h
+++ b/muse2/awl/midimslider.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLMIDIMSLIDER_H__
diff --git a/muse2/awl/midipanentry.cpp b/muse2/awl/midipanentry.cpp
index 5e4e4f9a..2c97b8ae 100644
--- a/muse2/awl/midipanentry.cpp
+++ b/muse2/awl/midipanentry.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "fastlog.h"
diff --git a/muse2/awl/midipanentry.h b/muse2/awl/midipanentry.h
index 25f7333a..415da452 100644
--- a/muse2/awl/midipanentry.h
+++ b/muse2/awl/midipanentry.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLMIDIPANENTRY_H__
diff --git a/muse2/awl/midipanknob.cpp b/muse2/awl/midipanknob.cpp
index a2530119..48fe3e12 100644
--- a/muse2/awl/midipanknob.cpp
+++ b/muse2/awl/midipanknob.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "midipanknob.h"
diff --git a/muse2/awl/midipanknob.h b/muse2/awl/midipanknob.h
index 9b628e6b..669f2d8c 100644
--- a/muse2/awl/midipanknob.h
+++ b/muse2/awl/midipanknob.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLMIDIPANKNOB_H__
diff --git a/muse2/awl/midivolentry.cpp b/muse2/awl/midivolentry.cpp
index 0b74afcc..7b1ddcdc 100644
--- a/muse2/awl/midivolentry.cpp
+++ b/muse2/awl/midivolentry.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "fastlog.h"
diff --git a/muse2/awl/midivolentry.h b/muse2/awl/midivolentry.h
index 99155877..773ffb7d 100644
--- a/muse2/awl/midivolentry.h
+++ b/muse2/awl/midivolentry.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLMIDIVOLENTRY_H__
diff --git a/muse2/awl/mslider.cpp b/muse2/awl/mslider.cpp
index 7424dfac..14aa9126 100644
--- a/muse2/awl/mslider.cpp
+++ b/muse2/awl/mslider.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "fastlog.h"
diff --git a/muse2/awl/mslider.h b/muse2/awl/mslider.h
index 15dd8a7e..a6af0fa4 100644
--- a/muse2/awl/mslider.h
+++ b/muse2/awl/mslider.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLMSLIDER_H__
diff --git a/muse2/awl/panentry.cpp b/muse2/awl/panentry.cpp
index 0cc098c2..ad019d35 100644
--- a/muse2/awl/panentry.cpp
+++ b/muse2/awl/panentry.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "panentry.h"
diff --git a/muse2/awl/panentry.h b/muse2/awl/panentry.h
index 01689580..63ed784c 100644
--- a/muse2/awl/panentry.h
+++ b/muse2/awl/panentry.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLPANENTRY_H__
diff --git a/muse2/awl/panknob.cpp b/muse2/awl/panknob.cpp
index 083aa2e0..2536cdfe 100644
--- a/muse2/awl/panknob.cpp
+++ b/muse2/awl/panknob.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "panknob.h"
diff --git a/muse2/awl/panknob.h b/muse2/awl/panknob.h
index d8bf2d87..b204bd8e 100644
--- a/muse2/awl/panknob.h
+++ b/muse2/awl/panknob.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLPANKNOB_H__
diff --git a/muse2/awl/pitchedit.cpp b/muse2/awl/pitchedit.cpp
index 6bae2f5b..e0ede87b 100644
--- a/muse2/awl/pitchedit.cpp
+++ b/muse2/awl/pitchedit.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include <stdio.h>
diff --git a/muse2/awl/pitchedit.h b/muse2/awl/pitchedit.h
index 1512ec8d..b2ae4ad6 100644
--- a/muse2/awl/pitchedit.h
+++ b/muse2/awl/pitchedit.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLPITCHEDIT_H__
diff --git a/muse2/awl/pitchlabel.cpp b/muse2/awl/pitchlabel.cpp
index d6e83515..e901db06 100644
--- a/muse2/awl/pitchlabel.cpp
+++ b/muse2/awl/pitchlabel.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "pitchedit.h"
diff --git a/muse2/awl/pitchlabel.h b/muse2/awl/pitchlabel.h
index a09d1ced..256e97b0 100644
--- a/muse2/awl/pitchlabel.h
+++ b/muse2/awl/pitchlabel.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLPITCHLABEL_H__
diff --git a/muse2/awl/posedit.cpp b/muse2/awl/posedit.cpp
index 07741e58..5666f39f 100644
--- a/muse2/awl/posedit.cpp
+++ b/muse2/awl/posedit.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "al/al.h"
diff --git a/muse2/awl/posedit.h b/muse2/awl/posedit.h
index 09cfd6e3..2da74d41 100644
--- a/muse2/awl/posedit.h
+++ b/muse2/awl/posedit.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __POSEDIT_H__
diff --git a/muse2/awl/poslabel.cpp b/muse2/awl/poslabel.cpp
index 638508fd..12f4c46d 100644
--- a/muse2/awl/poslabel.cpp
+++ b/muse2/awl/poslabel.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "poslabel.h"
diff --git a/muse2/awl/poslabel.h b/muse2/awl/poslabel.h
index 68139efe..010c3c23 100644
--- a/muse2/awl/poslabel.h
+++ b/muse2/awl/poslabel.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLPOSLABEL_H__
diff --git a/muse2/awl/sigedit.cpp b/muse2/awl/sigedit.cpp
index 0ff40de9..1d2bce48 100644
--- a/muse2/awl/sigedit.cpp
+++ b/muse2/awl/sigedit.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "al/al.h"
diff --git a/muse2/awl/sigedit.h b/muse2/awl/sigedit.h
index d2494798..259812dd 100644
--- a/muse2/awl/sigedit.h
+++ b/muse2/awl/sigedit.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __SIGEDIT_H__
diff --git a/muse2/awl/slider.cpp b/muse2/awl/slider.cpp
index 00f3d925..8c88b870 100644
--- a/muse2/awl/slider.cpp
+++ b/muse2/awl/slider.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "slider.h"
diff --git a/muse2/awl/slider.h b/muse2/awl/slider.h
index e8e38ba2..8379ae11 100644
--- a/muse2/awl/slider.h
+++ b/muse2/awl/slider.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLSLIDER_H__
diff --git a/muse2/awl/tcanvas.cpp b/muse2/awl/tcanvas.cpp
index 6ec4f68f..55d06b1f 100644
--- a/muse2/awl/tcanvas.cpp
+++ b/muse2/awl/tcanvas.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "tcanvas.h"
diff --git a/muse2/awl/tcanvas.h b/muse2/awl/tcanvas.h
index 09b26b1d..7084292d 100644
--- a/muse2/awl/tcanvas.h
+++ b/muse2/awl/tcanvas.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __TCANVAS_H__
diff --git a/muse2/awl/tempoedit.cpp b/muse2/awl/tempoedit.cpp
index 7bdc5c2d..348d10a8 100644
--- a/muse2/awl/tempoedit.cpp
+++ b/muse2/awl/tempoedit.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include <cmath>
diff --git a/muse2/awl/tempoedit.h b/muse2/awl/tempoedit.h
index 8ad83dc7..2ed6c586 100644
--- a/muse2/awl/tempoedit.h
+++ b/muse2/awl/tempoedit.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLTEMPOEDIT_H__
diff --git a/muse2/awl/tempolabel.cpp b/muse2/awl/tempolabel.cpp
index fc4e8daa..e5dae198 100644
--- a/muse2/awl/tempolabel.cpp
+++ b/muse2/awl/tempolabel.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "tempolabel.h"
diff --git a/muse2/awl/tempolabel.h b/muse2/awl/tempolabel.h
index b7df6b56..9a16eb99 100644
--- a/muse2/awl/tempolabel.h
+++ b/muse2/awl/tempolabel.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLTEMPOLABEL_H__
diff --git a/muse2/awl/utils.cpp b/muse2/awl/utils.cpp
index 030ae538..adc4f5f5 100644
--- a/muse2/awl/utils.cpp
+++ b/muse2/awl/utils.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include <QString>
diff --git a/muse2/awl/utils.h b/muse2/awl/utils.h
index f354a399..7142159e 100644
--- a/muse2/awl/utils.h
+++ b/muse2/awl/utils.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLUTILS_H__
diff --git a/muse2/awl/volentry.cpp b/muse2/awl/volentry.cpp
index 23b38720..a5c246f8 100644
--- a/muse2/awl/volentry.cpp
+++ b/muse2/awl/volentry.cpp
@@ -1,10 +1,12 @@
//=============================================================================
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -13,7 +15,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "fastlog.h"
diff --git a/muse2/awl/volentry.h b/muse2/awl/volentry.h
index 0b51b945..828866c3 100644
--- a/muse2/awl/volentry.h
+++ b/muse2/awl/volentry.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLVOLENTRY_H__
diff --git a/muse2/awl/volknob.cpp b/muse2/awl/volknob.cpp
index da9a1e63..43dd728b 100644
--- a/muse2/awl/volknob.cpp
+++ b/muse2/awl/volknob.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "fastlog.h"
diff --git a/muse2/awl/volknob.h b/muse2/awl/volknob.h
index 7cec4335..39ae8c3e 100644
--- a/muse2/awl/volknob.h
+++ b/muse2/awl/volknob.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLVOLKNOB_H__
diff --git a/muse2/awl/volslider.cpp b/muse2/awl/volslider.cpp
index 87997510..534e950b 100644
--- a/muse2/awl/volslider.cpp
+++ b/muse2/awl/volslider.cpp
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "fastlog.h"
diff --git a/muse2/awl/volslider.h b/muse2/awl/volslider.h
index 22b4000f..54b69240 100644
--- a/muse2/awl/volslider.h
+++ b/muse2/awl/volslider.h
@@ -3,10 +3,12 @@
// Audio Widget Library
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __AWLVOLSLIDER_H__
diff --git a/muse2/compile_muse.sh b/muse2/compile_muse.sh
index 2e32f98a..ef3a57ec 100755
--- a/muse2/compile_muse.sh
+++ b/muse2/compile_muse.sh
@@ -1,4 +1,26 @@
#!/bin/bash
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 1999-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
if [ -d build ]; then
echo "Build dir already exists"
diff --git a/muse2/config.h.in b/muse2/config.h.in
index f7b511ad..35f01bca 100644
--- a/muse2/config.h.in
+++ b/muse2/config.h.in
@@ -3,10 +3,12 @@
// Linux Music Editor
// $Id:$
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 2002-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// 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
diff --git a/muse2/demos/CMakeLists.txt b/muse2/demos/CMakeLists.txt
index c5d18766..f244ed76 100644
--- a/muse2/demos/CMakeLists.txt
+++ b/muse2/demos/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file (GLOB med_files *.med)
diff --git a/muse2/grepmidi/CMakeLists.txt b/muse2/grepmidi/CMakeLists.txt
index ff607aca..098f19e9 100644
--- a/muse2/grepmidi/CMakeLists.txt
+++ b/muse2/grepmidi/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/grepmidi/grepmidi.cpp b/muse2/grepmidi/grepmidi.cpp
index 1d33b4ac..6e1aabbd 100644
--- a/muse2/grepmidi/grepmidi.cpp
+++ b/muse2/grepmidi/grepmidi.cpp
@@ -4,6 +4,21 @@
// $Id: grepmidi.cpp,v 1.1.1.1.2.1 2009/03/09 02:05:17 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
diff --git a/muse2/man/CMakeLists.txt b/muse2/man/CMakeLists.txt
index a76a8e4a..fdeebca1 100644
--- a/muse2/man/CMakeLists.txt
+++ b/muse2/man/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
#
diff --git a/muse2/muse/CMakeLists.txt b/muse2/muse/CMakeLists.txt
index 1a3bb565..b26100f9 100644
--- a/muse2/muse/CMakeLists.txt
+++ b/muse2/muse/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2008 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
include(${PROJECT_SOURCE_DIR}/pch.txt)
diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp
index 91dbaed8..7ec00f41 100644
--- a/muse2/muse/app.cpp
+++ b/muse2/muse/app.cpp
@@ -3,7 +3,22 @@
// Linux Music Editor
// $Id: app.cpp,v 1.113.2.68 2009/12/21 14:51:51 spamatica Exp $
//
-// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+// (C) Copyright 1999-2011 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <typeinfo>
@@ -19,6 +34,8 @@
#include <QMdiArea>
#include <QMdiSubWindow>
+#include <iostream>
+
#include "app.h"
#include "master/lmaster.h"
#include "al/dsp.h"
@@ -61,6 +78,9 @@
#include "functions.h"
+
+namespace MusEApp {
+
//extern void cacheJackRouteNames();
static pthread_t watchdogThread;
@@ -129,7 +149,7 @@ bool MusE::seqStart()
}
if (!audio->start()) {
- QMessageBox::critical( muse, tr("Failed to start audio!"),
+ QMessageBox::critical( MusEGlobal::muse, tr("Failed to start audio!"),
tr("Was not able to start audio, check if jack is running.\n"));
return false;
}
@@ -145,46 +165,46 @@ bool MusE::seqStart()
}
if(!audio->isRunning())
{
- QMessageBox::critical( muse, tr("Failed to start audio!"),
+ QMessageBox::critical( MusEGlobal::muse, tr("Failed to start audio!"),
tr("Timeout waiting for audio to run. Check if jack is running.\n"));
}
//
// now its safe to ask the driver for realtime
// priority
- realTimePriority = audioDevice->realtimePriority();
- if(debugMsg)
- printf("MusE::seqStart: getting audio driver realTimePriority:%d\n", realTimePriority);
+ MusEGlobal::realTimePriority = audioDevice->realtimePriority();
+ if(MusEGlobal::debugMsg)
+ printf("MusE::seqStart: getting audio driver MusEGlobal::realTimePriority:%d\n", MusEGlobal::realTimePriority);
int pfprio = 0;
int midiprio = 0;
- // NOTE: realTimeScheduling can be true (gotten using jack_is_realtime()),
- // while the determined realTimePriority can be 0.
- // realTimePriority is gotten using pthread_getschedparam() on the client thread
+ // NOTE: MusEGlobal::realTimeScheduling can be true (gotten using jack_is_realtime()),
+ // while the determined MusEGlobal::realTimePriority can be 0.
+ // MusEGlobal::realTimePriority is gotten using pthread_getschedparam() on the client thread
// in JackAudioDevice::realtimePriority() which is a bit flawed - it reports there's no RT...
- if(realTimeScheduling)
+ if(MusEGlobal::realTimeScheduling)
{
{
- //pfprio = realTimePriority - 5;
+ //pfprio = MusEGlobal::realTimePriority - 5;
// p3.3.40
- pfprio = realTimePriority + 1;
+ pfprio = MusEGlobal::realTimePriority + 1;
- //midiprio = realTimePriority - 2;
+ //midiprio = MusEGlobal::realTimePriority - 2;
// p3.3.37
- //midiprio = realTimePriority + 1;
+ //midiprio = MusEGlobal::realTimePriority + 1;
// p3.3.40
- midiprio = realTimePriority + 2;
+ midiprio = MusEGlobal::realTimePriority + 2;
}
}
- if(midiRTPrioOverride > 0)
- midiprio = midiRTPrioOverride;
+ if(MusEGlobal::midiRTPrioOverride > 0)
+ midiprio = MusEGlobal::midiRTPrioOverride;
- // FIXME FIXME: The realTimePriority of the Jack thread seems to always be 5 less than the value passed to jackd command.
- //if(midiprio == realTimePriority)
+ // FIXME FIXME: The MusEGlobal::realTimePriority of the Jack thread seems to always be 5 less than the value passed to jackd command.
+ //if(midiprio == MusEGlobal::realTimePriority)
// printf("MusE: WARNING: Midi realtime priority %d is the same as audio realtime priority %d. Try a different setting.\n",
- // midiprio, realTimePriority);
+ // midiprio, MusEGlobal::realTimePriority);
//if(midiprio == pfprio)
// printf("MusE: WARNING: Midi realtime priority %d is the same as audio prefetch realtime priority %d. Try a different setting.\n",
// midiprio, pfprio);
@@ -193,9 +213,9 @@ bool MusE::seqStart()
audioPrefetch->msgSeek(0, true); // force
- //midiSeqRunning = !midiSeq->start(realTimeScheduling ? realTimePriority : 0);
+ //MusEGlobal::midiSeqRunning = !midiSeq->start(MusEGlobal::realTimeScheduling ? MusEGlobal::realTimePriority : 0);
// Changed by Tim. p3.3.22
- //midiSeq->start(realTimeScheduling ? realTimePriority : 0);
+ //midiSeq->start(MusEGlobal::realTimeScheduling ? MusEGlobal::realTimePriority : 0);
midiSeq->start(midiprio);
int counter=0;
@@ -205,14 +225,14 @@ bool MusE::seqStart()
fprintf(stderr,"midi sequencer thread does not start!? Exiting...\n");
exit(33);
}
- midiSeqRunning = midiSeq->isRunning();
- if (midiSeqRunning)
+ MusEGlobal::midiSeqRunning = midiSeq->isRunning();
+ if (MusEGlobal::midiSeqRunning)
break;
usleep(1000);
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("looping waiting for sequencer thread to start\n");
}
- if(!midiSeqRunning)
+ if(!MusEGlobal::midiSeqRunning)
{
fprintf(stderr, "midiSeq is not running! Exiting...\n");
exit(33);
@@ -227,14 +247,14 @@ bool MusE::seqStart()
void MusE::seqStop()
{
// label sequencer as disabled before it actually happened to minimize race condition
- midiSeqRunning = false;
+ MusEGlobal::midiSeqRunning = false;
song->setStop(true);
song->setStopPlay(false);
midiSeq->stop(true);
audio->stop(true);
audioPrefetch->stop(true);
- if (realTimeScheduling && watchdogThread)
+ if (MusEGlobal::realTimeScheduling && watchdogThread)
pthread_cancel(watchdogThread);
}
@@ -301,7 +321,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow()
setIconSize(ICON_SIZE);
setFocusPolicy(Qt::WheelFocus);
//setFocusPolicy(Qt::NoFocus);
- muse = this; // hack
+ MusEGlobal::muse = this; // hack
clipListEdit = 0;
midiSyncConfig = 0;
midiRemoteConfig = 0;
@@ -338,9 +358,9 @@ MusE::MusE(int argc, char** argv) : QMainWindow()
song = new Song("song");
song->blockSignals(true);
- heartBeatTimer = new QTimer(this);
- heartBeatTimer->setObjectName("timer");
- connect(heartBeatTimer, SIGNAL(timeout()), song, SLOT(beat()));
+ MusEGlobal::heartBeatTimer = new QTimer(this);
+ MusEGlobal::heartBeatTimer->setObjectName("timer");
+ connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), song, SLOT(beat()));
connect(this, SIGNAL(activeTopWinChanged(TopWin*)), SLOT(activeTopWinChangedSlot(TopWin*)));
@@ -363,97 +383,97 @@ MusE::MusE(int argc, char** argv) : QMainWindow()
// undo/redo
//---------------------------------------------------
- undoRedo = new QActionGroup(this);
- undoRedo->setExclusive(false);
- undoAction = new QAction(QIcon(*undoIconS), tr("Und&o"),
- undoRedo);
- redoAction = new QAction(QIcon(*redoIconS), tr("Re&do"),
- undoRedo);
+ MusEGlobal::undoRedo = new QActionGroup(this);
+ MusEGlobal::undoRedo->setExclusive(false);
+ MusEGlobal::undoAction = new QAction(QIcon(*undoIconS), tr("Und&o"),
+ MusEGlobal::undoRedo);
+ MusEGlobal::redoAction = new QAction(QIcon(*redoIconS), tr("Re&do"),
+ MusEGlobal::undoRedo);
- undoAction->setWhatsThis(tr("undo last change to song"));
- redoAction->setWhatsThis(tr("redo last undo"));
- undoAction->setEnabled(false);
- redoAction->setEnabled(false);
- connect(redoAction, SIGNAL(activated()), song, SLOT(redo()));
- connect(undoAction, SIGNAL(activated()), song, SLOT(undo()));
+ MusEGlobal::undoAction->setWhatsThis(tr("undo last change to song"));
+ MusEGlobal::redoAction->setWhatsThis(tr("redo last undo"));
+ MusEGlobal::undoAction->setEnabled(false);
+ MusEGlobal::redoAction->setEnabled(false);
+ connect(MusEGlobal::redoAction, SIGNAL(activated()), song, SLOT(redo()));
+ connect(MusEGlobal::undoAction, SIGNAL(activated()), song, SLOT(undo()));
//---------------------------------------------------
// Transport
//---------------------------------------------------
- transportAction = new QActionGroup(this);
- transportAction->setExclusive(false);
+ MusEGlobal::transportAction = new QActionGroup(this);
+ MusEGlobal::transportAction->setExclusive(false);
- loopAction = new QAction(QIcon(*loop1Icon),
- tr("Loop"), transportAction);
- loopAction->setCheckable(true);
+ MusEGlobal::loopAction = new QAction(QIcon(*loop1Icon),
+ tr("Loop"), MusEGlobal::transportAction);
+ MusEGlobal::loopAction->setCheckable(true);
- loopAction->setWhatsThis(tr(infoLoopButton));
- connect(loopAction, SIGNAL(toggled(bool)), song, SLOT(setLoop(bool)));
+ MusEGlobal::loopAction->setWhatsThis(tr(infoLoopButton));
+ connect(MusEGlobal::loopAction, SIGNAL(toggled(bool)), song, SLOT(setLoop(bool)));
- punchinAction = new QAction(QIcon(*punchin1Icon),
- tr("Punchin"), transportAction);
- punchinAction->setCheckable(true);
+ MusEGlobal::punchinAction = new QAction(QIcon(*punchin1Icon),
+ tr("Punchin"), MusEGlobal::transportAction);
+ MusEGlobal::punchinAction->setCheckable(true);
- punchinAction->setWhatsThis(tr(infoPunchinButton));
- connect(punchinAction, SIGNAL(toggled(bool)), song, SLOT(setPunchin(bool)));
+ MusEGlobal::punchinAction->setWhatsThis(tr(infoPunchinButton));
+ connect(MusEGlobal::punchinAction, SIGNAL(toggled(bool)), song, SLOT(setPunchin(bool)));
- punchoutAction = new QAction(QIcon(*punchout1Icon),
- tr("Punchout"), transportAction);
- punchoutAction->setCheckable(true);
+ MusEGlobal::punchoutAction = new QAction(QIcon(*punchout1Icon),
+ tr("Punchout"), MusEGlobal::transportAction);
+ MusEGlobal::punchoutAction->setCheckable(true);
- punchoutAction->setWhatsThis(tr(infoPunchoutButton));
- connect(punchoutAction, SIGNAL(toggled(bool)), song, SLOT(setPunchout(bool)));
+ MusEGlobal::punchoutAction->setWhatsThis(tr(infoPunchoutButton));
+ connect(MusEGlobal::punchoutAction, SIGNAL(toggled(bool)), song, SLOT(setPunchout(bool)));
QAction *tseparator = new QAction(this);
tseparator->setSeparator(true);
- transportAction->addAction(tseparator);
+ MusEGlobal::transportAction->addAction(tseparator);
- startAction = new QAction(QIcon(*startIcon),
- tr("Start"), transportAction);
+ MusEGlobal::startAction = new QAction(QIcon(*startIcon),
+ tr("Start"), MusEGlobal::transportAction);
- startAction->setWhatsThis(tr(infoStartButton));
- connect(startAction, SIGNAL(activated()), song, SLOT(rewindStart()));
+ MusEGlobal::startAction->setWhatsThis(tr(infoStartButton));
+ connect(MusEGlobal::startAction, SIGNAL(activated()), song, SLOT(rewindStart()));
- rewindAction = new QAction(QIcon(*frewindIcon),
- tr("Rewind"), transportAction);
+ MusEGlobal::rewindAction = new QAction(QIcon(*frewindIcon),
+ tr("Rewind"), MusEGlobal::transportAction);
- rewindAction->setWhatsThis(tr(infoRewindButton));
- connect(rewindAction, SIGNAL(activated()), song, SLOT(rewind()));
+ MusEGlobal::rewindAction->setWhatsThis(tr(infoRewindButton));
+ connect(MusEGlobal::rewindAction, SIGNAL(activated()), song, SLOT(rewind()));
- forwardAction = new QAction(QIcon(*fforwardIcon),
- tr("Forward"), transportAction);
+ MusEGlobal::forwardAction = new QAction(QIcon(*fforwardIcon),
+ tr("Forward"), MusEGlobal::transportAction);
- forwardAction->setWhatsThis(tr(infoForwardButton));
- connect(forwardAction, SIGNAL(activated()), song, SLOT(forward()));
+ MusEGlobal::forwardAction->setWhatsThis(tr(infoForwardButton));
+ connect(MusEGlobal::forwardAction, SIGNAL(activated()), song, SLOT(forward()));
- stopAction = new QAction(QIcon(*stopIcon),
- tr("Stop"), transportAction);
- stopAction->setCheckable(true);
+ MusEGlobal::stopAction = new QAction(QIcon(*stopIcon),
+ tr("Stop"), MusEGlobal::transportAction);
+ MusEGlobal::stopAction->setCheckable(true);
- stopAction->setWhatsThis(tr(infoStopButton));
- stopAction->setChecked(true);
- connect(stopAction, SIGNAL(toggled(bool)), song, SLOT(setStop(bool)));
+ MusEGlobal::stopAction->setWhatsThis(tr(infoStopButton));
+ MusEGlobal::stopAction->setChecked(true);
+ connect(MusEGlobal::stopAction, SIGNAL(toggled(bool)), song, SLOT(setStop(bool)));
- playAction = new QAction(QIcon(*playIcon),
- tr("Play"), transportAction);
- playAction->setCheckable(true);
+ MusEGlobal::playAction = new QAction(QIcon(*playIcon),
+ tr("Play"), MusEGlobal::transportAction);
+ MusEGlobal::playAction->setCheckable(true);
- playAction->setWhatsThis(tr(infoPlayButton));
- playAction->setChecked(false);
- connect(playAction, SIGNAL(toggled(bool)), song, SLOT(setPlay(bool)));
+ MusEGlobal::playAction->setWhatsThis(tr(infoPlayButton));
+ MusEGlobal::playAction->setChecked(false);
+ connect(MusEGlobal::playAction, SIGNAL(toggled(bool)), song, SLOT(setPlay(bool)));
- recordAction = new QAction(QIcon(*recordIcon),
- tr("Record"), transportAction);
- recordAction->setCheckable(true);
- recordAction->setWhatsThis(tr(infoRecordButton));
- connect(recordAction, SIGNAL(toggled(bool)), song, SLOT(setRecord(bool)));
+ MusEGlobal::recordAction = new QAction(QIcon(*recordIcon),
+ tr("Record"), MusEGlobal::transportAction);
+ MusEGlobal::recordAction->setCheckable(true);
+ MusEGlobal::recordAction->setWhatsThis(tr(infoRecordButton));
+ connect(MusEGlobal::recordAction, SIGNAL(toggled(bool)), song, SLOT(setRecord(bool)));
- panicAction = new QAction(QIcon(*panicIcon),
+ MusEGlobal::panicAction = new QAction(QIcon(*panicIcon),
tr("Panic"), this);
- panicAction->setWhatsThis(tr(infoPanicButton));
- connect(panicAction, SIGNAL(activated()), song, SLOT(panic()));
+ MusEGlobal::panicAction->setWhatsThis(tr(infoPanicButton));
+ connect(MusEGlobal::panicAction, SIGNAL(activated()), song, SLOT(panic()));
initMidiInstruments();
initMidiPorts();
@@ -594,7 +614,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow()
//-------- View connections
connect(viewTransportAction, SIGNAL(toggled(bool)), SLOT(toggleTransport(bool)));
- connect(viewBigtimeAction, SIGNAL(toggled(bool)), SLOT(toggleBigTime(bool)));
+ connect(viewBigtimeAction, SIGNAL(toggled(bool)), SLOT(toggleMusEWidget::BigTime(bool)));
connect(viewMixerAAction, SIGNAL(toggled(bool)),SLOT(toggleMixer1(bool)));
connect(viewMixerBAction, SIGNAL(toggled(bool)), SLOT(toggleMixer2(bool)));
connect(viewCliplistAction, SIGNAL(toggled(bool)), SLOT(startClipList(bool)));
@@ -676,15 +696,15 @@ MusE::MusE(int argc, char** argv) : QMainWindow()
QToolBar* undoToolbar = addToolBar(tr("Undo/Redo"));
undoToolbar->setObjectName("Undo/Redo (global)");
- undoToolbar->addActions(undoRedo->actions());
+ undoToolbar->addActions(MusEGlobal::undoRedo->actions());
QToolBar* transportToolbar = addToolBar(tr("Transport"));
transportToolbar->setObjectName("Transport (global)");
- transportToolbar->addActions(transportAction->actions());
+ transportToolbar->addActions(MusEGlobal::transportAction->actions());
QToolBar* panicToolbar = addToolBar(tr("Panic"));
panicToolbar->setObjectName("Panic (global)");
- panicToolbar->addAction(panicAction);
+ panicToolbar->addAction(MusEGlobal::panicAction);
requiredToolbars.push_back(tools);
optionalToolbars.push_back(undoToolbar);
@@ -696,22 +716,22 @@ MusE::MusE(int argc, char** argv) : QMainWindow()
//getrlimit(RLIMIT_RTPRIO, &lim);
//printf("RLIMIT_RTPRIO soft:%d hard:%d\n", lim.rlim_cur, lim.rlim_max); // Reported 80, 80 even with non-RT kernel.
- if (realTimePriority < sched_get_priority_min(SCHED_FIFO))
- realTimePriority = sched_get_priority_min(SCHED_FIFO);
- else if (realTimePriority > sched_get_priority_max(SCHED_FIFO))
- realTimePriority = sched_get_priority_max(SCHED_FIFO);
+ if (MusEGlobal::realTimePriority < sched_get_priority_min(SCHED_FIFO))
+ MusEGlobal::realTimePriority = sched_get_priority_min(SCHED_FIFO);
+ else if (MusEGlobal::realTimePriority > sched_get_priority_max(SCHED_FIFO))
+ MusEGlobal::realTimePriority = sched_get_priority_max(SCHED_FIFO);
// If we requested to force the midi thread priority...
- if(midiRTPrioOverride > 0)
+ if(MusEGlobal::midiRTPrioOverride > 0)
{
- if (midiRTPrioOverride < sched_get_priority_min(SCHED_FIFO))
- midiRTPrioOverride = sched_get_priority_min(SCHED_FIFO);
- else if (midiRTPrioOverride > sched_get_priority_max(SCHED_FIFO))
- midiRTPrioOverride = sched_get_priority_max(SCHED_FIFO);
+ if (MusEGlobal::midiRTPrioOverride < sched_get_priority_min(SCHED_FIFO))
+ MusEGlobal::midiRTPrioOverride = sched_get_priority_min(SCHED_FIFO);
+ else if (MusEGlobal::midiRTPrioOverride > sched_get_priority_max(SCHED_FIFO))
+ MusEGlobal::midiRTPrioOverride = sched_get_priority_max(SCHED_FIFO);
}
// Changed by Tim. p3.3.17
- //midiSeq = new MidiSeq(realTimeScheduling ? realTimePriority : 0, "Midi");
+ //midiSeq = new MidiSeq(MusEGlobal::realTimeScheduling ? MusEGlobal::realTimePriority : 0, "Midi");
midiSeq = new MidiSeq("Midi");
audio = new Audio();
//audioPrefetch = new AudioPrefetch(0, "Disc");
@@ -919,7 +939,7 @@ MusE::MusE(int argc, char** argv) : QMainWindow()
// read list of "Recent Projects"
//---------------------------------------------------
- QString prjPath(configPath);
+ QString prjPath(MusEGlobal::configPath);
prjPath += QString("/projects");
FILE* f = fopen(prjPath.toLatin1().constData(), "r");
if (f == 0) {
@@ -962,21 +982,21 @@ MusE::MusE(int argc, char** argv) : QMainWindow()
bool useTemplate = false;
if (argc >= 2)
name = argv[0];
- else if (config.startMode == 0) {
+ else if (MusEConfig::config.startMode == 0) {
if (argc < 2)
name = projectList[0] ? *projectList[0] : QString("untitled");
else
name = argv[0];
- printf("starting with selected song %s\n", config.startSong.toLatin1().constData());
+ printf("starting with selected song %s\n", MusEConfig::config.startSong.toLatin1().constData());
}
- else if (config.startMode == 1) {
+ else if (MusEConfig::config.startMode == 1) {
printf("starting with default template\n");
- name = museGlobalShare + QString("/templates/default.med");
+ name = MusEGlobal::museGlobalShare + QString("/templates/default.med");
useTemplate = true;
}
- else if (config.startMode == 2) {
- printf("starting with pre configured song %s\n", config.startSong.toLatin1().constData());
- name = config.startSong;
+ else if (MusEConfig::config.startMode == 2) {
+ printf("starting with pre configured song %s\n", MusEConfig::config.startSong.toLatin1().constData());
+ name = MusEConfig::config.startSong;
}
song->blockSignals(false);
loadProjectFile(name, useTemplate, true);
@@ -1001,7 +1021,7 @@ MusE::~MusE()
void MusE::setHeartBeat()
{
- heartBeatTimer->start(1000/config.guiRefresh);
+ MusEGlobal::heartBeatTimer->start(1000/MusEConfig::config.guiRefresh);
}
//---------------------------------------------------------
@@ -1146,11 +1166,11 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll
return;
}
project.setFile("untitled");
- museProject = museProjectInitPath;
+ MusEGlobal::museProject = MusEGlobal::museProjectInitPath;
}
else {
printf("Setting project path to %s\n", fi.absolutePath().toLatin1().constData());
- museProject = fi.absolutePath();
+ MusEGlobal::museProject = fi.absolutePath();
project.setFile(name);
}
// Changed by T356. 01/19/2010. We want the complete extension here.
@@ -1168,7 +1188,7 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll
// read *.med file
//
bool popenFlag;
- FILE* f = fileOpen(this, fi.filePath(), QString(".med"), "r", popenFlag, true);
+ FILE* f = MusEWidget::fileOpen(this, fi.filePath(), QString(".med"), "r", popenFlag, true);
if (f == 0) {
if (errno != ENOENT) {
QMessageBox::critical(this, QString("MusE"),
@@ -1208,53 +1228,53 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll
song->dirty = false;
progress->setValue(30);
- viewTransportAction->setChecked(config.transportVisible);
- viewBigtimeAction->setChecked(config.bigTimeVisible);
- viewMarkerAction->setChecked(config.markerVisible);
- viewArrangerAction->setChecked(config.arrangerVisible);
+ viewTransportAction->setChecked(MusEConfig::config.transportVisible);
+ viewBigtimeAction->setChecked(MusEConfig::config.bigTimeVisible);
+ viewMarkerAction->setChecked(MusEConfig::config.markerVisible);
+ viewArrangerAction->setChecked(MusEConfig::config.arrangerVisible);
- autoMixerAction->setChecked(automation);
+ autoMixerAction->setChecked(MusEGlobal::automation);
if (loadAll) {
- showBigtime(config.bigTimeVisible);
- //showMixer(config.mixerVisible);
- showMixer1(config.mixer1Visible);
- showMixer2(config.mixer2Visible);
+ showBigtime(MusEConfig::config.bigTimeVisible);
+ //showMixer(MusEConfig::config.mixerVisible);
+ showMixer1(MusEConfig::config.mixer1Visible);
+ showMixer2(MusEConfig::config.mixer2Visible);
// Added p3.3.43 Make sure the geometry is correct because showMixerX() will NOT
// set the geometry if the mixer has already been created.
if(mixer1)
{
- //if(mixer1->geometry().size() != config.mixer1.geometry.size()) // p3.3.53 Moved below
- // mixer1->resize(config.mixer1.geometry.size());
+ //if(mixer1->geometry().size() != MusEConfig::config.mixer1.geometry.size()) // p3.3.53 Moved below
+ // mixer1->resize(MusEConfig::config.mixer1.geometry.size());
- if(mixer1->geometry().topLeft() != config.mixer1.geometry.topLeft())
- mixer1->move(config.mixer1.geometry.topLeft());
+ if(mixer1->geometry().topLeft() != MusEConfig::config.mixer1.geometry.topLeft())
+ mixer1->move(MusEConfig::config.mixer1.geometry.topLeft());
}
if(mixer2)
{
- //if(mixer2->geometry().size() != config.mixer2.geometry.size()) // p3.3.53 Moved below
- // mixer2->resize(config.mixer2.geometry.size());
+ //if(mixer2->geometry().size() != MusEConfig::config.mixer2.geometry.size()) // p3.3.53 Moved below
+ // mixer2->resize(MusEConfig::config.mixer2.geometry.size());
- if(mixer2->geometry().topLeft() != config.mixer2.geometry.topLeft())
- mixer2->move(config.mixer2.geometry.topLeft());
+ if(mixer2->geometry().topLeft() != MusEConfig::config.mixer2.geometry.topLeft())
+ mixer2->move(MusEConfig::config.mixer2.geometry.topLeft());
}
- //showMarker(config.markerVisible); // Moved below. Tim.
- resize(config.geometryMain.size());
- move(config.geometryMain.topLeft());
+ //showMarker(MusEConfig::config.markerVisible); // Moved below. Tim.
+ resize(MusEConfig::config.geometryMain.size());
+ move(MusEConfig::config.geometryMain.topLeft());
- if (config.transportVisible)
+ if (MusEConfig::config.transportVisible)
transport->show();
- transport->move(config.geometryTransport.topLeft());
- showTransport(config.transportVisible);
+ transport->move(MusEConfig::config.geometryTransport.topLeft());
+ showTransport(MusEConfig::config.transportVisible);
}
progress->setValue(40);
transport->setMasterFlag(song->masterFlag());
- punchinAction->setChecked(song->punchin());
- punchoutAction->setChecked(song->punchout());
- loopAction->setChecked(song->loop());
+ MusEGlobal::punchinAction->setChecked(song->punchin());
+ MusEGlobal::punchoutAction->setChecked(song->punchout());
+ MusEGlobal::loopAction->setChecked(song->loop());
song->update();
song->updatePos();
arrangerView->clipboardChanged(); // enable/disable "Paste"
@@ -1267,32 +1287,32 @@ void MusE::loadProjectFile1(const QString& name, bool songTemplate, bool loadAll
{
if(mixer1)
{
- if(mixer1->geometry().size() != config.mixer1.geometry.size())
+ if(mixer1->geometry().size() != MusEConfig::config.mixer1.geometry.size())
{
- //printf("MusE::loadProjectFile1 resizing mixer1 x:%d y:%d w:%d h:%d\n", config.mixer1.geometry.x(),
- // config.mixer1.geometry.y(),
- // config.mixer1.geometry.width(),
- // config.mixer1.geometry.height()
+ //printf("MusE::loadProjectFile1 resizing mixer1 x:%d y:%d w:%d h:%d\n", MusEConfig::config.mixer1.geometry.x(),
+ // MusEConfig::config.mixer1.geometry.y(),
+ // MusEConfig::config.mixer1.geometry.width(),
+ // MusEConfig::config.mixer1.geometry.height()
// );
- mixer1->resize(config.mixer1.geometry.size());
+ mixer1->resize(MusEConfig::config.mixer1.geometry.size());
}
}
if(mixer2)
{
- if(mixer2->geometry().size() != config.mixer2.geometry.size())
+ if(mixer2->geometry().size() != MusEConfig::config.mixer2.geometry.size())
{
- //printf("MusE::loadProjectFile1 resizing mixer2 x:%d y:%d w:%d h:%d\n", config.mixer2.geometry.x(),
- // config.mixer2.geometry.y(),
- // config.mixer2.geometry.width(),
- // config.mixer2.geometry.height()
+ //printf("MusE::loadProjectFile1 resizing mixer2 x:%d y:%d w:%d h:%d\n", MusEConfig::config.mixer2.geometry.x(),
+ // MusEConfig::config.mixer2.geometry.y(),
+ // MusEConfig::config.mixer2.geometry.width(),
+ // MusEConfig::config.mixer2.geometry.height()
// );
- mixer2->resize(config.mixer2.geometry.size());
+ mixer2->resize(MusEConfig::config.mixer2.geometry.size());
}
}
// Moved here from above due to crash with a song loaded and then File->New.
// Marker view list was not updated, had non-existent items from marker list (cleared in ::clear()).
- showMarker(config.markerVisible);
+ showMarker(MusEConfig::config.markerVisible);
}
if (songTemplate)
@@ -1323,7 +1343,7 @@ void MusE::setUntitledProject()
{
setConfigDefaults();
QString name("untitled");
- museProject = "./"; //QFileInfo(name).absolutePath();
+ MusEGlobal::museProject = "./"; //QFileInfo(name).absolutePath();
project.setFile(name);
setWindowTitle(tr("MusE: Song: ") + project.completeBaseName());
}
@@ -1358,10 +1378,10 @@ void MusE::setFollow()
void MusE::loadProject()
{
bool loadAll;
- QString fn = getOpenFileName(QString(""), med_file_pattern, this,
+ QString fn = MusEWidget::getOpenFileName(QString(""), MusEGlobal::med_file_pattern, this,
tr("MusE: load project"), &loadAll);
if (!fn.isEmpty()) {
- museProject = QFileInfo(fn).absolutePath();
+ MusEGlobal::museProject = QFileInfo(fn).absolutePath();
loadProjectFile(fn, false, loadAll);
}
}
@@ -1372,10 +1392,10 @@ void MusE::loadProject()
void MusE::loadTemplate()
{
- QString fn = getOpenFileName(QString("templates"), med_file_pattern, this,
- tr("MusE: load template"), 0, MFileDialog::GLOBAL_VIEW);
+ QString fn = MusEWidget::getOpenFileName(QString("templates"), MusEGlobal::med_file_pattern, this,
+ tr("MusE: load template"), 0, MusEWidget::MFileDialog::GLOBAL_VIEW);
if (!fn.isEmpty()) {
- // museProject = QFileInfo(fn).absolutePath();
+ // MusEGlobal::museProject = QFileInfo(fn).absolutePath();
loadProjectFile(fn, true, true);
// With templates, don't clear midi ports.
@@ -1425,7 +1445,7 @@ bool MusE::save(const QString& name, bool overwriteWarn)
system(backupCommand.toLatin1().constData());
bool popenFlag;
- FILE* f = fileOpen(this, name, QString(".med"), "w", popenFlag, false, overwriteWarn);
+ FILE* f = MusEWidget::fileOpen(this, name, QString(".med"), "w", popenFlag, false, overwriteWarn);
if (f == 0)
return false;
Xml xml(f);
@@ -1508,7 +1528,7 @@ void MusE::closeEvent(QCloseEvent* event)
writeGlobalConfiguration();
// save "Open Recent" list
- QString prjPath(configPath);
+ QString prjPath(MusEGlobal::configPath);
prjPath += "/projects";
FILE* f = fopen(prjPath.toLatin1().constData(), "w");
if (f) {
@@ -1517,13 +1537,13 @@ void MusE::closeEvent(QCloseEvent* event)
}
fclose(f);
}
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MusE: Exiting JackAudio\n");
exitJackAudio();
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MusE: Exiting DummyAudio\n");
exitDummyAudio();
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MusE: Exiting Metronome\n");
exitMetronome();
@@ -1545,7 +1565,7 @@ void MusE::closeEvent(QCloseEvent* event)
// delete *i;
song->cleanupForQuit();
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("Muse: Cleaning up temporary wavefiles + peakfiles\n");
// Cleanup temporary wavefiles + peakfiles used for undo
for (std::list<QString>::iterator i = temporaryWavFiles.begin(); i != temporaryWavFiles.end(); i++) {
@@ -1560,18 +1580,18 @@ void MusE::closeEvent(QCloseEvent* event)
// Disconnect gracefully from LASH. Tim. p3.3.14
if(lash_client)
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MusE: Disconnecting from LASH\n");
lash_event_t* lashev = lash_event_new_with_type (LASH_Quit);
lash_send_event(lash_client, lashev);
}
#endif
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MusE: Exiting Dsp\n");
AL::exitDsp();
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MusE: Exiting OSC\n");
exitOSC();
@@ -1687,10 +1707,10 @@ void MusE::showTransport(bool flag)
// by audio strip, midi strip, and midi trackinfo.
//---------------------------------------------------------
-RoutePopupMenu* MusE::getRoutingPopupMenu()
+MusEWidget::RoutePopupMenu* MusE::getRoutingPopupMenu()
{
if(!routingPopupMenu)
- routingPopupMenu = new RoutePopupMenu(this);
+ routingPopupMenu = new MusEWidget::RoutePopupMenu(this);
return routingPopupMenu;
}
@@ -1701,9 +1721,9 @@ RoutePopupMenu* MusE::getRoutingPopupMenu()
bool MusE::saveAs()
{
QString name;
- if (museProject == museProjectInitPath ) {
- if (config.useProjectSaveDialog) {
- ProjectCreateImpl pci(muse);
+ if (MusEGlobal::museProject == MusEGlobal::museProjectInitPath ) {
+ if (MusEConfig::config.useProjectSaveDialog) {
+ MusEWidget::ProjectCreateImpl pci(MusEGlobal::muse);
if (pci.exec() == QDialog::Rejected) {
return false;
}
@@ -1711,25 +1731,25 @@ bool MusE::saveAs()
song->setSongInfo(pci.getSongInfo(), true);
name = pci.getProjectPath();
} else {
- name = getSaveFileName(QString(""), med_file_save_pattern, this, tr("MusE: Save As"));
+ name = MusEWidget::getSaveFileName(QString(""), MusEGlobal::med_file_save_pattern, this, tr("MusE: Save As"));
if (name.isEmpty())
return false;
}
- museProject = QFileInfo(name).absolutePath();
+ MusEGlobal::museProject = QFileInfo(name).absolutePath();
QDir dirmanipulator;
- if (!dirmanipulator.mkpath(museProject)) {
+ if (!dirmanipulator.mkpath(MusEGlobal::museProject)) {
QMessageBox::warning(this,"Path error","Can't create project path", QMessageBox::Ok);
return false;
}
}
else {
- name = getSaveFileName(QString(""), med_file_save_pattern, this, tr("MusE: Save As"));
+ name = MusEWidget::getSaveFileName(QString(""), MusEGlobal::med_file_save_pattern, this, tr("MusE: Save As"));
}
bool ok = false;
if (!name.isEmpty()) {
- QString tempOldProj = museProject;
- museProject = QFileInfo(name).absolutePath();
+ QString tempOldProj = MusEGlobal::museProject;
+ MusEGlobal::museProject = QFileInfo(name).absolutePath();
ok = save(name, true);
if (ok) {
project.setFile(name);
@@ -1737,7 +1757,7 @@ bool MusE::saveAs()
addProject(name);
}
else
- museProject = tempOldProj;
+ MusEGlobal::museProject = tempOldProj;
}
return ok;
@@ -1856,7 +1876,7 @@ void MusE::startPianoroll(PartList* pl, bool showDefaultCtrls)
pianoroll->show();
toplevels.push_back(pianoroll);
connect(pianoroll, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
- connect(muse, SIGNAL(configChanged()), pianoroll, SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), pianoroll, SLOT(configChanged()));
updateWindowMenu();
}
@@ -1878,7 +1898,7 @@ void MusE::startListEditor(PartList* pl)
listEditor->show();
toplevels.push_back(listEditor);
connect(listEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
- connect(muse,SIGNAL(configChanged()), listEditor, SLOT(configChanged()));
+ connect(MusEGlobal::muse,SIGNAL(configChanged()), listEditor, SLOT(configChanged()));
updateWindowMenu();
}
@@ -1905,7 +1925,7 @@ void MusE::startLMasterEditor()
lmaster->show();
toplevels.push_back(lmaster);
connect(lmaster, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
- connect(muse, SIGNAL(configChanged()), lmaster, SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), lmaster, SLOT(configChanged()));
updateWindowMenu();
}
@@ -1930,7 +1950,7 @@ void MusE::startDrumEditor(PartList* pl, bool showDefaultCtrls)
drumEditor->show();
toplevels.push_back(drumEditor);
connect(drumEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
- connect(muse, SIGNAL(configChanged()), drumEditor, SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), drumEditor, SLOT(configChanged()));
updateWindowMenu();
}
@@ -1952,7 +1972,7 @@ void MusE::startWaveEditor(PartList* pl)
{
WaveEdit* waveEditor = new WaveEdit(pl);
waveEditor->show();
- connect(muse, SIGNAL(configChanged()), waveEditor, SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), waveEditor, SLOT(configChanged()));
toplevels.push_back(waveEditor);
connect(waveEditor, SIGNAL(deleted(TopWin*)), SLOT(toplevelDeleted(TopWin*)));
updateWindowMenu();
@@ -1964,7 +1984,7 @@ void MusE::startWaveEditor(PartList* pl)
//---------------------------------------------------------
void MusE::startSongInfo(bool editable)
{
- SongInfoWidget info;
+ MusEWidget::SongInfoWidget info;
info.viewCheckBox->setChecked(song->showSongInfoOnStartup());
info.viewCheckBox->setEnabled(editable);
info.songInfoText->setPlainText(song->getSongInfo());
@@ -1984,15 +2004,15 @@ void MusE::startSongInfo(bool editable)
//---------------------------------------------------------
void MusE::showDidYouKnowDialog()
{
- if ((bool)config.showDidYouKnow == true) {
- DidYouKnowWidget dyk;
+ if ((bool)MusEConfig::config.showDidYouKnow == true) {
+ MusEWidget::DidYouKnowWidget dyk;
dyk.tipText->setText("To get started with MusE why don't you try some demo songs available at http://demos.muse-sequencer.org/");
dyk.show();
if( dyk.exec()) {
if (dyk.dontShowCheckBox->isChecked()) {
//printf("disables dialog!\n");
- config.showDidYouKnow=false;
- muse->changeConfig(true); // save settings
+ MusEConfig::config.showDidYouKnow=false;
+ MusEGlobal::muse->changeConfig(true); // save settings
}
}
}
@@ -2126,7 +2146,7 @@ void MusE::kbAccel(int key)
if (audio->isPlaying())
//song->setStopPlay(false);
song->setStop(true);
- else if (!config.useOldStyleStopShortCut)
+ else if (!MusEConfig::config.useOldStyleStopShortCut)
song->setPlay(true);
else if (song->cpos() != song->lpos())
song->setPos(0, song->lPos());
@@ -2229,7 +2249,7 @@ void MusE::kbAccel(int key)
markerView->prevMarker();
}
else {
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("unknown kbAccel 0x%x\n", key);
}
}
@@ -2242,7 +2262,7 @@ void MusE::kbAccel(int key)
#if 0
static void catchSignal(int sig)
{
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
fprintf(stderr, "MusE: signal %d catched\n", sig);
if (sig == SIGSEGV) {
fprintf(stderr, "MusE: segmentation fault\n");
@@ -2348,10 +2368,10 @@ void MusE::changeConfig(bool writeFlag)
if (writeFlag)
writeGlobalConfiguration();
- //loadStyleSheetFile(config.styleSheetFile);
- loadTheme(config.style);
- QApplication::setFont(config.fonts[0]);
- loadStyleSheetFile(config.styleSheetFile);
+ //loadStyleSheetFile(MusEConfig::config.styleSheetFile);
+ loadTheme(MusEConfig::config.style);
+ QApplication::setFont(MusEConfig::config.fonts[0]);
+ loadStyleSheetFile(MusEConfig::config.styleSheetFile);
emit configChanged();
updateConfiguration();
@@ -2364,7 +2384,7 @@ void MusE::changeConfig(bool writeFlag)
void MusE::configMetronome()
{
if (!metronomeConfig)
- metronomeConfig = new MetronomeConfig;
+ metronomeConfig = new MusEWidget::MetronomeConfig;
if(metronomeConfig->isVisible()) {
metronomeConfig->raise();
@@ -2382,7 +2402,7 @@ void MusE::configMetronome()
void MusE::configShortCuts()
{
if (!shortcutConfig)
- shortcutConfig = new ShortcutConfig(this);
+ shortcutConfig = new MusEWidget::ShortcutConfig(this);
shortcutConfig->_config_changed = false;
if (shortcutConfig->exec())
changeConfig(true);
@@ -2609,7 +2629,7 @@ bool MusE::checkRegionNotNull()
//---------------------------------------------------------
// lash_idle_cb
//---------------------------------------------------------
-#include <iostream>
+
void
MusE::lash_idle_cb ()
{
@@ -2630,7 +2650,7 @@ MusE::lash_idle_cb ()
project.setFile(ss.toAscii());
setWindowTitle(tr("MusE: Song: ") + project.completeBaseName());
addProject(ss.toAscii());
- museProject = QFileInfo(ss.toAscii()).absolutePath();
+ MusEGlobal::museProject = QFileInfo(ss.toAscii()).absolutePath();
}
lash_send_event (lash_client, event);
}
@@ -2758,12 +2778,12 @@ void MusE::startEditInstrument()
void MusE::switchMixerAutomation()
{
- automation = !automation;
+ MusEGlobal::automation = ! MusEGlobal::automation;
// Clear all pressed and touched and rec event lists.
song->clearRecAutomation(true);
// printf("automation = %d\n", automation);
- autoMixerAction->setChecked(automation);
+ autoMixerAction->setChecked(MusEGlobal::automation);
}
//---------------------------------------------------------
@@ -2816,8 +2836,8 @@ void MusE::updateConfiguration()
//menu_file->setShortcut(shortcuts[SHRT_LOAD_TEMPLATE].key, menu_ids[CMD_LOAD_TEMPLATE]); // Not used.
- undoAction->setShortcut(shortcuts[SHRT_UNDO].key);
- redoAction->setShortcut(shortcuts[SHRT_REDO].key);
+ MusEGlobal::undoAction->setShortcut(shortcuts[SHRT_UNDO].key);
+ MusEGlobal::redoAction->setShortcut(shortcuts[SHRT_REDO].key);
//editSongInfoAction has no acceleration
@@ -2881,13 +2901,13 @@ void MusE::updateConfiguration()
void MusE::showBigtime(bool on)
{
if (on && bigtime == 0) {
- bigtime = new BigTime(0);
+ bigtime = new MusEWidget::BigTime(0);
bigtime->setPos(0, song->cpos(), false);
connect(song, SIGNAL(posChanged(int, unsigned, bool)), bigtime, SLOT(setPos(int, unsigned, bool)));
- connect(muse, SIGNAL(configChanged()), bigtime, SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), bigtime, SLOT(configChanged()));
connect(bigtime, SIGNAL(closed()), SLOT(bigtimeClosed()));
- bigtime->resize(config.geometryBigTime.size());
- bigtime->move(config.geometryBigTime.topLeft());
+ bigtime->resize(MusEConfig::config.geometryBigTime.size());
+ bigtime->move(MusEConfig::config.geometryBigTime.topLeft());
}
if (bigtime)
bigtime->setVisible(on);
@@ -2895,7 +2915,7 @@ void MusE::showBigtime(bool on)
}
//---------------------------------------------------------
-// toggleBigTime
+// toggleMusEWidget::BigTime
//---------------------------------------------------------
void MusE::toggleBigTime(bool checked)
@@ -2920,10 +2940,10 @@ void MusE::bigtimeClosed()
void MusE::showMixer1(bool on)
{
if (on && mixer1 == 0) {
- mixer1 = new AudioMixerApp(this, &(config.mixer1));
+ mixer1 = new AudioMixerApp(this, &(MusEConfig::config.mixer1));
connect(mixer1, SIGNAL(closed()), SLOT(mixer1Closed()));
- mixer1->resize(config.mixer1.geometry.size());
- mixer1->move(config.mixer1.geometry.topLeft());
+ mixer1->resize(MusEConfig::config.mixer1.geometry.size());
+ mixer1->move(MusEConfig::config.mixer1.geometry.topLeft());
}
if (mixer1)
mixer1->setVisible(on);
@@ -2937,10 +2957,10 @@ void MusE::showMixer1(bool on)
void MusE::showMixer2(bool on)
{
if (on && mixer2 == 0) {
- mixer2 = new AudioMixerApp(this, &(config.mixer2));
+ mixer2 = new AudioMixerApp(this, &(MusEConfig::config.mixer2));
connect(mixer2, SIGNAL(closed()), SLOT(mixer2Closed()));
- mixer2->resize(config.mixer2.geometry.size());
- mixer2->move(config.mixer2.geometry.topLeft());
+ mixer2->resize(MusEConfig::config.mixer2.geometry.size());
+ mixer2->move(MusEConfig::config.mixer2.geometry.topLeft());
}
if (mixer2)
mixer2->setVisible(on);
@@ -3030,7 +3050,7 @@ void MusE::execUserScript(int id)
//---------------------------------------------------------
void MusE::findUnusedWaveFiles()
{
- UnusedWaveFiles unused(muse);
+ MusEWidget::UnusedWaveFiles unused(MusEGlobal::muse);
unused.exec();
}
@@ -3071,11 +3091,11 @@ void MusE::focusChanged(QWidget*, QWidget* now)
void MusE::activeTopWinChangedSlot(TopWin* win)
{
- if (debugMsg) printf("ACTIVE TOPWIN CHANGED to '%s' (%p)\n", win ? win->windowTitle().toAscii().data() : "<None>", win);
+ if (MusEGlobal::debugMsg) printf("ACTIVE TOPWIN CHANGED to '%s' (%p)\n", win ? win->windowTitle().toAscii().data() : "<None>", win);
if ((win==NULL) || (win->isMdiWin()==false))
{
- if (debugMsg) printf(" that's out of the MDI area\n");
+ if (MusEGlobal::debugMsg) printf(" that's out of the MDI area\n");
menuBar()->setFocus(Qt::MenuBarFocusReason);
}
@@ -3098,7 +3118,7 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win)
TopWin* previousMenuSharingTopwin = currentMenuSharingTopwin;
currentMenuSharingTopwin = NULL;
- if (debugMsg) printf("MENU SHARING TOPWIN CHANGED to '%s' (%p)\n", win ? win->windowTitle().toAscii().data() : "<None>", win);
+ if (MusEGlobal::debugMsg) printf("MENU SHARING TOPWIN CHANGED to '%s' (%p)\n", win ? win->windowTitle().toAscii().data() : "<None>", win);
// empty our toolbars
if (previousMenuSharingTopwin)
@@ -3106,7 +3126,7 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win)
for (list<QToolBar*>::iterator it = foreignToolbars.begin(); it!=foreignToolbars.end(); it++)
if (*it)
{
- if (debugMsg) printf(" removing sharer's toolbar '%s'\n", (*it)->windowTitle().toAscii().data());
+ if (MusEGlobal::debugMsg) printf(" removing sharer's toolbar '%s'\n", (*it)->windowTitle().toAscii().data());
removeToolBar(*it); // this does not delete *it, which is good
(*it)->setParent(NULL);
}
@@ -3118,7 +3138,7 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win)
for (list<QToolBar*>::iterator it = optionalToolbars.begin(); it!=optionalToolbars.end(); it++)
if (*it)
{
- if (debugMsg) printf(" removing optional toolbar '%s'\n", (*it)->windowTitle().toAscii().data());
+ if (MusEGlobal::debugMsg) printf(" removing optional toolbar '%s'\n", (*it)->windowTitle().toAscii().data());
removeToolBar(*it); // this does not delete *it, which is good
(*it)->setParent(NULL);
}
@@ -3138,7 +3158,7 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win)
const QList<QAction*>& actions=win->menuBar()->actions();
for (QList<QAction*>::const_iterator it=actions.begin(); it!=actions.end(); it++)
{
- if (debugMsg) printf(" menu entry '%s'\n", (*it)->text().toAscii().data());
+ if (MusEGlobal::debugMsg) printf(" menu entry '%s'\n", (*it)->text().toAscii().data());
menuBar()->addAction(*it);
}
@@ -3149,7 +3169,7 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win)
for (list<QToolBar*>::const_iterator it=toolbars.begin(); it!=toolbars.end(); it++)
if (*it)
{
- if (debugMsg) printf(" toolbar '%s'\n", (*it)->windowTitle().toAscii().data());
+ if (MusEGlobal::debugMsg) printf(" toolbar '%s'\n", (*it)->windowTitle().toAscii().data());
addToolBar(*it);
foreignToolbars.push_back(*it);
@@ -3157,7 +3177,7 @@ void MusE::setCurrentMenuSharingTopwin(TopWin* win)
}
else
{
- if (debugMsg) printf(" toolbar break\n");
+ if (MusEGlobal::debugMsg) printf(" toolbar break\n");
addToolBarBreak();
foreignToolbars.push_back(NULL);
@@ -3355,3 +3375,5 @@ void MusE::arrangeSubWindowsRows()
}
}
}
+
+} //namespace MusEApp
diff --git a/muse2/muse/app.h b/muse2/muse/app.h
index 83fb70ae..721b9c05 100644
--- a/muse2/muse/app.h
+++ b/muse2/muse/app.h
@@ -4,6 +4,21 @@
// $Id: app.h,v 1.34.2.14 2009/11/16 11:29:33 lunar_shuttle Exp $
//
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __APP_H__
@@ -28,21 +43,27 @@ class QString;
class QToolBar;
class QToolButton;
class QProgressDialog;
-class EditToolBar;
class QMdiArea;
+namespace MusEWidget {
+class BigTime;
+class EditToolBar;
+class GlobalSettingsConfig;
+class MetronomeConfig;
+class MidiSyncConfig;
+class RoutePopupMenu;
+class ShortcutConfig;
+class VisibleTracks;
+}
+
class Part;
class PartList;
class Transport;
-class BigTime;
class Arranger;
class Instrument;
-class RoutePopupMenu;
class Track;
class PrinterConfig;
-class MidiSyncConfig;
class MRConfig;
-class MetronomeConfig;
class AudioConf;
class Xml;
class AudioMixerApp;
@@ -61,7 +82,6 @@ class RhythmGen;
class MidiTrack;
class MidiInstrument;
class MidiPort;
-class ShortcutConfig;
class Appearance;
class WaveTrack;
class AudioOutput;
@@ -71,6 +91,9 @@ class Undo;
#define MENU_ADD_SYNTH_ID_BASE 0x1000
+namespace MusEApp {
+
+
//---------------------------------------------------------
// MusE
//---------------------------------------------------------
@@ -151,7 +174,7 @@ class MusE : public QMainWindow
// either the requiredToolbars or optionalToolbars list!
Transport* transport;
- BigTime* bigtime;
+ MusEWidget::BigTime* bigtime;
EditInstrument* editInstrument;
// when adding a menu to the main window, remember adding it to
@@ -161,23 +184,23 @@ class MusE : public QMainWindow
QMenu* menu_functions, *menuScriptPlugins;
// Special common menu for routes. Used (so far) by audio and midi strip, and midi trackinfo.
- RoutePopupMenu* routingPopupMenu;
+ MusEWidget::RoutePopupMenu* routingPopupMenu;
QMenu* follow;
QMenu* midiInputPlugins;
QWidget* midiPortConfig;
QWidget* softSynthesizerConfig;
- MidiSyncConfig* midiSyncConfig;
+ MusEWidget::MidiSyncConfig* midiSyncConfig;
MRConfig* midiRemoteConfig;
RhythmGen* midiRhythmGenerator;
- MetronomeConfig* metronomeConfig;
+ MusEWidget::MetronomeConfig* metronomeConfig;
AudioConf* audioConfig;
MidiFileConfig* midiFileConfig;
- GlobalSettingsConfig* globalSettingsConfig;
+ MusEWidget::GlobalSettingsConfig* globalSettingsConfig;
MidiFilterConfig* midiFilterConfig;
MidiInputTransformDialog* midiInputTransform;
- ShortcutConfig* shortcutConfig;
+ MusEWidget::ShortcutConfig* shortcutConfig;
Appearance* appearance;
AudioMixerApp* mixer1;
AudioMixerApp* mixer2;
@@ -370,7 +393,7 @@ class MusE : public QMainWindow
bool importWaveToTrack(QString& name, unsigned tick=0, Track* track=NULL);
void importPartToTrack(QString& filename, unsigned tick, Track* track);
void showTransport(bool flag);
- RoutePopupMenu* getRoutingPopupMenu();
+ MusEWidget::RoutePopupMenu* getRoutingPopupMenu();
const ToplevelList* getToplevels() { return &toplevels; }
@@ -384,3 +407,4 @@ class MusE : public QMainWindow
extern void addProject(const QString& name);
#endif
+} // namespace MusEA
diff --git a/muse2/muse/appearance.cpp b/muse2/muse/appearance.cpp
index e326e868..c26f9542 100644
--- a/muse2/muse/appearance.cpp
+++ b/muse2/muse/appearance.cpp
@@ -1,7 +1,25 @@
//=========================================================
+//=========================================================
// MusE
// Linux Music Editor
// $Id: appearance.cpp,v 1.11.2.5 2009/11/14 03:37:48 terminator356 Exp $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QAbstractButton>
@@ -104,7 +122,7 @@ Appearance::Appearance(Arranger* a, QWidget* parent)
setupUi(this);
arr = a;
color = 0;
- config = new GlobalConfigValues;
+ config = new MusEConfig::GlobalConfigValues;
lastSelectedColorItem = 0;
lastSelectedBgItem = 0;
@@ -190,7 +208,7 @@ Appearance::Appearance(Arranger* a, QWidget* parent)
new IdListViewItem(0x410, id, "Saxophon");
*/
for(int i = 0; i < NUM_PARTCOLORS; ++i)
- new IdListViewItem(0x400 + i, id, ::config.partColorNames[i]);
+ new IdListViewItem(0x400 + i, id, MusEConfig::config.partColorNames[i]);
new IdListViewItem(0x41c, aid, "part canvas background");
id = new IdListViewItem(0, aid, "Track List");
@@ -254,7 +272,7 @@ Appearance::Appearance(Arranger* a, QWidget* parent)
/*
themeComboBox->clear();
- QString cs = muse->style().name();
+ QString cs = MusEGlobal::muse->style().name();
cs = cs.lower();
themeComboBox->insertStringList(QStyleFactory::keys());
@@ -305,7 +323,7 @@ Appearance::Appearance(Arranger* a, QWidget* parent)
void Appearance::resetValues()
{
- *config = ::config; // init with global config values
+ *config = MusEConfig::config; // init with global config values
styleSheetPath->setText(config->styleSheetFile);
updateFonts();
@@ -436,7 +454,7 @@ void Appearance::resetValues()
global_bg->takeChildren();
user_bg->takeChildren();
- QDir bgdir = museGlobalShare + "/wallpapers/";
+ QDir bgdir = MusEGlobal::museGlobalShare + "/wallpapers/";
QStringList filters;
filters << "*.jpg" << "*.jpeg" << "*.png" << "*.gif";
bgdir.setNameFilters(filters);
@@ -447,10 +465,10 @@ void Appearance::resetValues()
foreach (const QString &bgfile, bglist)
{
QTreeWidgetItem* item = new QTreeWidgetItem(global_bg, 0);
- item->setData(0, Qt::UserRole, QVariant(museGlobalShare + "/wallpapers/" + bgfile));
- BgPreviewWidget* bgw = new BgPreviewWidget(museGlobalShare + "/wallpapers/" + bgfile, backgroundTree);
+ item->setData(0, Qt::UserRole, QVariant(MusEGlobal::museGlobalShare + "/wallpapers/" + bgfile));
+ BgPreviewWidget* bgw = new BgPreviewWidget(MusEGlobal::museGlobalShare + "/wallpapers/" + bgfile, backgroundTree);
backgroundTree->setItemWidget(item, 0, bgw);
- if (config->canvasBgPixmap == museGlobalShare + "/wallpapers/" + bgfile)
+ if (config->canvasBgPixmap == MusEGlobal::museGlobalShare + "/wallpapers/" + bgfile)
backgroundTree->setCurrentItem(item);
}
@@ -488,7 +506,7 @@ void Appearance::resetValues()
arrGrid->setChecked(config->canvasShowGrid);
themeComboBox->clear();
- QString cs = muse->style()->objectName();
+ QString cs = MusEGlobal::muse->style()->objectName();
//printf("Appearance::resetValues style:%s\n", cs.toAscii().data());
//printf("Appearance::resetValues App styleSheet:%s\n", qApp->styleSheet().toAscii().data());
cs = cs.toLower();
@@ -532,7 +550,7 @@ void Appearance::bgSelectionChanged(QTreeWidgetItem* item)
removeBgButton->setEnabled(true);
lastSelectedBgItem = item;
- muse->arranger->getCanvas()->setBg(QPixmap(item->data(0, Qt::UserRole).toString()));
+ MusEGlobal::muse->arranger->getCanvas()->setBg(QPixmap(item->data(0, Qt::UserRole).toString()));
}
//---------------------------------------------------------
@@ -680,8 +698,8 @@ void Appearance::apply()
config->globalAlphaBlend = globalAlphaVal->value();
// set colors...
- ::config = *config;
- muse->changeConfig(true);
+ MusEConfig::config = *config;
+ MusEGlobal::muse->changeConfig(true);
}
//---------------------------------------------------------
@@ -723,7 +741,7 @@ void Appearance::ok()
void Appearance::cancel()
{
- muse->arranger->getCanvas()->setBg(QPixmap(config->canvasBgPixmap));
+ MusEGlobal::muse->arranger->getCanvas()->setBg(QPixmap(config->canvasBgPixmap));
close();
}
@@ -734,7 +752,7 @@ void Appearance::cancel()
void Appearance::removeBackground()
{
QTreeWidgetItem* item = backgroundTree->currentItem();
- muse->arranger->getCanvas()->setBg(QPixmap());
+ MusEGlobal::muse->arranger->getCanvas()->setBg(QPixmap());
user_bg->takeChild(user_bg->indexOfChild(item));
backgroundTree->setCurrentItem (0);
removeBgButton->setEnabled(false);
@@ -747,7 +765,7 @@ void Appearance::removeBackground()
void Appearance::addBackground()
{
QString cur = getenv("HOME");
- QString user_bgfile = getImageFileName(cur, image_file_pattern, this,
+ QString user_bgfile = MusEWidget::getImageFileName(cur, MusEGlobal::image_file_pattern, this,
tr("MusE: load image"));
bool image_exists = false;
@@ -773,7 +791,7 @@ void Appearance::addBackground()
void Appearance::clearBackground()
{
- muse->arranger->getCanvas()->setBg(QPixmap());
+ MusEGlobal::muse->arranger->getCanvas()->setBg(QPixmap());
backgroundTree->setCurrentItem (0);
removeBgButton->setEnabled(false);
}
diff --git a/muse2/muse/appearance.h b/muse2/muse/appearance.h
index ec266f8e..5193f679 100644
--- a/muse2/muse/appearance.h
+++ b/muse2/muse/appearance.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/appearance.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef __APPEARANCE_H__
#define __APPEARANCE_H__
@@ -8,7 +30,9 @@ class QDialog;
class MusE;
class Arranger;
+namespace MusEConfig {
class GlobalConfigValues;
+}
//---------------------------------------------------------
// Appearance Dialog
@@ -21,7 +45,7 @@ class Appearance : public QDialog, public Ui::AppearanceDialogBase {
private:
Arranger* arr;
QColor* color;
- GlobalConfigValues* config;
+ MusEConfig::GlobalConfigValues* config;
QButtonGroup* aPalette;
QTreeWidgetItem* user_bg;
QTreeWidgetItem* global_bg;
diff --git a/muse2/muse/arranger/CMakeLists.txt b/muse2/muse/arranger/CMakeLists.txt
index b679a37a..d81d92c6 100644
--- a/muse2/muse/arranger/CMakeLists.txt
+++ b/muse2/muse/arranger/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
#
diff --git a/muse2/muse/arranger/alayout.cpp b/muse2/muse/arranger/alayout.cpp
index c7e1e4e3..f316dec9 100644
--- a/muse2/muse/arranger/alayout.cpp
+++ b/muse2/muse/arranger/alayout.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: alayout.cpp,v 1.8 2004/02/28 14:58:24 wschweer Exp $
// (C) Copyright 2002 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "alayout.h"
diff --git a/muse2/muse/arranger/alayout.h b/muse2/muse/arranger/alayout.h
index 8ba1a829..88f03e7a 100644
--- a/muse2/muse/arranger/alayout.h
+++ b/muse2/muse/arranger/alayout.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: alayout.h,v 1.3.2.1 2008/01/19 13:33:46 wschweer Exp $
// (C) Copyright 2002 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __ALAYOUT_H__
diff --git a/muse2/muse/arranger/arranger.cpp b/muse2/muse/arranger/arranger.cpp
index 03caae3e..5705b6a5 100644
--- a/muse2/muse/arranger/arranger.cpp
+++ b/muse2/muse/arranger/arranger.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: arranger.cpp,v 1.33.2.21 2009/11/17 22:08:22 terminator356 Exp $
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "config.h"
@@ -129,7 +144,7 @@ Arranger::Arranger(ArrangerView* parent, const char* name)
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
label->setIndent(3);
toolbar->addWidget(label);
- cursorPos = new PosLabel(0);
+ cursorPos = new MusEWidget::PosLabel(0);
cursorPos->setEnabled(false);
cursorPos->setFixedHeight(22);
toolbar->addWidget(cursorPos);
@@ -161,14 +176,14 @@ Arranger::Arranger(ArrangerView* parent, const char* name)
// song length is limited to 10000 bars; the real song len is limited
// by overflows in tick computations
//
- lenEntry = new SpinBox(1, 10000, 1);
+ lenEntry = new MusEWidget::SpinBox(1, 10000, 1);
lenEntry->setValue(song->len());
lenEntry->setToolTip(tr("song length - bars"));
lenEntry->setWhatsThis(tr("song length - bars"));
toolbar->addWidget(lenEntry);
connect(lenEntry, SIGNAL(valueChanged(int)), SLOT(songlenChanged(int)));
- typeBox = new LabelCombo(tr("Type"), 0);
+ typeBox = new MusEWidget::LabelCombo(tr("Type"), 0);
typeBox->insertItem(0, tr("NO"));
typeBox->insertItem(1, tr("GM"));
typeBox->insertItem(2, tr("GS"));
@@ -186,7 +201,7 @@ Arranger::Arranger(ArrangerView* parent, const char* name)
label->setIndent(3);
toolbar->addWidget(label);
- globalPitchSpinBox = new SpinBox(-127, 127, 1);
+ globalPitchSpinBox = new MusEWidget::SpinBox(-127, 127, 1);
globalPitchSpinBox->setValue(song->globalPitchShift());
globalPitchSpinBox->setToolTip(tr("midi pitch"));
globalPitchSpinBox->setWhatsThis(tr("global midi pitch shift"));
@@ -198,7 +213,7 @@ Arranger::Arranger(ArrangerView* parent, const char* name)
label->setIndent(3);
toolbar->addWidget(label);
- globalTempoSpinBox = new SpinBox(50, 200, 1, toolbar);
+ globalTempoSpinBox = new MusEWidget::SpinBox(50, 200, 1, toolbar);
globalTempoSpinBox->setSuffix(QString("%"));
globalTempoSpinBox->setValue(tempomap.globalTempo());
globalTempoSpinBox->setToolTip(tr("midi tempo"));
@@ -224,8 +239,8 @@ Arranger::Arranger(ArrangerView* parent, const char* name)
QVBoxLayout* box = new QVBoxLayout(this);
box->setContentsMargins(0, 0, 0, 0);
box->setSpacing(0);
- box->addWidget(hLine(this), Qt::AlignTop);
- //QFrame* hline = hLine(this);
+ box->addWidget(MusEUtil::hLine(this), Qt::AlignTop);
+ //QFrame* hline = MusEUtil::hLine(this);
//hline->setLineWidth(0);
//box->addWidget(hline, Qt::AlignTop);
@@ -236,7 +251,7 @@ Arranger::Arranger(ArrangerView* parent, const char* name)
int xscale = -100;
int yscale = 1;
- split = new Splitter(Qt::Horizontal, this, "split");
+ split = new MusEWidget::Splitter(Qt::Horizontal, this, "split");
split->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
box->addWidget(split, 1000);
//split->setHandleWidth(10);
@@ -278,7 +293,7 @@ Arranger::Arranger(ArrangerView* parent, const char* name)
ib->setFocusPolicy(Qt::NoFocus);
connect(ib, SIGNAL(toggled(bool)), SLOT(showTrackInfo(bool)));
- header = new Header(tracklist, "header");
+ header = new MusEWidget::Header(tracklist, "header");
header->setFixedHeight(30);
@@ -340,7 +355,7 @@ Arranger::Arranger(ArrangerView* parent, const char* name)
tgrid->wadd(1, infoScroll);
tgrid->wadd(2, header);
tgrid->wadd(3, list);
- tgrid->wadd(4, hLine(tracklist));
+ tgrid->wadd(4, MusEUtil::hLine(tracklist));
tgrid->wadd(5, ib);
//---------------------------------------------------
@@ -348,7 +363,7 @@ Arranger::Arranger(ArrangerView* parent, const char* name)
//---------------------------------------------------
int offset = AL::sigmap.ticksMeasure(0);
- hscroll = new ScrollScale(-1000, -10, xscale, song->len(), Qt::Horizontal, editor, -offset);
+ hscroll = new MusEWidget::ScrollScale(-1000, -10, xscale, song->len(), Qt::Horizontal, editor, -offset);
hscroll->setFocusPolicy(Qt::NoFocus);
ib->setFixedHeight(hscroll->sizeHint().height());
@@ -376,11 +391,11 @@ Arranger::Arranger(ArrangerView* parent, const char* name)
egrid->setContentsMargins(0, 0, 0, 0);
egrid->setSpacing(0);
- time = new MTScale(&_raster, editor, xscale);
+ time = new MusEWidget::MTScale(&_raster, editor, xscale);
time->setOrigin(-offset, 0);
canvas = new PartCanvas(&_raster, editor, xscale, yscale);
- canvas->setBg(config.partCanvasBg);
- canvas->setCanvasTools(arrangerTools);
+ canvas->setBg(MusEConfig::config.partCanvasBg);
+ canvas->setCanvasTools(MusEWidget::arrangerTools);
canvas->setOrigin(-offset, 0);
canvas->setFocus();
setFocusProxy(canvas); // once removed by Tim (r735), added by flo again
@@ -397,9 +412,9 @@ Arranger::Arranger(ArrangerView* parent, const char* name)
connect(list, SIGNAL(redirectWheelEvent(QWheelEvent*)), canvas, SLOT(redirectedWheelEvent(QWheelEvent*)));
//egrid->addMultiCellWidget(time, 0, 0, 0, 1);
- //egrid->addMultiCellWidget(hLine(editor), 1, 1, 0, 1);
+ //egrid->addMultiCellWidget(MusEUtil::hLine(editor), 1, 1, 0, 1);
egrid->addWidget(time, 0, 0, 1, 2);
- egrid->addWidget(hLine(editor), 1, 0, 1, 2);
+ egrid->addWidget(MusEUtil::hLine(editor), 1, 0, 1, 2);
egrid->addWidget(canvas, 2, 0);
egrid->addWidget(vscroll, 2, 1);
@@ -520,17 +535,17 @@ void Arranger::configChanged()
{
//printf("Arranger::configChanged\n");
- if (config.canvasBgPixmap.isEmpty()) {
- canvas->setBg(config.partCanvasBg);
+ if (MusEConfig::config.canvasBgPixmap.isEmpty()) {
+ canvas->setBg(MusEConfig::config.partCanvasBg);
canvas->setBg(QPixmap());
//printf("Arranger::configChanged - no bitmap!\n");
}
else {
- //printf("Arranger::configChanged - bitmap %s!\n", config.canvasBgPixmap.ascii());
- canvas->setBg(QPixmap(config.canvasBgPixmap));
+ //printf("Arranger::configChanged - bitmap %s!\n", MusEConfig::config.canvasBgPixmap.ascii());
+ canvas->setBg(QPixmap(MusEConfig::config.canvasBgPixmap));
}
- ///midiTrackInfo->setFont(config.fonts[2]);
+ ///midiTrackInfo->setFont(MusEConfig::config.fonts[2]);
//updateTrackInfo(type);
}
@@ -993,14 +1008,14 @@ void Arranger::genTrackInfo(QWidget* parent)
noTrackInfo->setGeometry(0, 0, 65, 200);
noTrackInfo->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Expanding));
- midiTrackInfo = new MidiTrackInfo(trackInfo);
+ midiTrackInfo = new MusEWidget::MidiTrackInfo(trackInfo);
//midiTrackInfo->setFocusPolicy(Qt::TabFocus); // p4.0.9
//midiTrackInfo->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Maximum));
trackInfo->addWidget(noTrackInfo, 0);
trackInfo->addWidget(midiTrackInfo, 1);
trackInfo->addWidget(0, 2);
-/// genMidiTrackInfo();
+/// genMusEWidget::MidiTrackInfo();
}
//---------------------------------------------------------
@@ -1046,7 +1061,7 @@ void Arranger::switchInfo(int n)
w = new AudioStrip(trackInfo, (AudioTrack*)selected);
//w->setFocusPolicy(Qt::TabFocus); // p4.0.9
connect(song, SIGNAL(songChanged(int)), w, SLOT(songChanged(int)));
- connect(muse, SIGNAL(configChanged()), w, SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), w, SLOT(configChanged()));
w->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
trackInfo->addWidget(w, 2);
w->show();
@@ -1101,11 +1116,11 @@ void Arranger::keyPressEvent(QKeyEvent* event)
void Arranger::horizontalZoomIn()
{
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl < 23)
zoomlvl++;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
@@ -1114,11 +1129,11 @@ void Arranger::horizontalZoomIn()
void Arranger::horizontalZoomOut()
{
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl > 1)
zoomlvl--;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
diff --git a/muse2/muse/arranger/arranger.h b/muse2/muse/arranger/arranger.h
index a89c4de9..1e3943be 100644
--- a/muse2/muse/arranger/arranger.h
+++ b/muse2/muse/arranger/arranger.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: arranger.h,v 1.17.2.15 2009/11/14 03:37:48 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __ARRANGER_H__
@@ -24,20 +39,24 @@ class QWheelEvent;
class QKeyEvent;
//class QStackedWidget;
-class Header;
class TList;
-class ScrollScale;
-class MTScale;
class Track;
class Xml;
-class Splitter;
-class LabelCombo;
-class PosLabel;
-class MidiTrackInfo;
class TLLayout;
class WidgetStack;
class AudioStrip;
+
+namespace MusEWidget {
+class Header;
+class LabelCombo;
+class MidiTrackInfo;
+class MTScale;
+class PosLabel;
+class ScrollScale;
+class Splitter;
class SpinBox;
+}
+
class ArrangerView;
//---------------------------------------------------------
@@ -70,33 +89,33 @@ class Arranger : public QWidget {
int _quant, _raster;
PartCanvas* canvas;
- ScrollScale* hscroll;
+ MusEWidget::ScrollScale* hscroll;
QScrollBar* vscroll;
TList* list;
- Header* header;
- MTScale* time;
- SpinBox* lenEntry;
+ MusEWidget::Header* header;
+ MusEWidget::MTScale* time;
+ MusEWidget::SpinBox* lenEntry;
bool showTrackinfoFlag;
WidgetStack* trackInfo;
//QStackedWidget* trackInfo;
QScrollBar* infoScroll;
//MidiTrackInfoBase* midiTrackInfo;
- MidiTrackInfo* midiTrackInfo;
+ MusEWidget::MidiTrackInfo* midiTrackInfo;
AudioStrip* waveTrackInfo;
QWidget* noTrackInfo;
TLLayout* tgrid;
Track* selected;
- LabelCombo* typeBox;
+ MusEWidget::LabelCombo* typeBox;
QToolButton* ib;
int trackInfoType;
- Splitter* split;
+ MusEWidget::Splitter* split;
///QMenu* pop;
int songType;
- PosLabel* cursorPos;
- SpinBox* globalTempoSpinBox;
- SpinBox* globalPitchSpinBox;
+ MusEWidget::PosLabel* cursorPos;
+ MusEWidget::SpinBox* globalTempoSpinBox;
+ MusEWidget::SpinBox* globalPitchSpinBox;
unsigned cursVal;
void genTrackInfo(QWidget* parent);
diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp
index 2ba3ab8f..2c84d17e 100644
--- a/muse2/muse/arranger/arrangerview.cpp
+++ b/muse2/muse/arranger/arrangerview.cpp
@@ -313,6 +313,8 @@ QActionGroup* populateAddTrack(QMenu* addTrack)
ArrangerView::ArrangerView(QWidget* parent)
: TopWin(TopWin::ARRANGER, parent, "arrangerview", Qt::Window)
{
+ using MusEGlobal::muse;
+
//setAttribute(Qt::WA_DeleteOnClose);
setWindowTitle(tr("MusE: Arranger"));
setFocusPolicy(Qt::StrongFocus);
@@ -333,22 +335,22 @@ ArrangerView::ArrangerView(QWidget* parent)
// Toolbars ---------------------------------------------------------
QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools"));
undo_tools->setObjectName("Undo/Redo tools");
- undo_tools->addActions(undoRedo->actions());
+ undo_tools->addActions(MusEGlobal::undoRedo->actions());
QToolBar* panic_toolbar = addToolBar(tr("panic"));
panic_toolbar->setObjectName("panic");
- panic_toolbar->addAction(panicAction);
+ panic_toolbar->addAction(MusEGlobal::panicAction);
QToolBar* transport_toolbar = addToolBar(tr("transport"));
transport_toolbar->setObjectName("transport");
- transport_toolbar->addActions(transportAction->actions());
+ transport_toolbar->addActions(MusEGlobal::transportAction->actions());
- editTools = new EditToolBar(this, arrangerTools);
+ editTools = new MusEWidget::EditToolBar(this, MusEWidget::arrangerTools);
addToolBar(editTools);
editTools->setObjectName("arrangerTools");
- visTracks = new VisibleTracks(this);
+ visTracks = new MusEWidget::VisibleTracks(this);
addToolBar(visTracks);
@@ -434,7 +436,7 @@ ArrangerView::ArrangerView(QWidget* parent)
//-------------------------------------------------------------
QMenu* menuEdit = menuBar()->addMenu(tr("&Edit"));
- menuEdit->addActions(undoRedo->actions());
+ menuEdit->addActions(MusEGlobal::undoRedo->actions());
menuEdit->addSeparator();
menuEdit->addAction(editCutAction);
@@ -828,7 +830,7 @@ void ArrangerView::updateScoreMenus()
scoreAllInOneMapper->setMapping(action, (QWidget*)NULL);
scoreAllInOneSubsubmenu->addAction(action);
- const ToplevelList* toplevels=muse->getToplevels();
+ const ToplevelList* toplevels=MusEGlobal::muse->getToplevels();
for (ToplevelList::const_iterator it=toplevels->begin(); it!=toplevels->end(); it++)
if ((*it)->type()==TopWin::SCORE)
diff --git a/muse2/muse/arranger/arrangerview.h b/muse2/muse/arranger/arrangerview.h
index f5214640..542b37f6 100644
--- a/muse2/muse/arranger/arrangerview.h
+++ b/muse2/muse/arranger/arrangerview.h
@@ -38,7 +38,7 @@
#include "helper.h"
#include "arranger.h"
-class VisibleTracks;
+namespace MusEWidget { class VisibleTracks; }
class ArrangerView : public TopWin
@@ -61,8 +61,8 @@ class ArrangerView : public TopWin
QGridLayout* mainGrid;
QWidget* mainw;
- EditToolBar *editTools;
- VisibleTracks *visTracks;
+ MusEWidget::EditToolBar* editTools;
+ MusEWidget::VisibleTracks* visTracks;
Arranger* arranger;
diff --git a/muse2/muse/arranger/pcanvas.cpp b/muse2/muse/arranger/pcanvas.cpp
index 3cd1e18e..1dd4c44d 100644
--- a/muse2/muse/arranger/pcanvas.cpp
+++ b/muse2/muse/arranger/pcanvas.cpp
@@ -4,6 +4,21 @@
// $Id: pcanvas.cpp,v 1.48.2.26 2009/11/22 11:08:33 spamatica Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
// Additions, modifications (C) Copyright 2011 Tim E. Real (terminator356 on users DOT sourceforge DOT net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -78,7 +93,7 @@ QIcon colorRect(const QColor& color, int width, int height) {
// NPart
//---------------------------------------------------------
-NPart::NPart(Part* e) : CItem(Event(), e)
+NPart::NPart(Part* e) : MusEWidget::CItem(Event(), e)
{
leftBorderTouches = false;
rightBorderTouches = false;
@@ -93,7 +108,7 @@ NPart::NPart(Part* e) : CItem(Event(), e)
//---------------------------------------------------------
PartCanvas::PartCanvas(int* r, QWidget* parent, int sx, int sy)
- : Canvas(parent, sx, sy)
+ : MusEWidget::Canvas(parent, sx, sy)
{
setAcceptDrops(true);
_raster = r;
@@ -187,7 +202,7 @@ void PartCanvas::returnPressed()
void PartCanvas::viewMouseDoubleClickEvent(QMouseEvent* event)
{
- if (_tool != PointerTool) {
+ if (_tool != MusEWidget::PointerTool) {
viewMousePressEvent(event);
return;
}
@@ -273,13 +288,13 @@ void PartCanvas::updateSong(DragType t, int flags)
// moveCanvasItems
//---------------------------------------------------------
-void PartCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtype)
+void PartCanvas::moveCanvasItems(MusEWidget::CItemList& items, int dp, int dx, DragType dtype)
{
Undo operations;
- for(iCItem ici = items.begin(); ici != items.end(); ++ici)
+ for(MusEWidget::iCItem ici = items.begin(); ici != items.end(); ++ici)
{
- CItem* ci = ici->second;
+ MusEWidget::CItem* ci = ici->second;
// If this item's part is in the parts2change list, change the item's part to the new part.
//Part* pt = ci->part();
@@ -318,7 +333,7 @@ void PartCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtyp
//---------------------------------------------------------
// Changed by T356.
-UndoOp PartCanvas::moveItem(CItem* item, const QPoint& newpos, DragType t)
+UndoOp PartCanvas::moveItem(MusEWidget::CItem* item, const QPoint& newpos, DragType t)
{
UndoOp result;
NPart* npart = (NPart*) item;
@@ -332,7 +347,7 @@ UndoOp PartCanvas::moveItem(CItem* item, const QPoint& newpos, DragType t)
}
if (ntrack >= tracks->size()) {
ntrack = tracks->size();
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("PartCanvas::moveItem - add new track\n");
Track* newTrack = song->addTrack(int(type));
if (type == Track::WAVE) {
@@ -465,7 +480,7 @@ void PartCanvas::partsChanged()
void PartCanvas::updateSelection()
{
- for (iCItem i = items.begin(); i != items.end(); ++i) {
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) {
NPart* part = (NPart*)(i->second);
part->part()->setSelected(i->second->isSelected());
}
@@ -477,7 +492,7 @@ void PartCanvas::updateSelection()
// resizeItem
//---------------------------------------------------------
-void PartCanvas::resizeItem(CItem* i, bool noSnap, bool ctrl)
+void PartCanvas::resizeItem(MusEWidget::CItem* i, bool noSnap, bool ctrl)
{
Track* t = ((NPart*)(i))->track();
Part* p = ((NPart*)(i))->part();
@@ -499,7 +514,7 @@ void PartCanvas::resizeItem(CItem* i, bool noSnap, bool ctrl)
// first create local Item
//---------------------------------------------------------
-CItem* PartCanvas::newItem(const QPoint& pos, int)
+MusEWidget::CItem* PartCanvas::newItem(const QPoint& pos, int)
{
int x = pos.x();
if (x < 0)
@@ -543,7 +558,7 @@ CItem* PartCanvas::newItem(const QPoint& pos, int)
// newItem
//---------------------------------------------------------
-void PartCanvas::newItem(CItem* i, bool noSnap)
+void PartCanvas::newItem(MusEWidget::CItem* i, bool noSnap)
{
Part* p = ((NPart*)(i))->part();
@@ -561,7 +576,7 @@ void PartCanvas::newItem(CItem* i, bool noSnap)
// deleteItem
//---------------------------------------------------------
-bool PartCanvas::deleteItem(CItem* i)
+bool PartCanvas::deleteItem(MusEWidget::CItem* i)
{
Part* p = ((NPart*)(i))->part();
audio->msgRemovePart(p, true); //Invokes songChanged which calls partsChanged which makes it difficult to delete them there
@@ -572,7 +587,7 @@ bool PartCanvas::deleteItem(CItem* i)
// splitItem
//---------------------------------------------------------
-void PartCanvas::splitItem(CItem* item, const QPoint& pt)
+void PartCanvas::splitItem(MusEWidget::CItem* item, const QPoint& pt)
{
NPart* np = (NPart*) item;
Track* t = np->track();
@@ -587,7 +602,7 @@ void PartCanvas::splitItem(CItem* item, const QPoint& pt)
// glueItem
//---------------------------------------------------------
-void PartCanvas::glueItem(CItem* item)
+void PartCanvas::glueItem(MusEWidget::CItem* item)
{
NPart* np = (NPart*) item;
Track* t = np->track();
@@ -599,7 +614,7 @@ void PartCanvas::glueItem(CItem* item)
// genItemPopup
//---------------------------------------------------------
-QMenu* PartCanvas::genItemPopup(CItem* item)
+QMenu* PartCanvas::genItemPopup(MusEWidget::CItem* item)
{
NPart* npart = (NPart*) item;
Track::TrackType trackType = npart->track()->type();
@@ -631,7 +646,7 @@ QMenu* PartCanvas::genItemPopup(CItem* item)
// part color selection
for (int i = 0; i < NUM_PARTCOLORS; ++i) {
- QAction *act_color = colorPopup->addAction(colorRect(config.partColors[i], 80, 80), config.partColorNames[i]);
+ QAction *act_color = colorPopup->addAction(colorRect(MusEConfig::config.partColors[i], 80, 80), MusEConfig::config.partColorNames[i]);
act_color->setData(20+i);
}
@@ -647,17 +662,17 @@ QMenu* PartCanvas::genItemPopup(CItem* item)
partPopup->addSeparator();
switch(trackType) {
case Track::MIDI: {
- partPopup->addAction(muse->arranger->parentWin->startPianoEditAction);
- partPopup->addMenu(muse->arranger->parentWin->scoreSubmenu);
- partPopup->addAction(muse->arranger->parentWin->startScoreEditAction);
- partPopup->addAction(muse->arranger->parentWin->startListEditAction);
+ partPopup->addAction(MusEGlobal::muse->arranger->parentWin->startPianoEditAction);
+ partPopup->addMenu(MusEGlobal::muse->arranger->parentWin->scoreSubmenu);
+ partPopup->addAction(MusEGlobal::muse->arranger->parentWin->startScoreEditAction);
+ partPopup->addAction(MusEGlobal::muse->arranger->parentWin->startListEditAction);
QAction *act_mexport = partPopup->addAction(tr("save part to disk"));
act_mexport->setData(16);
}
break;
case Track::DRUM: {
- partPopup->addAction(muse->arranger->parentWin->startDrumEditAction);
- partPopup->addAction(muse->arranger->parentWin->startListEditAction);
+ partPopup->addAction(MusEGlobal::muse->arranger->parentWin->startDrumEditAction);
+ partPopup->addAction(MusEGlobal::muse->arranger->parentWin->startListEditAction);
QAction *act_dexport = partPopup->addAction(tr("save part to disk"));
act_dexport->setData(16);
}
@@ -691,7 +706,7 @@ QMenu* PartCanvas::genItemPopup(CItem* item)
// itemPopup
//---------------------------------------------------------
-void PartCanvas::itemPopup(CItem* item, int n, const QPoint& pt)
+void PartCanvas::itemPopup(MusEWidget::CItem* item, int n, const QPoint& pt)
{
PartList* pl = new PartList;
NPart* npart = (NPart*)(item);
@@ -755,7 +770,7 @@ void PartCanvas::itemPopup(CItem* item, int n, const QPoint& pt)
{
const Part* part = item->part();
bool popenFlag = false;
- QString fn = getSaveFileName(QString(""), part_file_save_pattern, this, tr("MusE: save part"));
+ QString fn = getSaveFileName(QString(""), MusEGlobal::part_file_save_pattern, this, tr("MusE: save part"));
if (!fn.isEmpty()) {
FILE* fp = fileOpen(this, fn, ".mpt", "w", popenFlag, false, false);
if (fp) {
@@ -813,7 +828,7 @@ void PartCanvas::itemPopup(CItem* item, int n, const QPoint& pt)
curColorIndex = n - 20;
bool selfound = false;
//Loop through all parts and set color on selected:
- for (iCItem i = items.begin(); i != items.end(); i++) {
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); i++) {
if (i->second->isSelected()) {
selfound = true;
i->second->part()->setColorIndex(curColorIndex);
@@ -845,7 +860,10 @@ void PartCanvas::mousePress(QMouseEvent* event)
return;
}
QPoint pt = event->pos();
- CItem* item = items.find(pt);
+ MusEWidget::CItem* item = items.find(pt);
+
+ //if (item == 0 && _tool!=MusEWidget::AutomationTool) // FINDMICHJETZT. neccessary? (flo93)
+ // return;
switch (_tool) {
default:
@@ -854,13 +872,13 @@ void PartCanvas::mousePress(QMouseEvent* event)
else
emit trackChanged(NULL);
break;
- case CutTool:
+ case MusEWidget::CutTool:
if (item) splitItem(item, pt);
break;
- case GlueTool:
+ case MusEWidget::GlueTool:
if (item) glueItem(item);
break;
- case MuteTool:
+ case MusEWidget::MuteTool:
{
if (item) {
NPart* np = (NPart*) item;
@@ -870,7 +888,7 @@ void PartCanvas::mousePress(QMouseEvent* event)
break;
}
}
- case AutomationTool:
+ case MusEWidget::AutomationTool:
if (automation.controllerState != doNothing)
automation.moveController=true;
break;
@@ -902,7 +920,7 @@ void PartCanvas::mouseMove(QMouseEvent* event)
if (x < 0)
x = 0;
- if (_tool == AutomationTool)
+ if (_tool == MusEWidget::AutomationTool)
processAutomationMovements(event->pos(), event->modifiers() & Qt::ShiftModifier);
emit timeChanged(AL::sigmap.raster(x, *_raster));
@@ -933,7 +951,7 @@ void PartCanvas::keyPress(QKeyEvent* event)
{
int key = event->key();
-// if (_tool == AutomationTool) { // can't get the cursor pos to work right, skipping for now
+// if (_tool == MusEWidget::AutomationTool) { // can't get the cursor pos to work right, skipping for now
// // clear all the automation parameters
// automation.moveController=false;
// automation.controllerState = doNothing;
@@ -1005,30 +1023,30 @@ void PartCanvas::keyPress(QKeyEvent* event)
return;
}
else if (key == shortcuts[SHRT_TOOL_POINTER].key) {
- emit setUsedTool(PointerTool);
+ emit setUsedTool(MusEWidget::PointerTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_PENCIL].key) {
- emit setUsedTool(PencilTool);
+ emit setUsedTool(MusEWidget::PencilTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_RUBBER].key) {
- emit setUsedTool(RubberTool);
+ emit setUsedTool(MusEWidget::RubberTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_SCISSORS].key) {
- emit setUsedTool(CutTool);
+ emit setUsedTool(MusEWidget::CutTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_LINEDRAW].key) {
- emit setUsedTool(AutomationTool);
+ emit setUsedTool(MusEWidget::AutomationTool);
return;
} else if (key == shortcuts[SHRT_TOOL_GLUE].key) {
- emit setUsedTool(GlueTool);
+ emit setUsedTool(MusEWidget::GlueTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_MUTE].key) {
- emit setUsedTool(MuteTool);
+ emit setUsedTool(MusEWidget::MuteTool);
return;
}
else if (key == shortcuts[SHRT_SEL_TRACK_ABOVE].key) {
@@ -1047,7 +1065,7 @@ void PartCanvas::keyPress(QKeyEvent* event)
event->ignore(); // give global accelerators a chance
return;
}
- for (iCItem i = items.begin(); i != items.end(); ++i) {
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) {
NPart* part = (NPart*)(i->second);
if (part->isSelected()) {
curItem=part;
@@ -1058,13 +1076,13 @@ void PartCanvas::keyPress(QKeyEvent* event)
curItem = (NPart*)items.begin()->second; // just grab the first part
}
- CItem* newItem = 0;
+ MusEWidget::CItem* newItem = 0;
bool singleSelection = isSingleSelection();
bool add = false;
//Locators to selection
if (key == shortcuts[SHRT_LOCATORS_TO_SELECTION].key) {
- CItem *leftmost = 0, *rightmost = 0;
- for (iCItem i = items.begin(); i != items.end(); i++) {
+ MusEWidget::CItem *leftmost = 0, *rightmost = 0;
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); i++) {
if (i->second->isSelected()) {
// Check leftmost:
if (!leftmost)
@@ -1100,7 +1118,7 @@ void PartCanvas::keyPress(QKeyEvent* event)
Track* track = part->track();
unsigned int tick = part->tick();
bool afterthis = false;
- for (iCItem i = items.begin(); i != items.end(); ++i) {
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) {
NPart* npart = (NPart*)(i->second);
Part* ipart = npart->part();
if (ipart->track() != track)
@@ -1128,7 +1146,7 @@ void PartCanvas::keyPress(QKeyEvent* event)
Track* track = part->track();
unsigned int tick = part->tick();
- for (iCItem i = items.begin(); i != items.end(); ++i) {
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) {
NPart* npart = (NPart*)(i->second);
Part* ipart = npart->part();
@@ -1157,7 +1175,7 @@ void PartCanvas::keyPress(QKeyEvent* event)
return;
}
int middle = curItem->x() + curItem->part()->lenTick()/2;
- CItem *aboveL = 0, *aboveR = 0;
+ MusEWidget::CItem *aboveL = 0, *aboveR = 0;
//Upper limit: song end, lower limit: song start
int ulimit = song->len();
int llimit = 0;
@@ -1178,7 +1196,7 @@ void PartCanvas::keyPress(QKeyEvent* event)
}
if ((aboveL || aboveR) != 0) { //We've hit something
- CItem* above = 0;
+ MusEWidget::CItem* above = 0;
above = (aboveL !=0) ? aboveL : aboveR;
newItem = above;
}
@@ -1204,7 +1222,7 @@ void PartCanvas::keyPress(QKeyEvent* event)
if (!track)
return;
- CItem *belowL = 0, *belowR = 0;
+ MusEWidget::CItem *belowL = 0, *belowR = 0;
//Upper limit: song end , lower limit: song start
int ulimit = song->len();
int llimit = 0;
@@ -1224,7 +1242,7 @@ void PartCanvas::keyPress(QKeyEvent* event)
}
if ((belowL || belowR) != 0) { //We've hit something
- CItem* below = 0;
+ MusEWidget::CItem* below = 0;
below = (belowL !=0) ? belowL : belowR;
newItem = below;
}
@@ -1308,7 +1326,7 @@ void PartCanvas::keyPress(QKeyEvent* event)
//---------------------------------------------------------
#if 0
-void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
+void PartCanvas::drawItem(QPainter& p, const MusEWidget::CItem* item, const QRect& rect)
{
int from = rect.x();
int to = from + rect.width();
@@ -1393,7 +1411,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
if (item->isMoving())
{
QColor c(Qt::gray);
- c.setAlpha(config.globalAlphaBlend);
+ c.setAlpha(MusEConfig::config.globalAlphaBlend);
QLinearGradient gradient(r.topLeft(), r.bottomLeft());
gradient.setColorAt(0, c);
gradient.setColorAt(1, c.darker());
@@ -1403,12 +1421,12 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
if (part->selected())
{
QColor c(Qt::black);
- c.setAlpha(config.globalAlphaBlend);
+ c.setAlpha(MusEConfig::config.globalAlphaBlend);
QLinearGradient gradient(r.topLeft(), r.bottomLeft());
- // Use a colour only about 20% lighter than black, rather than the 50% we use in gGradientFromQColor
+ // Use a colour only about 20% lighter than black, rather than the 50% we use in MusEUtil::gGradientFromQColor
// and is used in darker()/lighter(), so that it is distinguished a bit better from grey non-part tracks.
//c.setRgba(64, 64, 64, c.alpha());
- gradient.setColorAt(0, QColor(51, 51, 51, config.globalAlphaBlend));
+ gradient.setColorAt(0, QColor(51, 51, 51, MusEConfig::config.globalAlphaBlend));
gradient.setColorAt(1, c);
brush = QBrush(gradient);
}
@@ -1416,7 +1434,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
if (part->mute())
{
QColor c(Qt::white);
- c.setAlpha(config.globalAlphaBlend);
+ c.setAlpha(MusEConfig::config.globalAlphaBlend);
QLinearGradient gradient(r.topLeft(), r.bottomLeft());
gradient.setColorAt(0, c);
gradient.setColorAt(1, c.darker());
@@ -1431,9 +1449,9 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
}
else
{
- QColor c(config.partColors[cidx]);
- c.setAlpha(config.globalAlphaBlend);
- brush = QBrush(gGradientFromQColor(c, r.topLeft(), r.bottomLeft()));
+ QColor c(MusEConfig::config.partColors[cidx]);
+ c.setAlpha(MusEConfig::config.globalAlphaBlend);
+ brush = QBrush(MusEUtil::gGradientFromQColor(c, r.topLeft(), r.bottomLeft()));
}
double h = r.height();
@@ -1501,7 +1519,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
//
int part_r, part_g, part_b, brightness, color_brightness;
- config.partColors[cidx].getRgb(&part_r, &part_g, &part_b);
+ MusEConfig::config.partColors[cidx].getRgb(&part_r, &part_g, &part_b);
brightness = part_r*29 + part_g*59 + part_b*12;
//if ((brightness < 12000 || part->selected()) && !part->mute() && !item->isMoving())
// color_brightness=223; // too dark: use lighter color
@@ -1511,8 +1529,8 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
color_brightness=32; // too light: use dark color
else
color_brightness=223; // too dark: use lighter color
- QColor c(color_brightness,color_brightness,color_brightness, config.globalAlphaBlend);
- p.setBrush(QBrush(gGradientFromQColor(c, r.topLeft(), r.bottomLeft())));
+ QColor c(color_brightness,color_brightness,color_brightness, MusEConfig::config.globalAlphaBlend);
+ p.setBrush(QBrush(MusEUtil::gGradientFromQColor(c, r.topLeft(), r.bottomLeft())));
//p.setBrush(QBrush(c));
if(het & Part::RightEventsHidden)
{
@@ -1563,7 +1581,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
// Works great but requires clones be drawn with the highest priority on top of all other parts, in Canvas::draw.
//
- QPen pen(part->selected() ? config.partColors[i] : Qt::black, 2.0, clone ? Qt::DotLine : Qt::SolidLine);
+ QPen pen(part->selected() ? MusEConfig::config.partColors[i] : Qt::black, 2.0, clone ? Qt::DotLine : Qt::SolidLine);
pen.setCosmetic(true);
p.setPen(pen);
p.setBrush(Qt::NoBrush);
@@ -1584,7 +1602,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
p.setBrush(Qt::NoBrush);
- QColor pc((part->mute() || item->isMoving())? Qt::white : config.partColors[cidx]);
+ QColor pc((part->mute() || item->isMoving())? Qt::white : MusEConfig::config.partColors[cidx]);
QPen penSelect1H(pc);
QPen penSelect2H(pc, 2.0);
QPen penSelect1V(pc);
@@ -1699,7 +1717,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
//p.restore();
- if (config.canvasShowPartType & 1) { // show names
+ if (MusEConfig::config.canvasShowPartType & 1) { // show names
// draw name
// FN: Set text color depending on part color (black / white)
int part_r, part_g, part_b, brightness;
@@ -1707,12 +1725,12 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
// get the lowest colour in the gradient used to draw the part.
QRect rr = map(r);
rr.setX(rr.x() + 3);
- gGradientFromQColor(config.partColors[cidx], rr.topLeft(), rr.bottomLeft()).stops().last().second.getRgb(&part_r, &part_g, &part_b);
+ MusEUtil::gGradientFromQColor(MusEConfig::config.partColors[cidx], rr.topLeft(), rr.bottomLeft()).stops().last().second.getRgb(&part_r, &part_g, &part_b);
brightness = part_r*29 + part_g*59 + part_b*12;
//bool rev = (brightness < 12000 || part->selected()) && !part->mute() && !item->isMoving();
bool rev = brightness >= 12000 && !part->selected();
p.save();
- p.setFont(config.fonts[1]);
+ p.setFont(MusEConfig::config.fonts[1]);
p.setWorldMatrixEnabled(false);
if (rev)
p.setPen(Qt::white);
@@ -1729,7 +1747,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
}
#endif
-void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
+void PartCanvas::drawItem(QPainter& p, const MusEWidget::CItem* item, const QRect& rect)
{
int from = rect.x();
int to = from + rect.width();
@@ -1818,7 +1836,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
if (item->isMoving())
{
QColor c(Qt::gray);
- c.setAlpha(config.globalAlphaBlend);
+ c.setAlpha(MusEConfig::config.globalAlphaBlend);
QLinearGradient gradient(rr.topLeft(), rr.bottomLeft());
gradient.setColorAt(0, c);
gradient.setColorAt(1, c.darker());
@@ -1828,12 +1846,12 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
if (part->selected())
{
QColor c(Qt::black);
- c.setAlpha(config.globalAlphaBlend);
+ c.setAlpha(MusEConfig::config.globalAlphaBlend);
QLinearGradient gradient(rr.topLeft(), rr.bottomLeft());
- // Use a colour only about 20% lighter than black, rather than the 50% we use in gGradientFromQColor
+ // Use a colour only about 20% lighter than black, rather than the 50% we use in MusEUtil::gGradientFromQColor
// and is used in darker()/lighter(), so that it is distinguished a bit better from grey non-part tracks.
//c.setRgba(64, 64, 64, c.alpha());
- gradient.setColorAt(0, QColor(51, 51, 51, config.globalAlphaBlend));
+ gradient.setColorAt(0, QColor(51, 51, 51, MusEConfig::config.globalAlphaBlend));
gradient.setColorAt(1, c);
brush = QBrush(gradient);
}
@@ -1841,7 +1859,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
if (part->mute())
{
QColor c(Qt::white);
- c.setAlpha(config.globalAlphaBlend);
+ c.setAlpha(MusEConfig::config.globalAlphaBlend);
QLinearGradient gradient(rr.topLeft(), rr.bottomLeft());
gradient.setColorAt(0, c);
gradient.setColorAt(1, c.darker());
@@ -1849,9 +1867,9 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
}
else
{
- QColor c(config.partColors[cidx]);
- c.setAlpha(config.globalAlphaBlend);
- brush = QBrush(gGradientFromQColor(c, rr.topLeft(), rr.bottomLeft()));
+ QColor c(MusEConfig::config.partColors[cidx]);
+ c.setAlpha(MusEConfig::config.globalAlphaBlend);
+ brush = QBrush(MusEUtil::gGradientFromQColor(c, rr.topLeft(), rr.bottomLeft()));
}
int h = rr.height();
@@ -1941,7 +1959,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
//
int part_r, part_g, part_b, brightness, color_brightness;
- config.partColors[cidx].getRgb(&part_r, &part_g, &part_b);
+ MusEConfig::config.partColors[cidx].getRgb(&part_r, &part_g, &part_b);
brightness = part_r*29 + part_g*59 + part_b*12;
//if ((brightness < 12000 || part->selected()) && !part->mute() && !item->isMoving())
// color_brightness=223; // too dark: use lighter color
@@ -1951,8 +1969,8 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
color_brightness=96; //0; // too light: use dark color
else
color_brightness=180; //255; // too dark: use lighter color
- QColor c(color_brightness,color_brightness,color_brightness, config.globalAlphaBlend);
- p.setBrush(QBrush(gGradientFromQColor(c, rr.topLeft(), rr.bottomLeft())));
+ QColor c(color_brightness,color_brightness,color_brightness, MusEConfig::config.globalAlphaBlend);
+ p.setBrush(QBrush(MusEUtil::gGradientFromQColor(c, rr.topLeft(), rr.bottomLeft())));
//p.setBrush(QBrush(c));
if(het & Part::RightEventsHidden)
{
@@ -2028,7 +2046,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
// Works great but requires clones be drawn with the highest priority on top of all other parts, in Canvas::draw.
//
- QPen pen(part->selected() ? config.partColors[i] : Qt::black, 2.0, clone ? Qt::DotLine : Qt::SolidLine);
+ QPen pen(part->selected() ? MusEConfig::config.partColors[i] : Qt::black, 2.0, clone ? Qt::DotLine : Qt::SolidLine);
pen.setCosmetic(true);
p.setPen(pen);
p.setBrush(Qt::NoBrush);
@@ -2041,7 +2059,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
p.setBrush(Qt::NoBrush);
- QColor pc((part->mute() || item->isMoving())? Qt::white : config.partColors[cidx]);
+ QColor pc((part->mute() || item->isMoving())? Qt::white : MusEConfig::config.partColors[cidx]);
QPen penSelect1H(pc);
QPen penSelect2H(pc, 2.0);
QPen penSelect1V(pc);
@@ -2162,7 +2180,7 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
#endif
- if (config.canvasShowPartType & 1) { // show names
+ if (MusEConfig::config.canvasShowPartType & 1) { // show names
// draw name
// FN: Set text color depending on part color (black / white)
int part_r, part_g, part_b, brightness;
@@ -2171,11 +2189,11 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
//QRect rr = map(r);
QRect tr = rr;
tr.setX(tr.x() + 3);
- gGradientFromQColor(config.partColors[cidx], tr.topLeft(), tr.bottomLeft()).stops().last().second.getRgb(&part_r, &part_g, &part_b);
+ MusEUtil::gGradientFromQColor(MusEConfig::config.partColors[cidx], tr.topLeft(), tr.bottomLeft()).stops().last().second.getRgb(&part_r, &part_g, &part_b);
brightness = part_r*29 + part_g*59 + part_b*12;
//bool rev = (brightness < 12000 || part->selected()) && !part->mute() && !item->isMoving();
bool rev = brightness >= 12000 && !part->selected();
- p.setFont(config.fonts[1]);
+ p.setFont(MusEConfig::config.fonts[1]);
if (rev)
p.setPen(Qt::white);
else
@@ -2197,12 +2215,12 @@ void PartCanvas::drawItem(QPainter& p, const CItem* item, const QRect& rect)
// draws moving items
//---------------------------------------------------------
-void PartCanvas::drawMoving(QPainter& p, const CItem* item, const QRect&)
+void PartCanvas::drawMoving(QPainter& p, const MusEWidget::CItem* item, const QRect&)
{
p.setPen( Qt::black);
Part* part = ((NPart*)item)->part();
- QColor c(part->mute() ? Qt::white : config.partColors[part->colorIndex()]);
- //c.setAlpha(config.globalAlphaBlend);
+ QColor c(part->mute() ? Qt::white : MusEConfig::config.partColors[part->colorIndex()]);
+ //c.setAlpha(MusEConfig::config.globalAlphaBlend);
c.setAlpha(128); // Fix this regardless of global setting. Should be OK.
p.setBrush(c);
p.drawRect(item->mp().x(), item->mp().y(), item->width(), item->height());
@@ -2222,7 +2240,7 @@ void PartCanvas::drawMidiPart(QPainter& p, const QRect&, EventList* events, Midi
if(pt)
{
int part_r, part_g, part_b, brightness;
- config.partColors[pt->colorIndex()].getRgb(&part_r, &part_g, &part_b);
+ MusEConfig::config.partColors[pt->colorIndex()].getRgb(&part_r, &part_g, &part_b);
brightness = part_r*29 + part_g*59 + part_b*12;
//if ((brightness < 12000 || pt->selected()) && !pt->mute())
// color_brightness=192; // too dark: use lighter color
@@ -2236,7 +2254,7 @@ void PartCanvas::drawMidiPart(QPainter& p, const QRect&, EventList* events, Midi
else
color_brightness=80;
- if (config.canvasShowPartType & 2) { // show events
+ if (MusEConfig::config.canvasShowPartType & 2) { // show events
p.setPen(QColor(color_brightness,color_brightness,color_brightness));
// Do not allow this, causes segfault.
if(from <= to)
@@ -2246,11 +2264,11 @@ void PartCanvas::drawMidiPart(QPainter& p, const QRect&, EventList* events, Midi
for (iEvent i = events->lower_bound(from); i != ito; ++i) {
EventType type = i->second.type();
if (
- ((config.canvasShowPartEvent & 1) && (type == Note))
- || ((config.canvasShowPartEvent & 2) && (type == PAfter))
- || ((config.canvasShowPartEvent & 4) && (type == Controller))
- || ((config.canvasShowPartEvent &16) && (type == CAfter))
- || ((config.canvasShowPartEvent &64) && (type == Sysex || type == Meta))
+ ((MusEConfig::config.canvasShowPartEvent & 1) && (type == Note))
+ || ((MusEConfig::config.canvasShowPartEvent & 2) && (type == PAfter))
+ || ((MusEConfig::config.canvasShowPartEvent & 4) && (type == Controller))
+ || ((MusEConfig::config.canvasShowPartEvent &16) && (type == CAfter))
+ || ((MusEConfig::config.canvasShowPartEvent &64) && (type == Sysex || type == Meta))
) {
int t = i->first + pTick;
int th = mt->height();
@@ -2345,7 +2363,7 @@ void PartCanvas::drawMidiPart(QPainter& p, const QRect&, EventList* events, Midi
int highest_pitch=0;
map<int,int> y_mapper;
- if (config.canvasShowPartType & 4) //y-stretch?
+ if (MusEConfig::config.canvasShowPartType & 4) //y-stretch?
{
for (iEvent i = events->begin(); i != events->end(); ++i)
{
@@ -2383,7 +2401,7 @@ void PartCanvas::drawMidiPart(QPainter& p, const QRect&, EventList* events, Midi
highest_pitch++;
}
- if (heavyDebugMsg)
+ if (MusEGlobal::heavyDebugMsg)
{
if (!isdrum)
printf("DEBUG: arranger: cakewalk enabled, y-stretching from %i to %i. eventlist=%p\n",lowest_pitch, highest_pitch, events);
@@ -2405,7 +2423,7 @@ void PartCanvas::drawMidiPart(QPainter& p, const QRect&, EventList* events, Midi
for (int cnt=0;cnt<127;cnt++)
y_mapper[cnt]=cnt;
- if (heavyDebugMsg) printf("DEBUG: arranger: cakewalk enabled, y-stretch disabled\n");
+ if (MusEGlobal::heavyDebugMsg) printf("DEBUG: arranger: cakewalk enabled, y-stretch disabled\n");
}
p.setPen(QColor(color_brightness,color_brightness,color_brightness));
@@ -2564,7 +2582,7 @@ void PartCanvas::drawWavePart(QPainter& p,
void PartCanvas::cmd(int cmd)
{
PartList pl;
- for (iCItem i = items.begin(); i != items.end(); ++i) {
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) {
if (!i->second->isSelected())
continue;
NPart* npart = (NPart*)(i->second);
@@ -2577,7 +2595,7 @@ void PartCanvas::cmd(int cmd)
Undo operations;
- for (iCItem i = items.begin(); i != items.end(); ++i) {
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) {
if (i->second->isSelected()) {
NPart* p = (NPart*)(i->second);
Part* part = p->part();
@@ -2648,7 +2666,7 @@ void PartCanvas::copy_in_range(PartList* pl_)
if (pl_->empty())
{
- for (iCItem i = items.begin(); i != items.end(); ++i)
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i)
{
Part* part=static_cast<NPart*>(i->second)->part();
if ( (part->track()->isMidiTrack()) || (part->track()->type() == Track::WAVE) )
@@ -3072,7 +3090,7 @@ void PartCanvas::paste(bool clone, paste_mode_t paste_mode, bool to_single_track
// startDrag
//---------------------------------------------------------
-void PartCanvas::startDrag(CItem* item, DragType t)
+void PartCanvas::startDrag(MusEWidget::CItem* item, DragType t)
{
NPart* p = (NPart*)(item);
Part* part = p->part();
@@ -3147,7 +3165,7 @@ void PartCanvas::dragEnterEvent(QDragEnterEvent* event)
void PartCanvas::viewDropEvent(QDropEvent* event)
{
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("void PartCanvas::viewDropEvent(QDropEvent* event)\n");
if (event->source() == this) {
printf("local DROP\n");
@@ -3164,7 +3182,7 @@ void PartCanvas::viewDropEvent(QDropEvent* event)
type = 2;
else
{
- if(debugMsg && event->mimeData()->formats().size() != 0)
+ if(MusEGlobal::debugMsg && event->mimeData()->formats().size() != 0)
printf("Drop with unknown format. First format:<%s>\n", event->mimeData()->formats()[0].toLatin1().constData());
//event->ignore(); // TODO CHECK Tim.
return;
@@ -3228,13 +3246,13 @@ void PartCanvas::viewDropEvent(QDropEvent* event)
(text.endsWith(".ogg", Qt::CaseInsensitive))))
{
unsigned tick = x;
- muse->importWaveToTrack(text, tick, track);
+ MusEGlobal::muse->importWaveToTrack(text, tick, track);
}
// Changed by T356. Support mixed .mpt files.
else if ((track->isMidiTrack() || track->type() == Track::WAVE) && text.endsWith(".mpt", Qt::CaseInsensitive))
{
unsigned tick = x;
- muse->importPartToTrack(text, tick, track);
+ MusEGlobal::muse->importPartToTrack(text, tick, track);
}
}
else if(text.endsWith(".med",Qt::CaseInsensitive))
@@ -3287,13 +3305,13 @@ void PartCanvas::drawCanvas(QPainter& p, const QRect& rect)
//////////
// GRID //
//////////
- QColor baseColor(config.partCanvasBg.light(104));
+ QColor baseColor(MusEConfig::config.partCanvasBg.light(104));
p.setPen(baseColor);
//--------------------------------
// vertical lines
//-------------------------------
- if (config.canvasShowGrid) {
+ if (MusEConfig::config.canvasShowGrid) {
int bar, beat;
unsigned tick;
@@ -3314,17 +3332,17 @@ void PartCanvas::drawCanvas(QPainter& p, const QRect& rect)
// append
int noDivisors=0;
- if (*_raster == config.division *2) // 1/2
+ if (*_raster == MusEConfig::config.division *2) // 1/2
noDivisors=2;
- else if (*_raster== config.division) // 1/4
+ else if (*_raster== MusEConfig::config.division) // 1/4
noDivisors=4;
- else if (*_raster==config.division/2) // 1/8
+ else if (*_raster==MusEConfig::config.division/2) // 1/8
noDivisors=8;
- else if (*_raster==config.division/4) // 1/16
+ else if (*_raster==MusEConfig::config.division/4) // 1/16
noDivisors=16;
- else if (*_raster==config.division/8) // 1/16
+ else if (*_raster==MusEConfig::config.division/8) // 1/16
noDivisors=32;
- else if (*_raster==config.division/16) // 1/16
+ else if (*_raster==MusEConfig::config.division/16) // 1/16
noDivisors=64;
int r = *_raster;
@@ -3363,7 +3381,7 @@ void PartCanvas::drawCanvas(QPainter& p, const QRect& rect)
th = track->height();
if (!th)
continue;
- if (config.canvasShowGrid && (track->isMidiTrack() || track->type() == Track::WAVE)) // Tim.
+ if (MusEConfig::config.canvasShowGrid && (track->isMidiTrack() || track->type() == Track::WAVE)) // Tim.
{
p.setPen(baseColor.dark(130));
//p.drawLine(x, yy + th, x + w, yy + th);
@@ -3430,7 +3448,7 @@ void PartCanvas::drawTopItem(QPainter& p, const QRect& rect)
int mw = mr.width();
int mh = mr.height();
- QColor baseColor(config.partCanvasBg.light(104));
+ QColor baseColor(MusEConfig::config.partCanvasBg.light(104));
//p.setPen(baseColor);
p.save();
@@ -3495,8 +3513,8 @@ void PartCanvas::drawTopItem(QPainter& p, const QRect& rect)
if (track->recordFlag()) {
QPen pen(Qt::black, 0, Qt::SolidLine);
p.setPen(pen);
- QColor c(config.partColors[0]);
- c.setAlpha(config.globalAlphaBlend);
+ QColor c(MusEConfig::config.partColors[0]);
+ c.setAlpha(MusEConfig::config.globalAlphaBlend);
QLinearGradient gradient(QPoint(startx,yPos), QPoint(startx,yPos+th));
gradient.setColorAt(0, c);
gradient.setColorAt(1, c.darker());
@@ -3574,7 +3592,7 @@ void PartCanvas::drawAudioTrack(QPainter& p, const QRect& r, const QRect& bbox,
p.setPen(Qt::black);
QColor c(Qt::gray);
- c.setAlpha(config.globalAlphaBlend);
+ c.setAlpha(MusEConfig::config.globalAlphaBlend);
//QLinearGradient gradient(r.topLeft(), r.bottomLeft());
QLinearGradient gradient(mex + 1, mey + 1, mex + 1, mey + meh - 1); // Inside the border
gradient.setColorAt(0, c);
@@ -3878,7 +3896,7 @@ void PartCanvas::controllerChanged(Track* t)
void PartCanvas::processAutomationMovements(QPoint pos, bool addPoint)
{
- if (_tool == AutomationTool) {
+ if (_tool == MusEWidget::AutomationTool) {
if (!automation.moveController) { // currently nothing going lets's check for some action.
Track * t = y2Track(pos.y());
diff --git a/muse2/muse/arranger/pcanvas.h b/muse2/muse/arranger/pcanvas.h
index f9f9a3df..2bce9035 100644
--- a/muse2/muse/arranger/pcanvas.h
+++ b/muse2/muse/arranger/pcanvas.h
@@ -4,6 +4,21 @@
// $Id: pcanvas.h,v 1.11.2.4 2009/05/24 21:43:44 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
// Additions, modifications (C) Copyright 2011 Tim E. Real (terminator356 on users DOT sourceforge DOT net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __PCANVAS_H__
@@ -31,7 +46,7 @@ class QDragEnterEvent;
// for displaying
//---------------------------------------------------------
-class NPart : public CItem {
+class NPart : public MusEWidget::CItem {
public:
NPart(Part* e);
const QString name() const { return part()->name(); }
@@ -63,7 +78,7 @@ class CtrlVal;
// PartCanvas
//---------------------------------------------------------
-class PartCanvas : public Canvas {
+class PartCanvas : public MusEWidget::Canvas {
Q_OBJECT
int* _raster;
TrackList* tracks;
@@ -84,30 +99,30 @@ class PartCanvas : public Canvas {
virtual void mouseRelease(const QPoint&);
virtual void viewMouseDoubleClickEvent(QMouseEvent*);
virtual void leaveEvent(QEvent*e);
- virtual void drawItem(QPainter&, const CItem*, const QRect&);
- virtual void drawMoving(QPainter&, const CItem*, const QRect&);
+ virtual void drawItem(QPainter&, const MusEWidget::CItem*, const QRect&);
+ virtual void drawMoving(QPainter&, const MusEWidget::CItem*, const QRect&);
virtual void updateSelection();
virtual QPoint raster(const QPoint&) const;
virtual int y2pitch(int y) const;
virtual int pitch2y(int p) const;
- virtual CItem* newItem(const QPoint&, int);
- virtual void resizeItem(CItem*,bool, bool ctrl);
- virtual void newItem(CItem*,bool);
- virtual bool deleteItem(CItem*);
- virtual void moveCanvasItems(CItemList&, int, int, DragType);
- virtual UndoOp moveItem(CItem*, const QPoint&, DragType);
+ virtual MusEWidget::CItem* newItem(const QPoint&, int);
+ virtual void resizeItem(MusEWidget::CItem*,bool, bool ctrl);
+ virtual void newItem(MusEWidget::CItem*,bool);
+ virtual bool deleteItem(MusEWidget::CItem*);
+ virtual void moveCanvasItems(MusEWidget::CItemList&, int, int, DragType);
+ virtual UndoOp moveItem(MusEWidget::CItem*, const QPoint&, DragType);
virtual void updateSong(DragType, int);
- virtual void startDrag(CItem*, DragType);
+ virtual void startDrag(MusEWidget::CItem*, DragType);
virtual void dragEnterEvent(QDragEnterEvent*);
virtual void viewDropEvent(QDropEvent*);
- virtual QMenu* genItemPopup(CItem*);
- virtual void itemPopup(CItem*, int, const QPoint&);
+ virtual QMenu* genItemPopup(MusEWidget::CItem*);
+ virtual void itemPopup(MusEWidget::CItem*, int, const QPoint&);
- void glueItem(CItem* item);
- void splitItem(CItem* item, const QPoint&);
+ void glueItem(MusEWidget::CItem* item);
+ void splitItem(MusEWidget::CItem* item, const QPoint&);
void copy(PartList*);
void copy_in_range(PartList*);
diff --git a/muse2/muse/arranger/tlist.cpp b/muse2/muse/arranger/tlist.cpp
index 903c78ba..77c00d2d 100644
--- a/muse2/muse/arranger/tlist.cpp
+++ b/muse2/muse/arranger/tlist.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: tlist.cpp,v 1.31.2.31 2009/12/15 03:39:58 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
//#include "config.h"
@@ -51,7 +66,10 @@
#include "dssihost.h"
#endif
+//namespace MusEApp { FINDMICHJETZT: again: dirty, dirty. implemented in arrangerview.cpp
+// should be moved together with populateAddTrack somewhere else
extern QMenu* populateAddSynth(QWidget* parent);
+//}
static const int MIN_TRACKHEIGHT = 20;
static const int WHEEL_DELTA = 120;
@@ -61,7 +79,7 @@ QColor collist[] = { Qt::red, Qt::yellow, Qt::blue , Qt::black, Qt::white, Qt::g
// TList
//---------------------------------------------------------
-TList::TList(Header* hdr, QWidget* parent, const char* name)
+TList::TList(MusEWidget::Header* hdr, QWidget* parent, const char* name)
: QWidget(parent) // Qt::WNoAutoErase | Qt::WResizeNoErase are no longer needed according to Qt4 doc
{
setBackgroundRole(QPalette::NoRole);
@@ -88,7 +106,7 @@ TList::TList(Header* hdr, QWidget* parent, const char* name)
resizeFlag = false;
connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
- connect(muse, SIGNAL(configChanged()), SLOT(redraw()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(redraw()));
}
//---------------------------------------------------------
@@ -153,7 +171,7 @@ void TList::paint(const QRect& r)
QPainter p(this);
if (bgPixmap.isNull())
- p.fillRect(rect, config.trackBg);
+ p.fillRect(rect, MusEConfig::config.trackBg);
else
p.drawTiledPixmap(rect, bgPixmap, QPoint(rect.x(), ypos + rect.y()));
p.setClipRegion(rect);
@@ -188,35 +206,35 @@ void TList::paint(const QRect& r)
//
QColor bg;
if (track->selected()) {
- bg = config.selectTrackBg;
+ bg = MusEConfig::config.selectTrackBg;
//p.setPen(palette().active().text());
- p.setPen(config.selectTrackFg);
+ p.setPen(MusEConfig::config.selectTrackFg);
}
else {
switch(type) {
case Track::MIDI:
- bg = config.midiTrackBg;
+ bg = MusEConfig::config.midiTrackBg;
break;
case Track::DRUM:
- bg = config.drumTrackBg;
+ bg = MusEConfig::config.drumTrackBg;
break;
case Track::WAVE:
- bg = config.waveTrackBg;
+ bg = MusEConfig::config.waveTrackBg;
break;
case Track::AUDIO_OUTPUT:
- bg = config.outputTrackBg;
+ bg = MusEConfig::config.outputTrackBg;
break;
case Track::AUDIO_INPUT:
- bg = config.inputTrackBg;
+ bg = MusEConfig::config.inputTrackBg;
break;
case Track::AUDIO_GROUP:
- bg = config.groupTrackBg;
+ bg = MusEConfig::config.groupTrackBg;
break;
case Track::AUDIO_AUX:
- bg = config.auxTrackBg;
+ bg = MusEConfig::config.auxTrackBg;
break;
case Track::AUDIO_SOFTSYNTH:
- bg = config.synthTrackBg;
+ bg = MusEConfig::config.synthTrackBg;
break;
}
p.setPen(palette().color(QPalette::Active, QPalette::Text));
@@ -553,7 +571,7 @@ void TList::portsPopupMenu(Track* t, int x, int y)
{
MidiTrack* track = (MidiTrack*)t;
- //QPopupMenu* p = midiPortsPopup(0);
+ //QMusEWidget::PopupMenu* p = midiPortsPopup(0);
MidiDevice* md = 0;
int port = -1;
if(t->type() == Track::AUDIO_SOFTSYNTH)
@@ -612,7 +630,7 @@ void TList::portsPopupMenu(Track* t, int x, int y)
// Compiler complains if simple cast from Track to SynthI...
midiSeq->msgSetMidiDevice(&midiPorts[n], (midiPorts[n].device() == md) ? 0 : md);
- muse->changeConfig(true); // save configuration file
+ MusEGlobal::muse->changeConfig(true); // save configuration file
//audio->msgIdle(false);
song->update();
@@ -847,7 +865,7 @@ void TList::moveSelection(int n)
// rec enable track if expected
TrackList recd = getRecEnabledTracks();
- if (recd.size() == 1 && config.moveArmedCheckBox) { // one rec enabled track, move rec enabled with selection
+ if (recd.size() == 1 && MusEConfig::config.moveArmedCheckBox) { // one rec enabled track, move rec enabled with selection
song->setRecordFlag((Track*)recd.front(),false);
song->setRecordFlag((*t),true);
}
@@ -936,10 +954,10 @@ void TList::changeAutomationColor(QAction* act)
// colorMenu
//---------------------------------------------------------
//QMenu* TList::colorMenu(QColor c, int id)
-PopupMenu* TList::colorMenu(QColor c, int id)
+MusEWidget::PopupMenu* TList::colorMenu(QColor c, int id)
{
//QMenu * m = new QMenu(this);
- PopupMenu * m = new PopupMenu(this); //, true); TODO
+ MusEWidget::PopupMenu * m = new MusEWidget::PopupMenu(this); //, true); TODO
for (int i = 0; i< 6; i++) {
QPixmap pix(10,10);
QPainter p(&pix);
@@ -1040,7 +1058,7 @@ void TList::mousePressEvent(QMouseEvent* ev)
if (dev==0)
{
midiSeq->msgSetMidiDevice(port, (SynthI*)t);
- muse->changeConfig(true); // save configuration file
+ MusEGlobal::muse->changeConfig(true); // save configuration file
song->update();
break;
}
@@ -1143,7 +1161,7 @@ void TList::mousePressEvent(QMouseEvent* ev)
{
if (!t->isMidiTrack()) {
editAutomation = t;
- PopupMenu* p = new PopupMenu(true);
+ MusEWidget::PopupMenu* p = new MusEWidget::PopupMenu(true);
p->disconnect();
p->clear();
p->setTitle(tr("Viewable automation"));
@@ -1161,7 +1179,7 @@ void TList::mousePressEvent(QMouseEvent* ev)
data += 150; // illegal color > 100
act->setData(data);
//QMenu *m = colorMenu(cl->color(), cl->id());
- PopupMenu *m = colorMenu(cl->color(), cl->id());
+ MusEWidget::PopupMenu *m = colorMenu(cl->color(), cl->id());
act->setMenu(m);
}
connect(p, SIGNAL(triggered(QAction*)), SLOT(changeAutomation(QAction*)));
@@ -1179,7 +1197,7 @@ void TList::mousePressEvent(QMouseEvent* ev)
if (!t->isMidiTrack()) {
if (t->type() == Track::AUDIO_OUTPUT) {
if (val && t->recordFlag() == false) {
- muse->bounceToFile((AudioOutput*)t);
+ MusEGlobal::muse->bounceToFile((AudioOutput*)t);
}
audio->msgSetRecord((AudioOutput*)t, val);
if (!((AudioOutput*)t)->recFile())
@@ -1260,7 +1278,7 @@ void TList::mousePressEvent(QMouseEvent* ev)
// rec enable track if expected
TrackList recd = getRecEnabledTracks();
- if (recd.size() == 1 && config.moveArmedCheckBox) { // one rec enabled track, move rec enabled with selection
+ if (recd.size() == 1 && MusEConfig::config.moveArmedCheckBox) { // one rec enabled track, move rec enabled with selection
song->setRecordFlag((Track*)recd.front(),false);
song->setRecordFlag(t,true);
}
@@ -1289,7 +1307,7 @@ void TList::mousePressEvent(QMouseEvent* ev)
case 1: // show track comment
{
- TrackComment* tc = new TrackComment(t, 0);
+ MusEWidget::TrackComment* tc = new MusEWidget::TrackComment(t, 0);
tc->show();
//QToolTip::add( this, "FOOOOOOOOOOOOO" );
}
@@ -1393,7 +1411,7 @@ void TList::selectTrack(Track* tr)
// rec enable track if expected
TrackList recd = getRecEnabledTracks();
- if (recd.size() == 1 && config.moveArmedCheckBox) { // one rec enabled track, move rec enabled with selection
+ if (recd.size() == 1 && MusEConfig::config.moveArmedCheckBox) { // one rec enabled track, move rec enabled with selection
song->setRecordFlag((Track*)recd.front(),false);
song->setRecordFlag(tr,true);
}
diff --git a/muse2/muse/arranger/tlist.h b/muse2/muse/arranger/tlist.h
index 607ca8c0..970df420 100644
--- a/muse2/muse/arranger/tlist.h
+++ b/muse2/muse/arranger/tlist.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: tlist.h,v 1.8.2.5 2008/01/19 13:33:46 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TLIST_H__
@@ -21,12 +36,15 @@ class QResizeEvent;
class QScrollBar;
class QWheelEvent;
//class QMenu;
-class PopupMenu;
class ScrollScale;
class Track;
class Xml;
+
+namespace MusEWidget {
class Header;
+class PopupMenu;
+}
enum TrackColumn {
COL_RECORD = 0,
@@ -55,7 +73,7 @@ class TList : public QWidget {
QPixmap bgPixmap; // background Pixmap
bool resizeFlag; // true if resize cursor is shown
- Header* header;
+ MusEWidget::Header* header;
QScrollBar* _scroll;
QLineEdit* editor;
QSpinBox* chan_edit;
@@ -90,7 +108,7 @@ class TList : public QWidget {
TrackList getRecEnabledTracks();
void setHeaderToolTips();
//QMenu* colorMenu(QColor c, int id);
- PopupMenu* colorMenu(QColor c, int id);
+ MusEWidget::PopupMenu* colorMenu(QColor c, int id);
private slots:
void returnPressed();
@@ -115,7 +133,7 @@ class TList : public QWidget {
void selectTrackBelow();
public:
- TList(Header*, QWidget* parent, const char* name);
+ TList(MusEWidget::Header*, QWidget* parent, const char* name);
void setScroll(QScrollBar* s) { _scroll = s; }
Track* track() const { return editTrack; }
void writeStatus(int level, Xml&, const char* name) const;
diff --git a/muse2/muse/arranger/trackautomationview.cpp b/muse2/muse/arranger/trackautomationview.cpp
index 8f7cfb12..343d853f 100644
--- a/muse2/muse/arranger/trackautomationview.cpp
+++ b/muse2/muse/arranger/trackautomationview.cpp
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/arranger/trackautomationview.cpp $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#include "trackautomationview.h"
#include "math.h"
diff --git a/muse2/muse/arranger/trackautomationview.h b/muse2/muse/arranger/trackautomationview.h
index 2ef05125..360ea898 100644
--- a/muse2/muse/arranger/trackautomationview.h
+++ b/muse2/muse/arranger/trackautomationview.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/arranger/trackautomationview.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef TRACKAUTOMATIONVIEW_H
#define TRACKAUTOMATIONVIEW_H
diff --git a/muse2/muse/audio.cpp b/muse2/muse/audio.cpp
index 668c2a30..60eb5c73 100644
--- a/muse2/muse/audio.cpp
+++ b/muse2/muse/audio.cpp
@@ -4,6 +4,22 @@
// $Id: audio.cpp,v 1.59.2.30 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
@@ -15,10 +31,8 @@
#include "song.h"
#include "node.h"
#include "audiodev.h"
-//#include "driver/audiodev.h" // p4.0.2
#include "mididev.h"
#include "alsamidi.h"
-//#include "driver/alsamidi.h" // p4.0.2
#include "synth.h"
#include "audioprefetch.h"
#include "plugin.h"
@@ -33,12 +47,14 @@
#include "pos.h"
#include "ticksynth.h"
+namespace MusEUtil {
extern double curTime();
+}
+
Audio* audio;
AudioDevice* audioDevice; // current audio device in use
-// p3.3.25
-extern unsigned int volatile midiExtSyncTicks;
+extern unsigned int volatile midiExtSyncTicks; // p3.3.25
//static const unsigned char mmcDeferredPlayMsg[] = { 0x7f, 0x7f, 0x06, 0x03 };
@@ -68,11 +84,11 @@ const char* seqMsgList[] = {
"MIDI_SHOW_INSTR_NATIVE_GUI",
"AUDIO_RECORD",
"AUDIO_ROUTEADD", "AUDIO_ROUTEREMOVE", "AUDIO_REMOVEROUTES",
- "AUDIO_VOL", "AUDIO_PAN",
+ //"AUDIO_VOL", "AUDIO_PAN",
"AUDIO_ADDPLUGIN",
"AUDIO_SET_SEG_SIZE",
"AUDIO_SET_PREFADER", "AUDIO_SET_CHANNELS",
- "AUDIO_SET_PLUGIN_CTRL_VAL",
+ //"AUDIO_SET_PLUGIN_CTRL_VAL",
"AUDIO_SWAP_CONTROLLER_IDX",
"AUDIO_CLEAR_CONTROLLER_EVENTS",
"AUDIO_SEEK_PREV_AC_EVENT",
@@ -108,7 +124,7 @@ Audio::Audio()
_pos.setType(Pos::FRAMES);
_pos.setFrame(0);
- curTickPos = 0;
+ nextTickPos = curTickPos = 0;
midiClick = 0;
clickno = 0;
@@ -122,10 +138,9 @@ Audio::Audio()
state = STOP;
msg = 0;
- // Changed by Tim. p3.3.8
//startRecordPos.setType(Pos::TICKS);
//endRecordPos.setType(Pos::TICKS);
- startRecordPos.setType(Pos::FRAMES);
+ startRecordPos.setType(Pos::FRAMES); // Tim
endRecordPos.setType(Pos::FRAMES);
_audioMonitor = 0;
@@ -164,21 +179,17 @@ extern bool initJackAudio();
bool Audio::start()
{
- //process(segmentSize); // warm up caches
+ //process(MusEGlobal::segmentSize); // warm up caches
state = STOP;
_loopCount = 0;
- muse->setHeartBeat();
+ MusEGlobal::muse->setHeartBeat();
if (audioDevice) {
- // Added by Tim. p3.3.6
//_running = true;
-
//audioDevice->start();
}
else {
if(false == initJackAudio()) {
- // Added by Tim. p3.3.6
//_running = true;
-
InputList* itl = song->inputs();
for (iAudioInput i = itl->begin(); i != itl->end(); ++i) {
//printf("reconnecting input %s\n", (*i)->name().ascii());
@@ -203,7 +214,7 @@ bool Audio::start()
}
}
- audioDevice->start(realTimePriority);
+ audioDevice->start(MusEGlobal::realTimePriority);
_running = true;
@@ -235,25 +246,6 @@ void Audio::stop(bool)
bool Audio::sync(int jackState, unsigned frame)
{
-
-// Changed by Tim. p3.3.24
-/*
- bool done = true;
- if (state == LOOP1)
- state = LOOP2;
- else {
- if (_pos.frame() != frame) {
- Pos p(frame, false);
- seek(p);
- }
- state = State(jackState);
- if (!_freewheel)
- //done = audioPrefetch->seekDone;
- done = audioPrefetch->seekDone();
- }
-
- return done;
-*/
bool done = true;
if (state == LOOP1)
state = LOOP2;
@@ -265,8 +257,6 @@ bool Audio::sync(int jackState, unsigned frame)
// PLAY -> START_PLAY seek in play state
if (state != START_PLAY) {
- //Pos p(frame, AL::FRAMES);
- // seek(p);
Pos p(frame, false);
seek(p);
if (!_freewheel)
@@ -275,10 +265,8 @@ bool Audio::sync(int jackState, unsigned frame)
state = START_PLAY;
}
else {
- //if (frame != _seqTime.pos.frame()) {
if (frame != _pos.frame()) {
// seek during seek
- //seek(Pos(frame, AL::FRAMES));
seek(Pos(frame, false));
}
done = audioPrefetch->seekDone();
@@ -317,11 +305,10 @@ void Audio::shutdown()
void Audio::process(unsigned frames)
{
- // Disabled by Tim. p3.3.22
// extern int watchAudio;
-// ++watchAudio; // make a simple watchdog happy
+// ++watchAudio; // make a simple watchdog happy. Disabled.
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
if (msg) {
processMsg(msg);
int sn = msg->serialNo;
@@ -343,7 +330,7 @@ void Audio::process(unsigned frames)
int jackState = audioDevice->getState();
- //if(debugMsg)
+ //if(MusEGlobal::debugMsg)
// printf("Audio::process Current state:%s jackState:%s\n", audioStates[state], audioStates[jackState]);
if (state == START_PLAY && jackState == PLAY) {
@@ -359,8 +346,8 @@ void Audio::process(unsigned frames)
startRolling();
}
else if (isPlaying() && jackState == STOP) {
- // p3.3.43 Make sure to stop bounce and freewheel mode, for example if user presses stop
- // in QJackCtl before right-hand marker is reached (which is handled below).
+ // Make sure to stop bounce and freewheel mode, for example if user presses stop
+ // in QJackCtl before right-hand marker is reached (which is handled below). p3.3.43
//printf("Audio::process isPlaying() && jackState == STOP\n");
//if (_bounce)
//{
@@ -402,7 +389,7 @@ void Audio::process(unsigned frames)
AudioAux* a = (AudioAux*)((*al)[i]);
float** dst = a->sendBuffer();
for (int ch = 0; ch < a->channels(); ++ch)
- memset(dst[ch], 0, sizeof(float) * segmentSize);
+ memset(dst[ch], 0, sizeof(float) * MusEGlobal::segmentSize);
}
for (iAudioOutput i = ol->begin(); i != ol->end(); ++i)
@@ -427,7 +414,7 @@ void Audio::process(unsigned frames)
&& !(song->record()
|| _bounce
|| song->loop())) {
- //if(debugMsg)
+ //if(MusEGlobal::debugMsg)
// printf("Audio::process curTickPos >= song->len\n");
audioDevice->stopTransport();
@@ -467,15 +454,11 @@ void Audio::process(unsigned frames)
//audioDevice->seekTransport(_loopFrame);
Pos lp(_loopFrame, false);
audioDevice->seekTransport(lp);
-
-
// printf(" process: seek to %d, end %d\n", _loopFrame, loop.frame());
}
}
-
- // p3.3.25
- if(extSyncFlag.value())
+ if(extSyncFlag.value()) // p3.3.25
{
nextTickPos = curTickPos + midiExtSyncTicks;
// Probably not good - interfere with midi thread.
@@ -493,7 +476,7 @@ void Audio::process(unsigned frames)
// resync with audio interface
//
syncFrame = audioDevice->framePos();
- syncTime = curTime();
+ syncTime = MusEUtil::curTime();
frameOffset = syncFrame - samplePos;
//printf("Audio::process calling process1:\n");
@@ -513,7 +496,7 @@ void Audio::process(unsigned frames)
void Audio::process1(unsigned samplePos, unsigned offset, unsigned frames)
{
- if (midiSeqRunning) {
+ if (MusEGlobal::midiSeqRunning) {
processMidi();
}
//midiSeq->msgProcess();
@@ -531,7 +514,6 @@ void Audio::process1(unsigned samplePos, unsigned offset, unsigned frames)
continue;
track = (AudioTrack*)(*it);
- // Added by T356.
// For audio track types, synths etc. which need some kind of non-audio
// (but possibly audio-affecting) processing always, even if their output path
// is ultimately unconnected.
@@ -542,23 +524,10 @@ void Audio::process1(unsigned samplePos, unsigned offset, unsigned frames)
// It should be used for things like midi events, gui events etc. - things which need to
// be done BEFORE all the AudioOutput::process() are called below. That does NOT include
// audio processing, because THAT is done at the very end of this routine.
- // This will also reset the track's processed flag.
+ // This will also reset the track's processed flag. Tim.
track->preProcessAlways();
-
- // Removed by T356
- /*
- if (track->noOutRoute() && !track->noInRoute() &&
- track->type() != Track::AUDIO_AUX && track->type() != Track::AUDIO_OUTPUT) {
- channels = track->channels();
- float* buffer[channels];
- float data[frames * channels];
- for (int i = 0; i < channels; ++i)
- buffer[i] = data + i * frames;
- track->copyData(samplePos, channels, frames, buffer);
- }
- */
-
}
+
// Pre-process the metronome.
((AudioTrack*)metronome)->preProcessAlways();
@@ -566,29 +535,12 @@ void Audio::process1(unsigned samplePos, unsigned offset, unsigned frames)
for (ciAudioOutput i = ol->begin(); i != ol->end(); ++i)
(*i)->process(samplePos, offset, frames);
- // Removed by T356
- /*
- AuxList* auxl = song->auxs();
- for (ciAudioAux ia = auxl->begin(); ia != auxl->end(); ++ia) {
- track = (AudioTrack*)(*ia);
- if (track->noOutRoute()) {
- channels = track->channels();
- float* buffer[channels];
- float data[frames * channels];
- for (int i = 0; i < channels; ++i)
- buffer[i] = data + i * frames;
- track->copyData(samplePos, channels, frames, buffer);
- }
- }
- */
-
- // Added by T356.
// Were ANY tracks unprocessed as a result of processing all the AudioOutputs, above?
// Not just unconnected ones, as previously done, but ones whose output path ultimately leads nowhere.
// Those tracks were missed, until this fix.
// Do them now. This will animate meters, and 'quietly' process some audio which needs to be done -
- // for example synths really need to be processed, 'quietly' or not, otherwise the next time
- // processing is 'turned on', if there was a backlog of events while it was off, then they all happen at once.
+ // for example synths really need to be processed, 'quietly' or not, otherwise the next time processing
+ // is 'turned on', if there was a backlog of events while it was off, then they all happen at once. Tim.
for(ciTrack it = tl->begin(); it != tl->end(); ++it)
{
if((*it)->isMidiTrack())
@@ -605,9 +557,6 @@ void Audio::process1(unsigned samplePos, unsigned offset, unsigned frames)
for (int i = 0; i < channels; ++i)
buffer[i] = data + i * frames;
//printf("Audio::process1 calling track->copyData for track:%s\n", track->name().toLatin1());
-
- // p3.3.38
- //track->copyData(samplePos, channels, frames, buffer);
track->copyData(samplePos, channels, -1, -1, frames, buffer);
}
}
@@ -629,15 +578,15 @@ void Audio::processMsg(AudioMsg* msg)
case AUDIO_ROUTEREMOVE:
removeRoute(msg->sroute, msg->droute);
break;
- case AUDIO_REMOVEROUTES: // p3.3.55
+ case AUDIO_REMOVEROUTES:
removeAllRoutes(msg->sroute, msg->droute);
break;
- case AUDIO_VOL:
- msg->snode->setVolume(msg->dval);
- break;
- case AUDIO_PAN:
- msg->snode->setPan(msg->dval);
- break;
+ //case AUDIO_VOL:
+ // msg->snode->setVolume(msg->dval);
+ // break;
+ //case AUDIO_PAN:
+ // msg->snode->setPan(msg->dval);
+ // break;
case SEQM_SET_AUX:
msg->snode->setAuxSend(msg->ival, msg->dval);
break;
@@ -650,11 +599,10 @@ void Audio::processMsg(AudioMsg* msg)
case AUDIO_ADDPLUGIN:
msg->snode->addPlugin(msg->plugin, msg->ival);
break;
- case AUDIO_SET_PLUGIN_CTRL_VAL:
+ //case AUDIO_SET_PLUGIN_CTRL_VAL:
//msg->plugin->track()->setPluginCtrlVal(msg->ival, msg->dval);
- // p3.3.43
- msg->snode->setPluginCtrlVal(msg->ival, msg->dval);
- break;
+ // msg->snode->setPluginCtrlVal(msg->ival, msg->dval);
+ // break;
case AUDIO_SWAP_CONTROLLER_IDX:
msg->snode->swapControllerIDX(msg->a, msg->b);
break;
@@ -688,14 +636,14 @@ void Audio::processMsg(AudioMsg* msg)
break;
case AUDIO_SET_SEG_SIZE:
- segmentSize = msg->ival;
- sampleRate = msg->iival;
+ MusEGlobal::segmentSize = msg->ival;
+ MusEGlobal::sampleRate = msg->iival;
#if 0 //TODO
- audioOutput.segmentSizeChanged();
+ audioOutput.MusEGlobal::segmentSizeChanged();
for (int i = 0; i < mixerGroups; ++i)
- audioGroups[i].segmentSizeChanged();
+ audioGroups[i].MusEGlobal::segmentSizeChanged();
for (iSynthI ii = synthiInstances.begin(); ii != synthiInstances.end();++ii)
- (*ii)->segmentSizeChanged();
+ (*ii)->MusEGlobal::segmentSizeChanged();
#endif
break;
@@ -703,8 +651,8 @@ void Audio::processMsg(AudioMsg* msg)
//printf("Audio::processMsg SEQM_RESET_DEVICES\n");
for (int i = 0; i < MIDI_PORTS; ++i)
{
- if(!midiPorts[i].device()) continue; // p4.0.15
- midiPorts[i].instrument()->reset(i, song->mtype());
+ if(midiPorts[i].device())
+ midiPorts[i].instrument()->reset(i, song->mtype());
}
break;
case SEQM_INIT_DEVICES:
@@ -741,7 +689,7 @@ void Audio::processMsg(AudioMsg* msg)
case MIDI_SHOW_INSTR_GUI:
midiSeq->msgUpdatePollFd();
break;
- case MIDI_SHOW_INSTR_NATIVE_GUI: // p4.0.20
+ case MIDI_SHOW_INSTR_NATIVE_GUI:
midiSeq->msgUpdatePollFd();
break;
case SEQM_ADD_TEMPO:
@@ -750,20 +698,20 @@ void Audio::processMsg(AudioMsg* msg)
case SEQM_SET_TEMPO:
song->processMsg(msg);
if (isPlaying()) {
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
_pos.setTick(curTickPos);
int samplePos = _pos.frame();
syncFrame = audioDevice->framePos();
- syncTime = curTime();
+ syncTime = MusEUtil::curTime();
frameOffset = syncFrame - samplePos;
}
break;
- case SEQM_ADD_TRACK:
- case SEQM_REMOVE_TRACK:
- case SEQM_CHANGE_TRACK:
- case SEQM_ADD_PART:
- case SEQM_REMOVE_PART:
- case SEQM_CHANGE_PART:
+ //case SEQM_ADD_TRACK:
+ //case SEQM_REMOVE_TRACK:
+ //case SEQM_CHANGE_TRACK:
+ //case SEQM_ADD_PART:
+ //case SEQM_REMOVE_PART:
+ //case SEQM_CHANGE_PART:
case SEQM_SET_TRACK_OUT_CHAN:
case SEQM_SET_TRACK_OUT_PORT:
case SEQM_REMAP_PORT_DRUM_CTL_EVS:
@@ -791,147 +739,30 @@ void Audio::processMsg(AudioMsg* msg)
void Audio::seek(const Pos& p)
{
if (_pos == p) {
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("Audio::seek already there\n");
return;
}
-
- // p3.3.23
- //printf("Audio::seek frame:%d\n", p.frame());
+ //printf("Audio::seek frame:%d\n", p.frame());
_pos = p;
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
syncFrame = audioDevice->framePos();
frameOffset = syncFrame - _pos.frame();
curTickPos = _pos.tick();
- // p4.0.22
- // Tell midi thread to tell ALSA devices to handle seek.
- midiSeq->msgSeek();
- // We are in the audio thread. Directly seek Jack midi devices.
+ if (curTickPos == 0 && !song->record())
+ audio->initDevices();
+
for(iMidiDevice i = midiDevices.begin(); i != midiDevices.end(); ++i)
- {
- MidiDevice* md = *i;
- if(md->deviceType() == MidiDevice::JACK_MIDI)
- md->handleSeek();
- }
-
- // Moved into MidiDevice::handleSeek
- #if 0
- // p3.3.31
- // Don't send if external sync is on. The master, and our sync routing system will take care of that.
- if(!extSyncFlag.value())
- {
-
- for(int port = 0; port < MIDI_PORTS; ++port)
- {
- MidiPort* mp = &midiPorts[port];
- MidiDevice* dev = mp->device();
- //if(!dev || !mp->syncInfo().MCOut())
- if(!dev || !mp->syncInfo().MRTOut())
- continue;
-
- // Added by T356: Shall we check for device write open flag to see if it's ok to send?...
- // This means obey what the user has chosen for read/write in the midi port config dialog,
- // which already takes into account whether the device is writable or not.
- //if(!(dev->rwFlags() & 0x1) || !(dev->openFlags() & 1))
- //if(!(dev->openFlags() & 1))
- // continue;
-
- //int port = dev->midiPort();
-
- // By checking for no port here (-1), (and out of bounds), it means
- // the device must be assigned to a port for these MMC commands to be sent.
- // Without this check, interesting sync things can be done by the user without ever
- // assigning any devices to ports !
- //if(port < 0 || port > MIDI_PORTS)
- //if(port < -1 || port > MIDI_PORTS)
- // continue;
-
- int beat = (curTickPos * 4) / config.division;
-
- bool isPlaying=false;
- if(state == PLAY)
- isPlaying = true;
-
- mp->sendStop();
- mp->sendSongpos(beat);
- if(isPlaying)
- mp->sendContinue();
- }
- }
- #endif
-
- /*
- if(genMCSync)
- {
- for(iMidiDevice imd = midiDevices.begin(); imd != midiDevices.end(); ++imd)
- {
- MidiDevice* dev = (*imd);
- if(!dev->syncInfo().MCOut())
- continue;
-
- // Added by T356: Shall we check for device write open flag to see if it's ok to send?...
- // This means obey what the user has chosen for read/write in the midi port config dialog,
- // which already takes into account whether the device is writable or not.
- //if(!(dev->rwFlags() & 0x1) || !(dev->openFlags() & 1))
- //if(!(dev->openFlags() & 1))
- // continue;
-
- int port = dev->midiPort();
-
- // By checking for no port here (-1), (and out of bounds), it means
- // the device must be assigned to a port for these MMC commands to be sent.
- // Without this check, interesting sync things can be done by the user without ever
- // assigning any devices to ports !
- //if(port < 0 || port > MIDI_PORTS)
- if(port < -1 || port > MIDI_PORTS)
- continue;
-
- int beat = (curTickPos * 4) / config.division;
-
- bool isPlaying=false;
- if(state == PLAY)
- isPlaying = true;
-
- if(port == -1)
- // Send straight to the device... Copied from MidiPort.
- {
- MidiPlayEvent event(0, 0, 0, ME_STOP, 0, 0);
- dev->putEvent(event);
-
- event.setType(ME_SONGPOS);
- event.setA(beat);
- dev->putEvent(event);
-
- if(isPlaying)
- {
- event.setType(ME_CONTINUE);
- event.setA(0);
- dev->putEvent(event);
- }
- }
- else
- // Go through the port...
- {
- MidiPort* mp = &midiPorts[port];
-
- mp->sendStop();
- mp->sendSongpos(beat);
- if(isPlaying)
- mp->sendContinue();
- }
- }
- }
- */
+ (*i)->handleSeek();
//loopPassed = true; // for record loop mode
if (state != LOOP2 && !freewheel())
{
- // Changed by T356 08/17/08. We need to force prefetch to update,
- // to ensure the most recent data. Things can happen to a part
- // before play is pressed - such as part muting, part moving etc.
- // Without a force, the wrong data was being played.
//audioPrefetch->msgSeek(_pos.frame());
+ // We need to force prefetch to update, to ensure the most recent data.
+ // Things can happen to a part before play is pressed - such as part muting,
+ // part moving etc. Without a force, the wrong data was being played. Tim 08/17/08
audioPrefetch->msgSeek(_pos.frame(), true);
}
@@ -966,9 +797,7 @@ void Audio::writeTick()
void Audio::startRolling()
{
- // Changed by Tim. p3.3.8
- //startRecordPos = _pos;
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("startRolling - loopCount=%d, _pos=%d\n", _loopCount, _pos.tick());
if(_loopCount == 0) {
@@ -987,20 +816,9 @@ void Audio::startRolling()
state = PLAY;
write(sigFd, "1", 1); // Play
- // p3.3.31
// Don't send if external sync is on. The master, and our sync routing system will take care of that.
if(!extSyncFlag.value())
{
-
- // Changed by Tim. p3.3.6
- //if (genMMC)
- // midiPorts[txSyncPort].sendSysex(mmcDeferredPlayMsg, sizeof(mmcDeferredPlayMsg));
- //if (genMCSync) {
- // if (curTickPos)
- // midiPorts[txSyncPort].sendContinue();
- // else
- // midiPorts[txSyncPort].sendStart();
- // }
for(int port = 0; port < MIDI_PORTS; ++port)
{
MidiPort* mp = &midiPorts[port];
@@ -1015,13 +833,9 @@ void Audio::startRolling()
MidiSyncInfo& si = mp->syncInfo();
- //if(genMMC && si.MMCOut())
if(si.MMCOut())
- //mp->sendSysex(mmcDeferredPlayMsg, sizeof(mmcDeferredPlayMsg));
mp->sendMMCDeferredPlay();
- //if(genMCSync && si.MCOut())
- //if(si.MCOut())
if(si.MRTOut())
{
if(curTickPos)
@@ -1032,69 +846,7 @@ void Audio::startRolling()
}
}
- /*
- for(iMidiDevice imd = midiDevices.begin(); imd != midiDevices.end(); ++imd)
- {
- MidiDevice* dev = (*imd);
-
- // Shall we check open flags?
- //if(!(dev->rwFlags() & 0x1) || !(dev->openFlags() & 1))
- //if(!(dev->openFlags() & 1))
- // continue;
-
- int port = dev->midiPort();
-
- // Without this -1 check, interesting sync things can be done by the user without ever
- // assigning any devices to ports !
- //if(port < 0 || port > MIDI_PORTS)
- if(port < -1 || port > MIDI_PORTS)
- continue;
-
- MidiSyncInfo& si = dev->syncInfo();
-
- if(port == -1)
- // Send straight to the device... Copied from MidiPort.
- {
- if(genMMC && si.MMCOut())
- {
- MidiPlayEvent event(0, 0, ME_SYSEX, mmcDeferredPlayMsg, sizeof(mmcDeferredPlayMsg));
- dev->putEvent(event);
- }
-
- if(genMCSync && si.MCOut())
- {
- if(curTickPos)
- {
- MidiPlayEvent event(0, 0, 0, ME_CONTINUE, 0, 0);
- dev->putEvent(event);
- }
- else
- {
- MidiPlayEvent event(0, 0, 0, ME_START, 0, 0);
- dev->putEvent(event);
- }
- }
- }
- else
- // Go through the port...
- {
- MidiPort* mp = &midiPorts[port];
-
- if(genMMC && si.MMCOut())
- mp->sendSysex(mmcDeferredPlayMsg, sizeof(mmcDeferredPlayMsg));
-
- if(genMCSync && si.MCOut())
- {
- if(curTickPos)
- mp->sendContinue();
- else
- mp->sendStart();
- }
- }
- }
- */
-
- if (precountEnableFlag
+ if (MusEGlobal::precountEnableFlag
&& song->click()
&& !extSyncFlag.value()
&& song->record()) {
@@ -1132,9 +884,7 @@ void Audio::startRolling()
if(mp->device() != NULL) {
//printf("send enable sustain!!!!!!!! port %d ch %d\n", i,ch);
MidiPlayEvent ev(0, i, ch, ME_CONTROLLER, CTRL_SUSTAIN, 127);
-
- // may cause problems, called from audio thread
- mp->device()->playEvents()->add(ev);
+ mp->device()->addScheduledEvent(ev); // TODO: Not working? Try putEvent
}
}
}
@@ -1149,225 +899,19 @@ void Audio::startRolling()
void Audio::stopRolling()
{
- //if(debugMsg)
+ //if(MusEGlobal::debugMsg)
// printf("Audio::stopRolling state %s\n", audioStates[state]);
state = STOP;
- //playStateExt = false; // not playing // Moved here from MidiSeq::processStop() p4.0.22
-
- // p4.0.22
- // Tell midi thread to clear ALSA device notes and stop stuck notes.
- midiSeq->msgStop();
- // We are in the audio thread. Directly clear Jack midi device notes and stop stuck notes.
+ midiSeq->setExternalPlayState(false); // not playing Moved here from MidiSeq::processStop() p4.0.34
+
for(iMidiDevice id = midiDevices.begin(); id != midiDevices.end(); ++id)
{
MidiDevice* md = *id;
- if(md->deviceType() == MidiDevice::JACK_MIDI)
- md->handleStop();
+ md->handleStop();
}
- // Moved into MidiDevice::handleStop() // p4.0.22
- #if 0 //TODO
- //---------------------------------------------------
- // reset sustain
- //---------------------------------------------------
-
-
- // clear sustain
- for (int i = 0; i < MIDI_PORTS; ++i) {
- MidiPort* mp = &midiPorts[i];
- for (int ch = 0; ch < MIDI_CHANNELS; ++ch) {
- if (mp->hwCtrlState(ch, CTRL_SUSTAIN) == 127) {
- if(mp->device()!=NULL) {
- //printf("send clear sustain!!!!!!!! port %d ch %d\n", i,ch);
- MidiPlayEvent ev(0, i, ch, ME_CONTROLLER, CTRL_SUSTAIN, 0);
- // may cause problems, called from audio thread
- mp->device()->putEvent(ev);
- }
- }
- }
- }
- #endif
-
- // Moved into MidiDevice::handleStop() // p4.0.22
- #if 0
- // p3.3.31
- // Don't send if external sync is on. The master, and our sync routing system will take care of that.
- if(!extSyncFlag.value())
- {
-
- // Changed by Tim. p3.3.6
- //MidiPort* syncPort = &midiPorts[txSyncPort];
- //if (genMMC) {
- // unsigned char mmcPos[] = {
- // 0x7f, 0x7f, 0x06, 0x44, 0x06, 0x01,
- // 0, 0, 0, 0, 0
- // };
- // int frame = tempomap.tick2frame(curTickPos);
- // MTC mtc(double(frame) / double(sampleRate));
- // mmcPos[6] = mtc.h() | (mtcType << 5);
- // mmcPos[7] = mtc.m();
- // mmcPos[8] = mtc.s();
- // mmcPos[9] = mtc.f();
- // mmcPos[10] = mtc.sf();
- // syncPort->sendSysex(mmcStopMsg, sizeof(mmcStopMsg));
- // syncPort->sendSysex(mmcPos, sizeof(mmcPos));
- // }
- //if (genMCSync) { // Midi Clock
- // send STOP and
- // "set song position pointer"
- // syncPort->sendStop();
- // syncPort->sendSongpos(curTickPos * 4 / config.division);
- // }
- for(int port = 0; port < MIDI_PORTS; ++port)
- {
- MidiPort* mp = &midiPorts[port];
- MidiDevice* dev = mp->device();
- if(!dev)
- continue;
-
- // Shall we check open flags?
- //if(!(dev->rwFlags() & 0x1) || !(dev->openFlags() & 1))
- //if(!(dev->openFlags() & 1))
- // continue;
-
- MidiSyncInfo& si = mp->syncInfo();
-
- //if(genMMC && si.MMCOut())
- if(si.MMCOut())
- {
- //unsigned char mmcPos[] = {
- // 0x7f, 0x7f, 0x06, 0x44, 0x06, 0x01,
- // 0, 0, 0, 0, 0
- // };
-
- // p3.3.31
- /*
- int frame = tempomap.tick2frame(curTickPos);
- MTC mtc(double(frame) / double(sampleRate));
- */
-
- //mmcPos[6] = mtc.h() | (mtcType << 5);
- //mmcPos[7] = mtc.m();
- //mmcPos[8] = mtc.s();
- //mmcPos[9] = mtc.f();
- //mmcPos[10] = mtc.sf();
-
- //mp->sendSysex(mmcStopMsg, sizeof(mmcStopMsg));
- mp->sendMMCStop();
- //mp->sendSysex(mmcPos, sizeof(mmcPos));
-
- // p3.3.31
- // Added check of option send continue not start.
- // Hmm, is this required? Seems to make other devices unhappy.
- /*
- if(!si.sendContNotStart())
- mp->sendMMCLocate(mtc.h() | (mtcType << 5),
- mtc.m(), mtc.s(), mtc.f(), mtc.sf());
- */
-
- }
-
- //if(genMCSync && si.MCOut()) // Midi Clock
- //if(si.MCOut()) // Midi Clock
- if(si.MRTOut()) //
- {
- // send STOP and
- // "set song position pointer"
- mp->sendStop();
-
- // p3.3.31
- // Added check of option send continue not start.
- // Hmm, is this required? Seems to make other devices unhappy.
- /*
- if(!si.sendContNotStart())
- mp->sendSongpos(curTickPos * 4 / config.division);
- */
-
- }
- }
- }
- #endif
-
- /*
- for(iMidiDevice imd = midiDevices.begin(); imd != midiDevices.end(); ++imd)
- {
- MidiDevice* dev = (*imd);
-
- // Shall we check open flags?
- //if(!(dev->rwFlags() & 0x1) || !(dev->openFlags() & 1))
- //if(!(dev->openFlags() & 1))
- // continue;
-
- int port = dev->midiPort();
-
- // Without this -1 check, interesting sync things can be done by the user without ever
- // assigning any devices to ports !
- //if(port < 0 || port > MIDI_PORTS)
- if(port < -1 || port > MIDI_PORTS)
- continue;
-
- MidiSyncInfo& si = dev->syncInfo();
-
- MidiPort* mp = 0;
- if(port != -1)
- mp = &midiPorts[port];
-
- if(genMMC && si.MMCOut())
- {
- unsigned char mmcPos[] = {
- 0x7f, 0x7f, 0x06, 0x44, 0x06, 0x01,
- 0, 0, 0, 0, 0
- };
- int frame = tempomap.tick2frame(curTickPos);
- MTC mtc(double(frame) / double(sampleRate));
- mmcPos[6] = mtc.h() | (mtcType << 5);
- mmcPos[7] = mtc.m();
- mmcPos[8] = mtc.s();
- mmcPos[9] = mtc.f();
- mmcPos[10] = mtc.sf();
-
- if(mp)
- // Go through the port...
- {
- mp->sendSysex(mmcStopMsg, sizeof(mmcStopMsg));
- mp->sendSysex(mmcPos, sizeof(mmcPos));
- }
- else
- // Send straight to the device... Copied from MidiPort.
- {
- MidiPlayEvent event(0, 0, ME_SYSEX, mmcStopMsg, sizeof(mmcStopMsg));
- dev->putEvent(event);
-
- event.setData(mmcPos, sizeof(mmcPos));
- dev->putEvent(event);
- }
- }
-
- if(genMCSync && si.MCOut()) // Midi Clock
- {
- // send STOP and
- // "set song position pointer"
- if(mp)
- // Go through the port...
- {
- mp->sendStop();
- mp->sendSongpos(curTickPos * 4 / config.division);
- }
- else
- // Send straight to the device... Copied from MidiPort.
- {
- MidiPlayEvent event(0, 0, 0, ME_STOP, 0, 0);
- dev->putEvent(event);
- event.setType(ME_SONGPOS);
- event.setA(curTickPos * 4 / config.division);
- dev->putEvent(event);
- }
- }
- }
- */
-
WaveTrackList* tracks = song->waves();
for (iWaveTrack i = tracks->begin(); i != tracks->end(); ++i) {
WaveTrack* track = *i;
@@ -1385,7 +929,7 @@ void Audio::stopRolling()
void Audio::recordStop()
{
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("recordStop - startRecordPos=%d\n", startRecordPos.tick());
audio->msgIdle(true); // gain access to all data structures
@@ -1419,9 +963,9 @@ void Audio::recordStop()
// resolve NoteOff events, Controller etc.
//---------------------------------------------------
- //buildMidiEventList(el, mpel, mt, config.division, true);
+ //buildMidiEventList(el, mpel, mt, MusEConfig::config.division, true);
// Do SysexMeta. Do loops.
- buildMidiEventList(el, mpel, mt, config.division, true, true);
+ buildMidiEventList(el, mpel, mt, MusEConfig::config.division, true, true);
song->cmdAddRecordedEvents(mt, el, startRecordPos.tick());
el->clear();
mpel->clear();
@@ -1458,7 +1002,7 @@ void Audio::recordStop()
unsigned int Audio::curFrame() const
{
- return lrint((curTime() - syncTime) * sampleRate) + syncFrame;
+ return lrint((MusEUtil::curTime() - syncTime) * MusEGlobal::sampleRate) + syncFrame;
}
//---------------------------------------------------------
diff --git a/muse2/muse/audio.h b/muse2/muse/audio.h
index ea9986c3..03e48e23 100644
--- a/muse2/muse/audio.h
+++ b/muse2/muse/audio.h
@@ -4,6 +4,22 @@
// $Id: audio.h,v 1.25.2.13 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __AUDIO_H__
@@ -62,11 +78,11 @@ enum {
MIDI_SHOW_INSTR_NATIVE_GUI,
AUDIO_RECORD,
AUDIO_ROUTEADD, AUDIO_ROUTEREMOVE, AUDIO_REMOVEROUTES,
- AUDIO_VOL, AUDIO_PAN,
+ //AUDIO_VOL, AUDIO_PAN,
AUDIO_ADDPLUGIN,
AUDIO_SET_SEG_SIZE,
AUDIO_SET_PREFADER, AUDIO_SET_CHANNELS,
- AUDIO_SET_PLUGIN_CTRL_VAL,
+ //AUDIO_SET_PLUGIN_CTRL_VAL,
AUDIO_SWAP_CONTROLLER_IDX,
AUDIO_CLEAR_CONTROLLER_EVENTS,
AUDIO_SEEK_PREV_AC_EVENT,
@@ -224,14 +240,14 @@ class Audio {
bool sendMessage(AudioMsg* m, bool doUndo);
void msgRemoveRoute(Route, Route);
void msgRemoveRoute1(Route, Route);
- void msgRemoveRoutes(Route, Route); // p3.3.55
- void msgRemoveRoutes1(Route, Route); // p3.3.55
+ void msgRemoveRoutes(Route, Route);
+ void msgRemoveRoutes1(Route, Route);
void msgAddRoute(Route, Route);
void msgAddRoute1(Route, Route);
void msgAddPlugin(AudioTrack*, int idx, PluginI* plugin);
void msgSetMute(AudioTrack*, bool val);
- void msgSetVolume(AudioTrack*, double val);
- void msgSetPan(AudioTrack*, double val);
+ //void msgSetVolume(AudioTrack*, double val);
+ //void msgSetPan(AudioTrack*, double val);
void msgAddSynthI(SynthI* synth);
void msgRemoveSynthI(SynthI* synth);
void msgSetSegSize(int, int);
@@ -246,7 +262,7 @@ class Audio {
void msgResetMidiDevices();
void msgIdle(bool);
void msgBounce();
- void msgSetPluginCtrlVal(AudioTrack*, int /*param*/, double /*val*/);
+ //void msgSetPluginCtrlVal(AudioTrack*, int /*param*/, double /*val*/);
void msgSwapControllerIDX(AudioTrack*, int, int);
void msgClearControllerEvents(AudioTrack*, int);
void msgSeekPrevACEvent(AudioTrack*, int);
@@ -275,7 +291,8 @@ class Audio {
int loopCount() { return _loopCount; } // Number of times we have looped so far
unsigned loopFrame() { return _loopFrame; }
- int tickPos() const { return curTickPos; }
+ unsigned tickPos() const { return curTickPos; }
+ unsigned nextTick() const { return nextTickPos; }
int timestamp() const;
void processMidi();
unsigned curFrame() const;
diff --git a/muse2/muse/audioconvert.cpp b/muse2/muse/audioconvert.cpp
index ced8e703..6b67f30e 100644
--- a/muse2/muse/audioconvert.cpp
+++ b/muse2/muse/audioconvert.cpp
@@ -7,6 +7,22 @@
//
// Audio converter module created by Tim
// (C) Copyright 2009-2011 Tim E. Real (terminator356 A T sourceforge D O T net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//
//=========================================================
#include <math.h>
@@ -126,7 +142,7 @@ off_t AudioConverter::readAudio(SndFileR& f, unsigned offset, float** buffer, in
off_t frame = offset; // _spos is added before the call.
unsigned fsrate = f.samplerate();
- bool resample = isValid() && ((unsigned)sampleRate != fsrate);
+ bool resample = isValid() && ((unsigned)MusEGlobal::sampleRate != fsrate);
// No resampling needed?
if(!resample)
@@ -143,7 +159,7 @@ off_t AudioConverter::readAudio(SndFileR& f, unsigned offset, float** buffer, in
{
// Sample rates are different. Seek to a calculated 'sample rate ratio factored' position.
- double srcratio = (double)fsrate / (double)sampleRate;
+ double srcratio = (double)fsrate / (double)MusEGlobal::sampleRate;
//long inSize = long((double)frames * _src_ratio) + 1 // From MusE-2 file converter.
off_t newfr = (off_t)floor(((double)frame * srcratio)); // From simplesynth.
@@ -327,13 +343,13 @@ off_t SRCAudioConverter::process(SndFileR& f, float** buffer, int channel, int n
// off_t frame = offset; // _spos is added before the call.
unsigned fsrate = f.samplerate();
- //bool resample = src_state && ((unsigned)sampleRate != fsrate);
-// bool resample = isValid() && ((unsigned)sampleRate != fsrate);
+ //bool resample = src_state && ((unsigned)MusEGlobal::sampleRate != fsrate);
+// bool resample = isValid() && ((unsigned)MusEGlobal::sampleRate != fsrate);
- if((sampleRate == 0) || (fsrate == 0))
+ if((MusEGlobal::sampleRate == 0) || (fsrate == 0))
{
#ifdef AUDIOCONVERT_DEBUG
- printf("SRCAudioConverter::process Error: sampleRate or file samplerate is zero!\n");
+ printf("SRCAudioConverter::process Error: MusEGlobal::sampleRate or file samplerate is zero!\n");
#endif
return _sfCurFrame;
}
@@ -341,7 +357,7 @@ off_t SRCAudioConverter::process(SndFileR& f, float** buffer, int channel, int n
SRC_DATA srcdata;
int fchan = f.channels();
// Ratio is defined as output sample rate over input samplerate.
- double srcratio = (double)sampleRate / (double)fsrate;
+ double srcratio = (double)MusEGlobal::sampleRate / (double)fsrate;
// Extra input compensation.
long inComp = 1;
@@ -353,7 +369,7 @@ off_t SRCAudioConverter::process(SndFileR& f, float** buffer, int channel, int n
//long inSize = (long)floor(((double)outSize / srcratio)); // From simplesynth.
//long inFrames = (long)floor(((double)outFrames / srcratio)); // From simplesynth.
long inFrames = (long)ceil(((double)outFrames / srcratio)) + inComp; // From simplesynth.
- //long inFrames = (long)floor(double(outFrames * sfinfo.samplerate) / double(sampleRate)); // From simplesynth.
+ //long inFrames = (long)floor(double(outFrames * sfinfo.samplerate) / double(MusEGlobal::sampleRate)); // From simplesynth.
long inSize = inFrames * fchan;
//long inSize = inFrames * channel;
@@ -567,7 +583,7 @@ RubberBandAudioConverter::RubberBandAudioConverter(int channels, int options) :
_rbs = 0;
_channels = channels;
- _rbs = new RubberBandStretcher(sampleRate, _channels, _options); // , initialTimeRatio = 1.0, initialPitchScale = 1.0
+ _rbs = new RubberBandStretcher(MusEGlobal::sampleRate, _channels, _options); // , initialTimeRatio = 1.0, initialPitchScale = 1.0
}
RubberBandAudioConverter::~RubberBandAudioConverter()
@@ -589,7 +605,7 @@ void RubberBandAudioConverter::setChannels(int ch)
_rbs = 0;
_channels = ch;
- _rbs = new RubberBandStretcher(sampleRate, _channels, _options); // , initialTimeRatio = 1.0, initialPitchScale = 1.0
+ _rbs = new RubberBandStretcher(MusEGlobal::sampleRate, _channels, _options); // , initialTimeRatio = 1.0, initialPitchScale = 1.0
}
void RubberBandAudioConverter::reset()
@@ -623,13 +639,13 @@ off_t RubberBandAudioConverter::process(SndFileR& f, float** buffer, int channel
// off_t frame = offset; // _spos is added before the call.
unsigned fsrate = f.samplerate();
- //bool resample = src_state && ((unsigned)sampleRate != fsrate);
-// bool resample = isValid() && ((unsigned)sampleRate != fsrate);
+ //bool resample = src_state && ((unsigned)MusEGlobal::sampleRate != fsrate);
+// bool resample = isValid() && ((unsigned)MusEGlobal::sampleRate != fsrate);
- if((sampleRate == 0) || (fsrate == 0))
+ if((MusEGlobal::sampleRate == 0) || (fsrate == 0))
{
#ifdef AUDIOCONVERT_DEBUG
- printf("RubberBandAudioConverter::process Error: sampleRate or file samplerate is zero!\n");
+ printf("RubberBandAudioConverter::process Error: MusEGlobal::sampleRate or file samplerate is zero!\n");
#endif
return _sfCurFrame;
}
@@ -637,7 +653,7 @@ off_t RubberBandAudioConverter::process(SndFileR& f, float** buffer, int channel
// SRC_DATA srcdata;
int fchan = f.channels();
// Ratio is defined as output sample rate over input samplerate.
- double srcratio = (double)sampleRate / (double)fsrate;
+ double srcratio = (double)MusEGlobal::sampleRate / (double)fsrate;
// Extra input compensation.
long inComp = 1;
@@ -649,7 +665,7 @@ off_t RubberBandAudioConverter::process(SndFileR& f, float** buffer, int channel
//long inSize = (long)floor(((double)outSize / srcratio)); // From simplesynth.
//long inFrames = (long)floor(((double)outFrames / srcratio)); // From simplesynth.
long inFrames = (long)ceil(((double)outFrames / srcratio)) + inComp; // From simplesynth.
- //long inFrames = (long)floor(double(outFrames * sfinfo.samplerate) / double(sampleRate)); // From simplesynth.
+ //long inFrames = (long)floor(double(outFrames * sfinfo.samplerate) / double(MusEGlobal::sampleRate)); // From simplesynth.
long inSize = inFrames * fchan;
//long inSize = inFrames * channel;
diff --git a/muse2/muse/audioconvert.h b/muse2/muse/audioconvert.h
index 0933de60..13331a67 100644
--- a/muse2/muse/audioconvert.h
+++ b/muse2/muse/audioconvert.h
@@ -7,6 +7,21 @@
//
// Audio converter module created by Tim
// (C) Copyright 2009-2011 Tim E. Real (terminator356 A T sourceforge D O T net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __AUDIOCONVERT_H__
diff --git a/muse2/muse/audioprefetch.cpp b/muse2/muse/audioprefetch.cpp
index b2ddab8c..cfdbb213 100644
--- a/muse2/muse/audioprefetch.cpp
+++ b/muse2/muse/audioprefetch.cpp
@@ -4,6 +4,21 @@
// $Id: audioprefetch.cpp,v 1.14.2.7 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <poll.h>
@@ -168,7 +183,7 @@ void AudioPrefetch::prefetch(bool doSeek)
if (song->loop() && !audio->bounce() && !extSyncFlag.value()) {
const Pos& loop = song->rPos();
unsigned n = loop.frame() - writePos;
- if (n < segmentSize) {
+ if (n < MusEGlobal::segmentSize) {
unsigned lpos = song->lPos().frame();
// adjust loop start so we get exact loop len
if (n > lpos)
@@ -188,18 +203,18 @@ void AudioPrefetch::prefetch(bool doSeek)
int ch = track->channels();
float* bp[ch];
// printf("prefetch %d\n", writePos);
- if (track->prefetchFifo()->getWriteBuffer(ch, segmentSize, bp, writePos)) {
+ if (track->prefetchFifo()->getWriteBuffer(ch, MusEGlobal::segmentSize, bp, writePos)) {
// printf("AudioPrefetch::prefetch No write buffer!\n"); // p3.3.46 Was getting this...
continue;
}
- //track->fetchData(writePos, segmentSize, bp);
- track->fetchData(writePos, segmentSize, bp, doSeek);
+ //track->fetchData(writePos, MusEGlobal::segmentSize, bp);
+ track->fetchData(writePos, MusEGlobal::segmentSize, bp, doSeek);
// p3.3.41
- //fprintf(stderr, "AudioPrefetch::prefetch data: segmentSize:%ld %e %e %e %e\n", segmentSize, bp[0][0], bp[0][1], bp[0][2], bp[0][3]);
+ //fprintf(stderr, "AudioPrefetch::prefetch data: MusEGlobal::segmentSize:%ld %e %e %e %e\n", MusEGlobal::segmentSize, bp[0][0], bp[0][1], bp[0][2], bp[0][3]);
}
- writePos += segmentSize;
+ writePos += MusEGlobal::segmentSize;
}
//---------------------------------------------------------
@@ -237,7 +252,7 @@ void AudioPrefetch::seek(unsigned seekTo)
}
bool isFirstPrefetch = true;
- for (unsigned int i = 0; i < (fifoLength)-1; ++i)//prevent compiler warning: comparison of signed/unsigned
+ for (unsigned int i = 0; i < (MusEGlobal::fifoLength)-1; ++i)//prevent compiler warning: comparison of signed/unsigned
{
// Indicate do a seek command before read, but only on the first pass.
// Changed by Tim. p3.3.17
diff --git a/muse2/muse/audioprefetch.h b/muse2/muse/audioprefetch.h
index dda4d895..e55251dc 100644
--- a/muse2/muse/audioprefetch.h
+++ b/muse2/muse/audioprefetch.h
@@ -4,6 +4,21 @@
// $Id: audioprefetch.h,v 1.3.2.2 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __AUDIOPREFETCH_H__
diff --git a/muse2/muse/audiotrack.cpp b/muse2/muse/audiotrack.cpp
index 42229111..551b640d 100644
--- a/muse2/muse/audiotrack.cpp
+++ b/muse2/muse/audiotrack.cpp
@@ -4,6 +4,21 @@
// $Id: audiotrack.cpp,v 1.14.2.21 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <values.h>
@@ -23,6 +38,7 @@
#include "audiodev.h"
#include "synth.h"
#include "dssihost.h"
+#include "app.h"
bool AudioAux::_isVisible=true;
bool AudioInput::_isVisible=true;
@@ -96,16 +112,16 @@ AudioTrack::AudioTrack(TrackType t)
// Changed by Tim. p3.3.15
//outBuffers = new float*[MAX_CHANNELS];
//for (int i = 0; i < MAX_CHANNELS; ++i)
- // outBuffers[i] = new float[segmentSize];
+ // outBuffers[i] = new float[MusEGlobal::segmentSize];
//for (int i = 0; i < MAX_CHANNELS; ++i)
- // posix_memalign((void**)(outBuffers + i), 16, sizeof(float) * segmentSize);
+ // posix_memalign((void**)(outBuffers + i), 16, sizeof(float) * MusEGlobal::segmentSize);
// Let's allocate it all in one block, and just point the remaining buffer pointers into the block
// which allows faster one-shot buffer copying.
// Nope. Nice but interferes with possibility we don't know if other buffers are contiguous (jack buffers, local stack buffers etc.).
- //posix_memalign((void**)(outBuffers), 16, sizeof(float) * segmentSize * MAX_CHANNELS);
+ //posix_memalign((void**)(outBuffers), 16, sizeof(float) * MusEGlobal::segmentSize * MAX_CHANNELS);
//for (int i = 0; i < MAX_CHANNELS; ++i)
- // *(outBuffers + i) = sizeof(float) * segmentSize * i;
+ // *(outBuffers + i) = sizeof(float) * MusEGlobal::segmentSize * i;
// p3.3.38
// Easy way, less desirable... Start out with enough for MAX_CHANNELS. Then multi-channel syntis can re-allocate,
@@ -114,7 +130,7 @@ AudioTrack::AudioTrack(TrackType t)
_totalOutChannels = MAX_CHANNELS;
outBuffers = new float*[_totalOutChannels];
for (int i = 0; i < _totalOutChannels; ++i)
- posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * segmentSize);
+ posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * MusEGlobal::segmentSize);
// This is only set by multi-channel syntis...
_totalInChannels = 0;
@@ -143,9 +159,9 @@ AudioTrack::AudioTrack(const AudioTrack& t, bool cloneParts)
// Changed by Tim. p3.3.15
//outBuffers = new float*[MAX_CHANNELS];
//for (int i = 0; i < MAX_CHANNELS; ++i)
- // outBuffers[i] = new float[segmentSize];
+ // outBuffers[i] = new float[MusEGlobal::segmentSize];
//for (int i = 0; i < MAX_CHANNELS; ++i)
- // posix_memalign((void**)(outBuffers + i), 16, sizeof(float) * segmentSize);
+ // posix_memalign((void**)(outBuffers + i), 16, sizeof(float) * MusEGlobal::segmentSize);
// p3.3.38
int chans = _totalOutChannels;
@@ -154,7 +170,7 @@ AudioTrack::AudioTrack(const AudioTrack& t, bool cloneParts)
chans = MAX_CHANNELS;
outBuffers = new float*[chans];
for (int i = 0; i < chans; ++i)
- posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * segmentSize);
+ posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * MusEGlobal::segmentSize);
bufferPos = MAXINT;
_recFile = t._recFile;
@@ -549,10 +565,10 @@ void AudioTrack::processAutomationEvents()
}
}
- // Done with the recorded automation event list. Clear it.
+ // Done with the recorded MusEGlobal::automation event list. Clear it.
_recEvents.clear();
- // Try muse without this, so that the user can remain in automation write mode
+ // Try muse without this, so that the user can remain in MusEGlobal::automation write mode
// after a stop.
/*
if (automationType() == AUTO_WRITE)
@@ -606,10 +622,13 @@ void AudioTrack::seekPrevACEvent(int id)
if(cl->empty())
return;
- iCtrl s = cl->lower_bound(song->cPos().frame());
+ //iCtrl s = cl->lower_bound(song->cPos().frame());
+ iCtrl s = cl->lower_bound(audio->pos().frame()); // p4.0.33
if(s != cl->begin())
--s;
- song->setPos(Song::CPOS, Pos(s->second.frame, false), true, false, true);
+
+ //song->setPos(Song::CPOS, Pos(s->second.frame, false), true, false, true);
+ song->setPos(Song::CPOS, Pos(s->second.frame, false), false, true, false); // p4.0.33
return;
}
@@ -627,13 +646,16 @@ void AudioTrack::seekNextACEvent(int id)
if(cl->empty())
return;
- iCtrl s = cl->upper_bound(song->cPos().frame());
+ //iCtrl s = cl->upper_bound(song->cPos().frame());
+ iCtrl s = cl->upper_bound(audio->pos().frame()); // p4.0.33
+
if(s == cl->end())
{
--s;
}
- song->setPos(Song::CPOS, Pos(s->second.frame, false), true, false, true);
+ //song->setPos(Song::CPOS, Pos(s->second.frame, false), true, false, true);
+ song->setPos(Song::CPOS, Pos(s->second.frame, false), false, true, false); // p4.0.33
return;
}
@@ -720,7 +742,7 @@ double AudioTrack::volume() const
if (cl == _controller.end())
return 0.0;
- if (automation &&
+ if (MusEGlobal::automation &&
automationType() != AUTO_OFF && _volumeEnCtrl && _volumeEn2Ctrl )
return cl->second->value(song->cPos().frame());
else
@@ -752,7 +774,7 @@ double AudioTrack::pan() const
if (cl == _controller.end())
return 0.0;
- if (automation &&
+ if (MusEGlobal::automation &&
automationType() != AUTO_OFF && _panEnCtrl && _panEn2Ctrl )
return cl->second->value(song->cPos().frame());
else
@@ -783,7 +805,7 @@ double AudioTrack::pluginCtrlVal(int ctlID) const
if (cl == _controller.end())
return 0.0;
- if (automation && (automationType() != AUTO_OFF))
+ if (MusEGlobal::automation && (automationType() != AUTO_OFF))
return cl->second->value(song->cPos().frame());
else
return cl->second->curVal();
@@ -804,7 +826,7 @@ void AudioTrack::setPluginCtrlVal(int param, double val)
void AudioTrack::recordAutomation(int n, double v)
{
- if(!automation)
+ if(!MusEGlobal::automation)
return;
if(audio->isPlaying())
_recEvents.push_back(CtrlRecVal(song->cPos().frame(), n, v));
@@ -827,7 +849,7 @@ void AudioTrack::recordAutomation(int n, double v)
void AudioTrack::startAutoRecord(int n, double v)
{
- if(!automation)
+ if(!MusEGlobal::automation)
return;
if(audio->isPlaying())
{
@@ -856,7 +878,7 @@ void AudioTrack::startAutoRecord(int n, double v)
void AudioTrack::stopAutoRecord(int n, double v)
{
- if(!automation)
+ if(!MusEGlobal::automation)
return;
if(audio->isPlaying())
{
@@ -877,7 +899,7 @@ void AudioTrack::writeProperties(int level, Xml& xml) const
Track::writeProperties(level, xml);
xml.intTag(level, "prefader", prefader());
xml.intTag(level, "sendMetronome", sendMetronome());
- xml.intTag(level, "automation", int(automationType()));
+ xml.intTag(level, "MusEGlobal::automation", int(automationType()));
if (hasAuxSend()) {
int naux = song->auxs()->size();
for (int idx = 0; idx < naux; ++idx) {
@@ -981,7 +1003,7 @@ bool AudioTrack::readProperties(Xml& xml, const QString& tag)
_prefader = xml.parseInt();
else if (tag == "sendMetronome")
_sendMetronome = xml.parseInt();
- else if (tag == "automation")
+ else if (tag == "MusEGlobal::automation")
setAutomationType(AutomationType(xml.parseInt()));
// Removed by T356
// "recfile" tag not saved anymore
@@ -992,7 +1014,7 @@ bool AudioTrack::readProperties(Xml& xml, const QString& tag)
l->read(xml);
// Since (until now) muse wrote a 'zero' for plugin controller current value
- // in the XML file, we can't use that value, now that plugin automation is added.
+ // in the XML file, we can't use that value, now that plugin MusEGlobal::automation is added.
// We must take the value from the plugin control value.
// Otherwise we break all existing .med files with plugins, because the gui
// controls would all be set to zero.
@@ -1116,7 +1138,7 @@ void AudioTrack::mapRackPluginsToControllers()
// No matter of the outcome of the above - rack position is not too critical -
// making sure that each control has a controller is important. Otherwise they
// are stuck at zero can't be adjusted.
- // Muse med files created before the automation patches (before 0.9pre1) may have broken
+ // Muse med files created before the MusEGlobal::automation patches (before 0.9pre1) may have broken
// controller sections, so this will allow more tolerance of them.
for(int idx = 0; idx < PipelineDepth; idx++)
{
@@ -1334,7 +1356,7 @@ AudioInput::AudioInput(const AudioInput& t, bool cloneParts)
AudioInput::~AudioInput()
{
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
for (int i = 0; i < _channels; ++i)
if(jackPorts[i])
audioDevice->unregisterPort(jackPorts[i]);
@@ -1411,7 +1433,7 @@ AudioOutput::AudioOutput(const AudioOutput& t, bool cloneParts)
AudioOutput::~AudioOutput()
{
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
for (int i = 0; i < _channels; ++i)
if(jackPorts[i])
audioDevice->unregisterPort(jackPorts[i]);
@@ -1523,11 +1545,11 @@ AudioAux::AudioAux()
//setChannels(2);
// Changed by Tim. p3.3.15
//for (int i = 0; i < MAX_CHANNELS; ++i)
- // buffer[i] = (i < channels()) ? new float[segmentSize] : 0;
+ // buffer[i] = (i < channels()) ? new float[MusEGlobal::segmentSize] : 0;
for(int i = 0; i < MAX_CHANNELS; ++i)
{
if(i < channels())
- posix_memalign((void**)(buffer + i), 16, sizeof(float) * segmentSize);
+ posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
else
buffer[i] = 0;
}
@@ -1600,9 +1622,9 @@ void AudioAux::setChannels(int n)
{
// Changed by Tim. p3.3.15
//for (int i = channels(); i < n; ++i)
- // buffer[i] = new float[segmentSize];
+ // buffer[i] = new float[MusEGlobal::segmentSize];
for(int i = channels(); i < n; ++i)
- posix_memalign((void**)(buffer + i), 16, sizeof(float) * segmentSize);
+ posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
}
else if(n < channels())
{
@@ -1650,7 +1672,7 @@ bool AudioTrack::setRecordFlag1(bool f)
setRecFile(0);
remove(s.toLatin1().constData());
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("AudioNode::setRecordFlag1: remove file %s if it exists\n", s.toLatin1().constData());
//_recFile = 0;
}
@@ -1668,7 +1690,7 @@ bool AudioTrack::setRecordFlag1(bool f)
//---------------------------------------------------------
bool AudioTrack::prepareRecording()
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("prepareRecording for track %s\n", _name.toLatin1().constData());
if (_recFile == 0) {
@@ -1677,10 +1699,10 @@ bool AudioTrack::prepareRecording()
//
char buffer[128];
QFile fil;
- for (;;++recFileNumber) {
+ for (;;++MusEGlobal::recFileNumber) {
sprintf(buffer, "%s/rec%d.wav",
- museProject.toLatin1().constData(),
- recFileNumber);
+ MusEGlobal::museProject.toLatin1().constData(),
+ MusEGlobal::recFileNumber);
fil.setFileName(QString(buffer));
if (!fil.exists())
break;
@@ -1688,10 +1710,10 @@ bool AudioTrack::prepareRecording()
_recFile = new SndFile(QString(buffer));
_recFile->setFormat(
SF_FORMAT_WAV | SF_FORMAT_FLOAT,
- _channels, sampleRate);
+ _channels, MusEGlobal::sampleRate);
}
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("AudioNode::setRecordFlag1: init internal file %s\n", _recFile->path().toLatin1().constData());
if(_recFile->openWrite())
diff --git a/muse2/muse/cleftypes.h b/muse2/muse/cleftypes.h
index 8c14a6d3..32697529 100644
--- a/muse2/muse/cleftypes.h
+++ b/muse2/muse/cleftypes.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// cleftypes.h
// (C) Copyright 2011 Florian Jung (flo93@users.sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CLEFTYPES_H__
diff --git a/muse2/muse/cliplist/CMakeLists.txt b/muse2/muse/cliplist/CMakeLists.txt
index a37aa79d..e1804f21 100644
--- a/muse2/muse/cliplist/CMakeLists.txt
+++ b/muse2/muse/cliplist/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/cliplist/cliplist.cpp b/muse2/muse/cliplist/cliplist.cpp
index ada25af9..22bee1ff 100644
--- a/muse2/muse/cliplist/cliplist.cpp
+++ b/muse2/muse/cliplist/cliplist.cpp
@@ -4,6 +4,21 @@
// $Id: cliplist.cpp,v 1.6.2.3 2008/08/18 00:15:24 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QCloseEvent>
@@ -119,16 +134,16 @@ ClipListEdit::ClipListEdit(QWidget* parent)
// Toolbars ---------------------------------------------------------
QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools"));
undo_tools->setObjectName("Undo/Redo tools");
- undo_tools->addActions(undoRedo->actions());
+ undo_tools->addActions(MusEGlobal::undoRedo->actions());
QToolBar* panic_toolbar = addToolBar(tr("panic"));
panic_toolbar->setObjectName("panic");
- panic_toolbar->addAction(panicAction);
+ panic_toolbar->addAction(MusEGlobal::panicAction);
QToolBar* transport_toolbar = addToolBar(tr("transport"));
transport_toolbar->setObjectName("transport");
- transport_toolbar->addActions(transportAction->actions());
+ transport_toolbar->addActions(MusEGlobal::transportAction->actions());
QMenu* settingsMenu = menuBar()->addMenu(tr("Window &Config"));
settingsMenu->addAction(subwinAction);
diff --git a/muse2/muse/cliplist/cliplist.h b/muse2/muse/cliplist/cliplist.h
index 1932e975..e4c8503b 100644
--- a/muse2/muse/cliplist/cliplist.h
+++ b/muse2/muse/cliplist/cliplist.h
@@ -4,6 +4,21 @@
// $Id: cliplist.h,v 1.3.2.1 2005/12/11 21:29:23 spamatica Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CLIPLIST_H__
diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp
index 1dabfe76..a4fbd6c7 100644
--- a/muse2/muse/cobject.cpp
+++ b/muse2/muse/cobject.cpp
@@ -4,6 +4,21 @@
// $Id: cobject.cpp,v 1.4 2004/02/02 12:10:09 wschweer Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "cobject.h"
@@ -19,6 +34,7 @@
#include <QAction>
using std::list;
+using MusEGlobal::muse;
int TopWin::_widthInit[TOPLEVELTYPE_LAST_ENTRY];
int TopWin::_heightInit[TOPLEVELTYPE_LAST_ENTRY];
@@ -212,7 +228,7 @@ void TopWin::setIsMdiWin(bool val)
}
else
{
- if (debugMsg) printf("TopWin::setIsMdiWin(true) called, but window is already a MDI win\n");
+ if (MusEGlobal::debugMsg) printf("TopWin::setIsMdiWin(true) called, but window is already a MDI win\n");
}
}
else
@@ -241,7 +257,7 @@ void TopWin::setIsMdiWin(bool val)
}
else
{
- if (debugMsg) printf("TopWin::setIsMdiWin(false) called, but window is not a MDI win\n");
+ if (MusEGlobal::debugMsg) printf("TopWin::setIsMdiWin(false) called, but window is not a MDI win\n");
}
}
}
@@ -281,7 +297,7 @@ void TopWin::shareToolsAndMenu(bool val)
{
if (_sharesToolsAndMenu == val)
{
- if (debugMsg) printf("TopWin::shareToolsAndMenu() called but has no effect\n");
+ if (MusEGlobal::debugMsg) printf("TopWin::shareToolsAndMenu() called but has no effect\n");
return;
}
diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h
index 1282b259..08fa2b47 100644
--- a/muse2/muse/cobject.h
+++ b/muse2/muse/cobject.h
@@ -4,6 +4,21 @@
// $Id: cobject.h,v 1.3.2.1 2005/12/11 21:29:24 spamatica Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __COBJECT_H__
diff --git a/muse2/muse/conf.cpp b/muse2/muse/conf.cpp
index 5fea91a5..3c07ae83 100644
--- a/muse2/muse/conf.cpp
+++ b/muse2/muse/conf.cpp
@@ -4,6 +4,21 @@
// $Id: conf.cpp,v 1.33.2.18 2009/12/01 03:52:40 terminator356 Exp $
//
// (C) Copyright 1999-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <sndfile.h>
@@ -282,18 +297,18 @@ static void readConfigMidiPort(Xml& xml)
MidiDevice* dev = midiDevices.find(device);
- //if(debugMsg && !dev)
+ //if(MusEGlobal::debugMsg && !dev)
// fprintf(stderr, "readConfigMidiPort: device not found %s\n", device.toLatin1().constData());
if(!dev && type == MidiDevice::JACK_MIDI)
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
fprintf(stderr, "readConfigMidiPort: creating jack midi device %s\n", device.toLatin1().constData());
//dev = MidiJackDevice::createJackMidiDevice(device, openFlags);
dev = MidiJackDevice::createJackMidiDevice(device); // p3.3.55
}
- if(debugMsg && !dev)
+ if(MusEGlobal::debugMsg && !dev)
fprintf(stderr, "readConfigMidiPort: device not found %s\n", device.toLatin1().constData());
MidiPort* mp = &midiPorts[idx];
@@ -416,37 +431,37 @@ static void loadConfigMetronom(Xml& xml)
switch (token) {
case Xml::TagStart:
if (tag == "premeasures")
- preMeasures = xml.parseInt();
+ MusEGlobal::preMeasures = xml.parseInt();
else if (tag == "measurepitch")
- measureClickNote = xml.parseInt();
+ MusEGlobal::measureClickNote = xml.parseInt();
else if (tag == "measurevelo")
- measureClickVelo = xml.parseInt();
+ MusEGlobal::measureClickVelo = xml.parseInt();
else if (tag == "beatpitch")
- beatClickNote = xml.parseInt();
+ MusEGlobal::beatClickNote = xml.parseInt();
else if (tag == "beatvelo")
- beatClickVelo = xml.parseInt();
+ MusEGlobal::beatClickVelo = xml.parseInt();
else if (tag == "channel")
- clickChan = xml.parseInt();
+ MusEGlobal::clickChan = xml.parseInt();
else if (tag == "port")
- clickPort = xml.parseInt();
+ MusEGlobal::clickPort = xml.parseInt();
else if (tag == "precountEnable")
- precountEnableFlag = xml.parseInt();
+ MusEGlobal::precountEnableFlag = xml.parseInt();
else if (tag == "fromMastertrack")
- precountFromMastertrackFlag = xml.parseInt();
+ MusEGlobal::precountFromMastertrackFlag = xml.parseInt();
else if (tag == "signatureZ")
- precountSigZ = xml.parseInt();
+ MusEGlobal::precountSigZ = xml.parseInt();
else if (tag == "signatureN")
- precountSigN = xml.parseInt();
+ MusEGlobal::precountSigN = xml.parseInt();
else if (tag == "prerecord")
- precountPrerecord = xml.parseInt();
+ MusEGlobal::precountPrerecord = xml.parseInt();
else if (tag == "preroll")
- precountPreroll = xml.parseInt();
+ MusEGlobal::precountPreroll = xml.parseInt();
else if (tag == "midiClickEnable")
- midiClickFlag = xml.parseInt();
+ MusEGlobal::midiClickFlag = xml.parseInt();
else if (tag == "audioClickEnable")
- audioClickFlag = xml.parseInt();
- else if (tag == "audioClickVolume")
- audioClickVolume = xml.parseFloat();
+ MusEGlobal::audioClickFlag = xml.parseInt();
+ else if (tag == "MusEGlobal::audioClickVolume")
+ MusEGlobal::audioClickVolume = xml.parseFloat();
else
xml.unknown("Metronome");
break;
@@ -477,17 +492,17 @@ static void readSeqConfiguration(Xml& xml)
else if (tag == "midiport")
readConfigMidiPort(xml);
else if (tag == "rcStop")
- rcStopNote = xml.parseInt();
- else if (tag == "rcEnable")
- rcEnable = xml.parseInt();
+ MusEGlobal::rcStopNote = xml.parseInt();
+ else if (tag == "MusEGlobal::rcEnable")
+ MusEGlobal::rcEnable = xml.parseInt();
else if (tag == "rcRecord")
- rcRecordNote = xml.parseInt();
+ MusEGlobal::rcRecordNote = xml.parseInt();
else if (tag == "rcGotoLeft")
- rcGotoLeftMarkNote = xml.parseInt();
+ MusEGlobal::rcGotoLeftMarkNote = xml.parseInt();
else if (tag == "rcPlay")
- rcPlayNote = xml.parseInt();
+ MusEGlobal::rcPlayNote = xml.parseInt();
else if (tag == "rcSteprec")
- rcSteprecNote = xml.parseInt();
+ MusEGlobal::rcSteprecNote = xml.parseInt();
else
xml.unknown("Seq");
break;
@@ -534,216 +549,216 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
}
if (tag == "theme")
- config.style = xml.parse1();
+ MusEConfig::config.style = xml.parse1();
else if (tag == "styleSheetFile")
- config.styleSheetFile = xml.parse1();
+ MusEConfig::config.styleSheetFile = xml.parse1();
else if (tag == "useOldStyleStopShortCut")
- config.useOldStyleStopShortCut = xml.parseInt();
+ MusEConfig::config.useOldStyleStopShortCut = xml.parseInt();
else if (tag == "moveArmedCheckBox")
- config.moveArmedCheckBox = xml.parseInt();
+ MusEConfig::config.moveArmedCheckBox = xml.parseInt();
else if (tag == "externalWavEditor")
- config.externalWavEditor = xml.parse1();
+ MusEConfig::config.externalWavEditor = xml.parse1();
else if (tag == "font0")
- config.fonts[0].fromString(xml.parse1());
+ MusEConfig::config.fonts[0].fromString(xml.parse1());
else if (tag == "font1")
- config.fonts[1].fromString(xml.parse1());
+ MusEConfig::config.fonts[1].fromString(xml.parse1());
else if (tag == "font2")
- config.fonts[2].fromString(xml.parse1());
+ MusEConfig::config.fonts[2].fromString(xml.parse1());
else if (tag == "font3")
- config.fonts[3].fromString(xml.parse1());
+ MusEConfig::config.fonts[3].fromString(xml.parse1());
else if (tag == "font4")
- config.fonts[4].fromString(xml.parse1());
+ MusEConfig::config.fonts[4].fromString(xml.parse1());
else if (tag == "font5")
- config.fonts[5].fromString(xml.parse1());
+ MusEConfig::config.fonts[5].fromString(xml.parse1());
else if (tag == "font6")
- config.fonts[6].fromString(xml.parse1());
+ MusEConfig::config.fonts[6].fromString(xml.parse1());
else if (tag == "globalAlphaBlend")
- config.globalAlphaBlend = xml.parseInt();
+ MusEConfig::config.globalAlphaBlend = xml.parseInt();
else if (tag == "palette0")
- config.palette[0] = readColor(xml);
+ MusEConfig::config.palette[0] = readColor(xml);
else if (tag == "palette1")
- config.palette[1] = readColor(xml);
+ MusEConfig::config.palette[1] = readColor(xml);
else if (tag == "palette2")
- config.palette[2] = readColor(xml);
+ MusEConfig::config.palette[2] = readColor(xml);
else if (tag == "palette3")
- config.palette[3] = readColor(xml);
+ MusEConfig::config.palette[3] = readColor(xml);
else if (tag == "palette4")
- config.palette[4] = readColor(xml);
+ MusEConfig::config.palette[4] = readColor(xml);
else if (tag == "palette5")
- config.palette[5] = readColor(xml);
+ MusEConfig::config.palette[5] = readColor(xml);
else if (tag == "palette6")
- config.palette[6] = readColor(xml);
+ MusEConfig::config.palette[6] = readColor(xml);
else if (tag == "palette7")
- config.palette[7] = readColor(xml);
+ MusEConfig::config.palette[7] = readColor(xml);
else if (tag == "palette8")
- config.palette[8] = readColor(xml);
+ MusEConfig::config.palette[8] = readColor(xml);
else if (tag == "palette9")
- config.palette[9] = readColor(xml);
+ MusEConfig::config.palette[9] = readColor(xml);
else if (tag == "palette10")
- config.palette[10] = readColor(xml);
+ MusEConfig::config.palette[10] = readColor(xml);
else if (tag == "palette11")
- config.palette[11] = readColor(xml);
+ MusEConfig::config.palette[11] = readColor(xml);
else if (tag == "palette12")
- config.palette[12] = readColor(xml);
+ MusEConfig::config.palette[12] = readColor(xml);
else if (tag == "palette13")
- config.palette[13] = readColor(xml);
+ MusEConfig::config.palette[13] = readColor(xml);
else if (tag == "palette14")
- config.palette[14] = readColor(xml);
+ MusEConfig::config.palette[14] = readColor(xml);
else if (tag == "palette15")
- config.palette[15] = readColor(xml);
+ MusEConfig::config.palette[15] = readColor(xml);
else if (tag == "palette16")
- config.palette[16] = readColor(xml);
+ MusEConfig::config.palette[16] = readColor(xml);
else if (tag == "partColor0")
- config.partColors[0] = readColor(xml);
+ MusEConfig::config.partColors[0] = readColor(xml);
else if (tag == "partColor1")
- config.partColors[1] = readColor(xml);
+ MusEConfig::config.partColors[1] = readColor(xml);
else if (tag == "partColor2")
- config.partColors[2] = readColor(xml);
+ MusEConfig::config.partColors[2] = readColor(xml);
else if (tag == "partColor3")
- config.partColors[3] = readColor(xml);
+ MusEConfig::config.partColors[3] = readColor(xml);
else if (tag == "partColor4")
- config.partColors[4] = readColor(xml);
+ MusEConfig::config.partColors[4] = readColor(xml);
else if (tag == "partColor5")
- config.partColors[5] = readColor(xml);
+ MusEConfig::config.partColors[5] = readColor(xml);
else if (tag == "partColor6")
- config.partColors[6] = readColor(xml);
+ MusEConfig::config.partColors[6] = readColor(xml);
else if (tag == "partColor7")
- config.partColors[7] = readColor(xml);
+ MusEConfig::config.partColors[7] = readColor(xml);
else if (tag == "partColor8")
- config.partColors[8] = readColor(xml);
+ MusEConfig::config.partColors[8] = readColor(xml);
else if (tag == "partColor9")
- config.partColors[9] = readColor(xml);
+ MusEConfig::config.partColors[9] = readColor(xml);
else if (tag == "partColor10")
- config.partColors[10] = readColor(xml);
+ MusEConfig::config.partColors[10] = readColor(xml);
else if (tag == "partColor11")
- config.partColors[11] = readColor(xml);
+ MusEConfig::config.partColors[11] = readColor(xml);
else if (tag == "partColor12")
- config.partColors[12] = readColor(xml);
+ MusEConfig::config.partColors[12] = readColor(xml);
else if (tag == "partColor13")
- config.partColors[13] = readColor(xml);
+ MusEConfig::config.partColors[13] = readColor(xml);
else if (tag == "partColor14")
- config.partColors[14] = readColor(xml);
+ MusEConfig::config.partColors[14] = readColor(xml);
else if (tag == "partColor15")
- config.partColors[15] = readColor(xml);
+ MusEConfig::config.partColors[15] = readColor(xml);
else if (tag == "partColor16")
- config.partColors[16] = readColor(xml);
+ MusEConfig::config.partColors[16] = readColor(xml);
else if (tag == "partColor17")
- config.partColors[17] = readColor(xml);
+ MusEConfig::config.partColors[17] = readColor(xml);
else if (tag == "partColorName0")
- config.partColorNames[0] = xml.parse1();
+ MusEConfig::config.partColorNames[0] = xml.parse1();
else if (tag == "partColorName1")
- config.partColorNames[1] = xml.parse1();
+ MusEConfig::config.partColorNames[1] = xml.parse1();
else if (tag == "partColorName2")
- config.partColorNames[2] = xml.parse1();
+ MusEConfig::config.partColorNames[2] = xml.parse1();
else if (tag == "partColorName3")
- config.partColorNames[3] = xml.parse1();
+ MusEConfig::config.partColorNames[3] = xml.parse1();
else if (tag == "partColorName4")
- config.partColorNames[4] = xml.parse1();
+ MusEConfig::config.partColorNames[4] = xml.parse1();
else if (tag == "partColorName5")
- config.partColorNames[5] = xml.parse1();
+ MusEConfig::config.partColorNames[5] = xml.parse1();
else if (tag == "partColorName6")
- config.partColorNames[6] = xml.parse1();
+ MusEConfig::config.partColorNames[6] = xml.parse1();
else if (tag == "partColorName7")
- config.partColorNames[7] = xml.parse1();
+ MusEConfig::config.partColorNames[7] = xml.parse1();
else if (tag == "partColorName8")
- config.partColorNames[8] = xml.parse1();
+ MusEConfig::config.partColorNames[8] = xml.parse1();
else if (tag == "partColorName9")
- config.partColorNames[9] = xml.parse1();
+ MusEConfig::config.partColorNames[9] = xml.parse1();
else if (tag == "partColorName10")
- config.partColorNames[10] = xml.parse1();
+ MusEConfig::config.partColorNames[10] = xml.parse1();
else if (tag == "partColorName11")
- config.partColorNames[11] = xml.parse1();
+ MusEConfig::config.partColorNames[11] = xml.parse1();
else if (tag == "partColorName12")
- config.partColorNames[12] = xml.parse1();
+ MusEConfig::config.partColorNames[12] = xml.parse1();
else if (tag == "partColorName13")
- config.partColorNames[13] = xml.parse1();
+ MusEConfig::config.partColorNames[13] = xml.parse1();
else if (tag == "partColorName14")
- config.partColorNames[14] = xml.parse1();
+ MusEConfig::config.partColorNames[14] = xml.parse1();
else if (tag == "partColorName15")
- config.partColorNames[15] = xml.parse1();
+ MusEConfig::config.partColorNames[15] = xml.parse1();
else if (tag == "partColorName16")
- config.partColorNames[16] = xml.parse1();
+ MusEConfig::config.partColorNames[16] = xml.parse1();
else if (tag == "partColorName17")
- config.partColorNames[17] = xml.parse1();
+ MusEConfig::config.partColorNames[17] = xml.parse1();
else if (tag == "partCanvasBg")
- config.partCanvasBg = readColor(xml);
+ MusEConfig::config.partCanvasBg = readColor(xml);
else if (tag == "trackBg")
- config.trackBg = readColor(xml);
+ MusEConfig::config.trackBg = readColor(xml);
else if (tag == "selectTrackBg")
- config.selectTrackBg = readColor(xml);
+ MusEConfig::config.selectTrackBg = readColor(xml);
else if (tag == "selectTrackFg")
- config.selectTrackFg = readColor(xml);
+ MusEConfig::config.selectTrackFg = readColor(xml);
else if (tag == "mixerBg")
- config.mixerBg = readColor(xml);
+ MusEConfig::config.mixerBg = readColor(xml);
else if (tag == "midiTrackLabelBg")
- config.midiTrackLabelBg = readColor(xml);
+ MusEConfig::config.midiTrackLabelBg = readColor(xml);
else if (tag == "drumTrackLabelBg")
- config.drumTrackLabelBg = readColor(xml);
+ MusEConfig::config.drumTrackLabelBg = readColor(xml);
else if (tag == "waveTrackLabelBg")
- config.waveTrackLabelBg = readColor(xml);
+ MusEConfig::config.waveTrackLabelBg = readColor(xml);
else if (tag == "outputTrackLabelBg")
- config.outputTrackLabelBg = readColor(xml);
+ MusEConfig::config.outputTrackLabelBg = readColor(xml);
else if (tag == "inputTrackLabelBg")
- config.inputTrackLabelBg = readColor(xml);
+ MusEConfig::config.inputTrackLabelBg = readColor(xml);
else if (tag == "groupTrackLabelBg")
- config.groupTrackLabelBg = readColor(xml);
+ MusEConfig::config.groupTrackLabelBg = readColor(xml);
else if (tag == "auxTrackLabelBg")
- config.auxTrackLabelBg = readColor(xml);
+ MusEConfig::config.auxTrackLabelBg = readColor(xml);
else if (tag == "synthTrackLabelBg")
- config.synthTrackLabelBg = readColor(xml);
+ MusEConfig::config.synthTrackLabelBg = readColor(xml);
else if (tag == "midiTrackBg")
- config.midiTrackBg = readColor(xml);
+ MusEConfig::config.midiTrackBg = readColor(xml);
else if (tag == "ctrlGraphFg")
- config.ctrlGraphFg = readColor(xml);
+ MusEConfig::config.ctrlGraphFg = readColor(xml);
else if (tag == "drumTrackBg")
- config.drumTrackBg = readColor(xml);
+ MusEConfig::config.drumTrackBg = readColor(xml);
else if (tag == "waveTrackBg")
- config.waveTrackBg = readColor(xml);
+ MusEConfig::config.waveTrackBg = readColor(xml);
else if (tag == "outputTrackBg")
- config.outputTrackBg = readColor(xml);
+ MusEConfig::config.outputTrackBg = readColor(xml);
else if (tag == "inputTrackBg")
- config.inputTrackBg = readColor(xml);
+ MusEConfig::config.inputTrackBg = readColor(xml);
else if (tag == "groupTrackBg")
- config.groupTrackBg = readColor(xml);
+ MusEConfig::config.groupTrackBg = readColor(xml);
else if (tag == "auxTrackBg")
- config.auxTrackBg = readColor(xml);
+ MusEConfig::config.auxTrackBg = readColor(xml);
else if (tag == "synthTrackBg")
- config.synthTrackBg = readColor(xml);
+ MusEConfig::config.synthTrackBg = readColor(xml);
else if (tag == "extendedMidi")
- config.extendedMidi = xml.parseInt();
+ MusEConfig::config.extendedMidi = xml.parseInt();
else if (tag == "midiExportDivision")
- config.midiDivision = xml.parseInt();
+ MusEConfig::config.midiDivision = xml.parseInt();
else if (tag == "copyright")
- config.copyright = xml.parse1();
+ MusEConfig::config.copyright = xml.parse1();
else if (tag == "smfFormat")
- config.smfFormat = xml.parseInt();
+ MusEConfig::config.smfFormat = xml.parseInt();
else if (tag == "exp2ByteTimeSigs")
- config.exp2ByteTimeSigs = xml.parseInt();
+ MusEConfig::config.exp2ByteTimeSigs = xml.parseInt();
else if (tag == "expOptimNoteOffs")
- config.expOptimNoteOffs = xml.parseInt();
+ MusEConfig::config.expOptimNoteOffs = xml.parseInt();
else if (tag == "importMidiSplitParts")
- config.importMidiSplitParts = xml.parseInt();
+ MusEConfig::config.importMidiSplitParts = xml.parseInt();
else if (tag == "midiInputDevice")
- midiInputPorts = xml.parseInt();
- else if (tag == "midiInputChannel")
- midiInputChannel = xml.parseInt();
- else if (tag == "midiRecordType")
- midiRecordType = xml.parseInt();
- else if (tag == "midiThruType")
- midiThruType = xml.parseInt();
- else if (tag == "midiFilterCtrl1")
- midiFilterCtrl1 = xml.parseInt();
- else if (tag == "midiFilterCtrl2")
- midiFilterCtrl2 = xml.parseInt();
- else if (tag == "midiFilterCtrl3")
- midiFilterCtrl3 = xml.parseInt();
- else if (tag == "midiFilterCtrl4")
- midiFilterCtrl4 = xml.parseInt();
+ MusEGlobal::midiInputPorts = xml.parseInt();
+ else if (tag == "MusEGlobal::midiInputChannel")
+ MusEGlobal::midiInputChannel = xml.parseInt();
+ else if (tag == "MusEGlobal::midiRecordType")
+ MusEGlobal::midiRecordType = xml.parseInt();
+ else if (tag == "MusEGlobal::midiThruType")
+ MusEGlobal::midiThruType = xml.parseInt();
+ else if (tag == "MusEGlobal::midiFilterCtrl1")
+ MusEGlobal::midiFilterCtrl1 = xml.parseInt();
+ else if (tag == "MusEGlobal::midiFilterCtrl2")
+ MusEGlobal::midiFilterCtrl2 = xml.parseInt();
+ else if (tag == "MusEGlobal::midiFilterCtrl3")
+ MusEGlobal::midiFilterCtrl3 = xml.parseInt();
+ else if (tag == "MusEGlobal::midiFilterCtrl4")
+ MusEGlobal::midiFilterCtrl4 = xml.parseInt();
else if (tag == "waveTracksVisible")
WaveTrack::setVisible((bool)xml.parseInt());
else if (tag == "auxTracksVisible")
@@ -759,67 +774,67 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
else if (tag == "synthTracksVisible")
SynthI::setVisible((bool)xml.parseInt());
else if (tag == "bigtimeVisible")
- config.bigTimeVisible = xml.parseInt();
+ MusEConfig::config.bigTimeVisible = xml.parseInt();
else if (tag == "transportVisible")
- config.transportVisible = xml.parseInt();
+ MusEConfig::config.transportVisible = xml.parseInt();
else if (tag == "markerVisible")
- config.markerVisible = xml.parseInt();
+ MusEConfig::config.markerVisible = xml.parseInt();
else if (tag == "mixerVisible")
- // config.mixerVisible = xml.parseInt(); // Obsolete
+ // MusEConfig::config.mixerVisible = xml.parseInt(); // Obsolete
xml.skip(tag);
else if (tag == "mixer1Visible")
- config.mixer1Visible = xml.parseInt();
+ MusEConfig::config.mixer1Visible = xml.parseInt();
else if (tag == "mixer2Visible")
- config.mixer2Visible = xml.parseInt();
+ MusEConfig::config.mixer2Visible = xml.parseInt();
else if (tag == "showSplashScreen")
- config.showSplashScreen = xml.parseInt();
+ MusEConfig::config.showSplashScreen = xml.parseInt();
else if (tag == "canvasShowPartType")
- config.canvasShowPartType = xml.parseInt();
+ MusEConfig::config.canvasShowPartType = xml.parseInt();
else if (tag == "canvasShowPartEvent")
- config.canvasShowPartEvent = xml.parseInt();
+ MusEConfig::config.canvasShowPartEvent = xml.parseInt();
else if (tag == "canvasShowGrid")
- config.canvasShowGrid = xml.parseInt();
+ MusEConfig::config.canvasShowGrid = xml.parseInt();
else if (tag == "canvasBgPixmap")
- config.canvasBgPixmap = xml.parse1();
+ MusEConfig::config.canvasBgPixmap = xml.parse1();
else if (tag == "canvasCustomBgList")
- config.canvasCustomBgList = xml.parse1().split(";", QString::SkipEmptyParts);
+ MusEConfig::config.canvasCustomBgList = xml.parse1().split(";", QString::SkipEmptyParts);
else if (tag == "geometryMain")
- config.geometryMain = readGeometry(xml, tag);
+ MusEConfig::config.geometryMain = readGeometry(xml, tag);
else if (tag == "geometryTransport")
- config.geometryTransport = readGeometry(xml, tag);
+ MusEConfig::config.geometryTransport = readGeometry(xml, tag);
else if (tag == "geometryBigTime")
- config.geometryBigTime = readGeometry(xml, tag);
+ MusEConfig::config.geometryBigTime = readGeometry(xml, tag);
else if (tag == "geometryPianoroll")
- config.geometryPianoroll = readGeometry(xml, tag);
+ MusEConfig::config.geometryPianoroll = readGeometry(xml, tag);
else if (tag == "geometryDrumedit")
- config.geometryDrumedit = readGeometry(xml, tag);
+ MusEConfig::config.geometryDrumedit = readGeometry(xml, tag);
else if (tag == "geometryMixer")
- // config.geometryMixer = readGeometry(xml, tag); // Obsolete
+ // MusEConfig::config.geometryMixer = readGeometry(xml, tag); // Obsolete
xml.skip(tag);
//else if (tag == "mixer1")
- // config.mixer1.read(xml);
+ // MusEConfig::config.mixer1.read(xml);
//else if (tag == "mixer2")
- // config.mixer2.read(xml);
+ // MusEConfig::config.mixer2.read(xml);
else if (tag == "Mixer")
{
if(mixers == 0)
- config.mixer1.read(xml);
+ MusEConfig::config.mixer1.read(xml);
else
- config.mixer2.read(xml);
+ MusEConfig::config.mixer2.read(xml);
++mixers;
}
else if (tag == "bigtimeForegroundcolor")
- config.bigTimeForegroundColor = readColor(xml);
+ MusEConfig::config.bigTimeForegroundColor = readColor(xml);
else if (tag == "bigtimeBackgroundcolor")
- config.bigTimeBackgroundColor = readColor(xml);
+ MusEConfig::config.bigTimeBackgroundColor = readColor(xml);
else if (tag == "transportHandleColor")
- config.transportHandleColor = readColor(xml);
+ MusEConfig::config.transportHandleColor = readColor(xml);
else if (tag == "waveEditBackgroundColor")
- config.waveEditBackgroundColor = readColor(xml);
+ MusEConfig::config.waveEditBackgroundColor = readColor(xml);
else if (tag == "txDeviceId")
//txDeviceId = xml.parseInt();
xml.parseInt();
@@ -908,9 +923,9 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
else if (tag == "shortcuts")
readShortCuts(xml);
else if (tag == "division")
- config.division = xml.parseInt();
+ MusEConfig::config.division = xml.parseInt();
else if (tag == "guiDivision")
- config.guiDivision = xml.parseInt();
+ MusEConfig::config.guiDivision = xml.parseInt();
else if (tag == "samplerate")
xml.parseInt();
else if (tag == "segmentsize")
@@ -918,47 +933,47 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
else if (tag == "segmentcount")
xml.parseInt();
else if (tag == "rtcTicks")
- config.rtcTicks = xml.parseInt();
+ MusEConfig::config.rtcTicks = xml.parseInt();
else if (tag == "minMeter")
- config.minMeter = xml.parseInt();
+ MusEConfig::config.minMeter = xml.parseInt();
else if (tag == "minSlider")
- config.minSlider = xml.parseDouble();
+ MusEConfig::config.minSlider = xml.parseDouble();
else if (tag == "freewheelMode")
- config.freewheelMode = xml.parseInt();
+ MusEConfig::config.freewheelMode = xml.parseInt();
else if (tag == "denormalProtection")
- config.useDenormalBias = xml.parseInt();
+ MusEConfig::config.useDenormalBias = xml.parseInt();
else if (tag == "didYouKnow")
- config.showDidYouKnow = xml.parseInt();
+ MusEConfig::config.showDidYouKnow = xml.parseInt();
else if (tag == "outputLimiter")
- config.useOutputLimiter = xml.parseInt();
+ MusEConfig::config.useOutputLimiter = xml.parseInt();
else if (tag == "vstInPlace")
- config.vstInPlace = xml.parseInt();
+ MusEConfig::config.vstInPlace = xml.parseInt();
else if (tag == "dummyAudioSampleRate")
- config.dummyAudioSampleRate = xml.parseInt();
+ MusEConfig::config.dummyAudioSampleRate = xml.parseInt();
else if (tag == "dummyAudioBufSize")
- config.dummyAudioBufSize = xml.parseInt();
+ MusEConfig::config.dummyAudioBufSize = xml.parseInt();
else if (tag == "minControlProcessPeriod")
- config.minControlProcessPeriod = xml.parseUInt();
+ MusEConfig::config.minControlProcessPeriod = xml.parseUInt();
else if (tag == "guiRefresh")
- config.guiRefresh = xml.parseInt();
+ MusEConfig::config.guiRefresh = xml.parseInt();
else if (tag == "userInstrumentsDir")
- config.userInstrumentsDir = xml.parse1();
+ MusEConfig::config.userInstrumentsDir = xml.parse1();
else if (tag == "midiTransform")
readMidiTransform(xml);
else if (tag == "midiInputTransform")
readMidiInputTransform(xml);
else if (tag == "startMode")
- config.startMode = xml.parseInt();
+ MusEConfig::config.startMode = xml.parseInt();
else if (tag == "startSong")
- config.startSong = xml.parse1();
+ MusEConfig::config.startSong = xml.parse1();
else if (tag == "projectBaseFolder")
- config.projectBaseFolder = xml.parse1();
+ MusEConfig::config.projectBaseFolder = xml.parse1();
else if (tag == "projectStoreInFolder")
- config.projectStoreInFolder = xml.parseInt();
+ MusEConfig::config.projectStoreInFolder = xml.parseInt();
else if (tag == "useProjectSaveDialog")
- config.useProjectSaveDialog = xml.parseInt();
+ MusEConfig::config.useProjectSaveDialog = xml.parseInt();
else if (tag == "popupsDefaultStayOpen")
- config.popupsDefaultStayOpen = xml.parseInt();
+ MusEConfig::config.popupsDefaultStayOpen = xml.parseInt();
else
xml.unknown("configuration");
@@ -993,13 +1008,13 @@ void readConfiguration(Xml& xml, bool readOnlySequencer)
bool readConfiguration()
{
- FILE* f = fopen(configName.toLatin1().constData(), "r");
+ FILE* f = fopen(MusEGlobal::configName.toLatin1().constData(), "r");
if (f == 0) {
- if (debugMsg || debugMode)
- fprintf(stderr, "NO Config File <%s> found\n", configName.toLatin1().constData());
+ if (MusEGlobal::debugMsg || MusEGlobal::debugMode)
+ fprintf(stderr, "NO Config File <%s> found\n", MusEGlobal::configName.toLatin1().constData());
- if (config.userInstrumentsDir.isEmpty())
- config.userInstrumentsDir = configPath + "/instruments";
+ if (MusEConfig::config.userInstrumentsDir.isEmpty())
+ MusEConfig::config.userInstrumentsDir = MusEGlobal::configPath + "/instruments";
return true;
}
Xml xml(f);
@@ -1051,31 +1066,31 @@ static void writeSeqConfiguration(int level, Xml& xml, bool writePortInfo)
xml.tag(level++, "sequencer");
xml.tag(level++, "metronom");
- xml.intTag(level, "premeasures", preMeasures);
- xml.intTag(level, "measurepitch", measureClickNote);
- xml.intTag(level, "measurevelo", measureClickVelo);
- xml.intTag(level, "beatpitch", beatClickNote);
- xml.intTag(level, "beatvelo", beatClickVelo);
- xml.intTag(level, "channel", clickChan);
- xml.intTag(level, "port", clickPort);
-
- xml.intTag(level, "precountEnable", precountEnableFlag);
- xml.intTag(level, "fromMastertrack", precountFromMastertrackFlag);
- xml.intTag(level, "signatureZ", precountSigZ);
- xml.intTag(level, "signatureN", precountSigN);
- xml.intTag(level, "prerecord", precountPrerecord);
- xml.intTag(level, "preroll", precountPreroll);
- xml.intTag(level, "midiClickEnable", midiClickFlag);
- xml.intTag(level, "audioClickEnable", audioClickFlag);
- xml.floatTag(level, "audioClickVolume", audioClickVolume);
+ xml.intTag(level, "premeasures", MusEGlobal::preMeasures);
+ xml.intTag(level, "measurepitch", MusEGlobal::measureClickNote);
+ xml.intTag(level, "measurevelo", MusEGlobal::measureClickVelo);
+ xml.intTag(level, "beatpitch", MusEGlobal::beatClickNote);
+ xml.intTag(level, "beatvelo", MusEGlobal::beatClickVelo);
+ xml.intTag(level, "channel", MusEGlobal::clickChan);
+ xml.intTag(level, "port", MusEGlobal::clickPort);
+
+ xml.intTag(level, "precountEnable", MusEGlobal::precountEnableFlag);
+ xml.intTag(level, "fromMastertrack", MusEGlobal::precountFromMastertrackFlag);
+ xml.intTag(level, "signatureZ", MusEGlobal::precountSigZ);
+ xml.intTag(level, "signatureN", MusEGlobal::precountSigN);
+ xml.intTag(level, "prerecord", MusEGlobal::precountPrerecord);
+ xml.intTag(level, "preroll", MusEGlobal::precountPreroll);
+ xml.intTag(level, "midiClickEnable", MusEGlobal::midiClickFlag);
+ xml.intTag(level, "audioClickEnable", MusEGlobal::audioClickFlag);
+ xml.floatTag(level, "MusEGlobal::audioClickVolume", MusEGlobal::audioClickVolume);
xml.tag(level--, "/metronom");
- xml.intTag(level, "rcEnable", rcEnable);
- xml.intTag(level, "rcStop", rcStopNote);
- xml.intTag(level, "rcRecord", rcRecordNote);
- xml.intTag(level, "rcGotoLeft", rcGotoLeftMarkNote);
- xml.intTag(level, "rcPlay", rcPlayNote);
- xml.intTag(level, "rcSteprec", rcSteprecNote);
+ xml.intTag(level, "MusEGlobal::rcEnable", MusEGlobal::rcEnable);
+ xml.intTag(level, "rcStop", MusEGlobal::rcStopNote);
+ xml.intTag(level, "rcRecord", MusEGlobal::rcRecordNote);
+ xml.intTag(level, "rcGotoLeft", MusEGlobal::rcGotoLeftMarkNote);
+ xml.intTag(level, "rcPlay", MusEGlobal::rcPlayNote);
+ xml.intTag(level, "rcSteprec", MusEGlobal::rcSteprecNote);
if (writePortInfo) {
//
@@ -1167,16 +1182,17 @@ static void writeSeqConfiguration(int level, Xml& xml, bool writePortInfo)
xml.tag(level, "/sequencer");
}
+namespace MusEApp {
//---------------------------------------------------------
// writeGlobalConfiguration
//---------------------------------------------------------
void MusE::writeGlobalConfiguration() const
{
- FILE* f = fopen(configName.toLatin1().constData(), "w");
+ FILE* f = fopen(MusEGlobal::configName.toLatin1().constData(), "w");
if (f == 0) {
printf("save configuration to <%s> failed: %s\n",
- configName.toLatin1().constData(), strerror(errno));
+ MusEGlobal::configName.toLatin1().constData(), strerror(errno));
return;
}
Xml xml(f);
@@ -1191,105 +1207,105 @@ void MusE::writeGlobalConfiguration(int level, Xml& xml) const
{
xml.tag(level++, "configuration");
- xml.intTag(level, "division", config.division);
- xml.intTag(level, "rtcTicks", config.rtcTicks);
- xml.intTag(level, "minMeter", config.minMeter);
- xml.doubleTag(level, "minSlider", config.minSlider);
- xml.intTag(level, "freewheelMode", config.freewheelMode);
- xml.intTag(level, "denormalProtection", config.useDenormalBias);
- xml.intTag(level, "didYouKnow", config.showDidYouKnow);
- xml.intTag(level, "outputLimiter", config.useOutputLimiter);
- xml.intTag(level, "vstInPlace", config.vstInPlace);
- xml.intTag(level, "dummyAudioBufSize", config.dummyAudioBufSize);
- xml.intTag(level, "dummyAudioSampleRate", config.dummyAudioSampleRate);
- xml.uintTag(level, "minControlProcessPeriod", config.minControlProcessPeriod);
-
- xml.intTag(level, "guiRefresh", config.guiRefresh);
- xml.strTag(level, "userInstrumentsDir", config.userInstrumentsDir);
+ xml.intTag(level, "division", MusEConfig::config.division);
+ xml.intTag(level, "rtcTicks", MusEConfig::config.rtcTicks);
+ xml.intTag(level, "minMeter", MusEConfig::config.minMeter);
+ xml.doubleTag(level, "minSlider", MusEConfig::config.minSlider);
+ xml.intTag(level, "freewheelMode", MusEConfig::config.freewheelMode);
+ xml.intTag(level, "denormalProtection", MusEConfig::config.useDenormalBias);
+ xml.intTag(level, "didYouKnow", MusEConfig::config.showDidYouKnow);
+ xml.intTag(level, "outputLimiter", MusEConfig::config.useOutputLimiter);
+ xml.intTag(level, "vstInPlace", MusEConfig::config.vstInPlace);
+ xml.intTag(level, "dummyAudioBufSize", MusEConfig::config.dummyAudioBufSize);
+ xml.intTag(level, "dummyAudioSampleRate", MusEConfig::config.dummyAudioSampleRate);
+ xml.uintTag(level, "minControlProcessPeriod", MusEConfig::config.minControlProcessPeriod);
+
+ xml.intTag(level, "guiRefresh", MusEConfig::config.guiRefresh);
+ xml.strTag(level, "userInstrumentsDir", MusEConfig::config.userInstrumentsDir);
// Removed by Orcan. 20101220
//xml.strTag(level, "helpBrowser", config.helpBrowser);
- xml.intTag(level, "extendedMidi", config.extendedMidi);
- xml.intTag(level, "midiExportDivision", config.midiDivision);
- xml.intTag(level, "guiDivision", config.guiDivision);
- xml.strTag(level, "copyright", config.copyright);
- xml.intTag(level, "smfFormat", config.smfFormat);
- xml.intTag(level, "exp2ByteTimeSigs", config.exp2ByteTimeSigs);
- xml.intTag(level, "expOptimNoteOffs", config.expOptimNoteOffs);
- xml.intTag(level, "importMidiSplitParts", config.importMidiSplitParts);
- xml.intTag(level, "startMode", config.startMode);
- xml.strTag(level, "startSong", config.startSong);
- xml.strTag(level, "projectBaseFolder", config.projectBaseFolder);
- xml.intTag(level, "projectStoreInFolder", config.projectStoreInFolder);
- xml.intTag(level, "useProjectSaveDialog", config.useProjectSaveDialog);
- xml.intTag(level, "midiInputDevice", midiInputPorts);
- xml.intTag(level, "midiInputChannel", midiInputChannel);
- xml.intTag(level, "midiRecordType", midiRecordType);
- xml.intTag(level, "midiThruType", midiThruType);
- xml.intTag(level, "midiFilterCtrl1", midiFilterCtrl1);
- xml.intTag(level, "midiFilterCtrl2", midiFilterCtrl2);
- xml.intTag(level, "midiFilterCtrl3", midiFilterCtrl3);
- xml.intTag(level, "midiFilterCtrl4", midiFilterCtrl4);
+ xml.intTag(level, "extendedMidi", MusEConfig::config.extendedMidi);
+ xml.intTag(level, "midiExportDivision", MusEConfig::config.midiDivision);
+ xml.intTag(level, "guiDivision", MusEConfig::config.guiDivision);
+ xml.strTag(level, "copyright", MusEConfig::config.copyright);
+ xml.intTag(level, "smfFormat", MusEConfig::config.smfFormat);
+ xml.intTag(level, "exp2ByteTimeSigs", MusEConfig::config.exp2ByteTimeSigs);
+ xml.intTag(level, "expOptimNoteOffs", MusEConfig::config.expOptimNoteOffs);
+ xml.intTag(level, "importMidiSplitParts", MusEConfig::config.importMidiSplitParts);
+ xml.intTag(level, "startMode", MusEConfig::config.startMode);
+ xml.strTag(level, "startSong", MusEConfig::config.startSong);
+ xml.strTag(level, "projectBaseFolder", MusEConfig::config.projectBaseFolder);
+ xml.intTag(level, "projectStoreInFolder", MusEConfig::config.projectStoreInFolder);
+ xml.intTag(level, "useProjectSaveDialog", MusEConfig::config.useProjectSaveDialog);
+ xml.intTag(level, "midiInputDevice", MusEGlobal::midiInputPorts);
+ xml.intTag(level, "MusEGlobal::midiInputChannel", MusEGlobal::midiInputChannel);
+ xml.intTag(level, "MusEGlobal::midiRecordType", MusEGlobal::midiRecordType);
+ xml.intTag(level, "MusEGlobal::midiThruType", MusEGlobal::midiThruType);
+ xml.intTag(level, "MusEGlobal::midiFilterCtrl1", MusEGlobal::midiFilterCtrl1);
+ xml.intTag(level, "MusEGlobal::midiFilterCtrl2", MusEGlobal::midiFilterCtrl2);
+ xml.intTag(level, "MusEGlobal::midiFilterCtrl3", MusEGlobal::midiFilterCtrl3);
+ xml.intTag(level, "MusEGlobal::midiFilterCtrl4", MusEGlobal::midiFilterCtrl4);
//xml.intTag(level, "txDeviceId", txDeviceId);
//xml.intTag(level, "rxDeviceId", rxDeviceId);
- xml.strTag(level, "theme", config.style);
- xml.strTag(level, "styleSheetFile", config.styleSheetFile);
- xml.strTag(level, "externalWavEditor", config.externalWavEditor);
- xml.intTag(level, "useOldStyleStopShortCut", config.useOldStyleStopShortCut);
- xml.intTag(level, "moveArmedCheckBox", config.moveArmedCheckBox);
- xml.intTag(level, "popupsDefaultStayOpen", config.popupsDefaultStayOpen);
+ xml.strTag(level, "theme", MusEConfig::config.style);
+ xml.strTag(level, "styleSheetFile", MusEConfig::config.styleSheetFile);
+ xml.strTag(level, "externalWavEditor", MusEConfig::config.externalWavEditor);
+ xml.intTag(level, "useOldStyleStopShortCut", MusEConfig::config.useOldStyleStopShortCut);
+ xml.intTag(level, "moveArmedCheckBox", MusEConfig::config.moveArmedCheckBox);
+ xml.intTag(level, "popupsDefaultStayOpen", MusEConfig::config.popupsDefaultStayOpen);
//for (int i = 0; i < 6; ++i) {
for (int i = 0; i < NUM_FONTS; ++i) {
char buffer[32];
sprintf(buffer, "font%d", i);
- xml.strTag(level, buffer, config.fonts[i].toString());
+ xml.strTag(level, buffer, MusEConfig::config.fonts[i].toString());
}
- xml.intTag(level, "globalAlphaBlend", config.globalAlphaBlend);
+ xml.intTag(level, "globalAlphaBlend", MusEConfig::config.globalAlphaBlend);
for (int i = 0; i < 16; ++i) {
char buffer[32];
sprintf(buffer, "palette%d", i);
- xml.colorTag(level, buffer, config.palette[i]);
+ xml.colorTag(level, buffer, MusEConfig::config.palette[i]);
}
for (int i = 0; i < NUM_PARTCOLORS; ++i) {
char buffer[32];
sprintf(buffer, "partColor%d", i);
- xml.colorTag(level, buffer, config.partColors[i]);
+ xml.colorTag(level, buffer, MusEConfig::config.partColors[i]);
}
for (int i = 0; i < NUM_PARTCOLORS; ++i) {
char buffer[32];
sprintf(buffer, "partColorName%d", i);
- xml.strTag(level, buffer, config.partColorNames[i]);
+ xml.strTag(level, buffer, MusEConfig::config.partColorNames[i]);
}
- xml.colorTag(level, "partCanvasBg", config.partCanvasBg);
- xml.colorTag(level, "trackBg", config.trackBg);
- xml.colorTag(level, "selectTrackBg", config.selectTrackBg);
- xml.colorTag(level, "selectTrackFg", config.selectTrackFg);
+ xml.colorTag(level, "partCanvasBg", MusEConfig::config.partCanvasBg);
+ xml.colorTag(level, "trackBg", MusEConfig::config.trackBg);
+ xml.colorTag(level, "selectTrackBg", MusEConfig::config.selectTrackBg);
+ xml.colorTag(level, "selectTrackFg", MusEConfig::config.selectTrackFg);
- xml.colorTag(level, "mixerBg", config.mixerBg);
- xml.colorTag(level, "midiTrackLabelBg", config.midiTrackLabelBg);
- xml.colorTag(level, "drumTrackLabelBg", config.drumTrackLabelBg);
- xml.colorTag(level, "waveTrackLabelBg", config.waveTrackLabelBg);
- xml.colorTag(level, "outputTrackLabelBg", config.outputTrackLabelBg);
- xml.colorTag(level, "inputTrackLabelBg", config.inputTrackLabelBg);
- xml.colorTag(level, "groupTrackLabelBg", config.groupTrackLabelBg);
- xml.colorTag(level, "auxTrackLabelBg", config.auxTrackLabelBg);
- xml.colorTag(level, "synthTrackLabelBg", config.synthTrackLabelBg);
+ xml.colorTag(level, "mixerBg", MusEConfig::config.mixerBg);
+ xml.colorTag(level, "midiTrackLabelBg", MusEConfig::config.midiTrackLabelBg);
+ xml.colorTag(level, "drumTrackLabelBg", MusEConfig::config.drumTrackLabelBg);
+ xml.colorTag(level, "waveTrackLabelBg", MusEConfig::config.waveTrackLabelBg);
+ xml.colorTag(level, "outputTrackLabelBg", MusEConfig::config.outputTrackLabelBg);
+ xml.colorTag(level, "inputTrackLabelBg", MusEConfig::config.inputTrackLabelBg);
+ xml.colorTag(level, "groupTrackLabelBg", MusEConfig::config.groupTrackLabelBg);
+ xml.colorTag(level, "auxTrackLabelBg", MusEConfig::config.auxTrackLabelBg);
+ xml.colorTag(level, "synthTrackLabelBg", MusEConfig::config.synthTrackLabelBg);
- xml.colorTag(level, "midiTrackBg", config.midiTrackBg);
- xml.colorTag(level, "ctrlGraphFg", config.ctrlGraphFg);
- xml.colorTag(level, "drumTrackBg", config.drumTrackBg);
- xml.colorTag(level, "waveTrackBg", config.waveTrackBg);
- xml.colorTag(level, "outputTrackBg", config.outputTrackBg);
- xml.colorTag(level, "inputTrackBg", config.inputTrackBg);
- xml.colorTag(level, "groupTrackBg", config.groupTrackBg);
- xml.colorTag(level, "auxTrackBg", config.auxTrackBg);
- xml.colorTag(level, "synthTrackBg", config.synthTrackBg);
+ xml.colorTag(level, "midiTrackBg", MusEConfig::config.midiTrackBg);
+ xml.colorTag(level, "ctrlGraphFg", MusEConfig::config.ctrlGraphFg);
+ xml.colorTag(level, "drumTrackBg", MusEConfig::config.drumTrackBg);
+ xml.colorTag(level, "waveTrackBg", MusEConfig::config.waveTrackBg);
+ xml.colorTag(level, "outputTrackBg", MusEConfig::config.outputTrackBg);
+ xml.colorTag(level, "inputTrackBg", MusEConfig::config.inputTrackBg);
+ xml.colorTag(level, "groupTrackBg", MusEConfig::config.groupTrackBg);
+ xml.colorTag(level, "auxTrackBg", MusEConfig::config.auxTrackBg);
+ xml.colorTag(level, "synthTrackBg", MusEConfig::config.synthTrackBg);
// Removed by Tim. p3.3.6
//xml.intTag(level, "txSyncPort", txSyncPort);
@@ -1310,35 +1326,35 @@ void MusE::writeGlobalConfiguration(int level, Xml& xml) const
// xml.intTag(level, "acceptMMC", acceptMMC);
// xml.intTag(level, "acceptMC", acceptMC);
- xml.qrectTag(level, "geometryMain", config.geometryMain);
- xml.qrectTag(level, "geometryTransport", config.geometryTransport);
- xml.qrectTag(level, "geometryBigTime", config.geometryBigTime);
- xml.qrectTag(level, "geometryPianoroll", config.geometryPianoroll);
- xml.qrectTag(level, "geometryDrumedit", config.geometryDrumedit);
- //xml.qrectTag(level, "geometryMixer", config.geometryMixer); // Obsolete
+ xml.qrectTag(level, "geometryMain", MusEConfig::config.geometryMain);
+ xml.qrectTag(level, "geometryTransport", MusEConfig::config.geometryTransport);
+ xml.qrectTag(level, "geometryBigTime", MusEConfig::config.geometryBigTime);
+ xml.qrectTag(level, "geometryPianoroll", MusEConfig::config.geometryPianoroll);
+ xml.qrectTag(level, "geometryDrumedit", MusEConfig::config.geometryDrumedit);
+ //xml.qrectTag(level, "geometryMixer", MusEConfig::config.geometryMixer); // Obsolete
- xml.intTag(level, "bigtimeVisible", config.bigTimeVisible);
- xml.intTag(level, "transportVisible", config.transportVisible);
+ xml.intTag(level, "bigtimeVisible", MusEConfig::config.bigTimeVisible);
+ xml.intTag(level, "transportVisible", MusEConfig::config.transportVisible);
- //xml.intTag(level, "mixerVisible", config.mixerVisible); // Obsolete
- xml.intTag(level, "mixer1Visible", config.mixer1Visible);
- xml.intTag(level, "mixer2Visible", config.mixer2Visible);
- //config.mixer1.write(level, xml, "mixer1");
- //config.mixer2.write(level, xml, "mixer2");
- config.mixer1.write(level, xml);
- config.mixer2.write(level, xml);
-
- xml.intTag(level, "showSplashScreen", config.showSplashScreen);
- xml.intTag(level, "canvasShowPartType", config.canvasShowPartType);
- xml.intTag(level, "canvasShowPartEvent", config.canvasShowPartEvent);
- xml.intTag(level, "canvasShowGrid", config.canvasShowGrid);
- xml.strTag(level, "canvasBgPixmap", config.canvasBgPixmap);
- xml.strTag(level, "canvasCustomBgList", config.canvasCustomBgList.join(";"));
-
- xml.colorTag(level, "transportHandleColor", config.transportHandleColor);
- xml.colorTag(level, "bigtimeForegroundcolor", config.bigTimeForegroundColor);
- xml.colorTag(level, "bigtimeBackgroundcolor", config.bigTimeBackgroundColor);
- xml.colorTag(level, "waveEditBackgroundColor", config.waveEditBackgroundColor);
+ //xml.intTag(level, "mixerVisible", MusEConfig::config.mixerVisible); // Obsolete
+ xml.intTag(level, "mixer1Visible", MusEConfig::config.mixer1Visible);
+ xml.intTag(level, "mixer2Visible", MusEConfig::config.mixer2Visible);
+ //MusEConfig::config.mixer1.write(level, xml, "mixer1");
+ //MusEConfig::config.mixer2.write(level, xml, "mixer2");
+ MusEConfig::config.mixer1.write(level, xml);
+ MusEConfig::config.mixer2.write(level, xml);
+
+ xml.intTag(level, "showSplashScreen", MusEConfig::config.showSplashScreen);
+ xml.intTag(level, "canvasShowPartType", MusEConfig::config.canvasShowPartType);
+ xml.intTag(level, "canvasShowPartEvent", MusEConfig::config.canvasShowPartEvent);
+ xml.intTag(level, "canvasShowGrid", MusEConfig::config.canvasShowGrid);
+ xml.strTag(level, "canvasBgPixmap", MusEConfig::config.canvasBgPixmap);
+ xml.strTag(level, "canvasCustomBgList", MusEConfig::config.canvasCustomBgList.join(";"));
+
+ xml.colorTag(level, "transportHandleColor", MusEConfig::config.transportHandleColor);
+ xml.colorTag(level, "bigtimeForegroundcolor", MusEConfig::config.bigTimeForegroundColor);
+ xml.colorTag(level, "bigtimeBackgroundcolor", MusEConfig::config.bigTimeBackgroundColor);
+ xml.colorTag(level, "waveEditBackgroundColor", MusEConfig::config.waveEditBackgroundColor);
writeSeqConfiguration(level, xml, false);
@@ -1368,14 +1384,14 @@ void MusE::writeConfiguration(int level, Xml& xml) const
{
xml.tag(level++, "configuration");
- xml.intTag(level, "midiInputDevice", midiInputPorts);
- xml.intTag(level, "midiInputChannel", midiInputChannel);
- xml.intTag(level, "midiRecordType", midiRecordType);
- xml.intTag(level, "midiThruType", midiThruType);
- xml.intTag(level, "midiFilterCtrl1", midiFilterCtrl1);
- xml.intTag(level, "midiFilterCtrl2", midiFilterCtrl2);
- xml.intTag(level, "midiFilterCtrl3", midiFilterCtrl3);
- xml.intTag(level, "midiFilterCtrl4", midiFilterCtrl4);
+ xml.intTag(level, "midiInputDevice", MusEGlobal::midiInputPorts);
+ xml.intTag(level, "MusEGlobal::midiInputChannel", MusEGlobal::midiInputChannel);
+ xml.intTag(level, "MusEGlobal::midiRecordType", MusEGlobal::midiRecordType);
+ xml.intTag(level, "MusEGlobal::midiThruType", MusEGlobal::midiThruType);
+ xml.intTag(level, "MusEGlobal::midiFilterCtrl1", MusEGlobal::midiFilterCtrl1);
+ xml.intTag(level, "MusEGlobal::midiFilterCtrl2", MusEGlobal::midiFilterCtrl2);
+ xml.intTag(level, "MusEGlobal::midiFilterCtrl3", MusEGlobal::midiFilterCtrl3);
+ xml.intTag(level, "MusEGlobal::midiFilterCtrl4", MusEGlobal::midiFilterCtrl4);
xml.intTag(level, "waveTracksVisible", WaveTrack::visible());
xml.intTag(level, "auxTracksVisible", AudioAux::visible());
@@ -1484,8 +1500,8 @@ void MusE::writeConfiguration(int level, Xml& xml) const
void MusE::configMidiSync()
{
if (!midiSyncConfig)
- //midiSyncConfig = new MidiSyncConfig(this);
- midiSyncConfig = new MidiSyncConfig;
+ //midiSyncConfig = new MusEWidget::MidiSyncConfig(this);
+ midiSyncConfig = new MusEWidget::MidiSyncConfig;
if (midiSyncConfig->isVisible()) {
midiSyncConfig->raise();
@@ -1514,6 +1530,25 @@ void MusE::configMidiFile()
}
//---------------------------------------------------------
+// configGlobalSettings
+//---------------------------------------------------------
+
+void MusE::configGlobalSettings()
+ {
+ if (!globalSettingsConfig)
+ globalSettingsConfig = new MusEWidget::GlobalSettingsConfig();
+
+ if (globalSettingsConfig->isVisible()) {
+ globalSettingsConfig->raise();
+ globalSettingsConfig->activateWindow();
+ }
+ else
+ globalSettingsConfig->show();
+ }
+
+} // namespace MusEApp
+
+//---------------------------------------------------------
// MidiFileConfig
// config properties of exported midi files
//---------------------------------------------------------
@@ -1533,18 +1568,18 @@ MidiFileConfig::MidiFileConfig(QWidget* parent)
void MidiFileConfig::updateValues()
{
int divisionIdx = 2;
- switch(config.midiDivision) {
+ switch(MusEConfig::config.midiDivision) {
case 96: divisionIdx = 0; break;
case 192: divisionIdx = 1; break;
case 384: divisionIdx = 2; break;
}
divisionCombo->setCurrentIndex(divisionIdx);
- formatCombo->setCurrentIndex(config.smfFormat);
- extendedFormat->setChecked(config.extendedMidi);
- copyrightEdit->setText(config.copyright);
- optNoteOffs->setChecked(config.expOptimNoteOffs);
- twoByteTimeSigs->setChecked(config.exp2ByteTimeSigs);
- splitPartsCheckBox->setChecked(config.importMidiSplitParts);
+ formatCombo->setCurrentIndex(MusEConfig::config.smfFormat);
+ extendedFormat->setChecked(MusEConfig::config.extendedMidi);
+ copyrightEdit->setText(MusEConfig::config.copyright);
+ optNoteOffs->setChecked(MusEConfig::config.expOptimNoteOffs);
+ twoByteTimeSigs->setChecked(MusEConfig::config.exp2ByteTimeSigs);
+ splitPartsCheckBox->setChecked(MusEConfig::config.importMidiSplitParts);
}
//---------------------------------------------------------
@@ -1557,15 +1592,15 @@ void MidiFileConfig::okClicked()
int divisions[3] = { 96, 192, 384 };
if (divisionIdx >= 0 && divisionIdx < 3)
- config.midiDivision = divisions[divisionIdx];
- config.extendedMidi = extendedFormat->isChecked();
- config.smfFormat = formatCombo->currentIndex();
- config.copyright = copyrightEdit->text();
- config.expOptimNoteOffs = optNoteOffs->isChecked();
- config.exp2ByteTimeSigs = twoByteTimeSigs->isChecked();
- config.importMidiSplitParts = splitPartsCheckBox->isChecked();
-
- muse->changeConfig(true); // write config file
+ MusEConfig::config.midiDivision = divisions[divisionIdx];
+ MusEConfig::config.extendedMidi = extendedFormat->isChecked();
+ MusEConfig::config.smfFormat = formatCombo->currentIndex();
+ MusEConfig::config.copyright = copyrightEdit->text();
+ MusEConfig::config.expOptimNoteOffs = optNoteOffs->isChecked();
+ MusEConfig::config.exp2ByteTimeSigs = twoByteTimeSigs->isChecked();
+ MusEConfig::config.importMidiSplitParts = splitPartsCheckBox->isChecked();
+
+ MusEGlobal::muse->changeConfig(true); // write config file
close();
}
@@ -1578,23 +1613,7 @@ void MidiFileConfig::cancelClicked()
close();
}
-//---------------------------------------------------------
-// configGlobalSettings
-//---------------------------------------------------------
-
-void MusE::configGlobalSettings()
- {
- if (!globalSettingsConfig)
- globalSettingsConfig = new GlobalSettingsConfig();
-
- if (globalSettingsConfig->isVisible()) {
- globalSettingsConfig->raise();
- globalSettingsConfig->activateWindow();
- }
- else
- globalSettingsConfig->show();
- }
-
+namespace MusEConfig {
//---------------------------------------------------------
// write
@@ -1680,3 +1699,4 @@ void MixerConfig::read(Xml& xml)
}
+} // namespace MusEConfig
diff --git a/muse2/muse/conf.h b/muse2/muse/conf.h
index 656be4a7..25cba677 100644
--- a/muse2/muse/conf.h
+++ b/muse2/muse/conf.h
@@ -4,6 +4,21 @@
// $Id: conf.h,v 1.4.2.1 2006/09/28 19:22:25 spamatica Exp $
//
// (C) Copyright 1999-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CONF_H__
diff --git a/muse2/muse/confmport.cpp b/muse2/muse/confmport.cpp
index 8b323fc1..42fb5276 100644
--- a/muse2/muse/confmport.cpp
+++ b/muse2/muse/confmport.cpp
@@ -4,6 +4,21 @@
// $Id: confmport.cpp,v 1.9.2.10 2009/12/15 03:39:58 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <list>
@@ -115,7 +130,7 @@ void MPConfig::changeDefInputRoutes(QAction* act)
else
chbits = defch ^ (1 << actid);
midiPorts[no].setDefaultInChannels(chbits);
- mdevView->item(item->row(), DEVCOL_DEF_IN_CHANS)->setText(bitmap2String(chbits));
+ mdevView->item(item->row(), DEVCOL_DEF_IN_CHANS)->setText(MusEUtil::bitmap2String(chbits));
}
}
@@ -202,7 +217,7 @@ void MPConfig::changeDefOutputRoutes(QAction* act)
else
chbits = defch ^ (1 << actid);
midiPorts[no].setDefaultOutChannels(chbits);
- mdevView->item(item->row(), DEVCOL_DEF_OUT_CHANS)->setText(bitmap2String(chbits));
+ mdevView->item(item->row(), DEVCOL_DEF_OUT_CHANS)->setText(MusEUtil::bitmap2String(chbits));
#else
if(actid < MIDI_CHANNELS)
{
@@ -211,7 +226,7 @@ void MPConfig::changeDefOutputRoutes(QAction* act)
setPortExclusiveDefOutChan(no, chbits);
int j = mdevView->rowCount();
for(int i = 0; i < j; ++i)
- mdevView->item(i, DEVCOL_DEF_OUT_CHANS)->setText(bitmap2String(i == no ? chbits : 0));
+ mdevView->item(i, DEVCOL_DEF_OUT_CHANS)->setText(MusEUtil::bitmap2String(i == no ? chbits : 0));
if(defpup)
{
QAction* a;
@@ -442,7 +457,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
case DEVCOL_INROUTES:
case DEVCOL_OUTROUTES:
{
- if(!checkAudioDevice())
+ if(!MusEGlobal::checkAudioDevice())
return;
if(audioDevice->deviceType() != AudioDevice::JACK_AUDIO) // Only if Jack is running.
@@ -609,8 +624,8 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
return;
#else
{
- defpup = new PopupMenu(this, true);
- defpup->addAction(new MenuTitleItem("Channel", defpup));
+ defpup = new MusEWidget::PopupMenu(this, true);
+ defpup->addAction(new MusEWidget::MenuTitleItem("Channel", defpup));
QAction* act = 0;
int chbits = midiPorts[no].defaultInChannels();
for(int i = 0; i < MIDI_CHANNELS; ++i)
@@ -632,7 +647,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
act->setEnabled(!song->midis()->empty()); // && midiPorts[no].device());
connect(defpup, SIGNAL(triggered(QAction*)), SLOT(changeDefInputRoutes(QAction*)));
- //connect(defpup, SIGNAL(aboutToHide()), muse, SLOT(routingPopupMenuAboutToHide()));
+ //connect(defpup, SIGNAL(aboutToHide()), MusEGlobal::muse, SLOT(routingMusEWidget::PopupMenuAboutToHide()));
//defpup->popup(QCursor::pos());
defpup->exec(QCursor::pos());
delete defpup;
@@ -649,8 +664,8 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
return;
#else
{
- defpup = new PopupMenu(this, true);
- defpup->addAction(new MenuTitleItem("Channel", defpup));
+ defpup = new MusEWidget::PopupMenu(this, true);
+ defpup->addAction(new MusEWidget::MenuTitleItem("Channel", defpup));
QAction* act = 0;
int chbits = midiPorts[no].defaultOutChannels();
for(int i = 0; i < MIDI_CHANNELS; ++i)
@@ -675,7 +690,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
act->setEnabled(!song->midis()->empty()); // && midiPorts[no].device());
connect(defpup, SIGNAL(triggered(QAction*)), SLOT(changeDefOutputRoutes(QAction*)));
- //connect(defpup, SIGNAL(aboutToHide()), muse, SLOT(routingPopupMenuAboutToHide()));
+ //connect(defpup, SIGNAL(aboutToHide()), MusEGlobal::muse, SLOT(routingMusEWidget::PopupMenuAboutToHide()));
//defpup->popup(QCursor::pos());
defpup->exec(QCursor::pos());
delete defpup;
@@ -757,7 +772,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
//if(!mapALSA.empty())
{
pup->addSeparator();
- pup->addAction(new MenuTitleItem(QT_TRANSLATE_NOOP("@default", "ALSA:"), pup));
+ pup->addAction(new MusEWidget::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "ALSA:"), pup));
for(imap i = mapALSA.begin(); i != mapALSA.end(); ++i)
{
@@ -783,7 +798,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
if(!mapSYNTH.empty())
{
pup->addSeparator();
- pup->addAction(new MenuTitleItem(QT_TRANSLATE_NOOP("@default", "SYNTH:"), pup));
+ pup->addAction(new MusEWidget::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "SYNTH:"), pup));
for(imap i = mapSYNTH.begin(); i != mapSYNTH.end(); ++i)
{
@@ -809,7 +824,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
//if(!mapJACK.empty())
{
pup->addSeparator();
- pup->addAction(new MenuTitleItem(QT_TRANSLATE_NOOP("@default", "JACK:"), pup));
+ pup->addAction(new MusEWidget::MenuTitleItem(QT_TRANSLATE_NOOP("@default", "JACK:"), pup));
for(imap i = mapJACK.begin(); i != mapJACK.end(); ++i)
{
@@ -884,7 +899,7 @@ void MPConfig::rbClicked(QTableWidgetItem* item)
}
midiSeq->msgSetMidiDevice(port, sdev);
- muse->changeConfig(true); // save configuration file
+ MusEGlobal::muse->changeConfig(true); // save configuration file
song->update();
}
}
@@ -1164,10 +1179,10 @@ void MPConfig::songChanged(int flags)
QTableWidgetItem* itemin = new QTableWidgetItem;
addItem(i, DEVCOL_INROUTES, itemin, mdevView);
itemin->setFlags(Qt::ItemIsEnabled);
- //QTableWidgetItem* itemdefin = new QTableWidgetItem(bitmap2String(port->defaultInChannels()));
+ //QTableWidgetItem* itemdefin = new QTableWidgetItem(MusEUtil::bitmap2String(port->defaultInChannels()));
// Ignore synth devices. Default input routes make no sense for them (right now).
QTableWidgetItem* itemdefin = new QTableWidgetItem((dev && dev->isSynti()) ?
- QString() : bitmap2String(port->defaultInChannels()));
+ QString() : MusEUtil::bitmap2String(port->defaultInChannels()));
addItem(i, DEVCOL_DEF_IN_CHANS, itemdefin, mdevView);
// Enabled: Use editor (not good). Disabled: Use pop-up menu.
#if 0
@@ -1184,12 +1199,12 @@ void MPConfig::songChanged(int flags)
// Turn on if and when multiple output routes are supported.
#if 0
- QTableWidgetItem* itemdefout = new QTableWidgetItem(bitmap2String(port->defaultOutChannels()));
+ QTableWidgetItem* itemdefout = new QTableWidgetItem(MusEUtil::bitmap2String(port->defaultOutChannels()));
addItem(i, DEVCOL_DEF_OUT_CHANS, itemdefout, mdevView);
itemdefout->setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled);
#else
//QTableWidgetItem* itemdefout = new QTableWidgetItem(QString("--"));
- QTableWidgetItem* itemdefout = new QTableWidgetItem(bitmap2String(0));
+ QTableWidgetItem* itemdefout = new QTableWidgetItem(MusEUtil::bitmap2String(0));
defochs = port->defaultOutChannels();
if(defochs)
{
@@ -1337,7 +1352,7 @@ void MPConfig::addInstanceClicked()
MidiDevice* dev = port->device();
if (dev==0) {
midiSeq->msgSetMidiDevice(port, si);
- muse->changeConfig(true); // save configuration file
+ MusEGlobal::muse->changeConfig(true); // save configuration file
song->update();
break;
}
@@ -1366,6 +1381,8 @@ void MPConfig::removeInstanceClicked()
audio->msgRemoveTrack(*ii);
}
+namespace MusEApp {
+
//---------------------------------------------------------
// configMidiPorts
//---------------------------------------------------------
@@ -1380,3 +1397,4 @@ void MusE::configMidiPorts()
midiPortConfig->activateWindow();
}
+} // namespace MusEApp
diff --git a/muse2/muse/confmport.h b/muse2/muse/confmport.h
index 6901035a..3e286b60 100644
--- a/muse2/muse/confmport.h
+++ b/muse2/muse/confmport.h
@@ -4,6 +4,21 @@
// $Id: confmport.h,v 1.3 2004/01/25 11:20:31 wschweer Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CONFMPORT_H__
@@ -19,9 +34,12 @@ class QTableWidget;
class QPoint;
class QMenu;
class QAction;
-class PopupMenu;
class Xml;
+namespace MusEWidget {
+class PopupMenu;
+}
+
//---------------------------------------------------------
// MPConfig
// Midi Port Config
@@ -31,7 +49,7 @@ class MPConfig : public QDialog, Ui::SynthConfigBase {
Q_OBJECT
QMenu* instrPopup;
//QMenu* popup;
- PopupMenu* defpup;
+ MusEWidget::PopupMenu* defpup;
int _showAliases; // -1: None. 0: First aliases. 1: Second aliases etc.
void setWhatsThis(QTableWidgetItem *item, int col);
void setToolTip(QTableWidgetItem *item, int col);
diff --git a/muse2/muse/controlfifo.cpp b/muse2/muse/controlfifo.cpp
index 526e88c7..741caad1 100644
--- a/muse2/muse/controlfifo.cpp
+++ b/muse2/muse/controlfifo.cpp
@@ -2,10 +2,12 @@
// MusE
// Linux Music Editor
//
-// Copyright (C) 1999-2010 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -14,7 +16,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "controlfifo.h"
diff --git a/muse2/muse/controlfifo.h b/muse2/muse/controlfifo.h
index d209ea91..8a9578f1 100644
--- a/muse2/muse/controlfifo.h
+++ b/muse2/muse/controlfifo.h
@@ -2,10 +2,12 @@
// MusE
// Linux Music Editor
//
-// Copyright (C) 1999-2010 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -14,7 +16,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __CONTROLFIFO_H__
@@ -61,4 +63,4 @@ class ControlFifo
};
-#endif \ No newline at end of file
+#endif
diff --git a/muse2/muse/ctrl.cpp b/muse2/muse/ctrl.cpp
index 0a863423..3779682d 100644
--- a/muse2/muse/ctrl.cpp
+++ b/muse2/muse/ctrl.cpp
@@ -7,6 +7,21 @@
//
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
// (C) Copyright 2011 Time E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
@@ -20,7 +35,7 @@
#include "globals.h"
#include "ctrl.h"
#include "xml.h"
-// #include "audio.h"
+#include "audio.h"
void CtrlList::initColor(int i)
{
@@ -82,7 +97,7 @@ CtrlList::CtrlList()
// value
//---------------------------------------------------------
-double CtrlList::value(int frame)
+double CtrlList::value(int frame) const
{
// Changed by Tim. p4.0.32...
@@ -141,11 +156,11 @@ double CtrlList::value(int frame)
//printf("before val1=%f val2=%f\n", val1,val2);
if (_valueType == VAL_LOG) {
val1 = 20.0*fast_log10(val1);
- if (val1 < config.minSlider)
- val1=config.minSlider;
+ if (val1 < MusEConfig::config.minSlider)
+ val1=MusEConfig::config.minSlider;
val2 = 20.0*fast_log10(val2);
- if (val2 < config.minSlider)
- val2=config.minSlider;
+ if (val2 < MusEConfig::config.minSlider)
+ val2=MusEConfig::config.minSlider;
}
//printf("after val1=%f val2=%f\n", val1,val2);
frame -= frame1;
@@ -166,6 +181,17 @@ double CtrlList::value(int frame)
return rv;
}
+//---------------------------------------------------------
+// curVal
+// returns the value at the current audio position
+//---------------------------------------------------------
+double CtrlList::curVal() const
+{
+ //double v = value(Pos(audio->tickPos()).frame()); // p4.0.33
+ //double v = value(audio->pos().frame()); // Try this.
+ //return v;
+ return _curVal;
+}
//---------------------------------------------------------
// setCurVal
diff --git a/muse2/muse/ctrl.h b/muse2/muse/ctrl.h
index 14f23643..1b603251 100644
--- a/muse2/muse/ctrl.h
+++ b/muse2/muse/ctrl.h
@@ -7,6 +7,21 @@
//
// (C) Copyright 2003-2004 Werner Schweer (ws@seh.de)
// (C) Copyright 2011 Time E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CTRL_H__
@@ -104,7 +119,7 @@ class CtrlList : public std::map<int, CtrlVal, std::less<int> > {
void setMode(Mode m) { _mode = m; }
double getDefault() const { return _default; }
void setDefault(double val) { _default = val; }
- double curVal() const { return _curVal; }
+ double curVal() const; /* { return _curVal; } */
void setCurVal(double val); // { _curVal = val; }
int id() const { return _id; }
QString name() const { return _name; }
@@ -120,7 +135,7 @@ class CtrlList : public std::map<int, CtrlVal, std::less<int> > {
CtrlValueType valueType() const { return _valueType; }
void setValueType(CtrlValueType t) { _valueType = t; }
- double value(int frame);
+ double value(int frame) const;
void add(int frame, double value);
void del(int frame);
void read(Xml& xml);
diff --git a/muse2/muse/ctrl/CMakeLists.txt b/muse2/muse/ctrl/CMakeLists.txt
index ca921775..f467b822 100644
--- a/muse2/muse/ctrl/CMakeLists.txt
+++ b/muse2/muse/ctrl/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/ctrl/ctrlcanvas.cpp b/muse2/muse/ctrl/ctrlcanvas.cpp
index 68e29f20..7c77a836 100644
--- a/muse2/muse/ctrl/ctrlcanvas.cpp
+++ b/muse2/muse/ctrl/ctrlcanvas.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ctrlcanvas.cpp,v 1.15.2.10 2009/11/14 03:37:48 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -184,10 +199,10 @@ CtrlCanvas::CtrlCanvas(MidiEditor* e, QWidget* parent, int xmag,
const char* name, CtrlPanel* pnl) : View(parent, xmag, 1, name)
{
setBg(Qt::white);
- setFont(config.fonts[3]);
+ setFont(MusEConfig::config.fonts[3]);
editor = e;
drag = DRAG_OFF;
- tool = PointerTool;
+ tool = MusEWidget::PointerTool;
pos[0] = 0;
pos[1] = 0;
pos[2] = 0;
@@ -212,7 +227,7 @@ CtrlCanvas::CtrlCanvas(MidiEditor* e, QWidget* parent, int xmag,
setCurTrackAndPart();
}
connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
- connect(muse, SIGNAL(configChanged()), SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged()));
curDrumInstrument = editor->curDrumInstrument();
//printf("CtrlCanvas::CtrlCanvas curDrumInstrument:%d\n", curDrumInstrument);
@@ -457,7 +472,7 @@ void CtrlCanvas::songChanged(int type)
return;
if(type & SC_CONFIG)
- setFont(config.fonts[3]);
+ setFont(MusEConfig::config.fonts[3]);
bool changed = false;
if(type & (SC_CONFIG | SC_PART_MODIFIED | SC_SELECTION))
@@ -663,7 +678,7 @@ void CtrlCanvas::viewMousePressEvent(QMouseEvent* event)
return;
start = event->pos();
- Tool activeTool = tool;
+ MusEWidget::Tool activeTool = tool;
bool ctrlKey = event->modifiers() & Qt::ControlModifier;
int xpos = start.x();
@@ -672,7 +687,7 @@ void CtrlCanvas::viewMousePressEvent(QMouseEvent* event)
MidiController::ControllerType type = midiControllerType(_controller->num());
switch (activeTool) {
- case PointerTool:
+ case MusEWidget::PointerTool:
if(curPart) // p4.0.27
{
drag = DRAG_LASSO_START;
@@ -717,7 +732,7 @@ void CtrlCanvas::viewMousePressEvent(QMouseEvent* event)
break;
- case PencilTool:
+ case MusEWidget::PencilTool:
if ((!ctrlKey) && (type != MidiController::Velo)) {
drag = DRAG_NEW;
song->startUndo();
@@ -730,7 +745,7 @@ void CtrlCanvas::viewMousePressEvent(QMouseEvent* event)
}
break;
- case RubberTool:
+ case MusEWidget::RubberTool:
if (type != MidiController::Velo) {
drag = DRAG_DELETE;
song->startUndo();
@@ -738,7 +753,7 @@ void CtrlCanvas::viewMousePressEvent(QMouseEvent* event)
}
break;
- case DrawTool:
+ case MusEWidget::DrawTool:
if (drawLineMode) {
line2x = xpos;
line2y = ypos;
@@ -802,7 +817,7 @@ void CtrlCanvas::viewMouseMoveEvent(QMouseEvent* event)
default:
break;
}
- if (tool == DrawTool && drawLineMode) {
+ if (tool == MusEWidget::DrawTool && drawLineMode) {
line2x = pos.x();
line2y = pos.y();
redraw();
@@ -915,8 +930,8 @@ void CtrlCanvas::newValRamp(int x1, int y1, int x2, int y2)
int raster = editor->raster();
if (raster == 1) // set reasonable raster
{
- //raster = config.division/4;
- raster = config.division/16; // Let's use 64th notes, for a bit finer resolution. p4.0.18 Tim.
+ //raster = MusEConfig::config.division/4;
+ raster = MusEConfig::config.division/16; // Let's use 64th notes, for a bit finer resolution. p4.0.18 Tim.
useRaster = true;
}
@@ -1373,8 +1388,8 @@ void CtrlCanvas::newVal(int x1, int y1, int x2, int y2)
int raster = editor->raster();
if (raster == 1) // set reasonable raster
{
- //raster = config.division/4;
- raster = config.division/16; // Let's use 64th notes, for a bit finer resolution. p4.0.18 Tim.
+ //raster = MusEConfig::config.division/4;
+ raster = MusEConfig::config.division/16; // Let's use 64th notes, for a bit finer resolution. p4.0.18 Tim.
useRaster = true;
}
@@ -1606,14 +1621,14 @@ void CtrlCanvas::deleteVal(int x1, int x2, int)
void CtrlCanvas::setTool(int t)
{
- if (tool == Tool(t))
+ if (tool == MusEWidget::Tool(t))
return;
- tool = Tool(t);
+ tool = MusEWidget::Tool(t);
switch(tool) {
- case PencilTool:
+ case MusEWidget::PencilTool:
setCursor(QCursor(*pencilIcon, 4, 15));
break;
- case DrawTool:
+ case MusEWidget::DrawTool:
drawLineMode = false;
break;
default:
@@ -1658,7 +1673,7 @@ void CtrlCanvas::pdrawItems(QPainter& p, const QRect& rect, const MidiPart* part
//if(!event.empty() && event.selected())
p.setPen(QPen(Qt::blue, 3));
else
- p.setPen(QPen(config.ctrlGraphFg, 3));
+ p.setPen(QPen(MusEConfig::config.ctrlGraphFg, 3));
}
else
p.setPen(QPen(Qt::darkGray, 3));
@@ -1750,7 +1765,7 @@ void CtrlCanvas::pdrawItems(QPainter& p, const QRect& rect, const MidiPart* part
p.drawLine(x1, lval, tick, lval);
}
else
- p.fillRect(x1, lval, tick - x1, wh - lval, selected ? Qt::blue : config.ctrlGraphFg);
+ p.fillRect(x1, lval, tick - x1, wh - lval, selected ? Qt::blue : MusEConfig::config.ctrlGraphFg);
}
@@ -1782,8 +1797,8 @@ void CtrlCanvas::pdrawItems(QPainter& p, const QRect& rect, const MidiPart* part
p.drawLine(x1, lval, x + w, lval);
}
else
- //p.fillRect(x1, lval, (x+w) - x1, wh - lval, config.ctrlGraphFg);
- p.fillRect(x1, lval, (x+w) - x1, wh - lval, selected ? Qt::blue : config.ctrlGraphFg);
+ //p.fillRect(x1, lval, (x+w) - x1, wh - lval, MusEConfig::config.ctrlGraphFg);
+ p.fillRect(x1, lval, (x+w) - x1, wh - lval, selected ? Qt::blue : MusEConfig::config.ctrlGraphFg);
}
}
}
@@ -1896,18 +1911,18 @@ void CtrlCanvas::drawOverlay(QPainter& p)
{
QString s(_controller ? _controller->name() : QString(""));
- //p.setFont(config.fonts[3]); // Use widget font instead.
+ //p.setFont(MusEConfig::config.fonts[3]); // Use widget font instead.
p.setFont(font());
p.setPen(Qt::black);
- //QFontMetrics fm(config.fonts[3]); // Use widget font metrics instead.
+ //QFontMetrics fm(MusEConfig::config.fonts[3]); // Use widget font metrics instead.
//int y = fm.lineSpacing() + 2;
int y = fontMetrics().lineSpacing() + 2;
p.drawText(2, y, s);
if (noEvents) {
- //p.setFont(config.fonts[3]);
+ //p.setFont(MusEConfig::config.fonts[3]);
//p.setPen(Qt::black);
//p.drawText(width()/2-100,height()/2-10, "Use shift + pencil or line tool to draw new events");
p.drawText(2 , y * 2, "Use shift + pencil or line tool to draw new events");
@@ -1921,7 +1936,7 @@ void CtrlCanvas::drawOverlay(QPainter& p)
QRect CtrlCanvas::overlayRect() const
{
- //QFontMetrics fm(config.fonts[3]); // Use widget font metrics instead (and set a widget font) !!!
+ //QFontMetrics fm(MusEConfig::config.fonts[3]); // Use widget font metrics instead (and set a widget font) !!!
QFontMetrics fm(fontMetrics());
QRect r(fm.boundingRect(_controller ? _controller->name() : QString("")));
@@ -1954,7 +1969,7 @@ void CtrlCanvas::draw(QPainter& p, const QRect& rect)
// draw line tool
//---------------------------------------------------
- if (drawLineMode && (tool == DrawTool)) {
+ if (drawLineMode && (tool == MusEWidget::DrawTool)) {
p.setPen(Qt::black);
p.drawLine(line1x, line1y, line2x, line2y);
}
diff --git a/muse2/muse/ctrl/ctrlcanvas.h b/muse2/muse/ctrl/ctrlcanvas.h
index e6864003..c9baf752 100644
--- a/muse2/muse/ctrl/ctrlcanvas.h
+++ b/muse2/muse/ctrl/ctrlcanvas.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ctrlcanvas.h,v 1.7.2.4 2009/06/01 20:15:53 spamatica Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CTRLCANVAS_H__
@@ -80,7 +95,7 @@ class CEventList: public std::list<CEvent*> {
// CtrlCanvas
//---------------------------------------------------------
-class CtrlCanvas : public View {
+class CtrlCanvas : public MusEWidget::View {
Q_OBJECT
MidiEditor* editor;
@@ -138,7 +153,7 @@ class CtrlCanvas : public View {
DragMode drag;
QRect lasso;
QPoint start;
- Tool tool;
+ MusEWidget::Tool tool;
unsigned pos[3];
int curDrumInstrument; //Used by the drum-editor to view velocity of only one key (one drum)
diff --git a/muse2/muse/ctrl/ctrledit.cpp b/muse2/muse/ctrl/ctrledit.cpp
index c4e33822..61f87d28 100644
--- a/muse2/muse/ctrl/ctrledit.cpp
+++ b/muse2/muse/ctrl/ctrledit.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ctrledit.cpp,v 1.4.2.2 2009/02/02 21:38:00 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -40,12 +55,12 @@ CtrlEdit::CtrlEdit(QWidget* parent, MidiEditor* e, int xmag,
QHBoxLayout* hbox = new QHBoxLayout;
panel = new CtrlPanel(0, e, "panel");
canvas = new CtrlCanvas(e, 0, xmag, "ctrlcanvas", panel);
- QWidget* vscale = new VScale;
+ QWidget* vscale = new MusEWidget::VScale;
hbox->setContentsMargins(0, 0, 0, 0);
hbox->setSpacing (0);
- canvas->setOrigin(-(config.division/4), 0);
+ canvas->setOrigin(-(MusEConfig::config.division/4), 0);
canvas->setMinimumHeight(50);
diff --git a/muse2/muse/ctrl/ctrledit.h b/muse2/muse/ctrl/ctrledit.h
index c5f5935e..e9ab3a52 100644
--- a/muse2/muse/ctrl/ctrledit.h
+++ b/muse2/muse/ctrl/ctrledit.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ctrledit.h,v 1.4.2.1 2008/05/21 00:28:53 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CTRL_EDIT_H__
diff --git a/muse2/muse/ctrl/ctrlpanel.cpp b/muse2/muse/ctrl/ctrlpanel.cpp
index b70c4d65..cb18afad 100644
--- a/muse2/muse/ctrl/ctrlpanel.cpp
+++ b/muse2/muse/ctrl/ctrlpanel.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ctrlpanel.cpp,v 1.10.2.9 2009/06/14 05:24:45 terminator356 Exp $
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -72,7 +87,7 @@ CtrlPanel::CtrlPanel(QWidget* parent, MidiEditor* e, const char* name)
dbox->setContentsMargins(0, 0, 0, 0);
selCtrl = new QPushButton(tr("S"));
- selCtrl->setFont(config.fonts[3]);
+ selCtrl->setFont(MusEConfig::config.fonts[3]);
selCtrl->setFixedHeight(20);
selCtrl->setSizePolicy(
QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
@@ -82,7 +97,7 @@ CtrlPanel::CtrlPanel(QWidget* parent, MidiEditor* e, const char* name)
// destroy button
QPushButton* destroy = new QPushButton(tr("X"));
- destroy->setFont(config.fonts[3]);
+ destroy->setFont(MusEConfig::config.fonts[3]);
destroy->setFixedHeight(20);
destroy->setSizePolicy(
QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
@@ -96,7 +111,7 @@ CtrlPanel::CtrlPanel(QWidget* parent, MidiEditor* e, const char* name)
_val = CTRL_VAL_UNKNOWN;
_dnum = -1;
- _knob = new Knob;
+ _knob = new MusEWidget::Knob;
_knob->setFixedWidth(25);
_knob->setFixedHeight(25);
_knob->setToolTip(tr("manual adjust"));
@@ -106,11 +121,11 @@ CtrlPanel::CtrlPanel(QWidget* parent, MidiEditor* e, const char* name)
_knob->hide();
_knob->setAltFaceColor(Qt::red);
- _dl = new DoubleLabel(-1.0, 0.0, +127.0);
+ _dl = new MusEWidget::DoubleLabel(-1.0, 0.0, +127.0);
_dl->setPrecision(0);
_dl->setToolTip(tr("double click on/off"));
_dl->setSpecialText(tr("off"));
- _dl->setFont(config.fonts[1]);
+ _dl->setFont(MusEConfig::config.fonts[1]);
_dl->setBackgroundRole(QPalette::Mid);
_dl->setFrame(true);
_dl->setFixedWidth(36);
@@ -134,7 +149,7 @@ CtrlPanel::CtrlPanel(QWidget* parent, MidiEditor* e, const char* name)
dbox->addStretch();
dbox->addWidget(_dl);
dbox->addStretch();
- connect(heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
+ connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
inHeartBeat = false;
setLayout(vbox);
}
@@ -169,7 +184,7 @@ void CtrlPanel::heartBeat()
int v = mp->hwCtrlState(chan, _dnum);
if(v == CTRL_VAL_UNKNOWN)
{
- // DoubleLabel ignores the value if already set...
+ // MusEWidget::DoubleLabel ignores the value if already set...
_dl->setValue(_dl->off() - 1.0);
_val = CTRL_VAL_UNKNOWN;
v = mp->lastValidHWCtrlState(chan, _dnum);
@@ -195,7 +210,7 @@ void CtrlPanel::heartBeat()
_val = v;
if(v == CTRL_VAL_UNKNOWN || ((_dnum == CTRL_PROGRAM) && ((v & 0xff) == 0xff) ))
{
- // DoubleLabel ignores the value if already set...
+ // MusEWidget::DoubleLabel ignores the value if already set...
//_dl->setValue(double(_ctrl->minVal() - 1));
_dl->setValue(_dl->off() - 1.0);
}
@@ -759,10 +774,10 @@ void CtrlPanel::ctrlPopup()
}
}
- PopupMenu* ctrlMainPop = new PopupMenu;
+ MusEWidget::PopupMenu* ctrlMainPop = new MusEWidget::PopupMenu;
//ctrlMainPop->addSeparator();
- ctrlMainPop->addAction(new MenuTitleItem(tr("Instrument-defined"), ctrlMainPop));
+ ctrlMainPop->addAction(new MusEWidget::MenuTitleItem(tr("Instrument-defined"), ctrlMainPop));
//ctrlMainPop->addAction(QIcon(*configureIcon), tr("Add ..."))->setData(max + 1);
@@ -781,7 +796,7 @@ void CtrlPanel::ctrlPopup()
//ctrlMainPop->addAction(QIcon(*midi_edit_instrumentIcon), tr("Edit instruments"))->setData(max + 2);
ctrlMainPop->addSeparator();
- ctrlMainPop->addAction(new MenuTitleItem(tr("Others"), ctrlMainPop));
+ ctrlMainPop->addAction(new MusEWidget::MenuTitleItem(tr("Others"), ctrlMainPop));
//ctrlMainPop->addAction(QIcon(*configureIcon), tr("Add ..."))->setData(max + 3);
@@ -819,8 +834,8 @@ void CtrlPanel::ctrlPopup()
}
else if (rv == max + 1) { // add new instrument controller
- PopupMenu * ctrlSubPop = new PopupMenu(this);
- ctrlSubPop->addAction(new MenuTitleItem(tr("Instrument-defined"), ctrlSubPop));
+ MusEWidget::PopupMenu * ctrlSubPop = new MusEWidget::PopupMenu(this);
+ ctrlSubPop->addAction(new MusEWidget::MenuTitleItem(tr("Instrument-defined"), ctrlSubPop));
//
// populate popup with all controllers available for
@@ -856,7 +871,7 @@ void CtrlPanel::ctrlPopup()
int rv2 = act2->data().toInt();
if (rv2 == max + 2) // edit instrument
- muse->startEditInstrument();
+ MusEGlobal::muse->startEditInstrument();
else // select new instrument control
{
MidiController* c;
@@ -888,11 +903,11 @@ void CtrlPanel::ctrlPopup()
}
//else if (rv == max + 2) // edit instrument
- // muse->startEditInstrument();
+ // MusEGlobal::muse->startEditInstrument();
else if (rv == max + 3) { // add new other controller
- PopupMenu* ctrlSubPop = new PopupMenu(this);
- ctrlSubPop->addAction(new MenuTitleItem(tr("Common Controls"), ctrlSubPop));
+ MusEWidget::PopupMenu* ctrlSubPop = new MusEWidget::PopupMenu(this);
+ ctrlSubPop->addAction(new MusEWidget::MenuTitleItem(tr("Common Controls"), ctrlSubPop));
for(int num = 0; num < 127; ++num)
if(cll->find(channel, num) == cll->end())
diff --git a/muse2/muse/ctrl/ctrlpanel.h b/muse2/muse/ctrl/ctrlpanel.h
index 3f6de205..0376a245 100644
--- a/muse2/muse/ctrl/ctrlpanel.h
+++ b/muse2/muse/ctrl/ctrlpanel.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ctrlpanel.h,v 1.2.2.5 2009/06/10 00:34:59 terminator356 Exp $
// (C) Copyright 1999-2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CTRL_PANEL_H__
@@ -14,9 +29,12 @@ class MidiController;
class QPushButton;
-class MidiEditor;
+namespace MusEWidget {
class Knob;
class DoubleLabel;
+}
+
+class MidiEditor;
class MidiPort;
class MidiTrack;
@@ -35,8 +53,8 @@ class CtrlPanel: public QWidget {
MidiController* _ctrl;
int _dnum;
bool inHeartBeat;
- Knob* _knob;
- DoubleLabel* _dl;
+ MusEWidget::Knob* _knob;
+ MusEWidget::DoubleLabel* _dl;
int _val;
diff --git a/muse2/muse/debug.h b/muse2/muse/debug.h
index 7339a613..4f3c77fe 100644
--- a/muse2/muse/debug.h
+++ b/muse2/muse/debug.h
@@ -2,6 +2,22 @@
// MusE
// Linux Music Editor
// $Id: debug.h,v 1.1.1.1 2003/10/27 18:51:20 wschweer Exp $
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MUSE_DEBUG_H__
diff --git a/muse2/muse/default_click.h b/muse2/muse/default_click.h
index 7f074350..950a168e 100644
--- a/muse2/muse/default_click.h
+++ b/muse2/muse/default_click.h
@@ -13,7 +13,7 @@
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
$Id: default_click.h,v 1.1.2.1 2004/11/15 23:25:51 spamatica Exp $
*/
diff --git a/muse2/muse/device.h b/muse2/muse/device.h
index b77ffb9b..82746c96 100644
--- a/muse2/muse/device.h
+++ b/muse2/muse/device.h
@@ -4,6 +4,21 @@
// $Id: device.h,v 1.1.1.1 2003/10/27 18:51:58 wschweer Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __DEVICE_H__
diff --git a/muse2/muse/dialogs.cpp b/muse2/muse/dialogs.cpp
index 674aa232..1dd19707 100644
--- a/muse2/muse/dialogs.cpp
+++ b/muse2/muse/dialogs.cpp
@@ -24,31 +24,31 @@
using namespace std;
-GateTime* gatetime_dialog=NULL;
-Velocity* velocity_dialog=NULL;
-Quantize* quantize_dialog=NULL;
-Remove* erase_dialog=NULL;
-DelOverlaps* del_overlaps_dialog=NULL;
-Setlen* set_notelen_dialog=NULL;
-Move* move_notes_dialog=NULL;
-Transpose* transpose_dialog=NULL;
-Crescendo* crescendo_dialog=NULL;
-Legato* legato_dialog=NULL;
-PasteDialog* paste_dialog=NULL;
+MusEDialog::GateTime* gatetime_dialog=NULL;
+MusEDialog::Velocity* velocity_dialog=NULL;
+MusEDialog::Quantize* quantize_dialog=NULL;
+MusEDialog::Remove* erase_dialog=NULL;
+MusEDialog::DelOverlaps* del_overlaps_dialog=NULL;
+MusEDialog::Setlen* set_notelen_dialog=NULL;
+MusEDialog::Move* move_notes_dialog=NULL;
+MusEDialog::Transpose* transpose_dialog=NULL;
+MusEDialog::Crescendo* crescendo_dialog=NULL;
+MusEDialog::Legato* legato_dialog=NULL;
+PasteDialog* paste_dialog=NULL; // FINDMICHJETZT
void init_function_dialogs(QWidget* parent)
{
- gatetime_dialog = new GateTime(parent);
- velocity_dialog = new Velocity(parent);
- quantize_dialog = new Quantize(parent);
- erase_dialog = new Remove(parent);
- del_overlaps_dialog = new DelOverlaps(parent);
- set_notelen_dialog = new Setlen(parent);
- move_notes_dialog = new Move(parent);
- transpose_dialog = new Transpose(parent);
- crescendo_dialog = new Crescendo(parent);
- legato_dialog = new Legato(parent);
- paste_dialog = new PasteDialog(parent);
+ gatetime_dialog = new MusEDialog::GateTime(parent);
+ velocity_dialog = new MusEDialog::Velocity(parent);
+ quantize_dialog = new MusEDialog::Quantize(parent);
+ erase_dialog = new MusEDialog::Remove(parent);
+ del_overlaps_dialog = new MusEDialog::DelOverlaps(parent);
+ set_notelen_dialog = new MusEDialog::Setlen(parent);
+ move_notes_dialog = new MusEDialog::Move(parent);
+ transpose_dialog = new MusEDialog::Transpose(parent);
+ crescendo_dialog = new MusEDialog::Crescendo(parent);
+ legato_dialog = new MusEDialog::Legato(parent);
+ paste_dialog = new PasteDialog(parent); // FINDMICHJETZT
}
void read_function_dialog_config(Xml& xml)
diff --git a/muse2/muse/dialogs.h b/muse2/muse/dialogs.h
index 3a99cdb0..4c449a6a 100644
--- a/muse2/muse/dialogs.h
+++ b/muse2/muse/dialogs.h
@@ -9,31 +9,34 @@
#define __DIALOGS_H__
class QWidget;
-class GateTime;
-class Velocity;
-class Quantize;
-class Remove;
-class DelOverlaps;
-class Setlen;
-class Move;
-class Transpose;
-class Crescendo;
-class Legato;
-class PasteDialog;
+namespace MusEDialog
+{
+ class GateTime;
+ class Velocity;
+ class Quantize;
+ class Remove;
+ class DelOverlaps;
+ class Setlen;
+ class Move;
+ class Transpose;
+ class Crescendo;
+ class Legato;
+}
+class PasteDialog; //FINDMICHJETZT put into namespace
class Xml;
-extern GateTime* gatetime_dialog;
-extern Velocity* velocity_dialog;
-extern Quantize* quantize_dialog;
-extern Remove* erase_dialog;
-extern DelOverlaps* del_overlaps_dialog;
-extern Setlen* set_notelen_dialog;
-extern Move* move_notes_dialog;
-extern Transpose* transpose_dialog;
-extern Crescendo* crescendo_dialog;
-extern Legato* legato_dialog;
-extern PasteDialog* paste_dialog;
+extern MusEDialog::GateTime* gatetime_dialog;
+extern MusEDialog::Velocity* velocity_dialog;
+extern MusEDialog::Quantize* quantize_dialog;
+extern MusEDialog::Remove* erase_dialog;
+extern MusEDialog::DelOverlaps* del_overlaps_dialog;
+extern MusEDialog::Setlen* set_notelen_dialog;
+extern MusEDialog::Move* move_notes_dialog;
+extern MusEDialog::Transpose* transpose_dialog;
+extern MusEDialog::Crescendo* crescendo_dialog;
+extern MusEDialog::Legato* legato_dialog;
+extern PasteDialog* paste_dialog; //FINDMICHJETZT
void init_function_dialogs(QWidget* parent);
void read_function_dialog_config(Xml& xml);
diff --git a/muse2/muse/driver/CMakeLists.txt b/muse2/muse/driver/CMakeLists.txt
index 0f9857f1..2833da04 100644
--- a/muse2/muse/driver/CMakeLists.txt
+++ b/muse2/muse/driver/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/driver/alsamidi.cpp b/muse2/muse/driver/alsamidi.cpp
index c7ae07b5..9a62dbdd 100644
--- a/muse2/muse/driver/alsamidi.cpp
+++ b/muse2/muse/driver/alsamidi.cpp
@@ -3,6 +3,22 @@
// Linux Music Editor
// $Id: alsamidi.cpp,v 1.8.2.7 2009/11/19 04:20:33 terminator356 Exp $
// (C) Copyright 2000-2001 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -10,16 +26,18 @@
#include "alsamidi.h"
#include "globals.h"
#include "midi.h"
-#include "mididev.h"
+//#include "mididev.h"
#include "../midiport.h"
#include "../midiseq.h"
#include "../midictrl.h"
#include "../audio.h"
-#include "mpevent.h"
+//#include "mpevent.h"
//#include "sync.h"
#include "utils.h"
#include "audiodev.h"
#include "xml.h"
+#include "part.h"
+#include "gconfig.h"
static int alsaSeqFdi = -1;
static int alsaSeqFdo = -1;
@@ -35,6 +53,8 @@ MidiAlsaDevice::MidiAlsaDevice(const snd_seq_addr_t& a, const QString& n)
: MidiDevice(n)
{
adr = a;
+ stopPending = false;
+ seekPending = false;
init();
}
@@ -117,7 +137,7 @@ void MidiAlsaDevice::close()
// Allocated on stack, no need to call snd_seq_port_subscribe_free() later.
snd_seq_port_subscribe_alloca(&subs);
- // Changed by T356. This function appears to be called only by MidiPort::setMidiDevice(),
+ // This function appears to be called only by MidiPort::setMidiDevice(),
// which closes then opens the device.
// Because the open flags are set BEFORE setMidiDevice() is called, we must ignore the flags.
//
@@ -131,7 +151,7 @@ void MidiAlsaDevice::close()
// dst 16:0
// only sometimes (not when playing notes), but with jack midi turned on,
// we don't get the messages. With jack stopped we get the messages
- // no matter if jack midi is turned on or not.
+ // no matter if jack midi is turned on or not. Tim.
//if (_openFlags & 1) {
//if (!(_openFlags & 1))
@@ -176,95 +196,27 @@ void MidiAlsaDevice::close()
void MidiAlsaDevice::writeRouting(int level, Xml& xml) const
{
- // p3.3.45
// If this device is not actually in use by the song, do not write any routes.
- // This prevents bogus routes from being saved and propagated in the med file.
+ // This prevents bogus routes from being saved and propagated in the med file. Tim.
if(midiPort() == -1)
return;
QString s;
- /*
- //if(rwFlags() & 2) // Readable
- {
- //RouteList* rl = _inRoutes;
- //for (ciRoute r = rl->begin(); r != rl->end(); ++r)
- for (ciRoute r = _inRoutes.begin(); r != _inRoutes.end(); ++r)
- {
- // Since an ALSA midi device supports read + write, this is the only way we can tell if this route is using the device as input.
- if(r->type == Route::TRACK_ROUTE)
- continue;
-
- if(!r->name().isEmpty())
- {
- xml.tag(level++, "Route");
-
- //xml.strTag(level, "srcNode", r->name());
- xml.tag(level, "source type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData());
-
- //xml.strTag(level, "dstNode", name());
- xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::ALSA_MIDI_ROUTE, name().toLatin1().constData());
-
- xml.etag(level--, "Route");
- }
- }
- }
- */
-
for (ciRoute r = _outRoutes.begin(); r != _outRoutes.end(); ++r)
{
- //if(r->type != Route::TRACK_ROUTE)
- //{
- // printf("MidiAlsaDevice::writeRouting Warning out route is not TRACK_ROUTE type\n");
- // continue;
- //}
-
if(!r->name().isEmpty())
{
- //xml.tag(level++, "Route");
-
s = QT_TRANSLATE_NOOP("@default", "Route");
if(r->channel != -1)
s += QString(QT_TRANSLATE_NOOP("@default", " channel=\"%1\"")).arg(r->channel);
xml.tag(level++, s.toLatin1().constData());
-
- /*
- //xml.strTag(level, "srcNode", name());
- if(r->channel != -1)
- //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::ALSA_MIDI_ROUTE, r->channel, name().toLatin1().constData());
- //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, r->channel, name().toLatin1().constData());
- xml.tag(level, "source devtype=\"%d\" channel=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, r->channel, name().toLatin1().constData());
- else
- //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::ALSA_MIDI_ROUTE, name().toLatin1().constData());
- //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().toLatin1().constData());
- */
- //xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, name().toLatin1().constData());
- xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, Xml::xmlString(name()).toLatin1().constData());
-
- /*
- //xml.strTag(level, "dstNode", r->name());
- if(r->channel != -1)
- {
- if(r->type == Route::MIDI_DEVICE_ROUTE)
- xml.tag(level, "dest devtype=\"%d\" channel=\"%d\" name=\"%s\"/", r->device->deviceType(), r->channel, r->name().toLatin1().constData());
- else
- xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", r->type, r->channel, r->name().toLatin1().constData());
- }
- else
- {
- if(r->type == Route::MIDI_DEVICE_ROUTE)
- xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", r->device->deviceType(), r->name().toLatin1().constData());
- else
- xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData());
- }
- */
-
+ xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::ALSA_MIDI, Xml::xmlString(name()).toLatin1().constData());
s = QT_TRANSLATE_NOOP("@default", "dest");
if(r->type == Route::MIDI_DEVICE_ROUTE)
s += QString(QT_TRANSLATE_NOOP("@default", " devtype=\"%1\"")).arg(r->device->deviceType());
else
if(r->type != Route::TRACK_ROUTE)
s += QString(QT_TRANSLATE_NOOP("@default", " type=\"%1\"")).arg(r->type);
- //s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(r->name());
s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(Xml::xmlString(r->name()));
xml.tag(level, s.toLatin1().constData());
@@ -279,7 +231,7 @@ void MidiAlsaDevice::writeRouting(int level, Xml& xml) const
bool MidiAlsaDevice::putMidiEvent(const MidiPlayEvent& e)
{
- if (midiOutputTrace) {
+ if (MusEGlobal::midiOutputTrace) {
printf("MidiOut: midiAlsa: ");
e.dump();
}
@@ -311,12 +263,9 @@ bool MidiAlsaDevice::putMidiEvent(const MidiPlayEvent& e)
int a = e.dataA();
int b = e.dataB();
int chn = e.channel();
- // p3.3.37
- //if (a < 0x1000) { // 7 Bit Controller
if (a < CTRL_14_OFFSET) { // 7 Bit Controller
snd_seq_ev_set_controller(&event, chn, a, b);
}
- //else if (a < 0x20000) { // 14 bit high resolution controller
else if (a < CTRL_RPN_OFFSET) { // 14 bit high resolution controller
int ctrlH = (a >> 8) & 0x7f;
int ctrlL = a & 0x7f;
@@ -324,7 +273,6 @@ bool MidiAlsaDevice::putMidiEvent(const MidiPlayEvent& e)
snd_seq_ev_set_controller(&event, chn, a, b);
event.type = SND_SEQ_EVENT_CONTROL14;
}
- //else if (a < 0x30000) { // RPN 7-Bit Controller
else if (a < CTRL_NRPN_OFFSET) { // RPN 7-Bit Controller
int ctrlH = (a >> 8) & 0x7f;
int ctrlL = a & 0x7f;
@@ -333,7 +281,6 @@ bool MidiAlsaDevice::putMidiEvent(const MidiPlayEvent& e)
snd_seq_ev_set_controller(&event, chn, a, b);
event.type = SND_SEQ_EVENT_REGPARAM;
}
- //else if (a < 0x40000) { // NRPN 7-Bit Controller
else if (a < CTRL_INTERNAL_OFFSET) { // NRPN 7-Bit Controller
int ctrlH = (a >> 8) & 0x7f;
int ctrlL = a & 0x7f;
@@ -342,7 +289,6 @@ bool MidiAlsaDevice::putMidiEvent(const MidiPlayEvent& e)
snd_seq_ev_set_controller(&event, chn, a, b);
event.type = SND_SEQ_EVENT_NONREGPARAM;
}
- //else if (a < 0x60000) { // RPN14 Controller
else if (a < CTRL_NRPN14_OFFSET) { // RPN14 Controller
int ctrlH = (a >> 8) & 0x7f;
int ctrlL = a & 0x7f;
@@ -350,7 +296,6 @@ bool MidiAlsaDevice::putMidiEvent(const MidiPlayEvent& e)
snd_seq_ev_set_controller(&event, chn, a, b);
event.type = SND_SEQ_EVENT_REGPARAM;
}
- //else if (a < 0x70000) { // NRPN14 Controller
else if (a < CTRL_NONE_OFFSET) { // NRPN14 Controller
int ctrlH = (a >> 8) & 0x7f;
int ctrlL = a & 0x7f;
@@ -451,13 +396,257 @@ bool MidiAlsaDevice::putEvent(snd_seq_event_t* event)
}
//---------------------------------------------------------
+// processMidi
+// Called from ALSA midi sequencer thread only.
+//---------------------------------------------------------
+
+void MidiAlsaDevice::processMidi()
+{
+ bool stop = stopPending; // Snapshots
+ bool seek = seekPending; //
+ seekPending = stopPending = false;
+ // Transfer the stuck notes FIFO to the play events list.
+ // FIXME It would be faster to have MidiAlsaDevice automatically add the stuck note so that only
+ // one FIFO would be needed. But that requires passing an extra 'tick' and 'off velocity' in
+ // addScheduledEvent, which felt too weird.
+ while(!stuckNotesFifo.isEmpty())
+ _stuckNotes.add(stuckNotesFifo.get());
+
+ bool extsync = extSyncFlag.value();
+ //int frameOffset = getFrameOffset();
+ //int nextTick = audio->nextTick();
+
+ // We're in the ALSA midi thread. audio->isPlaying() might not be true during seek right now.
+ //if(stop || (seek && audio->isPlaying()))
+ if(stop || seek)
+ {
+ //---------------------------------------------------
+ // Clear all notes and handle stuck notes
+ //---------------------------------------------------
+ playEventFifo.clear();
+ _playEvents.clear();
+ //printf("transferring stuck notes\n");
+ for(iMPEvent i = _stuckNotes.begin(); i != _stuckNotes.end(); ++i)
+ {
+ //printf(" stuck note\n");
+ MidiPlayEvent ev = *i;
+ ev.setTime(0);
+ _playEvents.add(ev);
+ }
+ _stuckNotes.clear();
+ }
+ else
+ {
+ // Transfer the play events FIFO to the play events list.
+ while(!playEventFifo.isEmpty())
+ _playEvents.add(playEventFifo.get());
+
+ /* TODO Handle these more directly than putting them into play events list.
+ //if(audio->isPlaying())
+ {
+ iMPEvent k;
+ for (k = _stuckNotes.begin(); k != _stuckNotes.end(); ++k) {
+ if (k->time() >= nextTick)
+ break;
+ MidiPlayEvent ev(*k);
+ if(extsync) // p3.3.25
+ ev.setTime(k->time());
+ else
+ ev.setTime(tempomap.tick2frame(k->time()) + frameOffset);
+ _playEvents.add(ev);
+ }
+ _stuckNotes.erase(_stuckNotes.begin(), k);
+ }
+ */
+ processStuckNotes();
+ }
+
+ /* Instead, done immediately in handleStop and handleSeek using putEvent.
+ if(stop)
+ {
+ // reset sustain...
+ MidiPort* mp = &midiPorts[_port];
+ for(int ch = 0; ch < MIDI_CHANNELS; ++ch)
+ {
+ if(mp->hwCtrlState(ch, CTRL_SUSTAIN) == 127)
+ {
+ //printf("send clear sustain!!!!!!!! port %d ch %d\n", i,ch);
+ MidiPlayEvent ev(0, _port, ch, ME_CONTROLLER, CTRL_SUSTAIN, 0);
+ _playEvents.add(ev);
+ }
+ }
+ }
+ if(seek)
+ {
+ // Send new contoller values...
+ for(iMidiCtrlValList ivl = cll->begin(); ivl != cll->end(); ++ivl)
+ {
+ MidiCtrlValList* vl = ivl->second;
+ iMidiCtrlVal imcv = vl->iValue(pos);
+ if(imcv != vl->end()) {
+ Part* p = imcv->second.part;
+ unsigned t = (unsigned)imcv->first;
+ // Do not add values that are outside of the part.
+ if(p && t >= p->tick() && t < (p->tick() + p->lenTick()) )
+ _playEvents.add(MidiPlayEvent(0, _port, ivl->first >> 24, ME_CONTROLLER, vl->num(), imcv->second.val));
+ }
+ }
+ } */
+
+ if (_playEvents.empty())
+ return;
+
+ int port = midiPort();
+ MidiPort* mp = port != -1 ? &midiPorts[port] : 0;
+ unsigned curFrame = audio->curFrame();
+ int tickpos = audio->tickPos();
+
+ // Play all events up to current frame.
+ iMPEvent i = _playEvents.begin();
+ for (; i != _playEvents.end(); ++i) {
+ if (i->time() > (extsync ? tickpos : curFrame)) // p3.3.25 Check: Should be nextTickPos? p4.0.34
+ break;
+ if(mp){
+ if (mp->sendEvent(*i))
+ break;
+ }
+ else
+ if(putMidiEvent(*i))
+ break;
+ }
+ _playEvents.erase(_playEvents.begin(), i);
+}
+
+//---------------------------------------------------------
+// handleStop
+//---------------------------------------------------------
+
+void MidiAlsaDevice::handleStop()
+{
+ // If the device is not in use by a port, don't bother it.
+ if(_port == -1)
+ return;
+
+ stopPending = true; // Trigger stop handling in processMidi.
+
+ //---------------------------------------------------
+ // reset sustain
+ //---------------------------------------------------
+
+ MidiPort* mp = &midiPorts[_port];
+ for(int ch = 0; ch < MIDI_CHANNELS; ++ch)
+ {
+ if(mp->hwCtrlState(ch, CTRL_SUSTAIN) == 127)
+ {
+ //printf("send clear sustain!!!!!!!! port %d ch %d\n", i,ch);
+ MidiPlayEvent ev(0, _port, ch, ME_CONTROLLER, CTRL_SUSTAIN, 0);
+ putMidiEvent(ev);
+ }
+ }
+
+ //---------------------------------------------------
+ // send midi stop
+ //---------------------------------------------------
+
+ // Don't send if external sync is on. The master, and our sync routing system will take care of that.
+ if(!extSyncFlag.value())
+ {
+ // Shall we check open flags?
+ //if(!(dev->rwFlags() & 0x1) || !(dev->openFlags() & 1))
+ //if(!(dev->openFlags() & 1))
+ // return;
+
+ MidiSyncInfo& si = mp->syncInfo();
+ if(si.MMCOut())
+ mp->sendMMCStop();
+
+ if(si.MRTOut())
+ {
+ // Send STOP
+ mp->sendStop();
+
+ // Added check of option send continue not start. p3.3.31
+ // Hmm, is this required? Seems to make other devices unhappy.
+ // (Could try now that this is in MidiDevice. p4.0.22 )
+ //if(!si.sendContNotStart())
+ // mp->sendSongpos(audio->tickPos() * 4 / config.division);
+ }
+ }
+}
+
+//---------------------------------------------------------
+// handleSeek
+//---------------------------------------------------------
+
+void MidiAlsaDevice::handleSeek()
+{
+ // If the device is not in use by a port, don't bother it.
+ if(_port == -1)
+ return;
+
+ seekPending = true; // Trigger seek handling in processMidi.
+
+ MidiPort* mp = &midiPorts[_port];
+ MidiCtrlValListList* cll = mp->controller();
+ int pos = audio->tickPos();
+
+ //---------------------------------------------------
+ // Send new contoller values
+ //---------------------------------------------------
+
+ for(iMidiCtrlValList ivl = cll->begin(); ivl != cll->end(); ++ivl)
+ {
+ MidiCtrlValList* vl = ivl->second;
+ iMidiCtrlVal imcv = vl->iValue(pos);
+ if(imcv != vl->end())
+ {
+ Part* p = imcv->second.part;
+ unsigned t = (unsigned)imcv->first;
+ // Do not add values that are outside of the part.
+ if(p && t >= p->tick() && t < (p->tick() + p->lenTick()) )
+ //_playEvents.add(MidiPlayEvent(0, _port, ivl->first >> 24, ME_CONTROLLER, vl->num(), imcv->second.val));
+ // Hmm, play event list for immediate playback? Try putEvent instead. p4.0.34
+ putMidiEvent(MidiPlayEvent(0, _port, ivl->first >> 24, ME_CONTROLLER, vl->num(), imcv->second.val));
+ }
+ }
+
+ //---------------------------------------------------
+ // Send STOP and "set song position pointer"
+ //---------------------------------------------------
+
+ // Don't send if external sync is on. The master, and our sync routing system will take care of that. p3.3.31
+ if(!extSyncFlag.value())
+ {
+ if(mp->syncInfo().MRTOut())
+ {
+ // Shall we check for device write open flag to see if it's ok to send?...
+ // This means obey what the user has chosen for read/write in the midi port config dialog,
+ // which already takes into account whether the device is writable or not.
+ //if(!(rwFlags() & 0x1) || !(openFlags() & 1))
+ //if(!(openFlags() & 1))
+ // continue;
+
+ int beat = (pos * 4) / MusEConfig::config.division;
+
+ //bool isPlaying = (state == PLAY);
+ bool isPlaying = audio->isPlaying(); // TODO Check this it includes LOOP1 and LOOP2 besides PLAY. p4.0.22
+
+ mp->sendStop();
+ mp->sendSongpos(beat);
+ if(isPlaying)
+ mp->sendContinue();
+ }
+ }
+}
+
+//---------------------------------------------------------
// initMidiAlsa
// return true on error
//---------------------------------------------------------
bool initMidiAlsa()
{
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("initMidiAlsa\n");
int error = snd_seq_open(&alsaSeq, "hw", SND_SEQ_OPEN_DUPLEX, SND_SEQ_NONBLOCK);
if (error < 0) {
@@ -495,7 +684,7 @@ bool initMidiAlsa()
if (capability & inCap)
flags |= 2;
dev->setrwFlags(flags);
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("ALSA port add: <%s>, %d:%d flags %d 0x%0x\n",
snd_seq_port_info_get_name(pinfo),
adr.client, adr.port,
@@ -524,7 +713,6 @@ bool initMidiAlsa()
}
}
- // p3.3.38
//snd_seq_set_client_name(alsaSeq, "MusE Sequencer");
snd_seq_set_client_name(alsaSeq, audioDevice->clientName());
@@ -750,7 +938,7 @@ void alsaProcessMidiInput()
}
if (mdev == 0 || curPort == -1) {
- if (debugMsg) {
+ if (MusEGlobal::debugMsg) {
fprintf(stderr, "no port %d:%d found for received alsa event\n",
ev->source.client, ev->source.port);
}
@@ -758,31 +946,6 @@ void alsaProcessMidiInput()
return;
}
- /*
- if(curPort == -1)
- {
- if(mdev == 0)
- {
- if (debugMsg)
- {
- fprintf(stderr, "no port %d:%d found for received alsa event\n",
- ev->source.client, ev->source.port);
- }
- }
- else
- {
- // Allow the sync detect mechanisms to work, even if device is not assigned to a port.
- if(ev->type == SND_SEQ_EVENT_CLOCK)
- mdev->syncInfo().trigMCSyncDetect();
- else
- if(ev->type == SND_SEQ_EVENT_TICK)
- mdev->syncInfo().trigTickDetect();
- }
- snd_seq_free_event(ev);
- return;
- }
- */
-
event.setType(0); // mark as unused
event.setPort(curPort);
event.setB(0);
@@ -852,7 +1015,6 @@ void alsaProcessMidiInput()
break;
case SND_SEQ_EVENT_SYSEX:
-
// TODO: Deal with large sysex, which are broken up into chunks!
// For now, do not accept if the first byte is not SYSEX or the last byte is not EOX,
// meaning it's a chunk, possibly with more chunks to follow.
@@ -901,13 +1063,7 @@ void alsaProcessMidiInput()
break;
}
if(event.type())
- {
mdev->recordEvent(event);
- // p3.3.26 1/23/10 Moved to MidiDevice now. Anticipating Jack midi support, so don't make it ALSA specific. Tim.
- //if(ev->type != SND_SEQ_EVENT_SYSEX)
- // Trigger general activity indicator detector. Sysex has no channel, don't trigger.
- // midiPorts[curPort].syncInfo().trigActDetect(event.channel());
- }
snd_seq_free_event(ev);
if (rv == 0)
diff --git a/muse2/muse/driver/alsamidi.h b/muse2/muse/driver/alsamidi.h
index a2480c5c..13e07ca4 100644
--- a/muse2/muse/driver/alsamidi.h
+++ b/muse2/muse/driver/alsamidi.h
@@ -3,6 +3,22 @@
// Linux Music Editor
// $Id: alsamidi.h,v 1.2 2004/01/14 09:06:43 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __ALSAMIDI_H__
@@ -11,6 +27,7 @@
#include <config.h>
#include <alsa/asoundlib.h>
+#include "mpevent.h"
#include "mididev.h"
class Xml;
@@ -24,6 +41,13 @@ class MidiAlsaDevice : public MidiDevice {
snd_seq_addr_t adr;
private:
+ // Special for ALSA midi device: Play event list is processed in the ALSA midi sequencer thread.
+ // Need this FIFO, to decouple from audio thread which adds events to the list.
+ MidiFifo playEventFifo;
+ MidiFifo stuckNotesFifo;
+ volatile bool stopPending;
+ volatile bool seekPending;
+
virtual QString open();
virtual void close();
virtual void processInput() {}
@@ -34,17 +58,22 @@ class MidiAlsaDevice : public MidiDevice {
virtual bool putMidiEvent(const MidiPlayEvent&);
public:
- //MidiAlsaDevice() {} // p3.3.55 Removed
MidiAlsaDevice(const snd_seq_addr_t&, const QString& name);
virtual ~MidiAlsaDevice() {}
- //virtual void* clientPort() { return (void*)&adr; }
- // p3.3.55
virtual void* inClientPort() { return (void*)&adr; } // For ALSA midi, in/out client ports are the same.
virtual void* outClientPort() { return (void*)&adr; } // That is, ALSA midi client ports can be both r/w.
virtual void writeRouting(int, Xml&) const;
virtual inline int deviceType() const { return ALSA_MIDI; }
+ // Schedule an event for playback. Returns false if event cannot be delivered.
+ virtual bool addScheduledEvent(const MidiPlayEvent& ev) { return !playEventFifo.put(ev); }
+ // Add a stuck note. Returns false if event cannot be delivered.
+ virtual bool addStuckNote(const MidiPlayEvent& ev) { return !stuckNotesFifo.put(ev); }
+ // Play all events up to current frame.
+ virtual void processMidi();
+ virtual void handleStop();
+ virtual void handleSeek();
};
extern bool initMidiAlsa();
diff --git a/muse2/muse/driver/alsatimer.cpp b/muse2/muse/driver/alsatimer.cpp
index d851410d..dee661fe 100644
--- a/muse2/muse/driver/alsatimer.cpp
+++ b/muse2/muse/driver/alsatimer.cpp
@@ -7,6 +7,21 @@
// alsalib 1.0.7
//
// (C) Copyright 2004 Robert Jonsson (rj@spamatica.se)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "alsatimer.h"
diff --git a/muse2/muse/driver/alsatimer.h b/muse2/muse/driver/alsatimer.h
index 211ba5ec..b906c02d 100644
--- a/muse2/muse/driver/alsatimer.h
+++ b/muse2/muse/driver/alsatimer.h
@@ -7,6 +7,21 @@
// alsalib 1.0.7
//
// (C) Copyright 2004 Robert Jonsson (rj@spamatica.se)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __ALSATIMER_H__
diff --git a/muse2/muse/driver/audiodev.h b/muse2/muse/driver/audiodev.h
index 4685b89a..3fe06fb9 100644
--- a/muse2/muse/driver/audiodev.h
+++ b/muse2/muse/driver/audiodev.h
@@ -4,6 +4,21 @@
// $Id: audiodev.h,v 1.5.2.2 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __AUDIODEV_H__
diff --git a/muse2/muse/driver/dummyaudio.cpp b/muse2/muse/driver/dummyaudio.cpp
index 55f091c2..4466e293 100644
--- a/muse2/muse/driver/dummyaudio.cpp
+++ b/muse2/muse/driver/dummyaudio.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: dummyaudio.cpp,v 1.3.2.16 2009/12/20 05:00:35 terminator356 Exp $
// (C) Copyright 2002-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -83,7 +98,7 @@ class DummyAudioDevice : public AudioDevice {
// p3.3.30
//if (nframes > dummyFrames) {
//printf("error: segment size > 1024\n");
- if (nframes > segmentSize) {
+ if (nframes > MusEGlobal::segmentSize) {
printf("DummyAudioDevice::getBuffer nframes > segment size\n");
exit(-1);
@@ -125,7 +140,7 @@ class DummyAudioDevice : public AudioDevice {
return _framePos; }
virtual unsigned frameTime() const {
- return lrint(curTime() * sampleRate);
+ return lrint(MusEUtil::curTime() * MusEGlobal::sampleRate);
}
virtual bool isRealtime() { return realtimeFlag; }
//virtual int realtimePriority() const { return 40; }
@@ -200,18 +215,20 @@ DummyAudioDevice::DummyAudioDevice()
// Added by Tim. p3.3.15
// p3.3.30
//posix_memalign((void**)&buffer, 16, sizeof(float) * dummyFrames);
- posix_memalign((void**)&buffer, 16, sizeof(float) * config.dummyAudioBufSize);
+ posix_memalign((void**)&buffer, 16, sizeof(float) * MusEConfig::config.dummyAudioBufSize);
dummyThread = 0;
realtimeFlag = false;
seekflag = false;
state = Audio::STOP;
- //startTime = curTime();
+ //startTime = MusEUtil::curTime();
_framePos = 0;
playPos = 0;
cmdQueue.clear();
}
+namespace MusEApp {
+
//---------------------------------------------------------
// exitDummyAudio
//---------------------------------------------------------
@@ -224,6 +241,8 @@ void exitDummyAudio()
audioDevice = NULL;
}
+} // namespace MusEApp
+
//---------------------------------------------------------
// initDummyAudio
//---------------------------------------------------------
@@ -274,13 +293,13 @@ static void* dummyLoop(void* ptr)
//unsigned int tickRate = 25;
// p3.3.30
- //sampleRate = 25600;
- sampleRate = config.dummyAudioSampleRate;
- //segmentSize = dummyFrames;
- segmentSize = config.dummyAudioBufSize;
+ //MusEGlobal::sampleRate = 25600;
+ MusEGlobal::sampleRate = MusEConfig::config.dummyAudioSampleRate;
+ //MusEGlobal::segmentSize = dummyFrames;
+ MusEGlobal::segmentSize = MusEConfig::config.dummyAudioBufSize;
#if 0
- //unsigned int tickRate = sampleRate / dummyFrames;
- unsigned int tickRate = sampleRate / segmentSize;
+ //unsigned int tickRate = MusEGlobal::sampleRate / dummyFrames;
+ unsigned int tickRate = MusEGlobal::sampleRate / MusEGlobal::segmentSize;
AlsaTimer timer;
fprintf(stderr, "Get alsa timer for dummy driver:\n");
@@ -297,7 +316,7 @@ static void* dummyLoop(void* ptr)
/* Depending on nature of the timer, the requested tickRate might not
* be available. The return value is the nearest available frequency,
- * so use this to reset our dummpy sampleRate to keep everything
+ * so use this to reset our dummpy MusEGlobal::sampleRate to keep everything
* consistent.
*/
tickRate = timer.setTimerFreq( /*250*/ tickRate );
@@ -307,7 +326,7 @@ static void* dummyLoop(void* ptr)
if(tickRate == 0)
tickRate = timer.getTimerFreq();
- sampleRate = tickRate * segmentSize;
+ MusEGlobal::sampleRate = tickRate * MusEGlobal::segmentSize;
timer.startTimer();
#endif
@@ -320,7 +339,7 @@ static void* dummyLoop(void* ptr)
/*
- doSetuid();
+ MusEGlobal::doSetuid();
struct sched_param rt_param;
int rv;
memset(&rt_param, 0, sizeof(sched_param));
@@ -349,13 +368,13 @@ static void* dummyLoop(void* ptr)
fprintf(stderr, "Unable to set thread to SCHED_FIFO\n");
}
}
- undoSetuid();
+ MusEGlobal::undoSetuid();
*/
#ifndef __APPLE__
- doSetuid();
+ MusEGlobal::doSetuid();
//if (realTimePriority) {
- if (realTimeScheduling) {
+ if (MusEGlobal::realTimeScheduling) {
//
// check if we really got realtime priviledges
//
@@ -367,7 +386,7 @@ static void* dummyLoop(void* ptr)
{
if (policy != SCHED_FIFO)
printf("audio dummy thread _NOT_ running SCHED_FIFO\n");
- else if (debugMsg) {
+ else if (MusEGlobal::debugMsg) {
struct sched_param rt_param;
memset(&rt_param, 0, sizeof(sched_param));
int type;
@@ -379,7 +398,7 @@ static void* dummyLoop(void* ptr)
}
}
}
- undoSetuid();
+ MusEGlobal::undoSetuid();
#endif
#if 0
@@ -423,8 +442,8 @@ static void* dummyLoop(void* ptr)
}
}
}
- audio->process(segmentSize);
- int increment = segmentSize; // 1 //tickRate / sampleRate * segmentSize;
+ audio->process(MusEGlobal::segmentSize);
+ int increment = MusEGlobal::segmentSize; // 1 //tickRate / MusEGlobal::sampleRate * MusEGlobal::segmentSize;
drvPtr->_framePos+=increment;
if (drvPtr->state == Audio::PLAY)
{
@@ -437,12 +456,12 @@ static void* dummyLoop(void* ptr)
{
//if(audioState == AUDIO_RUNNING)
if(audio->isRunning())
- //audio->process(segmentSize, drvPtr->state);
- audio->process(segmentSize);
+ //audio->process(MusEGlobal::segmentSize, drvPtr->state);
+ audio->process(MusEGlobal::segmentSize);
//else if (audioState == AUDIO_START1)
// audioState = AUDIO_START2;
- //usleep(dummyFrames*1000000/AL::sampleRate);
- usleep(segmentSize*1000000/sampleRate);
+ //usleep(dummyFrames*1000000/AL::MusEGlobal::sampleRate);
+ usleep(MusEGlobal::segmentSize*1000000/MusEGlobal::sampleRate);
//if(dummyAudio->seekflag)
if(drvPtr->seekflag)
{
@@ -456,9 +475,9 @@ static void* dummyLoop(void* ptr)
//if(dummyAudio->state == Audio::PLAY)
// dummyAudio->pos += dummyFrames;
- drvPtr->_framePos += segmentSize;
+ drvPtr->_framePos += MusEGlobal::segmentSize;
if(drvPtr->state == Audio::PLAY)
- drvPtr->playPos += segmentSize;
+ drvPtr->playPos += MusEGlobal::segmentSize;
}
#endif
@@ -472,7 +491,7 @@ void DummyAudioDevice::start(int priority)
_realTimePriority = priority;
pthread_attr_t* attributes = 0;
- if (realTimeScheduling && _realTimePriority > 0) {
+ if (MusEGlobal::realTimeScheduling && _realTimePriority > 0) {
attributes = (pthread_attr_t*) malloc(sizeof(pthread_attr_t));
pthread_attr_init(attributes);
@@ -499,11 +518,11 @@ void DummyAudioDevice::start(int priority)
int rv = pthread_create(&dummyThread, attributes, ::dummyLoop, this);
if(rv)
{
- // p4.0.16: realTimeScheduling is unreliable. It is true even in some clearly non-RT cases.
+ // p4.0.16: MusEGlobal::realTimeScheduling is unreliable. It is true even in some clearly non-RT cases.
// I cannot seem to find a reliable answer to the question of "are we RT or not".
// MusE was failing with a stock kernel because of PTHREAD_EXPLICIT_SCHED.
// So we'll just have to try again without attributes.
- if (realTimeScheduling && _realTimePriority > 0)
+ if (MusEGlobal::realTimeScheduling && _realTimePriority > 0)
rv = pthread_create(&dummyThread, NULL, ::dummyLoop, this);
}
diff --git a/muse2/muse/driver/jack.cpp b/muse2/muse/driver/jack.cpp
index 529e8a60..31179ea3 100644
--- a/muse2/muse/driver/jack.cpp
+++ b/muse2/muse/driver/jack.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: jack.cpp,v 1.30.2.17 2009/12/20 05:00:35 terminator356 Exp $
// (C) Copyright 2002 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "config.h"
@@ -39,8 +54,8 @@
//#include "errorhandler.h"
#ifndef RTCAP
-extern void doSetuid();
-extern void undoSetuid();
+extern void MusEGlobal::doSetuid();
+extern void MusEGlobal::undoSetuid();
#endif
#ifdef VST_SUPPORT
@@ -69,19 +84,6 @@ inline bool checkJackClient(jack_client_t* _client)
}
return true;
}
-//---------------------------------------------------------
-// checkAudioDevice - make sure audioDevice exists
-//---------------------------------------------------------
-bool checkAudioDevice()
- {
- if (audioDevice == NULL) {
- if(debugMsg)
- printf("Muse:checkAudioDevice: no audioDevice\n");
- return false;
- }
- return true;
- }
-
//---------------------------------------------------------
// jack_thread_init
@@ -89,7 +91,7 @@ bool checkAudioDevice()
static void jack_thread_init (void* ) // data
{
- doSetuid();
+ MusEGlobal::doSetuid();
/*
if (jackAudio->isRealtime()) {
struct sched_param rt_param;
@@ -123,7 +125,7 @@ static void jack_thread_init (void* ) // data
if (loadVST)
fst_adopt_thread();
#endif
- undoSetuid();
+ MusEGlobal::undoSetuid();
}
/*
@@ -272,11 +274,11 @@ int JackAudioDevice::processAudio(jack_nframes_t frames, void*)
// if (JACK_DEBUG)
// printf("processAudio - >>>>\n");
- segmentSize = frames;
+ MusEGlobal::segmentSize = frames;
if (audio->isRunning())
audio->process((unsigned long)frames);
else {
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
puts("jack calling when audio is disconnected!\n");
}
// if (JACK_DEBUG)
@@ -396,7 +398,7 @@ static void processShutdown(void*)
audio->shutdown();
int c=0;
- while(midiSeqRunning == true) {
+ while(MusEGlobal::midiSeqRunning == true) {
if(c++ >10) {
fprintf(stderr, "sequencer still running, something is very wrong.\n");
break;
@@ -540,13 +542,13 @@ bool initJackAudio()
if (JACK_DEBUG)
printf("initJackAudio()\n");
- if (debugMsg) {
+ if (MusEGlobal::debugMsg) {
fprintf(stderr,"initJackAudio()\n");
jack_set_error_function(jackError);
}
else
jack_set_error_function(noJackError);
- doSetuid();
+ MusEGlobal::doSetuid();
//jack_client_t* client = 0;
//int i = 0;
@@ -574,25 +576,25 @@ bool initJackAudio()
if (status & JackVersionError)
printf("jack server has wrong version\n");
printf("cannot create jack client\n");
- undoSetuid(); // p3.3.51
+ MusEGlobal::undoSetuid(); // p3.3.51
return true;
}
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
fprintf(stderr, "initJackAudio(): client %s opened.\n", jack_get_client_name(client));
if (client) {
jack_set_error_function(jackError);
//jackAudio = new JackAudioDevice(client, jackIdString);
jackAudio = new JackAudioDevice(client, jack_get_client_name(client));
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
fprintf(stderr, "initJackAudio(): registering client...\n");
jackAudio->registerClient();
- sampleRate = jack_get_sample_rate(client);
- segmentSize = jack_get_buffer_size(client);
+ MusEGlobal::sampleRate = jack_get_sample_rate(client);
+ MusEGlobal::segmentSize = jack_get_buffer_size(client);
jack_set_thread_init_callback(client, (JackThreadInitCallback) jack_thread_init, 0);
//jack_set_timebase_callback(client, 0, (JackTimebaseCallback) timebase_callback, 0);
}
- undoSetuid();
+ MusEGlobal::undoSetuid();
/*
// setup midi input/output
@@ -647,14 +649,14 @@ static int bufsize_callback(jack_nframes_t n, void*)
static void freewheel_callback(int starting, void*)
{
- if (debugMsg || JACK_DEBUG)
+ if (MusEGlobal::debugMsg || JACK_DEBUG)
printf("JACK: freewheel_callback: starting%d\n", starting);
audio->setFreewheel(starting);
}
static int srate_callback(jack_nframes_t n, void*)
{
- if (debugMsg || JACK_DEBUG)
+ if (MusEGlobal::debugMsg || JACK_DEBUG)
printf("JACK: sample rate changed: %d\n", n);
return 0;
}
@@ -665,7 +667,7 @@ static int srate_callback(jack_nframes_t n, void*)
static void registration_callback(jack_port_id_t, int, void*)
{
- if(debugMsg || JACK_DEBUG)
+ if(MusEGlobal::debugMsg || JACK_DEBUG)
printf("JACK: registration changed\n");
audio->sendMsgToGui('R');
@@ -743,7 +745,7 @@ void JackAudioDevice::connectJackMidiPorts()
// Ignore our own client ports.
if(jack_port_is_mine(_client, port))
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf(" ignoring own port: %s\n", *p);
continue;
}
@@ -754,7 +756,7 @@ void JackAudioDevice::connectJackMidiPorts()
//if(strncmp(buffer, "MusE", 4) == 0)
// continue;
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf(" found port: %s ", buffer);
// If there are aliases for this port, use the first one - much better for identifying.
@@ -770,7 +772,7 @@ void JackAudioDevice::connectJackMidiPorts()
//char* namep = (na >= 1) ? aliases[0] : buffer;
char* namep = aliases[0];
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("alias: %s\n", aliases[0]);
//int flags = 0;
@@ -847,7 +849,7 @@ void JackAudioDevice::connectJackMidiPorts()
static void client_registration_callback(const char *name, int isRegister, void*)
{
- if (debugMsg || JACK_DEBUG)
+ if (MusEGlobal::debugMsg || JACK_DEBUG)
printf("JACK: client registration changed:%s register:%d\n", name, isRegister);
}
@@ -857,7 +859,7 @@ static void client_registration_callback(const char *name, int isRegister, void*
static void port_connect_callback(jack_port_id_t a, jack_port_id_t b, int isConnect, void*)
{
- if (debugMsg || JACK_DEBUG)
+ if (MusEGlobal::debugMsg || JACK_DEBUG)
{
//jack_port_t* ap = jack_port_by_id(_client, a);
//jack_port_t* bp = jack_port_by_id(_client, b);
@@ -880,7 +882,7 @@ static int graph_callback(void*)
// context, so we send a message to the gui thread which in turn
// calls graphChanged()
audio->sendMsgToGui('C');
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("JACK: graph changed\n");
return 0;
}
@@ -1368,6 +1370,26 @@ void* JackAudioDevice::registerOutPort(const char* name, bool midi)
return p;
}
+namespace MusEGlobal {
+
+//---------------------------------------------------------
+// checkAudioDevice - make sure audioDevice exists
+//---------------------------------------------------------
+
+bool checkAudioDevice()
+ {
+ if (audioDevice == NULL) {
+ if(MusEGlobal::debugMsg)
+ printf("Muse:checkAudioDevice: no audioDevice\n");
+ return false;
+ }
+ return true;
+ }
+
+} // namespace MusEGlobal
+
+namespace MusEApp {
+
//---------------------------------------------------------
// exitJackAudio
//---------------------------------------------------------
@@ -1386,6 +1408,7 @@ void exitJackAudio()
audioDevice = NULL;
}
+} // namespace MusEApp
//---------------------------------------------------------
// connect
@@ -1458,10 +1481,10 @@ void JackAudioDevice::start(int /*priority*/)
printf("JackAudioDevice::start()\n");
if(!checkJackClient(_client)) return;
- doSetuid();
+ MusEGlobal::doSetuid();
if (jack_activate(_client)) {
- undoSetuid(); // p3.3.51
+ MusEGlobal::undoSetuid(); // p3.3.51
fprintf (stderr, "JACK: cannot activate client\n");
exit(-1);
}
@@ -1503,7 +1526,7 @@ void JackAudioDevice::start(int /*priority*/)
// Connect the Jack midi client ports to device ports.
connectJackMidiPorts();
- undoSetuid();
+ MusEGlobal::undoSetuid();
//MUSE_DEBUG("JackAudioDevice::start()\n");
fflush(stdin);
@@ -1594,7 +1617,7 @@ int JackAudioDevice::framesSinceCycleStart() const
int JackAudioDevice::frameDelay() const
{
- jack_nframes_t n = (segmentSize * (segmentCount-1)) - jack_frames_since_cycle_start(client);
+ jack_nframes_t n = (MusEGlobal::segmentSize * (segmentCount-1)) - jack_frames_since_cycle_start(client);
return (int)n;
}
#endif
@@ -1625,7 +1648,7 @@ std::list<QString> JackAudioDevice::outputPorts(bool midi, int aliases)
strncpy(buffer, *p, nsz);
//if (strncmp(buffer, "MusE", 4) == 0)
//{
- // if(debugMsg)
+ // if(MusEGlobal::debugMsg)
// printf("JackAudioDevice::outputPorts ignoring own MusE port: %s\n", *p);
// continue;
//}
@@ -1633,7 +1656,7 @@ std::list<QString> JackAudioDevice::outputPorts(bool midi, int aliases)
// Ignore our own client ports.
if(jack_port_is_mine(_client, port))
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("JackAudioDevice::outputPorts ignoring own port: %s\n", *p);
continue;
}
@@ -1698,7 +1721,7 @@ std::list<QString> JackAudioDevice::inputPorts(bool midi, int aliases)
strncpy(buffer, *p, nsz);
//if (strncmp(buffer, "MusE", 4) == 0)
//{
- // if(debugMsg)
+ // if(MusEGlobal::debugMsg)
// printf("JackAudioDevice::inputPorts ignoring own MusE port: %s\n", *p);
// continue;
//}
@@ -1706,7 +1729,7 @@ std::list<QString> JackAudioDevice::inputPorts(bool midi, int aliases)
// Ignore our own client ports.
if(jack_port_is_mine(_client, port))
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("JackAudioDevice::inputPorts ignoring own port: %s\n", *p);
continue;
}
@@ -1842,14 +1865,14 @@ void JackAudioDevice::setFreewheel(bool f)
bool JackAudioDevice::dummySync(int state)
{
// Roughly segment time length.
- //timespec ts = { 0, (1000000000 * segmentSize) / sampleRate }; // In nanoseconds.
- unsigned int sl = (1000000 * segmentSize) / sampleRate; // In microseconds.
+ //timespec ts = { 0, (1000000000 * MusEGlobal::segmentSize) / MusEGlobal::sampleRate }; // In nanoseconds.
+ unsigned int sl = (1000000 * MusEGlobal::segmentSize) / MusEGlobal::sampleRate; // In microseconds.
- double ct = curTime();
+ double ct = MusEUtil::curTime();
// Wait for a default maximum of 5 seconds.
// Similar to how Jack is supposed to wait a default of 2 seconds for slow clients.
// TODO: Make this timeout a 'settings' option so it can be applied both to Jack and here.
- while((curTime() - ct) < 5.0)
+ while((MusEUtil::curTime() - ct) < 5.0)
{
// Is MusE audio ready to roll?
if(audio->sync(state, dummyPos))
@@ -2057,7 +2080,7 @@ int JackAudioDevice::setMaster(bool f)
{
// Make Muse the Jack timebase master. Do it unconditionally (second param = 0).
r = jack_set_timebase_callback(_client, 0, (JackTimebaseCallback) timebase_callback, 0);
- if(debugMsg || JACK_DEBUG)
+ if(MusEGlobal::debugMsg || JACK_DEBUG)
{
if(r)
printf("JackAudioDevice::setMaster jack_set_timebase_callback failed: result:%d\n", r);
@@ -2072,7 +2095,7 @@ int JackAudioDevice::setMaster(bool f)
else
{
r = jack_release_timebase(_client);
- if(debugMsg || JACK_DEBUG)
+ if(MusEGlobal::debugMsg || JACK_DEBUG)
{
if(r)
printf("JackAudioDevice::setMaster jack_release_timebase failed: result:%d\n", r);
@@ -2087,7 +2110,7 @@ int JackAudioDevice::setMaster(bool f)
void JackAudioDevice::scanMidiPorts()
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("JackAudioDevice::scanMidiPorts:\n");
/*
@@ -2103,7 +2126,7 @@ void JackAudioDevice::scanMidiPorts()
// Ignore our own client ports.
if(jack_port_is_mine(_client, port))
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf(" ignoring own port: %s\n", *p);
continue;
}
@@ -2115,7 +2138,7 @@ void JackAudioDevice::scanMidiPorts()
//if(strncmp(buffer, "MusE", 4) == 0)
// continue;
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf(" found port: %s ", buffer);
// If there are aliases for this port, use the first one - much better for identifying.
@@ -2131,7 +2154,7 @@ void JackAudioDevice::scanMidiPorts()
//char* namep = (na >= 1) ? aliases[0] : buffer;
//char* namep = aliases[0];
//names.insert(std::string(*p));
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("alias: %s\n", aliases[0]);
names.insert(std::string(aliases[0]));
@@ -2151,7 +2174,7 @@ void JackAudioDevice::scanMidiPorts()
for(std::list<MidiDevice*>::iterator imd = to_del.begin(); imd != to_del.end(); ++imd)
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf(" removing port device:%s\n", (*imd)->name().toLatin1());
midiDevices.remove(*imd);
// This will close (and unregister) the client port.
@@ -2212,7 +2235,7 @@ void JackAudioDevice::scanMidiPorts()
//JackPort jp(0, QString(buffer), flags);
//portList.append(jp);
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf(" adding port device:%s\n", qname.toLatin1());
MidiJackDevice* dev = new MidiJackDevice(0, qname);
diff --git a/muse2/muse/driver/jackaudio.h b/muse2/muse/driver/jackaudio.h
index 5be0797f..d116a2ff 100644
--- a/muse2/muse/driver/jackaudio.h
+++ b/muse2/muse/driver/jackaudio.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: jackaudio.h,v 1.20.2.4 2009/12/20 05:00:35 terminator356 Exp $
// (C) Copyright 2002 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __JACKAUDIO_H__
@@ -13,10 +28,13 @@
class MidiPlayEvent;
+namespace MusEGlobal {
+bool checkAudioDevice();
+}
+
//---------------------------------------------------------
// JackAudioDevice
//---------------------------------------------------------
-bool checkAudioDevice();
class JackAudioDevice : public AudioDevice {
diff --git a/muse2/muse/driver/jackmidi.cpp b/muse2/muse/driver/jackmidi.cpp
index e514af7a..a4577f0b 100644
--- a/muse2/muse/driver/jackmidi.cpp
+++ b/muse2/muse/driver/jackmidi.cpp
@@ -3,6 +3,22 @@
// Linux Music Editor
// $Id: jackmidi.cpp,v 1.1.1.1 2010/01/27 09:06:43 terminator356 Exp $
// (C) Copyright 1999-2010 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QString>
@@ -33,128 +49,16 @@
extern unsigned int volatile lastExtMidiSyncTick;
-///int jackmidi_pi[2];
-///int jackmidi_po[2];
-
-//extern muse_jack_midi_buffer jack_midi_out_data[JACK_MIDI_CHANNELS];
-//extern muse_jack_midi_buffer jack_midi_in_data[JACK_MIDI_CHANNELS];
-///extern jack_port_t *midi_port_in[JACK_MIDI_CHANNELS];
-///extern jack_port_t *midi_port_out[JACK_MIDI_CHANNELS];
-
-///MidiJackDevice* gmdev = NULL;
-
-///int* jackSeq;
-//static snd_seq_addr_t musePort;
-
-//int MidiJackDevice::_nextOutIdNum = 0;
-//int MidiJackDevice::_nextInIdNum = 0;
-
-//int JackMidiPortList::_nextOutIdNum = 0;
-//int JackMidiPortList::_nextInIdNum = 0;
-
-//JackMidiPortList jackMidiClientPorts;
-
-
-/*
-//---------------------------------------------------------
-// JackMidiPortList
-//---------------------------------------------------------
-
-JackMidiPortList::JackMidiPortList()
-{
-
-}
-
-JackMidiPortList::~JackMidiPortList()
-{
-
-}
-
-iJackMidiPort JackMidiPortList::createClientPort(int flags) // 1 = writable, 2 = readable - do not mix
-{
- if(flags & 1)
- {
- char buf[80];
- snprintf(buf, 80, "muse-jack-midi-out-%d", _nextOutIdNum);
- jack_port_t* _client_jackport = (jack_port_t*)audioDevice->registerOutPort(buf, true);
- if(_client_jackport == NULL)
- {
- fprintf(stderr, "JackMidiPortList::createClientPort failed to register jack-midi-out\n");
- //return QString("Could not register jack-midi-out client port");
- return end();
- }
- else
- {
- JackMidiPort jmp(_client_jackport, QString(buf), flags);
- _nextOutIdNum++;
- return insert(begin(), std::pair<jack_port_t*, JackMidiPort>(_client_jackport, jmp));
- }
- }
- else
- if(flags & 2)
- {
- char buf[80];
- snprintf(buf, 80, "muse-jack-midi-in-%d", _nextInIdNum);
- jack_port_t* _client_jackport = (jack_port_t*)audioDevice->registerInPort(buf, true);
- if(_client_jackport == NULL)
- {
- fprintf(stderr, "JackMidiPortList::createClientPort failed to register jack-midi-in\n");
- return end();
- }
- else
- {
- JackMidiPort jmp(_client_jackport, QString(buf), flags);
- _nextInIdNum++;
- return insert(begin(), std::pair<jack_port_t*, JackMidiPort>(_client_jackport, jmp));
- }
- }
- return end();
-}
-
-// Return true if removed.
-bool JackMidiPortList::removeClientPort(jack_port_t* port)
-{
- iJackMidiPort ijp = find(port);
- if(ijp == end())
- return false;
-
- // Is output?
- if(ijp->second._flags & 1)
- _nextOutIdNum--;
- // Is input?
- if(ijp->second._flags & 2)
- _nextInIdNum--;
-
- erase(ijp);
-
- audioDevice->unregisterPort(port);
-
- return true;
-}
-*/
-
//---------------------------------------------------------
// MidiJackDevice
// in_jack_port or out_jack_port can be null
//---------------------------------------------------------
-//MidiJackDevice::MidiJackDevice(const int& a, const QString& n)
-//MidiJackDevice::MidiJackDevice(jack_port_t* jack_port, const QString& n)
-// p3.3.55
-//MidiJackDevice::MidiJackDevice(jack_port_t* in_jack_port, jack_port_t* out_jack_port, const QString& n)
MidiJackDevice::MidiJackDevice(const QString& n)
: MidiDevice(n)
{
- //_client_jackport = 0;
-
- //_client_jackport = jack_port;
- // p3.3.55
- //_in_client_jackport = in_jack_port;
- //_out_client_jackport = out_jack_port;
_in_client_jackport = NULL;
_out_client_jackport = NULL;
-
- //adr = a;
init();
}
@@ -164,10 +68,6 @@ MidiJackDevice::~MidiJackDevice()
printf("MidiJackDevice::~MidiJackDevice()\n");
#endif
- //if(_client_jackport)
- // audioDevice->unregisterPort(_client_jackport);
- // p3.3.55
-
if(audioDevice)
{
if(_in_client_jackport)
@@ -179,69 +79,13 @@ MidiJackDevice::~MidiJackDevice()
//close();
}
-/*
-//---------------------------------------------------------
-// select[RW]fd
-//---------------------------------------------------------
-
-int MidiJackDevice::selectRfd()
-{
- return jackmidi_pi[0];
-}
-
-int MidiJackDevice::selectWfd()
-{
- return jackmidi_po[0];
-}
-*/
-
//---------------------------------------------------------
// createJackMidiDevice
// If name parameter is blank, creates a new (locally) unique one.
//---------------------------------------------------------
-//QString MidiJackDevice::createJackMidiDevice(int rwflags) // 1:Writable 2: Readable. Do not mix.
-//MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // 1:Writable 2: Readable. Do not mix.
-MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p3.3.55 1:Writable 2: Readable 3: Writable + Readable
+MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // 1:Writable 2: Readable 3: Writable + Readable
{
-/// _openFlags &= _rwFlags; // restrict to available bits
-
-/// #ifdef JACK_MIDI_DEBUG
-/// printf("MidiJackDevice::open %s\n", name.toLatin1().constData());
-/// #endif
-
- //jack_port_t* jp = jack_port_by_name(_client, name().toLatin1().constData());
-/// jack_port_t* jp = (jack_port_t*)audioDevice->findPort(name().toLatin1().constData());
-
-/// if(!jp)
-/// {
-/// printf("MidiJackDevice::open: Jack midi port %s not found!\n", name().toLatin1().constData());
-/// _writeEnable = false;
-/// _readEnable = false;
-/// return QString("Jack midi port not found");
-/// }
-
-/// int pf = jack_port_flags(jp);
-
- //if(!name.isEmpty())
- //{
- // Does not work.
- // if(audioDevice->findPort(name.toLatin1().constData()))
- // {
- // fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed! Given port name %s already exists!\n", name.toLatin1().constData());
- // return 0;
- // }
- //}
-
- //jack_port_t* client_jackport = NULL;
- // p3.3.55
- ///jack_port_t* in_client_jackport = NULL;
- ///jack_port_t* out_client_jackport = NULL;
-
- //char buf[80];
-
-
- // p3.3.55
int ni = 0;
if(name.isEmpty())
{
@@ -258,188 +102,7 @@ MidiDevice* MidiJackDevice::createJackMidiDevice(QString name, int rwflags) // p
return 0;
}
- // If Jack port can receive data from us and we actually want to...
- //if((pf & JackPortIsInput) && (_openFlags & 1))
- ///if(rwflags & 1)
- ///{
- /* p3.3.55 Removed.
- if(name.isEmpty())
- {
- //snprintf(buf, 80, "muse-jack-midi-out-%d", _nextOutIdNum);
- for(int i = 0; ; ++i)
- {
- //snprintf(buf, 80, "midi-out-%d", i);
- name.sprintf("midi-out-%d", i);
-
- if(!midiDevices.find(name))
- {
- // Does not work.
- //if(!audioDevice->findPort(buf))
- // break;
- //client_jackport = (jack_port_t*)audioDevice->registerOutPort(buf, true);
- if(audioDevice->deviceType() == AudioDevice::JACK_AUDIO) // p3.3.52
- {
- //client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.toLatin1().constData(), true);
- out_client_jackport = (jack_port_t*)audioDevice->registerOutPort((name + QString("_out")).toLatin1().constData(), true); // p3.3.55
- //if(client_jackport)
- if(out_client_jackport) // p3.3.55
- break;
- }
- else
- break;
- }
-
- if(i == 65535)
- {
- fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed! Can't find unused output port name!\n");
- return 0;
- }
- }
- //name = QString(buf);
- }
- else
- */
-
- /*
- {
- if(audioDevice->deviceType() == AudioDevice::JACK_AUDIO) // p3.3.52
- {
- //client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.toLatin1().constData(), true);
- out_client_jackport = (jack_port_t*)audioDevice->registerOutPort((name + QString(JACK_MIDI_OUT_PORT_SUFFIX)).toLatin1().constData(), true); // p3.3.55
- //if(!client_jackport)
- if(!out_client_jackport) // p3.3.55
- {
- //fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed creating output port name %s\n", name.toLatin1().constData());
- fprintf(stderr, "MusE: createJackMidiDevice failed creating output port name %s\n", (name + QString(JACK_MIDI_OUT_PORT_SUFFIX)).toLatin1().constData()); // p3.3.55
-
- //return 0;
- rwflags &= ~1; // p3.3.55 Remove the output r/w flag, but continue on...
- }
- }
- }
- */
-
- /*
- else
- {
- client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.toLatin1().constData(), true);
- if(!client_jackport)
- {
- for(int i = 0; ; ++i)
- {
- snprintf(buf, 80, "midi-out-%d", i);
- // Does not work!
- //if(!audioDevice->findPort(buf))
- // break;
- client_jackport = (jack_port_t*)audioDevice->registerOutPort(buf, true);
- if(client_jackport)
- break;
-
- if(i == 65535)
- {
- fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed! Can't find unused output port name!\n");
- return 0;
- }
- }
- name = QString(buf);
- }
- }
- */
-
- //client_jackport = (jack_port_t*)audioDevice->registerOutPort(name.toLatin1().constData(), true);
- //if(client_jackport == NULL)
- //{
- // fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed to register jack midi client output port %s\n", name.toLatin1().constData());
- // return 0;
- //}
- //else
- // _nextOutIdNum++;
-
- ///}
- //else // Note docs say it can't be both input and output. // p3.3.55 Removed
-
- // If Jack port can send data to us and we actually want it...
- //if((pf & JackPortIsOutput) && (_openFlags & 2))
- ///if(rwflags & 2)
- ///{
- /* p3.3.55 Removed.
- if(name.isEmpty())
- {
- //snprintf(buf, 80, "muse-jack-midi-in-%d", _nextInIdNum);
- for(int i = 0; ; ++i)
- {
- //snprintf(buf, 80, "midi-in-%d", i);
- name.sprintf("midi-in-%d", i);
-
- if(!midiDevices.find(name))
- {
- // Does not work.
- //if(!audioDevice->findPort(buf))
- // break;
- //client_jackport = (jack_port_t*)audioDevice->registerInPort(buf, true);
- if(audioDevice->deviceType() == AudioDevice::JACK_AUDIO) // p3.3.52
- {
- //client_jackport = (jack_port_t*)audioDevice->registerInPort(name.toLatin1().constData(), true);
- in_client_jackport = (jack_port_t*)audioDevice->registerInPort(name.toLatin1().constData(), true); // p3.3.55
- //if(client_jackport)
- if(in_client_jackport) // p3.3.55
- break;
- }
- else
- break;
- }
-
- if(i == 65535)
- {
- fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed! Can't find unused input port name!\n");
- return 0;
- }
- }
- //name = QString(buf);
- }
- else
- */
-
- /*
- {
- if(audioDevice->deviceType() == AudioDevice::JACK_AUDIO) // p3.3.52
- {
- //client_jackport = (jack_port_t*)audioDevice->registerInPort(name.toLatin1().constData(), true);
- in_client_jackport = (jack_port_t*)audioDevice->registerInPort((name + QString(JACK_MIDI_IN_PORT_SUFFIX)).toLatin1().constData(), true); // p3.3.55
- //if(!client_jackport)
- if(!in_client_jackport) // p3.3.55
- {
- //fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed creating input port name %s\n", name.toLatin1().constData());
- fprintf(stderr, "MusE: createJackMidiDevice failed creating input port name %s\n", (name + QString(JACK_MIDI_IN_PORT_SUFFIX)).toLatin1().constData());
-
- //return 0;
- rwflags &= ~2; // p3.3.55 Remove the input r/w flag, but continue on...
- }
- }
- }
- */
-
- //client_jackport = (jack_port_t*)audioDevice->registerInPort(name.toLatin1().constData(), true);
-
- //if(client_jackport == NULL)
- //{
- // fprintf(stderr, "MidiJackDevice::createJackMidiDevice failed to register jack midi client input port %s\n", name.toLatin1().constData());
- //_readEnable = false;
- //return QString("Could not register jack-midi-in client port");
- // return 0;
- //}
- //else
- // _nextInIdNum++;
-
- ///}
-
- //if(client_jackport == NULL) // p3.3.52 Removed. Allow the device to be created even if Jack isn't running.
- // return 0;
-
- //MidiJackDevice* dev = new MidiJackDevice(client_jackport, name);
- //MidiJackDevice* dev = new MidiJackDevice(in_client_jackport, out_client_jackport, name); // p3.3.55
- //MidiJackDevice* dev = new MidiJackDevice(NULL, NULL, name); // p3.3.55
- MidiJackDevice* dev = new MidiJackDevice(name); // p3.3.55
+ MidiJackDevice* dev = new MidiJackDevice(name);
dev->setrwFlags(rwflags);
midiDevices.add(dev);
return dev;
@@ -456,9 +119,6 @@ void MidiJackDevice::setName(const QString& s)
#endif
_name = s;
- //if(clientPort()) // p3.3.52 Added check.
- // audioDevice->setPortName(clientPort(), s.toLatin1().constData());
- // p3.3.55
if(inClientPort())
audioDevice->setPortName(inClientPort(), (s + QString(JACK_MIDI_IN_PORT_SUFFIX)).toLatin1().constData());
if(outClientPort())
@@ -477,65 +137,7 @@ QString MidiJackDevice::open()
printf("MidiJackDevice::open %s\n", name().toLatin1().constData());
#endif
- /*
- //jack_port_t* jp = jack_port_by_name(_client, name().toLatin1().constData());
- jack_port_t* jp = (jack_port_t*)audioDevice->findPort(name().toLatin1().constData());
-
- if(!jp)
- {
- printf("MidiJackDevice::open: Jack midi port %s not found!\n", name().toLatin1().constData());
- _writeEnable = false;
- _readEnable = false;
- return QString("Jack midi port not found");
- }
-
- int pf = jack_port_flags(jp);
-
- // If Jack port can receive data from us and we actually want to...
- if((pf & JackPortIsInput) && (_openFlags & 1))
- {
- char buf[80];
- snprintf(buf, 80, "muse-jack-midi-out-%d", _nextOutIdNum);
- _client_jackport = (jack_port_t*)audioDevice->registerOutPort(buf, true);
- if(_client_jackport == NULL)
- {
- fprintf(stderr, "MidiJackDevice::open failed to register jack-midi-out\n");
- _writeEnable = false;
- return QString("Could not register jack-midi-out client port");
- }
- else
- {
- _nextOutIdNum++;
- // src, dest
- ///audioDevice->connect(_client_jackport, jp);
- _writeEnable = true;
- }
- }
- else // Note docs say it can't be both input and output.
- // If Jack port can send data to us and we actually want it...
- if((pf & JackPortIsOutput) && (_openFlags & 2))
- {
- char buf[80];
- snprintf(buf, 80, "muse-jack-midi-in-%d", _nextInIdNum);
- _client_jackport = (jack_port_t*)audioDevice->registerInPort(buf, true);
- if(_client_jackport == NULL)
- {
- fprintf(stderr, "MidiJackDevice::open failed to register jack-midi-in\n");
- _readEnable = false;
- return QString("Could not register jack-midi-in client port");
- }
- else
- {
- _nextInIdNum++;
- ///audioDevice->connect(jp, _client_jackport);
- _readEnable = true;
- }
- }
- */
-
-
QString s;
- // p3.3.55 Moved from createJackMidiDevice()
if(_openFlags & 1)
{
if(!_out_client_jackport)
@@ -608,9 +210,6 @@ QString MidiJackDevice::open()
_in_client_jackport = NULL;
}
- //if(client_jackport == NULL) // p3.3.52 Removed. Allow the device to be created even if Jack isn't running.
- // return 0;
-
_writeEnable = bool(_openFlags & 1);
_readEnable = bool(_openFlags & 2);
@@ -627,10 +226,10 @@ void MidiJackDevice::close()
printf("MidiJackDevice::close %s\n", name().toLatin1().constData());
#endif
- // p3.3.55 TODO: I don't really want to unregister the
+ // TODO: I don't really want to unregister the
// Jack midi ports because then we lose the connections
// to Jack every time we click the read/write lights
- // or change a port's device.
+ // or change a port's device. p3.3.55
/*
if(_client_jackport)
@@ -652,38 +251,6 @@ void MidiJackDevice::close()
_writeEnable = false;
_readEnable = false;
-
- /*
- //jack_port_t* jp = jack_port_by_name(_client, name().toLatin1().constData());
- jack_port_t* jp = (jack_port_t*)audioDevice->findPort(name().toLatin1().constData());
-
- if(!jp)
- {
- printf("MidiJackDevice::close: Jack midi port %s not found!\n", name().toLatin1().constData());
- _writeEnable = false;
- _readEnable = false;
- return;
- }
-
- //int pf = jack_port_flags(jp);
-
- // If Jack port can receive data from us and we actually want to...
- //if((pf & JackPortIsInput) && (_openFlags & 1))
- if(jack_port_connected_to(midi_port_out[0], name().toLatin1().constData()))
- {
- // src, dest
-/// audioDevice->disconnect(midi_port_out[0], jp);
- _writeEnable = false;
- }
- else // Note docs say it can't be both input and output.
- // If Jack port can send data to us and we actually want it...
- //if((pf & JackPortIsOutput) && (_openFlags & 2))
- if(jack_port_connected_to(midi_port_in[0], name().toLatin1().constData()))
- {
-/// audioDevice->disconnect(jp, midi_port_in[0]);
- _readEnable = false;
- }
- */
}
//---------------------------------------------------------
@@ -692,7 +259,6 @@ void MidiJackDevice::close()
void MidiJackDevice::writeRouting(int level, Xml& xml) const
{
- // p3.3.45
// If this device is not actually in use by the song, do not write any routes.
// This prevents bogus routes from being saved and propagated in the med file.
if(midiPort() == -1)
@@ -701,30 +267,17 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const
QString s;
if(rwFlags() & 2) // Readable
{
- //RouteList* rl = _inRoutes;
- //for (ciRoute r = rl->begin(); r != rl->end(); ++r)
for (ciRoute r = _inRoutes.begin(); r != _inRoutes.end(); ++r)
{
if(!r->name().isEmpty())
{
xml.tag(level++, "Route");
-
- //xml.strTag(level, "srcNode", r->name());
- //xml.tag(level, "source type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData());
s = QT_TRANSLATE_NOOP("@default", "source");
if(r->type != Route::TRACK_ROUTE)
s += QString(QT_TRANSLATE_NOOP("@default", " type=\"%1\"")).arg(r->type);
-
- //s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(r->name());
s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(Xml::xmlString(r->name()));
xml.tag(level, s.toLatin1().constData());
-
- //xml.strTag(level, "dstNode", name());
- //xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, name().toLatin1().constData());
- //xml.tag(level, "dest type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().toLatin1().constData());
- //xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, name().toLatin1().constData());
xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, Xml::xmlString(name()).toLatin1().constData());
-
xml.etag(level--, "Route");
}
}
@@ -737,49 +290,14 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const
s = QT_TRANSLATE_NOOP("@default", "Route");
if(r->channel != -1)
s += QString(QT_TRANSLATE_NOOP("@default", " channel=\"%1\"")).arg(r->channel);
-
- //xml.tag(level++, "Route");
xml.tag(level++, s.toLatin1().constData());
-
- /*
- //xml.strTag(level, "srcNode", name());
- if(r->channel != -1)
- //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, r->channel, name().toLatin1().constData());
- //xml.tag(level, "source type=\"%d\" channel=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, r->channel, name().toLatin1().constData());
- xml.tag(level, "source devtype=\"%d\" channel=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, r->channel, name().toLatin1().constData());
- else
- //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, name().toLatin1().constData());
- //xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::MIDI_DEVICE_ROUTE, name().toLatin1().constData());
- */
- //xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, name().toLatin1().constData());
- xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, Xml::xmlString(name()).toLatin1().constData());
-
- /*
- //xml.strTag(level, "dstNode", r->name());
- if(r->channel != -1)
- {
- if(r->type == Route::MIDI_DEVICE_ROUTE)
- xml.tag(level, "dest devtype=\"%d\" channel=\"%d\" name=\"%s\"/", r->device->deviceType(), r->channel, r->name().toLatin1().constData());
- else
- xml.tag(level, "dest type=\"%d\" channel=\"%d\" name=\"%s\"/", r->type, r->channel, r->name().toLatin1().constData());
- }
- else
- {
- if(r->type == Route::MIDI_DEVICE_ROUTE)
- xml.tag(level, "dest devtype=\"%d\" name=\"%s\"/", r->device->deviceType(), r->name().toLatin1().constData());
- else
- xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData());
- }
- */
-
+ xml.tag(level, "source devtype=\"%d\" name=\"%s\"/", MidiDevice::JACK_MIDI, Xml::xmlString(name()).toLatin1().constData());
s = QT_TRANSLATE_NOOP("@default", "dest");
if(r->type == Route::MIDI_DEVICE_ROUTE)
s += QString(QT_TRANSLATE_NOOP("@default", " devtype=\"%1\"")).arg(r->device->deviceType());
else
if(r->type != Route::TRACK_ROUTE)
s += QString(QT_TRANSLATE_NOOP("@default", " type=\"%1\"")).arg(r->type);
-
- //s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(r->name());
s += QString(QT_TRANSLATE_NOOP("@default", " name=\"%1\"/")).arg(Xml::xmlString(r->name()));
xml.tag(level, s.toLatin1().constData());
@@ -787,33 +305,6 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const
xml.etag(level--, "Route");
}
}
-
- /*
- else
- if(rwFlags() & 1) // Writable
- {
- //RouteList* rl = _outRoutes;
- //for (ciRoute r = rl->begin(); r != rl->end(); ++r)
- for (ciRoute r = _outRoutes.begin(); r != _outRoutes.end(); ++r)
- {
- if(!r->name().isEmpty())
- {
- xml.tag(level++, "Route");
-
- //xml.strTag(level, "srcNode", name());
- //if(r->channel != -1)
- // xml.tag(level, "srcNode type=\"%d\" channel=\"%d\" name=\"%s\"", Route::JACK_MIDI_ROUTE, r->channel, name().toLatin1().constData());
- //else
- xml.tag(level, "source type=\"%d\" name=\"%s\"/", Route::JACK_MIDI_ROUTE, name().toLatin1().constData());
-
- //xml.strTag(level, "dstNode", r->name());
- xml.tag(level, "dest type=\"%d\" name=\"%s\"/", r->type, r->name().toLatin1().constData());
-
- xml.etag(level--, "Route");
- }
- }
- }
- */
}
//---------------------------------------------------------
@@ -826,80 +317,8 @@ void MidiJackDevice::writeRouting(int level, Xml& xml) const
*/
bool MidiJackDevice::putMidiEvent(const MidiPlayEvent& /*event*/)
{
- /*
- int give, channel = event.channel();
- int x;
-
- if(channel >= JACK_MIDI_CHANNELS) return false;
-
- // buffer up events, because jack eats them in chunks, if
- // the buffer is full, there isn't so much to do, than
- // drop the event
-
- give = jack_midi_out_data[channel].give;
- if(jack_midi_out_data[channel].buffer[give*4+3]){
- fprintf(stderr, "WARNING: muse-to-jack midi-buffer is full, channel=%u\n", channel);
- return false;
- }
- // copy event(note-on etc..), pitch and volume
- // see http://www.midi.org/techspecs/midimessages.php
- switch(event.type()){
- case ME_NOTEOFF:
- jack_midi_out_data[channel].buffer[give*4+0] = 0x80;
- jack_midi_out_data[channel].buffer[give*4+1] = event.dataA() & 0x7f;
- jack_midi_out_data[channel].buffer[give*4+2] = event.dataB() & 0x7f;
- break;
- case ME_NOTEON:
- jack_midi_out_data[channel].buffer[give*4+0] = 0x90;
- jack_midi_out_data[channel].buffer[give*4+1] = event.dataA() & 0x7f;
- jack_midi_out_data[channel].buffer[give*4+2] = event.dataB() & 0x7f;
- break;
- case ME_CONTROLLER:
- jack_midi_out_data[channel].buffer[give*4+0] = 0xb0;
- jack_midi_out_data[channel].buffer[give*4+1] = event.dataA() & 0x7f;
- jack_midi_out_data[channel].buffer[give*4+2] = event.dataB() & 0x7f;
- break;
- case ME_PROGRAM:
- jack_midi_out_data[channel].buffer[give*4+0] = 0xc0;
- jack_midi_out_data[channel].buffer[give*4+1] = event.dataA() & 0x7f;
- jack_midi_out_data[channel].buffer[give*4+2] = 0;
- break;
- case ME_PITCHBEND:
- jack_midi_out_data[channel].buffer[give*4+0] = 0xE0;
- // convert muse pitch-bend to midi standard
- x = 0x2000 + event.dataA();
- jack_midi_out_data[channel].buffer[give*4+1] = x & 0x7f;
- jack_midi_out_data[channel].buffer[give*4+2] = (x >> 8) & 0x7f;
- break;
- default:
- fprintf(stderr, "jack-midi-out %u WARNING: unknown event %x\n", channel, event.type());
- return false;
- }
- jack_midi_out_data[channel].buffer[give*4+3] = 1; // mark state of this slot
- // finally increase give position
- give++;
- if(give >= JACK_MIDI_BUFFER_SIZE){
- give = 0;
- }
- jack_midi_out_data[channel].give = give;
- return false;
- */
-
- return false;
-}
-
-/*
-//---------------------------------------------------------
-// putEvent
-// return false if event is delivered
-//---------------------------------------------------------
-
-bool MidiJackDevice::putEvent(int* event)
-{
- int *y; y = event;
return false;
}
-*/
//---------------------------------------------------------
// recordEvent
@@ -912,7 +331,7 @@ void MidiJackDevice::recordEvent(MidiRecordEvent& event)
if(audio->isPlaying())
event.setLoopNum(audio->loopCount());
- if (midiInputTrace) {
+ if (MusEGlobal::midiInputTrace) {
printf("Jack MidiInput: ");
event.dump();
}
@@ -964,11 +383,11 @@ void MidiJackDevice::recordEvent(MidiRecordEvent& event)
processMidiInputTransformPlugins(event);
- if (filterEvent(event, midiRecordType, false))
+ if (filterEvent(event, MusEGlobal::midiRecordType, false))
return;
if (!applyMidiInputTransformation(event)) {
- if (midiInputTrace)
+ if (MusEGlobal::midiInputTrace)
printf(" midi input transformation: event filtered\n");
return;
}
@@ -989,9 +408,8 @@ void MidiJackDevice::recordEvent(MidiRecordEvent& event)
//if(_recordFifo.put(MidiPlayEvent(event)))
// printf("MidiJackDevice::recordEvent: fifo overflow\n");
- // p3.3.38
// Do not bother recording if it is NOT actually being used by a port.
- // Because from this point on, process handles things, by selected port.
+ // Because from this point on, process handles things, by selected port. p3.3.38
if(_port == -1)
return;
@@ -1010,8 +428,8 @@ void MidiJackDevice::eventReceived(jack_midi_event_t* ev)
MidiRecordEvent event;
event.setB(0);
- // NOTE: From MusE-2. Not done here in Muse-1 (yet).
- // move all events 2*segmentSize into the future to get
+ // NOTE: From muse_qt4_evolution. Not done here in Muse-2 (yet).
+ // move all events 2*MusEGlobal::segmentSize into the future to get
// jitterfree playback
//
// cycle n-1 n n+1
@@ -1019,15 +437,11 @@ void MidiJackDevice::eventReceived(jack_midi_event_t* ev)
// ^ ^ ^
// catch process play
//
-// const SeqTime* st = audio->seqTime();
-
- //unsigned curFrame = st->startFrame() + segmentSize;
-// unsigned curFrame = st->lastFrameTime;
+
//int frameOffset = audio->getFrameOffset();
unsigned pos = audio->pos().frame();
- //event.setTime(pos + ev->time);
- event.setTime(extSyncFlag.value() ? lastExtMidiSyncTick : (pos + ev->time));
+ event.setTime(extSyncFlag.value() ? lastExtMidiSyncTick : (pos + ev->time)); // p3.3.25
event.setChannel(*(ev->buffer) & 0xf);
int type = *(ev->buffer) & 0xf0;
@@ -1061,7 +475,7 @@ void MidiJackDevice::eventReceived(jack_midi_event_t* ev)
// For now, do not accept if the last byte is not EOX, meaning it's a chunk with more chunks to follow.
if(*(((unsigned char*)ev->buffer) + ev->size - 1) != ME_SYSEX_END)
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MidiJackDevice::eventReceived sysex chunks not supported!\n");
return;
}
@@ -1093,7 +507,7 @@ void MidiJackDevice::eventReceived(jack_midi_event_t* ev)
//break;
// return;
default:
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MidiJackDevice::eventReceived unsupported system event 0x%02x\n", type);
return;
}
@@ -1101,13 +515,13 @@ void MidiJackDevice::eventReceived(jack_midi_event_t* ev)
//return;
break;
default:
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MidiJackDevice::eventReceived unknown event 0x%02x\n", type);
//printf("MidiJackDevice::eventReceived unknown event 0x%02x size:%d buf:0x%02x 0x%02x 0x%02x ...0x%02x\n", type, ev->size, *(ev->buffer), *(ev->buffer + 1), *(ev->buffer + 2), *(ev->buffer + (ev->size - 1)));
return;
}
- if (midiInputTrace) {
+ if (MusEGlobal::midiInputTrace) {
printf("MidiInput<%s>: ", name().toLatin1().constData());
event.dump();
}
@@ -1129,13 +543,10 @@ void MidiJackDevice::collectMidiEvents()
if(!_readEnable)
return;
- //if(!_client_jackport)
- if(!_in_client_jackport) // p3.3.55
+ if(!_in_client_jackport)
return;
- //void* port_buf = jack_port_get_buffer(_client_jackport, segmentSize);
- void* port_buf = jack_port_get_buffer(_in_client_jackport, segmentSize); // p3.3.55
-
+ void* port_buf = jack_port_get_buffer(_in_client_jackport, MusEGlobal::segmentSize);
jack_midi_event_t event;
jack_nframes_t eventCount = jack_midi_get_event_count(port_buf);
for (jack_nframes_t i = 0; i < eventCount; ++i)
@@ -1157,9 +568,7 @@ void MidiJackDevice::collectMidiEvents()
bool MidiJackDevice::putEvent(const MidiPlayEvent& ev)
{
- //if(!_writeEnable)
- if(!_writeEnable || !_out_client_jackport) // p4.0.15
- //return true;
+ if(!_writeEnable || !_out_client_jackport)
return false;
#ifdef JACK_MIDI_DEBUG
@@ -1178,9 +587,7 @@ bool MidiJackDevice::putEvent(const MidiPlayEvent& ev)
// return true if successful
//---------------------------------------------------------
-//void JackAudioDevice::putEvent(Port port, const MidiEvent& e)
bool MidiJackDevice::queueEvent(const MidiPlayEvent& e)
-//bool MidiJackDevice::queueEvent(const MidiPlayEvent& e)
{
// Perhaps we can find use for this value later, together with the Jack midi MusE port(s).
// No big deal if not. Not used for now.
@@ -1194,14 +601,12 @@ bool MidiJackDevice::queueEvent(const MidiPlayEvent& e)
// e.dump();
// }
- //if(debugMsg)
+ //if(MusEGlobal::debugMsg)
// printf("MidiJackDevice::queueEvent\n");
- //if(!_client_jackport)
- if(!_out_client_jackport) // p3.3.55
+ if(!_out_client_jackport)
return false;
- //void* pb = jack_port_get_buffer(_client_jackport, segmentSize);
- void* pb = jack_port_get_buffer(_out_client_jackport, segmentSize); // p3.3.55
+ void* pb = jack_port_get_buffer(_out_client_jackport, MusEGlobal::segmentSize);
//unsigned frameCounter = ->frameTime();
int frameOffset = audio->getFrameOffset();
@@ -1210,10 +615,10 @@ bool MidiJackDevice::queueEvent(const MidiPlayEvent& e)
if (ft < 0)
ft = 0;
- if (ft >= (int)segmentSize) {
- printf("MidiJackDevice::queueEvent: Event time:%d out of range. offset:%d ft:%d (seg=%d)\n", e.time(), frameOffset, ft, segmentSize);
- if (ft > (int)segmentSize)
- ft = segmentSize - 1;
+ if (ft >= (int)MusEGlobal::segmentSize) {
+ printf("MidiJackDevice::queueEvent: Event time:%d out of range. offset:%d ft:%d (seg=%d)\n", e.time(), frameOffset, ft, MusEGlobal::segmentSize);
+ if (ft > (int)MusEGlobal::segmentSize)
+ ft = MusEGlobal::segmentSize - 1;
}
#ifdef JACK_MIDI_DEBUG
@@ -1293,7 +698,7 @@ bool MidiJackDevice::queueEvent(const MidiPlayEvent& e)
case ME_START:
case ME_CONTINUE:
case ME_STOP:
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MidiJackDevice::queueEvent: event type %x not supported\n", e.type());
//return false;
return true; // Absorb the event. Don't want it hanging around in the list. FIXME: Support these? p4.0.15 Tim.
@@ -1325,7 +730,7 @@ bool MidiJackDevice::processEvent(const MidiPlayEvent& event)
// Just do this 'standard midi 64T timing thing' for now until we figure out more precise external timings.
// Does require relatively short audio buffers, in order to catch the resolution, but buffer <= 256 should be OK...
// Tested OK so far with 128.
- ///if(extSyncFlag.value())
+ //if(extSyncFlag.value())
// p4.0.15 Or, is the event marked to be played immediately?
// Nothing to do but stamp the event to be queued for frame 0+.
if(t == 0 || extSyncFlag.value())
@@ -1362,17 +767,13 @@ bool MidiJackDevice::processEvent(const MidiPlayEvent& event)
if(event.type() == ME_PITCHBEND)
{
int v = a + 8192;
- // p3.3.44
//printf("MidiJackDevice::processEvent ME_PITCHBEND v:%d time:%d type:%d ch:%d A:%d B:%d\n", v, event.time(), event.type(), event.channel(), event.dataA(), event.dataB());
-
if(!queueEvent(MidiPlayEvent(t, port, chn, ME_PITCHBEND, v & 0x7f, (v >> 7) & 0x7f)))
return false;
}
else
if(event.type() == ME_CONTROLLER)
{
- //int a = event.dataA();
- //int b = event.dataB();
// Perhaps we can find use for this value later, together with the Jack midi MusE port(s).
// No big deal if not. Not used for now.
//int port = event.port();
@@ -1392,9 +793,7 @@ bool MidiJackDevice::processEvent(const MidiPlayEvent& event)
if(a == CTRL_PITCH)
{
int v = b + 8192;
- // p3.3.44
//printf("MidiJackDevice::processEvent CTRL_PITCH v:%d time:%d type:%d ch:%d A:%d B:%d\n", v, event.time(), event.type(), event.channel(), event.dataA(), event.dataB());
-
if(!queueEvent(MidiPlayEvent(t, port, chn, ME_PITCHBEND, v & 0x7f, (v >> 7) & 0x7f)))
return false;
}
@@ -1405,8 +804,6 @@ bool MidiJackDevice::processEvent(const MidiPlayEvent& event)
int hb = (b >> 16) & 0xff;
int lb = (b >> 8) & 0xff;
int pr = b & 0x7f;
-
- // p3.3.44
//printf("MidiJackDevice::processEvent CTRL_PROGRAM time:%d type:%d ch:%d A:%d B:%d hb:%d lb:%d pr:%d\n",
// event.time(), event.type(), event.channel(), event.dataA(), event.dataB(), hb, lb, pr);
@@ -1425,7 +822,7 @@ bool MidiJackDevice::processEvent(const MidiPlayEvent& event)
// }
}
- else if (a == CTRL_MASTER_VOLUME) // Enabled p4.0.15 Tim.
+ else if (a == CTRL_MASTER_VOLUME)
{
unsigned char sysex[] = {
0x7f, 0x7f, 0x04, 0x01, 0x00, 0x00
@@ -1565,7 +962,7 @@ bool MidiJackDevice::processEvent(const MidiPlayEvent& event)
}
else
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MidiJackDevice::processEvent: unknown controller type 0x%x\n", a);
//return false; // Just ignore it.
}
@@ -1581,65 +978,41 @@ bool MidiJackDevice::processEvent(const MidiPlayEvent& event)
}
//---------------------------------------------------------
-// processMidi called from audio process only.
+// processMidi
+// Called from audio thread only.
//---------------------------------------------------------
void MidiJackDevice::processMidi()
{
- //if(!_client_jackport)
- //if(!_out_client_jackport) // p3.3.55
- // return;
+ processStuckNotes();
- //void* port_buf = jack_port_get_buffer(_client_jackport, segmentSize);
- //void* port_buf = jack_port_get_buffer(_out_client_jackport, segmentSize); // p3.3.55
void* port_buf = 0;
- if(_out_client_jackport && _writeEnable) // p4.0.15
+ if(_out_client_jackport && _writeEnable)
{
- port_buf = jack_port_get_buffer(_out_client_jackport, segmentSize);
+ port_buf = jack_port_get_buffer(_out_client_jackport, MusEGlobal::segmentSize);
jack_midi_clear_buffer(port_buf);
}
while(!eventFifo.isEmpty())
{
- ///MidiPlayEvent e(eventFifo.get());
- MidiPlayEvent e(eventFifo.peek()); // p4.0.15
-
- ///int evTime = e.time();
- // Is event marked to be played immediately? p4.0.15 Moved into processEvent().
- ///if(evTime == 0)
- ///{
- // Nothing to do but stamp the event to be queued for frame 0+.
- //e.setTime(frameOffset + pos);
- /// e.setTime(audio->getFrameOffset() + audio->pos().frame());
- ///}
-
- //#ifdef JACK_MIDI_DEBUG
- //printf("MidiJackDevice::processMidi eventFifo time:%d type:%d ch:%d A:%d B:%d\n", e.time(), e.type(), e.channel(), e.dataA(), e.dataB());
- //#endif
-
- //el->insert(eventFifo.get());
- //el->insert(e);
- ///processEvent(e);
- // p4.0.15 Try to process only until full, keep rest for next cycle. If no out client port or no write enable, eat up events.
+ MidiPlayEvent e(eventFifo.peek());
+ // Try to process only until full, keep rest for next cycle. If no out client port or no write enable, eat up events. p4.0.15
if(port_buf && !processEvent(e))
return; // Give up. The Jack buffer is full. Nothing left to do.
eventFifo.remove(); // Successfully processed event. Remove it from FIFO.
}
- MPEventList* el = playEvents();
- if(el->empty())
+ if(_playEvents.empty())
{
//printf("MidiJackDevice::processMidi play events empty\n");
return;
}
- //printf("MidiJackDevice::processMidi play events:\n");
- ///iMPEvent i = nextPlayEvent();
- iMPEvent i = el->begin(); // p4.0.15
- for(; i != el->end(); ++i)
+ iMPEvent i = _playEvents.begin();
+ for(; i != _playEvents.end(); ++i)
{
//printf("MidiJackDevice::processMidi playEvent time:%d type:%d ch:%d A:%d B:%d\n", i->time(), i->type(), i->channel(), i->dataA(), i->dataB());
- // p3.3.39 Update hardware state so knobs and boxes are updated. Optimize to avoid re-setting existing values.
+ // Update hardware state so knobs and boxes are updated. Optimize to avoid re-setting existing values.
// Same code as in MidiPort::sendEvent()
if(_port != -1)
{
@@ -1657,12 +1030,10 @@ void MidiJackDevice::processMidi()
if(i->type() == ME_PITCHBEND)
{
//printf("MidiJackDevice::processMidi playEvents ME_PITCHBEND time:%d type:%d ch:%d A:%d B:%d\n", (*i).time(), (*i).type(), (*i).channel(), (*i).dataA(), (*i).dataB());
-
int da = mp->limitValToInstrCtlRange(CTRL_PITCH, i->dataA());
if(!mp->setHwCtrlState(i->channel(), CTRL_PITCH, da))
continue;
//mp->setHwCtrlState(i->channel(), CTRL_PITCH, da);
-
//(MidiPlayEvent(t, port, chn, ME_PITCHBEND, v & 0x7f, (v >> 7) & 0x7f));
}
else
@@ -1674,25 +1045,11 @@ void MidiJackDevice::processMidi()
}
}
- ///processEvent(*i);
- // p4.0.15 Try to process only until full, keep rest for next cycle. If no out client port or no write enable, eat up events.
- if(port_buf && !processEvent(*i))
- {
- //setNextPlayEvent(i);
- //return;
+ // Try to process only until full, keep rest for next cycle. If no out client port or no write enable, eat up events. p4.0.15
+ if(port_buf && !processEvent(*i))
break;
- }
}
-
- ///setNextPlayEvent(i);
- // p4.0.15 We are done with these events. Let us erase them here instead of Audio::processMidi.
- // That way we can simply set the next play event to the beginning.
- // This also allows other events to be inserted without the problems caused by the next play event
- // being at the 'end' iterator and not being *easily* set to some new place beginning of the newer insertions.
- // The way that MPEventList sorts made it difficult to predict where the iterator of the first newly inserted items was.
- // The erasure in Audio::processMidi was missing some events because of that.
- el->erase(el->begin(), i);
- // setNextPlayEvent(el->begin()); // Removed p4.0.15 Tim.
+ _playEvents.erase(_playEvents.begin(), i);
}
@@ -1703,139 +1060,6 @@ void MidiJackDevice::processMidi()
bool initMidiJack()
{
- /*
- int adr = 0;
-
- memset(jack_midi_out_data, 0, JACK_MIDI_CHANNELS * sizeof(muse_jack_midi_buffer));
- memset(jack_midi_in_data, 0, JACK_MIDI_CHANNELS * sizeof(muse_jack_midi_buffer));
-
- MidiJackDevice* dev = new MidiJackDevice(adr, QString("jack-midi"));
- dev->setrwFlags(3); // set read and write flags
-
- if(pipe(jackmidi_pi) < 0){
- fprintf(stderr, "cant create midi-jack input pipe\n");
- }
- if(pipe(jackmidi_po) < 0){
- fprintf(stderr, "cant create midi-jack output pipe\n");
- }
-
- midiDevices.add(dev);
-
- gmdev = dev; // proclaim the global jack-midi instance
-
- //jackScanMidiPorts();
- */
-
return false;
}
-/*
-struct JackPort {
- int adr;
- //char* name;
- QString name;
- int flags;
- //JackPort(int a, const char* s, int f) {
- JackPort(int a, const QString& s, int f) {
- adr = a;
- //name = strdup(s);
- name = QString(s);
- flags = f;
- }
- };
-
-
-static std::list<JackPort> portList;
-
-//---------------------------------------------------------
-// jackScanMidiPorts
-//---------------------------------------------------------
-
-void jackScanMidiPorts()
-{
- int adr;
- const char* name;
-
- portList.clear();
- adr = 0;
- name = strdup("namex");
- portList.push_back(JackPort(adr, name, 0));
- //
- // check for devices to add
- //
- for (std::list<JackPort>::iterator k = portList.begin(); k != portList.end(); ++k) {
- iMidiDevice i = midiDevices.begin();
- for (;i != midiDevices.end(); ++i) {
- //MidiJackDevice* d = dynamic_cast<MidiJackDevice*>(*i);
- break;
- //if (d == 0) continue;
- //if ((k->adr.client == d->adr.client) && (k->adr.port == d->adr.port)) {
- // break;
- //}
- }
- if (i == midiDevices.end()) {
- // add device
- MidiJackDevice* dev = new MidiJackDevice(k->adr, QString(k->name));
- dev->setrwFlags(k->flags);
- midiDevices.add(dev);
- }
- }
-}
-*/
-
-/*
-//---------------------------------------------------------
-// processInput
-//---------------------------------------------------------
-static void handle_jack_midi_in(int channel)
-{
- MidiRecordEvent event;
- int t,n,v;
- t = jack_midi_in_data[channel].buffer[0];
- n = jack_midi_in_data[channel].buffer[1];
- v = jack_midi_in_data[channel].buffer[2];
-
- event.setType(0); // mark as unused
- event.setPort(gmdev->midiPort());
- event.setB(0);
-
- if(t == 0x90){ // note on
- fprintf(stderr, "jackProcessMidiInput note-on\n");
- event.setChannel(channel);
- event.setType(ME_NOTEON);
- event.setA(n);
- event.setB(v);
- }else if (t == 0x80){ // note off
- fprintf(stderr, "jackProcessMidiInput note-off\n");
- event.setChannel(channel);
- event.setType(ME_NOTEOFF);
- event.setA(n);
- event.setB(v);
- }else{
- fprintf(stderr, "WARNING: unknown midi-in on channel %d: %x,%x,%x\n",
- channel, t, n, v);
- return;
- }
- if(event.type()){
- gmdev->recordEvent(event);
- midiPorts[gmdev->midiPort()].syncInfo().trigActDetect(event.channel());
- }
-}
-
-void MidiJackDevice::processInput()
-{
- char buf;
- int i,s;
- read(gmdev->selectRfd(), &buf, 1);
-
- s = 1;
- for(i = 0; i < JACK_MIDI_CHANNELS; i++){
- if(jack_midi_in_data[i].buffer[3]){
- s = 0;
- handle_jack_midi_in(i);
- jack_midi_in_data[i].buffer[3] = 0;
- }
- }
-}
-
-*/
diff --git a/muse2/muse/driver/jackmidi.h b/muse2/muse/driver/jackmidi.h
index 2dcf2fbb..e79e9288 100644
--- a/muse2/muse/driver/jackmidi.h
+++ b/muse2/muse/driver/jackmidi.h
@@ -3,6 +3,22 @@
// Linux Music Editor
// $Id: jackmidi.h,v 1.1.1.1 2010/01/27 09:06:43 terminator356 Exp $
// (C) Copyright 1999-2010 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __JACKMIDI_H__
@@ -25,81 +41,17 @@ class MidiPlayEvent;
//class RouteList;
class Xml;
-// Turn on to show multiple devices, work in progress,
-// not working fully yet, can't seem to connect...
-//#define JACK_MIDI_SHOW_MULTIPLE_DEVICES
-
// It appears one client port per remote port will be necessary.
// Jack doesn't seem to like manipulation of non-local ports buffers.
//#define JACK_MIDI_USE_MULTIPLE_CLIENT_PORTS
-/* jack-midi channels */
-//#define JACK_MIDI_CHANNELS 32
-
-/* jack-midi buffer size */
-//#define JACK_MIDI_BUFFER_SIZE 32
-
-/*
-typedef struct {
- int give;
- int take;
- // 32 parallel midi events, where each event contains three
- // midi-bytes and one busy-byte
- char buffer[4 * JACK_MIDI_BUFFER_SIZE];
-} muse_jack_midi_buffer;
-*/
-
-/*
-struct JackMidiPort
-{
- jack_port_t* _jackPort;
- QString _name;
- int _flags; // 1 = writable, 2 = readable - do not mix
- JackMidiPort(jack_port_t* jp, const QString& s, int f)
- {
- _jackPort = jp;
- _name = QString(s);
- _flags = f;
- }
-};
-
-typedef std::map<jack_port_t*, JackMidiPort, std::less<jack_port_t*> >::iterator iJackMidiPort;
-typedef std::map<jack_port_t*, JackMidiPort, std::less<jack_port_t*> >::const_iterator ciJackMidiPort;
-
-class JackMidiPortList : public std::map<jack_port_t*, JackMidiPort, std::less<jack_port_t*> >
-{
- private:
- static int _nextOutIdNum;
- static int _nextInIdNum;
-
- public:
- JackMidiPortList();
- ~JackMidiPortList();
- iJackMidiPort createClientPort(int flags);
- bool removeClientPort(jack_port_t* port);
-};
-
-extern JackMidiPortList jackMidiClientPorts;
-*/
-
//---------------------------------------------------------
// MidiJackDevice
//---------------------------------------------------------
class MidiJackDevice : public MidiDevice {
- public:
- //int adr;
-
private:
- // fifo for midi events sent from gui
- // direct to midi port:
- //MidiFifo eventFifo; // Moved into MidiDevice p4.0.15
-
- //static int _nextOutIdNum;
- //static int _nextInIdNum;
- //jack_port_t* _client_jackport;
- // p3.3.55
jack_port_t* _in_client_jackport;
jack_port_t* _out_client_jackport;
@@ -119,49 +71,27 @@ class MidiJackDevice : public MidiDevice {
void eventReceived(jack_midi_event_t*);
public:
- //MidiJackDevice() {} // p3.3.55 Removed.
- //MidiJackDevice(const int&, const QString& name);
-
- //MidiJackDevice(jack_port_t* jack_port, const QString& name);
- //MidiJackDevice(jack_port_t* in_jack_port, jack_port_t* out_jack_port, const QString& name); // p3.3.55 In or out port can be null.
MidiJackDevice(const QString& name);
- //static MidiDevice* createJackMidiDevice(QString /*name*/, int /*rwflags*/); // 1:Writable 2: Readable. Do not mix.
- static MidiDevice* createJackMidiDevice(QString name = "", int rwflags = 3); // p3.3.55 1:Writable 2: Readable 3: Writable + Readable
-
+ static MidiDevice* createJackMidiDevice(QString name = "", int rwflags = 3); // 1:Writable 2: Readable 3: Writable + Readable
virtual inline int deviceType() const { return JACK_MIDI; }
-
virtual void setName(const QString&);
virtual void processMidi();
virtual ~MidiJackDevice();
- //virtual int selectRfd();
- //virtual int selectWfd();
- //virtual void processInput();
virtual void recordEvent(MidiRecordEvent&);
virtual bool putEvent(const MidiPlayEvent&);
virtual void collectMidiEvents();
- //virtual jack_port_t* jackPort() { return _jackport; }
- //virtual jack_port_t* clientJackPort() { return _client_jackport; }
-
- //virtual void* clientPort() { return (void*)_client_jackport; }
- // p3.3.55
virtual void* inClientPort() { return (void*) _in_client_jackport; }
virtual void* outClientPort() { return (void*) _out_client_jackport; }
- //RouteList* routes() { return &_routes; }
- //bool noRoute() const { return _routes.empty(); }
virtual void writeRouting(int, Xml&) const;
};
extern bool initMidiJack();
-//extern int jackSelectRfd();
-//extern int jackSelectWfd();
-//extern void jackProcessMidiInput();
-//extern void jackScanMidiPorts();
#endif
diff --git a/muse2/muse/driver/rtctimer.cpp b/muse2/muse/driver/rtctimer.cpp
index 1a3cefa6..8410bb04 100644
--- a/muse2/muse/driver/rtctimer.cpp
+++ b/muse2/muse/driver/rtctimer.cpp
@@ -5,8 +5,23 @@
//
// Most code moved from midiseq.cpp by Werner Schweer.
//
- // (C) Copyright 2004 Robert Jonsson (rj@spamatica.se)
// (C) Copyright -2004 Werner Schweer (werner@seh.de)
+ // (C) Copyright 2004 Robert Jonsson (rj@spamatica.se)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <linux/version.h>
@@ -46,16 +61,16 @@ signed int RtcTimer::initTimer()
fprintf(stderr,"RtcTimer::initTimer(): called on initialised timer!\n");
return -1;
}
- doSetuid();
+ MusEGlobal::doSetuid();
timerFd = ::open("/dev/rtc", O_RDONLY);
if (timerFd == -1) {
fprintf(stderr, "fatal error: open /dev/rtc failed: %s\n", strerror(errno));
fprintf(stderr, "hint: check if 'rtc' kernel module is loaded, or used by something else\n");
- undoSetuid();
+ MusEGlobal::undoSetuid();
return timerFd;
}
- if (!setTimerFreq(config.rtcTicks)) {
+ if (!setTimerFreq(MusEConfig::config.rtcTicks)) {
// unable to set timer frequency
return -1;
}
@@ -118,7 +133,7 @@ bool RtcTimer::startTimer()
}
if (ioctl(timerFd, RTC_PIE_ON, 0) == -1) {
perror("MidiThread: start: RTC_PIE_ON failed");
- undoSetuid();
+ MusEGlobal::undoSetuid();
return false;
}
return true;
diff --git a/muse2/muse/driver/rtctimer.h b/muse2/muse/driver/rtctimer.h
index fa58b032..5befdf22 100644
--- a/muse2/muse/driver/rtctimer.h
+++ b/muse2/muse/driver/rtctimer.h
@@ -5,8 +5,23 @@
//
// Most code moved from midiseq.cpp
//
- // (C) Copyright 2004 Robert Jonsson (rj@spamatica.se)
// (C) Copyright -2004 Werner Schweer (werner@seh.de)
+ // (C) Copyright 2004 Robert Jonsson (rj@spamatica.se)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __RTCTIMER_H__
diff --git a/muse2/muse/driver/timerdev.h b/muse2/muse/driver/timerdev.h
index 944bc213..960cf2f4 100644
--- a/muse2/muse/driver/timerdev.h
+++ b/muse2/muse/driver/timerdev.h
@@ -7,6 +7,21 @@
// alsalib 1.0.7
//
// (C) Copyright 2004 Robert Jonsson (rj@spamatica.se)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TIMERDEV_H__
diff --git a/muse2/muse/dssihost.cpp b/muse2/muse/dssihost.cpp
index 72456dd1..1f7009a4 100644
--- a/muse2/muse/dssihost.cpp
+++ b/muse2/muse/dssihost.cpp
@@ -3,10 +3,12 @@
// Linux Music Editor
// $Id: dssihost.cpp,v 1.15.2.16 2009/12/15 03:39:58 terminator356 Exp $
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "config.h"
@@ -145,13 +147,13 @@ int DssiSynthIF::oscUpdate(lo_arg **argv)
#ifdef DSSI_DEBUG
- printf("DssiSynthIF::oscUpdate synth name:%s url:%s uiTarget:%p uiOscPath:%s uiOscConfigurePath:%s museProject:%s\n", synti->name().ascii(), url, uiTarget, uiOscPath, uiOscConfigurePath, museProject.ascii());
+ printf("DssiSynthIF::oscUpdate synth name:%s url:%s uiTarget:%p uiOscPath:%s uiOscConfigurePath:%s MusEGlobal::museProject:%s\n", synti->name().ascii(), url, uiTarget, uiOscPath, uiOscConfigurePath, MusEGlobal::museProject.ascii());
#endif
//lo_send(uiTarget, uiOscConfigurePath, "ss",
//DSSI_PROJECT_DIRECTORY_KEY, song->projectPath().toAscii().data());
lo_send(uiTarget, uiOscConfigurePath, "ss",
- DSSI_PROJECT_DIRECTORY_KEY, museProject.ascii());
+ DSSI_PROJECT_DIRECTORY_KEY, MusEGlobal::museProject.ascii());
#if 0
// Send current bank/program (-FIX- another race...)
@@ -380,7 +382,7 @@ static void scanDSSILib(QFileInfo& fi) // ddskrjo removed const for argument
DssiSynth* s = new DssiSynth(fi, descr);
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
{
fprintf(stderr, "scanDSSILib: name:%s listname:%s lib:%s listlib:%s\n",
label.toLatin1().constData(), s->name().toLatin1().constData(), fi.completeBaseName().toLatin1().constData(), s->baseName().toLatin1().constData());
@@ -423,7 +425,7 @@ static void scanDSSILib(QFileInfo& fi) // ddskrjo removed const for argument
static void scanDSSIDir(QString& s) // ddskrjo removed const for argument
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
//printf("scan DSSI plugin dir <%s>\n", s.toAscii().data());
printf("scanDSSIDir: scan DSSI plugin dir <%s>\n", s.toLatin1().constData());
@@ -444,7 +446,7 @@ static void scanDSSIDir(QString& s) // ddskrjo removed const for argument
QStringList list = pluginDir.entryList();
for(int i = 0; i < list.count(); ++i)
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("scanDSSIDir: found %s\n", (s + QString("/") + list[i]).toLatin1().constData());
QFileInfo fi(s + QString("/") + list[i]);
@@ -555,7 +557,7 @@ DssiSynth::DssiSynth(QFileInfo& fi, const DSSI_Descriptor* d) : // ddskrjo remov
// Hack: Special flag required for example for control processing.
_isDssiVst = fi.completeBaseName() == QString("dssi-vst");
// Hack: Blacklist vst plugins in-place, configurable for now.
- if ((_inports != _outports) || (_isDssiVst && !config.vstInPlace))
+ if ((_inports != _outports) || (_isDssiVst && !MusEConfig::config.vstInPlace))
_inPlaceCapable = false;
}
@@ -684,7 +686,7 @@ SynthIF* DssiSynth::createSIF(SynthI* synti)
// Hack: Special flag required for example for control processing.
_isDssiVst = info.completeBaseName() == QString("dssi-vst");
// Hack: Blacklist vst plugins in-place, configurable for now.
- if((_inports != _outports) || (_isDssiVst && !config.vstInPlace))
+ if((_inports != _outports) || (_isDssiVst && !MusEConfig::config.vstInPlace))
_inPlaceCapable = false;
}
}
@@ -847,7 +849,7 @@ bool DssiSynthIF::init(DssiSynth* s)
synth = s;
const DSSI_Descriptor* dssi = synth->dssi;
const LADSPA_Descriptor* ld = dssi->LADSPA_Plugin;
- handle = ld->instantiate(ld, sampleRate);
+ handle = ld->instantiate(ld, MusEGlobal::sampleRate);
#ifdef OSC_SUPPORT
_oscif.oscSetSynthIF(this);
@@ -861,10 +863,10 @@ bool DssiSynthIF::init(DssiSynth* s)
audioInBuffers = new float*[inports];
for(int k = 0; k < inports; ++k)
{
- //audioInBuffers[k] = new LADSPA_Data[segmentSize];
- //posix_memalign((void**)(audioInBuffers + k), 16, sizeof(float) * segmentSize);
- posix_memalign((void**)&audioInBuffers[k], 16, sizeof(float) * segmentSize);
- memset(audioInBuffers[k], 0, sizeof(float) * segmentSize);
+ //audioInBuffers[k] = new LADSPA_Data[MusEGlobal::segmentSize];
+ //posix_memalign((void**)(audioInBuffers + k), 16, sizeof(float) * MusEGlobal::segmentSize);
+ posix_memalign((void**)&audioInBuffers[k], 16, sizeof(float) * MusEGlobal::segmentSize);
+ memset(audioInBuffers[k], 0, sizeof(float) * MusEGlobal::segmentSize);
ld->connect_port(handle, synth->iIdx[k], audioInBuffers[k]);
}
}
@@ -875,10 +877,10 @@ bool DssiSynthIF::init(DssiSynth* s)
audioOutBuffers = new float*[outports];
for(int k = 0; k < outports; ++k)
{
- //audioOutBuffers[k] = new LADSPA_Data[segmentSize];
- //posix_memalign((void**)(audioOutBuffers + k), 16, sizeof(float) * segmentSize);
- posix_memalign((void**)&audioOutBuffers[k], 16, sizeof(float) * segmentSize);
- memset(audioOutBuffers[k], 0, sizeof(float) * segmentSize);
+ //audioOutBuffers[k] = new LADSPA_Data[MusEGlobal::segmentSize];
+ //posix_memalign((void**)(audioOutBuffers + k), 16, sizeof(float) * MusEGlobal::segmentSize);
+ posix_memalign((void**)&audioOutBuffers[k], 16, sizeof(float) * MusEGlobal::segmentSize);
+ memset(audioOutBuffers[k], 0, sizeof(float) * MusEGlobal::segmentSize);
ld->connect_port(handle, synth->oIdx[k], audioOutBuffers[k]);
//printf("DssiSynthIF::init output port name: %s\n", ld->PortNames[synth->oIdx[k]]); // out1, out2, out3 etc
}
@@ -1155,7 +1157,7 @@ bool DssiSynthIF::init(DssiSynth* s)
if(dssi->configure)
{
char *rv = dssi->configure(handle, DSSI_PROJECT_DIRECTORY_KEY,
- museProject.toLatin1().constData()); //song->projectPath()
+ MusEGlobal::museProject.toLatin1().constData()); //song->projectPath()
if(rv)
{
@@ -2033,7 +2035,7 @@ bool DssiSynthIF::processEvent(const MidiPlayEvent& e, snd_seq_event_t* event)
}
break;
default:
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
fprintf(stderr, "DssiSynthIF::processEvent midi event unknown type:%d\n", e.type());
// Event not filled.
return false;
@@ -2125,11 +2127,11 @@ iMPEvent DssiSynthIF::getData(MidiPort* /*mp*/, MPEventList* el, iMPEvent i, uns
int ft = i->time() - frameOffset - pos;
if(ft < 0)
ft = 0;
- if (ft >= (int)segmentSize)
+ if (ft >= (int)MusEGlobal::segmentSize)
{
- printf("DssiSynthIF::getData: eventlist event time:%d out of range. pos:%d offset:%d ft:%d (seg=%d)\n", i->time(), pos, frameOffset, ft, segmentSize);
- ///if (ft > (int)segmentSize)
- ft = segmentSize - 1;
+ printf("DssiSynthIF::getData: eventlist event time:%d out of range. pos:%d offset:%d ft:%d (seg=%d)\n", i->time(), pos, frameOffset, ft, MusEGlobal::segmentSize);
+ ///if (ft > (int)MusEGlobal::segmentSize)
+ ft = MusEGlobal::segmentSize - 1;
}
// "Each event is timestamped relative to the start of the block, (mis)using the ALSA "tick time" field as a frame count.
// The host is responsible for ensuring that events with differing timestamps are already ordered by time." - From dssi.h
@@ -2158,11 +2160,11 @@ iMPEvent DssiSynthIF::getData(MidiPort* /*mp*/, MPEventList* el, iMPEvent i, uns
int ft = e.time() - frameOffset - pos;
if(ft < 0)
ft = 0;
- if (ft >= (int)segmentSize)
+ if (ft >= (int)MusEGlobal::segmentSize)
{
- printf("DssiSynthIF::getData: eventFifo event time:%d out of range. pos:%d offset:%d ft:%d (seg=%d)\n", e.time(), pos, frameOffset, ft, segmentSize);
- ///if (ft > (int)segmentSize)
- ft = segmentSize - 1;
+ printf("DssiSynthIF::getData: eventFifo event time:%d out of range. pos:%d offset:%d ft:%d (seg=%d)\n", e.time(), pos, frameOffset, ft, MusEGlobal::segmentSize);
+ ///if (ft > (int)MusEGlobal::segmentSize)
+ ft = MusEGlobal::segmentSize - 1;
}
// "Each event is timestamped relative to the start of the block, (mis)using the ALSA "tick time" field as a frame count.
// The host is responsible for ensuring that events with differing timestamps are already ordered by time." - From dssi.h
@@ -2198,7 +2200,7 @@ iMPEvent DssiSynthIF::getData(MidiPort* /*mp*/, MPEventList* el, iMPEvent i, uns
controls[k].val = v.value;
// TODO: (From plugin module, adapt for synth if/when our own plugin gui is added to synths).
- // Need to update the automation value, otherwise the block above overwrites with the last automation value.
+ // Need to update the MusEGlobal::automation value, otherwise the block above overwrites with the last MusEGlobal::automation value.
///if(_track)
///{
// Since we are now in the audio thread context, there's no need to send a message,
@@ -2251,7 +2253,7 @@ iMPEvent DssiSynthIF::getData(MidiPort* /*mp*/, MPEventList* el, iMPEvent i, uns
iRoute i = irl->begin();
if(!i->track->isMidiTrack())
{
- //if(debugMsg)
+ //if(MusEGlobal::debugMsg)
printf("DssiSynthIF::getData: Error: First route is a midi track route!\n");
}
else
@@ -2281,7 +2283,7 @@ iMPEvent DssiSynthIF::getData(MidiPort* /*mp*/, MPEventList* el, iMPEvent i, uns
{
if(i->track->isMidiTrack())
{
- //if(debugMsg)
+ //if(MusEGlobal::debugMsg)
printf("DssiSynthIF::getData: Error: Route is a midi track route!\n");
continue;
}
@@ -2404,13 +2406,13 @@ iMPEvent DssiSynthIF::getData(MidiPort* /*mp*/, MPEventList* el, iMPEvent i, uns
if(fixedsize > n)
fixedsize = n;
- unsigned long min_per = config.minControlProcessPeriod;
+ unsigned long min_per = MusEConfig::config.minControlProcessPeriod;
if(min_per > n)
min_per = n;
- // Process automation control values now.
+ // Process MusEGlobal::automation control values now.
// TODO: This needs to be respect frame resolution. Put this inside the sample loop below.
- if(automation && synti && synti->automationType() != AUTO_OFF && id() != -1)
+ if(MusEGlobal::automation && synti && synti->automationType() != AUTO_OFF && id() != -1)
{
for(unsigned long k = 0; k < synth->_controlInPorts; ++k)
{
@@ -2481,8 +2483,8 @@ iMPEvent DssiSynthIF::getData(MidiPort* /*mp*/, MPEventList* el, iMPEvent i, uns
controls[v.idx].val = v.value;
}
- // Process automation control values now.
- //if(automation && synti && synti->automationType() != AUTO_OFF && id() != -1)
+ // Process MusEGlobal::automation control values now.
+ //if(MusEGlobal::automation && synti && synti->automationType() != AUTO_OFF && id() != -1)
//{
// for(unsigned long k = 0; k < synth->_controlInPorts; ++k)
// {
@@ -2556,13 +2558,13 @@ iMPEvent DssiSynthIF::getData(MidiPort* /*mp*/, MPEventList* el, iMPEvent i, uns
int ft = i->time() - frameOffset - pos;
if(ft < 0)
ft = 0;
- //if (ft >= (int)segmentSize)
+ //if (ft >= (int)MusEGlobal::segmentSize)
if (ft >= int(sample + nsamp))
{
- //printf("DssiSynthIF::getData: eventlist event time:%d out of range. pos:%d offset:%d ft:%d (seg=%d)\n", i->time(), pos, frameOffset, ft, segmentSize);
+ //printf("DssiSynthIF::getData: eventlist event time:%d out of range. pos:%d offset:%d ft:%d (seg=%d)\n", i->time(), pos, frameOffset, ft, MusEGlobal::segmentSize);
printf("DssiSynthIF::getData: eventlist event time:%d out of range. pos:%d offset:%d ft:%d sample:%lu nsamp:%lu\n", i->time(), pos, frameOffset, ft, sample, nsamp);
- ///if (ft > (int)segmentSize)
- //ft = segmentSize - 1;
+ ///if (ft > (int)MusEGlobal::segmentSize)
+ //ft = MusEGlobal::segmentSize - 1;
ft = sample + nsamp - 1;
}
// "Each event is timestamped relative to the start of the block, (mis)using the ALSA "tick time" field as a frame count.
@@ -2595,13 +2597,13 @@ iMPEvent DssiSynthIF::getData(MidiPort* /*mp*/, MPEventList* el, iMPEvent i, uns
int ft = e.time() - frameOffset - pos;
if(ft < 0)
ft = 0;
- //if (ft >= (int)segmentSize)
+ //if (ft >= (int)MusEGlobal::segmentSize)
if (ft >= int(sample + nsamp))
{
- //printf("DssiSynthIF::getData: eventFifo event time:%d out of range. pos:%d offset:%d ft:%d (seg=%d)\n", e.time(), pos, frameOffset, ft, segmentSize);
+ //printf("DssiSynthIF::getData: eventFifo event time:%d out of range. pos:%d offset:%d ft:%d (seg=%d)\n", e.time(), pos, frameOffset, ft, MusEGlobal::segmentSize);
printf("DssiSynthIF::getData: eventFifo event time:%d out of range. pos:%d offset:%d ft:%d sample:%lu nsamp:%lu\n", e.time(), pos, frameOffset, ft, sample, nsamp);
- ///if (ft > (int)segmentSize)
- //ft = segmentSize - 1;
+ ///if (ft > (int)MusEGlobal::segmentSize)
+ //ft = MusEGlobal::segmentSize - 1;
ft = sample + nsamp - 1;
}
// "Each event is timestamped relative to the start of the block, (mis)using the ALSA "tick time" field as a frame count.
@@ -2623,7 +2625,7 @@ iMPEvent DssiSynthIF::getData(MidiPort* /*mp*/, MPEventList* el, iMPEvent i, uns
iRoute i = irl->begin();
if(!i->track->isMidiTrack())
{
- //if(debugMsg)
+ //if(MusEGlobal::debugMsg)
printf("DssiSynthIF::getData: Error: First route is a midi track route!\n");
}
else
@@ -2653,7 +2655,7 @@ iMPEvent DssiSynthIF::getData(MidiPort* /*mp*/, MPEventList* el, iMPEvent i, uns
{
if(i->track->isMidiTrack())
{
- //if(debugMsg)
+ //if(MusEGlobal::debugMsg)
printf("DssiSynthIF::getData: Error: Route is a midi track route!\n");
continue;
}
@@ -2714,7 +2716,7 @@ bool DssiSynthIF::putEvent(const MidiPlayEvent& ev)
fprintf(stderr, "DssiSynthIF::putEvent midi event time:%d chn:%d a:%d b:%d\n", ev.time(), ev.channel(), ev.dataA(), ev.dataB());
#endif
- if (midiOutputTrace)
+ if (MusEGlobal::midiOutputTrace)
ev.dump();
return synti->eventFifo.put(ev);
@@ -2951,7 +2953,7 @@ void DssiSynthIF::guiHeartBeat()
int DssiSynthIF::oscUpdate()
{
// Send project directory.
- _oscif.oscSendConfigure(DSSI_PROJECT_DIRECTORY_KEY, museProject.toLatin1().constData()); // song->projectPath()
+ _oscif.oscSendConfigure(DSSI_PROJECT_DIRECTORY_KEY, MusEGlobal::museProject.toLatin1().constData()); // song->projectPath()
// Send current string configuration parameters.
//StringParamMap& map = synti->_stringParamMap;
@@ -3417,7 +3419,7 @@ const char* DssiSynthIF::getPatchName(int /*chan*/, int prog, MType /*type*/, bo
//---------------------------------------------------------
//void DssiSynthIF::populatePatchPopup(QMenu* menu, int)
-void DssiSynthIF::populatePatchPopup(PopupMenu* menu, int /*ch*/, MType /*type*/, bool /*drum*/)
+void DssiSynthIF::populatePatchPopup(MusEWidget::PopupMenu* menu, int /*ch*/, MType /*type*/, bool /*drum*/)
{
// The plugin can change the programs, patches etc.
// So make sure we're up to date by calling queryPrograms.
diff --git a/muse2/muse/dssihost.h b/muse2/muse/dssihost.h
index 12be7b50..802e0e95 100644
--- a/muse2/muse/dssihost.h
+++ b/muse2/muse/dssihost.h
@@ -3,10 +3,12 @@
// Linux Music Editor
// $Id: dssihost.h,v 1.10.2.7 2009/12/06 10:05:00 terminator356 Exp $
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __DSSIHOST_H__
@@ -209,7 +211,7 @@ class DssiSynthIF : public SynthIF, public PluginIBase
//virtual void populatePatchPopup(QMenu*, int);
//virtual void populatePatchPopup(QMenu*, int, MType, bool);
- virtual void populatePatchPopup(PopupMenu*, int, MType, bool);
+ virtual void populatePatchPopup(MusEWidget::PopupMenu*, int, MType, bool);
//virtual void write(Xml& xml) const;
virtual void write(int level, Xml& xml) const;
diff --git a/muse2/muse/evdata.h b/muse2/muse/evdata.h
index b8c2bde4..821bd9f4 100644
--- a/muse2/muse/evdata.h
+++ b/muse2/muse/evdata.h
@@ -4,6 +4,21 @@
// $Id: evdata.h,v 1.2.2.2 2008/08/18 00:15:23 terminator356 Exp $
//
// (C) Copyright 1999-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __EVDATA_H__
diff --git a/muse2/muse/event.cpp b/muse2/muse/event.cpp
index 77b66359..fa12860b 100644
--- a/muse2/muse/event.cpp
+++ b/muse2/muse/event.cpp
@@ -4,6 +4,21 @@
// $Id: event.cpp,v 1.8.2.5 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2000-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
diff --git a/muse2/muse/event.h b/muse2/muse/event.h
index b450d1fd..94c41e55 100644
--- a/muse2/muse/event.h
+++ b/muse2/muse/event.h
@@ -4,6 +4,21 @@
// $Id: event.h,v 1.7.2.4 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __EVENT_H__
diff --git a/muse2/muse/eventbase.h b/muse2/muse/eventbase.h
index 6684bf57..c41d1d0e 100644
--- a/muse2/muse/eventbase.h
+++ b/muse2/muse/eventbase.h
@@ -4,6 +4,21 @@
// $Id: eventbase.h,v 1.3.2.3 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __EVENTBASE_H__
diff --git a/muse2/muse/eventlist.cpp b/muse2/muse/eventlist.cpp
index 23fffc8c..0615d435 100644
--- a/muse2/muse/eventlist.cpp
+++ b/muse2/muse/eventlist.cpp
@@ -4,6 +4,21 @@
// $Id: eventlist.cpp,v 1.7.2.3 2009/11/05 03:14:35 terminator356 Exp $
//
// (C) Copyright 2000-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "tempo.h"
diff --git a/muse2/muse/exportmidi.cpp b/muse2/muse/exportmidi.cpp
index 8065c275..450aa992 100644
--- a/muse2/muse/exportmidi.cpp
+++ b/muse2/muse/exportmidi.cpp
@@ -4,6 +4,21 @@
// $Id: exportmidi.cpp,v 1.9.2.1 2009/04/01 01:37:10 terminator356 Exp $
//
// (C) Copyright 1999-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -113,16 +128,18 @@ static void addController(MPEventList* l, int tick, int port, int channel, int a
}
}
+namespace MusEApp {
+
//---------------------------------------------------------
// exportMidi
//---------------------------------------------------------
void MusE::exportMidi()
{
- MFile file(QString("midis"), QString(".mid"));
+ MusEWidget::MFile file(QString("midis"), QString(".mid"));
//FILE* fp = file.open("w", midi_file_pattern, this, false, true,
- FILE* fp = file.open("w", midi_file_save_pattern, this, false, true,
+ FILE* fp = file.open("w", MusEGlobal::midi_file_save_pattern, this, false, true,
tr("MusE: Export Midi"));
if (fp == 0)
return;
@@ -167,7 +184,7 @@ void MusE::exportMidi()
//---------------------------------------------------
// Write Copyright
//
- QByteArray ba = config.copyright.toLatin1();
+ QByteArray ba = MusEConfig::config.copyright.toLatin1();
const char* copyright = ba.constData();
if (copyright && *copyright) {
int len = strlen(copyright);
@@ -232,7 +249,7 @@ void MusE::exportMidi()
for (AL::ciSigEvent e = sl->begin(); e != sl->end(); ++e) {
///SigEvent* event = e->second;
AL::SigEvent* event = e->second;
- int sz = (config.exp2ByteTimeSigs ? 2 : 4); // export 2 byte timesigs instead of 4 ?
+ int sz = (MusEConfig::config.exp2ByteTimeSigs ? 2 : 4); // export 2 byte timesigs instead of 4 ?
unsigned char data[sz];
data[0] = event->sig.z;
switch(event->sig.n) {
@@ -249,7 +266,7 @@ void MusE::exportMidi()
}
// By T356. In muse the metronome pulse is fixed at 24 (once per quarter-note).
// The number of 32nd notes per 24 MIDI clock signals (per quarter-note) is 8.
- if(!config.exp2ByteTimeSigs)
+ if(!MusEConfig::config.exp2ByteTimeSigs)
{
data[2] = 24;
data[3] = 8;
@@ -344,7 +361,7 @@ void MusE::exportMidi()
len = 1;
l->add(MidiPlayEvent(tick, port, channel, ME_NOTEON, pitch, velo));
- if(config.expOptimNoteOffs) // Save space by replacing note offs with note on velocity 0
+ if(MusEConfig::config.expOptimNoteOffs) // Save space by replacing note offs with note on velocity 0
l->add(MidiPlayEvent(tick+len, port, channel, ME_NOTEON, pitch, 0));
else
l->add(MidiPlayEvent(tick+len, port, channel, ME_NOTEOFF, pitch, velo));
@@ -380,9 +397,10 @@ void MusE::exportMidi()
}
}
}
- mf.setDivision(config.midiDivision);
+ mf.setDivision(MusEConfig::config.midiDivision);
mf.setMType(song->mtype());
mf.setTrackList(mtl, ntracks);
mf.write();
}
+} // namespace MusEApp
diff --git a/muse2/muse/fastlog.h b/muse2/muse/fastlog.h
index 23710a8b..b992bd49 100644
--- a/muse2/muse/fastlog.h
+++ b/muse2/muse/fastlog.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/fastlog.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
/* Copyright unknown. Code by Laurent de Soras <laurent@ohmforce.com>.
*/
diff --git a/muse2/muse/functions.cpp b/muse2/muse/functions.cpp
index bacd6e34..2fc9f826 100644
--- a/muse2/muse/functions.cpp
+++ b/muse2/muse/functions.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: functions.cpp,v 1.20.2.19 2011/05/05 20:10 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "functions.h"
@@ -44,6 +59,7 @@
using namespace std;
+using MusEConfig::config;
set<Part*> partlist_to_set(PartList* pl)
{
@@ -151,7 +167,7 @@ bool quantize_notes(const set<Part*>& parts)
if (!quantize_dialog->exec())
return false;
- quantize_notes(parts, quantize_dialog->range, (config.division*4)/(1<<quantize_dialog->raster_power2),
+ quantize_notes(parts, quantize_dialog->range, (MusEConfig::config.division*4)/(1<<quantize_dialog->raster_power2),
quantize_dialog->quant_len, quantize_dialog->strength, quantize_dialog->swing,
quantize_dialog->threshold);
@@ -1137,8 +1153,8 @@ void shrink_parts(int raster)
Undo operations;
unsigned min_len;
- if (raster<0) raster=config.division;
- if (raster>=0) min_len=raster; else min_len=config.division;
+ if (raster<0) raster=MusEConfig::config.division;
+ if (raster>=0) min_len=raster; else min_len=MusEConfig::config.division;
TrackList* tracks = song->tracks();
for (iTrack track = tracks->begin(); track != tracks->end(); track++)
@@ -1210,8 +1226,8 @@ void expand_parts(int raster)
Undo operations;
unsigned min_len;
- if (raster<0) raster=config.division;
- if (raster>=0) min_len=raster; else min_len=config.division;
+ if (raster<0) raster=MusEConfig::config.division;
+ if (raster>=0) min_len=raster; else min_len=MusEConfig::config.division;
TrackList* tracks = song->tracks();
for (iTrack track = tracks->begin(); track != tracks->end(); track++)
diff --git a/muse2/muse/functions.h b/muse2/muse/functions.h
index cc2768cb..650b986e 100644
--- a/muse2/muse/functions.h
+++ b/muse2/muse/functions.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: functions.h,v 1.20.2.19 2011/05/05 20:10 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __FUNCTIONS_H__
diff --git a/muse2/muse/gconfig.cpp b/muse2/muse/gconfig.cpp
index 6583dae4..deed36b3 100644
--- a/muse2/muse/gconfig.cpp
+++ b/muse2/muse/gconfig.cpp
@@ -4,10 +4,27 @@
// $Id: gconfig.cpp,v 1.15.2.13 2009/12/01 03:52:40 terminator356 Exp $
//
// (C) Copyright 1999-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "gconfig.h"
+namespace MusEConfig {
+
GlobalConfigValues config = {
190, // globalAlphaBlend
{
@@ -173,3 +190,4 @@ GlobalConfigValues config = {
false // popupsDefaultStayOpen
};
+} // namespace MusEConfig
diff --git a/muse2/muse/gconfig.h b/muse2/muse/gconfig.h
index 5b8e9585..1801df5f 100644
--- a/muse2/muse/gconfig.h
+++ b/muse2/muse/gconfig.h
@@ -4,6 +4,21 @@
// $Id: gconfig.h,v 1.12.2.10 2009/12/01 03:52:40 terminator356 Exp $
//
// (C) Copyright 1999-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CONFIG_H__
@@ -19,6 +34,8 @@
class Xml;
+namespace MusEConfig {
+
//---------------------------------------------------------
// MixerConfig
//---------------------------------------------------------
@@ -149,5 +166,7 @@ struct GlobalConfigValues {
extern GlobalConfigValues config;
+} // namespace MusEConfig
+
#endif
diff --git a/muse2/muse/globaldefs.h b/muse2/muse/globaldefs.h
index 92ccf0e0..300aa07d 100644
--- a/muse2/muse/globaldefs.h
+++ b/muse2/muse/globaldefs.h
@@ -4,6 +4,21 @@
// $Id: globaldefs.h,v 1.3.2.1 2009/05/03 04:14:00 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __GLOBALDEFS_H__
diff --git a/muse2/muse/globals.cpp b/muse2/muse/globals.cpp
index 7f346f87..bbcf0434 100644
--- a/muse2/muse/globals.cpp
+++ b/muse2/muse/globals.cpp
@@ -4,6 +4,21 @@
// $Id: globals.cpp,v 1.15.2.11 2009/11/25 09:09:43 terminator356 Exp $
//
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -18,6 +33,8 @@
#include "globals.h"
#include "config.h"
+namespace MusEGlobal {
+
int recFileNumber = 1;
int sampleRate = 44100;
@@ -323,7 +340,7 @@ QAction* recordAction;
QAction* panicAction;
//AudioMixerApp* audioMixer;
-MusE* muse;
+MusEApp::MusE* muse = 0;
int preMeasures = 2;
unsigned char measureClickNote = 63;
@@ -444,3 +461,5 @@ bool getUniqueTmpfileName(QString subDir, QString ext,QString& newFilename)
printf("Could not find a suitable tmpfilename (more than 10000 tmpfiles in tmpdir - clean up!\n");
return false;
}
+
+} // namespace MusEGlobal
diff --git a/muse2/muse/globals.h b/muse2/muse/globals.h
index cee5e815..33c32c20 100644
--- a/muse2/muse/globals.h
+++ b/muse2/muse/globals.h
@@ -4,6 +4,21 @@
// $Id: globals.h,v 1.10.2.11 2009/11/25 09:09:43 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef GLOBALS_H
@@ -20,6 +35,13 @@ class QString;
class QAction;
class QActionGroup;
class QStringList;
+class QTimer;
+
+namespace MusEApp {
+class MusE;
+}
+
+namespace MusEGlobal {
extern const float denormalBias;
@@ -33,7 +55,6 @@ extern int segmentCount;
extern bool overrideAudioOutput;
extern bool overrideAudioInput;
-class QTimer;
extern QTimer* heartBeatTimer;
extern bool hIsB;
@@ -140,9 +161,8 @@ extern QAction* recordAction;
extern QAction* panicAction;
//class AudioMixerApp;
-class MusE;
//extern AudioMixerApp* audioMixer;
-extern MusE* muse;
+extern MusEApp::MusE* muse;
extern int preMeasures;
extern unsigned char measureClickNote;
@@ -181,5 +201,7 @@ extern void undoSetuid();
extern bool checkAudioDevice();
extern bool getUniqueTmpfileName(QString subDir, QString ext, QString& newFilename);
+} // namespace MusEGlobal
+
#endif
diff --git a/muse2/muse/gui.h b/muse2/muse/gui.h
index 4deeb748..43836dbb 100644
--- a/muse2/muse/gui.h
+++ b/muse2/muse/gui.h
@@ -1,12 +1,14 @@
//=============================================================================
// MusE
// Linux Music Editor
-// $Id:$
+// $Id: ./muse/gui.h $
//
-// Copyright (C) 2002-2006 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// 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; 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
@@ -15,7 +17,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=============================================================================
#ifndef __GUI_H__
diff --git a/muse2/muse/help.cpp b/muse2/muse/help.cpp
index 30803838..ae805a60 100644
--- a/muse2/muse/help.cpp
+++ b/muse2/muse/help.cpp
@@ -4,6 +4,21 @@
// $Id: help.cpp,v 1.7.2.4 2009/07/05 23:06:21 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <unistd.h>
@@ -19,6 +34,8 @@
#include "icons.h"
#include "aboutbox_impl.h"
+namespace MusEApp {
+
//---------------------------------------------------------
// startHelpBrowser
//---------------------------------------------------------
@@ -67,7 +84,7 @@ void MusE::startBugBrowser()
void MusE::about()
{
- AboutBoxImpl ab;
+ MusEWidget::AboutBoxImpl ab;
ab.show();
ab.exec();
}
@@ -92,3 +109,5 @@ void MusE::launchBrowser(QString &whereTo)
printf("Unable to launch help\n");
}
}
+
+} // namespace MusEApp
diff --git a/muse2/muse/helper.cpp b/muse2/muse/helper.cpp
index be45e048..fad9959f 100644
--- a/muse2/muse/helper.cpp
+++ b/muse2/muse/helper.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: helper.cpp,v 1.1.1.1 2003/10/27 18:51:27 wschweer Exp $
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "helper.h"
@@ -10,7 +25,10 @@
#include "track.h"
#include "song.h"
+namespace MusEGlobal {
extern bool hIsB;
+}
+
static const char* vall[] = {
"c","c#","d","d#","e","f","f#","g","g#","a","a#","h"
};
@@ -31,7 +49,7 @@ QString pitch2string(int v)
o.sprintf("%d", octave);
int i = v % 12;
QString s(octave < 0 ? valu[i] : vall[i]);
- if (hIsB) {
+ if (MusEGlobal::hIsB) {
if (s == "h")
s = "b";
else if (s == "H")
diff --git a/muse2/muse/helper.h b/muse2/muse/helper.h
index 109ecbee..fe4d018f 100644
--- a/muse2/muse/helper.h
+++ b/muse2/muse/helper.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: helper.h,v 1.1.1.1 2003/10/27 18:52:11 wschweer Exp $
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __HELPER_H__
diff --git a/muse2/muse/icons.cpp b/muse2/muse/icons.cpp
index 7745a9d0..423e65fa 100644
--- a/muse2/muse/icons.cpp
+++ b/muse2/muse/icons.cpp
@@ -4,6 +4,21 @@
// $Id: icons.cpp,v 1.13.2.8 2009/11/14 03:37:48 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "globals.h"
diff --git a/muse2/muse/icons.h b/muse2/muse/icons.h
index c93e4a58..8d55b255 100644
--- a/muse2/muse/icons.h
+++ b/muse2/muse/icons.h
@@ -4,6 +4,21 @@
// $Id: icons.h,v 1.11.2.8 2009/11/14 03:37:48 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef ICONS_H
diff --git a/muse2/muse/importmidi.cpp b/muse2/muse/importmidi.cpp
index 3e4e641e..c7c02253 100644
--- a/muse2/muse/importmidi.cpp
+++ b/muse2/muse/importmidi.cpp
@@ -4,6 +4,21 @@
// $Id: importmidi.cpp,v 1.26.2.10 2009/11/05 03:14:35 terminator356 Exp $
//
// (C) Copyright 1999-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <assert.h>
@@ -38,6 +53,9 @@
using std::set;
using std::pair;
+
+namespace MusEApp {
+
//---------------------------------------------------------
// importMidi
//---------------------------------------------------------
@@ -52,11 +70,11 @@ void MusE::importMidi(const QString &file)
{
QString fn;
if (file.isEmpty()) {
- fn = getOpenFileName(lastMidiPath, midi_file_pattern, this,
+ fn = MusEWidget::getOpenFileName(MusEGlobal::lastMidiPath, MusEGlobal::midi_file_pattern, this,
tr("MusE: Import Midi"), 0);
if (fn.isEmpty())
return;
- lastMidiPath = fn;
+ MusEGlobal::lastMidiPath = fn;
}
else
fn = file;
@@ -88,7 +106,7 @@ void MusE::importMidi(const QString &file)
bool MusE::importMidi(const QString name, bool merge)
{
bool popenFlag;
- FILE* fp = fileOpen(this, name, QString(".mid"), "r", popenFlag);
+ FILE* fp = MusEWidget::fileOpen(this, name, QString(".mid"), "r", popenFlag);
if (fp == 0)
return true;
MidiFile mf(fp);
@@ -293,7 +311,7 @@ void MusE::processTrack(MidiTrack* track)
int len = song->roundUpBar(lastTick+1);
// p3.3.27
- if(config.importMidiSplitParts)
+ if(MusEConfig::config.importMidiSplitParts)
{
int bar2, beat;
@@ -461,7 +479,7 @@ void MusE::importPart()
if (track) {
bool loadAll;
- QString filename = getOpenFileName(QString(""), part_file_pattern, this, tr("MusE: load part"), &loadAll);
+ QString filename = MusEWidget::getOpenFileName(QString(""), MusEGlobal::part_file_pattern, this, tr("MusE: load part"), &loadAll);
if (!filename.isEmpty()){
// Make a backup of the current clone list, to retain any 'copy' items,
// so that pasting works properly after.
@@ -491,7 +509,7 @@ void MusE::importPartToTrack(QString& filename, unsigned tick, Track* track)
// Changed by T356
/*
bool popenFlag = false;
- FILE* fp = fileOpen(this, filename, ".mpt", "r", popenFlag, false, false);
+ FILE* fp = MusEWidget::fileOpen(this, filename, ".mpt", "r", popenFlag, false, false);
if(fp)
{
@@ -530,7 +548,7 @@ void MusE::importPartToTrack(QString& filename, unsigned tick, Track* track)
bool popenFlag = false;
- FILE* fp = fileOpen(this, filename, ".mpt", "r", popenFlag, false, false);
+ FILE* fp = MusEWidget::fileOpen(this, filename, ".mpt", "r", popenFlag, false, false);
if(fp)
{
@@ -608,3 +626,5 @@ void MusE::importPartToTrack(QString& filename, unsigned tick, Track* track)
return;
}
}
+
+} // namespace MuseApp
diff --git a/muse2/muse/instruments/CMakeLists.txt b/muse2/muse/instruments/CMakeLists.txt
index bca57336..5a3bedad 100644
--- a/muse2/muse/instruments/CMakeLists.txt
+++ b/muse2/muse/instruments/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/instruments/editinstrument.cpp b/muse2/muse/instruments/editinstrument.cpp
index c45ac97a..49bdd6c2 100644
--- a/muse2/muse/instruments/editinstrument.cpp
+++ b/muse2/muse/instruments/editinstrument.cpp
@@ -4,6 +4,21 @@
// $Id: editinstrument.cpp,v 1.2.2.6 2009/05/31 05:12:12 terminator356 Exp $
//
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -262,7 +277,7 @@ void EditInstrument::fileSave()
// Do not allow a direct overwrite of a 'built-in' muse instrument.
QFileInfo qfi(workingInstrument.filePath());
- if(qfi.absolutePath() == museInstruments)
+ if(qfi.absolutePath() == MusEGlobal::museInstruments)
{
//fileSaveAs();
saveAs();
@@ -384,34 +399,34 @@ void EditInstrument::saveAs()
//MidiInstrument* instrument = (MidiInstrument*)item->data(Qt::UserRole).value<void*>();
// MidiInstrument* instrument = (MidiInstrument*)item->data();
- //QString path = QDir::homePath() + "/" + config.instrumentPath;
- //QString path = QDir::homeDirPath() + "/" + museGlobalShare;
- //QString path = museInstruments;
- QString path = museUserInstruments;
+ //QString path = QDir::homePath() + "/" + MusEConfig::config.instrumentPath;
+ //QString path = QDir::homeDirPath() + "/" + MusEGlobal::museGlobalShare;
+ //QString path = MusEGlobal::museInstruments;
+ QString path = MusEGlobal::museUserInstruments;
- if(!QDir(museUserInstruments).exists())
+ if(!QDir(MusEGlobal::museUserInstruments).exists())
{
if(QMessageBox::question(this,
tr("MusE:"),
- tr("The user instrument directory\n") + museUserInstruments + tr("\ndoes not exist yet. Create it now?\n") +
+ tr("The user instrument directory\n") + MusEGlobal::museUserInstruments + tr("\ndoes not exist yet. Create it now?\n") +
tr("(You can change the user instruments directory at Settings->Global Settings->Midi)"),
QMessageBox::Ok | QMessageBox::Default,
QMessageBox::Cancel | QMessageBox::Escape,
Qt::NoButton) == QMessageBox::Ok)
{
- if(QDir().mkdir(museUserInstruments))
- printf("Created user instrument directory: %s\n", museUserInstruments.toLatin1().constData());
+ if(QDir().mkdir(MusEGlobal::museUserInstruments))
+ printf("Created user instrument directory: %s\n", MusEGlobal::museUserInstruments.toLatin1().constData());
else
{
- printf("Unable to create user instrument directory: %s\n", museUserInstruments.toLatin1().constData());
- QMessageBox::critical(this, tr("MusE:"), tr("Unable to create user instrument directory\n") + museUserInstruments);
+ printf("Unable to create user instrument directory: %s\n", MusEGlobal::museUserInstruments.toLatin1().constData());
+ QMessageBox::critical(this, tr("MusE:"), tr("Unable to create user instrument directory\n") + MusEGlobal::museUserInstruments);
//return;
- path = museUser;
+ path = MusEGlobal::museUser;
}
}
else
// return;
- path = museUser;
+ path = MusEGlobal::museUser;
}
//if (instrument->filePath().isEmpty())
@@ -431,7 +446,7 @@ void EditInstrument::saveAs()
{
// Prompt only if it's a user instrument, to avoid duplicates in the user instrument dir.
// This will still allow a user instrument to override a built-in instrument with the same name.
- if(fi.absolutePath() != museInstruments)
+ if(fi.absolutePath() != MusEGlobal::museInstruments)
{
//QMessageBox::critical(this,
// tr("MusE: Bad instrument name"),
@@ -555,7 +570,7 @@ void EditInstrument::fileSaveAs()
{
// Allow override of built-in instrument names.
QFileInfo fi((*imi)->filePath());
- if(fi.absolutePath() == museInstruments)
+ if(fi.absolutePath() == MusEGlobal::museInstruments)
break;
found = true;
break;
@@ -589,7 +604,7 @@ void EditInstrument::fileSaveAs()
QFileInfo fi((*imi)->filePath());
// Allow override of built-in and user instruments:
// If it's a user instrument, not a built-in instrument...
- if(fi.absolutePath() == museUserInstruments)
+ if(fi.absolutePath() == MusEGlobal::museUserInstruments)
{
// No choice really but to overwrite the destination instrument file!
// Can not have two user files containing the same instrument name.
@@ -676,34 +691,34 @@ void EditInstrument::fileSaveAs()
break;
}
- //QString path = QDir::homePath() + "/" + config.instrumentPath;
- //QString path = QDir::homeDirPath() + "/" + museGlobalShare;
- //QString path = museInstruments;
- QString path = museUserInstruments;
+ //QString path = QDir::homePath() + "/" + MusEConfig::config.instrumentPath;
+ //QString path = QDir::homeDirPath() + "/" + MusEGlobal::museGlobalShare;
+ //QString path = MusEGlobal::museInstruments;
+ QString path = MusEGlobal::museUserInstruments;
- if(!QDir(museUserInstruments).exists())
+ if(!QDir(MusEGlobal::museUserInstruments).exists())
{
if(QMessageBox::question(this,
tr("MusE:"),
- tr("The user instrument directory\n") + museUserInstruments + tr("\ndoes not exist yet. Create it now?\n") +
+ tr("The user instrument directory\n") + MusEGlobal::museUserInstruments + tr("\ndoes not exist yet. Create it now?\n") +
tr("(You can change the user instruments directory at Settings->Global Settings->Midi)"),
QMessageBox::Ok | QMessageBox::Default,
QMessageBox::Cancel | QMessageBox::Escape,
Qt::NoButton) == QMessageBox::Ok)
{
- if(QDir().mkdir(museUserInstruments))
- printf("Created user instrument directory: %s\n", museUserInstruments.toLatin1().constData());
+ if(QDir().mkdir(MusEGlobal::museUserInstruments))
+ printf("Created user instrument directory: %s\n", MusEGlobal::museUserInstruments.toLatin1().constData());
else
{
- printf("Unable to create user instrument directory: %s\n", museUserInstruments.toLatin1().constData());
- QMessageBox::critical(this, tr("MusE:"), tr("Unable to create user instrument directory\n") + museUserInstruments);
+ printf("Unable to create user instrument directory: %s\n", MusEGlobal::museUserInstruments.toLatin1().constData());
+ QMessageBox::critical(this, tr("MusE:"), tr("Unable to create user instrument directory\n") + MusEGlobal::museUserInstruments);
//return;
- path = museUser;
+ path = MusEGlobal::museUser;
}
}
else
// return;
- path = museUser;
+ path = MusEGlobal::museUser;
}
path += QString("/%1.idf").arg(so);
@@ -1448,7 +1463,7 @@ void EditInstrument::patchButtonClicked()
PatchGroup* pgp = *i;
QMenu* pm = patchpopup->addMenu(pgp->name);
//pm->setCheckable(false);//Qt4 doc says this is unnecessary
- pm->setFont(config.fonts[0]);
+ pm->setFont(MusEConfig::config.fonts[0]);
const PatchList& pl = pgp->patches;
for (ciPatch ipl = pl.begin(); ipl != pl.end(); ++ipl) {
const Patch* mp = *ipl;
diff --git a/muse2/muse/instruments/editinstrument.h b/muse2/muse/instruments/editinstrument.h
index b3c6b5e0..645a5b98 100644
--- a/muse2/muse/instruments/editinstrument.h
+++ b/muse2/muse/instruments/editinstrument.h
@@ -4,6 +4,21 @@
// $Id: editinstrument.h,v 1.1.1.1.2.4 2009/05/31 05:12:12 terminator356 Exp $
//
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __EDITINSTRUMENT_H__
diff --git a/muse2/muse/instruments/midictrledit.cpp b/muse2/muse/instruments/midictrledit.cpp
index 9dcac628..56f4cabf 100644
--- a/muse2/muse/instruments/midictrledit.cpp
+++ b/muse2/muse/instruments/midictrledit.cpp
@@ -4,6 +4,21 @@
// $Id: midictrledit.cpp,v 1.1.1.1.2.2 2008/08/18 00:15:24 terminator356 Exp $
//
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
diff --git a/muse2/muse/instruments/midictrledit.h b/muse2/muse/instruments/midictrledit.h
index e1624f29..308302b1 100644
--- a/muse2/muse/instruments/midictrledit.h
+++ b/muse2/muse/instruments/midictrledit.h
@@ -4,6 +4,21 @@
// $Id: midictrledit.h,v 1.1.1.1.2.1 2008/08/18 00:15:25 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDICTRLEDIT_H__
diff --git a/muse2/muse/instruments/minstrument.cpp b/muse2/muse/instruments/minstrument.cpp
index 613e5bdf..20bee129 100644
--- a/muse2/muse/instruments/minstrument.cpp
+++ b/muse2/muse/instruments/minstrument.cpp
@@ -4,6 +4,21 @@
// $Id: minstrument.cpp,v 1.10.2.5 2009/03/28 01:46:10 terminator356 Exp $
//
// (C) Copyright 2000-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -27,6 +42,7 @@
#include "gconfig.h"
#include "popupmenu.h"
+
MidiInstrumentList midiInstruments;
MidiInstrument* genericMidiInstrument;
@@ -140,7 +156,7 @@ static void loadIDF(QFileInfo* fi)
printf("cannot open file %s\n", fi->fileName().toLatin1());
return;
}
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf(" load instrument definition <%s>\n", fi->filePath().local8Bit().data());
QDomDocument doc;
int line, column;
@@ -172,7 +188,7 @@ static void loadIDF(QFileInfo* fi)
if (midiInstruments[idx]->iname() == i->iname()) {
midiInstruments.replace(idx, i);
replaced = true;
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("Midi Instrument Definition <%s> overwritten\n",
i->iname().toLocal8Bit().data());
break;
@@ -193,7 +209,7 @@ static void loadIDF(QFileInfo* fi)
FILE* f = fopen(fi->filePath().toAscii().constData(), "r");
if (f == 0)
return;
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("READ IDF %s\n", fi->filePath().toLatin1().constData());
Xml xml(f);
@@ -252,9 +268,9 @@ void initMidiInstruments()
{
genericMidiInstrument = new MidiInstrument(QWidget::tr("generic midi"));
midiInstruments.push_back(genericMidiInstrument);
- if (debugMsg)
- printf("load user instrument definitions from <%s>\n", museUserInstruments.toLatin1().constData());
- QDir usrInstrumentsDir(museUserInstruments, QString("*.idf"));
+ if (MusEGlobal::debugMsg)
+ printf("load user instrument definitions from <%s>\n", MusEGlobal::museUserInstruments.toLatin1().constData());
+ QDir usrInstrumentsDir(MusEGlobal::museUserInstruments, QString("*.idf"));
if (usrInstrumentsDir.exists()) {
QFileInfoList list = usrInstrumentsDir.entryInfoList();
QFileInfoList::iterator it=list.begin(); // ddskrjo
@@ -265,15 +281,15 @@ void initMidiInstruments()
}
//else
//{
- // if(usrInstrumentsDir.mkdir(museUserInstruments))
- // printf("Created user instrument directory: %s\n", museUserInstruments.toLatin1());
+ // if(usrInstrumentsDir.mkdir(MusEGlobal::museUserInstruments))
+ // printf("Created user instrument directory: %s\n", MusEGlobal::museUserInstruments.toLatin1());
// else
- // printf("Unable to create user instrument directory: %s\n", museUserInstruments.toLatin1());
+ // printf("Unable to create user instrument directory: %s\n", MusEGlobal::museUserInstruments.toLatin1());
//}
- if (debugMsg)
- printf("load instrument definitions from <%s>\n", museInstruments.toLatin1().constData());
- QDir instrumentsDir(museInstruments, QString("*.idf"));
+ if (MusEGlobal::debugMsg)
+ printf("load instrument definitions from <%s>\n", MusEGlobal::museInstruments.toLatin1().constData());
+ QDir instrumentsDir(MusEGlobal::museInstruments, QString("*.idf"));
if (instrumentsDir.exists()) {
QFileInfoList list = instrumentsDir.entryInfoList();
QFileInfoList::iterator it=list.begin(); // ddskrjo
@@ -283,7 +299,7 @@ void initMidiInstruments()
}
}
else
- printf("Instrument directory not found: %s\n", museInstruments.toLatin1().constData());
+ printf("Instrument directory not found: %s\n", MusEGlobal::museInstruments.toLatin1().constData());
}
@@ -543,6 +559,7 @@ void MidiInstrument::reset(int portNo, MType)
// These loops send 2048 events, which is more than our FIFO (or Jack buffer) can handle! p4.0.15 Tim.
// Nope, instead, increased FIFO sizes to accommodate.
//port->device()->playEvents()->add(ev);
+ //port->device()->addScheduledEvent(ev);
}
}
}
@@ -918,7 +935,7 @@ QString MidiInstrument::getPatchName(int channel, int prog, MType mode, bool dru
// populatePatchPopup
//---------------------------------------------------------
-void MidiInstrument::populatePatchPopup(PopupMenu* menu, int chan, MType songType, bool drum)
+void MidiInstrument::populatePatchPopup(MusEWidget::PopupMenu* menu, int chan, MType songType, bool drum)
{
menu->clear();
int mask = 0;
@@ -943,9 +960,9 @@ void MidiInstrument::populatePatchPopup(PopupMenu* menu, int chan, MType songTyp
for (ciPatchGroup i = pg.begin(); i != pg.end(); ++i) {
PatchGroup* pgp = *i;
//QMenu* pm = menu->addMenu(pgp->name);
- PopupMenu* pm = new PopupMenu(pgp->name, menu, menu->stayOpen()); // Use the parent stayOpen here.
+ MusEWidget::PopupMenu* pm = new MusEWidget::PopupMenu(pgp->name, menu, menu->stayOpen()); // Use the parent stayOpen here.
menu->addMenu(pm);
- pm->setFont(config.fonts[0]);
+ pm->setFont(MusEConfig::config.fonts[0]);
const PatchList& pl = pgp->patches;
for (ciPatch ipl = pl.begin(); ipl != pl.end(); ++ipl) {
const Patch* mp = *ipl;
diff --git a/muse2/muse/instruments/minstrument.h b/muse2/muse/instruments/minstrument.h
index dacd17fc..e7800eea 100644
--- a/muse2/muse/instruments/minstrument.h
+++ b/muse2/muse/instruments/minstrument.h
@@ -4,6 +4,21 @@
// $Id: minstrument.h,v 1.3.2.3 2009/03/09 02:05:18 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MINSTRUMENT_H__
@@ -13,14 +28,17 @@
#include <list>
#include <vector>
+class QString;
+
class MidiPort;
-//class QMenu;
-class PopupMenu;
class MidiPlayEvent;
class Xml;
class EventList;
class MidiControllerList;
-class QString;
+
+namespace MusEWidget {
+class PopupMenu;
+}
//---------------------------------------------------------
// Patch
@@ -123,7 +141,7 @@ class MidiInstrument {
virtual void reset(int, MType);
virtual QString getPatchName(int,int,MType,bool);
//virtual void populatePatchPopup(QMenu*, int, MType, bool);
- virtual void populatePatchPopup(PopupMenu*, int, MType, bool);
+ virtual void populatePatchPopup(MusEWidget::PopupMenu*, int, MType, bool);
void read(Xml&);
void write(int level, Xml&);
diff --git a/muse2/muse/key.cpp b/muse2/muse/key.cpp
index 0f34f8ea..26dbfbde 100644
--- a/muse2/muse/key.cpp
+++ b/muse2/muse/key.cpp
@@ -4,6 +4,21 @@
// $Id: key.cpp,v 1.1.1.1 2003/10/27 18:51:22 wschweer Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
diff --git a/muse2/muse/key.h b/muse2/muse/key.h
index 1c1c4cac..e895adf7 100644
--- a/muse2/muse/key.h
+++ b/muse2/muse/key.h
@@ -4,6 +4,21 @@
// $Id: key.h,v 1.1.1.1 2003/10/27 18:51:25 wschweer Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __KEY_H__
diff --git a/muse2/muse/keyevent.cpp b/muse2/muse/keyevent.cpp
index 5d55fef6..63bcdbe8 100644
--- a/muse2/muse/keyevent.cpp
+++ b/muse2/muse/keyevent.cpp
@@ -4,6 +4,21 @@
// $Id: key.cpp,v 1.7.2.7 2008/05/21 00:28:52 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
diff --git a/muse2/muse/keyevent.h b/muse2/muse/keyevent.h
index 2d127a67..e3237d25 100644
--- a/muse2/muse/keyevent.h
+++ b/muse2/muse/keyevent.h
@@ -4,6 +4,21 @@
// $Id: tempo.h,v 1.2.2.1 2006/09/19 19:07:09 spamatica Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef KEYEVENT_H
#define KEYEVENT_H
diff --git a/muse2/muse/liste/CMakeLists.txt b/muse2/muse/liste/CMakeLists.txt
index d25a2077..c846d665 100644
--- a/muse2/muse/liste/CMakeLists.txt
+++ b/muse2/muse/liste/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/liste/editevent.cpp b/muse2/muse/liste/editevent.cpp
index fd74d5d3..e211e7f7 100644
--- a/muse2/muse/liste/editevent.cpp
+++ b/muse2/muse/liste/editevent.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: editevent.cpp,v 1.12.2.6 2009/02/02 21:38:00 terminator356 Exp $
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -297,7 +312,7 @@ EditMetaDialog::EditMetaDialog(int tick, const Event& ev,
epos = new Awl::PosEdit;
QLabel* l2 = new QLabel(tr("Meta Type"));
- il2 = new IntLabel(-1, 0, 127, this, -1);
+ il2 = new MusEWidget::IntLabel(-1, 0, 127, this, -1);
il2->setFixedWidth(100);
il2->setFrame(true);
il2->setDark();
@@ -313,7 +328,7 @@ EditMetaDialog::EditMetaDialog(int tick, const Event& ev,
connect(hexButton, SIGNAL(toggled(bool)), SLOT(toggled(bool)));
edit = new QTextEdit;
- edit->setFont(config.fonts[5]);
+ edit->setFont(MusEConfig::config.fonts[5]);
if (!ev.empty()) {
epos->setValue(tick);
@@ -432,7 +447,7 @@ EditCAfterDialog::EditCAfterDialog(int tick, const Event& event,
epos = new Awl::PosEdit;
QLabel* l2 = new QLabel(tr("Pressure"));
- il2 = new IntLabel(-1, 0, 127, this, -1);
+ il2 = new MusEWidget::IntLabel(-1, 0, 127, this, -1);
il2->setFrame(true);
il2->setDark();
@@ -491,9 +506,9 @@ EditPAfterDialog::EditPAfterDialog(int tick, const Event& event,
epos = new Awl::PosEdit;
QLabel* l2 = new QLabel(tr("Pitch"));
- pl = new PitchEdit;
+ pl = new MusEWidget::PitchEdit;
QLabel* l3 = new QLabel(tr("Pressure"));
- il2 = new IntLabel(-1, 0, 127, this, -1);
+ il2 = new MusEWidget::IntLabel(-1, 0, 127, this, -1);
il2->setFrame(true);
il2->setDark();
@@ -681,7 +696,7 @@ EditCtrlDialog::EditCtrlDialog(int tick, const Event& event,
void EditCtrlDialog::newController()
{
//QMenu* pup = new QMenu(this);
- PopupMenu* pup = new PopupMenu(this);
+ MusEWidget::PopupMenu* pup = new MusEWidget::PopupMenu(this);
//pup->setCheckable(this);//not necessary in Qt4
//
// populate popup with all controllers available for
@@ -856,7 +871,7 @@ void EditCtrlDialog::instrPopup()
///instr->populatePatchPopup(pop, channel, song->mtype(), track->type() == Track::DRUM);
//QMenu* pup = new QMenu(this);
- PopupMenu* pup = new PopupMenu(this);
+ MusEWidget::PopupMenu* pup = new MusEWidget::PopupMenu(this);
instr->populatePatchPopup(pup, channel, song->mtype(), track->type() == Track::DRUM);
///if(pop->actions().count() == 0)
diff --git a/muse2/muse/liste/editevent.h b/muse2/muse/liste/editevent.h
index 454e6a69..02befe7e 100644
--- a/muse2/muse/liste/editevent.h
+++ b/muse2/muse/liste/editevent.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: editevent.h,v 1.6.2.1 2008/05/21 00:28:53 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __EDIT_EVENT_H__
@@ -18,8 +33,11 @@ namespace Awl {
};
///class PosEdit;
+namespace MusEWidget {
class IntLabel;
class PitchEdit;
+}
+
class QDialog;
class QLabel;
class QGridLayout;
@@ -128,7 +146,7 @@ class EditMetaDialog : public EditEventDialog {
///PosEdit* epos;
Awl::PosEdit* epos;
QTextEdit* edit;
- IntLabel* il2;
+ MusEWidget::IntLabel* il2;
QRadioButton* hexButton;
QLabel* typeLabel;
@@ -158,7 +176,7 @@ class EditCAfterDialog : public EditEventDialog {
///PosEdit* epos;
Awl::PosEdit* epos;
- IntLabel* il2;
+ MusEWidget::IntLabel* il2;
protected:
QGridLayout* layout;
@@ -180,8 +198,8 @@ class EditPAfterDialog : public EditEventDialog {
///PosEdit* epos;
Awl::PosEdit* epos;
- PitchEdit* pl;
- IntLabel* il2;
+ MusEWidget::PitchEdit* pl;
+ MusEWidget::IntLabel* il2;
protected:
QGridLayout* layout;
diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp
index bc90433d..e76f68e5 100644
--- a/muse2/muse/liste/listedit.cpp
+++ b/muse2/muse/liste/listedit.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: listedit.cpp,v 1.11.2.11 2009/05/24 21:43:44 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QAction>
@@ -366,7 +381,7 @@ QString EventListItem::text(int col) const
break;
case 4:
if (event.isNote() || event.type() == PAfter)
- s = pitch2string(event.dataA());
+ s = pitch2string(event.dataA());
else if (event.type() == Controller)
s.setNum(event.dataA() & 0xffff); // mask off type bits
else
@@ -468,7 +483,7 @@ ListEdit::ListEdit(PartList* pl)
QSignalMapper *editSignalMapper = new QSignalMapper(this);
menuEdit = menuBar()->addMenu(tr("&Edit"));
- menuEdit->addActions(undoRedo->actions());
+ menuEdit->addActions(MusEGlobal::undoRedo->actions());
menuEdit->addSeparator();
#if 0
@@ -505,7 +520,7 @@ ListEdit::ListEdit(PartList* pl)
// Toolbars ---------------------------------------------------------
QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools"));
undo_tools->setObjectName("Undo/Redo tools");
- undo_tools->addActions(undoRedo->actions());
+ undo_tools->addActions(MusEGlobal::undoRedo->actions());
QToolBar* insertTools = addToolBar(tr("Insert tools"));
insertTools->setObjectName("list insert tools");
@@ -513,11 +528,11 @@ ListEdit::ListEdit(PartList* pl)
QToolBar* panic_toolbar = addToolBar(tr("panic"));
panic_toolbar->setObjectName("panic");
- panic_toolbar->addAction(panicAction);
+ panic_toolbar->addAction(MusEGlobal::panicAction);
QToolBar* transport_toolbar = addToolBar(tr("transport"));
transport_toolbar->setObjectName("transport");
- transport_toolbar->addActions(transportAction->actions());
+ transport_toolbar->addActions(MusEGlobal::transportAction->actions());
//
//---------------------------------------------------
@@ -601,7 +616,7 @@ ListEdit::ListEdit(PartList* pl)
ListEdit::~ListEdit()
{
- // undoRedo->removeFrom(listTools); // p4.0.6 Removed
+ // MusEGlobal::undoRedo->removeFrom(listTools); // p4.0.6 Removed
}
//---------------------------------------------------------
diff --git a/muse2/muse/liste/listedit.h b/muse2/muse/liste/listedit.h
index 1b1a8ece..ba26b6b6 100644
--- a/muse2/muse/liste/listedit.h
+++ b/muse2/muse/liste/listedit.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: listedit.h,v 1.3.2.3 2006/09/19 22:03:33 spamatica Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __LIST_EDIT_H__
diff --git a/muse2/muse/main.cpp b/muse2/muse/main.cpp
index ebdf7b5d..fe18214c 100644
--- a/muse2/muse/main.cpp
+++ b/muse2/muse/main.cpp
@@ -3,7 +3,22 @@
// Linux Music Editor
// $Id: app.cpp,v 1.113.2.68 2009/12/21 14:51:51 spamatica Exp $
//
-// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+// (C) Copyright 1999-2011 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QApplication>
@@ -45,7 +60,9 @@ static QString locale_override;
#ifdef HAVE_LASH
#include <lash/lash.h>
+namespace MusEApp {
extern lash_client_t * lash_client;
+}
extern snd_seq_t * alsaSeq;
#endif
@@ -89,7 +106,7 @@ static void printVersion(const char* prog)
//---------------------------------------------------------
class MuseApplication : public QApplication {
- MusE* muse;
+ MusEApp::MusE* muse;
public:
MuseApplication(int& argc, char** argv)
@@ -99,12 +116,12 @@ class MuseApplication : public QApplication {
}
- void setMuse(MusE* m) {
+ void setMuse(MusEApp::MusE* m) {
muse = m;
connect(this,SIGNAL(focusChanged(QWidget*,QWidget*)),muse,SLOT(focusChanged(QWidget*,QWidget*)));
#ifdef HAVE_LASH
- if(useLASH)
+ if(MusEGlobal::useLASH)
startTimer (300);
#endif
}
@@ -116,21 +133,21 @@ class MuseApplication : public QApplication {
if (event->type() == QEvent::KeyPress) {
//printf("notify key press after app::notify accepted:%d\n", event->isAccepted());
QKeyEvent* ke = (QKeyEvent*)event;
- ///globalKeyState = ke->stateAfter();
- globalKeyState = ke->modifiers();
+ ///MusEGlobal::globalKeyState = ke->stateAfter();
+ MusEGlobal::globalKeyState = ke->modifiers();
bool accepted = ke->isAccepted();
if (!accepted) {
int key = ke->key();
///if (ke->state() & Qt::ShiftModifier)
- //if (globalKeyState & Qt::ShiftModifier)
+ //if (MusEGlobal::globalKeyState & Qt::ShiftModifier)
if (((QInputEvent*)ke)->modifiers() & Qt::ShiftModifier)
key += Qt::SHIFT;
///if (ke->state() & Qt::AltModifier)
- //if (globalKeyState & Qt::AltModifier)
+ //if (MusEGlobal::globalKeyState & Qt::AltModifier)
if (((QInputEvent*)ke)->modifiers() & Qt::AltModifier)
key += Qt::ALT;
///if (ke->state() & Qt::ControlModifier)
- //if (globalKeyState & Qt::ControlModifier)
+ //if (MusEGlobal::globalKeyState & Qt::ControlModifier)
if (((QInputEvent*)ke)->modifiers() & Qt::ControlModifier)
key+= Qt::CTRL;
muse->kbAccel(key);
@@ -139,8 +156,8 @@ class MuseApplication : public QApplication {
}
if (event->type() == QEvent::KeyRelease) {
QKeyEvent* ke = (QKeyEvent*)event;
- ///globalKeyState = ke->stateAfter();
- globalKeyState = ke->modifiers();
+ ///MusEGlobal::globalKeyState = ke->stateAfter();
+ MusEGlobal::globalKeyState = ke->modifiers();
}
return flag;
@@ -148,7 +165,7 @@ class MuseApplication : public QApplication {
#ifdef HAVE_LASH
virtual void timerEvent (QTimerEvent * /* e */) {
- if(useLASH)
+ if(MusEGlobal::useLASH)
muse->lash_idle_cb ();
}
#endif /* HAVE_LASH */
@@ -163,7 +180,7 @@ static QString localeList()
{
// Find out what translations are available:
QStringList deliveredLocaleListFiltered;
- QString distLocale = museGlobalShare + "/locale";
+ QString distLocale = MusEGlobal::museGlobalShare + "/locale";
QFileInfo distLocaleFi(distLocale);
if (distLocaleFi.isDir()) {
QDir dir = QDir(distLocale);
@@ -227,26 +244,26 @@ int main(int argc, char* argv[])
{
// error = ErrorHandler::create(argv[0]);
- ruid = getuid();
- euid = geteuid();
- undoSetuid();
+ MusEGlobal::ruid = getuid();
+ MusEGlobal::euid = geteuid();
+ MusEGlobal::undoSetuid();
getCapabilities();
int noAudio = false;
-
- museUser = QString(getenv("HOME"));
- museGlobalLib = QString(LIBDIR);
- museGlobalShare = QString(SHAREDIR);
- museProject = museProjectInitPath; //getcwd(0, 0);
- museInstruments = museGlobalShare + QString("/instruments");
+
+ MusEGlobal::museUser = QString(getenv("HOME"));
+ MusEGlobal::museGlobalLib = QString(LIBDIR);
+ MusEGlobal::museGlobalShare = QString(SHAREDIR);
+ MusEGlobal::museProject = MusEGlobal::museProjectInitPath; //getcwd(0, 0);
+ MusEGlobal::museInstruments = MusEGlobal::museGlobalShare + QString("/instruments");
// Create config dir if it doesn't exists
- QDir cPath = QDir(configPath);
+ QDir cPath = QDir(MusEGlobal::configPath);
if (! cPath.exists())
cPath.mkpath(".");
#ifdef HAVE_LASH
lash_args_t * lash_args = 0;
- if(useLASH)
+ if(MusEGlobal::useLASH)
lash_args = lash_extract_args (&argc, &argv);
#endif
@@ -256,17 +273,17 @@ int main(int argc, char* argv[])
QApplication::setColorSpec(QApplication::ManyColor);
MuseApplication app(argc, argv);
- init_function_dialogs(muse);
+ init_function_dialogs(MusEGlobal::muse);
initShortCuts();
readConfiguration();
- museUserInstruments = config.userInstrumentsDir;
+ MusEGlobal::museUserInstruments = MusEConfig::config.userInstrumentsDir;
- if (config.useDenormalBias)
+ if (MusEConfig::config.useDenormalBias)
printf("Denormal protection enabled.\n");
// SHOW MUSE SPLASH SCREEN
- if (config.showSplashScreen) {
- QPixmap splsh(museGlobalShare + "/splash.png");
+ if (MusEConfig::config.showSplashScreen) {
+ QPixmap splsh(MusEGlobal::museGlobalShare + "/splash.png");
if (!splsh.isNull()) {
QSplashScreen* muse_splash = new QSplashScreen(splsh,
@@ -304,27 +321,27 @@ int main(int argc, char* argv[])
switch (c) {
case 'v': printVersion(argv[0]); return 0;
case 'd':
- debugMode = true;
- realTimeScheduling = false;
+ MusEGlobal::debugMode = true;
+ MusEGlobal::realTimeScheduling = false;
break;
case 'a':
noAudio = true;
break;
case 'D':
- if (!debugMsg)
- debugMsg=true;
+ if (!MusEGlobal::debugMsg)
+ MusEGlobal::debugMsg=true;
else
- heavyDebugMsg=true;
- case 'm': midiInputTrace = true; break;
- case 'M': midiOutputTrace = true; break;
+ MusEGlobal::heavyDebugMsg=true;
+ case 'm': MusEGlobal::midiInputTrace = true; break;
+ case 'M': MusEGlobal::midiOutputTrace = true; break;
case 's': debugSync = true; break;
- case 'P': realTimePriority = atoi(optarg); break;
- case 'Y': midiRTPrioOverride = atoi(optarg); break;
- case 'p': loadPlugins = false; break;
- case 'V': loadVST = false; break;
- case 'I': loadDSSI = false; break;
- case 'L': useLASH = false; break;
- case 'y': usePythonBridge = true; break;
+ case 'P': MusEGlobal::realTimePriority = atoi(optarg); break;
+ case 'Y': MusEGlobal::midiRTPrioOverride = atoi(optarg); break;
+ case 'p': MusEGlobal::loadPlugins = false; break;
+ case 'V': MusEGlobal::loadVST = false; break;
+ case 'I': MusEGlobal::loadDSSI = false; break;
+ case 'L': MusEGlobal::useLASH = false; break;
+ case 'y': MusEGlobal::usePythonBridge = true; break;
case 'l': locale_override = QString(optarg); break;
case 'h': usage(argv[0], argv[1]); return -1;
default: usage(argv[0], "bad argument"); return -1;
@@ -332,11 +349,11 @@ int main(int argc, char* argv[])
}
/*
- if(!config.styleSheetFile.isEmpty())
+ if(!MusEConfig::config.styleSheetFile.isEmpty())
{
- if(debugMsg)
- printf("loading style sheet <%s> \n", qPrintable(config.styleSheetFile));
- QFile cf(config.styleSheetFile);
+ if(MusEGlobal::debugMsg)
+ printf("loading style sheet <%s> \n", qPrintable(MusEConfig::config.styleSheetFile));
+ QFile cf(MusEConfig::config.styleSheetFile);
if (cf.open(QIODevice::ReadOnly)) {
QByteArray ss = cf.readAll();
QString sheet(QString::fromUtf8(ss.data()));
@@ -344,28 +361,28 @@ int main(int argc, char* argv[])
cf.close();
}
else
- printf("loading style sheet <%s> failed\n", qPrintable(config.styleSheetFile));
+ printf("loading style sheet <%s> failed\n", qPrintable(MusEConfig::config.styleSheetFile));
}
*/
AL::initDsp();
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("Start euid: %d ruid: %d, Now euid %d\n",
- euid, ruid, geteuid());
- if (debugMode) {
+ MusEGlobal::euid, MusEGlobal::ruid, geteuid());
+ if (MusEGlobal::debugMode) {
initDummyAudio();
- realTimeScheduling = false;
+ MusEGlobal::realTimeScheduling = false;
}
else if (noAudio) {
initDummyAudio();
- realTimeScheduling = true;
- //if (debugMode) { // ??
- // realTimeScheduling = false;
+ MusEGlobal::realTimeScheduling = true;
+ //if (MusEGlobal::debugMode) { // ??
+ // MusEGlobal::realTimeScheduling = false;
// }
}
else if (initJackAudio()) {
- if (!debugMode)
+ if (!MusEGlobal::debugMode)
{
QMessageBox::critical(NULL, "MusE fatal error", "MusE <b>failed</b> to find a <b>Jack audio server</b>.<br><br>"
"<i>MusE will continue without audio support (-a switch)!</i><br><br>"
@@ -375,9 +392,9 @@ int main(int argc, char* argv[])
initDummyAudio();
noAudio = true;
- realTimeScheduling = true;
- if (debugMode) {
- realTimeScheduling = false;
+ MusEGlobal::realTimeScheduling = true;
+ if (MusEGlobal::debugMode) {
+ MusEGlobal::realTimeScheduling = false;
}
}
else
@@ -386,38 +403,38 @@ int main(int argc, char* argv[])
fprintf(stderr, "no audio functions available\n");
fprintf(stderr, "*** experimental mode -- no play possible ***\n");
initDummyAudio();
- //realTimeScheduling = audioDevice->isRealtime();
+ //MusEGlobal::realTimeScheduling = audioDevice->isRealtime();
}
- realTimeScheduling = true;
+ MusEGlobal::realTimeScheduling = true;
}
else
- realTimeScheduling = audioDevice->isRealtime();
+ MusEGlobal::realTimeScheduling = audioDevice->isRealtime();
// What unreliable nonsense. With Jack2 this reports true even if it is not running realtime.
// Jack says: "Cannot use real-time scheduling (RR/10)(1: Operation not permitted)". The kernel is non-RT.
// I cannot seem to find a reliable answer to the question, even with dummy audio and system calls.
- //if (debugMsg)
- // printf("realTimeScheduling:%d\n", realTimeScheduling);
+ //if (MusEGlobal::debugMsg)
+ // printf("MusEGlobal::realTimeScheduling:%d\n", MusEGlobal::realTimeScheduling);
useJackTransport.setValue(true);
// setup the prefetch fifo length now that the segmentSize is known
// Changed by Tim. p3.3.17
// Changed to 4 *, JUST FOR TEST!!!
- fifoLength = 131072/segmentSize;
- //fifoLength = (131072/segmentSize) * 4;
+ MusEGlobal::fifoLength = 131072 / MusEGlobal::segmentSize;
+ //MusEGlobal::fifoLength = (131072 / MusEGlobal::segmentSize) * 4;
argc -= optind;
++argc;
- if (debugMsg) {
- printf("global lib: <%s>\n", museGlobalLib.toLatin1().constData());
- printf("global share: <%s>\n", museGlobalShare.toLatin1().constData());
- printf("muse home: <%s>\n", museUser.toLatin1().constData());
- printf("project dir: <%s>\n", museProject.toLatin1().constData());
- printf("user instruments: <%s>\n", museUserInstruments.toLatin1().constData());
+ if (MusEGlobal::debugMsg) {
+ printf("global lib: <%s>\n", MusEGlobal::museGlobalLib.toLatin1().constData());
+ printf("global share: <%s>\n", MusEGlobal::museGlobalShare.toLatin1().constData());
+ printf("muse home: <%s>\n", MusEGlobal::museUser.toLatin1().constData());
+ printf("project dir: <%s>\n", MusEGlobal::museProject.toLatin1().constData());
+ printf("user instruments: <%s>\n", MusEGlobal::museUserInstruments.toLatin1().constData());
}
static QTranslator translator(0);
@@ -428,7 +445,7 @@ int main(int argc, char* argv[])
QString loc("muse_");
loc += locale;
if (translator.load(loc, QString(".")) == false) {
- QString lp(museGlobalShare);
+ QString lp(MusEGlobal::museGlobalShare);
lp += QString("/locale");
if (translator.load(loc, lp) == false) {
printf("no locale <%s>/<%s>\n", loc.toLatin1().constData(), lp.toLatin1().constData());
@@ -439,16 +456,16 @@ int main(int argc, char* argv[])
if (locale == "de") {
printf("locale de\n");
- hIsB = false;
+ MusEGlobal::hIsB = false;
}
- if (loadPlugins)
+ if (MusEGlobal::loadPlugins)
initPlugins();
- if (loadVST)
+ if (MusEGlobal::loadVST)
initVST();
- if(loadDSSI)
+ if(MusEGlobal::loadDSSI)
initDSSI();
// p3.3.39
@@ -460,8 +477,8 @@ int main(int argc, char* argv[])
//QApplication::clipboard()->setSelectionMode(false); ddskrjo obsolete even in Qt3
- QApplication::addLibraryPath(museGlobalLib + "/qtplugins");
- if (debugMsg) {
+ QApplication::addLibraryPath(MusEGlobal::museGlobalLib + "/qtplugins");
+ if (MusEGlobal::debugMsg) {
QStringList list = app.libraryPaths();
QStringList::Iterator it = list.begin();
printf("QtLibraryPath:\n");
@@ -471,45 +488,45 @@ int main(int argc, char* argv[])
}
}
- muse = new MusE(argc, &argv[optind]);
- app.setMuse(muse);
- muse->setWindowIcon(*museIcon);
+ MusEGlobal::muse = new MusEApp::MusE(argc, &argv[optind]);
+ app.setMuse(MusEGlobal::muse);
+ MusEGlobal::muse->setWindowIcon(*museIcon);
// Added by Tim. p3.3.22
- if (!debugMode) {
+ if (!MusEGlobal::debugMode) {
if (mlockall(MCL_CURRENT | MCL_FUTURE))
perror("WARNING: Cannot lock memory:");
}
- muse->show();
- muse->seqStart();
+ MusEGlobal::muse->show();
+ MusEGlobal::muse->seqStart();
#ifdef HAVE_LASH
{
- lash_client = 0;
- if(useLASH)
+ MusEApp::lash_client = 0;
+ if(MusEGlobal::useLASH)
{
int lash_flags = LASH_Config_File;
const char *muse_name = PACKAGE_NAME;
- lash_client = lash_init (lash_args, muse_name, lash_flags, LASH_PROTOCOL(2,0));
- lash_alsa_client_id (lash_client, snd_seq_client_id (alsaSeq));
+ MusEApp::lash_client = lash_init (lash_args, muse_name, lash_flags, LASH_PROTOCOL(2,0));
+ lash_alsa_client_id (MusEApp::lash_client, snd_seq_client_id (alsaSeq));
if (!noAudio) {
// p3.3.38
//char *jack_name = ((JackAudioDevice*)audioDevice)->getJackName();
const char *jack_name = audioDevice->clientName();
- lash_jack_client_name (lash_client, jack_name);
+ lash_jack_client_name (MusEApp::lash_client, jack_name);
}
}
}
#endif /* HAVE_LASH */
- QTimer::singleShot(100, muse, SLOT(showDidYouKnowDialog()));
+ QTimer::singleShot(100, MusEGlobal::muse, SLOT(showDidYouKnowDialog()));
int rv = app.exec();
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("app.exec() returned:%d\nDeleting main MusE object\n", rv);
- delete muse;
- if(debugMsg)
+ delete MusEGlobal::muse;
+ if(MusEGlobal::debugMsg)
printf("Finished! Exiting main, return value:%d\n", rv);
return rv;
diff --git a/muse2/muse/marker/CMakeLists.txt b/muse2/muse/marker/CMakeLists.txt
index 1077eba1..ade841db 100644
--- a/muse2/muse/marker/CMakeLists.txt
+++ b/muse2/muse/marker/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/marker/marker.cpp b/muse2/muse/marker/marker.cpp
index e34e03dd..00f76e81 100644
--- a/muse2/muse/marker/marker.cpp
+++ b/muse2/muse/marker/marker.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: marker.cpp,v 1.2 2003/12/10 18:34:22 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "marker.h"
diff --git a/muse2/muse/marker/marker.h b/muse2/muse/marker/marker.h
index 012cce80..4d222b01 100644
--- a/muse2/muse/marker/marker.h
+++ b/muse2/muse/marker/marker.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: marker.h,v 1.2 2003/12/15 11:41:00 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MARKER_H__
diff --git a/muse2/muse/marker/markerview.cpp b/muse2/muse/marker/markerview.cpp
index fabb35fd..f6517ee1 100644
--- a/muse2/muse/marker/markerview.cpp
+++ b/muse2/muse/marker/markerview.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: markerview.cpp,v 1.7.2.6 2009/08/25 20:28:45 spamatica Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "al/sig.h" // Tim.
@@ -109,7 +124,7 @@ void MarkerItem::setTick(unsigned v)
s.sprintf("%04d.%02d.%03d", bar+1, beat+1, tick);
setText(COL_TICK, s);
- double time = double(tempomap.tick2frame(v))/double(sampleRate);
+ double time = double(tempomap.tick2frame(v))/double(MusEGlobal::sampleRate);
int hour = int(time) / 3600;
int min = (int(time) % 3600)/60;
int sec = int(time) % 60;
@@ -183,7 +198,7 @@ MarkerView::MarkerView(QWidget* parent)
// Toolbars ---------------------------------------------------------
QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools"));
undo_tools->setObjectName("Undo/Redo tools");
- undo_tools->addActions(undoRedo->actions());
+ undo_tools->addActions(MusEGlobal::undoRedo->actions());
QToolBar* edit = addToolBar(tr("edit tools"));
edit->setObjectName("marker edit tools");
@@ -192,11 +207,11 @@ MarkerView::MarkerView(QWidget* parent)
QToolBar* panic_toolbar = addToolBar(tr("panic"));
panic_toolbar->setObjectName("panic");
- panic_toolbar->addAction(panicAction);
+ panic_toolbar->addAction(MusEGlobal::panicAction);
QToolBar* transport_toolbar = addToolBar(tr("transport"));
transport_toolbar->setObjectName("transport");
- transport_toolbar->addActions(transportAction->actions());
+ transport_toolbar->addActions(MusEGlobal::transportAction->actions());
//---------------------------------------------------
// master
diff --git a/muse2/muse/marker/markerview.h b/muse2/muse/marker/markerview.h
index bab0f6e3..48d4901a 100644
--- a/muse2/muse/marker/markerview.h
+++ b/muse2/muse/marker/markerview.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: markerview.h,v 1.4.2.3 2008/08/18 00:15:25 terminator356 Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MARKERVIEW_H__
diff --git a/muse2/muse/master/CMakeLists.txt b/muse2/muse/master/CMakeLists.txt
index ed2bd2db..ffbd4fa3 100644
--- a/muse2/muse/master/CMakeLists.txt
+++ b/muse2/muse/master/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/master/lmaster.cpp b/muse2/muse/master/lmaster.cpp
index 5370a493..5575b64e 100644
--- a/muse2/muse/master/lmaster.cpp
+++ b/muse2/muse/master/lmaster.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: lmaster.cpp,v 1.2.2.8 2009/03/09 02:05:18 terminator356 Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "awl/posedit.h"
@@ -144,7 +159,7 @@ LMaster::LMaster()
//---------Pulldown Menu----------------------------
menuEdit = menuBar()->addMenu(tr("&Edit"));
QSignalMapper *signalMapper = new QSignalMapper(this);
- menuEdit->addActions(undoRedo->actions());
+ menuEdit->addActions(MusEGlobal::undoRedo->actions());
menuEdit->addSeparator();
tempoAction = menuEdit->addAction(tr("Insert Tempo"));
signAction = menuEdit->addAction(tr("Insert Signature"));
@@ -179,7 +194,7 @@ LMaster::LMaster()
// Toolbars ---------------------------------------------------------
QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools"));
undo_tools->setObjectName("Undo/Redo tools");
- undo_tools->addActions(undoRedo->actions());
+ undo_tools->addActions(MusEGlobal::undoRedo->actions());
QToolBar* edit = addToolBar(tr("Edit tools"));
edit->setObjectName("Master List Edit Tools");
@@ -198,11 +213,11 @@ LMaster::LMaster()
QToolBar* panic_toolbar = addToolBar(tr("panic"));
panic_toolbar->setObjectName("panic");
- panic_toolbar->addAction(panicAction);
+ panic_toolbar->addAction(MusEGlobal::panicAction);
QToolBar* transport_toolbar = addToolBar(tr("transport"));
transport_toolbar->setObjectName("transport");
- transport_toolbar->addActions(transportAction->actions());
+ transport_toolbar->addActions(MusEGlobal::transportAction->actions());
///Q3Accel* qa = new Q3Accel(this);
///qa->connectItem(qa->insertItem(Qt::CTRL+Qt::Key_Z), song, SLOT(undo()));
@@ -844,7 +859,7 @@ LMasterKeyEventItem::LMasterKeyEventItem(QTreeWidget* parent, const KeyEvent& ev
AL::sigmap.tickValues(t, &bar, &beat, &tick);
c1.sprintf("%04d.%02d.%03d", bar+1, beat+1, tick);
- double time = double(tempomap.tick2frame(t)) / double(sampleRate);
+ double time = double(tempomap.tick2frame(t)) / double(MusEGlobal::sampleRate);
int min = int(time) / 60;
int sec = int(time) % 60;
int msec = int((time - (min*60 + sec)) * 1000.0);
@@ -875,7 +890,7 @@ LMasterTempoItem::LMasterTempoItem(QTreeWidget* parent, const TEvent* ev)
AL::sigmap.tickValues(t, &bar, &beat, &tick);
c1.sprintf("%04d.%02d.%03d", bar+1, beat+1, tick);
- double time = double(tempomap.tick2frame(t) /*ev->frame*/) / double(sampleRate);
+ double time = double(tempomap.tick2frame(t) /*ev->frame*/) / double(MusEGlobal::sampleRate);
int min = int(time) / 60;
int sec = int(time) % 60;
int msec = int((time - (min*60 + sec)) * 1000.0);
@@ -903,7 +918,7 @@ LMasterSigEventItem::LMasterSigEventItem(QTreeWidget* parent, const AL::SigEvent
AL::sigmap.tickValues(t, &bar, &beat, &tick);
c1.sprintf("%04d.%02d.%03d", bar+1, beat+1, tick);
- double time = double(tempomap.tick2frame(t)) / double (sampleRate);
+ double time = double(tempomap.tick2frame(t)) / double (MusEGlobal::sampleRate);
int min = int(time) / 60;
int sec = int(time) % 60;
int msec = int((time - (min*60 + sec)) * 1000.0);
diff --git a/muse2/muse/master/lmaster.h b/muse2/muse/master/lmaster.h
index 9372d1b2..4d2c03e9 100644
--- a/muse2/muse/master/lmaster.h
+++ b/muse2/muse/master/lmaster.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: lmaster.h,v 1.1.1.1.2.5 2005/12/11 21:29:23 spamatica Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __LMASTER_EDIT_H__
diff --git a/muse2/muse/master/master.cpp b/muse2/muse/master/master.cpp
index 6293e64c..e9212be9 100644
--- a/muse2/muse/master/master.cpp
+++ b/muse2/muse/master/master.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: master.cpp,v 1.3 2004/04/11 13:03:32 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -191,21 +206,21 @@ void Master::draw(QPainter& p, const QRect& rect)
void Master::viewMousePressEvent(QMouseEvent* event)
{
start = event->pos();
- Tool activeTool = tool;
+ MusEWidget::Tool activeTool = tool;
// bool shift = event->state() & ShiftButton;
switch (activeTool) {
- case PointerTool:
+ case MusEWidget::PointerTool:
drag = DRAG_LASSO_START;
break;
- case PencilTool:
+ case MusEWidget::PencilTool:
drag = DRAG_NEW;
song->startUndo();
newVal(start.x(), start.x(), start.y());
break;
- case RubberTool:
+ case MusEWidget::RubberTool:
drag = DRAG_DELETE;
song->startUndo();
deleteVal(start.x(), start.x());
@@ -302,11 +317,11 @@ void Master::deleteVal(int x1, int x2)
void Master::setTool(int t)
{
- if (tool == Tool(t))
+ if (tool == MusEWidget::Tool(t))
return;
- tool = Tool(t);
+ tool = MusEWidget::Tool(t);
switch(tool) {
- case PencilTool:
+ case MusEWidget::PencilTool:
setCursor(QCursor(*pencilIcon, 4, 15));
break;
default:
diff --git a/muse2/muse/master/master.h b/muse2/muse/master/master.h
index 2415b15e..4f181755 100644
--- a/muse2/muse/master/master.h
+++ b/muse2/muse/master/master.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: master.h,v 1.3 2004/04/11 13:03:32 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MASTER_H__
@@ -25,7 +40,7 @@ class ScrollScale;
// Master
//---------------------------------------------------------
-class Master : public View {
+class Master : public MusEWidget::View {
Q_OBJECT
enum DragMode { DRAG_OFF, DRAG_NEW, DRAG_MOVE_START, DRAG_MOVE,
DRAG_DELETE, DRAG_COPY_START, DRAG_COPY,
@@ -34,7 +49,7 @@ class Master : public View {
ScrollScale* vscroll;
unsigned pos[3];
QPoint start;
- Tool tool;
+ MusEWidget::Tool tool;
DragMode drag;
MidiEditor* editor;
diff --git a/muse2/muse/master/masteredit.cpp b/muse2/muse/master/masteredit.cpp
index 1eb2d071..976d90b9 100644
--- a/muse2/muse/master/masteredit.cpp
+++ b/muse2/muse/master/masteredit.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: masteredit.cpp,v 1.4.2.5 2009/07/01 22:14:56 spamatica Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "awl/sigedit.h"
@@ -96,18 +111,18 @@ MasterEdit::MasterEdit()
// Toolbars ---------------------------------------------------------
QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools"));
undo_tools->setObjectName("Undo/Redo tools");
- undo_tools->addActions(undoRedo->actions());
+ undo_tools->addActions(MusEGlobal::undoRedo->actions());
QToolBar* panic_toolbar = addToolBar(tr("panic"));
panic_toolbar->setObjectName("panic");
- panic_toolbar->addAction(panicAction);
+ panic_toolbar->addAction(MusEGlobal::panicAction);
QToolBar* transport_toolbar = addToolBar(tr("transport"));
transport_toolbar->setObjectName("transport");
- transport_toolbar->addActions(transportAction->actions());
+ transport_toolbar->addActions(MusEGlobal::transportAction->actions());
- EditToolBar* tools2 = new EditToolBar(this, PointerTool | PencilTool | RubberTool);
+ MusEWidget::EditToolBar* tools2 = new MusEWidget::EditToolBar(this, MusEWidget::PointerTool | MusEWidget::PencilTool | MusEWidget::RubberTool);
addToolBar(tools2);
QToolBar* enableMaster = addToolBar(tr("Enable master"));
@@ -127,11 +142,11 @@ MasterEdit::MasterEdit()
label->setIndent(3);
info->addWidget(label);
- cursorPos = new PosLabel(0);
+ cursorPos = new MusEWidget::PosLabel(0);
cursorPos->setFixedHeight(22);
cursorPos->setToolTip(tr("time at cursor position"));
info->addWidget(cursorPos);
- tempo = new TempoLabel(0);
+ tempo = new MusEWidget::TempoLabel(0);
tempo->setFixedHeight(22);
tempo->setToolTip(tr("tempo at cursor position"));
info->addWidget(tempo);
@@ -139,7 +154,7 @@ MasterEdit::MasterEdit()
const char* rastval[] = {
QT_TRANSLATE_NOOP("@default", "Off"), "Bar", "1/2", "1/4", "1/8", "1/16"
};
- rasterLabel = new LabelCombo(tr("Snap"), 0);
+ rasterLabel = new MusEWidget::LabelCombo(tr("Snap"), 0);
rasterLabel->setFocusPolicy(Qt::NoFocus);
for (int i = 0; i < 6; i++)
rasterLabel->insertItem(i, tr(rastval[i]));
@@ -149,7 +164,7 @@ MasterEdit::MasterEdit()
//---------values for current position---------------
info->addWidget(new QLabel(tr("CurPos ")));
- curTempo = new TempoEdit(0);
+ curTempo = new MusEWidget::TempoEdit(0);
curSig = new SigEdit(0);
curSig->setValue(AL::TimeSignature(4, 4));
curTempo->setToolTip(tr("tempo at current position"));
@@ -168,17 +183,17 @@ MasterEdit::MasterEdit()
int xscale = -20;
int yscale = -500;
- hscroll = new ScrollScale(-100, -2, xscale, song->len(), Qt::Horizontal, mainw);
- vscroll = new ScrollScale(-1000, -100, yscale, 120000, Qt::Vertical, mainw);
+ hscroll = new MusEWidget::ScrollScale(-100, -2, xscale, song->len(), Qt::Horizontal, mainw);
+ vscroll = new MusEWidget::ScrollScale(-1000, -100, yscale, 120000, Qt::Vertical, mainw);
vscroll->setRange(30000, 250000);
- time1 = new MTScale(&_raster, mainw, xscale);
- sign = new SigScale(&_raster, mainw, xscale);
-// thits = new HitScale(&_raster, mainw, xscale);
+ time1 = new MusEWidget::MTScale(&_raster, mainw, xscale);
+ sign = new MusEWidget::SigScale(&_raster, mainw, xscale);
+// thits = new MusEWidget::HitScale(&_raster, mainw, xscale);
canvas = new Master(this, mainw, xscale, yscale);
-// zhits = new HitScale(&_raster, mainw, xscale);
- time2 = new MTScale(&_raster, mainw, xscale);
+// zhits = new MusEWidget::HitScale(&_raster, mainw, xscale);
+ time2 = new MusEWidget::MTScale(&_raster, mainw, xscale);
tscale = new TScale(mainw, yscale);
time2->setBarLocator(true);
@@ -191,18 +206,18 @@ MasterEdit::MasterEdit()
mainGrid->setRowStretch(5, 100);
mainGrid->setColumnStretch(1, 100);
- mainGrid->addWidget(hLine(mainw), 0, 1);
+ mainGrid->addWidget(MusEUtil::hLine(mainw), 0, 1);
mainGrid->addWidget(time1, 1, 1);
- mainGrid->addWidget(hLine(mainw), 2, 1);
+ mainGrid->addWidget(MusEUtil::hLine(mainw), 2, 1);
mainGrid->addWidget(sign, 3, 1);
- mainGrid->addWidget(hLine(mainw), 4, 1);
+ mainGrid->addWidget(MusEUtil::hLine(mainw), 4, 1);
// mainGrid->addWidget(thits, 5, 1);
-// mainGrid->addWidget(hLine(mainw), 6, 1);
+// mainGrid->addWidget(MusEUtil::hLine(mainw), 6, 1);
mainGrid->addWidget(canvas, 5, 1);
mainGrid->addWidget(tscale, 5, 0);
- mainGrid->addWidget(hLine(mainw), 6, 1);
+ mainGrid->addWidget(MusEUtil::hLine(mainw), 6, 1);
// mainGrid->addWidget(zhits, 9, 1);
-// mainGrid->addWidget(hLine(mainw), 7, 1);
+// mainGrid->addWidget(MusEUtil::hLine(mainw), 7, 1);
mainGrid->addWidget(time2, 7, 1);
mainGrid->addWidget(hscroll, 8, 1);
mainGrid->addWidget(vscroll, 0, 2, 10, 1);
diff --git a/muse2/muse/master/masteredit.h b/muse2/muse/master/masteredit.h
index 4e66f70e..4f188813 100644
--- a/muse2/muse/master/masteredit.h
+++ b/muse2/muse/master/masteredit.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: masteredit.h,v 1.3.2.2 2009/04/01 01:37:11 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MASTER_EDIT_H__
@@ -25,15 +40,18 @@ class QToolBar;
class QToolButton;
class Master;
-class ScrollScale;
-class MTScale;
-class SigScale;
-class HitScale;
class TScale;
-class TempoEdit;
+
+namespace MusEWidget {
+class HitScale;
class LabelCombo;
+class MTScale;
class PosLabel;
+class ScrollScale;
+class SigScale;
+class TempoEdit;
class TempoLabel;
+}
//---------------------------------------------------------
// MasterEdit
@@ -43,21 +61,21 @@ class MasterEdit : public MidiEditor {
Q_OBJECT
Master* canvas;
- ScrollScale* hscroll;
- ScrollScale* vscroll;
- MTScale* time1;
- MTScale* time2;
- SigScale* sign;
- HitScale* thits;
- HitScale* zhits;
+ MusEWidget::ScrollScale* hscroll;
+ MusEWidget::ScrollScale* vscroll;
+ MusEWidget::MTScale* time1;
+ MusEWidget::MTScale* time2;
+ MusEWidget::SigScale* sign;
+ MusEWidget::HitScale* thits;
+ MusEWidget::HitScale* zhits;
TScale* tscale;
- TempoEdit* curTempo;
+ MusEWidget::TempoEdit* curTempo;
SigEdit* curSig;
- LabelCombo* rasterLabel;
+ MusEWidget::LabelCombo* rasterLabel;
QToolBar* tools;
- PosLabel* cursorPos;
- TempoLabel* tempo;
+ MusEWidget::PosLabel* cursorPos;
+ MusEWidget::TempoLabel* tempo;
QToolButton* enableButton;
static int _rasterInit;
diff --git a/muse2/muse/master/tscale.cpp b/muse2/muse/master/tscale.cpp
index 9ea34fba..e25c3454 100644
--- a/muse2/muse/master/tscale.cpp
+++ b/muse2/muse/master/tscale.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: tscale.cpp,v 1.2 2003/12/17 11:04:14 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -20,8 +35,8 @@
TScale::TScale(QWidget* parent, int ymag)
: View(parent, 1, ymag)
{
- setFont(config.fonts[4]);
- //int w = 4 * QFontMetrics(config.fonts[4]).width('0');
+ setFont(MusEConfig::config.fonts[4]);
+ //int w = 4 * QFontMetrics(MusEConfig::config.fonts[4]).width('0');
int w = 4 * fontMetrics().width('0');
setFixedWidth(w);
setMouseTracking(true);
@@ -35,7 +50,7 @@ void TScale::pdraw(QPainter& p, const QRect& r)
{
int y = r.y();
int h = r.height();
- //p.setFont(config.fonts[4]);
+ //p.setFont(MusEConfig::config.fonts[4]);
QString s;
for (int i = 30000; i <= 250000; i += 10000) {
int yy = mapy(280000 - i);
@@ -45,7 +60,7 @@ void TScale::pdraw(QPainter& p, const QRect& r)
continue;
p.drawLine(0, yy, width(), yy);
s.setNum(i/1000);
- //QFontMetrics fm(config.fonts[4]);
+ //QFontMetrics fm(MusEConfig::config.fonts[4]);
//p.drawText(width() - fm.width(s) - 1, yy-2, s);
p.drawText(width() - fontMetrics().width(s) - 1, yy-2, s); // Use the window font. Tim p4.0.31
}
diff --git a/muse2/muse/master/tscale.h b/muse2/muse/master/tscale.h
index d7ce86c9..2c03839f 100644
--- a/muse2/muse/master/tscale.h
+++ b/muse2/muse/master/tscale.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: tscale.h,v 1.1.1.1 2003/10/27 18:52:36 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TSCALE_H__
@@ -14,7 +29,7 @@
// Tscale
//---------------------------------------------------------
-class TScale : public View {
+class TScale : public MusEWidget::View {
Q_OBJECT
double curTempo;
diff --git a/muse2/muse/memory.cpp b/muse2/muse/memory.cpp
index 6a5b5c0c..a1ece0a7 100644
--- a/muse2/muse/memory.cpp
+++ b/muse2/muse/memory.cpp
@@ -4,6 +4,21 @@
// $Id: memory.cpp,v 1.1.1.1.2.2 2009/12/19 23:35:39 spamatica Exp $
//
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "memory.h"
diff --git a/muse2/muse/memory.h b/muse2/muse/memory.h
index 9e996965..816cf185 100644
--- a/muse2/muse/memory.h
+++ b/muse2/muse/memory.h
@@ -4,6 +4,21 @@
// $Id: memory.h,v 1.4.2.3 2009/12/15 22:08:50 spamatica Exp $
//
// (C) Copyright 2003-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MEMORY_H__
diff --git a/muse2/muse/midi.cpp b/muse2/muse/midi.cpp
index 6abcaa81..39642348 100644
--- a/muse2/muse/midi.cpp
+++ b/muse2/muse/midi.cpp
@@ -4,6 +4,22 @@
// $Id: midi.cpp,v 1.43.2.22 2009/11/09 20:28:28 terminator356 Exp $
//
// (C) Copyright 1999/2004 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
@@ -52,7 +68,7 @@ const unsigned int mmcDeferredPlayMsgLen = sizeof(mmcDeferredPlayMsg);
const unsigned int mmcStopMsgLen = sizeof(mmcStopMsg);
const unsigned int mmcLocateMsgLen = sizeof(mmcLocateMsg);
-#define CALC_TICK(the_tick) lrintf((float(the_tick) * float(config.division) + float(div/2)) / float(div));
+#define CALC_TICK(the_tick) lrintf((float(the_tick) * float(MusEConfig::config.division) + float(div/2)) / float(div));
/*---------------------------------------------------------
* midi_meta_name
*---------------------------------------------------------*/
@@ -201,9 +217,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track,
|| ((ev.channel() == track->outChannel()) && (ev.port() == track->outPort()))))
continue;
unsigned tick = ev.time();
- // Added by Tim. p3.3.8
- // Added by T356.
if(doLoops)
{
if(tick >= song->lPos().tick() && tick < song->rPos().tick())
@@ -408,7 +422,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track,
break;
case 0x6: // Marker
{
- unsigned ltick = CALC_TICK(tick);//(tick * config.division + div/2) / div;
+ unsigned ltick = CALC_TICK(tick);//(tick * MusEConfig::config.division + div/2) / div;
song->addMarker(QString((const char*)(data)), ltick, false);
}
break;
@@ -424,7 +438,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track,
case 0x51: // Tempo
{
unsigned tempo = data[2] + (data[1] << 8) + (data[0] <<16);
- unsigned ltick = CALC_TICK(tick);// (unsigned(tick) * unsigned(config.division) + unsigned(div/2)) / unsigned(div);
+ unsigned ltick = CALC_TICK(tick);// (unsigned(tick) * unsigned(MusEConfig::config.division) + unsigned(div/2)) / unsigned(div);
// After ca 10 mins 32 bits will not be enough... This expression has to be changed/factorized or so in some "sane" way...
tempomap.addTempo(ltick, tempo);
}
@@ -436,7 +450,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track,
int timesig_n = 1;
for (int i = 0; i < n; i++)
timesig_n *= 2;
- int ltick = CALC_TICK(tick);//(tick * config.division + div/2) / div;
+ int ltick = CALC_TICK(tick);//(tick * MusEConfig::config.division + div/2) / div;
///sigmap.add(ltick, timesig_z, timesig_n);
AL::sigmap.add(ltick, AL::TimeSignature(timesig_z, timesig_n));
}
@@ -460,13 +474,10 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track,
// read NoteOn events and remove corresponding NoteOffs
//---------------------------------------------------
- // Added by Tim. p3.3.8
- // Loop removed by flo
for (iEvent i = mel.begin(); i != mel.end(); ++i) {
Event ev = i->second;
if (ev.isNote()) {
if (!ev.isNoteOff()) {
- // Added by Tim. p3.3.8
// If the event length is not zero, it means the event and its
// note on/off have already been taken care of. So ignore it.
@@ -479,7 +490,7 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track,
if (ev.isNoteOff(event)) {
int t = k->first - i->first;
if (t <= 0) {
- if (debugMsg) {
+ if (MusEGlobal::debugMsg) {
printf("Note len is (%d-%d)=%d, set to 1\n",
k->first, i->first, k->first - i->first);
ev.dump();
@@ -505,10 +516,10 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track,
if (k==i)
//this will never happen, because i->second has to be a NOTE ON,
//while k has to be a NOTE OFF. but in case something changes:
- printf("ERROR: THIS SHOULD NEVER HAPPEN: k==i in midi.cpp:buildMidiEventList()\n");
+ printf("ERROR: THIS SHOULD NEVER HAPPEN: k==i in midi.cpp:buildMidiEventList()\n");
else
- mel.erase(k);
-
+ mel.erase(k);
+ i = mel.begin(); // p4.0.34
continue;
}
}
@@ -523,9 +534,9 @@ void buildMidiEventList(EventList* del, const MPEventList* el, MidiTrack* track,
i->first, ev.pitch(), ev.velo());
continue;
}
- int tick = CALC_TICK(ev.tick()); //(ev.tick() * config.division + div/2) / div;
+ int tick = CALC_TICK(ev.tick()); //(ev.tick() * MusEConfig::config.division + div/2) / div;
if (ev.isNote()) {
- int lenTick = CALC_TICK(ev.lenTick()); //(ev.lenTick() * config.division + div/2) / div;
+ int lenTick = CALC_TICK(ev.lenTick()); //(ev.lenTick() * MusEConfig::config.division + div/2) / div;
ev.setLenTick(lenTick);
}
ev.setTick(tick);
@@ -565,7 +576,7 @@ void Audio::panic()
if (port == 0) // ??
continue;
for (int chan = 0; chan < MIDI_CHANNELS; ++chan) {
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("send all sound of to midi port %d channel %d\n", i, chan);
port->sendEvent(MidiPlayEvent(0, i, chan, ME_CONTROLLER, CTRL_ALL_SOUNDS_OFF, 0), true);
port->sendEvent(MidiPlayEvent(0, i, chan, ME_CONTROLLER, CTRL_RESET_ALL_CTRL, 0), true);
@@ -594,7 +605,7 @@ void Audio::initDevices()
activePorts[track->outPort()] = true;
}
if (song->click())
- activePorts[clickPort] = true;
+ activePorts[MusEGlobal::clickPort] = true;
//
// test for explicit instrument initialization
@@ -675,8 +686,6 @@ void Audio::collectEvents(MidiTrack* track, unsigned int cts, unsigned int nts)
int defaultPort = port;
MidiDevice* md = midiPorts[port].device();
- MPEventList* playEvents = md->playEvents();
- MPEventList* stuckNotes = md->stuckNotes();
PartList* pl = track->parts();
for (iPart p = pl->begin(); p != pl->end(); ++p) {
@@ -699,7 +708,7 @@ void Audio::collectEvents(MidiTrack* track, unsigned int cts, unsigned int nts)
continue;
unsigned stick = (offset > cts) ? 0 : cts - offset;
unsigned etick = nts - offset;
- // By T356. Do not play events which are past the end of this part.
+ // Do not play events which are past the end of this part.
if(etick > partLen)
continue;
@@ -761,33 +770,26 @@ void Audio::collectEvents(MidiTrack* track, unsigned int cts, unsigned int nts)
int veloOff = ev.veloOff();
if (port == defaultPort) {
- //printf("Adding event normally: frame=%d port=%d channel=%d pitch=%d velo=%d\n",frame, port, channel, pitch, velo);
-
- // p3.3.25
// If syncing to external midi sync, we cannot use the tempo map.
- // Therefore we cannot get sub-tick resolution. Just use ticks instead of frames.
+ // Therefore we cannot get sub-tick resolution. Just use ticks instead of frames. p3.3.25
if(extSyncFlag.value())
- playEvents->add(MidiPlayEvent(tick, port, channel, 0x90, pitch, velo));
+ md->addScheduledEvent(MidiPlayEvent(tick, port, channel, ME_NOTEON, pitch, velo));
else
-
- playEvents->add(MidiPlayEvent(frame, port, channel, 0x90, pitch, velo));
+ md->addScheduledEvent(MidiPlayEvent(frame, port, channel, ME_NOTEON, pitch, velo));
- stuckNotes->add(MidiPlayEvent(tick + len, port, channel,
- veloOff ? 0x80 : 0x90, pitch, veloOff));
+ md->addStuckNote(MidiPlayEvent(tick + len, port, channel,
+ veloOff ? ME_NOTEOFF : ME_NOTEON, pitch, veloOff));
}
else { //Handle events to different port than standard.
MidiDevice* mdAlt = midiPorts[port].device();
if (mdAlt) {
-
- // p3.3.25
- if(extSyncFlag.value())
- mdAlt->playEvents()->add(MidiPlayEvent(tick, port, channel, 0x90, pitch, velo));
+ if(extSyncFlag.value()) // p3.3.25
+ mdAlt->addScheduledEvent(MidiPlayEvent(tick, port, channel, ME_NOTEON, pitch, velo));
else
+ mdAlt->addScheduledEvent(MidiPlayEvent(frame, port, channel, ME_NOTEON, pitch, velo));
- mdAlt->playEvents()->add(MidiPlayEvent(frame, port, channel, 0x90, pitch, velo));
-
- mdAlt->stuckNotes()->add(MidiPlayEvent(tick + len, port, channel,
- veloOff ? 0x80 : 0x90, pitch, veloOff));
+ mdAlt->addStuckNote(MidiPlayEvent(tick + len, port, channel,
+ veloOff ? ME_NOTEOFF : ME_NOTEON, pitch, veloOff));
}
}
@@ -796,7 +798,6 @@ void Audio::collectEvents(MidiTrack* track, unsigned int cts, unsigned int nts)
}
break;
- // Added by T356.
case Controller:
{
if (track->type() == Track::DRUM)
@@ -814,37 +815,30 @@ void Audio::collectEvents(MidiTrack* track, unsigned int cts, unsigned int nts)
MidiDevice* mdAlt = midiPorts[port].device();
if(mdAlt)
{
- // p3.3.25
// If syncing to external midi sync, we cannot use the tempo map.
- // Therefore we cannot get sub-tick resolution. Just use ticks instead of frames.
+ // Therefore we cannot get sub-tick resolution. Just use ticks instead of frames. p3.3.25
if(extSyncFlag.value())
- mdAlt->playEvents()->add(MidiPlayEvent(tick, port, channel,
+ mdAlt->addScheduledEvent(MidiPlayEvent(tick, port, channel,
ME_CONTROLLER, ctl | pitch, ev.dataB()));
else
- mdAlt->playEvents()->add(MidiPlayEvent(frame, port, channel,
+ mdAlt->addScheduledEvent(MidiPlayEvent(frame, port, channel,
ME_CONTROLLER, ctl | pitch, ev.dataB()));
-
}
break;
}
}
- // p3.3.25
- if(extSyncFlag.value())
- playEvents->add(MidiPlayEvent(tick, port, channel, ev));
+ if(extSyncFlag.value()) // p3.3.25
+ md->addScheduledEvent(MidiPlayEvent(tick, port, channel, ev));
else
-
- playEvents->add(MidiPlayEvent(frame, port, channel, ev));
+ md->addScheduledEvent(MidiPlayEvent(frame, port, channel, ev));
}
break;
-
-
+
default:
- // p3.3.25
- if(extSyncFlag.value())
- playEvents->add(MidiPlayEvent(tick, port, channel, ev));
+ if(extSyncFlag.value()) // p3.3.25
+ md->addScheduledEvent(MidiPlayEvent(tick, port, channel, ev));
else
-
- playEvents->add(MidiPlayEvent(frame, port, channel, ev));
+ md->addScheduledEvent(MidiPlayEvent(frame, port, channel, ev));
break;
}
@@ -870,30 +864,6 @@ void Audio::processMidi()
for (iMidiDevice id = midiDevices.begin(); id != midiDevices.end(); ++id) {
MidiDevice* md = *id;
- //
- // erase already played events:
- //
- ///MPEventList* playEvents = md->playEvents();
- ///iMPEvent nextPlayEvent = md->nextPlayEvent();
-
- //if(md->playEvents()->size())
- //{
- //printf("Audio::processMidi before erase md play events size:%d nextPlayEvent isEnd:%d\n", md->playEvents()->size(), md->nextPlayEvent() == md->playEvents()->end());
- // printf("Audio::processMidi md play events size:%d first item:\n", md->playEvents()->size());
- // md->playEvents()->begin()->dump();
- //}
-
- // p4.0.15 Tim. Moved into MidiJackDevice::processMidi (for Jack), and MidiSeq::processTimerTick (for ALSA).
- // Why do this here? Instead, let each device erase their just-played events.
- ///playEvents->erase(playEvents->begin(), nextPlayEvent);
-
- //if(playEvents->size())
- //{
- // printf("Audio::processMidi after erase md play events size:%d nextPlayEvent isEnd:%d events:\n", playEvents->size(), nextPlayEvent == playEvents->end());
- //for(iMPEvent ie = playEvents->begin(); ie != playEvents->end(); ++ie)
- // ie->dump();
- //}
-
// klumsy hack for synti devices:
if(md->isSynti())
{
@@ -905,10 +875,6 @@ void Audio::processMidi()
}
}
- // Is it a Jack midi device?
- //MidiJackDevice* mjd = dynamic_cast<MidiJackDevice*>(md);
- //if(mjd)
- // mjd->collectMidiEvents();
md->collectMidiEvents();
// Take snapshots of the current sizes of the recording fifos,
@@ -916,33 +882,14 @@ void Audio::processMidi()
md->beforeProcess();
}
- // p4.0.15 Tim. Moved into SynthI::getData.
- // Why do this here? Instead, let each device erase their just-played events.
- ///MPEventList* playEvents = metronome->playEvents();
- ///iMPEvent nextPlayEvent = metronome->nextPlayEvent();
- ///playEvents->erase(playEvents->begin(), nextPlayEvent);
-
- // p3.3.25
bool extsync = extSyncFlag.value();
-
for (iMidiTrack t = song->midis()->begin(); t != song->midis()->end(); ++t)
{
MidiTrack* track = *t;
int port = track->outPort();
MidiDevice* md = midiPorts[port].device();
-
- // Changed by Tim. p3.3.8
- //if(md == 0)
- // continue;
- //MPEventList* playEvents = md->playEvents();
- //if (playEvents == 0)
- // continue;
- //if (!track->isMute())
- MPEventList* playEvents = 0;
if(md)
{
- playEvents = md->playEvents();
-
// only add track events if the track is unmuted
if(!track->isMute())
{
@@ -956,66 +903,26 @@ void Audio::processMidi()
//
if (track->recordFlag())
{
- //int portMask = track->inPortMask();
- // p3.3.38 Removed
- //unsigned int portMask = track->inPortMask();
- //int channelMask = track->inChannelMask();
-
MPEventList* rl = track->mpevents();
MidiPort* tport = &midiPorts[port];
-
- // p3.3.38
- //for (iMidiDevice id = midiDevices.begin(); id != midiDevices.end(); ++id)
- //{
RouteList* irl = track->inRoutes();
for(ciRoute r = irl->begin(); r != irl->end(); ++r)
{
- //if(!r->isValid() || (r->type != Route::ALSA_MIDI_ROUTE && r->type != Route::JACK_MIDI_ROUTE))
- //if(!r->isValid() || (r->type != Route::MIDI_DEVICE_ROUTE))
if(!r->isValid() || (r->type != Route::MIDI_PORT_ROUTE)) // p3.3.49
continue;
-
- int devport = r->midiPort; // p3.3.49
+ int devport = r->midiPort; //
if (devport == -1)
- continue;
-
- //MidiDevice* dev = *id;
- //MidiDevice* dev = r->device;
- MidiDevice* dev = midiPorts[devport].device(); // p3.3.49
+ continue;
+ MidiDevice* dev = midiPorts[devport].device(); //
if(!dev)
continue;
-
-
- // p3.3.50 Removed
- //int channel = r->channel;
- // NOTE: TODO: Special for input device sysex 'channel' marked as -1, ** IF we end up going with that method **.
- // This would mean having a separate 'System' channel listed in the routing popups.
- // The other alternative is to accept sysex from a device as long as ANY regular channel is routed from it,
- // this does not require a 'System' channel listed in the routing popups.
- // But that requires more code below... Done.
- //if(channel == -1)
- //channel = MIDI_CHANNELS; // Special channel '17'
- // continue;
-
- //int devport = dev->midiPort();
-
- // record only from ports marked in portMask:
- //if (devport == -1 || !(portMask & (1 << devport)))
- //if (devport == -1)
- // continue;
-
- //MREventList* el = dev->recordEvents();
- //MidiFifo& rf = dev->recordEvents();
-
-
- int channelMask = r->channel; // p3.3.50
+ int channelMask = r->channel;
if(channelMask == -1 || channelMask == 0)
continue;
- for(int channel = 0; channel < MIDI_CHANNELS; ++channel) // p3.3.50
+ for(int channel = 0; channel < MIDI_CHANNELS; ++channel)
{
if(!(channelMask & (1 << channel)))
continue;
-
if(!dev->sysexFIFOProcessed())
{
// Set to the sysex fifo at first.
@@ -1026,394 +933,237 @@ void Audio::processMidi()
for(int i = 0; i < count; ++i)
{
MidiPlayEvent event(rf.peek(i));
-
- //unsigned time = event.time() + segmentSize*(segmentCount-1);
- //unsigned time = event.time() + (extsync ? config.division/24 : segmentSize*(segmentCount-1));
- //unsigned time = extsync ? curTickPos : (event.time() + segmentSize*(segmentCount-1));
- //event.setTime(time);
- //if(!extsync)
- // event.setTime(event.time() + segmentSize*(segmentCount-1));
-
event.setPort(port);
-
// dont't echo controller changes back to software
// synthesizer:
if(!dev->isSynti() && md && track->recEcho())
- playEvents->add(event);
-
- // If syncing externally the event time is already in units of ticks, set above.
+ md->addScheduledEvent(event);
+ // If syncing externally the event time is already in units of ticks, set above. p3.3.25
if(!extsync)
- {
- //time = tempomap.frame2tick(event.time());
- //event.setTime(time); // set tick time
event.setTime(tempomap.frame2tick(event.time())); // set tick time
- }
-
if(recording)
rl->add(event);
}
-
dev->setSysexFIFOProcessed(true);
}
- // Set to the sysex fifo at first.
- ///MidiFifo& rf = dev->recordEvents(MIDI_CHANNELS);
- // Get the frozen snapshot of the size.
- ///int count = dev->tmpRecordCount(MIDI_CHANNELS);
-
- // Iterate once for sysex fifo (if needed), once for channel fifos.
- ///for(int sei = 0; sei < 2; ++sei)
+ MidiRecFifo& rf = dev->recordEvents(channel);
+ int count = dev->tmpRecordCount(channel);
+ for(int i = 0; i < count; ++i)
{
- // If on first pass, do sysex fifo.
- /*
- if(sei == 0)
- {
- // Ignore any further channel routes on this device if already done here.
- if(dev->sysexFIFOProcessed())
- continue;
- // Go ahead and set this now.
- dev->setSysexFIFOProcessed(true);
- // Allow it to fall through with the sysex fifo and count...
- }
- else
- {
- // We're on the second pass, do channel fifos.
- rf = dev->recordEvents(channel);
- // Get the frozen snapshot of the size.
- count = dev->tmpRecordCount(channel);
- }
- */
-
- MidiRecFifo& rf = dev->recordEvents(channel);
- int count = dev->tmpRecordCount(channel);
-
- //for (iMREvent ie = el->begin(); ie != el->end(); ++ie)
- for(int i = 0; i < count; ++i)
- {
- MidiPlayEvent event(rf.peek(i));
-
- //int channel = ie->channel();
- ///int channel = event.channel();
-
- int defaultPort = devport;
- ///if (!(channelMask & (1 << channel)))
- ///{
- /// continue;
- ///}
-
- //MidiPlayEvent event(*ie);
- int drumRecPitch=0; //prevent compiler warning: variable used without initialization
- MidiController *mc = 0;
- int ctl = 0;
-
- //Hmmm, hehhh...
- // TODO: Clean up a bit around here when it comes to separate events for rec & for playback.
- // But not before 0.7 (ml)
-
- int prePitch = 0, preVelo = 0;
-
- event.setChannel(track->outChannel());
-
- if (event.isNote() || event.isNoteOff())
+ MidiPlayEvent event(rf.peek(i));
+ int defaultPort = devport;
+ int drumRecPitch=0; //prevent compiler warning: variable used without initialization
+ MidiController *mc = 0;
+ int ctl = 0;
+
+ //Hmmm, hehhh...
+ // TODO: Clean up a bit around here when it comes to separate events for rec & for playback.
+ // But not before 0.7 (ml)
+
+ int prePitch = 0, preVelo = 0;
+
+ event.setChannel(track->outChannel());
+
+ if (event.isNote() || event.isNoteOff())
+ {
+ //
+ // apply track values
+ //
+
+ //Apply drum inkey:
+ if (track->type() == Track::DRUM)
+ {
+ int pitch = event.dataA();
+ //Map note that is played according to drumInmap
+ drumRecPitch = drumMap[(unsigned int)drumInmap[pitch]].enote;
+ devport = drumMap[(unsigned int)drumInmap[pitch]].port;
+ event.setPort(devport);
+ channel = drumMap[(unsigned int)drumInmap[pitch]].channel;
+ event.setA(drumMap[(unsigned int)drumInmap[pitch]].anote);
+ event.setChannel(channel);
+ }
+ else
+ { //Track transpose if non-drum
+ prePitch = event.dataA();
+ int pitch = prePitch + track->transposition;
+ if (pitch > 127)
+ pitch = 127;
+ if (pitch < 0)
+ pitch = 0;
+ event.setA(pitch);
+ }
+
+ if (!event.isNoteOff())
+ {
+ preVelo = event.dataB();
+ int velo = preVelo + track->velocity;
+ velo = (velo * track->compression) / 100;
+ if (velo > 127)
+ velo = 127;
+ if (velo < 1)
+ velo = 1;
+ event.setB(velo);
+ }
+ }
+ else
+ if(event.type() == ME_CONTROLLER)
+ {
+ if(track->type() == Track::DRUM)
{
- //
- // apply track values
- //
-
- //Apply drum inkey:
- if (track->type() == Track::DRUM)
- {
- int pitch = event.dataA();
- //Map note that is played according to drumInmap
- drumRecPitch = drumMap[(unsigned int)drumInmap[pitch]].enote;
- devport = drumMap[(unsigned int)drumInmap[pitch]].port;
- event.setPort(devport);
- channel = drumMap[(unsigned int)drumInmap[pitch]].channel;
- event.setA(drumMap[(unsigned int)drumInmap[pitch]].anote);
- event.setChannel(channel);
- }
- else
- { //Track transpose if non-drum
- prePitch = event.dataA();
- int pitch = prePitch + track->transposition;
- if (pitch > 127)
- pitch = 127;
- if (pitch < 0)
- pitch = 0;
- event.setA(pitch);
+ ctl = event.dataA();
+ // Regardless of what port the event came from, is it a drum controller event
+ // according to the track port's instrument?
+ mc = tport->drumController(ctl);
+ if(mc)
+ {
+ int pitch = ctl & 0x7f;
+ ctl &= ~0xff;
+ int dmindex = drumInmap[pitch] & 0x7f;
+ //Map note that is played according to drumInmap
+ drumRecPitch = drumMap[dmindex].enote;
+ devport = drumMap[dmindex].port;
+ event.setPort(devport);
+ channel = drumMap[dmindex].channel;
+ event.setA(ctl | drumMap[dmindex].anote);
+ event.setChannel(channel);
+ }
+ }
+ }
+
+ // MusE uses a fixed clocks per quarternote of 24.
+ // At standard 384 ticks per quarternote for example,
+ // 384/24=16 for a division of 16 sub-frames (16 MusE 'ticks').
+ // If ext sync, events are now time-stamped with last tick in MidiDevice::recordEvent(). p3.3.35
+ // TODO: Tested, but record resolution not so good. Switch to wall clock based separate list in MidiDevice.
+
+ // dont't echo controller changes back to software
+ // synthesizer:
+
+ if (!dev->isSynti())
+ {
+ //Check if we're outputting to another port than default:
+ if (devport == defaultPort) {
+ event.setPort(port);
+ if(md && track->recEcho())
+ //playEvents->add(event);
+ md->addScheduledEvent(event);
}
-
- if (!event.isNoteOff())
- {
- preVelo = event.dataB();
- int velo = preVelo + track->velocity;
- velo = (velo * track->compression) / 100;
- if (velo > 127)
- velo = 127;
- if (velo < 1)
- velo = 1;
- event.setB(velo);
+ else {
+ // Hmm, this appears to work, but... Will this induce trouble with md->setNextPlayEvent??
+ MidiDevice* mdAlt = midiPorts[devport].device();
+ if(mdAlt && track->recEcho())
+ //mdAlt->playEvents()->add(event);
+ mdAlt->addScheduledEvent(event);
}
- }
- // Added by T356.
- else
- if(event.type() == ME_CONTROLLER)
- {
- if(track->type() == Track::DRUM)
- {
- ctl = event.dataA();
- // Regardless of what port the event came from, is it a drum controller event
- // according to the track port's instrument?
- mc = tport->drumController(ctl);
- if(mc)
+ // Shall we activate meters even while rec echo is off? Sure, why not...
+ if(event.isNote() && event.dataB() > track->activity())
+ track->setActivity(event.dataB());
+ }
+
+ // If syncing externally the event time is already in units of ticks, set above. p3.3.25
+ if(!extsync)
+ event.setTime(tempomap.frame2tick(event.time())); // set tick time
+
+ // Special handling of events stored in rec-lists. a bit hACKish. TODO: Clean up (after 0.7)! :-/ (ml)
+ if (recording)
+ {
+ // In these next steps, it is essential to set the recorded event's port
+ // to the track port so buildMidiEventList will accept it. Even though
+ // the port may have no device "<none>".
+ //
+ if (track->type() == Track::DRUM)
{
- int pitch = ctl & 0x7f;
- ctl &= ~0xff;
- int dmindex = drumInmap[pitch] & 0x7f;
- //Map note that is played according to drumInmap
- drumRecPitch = drumMap[dmindex].enote;
- devport = drumMap[dmindex].port;
- event.setPort(devport);
- channel = drumMap[dmindex].channel;
- event.setA(ctl | drumMap[dmindex].anote);
- event.setChannel(channel);
- }
- }
- }
-
- // p3.3.25
- // MusE uses a fixed clocks per quarternote of 24.
- // At standard 384 ticks per quarternote for example,
- // 384/24=16 for a division of 16 sub-frames (16 MusE 'ticks').
- // That is what we'll use if syncing externally.
- //unsigned time = event.time() + segmentSize*(segmentCount-1);
- //unsigned time = event.time() + (extsync ? config.division/24 : segmentSize*(segmentCount-1));
- // p3.3.34
- // Oops, use the current tick.
- //unsigned time = extsync ? curTickPos : (event.time() + segmentSize*(segmentCount-1));
- //event.setTime(time);
- // p3.3.35
- // If ext sync, events are now time-stamped with last tick in MidiDevice::recordEvent().
- // TODO: Tested, but record resolution not so good. Switch to wall clock based separate list in MidiDevice.
- // p3.3.36
- //if(!extsync)
- // event.setTime(event.time() + segmentSize*(segmentCount-1));
-
- // dont't echo controller changes back to software
- // synthesizer:
-
- if (!dev->isSynti())
- {
- //Check if we're outputting to another port than default:
- if (devport == defaultPort) {
- event.setPort(port);
- if(md && track->recEcho())
- playEvents->add(event);
- }
- else {
- // Hmm, this appears to work, but... Will this induce trouble with md->setNextPlayEvent??
- MidiDevice* mdAlt = midiPorts[devport].device();
- if(mdAlt && track->recEcho())
- mdAlt->playEvents()->add(event);
- }
- // Shall we activate meters even while rec echo is off? Sure, why not...
- if(event.isNote() && event.dataB() > track->activity())
- track->setActivity(event.dataB());
- }
-
- // p3.3.25
- // If syncing externally the event time is already in units of ticks, set above.
- if(!extsync)
- {
- // p3.3.35
- //time = tempomap.frame2tick(event.time());
- //event.setTime(time); // set tick time
- event.setTime(tempomap.frame2tick(event.time())); // set tick time
- }
-
- // Special handling of events stored in rec-lists. a bit hACKish. TODO: Clean up (after 0.7)! :-/ (ml)
- if (recording)
- {
- // In these next steps, it is essential to set the recorded event's port
- // to the track port so buildMidiEventList will accept it. Even though
- // the port may have no device "<none>".
- //
- if (track->type() == Track::DRUM)
- {
- // Is it a drum controller event?
- if(mc)
- {
- MidiPlayEvent drumRecEvent = event;
- drumRecEvent.setA(ctl | drumRecPitch);
- // In this case, preVelo is simply the controller value.
- drumRecEvent.setB(preVelo);
- drumRecEvent.setPort(port); //rec-event to current port
- drumRecEvent.setChannel(track->outChannel()); //rec-event to current channel
- rl->add(drumRecEvent);
- }
- else
- {
-
- MidiPlayEvent drumRecEvent = event;
- drumRecEvent.setA(drumRecPitch);
- drumRecEvent.setB(preVelo);
- // Changed by T356.
- // Tested: Events were not being recorded for a drum map entry pointing to a
- // different port. This must have been wrong - buildMidiEventList would ignore this.
- //drumRecEvent.setPort(devport);
- drumRecEvent.setPort(port); //rec-event to current port
-
- drumRecEvent.setChannel(track->outChannel()); //rec-event to current channel
- rl->add(drumRecEvent);
- }
+ // Is it a drum controller event?
+ if(mc)
+ {
+ MidiPlayEvent drumRecEvent = event;
+ drumRecEvent.setA(ctl | drumRecPitch);
+ // In this case, preVelo is simply the controller value.
+ drumRecEvent.setB(preVelo);
+ drumRecEvent.setPort(port); //rec-event to current port
+ drumRecEvent.setChannel(track->outChannel()); //rec-event to current channel
+ rl->add(drumRecEvent);
}
- else
+ else
{
- // Restore record-pitch to non-transposed value since we don't want the note transposed twice next
- MidiPlayEvent recEvent = event;
- if (prePitch)
- recEvent.setA(prePitch);
- if (preVelo)
- recEvent.setB(preVelo);
- recEvent.setPort(port);
- recEvent.setChannel(track->outChannel());
-
- rl->add(recEvent);
- }
- }
+ MidiPlayEvent drumRecEvent = event;
+ drumRecEvent.setA(drumRecPitch);
+ drumRecEvent.setB(preVelo);
+ // Tested: Events were not being recorded for a drum map entry pointing to a
+ // different port. This must have been wrong - buildMidiEventList would ignore this. Tim.
+ //drumRecEvent.setPort(devport);
+ drumRecEvent.setPort(port); //rec-event to current port
+
+ drumRecEvent.setChannel(track->outChannel()); //rec-event to current channel
+ rl->add(drumRecEvent);
+ }
+ }
+ else
+ {
+ // Restore record-pitch to non-transposed value since we don't want the note transposed twice next
+ MidiPlayEvent recEvent = event;
+ if (prePitch)
+ recEvent.setA(prePitch);
+ if (preVelo)
+ recEvent.setB(preVelo);
+ recEvent.setPort(port);
+ recEvent.setChannel(track->outChannel());
+
+ rl->add(recEvent);
+ }
+ }
}
- }
}
}
}
- // Added by Tim. p3.3.8
- // Removed p4.0.15
- ///if(md)
- /// md->setNextPlayEvent(playEvents->begin());
- //if(md)
- //{
- // if(md->nextPlayEvent() != playEvents->begin())
- // printf("Audio::processMidi md->nextPlayEvent() != playEvents->begin()\n");
- //}
}
- //
- // clear all recorded events in midiDevices
- // process stuck notes
- //
- for (iMidiDevice id = midiDevices.begin(); id != midiDevices.end(); ++id) {
- MidiDevice* md = *id;
-
- ///md->recordEvents()->clear();
- // By T356. Done processing this rec buffer, now flip to the other one.
- ///md->flipRecBuffer();
- // We are done with the 'frozen' recording fifos, remove the events.
- md->afterProcess();
-
- MPEventList* stuckNotes = md->stuckNotes();
- MPEventList* playEvents = md->playEvents();
-
- iMPEvent k;
- for (k = stuckNotes->begin(); k != stuckNotes->end(); ++k) {
- if (k->time() >= nextTickPos)
- break;
- MidiPlayEvent ev(*k);
-
- // p3.3.25
- //int frame = tempomap.tick2frame(k->time()) + frameOffset;
- if(extsync)
- {
- ev.setTime(k->time());
- }
- else
- {
- int frame = tempomap.tick2frame(k->time()) + frameOffset;
- ev.setTime(frame);
- }
-
- // p3.3.25
- //ev.setTime(frame);
-
- playEvents->add(ev);
- }
- stuckNotes->erase(stuckNotes->begin(), k);
- // Removed p4.0.15 Tim.
- ///md->setNextPlayEvent(playEvents->begin());
- //if(md->nextPlayEvent() != playEvents->begin())
- // printf("Audio::processMidi clear notes: md->nextPlayEvent() != playEvents->begin()\n");
- }
-
//---------------------------------------------------
// insert metronome clicks
//---------------------------------------------------
MidiDevice* md = 0;
- if (midiClickFlag)
- md = midiPorts[clickPort].device();
+ if (MusEGlobal::midiClickFlag)
+ md = midiPorts[MusEGlobal::clickPort].device();
if (song->click() && (isPlaying() || state == PRECOUNT)) {
- MPEventList* playEvents = 0;
- MPEventList* stuckNotes = 0;
- if (md) {
- playEvents = md->playEvents();
- stuckNotes = md->stuckNotes();
- }
int bar, beat;
unsigned tick;
bool isMeasure = false;
while (midiClick < nextTickPos) {
if (isPlaying()) {
- ///sigmap.tickValues(midiClick, &bar, &beat, &tick);
AL::sigmap.tickValues(midiClick, &bar, &beat, &tick);
isMeasure = beat == 0;
}
else if (state == PRECOUNT) {
isMeasure = (clickno % clicksMeasure) == 0;
}
- // p3.3.25
//int frame = tempomap.tick2frame(midiClick) + frameOffset;
- int evtime = extsync ? midiClick : tempomap.tick2frame(midiClick) + frameOffset;
+ int evtime = extsync ? midiClick : tempomap.tick2frame(midiClick) + frameOffset; // p3.3.25
- // p3.3.25
- //MidiPlayEvent ev(frame, clickPort, clickChan, ME_NOTEON,
- MidiPlayEvent ev(evtime, clickPort, clickChan, ME_NOTEON,
- beatClickNote, beatClickVelo);
-
if (md) {
- // p3.3.25
- //MidiPlayEvent ev(frame, clickPort, clickChan, ME_NOTEON,
- MidiPlayEvent ev(evtime, clickPort, clickChan, ME_NOTEON,
- beatClickNote, beatClickVelo);
+ //MidiPlayEvent ev(frame, MusEGlobal::clickPort, MusEGlobal::clickChan, ME_NOTEON,
+ MidiPlayEvent ev(evtime, MusEGlobal::clickPort, MusEGlobal::clickChan, ME_NOTEON,
+ MusEGlobal::beatClickNote, MusEGlobal::beatClickVelo);
if (isMeasure) {
- ev.setA(measureClickNote);
- ev.setB(measureClickVelo);
+ ev.setA(MusEGlobal::measureClickNote);
+ ev.setB(MusEGlobal::measureClickVelo);
}
- playEvents->add(ev);
- }
- if (audioClickFlag) {
- // p3.3.25
- //MidiPlayEvent ev1(frame, 0, 0, ME_NOTEON, 0, 0);
- MidiPlayEvent ev1(evtime, 0, 0, ME_NOTEON, 0, 0);
+ md->addScheduledEvent(ev);
- ev1.setA(isMeasure ? 0 : 1);
- metronome->playEvents()->add(ev1);
- }
- if (md) {
ev.setB(0);
- // p3.3.25
- // Removed. Why was this here?
- //frame = tempomap.tick2frame(midiClick+20) + frameOffset;
- //
- // Does it mean this should be changed too?
- // No, stuck notes are in units of ticks, not frames like (normal, non-external) play events...
ev.setTime(midiClick+10);
-
- if (md)
- stuckNotes->add(ev);
+ md->addStuckNote(ev);
+ }
+ if (MusEGlobal::audioClickFlag) {
+ //MidiPlayEvent ev1(frame, 0, 0, ME_NOTEON, 0, 0);
+ MidiPlayEvent ev(evtime, 0, 0, ME_NOTEON, 0, 0);
+ ev.setA(isMeasure ? 0 : 1);
+ metronome->addScheduledEvent(ev);
+ // Built-in metronome synth does not use stuck notes...
}
-
if (isPlaying())
- ///midiClick = sigmap.bar2tick(bar, beat+1, 0);
midiClick = AL::sigmap.bar2tick(bar, beat+1, 0);
else if (state == PRECOUNT) {
midiClick += ticksBeat;
@@ -1423,94 +1173,21 @@ void Audio::processMidi()
state = START_PLAY;
}
}
- // Removed p4.0.15 Tim.
- ///if (md)
- /// md->setNextPlayEvent(playEvents->begin());
- //if(md)
- //{
- // if(md->nextPlayEvent() != playEvents->begin())
- // printf("Audio::processMidi metronome: md->nextPlayEvent() != playEvents->begin()\n");
- //}
-
- // Removed p4.0.15 Tim.
- ///if (audioClickFlag)
- /// metronome->setNextPlayEvent(metronome->playEvents()->begin());
- //if(audioClickFlag)
- //{
- // if(metronome->nextPlayEvent() != metronome->playEvents()->begin())
- // printf("Audio::processMidi metronome: metronome->nextPlayEvent() != metronome->playEvents->begin()\n");
- //}
-
- }
-
- if (state == STOP) {
- //---------------------------------------------------
- // end all notes
- //---------------------------------------------------
-
- for (iMidiDevice imd = midiDevices.begin(); imd != midiDevices.end(); ++imd) {
- MidiDevice* md = *imd;
- MPEventList* playEvents = md->playEvents();
- MPEventList* stuckNotes = md->stuckNotes();
- for (iMPEvent k = stuckNotes->begin(); k != stuckNotes->end(); ++k) {
- MidiPlayEvent ev(*k);
- ev.setTime(0); // play now
- playEvents->add(ev);
- }
- stuckNotes->clear();
- }
}
-
-
- // p3.3.36
- //int tickpos = audio->tickPos();
- //bool extsync = extSyncFlag.value();
+
//
- // Special for Jack midi devices: Play all Jack midi events up to curFrame.
+ // Play all midi events up to curFrame.
//
for(iMidiDevice id = midiDevices.begin(); id != midiDevices.end(); ++id)
{
- //MidiDevice* md = *id;
- // Is it a Jack midi device?
- //MidiJackDevice* mjd = dynamic_cast<MidiJackDevice*>(md);
- //if(!mjd)
- // continue;
- //mjd->processMidi();
- (*id)->processMidi();
+ // We are done with the 'frozen' recording fifos, remove the events.
+ (*id)->afterProcess(); // p4.0.34
- /*
- int port = md->midiPort();
- MidiPort* mp = port != -1 ? &midiPorts[port] : 0;
- MPEventList* el = md->playEvents();
- if (el->empty())
- continue;
- iMPEvent i = md->nextPlayEvent();
- for(; i != el->end(); ++i)
- {
- // If syncing to external midi sync, we cannot use the tempo map.
- // Therefore we cannot get sub-tick resolution. Just use ticks instead of frames.
- //if(i->time() > curFrame)
- if(i->time() > (extsync ? tickpos : curFrame))
- {
- //printf(" curT %d frame %d\n", i->time(), curFrame);
- break; // skip this event
- }
-
- if(mp)
- {
- if(mp->sendEvent(*i))
- break;
- }
- else
- {
- if(md->putEvent(*i))
- break;
- }
- }
- md->setNextPlayEvent(i);
- */
+ // ALSA devices handled by another thread.
+ if((*id)->deviceType() != MidiDevice::ALSA_MIDI)
+ //if((*id)->deviceType() == MidiDevice::JACK_MIDI)
+ (*id)->processMidi();
}
-
midiBusy=false;
}
diff --git a/muse2/muse/midi.h b/muse2/muse/midi.h
index 8250a0e3..f137d7e5 100644
--- a/muse2/muse/midi.h
+++ b/muse2/muse/midi.h
@@ -4,6 +4,22 @@
// $Id: midi.h,v 1.4.2.2 2009/11/09 20:28:28 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDI_H__
@@ -71,7 +87,6 @@ QString midiMetaName(int);
class EventList;
class MPEventList;
class MidiTrack;
-//extern void buildMidiEventList(EventList* mel, const MPEventList* el, MidiTrack* track, int division, bool);
extern void buildMidiEventList(EventList* mel, const MPEventList* el, MidiTrack* track, int division, bool /*addSysexMeta*/, bool /*doLoops*/);
// extern bool checkSysex(MidiTrack* track, unsigned int len, unsigned char* buf);
diff --git a/muse2/muse/midictrl.cpp b/muse2/muse/midictrl.cpp
index 4cf1886a..d7cf1230 100644
--- a/muse2/muse/midictrl.cpp
+++ b/muse2/muse/midictrl.cpp
@@ -4,6 +4,21 @@
// $Id: midictrl.cpp,v 1.17.2.10 2009/06/10 00:34:59 terminator356 Exp $
//
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <assert.h>
@@ -788,7 +803,7 @@ void MidiCtrlValList::delMCtlVal(int tick, Part* part)
{
iMidiCtrlVal e = findMCtlVal(tick, part);
if (e == end()) {
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MidiCtrlValList::delMCtlVal(%d): not found (size %zd)\n", tick, size());
return;
}
diff --git a/muse2/muse/midictrl.h b/muse2/muse/midictrl.h
index 3b18ba91..8f3c9d16 100644
--- a/muse2/muse/midictrl.h
+++ b/muse2/muse/midictrl.h
@@ -4,6 +4,21 @@
// $Id: midictrl.h,v 1.16.2.8 2009/11/25 09:09:43 terminator356 Exp $
//
// (C) Copyright 1999-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDICTRL_H__
diff --git a/muse2/muse/mididev.cpp b/muse2/muse/mididev.cpp
index b13f571b..a06303e1 100644
--- a/muse2/muse/mididev.cpp
+++ b/muse2/muse/mididev.cpp
@@ -4,6 +4,22 @@
// $Id: mididev.cpp,v 1.10.2.6 2009/11/05 03:14:35 terminator356 Exp $
//
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <config.h>
@@ -133,10 +149,10 @@ bool filterEvent(const MEvent& event, int type, bool thru)
case ME_CONTROLLER:
if (type & MIDI_FILTER_CTRL)
return true;
- if (!thru && (midiFilterCtrl1 == event.dataA()
- || midiFilterCtrl2 == event.dataA()
- || midiFilterCtrl3 == event.dataA()
- || midiFilterCtrl4 == event.dataA())) {
+ if (!thru && (MusEGlobal::midiFilterCtrl1 == event.dataA()
+ || MusEGlobal::midiFilterCtrl2 == event.dataA()
+ || MusEGlobal::midiFilterCtrl3 == event.dataA()
+ || MusEGlobal::midiFilterCtrl4 == event.dataA())) {
return true;
}
break;
@@ -254,7 +270,7 @@ void MidiDevice::recordEvent(MidiRecordEvent& event)
if(audio->isPlaying())
event.setLoopNum(audio->loopCount());
- if (midiInputTrace) {
+ if (MusEGlobal::midiInputTrace) {
printf("MidiInput: ");
event.dump();
}
@@ -313,11 +329,11 @@ void MidiDevice::recordEvent(MidiRecordEvent& event)
processMidiInputTransformPlugins(event);
- if (filterEvent(event, midiRecordType, false))
+ if (filterEvent(event, MusEGlobal::midiRecordType, false))
return;
if (!applyMidiInputTransformation(event)) {
- if (midiInputTrace)
+ if (MusEGlobal::midiInputTrace)
printf(" midi input transformation: event filtered\n");
return;
}
@@ -581,6 +597,34 @@ bool MidiDevice::putEvent(const MidiPlayEvent& ev)
}
//---------------------------------------------------------
+// processStuckNotes
+//---------------------------------------------------------
+
+void MidiDevice::processStuckNotes()
+{
+ // Must be playing for valid nextTickPos, right? But wasn't checked in Audio::processMidi().
+ // audio->isPlaying() might not be true during seek right now.
+ //if(audio->isPlaying())
+ {
+ bool extsync = extSyncFlag.value();
+ int frameOffset = audio->getFrameOffset();
+ unsigned nextTick = audio->nextTick();
+ iMPEvent k;
+ for (k = _stuckNotes.begin(); k != _stuckNotes.end(); ++k) {
+ if (k->time() >= nextTick)
+ break;
+ MidiPlayEvent ev(*k);
+ if(extsync) // p3.3.25
+ ev.setTime(k->time());
+ else
+ ev.setTime(tempomap.tick2frame(k->time()) + frameOffset);
+ _playEvents.add(ev);
+ }
+ _stuckNotes.erase(_stuckNotes.begin(), k);
+ }
+}
+
+//---------------------------------------------------------
// handleStop
//---------------------------------------------------------
@@ -647,7 +691,7 @@ void MidiDevice::handleStop()
// (Could try now that this is in MidiDevice. p4.0.22 )
/*
if(!si.sendContNotStart())
- mp->sendSongpos(audio->tickPos() * 4 / config.division);
+ mp->sendSongpos(audio->tickPos() * 4 / MusEConfig::config.division);
*/
}
}
@@ -738,7 +782,7 @@ void MidiDevice::handleSeek()
//if(port < -1 || port > MIDI_PORTS)
// continue;
- int beat = (pos * 4) / config.division;
+ int beat = (pos * 4) / MusEConfig::config.division;
//bool isPlaying = false;
//if(state == PLAY)
diff --git a/muse2/muse/mididev.h b/muse2/muse/mididev.h
index 7de016b1..cdb69ea2 100644
--- a/muse2/muse/mididev.h
+++ b/muse2/muse/mididev.h
@@ -4,6 +4,22 @@
// $Id: mididev.h,v 1.3.2.4 2009/04/04 01:49:50 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Tim E. Real (terminator356 on users dot sourceforge dot net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDIDEV_H__
@@ -26,8 +42,8 @@ class Xml;
//---------------------------------------------------------
class MidiDevice {
- MPEventList _stuckNotes;
- MPEventList _playEvents;
+ //MPEventList _stuckNotes;
+ //MPEventList _playEvents;
// Removed p4.0.15 Tim.
//iMPEvent _nextPlayEvent;
@@ -56,6 +72,9 @@ class MidiDevice {
//bool _sysexWritingChunks;
bool _sysexReadingChunks;
+ MPEventList _stuckNotes;
+ MPEventList _playEvents;
+
// Fifo for midi events sent from gui direct to midi port:
MidiFifo eventFifo; // p4.0.15
@@ -69,6 +88,7 @@ class MidiDevice {
void init();
virtual bool putMidiEvent(const MidiPlayEvent&) = 0;
+ virtual void processStuckNotes();
public:
enum { ALSA_MIDI=0, JACK_MIDI=1, SYNTH_MIDI=2 };
@@ -115,21 +135,24 @@ class MidiDevice {
virtual void recordEvent(MidiRecordEvent&);
+ // Schedule an event for playback. Returns false if event cannot be delivered.
+ virtual bool addScheduledEvent(const MidiPlayEvent& ev) { _playEvents.add(ev); return true; }
+ // Add a stuck note. Returns false if event cannot be delivered.
+ virtual bool addStuckNote(const MidiPlayEvent& ev) { _stuckNotes.add(ev); return true; }
+ // Put an event for immediate playback.
virtual bool putEvent(const MidiPlayEvent&);
// This method will try to putEvent 'tries' times, waiting 'delayUs' microseconds between tries.
// Since it waits, it should not be used in RT or other time-sensitive threads. p4.0.15
bool putEventWithRetry(const MidiPlayEvent&, int /*tries*/ = 2, long /*delayUs*/ = 50000); // 2 tries, 50 mS by default.
- // p4.0.22
- virtual void handleStop();
+ virtual void handleStop(); // p4.0.22
virtual void handleSeek();
- // For Jack-based devices - called in Jack audio process callback
virtual void collectMidiEvents() {}
virtual void processMidi() {}
- MPEventList* stuckNotes() { return &_stuckNotes; }
- MPEventList* playEvents() { return &_playEvents; }
+ //MPEventList* stuckNotes() { return &_stuckNotes; }
+ //MPEventList* playEvents() { return &_playEvents; }
///MREventList* recordEvents();
///void flipRecBuffer() { _recBufFlipped = _recBufFlipped ? false : true; }
diff --git a/muse2/muse/midiedit/CMakeLists.txt b/muse2/muse/midiedit/CMakeLists.txt
index 9c3441e9..be50504a 100644
--- a/muse2/muse/midiedit/CMakeLists.txt
+++ b/muse2/muse/midiedit/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/midiedit/cmd.h b/muse2/muse/midiedit/cmd.h
index b72166b1..75910718 100644
--- a/muse2/muse/midiedit/cmd.h
+++ b/muse2/muse/midiedit/cmd.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: cmd.h,v 1.1.1.1 2003/10/27 18:52:20 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CMD_H__
diff --git a/muse2/muse/midiedit/dcanvas.cpp b/muse2/muse/midiedit/dcanvas.cpp
index 6abaaa51..783a72f5 100644
--- a/muse2/muse/midiedit/dcanvas.cpp
+++ b/muse2/muse/midiedit/dcanvas.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: dcanvas.cpp,v 1.16.2.10 2009/10/15 22:45:50 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QPainter>
@@ -100,7 +115,7 @@ DrumCanvas::DrumCanvas(MidiEditor* pr, QWidget* parent, int sx,
// moveCanvasItems
//---------------------------------------------------------
-Undo DrumCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtype)
+Undo DrumCanvas::moveCanvasItems(MusEWidget::CItemList& items, int dp, int dx, DragType dtype)
{
if(editor->parts()->empty())
return Undo(); //return empty list
@@ -115,9 +130,9 @@ Undo DrumCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtyp
continue;
int npartoffset = 0;
- for(iCItem ici = items.begin(); ici != items.end(); ++ici)
+ for(MusEWidget::iCItem ici = items.begin(); ici != items.end(); ++ici)
{
- CItem* ci = ici->second;
+ MusEWidget::CItem* ci = ici->second;
if(ci->part() != part)
continue;
@@ -168,12 +183,12 @@ Undo DrumCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtyp
if (!forbidden)
{
- std::vector< CItem* > doneList;
- typedef std::vector< CItem* >::iterator iDoneList;
+ std::vector< MusEWidget::CItem* > doneList;
+ typedef std::vector< MusEWidget::CItem* >::iterator iDoneList;
- for(iCItem ici = items.begin(); ici != items.end(); ++ici)
+ for(MusEWidget::iCItem ici = items.begin(); ici != items.end(); ++ici)
{
- CItem* ci = ici->second;
+ MusEWidget::CItem* ci = ici->second;
int x = ci->pos().x();
int y = ci->pos().y();
@@ -223,7 +238,7 @@ Undo DrumCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtyp
// moveItem
//---------------------------------------------------------
-UndoOp DrumCanvas::moveItem(CItem* item, const QPoint& pos, DragType dtype)
+UndoOp DrumCanvas::moveItem(MusEWidget::CItem* item, const QPoint& pos, DragType dtype)
{
DEvent* nevent = (DEvent*) item;
@@ -257,7 +272,7 @@ UndoOp DrumCanvas::moveItem(CItem* item, const QPoint& pos, DragType dtype)
// newItem
//---------------------------------------------------------
-CItem* DrumCanvas::newItem(const QPoint& p, int state)
+MusEWidget::CItem* DrumCanvas::newItem(const QPoint& p, int state)
{
int instr = y2pitch(p.y()); //drumInmap[y2pitch(p.y())];
int velo = drumMap[instr].lv4;
@@ -275,7 +290,7 @@ CItem* DrumCanvas::newItem(const QPoint& p, int state)
// newItem
//---------------------------------------------------------
-CItem* DrumCanvas::newItem(int tick, int instrument, int velocity)
+MusEWidget::CItem* DrumCanvas::newItem(int tick, int instrument, int velocity)
{
tick -= curPart->tick();
Event e(Note);
@@ -290,7 +305,7 @@ CItem* DrumCanvas::newItem(int tick, int instrument, int velocity)
// resizeItem
//---------------------------------------------------------
-void DrumCanvas::resizeItem(CItem* item, bool, bool)
+void DrumCanvas::resizeItem(MusEWidget::CItem* item, bool, bool)
{
DEvent* nevent = (DEvent*) item;
Event ev = nevent->event();
@@ -301,11 +316,11 @@ void DrumCanvas::resizeItem(CItem* item, bool, bool)
//---------------------------------------------------------
// newItem
//---------------------------------------------------------
-void DrumCanvas::newItem(CItem* item, bool noSnap) {
+void DrumCanvas::newItem(MusEWidget::CItem* item, bool noSnap) {
newItem(item, noSnap,false);
}
-void DrumCanvas::newItem(CItem* item, bool noSnap, bool replace)
+void DrumCanvas::newItem(MusEWidget::CItem* item, bool noSnap, bool replace)
{
DEvent* nevent = (DEvent*) item;
Event event = nevent->event();
@@ -366,7 +381,7 @@ void DrumCanvas::newItem(CItem* item, bool noSnap, bool replace)
// deleteItem
//---------------------------------------------------------
-bool DrumCanvas::deleteItem(CItem* item)
+bool DrumCanvas::deleteItem(MusEWidget::CItem* item)
{
Event ev = ((DEvent*)item)->event();
// Indicate do undo, and do not do port controller values and clone parts.
@@ -378,7 +393,7 @@ bool DrumCanvas::deleteItem(CItem* item)
// drawItem
//---------------------------------------------------------
-void DrumCanvas::drawItem(QPainter&p, const CItem*item, const QRect& rect)
+void DrumCanvas::drawItem(QPainter&p, const MusEWidget::CItem*item, const QRect& rect)
{
DEvent* e = (DEvent*) item;
int x = 0, y = 0;
@@ -436,7 +451,7 @@ void DrumCanvas::drawItem(QPainter&p, const CItem*item, const QRect& rect)
// draws moving items
//---------------------------------------------------------
-void DrumCanvas::drawMoving(QPainter& p, const CItem* item, const QRect& rect)
+void DrumCanvas::drawMoving(QPainter& p, const MusEWidget::CItem* item, const QRect& rect)
{
QPolygon pa(4);
QPoint pt = map(item->mp());
@@ -489,7 +504,7 @@ void DrumCanvas::drawCanvas(QPainter& p, const QRect& rect)
void DrumCanvas::drawTopItem(QPainter& p, const QRect&)
{
// draw cursor
- if (_tool == CursorTool) {
+ if (_tool == MusEWidget::CursorTool) {
p.setPen(Qt::black);
int y = mapy(TH * cursorPos.y());
@@ -528,7 +543,7 @@ void DrumCanvas::cmd(int cmd)
{
switch (cmd) {
case CMD_SELECT_ALL: // select all
- for (iCItem k = items.begin(); k != items.end(); ++k) {
+ for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) {
if (!k->second->isSelected())
selectItem(k->second, true);
}
@@ -537,12 +552,12 @@ void DrumCanvas::cmd(int cmd)
deselectAll();
break;
case CMD_SELECT_INVERT: // invert selection
- for (iCItem k = items.begin(); k != items.end(); ++k) {
+ for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) {
selectItem(k->second, !k->second->isSelected());
}
break;
case CMD_SELECT_ILOOP: // select inside loop
- for (iCItem k = items.begin(); k != items.end(); ++k) {
+ for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) {
DEvent* nevent =(DEvent*)(k->second);
Part* part = nevent->part();
Event event = nevent->event();
@@ -554,7 +569,7 @@ void DrumCanvas::cmd(int cmd)
}
break;
case CMD_SELECT_OLOOP: // select outside loop
- for (iCItem k = items.begin(); k != items.end(); ++k) {
+ for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) {
DEvent* nevent = (DEvent*)(k->second);
Part* part = nevent->part();
Event event = nevent->event();
@@ -611,7 +626,7 @@ void DrumCanvas::cmd(int cmd)
if (!selectionSize())
break;
song->startUndo();
- for (iCItem k = items.begin(); k != items.end(); ++k) {
+ for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) {
if (k->second->isSelected()) {
DEvent* devent = (DEvent*)(k->second);
Event event = devent->event();
@@ -670,7 +685,7 @@ void DrumCanvas::cmd(int cmd)
// startDrag
//---------------------------------------------------------
-void DrumCanvas::startDrag(CItem* /* item*/, bool copymode)
+void DrumCanvas::startDrag(MusEWidget::CItem* /* item*/, bool copymode)
{
QMimeData* md = selected_events_to_mime(partlist_to_set(editor->parts()), 1);
@@ -730,7 +745,7 @@ void DrumCanvas::keyPressed(int index, int velocity)
audio->msgPlayMidiEvent(&e);
if (_steprec && pos[0] >= start_tick /* && pos[0] < end_tick [removed by flo93: this is handled in steprec->record] */ && curPart)
- steprec->record(curPart,index,drumMap[index].len,editor->raster(),velocity,globalKeyState&Qt::ControlModifier,globalKeyState&Qt::ShiftModifier);
+ steprec->record(curPart,index,drumMap[index].len,editor->raster(),velocity,MusEGlobal::globalKeyState&Qt::ControlModifier,MusEGlobal::globalKeyState&Qt::ShiftModifier);
}
@@ -851,11 +866,11 @@ void DrumCanvas::resizeEvent(QResizeEvent* ev)
// modifySelected
//---------------------------------------------------------
-void DrumCanvas::modifySelected(NoteInfo::ValType type, int delta)
+void DrumCanvas::modifySelected(MusEWidget::NoteInfo::ValType type, int delta)
{
audio->msgIdle(true);
song->startUndo();
- for (iCItem i = items.begin(); i != items.end(); ++i) {
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) {
if (!(i->second->isSelected()))
continue;
DEvent* e = (DEvent*)(i->second);
@@ -867,7 +882,7 @@ void DrumCanvas::modifySelected(NoteInfo::ValType type, int delta)
Event newEvent = event.clone();
switch (type) {
- case NoteInfo::VAL_TIME:
+ case MusEWidget::NoteInfo::VAL_TIME:
{
int newTime = event.tick() + delta;
if (newTime < 0)
@@ -875,16 +890,16 @@ void DrumCanvas::modifySelected(NoteInfo::ValType type, int delta)
newEvent.setTick(newTime);
}
break;
- case NoteInfo::VAL_LEN:
- printf("DrumCanvas::modifySelected - NoteInfo::VAL_LEN not implemented\n");
+ case MusEWidget::NoteInfo::VAL_LEN:
+ printf("DrumCanvas::modifySelected - MusEWidget::NoteInfo::VAL_LEN not implemented\n");
break;
- case NoteInfo::VAL_VELON:
- printf("DrumCanvas::modifySelected - NoteInfo::VAL_VELON not implemented\n");
+ case MusEWidget::NoteInfo::VAL_VELON:
+ printf("DrumCanvas::modifySelected - MusEWidget::NoteInfo::VAL_VELON not implemented\n");
break;
- case NoteInfo::VAL_VELOFF:
- printf("DrumCanvas::modifySelected - NoteInfo::VAL_VELOFF not implemented\n");
+ case MusEWidget::NoteInfo::VAL_VELOFF:
+ printf("DrumCanvas::modifySelected - MusEWidget::NoteInfo::VAL_VELOFF not implemented\n");
break;
- case NoteInfo::VAL_PITCH:
+ case MusEWidget::NoteInfo::VAL_PITCH:
{
int pitch = event.pitch() - delta; // Reversing order since the drumlist is displayed in increasing order
if (pitch > 127)
@@ -940,7 +955,7 @@ int DrumCanvas::getNextStep(unsigned int pos, int basicStep, int stepSize)
//---------------------------------------------------------
void DrumCanvas::keyPress(QKeyEvent* event)
{
- if (_tool == CursorTool) {
+ if (_tool == MusEWidget::CursorTool) {
int key = event->key();
if (((QInputEvent*)event)->modifiers() & Qt::ShiftModifier)
@@ -1019,7 +1034,7 @@ void DrumCanvas::keyPress(QKeyEvent* event)
//---------------------------------------------------------
void DrumCanvas::setTool2(int)
{
- if (_tool == CursorTool)
+ if (_tool == MusEWidget::CursorTool)
deselectAll();
if (unsigned(cursorPos.x()) < curPart->tick())
cursorPos.setX(curPart->tick());
@@ -1047,7 +1062,7 @@ void DrumCanvas::setStep(int v)
//---------------------------------------------------------
Event *DrumCanvas::getEventAtCursorPos()
{
- if (_tool != CursorTool)
+ if (_tool != MusEWidget::CursorTool)
return 0;
EventList* el = curPart->events();
iEvent lower = el->lower_bound(cursorPos.x()-curPart->tick());
@@ -1067,7 +1082,7 @@ Event *DrumCanvas::getEventAtCursorPos()
//---------------------------------------------------------
void DrumCanvas::selectCursorEvent(Event *ev)
{
- for (iCItem i = items.begin(); i != items.end(); ++i)
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i)
{
Event e = i->second->event();
@@ -1086,7 +1101,7 @@ void DrumCanvas::moveAwayUnused()
using std::set;
set<int> used;
- for (iCItem it=items.begin(); it!=items.end(); it++)
+ for (MusEWidget::iCItem it=items.begin(); it!=items.end(); it++)
{
const Event& ev=it->second->event();
@@ -1114,12 +1129,12 @@ void DrumCanvas::moveAwayUnused()
//---------------------------------------------------------
void DrumCanvas::midiNote(int pitch, int velo)
{
- if (debugMsg) printf("DrumCanvas::midiNote: pitch=%i, velo=%i\n", pitch, velo);
+ if (MusEGlobal::debugMsg) printf("DrumCanvas::midiNote: pitch=%i, velo=%i\n", pitch, velo);
if (_midiin && _steprec && curPart
&& !audio->isPlaying() && velo && pos[0] >= start_tick
/* && pos[0] < end_tick [removed by flo93: this is handled in steprec->record] */
- && !(globalKeyState & Qt::AltModifier)) {
- steprec->record(curPart,drumInmap[pitch],drumMap[(int)drumInmap[pitch]].len,editor->raster(),velo,globalKeyState&Qt::ControlModifier,globalKeyState&Qt::ShiftModifier);
+ && !(MusEGlobal::globalKeyState & Qt::AltModifier)) {
+ steprec->record(curPart,drumInmap[pitch],drumMap[(int)drumInmap[pitch]].len,editor->raster(),velo,MusEGlobal::globalKeyState&Qt::ControlModifier,MusEGlobal::globalKeyState&Qt::ShiftModifier);
}
}
diff --git a/muse2/muse/midiedit/dcanvas.h b/muse2/muse/midiedit/dcanvas.h
index a2d0f7de..0256de01 100644
--- a/muse2/muse/midiedit/dcanvas.h
+++ b/muse2/muse/midiedit/dcanvas.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: dcanvas.h,v 1.8.2.2 2009/02/02 21:38:00 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __DCANVAS_H__
@@ -28,7 +43,7 @@ class MidiEditor;
// ''visual'' Drum Event
//---------------------------------------------------------
-class DEvent : public CItem {
+class DEvent : public MusEWidget::CItem {
public:
DEvent(Event e, Part* p);
};
@@ -51,21 +66,21 @@ class DrumCanvas : public EventCanvas {
virtual void drawCanvas(QPainter&, const QRect&);
- virtual void drawItem(QPainter&, const CItem*, const QRect&);
+ virtual void drawItem(QPainter&, const MusEWidget::CItem*, const QRect&);
void drawTopItem(QPainter& p, const QRect& rect);
- virtual void drawMoving(QPainter&, const CItem*, const QRect&);
- virtual Undo moveCanvasItems(CItemList&, int, int, DragType);
- virtual UndoOp moveItem(CItem*, const QPoint&, DragType);
- virtual CItem* newItem(const QPoint&, int);
- virtual void resizeItem(CItem*, bool, bool);
- virtual void newItem(CItem*, bool);
- virtual void newItem(CItem*, bool, bool replace );
- virtual bool deleteItem(CItem*);
- CItem* newItem(int tick, int instrument, int velocity);
+ virtual void drawMoving(QPainter&, const MusEWidget::CItem*, const QRect&);
+ virtual Undo moveCanvasItems(MusEWidget::CItemList&, int, int, DragType);
+ virtual UndoOp moveItem(MusEWidget::CItem*, const QPoint&, DragType);
+ virtual MusEWidget::CItem* newItem(const QPoint&, int);
+ virtual void resizeItem(MusEWidget::CItem*, bool, bool);
+ virtual void newItem(MusEWidget::CItem*, bool);
+ virtual void newItem(MusEWidget::CItem*, bool, bool replace );
+ virtual bool deleteItem(MusEWidget::CItem*);
+ MusEWidget::CItem* newItem(int tick, int instrument, int velocity);
int y2pitch(int y) const;
int pitch2y(int pitch) const;
- void startDrag(CItem*, bool copymode);
+ void startDrag(MusEWidget::CItem*, bool copymode);
void dragEnterEvent(QDragEnterEvent* event);
void dragMoveEvent(QDragMoveEvent*);
void dragLeaveEvent(QDragLeaveEvent*);
@@ -100,7 +115,7 @@ class DrumCanvas : public EventCanvas {
DrumCanvas(MidiEditor*, QWidget*, int, int,
const char* name = 0);
void cmd(int);
- virtual void modifySelected(NoteInfo::ValType type, int delta);
+ virtual void modifySelected(MusEWidget::NoteInfo::ValType type, int delta);
virtual void keyPress(QKeyEvent* event);
Event *getEventAtCursorPos();
void selectCursorEvent(Event *ev);
diff --git a/muse2/muse/midiedit/dlist.cpp b/muse2/muse/midiedit/dlist.cpp
index d2d5659c..165bb4cb 100644
--- a/muse2/muse/midiedit/dlist.cpp
+++ b/muse2/muse/midiedit/dlist.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: dlist.cpp,v 1.9.2.7 2009/10/16 21:50:16 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QCursor>
@@ -75,10 +90,10 @@ void DList::draw(QPainter& p, const QRect& rect)
s.setNum(dm->len);
break;
case COL_ANOTE:
- s = pitch2string(dm->anote);
+ s = pitch2string(dm->anote);
break;
case COL_ENOTE:
- s = pitch2string(dm->enote);
+ s = pitch2string(dm->enote);
break;
case COL_LV1:
s.setNum(dm->lv1);
@@ -724,7 +739,7 @@ void DList::songChanged(int flags)
//---------------------------------------------------------
DList::DList(QHeaderView* h, QWidget* parent, int ymag)
- : View(parent, 1, ymag)
+ : MusEWidget::View(parent, 1, ymag)
{
setBg(Qt::white);
if (!h){
diff --git a/muse2/muse/midiedit/dlist.h b/muse2/muse/midiedit/dlist.h
index 00f21c55..0fb1fd0b 100644
--- a/muse2/muse/midiedit/dlist.h
+++ b/muse2/muse/midiedit/dlist.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: dlist.h,v 1.5.2.3 2009/10/16 21:50:16 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __DLIST_H__
@@ -69,7 +84,7 @@ class DPitchEdit: public Awl::PitchEdit
// DList
//---------------------------------------------------------
-class DList : public View {
+class DList : public MusEWidget::View {
Q_OBJECT
QHeaderView* header;
diff --git a/muse2/muse/midiedit/drumedit.cpp b/muse2/muse/midiedit/drumedit.cpp
index 1553ec2b..a9ba81ef 100644
--- a/muse2/muse/midiedit/drumedit.cpp
+++ b/muse2/muse/midiedit/drumedit.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: drumedit.cpp,v 1.22.2.21 2009/11/16 11:29:33 lunar_shuttle Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QAction>
@@ -67,7 +82,7 @@ int DrumEdit::_dcanvasWidthInit = 300;
static const int xscale = -10;
static const int yscale = 1;
-static const int drumeditTools = PointerTool | PencilTool | RubberTool | CursorTool | DrawTool;
+static const int drumeditTools = MusEWidget::PointerTool | MusEWidget::PencilTool | MusEWidget::RubberTool | MusEWidget::CursorTool | MusEWidget::DrawTool;
enum DrumColumn {
COL_MUTE = 0,
@@ -177,7 +192,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini
signalMapper->setMapping(resetAction, DrumCanvas::CMD_RESET);
menuEdit = menuBar()->addMenu(tr("&Edit"));
- menuEdit->addActions(undoRedo->actions());
+ menuEdit->addActions(MusEGlobal::undoRedo->actions());
menuEdit->addSeparator();
cutAction = menuEdit->addAction(QIcon(*editcutIconSet), tr("Cut"));
@@ -291,7 +306,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini
tools->addAction(QWhatsThis::createAction());
tools->addSeparator();
- tools->addActions(undoRedo->actions());
+ tools->addActions(MusEGlobal::undoRedo->actions());
tools->addSeparator();
srec = new QToolButton();
@@ -307,7 +322,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini
tools->addWidget(midiin);
- tools2 = new EditToolBar(this, drumeditTools);
+ tools2 = new MusEWidget::EditToolBar(this, drumeditTools);
addToolBar(tools2);
QToolBar* cursorToolbar = addToolBar(tr("cursor tools"));
@@ -331,32 +346,32 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini
QToolBar* panicToolbar = addToolBar(tr("panic"));
panicToolbar->setObjectName("panic");
- panicToolbar->addAction(panicAction);
+ panicToolbar->addAction(MusEGlobal::panicAction);
QToolBar* transport = addToolBar(tr("transport"));
transport->setObjectName("transport");
- transport->addActions(transportAction->actions());
+ transport->addActions(MusEGlobal::transportAction->actions());
addToolBarBreak();
// don't show pitch value in toolbar
- toolbar = new Toolbar1(this, _rasterInit, false);
+ toolbar = new MusEWidget::Toolbar1(this, _rasterInit, false);
addToolBar(toolbar);
addToolBarBreak();
- info = new NoteInfo(this);
+ info = new MusEWidget::NoteInfo(this);
addToolBar(info);
//---------------------------------------------------
// split
//---------------------------------------------------
- split1 = new Splitter(Qt::Vertical, mainw, "split1");
+ split1 = new MusEWidget::Splitter(Qt::Vertical, mainw, "split1");
QPushButton* ctrl = new QPushButton(tr("ctrl"), mainw);
ctrl->setObjectName("Ctrl");
- ctrl->setFont(config.fonts[3]);
- //hscroll = new ScrollScale(-25, -2, xscale, 20000, Qt::Horizontal, mainw);
+ ctrl->setFont(MusEConfig::config.fonts[3]);
+ //hscroll = new MusEWidget::ScrollScale(-25, -2, xscale, 20000, Qt::Horizontal, mainw);
// Increased scale to -1. To resolve/select/edit 1-tick-wide (controller graph) events. p4.0.18 Tim.
- hscroll = new ScrollScale(-25, -1, xscale, 20000, Qt::Horizontal, mainw);
+ hscroll = new MusEWidget::ScrollScale(-25, -1, xscale, 20000, Qt::Horizontal, mainw);
ctrl->setFixedSize(40, hscroll->sizeHint().height());
ctrl->setToolTip(tr("Add Controller View"));
@@ -373,7 +388,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini
// mainGrid->addRowSpacing(1, hscroll->sizeHint().height());
// mainGrid->addItem(new QSpacerItem(0, hscroll->sizeHint().height()), 1, 0);
- split2 = new Splitter(Qt::Horizontal, split1, "split2");
+ split2 = new MusEWidget::Splitter(Qt::Horizontal, split1, "split2");
split1w1 = new QWidget(split2);
QWidget* split1w2 = new QWidget(split2);
QGridLayout* gridS1 = new QGridLayout(split1w1);
@@ -382,10 +397,10 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini
gridS1->setSpacing(0);
gridS2->setContentsMargins(0, 0, 0, 0);
gridS2->setSpacing(0);
- time = new MTScale(&_raster, split1w2, xscale);
+ time = new MusEWidget::MTScale(&_raster, split1w2, xscale);
canvas = new DrumCanvas(this, split1w2, xscale, yscale);
- vscroll = new ScrollScale(-4, 1, yscale, DRUM_MAPSIZE*TH, Qt::Vertical, split1w2);
- int offset = -(config.division/4);
+ vscroll = new MusEWidget::ScrollScale(-4, 1, yscale, DRUM_MAPSIZE*TH, Qt::Vertical, split1w2);
+ int offset = -(MusEConfig::config.division/4);
canvas->setOrigin(offset, 0);
canvas->setCanvasTools(drumeditTools);
canvas->setFocus();
@@ -400,20 +415,20 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini
split2->setSizes(mops);
// By T356. Not much choice but to disable this for now, to stop runaway resize bug.
// Can't seem to get the splitter to readjust when manually setting sizes.
- //split2->setResizeMode(split1w1, QSplitter::KeepSize);
+ //split2->setResizeMode(split1w1, QMusEWidget::Splitter::KeepSize);
gridS2->setRowStretch(1, 100);
gridS2->setColumnStretch(0, 100);
gridS2->addWidget(time, 0, 0, 1, 2);
- gridS2->addWidget(hLine(split1w2), 1, 0, 1, 2);
+ gridS2->addWidget(MusEUtil::hLine(split1w2), 1, 0, 1, 2);
gridS2->addWidget(canvas, 2, 0);
gridS2->addWidget(vscroll, 2, 1);
//
// Reihenfolge in dlist.c festgeschrieben ("Dcols")
//
- header = new Header(split1w1, "header");
+ header = new MusEWidget::Header(split1w1, "header");
header->setFixedHeight(31);
header->setColumnLabel(tr("M"), COL_MUTE, 20);
header->setColumnLabel(tr("Sound"), COL_NAME, 120);
@@ -480,7 +495,7 @@ DrumEdit::DrumEdit(PartList* pl, QWidget* parent, const char* name, unsigned ini
connect(time, SIGNAL(timeChanged(unsigned)), SLOT(setTime(unsigned)));
connect(toolbar, SIGNAL(rasterChanged(int)), SLOT(setRaster(int)));
connect(toolbar, SIGNAL(soloChanged(bool)), SLOT(soloChanged(bool)));
- connect(info, SIGNAL(valueChanged(NoteInfo::ValType, int)), SLOT(noteinfoChanged(NoteInfo::ValType, int)));
+ connect(info, SIGNAL(valueChanged(MusEWidget::NoteInfo::ValType, int)), SLOT(noteinfoChanged(MusEWidget::NoteInfo::ValType, int)));
connect(ctrl, SIGNAL(clicked()), SLOT(addCtrl()));
@@ -578,7 +593,7 @@ void DrumEdit::setTime(unsigned tick)
DrumEdit::~DrumEdit()
{
- //undoRedo->removeFrom(tools); // p4.0.6 Removed
+ //MusEGlobal::undoRedo->removeFrom(tools); // p4.0.6 Removed
}
//---------------------------------------------------------
@@ -627,7 +642,7 @@ void DrumEdit::setRaster(int val)
// edit currently selected Event
//---------------------------------------------------------
-void DrumEdit::noteinfoChanged(NoteInfo::ValType type, int val)
+void DrumEdit::noteinfoChanged(MusEWidget::NoteInfo::ValType type, int val)
{
if (selEvent.empty()) {
printf("noteinfoChanged while note is zero %d\n", type);
@@ -635,19 +650,19 @@ void DrumEdit::noteinfoChanged(NoteInfo::ValType type, int val)
}
Event event = selEvent.clone();
switch (type) {
- case NoteInfo::VAL_TIME:
+ case MusEWidget::NoteInfo::VAL_TIME:
event.setTick(val - selPart->tick());
break;
- case NoteInfo::VAL_LEN:
+ case MusEWidget::NoteInfo::VAL_LEN:
event.setLenTick(val);
break;
- case NoteInfo::VAL_VELON:
+ case MusEWidget::NoteInfo::VAL_VELON:
event.setVelo(val);
break;
- case NoteInfo::VAL_VELOFF:
+ case MusEWidget::NoteInfo::VAL_VELOFF:
event.setVeloOff(val);
break;
- case NoteInfo::VAL_PITCH:
+ case MusEWidget::NoteInfo::VAL_PITCH:
event.setPitch(val);
break;
}
@@ -799,13 +814,13 @@ void DrumEdit::writeConfiguration(int level, Xml& xml)
void DrumEdit::load()
{
- //QString fn = getOpenFileName("drummaps", map_file_pattern,
- QString fn = getOpenFileName("drummaps", drum_map_file_pattern,
+ //QString fn = MusEWidget::getOpenFileName("drummaps", map_file_pattern,
+ QString fn = MusEWidget::getOpenFileName("drummaps", MusEGlobal::drum_map_file_pattern,
this, tr("Muse: Load Drum Map"), 0);
if (fn.isEmpty())
return;
bool popenFlag;
- FILE* f = fileOpen(this, fn, QString(".map"), "r", popenFlag, true);
+ FILE* f = MusEWidget::fileOpen(this, fn, QString(".map"), "r", popenFlag, true);
if (f == 0)
return;
@@ -852,13 +867,13 @@ ende:
void DrumEdit::save()
{
- //QString fn = getSaveFileName(QString("drummaps"), map_file_pattern,
- QString fn = getSaveFileName(QString("drummaps"), drum_map_file_save_pattern,
+ //QString fn = MusEWidget::getSaveFileName(QString("drummaps"), map_file_pattern,
+ QString fn = MusEWidget::getSaveFileName(QString("drummaps"), MusEGlobal::drum_map_file_save_pattern,
this, tr("MusE: Store Drum Map"));
if (fn.isEmpty())
return;
bool popenFlag;
- FILE* f = fileOpen(this, fn, QString(".map"), "w", popenFlag, false, true);
+ FILE* f = MusEWidget::fileOpen(this, fn, QString(".map"), "w", popenFlag, false, true);
if (f == 0)
return;
Xml xml(f);
@@ -914,7 +929,7 @@ void DrumEdit::cmd(int cmd)
case DrumCanvas::CMD_QUANTIZE:
if (quantize_dialog->exec())
quantize_notes(partlist_to_set(parts()), quantize_dialog->range,
- (config.division*4)/(1<<quantize_dialog->raster_power2),
+ (MusEConfig::config.division*4)/(1<<quantize_dialog->raster_power2),
/* quant_len= */false, quantize_dialog->strength,
quantize_dialog->swing, quantize_dialog->threshold);
break;
@@ -1134,28 +1149,28 @@ void DrumEdit::keyPressEvent(QKeyEvent* event)
}
else if (key == shortcuts[SHRT_TOOL_POINTER].key) {
- tools2->set(PointerTool);
+ tools2->set(MusEWidget::PointerTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_PENCIL].key) {
- tools2->set(PencilTool);
+ tools2->set(MusEWidget::PencilTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_RUBBER].key) {
- tools2->set(RubberTool);
+ tools2->set(MusEWidget::RubberTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_CURSOR].key) {
- tools2->set(CursorTool);
+ tools2->set(MusEWidget::CursorTool);
return;
}
else if (key == shortcuts[SHRT_ZOOM_IN].key) {
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl < 23)
zoomlvl++;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
//printf("mag = %d zoomlvl = %d newmag = %d\n", mag, zoomlvl, newmag);
@@ -1163,24 +1178,24 @@ void DrumEdit::keyPressEvent(QKeyEvent* event)
}
else if (key == shortcuts[SHRT_ZOOM_OUT].key) {
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl > 1)
zoomlvl--;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
//printf("mag = %d zoomlvl = %d newmag = %d\n", mag, zoomlvl, newmag);
return;
}
else if (key == shortcuts[SHRT_SCROLL_LEFT].key) {
- int pos = hscroll->pos() - config.division;
+ int pos = hscroll->pos() - MusEConfig::config.division;
if (pos < 0)
pos = 0;
hscroll->setPos(pos);
return;
}
else if (key == shortcuts[SHRT_SCROLL_RIGHT].key) {
- int pos = hscroll->pos() + config.division;
+ int pos = hscroll->pos() + MusEConfig::config.division;
hscroll->setPos(pos);
return;
}
diff --git a/muse2/muse/midiedit/drumedit.h b/muse2/muse/midiedit/drumedit.h
index a242eda8..5169dfcd 100644
--- a/muse2/muse/midiedit/drumedit.h
+++ b/muse2/muse/midiedit/drumedit.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: drumedit.h,v 1.9.2.7 2009/11/16 11:29:33 lunar_shuttle Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __DRUM_EDIT_H__
@@ -32,18 +47,20 @@ class MidiPart;
class DrumCanvas;
class ScrollScale;
class ScoreConfig;
-class MTScale;
-class Splitter;
class PartList;
-class Toolbar1;
class CtrlCanvas;
class Xml;
class DList;
-class Header;
class CtrlEdit;
class Part;
class SNode;
+namespace MusEWidget {
+class Header;
+class Splitter;
+class Toolbar1;
+}
+
//---------------------------------------------------------
// DrumEdit
//---------------------------------------------------------
@@ -56,17 +73,17 @@ class DrumEdit : public MidiEditor {
int selTick;
QMenu* menuEdit, *menuFunctions, *menuFile, *menuSelect;
- NoteInfo* info;
+ MusEWidget::NoteInfo* info;
QToolButton* srec;
QToolButton* midiin;
- EditToolBar* tools2;
+ MusEWidget::EditToolBar* tools2;
- Toolbar1* toolbar;
- Splitter* split1;
- Splitter* split2;
+ MusEWidget::Toolbar1* toolbar;
+ MusEWidget::Splitter* split1;
+ MusEWidget::Splitter* split2;
QWidget* split1w1;
DList* dlist;
- Header* header;
+ MusEWidget::Header* header;
QToolBar* tools;
QComboBox *stepLenWidget;
@@ -91,7 +108,7 @@ class DrumEdit : public MidiEditor {
private slots:
void setRaster(int);
- void noteinfoChanged(NoteInfo::ValType type, int val);
+ void noteinfoChanged(MusEWidget::NoteInfo::ValType type, int val);
//CtrlEdit* addCtrl();
void removeCtrl(CtrlEdit* ctrl);
void cmd(int);
diff --git a/muse2/muse/midiedit/drummap.cpp b/muse2/muse/midiedit/drummap.cpp
index 46bf2057..032c2bd6 100644
--- a/muse2/muse/midiedit/drummap.cpp
+++ b/muse2/muse/midiedit/drummap.cpp
@@ -4,6 +4,21 @@
// $Id: drummap.cpp,v 1.3.2.6 2009/10/29 02:14:37 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "audio.h"
diff --git a/muse2/muse/midiedit/drummap.h b/muse2/muse/midiedit/drummap.h
index eb494c9c..2c02ffcc 100644
--- a/muse2/muse/midiedit/drummap.h
+++ b/muse2/muse/midiedit/drummap.h
@@ -4,6 +4,21 @@
// $Id: drummap.h,v 1.3.2.3 2009/10/29 02:14:37 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __DRUMMAP_H__
diff --git a/muse2/muse/midiedit/ecanvas.cpp b/muse2/muse/midiedit/ecanvas.cpp
index a0545412..7f36c7cd 100644
--- a/muse2/muse/midiedit/ecanvas.cpp
+++ b/muse2/muse/midiedit/ecanvas.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ecanvas.cpp,v 1.8.2.6 2009/05/03 04:14:00 terminator356 Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <errno.h>
@@ -167,10 +182,10 @@ void EventCanvas::songChanged(int flags)
Event event;
MidiPart* part = 0;
int x = 0;
- CItem* nevent = 0;
+ MusEWidget::CItem* nevent = 0;
int n = 0; // count selections
- for (iCItem k = items.begin(); k != items.end(); ++k) {
+ for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) {
Event ev = k->second->event();
bool selected = ev.selected();
if (selected) {
@@ -209,11 +224,11 @@ void EventCanvas::selectAtTick(unsigned int tick)
{
//Select note nearest tick, if none selected and there are any
if (!items.empty() && selectionSize() == 0) {
- iCItem i = items.begin();
- CItem* nearest = i->second;
+ MusEWidget::iCItem i = items.begin();
+ MusEWidget::CItem* nearest = i->second;
while (i != items.end()) {
- CItem* cur=i->second;
+ MusEWidget::CItem* cur=i->second;
unsigned int curtk=abs(cur->x() + cur->part()->tick() - tick);
unsigned int neartk=abs(nearest->x() + nearest->part()->tick() - tick);
@@ -267,7 +282,7 @@ void EventCanvas::keyPress(QKeyEvent* event)
int tick_min = INT_MAX;
bool found = false;
- for (iCItem i= items.begin(); i != items.end(); i++) {
+ for (MusEWidget::iCItem i= items.begin(); i != items.end(); i++) {
if (!i->second->isSelected())
continue;
@@ -288,8 +303,8 @@ void EventCanvas::keyPress(QKeyEvent* event)
}
// Select items by key (PianoRoll & DrumEditor)
else if (key == shortcuts[SHRT_SEL_RIGHT].key || key == shortcuts[SHRT_SEL_RIGHT_ADD].key) {
- iCItem i, iRightmost;
- CItem* rightmost = NULL;
+ MusEWidget::iCItem i, iRightmost;
+ MusEWidget::CItem* rightmost = NULL;
//Get the rightmost selected note (if any)
for (i = items.begin(); i != items.end(); ++i) {
if (i->second->isSelected()) {
@@ -297,7 +312,7 @@ void EventCanvas::keyPress(QKeyEvent* event)
}
}
if (rightmost) {
- iCItem temp = iRightmost; temp++;
+ MusEWidget::iCItem temp = iRightmost; temp++;
//If so, deselect current note and select the one to the right
if (temp != items.end()) {
if (key != shortcuts[SHRT_SEL_RIGHT_ADD].key)
@@ -314,8 +329,8 @@ void EventCanvas::keyPress(QKeyEvent* event)
}
//Select items by key: (PianoRoll & DrumEditor)
else if (key == shortcuts[SHRT_SEL_LEFT].key || key == shortcuts[SHRT_SEL_LEFT_ADD].key) {
- iCItem i, iLeftmost;
- CItem* leftmost = NULL;
+ MusEWidget::iCItem i, iLeftmost;
+ MusEWidget::CItem* leftmost = NULL;
if (items.size() > 0 ) {
for (i = items.end(), i--; i != items.begin(); i--) {
if (i->second->isSelected()) {
@@ -338,27 +353,27 @@ void EventCanvas::keyPress(QKeyEvent* event)
}
}
else if (key == shortcuts[SHRT_INC_PITCH].key) {
- modifySelected(NoteInfo::VAL_PITCH, 1);
+ modifySelected(MusEWidget::NoteInfo::VAL_PITCH, 1);
}
else if (key == shortcuts[SHRT_DEC_PITCH].key) {
- modifySelected(NoteInfo::VAL_PITCH, -1);
+ modifySelected(MusEWidget::NoteInfo::VAL_PITCH, -1);
}
else if (key == shortcuts[SHRT_INC_POS].key) {
// TODO: Check boundaries
- modifySelected(NoteInfo::VAL_TIME, editor->raster());
+ modifySelected(MusEWidget::NoteInfo::VAL_TIME, editor->raster());
}
else if (key == shortcuts[SHRT_DEC_POS].key) {
// TODO: Check boundaries
- modifySelected(NoteInfo::VAL_TIME, 0 - editor->raster());
+ modifySelected(MusEWidget::NoteInfo::VAL_TIME, 0 - editor->raster());
}
else if (key == shortcuts[SHRT_INCREASE_LEN].key) {
// TODO: Check boundaries
- modifySelected(NoteInfo::VAL_LEN, editor->raster());
+ modifySelected(MusEWidget::NoteInfo::VAL_LEN, editor->raster());
}
else if (key == shortcuts[SHRT_DECREASE_LEN].key) {
// TODO: Check boundaries
- modifySelected(NoteInfo::VAL_LEN, 0 - editor->raster());
+ modifySelected(MusEWidget::NoteInfo::VAL_LEN, 0 - editor->raster());
}
else
diff --git a/muse2/muse/midiedit/ecanvas.h b/muse2/muse/midiedit/ecanvas.h
index b847f0f9..f31b5f6b 100644
--- a/muse2/muse/midiedit/ecanvas.h
+++ b/muse2/muse/midiedit/ecanvas.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ecanvas.h,v 1.5.2.4 2009/02/02 21:38:00 terminator356 Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __ECANVAS_H__
@@ -34,7 +49,7 @@ typedef std::map<Part*, PartToChange>::iterator iPartToChange;
// EventCanvas
//---------------------------------------------------------
-class EventCanvas : public Canvas {
+class EventCanvas : public MusEWidget::Canvas {
Q_OBJECT
virtual void leaveEvent(QEvent*e);
virtual void enterEvent(QEvent*e);
@@ -53,8 +68,8 @@ class EventCanvas : public Canvas {
virtual void addItem(Part*, Event&) = 0;
// Added by T356.
virtual QPoint raster(const QPoint&) const;
- virtual Undo moveCanvasItems(CItemList&, int, int, DragType) = 0;
- virtual UndoOp moveItem(CItem*, const QPoint&, DragType) = 0;
+ virtual Undo moveCanvasItems(MusEWidget::CItemList&, int, int, DragType) = 0;
+ virtual UndoOp moveItem(MusEWidget::CItem*, const QPoint&, DragType) = 0;
virtual void endMoveItems(const QPoint&, DragType, int dir);
public slots:
@@ -81,7 +96,7 @@ class EventCanvas : public Canvas {
void playEvents(bool flag) { _playEvents = flag; }
void selectAtTick(unsigned int tick);
void viewDropEvent(QDropEvent* event);
- virtual void modifySelected(NoteInfo::ValType, int) {}
+ virtual void modifySelected(MusEWidget::NoteInfo::ValType, int) {}
virtual void keyPress(QKeyEvent*);
};
diff --git a/muse2/muse/midiedit/piano.cpp b/muse2/muse/midiedit/piano.cpp
index 69a3a9e2..d347b10a 100644
--- a/muse2/muse/midiedit/piano.cpp
+++ b/muse2/muse/midiedit/piano.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: piano.cpp,v 1.3 2004/05/31 11:48:55 lunar_shuttle Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QMouseEvent>
@@ -352,7 +367,7 @@ static const char *mk4_xpm[] = {
//---------------------------------------------------------
Piano::Piano(QWidget* parent, int ymag)
- : View(parent, 1, ymag)
+ : MusEWidget::View(parent, 1, ymag)
{
setMouseTracking(true);
curPitch = -1;
diff --git a/muse2/muse/midiedit/piano.h b/muse2/muse/midiedit/piano.h
index f8deec52..133295ab 100644
--- a/muse2/muse/midiedit/piano.h
+++ b/muse2/muse/midiedit/piano.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: piano.h,v 1.2 2004/05/31 11:48:55 lunar_shuttle Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __PIANO_H__
@@ -21,7 +36,7 @@ class QPixmap;
// Piano
//---------------------------------------------------------
-class Piano : public View
+class Piano : public MusEWidget::View
{
Q_OBJECT
diff --git a/muse2/muse/midiedit/pianoroll.cpp b/muse2/muse/midiedit/pianoroll.cpp
index 258efe19..cfebb493 100644
--- a/muse2/muse/midiedit/pianoroll.cpp
+++ b/muse2/muse/midiedit/pianoroll.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: pianoroll.cpp,v 1.25.2.15 2009/11/16 11:29:33 lunar_shuttle Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QLayout>
@@ -58,7 +73,7 @@ int PianoRoll::colorModeInit = 0;
static const int xscale = -10;
static const int yscale = 1;
static const int pianoWidth = 40;
-static int pianorollTools = PointerTool | PencilTool | RubberTool | DrawTool;
+static int pianorollTools = MusEWidget::PointerTool | MusEWidget::PencilTool | MusEWidget::RubberTool | MusEWidget::DrawTool;
//---------------------------------------------------------
@@ -80,7 +95,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
menuEdit = menuBar()->addMenu(tr("&Edit"));
- menuEdit->addActions(undoRedo->actions());
+ menuEdit->addActions(MusEGlobal::undoRedo->actions());
menuEdit->addSeparator();
@@ -237,7 +252,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
//---------ToolBar----------------------------------
tools = addToolBar(tr("Pianoroll tools"));
tools->setObjectName("Pianoroll tools");
- tools->addActions(undoRedo->actions());
+ tools->addActions(MusEGlobal::undoRedo->actions());
tools->addSeparator();
srec = new QToolButton();
@@ -258,46 +273,46 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
speaker->setCheckable(true);
tools->addWidget(speaker);
- tools2 = new EditToolBar(this, pianorollTools);
+ tools2 = new MusEWidget::EditToolBar(this, pianorollTools);
addToolBar(tools2);
QToolBar* panicToolbar = addToolBar(tr("panic"));
panicToolbar->setObjectName("panic");
- panicToolbar->addAction(panicAction);
+ panicToolbar->addAction(MusEGlobal::panicAction);
//-------------------------------------------------------------
// Transport Bar
QToolBar* transport = addToolBar(tr("transport"));
transport->setObjectName("transport");
- transport->addActions(transportAction->actions());
+ transport->addActions(MusEGlobal::transportAction->actions());
addToolBarBreak();
- toolbar = new Toolbar1(this, _rasterInit);
+ toolbar = new MusEWidget::Toolbar1(this, _rasterInit);
addToolBar(toolbar);
addToolBarBreak();
- info = new NoteInfo(this);
+ info = new MusEWidget::NoteInfo(this);
addToolBar(info);
//---------------------------------------------------
// split
//---------------------------------------------------
- splitter = new Splitter(Qt::Vertical, mainw, "splitter");
+ splitter = new MusEWidget::Splitter(Qt::Vertical, mainw, "splitter");
splitter->setHandleWidth(2);
- hsplitter = new Splitter(Qt::Horizontal, mainw, "hsplitter");
+ hsplitter = new MusEWidget::Splitter(Qt::Horizontal, mainw, "hsplitter");
hsplitter->setChildrenCollapsible(true);
hsplitter->setHandleWidth(2);
QPushButton* ctrl = new QPushButton(tr("ctrl"), mainw);
//QPushButton* ctrl = new QPushButton(tr("C"), mainw); // Tim.
ctrl->setObjectName("Ctrl");
- ctrl->setFont(config.fonts[3]);
+ ctrl->setFont(MusEConfig::config.fonts[3]);
ctrl->setToolTip(tr("Add Controller View"));
- //hscroll = new ScrollScale(-25, -2, xscale, 20000, Qt::Horizontal, mainw);
+ //hscroll = new MusEWidget::ScrollScale(-25, -2, xscale, 20000, Qt::Horizontal, mainw);
// Increased scale to -1. To resolve/select/edit 1-tick-wide (controller graph) events. p4.0.18 Tim.
- hscroll = new ScrollScale(-25, -1, xscale, 20000, Qt::Horizontal, mainw);
+ hscroll = new MusEWidget::ScrollScale(-25, -1, xscale, 20000, Qt::Horizontal, mainw);
ctrl->setFixedSize(pianoWidth, hscroll->sizeHint().height());
//ctrl->setFixedSize(pianoWidth / 2, hscroll->sizeHint().height()); // Tim.
@@ -305,14 +320,14 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
/*
QPushButton* trackInfoButton = new QPushButton(tr("T"), mainw);
trackInfoButton->setObjectName("TrackInfo");
- trackInfoButton->setFont(config.fonts[3]);
+ trackInfoButton->setFont(MusEConfig::config.fonts[3]);
trackInfoButton->setToolTip(tr("Show track info"));
trackInfoButton->setFixedSize(pianoWidth / 2, hscroll->sizeHint().height());
*/
QSizeGrip* corner = new QSizeGrip(mainw);
- midiTrackInfo = new MidiTrackInfo(mainw);
+ midiTrackInfo = new MusEWidget::MidiTrackInfo(mainw);
int mtiw = midiTrackInfo->width(); // Save this.
midiTrackInfo->setMinimumWidth(100);
//midiTrackInfo->setMaximumWidth(150);
@@ -365,14 +380,14 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
gridS1->setSpacing(0);
//Defined and configure your program change bar here.
//This may well be a copy of MTScale extended for our needs
- time = new MTScale(&_raster, split1, xscale);
+ time = new MusEWidget::MTScale(&_raster, split1, xscale);
Piano* piano = new Piano(split1, yscale);
canvas = new PianoCanvas(this, split1, xscale, yscale);
- vscroll = new ScrollScale(-3, 7, yscale, KH * 75, Qt::Vertical, split1);
+ vscroll = new MusEWidget::ScrollScale(-3, 7, yscale, KH * 75, Qt::Vertical, split1);
//setFocusProxy(canvas); // Tim.
- int offset = -(config.division/4);
+ int offset = -(MusEConfig::config.division/4);
canvas->setOrigin(offset, 0);
canvas->setCanvasTools(pianorollTools);
canvas->setFocus();
@@ -386,7 +401,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
//gridS1->setColumnStretch(2, 100); // Tim.
gridS1->addWidget(time, 0, 1, 1, 2);
- gridS1->addWidget(hLine(split1), 1, 0, 1, 3);
+ gridS1->addWidget(MusEUtil::hLine(split1), 1, 0, 1, 3);
gridS1->addWidget(piano, 2, 0);
gridS1->addWidget(canvas, 2, 1);
gridS1->addWidget(vscroll, 2, 2);
@@ -394,7 +409,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
// Tim.
/*
gridS1->addWidget(time, 0, 2, 1, 3);
- gridS1->addWidget(hLine(split1), 1, 1, 1, 4);
+ gridS1->addWidget(MusEUtil::hLine(split1), 1, 1, 1, 4);
//gridS1->addWidget(infoScroll, 2, 0);
gridS1->addWidget(infoScroll, 0, 0, 3, 1);
gridS1->addWidget(piano, 2, 1);
@@ -402,7 +417,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
gridS1->addWidget(vscroll, 2, 3);
*/
- ctrlLane = new Splitter(Qt::Vertical, splitter, "ctrllane");
+ ctrlLane = new MusEWidget::Splitter(Qt::Vertical, splitter, "ctrllane");
QWidget* split2 = new QWidget(splitter);
split2->setMaximumHeight(hscroll->sizeHint().height());
split2->setMinimumHeight(hscroll->sizeHint().height());
@@ -428,7 +443,7 @@ PianoRoll::PianoRoll(PartList* pl, QWidget* parent, const char* name, unsigned i
connect(ctrl, SIGNAL(clicked()), SLOT(addCtrl()));
//connect(trackInfoButton, SIGNAL(clicked()), SLOT(toggleTrackInfo())); Tim.
- connect(info, SIGNAL(valueChanged(NoteInfo::ValType, int)), SLOT(noteinfoChanged(NoteInfo::ValType, int)));
+ connect(info, SIGNAL(valueChanged(MusEWidget::NoteInfo::ValType, int)), SLOT(noteinfoChanged(MusEWidget::NoteInfo::ValType, int)));
connect(vscroll, SIGNAL(scrollChanged(int)), piano, SLOT(setYPos(int)));
connect(vscroll, SIGNAL(scrollChanged(int)), canvas, SLOT(setYPos(int)));
connect(vscroll, SIGNAL(scaleChanged(int)), canvas, SLOT(setYMag(int)));
@@ -598,7 +613,7 @@ void PianoRoll::setTime(unsigned tick)
PianoRoll::~PianoRoll()
{
- // undoRedo->removeFrom(tools); // p4.0.6 Removed
+ // MusEGlobal::undoRedo->removeFrom(tools); // p4.0.6 Removed
}
//---------------------------------------------------------
@@ -682,7 +697,7 @@ void PianoRoll::setSelection(int tick, Event& e, Part* p)
// edit currently selected Event
//---------------------------------------------------------
-void PianoRoll::noteinfoChanged(NoteInfo::ValType type, int val)
+void PianoRoll::noteinfoChanged(MusEWidget::NoteInfo::ValType type, int val)
{
int selections = canvas->selectionSize();
@@ -692,19 +707,19 @@ void PianoRoll::noteinfoChanged(NoteInfo::ValType type, int val)
else if (selections == 1) {
Event event = selEvent.clone();
switch(type) {
- case NoteInfo::VAL_TIME:
+ case MusEWidget::NoteInfo::VAL_TIME:
event.setTick(val - selPart->tick());
break;
- case NoteInfo::VAL_LEN:
+ case MusEWidget::NoteInfo::VAL_LEN:
event.setLenTick(val);
break;
- case NoteInfo::VAL_VELON:
+ case MusEWidget::NoteInfo::VAL_VELON:
event.setVelo(val);
break;
- case NoteInfo::VAL_VELOFF:
+ case MusEWidget::NoteInfo::VAL_VELOFF:
event.setVeloOff(val);
break;
- case NoteInfo::VAL_PITCH:
+ case MusEWidget::NoteInfo::VAL_PITCH:
event.setPitch(val);
break;
}
@@ -718,23 +733,23 @@ void PianoRoll::noteinfoChanged(NoteInfo::ValType type, int val)
int delta = 0;
switch (type) {
- case NoteInfo::VAL_TIME:
+ case MusEWidget::NoteInfo::VAL_TIME:
delta = val - tickOffset;
tickOffset = val;
break;
- case NoteInfo::VAL_LEN:
+ case MusEWidget::NoteInfo::VAL_LEN:
delta = val - lenOffset;
lenOffset = val;
break;
- case NoteInfo::VAL_VELON:
+ case MusEWidget::NoteInfo::VAL_VELON:
delta = val - veloOnOffset;
veloOnOffset = val;
break;
- case NoteInfo::VAL_VELOFF:
+ case MusEWidget::NoteInfo::VAL_VELOFF:
delta = val - veloOffOffset;
veloOffOffset = val;
break;
- case NoteInfo::VAL_PITCH:
+ case MusEWidget::NoteInfo::VAL_PITCH:
delta = val - pitchOffset;
pitchOffset = val;
break;
@@ -1006,19 +1021,19 @@ void PianoRoll::keyPressEvent(QKeyEvent* event)
return;
}
else if (key == shortcuts[SHRT_TOOL_POINTER].key) {
- tools2->set(PointerTool);
+ tools2->set(MusEWidget::PointerTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_PENCIL].key) {
- tools2->set(PencilTool);
+ tools2->set(MusEWidget::PencilTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_RUBBER].key) {
- tools2->set(RubberTool);
+ tools2->set(MusEWidget::RubberTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_LINEDRAW].key) {
- tools2->set(DrawTool);
+ tools2->set(MusEWidget::DrawTool);
return;
}
else if (key == shortcuts[SHRT_POS_INC].key) {
@@ -1047,22 +1062,22 @@ void PianoRoll::keyPressEvent(QKeyEvent* event)
}
else if (key == shortcuts[SHRT_ZOOM_IN].key) {
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl < 23)
zoomlvl++;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
//printf("mag = %d zoomlvl = %d newmag = %d\n", mag, zoomlvl, newmag);
return;
}
else if (key == shortcuts[SHRT_ZOOM_OUT].key) {
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl > 1)
zoomlvl--;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
//printf("mag = %d zoomlvl = %d newmag = %d\n", mag, zoomlvl, newmag);
return;
@@ -1074,14 +1089,14 @@ void PianoRoll::keyPressEvent(QKeyEvent* event)
return;
}
else if (key == shortcuts[SHRT_SCROLL_LEFT].key) {
- int pos = hscroll->pos() - config.division;
+ int pos = hscroll->pos() - MusEConfig::config.division;
if (pos < 0)
pos = 0;
hscroll->setPos(pos);
return;
}
else if (key == shortcuts[SHRT_SCROLL_RIGHT].key) {
- int pos = hscroll->pos() + config.division;
+ int pos = hscroll->pos() + MusEConfig::config.division;
hscroll->setPos(pos);
return;
}
diff --git a/muse2/muse/midiedit/pianoroll.h b/muse2/muse/midiedit/pianoroll.h
index b55d7689..b1a5010b 100644
--- a/muse2/muse/midiedit/pianoroll.h
+++ b/muse2/muse/midiedit/pianoroll.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: pianoroll.h,v 1.5.2.4 2009/11/16 11:29:33 lunar_shuttle Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __PIANOROLL_H__
@@ -31,9 +46,7 @@ class QToolButton;
class QToolBar;
class QPushButton;
class CtrlEdit;
-class Splitter;
class PartList;
-class Toolbar1;
class Xml;
class ScrollScale;
class Part;
@@ -42,9 +55,14 @@ class QMenu;
class QAction;
class QWidget;
class QScrollBar;
-class MidiTrackInfo;
class QScrollArea;
+namespace MusEWidget {
+class MidiTrackInfo;
+class Splitter;
+class Toolbar1;
+}
+
//---------------------------------------------------------
// PianoRoll
//---------------------------------------------------------
@@ -62,7 +80,7 @@ class PianoRoll : public MidiEditor {
QMenu *menuEdit, *menuFunctions, *menuSelect, *menuConfig, *eventColor, *menuPlugins;
- MidiTrackInfo *midiTrackInfo;
+ MusEWidget::MidiTrackInfo *midiTrackInfo;
Track* selected;
QAction* editCutAction;
@@ -100,18 +118,18 @@ class PianoRoll : public MidiEditor {
int veloOffOffset;
bool deltaMode;
- NoteInfo* info;
+ MusEWidget::NoteInfo* info;
QToolButton* srec;
QToolButton* midiin;
- Toolbar1* toolbar;
- Splitter* splitter;
- Splitter* hsplitter;
- Splitter* ctrlLane;
+ MusEWidget::Toolbar1* toolbar;
+ MusEWidget::Splitter* splitter;
+ MusEWidget::Splitter* hsplitter;
+ MusEWidget::Splitter* ctrlLane;
QToolButton* speaker;
QToolBar* tools;
- EditToolBar* tools2;
+ MusEWidget::EditToolBar* tools2;
int colorMode;
@@ -133,7 +151,7 @@ class PianoRoll : public MidiEditor {
private slots:
void setSelection(int, Event&, Part*);
- void noteinfoChanged(NoteInfo::ValType, int);
+ void noteinfoChanged(MusEWidget::NoteInfo::ValType, int);
//CtrlEdit* addCtrl();
void removeCtrl(CtrlEdit* ctrl);
void soloChanged(bool flag);
diff --git a/muse2/muse/midiedit/prcanvas.cpp b/muse2/muse/midiedit/prcanvas.cpp
index 43edc7f5..b96cb47f 100644
--- a/muse2/muse/midiedit/prcanvas.cpp
+++ b/muse2/muse/midiedit/prcanvas.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: prcanvas.cpp,v 1.20.2.19 2009/11/16 11:29:33 lunar_shuttle Exp $
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QApplication>
@@ -45,7 +60,7 @@
// NEvent
//---------------------------------------------------------
-NEvent::NEvent(Event& e, Part* p, int y) : CItem(e, p)
+NEvent::NEvent(Event& e, Part* p, int y) : MusEWidget::CItem(e, p)
{
y = y - KH/4;
unsigned tick = e.tick() + p->tick();
@@ -141,7 +156,7 @@ int PianoCanvas::y2pitch(int y) const
// draws a note
//---------------------------------------------------------
-void PianoCanvas::drawItem(QPainter& p, const CItem* item,
+void PianoCanvas::drawItem(QPainter& p, const MusEWidget::CItem* item,
const QRect& rect)
{
QRect r = item->bbox();
@@ -246,7 +261,7 @@ void PianoCanvas::drawItem(QPainter& p, const CItem* item,
//int mfh = mh;
//if(mfh == meh) mfh -= 1;
//if(mfy == mey) mfh -= 1;
- color.setAlpha(config.globalAlphaBlend);
+ color.setAlpha(MusEConfig::config.globalAlphaBlend);
//QLinearGradient gradient(mex + 1, mey + 1, mex + 1, mey + meh - 2); // Inside the border
//gradient.setColorAt(0, color);
//gradient.setColorAt(1, color.darker());
@@ -280,7 +295,7 @@ void PianoCanvas::drawTopItem(QPainter& , const QRect&)
// draws moving items
//---------------------------------------------------------
-void PianoCanvas::drawMoving(QPainter& p, const CItem* item, const QRect& rect)
+void PianoCanvas::drawMoving(QPainter& p, const MusEWidget::CItem* item, const QRect& rect)
{
//if(((NEvent*)item)->part() != curPart)
// return;
@@ -301,7 +316,7 @@ void PianoCanvas::drawMoving(QPainter& p, const CItem* item, const QRect& rect)
void PianoCanvas::viewMouseDoubleClickEvent(QMouseEvent* event)
{
- if ((_tool != PointerTool) && (event->button() != Qt::LeftButton)) {
+ if ((_tool != MusEWidget::PointerTool) && (event->button() != Qt::LeftButton)) {
mousePress(event);
return;
}
@@ -311,7 +326,7 @@ void PianoCanvas::viewMouseDoubleClickEvent(QMouseEvent* event)
// moveCanvasItems
//---------------------------------------------------------
-Undo PianoCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dtype)
+Undo PianoCanvas::moveCanvasItems(MusEWidget::CItemList& items, int dp, int dx, DragType dtype)
{
if(editor->parts()->empty())
return Undo(); //return empty list
@@ -326,9 +341,9 @@ Undo PianoCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dty
continue;
int npartoffset = 0;
- for(iCItem ici = items.begin(); ici != items.end(); ++ici)
+ for(MusEWidget::iCItem ici = items.begin(); ici != items.end(); ++ici)
{
- CItem* ci = ici->second;
+ MusEWidget::CItem* ci = ici->second;
if(ci->part() != part)
continue;
@@ -379,12 +394,12 @@ Undo PianoCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dty
if (!forbidden)
{
- std::vector< CItem* > doneList;
- typedef std::vector< CItem* >::iterator iDoneList;
+ std::vector< MusEWidget::CItem* > doneList;
+ typedef std::vector< MusEWidget::CItem* >::iterator iDoneList;
- for(iCItem ici = items.begin(); ici != items.end(); ++ici)
+ for(MusEWidget::iCItem ici = items.begin(); ici != items.end(); ++ici)
{
- CItem* ci = ici->second;
+ MusEWidget::CItem* ci = ici->second;
int x = ci->pos().x();
int y = ci->pos().y();
@@ -435,7 +450,7 @@ Undo PianoCanvas::moveCanvasItems(CItemList& items, int dp, int dx, DragType dty
// called after moving an object
//---------------------------------------------------------
-UndoOp PianoCanvas::moveItem(CItem* item, const QPoint& pos, DragType dtype)
+UndoOp PianoCanvas::moveItem(MusEWidget::CItem* item, const QPoint& pos, DragType dtype)
{
NEvent* nevent = (NEvent*) item;
Event event = nevent->event();
@@ -480,7 +495,7 @@ UndoOp PianoCanvas::moveItem(CItem* item, const QPoint& pos, DragType dtype)
// newItem(p, state)
//---------------------------------------------------------
-CItem* PianoCanvas::newItem(const QPoint& p, int)
+MusEWidget::CItem* PianoCanvas::newItem(const QPoint& p, int)
{
//printf("newItem point\n");
int pitch = y2pitch(p.y());
@@ -497,7 +512,7 @@ CItem* PianoCanvas::newItem(const QPoint& p, int)
return new NEvent(e, curPart, pitch2y(pitch));
}
-void PianoCanvas::newItem(CItem* item, bool noSnap)
+void PianoCanvas::newItem(MusEWidget::CItem* item, bool noSnap)
{
//printf("newItem citem\n");
NEvent* nevent = (NEvent*) item;
@@ -543,7 +558,7 @@ void PianoCanvas::newItem(CItem* item, bool noSnap)
// resizeItem
//---------------------------------------------------------
-void PianoCanvas::resizeItem(CItem* item, bool noSnap, bool) // experimental changes to try dynamically extending parts
+void PianoCanvas::resizeItem(MusEWidget::CItem* item, bool noSnap, bool) // experimental changes to try dynamically extending parts
{
//printf("resizeItem!\n");
NEvent* nevent = (NEvent*) item;
@@ -587,7 +602,7 @@ void PianoCanvas::resizeItem(CItem* item, bool noSnap, bool) // experime
// deleteItem
//---------------------------------------------------------
-bool PianoCanvas::deleteItem(CItem* item)
+bool PianoCanvas::deleteItem(MusEWidget::CItem* item)
{
NEvent* nevent = (NEvent*) item;
if (nevent->part() == curPart) {
@@ -714,7 +729,7 @@ void PianoCanvas::pianoPressed(int pitch, int velocity, bool shift)
audio->msgPlayMidiEvent(&e);
if (_steprec && pos[0] >= start_tick /* && pos[0] < end_tick [removed by flo93: this is handled in steprec->record] */ && curPart)
- steprec->record(curPart,pitch,editor->raster(),editor->raster(),velocity,globalKeyState&Qt::ControlModifier,shift);
+ steprec->record(curPart,pitch,editor->raster(),editor->raster(),velocity,MusEGlobal::globalKeyState&Qt::ControlModifier,shift);
}
//---------------------------------------------------------
@@ -811,7 +826,7 @@ void PianoCanvas::cmd(int cmd)
{
switch (cmd) {
case CMD_SELECT_ALL: // select all
- for (iCItem k = items.begin(); k != items.end(); ++k) {
+ for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) {
if (!k->second->isSelected())
selectItem(k->second, true);
}
@@ -820,12 +835,12 @@ void PianoCanvas::cmd(int cmd)
deselectAll();
break;
case CMD_SELECT_INVERT: // invert selection
- for (iCItem k = items.begin(); k != items.end(); ++k) {
+ for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) {
selectItem(k->second, !k->second->isSelected());
}
break;
case CMD_SELECT_ILOOP: // select inside loop
- for (iCItem k = items.begin(); k != items.end(); ++k) {
+ for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) {
NEvent* nevent = (NEvent*)(k->second);
Part* part = nevent->part();
Event event = nevent->event();
@@ -837,7 +852,7 @@ void PianoCanvas::cmd(int cmd)
}
break;
case CMD_SELECT_OLOOP: // select outside loop
- for (iCItem k = items.begin(); k != items.end(); ++k) {
+ for (MusEWidget::iCItem k = items.begin(); k != items.end(); ++k) {
NEvent* nevent = (NEvent*)(k->second);
Part* part = nevent->part();
Event event = nevent->event();
@@ -910,14 +925,14 @@ void PianoCanvas::cmd(int cmd)
//---------------------------------------------------------
void PianoCanvas::midiNote(int pitch, int velo)
{
- if (debugMsg) printf("PianoCanvas::midiNote: pitch=%i, velo=%i\n", pitch, velo);
+ if (MusEGlobal::debugMsg) printf("PianoCanvas::midiNote: pitch=%i, velo=%i\n", pitch, velo);
if (velo)
noteHeldDown[pitch]=true;
else
noteHeldDown[pitch]=false;
- if (heavyDebugMsg)
+ if (MusEGlobal::heavyDebugMsg)
{
printf(" held down notes are: ");
for (int i=0;i<128;i++)
@@ -929,8 +944,8 @@ void PianoCanvas::midiNote(int pitch, int velo)
if (_midiin && _steprec && curPart
&& !audio->isPlaying() && velo && pos[0] >= start_tick
/* && pos[0] < end_tick [removed by flo93: this is handled in steprec->record] */
- && !(globalKeyState & Qt::AltModifier)) {
- steprec->record(curPart,pitch,editor->raster(),editor->raster(),velo,globalKeyState&Qt::ControlModifier,globalKeyState&Qt::ShiftModifier);
+ && !(MusEGlobal::globalKeyState & Qt::AltModifier)) {
+ steprec->record(curPart,pitch,editor->raster(),editor->raster(),velo,MusEGlobal::globalKeyState&Qt::ControlModifier,MusEGlobal::globalKeyState&Qt::ShiftModifier);
}
}
@@ -939,7 +954,7 @@ void PianoCanvas::midiNote(int pitch, int velo)
// startDrag
//---------------------------------------------------------
-void PianoCanvas::startDrag(CItem* /* item*/, bool copymode)
+void PianoCanvas::startDrag(MusEWidget::CItem* /* item*/, bool copymode)
{
QMimeData* md = selected_events_to_mime(partlist_to_set(editor->parts()), 1);
@@ -991,7 +1006,7 @@ void PianoCanvas::dragLeaveEvent(QDragLeaveEvent*)
// itemPressed
//---------------------------------------------------------
-void PianoCanvas::itemPressed(const CItem* item)
+void PianoCanvas::itemPressed(const MusEWidget::CItem* item)
{
if (!_playEvents)
return;
@@ -1012,7 +1027,7 @@ void PianoCanvas::itemPressed(const CItem* item)
// itemReleased
//---------------------------------------------------------
-void PianoCanvas::itemReleased(const CItem*, const QPoint&)
+void PianoCanvas::itemReleased(const MusEWidget::CItem*, const QPoint&)
{
if (!_playEvents)
return;
@@ -1029,7 +1044,7 @@ void PianoCanvas::itemReleased(const CItem*, const QPoint&)
// itemMoved
//---------------------------------------------------------
-void PianoCanvas::itemMoved(const CItem* item, const QPoint& pos)
+void PianoCanvas::itemMoved(const MusEWidget::CItem* item, const QPoint& pos)
{
int npitch = y2pitch(pos.y());
if ((playedPitch != -1) && (playedPitch != npitch)) {
@@ -1061,11 +1076,11 @@ void PianoCanvas::curPartChanged()
// modifySelected
//---------------------------------------------------------
-void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta)
+void PianoCanvas::modifySelected(MusEWidget::NoteInfo::ValType type, int delta)
{
audio->msgIdle(true);
song->startUndo();
- for (iCItem i = items.begin(); i != items.end(); ++i) {
+ for (MusEWidget::iCItem i = items.begin(); i != items.end(); ++i) {
if (!(i->second->isSelected()))
continue;
NEvent* e = (NEvent*)(i->second);
@@ -1077,7 +1092,7 @@ void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta)
Event newEvent = event.clone();
switch (type) {
- case NoteInfo::VAL_TIME:
+ case MusEWidget::NoteInfo::VAL_TIME:
{
int newTime = event.tick() + delta;
if (newTime < 0)
@@ -1085,7 +1100,7 @@ void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta)
newEvent.setTick(newTime);
}
break;
- case NoteInfo::VAL_LEN:
+ case MusEWidget::NoteInfo::VAL_LEN:
{
int len = event.lenTick() + delta;
if (len < 1)
@@ -1093,7 +1108,7 @@ void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta)
newEvent.setLenTick(len);
}
break;
- case NoteInfo::VAL_VELON:
+ case MusEWidget::NoteInfo::VAL_VELON:
{
int velo = event.velo() + delta;
if (velo > 127)
@@ -1103,7 +1118,7 @@ void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta)
newEvent.setVelo(velo);
}
break;
- case NoteInfo::VAL_VELOFF:
+ case MusEWidget::NoteInfo::VAL_VELOFF:
{
int velo = event.veloOff() + delta;
if (velo > 127)
@@ -1113,7 +1128,7 @@ void PianoCanvas::modifySelected(NoteInfo::ValType type, int delta)
newEvent.setVeloOff(velo);
}
break;
- case NoteInfo::VAL_PITCH:
+ case MusEWidget::NoteInfo::VAL_PITCH:
{
int pitch = event.pitch() + delta;
if (pitch > 127)
diff --git a/muse2/muse/midiedit/prcanvas.h b/muse2/muse/midiedit/prcanvas.h
index d96dd4df..d239994e 100644
--- a/muse2/muse/midiedit/prcanvas.h
+++ b/muse2/muse/midiedit/prcanvas.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: prcanvas.h,v 1.5.2.6 2009/11/16 11:29:33 lunar_shuttle Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __PRCANVAS_H__
@@ -26,7 +41,7 @@
// ''visual'' Note Event
//---------------------------------------------------------
-class NEvent : public CItem {
+class NEvent : public MusEWidget::CItem {
public:
NEvent(Event& e, Part* p, int y);
};
@@ -51,16 +66,16 @@ class PianoCanvas : public EventCanvas {
virtual void viewMouseDoubleClickEvent(QMouseEvent*);
- virtual void drawItem(QPainter&, const CItem*, const QRect&);
+ virtual void drawItem(QPainter&, const MusEWidget::CItem*, const QRect&);
void drawTopItem(QPainter &p, const QRect &rect);
- virtual void drawMoving(QPainter&, const CItem*, const QRect&);
- virtual Undo moveCanvasItems(CItemList&, int, int, DragType);
- virtual UndoOp moveItem(CItem*, const QPoint&, DragType);
- virtual CItem* newItem(const QPoint&, int);
- virtual void resizeItem(CItem*, bool noSnap, bool);
- virtual void newItem(CItem*, bool noSnap);
- virtual bool deleteItem(CItem*);
- virtual void startDrag(CItem* item, bool copymode);
+ virtual void drawMoving(QPainter&, const MusEWidget::CItem*, const QRect&);
+ virtual Undo moveCanvasItems(MusEWidget::CItemList&, int, int, DragType);
+ virtual UndoOp moveItem(MusEWidget::CItem*, const QPoint&, DragType);
+ virtual MusEWidget::CItem* newItem(const QPoint&, int);
+ virtual void resizeItem(MusEWidget::CItem*, bool noSnap, bool);
+ virtual void newItem(MusEWidget::CItem*, bool noSnap);
+ virtual bool deleteItem(MusEWidget::CItem*);
+ virtual void startDrag(MusEWidget::CItem* item, bool copymode);
virtual void dragEnterEvent(QDragEnterEvent* event);
virtual void dragMoveEvent(QDragMoveEvent*);
virtual void dragLeaveEvent(QDragLeaveEvent*);
@@ -69,9 +84,9 @@ class PianoCanvas : public EventCanvas {
int y2pitch(int) const;
int pitch2y(int) const;
virtual void drawCanvas(QPainter&, const QRect&);
- virtual void itemPressed(const CItem*);
- virtual void itemReleased(const CItem*, const QPoint&);
- virtual void itemMoved(const CItem*, const QPoint&);
+ virtual void itemPressed(const MusEWidget::CItem*);
+ virtual void itemReleased(const MusEWidget::CItem*, const QPoint&);
+ virtual void itemMoved(const MusEWidget::CItem*, const QPoint&);
virtual void curPartChanged();
virtual void resizeEvent(QResizeEvent*);
@@ -107,7 +122,7 @@ class PianoCanvas : public EventCanvas {
colorMode = mode;
redraw();
}
- virtual void modifySelected(NoteInfo::ValType type, int delta);
+ virtual void modifySelected(MusEWidget::NoteInfo::ValType type, int delta);
};
#endif
diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp
index 72740a8e..39f2f389 100644
--- a/muse2/muse/midiedit/scoreedit.cpp
+++ b/muse2/muse/midiedit/scoreedit.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// scoreedit.cpp
// (C) Copyright 2011 Florian Jung (flo93@users.sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
@@ -175,7 +190,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
score_canvas=new ScoreCanvas(this, mainw);
xscroll = new QScrollBar(Qt::Horizontal, mainw);
yscroll = new QScrollBar(Qt::Vertical, mainw);
- time_bar = new MTScaleFlo(score_canvas, mainw);
+ time_bar = new MusEWidget::MTScaleFlo(score_canvas, mainw);
connect(xscroll, SIGNAL(valueChanged(int)), score_canvas, SLOT(x_scroll_event(int)));
connect(score_canvas, SIGNAL(xscroll_changed(int)), xscroll, SLOT(setValue(int)));
@@ -210,7 +225,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
// Toolbars ---------------------------------------------------------
QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools"));
undo_tools->setObjectName("Undo/Redo tools");
- undo_tools->addActions(undoRedo->actions());
+ undo_tools->addActions(MusEGlobal::undoRedo->actions());
addToolBar(undo_tools);
QToolBar* steprec_tools=addToolBar(tr("Step recording tools"));
@@ -223,19 +238,19 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
connect(srec, SIGNAL(toggled(bool)), score_canvas, SLOT(set_steprec(bool)));
- edit_tools = new EditToolBar(this, PointerTool | PencilTool | RubberTool);
+ edit_tools = new MusEWidget::EditToolBar(this, MusEWidget::PointerTool | MusEWidget::PencilTool | MusEWidget::RubberTool);
addToolBar(edit_tools);
- edit_tools->set(PointerTool);
- score_canvas->set_tool(PointerTool);
+ edit_tools->set(MusEWidget::PointerTool);
+ score_canvas->set_tool(MusEWidget::PointerTool);
connect(edit_tools, SIGNAL(toolChanged(int)), score_canvas, SLOT(set_tool(int)));
QToolBar* panic_toolbar = addToolBar(tr("panic"));
panic_toolbar->setObjectName("panic");
- panic_toolbar->addAction(panicAction);
+ panic_toolbar->addAction(MusEGlobal::panicAction);
QToolBar* transport_toolbar = addToolBar(tr("transport"));
transport_toolbar->setObjectName("transport");
- transport_toolbar->addActions(transportAction->actions());
+ transport_toolbar->addActions(MusEGlobal::transportAction->actions());
addToolBarBreak();
@@ -337,7 +352,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
QMenu* edit_menu = menuBar()->addMenu(tr("&Edit"));
- edit_menu->addActions(undoRedo->actions());
+ edit_menu->addActions(MusEGlobal::undoRedo->actions());
edit_menu->addSeparator();
cut_action = edit_menu->addAction(QIcon(*editcutIconSet), tr("C&ut"));
@@ -452,7 +467,7 @@ ScoreEdit::ScoreEdit(QWidget* parent, const char* name, unsigned initPos)
init_shortcuts();
- connect(muse, SIGNAL(configChanged()), SLOT(init_shortcuts()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(init_shortcuts()));
QClipboard* cb = QApplication::clipboard();
connect(cb, SIGNAL(dataChanged()), SLOT(clipboard_changed()));
@@ -737,11 +752,11 @@ Part* read_part(Xml& xml, QString tag_name="part")
else
{
sscanf(tag.toLatin1().constData(), "%d:%d", &trackIdx, &partIdx);
- if (debugMsg) cout << "read_part: trackIdx="<<trackIdx<<", partIdx="<<partIdx;
+ if (MusEGlobal::debugMsg) cout << "read_part: trackIdx="<<trackIdx<<", partIdx="<<partIdx;
Track* track = song->tracks()->index(trackIdx);
if (track)
part = track->parts()->find(partIdx);
- if (debugMsg) cout << ", track="<<track<<", part="<<part<<endl;
+ if (MusEGlobal::debugMsg) cout << ", track="<<track<<", part="<<part<<endl;
}
}
break;
@@ -1196,11 +1211,11 @@ ScoreCanvas::ScoreCanvas(ScoreEdit* pr, QWidget* parent_widget) : View(parent_wi
x_scroll_pos=0;
y_scroll_speed=0;
y_scroll_pos=0;
- connect (heartBeatTimer, SIGNAL(timeout()), SLOT(heartbeat_timer_event()));
+ connect (MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartbeat_timer_event()));
connect(song, SIGNAL(posChanged(int, unsigned, bool)), SLOT(pos_changed(int,unsigned,bool)));
connect(song, SIGNAL(playChanged(bool)), SLOT(play_changed(bool)));
- connect(muse, SIGNAL(configChanged()), SLOT(config_changed()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(config_changed()));
staff_menu=new QMenu(this);
@@ -1519,13 +1534,13 @@ void ScoreCanvas::init_pixmaps()
{
if (!pixmaps_initalized)
{
- if (debugMsg) cout << "initalizing colors..." << endl;
+ if (MusEGlobal::debugMsg) cout << "initalizing colors..." << endl;
mycolors=new QColor[NUM_MYCOLORS];
mycolors[0]=Qt::black;
for (int i=1;i<NUM_PARTCOLORS;i++)
- mycolors[i]=config.partColors[i];
+ mycolors[i]=MusEConfig::config.partColors[i];
mycolors[BLACK_PIXMAP]=Qt::black;
mycolors[HIGHLIGHTED_PIXMAP]=Qt::red;
mycolors[SELECTED_PIXMAP]=QColor(255,160,0);
@@ -1536,7 +1551,7 @@ void ScoreCanvas::init_pixmaps()
mycolors[i+VELO_PIXMAP_BEGIN]=QColor(0xff,0,(127-i)*4);
- if (debugMsg) cout << "loading pixmaps..." << endl;
+ if (MusEGlobal::debugMsg) cout << "loading pixmaps..." << endl;
pix_whole=new QPixmap[NUM_MYCOLORS];
pix_half=new QPixmap[NUM_MYCOLORS];
@@ -1563,38 +1578,38 @@ void ScoreCanvas::init_pixmaps()
- load_colored_pixmaps(museGlobalShare + "/scoreglyphs/whole.png", pix_whole);
- load_colored_pixmaps(museGlobalShare + "/scoreglyphs/half.png", pix_half);
- load_colored_pixmaps(museGlobalShare + "/scoreglyphs/quarter.png", pix_quarter);
- load_colored_pixmaps(museGlobalShare + "/scoreglyphs/dot.png", pix_dot);
- load_colored_pixmaps(museGlobalShare + "/scoreglyphs/acc_none.png", pix_noacc);
- load_colored_pixmaps(museGlobalShare + "/scoreglyphs/acc_sharp.png", pix_sharp);
- load_colored_pixmaps(museGlobalShare + "/scoreglyphs/acc_b.png", pix_b);
-
- pix_r1->load(museGlobalShare + "/scoreglyphs/rest1.png");
- pix_r2->load(museGlobalShare + "/scoreglyphs/rest2.png");
- pix_r4->load(museGlobalShare + "/scoreglyphs/rest4.png");
- pix_r8->load(museGlobalShare + "/scoreglyphs/rest8.png");
- pix_r16->load(museGlobalShare + "/scoreglyphs/rest16.png");
- pix_r32->load(museGlobalShare + "/scoreglyphs/rest32.png");
- pix_flag_up[0].load(museGlobalShare + "/scoreglyphs/flags8u.png");
- pix_flag_up[1].load(museGlobalShare + "/scoreglyphs/flags16u.png");
- pix_flag_up[2].load(museGlobalShare + "/scoreglyphs/flags32u.png");
- pix_flag_up[3].load(museGlobalShare + "/scoreglyphs/flags64u.png");
- pix_flag_down[0].load(museGlobalShare + "/scoreglyphs/flags8d.png");
- pix_flag_down[1].load(museGlobalShare + "/scoreglyphs/flags16d.png");
- pix_flag_down[2].load(museGlobalShare + "/scoreglyphs/flags32d.png");
- pix_flag_down[3].load(museGlobalShare + "/scoreglyphs/flags64d.png");
+ load_colored_pixmaps(MusEGlobal::museGlobalShare + "/scoreglyphs/whole.png", pix_whole);
+ load_colored_pixmaps(MusEGlobal::museGlobalShare + "/scoreglyphs/half.png", pix_half);
+ load_colored_pixmaps(MusEGlobal::museGlobalShare + "/scoreglyphs/quarter.png", pix_quarter);
+ load_colored_pixmaps(MusEGlobal::museGlobalShare + "/scoreglyphs/dot.png", pix_dot);
+ load_colored_pixmaps(MusEGlobal::museGlobalShare + "/scoreglyphs/acc_none.png", pix_noacc);
+ load_colored_pixmaps(MusEGlobal::museGlobalShare + "/scoreglyphs/acc_sharp.png", pix_sharp);
+ load_colored_pixmaps(MusEGlobal::museGlobalShare + "/scoreglyphs/acc_b.png", pix_b);
+
+ pix_r1->load(MusEGlobal::museGlobalShare + "/scoreglyphs/rest1.png");
+ pix_r2->load(MusEGlobal::museGlobalShare + "/scoreglyphs/rest2.png");
+ pix_r4->load(MusEGlobal::museGlobalShare + "/scoreglyphs/rest4.png");
+ pix_r8->load(MusEGlobal::museGlobalShare + "/scoreglyphs/rest8.png");
+ pix_r16->load(MusEGlobal::museGlobalShare + "/scoreglyphs/rest16.png");
+ pix_r32->load(MusEGlobal::museGlobalShare + "/scoreglyphs/rest32.png");
+ pix_flag_up[0].load(MusEGlobal::museGlobalShare + "/scoreglyphs/flags8u.png");
+ pix_flag_up[1].load(MusEGlobal::museGlobalShare + "/scoreglyphs/flags16u.png");
+ pix_flag_up[2].load(MusEGlobal::museGlobalShare + "/scoreglyphs/flags32u.png");
+ pix_flag_up[3].load(MusEGlobal::museGlobalShare + "/scoreglyphs/flags64u.png");
+ pix_flag_down[0].load(MusEGlobal::museGlobalShare + "/scoreglyphs/flags8d.png");
+ pix_flag_down[1].load(MusEGlobal::museGlobalShare + "/scoreglyphs/flags16d.png");
+ pix_flag_down[2].load(MusEGlobal::museGlobalShare + "/scoreglyphs/flags32d.png");
+ pix_flag_down[3].load(MusEGlobal::museGlobalShare + "/scoreglyphs/flags64d.png");
- pix_clef_violin->load(museGlobalShare + "/scoreglyphs/clef_violin_big.png");
- pix_clef_bass->load(museGlobalShare + "/scoreglyphs/clef_bass_big.png");
+ pix_clef_violin->load(MusEGlobal::museGlobalShare + "/scoreglyphs/clef_violin_big.png");
+ pix_clef_bass->load(MusEGlobal::museGlobalShare + "/scoreglyphs/clef_bass_big.png");
for (int i=0;i<10;i++)
- pix_num[i].load(museGlobalShare + "/scoreglyphs/"+IntToQStr(i)+".png");
+ pix_num[i].load(MusEGlobal::museGlobalShare + "/scoreglyphs/"+IntToQStr(i)+".png");
pixmaps_initalized=true;
- if (debugMsg) cout << "done" << endl;
+ if (MusEGlobal::debugMsg) cout << "done" << endl;
}
}
@@ -1676,11 +1691,11 @@ void staff_t::create_appropriate_eventlist()
end=flo_quantize(event.endTick()+part->tick(), parent->quant_ticks());
if (end==begin)
{
- if (heavyDebugMsg) cout << "note len would be quantized to zero. using minimal possible length" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "note len would be quantized to zero. using minimal possible length" << endl;
end=begin+parent->quant_ticks();
}
- if (heavyDebugMsg) cout << "inserting note on at "<<begin<<" with pitch="<<event.pitch()<<" and len="<<end-begin<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "inserting note on at "<<begin<<" with pitch="<<event.pitch()<<" and len="<<end-begin<<endl;
eventlist.insert(pair<unsigned, FloEvent>(begin, FloEvent(begin,event.pitch(), event.velo(),end-begin,FloEvent::NOTE_ON,part,&it->second)));
}
//else ignore it
@@ -1697,7 +1712,7 @@ void staff_t::create_appropriate_eventlist()
if (to > unsigned(SONG_LENGTH))
to=SONG_LENGTH;
- if (heavyDebugMsg) cout << "new signature from tick "<<from<<" to " << to << ": "<<it->second->sig.z<<"/"<<it->second->sig.n<<"; ticks per measure = "<<ticks_per_measure<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "new signature from tick "<<from<<" to " << to << ": "<<it->second->sig.z<<"/"<<it->second->sig.n<<"; ticks per measure = "<<ticks_per_measure<<endl;
eventlist.insert(pair<unsigned, FloEvent>(from, FloEvent(from, FloEvent::TIME_SIG, it->second->sig.z, it->second->sig.n) ) );
for (unsigned t=from; t<to; t+=ticks_per_measure)
eventlist.insert(pair<unsigned, FloEvent>(t, FloEvent(t,0,0,ticks_per_measure,FloEvent::BAR) ) );
@@ -1874,7 +1889,7 @@ int calc_measure_len(const list<int>& nums, int denom)
vector<int> create_emphasize_list(const list<int>& nums, int denom)
{
- if (heavyDebugMsg)
+ if (MusEGlobal::heavyDebugMsg)
{
cout << "creating emphasize list for ";
for (list<int>::const_iterator it=nums.begin(); it!=nums.end(); it++)
@@ -1902,7 +1917,7 @@ vector<int> create_emphasize_list(const list<int>& nums, int denom)
result[0]=0;
- if (heavyDebugMsg)
+ if (MusEGlobal::heavyDebugMsg)
{
for (int i=0;i<len;i++)
{
@@ -1984,7 +1999,7 @@ list<note_len_t> parse_note_len(int len_ticks, int begin_tick, vector<int>& foo,
len_now=len_now*TICKS_PER_WHOLE/64;
- if (heavyDebugMsg) cout << "add " << len_now << " ticks" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "add " << len_now << " ticks" << endl;
if (allow_dots)
{
for (int i=0;i<=MAX_QUANT_POWER;i++)
@@ -2127,7 +2142,7 @@ void staff_t::create_itemlist()
note_pos_t notepos=note_pos(pitch,tmp_key,clef);
- if (heavyDebugMsg)
+ if (MusEGlobal::heavyDebugMsg)
{
printf("FLO: t=%i\ttype=%i\tpitch=%i\tvel=%i\tlen=%i\n",it->first, it->second.type, it->second.pitch, it->second.vel, it->second.len);
cout << "\tline="<<notepos.height<<"\tvorzeichen="<<notepos.vorzeichen << endl;
@@ -2140,7 +2155,7 @@ void staff_t::create_itemlist()
if (lastevent==last_measure) //there was no note?
{
unsigned tmppos=(last_measure+t-parent->quant_ticks())/2;
- if (heavyDebugMsg) cout << "\tend-of-measure: this was an empty measure. inserting rest in between at t="<<tmppos << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\tend-of-measure: this was an empty measure. inserting rest in between at t="<<tmppos << endl;
itemlist[tmppos].insert( FloItem(FloItem::REST,notepos,0,0) );
itemlist[t].insert( FloItem(FloItem::REST_END,notepos,0,0) );
}
@@ -2150,13 +2165,13 @@ void staff_t::create_itemlist()
int rest=t-lastevent;
if (rest)
{
- if (heavyDebugMsg) printf("\tend-of-measure: set rest at %i with len %i\n",lastevent,rest);
+ if (MusEGlobal::heavyDebugMsg) printf("\tend-of-measure: set rest at %i with len %i\n",lastevent,rest);
list<note_len_t> lens=parse_note_len(rest,lastevent-last_measure,emphasize_list,DOTTED_RESTS,UNSPLIT_RESTS);
unsigned tmppos=lastevent;
for (list<note_len_t>::iterator x=lens.begin(); x!=lens.end(); x++)
{
- if (heavyDebugMsg) cout << "\t\tpartial rest with len="<<x->len<<", dots="<<x->dots<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\t\tpartial rest with len="<<x->len<<", dots="<<x->dots<<endl;
itemlist[tmppos].insert( FloItem(FloItem::REST,notepos,x->len,x->dots) );
tmppos+=calc_len(x->len,x->dots);
itemlist[tmppos].insert( FloItem(FloItem::REST_END,notepos,0,0) );
@@ -2176,7 +2191,7 @@ void staff_t::create_itemlist()
int rest=t-lastevent;
if (rest)
{
- if (heavyDebugMsg) printf("\tset rest at %i with len %i\n",lastevent,rest);
+ if (MusEGlobal::heavyDebugMsg) printf("\tset rest at %i with len %i\n",lastevent,rest);
// no need to check if the rest crosses measure boundaries;
// it can't.
@@ -2184,7 +2199,7 @@ void staff_t::create_itemlist()
unsigned tmppos=lastevent;
for (list<note_len_t>::iterator x=lens.begin(); x!=lens.end(); x++)
{
- if (heavyDebugMsg) cout << "\t\tpartial rest with len="<<x->len<<", dots="<<x->dots<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\t\tpartial rest with len="<<x->len<<", dots="<<x->dots<<endl;
itemlist[tmppos].insert( FloItem(FloItem::REST,notepos,x->len,x->dots) );
tmppos+=calc_len(x->len,x->dots);
itemlist[tmppos].insert( FloItem(FloItem::REST_END,notepos,0,0) );
@@ -2193,7 +2208,7 @@ void staff_t::create_itemlist()
- if (heavyDebugMsg) printf("\tset note at %i with len=%i\n", t, len);
+ if (MusEGlobal::heavyDebugMsg) printf("\tset note at %i with len=%i\n", t, len);
int tmplen;
bool tied_note;
@@ -2210,14 +2225,14 @@ void staff_t::create_itemlist()
eventlist.insert(pair<unsigned, FloEvent>(next_measure, FloEvent(actual_tick,pitch, velo,0,FloEvent::NOTE_OFF, it->second.source_part, it->second.source_event)));
eventlist.insert(pair<unsigned, FloEvent>(next_measure, FloEvent(actual_tick,pitch, velo,newlen,FloEvent::NOTE_ON, it->second.source_part, it->second.source_event)));
- if (heavyDebugMsg) cout << "\t\tnote was split to length "<<tmplen<<" + " << newlen<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\t\tnote was split to length "<<tmplen<<" + " << newlen<<endl;
}
else
{
tmplen=len;
tied_note=false;
- if (heavyDebugMsg) cout << "\t\tinserting NOTE OFF at "<<t+len<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\t\tinserting NOTE OFF at "<<t+len<<endl;
eventlist.insert(pair<unsigned, FloEvent>(t+len, FloEvent(t+len,pitch, velo,0,FloEvent::NOTE_OFF,it->second.source_part, it->second.source_event)));
}
@@ -2227,7 +2242,7 @@ void staff_t::create_itemlist()
int count=0;
for (list<note_len_t>::iterator x=lens.begin(); x!=lens.end(); x++)
{
- if (heavyDebugMsg) cout << "\t\tpartial note with len="<<x->len<<", dots="<<x->dots<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\t\tpartial note with len="<<x->len<<", dots="<<x->dots<<endl;
count++;
bool tie;
@@ -2248,14 +2263,14 @@ void staff_t::create_itemlist()
}
else if (type==FloEvent::TIME_SIG)
{
- if (heavyDebugMsg) cout << "inserting TIME SIGNATURE "<<it->second.num<<"/"<<it->second.denom<<" at "<<t<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "inserting TIME SIGNATURE "<<it->second.num<<"/"<<it->second.denom<<" at "<<t<<endl;
itemlist[t].insert( FloItem(FloItem::TIME_SIG, it->second.num, it->second.denom) );
emphasize_list=create_emphasize_list(it->second.num, it->second.denom);
}
else if (type==FloEvent::KEY_CHANGE)
{
- if (heavyDebugMsg) cout << "inserting KEY CHANGE ("<<it->second.key<<") at "<<t<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "inserting KEY CHANGE ("<<it->second.key<<") at "<<t<<endl;
itemlist[t].insert( FloItem(FloItem::KEY_CHANGE, it->second.key) );
tmp_key=it->second.key;
}
@@ -2273,7 +2288,7 @@ void staff_t::process_itemlist()
{
set<FloItem, floComp>& curr_items=it2->second;
- if (heavyDebugMsg) cout << "at t="<<it2->first<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "at t="<<it2->first<<endl;
// phase 0: keep track of active notes, rests -------------------
// (and occupied lines) and the last measure
@@ -2290,7 +2305,7 @@ void staff_t::process_itemlist()
emphasize_list=create_emphasize_list(it->num, it->denom);
}
- if (heavyDebugMsg)
+ if (MusEGlobal::heavyDebugMsg)
{
cout << "occupied: ";
for (map<int,int>::iterator i=occupied.begin(); i!=occupied.end(); i++)
@@ -2316,7 +2331,7 @@ void staff_t::process_itemlist()
//(can be seen on already_grouped)
if ((it->type==FloItem::REST) && (it->already_grouped==false))
{
- if (heavyDebugMsg) cout << "trying to group" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "trying to group" << endl;
int lastheight;
int height_cumulative=0;
@@ -2327,12 +2342,12 @@ void staff_t::process_itemlist()
set<FloItem, floComp>::iterator tmp;
for (tmp=it; tmp!=curr_items.end();)
{
- if (heavyDebugMsg) cout << "checking if we can proceed with an item at height="<<tmp->pos.height<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "checking if we can proceed with an item at height="<<tmp->pos.height<<endl;
for (int i=lastheight+1; i<=tmp->pos.height-1; i++)
if (occupied[i]!=0)
{
- if (heavyDebugMsg) cout << "we can NOT, because occ["<<i<<"] != 0" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "we can NOT, because occ["<<i<<"] != 0" << endl;
//stop grouping that rest
goto get_out_here;
}
@@ -2344,7 +2359,7 @@ void staff_t::process_itemlist()
{
// füge diese pause zur gruppe dazu und entferne sie von diesem set hier
// entfernen aber nur, wenn sie nicht it, also die erste pause ist, die brauchen wir noch!
- if (heavyDebugMsg) cout << "\tgrouping rest at height="<<tmp->pos.height<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\tgrouping rest at height="<<tmp->pos.height<<endl;
height_cumulative+=tmp->pos.height;
counter++;
if (tmp!=it)
@@ -2354,12 +2369,12 @@ void staff_t::process_itemlist()
}
else //it's something else? well, we can stop grouping that rest then
{
- if (heavyDebugMsg) cout << "we can NOT, because that item is not a rest" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "we can NOT, because that item is not a rest" << endl;
//stop grouping that rest
goto get_out_here;
}
}
- if (heavyDebugMsg) cout << "no items to proceed on left, continuing" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "no items to proceed on left, continuing" << endl;
get_out_here:
n_groups++;
@@ -2374,7 +2389,7 @@ void staff_t::process_itemlist()
// have we grouped all available rests into one single?
if ( (n_groups==1) && (tmp==curr_items.end()) && !dont_group)
{
- if (heavyDebugMsg) cout << "wow, we were able to group all rests into one single" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "wow, we were able to group all rests into one single" << endl;
if (temp.len==0) //the whole rest is shifted one line (one space and one line)
temp.pos.height=DEFAULT_REST_HEIGHT+2;
else
@@ -2382,7 +2397,7 @@ void staff_t::process_itemlist()
}
else
{
- if (heavyDebugMsg) cout << "creating group #"<<n_groups<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "creating group #"<<n_groups<<endl;
temp.pos.height=nearbyint((float)height_cumulative/counter);
}
@@ -2393,7 +2408,7 @@ void staff_t::process_itemlist()
// the item. effect: you don't have the rest at all
curr_items.erase(it++);
- if (heavyDebugMsg) cout << "replacing all grouped rests with a rest at height="<<temp.pos.height<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "replacing all grouped rests with a rest at height="<<temp.pos.height<<endl;
curr_items.insert(temp);
}
@@ -2484,7 +2499,7 @@ group_them_again:
if (it->type==FloItem::NOTE)
lengths[it->len].add(it->pos.height);
- if (heavyDebugMsg)
+ if (MusEGlobal::heavyDebugMsg)
{
cout << "note lengths at that time are:";
for (map<int, cumulative_t>::iterator it=lengths.begin(); it!=lengths.end(); it++)
@@ -2497,14 +2512,14 @@ group_them_again:
if (lengths.size()==0)
{
- if (heavyDebugMsg) cout << "no notes other than wholes, or no notes at all. we can relax" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "no notes other than wholes, or no notes at all. we can relax" << endl;
}
else if (lengths.size()==1)
{
pair<const int, cumulative_t>& group=*(lengths.begin());
stem_t stem;
int shift=0;
- if (heavyDebugMsg) cout << "only one non-whole note group (len="<<group.first<<") at height="<<group.second.mean()<< endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "only one non-whole note group (len="<<group.first<<") at height="<<group.second.mean()<< endl;
if (group.second.mean()>=6)
{
@@ -2535,7 +2550,7 @@ group_them_again:
pair<const int, cumulative_t>& group2=*it;
stem_t stem1, stem2;
int shift1=0, shift2=0;
- if (heavyDebugMsg) cout << "two non-whole note group: len="<<group1.first<<" at height="<<group1.second.mean()<<" and len="<<group2.first<<" at height="<<group2.second.mean()<< endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "two non-whole note group: len="<<group1.first<<" at height="<<group1.second.mean()<<" and len="<<group2.first<<" at height="<<group2.second.mean()<< endl;
if (group1.second.mean()<group2.second.mean())
{
@@ -2593,17 +2608,17 @@ group_them_again:
group1_len_ticks=calc_len(group1_len,0);
group2_len_ticks=calc_len(group2_len,0);
- if (heavyDebugMsg) cout << "we have "<<lengths.size()<<" groups. putting the "<<group1_n<<" longest and the "<<group2_n<<"shortest groups together"<<endl <<
+ if (MusEGlobal::heavyDebugMsg) cout << "we have "<<lengths.size()<<" groups. putting the "<<group1_n<<" longest and the "<<group2_n<<"shortest groups together"<<endl <<
"\tgroup1 will have len="<<group1_len<<" ("<<group1_len_ticks<<" ticks), group2 will have len="<<group2_len<<" ("<<group2_len_ticks<<" ticks)"<<endl;
for (set<FloItem, floComp>::iterator it=curr_items.begin(); it!=curr_items.end();)
if (it->type==FloItem::NOTE)
{
//if *it belongs to group1 and has not already its destination length
- if (heavyDebugMsg) cout << "\tprocessing note-item with len="<<it->len<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\tprocessing note-item with len="<<it->len<<endl;
if (it->len<group1_len)
{
- if (heavyDebugMsg) cout << "\t\thas to be changed to fit into group 1" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\t\thas to be changed to fit into group 1" << endl;
FloItem tmp=*it;
curr_items.erase(it++);
@@ -2628,7 +2643,7 @@ group_them_again:
int count=0;
for (list<note_len_t>::iterator x=lens.begin(); x!=lens.end(); x++)
{
- if (heavyDebugMsg) cout << "\t\twhile regrouping: partial note with len="<<x->len<<", dots="<<x->dots<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\t\twhile regrouping: partial note with len="<<x->len<<", dots="<<x->dots<<endl;
count++;
bool tie;
@@ -2647,7 +2662,7 @@ group_them_again:
//else if *it belongs to group2 and has not already its destination length
else if ((it->len<group2_len) && (it->len>group1_len))
{
- if (heavyDebugMsg) cout << "\t\thas to be changed to fit into group 2" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\t\thas to be changed to fit into group 2" << endl;
FloItem tmp=*it;
curr_items.erase(it++);
@@ -2673,7 +2688,7 @@ group_them_again:
int count=0;
for (list<note_len_t>::iterator x=lens.begin(); x!=lens.end(); x++)
{
- if (heavyDebugMsg) cout << "\t\twhile regrouping: partial note with len="<<x->len<<", dots="<<x->dots<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\t\twhile regrouping: partial note with len="<<x->len<<", dots="<<x->dots<<endl;
count++;
bool tie;
@@ -2691,7 +2706,7 @@ group_them_again:
}
else //nothing to do?
{
- if (heavyDebugMsg) cout << "\t\tnothing to do" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\t\tnothing to do" << endl;
it++;
}
}
@@ -2707,7 +2722,7 @@ group_them_again:
//draw a pixmap centered
void ScoreCanvas::draw_pixmap(QPainter& p, int x, int y, const QPixmap& pm)
{
- if (heavyDebugMsg) cout << "drawing pixmap with size="<<pm.width()<<"/"<<pm.height()<<" at "<<x<<"/"<<y<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "drawing pixmap with size="<<pm.width()<<"/"<<pm.height()<<" at "<<x<<"/"<<y<<endl;
p.drawPixmap(x-pm.width()/2,y-pm.height()/2,pm);
}
@@ -2924,7 +2939,7 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte
for (ScoreItemList::iterator it2=from_it; it2!=to_it; it2++)
{
- if (heavyDebugMsg) cout << "at t="<<it2->first << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "at t="<<it2->first << endl;
int upstem_y1 = -1, upstem_y2=-1, upstem_x=-1, upflag=-1;
int downstem_y1 = -1, downstem_y2=-1, downstem_x=-1, downflag=-1;
@@ -2933,7 +2948,7 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte
{
if (it->type==FloItem::NOTE)
{
- if (heavyDebugMsg)
+ if (MusEGlobal::heavyDebugMsg)
{
cout << "\tNOTE at line"<<it->pos.height<<" with acc.="<<it->pos.vorzeichen<<", len="<<pow(2,it->len);
for (int i=0;i<it->dots;i++) cout << ".";
@@ -3067,7 +3082,7 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte
//if needed, draw tie
if (it->is_tie_dest)
{
- if (heavyDebugMsg) cout << "drawing tie" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "drawing tie" << endl;
draw_tie(p,it->tie_from_x-x_pos+x_left,it->x -x_pos+x_left,y_offset + it->y, (it->len==0) ? true : (it->stem==DOWNWARDS) , mycolors[color_index]);
// in english: "if it's a whole note, tie is upwards (true). if not, tie is upwards if
// stem is downwards and vice versa"
@@ -3075,7 +3090,7 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte
}
else if (it->type==FloItem::REST)
{
- if (heavyDebugMsg)
+ if (MusEGlobal::heavyDebugMsg)
{
cout << "\tREST at line"<<it->pos.height<<" with len="<<pow(2,it->len);
for (int i=0;i<it->dots;i++) cout << ".";
@@ -3105,7 +3120,7 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte
}
else if (it->type==FloItem::BAR)
{
- if (heavyDebugMsg) cout << "\tBAR" << endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\tBAR" << endl;
p.setPen(Qt::black);
p.drawLine(it->x -x_pos+x_left,y_offset -2*YLEN,it->x -x_pos+x_left,y_offset +2*YLEN);
@@ -3115,14 +3130,14 @@ void ScoreCanvas::draw_items(QPainter& p, int y_offset, staff_t& staff, ScoreIte
}
else if (it->type==FloItem::TIME_SIG)
{
- if (heavyDebugMsg) cout << "\tTIME SIGNATURE: "<<it->num<<"/"<<it->denom<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\tTIME SIGNATURE: "<<it->num<<"/"<<it->denom<<endl;
draw_timesig(p, it->x - x_pos+x_left, y_offset, it->num, it->denom);
}
else if (it->type==FloItem::KEY_CHANGE)
{
key_enum new_key=it->key;
- if (heavyDebugMsg) cout << "\tKEY CHANGE: from "<<curr_key<<" to "<<new_key<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "\tKEY CHANGE: from "<<curr_key<<" to "<<new_key<<endl;
list<int> aufloes_list=calc_accidentials(curr_key, staff.clef, new_key);
list<int> new_acc_list=calc_accidentials(new_key, staff.clef);
@@ -3333,7 +3348,7 @@ void ScoreCanvas::draw_number(QPainter& p, int x, int y, int n)
void ScoreCanvas::draw(QPainter& p, const QRect&)
{
- if (debugMsg) cout <<"now in ScoreCanvas::draw"<<endl;
+ if (MusEGlobal::debugMsg) cout <<"now in ScoreCanvas::draw"<<endl;
@@ -3356,7 +3371,7 @@ void ScoreCanvas::draw(QPainter& p, const QRect&)
p.drawRect(lasso);
}
- if (debugMsg) cout << "drawing done." << endl;
+ if (MusEGlobal::debugMsg) cout << "drawing done." << endl;
}
@@ -3539,7 +3554,7 @@ void ScoreCanvas::mousePressEvent (QMouseEvent* event)
{
ScoreItemList& itemlist=staff_it->itemlist;
- if (debugMsg) cout << "mousePressEvent at "<<x<<"/"<<y<<"; tick="<<tick<<endl;
+ if (MusEGlobal::debugMsg) cout << "mousePressEvent at "<<x<<"/"<<y<<"; tick="<<tick<<endl;
set<FloItem, floComp>::iterator set_it;
for (set_it=itemlist[tick].begin(); set_it!=itemlist[tick].end(); set_it++)
if (set_it->type==FloItem::NOTE)
@@ -3595,7 +3610,7 @@ void ScoreCanvas::mousePressEvent (QMouseEvent* event)
mouse_x_drag_operation=NO_OP;
}
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
cout << "you clicked at a note with begin at "<<set_it->begin_tick<<" and end at "<<t<<endl
<< "x-drag-operation will be "<<mouse_x_drag_operation<<endl
<< "pointer to part is "<<set_it->source_part << endl;
@@ -3663,13 +3678,13 @@ void ScoreCanvas::mousePressEvent (QMouseEvent* event)
if (flo_quantize(newevent.lenTick(), quant_ticks()) <= 0)
{
newevent.setLenTick(quant_ticks());
- if (debugMsg) cout << "inserted note's length would be invisible after quantisation (too short)." << endl <<
+ if (MusEGlobal::debugMsg) cout << "inserted note's length would be invisible after quantisation (too short)." << endl <<
" setting it to " << newevent.lenTick() << endl;
}
if (newevent.endTick() > curr_part->lenTick())
{
- if (debugMsg) cout << "clipping inserted note from len="<<newevent.endTick()<<" to len="<<(curr_part->lenTick() - newevent.tick())<<endl;
+ if (MusEGlobal::debugMsg) cout << "clipping inserted note from len="<<newevent.endTick()<<" to len="<<(curr_part->lenTick() - newevent.tick())<<endl;
newevent.setLenTick(curr_part->lenTick() - newevent.tick());
}
@@ -3718,7 +3733,7 @@ void ScoreCanvas::mouseReleaseEvent (QMouseEvent* event)
{
if (flo_quantize(dragged_event.lenTick(), quant_ticks()) <= 0)
{
- if (debugMsg) cout << "new length <= 0, erasing item" << endl;
+ if (MusEGlobal::debugMsg) cout << "new length <= 0, erasing item" << endl;
if (undo_started) song->undo();
audio->msgDeleteEvent(dragged_event, dragged_event_part, true, false, false);
}
@@ -3818,13 +3833,13 @@ void ScoreCanvas::mouseMoveEvent (QMouseEvent* event)
{
if ((abs(dx)>DRAG_INIT_DISTANCE) && (mouse_x_drag_operation!=NO_OP))
{
- if (debugMsg) cout << "mouse-operation is now "<<mouse_x_drag_operation<<endl;
+ if (MusEGlobal::debugMsg) cout << "mouse-operation is now "<<mouse_x_drag_operation<<endl;
mouse_operation=mouse_x_drag_operation;
setCursor(Qt::SizeHorCursor);
}
else if (abs(dy)>DRAG_INIT_DISTANCE)
{
- if (debugMsg) cout << "mouse-operation is now PITCH" << endl;
+ if (MusEGlobal::debugMsg) cout << "mouse-operation is now PITCH" << endl;
mouse_operation=PITCH;
setCursor(Qt::SizeVerCursor);
}
@@ -3855,7 +3870,7 @@ void ScoreCanvas::mouseMoveEvent (QMouseEvent* event)
break;
case PITCH:
- if (heavyDebugMsg) cout << "trying to change pitch, delta="<<-nearbyint((float)dy/PITCH_DELTA)<<endl;
+ if (MusEGlobal::heavyDebugMsg) cout << "trying to change pitch, delta="<<-nearbyint((float)dy/PITCH_DELTA)<<endl;
new_pitch=original_dragged_event.pitch() - nearbyint((float)dy/PITCH_DELTA);
if (new_pitch < 0) new_pitch=0;
@@ -3863,7 +3878,7 @@ void ScoreCanvas::mouseMoveEvent (QMouseEvent* event)
if (new_pitch != old_pitch)
{
- if (debugMsg) cout << "changing pitch, delta="<<new_pitch-original_dragged_event.pitch()<<endl;
+ if (MusEGlobal::debugMsg) cout << "changing pitch, delta="<<new_pitch-original_dragged_event.pitch()<<endl;
if (undo_started) song->undo();
undo_started=transpose_notes(part_to_set(dragged_event_part),1, new_pitch-original_dragged_event.pitch());
old_pitch=new_pitch;
@@ -3881,7 +3896,7 @@ void ScoreCanvas::mouseMoveEvent (QMouseEvent* event)
else
{
dest_tick=0;
- if (debugMsg) cout << "not moving note before begin of part; setting it directly to the begin" << endl;
+ if (MusEGlobal::debugMsg) cout << "not moving note before begin of part; setting it directly to the begin" << endl;
}
if (dest_tick != old_dest_tick)
@@ -3907,7 +3922,7 @@ void ScoreCanvas::mouseMoveEvent (QMouseEvent* event)
else
{
tmp.setLenTick(0);
- if (debugMsg) cout << "not setting len to a negative value. using 0 instead" << endl;
+ if (MusEGlobal::debugMsg) cout << "not setting len to a negative value. using 0 instead" << endl;
}
unsigned newpartlen=dragged_event_part->lenTick();
@@ -3916,12 +3931,12 @@ void ScoreCanvas::mouseMoveEvent (QMouseEvent* event)
if (dragged_event_part->hasHiddenEvents()) // do not allow autoexpand
{
tmp.setLenTick(dragged_event_part->lenTick() - tmp.tick());
- if (debugMsg) cout << "resized note would exceed its part; limiting length to " << tmp.lenTick() << endl;
+ if (MusEGlobal::debugMsg) cout << "resized note would exceed its part; limiting length to " << tmp.lenTick() << endl;
}
else
{
newpartlen=tmp.endTick();
- if (debugMsg) cout << "resized note would exceeds its part; expanding the part..." << endl;
+ if (MusEGlobal::debugMsg) cout << "resized note would exceeds its part; expanding the part..." << endl;
}
}
@@ -3997,7 +4012,7 @@ void ScoreCanvas::heartbeat_timer_event()
{
int old_xpos=x_pos;
- x_scroll_pos+=x_scroll_speed*heartBeatTimer->interval()/1000.0;
+ x_scroll_pos+=x_scroll_speed*MusEGlobal::heartBeatTimer->interval()/1000.0;
int tmp=int(x_scroll_pos);
if (tmp!=0)
x_pos+=tmp;
@@ -4013,7 +4028,7 @@ void ScoreCanvas::heartbeat_timer_event()
{
int old_ypos=y_pos;
- y_scroll_pos+=y_scroll_speed*heartBeatTimer->interval()/1000.0;
+ y_scroll_pos+=y_scroll_speed*MusEGlobal::heartBeatTimer->interval()/1000.0;
int tmp=int(y_scroll_pos);
if (tmp!=0)
y_pos+=tmp;
@@ -4028,14 +4043,14 @@ void ScoreCanvas::heartbeat_timer_event()
void ScoreCanvas::x_scroll_event(int x)
{
- if (debugMsg) cout << "SCROLL EVENT: x="<<x<<endl;
+ if (MusEGlobal::debugMsg) cout << "SCROLL EVENT: x="<<x<<endl;
x_pos=x;
redraw();
}
void ScoreCanvas::y_scroll_event(int y)
{
- if (debugMsg) cout << "SCROLL EVENT: y="<<y<<endl;
+ if (MusEGlobal::debugMsg) cout << "SCROLL EVENT: y="<<y<<endl;
y_pos=y;
redraw();
}
@@ -4178,9 +4193,9 @@ void ScoreCanvas::set_tool(int tool)
{
switch (tool)
{
- case PointerTool: mouse_erases_notes=false; mouse_inserts_notes=false; break;
- case RubberTool: mouse_erases_notes=true; mouse_inserts_notes=false; break;
- case PencilTool: mouse_erases_notes=false; mouse_inserts_notes=true; break;
+ case MusEWidget::PointerTool: mouse_erases_notes=false; mouse_inserts_notes=false; break;
+ case MusEWidget::RubberTool: mouse_erases_notes=true; mouse_inserts_notes=false; break;
+ case MusEWidget::PencilTool: mouse_erases_notes=false; mouse_inserts_notes=true; break;
default:
cerr << "ERROR: THIS SHOULD NEVER HAPPEN: set_tool called with unknown tool ("<<tool<<")"<<endl;
}
@@ -4239,7 +4254,7 @@ void ScoreCanvas::set_quant(int val)
void ScoreCanvas::set_pixels_per_whole(int val)
{
- if (debugMsg) cout << "setting px per whole to " << val << endl;
+ if (MusEGlobal::debugMsg) cout << "setting px per whole to " << val << endl;
int tick;
int old_xpos=x_pos;
@@ -4261,7 +4276,7 @@ void ScoreCanvas::set_pixels_per_whole(int val)
if (old_xpos!=0)
{
x_pos=tick_to_x(tick);
- if (debugMsg) cout << "x_pos was not zero, readjusting to " << x_pos << endl;
+ if (MusEGlobal::debugMsg) cout << "x_pos was not zero, readjusting to " << x_pos << endl;
emit xscroll_changed(x_pos);
}
@@ -4391,7 +4406,7 @@ void ScoreCanvas::midi_note(int pitch, int velo)
held_notes[pitch]=false;
if ( srec && selected_part && !audio->isPlaying() && velo )
- steprec->record(selected_part,pitch,quant_ticks(),quant_ticks(),velo,globalKeyState&Qt::ControlModifier,globalKeyState&Qt::ShiftModifier);
+ steprec->record(selected_part,pitch,quant_ticks(),quant_ticks(),velo,MusEGlobal::globalKeyState&Qt::ControlModifier,MusEGlobal::globalKeyState&Qt::ShiftModifier);
}
@@ -4436,17 +4451,17 @@ void ScoreEdit::keyPressEvent(QKeyEvent* event)
}
else if (key == shortcuts[SHRT_TOOL_POINTER].key)
{
- edit_tools->set(PointerTool);
+ edit_tools->set(MusEWidget::PointerTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_PENCIL].key)
{
- edit_tools->set(PencilTool);
+ edit_tools->set(MusEWidget::PencilTool);
return;
}
else if (key == shortcuts[SHRT_TOOL_RUBBER].key)
{
- edit_tools->set(RubberTool);
+ edit_tools->set(MusEWidget::RubberTool);
return;
}
else //Default:
diff --git a/muse2/muse/midiedit/scoreedit.h b/muse2/muse/midiedit/scoreedit.h
index 51d87634..a2a89938 100644
--- a/muse2/muse/midiedit/scoreedit.h
+++ b/muse2/muse/midiedit/scoreedit.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// scoreedit.h
// (C) Copyright 2011 Florian Jung (flo93@users.sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SCOREEDIT_H__
@@ -52,7 +67,7 @@ using std::string;
-#define TICKS_PER_WHOLE (config.division*4)
+#define TICKS_PER_WHOLE (MusEConfig::config.division*4)
#define SONG_LENGTH (song->len())
@@ -70,7 +85,10 @@ enum {CMD_COLOR_BLACK, CMD_COLOR_VELO, CMD_COLOR_PART,
class ScoreCanvas;
+
+namespace MusEWidget {
class EditToolBar;
+}
//---------------------------------------------------------
// ScoreEdit
@@ -87,7 +105,7 @@ class ScoreEdit : public TopWin
QGridLayout* mainGrid;
QWidget* mainw;
- EditToolBar* edit_tools;
+ MusEWidget::EditToolBar* edit_tools;
QSpinBox* velo_spinbox;
QSpinBox* velo_off_spinbox;
@@ -140,7 +158,7 @@ class ScoreEdit : public TopWin
QScrollBar* xscroll;
QScrollBar* yscroll;
ScoreCanvas* score_canvas;
- MTScaleFlo* time_bar;
+ MusEWidget::MTScaleFlo* time_bar;
QLabel* apply_velo_to_label;
bool apply_velo;
@@ -586,7 +604,7 @@ int calc_timesig_width(int num, int denom);
int calc_number_width(int n);
-class ScoreCanvas : public View
+class ScoreCanvas : public MusEWidget::View
{
Q_OBJECT
private:
diff --git a/muse2/muse/midieditor.cpp b/muse2/muse/midieditor.cpp
index 19ecd93f..218c0615 100644
--- a/muse2/muse/midieditor.cpp
+++ b/muse2/muse/midieditor.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: midieditor.cpp,v 1.2.2.2 2009/02/02 21:38:00 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "midieditor.h"
@@ -229,11 +244,11 @@ void MidiEditor::setCurCanvasPart(Part* part)
void MidiEditor::horizontalZoomIn()
{
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl < 23)
zoomlvl++;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
@@ -242,11 +257,11 @@ void MidiEditor::horizontalZoomIn()
void MidiEditor::horizontalZoomOut()
{
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl > 1)
zoomlvl--;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
diff --git a/muse2/muse/midieditor.h b/muse2/muse/midieditor.h
index 41967f9c..af681075 100644
--- a/muse2/muse/midieditor.h
+++ b/muse2/muse/midieditor.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: midieditor.h,v 1.3.2.2 2009/02/02 21:38:00 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDIEDITOR_H__
@@ -18,13 +33,16 @@ class QWidget;
class PartList;
class Xml;
class EventCanvas;
-class ScrollScale;
class CtrlEdit;
-class MTScale;
class WaveView;
class Part;
class WavePart;
+namespace MusEWidget {
+class MTScale;
+class ScrollScale;
+}
+
//---------------------------------------------------------
// MidiEditor
//---------------------------------------------------------
@@ -37,9 +55,9 @@ class MidiEditor : public TopWin {
int _curDrumInstrument; // currently selected instrument if drum
// editor
protected:
- ScrollScale* hscroll;
- ScrollScale* vscroll;
- MTScale* time;
+ MusEWidget::ScrollScale* hscroll;
+ MusEWidget::ScrollScale* vscroll;
+ MusEWidget::MTScale* time;
EventCanvas* canvas;
WaveView* wview;
diff --git a/muse2/muse/midievent.cpp b/muse2/muse/midievent.cpp
index ffeca3ff..c92322cb 100644
--- a/muse2/muse/midievent.cpp
+++ b/muse2/muse/midievent.cpp
@@ -4,6 +4,21 @@
// $Id: midievent.cpp,v 1.7.2.2 2009/05/24 21:43:44 terminator356 Exp $
//
// (C) Copyright 2000-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "event.h"
diff --git a/muse2/muse/midievent.h b/muse2/muse/midievent.h
index 48217f57..ab0ad6b6 100644
--- a/muse2/muse/midievent.h
+++ b/muse2/muse/midievent.h
@@ -4,6 +4,21 @@
// $Id: midievent.h,v 1.7.2.1 2009/05/24 21:43:44 terminator356 Exp $
//
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDI_EVENT_H__
diff --git a/muse2/muse/midifile.cpp b/muse2/muse/midifile.cpp
index 65cb6d25..3abf34b6 100644
--- a/muse2/muse/midifile.cpp
+++ b/muse2/muse/midifile.cpp
@@ -4,6 +4,21 @@
// $Id: midifile.cpp,v 1.17 2004/06/18 08:36:43 wschweer Exp $
//
// (C) Copyright 1999-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <errno.h>
@@ -520,7 +535,7 @@ bool MidiFile::writeTrack(const MidiFileTrack* t)
printf("MidiFile::writeTrack: ntick %d < tick %d\n", ntick, tick);
ntick = tick;
}
- putvl(((ntick - tick) * config.midiDivision + config.division/2)/config.division);
+ putvl(((ntick - tick) * MusEConfig::config.midiDivision + MusEConfig::config.division/2)/MusEConfig::config.division);
tick = ntick;
writeEvent(&(*i));
}
@@ -552,7 +567,7 @@ void MidiFile::writeEvent(const MidiPlayEvent* event)
// we dont save meta data into smf type 0 files:
- if (config.smfFormat == 0 && nstat == ME_META)
+ if (MusEConfig::config.smfFormat == 0 && nstat == ME_META)
return;
nstat |= c;
@@ -602,8 +617,8 @@ bool MidiFile::write()
{
write("MThd", 4);
writeLong(6); // header len
- writeShort(config.smfFormat);
- if (config.smfFormat == 0) {
+ writeShort(MusEConfig::config.smfFormat);
+ if (MusEConfig::config.smfFormat == 0) {
writeShort(1);
MidiFileTrack dst;
for (iMidiFileTrack i = _tracks->begin(); i != _tracks->end(); ++i) {
diff --git a/muse2/muse/midifile.h b/muse2/muse/midifile.h
index da71a00a..5f4c6231 100644
--- a/muse2/muse/midifile.h
+++ b/muse2/muse/midifile.h
@@ -4,6 +4,21 @@
// $Id: midifile.h,v 1.3 2004/01/04 18:24:43 wschweer Exp $
//
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDIFILE_H__
diff --git a/muse2/muse/midiport.cpp b/muse2/muse/midiport.cpp
index 553c8e31..a2e23cee 100644
--- a/muse2/muse/midiport.cpp
+++ b/muse2/muse/midiport.cpp
@@ -4,6 +4,21 @@
// $Id: midiport.cpp,v 1.21.2.15 2009/12/07 20:11:51 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
//#include "config.h"
@@ -800,7 +815,7 @@ bool MidiPort::sendEvent(const MidiPlayEvent& ev, bool forceSend)
// }
// printf("set HW Ctrl State ch:%d 0x%x 0x%x\n", ev.channel(), ev.dataA(), ev.dataB());
if(!setHwCtrlState(ev.channel(), da, db)) {
- if (debugMsg && forceSend)
+ if (MusEGlobal::debugMsg && forceSend)
printf("sendEvent: State already set. Forcing anyway...\n");
if (!forceSend)
return false;
@@ -830,7 +845,7 @@ bool MidiPort::sendEvent(const MidiPlayEvent& ev, bool forceSend)
if (!_device) {
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("no device for this midi port\n");
return true;
}
@@ -861,7 +876,7 @@ int MidiPort::hwCtrlState(int ch, int ctrl) const
ch &= 0xff;
iMidiCtrlValList cl = _controller->find(ch, ctrl);
if (cl == _controller->end()) {
- //if (debugMsg)
+ //if (MusEGlobal::debugMsg)
// printf("hwCtrlState: chan %d ctrl 0x%x not found\n", ch, ctrl);
return CTRL_VAL_UNKNOWN;
}
@@ -884,7 +899,7 @@ bool MidiPort::setHwCtrlState(int ch, int ctrl, int val)
// muse->importController(ch, this, ctrl);
// cl = _controller->find(ch, ctrl);
// if (cl == _controller->end()) {
- // if (debugMsg)
+ // if (MusEGlobal::debugMsg)
// printf("setHwCtrlState(%d,0x%x,0x%x): not found\n", ch, ctrl, val);
// return;
// }
@@ -922,11 +937,11 @@ bool MidiPort::setHwCtrlStates(int ch, int ctrl, int val, int lastval)
//bool MidiPort::setCtrl(int ch, int tick, int ctrl, int val)
// {
-// if (debugMsg)
+// if (MusEGlobal::debugMsg)
// printf("setCtrl(tick=%d val=%d)\n",tick,val);
// iMidiCtrlValList cl = _controller->find(ch, ctrl);
// if (cl == _controller->end()) {
-// if (debugMsg)
+// if (MusEGlobal::debugMsg)
// printf("setCtrl: controller 0x%x for channel %d not found\n", ctrl, ch);
// return false;
// }
@@ -963,7 +978,7 @@ int MidiPort::getCtrl(int ch, int tick, int ctrl) const
{
iMidiCtrlValList cl = _controller->find(ch, ctrl);
if (cl == _controller->end()) {
- //if (debugMsg)
+ //if (MusEGlobal::debugMsg)
// printf("getCtrl: controller %d(0x%x) for channel %d not found size %zd\n",
// ctrl, ctrl, ch, _controller->size());
return CTRL_VAL_UNKNOWN;
@@ -975,7 +990,7 @@ int MidiPort::getCtrl(int ch, int tick, int ctrl, Part* part) const
{
iMidiCtrlValList cl = _controller->find(ch, ctrl);
if (cl == _controller->end()) {
- //if (debugMsg)
+ //if (MusEGlobal::debugMsg)
// printf("getCtrl: controller %d(0x%x) for channel %d not found size %zd\n",
// ctrl, ctrl, ch, _controller->size());
return CTRL_VAL_UNKNOWN;
@@ -990,7 +1005,7 @@ void MidiPort::deleteController(int ch, int tick, int ctrl, Part* part)
{
iMidiCtrlValList cl = _controller->find(ch, ctrl);
if (cl == _controller->end()) {
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("deleteController: controller %d(0x%x) for channel %d not found size %zd\n",
ctrl, ctrl, ch, _controller->size());
return;
diff --git a/muse2/muse/midiport.h b/muse2/muse/midiport.h
index 916c7337..25b11696 100644
--- a/muse2/muse/midiport.h
+++ b/muse2/muse/midiport.h
@@ -4,6 +4,21 @@
// $Id: midiport.h,v 1.9.2.6 2009/11/17 22:08:22 terminator356 Exp $
//
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDIPORT_H__
diff --git a/muse2/muse/midiseq.cpp b/muse2/muse/midiseq.cpp
index aaf3f7dd..2f1174cd 100644
--- a/muse2/muse/midiseq.cpp
+++ b/muse2/muse/midiseq.cpp
@@ -6,6 +6,21 @@
// high priority task for scheduling midi events
//
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QMessageBox>
@@ -59,20 +74,25 @@ void MidiSeq::processMsg(const ThreadMsg* m)
//case MS_PROCESS:
// audio->processMidi();
// break;
- case SEQM_SEEK:
- processSeek();
- break;
- case MS_STOP:
- processStop();
- break;
+
+ // Removed p4.0.34
+ //case SEQM_SEEK:
+ // processSeek();
+ // break;
+ //case MS_STOP:
+ // processStop();
+ // break;
+
case MS_SET_RTC:
- doSetuid();
+ MusEGlobal::doSetuid();
setRtcTicks();
- undoSetuid();
+ MusEGlobal::undoSetuid();
break;
case MS_UPDATE_POLL_FD:
updatePollFd();
break;
+ // Moved into Song::processMsg p4.0.34
+ /*
case SEQM_ADD_TRACK:
song->insertTrack2(msg->track, msg->ival);
updatePollFd();
@@ -95,6 +115,7 @@ void MidiSeq::processMsg(const ThreadMsg* m)
//song->cmdChangePart((Part*)msg->p1, (Part*)msg->p2);
song->cmdChangePart((Part*)msg->p1, (Part*)msg->p2, msg->a, msg->b);
break;
+ */
case SEQM_SET_TRACK_OUT_CHAN:
{
MidiTrack* track = (MidiTrack*)(msg->p1);
@@ -126,6 +147,8 @@ void MidiSeq::processMsg(const ThreadMsg* m)
}
}
+#if 0
+// Removed p4.0.34
//---------------------------------------------------------
// processStop
//---------------------------------------------------------
@@ -133,8 +156,8 @@ void MidiSeq::processMsg(const ThreadMsg* m)
void MidiSeq::processStop()
{
// p3.3.28
- // TODO Try to move this into Audio::stopRolling(). p4.0.22
- playStateExt = false; // not playing
+ // TODO Try to move this into Audio::stopRolling(). p4.0.22 // Done p4.0.34
+ //playStateExt = false; // not playing
//
// clear Alsa midi device notes and stop stuck notes
@@ -142,10 +165,10 @@ void MidiSeq::processStop()
//
for(iMidiDevice id = midiDevices.begin(); id != midiDevices.end(); ++id)
{
- MidiDevice* md = *id;
- if(md->deviceType() == MidiDevice::JACK_MIDI) // p4.0.22
- continue;
- md->handleStop(); // p4.0.22
+ //MidiDevice* md = *id;
+ // Only ALSA devices are handled by this thread.
+ if((*id)->deviceType() == MidiDevice::ALSA_MIDI) // p4.0.22
+ (*id)->handleStop(); // p4.0.22
/*
if (md->midiPort() == -1)
continue;
@@ -163,18 +186,20 @@ void MidiSeq::processStop()
*/
}
}
+#endif
+#if 0
+// Removed p4.0.34
//---------------------------------------------------------
// processSeek
//---------------------------------------------------------
void MidiSeq::processSeek()
{
- int pos = audio->tickPos();
-
- // TODO Try to move this into audio::seek(). p4.0.22
- if (pos == 0 && !song->record())
- audio->initDevices();
+ //int pos = audio->tickPos();
+ // TODO Try to move this into audio::seek(). p4.0.22 Done p4.0.34
+ //if (pos == 0 && !song->record())
+ // audio->initDevices();
//---------------------------------------------------
// set all controller
@@ -182,13 +207,10 @@ void MidiSeq::processSeek()
for (iMidiDevice i = midiDevices.begin(); i != midiDevices.end(); ++i)
{
- MidiDevice* md = *i;
- //
- // Jack midi devices are handled in Audio::seek()
- //
- if(md->deviceType() == MidiDevice::JACK_MIDI) // p4.0.22
- continue;
- md->handleSeek(); // p4.0.22
+ //MidiDevice* md = *i;
+ // Only ALSA devices are handled by this thread.
+ if((*i)->deviceType() == MidiDevice::ALSA_MIDI) // p4.0.22
+ (*i)->handleSeek(); // p4.0.22
/*
int port = md->midiPort();
if (port == -1)
@@ -239,6 +261,7 @@ void MidiSeq::processSeek()
*/
}
}
+#endif
//---------------------------------------------------------
// MidiSeq
@@ -261,9 +284,9 @@ MidiSeq::MidiSeq(const char* name)
lastTempo = 0;
storedtimediffs = 0;
playStateExt = false; // not playing
- doSetuid();
+ MusEGlobal::doSetuid();
timerFd=selectTimer();
- undoSetuid();
+ MusEGlobal::undoSetuid();
}
@@ -399,7 +422,7 @@ void MidiSeq::updatePollFd()
if (timerFd == -1) {
fprintf(stderr, "updatePollFd: no timer fd\n");
- if (!debugMode)
+ if (!MusEGlobal::debugMode)
exit(-1);
}
@@ -412,7 +435,7 @@ void MidiSeq::updatePollFd()
for (iMidiDevice imd = midiDevices.begin(); imd != midiDevices.end(); ++imd) {
MidiDevice* dev = *imd;
int port = dev->midiPort();
- const QString name = dev->name();
+ //const QString name = dev->name();
if (port == -1)
continue;
if ((dev->rwFlags() & 0x2) || (extSyncFlag.value()
@@ -457,11 +480,11 @@ void MidiSeq::threadStop()
bool MidiSeq::setRtcTicks()
{
- //timer.setTimerFreq(config.rtcTicks);
+ //timer.setTimerFreq(MusEConfig::config.rtcTicks);
//timer.startTimer();
- timer->setTimerFreq(config.rtcTicks);
+ timer->setTimerFreq(MusEConfig::config.rtcTicks);
timer->startTimer();
- realRtcTicks = config.rtcTicks;
+ realRtcTicks = MusEConfig::config.rtcTicks;
return true;
}
@@ -479,12 +502,12 @@ void MidiSeq::start(int priority)
//timerFd = -1;
- doSetuid();
+ MusEGlobal::doSetuid();
//timerFd = selectTimer();
//timerFd = timer.initTimer();
//printf("timerFd=%d\n",timerFd);
setRtcTicks();
- undoSetuid();
+ MusEGlobal::undoSetuid();
//Thread::start();
Thread::start(priority);
//return false;
@@ -511,7 +534,7 @@ void MidiSeq::processMidiClock()
midiClick = sigmap.bar2tick(bar, beat+1, 0);
double cpos = tempomap.tick2time(playTickPos);
- samplePosStart = samplePos - lrint(cpos * sampleRate);
+ samplePosStart = samplePos - lrint(cpos * MusEGlobal::sampleRate);
rtcTickStart = rtcTick - lrint(cpos * realRtcTicks);
endSlice = playTickPos;
@@ -523,7 +546,7 @@ void MidiSeq::processMidiClock()
startRecordPos.setPosTick(playTickPos);
}
*/
-// midiClock += config.division/24;
+// midiClock += MusEConfig::config.division/24;
}
//---------------------------------------------------------
@@ -593,10 +616,10 @@ void MidiSeq::processTimerTick()
if (!extSyncFlag.value()) {
//int curTick = tempomap.frame2tick(curFrame);
// Copied from Tempomap.
- //int curTick = lrint((double(curFrame)/double(sampleRate)) * tempomap.globalTempo() * config.division * 10000.0 / double(tempomap.tempo(song->cpos())));
- //int curTick = lrint((double(curFrame)/double(sampleRate)) * tempomap.globalTempo() * 240000.0 / double(tempomap.tempo(song->cpos())));
- int curTick = lrint((double(curFrame)/double(sampleRate)) * double(tempomap.globalTempo()) * double(config.division) * 10000.0 / double(tempomap.tempo(song->cpos())));
- //int curTick = int((double(curFrame)/double(sampleRate)) * double(tempomap.globalTempo()) * double(config.division * 10000.0) / double(tempomap.tempo(song->cpos())));
+ //int curTick = lrint((double(curFrame)/double(MusEGlobal::sampleRate)) * tempomap.globalTempo() * MusEConfig::config.division * 10000.0 / double(tempomap.tempo(song->cpos())));
+ //int curTick = lrint((double(curFrame)/double(MusEGlobal::sampleRate)) * tempomap.globalTempo() * 240000.0 / double(tempomap.tempo(song->cpos())));
+ int curTick = lrint((double(curFrame)/double(MusEGlobal::sampleRate)) * double(tempomap.globalTempo()) * double(MusEConfig::config.division) * 10000.0 / double(tempomap.tempo(song->cpos())));
+ //int curTick = int((double(curFrame)/double(MusEGlobal::sampleRate)) * double(tempomap.globalTempo()) * double(MusEConfig::config.division * 10000.0) / double(tempomap.tempo(song->cpos())));
/* if ( midiClock > curTick + 100) // reinitialize
{
@@ -610,7 +633,7 @@ void MidiSeq::processTimerTick()
if(midiClock > curTick)
midiClock = curTick;
- int div = config.division/24;
+ int div = MusEConfig::config.division/24;
if(curTick >= midiClock + div) {
//if(curTick >= midiClock) {
//processMidiClock();
@@ -674,7 +697,7 @@ void MidiSeq::processTimerTick()
}
*/
- if(debugMsg && used && perr > 1)
+ if(MusEGlobal::debugMsg && used && perr > 1)
printf("Dropped %d midi out clock(s). curTick:%d midiClock:%d div:%d\n", perr, curTick, midiClock, div);
//}
@@ -710,20 +733,26 @@ void MidiSeq::processTimerTick()
// }
// p3.3.25
- int tickpos = audio->tickPos();
- bool extsync = extSyncFlag.value();
+ //int tickpos = audio->tickPos();
+ //bool extsync = extSyncFlag.value();
//
// play all events upto curFrame
//
for (iMidiDevice id = midiDevices.begin(); id != midiDevices.end(); ++id) {
- MidiDevice* md = *id;
+ //MidiDevice* md = *id;
// Is it a Jack midi device? They are iterated in Audio::processMidi. p3.3.36
//MidiJackDevice* mjd = dynamic_cast<MidiJackDevice*>(md);
//if(mjd)
- if(md->deviceType() == MidiDevice::JACK_MIDI)
- continue;
- if(md->isSynti()) // syntis are handled by audio thread
- continue;
+ //if(md->deviceType() == MidiDevice::JACK_MIDI)
+ // continue;
+ //if(md->isSynti()) // syntis are handled by audio thread
+ // continue;
+ // Only ALSA midi devices are handled by this thread.
+ if((*id)->deviceType() == MidiDevice::ALSA_MIDI)
+ (*id)->processMidi();
+
+ // Moved into MidiAlsaDevice. p4.0.34
+ /*
int port = md->midiPort();
MidiPort* mp = port != -1 ? &midiPorts[port] : 0;
MPEventList* el = md->playEvents();
@@ -761,6 +790,8 @@ void MidiSeq::processTimerTick()
// The erasure in Audio::processMidi was missing some events because of that.
el->erase(el->begin(), i);
//md->setNextPlayEvent(el->begin()); // Removed p4.0.15
+ */
+
}
}
@@ -798,8 +829,8 @@ void MidiSeq::msgSetMidiDevice(MidiPort* port, MidiDevice* device)
// This does not appear to be used anymore. Was called in Audio::process1, now Audio::processMidi is called directly. p4.0.15 Tim.
//void MidiSeq::msgProcess() { msgMsg(MS_PROCESS); }
-void MidiSeq::msgSeek() { msgMsg(SEQM_SEEK); }
-void MidiSeq::msgStop() { msgMsg(MS_STOP); }
+//void MidiSeq::msgSeek() { msgMsg(SEQM_SEEK); } // Removed p4.0.34
+//void MidiSeq::msgStop() { msgMsg(MS_STOP); } //
void MidiSeq::msgSetRtc() { msgMsg(MS_SET_RTC); }
void MidiSeq::msgUpdatePollFd() { msgMsg(MS_UPDATE_POLL_FD); }
diff --git a/muse2/muse/midiseq.h b/muse2/muse/midiseq.h
index a11820fe..1e6ebf2a 100644
--- a/muse2/muse/midiseq.h
+++ b/muse2/muse/midiseq.h
@@ -4,6 +4,21 @@
// $Id: midiseq.h,v 1.6.2.11 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDISEQ_H__
@@ -76,6 +91,8 @@ class MidiSeq : public Thread {
virtual void threadStop();
virtual void threadStart(void*);
+ bool externalPlayState() const { return playStateExt; }
+ void setExternalPlayState(bool v) { playStateExt = v; }
void realtimeSystemInput(int, int);
void mtcInputQuarter(int, unsigned char);
void setSongPosition(int, int);
@@ -86,9 +103,9 @@ class MidiSeq : public Thread {
void nonRealtimeSystemSysex(int, const unsigned char*, int);
void msgMsg(int id);
- void msgProcess();
- void msgSeek();
- void msgStop();
+ //void msgProcess();
+ //void msgSeek();
+ //void msgStop();
void msgSetRtc();
void msgUpdatePollFd();
void msgAddSynthI(SynthI* synth);
diff --git a/muse2/muse/miditransform.cpp b/muse2/muse/miditransform.cpp
index 9e9c87c0..76a39306 100644
--- a/muse2/muse/miditransform.cpp
+++ b/muse2/muse/miditransform.cpp
@@ -4,6 +4,21 @@
// $Id: miditransform.cpp,v 1.8.2.3 2009/05/24 21:43:44 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -113,7 +128,7 @@ class MidiTransformation {
procPos = Keep;
procPosA = 0;
funcOp = Select;
- quantVal = config.division;
+ quantVal = MusEConfig::config.division;
selectedTracks = false;
insideLoop = false;
}
diff --git a/muse2/muse/miditransform.h b/muse2/muse/miditransform.h
index 4cf444bd..c0d69fe3 100644
--- a/muse2/muse/miditransform.h
+++ b/muse2/muse/miditransform.h
@@ -4,6 +4,21 @@
// $Id: miditransform.h,v 1.2.2.2 2009/02/02 21:38:00 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDITRANSFORM_H__
diff --git a/muse2/muse/mixer/CMakeLists.txt b/muse2/muse/mixer/CMakeLists.txt
index 3d76ebd6..f8365038 100644
--- a/muse2/muse/mixer/CMakeLists.txt
+++ b/muse2/muse/mixer/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
@@ -26,7 +29,6 @@ QT4_WRAP_CPP ( mixer_mocs
astrip.h
auxknob.h
mstrip.h
- panknob.h
rack.h
routedialog.h
strip.h
@@ -48,7 +50,6 @@ file (GLOB mixer_source_files
astrip.cpp
auxknob.cpp
mstrip.cpp
- panknob.cpp
rack.cpp
routedialog.cpp
strip.cpp
diff --git a/muse2/muse/mixer/amixer.cpp b/muse2/muse/mixer/amixer.cpp
index f59a2187..08e1aad4 100644
--- a/muse2/muse/mixer/amixer.cpp
+++ b/muse2/muse/mixer/amixer.cpp
@@ -4,6 +4,21 @@
// $Id: amixer.cpp,v 1.49.2.5 2009/11/16 01:55:55 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <list>
@@ -30,7 +45,10 @@
#include "gconfig.h"
#include "xml.h"
+//namespace MusEApp { FINDMICHJETZT dirty, dirty. this is implemented in arrangerview.cpp,
+// currently in global namespace. where to put it? in an own code file? helper.cpp?
extern QActionGroup* populateAddTrack(QMenu* addTrack);
+//}
#define __WIDTH_COMPENSATION 4
@@ -143,7 +161,7 @@ bool ScrollArea::viewportEvent(QEvent* event)
// inputs | synthis | tracks | groups | master
//---------------------------------------------------------
-AudioMixerApp::AudioMixerApp(QWidget* parent, MixerConfig* c)
+AudioMixerApp::AudioMixerApp(QWidget* parent, MusEConfig::MixerConfig* c)
: QMainWindow(parent)
{
cfg = c;
@@ -219,7 +237,7 @@ AudioMixerApp::AudioMixerApp(QWidget* parent, MixerConfig* c)
///connect(this, SIGNAL(layoutRequest()), SLOT(setSizing()));
connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
- connect(muse, SIGNAL(configChanged()), SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged()));
song->update(); // calls update mixer
}
diff --git a/muse2/muse/mixer/amixer.h b/muse2/muse/mixer/amixer.h
index ca8a3f4c..1726ba7b 100644
--- a/muse2/muse/mixer/amixer.h
+++ b/muse2/muse/mixer/amixer.h
@@ -4,6 +4,21 @@
// $Id: amixer.h,v 1.27.2.2 2009/10/18 06:13:00 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __AMIXER_H__
@@ -33,7 +48,9 @@ class ComboBox;
class RouteDialog;
class Strip;
+namespace MusEConfig {
struct MixerConfig;
+}
#define EFX_HEIGHT 16
@@ -65,7 +82,7 @@ class AudioMixerApp : public QMainWindow {
Q_OBJECT
//QString name;
- MixerConfig* cfg;
+ MusEConfig::MixerConfig* cfg;
StripList stripList;
QScrollArea* view;
QWidget* central;
@@ -123,7 +140,7 @@ class AudioMixerApp : public QMainWindow {
public:
//AudioMixerApp(QWidget* parent);
- AudioMixerApp(QWidget* parent, MixerConfig* c);
+ AudioMixerApp(QWidget* parent, MusEConfig::MixerConfig* c);
//void write(Xml&, const char* name);
//void write(int level, Xml& xml, const char* name);
void write(int level, Xml& xml);
diff --git a/muse2/muse/mixer/astrip.cpp b/muse2/muse/mixer/astrip.cpp
index 97ddc98c..4084a7d4 100644
--- a/muse2/muse/mixer/astrip.cpp
+++ b/muse2/muse/mixer/astrip.cpp
@@ -4,6 +4,21 @@
// $Id: astrip.cpp,v 1.23.2.17 2009/11/16 01:55:55 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <fastlog.h>
@@ -26,11 +41,12 @@
#include <QVariant>
#include <QAction>
#include <QGridLayout>
+//#include <QLinearGradient>
#include "app.h"
#include "globals.h"
#include "audio.h"
-#include "driver/audiodev.h"
+//#include "driver/audiodev.h"
#include "song.h"
#include "slider.h"
#include "knob.h"
@@ -116,7 +132,7 @@ void AudioStrip::songChanged(int val)
AudioTrack* src = (AudioTrack*)track;
- // Do channels before config...
+ // Do channels before MusEConfig::config...
if (val & SC_CHANNELS)
updateChannels();
@@ -126,12 +142,12 @@ void AudioStrip::songChanged(int val)
// Added by Tim. p3.3.9
// Set the strip label's font.
- //label->setFont(config.fonts[1]);
+ //label->setFont(MusEConfig::config.fonts[1]);
setLabelFont();
// Adjust minimum volume slider and label values.
- slider->setRange(config.minSlider-0.1, 10.0);
- sl->setRange(config.minSlider, 10.0);
+ slider->setRange(MusEConfig::config.minSlider-0.1, 10.0);
+ sl->setRange(MusEConfig::config.minSlider, 10.0);
// Adjust minimum aux knob and label values.
int n = auxKnob.size();
@@ -139,15 +155,15 @@ void AudioStrip::songChanged(int val)
{
auxKnob[idx]->blockSignals(true);
auxLabel[idx]->blockSignals(true);
- auxKnob[idx]->setRange(config.minSlider-0.1, 10.0);
- auxLabel[idx]->setRange(config.minSlider, 10.1);
+ auxKnob[idx]->setRange(MusEConfig::config.minSlider-0.1, 10.0);
+ auxLabel[idx]->setRange(MusEConfig::config.minSlider, 10.1);
auxKnob[idx]->blockSignals(false);
auxLabel[idx]->blockSignals(false);
}
// Adjust minimum meter values.
for(int c = 0; c < channel; ++c)
- meter[c]->setRange(config.minMeter, 10.0);
+ meter[c]->setRange(MusEConfig::config.minMeter, 10.0);
}
if (mute && (val & SC_MUTE)) { // mute && off
@@ -210,19 +226,32 @@ void AudioStrip::songChanged(int val)
autoType->blockSignals(true);
autoType->setCurrentItem(track->automationType());
QPalette palette;
+ //QLinearGradient gradient(autoType->geometry().topLeft(), autoType->geometry().bottomLeft());
if(track->automationType() == AUTO_TOUCH || track->automationType() == AUTO_WRITE)
{
palette.setColor(QPalette::Button, QColor(Qt::red));
+ //QColor c(Qt::red);
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
else if(track->automationType() == AUTO_READ)
{
palette.setColor(QPalette::Button, QColor(Qt::green));
+ //QColor c(Qt::green);
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
else
{
palette.setColor(QPalette::Button, qApp->palette().color(QPalette::Active, QPalette::Background));
+ //QColor c(qApp->palette().color(QPalette::Active, QPalette::Background));
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
@@ -359,7 +388,7 @@ void AudioStrip::stereoToggled(bool val)
void AudioStrip::auxChanged(double val, int idx)
{
double vol;
- if (val <= config.minSlider) {
+ if (val <= MusEConfig::config.minSlider) {
vol = 0.0;
val -= 1.0; // display special value "off"
}
@@ -391,16 +420,17 @@ void AudioStrip::volumeChanged(double val)
track->enableVolumeController(false);
double vol;
- if (val <= config.minSlider) {
+ if (val <= MusEConfig::config.minSlider) {
vol = 0.0;
val -= 1.0; // display special value "off"
}
else
vol = pow(10.0, val/20.0);
volume = vol;
- audio->msgSetVolume((AudioTrack*)track, vol);
+ //audio->msgSetVolume((AudioTrack*)track, vol);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setVolume(vol);
+ ((AudioTrack*)track)->setVolume(vol);
+ song->controllerChange(track);
((AudioTrack*)track)->recordAutomation(AC_VOLUME, vol);
@@ -420,16 +450,17 @@ void AudioStrip::volumePressed()
double val = slider->value();
double vol;
- if (val <= config.minSlider) {
+ if (val <= MusEConfig::config.minSlider) {
vol = 0.0;
//val -= 1.0; // display special value "off"
}
else
vol = pow(10.0, val/20.0);
volume = vol;
- audio->msgSetVolume((AudioTrack*)track, volume);
+ //audio->msgSetVolume((AudioTrack*)track, volume);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setVolume(volume);
+ ((AudioTrack*)track)->setVolume(volume);
+ song->controllerChange(track);
((AudioTrack*)track)->startAutoRecord(AC_VOLUME, volume);
}
@@ -465,7 +496,7 @@ void AudioStrip::volLabelChanged(double val)
track->enableVolumeController(false);
double vol;
- if (val <= config.minSlider) {
+ if (val <= MusEConfig::config.minSlider) {
vol = 0.0;
val -= 1.0; // display special value "off"
}
@@ -473,9 +504,10 @@ void AudioStrip::volLabelChanged(double val)
vol = pow(10.0, val/20.0);
volume = vol;
slider->setValue(val);
- audio->msgSetVolume((AudioTrack*)track, vol);
+ //audio->msgSetVolume((AudioTrack*)track, vol);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setVolume(vol);
+ ((AudioTrack*)track)->setVolume(vol);
+ song->controllerChange(track);
((AudioTrack*)track)->startAutoRecord(AC_VOLUME, vol);
}
@@ -491,9 +523,10 @@ void AudioStrip::panChanged(double val)
track->enablePanController(false);
panVal = val;
- audio->msgSetPan(((AudioTrack*)track), val);
+ //audio->msgSetPan(((AudioTrack*)track), val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setPan(val);
+ ((AudioTrack*)track)->setPan(val);
+ song->controllerChange(track);
((AudioTrack*)track)->recordAutomation(AC_PAN, val);
}
@@ -509,9 +542,11 @@ void AudioStrip::panPressed()
track->enablePanController(false);
panVal = pan->value();
- audio->msgSetPan(((AudioTrack*)track), panVal);
+ //audio->msgSetPan(((AudioTrack*)track), panVal);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setPan(panVal);
+ ((AudioTrack*)track)->setPan(panVal);
+ song->controllerChange(track);
+
((AudioTrack*)track)->startAutoRecord(AC_PAN, panVal);
}
@@ -546,9 +581,11 @@ void AudioStrip::panLabelChanged(double val)
panVal = val;
pan->setValue(val);
- audio->msgSetPan((AudioTrack*)track, val);
+ //audio->msgSetPan((AudioTrack*)track, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //((AudioTrack*)track)->setPan(val);
+ ((AudioTrack*)track)->setPan(val);
+ song->controllerChange(track);
+
((AudioTrack*)track)->startAutoRecord(AC_PAN, val);
}
@@ -564,9 +601,9 @@ void AudioStrip::updateChannels()
if (c > channel) {
for (int cc = channel; cc < c; ++cc) {
- meter[cc] = new Meter(this);
- //meter[cc]->setRange(config.minSlider, 10.0);
- meter[cc]->setRange(config.minMeter, 10.0);
+ meter[cc] = new MusEWidget::Meter(this);
+ //meter[cc]->setRange(MusEConfig::config.minSlider, 10.0);
+ meter[cc]->setRange(MusEConfig::config.minMeter, 10.0);
meter[cc]->setFixedWidth(15);
connect(meter[cc], SIGNAL(mousePress()), this, SLOT(resetPeaks()));
sliderGrid->addWidget(meter[cc], 0, cc+1, Qt::AlignLeft);
@@ -587,19 +624,19 @@ void AudioStrip::updateChannels()
}
//---------------------------------------------------------
-// addKnob
+// addMusEWidget::Knob
// type = 0 - panorama
// 1 - aux send
//---------------------------------------------------------
-Knob* AudioStrip::addKnob(int type, int id, DoubleLabel** dlabel)
+MusEWidget::Knob* AudioStrip::addKnob(int type, int id, MusEWidget::DoubleLabel** dlabel)
{
- Knob* knob = new Knob(this);
+ MusEWidget::Knob* knob = new MusEWidget::Knob(this);
knob->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
if (type == 0)
knob->setRange(-1.0, +1.0);
else
- knob->setRange(config.minSlider-0.1, 10.0);
+ knob->setRange(MusEConfig::config.minSlider-0.1, 10.0);
knob->setBackgroundRole(QPalette::Mid);
if (type == 0)
@@ -607,16 +644,16 @@ Knob* AudioStrip::addKnob(int type, int id, DoubleLabel** dlabel)
else
knob->setToolTip(tr("aux send level"));
- DoubleLabel* pl;
+ MusEWidget::DoubleLabel* pl;
if (type == 0)
- pl = new DoubleLabel(0, -1.0, +1.0, this);
+ pl = new MusEWidget::DoubleLabel(0, -1.0, +1.0, this);
else
- pl = new DoubleLabel(0.0, config.minSlider, 10.1, this);
+ pl = new MusEWidget::DoubleLabel(0.0, MusEConfig::config.minSlider, 10.1, this);
if (dlabel)
*dlabel = pl;
pl->setSlider(knob);
- pl->setFont(config.fonts[1]);
+ pl->setFont(MusEConfig::config.fonts[1]);
pl->setBackgroundRole(QPalette::Mid);
pl->setFrame(true);
if (type == 0)
@@ -633,7 +670,7 @@ Knob* AudioStrip::addKnob(int type, int id, DoubleLabel** dlabel)
label.sprintf("Aux%d", id+1);
QLabel* plb = new QLabel(label, this);
- plb->setFont(config.fonts[1]);
+ plb->setFont(MusEConfig::config.fonts[1]);
plb->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
plb->setAlignment(Qt::AlignCenter);
@@ -696,7 +733,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
int ch = 0;
for (; ch < channel; ++ch)
- meter[ch] = new Meter(this);
+ meter[ch] = new MusEWidget::Meter(this);
for (; ch < MAX_CHANNELS; ++ch)
meter[ch] = 0;
@@ -713,7 +750,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
//---------------------------------------------------
stereo = new QToolButton();
- stereo->setFont(config.fonts[1]);
+ stereo->setFont(MusEConfig::config.fonts[1]);
QIcon stereoSet;
stereoSet.addPixmap(*monoIcon, QIcon::Normal, QIcon::Off);
stereoSet.addPixmap(*stereoIcon, QIcon::Normal, QIcon::On);
@@ -731,7 +768,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
stereo->setEnabled(false);
pre = new QToolButton();
- pre->setFont(config.fonts[1]);
+ pre->setFont(MusEConfig::config.fonts[1]);
pre->setCheckable(true);
pre->setText(tr("Pre"));
pre->setToolTip(tr("pre fader - post fader"));
@@ -749,8 +786,8 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
int auxsSize = song->auxs()->size();
if (t->hasAuxSend()) {
for (int idx = 0; idx < auxsSize; ++idx) {
- DoubleLabel* al;
- Knob* ak = addKnob(1, idx, &al);
+ MusEWidget::DoubleLabel* al;
+ MusEWidget::Knob* ak = addKnob(1, idx, &al);
auxKnob.push_back(ak);
auxLabel.push_back(al);
double val = fast_log10(t->auxSend(idx))*20.0;
@@ -773,19 +810,19 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
sliderGrid->setContentsMargins(0, 0, 0, 0);
sliderGrid->setSpacing(0);
- slider = new Slider(this, "vol", Qt::Vertical, Slider::None,
- Slider::BgTrough | Slider::BgSlot);
+ slider = new MusEWidget::Slider(this, "vol", Qt::Vertical, MusEWidget::Slider::None);
+
slider->setCursorHoming(true);
- slider->setRange(config.minSlider-0.1, 10.0);
+ slider->setRange(MusEConfig::config.minSlider-0.1, 10.0);
slider->setFixedWidth(20);
- slider->setFont(config.fonts[1]);
+ slider->setFont(MusEConfig::config.fonts[1]);
slider->setValue(fast_log10(t->volume())*20.0);
sliderGrid->addWidget(slider, 0, 0, Qt::AlignHCenter);
for (int i = 0; i < channel; ++i) {
- //meter[i]->setRange(config.minSlider, 10.0);
- meter[i]->setRange(config.minMeter, 10.0);
+ //meter[i]->setRange(MusEConfig::config.minSlider, 10.0);
+ meter[i]->setRange(MusEConfig::config.minMeter, 10.0);
meter[i]->setFixedWidth(15);
connect(meter[i], SIGNAL(mousePress()), this, SLOT(resetPeaks()));
sliderGrid->addWidget(meter[i], 0, i+1, Qt::AlignHCenter);
@@ -794,9 +831,9 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
sliderGrid->addItem(new QSpacerItem(2,0),0,3);
grid->addLayout(sliderGrid, _curGridRow++, 0, 1, 2);
- sl = new DoubleLabel(0.0, config.minSlider, 10.0, this);
+ sl = new MusEWidget::DoubleLabel(0.0, MusEConfig::config.minSlider, 10.0, this);
sl->setSlider(slider);
- sl->setFont(config.fonts[1]);
+ sl->setFont(MusEConfig::config.fonts[1]);
sl->setBackgroundRole(QPalette::Mid);
sl->setSuffix(tr("dB"));
sl->setFrame(true);
@@ -825,7 +862,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
//---------------------------------------------------
if (track->canRecord()) {
- record = new TransparentToolButton(this);
+ record = new MusEWidget::TransparentToolButton(this);
record->setCheckable(true);
record->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
record->setBackgroundRole(QPalette::Mid);
@@ -882,7 +919,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
solo->setToolTip(tr("solo mode"));
}
- off = new TransparentToolButton(this);
+ off = new MusEWidget::TransparentToolButton(this);
QIcon iconSet;
iconSet.addPixmap(*exit1Icon, QIcon::Normal, QIcon::On);
iconSet.addPixmap(*exitIcon, QIcon::Normal, QIcon::Off);
@@ -908,7 +945,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
if (type != Track::AUDIO_AUX) {
iR = new QToolButton();
- iR->setFont(config.fonts[1]);
+ iR->setFont(MusEConfig::config.fonts[1]);
iR->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
iR->setText(tr("iR"));
iR->setCheckable(false);
@@ -918,7 +955,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
}
oR = new QToolButton();
- oR->setFont(config.fonts[1]);
+ oR->setFont(MusEConfig::config.fonts[1]);
oR->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
oR->setText(tr("oR"));
oR->setCheckable(false);
@@ -930,8 +967,8 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
// automation type
//---------------------------------------------------
- autoType = new ComboBox();
- autoType->setFont(config.fonts[1]);
+ autoType = new MusEWidget::ComboBox();
+ autoType->setFont(MusEConfig::config.fonts[1]);
autoType->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
autoType->addAction(tr("Off"), AUTO_OFF);
@@ -941,19 +978,32 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
autoType->setCurrentItem(t->automationType());
QPalette palette;
+ //QLinearGradient gradient(autoType->geometry().topLeft(), autoType->geometry().bottomLeft());
if(t->automationType() == AUTO_TOUCH || t->automationType() == AUTO_WRITE)
{
palette.setColor(QPalette::Button, QColor(Qt::red));
+ //QColor c(Qt::red);
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
else if(t->automationType() == AUTO_READ)
{
palette.setColor(QPalette::Button, QColor(Qt::green));
+ //QColor c(Qt::green);
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
else
{
palette.setColor(QPalette::Button, qApp->palette().color(QPalette::Active, QPalette::Background));
+ //QColor c(qApp->palette().color(QPalette::Active, QPalette::Background));
+ //gradient.setColorAt(0, c);
+ //gradient.setColorAt(1, c.darker());
+ //palette.setBrush(QPalette::Button, gradient);
autoType->setPalette(palette);
}
@@ -966,7 +1016,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
updateOffState(); // init state
off->blockSignals(false);
}
- connect(heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
+ connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
}
//---------------------------------------------------------
@@ -975,7 +1025,7 @@ AudioStrip::AudioStrip(QWidget* parent, AudioTrack* at)
void AudioStrip::iRoutePressed()
{
- RoutePopupMenu* pup = muse->getRoutingPopupMenu();
+ MusEWidget::RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu();
iR->setDown(false);
pup->exec(QCursor::pos(), track, false);
}
@@ -986,7 +1036,7 @@ void AudioStrip::iRoutePressed()
void AudioStrip::oRoutePressed()
{
- RoutePopupMenu* pup = muse->getRoutingPopupMenu();
+ MusEWidget::RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu();
oR->setDown(false);
pup->exec(QCursor::pos(), track, true);
}
diff --git a/muse2/muse/mixer/astrip.h b/muse2/muse/mixer/astrip.h
index 92867033..fc25bb9b 100644
--- a/muse2/muse/mixer/astrip.h
+++ b/muse2/muse/mixer/astrip.h
@@ -4,6 +4,21 @@
// $Id: astrip.h,v 1.8.2.6 2009/11/14 03:37:48 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __ASTRIP_H__
@@ -14,17 +29,20 @@
#include "strip.h"
//#include "route.h"
+namespace MusEWidget {
+class DoubleLabel;
class Slider;
class Knob;
+class TransparentToolButton;
+}
+
//class QDialog;
class QToolButton;
//class QAction;
//class QPopupMenu;
//class PopupMenu;
class QButton;
-class TransparentToolButton;
class AudioTrack;
-class DoubleLabel;
class EffectRack;
//---------------------------------------------------------
@@ -35,19 +53,19 @@ class AudioStrip : public Strip {
Q_OBJECT
int channel;
- Slider* slider;
- DoubleLabel* sl;
+ MusEWidget::Slider* slider;
+ MusEWidget::DoubleLabel* sl;
EffectRack* rack;
- Knob* pan;
- DoubleLabel* panl;
+ MusEWidget::Knob* pan;
+ MusEWidget::DoubleLabel* panl;
- std::vector<Knob*> auxKnob;
- std::vector<DoubleLabel*> auxLabel;
+ std::vector<MusEWidget::Knob*> auxKnob;
+ std::vector<MusEWidget::DoubleLabel*> auxLabel;
QToolButton* stereo;
QToolButton* pre;
- TransparentToolButton* off;
+ MusEWidget::TransparentToolButton* off;
double volume;
double panVal;
@@ -55,7 +73,7 @@ class AudioStrip : public Strip {
//QToolButton* iR;
//QToolButton* oR;
- Knob* addKnob(int, int, DoubleLabel**);
+ MusEWidget::Knob* addKnob(int, int, MusEWidget::DoubleLabel**);
void updateOffState();
void updateVolume();
diff --git a/muse2/muse/mixer/auxknob.cpp b/muse2/muse/mixer/auxknob.cpp
index a64f3929..a9b9c4e2 100644
--- a/muse2/muse/mixer/auxknob.cpp
+++ b/muse2/muse/mixer/auxknob.cpp
@@ -4,21 +4,38 @@
// $Id: auxknob.cpp,v 1.7 2004/07/11 16:26:46 wschweer Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
#include "auxknob.h"
#include "gconfig.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// Aux
//---------------------------------------------------------
AuxKnob::AuxKnob(QWidget* parent, int i)
- : Knob(parent, "aux")
+ : MusEWidget::Knob(parent, "aux")
{
idx = i;
- setRange(config.minSlider-0.1, 10.0);
+ setRange(MusEConfig::config.minSlider-0.1, 10.0);
connect(this, SIGNAL(valueChanged(double,int)), SLOT(valueChanged(double)));
}
@@ -29,7 +46,7 @@ AuxKnob::AuxKnob(QWidget* parent, int i)
void AuxKnob::valueChanged(double val)
{
double vol;
- if (val <= config.minSlider) {
+ if (val <= MusEConfig::config.minSlider) {
vol = 0.0;
val -= 1.0; // display special value "off"
}
@@ -38,3 +55,4 @@ void AuxKnob::valueChanged(double val)
emit auxChanged(idx, vol);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/mixer/auxknob.h b/muse2/muse/mixer/auxknob.h
index c2b8ec7a..c8693698 100644
--- a/muse2/muse/mixer/auxknob.h
+++ b/muse2/muse/mixer/auxknob.h
@@ -4,6 +4,21 @@
// $Id: auxknob.h,v 1.3 2003/11/08 15:10:18 wschweer Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __AUXKNOB_H__
@@ -11,6 +26,8 @@
#include "knob.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// AuxKnob
//---------------------------------------------------------
@@ -29,5 +46,7 @@ class AuxKnob : public Knob {
AuxKnob(QWidget* parent, int idx);
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/mixer/mstrip.cpp b/muse2/muse/mixer/mstrip.cpp
index ad21916d..d8e09adb 100644
--- a/muse2/muse/mixer/mstrip.cpp
+++ b/muse2/muse/mixer/mstrip.cpp
@@ -4,6 +4,21 @@
// $Id: mstrip.cpp,v 1.9.2.13 2009/11/14 03:37:48 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <fastlog.h>
@@ -77,7 +92,7 @@ void MidiStrip::addKnob(int idx, const QString& tt, const QString& label,
mn = mc->minVal();
mx = mc->maxVal();
- Knob* knob = new Knob(this);
+ MusEWidget::Knob* knob = new MusEWidget::Knob(this);
knob->setRange(double(mn), double(mx), 1.0);
knob->setId(ctl);
@@ -87,12 +102,12 @@ void MidiStrip::addKnob(int idx, const QString& tt, const QString& label,
knob->setToolTip(tt);
knob->setEnabled(enabled);
- DoubleLabel* dl = new DoubleLabel(0.0, double(mn), double(mx), this);
+ MusEWidget::DoubleLabel* dl = new MusEWidget::DoubleLabel(0.0, double(mn), double(mx), this);
dl->setId(idx);
dl->setSpecialText(tr("off"));
dl->setToolTip(tr("double click on/off"));
controller[idx].dl = dl;
- dl->setFont(config.fonts[1]);
+ dl->setFont(MusEConfig::config.fonts[1]);
dl->setBackgroundRole(QPalette::Mid);
dl->setFrame(true);
dl->setPrecision(0);
@@ -135,7 +150,7 @@ void MidiStrip::addKnob(int idx, const QString& tt, const QString& label,
QLabel* lb = new QLabel(label, this);
controller[idx].lb = lb;
- lb->setFont(config.fonts[1]);
+ lb->setFont(MusEConfig::config.fonts[1]);
lb->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
lb->setAlignment(Qt::AlignCenter);
lb->setEnabled(enabled);
@@ -188,15 +203,15 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t)
int mn = mc->minVal();
int mx = mc->maxVal();
- slider = new Slider(this, "vol", Qt::Vertical, Slider::None,
- Slider::BgTrough | Slider::BgSlot);
+ slider = new MusEWidget::Slider(this, "vol", Qt::Vertical, MusEWidget::Slider::None,
+ QColor(100, 255, 100));
slider->setCursorHoming(true);
slider->setRange(double(mn), double(mx), 1.0);
slider->setFixedWidth(20);
- slider->setFont(config.fonts[1]);
+ slider->setFont(MusEConfig::config.fonts[1]);
slider->setId(CTRL_VOLUME);
- meter[0] = new Meter(this, Meter::LinMeter);
+ meter[0] = new MusEWidget::Meter(this, MusEWidget::Meter::LinMeter);
meter[0]->setRange(0, 127.0);
meter[0]->setFixedWidth(15);
connect(meter[0], SIGNAL(mousePress()), this, SLOT(resetPeaks()));
@@ -207,8 +222,8 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t)
sliderGrid->addWidget(meter[0], 0, 1, Qt::AlignLeft);
grid->addLayout(sliderGrid, _curGridRow++, 0, 1, 2);
- sl = new DoubleLabel(0.0, -98.0, 0.0, this);
- sl->setFont(config.fonts[1]);
+ sl = new MusEWidget::DoubleLabel(0.0, -98.0, 0.0, this);
+ sl->setFont(MusEConfig::config.fonts[1]);
sl->setBackgroundRole(QPalette::Mid);
sl->setSpecialText(tr("off"));
sl->setSuffix(tr("dB"));
@@ -275,7 +290,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t)
// record, mixdownfile
//---------------------------------------------------
- record = new TransparentToolButton(this);
+ record = new MusEWidget::TransparentToolButton(this);
record->setBackgroundRole(QPalette::Mid);
record->setCheckable(true);
record->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
@@ -333,7 +348,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t)
// Special here: Must make label same size as the 'exit' button would be IF this were an audio strip...
// (The 'exit1' icon is BIGGER than the 'record on' icon.)
- TransparentToolButton* off = new TransparentToolButton(this);
+ MusEWidget::TransparentToolButton* off = new MusEWidget::TransparentToolButton(this);
QIcon iconOff;
iconOff.addPixmap(*exit1Icon, QIcon::Normal, QIcon::On);
iconOff.addPixmap(*exitIcon, QIcon::Normal, QIcon::Off);
@@ -352,14 +367,14 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t)
dcs.sprintf("%d-%d", port + 1, channel + 1);
dev_ch_label->setText(dcs);
//dev_ch_label->setBackgroundColor(QColor(0, 160, 255)); // Med blue
- //dev_ch_label->setFont(config.fonts[6]);
- dev_ch_label->setFont(config.fonts[1]);
+ //dev_ch_label->setFont(MusEConfig::config.fonts[6]);
+ dev_ch_label->setFont(MusEConfig::config.fonts[1]);
// Dealing with a horizontally constrained label. Ignore vertical. Use a minimum readable point size.
- //autoAdjustFontSize(dev_ch_label, dev_ch_label->text(), false, true, config.fonts[6].pointSize(), 5);
+ //autoAdjustFontSize(dev_ch_label, dev_ch_label->text(), false, true, MusEConfig::config.fonts[6].pointSize(), 5);
QToolTip::add(dev_ch_label, tr("output port and channel"));
*/
- off = new TransparentToolButton(this);
+ off = new MusEWidget::TransparentToolButton(this);
QIcon iconOff;
iconOff.addPixmap(*exit1Icon, QIcon::Normal, QIcon::On);
iconOff.addPixmap(*exitIcon, QIcon::Normal, QIcon::Off);
@@ -382,7 +397,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t)
//---------------------------------------------------
iR = new QToolButton();
- iR->setFont(config.fonts[1]);
+ iR->setFont(MusEConfig::config.fonts[1]);
iR->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
iR->setText(tr("iR"));
iR->setCheckable(false);
@@ -390,7 +405,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t)
grid->addWidget(iR, _curGridRow, 0);
connect(iR, SIGNAL(pressed()), SLOT(iRoutePressed()));
oR = new QToolButton();
- oR->setFont(config.fonts[1]);
+ oR->setFont(MusEConfig::config.fonts[1]);
oR->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
oR->setText(tr("oR"));
oR->setCheckable(false);
@@ -405,8 +420,8 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t)
// automation mode
//---------------------------------------------------
- autoType = new ComboBox();
- autoType->setFont(config.fonts[1]);
+ autoType = new MusEWidget::ComboBox();
+ autoType->setFont(MusEConfig::config.fonts[1]);
autoType->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum));
autoType->setEnabled(false);
@@ -421,7 +436,7 @@ MidiStrip::MidiStrip(QWidget* parent, MidiTrack* t)
//connect(autoType, SIGNAL(activated(int)), SLOT(setAutomationType(int)));
grid->addWidget(autoType, _curGridRow++, 0, 1, 2);
- connect(heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
+ connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
inHeartBeat = false;
}
@@ -505,7 +520,7 @@ void MidiStrip::songChanged(int val)
if (val & SC_CONFIG)
{
// Set the strip label's font.
- //label->setFont(config.fonts[1]);
+ //label->setFont(MusEConfig::config.fonts[1]);
setLabelFont();
}
}
@@ -659,7 +674,7 @@ void MidiStrip::updateControls()
{
//if(nvolume != volume)
//{
- // DoubleLabel ignores the value if already set...
+ // MusEWidget::DoubleLabel ignores the value if already set...
sl->setValue(sl->off() - 1.0);
//volume = nvolume;
//}
@@ -721,7 +736,7 @@ void MidiStrip::updateControls()
int npan = mp->hwCtrlState(channel, CTRL_PANPOT);
if(npan == CTRL_VAL_UNKNOWN)
{
- // DoubleLabel ignores the value if already set...
+ // MusEWidget::DoubleLabel ignores the value if already set...
//if(npan != pan)
//{
gcon->dl->setValue(gcon->dl->off() - 1.0);
@@ -773,7 +788,7 @@ void MidiStrip::updateControls()
int nvariSend = icl->second->hwVal();
if(nvariSend == CTRL_VAL_UNKNOWN)
{
- // DoubleLabel ignores the value if already set...
+ // MusEWidget::DoubleLabel ignores the value if already set...
//if(nvariSend != variSend)
//{
gcon->dl->setValue(gcon->dl->off() - 1.0);
@@ -821,7 +836,7 @@ void MidiStrip::updateControls()
int nreverbSend = icl->second->hwVal();
if(nreverbSend == CTRL_VAL_UNKNOWN)
{
- // DoubleLabel ignores the value if already set...
+ // MusEWidget::DoubleLabel ignores the value if already set...
//if(nreverbSend != reverbSend)
//{
gcon->dl->setValue(gcon->dl->off() - 1.0);
@@ -869,7 +884,7 @@ void MidiStrip::updateControls()
int nchorusSend = icl->second->hwVal();
if(nchorusSend == CTRL_VAL_UNKNOWN)
{
- // DoubleLabel ignores the value if already set...
+ // MusEWidget::DoubleLabel ignores the value if already set...
//if(nchorusSend != chorusSend)
//{
gcon->dl->setValue(gcon->dl->off() - 1.0);
@@ -997,7 +1012,7 @@ void MidiStrip::setReverbSend(double val)
void MidiStrip::iRoutePressed()
{
- RoutePopupMenu* pup = muse->getRoutingPopupMenu();
+ MusEWidget::RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu();
iR->setDown(false);
pup->exec(QCursor::pos(), track, false);
}
@@ -1008,7 +1023,7 @@ void MidiStrip::iRoutePressed()
void MidiStrip::oRoutePressed()
{
- RoutePopupMenu* pup = muse->getRoutingPopupMenu();
+ MusEWidget::RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu();
oR->setDown(false);
pup->exec(QCursor::pos(), track, true);
}
diff --git a/muse2/muse/mixer/mstrip.h b/muse2/muse/mixer/mstrip.h
index 39b55d21..2f0a133d 100644
--- a/muse2/muse/mixer/mstrip.h
+++ b/muse2/muse/mixer/mstrip.h
@@ -4,6 +4,21 @@
// $Id: mstrip.h,v 1.4.2.4 2009/10/25 19:26:29 lunar_shuttle Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MSTRIP_H__
@@ -12,15 +27,20 @@
#include "strip.h"
#include <QLabel>
-class Slider;
-class DoubleLabel;
+class QAction;
class QDialog;
-class Knob;
-class QString;
-class MidiTrack;
class QLabel;
-class QAction;
+class QString;
+
+namespace MusEWidget {
+class DoubleLabel;
+class Knob;
+class Slider;
class TransparentToolButton;
+}
+
+class MidiTrack;
+
//---------------------------------------------------------
// MidiStrip
@@ -29,13 +49,13 @@ class TransparentToolButton;
class MidiStrip : public Strip {
Q_OBJECT
- Slider* slider;
- DoubleLabel* sl;
- TransparentToolButton* off;
+ MusEWidget::Slider* slider;
+ MusEWidget::DoubleLabel* sl;
+ MusEWidget::TransparentToolButton* off;
struct KNOB {
- Knob* knob;
- DoubleLabel* dl;
+ MusEWidget::Knob* knob;
+ MusEWidget::DoubleLabel* dl;
QLabel* lb;
} controller[4]; // pan variation reverb chorus
diff --git a/muse2/muse/mixer/panknob.cpp b/muse2/muse/mixer/panknob.cpp
index 598bf5bf..077b39e1 100644
--- a/muse2/muse/mixer/panknob.cpp
+++ b/muse2/muse/mixer/panknob.cpp
@@ -4,18 +4,34 @@
// $Id: panknob.cpp,v 1.5 2004/01/23 08:41:38 wschweer Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
-#include "../audio.h"
+//#include "../audio.h"
+#include "song.h"
#include "panknob.h"
#include "track.h"
//---------------------------------------------------------
-// PanKnob
+// PanMusEWidget::Knob
//---------------------------------------------------------
-PanKnob::PanKnob(QWidget* parent, AudioTrack* s)
- : Knob(parent, "pan")
+PanMusEWidget::Knob::PanMusEWidget::Knob(QWidget* parent, AudioTrack* s)
+ : MusEWidget::Knob(parent, "pan")
{
src = s;
connect(this, SIGNAL(valueChanged(double,int)), SLOT(valueChanged(double)));
@@ -25,11 +41,12 @@ PanKnob::PanKnob(QWidget* parent, AudioTrack* s)
// panChanged
//---------------------------------------------------------
-void PanKnob::valueChanged(double val)
+void PanMusEWidget::Knob::valueChanged(double val)
{
- audio->msgSetPan(src, val);
+ //audio->msgSetPan(src, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //src->setPan(val);
+ src->setPan(val);
+ song->controllerChange(src);
}
diff --git a/muse2/muse/mixer/panknob.h b/muse2/muse/mixer/panknob.h
index 92c41b03..5fcb2171 100644
--- a/muse2/muse/mixer/panknob.h
+++ b/muse2/muse/mixer/panknob.h
@@ -4,6 +4,21 @@
// $Id: panknob.h,v 1.3 2003/11/08 15:10:18 wschweer Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __PANKNOB_H__
diff --git a/muse2/muse/mixer/rack.cpp b/muse2/muse/mixer/rack.cpp
index c2333e9d..9e7dc754 100644
--- a/muse2/muse/mixer/rack.cpp
+++ b/muse2/muse/mixer/rack.cpp
@@ -4,6 +4,21 @@
// $Id: rack.cpp,v 1.7.2.7 2007/01/27 14:52:43 spamatica Exp $
//
// (C) Copyright 2000-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QByteArray>
@@ -16,6 +31,7 @@
#include <QMouseEvent>
#include <QPainter>
#include <QPalette>
+#include <QStyledItemDelegate>
#include <QUrl>
#include <errno.h>
@@ -31,6 +47,77 @@
#include "filedialog.h"
//---------------------------------------------------------
+// class EffectRackDelegate
+//---------------------------------------------------------
+
+class EffectRackDelegate : public QStyledItemDelegate {
+
+ EffectRack* er;
+ AudioTrack* tr;
+
+ public:
+ void paint ( QPainter * painter,
+ const QStyleOptionViewItem & option,
+ const QModelIndex & index ) const;
+ EffectRackDelegate(QObject * parent, AudioTrack* at );
+};
+
+EffectRackDelegate::EffectRackDelegate(QObject * parent, AudioTrack* at ) : QStyledItemDelegate(parent) {
+ er = (EffectRack*) parent;
+ tr = at;
+}
+
+void EffectRackDelegate::paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const {
+ painter->save();
+ painter->setRenderHint(QPainter::Antialiasing);
+
+ QRect rr = er->visualItemRect(er->item(index.row()));
+ QRect cr = QRect(rr.x()+1, rr.y()+1,
+ rr.width()-2, rr.height() -2);
+ painter->fillRect(rr, option.palette.dark().color().darker(130));
+
+ QColor mask_edge = QColor(110, 110, 110, 55);
+ QColor mask_center = QColor(220, 220, 220, 55);
+ QLinearGradient mask;
+ mask.setColorAt(0, mask_edge);
+ mask.setColorAt(0.5, mask_center);
+ mask.setColorAt(1, mask_edge);
+ mask.setStart(QPointF(0, cr.y()));
+ mask.setFinalStop(QPointF(0, cr.y() + cr.height()));
+
+ painter->setBrush(tr->efxPipe()->isOn(index.row()) ?
+ option.palette.mid() :
+ option.palette.dark());
+ painter->setPen(Qt::NoPen);
+ painter->drawRoundedRect(cr, 2, 2);
+ painter->setBrush(mask);
+ painter->drawRoundedRect(cr, 2, 2);
+
+ QString name = tr->efxPipe()->name(index.row());
+ if (name.length() > 11)
+ name = name.left(9) + "...";
+
+ if (option.state & QStyle::State_Selected)
+ {
+ if (option.state & QStyle::State_MouseOver)
+ painter->setPen(QPen(QColor(239,239,239)));
+ else
+ painter->setPen(QPen(Qt::white));
+ }
+ else if (option.state & QStyle::State_MouseOver)
+ painter->setPen(QPen(QColor(48,48,48)));
+ else
+ painter->setPen(QPen(Qt::black));
+
+ painter->drawText(cr.x()+2, cr.y()+1,
+ cr.width()-2, cr.height()-1,
+ Qt::AlignLeft, name);
+
+ painter->restore();
+}
+
+
+//---------------------------------------------------------
// class RackSlot
//---------------------------------------------------------
@@ -39,7 +126,7 @@ class RackSlot : public QListWidgetItem {
AudioTrack* node;
public:
- RackSlot(QListWidget* lb, AudioTrack* t, int i);
+ RackSlot(QListWidget* lb, AudioTrack* t, int i, int h);
~RackSlot();
void setBackgroundColor(const QBrush& brush) {setBackground(brush);};
};
@@ -53,12 +140,12 @@ RackSlot::~RackSlot()
// RackSlot
//---------------------------------------------------------
-RackSlot::RackSlot(QListWidget* b, AudioTrack* t, int i)
+RackSlot::RackSlot(QListWidget* b, AudioTrack* t, int i, int h)
: QListWidgetItem(b)
{
node = t;
idx = i;
- setSizeHint(QSize(10,17));
+ setSizeHint(QSize(10,h));
}
//---------------------------------------------------------
@@ -71,36 +158,37 @@ EffectRack::EffectRack(QWidget* parent, AudioTrack* t)
setObjectName("Rack");
setAttribute(Qt::WA_DeleteOnClose);
track = t;
- setFont(config.fonts[1]);
+ itemheight = 19;
+ setFont(MusEConfig::config.fonts[1]);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setSelectionMode(QAbstractItemView::SingleSelection);
- setMaximumHeight(19 * PipelineDepth);
+
for (int i = 0; i < PipelineDepth; ++i)
- new RackSlot(this, track, i);
+ new RackSlot(this, track, i, itemheight);
updateContents();
connect(this, SIGNAL(itemDoubleClicked(QListWidgetItem*)),
this, SLOT(doubleClicked(QListWidgetItem*)));
connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
+ EffectRackDelegate* er_delegate = new EffectRackDelegate(this, track);
+ setItemDelegate(er_delegate);
+
setSpacing(0);
- QPalette qpal;
- qpal.setColor(QPalette::Base, QColor(palette().midlight().color()));
- setPalette(qpal);
setAcceptDrops(true);
}
void EffectRack::updateContents()
{
- for (int i = 0; i < PipelineDepth; ++i) {
- QString name = track->efxPipe()->name(i);
- item(i)->setText(name);
- item(i)->setBackground(track->efxPipe()->isOn(i) ? palette().mid() : palette().dark());
- item(i)->setToolTip(name == QString("empty") ? tr("effect rack") : name );
- }
+ for (int i = 0; i < PipelineDepth; ++i) {
+ QString name = track->efxPipe()->name(i);
+ item(i)->setText(name);
+ item(i)->setBackground(track->efxPipe()->isOn(i) ? palette().mid() : palette().dark());
+ item(i)->setToolTip(name == QString("empty") ? tr("effect rack") : name );
+ }
}
//---------------------------------------------------------
@@ -128,7 +216,8 @@ void EffectRack::songChanged(int typ)
QSize EffectRack::minimumSizeHint() const
{
- return QSize(10, 19 * PipelineDepth);
+ // FIXME(Orcan): Why do we have to manually add 6 pixels?
+ return QSize(10, itemheight * PipelineDepth + 6);
}
//---------------------------------------------------------
@@ -171,11 +260,11 @@ void EffectRack::menuRequested(QListWidgetItem* it)
RackSlot* curitem = (RackSlot*)it;
int idx = row(curitem);
QString name;
- bool mute;
+ //bool mute;
Pipeline* pipe = track->efxPipe();
if (pipe) {
name = pipe->name(idx);
- mute = pipe->isOn(idx);
+ //mute = pipe->isOn(idx);
}
//enum { NEW, CHANGE, UP, DOWN, REMOVE, BYPASS, SHOW, SAVE };
@@ -325,8 +414,8 @@ void EffectRack::doubleClicked(QListWidgetItem* it)
void EffectRack::savePreset(int idx)
{
- //QString name = getSaveFileName(QString(""), plug_file_pattern, this,
- QString name = getSaveFileName(QString(""), preset_file_save_pattern, this,
+ //QString name = MusEWidget::getSaveFileName(QString(""), plug_file_pattern, this,
+ QString name = MusEWidget::getSaveFileName(QString(""), MusEGlobal::preset_file_save_pattern, this,
tr("MusE: Save Preset"));
if(name.isEmpty())
@@ -334,7 +423,7 @@ void EffectRack::savePreset(int idx)
//FILE* presetFp = fopen(name.ascii(),"w+");
bool popenFlag;
- FILE* presetFp = fileOpen(this, name, QString(".pre"), "w", popenFlag, false, true);
+ FILE* presetFp = MusEWidget::fileOpen(this, name, QString(".pre"), "w", popenFlag, false, true);
if (presetFp == 0) {
//fprintf(stderr, "EffectRack::savePreset() fopen failed: %s\n",
// strerror(errno));
@@ -382,9 +471,9 @@ void EffectRack::startDrag(int idx)
return;
}
FILE *tmp;
- if (debugMsg) {
+ if (MusEGlobal::debugMsg) {
QString fileName;
- getUniqueTmpfileName("tmp","preset", fileName);
+ MusEGlobal::getUniqueTmpfileName("tmp","preset", fileName);
tmp = fopen(fileName.toLatin1().data(), "w+");
}
else
@@ -501,7 +590,7 @@ void EffectRack::dropEvent(QDropEvent *event)
{
//bool popenFlag = false;
bool popenFlag;
- FILE* fp = fileOpen(this, text, ".pre", "r", popenFlag, false, false);
+ FILE* fp = MusEWidget::fileOpen(this, text, ".pre", "r", popenFlag, false, false);
if (fp)
{
Xml xml(fp);
@@ -525,15 +614,17 @@ void EffectRack::dragEnterEvent(QDragEnterEvent *event)
void EffectRack::mousePressEvent(QMouseEvent *event)
{
+ RackSlot* item = (RackSlot*) itemAt(event->pos());
if(event->button() & Qt::LeftButton) {
dragPos = event->pos();
}
else if(event->button() & Qt::RightButton) {
- menuRequested(itemAt(event->pos()));
+ setCurrentItem(item);
+ menuRequested(item);
return;
}
else if(event->button() & Qt::MidButton) {
- int idx = row(itemAt(event->pos()));
+ int idx = row(item);
bool flag = !track->efxPipe()->isOn(idx);
track->efxPipe()->setOn(idx, flag);
updateContents();
diff --git a/muse2/muse/mixer/rack.h b/muse2/muse/mixer/rack.h
index 2b1bbb66..a2f2a25a 100644
--- a/muse2/muse/mixer/rack.h
+++ b/muse2/muse/mixer/rack.h
@@ -4,6 +4,21 @@
// $Id: rack.h,v 1.5.2.3 2006/09/24 19:32:31 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __RACK_H__
@@ -28,8 +43,8 @@ class EffectRack : public QListWidget {
AudioTrack* track;
+ int itemheight;
-
virtual QSize minimumSizeHint() const;
virtual QSize sizeHint() const;
diff --git a/muse2/muse/mixer/routedialog.cpp b/muse2/muse/mixer/routedialog.cpp
index 29ff8946..53b8d48b 100644
--- a/muse2/muse/mixer/routedialog.cpp
+++ b/muse2/muse/mixer/routedialog.cpp
@@ -4,6 +4,21 @@
// $Id: routedialog.cpp,v 1.5.2.2 2007/01/04 00:35:17 terminator356 Exp $
//
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QCloseEvent>
@@ -86,7 +101,7 @@ void RouteDialog::routingChanged()
new QTreeWidgetItem(routeList, QStringList() << src << r->name());
}
}
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
std::list<QString> sl = audioDevice->outputPorts();
for (std::list<QString>::iterator i = sl.begin(); i != sl.end(); ++i)
newSrcList->addItem(*i);
diff --git a/muse2/muse/mixer/routedialog.h b/muse2/muse/mixer/routedialog.h
index 39bbce2c..d5326ab3 100644
--- a/muse2/muse/mixer/routedialog.h
+++ b/muse2/muse/mixer/routedialog.h
@@ -4,6 +4,21 @@
// $Id: routedialog.h,v 1.2 2004/01/31 17:31:49 wschweer Exp $
//
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __ROUTEDIALOG_H__
diff --git a/muse2/muse/mixer/strip.cpp b/muse2/muse/mixer/strip.cpp
index 3cf9765d..750f1623 100644
--- a/muse2/muse/mixer/strip.cpp
+++ b/muse2/muse/mixer/strip.cpp
@@ -4,6 +4,21 @@
// $Id: strip.cpp,v 1.6.2.5 2009/11/14 03:37:48 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QToolButton>
@@ -54,7 +69,7 @@ void Strip::recordToggled(bool val)
{
if (track->type() == Track::AUDIO_OUTPUT) {
if (val && track->recordFlag() == false) {
- muse->bounceToFile((AudioOutput*)track);
+ MusEGlobal::muse->bounceToFile((AudioOutput*)track);
}
audio->msgSetRecord((AudioOutput*)track, val);
if (!((AudioOutput*)track)->recFile())
@@ -80,9 +95,9 @@ void Strip::setLabelFont()
{
// Use the new font #6 I created just for these labels (so far).
// Set the label's font.
- label->setFont(config.fonts[6]);
+ label->setFont(MusEConfig::config.fonts[6]);
// Dealing with a horizontally constrained label. Ignore vertical. Use a minimum readable point size.
- autoAdjustFontSize(label, label->text(), false, true, config.fonts[6].pointSize(), 5);
+ MusEUtil::autoAdjustFontSize(label, label->text(), false, true, MusEConfig::config.fonts[6].pointSize(), 5);
}
//---------------------------------------------------------
@@ -95,35 +110,35 @@ void Strip::setLabelText()
switch(track->type()) {
case Track::AUDIO_OUTPUT:
//c = Qt::green;
- c = config.outputTrackLabelBg;
+ c = MusEConfig::config.outputTrackLabelBg;
break;
case Track::AUDIO_GROUP:
//c = Qt::yellow;
- c = config.groupTrackLabelBg;
+ c = MusEConfig::config.groupTrackLabelBg;
break;
case Track::AUDIO_AUX:
//c = QColor(120, 255, 255); // Light blue
- c = config.auxTrackLabelBg;
+ c = MusEConfig::config.auxTrackLabelBg;
break;
case Track::WAVE:
//c = Qt::magenta;
- c = config.waveTrackLabelBg;
+ c = MusEConfig::config.waveTrackLabelBg;
break;
case Track::AUDIO_INPUT:
//c = Qt::red;
- c = config.inputTrackLabelBg;
+ c = MusEConfig::config.inputTrackLabelBg;
break;
case Track::AUDIO_SOFTSYNTH:
//c = QColor(255, 130, 0); // Med orange
- c = config.synthTrackLabelBg;
+ c = MusEConfig::config.synthTrackLabelBg;
break;
case Track::MIDI:
//c = QColor(0, 160, 255); // Med blue
- c = config.midiTrackLabelBg;
+ c = MusEConfig::config.midiTrackLabelBg;
break;
case Track::DRUM:
//c = QColor(0, 160, 255); // Med blue
- c = config.drumTrackLabelBg;
+ c = MusEConfig::config.drumTrackLabelBg;
break;
default:
return;
@@ -207,7 +222,7 @@ Strip::Strip(QWidget* parent, Track* t)
// Moved by Tim. p3.3.9
//setLabelText();
- //label->setFont(config.fonts[1]);
+ //label->setFont(MusEConfig::config.fonts[1]);
//printf("Strip::Strip w:%d frw:%d layoutmarg:%d lx:%d ly:%d lw:%d lh:%d\n", STRIP_WIDTH, frameWidth(), layout->margin(), label->x(), label->y(), label->width(), label->height());
diff --git a/muse2/muse/mixer/strip.h b/muse2/muse/mixer/strip.h
index cf3babe8..602e6e07 100644
--- a/muse2/muse/mixer/strip.h
+++ b/muse2/muse/mixer/strip.h
@@ -4,6 +4,21 @@
// $Id: strip.h,v 1.3.2.2 2009/11/14 03:37:48 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __STRIP_H__
@@ -21,10 +36,13 @@
class Track;
class QLabel;
//class QVBoxLayout;
-class Meter;
class QToolButton;
class QGridLayout;
+
+namespace MusEWidget {
class ComboBox;
+class Meter;
+}
static const int STRIP_WIDTH = 65;
@@ -41,7 +59,7 @@ class Strip : public QFrame {
//QVBoxLayout* layout;
QGridLayout* grid;
int _curGridRow;
- Meter* meter[MAX_CHANNELS];
+ MusEWidget::Meter* meter[MAX_CHANNELS];
bool useSoloIconSet2;
QToolButton* record;
@@ -50,7 +68,7 @@ class Strip : public QFrame {
QToolButton* iR; // Input routing button
QToolButton* oR; // Output routing button
QGridLayout* sliderGrid;
- ComboBox* autoType;
+ MusEWidget::ComboBox* autoType;
void setLabelText();
private slots:
diff --git a/muse2/muse/mpevent.cpp b/muse2/muse/mpevent.cpp
index 5b4fc4cb..11c85704 100644
--- a/muse2/muse/mpevent.cpp
+++ b/muse2/muse/mpevent.cpp
@@ -4,6 +4,21 @@
// $Id: mpevent.cpp,v 1.6.2.2 2009/11/25 09:09:43 terminator356 Exp $
//
// (C) Copyright 2002-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "mpevent.h"
diff --git a/muse2/muse/mpevent.h b/muse2/muse/mpevent.h
index b9b21e08..4d957adf 100644
--- a/muse2/muse/mpevent.h
+++ b/muse2/muse/mpevent.h
@@ -4,6 +4,21 @@
// $Id: mpevent.h,v 1.8.2.5 2009/11/25 09:09:43 terminator356 Exp $
//
// (C) Copyright 1999-2002 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MPEVENT_H__
@@ -139,8 +154,8 @@ class MidiPlayEvent : public MEvent {
typedef std::multiset<MidiPlayEvent, std::less<MidiPlayEvent>, audioRTalloc<MidiPlayEvent> > MPEL;
struct MPEventList : public MPEL {
- //void add(const MidiPlayEvent& ev) { MPEL::insert(ev); }
- iterator add(const MidiPlayEvent& ev) { return MPEL::insert(ev); } // p4.0.15 We need the iterator.
+ void add(const MidiPlayEvent& ev) { MPEL::insert(ev); }
+ //iterator add(const MidiPlayEvent& ev) { return MPEL::insert(ev); } // p4.0.15 We need the iterator.
};
typedef MPEventList::iterator iMPEvent;
diff --git a/muse2/muse/mplugins/CMakeLists.txt b/muse2/muse/mplugins/CMakeLists.txt
index 470451e1..47cc01f8 100644
--- a/muse2/muse/mplugins/CMakeLists.txt
+++ b/muse2/muse/mplugins/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/mplugins/midifilter.ui b/muse2/muse/mplugins/midifilter.ui
index 529f893a..55263f2f 100644
--- a/muse2/muse/mplugins/midifilter.ui
+++ b/muse2/muse/mplugins/midifilter.ui
@@ -269,16 +269,16 @@
<number>11</number>
</property>
<item>
- <widget class="CtrlComboBox" name="cb1" native="true"/>
+ <widget class="MusEWidget::CtrlComboBox" name="cb1" native="true"/>
</item>
<item>
- <widget class="CtrlComboBox" name="cb2" native="true"/>
+ <widget class="MusEWidget::CtrlComboBox" name="cb2" native="true"/>
</item>
<item>
- <widget class="CtrlComboBox" name="cb3" native="true"/>
+ <widget class="MusEWidget::CtrlComboBox" name="cb3" native="true"/>
</item>
<item>
- <widget class="CtrlComboBox" name="cb4" native="true"/>
+ <widget class="MusEWidget::CtrlComboBox" name="cb4" native="true"/>
</item>
</layout>
</widget>
@@ -685,7 +685,7 @@
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
- <class>CtrlComboBox</class>
+ <class>MusEWidget::CtrlComboBox</class>
<extends>QWidget</extends>
<header location="global">ctrlcombo.h</header>
</customwidget>
diff --git a/muse2/muse/mplugins/midifilterimpl.cpp b/muse2/muse/mplugins/midifilterimpl.cpp
index 196ce97c..50dcd601 100644
--- a/muse2/muse/mplugins/midifilterimpl.cpp
+++ b/muse2/muse/mplugins/midifilterimpl.cpp
@@ -4,6 +4,21 @@
// $Id: midifilterimpl.cpp,v 1.1.1.1 2003/10/27 18:52:49 wschweer Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "midifilterimpl.h"
@@ -18,19 +33,19 @@
void MidiFilterConfig::setCtrl1(int n)
{
- midiFilterCtrl1 = n-1;
+ MusEGlobal::midiFilterCtrl1 = n-1;
}
void MidiFilterConfig::setCtrl2(int n)
{
- midiFilterCtrl2 = n-1;
+ MusEGlobal::midiFilterCtrl2 = n-1;
}
void MidiFilterConfig::setCtrl3(int n)
{
- midiFilterCtrl3 = n-1;
+ MusEGlobal::midiFilterCtrl3 = n-1;
}
void MidiFilterConfig::setCtrl4(int n)
{
- midiFilterCtrl4 = n-1;
+ MusEGlobal::midiFilterCtrl4 = n-1;
}
@@ -42,18 +57,18 @@ MidiFilterConfig::MidiFilterConfig(QDialog* parent)
: QDialog(parent)
{
setupUi(this);
- cb1->setCurrentIndex(midiFilterCtrl1);
- cb2->setCurrentIndex(midiFilterCtrl2);
- cb3->setCurrentIndex(midiFilterCtrl3);
- cb4->setCurrentIndex(midiFilterCtrl4);
-
- rf1->setChecked(midiRecordType & 1);
- rf2->setChecked(midiRecordType & 2);
- rf3->setChecked(midiRecordType & 4);
- rf4->setChecked(midiRecordType & 8);
- rf5->setChecked(midiRecordType & 16);
- rf6->setChecked(midiRecordType & 32);
- rf7->setChecked(midiRecordType & 64);
+ cb1->setCurrentIndex(MusEGlobal::midiFilterCtrl1);
+ cb2->setCurrentIndex(MusEGlobal::midiFilterCtrl2);
+ cb3->setCurrentIndex(MusEGlobal::midiFilterCtrl3);
+ cb4->setCurrentIndex(MusEGlobal::midiFilterCtrl4);
+
+ rf1->setChecked(MusEGlobal::midiRecordType & 1);
+ rf2->setChecked(MusEGlobal::midiRecordType & 2);
+ rf3->setChecked(MusEGlobal::midiRecordType & 4);
+ rf4->setChecked(MusEGlobal::midiRecordType & 8);
+ rf5->setChecked(MusEGlobal::midiRecordType & 16);
+ rf6->setChecked(MusEGlobal::midiRecordType & 32);
+ rf7->setChecked(MusEGlobal::midiRecordType & 64);
connect(rf1, SIGNAL(toggled(bool)), SLOT(recordChanged1(bool)));
connect(rf2, SIGNAL(toggled(bool)), SLOT(recordChanged2(bool)));
connect(rf3, SIGNAL(toggled(bool)), SLOT(recordChanged3(bool)));
@@ -62,13 +77,13 @@ MidiFilterConfig::MidiFilterConfig(QDialog* parent)
connect(rf6, SIGNAL(toggled(bool)), SLOT(recordChanged6(bool)));
connect(rf7, SIGNAL(toggled(bool)), SLOT(recordChanged7(bool)));
- tf1->setChecked(midiThruType & 1);
- tf2->setChecked(midiThruType & 2);
- tf3->setChecked(midiThruType & 4);
- tf4->setChecked(midiThruType & 8);
- tf5->setChecked(midiThruType & 16);
- tf6->setChecked(midiThruType & 32);
- tf7->setChecked(midiThruType & 64);
+ tf1->setChecked(MusEGlobal::midiThruType & 1);
+ tf2->setChecked(MusEGlobal::midiThruType & 2);
+ tf3->setChecked(MusEGlobal::midiThruType & 4);
+ tf4->setChecked(MusEGlobal::midiThruType & 8);
+ tf5->setChecked(MusEGlobal::midiThruType & 16);
+ tf6->setChecked(MusEGlobal::midiThruType & 32);
+ tf7->setChecked(MusEGlobal::midiThruType & 64);
connect(tf1, SIGNAL(toggled(bool)), SLOT(thruChanged1(bool)));
connect(tf2, SIGNAL(toggled(bool)), SLOT(thruChanged2(bool)));
connect(tf3, SIGNAL(toggled(bool)), SLOT(thruChanged3(bool)));
@@ -77,22 +92,22 @@ MidiFilterConfig::MidiFilterConfig(QDialog* parent)
connect(tf6, SIGNAL(toggled(bool)), SLOT(thruChanged6(bool)));
connect(tf7, SIGNAL(toggled(bool)), SLOT(thruChanged7(bool)));
- cf1->setChecked(midiInputChannel & 1);
- cf2->setChecked(midiInputChannel & 2);
- cf3->setChecked(midiInputChannel & 4);
- cf4->setChecked(midiInputChannel & 8);
- cf5->setChecked(midiInputChannel & 0x10);
- cf6->setChecked(midiInputChannel & 0x20);
- cf7->setChecked(midiInputChannel & 0x40);
- cf8->setChecked(midiInputChannel & 0x80);
- cf9->setChecked(midiInputChannel & 0x100);
- cf10->setChecked(midiInputChannel & 0x200);
- cf11->setChecked(midiInputChannel & 0x400);
- cf12->setChecked(midiInputChannel & 0x800);
- cf13->setChecked(midiInputChannel & 0x1000);
- cf14->setChecked(midiInputChannel & 0x2000);
- cf15->setChecked(midiInputChannel & 0x4000);
- cf16->setChecked(midiInputChannel & 0x8000);
+ cf1->setChecked(MusEGlobal::midiInputChannel & 1);
+ cf2->setChecked(MusEGlobal::midiInputChannel & 2);
+ cf3->setChecked(MusEGlobal::midiInputChannel & 4);
+ cf4->setChecked(MusEGlobal::midiInputChannel & 8);
+ cf5->setChecked(MusEGlobal::midiInputChannel & 0x10);
+ cf6->setChecked(MusEGlobal::midiInputChannel & 0x20);
+ cf7->setChecked(MusEGlobal::midiInputChannel & 0x40);
+ cf8->setChecked(MusEGlobal::midiInputChannel & 0x80);
+ cf9->setChecked(MusEGlobal::midiInputChannel & 0x100);
+ cf10->setChecked(MusEGlobal::midiInputChannel & 0x200);
+ cf11->setChecked(MusEGlobal::midiInputChannel & 0x400);
+ cf12->setChecked(MusEGlobal::midiInputChannel & 0x800);
+ cf13->setChecked(MusEGlobal::midiInputChannel & 0x1000);
+ cf14->setChecked(MusEGlobal::midiInputChannel & 0x2000);
+ cf15->setChecked(MusEGlobal::midiInputChannel & 0x4000);
+ cf16->setChecked(MusEGlobal::midiInputChannel & 0x8000);
connect(cb1, SIGNAL(activated(int)), SLOT(setCtrl1(int)));
connect(cb2, SIGNAL(activated(int)), SLOT(setCtrl2(int)));
diff --git a/muse2/muse/mplugins/midifilterimpl.h b/muse2/muse/mplugins/midifilterimpl.h
index bbda7757..de276f44 100644
--- a/muse2/muse/mplugins/midifilterimpl.h
+++ b/muse2/muse/mplugins/midifilterimpl.h
@@ -4,6 +4,21 @@
// $Id: midifilterimpl.h,v 1.1.1.1 2003/10/27 18:52:40 wschweer Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDIFILTERIMP_H__
@@ -23,21 +38,21 @@ class MidiFilterConfig : public QDialog, public Ui::MidiFilterConfigBase {
void rChanged(bool f, int val) {
if (f)
- midiRecordType |= val;
+ MusEGlobal::midiRecordType |= val;
else
- midiRecordType &= ~val;
+ MusEGlobal::midiRecordType &= ~val;
}
void tChanged(bool f, int val) {
if (f)
- midiThruType |= val;
+ MusEGlobal::midiThruType |= val;
else
- midiThruType &= ~val;
+ MusEGlobal::midiThruType &= ~val;
}
void chChanged(bool f, int val) {
if (f)
- midiInputChannel |= val;
+ MusEGlobal::midiInputChannel |= val;
else
- midiInputChannel &= ~val;
+ MusEGlobal::midiInputChannel &= ~val;
}
virtual void closeEvent(QCloseEvent*);
diff --git a/muse2/muse/mplugins/midiitransform.cpp b/muse2/muse/mplugins/midiitransform.cpp
index 6ab584d3..8cc881ff 100644
--- a/muse2/muse/mplugins/midiitransform.cpp
+++ b/muse2/muse/mplugins/midiitransform.cpp
@@ -4,6 +4,21 @@
// $Id: midiitransform.cpp,v 1.2.2.2 2009/05/24 21:43:44 terminator356 Exp $
//
// (C) Copyright 2001-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -115,7 +130,7 @@ class MidiInputTransformation {
procVal2a = 0;
procVal2b = 0;
funcOp = Transform;
- quantVal = config.division;
+ quantVal = MusEConfig::config.division;
selPort = Ignore;
selChannel = Ignore;
selChannela = 0;
@@ -162,7 +177,7 @@ bool applyMidiInputTransformation(MidiRecordEvent& event)
int rv = modules[i].transform->apply(event);
if (rv == 1)
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("drop input event\n");
}
if (rv)
@@ -1615,7 +1630,7 @@ void MidiInputTransformDialog::presetChanged(QListWidgetItem* item)
iMidiInputTransformation i;
for (i = mtlist.begin(); i != mtlist.end(); ++i) {
if (item->text() == (*i)->name) {
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("found %s\n", (*i)->name.toLatin1().constData());
cmt = *i;
if (cmodul != -1) {
diff --git a/muse2/muse/mplugins/midiitransform.h b/muse2/muse/mplugins/midiitransform.h
index b9288319..74a7be7e 100644
--- a/muse2/muse/mplugins/midiitransform.h
+++ b/muse2/muse/mplugins/midiitransform.h
@@ -4,6 +4,21 @@
// $Id: midiitransform.h,v 1.1.1.1.2.1 2009/02/02 21:38:01 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDIITRANSFORM_H__
diff --git a/muse2/muse/mplugins/mitplugin.cpp b/muse2/muse/mplugins/mitplugin.cpp
index e1a4e656..b60e47e8 100644
--- a/muse2/muse/mplugins/mitplugin.cpp
+++ b/muse2/muse/mplugins/mitplugin.cpp
@@ -4,6 +4,21 @@
// $Id: mitplugin.cpp,v 1.1.1.1 2003/10/27 18:52:40 wschweer Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "mitplugin.h"
@@ -22,6 +37,8 @@
MITPluginList mitPlugins;
+namespace MusEApp {
+
//---------------------------------------------------------
// startMidiInputPlugin
//---------------------------------------------------------
@@ -113,24 +130,26 @@ void MusE::hideMidiRhythmGenerator()
#endif
//---------------------------------------------------------
-// processMidiInputTransformPlugins
+// startMidiTransformer
//---------------------------------------------------------
-void processMidiInputTransformPlugins(MEvent& event)
+void MusE::startMidiTransformer()
{
- for (iMITPlugin i = mitPlugins.begin(); i != mitPlugins.end(); ++i)
- (*i)->process(event);
+ if (midiTransformerDialog == 0)
+ midiTransformerDialog = new MidiTransformerDialog;
+ midiTransformerDialog->show();
}
+} // namespace MusEApp
+
//---------------------------------------------------------
-// startMidiTransformer
+// processMidiInputTransformPlugins
//---------------------------------------------------------
-void MusE::startMidiTransformer()
+void processMidiInputTransformPlugins(MEvent& event)
{
- if (midiTransformerDialog == 0)
- midiTransformerDialog = new MidiTransformerDialog;
- midiTransformerDialog->show();
+ for (iMITPlugin i = mitPlugins.begin(); i != mitPlugins.end(); ++i)
+ (*i)->process(event);
}
//---------------------------------------------------------
diff --git a/muse2/muse/mplugins/mitplugin.h b/muse2/muse/mplugins/mitplugin.h
index a7ab3729..058515a3 100644
--- a/muse2/muse/mplugins/mitplugin.h
+++ b/muse2/muse/mplugins/mitplugin.h
@@ -4,6 +4,21 @@
// $Id: mitplugin.h,v 1.1.1.1.2.1 2007/01/27 14:52:43 spamatica Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MITPLUGIN_H__
diff --git a/muse2/muse/mplugins/mittranspose.cpp b/muse2/muse/mplugins/mittranspose.cpp
index 4aeaf046..feefccad 100644
--- a/muse2/muse/mplugins/mittranspose.cpp
+++ b/muse2/muse/mplugins/mittranspose.cpp
@@ -4,6 +4,21 @@
// $Id: mittranspose.cpp,v 1.2.2.1 2009/05/03 04:14:00 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QCloseEvent>
@@ -36,7 +51,7 @@ MITPluginTranspose::MITPluginTranspose(QWidget* parent, Qt::WFlags fl)
connect(onCheckBox, SIGNAL(toggled(bool)), SLOT(onToggled(bool)));
connect(triggerKeySpinBox, SIGNAL(valueChanged(int)),
SLOT(triggerKeyChanged(int)));
- connect(heartBeatTimer, SIGNAL(timeout()), SLOT(noteReceived()));
+ connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(noteReceived()));
}
//---------------------------------------------------------
diff --git a/muse2/muse/mplugins/mittranspose.h b/muse2/muse/mplugins/mittranspose.h
index fcbc96e3..2fc4d378 100644
--- a/muse2/muse/mplugins/mittranspose.h
+++ b/muse2/muse/mplugins/mittranspose.h
@@ -4,6 +4,21 @@
// $Id: mittranspose.h,v 1.1.1.1 2003/10/27 18:52:40 wschweer Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MITTRANSPOSE_H__
diff --git a/muse2/muse/mplugins/mrconfig.cpp b/muse2/muse/mplugins/mrconfig.cpp
index 1a55c826..26788389 100644
--- a/muse2/muse/mplugins/mrconfig.cpp
+++ b/muse2/muse/mplugins/mrconfig.cpp
@@ -4,6 +4,21 @@
// $Id: mrconfig.cpp,v 1.1.1.1 2003/10/27 18:52:43 wschweer Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "pitchedit.h"
@@ -21,12 +36,12 @@ MRConfig::MRConfig(QWidget* parent, Qt::WFlags fl)
: QWidget(parent, fl)
{
setupUi(this);
- b1->setChecked(rcEnable);
- sb1->setValue(rcStopNote);
- sb2->setValue(rcRecordNote);
- sb3->setValue(rcGotoLeftMarkNote);
- sb4->setValue(rcPlayNote);
- steprec_box->setValue(rcSteprecNote);
+ b1->setChecked(MusEGlobal::rcEnable);
+ sb1->setValue(MusEGlobal::rcStopNote);
+ sb2->setValue(MusEGlobal::rcRecordNote);
+ sb3->setValue(MusEGlobal::rcGotoLeftMarkNote);
+ sb4->setValue(MusEGlobal::rcPlayNote);
+ steprec_box->setValue(MusEGlobal::rcSteprecNote);
connect(b1, SIGNAL(toggled(bool)), SLOT(setRcEnable(bool)));
connect(sb1, SIGNAL(valueChanged(int)), SLOT(setRcStopNote(int)));
@@ -48,31 +63,31 @@ void MRConfig::closeEvent(QCloseEvent* ev)
void MRConfig::setRcEnable(bool f)
{
- rcEnable = f;
+ MusEGlobal::rcEnable = f;
}
void MRConfig::setRcStopNote(int val)
{
- rcStopNote = val;
+ MusEGlobal::rcStopNote = val;
}
void MRConfig::setRcRecordNote(int val)
{
- rcRecordNote = val;
+ MusEGlobal::rcRecordNote = val;
}
void MRConfig::setRcGotoLeftMarkNote(int val)
{
- rcGotoLeftMarkNote = val;
+ MusEGlobal::rcGotoLeftMarkNote = val;
}
void MRConfig::setRcPlayNote(int val)
{
- rcPlayNote = val;
+ MusEGlobal::rcPlayNote = val;
}
void MRConfig::setRcSteprecNote(int val)
{
- rcSteprecNote = val;
+ MusEGlobal::rcSteprecNote = val;
}
diff --git a/muse2/muse/mplugins/mrconfig.h b/muse2/muse/mplugins/mrconfig.h
index 5e4b38af..60e6c119 100644
--- a/muse2/muse/mplugins/mrconfig.h
+++ b/muse2/muse/mplugins/mrconfig.h
@@ -4,6 +4,21 @@
// $Id: mrconfig.h,v 1.1.1.1 2003/10/27 18:52:43 wschweer Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MRCONFIG_H__
diff --git a/muse2/muse/mplugins/random.cpp b/muse2/muse/mplugins/random.cpp
index 5360d6b8..9f74dd74 100644
--- a/muse2/muse/mplugins/random.cpp
+++ b/muse2/muse/mplugins/random.cpp
@@ -5,6 +5,21 @@
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//
// This code is an adaption of the random rhythm generator taken
// from "The JAZZ++ Midi Sequencer"
// Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all
diff --git a/muse2/muse/mplugins/random.h b/muse2/muse/mplugins/random.h
index 2c9dfe5b..9d7cffa1 100644
--- a/muse2/muse/mplugins/random.h
+++ b/muse2/muse/mplugins/random.h
@@ -5,6 +5,21 @@
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//
// This code is an adaption of the random rhythm generator taken
// from "The JAZZ++ Midi Sequencer"
// Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all
diff --git a/muse2/muse/mplugins/rhythm.cpp b/muse2/muse/mplugins/rhythm.cpp
index 0fe2ba16..78dfeee5 100644
--- a/muse2/muse/mplugins/rhythm.cpp
+++ b/muse2/muse/mplugins/rhythm.cpp
@@ -5,6 +5,21 @@
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//
// This code is an adaption of the random rhythm generator taken
// from "The JAZZ++ Midi Sequencer"
// Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all
diff --git a/muse2/muse/mplugins/rhythm.h b/muse2/muse/mplugins/rhythm.h
index eb8d00dd..d60e7993 100644
--- a/muse2/muse/mplugins/rhythm.h
+++ b/muse2/muse/mplugins/rhythm.h
@@ -5,6 +5,21 @@
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//
// This code is an adaption of the random rhythm generator taken
// from "The JAZZ++ Midi Sequencer"
// Copyright (C) 1994-2000 Andreas Voss and Per Sigmond, all
diff --git a/muse2/muse/mtc.cpp b/muse2/muse/mtc.cpp
index 647d6359..cf404a90 100644
--- a/muse2/muse/mtc.cpp
+++ b/muse2/muse/mtc.cpp
@@ -4,6 +4,21 @@
// $Id: mtc.cpp,v 1.1.1.1 2003/10/27 18:51:48 wschweer Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "mtc.h"
diff --git a/muse2/muse/mtc.h b/muse2/muse/mtc.h
index ae2bb01e..1c5130ae 100644
--- a/muse2/muse/mtc.h
+++ b/muse2/muse/mtc.h
@@ -4,6 +4,21 @@
// $Id: mtc.h,v 1.1.1.1 2003/10/27 18:51:25 wschweer Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MTC_H__
diff --git a/muse2/muse/node.cpp b/muse2/muse/node.cpp
index da3874f0..8b9e44d8 100644
--- a/muse2/muse/node.cpp
+++ b/muse2/muse/node.cpp
@@ -4,6 +4,21 @@
// $Id: node.cpp,v 1.36.2.25 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
@@ -375,10 +390,10 @@ void AudioTrack::copyData(unsigned pos, int dstChannels, int srcStartChan, int s
// No data was available from a previous call during this process cycle. Zero the supplied buffers and just return.
for(i = 0; i < dstChannels; ++i)
{
- if(config.useDenormalBias)
+ if(MusEConfig::config.useDenormalBias)
{
for(unsigned int q = 0; q < nframes; ++q)
- dstBuffer[i][q] = denormalBias;
+ dstBuffer[i][q] = MusEGlobal::denormalBias;
}
else
memset(dstBuffer[i], 0, sizeof(float) * nframes);
@@ -416,10 +431,10 @@ void AudioTrack::copyData(unsigned pos, int dstChannels, int srcStartChan, int s
unsigned int q;
for(i = 0; i < dstChannels; ++i)
{
- if(config.useDenormalBias)
+ if(MusEConfig::config.useDenormalBias)
{
for(q = 0; q < nframes; ++q)
- dstBuffer[i][q] = denormalBias;
+ dstBuffer[i][q] = MusEGlobal::denormalBias;
}
else
memset(dstBuffer[i], 0, sizeof(float) * nframes);
@@ -433,10 +448,10 @@ void AudioTrack::copyData(unsigned pos, int dstChannels, int srcStartChan, int s
/*
if(!usedirectbuf)
{
- if(config.useDenormalBias)
+ if(MusEConfig::config.useDenormalBias)
{
for(q = 0; q < nframes; ++q)
- outBuffers[i][q] = denormalBias;
+ outBuffers[i][q] = MusEGlobal::denormalBias;
}
else
memset(outBuffers[i], 0, sizeof(float) * nframes);
@@ -525,10 +540,10 @@ void AudioTrack::copyData(unsigned pos, int dstChannels, int srcStartChan, int s
unsigned int q;
for(i = 0; i < dstChannels; ++i)
{
- if(config.useDenormalBias)
+ if(MusEConfig::config.useDenormalBias)
{
for(q = 0; q < nframes; q++)
- dstBuffer[i][q] = denormalBias;
+ dstBuffer[i][q] = MusEGlobal::denormalBias;
}
else
memset(dstBuffer[i], 0, sizeof(float) * nframes);
@@ -539,10 +554,10 @@ void AudioTrack::copyData(unsigned pos, int dstChannels, int srcStartChan, int s
{
for(i = 0; i < srcChannels; ++i)
{
- if(config.useDenormalBias)
+ if(MusEConfig::config.useDenormalBias)
{
for(q = 0; q < nframes; ++q)
- outBuffers[i][q] = denormalBias;
+ outBuffers[i][q] = MusEGlobal::denormalBias;
}
else
memset(outBuffers[i], 0, sizeof(float) * nframes);
@@ -575,10 +590,10 @@ void AudioTrack::copyData(unsigned pos, int dstChannels, int srcStartChan, int s
unsigned int q;
for(i = 0; i < dstChannels; ++i)
{
- if(config.useDenormalBias)
+ if(MusEConfig::config.useDenormalBias)
{
for(q = 0; q < nframes; q++)
- dstBuffer[i][q] = denormalBias;
+ dstBuffer[i][q] = MusEGlobal::denormalBias;
}
else
memset(dstBuffer[i], 0, sizeof(float) * nframes);
@@ -823,10 +838,10 @@ void AudioTrack::addData(unsigned pos, int dstChannels, int srcStartChan, int sr
/*
if(!usedirectbuf)
{
- if(config.useDenormalBias)
+ if(MusEConfig::config.useDenormalBias)
{
for(unsigned int q = 0; q < nframes; ++q)
- outBuffers[i][q] = denormalBias;
+ outBuffers[i][q] = MusEGlobal::denormalBias;
}
else
memset(outBuffers[i], 0, sizeof(float) * nframes);
@@ -847,14 +862,14 @@ void AudioTrack::addData(unsigned pos, int dstChannels, int srcStartChan, int sr
unsigned int q;
for(i = 0; i < srcChans; ++i)
{
- if(config.useDenormalBias)
+ if(MusEConfig::config.useDenormalBias)
{
for(q = 0; q < nframes; ++q)
{
if(q & 1)
- buffer[i][q] -= denormalBias;
+ buffer[i][q] -= MusEGlobal::denormalBias;
else
- buffer[i][q] += denormalBias;
+ buffer[i][q] += MusEGlobal::denormalBias;
}
}
}
@@ -943,10 +958,10 @@ void AudioTrack::addData(unsigned pos, int dstChannels, int srcStartChan, int sr
{
for(i = 0; i < srcChannels; ++i)
{
- if(config.useDenormalBias)
+ if(MusEConfig::config.useDenormalBias)
{
for(unsigned int q = 0; q < nframes; ++q)
- outBuffers[i][q] = denormalBias;
+ outBuffers[i][q] = MusEGlobal::denormalBias;
}
else
memset(outBuffers[i], 0, sizeof(float) * nframes);
@@ -979,10 +994,10 @@ void AudioTrack::addData(unsigned pos, int dstChannels, int srcStartChan, int sr
unsigned int q;
for(i = 0; i < dstChannels; ++i)
{
- if(config.useDenormalBias)
+ if(MusEConfig::config.useDenormalBias)
{
for(q = 0; q < nframes; q++)
- dstBuffer[i][q] = denormalBias;
+ dstBuffer[i][q] = MusEGlobal::denormalBias;
}
else
memset(dstBuffer[i], 0, sizeof(float) * nframes);
@@ -1313,7 +1328,7 @@ bool AudioTrack::getData(unsigned pos, int channels, unsigned nframes, float** b
bool AudioInput::getData(unsigned, int channels, unsigned nframes, float** buffer)
{
- if (!checkAudioDevice()) return false;
+ if (!MusEGlobal::checkAudioDevice()) return false;
for (int ch = 0; ch < channels; ++ch)
{
void* jackPort = jackPorts[ch];
@@ -1337,10 +1352,10 @@ bool AudioInput::getData(unsigned, int channels, unsigned nframes, float** buffe
//memcpy(buffer[ch], jackbuf, nframes* sizeof(float));
AL::dsp->cpy(buffer[ch], jackbuf, nframes);
- if (config.useDenormalBias)
+ if (MusEConfig::config.useDenormalBias)
{
for (unsigned int i=0; i < nframes; i++)
- buffer[ch][i] += denormalBias;
+ buffer[ch][i] += MusEGlobal::denormalBias;
// p3.3.41
//fprintf(stderr, "AudioInput::getData %s Jack port %p efx apply channels:%d nframes:%ld %e %e %e %e\n",
@@ -1349,10 +1364,10 @@ bool AudioInput::getData(unsigned, int channels, unsigned nframes, float** buffe
}
else
{
- if (config.useDenormalBias)
+ if (MusEConfig::config.useDenormalBias)
{
for (unsigned int i=0; i < nframes; i++)
- buffer[ch][i] = denormalBias;
+ buffer[ch][i] = MusEGlobal::denormalBias;
}
else
{
@@ -1374,7 +1389,7 @@ bool AudioInput::getData(unsigned, int channels, unsigned nframes, float** buffe
void AudioInput::setName(const QString& s)
{
_name = s;
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
for (int i = 0; i < channels(); ++i) {
char buffer[128];
snprintf(buffer, 128, "%s-%d", _name.toLatin1().constData(), i);
@@ -1490,7 +1505,7 @@ void AudioTrack::record()
while(fifo.getCount()) {
- if (fifo.get(_channels, segmentSize, buffer, &pos)) {
+ if (fifo.get(_channels, MusEGlobal::segmentSize, buffer, &pos)) {
printf("AudioTrack::record(): empty fifo\n");
return;
}
@@ -1546,7 +1561,7 @@ void AudioTrack::record()
//printf("AudioTrack::record loopcnt:%d lframe:%d newpos:%d curpos:%d start:%d end:%d\n", audio->loopCount(), audio->loopFrame(), pos, position, audio->getStartRecordPos().frame(), audio->getEndRecordPos().frame());
_recFile->seek(pos, 0);
- _recFile->write(_channels, buffer, segmentSize);
+ _recFile->write(_channels, buffer, MusEGlobal::segmentSize);
}
}
@@ -1563,13 +1578,13 @@ void AudioTrack::record()
void AudioOutput::processInit(unsigned nframes)
{
_nframes = nframes;
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
for (int i = 0; i < channels(); ++i) {
if (jackPorts[i]) {
buffer[i] = audioDevice->getBuffer(jackPorts[i], nframes);
- if (config.useDenormalBias) {
+ if (MusEConfig::config.useDenormalBias) {
for (unsigned int j=0; j < nframes; j++)
- buffer[i][j] += denormalBias;
+ buffer[i][j] += MusEGlobal::denormalBias;
}
}
else
@@ -1607,9 +1622,9 @@ void AudioOutput::silence(unsigned n)
{
processInit(n);
for (int i = 0; i < channels(); ++i)
- if (config.useDenormalBias) {
+ if (MusEConfig::config.useDenormalBias) {
for (unsigned int j=0; j < n; j++)
- buffer[i][j] = denormalBias;
+ buffer[i][j] = MusEGlobal::denormalBias;
} else {
memset(buffer[i], 0, n * sizeof(float));
}
@@ -1638,8 +1653,8 @@ void AudioOutput::processWrite()
}
}
// Changed by Tim. p3.3.18
- //if (audioClickFlag && song->click()) {
- if (sendMetronome() && audioClickFlag && song->click()) {
+ //if (MusEGlobal::audioClickFlag && song->click()) {
+ if (sendMetronome() && MusEGlobal::audioClickFlag && song->click()) {
// Added by Tim. p3.3.18
#ifdef METRONOME_DEBUG
@@ -1658,7 +1673,7 @@ void AudioOutput::processWrite()
void AudioOutput::setName(const QString& s)
{
_name = s;
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
for (int i = 0; i < channels(); ++i) {
char buffer[128];
snprintf(buffer, 128, "%s-%d", _name.toLatin1().constData(), i);
@@ -1680,7 +1695,7 @@ Fifo::Fifo()
{
muse_atomic_init(&count);
//nbuffer = FIFO_BUFFER;
- nbuffer = fifoLength;
+ nbuffer = MusEGlobal::fifoLength;
buffer = new FifoBuffer*[nbuffer];
for (int i = 0; i < nbuffer; ++i)
buffer[i] = new FifoBuffer;
@@ -1915,7 +1930,7 @@ void AudioTrack::setTotalOutChannels(int num)
outBuffers = new float*[chans];
for (int i = 0; i < chans; ++i)
- posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * segmentSize);
+ posix_memalign((void**)&outBuffers[i], 16, sizeof(float) * MusEGlobal::segmentSize);
//chans = num;
// Limit the actual track (meters, copying etc, all 'normal' operation) to two-channel stereo.
diff --git a/muse2/muse/node.h b/muse2/muse/node.h
index b54faea9..1b8d39ab 100644
--- a/muse2/muse/node.h
+++ b/muse2/muse/node.h
@@ -4,6 +4,21 @@
// $Id: node.h,v 1.8.2.2 2006/04/13 19:09:48 spamatica Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __AUDIONODE_H__
diff --git a/muse2/muse/osc.cpp b/muse2/muse/osc.cpp
index 9f9a5531..ba0941f9 100644
--- a/muse2/muse/osc.cpp
+++ b/muse2/muse/osc.cpp
@@ -3,11 +3,13 @@
// Linux Music Editor
// $Id: osc.cpp,v 1.0.0.0 2010/04/22 03:39:58 terminator356 Exp $
//
-// Copyright (C) 1999-2010 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
// OSC module added by Tim.
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -16,7 +18,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "config.h"
@@ -363,6 +365,8 @@ void initOSC()
lo_server_thread_start(serverThread);
}
+namespace MusEApp {
+
//---------------------------------------------------------
// exitOSC
//---------------------------------------------------------
@@ -403,7 +407,7 @@ void stopOSC()
oscServerRunning = false;
}
-
+} // namespace MusEApp
/*
//---------------------------------------------------------
@@ -622,7 +626,7 @@ int OscIF::oscUpdate(lo_arg **argv)
#endif
// Send sample rate.
- lo_send(_uiOscTarget, _uiOscSampleRatePath, "i", sampleRate);
+ lo_send(_uiOscTarget, _uiOscSampleRatePath, "i", MusEGlobal::sampleRate);
// Send project directory.
//lo_send(_uiOscTarget, _uiOscConfigurePath, "ss",
diff --git a/muse2/muse/osc.h b/muse2/muse/osc.h
index 02c30de4..a0973ac7 100644
--- a/muse2/muse/osc.h
+++ b/muse2/muse/osc.h
@@ -3,10 +3,12 @@
// Linux Music Editor
// $Id: osc.h,v 1.0.0.0 2010/04/22 10:05:00 terminator356 Exp $
//
-// Copyright (C) 1999-2010 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __OSC_H__
diff --git a/muse2/muse/part.cpp b/muse2/muse/part.cpp
index 239d53d5..51478928 100644
--- a/muse2/muse/part.cpp
+++ b/muse2/muse/part.cpp
@@ -5,6 +5,21 @@
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
// Additions, modifications (C) Copyright 2011 Tim E. Real (terminator356 on users DOT sourceforge DOT net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -631,7 +646,7 @@ int PartList::index(Part* part)
if (i->second == part) {
return index;
}
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("PartList::index(): not found!\n");
//return 0;
return -1;
diff --git a/muse2/muse/part.h b/muse2/muse/part.h
index 67a67dbb..d5b85b03 100644
--- a/muse2/muse/part.h
+++ b/muse2/muse/part.h
@@ -5,6 +5,21 @@
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
// Additions, modifications (C) Copyright 2011 Tim E. Real (terminator356 on users DOT sourceforge DOT net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __PART_H__
diff --git a/muse2/muse/plugin.cpp b/muse2/muse/plugin.cpp
index e6027c6f..99d89640 100644
--- a/muse2/muse/plugin.cpp
+++ b/muse2/muse/plugin.cpp
@@ -4,6 +4,21 @@
// $Id: plugin.cpp,v 1.21.2.23 2009/12/15 22:07:12 spamatica Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -64,13 +79,13 @@
PluginList plugins;
/*
-static const char* preset_file_pattern[] = {
+static const char* MusEGlobal::preset_file_pattern[] = {
QT_TRANSLATE_NOOP("@default", "Presets (*.pre *.pre.gz *.pre.bz2)"),
QT_TRANSLATE_NOOP("@default", "All Files (*)"),
0
};
-static const char* preset_file_save_pattern[] = {
+static const char* MusEGlobal::preset_file_save_pattern[] = {
QT_TRANSLATE_NOOP("@default", "Presets (*.pre)"),
QT_TRANSLATE_NOOP("@default", "gzip compressed presets (*.pre.gz)"),
QT_TRANSLATE_NOOP("@default", "bzip2 compressed presets (*.pre.bz2)"),
@@ -126,7 +141,7 @@ bool ladspa2MidiControlValues(const LADSPA_Descriptor* plugin, unsigned long por
printf("ladspa2MidiControlValues: has LADSPA_HINT_SAMPLE_RATE\n");
#endif
- m = float(sampleRate);
+ m = float(MusEGlobal::sampleRate);
}
if(desc & LADSPA_HINT_BOUNDED_BELOW)
@@ -306,7 +321,7 @@ float midi2LadspaValue(const LADSPA_Descriptor* plugin, unsigned long port, int
printf("midi2LadspaValue: has LADSPA_HINT_SAMPLE_RATE\n");
#endif
- m = float(sampleRate);
+ m = float(MusEGlobal::sampleRate);
}
if(desc & LADSPA_HINT_BOUNDED_BELOW)
@@ -518,7 +533,7 @@ bool ladspaDefaultValue(const LADSPA_Descriptor* plugin, unsigned long port, flo
LADSPA_PortRangeHintDescriptor rh = range.HintDescriptor;
// bool isLog = LADSPA_IS_HINT_LOGARITHMIC(rh);
//double val = 1.0;
- float m = (rh & LADSPA_HINT_SAMPLE_RATE) ? float(sampleRate) : 1.0f;
+ float m = (rh & LADSPA_HINT_SAMPLE_RATE) ? float(MusEGlobal::sampleRate) : 1.0f;
if (LADSPA_IS_HINT_DEFAULT_MINIMUM(rh))
{
*val = range.LowerBound * m;
@@ -621,7 +636,7 @@ void ladspaControlRange(const LADSPA_Descriptor* plugin, unsigned long port, flo
}
float m = 1.0;
if (desc & LADSPA_HINT_SAMPLE_RATE)
- m = float(sampleRate);
+ m = float(MusEGlobal::sampleRate);
if (desc & LADSPA_HINT_BOUNDED_BELOW)
*min = range.LowerBound * m;
@@ -653,7 +668,7 @@ void PluginBase::range(unsigned long i, float* min, float* max) const
}
float m = 1.0;
if (desc & LADSPA_HINT_SAMPLE_RATE)
- m = float(sampleRate);
+ m = float(MusEGlobal::sampleRate);
if (desc & LADSPA_HINT_BOUNDED_BELOW)
*min = range.LowerBound * m;
@@ -747,7 +762,7 @@ Plugin::Plugin(QFileInfo* f, const LADSPA_Descriptor* d, bool isDssi)
// Hack: Special Flag required for example for control processing.
_isDssiVst = fi.completeBaseName() == QString("dssi-vst");
// Hack: Blacklist vst plugins in-place, configurable for now.
- if ((_inports != _outports) || (_isDssiVst && !config.vstInPlace))
+ if ((_inports != _outports) || (_isDssiVst && !MusEConfig::config.vstInPlace))
_inPlaceCapable = false;
}
@@ -925,7 +940,7 @@ int Plugin::incReferences(int val)
// Hack: Special flag required for example for control processing.
_isDssiVst = fi.completeBaseName() == QString("dssi-vst");
// Hack: Blacklist vst plugins in-place, configurable for now.
- if ((_inports != _outports) || (_isDssiVst && !config.vstInPlace))
+ if ((_inports != _outports) || (_isDssiVst && !MusEConfig::config.vstInPlace))
_inPlaceCapable = false;
}
}
@@ -964,7 +979,7 @@ void Plugin::range(unsigned long i, float* min, float* max) const
}
float m = 1.0;
if (desc & LADSPA_HINT_SAMPLE_RATE)
- m = float(sampleRate);
+ m = float(MusEGlobal::sampleRate);
if (desc & LADSPA_HINT_BOUNDED_BELOW)
*min = range.LowerBound * m;
@@ -1100,7 +1115,7 @@ static void loadPluginLib(QFileInfo* fi)
//LADSPA_Properties properties = descr->LADSPA_Plugin->Properties;
//bool inPlaceBroken = LADSPA_IS_INPLACE_BROKEN(properties);
//plugins.add(fi, descr, !inPlaceBroken);
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
fprintf(stderr, "loadPluginLib: adding dssi effect plugin:%s name:%s label:%s\n", fi->filePath().toLatin1().constData(), descr->LADSPA_Plugin->Name, descr->LADSPA_Plugin->Label);
plugins.add(fi, descr->LADSPA_Plugin, true);
@@ -1146,7 +1161,7 @@ static void loadPluginLib(QFileInfo* fi)
//LADSPA_Properties properties = descr->Properties;
//bool inPlaceBroken = LADSPA_IS_INPLACE_BROKEN(properties);
//plugins.add(fi, ladspa, descr, !inPlaceBroken);
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
fprintf(stderr, "loadPluginLib: adding ladspa plugin:%s name:%s label:%s\n", fi->filePath().toLatin1().constData(), descr->Name, descr->Label);
plugins.add(fi, descr);
}
@@ -1161,7 +1176,7 @@ static void loadPluginLib(QFileInfo* fi)
static void loadPluginDir(const QString& s)
{
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("scan ladspa plugin dir <%s>\n", s.toLatin1().constData());
QDir pluginDir(s, QString("*.so")); // ddskrjo
if (pluginDir.exists()) {
@@ -1180,7 +1195,7 @@ static void loadPluginDir(const QString& s)
void initPlugins()
{
- loadPluginDir(museGlobalLib + QString("/plugins"));
+ loadPluginDir(MusEGlobal::museGlobalLib + QString("/plugins"));
const char* p = 0;
@@ -1215,7 +1230,7 @@ void initPlugins()
ladspaPath = "/usr/local/lib64/ladspa:/usr/lib64/ladspa:/usr/local/lib/ladspa:/usr/lib/ladspa";
p = ladspaPath;
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
fprintf(stderr, "loadPluginDir: ladspa path:%s\n", ladspaPath);
while (*p != '\0') {
@@ -1228,7 +1243,7 @@ void initPlugins()
char* buffer = new char[n + 1];
strncpy(buffer, p, n);
buffer[n] = '\0';
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
fprintf(stderr, "loadPluginDir: loading ladspa dir:%s\n", buffer);
loadPluginDir(QString(buffer));
@@ -1263,7 +1278,7 @@ Pipeline::Pipeline()
{
// Added by Tim. p3.3.15
for (int i = 0; i < MAX_CHANNELS; ++i)
- posix_memalign((void**)(buffer + i), 16, sizeof(float) * segmentSize);
+ posix_memalign((void**)(buffer + i), 16, sizeof(float) * MusEGlobal::segmentSize);
for (int i = 0; i < PipelineDepth; ++i)
push_back(0);
@@ -1754,9 +1769,9 @@ void PluginI::updateControllers()
for(unsigned long i = 0; i < controlPorts; ++i)
//audio->msgSetPluginCtrlVal(this, genACnum(_id, i), controls[i].val);
// p3.3.43
- audio->msgSetPluginCtrlVal(_track, genACnum(_id, i), controls[i].val);
+ //audio->msgSetPluginCtrlVal(_track, genACnum(_id, i), controls[i].val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //_track->setPluginCtrlVal(genACnum(_id, i), controls[i].val); // TODO A faster bulk message
+ _track->setPluginCtrlVal(genACnum(_id, i), controls[i].val); // TODO A faster bulk message
}
//---------------------------------------------------------
@@ -1902,7 +1917,7 @@ float PluginI::defaultValue(unsigned long param) const
LADSPA_Handle Plugin::instantiate()
{
- LADSPA_Handle h = plugin->instantiate(plugin, sampleRate);
+ LADSPA_Handle h = plugin->instantiate(plugin, MusEGlobal::sampleRate);
if(h == NULL)
{
fprintf(stderr, "Plugin::instantiate() Error: plugin:%s instantiate failed!\n", plugin->Label);
@@ -2506,7 +2521,7 @@ void PluginI::enable2AllControllers(bool v)
void PluginI::apply(unsigned long n)
{
// Process control value changes.
- //if(automation && _track && _track->automationType() != AUTO_OFF && _id != -1)
+ //if(MusEGlobal::automation && _track && _track->automationType() != AUTO_OFF && _id != -1)
//{
// for(int i = 0; i < controlPorts; ++i)
// {
@@ -2542,7 +2557,7 @@ void PluginI::apply(unsigned long n)
// Set the ladspa control port value.
controls[k].tmpVal = v.value;
- // Need to update the automation value, otherwise it overwrites later with the last automation value.
+ // Need to update the MusEGlobal::automation value, otherwise it overwrites later with the last MusEGlobal::automation value.
if(_track && _id != -1)
{
// Since we are now in the audio thread context, there's no need to send a message,
@@ -2552,7 +2567,7 @@ void PluginI::apply(unsigned long n)
//audio->msgSetPluginCtrlVal(_track, genACnum(_id, k), controls[k].val);
_track->setPluginCtrlVal(genACnum(_id, k), v.value);
- // Record automation.
+ // Record MusEGlobal::automation.
// NO! Take care of this immediately in the OSC control handler, because we don't want
// the silly delay associated with processing the fifo one-at-a-time here.
@@ -2568,8 +2583,8 @@ void PluginI::apply(unsigned long n)
else
#endif // OSC_SUPPORT
{
- // Process automation control value.
- if(automation && _track && _track->automationType() != AUTO_OFF && _id != -1)
+ // Process MusEGlobal::automation control value.
+ if(MusEGlobal::automation && _track && _track->automationType() != AUTO_OFF && _id != -1)
{
if(controls[k].enCtrl && controls[k].en2Ctrl )
controls[k].tmpVal = _track->pluginCtrlVal(genACnum(_id, k));
@@ -2597,7 +2612,7 @@ void PluginI::apply(unsigned long n)
void PluginI::apply(unsigned long n, unsigned long ports, float** bufIn, float** bufOut)
{
// Process control value changes.
- //if(automation && _track && _track->automationType() != AUTO_OFF && _id != -1)
+ //if(MusEGlobal::automation && _track && _track->automationType() != AUTO_OFF && _id != -1)
//{
// for(int i = 0; i < controlPorts; ++i)
// {
@@ -2631,13 +2646,13 @@ void PluginI::apply(unsigned long n, unsigned long ports, float** bufIn, float**
if(fixedsize > n)
fixedsize = n;
- unsigned long min_per = config.minControlProcessPeriod;
+ unsigned long min_per = MusEConfig::config.minControlProcessPeriod;
if(min_per > n)
min_per = n;
- // Process automation control values now.
+ // Process MusEGlobal::automation control values now.
// TODO: This needs to be respect frame resolution. Put this inside the sample loop below.
- if(automation && _track && _track->automationType() != AUTO_OFF && _id != -1)
+ if(MusEGlobal::automation && _track && _track->automationType() != AUTO_OFF && _id != -1)
{
for(unsigned long k = 0; k < controlPorts; ++k)
{
@@ -2710,7 +2725,7 @@ void PluginI::apply(unsigned long n, unsigned long ports, float** bufIn, float**
controls[v.idx].tmpVal = v.value;
/*
- // Need to update the automation value, otherwise it overwrites later with the last automation value.
+ // Need to update the MusEGlobal::automation value, otherwise it overwrites later with the last MusEGlobal::automation value.
if(_track && _id != -1)
{
// Since we are now in the audio thread context, there's no need to send a message,
@@ -2720,11 +2735,11 @@ void PluginI::apply(unsigned long n, unsigned long ports, float** bufIn, float**
//audio->msgSetPluginCtrlVal(_track, genACnum(_id, k), controls[k].val);
_track->setPluginCtrlVal(genACnum(_id, v.idx), v.value);
- // Record automation.
+ // Record MusEGlobal::automation.
// NO! Take care of this immediately in the OSC control handler, because we don't want
// any delay.
// OTOH Since this is the actual place and time where the control ports values
- // are set, best to reflect what happens here to automation.
+ // are set, best to reflect what happens here to MusEGlobal::automation.
// However for dssi-vst it might be best to handle it that way.
//AutomationType at = _track->automationType();
@@ -2878,7 +2893,7 @@ int PluginI::oscUpdate()
{
#ifdef DSSI_SUPPORT
// Send project directory.
- _oscif.oscSendConfigure(DSSI_PROJECT_DIRECTORY_KEY, museProject.toLatin1().constData()); // song->projectPath()
+ _oscif.oscSendConfigure(DSSI_PROJECT_DIRECTORY_KEY, MusEGlobal::museProject.toLatin1().constData()); // song->projectPath()
/*
// Send current string configuration parameters.
@@ -3004,7 +3019,7 @@ int PluginI::oscControl(unsigned long port, float value)
}
- // Record automation:
+ // Record MusEGlobal::automation:
// Take care of this immediately, because we don't want the silly delay associated with
// processing the fifo one-at-a-time in the apply().
// NOTE: With some vsts we don't receive control events until the user RELEASES a control.
@@ -3411,7 +3426,7 @@ PluginGui::PluginGui(PluginIBase* p)
QString id;
id.setNum(plugin->pluginID());
- QString name(museGlobalShare + QString("/plugins/") + id + QString(".ui"));
+ QString name(MusEGlobal::museGlobalShare + QString("/plugins/") + id + QString(".ui"));
QFile uifile(name);
if (uifile.exists()) {
//
@@ -3451,7 +3466,7 @@ PluginGui::PluginGui(PluginIBase* p)
QSignalMapper* mapper = new QSignalMapper(this);
// FIXME: There's no unsigned for gui params. We would need to limit nobj to MAXINT. // p4.0.21
- // FIXME: Our Slider class uses doubles for values, giving some problems with float conversion. // p4.0.21
+ // FIXME: Our MusEWidget::Slider class uses doubles for values, giving some problems with float conversion. // p4.0.21
connect(mapper, SIGNAL(mapped(int)), SLOT(guiParamChanged(int)));
@@ -3483,30 +3498,30 @@ PluginGui::PluginGui(PluginIBase* p)
gw[nobj].param = parameter;
gw[nobj].type = -1;
- if (strcmp(obj->metaObject()->className(), "Slider") == 0) {
+ if (strcmp(obj->metaObject()->className(), "MusEWidget::Slider") == 0) {
gw[nobj].type = GuiWidgets::SLIDER;
- ((Slider*)obj)->setId(nobj);
- ((Slider*)obj)->setCursorHoming(true);
+ ((MusEWidget::Slider*)obj)->setId(nobj);
+ ((MusEWidget::Slider*)obj)->setCursorHoming(true);
//for(int i = 0; i < nobj; i++)
for(unsigned long i = 0; i < nobj; i++) // p4.0.21
{
if(gw[i].type == GuiWidgets::DOUBLE_LABEL && gw[i].param == parameter)
- ((DoubleLabel*)gw[i].widget)->setSlider((Slider*)obj);
+ ((MusEWidget::DoubleLabel*)gw[i].widget)->setSlider((MusEWidget::Slider*)obj);
}
connect(obj, SIGNAL(sliderMoved(double,int)), mapper, SLOT(map()));
connect(obj, SIGNAL(sliderPressed(int)), SLOT(guiSliderPressed(int)));
connect(obj, SIGNAL(sliderReleased(int)), SLOT(guiSliderReleased(int)));
connect(obj, SIGNAL(sliderRightClicked(const QPoint &, int)), SLOT(guiSliderRightClicked(const QPoint &, int)));
}
- else if (strcmp(obj->metaObject()->className(), "DoubleLabel") == 0) {
+ else if (strcmp(obj->metaObject()->className(), "MusEWidget::DoubleLabel") == 0) {
gw[nobj].type = GuiWidgets::DOUBLE_LABEL;
- ((DoubleLabel*)obj)->setId(nobj);
+ ((MusEWidget::DoubleLabel*)obj)->setId(nobj);
//for(int i = 0; i < nobj; i++)
for(unsigned long i = 0; i < nobj; i++)
{
if(gw[i].type == GuiWidgets::SLIDER && gw[i].param == parameter)
{
- ((DoubleLabel*)obj)->setSlider((Slider*)gw[i].widget);
+ ((MusEWidget::DoubleLabel*)obj)->setSlider((MusEWidget::Slider*)gw[i].widget);
break;
}
}
@@ -3546,7 +3561,7 @@ PluginGui::PluginGui(PluginIBase* p)
unsigned long n = plugin->parameters(); // p4.0.21
params = new GuiParam[n];
- //int style = Slider::BgTrough | Slider::BgSlot;
+ //int style = MusEWidget::Slider::BgTrough | MusEWidget::Slider::BgSlot;
QFontMetrics fm = fontMetrics();
int h = fm.height() + 4;
@@ -3566,7 +3581,7 @@ PluginGui::PluginGui(PluginIBase* p)
if (LADSPA_IS_HINT_TOGGLED(range.HintDescriptor)) {
params[i].type = GuiParam::GUI_SWITCH;
- CheckBox* cb = new CheckBox(mw, i, "param");
+ MusEWidget::CheckBox* cb = new MusEWidget::CheckBox(mw, i, "param");
cb->setId(i);
cb->setText(QString(plugin->paramName(i)));
cb->setChecked(plugin->param(i) != 0.0);
@@ -3576,13 +3591,13 @@ PluginGui::PluginGui(PluginIBase* p)
else {
label = new QLabel(QString(plugin->paramName(i)), 0);
params[i].type = GuiParam::GUI_SLIDER;
- params[i].label = new DoubleLabel(val, lower, upper, 0);
+ params[i].label = new MusEWidget::DoubleLabel(val, lower, upper, 0);
params[i].label->setFrame(true);
params[i].label->setPrecision(2);
params[i].label->setId(i);
- Slider* s = new Slider(0, "param", Qt::Horizontal,
- Slider::None); //, style);
+ MusEWidget::Slider* s = new MusEWidget::Slider(0, "param", Qt::Horizontal,
+ MusEWidget::Slider::None); //, style);
s->setCursorHoming(true);
s->setId(i);
@@ -3592,7 +3607,7 @@ PluginGui::PluginGui(PluginIBase* p)
s->setStep(1.0);
s->setValue(dval);
params[i].actuator = s;
- params[i].label->setSlider((Slider*)params[i].actuator);
+ params[i].label->setSlider((MusEWidget::Slider*)params[i].actuator);
}
//params[i].actuator->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Maximum));
params[i].actuator->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
@@ -3643,21 +3658,21 @@ PluginGui::PluginGui(PluginIBase* p)
getPluginConvertedValues(range, lower, upper, dlower, dupper, dval);
label = new QLabel(QString(plugin->paramOutName(i)), 0);
paramsOut[i].type = GuiParam::GUI_METER;
- paramsOut[i].label = new DoubleLabel(val, lower, upper, 0);
+ paramsOut[i].label = new MusEWidget::DoubleLabel(val, lower, upper, 0);
paramsOut[i].label->setFrame(true);
paramsOut[i].label->setPrecision(2);
paramsOut[i].label->setId(i);
- Meter::MeterType mType=Meter::LinMeter;
+ MusEWidget::Meter::MeterType mType=MusEWidget::Meter::LinMeter;
if(LADSPA_IS_HINT_INTEGER(range.HintDescriptor))
- mType=Meter::DBMeter;
- VerticalMeter* m = new VerticalMeter(this, mType);
+ mType=MusEWidget::Meter::DBMeter;
+ MusEWidget::VerticalMeter* m = new MusEWidget::VerticalMeter(this, mType);
//printf("lower =%f upper=%f dlower=%f dupper=%f\n", lower, upper,dlower,dupper);
m->setRange(dlower, dupper);
m->setVal(dval);
paramsOut[i].actuator = m;
-// paramsOut[i].label->setSlider((Slider*)params[i].actuator);
+// paramsOut[i].label->setMusEWidget::Slider((MusEWidget::Slider*)params[i].actuator);
//paramsOut[i].actuator->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
label->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
paramsOut[i].label->setSizePolicy(QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed));
@@ -3676,7 +3691,7 @@ PluginGui::PluginGui(PluginIBase* p)
mw->setLayout(grid);
view->setWidget(mw);
}
- connect(heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
+ connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
}
//---------------------------------------------------------
@@ -3703,8 +3718,8 @@ void PluginGui::getPluginConvertedValues(LADSPA_PortRangeHint range,
dupper = upper = range.UpperBound;
}
if (LADSPA_IS_HINT_SAMPLE_RATE(range.HintDescriptor)) {
- lower *= sampleRate;
- upper *= sampleRate;
+ lower *= MusEGlobal::sampleRate;
+ upper *= MusEGlobal::sampleRate;
dlower = lower;
dupper = upper;
}
@@ -3750,13 +3765,13 @@ void PluginGui::ctrlPressed(int param)
if(params[param].type == GuiParam::GUI_SLIDER)
{
- double val = ((Slider*)params[param].actuator)->value();
+ double val = ((MusEWidget::Slider*)params[param].actuator)->value();
if (LADSPA_IS_HINT_LOGARITHMIC(params[param].hint))
val = pow(10.0, val/20.0);
else if (LADSPA_IS_HINT_INTEGER(params[param].hint))
val = rint(val);
plugin->setParam(param, val);
- ((DoubleLabel*)params[param].label)->setValue(val);
+ ((MusEWidget::DoubleLabel*)params[param].label)->setValue(val);
// p3.3.43
//audio->msgSetPluginCtrlVal(((PluginI*)plugin), id, val);
@@ -3764,17 +3779,17 @@ void PluginGui::ctrlPressed(int param)
if(track)
{
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
track->startAutoRecord(id, val);
}
}
else if(params[param].type == GuiParam::GUI_SWITCH)
{
- //double val = (double)((CheckBox*)params[param].actuator)->isChecked();
- float val = (float)((CheckBox*)params[param].actuator)->isChecked(); // p4.0.21
+ //double val = (double)((MusEWidget::CheckBox*)params[param].actuator)->isChecked();
+ float val = (float)((MusEWidget::CheckBox*)params[param].actuator)->isChecked(); // p4.0.21
plugin->setParam(param, val);
// p3.3.43
@@ -3783,9 +3798,9 @@ void PluginGui::ctrlPressed(int param)
if(track)
{
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
track->startAutoRecord(id, val);
}
@@ -3816,7 +3831,7 @@ void PluginGui::ctrlReleased(int param)
if(params[param].type == GuiParam::GUI_SLIDER)
{
- double val = ((Slider*)params[param].actuator)->value();
+ double val = ((MusEWidget::Slider*)params[param].actuator)->value();
if (LADSPA_IS_HINT_LOGARITHMIC(params[param].hint))
val = pow(10.0, val/20.0);
else if (LADSPA_IS_HINT_INTEGER(params[param].hint))
@@ -3825,7 +3840,7 @@ void PluginGui::ctrlReleased(int param)
}
//else if(params[param].type == GuiParam::GUI_SWITCH)
//{
- //double val = (double)((CheckBox*)params[param].actuator)->isChecked();
+ //double val = (double)((MusEWidget::CheckBox*)params[param].actuator)->isChecked();
// No concept of 'untouching' a checkbox. Remain 'touched' until stop.
//plugin->track()->stopAutoRecord(genACnum(plugin->id(), param), val);
//}
@@ -3863,7 +3878,7 @@ void PluginGui::sliderChanged(double val, int param)
val = rint(val);
if (plugin->param(param) != val) {
plugin->setParam(param, val);
- ((DoubleLabel*)params[param].label)->setValue(val);
+ ((MusEWidget::DoubleLabel*)params[param].label)->setValue(val);
}
int id = plugin->id();
@@ -3877,9 +3892,9 @@ void PluginGui::sliderChanged(double val, int param)
if(track)
{
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
track->recordAutomation(id, val);
}
@@ -3906,7 +3921,7 @@ void PluginGui::labelChanged(double val, int param)
dval = rint(val);
if (plugin->param(param) != val) {
plugin->setParam(param, val);
- ((Slider*)params[param].actuator)->setValue(dval);
+ ((MusEWidget::Slider*)params[param].actuator)->setValue(dval);
}
int id = plugin->id();
@@ -3921,9 +3936,9 @@ void PluginGui::labelChanged(double val, int param)
if(track)
{
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
track->startAutoRecord(id, val);
}
@@ -3940,12 +3955,12 @@ void PluginGui::load()
s += plugin->pluginLabel();
s += "/";
- QString fn = getOpenFileName(s, preset_file_pattern,
+ QString fn = MusEWidget::getOpenFileName(s, MusEGlobal::preset_file_pattern,
this, tr("MusE: load preset"), 0);
if (fn.isEmpty())
return;
bool popenFlag;
- FILE* f = fileOpen(this, fn, QString(".pre"), "r", popenFlag, true);
+ FILE* f = MusEWidget::fileOpen(this, fn, QString(".pre"), "r", popenFlag, true);
if (f == 0)
return;
@@ -4005,13 +4020,13 @@ void PluginGui::save()
s += plugin->pluginLabel();
s += "/";
- //QString fn = getSaveFileName(s, preset_file_pattern, this,
- QString fn = getSaveFileName(s, preset_file_save_pattern, this,
+ //QString fn = MusEWidget::getSaveFileName(s, MusEGlobal::preset_file_pattern, this,
+ QString fn = MusEWidget::getSaveFileName(s, MusEGlobal::preset_file_save_pattern, this,
tr("MusE: save preset"));
if (fn.isEmpty())
return;
bool popenFlag;
- FILE* f = fileOpen(this, fn, QString(".pre"), "w", popenFlag, false, true);
+ FILE* f = MusEWidget::fileOpen(this, fn, QString(".pre"), "w", popenFlag, false, true);
if (f == 0)
return;
Xml xml(f);
@@ -4068,10 +4083,10 @@ void PluginGui::updateValues()
lv = sv;
}
gp->label->setValue(lv);
- ((Slider*)(gp->actuator))->setValue(sv);
+ ((MusEWidget::Slider*)(gp->actuator))->setValue(sv);
}
else if (gp->type == GuiParam::GUI_SWITCH) {
- ((CheckBox*)(gp->actuator))->setChecked(int(plugin->param(i)));
+ ((MusEWidget::CheckBox*)(gp->actuator))->setChecked(int(plugin->param(i)));
}
}
}
@@ -4086,10 +4101,10 @@ void PluginGui::updateValues()
float val = plugin->param(param);
switch(type) {
case GuiWidgets::SLIDER:
- ((Slider*)widget)->setValue(val); // Note conversion to double
+ ((MusEWidget::Slider*)widget)->setValue(val); // Note conversion to double
break;
case GuiWidgets::DOUBLE_LABEL:
- ((DoubleLabel*)widget)->setValue(val); // Note conversion to double
+ ((MusEWidget::DoubleLabel*)widget)->setValue(val); // Note conversion to double
break;
case GuiWidgets::QCHECKBOX:
((QCheckBox*)widget)->setChecked(int(val));
@@ -4126,7 +4141,7 @@ void PluginGui::updateControls()
sv = rint(lv);
lv = sv;
}
- ((VerticalMeter*)(gp->actuator))->setVal(sv);
+ ((MusEWidget::VerticalMeter*)(gp->actuator))->setVal(sv);
gp->label->setValue(lv);
}
@@ -4134,7 +4149,7 @@ void PluginGui::updateControls()
}
- if(!automation)
+ if(!MusEGlobal::automation)
return;
AutomationType at = plugin->track()->automationType();
if(at == AUTO_OFF)
@@ -4156,15 +4171,15 @@ void PluginGui::updateControls()
sv = rint(lv);
lv = sv;
}
- if(((Slider*)(gp->actuator))->value() != sv)
+ if(((MusEWidget::Slider*)(gp->actuator))->value() != sv)
{
//printf("PluginGui::updateControls slider\n");
gp->label->blockSignals(true);
- ((Slider*)(gp->actuator))->blockSignals(true);
- ((Slider*)(gp->actuator))->setValue(sv);
+ ((MusEWidget::Slider*)(gp->actuator))->blockSignals(true);
+ ((MusEWidget::Slider*)(gp->actuator))->setValue(sv);
gp->label->setValue(lv);
- ((Slider*)(gp->actuator))->blockSignals(false);
+ ((MusEWidget::Slider*)(gp->actuator))->blockSignals(false);
gp->label->blockSignals(false);
}
}
@@ -4174,13 +4189,13 @@ void PluginGui::updateControls()
if( plugin->controllerEnabled(i) && plugin->controllerEnabled2(i) )
{
bool v = (int)plugin->track()->pluginCtrlVal(genACnum(plugin->id(), i));
- if(((CheckBox*)(gp->actuator))->isChecked() != v)
+ if(((MusEWidget::CheckBox*)(gp->actuator))->isChecked() != v)
{
//printf("PluginGui::updateControls switch\n");
- ((CheckBox*)(gp->actuator))->blockSignals(true);
- ((CheckBox*)(gp->actuator))->setChecked(v);
- ((CheckBox*)(gp->actuator))->blockSignals(false);
+ ((MusEWidget::CheckBox*)(gp->actuator))->blockSignals(true);
+ ((MusEWidget::CheckBox*)(gp->actuator))->setChecked(v);
+ ((MusEWidget::CheckBox*)(gp->actuator))->blockSignals(false);
}
}
}
@@ -4198,13 +4213,13 @@ void PluginGui::updateControls()
if( plugin->controllerEnabled(param) && plugin->controllerEnabled2(param) )
{
double v = plugin->track()->pluginCtrlVal(genACnum(plugin->id(), param));
- if(((Slider*)widget)->value() != v)
+ if(((MusEWidget::Slider*)widget)->value() != v)
{
//printf("PluginGui::updateControls slider\n");
- ((Slider*)widget)->blockSignals(true);
- ((Slider*)widget)->setValue(v);
- ((Slider*)widget)->blockSignals(false);
+ ((MusEWidget::Slider*)widget)->blockSignals(true);
+ ((MusEWidget::Slider*)widget)->setValue(v);
+ ((MusEWidget::Slider*)widget)->blockSignals(false);
}
}
break;
@@ -4212,13 +4227,13 @@ void PluginGui::updateControls()
if( plugin->controllerEnabled(param) && plugin->controllerEnabled2(param) )
{
double v = plugin->track()->pluginCtrlVal(genACnum(plugin->id(), param));
- if(((DoubleLabel*)widget)->value() != v)
+ if(((MusEWidget::DoubleLabel*)widget)->value() != v)
{
//printf("PluginGui::updateControls label\n");
- ((DoubleLabel*)widget)->blockSignals(true);
- ((DoubleLabel*)widget)->setValue(v);
- ((DoubleLabel*)widget)->blockSignals(false);
+ ((MusEWidget::DoubleLabel*)widget)->blockSignals(true);
+ ((MusEWidget::DoubleLabel*)widget)->setValue(v);
+ ((MusEWidget::DoubleLabel*)widget)->blockSignals(false);
}
}
break;
@@ -4277,10 +4292,10 @@ void PluginGui::guiParamChanged(int idx)
double val = 0.0;
switch(type) {
case GuiWidgets::SLIDER:
- val = ((Slider*)w)->value();
+ val = ((MusEWidget::Slider*)w)->value();
break;
case GuiWidgets::DOUBLE_LABEL:
- val = ((DoubleLabel*)w)->value();
+ val = ((MusEWidget::DoubleLabel*)w)->value();
break;
case GuiWidgets::QCHECKBOX:
val = double(((QCheckBox*)w)->isChecked());
@@ -4298,10 +4313,10 @@ void PluginGui::guiParamChanged(int idx)
int type = gw[i].type;
switch(type) {
case GuiWidgets::SLIDER:
- ((Slider*)widget)->setValue(val);
+ ((MusEWidget::Slider*)widget)->setValue(val);
break;
case GuiWidgets::DOUBLE_LABEL:
- ((DoubleLabel*)widget)->setValue(val);
+ ((MusEWidget::DoubleLabel*)widget)->setValue(val);
break;
case GuiWidgets::QCHECKBOX:
((QCheckBox*)widget)->setChecked(int(val));
@@ -4323,9 +4338,9 @@ void PluginGui::guiParamChanged(int idx)
//if(track)
//{
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
switch(type)
{
@@ -4366,13 +4381,13 @@ void PluginGui::guiParamPressed(int idx)
id = genACnum(id, param);
// NOTE: For this to be of any use, the freeverb gui 2142.ui
- // would have to be used, and changed to use CheckBox and ComboBox
+ // would have to be used, and changed to use MusEWidget::CheckBox and ComboBox
// instead of QCheckBox and QComboBox, since both of those would
// need customization (Ex. QCheckBox doesn't check on click).
/*
switch(type) {
case GuiWidgets::QCHECKBOX:
- double val = (double)((CheckBox*)w)->isChecked();
+ double val = (double)((MusEWidget::CheckBox*)w)->isChecked();
track->startAutoRecord(id, val);
break;
case GuiWidgets::QCOMBOBOX:
@@ -4412,13 +4427,13 @@ void PluginGui::guiParamReleased(int idx)
id = genACnum(id, param);
// NOTE: For this to be of any use, the freeverb gui 2142.ui
- // would have to be used, and changed to use CheckBox and ComboBox
+ // would have to be used, and changed to use MusEWidget::CheckBox and ComboBox
// instead of QCheckBox and QComboBox, since both of those would
// need customization (Ex. QCheckBox doesn't check on click).
/*
switch(type) {
case GuiWidgets::QCHECKBOX:
- double val = (double)((CheckBox*)w)->isChecked();
+ double val = (double)((MusEWidget::CheckBox*)w)->isChecked();
track->stopAutoRecord(id, param);
break;
case GuiWidgets::QCOMBOBOX:
@@ -4454,14 +4469,14 @@ void PluginGui::guiSliderPressed(int idx)
id = genACnum(id, param);
- double val = ((Slider*)w)->value();
+ double val = ((MusEWidget::Slider*)w)->value();
plugin->setParam(param, val);
//audio->msgSetPluginCtrlVal(((PluginI*)plugin), id, val);
// p3.3.43
- audio->msgSetPluginCtrlVal(track, id, val);
+ //audio->msgSetPluginCtrlVal(track, id, val);
// p4.0.21 audio->msgXXX waits. Do we really need to?
- //track->setPluginCtrlVal(id, val);
+ track->setPluginCtrlVal(id, val);
track->startAutoRecord(id, val);
@@ -4474,10 +4489,10 @@ void PluginGui::guiSliderPressed(int idx)
int type = gw[i].type;
switch(type) {
case GuiWidgets::SLIDER:
- ((Slider*)widget)->setValue(val);
+ ((MusEWidget::Slider*)widget)->setValue(val);
break;
case GuiWidgets::DOUBLE_LABEL:
- ((DoubleLabel*)widget)->setValue(val);
+ ((MusEWidget::DoubleLabel*)widget)->setValue(val);
break;
case GuiWidgets::QCHECKBOX:
((QCheckBox*)widget)->setChecked(int(val));
@@ -4513,7 +4528,7 @@ void PluginGui::guiSliderReleased(int idx)
id = genACnum(id, param);
- double val = ((Slider*)w)->value();
+ double val = ((MusEWidget::Slider*)w)->value();
track->stopAutoRecord(id, val);
}
@@ -4535,10 +4550,10 @@ void PluginGui::guiSliderRightClicked(const QPoint &p, int idx)
//---------------------------------------------------------
QWidget* PluginLoader::createWidget(const QString & className, QWidget * parent, const QString & name)
{
- if(className == QString("DoubleLabel"))
- return new DoubleLabel(parent, name.toLatin1().constData());
- if(className == QString("Slider"))
- return new Slider(parent, name.toLatin1().constData(), Qt::Horizontal);
+ if(className == QString("MusEWidget::DoubleLabel"))
+ return new MusEWidget::DoubleLabel(parent, name.toLatin1().constData());
+ if(className == QString("MusEWidget::Slider"))
+ return new MusEWidget::Slider(parent, name.toLatin1().constData(), Qt::Horizontal);
return QUiLoader::createWidget(className, parent, name);
};
diff --git a/muse2/muse/plugin.h b/muse2/muse/plugin.h
index dec77d2f..2a98760e 100644
--- a/muse2/muse/plugin.h
+++ b/muse2/muse/plugin.h
@@ -4,6 +4,21 @@
// $Id: plugin.h,v 1.9.2.13 2009/12/06 01:25:21 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __PLUGIN_H__
@@ -46,8 +61,11 @@ class QToolButton;
class QTreeWidget;
class Xml;
-class Slider;
+
+namespace MusEWidget {
class DoubleLabel;
+}
+
class AudioTrack;
class MidiController;
@@ -250,7 +268,7 @@ struct GuiParam {
int type;
int hint;
- DoubleLabel* label;
+ MusEWidget::DoubleLabel* label;
QWidget* actuator; // Slider or Toggle Button (SWITCH)
};
diff --git a/muse2/muse/pos.cpp b/muse2/muse/pos.cpp
index 5a86673d..d731a5b1 100644
--- a/muse2/muse/pos.cpp
+++ b/muse2/muse/pos.cpp
@@ -4,6 +4,21 @@
// $Id: pos.cpp,v 1.11.2.1 2006/09/19 19:07:08 spamatica Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
@@ -86,7 +101,7 @@ Pos::Pos(int min, int sec, int frame, int subframe)
break;
}
_type = FRAMES;
- _frame = lrint(time * sampleRate);
+ _frame = lrint(time * MusEGlobal::sampleRate);
sn = -1;
}
@@ -526,7 +541,7 @@ void Pos::mbt(int* bar, int* beat, int* tk) const
void Pos::msf(int* min, int* sec, int* fr, int* subFrame) const
{
- double time = double(frame()) / double(sampleRate);
+ double time = double(frame()) / double(MusEGlobal::sampleRate);
*min = int(time) / 60;
*sec = int(time) % 60;
double rest = time - (*min * 60 + *sec);
diff --git a/muse2/muse/pos.h b/muse2/muse/pos.h
index 33c08f6b..a6f8513d 100644
--- a/muse2/muse/pos.h
+++ b/muse2/muse/pos.h
@@ -4,6 +4,21 @@
// $Id: pos.h,v 1.8 2004/07/14 15:27:26 wschweer Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __POS_H__
diff --git a/muse2/muse/remote/CMakeLists.txt b/muse2/muse/remote/CMakeLists.txt
index 22943e71..29ead183 100644
--- a/muse2/muse/remote/CMakeLists.txt
+++ b/muse2/muse/remote/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/remote/pyapi.cpp b/muse2/muse/remote/pyapi.cpp
index 29ea34b3..2143faf0 100644
--- a/muse2/muse/remote/pyapi.cpp
+++ b/muse2/muse/remote/pyapi.cpp
@@ -2,6 +2,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <Python.h>
#include <iostream>
diff --git a/muse2/muse/remote/pyapi.h b/muse2/muse/remote/pyapi.h
index 7501e591..6cc7fbdc 100644
--- a/muse2/muse/remote/pyapi.h
+++ b/muse2/muse/remote/pyapi.h
@@ -2,6 +2,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef PYAPI_H
#define PYAPI_H
diff --git a/muse2/muse/route.cpp b/muse2/muse/route.cpp
index 9425f056..fbf42436 100644
--- a/muse2/muse/route.cpp
+++ b/muse2/muse/route.cpp
@@ -4,6 +4,21 @@
// $Id: route.cpp,v 1.18.2.3 2008/05/21 00:28:52 terminator356 Exp $
//
// (C) Copyright 2003-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QWidget>
@@ -1065,7 +1080,7 @@ QString Route::name() const
else
if(type == JACK_ROUTE)
{
- if (!checkAudioDevice()) return "";
+ if (!MusEGlobal::checkAudioDevice()) return "";
//return s + audioDevice->portName(jackPort);
return audioDevice->portName(jackPort);
}
@@ -1101,7 +1116,7 @@ Route name2route(const QString& rn, bool /*dst*/, int rtype)
{
//if(dst)
//{
- if(checkAudioDevice())
+ if(MusEGlobal::checkAudioDevice())
{
void* p = audioDevice->findPort(s.toLatin1().constData());
if(p)
@@ -1198,7 +1213,7 @@ Route name2route(const QString& rn, bool /*dst*/, int rtype)
else
if(rtype == Route::JACK_ROUTE)
{
- if(checkAudioDevice())
+ if(MusEGlobal::checkAudioDevice())
{
void* p = audioDevice->findPort(s.toLatin1().constData());
if(p)
@@ -1637,7 +1652,7 @@ void Route::dump() const
else
if (type == JACK_ROUTE)
{
- if(checkAudioDevice())
+ if(MusEGlobal::checkAudioDevice())
printf("Route dump: jack audio port <%s> channel %d\n", audioDevice->portName(jackPort).toLatin1().constData(), channel);
}
else
@@ -1653,7 +1668,7 @@ void Route::dump() const
{
if(device->deviceType() == MidiDevice::JACK_MIDI)
{
- if(checkAudioDevice())
+ if(MusEGlobal::checkAudioDevice())
//printf("jack midi port device <%s> ", audioDevice->portName(device->clientPort()).toLatin1().constData());
// p3.3.55
{
@@ -1710,7 +1725,7 @@ bool Route::operator==(const Route& a) const
{
if (type == JACK_ROUTE)
{
- //if (!checkAudioDevice()) return false;
+ //if (!MusEGlobal::checkAudioDevice()) return false;
//return audioDevice->portName(jackPort) == audioDevice->portName(a.jackPort);
// p3.3.55 Simplified.
return jackPort == a.jackPort;
@@ -1730,7 +1745,7 @@ bool Route::operator==(const Route& a) const
{
if(device->deviceType() == MidiDevice::JACK_MIDI)
{
- if (!checkAudioDevice()) return false;
+ if (!MusEGlobal::checkAudioDevice()) return false;
return audioDevice->portName(device->clientPort()) == audioDevice->portName(a.device->clientPort());
}
else
diff --git a/muse2/muse/route.h b/muse2/muse/route.h
index 9809352c..b93e5a0b 100644
--- a/muse2/muse/route.h
+++ b/muse2/muse/route.h
@@ -4,6 +4,21 @@
// $Id: route.h,v 1.5.2.1 2008/05/21 00:28:52 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __ROUTE_H__
diff --git a/muse2/muse/seqmsg.cpp b/muse2/muse/seqmsg.cpp
index 035ee949..6c3fc5ab 100644
--- a/muse2/muse/seqmsg.cpp
+++ b/muse2/muse/seqmsg.cpp
@@ -4,6 +4,21 @@
// $Id: seqmsg.cpp,v 1.32.2.17 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -77,10 +92,10 @@ bool Audio::sendMessage(AudioMsg* m, bool doUndo)
void Audio::msgRemoveRoute(Route src, Route dst)
{
msgRemoveRoute1(src, dst);
- //if (!checkAudioDevice()) return;
+ //if (!MusEGlobal::checkAudioDevice()) return;
if (src.type == Route::JACK_ROUTE)
{
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
//if(dst.type == Route::JACK_MIDI_ROUTE)
if(dst.type == Route::MIDI_DEVICE_ROUTE)
@@ -105,7 +120,7 @@ void Audio::msgRemoveRoute(Route src, Route dst)
}
else if (dst.type == Route::JACK_ROUTE)
{
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
//if(src.type == Route::JACK_MIDI_ROUTE)
if(src.type == Route::MIDI_DEVICE_ROUTE)
@@ -154,10 +169,10 @@ void Audio::msgRemoveRoutes(Route src, Route dst)
// TODO
/*
- //if (!checkAudioDevice()) return;
+ //if (!MusEGlobal::checkAudioDevice()) return;
if (src.type == Route::JACK_ROUTE)
{
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
//if(dst.type == Route::JACK_MIDI_ROUTE)
if(dst.type == Route::MIDI_DEVICE_ROUTE)
@@ -182,7 +197,7 @@ void Audio::msgRemoveRoutes(Route src, Route dst)
}
else if (dst.type == Route::JACK_ROUTE)
{
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
//if(src.type == Route::JACK_MIDI_ROUTE)
if(src.type == Route::MIDI_DEVICE_ROUTE)
@@ -231,7 +246,7 @@ void Audio::msgAddRoute(Route src, Route dst)
{
if (src.type == Route::JACK_ROUTE)
{
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
if (isRunning())
{
//if(dst.type == Route::JACK_MIDI_ROUTE)
@@ -258,7 +273,7 @@ void Audio::msgAddRoute(Route src, Route dst)
}
else if (dst.type == Route::JACK_ROUTE)
{
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
if (audio->isRunning())
{
//if(src.type == Route::JACK_MIDI_ROUTE)
@@ -326,6 +341,7 @@ void Audio::msgSetRecord(AudioTrack* node, bool val)
sendMsg(&msg);
}
+/*
//---------------------------------------------------------
// msgSetVolume
//---------------------------------------------------------
@@ -355,6 +371,7 @@ void Audio::msgSetPan(AudioTrack* node, double val)
//muse->arranger->controllerChanged(node);
song->controllerChange(node);
}
+*/
//---------------------------------------------------------
// msgSetPrefader
@@ -384,7 +401,7 @@ void Audio::msgSetChannels(AudioTrack* node, int n)
{
if (node->type() == Track::AUDIO_INPUT)
{
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
AudioInput* ai = (AudioInput*)node;
for (int i = 0; i < mc; ++i)
{
@@ -414,7 +431,7 @@ void Audio::msgSetChannels(AudioTrack* node, int n)
}
else if (node->type() == Track::AUDIO_OUTPUT)
{
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
AudioOutput* ao = (AudioOutput*)node;
for (int i = 0; i < mc; ++i)
{
@@ -498,6 +515,7 @@ void Audio::msgSetChannels(AudioTrack* node, int n)
sendMsg(&msg);
}
+/*
//---------------------------------------------------------
// msgSetPluginCtrlVal
//---------------------------------------------------------
@@ -517,6 +535,7 @@ void Audio::msgSetPluginCtrlVal(AudioTrack* track, int param, double val)
//muse->arranger->controllerChanged(track);
song->controllerChange(track);
}
+*/
//---------------------------------------------------------
// msgSwapControllerIDX
@@ -683,7 +702,7 @@ void Audio::msgSetSegSize(int bs, int sr)
void Audio::msgSeek(const Pos& pos)
{
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
//audioDevice->seekTransport(pos.frame());
// p3.3.23
//printf("Audio::msgSeek before audioDevice->seekTransport frame:%d\n", pos.frame());
@@ -1310,7 +1329,7 @@ void Audio::msgSetSendMetronome(AudioTrack* track, bool b)
void Audio::msgBounce()
{
_bounce = true;
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
//audioDevice->seekTransport(song->lPos().frame());
audioDevice->seekTransport(song->lPos());
}
diff --git a/muse2/muse/shortcuts.cpp b/muse2/muse/shortcuts.cpp
index 94790190..285bf8bc 100644
--- a/muse2/muse/shortcuts.cpp
+++ b/muse2/muse/shortcuts.cpp
@@ -1,14 +1,37 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/shortcuts.cpp $
//
-// C++ Implementation: shortcuts
-//
-// Description:
-// Definition of shortcuts used in the application
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// Author: Mathias Lundgren <lunar_shuttle@users.sourceforge.net>, (C) 2003
//
// Copyright: Mathias Lundgren (lunar_shuttle@users.sourceforge.net) (C) 2003
//
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
+//
+// C++ Implementation: shortcuts
+//
+// Description:
+// Definition of shortcuts used in the application
+//
+
#include "shortcuts.h"
#include <QTranslator>
#include <QKeySequence>
diff --git a/muse2/muse/shortcuts.h b/muse2/muse/shortcuts.h
index 84f2daca..ededa796 100644
--- a/muse2/muse/shortcuts.h
+++ b/muse2/muse/shortcuts.h
@@ -1,14 +1,37 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/shortcuts.h $
//
-// C++ Interface: shortcuts
-//
-// Description:
-// Datastructures and declaration of shortcuts used in the application
-//
+// Copyright (C) 1999-2011 by Werner Schweer and others
// Author: Mathias Lundgren <lunar_shuttle@users.sourceforge.net>, (C) 2003
//
// Copyright: Mathias Lundgren (lunar_shuttle@users.sourceforge.net) (C) 2003
//
//
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
+//
+// C++ Interface: shortcuts
+//
+// Description:
+// Datastructures and declaration of shortcuts used in the application
+//
+
#ifndef __SHORTCUTS_H__
#define __SHORTCUTS_H__
diff --git a/muse2/muse/sig.cpp b/muse2/muse/sig.cpp
index 8bbebfae..22acf6f8 100644
--- a/muse2/muse/sig.cpp
+++ b/muse2/muse/sig.cpp
@@ -4,6 +4,21 @@
// $Id: sig.cpp,v 1.5.2.2 2009/03/09 02:05:17 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -172,7 +187,7 @@ int SigList::ticksBeat(unsigned tick) const
int SigList::ticks_beat(int n) const
{
- int m = config.division;
+ int m = MusEConfig::config.division;
switch (n) {
case 1: m <<= 2; break; // 1536
case 2: m <<= 1; break; // 768
diff --git a/muse2/muse/sig.h b/muse2/muse/sig.h
index 6a561d6e..bec1951e 100644
--- a/muse2/muse/sig.h
+++ b/muse2/muse/sig.h
@@ -4,6 +4,21 @@
// $Id: sig.h,v 1.2 2004/01/11 18:55:34 wschweer Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SIG_H__
diff --git a/muse2/muse/song.cpp b/muse2/muse/song.cpp
index e4749d19..bec5aabc 100644
--- a/muse2/muse/song.cpp
+++ b/muse2/muse/song.cpp
@@ -4,6 +4,21 @@
// $Id: song.cpp,v 1.59.2.52 2009/12/15 03:39:58 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <unistd.h>
@@ -49,7 +64,7 @@
extern void clearMidiTransforms();
extern void clearMidiInputTransforms();
-Song* song;
+Song* song = 0;
/*
//---------------------------------------------------------
@@ -177,7 +192,7 @@ Track* Song::addNewTrack(QAction* action)
if (dev==0)
{
midiSeq->msgSetMidiDevice(port, si);
- muse->changeConfig(true); // save configuration file
+ MusEGlobal::muse->changeConfig(true); // save configuration file
deselectTracks();
si->setSelected(true);
update();
@@ -451,7 +466,7 @@ bool Song::addEvent(Event& event, Part* part)
if(part->events()->find(event) != part->events()->end())
{
// This can be normal for some (redundant) operations.
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("Song::addEvent event already found in part:%s size:%zd\n", part->name().toLatin1().constData(), part->events()->size());
return false;
}
@@ -470,7 +485,7 @@ void Song::changeEvent(Event& oldEvent, Event& newEvent, Part* part)
if (i == part->events()->end()) {
// This can be normal for some (redundant) operations.
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("Song::changeEvent event not found in part:%s size:%zd\n", part->name().toLatin1().constData(), part->events()->size());
// abort();
// Removed by T356. Allow it to add the new event.
@@ -572,7 +587,7 @@ void Song::deleteEvent(Event& event, Part* part)
iEvent ev = part->events()->find(event);
if (ev == part->events()->end()) {
// This can be normal for some (redundant) operations.
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("Song::deleteEvent event not found in part:%s size:%zd\n", part->name().toLatin1().constData(), part->events()->size());
return;
}
@@ -739,7 +754,7 @@ void Song::controllerChange(Track* t)
void Song::cmdAddRecordedEvents(MidiTrack* mt, EventList* events, unsigned startTick)
{
if (events->empty()) {
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("no events recorded\n");
return;
}
@@ -789,7 +804,7 @@ void Song::cmdAddRecordedEvents(MidiTrack* mt, EventList* events, unsigned start
e = events->end();
if (startTick > endTick) {
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("no events in record area\n");
return;
}
@@ -812,7 +827,7 @@ void Song::cmdAddRecordedEvents(MidiTrack* mt, EventList* events, unsigned start
break;
}
if (ip == pl->end()) {
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("create new part for recorded events\n");
// create new part
part = new MidiPart(mt);
@@ -1079,7 +1094,7 @@ void Song::setLoop(bool f)
{
if (loopFlag != f) {
loopFlag = f;
- loopAction->setChecked(loopFlag);
+ MusEGlobal::loopAction->setChecked(loopFlag);
emit loopChanged(loopFlag);
}
}
@@ -1098,12 +1113,12 @@ void Song::clearTrackRec()
//---------------------------------------------------------
void Song::setRecord(bool f, bool autoRecEnable)
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("setRecord recordflag =%d f(record state)=%d autoRecEnable=%d\n", recordFlag, f, autoRecEnable);
- if (f && config.useProjectSaveDialog && museProject == museProjectInitPath ) { // check that there is a project stored before commencing
+ if (f && MusEConfig::config.useProjectSaveDialog && MusEGlobal::museProject == MusEGlobal::museProjectInitPath ) { // check that there is a project stored before commencing
// no project, we need to create one.
- if (!muse->saveAs())
+ if (!MusEGlobal::muse->saveAs())
return; // could not store project, won't enable record
}
if (recordFlag != f) {
@@ -1177,7 +1192,7 @@ void Song::setRecord(bool f, bool autoRecEnable)
if (audio->isPlaying() && f)
f = false;
recordFlag = f;
- recordAction->setChecked(recordFlag);
+ MusEGlobal::recordAction->setChecked(recordFlag);
emit recordChanged(recordFlag);
}
}
@@ -1191,7 +1206,7 @@ void Song::setPunchin(bool f)
{
if (punchinFlag != f) {
punchinFlag = f;
- punchinAction->setChecked(punchinFlag);
+ MusEGlobal::punchinAction->setChecked(punchinFlag);
emit punchinChanged(punchinFlag);
}
}
@@ -1205,7 +1220,7 @@ void Song::setPunchout(bool f)
{
if (punchoutFlag != f) {
punchoutFlag = f;
- punchoutAction->setChecked(punchoutFlag);
+ MusEGlobal::punchoutAction->setChecked(punchoutFlag);
emit punchoutChanged(punchoutFlag);
}
}
@@ -1258,13 +1273,13 @@ void Song::setMasterFlag(bool val)
void Song::setPlay(bool f)
{
if (extSyncFlag.value()) {
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("not allowed while using external sync");
return;
}
// only allow the user to set the button "on"
if (!f)
- playAction->setChecked(true);
+ MusEGlobal::playAction->setChecked(true);
else
audio->msgPlay(true);
}
@@ -1272,29 +1287,29 @@ void Song::setPlay(bool f)
void Song::setStop(bool f)
{
if (extSyncFlag.value()) {
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("not allowed while using external sync");
return;
}
// only allow the user to set the button "on"
if (!f)
- stopAction->setChecked(true);
+ MusEGlobal::stopAction->setChecked(true);
else
audio->msgPlay(false);
}
void Song::setStopPlay(bool f)
{
- playAction->blockSignals(true);
- stopAction->blockSignals(true);
+ MusEGlobal::playAction->blockSignals(true);
+ MusEGlobal::stopAction->blockSignals(true);
emit playChanged(f); // signal transport window
- playAction->setChecked(f);
- stopAction->setChecked(!f);
+ MusEGlobal::playAction->setChecked(f);
+ MusEGlobal::stopAction->setChecked(!f);
- stopAction->blockSignals(false);
- playAction->blockSignals(false);
+ MusEGlobal::stopAction->blockSignals(false);
+ MusEGlobal::playAction->blockSignals(false);
}
//---------------------------------------------------------
@@ -1332,20 +1347,29 @@ void Song::setPos(int idx, const Pos& val, bool sig,
// idx, sig, isSeek, adjustScrollbar);
// val.dump(0);
// printf("\n");
-
- // p3.3.23
- //printf("Song::setPos before audio->msgSeek idx:%d isSeek:%d frame:%d\n", idx, isSeek, val.frame());
- if (pos[idx] == val)
- return;
+ //printf("Song::setPos before audio->msgSeek idx:%d isSeek:%d frame:%d\n", idx, isSeek, val.frame());
+
+ // If seeking audio, ensure frame resolution CAN be kept throughout. This compares apples and oranges. Moved below. p4.0.33
+ //if (pos[idx] == val)
+ // return;
if (idx == CPOS) {
_vcpos = val;
- if (isSeek && !extSyncFlag.value()) {
+ if (isSeek && !extSyncFlag.value()) {
+ if (val == audio->pos())
+ {
+ //printf("Song::setPos seek audio->pos already == val tick:%d frame:%d\n", val.tick(), val.frame());
+ return;
+ }
audio->msgSeek(val);
- // p3.3.23
- //printf("Song::setPos after audio->msgSeek idx:%d isSeek:%d frame:%d\n", idx, isSeek, val.frame());
+ //printf("Song::setPos after audio->msgSeek idx:%d isSeek:%d frame:%d\n", idx, isSeek, val.frame());
return;
}
}
+ if (val == pos[idx])
+ {
+ //printf("Song::setPos song->pos already == val tick:%d frame:%d\n", val.tick(), val.frame());
+ return;
+ }
pos[idx] = val;
bool swap = pos[LPOS] > pos[RPOS];
if (swap) { // swap lpos/rpos if lpos > rpos
@@ -1404,7 +1428,7 @@ void Song::setPos(int idx, const Pos& val, bool sig,
void Song::forward()
{
- unsigned newPos = pos[0].tick() + config.division;
+ unsigned newPos = pos[0].tick() + MusEConfig::config.division;
audio->msgSeek(Pos(newPos, true));
}
@@ -1415,10 +1439,10 @@ void Song::forward()
void Song::rewind()
{
unsigned newPos;
- if (unsigned(config.division) > pos[0].tick())
+ if (unsigned(MusEConfig::config.division) > pos[0].tick())
newPos = 0;
else
- newPos = pos[0].tick() - config.division;
+ newPos = pos[0].tick() - MusEConfig::config.division;
audio->msgSeek(Pos(newPos, true));
}
@@ -1683,10 +1707,13 @@ void Song::beat()
}
- int tick = audio->tickPos();
+ //int tick = audio->tickPos();
if (audio->isPlaying())
- setPos(0, tick, true, false, true);
-
+ {
+ //Pos tick(audio->tickPos());
+ //setPos(0, tick, true, false, true);
+ setPos(0, audio->tickPos(), true, false, true);
+ }
// p3.3.40 Update synth native guis at the heartbeat rate.
for(ciSynthI is = _synthIs.begin(); is != _synthIs.end(); ++is)
(*is)->guiHeartBeat();
@@ -1701,14 +1728,14 @@ void Song::beat()
// filter midi remote control events
//---------------------------------------------------
- if (rcEnable && velo != 0) {
- if (pitch == rcStopNote)
+ if (MusEGlobal::rcEnable && velo != 0) {
+ if (pitch == MusEGlobal::rcStopNote)
setStop(true);
- else if (pitch == rcRecordNote)
+ else if (pitch == MusEGlobal::rcRecordNote)
setRecord(true);
- else if (pitch == rcGotoLeftMarkNote)
+ else if (pitch == MusEGlobal::rcGotoLeftMarkNote)
setPos(0, pos[LPOS].tick(), true, true, true);
- else if (pitch == rcPlayNote)
+ else if (pitch == MusEGlobal::rcPlayNote)
setPlay(true);
}
emit song->midiNote(pitch, velo);
@@ -1843,8 +1870,8 @@ void Song::endMsgCmd()
{
if (updateFlags) {
redoList->clear(); // TODO: delete elements in list
- undoAction->setEnabled(true);
- redoAction->setEnabled(false);
+ MusEGlobal::undoAction->setEnabled(true);
+ MusEGlobal::redoAction->setEnabled(false);
emit songChanged(updateFlags);
}
}
@@ -1860,8 +1887,8 @@ void Song::undo()
return;
audio->msgUndo();
doUndo3();
- redoAction->setEnabled(true);
- undoAction->setEnabled(!undoList->empty());
+ MusEGlobal::redoAction->setEnabled(true);
+ MusEGlobal::undoAction->setEnabled(!undoList->empty());
if(updateFlags && (SC_TRACK_REMOVED | SC_TRACK_INSERTED))
audio->msgUpdateSoloStates();
@@ -1880,8 +1907,8 @@ void Song::redo()
return;
audio->msgRedo();
doRedo3();
- undoAction->setEnabled(true);
- redoAction->setEnabled(!redoList->empty());
+ MusEGlobal::undoAction->setEnabled(true);
+ MusEGlobal::redoAction->setEnabled(!redoList->empty());
if(updateFlags && (SC_TRACK_REMOVED | SC_TRACK_INSERTED))
audio->msgUpdateSoloStates();
@@ -1955,6 +1982,28 @@ void Song::processMsg(AudioMsg* msg)
updateFlags = SC_EVENT_MODIFIED;
break;
+ // Moved here from MidiSeq::processMsg p4.0.34
+ case SEQM_ADD_TRACK:
+ insertTrack2(msg->track, msg->ival);
+ break;
+ case SEQM_REMOVE_TRACK:
+ //removeTrack2(msg->track);
+ cmdRemoveTrack(msg->track);
+ break;
+ case SEQM_CHANGE_TRACK:
+ changeTrack((Track*)(msg->p1), (Track*)(msg->p2));
+ break;
+ case SEQM_ADD_PART:
+ cmdAddPart((Part*)msg->p1);
+ break;
+ case SEQM_REMOVE_PART:
+ cmdRemovePart((Part*)msg->p1);
+ break;
+ case SEQM_CHANGE_PART:
+ //cmdChangePart((Part*)msg->p1, (Part*)msg->p2);
+ cmdChangePart((Part*)msg->p1, (Part*)msg->p2, msg->a, msg->b);
+ break;
+
case SEQM_ADD_TEMPO:
//printf("processMsg (SEQM_ADD_TEMPO) UndoOp::AddTempo. adding tempo at: %d with tempo=%d\n", msg->a, msg->b);
addUndo(UndoOp(UndoOp::AddTempo, msg->a, msg->b));
@@ -2090,7 +2139,7 @@ void Song::panic()
void Song::clear(bool signal, bool /*clear_all*/)
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("Song::clear\n");
bounceTrack = 0;
@@ -2212,36 +2261,36 @@ void Song::cleanupForQuit()
{
bounceTrack = 0;
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("MusE: Song::cleanupForQuit...\n");
_tracks.clear();
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting _midis\n");
_midis.clearDelete();
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting _waves\n");
_waves.clearDelete();
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting _inputs\n");
_inputs.clearDelete(); // audio input ports
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting _outputs\n");
_outputs.clearDelete(); // audio output ports
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting _groups\n");
_groups.clearDelete(); // mixer groups
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting _auxs\n");
_auxs.clearDelete(); // aux sends
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting _synthIs\n");
_synthIs.clearDelete(); // each ~SynthI() -> deactivate3() -> ~SynthIF()
@@ -2249,19 +2298,19 @@ void Song::cleanupForQuit()
AL::sigmap.clear();
keymap.clear();
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting undoList, clearing redoList\n");
undoList->clearDelete();
redoList->clear(); // Check this - Should we do a clearDelete? IIRC it was OK this way - no clearDelete in case of same items in both lists.
_markerList->clear();
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting transforms\n");
clearMidiTransforms(); // Deletes stuff.
clearMidiInputTransforms(); // Deletes stuff.
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting midiport controllers\n");
// Clear all midi port controllers and values.
for(int i = 0; i < MIDI_PORTS; ++i)
@@ -2270,7 +2319,7 @@ void Song::cleanupForQuit()
// Can't do this here. Jack isn't running. Fixed. Test OK so far.
#if 1
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting midi devices except synths\n");
for(iMidiDevice imd = midiDevices.begin(); imd != midiDevices.end(); ++imd)
{
@@ -2282,7 +2331,7 @@ void Song::cleanupForQuit()
midiDevices.clear(); // midi devices
#endif
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting global available synths\n");
// Delete all synths.
std::vector<Synth*>::iterator is;
@@ -2295,7 +2344,7 @@ void Song::cleanupForQuit()
}
synthis.clear();
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("deleting midi instruments\n");
for(iMidiInstrument imi = midiInstruments.begin(); imi != midiInstruments.end(); ++imi)
{
@@ -2311,7 +2360,7 @@ void Song::cleanupForQuit()
// Nothing required for ladspa plugin list, and rack instances of them
// are handled by ~AudioTrack.
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("...finished cleaning up.\n");
}
@@ -2354,11 +2403,11 @@ void Song::seqSignal(int fd)
setPos(0, audio->tickPos(), true, false, true);
break;
case 'S': // shutdown audio
- muse->seqStop();
+ MusEGlobal::muse->seqStop();
{
// give the user a sensible explanation
- int btn = QMessageBox::critical( muse, tr("Jack shutdown!"),
+ int btn = QMessageBox::critical( MusEGlobal::muse, tr("Jack shutdown!"),
tr("Jack has detected a performance problem which has lead to\n"
"MusE being disconnected.\n"
"This could happen due to a number of reasons:\n"
@@ -2376,27 +2425,27 @@ void Song::seqSignal(int fd)
"click on the Restart button."), "restart", "cancel");
if (btn == 0) {
printf("restarting!\n");
- muse->seqRestart();
+ MusEGlobal::muse->seqRestart();
}
}
break;
case 'f': // start freewheel
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("Song: seqSignal: case f: setFreewheel start\n");
// Enabled by Tim. p3.3.6
- if(config.freewheelMode)
+ if(MusEConfig::config.freewheelMode)
audioDevice->setFreewheel(true);
break;
case 'F': // stop freewheel
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("Song: seqSignal: case F: setFreewheel stop\n");
// Enabled by Tim. p3.3.6
- if(config.freewheelMode)
+ if(MusEConfig::config.freewheelMode)
audioDevice->setFreewheel(false);
audio->msgPlay(false);
@@ -2518,9 +2567,18 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a
{
CtrlList *cl = icl->second;
canAdd = true;
- int frame = pos[0].frame();
- ctlval = cl->curVal();
- //ctlval = cl->value(frame); // p4.0.32
+
+ //int frame = pos[0].frame();
+ int frame = audio->pos().frame(); // Try this. p4.0.33
+
+ //printf("pos[0]:%d f:%d tickPos:%d f:%d\n", pos[0].tick(), pos[0].frame(), audio->tickPos(), Pos(audio->tickPos(), true).frame());
+
+ //ctlval = cl->curVal();
+ //AutomationType at = track->MusEGlobal::automationType();
+ //if(!MusEGlobal::automation || track->MusEGlobal::automationType() == AUTO_OFF)
+ ctlval = cl->curVal();
+ //else
+ // ctlval = cl->value(frame);
count = cl->size();
if(count)
{
@@ -2544,7 +2602,7 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a
//menu->setItemEnabled(HEADER, false);
//MenuTitleItem* title = new MenuTitleItem(tr("Automation:")); ddskrjo
//menu->insertItem(title, HEADER, HEADER); ddskrjo
- menu->addAction(new MenuTitleItem(tr("Automation:"), menu));
+ menu->addAction(new MusEWidget::MenuTitleItem(tr("Automation:"), menu));
//menu->insertSeparator(SEP1);
@@ -2576,7 +2634,7 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a
eraseRangeAction->setData(CLEAR_RANGE);
eraseRangeAction->setEnabled(canEraseRange);
- QAction* clearAction = menu->addAction(tr("clear automation"));
+ QAction* clearAction = menu->addAction(tr("clear MusEGlobal::automation"));
clearAction->setData(CLEAR_ALL_EVENTS);
clearAction->setEnabled((bool)count);
@@ -2608,7 +2666,7 @@ int Song::execAutomationCtlPopup(AudioTrack* track, const QPoint& menupos, int a
break;
case CLEAR_ALL_EVENTS:
- if(QMessageBox::question(muse, QString("Muse"),
+ if(QMessageBox::question(MusEGlobal::muse, QString("Muse"),
tr("Clear all controller events?"), tr("&Ok"), tr("&Cancel"),
QString::null, 0, 1 ) == 0)
audio->msgClearControllerEvents(track, acid);
@@ -2759,7 +2817,7 @@ int Song::execMidiAutomationCtlPopup(MidiTrack* track, MidiPart* part, const QPo
// menu->insertItem(tr("erase range"), CLEAR_RANGE, CLEAR_RANGE);
// menu->setItemEnabled(CLEAR_RANGE, canEraseRange);
-// menu->insertItem(tr("clear automation"), CLEAR_ALL_EVENTS, CLEAR_ALL_EVENTS);
+// menu->insertItem(tr("clear MusEGlobal::automation"), CLEAR_ALL_EVENTS, CLEAR_ALL_EVENTS);
// menu->setItemEnabled(CLEAR_ALL_EVENTS, (bool)count);
@@ -2836,7 +2894,7 @@ int Song::execMidiAutomationCtlPopup(MidiTrack* track, MidiPart* part, const QPo
//break;
//case CLEAR_ALL_EVENTS:
- //if(QMessageBox::question(muse, QString("Muse"),
+ //if(QMessageBox::question(MusEGlobal::muse, QString("Muse"),
// tr("Clear all controller events?"), tr("&Ok"), tr("&Cancel"),
// QString::null, 0, 1 ) == 0)
//audio->msgClearControllerEvents(track, acid);
@@ -2892,7 +2950,7 @@ void Song::processAutomationEvents()
{
// Just clear all pressed and touched flags, not rec event lists.
clearRecAutomation(false);
- if (!automation)
+ if (!MusEGlobal::automation)
return;
for(iTrack i = _tracks.begin(); i != _tracks.end(); ++i)
{
@@ -2938,7 +2996,7 @@ void Song::connectJackRoutes(AudioTrack* track, bool disconnect)
if(!disconnect)
ao->setName(ao->name());
// Now reconnect the output routes.
- if(checkAudioDevice() && audio->isRunning())
+ if(MusEGlobal::checkAudioDevice() && audio->isRunning())
{
for(int ch = 0; ch < ao->channels(); ++ch)
{
@@ -2971,7 +3029,7 @@ void Song::connectJackRoutes(AudioTrack* track, bool disconnect)
if(!disconnect)
ai->setName(ai->name());
// Now reconnect the input routes.
- if(checkAudioDevice() && audio->isRunning())
+ if(MusEGlobal::checkAudioDevice() && audio->isRunning())
{
for(int ch = 0; ch < ai->channels(); ++ch)
{
@@ -3104,7 +3162,7 @@ void Song::chooseMidiRoutes(QButton* parent, MidiTrack* track, bool dst)
// MenuTitleItem* titel = new MenuTitleItem(QString(buffer));
// pup->insertItem(titel);
-// if (!checkAudioDevice()) return;
+// if (!MusEGlobal::checkAudioDevice()) return;
// std::list<QString> ol = audioDevice->outputPorts();
// for (std::list<QString>::iterator ip = ol.begin(); ip != ol.end(); ++ip) {
// int id = pup->insertItem(*ip, (gid * 16) + i);
@@ -3135,7 +3193,7 @@ void Song::chooseMidiRoutes(QButton* parent, MidiTrack* track, bool dst)
int mdidx = n / MIDI_CHANNELS;
int ch = n % MIDI_CHANNELS;
- //if(debugMsg)
+ //if(MusEGlobal::debugMsg)
//printf("Song::chooseMidiRoutes mdidx:%d ch:%d\n", mdidx, ch);
MidiPort* mp = &midiPorts[mdidx];
@@ -3702,7 +3760,7 @@ void Song::executeScript(const char* scriptfile, PartList* parts, int quant, boo
//const char* tmp = tmpnam(NULL);
char tmp[16] = "muse-tmp-XXXXXX";
int fd = mkstemp(tmp);
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("executeScript: script input filename=%s\n",tmp);
FILE *fp = fdopen(fd , "w");
MidiPart *part = (MidiPart*)(i->second);
@@ -3737,13 +3795,13 @@ void Song::executeScript(const char* scriptfile, PartList* parts, int quant, boo
QStringList arguments;
arguments << tmp;
- QProcess *myProcess = new QProcess(muse);
+ QProcess *myProcess = new QProcess(MusEGlobal::muse);
myProcess->start(scriptfile, arguments);
myProcess->waitForFinished();
QByteArray errStr = myProcess->readAllStandardError();
if (myProcess->exitCode()) {
- QMessageBox::warning(muse, tr("MusE - external script failed"),
+ QMessageBox::warning(MusEGlobal::muse, tr("MusE - external script failed"),
tr("MusE was unable to launch the script, error message:\n ")+ QString(errStr)
);
endUndo(SC_EVENT_REMOVED);
@@ -3806,9 +3864,9 @@ void Song::populateScriptMenu(QMenu* menuPlugins, QObject* receiver)
//
// List scripts
//
- QString distScripts = museGlobalShare + "/scripts";
+ QString distScripts = MusEGlobal::museGlobalShare + "/scripts";
- QString userScripts = configPath + "/scripts";
+ QString userScripts = MusEGlobal::configPath + "/scripts";
QFileInfo distScriptsFi(distScripts);
if (distScriptsFi.isDir()) {
@@ -3861,11 +3919,11 @@ void Song::populateScriptMenu(QMenu* menuPlugins, QObject* receiver)
QString Song::getScriptPath(int id, bool isdelivered)
{
if (isdelivered) {
- QString path = museGlobalShare + "/scripts/" + deliveredScriptNames[id];
+ QString path = MusEGlobal::museGlobalShare + "/scripts/" + deliveredScriptNames[id];
return path;
}
- QString path = configPath + "/scripts/" + userScriptNames[id - deliveredScriptNames.size()];
+ QString path = MusEGlobal::configPath + "/scripts/" + userScriptNames[id - deliveredScriptNames.size()];
return path;
}
diff --git a/muse2/muse/song.h b/muse2/muse/song.h
index bb96b619..872993e5 100644
--- a/muse2/muse/song.h
+++ b/muse2/muse/song.h
@@ -4,6 +4,21 @@
// $Id: song.h,v 1.35.2.25 2009/12/15 03:39:58 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SONG_H__
diff --git a/muse2/muse/songfile.cpp b/muse2/muse/songfile.cpp
index fb279e92..6bc0f24d 100644
--- a/muse2/muse/songfile.cpp
+++ b/muse2/muse/songfile.cpp
@@ -4,6 +4,21 @@
// $Id: songfile.cpp,v 1.25.2.12 2009/11/04 15:06:07 spamatica Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <assert.h>
@@ -944,6 +959,8 @@ QFont Song::readFont(Xml& xml, const char* name)
return f;
}
+namespace MusEApp {
+
//---------------------------------------------------------
// readPart
//---------------------------------------------------------
@@ -1206,6 +1223,102 @@ void MusE::readMidiport(Xml& xml)
}
//---------------------------------------------------------
+// read
+// read song
+//---------------------------------------------------------
+
+void MusE::read(Xml& xml, bool skipConfig, bool isTemplate)
+ {
+ bool skipmode = true;
+ for (;;) {
+ if (progress)
+ progress->setValue(progress->value()+1);
+ Xml::Token token = xml.parse();
+ const QString& tag = xml.s1();
+ switch (token) {
+ case Xml::Error:
+ case Xml::End:
+ return;
+ case Xml::TagStart:
+ if (skipmode && tag == "muse")
+ skipmode = false;
+ else if (skipmode)
+ break;
+ else if (tag == "configuration")
+ if (skipConfig)
+ //xml.skip(tag);
+ readConfiguration(xml,true /* only read sequencer settings */);
+ else
+ readConfiguration(xml, false);
+ else if (tag == "song")
+ {
+ song->read(xml, isTemplate);
+ audio->msgUpdateSoloStates();
+ }
+ else if (tag == "midiport")
+ readMidiport(xml);
+ else if (tag == "Controller") { // obsolete
+ MidiController* ctrl = new MidiController;
+ ctrl->read(xml);
+ delete ctrl;
+ }
+ else if (tag == "mplugin")
+ readStatusMidiInputTransformPlugin(xml);
+ else if (tag == "toplevels")
+ readToplevels(xml);
+ else
+ xml.unknown("muse");
+ break;
+ case Xml::Attribut:
+ if (tag == "version") {
+ int major = xml.s2().section('.', 0, 0).toInt();
+ int minor = xml.s2().section('.', 1, 1).toInt();
+ xml.setVersion(major, minor);
+ }
+ break;
+ case Xml::TagEnd:
+ if (!skipmode && tag == "muse")
+ return;
+ default:
+ break;
+ }
+ }
+ }
+
+
+//---------------------------------------------------------
+// write
+// write song
+//---------------------------------------------------------
+
+void MusE::write(Xml& xml) const
+ {
+ xml.header();
+
+ int level = 0;
+ xml.tag(level++, "muse version=\"2.0\"");
+ writeConfiguration(level, xml);
+
+ writeStatusMidiInputTransformPlugins(level, xml);
+
+ song->write(level, xml);
+
+ if (!toplevels.empty()) {
+ xml.tag(level++, "toplevels");
+ for (ciToplevel i = toplevels.begin(); i != toplevels.end(); ++i) {
+ if ((*i)->isVisible())
+ (*i)->writeStatus(level, xml);
+ }
+ xml.tag(level--, "/toplevels");
+ }
+
+ xml.tag(level, "/muse");
+ }
+
+} // namespace MusEApp
+
+
+//---------------------------------------------------------
// readMarker
//---------------------------------------------------------
@@ -1224,8 +1337,8 @@ void Song::read(Xml& xml, bool isTemplate)
{
cloneList.clear();
for (;;) {
- if (muse->progress)
- muse->progress->setValue(muse->progress->value()+1);
+ if (MusEGlobal::muse->progress)
+ MusEGlobal::muse->progress->setValue(MusEGlobal::muse->progress->value()+1);
Xml::Token token;
token = xml.parse();
@@ -1267,8 +1380,8 @@ void Song::read(Xml& xml, bool isTemplate)
_follow = FollowMode(xml.parseInt());
else if (tag == "sampleRate") {
int sRate = xml.parseInt();
- if (!isTemplate && audioDevice->deviceType() != AudioDevice::DUMMY_AUDIO && sRate != sampleRate)
- QMessageBox::warning(muse,"Wrong sample rate", "The sample rate in this project and the current system setting differs, the project may not work as intended!");
+ if (!isTemplate && audioDevice->deviceType() != AudioDevice::DUMMY_AUDIO && sRate != MusEGlobal::sampleRate)
+ QMessageBox::warning(MusEGlobal::muse,"Wrong sample rate", "The sample rate in this project and the current system setting differs, the project may not work as intended!");
}
else if (tag == "tempolist") {
tempomap.read(xml);
@@ -1336,8 +1449,8 @@ void Song::read(Xml& xml, bool isTemplate)
readMarker(xml);
else if (tag == "globalPitchShift")
_globalPitchShift = xml.parseInt();
- else if (tag == "automation")
- automation = xml.parseInt();
+ else if (tag == "MusEGlobal::automation")
+ MusEGlobal::automation = xml.parseInt();
else if (tag == "cpos") {
int pos = xml.parseInt();
Pos p(pos, true);
@@ -1376,69 +1489,6 @@ void Song::read(Xml& xml, bool isTemplate)
}
//---------------------------------------------------------
-// read
-// read song
-//---------------------------------------------------------
-
-void MusE::read(Xml& xml, bool skipConfig, bool isTemplate)
- {
- bool skipmode = true;
- for (;;) {
- if (progress)
- progress->setValue(progress->value()+1);
- Xml::Token token = xml.parse();
- const QString& tag = xml.s1();
- switch (token) {
- case Xml::Error:
- case Xml::End:
- return;
- case Xml::TagStart:
- if (skipmode && tag == "muse")
- skipmode = false;
- else if (skipmode)
- break;
- else if (tag == "configuration")
- if (skipConfig)
- //xml.skip(tag);
- readConfiguration(xml,true /* only read sequencer settings */);
- else
- readConfiguration(xml, false);
- else if (tag == "song")
- {
- song->read(xml, isTemplate);
- audio->msgUpdateSoloStates();
- }
- else if (tag == "midiport")
- readMidiport(xml);
- else if (tag == "Controller") { // obsolete
- MidiController* ctrl = new MidiController;
- ctrl->read(xml);
- delete ctrl;
- }
- else if (tag == "mplugin")
- readStatusMidiInputTransformPlugin(xml);
- else if (tag == "toplevels")
- readToplevels(xml);
- else
- xml.unknown("muse");
- break;
- case Xml::Attribut:
- if (tag == "version") {
- int major = xml.s2().section('.', 0, 0).toInt();
- int minor = xml.s2().section('.', 1, 1).toInt();
- xml.setVersion(major, minor);
- }
- break;
- case Xml::TagEnd:
- if (!skipmode && tag == "muse")
- return;
- default:
- break;
- }
- }
- }
-
-//---------------------------------------------------------
// write
//---------------------------------------------------------
@@ -1447,7 +1497,7 @@ void Song::write(int level, Xml& xml) const
xml.tag(level++, "song");
xml.strTag(level, "info", songInfoStr);
xml.intTag(level, "showinfo", showSongInfo);
- xml.intTag(level, "automation", automation);
+ xml.intTag(level, "MusEGlobal::automation", MusEGlobal::automation);
xml.intTag(level, "cpos", song->cpos());
xml.intTag(level, "rpos", song->rpos());
xml.intTag(level, "lpos", song->lpos());
@@ -1464,7 +1514,7 @@ void Song::write(int level, Xml& xml) const
xml.intTag(level, "quantize", _quantize);
xml.intTag(level, "len", _len);
xml.intTag(level, "follow", _follow);
- xml.intTag(level, "sampleRate", sampleRate);
+ xml.intTag(level, "sampleRate", MusEGlobal::sampleRate);
if (_globalPitchShift)
xml.intTag(level, "globalPitchShift", _globalPitchShift);
@@ -1518,32 +1568,3 @@ void Song::write(int level, Xml& xml) const
cloneList = copyCloneList;
}
-//---------------------------------------------------------
-// write
-// write song
-//---------------------------------------------------------
-
-void MusE::write(Xml& xml) const
- {
- xml.header();
-
- int level = 0;
- xml.tag(level++, "muse version=\"2.0\"");
- writeConfiguration(level, xml);
-
- writeStatusMidiInputTransformPlugins(level, xml);
-
- song->write(level, xml);
-
- if (!toplevels.empty()) {
- xml.tag(level++, "toplevels");
- for (ciToplevel i = toplevels.begin(); i != toplevels.end(); ++i) {
- if ((*i)->isVisible())
- (*i)->writeStatus(level, xml);
- }
- xml.tag(level--, "/toplevels");
- }
-
- xml.tag(level, "/muse");
- }
-
diff --git a/muse2/muse/steprec.cpp b/muse2/muse/steprec.cpp
index 45af3930..a7a7546f 100644
--- a/muse2/muse/steprec.cpp
+++ b/muse2/muse/steprec.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// steprec.cpp
// (C) Copyright 2011 Florian Jung (flo93@users.sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "steprec.h"
@@ -44,7 +59,7 @@ void StepRec::record(Part* part, int pitch, int len, int step, int velo, bool ct
unsigned lasttick=0;
Undo operations;
- if (pitch!=rcSteprecNote)
+ if (pitch!=MusEGlobal::rcSteprecNote)
{
chord_timer->stop();
@@ -107,7 +122,7 @@ void StepRec::record(Part* part, int pitch, int len, int step, int velo, bool ct
operations.push_back(UndoOp(UndoOp::AddEvent, e, part, false, false));
lasttick=e.endTick();
- if (! (globalKeyState & Qt::ShiftModifier))
+ if (! (MusEGlobal::globalKeyState & Qt::ShiftModifier))
{
chord_timer_set_to_tick = tick + step;
chord_timer->start();
@@ -115,7 +130,7 @@ void StepRec::record(Part* part, int pitch, int len, int step, int velo, bool ct
goto steprec_record_foot; // this is actually unneccessary, but for clarity
}
- else // equals if (pitch==rcSteprecNote)
+ else // equals if (pitch==MusEGlobal::rcSteprecNote)
{
bool held_notes=false;
if (note_held_down!=NULL)
diff --git a/muse2/muse/steprec.h b/muse2/muse/steprec.h
index 02eab46c..0f8e046f 100644
--- a/muse2/muse/steprec.h
+++ b/muse2/muse/steprec.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// steprec.h
// (C) Copyright 2011 Florian Jung (flo93@users.sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __STEPREC_H__
diff --git a/muse2/muse/stringparam.cpp b/muse2/muse/stringparam.cpp
index 24e28e2f..21889945 100644
--- a/muse2/muse/stringparam.cpp
+++ b/muse2/muse/stringparam.cpp
@@ -3,11 +3,13 @@
// Linux Music Editor
// $Id: stringparam.cpp,v 1.0.0.0 2010/04/24 01:01:01 terminator356 Exp $
//
-// Copyright (C) 1999-2010 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
// String parameter module added by Tim.
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -16,7 +18,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "stringparam.h"
diff --git a/muse2/muse/stringparam.h b/muse2/muse/stringparam.h
index 0e05c987..fb004d24 100644
--- a/muse2/muse/stringparam.h
+++ b/muse2/muse/stringparam.h
@@ -3,10 +3,12 @@
// Linux Music Editor
// $Id: stringparam.h,v 1.0.0.0 2010/04/24 01:01:01 terminator356 Exp $
//
-// Copyright (C) 1999-2010 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
@@ -46,4 +48,4 @@ class StringParamMap : public std::map<std::string, std::string >
};
-#endif //__STRINGPARAM_H__ \ No newline at end of file
+#endif //__STRINGPARAM_H__
diff --git a/muse2/muse/structure.cpp b/muse2/muse/structure.cpp
index 1a741834..9665ce5e 100644
--- a/muse2/muse/structure.cpp
+++ b/muse2/muse/structure.cpp
@@ -5,6 +5,21 @@
//
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
// (C) Copyright 2011 Robert Jonsson (rj@spamatica.se)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <qmessagebox.h>
@@ -21,6 +36,7 @@
#include <set>
using std::set;
+
//---------------------------------------------------------
// adjustGlobalLists
// helper that adjusts tempo, sig, key and marker
diff --git a/muse2/muse/sync.cpp b/muse2/muse/sync.cpp
index 22117536..66055aab 100644
--- a/muse2/muse/sync.cpp
+++ b/muse2/muse/sync.cpp
@@ -4,6 +4,21 @@
// $Id: sync.cpp,v 1.6.2.12 2009/06/20 22:20:41 terminator356 Exp $
//
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
@@ -180,7 +195,7 @@ void MidiSyncInfo::setTime()
// Note: CurTime() makes a system call to gettimeofday(),
// which apparently can be slow in some cases. So I avoid calling this function
// too frequently by calling it (at the heartbeat rate) in Song::beat(). T356
- double t = curTime();
+ double t = MusEUtil::curTime();
if(_clockTrig)
{
@@ -599,12 +614,12 @@ void MidiSeq::mmcInput(int port, const unsigned char* p, int n)
break;
}
else if (p[5] == 1) {
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
MTC mtc(p[6] & 0x1f, p[7], p[8], p[9], p[10]);
int type = (p[6] >> 5) & 3;
- //int mmcPos = tempomap.frame2tick(lrint(mtc.time()*sampleRate));
- //int mmcPos = lrint(mtc.time()*sampleRate);
- int mmcPos = lrint(mtc.time(type) * sampleRate);
+ //int mmcPos = tempomap.frame2tick(lrint(mtc.time()*MusEGlobal::sampleRate));
+ //int mmcPos = lrint(mtc.time()*MusEGlobal::sampleRate);
+ int mmcPos = lrint(mtc.time(type) * MusEGlobal::sampleRate);
//Pos tp(mmcPos, true);
Pos tp(mmcPos, false);
@@ -728,7 +743,7 @@ void MidiSeq::mtcInputFull(int port, const unsigned char* p, int n)
if (p[3] != 1) {
if (p[3] != 2) { // silently ignore user bits
printf("unknown mtc msg subtype 0x%02x\n", p[3]);
- dump(p, n);
+ MusEUtil::dump(p, n);
}
return;
}
@@ -761,8 +776,8 @@ void MidiSeq::mtcInputFull(int port, const unsigned char* p, int n)
//if(extSyncFlag.value() && msync.MTCIn())
if(msync.MTCIn())
{
- //Pos tp(lrint(mtcCurTime.time() * sampleRate), false);
- Pos tp(lrint(mtcCurTime.time(type) * sampleRate), false);
+ //Pos tp(lrint(mtcCurTime.time() * MusEGlobal::sampleRate), false);
+ Pos tp(lrint(mtcCurTime.time(type) * MusEGlobal::sampleRate), false);
audioDevice->seekTransport(tp);
alignAllTicks();
}
@@ -783,7 +798,7 @@ void MidiSeq::nonRealtimeSystemSysex(int /*port*/, const unsigned char* p, int n
break;
default:
printf("unknown NRT Msg 0x%02x\n", p[3]);
- dump(p, n);
+ MusEUtil::dump(p, n);
break;
}
}
@@ -798,7 +813,7 @@ void MidiSeq::nonRealtimeSystemSysex(int /*port*/, const unsigned char* p, int n
void MidiSeq::setSongPosition(int port, int midiBeat)
{
- if (midiInputTrace)
+ if (MusEGlobal::midiInputTrace)
printf("set song position port:%d %d\n", port, midiBeat);
//midiPorts[port].syncInfo().trigMCSyncDetect();
@@ -816,13 +831,13 @@ void MidiSeq::setSongPosition(int port, int midiBeat)
if(p != port && midiPorts[p].syncInfo().MRTOut())
midiPorts[p].sendSongpos(midiBeat);
- curExtMidiSyncTick = (config.division * midiBeat) / 4;
+ curExtMidiSyncTick = (MusEConfig::config.division * midiBeat) / 4;
lastExtMidiSyncTick = curExtMidiSyncTick;
- //Pos pos((config.division * midiBeat) / 4, true);
+ //Pos pos((MusEConfig::config.division * midiBeat) / 4, true);
Pos pos(curExtMidiSyncTick, true);
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
//audioDevice->seekTransport(pos.frame());
audioDevice->seekTransport(pos);
@@ -855,8 +870,8 @@ void MidiSeq::alignAllTicks(int frameOverride)
mclock2=mclock1=0.0; // set all clock values to "in sync"
- recTick = (int) ((double(curFrame)/double(sampleRate)) *
- double(config.division * 1000000.0) / double(tempo) //prevent compiler warning: casting double to int
+ recTick = (int) ((double(curFrame)/double(MusEGlobal::sampleRate)) *
+ double(MusEConfig::config.division * 1000000.0) / double(tempo) //prevent compiler warning: casting double to int
);
songtick1 = recTick - songTickSpan;
if (songtick1 < 0)
@@ -882,10 +897,10 @@ void MidiSeq::alignAllTicks(int frameOverride)
void MidiSeq::realtimeSystemInput(int port, int c)
{
- if (midiInputTrace)
+ if (MusEGlobal::midiInputTrace)
printf("realtimeSystemInput port:%d 0x%x\n", port+1, c);
- //if (midiInputTrace && (rxSyncPort != port) && rxSyncPort != -1) {
+ //if (MusEGlobal::midiInputTrace && (rxSyncPort != port) && rxSyncPort != -1) {
// if (debugSync)
// printf("rxSyncPort configured as %d; received sync from port %d\n",
// rxSyncPort, port);
@@ -923,7 +938,7 @@ void MidiSeq::realtimeSystemInput(int port, int c)
if(port != curMidiSyncInPort)
break;
- //printf("midi clock:%f\n", curTime());
+ //printf("midi clock:%f\n", MusEUtil::curTime());
// Re-transmit clock to other devices if clock out turned on.
// Must be careful not to allow more than one clock input at a time.
@@ -951,8 +966,8 @@ void MidiSeq::realtimeSystemInput(int port, int c)
if(playStateExt)
{
lastExtMidiSyncTime = curExtMidiSyncTime;
- curExtMidiSyncTime = curTime();
- int div = config.division/24;
+ curExtMidiSyncTime = MusEUtil::curTime();
+ int div = MusEConfig::config.division/24;
midiExtSyncTicks += div;
lastExtMidiSyncTick = curExtMidiSyncTick;
curExtMidiSyncTick += div;
@@ -960,7 +975,7 @@ void MidiSeq::realtimeSystemInput(int port, int c)
//BEGIN : Original code:
/*
- double mclock0 = curTime();
+ double mclock0 = MusEUtil::curTime();
// Difference in time last 2 rounds:
double tdiff0 = mclock0 - mclock1;
double tdiff1 = mclock1 - mclock2;
@@ -987,11 +1002,11 @@ void MidiSeq::realtimeSystemInput(int port, int c)
// Compare w audio if playing:
if (playStateExt == true ) { //audio->isPlaying() state == PLAY
//BEGIN standard setup:
- recTick += config.division / 24; // The one we're syncing to
+ recTick += MusEConfig::config.division / 24; // The one we're syncing to
int tempo = tempomap.tempo(0);
unsigned curFrame = audio->pos().frame();
- double songtick = (double(curFrame)/double(sampleRate)) *
- double(config.division * 1000000.0) / double(tempo);
+ double songtick = (double(curFrame)/double(MusEGlobal::sampleRate)) *
+ double(MusEConfig::config.division * 1000000.0) / double(tempo);
double scale = double(tdiff0/averagetimediff);
double tickdiff = songtick - ((double) recTick - 24 + scale*24.0);
@@ -1002,7 +1017,7 @@ void MidiSeq::realtimeSystemInput(int port, int c)
audio->pos().mbt(&m, &b, &t);
int song_beat = b + m*4; // if the time-signature is different than 4/4, this will be wrong.
- int sync_beat = recTick/config.division;
+ int sync_beat = recTick/MusEConfig::config.division;
printf("pT=%.3f rT=%d diff=%.3f songB=%d syncB=%d scale=%.3f, curFrame=%d",
songtick, recTick, tickdiff, song_beat, sync_beat, scale, curFrame);
}
@@ -1074,7 +1089,7 @@ void MidiSeq::realtimeSystemInput(int port, int c)
//BEGIN : Using external tempo map:
/*
- double mclock0 = curTime();
+ double mclock0 = MusEUtil::curTime();
// Difference in time last 2 rounds:
double tdiff0 = mclock0 - mclock1;
double tdiff1 = mclock1 - mclock2;
@@ -1102,11 +1117,11 @@ void MidiSeq::realtimeSystemInput(int port, int c)
//if (playStateExt == true ) { //audio->isPlaying() state == PLAY
if (0) {
//BEGIN standard setup:
- recTick += config.division / 24; // The one we're syncing to
+ recTick += MusEConfig::config.division / 24; // The one we're syncing to
int tempo = tempomap.tempo(0);
//unsigned curFrame = audio->pos().frame();
- //double songtick = (double(curFrame)/double(sampleRate)) *
- // double(config.division * 1000000.0) / double(tempo);
+ //double songtick = (double(curFrame)/double(MusEGlobal::sampleRate)) *
+ // double(MusEConfig::config.division * 1000000.0) / double(tempo);
double songtick = tempomap.curTickExt(mclock0);
double scale = double(tdiff0/averagetimediff);
@@ -1118,7 +1133,7 @@ void MidiSeq::realtimeSystemInput(int port, int c)
audio->pos().mbt(&m, &b, &t);
int song_beat = b + m*4; // if the time-signature is different than 4/4, this will be wrong.
- int sync_beat = recTick/config.division;
+ int sync_beat = recTick/MusEConfig::config.division;
printf("pT=%.3f rT=%d diff=%.3f songB=%d syncB=%d scale=%.3f, curFrame=%d averagetimediff:%.3lf",
songtick, recTick, tickdiff, song_beat, sync_beat, scale, audio->pos().frame(), averagetimediff);
}
@@ -1233,10 +1248,10 @@ void MidiSeq::realtimeSystemInput(int port, int c)
if (debugSync)
printf(" start\n");
- //printf("midi start:%f\n", curTime());
+ //printf("midi start:%f\n", MusEUtil::curTime());
if (1 /* !audio->isPlaying()*/ /*state == IDLE*/) {
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
// p3.3.31
// Rew on start option.
@@ -1282,7 +1297,7 @@ void MidiSeq::realtimeSystemInput(int port, int c)
if (debugSync)
printf("realtimeSystemInput continue\n");
- //printf("continue:%f\n", curTime());
+ //printf("continue:%f\n", MusEUtil::curTime());
if (1 /* !audio->isPlaying() */ /*state == IDLE */) {
//unsigned curFrame = audio->curFrame();
@@ -1314,10 +1329,10 @@ void MidiSeq::realtimeSystemInput(int port, int c)
//playPendingFirstClock = false;
- //lastStoppedBeat = (audio->tickPos() * 4) / config.division;
- //curExtMidiSyncTick = (config.division * lastStoppedBeat) / 4;
+ //lastStoppedBeat = (audio->tickPos() * 4) / MusEConfig::config.division;
+ //curExtMidiSyncTick = (MusEConfig::config.division * lastStoppedBeat) / 4;
- //printf("stop:%f\n", curTime());
+ //printf("stop:%f\n", MusEUtil::curTime());
if (audio->isPlaying() /*state == PLAY*/) {
audio->msgPlay(false);
@@ -1331,7 +1346,7 @@ void MidiSeq::realtimeSystemInput(int port, int c)
// audio tick position to increment, reset the incrementer and force
// the transport position to what the hardware thinks is the current position.
//midiExtSyncTicks = 0;
- //Pos pos((config.division * lastStoppedBeat) / 4, true);
+ //Pos pos((MusEConfig::config.division * lastStoppedBeat) / 4, true);
//Pos pos(curExtMidiSyncTick, true);
//audioDevice->seekTransport(pos);
}
@@ -1364,7 +1379,7 @@ void MidiSeq::mtcSyncMsg(const MTC& mtc, int type, bool seekFlag)
// int tick = tempomap.time2tick(time);
//state = PLAY;
//write(sigFd, "1", 1); // say PLAY to gui
- if (!checkAudioDevice()) return;
+ if (!MusEGlobal::checkAudioDevice()) return;
if (debugSync)
printf("MidiSeq::mtcSyncMsg starting transport.\n");
audioDevice->startTransport();
@@ -1373,7 +1388,7 @@ void MidiSeq::mtcSyncMsg(const MTC& mtc, int type, bool seekFlag)
/*if (tempoSN != tempomap.tempoSN()) {
double cpos = tempomap.tick2time(_midiTick, 0);
- samplePosStart = samplePos - lrint(cpos * sampleRate);
+ samplePosStart = samplePos - lrint(cpos * MusEGlobal::sampleRate);
rtcTickStart = rtcTick - lrint(cpos * realRtcTicks);
tempoSN = tempomap.tempoSN();
}*/
@@ -1381,7 +1396,7 @@ void MidiSeq::mtcSyncMsg(const MTC& mtc, int type, bool seekFlag)
//
// diff is the time in sec MusE is out of sync
//
- /*double diff = time - (double(samplePosStart)/double(sampleRate));
+ /*double diff = time - (double(samplePosStart)/double(MusEGlobal::sampleRate));
if (debugSync)
printf(" state %d diff %f\n", mtcState, diff);
*/
diff --git a/muse2/muse/sync.h b/muse2/muse/sync.h
index 47acece8..5d949d5f 100644
--- a/muse2/muse/sync.h
+++ b/muse2/muse/sync.h
@@ -4,6 +4,21 @@
// $Id: sync.h,v 1.1.1.1.2.2 2009/04/01 01:37:11 terminator356 Exp $
//
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SYNC_H__
diff --git a/muse2/muse/synth.cpp b/muse2/muse/synth.cpp
index f8946a9f..ae54cd15 100644
--- a/muse2/muse/synth.cpp
+++ b/muse2/muse/synth.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: synth.cpp,v 1.43.2.23 2009/12/15 03:39:58 terminator356 Exp $
// (C) Copyright 2000-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "config.h"
@@ -197,7 +212,7 @@ void* MessSynth::instantiate(const QString& instanceName)
//n.setNum(_instances);
//QString instanceName = baseName() + "-" + n;
- doSetuid();
+ MusEGlobal::doSetuid();
QByteArray ba = info.filePath().toLatin1();
const char* path = ba.constData();
@@ -206,7 +221,7 @@ void* MessSynth::instantiate(const QString& instanceName)
if (handle == 0) {
fprintf(stderr, "Synth::instantiate: dlopen(%s) failed: %s\n",
path, dlerror());
- undoSetuid();
+ MusEGlobal::undoSetuid();
return 0;
}
typedef const MESS* (*MESS_Function)();
@@ -220,18 +235,18 @@ void* MessSynth::instantiate(const QString& instanceName)
"library file \"%s\": %s.\n"
"Are you sure this is a MESS plugin file?\n",
info.filePath().toAscii().constData(), txt);
- undoSetuid();
+ MusEGlobal::undoSetuid();
return 0;
}
}
_descr = msynth();
if (_descr == 0) {
fprintf(stderr, "Synth::instantiate: no MESS descr found\n");
- undoSetuid();
+ MusEGlobal::undoSetuid();
return 0;
}
- Mess* mess = _descr->instantiate(sampleRate, muse, &museProject, instanceName.toLatin1().constData());
- undoSetuid();
+ Mess* mess = _descr->instantiate(MusEGlobal::sampleRate, MusEGlobal::muse, &MusEGlobal::museProject, instanceName.toLatin1().constData());
+ MusEGlobal::undoSetuid();
return mess;
}
@@ -308,6 +323,15 @@ bool SynthI::putEvent(const MidiPlayEvent& ev)
}
//---------------------------------------------------------
+// processMidi
+//---------------------------------------------------------
+
+void SynthI::processMidi()
+{
+ processStuckNotes();
+}
+
+//---------------------------------------------------------
// setName
//---------------------------------------------------------
@@ -508,13 +532,13 @@ void SynthI::deactivate3()
// Moved below by Tim. p3.3.14
//synthesizer->incInstances(-1);
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("SynthI::deactivate3 deleting _sif...\n");
delete _sif;
_sif = 0;
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("SynthI::deactivate3 decrementing synth instances...\n");
synthesizer->incInstances(-1);
@@ -538,6 +562,8 @@ SynthI::~SynthI()
deactivate3();
}
+namespace MusEApp {
+
//---------------------------------------------------------
// initMidiSynth
// search for software synthis and advertise
@@ -545,10 +571,10 @@ SynthI::~SynthI()
void initMidiSynth()
{
- QString s = museGlobalLib + "/synthi";
+ QString s = MusEGlobal::museGlobalLib + "/synthi";
QDir pluginDir(s, QString("*.so")); // ddskrjo
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("searching for software synthesizer in <%s>\n", s.toLatin1().constData());
if (pluginDir.exists()) {
QFileInfoList list = pluginDir.entryInfoList();
@@ -557,7 +583,7 @@ void initMidiSynth()
while(it!=list.end()) {
fi = &*it;
- //doSetuid();
+ //MusEGlobal::doSetuid();
QByteArray ba = fi->filePath().toLatin1();
const char* path = ba.constData();
@@ -566,7 +592,7 @@ void initMidiSynth()
void* handle = dlopen(path, RTLD_NOW);
if (handle == 0) {
fprintf(stderr, "initMidiSynth: MESS dlopen(%s) failed: %s\n", path, dlerror());
- //undoSetuid();
+ //MusEGlobal::undoSetuid();
//return 0;
++it;
continue;
@@ -583,7 +609,7 @@ void initMidiSynth()
"library file \"%s\": %s.\n"
"Are you sure this is a MESS plugin file?\n",
path, txt);
- //undoSetuid();
+ //MusEGlobal::undoSetuid();
//return 0;
}
#endif
@@ -594,14 +620,14 @@ void initMidiSynth()
const MESS* descr = msynth();
if (descr == 0) {
fprintf(stderr, "initMidiSynth: no MESS descr found in %s\n", path);
- //undoSetuid();
+ //MusEGlobal::undoSetuid();
//return 0;
dlclose(handle);
++it;
continue;
}
- //Mess* mess = descr->instantiate(sampleRate, muse, &museProject, instanceName.toLatin1().constData());
- //undoSetuid();
+ //Mess* mess = descr->instantiate(MusEGlobal::sampleRate, muse, &museProject, instanceName.toLatin1().constData());
+ //MusEGlobal::undoSetuid();
@@ -612,10 +638,12 @@ void initMidiSynth()
dlclose(handle);
++it;
}
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("%zd soft synth found\n", synthis.size());
}
}
+} // namespace MusEApp
+
//---------------------------------------------------------
// createSynthI
@@ -892,7 +920,7 @@ const char* MessSynthIF::getPatchName(int channel, int prog, MType type, bool dr
// populatePatchPopup
//---------------------------------------------------------
-void MessSynthIF::populatePatchPopup(PopupMenu* menu, int ch, MType, bool)
+void MessSynthIF::populatePatchPopup(MusEWidget::PopupMenu* menu, int ch, MType, bool)
{
menu->clear();
const MidiPatch* mp = _mess->getPatchInfo(ch, 0);
@@ -943,12 +971,13 @@ void SynthI::preProcessAlways()
if(off())
{
// Clear any accumulated play events.
- playEvents()->clear();
+ //playEvents()->clear();
+ _playEvents.clear();
// Eat up any fifo events.
//while(!eventFifo.isEmpty())
// eventFifo.get();
- eventFifo.clear(); // p4.0.21 Duh, clear is the same but faster AND safer, right?
- }
+ eventFifo.clear(); // Clear is the same but faster AND safer, right?
+ }
}
void MessSynthIF::preProcessAlways()
@@ -968,12 +997,15 @@ bool SynthI::getData(unsigned pos, int ports, unsigned n, float** buffer)
int p = midiPort();
MidiPort* mp = (p != -1) ? &midiPorts[p] : 0;
- MPEventList* el = playEvents();
+ //MPEventList* el = playEvents();
///iMPEvent ie = nextPlayEvent();
- iMPEvent ie = el->begin(); // p4.0.15 Tim.
+ //iMPEvent ie = el->begin(); // p4.0.15 Tim.
+ iMPEvent ie = _playEvents.begin();
+
- ie = _sif->getData(mp, el, ie, pos, ports, n, buffer);
+ //ie = _sif->getData(mp, el, ie, pos, ports, n, buffer);
+ ie = _sif->getData(mp, &_playEvents, ie, pos, ports, n, buffer);
///setNextPlayEvent(ie);
// p4.0.15 We are done with these events. Let us erase them here instead of Audio::processMidi.
@@ -982,7 +1014,8 @@ bool SynthI::getData(unsigned pos, int ports, unsigned n, float** buffer)
// being at the 'end' iterator and not being *easily* set to some new place beginning of the newer insertions.
// The way that MPEventList sorts made it difficult to predict where the iterator of the first newly inserted items was.
// The erasure in Audio::processMidi was missing some events because of that.
- el->erase(el->begin(), ie);
+ //el->erase(el->begin(), ie);
+ _playEvents.erase(_playEvents.begin(), ie);
// setNextPlayEvent(el->begin()); // Removed p4.0.15
return true;
@@ -1053,7 +1086,7 @@ iMPEvent MessSynthIF::getData(MidiPort* mp, MPEventList* el, iMPEvent i, unsigne
bool MessSynthIF::putEvent(const MidiPlayEvent& ev)
{
- if (midiOutputTrace)
+ if (MusEGlobal::midiOutputTrace)
ev.dump();
if (_mess)
return _mess->processEvent(ev);
diff --git a/muse2/muse/synth.h b/muse2/muse/synth.h
index 0c48a231..fc442027 100644
--- a/muse2/muse/synth.h
+++ b/muse2/muse/synth.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: synth.h,v 1.22.2.12 2009/12/06 10:05:00 terminator356 Exp $
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SYNTH_H__
@@ -26,7 +41,9 @@
#define SYNTH_MIDI_STATE_SAVE_VERSION 2
//class QMenu;
+namespace MusEWidget {
class PopupMenu;
+}
//class MidiEvent;
class MidiPlayEvent;
@@ -160,7 +177,7 @@ class SynthIF {
virtual const char* getPatchName(int, int, int, bool) const = 0;
virtual const char* getPatchName(int, int, MType, bool) = 0;
//virtual void populatePatchPopup(QMenu*, int, MType, bool) = 0;
- virtual void populatePatchPopup(PopupMenu*, int, MType, bool) = 0;
+ virtual void populatePatchPopup(MusEWidget::PopupMenu*, int, MType, bool) = 0;
virtual void write(int level, Xml& xml) const = 0;
virtual float getParameter(unsigned long idx) const = 0;
virtual void setParameter(unsigned long idx, float value) = 0;
@@ -245,7 +262,7 @@ class SynthI : public AudioTrack, public MidiDevice,
}
//virtual void populatePatchPopup(QMenu* m, int i, MType t, bool d) {
- virtual void populatePatchPopup(PopupMenu* m, int i, MType t, bool d) {
+ virtual void populatePatchPopup(MusEWidget::PopupMenu* m, int i, MType t, bool d) {
_sif->populatePatchPopup(m, i, t, d);
}
@@ -275,6 +292,7 @@ class SynthI : public AudioTrack, public MidiDevice,
}
bool putEvent(const MidiPlayEvent& ev);
+ virtual void processMidi();
MidiPlayEvent receiveEvent() { return _sif->receiveEvent(); }
int eventsPending() const { return _sif->eventsPending(); }
@@ -335,7 +353,7 @@ class MessSynthIF : public SynthIF {
virtual const char* getPatchName(int, int, int, bool) const { return ""; }
virtual const char* getPatchName(int, int, MType, bool);
//virtual void populatePatchPopup(QMenu*, int, MType, bool);
- virtual void populatePatchPopup(PopupMenu*, int, MType, bool);
+ virtual void populatePatchPopup(MusEWidget::PopupMenu*, int, MType, bool);
virtual void write(int level, Xml& xml) const;
virtual float getParameter(unsigned long) const { return 0.0; }
virtual void setParameter(unsigned long, float) {}
diff --git a/muse2/muse/tempo.cpp b/muse2/muse/tempo.cpp
index 1e476e45..e41e39c6 100644
--- a/muse2/muse/tempo.cpp
+++ b/muse2/muse/tempo.cpp
@@ -4,6 +4,21 @@
// $Id: tempo.cpp,v 1.7.2.7 2008/05/21 00:28:52 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -68,8 +83,8 @@ void TempoList::normalize()
for (iTEvent e = begin(); e != end(); ++e) {
e->second->frame = frame;
unsigned dtick = e->first - e->second->tick;
- double dtime = double(dtick) / (config.division * _globalTempo * 10000.0/e->second->tempo);
- frame += lrint(dtime * sampleRate);
+ double dtime = double(dtick) / (MusEConfig::config.division * _globalTempo * 10000.0/e->second->tempo);
+ frame += lrint(dtime * MusEGlobal::sampleRate);
}
}
@@ -255,13 +270,13 @@ unsigned TempoList::tick2frame(unsigned tick, int* sn) const
return 0;
}
unsigned dtick = tick - i->second->tick;
- double dtime = double(dtick) / (config.division * _globalTempo * 10000.0/ i->second->tempo);
- unsigned dframe = lrint(dtime * sampleRate);
+ double dtime = double(dtick) / (MusEConfig::config.division * _globalTempo * 10000.0/ i->second->tempo);
+ unsigned dframe = lrint(dtime * MusEGlobal::sampleRate);
f = i->second->frame + dframe;
}
else {
- double t = (double(tick) * double(_tempo)) / (double(config.division) * _globalTempo * 10000.0);
- f = lrint(t * sampleRate);
+ double t = (double(tick) * double(_tempo)) / (double(MusEConfig::config.division) * _globalTempo * 10000.0);
+ f = lrint(t * MusEGlobal::sampleRate);
}
if (sn)
*sn = _tempoSN;
@@ -298,11 +313,11 @@ unsigned TempoList::frame2tick(unsigned frame, int* sn) const
}
unsigned te = e->second->tempo;
int dframe = frame - e->second->frame;
- double dtime = double(dframe) / double(sampleRate);
- tick = e->second->tick + lrint(dtime * _globalTempo * config.division * 10000.0 / te);
+ double dtime = double(dframe) / double(MusEGlobal::sampleRate);
+ tick = e->second->tick + lrint(dtime * _globalTempo * MusEConfig::config.division * 10000.0 / te);
}
else
- tick = lrint((double(frame)/double(sampleRate)) * _globalTempo * config.division * 10000.0 / double(_tempo));
+ tick = lrint((double(frame)/double(MusEGlobal::sampleRate)) * _globalTempo * MusEConfig::config.division * 10000.0 / double(_tempo));
if (sn)
*sn = _tempoSN;
return tick;
@@ -323,8 +338,8 @@ unsigned TempoList::deltaTick2frame(unsigned tick1, unsigned tick2, int* sn) con
return 0;
}
unsigned dtick = tick1 - i->second->tick;
- double dtime = double(dtick) / (config.division * _globalTempo * 10000.0/ i->second->tempo);
- unsigned dframe = lrint(dtime * sampleRate);
+ double dtime = double(dtick) / (MusEConfig::config.division * _globalTempo * 10000.0/ i->second->tempo);
+ unsigned dframe = lrint(dtime * MusEGlobal::sampleRate);
f1 = i->second->frame + dframe;
i = upper_bound(tick2);
@@ -332,16 +347,16 @@ unsigned TempoList::deltaTick2frame(unsigned tick1, unsigned tick2, int* sn) con
return 0;
}
dtick = tick2 - i->second->tick;
- dtime = double(dtick) / (config.division * _globalTempo * 10000.0/ i->second->tempo);
- dframe = lrint(dtime * sampleRate);
+ dtime = double(dtick) / (MusEConfig::config.division * _globalTempo * 10000.0/ i->second->tempo);
+ dframe = lrint(dtime * MusEGlobal::sampleRate);
f2 = i->second->frame + dframe;
}
else {
- double t = (double(tick1) * double(_tempo)) / (double(config.division) * _globalTempo * 10000.0);
- f1 = lrint(t * sampleRate);
+ double t = (double(tick1) * double(_tempo)) / (double(MusEConfig::config.division) * _globalTempo * 10000.0);
+ f1 = lrint(t * MusEGlobal::sampleRate);
- t = (double(tick2) * double(_tempo)) / (double(config.division) * _globalTempo * 10000.0);
- f2 = lrint(t * sampleRate);
+ t = (double(tick2) * double(_tempo)) / (double(MusEConfig::config.division) * _globalTempo * 10000.0);
+ f2 = lrint(t * MusEGlobal::sampleRate);
}
if (sn)
*sn = _tempoSN;
@@ -371,8 +386,8 @@ unsigned TempoList::deltaFrame2tick(unsigned frame1, unsigned frame2, int* sn) c
}
unsigned te = e->second->tempo;
int dframe = frame1 - e->second->frame;
- double dtime = double(dframe) / double(sampleRate);
- tick1 = e->second->tick + lrint(dtime * _globalTempo * config.division * 10000.0 / te);
+ double dtime = double(dframe) / double(MusEGlobal::sampleRate);
+ tick1 = e->second->tick + lrint(dtime * _globalTempo * MusEConfig::config.division * 10000.0 / te);
for (e = begin(); e != end();) {
ciTEvent ee = e;
@@ -385,13 +400,13 @@ unsigned TempoList::deltaFrame2tick(unsigned frame1, unsigned frame2, int* sn) c
}
te = e->second->tempo;
dframe = frame2 - e->second->frame;
- dtime = double(dframe) / double(sampleRate);
- tick2 = e->second->tick + lrint(dtime * _globalTempo * config.division * 10000.0 / te);
+ dtime = double(dframe) / double(MusEGlobal::sampleRate);
+ tick2 = e->second->tick + lrint(dtime * _globalTempo * MusEConfig::config.division * 10000.0 / te);
}
else
{
- tick1 = lrint((double(frame1)/double(sampleRate)) * _globalTempo * config.division * 10000.0 / double(_tempo));
- tick2 = lrint((double(frame2)/double(sampleRate)) * _globalTempo * config.division * 10000.0 / double(_tempo));
+ tick1 = lrint((double(frame1)/double(MusEGlobal::sampleRate)) * _globalTempo * MusEConfig::config.division * 10000.0 / double(_tempo));
+ tick2 = lrint((double(frame2)/double(MusEGlobal::sampleRate)) * _globalTempo * MusEConfig::config.division * 10000.0 / double(_tempo));
}
if (sn)
*sn = _tempoSN;
diff --git a/muse2/muse/tempo.h b/muse2/muse/tempo.h
index 632d60bb..3022705b 100644
--- a/muse2/muse/tempo.h
+++ b/muse2/muse/tempo.h
@@ -4,6 +4,21 @@
// $Id: tempo.h,v 1.2.2.1 2006/09/19 19:07:09 spamatica Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TEMPO_H__
diff --git a/muse2/muse/thread.cpp b/muse2/muse/thread.cpp
index 67daf07b..ce11fba6 100644
--- a/muse2/muse/thread.cpp
+++ b/muse2/muse/thread.cpp
@@ -4,6 +4,21 @@
// $Id: thread.cpp,v 1.4.2.5 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "thread.h"
@@ -64,7 +79,7 @@ void Thread::start(int prio, void* ptr)
//if (_realTimePriority) {
- if (realTimeScheduling && _realTimePriority > 0) { // p4.0.16
+ if (MusEGlobal::realTimeScheduling && _realTimePriority > 0) { // p4.0.16
attributes = (pthread_attr_t*) malloc(sizeof(pthread_attr_t));
pthread_attr_init(attributes);
@@ -102,11 +117,11 @@ void Thread::start(int prio, void* ptr)
int rv = pthread_create(&thread, attributes, ::loop, this);
if(rv)
{
- // p4.0.16: realTimeScheduling is unreliable. It is true even in some clearly non-RT cases.
+ // p4.0.16: MusEGlobal::realTimeScheduling is unreliable. It is true even in some clearly non-RT cases.
// I cannot seem to find a reliable answer to the question of "are we RT or not".
// MusE was failing with a stock kernel because of PTHREAD_EXPLICIT_SCHED.
// So we'll just have to try again without attributes.
- if (realTimeScheduling && _realTimePriority > 0)
+ if (MusEGlobal::realTimeScheduling && _realTimePriority > 0)
rv = pthread_create(&thread, NULL, ::loop, this);
}
@@ -166,7 +181,7 @@ Thread::Thread(const char* s)
_pollWait = -1;
thread = 0;
- //if (debugMsg)
+ //if (MusEGlobal::debugMsg)
// printf("Start thread %s with priority %d\n", s, prio);
// create message channels
@@ -249,7 +264,7 @@ void Thread::loop()
{
// Changed by Tim. p3.3.17
- if (!debugMode) {
+ if (!MusEGlobal::debugMode) {
if (mlockall(MCL_CURRENT | MCL_FUTURE))
perror("WARNING: Cannot lock memory:");
}
@@ -259,7 +274,7 @@ void Thread::loop()
attributes = (pthread_attr_t*) malloc(sizeof(pthread_attr_t));
pthread_attr_init(attributes);
- if (realTimeScheduling && realTimePriority > 0) {
+ if (MusEGlobal::realTimeScheduling && realTimePriority > 0) {
doSetuid();
// if (pthread_attr_setschedpolicy(attributes, SCHED_FIFO)) {
@@ -283,7 +298,7 @@ void Thread::loop()
if (error != 0)
perror( "error set_schedparam 2:");
-// if (!debugMode) {
+// if (!MusEGlobal::debugMode) {
// if (mlockall(MCL_CURRENT|MCL_FUTURE))
// perror("WARNING: Cannot lock memory:");
// }
@@ -321,12 +336,12 @@ void Thread::loop()
}
/*
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("Thread <%s> set to %s priority %d\n",
_name, policy == SCHED_FIFO ? "SCHED_FIFO" : "SCHED_OTHER",
realTimePriority);
*/
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("Thread <%s, id %p> has %s priority %d\n",
_name, (void *)pthread_self(), policy == SCHED_FIFO ? "SCHED_FIFO" : "SCHED_OTHER",
policy == SCHED_FIFO ? _realTimePriority : 0);
@@ -340,7 +355,7 @@ void Thread::loop()
threadStart(userPtr);
while (_running) {
- if (debugMode) // DEBUG
+ if (MusEGlobal::debugMode) // DEBUG
_pollWait = 10; // ms
else
_pollWait = -1;
diff --git a/muse2/muse/thread.h b/muse2/muse/thread.h
index f9642301..3650f0ab 100644
--- a/muse2/muse/thread.h
+++ b/muse2/muse/thread.h
@@ -4,6 +4,21 @@
// $Id: thread.h,v 1.1.1.1.2.2 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __THREAD_H__
diff --git a/muse2/muse/ticksynth.cpp b/muse2/muse/ticksynth.cpp
index 90e01417..57ed6272 100644
--- a/muse2/muse/ticksynth.cpp
+++ b/muse2/muse/ticksynth.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ticksynth.cpp,v 1.8.2.7 2009/12/20 05:00:35 terminator356 Exp $
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "audio.h"
@@ -94,7 +109,7 @@ class MetronomeSynthIF : public SynthIF
virtual const char* getPatchName(int, int, int, bool) const { return ""; }
virtual const char* getPatchName(int, int, MType, bool) { return ""; }
//virtual void populatePatchPopup(QMenu*, int, MType, bool) {};
- virtual void populatePatchPopup(PopupMenu*, int, MType, bool) {};
+ virtual void populatePatchPopup(MusEWidget::PopupMenu*, int, MType, bool) {};
virtual void write(int, Xml&) const {}
virtual float getParameter(unsigned long) const { return 0.0; }
virtual void setParameter(unsigned long, float) {}
@@ -187,7 +202,7 @@ void MetronomeSynthIF::process(float** buffer, int offset, int n)
int l = std::min(n, len);
for (int i = 0; i < l; ++i)
- *d++ += *s++ * audioClickVolume;
+ *d++ += *s++ * MusEGlobal::audioClickVolume;
pos += l;
len -= l;
if (len <= 0)
diff --git a/muse2/muse/ticksynth.h b/muse2/muse/ticksynth.h
index 4f467bcd..395b6168 100644
--- a/muse2/muse/ticksynth.h
+++ b/muse2/muse/ticksynth.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ticksynth.h,v 1.1.2.3 2009/12/06 10:05:00 terminator356 Exp $
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TICKSYNTH_H__
diff --git a/muse2/muse/track.cpp b/muse2/muse/track.cpp
index eae74ccf..57c4a658 100644
--- a/muse2/muse/track.cpp
+++ b/muse2/muse/track.cpp
@@ -4,6 +4,21 @@
// $Id: track.cpp,v 1.34.2.11 2009/11/30 05:05:49 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "track.h"
@@ -140,7 +155,7 @@ int Track::y() const
yy += (*it)->height();
}
// FIXME Get this when loading a song with automation graphs showing. Benign. Likely song not fully loaded yet. p4.0.32
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("Track::y(%s): track not in tracklist\n", name().toLatin1().constData());
return -1;
}
diff --git a/muse2/muse/track.h b/muse2/muse/track.h
index de766e32..9c6aea24 100644
--- a/muse2/muse/track.h
+++ b/muse2/muse/track.h
@@ -4,6 +4,21 @@
// $Id: track.h,v 1.39.2.17 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TRACK_H__
diff --git a/muse2/muse/transport.cpp b/muse2/muse/transport.cpp
index 8eeca4c7..72415995 100644
--- a/muse2/muse/transport.cpp
+++ b/muse2/muse/transport.cpp
@@ -4,6 +4,21 @@
// $Id: transport.cpp,v 1.8.2.3 2009/07/01 10:39:42 spamatica Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QAction>
@@ -77,7 +92,7 @@ Handle::Handle(QWidget* r, QWidget* parent)
setFixedWidth(20);
setCursor(Qt::PointingHandCursor);
QPalette palette;
- palette.setColor(this->backgroundRole(), config.transportHandleColor);
+ palette.setColor(this->backgroundRole(), MusEConfig::config.transportHandleColor);
this->setPalette(palette);
setAutoFillBackground(true);
}
@@ -124,12 +139,12 @@ TempoSig::TempoSig(QWidget* parent)
f->setLineWidth(1);
// ORCAN get rid of l1 l2 last arguments (parent)?
- l1 = new DoubleLabel(120.0, 20.0, 400.0, 0);
+ l1 = new MusEWidget::DoubleLabel(120.0, 20.0, 400.0, 0);
l1->setFocusPolicy(Qt::NoFocus);
l1->setSpecialText(QString("extern"));
vb2->addWidget(l1);
- l2 = new SigLabel(4, 4, 0);
+ l2 = new MusEWidget::SigLabel(4, 4, 0);
l2->setFocusPolicy(Qt::NoFocus);
vb2->addWidget(l2);
@@ -137,7 +152,7 @@ TempoSig::TempoSig(QWidget* parent)
vb1->addWidget(f);
l3 = new QLabel(tr("Tempo/Sig"));
- l3->setFont(config.fonts[2]);
+ l3->setFont(MusEConfig::config.fonts[2]);
vb1->addWidget(l3);
l1->setBackgroundRole(QPalette::Light);
@@ -152,7 +167,7 @@ TempoSig::TempoSig(QWidget* parent)
connect(l1, SIGNAL(valueChanged(double,int)), SLOT(setTempo(double)));
///connect(l2, SIGNAL(valueChanged(int,int)), SIGNAL(sigChanged(int,int)));
connect(l2, SIGNAL(valueChanged(const AL::TimeSignature&)), SIGNAL(sigChanged(const AL::TimeSignature&)));
- connect(muse, SIGNAL(configChanged()), SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged()));
this->setLayout(vb1);
}
@@ -163,7 +178,7 @@ TempoSig::TempoSig(QWidget* parent)
void TempoSig::configChanged()
{
- l3->setFont(config.fonts[2]);
+ l3->setFont(MusEConfig::config.fonts[2]);
}
//---------------------------------------------------------
@@ -248,7 +263,7 @@ Transport::Transport(QWidget* parent, const char* name)
box1->addWidget(recMode);
l2 = new QLabel(tr("Rec Mode"));
- l2->setFont(config.fonts[2]);
+ l2->setFont(MusEConfig::config.fonts[2]);
l2->setAlignment(Qt::AlignCenter);
connect(recMode, SIGNAL(activated(int)), SLOT(setRecMode(int)));
box1->addWidget(l2);
@@ -263,7 +278,7 @@ Transport::Transport(QWidget* parent, const char* name)
box1->addWidget(cycleMode);
l3 = new QLabel(tr("Cycle Rec"));
- l3->setFont(config.fonts[2]);
+ l3->setFont(MusEConfig::config.fonts[2]);
l3->setAlignment(Qt::AlignCenter);
connect(cycleMode, SIGNAL(activated(int)), SLOT(setCycleMode(int)));
box1->addWidget(l3);
@@ -325,7 +340,7 @@ Transport::Transport(QWidget* parent, const char* name)
marken->addWidget(tl1);
l5 = new QLabel(tr("Left Mark"));
- l5->setFont(config.fonts[2]);
+ l5->setFont(MusEConfig::config.fonts[2]);
l5->setAlignment(Qt::AlignCenter);
marken->addWidget(l5);
@@ -337,7 +352,7 @@ Transport::Transport(QWidget* parent, const char* name)
tl2->setFocusPolicy(Qt::NoFocus);
l6 = new QLabel(tr("Right Mark"));
- l6->setFont(config.fonts[2]);
+ l6->setFont(MusEConfig::config.fonts[2]);
l6->setAlignment(Qt::AlignCenter);
marken->addWidget(l6);
@@ -502,7 +517,7 @@ Transport::Transport(QWidget* parent, const char* name)
connect(tempo, SIGNAL(sigChanged(const AL::TimeSignature&)), song, SLOT(setSig(const AL::TimeSignature&)));
connect(song, SIGNAL(playChanged(bool)), SLOT(setPlay(bool)));
connect(song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int)));
- connect(muse, SIGNAL(configChanged()), SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged()));
this->setLayout(hbox);
@@ -521,13 +536,13 @@ Transport::~Transport()
void Transport::configChanged()
{
- l2->setFont(config.fonts[2]);
- l3->setFont(config.fonts[2]);
- l5->setFont(config.fonts[2]);
- l6->setFont(config.fonts[2]);
+ l2->setFont(MusEConfig::config.fonts[2]);
+ l3->setFont(MusEConfig::config.fonts[2]);
+ l5->setFont(MusEConfig::config.fonts[2]);
+ l6->setFont(MusEConfig::config.fonts[2]);
QPalette pal;
- pal.setColor(lefthandle->backgroundRole(), config.transportHandleColor);
+ pal.setColor(lefthandle->backgroundRole(), MusEConfig::config.transportHandleColor);
lefthandle->setPalette(pal);
righthandle->setPalette(pal);
}
@@ -756,11 +771,11 @@ void Transport::syncChanged(bool flag)
}
else
tempo->setTempo(tempomap.tempo(song->cpos()));
- playAction->setEnabled(!flag);
- startAction->setEnabled(!flag);
- stopAction->setEnabled(!flag);
- rewindAction->setEnabled(!flag);
- forwardAction->setEnabled(!flag);
+ MusEGlobal::playAction->setEnabled(!flag);
+ MusEGlobal::startAction->setEnabled(!flag);
+ MusEGlobal::stopAction->setEnabled(!flag);
+ MusEGlobal::rewindAction->setEnabled(!flag);
+ MusEGlobal::forwardAction->setEnabled(!flag);
}
void Transport::jackSyncChanged(bool flag)
diff --git a/muse2/muse/transport.h b/muse2/muse/transport.h
index ce8dcf1b..abe1534f 100644
--- a/muse2/muse/transport.h
+++ b/muse2/muse/transport.h
@@ -4,6 +4,21 @@
// $Id: transport.h,v 1.4 2004/06/28 21:13:16 wschweer Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TRANSPORT_H__
@@ -25,8 +40,11 @@ class QLabel;
class QSlider;
class QToolButton;
+namespace MusEWidget {
class DoubleLabel;
class SigLabel;
+}
+
class Pos;
//---------------------------------------------------------
@@ -36,8 +54,8 @@ class Pos;
class TempoSig : public QWidget {
Q_OBJECT
- DoubleLabel* l1;
- SigLabel* l2;
+ MusEWidget::DoubleLabel* l1;
+ MusEWidget::SigLabel* l2;
QLabel* l3;
diff --git a/muse2/muse/undo.cpp b/muse2/muse/undo.cpp
index d13b38d7..c0191362 100644
--- a/muse2/muse/undo.cpp
+++ b/muse2/muse/undo.cpp
@@ -4,6 +4,21 @@
// $Id: undo.cpp,v 1.12.2.9 2009/05/24 21:43:44 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
///#include "sig.h"
@@ -189,7 +204,7 @@ void UndoList::clearDelete()
void Song::startUndo()
{
redoList->clear(); // added by flo93: redo must be invalidated when
- redoAction->setEnabled(false); // a new undo is started
+ MusEGlobal::redoAction->setEnabled(false); // a new undo is started
undoList->push_back(Undo());
updateFlags = 0;
@@ -252,12 +267,12 @@ bool Song::applyOperationGroup(Undo& group, bool doUndo)
if (!doUndo)
{
undoList->pop_back();
- undoAction->setEnabled(!undoList->empty());
+ MusEGlobal::undoAction->setEnabled(!undoList->empty());
}
else
{
redoList->clear(); // added by flo93: redo must be invalidated when
- redoAction->setEnabled(false); // a new undo is started
+ MusEGlobal::redoAction->setEnabled(false); // a new undo is started
}
return doUndo;
diff --git a/muse2/muse/undo.h b/muse2/muse/undo.h
index b8f69d9f..5dca82b6 100644
--- a/muse2/muse/undo.h
+++ b/muse2/muse/undo.h
@@ -4,6 +4,21 @@
// $Id: undo.h,v 1.6.2.5 2009/05/24 21:43:44 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __UNDO_H__
diff --git a/muse2/muse/value.cpp b/muse2/muse/value.cpp
index dfdbe1ad..a7e59ea4 100644
--- a/muse2/muse/value.cpp
+++ b/muse2/muse/value.cpp
@@ -4,6 +4,21 @@
// $Id: value.cpp,v 1.2 2004/02/28 14:58:21 wschweer Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "value.h"
diff --git a/muse2/muse/value.h b/muse2/muse/value.h
index e5c74b20..56efbf32 100644
--- a/muse2/muse/value.h
+++ b/muse2/muse/value.h
@@ -4,6 +4,21 @@
// $Id: value.h,v 1.1.1.1 2003/10/27 18:51:53 wschweer Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __VALUE_H__
diff --git a/muse2/muse/vst.cpp b/muse2/muse/vst.cpp
index 7bcae7f6..e0c291e3 100644
--- a/muse2/muse/vst.cpp
+++ b/muse2/muse/vst.cpp
@@ -8,6 +8,21 @@
// Torben Hohn <torbenh@informatik.uni-bremen.de>
//
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//===================================================================
#include "config.h"
diff --git a/muse2/muse/vst.h b/muse2/muse/vst.h
index bb675c22..33303277 100644
--- a/muse2/muse/vst.h
+++ b/muse2/muse/vst.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: vst.h,v 1.11.2.3 2009/11/25 09:09:44 terminator356 Exp $
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __VST_H__
diff --git a/muse2/muse/wave.cpp b/muse2/muse/wave.cpp
index 30278c84..6f97a3f0 100644
--- a/muse2/muse/wave.cpp
+++ b/muse2/muse/wave.cpp
@@ -4,6 +4,21 @@
// $Id: wave.cpp,v 1.19.2.20 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2000-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <fcntl.h>
@@ -622,12 +637,12 @@ SndFile* getWave(const QString& inName, bool readOnlyFlag)
QString name = inName;
if (QFileInfo(name).isRelative()) {
- name = museProject + QString("/") + name;
+ name = MusEGlobal::museProject + QString("/") + name;
}
else {
if (!QFile::exists(name)) {
- if (QFile::exists(museProject + QString("/") + name)) {
- name = museProject + QString("/") + name;
+ if (QFile::exists(MusEGlobal::museProject + QString("/") + name)) {
+ name = MusEGlobal::museProject + QString("/") + name;
}
}
}
@@ -792,6 +807,8 @@ void SndFile::applyUndoFile(const QString& original, const QString& tmpfile, uns
audio->msgIdle(false);
}
+namespace MusEApp {
+
//---------------------------------------------------------
// importAudio
//---------------------------------------------------------
@@ -805,11 +822,11 @@ void MusE::importWave()
"a wave track"));
return;
}
- //QString fn = getOpenFileName(lastWavePath, audioFilePattern, this,
- QString fn = getOpenFileName(lastWavePath, audio_file_pattern, this,
+ //QString fn = MusEWidget::getOpenFileName(MusEGlobal::lastWavePath, audioFilePattern, this,
+ QString fn = MusEWidget::getOpenFileName(MusEGlobal::lastWavePath, MusEGlobal::audio_file_pattern, this,
tr("Import Wave File"), 0);
if (!fn.isEmpty()) {
- lastWavePath = fn;
+ MusEGlobal::lastWavePath = fn;
importWaveToTrack(fn);
}
}
@@ -830,11 +847,11 @@ bool MusE::importWaveToTrack(QString& name, unsigned tick, Track* track)
return true;
}
int samples = f->samples();
- if ((unsigned)sampleRate !=f->samplerate()) {
+ if ((unsigned)MusEGlobal::sampleRate !=f->samplerate()) {
if(QMessageBox::question(this, tr("Import Wavefile"),
tr("This wave file has a samplerate of %1,\n"
"as opposed to current setting %2.\n"
- "Do you still want to import it?").arg(f->samplerate()).arg(sampleRate),
+ "Do you still want to import it?").arg(f->samplerate()).arg(MusEGlobal::sampleRate),
tr("&Yes"), tr("&No"),
QString::null, 0, 1 ))
{
@@ -867,6 +884,9 @@ bool MusE::importWaveToTrack(QString& name, unsigned tick, Track* track)
song->setLen(endTick);
return false;
}
+
+} // namespace MusEApp
+
#if 0
//---------------------------------------------------------
// Clip
@@ -938,7 +958,7 @@ void ClipBase::write(int level, Xml& xml) const
// waves in the project dirctory are stored
// with relative path name, others with absolute path
//
- if (path == museProject)
+ if (path == MusEGlobal::museProject)
xml.strTag(level, "file", f.name());
else
xml.strTag(level, "file", f.path());
@@ -1044,7 +1064,7 @@ int ClipList::idx(const Clip& clip) const
//void Song::cmdAddRecordedWave(WaveTrack* track, const Pos& s, const Pos& e)
void Song::cmdAddRecordedWave(WaveTrack* track, Pos s, Pos e)
{
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("cmdAddRecordedWave - loopCount = %d, punchin = %d", audio->loopCount(), punchin());
SndFile* f = track->recFile();
@@ -1076,7 +1096,7 @@ void Song::cmdAddRecordedWave(WaveTrack* track, Pos s, Pos e)
// The function which calls this function already does this immediately after. But do it here anyway.
track->setRecFile(0);
remove(st.toLatin1().constData());
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("Song::cmdAddRecordedWave: remove file %s - start=%d end=%d\n", st.toLatin1().constData(), s.tick(), e.tick());
return;
}
diff --git a/muse2/muse/wave.h b/muse2/muse/wave.h
index c2a0d38a..2f97e6c5 100644
--- a/muse2/muse/wave.h
+++ b/muse2/muse/wave.h
@@ -4,6 +4,21 @@
// $Id: wave.h,v 1.5.2.7 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 1999/2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __WAVE_H__
diff --git a/muse2/muse/waveedit/CMakeLists.txt b/muse2/muse/waveedit/CMakeLists.txt
index b6646cbb..f32eb6e1 100644
--- a/muse2/muse/waveedit/CMakeLists.txt
+++ b/muse2/muse/waveedit/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/waveedit/editgain.cpp b/muse2/muse/waveedit/editgain.cpp
index c36df603..bcb19928 100644
--- a/muse2/muse/waveedit/editgain.cpp
+++ b/muse2/muse/waveedit/editgain.cpp
@@ -1,14 +1,36 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/waveedit/editgain.cpp $
//
-// C++ Implementation: editgain
-//
-// Description:
-//
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
+//
+// C++ Implementation: editgain
+//
+// Description:
+//
+//
#include <QDialog>
diff --git a/muse2/muse/waveedit/editgain.h b/muse2/muse/waveedit/editgain.h
index 9cbc1d79..5d41c7d4 100644
--- a/muse2/muse/waveedit/editgain.h
+++ b/muse2/muse/waveedit/editgain.h
@@ -1,14 +1,36 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/waveedit/editgain.h $
//
-// C++ Interface: editgain
-//
-// Description:
-//
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
+//
+// C++ Interface: editgain
+//
+// Description:
+//
+//
#ifndef EDITGAIN_H
#define EDITGAIN_H
diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp
index e138769d..0d42ab6b 100644
--- a/muse2/muse/waveedit/waveedit.cpp
+++ b/muse2/muse/waveedit/waveedit.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: waveedit.cpp,v 1.5.2.12 2009/04/06 01:24:54 terminator356 Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QMenu>
@@ -159,15 +174,15 @@ WaveEdit::WaveEdit(PartList* pl)
tools = addToolBar(tr("Wave edit tools"));
tools->setObjectName("Wave edit tools");
- tools->addActions(undoRedo->actions());
+ tools->addActions(MusEGlobal::undoRedo->actions());
- connect(muse, SIGNAL(configChanged()), SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged()));
//--------------------------------------------------
// Transport Bar
QToolBar* transport = addToolBar(tr("transport"));
transport->setObjectName("transport");
- transport->addActions(transportAction->actions());
+ transport->addActions(MusEGlobal::transportAction->actions());
//--------------------------------------------------
// ToolBar: Solo Cursor1 Cursor2
@@ -187,10 +202,10 @@ WaveEdit::WaveEdit(PartList* pl)
tb1->addWidget(label);
label->setAlignment(Qt::AlignRight|Qt::AlignVCenter);
label->setIndent(3);
- pos1 = new PosLabel(0);
+ pos1 = new MusEWidget::PosLabel(0);
pos1->setFixedHeight(22);
tb1->addWidget(pos1);
- pos2 = new PosLabel(0);
+ pos2 = new MusEWidget::PosLabel(0);
pos2->setFixedHeight(22);
pos2->setSmpte(true);
tb1->addWidget(pos2);
@@ -210,7 +225,7 @@ WaveEdit::WaveEdit(PartList* pl)
xscale = -8000;
}
- hscroll = new ScrollScale(1, -32768, xscale, 10000, Qt::Horizontal, mainw, 0, true, 10000.0);
+ hscroll = new MusEWidget::ScrollScale(1, -32768, xscale, 10000, Qt::Horizontal, mainw, 0, true, 10000.0);
view = new WaveView(this, mainw, xscale, yscale);
wview = view; // HACK!
@@ -221,7 +236,7 @@ WaveEdit::WaveEdit(PartList* pl)
ymag->setPageStep(256);
ymag->setValue(yscale);
- time = new MTScale(&_raster, mainw, xscale, true);
+ time = new MusEWidget::MTScale(&_raster, mainw, xscale, true);
ymag->setFixedWidth(16);
connect(view, SIGNAL(mouseWheelMoved(int)), this, SLOT(moveVerticalSlider(int)));
connect(ymag, SIGNAL(valueChanged(int)), view, SLOT(setYScale(int)));
@@ -234,7 +249,7 @@ WaveEdit::WaveEdit(PartList* pl)
mainGrid->setColumnStretch(0, 100);
mainGrid->addWidget(time, 0, 0, 1, 2);
- mainGrid->addWidget(hLine(mainw), 1, 0, 1, 2);
+ mainGrid->addWidget(MusEUtil::hLine(mainw), 1, 0, 1, 2);
mainGrid->addWidget(view, 2, 0);
mainGrid->addWidget(ymag, 2, 1);
mainGrid->addWidget(hscroll, 3, 0);
@@ -287,7 +302,7 @@ void WaveEdit::initShortcuts()
void WaveEdit::configChanged()
{
- view->setBg(config.waveEditBackgroundColor);
+ view->setBg(MusEConfig::config.waveEditBackgroundColor);
selectAllAction->setShortcut(shortcuts[SHRT_SELECT_ALL].key);
selectNoneAction->setShortcut(shortcuts[SHRT_SELECT_NONE].key);
}
@@ -331,7 +346,7 @@ void WaveEdit::setTime(unsigned samplepos)
WaveEdit::~WaveEdit()
{
- // undoRedo->removeFrom(tools); // p4.0.6 Removed
+ // MusEGlobal::undoRedo->removeFrom(tools); // p4.0.6 Removed
}
//---------------------------------------------------------
@@ -355,7 +370,7 @@ void WaveEdit::readConfiguration(Xml& xml)
switch (token) {
case Xml::TagStart:
if (tag == "bgcolor")
- config.waveEditBackgroundColor = readColor(xml);
+ MusEConfig::config.waveEditBackgroundColor = readColor(xml);
else if (tag == "topwin")
TopWin::readConfiguration(WAVE, xml);
else
@@ -380,7 +395,7 @@ void WaveEdit::readConfiguration(Xml& xml)
void WaveEdit::writeConfiguration(int level, Xml& xml)
{
xml.tag(level++, "waveedit");
- xml.colorTag(level, "bgcolor", config.waveEditBackgroundColor);
+ xml.colorTag(level, "bgcolor", MusEConfig::config.waveEditBackgroundColor);
TopWin::writeConfiguration(WAVE, level,xml);
xml.tag(level, "/waveedit");
}
@@ -495,11 +510,11 @@ void WaveEdit::moveVerticalSlider(int val)
void WaveEdit::horizontalZoomIn()
{
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl < 23)
zoomlvl++;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
@@ -508,11 +523,11 @@ void WaveEdit::horizontalZoomIn()
void WaveEdit::horizontalZoomOut()
{
int mag = hscroll->mag();
- int zoomlvl = ScrollScale::getQuickZoomLevel(mag);
+ int zoomlvl = MusEWidget::ScrollScale::getQuickZoomLevel(mag);
if (zoomlvl > 1)
zoomlvl--;
- int newmag = ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
+ int newmag = MusEWidget::ScrollScale::convertQuickZoomLevelToMag(zoomlvl);
hscroll->setMag(newmag);
diff --git a/muse2/muse/waveedit/waveedit.h b/muse2/muse/waveedit/waveedit.h
index 4f040d6e..64929555 100644
--- a/muse2/muse/waveedit/waveedit.h
+++ b/muse2/muse/waveedit/waveedit.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: waveedit.h,v 1.3.2.8 2008/01/26 07:23:21 terminator356 Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __WAVE_EDIT_H__
@@ -23,11 +38,14 @@ class PartList;
class WaveView;
class ScrollScale;
class QSlider;
-class PosLabel;
class QResizeEvent;
class SNode;
class QAction;
+namespace MusEWidget {
+class PosLabel;
+}
+
//---------------------------------------------------------
// WaveEdit
//---------------------------------------------------------
@@ -40,8 +58,8 @@ class WaveEdit : public MidiEditor {
QToolBar* tools;
QToolBar* tb1;
QToolButton* solo;
- PosLabel* pos1;
- PosLabel* pos2;
+ MusEWidget::PosLabel* pos1;
+ MusEWidget::PosLabel* pos2;
QAction* selectAllAction;
QAction* selectNoneAction;
QAction* cutAction;
diff --git a/muse2/muse/waveedit/waveview.cpp b/muse2/muse/waveedit/waveview.cpp
index 236e2588..2b3ddfbf 100644
--- a/muse2/muse/waveedit/waveview.cpp
+++ b/muse2/muse/waveedit/waveview.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: waveview.cpp,v 1.10.2.16 2009/11/14 03:37:48 terminator356 Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -33,7 +48,7 @@ bool modifyWarnedYet = false;
//---------------------------------------------------------
WaveView::WaveView(MidiEditor* pr, QWidget* parent, int xscale, int yscale)
- : View(parent, xscale, 1)
+ : MusEWidget::View(parent, xscale, 1)
{
editor = pr;
setVirt(true);
@@ -713,7 +728,7 @@ void WaveView::modifySelection(int operation, unsigned startpos, unsigned stoppo
unsigned file_channels = file.channels();
QString tmpWavFile = QString::null;
- if (!getUniqueTmpfileName("tmp_musewav",".wav", tmpWavFile)) {
+ if (!MusEGlobal::getUniqueTmpfileName("tmp_musewav",".wav", tmpWavFile)) {
break;
}
@@ -819,7 +834,7 @@ void WaveView::copySelection(unsigned file_channels, float** tmpdata, unsigned l
if (copiedPart!="") {
QFile::remove(copiedPart);
}
- if (!getUniqueTmpfileName("tmp_musewav",".wav", copiedPart)) {
+ if (!MusEGlobal::getUniqueTmpfileName("tmp_musewav",".wav", copiedPart)) {
return;
}
@@ -936,7 +951,7 @@ void WaveView::editExternal(unsigned file_format, unsigned file_samplerate, unsi
{
// Create yet another tmp-file
QString exttmpFileName;
- if (!getUniqueTmpfileName("tmp_musewav",".wav", exttmpFileName)) {
+ if (!MusEGlobal::getUniqueTmpfileName("tmp_musewav",".wav", exttmpFileName)) {
printf("Could not create temp file - aborting...\n");
return;
}
@@ -954,7 +969,7 @@ void WaveView::editExternal(unsigned file_format, unsigned file_samplerate, unsi
// Forkaborkabork
int pid = fork();
if (pid == 0) {
- if (execlp(config.externalWavEditor.toLatin1().constData(), config.externalWavEditor.toLatin1().constData(), exttmpFileName.toLatin1().constData(), NULL) == -1) {
+ if (execlp(MusEConfig::config.externalWavEditor.toLatin1().constData(), MusEConfig::config.externalWavEditor.toLatin1().constData(), exttmpFileName.toLatin1().constData(), NULL) == -1) {
perror("Failed to launch external editor");
// Get out of here
diff --git a/muse2/muse/waveedit/waveview.h b/muse2/muse/waveedit/waveview.h
index 1a646af9..664fcb51 100644
--- a/muse2/muse/waveedit/waveview.h
+++ b/muse2/muse/waveedit/waveview.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: waveview.h,v 1.3.2.6 2009/02/02 21:38:01 terminator356 Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef WAVE_VIEW_H
@@ -33,7 +48,7 @@ typedef std::list<WaveEventSelection>::iterator iWaveSelection;
// WaveView
//---------------------------------------------------------
-class WaveView : public View {
+class WaveView : public MusEWidget::View {
Q_OBJECT
MidiEditor* editor;
diff --git a/muse2/muse/waveevent.cpp b/muse2/muse/waveevent.cpp
index 9f81b7e3..759e8991 100644
--- a/muse2/muse/waveevent.cpp
+++ b/muse2/muse/waveevent.cpp
@@ -4,6 +4,21 @@
// $Id: waveevent.cpp,v 1.9.2.6 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2000-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "audioconvert.h"
@@ -135,10 +150,10 @@ void WaveEventBase::write(int level, Xml& xml, const Pos& offset, bool forcePath
//
QString path = f.dirPath();
- //if (path.contains(museProject)) {
- if (!forcePath && path.contains(museProject)) {
- // extract museProject.
- QString newName = f.path().remove(museProject+"/");
+ //if (path.contains(MusEGlobal::museProject)) {
+ if (!forcePath && path.contains(MusEGlobal::museProject)) {
+ // extract MusEGlobal::museProject.
+ QString newName = f.path().remove(MusEGlobal::museProject+"/");
xml.strTag(level, "file", newName);
}
else
diff --git a/muse2/muse/waveevent.h b/muse2/muse/waveevent.h
index 4ea4918b..850be707 100644
--- a/muse2/muse/waveevent.h
+++ b/muse2/muse/waveevent.h
@@ -4,6 +4,21 @@
// $Id: waveevent.h,v 1.6.2.4 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __WAVE_EVENT_H__
diff --git a/muse2/muse/wavetrack.cpp b/muse2/muse/wavetrack.cpp
index ad02084c..efc0b274 100644
--- a/muse2/muse/wavetrack.cpp
+++ b/muse2/muse/wavetrack.cpp
@@ -4,6 +4,21 @@
// $Id: wavetrack.cpp,v 1.15.2.12 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "track.h"
@@ -101,19 +116,19 @@ void WaveTrack::fetchData(unsigned pos, unsigned samples, float** bp, bool doSee
}
}
- if(config.useDenormalBias) {
+ if(MusEConfig::config.useDenormalBias) {
// add denormal bias to outdata
for (int i = 0; i < channels(); ++i)
for (unsigned int j = 0; j < samples; ++j)
{
- bp[i][j] +=denormalBias;
+ bp[i][j] +=MusEGlobal::denormalBias;
/*
// p3.3.41
if(j & 1)
- bp[i][j] -=denormalBias;
+ bp[i][j] -=MusEGlobal::denormalBias;
else
- bp[i][j] +=denormalBias;
+ bp[i][j] +=MusEGlobal::denormalBias;
*/
}
}
@@ -204,7 +219,7 @@ Part* WaveTrack::newPart(Part*p, bool clone)
bool WaveTrack::getData(unsigned framePos, int channels, unsigned nframe, float** bp)
{
- //if(debugMsg)
+ //if(MusEGlobal::debugMsg)
// printf("WaveTrack::getData framePos:%u channels:%d nframe:%u processed?:%d\n", framePos, channels, nframe, processed());
if ((song->bounceTrack != this) && !noInRoute()) {
@@ -212,7 +227,7 @@ bool WaveTrack::getData(unsigned framePos, int channels, unsigned nframe, float*
ciRoute i = irl->begin();
if(i->track->isMidiTrack())
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("WaveTrack::getData: Error: First route is a midi track route!\n");
return false;
}
@@ -229,7 +244,7 @@ bool WaveTrack::getData(unsigned framePos, int channels, unsigned nframe, float*
{
if(i->track->isMidiTrack())
{
- if(debugMsg)
+ if(MusEGlobal::debugMsg)
printf("WaveTrack::getData: Error: Route is a midi track route!\n");
//return false;
continue;
@@ -281,7 +296,7 @@ bool WaveTrack::getData(unsigned framePos, int channels, unsigned nframe, float*
if (pos != framePos) {
printf("fifo get error expected %d, got %d\n",
framePos, pos);
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("fifo get error expected %d, got %d\n",
framePos, pos);
while (pos < framePos) {
@@ -320,7 +335,7 @@ bool WaveTrack::getData(unsigned framePos, int channels, unsigned nframe, float*
return false;
}
if (pos != framePos) {
- if (debugMsg)
+ if (MusEGlobal::debugMsg)
printf("fifo get error expected %d, got %d\n",
framePos, pos);
while (pos < framePos) {
diff --git a/muse2/muse/widgets/CMakeLists.txt b/muse2/muse/widgets/CMakeLists.txt
index 66fefa6f..4e934ad0 100644
--- a/muse2/muse/widgets/CMakeLists.txt
+++ b/muse2/muse/widgets/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
set (SubDirs
@@ -187,7 +190,7 @@ file (GLOB widgets_source_files
tb1.cpp
tempolabel.cpp
tools.cpp
- ttoolbar.cpp
+ # ttoolbar.cpp
ttoolbutton.cpp
unusedwavefiles.cpp
utils.cpp
diff --git a/muse2/muse/widgets/aboutbox_impl.cpp b/muse2/muse/widgets/aboutbox_impl.cpp
index bf370ab7..36ba299e 100644
--- a/muse2/muse/widgets/aboutbox_impl.cpp
+++ b/muse2/muse/widgets/aboutbox_impl.cpp
@@ -1,7 +1,31 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/aboutbox_impl.cpp $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#include "aboutbox_impl.h"
#include "config.h"
#include "icons.h"
+namespace MusEWidget {
+
AboutBoxImpl::AboutBoxImpl()
{
setupUi(this);
@@ -10,3 +34,5 @@ AboutBoxImpl::AboutBoxImpl()
QString svnrevision(SVNVERSION);
versionLabel->setText("Version: " + version + " (svn revision: "+ svnrevision +")");
}
+
+}
diff --git a/muse2/muse/widgets/aboutbox_impl.h b/muse2/muse/widgets/aboutbox_impl.h
index de75bfc9..3ad3cd93 100644
--- a/muse2/muse/widgets/aboutbox_impl.h
+++ b/muse2/muse/widgets/aboutbox_impl.h
@@ -1,8 +1,32 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/aboutbox_impl.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef ABOUTBOXIMPL_H
#define ABOUTBOXIMPL_H
#include "ui_aboutbox.h"
+namespace MusEWidget {
+
class AboutBoxImpl : public QDialog, public Ui::AboutBox
{
Q_OBJECT
@@ -13,4 +37,6 @@ public:
};
+}
+
#endif // ABOUTBOXIMPL_H
diff --git a/muse2/muse/widgets/action.h b/muse2/muse/widgets/action.h
index 7fa040c4..efc7c2ee 100644
--- a/muse2/muse/widgets/action.h
+++ b/muse2/muse/widgets/action.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: action.h,v 1.1.1.1.2.1 2008/01/19 13:33:46 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __ACTION_H__
@@ -10,6 +25,8 @@
#include <QAction>
+namespace MusEWidget {
+
//---------------------------------------------------------
// Action
//---------------------------------------------------------
@@ -28,6 +45,7 @@ class Action : public QAction {
int id() const { return _id; }
};
+}
#endif
diff --git a/muse2/muse/widgets/bigtime.cpp b/muse2/muse/widgets/bigtime.cpp
index b47773c8..572710e2 100644
--- a/muse2/muse/widgets/bigtime.cpp
+++ b/muse2/muse/widgets/bigtime.cpp
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/bigtime.cpp $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#include <stdio.h>
#include <limits.h>
@@ -13,6 +35,8 @@
extern int mtcType;
+namespace MusEWidget {
+
//
// the bigtime widget
// display is split into several parts to avoid flickering.
@@ -165,8 +189,8 @@ void BigTime::fmtButtonToggled(bool v)
void BigTime::configChanged()
{
- setBgColor(config.bigTimeBackgroundColor);
- setFgColor(config.bigTimeForegroundColor);
+ setBgColor(MusEConfig::config.bigTimeBackgroundColor);
+ setFgColor(MusEConfig::config.bigTimeForegroundColor);
}
//---------------------------------------------------------
@@ -208,7 +232,7 @@ bool BigTime::setString(unsigned v)
int bar, beat;
unsigned tick;
AL::sigmap.tickValues(v, &bar, &beat, &tick);
- double time = double(absFrame)/double(sampleRate);
+ double time = double(absFrame)/double(MusEGlobal::sampleRate);
//int hour = int(time) / 3600;
//int min = (int(time) / 60) % 60;
int min = int(time) / 60;
@@ -335,8 +359,8 @@ void BigTime::resizeEvent(QResizeEvent *ev)
//dwin->setFont(f);
QString fstr = QString("font-size:%1px; font-family:'Courier'; ").arg(fs); // Tim p4.0.8
dwin->setStyleSheet(fstr);
- setBgColor(config.bigTimeBackgroundColor);
- setFgColor(config.bigTimeForegroundColor);
+ setBgColor(MusEConfig::config.bigTimeBackgroundColor);
+ setFgColor(MusEConfig::config.bigTimeForegroundColor);
int digitWidth = dwin->fontMetrics().width(QString("0"));
int vspace = (ev->size().height() - (fs*2)) / 3;
@@ -446,3 +470,4 @@ void BigTime::setBgColor(QColor c)
setPalette(newpalette);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/bigtime.h b/muse2/muse/widgets/bigtime.h
index eff0ef92..636abfb3 100644
--- a/muse2/muse/widgets/bigtime.h
+++ b/muse2/muse/widgets/bigtime.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/bigtime.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef __BIGTIME_H__
#define __BIGTIME_H__
@@ -6,7 +28,11 @@
class QCheckBox;
class QLabel;
+namespace MusEApp {
class MusE;
+}
+
+namespace MusEWidget {
//---------------------------------------------------------
// BigTime
@@ -16,7 +42,7 @@ class BigTime : public QWidget {
Q_OBJECT
bool tickmode;
- MusE* seq;
+ MusEApp::MusE* seq;
bool setString(unsigned);
@@ -52,4 +78,6 @@ class BigTime : public QWidget {
BigTime(QWidget* parent);
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/canvas.cpp b/muse2/muse/widgets/canvas.cpp
index 6491b585..c498bfd1 100644
--- a/muse2/muse/widgets/canvas.cpp
+++ b/muse2/muse/widgets/canvas.cpp
@@ -4,6 +4,21 @@
// $Id: canvas.cpp,v 1.10.2.17 2009/05/03 04:14:01 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
// Additions, modifications (C) Copyright 2011 Tim E. Real (terminator356 on users DOT sourceforge DOT net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -31,6 +46,8 @@
#define ABS(x) ((x) < 0) ? -(x) : (x)
+namespace MusEWidget {
+
//---------------------------------------------------------
// Canvas
//---------------------------------------------------------
@@ -1525,3 +1542,5 @@ void Canvas::setCurrentPart(Part* part)
curPartId = curPart->sn();
curPartChanged();
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/canvas.h b/muse2/muse/widgets/canvas.h
index 99bbabee..553ef407 100644
--- a/muse2/muse/widgets/canvas.h
+++ b/muse2/muse/widgets/canvas.h
@@ -4,6 +4,21 @@
// $Id: canvas.h,v 1.3.2.8 2009/02/02 21:38:01 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
// Additions, modifications (C) Copyright 2011 Tim E. Real (terminator356 on users DOT sourceforge DOT net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CANVAS_H__
@@ -20,6 +35,8 @@
class QMenu;
+namespace MusEWidget {
+
//---------------------------------------------------------
// Canvas
//---------------------------------------------------------
@@ -180,5 +197,8 @@ class Canvas : public View {
void setCurrentPart(Part*);
void setCanvasTools(int n) { canvasTools = n; }
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/checkbox.cpp b/muse2/muse/widgets/checkbox.cpp
index 8f706361..def23730 100644
--- a/muse2/muse/widgets/checkbox.cpp
+++ b/muse2/muse/widgets/checkbox.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: checkbox.cpp,v 1.2.2.2 2006/10/29 07:54:52 terminator356 Exp $
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "checkbox.h"
#include <QMouseEvent>
+namespace MusEWidget {
+
//---------------------------------------------------------
// CheckBox
//---------------------------------------------------------
@@ -56,4 +73,4 @@ void CheckBox::mouseReleaseEvent(QMouseEvent *e)
emit checkboxReleased(_id);
}
-
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/checkbox.h b/muse2/muse/widgets/checkbox.h
index f9b58ad1..d50b31d3 100644
--- a/muse2/muse/widgets/checkbox.h
+++ b/muse2/muse/widgets/checkbox.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: checkbox.h,v 1.2.2.2 2006/10/29 07:54:52 terminator356 Exp $
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CHECKBOX_H__
@@ -10,6 +25,7 @@
#include <QCheckBox>
+namespace MusEWidget {
//---------------------------------------------------------
// CheckBox
@@ -40,5 +56,7 @@ class CheckBox : public QCheckBox {
void setId(int i) { _id = i; }
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/citem.cpp b/muse2/muse/widgets/citem.cpp
index 2974196d..1fe861a0 100644
--- a/muse2/muse/widgets/citem.cpp
+++ b/muse2/muse/widgets/citem.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: citem.cpp,v 1.2.2.3 2008/01/26 07:23:21 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "part.h"
#include "citem.h"
#include <stdio.h>
+namespace MusEWidget {
+
//---------------------------------------------------------
// CItem
//---------------------------------------------------------
@@ -91,3 +108,4 @@ void CItemList::add(CItem* item)
std::multimap<int, CItem*, std::less<int> >::insert(std::pair<const int, CItem*> (item->bbox().x(), item));
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/citem.h b/muse2/muse/widgets/citem.h
index cd77f51d..bdeca213 100644
--- a/muse2/muse/widgets/citem.h
+++ b/muse2/muse/widgets/citem.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: citem.h,v 1.2.2.1 2006/10/04 18:45:35 spamatica Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CITEM_H__
@@ -17,6 +32,8 @@
class Event;
class Part;
+namespace MusEWidget {
+
//---------------------------------------------------------
// CItem
// virtuelle Basisklasse fr alle Canvas Item's
@@ -86,5 +103,7 @@ class CItemList: public std::multimap<int, CItem*, std::less<int> > {
CItem* find(const QPoint& pos) const;
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/comboQuant.cpp b/muse2/muse/widgets/comboQuant.cpp
index 87d88fca..c455851a 100644
--- a/muse2/muse/widgets/comboQuant.cpp
+++ b/muse2/muse/widgets/comboQuant.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: comboQuant.cpp,v 1.1.1.1 2003/10/27 18:54:52 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -13,6 +28,8 @@
#include "comboQuant.h"
+namespace MusEWidget {
+
static int quantTable[] = {
1, 16, 32, 64, 128, 256, 512, 1024,
1, 24, 48, 96, 192, 384, 768, 1536,
@@ -92,3 +109,4 @@ void ComboQuant::setValue(int val)
setCurrentIndex(0);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/comboQuant.h b/muse2/muse/widgets/comboQuant.h
index 501f0a14..8e1d80ea 100644
--- a/muse2/muse/widgets/comboQuant.h
+++ b/muse2/muse/widgets/comboQuant.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: comboQuant.h,v 1.1.1.1 2003/10/27 18:54:30 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __COMBOQUANT_H__
@@ -15,6 +30,8 @@
class QWidget;
class QTableWidget;
+namespace MusEWidget {
+
//---------------------------------------------------------
// ComboQuant
//---------------------------------------------------------
@@ -35,5 +52,7 @@ class ComboQuant : public QComboBox {
void setValue(int val);
};
+}
+
#endif
diff --git a/muse2/muse/widgets/combobox.cpp b/muse2/muse/widgets/combobox.cpp
index bd78d6f2..d32685d0 100644
--- a/muse2/muse/widgets/combobox.cpp
+++ b/muse2/muse/widgets/combobox.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: combobox.cpp,v 1.4 2004/05/06 15:08:07 wschweer Exp $
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QMenu>
@@ -11,6 +26,8 @@
#include "combobox.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// ComboBox
//---------------------------------------------------------
@@ -88,3 +105,4 @@ void ComboBox::addAction(const QString& s, int id)
itemlist << id;
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/combobox.h b/muse2/muse/widgets/combobox.h
index c099b3ce..8de82989 100644
--- a/muse2/muse/widgets/combobox.h
+++ b/muse2/muse/widgets/combobox.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: combobox.h,v 1.3 2004/02/29 12:12:36 wschweer Exp $
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __COMBOBOX_H__
@@ -13,6 +28,8 @@
class QMenu;
class QSignalMapper;
+namespace MusEWidget {
+
//---------------------------------------------------------
// ComboBox
//---------------------------------------------------------
@@ -42,6 +59,8 @@ class ComboBox : public QToolButton {
void addAction(const QString& s, int id = -1);
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/comment.cpp b/muse2/muse/widgets/comment.cpp
index 36298330..99fd8487 100644
--- a/muse2/muse/widgets/comment.cpp
+++ b/muse2/muse/widgets/comment.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: comment.cpp,v 1.2 2004/02/08 18:30:00 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "comment.h"
@@ -11,6 +26,8 @@
#include <QWidget>
+namespace MusEWidget {
+
//---------------------------------------------------------
// Comment
//---------------------------------------------------------
@@ -87,3 +104,4 @@ void TrackComment::setText(const QString& s)
song->update(SC_TRACK_MODIFIED);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/comment.h b/muse2/muse/widgets/comment.h
index 0dbd953b..4fc0bd33 100644
--- a/muse2/muse/widgets/comment.h
+++ b/muse2/muse/widgets/comment.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: comment.h,v 1.2 2004/02/08 18:30:00 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __COMMENT_H__
@@ -14,6 +29,8 @@ class Xml;
class Track;
class QWidget;
+namespace MusEWidget {
+
//---------------------------------------------------------
// Comment
//---------------------------------------------------------
@@ -51,5 +68,7 @@ class TrackComment : public Comment {
TrackComment(Track*, QWidget*);
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/ctrlcombo.cpp b/muse2/muse/widgets/ctrlcombo.cpp
index 911357ee..61a7e50f 100644
--- a/muse2/muse/widgets/ctrlcombo.cpp
+++ b/muse2/muse/widgets/ctrlcombo.cpp
@@ -4,10 +4,27 @@
// $Id: ctrlcombo.cpp,v 1.1.1.1 2003/10/27 18:55:02 wschweer Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "ctrlcombo.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// CtrlComboBox
//---------------------------------------------------------
@@ -54,3 +71,4 @@ CtrlComboBox::CtrlComboBox(QWidget* parent)
insertItem(i, QString(ctxt[i]));
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/ctrlcombo.h b/muse2/muse/widgets/ctrlcombo.h
index 2feff096..dca3d91e 100644
--- a/muse2/muse/widgets/ctrlcombo.h
+++ b/muse2/muse/widgets/ctrlcombo.h
@@ -4,6 +4,21 @@
// $Id: ctrlcombo.h,v 1.1.1.1 2003/10/27 18:54:30 wschweer Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CTRLGRP_H__
@@ -11,12 +26,15 @@
#include <QComboBox>
+namespace MusEWidget {
+
class CtrlComboBox : public QComboBox {
Q_OBJECT
public:
CtrlComboBox(QWidget* parent);
};
+} // namespace MusEWidget
#endif
diff --git a/muse2/muse/widgets/dentry.cpp b/muse2/muse/widgets/dentry.cpp
index c7aa3c1b..000dec50 100644
--- a/muse2/muse/widgets/dentry.cpp
+++ b/muse2/muse/widgets/dentry.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: dentry.cpp,v 1.1.1.1.2.3 2008/08/18 00:15:26 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -20,6 +35,8 @@
#define TIMEC2 20
#define TIMER4 50
+namespace MusEWidget {
+
//---------------------------------------------------------
// Dentry
// lineedit double values
@@ -240,3 +257,4 @@ void Dentry::setValue(double v)
val = v;
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/dentry.h b/muse2/muse/widgets/dentry.h
index 21c9ff38..1e429187 100644
--- a/muse2/muse/widgets/dentry.h
+++ b/muse2/muse/widgets/dentry.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: dentry.h,v 1.1.1.1.2.3 2008/08/18 00:15:26 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __DENTRY_H__
@@ -12,6 +27,8 @@
#include "sliderbase.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// Dentry
//---------------------------------------------------------
@@ -70,4 +87,7 @@ class Dentry : public QLineEdit {
SliderBase* slider() const { return _slider; }
void setSlider(SliderBase* s) { _slider = s; }
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/didyouknow.h b/muse2/muse/widgets/didyouknow.h
index 7dbc03c5..212e9254 100644
--- a/muse2/muse/widgets/didyouknow.h
+++ b/muse2/muse/widgets/didyouknow.h
@@ -3,10 +3,11 @@
// Linux Music Editor
// $Id: didyouknow.h,v 1.0.0.0 2010/11/21 01:01:01 ogetbilo Exp $
//
-// Copyright (C) 1999-2010 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License 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
@@ -15,13 +16,14 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "ui_didyouknow.h"
class QDialog;
+namespace MusEWidget {
//---------------------------------------------------------
// DidYouKnowWidget
@@ -35,3 +37,5 @@ class DidYouKnowWidget : public QDialog, public Ui::DidYouKnow
public:
DidYouKnowWidget(QDialog *parent = 0) : QDialog(parent) { setupUi(this); }
};
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/dimap.cpp b/muse2/muse/widgets/dimap.cpp
index 1f87358c..7fff9115 100644
--- a/muse2/muse/widgets/dimap.cpp
+++ b/muse2/muse/widgets/dimap.cpp
@@ -4,17 +4,30 @@
// $Id: dimap.cpp,v 1.1.1.1 2003/10/27 18:55:11 wschweer Exp $
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
#include "dimap.h"
#include "mmath.h"
+namespace MusEWidget {
+
const double DiMap::LogMin = 1.0e-150;
const double DiMap::LogMax = 1.0e150;
@@ -100,7 +113,7 @@ DiMap::~DiMap()
bool DiMap::contains(double x) const
{
- return ( (x >= qwtMin(d_x1, d_x1)) && (x <= qwtMax(d_x1, d_x2)));
+ return ( (x >= MusEUtil::qwtMin(d_x1, d_x1)) && (x <= MusEUtil::qwtMax(d_x1, d_x2)));
}
//------------------------------------------------------------
@@ -117,7 +130,7 @@ bool DiMap::contains(double x) const
bool DiMap::contains(int x) const
{
- return ( (x >= qwtMin(d_y1, d_y1)) && (x <= qwtMax(d_y1, d_y2)));
+ return ( (x >= MusEUtil::qwtMin(d_y1, d_y1)) && (x <= MusEUtil::qwtMax(d_y1, d_y2)));
}
//------------------------------------------------------------
@@ -256,10 +269,10 @@ double DiMap::invTransform(int y) const
int DiMap::limTransform(double x) const
{
- if ( x > qwtMax(d_x1, d_x2) )
- x = qwtMax(d_x1, d_x2);
- else if ( x < qwtMin(d_x1, d_x2))
- x = qwtMin(d_x1, d_x2);
+ if ( x > MusEUtil::qwtMax(d_x1, d_x2) )
+ x = MusEUtil::qwtMax(d_x1, d_x2);
+ else if ( x < MusEUtil::qwtMin(d_x1, d_x2))
+ x = MusEUtil::qwtMin(d_x1, d_x2);
return transform(x);
}
@@ -306,3 +319,5 @@ void DiMap::newFactor()
else
d_cnv = 0.0;
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/dimap.h b/muse2/muse/widgets/dimap.h
index cf51dee2..fc522b4e 100644
--- a/muse2/muse/widgets/dimap.h
+++ b/muse2/muse/widgets/dimap.h
@@ -4,11 +4,22 @@
// $Id: dimap.h,v 1.1.1.1 2003/10/27 18:54:28 wschweer Exp $
//
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __DIMAP_H__
@@ -16,6 +27,8 @@
#include <QtGlobal>
+namespace MusEWidget {
+
class DiMap
{
double d_x1, d_x2; // double interval boundaries
@@ -52,4 +65,6 @@ class DiMap
bool logarithmic() const { return d_log;}
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/doublelabel.cpp b/muse2/muse/widgets/doublelabel.cpp
index fe2bfc6a..00d9e2fa 100644
--- a/muse2/muse/widgets/doublelabel.cpp
+++ b/muse2/muse/widgets/doublelabel.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: doublelabel.cpp,v 1.1.1.1.2.2 2008/08/18 00:15:26 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
#include "doublelabel.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// DoubleLabel
//---------------------------------------------------------
@@ -191,3 +208,5 @@ QSize DoubleLabel::minimumSizeHint() const
{
return sizeHint();
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/doublelabel.h b/muse2/muse/widgets/doublelabel.h
index b5e40597..d02546e6 100644
--- a/muse2/muse/widgets/doublelabel.h
+++ b/muse2/muse/widgets/doublelabel.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: doublelabel.h,v 1.2.2.3 2008/08/18 00:15:26 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __DOUBLELABEL_H__
@@ -10,6 +25,8 @@
#include "dentry.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// DoubleLabel
//---------------------------------------------------------
@@ -58,4 +75,6 @@ class DoubleLabel : public Dentry {
void setSuffix(const QString& s) { _suffix = s; }
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/drange.cpp b/muse2/muse/widgets/drange.cpp
index e144dfea..18868b2c 100644
--- a/muse2/muse/widgets/drange.cpp
+++ b/muse2/muse/widgets/drange.cpp
@@ -4,11 +4,22 @@
// $Id: drange.cpp,v 1.2.2.1 2009/03/09 02:05:18 terminator356 Exp $
//
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
@@ -18,6 +29,8 @@
#include "mmath.h"
#include "drange.h"
+namespace MusEWidget {
+
const double DoubleRange::MinRelStep = 1.0e-10;
const double DoubleRange::DefaultRelStep = 1.0e-2;
const double DoubleRange::MinEps = 1.0e-10;
@@ -60,8 +73,8 @@ void DoubleRange::setNewValue(double x, bool align)
{
d_prevValue = d_value;
- double vmin = qwtMin(d_minValue, d_maxValue);
- double vmax = qwtMax(d_minValue, d_maxValue);
+ double vmin = MusEUtil::qwtMin(d_minValue, d_maxValue);
+ double vmax = MusEUtil::qwtMax(d_minValue, d_maxValue);
// Range check
@@ -93,11 +106,11 @@ void DoubleRange::setNewValue(double x, bool align)
d_value = d_minValue;
// correct rounding error at the border
- if (fabs(d_value - d_maxValue) < MinEps * qwtAbs(d_step))
+ if (fabs(d_value - d_maxValue) < MinEps * MusEUtil::qwtAbs(d_step))
d_value = d_maxValue;
// correct rounding error if value = 0
- if (fabs(d_value) < MinEps * qwtAbs(d_step))
+ if (fabs(d_value) < MinEps * MusEUtil::qwtAbs(d_step))
d_value = 0.0;
}
if (d_prevValue != d_value)
@@ -166,7 +179,7 @@ void DoubleRange::setRange(double vmin, double vmax, double vstep, int pageSize)
//
// limit page size
//
- d_pageSize = qwtLim(pageSize,0, int(qwtAbs((d_maxValue - d_minValue) / d_step)));
+ d_pageSize = MusEUtil::qwtLim(pageSize,0, int(MusEUtil::qwtAbs((d_maxValue - d_minValue) / d_step)));
//
// If the value lies out of the range, it
@@ -260,6 +273,7 @@ void DoubleRange::incPages(int nPages)
double DoubleRange::step() const
{
- return qwtAbs(d_step);
+ return MusEUtil::qwtAbs(d_step);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/drange.h b/muse2/muse/widgets/drange.h
index d0931e86..938b70c6 100644
--- a/muse2/muse/widgets/drange.h
+++ b/muse2/muse/widgets/drange.h
@@ -4,16 +4,29 @@
// $Id: drange.h,v 1.1.1.1.2.1 2007/01/27 14:52:43 spamatica Exp $
//
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __DOUBLE_RANGE_H__
#define __DOUBLE_RANGE_H__
+namespace MusEWidget {
+
//---------------------------------------------------------
// DoubleRange
//---------------------------------------------------------
@@ -66,4 +79,6 @@ class DoubleRange
double step() const;
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/editnotedialogbase.ui b/muse2/muse/widgets/editnotedialogbase.ui
index b19efc49..165bdf02 100644
--- a/muse2/muse/widgets/editnotedialogbase.ui
+++ b/muse2/muse/widgets/editnotedialogbase.ui
@@ -156,7 +156,7 @@
</widget>
</item>
<item row="2" column="1">
- <widget class="PitchEdit" name="pl" native="true"/>
+ <widget class="MusEWidget::PitchEdit" name="pl" native="true"/>
</item>
</layout>
</widget>
@@ -169,7 +169,7 @@
<container>0</container>
</customwidget>
<customwidget>
- <class>PitchEdit</class>
+ <class>MusEWidget::PitchEdit</class>
<extends>QWidget</extends>
<header>pitchedit.h</header>
</customwidget>
diff --git a/muse2/muse/widgets/filedialog.cpp b/muse2/muse/widgets/filedialog.cpp
index fc19a058..0df0fa7f 100644
--- a/muse2/muse/widgets/filedialog.cpp
+++ b/muse2/muse/widgets/filedialog.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: filedialog.cpp,v 1.3.2.3 2005/06/19 06:32:07 lunar_shuttle Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <errno.h>
@@ -19,6 +34,8 @@
#include "../globals.h"
#include "gconfig.h"
+namespace MusEWidget {
+
MFileDialog::ViewType MFileDialog::lastViewUsed = GLOBAL_VIEW;
//QString MFileDialog::lastUserDir = "";
//QString MFileDialog::lastGlobalDir = "";
@@ -87,7 +104,7 @@ void MFileDialog::globalToggled(bool flag)
buttons.userButton->setChecked(!flag);
buttons.projectButton->setChecked(!flag);
if (lastGlobalDir.isEmpty())
- lastGlobalDir = museGlobalShare + QString("/") + baseDir; // Initialize if first time
+ lastGlobalDir = MusEGlobal::museGlobalShare + QString("/") + baseDir; // Initialize if first time
QString dir = lastGlobalDir;
setDirectory(dir);
lastViewUsed = GLOBAL_VIEW;
@@ -106,11 +123,11 @@ void MFileDialog::userToggled(bool flag)
if (lastUserDir.isEmpty()) {
- lastUserDir = museUser + QString("/") + baseDir; // Initialize if first time
+ lastUserDir = MusEGlobal::museUser + QString("/") + baseDir; // Initialize if first time
}
if (testDirCreate(this, lastUserDir))
- setDirectory(museUser);
+ setDirectory(MusEGlobal::museUser);
else
setDirectory(lastUserDir);
@@ -129,17 +146,17 @@ void MFileDialog::projectToggled(bool flag)
buttons.userButton->setChecked(!flag);
QString s;
- if (museProject == museProjectInitPath ) {
+ if (MusEGlobal::museProject == MusEGlobal::museProjectInitPath ) {
// if project path is uninitialized, meaning it is still set to museProjectInitPath.
// then project path is set to current pwd instead.
//s = QString(getcwd(0,0)) + QString("/");
- s = config.projectBaseFolder;
+ s = MusEConfig::config.projectBaseFolder;
}
else
- s = museProject + QString("/"); // + baseDir;
+ s = MusEGlobal::museProject + QString("/"); // + baseDir;
if (testDirCreate(this, s))
- setDirectory(museProject);
+ setDirectory(MusEGlobal::museProject);
else
setDirectory(s);
lastViewUsed = PROJECT_VIEW;
@@ -548,3 +565,4 @@ FILE* MFile::open(const char* mode, const QStringList& pattern,
return f;
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/filedialog.h b/muse2/muse/widgets/filedialog.h
index 6aaf091c..74297210 100644
--- a/muse2/muse/widgets/filedialog.h
+++ b/muse2/muse/widgets/filedialog.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: filedialog.h,v 1.2.2.2 2008/01/19 13:33:46 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QFileDialog>
@@ -11,6 +26,8 @@
class QStringList;
+namespace MusEWidget {
+
//---------------------------------------------------------
// FileDialogButtonsWidget
// Wrapper around Ui::FileDialogButtons
@@ -108,3 +125,4 @@ class MFile {
bool warnIfOverwrite, const QString& caption);
};
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/function_dialogs/CMakeLists.txt b/muse2/muse/widgets/function_dialogs/CMakeLists.txt
index db1f3229..5b9fc328 100644
--- a/muse2/muse/widgets/function_dialogs/CMakeLists.txt
+++ b/muse2/muse/widgets/function_dialogs/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/muse/widgets/function_dialogs/crescendo.cpp b/muse2/muse/widgets/function_dialogs/crescendo.cpp
index ef31c5ef..f8245b24 100644
--- a/muse2/muse/widgets/function_dialogs/crescendo.cpp
+++ b/muse2/muse/widgets/function_dialogs/crescendo.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: crescendo.cpp,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QButtonGroup>
#include "crescendo.h"
#include "xml.h"
+namespace MusEDialog {
+
Crescendo::Crescendo(QWidget* parent)
: QDialog(parent)
{
@@ -110,3 +127,5 @@ void Crescendo::absolute_changed(bool val)
end_spinbox->setSuffix(" %");
}
}
+
+} // namespace MusEDialog
diff --git a/muse2/muse/widgets/function_dialogs/crescendo.h b/muse2/muse/widgets/function_dialogs/crescendo.h
index 73a7e088..c0871ab8 100644
--- a/muse2/muse/widgets/function_dialogs/crescendo.h
+++ b/muse2/muse/widgets/function_dialogs/crescendo.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: crescendo.h,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __CRESCENDO_H__
@@ -13,6 +28,8 @@
class QButtonGroup;
class Xml;
+namespace MusEDialog {
+
class Crescendo : public QDialog, public Ui::CrescendoBase
{
Q_OBJECT
@@ -43,5 +60,7 @@ class Crescendo : public QDialog, public Ui::CrescendoBase
void absolute_changed(bool);
};
+} // namespace MusEDialog
+
#endif
diff --git a/muse2/muse/widgets/function_dialogs/deloverlaps.cpp b/muse2/muse/widgets/function_dialogs/deloverlaps.cpp
index 76103d74..0841b6e9 100644
--- a/muse2/muse/widgets/function_dialogs/deloverlaps.cpp
+++ b/muse2/muse/widgets/function_dialogs/deloverlaps.cpp
@@ -3,12 +3,28 @@
// Linux Music Editor
// $Id: deloverlaps.cpp,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QButtonGroup>
#include "deloverlaps.h"
#include "xml.h"
+namespace MusEDialog {
DelOverlaps::DelOverlaps(QWidget* parent)
: QDialog(parent)
@@ -77,3 +93,5 @@ void DelOverlaps::write_configuration(int level, Xml& xml)
xml.intTag(level, "range", range);
xml.tag(level, "/del_overlaps");
}
+
+} // namespace MusEDialog
diff --git a/muse2/muse/widgets/function_dialogs/deloverlaps.h b/muse2/muse/widgets/function_dialogs/deloverlaps.h
index d151d5a5..2fc470cd 100644
--- a/muse2/muse/widgets/function_dialogs/deloverlaps.h
+++ b/muse2/muse/widgets/function_dialogs/deloverlaps.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: deloverlaps.h,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __DELOVERLAPS_H__
@@ -13,6 +28,8 @@
class QButtonGroup;
class Xml;
+namespace MusEDialog {
+
class DelOverlaps : public QDialog, public Ui::DelOverlapsBase
{
Q_OBJECT
@@ -36,5 +53,7 @@ class DelOverlaps : public QDialog, public Ui::DelOverlapsBase
int exec();
};
+} // namespace MusEDialog
+
#endif
diff --git a/muse2/muse/widgets/function_dialogs/gatetime.cpp b/muse2/muse/widgets/function_dialogs/gatetime.cpp
index 9448ab1c..537260ca 100644
--- a/muse2/muse/widgets/function_dialogs/gatetime.cpp
+++ b/muse2/muse/widgets/function_dialogs/gatetime.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: gatetime.cpp,v 1.1.1.1 2003/10/27 18:54:37 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QButtonGroup>
@@ -13,6 +28,8 @@
#include "xml.h"
#include "song.h"
+namespace MusEDialog {
+
//---------------------------------------------------------
// GateTime
//---------------------------------------------------------
@@ -106,3 +123,5 @@ void GateTime::write_configuration(int level, Xml& xml)
xml.intTag(level, "rate", rateVal);
xml.tag(level, "/mod_len");
}
+
+} // namespace MusEDialog
diff --git a/muse2/muse/widgets/function_dialogs/gatetime.h b/muse2/muse/widgets/function_dialogs/gatetime.h
index baa5a97b..20d28948 100644
--- a/muse2/muse/widgets/function_dialogs/gatetime.h
+++ b/muse2/muse/widgets/function_dialogs/gatetime.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: gatetime.h,v 1.1.1.1.2.1 2008/01/19 13:33:47 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __GATETIME_H__
@@ -13,6 +28,8 @@
class QButtonGroup;
class Xml;
+namespace MusEDialog {
+
//---------------------------------------------------------
// GateTime
//---------------------------------------------------------
@@ -42,5 +59,7 @@ class GateTime : public QDialog, public Ui::GateTimeBase {
int exec();
};
+} // namespace MusEDialog
+
#endif
diff --git a/muse2/muse/widgets/function_dialogs/legato.cpp b/muse2/muse/widgets/function_dialogs/legato.cpp
index 0a181106..5ca6e29b 100644
--- a/muse2/muse/widgets/function_dialogs/legato.cpp
+++ b/muse2/muse/widgets/function_dialogs/legato.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: legato.cpp,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QButtonGroup>
#include "legato.h"
#include "xml.h"
+namespace MusEDialog {
+
Legato::Legato(QWidget* parent)
: QDialog(parent)
{
@@ -86,3 +103,5 @@ void Legato::write_configuration(int level, Xml& xml)
xml.intTag(level, "allow_shortening", allow_shortening);
xml.tag(level, "/legato");
}
+
+} // namespace MusEDialog
diff --git a/muse2/muse/widgets/function_dialogs/legato.h b/muse2/muse/widgets/function_dialogs/legato.h
index 00831830..c2cbeabc 100644
--- a/muse2/muse/widgets/function_dialogs/legato.h
+++ b/muse2/muse/widgets/function_dialogs/legato.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: legato.h,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __LEGATO_H__
@@ -13,6 +28,8 @@
class QButtonGroup;
class Xml;
+namespace MusEDialog {
+
class Legato : public QDialog, public Ui::LegatoBase
{
Q_OBJECT
@@ -39,5 +56,7 @@ class Legato : public QDialog, public Ui::LegatoBase
int exec();
};
+} // namespace MusEDialog
+
#endif
diff --git a/muse2/muse/widgets/function_dialogs/move.cpp b/muse2/muse/widgets/function_dialogs/move.cpp
index 2ce6cb05..2529cb68 100644
--- a/muse2/muse/widgets/function_dialogs/move.cpp
+++ b/muse2/muse/widgets/function_dialogs/move.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: move.cpp,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QButtonGroup>
#include "move.h"
#include "xml.h"
+namespace MusEDialog {
+
Move::Move(QWidget* parent)
: QDialog(parent)
{
@@ -82,3 +99,5 @@ void Move::write_configuration(int level, Xml& xml)
xml.intTag(level, "amount", amount);
xml.tag(level, "/move");
}
+
+} // namespace MusEDialog
diff --git a/muse2/muse/widgets/function_dialogs/move.h b/muse2/muse/widgets/function_dialogs/move.h
index 5049c567..39718134 100644
--- a/muse2/muse/widgets/function_dialogs/move.h
+++ b/muse2/muse/widgets/function_dialogs/move.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: move.h,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MOVE_H__
@@ -13,6 +28,8 @@
class QButtonGroup;
class Xml;
+namespace MusEDialog {
+
class Move : public QDialog, public Ui::MoveBase
{
Q_OBJECT
@@ -38,5 +55,7 @@ class Move : public QDialog, public Ui::MoveBase
int exec();
};
+} // namespace MusEDialog
+
#endif
diff --git a/muse2/muse/widgets/function_dialogs/quantize.cpp b/muse2/muse/widgets/function_dialogs/quantize.cpp
index 111087c2..0841e106 100644
--- a/muse2/muse/widgets/function_dialogs/quantize.cpp
+++ b/muse2/muse/widgets/function_dialogs/quantize.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: quantize.cpp,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QButtonGroup>
#include "quantize.h"
#include "xml.h"
+namespace MusEDialog {
+
Quantize::Quantize(QWidget* parent)
: QDialog(parent)
{
@@ -101,3 +118,6 @@ void Quantize::write_configuration(int level, Xml& xml)
xml.intTag(level, "quant_len", quant_len);
xml.tag(level, "/quantize");
}
+
+} // namespace MusEDialog
+
diff --git a/muse2/muse/widgets/function_dialogs/quantize.h b/muse2/muse/widgets/function_dialogs/quantize.h
index a857e667..69498810 100644
--- a/muse2/muse/widgets/function_dialogs/quantize.h
+++ b/muse2/muse/widgets/function_dialogs/quantize.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: quantize.h,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __QUANTIZE_H__
@@ -13,6 +28,8 @@
class QButtonGroup;
class Xml;
+namespace MusEDialog {
+
class Quantize : public QDialog, public Ui::QuantBase
{
Q_OBJECT
@@ -42,5 +59,7 @@ class Quantize : public QDialog, public Ui::QuantBase
int exec();
};
+} // namespace MusEDialog
+
#endif
diff --git a/muse2/muse/widgets/function_dialogs/remove.cpp b/muse2/muse/widgets/function_dialogs/remove.cpp
index 4a875135..69558fc3 100644
--- a/muse2/muse/widgets/function_dialogs/remove.cpp
+++ b/muse2/muse/widgets/function_dialogs/remove.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: remove.cpp,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QButtonGroup>
#include "remove.h"
#include "xml.h"
+namespace MusEDialog {
+
Remove::Remove(QWidget* parent)
: QDialog(parent)
{
@@ -96,3 +113,6 @@ void Remove::write_configuration(int level, Xml& xml)
xml.intTag(level, "len_thres_used", len_thres_used);
xml.tag(level, "/erase");
}
+
+} // namespace MusEDialog
+
diff --git a/muse2/muse/widgets/function_dialogs/remove.h b/muse2/muse/widgets/function_dialogs/remove.h
index 33ac3fd0..aba05909 100644
--- a/muse2/muse/widgets/function_dialogs/remove.h
+++ b/muse2/muse/widgets/function_dialogs/remove.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: remove.h,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __REMOVE_H__
@@ -13,6 +28,8 @@
class QButtonGroup;
class Xml;
+namespace MusEDialog {
+
class Remove : public QDialog, public Ui::RemoveBase
{
Q_OBJECT
@@ -41,5 +58,7 @@ class Remove : public QDialog, public Ui::RemoveBase
int exec();
};
+} // namespace MusEDialog
+
#endif
diff --git a/muse2/muse/widgets/function_dialogs/setlen.cpp b/muse2/muse/widgets/function_dialogs/setlen.cpp
index 024cdd35..81a589ae 100644
--- a/muse2/muse/widgets/function_dialogs/setlen.cpp
+++ b/muse2/muse/widgets/function_dialogs/setlen.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: setlen.cpp,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QButtonGroup>
#include "setlen.h"
#include "xml.h"
+namespace MusEDialog {
+
Setlen::Setlen(QWidget* parent)
: QDialog(parent)
{
@@ -81,3 +98,5 @@ void Setlen::write_configuration(int level, Xml& xml)
xml.intTag(level, "len", len);
xml.tag(level, "/setlen");
}
+
+} // namespace MusEDialog
diff --git a/muse2/muse/widgets/function_dialogs/setlen.h b/muse2/muse/widgets/function_dialogs/setlen.h
index 6a052bdb..fea6a5dd 100644
--- a/muse2/muse/widgets/function_dialogs/setlen.h
+++ b/muse2/muse/widgets/function_dialogs/setlen.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: setlen.h,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SETLEN_H__
@@ -13,6 +28,8 @@
class QButtonGroup;
class Xml;
+namespace MusEDialog {
+
class Setlen : public QDialog, public Ui::SetlenBase
{
Q_OBJECT
@@ -38,5 +55,7 @@ class Setlen : public QDialog, public Ui::SetlenBase
int exec();
};
+} // namespace MusEDialog
+
#endif
diff --git a/muse2/muse/widgets/function_dialogs/transpose.cpp b/muse2/muse/widgets/function_dialogs/transpose.cpp
index b10c1249..dd642050 100644
--- a/muse2/muse/widgets/function_dialogs/transpose.cpp
+++ b/muse2/muse/widgets/function_dialogs/transpose.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: transpose.cpp,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QButtonGroup>
#include "transpose.h"
#include "xml.h"
+namespace MusEDialog {
+
Transpose::Transpose(QWidget* parent)
: QDialog(parent)
{
@@ -81,3 +98,5 @@ void Transpose::write_configuration(int level, Xml& xml)
xml.intTag(level, "amount", amount);
xml.tag(level, "/transpose");
}
+
+} // namespace MusEDialog
diff --git a/muse2/muse/widgets/function_dialogs/transpose.h b/muse2/muse/widgets/function_dialogs/transpose.h
index b85bb827..b6363ae5 100644
--- a/muse2/muse/widgets/function_dialogs/transpose.h
+++ b/muse2/muse/widgets/function_dialogs/transpose.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: transpose.h,v 1.1.1.1 2011/05/05 18:51:04 flo93 Exp $
// (C) Copyright 2011 Florian Jung (flo93@sourceforge.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TRANSPOSE_H__
@@ -13,6 +28,8 @@
class QButtonGroup;
class Xml;
+namespace MusEDialog {
+
class Transpose : public QDialog, public Ui::TransposeBase
{
Q_OBJECT
@@ -36,5 +53,7 @@ class Transpose : public QDialog, public Ui::TransposeBase
int exec();
};
+} // namespace MusEDialog
+
#endif
diff --git a/muse2/muse/widgets/function_dialogs/velocity.cpp b/muse2/muse/widgets/function_dialogs/velocity.cpp
index ec625489..81655b5f 100644
--- a/muse2/muse/widgets/function_dialogs/velocity.cpp
+++ b/muse2/muse/widgets/function_dialogs/velocity.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: velocity.cpp,v 1.1.1.1 2003/10/27 18:55:04 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QButtonGroup>
#include "velocity.h"
#include "xml.h"
+namespace MusEDialog {
+
//---------------------------------------------------------
// Velocity
//---------------------------------------------------------
@@ -100,3 +117,5 @@ void Velocity::write_configuration(int level, Xml& xml)
xml.intTag(level, "rate", rateVal);
xml.tag(level, "/mod_velo");
}
+
+} // namespace MusEDialog
diff --git a/muse2/muse/widgets/function_dialogs/velocity.h b/muse2/muse/widgets/function_dialogs/velocity.h
index 83aac54d..9ef6cd2a 100644
--- a/muse2/muse/widgets/function_dialogs/velocity.h
+++ b/muse2/muse/widgets/function_dialogs/velocity.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: velocity.h,v 1.1.1.1 2003/10/27 18:54:51 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __VELOCITY_H__
@@ -13,6 +28,8 @@
class QButtonGroup;
class Xml;
+namespace MusEDialog {
+
//---------------------------------------------------------
// Velocity
//---------------------------------------------------------
@@ -42,5 +59,7 @@ class Velocity : public QDialog, public Ui::VelocityBase {
int exec();
};
+} // namespace MusEDialog
+
#endif
diff --git a/muse2/muse/widgets/genset.cpp b/muse2/muse/widgets/genset.cpp
index 9510f580..c6761a07 100644
--- a/muse2/muse/widgets/genset.cpp
+++ b/muse2/muse/widgets/genset.cpp
@@ -4,6 +4,21 @@
// $Id: genset.cpp,v 1.7.2.8 2009/12/01 03:52:40 terminator356 Exp $
//
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -19,6 +34,8 @@
#include "globals.h"
#include "icons.h"
+namespace MusEWidget {
+
static int rtcResolutions[] = {
1024, 2048, 4096, 8192, 16384, 32768
};
@@ -45,51 +62,51 @@ GlobalSettingsConfig::GlobalSettingsConfig(QWidget* parent)
startSongGroup->addButton(startEmptyButton, 1);
startSongGroup->addButton(startSongButton, 2);
for (unsigned i = 0; i < sizeof(rtcResolutions)/sizeof(*rtcResolutions); ++i) {
- if (rtcResolutions[i] == config.rtcTicks) {
+ if (rtcResolutions[i] == MusEConfig::config.rtcTicks) {
rtcResolutionSelect->setCurrentIndex(i);
break;
}
}
for (unsigned i = 0; i < sizeof(divisions)/sizeof(*divisions); ++i) {
- if (divisions[i] == config.division) {
+ if (divisions[i] == MusEConfig::config.division) {
midiDivisionSelect->setCurrentIndex(i);
break;
}
}
for (unsigned i = 0; i < sizeof(divisions)/sizeof(*divisions); ++i) {
- if (divisions[i] == config.guiDivision) {
+ if (divisions[i] == MusEConfig::config.guiDivision) {
guiDivisionSelect->setCurrentIndex(i);
break;
}
}
for (unsigned i = 0; i < sizeof(dummyAudioBufSizes)/sizeof(*dummyAudioBufSizes); ++i) {
- if (dummyAudioBufSizes[i] == config.dummyAudioBufSize) {
+ if (dummyAudioBufSizes[i] == MusEConfig::config.dummyAudioBufSize) {
dummyAudioSize->setCurrentIndex(i);
break;
}
}
for (unsigned i = 0; i < sizeof(minControlProcessPeriods)/sizeof(*minControlProcessPeriods); ++i) {
- if (minControlProcessPeriods[i] == config.minControlProcessPeriod) {
+ if (minControlProcessPeriods[i] == MusEConfig::config.minControlProcessPeriod) {
minControlProcessPeriodComboBox->setCurrentIndex(i);
break;
}
}
- userInstrumentsPath->setText(config.userInstrumentsDir);
+ userInstrumentsPath->setText(MusEConfig::config.userInstrumentsDir);
selectInstrumentsDirButton->setIcon(*openIcon);
defaultInstrumentsDirButton->setIcon(*undoIcon);
connect(selectInstrumentsDirButton, SIGNAL(clicked()), SLOT(selectInstrumentsPath()));
connect(defaultInstrumentsDirButton, SIGNAL(clicked()), SLOT(defaultInstrumentsPath()));
- guiRefreshSelect->setValue(config.guiRefresh);
- minSliderSelect->setValue(int(config.minSlider));
- minMeterSelect->setValue(config.minMeter);
- freewheelCheckBox->setChecked(config.freewheelMode);
- denormalCheckBox->setChecked(config.useDenormalBias);
- outputLimiterCheckBox->setChecked(config.useOutputLimiter);
- vstInPlaceCheckBox->setChecked(config.vstInPlace);
- dummyAudioRate->setValue(config.dummyAudioSampleRate);
+ guiRefreshSelect->setValue(MusEConfig::config.guiRefresh);
+ minSliderSelect->setValue(int(MusEConfig::config.minSlider));
+ minMeterSelect->setValue(MusEConfig::config.minMeter);
+ freewheelCheckBox->setChecked(MusEConfig::config.freewheelMode);
+ denormalCheckBox->setChecked(MusEConfig::config.useDenormalBias);
+ outputLimiterCheckBox->setChecked(MusEConfig::config.useOutputLimiter);
+ vstInPlaceCheckBox->setChecked(MusEConfig::config.vstInPlace);
+ dummyAudioRate->setValue(MusEConfig::config.dummyAudioSampleRate);
//DummyAudioDevice* dad = dynamic_cast<DummyAudioDevice*>(audioDevice);
//dummyAudioRealRate->setText(dad ? QString().setNum(sampleRate) : "---");
@@ -103,55 +120,55 @@ Period affects midi playback resolution.
Shorter periods are desirable.</string>
</property> */
- startSongEntry->setText(config.startSong);
- startSongGroup->button(config.startMode)->setChecked(true);
-
- showTransport->setChecked(config.transportVisible);
- showBigtime->setChecked(config.bigTimeVisible);
- //showMixer->setChecked(config.mixerVisible);
- showMixer->setChecked(config.mixer1Visible);
- showMixer2->setChecked(config.mixer2Visible);
-
- mainX->setValue(config.geometryMain.x());
- mainY->setValue(config.geometryMain.y());
- mainW->setValue(config.geometryMain.width());
- mainH->setValue(config.geometryMain.height());
-
- transportX->setValue(config.geometryTransport.x());
- transportY->setValue(config.geometryTransport.y());
-
- bigtimeX->setValue(config.geometryBigTime.x());
- bigtimeY->setValue(config.geometryBigTime.y());
- bigtimeW->setValue(config.geometryBigTime.width());
- bigtimeH->setValue(config.geometryBigTime.height());
-
- //mixerX->setValue(config.geometryMixer.x());
- //mixerY->setValue(config.geometryMixer.y());
- //mixerW->setValue(config.geometryMixer.width());
- //mixerH->setValue(config.geometryMixer.height());
- mixerX->setValue(config.mixer1.geometry.x());
- mixerY->setValue(config.mixer1.geometry.y());
- mixerW->setValue(config.mixer1.geometry.width());
- mixerH->setValue(config.mixer1.geometry.height());
- mixer2X->setValue(config.mixer2.geometry.x());
- mixer2Y->setValue(config.mixer2.geometry.y());
- mixer2W->setValue(config.mixer2.geometry.width());
- mixer2H->setValue(config.mixer2.geometry.height());
-
- //setMixerCurrent->setEnabled(muse->mixerWindow());
- setMixerCurrent->setEnabled(muse->mixer1Window());
- setMixer2Current->setEnabled(muse->mixer2Window());
+ startSongEntry->setText(MusEConfig::config.startSong);
+ startSongGroup->button(MusEConfig::config.startMode)->setChecked(true);
+
+ showTransport->setChecked(MusEConfig::config.transportVisible);
+ showBigtime->setChecked(MusEConfig::config.bigTimeVisible);
+ //showMixer->setChecked(MusEConfig::config.mixerVisible);
+ showMixer->setChecked(MusEConfig::config.mixer1Visible);
+ showMixer2->setChecked(MusEConfig::config.mixer2Visible);
+
+ mainX->setValue(MusEConfig::config.geometryMain.x());
+ mainY->setValue(MusEConfig::config.geometryMain.y());
+ mainW->setValue(MusEConfig::config.geometryMain.width());
+ mainH->setValue(MusEConfig::config.geometryMain.height());
+
+ transportX->setValue(MusEConfig::config.geometryTransport.x());
+ transportY->setValue(MusEConfig::config.geometryTransport.y());
+
+ bigtimeX->setValue(MusEConfig::config.geometryBigTime.x());
+ bigtimeY->setValue(MusEConfig::config.geometryBigTime.y());
+ bigtimeW->setValue(MusEConfig::config.geometryBigTime.width());
+ bigtimeH->setValue(MusEConfig::config.geometryBigTime.height());
+
+ //mixerX->setValue(MusEConfig::config.geometryMixer.x());
+ //mixerY->setValue(MusEConfig::config.geometryMixer.y());
+ //mixerW->setValue(MusEConfig::config.geometryMixer.width());
+ //mixerH->setValue(MusEConfig::config.geometryMixer.height());
+ mixerX->setValue(MusEConfig::config.mixer1.geometry.x());
+ mixerY->setValue(MusEConfig::config.mixer1.geometry.y());
+ mixerW->setValue(MusEConfig::config.mixer1.geometry.width());
+ mixerH->setValue(MusEConfig::config.mixer1.geometry.height());
+ mixer2X->setValue(MusEConfig::config.mixer2.geometry.x());
+ mixer2Y->setValue(MusEConfig::config.mixer2.geometry.y());
+ mixer2W->setValue(MusEConfig::config.mixer2.geometry.width());
+ mixer2H->setValue(MusEConfig::config.mixer2.geometry.height());
+
+ //setMixerCurrent->setEnabled(MusEGlobal::muse->mixerWindow());
+ setMixerCurrent->setEnabled(MusEGlobal::muse->mixer1Window());
+ setMixer2Current->setEnabled(MusEGlobal::muse->mixer2Window());
- setBigtimeCurrent->setEnabled(muse->bigtimeWindow());
- setTransportCurrent->setEnabled(muse->transportWindow());
-
- showSplash->setChecked(config.showSplashScreen);
- showDidYouKnow->setChecked(config.showDidYouKnow);
- externalWavEditorSelect->setText(config.externalWavEditor);
- oldStyleStopCheckBox->setChecked(config.useOldStyleStopShortCut);
- moveArmedCheckBox->setChecked(config.moveArmedCheckBox);
- projectSaveCheckBox->setChecked(config.useProjectSaveDialog);
- popsDefStayOpenCheckBox->setChecked(config.popupsDefaultStayOpen);
+ setBigtimeCurrent->setEnabled(MusEGlobal::muse->bigtimeWindow());
+ setTransportCurrent->setEnabled(MusEGlobal::muse->transportWindow());
+
+ showSplash->setChecked(MusEConfig::config.showSplashScreen);
+ showDidYouKnow->setChecked(MusEConfig::config.showDidYouKnow);
+ externalWavEditorSelect->setText(MusEConfig::config.externalWavEditor);
+ oldStyleStopCheckBox->setChecked(MusEConfig::config.useOldStyleStopShortCut);
+ moveArmedCheckBox->setChecked(MusEConfig::config.moveArmedCheckBox);
+ projectSaveCheckBox->setChecked(MusEConfig::config.useProjectSaveDialog);
+ popsDefStayOpenCheckBox->setChecked(MusEConfig::config.popupsDefaultStayOpen);
//updateSettings(); // TESTING
@@ -195,99 +212,99 @@ void GlobalSettingsConfig::addMdiSettings(TopWin::ToplevelType t)
void GlobalSettingsConfig::updateSettings()
{
for (unsigned i = 0; i < sizeof(rtcResolutions)/sizeof(*rtcResolutions); ++i) {
- if (rtcResolutions[i] == config.rtcTicks) {
+ if (rtcResolutions[i] == MusEConfig::config.rtcTicks) {
rtcResolutionSelect->setCurrentIndex(i);
break;
}
}
for (unsigned i = 0; i < sizeof(divisions)/sizeof(*divisions); ++i) {
- if (divisions[i] == config.division) {
+ if (divisions[i] == MusEConfig::config.division) {
midiDivisionSelect->setCurrentIndex(i);
break;
}
}
for (unsigned i = 0; i < sizeof(divisions)/sizeof(*divisions); ++i) {
- if (divisions[i] == config.guiDivision) {
+ if (divisions[i] == MusEConfig::config.guiDivision) {
guiDivisionSelect->setCurrentIndex(i);
break;
}
}
for (unsigned i = 0; i < sizeof(dummyAudioBufSizes)/sizeof(*dummyAudioBufSizes); ++i) {
- if (dummyAudioBufSizes[i] == config.dummyAudioBufSize) {
+ if (dummyAudioBufSizes[i] == MusEConfig::config.dummyAudioBufSize) {
dummyAudioSize->setCurrentIndex(i);
break;
}
}
for (unsigned i = 0; i < sizeof(minControlProcessPeriods)/sizeof(*minControlProcessPeriods); ++i) {
- if (minControlProcessPeriods[i] == config.minControlProcessPeriod) {
+ if (minControlProcessPeriods[i] == MusEConfig::config.minControlProcessPeriod) {
minControlProcessPeriodComboBox->setCurrentIndex(i);
break;
}
}
- guiRefreshSelect->setValue(config.guiRefresh);
- minSliderSelect->setValue(int(config.minSlider));
- minMeterSelect->setValue(config.minMeter);
- freewheelCheckBox->setChecked(config.freewheelMode);
- denormalCheckBox->setChecked(config.useDenormalBias);
- outputLimiterCheckBox->setChecked(config.useOutputLimiter);
- vstInPlaceCheckBox->setChecked(config.vstInPlace);
- dummyAudioRate->setValue(config.dummyAudioSampleRate);
+ guiRefreshSelect->setValue(MusEConfig::config.guiRefresh);
+ minSliderSelect->setValue(int(MusEConfig::config.minSlider));
+ minMeterSelect->setValue(MusEConfig::config.minMeter);
+ freewheelCheckBox->setChecked(MusEConfig::config.freewheelMode);
+ denormalCheckBox->setChecked(MusEConfig::config.useDenormalBias);
+ outputLimiterCheckBox->setChecked(MusEConfig::config.useOutputLimiter);
+ vstInPlaceCheckBox->setChecked(MusEConfig::config.vstInPlace);
+ dummyAudioRate->setValue(MusEConfig::config.dummyAudioSampleRate);
//DummyAudioDevice* dad = dynamic_cast<DummyAudioDevice*>(audioDevice);
//dummyAudioRealRate->setText(dad ? QString().setNum(sampleRate) : "---");
//dummyAudioRealRate->setText(QString().setNum(sampleRate)); // Not used any more. p4.0.20
- startSongEntry->setText(config.startSong);
- startSongGroup->button(config.startMode)->setChecked(true);
-
- showTransport->setChecked(config.transportVisible);
- showBigtime->setChecked(config.bigTimeVisible);
- //showMixer->setChecked(config.mixerVisible);
- showMixer->setChecked(config.mixer1Visible);
- showMixer2->setChecked(config.mixer2Visible);
-
- mainX->setValue(config.geometryMain.x());
- mainY->setValue(config.geometryMain.y());
- mainW->setValue(config.geometryMain.width());
- mainH->setValue(config.geometryMain.height());
-
- transportX->setValue(config.geometryTransport.x());
- transportY->setValue(config.geometryTransport.y());
-
- bigtimeX->setValue(config.geometryBigTime.x());
- bigtimeY->setValue(config.geometryBigTime.y());
- bigtimeW->setValue(config.geometryBigTime.width());
- bigtimeH->setValue(config.geometryBigTime.height());
-
- //mixerX->setValue(config.geometryMixer.x());
- //mixerY->setValue(config.geometryMixer.y());
- //mixerW->setValue(config.geometryMixer.width());
- //mixerH->setValue(config.geometryMixer.height());
- mixerX->setValue(config.mixer1.geometry.x());
- mixerY->setValue(config.mixer1.geometry.y());
- mixerW->setValue(config.mixer1.geometry.width());
- mixerH->setValue(config.mixer1.geometry.height());
- mixer2X->setValue(config.mixer2.geometry.x());
- mixer2Y->setValue(config.mixer2.geometry.y());
- mixer2W->setValue(config.mixer2.geometry.width());
- mixer2H->setValue(config.mixer2.geometry.height());
-
- //setMixerCurrent->setEnabled(muse->mixerWindow());
- setMixerCurrent->setEnabled(muse->mixer1Window());
- setMixer2Current->setEnabled(muse->mixer2Window());
+ startSongEntry->setText(MusEConfig::config.startSong);
+ startSongGroup->button(MusEConfig::config.startMode)->setChecked(true);
+
+ showTransport->setChecked(MusEConfig::config.transportVisible);
+ showBigtime->setChecked(MusEConfig::config.bigTimeVisible);
+ //showMixer->setChecked(MusEConfig::config.mixerVisible);
+ showMixer->setChecked(MusEConfig::config.mixer1Visible);
+ showMixer2->setChecked(MusEConfig::config.mixer2Visible);
+
+ mainX->setValue(MusEConfig::config.geometryMain.x());
+ mainY->setValue(MusEConfig::config.geometryMain.y());
+ mainW->setValue(MusEConfig::config.geometryMain.width());
+ mainH->setValue(MusEConfig::config.geometryMain.height());
+
+ transportX->setValue(MusEConfig::config.geometryTransport.x());
+ transportY->setValue(MusEConfig::config.geometryTransport.y());
+
+ bigtimeX->setValue(MusEConfig::config.geometryBigTime.x());
+ bigtimeY->setValue(MusEConfig::config.geometryBigTime.y());
+ bigtimeW->setValue(MusEConfig::config.geometryBigTime.width());
+ bigtimeH->setValue(MusEConfig::config.geometryBigTime.height());
+
+ //mixerX->setValue(MusEConfig::config.geometryMixer.x());
+ //mixerY->setValue(MusEConfig::config.geometryMixer.y());
+ //mixerW->setValue(MusEConfig::config.geometryMixer.width());
+ //mixerH->setValue(MusEConfig::config.geometryMixer.height());
+ mixerX->setValue(MusEConfig::config.mixer1.geometry.x());
+ mixerY->setValue(MusEConfig::config.mixer1.geometry.y());
+ mixerW->setValue(MusEConfig::config.mixer1.geometry.width());
+ mixerH->setValue(MusEConfig::config.mixer1.geometry.height());
+ mixer2X->setValue(MusEConfig::config.mixer2.geometry.x());
+ mixer2Y->setValue(MusEConfig::config.mixer2.geometry.y());
+ mixer2W->setValue(MusEConfig::config.mixer2.geometry.width());
+ mixer2H->setValue(MusEConfig::config.mixer2.geometry.height());
+
+ //setMixerCurrent->setEnabled(MusEGlobal::muse->mixerWindow());
+ setMixerCurrent->setEnabled(MusEGlobal::muse->mixer1Window());
+ setMixer2Current->setEnabled(MusEGlobal::muse->mixer2Window());
- setBigtimeCurrent->setEnabled(muse->bigtimeWindow());
- setTransportCurrent->setEnabled(muse->transportWindow());
-
- showSplash->setChecked(config.showSplashScreen);
- showDidYouKnow->setChecked(config.showDidYouKnow);
- externalWavEditorSelect->setText(config.externalWavEditor);
- oldStyleStopCheckBox->setChecked(config.useOldStyleStopShortCut);
- moveArmedCheckBox->setChecked(config.moveArmedCheckBox);
- projectSaveCheckBox->setChecked(config.useProjectSaveDialog);
- popsDefStayOpenCheckBox->setChecked(config.popupsDefaultStayOpen);
+ setBigtimeCurrent->setEnabled(MusEGlobal::muse->bigtimeWindow());
+ setTransportCurrent->setEnabled(MusEGlobal::muse->transportWindow());
+
+ showSplash->setChecked(MusEConfig::config.showSplashScreen);
+ showDidYouKnow->setChecked(MusEConfig::config.showDidYouKnow);
+ externalWavEditorSelect->setText(MusEConfig::config.externalWavEditor);
+ oldStyleStopCheckBox->setChecked(MusEConfig::config.useOldStyleStopShortCut);
+ moveArmedCheckBox->setChecked(MusEConfig::config.moveArmedCheckBox);
+ projectSaveCheckBox->setChecked(MusEConfig::config.useProjectSaveDialog);
+ popsDefStayOpenCheckBox->setChecked(MusEConfig::config.popupsDefaultStayOpen);
updateMdiSettings();
}
@@ -321,112 +338,112 @@ void GlobalSettingsConfig::showEvent(QShowEvent* e)
void GlobalSettingsConfig::apply()
{
int rtcticks = rtcResolutionSelect->currentIndex();
- config.guiRefresh = guiRefreshSelect->value();
- config.minSlider = minSliderSelect->value();
- config.minMeter = minMeterSelect->value();
- config.freewheelMode = freewheelCheckBox->isChecked();
- config.useDenormalBias = denormalCheckBox->isChecked();
- config.useOutputLimiter = outputLimiterCheckBox->isChecked();
- config.vstInPlace = vstInPlaceCheckBox->isChecked();
- config.rtcTicks = rtcResolutions[rtcticks];
- config.userInstrumentsDir = userInstrumentsPath->text();
- config.startSong = startSongEntry->text();
- config.startMode = startSongGroup->checkedId();
+ MusEConfig::config.guiRefresh = guiRefreshSelect->value();
+ MusEConfig::config.minSlider = minSliderSelect->value();
+ MusEConfig::config.minMeter = minMeterSelect->value();
+ MusEConfig::config.freewheelMode = freewheelCheckBox->isChecked();
+ MusEConfig::config.useDenormalBias = denormalCheckBox->isChecked();
+ MusEConfig::config.useOutputLimiter = outputLimiterCheckBox->isChecked();
+ MusEConfig::config.vstInPlace = vstInPlaceCheckBox->isChecked();
+ MusEConfig::config.rtcTicks = rtcResolutions[rtcticks];
+ MusEConfig::config.userInstrumentsDir = userInstrumentsPath->text();
+ MusEConfig::config.startSong = startSongEntry->text();
+ MusEConfig::config.startMode = startSongGroup->checkedId();
int das = dummyAudioSize->currentIndex();
- config.dummyAudioBufSize = dummyAudioBufSizes[das];
- config.dummyAudioSampleRate = dummyAudioRate->value();
+ MusEConfig::config.dummyAudioBufSize = dummyAudioBufSizes[das];
+ MusEConfig::config.dummyAudioSampleRate = dummyAudioRate->value();
int mcp = minControlProcessPeriodComboBox->currentIndex();
- config.minControlProcessPeriod = minControlProcessPeriods[mcp];
+ MusEConfig::config.minControlProcessPeriod = minControlProcessPeriods[mcp];
int div = midiDivisionSelect->currentIndex();
- config.division = divisions[div];
+ MusEConfig::config.division = divisions[div];
div = guiDivisionSelect->currentIndex();
- config.guiDivision = divisions[div];
+ MusEConfig::config.guiDivision = divisions[div];
- config.transportVisible = showTransport->isChecked();
- config.bigTimeVisible = showBigtime->isChecked();
- //config.mixerVisible = showMixer->isChecked();
- config.mixer1Visible = showMixer->isChecked();
- config.mixer2Visible = showMixer2->isChecked();
-
- config.geometryMain.setX(mainX->value());
- config.geometryMain.setY(mainY->value());
- config.geometryMain.setWidth(mainW->value());
- config.geometryMain.setHeight(mainH->value());
-
- config.geometryTransport.setX(transportX->value());
- config.geometryTransport.setY(transportY->value());
- config.geometryTransport.setWidth(0);
- config.geometryTransport.setHeight(0);
-
- config.geometryBigTime.setX(bigtimeX->value());
- config.geometryBigTime.setY(bigtimeY->value());
- config.geometryBigTime.setWidth(bigtimeW->value());
- config.geometryBigTime.setHeight(bigtimeH->value());
-
- //config.geometryMixer.setX(mixerX->value());
- //config.geometryMixer.setY(mixerY->value());
- //config.geometryMixer.setWidth(mixerW->value());
- //config.geometryMixer.setHeight(mixerH->value());
- config.mixer1.geometry.setX(mixerX->value());
- config.mixer1.geometry.setY(mixerY->value());
- config.mixer1.geometry.setWidth(mixerW->value());
- config.mixer1.geometry.setHeight(mixerH->value());
- config.mixer2.geometry.setX(mixer2X->value());
- config.mixer2.geometry.setY(mixer2Y->value());
- config.mixer2.geometry.setWidth(mixer2W->value());
- config.mixer2.geometry.setHeight(mixer2H->value());
-
- config.showSplashScreen = showSplash->isChecked();
- config.showDidYouKnow = showDidYouKnow->isChecked();
- config.externalWavEditor = externalWavEditorSelect->text();
- config.useOldStyleStopShortCut = oldStyleStopCheckBox->isChecked();
- config.moveArmedCheckBox = moveArmedCheckBox->isChecked();
- config.useProjectSaveDialog = projectSaveCheckBox->isChecked();
- config.popupsDefaultStayOpen = popsDefStayOpenCheckBox->isChecked();
-
- //muse->showMixer(config.mixerVisible);
- muse->showMixer1(config.mixer1Visible);
- muse->showMixer2(config.mixer2Visible);
+ MusEConfig::config.transportVisible = showTransport->isChecked();
+ MusEConfig::config.bigTimeVisible = showBigtime->isChecked();
+ //MusEConfig::config.mixerVisible = showMixer->isChecked();
+ MusEConfig::config.mixer1Visible = showMixer->isChecked();
+ MusEConfig::config.mixer2Visible = showMixer2->isChecked();
+
+ MusEConfig::config.geometryMain.setX(mainX->value());
+ MusEConfig::config.geometryMain.setY(mainY->value());
+ MusEConfig::config.geometryMain.setWidth(mainW->value());
+ MusEConfig::config.geometryMain.setHeight(mainH->value());
+
+ MusEConfig::config.geometryTransport.setX(transportX->value());
+ MusEConfig::config.geometryTransport.setY(transportY->value());
+ MusEConfig::config.geometryTransport.setWidth(0);
+ MusEConfig::config.geometryTransport.setHeight(0);
+
+ MusEConfig::config.geometryBigTime.setX(bigtimeX->value());
+ MusEConfig::config.geometryBigTime.setY(bigtimeY->value());
+ MusEConfig::config.geometryBigTime.setWidth(bigtimeW->value());
+ MusEConfig::config.geometryBigTime.setHeight(bigtimeH->value());
+
+ //MusEConfig::config.geometryMixer.setX(mixerX->value());
+ //MusEConfig::config.geometryMixer.setY(mixerY->value());
+ //MusEConfig::config.geometryMixer.setWidth(mixerW->value());
+ //MusEConfig::config.geometryMixer.setHeight(mixerH->value());
+ MusEConfig::config.mixer1.geometry.setX(mixerX->value());
+ MusEConfig::config.mixer1.geometry.setY(mixerY->value());
+ MusEConfig::config.mixer1.geometry.setWidth(mixerW->value());
+ MusEConfig::config.mixer1.geometry.setHeight(mixerH->value());
+ MusEConfig::config.mixer2.geometry.setX(mixer2X->value());
+ MusEConfig::config.mixer2.geometry.setY(mixer2Y->value());
+ MusEConfig::config.mixer2.geometry.setWidth(mixer2W->value());
+ MusEConfig::config.mixer2.geometry.setHeight(mixer2H->value());
+
+ MusEConfig::config.showSplashScreen = showSplash->isChecked();
+ MusEConfig::config.showDidYouKnow = showDidYouKnow->isChecked();
+ MusEConfig::config.externalWavEditor = externalWavEditorSelect->text();
+ MusEConfig::config.useOldStyleStopShortCut = oldStyleStopCheckBox->isChecked();
+ MusEConfig::config.moveArmedCheckBox = moveArmedCheckBox->isChecked();
+ MusEConfig::config.useProjectSaveDialog = projectSaveCheckBox->isChecked();
+ MusEConfig::config.popupsDefaultStayOpen = popsDefStayOpenCheckBox->isChecked();
+
+ //MusEGlobal::muse->showMixer(MusEConfig::config.mixerVisible);
+ MusEGlobal::muse->showMixer1(MusEConfig::config.mixer1Visible);
+ MusEGlobal::muse->showMixer2(MusEConfig::config.mixer2Visible);
- muse->showBigtime(config.bigTimeVisible);
- muse->showTransport(config.transportVisible);
- QWidget* w = muse->transportWindow();
+ MusEGlobal::muse->showBigtime(MusEConfig::config.bigTimeVisible);
+ MusEGlobal::muse->showTransport(MusEConfig::config.transportVisible);
+ QWidget* w = MusEGlobal::muse->transportWindow();
if (w) {
- w->resize(config.geometryTransport.size());
- w->move(config.geometryTransport.topLeft());
+ w->resize(MusEConfig::config.geometryTransport.size());
+ w->move(MusEConfig::config.geometryTransport.topLeft());
}
- //w = muse->mixerWindow();
+ //w = MusEGlobal::muse->mixerWindow();
//if (w) {
- // w->resize(config.geometryMixer.size());
- // w->move(config.geometryMixer.topLeft());
+ // w->resize(MusEConfig::config.geometryMixer.size());
+ // w->move(MusEConfig::config.geometryMixer.topLeft());
// }
- w = muse->mixer1Window();
+ w = MusEGlobal::muse->mixer1Window();
if (w) {
- w->resize(config.mixer1.geometry.size());
- w->move(config.mixer1.geometry.topLeft());
+ w->resize(MusEConfig::config.mixer1.geometry.size());
+ w->move(MusEConfig::config.mixer1.geometry.topLeft());
}
- w = muse->mixer2Window();
+ w = MusEGlobal::muse->mixer2Window();
if (w) {
- w->resize(config.mixer2.geometry.size());
- w->move(config.mixer2.geometry.topLeft());
+ w->resize(MusEConfig::config.mixer2.geometry.size());
+ w->move(MusEConfig::config.mixer2.geometry.topLeft());
}
- w = muse->bigtimeWindow();
+ w = MusEGlobal::muse->bigtimeWindow();
if (w) {
- w->resize(config.geometryBigTime.size());
- w->move(config.geometryBigTime.topLeft());
+ w->resize(MusEConfig::config.geometryBigTime.size());
+ w->move(MusEConfig::config.geometryBigTime.topLeft());
}
- muse->resize(config.geometryMain.size());
- muse->move(config.geometryMain.topLeft());
+ MusEGlobal::muse->resize(MusEConfig::config.geometryMain.size());
+ MusEGlobal::muse->move(MusEConfig::config.geometryMain.topLeft());
- museUserInstruments = config.userInstrumentsDir;
+ MusEGlobal::museUserInstruments = MusEConfig::config.userInstrumentsDir;
- muse->setHeartBeat(); // set guiRefresh
+ MusEGlobal::muse->setHeartBeat(); // set guiRefresh
midiSeq->msgSetRtc(); // set midi tick rate
applyMdiSettings();
- muse->changeConfig(true); // save settings
+ MusEGlobal::muse->changeConfig(true); // save settings
}
//---------------------------------------------------------
@@ -454,7 +471,7 @@ void GlobalSettingsConfig::cancel()
void GlobalSettingsConfig::mixerCurrent()
{
- QWidget* w = muse->mixer1Window();
+ QWidget* w = MusEGlobal::muse->mixer1Window();
if (!w)
return;
QRect r(w->frameGeometry());
@@ -470,7 +487,7 @@ void GlobalSettingsConfig::mixerCurrent()
void GlobalSettingsConfig::mixer2Current()
{
- QWidget* w = muse->mixer2Window();
+ QWidget* w = MusEGlobal::muse->mixer2Window();
if (!w)
return;
QRect r(w->frameGeometry());
@@ -486,7 +503,7 @@ void GlobalSettingsConfig::mixer2Current()
void GlobalSettingsConfig::bigtimeCurrent()
{
- QWidget* w = muse->bigtimeWindow();
+ QWidget* w = MusEGlobal::muse->bigtimeWindow();
if (!w)
return;
QRect r(w->frameGeometry());
@@ -502,11 +519,11 @@ void GlobalSettingsConfig::bigtimeCurrent()
void GlobalSettingsConfig::mainCurrent()
{
- QRect r(muse->frameGeometry());
+ QRect r(MusEGlobal::muse->frameGeometry());
mainX->setValue(r.x());
mainY->setValue(r.y());
- mainW->setValue(muse->width()); //this is intendedly not the frameGeometry, but
- mainH->setValue(muse->height()); //the "non-frame-geom." to avoid a sizing bug
+ mainW->setValue(MusEGlobal::muse->width()); //this is intendedly not the frameGeometry, but
+ mainH->setValue(MusEGlobal::muse->height()); //the "non-frame-geom." to avoid a sizing bug
}
//---------------------------------------------------------
@@ -515,7 +532,7 @@ void GlobalSettingsConfig::mainCurrent()
void GlobalSettingsConfig::transportCurrent()
{
- QWidget* w = muse->transportWindow();
+ QWidget* w = MusEGlobal::muse->transportWindow();
if (!w)
return;
QRect r(w->frameGeometry());
@@ -527,13 +544,13 @@ void GlobalSettingsConfig::selectInstrumentsPath()
{
QString dir = QFileDialog::getExistingDirectory(this,
tr("Selects instruments directory"),
- config.userInstrumentsDir);
+ MusEConfig::config.userInstrumentsDir);
userInstrumentsPath->setText(dir);
}
void GlobalSettingsConfig::defaultInstrumentsPath()
{
- QString dir = configPath + "/instruments";
+ QString dir = MusEGlobal::configPath + "/instruments";
userInstrumentsPath->setText(dir);
}
@@ -575,3 +592,5 @@ void GlobalSettingsConfig::borlandPreset()
updateMdiSettings();
}
+} // namespace MusEWidget
+
diff --git a/muse2/muse/widgets/genset.h b/muse2/muse/widgets/genset.h
index 9c636c67..6068c429 100644
--- a/muse2/muse/widgets/genset.h
+++ b/muse2/muse/widgets/genset.h
@@ -4,6 +4,21 @@
// $Id: genset.h,v 1.3 2004/01/25 09:55:17 wschweer Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __GENSET_H__
@@ -16,6 +31,8 @@
#include <QShowEvent>
#include <list>
+namespace MusEWidget {
+
//---------------------------------------------------------
// GlobalSettingsConfig
//---------------------------------------------------------
@@ -51,4 +68,6 @@ class GlobalSettingsConfig : public QDialog, public Ui::GlobalSettingsDialogBase
GlobalSettingsConfig(QWidget* parent=0);
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/header.cpp b/muse2/muse/widgets/header.cpp
index ef874fc4..8e2efe21 100644
--- a/muse2/muse/widgets/header.cpp
+++ b/muse2/muse/widgets/header.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: header.cpp,v 1.1.1.1 2003/10/27 18:55:05 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "header.h"
@@ -13,6 +28,8 @@
#include <QStandardItemModel>
#include <QMouseEvent>
+namespace MusEWidget {
+
//---------------------------------------------------------
// readStatus
//---------------------------------------------------------
@@ -174,3 +191,5 @@ void Header::changeColumns(QAction *a)
else
hideSection(section);
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/header.h b/muse2/muse/widgets/header.h
index 3e7b73a4..47c79192 100644
--- a/muse2/muse/widgets/header.h
+++ b/muse2/muse/widgets/header.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: header.h,v 1.1.1.1 2003/10/27 18:55:03 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __HEADER_H__
@@ -15,6 +30,8 @@ class QStandardItemModel;
class Xml;
+namespace MusEWidget {
+
class Header : public QHeaderView {
Q_OBJECT
@@ -32,5 +49,7 @@ class Header : public QHeaderView {
void changeColumns(QAction* a);
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/hitscale.cpp b/muse2/muse/widgets/hitscale.cpp
index feba5920..c1fcdd87 100644
--- a/muse2/muse/widgets/hitscale.cpp
+++ b/muse2/muse/widgets/hitscale.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: hitscale.cpp,v 1.3.2.1 2007/01/27 14:52:43 spamatica Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "hitscale.h"
@@ -13,6 +28,8 @@
#include "song.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// HitScale
//---------------------------------------------------------
@@ -130,4 +147,5 @@ void HitScale::pdraw(QPainter& p, const QRect& r)
p.drawLine(xp, 0, xp, height());
}
+}
diff --git a/muse2/muse/widgets/hitscale.h b/muse2/muse/widgets/hitscale.h
index 0eaae399..cf43ef4a 100644
--- a/muse2/muse/widgets/hitscale.h
+++ b/muse2/muse/widgets/hitscale.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: hitscale.h,v 1.2 2004/01/11 18:55:37 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __HITSCALE_H__
@@ -12,6 +27,8 @@
class MidiEditor;
+namespace MusEWidget {
+
//---------------------------------------------------------
// HitScale
// scale for midi track
@@ -42,5 +59,8 @@ class HitScale : public View {
public:
HitScale(int* raster, QWidget* parent, int xscale);
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/intlabel.cpp b/muse2/muse/widgets/intlabel.cpp
index 355f4510..6884adfb 100644
--- a/muse2/muse/widgets/intlabel.cpp
+++ b/muse2/muse/widgets/intlabel.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: intlabel.cpp,v 1.1.1.1.2.1 2008/08/18 00:15:26 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -10,6 +25,8 @@
#include "intlabel.h"
#include "utils.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// IntLabel
//---------------------------------------------------------
@@ -24,7 +41,7 @@ IntLabel::IntLabel(int _val, int _min, int _max, QWidget* parent,
val = _val+1; // dont optimize away
off = _off;
setValue(_val);
- int len = num2cols(min, max);
+ int len = MusEUtil::num2cols(min, max);
setSize(len);
}
@@ -42,7 +59,7 @@ void IntLabel::setRange(int mn, int mx)
{
min = mn;
max = mx;
- setSize(num2cols(min, max));
+ setSize(MusEUtil::num2cols(min, max));
int v = val;
if(val < mn)
v = mn;
@@ -138,3 +155,4 @@ void IntLabel::setOff(int v)
setString(val);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/intlabel.h b/muse2/muse/widgets/intlabel.h
index cb5c3ecc..34c075d8 100644
--- a/muse2/muse/widgets/intlabel.h
+++ b/muse2/muse/widgets/intlabel.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: intlabel.h,v 1.1.1.1.2.2 2008/08/18 00:15:26 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __INTLABEL_H__
@@ -13,6 +28,8 @@
class QString;
+namespace MusEWidget {
+
//---------------------------------------------------------
// IntLabel
//---------------------------------------------------------
@@ -43,4 +60,6 @@ class IntLabel : public Nentry {
void setRange(int, int);
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/itransformbase.ui b/muse2/muse/widgets/itransformbase.ui
index 51280e56..2e9fb602 100644
--- a/muse2/muse/widgets/itransformbase.ui
+++ b/muse2/muse/widgets/itransformbase.ui
@@ -533,7 +533,7 @@
</widget>
</item>
<item row="2" column="1">
- <widget class="SpinBoxFP" name="procVal1a">
+ <widget class="MusEWidget::SpinBoxFP" name="procVal1a">
<property name="maximum" stdset="0">
<number>99999999</number>
</property>
@@ -736,21 +736,21 @@
</widget>
</item>
<item row="2" column="2">
- <widget class="SpinBoxFP" name="procVal2a">
+ <widget class="MusEWidget::SpinBoxFP" name="procVal2a">
<property name="maximum" stdset="0">
<number>99999999</number>
</property>
</widget>
</item>
<item row="2" column="3">
- <widget class="SpinBoxFP" name="procPortVala">
+ <widget class="MusEWidget::SpinBoxFP" name="procPortVala">
<property name="maximum" stdset="0">
<number>99999999</number>
</property>
</widget>
</item>
<item row="2" column="4">
- <widget class="SpinBoxFP" name="procChannelVala">
+ <widget class="MusEWidget::SpinBoxFP" name="procChannelVala">
<property name="maximum" stdset="0">
<number>99999999</number>
</property>
@@ -1106,7 +1106,7 @@
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
- <class>SpinBoxFP</class>
+ <class>MusEWidget::SpinBoxFP</class>
<extends>QDoubleSpinBox</extends>
<header>spinboxFP.h</header>
</customwidget>
diff --git a/muse2/muse/widgets/knob.cpp b/muse2/muse/widgets/knob.cpp
index dc41e1c4..9bc63b33 100644
--- a/muse2/muse/widgets/knob.cpp
+++ b/muse2/muse/widgets/knob.cpp
@@ -2,20 +2,26 @@
// MusE
// Linux Music Editor
// $Id: knob.cpp,v 1.3.2.3 2009/03/09 02:05:18 terminator356 Exp $
-// (C) Copyright 1999 Werner Schweer (ws@seh.de)
//
// Adapted from Qwt Lib:
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
+// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Orcan Ogetbil (ogetbilo at sf.net) completely redesigned.
+//
+// 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; 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; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -28,6 +34,8 @@
#include <QPaintEvent>
#include <QResizeEvent>
+namespace MusEWidget {
+
//---------------------------------------------------------
// The QwtKnob widget imitates look and behaviour of a volume knob on a radio.
// It contains
@@ -327,8 +335,8 @@ void Knob::resizeEvent(QResizeEvent *)
// printf("resize %d %d %d\n", r.height(), r.width(), d_knobWidth);
-// width = qwtMin(qwtMin(r.height(), r.width()), d_knobWidth);
- width = qwtMin(r.height(), r.width());
+// width = MusEUtil::qwtMin(MusEUtil::qwtMin(r.height(), r.width()), d_knobWidth);
+ width = MusEUtil::qwtMin(r.height(), r.width());
width_2 = width / 2;
int x = r.x() + r.width() / 2 - width_2;
@@ -417,7 +425,7 @@ void Knob::drawMarker(QPainter *p, double arc, const QColor &c)
p->setBrush(c);
p->setPen(Qt::NoPen);
- rb = double(qwtMax(radius - 4 - d_dotWidth / 2, 0));
+ rb = double(MusEUtil::qwtMax(radius - 4 - d_dotWidth / 2, 0));
p->drawEllipse(xm - int(rint(sa * rb)) - d_dotWidth / 2,
ym - int(rint(ca * rb)) - d_dotWidth / 2,
d_dotWidth, d_dotWidth);
@@ -430,8 +438,8 @@ void Knob::drawMarker(QPainter *p, double arc, const QColor &c)
pn.setWidth(2);
p->setPen(pn);
- rb = qwtMax(double((radius - 1) / 3.0), 0.0);
- re = qwtMax(double(radius - 1), 0.0);
+ rb = MusEUtil::qwtMax(double((radius - 1) / 3.0), 0.0);
+ re = MusEUtil::qwtMax(double(radius - 1), 0.0);
p->setRenderHint(QPainter::Antialiasing, true);
p->drawLine( xm,
@@ -462,7 +470,7 @@ void Knob::drawMarker(QPainter *p, double arc, const QColor &c)
//------------------------------------------------------------
void Knob::setKnobWidth(int w)
{
- d_knobWidth = qwtMax(w,5);
+ d_knobWidth = MusEUtil::qwtMax(w,5);
resize(size());
repaint();
}
@@ -481,7 +489,7 @@ void Knob::setKnobWidth(int w)
//------------------------------------------------------------
void Knob::setBorderWidth(int bw)
{
- d_borderWidth = qwtMax(bw, 0);
+ d_borderWidth = MusEUtil::qwtMax(bw, 0);
resize(size());
repaint();
}
@@ -565,3 +573,4 @@ void Knob::setMarkerColor(const QColor c)
repaint();
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/knob.h b/muse2/muse/widgets/knob.h
index 2a553c4e..a629f158 100644
--- a/muse2/muse/widgets/knob.h
+++ b/muse2/muse/widgets/knob.h
@@ -1,3 +1,26 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/knob.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+// (C) Copyright 2011 Orcan Ogetbil (ogetbilo at sf.net) completely redesigned.
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef QWT_KNOB_H
#define QWT_KNOB_H
@@ -7,6 +30,7 @@
#include <QResizeEvent>
#include <QPaintEvent>
+namespace MusEWidget {
//---------------------------------------------------------
// Knob
@@ -80,5 +104,6 @@ class Knob : public SliderBase, public ScaleIf
void setMarkerColor(const QColor c);
};
+} // namespace MusEWidget
#endif
diff --git a/muse2/muse/widgets/lcombo.cpp b/muse2/muse/widgets/lcombo.cpp
index e4bdf00c..ca17e5e3 100644
--- a/muse2/muse/widgets/lcombo.cpp
+++ b/muse2/muse/widgets/lcombo.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: lcombo.cpp,v 1.1.1.1.2.3 2009/07/01 22:14:56 spamatica Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "lcombo.h"
@@ -10,6 +25,7 @@
#include <QHBoxLayout>
#include <QLabel>
+namespace MusEWidget {
//---------------------------------------------------------
// LabelCombo
@@ -49,3 +65,5 @@ void LabelCombo::setCurrentIndex(int i)
if(box->currentIndex() != r)
box->setCurrentIndex(r);
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/lcombo.h b/muse2/muse/widgets/lcombo.h
index 760d4512..f500dc60 100644
--- a/muse2/muse/widgets/lcombo.h
+++ b/muse2/muse/widgets/lcombo.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: lcombo.h,v 1.1.1.1.2.3 2009/07/01 22:14:56 spamatica Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __LCOMBO_H__
@@ -14,6 +29,7 @@
class QString;
+namespace MusEWidget {
//---------------------------------------------------------
// LabelCombo
@@ -41,4 +57,6 @@ class LabelCombo : public QWidget {
void setFocusPolicy ( Qt::FocusPolicy fp ) { box->setFocusPolicy(fp); }
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/menutitleitem.cpp b/muse2/muse/widgets/menutitleitem.cpp
index 8769eb02..c15c8c64 100644
--- a/muse2/muse/widgets/menutitleitem.cpp
+++ b/muse2/muse/widgets/menutitleitem.cpp
@@ -3,8 +3,10 @@
// Linux Music Editor
// (C) Copyright 1999-2001 Werner Schweer (ws@seh.de)
//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// 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; 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
@@ -13,13 +15,15 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include <QLabel>
#include "menutitleitem.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// MenuTitleItem
//---------------------------------------------------------
@@ -46,3 +50,4 @@ QWidget* MenuTitleItem::createWidget(QWidget *parent)
return l;
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/menutitleitem.h b/muse2/muse/widgets/menutitleitem.h
index 20583bd1..98573c72 100644
--- a/muse2/muse/widgets/menutitleitem.h
+++ b/muse2/muse/widgets/menutitleitem.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: menutitleitem.h,v 1.1.2.1 2009/06/10 00:34:59 terminator356 Exp $
// (C) Copyright 1999-2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MENU_TITLE_ITEM_H__
@@ -10,6 +25,8 @@
#include <QWidgetAction>
+namespace MusEWidget {
+
//---------------------------------------------------------
// MenuTitleItem
//---------------------------------------------------------
@@ -26,4 +43,5 @@ class MenuTitleItem : public QWidgetAction {
QWidget* createWidget(QWidget* /*parent*/);
};
+} // namespace MusEWidget
#endif
diff --git a/muse2/muse/widgets/meter.cpp b/muse2/muse/widgets/meter.cpp
index 9f13059e..f4d907d1 100644
--- a/muse2/muse/widgets/meter.cpp
+++ b/muse2/muse/widgets/meter.cpp
@@ -5,6 +5,22 @@
// redesigned by oget on 2011/08/15
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Orcan Ogetbil (ogetbilo at sf.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
@@ -17,6 +33,8 @@
#include "gconfig.h"
#include "fastlog.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// Meter
//---------------------------------------------------------
@@ -36,7 +54,7 @@ Meter::Meter(QWidget* parent, MeterType type)
overflow = false;
val = 0.0;
maxVal = 0.0;
- minScale = mtype == DBMeter ? config.minMeter : 0.0; // min value in dB or int
+ minScale = mtype == DBMeter ? MusEConfig::config.minMeter : 0.0; // min value in dB or int
maxScale = mtype == DBMeter ? 10.0 : 127.0;
yellowScale = -10;
redScale = 0;
@@ -158,7 +176,7 @@ void Meter::setRange(double min, double max)
// paintEvent
//---------------------------------------------------------
-void Meter::paintEvent(QPaintEvent* ev)
+void Meter::paintEvent(QPaintEvent* /*ev*/)
{
// TODO: Could make better use of event rectangle, for speed.
@@ -166,15 +184,17 @@ void Meter::paintEvent(QPaintEvent* ev)
//p.setRenderHint(QPainter::Antialiasing);
double range = maxScale - minScale;
- /*
+
int fw = frameWidth();
int w = width() - 2*fw;
int h = height() - 2*fw;
- */
-
+
+ // FIXME (Orcan): With the event rectangle we get corruption when we toggle the mono/stereo switch. Why?
+ /*
QRect rect = ev->rect();
int w = rect.width();
int h = rect.height();
+ */
int yv;
if(mtype == DBMeter)
@@ -339,3 +359,4 @@ void Meter::mousePressEvent(QMouseEvent*)
emit mousePress();
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/meter.h b/muse2/muse/widgets/meter.h
index 848ae855..62ad3fe0 100644
--- a/muse2/muse/widgets/meter.h
+++ b/muse2/muse/widgets/meter.h
@@ -5,6 +5,22 @@
// redesigned by oget on 2011/08/15
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Orcan Ogetbil (ogetbilo at sf.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __METER_H__
@@ -16,6 +32,7 @@ class QResizeEvent;
class QMouseEvent;
class QPainter;
+namespace MusEWidget {
class Meter : public QFrame {
Q_OBJECT
@@ -81,5 +98,8 @@ class Meter : public QFrame {
Meter(QWidget* parent, MeterType type = DBMeter);
void setRange(double min, double max);
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/metronome.cpp b/muse2/muse/widgets/metronome.cpp
index 08c8abac..e639df81 100644
--- a/muse2/muse/widgets/metronome.cpp
+++ b/muse2/muse/widgets/metronome.cpp
@@ -4,6 +4,21 @@
// $Id: metronome.cpp,v 1.2.2.1 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -15,6 +30,8 @@
#include "track.h"
#include "audio.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// MetronomeConfig
//---------------------------------------------------------
@@ -31,15 +48,15 @@ MetronomeConfig::MetronomeConfig(QDialog* parent)
connect(audioBeepRoutesButton, SIGNAL(clicked()), SLOT(audioBeepRoutesClicked()));
connect(volumeSlider, SIGNAL(valueChanged(int)), SLOT(beepVolumeChanged(int)));
- measureNote->setValue(measureClickNote);
- measureVelocity->setValue(measureClickVelo);
- beatNote->setValue(beatClickNote);
- beatVelocity->setValue(beatClickVelo);
- midiChannel->setValue(clickChan+1);
- midiPort->setValue(clickPort+1);
+ measureNote->setValue(MusEGlobal::measureClickNote);
+ measureVelocity->setValue(MusEGlobal::measureClickVelo);
+ beatNote->setValue(MusEGlobal::beatClickNote);
+ beatVelocity->setValue(MusEGlobal::beatClickVelo);
+ midiChannel->setValue(MusEGlobal::clickChan+1);
+ midiPort->setValue(MusEGlobal::clickPort+1);
/*
- precountBars->setValue(preMeasures);
+ precountBars->setValue(MusEGlobal::preMeasures);
precountEnable->setChecked(precountEnableFlag);
precountFromMastertrack->setChecked(precountFromMastertrackFlag);
precountSigZ->setValue(::precountSigZ);
@@ -48,8 +65,8 @@ MetronomeConfig::MetronomeConfig(QDialog* parent)
precountPreroll->setChecked(::precountPreroll);
*/
- midiClick->setChecked(midiClickFlag);
- audioBeep->setChecked(audioClickFlag);
+ midiClick->setChecked(MusEGlobal::midiClickFlag);
+ audioBeep->setChecked(MusEGlobal::audioClickFlag);
}
//---------------------------------------------------------
@@ -115,13 +132,13 @@ void MetronomeConfig::accept()
void MetronomeConfig::apply()
{
- measureClickNote = measureNote->value();
- measureClickVelo = measureVelocity->value();
- beatClickNote = beatNote->value();
- beatClickVelo = beatVelocity->value();
- clickChan = midiChannel->value() - 1;
- clickPort = midiPort->value() - 1;
- preMeasures = precountBars->value();
+ MusEGlobal::measureClickNote = measureNote->value();
+ MusEGlobal::measureClickVelo = measureVelocity->value();
+ MusEGlobal::beatClickNote = beatNote->value();
+ MusEGlobal::beatClickVelo = beatVelocity->value();
+ MusEGlobal::clickChan = midiChannel->value() - 1;
+ MusEGlobal::clickPort = midiPort->value() - 1;
+ MusEGlobal::preMeasures = precountBars->value();
/*
precountEnableFlag = precountEnable->isChecked();
precountFromMastertrackFlag = precountFromMastertrack->isChecked();
@@ -130,8 +147,8 @@ void MetronomeConfig::apply()
::precountPrerecord = precountPrerecord->isChecked();
::precountPreroll = precountPreroll->isChecked();
*/
- midiClickFlag = midiClick->isChecked();
- audioClickFlag = audioBeep->isChecked();
+ MusEGlobal::midiClickFlag = midiClick->isChecked();
+ MusEGlobal::audioClickFlag = audioBeep->isChecked();
//audioVolumeChanged = volumeSlider->value();
}
@@ -179,5 +196,8 @@ void MetronomeConfig::precountFromMastertrackChanged(bool /*flag*/)
void MetronomeConfig::beepVolumeChanged(int volume)
{
// this value is directly applied, not using th Apply button, it just seems more usable this way.
- audioClickVolume=volume/100.0;
+ MusEGlobal::audioClickVolume=volume/100.0;
}
+
+} // namespace MusEWidget
+
diff --git a/muse2/muse/widgets/metronome.h b/muse2/muse/widgets/metronome.h
index 976dfcd0..62edcdc5 100644
--- a/muse2/muse/widgets/metronome.h
+++ b/muse2/muse/widgets/metronome.h
@@ -4,6 +4,21 @@
// $Id: metronome.h,v 1.1.1.1.2.1 2009/12/20 05:00:35 terminator356 Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __METRONOME_H__
@@ -13,6 +28,8 @@
class QDialog;
+namespace MusEWidget {
+
//---------------------------------------------------------
// MetronomeConfig
//---------------------------------------------------------
@@ -33,4 +50,7 @@ class MetronomeConfig : public QDialog, public Ui::MetronomeConfigBase {
public:
MetronomeConfig(QDialog* parent=0);
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/midisyncimpl.cpp b/muse2/muse/widgets/midisyncimpl.cpp
index 07527973..3829ca43 100644
--- a/muse2/muse/widgets/midisyncimpl.cpp
+++ b/muse2/muse/widgets/midisyncimpl.cpp
@@ -4,6 +4,21 @@
// $Id: midisyncimpl.cpp,v 1.1.1.1.2.4 2009/05/03 04:14:01 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QCloseEvent>
@@ -26,6 +41,8 @@
#include "driver/audiodev.h"
#include "audio.h"
+namespace MusEWidget {
+
enum { DEVCOL_NO = 0, DEVCOL_NAME, DEVCOL_IN, DEVCOL_TICKIN, DEVCOL_MRTIN, DEVCOL_MMCIN, DEVCOL_MTCIN, DEVCOL_MTCTYPE,
DEVCOL_RID, DEVCOL_RCLK, DEVCOL_RMRT, DEVCOL_RMMC, DEVCOL_RMTC, DEVCOL_RREWSTART,
DEVCOL_TID, DEVCOL_TCLK, DEVCOL_TMRT, DEVCOL_TMMC, DEVCOL_TMTC, /* DEVCOL_TREWSTART, */ };
@@ -296,7 +313,7 @@ MidiSyncConfig::MidiSyncConfig(QWidget* parent)
// Done in show().
//connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
- //connect(heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
+ //connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
//inHeartBeat = false;
}
@@ -646,7 +663,7 @@ void MidiSyncConfig::show()
{
songChanged(-1);
connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
- connect(heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
+ connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
QDialog::show();
}
@@ -673,7 +690,7 @@ void MidiSyncConfig::closeEvent(QCloseEvent* e)
apply();
}
- disconnect(heartBeatTimer, SIGNAL(timeout()), this, SLOT(heartBeat()));
+ disconnect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), this, SLOT(heartBeat()));
disconnect(song, SIGNAL(songChanged(int)), this, SLOT(songChanged(int)));
e->accept();
@@ -1249,3 +1266,4 @@ void MidiSyncConfig::setDirty()
applyButton->setEnabled(true);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/midisyncimpl.h b/muse2/muse/widgets/midisyncimpl.h
index 9b133af2..50df186e 100644
--- a/muse2/muse/widgets/midisyncimpl.h
+++ b/muse2/muse/widgets/midisyncimpl.h
@@ -4,6 +4,21 @@
// $Id: midisyncimpl.h,v 1.1.1.1.2.3 2009/05/03 04:14:01 terminator356 Exp $
//
// (C) Copyright 1999/2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIDISYNCIMPL_H__
@@ -16,6 +31,8 @@ class QCloseEvent;
class QDialog;
class QTreeWidgetItem;
+namespace MusEWidget {
+
//----------------------------------------------------------
// MidiSyncLViewItem
//----------------------------------------------------------
@@ -112,5 +129,7 @@ class MidiSyncConfig : public QDialog, public Ui::MidiSyncConfigBase {
void setDirty();
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/mittransposebase.ui b/muse2/muse/widgets/mittransposebase.ui
index b29e34ed..06a18029 100644
--- a/muse2/muse/widgets/mittransposebase.ui
+++ b/muse2/muse/widgets/mittransposebase.ui
@@ -44,7 +44,7 @@
</widget>
</item>
<item>
- <widget class="PitchEdit" name="triggerKeySpinBox" native="true"/>
+ <widget class="MusEWidget::PitchEdit" name="triggerKeySpinBox" native="true"/>
</item>
<item>
<widget class="QLabel" name="TextLabel2">
@@ -101,7 +101,7 @@
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
- <class>PitchEdit</class>
+ <class>MusEWidget::PitchEdit</class>
<extends>QWidget</extends>
<header>pitchedit.h</header>
</customwidget>
diff --git a/muse2/muse/widgets/mixdowndialog.cpp b/muse2/muse/widgets/mixdowndialog.cpp
index 8ab26859..01c1d049 100644
--- a/muse2/muse/widgets/mixdowndialog.cpp
+++ b/muse2/muse/widgets/mixdowndialog.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: mixdowndialog.cpp,v 1.1.1.1 2003/10/27 18:55:02 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QFileDialog>
@@ -18,13 +33,15 @@
SndFile* getSndFile(const SndFile* sf, QWidget* parent)
{
- MixdownFileDialog* dialog = new MixdownFileDialog(sf, parent);
+ MusEWidget::MixdownFileDialog* dialog = new MusEWidget::MixdownFileDialog(sf, parent);
dialog->exec();
SndFile* sndFile = dialog->sndFile();
delete dialog;
return sndFile;
}
+namespace MusEWidget {
+
//---------------------------------------------------------
// MixdownFileDialog
//---------------------------------------------------------
@@ -84,7 +101,7 @@ void MixdownFileDialog::accept()
if (path.right(4) != ".wav")
path += ".wav";
sf = new SndFile(path);
- sf->setFormat(format, channel, sampleRate);
+ sf->setFormat(format, channel, MusEGlobal::sampleRate);
done(1);
}
@@ -103,3 +120,4 @@ void MixdownFileDialog::fdialog()
editPath->setText(path);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/mixdowndialog.h b/muse2/muse/widgets/mixdowndialog.h
index 750acd28..cca60178 100644
--- a/muse2/muse/widgets/mixdowndialog.h
+++ b/muse2/muse/widgets/mixdowndialog.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: mixdowndialog.h,v 1.1.1.1 2003/10/27 18:54:28 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MIXDOWNDIALOG_H__
@@ -16,6 +31,8 @@ class SndFile;
extern SndFile* getSndFile(const SndFile* sf, QWidget* parent);
+namespace MusEWidget {
+
//---------------------------------------------------------
// MixdownFileDialog
//---------------------------------------------------------
@@ -34,5 +51,7 @@ class MixdownFileDialog : public QDialog, public Ui::MixdownFileDialogBase {
SndFile* sndFile() { return sf; }
};
+}
+
#endif
diff --git a/muse2/muse/widgets/mlabel.cpp b/muse2/muse/widgets/mlabel.cpp
index 2b9526d4..071427b6 100644
--- a/muse2/muse/widgets/mlabel.cpp
+++ b/muse2/muse/widgets/mlabel.cpp
@@ -3,13 +3,30 @@
// Linux Music Editor
// $Id: mlabel.cpp,v 1.1.1.1 2003/10/27 18:55:03 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "mlabel.h"
+namespace MusEWidget {
void MLabel::mousePressEvent(QMouseEvent*)
{
emit mousePressed();
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/mlabel.h b/muse2/muse/widgets/mlabel.h
index 01bfa788..64a52220 100644
--- a/muse2/muse/widgets/mlabel.h
+++ b/muse2/muse/widgets/mlabel.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: mlabel.h,v 1.1.1.1 2003/10/27 18:55:03 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MLABEL_H__
@@ -10,6 +25,8 @@
#include <QLabel>
+namespace MusEWidget {
+
//---------------------------------------------------------
// MLabel
// label widged which sends signal mousePressed
@@ -33,5 +50,8 @@ class MLabel : public QLabel {
MLabel(QWidget* parent, const char* name = 0)
: QLabel(parent) {setObjectName(name);};
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/mmath.cpp b/muse2/muse/widgets/mmath.cpp
index acc8e25a..52dffea2 100644
--- a/muse2/muse/widgets/mmath.cpp
+++ b/muse2/muse/widgets/mmath.cpp
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/mmath.cpp $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#include <cmath>
#include "mmath.h"
@@ -24,6 +46,7 @@
// qwtInt -- Return nearest integer
// qwtLim -- Limit a values
+namespace MusEUtil {
//------------------------------------------------------------
//.F qwtGetMin
@@ -298,3 +321,5 @@ void qwtLogSpace(double *array, int size, double xmin, double xmax)
array[i] = exp(lxmin + double(i) * lstep);
}
+
+} // namespace MusEUtil
diff --git a/muse2/muse/widgets/mmath.h b/muse2/muse/widgets/mmath.h
index 51381047..813aed93 100644
--- a/muse2/muse/widgets/mmath.h
+++ b/muse2/muse/widgets/mmath.h
@@ -4,6 +4,21 @@
// $Id: mmath.h,v 1.1.1.1 2003/10/27 18:54:47 wschweer Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MATH_H__
@@ -12,6 +27,8 @@
#define LOG_MIN 1.0e-100
#define LOG_MAX 1.0e100
+namespace MusEUtil {
+
double qwtCeil125(double x);
double qwtFloor125(double x);
void qwtTwistArray(double *array, int size);
@@ -73,5 +90,7 @@ T qwtLim(const T& x, const T& x1, const T& x2)
return rv;
}
+}
+
#endif
diff --git a/muse2/muse/widgets/moc_ttoolbar.cpp b/muse2/muse/widgets/moc_ttoolbar.cpp
index e69de29b..63787863 100644
--- a/muse2/muse/widgets/moc_ttoolbar.cpp
+++ b/muse2/muse/widgets/moc_ttoolbar.cpp
@@ -0,0 +1,22 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/moc_ttoolbar.cpp $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
diff --git a/muse2/muse/widgets/mtrackinfo.cpp b/muse2/muse/widgets/mtrackinfo.cpp
index c5cdac0b..e4c4e217 100644
--- a/muse2/muse/widgets/mtrackinfo.cpp
+++ b/muse2/muse/widgets/mtrackinfo.cpp
@@ -2,6 +2,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2010 Werner Schweer and others (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QTimer>
@@ -28,6 +43,8 @@
#include "popupmenu.h"
#include "routepopup.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// setTrack
//---------------------------------------------------------
@@ -46,10 +63,10 @@ void MidiTrackInfo::setTrack(Track* t)
QPalette pal;
if(selected->type() == Track::DRUM) {
- pal.setColor(trackNameLabel->backgroundRole(), config.drumTrackLabelBg);
+ pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.drumTrackLabelBg);
iOutputChannel->setEnabled(false);
} else {
- pal.setColor(trackNameLabel->backgroundRole(), config.midiTrackLabelBg);
+ pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.midiTrackLabelBg);
iOutputChannel->setEnabled(true);
}
trackNameLabel->setPalette(pal);
@@ -75,7 +92,7 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent
pan = -65;
volume = -1;
- setFont(config.fonts[2]);
+ setFont(MusEConfig::config.fonts[2]);
//iChanDetectLabel->setPixmap(*darkgreendotIcon);
iChanDetectLabel->setPixmap(*darkRedLedIcon);
@@ -100,14 +117,14 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent
QPalette pal;
//pal.setColor(trackNameLabel->backgroundRole(), QColor(0, 160, 255)); // Med blue
if(selected->type() == Track::DRUM)
- pal.setColor(trackNameLabel->backgroundRole(), config.drumTrackLabelBg);
+ pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.drumTrackLabelBg);
else
- pal.setColor(trackNameLabel->backgroundRole(), config.midiTrackLabelBg);
+ pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.midiTrackLabelBg);
trackNameLabel->setPalette(pal);
}
//else
//{
- // pal.setColor(trackNameLabel->backgroundRole(), config.midiTrackLabelBg);
+ // pal.setColor(trackNameLabel->backgroundRole(), MusEConfig::config.midiTrackLabelBg);
// trackNameLabel->setPalette(pal);
//}
@@ -165,9 +182,9 @@ MidiTrackInfo::MidiTrackInfo(QWidget* parent, Track* sel_track) : QWidget(parent
connect(oRButton, SIGNAL(pressed()), SLOT(outRoutesPressed()));
connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int)));
- connect(muse, SIGNAL(configChanged()), SLOT(configChanged()));
+ connect(MusEGlobal::muse, SIGNAL(configChanged()), SLOT(configChanged()));
- connect(heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
+ connect(MusEGlobal::heartBeatTimer, SIGNAL(timeout()), SLOT(heartBeat()));
}
//---------------------------------------------------------
@@ -487,15 +504,15 @@ void MidiTrackInfo::configChanged()
{
//printf("MidiTrackInfo::configChanged\n");
- //if (config.canvasBgPixmap.isEmpty()) {
- // canvas->setBg(config.partCanvasBg);
+ //if (MusEConfig::config.canvasBgPixmap.isEmpty()) {
+ // canvas->setBg(MusEConfig::config.partCanvasBg);
// canvas->setBg(QPixmap());
//}
//else {
- // canvas->setBg(QPixmap(config.canvasBgPixmap));
+ // canvas->setBg(QPixmap(MusEConfig::config.canvasBgPixmap));
//}
- setFont(config.fonts[2]);
+ setFont(MusEConfig::config.fonts[2]);
//updateTrackInfo(type);
}
@@ -540,9 +557,9 @@ void MidiTrackInfo::setLabelFont()
// Use the new font #6 I created just for these labels (so far).
// Set the label's font.
- trackNameLabel->setFont(config.fonts[6]);
+ trackNameLabel->setFont(MusEConfig::config.fonts[6]);
// Dealing with a horizontally constrained label. Ignore vertical. Use a minimum readable point size.
- autoAdjustFontSize(trackNameLabel, trackNameLabel->text(), false, true, config.fonts[6].pointSize(), 5);
+ MusEUtil::autoAdjustFontSize(trackNameLabel, trackNameLabel->text(), false, true, MusEConfig::config.fonts[6].pointSize(), 5);
}
//---------------------------------------------------------
@@ -607,7 +624,7 @@ void MidiTrackInfo::inRoutesPressed()
if(!selected->isMidiTrack())
return;
- RoutePopupMenu* pup = muse->getRoutingPopupMenu();
+ RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu();
iRButton->setDown(false);
pup->exec(QCursor::pos(), selected, false);
}
@@ -623,7 +640,7 @@ void MidiTrackInfo::outRoutesPressed()
if(!selected->isMidiTrack())
return;
- RoutePopupMenu* pup = muse->getRoutingPopupMenu();
+ RoutePopupMenu* pup = MusEGlobal::muse->getRoutingPopupMenu();
oRButton->setDown(false);
pup->exec(QCursor::pos(), selected, true);
}
@@ -1549,3 +1566,4 @@ void MidiTrackInfo::recordClicked()
}
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/mtrackinfo.h b/muse2/muse/widgets/mtrackinfo.h
index 20fd3a69..42be1f58 100644
--- a/muse2/muse/widgets/mtrackinfo.h
+++ b/muse2/muse/widgets/mtrackinfo.h
@@ -2,6 +2,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2010 Werner Schweer and others (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MTRACKINFO_H__
@@ -11,6 +26,8 @@
class Track;
+namespace MusEWidget {
+
//---------------------------------------------------------
// MidiTrackInfo
//---------------------------------------------------------
@@ -65,7 +82,7 @@ class MidiTrackInfo : public QWidget, public Ui::MidiTrackInfoBase
void updateTrackInfo(int);
};
-
+} // namespace MusEWidget
#endif
diff --git a/muse2/muse/widgets/mtrackinfobase.ui b/muse2/muse/widgets/mtrackinfobase.ui
index 53e772c8..99c06ad0 100644
--- a/muse2/muse/widgets/mtrackinfobase.ui
+++ b/muse2/muse/widgets/mtrackinfobase.ui
@@ -86,7 +86,7 @@
</widget>
</item>
<item row="2" column="0">
- <widget class="SpinBox" name="iOutputChannel">
+ <widget class="MusEWidget::SpinBox" name="iOutputChannel">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -247,7 +247,7 @@
</layout>
</item>
<item row="4" column="0">
- <widget class="SpinBox" name="iTransp">
+ <widget class="MusEWidget::SpinBox" name="iTransp">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -291,7 +291,7 @@
</widget>
</item>
<item row="5" column="0">
- <widget class="SpinBox" name="iVerz">
+ <widget class="MusEWidget::SpinBox" name="iVerz">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -332,7 +332,7 @@
</widget>
</item>
<item row="6" column="0">
- <widget class="SpinBox" name="iLen">
+ <widget class="MusEWidget::SpinBox" name="iLen">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -376,7 +376,7 @@
</widget>
</item>
<item row="7" column="0">
- <widget class="SpinBox" name="iAnschl">
+ <widget class="MusEWidget::SpinBox" name="iAnschl">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -423,7 +423,7 @@
</widget>
</item>
<item row="8" column="0">
- <widget class="SpinBox" name="iKompr">
+ <widget class="MusEWidget::SpinBox" name="iKompr">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -575,7 +575,7 @@
</layout>
</item>
<item row="12" column="0">
- <widget class="SpinBox" name="iHBank">
+ <widget class="MusEWidget::SpinBox" name="iHBank">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -628,7 +628,7 @@
</widget>
</item>
<item row="13" column="0">
- <widget class="SpinBox" name="iLBank">
+ <widget class="MusEWidget::SpinBox" name="iLBank">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -681,7 +681,7 @@
</widget>
</item>
<item row="14" column="0">
- <widget class="SpinBox" name="iProgram">
+ <widget class="MusEWidget::SpinBox" name="iProgram">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -748,7 +748,7 @@
</layout>
</item>
<item row="15" column="0">
- <widget class="SpinBox" name="iLautst">
+ <widget class="MusEWidget::SpinBox" name="iLautst">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -815,7 +815,7 @@
</layout>
</item>
<item row="16" column="0">
- <widget class="SpinBox" name="iPan">
+ <widget class="MusEWidget::SpinBox" name="iPan">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -905,7 +905,7 @@
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
- <class>SpinBox</class>
+ <class>MusEWidget::SpinBox</class>
<extends>QSpinBox</extends>
<header location="global">spinbox.h</header>
</customwidget>
diff --git a/muse2/muse/widgets/mtscale.cpp b/muse2/muse/widgets/mtscale.cpp
index 624c83d4..1bd34de3 100644
--- a/muse2/muse/widgets/mtscale.cpp
+++ b/muse2/muse/widgets/mtscale.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: mtscale.cpp,v 1.8.2.7 2009/05/03 04:14:01 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <values.h>
@@ -15,6 +30,8 @@
#include "icons.h"
#include "gconfig.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// MTScale
// Midi Time Scale
@@ -215,7 +232,7 @@ void MTScale::pdraw(QPainter& p, const QRect& r)
int y = 12;
p.setPen(Qt::black);
- p.setFont(config.fonts[4]);
+ p.setFont(MusEConfig::config.fonts[4]);
p.drawLine(r.x(), y+1, r.x() + r.width(), y+1);
QRect tr(r);
tr.setHeight(12);
@@ -376,7 +393,7 @@ void MTScale::pdraw(QPainter& p, const QRect& r)
n = 32;
if (bar % n)
continue;
- p.setFont(config.fonts[3]);
+ p.setFont(MusEConfig::config.fonts[3]);
int x = mapx(waveMode ? b : stick);
QString s;
s.setNum(bar + 1);
@@ -400,12 +417,12 @@ void MTScale::pdraw(QPainter& p, const QRect& r)
if (beat == 0) {
num = bar + 1;
y1 = y + 1;
- p.setFont(config.fonts[3]);
+ p.setFont(MusEConfig::config.fonts[3]);
}
else {
num = beat + 1;
y1 = y + 7;
- p.setFont(config.fonts[1]);
+ p.setFont(MusEConfig::config.fonts[1]);
r.setY(y+3);
}
s.setNum(num);
@@ -416,3 +433,4 @@ void MTScale::pdraw(QPainter& p, const QRect& r)
}
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/mtscale.h b/muse2/muse/widgets/mtscale.h
index 7c53d4ff..820e33c6 100644
--- a/muse2/muse/widgets/mtscale.h
+++ b/muse2/muse/widgets/mtscale.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: mtscale.h,v 1.3 2004/04/27 22:27:06 spamatica Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MTSCALE_H__
@@ -11,6 +26,8 @@
#include "view.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// MTScale
// scale for midi track
@@ -45,5 +62,8 @@ class MTScale : public View {
MTScale(int* raster, QWidget* parent, int xscale, bool f = false);
void setBarLocator(bool f) { barLocator = f; }
};
+
+}
+
#endif
diff --git a/muse2/muse/widgets/mtscale_flo.cpp b/muse2/muse/widgets/mtscale_flo.cpp
index e18a7d11..50abf75d 100644
--- a/muse2/muse/widgets/mtscale_flo.cpp
+++ b/muse2/muse/widgets/mtscale_flo.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: mtscale_flo.cpp,v 1.8.2.7 2011/05/19 04:14:01 flo Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <values.h>
@@ -16,6 +31,8 @@
#include "gconfig.h"
#include "scoreedit.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// MTScale
// Midi Time Scale
@@ -171,7 +188,7 @@ void MTScaleFlo::draw(QPainter& p, const QRect& r)
int y = 12;
p.setPen(Qt::black);
- p.setFont(config.fonts[4]);
+ p.setFont(MusEConfig::config.fonts[4]);
p.drawLine(r.x(), y+1, r.x() + r.width(), y+1);
QRect tr(r);
tr.setHeight(12);
@@ -270,7 +287,7 @@ void MTScaleFlo::draw(QPainter& p, const QRect& r)
n = 32;
if (bar % n)
continue;
- p.setFont(config.fonts[3]);
+ p.setFont(MusEConfig::config.fonts[3]);
int x = parent->tick_to_x(stick) + xoffset - xpos;
QString s;
s.setNum(bar + 1);
@@ -291,12 +308,12 @@ void MTScaleFlo::draw(QPainter& p, const QRect& r)
if (beat == 0) {
num = bar + 1;
y1 = y + 1;
- p.setFont(config.fonts[3]);
+ p.setFont(MusEConfig::config.fonts[3]);
}
else {
num = beat + 1;
y1 = y + 7;
- p.setFont(config.fonts[1]);
+ p.setFont(MusEConfig::config.fonts[1]);
r.setY(y+3);
}
s.setNum(num);
@@ -323,3 +340,5 @@ void MTScaleFlo::pos_add_changed()
{
redraw();
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/mtscale_flo.h b/muse2/muse/widgets/mtscale_flo.h
index b7856207..b7169ab6 100644
--- a/muse2/muse/widgets/mtscale_flo.h
+++ b/muse2/muse/widgets/mtscale_flo.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: mtscale_flo.h,v 1.3 2011/05/19 22:27:06 flo Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MTSCALE_FLO_H__
@@ -13,6 +28,8 @@
class ScoreCanvas;
+namespace MusEWidget {
+
//---------------------------------------------------------
// MTScaleFlo
// scale for midi track
@@ -47,5 +64,8 @@ class MTScaleFlo : public View {
public:
MTScaleFlo(ScoreCanvas* parent_editor, QWidget* parent_widget);
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/musewidgetsplug.cpp b/muse2/muse/widgets/musewidgetsplug.cpp
index 993b0fb8..7141fe4e 100644
--- a/muse2/muse/widgets/musewidgetsplug.cpp
+++ b/muse2/muse/widgets/musewidgetsplug.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: musewidgetsplug.cpp,v 1.9.2.9 2009/12/01 03:52:40 terminator356 Exp $
// (C) Copyright 2001-2003 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
// this file makes some of the MusE widgets available
diff --git a/muse2/muse/widgets/nentry.cpp b/muse2/muse/widgets/nentry.cpp
index 77710e5a..13569b0d 100644
--- a/muse2/muse/widgets/nentry.cpp
+++ b/muse2/muse/widgets/nentry.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: nentry.cpp,v 1.1.1.1.2.1 2008/05/21 00:28:54 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QApplication>
@@ -21,6 +36,8 @@
#define TIMEC2 20
#define TIMER4 50
+namespace MusEWidget {
+
NentryFilter::NentryFilter(QObject* parent)
: QObject(parent)
{
@@ -399,3 +416,4 @@ bool Nentry::keyPress(QKeyEvent* event)
return true;
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/nentry.h b/muse2/muse/widgets/nentry.h
index 48343b4a..c0508c63 100644
--- a/muse2/muse/widgets/nentry.h
+++ b/muse2/muse/widgets/nentry.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: nentry.h,v 1.1.1.1.2.2 2008/05/21 00:28:54 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __NENTRY_H__
@@ -15,6 +30,8 @@ class QLabel;
class QLineEdit;
class QTimer;
+namespace MusEWidget {
+
class NentryFilter : public QObject {
Q_OBJECT
@@ -81,4 +98,7 @@ class Nentry : public QFrame {
void setFocusPolicy(Qt::FocusPolicy);
bool contextMenu(QContextMenuEvent*);
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/noteinfo.cpp b/muse2/muse/widgets/noteinfo.cpp
index f6d40857..2a262723 100644
--- a/muse2/muse/widgets/noteinfo.cpp
+++ b/muse2/muse/widgets/noteinfo.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: noteinfo.cpp,v 1.4.2.1 2008/08/18 00:15:26 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QLabel>
@@ -16,6 +31,8 @@
///#include "posedit.h"
#include "pitchedit.h"
+namespace MusEWidget {
+
//---------------------------------------------------
// NoteInfo
// ToolBar
@@ -209,3 +226,4 @@ void NoteInfo::timeChanged(const Pos& pos)
emit valueChanged(VAL_TIME, pos.tick());
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/noteinfo.h b/muse2/muse/widgets/noteinfo.h
index 64842988..6ca34a42 100644
--- a/muse2/muse/widgets/noteinfo.h
+++ b/muse2/muse/widgets/noteinfo.h
@@ -2,6 +2,21 @@
// Linux Music Editor
// $Id: noteinfo.h,v 1.3 2004/01/09 17:12:54 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __NOTE_INFO_H__
@@ -17,9 +32,12 @@ namespace Awl {
class QSpinBox;
///class PosEdit;
-class PitchEdit;
class Pos;
+namespace MusEWidget {
+
+class PitchEdit;
+
//---------------------------------------------------------
// NoteInfo
//---------------------------------------------------------
@@ -57,5 +75,8 @@ class NoteInfo : public QToolBar {
signals:
void valueChanged(NoteInfo::ValType, int);
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/pastedialog.cpp b/muse2/muse/widgets/pastedialog.cpp
index a772e45b..0a6ce463 100644
--- a/muse2/muse/widgets/pastedialog.cpp
+++ b/muse2/muse/widgets/pastedialog.cpp
@@ -10,6 +10,8 @@
#include "xml.h"
#include "gconfig.h"
+using MusEConfig::config;
+
PasteDialog::PasteDialog(QWidget* parent)
: QDialog(parent)
{
diff --git a/muse2/muse/widgets/pitchedit.cpp b/muse2/muse/widgets/pitchedit.cpp
index 563cd6a8..7d637d01 100644
--- a/muse2/muse/widgets/pitchedit.cpp
+++ b/muse2/muse/widgets/pitchedit.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: pitchedit.cpp,v 1.2 2004/01/09 17:12:54 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
#include "pitchedit.h"
#include "helper.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// PitchEdit
//---------------------------------------------------------
@@ -62,3 +79,4 @@ void PitchEdit::setDeltaMode(bool val)
setRange(0, 127);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/pitchedit.h b/muse2/muse/widgets/pitchedit.h
index 8d2c8789..0c334d22 100644
--- a/muse2/muse/widgets/pitchedit.h
+++ b/muse2/muse/widgets/pitchedit.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: pitchedit.h,v 1.2 2004/01/09 17:12:54 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __PITCHEDIT_H__
@@ -10,6 +25,10 @@
#include <QSpinBox>
+extern QString pitch2string(int v);
+
+namespace MusEWidget {
+
//---------------------------------------------------------
// PitchEdit
//---------------------------------------------------------
@@ -28,6 +47,6 @@ class PitchEdit : public QSpinBox {
void setDeltaMode(bool);
};
-extern QString pitch2string(int v);
+} // namespace MusEWidget
#endif
diff --git a/muse2/muse/widgets/pitchlabel.cpp b/muse2/muse/widgets/pitchlabel.cpp
index 91daf09f..b1f062a8 100644
--- a/muse2/muse/widgets/pitchlabel.cpp
+++ b/muse2/muse/widgets/pitchlabel.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: pitchlabel.cpp,v 1.2 2004/05/16 16:55:01 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QApplication>
@@ -12,6 +27,8 @@
#include "pitchlabel.h"
#include "helper.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// PitchLabel
//---------------------------------------------------------
@@ -95,3 +112,4 @@ void PitchLabel::setPitch(int val)
setValue(val);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/pitchlabel.h b/muse2/muse/widgets/pitchlabel.h
index d29a4ee4..3fe2eb42 100644
--- a/muse2/muse/widgets/pitchlabel.h
+++ b/muse2/muse/widgets/pitchlabel.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: pitchlabel.h,v 1.1.1.1 2003/10/27 18:54:49 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __PITCHLABEL_H__
@@ -10,6 +25,8 @@
#include <QLabel>
+namespace MusEWidget {
+
//---------------------------------------------------------
// PitchLabel
//---------------------------------------------------------
@@ -36,6 +53,7 @@ class PitchLabel : public QLabel {
bool pitchMode() const { return _pitchMode; }
};
+} // namespace MusEWidget
#endif
diff --git a/muse2/muse/widgets/popupmenu.cpp b/muse2/muse/widgets/popupmenu.cpp
index adbe7dd6..2b0b6711 100644
--- a/muse2/muse/widgets/popupmenu.cpp
+++ b/muse2/muse/widgets/popupmenu.cpp
@@ -7,6 +7,21 @@
//
// PopupMenu sub-class of QMenu created by Tim.
// (C) Copyright 2010-2011 Tim E. Real (terminator356 A T sourceforge D O T net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
//#include <stdio.h>
@@ -26,6 +41,8 @@
#include "route.h"
+namespace MusEWidget {
+
//======================
// PopupMenu
//======================
@@ -157,7 +174,7 @@ bool PopupMenu::event(QEvent* event)
case QEvent::MouseButtonDblClick:
{
if(_stayOpen)
- //if(_stayOpen && config.popupsDefaultStayOpen)
+ //if(_stayOpen && MusEConfig::config.popupsDefaultStayOpen)
{
QMouseEvent* e = static_cast<QMouseEvent*>(event);
if(e->modifiers() == Qt::NoModifier)
@@ -176,7 +193,7 @@ bool PopupMenu::event(QEvent* event)
case QEvent::KeyPress:
{
if(_stayOpen)
- //if(_stayOpen && config.popupsDefaultStayOpen)
+ //if(_stayOpen && MusEConfig::config.popupsDefaultStayOpen)
{
QKeyEvent* e = static_cast<QKeyEvent*>(event);
if(e->modifiers() == Qt::NoModifier && e->key() == Qt::Key_Space)
@@ -330,7 +347,7 @@ void PopupMenu::mouseReleaseEvent(QMouseEvent *e)
#else
// Check for Ctrl to stay open.
- if(!_stayOpen || (!config.popupsDefaultStayOpen && (e->modifiers() & Qt::ControlModifier) == 0))
+ if(!_stayOpen || (!MusEConfig::config.popupsDefaultStayOpen && (e->modifiers() & Qt::ControlModifier) == 0))
{
QMenu::mouseReleaseEvent(e);
return;
@@ -373,3 +390,4 @@ void PopupView::clear()
}
*/
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/popupmenu.h b/muse2/muse/widgets/popupmenu.h
index e0e7d26f..b51cfd56 100644
--- a/muse2/muse/widgets/popupmenu.h
+++ b/muse2/muse/widgets/popupmenu.h
@@ -7,6 +7,21 @@
//
// PopupMenu sub-class of QMenu created by Tim.
// (C) Copyright 2010-2011 Tim E. Real (terminator356 A T sourceforge D O T net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __POPUPMENU_H__
@@ -32,6 +47,8 @@ class QEvent;
//class QTimer;
//class QStandardItemModel;
+namespace MusEWidget {
+
class PopupMenu : public QMenu
{
Q_OBJECT
@@ -84,6 +101,7 @@ class PopupView : public QColumnView
};
*/
+} // namespace MusEWidget
#endif
diff --git a/muse2/muse/widgets/posedit.cpp b/muse2/muse/widgets/posedit.cpp
index 3accf557..0e031c38 100644
--- a/muse2/muse/widgets/posedit.cpp
+++ b/muse2/muse/widgets/posedit.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: posedit.cpp,v 1.3.2.2 2008/05/21 00:28:54 terminator356 Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <values.h>
@@ -23,6 +38,8 @@
extern int mtcType;
+namespace MusEWidget {
+
//---------------------------------------------------------
// QNumberSection
//---------------------------------------------------------
@@ -852,3 +869,5 @@ void PosEdit::setEnabled(bool v)
QWidget::setEnabled(v);
updateButtons();
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/posedit.h b/muse2/muse/widgets/posedit.h
index e17da3a2..3224a3a6 100644
--- a/muse2/muse/widgets/posedit.h
+++ b/muse2/muse/widgets/posedit.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: posedit.h,v 1.1.1.1.2.1 2004/12/27 19:47:25 lunar_shuttle Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __POSEDIT_H__
@@ -19,6 +34,8 @@ class QTimerEvent;
class PosEditor;
class SpinBox;
+namespace MusEWidget {
+
//---------------------------------------------------------
// PosEdit
//---------------------------------------------------------
@@ -101,4 +118,6 @@ class PosEdit : public QWidget
void enterPressed();
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/poslabel.cpp b/muse2/muse/widgets/poslabel.cpp
index 78903a1f..98a7eba3 100644
--- a/muse2/muse/widgets/poslabel.cpp
+++ b/muse2/muse/widgets/poslabel.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: poslabel.cpp,v 1.2.2.2 2009/04/06 01:24:55 terminator356 Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdlib.h>
@@ -20,6 +35,8 @@
extern int mtcType;
+namespace MusEWidget {
+
//---------------------------------------------------------
// PosLabel
//---------------------------------------------------------
@@ -66,7 +83,7 @@ void PosLabel::updateValue()
{
QString s;
if (_smpte) {
- double time = double(_sampleValue) / double(sampleRate);
+ double time = double(_sampleValue) / double(MusEGlobal::sampleRate);
int min = int(time) / 60;
int sec = int(time) % 60;
double rest = time - (min * 60 + sec);
@@ -154,3 +171,4 @@ void PosLabel::setSmpte(bool val)
updateValue();
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/poslabel.h b/muse2/muse/widgets/poslabel.h
index 7be236ec..38236ac7 100644
--- a/muse2/muse/widgets/poslabel.h
+++ b/muse2/muse/widgets/poslabel.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: poslabel.h,v 1.2 2004/01/11 18:55:37 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __POSLABEL_H__
@@ -10,6 +25,8 @@
#include <QLabel>
+namespace MusEWidget {
+
//---------------------------------------------------------
// PosLabel
//---------------------------------------------------------
@@ -41,6 +58,7 @@ class PosLabel : public QLabel {
bool smpte() const { return _smpte; }
};
+} // namespace MusEWidget
#endif
diff --git a/muse2/muse/widgets/projectcreateimpl.cpp b/muse2/muse/widgets/projectcreateimpl.cpp
index 369e806a..d6f918b3 100644
--- a/muse2/muse/widgets/projectcreateimpl.cpp
+++ b/muse2/muse/widgets/projectcreateimpl.cpp
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/projectcreateimpl.cpp $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#include <stdio.h>
#include <qfiledialog.h>
#include <qdir.h>
@@ -6,12 +28,14 @@
#include "globals.h"
#include "app.h"
+namespace MusEWidget {
+
ProjectCreateImpl::ProjectCreateImpl(QWidget *parent) :
QDialog(parent)
{
setupUi(this);
- createFolderCheckbox->setChecked(config.projectStoreInFolder);
+ createFolderCheckbox->setChecked(MusEConfig::config.projectStoreInFolder);
connect(browseDirButton,SIGNAL(clicked()), this, SLOT(selectDirectory()));
connect(projectNameEdit,SIGNAL(textChanged(QString)), this, SLOT(updateDirectoryPath()));
connect(createFolderCheckbox,SIGNAL(clicked()), this, SLOT(updateDirectoryPath()));
@@ -22,7 +46,7 @@ ProjectCreateImpl::ProjectCreateImpl(QWidget *parent) :
// as of Qt-4.7.1
//commentEdit->setPlaceholderText("<Add information about project here>");
#endif
- directoryPath = config.projectBaseFolder;
+ directoryPath = MusEConfig::config.projectBaseFolder;
updateDirectoryPath();
show();
}
@@ -64,8 +88,10 @@ QString ProjectCreateImpl::getSongInfo()
}
void ProjectCreateImpl::ok()
{
- config.projectStoreInFolder = createFolderCheckbox->isChecked();
- config.projectBaseFolder = directoryPath;
- muse->changeConfig(true);
+ MusEConfig::config.projectStoreInFolder = createFolderCheckbox->isChecked();
+ MusEConfig::config.projectBaseFolder = directoryPath;
+ MusEGlobal::muse->changeConfig(true);
emit accept();
}
+
+} //namespace MusEWidget
diff --git a/muse2/muse/widgets/projectcreateimpl.h b/muse2/muse/widgets/projectcreateimpl.h
index 3ca61e36..d6881840 100644
--- a/muse2/muse/widgets/projectcreateimpl.h
+++ b/muse2/muse/widgets/projectcreateimpl.h
@@ -1,9 +1,33 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/projectcreateimpl.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef PROJECTCREATEIMPL_H
#define PROJECTCREATEIMPL_H
#include <QDialog>
#include "ui_projectcreate.h"
+namespace MusEWidget {
+
class ProjectCreateImpl : public QDialog, Ui::ProjectCreate
{
Q_OBJECT
@@ -23,4 +47,6 @@ public slots:
};
+} // namespace MusEWidget
+
#endif // PROJECTCREATEIMPL_H
diff --git a/muse2/muse/widgets/routepopup.cpp b/muse2/muse/widgets/routepopup.cpp
index 0afbbdb6..ec3f3ea0 100644
--- a/muse2/muse/widgets/routepopup.cpp
+++ b/muse2/muse/widgets/routepopup.cpp
@@ -5,8 +5,10 @@
// RoutePopupMenu.cpp
// (C) Copyright 2011 Tim E. Real (terminator356 A T sourceforge D O T net)
//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// 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; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "app.h"
@@ -32,6 +34,8 @@
#include "menutitleitem.h"
#include "popupmenu.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// addMenuItem
//---------------------------------------------------------
@@ -887,7 +891,7 @@ void RoutePopupMenu::popupActivated(QAction* action)
{
int n = action->data().value<int>();
if(!_isOutMenu && n == 0)
- muse->configMidiPorts();
+ MusEGlobal::muse->configMidiPorts();
return;
}
}
@@ -1217,7 +1221,7 @@ void RoutePopupMenu::prepare()
MenuTitleItem* titel = new MenuTitleItem(QString(buffer), _pup);
_pup->addAction(titel);
- if(!checkAudioDevice())
+ if(!MusEGlobal::checkAudioDevice())
{
_pup->clear();
return;
@@ -1302,7 +1306,7 @@ void RoutePopupMenu::prepare()
MenuTitleItem* titel = new MenuTitleItem(QString(buffer), _pup);
_pup->addAction(titel);
- if(!checkAudioDevice())
+ if(!MusEGlobal::checkAudioDevice())
{
_pup->clear();
return;
@@ -1418,3 +1422,4 @@ void RoutePopupMenu::popup(const QPoint& p, Track* track, bool isOutput)
_pup->popup(p);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/routepopup.h b/muse2/muse/widgets/routepopup.h
index 6772e8ca..7f5a8820 100644
--- a/muse2/muse/widgets/routepopup.h
+++ b/muse2/muse/widgets/routepopup.h
@@ -5,8 +5,10 @@
// RoutePopupMenu.h
// (C) Copyright 2011 Tim E. Real (terminator356 A T sourceforge D O T net)
//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// 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; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#ifndef __ROUTEPOPUPMENU_H__
@@ -25,12 +27,15 @@
class Track;
class AudioTrack;
-class PopupMenu;
class QWidget;
class QString;
class QAction;
class QPoint;
+namespace MusEWidget {
+
+class PopupMenu;
+
class RoutePopupMenu : public QObject
{
Q_OBJECT
@@ -70,4 +75,6 @@ class RoutePopupMenu : public QObject
void popup(const QPoint& p, Track* track = 0, bool isOutput = false);
};
+}
+
#endif
diff --git a/muse2/muse/widgets/scldiv.cpp b/muse2/muse/widgets/scldiv.cpp
index 0a75cbd4..ba19f659 100644
--- a/muse2/muse/widgets/scldiv.cpp
+++ b/muse2/muse/widgets/scldiv.cpp
@@ -4,17 +4,30 @@
// $Id: scldiv.cpp,v 1.1.1.1 2003/10/27 18:54:32 wschweer Exp $
//
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
#include "scldiv.h"
#include "mmath.h"
+namespace MusEWidget {
+
// ScaleDiv - A class for building scale divisions
//
// The ScaleDiv class can build
@@ -71,10 +84,10 @@ static bool limRange(double &val, double v1, double v2, double eps_rel = 0.0,
{
bool rv = TRUE;
- double vmin = qwtMin(v1, v2);
- double vmax = qwtMax(v1, v2);
- double delta_min = qwtMax(qwtAbs(eps_rel * vmin), qwtAbs(eps_abs));
- double delta_max = qwtMax(qwtAbs(eps_rel * vmax), qwtAbs(eps_abs));
+ double vmin = MusEUtil::qwtMin(v1, v2);
+ double vmax = MusEUtil::qwtMax(v1, v2);
+ double delta_min = MusEUtil::qwtMax(MusEUtil::qwtAbs(eps_rel * vmin), MusEUtil::qwtAbs(eps_abs));
+ double delta_max = MusEUtil::qwtMax(MusEUtil::qwtAbs(eps_rel * vmax), MusEUtil::qwtAbs(eps_abs));
if (val < vmin)
{
@@ -220,8 +233,8 @@ bool ScaleDiv::rebuild(double x1, double x2, int maxMajSteps, int maxMinSteps,
int rv;
- d_lBound = qwtMin(x1, x2);
- d_hBound = qwtMax(x1, x2);
+ d_lBound = MusEUtil::qwtMin(x1, x2);
+ d_hBound = MusEUtil::qwtMax(x1, x2);
d_log = log;
if (d_log)
@@ -233,8 +246,8 @@ bool ScaleDiv::rebuild(double x1, double x2, int maxMajSteps, int maxMinSteps,
{
d_lBound = x1;
d_hBound = x2;
- qwtTwistArray(d_majMarks.data(), d_majMarks.size());
- qwtTwistArray(d_minMarks.data(), d_minMarks.size());
+ MusEUtil::qwtTwistArray(d_majMarks.data(), d_majMarks.size());
+ MusEUtil::qwtTwistArray(d_minMarks.data(), d_minMarks.size());
}
return rv;
@@ -280,9 +293,9 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step)
bool rv = TRUE;
// parameter range check
- maxMajSteps = qwtMax(1, maxMajSteps);
- maxMinSteps = qwtMax(0, maxMinSteps);
- step = qwtAbs(step);
+ maxMajSteps = MusEUtil::qwtMax(1, maxMajSteps);
+ maxMinSteps = MusEUtil::qwtMax(0, maxMinSteps);
+ step = MusEUtil::qwtAbs(step);
// reset vectors
d_minMarks.resize(0);
@@ -294,7 +307,7 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step)
// Set up major divisions
//
if (step == 0.0)
- d_majStep = qwtCeil125(qwtAbs(d_hBound - d_lBound) * 0.999999
+ d_majStep = MusEUtil::qwtCeil125(MusEUtil::qwtAbs(d_hBound - d_lBound) * 0.999999
/ double(maxMajSteps));
else
d_majStep = step;
@@ -304,10 +317,10 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step)
firstTick = ceil( (d_lBound - step_eps * d_majStep) / d_majStep) * d_majStep;
lastTick = floor( (d_hBound + step_eps * d_majStep) / d_majStep) * d_majStep;
- nMaj = qwtMin(10000, int(rint((lastTick - firstTick) / d_majStep)) + 1);
+ nMaj = MusEUtil::qwtMin(10000, int(rint((lastTick - firstTick) / d_majStep)) + 1);
d_majMarks.resize(nMaj);
- qwtLinSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick);
+ MusEUtil::qwtLinSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick);
//
// Set up minor divisions
@@ -315,14 +328,14 @@ bool ScaleDiv::buildLinDiv(int maxMajSteps, int maxMinSteps, double step)
if (maxMinSteps < 1) // no minor divs
return TRUE;
- minStep = qwtCeil125( d_majStep / double(maxMinSteps) );
+ minStep = MusEUtil::qwtCeil125( d_majStep / double(maxMinSteps) );
if (minStep == 0.0) return TRUE;
- nMin = qwtAbs(int(rint(d_majStep / minStep))) - 1; // # minor steps per interval
+ nMin = MusEUtil::qwtAbs(int(rint(d_majStep / minStep))) - 1; // # minor steps per interval
// Do the minor steps fit into the interval?
- if ( qwtAbs(double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep)
+ if ( MusEUtil::qwtAbs(double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep)
{
nMin = 1;
minStep = d_majStep * 0.5;
@@ -397,9 +410,9 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep)
// Parameter range check
- maxMajSteps = qwtMax(1, qwtAbs(maxMajSteps));
- maxMinSteps = qwtMax(0, qwtAbs(maxMinSteps));
- majStep = qwtAbs(majStep);
+ maxMajSteps = MusEUtil::qwtMax(1, MusEUtil::qwtAbs(maxMajSteps));
+ maxMinSteps = MusEUtil::qwtMax(0, MusEUtil::qwtAbs(maxMinSteps));
+ majStep = MusEUtil::qwtAbs(majStep);
// boundary check
limRange(d_hBound, LOG_MIN, LOG_MAX);
@@ -429,12 +442,12 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep)
// Set up major scale divisions
//
if (majStep == 0.0)
- d_majStep = qwtCeil125( width * 0.999999 / double(maxMajSteps));
+ d_majStep = MusEUtil::qwtCeil125( width * 0.999999 / double(maxMajSteps));
else
d_majStep = majStep;
// major step must be >= 1 decade
- d_majStep = qwtMax(d_majStep, 1.0);
+ d_majStep = MusEUtil::qwtMax(d_majStep, 1.0);
lFirst = ceil((log10(d_lBound) - step_eps * d_majStep) / d_majStep) * d_majStep;
@@ -443,10 +456,10 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep)
firstTick = pow(10.0, lFirst);
lastTick = pow(10.0, lLast);
- nMaj = qwtMin(10000, int(rint(qwtAbs(lLast - lFirst) / d_majStep)) + 1);
+ nMaj = MusEUtil::qwtMin(10000, int(rint(MusEUtil::qwtAbs(lLast - lFirst) / d_majStep)) + 1);
d_majMarks.resize(nMaj);
- qwtLogSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick);
+ MusEUtil::qwtLogSpace(d_majMarks.data(), d_majMarks.size(), firstTick, lastTick);
//
@@ -525,15 +538,15 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep)
{
// substep width in decades, at least one decade
- minStep = qwtCeil125( (d_majStep - step_eps * (d_majStep / double(maxMinSteps)))
+ minStep = MusEUtil::qwtCeil125( (d_majStep - step_eps * (d_majStep / double(maxMinSteps)))
/ double(maxMinSteps) );
- minStep = qwtMax(1.0, minStep);
+ minStep = MusEUtil::qwtMax(1.0, minStep);
// # subticks per interval
nMin = int(rint(d_majStep / minStep)) - 1;
// Do the minor steps fit into the interval?
- if ( qwtAbs( double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep)
+ if ( MusEUtil::qwtAbs( double(nMin + 1) * minStep - d_majStep) > step_eps * d_majStep)
nMin = 0;
if (nMin < 1) return TRUE; // no subticks
@@ -542,7 +555,7 @@ bool ScaleDiv::buildLogDiv(int maxMajSteps, int maxMinSteps, double majStep)
buffer.resize((d_majMarks.size() + 1) * nMin );
// substep factor = 10^substeps
- minFactor = qwtMax(pow(10,minStep), 10.0);
+ minFactor = MusEUtil::qwtMax(pow(10,minStep), 10.0);
// Are there minor ticks below the first major tick?
if ( d_lBound < firstTick )
@@ -646,7 +659,7 @@ void ScaleDiv::reset()
d_log = FALSE;
}
-
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/scldiv.h b/muse2/muse/widgets/scldiv.h
index 3d1e1d58..1f91c2db 100644
--- a/muse2/muse/widgets/scldiv.h
+++ b/muse2/muse/widgets/scldiv.h
@@ -4,11 +4,22 @@
// $Id: scldiv.h,v 1.1.1.1 2003/10/27 18:54:43 wschweer Exp $
//
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SCLDIV_H__
@@ -16,6 +27,8 @@
#include <QVector>
+namespace MusEWidget {
+
class ScaleDiv
{
double d_lBound;
@@ -53,4 +66,6 @@ class ScaleDiv
bool log, double step = 0.0, bool ascend = TRUE);
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/scldraw.cpp b/muse2/muse/widgets/scldraw.cpp
index 709e104a..c35d04e0 100644
--- a/muse2/muse/widgets/scldraw.cpp
+++ b/muse2/muse/widgets/scldraw.cpp
@@ -4,11 +4,22 @@
// $Id: scldraw.cpp,v 1.1.1.1 2003/10/27 18:54:36 wschweer Exp $
//
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
@@ -19,6 +30,8 @@
#include "scldraw.h"
+namespace MusEWidget {
+
int const ScaleDraw::minLen = 10;
const double step_eps = 1.0e-6;
@@ -211,7 +224,7 @@ void ScaleDraw::draw(QPainter *p) const
hval = majTick - 0.5 * d_scldiv.majStep();
}
- if (qwtAbs(val-hval) < step_eps * d_scldiv.majStep())
+ if (MusEUtil::qwtAbs(val-hval) < step_eps * d_scldiv.majStep())
drawTick(p, val, d_medLen);
else
drawTick(p, val, d_minLen);
@@ -264,10 +277,10 @@ void ScaleDraw::drawTick(QPainter *p, double val, int len) const
if ((tval <= d_minAngle + 359 * 16) || (tval >= d_minAngle - 359 * 16))
{
arc = double(tval) / 16.0 * M_PI / 180.0;
- x1 = qwtInt(d_xCenter + sin(arc) * d_radius);
- x2 = qwtInt(d_xCenter + sin(arc) * (d_radius + double(len)));
- y1 = qwtInt(d_yCenter - cos(arc) * d_radius);
- y2 = qwtInt(d_yCenter - cos(arc) * (d_radius + double(len)));
+ x1 = MusEUtil::qwtInt(d_xCenter + sin(arc) * d_radius);
+ x2 = MusEUtil::qwtInt(d_xCenter + sin(arc) * (d_radius + double(len)));
+ y1 = MusEUtil::qwtInt(d_yCenter - cos(arc) * d_radius);
+ y2 = MusEUtil::qwtInt(d_yCenter - cos(arc) * (d_radius + double(len)));
p->drawLine(x1, y1, x2, y2);
}
break;
@@ -311,7 +324,7 @@ void ScaleDraw::drawLabel(QPainter *p, double val) const
tval = transform(val);
// correct rounding errors if val = 0
- if ((!d_scldiv.logScale()) && (qwtAbs(val) < qwtAbs(step_eps * d_scldiv.majStep())))
+ if ((!d_scldiv.logScale()) && (MusEUtil::qwtAbs(val) < MusEUtil::qwtAbs(step_eps * d_scldiv.majStep())))
val = 0.0;
label.setNum(val, d_fmt, d_prec);
@@ -342,12 +355,12 @@ void ScaleDraw::drawLabel(QPainter *p, double val) const
if ((arc < -M_PI) || (arc > M_PI))
arc -= floor((arc + M_PI) / M_PI * 0.5) * 2.0 * M_PI;
- xpos = 1 + qwtInt(d_xCenter + (d_radius + double(d_majLen + d_vpad)) * sin(arc));
- ypos = qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc));
+ xpos = 1 + MusEUtil::qwtInt(d_xCenter + (d_radius + double(d_majLen + d_vpad)) * sin(arc));
+ ypos = MusEUtil::qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc));
if (arc < -pi_75)
{
- p->drawText(xpos - qwtInt(double(fm.width(label))
+ p->drawText(xpos - MusEUtil::qwtInt(double(fm.width(label))
* (1.0 + (arc + pi_75) * M_2_PI) ),
ypos + fm.ascent() - 1,
label);
@@ -357,13 +370,13 @@ void ScaleDraw::drawLabel(QPainter *p, double val) const
p->drawText(xpos - fm.width(label),
- ypos - qwtInt(double(fm.ascent() - 1)
+ ypos - MusEUtil::qwtInt(double(fm.ascent() - 1)
* (arc + M_PI_4) * M_2_PI),
label);
}
else if (arc < pi_4)
{
- p->drawText(xpos + qwtInt(double(fm.width(label))
+ p->drawText(xpos + MusEUtil::qwtInt(double(fm.width(label))
* ( arc - M_PI_4 ) * M_2_PI ),
ypos,
label);
@@ -371,13 +384,13 @@ void ScaleDraw::drawLabel(QPainter *p, double val) const
else if (arc < pi_75)
{
p->drawText(xpos,
- ypos + qwtInt(double(fm.ascent() - 1)
+ ypos + MusEUtil::qwtInt(double(fm.ascent() - 1)
* (arc - M_PI_4) * M_2_PI),
label);
}
else
{
- p->drawText(xpos - qwtInt(double(fm.width(label))
+ p->drawText(xpos - MusEUtil::qwtInt(double(fm.width(label))
* ( arc - pi_75) * M_2_PI ),
ypos + fm.ascent() - 1,
label);
@@ -420,8 +433,8 @@ void ScaleDraw::drawBackbone(QPainter *p) const
break;
case Round:
- a1 = qwtMin(i1(), i2()) - 90 * 16;
- a2 = qwtMax(i1(), i2()) - 90 * 16;
+ a1 = MusEUtil::qwtMin(i1(), i2()) - 90 * 16;
+ a2 = MusEUtil::qwtMax(i1(), i2()) - 90 * 16;
p->drawArc(d_xorg, d_yorg, d_len,
d_len,
@@ -681,7 +694,7 @@ QRect ScaleDraw::maxBoundingRect(QPainter *p) const
while (a > 2880) a -= 5760;
while (a < - 2880) a += 5760;
- ar = qwtAbs(a);
+ ar = MusEUtil::qwtAbs(a);
if (ar < amin) amin = ar;
if (ar > amax) amax = ar;
@@ -695,18 +708,18 @@ QRect ScaleDraw::maxBoundingRect(QPainter *p) const
while (a > 2880) a -= 5760;
while (a < - 2880) a += 5760;
- ar = qwtAbs(a);
+ ar = MusEUtil::qwtAbs(a);
if (ar < amin) amin = ar;
if (ar > amax) amax = ar;
}
arc = double(amin) / 16.0 * M_PI / 180.0;
- r.setTop(qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc))
+ r.setTop(MusEUtil::qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc))
+ fm.ascent() );
arc = double(amax) / 16.0 * M_PI / 180.0;
- r.setBottom(qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc))
+ r.setBottom(MusEUtil::qwtInt(d_yCenter - (d_radius + double(d_majLen + d_vpad)) * cos(arc))
+ fm.height() );
wmax = d_len + d_majLen + d_hpad + wl;
@@ -752,10 +765,10 @@ void ScaleDraw::setAngleRange(double angle1, double angle2)
{
int amin, amax;
- angle1 = qwtLim(angle1, -360.0, 360.0);
- angle2 = qwtLim(angle2, -360.0, 360.0);
- amin = int(rint(qwtMin(angle1, angle2) * 16.0));
- amax = int(rint(qwtMax(angle1, angle2) * 16.0));
+ angle1 = MusEUtil::qwtLim(angle1, -360.0, 360.0);
+ angle2 = MusEUtil::qwtLim(angle2, -360.0, 360.0);
+ amin = int(rint(MusEUtil::qwtMin(angle1, angle2) * 16.0));
+ amax = int(rint(MusEUtil::qwtMax(angle1, angle2) * 16.0));
if (amin == amax)
{
@@ -831,10 +844,10 @@ int ScaleDraw::maxLabelWidth(QPainter *p, int worst) const
{
val = d_scldiv.majMark(i);
// correct rounding errors if val = 0
- if ((!d_scldiv.logScale()) && (qwtAbs(val) < step_eps * qwtAbs(d_scldiv.majStep())))
+ if ((!d_scldiv.logScale()) && (MusEUtil::qwtAbs(val) < step_eps * MusEUtil::qwtAbs(d_scldiv.majStep())))
val = 0.0;
s.setNum(val, d_fmt, d_prec);
- rv = qwtMax(rv,fm.width(s));
+ rv = MusEUtil::qwtMax(rv,fm.width(s));
}
}
@@ -869,7 +882,7 @@ int ScaleDraw::maxLabelWidth(QPainter *p, int worst) const
//
//------------------------------------------------------------
-
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/scldraw.h b/muse2/muse/widgets/scldraw.h
index 08a198ca..2c1543cd 100644
--- a/muse2/muse/widgets/scldraw.h
+++ b/muse2/muse/widgets/scldraw.h
@@ -4,11 +4,22 @@
// $Id: scldraw.h,v 1.1.1.1 2003/10/27 18:55:08 wschweer Exp $
//
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SCLDRAW_H__
@@ -20,7 +31,7 @@
class QPainter;
class QRect;
-class AutoScale;
+namespace MusEWidget {
class ScaleDraw : public DiMap {
public:
@@ -76,6 +87,8 @@ class ScaleDraw : public DiMap {
void draw(QPainter *p) const;
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/sclif.cpp b/muse2/muse/widgets/sclif.cpp
index 8740bc53..93987999 100644
--- a/muse2/muse/widgets/sclif.cpp
+++ b/muse2/muse/widgets/sclif.cpp
@@ -4,15 +4,28 @@
// $Id: sclif.cpp,v 1.1.1.1 2003/10/27 18:55:10 wschweer Exp $
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "sclif.h"
+namespace MusEWidget {
+
// ScaleIf - An interface class for widgets containing a scale
//
// This interface class is used to provide classes
@@ -203,3 +216,4 @@ void ScaleIf::setScaleMaxMinor(int ticks)
}
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/sclif.h b/muse2/muse/widgets/sclif.h
index ec8eafc9..e168dfc3 100644
--- a/muse2/muse/widgets/sclif.h
+++ b/muse2/muse/widgets/sclif.h
@@ -4,11 +4,22 @@
// $Id: sclif.h,v 1.1.1.1 2003/10/27 18:54:33 wschweer Exp $
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SCALE_IF_H__
@@ -16,6 +27,8 @@
#include "scldraw.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// ScaleIf
//---------------------------------------------------------
@@ -46,5 +59,7 @@ class ScaleIf
int scaleMaxMajor() const {return d_maxMinor;}
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/scrollscale.cpp b/muse2/muse/widgets/scrollscale.cpp
index 15ec0947..21ed10b6 100644
--- a/muse2/muse/widgets/scrollscale.cpp
+++ b/muse2/muse/widgets/scrollscale.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: scrollscale.cpp,v 1.2.2.2 2009/11/04 17:43:25 lunar_shuttle Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -20,6 +35,8 @@
#include "scrollscale.h"
#include "icons.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// setScale
// "val" - slider value in range 0-1024
@@ -509,3 +526,4 @@ int ScrollScale::convertQuickZoomLevelToMag(int zoomlevel)
return vals[zoomlevel];
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/scrollscale.h b/muse2/muse/widgets/scrollscale.h
index 67cfe573..0fce5b56 100644
--- a/muse2/muse/widgets/scrollscale.h
+++ b/muse2/muse/widgets/scrollscale.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: scrollscale.h,v 1.2.2.3 2009/11/04 17:43:26 lunar_shuttle Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SCROLLSCALE_H__
@@ -16,6 +31,8 @@ class QResizeEvent;
class QScrollBar;
class QToolButton;
+namespace MusEWidget {
+
//---------------------------------------------------------
// ScrollScale
//---------------------------------------------------------
@@ -82,5 +99,7 @@ class ScrollScale : public QWidget {
static int convertQuickZoomLevelToMag(int zoomlvl);
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/section.h b/muse2/muse/widgets/section.h
index 7aaa4778..02b84355 100644
--- a/muse2/muse/widgets/section.h
+++ b/muse2/muse/widgets/section.h
@@ -3,11 +3,28 @@
// Linux Music Editor
// $Id: section.h,v 1.1.1.1 2003/10/27 18:54:27 wschweer Exp $
// (C) Copyright 2002 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SECTION_H__
#define __SECTION_H__
+namespace MusEWidget {
+
struct Section {
int offset;
unsigned len;
@@ -15,5 +32,7 @@ struct Section {
int val;
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/shortcutcapturedialog.cpp b/muse2/muse/widgets/shortcutcapturedialog.cpp
index 1c06eece..a470d698 100644
--- a/muse2/muse/widgets/shortcutcapturedialog.cpp
+++ b/muse2/muse/widgets/shortcutcapturedialog.cpp
@@ -1,14 +1,37 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/shortcutcapturedialog.cpp $
//
-// C++ Implementation: shortcutcapturedialog
-//
-// Description:
-// Dialog window for capturing keyboard shortcuts
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// Author: Mathias Lundgren <lunar_shuttle@users.sourceforge.net>, (C) 2003
//
// Copyright: Mathias Lundgren (lunar_shuttle@users.sourceforge.net) (C) 2003
//
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
+//
+// C++ Implementation: shortcutcapturedialog
+//
+// Description:
+// Dialog window for capturing keyboard shortcuts
+//
+
#include "shortcutcapturedialog.h"
#include "shortcuts.h"
@@ -17,6 +40,8 @@
#include <QInputEvent>
#include <QChar>
+namespace MusEWidget {
+
ShortcutCaptureDialog::ShortcutCaptureDialog(QWidget* parent, int index)
: QDialog(parent)
{
@@ -100,3 +125,4 @@ void ShortcutCaptureDialog::apply()
done(key);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/shortcutcapturedialog.h b/muse2/muse/widgets/shortcutcapturedialog.h
index a7ba69c7..9af3f7c2 100644
--- a/muse2/muse/widgets/shortcutcapturedialog.h
+++ b/muse2/muse/widgets/shortcutcapturedialog.h
@@ -1,13 +1,35 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/shortcutcapturedialog.h $
//
-// C++ Interface: shortcutcapturedialog
-//
-// Description:
-// Dialog window for capturing keyboard shortcuts
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// Author: Mathias Lundgren <lunar_shuttle@users.sourceforge.net>, (C) 2003
//
// Copyright: Mathias Lundgren (lunar_shuttle@users.sourceforge.net) (C) 2003
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
+//
+// C++ Interface: shortcutcapturedialog
+//
+// Description:
+// Dialog window for capturing keyboard shortcuts
+//
//
#include "shortcuts.h"
@@ -16,6 +38,8 @@
class QKeyEvent;
+namespace MusEWidget {
+
class ShortcutCaptureDialog : public QDialog, public Ui::ShortcutCaptureDialogBase
{
Q_OBJECT
@@ -33,3 +57,4 @@ class ShortcutCaptureDialog : public QDialog, public Ui::ShortcutCaptureDialogBa
~ShortcutCaptureDialog();
};
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/shortcutconfig.cpp b/muse2/muse/widgets/shortcutconfig.cpp
index 80d0290f..8e4d7b1a 100644
--- a/muse2/muse/widgets/shortcutconfig.cpp
+++ b/muse2/muse/widgets/shortcutconfig.cpp
@@ -1,14 +1,37 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/shortcutconfig.cpp $
//
-// C++ Implementation: shortcutconfig
-//
-// Description:
-// Dialog for configuring keyboard shortcuts
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// Author: Mathias Lundgren <lunar_shuttle@users.sourceforge.net>, (C) 2003
//
// Copyright: Mathias Lundgren (lunar_shuttle@users.sourceforge.net) (C) 2003
//
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
+//
+// C++ Implementation: shortcutconfig
+//
+// Description:
+// Dialog for configuring keyboard shortcuts
+//
+
#include <QCloseEvent>
#include <QKeySequence>
#include <QString>
@@ -18,6 +41,8 @@
#include "shortcutcapturedialog.h"
#include "shortcuts.h"
+namespace MusEWidget {
+
ShortcutConfig::ShortcutConfig(QWidget* parent)
: QDialog(parent)
{
@@ -132,3 +157,5 @@ void ShortcutConfig::assignAll()
applyButton->setDown(false);
done(_config_changed);
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/shortcutconfig.h b/muse2/muse/widgets/shortcutconfig.h
index f68bfd5a..fe417c05 100644
--- a/muse2/muse/widgets/shortcutconfig.h
+++ b/muse2/muse/widgets/shortcutconfig.h
@@ -1,14 +1,37 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/shortcutconfig.h $
//
-// C++ Interface: shortcutconfig
-//
-// Description:
-// Dialog for configuring keyboard shortcuts
-//
+// Copyright (C) 1999-2011 by Werner Schweer and others
// Author: Mathias Lundgren <lunar_shuttle@users.sourceforge.net>, (C) 2003
//
// Copyright: Mathias Lundgren (lunar_shuttle@users.sourceforge.net) (C) 2003
//
//
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
+//
+// C++ Interface: shortcutconfig
+//
+// Description:
+// Dialog for configuring keyboard shortcuts
+//
+
#ifndef __SHORTCUTCONFIG_H
#define __SHORTCUTCONFIG_H
@@ -17,6 +40,9 @@ class QCloseEvent;
#include "ui_shortcutconfigbase.h"
#define SHRT_CATEGORY_COL 0
+
+namespace MusEWidget {
+
enum
{
SHRT_SHRTCUT_COL = 0,
@@ -57,4 +83,6 @@ class ShortcutConfig : public QDialog, public Ui::ShortcutConfigBase {
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/sigedit.cpp b/muse2/muse/widgets/sigedit.cpp
index d4c210e4..c2c5a842 100644
--- a/muse2/muse/widgets/sigedit.cpp
+++ b/muse2/muse/widgets/sigedit.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: sigedit.cpp,v 1.1.1.1.2.1 2004/12/28 23:23:51 lunar_shuttle Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -27,6 +42,8 @@
extern int mtcType;
+namespace MusEWidget {
+
bool Sig::isValid() const
{
if((z < 1) || (z > 63))
@@ -737,3 +754,5 @@ void SigEdit::enterPressed()
{
emit returnPressed();
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/sigedit.h b/muse2/muse/widgets/sigedit.h
index 07ae0741..3b1ca635 100644
--- a/muse2/muse/widgets/sigedit.h
+++ b/muse2/muse/widgets/sigedit.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: sigedit.h,v 1.1.1.1.2.1 2004/12/28 23:23:51 lunar_shuttle Exp $
// (C) Copyright 2002 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SIGEDIT_H__
@@ -15,6 +30,8 @@
class QResizeEvent;
class QTimerEvent;
+namespace MusEWidget {
+
class SigEditor;
class SpinBox;
@@ -85,4 +102,6 @@ class SigEdit : public QWidget
void enterPressed();
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/siglabel.cpp b/muse2/muse/widgets/siglabel.cpp
index 47fcd2f8..1a1c9164 100644
--- a/muse2/muse/widgets/siglabel.cpp
+++ b/muse2/muse/widgets/siglabel.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: siglabel.cpp,v 1.1.1.1 2003/10/27 18:54:28 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "siglabel.h"
@@ -20,6 +35,8 @@
#include <QWheelEvent>
#include <QLabel>
+namespace MusEWidget {
+
//---------------------------------------------------------
// SigLabel
// edit Signature Values (4/4)
@@ -162,3 +179,5 @@ void SigLabel::setFrame(bool flag)
setFrameStyle(flag ? Panel | Sunken : NoFrame);
setLineWidth(2);
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/siglabel.h b/muse2/muse/widgets/siglabel.h
index bf9e53b4..33248e53 100644
--- a/muse2/muse/widgets/siglabel.h
+++ b/muse2/muse/widgets/siglabel.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: siglabel.h,v 1.1.1.1 2003/10/27 18:54:56 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SIGLABEL_H__
@@ -15,6 +30,8 @@
class QWheelEvent;
class QMouseEvent;
+namespace MusEWidget {
+
//---------------------------------------------------------
// SigLabel
// show/edit time signature
@@ -43,5 +60,8 @@ class SigLabel : public QLabel {
AL::TimeSignature value() const { return AL::TimeSignature(z, n); }
void setFrame(bool);
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/sigscale.cpp b/muse2/muse/widgets/sigscale.cpp
index 74ed0bcb..bcfb540e 100644
--- a/muse2/muse/widgets/sigscale.cpp
+++ b/muse2/muse/widgets/sigscale.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: sigscale.cpp,v 1.6 2004/04/11 13:03:32 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <values.h>
@@ -17,6 +32,8 @@
#include "song.h"
#include "gconfig.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// SigScale
//---------------------------------------------------------
@@ -115,7 +132,7 @@ void SigScale::pdraw(QPainter& p, const QRect& r)
if (x < 0)
x = 0;
- p.setFont(config.fonts[3]);
+ p.setFont(MusEConfig::config.fonts[3]);
///for (ciSigEvent si = sigmap.begin(); si != sigmap.end(); ++si) {
for (AL::ciSigEvent si = AL::sigmap.begin(); si != AL::sigmap.end(); ++si) {
///SigEvent* e = si->second;
@@ -149,4 +166,4 @@ void SigScale::pdraw(QPainter& p, const QRect& r)
p.drawLine(xp, 0, xp, h);
}
-
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/sigscale.h b/muse2/muse/widgets/sigscale.h
index 8c9ffea9..9ecacfb1 100644
--- a/muse2/muse/widgets/sigscale.h
+++ b/muse2/muse/widgets/sigscale.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: sigscale.h,v 1.2 2004/01/11 18:55:37 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SIGSCALE_H__
@@ -12,6 +27,8 @@
class MidiEditor;
+namespace MusEWidget {
+
//---------------------------------------------------------
// SigScale
// Time Signature Scale
@@ -42,5 +59,8 @@ class SigScale : public View {
public:
SigScale(int* raster, QWidget* parent, int xscale);
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/slider.cpp b/muse2/muse/widgets/slider.cpp
index 4f68388d..f50c144a 100644
--- a/muse2/muse/widgets/slider.cpp
+++ b/muse2/muse/widgets/slider.cpp
@@ -1,3 +1,26 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/slider.cpp $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+// (C) Copyright 2011 Orcan Ogetbil (ogetbilo at sf.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#include <cmath>
#include "mmath.h"
@@ -6,6 +29,8 @@
#include "slider.h"
+namespace MusEWidget {
+
//-------------------------------------------------------------
// Slider - The Slider Widget
//
@@ -32,39 +57,27 @@
// ScalePos scalePos -- Position of the scale. Can be Slider::None,
// Slider::Left, Slider::Right, Slider::Top,
// or Slider::Bottom. Defaults to Slider::None.
-// int bgStyle -- Background style. Slider::BgTrough draws the
-// slider button in a trough, Slider::BgSlot draws
-// a slot underneath the button. An or-combination of both
-// may also be used. The default is Slider::BgTrough.
+// QColor fillcolor -- the color used to fill in the full side
+// of the Slider
//------------------------------------------------------------
Slider::Slider(QWidget *parent, const char *name,
- Qt::Orientation orient, ScalePos scalePos, int bgStyle)
+ Qt::Orientation orient, ScalePos scalePos, QColor fillColor)
: SliderBase(parent,name)
{
- if (bgStyle == BgSlot) {
- d_thumbLength = 16;
- d_thumbHalf = 8;
- d_thumbWidth = 30;
- }
- else {
- d_thumbLength = 30;
- d_thumbHalf = 15;
- d_thumbWidth = 16;
- }
+ d_thumbLength = 16;
+ d_thumbHalf = 8;
+ d_thumbWidth = 16;
+
- d_borderWidth = 2;
d_scaleDist = 4;
d_scaleStep = 0.0;
d_scalePos = scalePos;
d_xMargin = 0;
d_yMargin = 0;
- d_bgStyle = bgStyle;
+ d_mMargin = 1;
- if (bgStyle & BgTrough)
- d_bwTrough = d_borderWidth;
- else
- d_bwTrough = 0;
+ d_fillColor = fillColor;
d_sliderRect.setRect(0, 0, 8, 8);
setOrientation(orient);
@@ -81,28 +94,6 @@ Slider::~Slider()
{
}
-//------------------------------------------------------------
-//
-//.F Slider::setBorderWidth
-// Change the slider's border width
-//
-//.u Syntax
-//.f void Slider::setBorderWidth(int bd)
-//
-//.u Parameters
-//.p int bd -- border width
-//
-//------------------------------------------------------------
-
-void Slider::setBorderWidth(int bd)
-{
- d_borderWidth = qwtMin(qwtMax(bd,0),10);
- if (d_bgStyle & BgTrough)
- d_bwTrough = d_borderWidth;
- else
- d_bwTrough = 0;
-}
-
//----------------------------------------------------
//
//.F Slider::setThumbLength
@@ -118,7 +109,7 @@ void Slider::setBorderWidth(int bd)
//-----------------------------------------------------
void Slider::setThumbLength(int l)
{
- d_thumbLength = qwtMax(l,8);
+ d_thumbLength = MusEUtil::qwtMax(l,8);
d_thumbHalf = d_thumbLength / 2;
resize(size());
}
@@ -137,7 +128,7 @@ void Slider::setThumbLength(int l)
//------------------------------------------------------------
void Slider::setThumbWidth(int w)
{
- d_thumbWidth = qwtMax(w,4);
+ d_thumbWidth = MusEUtil::qwtMax(w,4);
resize(size());
}
@@ -177,311 +168,284 @@ void Slider::fontChange(const QFont & /*oldFont*/)
}
//------------------------------------------------------------
-// drawSlider
-// Draw the slider into the specified rectangle.
-//------------------------------------------------------------
-
-void Slider::drawSlider(QPainter *p, const QRect &r)
- {
- const QPalette& pal = palette();
- QBrush brBack(pal.window());
- QBrush brMid;
- QBrush brDark(pal.dark());
-
- QRect cr;
-
- int ipos,dist1;
- double rpos;
- int lineDist;
-
- if (d_bwTrough > 0) {
- qDrawShadePanel(p, r.x(), r.y(),
- r.width(), r.height(),
- pal, TRUE, d_bwTrough,0);
- cr.setRect(r.x() + d_bwTrough,
- r.y() + d_bwTrough,
- r.width() - 2*d_bwTrough,
- r.height() - 2*d_bwTrough);
- brMid = pal.mid();
- }
- else {
- cr = r;
- brMid = brBack;
- }
-
- rpos = (value() - minValue()) / (maxValue() - minValue());
-
- lineDist = d_borderWidth - 1;
- if (lineDist < 1) lineDist = 1;
-
- if (d_orient == Qt::Horizontal)
- {
-
- dist1 = int(double(cr.width() - d_thumbLength) * rpos);
- ipos = cr.x() + dist1;
- markerPos = ipos + d_thumbHalf;
-
- //
- // draw background
- //
- if (d_bgStyle & BgSlot)
- {
- drawHsBgSlot(p, cr, QRect(ipos, cr.y(), d_thumbLength, cr.height()), brMid);
- }
- else
- {
- p->fillRect(cr.x(),cr.y(),dist1,cr.height(),brMid);
- p->fillRect(ipos + d_thumbLength, cr.y(),
- cr.width() - d_thumbLength - dist1, cr.height(),brMid);
- }
-
- //
- // Draw thumb
- //
- qDrawShadePanel(p,ipos, cr.y(), d_thumbLength, cr.height(),
- pal, FALSE, d_borderWidth, &brBack);
-
- if (lineDist > 1)
- qDrawShadeLine(p,markerPos, cr.y() + lineDist , markerPos,
- cr.y() + cr.height() - lineDist,
- pal, TRUE, 1);
- else
- {
- p->setPen(pal.dark().color());
- p->drawLine(markerPos -1 , cr.y() + lineDist, markerPos -1,
- cr.y() + cr.height() - lineDist - 1);
- p->setPen(pal.light().color());
- p->drawLine(markerPos, cr.y() + lineDist, markerPos,
- cr.y() + cr.height() - lineDist - 1);
- }
-
-
- }
- else
- {
- dist1 = int(double(cr.height() - d_thumbLength) * (1.0 - rpos));
- ipos = cr.y() + dist1;
- markerPos = ipos + d_thumbHalf;
-
- if ( d_bgStyle & BgSlot)
- {
- drawVsBgSlot(p, cr, QRect(cr.left(), ipos, cr.width(),
- d_thumbLength), brMid);
- }
- else
- {
- p->fillRect(cr.x(),cr.y(),cr.width(),ipos,brMid);
- p->fillRect(cr.x(), ipos + d_thumbLength, cr.width(),
- cr.height() - d_thumbLength - dist1, brMid);
- }
-
- qDrawShadePanel(p,cr.x(),ipos , cr.width(), d_thumbLength,
- pal,FALSE,d_borderWidth, &brBack);
- if (lineDist > 1)
- qDrawShadeLine(p, cr.x() + lineDist , markerPos,
- cr.x() + cr.width() - lineDist, markerPos,
- pal, TRUE, 1);
- else {
-
- p->setPen(pal.dark().color());
- p->drawLine(cr.x() + lineDist, markerPos - 1 ,
- cr.x() + cr.width() - lineDist - 1, markerPos - 1);
- p->setPen(pal.light().color());
- p->drawLine(cr.x() + lineDist, markerPos,
- cr.x() + cr.width() - lineDist - 1 , markerPos);
- }
- }
-
-}
-
-//------------------------------------------------------------
-//.-
-//.F Slider::drawSlotBg
//
+// roundedPath
+// Returns a rectangle with rounded corners
//
-//.u Syntax
-//.f void Slider::drawSlotBg(QPainter *p, const QRect &rBound, const QRect &rThumb, const QRect &rSlot, const QBrush &brBack)
-//
-//.u Parameters
-//.p QPainter *p, const QRect &rBound, const QRect &rThumb, const QRect &rSlot, const QBrush &brBack
-//
+// roundCorner can be an bitwise-or combination of
+// UpperLeft, UpperRight, LowerRight, LowerLeft
//------------------------------------------------------------
-void Slider::drawHsBgSlot(QPainter *p, const QRect &rBound, const QRect &rThumb, const QBrush &brBack)
+QPainterPath Slider::roundedPath(QRect r, int xrad, int yrad, RoundCorner roundCorner)
{
- int ws, ds, dLeft;
- int lPos, rPos;
- QRect rSlot;
- const QPalette& pal = palette();
+ return roundedPath(r.x(), r.y(),
+ r.width(), r.height(),
+ xrad, yrad,
+ roundCorner);
+}
- ws = rBound.height();
- if ((ws / 2) * 2 != ws)
- ws = 5;
+QPainterPath Slider::roundedPath(int x, int y, int w, int h, int xrad, int yrad, RoundCorner roundCorner)
+{
+ QPainterPath rounded_rect;
+ rounded_rect.addRect(x, y + yrad, w, h - 2 * yrad);
+ if (roundCorner & UpperLeft)
+ {
+ rounded_rect.moveTo(x + xrad, y + yrad);
+ rounded_rect.arcTo(x, y, xrad*2, yrad*2, 180, -90);
+ }
else
- ws = 4;
-
- ds = qwtMax(1, d_thumbLength/2 - 4);
- dLeft = rThumb.left() - rBound.left();
+ {
+ rounded_rect.moveTo(x, y + yrad);
+ rounded_rect.lineTo(x,y);
+ rounded_rect.lineTo(x + xrad, y);
+ }
- rSlot = QRect(rBound.x() + ds, rBound.y() + (rBound.height() - ws) / 2,
- rBound.width() - 2 * ds, ws);
+ rounded_rect.lineTo(x + w - xrad, y);
- rPos = qwtMin(rSlot.x(), rThumb.left());
+ if (roundCorner & UpperRight)
+ rounded_rect.arcTo(x + w - xrad * 2, y, xrad*2, yrad*2, 90, -90);
+ else
+ {
+ rounded_rect.lineTo(x + w, y);
+ rounded_rect.lineTo(x + w, y + yrad);
+ }
- if (rThumb.left() > rBound.x())
- {
- p->fillRect(rBound.x(),rBound.y(),dLeft, rSlot.top() - rBound.top(), brBack);
- p->fillRect(rBound.x(),rSlot.bottom() + 1,dLeft,
- rBound.bottom() - rSlot.bottom(),brBack);
- if (rPos > rBound.left())
- p->fillRect(rBound.x(),rSlot.y(),
- rPos - rBound.left(),ws,brBack);
-
- p->setPen(pal.dark().color());
- if (rSlot.x() < rThumb.left())
- p->drawLine(rSlot.x(), rSlot.bottom(), rSlot.x(), rSlot.top());
- if (rSlot.x() < rThumb.left() - 1)
- {
- p->drawLine(rSlot.x(), rSlot.top(), rThumb.left() - 1, rSlot.top());
- p->setPen(pal.light().color());
- p->drawLine(rSlot.x() + 1, rSlot.bottom(),
- rThumb.left() - 1, rSlot.bottom());
-
- p->fillRect(rSlot.x() + 1, rSlot.y() + 1, dLeft - ds -1,
- rSlot.height() -2, QBrush(pal.currentColorGroup() == QPalette::Disabled ?
- pal.color(QPalette::Disabled, QPalette::WindowText) : Qt::black));
- }
- }
+ if (roundCorner & LowerLeft)
+ {
+ rounded_rect.moveTo(x + xrad, y + h - yrad);
+ rounded_rect.arcTo(x, y + h - yrad*2, xrad*2, yrad*2, 180, 90);
+ }
+ else
+ {
+ rounded_rect.moveTo(x, y + h - yrad);
+ rounded_rect.lineTo(x, y + h);
+ rounded_rect.lineTo(x + xrad, y + h);
+ }
- lPos = qwtMax(rSlot.right(), rThumb.right()) + 1;
- if (rThumb.right() < rBound.right())
- {
- p->fillRect(rThumb.right() + 1,rBound.y(),rBound.right() - rThumb.right(),
- rSlot.top() - rBound.top(), brBack);
- p->fillRect(rThumb.right() + 1,rSlot.bottom() + 1,
- rBound.right() - rThumb.right(),
- rBound.bottom() - rSlot.bottom(),brBack);
- if (lPos <= rBound.right())
- p->fillRect(lPos, rSlot.y() , rBound.right() - lPos + 1, ws ,brBack);
-
- p->setPen(pal.dark().color());
- if (rSlot.right() > rThumb.right())
- {
- p->drawLine(rThumb.right() + 1, rSlot.top(), rSlot.right(), rSlot.top());
- p->setPen(pal.light().color());
- p->drawLine(rSlot.right(), rSlot.bottom(), rSlot.right(), rSlot.top() + 1);
- }
+ rounded_rect.lineTo(x + w - xrad, y + h);
- if (rSlot.right() > rThumb.right() + 1)
- {
- p->setPen(pal.light().color());
- p->drawLine(rThumb.right() + 1, rSlot.bottom(),
- rSlot.right() -1, rSlot.bottom());
- p->fillRect(rThumb.right() + 1, rSlot.y() + 1,
- rSlot.right() - rThumb.right() - 1,
- rSlot.height() -2, QBrush(pal.currentColorGroup() == QPalette::Disabled ?
- pal.color(QPalette::Disabled, QPalette::WindowText) : Qt::black));
- }
- }
+ if (roundCorner & LowerRight)
+ rounded_rect.arcTo(x + w - xrad*2, y + h - yrad*2, xrad*2, yrad*2, 270, 90);
+ else
+ {
+ rounded_rect.lineTo(x + w, y + h);
+ rounded_rect.lineTo(x + w, y + h - yrad);
+ }
+ return rounded_rect;
}
//------------------------------------------------------------
-//.-
-//.F Slider::drawVsBgSlot
-//
-//
-//.u Syntax
-//.f void Slider::drawVsBgSlot(QPainter *p, const QRect &rBound, const QRect &rThumb, const QBrush &brBack)
-//
-//.u Parameters
-//.p QPainter *p, const QRect &rBound, const QRect &rThumb, const QBrush &brBack
-//
-//.u Return Value
-//
-//.u Description
-//
+// drawSlider
+// Draw the slider into the specified rectangle.
//------------------------------------------------------------
-void Slider::drawVsBgSlot(QPainter *p, const QRect &rBound, const QRect &rThumb, const QBrush &brBack)
+
+void Slider::drawSlider(QPainter *p, const QRect &r)
{
+ p->setRenderHint(QPainter::Antialiasing);
- int ws, ds, dTop;
- int lPos, hPos;
- QRect rSlot;
const QPalette& pal = palette();
+ QBrush brBack(pal.window());
+ QBrush brMid(pal.mid());
+ QBrush brDark(pal.dark());
- ws = rBound.width();
- if ((ws / 2) * 2 != ws)
- ws = 5;
+ QRect cr;
+
+ int ipos,dist1;
+ double rpos;
+
+ int xrad = 4;
+ int yrad = 4;
+
+ // for the empty side
+ QColor e_mask_edge = pal.mid().color();
+ QColor e_mask_center = pal.midlight().color();
+ int e_alpha = 215;
+ e_mask_edge.setAlpha(e_alpha);
+ e_mask_center.setAlpha(e_alpha);
+
+ QLinearGradient e_mask;
+ e_mask.setColorAt(0, e_mask_edge);
+ e_mask.setColorAt(0.5, e_mask_center);
+ e_mask.setColorAt(1, e_mask_edge);
+
+ // for the full side
+ rpos = (value() - minValue()) / (maxValue() - minValue());
+
+ int f_brightness = 155 * rpos + 100;
+ int f_alpha;
+ int f_edge;
+ if (pal.currentColorGroup() == QPalette::Disabled)
+ {
+ f_alpha = 185;
+ f_edge = 100;
+ }
else
- ws = 4;
-
- ds = qwtMax(1, d_thumbLength/2 - 4);
- dTop = rThumb.top() - rBound.top();
-
- rSlot = QRect(rBound.x() + (rBound.width() - ws) / 2, rBound.y() + ds,
- ws, rBound.height() - 2 * ds);
-
- hPos = qwtMin(rSlot.y(), rThumb.top());
+ {
+ f_alpha = 127;
+ f_edge = 0;
+ }
+
+ QColor f_mask_center = QColor(f_brightness, f_brightness, f_brightness, f_alpha);
+ QColor f_mask_edge = QColor(f_edge, f_edge, f_edge, f_alpha);
+ QLinearGradient f_mask;
+
+ f_mask.setColorAt(0, f_mask_edge);
+ f_mask.setColorAt(0.5, f_mask_center);
+ f_mask.setColorAt(1, f_mask_edge);
+
+ // for the thumb
+ QLinearGradient thumbGrad;
+ QColor thumb_edge = pal.dark().color();
+ QColor thumb_center = pal.midlight().color();
+
+ thumbGrad.setColorAt(0, thumb_edge);
+ thumbGrad.setColorAt(0.5, thumb_center);
+ thumbGrad.setColorAt(1, thumb_edge);
+
+
+ if (d_orient == Qt::Horizontal)
+ {
- if (rThumb.top() > rBound.top())
- {
- p->fillRect(rBound.x(),rBound.y(), rSlot.left() - rBound.left(),dTop, brBack);
- p->fillRect(rSlot.right() + 1, rBound.y(),
- rBound.right() - rSlot.right(), dTop,brBack);
- if (hPos > rBound.top())
- p->fillRect(rSlot.x(),rBound.y(), ws,
- hPos - rBound.top(),brBack);
+ cr.setRect(r.x(),
+ r.y() + d_mMargin,
+ r.width(),
+ r.height() - 2*d_mMargin);
+
+
+ //
+ // Draw background
+ //
+ QPainterPath bg_rect = roundedPath(cr,
+ xrad, yrad,
+ (RoundCorner) (UpperLeft | UpperRight | LowerLeft | LowerRight) );
+
+ p->fillPath(bg_rect, d_fillColor);
+
+ dist1 = int(double(cr.width() - d_thumbLength) * rpos);
+ ipos = cr.x() + dist1;
+ markerPos = ipos + d_thumbHalf;
+
+
+ //
+ // Draw empty right side
+ //
+
+ e_mask.setStart(QPointF(0, cr.y()));
+ e_mask.setFinalStop(QPointF(0, cr.y() + cr.height()));
+
+ QPainterPath e_rect = roundedPath(ipos + d_thumbLength, cr.y(),
+ cr.width() - d_thumbLength - dist1, cr.height(),
+ xrad, yrad, (RoundCorner) (UpperRight | LowerRight) );
+
+ p->fillPath(e_rect, QBrush(e_mask));
+
+
+ //
+ // Draw full left side
+ //
+
+ f_mask.setStart(QPointF(0, cr.y()));
+ f_mask.setFinalStop(QPointF(0, cr.y() + cr.height()));
+
+ QPainterPath f_rect = roundedPath(cr.x(), cr.y(),
+ ipos + 1, cr.height(),
+ xrad, yrad,
+ (RoundCorner) (LowerLeft | UpperLeft) );
+
+ p->fillPath(f_rect, QBrush(f_mask));
+
+
+ //
+ // Draw thumb
+ //
+
+ QPainterPath thumb_rect = roundedPath(ipos, r.y(),
+ d_thumbLength, r.height(),
+ 2, 2,
+ (RoundCorner) (UpperLeft | UpperRight | LowerLeft | LowerRight) );
+
+ thumbGrad.setStart(QPointF(0, cr.y()));
+ thumbGrad.setFinalStop(QPointF(0, cr.y() + cr.height()));
+
+
+ p->fillPath(thumb_rect, QBrush(thumbGrad));
+
+ // center line
+ p->fillRect(ipos + d_thumbHalf, cr.y(), 1, cr.height(), pal.dark().color());
+
- p->setPen(pal.dark().color());
- if (rSlot.top() < rThumb.top())
- p->drawLine(rSlot.left(), rSlot.top(), rSlot.right(), rSlot.top());
+ }
+ else // (d_orient == Qt::Vertical)
+ {
+
+ cr.setRect(r.x() + d_mMargin,
+ r.y(),
+ r.width() - 2*d_mMargin,
+ r.height());
+
+
+ //
+ // Draw background
+ //
+ QPainterPath bg_rect = roundedPath(cr,
+ xrad, yrad,
+ (RoundCorner) (UpperLeft | UpperRight | LowerLeft | LowerRight) );
+
+ p->fillPath(bg_rect, d_fillColor);
+
+ dist1 = int(double(cr.height() - d_thumbLength) * (1.0 - rpos));
+ ipos = cr.y() + dist1;
+ markerPos = ipos + d_thumbHalf;
- if (rSlot.top() < rThumb.top() - 1)
- {
- p->drawLine(rSlot.left(), rThumb.top() - 1, rSlot.left(), rSlot.top());
- p->setPen(pal.light().color());
- p->drawLine(rSlot.right(), rSlot.top() + 1, rSlot.right(),
- rThumb.top() - 1);
-
- p->fillRect(rSlot.x() + 1, rSlot.y() + 1, rSlot.width() - 2,
- dTop - ds -1, QBrush(pal.currentColorGroup() == QPalette::Disabled ?
- pal.color(QPalette::Disabled, QPalette::WindowText) : Qt::black));
-
- }
- }
-
- lPos = qwtMax(rSlot.bottom(), rThumb.bottom()) + 1;
- if (rThumb.bottom() < rBound.bottom())
- {
- p->fillRect(rBound.left(), rThumb.bottom() + 1,
- rSlot.left() - rBound.left(),
- rBound.bottom() - rThumb.bottom(), brBack);
- p->fillRect(rSlot.right() + 1, rThumb.bottom() + 1,
- rBound.right() - rSlot.right(),
- rBound.bottom() - rThumb.bottom(), brBack);
- if (lPos <= rBound.bottom())
- p->fillRect(rSlot.left(), lPos, ws, rBound.bottom() - lPos + 1, brBack);
-
- p->setPen(pal.dark().color());
- if (rSlot.bottom() > rThumb.bottom())
- {
- p->drawLine(rSlot.left(), rThumb.bottom() + 1, rSlot.left(), rSlot.bottom());
- p->setPen(pal.light().color());
- p->drawLine(rSlot.left() * 1, rSlot.bottom(), rSlot.right(), rSlot.bottom());
- }
-
- if (rSlot.bottom() > rThumb.bottom() + 1)
- {
- p->setPen(pal.light().color());
- p->drawLine(rSlot.right(), rThumb.bottom() + 1, rSlot.right(),
- rSlot.bottom());
- p->fillRect(rSlot.left() + 1, rThumb.bottom() + 1,
- rSlot.width() - 2, rSlot.bottom() - rThumb.bottom() - 1,
- QBrush(pal.currentColorGroup() == QPalette::Disabled ?
- pal.color(QPalette::Disabled, QPalette::WindowText) : Qt::black));
- }
- }
+ //
+ // Draw empty upper filling
+ //
+
+ e_mask.setStart(QPointF(cr.x(), 0));
+ e_mask.setFinalStop(QPointF(cr.x() + cr.width(), 0));
+
+ QPainterPath e_rect = roundedPath(cr.x(), cr.y(),
+ cr.width(), ipos + 1,
+ xrad, yrad,
+ (RoundCorner) (UpperLeft | UpperRight) );
+
+ p->fillPath(e_rect, QBrush(e_mask));
+
+
+ //
+ // Draw lower filling mask
+ //
+
+ f_mask.setStart(QPointF(cr.x(), 0));
+ f_mask.setFinalStop(QPointF(cr.x() + cr.width(), 0));
+
+ QPainterPath f_rect = roundedPath(cr.x(), ipos + d_thumbLength,
+ cr.width(), cr.height() - d_thumbLength - dist1,
+ xrad, yrad, (RoundCorner) (LowerLeft | LowerRight) );
+
+ p->fillPath(f_rect, QBrush(f_mask));
+
+
+ //
+ // Draw thumb
+ //
+
+ QPainterPath thumb_rect = roundedPath(r.x(), ipos,
+ r.width(), d_thumbLength,
+ 2, 2,
+ (RoundCorner) (UpperLeft | UpperRight | LowerLeft | LowerRight) );
+
+ thumbGrad.setStart(QPointF(cr.x(), 0));
+ thumbGrad.setFinalStop(QPointF(cr.x() + cr.width(), 0));
+
+
+ p->fillPath(thumb_rect, QBrush(thumbGrad));
+
+ // center line
+ p->fillRect(cr.x(), ipos + d_thumbHalf, cr.width(), 1, pal.dark().color());
+
+ }
}
@@ -506,11 +470,6 @@ double Slider::getValue( const QPoint &p)
int pos;
QRect r = d_sliderRect;
- r.setLeft(r.left() + d_bwTrough);
- r.setRight(r.right() - d_bwTrough);
- r.setTop(r.top() - d_bwTrough);
- r.setBottom(r.bottom() - d_bwTrough);
-
if (d_orient == Qt::Horizontal)
{
@@ -579,21 +538,11 @@ void Slider::getScrollMode( QPoint &p, const Qt::MouseButton &button, int &scrol
QPoint cp;
int ipos,dist1;
double rpos;
- int lineDist;
-
- if(d_bwTrough > 0)
- cr.setRect(d_sliderRect.x() + d_bwTrough,
- d_sliderRect.y() + d_bwTrough,
- d_sliderRect.width() - 2*d_bwTrough,
- d_sliderRect.height() - 2*d_bwTrough);
- else
- cr = d_sliderRect;
+
+ cr = d_sliderRect;
rpos = (value() - minValue()) / (maxValue() - minValue());
- lineDist = d_borderWidth - 1;
- if(lineDist < 1) lineDist = 1;
-
if(d_orient == Qt::Horizontal)
{
dist1 = int(double(cr.width() - d_thumbLength) * rpos);
@@ -687,7 +636,7 @@ void Slider::resizeEvent(QResizeEvent *e)
d_resized = TRUE;
QSize s = e->size();
- int sliderWidth = d_thumbWidth + 2 * d_bwTrough;
+ int sliderWidth = d_thumbWidth;
// reposition slider
if(d_orient == Qt::Horizontal)
@@ -701,9 +650,9 @@ void Slider::resizeEvent(QResizeEvent *e)
- d_yMargin - sliderWidth,
s.width() - 2 * d_xMargin,
sliderWidth);
- d_scale.setGeometry(d_sliderRect.x() + d_bwTrough + d_thumbHalf,
+ d_scale.setGeometry(d_sliderRect.x() + d_thumbHalf,
d_sliderRect.y() - d_scaleDist,
- d_sliderRect.width() - d_thumbLength - 2*d_bwTrough,
+ d_sliderRect.width() - d_thumbLength,
ScaleDraw::Top);
break;
@@ -714,9 +663,9 @@ void Slider::resizeEvent(QResizeEvent *e)
this->rect().y() + d_yMargin,
s.width() - 2*d_xMargin,
sliderWidth);
- d_scale.setGeometry(d_sliderRect.x() + d_bwTrough + d_thumbHalf,
+ d_scale.setGeometry(d_sliderRect.x() + d_thumbHalf,
d_sliderRect.y() + d_sliderRect.height() + d_scaleDist,
- d_sliderRect.width() - d_thumbLength - 2*d_bwTrough,
+ d_sliderRect.width() - d_thumbLength,
ScaleDraw::Bottom);
break;
@@ -727,7 +676,7 @@ void Slider::resizeEvent(QResizeEvent *e)
break;
}
}
- else
+ else // d_orient == Qt::Vertical
{
switch(d_scalePos)
{
@@ -738,8 +687,8 @@ void Slider::resizeEvent(QResizeEvent *e)
sliderWidth,
s.height() - 2 * d_yMargin);
d_scale.setGeometry(d_sliderRect.x() - d_scaleDist,
- d_sliderRect.y() + d_thumbHalf + d_bwTrough,
- s.height() - d_thumbLength - 2*d_bwTrough,
+ d_sliderRect.y() + d_thumbHalf,
+ s.height() - d_thumbLength,
ScaleDraw::Left);
break;
@@ -750,8 +699,8 @@ void Slider::resizeEvent(QResizeEvent *e)
s.height() - 2* d_yMargin);
d_scale.setGeometry(this->rect().x() + d_sliderRect.width()
+ d_scaleDist,
- d_sliderRect.y() + d_thumbHalf + d_bwTrough,
- s.height() - d_thumbLength - 2*d_bwTrough,
+ d_sliderRect.y() + d_thumbHalf,
+ s.height() - d_thumbLength,
ScaleDraw::Right);
break;
default:
@@ -759,8 +708,8 @@ void Slider::resizeEvent(QResizeEvent *e)
s.width(), s.height());
break;
}
- }
+ }
}
//------------------------------------------------------------
@@ -813,8 +762,8 @@ void Slider::rangeChange()
//------------------------------------------------------------
void Slider::setMargins(int hor, int vert)
{
- d_xMargin = qwtMax(0, hor);
- d_yMargin = qwtMin(0, vert);
+ d_xMargin = MusEUtil::qwtMax(0, hor);
+ d_yMargin = MusEUtil::qwtMin(0, vert);
resize(this->size());
}
@@ -847,20 +796,20 @@ QSize Slider::sizeHint() //const ddskrjo
switch(d_orient) {
case Qt::Vertical:
- w = 2*d_xMargin + d_thumbWidth + 2*d_bwTrough + msWidth + d_scaleDist + 2;
+ w = 2*d_xMargin + d_thumbWidth + msWidth + d_scaleDist + 2;
break;
case Qt::Horizontal:
- h = 2*d_yMargin + d_thumbWidth + 2*d_bwTrough + msHeight + d_scaleDist;
+ h = 2*d_yMargin + d_thumbWidth + msHeight + d_scaleDist;
break;
}
}
else { // no scale
switch(d_orient) {
case Qt::Vertical:
- w = 16 + 2 * d_bwTrough;
+ w = 16;
break;
case Qt::Horizontal:
- h = 16 + 2 * d_bwTrough;
+ h = 16;
break;
}
}
@@ -923,3 +872,4 @@ void Slider::setPageStep(double)
{
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/slider.h b/muse2/muse/widgets/slider.h
index 72fcc6ba..a76c5270 100644
--- a/muse2/muse/widgets/slider.h
+++ b/muse2/muse/widgets/slider.h
@@ -4,11 +4,23 @@
// $Id: slider.h,v 1.3.2.2 2008/01/19 13:33:47 wschweer Exp $
//
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+// (C) Copyright 2011 Orcan Ogetbil (ogetbilo at sf.net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SLIDER_H__
@@ -18,6 +30,8 @@
#include "sliderbase.h"
#include "scldraw.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// Slider
//---------------------------------------------------------
@@ -28,7 +42,7 @@ class Slider : public SliderBase, public ScaleIf
public:
enum ScalePos { None, Left, Right, Top, Bottom };
- enum { BgTrough = 0x1, BgSlot = 0x2 };
+ enum RoundCorner { UpperLeft = 0x1, UpperRight = 0x2, LowerLeft = 0x4, LowerRight = 0x8 };
private:
Q_PROPERTY( double lineStep READ lineStep WRITE setLineStep )
@@ -40,11 +54,12 @@ class Slider : public SliderBase, public ScaleIf
int d_thumbLength;
int d_thumbHalf;
int d_thumbWidth;
- int d_borderWidth;
- int d_bwTrough;
int d_scaleDist;
int d_xMargin;
int d_yMargin;
+ int d_mMargin;
+
+ QColor d_fillColor;
int d_resized;
bool d_autoResize;
@@ -55,6 +70,8 @@ class Slider : public SliderBase, public ScaleIf
int d_bgStyle;
int markerPos;
+ QPainterPath roundedPath(int x, int y, int w, int h, int xrad, int yrad, RoundCorner roundCorner);
+ QPainterPath roundedPath(QRect r, int xrad, int yrad, RoundCorner roundCorner);
void drawHsBgSlot(QPainter *, const QRect&, const QRect&,const QBrush&);
void drawVsBgSlot(QPainter *, const QRect&, const QRect&,const QBrush&);
@@ -71,9 +88,9 @@ class Slider : public SliderBase, public ScaleIf
public:
Slider(QWidget *parent, const char *name = 0,
- Qt::Orientation orient = Qt::Vertical,
- ScalePos scalePos = None,
- int bgStyle = BgTrough);
+ Qt::Orientation orient = Qt::Vertical,
+ ScalePos scalePos = None,
+ QColor fillColor = QColor(100, 100, 255));
~Slider();
void setThumbLength(int l);
@@ -88,8 +105,10 @@ class Slider : public SliderBase, public ScaleIf
void setLineStep(double);
void setPageStep(double);
- void setBorderWidth(int bw);
void setMargins(int x, int y);
QSize sizeHint(); // const;
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/sliderbase.cpp b/muse2/muse/widgets/sliderbase.cpp
index 320e1bc3..8b85878e 100644
--- a/muse2/muse/widgets/sliderbase.cpp
+++ b/muse2/muse/widgets/sliderbase.cpp
@@ -4,11 +4,22 @@
// $Id: sliderbase.cpp,v 1.4.2.4 2007/01/27 14:52:43 spamatica Exp $
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
@@ -18,6 +29,8 @@
#include <QMouseEvent>
#include <QTimerEvent>
+namespace MusEWidget {
+
// DESCRIPTION
// SliderBase is a base class for
// slider widgets. QwtSliderBase handles the mouse events
@@ -171,7 +184,7 @@ void SliderBase::mousePressEvent(QMouseEvent *e)
d_mouseOffset = 0;
DoubleRange::incPages(d_direction);
emit sliderMoved(value(), _id);
- d_tmrID = startTimer(qwtMax(250, 2 * d_updTime));
+ d_tmrID = startTimer(MusEUtil::qwtMax(250, 2 * d_updTime));
break;
case ScrMouse:
@@ -716,6 +729,7 @@ void SliderBase::stepPages(int pages)
//
//------------------------------------------------------------
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/sliderbase.h b/muse2/muse/widgets/sliderbase.h
index 8bfac9c3..39860153 100644
--- a/muse2/muse/widgets/sliderbase.h
+++ b/muse2/muse/widgets/sliderbase.h
@@ -4,11 +4,22 @@
// $Id: sliderbase.h,v 1.4.2.3 2006/11/14 06:28:37 terminator356 Exp $
// Copyright (C) 1997 Josef Wilgen
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License, version 2,
-// as published by the Free Software Foundation.
-//
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SLIDERBASE_H__
@@ -19,6 +30,8 @@
#include <QTime>
#include <QWidget>
+namespace MusEWidget {
+
//---------------------------------------------------------
// SliderBase
//---------------------------------------------------------
@@ -98,4 +111,6 @@ class SliderBase : public QWidget, public DoubleRange
void setId(int i) { _id = i; }
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/songinfo.h b/muse2/muse/widgets/songinfo.h
index d566e00a..8e576876 100644
--- a/muse2/muse/widgets/songinfo.h
+++ b/muse2/muse/widgets/songinfo.h
@@ -3,10 +3,12 @@
// Linux Music Editor
// $Id: songinfo.h,v 1.0.0.0 2010/11/17 01:01:01 ogetbilo Exp $
//
-// Copyright (C) 1999-2010 by Werner Schweer and others
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License version 2.
+// it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; 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
@@ -15,7 +17,7 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//=============================================================================
#include "ui_songinfo.h"
@@ -23,6 +25,8 @@
class QDialog;
+namespace MusEWidget {
+
//---------------------------------------------------------
// SongInfoWidget
// Wrapper around Ui::SongInfo
@@ -35,3 +39,5 @@ class SongInfoWidget : public QDialog, public Ui::SongInfo
public:
SongInfoWidget(QDialog *parent = 0) : QDialog(parent) { setupUi(this); }
};
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/spinbox.cpp b/muse2/muse/widgets/spinbox.cpp
index ee585da7..0111158d 100644
--- a/muse2/muse/widgets/spinbox.cpp
+++ b/muse2/muse/widgets/spinbox.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: spinbox.cpp,v 1.1.2.3 2009/07/09 18:27:11 terminator356 Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QKeyEvent>
#include <QEvent>
#include "spinbox.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// SpinBox
//---------------------------------------------------------
@@ -82,3 +99,4 @@ void SpinBox::stepDown()
_clearFocus = true;
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/spinbox.h b/muse2/muse/widgets/spinbox.h
index 43ff85be..01cd6ad5 100644
--- a/muse2/muse/widgets/spinbox.h
+++ b/muse2/muse/widgets/spinbox.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: spinbox.h,v 1.1.2.2 2009/02/02 21:38:01 terminator356 Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
// SpinBox:
@@ -15,6 +30,8 @@
#include <QSpinBox>
#include <QEvent>
+namespace MusEWidget {
+
//---------------------------------------------------------
// SpinBox
//---------------------------------------------------------
@@ -39,5 +56,7 @@ class SpinBox : public QSpinBox {
SpinBox(int minValue, int maxValue, int step = 1, QWidget* parent=0);
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/spinboxFP.cpp b/muse2/muse/widgets/spinboxFP.cpp
index 2d8f3372..696e589f 100644
--- a/muse2/muse/widgets/spinboxFP.cpp
+++ b/muse2/muse/widgets/spinboxFP.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: spinboxFP.cpp,v 1.1.1.1 2003/10/27 18:55:03 wschweer Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -14,6 +29,8 @@
#include "spinboxFP.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// SpinBoxFP
//---------------------------------------------------------
@@ -169,4 +186,6 @@ int SpinBoxFP::valueFromText(const QString& text) const
return QSpinBox::valueFromText(text);
}
-*/ \ No newline at end of file
+*/
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/spinboxFP.h b/muse2/muse/widgets/spinboxFP.h
index 4c0b75db..81fc4876 100644
--- a/muse2/muse/widgets/spinboxFP.h
+++ b/muse2/muse/widgets/spinboxFP.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: spinboxFP.h,v 1.1.1.1.2.1 2008/05/21 00:28:54 terminator356 Exp $
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SPINBOXFP_H__
@@ -14,6 +29,8 @@
//class QValidator;
//class QDoubleValidator;
+namespace MusEWidget {
+
//---------------------------------------------------------
// SpinBoxFP
//---------------------------------------------------------
@@ -49,5 +66,7 @@ class SpinBoxFP : public QDoubleSpinBox {
//int decimals() const { return _decimals; }
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/splitter.cpp b/muse2/muse/widgets/splitter.cpp
index 96fe2378..09220b24 100644
--- a/muse2/muse/widgets/splitter.cpp
+++ b/muse2/muse/widgets/splitter.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: splitter.cpp,v 1.1.1.1 2003/10/27 18:54:59 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "splitter.h"
@@ -11,6 +26,8 @@
#include <QList>
#include <QStringList>
+namespace MusEWidget {
+
//---------------------------------------------------------
// Splitter
//---------------------------------------------------------
@@ -77,3 +94,5 @@ void Splitter::readStatus(Xml& xml)
}
}
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/splitter.h b/muse2/muse/widgets/splitter.h
index 98a64087..3121fe87 100644
--- a/muse2/muse/widgets/splitter.h
+++ b/muse2/muse/widgets/splitter.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: splitter.h,v 1.1.1.1 2003/10/27 18:54:51 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SPLITTER_H__
@@ -12,6 +27,8 @@
class Xml;
+namespace MusEWidget {
+
//---------------------------------------------------------
// Splitter
//---------------------------------------------------------
@@ -25,5 +42,7 @@ class Splitter : public QSplitter {
void readStatus(Xml&);
};
+}
+
#endif
diff --git a/muse2/muse/widgets/swidget.cpp b/muse2/muse/widgets/swidget.cpp
index 79f5b845..f8461977 100644
--- a/muse2/muse/widgets/swidget.cpp
+++ b/muse2/muse/widgets/swidget.cpp
@@ -3,12 +3,29 @@
// Linux Music Editor
// $Id: swidget.cpp,v 1.1.1.1 2003/10/27 18:54:27 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "swidget.h"
#include <QResizeEvent>
+namespace MusEWidget {
+
//---------------------------------------------------------
// resizeEvent
//---------------------------------------------------------
@@ -18,3 +35,4 @@ void SWidget::resizeEvent(QResizeEvent* ev)
emit heightChanged(ev->size().height());
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/swidget.h b/muse2/muse/widgets/swidget.h
index 45f8cad0..0412ac41 100644
--- a/muse2/muse/widgets/swidget.h
+++ b/muse2/muse/widgets/swidget.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: swidget.h,v 1.1.1.1 2003/10/27 18:54:49 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SWIDGET_H__
@@ -10,6 +25,8 @@
#include <QWidget>
+namespace MusEWidget {
+
//---------------------------------------------------------
// SWidget
// a simple widget which emits a heighChanged signal
@@ -28,5 +45,7 @@ class SWidget : public QWidget {
SWidget(QWidget* parent) : QWidget(parent) {}
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/tb1.cpp b/muse2/muse/widgets/tb1.cpp
index bd8e94a2..272359f0 100644
--- a/muse2/muse/widgets/tb1.cpp
+++ b/muse2/muse/widgets/tb1.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: tb1.cpp,v 1.3.2.2 2007/01/04 00:35:17 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
//#include <assert.h>
@@ -20,6 +35,8 @@
#include "poslabel.h"
#include "pitchlabel.h"
+namespace MusEWidget {
+
static int rasterTable[] = {
//------ 8 4 2
1, 4, 8, 16, 32, 64, 128, 256, 512, 1024,
@@ -193,3 +210,4 @@ void Toolbar1::setPitchMode(bool /*flag*/)
// pitch->setPitchMode(flag);
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/tb1.h b/muse2/muse/widgets/tb1.h
index 3e721e74..93181c39 100644
--- a/muse2/muse/widgets/tb1.h
+++ b/muse2/muse/widgets/tb1.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: tb1.h,v 1.2 2004/01/11 18:55:37 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TB1_H__
@@ -13,11 +28,14 @@
class QToolButton;
class QTableWidget;
-class PosLabel;
-class PitchLabel;
class Track;
class LabelCombo;
+namespace MusEWidget {
+
+class PitchLabel;
+class PosLabel;
+
//---------------------------------------------------------
// Toolbar1
//---------------------------------------------------------
@@ -53,4 +71,6 @@ class Toolbar1 : public QToolBar {
void setPitchMode(bool flag);
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/tempolabel.cpp b/muse2/muse/widgets/tempolabel.cpp
index a26b0b69..cdbc029d 100644
--- a/muse2/muse/widgets/tempolabel.cpp
+++ b/muse2/muse/widgets/tempolabel.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: tempolabel.cpp,v 1.1.1.1 2003/10/27 18:54:29 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QApplication>
@@ -10,6 +25,8 @@
#include "tempolabel.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// TempoLabel
//---------------------------------------------------------
@@ -120,4 +137,4 @@ void TempoEdit::setValue(double val)
// return lrint(60000000.0/value());
// }
-
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/tempolabel.h b/muse2/muse/widgets/tempolabel.h
index 69dc1450..682c1e37 100644
--- a/muse2/muse/widgets/tempolabel.h
+++ b/muse2/muse/widgets/tempolabel.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: tempolabel.h,v 1.1.1.1 2003/10/27 18:55:05 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TEMPOLABEL_H__
@@ -11,6 +26,8 @@
#include <QLabel>
#include <QDoubleSpinBox>
+namespace MusEWidget {
+
//---------------------------------------------------------
// TempoLabel
//---------------------------------------------------------
@@ -59,5 +76,7 @@ class TempoEdit : public QDoubleSpinBox {
//int tempo() const;
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/tools.cpp b/muse2/muse/widgets/tools.cpp
index 31f014ef..ccd0f89b 100644
--- a/muse2/muse/widgets/tools.cpp
+++ b/muse2/muse/widgets/tools.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: tools.cpp,v 1.2 2004/04/28 21:56:13 spamatica Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -13,6 +28,8 @@
#include "icons.h"
#include "action.h"
+namespace MusEWidget {
+
const char* infoPointer = QT_TRANSLATE_NOOP("@default", "select Pointer Tool:\n"
"with the pointer tool you can:\n"
" select parts\n"
@@ -145,3 +162,4 @@ int EditToolBar::curTool()
return -1;
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/tools.h b/muse2/muse/widgets/tools.h
index 2116b958..55c75c4a 100644
--- a/muse2/muse/widgets/tools.h
+++ b/muse2/muse/widgets/tools.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: tools.h,v 1.1.1.1 2003/10/27 18:54:49 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TOOLS_H__
@@ -10,12 +25,15 @@
#include <QToolBar>
-class Action;
class QAction;
class QPixmap;
class QWidget;
+namespace MusEWidget {
+
+class Action;
+
enum Tool {
PointerTool=1,
PencilTool=2,
@@ -66,5 +84,7 @@ class EditToolBar : public QToolBar {
int curTool();
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/transformbase.ui b/muse2/muse/widgets/transformbase.ui
index 578b4a97..ffa56338 100644
--- a/muse2/muse/widgets/transformbase.ui
+++ b/muse2/muse/widgets/transformbase.ui
@@ -417,7 +417,7 @@
</widget>
</item>
<item row="2" column="1">
- <widget class="SpinBoxFP" name="procVal1a">
+ <widget class="MusEWidget::SpinBoxFP" name="procVal1a">
<property name="maximum" stdset="0">
<number>99999999</number>
</property>
@@ -453,21 +453,21 @@
</widget>
</item>
<item row="2" column="2">
- <widget class="SpinBoxFP" name="procVal2a">
+ <widget class="MusEWidget::SpinBoxFP" name="procVal2a">
<property name="maximum" stdset="0">
<number>99999999</number>
</property>
</widget>
</item>
<item row="2" column="3">
- <widget class="SpinBoxFP" name="procLenA">
+ <widget class="MusEWidget::SpinBoxFP" name="procLenA">
<property name="maximum" stdset="0">
<number>99999999</number>
</property>
</widget>
</item>
<item row="2" column="4">
- <widget class="SpinBoxFP" name="procPosA">
+ <widget class="MusEWidget::SpinBoxFP" name="procPosA">
<property name="maximum" stdset="0">
<number>99999999</number>
</property>
@@ -798,14 +798,14 @@
</widget>
</item>
<item row="3" column="4">
- <widget class="SpinBoxFP" name="selBarB">
+ <widget class="MusEWidget::SpinBoxFP" name="selBarB">
<property name="decimals" stdset="0">
<number>3</number>
</property>
</widget>
</item>
<item row="2" column="4">
- <widget class="SpinBoxFP" name="selBarA">
+ <widget class="MusEWidget::SpinBoxFP" name="selBarA">
<property name="minimum" stdset="0">
<number>1000</number>
</property>
@@ -974,7 +974,7 @@
</widget>
</item>
<item>
- <widget class="ComboQuant" name="funcQuantVal" native="true"/>
+ <widget class="MusEWidget::ComboQuant" name="funcQuantVal" native="true"/>
</item>
</layout>
</widget>
@@ -986,12 +986,12 @@
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
<customwidget>
- <class>SpinBoxFP</class>
+ <class>MusEWidget::SpinBoxFP</class>
<extends>QDoubleSpinBox</extends>
<header>spinboxFP.h</header>
</customwidget>
<customwidget>
- <class>ComboQuant</class>
+ <class>MusEWidget::ComboQuant</class>
<extends>QComboBox</extends>
<header>comboQuant.h</header>
</customwidget>
diff --git a/muse2/muse/widgets/ttoolbar.cpp b/muse2/muse/widgets/ttoolbar.cpp
index 774cb34d..dddc42c1 100644
--- a/muse2/muse/widgets/ttoolbar.cpp
+++ b/muse2/muse/widgets/ttoolbar.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ttoolbar.cpp,v 1.1.1.1 2003/10/27 18:54:46 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QAction>
@@ -14,11 +29,11 @@
void syncChanged(bool flag)
{
- startAction->setEnabled(!flag);
- forwardAction->setEnabled(!flag);
- rewindAction->setEnabled(!flag);
- stopAction->setEnabled(!flag);
- playAction->setEnabled(!flag);
+ MusEGlobal::startAction->setEnabled(!flag);
+ MusEGlobal::forwardAction->setEnabled(!flag);
+ MusEGlobal::rewindAction->setEnabled(!flag);
+ MusEGlobal::stopAction->setEnabled(!flag);
+ MusEGlobal::playAction->setEnabled(!flag);
}
diff --git a/muse2/muse/widgets/ttoolbar.h b/muse2/muse/widgets/ttoolbar.h
index b7d34b2d..96f33399 100644
--- a/muse2/muse/widgets/ttoolbar.h
+++ b/muse2/muse/widgets/ttoolbar.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ttoolbar.h,v 1.1.1.1 2003/10/27 18:54:52 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
extern void syncChanged(bool flag);
diff --git a/muse2/muse/widgets/ttoolbutton.cpp b/muse2/muse/widgets/ttoolbutton.cpp
index 324b5fca..6bf43b1f 100644
--- a/muse2/muse/widgets/ttoolbutton.cpp
+++ b/muse2/muse/widgets/ttoolbutton.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ttoolbutton.cpp,v 1.1 2004/02/21 16:53:50 wschweer Exp $
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QPainter>
@@ -12,6 +27,8 @@
#include "gconfig.h"
#include "icons.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// drawButton
//---------------------------------------------------------
@@ -26,4 +43,4 @@ void TransparentToolButton::drawButton(QPainter* p)
p->drawPixmap(QPoint((w - pm.width())/2, (h - pm.height())/2), pm);
}
-
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/ttoolbutton.h b/muse2/muse/widgets/ttoolbutton.h
index b4c54401..b61d2f7c 100644
--- a/muse2/muse/widgets/ttoolbutton.h
+++ b/muse2/muse/widgets/ttoolbutton.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: ttoolbutton.h,v 1.1 2004/02/21 16:53:51 wschweer Exp $
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __TTOOLBUTTON_H__
@@ -10,6 +25,8 @@
#include <QToolButton>
+namespace MusEWidget {
+
//---------------------------------------------------------
// TransparentToolButton
//---------------------------------------------------------
@@ -24,5 +41,7 @@ class TransparentToolButton : public QToolButton {
: QToolButton(parent) {setObjectName(name);}
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/unusedwavefiles.cpp b/muse2/muse/widgets/unusedwavefiles.cpp
index 5a2e620b..07fcbf0c 100644
--- a/muse2/muse/widgets/unusedwavefiles.cpp
+++ b/muse2/muse/widgets/unusedwavefiles.cpp
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/unusedwavefiles.cpp $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#include <stdio.h>
#include <qdir.h>
#include <qfileinfo.h>
@@ -9,6 +31,8 @@
#include "globals.h"
#include "app.h"
+namespace MusEWidget {
+
UnusedWaveFiles::UnusedWaveFiles(QWidget *parent) :
QDialog(parent),
ui(new Ui::UnusedWaveFiles)
@@ -25,10 +49,10 @@ UnusedWaveFiles::UnusedWaveFiles(QWidget *parent) :
void UnusedWaveFiles::findWaveFiles()
{
ui->filelistWidget->clear();
- //printf("museProject =%s\n", museProject.toLatin1().data());
-// QFileInfo proj(museProject);
+ //printf("MusEGlobal::museProject =%s\n", MusEGlobal::museProject.toLatin1().data());
+// QFileInfo proj(MusEGlobal::museProject);
// QString projPath = proj.absolutePath();
- QDir dir(museProject);
+ QDir dir(MusEGlobal::museProject);
QStringList filter;
filter.append("*.wav");
filter.append("*.ogg");
@@ -38,14 +62,14 @@ void UnusedWaveFiles::findWaveFiles()
// get med files
QStringList medFiles;
if (ui->currentProjRadioButton->isChecked()) {
- medFiles.append(muse->projectName());
+ medFiles.append(MusEGlobal::muse->projectName());
} else {
//printf("get ALLL *.med files!\n");
QStringList medFilter("*.med");
medFiles = dir.entryList(medFilter);
}
foreach (QString medFile, medFiles) {
- QString fname = museProject+"/"+ medFile;
+ QString fname = MusEGlobal::museProject+"/"+ medFile;
//printf("fopen %s\n", fname.toLatin1().data());
FILE *fp =fopen(fname.toLatin1().data(),"r");
QTextStream fileContent(fp);
@@ -80,18 +104,20 @@ void UnusedWaveFiles::accept()
int ret = QMessageBox::question(this,"Move files", "Are you sure you want to move away the unused files?",
QMessageBox::Ok, QMessageBox::Cancel);
if (ret == QMessageBox::Ok) {
- QDir currDir(museProject);
+ QDir currDir(MusEGlobal::museProject);
currDir.mkdir("unused");
foreach(QString file, allWaveFiles) {
- QFile::rename(museProject+ "/"+file, museProject + "/unused/" +file);
+ QFile::rename(MusEGlobal::museProject+ "/"+file, MusEGlobal::museProject + "/unused/" +file);
// move the wca file if it exists
- QFileInfo wf(museProject + "/" + file);
- if (QFile::exists(museProject + "/" + wf.baseName()+".wca")) {
- QFile::rename(museProject + "/" + wf.baseName()+".wca", museProject + "/unused/" +wf.baseName()+".wca");
+ QFileInfo wf(MusEGlobal::museProject + "/" + file);
+ if (QFile::exists(MusEGlobal::museProject + "/" + wf.baseName()+".wca")) {
+ QFile::rename(MusEGlobal::museProject + "/" + wf.baseName()+".wca", MusEGlobal::museProject + "/unused/" +wf.baseName()+".wca");
}
}
}
QDialog::accept();
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/unusedwavefiles.h b/muse2/muse/widgets/unusedwavefiles.h
index e28754de..fba41212 100644
--- a/muse2/muse/widgets/unusedwavefiles.h
+++ b/muse2/muse/widgets/unusedwavefiles.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./muse/widgets/unusedwavefiles.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef UNUSEDWAVEFILES_H
#define UNUSEDWAVEFILES_H
@@ -7,6 +29,8 @@ namespace Ui {
class UnusedWaveFiles;
}
+namespace MusEWidget {
+
class UnusedWaveFiles : public QDialog
{
Q_OBJECT
@@ -23,4 +47,6 @@ private:
Ui::UnusedWaveFiles *ui;
};
+} // namespace MusEWidget
+
#endif // UNUSEDWAVEFILES_H
diff --git a/muse2/muse/widgets/utils.cpp b/muse2/muse/widgets/utils.cpp
index 01a5249d..e46d265c 100644
--- a/muse2/muse/widgets/utils.cpp
+++ b/muse2/muse/widgets/utils.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: utils.cpp,v 1.1.1.1.2.3 2009/11/14 03:37:48 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
@@ -19,6 +34,8 @@
#include "utils.h"
+namespace MusEUtil {
+
//---------------------------------------------------------
// curTime
//---------------------------------------------------------
@@ -385,4 +402,6 @@ QGradient gGradientFromQColor(const QColor& c, const QPointF& start, const QPoin
gradient.setColorAt(1, c1);
return gradient;
-} \ No newline at end of file
+}
+
+} // namespace MusEUtils
diff --git a/muse2/muse/widgets/utils.h b/muse2/muse/widgets/utils.h
index b6997023..b74ba394 100644
--- a/muse2/muse/widgets/utils.h
+++ b/muse2/muse/widgets/utils.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: utils.h,v 1.1.1.1.2.3 2009/11/14 03:37:48 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __UTILS_H__
@@ -16,6 +31,7 @@ class QCanvas;
class QPointF;
class QColor;
+namespace MusEUtil {
extern QString bitmap2String(int bm);
extern int string2bitmap(const QString& str);
@@ -30,5 +46,7 @@ extern QFrame* vLine(QWidget* parent);
extern void dump(const unsigned char* p, int n);
extern double curTime();
+} // namespace MusEUtils
+
#endif
diff --git a/muse2/muse/widgets/verticalmeter.cpp b/muse2/muse/widgets/verticalmeter.cpp
index 76f8dcd1..b0e0198f 100644
--- a/muse2/muse/widgets/verticalmeter.cpp
+++ b/muse2/muse/widgets/verticalmeter.cpp
@@ -5,6 +5,21 @@
// redesigned by oget on 2011/08/15
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
@@ -17,6 +32,8 @@
#include "gconfig.h"
#include "fastlog.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// VerticalMeter
//---------------------------------------------------------
@@ -35,7 +52,7 @@ VerticalMeter::VerticalMeter(QWidget* parent, MeterType type)
overflow = false;
val = 0.0;
maxVal = 0.0;
- minScale = mtype == DBMeter ? config.minMeter : 0.0; // min value in dB or int
+ minScale = mtype == DBMeter ? MusEConfig::config.minMeter : 0.0; // min value in dB or int
maxScale = mtype == DBMeter ? 10.0 : 127.0;
yellowScale = -10;
redScale = 0;
@@ -254,3 +271,5 @@ void VerticalMeter::resizeEvent(QResizeEvent* ev)
QRegion maskregion(rounded_rect.toFillPolygon().toPolygon());
setMask(maskregion);
}
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/verticalmeter.h b/muse2/muse/widgets/verticalmeter.h
index 9613ec43..d6bee245 100644
--- a/muse2/muse/widgets/verticalmeter.h
+++ b/muse2/muse/widgets/verticalmeter.h
@@ -4,6 +4,21 @@
// $Id: meter.h,v 1.1.1.1.2.2 2009/05/03 04:14:00 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __VERTICALMETER_H__
@@ -16,6 +31,8 @@ class QResizeEvent;
class QMouseEvent;
class QPainter;
+namespace MusEWidget {
+
class VerticalMeter : public Meter {
Q_OBJECT
@@ -41,5 +58,8 @@ class VerticalMeter : public Meter {
VerticalMeter(QWidget* parent, MeterType type = DBMeter);
void setRange(double min, double max);
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/view.cpp b/muse2/muse/widgets/view.cpp
index 57955c19..9be66ed5 100644
--- a/muse2/muse/widgets/view.cpp
+++ b/muse2/muse/widgets/view.cpp
@@ -4,6 +4,21 @@
// $Id: view.cpp,v 1.3.2.2 2009/04/06 01:24:55 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
// Additions, modifications (C) Copyright 2011 Tim E. Real (terminator356 on users DOT sourceforge DOT net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "view.h"
@@ -27,6 +42,8 @@
// just ate up all the time no matter what I tried.
//#defines VIEW_USE_DOUBLE_BUFFERING 1
+namespace MusEWidget {
+
//---------------------------------------------------------
// View::View
// double xMag = (xmag < 0) ? 1.0/-xmag : double(xmag)
@@ -962,3 +979,5 @@ QRect View::devToVirt(const QRect& r)
return QRect(x, y, w, h);
}
*/
+
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/view.h b/muse2/muse/widgets/view.h
index a932f173..e5f33657 100644
--- a/muse2/muse/widgets/view.h
+++ b/muse2/muse/widgets/view.h
@@ -4,6 +4,21 @@
// $Id: view.h,v 1.2.2.1 2008/01/26 07:23:21 terminator356 Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
// Additions, modifications (C) Copyright 2011 Tim E. Real (terminator356 on users DOT sourceforge DOT net)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __VIEW_H__
@@ -19,6 +34,8 @@ class QPainter;
class QPixmap;
class QResizeEvent;
+namespace MusEWidget {
+
//---------------------------------------------------------
// View
// horizontal View with double buffering
@@ -111,5 +128,7 @@ class View : public QWidget {
int rmapx(int x) const;
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/visibletracks.cpp b/muse2/muse/widgets/visibletracks.cpp
index f6acf206..1b549975 100644
--- a/muse2/muse/widgets/visibletracks.cpp
+++ b/muse2/muse/widgets/visibletracks.cpp
@@ -4,6 +4,21 @@
// $Id: tools.cpp,v 1.2 2004/04/28 21:56:13 spamatica Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
// (C) Copyright 2011 Robert Jonsson (rj@spamatica.se)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <QActionGroup>
@@ -15,6 +30,8 @@
#include "track.h"
#include "synth.h"
+namespace MusEWidget {
+
const char* waveTrack = QT_TRANSLATE_NOOP("@default", "Show wave tracks");
const char* groupTrack = QT_TRANSLATE_NOOP("@default", "Show group tracks");
const char* auxTrack = QT_TRANSLATE_NOOP("@default", "Show aux tracks");
@@ -125,3 +142,4 @@ VisibleTracks::~VisibleTracks()
delete actions;
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/visibletracks.h b/muse2/muse/widgets/visibletracks.h
index 2f17e323..b0e92d26 100644
--- a/muse2/muse/widgets/visibletracks.h
+++ b/muse2/muse/widgets/visibletracks.h
@@ -4,18 +4,35 @@
// $Id: tools.h,v 1.1.1.1 2003/10/27 18:54:49 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
// (C) Copyright 2011 Robert Jonsson (rj@spamatica.se)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef VISIBLETRACKS_H
#define VISIBLETRACKS_H
#include <QToolBar>
-class Action;
-
class QAction;
class QPixmap;
class QWidget;
+namespace MusEWidget {
+
+class Action;
+
struct VisibleToolB {
QPixmap** icon;
const char* tip;
@@ -45,6 +62,6 @@ class VisibleTracks : public QToolBar {
~VisibleTracks();
};
-
+} // namespace MusEWidget
#endif // VISIBLETRACKS_H
diff --git a/muse2/muse/widgets/vscale.cpp b/muse2/muse/widgets/vscale.cpp
index 943124e5..22af7889 100644
--- a/muse2/muse/widgets/vscale.cpp
+++ b/muse2/muse/widgets/vscale.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: vscale.cpp,v 1.1.1.1 2003/10/27 18:54:41 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "vscale.h"
@@ -10,6 +25,8 @@
#include <QPainter>
#include <QPaintEvent>
+namespace MusEWidget {
+
//---------------------------------------------------------
// paintEvent
//---------------------------------------------------------
@@ -26,3 +43,4 @@ void VScale::paintEvent(QPaintEvent*)
p.end();
}
+} // namespace MusEWidget
diff --git a/muse2/muse/widgets/vscale.h b/muse2/muse/widgets/vscale.h
index 100c5fb2..e926b3cb 100644
--- a/muse2/muse/widgets/vscale.h
+++ b/muse2/muse/widgets/vscale.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: vscale.h,v 1.1.1.1.2.1 2008/01/19 13:33:47 wschweer Exp $
// (C) Copyright 1999 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __VSCALE_H__
@@ -12,6 +27,8 @@
class QPaintEvent;
+namespace MusEWidget {
+
//---------------------------------------------------------
// VScale
//---------------------------------------------------------
@@ -25,5 +42,7 @@ class VScale : public QWidget {
VScale(QWidget* parent=0) : QWidget(parent) {setFixedWidth(18);}
};
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/widgets/wtscale.cpp b/muse2/muse/widgets/wtscale.cpp
index 2c02b631..3b6aa6eb 100644
--- a/muse2/muse/widgets/wtscale.cpp
+++ b/muse2/muse/widgets/wtscale.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: wtscale.cpp,v 1.3 2004/04/11 13:03:32 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <values.h>
@@ -18,6 +33,8 @@
#include "../marker/marker.h"
#include "icons.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// WTScale
// Wave Time Scale
@@ -284,3 +301,5 @@ void WTScale::pdraw(QPainter& p, const QRect& r)
}
}
+} // namespace MusEWidget
+
diff --git a/muse2/muse/widgets/wtscale.h b/muse2/muse/widgets/wtscale.h
index f12bbc6f..b25de627 100644
--- a/muse2/muse/widgets/wtscale.h
+++ b/muse2/muse/widgets/wtscale.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: wtscale.h,v 1.2 2004/01/11 18:55:37 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MTSCALE_H__
@@ -10,6 +25,8 @@
#include "view.h"
+namespace MusEWidget {
+
//---------------------------------------------------------
// WTScale
// scale for wave track
@@ -42,5 +59,8 @@ class WTScale : public View {
WTScale(int* raster, QWidget* parent, int xscale);
void setBarLocator(bool f) { barLocator = f; }
};
+
+} // namespace MusEWidget
+
#endif
diff --git a/muse2/muse/xml.cpp b/muse2/muse/xml.cpp
index 6a12283e..0487dda5 100644
--- a/muse2/muse/xml.cpp
+++ b/muse2/muse/xml.cpp
@@ -4,6 +4,21 @@
// $Id: xml.cpp,v 1.17.2.6 2009/12/07 20:48:45 spamatica Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdio.h>
diff --git a/muse2/muse/xml.h b/muse2/muse/xml.h
index 646c1a12..2d2b2ee1 100644
--- a/muse2/muse/xml.h
+++ b/muse2/muse/xml.h
@@ -4,6 +4,21 @@
// $Id: xml.h,v 1.8.2.3 2009/11/09 20:28:28 terminator356 Exp $
//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __XML_H__
diff --git a/muse2/packaging/CMakeLists.txt b/muse2/packaging/CMakeLists.txt
index 2582848a..0cf5c0a6 100644
--- a/muse2/packaging/CMakeLists.txt
+++ b/muse2/packaging/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
#
diff --git a/muse2/plugins/CMakeLists.txt b/muse2/plugins/CMakeLists.txt
index 1293902f..fc60c3d3 100644
--- a/muse2/plugins/CMakeLists.txt
+++ b/muse2/plugins/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
subdirs( freeverb doublechorus pandelay )
diff --git a/muse2/plugins/doublechorus/CMakeLists.txt b/muse2/plugins/doublechorus/CMakeLists.txt
index 04ea864f..41ec2ace 100644
--- a/muse2/plugins/doublechorus/CMakeLists.txt
+++ b/muse2/plugins/doublechorus/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/plugins/doublechorus/doublechorus.cpp b/muse2/plugins/doublechorus/doublechorus.cpp
index 27d84336..1e1be881 100644
--- a/muse2/plugins/doublechorus/doublechorus.cpp
+++ b/muse2/plugins/doublechorus/doublechorus.cpp
@@ -2,6 +2,21 @@
// DoubleChorus for MusE
//
// (C) Copyright 2006 Nil Geisweiller
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "doublechorusmodel.h"
diff --git a/muse2/plugins/doublechorus/doublechorusmodel.cpp b/muse2/plugins/doublechorus/doublechorusmodel.cpp
index 01def026..ca655f2f 100644
--- a/muse2/plugins/doublechorus/doublechorusmodel.cpp
+++ b/muse2/plugins/doublechorus/doublechorusmodel.cpp
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#include "doublechorusmodel.h"
diff --git a/muse2/plugins/doublechorus/doublechorusmodel.h b/muse2/plugins/doublechorus/doublechorusmodel.h
index 40ce9f3f..2eea805c 100644
--- a/muse2/plugins/doublechorus/doublechorusmodel.h
+++ b/muse2/plugins/doublechorus/doublechorusmodel.h
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#ifndef __DOUBLECHORUSMODEL_H
diff --git a/muse2/plugins/doublechorus/simplechorusmodel.cpp b/muse2/plugins/doublechorus/simplechorusmodel.cpp
index 72015465..cd9e4da1 100644
--- a/muse2/plugins/doublechorus/simplechorusmodel.cpp
+++ b/muse2/plugins/doublechorus/simplechorusmodel.cpp
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#include "simplechorusmodel.h"
diff --git a/muse2/plugins/doublechorus/simplechorusmodel.h b/muse2/plugins/doublechorus/simplechorusmodel.h
index 797e7030..efe552b7 100644
--- a/muse2/plugins/doublechorus/simplechorusmodel.h
+++ b/muse2/plugins/doublechorus/simplechorusmodel.h
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#ifndef __SIMPLECHORUSMODEL_H
diff --git a/muse2/plugins/freeverb/CMakeLists.txt b/muse2/plugins/freeverb/CMakeLists.txt
index da43dc98..9dfd9b1e 100644
--- a/muse2/plugins/freeverb/CMakeLists.txt
+++ b/muse2/plugins/freeverb/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/plugins/freeverb/allpass.h b/muse2/plugins/freeverb/allpass.h
index 4eb1c1a0..911a2c8a 100644
--- a/muse2/plugins/freeverb/allpass.h
+++ b/muse2/plugins/freeverb/allpass.h
@@ -1,8 +1,15 @@
-// Allpass filter declaration
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./plugins/freeverb/allpass.h $
//
// Written by Jezar at Dreampoint, June 2000
// http://www.dreampoint.co.uk
// This code is public domain
+//
+//=========================================================
+// Allpass filter declaration
+//
#ifndef _allpass_
#define _allpass_
diff --git a/muse2/plugins/freeverb/comb.h b/muse2/plugins/freeverb/comb.h
index d2e0f871..5d70e0b1 100644
--- a/muse2/plugins/freeverb/comb.h
+++ b/muse2/plugins/freeverb/comb.h
@@ -1,8 +1,15 @@
-// Comb filter class declaration
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./plugins/freeverb/comb.h $
//
// Written by Jezar at Dreampoint, June 2000
// http://www.dreampoint.co.uk
// This code is public domain
+//
+//=========================================================
+// Comb filter class declaration
+//
#ifndef _comb_
#define _comb_
diff --git a/muse2/plugins/freeverb/denormals.h b/muse2/plugins/freeverb/denormals.h
index d18412b4..ce3d77f6 100644
--- a/muse2/plugins/freeverb/denormals.h
+++ b/muse2/plugins/freeverb/denormals.h
@@ -1,9 +1,16 @@
-// Macro for killing denormalled numbers
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./plugins/freeverb/denormals.h $
//
// Written by Jezar at Dreampoint, June 2000
// http://www.dreampoint.co.uk
// Based on IS_DENORMAL macro by Jon Watte
// This code is public domain
+//
+//=========================================================
+// Macro for killing denormalled numbers
+//
#ifndef _denormals_
#define _denormals_
diff --git a/muse2/plugins/freeverb/freeverb.cpp b/muse2/plugins/freeverb/freeverb.cpp
index 0385e887..d7b65b89 100644
--- a/muse2/plugins/freeverb/freeverb.cpp
+++ b/muse2/plugins/freeverb/freeverb.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: freeverb.cpp,v 1.1.1.1 2003/10/27 18:57:03 wschweer Exp $
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "revmodel.h"
diff --git a/muse2/plugins/freeverb/revmodel.cpp b/muse2/plugins/freeverb/revmodel.cpp
index c72ee22b..e0f2e0b4 100644
--- a/muse2/plugins/freeverb/revmodel.cpp
+++ b/muse2/plugins/freeverb/revmodel.cpp
@@ -1,8 +1,15 @@
-// Reverb model implementation
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./plugins/freeverb/revmodel.cpp $
//
// Written by Jezar at Dreampoint, June 2000
// http://www.dreampoint.co.uk
// This code is public domain
+//
+//=========================================================
+// Reverb model implementation
+//
#include <stdio.h>
#include "revmodel.h"
diff --git a/muse2/plugins/freeverb/revmodel.h b/muse2/plugins/freeverb/revmodel.h
index bfa1f0b3..a143679a 100644
--- a/muse2/plugins/freeverb/revmodel.h
+++ b/muse2/plugins/freeverb/revmodel.h
@@ -1,8 +1,15 @@
-// Reverb model declaration
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./plugins/freeverb/revmodel.h $
+//
//
// Written by Jezar at Dreampoint, June 2000
// http://www.dreampoint.co.uk
// This code is public domain
+//
+//=========================================================
+// Reverb model declaration
#ifndef _revmodel_
#define _revmodel_
diff --git a/muse2/plugins/freeverb/tuning.h b/muse2/plugins/freeverb/tuning.h
index ced89252..206209b6 100644
--- a/muse2/plugins/freeverb/tuning.h
+++ b/muse2/plugins/freeverb/tuning.h
@@ -1,8 +1,15 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./plugins/freeverb/tuning.h $
+//
// Reverb model tuning values
//
// Written by Jezar at Dreampoint, June 2000
// http://www.dreampoint.co.uk
// This code is public domain
+//
+//=========================================================
#ifndef _tuning_
#define _tuning_
diff --git a/muse2/plugins/pandelay/CMakeLists.txt b/muse2/plugins/pandelay/CMakeLists.txt
index 02900cb3..8f2be5c8 100644
--- a/muse2/plugins/pandelay/CMakeLists.txt
+++ b/muse2/plugins/pandelay/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/plugins/pandelay/ladspapandelay.cpp b/muse2/plugins/pandelay/ladspapandelay.cpp
index b5680d3e..90ff3bb8 100644
--- a/muse2/plugins/pandelay/ladspapandelay.cpp
+++ b/muse2/plugins/pandelay/ladspapandelay.cpp
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#include "ladspapandelay.h"
diff --git a/muse2/plugins/pandelay/ladspapandelay.h b/muse2/plugins/pandelay/ladspapandelay.h
index dd7fc0ea..b72932a4 100644
--- a/muse2/plugins/pandelay/ladspapandelay.h
+++ b/muse2/plugins/pandelay/ladspapandelay.h
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#ifndef __LADSPAPANDELAY_H
diff --git a/muse2/plugins/pandelay/pandelay.cpp b/muse2/plugins/pandelay/pandelay.cpp
index 18ce1a41..3995888c 100644
--- a/muse2/plugins/pandelay/pandelay.cpp
+++ b/muse2/plugins/pandelay/pandelay.cpp
@@ -2,6 +2,21 @@
// PanDelay for MusE
//
// (C) Copyright 2006 Nil Geisweiller
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "ladspapandelay.h"
diff --git a/muse2/plugins/pandelay/pandelaymodel.cpp b/muse2/plugins/pandelay/pandelaymodel.cpp
index a30d0646..aa8d872a 100644
--- a/muse2/plugins/pandelay/pandelaymodel.cpp
+++ b/muse2/plugins/pandelay/pandelaymodel.cpp
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#include "pandelaymodel.h"
diff --git a/muse2/plugins/pandelay/pandelaymodel.h b/muse2/plugins/pandelay/pandelaymodel.h
index e3f74bcd..928cb287 100644
--- a/muse2/plugins/pandelay/pandelaymodel.h
+++ b/muse2/plugins/pandelay/pandelaymodel.h
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#ifndef __PANDELAYMODEL_H
diff --git a/muse2/share/CMakeLists.txt b/muse2/share/CMakeLists.txt
index 44b02269..d25bcec9 100644
--- a/muse2/share/CMakeLists.txt
+++ b/muse2/share/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
# NOTE: locale/ directory needs to be at the end so that the translations
diff --git a/muse2/share/drummaps/CMakeLists.txt b/muse2/share/drummaps/CMakeLists.txt
index 92af890a..06602192 100644
--- a/muse2/share/drummaps/CMakeLists.txt
+++ b/muse2/share/drummaps/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file (GLOB drummaps_files *.map)
diff --git a/muse2/share/html/CMakeLists.txt b/muse2/share/html/CMakeLists.txt
index e771637a..b9417ad1 100644
--- a/muse2/share/html/CMakeLists.txt
+++ b/muse2/share/html/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file (GLOB html_files
diff --git a/muse2/share/html/COPYING.html b/muse2/share/html/COPYING.html
index 86b6fa8e..8c84ced7 100644
--- a/muse2/share/html/COPYING.html
+++ b/muse2/share/html/COPYING.html
@@ -13,7 +13,7 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
diff --git a/muse2/share/instruments/CMakeLists.txt b/muse2/share/instruments/CMakeLists.txt
index 5338d7b3..cfebdce4 100644
--- a/muse2/share/instruments/CMakeLists.txt
+++ b/muse2/share/instruments/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file (GLOB instruments_files *.idf)
diff --git a/muse2/share/locale/CMakeLists.txt b/muse2/share/locale/CMakeLists.txt
index 112cd56b..f43d9404 100644
--- a/muse2/share/locale/CMakeLists.txt
+++ b/muse2/share/locale/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file (GLOB TRANSLATIONS_FILES *.ts)
diff --git a/muse2/share/plugins/CMakeLists.txt b/muse2/share/plugins/CMakeLists.txt
index 9aa4b92c..afb5be2a 100644
--- a/muse2/share/plugins/CMakeLists.txt
+++ b/muse2/share/plugins/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file (GLOB plugins_ui_files *.ui)
diff --git a/muse2/share/pybridge/CMakeLists.txt b/muse2/share/pybridge/CMakeLists.txt
index bee3a0d0..cf682205 100644
--- a/muse2/share/pybridge/CMakeLists.txt
+++ b/muse2/share/pybridge/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file (GLOB pybridge_files *.py)
diff --git a/muse2/share/pybridge/examples/addpartexample.py b/muse2/share/pybridge/examples/addpartexample.py
index 65c41bdf..d079e49f 100644
--- a/muse2/share/pybridge/examples/addpartexample.py
+++ b/muse2/share/pybridge/examples/addpartexample.py
@@ -3,6 +3,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//=========================================================
"""
diff --git a/muse2/share/pybridge/examples/addtrack.py b/muse2/share/pybridge/examples/addtrack.py
index 116b35c0..28b381ec 100644
--- a/muse2/share/pybridge/examples/addtrack.py
+++ b/muse2/share/pybridge/examples/addtrack.py
@@ -3,6 +3,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//=========================================================
"""
diff --git a/muse2/share/pybridge/examples/ctrlexample.py b/muse2/share/pybridge/examples/ctrlexample.py
index 9e28afad..c625b0d4 100644
--- a/muse2/share/pybridge/examples/ctrlexample.py
+++ b/muse2/share/pybridge/examples/ctrlexample.py
@@ -3,6 +3,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//=========================================================
"""
diff --git a/muse2/share/pybridge/examples/effecttoggle.py b/muse2/share/pybridge/examples/effecttoggle.py
index 6feb4bca..f72c15f3 100644
--- a/muse2/share/pybridge/examples/effecttoggle.py
+++ b/muse2/share/pybridge/examples/effecttoggle.py
@@ -3,6 +3,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//=========================================================
"""
diff --git a/muse2/share/pybridge/examples/mute.py b/muse2/share/pybridge/examples/mute.py
index 5732a7f8..224f93b2 100644
--- a/muse2/share/pybridge/examples/mute.py
+++ b/muse2/share/pybridge/examples/mute.py
@@ -3,6 +3,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//=========================================================
"""
diff --git a/muse2/share/pybridge/examples/repeatpart.py b/muse2/share/pybridge/examples/repeatpart.py
index e2b8ff31..9df75e2c 100644
--- a/muse2/share/pybridge/examples/repeatpart.py
+++ b/muse2/share/pybridge/examples/repeatpart.py
@@ -3,6 +3,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//=========================================================
"""
diff --git a/muse2/share/pybridge/examples/setpositionexample.py b/muse2/share/pybridge/examples/setpositionexample.py
index 476410d9..6f4ff44b 100644
--- a/muse2/share/pybridge/examples/setpositionexample.py
+++ b/muse2/share/pybridge/examples/setpositionexample.py
@@ -3,6 +3,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//=========================================================
"""
diff --git a/muse2/share/pybridge/examples/tempoexample.py b/muse2/share/pybridge/examples/tempoexample.py
index ed12638d..72d0598c 100644
--- a/muse2/share/pybridge/examples/tempoexample.py
+++ b/muse2/share/pybridge/examples/tempoexample.py
@@ -1,3 +1,26 @@
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 1999-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
+
import Pyro.core
muse=Pyro.core.getProxyForURI('PYRONAME://:Default.muse')
diff --git a/muse2/share/pybridge/examples/trackparamchangeexample.py b/muse2/share/pybridge/examples/trackparamchangeexample.py
index 0681ccb4..aa7b947a 100644
--- a/muse2/share/pybridge/examples/trackparamchangeexample.py
+++ b/muse2/share/pybridge/examples/trackparamchangeexample.py
@@ -3,6 +3,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//=========================================================
"""
import Pyro.core
diff --git a/muse2/share/pybridge/musepclient.py b/muse2/share/pybridge/musepclient.py
index dc87e4e8..14128118 100644
--- a/muse2/share/pybridge/musepclient.py
+++ b/muse2/share/pybridge/musepclient.py
@@ -1,3 +1,26 @@
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 1999-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
+
#
# Example client for MusE Pyro bridge (Python Remote Object)
#
diff --git a/muse2/share/pybridge/museplauncher.py b/muse2/share/pybridge/museplauncher.py
index 24206213..4a1b5c19 100644
--- a/muse2/share/pybridge/museplauncher.py
+++ b/muse2/share/pybridge/museplauncher.py
@@ -3,6 +3,21 @@
// MusE
// Linux Music Editor
// (C) Copyright 2009 Mathias Gyllengahm (lunar_shuttle@users.sf.net)
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
//=========================================================
This file is used by MusE for launching a Pyro name service and connecting a remote object to the global Python functions
diff --git a/muse2/share/pybridge/parter/main.py b/muse2/share/pybridge/parter/main.py
index 40b85734..b5ca9f21 100644
--- a/muse2/share/pybridge/parter/main.py
+++ b/muse2/share/pybridge/parter/main.py
@@ -1,3 +1,26 @@
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 1999-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
+
import sys,time
from PyQt4 import QtGui
diff --git a/muse2/share/pybridge/parter/parter.py b/muse2/share/pybridge/parter/parter.py
index 889b00a1..4300993a 100644
--- a/muse2/share/pybridge/parter/parter.py
+++ b/muse2/share/pybridge/parter/parter.py
@@ -1,3 +1,26 @@
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 1999-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
+
import sys,time,os
from PyQt4 import QtGui, QtCore
from PyQt4.QtGui import QFileDialog, QListView, QStringListModel, QButtonGroup, QPushButton
diff --git a/muse2/share/pybridge/robert.py b/muse2/share/pybridge/robert.py
index 2de8e1ab..6d57a127 100644
--- a/muse2/share/pybridge/robert.py
+++ b/muse2/share/pybridge/robert.py
@@ -1,4 +1,26 @@
# -*- coding: utf-8 -*-
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 1999-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
#
# Example client for MusE Pyro bridge (Python Remote Object)
#
diff --git a/muse2/share/scoreglyphs/CMakeLists.txt b/muse2/share/scoreglyphs/CMakeLists.txt
index fe520892..ceceaeca 100644
--- a/muse2/share/scoreglyphs/CMakeLists.txt
+++ b/muse2/share/scoreglyphs/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file (GLOB scoreglyph_files *.png)
diff --git a/muse2/share/scripts/CMakeLists.txt b/muse2/share/scripts/CMakeLists.txt
index 5a7be7db..3a16ea26 100644
--- a/muse2/share/scripts/CMakeLists.txt
+++ b/muse2/share/scripts/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file(GLOB script_files
diff --git a/muse2/share/scripts/ConstantLength b/muse2/share/scripts/ConstantLength
index f03addcd..70e3fd97 100755
--- a/muse2/share/scripts/ConstantLength
+++ b/muse2/share/scripts/ConstantLength
@@ -1,5 +1,27 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 2002-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
import sys,time
from PyQt4 import QtGui, QtCore
diff --git a/muse2/share/scripts/DoNothing b/muse2/share/scripts/DoNothing
index a3d92c7d..229a3e76 100755
--- a/muse2/share/scripts/DoNothing
+++ b/muse2/share/scripts/DoNothing
@@ -1,5 +1,28 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 2002-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
+
import sys
testFile = file(sys.argv[1],"r")
inputEvents = testFile.readlines()
diff --git a/muse2/share/scripts/DoubleSpeed b/muse2/share/scripts/DoubleSpeed
index da6d0c2e..a82bbc1f 100755
--- a/muse2/share/scripts/DoubleSpeed
+++ b/muse2/share/scripts/DoubleSpeed
@@ -3,6 +3,28 @@
# MusE external midi processing script
# By: Mathias Gyllengahm 2009
# DoubleSpeed
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 2002-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
import sys,time
testFile = file(sys.argv[1],"r")
diff --git a/muse2/share/scripts/RemoveShortEvents b/muse2/share/scripts/RemoveShortEvents
index cc6735b2..e386c825 100755
--- a/muse2/share/scripts/RemoveShortEvents
+++ b/muse2/share/scripts/RemoveShortEvents
@@ -3,6 +3,29 @@
# MusE external midi processing script
# By: Robert Jonsson 2009
# RemoveShortEvents
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 2002-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
+
import sys,time
from PyQt4 import QtGui, QtCore
diff --git a/muse2/share/scripts/SwingQuantize1 b/muse2/share/scripts/SwingQuantize1
index 11fded84..e0d37f9a 100755
--- a/muse2/share/scripts/SwingQuantize1
+++ b/muse2/share/scripts/SwingQuantize1
@@ -3,6 +3,29 @@
# MusE external midi processing script
# By: Robert Jonsson 2009
# Quantize
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 2002-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
+
import sys,time
from PyQt4 import QtGui, QtCore
diff --git a/muse2/share/templates/CMakeLists.txt b/muse2/share/templates/CMakeLists.txt
index 3bdb6d8a..4db9f59b 100644
--- a/muse2/share/templates/CMakeLists.txt
+++ b/muse2/share/templates/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file (GLOB templates_files *.med)
diff --git a/muse2/share/wallpapers/CMakeLists.txt b/muse2/share/wallpapers/CMakeLists.txt
index f2ffef6d..4ccbd56a 100644
--- a/muse2/share/wallpapers/CMakeLists.txt
+++ b/muse2/share/wallpapers/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file (GLOB wallpapers_files *.gif *.jpg *.png)
diff --git a/muse2/synti/CMakeLists.txt b/muse2/synti/CMakeLists.txt
index 73e6d349..f239fde2 100644
--- a/muse2/synti/CMakeLists.txt
+++ b/muse2/synti/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
include_directories(
diff --git a/muse2/synti/deicsonze/CMakeLists.txt b/muse2/synti/deicsonze/CMakeLists.txt
index c311b05a..ee987fbd 100644
--- a/muse2/synti/deicsonze/CMakeLists.txt
+++ b/muse2/synti/deicsonze/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/synti/deicsonze/common_defs.h b/muse2/synti/deicsonze/common_defs.h
index 3c433e2a..912b345c 100644
--- a/muse2/synti/deicsonze/common_defs.h
+++ b/muse2/synti/deicsonze/common_defs.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./synti/deicsonze/common_defs.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef __DEICSONZE_UNIQUE_ID_H
#define __DEICSONZE_UNIQUE_ID_H
diff --git a/muse2/synti/deicsonze/deicsonze.cpp b/muse2/synti/deicsonze/deicsonze.cpp
index bffedf53..01608fcb 100644
--- a/muse2/synti/deicsonze/deicsonze.cpp
+++ b/muse2/synti/deicsonze/deicsonze.cpp
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
// #include <cmath>
@@ -125,7 +125,7 @@ DeicsOnze::DeicsOnze() : Mess(2) {
_saveConfig = true;
_isInitSet = true; //false if an initial bank must be download
- QString sharePath(museGlobalShare);
+ QString sharePath(MusEGlobal::museGlobalShare);
_initSetPath = sharePath + QString("/presets/deicsonze/SutulaBank.dei");
@@ -170,7 +170,7 @@ DeicsOnze::DeicsOnze() : Mess(2) {
//Load configuration
QString defaultConf =
- (configPath + QString("/" DEICSONZESTR ".dco"));
+ (MusEGlobal::configPath + QString("/" DEICSONZESTR ".dco"));
FILE* f;
f = fopen(defaultConf.toAscii().data(), "r");
if(f) {
diff --git a/muse2/synti/deicsonze/deicsonze.h b/muse2/synti/deicsonze/deicsonze.h
index bd79b7fb..53a3afee 100644
--- a/muse2/synti/deicsonze/deicsonze.h
+++ b/muse2/synti/deicsonze/deicsonze.h
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
diff --git a/muse2/synti/deicsonze/deicsonzefilter.cpp b/muse2/synti/deicsonze/deicsonzefilter.cpp
index d4bef946..825c7a04 100644
--- a/muse2/synti/deicsonze/deicsonzefilter.cpp
+++ b/muse2/synti/deicsonze/deicsonzefilter.cpp
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#include "deicsonzefilter.h"
diff --git a/muse2/synti/deicsonze/deicsonzefilter.h b/muse2/synti/deicsonze/deicsonzefilter.h
index fc92142a..b9efa602 100644
--- a/muse2/synti/deicsonze/deicsonzefilter.h
+++ b/muse2/synti/deicsonze/deicsonzefilter.h
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#ifndef __DEICSONZEFILTER_H
diff --git a/muse2/synti/deicsonze/deicsonzegui.cpp b/muse2/synti/deicsonze/deicsonzegui.cpp
index 4cb78764..b88a47fc 100644
--- a/muse2/synti/deicsonze/deicsonzegui.cpp
+++ b/muse2/synti/deicsonze/deicsonzegui.cpp
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#include <QDir>
@@ -418,7 +418,7 @@ DeicsOnzeGui::DeicsOnzeGui(DeicsOnze* deicsOnze)
QSocketNotifier* s = new QSocketNotifier(readFd, QSocketNotifier::Read);
connect(s, SIGNAL(activated(int)), SLOT(readMessage(int)));
- QString sharePath(museGlobalShare);
+ QString sharePath(MusEGlobal::museGlobalShare);
// Tim.
updateInitSetPath(sharePath + QString("/presets/deicsonze/SutulaBank.dei")); // Tim.
updateBackgroundPixPath(sharePath + QString("/wallpapers/paper2.jpg")); // Tim.
@@ -555,7 +555,7 @@ void DeicsOnzeGui::saveConfiguration() {
// saveDefaultConfiguration
//-----------------------------------------------------------
void DeicsOnzeGui::saveDefaultConfiguration() {
- QString filename = configPath + QString("/" DEICSONZESTR ".dco");
+ QString filename = MusEGlobal::configPath + QString("/" DEICSONZESTR ".dco");
if(!filename.isEmpty()) {
QFile f(filename);
f.open(QIODevice::WriteOnly);
diff --git a/muse2/synti/deicsonze/deicsonzegui.h b/muse2/synti/deicsonze/deicsonzegui.h
index 4c3d5e8e..f82e072b 100644
--- a/muse2/synti/deicsonze/deicsonzegui.h
+++ b/muse2/synti/deicsonze/deicsonzegui.h
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#ifndef __DEICSONZEGUI_H
diff --git a/muse2/synti/deicsonze/deicsonzeplugin.cpp b/muse2/synti/deicsonze/deicsonzeplugin.cpp
index 54eee202..c8f5b086 100644
--- a/muse2/synti/deicsonze/deicsonzeplugin.cpp
+++ b/muse2/synti/deicsonze/deicsonzeplugin.cpp
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#include "deicsonzeplugin.h"
diff --git a/muse2/synti/deicsonze/deicsonzeplugin.h b/muse2/synti/deicsonze/deicsonzeplugin.h
index d9527e23..c990097d 100644
--- a/muse2/synti/deicsonze/deicsonzeplugin.h
+++ b/muse2/synti/deicsonze/deicsonzeplugin.h
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#ifndef __DEICSONZEPLUGIN_H
diff --git a/muse2/synti/deicsonze/deicsonzepreset.cpp b/muse2/synti/deicsonze/deicsonzepreset.cpp
index 1b070935..afe6684e 100644
--- a/muse2/synti/deicsonze/deicsonzepreset.cpp
+++ b/muse2/synti/deicsonze/deicsonzepreset.cpp
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#include "deicsonzepreset.h"
diff --git a/muse2/synti/deicsonze/deicsonzepreset.h b/muse2/synti/deicsonze/deicsonzepreset.h
index be98b48e..e9bfb185 100644
--- a/muse2/synti/deicsonze/deicsonzepreset.h
+++ b/muse2/synti/deicsonze/deicsonzepreset.h
@@ -23,8 +23,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//===========================================================================
#ifndef __DEICSONZEPRESET_H
diff --git a/muse2/synti/fluid/CMakeLists.txt b/muse2/synti/fluid/CMakeLists.txt
index 1367436a..5be44593 100644
--- a/muse2/synti/fluid/CMakeLists.txt
+++ b/muse2/synti/fluid/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/synti/fluid/common_defs.h b/muse2/synti/fluid/common_defs.h
index 6aa62bc0..26204bc6 100644
--- a/muse2/synti/fluid/common_defs.h
+++ b/muse2/synti/fluid/common_defs.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./synti/fluid/common_defs.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef __FLUID_UNIQUE_ID_H
#define __FLUID_UNIQUE_ID_H
diff --git a/muse2/synti/fluid/fluid.cpp b/muse2/synti/fluid/fluid.cpp
index c06e672e..1431460f 100644
--- a/muse2/synti/fluid/fluid.cpp
+++ b/muse2/synti/fluid/fluid.cpp
@@ -12,6 +12,21 @@
// fluid: Copyright (C) 2001 Peter Hanappe
// MusE: Copyright (C) 2001 Werner Schweer
// awesfx: Copyright (C) 1996-1999 Takashi Iwai
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <stdlib.h>
diff --git a/muse2/synti/fluid/fluid.h b/muse2/synti/fluid/fluid.h
index 02b111e4..cc5dfc26 100644
--- a/muse2/synti/fluid/fluid.h
+++ b/muse2/synti/fluid/fluid.h
@@ -12,6 +12,21 @@
// fluid: Copyright (C) 2001 Peter Hanappe
// MusE: Copyright (C) 2001 Werner Schweer
// awesfx: Copyright (C) 1996-1999 Takashi Iwai
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef _SYNTH_H
diff --git a/muse2/synti/fluid/fluidgui.cpp b/muse2/synti/fluid/fluidgui.cpp
index 1f948a7d..9c13e81f 100644
--- a/muse2/synti/fluid/fluidgui.cpp
+++ b/muse2/synti/fluid/fluidgui.cpp
@@ -7,6 +7,21 @@
// fluid software synthesizer.
//
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <unistd.h>
diff --git a/muse2/synti/fluid/fluidgui.h b/muse2/synti/fluid/fluidgui.h
index 2752567f..87bc6b24 100644
--- a/muse2/synti/fluid/fluidgui.h
+++ b/muse2/synti/fluid/fluidgui.h
@@ -4,6 +4,21 @@
// $Id: fluidgui.h,v 1.2 2004/02/12 17:32:29 wschweer Exp $
//
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __GUI_H__
diff --git a/muse2/synti/fluidsynth/CMakeLists.txt b/muse2/synti/fluidsynth/CMakeLists.txt
index 930d12d5..db96341f 100644
--- a/muse2/synti/fluidsynth/CMakeLists.txt
+++ b/muse2/synti/fluidsynth/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/synti/fluidsynth/common_defs.h b/muse2/synti/fluidsynth/common_defs.h
index f1f4007d..64cd2ffb 100644
--- a/muse2/synti/fluidsynth/common_defs.h
+++ b/muse2/synti/fluidsynth/common_defs.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./synti/fluidsynth/common_defs.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef __FLUIDSYNTH_UNIQUE_ID_H
#define __FLUIDSYNTH_UNIQUE_ID_H
diff --git a/muse2/synti/fluidsynth/fluidsynthgui.cpp b/muse2/synti/fluidsynth/fluidsynthgui.cpp
index 6dda43bd..62d8e791 100644
--- a/muse2/synti/fluidsynth/fluidsynthgui.cpp
+++ b/muse2/synti/fluidsynth/fluidsynthgui.cpp
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./synti/fluidsynth/fluidsynthgui.cpp $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
/*
* MusE FLUID Synth softsynth plugin
*
diff --git a/muse2/synti/fluidsynth/fluidsynthgui.h b/muse2/synti/fluidsynth/fluidsynthgui.h
index 373a2343..d0709109 100644
--- a/muse2/synti/fluidsynth/fluidsynthgui.h
+++ b/muse2/synti/fluidsynth/fluidsynthgui.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./synti/fluidsynth/fluidsynthgui.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
/*
* MusE FLUID Synth softsynth plugin
*
diff --git a/muse2/synti/fluidsynth/fluidsynti.cpp b/muse2/synti/fluidsynth/fluidsynti.cpp
index 63a516ed..a03c5da8 100644
--- a/muse2/synti/fluidsynth/fluidsynti.cpp
+++ b/muse2/synti/fluidsynth/fluidsynti.cpp
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./synti/fluidsynth/fluidsynti.cpp $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
/*
* MusE FLUID Synth softsynth plugin
*
diff --git a/muse2/synti/fluidsynth/fluidsynti.h b/muse2/synti/fluidsynth/fluidsynti.h
index fde42396..7a97904e 100644
--- a/muse2/synti/fluidsynth/fluidsynti.h
+++ b/muse2/synti/fluidsynth/fluidsynti.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./synti/fluidsynth/fluidsynti.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
/*
* MusE FLUID Synth softsynth plugin
*
diff --git a/muse2/synti/libsynti/CMakeLists.txt b/muse2/synti/libsynti/CMakeLists.txt
index 0b0e480c..adfb4bec 100644
--- a/muse2/synti/libsynti/CMakeLists.txt
+++ b/muse2/synti/libsynti/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
include(${PROJECT_SOURCE_DIR}/pch.txt)
diff --git a/muse2/synti/libsynti/gui.cpp b/muse2/synti/libsynti/gui.cpp
index 23a18fee..194e186a 100644
--- a/muse2/synti/libsynti/gui.cpp
+++ b/muse2/synti/libsynti/gui.cpp
@@ -5,6 +5,21 @@
// $Id: gui.cpp,v 1.5 2004/04/11 10:46:14 wschweer Exp $
//
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "gui.h"
diff --git a/muse2/synti/libsynti/gui.h b/muse2/synti/libsynti/gui.h
index 54044243..96ac907f 100644
--- a/muse2/synti/libsynti/gui.h
+++ b/muse2/synti/libsynti/gui.h
@@ -5,6 +5,21 @@
// $Id: gui.h,v 1.4 2004/06/19 09:50:37 wschweer Exp $
//
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SYNTH_GUI_H__
diff --git a/muse2/synti/libsynti/mess.cpp b/muse2/synti/libsynti/mess.cpp
index aa771056..62a281e1 100644
--- a/muse2/synti/libsynti/mess.cpp
+++ b/muse2/synti/libsynti/mess.cpp
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: mess.cpp,v 1.2 2004/04/15 13:46:18 wschweer Exp $
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "mess.h"
diff --git a/muse2/synti/libsynti/mess.h b/muse2/synti/libsynti/mess.h
index 81a3fe96..65f30e26 100644
--- a/muse2/synti/libsynti/mess.h
+++ b/muse2/synti/libsynti/mess.h
@@ -3,6 +3,21 @@
// Linux Music Editor
// $Id: mess.h,v 1.3.2.3 2009/11/19 04:20:33 terminator356 Exp $
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __MESS_H__
diff --git a/muse2/synti/libsynti/mono.cpp b/muse2/synti/libsynti/mono.cpp
index 14a23aca..18af44ec 100644
--- a/muse2/synti/libsynti/mono.cpp
+++ b/muse2/synti/libsynti/mono.cpp
@@ -5,6 +5,21 @@
// $Id: mono.cpp,v 1.2 2004/04/15 13:46:18 wschweer Exp $
//
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "mono.h"
diff --git a/muse2/synti/libsynti/mono.h b/muse2/synti/libsynti/mono.h
index f2f8bdf7..2b49d737 100644
--- a/muse2/synti/libsynti/mono.h
+++ b/muse2/synti/libsynti/mono.h
@@ -5,6 +5,21 @@
// $Id: mono.h,v 1.4 2004/04/15 13:46:18 wschweer Exp $
//
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SYNTH_MONO_H__
diff --git a/muse2/synti/libsynti/poly.cpp b/muse2/synti/libsynti/poly.cpp
index e76fe966..1dec00fd 100644
--- a/muse2/synti/libsynti/poly.cpp
+++ b/muse2/synti/libsynti/poly.cpp
@@ -5,6 +5,21 @@
// $Id: poly.cpp,v 1.3 2004/06/01 14:25:50 wschweer Exp $
//
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include "poly.h"
diff --git a/muse2/synti/libsynti/poly.h b/muse2/synti/libsynti/poly.h
index b990b198..c0d4bde8 100644
--- a/muse2/synti/libsynti/poly.h
+++ b/muse2/synti/libsynti/poly.h
@@ -5,6 +5,21 @@
// $Id: poly.h,v 1.2 2004/04/15 13:46:18 wschweer Exp $
//
// (C) Copyright 2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __SYNTH_POLY_H__
diff --git a/muse2/synti/organ/CMakeLists.txt b/muse2/synti/organ/CMakeLists.txt
index 0d8dda90..b22a924b 100644
--- a/muse2/synti/organ/CMakeLists.txt
+++ b/muse2/synti/organ/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/synti/organ/common_defs.h b/muse2/synti/organ/common_defs.h
index 31d09081..85610bdc 100644
--- a/muse2/synti/organ/common_defs.h
+++ b/muse2/synti/organ/common_defs.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./synti/organ/common_defs.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef __ORGAN_UNIQUE_ID_H
#define __ORGAN_UNIQUE_ID_H
diff --git a/muse2/synti/organ/organ.cpp b/muse2/synti/organ/organ.cpp
index 60f3f52d..d9613992 100644
--- a/muse2/synti/organ/organ.cpp
+++ b/muse2/synti/organ/organ.cpp
@@ -8,6 +8,21 @@
// Copyright (c) 1999, 2000 David A. Bartold
//
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
diff --git a/muse2/synti/organ/organ.h b/muse2/synti/organ/organ.h
index f859ea8c..b85f9282 100644
--- a/muse2/synti/organ/organ.h
+++ b/muse2/synti/organ/organ.h
@@ -8,6 +8,21 @@
// Copyright (c) 1999, 2000 David A. Bartold
//
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __ORGAN_H__
diff --git a/muse2/synti/organ/organgui.cpp b/muse2/synti/organ/organgui.cpp
index a25a8de9..e648a9e6 100644
--- a/muse2/synti/organ/organgui.cpp
+++ b/muse2/synti/organ/organgui.cpp
@@ -7,6 +7,21 @@
// organ software synthesizer.
//
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <unistd.h>
diff --git a/muse2/synti/organ/organgui.h b/muse2/synti/organ/organgui.h
index f246198d..826ecf09 100644
--- a/muse2/synti/organ/organgui.h
+++ b/muse2/synti/organ/organgui.h
@@ -4,6 +4,21 @@
// $Id: organgui.h,v 1.6.2.1 2005/12/29 23:33:50 spamatica Exp $
//
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#ifndef __ORGANGUI_H__
diff --git a/muse2/synti/s1/CMakeLists.txt b/muse2/synti/s1/CMakeLists.txt
index 93c62961..2dc55a7a 100644
--- a/muse2/synti/s1/CMakeLists.txt
+++ b/muse2/synti/s1/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/synti/s1/s1.cpp b/muse2/synti/s1/s1.cpp
index 9c466b4a..ceec6de6 100644
--- a/muse2/synti/s1/s1.cpp
+++ b/muse2/synti/s1/s1.cpp
@@ -11,6 +11,21 @@
// clicks
//
// (C) Copyright 2001-2004 Werner Schweer (ws@seh.de)
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//=========================================================
#include <cmath>
diff --git a/muse2/synti/simpledrums2/CMakeLists.txt b/muse2/synti/simpledrums2/CMakeLists.txt
index 41fb8da5..bf0c33d8 100644
--- a/muse2/synti/simpledrums2/CMakeLists.txt
+++ b/muse2/synti/simpledrums2/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/synti/simpledrums2/common.h b/muse2/synti/simpledrums2/common.h
index f31ca7ce..827d68c0 100644
--- a/muse2/synti/simpledrums2/common.h
+++ b/muse2/synti/simpledrums2/common.h
@@ -1,14 +1,32 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./synti/simpledrums2/common.h $
//
-// C++ Interface: common
+// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2004
+// Copyright (C) 1999-2011 by Werner Schweer and others
//
-// Description:
+// 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; 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.
//
-// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2004
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
-// Copyright: See COPYING file that comes with this distribution
+//=========================================================
//
+// C++ Interface: common
+//
+// Description:
//
+
#ifndef __MUSE_TESTO_COMMON_H__
#define __MUSE_TESTO_COMMON_H__
diff --git a/muse2/synti/simpledrums2/common_defs.h b/muse2/synti/simpledrums2/common_defs.h
index b3745a1d..dad933a6 100644
--- a/muse2/synti/simpledrums2/common_defs.h
+++ b/muse2/synti/simpledrums2/common_defs.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./synti/simpledrums2/common_defs.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef __SIMPLEDRUMS_UNIQUE_ID_H
#define __SIMPLEDRUMS_UNIQUE_ID_H
diff --git a/muse2/synti/simpledrums2/simpledrums.cpp b/muse2/synti/simpledrums2/simpledrums.cpp
index 2da4ed82..2321ec4b 100644
--- a/muse2/synti/simpledrums2/simpledrums.cpp
+++ b/muse2/synti/simpledrums2/simpledrums.cpp
@@ -7,7 +7,19 @@
// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2004
// Contributer: (C) Copyright 2011 Tim E. Real (terminator356 at users.sourceforge.net)
//
-// Copyright: See COPYING file that comes with this distribution
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
//
diff --git a/muse2/synti/simpledrums2/simpledrums.h b/muse2/synti/simpledrums2/simpledrums.h
index f0339d6a..a3df0092 100644
--- a/muse2/synti/simpledrums2/simpledrums.h
+++ b/muse2/synti/simpledrums2/simpledrums.h
@@ -7,7 +7,20 @@
// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2004
// Contributer: (C) Copyright 2011 Tim E. Real (terminator356 at users.sourceforge.net)
//
-// Copyright: See COPYING file that comes with this distribution
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//
//
#ifndef SIMPLESYNTH_H
diff --git a/muse2/synti/simpledrums2/simpledrumsgui.cpp b/muse2/synti/simpledrums2/simpledrumsgui.cpp
index 7d314565..d4271e1b 100644
--- a/muse2/synti/simpledrums2/simpledrumsgui.cpp
+++ b/muse2/synti/simpledrums2/simpledrumsgui.cpp
@@ -7,7 +7,20 @@
// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2004
// Contributer: (C) Copyright 2011 Tim E. Real (terminator356 at users.sourceforge.net)
//
-// Copyright: See COPYING file that comes with this distribution
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//
//
diff --git a/muse2/synti/simpledrums2/simpledrumsgui.h b/muse2/synti/simpledrums2/simpledrumsgui.h
index af32e432..3cb11ba3 100644
--- a/muse2/synti/simpledrums2/simpledrumsgui.h
+++ b/muse2/synti/simpledrums2/simpledrumsgui.h
@@ -7,7 +7,20 @@
// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2004
// Contributer: (C) Copyright 2011 Tim E. Real (terminator356 at users.sourceforge.net)
//
-// Copyright: See COPYING file that comes with this distribution
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
//
//
#ifndef __MUSE_TESTOGUI_H__
diff --git a/muse2/synti/simpledrums2/ssplugin.cpp b/muse2/synti/simpledrums2/ssplugin.cpp
index 75559a8f..cebf97c7 100644
--- a/muse2/synti/simpledrums2/ssplugin.cpp
+++ b/muse2/synti/simpledrums2/ssplugin.cpp
@@ -3,11 +3,25 @@
//
// Description:
//
-//
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
+//
// Additions/modifications: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2004
// (C) Copyright 2011 Tim E. Real (terminator356 at users.sourceforge.net)
-// Copyright: See COPYING file that comes with this distribution
+//
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
//
diff --git a/muse2/synti/simpledrums2/ssplugin.h b/muse2/synti/simpledrums2/ssplugin.h
index 8750753b..d510a787 100644
--- a/muse2/synti/simpledrums2/ssplugin.h
+++ b/muse2/synti/simpledrums2/ssplugin.h
@@ -7,7 +7,20 @@
// (C) Copyright 2000 Werner Schweer (ws@seh.de)
// Additions/modifications: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2004
// (C) Copyright 2011 Tim E. Real (terminator356 at users.sourceforge.net)
-// Copyright: See COPYING file that comes with this distribution
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
//
diff --git a/muse2/synti/simpledrums2/ssplugingui.cpp b/muse2/synti/simpledrums2/ssplugingui.cpp
index 31ac3ac4..5b6e57b6 100644
--- a/muse2/synti/simpledrums2/ssplugingui.cpp
+++ b/muse2/synti/simpledrums2/ssplugingui.cpp
@@ -7,6 +7,21 @@
// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2004
// Contributer: (C) Copyright 2011 Tim E. Real (terminator356 at users.sourceforge.net)
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//
// Copyright: See COPYING file that comes with this distribution
//
//
diff --git a/muse2/synti/simpledrums2/ssplugingui.h b/muse2/synti/simpledrums2/ssplugingui.h
index 99951d01..00ff3515 100644
--- a/muse2/synti/simpledrums2/ssplugingui.h
+++ b/muse2/synti/simpledrums2/ssplugingui.h
@@ -7,6 +7,21 @@
// Author: Mathias Lundgren <lunar_shuttle@users.sf.net>, (C) 2004
// Contributer: (C) Copyright 2011 Tim E. Real (terminator356 at users.sourceforge.net)
//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//
// Copyright: See COPYING file that comes with this distribution
//
//
diff --git a/muse2/synti/vam/CMakeLists.txt b/muse2/synti/vam/CMakeLists.txt
index 31f2a12a..1aad535a 100644
--- a/muse2/synti/vam/CMakeLists.txt
+++ b/muse2/synti/vam/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
##
diff --git a/muse2/synti/vam/common_defs.h b/muse2/synti/vam/common_defs.h
index 59821a70..64c28ea8 100644
--- a/muse2/synti/vam/common_defs.h
+++ b/muse2/synti/vam/common_defs.h
@@ -1,3 +1,25 @@
+//=========================================================
+// MusE
+// Linux Music Editor
+// $Id: ./synti/vam/common_defs.h $
+//
+// Copyright (C) 1999-2011 by Werner Schweer and others
+//
+// 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; 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; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//=========================================================
#ifndef __VAM_UNIQUE_ID_H
#define __VAM_UNIQUE_ID_H
diff --git a/muse2/synti/vam/vam.cpp b/muse2/synti/vam/vam.cpp
index 78328eb2..b473188f 100644
--- a/muse2/synti/vam/vam.cpp
+++ b/muse2/synti/vam/vam.cpp
@@ -22,8 +22,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//=========================================================
#include <assert.h>
diff --git a/muse2/synti/vam/vam.h b/muse2/synti/vam/vam.h
index 72edd9f8..54f0e465 100644
--- a/muse2/synti/vam/vam.h
+++ b/muse2/synti/vam/vam.h
@@ -14,8 +14,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
#ifndef __VAM_H
diff --git a/muse2/synti/vam/vamgui.cpp b/muse2/synti/vam/vamgui.cpp
index 34f8636c..0993087b 100644
--- a/muse2/synti/vam/vamgui.cpp
+++ b/muse2/synti/vam/vamgui.cpp
@@ -22,8 +22,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//=========================================================
#include <unistd.h>
@@ -601,7 +601,7 @@ void VAMGui::loadPresetsPressed()
{
#if 1 // TODO
QString iname;
- QString s(configPath);
+ QString s(MusEGlobal::configPath);
/* QString filename = QFileDialog::getOpenFileName(lastdir, QString("*.[Ss][Ff]2"),
this,
@@ -716,7 +716,7 @@ void VAMGui::doSavePresets(const QString& fn, bool showWarning)
void VAMGui::savePresetsPressed()
{
#if 1 // TODO
- QString s(configPath);
+ QString s(MusEGlobal::configPath);
QString fn = QFileDialog::getSaveFileName(this, tr("MusE: Save VAM Presets"),
s, "Presets (*.vam)");
if (fn.isEmpty())
@@ -734,7 +734,7 @@ void VAMGui::savePresetsToFilePressed()
{
if (!presetFileName ) {
- QString s(configPath);
+ QString s(MusEGlobal::configPath);
QString fn = QFileDialog::getSaveFileName(this, tr("MusE: Save VAM Presets"),
s, "Presets (*.vam)");
presetFileName = new QString(fn);
diff --git a/muse2/synti/vam/vamgui.h b/muse2/synti/vam/vamgui.h
index b5906ae8..abee3c43 100644
--- a/muse2/synti/vam/vamgui.h
+++ b/muse2/synti/vam/vamgui.h
@@ -17,8 +17,8 @@
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA or point your web browser to http://www.gnu.org.
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02111-1301, USA or point your web browser to http://www.gnu.org.
//=========================================================
#ifndef __VAMGUI_H
diff --git a/muse2/utils/CMakeLists.txt b/muse2/utils/CMakeLists.txt
index 20ae35cd..53c62a18 100644
--- a/muse2/utils/CMakeLists.txt
+++ b/muse2/utils/CMakeLists.txt
@@ -3,10 +3,12 @@
# Linux Music Editor
# $Id:$
#
-# Copyright (C) 2002-2006 by Werner Schweer and others
+# Copyright (C) 1999-2011 by Werner Schweer and others
#
# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2.
+# 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
@@ -14,8 +16,9 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# along with this program; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#=============================================================================
file(GLOB utils_files
diff --git a/muse2/utils/muse-find-unused-wavs b/muse2/utils/muse-find-unused-wavs
index a325e1e0..5aaf2707 100755
--- a/muse2/utils/muse-find-unused-wavs
+++ b/muse2/utils/muse-find-unused-wavs
@@ -1,5 +1,28 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 1999-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
+
import os
import string
import shutil
diff --git a/muse2/utils/muse-song-convert.py b/muse2/utils/muse-song-convert.py
index ff2f81b0..76577610 100755
--- a/muse2/utils/muse-song-convert.py
+++ b/muse2/utils/muse-song-convert.py
@@ -1,4 +1,28 @@
#!/usr/bin/python
+#=============================================================================
+# MusE
+# Linux Music Editor
+# $Id:$
+#
+# Copyright (C) 1999-2011 by Werner Schweer and others
+#
+# 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; if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+#=============================================================================
+
+
import sys
import os
import string