Subversion Repositories svn.mios

Rev

Rev 213 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
213 tk 1
/*
2
 * @(#)SIDV2librarian.java  beta1   2008/01/21
3
 *
4
 * Copyright (C) 2008    Rutger Vlek (rutgervlek@hotmail.com)
5
 *
6
 * This application is free software; you can redistribute it and/or modify
7
 * it under the terms of the GNU General Public License as published by
8
 * the Free Software Foundation; either version 2 of the License, or
9
 * (at your option) any later version.
10
 *
11
 * This application is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this application; if not, write to the Free Software
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
 */
20
 
21
package org.midibox.sidedit.gui.lead;
22
 
23
import java.awt.BorderLayout;
24
import java.awt.GridLayout;
25
import java.util.Vector;
26
 
27
import javax.swing.BorderFactory;
28
import javax.swing.BoxLayout;
29
import javax.swing.JPanel;
30
 
628 adamjking 31
import org.midibox.sidedit.gui.controls.SIDSysexParameterControlGUI;
32
 
33
public class OscillatorGUI extends JPanel {
34
    protected OscillatorGUI(Vector masterGUIv, Vector V1GUIv, Vector V2GUIv,
35
            Vector V3GUIv, Vector V4GUIv, Vector V5GUIv, Vector V6GUIv) {
213 tk 36
        setLayout(new BorderLayout());
37
        this.setOpaque(false);
628 adamjking 38
 
213 tk 39
        JPanel panel = new JPanel();
40
        panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
41
        panel.setOpaque(false);
628 adamjking 42
 
213 tk 43
        JPanel panel1 = new JPanel();
44
        panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS));
45
        panel1.setOpaque(false);
628 adamjking 46
 
213 tk 47
        JPanel panel2 = new JPanel();
48
        panel2.setLayout(new BoxLayout(panel2, BoxLayout.Y_AXIS));
49
        panel2.setOpaque(false);
628 adamjking 50
 
51
        panel2.add(createVoice(V1GUIv, "Voice 1 (left)"));
52
        panel2.add(createVoice(V2GUIv, "Voice 2 (left)"));
53
        panel2.add(createVoice(V3GUIv, "Voice 3 (left)"));
54
 
213 tk 55
        JPanel panel3 = new JPanel();
56
        panel3.setLayout(new BoxLayout(panel3, BoxLayout.Y_AXIS));
57
        panel3.setOpaque(false);
628 adamjking 58
 
59
        panel3.add(createVoice(V4GUIv, "Voice 4 (right)"));
60
        panel3.add(createVoice(V5GUIv, "Voice 5 (right)"));
61
        panel3.add(createVoice(V6GUIv, "Voice 6 (right)"));
62
 
213 tk 63
        panel1.add(panel2);
64
        panel1.add(panel3);
628 adamjking 65
 
213 tk 66
        JPanel globPanel = new JPanel();
67
        globPanel.setLayout(new BoxLayout(globPanel, BoxLayout.Y_AXIS));
68
        globPanel.setOpaque(false);
628 adamjking 69
 
70
        panel.add(createGlob(masterGUIv, "Master settings"));
213 tk 71
        panel.add(panel1);
628 adamjking 72
        this.add(panel, BorderLayout.NORTH);
213 tk 73
    }
74
 
628 adamjking 75
    protected JPanel createGlob(Vector vGUI, String s) {
213 tk 76
        JPanel globPanel = new JPanel();
77
        globPanel.setLayout(new BoxLayout(globPanel, BoxLayout.X_AXIS));
78
        globPanel.setBorder(BorderFactory.createEtchedBorder());
79
        globPanel.setBorder(BorderFactory.createTitledBorder(s));
80
        globPanel.setOpaque(false);
628 adamjking 81
 
213 tk 82
        globPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(0));
83
        globPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(1));
84
        globPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(2));
85
        globPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(3));
86
        globPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(4));
628 adamjking 87
 
213 tk 88
        return globPanel;
89
    }
628 adamjking 90
 
213 tk 91
    protected JPanel createVoice(Vector vGUI, String s) {
628 adamjking 92
 
213 tk 93
        JPanel voicePanel = new JPanel();
94
        voicePanel.setLayout(new BoxLayout(voicePanel, BoxLayout.X_AXIS));
95
        voicePanel.setBorder(BorderFactory.createEtchedBorder());
96
        voicePanel.setBorder(BorderFactory.createTitledBorder(s));
97
        voicePanel.setOpaque(false);
628 adamjking 98
 
213 tk 99
        JPanel subPanel1 = new JPanel();
100
        subPanel1.setLayout(new BoxLayout(subPanel1, BoxLayout.Y_AXIS));
101
        subPanel1.setOpaque(false);
628 adamjking 102
 
213 tk 103
        JPanel subPanel2 = new JPanel();
104
        subPanel2.setLayout(new BoxLayout(subPanel2, BoxLayout.Y_AXIS));
105
        subPanel2.setOpaque(false);
628 adamjking 106
 
213 tk 107
        // Waveform selection
108
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(2));
628 adamjking 109
 
213 tk 110
        // Tuning Panel
111
        JPanel tunePanel = new JPanel();
628 adamjking 112
        tunePanel.setLayout(new GridLayout(2, 3));
213 tk 113
        tunePanel.setOpaque(false);
114
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(10));
115
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(11));
116
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(12));
117
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(7));
628 adamjking 118
        // tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(8));
213 tk 119
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(13));
120
        subPanel2.add(tunePanel);
628 adamjking 121
 
213 tk 122
        // Portamento Panel
123
        JPanel portaPanel = new JPanel();
124
        portaPanel.setLayout(new BoxLayout(portaPanel, BoxLayout.X_AXIS));
125
        portaPanel.setOpaque(false);
628 adamjking 126
 
213 tk 127
        portaPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(1));
128
        portaPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(0));
628 adamjking 129
 
213 tk 130
        subPanel2.add(portaPanel);
628 adamjking 131
 
213 tk 132
        // Envelope Panel
133
        JPanel envPanel = new JPanel();
134
        envPanel.setLayout(new BoxLayout(envPanel, BoxLayout.X_AXIS));
135
        envPanel.setOpaque(false);
136
        envPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(9));
137
        envPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(3));
138
        envPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(4));
139
        envPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(5));
140
        envPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(6));
141
        subPanel1.add(envPanel);
628 adamjking 142
 
213 tk 143
        voicePanel.add(subPanel1);
144
        voicePanel.add(subPanel2);
145
        return voicePanel;
628 adamjking 146
    }
213 tk 147
}