Skip to content

Commit

Permalink
class lib: add count to temp synthdefs post
Browse files Browse the repository at this point in the history
This commit amends the "Cleaning up temporary SynthDefs..." post message to display the number of SynthDefs being cleaned up. It also has a very minor refactor so that "pathMatch" is called only once, and "match.do" is not called if the match is empty.
  • Loading branch information
Nathan Ho committed Jan 11, 2017
1 parent 4ebf13b commit 91fa8bd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions SCClassLibrary/Common/Audio/SystemSynthDefs.sc
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ SystemSynthDefs {
// clean up any written synthdefs starting with "temp__"
var path = SynthDef.synthDefDir ++ tempNamePrefix ++ "*";
var match = pathMatch(path);
if(match.notEmpty) { "Cleaning up temporary SynthDefs...".postln };
pathMatch(path).do { |file| File.delete(file) };
if(match.notEmpty) {
"Cleaning up % temporary SynthDef%...\n".postf(
match.size,
if(match.size == 1, { "" }, { "s" })
);
match.do { |file| File.delete(file) };
};

// add system synth defs
(1..numChannels).do { arg i;
Expand Down

0 comments on commit 91fa8bd

Please sign in to comment.