Subversion Repositories svn.mios

Rev

Rev 294 | Rev 666 | 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;
22
 
23
import java.util.Vector;
628 adamjking 24
 
213 tk 25
import org.midibox.sidlibr.Patch;
26
 
27
public class SIDEditController extends SIDSysexParameterControlManager {
28
    private Patch patch;
29
    private Vector engine;
628 adamjking 30
 
213 tk 31
    public SIDEditController(Patch p) {
32
        super(p.getReceiver());
33
        this.patch = p.clone();
34
        engine = EngineSpecs.getEngine(patch);
628 adamjking 35
 
213 tk 36
        for (int b = 0; b < engine.size(); b++) {
37
            Vector v = (Vector) engine.elementAt(b);
38
            for (int c = 0; c < v.size(); c++) {
628 adamjking 39
                SIDSysexParameterControl midiParameter = (SIDSysexParameterControl) v
40
                        .elementAt(c);
213 tk 41
                addSIDSysexParameter(midiParameter);
42
            }
43
        }
44
    }
628 adamjking 45
 
213 tk 46
    public Vector getEngine() {
47
        return engine;
48
    }
628 adamjking 49
 
213 tk 50
    public void setTooltipListener(Object object) {
51
        for (int b = 0; b < engine.size(); b++) {
52
            Vector v = (Vector) engine.elementAt(b);
53
            for (int c = 0; c < v.size(); c++) {
628 adamjking 54
                SIDSysexParameterControl midiParameter = (SIDSysexParameterControl) v
55
                        .elementAt(c);
213 tk 56
                midiParameter.setTooltipListener(object);
57
            }
58
        }
59
    }
628 adamjking 60
 
213 tk 61
    public Patch getPatch() {
62
        return patch;
63
    }
64
 
65
    public String getPatchName() {
66
        return patch.getPatchName();
67
    }
628 adamjking 68
 
213 tk 69
    public void setPatchName(String s) {
70
        patch.setPatchName(s);
71
    }
628 adamjking 72
 
213 tk 73
    public void Save() {
74
        setChanged();
628 adamjking 75
        notifyObservers("Save editor patch");
213 tk 76
    }
77
}