Subversion Repositories svn.mios

Rev

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