Skip to content
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

class library and ide: refactor server #2422

Merged

Conversation

telephon
Copy link
Member

Here is the last version of the server refactoring.

This commit fixes the display of the recording time in the IDE gui. It
also adds a hook to the pause and resume recording functions.
For the server GUI window, the SimpleController should take the view as
dependant.
This is symmetric to `register`.
Stethoscope calls `serverTree` already.
- a minor API change: the methods called on Volume are adopted to
standard usage: numChans (deprecated) is now numChannels.

- refactoring of the code, use method instead of function for update.
This is a rather large refactoring, but because of its
interdependencies is hard to dissect into pieces.

– move functionality between Server and NetAddr
- simplify Buffer allocation methods
- unify code formatting
- move recording functionality to recorder class
- moves recording defaults to ServerOptions
- makes hack unnecessary for reserved recording buffers
- print more informative messages
- deprecates the `set_` class method (replaced by `all_` already long
ago).
@telephon
Copy link
Member Author

I don't understand why this failed. The error is �[31mError:�[0m python-2.7.12_1 already installed. Nothing to do with this PR, really.

@bagong
Copy link
Contributor

bagong commented Oct 28, 2016

Retriggering the build "fixed" it ;)

@telephon
Copy link
Member Author

excellent.

@nhthn
Copy link
Contributor

nhthn commented Oct 28, 2016

What should I look for testing this PR?

argument::server


InstanceMethods::
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two small doc warnings:

WARNING: SCDoc: In /home/nathan/git/supercollider/HelpSource/Classes/Recorder.schelp
  Method -prepareForRecord has 2 args, but doc has 1 argument:: tags.
WARNING: SCDoc: In /home/nathan/git/supercollider/HelpSource/Classes/Recorder.schelp
  Method -record has 5 args, but doc has 1 argument:: tags.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, done

@telephon
Copy link
Member Author

@snappizz: A lot of the server class functionality is refactored in this PR, but especially booting, quitting, recording, scoping, pause and resume recording, both programmatically and from the IDE menus would be possible places to look at.

In terms of code quality, the C++/Qt code may need more eyes perhaps.

@telephon
Copy link
Member Author

That's what I had thought as well, but when I call killall scsynth from the terminal, I also see it.

@jamshark70
Copy link
Contributor

We can turn it off by setting postOutput to false

It would be worth testing to be sure this doesn't suppress error posting from scsynth. I believe postOutput: false will block all stdout, and that would be bad.

@telephon
Copy link
Member Author

For what this PR is concerned, I'm rather curious to know where the posting comes from. It could be used at least for local servers to detect a killed server.

@nhthn
Copy link
Contributor

nhthn commented Oct 31, 2016

I have filed #2452 concerning the inability to disable RESULT = posting without disabling post output entirely.

You can detect a killed server using the action argument to unixCmd.

@telephon
Copy link
Member Author

You can detect a killed server using the action argument to unixCmd.

Yes, but only if you have called the command from sclang. Make the following experiment:

Open the terminal (bash or whatever) and type killall scsynth. Then look in the post window of sclang. You'll (probably) see RESULT = 0. Why is that!?

@nhthn
Copy link
Contributor

nhthn commented Oct 31, 2016

I think we keep talking past each other here... never mind.

Thanks for your work on this, I'm excited to get this merged. Let's get at least one thorough code review in before merging. Sound good?

I can go over it on Saturday, and of course everyone else should feel free to step up.

@telephon
Copy link
Member Author

telephon commented Nov 1, 2016

… yes, never mind.

sounds good!

@telephon
Copy link
Member Author

telephon commented Nov 1, 2016

Ah, now I got it: because sclang actually creates the process using a unixCmd, we can also test for an end.

see #2458.

@telephon
Copy link
Member Author

ping …

@telephon telephon changed the title server refactoring reordered class library and ide: refactor server Nov 12, 2016
@nhthn
Copy link
Contributor

nhthn commented Nov 13, 2016

sorry i didn't get around to code review as promised :( pretty busy for the next few days unfortunately

@telephon
Copy link
Member Author

no problem, just wanted to keep this awake :)

@nhthn nhthn self-assigned this Nov 22, 2016
Copy link
Contributor

@adcxyz adcxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a big improvement - code is much clearer than it was, and better organized.
Testing for a few hours, no problems found; will test for a few more days.

@nhthn
Copy link
Contributor

nhthn commented Nov 29, 2016

I swear I will get around to code review for this at some point, but right now I'm behind on work and school.

@telephon
Copy link
Member Author

@snappizz no Problem, this is just for keeping it alive. if others can test too, it wouldn't hurt

@adcxyz
Copy link
Contributor

adcxyz commented Nov 29, 2016 via email

@jamshark70
Copy link
Contributor

#2521. It was only a matter of time before we got caught with pants around ankles.

@telephon
Copy link
Member Author

that is a rather drastic metaphor for code review, james!

@jamshark70
Copy link
Contributor

Oh, heh heh, it's a modified version of the American idiom "(to) get caught with your pants down," meaning to be unprepared for something that you knew was coming up and should have been ready to do. It seemed apt (if colorful).

@adcxyz adcxyz merged commit 6a3f37e into supercollider:master Dec 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants