diff options
Diffstat (limited to 'attic/muse2-oom/muse2/muse/mplugins')
19 files changed, 0 insertions, 6390 deletions
diff --git a/attic/muse2-oom/muse2/muse/mplugins/.cvsignore b/attic/muse2-oom/muse2/muse/mplugins/.cvsignore deleted file mode 100644 index 66e962c6..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -mrconfigbase.h -midifilter.h diff --git a/attic/muse2-oom/muse2/muse/mplugins/CMakeLists.txt b/attic/muse2-oom/muse2/muse/mplugins/CMakeLists.txt deleted file mode 100644 index a6db14f6..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/CMakeLists.txt +++ /dev/null @@ -1,109 +0,0 @@ -#============================================================================= -# MusE -# Linux Music Editor -# $Id:$ -# -# Copyright (C) 2002-2006 by Werner Schweer and others -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License version 2. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#============================================================================= - -## -## Expand Qt macros in source files -## -if ( ENABLE_EXPERIMENTAL ) - QT4_WRAP_UI ( mplugins_experimental_uis rhythmbase.ui) - set ( experimental_hdrs rhythm.h ) - set ( experimental_srcs - rhythm.cpp - ${mplugins_experimental_uis} - ) -endif ( ENABLE_EXPERIMENTAL ) -QT4_WRAP_CPP ( mplugins_mocs - midifilterimpl.h - midiitransform.h - mittranspose.h - mrconfig.h - ${experimental_hdrs} - ) - -## -## UI files -## -file (GLOB mplugins_ui_files - midifilter.ui - mrconfigbase.ui - ) -QT4_WRAP_UI ( mplugins_uis ${mplugins_ui_files} ) - -## -## List of source files to compile -## -file (GLOB mplugins_source_files - midifilterimpl.cpp - midiitransform.cpp - mitplugin.cpp - mittranspose.cpp - mrconfig.cpp - random.cpp - ) - -## -## Define target -## -add_library ( mplugins SHARED - ${mplugins_source_files} - ${mplugins_mocs} - ${mplugins_uis} - ${experimental_srcs} - ) - -## -## Append to the list of translations -## -set (FILES_TO_TRANSLATE - ${FILES_TO_TRANSLATE} - ${mplugins_source_files} - ${mplugins_ui_files} - CACHE INTERNAL "" - ) - -## -## Compilation flags and target name -## -# - tell cmake to name target transform.so instead of -# libtransform.so -# - use precompiled header files -# -set_target_properties ( mplugins - # PROPERTIES PREFIX "" - PROPERTIES COMPILE_FLAGS "-include ${PROJECT_BINARY_DIR}/all.h -fPIC" - OUTPUT_NAME muse_mplugins - ) - -## -## Linkage -## -target_link_libraries( mplugins - # midiplugin - ${QT_LIBRARIES} - widgets - ) - -## -## Install location -## -install(TARGETS mplugins - DESTINATION ${MusE_MODULES_DIR} - ) - diff --git a/attic/muse2-oom/muse2/muse/mplugins/midifilter.ui b/attic/muse2-oom/muse2/muse/mplugins/midifilter.ui deleted file mode 100644 index 529f893a..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/midifilter.ui +++ /dev/null @@ -1,730 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>MidiFilterConfigBase</class> - <widget class="QDialog" name="MidiFilterConfigBase"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>348</width> - <height>431</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="windowTitle"> - <string>MusE: Midi Input Filter</string> - </property> - <layout class="QGridLayout"> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <item row="0" column="0"> - <widget class="QGroupBox" name="GroupBoxx"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Record Filter</string> - </property> - <layout class="QVBoxLayout"> - <property name="spacing"> - <number>6</number> - </property> - <property name="margin"> - <number>11</number> - </property> - <item> - <widget class="QCheckBox" name="rf1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Note On</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="rf2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Poly Pressure</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="rf3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Controller</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="rf4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Program Change</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="rf5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>After Touch</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="rf6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Pitch Bend</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="rf7"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Sysex</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="0" column="1"> - <widget class="QGroupBox" name="GroupBox2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Thru Filter</string> - </property> - <layout class="QVBoxLayout"> - <property name="spacing"> - <number>6</number> - </property> - <property name="margin"> - <number>11</number> - </property> - <item> - <widget class="QCheckBox" name="tf1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Note On</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="tf2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Poly Pressure</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="tf3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Controller</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="tf4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Preferred"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Program Change</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="tf5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>After Touch</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="tf6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Pitch Bend</string> - </property> - </widget> - </item> - <item> - <widget class="QCheckBox" name="tf7"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Fixed"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string>Sysex</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item row="1" column="1"> - <widget class="QGroupBox" name="GroupBox4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Controller Filter</string> - </property> - <layout class="QVBoxLayout"> - <property name="spacing"> - <number>6</number> - </property> - <property name="margin"> - <number>11</number> - </property> - <item> - <widget class="CtrlComboBox" name="cb1" native="true"/> - </item> - <item> - <widget class="CtrlComboBox" name="cb2" native="true"/> - </item> - <item> - <widget class="CtrlComboBox" name="cb3" native="true"/> - </item> - <item> - <widget class="CtrlComboBox" name="cb4" native="true"/> - </item> - </layout> - </widget> - </item> - <item row="1" column="0"> - <widget class="QGroupBox" name="ButtonGroup1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="title"> - <string>Channel Filter</string> - </property> - <layout class="QGridLayout"> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>3</number> - </property> - <item row="3" column="1"> - <widget class="QPushButton" name="cf14"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="2" column="1"> - <widget class="QPushButton" name="cf10"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QPushButton" name="cf6"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QPushButton" name="cf12"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="0" column="3"> - <widget class="QPushButton" name="cf4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QPushButton" name="cf2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QPushButton" name="cf9"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QPushButton" name="cf8"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QPushButton" name="cf3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QPushButton" name="cf13"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="3" column="2"> - <widget class="QPushButton" name="cf15"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="3" column="3"> - <widget class="QPushButton" name="cf16"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="1" column="2"> - <widget class="QPushButton" name="cf7"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Preferred"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QPushButton" name="cf11"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Preferred" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QPushButton" name="cf5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QPushButton" name="cf1"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <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="checkable"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <layoutdefault spacing="6" margin="11"/> - <customwidgets> - <customwidget> - <class>CtrlComboBox</class> - <extends>QWidget</extends> - <header location="global">ctrlcombo.h</header> - </customwidget> - </customwidgets> - <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> - <includes> - <include location="local">ctrlcombo.h</include> - </includes> - <resources/> - <connections/> -</ui> diff --git a/attic/muse2-oom/muse2/muse/mplugins/midifilterimpl.cpp b/attic/muse2-oom/muse2/muse/mplugins/midifilterimpl.cpp deleted file mode 100644 index 196ce97c..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/midifilterimpl.cpp +++ /dev/null @@ -1,130 +0,0 @@ -//========================================================= -// 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 <QDialog> -#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(QDialog* parent) - : QDialog(parent) - { - setupUi(this); - cb1->setCurrentIndex(midiFilterCtrl1); - cb2->setCurrentIndex(midiFilterCtrl2); - cb3->setCurrentIndex(midiFilterCtrl3); - cb4->setCurrentIndex(midiFilterCtrl4); - - rf1->setChecked(midiRecordType & 1); - rf2->setChecked(midiRecordType & 2); - rf3->setChecked(midiRecordType & 4); - rf4->setChecked(midiRecordType & 8); - rf5->setChecked(midiRecordType & 16); - rf6->setChecked(midiRecordType & 32); - rf7->setChecked(midiRecordType & 64); - 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->setChecked(midiInputChannel & 1); - cf2->setChecked(midiInputChannel & 2); - cf3->setChecked(midiInputChannel & 4); - cf4->setChecked(midiInputChannel & 8); - cf5->setChecked(midiInputChannel & 0x10); - cf6->setChecked(midiInputChannel & 0x20); - cf7->setChecked(midiInputChannel & 0x40); - cf8->setChecked(midiInputChannel & 0x80); - cf9->setChecked(midiInputChannel & 0x100); - cf10->setChecked(midiInputChannel & 0x200); - cf11->setChecked(midiInputChannel & 0x400); - cf12->setChecked(midiInputChannel & 0x800); - cf13->setChecked(midiInputChannel & 0x1000); - cf14->setChecked(midiInputChannel & 0x2000); - cf15->setChecked(midiInputChannel & 0x4000); - cf16->setChecked(midiInputChannel & 0x8000); - - 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/attic/muse2-oom/muse2/muse/mplugins/midifilterimpl.h b/attic/muse2-oom/muse2/muse/mplugins/midifilterimpl.h deleted file mode 100644 index bbda7757..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/midifilterimpl.h +++ /dev/null @@ -1,92 +0,0 @@ -//========================================================= -// 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 "ui_midifilter.h" - -class QCloseEvent; - -//--------------------------------------------------------- -// MidiFilterConfig -//--------------------------------------------------------- - -class MidiFilterConfig : public QDialog, public Ui::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(QDialog* parent=0); - }; - -#endif - - diff --git a/attic/muse2-oom/muse2/muse/mplugins/midiitransform.cpp b/attic/muse2-oom/muse2/muse/mplugins/midiitransform.cpp deleted file mode 100644 index 6ab584d3..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/midiitransform.cpp +++ /dev/null @@ -1,1722 +0,0 @@ -//========================================================= -// 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 <QCloseEvent> - -#include <QButtonGroup> -#include <QDialog> -#include <QListWidgetItem> - -#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 "globals.h" -#include "gconfig.h" -//#include "comboQuant.h" -//#include "pitchedit.h" -#include "helper.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) - { - if(debugMsg) - 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(QDialog* parent, Qt::WFlags fl) - : QDialog(parent, fl) - { - setupUi(this); - cindex = 0; - cmodul = 0; - cmt = 0; - - modulGroup = new QButtonGroup; - modulGroup->addButton(modul1select,0); - modulGroup->addButton(modul2select,1); - modulGroup->addButton(modul3select,2); - modulGroup->addButton(modul4select,3); - - for (unsigned i = 0; i < sizeof(oplist)/sizeof(*oplist); ++i) - funcOp->insertItem(i, oplist[i].text); - - 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(itemActivated(QListWidgetItem*)), - SLOT(presetChanged(QListWidgetItem*))); - 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(buttonClicked(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(); - presetList->setCurrentItem(presetList->item(0)); - presetChanged(presetList->item(0)); - 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->setChecked(true); - for (iMidiInputTransformation i = mtlist.begin(); i != mtlist.end(); ++i) { - presetList->addItem((*i)->name); - if (cmt == 0) - cmt = *i; - } - if (cmt == 0) { - // create default "New" preset - cmt = new MidiInputTransformation(tr("New")); - mtlist.push_back(cmt); - presetList->addItem(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.toLatin1().constData(), 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(); - } - -//--------------------------------------------------------- -// 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->setDecimals(2); - procVal1b->setEnabled(false); - break; - case Plus: - case Minus: - case Fix: - case Value: - case Flip: - procVal1a->setDecimals(0); - procVal1a->setEnabled(true); - procVal1b->setEnabled(false); - break; - case Random: - case ScaleMap: - case Dynamic: - procVal1a->setDecimals(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->setDecimals(2); - procVal2b->setEnabled(false); - break; - case Plus: - case Minus: - case Fix: - case Value: - procVal2a->setDecimals(0); - procVal2a->setEnabled(true); - procVal2b->setEnabled(false); - break; - case Random: - case Dynamic: - procVal2a->setDecimals(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); - QListWidgetItem* lbi = new QListWidgetItem(name); - presetList->addItem(lbi); - mtlist.push_back(mt); - presetList->setCurrentItem(lbi); - presetChanged(lbi); - } - -//--------------------------------------------------------- -// presetDelete -//--------------------------------------------------------- - -void MidiInputTransformDialog::presetDelete() - { - if (cindex != -1) { - iMidiInputTransformation mt = mtlist.begin(); - for (int i = 0; i < cindex; ++i, ++mt) { - mtlist.erase(mt); - presetList->setCurrentItem(presetList->item(cindex - 1)); - presetList->takeItem(cindex); - presetChanged(presetList->item(cindex - 1)); - break; - } - } - } - -//--------------------------------------------------------- -// nameChanged -//--------------------------------------------------------- - -void MidiInputTransformDialog::nameChanged(const QString& s) - { - cmt->name = s; - QListWidgetItem* item = presetList->item(cindex); - if (s != item->text()) { - disconnect(presetList, SIGNAL(itemActivated(QListWidgetItem*)), - this, SLOT(presetChanged(QListWidgetItem*))); - presetList->insertItem(cindex, s); - presetList->takeItem(cindex+1); - presetList->setCurrentItem(presetList->item(cindex)); - connect(presetList, SIGNAL(itemActivated(QListWidgetItem*)), - SLOT(presetChanged(QListWidgetItem*))); - } - } - -//--------------------------------------------------------- -// commentChanged -//--------------------------------------------------------- - -void MidiInputTransformDialog::commentChanged() - { - cmt->comment = commentEntry->toPlainText(); - } - -//--------------------------------------------------------- -// selVal1aChanged -//--------------------------------------------------------- - -void MidiInputTransformDialog::selVal1aChanged(int val) - { - cmt->selVal1a = val; - if ((cmt->selEventOp != All) - && (cmt->selType == MIDITRANSFORM_NOTE)) { - selVal1a->setSuffix(" - " + pitch2string(val)); - } - else - { - if(!selVal1a->suffix().isEmpty()) - 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 - { - if(!selVal1b->suffix().isEmpty()) - 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 - { - if(!procVal1a->suffix().isEmpty()) - 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 - { - if(!procVal1b->suffix().isEmpty()) - 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->setDecimals(2); - procPortValb->setEnabled(false); - break; - case Plus: - case Minus: - case Fix: - case Value: - case Flip: - procPortVala->setDecimals(0); - procPortVala->setEnabled(true); - procPortValb->setEnabled(false); - break; - case Random: - case ScaleMap: - case Dynamic: - procPortVala->setDecimals(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->setDecimals(2); - procChannelValb->setEnabled(false); - break; - case Plus: - case Minus: - case Fix: - case Value: - case Flip: - procChannelVala->setDecimals(0); - procChannelVala->setEnabled(true); - procChannelValb->setEnabled(false); - break; - case Random: - case ScaleMap: - case Dynamic: - procChannelVala->setDecimals(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(presetList->item(idx)); - break; - } - } - if (i == mtlist.end()) - printf("change to unknown transformation!\n"); - } - } - -//--------------------------------------------------------- -// presetChanged -//--------------------------------------------------------- - -void MidiInputTransformDialog::presetChanged(QListWidgetItem* item) - { - cindex = presetList->row(item); - - //--------------------------------------------------- - // search transformation in list and set - // cmt - //--------------------------------------------------- - - iMidiInputTransformation i; - for (i = mtlist.begin(); i != mtlist.end(); ++i) { - if (item->text() == (*i)->name) { - if(debugMsg) - printf("found %s\n", (*i)->name.toLatin1().constData()); - 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->setCurrentIndex(cmt->selEventOp); - selEventOpSel(cmt->selEventOp); - - for (unsigned i = 0; i < sizeof(selTypeTable)/sizeof(*selTypeTable); ++i) { - if (selTypeTable[i] == cmt->selType) { - selType->setCurrentIndex(i); - break; - } - } - - selVal1Op->setCurrentIndex(cmt->selVal1); - selVal1OpSel(cmt->selVal1); - - selVal2Op->setCurrentIndex(cmt->selVal2); - selVal2OpSel(cmt->selVal2); - - selPortOp->setCurrentIndex(cmt->selPort); - selPortOpSel(cmt->selPort); - - selChannelOp->setCurrentIndex(cmt->selChannel); - selChannelOpSel(cmt->selChannel); - - { - unsigned i; - for (i = 0; i < sizeof(oplist)/sizeof(*oplist); ++i) { - if (oplist[i].id == cmt->funcOp) { - funcOp->setCurrentIndex(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->setCurrentIndex(i); - break; - } - } - - procEventOp->setCurrentIndex(cmt->procEvent); - procEventOpSel(cmt->procEvent); - - procVal1Op->setCurrentIndex(cmt->procVal1); - procVal1OpSel(cmt->procVal1); - - for (unsigned i = 0; i < sizeof(procVal2Map)/sizeof(*procVal2Map); ++i) { - if (procVal2Map[i] == cmt->procVal2) { - procVal2Op->setCurrentIndex(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->setCurrentIndex(cmt->procPort); - procPortOpSel(cmt->procPort); - - procChannelOp->setCurrentIndex(cmt->procChannel); - procChannelOpSel(cmt->procChannel); - - } - diff --git a/attic/muse2-oom/muse2/muse/mplugins/midiitransform.h b/attic/muse2-oom/muse2/muse/mplugins/midiitransform.h deleted file mode 100644 index b9288319..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/midiitransform.h +++ /dev/null @@ -1,102 +0,0 @@ -//========================================================= -// 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 "ui_itransformbase.h" - -#include <QCloseEvent> - -class QButtonGroup; -class MidiTransformation; -class MidiInputTransformation; -class MidiRecordEvent; -class MidiPart; -class Xml; - -#include "miditransform.h" - -enum InputTransformProcEventOp { KeepType, FixType }; - -//--------------------------------------------------------- -// MidiInputTransform -//--------------------------------------------------------- - -class MidiInputTransformDialog : public QDialog, public Ui::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(); - QButtonGroup* modulGroup; - - 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(QListWidgetItem*); - 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(QDialog* parent = 0, 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/attic/muse2-oom/muse2/muse/mplugins/mitplugin.cpp b/attic/muse2-oom/muse2/muse/mplugins/mitplugin.cpp deleted file mode 100644 index e1a4e656..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/mitplugin.cpp +++ /dev/null @@ -1,156 +0,0 @@ -//========================================================= -// 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 "mitplugin.h" -#include "app.h" -#include "event.h" -#include "xml.h" - -#include "midiitransform.h" -#include "mittranspose.h" -#include "midifilterimpl.h" -#include "mrconfig.h" - -#ifdef BUILD_EXPERIMENTAL -#include "rhythm.h" -#endif - -MITPluginList mitPlugins; - -//--------------------------------------------------------- -// startMidiInputPlugin -//--------------------------------------------------------- - -void MusE::startMidiInputPlugin(int id) - { - bool flag = false; - QWidget* w = 0; - QAction* act; - if (id == 0) { - if (!mitPluginTranspose) { - mitPluginTranspose = new MITPluginTranspose(); - mitPlugins.push_back(mitPluginTranspose); - connect(mitPluginTranspose, SIGNAL(hideWindow()), - SLOT(hideMitPluginTranspose())); - } - w = mitPluginTranspose; - act = midiTrpAction; - } - else if (id == 1) { - if (!midiInputTransform) { - midiInputTransform = new MidiInputTransformDialog(); - connect(midiInputTransform, SIGNAL(hideWindow()), - SLOT(hideMidiInputTransform())); - } - w = midiInputTransform; - act = midiInputTrfAction; - } - else if (id == 2) { - if (!midiFilterConfig) { - midiFilterConfig = new MidiFilterConfig(); - connect(midiFilterConfig, SIGNAL(hideWindow()), - SLOT(hideMidiFilterConfig())); - } - w = midiFilterConfig; - act = midiInputFilterAction; - } - else if (id == 3) { - if (!midiRemoteConfig) { - midiRemoteConfig = new MRConfig(); - connect(midiRemoteConfig, SIGNAL(hideWindow()), - SLOT(hideMidiRemoteConfig())); - } - w = midiRemoteConfig; - act = midiRemoteAction; - } -#ifdef BUILD_EXPERIMENTAL - else if (id == 4) { - if (!midiRhythmGenerator) { - midiRhythmGenerator = new RhythmGen(); - connect(midiRhythmGenerator, SIGNAL(hideWindow()), - SLOT(hideMidiRhythmGenerator())); - } - w = midiRhythmGenerator; - act = midiRhythmAction; - } -#endif - if (w) { - flag = !w->isVisible(); - if (flag) - w->show(); - else - w->hide(); - } - act->setChecked(flag); - } - -void MusE::hideMitPluginTranspose() - { - midiTrpAction->setChecked(false); - } -void MusE::hideMidiInputTransform() - { - midiInputTrfAction->setChecked(false); - } -void MusE::hideMidiFilterConfig() - { - midiInputFilterAction->setChecked(false); - } -void MusE::hideMidiRemoteConfig() - { - midiRemoteAction->setChecked(false); - } -#ifdef BUILD_EXPERIMENTAL -void MusE::hideMidiRhythmGenerator() - { - midiRhythmAction->setChecked(false); - } -#endif - -//--------------------------------------------------------- -// 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; - 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/attic/muse2-oom/muse2/muse/mplugins/mitplugin.h b/attic/muse2-oom/muse2/muse/mplugins/mitplugin.h deleted file mode 100644 index a7ab3729..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/mitplugin.h +++ /dev/null @@ -1,39 +0,0 @@ -//========================================================= -// 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/attic/muse2-oom/muse2/muse/mplugins/mittranspose.cpp b/attic/muse2-oom/muse2/muse/mplugins/mittranspose.cpp deleted file mode 100644 index 4aeaf046..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/mittranspose.cpp +++ /dev/null @@ -1,178 +0,0 @@ -//========================================================= -// 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 <QCloseEvent> -#include <QTimer> - -#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, Qt::WFlags fl) - : QWidget(parent, fl) - { - setupUi(this); - 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/attic/muse2-oom/muse2/muse/mplugins/mittranspose.h b/attic/muse2-oom/muse2/muse/mplugins/mittranspose.h deleted file mode 100644 index fcbc96e3..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/mittranspose.h +++ /dev/null @@ -1,70 +0,0 @@ -//========================================================= -// 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 "ui_mittransposebase.h" -#include <list> - -class 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 QWidget, public Ui::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, 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/attic/muse2-oom/muse2/muse/mplugins/mrconfig.cpp b/attic/muse2-oom/muse2/muse/mplugins/mrconfig.cpp deleted file mode 100644 index f64384af..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/mrconfig.cpp +++ /dev/null @@ -1,71 +0,0 @@ -//========================================================= -// 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 <QCloseEvent> - -//--------------------------------------------------------- -// MRConfig -// Midi Remote Control Config -//--------------------------------------------------------- - -MRConfig::MRConfig(QWidget* parent, Qt::WFlags fl) - : QWidget(parent, fl) - { - setupUi(this); - b1->setChecked(rcEnable); - sb1->setValue(rcStopNote); - sb2->setValue(rcRecordNote); - sb3->setValue(rcGotoLeftMarkNote); - sb4->setValue(rcPlayNote); - - 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/attic/muse2-oom/muse2/muse/mplugins/mrconfig.h b/attic/muse2-oom/muse2/muse/mplugins/mrconfig.h deleted file mode 100644 index e829c15c..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/mrconfig.h +++ /dev/null @@ -1,41 +0,0 @@ -//========================================================= -// 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 "ui_mrconfigbase.h" - -class QCloseEvent; -class QWidget; - -//--------------------------------------------------------- -// MRConfig -//--------------------------------------------------------- - -class MRConfig : public QWidget, public Ui::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, Qt::WFlags fl = 0); - }; - -#endif - diff --git a/attic/muse2-oom/muse2/muse/mplugins/mrconfigbase.ui b/attic/muse2-oom/muse2/muse/mplugins/mrconfigbase.ui deleted file mode 100644 index ed04c334..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/mrconfigbase.ui +++ /dev/null @@ -1,191 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>MRConfigBase</class> - <widget class="QWidget" name="MRConfigBase"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>298</width> - <height>249</height> - </rect> - </property> - <property name="windowTitle"> - <string>MusE: Midi Input Plugin: Remote Control</string> - </property> - <layout class="QVBoxLayout"> - <property name="spacing"> - <number>6</number> - </property> - <property name="margin"> - <number>11</number> - </property> - <item> - <widget class="QGroupBox" name="GroupBox2"> - <property name="title"> - <string>Activate</string> - </property> - <layout class="QHBoxLayout"> - <property name="spacing"> - <number>6</number> - </property> - <property name="margin"> - <number>11</number> - </property> - <item> - <widget class="QCheckBox" name="b1"> - <property name="text"> - <string>On</string> - </property> - </widget> - </item> - </layout> - </widget> - </item> - <item> - <widget class="QGroupBox" name="GroupBox1"> - <property name="title"> - <string>Actions</string> - </property> - <layout class="QGridLayout"> - <property name="margin"> - <number>11</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <item row="0" column="0"> - <widget class="QLabel" name="TextLabel1"> - <property name="text"> - <string>Stop</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="TextLabel2"> - <property name="text"> - <string>Record</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="2" column="0"> - <widget class="QLabel" name="TextLabel3"> - <property name="text"> - <string>Goto Left Mark</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="3" column="0"> - <widget class="QLabel" name="TextLabel4"> - <property name="text"> - <string>Play</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="PitchEdit" name="sb1" native="true"/> - </item> - <item row="1" column="1"> - <widget class="PitchEdit" name="sb2" native="true"/> - </item> - <item row="2" column="1"> - <widget class="PitchEdit" name="sb3" native="true"/> - </item> - <item row="3" column="1"> - <widget class="PitchEdit" name="sb4" native="true"/> - </item> - <item row="0" column="2"> - <spacer name="Spacer1"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="1" column="2"> - <spacer name="Spacer2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="2" column="2"> - <spacer name="Spacer3"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item row="3" column="2"> - <spacer name="Spacer4"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - </layout> - </widget> - </item> - </layout> - </widget> - <layoutdefault spacing="6" margin="11"/> - <customwidgets> - <customwidget> - <class>PitchEdit</class> - <extends>QWidget</extends> - <header>pitchedit.h</header> - </customwidget> - </customwidgets> - <includes> - <include location="local">pitchedit.h</include> - </includes> - <resources/> - <connections/> -</ui> diff --git a/attic/muse2-oom/muse2/muse/mplugins/random.cpp b/attic/muse2-oom/muse2/muse/mplugins/random.cpp deleted file mode 100644 index 5360d6b8..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/random.cpp +++ /dev/null @@ -1,758 +0,0 @@ -//========================================================= -// 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/attic/muse2-oom/muse2/muse/mplugins/random.h b/attic/muse2-oom/muse2/muse/mplugins/random.h deleted file mode 100644 index 2c9dfe5b..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/random.h +++ /dev/null @@ -1,192 +0,0 @@ -//========================================================= -// 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/attic/muse2-oom/muse2/muse/mplugins/rhythm.cpp b/attic/muse2-oom/muse2/muse/mplugins/rhythm.cpp deleted file mode 100644 index 0fe2ba16..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/rhythm.cpp +++ /dev/null @@ -1,514 +0,0 @@ -//========================================================= -// 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" - -//--------------------------------------------------------- -// RhythmGen -//--------------------------------------------------------- - -RhythmGen::RhythmGen(QWidget* parent, Qt::WFlags fo) - : QMainWindow(parent, fo) - { - setupUi(this); - } -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 <QCloseEvent> -#include <QHBoxLayout> -#include <QVBoxLayout> -#include <QVariant> -#include <QCheckBox> -#include <QFrame> -#include <QLabel> -#include <QLCDNumber> -#include <QPushButton> -#include <QSlider> -#include <QToolButton> -#include <QLayout> -#include <QToolTip> -#include <QImage> -#include <QPixmap> - -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 QFrame( this); - Frame6->setFrameShape( QFrame::StyledPanel ); - Frame6->setFrameShadow( QFrame::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 QFrame( this ); - Frame5->setFrameShape( QFrame::StyledPanel ); - Frame5->setFrameShadow( QFrame::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 QFrame( this ); - Frame5_2->setFrameShape( QFrame::StyledPanel ); - Frame5_2->setFrameShadow( QFrame::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 QFrame( this ); - Frame6_2->setMinimumSize( QSize( 200, 150 ) ); - Frame6_2->setFrameShape( QFrame::StyledPanel ); - Frame6_2->setFrameShadow( QFrame::Raised ); - Layout29->addWidget( Frame6_2 ); - - Frame7 = new QFrame( this ); - Frame7->setMinimumSize( QSize( 200, 150 ) ); - Frame7->setFrameShape( QFrame::StyledPanel ); - Frame7->setFrameShadow( QFrame::Raised ); - Layout29->addWidget( Frame7 ); - RhythmGeneratorLayout->addLayout( Layout29 ); - - Frame8 = new QFrame( this ); - Frame8->setMinimumSize( QSize( 400, 150 ) ); - Frame8->setFrameShape( QFrame::StyledPanel ); - Frame8->setFrameShadow( QFrame::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/attic/muse2-oom/muse2/muse/mplugins/rhythm.h b/attic/muse2-oom/muse2/muse/mplugins/rhythm.h deleted file mode 100644 index eb8d00dd..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/rhythm.h +++ /dev/null @@ -1,198 +0,0 @@ -//========================================================= -// 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 "ui_rhythmbase.h" - -#include <QMainWindow> - -class 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 QMainWindow, public Ui::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, Qt::WFlags fo = Qt::Window); - virtual ~RhythmGen(); -// void OnPaint(); -// void GenRhythm(); -// bool OnClose(); - }; - -#endif - diff --git a/attic/muse2-oom/muse2/muse/mplugins/rhythmbase.ui b/attic/muse2-oom/muse2/muse/mplugins/rhythmbase.ui deleted file mode 100644 index 21373690..00000000 --- a/attic/muse2-oom/muse2/muse/mplugins/rhythmbase.ui +++ /dev/null @@ -1,1095 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<ui version="4.0"> - <class>RhythmBase</class> - <widget class="QMainWindow" name="RhythmBase"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>465</width> - <height>605</height> - </rect> - </property> - <property name="windowTitle"> - <string>MusE: Random Rhythm Generator</string> - </property> - <widget class="QWidget" name="widget"> - <property name="geometry"> - <rect> - <x>0</x> - <y>59</y> - <width>465</width> - <height>546</height> - </rect> - </property> - <layout class="QGridLayout"> - <property name="margin"> - <number>6</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <item row="1" column="0"> - <widget class="QGroupBox" name="GroupBox1"> - <property name="title"> - <string>Instrument Properties</string> - </property> - <layout class="QVBoxLayout"> - <property name="spacing"> - <number>6</number> - </property> - <property name="margin"> - <number>11</number> - </property> - <item> - <layout class="QGridLayout"> - <property name="margin"> - <number>0</number> - </property> - <property name="spacing"> - <number>6</number> - </property> - <item row="1" column="2"> - <widget class="QLabel" name="TextLabel2_3_2"> - <property name="text"> - <string>counts/bar</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="0" column="2"> - <widget class="QLabel" name="TextLabel3_2"> - <property name="text"> - <string>steps/count</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="2" column="2"> - <widget class="QLabel" name="TextLabel1_2_2"> - <property name="text"> - <string># bars</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLineEdit" name="lineInstrument_2"> - <property name="text"> - <string>test</string> - </property> - <property name="dragEnabled"> - <bool>false</bool> - </property> - <property name="readOnly"> - <bool>true</bool> - </property> - </widget> - </item> - <item row="0" column="5"> - <widget class="QSpinBox" name="spinboxContrib_2"> - <property name="minimum"> - <number>0</number> - </property> - <property name="maximum"> - <number>100</number> - </property> - <property name="value"> - <number>0</number> - </property> - </widget> - </item> - <item row="0" column="4"> - <widget class="QLabel" name="labelContrib_2"> - <property name="text"> - <string>contrib</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="2" column="0" colspan="2"> - <widget class="QCheckBox" name="checkRandomize_2"> - <property name="text"> - <string>randomize</string> - </property> - <property name="checked"> - <bool>true</bool> - </property> - <property name="tristate"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="1" column="1"> - <widget class="QComboBox" name="comboGroupSel_2"> - <item> - <property name="text"> - <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> - </widget> - </item> - <item row="0" column="3"> - <widget class="QSpinBox" name="spinBoxSteps_2"> - <property name="minimum"> - <number>1</number> - </property> - <property name="maximum"> - <number>16</number> - </property> - <property name="value"> - <number>4</number> - </property> - </widget> - </item> - <item row="2" column="3"> - <widget class="QSpinBox" name="spinboxBars_2"> - <property name="minimum"> - <number>1</number> - </property> - <property name="maximum"> - <number>16</number> - </property> - <property name="value"> - <number>1</number> - </property> - </widget> - </item> - <item row="1" column="4"> - <widget class="QLabel" name="labelListen_2"> - <property name="text"> - <string>listen</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="0" column="0"> - <widget class="QLabel" name="TextLabel1_4"> - <property name="text"> - <string>Instrument</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - <item row="1" column="3"> - <widget class="QSpinBox" name="spinboxCounts_2"> - <property name="minimum"> - <number>1</number> - </property> - <property name="maximum"> - <number>16</number> - </property> - <property name="value"> - <number>4</number> - </property> - </widget> - </item> - <item row="1" column="5"> - <widget class="QSpinBox" name="spinboxListen_2"> - <property name="minimum"> - <number>-100</number> - </property> - <property name="maximum"> - <number>100</number> - </property> - <property name="value"> - <number>0</number> - </property> - </widget> - </item> - <item row="1" column="0"> - <widget class="QLabel" name="TextLabel1_3_2"> - <property name="text"> - <string>Group</string> - </property> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </item> - </layout> - </item> - <item> - <layout class="QHBoxLayout"> - <property name="spacing"> - <number>6</number> - </property> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QPushButton" name="buttonNew_2"> - <property name="toolTip"> - <string>create new entry</string> - </property> - <property name="whatsThis"> - <string>pressing the New button you create a new entry -in the MusE list of defined controllers</string> - </property> - <property name="text"> - <string>&New</string> - </property> - <property name="autoDefault"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonDelete_2"> - <property name="toolTip"> - <string>delete selected entry</string> - </property> - <property name="text"> - <string>&Delete</string> - </property> - <property name="autoDefault"> - <bool>true</bool> - </property> - </widget> - </item> - <item> - <spacer name="Spacer1_2"> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <property name="sizeType"> - <enum>QSizePolicy::Expanding</enum> - </property> - <property name="sizeHint" stdset="0"> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - </item> - <item> - <widget class="QPushButton" name="buttonUp_2"> - <property name="text"> - <string>Up</string> - </property> - </widget> - </item> - <item> - <widget class="QPushButton" name="buttonDown_2"> - <property name="text"> - <string>Down</string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item row="0" column="0"> - <widget class="QTreeWidget" name="viewInstrument"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> - <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="toolTip"> - <string>list of defined controllers</string> - </property> - <property name="whatsThis"> - <string>This is the MusE list of defined controllers.</string> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Sunken</enum> - </property> - <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> - </widget> - </item> - <item row="2" column="0"> - <widget class="QSplitter" name="Splitter3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Minimum" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="orientation"> - <enum>Qt::Vertical</enum> - </property> - <widget class="QSplitter" name="Splitter2"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="orientation"> - <enum>Qt::Horizontal</enum> - </property> - <widget class="QFrame" name="Frame3"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - </widget> - <widget class="QFrame" name="Frame4"> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>50</width> - <height>50</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - </widget> - </widget> - <widget class="QFrame" name="Frame5"> - <property name="sizePolicy"> - <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>0</width> - <height>150</height> - </size> - </property> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> - </property> - <widget class="QLabel" name="textLabel1"> - <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> - <property name="wordWrap"> - <bool>false</bool> - </property> - </widget> - </widget> - </widget> - </item> - </layout> - </widget> - <widget class="QToolBar" name="toolBar"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>111</width> - <height>38</height> - </rect> - </property> - <property name="label"> - <string>Tools</string> - </property> - <addaction name="fileNewAction"/> - <addaction name="fileOpenAction"/> - <addaction name="fileSaveAction"/> - </widget> - <widget class="QMenuBar" name="menubar"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>465</width> - <height>21</height> - </rect> - </property> - <widget class="QMenu" name="fileMenu"> - <property name="title"> - <string>&File</string> - </property> - <addaction name="fileNewAction"/> - <addaction name="fileOpenAction"/> - <addaction name="fileSaveAction"/> - <addaction name="fileSaveAsAction"/> - <addaction name="separator"/> - <addaction name="filePrintAction"/> - <addaction name="separator"/> - <addaction name="fileExitAction"/> - </widget> - <widget class="QMenu" name="editMenu"> - <property name="title"> - <string>&Edit</string> - </property> - <addaction name="editUndoAction"/> - <addaction name="editRedoAction"/> - <addaction name="separator"/> - <addaction name="editCutAction"/> - <addaction name="editCopyAction"/> - <addaction name="editPasteAction"/> - <addaction name="separator"/> - <addaction name="editFindAction"/> - </widget> - <widget class="QMenu" name="helpMenu"> - <property name="title"> - <string>&Help</string> - </property> - <addaction name="helpContentsAction"/> - <addaction name="helpIndexAction"/> - <addaction name="separator"/> - <addaction name="helpAboutAction"/> - </widget> - <addaction name="fileMenu"/> - <addaction name="editMenu"/> - <addaction name="helpMenu"/> - </widget> - <action name="fileNewAction"> - <property name="icon"> - <iconset> - <normaloff>image0</normaloff>image0</iconset> - </property> - <property name="text"> - <string>&New</string> - </property> - <property name="iconText"> - <string>New</string> - </property> - <property name="shortcut"> - <string>Ctrl+N</string> - </property> - <property name="name" stdset="0"> - <cstring>fileNewAction</cstring> - </property> - </action> - <action name="fileOpenAction"> - <property name="icon"> - <iconset> - <normaloff>image1</normaloff>image1</iconset> - </property> - <property name="text"> - <string>&Open...</string> - </property> - <property name="iconText"> - <string>Open</string> - </property> - <property name="shortcut"> - <string>Ctrl+O</string> - </property> - <property name="name" stdset="0"> - <cstring>fileOpenAction</cstring> - </property> - </action> - <action name="fileSaveAction"> - <property name="icon"> - <iconset> - <normaloff>image2</normaloff>image2</iconset> - </property> - <property name="text"> - <string>&Save</string> - </property> - <property name="iconText"> - <string>Save</string> - </property> - <property name="shortcut"> - <string>Ctrl+S</string> - </property> - <property name="name" stdset="0"> - <cstring>fileSaveAction</cstring> - </property> - </action> - <action name="fileSaveAsAction"> - <property name="text"> - <string>Save &As...</string> - </property> - <property name="iconText"> - <string>Save As</string> - </property> - <property name="shortcut"> - <string/> - </property> - <property name="name" stdset="0"> - <cstring>fileSaveAsAction</cstring> - </property> - </action> - <action name="filePrintAction"> - <property name="icon"> - <iconset> - <normaloff>image3</normaloff>image3</iconset> - </property> - <property name="text"> - <string>&Print...</string> - </property> - <property name="iconText"> - <string>Print</string> - </property> - <property name="shortcut"> - <string>Ctrl+P</string> - </property> - <property name="name" stdset="0"> - <cstring>filePrintAction</cstring> - </property> - </action> - <action name="fileExitAction"> - <property name="text"> - <string>E&xit</string> - </property> - <property name="iconText"> - <string>Exit</string> - </property> - <property name="shortcut"> - <string/> - </property> - <property name="name" stdset="0"> - <cstring>fileExitAction</cstring> - </property> - </action> - <action name="editUndoAction"> - <property name="icon"> - <iconset> - <normaloff>image4</normaloff>image4</iconset> - </property> - <property name="text"> - <string>&Undo</string> - </property> - <property name="iconText"> - <string>Undo</string> - </property> - <property name="shortcut"> - <string>Ctrl+Z</string> - </property> - <property name="name" stdset="0"> - <cstring>editUndoAction</cstring> - </property> - </action> - <action name="editRedoAction"> - <property name="icon"> - <iconset> - <normaloff>image5</normaloff>image5</iconset> - </property> - <property name="text"> - <string>&Redo</string> - </property> - <property name="iconText"> - <string>Redo</string> - </property> - <property name="shortcut"> - <string>Ctrl+Y</string> - </property> - <property name="name" stdset="0"> - <cstring>editRedoAction</cstring> - </property> - </action> - <action name="editCutAction"> - <property name="icon"> - <iconset> - <normaloff>image6</normaloff>image6</iconset> - </property> - <property name="text"> - <string>&Cut</string> - </property> - <property name="iconText"> - <string>Cut</string> - </property> - <property name="shortcut"> - <string>Ctrl+X</string> - </property> - <property name="name" stdset="0"> - <cstring>editCutAction</cstring> - </property> - </action> - <action name="editCopyAction"> - <property name="icon"> - <iconset> - <normaloff>image7</normaloff>image7</iconset> - </property> - <property name="text"> - <string>C&opy</string> - </property> - <property name="iconText"> - <string>Copy</string> - </property> - <property name="shortcut"> - <string>Ctrl+C</string> - </property> - <property name="name" stdset="0"> - <cstring>editCopyAction</cstring> - </property> - </action> - <action name="editPasteAction"> - <property name="icon"> - <iconset> - <normaloff>image8</normaloff>image8</iconset> - </property> - <property name="text"> - <string>&Paste</string> - </property> - <property name="iconText"> - <string>Paste</string> - </property> - <property name="shortcut"> - <string>Ctrl+V</string> - </property> - <property name="name" stdset="0"> - <cstring>editPasteAction</cstring> - </property> - </action> - <action name="editFindAction"> - <property name="icon"> - <iconset> - <normaloff>image9</normaloff>image9</iconset> - </property> - <property name="text"> - <string>&Find...</string> - </property> - <property name="iconText"> - <string>Find</string> - </property> - <property name="shortcut"> - <string>Ctrl+F</string> - </property> - <property name="name" stdset="0"> - <cstring>editFindAction</cstring> - </property> - </action> - <action name="helpContentsAction"> - <property name="text"> - <string>&Contents...</string> - </property> - <property name="iconText"> - <string>Contents</string> - </property> - <property name="shortcut"> - <string/> - </property> - <property name="name" stdset="0"> - <cstring>helpContentsAction</cstring> - </property> - </action> - <action name="helpIndexAction"> - <property name="text"> - <string>&Index...</string> - </property> - <property name="iconText"> - <string>Index</string> - </property> - <property name="shortcut"> - <string/> - </property> - <property name="name" stdset="0"> - <cstring>helpIndexAction</cstring> - </property> - </action> - <action name="helpAboutAction"> - <property name="text"> - <string>&About...</string> - </property> - <property name="iconText"> - <string>About</string> - </property> - <property name="shortcut"> - <string/> - </property> - <property name="name" stdset="0"> - <cstring>helpAboutAction</cstring> - </property> - </action> - </widget> - <layoutdefault spacing="6" margin="11"/> - <resources/> - <connections> - <connection> - <sender>fileNewAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>fileNew()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>fileOpenAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>fileOpen()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>fileSaveAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>fileSave()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>fileSaveAsAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>fileSaveAs()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>filePrintAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>filePrint()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>fileExitAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>fileExit()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>editUndoAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>editUndo()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>editRedoAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>editRedo()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>editCutAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>editCut()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>editCopyAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>editCopy()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>editPasteAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>editPaste()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>editFindAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>editFind()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>helpIndexAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>helpIndex()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>helpContentsAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>helpContents()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - <connection> - <sender>helpAboutAction</sender> - <signal>activated()</signal> - <receiver>RhythmBase</receiver> - <slot>helpAbout()</slot> - <hints> - <hint type="sourcelabel"> - <x>-1</x> - <y>-1</y> - </hint> - <hint type="destinationlabel"> - <x>20</x> - <y>20</y> - </hint> - </hints> - </connection> - </connections> -</ui> |