PlayerEvent.java 2.44 KB
package com.wd.basemusic.domain;


import com.wd.basemusic.PlayingInfoManager;
import com.wd.foundation.bean.music.bean.dto.ChangeMusic;
import com.wd.foundation.bean.music.bean.dto.PlayingMusic;

/**
 * Create by KunMinX at 2022/7/4
 */
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 final static int EVENT_COUNTDOWN = 5;

  public final int eventId;
  public final ChangeMusic changeMusic;
  public final PlayingMusic playingMusic;
  public final boolean toPause;
  public boolean isend;
  public final Enum<PlayingInfoManager.RepeatMode> repeatMode;

  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(int eventId, ChangeMusic changeMusic) {
    this.eventId = eventId;
    this.changeMusic = changeMusic;
    this.playingMusic = null;
    this.toPause = true;
    this.repeatMode = null;
  }
  public PlayerEvent(int eventId) {
    this.eventId = eventId;
    this.changeMusic = null;
    this.playingMusic = null;
    this.toPause = false;
    this.repeatMode = null;
  }

  public PlayerEvent(int eventId, PlayingMusic playingMusic) {
    this.eventId = eventId;
    this.changeMusic = null;
    this.playingMusic = playingMusic;
    this.toPause = false;
    this.repeatMode = null;
  }

  public PlayerEvent(int eventId, boolean toPause) {
    this.eventId = eventId;
    this.changeMusic = null;
    this.playingMusic = null;
    this.toPause = toPause;
    this.repeatMode = null;
  }

  public PlayerEvent(int eventId, boolean toPause, boolean isend, PlayingMusic playingMusic) {
    this.eventId = eventId;
    this.changeMusic = null;
    this.playingMusic = playingMusic;
    this.toPause = toPause;
    this.repeatMode = null;
    this.isend = isend;
  }

  public PlayerEvent(int eventId, Enum<PlayingInfoManager.RepeatMode> repeatMode) {
    this.eventId = eventId;
    this.changeMusic = null;
    this.playingMusic = null;
    this.toPause = false;
    this.repeatMode = repeatMode;
  }
}