MusicCenterManager.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // MusicCenterManager.h
  3. // BuguLive
  4. //
  5. // Created by 岳克奎 on 16/12/16.
  6. // Copyright © 2016年 xfg. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "MusicSuperPlayer.h"
  10. #import "MusicDataManager.h"
  11. @class MusicCenterManager;
  12. @protocol MusicCenterManagerLrcDataDelegate <NSObject>
  13. @optional
  14. //因为single 写一个 主要是为了嫩出来个方法,其余参数直接single 传
  15. - (void)sendMusicOfLrcModelMArray:(NSMutableArray *)lrcModelMArray
  16. lrcPointTimeStrArray:(NSMutableArray *)lrcPointTimeStrArray
  17. musicNameStr:(NSString *)musicNameStr
  18. musicSingerStr:(NSString *)musicSingerStr;
  19. //歌曲进度 时间
  20. - (void)sendMusicTotalDuration:(CGFloat)musicTotalDuration musicCurrentDuration:(CGFloat)musicCurrentDuration musicPresent:(CGFloat)musicPresent;
  21. //展示要显示 的音乐功能界面 具体实现放在相应SDK下的ViewController里去实现
  22. //- (UIViewController *)showMusicFunctionViewControllerOfMusicCenterManager:(MusicCenterManager *)musicCM;
  23. - (void)changeMusicBtnOfPlayStatewWithMusicPlayState:(BOOL)musicPlaySate;
  24. - (void)showMusicSDKMehodsWhenShowNewPlayer;
  25. @end
  26. //音乐调度中心的代理
  27. @protocol MusicCenterManagerDelegate <NSObject>
  28. @optional
  29. //音乐加载
  30. - (BOOL)showMusicPlayOfMusicPathStr:(NSString *)musicPathStr ofSamplerateNum:(int)samplerateNum;
  31. //音乐播放 //音乐暂停
  32. - (BOOL)musicStartOrStopPlayOfPlayingState:(BOOL)isPlayingState;
  33. //互动音乐 暂停 需要关闭 KTV回响 (暂时是互动)
  34. - (void)closeEnableLoopBackFunction;
  35. // 歌词处理后 给对应的SDK 下的VC
  36. - (void)sendMusicLrcModelDataMArray:(NSMutableArray *)lrcModelMArray lrcPointTimeStrArray:(NSMutableArray *)lrcPointTimeStrArray;
  37. @end
  38. @interface MusicCenterManager : NSObject
  39. @property (nonatomic, strong) MusicSuperPlayer *superPlayer; //C++播放器控制中心
  40. @property (nonatomic, strong) MusicDataManager *musicDataManager; //音乐数据处理中心
  41. @property (nonatomic, strong) UIViewController *recordMusicViewController; //记录 音乐功能UI VC(预留)
  42. @property (nonatomic, assign) BOOL musicPlayingState; //音乐的状态
  43. @property (nonatomic, strong) NSString *recordMusicFilePatnStr; //音乐的本地沙盒路径str
  44. @property (nonatomic, strong) NSString *recordMusicNameStr; //音乐的名称str
  45. @property (nonatomic, strong) NSString *recordMusicSingerStr; //音乐的歌手名Str
  46. @property (nonatomic, assign) CGFloat recordMusicTotalDuration; //当前音乐的总时长
  47. @property (nonatomic, assign) CGFloat recordMusicCurrentDuration;
  48. @property (nonatomic, assign) CGFloat musicPresent;
  49. @property (nonatomic, strong) NSString *recordMusicLrcStr; //当前音乐 歌词 str
  50. @property (nonatomic, strong) NSArray *recordLrcDataArray; //当前音乐 歌词 数据源 数组
  51. @property (nonatomic, strong) UIViewController *recordSuperViewController; //记录 音乐要添加到的父视图
  52. @property (nonatomic, assign) CGRect recordMusicFunctionVCFrameRect; //记录 音乐VC 在父视图的frame
  53. @property (nonatomic, weak) id<MusicCenterManagerDelegate>delegate; //代理 --》VC方向
  54. @property (nonatomic, weak) id<MusicCenterManagerLrcDataDelegate>dataDelegate; //代理--》播放器方向
  55. #pragma mark --life cycle
  56. + (MusicCenterManager *)shareManager;
  57. #pragma mark 音 乐 UI层 部 分 (UI)
  58. #pragma mark - music 加载歌词(LRC)(Data)
  59. /**
  60. * @ brief:加载歌词
  61. *
  62. * @prama : lrcDataStr 歌词
  63. * @prama : mDic 歌词 名信息
  64. * @prama : block finished lrcModelMArray 相当于我么你的歌词数据源
  65. *
  66. * @ use : 把歌词给管理中心,管理中心自动调给数据层解析数据,然后把数据 返回给对应的对象
  67. */
  68. - (void)showMusicLRCofLRCDataStr:(NSString *)lrcDataStr
  69. musicNameStr:(NSString *)musicNameStr
  70. musicSingerStr:(NSString *)musicSingerStr
  71. complete:(void(^)(BOOL finished,NSMutableArray *lrcModelMArray,NSMutableArray *lrcPointTimeStrArray))block;
  72. @end