package com.bassmedia;

import java.nio.ByteBuffer;

public interface PlayerListener {
    public interface OnCompletionListener {
        /**
         * 当播放网络音频时，如果中间网络中断或其他异常，
         * 播放器在播放完已经缓冲完的数据后，调用onCompletion，
         * 所以请在onCompletion中判断是否网络异常/是否播放到文件末端
         *
         * @param fp
         */
        void onCompletion(BassMusicPlay fp);
    }

    public interface OnErrorListener {
        /**
         * @param fp
         * @param errorCode about the error code , you can see the strings_omeplayer.xml
         */
        void onError(BassMusicPlay fp, int errorCode);
    }

    public interface OnPreparedListener {
        /**
         * 当设置了OnPreparedListener后，无论调用prepared()或preparedAsync
         *
         * @param fp
         */
        void OnPrepared(BassMusicPlay fp);
    }

    public interface OnDownloadedListener {
        void onDownloaded(BassMusicPlay fp, ByteBuffer buffer, int length);
    }
}
