Skip to content

Commit

Permalink
Merge pull request #5312 from capital-G/remove-swing-osc
Browse files Browse the repository at this point in the history
remove SwingOSC references
  • Loading branch information
dyfer authored Sep 20, 2021
2 parents 9885b7e + 21d5858 commit 3287b55
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 86 deletions.
2 changes: 1 addition & 1 deletion HelpSource/Classes/Buffer.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ b.free;
::

method:: loadDialog
As link::#*read:: above, but gives you a load dialog window to browse for a file. Cocoa and SwingOSC compatible.
As link::#*read:: above, but gives you a load dialog window to browse for a file. Cocoa compatible.
argument:: server
The server on which to allocate the buffer.
argument:: startFrame
Expand Down
5 changes: 1 addition & 4 deletions HelpSource/Classes/GUI.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ related:: Overviews/GUI-Classes, Guides/GUI-Introduction
description::
SuperCollider currently supports three operating system platforms: macOS, UNIX (Linux and FreeBSD) and Windows (with some limitations).

Warning::The redirect system has been deprecated, please use the view classes directly. If you find old code that uses prefixes for the old GUI Kits (e.g. SCWindow for CocoaGUI, JSCWindow for SwingOSC), try dropping the prefixes to Window, Button etc. The Qt prefix Q, as e.g. in QWindow, is converted to Window automatically; still it is better style to simply write Window.::
Warning::The redirect system has been deprecated, please use the view classes directly. If you find old code that uses prefixes for the old GUI Kits (e.g. SCWindow for CocoaGUI), try dropping the prefixes to Window, Button etc. The Qt prefix Q, as e.g. in QWindow, is converted to Window automatically; still it is better style to simply write Window.::

Switching between GUI schemes is not needed anymore, as Qt runs well on all platforms.
Still, you can get the available schemes with:
Expand Down Expand Up @@ -41,9 +41,6 @@ method:: add
method:: qt
Makes QtGUI the current scheme and returns it. Subsequent GUI object calls to GUI are delegated to Qt. Returns the current (Qt) scheme.

method:: swing
If SwingOSC is installed, makes SwingGUI (Java GUI) the current scheme and returns it. Subsequent GUI object calls to GUI are delegated to swing. Returns the current (swing) scheme.

method:: fromID
Changes the current scheme and returns the new scheme.
argument:: id
Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Classes/MultiSliderView.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ METHOD:: size

When setting -size, if the new amount is larger then the current, new sliders will be added with the value of 0. In the opposite case, the value of sliders up to the new amount will be preserved, and the rest of the sliders will be removed.

note:: strong:: In Cocoa and SwingOSC GUIs: ::
note:: strong:: In Cocoa GUI: ::

Changing -size after the view has been drawn or after the link::#-value:: array has been set will lead to unexpected results. Instead, you should change the link::#-value::, if you need to change the contents of the view.

Expand Down
12 changes: 1 addition & 11 deletions HelpSource/Classes/ProxyMonitorGui.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ ProxyMonitorGui(~test);
// switches the button next to it to show a different output shape:
// ("-<" is multiple outs, "-=" is directly adjacent outs.
// clicking on that button opens an editing dialog:
~test.playNDialog; // needs testing with SwingOSC.
~test.playNDialog;

~test.out_(0);

Expand All @@ -112,15 +112,5 @@ ProxyMonitorGui(~test);

ProxyMonitorGui(skin: <your look here>)


// Quick SwingOsc tests.

g = SwingOSC.default;
g.boot;
GUI.swing;

y = ProxyMonitorGui(~test);

GUI.cocoa;
y = ProxyMonitorGui(~test);
::
2 changes: 0 additions & 2 deletions HelpSource/Classes/UserView.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ SUBSECTION:: Animation
METHOD:: animate
Whether the view shall redraw itself internally at a regular time interval (frame rate). See link::#-frameRate:: for the way to adjust that interval.

note:: This method is strong::not:: available in strong:: SwingOSC GUI ::. ::

The default value is code::false::.

