增加麦序管理的协议

This commit is contained in:
zu
2021-11-04 19:01:19 +08:00
parent 06b1262740
commit 670e0c8e78
8 changed files with 47 additions and 3 deletions

View File

@@ -330,6 +330,7 @@
186A536526FC6F2E00D67B2C /* XCShareItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCShareItem.h; sourceTree = "<group>"; };
186A536726FC6F2E00D67B2C /* XCShareItemCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCShareItemCell.m; sourceTree = "<group>"; };
186A536826FC6F2E00D67B2C /* XCShareItemCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCShareItemCell.h; sourceTree = "<group>"; };
186F8B472733F2AE007A17BC /* MicroQueueProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MicroQueueProtocol.h; sourceTree = "<group>"; };
187EEEDA26E89B32002833B2 /* BaseModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaseModel.h; sourceTree = "<group>"; };
187EEEDB26E89B32002833B2 /* BaseModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BaseModel.m; sourceTree = "<group>"; };
187EEEDF26E89BFB002833B2 /* AccountModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AccountModel.h; sourceTree = "<group>"; };
@@ -1613,6 +1614,7 @@
E8AEAED5271412EC0017FCE0 /* XPRoomViewController.m */,
181D7F222727DB1E00B7C059 /* RoomHostDelegate.h */,
180806F827298F9B001FD836 /* RoomGuestDelegate.h */,
186F8B472733F2AE007A17BC /* MicroQueueProtocol.h */,
E8AEAEE827141ACC0017FCE0 /* RoomHeaderView */,
E8AEAEEA27141ACC0017FCE0 /* StageView */,
E8AEAEE627141ACC0017FCE0 /* MessageContainerView */,

View File

@@ -7,8 +7,11 @@
#import <UIKit/UIKit.h>
#import "RoomHostDelegate.h"
#import "RoomGuestDelegate.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPRoomMenuContainerView : UIView
@interface XPRoomMenuContainerView : UIView<RoomGuestDelegate>
- (instancetype)initWithDelegate:(id<RoomHostDelegate>)delegate;
@end

View File

@@ -76,6 +76,11 @@
}
}
#pragma mark - RoomGuestDelegate
- (void)onMicroQueueUpdate:(NSMutableDictionary<NSString *,MicroQueueModel *> *)queue {
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.stackView];

View File

@@ -0,0 +1,20 @@
//
// MicroQueueProtocol.h
// xplan-ios
//
// Created by apple on 2021/11/4.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@class MicroQueueModel;
@protocol MicroQueueProtocol <NSObject>
@optional
- (NSMutableDictionary<NSString *, MicroQueueModel *>*)getMicroQueue;
- (void)onMicroQueueUpdate:(NSMutableDictionary<NSString *, MicroQueueModel *>*)queue;
@end
NS_ASSUME_NONNULL_END

View File

@@ -9,7 +9,7 @@
NS_ASSUME_NONNULL_BEGIN
@protocol RoomGuestDelegate <NSObject>
@protocol RoomGuestDelegate <NSObject, MicroQueueProtocol>
@optional

View File

@@ -6,13 +6,14 @@
//
#import <Foundation/Foundation.h>
#import "MicroQueueProtocol.h"
NS_ASSUME_NONNULL_BEGIN
@class RoomInfoModel;
@class UserInfoModel;
@protocol RoomHostDelegate <NSObject>
@protocol RoomHostDelegate <NSObject, MicroQueueProtocol>
- (RoomInfoModel*)getRoomInfo;
- (UserInfoModel*)getUserInfo;

View File

@@ -128,6 +128,10 @@
[self initRtcRoom];
}
- (NSMutableDictionary<NSString *,MicroQueueModel *> *)getMicroQueue {
return self.micQueue;
}
#pragma mark - RtcDelegate -
- (void)usersSpeaking:(NSMutableArray *)uids {
if ([RtcManager instance].isRemoteMuted) {
@@ -215,6 +219,7 @@
}
if (microQueueChanged) {
[self microQueueUpdated];
[self.hostDelegate onMicroQueueUpdate:self.micQueue];
}
}

View File

@@ -187,6 +187,14 @@
return self.userInfo;
}
- (NSMutableDictionary<NSString *,MicroQueueModel *> *)getMicroQueue {
return [self.stageView getMicroQueue];
}
- (void)onMicroQueueUpdate:(NSMutableDictionary<NSString *,MicroQueueModel *> *)queue {
[self.menuContainerView onMicroQueueUpdate:queue];
}
- (void)exitRoom {
[self.presenter exitNIMRoom:[NSString stringWithFormat:@"%ld", self.roomInfo.roomId]];
[[RtcManager instance] exitRoom];