Revert "Volume adjustment"

This reverts commit d906e94c0b513612b37dad2d6890076d5c72636e.
This commit is contained in:
Ali 2020-12-28 15:21:48 +04:00
parent d906e94c0b
commit 83e0c1250e
7 changed files with 32 additions and 4 deletions

View File

@ -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)

View File

@ -57,12 +57,12 @@ func callListViewForLocationAndType(locationAndType: CallListNodeLocationAndType
return (CallListNodeViewUpdate(view: view, type: .Generic, scrollPosition: nil), locationAndType.type)
}
case let .changeType(index):
return account.viewTracker.callListView(type: locationAndType.type, index: index, count: 200) |> map { view -> (CallListNodeViewUpdate, CallListViewType) in
return account.viewTracker.callListView(type: locationAndType.type, index: index, count: 120) |> map { view -> (CallListNodeViewUpdate, CallListViewType) in
return (CallListNodeViewUpdate(view: view, type: .ReloadAnimated, scrollPosition: nil), locationAndType.type)
}
case let .navigation(index):
var first = true
return account.viewTracker.callListView(type: locationAndType.type, index: index, count: 200) |> map { view -> (CallListNodeViewUpdate, CallListViewType) in
return account.viewTracker.callListView(type: locationAndType.type, index: index, count: 120) |> map { view -> (CallListNodeViewUpdate, CallListViewType) in
let genericType: CallListNodeViewUpdateType
if first {
first = false
@ -76,7 +76,7 @@ func callListViewForLocationAndType(locationAndType: CallListNodeLocationAndType
let directionHint: ListViewScrollToItemDirectionHint = sourceIndex > index ? .Down : .Up
let callScrollPosition: CallListNodeViewScrollPosition = .index(index: index, position: scrollPosition, directionHint: directionHint, animated: animated)
var first = true
return account.viewTracker.callListView(type: locationAndType.type, index: index, count: 200) |> map { view -> (CallListNodeViewUpdate, CallListViewType) in
return account.viewTracker.callListView(type: locationAndType.type, index: index, count: 120) |> map { view -> (CallListNodeViewUpdate, CallListViewType) in
let genericType: CallListNodeViewUpdateType
let scrollPosition: CallListNodeViewScrollPosition? = first ? callScrollPosition : nil
if first {

View File

@ -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

View File

@ -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()

View File

@ -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;

View File

@ -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