From 2d51ab3e7cd5bbd84c35eb85456df461c5233cc0 Mon Sep 17 00:00:00 2001 From: fengshuo <963787902@qq.com> Date: Mon, 9 May 2022 22:18:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E8=83=8C=E6=99=AF=E9=9F=B3?= =?UTF-8?q?=E4=B9=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Music+CoreDataClass.h | 20 ++ Music+CoreDataClass.m | 13 ++ Music+CoreDataProperties.h | 28 +++ Music+CoreDataProperties.m | 25 ++ xplan-ios.xcodeproj/project.pbxproj | 103 +++++++++ xplan-ios/Appdelegate/AppDelegate.h | 7 +- xplan-ios/Appdelegate/AppDelegate.m | 79 +++++++ .../Contents.json | 22 ++ .../room_music_library_nav_add@2x.png | Bin 0 -> 169 bytes .../room_music_library_nav_add@3x.png | Bin 0 -> 263 bytes .../Contents.json | 22 ++ .../room_music_library_pause@2x.png | Bin 0 -> 591 bytes .../room_music_library_pause@3x.png | Bin 0 -> 1066 bytes .../Contents.json | 22 ++ .../room_music_library_play@2x.png | Bin 0 -> 825 bytes .../room_music_library_play@3x.png | Bin 0 -> 1506 bytes .../Contents.json | 22 ++ .../room_music_library_volum_setting@2x.png | Bin 0 -> 245 bytes .../room_music_library_volum_setting@3x.png | Bin 0 -> 487 bytes .../Contents.json | 22 ++ .../room_music_player_enter@2x.png | Bin 0 -> 429 bytes .../room_music_player_enter@3x.png | Bin 0 -> 640 bytes .../Contents.json | 21 ++ .../room_music_small_player_more@3x.png | Bin 0 -> 238 bytes .../Contents.json | 22 ++ .../room_music_small_player_next@2x.png | Bin 0 -> 436 bytes .../room_music_small_player_next@3x.png | Bin 0 -> 643 bytes .../Contents.json | 22 ++ .../room_music_small_player_pause@2x.png | Bin 0 -> 146 bytes .../room_music_small_player_pause@3x.png | Bin 0 -> 257 bytes .../Contents.json | 22 ++ .../room_music_small_player_play@2x.png | Bin 0 -> 392 bytes .../room_music_small_player_play@3x.png | Bin 0 -> 585 bytes .../Contents.json | 22 ++ .../room_music_small_player_voice@2x.png | Bin 0 -> 291 bytes .../room_music_small_player_voice@3x.png | Bin 0 -> 411 bytes .../Contents.json | 22 ++ .../room_music_small_player_white_dot@2x.png | Bin 0 -> 245 bytes .../room_music_small_player_white_dot@3x.png | Bin 0 -> 282 bytes .../Contents.json | 22 ++ .../room_music_voice_setting_dot@2x.png | Bin 0 -> 227 bytes .../room_music_voice_setting_dot@3x.png | Bin 0 -> 342 bytes xplan-ios/Main/RTC/RtcImpl/AgoraRtcImpl.m | 51 +++++ xplan-ios/Main/RTC/RtcImpl/RtcImplDelegate.h | 3 + xplan-ios/Main/RTC/RtcImpl/RtcInterface.h | 16 +- xplan-ios/Main/RTC/RtcImpl/TRTCRtcImpl.m | 70 ++++++ xplan-ios/Main/RTC/RtcImpl/ZegoRtcImpl.m | 71 +++++- xplan-ios/Main/RTC/RtcManager.h | 23 ++ xplan-ios/Main/RTC/RtcManager.m | 23 ++ .../BackMusic/Model/Music+CoreDataClass.h | 20 ++ .../BackMusic/Model/Music+CoreDataClass.m | 13 ++ .../Model/Music+CoreDataProperties.h | 28 +++ .../Model/Music+CoreDataProperties.m | 25 ++ .../BackMusic/Presenter/XPCoreDataManager.h | 33 +++ .../BackMusic/Presenter/XPCoreDataManager.m | 78 +++++++ .../xplan-ios.xcdatamodel/contents | 15 ++ .../XPRoomMusicLibraryEmptyTableViewCell.h | 22 ++ .../XPRoomMusicLibraryEmptyTableViewCell.m | 99 ++++++++ .../Cell/XPRoomMusicLibraryTableViewCell.h | 17 ++ .../Cell/XPRoomMusicLibraryTableViewCell.m | 122 ++++++++++ .../View/SubViews/XPMusicLibraryPlayView.h | 25 ++ .../View/SubViews/XPMusicLibraryPlayView.m | 109 +++++++++ .../View/SubViews/XPRoomBackMusicPlayerView.h | 16 ++ .../View/SubViews/XPRoomBackMusicPlayerView.m | 216 ++++++++++++++++++ .../SubViews/XPRoomMusicVoiceSettingView.h | 31 +++ .../SubViews/XPRoomMusicVoiceSettingView.m | 214 +++++++++++++++++ .../View/XPRoomMusicLibraryViewController.h | 16 ++ .../View/XPRoomMusicLibraryViewController.m | 158 +++++++++++++ .../View/XPRoomTransferMusicViewController.m | 83 ++++--- .../XPRoomFunctionContainerView.m | 91 +++++++- xplan-ios/Main/Tabbar/TabbarViewController.m | 13 +- 71 files changed, 2197 insertions(+), 42 deletions(-) create mode 100644 Music+CoreDataClass.h create mode 100644 Music+CoreDataClass.m create mode 100644 Music+CoreDataProperties.h create mode 100644 Music+CoreDataProperties.m create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_nav_add.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_nav_add.imageset/room_music_library_nav_add@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_nav_add.imageset/room_music_library_nav_add@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_pause.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_pause.imageset/room_music_library_pause@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_pause.imageset/room_music_library_pause@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_play.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_play.imageset/room_music_library_play@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_play.imageset/room_music_library_play@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_volum_setting.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_volum_setting.imageset/room_music_library_volum_setting@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_volum_setting.imageset/room_music_library_volum_setting@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_player_enter.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_player_enter.imageset/room_music_player_enter@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_player_enter.imageset/room_music_player_enter@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_more.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_more.imageset/room_music_small_player_more@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_next.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_next.imageset/room_music_small_player_next@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_next.imageset/room_music_small_player_next@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_pause.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_pause.imageset/room_music_small_player_pause@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_pause.imageset/room_music_small_player_pause@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_play.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_play.imageset/room_music_small_player_play@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_play.imageset/room_music_small_player_play@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_voice.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_voice.imageset/room_music_small_player_voice@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_voice.imageset/room_music_small_player_voice@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_white_dot.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_white_dot.imageset/room_music_small_player_white_dot@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_white_dot.imageset/room_music_small_player_white_dot@3x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_voice_setting_dot.imageset/Contents.json create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_voice_setting_dot.imageset/room_music_voice_setting_dot@2x.png create mode 100644 xplan-ios/Assets.xcassets/Room/BackMusic/room_music_voice_setting_dot.imageset/room_music_voice_setting_dot@3x.png create mode 100644 xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataClass.h create mode 100644 xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataClass.m create mode 100644 xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataProperties.h create mode 100644 xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataProperties.m create mode 100644 xplan-ios/Main/Room/View/BackMusic/Presenter/XPCoreDataManager.h create mode 100644 xplan-ios/Main/Room/View/BackMusic/Presenter/XPCoreDataManager.m create mode 100644 xplan-ios/Main/Room/View/BackMusic/Presenter/xplan-ios.xcdatamodeld/xplan-ios.xcdatamodel/contents create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.h create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.m create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryTableViewCell.h create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryTableViewCell.m create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPMusicLibraryPlayView.h create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPMusicLibraryPlayView.m create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.h create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomMusicVoiceSettingView.h create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomMusicVoiceSettingView.m create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/XPRoomMusicLibraryViewController.h create mode 100644 xplan-ios/Main/Room/View/BackMusic/View/XPRoomMusicLibraryViewController.m diff --git a/Music+CoreDataClass.h b/Music+CoreDataClass.h new file mode 100644 index 00000000..40fabaad --- /dev/null +++ b/Music+CoreDataClass.h @@ -0,0 +1,20 @@ +// +// Music+CoreDataClass.h +// +// +// Created by 冯硕 on 2022/5/9. +// +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface Music : NSManagedObject + +@end + +NS_ASSUME_NONNULL_END + +#import "Music+CoreDataProperties.h" diff --git a/Music+CoreDataClass.m b/Music+CoreDataClass.m new file mode 100644 index 00000000..689ca764 --- /dev/null +++ b/Music+CoreDataClass.m @@ -0,0 +1,13 @@ +// +// Music+CoreDataClass.m +// +// +// Created by 冯硕 on 2022/5/9. +// +// + +#import "Music+CoreDataClass.h" + +@implementation Music + +@end diff --git a/Music+CoreDataProperties.h b/Music+CoreDataProperties.h new file mode 100644 index 00000000..ff6aa99c --- /dev/null +++ b/Music+CoreDataProperties.h @@ -0,0 +1,28 @@ +// +// Music+CoreDataProperties.h +// +// +// Created by 冯硕 on 2022/5/9. +// +// + +#import "Music+CoreDataClass.h" + + +NS_ASSUME_NONNULL_BEGIN + +@interface Music (CoreDataProperties) + ++ (NSFetchRequest *)fetchRequest NS_SWIFT_NAME(fetchRequest()); + +@property (nullable, nonatomic, copy) NSString *author; +@property (nullable, nonatomic, copy) NSString *filePath; +@property (nullable, nonatomic, copy) NSString *musicArtists; +@property (nullable, nonatomic, copy) NSString *musicId; +@property (nullable, nonatomic, copy) NSString *musicName; +@property (nullable, nonatomic, retain) NSData *songAlbum; +@property (nullable, nonatomic, copy) NSString *songName; + +@end + +NS_ASSUME_NONNULL_END diff --git a/Music+CoreDataProperties.m b/Music+CoreDataProperties.m new file mode 100644 index 00000000..67f7cfa9 --- /dev/null +++ b/Music+CoreDataProperties.m @@ -0,0 +1,25 @@ +// +// Music+CoreDataProperties.m +// +// +// Created by 冯硕 on 2022/5/9. +// +// + +#import "Music+CoreDataProperties.h" + +@implementation Music (CoreDataProperties) + ++ (NSFetchRequest *)fetchRequest { + return [NSFetchRequest fetchRequestWithEntityName:@"Music"]; +} + +@dynamic author; +@dynamic filePath; +@dynamic musicArtists; +@dynamic musicId; +@dynamic musicName; +@dynamic songAlbum; +@dynamic songName; + +@end diff --git a/xplan-ios.xcodeproj/project.pbxproj b/xplan-ios.xcodeproj/project.pbxproj index bf13268c..1df6c6b6 100644 --- a/xplan-ios.xcodeproj/project.pbxproj +++ b/xplan-ios.xcodeproj/project.pbxproj @@ -367,6 +367,8 @@ E82D5C76276AEB5100858D6D /* NameplateModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E82D5C75276AEB5100858D6D /* NameplateModel.m */; }; E82D5C7A276B25D100858D6D /* SpriteSheetImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E82D5C79276B25D100858D6D /* SpriteSheetImageManager.m */; }; E82D5C7D276B343300858D6D /* YYAnimatedImageView+ImageShow.m in Sources */ = {isa = PBXBuildFile; fileRef = E82D5C7C276B343300858D6D /* YYAnimatedImageView+ImageShow.m */; }; + E82E74FD2828B23D00C25EF7 /* xplan-ios.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = E82E74FB2828B23D00C25EF7 /* xplan-ios.xcdatamodeld */; }; + E82E75062828E76400C25EF7 /* XPCoreDataManager.m in Sources */ = {isa = PBXBuildFile; fileRef = E82E75052828E76400C25EF7 /* XPCoreDataManager.m */; }; E82EE0F8272FDDFA00D15DC1 /* UserPrivacyView.m in Sources */ = {isa = PBXBuildFile; fileRef = E82EE0F7272FDDFA00D15DC1 /* UserPrivacyView.m */; }; E833ED0D274FAD1C00A2463B /* XPKickUserModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E833ED0C274FAD1C00A2463B /* XPKickUserModel.m */; }; E836DBCD279BF2F10056F7DD /* XPLittleGameRoomListView.m in Sources */ = {isa = PBXBuildFile; fileRef = E836DBCC279BF2F10056F7DD /* XPLittleGameRoomListView.m */; }; @@ -523,6 +525,14 @@ E88B5CBD26FB3BDF00DA9178 /* XPTeenagerAlertView.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CBC26FB3BDF00DA9178 /* XPTeenagerAlertView.m */; }; E88B5CC126FB407B00DA9178 /* XPMineUserInfoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CC026FB407B00DA9178 /* XPMineUserInfoViewController.m */; }; E88B5CC526FB42B000DA9178 /* XPMineUserInfoHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = E88B5CC426FB42B000DA9178 /* XPMineUserInfoHeaderView.m */; }; + E88C72912828EA4E0047FB2B /* Music+CoreDataProperties.m in Sources */ = {isa = PBXBuildFile; fileRef = E88C728F2828EA4E0047FB2B /* Music+CoreDataProperties.m */; }; + E88C72922828EA4E0047FB2B /* Music+CoreDataClass.m in Sources */ = {isa = PBXBuildFile; fileRef = E88C72902828EA4E0047FB2B /* Music+CoreDataClass.m */; }; + E88C72952828F1AD0047FB2B /* XPRoomMusicLibraryViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E88C72942828F1AD0047FB2B /* XPRoomMusicLibraryViewController.m */; }; + E88C72992828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E88C72982828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.m */; }; + E88C729C2828F37D0047FB2B /* XPRoomMusicLibraryEmptyTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E88C729B2828F37D0047FB2B /* XPRoomMusicLibraryEmptyTableViewCell.m */; }; + E88C72A02828FCD40047FB2B /* XPMusicLibraryPlayView.m in Sources */ = {isa = PBXBuildFile; fileRef = E88C729F2828FCD40047FB2B /* XPMusicLibraryPlayView.m */; }; + E88C72A3282917590047FB2B /* XPRoomMusicVoiceSettingView.m in Sources */ = {isa = PBXBuildFile; fileRef = E88C72A2282917590047FB2B /* XPRoomMusicVoiceSettingView.m */; }; + E88C72A6282921D60047FB2B /* XPRoomBackMusicPlayerView.m in Sources */ = {isa = PBXBuildFile; fileRef = E88C72A5282921D60047FB2B /* XPRoomBackMusicPlayerView.m */; }; E890BC04273CF0500007C46B /* XPGiftCountModel.m in Sources */ = {isa = PBXBuildFile; fileRef = E890BC03273CF0500007C46B /* XPGiftCountModel.m */; }; E890BC07273CF1800007C46B /* XPGiftCountCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = E890BC06273CF1800007C46B /* XPGiftCountCollectionViewCell.m */; }; E890BC0D273D09A50007C46B /* XPGiftCountView.m in Sources */ = {isa = PBXBuildFile; fileRef = E890BC0C273D09A50007C46B /* XPGiftCountView.m */; }; @@ -1512,6 +1522,9 @@ E82D5C79276B25D100858D6D /* SpriteSheetImageManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SpriteSheetImageManager.m; sourceTree = ""; }; E82D5C7B276B343300858D6D /* YYAnimatedImageView+ImageShow.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YYAnimatedImageView+ImageShow.h"; sourceTree = ""; }; E82D5C7C276B343300858D6D /* YYAnimatedImageView+ImageShow.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "YYAnimatedImageView+ImageShow.m"; sourceTree = ""; }; + E82E74FC2828B23D00C25EF7 /* xplan-ios.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "xplan-ios.xcdatamodel"; sourceTree = ""; }; + E82E75042828E76400C25EF7 /* XPCoreDataManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPCoreDataManager.h; sourceTree = ""; }; + E82E75052828E76400C25EF7 /* XPCoreDataManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPCoreDataManager.m; sourceTree = ""; }; E82EE0F6272FDDFA00D15DC1 /* UserPrivacyView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = UserPrivacyView.h; sourceTree = ""; }; E82EE0F7272FDDFA00D15DC1 /* UserPrivacyView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = UserPrivacyView.m; sourceTree = ""; }; E833ED0B274FAD1C00A2463B /* XPKickUserModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPKickUserModel.h; sourceTree = ""; }; @@ -1839,6 +1852,22 @@ E88B5CC026FB407B00DA9178 /* XPMineUserInfoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfoViewController.m; sourceTree = ""; }; E88B5CC326FB42B000DA9178 /* XPMineUserInfoHeaderView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfoHeaderView.h; sourceTree = ""; }; E88B5CC426FB42B000DA9178 /* XPMineUserInfoHeaderView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfoHeaderView.m; sourceTree = ""; }; + E88C728D2828EA4E0047FB2B /* Music+CoreDataProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Music+CoreDataProperties.h"; sourceTree = ""; }; + E88C728E2828EA4E0047FB2B /* Music+CoreDataClass.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Music+CoreDataClass.h"; sourceTree = ""; }; + E88C728F2828EA4E0047FB2B /* Music+CoreDataProperties.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Music+CoreDataProperties.m"; sourceTree = ""; }; + E88C72902828EA4E0047FB2B /* Music+CoreDataClass.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "Music+CoreDataClass.m"; sourceTree = ""; }; + E88C72932828F1AD0047FB2B /* XPRoomMusicLibraryViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMusicLibraryViewController.h; sourceTree = ""; }; + E88C72942828F1AD0047FB2B /* XPRoomMusicLibraryViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMusicLibraryViewController.m; sourceTree = ""; }; + E88C72972828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMusicLibraryTableViewCell.h; sourceTree = ""; }; + E88C72982828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMusicLibraryTableViewCell.m; sourceTree = ""; }; + E88C729A2828F37D0047FB2B /* XPRoomMusicLibraryEmptyTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMusicLibraryEmptyTableViewCell.h; sourceTree = ""; }; + E88C729B2828F37D0047FB2B /* XPRoomMusicLibraryEmptyTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMusicLibraryEmptyTableViewCell.m; sourceTree = ""; }; + E88C729E2828FCD40047FB2B /* XPMusicLibraryPlayView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMusicLibraryPlayView.h; sourceTree = ""; }; + E88C729F2828FCD40047FB2B /* XPMusicLibraryPlayView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMusicLibraryPlayView.m; sourceTree = ""; }; + E88C72A1282917590047FB2B /* XPRoomMusicVoiceSettingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMusicVoiceSettingView.h; sourceTree = ""; }; + E88C72A2282917590047FB2B /* XPRoomMusicVoiceSettingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMusicVoiceSettingView.m; sourceTree = ""; }; + E88C72A4282921D60047FB2B /* XPRoomBackMusicPlayerView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomBackMusicPlayerView.h; sourceTree = ""; }; + E88C72A5282921D60047FB2B /* XPRoomBackMusicPlayerView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomBackMusicPlayerView.m; sourceTree = ""; }; E890BC02273CF0500007C46B /* XPGiftCountModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftCountModel.h; sourceTree = ""; }; E890BC03273CF0500007C46B /* XPGiftCountModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPGiftCountModel.m; sourceTree = ""; }; E890BC05273CF1800007C46B /* XPGiftCountCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPGiftCountCollectionViewCell.h; sourceTree = ""; }; @@ -4287,6 +4316,27 @@ path = SpriteSheetManager; sourceTree = ""; }; + E82E74F92828B1FC00C25EF7 /* Model */ = { + isa = PBXGroup; + children = ( + E88C728D2828EA4E0047FB2B /* Music+CoreDataProperties.h */, + E88C728E2828EA4E0047FB2B /* Music+CoreDataClass.h */, + E88C728F2828EA4E0047FB2B /* Music+CoreDataProperties.m */, + E88C72902828EA4E0047FB2B /* Music+CoreDataClass.m */, + ); + path = Model; + sourceTree = ""; + }; + E82E74FA2828B20F00C25EF7 /* Presenter */ = { + isa = PBXGroup; + children = ( + E82E74FB2828B23D00C25EF7 /* xplan-ios.xcdatamodeld */, + E82E75042828E76400C25EF7 /* XPCoreDataManager.h */, + E82E75052828E76400C25EF7 /* XPCoreDataManager.m */, + ); + path = Presenter; + sourceTree = ""; + }; E838D99D275E1B6C0079E0B5 /* AnimationView */ = { isa = PBXGroup; children = ( @@ -5016,6 +5066,30 @@ path = MineInfo; sourceTree = ""; }; + E88C72962828F3410047FB2B /* Cell */ = { + isa = PBXGroup; + children = ( + E88C72972828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.h */, + E88C72982828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.m */, + E88C729A2828F37D0047FB2B /* XPRoomMusicLibraryEmptyTableViewCell.h */, + E88C729B2828F37D0047FB2B /* XPRoomMusicLibraryEmptyTableViewCell.m */, + ); + path = Cell; + sourceTree = ""; + }; + E88C729D2828FCB10047FB2B /* SubViews */ = { + isa = PBXGroup; + children = ( + E88C729E2828FCD40047FB2B /* XPMusicLibraryPlayView.h */, + E88C729F2828FCD40047FB2B /* XPMusicLibraryPlayView.m */, + E88C72A1282917590047FB2B /* XPRoomMusicVoiceSettingView.h */, + E88C72A2282917590047FB2B /* XPRoomMusicVoiceSettingView.m */, + E88C72A4282921D60047FB2B /* XPRoomBackMusicPlayerView.h */, + E88C72A5282921D60047FB2B /* XPRoomBackMusicPlayerView.m */, + ); + path = SubViews; + sourceTree = ""; + }; E8937ABF276C3ECF00B2C7E1 /* enterroom */ = { isa = PBXGroup; children = ( @@ -6323,7 +6397,9 @@ E8E859E628264F0000EE4857 /* BackMusic */ = { isa = PBXGroup; children = ( + E82E74F92828B1FC00C25EF7 /* Model */, E8E859EA28264F4C00EE4857 /* View */, + E82E74FA2828B20F00C25EF7 /* Presenter */, ); path = BackMusic; sourceTree = ""; @@ -6331,8 +6407,12 @@ E8E859EA28264F4C00EE4857 /* View */ = { isa = PBXGroup; children = ( + E88C729D2828FCB10047FB2B /* SubViews */, + E88C72962828F3410047FB2B /* Cell */, E8E859E728264F4500EE4857 /* XPRoomTransferMusicViewController.h */, E8E859E828264F4500EE4857 /* XPRoomTransferMusicViewController.m */, + E88C72932828F1AD0047FB2B /* XPRoomMusicLibraryViewController.h */, + E88C72942828F1AD0047FB2B /* XPRoomMusicLibraryViewController.m */, ); path = View; sourceTree = ""; @@ -6547,6 +6627,7 @@ 9B9EEF5427C8AFEA006B0EB3 /* XPSkillCardRecordPropModel.m in Sources */, E80B0737280D790400A79F63 /* GuildMessageModel.m in Sources */, E8B846D826FDE17300A777FE /* XPMineRechargeProtocol.h in Sources */, + E88C72A6282921D60047FB2B /* XPRoomBackMusicPlayerView.m in Sources */, E82D5C7D276B343300858D6D /* YYAnimatedImageView+ImageShow.m in Sources */, E851E45F27FF0FEB002F3ACB /* XPGuildSearchNavView.m in Sources */, E8B846C726FDB45000A777FE /* XPMineUserInfoAlbumProtocol.h in Sources */, @@ -6554,6 +6635,7 @@ E8DEC992276441AA0078CB70 /* XPCandyTreeAnimationModel.m in Sources */, 9B1EF3D527E8294B00554295 /* XPMineDressEmptyCollectionViewCell.m in Sources */, E890BC07273CF1800007C46B /* XPGiftCountCollectionViewCell.m in Sources */, + E88C72A02828FCD40047FB2B /* XPMusicLibraryPlayView.m in Sources */, E8C1670C28067DED00ECB15C /* XPMineGuildChooseManagerViewController.m in Sources */, E81EF6E8279AC21E00FF3EDE /* Api+LittleGame.m in Sources */, E8EEB91126FC6AE2007C6EBA /* XPMineUserInfoEditProtocol.h in Sources */, @@ -6704,6 +6786,7 @@ E80DE40A277568D300BE5BCB /* ThemeColor+FirstRecharge.m in Sources */, 9BC5C8ED277AFF63007C8719 /* XPNobleCenterViewController.m in Sources */, 9B92A34A2797F35E00AD168F /* XPMatchManageTableViewCell.m in Sources */, + E82E74FD2828B23D00C25EF7 /* xplan-ios.xcdatamodeld in Sources */, 18EE3FE22750C29D00A452BF /* NIMBadgeView.m in Sources */, E82EE0F8272FDDFA00D15DC1 /* UserPrivacyView.m in Sources */, E8DEC9A42764A6600078CB70 /* XPMoreMenuPresenter.m in Sources */, @@ -6771,6 +6854,7 @@ 189DD74A26E21D8400AB55B1 /* SSKeychain.m in Sources */, E8DACCFE27673F870052092C /* GiftValueInfoModel.m in Sources */, E8412F9927799249006E1101 /* InviteFansModel.m in Sources */, + E88C72912828EA4E0047FB2B /* Music+CoreDataProperties.m in Sources */, E84BF7CA277AF79D00EF8877 /* XPRoomSettingTagCell.m in Sources */, 9BE9F0F927FED12D00667200 /* XPAnchorFansPrivilegeModel.m in Sources */, E8B846CF26FDD96100A777FE /* XPMineRechageHeadView.m in Sources */, @@ -7034,6 +7118,7 @@ E824545126F5CE6E00BE8163 /* XPMineModifPayPwdPresenter.m in Sources */, E8A86DF727BA2F1C001C21F9 /* XPRoomLittleGameContainerView.m in Sources */, E880B3AF278BE1D800A83B0D /* Api+AcrossRoomPK.m in Sources */, + E88C72992828F3620047FB2B /* XPRoomMusicLibraryTableViewCell.m in Sources */, E8D34D4728080295009C4835 /* XPMineUserDataViewController.m in Sources */, E8EEB90F26FC6AB8007C6EBA /* XPMineUserInfoEditPresenter.m in Sources */, E873EB09280960990071030D /* XPMineUserInfoVoiceCardView.m in Sources */, @@ -7064,6 +7149,7 @@ E89DA67527009ACD008483C1 /* XPMineRechargeNavView.m in Sources */, E8C1672A2806B1E500ECB15C /* XPGuildSuperAdminSetTableViewCell.m in Sources */, E8834E4528003A8F0029CCC1 /* XPMineMangerListViewController.m in Sources */, + E82E75062828E76400C25EF7 /* XPCoreDataManager.m in Sources */, 1808072D2731598F001FD836 /* XPNetImageYYLabel.m in Sources */, E800806827FD3B520055A8AB /* XPClanMenuView.m in Sources */, E896EFAF2771AF0F00AD2CC1 /* XPMineFriendEmptyTableViewCell.m in Sources */, @@ -7080,6 +7166,7 @@ E8E5E18E27C3331E00F457D8 /* XPHomeRecommendViewController.m in Sources */, 9BE9F0FF27FED76500667200 /* XPAnchorFansTaskModel.m in Sources */, 9B73CD05279A9A6A006AF255 /* XPSkillCardSaveModel.m in Sources */, + E88C72922828EA4E0047FB2B /* Music+CoreDataClass.m in Sources */, E8E7DAE82744F5EF00C631CC /* XPGiftStorage.m in Sources */, E8AA6EEF27DF1E6B009B4C2B /* XPRoomTopicViewController.m in Sources */, E87AE7FC277AAC450037823A /* XPRoomTagPresenter.m in Sources */, @@ -7174,6 +7261,7 @@ E82D5C76276AEB5100858D6D /* NameplateModel.m in Sources */, E800806227FD373D0055A8AB /* XPClanMemberTableViewCell.m in Sources */, E80016452804268E00D6D17A /* XPMineClanIncomeStatisViewController.m in Sources */, + E88C72A3282917590047FB2B /* XPRoomMusicVoiceSettingView.m in Sources */, E84150BF27747BD300A7F548 /* Api+FirstRecharge.m in Sources */, E8E859CF28264C2300EE4857 /* DDNumber.m in Sources */, E84B0E422727EE0A008818C6 /* XPRoomMessageHeaderView.m in Sources */, @@ -7242,9 +7330,11 @@ 189DD58F26DF97E700AB55B1 /* LoginPresenter.m in Sources */, E8C167272806A68F00ECB15C /* GuildRoomInfoModel.m in Sources */, E88863C9278EBA43004BCFAB /* XPAcrossRoomPKForceEndResultView.m in Sources */, + E88C72952828F1AD0047FB2B /* XPRoomMusicLibraryViewController.m in Sources */, E8E859D728264C2300EE4857 /* DDLog.m in Sources */, E896EFB22771C93B00AD2CC1 /* XPMineFriendNumberView.m in Sources */, 9BB5495F2782E9DB0090CD26 /* NobleAuthInfo.m in Sources */, + E88C729C2828F37D0047FB2B /* XPRoomMusicLibraryEmptyTableViewCell.m in Sources */, 9B85F3562806DD8A006EDF51 /* XPAnchorPKFinishView.m in Sources */, E855516728059692005F293F /* GuildIncomeDetailModel.m in Sources */, E89DA67227008D59008483C1 /* WalletInfoModel.m in Sources */, @@ -7454,6 +7544,19 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCVersionGroup section */ + E82E74FB2828B23D00C25EF7 /* xplan-ios.xcdatamodeld */ = { + isa = XCVersionGroup; + children = ( + E82E74FC2828B23D00C25EF7 /* xplan-ios.xcdatamodel */, + ); + currentVersion = E82E74FC2828B23D00C25EF7 /* xplan-ios.xcdatamodel */; + path = "xplan-ios.xcdatamodeld"; + sourceTree = ""; + versionGroupType = wrapper.xcdatamodel; + }; +/* End XCVersionGroup section */ }; rootObject = 189DD52126DE255300AB55B1 /* Project object */; } diff --git a/xplan-ios/Appdelegate/AppDelegate.h b/xplan-ios/Appdelegate/AppDelegate.h index dde3a8ab..8b0d5d2b 100644 --- a/xplan-ios/Appdelegate/AppDelegate.h +++ b/xplan-ios/Appdelegate/AppDelegate.h @@ -6,10 +6,15 @@ // #import - +#import @interface AppDelegate : UIResponder @property (strong, nonatomic) UIWindow *window; +@property(nonatomic,strong,readonly)NSManagedObjectContext *managedObjectContext; +@property(nonatomic,strong,readonly)NSManagedObjectModel *managedObjectModel; +@property(nonatomic,strong,readonly)NSPersistentStoreCoordinator *persistentStoreCoordinator; +- (void)saveContext; +- (NSURL *)applicationDocumentsDirectory; @end diff --git a/xplan-ios/Appdelegate/AppDelegate.m b/xplan-ios/Appdelegate/AppDelegate.m index a2d5875a..6d784180 100644 --- a/xplan-ios/Appdelegate/AppDelegate.m +++ b/xplan-ios/Appdelegate/AppDelegate.m @@ -67,4 +67,83 @@ } +#pragma mark - Core Data stack +@synthesize managedObjectContext = _managedObjectContext; +@synthesize managedObjectModel = _managedObjectModel; +@synthesize persistentStoreCoordinator = _persistentStoreCoordinator; + +-(NSURL *)applicationDocumentsDirectory{ + return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; +} + +- (NSManagedObjectModel *)managedObjectModel { + // The managed object model for the application. It is a fatal error for the application not to be able to find and load its model. + if (_managedObjectModel != nil) { + return _managedObjectModel; + } + NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"_1_______" withExtension:@"momd"]; + _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; + return _managedObjectModel; +} + +- (NSPersistentStoreCoordinator *)persistentStoreCoordinator { + // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. + if (_persistentStoreCoordinator != nil) { + return _persistentStoreCoordinator; + } + + // Create the coordinator and store + + _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; + NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"_1_______.sqlite"]; + NSError *error = nil; + NSString *failureReason = @"There was an error creating or loading the application's saved data."; + if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { + // Report any error we got. + NSMutableDictionary *dict = [NSMutableDictionary dictionary]; + dict[NSLocalizedDescriptionKey] = @"Failed to initialize the application's saved data"; + dict[NSLocalizedFailureReasonErrorKey] = failureReason; + dict[NSUnderlyingErrorKey] = error; + error = [NSError errorWithDomain:@"YOUR_ERROR_DOMAIN" code:9999 userInfo:dict]; + // Replace this with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + + return _persistentStoreCoordinator; +} + + +- (NSManagedObjectContext *)managedObjectContext { + // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) + if (_managedObjectContext != nil) { + return _managedObjectContext; + } + + NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; + if (!coordinator) { + return nil; + } + _managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; + [_managedObjectContext setPersistentStoreCoordinator:coordinator]; + return _managedObjectContext; +} + +#pragma mark - Core Data Saving support + +- (void)saveContext { + NSManagedObjectContext *managedObjectContext = self.managedObjectContext; + if (managedObjectContext != nil) { + NSError *error = nil; + if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) { + // Replace this implementation with code to handle the error appropriately. + // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. + NSLog(@"Unresolved error %@, %@", error, [error userInfo]); + abort(); + } + } +} + + @end diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_nav_add.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_nav_add.imageset/Contents.json new file mode 100644 index 00000000..1c380019 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_nav_add.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_music_library_nav_add@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_music_library_nav_add@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_nav_add.imageset/room_music_library_nav_add@2x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_nav_add.imageset/room_music_library_nav_add@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..8635a94e9005d702f1c5dbf7099411078a380e22 GIT binary patch literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^Iv~u!0wlNePU-?u1)eUBAr-gYUbp5uV8Fo~uxyU) z-AT=dMDHm6HCQ%jX4dBYiW-{?jHmSE9^w`5JK*y85OcYe_&4@4y*bJe8xjuMw})GA zDB9W+na3XXt7$G@wc(liuE())Av*r@EEe|RvvxVs7i7JN z*C}v%l!Dlnsn3*`IG?CFveP-HL!pU72}X3R?@+!lm+jXz#dprHSAUoxSh`?#`$sJeVG53>3H4pJC)*08-YG!@O1TaS?83{1OT1mYwiF5 literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_pause.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_pause.imageset/Contents.json new file mode 100644 index 00000000..e9866ae6 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_pause.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_music_library_pause@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_music_library_pause@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_pause.imageset/room_music_library_pause@2x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_pause.imageset/room_music_library_pause@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..2bea0aae5ad83682044bd9dfc91537d21629aed0 GIT binary patch literal 591 zcmeAS@N?(olHy`uVBq!ia0vp^VIa)G3?!2}CLRS+egQrqu0Zgn4fIOfe z1OVBeKYxbE14ZDB@87=zx&QzFhYSAS#&%4&v-E1)!s}fjyX2jsuU4E|zb<)6@#^{uIlTNczs23OQnTn@?R8k#r&D`b zle(zzxhy7q4qm^NCi)jeFHM^`y_Z{P&qH1{!)=kD#cUrludbN9$s$DS-m+6i)*kwP zuB(5AWJl%M_ATxynm=ZAe*f*tm~6t-wc>;SVofLW3ULjU2WMRjh5w0&1iSoKUCdI} z*2GgbZIMo$WmnPfG|~Q=e4+D({b#!m-4vVcWR=ZuAlT}()B&yev5Xc!*Dzl=nQpyc zSQeh5T)|7)|x1Ofw7?8Rkvni<+3RQ2A%#5ur(C9vxCQ zdtCNyR5{@wxx4+$%8i#!{E+rZT)^ezz!o97CoN%t<8-zyQaU*b+Z^AiC>Rv7amL?s zcQwB8i!XlbpTc0<*Z(fevR$|Osg=nYv34cF=L|o!Wi?rA4+G(_7Jz5z)H1IR|^ ze*gX*nfvS4FQ77@AXqs_k<_WSb#-yd)E zaKR#yf4{3h`OzFTCD$fT7R#Q2NXl9pRzf zN1k#|Qah&Ib#~HvEh$k=VE6;@;GM?A8o1%8gbkEjYskX!Hh`q9i`1ItW z>#Xl?XZM}v);-T0yX%Oo-=U8)dGor;wC@JV)PPQaqh8f*sDFGA#t~>n9l^w6>~G1 zwo4Q$%u1NH_?xTn4?aH;-vgF>hd7-~4sj|iIm8*1(<(eikVBm#p+#6C;~|UGyaFb9 z5kH3?Q+yxzFOWac&-(MHL!IB0c=0FK-G2UU{3EA1{jU11T=U~@|T?- zjXF0M&kOkU&*2xJ>WmY%lm5g?O-tgOHhE|8+TH-Bw?5DEV*k}9GUe-ZXeiFU5bj@7pf5AMDKP{oj5Rmxv0!^}MR`Uzt%gSF_OB#X3y* z-|Y1CxJ&AH0;^{E+;tXu0>x&7T7yRcnLO4mthvG~+J;e&TW z-!H3U)NqrS^3V05;L?X1zC65p^%Fzkk%w!twzOzc*8Q1z1*V@)! zSRJwBSaCC>$hoM`l5tNocvRvg=l2)-KKm2?^_+dE-;NafgGW~y@IBvTBKQ8I&xV2v zU;khEw>@Oe{}X~spC8DWzt8NTW$&S%hW(;)-(^$OJLOiFd=~`fGzL#sKbLh*2~7Y{ Clra4O literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_play.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_play.imageset/Contents.json new file mode 100644 index 00000000..c987db3a --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_play.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_music_library_play@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_music_library_play@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_play.imageset/room_music_library_play@2x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_play.imageset/room_music_library_play@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..6a602a15bbc3b10e52405090961cd7477c827b73 GIT binary patch literal 825 zcmeAS@N?(olHy`uVBq!ia0vp^VIa)G3?!2}CLRS+lLLH0T!Hl0uV24?`vxR`{P+Q6 zK-fU?%a<=eK{$Yj1Gx~X@87=z89*)n|Nn;w0!g4Ckc4Rbzm4tdm-l~82mRZt@cqrj zU$=Vx9@PEz;lcM8M}9os^z;70Uso!ApHKd`OYHAq({G<%et)*-_r<)wM;$CCnWO=o zC0i2Y7tHYH>lW3;LBB#pE}cH_edF-lJa=1jCCyjo zEi>#h?w^K z^nt}2_gqSqNXWBP+8gIOp(`wVQ{c{k0&OGH?gfgoCU#o2E!&|MyO5u`&LfJ6O<6}_ zt1Dyj(I$~uEMk+|7n@NRRuR6gPt%RN&c8f_-`w;x*W0+S zv+QrD{QUV*P=BStIj-r)>i=^8pPy(e z?VPCe?(LG96{(xWlGJ3TbaIwmojGH>yX)usd}2$_)lV;-)b#%u@1(GLzXEBChFpOF7P{IK;F#rTslQx%wx-mpC}$0$t7_+O2W zqU{++ZV^VqMp5DQhKUNou||&C!raD+X2Ls_Ss8=V6`r2{7aFL!jV(KiLp=B54F6v1 osqVR9XYP9+mboetQdq|zp)*nKRqtD1T4P}FboFyt=akR{0IETxmjD0& literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_play.imageset/room_music_library_play@3x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_play.imageset/room_music_library_play@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..3c3775f883e434e481190fdb5b760113d6a74c79 GIT binary patch literal 1506 zcmYjRXH*kb7)^l^2phzM0vf^$GJ-M!QHq4Hmo$nH%9Ju>XhazjR+t)P8z@6%N!SG$ zp@Jv~f@}~WkOC=F*^t3*Je+#^o%8O!-~I0Q&Ut@clC8Cg0O%|T000P>nHt%#Ir{tI z;bh}r1k{~P1GbiE6q^|g2Axi4)Z67yqA2)&M+w1hrxg+waqgJ`y3Bu7EslCr3jFl1Q-0Qs| z|NVZ~gD%wJI~Ze)!dz@U=&@xkb+Ts5Skx@mbiqN#WyMDR?=Mshva|jbKwsLukS_%C z0&Zr=jIZiYZBCO2?-istpZ?QY?=0FIcXwvkpepnMj2L;tI0sBD2LQM-&5W+1Lnzd# z1m{VZF!x5fmlOgagOFJnvgrpCQVcCZkG+(G$SJY8o}c25p3g)y*Qw;Gq;m|AxPj!b zN(^j^0}^8(oX^q|B7mDaTSRfgOB83{9I z7C4B*r{{dRS%mf}!D7i5JYd9;7pCRF zVUCo$4mV8!eM5tF-H47wC3XgSJ&Q%|wkBcWalT4)%c9b21zG*flq&1zG;jL0X%3u` z*hf``;0o4+(>-zq-&JTJ?|f6x{L?`O{z@T8LszDWaLU^%Hu#pIVqME>(#QFiL<#@w z#H~Tq=~p^89}W&E4H@Il)ed?OE8G`zfZ-@FVk&Y+9B=&OFoD5Mmil~w z=Q~Z6-y&1BLlly?h|7oKX|>{IGvx$J^|X@riQF&M+wQ5$+K^a(sEE_xj=3>DYA#u7 zX#&WB-Mm=AEW_QNgWE9@1;C3yH8SMQ+xTXYLrpHClSf3MK0k8L4d{ohoX^9e9CubE z{ID&{G(q3~C9`rqZF2Vthk3jz1k~f2o^z$s3Z)6fDaTl~xP3iT87X|c)7-dV~3$Mmy$RUSWLq&Z|gvnfZ@RB6n;*Pfzepv^`^W=U_Zp~MN={i^ocS7n>xbS>b zv4Ox9k>2xdBZJ${S!(0zT}ajSP6vX2OSKyg)^Y|Pn6Y;j>g1Fxf|OsqPg|Mfx|^lA zT#@;CA2SbLj*#*3AYtSOfX|&$Uz30Ti?k})K6yb2ZtlN+z!DAy6tryjpBvX!|5;zQ zsx)WJH_Cs+c~kHa1G6*7<0q*H7c12(^g2C0)*o%}p;RZz6lc*663Bc$e5V#ne)=^y4l(77%j)M@+5KGa7Q;Pd&761#^UL`L_GY}h`!M5HZAn%ZkH zXVw*+NjFVHRfMd=O5Dm literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_volum_setting.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_volum_setting.imageset/Contents.json new file mode 100644 index 00000000..1e85b8aa --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_volum_setting.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_music_library_volum_setting@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_music_library_volum_setting@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_volum_setting.imageset/room_music_library_volum_setting@2x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_volum_setting.imageset/room_music_library_volum_setting@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..da022a93fa1ac2186779c9a807685bfe0bd6ccc4 GIT binary patch literal 245 zcmeAS@N?(olHy`uVBq!ia0vp^Iv~u#3?$#IayJ4}asfUeu0Yxt3{1cP$TTuCf`|ag z%N*B)fGRjkg8YIRj(l7zn5R~zA(J)vHBhkD)5S4F<9xD&#DO#uVNMNoht|nyix^B- zY*1bGA!WseXJ-UjI@cMiJ4PBWSGpZyDXeD08hJxl&xSE_#^i`ZPsWf$3+C7ep-0a; zGY%Q-7g#KHPT`!YfrE77vCbKX3gmQc_@5{4YH8U0@t94T)xn9YJ}f_|7Lv#t^Rn82 akzv!twtsc!+CqR1VeoYIb6Mw<&;$UqJWs>` literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_volum_setting.imageset/room_music_library_volum_setting@3x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_library_volum_setting.imageset/room_music_library_volum_setting@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..f40c9275e82eb91b398396720ac949c3b5b48c8f GIT binary patch literal 487 zcmeAS@N?(olHy`uVBq!ia0vp^P9V&|3?#2~eYgdrq5^zET!FNak&&^nF_45X^z`)L zYzV{9&=6S!$Tcu9(9qBT3If?cpsTB^t*s3-1Ok8}K*p`3FMa?`mn{kM3udU#@BdmM zc+>FQzRsja+h)XAYjPi587d?G`ckIrro28@1_nlXPZ!6Kh{JEM-Rx>H5NLh)B1C9= z+4XJHKmS{A$+t6WMM_Xh;frJc!+vtKD6iVg|9;mi9i_YRwNA;LffLW#GAUYJnqv^B z@FK{-g*Q;vd580z>cvenx0W1Fm}hyLF>%RZf4M__f#vaR9jQTvR~a99yH4G&9r)r+ z;-wCu1u-rk`deH+T2;L{`}+hpV_?%;J%tCJ4g&fU8ZI2+x*2GG$c^EZiIeb~5AUTd zJ4=#u9IbjQb_8~C-mflFdY-@R reHI^B!FF`pS5ZZ!S+jlT&iz|?Kg=^*-=xe96s8QGu6{1-oD!MwU!os-dmC5UL|epjfwaKPKP>4MvR~My zG5>$1!L1>q%sOR{&2JXtxGDMul3&+8{Jw9~%;zQ!({AKV-=!kIp!t$zc7vw*fn^6H ztvWBVNt9ZqnXb7~>&&oK;@sw{4koSbFABq3mx^_tVp_k$f=SC+t}QC0Ekd~Lp6VYl zPX=dQp)>aJw`U%0y!mv(@x4zRbfZG98ed78D)j5q@rj$*GQ0E`{exICjnxp);)c4-x1O_03r>mdKI;Vst01oZNTmS$7 literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_player_enter.imageset/room_music_player_enter@3x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_player_enter.imageset/room_music_player_enter@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..9462fe9a1ad3b3da8b06a36299e80ed1bf1bf343 GIT binary patch literal 640 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw3=&b&bO2J80X`wF|Ns97GJzziz{T_GA)rp- zk|4ieUj`Qsc3oycdoCqoD|HJQaS{IM8^U%oFfcy$ba4#vIKFlI?P;qOc-oX14@G|Y zD_^#KTeVKYBH8PI%=fOi-!zBW$Nkd0CQmNL09D}=uU~qwZ&)fIYf@x5VK3A5B@Z05 zt{UIaV~v=4)XPAU#WAC!J)KoO$e1~sSv=*7;2Y(bpfAd6WMigWwtW*Fwyc)>HAlS0 zD>kzaQ_rZ|9G*U_e8!I-NoVwrK9hF+pQs&Ub$fnM;n|~arQ;@~iq<~SJERwLuV7-* zuEX0pJt_}|a-I6JkZ1lX{~Kx-SMRpEuJXIVlk-E}Yeh~`+Xo68@}zw3iK+<*8}IL{ z$yl4`6C|LWRJm#O;r6~)%pM6>!|bMdGc%ohvS>EPSFVI}KHJs=^Kb+ni_A0RoRaWq z*H7-7{~22~qIX{VxF_D_$JAGB#bqbc7vJ-l7I4)4=Si=X>sta^dG&1O@J(`=DdVK) z5j}-<^4SUVB=+20QTjWQ#e#v;IK)hHh5pIDt!`40vBm~}qe7N+Ufre`V|~M0t(B1rxZEuBwfCPZ#DBf^j)A)J>1l}mdKI;Vst0G>H9kN^Mx literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_more.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_more.imageset/Contents.json new file mode 100644 index 00000000..ef916133 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_more.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_music_small_player_more@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_more.imageset/room_music_small_player_more@3x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_more.imageset/room_music_small_player_more@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..0a5e33205743fa537902b59504e133a481f47783 GIT binary patch literal 238 zcmeAS@N?(olHy`uVBq!ia0vp^P9V&}3?v1sWN!m0#Q>iWS0Mc#FF3FG`X^8kS4ogx zFvG`fB{8Aa=7RiNT<)y`iWYggIEHu}PnKX^oFKyEdm-r(L-HnR@dGnt&dC|5t-hia zs4+P>`|2XjfU*axS{VbiPMF?={^*Y2HW7tz_3}{R#Jb?XI7x?44$rjF6*2UngG6$ BUP1r> literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_next.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_next.imageset/Contents.json new file mode 100644 index 00000000..d0841c3e --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_next.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_music_small_player_next@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_music_small_player_next@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_next.imageset/room_music_small_player_next@2x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_next.imageset/room_music_small_player_next@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..88ca29525e770f1cdee0cd8ee8628706c054edfe GIT binary patch literal 436 zcmeAS@N?(olHy`uVBq!ia0vp^Iv~u!3?wz9Rv81SAR@ht$+WoUvrs_Np(WycN>ivhgF@Aod~_4)t&Y@{^FQ>`n&z0_ z9JGnoYRi;2O-7rzy-w(9s4KrXaVo(#V`rR*?M`PW*OO_-E^JJHBDTAi>si1lndI$W z96LJ;Z&(K}Q9c}z+i^{j*VKB3-TUUXbrI{#Zksxl?a%huwsmH&z^CmKGTrZbIOuNO p@M%lY_7!0oOr`eCr%pWm$)KmD*}*-z=@rng44$rjF6*2UngG<)?h^n2 literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_next.imageset/room_music_small_player_next@3x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_next.imageset/room_music_small_player_next@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..203323a654af370da2396e022666eabf545ae552 GIT binary patch literal 643 zcmeAS@N?(olHy`uVBq!ia0vp^P9V&|3?#2~eYgdrN&|dCT!Hj|x`U_PX%0Y()k=c= zf*D@K%oF4OFpW+3+cs;}Th0oC56=YcE0TJB_sY_`9PeYRJIcdNQ#*V0>=+mrr+d0M zhD02GJMDB{vw?tXdwZ|1;d+62j7|!F{;P`}-L^ST4<5{_-EAJ3VWZ!P)c@GzHqPHpSanMN^z zFkLomgcrrS zA61t8sEm^536K!Fe68?h0BdOQ-=Zs)3pRLM4s%HqJTDO*apmupMOLd5@`~TNzY#ek zI&r_zPK3xJ3GNLcN@n}(6nb8$%PK~yUEJciVfm4>Vem#7AUiPD# zGq^W4oZosRu49tmiU(@HuAID{A8lZ@^g*M4i>6YZ{t?B$+n((c4@BadQW-p5{an^LB{Ts5PS9Sp literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_pause.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_pause.imageset/Contents.json new file mode 100644 index 00000000..2e35fde7 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_pause.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_music_small_player_pause@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_music_small_player_pause@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_pause.imageset/room_music_small_player_pause@2x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_pause.imageset/room_music_small_player_pause@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..000544a19a4a7cf9af9aa3920d600ed383b4795d GIT binary patch literal 146 zcmeAS@N?(olHy`uVBq!ia0vp^Iv~u#3?$#IayJ4}`~f~8u0Z-f66kljmjM)FDGBlm zX876q%PredQMC2l34WTvN!V@Sl|x7R)S8WcoW0x$A&oeKEAe~oy< zgHtnZY<>IWZFOLM#`lA6vsw4s3n;C-;h@oHVQy0(`}ge*27A@81G#^5iw|fywQvY3 zxpW99I<<843qEWysbUg5XP~;~*%h~B@13_6U9rCVc8i!vDX*X>&{76ZS3j3^P65?G7 zUKP)MAJ@bu5X?>$;KaE zU0Qj22EUEkWwE$V1u;BtnF71M`C3V^FMGFliGI+W+$Kw*@Q~N1vTo0uZq#$lY5k;j z=X7D6i4}Ll6E7cp)B861#;Nza4qcA^B75U+%`V3m6;t=0X5Y{u$^9_H{VdQ=44$rj JF6*2UngHvp(1rj2 literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_play.imageset/room_music_small_player_play@3x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_play.imageset/room_music_small_player_play@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..b6027b54515ee08b45adfe855db4af0e906f8a42 GIT binary patch literal 585 zcmeAS@N?(olHy`uVBq!ia0vp^P9V&|3?#2~eYgdrasqrpT!Hj|dI3BC2Vp?_luLsA zf*D@V;nv%~=~-b4TbI%22iwbiWkhbBJF&JV+d*|nsP*@ltJ7k2BsVfJFlKtXIEF+V zemgC?@2~=o>)jav3jNQnZppm$<>0^X7PAtLc>LV0eD?ekod+DhlMLRz`NO+e&hGo> z#6uVBo-QdkdXT*@{Fvy(n7>Ye*B>efAMVPzRy08yRBo%)AGn@9W*B94s zSvDSju)edHu9q;Sa6S9^Aeuoq6a7gMH)mo2M&`e<;Q|@m@_oW_M)W&q7JT*4g(A zJ=8olzOV?8-L|O2Rn=7I!J;cXh8_j6(oX{|L~M7NaEVK5L`>YyVzi{u$?(3XO{z9i iq};NM%;)nzv+j;@{xa)Ev<@(i7(8A5T-G@yGywonU^f8( literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_voice.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_voice.imageset/Contents.json new file mode 100644 index 00000000..839db885 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_voice.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_music_small_player_voice@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_music_small_player_voice@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_voice.imageset/room_music_small_player_voice@2x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_voice.imageset/room_music_small_player_voice@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..9e802b48a1d2398aab1b5792457fdd402f26deda GIT binary patch literal 291 zcmeAS@N?(olHy`uVBq!ia0vp^;y^6R!3-qJ^4Y%tDf8W9sjC4Z|`TT&krm2otgjc^v?LoyX^Pm h>+kQd;NxDy>+)61>mTpae?X@&c)I$ztaD0e0s!Kfnq&X~ literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_voice.imageset/room_music_small_player_voice@3x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_voice.imageset/room_music_small_player_voice@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..ce61691248df51f8c2ba93b5820126226f0357ce GIT binary patch literal 411 zcmeAS@N?(olHy`uVBq!ia0vp^%0R5c!3-pC1b*BHq+$bnLR^9Lf0}_nt=~_97RZ$Z z`2{miaZ>plqSt=8XRW~LM^m;i)xK*v zA-Vn0lZguHpRA3JePNPZyt_B0^vV)p&csw9!&}!}LKp>RZP^j%y?#OwYs;}Giyge) zp08}+H`d@eZL;U=j!WLcU8^o{koJn?3}{m`7myHH%l5_eQhNwj`_0WMMju>z6L`Lw z+Z#SQWxm%$`cIGH=2u~7&)Mv^{=-+d@$?zrggoxz#W$kG{r!3p^YrTvJ8zNs-z09- W=p(9oR!$D+H3m;tKbLh*2~7YfQ{HF* literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_white_dot.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_white_dot.imageset/Contents.json new file mode 100644 index 00000000..ebf19127 --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_white_dot.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_music_small_player_white_dot@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_music_small_player_white_dot@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_white_dot.imageset/room_music_small_player_white_dot@2x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_white_dot.imageset/room_music_small_player_white_dot@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..e85c35339e0bcc128698b869496bc241794edb48 GIT binary patch literal 245 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh-3?!F4n4AKn3<7*YT!Hj|Qh>EDivds%e@T#E zFoUbcug`am&ti1=aAW@>&4yROd_bvGPZ!4!j_b(@2@iBk`NR_#n3jD8*|3-)#rG#a z(>#ZTUlXqBv$k#fFEHVt0)J|4%8K?)`;3n`N5)IOS-9pr&%c6ebvxeFYP{AzB+_!S v;I^E?&W1)!`4c~uF%%^vuRK}C$;QSY@VJt}O+HN*Xd#2AtDnm{r-UW|PPKHE literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_white_dot.imageset/room_music_small_player_white_dot@3x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_small_player_white_dot.imageset/room_music_small_player_white_dot@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..8ce56d71f52a0c0b9387618c55bcf7d8584de1c3 GIT binary patch literal 282 zcmeAS@N?(olHy`uVBq!ia0vp^(jd&j3?%D+y-WjAx&b~Ru0Z-f(O{v+>e)aId?i7C z!3-aT&L&Utc1!qnp7Gp;$mI(+0cH9;T^vIsE+;cEewDDCS-{Gs5wNkEokcCcPI>}6 zQ<^~DV{49z8w`&M&s4Ls8av!^QDD}Zd*HwUmMfghZah5E_Y@CI=H)r%apyP}PwD#! z4vfw+M&=EPvPR{M%`!&e4G(3FDjM{v`Da!$o=q{Sz8KT`EKNjS*6Fi;T84qeAr;vG lXCdP`iW>z~)mb}P88&qPon9Gd{150d22WQ%mvv4FO#t5Wb~gY3 literal 0 HcmV?d00001 diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_voice_setting_dot.imageset/Contents.json b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_voice_setting_dot.imageset/Contents.json new file mode 100644 index 00000000..6d1d016f --- /dev/null +++ b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_voice_setting_dot.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "room_music_voice_setting_dot@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "room_music_voice_setting_dot@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_voice_setting_dot.imageset/room_music_voice_setting_dot@2x.png b/xplan-ios/Assets.xcassets/Room/BackMusic/room_music_voice_setting_dot.imageset/room_music_voice_setting_dot@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..f7cbf230cb9730808a1878790fc4ff16c19256f4 GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh-3?!F4n4AKnR04cLT!Hle?QH+IvHjl(CV`A? z?En8WfJC;jLZrew*h_)xxJ!ckf*G7YY1}zJi}A+(MQ`Ue7XpQoJzX3_IIbrrBqaFU ze5-bVf#uBR^7r@lUS>EUbc>g%%Rw>MAbT>S^UFLAj`Rs_o6L+-oFi{b>{+-*muGik zgQN7hS8b=)wQVX>^l_Zgvw`;{E6QS0Md=8|(iaU=qmK%KCpB z8yKFP(9oKEf9@B1z@xlBtG$f%>|%|k|jZY!3^J6-(Q^Z zpuJvcVz8T`=$-5Hw75$Pa?>hnuG9nr70vT>aSYKo-+Jk`P_qIL%LQIWowyI{p8l`j zayiV=z4>=lnyAMH*Ppwt_^k1LE9xiNrS~TD^fQI5ts+4u^t3K*@w}9D=fzZwhx>QB zSv~rrntnKTM`!#VvEHWZ5AD`E%Pt8qSoHP6qRb5$JVLz(Ha-0}-8%hS-9F(HyWUhM zO?b|5X8Y%A`*X67Sy#$DHq!NRf9PrZHhs;mQ-8kgT7M_*7emPflfug40ui7~89ZJ6 KT-G@yGywocK%9;M literal 0 HcmV?d00001 diff --git a/xplan-ios/Main/RTC/RtcImpl/AgoraRtcImpl.m b/xplan-ios/Main/RTC/RtcImpl/AgoraRtcImpl.m index 6d9bee8f..8f3a6fbf 100644 --- a/xplan-ios/Main/RTC/RtcImpl/AgoraRtcImpl.m +++ b/xplan-ios/Main/RTC/RtcImpl/AgoraRtcImpl.m @@ -73,6 +73,57 @@ [AgoraRtcEngineKit destroy]; } +/// 播放背景音乐 +/// @param filePath 音频文件的地址 +/// @param musicId TRTC自己要的 +- (BOOL)playBackMusic:(NSString *)filePath musicId:(int)musicId { + + if (filePath) { + [self changePlayState:BackMusicPlayState_Stop];//切换歌曲need stop + BOOL state = [self.engine startAudioMixing:filePath loopback:NO replace:NO cycle:1]; + return state; + } else { + return NO; + } + +} + +/// 改变播放器的状态 +/// @param state 播放状态 +- (BOOL)changePlayState:(BackMusicPlayState)state { + BOOL isPlaying = NO; + switch (state) { + case BackMusicPlayState_Stop: + { + [self.engine stopAudioMixing]; + isPlaying = NO; + } + break; + case BackMusicPlayState_Pause: + { + [self.engine pauseAudioMixing]; + isPlaying = NO; + } + break; + case BackMusicPlayState_Resume: + { + [self.engine resumeAudioMixing]; + isPlaying = NO; + } + default: + break; + } + return isPlaying; +} + +- (void)updateUserSound:(int)soundVol { + [self.engine adjustRecordingSignalVolume:soundVol]; +} + +- (void)updateMusicSound:(int)soundVol { + [self.engine adjustAudioMixingVolume:soundVol]; +} + #pragma mark - AgoraRtcEngineDelegate - (void)rtcEngine:(AgoraRtcEngineKit *)engine reportAudioVolumeIndicationOfSpeakers:(NSArray *)speakers totalVolume:(NSInteger)totalVolume { NSMutableArray *uids = [NSMutableArray array]; diff --git a/xplan-ios/Main/RTC/RtcImpl/RtcImplDelegate.h b/xplan-ios/Main/RTC/RtcImpl/RtcImplDelegate.h index e2945dff..b33be606 100644 --- a/xplan-ios/Main/RTC/RtcImpl/RtcImplDelegate.h +++ b/xplan-ios/Main/RTC/RtcImpl/RtcImplDelegate.h @@ -16,6 +16,9 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)usersSpeaking:(NSMutableArray * _Nullable)uids; +///当前的背景音乐播放完毕 是否进行下一首 +- (void)currentBackMusicPlayFinish:(NSString *)filePath; + @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/RTC/RtcImpl/RtcInterface.h b/xplan-ios/Main/RTC/RtcImpl/RtcInterface.h index 42ea2512..b37bf913 100644 --- a/xplan-ios/Main/RTC/RtcImpl/RtcInterface.h +++ b/xplan-ios/Main/RTC/RtcImpl/RtcInterface.h @@ -6,7 +6,7 @@ // #import - +#import "RtcManager.h" NS_ASSUME_NONNULL_BEGIN @protocol RtcInterface @@ -49,6 +49,20 @@ NS_ASSUME_NONNULL_BEGIN ///退出跨房通话 - (void)disconnectOtherRoom; + +/// @param filePath 音频文件的地址 +/// @param musicId TRTC自己要的 +- (BOOL)playBackMusic:(NSString *)filePath musicId:(int)musicId; + +/// 改变播放器的状态 +/// @param state 播放状态 +- (BOOL)changePlayState:(BackMusicPlayState)state; + +///背景音乐的音量大小 +- (void)updateMusicSound:(int)soundVol; + +///背景人声的音量大小 +- (void)updateUserSound:(int)soundVol; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/RTC/RtcImpl/TRTCRtcImpl.m b/xplan-ios/Main/RTC/RtcImpl/TRTCRtcImpl.m index e103dfe9..36559bc4 100644 --- a/xplan-ios/Main/RTC/RtcImpl/TRTCRtcImpl.m +++ b/xplan-ios/Main/RTC/RtcImpl/TRTCRtcImpl.m @@ -12,6 +12,10 @@ @interface TRTCRtcImpl() @property (strong, nonatomic) TRTCCloud *engine; +///背景音乐管理 +@property (nonatomic, strong) TXAudioEffectManager *musicManager; +///音乐的id +@property (nonatomic,assign) int musicId; @end @@ -22,6 +26,7 @@ if (self) { _engine = [TRTCCloud sharedInstance]; [_engine enableAudioVolumeEvaluation:900]; + [TRTCCloud setConsoleEnabled:NO]; _engine.delegate = self; } return self; @@ -120,6 +125,71 @@ [TRTCCloud destroySharedIntance]; } +/// 播放背景音乐 +/// @param filePath 音频文件的地址 +/// @param musicId TRTC自己要的 +- (BOOL)playBackMusic:(NSString *)filePath musicId:(int)musicId { + + if (filePath) { + [self changePlayState:BackMusicPlayState_Stop];//切换歌曲need stop + self.musicId = musicId; + if (self.musicManager == nil) { + self.musicManager = [self.engine getAudioEffectManager]; + } + + TXAudioMusicParam *param = [[TXAudioMusicParam alloc] init]; + param.ID = musicId; + param.path = filePath; + [self.musicManager startPlayMusic:param onStart:^(NSInteger errCode) { + NSLog(@"aianan %ld",errCode); + } onProgress:^(NSInteger progressMs, NSInteger durationMs) { + + } onComplete:^(NSInteger errCode) { + [self.delegate currentBackMusicPlayFinish:filePath]; + }]; + return YES; + } else { + return NO; + } + +} + +/// 改变播放器的状态 +/// @param state 播放状态 +- (BOOL)changePlayState:(BackMusicPlayState)state { + BOOL isPlaying = NO; + switch (state) { + case BackMusicPlayState_Stop: + { + [self.musicManager stopPlayMusic:self.musicId]; + isPlaying = NO; + } + break; + case BackMusicPlayState_Pause: + { + [self.musicManager pausePlayMusic:self.musicId]; + isPlaying = NO; + } + break; + case BackMusicPlayState_Resume: + { + [self.musicManager resumePlayMusic:self.musicId]; + isPlaying = NO; + } + default: + break; + } + return isPlaying; +} + +- (void)updateUserSound:(int)soundVol { + [self.engine setAudioCaptureVolume:soundVol]; +} + +- (void)updateMusicSound:(int)soundVol { + [self.musicManager setMusicPublishVolume:self.musicId volume:soundVol]; +} + #pragma mark - TRTCCloudDelegate - (void)onUserVoiceVolume:(NSArray *)userVolumes totalVolume:(NSInteger)totalVolume { NSMutableArray *uids = [NSMutableArray array]; diff --git a/xplan-ios/Main/RTC/RtcImpl/ZegoRtcImpl.m b/xplan-ios/Main/RTC/RtcImpl/ZegoRtcImpl.m index bca6b685..f1ece0ee 100644 --- a/xplan-ios/Main/RTC/RtcImpl/ZegoRtcImpl.m +++ b/xplan-ios/Main/RTC/RtcImpl/ZegoRtcImpl.m @@ -8,10 +8,12 @@ #import "ZegoRtcImpl.h" #import -@interface ZegoRtcImpl() +@interface ZegoRtcImpl() @property (nonatomic, strong) ZegoAudioRoomApi *engine; - +@property (nonatomic, strong) ZegoMediaPlayer *mediaPlayer; +///当前播放的背景音乐路径 +@property (nonatomic,copy) NSString *filePath; @end @implementation ZegoRtcImpl @@ -44,6 +46,9 @@ #pragma mark - RtcInterface impl - (BOOL)joinChannel:(nonnull NSString *)channelId completion:(void (^ _Nullable)(void))completion { + //推流播放模式,会将音频混流推流中,调用端和拉流端都可以听到播放的声音。 + self.mediaPlayer = [[ZegoMediaPlayer alloc] initWithPlayerType:MediaPlayerTypeAux]; + [self.mediaPlayer setDelegate:self]; //开始监听 [[ZegoSoundLevel sharedInstance] setSoundLevelDelegate:self]; [[ZegoSoundLevel sharedInstance] setSoundLevelMonitorCycle:1200]; //监控周期 [100, 3000]。默认 200 ms。 @@ -97,6 +102,60 @@ } +/// 播放背景音乐 +/// @param filePath 音频文件的地址 +/// @param musicId TRTC自己要的 +- (BOOL)playBackMusic:(NSString *)filePath musicId:(int)musicId { + [self.mediaPlayer stop];//切换歌曲need stop + if (filePath) { + self.filePath = filePath; + [self.engine muteAux:true]; + [self.mediaPlayer start:filePath repeat:NO]; + } + return YES; +} + +/// 改变播放器的状态 +/// @param state 播放状态 +- (BOOL)changePlayState:(BackMusicPlayState)state { + BOOL isPlaying = NO; + switch (state) { + case BackMusicPlayState_Stop: + { + [self.mediaPlayer stop]; + [self.engine muteAux:false]; + isPlaying = NO; + } + break; + case BackMusicPlayState_Pause: + { + [self.mediaPlayer pause]; + isPlaying = NO; + } + break; + case BackMusicPlayState_Resume: + { + [self.mediaPlayer resume]; + isPlaying = NO; + } + default: + break; + } + return isPlaying; +} + +- (void)updateUserSound:(int)soundVol { + if (soundVol) { + [self.engine setCaptureVolume:soundVol]; + } +} + +- (void)updateMusicSound:(int)soundVol { + if (soundVol) { + [self.mediaPlayer setVolume:soundVol]; + } +} + #pragma mark - ZegoAudioRoomDelegate - (void)onStreamUpdated:(ZegoAudioStreamType)type stream:(ZegoAudioStream *)stream { switch (type) { @@ -129,6 +188,12 @@ [self.delegate usersSpeaking:[self formatSpeakingUids:@[captureSoundLevel]]]; } +#pragma mark - ZegoMediaPlayerEventDelegate +///播放结束 +- (void)onPlayEnd { + [self.delegate currentBackMusicPlayFinish:self.filePath]; +} + #pragma mark - private method - (NSMutableArray *)formatSpeakingUids:(NSArray *)soundLevels { NSMutableArray *uids = [NSMutableArray array]; @@ -154,4 +219,6 @@ return [NSData dataWithBytes:signkey length:32]; } + + @end diff --git a/xplan-ios/Main/RTC/RtcManager.h b/xplan-ios/Main/RTC/RtcManager.h index 409c2801..b76629c2 100644 --- a/xplan-ios/Main/RTC/RtcManager.h +++ b/xplan-ios/Main/RTC/RtcManager.h @@ -17,6 +17,15 @@ typedef enum : NSUInteger { RtcEngineType_TRTC, // 腾讯TRTC } RtcEngineType; +typedef NS_ENUM(NSInteger, BackMusicPlayState) { + ///停止 + BackMusicPlayState_Stop = 1, + ///暂停 + BackMusicPlayState_Pause, + ///重新播放 + BackMusicPlayState_Resume +}; + /** 音频服务管理单例,对所有音频服务 SDK 的封装。 **Note:** @@ -106,6 +115,20 @@ typedef enum : NSUInteger { ///退出跨房通话 - (void)disconnectOtherRoom; +/// 播放背景音乐 +/// @param filePath 音频文件的地址 +/// @param musicId TRTC自己要的 +- (BOOL)playBackMusic:(NSString *)filePath musicId:(int)musicId; + +/// 改变播放器的状态 +/// @param state 播放状态 +- (BOOL)changePlayState:(BackMusicPlayState)state; + +///背景音乐的音量大小 +- (void)updateMusicSound:(int)soundVol; + +///背景人声的音量大小 +- (void)updateUserSound:(int)soundVol; @end NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/RTC/RtcManager.m b/xplan-ios/Main/RTC/RtcManager.m index a576fac5..9168a34c 100644 --- a/xplan-ios/Main/RTC/RtcManager.m +++ b/xplan-ios/Main/RTC/RtcManager.m @@ -111,6 +111,29 @@ [self.engine destory]; } +/// 播放背景音乐 +/// @param filePath 音频文件的地址 +/// @param musicId TRTC自己要的 +- (BOOL)playBackMusic:(NSString *)filePath musicId:(int)musicId { + return [self.engine playBackMusic:filePath musicId:musicId]; +} + +/// 改变播放器的状态 +/// @param state 播放状态 +- (BOOL)changePlayState:(BackMusicPlayState)state { + return [self.engine changePlayState:state]; +} + +///背景音乐的音量大小 +- (void)updateMusicSound:(int)soundVol { + [self.engine updateMusicSound:soundVol]; +} + +///背景人声的音量大小 +- (void)updateUserSound:(int)soundVol { + [self.engine updateUserSound:soundVol]; +} + - (void)usersSpeaking:(NSMutableArray *)uids { if (self.engineDelegate) { [self.engineDelegate usersSpeaking:uids]; diff --git a/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataClass.h b/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataClass.h new file mode 100644 index 00000000..40fabaad --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataClass.h @@ -0,0 +1,20 @@ +// +// Music+CoreDataClass.h +// +// +// Created by 冯硕 on 2022/5/9. +// +// + +#import +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface Music : NSManagedObject + +@end + +NS_ASSUME_NONNULL_END + +#import "Music+CoreDataProperties.h" diff --git a/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataClass.m b/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataClass.m new file mode 100644 index 00000000..689ca764 --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataClass.m @@ -0,0 +1,13 @@ +// +// Music+CoreDataClass.m +// +// +// Created by 冯硕 on 2022/5/9. +// +// + +#import "Music+CoreDataClass.h" + +@implementation Music + +@end diff --git a/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataProperties.h b/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataProperties.h new file mode 100644 index 00000000..ff6aa99c --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataProperties.h @@ -0,0 +1,28 @@ +// +// Music+CoreDataProperties.h +// +// +// Created by 冯硕 on 2022/5/9. +// +// + +#import "Music+CoreDataClass.h" + + +NS_ASSUME_NONNULL_BEGIN + +@interface Music (CoreDataProperties) + ++ (NSFetchRequest *)fetchRequest NS_SWIFT_NAME(fetchRequest()); + +@property (nullable, nonatomic, copy) NSString *author; +@property (nullable, nonatomic, copy) NSString *filePath; +@property (nullable, nonatomic, copy) NSString *musicArtists; +@property (nullable, nonatomic, copy) NSString *musicId; +@property (nullable, nonatomic, copy) NSString *musicName; +@property (nullable, nonatomic, retain) NSData *songAlbum; +@property (nullable, nonatomic, copy) NSString *songName; + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataProperties.m b/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataProperties.m new file mode 100644 index 00000000..67f7cfa9 --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/Model/Music+CoreDataProperties.m @@ -0,0 +1,25 @@ +// +// Music+CoreDataProperties.m +// +// +// Created by 冯硕 on 2022/5/9. +// +// + +#import "Music+CoreDataProperties.h" + +@implementation Music (CoreDataProperties) + ++ (NSFetchRequest *)fetchRequest { + return [NSFetchRequest fetchRequestWithEntityName:@"Music"]; +} + +@dynamic author; +@dynamic filePath; +@dynamic musicArtists; +@dynamic musicId; +@dynamic musicName; +@dynamic songAlbum; +@dynamic songName; + +@end diff --git a/xplan-ios/Main/Room/View/BackMusic/Presenter/XPCoreDataManager.h b/xplan-ios/Main/Room/View/BackMusic/Presenter/XPCoreDataManager.h new file mode 100644 index 00000000..3041b3bc --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/Presenter/XPCoreDataManager.h @@ -0,0 +1,33 @@ +// +// XPCoreDataManager.h +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import +#import +NS_ASSUME_NONNULL_BEGIN + +@interface XPCoreDataManager : NSObject ++(XPCoreDataManager *)shareInstance; +/** + 管理上下文 + */ +@property(nonatomic,strong)NSManagedObjectContext *managedObjectContext; +/** + 模型对象 + */ +@property(nonatomic,strong)NSManagedObjectModel *managedObjectModel; +/** + 存储调度器 + */ +@property(nonatomic,strong)NSPersistentStoreCoordinator *persistentStoreCoordinator; + +/** + 保存操作 + */ +-(void)save; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/BackMusic/Presenter/XPCoreDataManager.m b/xplan-ios/Main/Room/View/BackMusic/Presenter/XPCoreDataManager.m new file mode 100644 index 00000000..23985b0d --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/Presenter/XPCoreDataManager.m @@ -0,0 +1,78 @@ +// +// XPCoreDataManager.m +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import "XPCoreDataManager.h" + +@implementation XPCoreDataManager +static XPCoreDataManager *manager = nil; ++(XPCoreDataManager *)shareInstance{ + static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + manager = [[XPCoreDataManager alloc]init]; + }); + return manager; +} + +//获取数据库的路径 +-(NSURL *)getDocumnetUrlpath{ + return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; +} + +-(NSManagedObjectContext *)managedObjectContext{ + if (!_managedObjectContext) { + /** + 参数:CoreData环境线程 + NSMainQueueConcurrencyType:主线程 储存无延迟 + NSPrivateQueueConcurrencyType:分支线程 存储有延迟 + */ + _managedObjectContext = [[NSManagedObjectContext alloc]initWithConcurrencyType:NSMainQueueConcurrencyType]; + //设置存储调度器 + _managedObjectContext.persistentStoreCoordinator = self.persistentStoreCoordinator; + } + return _managedObjectContext; +} + +-(NSManagedObjectModel *)managedObjectModel{ + if (!_managedObjectModel) { + /** + 初始化NSManagedObjectModel + 参数是:模型文件的路径 + 后缀不能是xcdatamodeld 只能是momd + _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:[[NSBundle mainBundle] URLForResource:@"Teacher" withExtension:@"momd"]]; + + 参数是模型文件的bundle数组 如果是nil 自动获取所有bundle的模型文件 + */ + _managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil]; + } + return _managedObjectModel; +} + +-(NSPersistentStoreCoordinator *)persistentStoreCoordinator{ + if (!_persistentStoreCoordinator) { + /** + 参数:要存储的模型 + */ + _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc]initWithManagedObjectModel:self.managedObjectModel]; + + /** + 参数: + * type:一般使用数据库存储方式NSSQLiteStoreType + * configuration:配置信息 一般无需配置 + * URL:要保存的文件路径 + * options:参数信息 一般无需设置 + */ + NSURL *url = [[self getDocumnetUrlpath] URLByAppendingPathComponent:@"sqlit.db" isDirectory:true]; + [_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:url options:nil error:nil]; + } + return _persistentStoreCoordinator; +} + +-(void)save{ + [self.managedObjectContext save:nil]; +} + +@end diff --git a/xplan-ios/Main/Room/View/BackMusic/Presenter/xplan-ios.xcdatamodeld/xplan-ios.xcdatamodel/contents b/xplan-ios/Main/Room/View/BackMusic/Presenter/xplan-ios.xcdatamodeld/xplan-ios.xcdatamodel/contents new file mode 100644 index 00000000..217702cf --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/Presenter/xplan-ios.xcdatamodeld/xplan-ios.xcdatamodel/contents @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.h b/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.h new file mode 100644 index 00000000..1e61dce5 --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.h @@ -0,0 +1,22 @@ +// +// XPRoomMusicLibraryEmptyTableViewCell.h +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class XPRoomMusicLibraryEmptyTableViewCell; +@protocol XPRoomMusicLibraryEmptyTableViewCellDelegate + +- (void)xPRoomMusicLibraryEmptyTableViewCell:(XPRoomMusicLibraryEmptyTableViewCell *)cell didClickAdd:(UIButton *)sender; + +@end +@interface XPRoomMusicLibraryEmptyTableViewCell : UITableViewCell +///代理 +@property (nonatomic,weak) id delegate; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.m b/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.m new file mode 100644 index 00000000..1964afcd --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.m @@ -0,0 +1,99 @@ +// +// XPRoomMusicLibraryEmptyTableViewCell.m +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import "XPRoomMusicLibraryEmptyTableViewCell.h" +///Third +#import +///Tool +#import "ThemeColor.h" +#import "UIImageConstant.h" + +@interface XPRoomMusicLibraryEmptyTableViewCell () +@property (nonatomic,strong) UIImageView *emptyImageView; +@property (nonatomic,strong) UILabel *titleLabel; +///更错 +@property (nonatomic,strong) UIButton *addButton; +@end + +@implementation XPRoomMusicLibraryEmptyTableViewCell + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} +#pragma mark - Private Method +- (void)initSubViews { + self.selectionStyle = UITableViewCellSelectionStyleNone; + [self.contentView addSubview:self.emptyImageView]; + [self.contentView addSubview:self.titleLabel]; + [self.contentView addSubview:self.addButton]; +} + +- (void)initSubViewConstraints { + [self.emptyImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.contentView).offset(150); + make.centerX.mas_equalTo(self.contentView); + make.size.mas_equalTo(CGSizeMake(200, 200)); + }]; + + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.mas_equalTo(self.emptyImageView.mas_bottom).offset(20); + make.left.right.mas_equalTo(self.contentView); + }]; + + [self.addButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(100, 30)); + make.centerX.mas_equalTo(self.contentView); + make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(20); + }]; +} +#pragma mark - Event Response +- (void)addButtonAction:(UIButton *)sender { + if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomMusicLibraryEmptyTableViewCell:didClickAdd:)]) { + [self.delegate xPRoomMusicLibraryEmptyTableViewCell:self didClickAdd:sender]; + } +} + +#pragma mark - Getters And Setters +- (UIImageView *)emptyImageView { + if (!_emptyImageView) { + _emptyImageView = [[UIImageView alloc] init]; + _emptyImageView.userInteractionEnabled = YES; + _emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder]; + _emptyImageView.layer.masksToBounds = YES; + _emptyImageView.contentMode = UIViewContentModeScaleAspectFit; + } + return _emptyImageView; +} + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [[UILabel alloc] init]; + _titleLabel.text = @"暂无数据"; + _titleLabel.font = [UIFont systemFontOfSize:16]; + _titleLabel.textAlignment = NSTextAlignmentCenter; + _titleLabel.textColor = [ThemeColor secondTextColor]; + } + return _titleLabel; +} + +- (UIButton *)addButton { + if (!_addButton) { + _addButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_addButton setTitle:@"传输更多歌曲" forState:UIControlStateNormal]; + [_addButton setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal]; + _addButton.titleLabel.font = [UIFont systemFontOfSize:15]; + [_addButton addTarget:self action:@selector(addButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _addButton; +} + + +@end diff --git a/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryTableViewCell.h b/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryTableViewCell.h new file mode 100644 index 00000000..7abb8fb0 --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryTableViewCell.h @@ -0,0 +1,17 @@ +// +// XPRoomMusicLibraryTableViewCell.h +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class Music; +@interface XPRoomMusicLibraryTableViewCell : UITableViewCell +///歌曲信息 +@property (nonatomic,strong) Music *musicInfo; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryTableViewCell.m b/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryTableViewCell.m new file mode 100644 index 00000000..43483e34 --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/Cell/XPRoomMusicLibraryTableViewCell.m @@ -0,0 +1,122 @@ +// +// XPRoomMusicLibraryTableViewCell.m +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import "XPRoomMusicLibraryTableViewCell.h" +///Third +#import +///Tool +#import "ThemeColor.h" +#import "Music+CoreDataClass.h" +@interface XPRoomMusicLibraryTableViewCell () +///背景 +@property (nonatomic,strong) UIView * backView; +///歌曲的背景 +@property (nonatomic,strong) UIImageView *musicAlbumImageView; +///歌曲的名称 +@property (nonatomic,strong) UILabel * songNameLabel; +///歌曲的作者 +@property (nonatomic,strong) UILabel *authorLabel; +///分割线 +@property (nonatomic,strong) UIView * lineView; +@end + +@implementation XPRoomMusicLibraryTableViewCell + +- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { + if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = [UIColor clearColor]; + self.selectionStyle = UITableViewCellSelectionStyleNone; + [self.contentView addSubview:self.backView]; + + [self.backView addSubview:self.musicAlbumImageView]; + [self.backView addSubview:self.songNameLabel]; + [self.backView addSubview:self.authorLabel]; +} + +- (void)initSubViewConstraints { + [self.backView mas_makeConstraints:^(MASConstraintMaker *make) { + make.edges.mas_equalTo(self.contentView); + }]; + + [self.musicAlbumImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.backView).offset(15); + make.centerY.mas_equalTo(self.backView); + make.size.mas_equalTo(CGSizeMake(45, 45)); + }]; + + [self.songNameLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.musicAlbumImageView.mas_right).offset(10); + make.bottom.mas_equalTo(self.musicAlbumImageView.mas_centerY).offset(-3); + }]; + + [self.authorLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.songNameLabel); + make.top.mas_equalTo(self.musicAlbumImageView.mas_centerY).offset(3); + }]; +} +#pragma mark - Getters And Setters +- (void)setMusicInfo:(Music *)musicInfo { + _musicInfo = musicInfo; + if (_musicInfo) { + self.musicAlbumImageView.image = [UIImage imageWithData:_musicInfo.songAlbum]; + self.songNameLabel.text = _musicInfo.songName; + self.authorLabel.text = _musicInfo.author; + } +} + +- (UIView *)backView { + if (!_backView) { + _backView = [[UIView alloc] init]; + _backView.backgroundColor = [UIColor clearColor]; + } + return _backView; +} + +- (UIImageView *)musicAlbumImageView { + if (!_musicAlbumImageView) { + _musicAlbumImageView = [[UIImageView alloc] init]; + _musicAlbumImageView.userInteractionEnabled = YES; + _musicAlbumImageView.layer.masksToBounds = YES; + _musicAlbumImageView.layer.cornerRadius = 8; + } + return _musicAlbumImageView; +} + +- (UILabel *)songNameLabel { + if (!_songNameLabel) { + _songNameLabel = [[UILabel alloc] init]; + _songNameLabel.font = [UIFont systemFontOfSize:15]; + _songNameLabel.textColor = [ThemeColor mainTextColor]; + } + return _songNameLabel; +} + +- (UILabel *)authorLabel { + if (!_authorLabel) { + _authorLabel = [[UILabel alloc] init]; + _authorLabel.font = [UIFont systemFontOfSize:12]; + _authorLabel.textColor = [ThemeColor secondTextColor]; + } + return _authorLabel; +} + +- (UIView *)lineView { + if (!_lineView) { + _lineView = [[UIView alloc] init]; + _lineView.backgroundColor = [ThemeColor dividerColor]; + } + return _lineView; +} + +@end diff --git a/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPMusicLibraryPlayView.h b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPMusicLibraryPlayView.h new file mode 100644 index 00000000..08d57651 --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPMusicLibraryPlayView.h @@ -0,0 +1,25 @@ +// +// XPMusicLibraryPlayView.h +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN +@class Music; +@class XPMusicLibraryPlayView; +@protocol XPMusicLibraryPlayViewDelegate + +- (void)xPMusicLibraryPlayView:(XPMusicLibraryPlayView *)view didClickVoiceSetting:(UIButton *)sender; + +@end +@interface XPMusicLibraryPlayView : UIView +///歌曲 +@property (nonatomic,strong) Music *music; +///代理 +@property (nonatomic,weak) id delegate; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPMusicLibraryPlayView.m b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPMusicLibraryPlayView.m new file mode 100644 index 00000000..04746bef --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPMusicLibraryPlayView.m @@ -0,0 +1,109 @@ +// +// XPMusicLibraryPlayView.m +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import "XPMusicLibraryPlayView.h" +///Third +#import +///Tool +#import "ThemeColor.h" +///Model +#import "Music+CoreDataClass.h" + +@interface XPMusicLibraryPlayView () +///显示播放按钮 +@property (nonatomic,strong) UIButton *playButton; +///显示标题 +@property (nonatomic,strong) UILabel *titleLabel; +///设置 +@property (nonatomic,strong) UIButton *settingButton; +@end + +@implementation XPMusicLibraryPlayView +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = UIColorRGBAlpha(0x000000, 0.2); + + [self addSubview:self.playButton]; + [self addSubview:self.titleLabel]; + [self addSubview:self.settingButton]; +} + +- (void)initSubViewConstraints { + [self.playButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(44, 44)); + make.centerY.mas_equalTo(self); + make.left.mas_equalTo(self).offset(15); + }]; + + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.playButton.mas_right).offset(5); + make.centerY.mas_equalTo(self.playButton); + }]; + + [self.settingButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(22, 22)); + make.centerY.mas_equalTo(self); + make.right.mas_equalTo(self).offset(-15); + }]; +} +#pragma mark - Event Response +- (void)playButtonAction:(UIButton *)sender { + +} + +- (void)settingButtonAction:(UIButton *)sender { + sender.selected = !sender.selected; + if (self.delegate && [self.delegate respondsToSelector:@selector(xPMusicLibraryPlayView:didClickVoiceSetting:)]) { + [self.delegate xPMusicLibraryPlayView:self didClickVoiceSetting:sender]; + } +} + +#pragma mark - Getters And Setters +- (void)setMusic:(Music *)music { + +} + +- (UIButton *)playButton { + if (!_playButton) { + _playButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_playButton setImage:[UIImage imageNamed:@"room_music_library_pause"] forState:UIControlStateNormal]; + [_playButton setImage:[UIImage imageNamed:@"room_music_library_play"] forState:UIControlStateSelected]; + [_playButton addTarget:self action:@selector(playButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _playButton; +} + +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [[UILabel alloc] init]; + _titleLabel.font = [UIFont systemFontOfSize:14]; + _titleLabel.textColor = [ThemeColor mainTextColor]; + _titleLabel.text = @"暂无歌曲"; + } + return _titleLabel; +} + +- (UIButton *)settingButton { + if (!_settingButton) { + _settingButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_settingButton setImage:[UIImage imageNamed:@"room_music_library_volum_setting"] forState:UIControlStateNormal]; + [_settingButton setImage:[UIImage imageNamed:@"room_music_library_volum_setting"] forState:UIControlStateSelected]; + [_settingButton addTarget:self action:@selector(settingButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _settingButton; +} + +@end diff --git a/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.h b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.h new file mode 100644 index 00000000..3e1d947d --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.h @@ -0,0 +1,16 @@ +// +// XPRoomBackMusicPlayerView.h +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomBackMusicPlayerView : UIView + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m new file mode 100644 index 00000000..657171a2 --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomBackMusicPlayerView.m @@ -0,0 +1,216 @@ +// +// XPRoomBackMusicPlayerView.m +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import "XPRoomBackMusicPlayerView.h" +///Third +#import +///Tool +#import "ThemeColor.h" +#import "UIImage+Utils.h" +#import "XCCurrentVCStackManager.h" +#import "XPCoreDataManager.h" +#import "RtcManager.h" +///Model +#import "Music+CoreDataClass.h" +///View +#import "XPRoomMusicLibraryViewController.h" +@interface XPRoomBackMusicPlayerView () + +///显示歌曲的名字 +@property (nonatomic,strong) UILabel *titleLabel; +///声音的logo +@property (nonatomic,strong) UIImageView *voiceImageView; +///调节声音 +@property (nonatomic,strong) UISlider *voiceSliderView; +///播放暂停 +@property (nonatomic,strong) UIButton *playButton; +///下一首 +@property (nonatomic,strong) UIButton *nextButton; +///更多 +@property (nonatomic,strong) UIButton *moreButton; +@property(nonatomic,strong)NSFetchedResultsController *fetchedResultController; +@end + +@implementation XPRoomBackMusicPlayerView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = [UIColor colorWithWhite:0 alpha:0.8]; + self.layer.masksToBounds = YES; + self.layer.cornerRadius = 40.f; + [self addSubview:self.titleLabel]; + [self addSubview:self.voiceImageView]; + [self addSubview:self.voiceSliderView]; + [self addSubview:self.playButton]; + [self addSubview:self.nextButton]; + [self addSubview:self.moreButton]; +} + +- (void)initSubViewConstraints { + [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self).inset(30); + make.top.mas_equalTo(self).offset(17); + }]; + + [self.voiceImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(12, 15)); + make.left.mas_equalTo(self.titleLabel); + make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(18); + }]; + + [self.voiceSliderView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.mas_equalTo(self.voiceImageView.mas_right).offset(5); + make.right.mas_equalTo(self.playButton.mas_left).offset(-10); + make.centerY.mas_equalTo(self.voiceImageView); + }]; + + [self.playButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(22, 22)); + make.centerY.mas_equalTo(self.voiceImageView); + make.right.mas_equalTo(self.nextButton.mas_left).offset(-10); + }]; + + [self.nextButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(22, 22)); + make.centerY.mas_equalTo(self.voiceImageView); + make.right.mas_equalTo(self.moreButton.mas_left).offset(-10); + }]; + + [self.moreButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.size.mas_equalTo(CGSizeMake(22, 22)); + make.centerY.mas_equalTo(self.voiceImageView); + make.right.mas_equalTo(self).offset(-30); + }]; +} +#pragma mark - Event Response +- (void)voiceSliderViewValueChange:(UISlider *)slider { + +} + +- (void)moreButtonAction:(UIButton *)sender { + XPRoomMusicLibraryViewController * musicLibraryVC = [[XPRoomMusicLibraryViewController alloc] init]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:musicLibraryVC animated:YES]; +} + +- (void)playButtonAction:(UIButton *)sender { + if (self.fetchedResultController.fetchedObjects.count <=0) { + XPRoomMusicLibraryViewController * musicLibraryVC = [[XPRoomMusicLibraryViewController alloc] init]; + [[XCCurrentVCStackManager shareManager].getCurrentVC.navigationController pushViewController:musicLibraryVC animated:YES]; + } else { + switch (sender.tag) { + case 1000: + { + NSArray * array = self.fetchedResultController.fetchedObjects; + Music * music = [array objectAtIndex:0]; + [[RtcManager instance] playBackMusic:music.filePath musicId:0]; + [[RtcManager instance] updateUserSound:50]; + [[RtcManager instance] updateMusicSound:50]; + } + break; + case 1001: + + break; + case 1002: + + break; + + default: + break; + } + } +} + +#pragma mark - Getters And Setters +- (UILabel *)titleLabel { + if (!_titleLabel) { + _titleLabel = [[UILabel alloc] init]; + _titleLabel.font = [UIFont systemFontOfSize:13]; + _titleLabel.textColor = UIColor.whiteColor; + _titleLabel.text = @"暂无音乐播放"; + } + return _titleLabel; +} + +- (UIImageView *)voiceImageView { + if (!_voiceImageView) { + _voiceImageView = [[UIImageView alloc] init]; + _voiceImageView.userInteractionEnabled = YES; + _voiceImageView.image = [UIImage imageNamed:@"room_music_small_player_voice"]; + } + return _voiceImageView; +} + +- (UISlider *)voiceSliderView { + if (!_voiceSliderView) { + _voiceSliderView = [[UISlider alloc]init]; + _voiceSliderView.minimumValue = 0; + _voiceSliderView.maximumValue = 100; + _voiceSliderView.value = 50; + _voiceSliderView.minimumTrackTintColor = [UIColor whiteColor]; + _voiceSliderView.maximumTrackTintColor = UIColorFromRGB(0x999999); + [_voiceSliderView setThumbImage:[UIImage imageNamed:@"room_music_small_player_white_dot"] forState:UIControlStateNormal]; + [_voiceSliderView addTarget:self action:@selector(voiceSliderViewValueChange:) forControlEvents:UIControlEventValueChanged]; + + } + return _voiceSliderView; +} + +- (UIButton *)playButton { + if (!_playButton) { + _playButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_playButton setImage:[UIImage imageNamed:@"room_music_small_player_play"] forState:UIControlStateNormal]; + [_playButton setImage:[UIImage imageNamed:@"room_music_small_player_pause"] forState:UIControlStateSelected]; + _playButton.tag = 1000; + [_playButton addTarget:self action:@selector(playButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _playButton; +} + +- (UIButton *)moreButton { + if (!_moreButton) { + _moreButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_moreButton setImage:[UIImage imageNamed:@"room_music_small_player_more"] forState:UIControlStateNormal]; + [_moreButton setImage:[UIImage imageNamed:@"room_music_small_player_more"] forState:UIControlStateSelected]; + _moreButton.tag = 1001; + [_moreButton addTarget:self action:@selector(moreButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + _moreButton.transform = CGAffineTransformMakeRotation(-M_PI /2); + } + return _moreButton; +} + +- (UIButton *)nextButton { + if (!_nextButton) { + _nextButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_nextButton setImage:[UIImage imageNamed:@"room_music_small_player_next"] forState:UIControlStateNormal]; + [_nextButton setImage:[UIImage imageNamed:@"room_music_small_player_next"] forState:UIControlStateSelected]; + _nextButton.tag = 1002; + [_nextButton addTarget:self action:@selector(playButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _nextButton; +} + +-(NSFetchedResultsController *)fetchedResultController{ + if (!_fetchedResultController) { + NSFetchRequest *request = [[NSFetchRequest alloc]initWithEntityName:@"Music"]; + NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"musicId" ascending:true]; + request.sortDescriptors = @[sort]; + _fetchedResultController = [[NSFetchedResultsController alloc]initWithFetchRequest:request managedObjectContext:[XPCoreDataManager shareInstance].managedObjectContext sectionNameKeyPath:nil cacheName:nil]; + _fetchedResultController.delegate = self; + [_fetchedResultController performFetch:nil]; + } + return _fetchedResultController; +} + +@end diff --git a/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomMusicVoiceSettingView.h b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomMusicVoiceSettingView.h new file mode 100644 index 00000000..f4690540 --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomMusicVoiceSettingView.h @@ -0,0 +1,31 @@ +// +// XPRoomMusicVoiceSettingView.h +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +typedef NS_ENUM(NSInteger, MusicVoiceSettingType) { + ///人声 + MusicVoiceSettingType_User, + ///背景音乐 + MusicVoiceSettingType_Music, +}; +@class XPRoomMusicVoiceSettingView; +@protocol XPRoomMusicVoiceSettingViewDelegate + +- (void)xPRoomMusicVoiceSettingView:(XPRoomMusicVoiceSettingView *)view didSliderValueChange:(UISlider *)slider; + +@end + +@interface XPRoomMusicVoiceSettingView : UIView + +///代理 +@property (nonatomic,weak) id delegate; +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomMusicVoiceSettingView.m b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomMusicVoiceSettingView.m new file mode 100644 index 00000000..7626b7fa --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/SubViews/XPRoomMusicVoiceSettingView.m @@ -0,0 +1,214 @@ +// +// XPRoomMusicVoiceSettingView.m +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import "XPRoomMusicVoiceSettingView.h" +///Third +#import +///Tool +#import "ThemeColor.h" + +@interface XPRoomMusicVoiceSettingView () +///最大的容器 +@property (nonatomic,strong) UIStackView *stackView; +///人声 +@property (nonatomic,strong) UIStackView *userStackView; +///人声 +@property (nonatomic,strong) UILabel *userTitleLabel; +///人生音量调节滑块 +@property (strong, nonatomic) UISlider *userVolumeSlider; +///% +@property (nonatomic,strong) UILabel *userVoiceLabel; +///音乐的 +@property (nonatomic,strong) UIStackView *musicStackView; +///人声 +@property (nonatomic,strong) UILabel *musicTitleLabel; +///人生音量调节滑块 +@property (strong, nonatomic) UISlider *musicVolumeSlider; +///音乐的% +@property (nonatomic,strong) UILabel *musicVoiceLabel; +@end + + +@implementation XPRoomMusicVoiceSettingView + +- (instancetype)initWithFrame:(CGRect)frame { + self = [super initWithFrame:frame]; + if (self) { + [self initSubViews]; + [self initSubViewConstraints]; + } + return self; +} + +#pragma mark - Private Method +- (void)initSubViews { + self.backgroundColor = UIColorRGBAlpha(0x000000, 0.2); + [self addSubview:self.stackView]; + + [self.stackView addArrangedSubview:self.userStackView]; + [self.stackView addArrangedSubview:self.musicStackView]; + + [self.userStackView addArrangedSubview:self.userTitleLabel]; + [self.userStackView addArrangedSubview:self.userVolumeSlider]; + [self.userStackView addArrangedSubview:self.userVoiceLabel]; + + [self.musicStackView addArrangedSubview:self.musicTitleLabel]; + [self.musicStackView addArrangedSubview:self.musicVolumeSlider]; + [self.musicStackView addArrangedSubview:self.musicVoiceLabel]; +} + +- (void)initSubViewConstraints { + [self mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(60); + }]; + + [self.stackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.right.mas_equalTo(self).inset(15); + make.top.bottom.mas_equalTo(self); + + }]; + + [self.userStackView mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(35); + }]; + + [self.userTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(35); + }]; + + [self.userVoiceLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(35); + }]; + + [self.musicTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(35); + }]; + + [self.musicVoiceLabel mas_makeConstraints:^(MASConstraintMaker *make) { + make.width.mas_equalTo(35); + }]; +} +#pragma mark - Event Response +- (void)userVolumeSliderValueChange:(UISlider *)slider { + if (slider == self.userVolumeSlider) { + self.userVoiceLabel.text = [[NSString stringWithFormat:@"%ld",(NSInteger)slider.value] stringByAppendingString:@"%"]; + } else { + self.musicVoiceLabel.text = [[NSString stringWithFormat:@"%ld",(NSInteger)slider.value] stringByAppendingString:@"%"]; + } + + if (self.delegate && [self.delegate respondsToSelector:@selector(xPRoomMusicVoiceSettingView:didSliderValueChange:)]) { + [self.delegate xPRoomMusicVoiceSettingView:self didSliderValueChange:slider]; + } +} + +#pragma mark - Getters And Setters +- (UIStackView *)stackView { + if (!_stackView) { + _stackView = [[UIStackView alloc] init]; + _stackView.axis = UILayoutConstraintAxisVertical; + _stackView.distribution = UIStackViewDistributionFill; + _stackView.alignment = UIStackViewAlignmentFill; + _stackView.spacing = 5; + } + return _stackView; +} + +- (UIStackView *)userStackView { + if (!_userStackView) { + _userStackView = [[UIStackView alloc] init]; + _userStackView.axis = UILayoutConstraintAxisHorizontal; + _userStackView.distribution = UIStackViewDistributionFill; + _userStackView.alignment = UIStackViewAlignmentCenter; + _userStackView.spacing = 5; + } + return _userStackView; +} + +- (UILabel *)userTitleLabel { + if (!_userTitleLabel) { + _userTitleLabel = [[UILabel alloc] init]; + _userTitleLabel.font = [UIFont systemFontOfSize:13]; + _userTitleLabel.textColor = UIColorFromRGB(0x999999); + _userTitleLabel.text = @"人声"; + } + return _userTitleLabel; +} + +- (UISlider *)userVolumeSlider { + if (!_userVolumeSlider) { + _userVolumeSlider = [[UISlider alloc]init]; + _userVolumeSlider.minimumValue = 0; + _userVolumeSlider.maximumValue = 100; + _userVolumeSlider.value = 50; + _userVolumeSlider.minimumTrackTintColor = [ThemeColor appMainColor]; + _userVolumeSlider.maximumTrackTintColor = UIColor.whiteColor; + _userVolumeSlider.tag = MusicVoiceSettingType_User; + [_userVolumeSlider setThumbImage:[UIImage imageNamed:@"room_music_voice_setting_dot"] forState:UIControlStateNormal]; + [_userVolumeSlider addTarget:self action:@selector(userVolumeSliderValueChange:) forControlEvents:UIControlEventValueChanged]; + + } + return _userVolumeSlider; +} + +- (UILabel *)userVoiceLabel { + if (!_userVoiceLabel) { + _userVoiceLabel = [[UILabel alloc] init]; + _userVoiceLabel.font = [UIFont systemFontOfSize:13]; + _userVoiceLabel.textColor = UIColorFromRGB(0x999999); + _userVoiceLabel.text = @"50%"; + } + return _userVoiceLabel; +} + +- (UIStackView *)musicStackView { + if (!_musicStackView) { + _musicStackView = [[UIStackView alloc] init]; + _musicStackView.axis = UILayoutConstraintAxisHorizontal; + _musicStackView.distribution = UIStackViewDistributionFill; + _musicStackView.alignment = UIStackViewAlignmentFill; + _musicStackView.spacing = 5; + } + return _musicStackView; +} + +- (UILabel *)musicTitleLabel { + if (!_musicTitleLabel) { + _musicTitleLabel = [[UILabel alloc] init]; + _musicTitleLabel.font = [UIFont systemFontOfSize:13]; + _musicTitleLabel.textColor = UIColorFromRGB(0x999999); + _musicTitleLabel.text = @"音乐"; + } + return _musicTitleLabel; +} + +- (UISlider *)musicVolumeSlider { + if (!_musicVolumeSlider) { + _musicVolumeSlider = [[UISlider alloc]init]; + _musicVolumeSlider.minimumValue = 0; + _musicVolumeSlider.maximumValue = 100; + _musicVolumeSlider.value = 50; + _musicVolumeSlider.minimumTrackTintColor = [ThemeColor appMainColor]; + _musicVolumeSlider.maximumTrackTintColor = UIColor.whiteColor; + _musicVolumeSlider.tag = MusicVoiceSettingType_Music; + [_musicVolumeSlider setThumbImage:[UIImage imageNamed:@"room_music_voice_setting_dot"] forState:UIControlStateNormal]; + [_musicVolumeSlider addTarget:self action:@selector(userVolumeSliderValueChange:) forControlEvents:UIControlEventValueChanged]; + + } + return _musicVolumeSlider; +} + +- (UILabel *)musicVoiceLabel { + if (!_musicVoiceLabel) { + _musicVoiceLabel = [[UILabel alloc] init]; + _musicVoiceLabel.font = [UIFont systemFontOfSize:13]; + _musicVoiceLabel.textColor = UIColorFromRGB(0x999999); + _musicVoiceLabel.text = @"50%"; + } + return _musicVoiceLabel; +} + +@end diff --git a/xplan-ios/Main/Room/View/BackMusic/View/XPRoomMusicLibraryViewController.h b/xplan-ios/Main/Room/View/BackMusic/View/XPRoomMusicLibraryViewController.h new file mode 100644 index 00000000..dc25105b --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/XPRoomMusicLibraryViewController.h @@ -0,0 +1,16 @@ +// +// XPRoomMusicLibraryViewController.h +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import "MvpViewController.h" + +NS_ASSUME_NONNULL_BEGIN + +@interface XPRoomMusicLibraryViewController : MvpViewController + +@end + +NS_ASSUME_NONNULL_END diff --git a/xplan-ios/Main/Room/View/BackMusic/View/XPRoomMusicLibraryViewController.m b/xplan-ios/Main/Room/View/BackMusic/View/XPRoomMusicLibraryViewController.m new file mode 100644 index 00000000..d5122fb7 --- /dev/null +++ b/xplan-ios/Main/Room/View/BackMusic/View/XPRoomMusicLibraryViewController.m @@ -0,0 +1,158 @@ +// +// XPRoomMusicLibraryViewController.m +// xplan-ios +// +// Created by 冯硕 on 2022/5/9. +// + +#import "XPRoomMusicLibraryViewController.h" +///Third +#import +///Tool +#import "XPCoreDataManager.h" +///View +#import "XPRoomMusicLibraryTableViewCell.h" +#import "XPRoomMusicLibraryEmptyTableViewCell.h" +#import "XPMusicLibraryPlayView.h" +#import "XPRoomMusicVoiceSettingView.h" +#import "XPRoomTransferMusicViewController.h" + +@interface XPRoomMusicLibraryViewController () +///列表 +@property (nonatomic,strong) UITableView *tableView; +///底部播放器 +@property (nonatomic,strong) XPMusicLibraryPlayView *playView; +///设置声音 +@property (nonatomic,strong) XPRoomMusicVoiceSettingView *voiceSettingView; +@property(nonatomic,strong)NSFetchedResultsController *fetchedResultController; +///数据源 +@property (nonatomic,strong) NSArray *datasource; +@end + +@implementation XPRoomMusicLibraryViewController + +-(NSFetchedResultsController *)fetchedResultController{ + if (!_fetchedResultController) { + NSFetchRequest *request = [[NSFetchRequest alloc]initWithEntityName:@"Music"]; + NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"musicId" ascending:true]; + request.sortDescriptors = @[sort]; + _fetchedResultController = [[NSFetchedResultsController alloc]initWithFetchRequest:request managedObjectContext:[XPCoreDataManager shareInstance].managedObjectContext sectionNameKeyPath:nil cacheName:nil]; + _fetchedResultController.delegate = self; + [_fetchedResultController performFetch:nil]; + } + return _fetchedResultController; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + self.title = @"我的乐库"; + self.datasource = self.fetchedResultController.fetchedObjects; + [self initSubViews]; + [self initSubViewConstraints]; +} + +#pragma mark - Private Method +- (void)initSubViews { + [self addNavigationItemWithImageNames:@[@"room_music_library_nav_add"] isLeft:NO target:self action:@selector(addMusicAction:) tags:nil]; + [self.view addSubview:self.tableView]; + [self.view addSubview:self.playView]; + [self.view addSubview:self.voiceSettingView]; +} + +- (void)initSubViewConstraints { + [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { + make.left.top.right.mas_equalTo(self.view); + make.bottom.mas_equalTo(self.playView.mas_top); + }]; + + [self.playView mas_makeConstraints:^(MASConstraintMaker *make) { + make.height.mas_equalTo(55); + make.bottom.left.right.mas_equalTo(self.view); + }]; + + [self.voiceSettingView mas_makeConstraints:^(MASConstraintMaker *make) { + make.bottom.mas_equalTo(self.playView.mas_top); + make.left.right.mas_equalTo(self.view); + }]; +} +#pragma mark - UITableViewDelegate And UITableViewDataSource +- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { + return 1; +} + +- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { + return self.datasource.count > 0 ? self.datasource.count : 1; +} +- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { + if (self.datasource.count > 0) { + XPRoomMusicLibraryTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPRoomMusicLibraryTableViewCell class])]; + cell.musicInfo = [self.datasource objectAtIndex:indexPath.row]; + return cell; + } + + XPRoomMusicLibraryEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPRoomMusicLibraryEmptyTableViewCell class])]; + cell.delegate = self; + return cell; +} + +- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { + return self.datasource.count > 0 ? 60 : 500; +} + +#pragma mark - XPRoomMusicLibraryEmptyTableViewCellDelegate +- (void)xPRoomMusicLibraryEmptyTableViewCell:(XPRoomMusicLibraryEmptyTableViewCell *)cell didClickAdd:(UIButton *)sender { + XPRoomTransferMusicViewController * transferVC = [[XPRoomTransferMusicViewController alloc] init]; + [self.navigationController pushViewController:transferVC animated:YES]; +} +#pragma mark - XPMusicLibraryPlayViewDelegate +- (void)xPMusicLibraryPlayView:(XPMusicLibraryPlayView *)view didClickVoiceSetting:(UIButton *)sender { + self.voiceSettingView.hidden = !sender.selected; +} + +#pragma mark - XPRoomMusicVoiceSettingViewDelegate +- (void)xPRoomMusicVoiceSettingView:(XPRoomMusicVoiceSettingView *)view didSliderValueChange:(UISlider *)slider { + +} + +#pragma mark - Event Response +- (void)addMusicAction:(UIButton *)sender { + XPRoomTransferMusicViewController * transferVC = [[XPRoomTransferMusicViewController alloc] init]; + [self.navigationController pushViewController:transferVC animated:YES]; +} + +#pragma mark - Getters And Setters +- (UITableView *)tableView { + if (!_tableView) { + _tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain]; + _tableView.delegate = self; + _tableView.dataSource = self; + _tableView.tableFooterView = [UIView new]; + _tableView.separatorStyle = UITableViewCellSeparatorStyleNone; + _tableView.backgroundColor = [UIColor clearColor]; + if (@available(iOS 11.0, *)) { + _tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; + } + [_tableView registerClass:[XPRoomMusicLibraryTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPRoomMusicLibraryTableViewCell class])]; + [_tableView registerClass:[XPRoomMusicLibraryEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPRoomMusicLibraryEmptyTableViewCell class])]; + } + return _tableView; +} + +- (XPMusicLibraryPlayView *)playView { + if (!_playView) { + _playView = [[XPMusicLibraryPlayView alloc] init]; + _playView.delegate = self; + } + return _playView; +} + +- (XPRoomMusicVoiceSettingView *)voiceSettingView { +if (!_voiceSettingView) { + _voiceSettingView = [[XPRoomMusicVoiceSettingView alloc] init]; + _voiceSettingView.delegate = self; + _voiceSettingView.hidden = YES; + } + return _voiceSettingView; +} + +@end diff --git a/xplan-ios/Main/Room/View/BackMusic/View/XPRoomTransferMusicViewController.m b/xplan-ios/Main/Room/View/BackMusic/View/XPRoomTransferMusicViewController.m index 58b6a845..ceda9ef0 100644 --- a/xplan-ios/Main/Room/View/BackMusic/View/XPRoomTransferMusicViewController.m +++ b/xplan-ios/Main/Room/View/BackMusic/View/XPRoomTransferMusicViewController.m @@ -17,7 +17,10 @@ #import "HTTPServer.h" #import "MyHTTPConnection.h" #import "SJXCSMIPHelper.h" - +#import "XPCoreDataManager.h" +#import "GCDHelper.h" +///Model +#import "Music+CoreDataClass.h" @interface XPRoomTransferMusicViewController () ///容器 @property (nonatomic,strong) UIStackView *stackView; @@ -41,13 +44,18 @@ @property (nonatomic,strong) UIButton *saveButton; @property (nonatomic,strong) HTTPServer *httpServer; @property (strong, nonatomic) NSString *ipAddress; +///歌曲的个数 +@property (nonatomic,assign) NSInteger numberSong; @end @implementation XPRoomTransferMusicViewController +- (void)dealloc { + NSLog(@"aaaa"); +} + - (void)viewDidLoad { [super viewDidLoad]; - [self getData]; [self connectHttpServer]; [self monitorNet]; [self initSubViews]; @@ -56,25 +64,9 @@ #pragma mark - Private Method -- (void)getData { - NSString* uploadDirPath =[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]; - uploadDirPath = [NSString stringWithFormat:@"%@/music",uploadDirPath]; - NSFileManager * fm = [NSFileManager defaultManager]; - NSArray *arr = [fm contentsOfDirectoryAtPath:uploadDirPath error:nil]; - for (int i = 0; i < arr.count; i++) { - NSString * name = [arr objectAtIndex:i]; - NSString * filePath = [NSString stringWithFormat:@"%@/%@", uploadDirPath, name]; - AVURLAsset *mp3Asset = [AVURLAsset URLAssetWithURL:[NSURL fileURLWithPath:filePath] options:nil]; - NSArray *titles = [AVMetadataItem metadataItemsFromArray:mp3Asset.commonMetadata withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon]; - NSMutableArray *artists = [[AVMetadataItem metadataItemsFromArray:mp3Asset.commonMetadata withKey:AVMetadataCommonKeyArtist keySpace:AVMetadataKeySpaceCommon] mutableCopy]; - NSArray *albumNames = [AVMetadataItem metadataItemsFromArray:mp3Asset.commonMetadata withKey:AVMetadataCommonKeyAlbumName keySpace:AVMetadataKeySpaceCommon]; - NSLog(@"标题%@ 内容%@ 相册%@", titles.firstObject.value, artists.firstObject.value, albumNames.firstObject.value); - } - NSLog(@"%@",arr); -} - - (void)initSubViews { self.title = @"歌曲传输"; + self.numberSong = 0; [self.view addSubview:self.stackView]; [self.stackView addArrangedSubview:self.wifiView]; [self.stackView addArrangedSubview:self.ipLabel]; @@ -152,8 +144,9 @@ } self.ipLabel.text = self.ipAddress; } - + @kWeakify(self); [[AFNetworkReachabilityManager sharedManager] setReachabilityStatusChangeBlock:^(AFNetworkReachabilityStatus status) { + @kStrongify(self); switch (status) { case AFNetworkReachabilityStatusNotReachable: { @@ -204,14 +197,48 @@ - (void)onHttpFileTranSportServer:(MyHTTPConnection *)server successWithPath:(NSString *)filePath { AVURLAsset *mp3Asset = [AVURLAsset URLAssetWithURL:[NSURL fileURLWithPath:filePath] options:nil]; - NSString *singer;//歌手 - NSString *song;//歌曲名 - UIImage *image;//图片 - NSString *albumName;//专辑名 - NSArray *titles = [AVMetadataItem metadataItemsFromArray:mp3Asset.commonMetadata withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon]; - NSMutableArray *artists = [[AVMetadataItem metadataItemsFromArray:mp3Asset.commonMetadata withKey:AVMetadataCommonKeyArtist keySpace:AVMetadataKeySpaceCommon] mutableCopy]; - NSArray *albumNames = [AVMetadataItem metadataItemsFromArray:mp3Asset.commonMetadata withKey:AVMetadataCommonKeyAlbumName keySpace:AVMetadataKeySpaceCommon]; - NSLog(@"歌手:%@ 歌曲名:%@, 专辑图片%@, 专辑名称%@", singer, song, image,albumName); + if (mp3Asset) { + NSString * songName;///歌曲 + NSString *singer;//歌手 + UIImage *image;//图片 + NSMutableArray *artists = [[AVMetadataItem metadataItemsFromArray:mp3Asset.commonMetadata withKey:AVMetadataCommonKeyArtist keySpace:AVMetadataKeySpaceCommon] mutableCopy]; + NSArray *albumNames = [AVMetadataItem metadataItemsFromArray:mp3Asset.commonMetadata withKey:AVMetadataCommonKeyArtwork keySpace:AVMetadataKeySpaceCommon]; + NSArray *titles = [AVMetadataItem metadataItemsFromArray:mp3Asset.commonMetadata withKey:AVMetadataCommonKeyTitle keySpace:AVMetadataKeySpaceCommon]; + if (artists.count > 0) { + AVMetadataItem *artist = [artists objectAtIndex:0]; + singer = [artist.value copyWithZone:nil]; + }else{ + singer = @"未知歌手"; + } + + if (albumNames.count > 0) { + AVMetadataItem *artist = [albumNames objectAtIndex:0]; + image = [UIImage imageWithData:[artist.value copyWithZone:nil]]; + }else{ + image = [UIImage imageNamed:@"common_avatar"]; + } + + if (titles.count > 0) { + AVMetadataItem *artist = [titles objectAtIndex:0]; + songName = [artist.value copyWithZone:nil]; + }else{ + songName = @"未知"; + } + + NSUUID * uuid = [UIDevice currentDevice].identifierForVendor; + NSString * musicId = [uuid.UUIDString stringByAppendingString:songName]; + Music * currentMusic = [NSEntityDescription insertNewObjectForEntityForName:@"Music" inManagedObjectContext:[XPCoreDataManager shareInstance].managedObjectContext]; + currentMusic.filePath = filePath; + currentMusic.author = singer; + currentMusic.musicId = musicId; + currentMusic.songName = songName; + currentMusic.songAlbum = UIImageJPEGRepresentation(image, 1); + [[XPCoreDataManager shareInstance] save]; + dispatch_main_sync_safe(^{ + self.numberSong++; + [self.musiceCountButton setTitle:[NSString stringWithFormat:@"已导入%ld首歌曲", self.numberSong] forState:UIControlStateNormal]; + }); + } } - (BOOL)onHttpFileDataEstimateDuplicateCanPassTranSportServer:(MyHTTPConnection *)server withPath:(NSString *)filePath andFileName:(NSString *)fileName { diff --git a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m index dbfb0c41..cec267d5 100644 --- a/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m +++ b/xplan-ios/Main/Room/View/BaseUIContainerView/XPRoomFunctionContainerView.m @@ -62,6 +62,7 @@ #import "XPMineUserInfoViewController.h" #import "XPRoomRankEntranceView.h" #import "XPRoomAnchorRankEnterView.h" +#import "XPRoomBackMusicPlayerView.h" ///个播PK #import "XPAnchorFansTeamEntranceView.h" #import "XPAnchorFansTeamViewController.h" @@ -104,7 +105,10 @@ @property (nonatomic, strong) NSMutableArray *trumpetQueue; ///小喇叭动画定时器 @property (nonatomic, strong) dispatch_source_t trumpetTimer; - +///播放器的入口 +@property (nonatomic,strong) UIButton *musicEnterButton; +///播放器 +@property (nonatomic,strong) XPRoomBackMusicPlayerView *musicPlayView; @end @implementation XPRoomFunctionContainerView @@ -136,6 +140,26 @@ return [subView hitTest:convertPoint withEvent:event]; } } + + + for (NSInteger i = (self.subviews.count - 1) ; i >= 0 ; i--) { + UIView * subView = [self.subviews objectAtIndex:i]; + if (self.musicPlayView.superview && self.musicEnterButton.hidden == YES && ![subView isEqual:self.musicPlayView]) { + [UIView animateWithDuration:0.2 animations:^{ + self.musicEnterButton.hidden = NO; + } completion:nil]; + + POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; + moveAnimation.fromValue = [NSValue valueWithCGPoint:self.musicPlayView.center]; + moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth, self.musicPlayView.center.y)]; + moveAnimation.beginTime = CACurrentMediaTime(); + moveAnimation.duration = 0.5; + moveAnimation.repeatCount = 1; + moveAnimation.removedOnCompletion = YES; + [self.musicPlayView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; + break; + } + } return nil; } @@ -648,6 +672,28 @@ if (self.delegate.getRoomInfo.type == RoomType_MiniGame) { [self.littleGameMiniView needRefreshPosition:queue]; } + MicroQueueModel * currentUserModel; + NSString * uid = [AccountInfoStorage instance].getUid; + for (MicroQueueModel * microModel in queue.allValues) { + if (microModel.userInfo && microModel.userInfo.uid == uid.integerValue) { + currentUserModel = microModel; + } + } + if (currentUserModel) { + if (!self.musicEnterButton.superview) { + [self addSubview:self.musicEnterButton]; + [self.musicEnterButton mas_makeConstraints:^(MASConstraintMaker *make) { + make.right.mas_equalTo(0).offset(8); + make.top.mas_equalTo(kNavigationHeight+4); + make.width.mas_equalTo(79); + make.height.mas_equalTo(22); + }]; + } + } else { + if (self.musicEnterButton) { + [self.musicEnterButton removeFromSuperview]; + } + } } #pragma mark - XPAcrpssRoomPKPanelViewDelegate - (void)xPAcrpssRoomPKPanelView:(XPAcrpssRoomPKPanelView *)view onlookRoom:(NSString *)roomUid { @@ -837,6 +883,26 @@ } } +- (void)musicEnterButtonAction:(UIButton *)sender { + if (!self.musicPlayView.superview) { + [self addSubview:self.musicPlayView]; + self.musicPlayView.frame = CGRectMake(-KScreenWidth, kNavigationHeight + 4, KScreenWidth - 85, 80); + } + + POPBasicAnimation *moveAnimation = [POPBasicAnimation animationWithPropertyNamed:kPOPViewCenter]; + moveAnimation.fromValue = [NSValue valueWithCGPoint:CGPointMake(-KScreenWidth, self.musicPlayView.center.y)]; + moveAnimation.toValue = [NSValue valueWithCGPoint:CGPointMake(KScreenWidth/ 2, self.musicPlayView.center.y)]; + moveAnimation.beginTime = CACurrentMediaTime(); + moveAnimation.duration = 0.5; + moveAnimation.repeatCount = 1; + moveAnimation.removedOnCompletion = YES; + [self.musicPlayView pop_addAnimation:moveAnimation forKey:@"moveOutAnimation"]; + + [UIView animateWithDuration:0.2 animations:^{ + self.musicEnterButton.hidden = YES; + } completion:nil]; +} + #pragma mark - 房间话题 - (void)updateRoomTopicViewConstraint { RoomInfoModel * roomInfo = self.delegate.getRoomInfo; @@ -1306,4 +1372,27 @@ return _trumpetQueue; } +- (UIButton *)musicEnterButton { + if (!_musicEnterButton) { + _musicEnterButton = [UIButton buttonWithType:UIButtonTypeCustom]; + [_musicEnterButton setTitle:@"播放音乐" forState:UIControlStateNormal]; + [_musicEnterButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; + _musicEnterButton.titleLabel.font = [UIFont systemFontOfSize:10]; + [_musicEnterButton setImage:[UIImage imageNamed:@"room_music_player_enter"] forState:UIControlStateNormal]; + _musicEnterButton.layer.masksToBounds = YES; + _musicEnterButton.layer.cornerRadius = 11; + _musicEnterButton.imageEdgeInsets = UIEdgeInsetsMake(0, -15, 0, 0); + _musicEnterButton.backgroundColor = UIColorRGBAlpha(0xffffff, 0.2); + [_musicEnterButton addTarget:self action:@selector(musicEnterButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + } + return _musicEnterButton; +} + +- (XPRoomBackMusicPlayerView *)musicPlayView { + if (!_musicPlayView) { + _musicPlayView = [[XPRoomBackMusicPlayerView alloc] init]; + } + return _musicPlayView; +} + @end diff --git a/xplan-ios/Main/Tabbar/TabbarViewController.m b/xplan-ios/Main/Tabbar/TabbarViewController.m index 23f89c87..ed1bce04 100644 --- a/xplan-ios/Main/Tabbar/TabbarViewController.m +++ b/xplan-ios/Main/Tabbar/TabbarViewController.m @@ -42,7 +42,6 @@ #import "XPTeenagerAlertView.h" #import "XPRoomViewController.h" #import "XPNobleUpgradeLevelView.h" -#import "XPRoomTransferMusicViewController.h" ///Present #import "MainPresenter.h" #import "MainProtocol.h" @@ -209,15 +208,14 @@ - (void)initTabs:(BOOL)logined { self.viewControllers = nil; - NSArray *normalImageNames = @[@"tab_gameHome_normal",@"tab_game_normal",@"tab_message_normal", @"tab_mine_normal", @"tab_mine_normal"]; - NSArray *selectImageNames = @[@"tab_gameHome_selected",@"tab_game_selected",@"tab_message_selected", @"tab_mine_selected", @"tab_mine_selected"]; - NSArray *tabLabel = @[@"派对",@"赛事",@"消息", @"我的", @"歌曲"]; + NSArray *normalImageNames = @[@"tab_gameHome_normal",@"tab_game_normal",@"tab_message_normal", @"tab_mine_normal"]; + NSArray *selectImageNames = @[@"tab_gameHome_selected",@"tab_game_selected",@"tab_message_selected", @"tab_mine_selected"]; + NSArray *tabLabel = @[@"派对",@"赛事",@"消息", @"我的"]; UIViewController *game; UIViewController *msg; UIViewController *me; UIViewController * home; - UIViewController * music; if (logined) { XplanFBFlutterViewContainer *fvcGame = XplanFBFlutterViewContainer.new; #ifdef DEBUG @@ -230,20 +228,17 @@ me = [[XPMineViewController alloc] init]; home = [[XPHomeViewController alloc] init]; - music = [[XPRoomTransferMusicViewController alloc] init]; } else { game = [[BaseViewController alloc]init]; msg = [[SessionListViewController alloc]init]; me = [[BaseViewController alloc]init]; home = [[BaseViewController alloc] init]; - music = [[BaseViewController alloc] init]; } [self createTabBarItem:home title:tabLabel[0] image:normalImageNames[0] selectedImage:selectImageNames[0]]; [self createTabBarItem:game title:tabLabel[1] image:normalImageNames[1] selectedImage:selectImageNames[1]]; [self createTabBarItem:msg title:tabLabel[2] image:normalImageNames[2] selectedImage:selectImageNames[2]]; [self createTabBarItem:me title:tabLabel[3] image:normalImageNames[3] selectedImage:selectImageNames[3]]; - [self createTabBarItem:music title:tabLabel[4] image:normalImageNames[4] selectedImage:selectImageNames[4]]; - self.viewControllers = @[home,game,msg,me, music]; + self.viewControllers = @[home,game,msg,me]; self.selectedIndex = 0; }