Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

21
LINES

< > BotCompany Repo | #1018687 // showFrequencyImage2 - with change points slider

JavaX fragment (include)

static float showFrequencyImage2_maxValue = 0.3f;

static ImageSurface showFrequencyImage2(File audioFile) {
  if (audioFile == null) null;
  ret showFrequencyImage2(audioFile.getName(), audioFileToFrequencyImage(audioFile));
}
  
static ImageSurface showFrequencyImage2(S name, final BWImage img) {
  ImageSurface is = showZoomedBWImage(name, img);
  final ImageSurface is2 = jImageSurface();
  is2.setZoom(2);
  final SimpleLiveValue<Float> lvThreshold = floatLiveValue(0.1f);
  
  Runnable update = runAndReturn(r {
    is2.setImage(bwImage_markColumnsWhite(img.getWidth(), 10, printStruct("change points: ", audio_changePoints1(img, lvThreshold!))));
  });
  
  lvThreshold.onChange(update);
  addToWindowAndPack(is, vstack(is2, jLiveValueSliderZeroToX(showFrequencyImage2_maxValue, lvThreshold)));
  ret is;
}

Author comment

Began life as a copy of #1018613

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1018687
Snippet name: showFrequencyImage2 - with change points slider
Eternal ID of this version: #1018687/9
Text MD5: f30239cc896b95776794a88546c93d2f
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-10-12 12:05:59
Source code size: 834 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 243 / 309
Version history: 8 change(s)
Referenced in: [show references]