feat: add playback gain methods to all platforms

This commit is contained in:
Andrew 2026-04-24 13:25:28 +07:00
parent 7608d79d64
commit 5a547958d5
7 changed files with 75 additions and 0 deletions

View file

@ -96,4 +96,10 @@ class LiblinphoneFlutter {
Future<double> getMicGain() async =>
LiblinphoneFlutterPlatform.instance.getMicGain();
Future<bool> setPlaybackGain(double level) async =>
LiblinphoneFlutterPlatform.instance.setPlaybackGain(level);
Future<double> getPlaybackGain() async =>
LiblinphoneFlutterPlatform.instance.getPlaybackGain();
}

View file

@ -130,4 +130,17 @@ class MethodChannelLiblinphoneFlutter extends LiblinphoneFlutterPlatform {
Future<double> getMicGain() async {
return (await methodChannel.invokeMethod<double>('getMicGain'))!;
}
@override
Future<bool> setPlaybackGain(double level) async {
return (await methodChannel.invokeMethod<bool>(
'setPlaybackGain',
<String, dynamic>{'level': level},
))!;
}
@override
Future<double> getPlaybackGain() async {
return (await methodChannel.invokeMethod<double>('getPlaybackGain'))!;
}
}

View file

@ -105,4 +105,12 @@ abstract class LiblinphoneFlutterPlatform extends PlatformInterface {
Future<double> getMicGain() async {
throw UnimplementedError('getMicGain() has not been implemented.');
}
Future<bool> setPlaybackGain(double level) async {
throw UnimplementedError('setPlaybackGain() has not been implemented.');
}
Future<double> getPlaybackGain() async {
throw UnimplementedError('getPlaybackGain() has not been implemented.');
}
}