New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make .plotTree
a single instance window and add ServerTreeView
#6294
base: develop
Are you sure you want to change the base?
make .plotTree
a single instance window and add ServerTreeView
#6294
Conversation
Thank you! The important thing in all the changes was that we still have an option to have several of them if needed (e.g. for multi-screen setups). s.meter –> But we have no |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should have a possibility to have several views if needed.
@telephon I think what you want is the behaviour of making a new window like
Comment
|
.plotTree
a single instance window and add ServerTreeView
change the display text for the link::Search#asRect::
- revise the new method for the ServerTreeView class - add plotTreeView method for the ServerTreeView class - revise (simplify) the plotTree method for the Server class - revise (simplify)the plotTreeView method for the Server class
Add ServerTreeView feature with full backwards compatibility - ServerTreeView - .plotTree - .plotTreeView
If there is already a s.plotTree, the following code preserves the precious position. 1. `s.plotTree` // evaluate this. 2. change the position of 1. 3. `s.plotTree` // evaluating this will only show the window, the position and size will not be changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks already quite good, thank you! There are still some little things to do, but it is getting there...
One more idea, to make multiple views even more useful: instead of passing the argument Within the code, you can then call E.g. g = Group.new(s);
g.asTarget // the group itself
g.asTarget.server // the server
// server asTarget returns the default group
s.asTarget
// maybe, for passing a server, we want to get the parent
group = if(target.isKindOf(Server)) { s.defaultGroup.parent } { target.asTarget };
// then you could also write
ServerNodeTree.new; // monitors the default server and the full tree
ServerNodeTree.new(42); // monitors group 42
Ndef(\x, { SinOsc.ar(Rand(200, 800)) * 0.1 });
Ndef(\x).fadeTime = 3;
Tdef(\x, { loop { 1.wait; Ndef(\x).send } }).play;
ServerNodeTree.new(Ndef(\x));
etc.
|
- updated according to review request - new: if no server argument is given, the default server is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you very much, it is already very good! I made a few more comments.
- updated according to the review - corrected background colour for start-stop
@telephon
It is also a great idea. But what do you mean by this?
|
}; | ||
viewParent = window; | ||
window.view.hasHorizontalScroller_(false).background_(Color.grey(0.9)); | ||
if(window.view.respondsTo(\hasHorizontalScroller_)) { window.view.hasHorizontalScroller_(false) }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thinking about it – perhaps we don't need the test. Doesn't the view of a window always respond to hasHorizontalScroller_
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need the test.
Please watch the following video:
https://www.dropbox.com/scl/fi/mqns39chx08rbobhbyiew/hasHorizontalScroller_.mov?rlkey=7ymra5gy3nk5kae6tdo5z3kvz&dl=0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Re-reading the code, I found that there are a few things to do, I hope this is fine for you.
- move the whole class definition to a separate file. "ServerPlusGui" implies that these are extensions only
- for now, maybe let's drop the feature of passing a parent? This can be added later. Let's just make a new window always and just pass the bounds. The current way of handling the parent is brittle. Or do you see a reason that we need that right now?
- the updater thing is still not correct, this may have been wrong already in the code you copied from the server, I am not sure. The updater is supposed to be a Routine, resulting from the fork, but currently it is just a function. So
updateFunc.stop
never works! Line 162 should beupdater = fork { ...
without the extra function brackets. Then, still the stopping on cmdPeriod needs to be fixed. If you need support on that I'll help, but this is getting long so I'll stop here.
- Update after review - Correct loop behaviour to avoid errors after - closing s.plotTree and a window containing `ServerTreeView`, and - starting server and quitting server
- correct `updateFunc` and `updater`
Thank you for your review!
Please let me know the name of the new file and where it is located. What I think is
Do you mean the parent argument in
Following your recommendation, I have moved some parts of
Um... anyway, `.stop' has worked (and sorry for not taking a closer look at the part nor writing it by myself!):
|
Purpose and Motivation
Currently
s.plotTree
creates new windows whenever the shortcut is pressed ors.plotTree
is evaluated. This behaviour is strange because the following server-related windows are singleton windowss.meter
s.freqscope
s.scope
.With this PR,
s.plotTree
makes only one singleton window.I thought this was a bug, but someone may see it as a new feature.
Merge Note
When this PR is approved or merged, #6282 should be checked to see if it has already been approved or merged.
Types of changes
To-do list