[Bluemusic-commits] SF.net SVN: bluemusic:[4202] blue/trunk
Brought to you by:
kunstmusik
|
From: <kun...@us...> - 2010-04-07 03:00:19
|
Revision: 4202
http://bluemusic.svn.sourceforge.net/bluemusic/?rev=4202&view=rev
Author: kunstmusik
Date: 2010-04-07 03:00:13 +0000 (Wed, 07 Apr 2010)
Log Message:
-----------
added Scale selection for MidiInputProcessor
Modified Paths:
--------------
blue/trunk/blue-core/src/blue/midi/MidiInputProcessor.java
blue/trunk/blue-ui-core/src/blue/ui/core/midi/MidiInputProcessorPanel.form
blue/trunk/blue-ui-core/src/blue/ui/core/midi/MidiInputProcessorPanel.java
Modified: blue/trunk/blue-core/src/blue/midi/MidiInputProcessor.java
===================================================================
--- blue/trunk/blue-core/src/blue/midi/MidiInputProcessor.java 2010-04-07 02:59:43 UTC (rev 4201)
+++ blue/trunk/blue-core/src/blue/midi/MidiInputProcessor.java 2010-04-07 03:00:13 UTC (rev 4202)
@@ -40,15 +40,15 @@
private MidiVelocityMapping velMapping = MidiVelocityMapping.MIDI;
- Scale scale = Scale.get12TET();
+ private Scale scale = Scale.get12TET();
- String pitchConstant = "";
+ private String pitchConstant = "";
- String ampConstant = "";
+ private String ampConstant = "";
- double ampMin = 0.0;
+ private double ampMin = 0.0;
- double ampMax = 1.0;
+ private double ampMax = 1.0;
public String getAmpConstant() {
return ampConstant;
@@ -82,6 +82,14 @@
this.pitchConstant = pitchConstant;
}
+ public Scale getScale() {
+ return scale;
+ }
+
+ public void setScale(Scale scale) {
+ this.scale = scale;
+ }
+
public String getNoteOn(String id, int noteNum, int key, int velocity) {
return NOTE_FORMAT.format(new Object[] { id, noteNum, processKey(key), processVelocity(
velocity)});
Modified: blue/trunk/blue-ui-core/src/blue/ui/core/midi/MidiInputProcessorPanel.form
===================================================================
--- blue/trunk/blue-ui-core/src/blue/ui/core/midi/MidiInputProcessorPanel.form 2010-04-07 02:59:43 UTC (rev 4201)
+++ blue/trunk/blue-ui-core/src/blue/ui/core/midi/MidiInputProcessorPanel.form 2010-04-07 03:00:13 UTC (rev 4202)
@@ -19,17 +19,18 @@
<Group type="102" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="jSeparator1" alignment="0" pref="192" max="32767" attributes="0"/>
+ <Component id="jSeparator1" alignment="0" pref="203" max="32767" attributes="0"/>
<Group type="102" alignment="0" attributes="0">
<Group type="103" groupAlignment="0" attributes="0">
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
+ <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
<Component id="jLabel1" min="-2" pref="31" max="-2" attributes="0"/>
- <Component id="jLabel3" alignment="0" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="keyMapComboBox" alignment="0" pref="121" max="32767" attributes="0"/>
- <Component id="keyConstantText" alignment="0" pref="121" max="32767" attributes="0"/>
+ <Component id="keyMapComboBox" alignment="0" pref="132" max="32767" attributes="0"/>
+ <Component id="keyConstantText" alignment="0" pref="132" max="32767" attributes="0"/>
+ <Component id="scaleSelectionPanel1" alignment="0" pref="132" max="32767" attributes="0"/>
</Group>
</Group>
<Group type="102" alignment="0" attributes="0">
@@ -39,8 +40,8 @@
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
- <Component id="ampMapComboBox" alignment="0" pref="121" max="32767" attributes="0"/>
- <Component id="ampConstantText" alignment="0" pref="121" max="32767" attributes="0"/>
+ <Component id="ampMapComboBox" alignment="0" pref="132" max="32767" attributes="0"/>
+ <Component id="ampConstantText" alignment="0" pref="132" max="32767" attributes="0"/>
</Group>
</Group>
</Group>
@@ -56,9 +57,12 @@
<Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="keyMapComboBox" alignment="3" min="-2" max="-2" attributes="0"/>
</Group>
- <EmptySpace type="unrelated" max="-2" attributes="0"/>
- <Component id="jLabel1" min="-2" max="-2" attributes="1"/>
<EmptySpace max="-2" attributes="0"/>
+ <Group type="103" groupAlignment="1" max="-2" attributes="0">
+ <Component id="jLabel1" max="32767" attributes="1"/>
+ <Component id="scaleSelectionPanel1" alignment="1" max="32767" attributes="1"/>
+ </Group>
+ <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="3" attributes="0">
<Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="keyConstantText" alignment="3" min="-2" max="-2" attributes="0"/>
@@ -162,5 +166,7 @@
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="ampMapComboBoxActionPerformed"/>
</Events>
</Component>
+ <Component class="blue.soundObject.editor.pianoRoll.ScaleSelectionPanel" name="scaleSelectionPanel1">
+ </Component>
</SubComponents>
</Form>
Modified: blue/trunk/blue-ui-core/src/blue/ui/core/midi/MidiInputProcessorPanel.java
===================================================================
--- blue/trunk/blue-ui-core/src/blue/ui/core/midi/MidiInputProcessorPanel.java 2010-04-07 02:59:43 UTC (rev 4201)
+++ blue/trunk/blue-ui-core/src/blue/ui/core/midi/MidiInputProcessorPanel.java 2010-04-07 03:00:13 UTC (rev 4202)
@@ -31,6 +31,8 @@
import blue.midi.MidiKeyMapping;
import blue.midi.MidiVelocityMapping;
import javax.swing.DefaultComboBoxModel;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
/**
@@ -65,6 +67,15 @@
}
}
});
+
+ scaleSelectionPanel1.addChangeListener(new ChangeListener() {
+
+ public void stateChanged(ChangeEvent e) {
+ if (processor != null) {
+ processor.setScale(scaleSelectionPanel1.getScale());
+ }
+ }
+ });
}
public void setMidiInputProcessor(MidiInputProcessor processor) {
@@ -76,6 +87,8 @@
keyMapComboBox.setSelectedItem(processor.getKeyMapping());
ampMapComboBox.setSelectedItem(processor.getVelMapping());
+ scaleSelectionPanel1.setScale(processor.getScale());
+
this.processor = processor;
}
@@ -98,6 +111,7 @@
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
ampMapComboBox = new javax.swing.JComboBox();
+ scaleSelectionPanel1 = new blue.soundObject.editor.pianoRoll.ScaleSelectionPanel();
jLabel1.setText(org.openide.util.NbBundle.getMessage(MidiInputProcessorPanel.class, "MidiInputProcessorPanel.jLabel1.text")); // NOI18N
@@ -134,24 +148,25 @@
.add(layout.createSequentialGroup()
.addContainerGap()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE)
+ .add(jSeparator1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 203, Short.MAX_VALUE)
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel2)
- .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
- .add(jLabel3))
+ .add(jLabel3)
+ .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 31, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(keyMapComboBox, 0, 121, Short.MAX_VALUE)
- .add(keyConstantText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE)))
+ .add(keyMapComboBox, 0, 132, Short.MAX_VALUE)
+ .add(keyConstantText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 132, Short.MAX_VALUE)
+ .add(scaleSelectionPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 132, Short.MAX_VALUE)))
.add(layout.createSequentialGroup()
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
.add(jLabel4)
.add(jLabel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 61, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
- .add(ampMapComboBox, 0, 121, Short.MAX_VALUE)
- .add(ampConstantText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 121, Short.MAX_VALUE))))
+ .add(ampMapComboBox, 0, 132, Short.MAX_VALUE)
+ .add(ampConstantText, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 132, Short.MAX_VALUE))))
.addContainerGap())
);
layout.setVerticalGroup(
@@ -161,9 +176,11 @@
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel2)
.add(keyMapComboBox, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
- .add(jLabel1)
.addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
+ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
+ .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
+ .add(scaleSelectionPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
+ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
.add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
.add(jLabel3)
.add(keyConstantText, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
@@ -205,6 +222,7 @@
private javax.swing.JSeparator jSeparator1;
private javax.swing.JTextField keyConstantText;
private javax.swing.JComboBox keyMapComboBox;
+ private blue.soundObject.editor.pianoRoll.ScaleSelectionPanel scaleSelectionPanel1;
// End of variables declaration//GEN-END:variables
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|