@@ -48,7 +48,7 @@ public class PlayerController<
4848
4949 private ICacheProxy mICacheProxy ;
5050 private IServiceNotifier mIServiceNotifier ;
51- private final PlayerInfoDispatcher mDispatcher = new PlayerInfoDispatcher ();
51+ private final PlayerInfoDispatcher < B , M , A > mDispatcher = new PlayerInfoDispatcher <> ();
5252
5353 private final PlayingMusic <B , M , A > mCurrentPlay = new PlayingMusic <>("00:00" , "00:00" );
5454 private final ChangeMusic <B , M , A > mChangeMusic = new ChangeMusic <>();
@@ -76,7 +76,7 @@ private void updateProgress() {
7676 mCurrentPlay .setAllTime (calculateTime (mPlayer .getDuration () / 1000 ));
7777 mCurrentPlay .setDuration ((int ) mPlayer .getDuration ());
7878 mCurrentPlay .setPlayerPosition ((int ) mPlayer .getCurrentPosition ());
79- mDispatcher .input (new PlayerEvent (PlayerEvent .EVENT_PROGRESS , mCurrentPlay ));
79+ mDispatcher .input (new PlayerEvent <> (PlayerEvent .EVENT_PROGRESS , mCurrentPlay ));
8080 if (mCurrentPlay .getAllTime ().equals (mCurrentPlay .getNowTime ())) {
8181 if (getRepeatMode () == PlayingInfoManager .RepeatMode .SINGLE_CYCLE ) playAgain ();
8282 else playNext ();
@@ -144,14 +144,14 @@ private void getUrlAndPlay() {
144144 private void afterPlay () {
145145 setChangingPlayingMusic (false );
146146 mHandler .post (mProgressAction );
147- mDispatcher .input (new PlayerEvent (PlayerEvent .EVENT_PLAY_STATUS , false ));
147+ mDispatcher .input (new PlayerEvent <> (PlayerEvent .EVENT_PLAY_STATUS , false ));
148148 if (mIServiceNotifier != null ) mIServiceNotifier .notifyService (true );
149149 }
150150
151151 public void requestLastPlayingInfo () {
152- mDispatcher .input (new PlayerEvent (PlayerEvent .EVENT_PROGRESS , mCurrentPlay ));
153- mDispatcher .input (new PlayerEvent (PlayerEvent .EVENT_CHANGE_MUSIC , mChangeMusic ));
154- mDispatcher .input (new PlayerEvent (PlayerEvent .EVENT_PLAY_STATUS , isPaused ()));
152+ mDispatcher .input (new PlayerEvent <> (PlayerEvent .EVENT_PROGRESS , mCurrentPlay ));
153+ mDispatcher .input (new PlayerEvent <> (PlayerEvent .EVENT_CHANGE_MUSIC , mChangeMusic ));
154+ mDispatcher .input (new PlayerEvent <> (PlayerEvent .EVENT_PLAY_STATUS , isPaused ()));
155155 }
156156
157157 public void setSeek (int progress ) {
@@ -197,21 +197,21 @@ public void playAgain() {
197197 public void pauseAudio () {
198198 mPlayer .pause ();
199199 mHandler .removeCallbacks (mProgressAction );
200- mDispatcher .input (new PlayerEvent (PlayerEvent .EVENT_PLAY_STATUS , true ));
200+ mDispatcher .input (new PlayerEvent <> (PlayerEvent .EVENT_PLAY_STATUS , true ));
201201 if (mIServiceNotifier != null ) mIServiceNotifier .notifyService (true );
202202 }
203203
204204 public void resumeAudio () {
205205 mPlayer .play ();
206206 mHandler .post (mProgressAction );
207- mDispatcher .input (new PlayerEvent (PlayerEvent .EVENT_PLAY_STATUS , false ));
207+ mDispatcher .input (new PlayerEvent <> (PlayerEvent .EVENT_PLAY_STATUS , false ));
208208 if (mIServiceNotifier != null ) mIServiceNotifier .notifyService (true );
209209 }
210210
211211 public void clear () {
212212 mPlayer .stop ();
213213 mPlayer .clearMediaItems ();
214- mDispatcher .input (new PlayerEvent (PlayerEvent .EVENT_PLAY_STATUS , true ));
214+ mDispatcher .input (new PlayerEvent <> (PlayerEvent .EVENT_PLAY_STATUS , true ));
215215 resetIsChangingPlayingChapter ();
216216 if (mIServiceNotifier != null ) mIServiceNotifier .notifyService (false );
217217 }
@@ -222,7 +222,7 @@ public void resetIsChangingPlayingChapter() {
222222 }
223223
224224 public void changeMode () {
225- mDispatcher .input (new PlayerEvent (PlayerEvent .EVENT_REPEAT_MODE , mPlayingInfoManager .changeMode ()));
225+ mDispatcher .input (new PlayerEvent <> (PlayerEvent .EVENT_REPEAT_MODE , mPlayingInfoManager .changeMode ()));
226226 }
227227
228228 public B getAlbum () {
@@ -237,7 +237,7 @@ public void setChangingPlayingMusic(boolean changingPlayingMusic) {
237237 mIsChangingPlayingMusic = changingPlayingMusic ;
238238 if (mIsChangingPlayingMusic ) {
239239 mChangeMusic .setBaseInfo (mPlayingInfoManager .getMusicAlbum (), getCurrentPlayingMusic ());
240- mDispatcher .input (new PlayerEvent (PlayerEvent .EVENT_CHANGE_MUSIC , mChangeMusic ));
240+ mDispatcher .input (new PlayerEvent <> (PlayerEvent .EVENT_CHANGE_MUSIC , mChangeMusic ));
241241 mCurrentPlay .setBaseInfo (mPlayingInfoManager .getMusicAlbum (), getCurrentPlayingMusic ());
242242 mCurrentPlay .setNowTime ("00:00" );
243243 mCurrentPlay .setAllTime ("00:00" );
@@ -263,7 +263,7 @@ public M getCurrentPlayingMusic() {
263263 return mPlayingInfoManager .getCurrentPlayingMusic ();
264264 }
265265
266- public PlayerInfoDispatcher getDispatcher () {
266+ public PlayerInfoDispatcher < B , M , A > getDispatcher () {
267267 return mDispatcher ;
268268 }
269269}
0 commit comments