feat: initial Cutdex application
Add the Flutter video editing application with project management, media import, timeline editing, preview, AI assistance, diagnostics and settings. Include shared UI and native host packages, platform runners, application tests and release tooling. Provide usage and contribution guides, the MIT license and third-party notices. Exclude local credentials, build outputs and validation data.
This commit is contained in:
commit
27e77fff39
718 files changed
+183958
No files matched your search
@@ -0,0 +1,27 @@
|
||||
/// Slider travel is a presentation choice, independent of authored gain.
|
||||
abstract final class AudioGainScale {
|
||||
static const decimalPlaces = 1;
|
||||
static double quantizeDb(double db) => double.parse(formatDb(db));
|
||||
static String formatDb(double db) {
|
||||
final text = db.toStringAsFixed(decimalPlaces);
|
||||
return text == '-0.0' ? '0.0' : text;
|
||||
}
|
||||
|
||||
// Reserve 70% of travel for -24...+6 dB. Zero is a separate mute endpoint.
|
||||
static double dbAt(double position) {
|
||||
if (!position.isFinite) throw ArgumentError.value(position);
|
||||
final p = position.clamp(0.0, 1.0);
|
||||
if (p <= .01) return -90;
|
||||
if (p <= .2) return -90 + (p - .01) / .19 * 66;
|
||||
if (p <= .9) return -24 + (p - .2) / .7 * 30;
|
||||
return 6 + (p - .9) / .1 * 6;
|
||||
}
|
||||
|
||||
static double positionAt(double db) {
|
||||
if (!db.isFinite) throw ArgumentError.value(db);
|
||||
final value = db.clamp(-90.0, 12.0);
|
||||
if (value <= -24) return .01 + (value + 90) / 66 * .19;
|
||||
if (value <= 6) return .2 + (value + 24) / 30 * .7;
|
||||
return .9 + (value - 6) / 6 * .1;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user