argument::
Expand Down
2 changes: 0 additions & 2 deletions HelpSource/Classes/Window.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ METHOD:: new
A Boolean indicating whether this window is resizable by the user. The default is code::true::.
argument:: border
A Boolean indicating whether this window has a border. Borderless windows have no title bar and thus can only be closed in code. The default is code::true::.
argument:: server
This is a dummy argument which is here to provide compatibility with SwingOSC and has no effect.
argument:: scroll
A Boolean indicating whether this window will add scrollbars if its contents exceed its bounds. If this is set to code::true::, then link::Classes/View#-resize:: settings will be ignored for contained views. The default is false.

Expand Down
2 changes: 1 addition & 1 deletion HelpSource/Guides/How-to-Use-the-Interpreter.schelp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ s.boot; // this boots the default Server. Watch the post window and server windo

In the help files all executable fragments are written in the Monaco font.

If an expression has multiple lines you can select all of the lines before typing 'Enter'. Note that this example uses link::Classes/GUI:: objects that are standard in macOS. Windows and Linux platforms can run this using SwingOSC. SwingOSC is installed as part of the Windows package. Linux users might need to download SwingOSC for themselves. http://www.sciss.de/swingOSC/
If an expression has multiple lines you can select all of the lines before typing 'Enter'.

code::
// Select all 9 of the following lines and press 'Enter':
Expand Down
8 changes: 6 additions & 2 deletions SCClassLibrary/Common/GUI/Base/QWindow.sc
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,20 @@ Window {
}

