Skip to content

Commit

Permalink
Merge pull request #2053 from fzyzcjy/feat/12189
Browse files Browse the repository at this point in the history
Support `#[frb(proxy)]` (part 3)
  • Loading branch information
fzyzcjy authored Jun 9, 2024
2 parents 1868cb3 + c270906 commit 8dbd4c2
Show file tree
Hide file tree
Showing 15 changed files with 35,792 additions and 12,375 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub(crate) fn generate(
let output_namespace = &(config_mir.rust_input_namespace_pack).rust_output_path_namespace;

let proxy_variants_of_enum =
(proxy_variants.iter()).into_group_map_by(|ty| ty.upstream.safe_ident());
(proxy_variants.iter()).into_group_map_by(|ty| ty.inner.safe_ident());

let proxied_types = compute_proxied_types(&proxy_variants_of_enum, &output_namespace);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ Future<void> _demoUsage() async {
await src.setLoop(value: true);

final biquad = await context.createBiquadFilter();
// TODO
// biquad.frequencyValue = 125;
biquad.frequency.setValue(value: 125);

await src.connect(dest: AudioNodeImplementor.biquadFilterNode(biquad));
await biquad.connect(
dest: await AudioNodeImplementor.audioDestinationNode(
await context.destination()));
// TODO
// await src.connect(dest: AudioNodeImplementor.biquadFilterNode(biquad));
// await biquad.connect(
// dest: await AudioNodeImplementor.audioDestinationNode(
// await context.destination()));

await src.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,97 +7,94 @@ import '../frb_generated.dart';
import '../third_party/web_audio_api.dart';
import 'package:flutter_rust_bridge/flutter_rust_bridge_for_generated.dart';

// Rust type: RustOpaqueMoi<flutter_rust_bridge::for_generated::RustAutoOpaqueInner<AudioNodeImplementor>>
abstract class AudioNodeImplementor implements RustOpaqueInterface {}

abstract class AnalyserNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class AudioBufferSourceNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class AudioContextExt {
Future<AudioBuffer> decodeAudioDataSync({required String inputPath});
}

abstract class AudioDestinationNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class AudioParamExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class BiquadFilterNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class ChannelMergerNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class ChannelSplitterNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class ConstantSourceNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class ConvolverNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class DelayNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class DynamicsCompressorNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class GainNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class IIRFilterNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class MediaElementAudioSourceNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class MediaStreamAudioDestinationNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class MediaStreamAudioSourceNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class MediaStreamTrackAudioSourceNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class OscillatorNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class PannerNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class ScriptProcessorNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class StereoPannerNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}

abstract class WaveShaperNodeExt {
Future<void> connect({required AudioNodeImplementor dest});
Future<void> connect();
}
Loading

0 comments on commit 8dbd4c2

Please sign in to comment.