Merge branch 'enhance/FluidWaveform' into dev

nix
Ted Moore 4 years ago
commit bdf72d7dd3

@ -15,16 +15,18 @@ FluidViewer {
FluidWaveform : FluidViewer { FluidWaveform : FluidViewer {
*new { *new {
arg audio_buf, slices_buf, feature_buf, bounds, lineWidth = 1; arg audio_buf, slices_buf, feature_buf, bounds, lineWidth = 1, waveformColor;
^super.new.init(audio_buf,slices_buf, feature_buf, bounds, lineWidth); ^super.new.init(audio_buf,slices_buf, feature_buf, bounds, lineWidth, waveformColor);
} }
init { init {
arg audio_buf, slices_buf, feature_buf, bounds, lineWidth; arg audio_buf, slices_buf, feature_buf, bounds, lineWidth, waveformColor;
Task{ Task{
var path = "%%_%_FluidWaveform.wav".format(PathName.tmp,Date.localtime.stamp,UniqueID.next); var path = "%%_%_FluidWaveform.wav".format(PathName.tmp,Date.localtime.stamp,UniqueID.next);
var sfv, win, categoryCounter = 0; var sfv, win, categoryCounter = 0;
waveformColor = waveformColor ? Color(*0.5.dup(3));
this.createCatColors; this.createCatColors;
bounds = bounds ? Rect(0,0,800,200); bounds = bounds ? Rect(0,0,800,200);
@ -34,8 +36,9 @@ FluidWaveform : FluidViewer {
audio_buf.server.sync; audio_buf.server.sync;
sfv = SoundFileView(win,Rect(0,0,bounds.width,bounds.height)); sfv = SoundFileView(win,Rect(0,0,bounds.width,bounds.height));
sfv.peakColor_(Color(*0.75.dup(3))); sfv.peakColor_(waveformColor);
sfv.rmsColor_(Color.black); // sfv.rmsColor_(Color.black);
sfv.rmsColor_(Color.clear);
sfv.background_(Color.white); sfv.background_(Color.white);
sfv.readFile(SoundFile(path)); sfv.readFile(SoundFile(path));
sfv.gridOn_(false); sfv.gridOn_(false);

Loading…
Cancel
Save