ソースを参照

版本升级维护

yyqxiaoyin 5 年 前
コミット
fe53ff9ee1

+ 7 - 0
MKRRadioManager/Classes/MKRRadioManager/MKRWIFIDeviceManager/MKRWIFIDeviceManager.h

@@ -181,5 +181,12 @@
 
 - (id <MKRRadioResorce>)getPlayingStatusWithDevice:(id <MKRUPnPDevice>)device;
 
+/// 通知设备刷新频道列表
+/// 当channelFlag 为 @"ALL" 时 为更新12个频道
+/// 当channelFlag 为 @"x(频道号)" 时 为更新x频道 eg:@"3"
+/// 当channelFlag 为 @"audition_x(频道号)"时  为通知设备更新x频道 并且在更新后的频道中找到当前播放的歌曲续播 eg: @"audition_3"
+/// @param channelFlag 频道标识
+- (void)setChannelUpdate:(NSString *)channelFlag device:(id <MKRUPnPDevice>)device;
+
 @end
 

+ 5 - 0
MKRRadioManager/Classes/MKRRadioManager/MKRWIFIDeviceManager/MKRWIFIDeviceManager.m

@@ -545,6 +545,11 @@ static inline void wd_playControl_queue(void (^block)(void)){
     });
 }
 
+- (void)setChannelUpdate:(NSString *)channelFlag device:(id<MKRUPnPDevice>)device timeStamp:(NSTimeInterval)timeStamp{
+    NSString *timestamp = [NSString stringWithFormat:@"%.0f", [[NSDate date] timeIntervalSince1970]];
+    libupnp_SetChannelUpdate(device.groupManagementUrl, self.userID, timestamp, channelFlag, @"null");
+}
+
 - (id <MKRRadioResorce>)getPlayingStatusWithDevice:(id <MKRUPnPDevice>)device {
     wd_playControl_queue(^{
         NSDictionary *resultDic = [[ASControlTools sharedInstanceUPNP] libupnp_getPlayInfo:device.avTransportUrl];