|
@@ -331,85 +331,44 @@ static inline void wd_playControl_queue(void (^block)(void)){
|
|
}
|
|
}
|
|
|
|
|
|
- (void)setM3UList:(MKRM3UListModel *)m3uListModel{
|
|
- (void)setM3UList:(MKRM3UListModel *)m3uListModel{
|
|
- wd_playControl_queue(^{
|
|
|
|
- libupnp_SetNewM3UListV2(m3uListModel.secondsList,
|
|
|
|
- m3uListModel.artistList,
|
|
|
|
- m3uListModel.titleList,
|
|
|
|
- m3uListModel.urlList,
|
|
|
|
- m3uListModel.songFromList,
|
|
|
|
- m3uListModel.channelNO,
|
|
|
|
- m3uListModel.playModeString,
|
|
|
|
- m3uListModel.timeString,
|
|
|
|
- m3uListModel.startIndex,
|
|
|
|
- m3uListModel.endIndex,
|
|
|
|
- m3uListModel.m3uSize,
|
|
|
|
- m3uListModel.channelID,
|
|
|
|
- m3uListModel.channelInfoString);
|
|
|
|
- });
|
|
|
|
|
|
+ libupnp_SetNewM3UListV2(m3uListModel.secondsList,
|
|
|
|
+ m3uListModel.artistList,
|
|
|
|
+ m3uListModel.titleList,
|
|
|
|
+ m3uListModel.urlList,
|
|
|
|
+ m3uListModel.songFromList,
|
|
|
|
+ m3uListModel.channelNO,
|
|
|
|
+ m3uListModel.playModeString,
|
|
|
|
+ m3uListModel.timeString,
|
|
|
|
+ m3uListModel.startIndex,
|
|
|
|
+ m3uListModel.endIndex,
|
|
|
|
+ m3uListModel.m3uSize,
|
|
|
|
+ m3uListModel.channelID,
|
|
|
|
+ m3uListModel.channelInfoString);
|
|
}
|
|
}
|
|
|
|
|
|
-//- (void)setM3UList:(MKRM3UListModel *)m3uListModel {
|
|
|
|
-// wd_playControl_queue(^{
|
|
|
|
-// libupnp_SetNewM3UList(
|
|
|
|
-// m3uListModel.secondsList,
|
|
|
|
-// m3uListModel.artistList,
|
|
|
|
-// m3uListModel.titleList,
|
|
|
|
-// m3uListModel.urlList,
|
|
|
|
-// m3uListModel.cueList,
|
|
|
|
-// m3uListModel.startTimeList,
|
|
|
|
-// m3uListModel.endTimeList,
|
|
|
|
-// m3uListModel.vipCanPlay,
|
|
|
|
-// m3uListModel.albumList,
|
|
|
|
-// m3uListModel.albumArtUriList,
|
|
|
|
-// m3uListModel.durationList,
|
|
|
|
-// m3uListModel.protocolInfoList,
|
|
|
|
-// m3uListModel.upnpclassList,
|
|
|
|
-// m3uListModel.channelNumList,
|
|
|
|
-// m3uListModel.songOrderList,
|
|
|
|
-// m3uListModel.userID,
|
|
|
|
-// m3uListModel.songIDList,
|
|
|
|
-// m3uListModel.songFromList,
|
|
|
|
-// m3uListModel.songAlbumIDList,
|
|
|
|
-// m3uListModel.channelNO,
|
|
|
|
-// m3uListModel.playModeString,
|
|
|
|
-// m3uListModel.timeString,
|
|
|
|
-// m3uListModel.channelPure,
|
|
|
|
-// m3uListModel.channelAlbumID,
|
|
|
|
-// m3uListModel.channelInfoString,
|
|
|
|
-// m3uListModel.userID,
|
|
|
|
-// m3uListModel.startIndex,
|
|
|
|
-// m3uListModel.endIndex,
|
|
|
|
-// m3uListModel.m3uSize,
|
|
|
|
-// @""
|
|
|
|
-// );
|
|
|
|
-// });
|
|
|
|
-//}
|
|
|
|
-
|
|
|
|
- (void)setAVTransportURIWithSong:(id <MKRRadioResorce>)song
|
|
- (void)setAVTransportURIWithSong:(id <MKRRadioResorce>)song
|
|
device:(id <MKRUPnPDevice>)device
|
|
device:(id <MKRUPnPDevice>)device
|
|
userID:(NSString *)userID {
|
|
userID:(NSString *)userID {
|
|
NSString *timestamp = [NSString stringWithFormat:@"%.0f", [[NSDate date] timeIntervalSince1970]];
|
|
NSString *timestamp = [NSString stringWithFormat:@"%.0f", [[NSDate date] timeIntervalSince1970]];
|
|
NSString *channelNumString = [NSString stringWithFormat:@"CHANNEL_UPDATE_%zd",song.songChannel];
|
|
NSString *channelNumString = [NSString stringWithFormat:@"CHANNEL_UPDATE_%zd",song.songChannel];
|
|
- wd_playControl_queue(^{
|
|
|
|
- libupnp_SetAVTransportURI(
|
|
|
|
- device.avTransportUrl,
|
|
|
|
- song.songUrl,
|
|
|
|
- song.songName,
|
|
|
|
- song.songArtist,
|
|
|
|
- song.songAlbum,
|
|
|
|
- song.songAlbumCover,
|
|
|
|
- @"0",
|
|
|
|
- @"null",
|
|
|
|
- @"null",
|
|
|
|
- timestamp,
|
|
|
|
- channelNumString,
|
|
|
|
- @"0",
|
|
|
|
- userID,
|
|
|
|
- @(song.songID).stringValue,
|
|
|
|
- @(song.songFrom).stringValue,
|
|
|
|
- song.songAlbumID?:@""
|
|
|
|
- );
|
|
|
|
- });
|
|
|
|
|
|
+ libupnp_SetAVTransportURI(
|
|
|
|
+ device.avTransportUrl,
|
|
|
|
+ song.songUrl,
|
|
|
|
+ song.songName,
|
|
|
|
+ song.songArtist,
|
|
|
|
+ song.songAlbum,
|
|
|
|
+ song.songAlbumCover,
|
|
|
|
+ @"0",
|
|
|
|
+ @"null",
|
|
|
|
+ @"null",
|
|
|
|
+ timestamp,
|
|
|
|
+ channelNumString,
|
|
|
|
+ @"0",
|
|
|
|
+ userID,
|
|
|
|
+ @(song.songID).stringValue,
|
|
|
|
+ @(song.songFrom).stringValue,
|
|
|
|
+ song.songAlbumID?:@""
|
|
|
|
+ );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -455,6 +414,33 @@ static inline void wd_playControl_queue(void (^block)(void)){
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+- (void)playTempChannelSongs:(NSArray<id<MKRRadioResorce>> *)songs
|
|
|
|
+ index:(NSInteger)index
|
|
|
|
+ device:(id<MKRUPnPDevice>)device
|
|
|
|
+ userID:(NSString *)userID{
|
|
|
|
+ MKRM3UListModel *m3uModel = [MKRM3UListModel tempChannelM3UModelWithSongs:songs startIndex:index];
|
|
|
|
+ m3uModel.userID = userID;
|
|
|
|
+ m3uModel.playModeString = @"REPEAT_ALL";
|
|
|
|
+ wd_playControl_queue(^{
|
|
|
|
+ [[MKRWIFIDeviceManager shareManager] setM3UList:m3uModel];
|
|
|
|
+ [self setAVTransportURIWithSong:songs[index] device:device userID:userID];
|
|
|
|
+ [self playSongWithChannelNO:13 index:index device:device userID:userID];
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+- (void)playTempChannelSongs:(NSArray<id<MKRRadioResorce>> *)songs
|
|
|
|
+ device:(id<MKRUPnPDevice>)device
|
|
|
|
+ userID:(NSString *)userID{
|
|
|
|
+ MKRM3UListModel *m3uModel = [MKRM3UListModel tempChannelM3UModelWithSongs:songs startIndex:index];
|
|
|
|
+ m3uModel.userID = userID;
|
|
|
|
+ m3uModel.playModeString = @"REPEAT_ALL";
|
|
|
|
+ wd_playControl_queue(^{
|
|
|
|
+ [[MKRWIFIDeviceManager shareManager] setM3UList:m3uModel];
|
|
|
|
+ [self setAVTransportURIWithSong:songs[0] device:device userID:userID];
|
|
|
|
+ [self playSongWithChannelNO:13 device:device userID:userID];
|
|
|
|
+ });
|
|
|
|
+}
|
|
|
|
+
|
|
- (void)pauseWithDevice:(id <MKRUPnPDevice>)device {
|
|
- (void)pauseWithDevice:(id <MKRUPnPDevice>)device {
|
|
wd_playControl_queue(^{
|
|
wd_playControl_queue(^{
|
|
libupnp_Pause(device.avTransportUrl);
|
|
libupnp_Pause(device.avTransportUrl);
|