Subversion Repositories svn.mios

Rev

Rev 628 | Rev 658 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 628 Rev 657
Line 4... Line 4...
4
import java.awt.event.ActionEvent;
4
import java.awt.event.ActionEvent;
-
 
5
import java.util.Observable;
-
 
6
import java.util.Observer;
5
7
6
import javax.swing.Icon;
8
import javax.swing.Icon;
7
import javax.swing.JButton;
9
import javax.swing.JButton;
8
import javax.swing.JMenuItem;
10
import javax.swing.JMenuItem;
9
11
10
import org.midibox.apps.SIDV2librarian.gui.SIDV2librarianGUI;
12
import org.midibox.apps.SIDV2librarian.gui.SIDV2librarianGUI;
11
import org.midibox.apps.miosstudio.gui.MIOSStudioGUI;
13
import org.midibox.apps.miosstudio.gui.MIOSStudioGUI;
12
import org.midibox.apps.miosstudiosid.MIOSStudioSID;
14
import org.midibox.apps.miosstudiosid.MIOSStudioSID;
13
import org.midibox.utils.gui.ImageLoader;
15
import org.midibox.utils.gui.ImageLoader;
14
16
15
public class MIOSStudioSIDGUI extends MIOSStudioGUI {
17
public class MIOSStudioSIDGUI extends MIOSStudioGUI implements Observer {
16
18
17
    protected SIDV2librarianGUI sidv2librariangui;
19
    protected SIDV2librarianGUI sidv2librariangui;
18
20
19
    protected MIOSStudioInternalFrame sidv2librarianWindow;
21
    protected MIOSStudioInternalFrame sidv2librarianWindow;
20
22
21
    public MIOSStudioSIDGUI(MIOSStudioSID miosStudioSID) {
23
    public MIOSStudioSIDGUI(MIOSStudioSID miosStudioSID) {
22
        super(miosStudioSID);
24
        super(miosStudioSID);
-
 
25
-
 
26
        sidv2librariangui.getSidv2librarian().getSIDLibController()
-
 
27
                .addObserver(this);
23
    }
28
    }
24
29
25
    public MIOSStudioInternalFrame getSidv2librarianWindow() {
30
    public MIOSStudioInternalFrame getSidv2librarianWindow() {
26
        return sidv2librarianWindow;
31
        return sidv2librarianWindow;
27
    }
32
    }
Line 78... Line 83...
78
        super.actionPerformed(ae);
83
        super.actionPerformed(ae);
79
84
80
        if (ae.getActionCommand().equals("sidv2_librarian")) {
85
        if (ae.getActionCommand().equals("sidv2_librarian")) {
81
            showFrame(sidv2librarianWindow);
86
            showFrame(sidv2librarianWindow);
82
87
-
 
88
        }
-
 
89
    }
-
 
90
-
 
91
    public void update(Observable observable, Object object) {
-
 
92
-
 
93
        if (object == "Edit") {
-
 
94
-
 
95
            boolean portsReleased = miosStudio.getMidiDeviceRouting()
-
 
96
                    .getPortsReleased();
-
 
97
-
 
98
            if (!portsReleased) {
-
 
99
-
 
100
                System.out.println("Now releasing ports!");
-
 
101
-
 
102
                miosStudio.getMidiDeviceRouting().setPortsReleased(true);
-
 
103
-
 
104
                System.out.println("Ports released successfully");
-
 
105
-
 
106
                miosStudio.getMidiDeviceRouting().setPortsReleased(false);
-
 
107
-
 
108
                System.out.println("Ports recaimed successfully");
-
 
109
            }
83
        }
110
        }
84
    }
111
    }
85
}
112
}