package com.daya.live_teaching.model;

import android.text.TextUtils;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

public class ClassMember implements Serializable {
    private boolean camera;
    private long joinTime;
    private boolean microphone;
    private int role;
    private String userId;
    private String headUrl;
    private String userName;
    private boolean musicMode;
    private boolean handUpOn;//是否举手
    private boolean isVisibiliyMic;//是否显示麦克风按钮
    private boolean isOnStage;//是否上台

    private PlayMidiJsonBean playMidiJson;
    private List<ScheduleStudentMusicScoresBean> scheduleStudentMusicScores;


    public String getHeadUrl() {
        return headUrl;
    }

    public void setHeadUrl(String headUrl) {
        this.headUrl = headUrl;
    }

    public boolean isMusicMode() {
        return musicMode;
    }

    public void setMusicMode(boolean musicMode) {
        this.musicMode = musicMode;
    }

    public boolean isHandUpOn() {
        return handUpOn;
    }

    public void setHandUpOn(boolean handUpOn) {
        this.handUpOn = handUpOn;
    }

    public boolean isOnStage() {
        return isOnStage;
    }

    public void setOnStage(boolean onStage) {
        isOnStage = onStage;
    }

    public boolean isVisibiliyMic() {
        return isVisibiliyMic;
    }

    public void setVisibiliyMic(boolean visibiliyMic) {
        isVisibiliyMic = visibiliyMic;
    }

    public boolean isCamera() {
        return camera;
    }

    public void setCamera(boolean camera) {
        this.camera = camera;
    }

    public long getJoinTime() {
        return joinTime;
    }

    public void setJoinTime(long joinTime) {
        this.joinTime = joinTime;
    }

    public boolean isMicrophone() {
        return microphone;
    }

    public void setMicrophone(boolean microphone) {
        this.microphone = microphone;
    }

    public Role getRole() {
        return Role.createRole(role);
    }

    public void setRole(int role) {
        this.role = role;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public PlayMidiJsonBean getPlayMidiJson() {
        return playMidiJson;
    }

    public void setPlayMidiJson(PlayMidiJsonBean playMidiJson) {
        this.playMidiJson = playMidiJson;
    }


    public static class PlayMidiJsonBean implements Serializable {
        /**
         * customType : 0
         * enable : false
         * userId :
         * rate : 0
         */

        private int customType;
        private boolean enable;
        @SerializedName("userId")
        private String userIdX;
        private int rate;
        private int playVolume;

        public int getPlayVolume() {
            return playVolume;
        }

        public void setPlayVolume(int playVolume) {
            this.playVolume = playVolume;
        }

        public int getCustomType() {
            return customType;
        }

        public void setCustomType(int customType) {
            this.customType = customType;
        }

        public boolean isEnable() {
            return enable;
        }

        public void setEnable(boolean enable) {
            this.enable = enable;
        }

        public String getUserIdX() {
            return userIdX;
        }

        public void setUserIdX(String userIdX) {
            this.userIdX = userIdX;
        }

        public int getRate() {
            return rate;
        }

        public void setRate(int rate) {
            this.rate = rate;
        }
    }


    public List<ScheduleStudentMusicScoresBean> getScheduleStudentMusicScores() {
        return scheduleStudentMusicScores;
    }

    public void setScheduleStudentMusicScores(List<ScheduleStudentMusicScoresBean> scheduleStudentMusicScores) {
        this.scheduleStudentMusicScores = scheduleStudentMusicScores;
    }

    public static class ScheduleStudentMusicScoresBean implements Serializable {
        public ScheduleStudentMusicScoresBean() {

        }

        public ScheduleStudentMusicScoresBean(int accompanimentPlayStatus, int playStatus) {
            this.accompanimentPlayStatus = accompanimentPlayStatus;
            this.playStatus = playStatus;
        }

        public ScheduleStudentMusicScoresBean(int accompanimentPlayStatus, int downStatus, String musicScoreAccompanimentId, int playStatus, int speed, String url, String mp3Url, String musicScoreName) {
            this.accompanimentPlayStatus = accompanimentPlayStatus;
            this.downStatus = downStatus;
            this.musicScoreAccompanimentId = musicScoreAccompanimentId;
            this.playStatus = playStatus;
            this.speed = speed;
            this.url = url;
            this.mp3Url = mp3Url;
            this.musicScoreName = musicScoreName;
        }

        /**
         * accompanimentPlayStatus : 0
         * downStatus : 0
         * id : 48
         * musicScoreAccompanimentId : 86
         * playStatus : 0
         * speed : 90
         * url :
         * mp3Url :
         */

        private int accompanimentPlayStatus;
        private int downStatus;
        private String id;
        private String musicScoreAccompanimentId;
        private int playStatus;
        private int speed;
        private String url;
        private String mp3Url;
        private String musicScoreName;
        private int isAccompaniment;


        public int getIsAccompaniment() {
            return isAccompaniment;
        }

        public void setIsAccompaniment(int isAccompaniment) {
            this.isAccompaniment = isAccompaniment;
        }

        public String getMusicScoreName() {
            return musicScoreName;
        }

        public void setMsicScoreName(String musicScoreName) {
            this.musicScoreName = musicScoreName;
        }

        public int getAccompanimentPlayStatus() {
            return accompanimentPlayStatus;
        }

        public void setAccompanimentPlayStatus(int accompanimentPlayStatus) {
            this.accompanimentPlayStatus = accompanimentPlayStatus;
        }

        public int getDownStatus() {
            return downStatus;
        }

        public void setDownStatus(int downStatus) {
            this.downStatus = downStatus;
        }

        public String getId() {
            return id;
        }

        public void setId(String id) {
            this.id = id;
        }

        public String getMusicScoreAccompanimentId() {
            return musicScoreAccompanimentId;
        }

        public void setMusicScoreAccompanimentId(String musicScoreAccompanimentId) {
            this.musicScoreAccompanimentId = musicScoreAccompanimentId;
        }

        public int getPlayStatus() {
            return playStatus;
        }

        public void setPlayStatus(int playStatus) {
            this.playStatus = playStatus;
        }

        public int getSpeed() {
            return speed;
        }

        public void setSpeed(int speed) {
            this.speed = speed;
        }

        public String getUrl() {
            return url;
        }

        public void setUrl(String url) {
            this.url = url;
        }

        public String getMp3Url() {
            return mp3Url;
        }

        public String getMp3UrlName() {
            return TextUtils.isEmpty(mp3Url) ? "" : mp3Url.substring(mp3Url.lastIndexOf("/") + 1);
        }

        public String getUrlName() {
            return TextUtils.isEmpty(url) ? "" : url.substring(url.lastIndexOf("/") + 1);
        }

        public void setMp3Url(String mp3Url) {
            this.mp3Url = mp3Url;
        }
    }
}
