FluidWaveform delete temp file

delete it right away instead of on close
nix
Ted Moore 4 years ago
parent 97b16d418f
commit 4096ff836b

@ -21,26 +21,26 @@ FluidWaveform {
sfv.readFile(SoundFile(path)); sfv.readFile(SoundFile(path));
sfv.gridOn_(false); sfv.gridOn_(false);
win.onClose_({ File.delete(path);
File.delete(path)
}); if(slices_buf.notNil,{
slices_buf.loadToFloatArray(action:{
slices_buf.loadToFloatArray(action:{ arg slices_fa;
arg slices_fa;
userView = UserView(win,Rect(0,0,bounds.width,bounds.height))
userView = UserView(win,Rect(0,0,bounds.width,bounds.height)) .drawFunc_({
.drawFunc_({ slices_fa.do{
slices_fa.do{ arg start_samp;
arg start_samp; var x = start_samp.linlin(0,audio_buf.numFrames,0,bounds.width);
var x = start_samp.linlin(0,audio_buf.numFrames,0,bounds.width); Pen.line(Point(x,0),Point(x,bounds.height));
Pen.line(Point(x,0),Point(x,bounds.height)); Pen.color_(Color.red);
Pen.color_(Color.red); Pen.stroke;
Pen.stroke; };
}; });
}); });
win.front;
}); });
win.front;
}.play(AppClock); }.play(AppClock);
} }
} }

Loading…
Cancel
Save