|
@@ -90,13 +90,14 @@ static inline void wd_playControl_queue(void (^block)(void)){
|
|
|
|
|
|
- (void)searchDeviceWithSearchTime:(int)searchTime
|
|
- (void)searchDeviceWithSearchTime:(int)searchTime
|
|
timeBlock:(void(^)(NSInteger time))timeBlock {
|
|
timeBlock:(void(^)(NSInteger time))timeBlock {
|
|
- if (_upnpErrorCode == 0) {//开始搜索设备
|
|
|
|
|
|
+ wd_playControl_queue(^{
|
|
|
|
+ if (_upnpErrorCode != 0) {
|
|
|
|
+ [self startUpnp];
|
|
|
|
+ }
|
|
[self checkBaseURL];
|
|
[self checkBaseURL];
|
|
libupnp_BuildFilesList();
|
|
libupnp_BuildFilesList();
|
|
libupnp_SearchDevice(20);
|
|
libupnp_SearchDevice(20);
|
|
- } else {
|
|
|
|
- [self startUpnp];
|
|
|
|
- }
|
|
|
|
|
|
+ });
|
|
__block int count = searchTime +1;
|
|
__block int count = searchTime +1;
|
|
_searchTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(0, 0));
|
|
_searchTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, dispatch_get_global_queue(0, 0));
|
|
dispatch_source_set_timer(_searchTimer, DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
|
|
dispatch_source_set_timer(_searchTimer, DISPATCH_TIME_NOW, 1 * NSEC_PER_SEC, 0 * NSEC_PER_SEC);
|
|
@@ -196,7 +197,9 @@ static inline void wd_playControl_queue(void (^block)(void)){
|
|
-(void)CallBackAddZoneMedia:(NSArray *)nStr Size:(NSInteger)size{
|
|
-(void)CallBackAddZoneMedia:(NSArray *)nStr Size:(NSInteger)size{
|
|
NSLog(@"搜索到设备:%@",nStr);
|
|
NSLog(@"搜索到设备:%@",nStr);
|
|
NSLog(@"%s",__func__);
|
|
NSLog(@"%s",__func__);
|
|
- [self addDevice:nStr];
|
|
|
|
|
|
+ wd_playControl_queue(^{
|
|
|
|
+ [self addDevice:nStr];
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
- (void)updateClockID:(NSString *)clockID clockDic:(NSDictionary *)clockDic clockTime:(NSString *)clockTime operationType:(BOOL)isOn deleteClock:(BOOL)isDelete{
|
|
- (void)updateClockID:(NSString *)clockID clockDic:(NSDictionary *)clockDic clockTime:(NSString *)clockTime operationType:(BOOL)isOn deleteClock:(BOOL)isDelete{
|
|
@@ -284,15 +287,15 @@ static inline void wd_playControl_queue(void (^block)(void)){
|
|
[deviceDict setObject:@"Unknown" forKey:@"devNowArtist"];
|
|
[deviceDict setObject:@"Unknown" forKey:@"devNowArtist"];
|
|
}
|
|
}
|
|
[deviceDict setObject:@"1" forKey:@"isOnLine"];
|
|
[deviceDict setObject:@"1" forKey:@"isOnLine"];
|
|
- id<MKRWIFIDeviceManagerDelegate> obj;
|
|
|
|
- NSEnumerator *enumerator = [self.listeners objectEnumerator];
|
|
|
|
- while ((obj = [enumerator nextObject]) != nil) {
|
|
|
|
- wd_main_queue(^{
|
|
|
|
|
|
+ wd_main_queue(^{
|
|
|
|
+ id<MKRWIFIDeviceManagerDelegate> obj;
|
|
|
|
+ NSEnumerator *enumerator = [self.listeners objectEnumerator];
|
|
|
|
+ while ((obj = [enumerator nextObject]) != nil) {
|
|
if ([obj respondsToSelector:@selector(didSearchNewDevice:)]) {
|
|
if ([obj respondsToSelector:@selector(didSearchNewDevice:)]) {
|
|
[obj didSearchNewDevice:deviceDict];
|
|
[obj didSearchNewDevice:deviceDict];
|
|
}
|
|
}
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
- (void)setM3UList:(MKRM3UListModel *)m3uListModel {
|
|
- (void)setM3UList:(MKRM3UListModel *)m3uListModel {
|