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,71 @@
|
||||
import 'dart:io';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:crypto/crypto.dart';
|
||||
|
||||
import 'export_publication.dart';
|
||||
|
||||
import 'package:cutdex_sdk/editor.dart';
|
||||
import 'package:cutdex_sdk/runtime.dart';
|
||||
|
||||
/// Native session and output-file adapter. Compilation belongs to editor.
|
||||
final class RuntimeEditorExport implements RecoverableEditorExportService {
|
||||
const RuntimeEditorExport(this.runtime);
|
||||
final CutdexRuntime runtime;
|
||||
|
||||
@override
|
||||
Future<MediaInfo?> probe(MediaReference media) => runtime.probe(media);
|
||||
|
||||
@override
|
||||
Future<EditorExportCapabilities> capabilities() async {
|
||||
final features = await runtime.capabilities();
|
||||
return EditorExportCapabilities(
|
||||
imageProbe:
|
||||
features.query('media.imageProbe') ==
|
||||
CapabilityAvailability.available,
|
||||
toneMapping:
|
||||
features.query('render.toneMapping') ==
|
||||
CapabilityAvailability.available,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<Uri?> recoverExport(Uri destination, String operationId) =>
|
||||
ExportPublication(destination, operationId).recover();
|
||||
|
||||
@override
|
||||
Future<Uri> exportRecoverable(
|
||||
ExecutionPlan plan,
|
||||
Uri destination,
|
||||
String operationId,
|
||||
) => ExportPublication(destination, operationId).run(
|
||||
sha256.convert(utf8.encode(jsonEncode(plan.toMap()))).toString(),
|
||||
(staging) => export(plan, staging),
|
||||
);
|
||||
|
||||
@override
|
||||
Future<Uri> export(ExecutionPlan plan, Uri destination) async {
|
||||
if (await FileSystemEntity.type(
|
||||
destination.toFilePath(),
|
||||
followLinks: false,
|
||||
) !=
|
||||
FileSystemEntityType.notFound) {
|
||||
throw const CommandRejected(
|
||||
'destinationExists',
|
||||
'Destination already exists',
|
||||
);
|
||||
}
|
||||
if (!await File.fromUri(destination).parent.exists()) {
|
||||
throw const CommandRejected(
|
||||
'invalidDestination',
|
||||
'Destination directory does not exist',
|
||||
);
|
||||
}
|
||||
final session = await runtime.createSession();
|
||||
try {
|
||||
return await session.export(plan, destination);
|
||||
} finally {
|
||||
await session.close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user