mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-06-16 05:55:20 +00:00
[WIP] Call participant volume adjustment
This commit is contained in:
parent
4c8c710391
commit
e683c8817d
@ -294,6 +294,7 @@ public protocol PresentationGroupCall: class {
|
||||
func toggleIsMuted()
|
||||
func setIsMuted(action: PresentationGroupCallMuteAction)
|
||||
func updateDefaultParticipantsAreMuted(isMuted: Bool)
|
||||
func setVolume(peerId: PeerId, volume: Double)
|
||||
func setCurrentAudioOutput(_ output: AudioSessionOutput)
|
||||
|
||||
func updateMuteState(peerId: PeerId, isMuted: Bool)
|
||||
|
@ -1235,6 +1235,15 @@ public final class PresentationGroupCallImpl: PresentationGroupCall {
|
||||
}
|
||||
}
|
||||
|
||||
public func setVolume(peerId: PeerId, volume: Double) {
|
||||
for (ssrc, id) in self.ssrcMapping {
|
||||
if id == peerId {
|
||||
self.callContext?.setVolume(ssrc: ssrc, volume: volume)
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public func setCurrentAudioOutput(_ output: AudioSessionOutput) {
|
||||
guard self.currentSelectedAudioOutputValue != output else {
|
||||
return
|
||||
|
@ -133,6 +133,10 @@ public final class OngoingGroupCallContext {
|
||||
})
|
||||
}
|
||||
|
||||
func setVolume(ssrc: UInt32, volume: Double) {
|
||||
self.context.setVolumeForSsrc(ssrc, volume: volume)
|
||||
}
|
||||
|
||||
func stop() {
|
||||
self.context.stop()
|
||||
}
|
||||
@ -242,6 +246,12 @@ public final class OngoingGroupCallContext {
|
||||
}
|
||||
}
|
||||
|
||||
public func setVolume(ssrc: UInt32, volume: Double) {
|
||||
self.impl.with { impl in
|
||||
impl.setVolume(ssrc: ssrc, volume: volume)
|
||||
}
|
||||
}
|
||||
|
||||
public func stop() {
|
||||
self.impl.with { impl in
|
||||
impl.stop()
|
||||
|
@ -168,6 +168,8 @@ typedef NS_ENUM(int32_t, GroupCallNetworkState) {
|
||||
- (void)removeSsrcs:(NSArray<NSNumber *> * _Nonnull)ssrcs;
|
||||
- (void)setIsMuted:(bool)isMuted;
|
||||
|
||||
- (void)setVolumeForSsrc:(uint32_t)ssrc volume:(double)volume;
|
||||
|
||||
- (void)switchAudioOutput:(NSString * _Nonnull)deviceId;
|
||||
- (void)switchAudioInput:(NSString * _Nonnull)deviceId;
|
||||
|
||||
|
@ -1052,6 +1052,12 @@ static void (*InternalVoipLoggingFunction)(NSString *) = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setVolumeForSsrc:(uint32_t)ssrc volume:(double)volume {
|
||||
if (_instance) {
|
||||
_instance->setVolume(ssrc, volume);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)switchAudioOutput:(NSString * _Nonnull)deviceId {
|
||||
if (_instance) {
|
||||
_instance->setAudioOutputDevice(deviceId.UTF8String);
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 6156230e6a50c65e4e6495623989689834e8e09a
|
||||
Subproject commit 727044698c8f3df83c0b6f9b37cc0ec3acba0c98
|
Loading…
x
Reference in New Issue
Block a user