package com.mogo.cloud.live.model;

/**
 * 直播状态数据模型
 */
public class LiveStatusModel {
    /**
     * 当前的房间ID
     */
    private String currentRoomId = "";
    /**
     * 是否登录了当前车机的房间
     */
    private boolean isLoginCurrentRoom = false;
    /**
     * 当前的多房间ID
     */
    private String multiRoomId = "";
    /**
     * 是否登录了第二个车机的直播房间
     */
    private boolean isLoginMultiRoom = false;
    /**
     * 当前直播流ID
     */
    private String currentStreamId = "";
    /**
     * MultiRoom中直播流ID
     */
    private String multiStreamId = "";
    /**
     * 自定义采集状态，true-初始化完成，false-没有初始化
     */
    private boolean isCaptureStatus;
    /**
     * 推送状态，true-推流中，false-没有推流
     */
    private boolean isPushing;
    /**
     * 播放状态，true-播放中，false-没有播放
     */
    private boolean isPlaying;
    /**
     * ZeGo引擎状态，true-ZeGo引擎可用，false-ZeGo引擎不可用
     */
    private boolean isExpressEngineCanUse;
    /**
     * 当前在直播间的人数，只剩下一个人的时候需要停掉直播推送
     */
    private int onlineNumber;

    public String getCurrentRoomId() {
        return currentRoomId;
    }

    public void setCurrentRoomId(String currentRoomId) {
        this.currentRoomId = currentRoomId;
    }

    public boolean isLoginCurrentRoom() {
        return isLoginCurrentRoom;
    }

    public void setLoginCurrentRoom(boolean loginCurrentRoom) {
        isLoginCurrentRoom = loginCurrentRoom;
    }

    public String getMultiRoomId() {
        if (multiRoomId == null) {
            return "";
        }
        return multiRoomId;
    }

    public void setMultiRoomId(String multiRoomId) {
        this.multiRoomId = multiRoomId;
    }

    public boolean isLoginMultiRoom() {
        return isLoginMultiRoom;
    }

    public void setLoginMultiRoom(boolean loginMultiRoom) {
        isLoginMultiRoom = loginMultiRoom;
    }

    public String getCurrentStreamId() {
        return currentStreamId;
    }

    public void setCurrentStreamId(String currentStreamId) {
        this.currentStreamId = currentStreamId;
    }

    public String getMultiStreamId() {
        return multiStreamId;
    }

    public void setMultiStreamId(String multiStreamId) {
        this.multiStreamId = multiStreamId;
    }

    public boolean isCaptureStatus() {
        return isCaptureStatus;
    }

    public void setCaptureStatus(boolean captureStatus) {
        isCaptureStatus = captureStatus;
    }

    public boolean isPushing() {
        return isPushing;
    }

    public void setPushing(boolean pushing) {
        isPushing = pushing;
    }

    public boolean isPlaying() {
        return isPlaying;
    }

    public void setPlaying(boolean playing) {
        isPlaying = playing;
    }

    public boolean isExpressEngineCanUse() {
        return isExpressEngineCanUse;
    }

    public void setExpressEngineCanUse(boolean expressEngineCanUse) {
        isExpressEngineCanUse = expressEngineCanUse;
    }

    public int getOnlineNumber() {
        // 在线人数至少有一个人,就是自己
        if (onlineNumber<=1) {
            return 1;
        }
        return onlineNumber;
    }

    public void setOnlineNumber(int onlineNumber) {
        // 在线人数至少有一个人,就是自己
        if (onlineNumber <= 1) {
            this.onlineNumber = 1;
        } else {
            this.onlineNumber = onlineNumber;
        }
    }

    @Override
    public String toString() {
        return "LiveStatusModel{" +
                "currentRoomId='" + currentRoomId + '\'' +
                ", isLoginCurrentRoom=" + isLoginCurrentRoom +
                ", multiRoomId='" + multiRoomId + '\'' +
                ", isLoginMultiRoom=" + isLoginMultiRoom +
                ", currentStreamId='" + currentStreamId + '\'' +
                ", multiStreamId='" + multiStreamId + '\'' +
                ", isCaptureStatus=" + isCaptureStatus +
                ", isPushing=" + isPushing +
                ", isPlaying=" + isPlaying +
                ", isExpressEngineCanUse=" + isExpressEngineCanUse +
                ", onlineNumber=" + onlineNumber +
                '}';
    }
}
