Subversion Repositories svn.mios

Rev

Rev 505 | Rev 710 | Go to most recent revision | 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.bassline;
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 V1GUIv, Vector V2GUIv,
35
            Vector masterLeftGUIv, Vector masterRightGUIv) {
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(createSlaveVoice(masterLeftGUIv, 0, "Voice 2 (left)"));
53
        panel2.add(createSlaveVoice(masterLeftGUIv, 4, "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(V2GUIv, "Voice 4 (right)"));
60
        panel3.add(createSlaveVoice(masterRightGUIv, 0, "Voice 5 (right)"));
61
        panel3.add(createSlaveVoice(masterRightGUIv, 4, "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(masterLeftGUIv, masterRightGUIv));
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 vGUIL, Vector vGUIR) {
213 tk 76
        JPanel globPanel = new JPanel();
628 adamjking 77
        globPanel.setLayout(new GridLayout(1, 2));
213 tk 78
        globPanel.setOpaque(false);
628 adamjking 79
 
213 tk 80
        JPanel subPanelL = new JPanel();
628 adamjking 81
        subPanelL.setLayout(new GridLayout(1, 4));
213 tk 82
        subPanelL.setOpaque(false);
83
        subPanelL.setBorder(BorderFactory.createEtchedBorder());
84
        subPanelL.setBorder(BorderFactory.createTitledBorder("Master Left"));
85
        subPanelL.add((SIDSysexParameterControlGUI) vGUIL.elementAt(0));
86
        subPanelL.add((SIDSysexParameterControlGUI) vGUIL.elementAt(1));
87
        subPanelL.add((SIDSysexParameterControlGUI) vGUIL.elementAt(2));
88
        subPanelL.add((SIDSysexParameterControlGUI) vGUIL.elementAt(3));
89
        globPanel.add(subPanelL);
628 adamjking 90
 
213 tk 91
        JPanel subPanelR = new JPanel();
628 adamjking 92
        subPanelR.setLayout(new GridLayout(1, 4));
213 tk 93
        subPanelR.setOpaque(false);
94
        subPanelR.setBorder(BorderFactory.createEtchedBorder());
95
        subPanelR.setBorder(BorderFactory.createTitledBorder("Master Right"));
96
        subPanelR.add((SIDSysexParameterControlGUI) vGUIR.elementAt(0));
97
        subPanelR.add((SIDSysexParameterControlGUI) vGUIR.elementAt(1));
98
        subPanelR.add((SIDSysexParameterControlGUI) vGUIR.elementAt(2));
99
        subPanelR.add((SIDSysexParameterControlGUI) vGUIR.elementAt(3));
100
        globPanel.add(subPanelR);
628 adamjking 101
 
213 tk 102
        return globPanel;
103
    }
628 adamjking 104
 
213 tk 105
    protected JPanel createVoice(Vector vGUI, String s) {
628 adamjking 106
 
213 tk 107
        JPanel voicePanel = new JPanel();
108
        voicePanel.setLayout(new BoxLayout(voicePanel, BoxLayout.X_AXIS));
109
        voicePanel.setBorder(BorderFactory.createEtchedBorder());
110
        voicePanel.setBorder(BorderFactory.createTitledBorder(s));
111
        voicePanel.setOpaque(false);
628 adamjking 112
 
213 tk 113
        JPanel subPanel1 = new JPanel();
114
        subPanel1.setLayout(new BoxLayout(subPanel1, BoxLayout.Y_AXIS));
115
        subPanel1.setOpaque(false);
628 adamjking 116
 
213 tk 117
        JPanel subPanel2 = new JPanel();
118
        subPanel2.setLayout(new BoxLayout(subPanel2, BoxLayout.Y_AXIS));
119
        subPanel2.setOpaque(false);
628 adamjking 120
 
213 tk 121
        // Waveform selection
122
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(2));
628 adamjking 123
 
213 tk 124
        // Tuning Panel
125
        JPanel tunePanel = new JPanel();
628 adamjking 126
        tunePanel.setLayout(new GridLayout(2, 3));
213 tk 127
        tunePanel.setOpaque(false);
128
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(10));
129
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(11));
130
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(12));
131
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(7));
132
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(8));
133
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(13));
134
        subPanel2.add(tunePanel);
628 adamjking 135
 
213 tk 136
        // Portamento Panel
137
        JPanel portaPanel = new JPanel();
138
        portaPanel.setLayout(new BoxLayout(portaPanel, BoxLayout.X_AXIS));
139
        portaPanel.setOpaque(false);
628 adamjking 140
 
213 tk 141
        portaPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(1));
142
        portaPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(0));
628 adamjking 143
 
213 tk 144
        subPanel2.add(portaPanel);
628 adamjking 145
 
213 tk 146
        // Envelope Panel
147
        JPanel envPanel = new JPanel();
148
        envPanel.setLayout(new BoxLayout(envPanel, BoxLayout.X_AXIS));
149
        envPanel.setOpaque(false);
150
        envPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(9));
151
        envPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(3));
152
        envPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(4));
153
        envPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(5));
154
        envPanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(6));
155
        subPanel1.add(envPanel);
628 adamjking 156
 
213 tk 157
        voicePanel.add(subPanel1);
158
        voicePanel.add(subPanel2);
159
        return voicePanel;
628 adamjking 160
    }
161
 
162
    protected JPanel createSlaveVoice(Vector vGUI, int offset, String s) {
163
 
505 rutgerv 164
        JPanel voicePanel = new JPanel();
165
        voicePanel.setLayout(new BoxLayout(voicePanel, BoxLayout.X_AXIS));
166
        voicePanel.setBorder(BorderFactory.createEtchedBorder());
167
        voicePanel.setBorder(BorderFactory.createTitledBorder(s));
168
        voicePanel.setOpaque(false);
628 adamjking 169
 
505 rutgerv 170
        JPanel subPanel1 = new JPanel();
171
        subPanel1.setLayout(new BoxLayout(subPanel1, BoxLayout.Y_AXIS));
172
        subPanel1.setOpaque(false);
628 adamjking 173
 
505 rutgerv 174
        JPanel subPanel2 = new JPanel();
175
        subPanel2.setLayout(new BoxLayout(subPanel2, BoxLayout.Y_AXIS));
176
        subPanel2.setOpaque(false);
628 adamjking 177
 
505 rutgerv 178
        // Waveform selection
628 adamjking 179
        subPanel1.add((SIDSysexParameterControlGUI) vGUI.elementAt(4 + offset));
180
 
505 rutgerv 181
        // Tuning Panel
182
        JPanel tunePanel = new JPanel();
628 adamjking 183
        tunePanel.setLayout(new GridLayout(1, 3));
505 rutgerv 184
        tunePanel.setOpaque(false);
628 adamjking 185
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(5 + offset));
186
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(6 + offset));
187
        tunePanel.add((SIDSysexParameterControlGUI) vGUI.elementAt(7 + offset));
505 rutgerv 188
        subPanel2.add(tunePanel);
628 adamjking 189
 
505 rutgerv 190
        voicePanel.add(subPanel1);
191
        voicePanel.add(subPanel2);
192
        return voicePanel;
628 adamjking 193
    }
213 tk 194
}