Sorting out sample rate info in clip display to support Contact Collator

plugin
This commit is contained in:
Douglas Gillespie 2022-04-26 13:29:50 +01:00
parent a62cff4f11
commit 2842143613

View File

@ -288,8 +288,8 @@ public class ClipDisplayUnit extends PamPanel {
String tStr = PamCalendar.formatTime(clipDataUnit.getTimeMilliseconds(), true);
g.drawString(tStr, borderSize, fontAscent);
String lenString = String.format("%3.2fs", (float)clipDataUnit.getSampleDuration() / clipDisplayPanel.getSampleRate());
float fs = clipDataUnit.getSourceSampleRate(); // was clipDisplayPanel.getSampleRate()
String lenString = String.format("%3.2fs", (float)clipDataUnit.getSampleDuration() / fs);
Rectangle2D strSize = fm.getStringBounds(lenString, g);
g.drawString(lenString, (int) (getWidth()-strSize.getWidth()), getHeight()-fm.getDescent());