/**************************************************************************
 * Copyright (C) 2012-2021  Unisound
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 **************************************************************************
 *
 * Description : lvp_voice_player.h
 * Author      : yzs.unisound.com
 * Date        : 2021.03.01
 *
 **************************************************************************/
#ifndef __LVP_VOICE_PLAYER__
#define __LVP_VOICE_PLAYER__

typedef enum {
    PLAYER_STATUS_PREPARE = 0,
    PLAYER_STATUS_PLAY,
    PLAYER_STATUS_NEXT,
    PLAYER_STATUS_PAUSE,
    PLAYER_STATUS_STOP,
} PLAYER_STATUS;

typedef enum {
    EVENT_PLAYER_FINISH,      //播放结束
    EVENT_PLAYER_LAST_FRAME,  //播放至最后一帧
    EVENT_PLAYER_COUNT
} PLAYER_EVENT;

typedef void (*LvpVoicePlayerEventCallback)(int player_event_id, void *data);

int LvpVoicePlayerMute(void);
int LvpVoicePlayerUnmute(void);
int LvpVoicePlayerSetVolume(int volume);
int LvpVoicePlayerGetVolume(void);
//int LvpvoicePlayerPause(void);
//int LvpVoicePlayerResume(void);
int LvpVoicePlayerStop(void);
int LvpVoicePlayerInit(LvpVoicePlayerEventCallback cb);
int LvpVoicePlayerGetStatus(void);
int LvpVoicePlayerPlay(const unsigned char *resource_position);
int LvpVoicePlayerPlayPcm(const unsigned char *resource_position, int len, int sample_rate, int channels, int interlace);
int LvpVoicePlayerSetUserPcmBuffer(unsigned char *resource_position, int len);
void LvpVoicePlayerClearUserPcmBuffer(void);

int LvpVoicePlayerTask(void *arg);

int LvpVoicePlayerSuspend(void);
int LvpVoicePlayerResume(void);
 
#endif