/* NOTE:
- 'server' is only for compatibility with SwingOSC
- all args have to be of correct type for Widget constructor to match!
*/
*new { arg name="",
bounds,
resizable = true,
border = true,
server,
deprecatedServerArgument,
scroll = false;

if(deprecatedServerArgument.notNil) {
// see https://github.com/supercollider/supercollider/pull/5312#discussion_r553546303
"this argument is deprecated, it was kept for SwingOSC compatibility, but will be removed".warn;
};

if( bounds.isNil ) {
bounds = Rect(0,0,400,400).center_( Window.availableBounds.center );
}{
Expand Down
11 changes: 0 additions & 11 deletions SCClassLibrary/Common/GUI/backwardsCompatibility/GUI.sc
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ GUI {
schemes = IdentityDictionary.new;
}

/**
* Makes Swing (Java GUI) the current scheme
* and returns it. Subsequent GUI object calls
* to GUI are delegated to swing.
*
* @return the current (swing) scheme
*/
*swing {
^this.fromID( \swing );
}

/**
* Makes qt (Qt GUI) the current scheme
* and returns it. Subsequent GUI object calls
Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/JITLib/GUI/ProxyMonitorGui.sc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ ProxyMonitorGui {
if (isAudio != oldState[2]) {
[ampSl, playBut, setOutBox, playNDialogBut].reject(_.isNil).do(_.enabled_(isAudio));
};
// dont update if typing into numberbox - should be tested with SwingOSC!
// dont update if typing into numberbox
if (setOutBox.numberView.hasFocus.not) {
setOutBox.value_(try { outs[0] } ? 0);
if (usesPlayN) {
Expand Down
2 changes: 1 addition & 1 deletion SCClassLibrary/JITLib/ProxySpace/extStoreOn.sc
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@

playNDialog { | bounds, usePlayN |
var doc = this.playEditString(usePlayN).newTextWindow("edit outs:");
try { doc.bounds_(bounds) }; // swingosc safe
try { doc.bounds_(bounds) };
}

findInOpenDocuments { |index = 0|
Expand Down
19 changes: 0 additions & 19 deletions editors/sced/sced/WindowHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
<menuitem action="ScedStartServer"/>
<menuitem action="ScedStopServer"/>
<separator/>
<menuitem action="ScedStartSwingOSC"/>
<menuitem action="ScedStopSwingOSC"/>
<separator/>
<menuitem action="ScedFindHelp"/>
<menuitem action="ScedBrowseHelp"/>
<menuitem action="ScedSearchHelp"/>
Expand Down Expand Up @@ -189,14 +186,6 @@ def __insert_sc_menu(self):
("ScedStopServer", None, _("Stop Server"), None,
_("Stop the default server"),
self.on_stop_server),

("ScedStartSwingOSC", None, _("Start SwingOSC GUI Server"), None,
_("Start the SwingOSC GUI server"),
self.on_start_swingosc),

("ScedStopSwingOSC", None, _("Stop SwingOSC GUI Server"), None,
_("Stop the SwingOSC GUI server"),
self.on_stop_swingosc),
]

toggle_entries = [
Expand Down Expand Up @@ -341,11 +330,3 @@ def on_start_server(self, action):
def on_stop_server(self, action):
# FIXME: make these actions possible only if interpreter is running and okay
self.__lang.evaluate("Server.default.quit;", silent=True)

def on_start_swingosc(self, action):
# FIXME: make these actions possible only if interpreter is running and okay
self.__lang.evaluate("SwingOSC.default.boot;GUI.swing;", silent=False)

def on_stop_swingosc(self, action):
# FIXME: make these actions possible only if interpreter is running and okay
self.__lang.evaluate("SwingOSC.default.quit;", silent=False)
8 changes: 0 additions & 8 deletions editors/sced/sced3/supercollider.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,14 +399,6 @@ def __insert_sc_menu(self):
_("Find and open class definition"),
self.on_find_definition),

("ScedBrowseClass", None, _("Browse class"), None,
_("Browse class (needs running SwingOSC server)"),
self.on_browse_class),

("ScedInspectObject", None, _("Inspect Object"), None,
_("Inspect object state (needs running SwingOSC server)"),
self.on_inspect_object),

("ScedOpenDevFile", None, _("Open development file"), "<control><alt>K",
_("Open corresponding development file for current document"),
self.on_open_dev_file),
Expand Down
19 changes: 0 additions & 19 deletions editors/sced/scedwin/py/WindowHelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,6 @@
<menuitem action="ScedStartServer"/>
<menuitem action="ScedStopServer"/>
<separator/>
<menuitem action="ScedStartSwingOSC"/>
<menuitem action="ScedStopSwingOSC"/>
<separator/>
<menuitem action="ScedFindDefinition"/>
<menuitem action="ScedBrowseClass"/>
<separator/>
Expand Down Expand Up @@ -191,14 +188,6 @@ def __insert_sc_menu(self):
("ScedStopServer", None, _("Stop Server"), None,
_("Stop the default server"),
self.on_stop_server),

("ScedStartSwingOSC", None, _("Start SwingOSC GUI Server"), None,
_("Start the SwingOSC GUI server"),
self.on_start_swingosc),

("ScedStopSwingOSC", None, _("Stop SwingOSC GUI Server"), None,
_("Stop the SwingOSC GUI server"),
self.on_stop_swingosc),
]

toggle_entries = [
Expand Down Expand Up @@ -357,11 +346,3 @@ def on_start_server(self, action):
def on_stop_server(self, action):
# FIXME: make these actions possible only if interpreter is running and okay
self.__lang.evaluate("Server.default.quit;", silent=True)

def on_start_swingosc(self, action):
# FIXME: make these actions possible only if interpreter is running and okay
self.__lang.evaluate("SwingOSC.default.boot;GUI.swing;", silent=False)

def on_stop_swingosc(self, action):
# FIXME: make these actions possible only if interpreter is running and okay
self.__lang.evaluate("SwingOSC.default.quit;", silent=False)
3 changes: 1 addition & 2 deletions examples/GUI examples/GUI_examples1.scd
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,13 @@ w.refresh;
)

// properties you can set in the window above.
w.view.background = Color.blue; // fallback on SwingOSC
w.view.background = HiliteGradient(Color.blue, Color.red, \v, 128, 0.2);
r.background = Color.gray; r.hi = 0.2;

z.visible = false;
z.visible = true;

z.enabled = false; // NO EFFECT WITH SWINGOSC!
z.enabled = false;
z.enabled = true;

b.visible = false;
Expand Down
1 change: 0 additions & 1 deletion examples/GUI examples/GUI_examples2.scd
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ SynthDef("window-test", { arg note = 36, fc = 1000, rq = 0.25, bal=0, amp=0.4, g
w = Window("another control panel", Rect(20, 400, 440, 360));
w.front; // make window visible and front window.
w.view.decorator = FlowLayout(w.view.bounds);
w.view.background = Color.rand(0.0,1.0); // fallback for SwingOSC
w.view.background = HiliteGradient(Color.rand(0.0,1.0),Color.rand(0.0,1.0),
[\h,\v].choose, 100, rrand(0.1,0.9));
)
Expand Down

0 comments on commit 3287b55

Please sign in to comment.