-
Notifications
You must be signed in to change notification settings - Fork 104
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
64 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 40 additions & 27 deletions
67
player/src/main/java/com/kunminx/player/domain/PlayerEvent.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,65 @@ | ||
package com.kunminx.player.domain; | ||
|
||
import com.kunminx.architecture.domain.event.Event; | ||
import com.kunminx.player.PlayingInfoManager; | ||
import com.kunminx.player.bean.dto.ChangeMusic; | ||
import com.kunminx.player.bean.dto.PlayingMusic; | ||
|
||
/** | ||
* Create by KunMinX at 2022/7/4 | ||
*/ | ||
public class PlayerEvent extends Event<PlayerEvent.Param, PlayerEvent.Result> { | ||
public class PlayerEvent { | ||
public final static int EVENT_CHANGE_MUSIC = 1; | ||
public final static int EVENT_PROGRESS = 2; | ||
public final static int EVENT_PLAY_STATUS = 3; | ||
public final static int EVENT_REPEAT_MODE = 4; | ||
|
||
public PlayerEvent(int eventId) { | ||
this.eventId = eventId; | ||
this.param = new Param(); | ||
this.result = new Result(); | ||
} | ||
public final int eventId; | ||
public final ChangeMusic changeMusic; | ||
public final PlayingMusic playingMusic; | ||
public final boolean toPause; | ||
public final Enum<PlayingInfoManager.RepeatMode> repeatMode; | ||
|
||
public static class Param { | ||
public ChangeMusic changeMusic; | ||
public PlayingMusic playingMusic; | ||
public boolean toPause; | ||
public Enum<PlayingInfoManager.RepeatMode> repeatMode; | ||
} | ||
|
||
public PlayerEvent setPlayingMusic(PlayingMusic music) { | ||
param.playingMusic = music; | ||
return this; | ||
public PlayerEvent(int eventId, | ||
ChangeMusic changeMusic, | ||
PlayingMusic playingMusic, | ||
boolean toPause, | ||
Enum<PlayingInfoManager.RepeatMode> repeatMode) { | ||
this.eventId = eventId; | ||
this.changeMusic = changeMusic; | ||
this.playingMusic = playingMusic; | ||
this.toPause = toPause; | ||
this.repeatMode = repeatMode; | ||
} | ||
|
||
public PlayerEvent setChangeMusic(ChangeMusic music) { | ||
param.changeMusic = music; | ||
return this; | ||
public PlayerEvent(int eventId, ChangeMusic changeMusic) { | ||
this.eventId = eventId; | ||
this.changeMusic = changeMusic; | ||
this.playingMusic = null; | ||
this.toPause = false; | ||
this.repeatMode = null; | ||
} | ||
|
||
public PlayerEvent setStatus(boolean toPause) { | ||
param.toPause = toPause; | ||
return this; | ||
public PlayerEvent(int eventId, PlayingMusic playingMusic) { | ||
this.eventId = eventId; | ||
this.changeMusic = null; | ||
this.playingMusic = playingMusic; | ||
this.toPause = false; | ||
this.repeatMode = null; | ||
} | ||
|
||
public PlayerEvent setRepeatMode(Enum<PlayingInfoManager.RepeatMode> repeatMode) { | ||
param.repeatMode = repeatMode; | ||
return this; | ||
public PlayerEvent(int eventId, boolean toPause) { | ||
this.eventId = eventId; | ||
this.changeMusic = null; | ||
this.playingMusic = null; | ||
this.toPause = toPause; | ||
this.repeatMode = null; | ||
} | ||
|
||
public static class Result { | ||
public PlayerEvent(int eventId, Enum<PlayingInfoManager.RepeatMode> repeatMode) { | ||
this.eventId = eventId; | ||
this.changeMusic = null; | ||
this.playingMusic = null; | ||
this.toPause = false; | ||
this.repeatMode = repeatMode; | ||
} | ||
} |