diff options
author | Robert Jonsson <spamatica@gmail.com> | 2010-10-13 19:34:22 +0000 |
---|---|---|
committer | Robert Jonsson <spamatica@gmail.com> | 2010-10-13 19:34:22 +0000 |
commit | 8a2c2824a59d7644e13bc52c9a0ecbd641f21f95 (patch) | |
tree | 064ad3f2bf8daab0ad27b128abd86a9bbdb1e496 /muse2/muse/mplugins | |
parent | a27706d9629e8b592cca4659f865b70adef24e6d (diff) |
new branch muse2, first checkin
Diffstat (limited to 'muse2/muse/mplugins')
-rw-r--r-- | muse2/muse/mplugins/.cvsignore | 2 | ||||
-rw-r--r-- | muse2/muse/mplugins/Makefile.am | 26 | ||||
-rw-r--r-- | muse2/muse/mplugins/Makefile.in | 624 | ||||
-rw-r--r-- | muse2/muse/mplugins/midifilter.ui | 879 | ||||
-rw-r--r-- | muse2/muse/mplugins/midifilterimpl.cpp | 131 | ||||
-rw-r--r-- | muse2/muse/mplugins/midifilterimpl.h | 92 | ||||
-rw-r--r-- | muse2/muse/mplugins/midiitransform.cpp | 1696 | ||||
-rw-r--r-- | muse2/muse/mplugins/midiitransform.h | 101 | ||||
-rw-r--r-- | muse2/muse/mplugins/mitplugin.cpp | 145 | ||||
-rw-r--r-- | muse2/muse/mplugins/mitplugin.h | 39 | ||||
-rw-r--r-- | muse2/muse/mplugins/mittranspose.cpp | 181 | ||||
-rw-r--r-- | muse2/muse/mplugins/mittranspose.h | 70 | ||||
-rw-r--r-- | muse2/muse/mplugins/mrconfig.cpp | 71 | ||||
-rw-r--r-- | muse2/muse/mplugins/mrconfig.h | 40 | ||||
-rw-r--r-- | muse2/muse/mplugins/mrconfigbase.ui | 200 | ||||
-rw-r--r-- | muse2/muse/mplugins/random.cpp | 758 | ||||
-rw-r--r-- | muse2/muse/mplugins/random.h | 192 | ||||
-rw-r--r-- | muse2/muse/mplugins/rhythm.cpp | 516 | ||||
-rw-r--r-- | muse2/muse/mplugins/rhythm.h | 196 | ||||
-rw-r--r-- | muse2/muse/mplugins/rhythmbase.ui | 1004 |
20 files changed, 6963 insertions, 0 deletions
diff --git a/muse2/muse/mplugins/.cvsignore b/muse2/muse/mplugins/.cvsignore new file mode 100644 index 00000000..66e962c6 --- /dev/null +++ b/muse2/muse/mplugins/.cvsignore @@ -0,0 +1,2 @@ +mrconfigbase.h +midifilter.h diff --git a/muse2/muse/mplugins/Makefile.am b/muse2/muse/mplugins/Makefile.am new file mode 100644 index 00000000..ef00f245 --- /dev/null +++ b/muse2/muse/mplugins/Makefile.am @@ -0,0 +1,26 @@ +include $(top_srcdir)/common.am + +noinst_LIBRARIES = libmplugins.a + +if PCH +AM_CXXFLAGS += -include $(top_srcdir)/all.h +endif + +dist_libmplugins_a_SOURCES = \ + mitplugin.cpp mitplugin.h \ + mittranspose.cpp mittranspose.h \ + midiitransform.cpp midiitransform.h \ + midifilterimpl.cpp midifilterimpl.h \ + mrconfig.cpp mrconfig.h \ + rhythm.cpp rhythm.h \ + random.cpp random.h \ + midifilter.ui \ + mrconfigbase.ui \ + rhythmbase.ui + +nodist_libmplugins_a_SOURCES = \ + moc_mittranspose.cpp \ + moc_midiitransform.cpp \ + moc_midifilterimpl.cpp \ + moc_mrconfig.cpp \ + moc_rhythm.cpp diff --git a/muse2/muse/mplugins/Makefile.in b/muse2/muse/mplugins/Makefile.in new file mode 100644 index 00000000..47f131bb --- /dev/null +++ b/muse2/muse/mplugins/Makefile.in @@ -0,0 +1,624 @@ +# Makefile.in generated by automake 1.11.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(top_srcdir)/common.am +@PCH_TRUE@am__append_1 = -include $(top_srcdir)/all.h +subdir = muse/mplugins +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/aclocal-include.m4 \ + $(top_srcdir)/m4/alsa.m4 $(top_srcdir)/m4/docbook.m4 \ + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libmplugins_a_AR = $(AR) $(ARFLAGS) +libmplugins_a_LIBADD = +dist_libmplugins_a_OBJECTS = mitplugin.$(OBJEXT) \ + mittranspose.$(OBJEXT) midiitransform.$(OBJEXT) \ + midifilterimpl.$(OBJEXT) mrconfig.$(OBJEXT) rhythm.$(OBJEXT) \ + random.$(OBJEXT) midifilter.$(OBJEXT) mrconfigbase.$(OBJEXT) \ + rhythmbase.$(OBJEXT) +nodist_libmplugins_a_OBJECTS = moc_mittranspose.$(OBJEXT) \ + moc_midiitransform.$(OBJEXT) moc_midifilterimpl.$(OBJEXT) \ + moc_mrconfig.$(OBJEXT) moc_rhythm.$(OBJEXT) +libmplugins_a_OBJECTS = $(dist_libmplugins_a_OBJECTS) \ + $(nodist_libmplugins_a_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ + --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +SOURCES = $(dist_libmplugins_a_SOURCES) \ + $(nodist_libmplugins_a_SOURCES) +DIST_SOURCES = $(dist_libmplugins_a_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALSA_CFLAGS = @ALSA_CFLAGS@ +ALSA_LIBS = @ALSA_LIBS@ +AMTAR = @AMTAR@ +AR = @AR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOCBOOKSTYLE = @DOCBOOKSTYLE@ +DOCBOOKTARGETS = @DOCBOOKTARGETS@ +DOT = @DOT@ +DOTPATH = @DOTPATH@ +DOXYGEN = @DOXYGEN@ +DOXYGEN_TREEVIEW = @DOXYGEN_TREEVIEW@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +FLUIDSYNTHDIRS = @FLUIDSYNTHDIRS@ +FST_CFLAGS = @FST_CFLAGS@ +FST_LIBS = @FST_LIBS@ +Fluidsynth_CFLAGS = @Fluidsynth_CFLAGS@ +Fluidsynth_LIBS = @Fluidsynth_LIBS@ +GIVERTCAP = @GIVERTCAP@ +GREP = @GREP@ +HAVEDOT = @HAVEDOT@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +JACK_CFLAGS = @JACK_CFLAGS@ +JACK_LIBS = @JACK_LIBS@ +JADE = @JADE@ +LASH_CFLAGS = @LASH_CFLAGS@ +LASH_LIBS = @LASH_LIBS@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LO_CFLAGS = @LO_CFLAGS@ +LO_LIBS = @LO_LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MUSECXXFLAGS = @MUSECXXFLAGS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +NSGMLS = @NSGMLS@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCH = @PCH@ +PERL = @PERL@ +PKG_CONFIG = @PKG_CONFIG@ +PYTHON = @PYTHON@ +PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ +PYTHON_INCLUDES = @PYTHON_INCLUDES@ +PYTHON_LIB = @PYTHON_LIB@ +PYTHON_PLATFORM = @PYTHON_PLATFORM@ +PYTHON_PREFIX = @PYTHON_PREFIX@ +PYTHON_VERSION = @PYTHON_VERSION@ +QTDIR_BIN = @QTDIR_BIN@ +QTDIR_INC = @QTDIR_INC@ +QT_LIBS = @QT_LIBS@ +RANLIB = @RANLIB@ +SAMPLERATE_CFLAGS = @SAMPLERATE_CFLAGS@ +SAMPLERATE_LIBS = @SAMPLERATE_LIBS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +SNDFILE_CFLAGS = @SNDFILE_CFLAGS@ +SNDFILE_LIBS = @SNDFILE_LIBS@ +STRIP = @STRIP@ +SUIDBUILD = @SUIDBUILD@ +SUIDINSTALL = @SUIDINSTALL@ +USE_SSE = @USE_SSE@ +UUID_CFLAGS = @UUID_CFLAGS@ +UUID_LIBS = @UUID_LIBS@ +VERSION = @VERSION@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +have_docbook = @have_docbook@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +pkgpyexecdir = @pkgpyexecdir@ +pkgpythondir = @pkgpythondir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +pyexecdir = @pyexecdir@ +pythondir = @pythondir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +synth_fluid = @synth_fluid@ +synth_fluidsynth = @synth_fluidsynth@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CXXFLAGS = $(MUSECXXFLAGS) -I.. -I$(top_srcdir)/synti \ + -I$(top_srcdir)/muse/widgets -DQT_SHARED -DQT_THREAD_SUPPORT \ + -DQT_PLUGIN $(QTDIR_INC) -DQT3_SUPPORT $(am__append_1) +AM_CPPFLAGS = +MOC = $(QTDIR_BIN)/moc +#UIC = $(QTDIR_BIN)/uic3 +UIC = /usr/bin/uic3 +UIFILES = $(wildcard *.ui) +MOCFILES = $(shell for h in $(filter %.h,$(SOURCES)); do \ + if grep -q Q_OBJECT $$h; then \ + echo $$h | sed "s/\(.*\)\.h/moc_\1.cpp/"; \ + fi; \ + done) + +BUILT_SOURCES = $(MOCFILES) $(UIFILES:%.ui=%.h) +MOSTLYCLEANFILES = $(MOCFILES) $(UIFILES:%.ui=%.h) +SUFFIXES = .ui .h.gch +noinst_LIBRARIES = libmplugins.a +dist_libmplugins_a_SOURCES = \ + mitplugin.cpp mitplugin.h \ + mittranspose.cpp mittranspose.h \ + midiitransform.cpp midiitransform.h \ + midifilterimpl.cpp midifilterimpl.h \ + mrconfig.cpp mrconfig.h \ + rhythm.cpp rhythm.h \ + random.cpp random.h \ + midifilter.ui \ + mrconfigbase.ui \ + rhythmbase.ui + +nodist_libmplugins_a_SOURCES = \ + moc_mittranspose.cpp \ + moc_midiitransform.cpp \ + moc_midifilterimpl.cpp \ + moc_mrconfig.cpp \ + moc_rhythm.cpp + +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .ui .h.gch .cpp .lo .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/common.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu muse/mplugins/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu muse/mplugins/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libmplugins.a: $(libmplugins_a_OBJECTS) $(libmplugins_a_DEPENDENCIES) + -rm -f libmplugins.a + $(libmplugins_a_AR) libmplugins.a $(libmplugins_a_OBJECTS) $(libmplugins_a_LIBADD) + $(RANLIB) libmplugins.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midifilterimpl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/midiitransform.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mitplugin.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mittranspose.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/moc_midifilterimpl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/moc_midiitransform.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/moc_mittranspose.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/moc_mrconfig.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/moc_rhythm.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mrconfig.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rhythm.Po@am__quote@ + +.cpp.o: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< + +.cpp.obj: +@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.cpp.lo: +@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + set x; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +all-am: Makefile $(LIBRARIES) +installdirs: +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +clean: clean-am + +clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \ + mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: + +install-html: install-html-am + +install-html-am: + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: all check install install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstLIBRARIES ctags distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags uninstall uninstall-am + + +de: + @for base in $(MOCFILES); do echo -e "\t$${base}.cpp $${base}.h \\"; done + +nde: + @for base in $(MOCFILES); do echo -e "\tmoc_$${base}.cpp \\"; done + +.ui.o: %.h + $(UIC) -L $(top_srcdir)/muse/widgets -o $*.cpp -impl $*.h $*.ui + $(MOC) $*.h >> $*.cpp + $(CXXCOMPILE) -c $*.cpp -o $*.o + $(RM) $*.cpp moc_$*.cpp moc_$*.o + +.ui.lo: %.h + $(UIC) -L $(top_srcdir)/muse/widgets -o $*.cpp -impl $*.h $*.ui + $(MOC) $*.h >> $*.cpp + $(LTCXXCOMPILE) -c $*.cpp -o $*.lo + $(RM) $*.cpp moc_$*.cpp moc_$*.lo moc_$*.o + +moc_%.cpp: %.h + $(MOC) $< -o $@ + +%.h: %.ui + $(UIC) -o $@ $< +# $(UIC) -L $(top_srcdir)/muse/widgets -o $@ $< + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/muse2/muse/mplugins/midifilter.ui b/muse2/muse/mplugins/midifilter.ui new file mode 100644 index 00000000..412e735d --- /dev/null +++ b/muse2/muse/mplugins/midifilter.ui @@ -0,0 +1,879 @@ +<!DOCTYPE UI><UI version="3.1" stdsetdef="1"> +<class>MidiFilterConfigBase</class> +<widget class="QDialog"> + <property name="name"> + <cstring>MidiFilterConfigBase</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>348</width> + <height>431</height> + </rect> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>3</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="caption"> + <string>MusE: Midi Input Filter</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QGroupBox" row="0" column="0"> + <property name="name"> + <cstring>GroupBoxx</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>3</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Record Filter</string> + </property> + <property name="layoutSpacing" stdset="0"> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>rf1</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Note On</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>rf2</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Poly Pressure</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>rf3</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Controller</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>rf4</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Program Change</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>rf5</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>After Touch</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>rf6</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Pitch Bend</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>rf7</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Sysex</string> + </property> + </widget> + </vbox> + </widget> + <widget class="QGroupBox" row="0" column="1"> + <property name="name"> + <cstring>GroupBox2</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Thru Filter</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>tf1</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Note On</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>tf2</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Poly Pressure</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>tf3</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Controller</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>tf4</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Program Change</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>tf5</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>After Touch</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>tf6</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Pitch Bend</string> + </property> + </widget> + <widget class="QCheckBox"> + <property name="name"> + <cstring>tf7</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Sysex</string> + </property> + </widget> + </vbox> + </widget> + <widget class="QGroupBox" row="1" column="1"> + <property name="name"> + <cstring>GroupBox4</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Controller Filter</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="CtrlComboBox"> + <property name="name"> + <cstring>cb1</cstring> + </property> + </widget> + <widget class="CtrlComboBox"> + <property name="name"> + <cstring>cb2</cstring> + </property> + </widget> + <widget class="CtrlComboBox"> + <property name="name"> + <cstring>cb3</cstring> + </property> + </widget> + <widget class="CtrlComboBox"> + <property name="name"> + <cstring>cb4</cstring> + </property> + </widget> + </vbox> + </widget> + <widget class="QButtonGroup" row="1" column="0"> + <property name="name"> + <cstring>ButtonGroup1</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title"> + <string>Channel Filter</string> + </property> + <property name="layoutSpacing" stdset="0"> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>3</number> + </property> + <widget class="QPushButton" row="3" column="1"> + <property name="name"> + <cstring>cf14</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>14</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="2" column="1"> + <property name="name"> + <cstring>cf10</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>10</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="1" column="1"> + <property name="name"> + <cstring>cf6</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>6</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="2" column="3"> + <property name="name"> + <cstring>cf12</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>12</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="0" column="3"> + <property name="name"> + <cstring>cf4</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>25</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>4</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="0" column="1"> + <property name="name"> + <cstring>cf2</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>25</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>2</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="2" column="0"> + <property name="name"> + <cstring>cf9</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>9</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="1" column="3"> + <property name="name"> + <cstring>cf8</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>8</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="0" column="2"> + <property name="name"> + <cstring>cf3</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>25</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>3</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="3" column="0"> + <property name="name"> + <cstring>cf13</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>13</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="3" column="2"> + <property name="name"> + <cstring>cf15</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>15</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="3" column="3"> + <property name="name"> + <cstring>cf16</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>16</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="1" column="2"> + <property name="name"> + <cstring>cf7</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>5</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>7</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="2" column="2"> + <property name="name"> + <cstring>cf11</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>5</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>11</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="1" column="0"> + <property name="name"> + <cstring>cf5</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>5</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton" row="0" column="0"> + <property name="name"> + <cstring>cf1</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>25</width> + <height>0</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>30</width> + <height>32767</height> + </size> + </property> + <property name="text"> + <string>1</string> + </property> + <property name="toggleButton"> + <bool>true</bool> + </property> + </widget> + </grid> + </widget> + </grid> +</widget> +<customwidgets> + <customwidget> + <class>CtrlComboBox</class> + <header location="global">ctrlcombo.h</header> + <sizehint> + <width>50</width> + <height>20</height> + </sizehint> + <container>0</container> + <sizepolicy> + <hordata>5</hordata> + <verdata>5</verdata> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + <pixmap>image0</pixmap> + <signal>activated(int index)</signal> + <signal>activated(const QString&)</signal> + </customwidget> +</customwidgets> +<images> + <image name="image0"> + <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> + </image> +</images> +<tabstops> + <tabstop>rf1</tabstop> + <tabstop>rf2</tabstop> + <tabstop>rf3</tabstop> + <tabstop>rf4</tabstop> + <tabstop>rf5</tabstop> + <tabstop>rf6</tabstop> + <tabstop>rf7</tabstop> + <tabstop>tf1</tabstop> + <tabstop>tf2</tabstop> + <tabstop>tf3</tabstop> + <tabstop>tf4</tabstop> + <tabstop>tf5</tabstop> + <tabstop>tf6</tabstop> + <tabstop>tf7</tabstop> + <tabstop>cf1</tabstop> + <tabstop>cf2</tabstop> + <tabstop>cf3</tabstop> + <tabstop>cf4</tabstop> + <tabstop>cf5</tabstop> + <tabstop>cf6</tabstop> + <tabstop>cf7</tabstop> + <tabstop>cf8</tabstop> + <tabstop>cf9</tabstop> + <tabstop>cf10</tabstop> + <tabstop>cf11</tabstop> + <tabstop>cf12</tabstop> + <tabstop>cf13</tabstop> + <tabstop>cf14</tabstop> + <tabstop>cf15</tabstop> + <tabstop>cf16</tabstop> +</tabstops> +<layoutdefaults spacing="6" margin="11"/> +<includehints> + <includehint>ctrlcombo.h</includehint> +</includehints> +</UI> diff --git a/muse2/muse/mplugins/midifilterimpl.cpp b/muse2/muse/mplugins/midifilterimpl.cpp new file mode 100644 index 00000000..56d5caf5 --- /dev/null +++ b/muse2/muse/mplugins/midifilterimpl.cpp @@ -0,0 +1,131 @@ +//========================================================= +// MusE +// Linux Music Editor +// $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) +//========================================================= + +#include "midifilterimpl.h" +#include "ctrlcombo.h" + +#include <qpushbutton.h> +#include <qcheckbox.h> +//Added by qt3to4: +#include <QCloseEvent> + +//--------------------------------------------------------- +// setCtrl +//--------------------------------------------------------- + +void MidiFilterConfig::setCtrl1(int n) + { + midiFilterCtrl1 = n-1; + } +void MidiFilterConfig::setCtrl2(int n) + { + midiFilterCtrl2 = n-1; + } +void MidiFilterConfig::setCtrl3(int n) + { + midiFilterCtrl3 = n-1; + } +void MidiFilterConfig::setCtrl4(int n) + { + midiFilterCtrl4 = n-1; + } + + +//--------------------------------------------------------- +// MidiFilterConfig +//--------------------------------------------------------- + +MidiFilterConfig::MidiFilterConfig(QWidget* parent, const char* name) + : MidiFilterConfigBase(parent, name) + { + cb1->setCurrentItem(midiFilterCtrl1); + cb2->setCurrentItem(midiFilterCtrl2); + cb3->setCurrentItem(midiFilterCtrl3); + cb4->setCurrentItem(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); + connect(rf1, SIGNAL(toggled(bool)), SLOT(recordChanged1(bool))); + connect(rf2, SIGNAL(toggled(bool)), SLOT(recordChanged2(bool))); + connect(rf3, SIGNAL(toggled(bool)), SLOT(recordChanged3(bool))); + connect(rf4, SIGNAL(toggled(bool)), SLOT(recordChanged4(bool))); + connect(rf5, SIGNAL(toggled(bool)), SLOT(recordChanged5(bool))); + 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); + connect(tf1, SIGNAL(toggled(bool)), SLOT(thruChanged1(bool))); + connect(tf2, SIGNAL(toggled(bool)), SLOT(thruChanged2(bool))); + connect(tf3, SIGNAL(toggled(bool)), SLOT(thruChanged3(bool))); + connect(tf4, SIGNAL(toggled(bool)), SLOT(thruChanged4(bool))); + connect(tf5, SIGNAL(toggled(bool)), SLOT(thruChanged5(bool))); + connect(tf6, SIGNAL(toggled(bool)), SLOT(thruChanged6(bool))); + connect(tf7, SIGNAL(toggled(bool)), SLOT(thruChanged7(bool))); + + cf1->setOn(midiInputChannel & 1); + cf2->setOn(midiInputChannel & 2); + cf3->setOn(midiInputChannel & 4); + cf4->setOn(midiInputChannel & 8); + cf5->setOn(midiInputChannel & 0x10); + cf6->setOn(midiInputChannel & 0x20); + cf7->setOn(midiInputChannel & 0x40); + cf8->setOn(midiInputChannel & 0x80); + cf9->setOn(midiInputChannel & 0x100); + cf10->setOn(midiInputChannel & 0x200); + cf11->setOn(midiInputChannel & 0x400); + cf12->setOn(midiInputChannel & 0x800); + cf13->setOn(midiInputChannel & 0x1000); + cf14->setOn(midiInputChannel & 0x2000); + cf15->setOn(midiInputChannel & 0x4000); + cf16->setOn(midiInputChannel & 0x8000); + + connect(cb1, SIGNAL(activated(int)), SLOT(setCtrl1(int))); + connect(cb2, SIGNAL(activated(int)), SLOT(setCtrl2(int))); + connect(cb3, SIGNAL(activated(int)), SLOT(setCtrl3(int))); + connect(cb4, SIGNAL(activated(int)), SLOT(setCtrl4(int))); + + connect(cf1, SIGNAL(toggled(bool)), SLOT(channelChanged1(bool))); + connect(cf2, SIGNAL(toggled(bool)), SLOT(channelChanged2(bool))); + connect(cf3, SIGNAL(toggled(bool)), SLOT(channelChanged3(bool))); + connect(cf4, SIGNAL(toggled(bool)), SLOT(channelChanged4(bool))); + connect(cf5, SIGNAL(toggled(bool)), SLOT(channelChanged5(bool))); + connect(cf6, SIGNAL(toggled(bool)), SLOT(channelChanged6(bool))); + connect(cf7, SIGNAL(toggled(bool)), SLOT(channelChanged7(bool))); + connect(cf8, SIGNAL(toggled(bool)), SLOT(channelChanged8(bool))); + connect(cf9, SIGNAL(toggled(bool)), SLOT(channelChanged9(bool))); + connect(cf10, SIGNAL(toggled(bool)), SLOT(channelChanged10(bool))); + connect(cf11, SIGNAL(toggled(bool)), SLOT(channelChanged11(bool))); + connect(cf12, SIGNAL(toggled(bool)), SLOT(channelChanged12(bool))); + connect(cf13, SIGNAL(toggled(bool)), SLOT(channelChanged13(bool))); + connect(cf14, SIGNAL(toggled(bool)), SLOT(channelChanged14(bool))); + connect(cf15, SIGNAL(toggled(bool)), SLOT(channelChanged15(bool))); + connect(cf16, SIGNAL(toggled(bool)), SLOT(channelChanged16(bool))); + } + +//--------------------------------------------------------- +// closeEvent +//--------------------------------------------------------- + +void MidiFilterConfig::closeEvent(QCloseEvent* ev) + { + emit hideWindow(); + QWidget::closeEvent(ev); + } + + diff --git a/muse2/muse/mplugins/midifilterimpl.h b/muse2/muse/mplugins/midifilterimpl.h new file mode 100644 index 00000000..4ab722c1 --- /dev/null +++ b/muse2/muse/mplugins/midifilterimpl.h @@ -0,0 +1,92 @@ +//========================================================= +// MusE +// Linux Music Editor +// $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) +//========================================================= + +#ifndef __MIDIFILTERIMP_H__ +#define __MIDIFILTERIMP_H__ + +#include "globals.h" +#include "midifilter.h" +//Added by qt3to4: +#include <QCloseEvent> + +//--------------------------------------------------------- +// MidiFilterConfig +//--------------------------------------------------------- + +class MidiFilterConfig : public MidiFilterConfigBase { + Q_OBJECT + + void rChanged(bool f, int val) { + if (f) + midiRecordType |= val; + else + midiRecordType &= ~val; + } + void tChanged(bool f, int val) { + if (f) + midiThruType |= val; + else + midiThruType &= ~val; + } + void chChanged(bool f, int val) { + if (f) + midiInputChannel |= val; + else + midiInputChannel &= ~val; + } + virtual void closeEvent(QCloseEvent*); + + signals: + void hideWindow(); + + private slots: + void channelChanged1(bool f) { chChanged(f, 0x01); } + void channelChanged2(bool f) { chChanged(f, 0x02); } + void channelChanged3(bool f) { chChanged(f, 0x04); } + void channelChanged4(bool f) { chChanged(f, 0x08); } + void channelChanged5(bool f) { chChanged(f, 0x10); } + void channelChanged6(bool f) { chChanged(f, 0x20); } + void channelChanged7(bool f) { chChanged(f, 0x40); } + void channelChanged8(bool f) { chChanged(f, 0x80); } + void channelChanged9(bool f) { chChanged(f, 0x100); } + void channelChanged10(bool f) { chChanged(f, 0x200); } + void channelChanged11(bool f) { chChanged(f, 0x400); } + void channelChanged12(bool f) { chChanged(f, 0x800); } + void channelChanged13(bool f) { chChanged(f, 0x1000); } + void channelChanged14(bool f) { chChanged(f, 0x2000); } + void channelChanged15(bool f) { chChanged(f, 0x4000); } + void channelChanged16(bool f) { chChanged(f, 0x8000); } + + void recordChanged1(bool f) { rChanged(f, 1); } + void recordChanged2(bool f) { rChanged(f, 2); } + void recordChanged3(bool f) { rChanged(f, 4); } + void recordChanged4(bool f) { rChanged(f, 8); } + void recordChanged5(bool f) { rChanged(f, 16); } + void recordChanged6(bool f) { rChanged(f, 32); } + void recordChanged7(bool f) { rChanged(f, 64); } + + void thruChanged1(bool f) { tChanged(f, 1); } + void thruChanged2(bool f) { tChanged(f, 2); } + void thruChanged3(bool f) { tChanged(f, 4); } + void thruChanged4(bool f) { tChanged(f, 8); } + void thruChanged5(bool f) { tChanged(f, 16); } + void thruChanged6(bool f) { tChanged(f, 32); } + void thruChanged7(bool f) { tChanged(f, 64); } + + void setCtrl1(int); + void setCtrl2(int); + void setCtrl3(int); + void setCtrl4(int); + + public: + MidiFilterConfig(QWidget* parent=0, const char* name=0); + }; + +#endif + + diff --git a/muse2/muse/mplugins/midiitransform.cpp b/muse2/muse/mplugins/midiitransform.cpp new file mode 100644 index 00000000..f3eecece --- /dev/null +++ b/muse2/muse/mplugins/midiitransform.cpp @@ -0,0 +1,1696 @@ +//========================================================= +// MusE +// Linux Music Editor +// $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) +//========================================================= + +#include <stdio.h> +#include <list> +#include <qpushbutton.h> +#include <q3buttongroup.h> +#include <qlineedit.h> +#include <qcombobox.h> +#include <q3listbox.h> +#include <qspinbox.h> +#include <q3multilineedit.h> +#include <qcheckbox.h> +#include <qtoolbutton.h> +//Added by qt3to4: +#include <QCloseEvent> + +#include "spinboxFP.h" +#include "midi.h" +#include "midictrl.h" +#include "event.h" +#include "mpevent.h" +#include "midiitransform.h" +#include "track.h" +#include "song.h" +#include "xml.h" +#include "gconfig.h" +#include "comboQuant.h" +#include "pitchedit.h" + +#define MIDITRANSFORM_NOTE 0 +#define MIDITRANSFORM_POLY 1 +#define MIDITRANSFORM_CTRL 2 +#define MIDITRANSFORM_ATOUCH 3 +#define MIDITRANSFORM_PITCHBEND 4 +#define MIDITRANSFORM_NRPN 5 +#define MIDITRANSFORM_RPN 6 + +static int selTypeTable[] = { + MIDITRANSFORM_NOTE, MIDITRANSFORM_POLY, MIDITRANSFORM_CTRL, MIDITRANSFORM_ATOUCH, + MIDITRANSFORM_PITCHBEND, MIDITRANSFORM_NRPN, MIDITRANSFORM_RPN + }; + +static int procTypeTable[] = { + MIDITRANSFORM_POLY, MIDITRANSFORM_CTRL, MIDITRANSFORM_ATOUCH, + MIDITRANSFORM_PITCHBEND, MIDITRANSFORM_NRPN, MIDITRANSFORM_RPN + }; + +static int procVal2Map[] = { 0, 1, 2, 3, 4, 5, 6, 7, 10, 11 }; + +struct TDict { + TransformFunction id; + const QString text; + TDict(TransformFunction f, const QString& s) : id(f), text(s) {} + }; + +static const TDict oplist[] = { + TDict(Transform, QString("Transform")), + TDict(Delete, QString("Filter")) + }; + +//--------------------------------------------------------- +// MidiInputTransform +//--------------------------------------------------------- + +class MidiInputTransformation { + public: + QString name; + QString comment; + + ValOp selEventOp; + int selType; + + ValOp selVal1; + int selVal1a, selVal1b; + ValOp selVal2; + int selVal2a, selVal2b; + ValOp selPort; + int selPorta, selPortb; + ValOp selChannel; + int selChannela, selChannelb; + + InputTransformProcEventOp procEvent; + int eventType; + + TransformOperator procVal1; + int procVal1a, procVal1b; + TransformOperator procVal2; + int procVal2a, procVal2b; + TransformOperator procPort; + int procPorta, procPortb; + TransformOperator procChannel; + int procChannela, procChannelb; + + TransformFunction funcOp; + int quantVal; + + MidiInputTransformation(const QString& s) { + name = s; + selEventOp = All; + selType = MIDITRANSFORM_NOTE; + selVal1 = Ignore; + selVal1a = 0; + selVal1b = 0; + selVal2 = Ignore; + selVal2a = 0; + selVal2b = 0; + procEvent = KeepType; + eventType = MIDITRANSFORM_POLY; + procVal1 = Keep; + procVal1a = 0; + procVal1b = 0; + procVal2 = Keep; + procVal2a = 0; + procVal2b = 0; + funcOp = Transform; + quantVal = config.division; + selPort = Ignore; + selChannel = Ignore; + selChannela = 0; + selChannelb = 0; + procPort = Keep; + procChannel = Keep; + procPorta = 0; + procPortb = 0; + procChannela = 0; + procChannelb = 0; + } + void write(int level, Xml& xml) const; + int apply(MidiRecordEvent& ev) const; + bool typesMatch(MidiRecordEvent& e, int selType) const; + }; + +typedef std::list<MidiInputTransformation*> MidiInputTransformationList; +typedef std::list<MidiInputTransformation*>::iterator iMidiInputTransformation; +typedef std::list<MidiInputTransformation*>::const_iterator ciMidiInputTransformation; + +// this is the list of defined transformations: +static MidiInputTransformationList mtlist; + +// list of modules to apply: + +struct ITransModul { + bool valid; + MidiInputTransformation* transform; + }; + +const int MIDI_INPUT_TRANSFORMATIONS = 4; +static ITransModul modules[MIDI_INPUT_TRANSFORMATIONS]; + +//--------------------------------------------------------- +// applyMidiInputTransformation +// return false if event should be dropped +// (filter) +//--------------------------------------------------------- + +bool applyMidiInputTransformation(MidiRecordEvent& event) + { + for (int i = 0; i < 4; ++i) { + if (modules[i].valid && modules[i].transform) { + int rv = modules[i].transform->apply(event); + if (rv == 1) + printf("drop input event\n"); + if (rv) + return rv != 1; + } + } + return true; + } + +//--------------------------------------------------------- +// filterValOp +//--------------------------------------------------------- + +static bool filterValOp(ValOp op, int val, int val1, int val2) + { + switch (op) { + case Ignore: + break; + case Equal: + if (val != val1) + return true; + break; + case Unequal: + if (val == val1) + return true; + break; + case Higher: + if (val <= val1) + return true; + break; + case Lower: + if (val >= val1) + return true; + break; + case Inside: + if ((val < val1) || (val >= val2)) + return true; + break; + case Outside: + if ((val >= val1) && (val < val2)) + return true; + break; + } + return false; + } + +//--------------------------------------------------------- +// apply +// apply Select filter +// return 0 - not applied +// 1 - drop event +// 2 - event changed +//--------------------------------------------------------- + +int MidiInputTransformation::apply(MidiRecordEvent& event) const + { + int t = event.type(); + + switch (selEventOp) { + case Equal: + switch(t) { + case ME_NOTEON: + case ME_NOTEOFF: + if (selType != MIDITRANSFORM_NOTE) + return 0; + break; + default: + if(!typesMatch(event, selType)) + return 0; + break; + } + break; + case Unequal: + switch(event.type()) { + case ME_NOTEON: + case ME_NOTEOFF: + if (selType == MIDITRANSFORM_NOTE) + return 0; + break; + default: + if(typesMatch(event, selType)) + return 0; + break; + } + break; + default: + break; + } + if (filterValOp(selVal1, event.dataA(), selVal1a, selVal1b)) + return 0; + if (filterValOp(selVal2, event.dataB(), selVal2a, selVal2b)) + return 0; + if (filterValOp(selPort, event.port(), selPorta, selPortb)) + return 0; + if (filterValOp(selChannel, event.channel(), selChannela, selChannelb)) + return 0; + + if (funcOp == Delete) + return 1; // discard event + + // transform event +//printf("transform\n"); + if (procEvent != KeepType) + { + switch(eventType) + { + case MIDITRANSFORM_POLY: + event.setType(ME_POLYAFTER); + break; + case MIDITRANSFORM_CTRL: + event.setType(ME_CONTROLLER); + break; + case MIDITRANSFORM_ATOUCH: + event.setType(ME_AFTERTOUCH); + break; + case MIDITRANSFORM_PITCHBEND: + { + event.setType(ME_PITCHBEND); + } + break; + case MIDITRANSFORM_NRPN: + { + event.setA(MidiController::NRPN); + event.setType(ME_CONTROLLER); + } + break; + case MIDITRANSFORM_RPN: + { + event.setA(MidiController::RPN); + event.setType(ME_CONTROLLER); + } + break; + default: + break; + } + } + + //--------------------------------------------------- + // transform value A + //--------------------------------------------------- + + int val = event.dataA(); + switch (procVal1) { + case Keep: + break; + case Plus: + val += procVal1a; + break; + case Minus: + val -= procVal1a; + break; + case Multiply: + val = int(val * (procVal1a/100.0) + .5); + break; + case Divide: + val = int(val / (procVal1a/100.0) + .5); + break; + case Fix: + val = procVal1a; + break; + case Value: + val = procVal2a; + break; + case Invert: + val = 127 - val; + break; + case ScaleMap: + printf("scale map not implemented\n"); + break; + case Flip: + val = procVal1a - val; + break; + case Dynamic: // "crescendo" + printf("transform not implemented\n"); + break; + case Random: + { + int range = procVal1b - procVal1a; + if (range > 0) + val = (rand() % range) + procVal1a; + else if (range < 0) + val = (rand() % -range) + procVal1b; + else + val = procVal1a; + } + break; + } + if (val < 0) + val = 0; + if (val > 127) + val = 127; + event.setA(val); + + //--------------------------------------------------- + // transform value B + //--------------------------------------------------- + + val = event.dataB(); + switch (procVal2) { + case Plus: + val += procVal2a; + break; + case Minus: + val -= procVal2a; + break; + case Multiply: + val = int(val * (procVal2a/100.0) + .5); + break; + case Divide: + val = int(val / (procVal2a/100.0) + .5); + break; + case Fix: + val = procVal2a; + break; + case Value: + val = procVal1a; + break; + case Invert: + val = 127 - val; + break; + case Dynamic: + printf("transform not implemented\n"); + break; + case Random: + { + int range = procVal2b - procVal2a; + if (range > 0) + val = (rand() % range) + procVal2a; + else if (range < 0) + val = (rand() % -range) + procVal2b; + else + val = procVal2a; + } + break; + case ScaleMap: + case Keep: + case Flip: + break; + } + if (val < 0) + val = 0; + if (val > 127) + val = 127; + event.setB(val); + + //--------------------------------------------------- + // transform port + //--------------------------------------------------- + + val = event.port(); + switch (procPort) { + case Plus: + val += procPorta; + break; + case Minus: + val -= procPorta; + break; + case Multiply: + val = int(val * (procPorta/100.0) + .5); + break; + case Divide: + val = int(val / (procPorta/100.0) + .5); + break; + case Fix: + val = procPorta; + break; + case Value: + val = procPorta; + break; + case Invert: + val = 15 - val; + break; + case Dynamic: + printf("transform not implemented\n"); + break; + case Random: + { + int range = procPortb - procPorta; + if (range > 0) + val = (rand() % range) + procPorta; + else if (range < 0) + val = (rand() % -range) + procPortb; + else + val = procPorta; + } + break; + case ScaleMap: + case Keep: + case Flip: + break; + } + if (val < 0) + val = 0; + if (val > 15) + val = 15; + event.setPort(val); + + //--------------------------------------------------- + // transform channel + //--------------------------------------------------- + + val = event.channel(); + switch (procChannel) { + case Plus: + val += procChannela; + break; + case Minus: + val -= procChannela; + break; + case Multiply: + val = int(val * (procChannela/100.0) + .5); + break; + case Divide: + val = int(val / (procChannela/100.0) + .5); + break; + case Fix: + val = procChannela; + break; + case Value: + val = procChannela; + break; + case Invert: + val = 16 - val; + break; + case Dynamic: + printf("transform not implemented\n"); + break; + case Random: + { + int range = procChannelb - procChannela; + if (range > 0) + val = (rand() % range) + procChannela; + else if (range < 0) + val = (rand() % -range) + procChannelb; + else + val = procChannela; + } + break; + case ScaleMap: + case Keep: + case Flip: + break; + } + if (val < 0) + val = 0; + if (val > 15) + val = 15; + event.setChannel(val); + + return 2; + } + +//--------------------------------------------------------- +// typesMatch +//--------------------------------------------------------- + +bool MidiInputTransformation::typesMatch(MidiRecordEvent& e, int selType) const + { + bool matched = false; + int t = e.type(); + switch (selType) + { + case MIDITRANSFORM_NOTE: + matched = ((t == ME_NOTEON) || (t == ME_NOTEOFF)); + break; + case MIDITRANSFORM_POLY: + matched = (t == ME_POLYAFTER); + break; + case MIDITRANSFORM_CTRL: + matched = (t == ME_CONTROLLER); + break; + case MIDITRANSFORM_ATOUCH: + matched = (t == ME_AFTERTOUCH); + break; + case MIDITRANSFORM_PITCHBEND: + { + //if (t == ME_CONTROLLER) { + // MidiController::ControllerType c = midiControllerType(e.dataA()); + // matched = (c == MidiController::Pitch); + matched = (t = ME_PITCHBEND); + } + break; + case MIDITRANSFORM_NRPN: + { + if (t == ME_CONTROLLER) { + MidiController::ControllerType c = midiControllerType(e.dataA()); + matched = (c == MidiController::NRPN); + } + } + break; + case MIDITRANSFORM_RPN: + { + if (t == ME_CONTROLLER) { + MidiController::ControllerType c = midiControllerType(e.dataA()); + matched = (c == MidiController::RPN); + } + } + break; + default: + fprintf(stderr, "Error matching type in MidiTransformerDialog: unknown eventtype!\n"); + break; + } + //printf("Event type=%d, selType =%d matched=%d\n", e.type(), selType, matched); + return matched; + } + +//--------------------------------------------------------- +// MidiInputTransformDialog +// Widgets: +// presetList nameEntry commentEntry +// selEventOp selType +// selVal1Op selVal1a selVal1b +// selVal2Op selVal2a selVal2b +// +// procEventOp procType +// procVal1Op procVal1a procVal1b +// procVal2Op procVal2a procVal2b +// funcOp funcQuantVal +// buttonNew buttonDelete +// +// modulGroup +// modul1select modul1enable +// modul2select modul2enable +// modul3select modul3enable +// modul4select modul4enable +// +// selPortOp selPortVala selPortValb +// selChannelOp selChannelVala selChannelValb +// +// procPortOp procPortVala procPortValb +// procChannelOp procChannelVala procChannelValb +//--------------------------------------------------------- + +MidiInputTransformDialog::MidiInputTransformDialog(QWidget* parent, + const char* name, bool modal, Qt::WFlags fl) + : MidiInputTransformDialogBase(parent, name, modal, fl) + { + cindex = 0; + cmodul = 0; + cmt = 0; + + for (unsigned i = 0; i < sizeof(oplist)/sizeof(*oplist); ++i) + funcOp->insertItem(oplist[i].text, i); + + connect(buttonNew, SIGNAL(clicked()), SLOT(presetNew())); + connect(buttonDelete, SIGNAL(clicked()), SLOT(presetDelete())); + connect(selEventOp, SIGNAL(activated(int)), SLOT(selEventOpSel(int))); + connect(selType, SIGNAL(activated(int)), SLOT(selTypeSel(int))); + connect(selVal1Op, SIGNAL(activated(int)), SLOT(selVal1OpSel(int))); + connect(selVal2Op, SIGNAL(activated(int)), SLOT(selVal2OpSel(int))); + connect(procEventOp, SIGNAL(activated(int)), SLOT(procEventOpSel(int))); + connect(procType, SIGNAL(activated(int)), SLOT(procEventTypeSel(int))); + connect(procVal1Op, SIGNAL(activated(int)), SLOT(procVal1OpSel(int))); + connect(procVal2Op, SIGNAL(activated(int)), SLOT(procVal2OpSel(int))); + connect(funcOp, SIGNAL(activated(int)), SLOT(funcOpSel(int))); + connect(presetList, SIGNAL(highlighted(Q3ListBoxItem*)), + SLOT(presetChanged(Q3ListBoxItem*))); + connect(nameEntry, SIGNAL(textChanged(const QString&)), + SLOT(nameChanged(const QString&))); + connect(commentEntry, SIGNAL(textChanged()), SLOT(commentChanged())); + + connect(selVal1a, SIGNAL(valueChanged(int)), SLOT(selVal1aChanged(int))); + connect(selVal1b, SIGNAL(valueChanged(int)), SLOT(selVal1bChanged(int))); + connect(selVal2a, SIGNAL(valueChanged(int)), SLOT(selVal2aChanged(int))); + connect(selVal2b, SIGNAL(valueChanged(int)), SLOT(selVal2bChanged(int))); + connect(procVal1a, SIGNAL(valueChanged(int)), SLOT(procVal1aChanged(int))); + connect(procVal1b, SIGNAL(valueChanged(int)), SLOT(procVal1bChanged(int))); + connect(procVal2a, SIGNAL(valueChanged(int)), SLOT(procVal2aChanged(int))); + connect(procVal2b, SIGNAL(valueChanged(int)), SLOT(procVal2bChanged(int))); + + connect(modul1enable, SIGNAL(toggled(bool)), SLOT(modul1enableChanged(bool))); + connect(modul2enable, SIGNAL(toggled(bool)), SLOT(modul2enableChanged(bool))); + connect(modul3enable, SIGNAL(toggled(bool)), SLOT(modul3enableChanged(bool))); + connect(modul4enable, SIGNAL(toggled(bool)), SLOT(modul4enableChanged(bool))); + connect(modulGroup, SIGNAL(clicked(int)), SLOT(changeModul(int))); + + connect(selPortOp, SIGNAL(activated(int)), SLOT(selPortOpSel(int))); + connect(selPortVala, SIGNAL(valueChanged(int)), SLOT(selPortValaChanged(int))); + connect(selPortValb, SIGNAL(valueChanged(int)), SLOT(selPortValbChanged(int))); + + connect(selChannelOp, SIGNAL(activated(int)), SLOT(selChannelOpSel(int))); + connect(selChannelVala, SIGNAL(valueChanged(int)), SLOT(selChannelValaChanged(int))); + connect(selChannelValb, SIGNAL(valueChanged(int)), SLOT(selChannelValbChanged(int))); + + connect(procPortOp, SIGNAL(activated(int)), SLOT(procPortOpSel(int))); + connect(procPortVala, SIGNAL(valueChanged(int)), SLOT(procPortValaChanged(int))); + connect(procPortValb, SIGNAL(valueChanged(int)), SLOT(procPortValbChanged(int))); + + connect(procChannelOp, SIGNAL(activated(int)), SLOT(procChannelOpSel(int))); + connect(procChannelVala, SIGNAL(valueChanged(int)), SLOT(procChannelValaChanged(int))); + connect(procChannelValb, SIGNAL(valueChanged(int)), SLOT(procChannelValbChanged(int))); + + //--------------------------------------------------- + // populate preset list + //--------------------------------------------------- + + updatePresetList(); + connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + } + +//--------------------------------------------------------- +// songChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::songChanged(int flags) +{ + // Whenever a song is loaded, flags is -1. Since transforms are part of configuration, + // use SC_CONFIG here, to filter unwanted song change events. + if(flags & SC_CONFIG) + updatePresetList(); +} + +//--------------------------------------------------------- +// updatePresetList +//--------------------------------------------------------- + +void MidiInputTransformDialog::updatePresetList() +{ + cmt = 0; + presetList->clear(); + + modul1select->setOn(true); + for (iMidiInputTransformation i = mtlist.begin(); i != mtlist.end(); ++i) { + presetList->insertItem((*i)->name); + if (cmt == 0) + cmt = *i; + } + if (cmt == 0) { + // create default "New" preset + cmt = new MidiInputTransformation(tr("New")); + mtlist.push_back(cmt); + presetList->insertItem(tr("New")); + presetList->setCurrentItem(0); + } + changeModul(0); + + modul1enable->setChecked(modules[0].valid); + modul2enable->setChecked(modules[1].valid); + modul3enable->setChecked(modules[2].valid); + modul4enable->setChecked(modules[3].valid); +} + +//--------------------------------------------------------- +// closeEvent +//--------------------------------------------------------- + +void MidiInputTransformDialog::closeEvent(QCloseEvent* ev) + { + emit hideWindow(); + QWidget::closeEvent(ev); + } + +//--------------------------------------------------------- +// writeMidiTransforms +//--------------------------------------------------------- + +void writeMidiInputTransforms(int level, Xml& xml) + { + for (iMidiInputTransformation i = mtlist.begin(); i != mtlist.end(); ++i) { + (*i)->write(level, xml); + } + } + +//--------------------------------------------------------- +// write +//--------------------------------------------------------- + +void MidiInputTransformation::write(int level, Xml& xml) const + { + xml.tag(level++, "midiInputTransform"); + xml.strTag(level, "name", name); + xml.strTag(level, "comment", comment); + xml.intTag(level, "function", int(funcOp)); + + // apply this transformation? + for (int i = 0; i < MIDI_INPUT_TRANSFORMATIONS; ++i) { + if (modules[i].transform == this) { + xml.intTag(level, "apply", int(modules[i].valid)); + break; + } + } + if (funcOp == Quantize) { + xml.intTag(level, "quantVal", quantVal); + } + if (funcOp == Transform || funcOp == Insert) { + if (procEvent != KeepType) { + xml.intTag(level, "procEventOp", int(procEvent)); + xml.intTag(level, "eventType", int(eventType)); + } + if (procVal1 != Keep) { + xml.intTag(level, "procVal1Op", int(procVal1)); + xml.intTag(level, "procVal1a", procVal1a); + xml.intTag(level, "procVal1b", procVal1b); + } + if (procVal2 != Keep) { + xml.intTag(level, "procVal2Op", int(procVal2)); + xml.intTag(level, "procVal2a", procVal2a); + xml.intTag(level, "procVal2b", procVal2b); + } + if (procPort != Keep) { + xml.intTag(level, "procPortOp", int(procPort)); + xml.intTag(level, "procPorta", procPorta); + xml.intTag(level, "procPortb", procPortb); + } + if (procChannel != Keep) { + xml.intTag(level, "procChannelOp", int(procChannel)); + xml.intTag(level, "procChannela", procChannela); + xml.intTag(level, "procChannelb", procChannelb); + } + } + if (selEventOp != Ignore) { + xml.intTag(level, "selEventOp", int(selEventOp)); + xml.intTag(level, "selEventType", int(selType)); + } + if (selVal1 != Ignore) { + xml.intTag(level, "selVal1Op", int(selVal1)); + xml.intTag(level, "selVal1a", selVal1a); + xml.intTag(level, "selVal1b", selVal1b); + } + if (selVal2 != Ignore) { + xml.intTag(level, "selVal2Op", int(selVal2)); + xml.intTag(level, "selVal2a", selVal2a); + xml.intTag(level, "selVal2b", selVal2b); + } + if (selPort != Ignore) { + xml.intTag(level, "selPortOp", int(selPort)); + xml.intTag(level, "selPorta", selPorta); + xml.intTag(level, "selPortb", selPortb); + } + if (selChannel != Ignore) { + xml.intTag(level, "selChannelOp", int(selChannel)); + xml.intTag(level, "selChannela", selChannela); + xml.intTag(level, "selChannelb", selChannelb); + } + xml.etag(level, "midiInputTransform"); + } + +//--------------------------------------------------------- +// readMidiTransform +//--------------------------------------------------------- + +void readMidiInputTransform(Xml& xml) + { + MidiInputTransformation trans(QString("new")); + int apply = -1; + + for (;;) { + Xml::Token token = xml.parse(); + const QString& tag = xml.s1(); + switch (token) { + case Xml::Error: + case Xml::End: + return; + case Xml::TagStart: + if (tag == "name") + trans.name = xml.parse1(); + else if (tag == "comment") + trans.comment = xml.parse1(); + else if (tag == "function") + trans.funcOp = TransformFunction(xml.parseInt()); + else if (tag == "quantVal") + trans.quantVal = xml.parseInt(); + else if (tag == "procEventOp") + trans.procEvent = InputTransformProcEventOp(xml.parseInt()); + else if (tag == "eventType") + trans.eventType = xml.parseInt(); + else if (tag == "procVal1Op") + trans.procVal1 = TransformOperator(xml.parseInt()); + else if (tag == "procVal1a") + trans.procVal1a = xml.parseInt(); + else if (tag == "procVal1b") + trans.procVal1b = xml.parseInt(); + else if (tag == "procVal2Op") + trans.procVal2 = TransformOperator(xml.parseInt()); + else if (tag == "procVal2a") + trans.procVal2a = xml.parseInt(); + else if (tag == "procVal2b") + trans.procVal2b = xml.parseInt(); + else if (tag == "selEventOp") + trans.selEventOp = ValOp(xml.parseInt()); + else if (tag == "selEventType") + trans.selType = xml.parseInt(); + else if (tag == "selVal1Op") + trans.selVal1 = ValOp(xml.parseInt()); + else if (tag == "selVal1a") + trans.selVal1a = xml.parseInt(); + else if (tag == "selVal1b") + trans.selVal1b = xml.parseInt(); + else if (tag == "selVal2Op") + trans.selVal2 = ValOp(xml.parseInt()); + else if (tag == "selVal2a") + trans.selVal2a = xml.parseInt(); + else if (tag == "selVal2b") + trans.selVal2b = xml.parseInt(); + + else if (tag == "procPortOp") + trans.procPort = TransformOperator(xml.parseInt()); + else if (tag == "procPorta") + trans.procPorta = xml.parseInt(); + else if (tag == "procPortb") + trans.procPortb = xml.parseInt(); + else if (tag == "procChannelOp") + trans.procChannel = TransformOperator(xml.parseInt()); + else if (tag == "procChannela") + trans.procChannela = xml.parseInt(); + else if (tag == "procChannelb") + trans.procChannelb = xml.parseInt(); + + else if (tag == "selPortOp") + trans.selPort = ValOp(xml.parseInt()); + else if (tag == "selPorta") + trans.selPorta = xml.parseInt(); + else if (tag == "selPortb") + trans.selPortb = xml.parseInt(); + else if (tag == "selChannelOp") + trans.selChannel = ValOp(xml.parseInt()); + else if (tag == "selChannela") + trans.selChannela = xml.parseInt(); + else if (tag == "selChannelb") + trans.selChannelb = xml.parseInt(); + + else if (tag == "apply") + apply = xml.parseInt(); + else + xml.unknown("midiInputTransform"); + break; + case Xml::TagEnd: + if (xml.s1() == "midiInputTransform") { +// printf("midi Input transform <%s> apply %d\n", +// trans.name.latin1(), apply); + + // By T356. A previous bug caused some .med files to grow very large + // with duplicate transforms. Here we can eliminate those duplicates. + for(iMidiInputTransformation i = mtlist.begin(); i != mtlist.end(); ++i) + { + if((*i)->name == trans.name) + { + return; + } + } + + MidiInputTransformation* t = new MidiInputTransformation(trans); + // search free slot in modules + if (apply != -1) { + for (int i = 0; i < MIDI_INPUT_TRANSFORMATIONS; ++i) { + if (modules[i].transform == 0) { + modules[i].transform = t; + modules[i].valid = apply; + break; + } + } + } + mtlist.push_back(t); + return; + } + default: + break; + } + } + } + +//--------------------------------------------------------- +// clearMidiInputTransforms +//--------------------------------------------------------- + +void clearMidiInputTransforms() +{ + for (int i = 0; i < MIDI_INPUT_TRANSFORMATIONS; ++i) + { + modules[i].transform = 0; + modules[i].valid = false; + } + for (iMidiInputTransformation i = mtlist.begin(); i != mtlist.end(); ++i) + { + MidiInputTransformation* t = *i; + if(t) + delete t; + } + mtlist.clear(); +} + +//--------------------------------------------------------- +// accept +//--------------------------------------------------------- + +void MidiInputTransformDialog::accept() + { + reject(); + } + +//--------------------------------------------------------- +// reject +//--------------------------------------------------------- + +void MidiInputTransformDialog::reject() + { + close(false); + } + +//--------------------------------------------------------- +// setValOp +//--------------------------------------------------------- + +void MidiInputTransformDialog::setValOp(QWidget* a, QWidget* b, ValOp op) + { + switch (op) { + case Ignore: + a->setEnabled(false); + b->setEnabled(false); + break; + case Equal: + case Unequal: + case Higher: + case Lower: + a->setEnabled(true); + b->setEnabled(false); + break; + case Inside: + case Outside: + a->setEnabled(true); + b->setEnabled(true); + break; + } + } + +//--------------------------------------------------------- +// selEventOpSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::selEventOpSel(int val) + { + selType->setEnabled(val != All); + cmt->selEventOp = ValOp(val); + selVal1aChanged(cmt->selVal1a); + selVal1bChanged(cmt->selVal1b); + } + +//--------------------------------------------------------- +// selTypeSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::selTypeSel(int val) + { + cmt->selType = selTypeTable[val]; + selVal1aChanged(cmt->selVal1a); + selVal1bChanged(cmt->selVal1b); + } + +//--------------------------------------------------------- +// selVal1OpSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::selVal1OpSel(int val) + { + setValOp(selVal1a, selVal1b, ValOp(val)); + cmt->selVal1 = ValOp(val); + } + +//--------------------------------------------------------- +// selVal2OpSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::selVal2OpSel(int val) + { + setValOp(selVal2a, selVal2b, ValOp(val)); + cmt->selVal2 = ValOp(val); + } + +//--------------------------------------------------------- +// procEventOpSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::procEventOpSel(int val) + { + InputTransformProcEventOp op = val == 0 ? KeepType : FixType; + procType->setEnabled(op == FixType); + cmt->procEvent = op; + + procVal1aChanged(cmt->procVal1a); + procVal1bChanged(cmt->procVal1b); + } + +//--------------------------------------------------------- +// procEventTypeSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::procEventTypeSel(int val) + { + cmt->eventType = procTypeTable[val]; + procVal1aChanged(cmt->procVal1a); + procVal1bChanged(cmt->procVal1b); + } + +//--------------------------------------------------------- +// procVal1OpSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::procVal1OpSel(int val) + { + cmt->procVal1 = TransformOperator(val); + switch(TransformOperator(val)) { + case Keep: + case Invert: + procVal1a->setEnabled(false); + procVal1b->setEnabled(false); + break; + case Multiply: + case Divide: + procVal1a->setEnabled(true); + procVal1a->setPrecision(2); + procVal1b->setEnabled(false); + break; + case Plus: + case Minus: + case Fix: + case Value: + case Flip: + procVal1a->setPrecision(0); + procVal1a->setEnabled(true); + procVal1b->setEnabled(false); + break; + case Random: + case ScaleMap: + case Dynamic: + procVal1a->setPrecision(0); + procVal1a->setEnabled(true); + procVal1b->setEnabled(true); + break; + } + procVal1aChanged(cmt->procVal1a); + procVal1bChanged(cmt->procVal1b); + } + +//--------------------------------------------------------- +// procVal2OpSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::procVal2OpSel(int val) + { + TransformOperator op = TransformOperator(procVal2Map[val]); + cmt->procVal2 = op; + + switch (op) { + case Keep: + case Invert: + procVal2a->setEnabled(false); + procVal2b->setEnabled(false); + break; + case Multiply: + case Divide: + procVal2a->setEnabled(true); + procVal2a->setPrecision(2); + procVal2b->setEnabled(false); + break; + case Plus: + case Minus: + case Fix: + case Value: + procVal2a->setPrecision(0); + procVal2a->setEnabled(true); + procVal2b->setEnabled(false); + break; + case Random: + case Dynamic: + procVal2a->setPrecision(0); + procVal2a->setEnabled(true); + procVal2b->setEnabled(true); + break; + default: + break; + } + } + +//--------------------------------------------------------- +// funcOpSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::funcOpSel(int val) + { + TransformFunction op = oplist[val].id; + + bool isFuncOp(op == Transform); + + procEventOp->setEnabled(isFuncOp); + procType->setEnabled(isFuncOp); + procVal1Op->setEnabled(isFuncOp); + procVal1a->setEnabled(isFuncOp); + procVal1b->setEnabled(isFuncOp); + procVal2Op->setEnabled(isFuncOp); + procVal2a->setEnabled(isFuncOp); + procVal2b->setEnabled(isFuncOp); + procPortOp->setEnabled(isFuncOp); + procPortVala->setEnabled(isFuncOp); + procPortValb->setEnabled(isFuncOp); + procChannelOp->setEnabled(isFuncOp); + procChannelVala->setEnabled(isFuncOp); + procChannelValb->setEnabled(isFuncOp); + if (isFuncOp) { + procEventOpSel(cmt->procEvent); + procVal1OpSel(cmt->procVal1); + procVal2OpSel(cmt->procVal2); + procPortOpSel(cmt->procPort); + procChannelOpSel(cmt->procChannel); + } + cmt->funcOp = op; + } + +//--------------------------------------------------------- +// presetNew +//--------------------------------------------------------- + +void MidiInputTransformDialog::presetNew() + { + QString name; + for (int i = 0;; ++i) { + name.sprintf("New-%d", i); + iMidiInputTransformation imt; + for (imt = mtlist.begin(); imt != mtlist.end(); ++imt) { + if (name == (*imt)->name) + break; + } + if (imt == mtlist.end()) + break; + } + MidiInputTransformation* mt = new MidiInputTransformation(name); + Q3ListBoxText* lbi = new Q3ListBoxText(presetList, name); + mtlist.push_back(mt); + presetList->setCurrentItem(lbi); + } + +//--------------------------------------------------------- +// presetDelete +//--------------------------------------------------------- + +void MidiInputTransformDialog::presetDelete() + { + if (cindex != -1) { + iMidiInputTransformation mt = mtlist.begin(); + for (int i = 0; i < cindex; ++i, ++mt) { + mtlist.erase(mt); + presetList->removeItem(cindex); + break; + } + } + } + +//--------------------------------------------------------- +// nameChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::nameChanged(const QString& s) + { + cmt->name = s; + Q3ListBoxItem* item = presetList->item(cindex); + if (s != item->text()) { + disconnect(presetList, SIGNAL(highlighted(Q3ListBoxItem*)), + this, SLOT(presetChanged(Q3ListBoxItem*))); + presetList->changeItem(s, cindex); + connect(presetList, SIGNAL(highlighted(Q3ListBoxItem*)), + SLOT(presetChanged(Q3ListBoxItem*))); + } + } + +//--------------------------------------------------------- +// commentChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::commentChanged() + { + cmt->comment = commentEntry->text(); + } + +//--------------------------------------------------------- +// selVal1aChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::selVal1aChanged(int val) + { + cmt->selVal1a = val; + if ((cmt->selEventOp != All) + && (cmt->selType == MIDITRANSFORM_NOTE)) { + selVal1a->setSuffix(" - " + pitch2string(val)); + } + else + selVal1a->setSuffix(QString("")); + } + +//--------------------------------------------------------- +// selVal1bChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::selVal1bChanged(int val) + { + cmt->selVal1b = val; + if ((cmt->selEventOp != All) + && (cmt->selType == MIDITRANSFORM_NOTE)) { + selVal1b->setSuffix(" - " + pitch2string(val)); + } + else + selVal1b->setSuffix(QString("")); + } + +//--------------------------------------------------------- +// selVal2aChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::selVal2aChanged(int val) + { + cmt->selVal2a = val; + } + +//--------------------------------------------------------- +// selVal2bChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::selVal2bChanged(int val) + { + cmt->selVal2b = val; + } + +//--------------------------------------------------------- +// procVal1aChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::procVal1aChanged(int val) + { + cmt->procVal1a = val; + + if((cmt->procEvent == KeepType && cmt->selType == MIDITRANSFORM_NOTE) && + (cmt->procVal1 == Fix || cmt->procVal1 == ScaleMap || cmt->procVal1 == Dynamic || + cmt->procVal1 == Random || cmt->procVal1 == Flip)) + { + procVal1a->setSuffix(" - " + pitch2string(val)); + } + else + procVal1a->setSuffix(QString("")); + } + +//--------------------------------------------------------- +// procVal1bChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::procVal1bChanged(int val) + { + cmt->procVal1b = val; + + if((cmt->procEvent == KeepType && cmt->selType == MIDITRANSFORM_NOTE) && + (cmt->procVal1 == Fix || cmt->procVal1 == ScaleMap || cmt->procVal1 == Dynamic || + cmt->procVal1 == Random || cmt->procVal1 == Flip)) + { + procVal1b->setSuffix(" - " + pitch2string(val)); + } + else + procVal1b->setSuffix(QString("")); + } + +//--------------------------------------------------------- +// procVal2aChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::procVal2aChanged(int val) + { + cmt->procVal2a = val; + } + +//--------------------------------------------------------- +// procVal2bChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::procVal2bChanged(int val) + { + cmt->procVal2b = val; + } + +//--------------------------------------------------------- +// modul1enableChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::modul1enableChanged(bool val) + { + modules[0].valid = val; + } + +//--------------------------------------------------------- +// modul2enableChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::modul2enableChanged(bool val) + { + modules[1].valid = val; + } + +//--------------------------------------------------------- +// modul3enableChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::modul3enableChanged(bool val) + { + modules[2].valid = val; + } + +//--------------------------------------------------------- +// modul4enableChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::modul4enableChanged(bool val) + { + modules[3].valid = val; + } + +//--------------------------------------------------------- +// selPortOpSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::selPortOpSel(int val) + { + setValOp(selPortVala, selPortValb, ValOp(val)); + cmt->selPort = ValOp(val); + } + +//--------------------------------------------------------- +// selPortValaChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::selPortValaChanged(int val) + { + cmt->selPorta = val; + } + +//--------------------------------------------------------- +// selPortValbChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::selPortValbChanged(int val) + { + cmt->selPortb = val; + } + +//--------------------------------------------------------- +// selChannelOpSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::selChannelOpSel(int val) + { + setValOp(selChannelVala, selChannelValb, ValOp(val)); + cmt->selChannel = ValOp(val); + } + +//--------------------------------------------------------- +// selChannelValaChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::selChannelValaChanged(int val) + { + cmt->selChannela = val; + } + +//--------------------------------------------------------- +// selChannelValbChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::selChannelValbChanged(int val) + { + cmt->selChannelb = val; + } + +//--------------------------------------------------------- +// procPortOpSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::procPortOpSel(int val) + { + cmt->procPort = TransformOperator(val); + switch(TransformOperator(val)) { + case Keep: + case Invert: + procPortVala->setEnabled(false); + procPortValb->setEnabled(false); + break; + case Multiply: + case Divide: + procPortVala->setEnabled(true); + procPortVala->setPrecision(2); + procPortValb->setEnabled(false); + break; + case Plus: + case Minus: + case Fix: + case Value: + case Flip: + procPortVala->setPrecision(0); + procPortVala->setEnabled(true); + procPortValb->setEnabled(false); + break; + case Random: + case ScaleMap: + case Dynamic: + procPortVala->setPrecision(0); + procPortVala->setEnabled(true); + procPortValb->setEnabled(true); + break; + } + } + +//--------------------------------------------------------- +// procPortValaChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::procPortValaChanged(int val) + { + cmt->procPorta = val; + } + +//--------------------------------------------------------- +// procPortValbChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::procPortValbChanged(int val) + { + cmt->procPortb = val; + } + +//--------------------------------------------------------- +// procChannelOpSel +//--------------------------------------------------------- + +void MidiInputTransformDialog::procChannelOpSel(int val) + { + cmt->procChannel = TransformOperator(val); + switch(TransformOperator(val)) { + case Keep: + case Invert: + procChannelVala->setEnabled(false); + procChannelValb->setEnabled(false); + break; + case Multiply: + case Divide: + procChannelVala->setEnabled(true); + procChannelVala->setPrecision(2); + procChannelValb->setEnabled(false); + break; + case Plus: + case Minus: + case Fix: + case Value: + case Flip: + procChannelVala->setPrecision(0); + procChannelVala->setEnabled(true); + procChannelValb->setEnabled(false); + break; + case Random: + case ScaleMap: + case Dynamic: + procChannelVala->setPrecision(0); + procChannelVala->setEnabled(true); + procChannelValb->setEnabled(true); + break; + } + } + +//--------------------------------------------------------- +// procChannelValaChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::procChannelValaChanged(int val) + { + cmt->procChannela = val; + } + +//--------------------------------------------------------- +// procChannelValbChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::procChannelValbChanged(int val) + { + cmt->procChannelb = val; + } + +//--------------------------------------------------------- +// changeModul +//--------------------------------------------------------- + +void MidiInputTransformDialog::changeModul(int k) + { +printf("change modul %d\n", k); + + cmodul = k; // current modul + + if (modules[k].transform == 0) { + printf("transform %d ist null\n", k); + modules[k].transform = cmt; + } + else { + //--------------------------------------------- + // search transformation in list + //--------------------------------------------- + + int idx = 0; + iMidiInputTransformation i; + for (i = mtlist.begin(); i != mtlist.end(); ++i, ++idx) { + if (*i == modules[k].transform) { + presetList->setCurrentItem(idx); + break; + } + } + if (i == mtlist.end()) + printf("change to unknown transformation!\n"); + } + } + +//--------------------------------------------------------- +// presetChanged +//--------------------------------------------------------- + +void MidiInputTransformDialog::presetChanged(Q3ListBoxItem* item) + { + cindex = presetList->index(item); + + //--------------------------------------------------- + // search transformation in list and set + // cmt + //--------------------------------------------------- + + iMidiInputTransformation i; + for (i = mtlist.begin(); i != mtlist.end(); ++i) { + if (item->text() == (*i)->name) { + printf("found %s\n", (*i)->name.latin1()); + cmt = *i; + if (cmodul != -1) { + modules[cmodul].transform = *i; + } + break; + } + } + if (i == mtlist.end()) { + printf("MidiInputTransformDialog::presetChanged: not found\n"); + return; + } + nameEntry->setText(cmt->name); + commentEntry->setText(cmt->comment); + + selEventOp->setCurrentItem(cmt->selEventOp); + selEventOpSel(cmt->selEventOp); + + for (unsigned i = 0; i < sizeof(selTypeTable)/sizeof(*selTypeTable); ++i) { + if (selTypeTable[i] == cmt->selType) { + selType->setCurrentItem(i); + break; + } + } + + selVal1Op->setCurrentItem(cmt->selVal1); + selVal1OpSel(cmt->selVal1); + + selVal2Op->setCurrentItem(cmt->selVal2); + selVal2OpSel(cmt->selVal2); + + selPortOp->setCurrentItem(cmt->selPort); + selPortOpSel(cmt->selPort); + + selChannelOp->setCurrentItem(cmt->selChannel); + selChannelOpSel(cmt->selChannel); + + { + unsigned i; + for (i = 0; i < sizeof(oplist)/sizeof(*oplist); ++i) { + if (oplist[i].id == cmt->funcOp) { + funcOp->setCurrentItem(i); + break; + } + } + if (i == sizeof(oplist)/sizeof(*oplist)) + printf("internal error: bad OpCode\n"); + funcOpSel(i); + } + + for (unsigned i = 0; i < sizeof(procTypeTable)/sizeof(*procTypeTable); ++i) { + if (procTypeTable[i] == cmt->eventType) { + procType->setCurrentItem(i); + break; + } + } + + procEventOp->setCurrentItem(cmt->procEvent); + procEventOpSel(cmt->procEvent); + + procVal1Op->setCurrentItem(cmt->procVal1); + procVal1OpSel(cmt->procVal1); + + for (unsigned i = 0; i < sizeof(procVal2Map)/sizeof(*procVal2Map); ++i) { + if (procVal2Map[i] == cmt->procVal2) { + procVal2Op->setCurrentItem(i); + break; + } + } + + selVal1a->setValue(cmt->selVal1a); + selVal1b->setValue(cmt->selVal1b); + selVal1aChanged(cmt->selVal1a); + selVal1bChanged(cmt->selVal1b); + + selVal2a->setValue(cmt->selVal2a); + selVal2b->setValue(cmt->selVal2b); + + selPortVala->setValue(cmt->selPorta); + selPortValb->setValue(cmt->selPortb); + + selChannelVala->setValue(cmt->selChannela); + selChannelValb->setValue(cmt->selChannelb); + + procVal1a->setValue(cmt->procVal1a); + procVal1b->setValue(cmt->procVal1b); + + procVal2a->setValue(cmt->procVal2a); + procVal2b->setValue(cmt->procVal2b); + + procPortVala->setValue(cmt->procPorta); + procPortValb->setValue(cmt->procPortb); + + procChannelVala->setValue(cmt->procChannela); + procChannelValb->setValue(cmt->procChannelb); + + procPortOp->setCurrentItem(cmt->procPort); + procPortOpSel(cmt->procPort); + + procChannelOp->setCurrentItem(cmt->procChannel); + procChannelOpSel(cmt->procChannel); + + } + diff --git a/muse2/muse/mplugins/midiitransform.h b/muse2/muse/mplugins/midiitransform.h new file mode 100644 index 00000000..860797c5 --- /dev/null +++ b/muse2/muse/mplugins/midiitransform.h @@ -0,0 +1,101 @@ +//========================================================= +// MusE +// Linux Music Editor +// $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) +//========================================================= + +#ifndef __MIDIITRANSFORM_H__ +#define __MIDIITRANSFORM_H__ + +#include "itransformbase.h" +//Added by qt3to4: +#include <QCloseEvent> + +class Q3ListBoxItem; +class MidiTransformation; +class MidiInputTransformation; +class MidiRecordEvent; +class MidiPart; +class Xml; + +#include "miditransform.h" + +enum InputTransformProcEventOp { KeepType, FixType }; +//--------------------------------------------------------- +// MidiInputTransform +//--------------------------------------------------------- + +class MidiInputTransformDialog : public MidiInputTransformDialogBase { + Q_OBJECT + MidiInputTransformation* cmt; + int cindex; // current index in preset list + int cmodul; // current index in modules list + + virtual void accept(); + virtual void reject(); + void setValOp(QWidget* a, QWidget* b, ValOp op); + virtual void closeEvent(QCloseEvent*); + + void updatePresetList(); + + signals: + void hideWindow(); + + private slots: + void presetNew(); + void presetDelete(); + + void changeModul(int k); + void selEventOpSel(int); + void selTypeSel(int); + void selVal1OpSel(int); + void selVal2OpSel(int); + void procEventOpSel(int); + void procEventTypeSel(int); + void procVal1OpSel(int); + void procVal2OpSel(int); + void funcOpSel(int); + void presetChanged(Q3ListBoxItem*); + void nameChanged(const QString&); + void commentChanged(); + void selVal1aChanged(int); + void selVal1bChanged(int); + void selVal2aChanged(int); + void selVal2bChanged(int); + void procVal1aChanged(int); + void procVal1bChanged(int); + void procVal2aChanged(int); + void procVal2bChanged(int); + void modul1enableChanged(bool); + void modul2enableChanged(bool); + void modul3enableChanged(bool); + void modul4enableChanged(bool); + + void selPortOpSel(int); + void selPortValaChanged(int); + void selPortValbChanged(int); + void selChannelOpSel(int); + void selChannelValaChanged(int); + void selChannelValbChanged(int); + void procPortOpSel(int); + void procPortValaChanged(int); + void procPortValbChanged(int); + void procChannelOpSel(int); + void procChannelValaChanged(int); + void procChannelValbChanged(int); + + public slots: + void songChanged(int); + + public: + MidiInputTransformDialog(QWidget* parent = 0, const char* name = 0, + bool modal = false, Qt::WFlags fl = 0); + }; + +extern void writeMidiInputTransforms(int level, Xml& xml); +extern void readMidiInputTransform(Xml&); +extern bool applyMidiInputTransformation(MidiRecordEvent& event); +extern void clearMidiInputTransforms(); +#endif diff --git a/muse2/muse/mplugins/mitplugin.cpp b/muse2/muse/mplugins/mitplugin.cpp new file mode 100644 index 00000000..d8066e2c --- /dev/null +++ b/muse2/muse/mplugins/mitplugin.cpp @@ -0,0 +1,145 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: mitplugin.cpp,v 1.1.1.1 2003/10/27 18:52:40 wschweer Exp $ +// +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +//========================================================= + +#include <q3popupmenu.h> + +#include "mitplugin.h" +#include "app.h" +#include "event.h" +#include "xml.h" + +#include "midiitransform.h" +#include "mittranspose.h" +#include "midifilterimpl.h" +#include "mrconfig.h" +#include "rhythm.h" + +MITPluginList mitPlugins; + +//--------------------------------------------------------- +// startMidiInputPlugin +//--------------------------------------------------------- + +void MusE::startMidiInputPlugin(int id) + { + bool flag = false; + QWidget* w = 0; + if (id == 0) { + if (!mitPluginTranspose) { + mitPluginTranspose = new MITPluginTranspose(); + mitPlugins.push_back(mitPluginTranspose); + connect(mitPluginTranspose, SIGNAL(hideWindow()), + SLOT(hideMitPluginTranspose())); + } + w = mitPluginTranspose; + } + else if (id == 1) { + if (!midiInputTransform) { + midiInputTransform = new MidiInputTransformDialog(); + connect(midiInputTransform, SIGNAL(hideWindow()), + SLOT(hideMidiInputTransform())); + } + w = midiInputTransform; + } + else if (id == 2) { + if (!midiFilterConfig) { + midiFilterConfig = new MidiFilterConfig(); + connect(midiFilterConfig, SIGNAL(hideWindow()), + SLOT(hideMidiFilterConfig())); + } + w = midiFilterConfig; + } + else if (id == 3) { + if (!midiRemoteConfig) { + midiRemoteConfig = new MRConfig(); + connect(midiRemoteConfig, SIGNAL(hideWindow()), + SLOT(hideMidiRemoteConfig())); + } + w = midiRemoteConfig; + } + else if (id == 4) { + if (!midiRhythmGenerator) { + midiRhythmGenerator = new RhythmGen(); + connect(midiRhythmGenerator, SIGNAL(hideWindow()), + SLOT(hideMidiRhythmGenerator())); + } + w = midiRhythmGenerator; + } + if (w) { + flag = !w->isVisible(); + if (flag) + w->show(); + else + w->hide(); + } + midiInputPlugins->setItemChecked(id, flag); + } + +void MusE::hideMitPluginTranspose() + { + midiInputPlugins->setItemChecked(0, false); + } +void MusE::hideMidiInputTransform() + { + midiInputPlugins->setItemChecked(1, false); + } +void MusE::hideMidiFilterConfig() + { + midiInputPlugins->setItemChecked(2, false); + } +void MusE::hideMidiRemoteConfig() + { + midiInputPlugins->setItemChecked(3, false); + } +void MusE::hideMidiRhythmGenerator() + { + midiInputPlugins->setItemChecked(4, false); + } + +//--------------------------------------------------------- +// processMidiInputTransformPlugins +//--------------------------------------------------------- + +void processMidiInputTransformPlugins(MEvent& event) + { + for (iMITPlugin i = mitPlugins.begin(); i != mitPlugins.end(); ++i) + (*i)->process(event); + } + +//--------------------------------------------------------- +// startMidiTransformer +//--------------------------------------------------------- + +void MusE::startMidiTransformer() + { + if (midiTransformerDialog == 0) + midiTransformerDialog = new MidiTransformerDialog(this); + midiTransformerDialog->show(); + } + +//--------------------------------------------------------- +// writeStatusMidiInputTransformPlugins +//--------------------------------------------------------- + +void writeStatusMidiInputTransformPlugins(int level, Xml& xml) + { + for (iMITPlugin i = mitPlugins.begin(); i != mitPlugins.end(); ++i) { + xml.tag(level++, "mplugin name=\"%d\""); + (*i)->writeStatus(level, xml); + xml.etag(level, "mplugin"); + } + } + +//--------------------------------------------------------- +// readStatusMidiInputTransformPlugin +//--------------------------------------------------------- + +void readStatusMidiInputTransformPlugin(Xml&) + { + } + diff --git a/muse2/muse/mplugins/mitplugin.h b/muse2/muse/mplugins/mitplugin.h new file mode 100644 index 00000000..a7ab3729 --- /dev/null +++ b/muse2/muse/mplugins/mitplugin.h @@ -0,0 +1,39 @@ +//========================================================= +// MusE +// Linux Music Editor +// $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) +//========================================================= + +#ifndef __MITPLUGIN_H__ +#define __MITPLUGIN_H__ + +#include <list> + +class MEvent; +class Xml; + +//--------------------------------------------------------- +// MITPlugin +// midi input transform plugin +//--------------------------------------------------------- + +class MITPlugin { + public: + virtual ~MITPlugin(){} + virtual void process(MEvent& event) = 0; + virtual void readStatus(Xml&) {} + virtual void writeStatus(int, Xml&) const {} + }; + +typedef std::list<MITPlugin*> MITPluginList; +typedef MITPluginList::iterator iMITPlugin; + +extern MITPluginList mitPlugins; +extern void processMidiInputTransformPlugins(MEvent&); +extern void writeStatusMidiInputTransformPlugins(int, Xml&); +extern void readStatusMidiInputTransformPlugin(Xml&); + +#endif + diff --git a/muse2/muse/mplugins/mittranspose.cpp b/muse2/muse/mplugins/mittranspose.cpp new file mode 100644 index 00000000..b9a260c9 --- /dev/null +++ b/muse2/muse/mplugins/mittranspose.cpp @@ -0,0 +1,181 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: mittranspose.cpp,v 1.2.2.1 2009/05/03 04:14:00 terminator356 Exp $ +// +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +//========================================================= + +#include <qcheckbox.h> +#include <qspinbox.h> +#include <qlabel.h> +#include <qtimer.h> +//Added by qt3to4: +#include <QCloseEvent> + +#include "mittranspose.h" +#include "song.h" +#include "mpevent.h" +#include "pitchedit.h" +#include "xml.h" +#include "globals.h" + +MITPluginTranspose* mitPluginTranspose; + +//--------------------------------------------------------- +// MITPluginTranspose +//--------------------------------------------------------- + +MITPluginTranspose::MITPluginTranspose(QWidget* parent, const char* name, Qt::WFlags fl) + : MITTransposeBase(parent, name, fl) + { + on = false; + transpose = 0; + trigger = 24; + transposeChangedFlag = false; + triggerKeySpinBox->setValue(trigger); + + onToggled(false); + connect(onCheckBox, SIGNAL(toggled(bool)), SLOT(onToggled(bool))); + connect(triggerKeySpinBox, SIGNAL(valueChanged(int)), + SLOT(triggerKeyChanged(int))); + connect(heartBeatTimer, SIGNAL(timeout()), SLOT(noteReceived())); + } + +//--------------------------------------------------------- +// closeEvent +//--------------------------------------------------------- + +void MITPluginTranspose::closeEvent(QCloseEvent* ev) + { + emit hideWindow(); + QWidget::closeEvent(ev); + } + +//--------------------------------------------------------- +// noteReceived +//--------------------------------------------------------- + +void MITPluginTranspose::noteReceived() + { + if (transposeChangedFlag) + { + // Added by Tim. p3.3.6 + //printf("MITPluginTranspose::noteReceived\n"); + + transposeChanged(); + } + } + +//--------------------------------------------------------- +// triggerKeyChanged +//--------------------------------------------------------- + +void MITPluginTranspose::triggerKeyChanged(int val) + { + trigger = val; + } + +//--------------------------------------------------------- +// transposeChanged +//--------------------------------------------------------- + +void MITPluginTranspose::transposeChanged() + { + QString s; + s.sprintf("%c%d", transpose >= 0 ? '-' : ' ', transpose); + transposeLabel->setText(s); + transposeChangedFlag = false; + } + +//--------------------------------------------------------- +// onToggled +//--------------------------------------------------------- + +void MITPluginTranspose::onToggled(bool f) + { + on = f; + if (!on) { + transpose = 0; + transposeChanged(); + keyOnList.clear(); + } + transposeLabel->setEnabled(on); + triggerKeySpinBox->setEnabled(on); + } + +//--------------------------------------------------------- +// process +//--------------------------------------------------------- + +void MITPluginTranspose::process(MEvent& ev) + { + if (!on || (ev.type() != 0x90)) + return; + int pitch = ev.dataA(); + if (pitch >= trigger && pitch < (trigger+12)) { + // process control keys + int diff = transpose - (pitch-trigger); + transpose -= diff; + transposeChangedFlag = true; + return; + } + if (ev.dataB() == 0) { + // Note Off + for (iKeyOn i = keyOnList.begin(); i != keyOnList.end(); ++i) { + if (i->pitch == pitch && i->channel == ev.channel() + && i->port == ev.port()) { + pitch += i->transpose; + keyOnList.erase(i); + break; + } + } + } + else { + // Note On + keyOnList.push_back(KeyOn(pitch, ev.channel(), ev.port(), transpose)); + pitch += transpose; + } + ev.setA(pitch); + } + +//--------------------------------------------------------- +// readStatus +//--------------------------------------------------------- + +void MITPluginTranspose::readStatus(Xml& xml) + { + for (;;) { + Xml::Token token = xml.parse(); + const QString& tag = xml.s1(); + switch (token) { + case Xml::Error: + case Xml::End: + return; + case Xml::Text: + if (tag == "on") + on = xml.parseInt(); + else if (tag == "trigger") + trigger = xml.parseInt(); + else + xml.unknown("TransposePlugin"); + break; + case Xml::TagEnd: + if (xml.s1() == "mplugin") + return; + default: + break; + } + } + } + +//--------------------------------------------------------- +// writeStatus +//--------------------------------------------------------- + +void MITPluginTranspose::writeStatus(int level, Xml& xml) const + { + xml.intTag(level, "on", on); + xml.intTag(level, "trigger", trigger); + } + diff --git a/muse2/muse/mplugins/mittranspose.h b/muse2/muse/mplugins/mittranspose.h new file mode 100644 index 00000000..b942eddf --- /dev/null +++ b/muse2/muse/mplugins/mittranspose.h @@ -0,0 +1,70 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: mittranspose.h,v 1.1.1.1 2003/10/27 18:52:40 wschweer Exp $ +// +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +//========================================================= + +#ifndef __MITTRANSPOSE_H__ +#define __MITTRANSPOSE_H__ + +#include "mitplugin.h" +#include "mittransposebase.h" +#include <list> +//Added by qt3to4: +#include <QCloseEvent> + +struct KeyOn { + unsigned char pitch; + unsigned char channel; + unsigned char port; + char transpose; + KeyOn(int a, int b, int c, int d) { + pitch = a; + transpose = d; + channel = b; + port = c; + } + }; + +typedef std::list<KeyOn > KeyOnList; +typedef KeyOnList::iterator iKeyOn; + +class Xml; + +//--------------------------------------------------------- +// MITPluginTranspose +//--------------------------------------------------------- + +class MITPluginTranspose : public MITTransposeBase, public MITPlugin { + Q_OBJECT + + KeyOnList keyOnList; + int transpose; // current pitch offset + int trigger; + bool on; + bool transposeChangedFlag; + + void transposeChanged(); + virtual void closeEvent(QCloseEvent*); + + signals: + void hideWindow(); + + private slots: + void onToggled(bool); + void triggerKeyChanged(int); + void noteReceived(); + + public: + MITPluginTranspose(QWidget* parent = 0, const char* name = 0, Qt::WFlags fl = 0); + virtual void process(MEvent&); + virtual void readStatus(Xml&); + virtual void writeStatus(int, Xml&) const; + }; + +extern MITPluginTranspose* mitPluginTranspose; + +#endif + diff --git a/muse2/muse/mplugins/mrconfig.cpp b/muse2/muse/mplugins/mrconfig.cpp new file mode 100644 index 00000000..38b67de3 --- /dev/null +++ b/muse2/muse/mplugins/mrconfig.cpp @@ -0,0 +1,71 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: mrconfig.cpp,v 1.1.1.1 2003/10/27 18:52:43 wschweer Exp $ +// +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +//========================================================= + +#include "pitchedit.h" +#include "mrconfig.h" +#include "globals.h" +#include <qcheckbox.h> +//Added by qt3to4: +#include <QCloseEvent> + +//--------------------------------------------------------- +// MRConfig +// Midi Remote Control Config +//--------------------------------------------------------- + +MRConfig::MRConfig(QWidget* parent, const char* name, Qt::WFlags fl) + : MRConfigBase(parent, name, fl) + { + b1->setChecked(rcEnable); + sb1->setValue(rcStopNote); + sb2->setValue(rcRecordNote); + sb3->setValue(rcGotoLeftMarkNote); + sb4->setValue(rcPlayNote); + + connect(b1, SIGNAL(toggled(bool)), SLOT(setRcEnable(bool))); + connect(sb1, SIGNAL(valueChanged(int)), SLOT(setRcStopNote(int))); + connect(sb2, SIGNAL(valueChanged(int)), SLOT(setRcRecordNote(int))); + connect(sb3, SIGNAL(valueChanged(int)), SLOT(setRcGotoLeftMarkNote(int))); + connect(sb4, SIGNAL(valueChanged(int)), SLOT(setRcPlayNote(int))); + } + +//--------------------------------------------------------- +// closeEvent +//--------------------------------------------------------- + +void MRConfig::closeEvent(QCloseEvent* ev) + { + emit hideWindow(); + QWidget::closeEvent(ev); + } + +void MRConfig::setRcEnable(bool f) + { + rcEnable = f; + } + +void MRConfig::setRcStopNote(int val) + { + rcStopNote = val; + } + +void MRConfig::setRcRecordNote(int val) + { + rcRecordNote = val; + } + +void MRConfig::setRcGotoLeftMarkNote(int val) + { + rcGotoLeftMarkNote = val; + } + +void MRConfig::setRcPlayNote(int val) + { + rcPlayNote = val; + } + diff --git a/muse2/muse/mplugins/mrconfig.h b/muse2/muse/mplugins/mrconfig.h new file mode 100644 index 00000000..67b1976c --- /dev/null +++ b/muse2/muse/mplugins/mrconfig.h @@ -0,0 +1,40 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: mrconfig.h,v 1.1.1.1 2003/10/27 18:52:43 wschweer Exp $ +// +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +//========================================================= + +#ifndef __MRCONFIG_H__ +#define __MRCONFIG_H__ + +#include "mrconfigbase.h" +//Added by qt3to4: +#include <QCloseEvent> + +//--------------------------------------------------------- +// MRConfig +//--------------------------------------------------------- + +class MRConfig : public MRConfigBase { + Q_OBJECT + + virtual void closeEvent(QCloseEvent*); + + signals: + void hideWindow(); + + private slots: + void setRcEnable(bool); + void setRcStopNote(int); + void setRcRecordNote(int); + void setRcGotoLeftMarkNote(int); + void setRcPlayNote(int); + + public: + MRConfig(QWidget* parent=0, const char* name=0, Qt::WFlags fl = 0); + }; + +#endif + diff --git a/muse2/muse/mplugins/mrconfigbase.ui b/muse2/muse/mplugins/mrconfigbase.ui new file mode 100644 index 00000000..299f9183 --- /dev/null +++ b/muse2/muse/mplugins/mrconfigbase.ui @@ -0,0 +1,200 @@ +<!DOCTYPE UI><UI version="3.0" stdsetdef="1"> +<class>MRConfigBase</class> +<widget class="QWidget"> + <property name="name"> + <cstring>MRConfigBase</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>298</width> + <height>203</height> + </rect> + </property> + <property name="caption"> + <string>MusE: Midi Input Plugin: Remote Control</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QGroupBox"> + <property name="name"> + <cstring>GroupBox2</cstring> + </property> + <property name="title"> + <string>Activate</string> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QCheckBox"> + <property name="name"> + <cstring>b1</cstring> + </property> + <property name="text"> + <string>On</string> + </property> + </widget> + </hbox> + </widget> + <widget class="QGroupBox"> + <property name="name"> + <cstring>GroupBox1</cstring> + </property> + <property name="title"> + <string>Actions</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>TextLabel1</cstring> + </property> + <property name="text"> + <string>Stop</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>TextLabel2</cstring> + </property> + <property name="text"> + <string>Record</string> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>TextLabel3</cstring> + </property> + <property name="text"> + <string>Goto Left Mark</string> + </property> + </widget> + <widget class="QLabel" row="3" column="0"> + <property name="name"> + <cstring>TextLabel4</cstring> + </property> + <property name="text"> + <string>Play</string> + </property> + </widget> + <widget class="PitchEdit" row="0" column="1"> + <property name="name"> + <cstring>sb1</cstring> + </property> + </widget> + <widget class="PitchEdit" row="1" column="1"> + <property name="name"> + <cstring>sb2</cstring> + </property> + </widget> + <widget class="PitchEdit" row="2" column="1"> + <property name="name"> + <cstring>sb3</cstring> + </property> + </widget> + <widget class="PitchEdit" row="3" column="1"> + <property name="name"> + <cstring>sb4</cstring> + </property> + </widget> + <spacer row="0" column="2"> + <property name="name" stdset="0"> + <cstring>Spacer1</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="1" column="2"> + <property name="name" stdset="0"> + <cstring>Spacer2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="2" column="2"> + <property name="name" stdset="0"> + <cstring>Spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <spacer row="3" column="2"> + <property name="name" stdset="0"> + <cstring>Spacer4</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + </grid> + </widget> + </vbox> +</widget> +<layoutdefaults spacing="6" margin="11"/> +<includes> + <include location="local" impldecl="in declaration">pitchedit.h</include> +</includes> +</UI> diff --git a/muse2/muse/mplugins/random.cpp b/muse2/muse/mplugins/random.cpp new file mode 100644 index 00000000..5360d6b8 --- /dev/null +++ b/muse2/muse/mplugins/random.cpp @@ -0,0 +1,758 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: random.cpp,v 1.1.1.1 2003/10/27 18:52:39 wschweer Exp $ +// +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +// +// 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 +// rights reserved. +// Distributed under the GNU General Public License +//========================================================= + +#if 0 +#include "random.h" +#include "util.h" +#include <assert.h> + + +#if USE_ACG +ACG rnd(0, 55); +#else +#include <stdlib.h> +double tRandomGenerator::asDouble() +{ + return double(rand()) / double(RAND_MAX); +} +tRandomGenerator rnd; +#endif + + +// Array of probabilities + +tRndArray::tRndArray(int nn, int mmin, int mmax) +{ + int i; + n = nn; + for (i = 0; i < n; i++) + array[i] = mmin; + min = mmin; + max = mmax; + nul = min > 0 ? min : 0; +} + + +void tRndArray::SetMinMax(int mi, int ma) +{ + min = mi; + max = ma; + nul = min > 0 ? min : 0; + for (int i = 0; i < array.GetSize(); i++) + { + if (array[i] < min) + array[i] = min; + else if (array[i] > max) + array[i] = max; + } +} + +tRndArray::~tRndArray() +{ +} + +#ifdef FOR_MSW +double tRndArray::operator[](double f) +#else +double tRndArray::operator[](double f) const +#endif +{ + int i = (int)f; + if (i < 0) + i = 0; + else if (i >= n - 2) + i = n - 2; + tMapper map(i, i+1, array[i], array[i+1]); + return map(f); +} + + +tRndArray & tRndArray::operator = (const tRndArray &o) +{ + if (this == &o) + return *this; + + array = o.array; + n = o.n; + min = o.min; + max = o.max; + nul = o.nul; + return *this; +} + + +tRndArray::tRndArray(const tRndArray &o) + : array(o.array) +{ + n = o.n; + min = o.min; + max = o.max; + nul = o.nul; +} + + +int tRndArray::Random() +{ + return Random(rnd.asDouble()); +} + +int tRndArray::Random(double rndval) +{ + double sum, dec; + int i; + + assert(n > 0); + + sum = 0.0; + for (i = 0; i < n; i++) + { + assert(array[i] >= 0); + sum += array[i]; + } + if (sum <= 0) + return 0; + + dec = sum * rndval * 0.99999; + assert(dec < sum); + + i = 0; + while (dec >= 0.0) + { + dec -= array[i]; + i++; + } + i--; + + assert(i >= 0 && i < n); + return i; +} + + +int tRndArray::Interval(int seed) +{ + if (seed < 0) // initial ? + seed = int(rnd.asDouble() * n); + int delta = Random(); + if (rnd.asDouble() < 0.5) + delta = -delta; + seed = (seed + n + delta) % n; + return seed; +} + +int tRndArray::Random(int i) +{ + return rnd.asDouble() * (max - min) < array[i]; +} + + +void tRndArray::SetUnion(tRndArray &o, int fuzz) +{ + for (int i = 0; i < n; i++) + { + int val = array[i]; + if (o.array[i] > val) + val = o.array[i]; + array[i] = Fuzz(fuzz, array[i], val); + } +} + + +void tRndArray::SetIntersection(tRndArray &o, int fuzz) +{ + for (int i = 0; i < n; i++) + { + int val = array[i]; + if (o.array[i] < val) + val = o.array[i]; + array[i] = Fuzz(fuzz, array[i], val); + } +} + + +void tRndArray::SetDifference(tRndArray &o, int fuzz) +{ + tRndArray tmp(o); + tmp.SetInverse(tmp.Max()); + SetIntersection(tmp, fuzz); +} + + +void tRndArray::SetInverse(int fuzz) +{ + for (int i = 0; i < n; i++) + array[i] = Fuzz(fuzz, array[i], min + max - array[i]); +} + + +int tRndArray::Fuzz(int fuz, int v1, int v2) const +{ + // interpolate between v1 and v2 + return (fuz - min) * v2 / (max - min) + (max - fuz) * v1 / (max - min); +} + + +void tRndArray::Clear() +{ + for (int i = 0; i < n; i++) + array[i] = min; +} + + +ostream & operator << (ostream &os, tRndArray const &a) +{ + int i; + + os << a.n << " " << a.min << " " << a.max << endl; + for (i = 0; i < a.n; i++) + os << a.array[i] << " "; + os << endl; + return os; +} + + +istream & operator >> (istream &is, tRndArray &a) +{ + int i; + is >> a.n >> a.min >> a.max; + for (i = 0; i < a.n; i++) + is >> a.array[i]; + return is; +} + + +// --------------------------------- tArrayEdit ------------------------------------- + +// length of tickmark line +#define TICK_LINE 0 + +tArrayEdit::tArrayEdit(wxFrame *frame, tRndArray &ar, long xx, long yy, long ww, long hh, int sty) + : wxCanvas(frame, xx, yy, ww, hh), + array(ar), + n(ar.n), + min(ar.min), + max(ar.max), + nul(ar.nul) +{ + draw_bars = 0; + enabled = 1; + dragging = 0; + index = -1; + label = 0; + style_bits = sty; + + xmin = 0; + xmax = n; + + x = 0; // draw to topleft corner of canvas + y = 0; + w = ww; + h = hh; + + float tw, th; + wxDC *dc = GetDC(); + dc->SetFont(wxSMALL_FONT); + dc->GetTextExtent("123", &tw, &th); + if (style_bits & ARED_XTICKS) + { + // leave space for bottomline + h -= (int)th; + } + + if (style_bits & (ARED_MINMAX | ARED_YTICKS)) + { + // leave space to display min / max + x = (int)(tw + TICK_LINE); + w -= (int)(tw + TICK_LINE); + } + + ynul = y + h - h * (nul - min) / (max - min); +} + + +void tArrayEdit::OnSize(int ww, int hh) +{ + w = ww; + h = hh; + wxCanvas::OnSize(w, h); + float tw, th; + GetDC()->GetTextExtent("123", &tw, &th); + if (style_bits & ARED_XTICKS) + h -= (int)th; + if (style_bits & (ARED_MINMAX | ARED_YTICKS)) + { + x = (int)(tw + TICK_LINE); + w -= (int)(tw + TICK_LINE); + } + ynul = y + h - h * (nul - min) / (max - min); +} + +tArrayEdit::~tArrayEdit() +{ + delete [] label; +} + +void tArrayEdit::DrawBar(int i, int Qt::black) +{ + wxDC *dc = GetDC(); + + if (style_bits & ARED_LINES) + { + if (!Qt::black) + dc->SetPen(wxWHITE_PEN); + + tMapper xmap(0, n, 0, w); + tMapper ymap(min, max, h, 0); + + float x1 = (float)xmap(i + 0.5); + float y1 = (float)ymap(array[i]); + if (i > 0) + { + // draw line to prev position + float x0 = (float)xmap(i - 0.5); + float y0 = (float)ymap(array[i-1]); + dc->DrawLine(x0, y0, x1, y1); + } + if (i < n-1) + { + // draw line to next position + float x2 = (float)xmap(i + 1.5); + float y2 = (float)ymap(array[i+1]); + dc->DrawLine(x1, y1, x2, y2); + } + + if (!Qt::black) + dc->SetPen(wxBLACK_PEN); + return; + } + + int gap = 0; + if (style_bits & ARED_GAP) + { + gap = w / n / 6; + if (!gap && w / n > 3) + gap = 1; + } + long xbar, ybar, wbar, hbar; + + wbar = w / n - 2 * gap; + xbar = x + i * w / n + gap; + hbar = h * (array[i] - nul) / (max - min); + + if (style_bits & ARED_BLOCKS) + { + /* + ybar = ynul - hbar; + if (hbar < 0) + hbar = -hbar; + hbar = (hbar < 2) ? hbar : 2; + */ + int hblk = 12; + + ybar = ynul - hbar - hblk/2; + hbar = hblk; + if (ybar < y) { + int d = y - ybar; + ybar += d; + hbar -= d; + } + if (ybar + hbar > y + h) { + int d = (ybar + hbar) - (y + h); + hbar -= d; + } + if (hbar < 2) + hbar = 2; + } + else + + if (hbar < 0) + { + ybar = ynul; + hbar = -hbar; + } + else + ybar = ynul - hbar; + + if (ybar == y) + ++ybar, --hbar; + + if (!Qt::black) + { + dc->SetBrush(wxWHITE_BRUSH); + dc->SetPen(wxWHITE_PEN); + } + if (wbar && hbar) + dc->DrawRectangle(xbar, ybar, wbar, hbar); + if (!Qt::black) + { + dc->SetBrush(wxBLACK_BRUSH); + dc->SetPen(wxBLACK_PEN); + } +} + +const char *tArrayEdit::GetXText(int xval) +{ + static char buf[8]; + sprintf(buf, "%d", xval); + return buf; +} + +const char *tArrayEdit::GetYText(int yval) +{ + static char buf[8]; + sprintf(buf, "%d", yval); + return buf; +} + +void tArrayEdit::DrawXTicks() +{ + float tw, th; + + if (!(style_bits & ARED_XTICKS)) + return; + + wxDC *dc = GetDC(); + dc->SetFont(wxSMALL_FONT); + + // compute tickmark x-distance + dc->GetTextExtent("-123", &tw, &th); + int max_labels = (int)(w / (tw + tw/2)); + if (max_labels > 0) + { + int step = (xmax - xmin + 1) / max_labels; + if (step <= 0) + step = 1; + for (int val = xmin; val <= xmax; val += step) + { + const char *buf = GetXText(val); + //sprintf(buf, "%d", val); + dc->GetTextExtent((char *)buf, &tw, &th); + float yy = y + h; + float xx = x + w * (val - xmin) / (xmax - xmin + 1); + xx -= tw/2; // center text + xx += 0.5 * w / n; // middle of bar + dc->DrawText(buf, xx, yy); + //dc->DrawLine(x - TICK_LINE, yy, x, yy); + } + } + + dc->SetFont(wxNORMAL_FONT); +} + + +void tArrayEdit::DrawYTicks() +{ + wxDC *dc = GetDC(); + dc->SetFont(wxSMALL_FONT); + + if (style_bits & ARED_YTICKS) + { + // compute tickmark y-distance + float tw, th; + dc->GetTextExtent("-123", &tw, &th); + int max_labels = (int)(h / (th + th/2)); + if (max_labels > 0) + { + int step = (max - min) / max_labels; + if (step <= 0) + step = 1; + for (int val = min; val < max; val += step) + { + const char *buf = GetYText(val); + //sprintf(buf, "%d", val); + dc->GetTextExtent((char *)buf, &tw, &th); + float yy = y + h - h * (val - min) / (max - min) - th/2; + dc->DrawText(buf, x - tw - TICK_LINE, yy); + //dc->DrawLine(x - TICK_LINE, yy, x, yy); + } + } + } + + else if (style_bits & ARED_MINMAX) + { + // min/max + float tw, th; + char buf[20]; + sprintf(buf, "%d", max); + dc->GetTextExtent(buf, &tw, &th); + dc->DrawText(buf, x - tw, y); + sprintf(buf, "%d", min); + dc->GetTextExtent(buf, &tw, &th); + dc->DrawText(buf, x - tw, y + h - th); + + } + + dc->SetFont(wxNORMAL_FONT); + +} + +void tArrayEdit::DrawLabel() +{ + wxDC *dc = GetDC(); + dc->SetFont(wxSMALL_FONT); + if (label) + dc->DrawText(label, x + 5, y + 2); + dc->SetFont(wxNORMAL_FONT); +} + + + +void tArrayEdit::OnPaint() +{ + int i; + wxDC *dc = GetDC(); + + // surrounding rectangle + dc->Clear(); + if (enabled) + dc->SetBrush(wxWHITE_BRUSH); + else + dc->SetBrush(wxGREY_BRUSH); + dc->SetPen(wxBLACK_PEN); + if (w && h) + dc->DrawRectangle(x, y, w, h); + + // sliders + dc->SetBrush(wxBLACK_BRUSH); + for (i = 0; i < n; i++) + DrawBar(i, 1); + + DrawXTicks(); + DrawLabel(); + DrawYTicks(); + DrawNull(); + if (draw_bars) + draw_bars->DrawBars(); +} + + + +void tArrayEdit::DrawNull() +{ + wxDC *dc = GetDC(); + dc->SetPen(wxCYAN_PEN); + // draw y-null line + if (min < nul && nul < max) + dc->DrawLine(x, ynul, x+w, ynul); + // draw x-null line + if (xmin < 0 && 0 < xmax) + { + float x0 = w * (0 - xmin) / (xmax - xmin); + dc->DrawLine(x0, y, x0, y + h); + } + dc->SetPen(wxBLACK_PEN); +} + + + +void tArrayEdit::SetXMinMax(int xmi, int xma) +{ + xmin = xmi; + xmax = xma; +} + +int tArrayEdit::Index(wxMouseEvent &e) +{ + float ex, ey; + e.Position(&ex, &ey); + int i = (int)( ((short)ex - x) * n / w); + i = i < 0 ? 0 : i; + i = i >= n ? n-1 : i; + return i; +} + +int tArrayEdit::Dragging(wxMouseEvent &e) +{ + if (!dragging) + return 0; + + if (index < 0) + index = Index(e); + + int val = nul; + if (e.LeftIsDown()) + { + float ex, ey; + e.Position(&ex, &ey); + // $blk$ val = (int)( (y + h - (short)ey) * (max - min) / h + min); + val = (int)( (double)(y + h - ey) * (max - min) / h + min + 0.5); + val = val > max ? max : val; + val = val < min ? min : val; + } + +#if 0 + { + // in msw ex,ey are 65536 for negative values! + wxDC *dc = GetDC(); + char buf[500]; + sprintf(buf, "x %4.0f, y %4.0f, sh %d", ex, ey, e.ShiftDown()); + dc->DrawText(buf, 50, 50); + } +#endif + + if (e.ShiftDown()) + { + int k; + for (k = 0; k < n; k++) + { + DrawBar(k, 0); + array[k] = val; + DrawBar(k, 1); + } + } + else if (e.ControlDown()) + { + DrawBar(index, 0); + array[index] = val; + DrawBar(index, 1); + } + else + { + int i = Index(e); + int k = i; + if (i < index) + for (; i <= index; i++) + { + DrawBar(i, 0); + array[i] = val; + DrawBar(i, 1); + } + else + for (; i >= index; i--) + { + DrawBar(i, 0); + array[i] = val; + DrawBar(i, 1); + } + index = k; + } + + return 0; +} + +int tArrayEdit::ButtonDown(wxMouseEvent &e) +{ +#ifdef wx_msw + CaptureMouse(); +#endif + dragging = 1; + index = Index(e); + Dragging(e); + return 0; +} + +int tArrayEdit::ButtonUp(wxMouseEvent &e) +{ +#ifdef wx_msw + ReleaseMouse(); +#endif + dragging = 0; + index = -1; + DrawLabel(); + DrawNull(); + return 0; +} + + +void tArrayEdit::OnEvent(wxMouseEvent &e) +{ + if (!enabled) + return; + if (e.ButtonDown()) + ButtonDown(e); + else if (e.Dragging()) + Dragging(e); + else if (e.ButtonUp()) + ButtonUp(e); +} + +void tArrayEdit::Enable(int e) +{ + enabled = e; +} + +void tArrayEdit::SetLabel(char const *llabel) +{ + delete label; + label = copystring(llabel); +} + +void tArrayEdit::SetYMinMax(int mi, int ma) +{ + array.SetMinMax(mi, ma); + ynul = y + h - h * (nul - min) / (max - min); +} + +void tArrayEdit::DrawBarLine (long xx) +{ + wxDC *dc = GetDC (); + // fprintf(stderr,"x: %ld, xx: %ld\n",x,xx); + if (xx > x && xx + 1 < x + w) + { + dc->SetPen (wxLIGHT_GREY_PEN); + dc->DrawLine (xx, y + 1, xx, y + h - 2); + dc->SetPen (wxBLACK_PEN); + } +} + + + +tRhyArrayEdit::tRhyArrayEdit(wxFrame *parent, tRndArray &array, long xx, long yy, long ww, long hh, int sty) + : tArrayEdit(parent, array, xx, yy, ww, hh, sty) +{ + steps_per_count = 4; + count_per_bar = 4; + n_bars = 4; +} + +void tRhyArrayEdit::SetMeter(int s, int c, int b) +{ + steps_per_count = s; + count_per_bar = c; + n_bars = b; + array.Resize(s * c * b); + SetXMinMax(1, s * c * b); +} + + +void tRhyArrayEdit::DrawXTicks() +{ + if (!(style_bits & ARED_RHYTHM)) + { + tArrayEdit::DrawXTicks(); + return; + } + + char buf[20]; + float tw, th; + + wxDC *dc = GetDC(); + dc->SetFont(wxSMALL_FONT); + + // tick marks + assert(steps_per_count && count_per_bar && n_bars); + int i; + for (i = 0; i < n; i += steps_per_count) + { + int mark = (i / steps_per_count) % count_per_bar + 1; + sprintf(buf, "%d", mark); + float yy = y + h; + float xx = x + (i + 0.5) * w / n; + dc->GetTextExtent(buf, &tw, &th); + xx -= tw/2.0; + dc->DrawText(buf, xx, yy); + } + dc->SetFont(wxNORMAL_FONT); +} +#endif + diff --git a/muse2/muse/mplugins/random.h b/muse2/muse/mplugins/random.h new file mode 100644 index 00000000..2c9dfe5b --- /dev/null +++ b/muse2/muse/mplugins/random.h @@ -0,0 +1,192 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: random.h,v 1.1.1.1 2003/10/27 18:52:43 wschweer Exp $ +// +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +// +// 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 +// rights reserved. +// Distributed under the GNU General Public License +//========================================================= + +#if 0 +#ifndef random_h +#define random_h + +#ifndef wx_wxh +#include "wx.h" +#endif + +#ifndef _FSTREAM_H +#include <fstream.h> +#endif + +#ifndef dynarray_h +#include "dynarray.h" +#endif + +// gcc > 2.7.2 does not have ACG anymore? +#define USE_ACG 0 + +#if USE_ACG +#include <ACG.h> // random generator from libg++ +extern ACG rnd; + +#else + +class tRandomGenerator +{ + public: + double asDouble(); +}; +extern tRandomGenerator rnd; + +#endif + + +#undef min +#undef max + + +// array of probabilities + +class tRndArray +{ + friend class tArrayEdit; + protected: + tIntArray array; + int n; // number of elements in array + int nul, min, max; + + public: + int Null() { return nul; } + void SetNull(int n) { nul = n; } + tRndArray(int n, int min, int max); + tRndArray & operator = (const tRndArray &); + tRndArray(tRndArray const &); + + virtual ~tRndArray(); + int &operator[] (int i) { return array[i]; } + int operator[] (int i) const { return array[i]; } +#ifdef FOR_MSW + double operator[](double f); + float operator[](float f) { +#else + double operator[](double f) const; + float operator[](float f) const { +#endif + return (float)operator[]((double)f); + } + int Size() const { return n; } + int Min() const { return min; } + int Max() const { return max; } + void SetMinMax(int min, int max); + void Resize(int nn) { n = nn; } + + friend ostream & operator << (ostream &, tRndArray const &); + friend istream & operator >> (istream &, tRndArray &); + + int Random(); // returns index 0..n-1 (arrayvalues -> empiric distribution) + int Random(double rndval); // returns index 0..n-1 (arrayvalues -> empiric distribution) + int Random(int i); // return 0/1 + int Interval(int seed); + + void SetUnion(tRndArray &o, int fuzz); + void SetDifference(tRndArray &o, int fuzz); + void SetIntersection(tRndArray &o, int fuzz); + void SetInverse(int fuzz); + int Fuzz(int fuzz, int v1, int v2) const; + void Clear(); +}; + + +#define ARED_GAP 1 +#define ARED_XTICKS 2 +#define ARED_YTICKS 4 +#define ARED_MINMAX 8 +#define ARED_RHYTHM 16 +#define ARED_BLOCKS 32 +#define ARED_LINES 64 + + +class tArrayEditDrawBars { + public: + virtual void DrawBars() = 0; +}; + + +class tArrayEdit : public wxCanvas +{ +protected: + // paint position + long x, y, w, h, ynul; + void DrawBar(int i, int Qt::black); + + int dragging; // Dragging-Event valid + int index; // ctrl down: drag this one + + tRndArray &array; + int &n, &min, &max, &nul; // shorthand for array.n, array.min, ... + char *label; + tArrayEditDrawBars *draw_bars; + + // array size is mapped to this range for x-tick marks + int xmin, xmax; + + virtual void DrawXTicks(); + virtual void DrawYTicks(); + virtual void DrawLabel(); + virtual void DrawNull(); + int Index(wxMouseEvent &e); + + int enabled; + int style_bits; + + virtual const char *GetXText(int xval); // Text for x-tickmarks + virtual const char *GetYText(int yval); // Text for y-tickmarks + + +public: + tArrayEdit(wxFrame *parent, tRndArray &array, long xx, long yy, long ww, long hh, int style_bits = (ARED_GAP | ARED_XTICKS)); + virtual ~tArrayEdit(); + + virtual void OnPaint(); + virtual void OnSize(int ww, int hh); + virtual void OnEvent(wxMouseEvent &e); + virtual int Dragging(wxMouseEvent &); + virtual int ButtonDown(wxMouseEvent &); + virtual int ButtonUp(wxMouseEvent &); + + virtual void SetLabel(char const *llabel); + void Enable(int enable = 1); + void SetStyle(int style) { style_bits = style; } + // min and max value in array (both values inclusive) + void SetYMinMax(int min, int max); + // for display x-axis only, does not resize the array (both values inclusive) + void SetXMinMax(int xmin, int xmax); + void DrawBarLine (long xx); + void SetDrawBars(tArrayEditDrawBars *x) { draw_bars = x; } + void Init() {} +}; + + + +class tRhyArrayEdit : public tArrayEdit +{ + int steps_per_count; + int count_per_bar; + int n_bars; + protected: + virtual void DrawXTicks(); + public: + tRhyArrayEdit(wxFrame *parent, tRndArray &array, long xx, long yy, long ww, long hh, int style_bits = (ARED_GAP | ARED_XTICKS | ARED_RHYTHM)); + void SetMeter(int steps_per_count, int count_per_bar, int n_bars); +}; + + +#endif +#endif + diff --git a/muse2/muse/mplugins/rhythm.cpp b/muse2/muse/mplugins/rhythm.cpp new file mode 100644 index 00000000..5281fb56 --- /dev/null +++ b/muse2/muse/mplugins/rhythm.cpp @@ -0,0 +1,516 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: rhythm.cpp,v 1.1.1.1 2003/10/27 18:52:49 wschweer Exp $ +// +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +// +// 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 +// rights reserved. +// Distributed under the GNU General Public License +//========================================================= + +#include "rhythm.h" +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <QCloseEvent> +#include <Q3VBoxLayout> + +//--------------------------------------------------------- +// RhythmGen +//--------------------------------------------------------- + +RhythmGen::RhythmGen(QWidget* parent, const char* name, Qt::WFlags fo) + : RhythmBase(parent, name, fo) + { + } +RhythmGen::~RhythmGen() + { + } + +//--------------------------------------------------------- +// closeEvent +//--------------------------------------------------------- + +void RhythmGen::closeEvent(QCloseEvent* ev) + { + emit hideWindow(); + QWidget::closeEvent(ev); + } + + + +#if 0 +/**************************************************************************** +** Form implementation generated from reading ui file 'rhythm.ui' +** +** Created: Tue Feb 26 13:43:04 2002 +** by: The User Interface Compiler (uic) +** +** WARNING! All changes made in this file will be lost! +****************************************************************************/ +#include "rhythm.h" + +#include <qvariant.h> +#include <qcheckbox.h> +#include <q3frame.h> +#include <qlabel.h> +#include <qlcdnumber.h> +#include <q3listbox.h> +#include <qpushbutton.h> +#include <qslider.h> +#include <qtoolbutton.h> +#include <qlayout.h> +#include <qtooltip.h> +#include <q3whatsthis.h> +#include <qimage.h> +#include <qpixmap.h> + +static const char* const image0_data[] = { +"16 16 56 1", +". c None", +"F c #000000", +"L c #000101", +"E c #010304", +"C c #06101d", +"j c #071728", +"w c #07182a", +"1 c #071c2c", +"0 c #081c2d", +"e c #081e31", +"a c #0a121f", +"Z c #0a1929", +"Q c #0a263b", +"T c #0a273b", +"z c #0e97bf", +"s c #0ea0c5", +"K c #0f5d7e", +"B c #105375", +"G c #114760", +"N c #1197b9", +"x c #124c6d", +"# c #124d6f", +"u c #1290b5", +"v c #135476", +"h c #1390b4", +"Y c #14839f", +"b c #155474", +"i c #155678", +"o c #155a7a", +"J c #159abc", +"d c #17587a", +"V c #178eac", +"f c #194a6a", +"r c #19b3ce", +"k c #1b4b6a", +"p c #1b4f6f", +"A c #1ca2c3", +"D c #20374f", +"P c #2294b1", +"I c #22bad1", +"S c #2a98b3", +"U c #2cc7d5", +"n c #3cd7e1", +"O c #43d5de", +"t c #48dfe9", +"X c #58acc5", +"m c #59c3da", +"q c #71d1e0", +"W c #80c2db", +"c c #819eba", +"H c #9ddeee", +"M c #cdebf6", +"g c #ddeff8", +"y c #e2f0f9", +"R c #fdfafd", +"l c #fdfcfd", +"................", +"................", +".......#a.......", +"......bcde......", +".....fcghij.....", +"....kclmnhoj....", +"...pclqrstuvw...", +"..xcymrzzsnABC..", +".BDEFGHzIJKLFFF.", +".....BMNOPQ.....", +".....BRNOST.....", +".....BMNUVT.....", +".....BWXIYF.....", +".....BZ01FF.....", +"................", +"................"}; + +static const char* const image1_data[] = { +"16 16 50 1", +". c None", +"E c #010001", +"O c #03060c", +"U c #050b12", +"u c #05151e", +"S c #060f19", +"m c #06141d", +"q c #06141f", +"h c #071620", +"D c #0b293e", +"c c #0d324c", +"v c #0d3652", +"A c #0e5775", +"J c #0e8fb6", +"x c #0e94b9", +"r c #0e97bf", +"Q c #0e9ec3", +"n c #0eadcb", +"R c #0fa0c4", +"N c #106589", +"V c #10698f", +"B c #114560", +"# c #124d6f", +"z c #1299bb", +"C c #144059", +"T c #14a5c9", +"K c #15c1da", +"b c #18425f", +"y c #1bbad1", +"M c #1ca2c3", +"t c #1f95b2", +"a c #254a64", +"p c #2695b1", +"l c #2b91ae", +"F c #337f9e", +"o c #40d1db", +"s c #46dbe6", +"L c #48dfe9", +"I c #54bdd7", +"j c #5fc0d8", +"g c #64a3bd", +"k c #8fcce2", +"d c #a0cbdf", +"H c #a7dcec", +"w c #bfdfee", +"f c #d3e5f0", +"G c #dfeff8", +"i c #e0f1fb", +"e c #eff3fc", +"P c #ffffff", +"................", +"................", +".....###abc.....", +".....#defgh.....", +".....#ijklm.....", +".....#enopq.....", +".....airstu.....", +".v##aawxyzABCDE.", +"..vFGHIJrKLMNO..", +"...vFPQrRLMNS...", +"....vFPTLMNU....", +".....vFGMNU.....", +"......vVNS......", +".......vO.......", +"................", +"................"}; + + +/* + * Constructs a RhythmGenerator which is a child of 'parent', with the + * name 'name' and widget flags set to 'f'. + * + * The dialog will by default be modeless, unless you set 'modal' to + * TRUE to construct a modal dialog. + */ +RhythmGenerator::RhythmGenerator( QWidget* parent, const char* name, bool modal, Qt::WFlags fl ) + : QDialog( parent, name, modal, fl ) +{ + QPixmap image0( ( const char** ) image0_data ); + QPixmap image1( ( const char** ) image1_data ); + if ( !name ) + setName( "RhythmGenerator" ); + resize( 500, 777 ); + setCaption( trUtf8( "Form3" ) ); + RhythmGeneratorLayout = new Q3VBoxLayout( this, 11, 6, "RhythmGeneratorLayout"); + + Frame6 = new Q3Frame( this, "Frame6" ); + Frame6->setFrameShape( Q3Frame::StyledPanel ); + Frame6->setFrameShadow( Q3Frame::Raised ); + Frame6Layout = new Q3VBoxLayout( Frame6, 11, 6, "Frame6Layout"); + + TextLabel1 = new QLabel( Frame6, "TextLabel1" ); + QFont TextLabel1_font( TextLabel1->font() ); + TextLabel1_font.setBold( TRUE ); + TextLabel1_font.setUnderline( TRUE ); + TextLabel1->setFont( TextLabel1_font ); + TextLabel1->setText( trUtf8( "Instrument Settings:" ) ); + Frame6Layout->addWidget( TextLabel1 ); + + Layout17 = new Q3HBoxLayout( 0, 0, 15, "Layout17"); + + Layout16 = new Q3VBoxLayout( 0, 0, 6, "Layout16"); + + InstrumentListLabel = new QLabel( Frame6, "InstrumentListLabel" ); + InstrumentListLabel->setText( trUtf8( "Instrument" ) ); + Layout16->addWidget( InstrumentListLabel ); + + InstrumentList = new Q3ListBox( Frame6, "InstrumentList" ); + InstrumentList->insertItem( trUtf8( "Hi-Hat" ) ); + InstrumentList->setMinimumSize( QSize( 150, 70 ) ); + Layout16->addWidget( InstrumentList ); + + Layout11 = new Q3HBoxLayout( 0, 0, 2, "Layout11"); + + InstrumentUp = new QToolButton( Frame6, "InstrumentUp" ); + InstrumentUp->setMinimumSize( QSize( 40, 20 ) ); + InstrumentUp->setText( trUtf8( "" ) ); + InstrumentUp->setPixmap( image0 ); + Layout11->addWidget( InstrumentUp ); + + InstrumentDown = new QToolButton( Frame6, "InstrumentDown" ); + InstrumentDown->setMinimumSize( QSize( 40, 20 ) ); + InstrumentDown->setText( trUtf8( "" ) ); + InstrumentDown->setPixmap( image1 ); + Layout11->addWidget( InstrumentDown ); + + InstrumentAdd = new QToolButton( Frame6, "InstrumentAdd" ); + InstrumentAdd->setMinimumSize( QSize( 40, 20 ) ); + InstrumentAdd->setText( trUtf8( "add" ) ); + Layout11->addWidget( InstrumentAdd ); + + InstrumentDel = new QToolButton( Frame6, "InstrumentDel" ); + InstrumentDel->setMinimumSize( QSize( 40, 20 ) ); + InstrumentDel->setText( trUtf8( "delete" ) ); + Layout11->addWidget( InstrumentDel ); + Layout16->addLayout( Layout11 ); + Layout17->addLayout( Layout16 ); + + Layout20 = new Q3VBoxLayout( 0, 0, 6, "Layout20"); + + StepsLabel = new QLabel( Frame6, "StepsLabel" ); + StepsLabel->setText( trUtf8( "steps/count" ) ); + Layout20->addWidget( StepsLabel ); + + StepsLayout = new Q3HBoxLayout( 0, 0, 6, "StepsLayout"); + + StepsSlider = new QSlider( Frame6, "StepsSlider" ); + StepsSlider->setMaxValue( 16 ); + StepsSlider->setValue( 4 ); + StepsSlider->setOrientation( Qt::Horizontal ); + StepsLayout->addWidget( StepsSlider ); + + StepsNumber = new QLCDNumber( Frame6, "StepsNumber" ); + StepsNumber->setPaletteBackgroundColor( QColor( 212, 212, 192 ) ); + StepsNumber->setLineWidth( 1 ); + StepsNumber->setNumDigits( 2 ); + StepsNumber->setSegmentStyle( QLCDNumber::Flat ); + StepsNumber->setProperty( "value", 4 ); + StepsLayout->addWidget( StepsNumber ); + Layout20->addLayout( StepsLayout ); + + CountLabel = new QLabel( Frame6, "CountLabel" ); + CountLabel->setText( trUtf8( "count/bar" ) ); + Layout20->addWidget( CountLabel ); + + CountLayout = new Q3HBoxLayout( 0, 0, 6, "CountLayout"); + + CountSlider = new QSlider( Frame6, "CountSlider" ); + CountSlider->setMaxValue( 16 ); + CountSlider->setValue( 4 ); + CountSlider->setOrientation( Qt::Horizontal ); + CountLayout->addWidget( CountSlider ); + + CountNumber = new QLCDNumber( Frame6, "CountNumber" ); + CountNumber->setPaletteBackgroundColor( QColor( 212, 212, 192 ) ); + CountNumber->setNumDigits( 2 ); + CountNumber->setSegmentStyle( QLCDNumber::Flat ); + CountNumber->setProperty( "value", 4 ); + CountLayout->addWidget( CountNumber ); + Layout20->addLayout( CountLayout ); + + BarsLabel = new QLabel( Frame6, "BarsLabel" ); + BarsLabel->setText( trUtf8( "# bars" ) ); + Layout20->addWidget( BarsLabel ); + + BarsLayout = new Q3HBoxLayout( 0, 0, 6, "BarsLayout"); + + BarsSlider = new QSlider( Frame6, "BarsSlider" ); + BarsSlider->setMaxValue( 16 ); + BarsSlider->setValue( 1 ); + BarsSlider->setOrientation( Qt::Horizontal ); + BarsLayout->addWidget( BarsSlider ); + + BarsNumber = new QLCDNumber( Frame6, "BarsNumber" ); + BarsNumber->setPaletteBackgroundColor( QColor( 212, 212, 192 ) ); + BarsNumber->setNumDigits( 2 ); + BarsNumber->setSegmentStyle( QLCDNumber::Flat ); + BarsNumber->setProperty( "value", 1 ); + BarsLayout->addWidget( BarsNumber ); + Layout20->addLayout( BarsLayout ); + Layout17->addLayout( Layout20 ); + Frame6Layout->addLayout( Layout17 ); + RhythmGeneratorLayout->addWidget( Frame6 ); + + Layout27 = new Q3HBoxLayout( 0, 0, 15, "Layout27"); + + Frame5 = new Q3Frame( this, "Frame5" ); + Frame5->setFrameShape( Q3Frame::StyledPanel ); + Frame5->setFrameShadow( Q3Frame::Raised ); + Frame5Layout = new Q3VBoxLayout( Frame5, 11, 6, "Frame5Layout"); + + TextLabel2 = new QLabel( Frame5, "TextLabel2" ); + QFont TextLabel2_font( TextLabel2->font() ); + TextLabel2_font.setBold( TRUE ); + TextLabel2_font.setUnderline( TRUE ); + TextLabel2->setFont( TextLabel2_font ); + TextLabel2->setText( trUtf8( "Group Settings:" ) ); + Frame5Layout->addWidget( TextLabel2 ); + + Layout20_2 = new Q3HBoxLayout( 0, 0, 15, "Layout20_2"); + + GroupListLayout = new Q3VBoxLayout( 0, 0, 6, "GroupListLayout"); + + GroupListLabel = new QLabel( Frame5, "GroupListLabel" ); + GroupListLabel->setText( trUtf8( "Group" ) ); + GroupListLayout->addWidget( GroupListLabel ); + + GroupList = new Q3ListBox( Frame5, "GroupList" ); + GroupList->insertItem( trUtf8( "Group 1" ) ); + GroupList->insertItem( trUtf8( "Group 2" ) ); + GroupList->insertItem( trUtf8( "Group 3" ) ); + GroupList->insertItem( trUtf8( "Group 4" ) ); + GroupList->insertItem( trUtf8( "Group 5" ) ); + GroupList->setMinimumSize( QSize( 150, 90 ) ); + GroupListLayout->addWidget( GroupList ); + Layout20_2->addLayout( GroupListLayout ); + + Layout19 = new Q3VBoxLayout( 0, 0, 6, "Layout19"); + + ContribLabel = new QLabel( Frame5, "ContribLabel" ); + ContribLabel->setText( trUtf8( "contrib" ) ); + Layout19->addWidget( ContribLabel ); + + ContribLayout = new Q3HBoxLayout( 0, 0, 6, "ContribLayout"); + + ContribSlider = new QSlider( Frame5, "ContribSlider" ); + ContribSlider->setMinimumSize( QSize( 100, 0 ) ); + ContribSlider->setMaxValue( 100 ); + ContribSlider->setOrientation( Qt::Horizontal ); + ContribLayout->addWidget( ContribSlider ); + + ContribNumber = new QLCDNumber( Frame5, "ContribNumber" ); + ContribNumber->setPaletteBackgroundColor( QColor( 212, 212, 192 ) ); + ContribNumber->setNumDigits( 3 ); + ContribNumber->setSegmentStyle( QLCDNumber::Flat ); + ContribLayout->addWidget( ContribNumber ); + Layout19->addLayout( ContribLayout ); + + ListenLabel = new QLabel( Frame5, "ListenLabel" ); + ListenLabel->setText( trUtf8( "listen" ) ); + Layout19->addWidget( ListenLabel ); + + ListenLayout = new Q3HBoxLayout( 0, 0, 6, "ListenLayout"); + + ListenSlider = new QSlider( Frame5, "ListenSlider" ); + ListenSlider->setMinimumSize( QSize( 100, 0 ) ); + ListenSlider->setMinValue( -99 ); + ListenSlider->setMaxValue( 100 ); + ListenSlider->setOrientation( Qt::Horizontal ); + ListenLayout->addWidget( ListenSlider ); + + ListenNumber = new QLCDNumber( Frame5, "ListenNumber" ); + ListenNumber->setPaletteBackgroundColor( QColor( 212, 212, 192 ) ); + ListenNumber->setNumDigits( 3 ); + ListenNumber->setSegmentStyle( QLCDNumber::Flat ); + ListenLayout->addWidget( ListenNumber ); + Layout19->addLayout( ListenLayout ); + Layout20_2->addLayout( Layout19 ); + Frame5Layout->addLayout( Layout20_2 ); + + RandomizeCheck = new QCheckBox( Frame5, "RandomizeCheck" ); + RandomizeCheck->setText( trUtf8( "Randomize" ) ); + Frame5Layout->addWidget( RandomizeCheck ); + Layout27->addWidget( Frame5 ); + + Frame5_2 = new Q3Frame( this, "Frame5_2" ); + Frame5_2->setFrameShape( Q3Frame::StyledPanel ); + Frame5_2->setFrameShadow( Q3Frame::Raised ); + Frame5_2Layout = new Q3VBoxLayout( Frame5_2, 11, 6, "Frame5_2Layout"); + + TextLabel3 = new QLabel( Frame5_2, "TextLabel3" ); + QFont TextLabel3_font( TextLabel3->font() ); + TextLabel3_font.setBold( TRUE ); + TextLabel3_font.setUnderline( TRUE ); + TextLabel3->setFont( TextLabel3_font ); + TextLabel3->setText( trUtf8( "Rhythm Style:" ) ); + Frame5_2Layout->addWidget( TextLabel3 ); + + Layout21 = new Q3VBoxLayout( 0, 0, 2, "Layout21"); + + ToolButton7 = new QToolButton( Frame5_2, "ToolButton7" ); + ToolButton7->setText( trUtf8( "Clear" ) ); + Layout21->addWidget( ToolButton7 ); + + ToolButton8 = new QToolButton( Frame5_2, "ToolButton8" ); + ToolButton8->setText( trUtf8( "Open..." ) ); + Layout21->addWidget( ToolButton8 ); + + ToolButton9 = new QToolButton( Frame5_2, "ToolButton9" ); + ToolButton9->setText( trUtf8( "Save" ) ); + Layout21->addWidget( ToolButton9 ); + + ToolButton10 = new QToolButton( Frame5_2, "ToolButton10" ); + ToolButton10->setText( trUtf8( "Save as..." ) ); + Layout21->addWidget( ToolButton10 ); + Frame5_2Layout->addLayout( Layout21 ); + + Layout22 = new Q3VBoxLayout( 0, 0, 2, "Layout22"); + + ToolButton5 = new QToolButton( Frame5_2, "ToolButton5" ); + ToolButton5->setText( trUtf8( "Generate" ) ); + Layout22->addWidget( ToolButton5 ); + + ToolButton6 = new QToolButton( Frame5_2, "ToolButton6" ); + ToolButton6->setText( trUtf8( "Close" ) ); + Layout22->addWidget( ToolButton6 ); + Frame5_2Layout->addLayout( Layout22 ); + Layout27->addWidget( Frame5_2 ); + RhythmGeneratorLayout->addLayout( Layout27 ); + + Layout29 = new Q3HBoxLayout( 0, 0, 6, "Layout29"); + + Frame6_2 = new Q3Frame( this, "Frame6_2" ); + Frame6_2->setMinimumSize( QSize( 200, 150 ) ); + Frame6_2->setFrameShape( Q3Frame::StyledPanel ); + Frame6_2->setFrameShadow( Q3Frame::Raised ); + Layout29->addWidget( Frame6_2 ); + + Frame7 = new Q3Frame( this, "Frame7" ); + Frame7->setMinimumSize( QSize( 200, 150 ) ); + Frame7->setFrameShape( Q3Frame::StyledPanel ); + Frame7->setFrameShadow( Q3Frame::Raised ); + Layout29->addWidget( Frame7 ); + RhythmGeneratorLayout->addLayout( Layout29 ); + + Frame8 = new Q3Frame( this, "Frame8" ); + Frame8->setMinimumSize( QSize( 400, 150 ) ); + Frame8->setFrameShape( Q3Frame::StyledPanel ); + Frame8->setFrameShadow( Q3Frame::Raised ); + RhythmGeneratorLayout->addWidget( Frame8 ); + + // signals and slots connections + connect( StepsSlider, SIGNAL( valueChanged(int) ), StepsNumber, SLOT( display(int) ) ); + connect( CountSlider, SIGNAL( valueChanged(int) ), CountNumber, SLOT( display(int) ) ); + connect( BarsSlider, SIGNAL( valueChanged(int) ), BarsNumber, SLOT( display(int) ) ); + connect( ContribSlider, SIGNAL( valueChanged(int) ), ContribNumber, SLOT( display(int) ) ); + connect( ListenSlider, SIGNAL( valueChanged(int) ), ListenNumber, SLOT( display(int) ) ); + connect( InstrumentDel, SIGNAL( pressed() ), InstrumentList, SLOT( clearSelection() ) ); +} + +/* + * Destroys the object and frees any allocated resources + */ +RhythmGenerator::~RhythmGenerator() +{ + // no need to delete child widgets, Qt does it all for us +} +#endif + diff --git a/muse2/muse/mplugins/rhythm.h b/muse2/muse/mplugins/rhythm.h new file mode 100644 index 00000000..013fba08 --- /dev/null +++ b/muse2/muse/mplugins/rhythm.h @@ -0,0 +1,196 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: rhythm.h,v 1.1.1.1 2003/10/27 18:52:44 wschweer Exp $ +// +// (C) Copyright 2001 Werner Schweer (ws@seh.de) +// +// 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 +// rights reserved. +// Distributed under the GNU General Public License +//========================================================= + +#ifndef __RHYTHM_H__ +#define __RHYTHM_H__ + +#include "rhythmbase.h" +//Added by qt3to4: +#include <QCloseEvent> + +class tTrack; +class tEventWin; +class tSong; +class tBarInfo; + +#define MAX_GROUPS 5 +#define MAX_KEYS 20 + +class Xml; + +#if 0 +//--------------------------------------------------------- +// tRhyGroup +//--------------------------------------------------------- + +struct tRhyGroup { + int contrib; + int listen; + + tRhyGroup() { + listen = 0; + contrib = 0; + } +// void write(int, Xml&); +// void read(Xml&); + }; + +//--------------------------------------------------------- +// tRhyGroups +//--------------------------------------------------------- + +struct tRhyGroups { + tRhyGroup g[MAX_GROUPS]; + tRhyGroup& operator [] (int i) { return g[i]; } + +// void write(int, Xml&); +// void read(Xml&); + }; + +//--------------------------------------------------------- +// tRhythm +//--------------------------------------------------------- + +class tRhythm + { + friend class tRhythmWin; + + char* label; + +// tRndArray rhythm; +// tRndArray length; +// tRndArray veloc; + + int steps_per_count; + int count_per_bar; + int n_bars; + int keys[MAX_KEYS]; + int n_keys; + int mode; + int parm; + + int randomize; + tRhyGroups groups; +// tRndArray history; + + // set by GenInit() + long start_clock; + long next_clock; + +// void GenGroup(tRndArray& out, int grp, tBarInfo &bi, tRhythm *rhy[], int n_rhy); + int Clock2i(long clock, tBarInfo &bi) const; + int ClocksPerStep(tBarInfo &bi) const; + + public: + tRhythm(int key); + tRhythm(const tRhythm &o); + tRhythm & operator= (const tRhythm &o); + virtual ~tRhythm(); + + char const * GetLabel() { return label; } + void SetLabel(char const *); + + void Generate(tTrack *track, long fr_clock, long to_clock, long ticks_per_bar); + void Generate(tTrack *track, tBarInfo &bi, tRhythm *rhy[], int n_rhy); + void GenInit(long start_clock); + void GenerateEvent(tTrack *track, long clock, short vel, short len); + + void write(int, Xml&); + void read(Xml&); + }; +#endif + +//--------------------------------------------------------- +// RhythmGen +//--------------------------------------------------------- + +class RhythmGen : public RhythmBase + { + Q_OBJECT +#if 0 + wxPanel *inst_panel; + wxText *label; + wxSlider *steps_per_count; + wxSlider *count_per_bar; + wxSlider *n_bars; + wxListBox *instrument_list; + wxCheckBox *rand_checkbox; + + wxPanel *group_panel; + wxListBox *group_list; + wxSlider *group_contrib; + wxSlider *group_listen; + int act_group; + + tArrayEdit *length_edit; + tArrayEdit *veloc_edit; + tRhyArrayEdit *rhythm_edit; + + enum { MAX_INSTRUMENTS = 20 }; + tRhythm *instruments[MAX_INSTRUMENTS]; + int n_instruments; + int act_instrument; // -1 if none + + // this one is edited and copied from/to instruments[i] + tRhythm edit; + + // ignore Updates while creating the window (motif) + Bool in_create; + + // callbacks + static void ItemCallback(wxItem& item, wxCommandEvent& event); + static void SelectInstr(wxListBox& list, wxCommandEvent& event); + static void SelectGroup(wxListBox& list, wxCommandEvent& event); + static void Add(wxButton &but, wxCommandEvent& event); + static void Del(wxButton &but, wxCommandEvent& event); + static void Generate(wxButton &but, wxCommandEvent& event); + static void Help(); + + void Instrument2Win(int i = -1); // instrument[act_instrument] -> win + void Win2Instrument(int i = -1); // win -> instrument[act_instrument] + void AddInstrumentDlg(); + void AddInstrument(tRhythm *r); + void DelInstrument(); + + tEventWin *event_win; + tSong *song; + + void RndEnable(); + + char *default_filename; + int has_changed; + wxToolBar *tool_bar; + float tb_width, tb_height; + + void UpInstrument(); + void DownInstrument(); + void InitInstrumentList(); +#endif + virtual void closeEvent(QCloseEvent*); + + signals: + void hideWindow(); + + public: +// virtual void OnMenuCommand(int id); +// virtual void OnSize(int w, int h); + RhythmGen(QWidget* parent = 0, const char* name = 0, Qt::WFlags fo = Qt::WType_TopLevel); + virtual ~RhythmGen(); +// void OnPaint(); +// void GenRhythm(); +// bool OnClose(); + }; + +#endif + diff --git a/muse2/muse/mplugins/rhythmbase.ui b/muse2/muse/mplugins/rhythmbase.ui new file mode 100644 index 00000000..4d236c52 --- /dev/null +++ b/muse2/muse/mplugins/rhythmbase.ui @@ -0,0 +1,1004 @@ +<!DOCTYPE UI><UI version="3.2" stdsetdef="1"> +<class>RhythmBase</class> +<widget class="QMainWindow"> + <property name="name"> + <cstring>RhythmBase</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>448</width> + <height>603</height> + </rect> + </property> + <property name="caption"> + <string>MusE: Random Rhythm Generator</string> + </property> + <property name="opaqueMoving"> + <bool>true</bool> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>6</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QGroupBox" row="1" column="0"> + <property name="name"> + <cstring>GroupBox1</cstring> + </property> + <property name="title"> + <string>Instrument Properties</string> + </property> + <vbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>11</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout2_2</cstring> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QLabel" row="1" column="2"> + <property name="name"> + <cstring>TextLabel2_3_2</cstring> + </property> + <property name="text"> + <string>counts/bar</string> + </property> + </widget> + <widget class="QLabel" row="0" column="2"> + <property name="name"> + <cstring>TextLabel3_2</cstring> + </property> + <property name="text"> + <string>steps/count</string> + </property> + </widget> + <widget class="QLabel" row="2" column="2"> + <property name="name"> + <cstring>TextLabel1_2_2</cstring> + </property> + <property name="text"> + <string># bars</string> + </property> + </widget> + <widget class="QLineEdit" row="0" column="1"> + <property name="name"> + <cstring>lineInstrument_2</cstring> + </property> + <property name="text"> + <string>test</string> + </property> + <property name="dragEnabled"> + <bool>false</bool> + </property> + <property name="readOnly"> + <bool>true</bool> + </property> + </widget> + <widget class="QSpinBox" row="0" column="5"> + <property name="name"> + <cstring>spinboxContrib_2</cstring> + </property> + <property name="maxValue"> + <number>100</number> + </property> + <property name="minValue"> + <number>0</number> + </property> + <property name="value"> + <number>0</number> + </property> + </widget> + <widget class="QLabel" row="0" column="4"> + <property name="name"> + <cstring>labelContrib_2</cstring> + </property> + <property name="text"> + <string>contrib</string> + </property> + </widget> + <widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>checkRandomize_2</cstring> + </property> + <property name="text"> + <string>randomize</string> + </property> + <property name="checked"> + <bool>true</bool> + </property> + <property name="tristate"> + <bool>false</bool> + </property> + </widget> + <widget class="QComboBox" row="1" column="1"> + <item> + <property name="text"> + <string></string> + </property> + </item> + <item> + <property name="text"> + <string>Group 1</string> + </property> + </item> + <item> + <property name="text"> + <string>Group 2</string> + </property> + </item> + <item> + <property name="text"> + <string>Group 3</string> + </property> + </item> + <item> + <property name="text"> + <string>Group 4</string> + </property> + </item> + <item> + <property name="text"> + <string>Group 5</string> + </property> + </item> + <property name="name"> + <cstring>comboGroupSel_2</cstring> + </property> + </widget> + <widget class="QSpinBox" row="0" column="3"> + <property name="name"> + <cstring>spinBoxSteps_2</cstring> + </property> + <property name="maxValue"> + <number>16</number> + </property> + <property name="minValue"> + <number>1</number> + </property> + <property name="value"> + <number>4</number> + </property> + </widget> + <widget class="QSpinBox" row="2" column="3"> + <property name="name"> + <cstring>spinboxBars_2</cstring> + </property> + <property name="maxValue"> + <number>16</number> + </property> + <property name="minValue"> + <number>1</number> + </property> + <property name="value"> + <number>1</number> + </property> + </widget> + <widget class="QLabel" row="1" column="4"> + <property name="name"> + <cstring>labelListen_2</cstring> + </property> + <property name="text"> + <string>listen</string> + </property> + </widget> + <widget class="QLabel" row="0" column="0"> + <property name="name"> + <cstring>TextLabel1_4</cstring> + </property> + <property name="text"> + <string>Instrument</string> + </property> + </widget> + <widget class="QSpinBox" row="1" column="3"> + <property name="name"> + <cstring>spinboxCounts_2</cstring> + </property> + <property name="maxValue"> + <number>16</number> + </property> + <property name="minValue"> + <number>1</number> + </property> + <property name="value"> + <number>4</number> + </property> + </widget> + <widget class="QSpinBox" row="1" column="5"> + <property name="name"> + <cstring>spinboxListen_2</cstring> + </property> + <property name="maxValue"> + <number>100</number> + </property> + <property name="minValue"> + <number>-100</number> + </property> + <property name="value"> + <number>0</number> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>TextLabel1_3_2</cstring> + </property> + <property name="text"> + <string>Group</string> + </property> + </widget> + </grid> + </widget> + <widget class="QLayoutWidget"> + <property name="name"> + <cstring>Layout65_2</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonNew_2</cstring> + </property> + <property name="text"> + <string>&New</string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + <property name="toolTip" stdset="0"> + <string>create new entry</string> + </property> + <property name="whatsThis" stdset="0"> + <string>pressing the New button you create a new entry +in the MusE list of defined controllers</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonDelete_2</cstring> + </property> + <property name="text"> + <string>&Delete</string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + <property name="toolTip" stdset="0"> + <string>delete selected entry</string> + </property> + </widget> + <spacer> + <property name="name"> + <cstring>Spacer1_2</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonUp_2</cstring> + </property> + <property name="text"> + <string>Up</string> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonDown_2</cstring> + </property> + <property name="text"> + <string>Down</string> + </property> + </widget> + </hbox> + </widget> + </vbox> + </widget> + <widget class="QListView" row="0" column="0"> + <column> + <property name="text"> + <string>Instrument </string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>Group</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>steps/count </string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>counts/bar</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string># bars</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>contrib</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizable"> + <bool>true</bool> + </property> + </column> + <column> + <property name="text"> + <string>listen</string> + </property> + <property name="clickable"> + <bool>true</bool> + </property> + <property name="resizable"> + <bool>true</bool> + </property> + </column> + <property name="name"> + <cstring>viewInstrument</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>3</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>150</height> + </size> + </property> + <property name="maximumSize"> + <size> + <width>32767</width> + <height>150</height> + </size> + </property> + <property name="frameShape"> + <enum>StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>Sunken</enum> + </property> + <property name="toolTip" stdset="0"> + <string>list of defined controllers</string> + </property> + <property name="whatsThis" stdset="0"> + <string>This is the MusE list of defined controllers.</string> + </property> + </widget> + <widget class="QSplitter" row="2" column="0"> + <property name="name"> + <cstring>Splitter3</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>1</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <widget class="QSplitter"> + <property name="name"> + <cstring>Splitter2</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>7</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <widget class="QFrame"> + <property name="name"> + <cstring>Frame3</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>3</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>50</width> + <height>50</height> + </size> + </property> + <property name="frameShape"> + <enum>StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>Raised</enum> + </property> + </widget> + <widget class="QFrame"> + <property name="name"> + <cstring>Frame4</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>7</hsizetype> + <vsizetype>3</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>50</width> + <height>50</height> + </size> + </property> + <property name="frameShape"> + <enum>StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>Raised</enum> + </property> + </widget> + </widget> + <widget class="QFrame"> + <property name="name"> + <cstring>Frame5</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>3</hsizetype> + <vsizetype>3</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>0</width> + <height>150</height> + </size> + </property> + <property name="frameShape"> + <enum>StyledPanel</enum> + </property> + <property name="frameShadow"> + <enum>Raised</enum> + </property> + <widget class="QLabel"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="geometry"> + <rect> + <x>64</x> + <y>26</y> + <width>250</width> + <height>90</height> + </rect> + </property> + <property name="text"> + <string><b>Notice!</b><br> +Random Rhythm Generator is not enabled yet!</string> + </property> + </widget> + </widget> + </widget> + </grid> +</widget> +<menubar> + <property name="name"> + <cstring>menubar</cstring> + </property> + <item text="&File" name="fileMenu"> + <action name="fileNewAction"/> + <action name="fileOpenAction"/> + <action name="fileSaveAction"/> + <action name="fileSaveAsAction"/> + <separator/> + <action name="filePrintAction"/> + <separator/> + <action name="fileExitAction"/> + </item> + <item text="&Edit" name="editMenu"> + <action name="editUndoAction"/> + <action name="editRedoAction"/> + <separator/> + <action name="editCutAction"/> + <action name="editCopyAction"/> + <action name="editPasteAction"/> + <separator/> + <action name="editFindAction"/> + </item> + <item text="&Help" name="helpMenu"> + <action name="helpContentsAction"/> + <action name="helpIndexAction"/> + <separator/> + <action name="helpAboutAction"/> + </item> +</menubar> +<toolbars> + <toolbar dock="2"> + <property name="name"> + <cstring>toolBar</cstring> + </property> + <property name="label"> + <string>Tools</string> + </property> + <action name="fileNewAction"/> + <action name="fileOpenAction"/> + <action name="fileSaveAction"/> + </toolbar> +</toolbars> +<actions> + <action> + <property name="name"> + <cstring>fileNewAction</cstring> + </property> + <property name="iconSet"> + <iconset>image0</iconset> + </property> + <property name="text"> + <string>New</string> + </property> + <property name="menuText"> + <string>&New</string> + </property> + <property name="accel"> + <string>Ctrl+N</string> + </property> + </action> + <action> + <property name="name"> + <cstring>fileOpenAction</cstring> + </property> + <property name="iconSet"> + <iconset>image1</iconset> + </property> + <property name="text"> + <string>Open</string> + </property> + <property name="menuText"> + <string>&Open...</string> + </property> + <property name="accel"> + <string>Ctrl+O</string> + </property> + </action> + <action> + <property name="name"> + <cstring>fileSaveAction</cstring> + </property> + <property name="iconSet"> + <iconset>image2</iconset> + </property> + <property name="text"> + <string>Save</string> + </property> + <property name="menuText"> + <string>&Save</string> + </property> + <property name="accel"> + <string>Ctrl+S</string> + </property> + </action> + <action> + <property name="name"> + <cstring>fileSaveAsAction</cstring> + </property> + <property name="text"> + <string>Save As</string> + </property> + <property name="menuText"> + <string>Save &As...</string> + </property> + <property name="accel"> + <string></string> + </property> + </action> + <action> + <property name="name"> + <cstring>filePrintAction</cstring> + </property> + <property name="iconSet"> + <iconset>image3</iconset> + </property> + <property name="text"> + <string>Print</string> + </property> + <property name="menuText"> + <string>&Print...</string> + </property> + <property name="accel"> + <string>Ctrl+P</string> + </property> + </action> + <action> + <property name="name"> + <cstring>fileExitAction</cstring> + </property> + <property name="text"> + <string>Exit</string> + </property> + <property name="menuText"> + <string>E&xit</string> + </property> + <property name="accel"> + <string></string> + </property> + </action> + <action> + <property name="name"> + <cstring>editUndoAction</cstring> + </property> + <property name="iconSet"> + <iconset>image4</iconset> + </property> + <property name="text"> + <string>Undo</string> + </property> + <property name="menuText"> + <string>&Undo</string> + </property> + <property name="accel"> + <string>Ctrl+Z</string> + </property> + </action> + <action> + <property name="name"> + <cstring>editRedoAction</cstring> + </property> + <property name="iconSet"> + <iconset>image5</iconset> + </property> + <property name="text"> + <string>Redo</string> + </property> + <property name="menuText"> + <string>&Redo</string> + </property> + <property name="accel"> + <string>Ctrl+Y</string> + </property> + </action> + <action> + <property name="name"> + <cstring>editCutAction</cstring> + </property> + <property name="iconSet"> + <iconset>image6</iconset> + </property> + <property name="text"> + <string>Cut</string> + </property> + <property name="menuText"> + <string>&Cut</string> + </property> + <property name="accel"> + <string>Ctrl+X</string> + </property> + </action> + <action> + <property name="name"> + <cstring>editCopyAction</cstring> + </property> + <property name="iconSet"> + <iconset>image7</iconset> + </property> + <property name="text"> + <string>Copy</string> + </property> + <property name="menuText"> + <string>C&opy</string> + </property> + <property name="accel"> + <string>Ctrl+C</string> + </property> + </action> + <action> + <property name="name"> + <cstring>editPasteAction</cstring> + </property> + <property name="iconSet"> + <iconset>image8</iconset> + </property> + <property name="text"> + <string>Paste</string> + </property> + <property name="menuText"> + <string>&Paste</string> + </property> + <property name="accel"> + <string>Ctrl+V</string> + </property> + </action> + <action> + <property name="name"> + <cstring>editFindAction</cstring> + </property> + <property name="iconSet"> + <iconset>image9</iconset> + </property> + <property name="text"> + <string>Find</string> + </property> + <property name="menuText"> + <string>&Find...</string> + </property> + <property name="accel"> + <string>Ctrl+F</string> + </property> + </action> + <action> + <property name="name"> + <cstring>helpContentsAction</cstring> + </property> + <property name="text"> + <string>Contents</string> + </property> + <property name="menuText"> + <string>&Contents...</string> + </property> + <property name="accel"> + <string></string> + </property> + </action> + <action> + <property name="name"> + <cstring>helpIndexAction</cstring> + </property> + <property name="text"> + <string>Index</string> + </property> + <property name="menuText"> + <string>&Index...</string> + </property> + <property name="accel"> + <string></string> + </property> + </action> + <action> + <property name="name"> + <cstring>helpAboutAction</cstring> + </property> + <property name="text"> + <string>About</string> + </property> + <property name="menuText"> + <string>&About...</string> + </property> + <property name="accel"> + <string></string> + </property> + </action> +</actions> +<images> + <image name="image0"> + <data format="XPM.GZ" length="721">789cedd2310ac23014c6f13da778245b11ab29c114f1088aa3200eaf2f151daaa07510f1eef64553ac696fe04787fcf90dc9d03481cd7a09492aae35d647023ae0051277abaafb76b77808a93534df0ca67224e4180856e753c967d59cd5c48fb3e0d4b9269d7312a741e30c723a4e9b596333ce92930c69329cc8b9f7f3b7f42e886a1709bea70a3524142812172892325024182892f681bff2f1bf74a5bb2f19fe0f7ae439172f13a0a94f</data> + </image> + <image name="image1"> + <data format="XPM.GZ" length="691">789cad914d0ac2301085f739c5d0d905b1b62214c423282e05713189165d5441eb42c4bb9b9fa6a67644045f0299978f3713482a61b59c834cc5a5a6faa041efe90c727badaadb7a33bb8b24cfc1ec0964c9402443d0b0381d77b64653e3c8c95a6d6d312e326fc9dad2c85b156c59ba3eacfe41d0c89defc4dfa2dd7c37fc44b025a179043c4152a4b055f4365414ad0e8901fd94c1ae5e19441da9211c68e7f44098d3074d86019e70a0210c089958df7ffb31154f9c7397a6</data> + </image> + <image name="image2"> + <data format="XPM.GZ" length="691">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022530543251d2e253d856405bffcbc54105b19c856360003103711c4b530b63084709340dc64d364a36453103719cc4d49324b0173f5b002b08c32160095494c544e4202400e6932c9406174d39293617a807c226510f6d04e2611d9ff892832688028196554e3b0c9e076010d65b04437341d604f21b5d65c008f8da445</data> + </image> + <image name="image3"> + <data format="XPM.GZ" length="2509">789c7d944973db381085effe152af7cd35d5a1242e604dcdc189b37a899d65e2646a0e240168b32cc992bc646afefb34ba1b509671f40c9a9fde43a349507c72d0bb3c3fed1d3cd95b6f9acda4eb75e3e6a67760b7f3f9c35f7ffff1cfdefe60d0a33f637a83fddff6f62f36bdae77b6b87601704000197f98df331bef3313186e03f7b3ccf4c5ff281cc47e9798f378ca6c22835336ea1f461e48bd93c0832c325c0907b1ff3571cdfe9cb94ebc5536cad791877d9eff4ed87bf5178187fde47f101e66c2b04ccc79fc22ecbdfa2be63afab051369a7f889c4b7e1d38ef47c685709ea93f666e7253f0e620f75f34455634ecdf28d7a5f8af853ba77e1bb86cca7ec98c4be55af93e723564fe2cecbdd6e3fb5d0d93cfd753b555bf6a99d7918df899b0f7ea737f6658d5ea6f13b30f23615308233f4fa6adea3a677f229cfcbbc8ea4f95adfa26b2f8c8cf439d478659e28ed90bd75a0f5789d9c737c25da9f32d73177d682237327fa6acf5f12cb2faaf843ba77c1cb8c9a30f9858e64f849b587f9858d607e62ee5ff148e3e5a65a73c8ddc4abd3a709b2706e1b654e6eb6b6deb5acb5c09db52997fdf5dd1955dc15c305b62f15b65a79c47b6927f11d816895f2696f7cf58d896ea3f4f2cfe85b0f7ea3f6576c9ef477625f34839d63f8aac7e19d89589bdb08bf39f2596f997c2deabff96d925df293be54f817d19c47ccecc1f79f9ee84800db6aa8ed4902c36d1ff29dfa0439fe458a35fe63b56ac2f6b748fe6813b08023dc2e3fd502d2bf552efe11c76891ff2bbba4d4aff3a0fa9aea4c3b08fe6bbef6aa72b79346fe9ae78ba7f3b8d694c48d31ff354678657d4cf98e6ec469833c76b5ce032ac13f3945ee10dae71f39db6788b77788f0ff8150f69ce44f25cfb293ec3233a3e57bdc097f80a5fe31b3ca6e409e9141fe4f78a67f816cf7fd205bec3f7345a5ae503d5ff8827f2bec04fff933ec74bfc8c5f30a3b33ef5768803cd0f69f51c0b1a63ee648425777644e715f5153c43dd0cf050debf58e394561902d2dce3f0c8e0844638030877c2400b5daa3fa7f454b2ac331e2c68c082c53bc98393f73757fc26473567922435388711b4a11f186b7dae9c52e93f555e916b6082f7d08143abf547f4cd1d4c694ce8cae46842926acff89b161c78d95f6ae62aec1fd011e6ac6b589096a41569c9e7fedbe7072ddcc09ab48125ed0d09b6b0a5f98e744bfb3bd3e7eddfdff7fe0305be5c9c</data> + </image> + <image name="image4"> + <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c8563600020b63103711c4b530b6308470f5b082019251068344848c32b23808206494a1e23015890819653db8b81e44255c0659025d460fa70c6e3d78ec814b21b90d052422fb070540f50ebaf84196a9b5e6020008a373c8</data> + </image> + <image name="image5"> + <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54103b11c8563600020b63105719c4b530b6308470f5b0027acb28278201a64c221c4084136132ca7011885c225c06c91890542256193d98a198327a386570ea49449581bb4d2f114d0624a08c230c50fd4f5cb80da04cad351700eee4866e</data> + </image> + <image name="image6"> + <data format="XPM.GZ" length="661">789cd3d7528808f055d0d2e72a2e492cc94c5648ce482c52d04a29cdcdad8c8eb5ade6523232520022630543251d2e253d856405bffcbc54105b19c856360003103711c6b53006abc40a90649491482ac92863955146d6822ca387474619c9301419a03842825819245bd064129513b1cb242602512216994430d44bc4904984c8c1a5e032897a3019a8144c26518f800c92715864d0ec81ab4dc4701b924fb0850e8a4cad351700fe117ccc</data> + </image> + <image name="image7"> + <data format="XPM.GZ" length="706">789c9d92cb0ac2301045f7f98aa1d915b1da82b4889fa0b814c4c54c6ad14515b42e44fc773b79d057ace04da073399c5042a21076db358491b857589d15a813de20cc1f65f9dc1f562f11c431d47b01f36022822928d85c2f479e653dcb990e5772354db82aae4996a8a2e09a734d29cd4c45ae858e3ed69b71226d3c04757ac81036b05edf1ceca0b643364387ccd7a2c69148c625453d079d936be47350239f637ec3e318ec733aa4edd8f997633374dc4d0d9d86fce1b433f60ede4bf101a375a557</data> + </image> + <image name="image8"> + <data format="XPM.GZ" length="736">789c7d92d10a82301486ef7d8ae1ee24321561103d42d165105dcce3465d54507611d1bbb7736cbaadd93f85fd7efb183af38cedb66b96e5c9bd93dd09181ce58d65ede37c7eee0fab57929625339760453a4bd23903b6b95e14ceb999f30505abb255545801aba844d1d3c6d69eb658a186126aac12ab36e9176b5bb5a64da37108c784841e7229251f319101b8885e8837d018c2e9a6b925585a1b6a9640030ec1e63a6302c71faee38fd051434247f51f4c2bad4247936008a2b88368c23128ea50628e9e741ce23bdfcd9cf3e1bf8e3d5fe5e5cf1ff25e261ff1b8c16c</data> + </image> + <image name="image9"> + <data format="XPM.GZ" length="2798">789cb5d5594f23471007f0773e8545bda1e8bfbe66ecd16a1fcc7d3ab017ec46799899ee010c0603365794ef9e9afe574f2201118a14350ffcd4d555d5c7c08795d6c9e1416be5c3d2dd3c9f9f97adf22cbf6dadb8c574faf4dbef9ffe585aee765bfad369a7adeef22f4bcb47f356d91a5f5ff91a325648b75d8fe0dde0ac3bec66c17bb57b596fd8a30f6af73bfd76bf531bd3da499e64491ee66fe94127a54774e686bde0d5da6937eda4a1198ccd99c56fd1cdfa7b3af7c322783b388ff128e94167c0fcebe68cc665e3b01ec7f43031cfcd8e96473a4bacdf073af7593fc42f6a0f7ab11eeecdb1de6963e65fa787b67f0ce826bf6bccfacfb41e68193ca38b94f5e5daec398f22b868eafd4a0f63fe9c8efdcb4d63e63fa7353ff325e6385f44e75c7f4697162f4fd19cc7b0f6b017eba31f5d70fe8cce9cf57345e749cefadfcdb1de061dfb93cd689b9f9863fc9c8efdc8a5d95b7ee62bf43e78dea7d1850b163ab37e654ae7dee64b3ad6c73eadf598ffabd9ea49156dfb0ff791f5b3c4ded315dddcf722ba0cf5704117b1ff03baa997465bfe5573acd7a15d9c5f6bccfc99d9f687f0bd676596b824d8999dbd8f07bab0fc8268c6cb1d5dc67cdd68db4f9b6eea7da17dece76774c9fadf6ae77a5e8e7faff6697d2fdccf882e52cea317ede91d3ad6970bda79cb7f4737f5c27de5651ecf7b37daf27da69b7ae77419f31dd22ee69b98637d4f6b3dee37bcb742fbb5fbd9367bcb7f44bbe85bdadb7923e42b5c11cff3992ed32a0d7ea25d5a55c127b44f6dfd8d39e6ff4157b63f09e7572665dccf23edbce59fd155ea8325bcaf52ebd9feb6ccdeea5fd35565e719be67975415f31dcddf3ffe7b3c04390a943a0a38f87f8f4785539ce11c131d17b8d435f276bc464f71856b1d33dce016779863f15a0dde1feef1a071333ce209cf1861156b58c7c61bf14e3bd9d4f82d6c6347c72ef6b08f038c5ff6c4ff0738d44e8ef059f37ec157cdff0ddff5f763b857e34f71821ff8a9a38d0ebae8a18f04290618be113fd13db691a123404f447229a414f746fc3d0ec56be68e5418c9291239937399683f2f76ccbfd79aeb4263f7e552a67225d732d37123b7a85e8dd7bb923b99eb286481bedccb838ec7d76ec0ee6b03737992423b7916a7b9473a56e1644d73f957e23d0a59970dd99489769eebc94cebb344a5aba6ffecaa793f5e6b8c655df7782c5bb2cd18d9d13cbbb2a773fee57bd617ea7426977dd9f93ba3ea40d75886f7bc7fadbd90b156c9dfffbde8def774cdf6fbbf2f48bdf7fffdfbfdf3e3d25f9a24cea0</data> + </image> +</images> +<connections> + <connection> + <sender>fileNewAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>fileNew()</slot> + </connection> + <connection> + <sender>fileOpenAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>fileOpen()</slot> + </connection> + <connection> + <sender>fileSaveAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>fileSave()</slot> + </connection> + <connection> + <sender>fileSaveAsAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>fileSaveAs()</slot> + </connection> + <connection> + <sender>filePrintAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>filePrint()</slot> + </connection> + <connection> + <sender>fileExitAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>fileExit()</slot> + </connection> + <connection> + <sender>editUndoAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>editUndo()</slot> + </connection> + <connection> + <sender>editRedoAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>editRedo()</slot> + </connection> + <connection> + <sender>editCutAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>editCut()</slot> + </connection> + <connection> + <sender>editCopyAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>editCopy()</slot> + </connection> + <connection> + <sender>editPasteAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>editPaste()</slot> + </connection> + <connection> + <sender>editFindAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>editFind()</slot> + </connection> + <connection> + <sender>helpIndexAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>helpIndex()</slot> + </connection> + <connection> + <sender>helpContentsAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>helpContents()</slot> + </connection> + <connection> + <sender>helpAboutAction</sender> + <signal>activated()</signal> + <receiver>RhythmBase</receiver> + <slot>helpAbout()</slot> + </connection> +</connections> +<slots> + <slot>fileNew()</slot> + <slot>fileOpen()</slot> + <slot>fileSave()</slot> + <slot>fileSaveAs()</slot> + <slot>filePrint()</slot> + <slot>fileExit()</slot> + <slot>editUndo()</slot> + <slot>editRedo()</slot> + <slot>editCut()</slot> + <slot>editCopy()</slot> + <slot>editPaste()</slot> + <slot>editFind()</slot> + <slot>helpIndex()</slot> + <slot>helpContents()</slot> + <slot>helpAbout()</slot> +</slots> +<layoutdefaults spacing="6" margin="11"/> +</UI> |