-
Notifications
You must be signed in to change notification settings - Fork 750
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
Topic/refactor server status #1547
Conversation
Some refactoring of the serverRunning_ method. This method is now really used to set the state if known. If unknown, like from the aliveThread, we call updateRunningState instead. This method will not change serverRunning if false, but will mark the server as unresponsive. Only if we quit the server from sclang explicitly, we call serverRunning_ directly.
…t for them to close down. They won't reply anyway.
…is for efficiency to keep at least serverRunning in Server, because this method is called all the time
aliveThread | ||
} | ||
|
||
/* backward compatibility */ |
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 wouldn't refer to this as "backward compatibility". the statusWatcher should be considered a private object and people should not be encouraged to use it or to think that its the new way to do things.
these methods are the correct way IMO to expose the api. so I suggest removing the "backward" comment
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.
Ah yes. I was wondering whether it is OK to have the getter to the watcher. I used it once:
*resumeThreads {
set.do { |server| server.statusWatcher.resumeThread }
}
I could of course add a method to Server that isolates it. What do you think?
useful to clean up Server, its a mess. I would also move the gui into a separate class, but please call it ServerGUI and not ServerGui as there is already one in crucial-library. agree: 3.8 |
Because CmdPeriod calls resumeThreads, all registered servers, if booted or not, have aliveThreads. This patch fixes that impolite misbehavior.
OK, that is a good idea. I'll also write a |
Now new allocators are created after the server app is booted to protect from invalid ids.
@timblechmann I have tried to correctly implement |
@crucialfelix uh, yes, no big hurry! |
do use Qt "properly" one should probably implement a QML view and move then one would have a gui system with modern features (delarative, btw, @telephon: it makes sense to split a PR of 52 commit to functional |
Yes, agreed. Unfortunately, it's a big refactoring and the commits all build on top of each other – so I'm not sure of how to do this. I've reduced and reshuffled as much as possible with Maybe it would have been even easier to just make one commit that removes the whole Sever class and then add things step by step ... |
yes, very much so. Maybe the best way to specify views would then be to embed QML in sclang directly as a string? It is very readable and adequately representing its objects in sclang would be overly complicated. |
This would be cool for sure, and is probably a better match for the state-of-the-art of Qt - but, I'm unclear what the concrete gains would be... Doing even complex layouts in SC now is, for the most part, very simple and clear. Declarative layouts are powerful, but are there GUI-building tasks in SC that are currently difficult / impossible because of limitations in the layout implementation? Do we have bugs that would be fixed by vsync animation? Are there QML widgets that would be a big improvement to existing options in SC? I don't mean to sound too skeptical (I'd love to hear other benefits of qml), but in the list of features that would have a big user-impact when UI-building in SuperCollider, I think it's down the list (refactoring .action's to a proper event-based / signal-slot pattern? exposing unexposed Qt functionality on existing widgets? WYSIWYG layout-ing? SynthDef graph display? Improved scopes? Better high-DPI & multitouch support?) |
@telephon, re commits: This seems like a fine granularity? Reading through, I don't see a huge benefit to testing this in too many separate pieces. At that point, the only real impact of the commit organization is what you see in blame - which, as it's structured now, is useful enough. The one thing I would say is - given the amount of functional change, a unit test that defines how the Server API's should work (especially in terms of notifications) should absolutely be a part of this. |
it would be possible to pass the qml code as string or as a QUrl (which
just a few thoughs ... jakob was already proposing this years ago ... |
um ... shouldn't you people be making music ? |
i was always surprised that once you write code people think that you are not a musician ... |
that's not what I meant. I was referring to the endless amount of discussion about GUI that happens in supercollider development. |
And the opposite! :-) |
I have to say that it would simplify a lot if we could do something like this.
This is a major issue, I think: it is also low resolution. Many people are using sc to do graphics with their music, or well, visual music. |
I'd love to see a proof-of-concept QML implementation of something that's better suited to QML than regular SC. Not sure what a good candidate is - maybe an animated version of Plot? I'd love to see what the performance difference is, as well as how easy it is to get data connected to the requisite drawing code in a SC vs QML version. It would be a good use-case for driving (and justifying) QML features. |
What do you mean by low resolution? Meaning, high dpi bugs, or something else? |
there's this: https://github.com/jleben/quickcollider On Fri, Jul 10, 2015 at 3:34 AM scztt notifications@github.com wrote:
|
On retina screens, aliasing is broken and looks bad, even number boxes. I once added an issue, but couldn't find it anymore now. |
bootNotifyFirst was implemented in a way that seemed not to work properly. This is also undocumented, so it may need someone who knows how it was supposed to work. This is why I commented it out and factored out a clearer message for server.
Possibly I already mentioned this, in which case I apologize for re-posting, just mentioning in the interest of comparing approaches. I have a declarative system implemented in FPLib which can be used for GUI time-dependent logic. It is similar to http://elm-lang.org/. I also implemented a declarative Pen interface, although it probably makes Pen drawing even slower. Possibly QML + an FRP system on sclang's side could be interesting, although FRP causes some cognitive dissonance to imperative programmers which might be insurmountable. https://github.com/miguel-negrao/FPLib/blob/master/Examples/FRP/ENdef-jitlib_style.scd |
Closing it, moving to branch |
This PR is still being developed, but it shouldn't break and can be tested.
This fixes #774 and fixes #889: instead of just assuming that the server is dead, it is taken to be unresponsive. It also fixes #1484.
It factors out all statusWatcher and recording functionality to a separate class (
ServerStatusWatcher
andRecorder
). This branch also implements the updating of recording display in the IDE.There is some more refactoring, in the server code itself, the Volume class, and also the allocation of buffers in Buffer.
While I took care to keep the old interface, this refactor may break code that relies on instance variables in
Server
, these problems are usually easy to solve, by writing, e.g.this.avgCPU
instead ofavgCPU
.