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/liste | |
parent | a27706d9629e8b592cca4659f865b70adef24e6d (diff) |
new branch muse2, first checkin
Diffstat (limited to 'muse2/muse/liste')
-rw-r--r-- | muse2/muse/liste/Makefile.am | 16 | ||||
-rw-r--r-- | muse2/muse/liste/Makefile.in | 601 | ||||
-rw-r--r-- | muse2/muse/liste/editctrlbase.ui | 702 | ||||
-rw-r--r-- | muse2/muse/liste/editevent.cpp | 853 | ||||
-rw-r--r-- | muse2/muse/liste/editevent.h | 196 | ||||
-rw-r--r-- | muse2/muse/liste/listedit.cpp | 909 | ||||
-rw-r--r-- | muse2/muse/liste/listedit.h | 81 |
7 files changed, 3358 insertions, 0 deletions
diff --git a/muse2/muse/liste/Makefile.am b/muse2/muse/liste/Makefile.am new file mode 100644 index 00000000..3fa30b8b --- /dev/null +++ b/muse2/muse/liste/Makefile.am @@ -0,0 +1,16 @@ +include $(top_srcdir)/common.am + +if PCH +AM_CXXFLAGS += -include $(top_srcdir)/all.h +endif + +noinst_LIBRARIES = libliste.a + +dist_libliste_a_SOURCES = \ + listedit.cpp listedit.h \ + editevent.cpp editevent.h \ + editctrlbase.ui + +nodist_libliste_a_SOURCES = \ + moc_listedit.cpp \ + moc_editevent.cpp diff --git a/muse2/muse/liste/Makefile.in b/muse2/muse/liste/Makefile.in new file mode 100644 index 00000000..ca126675 --- /dev/null +++ b/muse2/muse/liste/Makefile.in @@ -0,0 +1,601 @@ +# 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/liste +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 +libliste_a_AR = $(AR) $(ARFLAGS) +libliste_a_LIBADD = +dist_libliste_a_OBJECTS = listedit.$(OBJEXT) editevent.$(OBJEXT) \ + editctrlbase.$(OBJEXT) +nodist_libliste_a_OBJECTS = moc_listedit.$(OBJEXT) \ + moc_editevent.$(OBJEXT) +libliste_a_OBJECTS = $(dist_libliste_a_OBJECTS) \ + $(nodist_libliste_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_libliste_a_SOURCES) $(nodist_libliste_a_SOURCES) +DIST_SOURCES = $(dist_libliste_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 = libliste.a +dist_libliste_a_SOURCES = \ + listedit.cpp listedit.h \ + editevent.cpp editevent.h \ + editctrlbase.ui + +nodist_libliste_a_SOURCES = \ + moc_listedit.cpp \ + moc_editevent.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/liste/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --gnu muse/liste/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) +libliste.a: $(libliste_a_OBJECTS) $(libliste_a_DEPENDENCIES) + -rm -f libliste.a + $(libliste_a_AR) libliste.a $(libliste_a_OBJECTS) $(libliste_a_LIBADD) + $(RANLIB) libliste.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/editevent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listedit.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/moc_editevent.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/moc_listedit.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/liste/editctrlbase.ui b/muse2/muse/liste/editctrlbase.ui new file mode 100644 index 00000000..e018a802 --- /dev/null +++ b/muse2/muse/liste/editctrlbase.ui @@ -0,0 +1,702 @@ +<!DOCTYPE UI><UI version="3.2" stdsetdef="1"> +<class>EditCtrlBase</class> +<widget class="QDialog"> + <property name="name"> + <cstring>MyDialog</cstring> + </property> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>601</width> + <height>413</height> + </rect> + </property> + <property name="caption"> + <string>MusE: Edit Controller Event</string> + </property> + <property name="sizeGripEnabled"> + <bool>true</bool> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="0" column="3"> + <property name="name"> + <cstring>textLabel1</cstring> + </property> + <property name="text"> + <string>Time Position</string> + </property> + </widget> + <widget class="QLabel" row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>textLabel1_2</cstring> + </property> + <property name="text"> + <string>Available Controller:</string> + </property> + </widget> + <widget class="QPushButton" row="2" column="0"> + <property name="name"> + <cstring>buttonNewController</cstring> + </property> + <property name="text"> + <string>Create New Controller</string> + </property> + <property name="accel"> + <string></string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + <property name="default"> + <bool>true</bool> + </property> + </widget> + <widget class="PosEdit" row="0" column="4"> + <property name="name"> + <cstring>timePos</cstring> + </property> + </widget> + <widget class="QWidgetStack" row="1" column="3" rowspan="2" colspan="2"> + <property name="name"> + <cstring>widgetStack</cstring> + </property> + <property name="paletteBackgroundColor"> + <color> + <red>104</red> + <green>137</green> + <blue>236</blue> + </color> + </property> + <property name="palette"> + <palette> + <active> + <color> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + <color> + <red>238</red> + <green>234</green> + <blue>222</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>246</red> + <green>244</green> + <blue>238</blue> + </color> + <color> + <red>119</red> + <green>117</green> + <blue>111</blue> + </color> + <color> + <red>158</red> + <green>155</green> + <blue>147</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>104</red> + <green>137</green> + <blue>236</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>128</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + </active> + <disabled> + <color> + <red>128</red> + <green>128</green> + <blue>128</blue> + </color> + <color> + <red>238</red> + <green>234</green> + <blue>222</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>119</red> + <green>117</green> + <blue>111</blue> + </color> + <color> + <red>158</red> + <green>155</green> + <blue>147</blue> + </color> + <color> + <red>128</red> + <green>128</green> + <blue>128</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>128</red> + <green>128</green> + <blue>128</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>104</red> + <green>137</green> + <blue>236</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>128</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>192</blue> + </color> + <color> + <red>128</red> + <green>0</green> + <blue>128</blue> + </color> + </disabled> + <inactive> + <color> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + <color> + <red>238</red> + <green>234</green> + <blue>222</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>119</red> + <green>117</green> + <blue>111</blue> + </color> + <color> + <red>158</red> + <green>155</green> + <blue>147</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>104</red> + <green>137</green> + <blue>236</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>0</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>128</blue> + </color> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + <color> + <red>0</red> + <green>0</green> + <blue>192</blue> + </color> + <color> + <red>128</red> + <green>0</green> + <blue>128</blue> + </color> + </inactive> + </palette> + </property> + <widget class="QWidget"> + <property name="name"> + <cstring>WStackPage</cstring> + </property> + <attribute name="id"> + <number>0</number> + </attribute> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QSlider" row="3" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>valSlider</cstring> + </property> + <property name="maxValue"> + <number>127</number> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + </widget> + <widget class="QLabel" row="1" column="1"> + <property name="name"> + <cstring>controllerName</cstring> + </property> + <property name="paletteBackgroundColor"> + <color> + <red>255</red> + <green>255</green> + <blue>255</blue> + </color> + </property> + <property name="frameShape"> + <enum>LineEditPanel</enum> + </property> + <property name="frameShadow"> + <enum>Sunken</enum> + </property> + <property name="text"> + <string>textLabel3</string> + </property> + </widget> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>textLabel4</cstring> + </property> + <property name="text"> + <string>Value</string> + </property> + </widget> + <widget class="QLabel" row="1" column="0"> + <property name="name"> + <cstring>textLabel2</cstring> + </property> + <property name="text"> + <string>Controller</string> + </property> + </widget> + <widget class="QSpinBox" row="2" column="1"> + <property name="name"> + <cstring>valSpinBox</cstring> + </property> + <property name="maxValue"> + <number>127</number> + </property> + </widget> + <spacer row="0" column="1"> + <property name="name"> + <cstring>spacer2</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>40</height> + </size> + </property> + </spacer> + </grid> + </widget> + <widget class="QWidget"> + <property name="name"> + <cstring>WStackPage</cstring> + </property> + <attribute name="id"> + <number>1</number> + </attribute> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="QLabel" row="2" column="0"> + <property name="name"> + <cstring>textLabel2_2</cstring> + </property> + <property name="text"> + <string>H-Bank</string> + </property> + </widget> + <widget class="QLabel" row="3" column="0"> + <property name="name"> + <cstring>textLabel3</cstring> + </property> + <property name="text"> + <string>L-Bank</string> + </property> + </widget> + <widget class="QLabel" row="4" column="0"> + <property name="name"> + <cstring>textLabel4_2</cstring> + </property> + <property name="text"> + <string>Program</string> + </property> + </widget> + <widget class="QSpinBox" row="2" column="1"> + <property name="name"> + <cstring>hbank</cstring> + </property> + <property name="specialValueText"> + <string>off</string> + </property> + <property name="maxValue"> + <number>128</number> + </property> + <property name="minValue"> + <number>0</number> + </property> + <property name="value"> + <number>0</number> + </property> + </widget> + <widget class="QSpinBox" row="3" column="1"> + <property name="name"> + <cstring>lbank</cstring> + </property> + <property name="specialValueText"> + <string>off</string> + </property> + <property name="maxValue"> + <number>128</number> + </property> + <property name="minValue"> + <number>0</number> + </property> + <property name="value"> + <number>0</number> + </property> + </widget> + <widget class="QSpinBox" row="4" column="1"> + <property name="name"> + <cstring>program</cstring> + </property> + <property name="maxValue"> + <number>128</number> + </property> + <property name="minValue"> + <number>1</number> + </property> + </widget> + <spacer row="0" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>spacer4</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>140</height> + </size> + </property> + </spacer> + <widget class="QPushButton" row="1" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>patchName</cstring> + </property> + <property name="text"> + <string>pushButton4</string> + </property> + </widget> + </grid> + </widget> + </widget> + <widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>Layout1</cstring> + </property> + <hbox> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="margin"> + <number>0</number> + </property> + <property name="spacing"> + <number>6</number> + </property> + <spacer> + <property name="name"> + <cstring>Horizontal Spacing2</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>buttonOk</cstring> + </property> + <property name="text"> + <string>&OK</string> + </property> + <property name="accel"> + <string></string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + <property name="default"> + <bool>true</bool> + </property> + </widget> + <widget class="QPushButton"> + <property name="name"> + <cstring>buttonCancel</cstring> + </property> + <property name="text"> + <string>&Cancel</string> + </property> + <property name="accel"> + <string></string> + </property> + <property name="autoDefault"> + <bool>true</bool> + </property> + </widget> + </hbox> + </widget> + <widget class="Line" row="3" column="0" rowspan="1" colspan="5"> + <property name="name"> + <cstring>line1</cstring> + </property> + <property name="frameShape"> + <enum>HLine</enum> + </property> + <property name="frameShadow"> + <enum>Raised</enum> + </property> + <property name="lineWidth"> + <number>3</number> + </property> + <property name="margin"> + <number>2</number> + </property> + <property name="midLineWidth"> + <number>2</number> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + </widget> + <widget class="QListBox" row="1" column="0" rowspan="1" colspan="2"> + <property name="name"> + <cstring>ctrlList</cstring> + </property> + <property name="currentItem"> + <number>-1</number> + </property> + </widget> + <spacer row="2" column="1"> + <property name="name"> + <cstring>spacer3</cstring> + </property> + <property name="orientation"> + <enum>Horizontal</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + <property name="sizeHint"> + <size> + <width>60</width> + <height>20</height> + </size> + </property> + </spacer> + <widget class="Line" row="0" column="2" rowspan="3" colspan="1"> + <property name="name"> + <cstring>line2</cstring> + </property> + <property name="frameShape"> + <enum>VLine</enum> + </property> + <property name="frameShadow"> + <enum>Raised</enum> + </property> + <property name="lineWidth"> + <number>3</number> + </property> + <property name="margin"> + <number>2</number> + </property> + <property name="midLineWidth"> + <number>2</number> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + </widget> + </grid> +</widget> +<customwidgets> + <customwidget> + <class>PosEdit</class> + <header location="global">posedit.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> + </customwidget> +</customwidgets> +<connections> + <connection> + <sender>buttonOk</sender> + <signal>clicked()</signal> + <receiver>MyDialog</receiver> + <slot>accept()</slot> + </connection> + <connection> + <sender>buttonCancel</sender> + <signal>clicked()</signal> + <receiver>MyDialog</receiver> + <slot>reject()</slot> + </connection> + <connection> + <sender>valSlider</sender> + <signal>valueChanged(int)</signal> + <receiver>valSpinBox</receiver> + <slot>setValue(int)</slot> + </connection> + <connection> + <sender>valSpinBox</sender> + <signal>valueChanged(int)</signal> + <receiver>valSlider</receiver> + <slot>setValue(int)</slot> + </connection> +</connections> +<layoutdefaults spacing="6" margin="11"/> +<includehints> + <includehint>../widgets/posedit.h</includehint> +</includehints> +</UI> diff --git a/muse2/muse/liste/editevent.cpp b/muse2/muse/liste/editevent.cpp new file mode 100644 index 00000000..ef084440 --- /dev/null +++ b/muse2/muse/liste/editevent.cpp @@ -0,0 +1,853 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: editevent.cpp,v 1.12.2.6 2009/02/02 21:38:00 terminator356 Exp $ +// (C) Copyright 1999-2004 Werner Schweer (ws@seh.de) +//========================================================= + +#include <stdio.h> + +#include <qlayout.h> +#include <qlabel.h> +#include <qpushbutton.h> +#include <q3multilineedit.h> +#include <qmessagebox.h> +#include <qslider.h> +#include <qradiobutton.h> +#include <qspinbox.h> +#include <q3listbox.h> +#include <q3widgetstack.h> +#include <q3popupmenu.h> +//Added by qt3to4: +#include <Q3HBoxLayout> +#include <Q3GridLayout> +#include <Q3VBoxLayout> +#include <Q3BoxLayout> + +#include "song.h" +#include "event.h" +#include "midictrl.h" +#include "editevent.h" +#include "pitchedit.h" +#include "intlabel.h" +#include "globals.h" +#include "posedit.h" +#include "gconfig.h" +#include "midiport.h" +#include "midiedit/drummap.h" +#include "instruments/minstrument.h" +#include "midi.h" + +//--------------------------------------------------------- +// string2qhex +//--------------------------------------------------------- + +QString string2hex(const unsigned char* data, int len) + { + QString d; + QString s; + for (int i = 0; i < len; ++i) { + if ((i > 0) && ((i % 8)==0)) { + d += "\n"; + } + else if (i) + d += " "; + d += s.sprintf("%02x", data[i]); + } + return d; + } + +//--------------------------------------------------------- +// hex2string +//--------------------------------------------------------- + +char* hex2string(QWidget* parent, const char* src, int& len) + { + char buffer[2048]; + char* dst = buffer; + + while (*src) { + while (*src == ' ' || *src == '\n') + ++src; + char* ep; + long val = strtol(src, &ep, 16); + if (ep == src) { + QMessageBox::information(parent, + QString("MusE"), + QWidget::tr("Cannot convert sysex string")); + return 0; + } + src = ep; + *dst++ = val; + if (dst - buffer >= 2048) { + QMessageBox::information(parent, + QString("MusE"), + QWidget::tr("Hex String too long (2048 bytes limit)")); + return 0; + } + } + len = dst - buffer; + char* b = new char[len+1]; + memcpy(b, buffer, len); + b[len] = 0; + return b; + } + +//--------------------------------------------------------- +// getEvent +//--------------------------------------------------------- + +Event EditNoteDialog::getEvent(int tick, const Event& event, QWidget* parent) + { + EditNoteDialog* dlg = new EditNoteDialog(tick, event, parent); + Event nevent; + if (dlg->exec() == QDialog::Accepted) { + nevent = dlg->event(); + } + delete dlg; + return nevent; + } + +Event EditSysexDialog::getEvent(int tick, const Event& event, QWidget* parent) + { + EditSysexDialog* dlg = new EditSysexDialog(tick, event, parent); + Event nevent; + if (dlg->exec() == QDialog::Accepted) { + nevent = dlg->event(); + } + delete dlg; + return nevent; + } + +Event EditMetaDialog::getEvent(int tick, const Event& event, QWidget* parent) + { + EditEventDialog* dlg = new EditMetaDialog(tick, event, parent); + Event nevent; + if (dlg->exec() == QDialog::Accepted) { + nevent = dlg->event(); + } + delete dlg; + return nevent; + } + +Event EditCAfterDialog::getEvent(int tick, const Event& event, QWidget* parent) + { + EditEventDialog* dlg = new EditCAfterDialog(tick, event, parent); + Event nevent; + if (dlg->exec() == QDialog::Accepted) { + nevent = dlg->event(); + } + delete dlg; + return nevent; + } + +Event EditPAfterDialog::getEvent(int tick, const Event& event, QWidget* parent) + { + EditEventDialog* dlg = new EditPAfterDialog(tick, event, parent); + Event nevent; + if (dlg->exec() == QDialog::Accepted) { + nevent = dlg->event(); + } + delete dlg; + return nevent; + } + +//--------------------------------------------------------- +// EditEventDialog +//--------------------------------------------------------- + +EditEventDialog::EditEventDialog(QWidget* parent, const char* name) + : QDialog(parent, name, true) + { + Q3VBoxLayout* xlayout = new Q3VBoxLayout(this); + layout1 = new Q3GridLayout(this); // ddskrjo this + xlayout->addLayout(layout1); + + //--------------------------------------------------- + // Ok, Cancel + //--------------------------------------------------- + + Q3BoxLayout* w5 = new Q3HBoxLayout(this); // ddskrjo this + xlayout->addLayout(w5); + QPushButton* okB = new QPushButton(tr("Ok"), this); + okB->setDefault(true); + QPushButton* cancelB = new QPushButton(tr("Cancel"), this); + okB->setFixedWidth(80); + cancelB->setFixedWidth(80); + w5->addWidget(okB); + w5->addSpacing(12); + w5->addWidget(cancelB); + w5->addStretch(1); + connect(cancelB, SIGNAL(clicked()), SLOT(reject())); + connect(okB, SIGNAL(clicked()), SLOT(accept())); + } + +//--------------------------------------------------------- +// EditNoteDialog +//--------------------------------------------------------- + +EditNoteDialog::EditNoteDialog(int tick, const Event& event, + QWidget* parent, const char* name) + : EditNoteDialogBase(parent, name) + { + if (!event.empty()) { + epos->setValue(tick); + il1->setValue(event.lenTick()); + pl->setValue(event.pitch()); + il2->setValue(event.velo()); + il3->setValue(event.veloOff()); + } + else { + epos->setValue(tick); + il1->setValue(96); + pl->setValue(64); + il2->setValue(100); + il3->setValue(0); + } + } + +//--------------------------------------------------------- +// EditNoteDialog::event +//--------------------------------------------------------- + +Event EditNoteDialog::event() + { + Event event(Note); + event.setTick(epos->pos().tick()); + event.setA(pl->value()); + event.setB(il2->value()); + event.setC(il3->value()); + event.setLenTick(il1->value()); + return event; + } + +//--------------------------------------------------------- +// EditSysExDialog +//--------------------------------------------------------- + +EditSysexDialog::EditSysexDialog(int tick, const Event& event, + QWidget* parent, const char* name) + : EditSysexDialogBase(parent, name) + { + sysex = 0; + if (!event.empty()) { + epos->setValue(tick); + edit->setText(string2hex(event.data(), event.dataLen())); + } + else { + epos->setValue(tick); + } + } + +//--------------------------------------------------------- +// ~EditSysexDialog +//--------------------------------------------------------- + +EditSysexDialog::~EditSysexDialog() + { + if (sysex) + delete sysex; + } + +//--------------------------------------------------------- +// EditSysExDialog::event +//--------------------------------------------------------- + +Event EditSysexDialog::event() + { + Event event(Sysex); + event.setTick(epos->pos().tick()); + event.setData(sysex, len); + return event; + } + +//--------------------------------------------------------- +// accept +//--------------------------------------------------------- + +void EditSysexDialog::accept() + { + QString qsrc = edit->text(); + const char* src = qsrc.latin1(); + + sysex = (unsigned char*)hex2string(this, src, len); + if (sysex) + QDialog::accept(); + } + +//--------------------------------------------------------- +// EditMetaDialog +//--------------------------------------------------------- + +EditMetaDialog::EditMetaDialog(int tick, const Event& ev, + QWidget* parent, const char* name) + : EditEventDialog(parent, name) + { + meta = 0; + setCaption(tr("MusE: Enter Meta Event")); + + QLabel* l1 = new QLabel(tr("Time Position"), this); + epos = new PosEdit(this); + + QLabel* l2 = new QLabel(tr("Meta Type"), this); + il2 = new IntLabel(-1, 0, 127, this, -1); + il2->setFixedWidth(100); + il2->setFrame(true); + il2->setDark(); + typeLabel = new QLabel(this); + typeLabel->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); + Q3HBoxLayout* typeLayout = new Q3HBoxLayout(this); + typeLayout->addWidget(il2); + typeLayout->addWidget(typeLabel); + typeLayout->addStretch(); + + hexButton = new QRadioButton(tr("Enter Hex"), this, "hextoggle"); + hexButton->setChecked(true); + connect(hexButton, SIGNAL(toggled(bool)), SLOT(toggled(bool))); + + edit = new Q3MultiLineEdit(this); + edit->setFont(config.fonts[5]); + + if (!ev.empty()) { + epos->setValue(tick); + il2->setValue(ev.dataA()); + toggled(true); + edit->setText(string2hex(ev.data(), ev.dataLen())); + } + else { + epos->setValue(tick); + il2->setValue(0); + } + + typeChanged(il2->value()); + connect(il2, SIGNAL(valueChanged(int)), SLOT(typeChanged(int))); + + layout1->addWidget(l1, 0, 0); + layout1->addWidget(epos, 0, 1, Qt::AlignLeft); + layout1->addWidget(l2, 1, 0); + + //layout1->addWidget(il2, 1, 1, AlignLeft); + layout1->addLayout(typeLayout, 1, 1); + + layout1->addMultiCellWidget(hexButton, 2, 2, 0, 1); + layout1->addMultiCellWidget(edit, 3, 3, 0, 1); + } + +//--------------------------------------------------------- +// typeChanged +//--------------------------------------------------------- + +void EditMetaDialog::typeChanged(int val) +{ + typeLabel->setText(midiMetaName(val)); +} + +//--------------------------------------------------------- +// toggled +//--------------------------------------------------------- + +void EditMetaDialog::toggled(bool flag) + { + QString qsrc = edit->text(); + const char* src = qsrc.latin1(); + edit->clear(); + + QString dst; + if (flag) { // convert to hex + dst = string2hex((unsigned char*)src, strlen(src)); + } + else { // convert to string + int len; + dst = hex2string(this, src, len); + } + edit->setText(dst); + } + +//--------------------------------------------------------- +// ~EditMetaDialog +//--------------------------------------------------------- + +EditMetaDialog::~EditMetaDialog() + { + if (meta) + delete meta; + } + +//--------------------------------------------------------- +// EditMetaDialog::event +//--------------------------------------------------------- + +Event EditMetaDialog::event() + { + Event event(Meta); + event.setTick(epos->pos().tick()); + event.setA(il2->value()); + event.setData(meta, len); // TODO ?? + return event; + } + +//--------------------------------------------------------- +// accept +//--------------------------------------------------------- + +void EditMetaDialog::accept() + { + QString qsrc = edit->text(); + const char* src = qsrc.latin1(); + if (!hexButton->isChecked()) { + meta = (unsigned char*)strdup(src); + len = strlen(src); + QDialog::accept(); + return; + } + + meta = (unsigned char*)hex2string(this, src, len); + if (meta) + QDialog::accept(); + } + +//--------------------------------------------------------- +// EditCAfterDialog +//--------------------------------------------------------- + +EditCAfterDialog::EditCAfterDialog(int tick, const Event& event, + QWidget* parent, const char* name) + : EditEventDialog(parent, name) + { + setCaption(tr("MusE: Enter Channel Aftertouch")); + + QLabel* l1 = new QLabel(tr("Time Position"), this); + epos = new PosEdit(this); + + QLabel* l2 = new QLabel(tr("Pressure"), this); + il2 = new IntLabel(-1, 0, 127, this, -1); + il2->setFrame(true); + il2->setDark(); + + QSlider* slider = new QSlider(0, 127, 1, 0, Qt::Horizontal, this); + connect(slider, SIGNAL(valueChanged(int)), il2, SLOT(setValue(int))); + connect(il2, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int))); + + if (!event.empty()) { + epos->setValue(tick); + il2->setValue(event.dataA()); + slider->setValue(event.dataA()); + } + else { + epos->setValue(tick); + il2->setValue(64); + slider->setValue(64); + } + + layout1->addWidget(l1, 0, 0); + layout1->addWidget(epos, 0, 1, Qt::AlignLeft); + layout1->addWidget(l2, 1, 0); + layout1->addWidget(il2, 1, 1, Qt::AlignLeft); + layout1->addMultiCellWidget(slider, 2, 2, 0, 1); + } + +//--------------------------------------------------------- +// EditCAfterDialog::event +//--------------------------------------------------------- + +Event EditCAfterDialog::event() + { + Event event(CAfter); + event.setTick(epos->pos().tick()); + event.setA(il2->value()); + return event; + } + +//--------------------------------------------------------- +// EditPAfterDialog +//--------------------------------------------------------- + +EditPAfterDialog::EditPAfterDialog(int tick, const Event& event, + QWidget* parent, const char* name) + : EditEventDialog(parent, name) + { + setCaption(tr("MusE: Enter Poly Aftertouch")); + + QLabel* l1 = new QLabel(tr("Time Position"), this); + epos = new PosEdit(this); + + QLabel* l2 = new QLabel(tr("Pitch"), this); + pl = new PitchEdit(this); + QLabel* l3 = new QLabel(tr("Pressure"), this); + il2 = new IntLabel(-1, 0, 127, this, -1); + il2->setFrame(true); + il2->setDark(); + + QSlider* slider = new QSlider(0, 127, 1, 0, Qt::Horizontal, this); + connect(slider, SIGNAL(valueChanged(int)), il2, SLOT(setValue(int))); + connect(il2, SIGNAL(valueChanged(int)), slider, SLOT(setValue(int))); + + if (!event.empty()) { + epos->setValue(tick); + pl->setValue(event.pitch()); + il2->setValue(event.dataB()); + slider->setValue(event.dataB()); + } + else { + epos->setValue(tick); + pl->setValue(64); + il2->setValue(64); + slider->setValue(64); + } + + layout1->addWidget(l1, 0, 0); + layout1->addWidget(epos, 0, 1, Qt::AlignLeft); + layout1->addWidget(l2, 1, 0); + layout1->addWidget(pl, 1, 1, Qt::AlignLeft); + layout1->addWidget(l3, 2, 0); + layout1->addWidget(il2, 2, 1, Qt::AlignLeft); + layout1->addMultiCellWidget(slider, 3, 3, 0, 1); + } + +//--------------------------------------------------------- +// EditPAfterDialog::event +//--------------------------------------------------------- + +Event EditPAfterDialog::event() + { + Event event(PAfter); + event.setTick(epos->pos().tick()); + event.setA(pl->value()); + event.setB(il2->value()); + return event; + } +//--------------------------------------------------------- +// getEvent +//--------------------------------------------------------- + +Event EditCtrlDialog::getEvent(int tick, const Event& event, + const MidiPart* part, QWidget* parent) + { + EditCtrlDialog* dlg = new EditCtrlDialog(tick, event, part, parent); + Event nevent; + if (dlg->exec() == QDialog::Accepted) { + nevent = dlg->event(); + } + delete dlg; + return nevent; + } + +//--------------------------------------------------------- +// EditCtrlDialog::event +//--------------------------------------------------------- + +Event EditCtrlDialog::event() + { + Event event(Controller); + event.setTick(timePos->pos().tick()); + event.setA(num); + if (num == CTRL_PROGRAM) + event.setB(val); + else + event.setB(valSlider->value() + midiPorts[part->track()->outPort()].midiController(num)->bias()); + return event; + } + +//--------------------------------------------------------- +// EditCtrlDialog +// PosEdit* timePos; +// QSlider* valSlider; +// QSpinBox* valSpinBox; +// QLabel* controllerName; +// QListBox* ctrlList; +// QPushButton* buttonNewController; +//--------------------------------------------------------- + +EditCtrlDialog::EditCtrlDialog(int tick, const Event& event, + const MidiPart* p, QWidget* parent, const char* name) + : EditCtrlBase(parent, name), part(p) + { + val = 0; + num = 0; + if (!event.empty()) { + num = event.dataA(); + val = event.dataB(); + } + + pop = new Q3PopupMenu(this); + pop->setCheckable(false); + + MidiTrack* track = part->track(); + int portn = track->outPort(); + MidiPort* port = &midiPorts[portn]; + bool isDrum = track->type() == Track::DRUM; + MidiCtrlValListList* cll = port->controller(); + + ctrlList->clear(); + ctrlList->setSelectionMode(Q3ListBox::Single); + + // + // populate list of available controller + // + + std::list<QString> sList; + typedef std::list<QString>::iterator isList; + + for (iMidiCtrlValList i = cll->begin(); i != cll->end(); ++i) { + MidiCtrlValList* cl = i->second; + int num = cl->num(); + + // dont show drum specific controller if not a drum track + if ((num & 0xff) == 0xff) { + if (!isDrum) + continue; + } + MidiController* c = port->midiController(num); + isList i = sList.begin(); + for (; i != sList.end(); ++i) { + if (*i == c->name()) + break; + } + if (i == sList.end()) + sList.push_back(c->name()); + } + MidiController* mc = port->midiController(num); + int idx = 0; + int selectionIndex = 0; + for (isList i = sList.begin(); i != sList.end(); ++i, ++idx) { + ctrlList->insertItem(*i); + if (mc->name() == *i) + selectionIndex = idx; + } + ctrlList->setSelected(selectionIndex, true); + + valSlider->setRange(mc->minVal(), mc->maxVal()); + valSpinBox->setRange(mc->minVal(), mc->maxVal()); + + controllerName->setText(mc->name()); + + if(!event.empty()) + { + if(num == CTRL_PROGRAM) + { + widgetStack->raiseWidget(1); + updatePatch(); + } + else + { + widgetStack->raiseWidget(0); + valSlider->setValue(val - mc->bias()); + } + } + else + ctrlListClicked(ctrlList->selectedItem()); + connect(ctrlList, SIGNAL(clicked(Q3ListBoxItem*)), SLOT(ctrlListClicked(Q3ListBoxItem*))); + connect(buttonNewController, SIGNAL(clicked()), SLOT(newController())); + connect(hbank, SIGNAL(valueChanged(int)), SLOT(programChanged())); + connect(lbank, SIGNAL(valueChanged(int)), SLOT(programChanged())); + connect(program, SIGNAL(valueChanged(int)), SLOT(programChanged())); + connect(patchName, SIGNAL(released()), SLOT(instrPopup())); + timePos->setValue(tick); + + } +//--------------------------------------------------------- +// newController +//--------------------------------------------------------- + +void EditCtrlDialog::newController() + { + Q3PopupMenu* pop = new Q3PopupMenu(this); + pop->setCheckable(this); + // + // populate popup with all controllers available for + // current instrument + // + MidiTrack* track = part->track(); + int portn = track->outPort(); + MidiPort* port = &midiPorts[portn]; + MidiInstrument* instr = port->instrument(); + MidiControllerList* mcl = instr->controller(); + + MidiCtrlValListList* cll = port->controller(); + int channel = track->outChannel(); + for (iMidiController ci = mcl->begin(); ci != mcl->end(); ++ci) + { + if(cll->find(channel, ci->second->num()) == cll->end()) + pop->insertItem(ci->second->name()); + } + int rv = pop->exec(buttonNewController->mapToGlobal(QPoint(0,0))); + if (rv != -1) { + QString s = pop->text(rv); + for (iMidiController ci = mcl->begin(); ci != mcl->end(); ++ci) { + MidiController* mc = ci->second; + if (mc->name() == s) { + if(cll->find(channel, mc->num()) == cll->end()) + { + MidiCtrlValList* vl = new MidiCtrlValList(mc->num()); + cll->add(channel, vl); + //song->update(SC_MIDI_CONTROLLER_ADD); + } + for (int idx = 0; ;++idx) { + QString str = ctrlList->text(idx); + if (s == str) + { + ctrlList->setSelected(idx, true); + ctrlListClicked(ctrlList->item(idx)); + break; + } + if (str.isNull()) { + ctrlList->insertItem(s); + ctrlList->setSelected(idx, true); + ctrlListClicked(ctrlList->item(idx)); + break; + } + } + + break; + } + } + } + delete pop; + } +//--------------------------------------------------------- +// ctrlListClicked +//--------------------------------------------------------- + +void EditCtrlDialog::ctrlListClicked(Q3ListBoxItem* item) + { + if (item == 0) + return; + QString s(item->text()); + + MidiTrack* track = part->track(); + int portn = track->outPort(); + MidiPort* port = &midiPorts[portn]; + MidiCtrlValListList* cll = port->controller(); + + iMidiCtrlValList i; + for (i = cll->begin(); i != cll->end(); ++i) { + MidiCtrlValList* cl = i->second; + num = cl->num(); + MidiController* c = port->midiController(num); + if (s == c->name()) { + if (num == CTRL_PROGRAM) { + widgetStack->raiseWidget(1); + + val = c->initVal(); + if(val == CTRL_VAL_UNKNOWN) + val = 0; + updatePatch(); + } + else { + widgetStack->raiseWidget(0); + valSlider->setRange(c->minVal(), c->maxVal()); + valSpinBox->setRange(c->minVal(), c->maxVal()); + controllerName->setText(s); + val = c->initVal(); + + if(val == CTRL_VAL_UNKNOWN || val == 0) + { + switch(num) + { + case CTRL_PANPOT: + val = 64 - c->bias(); + break; + case CTRL_VOLUME: + val = 100; + break; + default: + val = 0; + break; + } + } + valSlider->setValue(val); + } + break; + } + } + if (i == cll->end()) + printf("controller %s not found!\n", s.latin1()); + } + +//--------------------------------------------------------- +// updatePatch +//--------------------------------------------------------- + +void EditCtrlDialog::updatePatch() + { + MidiTrack* track = part->track(); + int port = track->outPort(); + int channel = track->outChannel(); + MidiInstrument* instr = midiPorts[port].instrument(); + const char* name = instr->getPatchName(channel, val, song->mtype(), track->type() == Track::DRUM); + patchName->setText(QString(name)); + + int hb = ((val >> 16) & 0xff) + 1; + if (hb == 0x100) + hb = 0; + int lb = ((val >> 8) & 0xff) + 1; + if (lb == 0x100) + lb = 0; + int pr = (val & 0xff) + 1; + if (pr == 0x100) + pr = 0; + + hbank->blockSignals(true); + lbank->blockSignals(true); + program->blockSignals(true); + + hbank->setValue(hb); + lbank->setValue(lb); + program->setValue(pr); + + hbank->blockSignals(false); + lbank->blockSignals(false); + program->blockSignals(false); + } + +//--------------------------------------------------------- +// instrPopup +//--------------------------------------------------------- + +void EditCtrlDialog::instrPopup() + { + MidiTrack* track = part->track(); + int channel = track->outChannel(); + int port = track->outPort(); + MidiInstrument* instr = midiPorts[port].instrument(); + instr->populatePatchPopup(pop, channel, song->mtype(), track->type() == Track::DRUM); + + if(pop->count() == 0) + return; + int rv = pop->exec(patchName->mapToGlobal(QPoint(10,5))); + if (rv != -1) { + val = rv; + updatePatch(); + } + } + +//--------------------------------------------------------- +// programChanged +//--------------------------------------------------------- + +void EditCtrlDialog::programChanged() + { +// MidiTrack* track = part->track(); +// int channel = track->outChannel(); +// int port = track->outPort(); + int hb = hbank->value(); + int lb = lbank->value(); + int prog = program->value(); + + if (hb > 0 && hb < 129) + hb -= 1; + else + hb = 0xff; + if (lb > 0 && lb < 129) + lb -= 1; + else + lb = 0xff; + if (prog > 0 && prog < 129) + prog -= 1; + else + prog = 0xff; + + val = (hb << 16) + (lb << 8) + prog; + updatePatch(); + } + diff --git a/muse2/muse/liste/editevent.h b/muse2/muse/liste/editevent.h new file mode 100644 index 00000000..769ba256 --- /dev/null +++ b/muse2/muse/liste/editevent.h @@ -0,0 +1,196 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: editevent.h,v 1.6.2.1 2008/05/21 00:28:53 terminator356 Exp $ +// (C) Copyright 1999 Werner Schweer (ws@seh.de) +//========================================================= + +#ifndef __EDIT_EVENT_H__ +#define __EDIT_EVENT_H__ + +#include <qdialog.h> +//Added by qt3to4: +#include <Q3PopupMenu> +#include <Q3GridLayout> +#include <QLabel> + +#include "editnotedialogbase.h" +#include "editsysexdialogbase.h" +#include "editctrlbase.h" +#include "event.h" + +class PosEdit; +class IntLabel; +class PitchEdit; +class Q3GridLayout; +class Q3MultiLineEdit; +class QRadioButton; +class PosEdit; +class MidiPart; +class Q3ListBoxItem; +class Q3PopupMenu; +//--------------------------------------------------------- +// EditEventDialog +//--------------------------------------------------------- + +class EditEventDialog : public QDialog { + Q_OBJECT + + protected: + Q3GridLayout* layout1; + + public: + EditEventDialog(QWidget* parent=0, const char* name=0); + virtual Event event() = 0; + }; + +//--------------------------------------------------------- +// EditNoteDialog +//--------------------------------------------------------- + +class EditNoteDialog : public EditNoteDialogBase { + Q_OBJECT + + public: + EditNoteDialog(int tick, const Event&, + QWidget* parent=0, const char* name=0); + static Event getEvent(int tick, const Event&, + QWidget* parent = 0); + virtual Event event(); + }; + +//--------------------------------------------------------- +// EditSysExDialog +//--------------------------------------------------------- + +class EditSysexDialog : public EditSysexDialogBase { + Q_OBJECT + + unsigned char* sysex; + int len; + + protected: + Q3GridLayout* layout; + + private slots: + virtual void accept(); + + public: + EditSysexDialog(int tick, const Event&, + QWidget* parent=0, const char* name=0); + ~EditSysexDialog(); + static Event getEvent(int tick, const Event&, + QWidget* parent = 0); + virtual Event event(); + }; + +//--------------------------------------------------------- +// EditCtrlDialog +//--------------------------------------------------------- + +class EditCtrlDialog : public EditCtrlBase { + Q_OBJECT + + int num; // controller number + int val; // controller value (for prog. changes) + + const MidiPart* part; + Q3PopupMenu* pop; + + void updatePatch(); + + private slots: + void ctrlListClicked(Q3ListBoxItem*); + void newController(); + void programChanged(); + void instrPopup(); + + protected: + Q3GridLayout* layout; + + + public: + EditCtrlDialog(int tick, const Event&, + const MidiPart*, QWidget* parent=0, const char* name=0); + static Event getEvent(int tick, const Event&, const MidiPart*, + QWidget* parent = 0); + virtual Event event(); + }; + +//--------------------------------------------------------- +// EditMetaDialog +//--------------------------------------------------------- + +class EditMetaDialog : public EditEventDialog { + Q_OBJECT + + unsigned char* meta; + int len; + PosEdit* epos; + Q3MultiLineEdit* edit; + IntLabel* il2; + QRadioButton* hexButton; + QLabel* typeLabel; + + protected: + Q3GridLayout* layout; + + private slots: + virtual void accept(); + void toggled(bool); + void typeChanged(int); + + public: + EditMetaDialog(int tick, const Event&, + QWidget* parent=0, const char* name=0); + ~EditMetaDialog(); + static Event getEvent(int tick, const Event&, + QWidget* parent = 0); + virtual Event event(); + }; + +//--------------------------------------------------------- +// EditCAfterDialog +//--------------------------------------------------------- + +class EditCAfterDialog : public EditEventDialog { + Q_OBJECT + + PosEdit* epos; + IntLabel* il2; + + protected: + Q3GridLayout* layout; + + public: + EditCAfterDialog(int tick, const Event&, + QWidget* parent=0, const char* name=0); + static Event getEvent(int tick, const Event&, + QWidget* parent = 0); + virtual Event event(); + }; + +//--------------------------------------------------------- +// EditPAfterDialog +//--------------------------------------------------------- + +class EditPAfterDialog : public EditEventDialog { + Q_OBJECT + + PosEdit* epos; + PitchEdit* pl; + IntLabel* il2; + + protected: + Q3GridLayout* layout; + + public: + EditPAfterDialog(int tick, const Event&, + QWidget* parent=0, const char* name=0); + static Event getEvent(int tick, const Event&, + QWidget* parent = 0); + virtual Event event(); + }; + +#endif + diff --git a/muse2/muse/liste/listedit.cpp b/muse2/muse/liste/listedit.cpp new file mode 100644 index 00000000..4cdb7892 --- /dev/null +++ b/muse2/muse/liste/listedit.cpp @@ -0,0 +1,909 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: listedit.cpp,v 1.11.2.11 2009/05/24 21:43:44 terminator356 Exp $ +// (C) Copyright 1999 Werner Schweer (ws@seh.de) +//========================================================= + +#include <q3toolbar.h> +#include <qtooltip.h> +#include <qtoolbutton.h> +#include <qlayout.h> +#include <q3hbox.h> +#include <qscrollbar.h> +#include <qlabel.h> +#include <qpushbutton.h> +#include <qradiobutton.h> +#include <q3buttongroup.h> +#include <q3listbox.h> +#include <q3listview.h> +#include <q3header.h> +#include <q3popupmenu.h> +#include <qmenubar.h> +#include <qaction.h> +#include <q3accel.h> +#include <Qt3Support> +//Added by qt3to4: +#include <QKeyEvent> +#include <Q3ActionGroup> +#include <QCloseEvent> + +#include "listedit.h" +#include "mtscale.h" +#include "globals.h" +#include "icons.h" +#include "editevent.h" +#include "xml.h" +#include "pitchedit.h" +#include "song.h" +#include "audio.h" +#include "shortcuts.h" +#include "midi.h" +#include "event.h" +#include "midiport.h" +#include "midictrl.h" + +//--------------------------------------------------------- +// EventListItem +//--------------------------------------------------------- + +class EventListItem : public Q3ListViewItem { + public: + Event event; + MidiPart* part; + + EventListItem(Q3ListView* parent, Event ev, MidiPart* p) + : Q3ListViewItem(parent) { + event = ev; + part = p; + } + virtual QString text(int col) const; + virtual int compare(Q3ListViewItem* i, int col, bool ascend) const + { + EventListItem* eli = (EventListItem*)i; + switch(col) + { + case 0: + return event.tick() - eli->event.tick(); + break; + case 1: + return part->tick() + event.tick() - (eli->part->tick() + eli->event.tick()); + break; + case 2: + return key(col, ascend).localeAwareCompare(i->key(col, ascend)); + break; + case 3: + return part->track()->outChannel() - eli->part->track()->outChannel(); + break; + case 4: + return event.dataA() - eli->event.dataA(); + break; + case 5: + return event.dataB() - eli->event.dataB(); + break; + case 6: + return event.dataC() - eli->event.dataC(); + break; + case 7: + return event.lenTick() - eli->event.lenTick(); + break; + case 8: + return key(col, ascend).localeAwareCompare(i->key(col, ascend)); + break; + default: + return 0; + } + } + }; +/*--------------------------------------------------------- + * midi_meta_name + *---------------------------------------------------------*/ + +static QString midiMetaComment(const Event& ev) + { + int meta = ev.dataA(); + QString s = midiMetaName(meta); + + switch (meta) { + case 0: + case 0x2f: + case 0x51: + case 0x54: + case 0x58: + case 0x59: + case 0x74: + case 0x7f: return s; + + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 0x0a: + case 0x0b: + case 0x0c: + case 0x0d: + case 0x0e: + case 0x0f: + { + s += QString(": "); + const char* txt = (char*)(ev.data()); + int len = ev.dataLen(); + char buffer[len+1]; + memcpy(buffer, txt, len); + buffer[len] = 0; + + for (int i = 0; i < len; ++i) { + if (buffer[i] == '\n' || buffer[i] == '\r') + buffer[i] = ' '; + } + return s + QString(buffer); + } + + case 0x20: + case 0x21: + default: + { + s += QString(": "); + int i; + int len = ev.lenTick(); + int n = len > 10 ? 10 : len; + for (i = 0; i < n; ++i) { + if (i >= ev.dataLen()) + break; + s += QString(" 0x"); + QString k; + k.setNum(ev.data()[i] & 0xff, 16); + s += k; + } + if (i == 10) + s += QString("..."); + return s; + } + } + } + +//--------------------------------------------------------- +// closeEvent +//--------------------------------------------------------- + +void ListEdit::closeEvent(QCloseEvent* e) + { + emit deleted((unsigned long)this); + e->accept(); + } + +//--------------------------------------------------------- +// songChanged +//--------------------------------------------------------- + +void ListEdit::songChanged(int type) + { + if (type == 0) + return; + if (type & (SC_PART_REMOVED | SC_PART_MODIFIED + | SC_PART_INSERTED | SC_EVENT_REMOVED | SC_EVENT_MODIFIED + | SC_EVENT_INSERTED | SC_SELECTION)) { + if (type & (SC_PART_REMOVED | SC_PART_INSERTED)) + genPartlist(); + // close window if editor has no parts anymore + if (parts()->empty()) { + close(false); + return; + } + if (type == SC_SELECTION) { + bool update = false; + Q3ListViewItem* ci = 0; + for (Q3ListViewItem* i = liste->firstChild(); i; i = i->nextSibling()) { + if (i->isSelected() ^ ((EventListItem*)i)->event.selected()) { + i->setSelected(((EventListItem*)i)->event.selected()); + if (i->isSelected()) + ci = i; + update = true; + } + } + if (update) { + if (ci) + liste->setCurrentItem(ci); + liste->triggerUpdate(); + } + } + else { + curPart = 0; + curTrack = 0; + liste->clear(); + for (iPart p = parts()->begin(); p != parts()->end(); ++p) { + MidiPart* part = (MidiPart*) (p->second); + if (part->sn() == curPartId) + curPart = part; + EventList* el = part->events(); + for (iEvent i = el->begin(); i != el->end(); ++i) { + EventListItem* item = new EventListItem(liste, i->second, part); + item->setSelected(i->second.selected()); + if (item->event.tick() == (unsigned) selectedTick) { //prevent compiler warning: comparison of signed/unsigned) + liste->setCurrentItem(item); + item->setSelected(true); + liste->ensureItemVisible(item); + } + } + } + } + + // p3.3.34 + //if (curPart == 0) + // curPart = (MidiPart*)(parts()->begin()->second); + //curTrack = curPart->track(); + if(!curPart) + { + if(!parts()->empty()) + { + curPart = (MidiPart*)(parts()->begin()->second); + if(curPart) + curTrack = curPart->track(); + else + curPart = 0; + } + } + } + } + +//--------------------------------------------------------- +// text +//--------------------------------------------------------- + +QString EventListItem::text(int col) const + { + QString s; + QString commentLabel; + switch(col) { + case 0: + s.setNum(event.tick()); + break; + case 1: + { + int t = event.tick() + part->tick(); + int bar, beat; + unsigned tick; + sigmap.tickValues(t, &bar, &beat, &tick); + s.sprintf("%04d.%02d.%03d", bar+1, beat+1, tick); + } + break; + case 2: + switch(event.type()) { + case Note: + s = QString("Note"); + break; + case Controller: + { + const char* cs; + switch (midiControllerType(event.dataA())) { + case MidiController::Controller7: cs = "Ctrl7"; break; + case MidiController::Controller14: cs = "Ctrl14"; break; + case MidiController::RPN: cs = "RPN"; break; + case MidiController::NRPN: cs = "NRPN"; break; + case MidiController::Pitch: cs = "Pitch"; break; + case MidiController::Program: cs = "Program"; break; + case MidiController::RPN14: cs = "RPN14"; break; + case MidiController::NRPN14: cs = "NRPN14"; break; + default: cs = "Ctrl?"; break; + } + s = QString(cs); + } + break; + case Sysex: + { + commentLabel = QString("len "); + QString k; + k.setNum(event.dataLen()); + commentLabel += k; + commentLabel += QString(" "); + + commentLabel += nameSysex(event.dataLen(), event.data()); + int i; + for (i = 0; i < 10; ++i) { + if (i >= event.dataLen()) + break; + commentLabel += QString(" 0x"); + QString k; + k.setNum(event.data()[i] & 0xff, 16); + commentLabel += k; + } + if (i == 10) + commentLabel += QString("..."); + } + s = QString("SysEx"); + break; + case PAfter: + s = QString("PoAT"); + break; + case CAfter: + s = QString("ChAT"); + break; + case Meta: + commentLabel = midiMetaComment(event); + s = QString("Meta"); + break; + case Wave: + break; + default: + printf("unknown event type %d\n", event.type()); + } + break; + case 3: + s.setNum(part->track()->outChannel() + 1); + break; + case 4: + if (event.isNote() || event.type() == PAfter) + s = pitch2string(event.dataA()); + else if (event.type() == Controller) + s.setNum(event.dataA() & 0xffff); // mask off type bits + else + s.setNum(event.dataA()); + break; + case 5: + if(event.type() == Controller && + midiControllerType(event.dataA()) == MidiController::Program) + { + int val = event.dataB(); + int hb = ((val >> 16) & 0xff) + 1; + if (hb == 0x100) + hb = 0; + int lb = ((val >> 8) & 0xff) + 1; + if (lb == 0x100) + lb = 0; + int pr = (val & 0xff) + 1; + if (pr == 0x100) + pr = 0; + s.sprintf("%d-%d-%d", hb, lb, pr); + } + else + s.setNum(event.dataB()); + break; + case 6: + s.setNum(event.dataC()); + break; + case 7: + s.setNum(event.lenTick()); + break; + case 8: + switch(event.type()) { + case Controller: + { + MidiPort* mp = &midiPorts[part->track()->outPort()]; + MidiController* mc = mp->midiController(event.dataA()); + s = mc->name(); + } + break; + case Sysex: + { + s = QString("len "); + QString k; + k.setNum(event.dataLen()); + s += k; + s += QString(" "); + + commentLabel += nameSysex(event.dataLen(), event.data()); + int i; + for (i = 0; i < 10; ++i) { + if (i >= event.dataLen()) + break; + s += QString(" 0x"); + QString k; + k.setNum(event.data()[i] & 0xff, 16); + s += k; + } + if (i == 10) + s += QString("..."); + } + break; + case Meta: + s = midiMetaComment(event); + break; + default: + break; + } + break; + + } + return s; + } + +//--------------------------------------------------------- +// ListEdit +//--------------------------------------------------------- + +ListEdit::ListEdit(PartList* pl) + : MidiEditor(0, 0, pl) + { + insertItems = new Q3ActionGroup(this, "InsertItems", false); + insertNote = new Q3Action(tr("Insert Note"), QIcon(*note1Icon), tr("insert Note"), + 0, insertItems); + insertSysEx = new Q3Action(tr("Insert SysEx"), QIcon(*sysexIcon), tr("insert SysEx"), + 0, insertItems); + insertCtrl = new Q3Action(tr("Insert Ctrl"), QIcon(*ctrlIcon), tr("insert Ctrl"), + 0, insertItems); + insertMeta = new Q3Action(tr("Insert Meta"), QIcon(*metaIcon), tr("insert Meta"), + 0, insertItems); + insertCAfter = new Q3Action(tr("Insert Channel Aftertouch"), QIcon(*cafterIcon), tr("insert Channel Aftertouch"), + 0, insertItems); + insertPAfter = new Q3Action(tr("Insert Key Aftertouch"), QIcon(*pafterIcon), tr("insert Poly Aftertouch"), + 0, insertItems); + + connect(insertNote, SIGNAL(activated()), SLOT(editInsertNote())); + connect(insertSysEx, SIGNAL(activated()), SLOT(editInsertSysEx())); + connect(insertCtrl, SIGNAL(activated()), SLOT(editInsertCtrl())); + connect(insertMeta, SIGNAL(activated()), SLOT(editInsertMeta())); + connect(insertCAfter, SIGNAL(activated()), SLOT(editInsertCAfter())); + connect(insertPAfter, SIGNAL(activated()), SLOT(editInsertPAfter())); + + //---------Pulldown Menu---------------------------- + menuEdit = new Q3PopupMenu(this); + menuBar()->insertItem(tr("&Edit"), menuEdit); + undoRedo->addTo(menuEdit); + + Q3Accel* qa = new Q3Accel(this); + qa->connectItem(qa->insertItem(Qt::CTRL+Qt::Key_Z), song, SLOT(undo())); + qa->connectItem(qa->insertItem(Qt::CTRL+Qt::Key_Y), song, SLOT(redo())); + + menuEdit->insertSeparator(); +#if 0 + menuEdit->insertItem(tr("Cut"), EList::CMD_CUT); + menuEdit->setAccel(Qt::CTRL+Qt::Key_X, EList::CMD_CUT); + menuEdit->insertItem(tr("Copy"), EList::CMD_COPY); + menuEdit->setAccel(Qt::CTRL+Qt::Key_C, EList::CMD_COPY); + menuEdit->insertItem(tr("Paste"), EList::CMD_PASTE); + menuEdit->setAccel(Qt::CTRL+Qt::Key_V, EList::CMD_PASTE); + menuEdit->insertSeparator(); +#endif + menuEdit->insertItem(tr("Delete Events"), CMD_DELETE); + menuEdit->setAccel(Qt::Key_Delete, CMD_DELETE); + menuEdit->insertSeparator(); + + insertItems->addTo(menuEdit); + + connect(menuEdit, SIGNAL(activated(int)), SLOT(cmd(int))); + + //---------ToolBar---------------------------------- + listTools = new Q3ToolBar(this, "list-tools"); + listTools->setLabel(tr("List Tools")); + undoRedo->addTo(listTools); + Q3ToolBar* insertTools = new Q3ToolBar(this, "insert"); + insertTools->setLabel(tr("Insert Tools")); + insertItems->addTo(insertTools); + + // + //--------------------------------------------------- + // liste + //--------------------------------------------------- + // + + liste = new Q3ListView(mainw); + QFontMetrics fm(liste->font()); + int n = fm.width('9'); + int b = 24; + int c = fm.width(QString("Val B")); + int sortIndW = n * 3; + liste->setAllColumnsShowFocus(true); + liste->setSorting(0); + liste->setSelectionMode(Q3ListView::Extended); + liste->setShowSortIndicator(true); + liste->addColumn(tr("Tick"), n * 6 + b); + liste->addColumn(tr("Bar"), fm.width(QString("9999.99.999")) + b); + liste->addColumn(tr("Type"), fm.width(QString("Program")) + b); + liste->addColumn(tr("Ch"), n * 2 + b + sortIndW); + liste->addColumn(tr("Val A"), c + b + sortIndW); + liste->addColumn(tr("Val B"), c + b + sortIndW); + liste->addColumn(tr("Val C"), c + b + sortIndW); + liste->addColumn(tr("Len"), n * 4 + b + sortIndW); + liste->addColumn(tr("Comment"), fm.width(QString("MainVolume")) + 70); + liste->setResizeMode(Q3ListView::LastColumn); + connect(liste, SIGNAL(selectionChanged()), SLOT(selectionChanged())); + connect(liste, SIGNAL(doubleClicked(Q3ListViewItem*)), SLOT(doubleClicked(Q3ListViewItem*))); + //--------------------------------------------------- + // Rest + //--------------------------------------------------- + + mainGrid->setRowStretch(1, 100); + mainGrid->setColStretch(0, 100); + mainGrid->addMultiCellWidget(liste, 1, 2, 0, 0); + connect(song, SIGNAL(songChanged(int)), SLOT(songChanged(int))); + songChanged(-1); + + // p3.3.34 + // Was crashing because of -1 stored, because there was an invalid + // part pointer stored. + //curPart = (MidiPart*)(pl->begin()->second); + if(pl->empty()) + { + curPart = 0; + curPartId = -1; + } + else + { + curPart = (MidiPart*)pl->begin()->second; + if(curPart) + curPartId = curPart->sn(); + else + { + curPart = 0; + curPartId = -1; + } + } + + initShortcuts(); + } + +//--------------------------------------------------------- +// ~ListEdit +//--------------------------------------------------------- + +ListEdit::~ListEdit() + { + undoRedo->removeFrom(listTools); + } + +//--------------------------------------------------------- +// editInsertNote +//--------------------------------------------------------- + +void ListEdit::editInsertNote() + { + // p3.3.34 + if(!curPart) + return; + + Event event = EditNoteDialog::getEvent(curPart->tick(), Event(), this); + if (!event.empty()) { + //No events before beginning of part + take Part offset into consideration + unsigned tick = event.tick(); + if (tick < curPart->tick()) + tick = 0; + else + tick-= curPart->tick(); + event.setTick(tick); + // Indicate do undo, and do not handle port controller values. + //audio->msgAddEvent(event, curPart); + audio->msgAddEvent(event, curPart, true, false, false); + } + } + +//--------------------------------------------------------- +// editInsertSysEx +//--------------------------------------------------------- + +void ListEdit::editInsertSysEx() + { + // p3.3.34 + if(!curPart) + return; + + Event event = EditSysexDialog::getEvent(curPart->tick(), Event(), this); + if (!event.empty()) { + //No events before beginning of part + take Part offset into consideration + unsigned tick = event.tick(); + if (tick < curPart->tick()) + tick = 0; + else + tick-= curPart->tick(); + event.setTick(tick); + // Indicate do undo, and do not handle port controller values. + //audio->msgAddEvent(event, curPart); + audio->msgAddEvent(event, curPart, true, false, false); + } + } + +//--------------------------------------------------------- +// editInsertCtrl +//--------------------------------------------------------- + +void ListEdit::editInsertCtrl() + { + // p3.3.34 + if(!curPart) + return; + + Event event = EditCtrlDialog::getEvent(curPart->tick(), Event(), curPart, this); + if (!event.empty()) { + //No events before beginning of part + take Part offset into consideration + unsigned tick = event.tick(); + if (tick < curPart->tick()) + tick = 0; + else + tick-= curPart->tick(); + event.setTick(tick); + // Indicate do undo, and do port controller values and clone parts. + //audio->msgAddEvent(event, curPart); + audio->msgAddEvent(event, curPart, true, true, true); + } + } + +//--------------------------------------------------------- +// editInsertMeta +//--------------------------------------------------------- + +void ListEdit::editInsertMeta() + { + // p3.3.34 + if(!curPart) + return; + + Event event = EditMetaDialog::getEvent(curPart->tick(), Event(), this); + if (!event.empty()) { + //No events before beginning of part + take Part offset into consideration + unsigned tick = event.tick(); + if (tick < curPart->tick()) + tick = 0; + else + tick-= curPart->tick(); + event.setTick(tick); + // Indicate do undo, and do not handle port controller values. + //audio->msgAddEvent(event, curPart); + audio->msgAddEvent(event, curPart, true, false, false); + } + } + +//--------------------------------------------------------- +// editInsertCAfter +//--------------------------------------------------------- + +void ListEdit::editInsertCAfter() + { + // p3.3.34 + if(!curPart) + return; + + Event event = EditCAfterDialog::getEvent(curPart->tick(), Event(), this); + if (!event.empty()) { + //No events before beginning of part + take Part offset into consideration + unsigned tick = event.tick(); + if (tick < curPart->tick()) + tick = 0; + else + tick-= curPart->tick(); + event.setTick(tick); + // Indicate do undo, and do not handle port controller values. + //audio->msgAddEvent(event, curPart); + audio->msgAddEvent(event, curPart, true, false, false); + } + } + +//--------------------------------------------------------- +// editInsertPAfter +//--------------------------------------------------------- + +void ListEdit::editInsertPAfter() + { + // p3.3.34 + if(!curPart) + return; + + Event ev; + Event event = EditPAfterDialog::getEvent(curPart->tick(), ev, this); + if (!event.empty()) { + //No events before beginning of part + take Part offset into consideration + unsigned tick = event.tick(); + if (tick < curPart->tick()) + tick = 0; + else + tick-= curPart->tick(); + event.setTick(tick); + // Indicate do undo, and do not handle port controller values. + //audio->msgAddEvent(event, curPart); + audio->msgAddEvent(event, curPart, true, false, false); + } + } + +//--------------------------------------------------------- +// editEvent +//--------------------------------------------------------- + +void ListEdit::editEvent(Event& event, MidiPart* part) + { + int tick = event.tick() + part->tick(); + Event nevent; + switch(event.type()) { + case Note: + nevent = EditNoteDialog::getEvent(tick, event, this); + break; + case Controller: + nevent = EditCtrlDialog::getEvent(tick, event, part, this); + break; + case Sysex: + nevent = EditSysexDialog::getEvent(tick, event, this); + break; + case PAfter: + nevent = EditPAfterDialog::getEvent(tick, event, this); + break; + case CAfter: + nevent = EditCAfterDialog::getEvent(tick, event, this); + break; + case Meta: + nevent = EditMetaDialog::getEvent(tick, event, this); + break; + default: + return; + } + if (!nevent.empty()) { + // TODO: check for event != nevent + int tick = nevent.tick() - part->tick(); + nevent.setTick(tick); + if (tick < 0) + printf("event not in part %d - %d - %d, not changed\n", part->tick(), + nevent.tick(), part->tick() + part->lenTick()); + else + { + if(event.type() == Controller) + // Indicate do undo, and do port controller values and clone parts. + //audio->msgChangeEvent(event, nevent, part); + audio->msgChangeEvent(event, nevent, part, true, true, true); + else + // Indicate do undo, and do not do port controller values and clone parts. + //audio->msgChangeEvent(event, nevent, part); + audio->msgChangeEvent(event, nevent, part, true, false, false); + } + } + } + +//--------------------------------------------------------- +// readStatus +//--------------------------------------------------------- + +void ListEdit::readStatus(Xml& xml) + { + for (;;) { + Xml::Token token = xml.parse(); + const QString& tag = xml.s1(); + if (token == Xml::Error || token == Xml::End) + break; + switch (token) { + case Xml::TagStart: + if (tag == "midieditor") + MidiEditor::readStatus(xml); + else + xml.unknown("ListEdit"); + break; + case Xml::TagEnd: + if (tag == "listeditor") + return; + default: + break; + } + } + } + +//--------------------------------------------------------- +// writeStatus +//--------------------------------------------------------- + +void ListEdit::writeStatus(int level, Xml& xml) const + { + writePartList(level, xml); + xml.tag(level++, "listeditor"); + MidiEditor::writeStatus(level, xml); + xml.tag(level, "/listeditor"); + } + +//--------------------------------------------------------- +// selectionChanged +//--------------------------------------------------------- + +void ListEdit::selectionChanged() + { + bool update = false; + for (Q3ListViewItem* i = liste->firstChild(); i; i = i->nextSibling()) { + if (i->isSelected() ^ ((EventListItem*)i)->event.selected()) { + ((EventListItem*)i)->event.setSelected(i->isSelected()); + update = true; + } + } + if (update) + song->update(SC_SELECTION); + } + +//--------------------------------------------------------- +// doubleClicked +//--------------------------------------------------------- + +void ListEdit::doubleClicked(Q3ListViewItem* item) + { + EventListItem* ev = (EventListItem*) item; + editEvent(ev->event, ev->part); + } + +//--------------------------------------------------------- +// cmd +//--------------------------------------------------------- + +void ListEdit::cmd(int cmd) + { + switch(cmd) { + case CMD_DELETE: + bool found = false; + for (Q3ListViewItem* i = liste->firstChild(); i; i = i->nextSibling()) + { + EventListItem *item = (EventListItem *) i; + if (i->isSelected() || item->event.selected()) + { + found = true; + break; + } + } + if(!found) + break; + song->startUndo(); + + EventListItem *deletedEvent=NULL; + for (Q3ListViewItem* i = liste->firstChild(); i; i = i->nextSibling()) { + EventListItem *item = (EventListItem *) i; + + if (i->isSelected() || item->event.selected()) { + deletedEvent=item; + // Indicate no undo, and do port controller values and clone parts. + //audio->msgDeleteEvent(item->event, item->part, false); + audio->msgDeleteEvent(item->event, item->part, false, true, true); + } + } + + unsigned int nextTick=0; + // find biggest tick + for (Q3ListViewItem* i = liste->firstChild(); i; i = i->nextSibling()) { + EventListItem *item = (EventListItem *) i; + if (item->event.tick() > nextTick && item != deletedEvent) + nextTick=item->event.tick(); + } + // check if there's a tick that is "just" bigger than the deleted + for (Q3ListViewItem* i = liste->firstChild(); i; i = i->nextSibling()) { + EventListItem *item = (EventListItem *) i; + if (item->event.tick() >= deletedEvent->event.tick() && + item->event.tick() < nextTick && + item != deletedEvent ) { + nextTick=item->event.tick(); + } + } + selectedTick=nextTick; + song->endUndo(SC_EVENT_MODIFIED); + //printf("selected tick = %d\n", selectedTick); + //emit selectionChanged(); + break; + } + } + +//--------------------------------------------------------- +// configChanged +//--------------------------------------------------------- + +void ListEdit::configChanged() + { + initShortcuts(); + } + +//--------------------------------------------------------- +// initShortcuts +//--------------------------------------------------------- + +void ListEdit::initShortcuts() + { + insertNote->setAccel(shortcuts[SHRT_LE_INS_NOTES].key); + insertSysEx->setAccel(shortcuts[SHRT_LE_INS_SYSEX].key); + insertCtrl->setAccel(shortcuts[SHRT_LE_INS_CTRL].key); + insertMeta->setAccel(shortcuts[SHRT_LE_INS_META].key); + insertCAfter->setAccel(shortcuts[SHRT_LE_INS_CHAN_AFTERTOUCH].key); + insertPAfter->setAccel(shortcuts[SHRT_LE_INS_POLY_AFTERTOUCH].key); + } + +//--------------------------------------------------------- +// viewKeyPressEvent +//--------------------------------------------------------- + +void ListEdit::keyPressEvent(QKeyEvent* event) + { +int key = event->key(); +if (key == Qt::Key_Escape) { + close(); + return; + } + } diff --git a/muse2/muse/liste/listedit.h b/muse2/muse/liste/listedit.h new file mode 100644 index 00000000..efa0a591 --- /dev/null +++ b/muse2/muse/liste/listedit.h @@ -0,0 +1,81 @@ +//========================================================= +// MusE +// Linux Music Editor +// $Id: listedit.h,v 1.3.2.3 2006/09/19 22:03:33 spamatica Exp $ +// (C) Copyright 1999 Werner Schweer (ws@seh.de) +//========================================================= + +#ifndef __LIST_EDIT_H__ +#define __LIST_EDIT_H__ + +#include "midieditor.h" +#include "noteinfo.h" +#include "cobject.h" +//Added by qt3to4: +#include <Q3PopupMenu> +#include <QKeyEvent> +#include <QCloseEvent> +#include <Q3ActionGroup> +#include <Qt3Support> + +class Event; +class MidiTrack; +class PartList; +class MidiPart; +class MidiPart; +class Xml; +class Q3ActionGroup; +class QAction; +class Q3ListView; +class Q3ListViewItem; + +//--------------------------------------------------------- +// ListEdit +//--------------------------------------------------------- + +class ListEdit : public MidiEditor { + Q3ListView* liste; + Q3PopupMenu* menuEdit; + Q3ActionGroup* insertItems; + Q3ToolBar* listTools; + MidiTrack* curTrack; + MidiPart* curPart; + int selectedTick; + int curPartId; + + enum { CMD_DELETE }; + + Q_OBJECT + virtual void closeEvent(QCloseEvent*); + virtual void keyPressEvent(QKeyEvent*); + void initShortcuts(); + Q3Action *insertNote, *insertSysEx, *insertCtrl, *insertMeta, *insertCAfter, *insertPAfter; + + private slots: + void editInsertNote(); + void editInsertSysEx(); + void editInsertCtrl(); + void editInsertMeta(); + void editInsertCAfter(); + void editInsertPAfter(); + void editEvent(Event&, MidiPart*); + void selectionChanged(); + void doubleClicked(Q3ListViewItem*); + void cmd(int cmd); + void configChanged(); + + public slots: + void songChanged(int); + + signals: + void deleted(unsigned long); + + public: + ListEdit(PartList*); + ~ListEdit(); + virtual void readStatus(Xml&); + virtual void writeStatus(int, Xml&) const; + }; + +#endif + |