Пример #1
0
void v_memzero(void* destp, size_t len)
{
    register int32 dest = (int)destp;

    /* If it's worth using altivec code */
    if( len >= 2*sizeof_vector ) { /* 32 byte */
        int i,xlen;
        vint32* destv;
	
	/* first, write things to word boundary. */
	if(( xlen = (int)dest % sizeof_vector ) != 0) {
	    libc_memset(destp,0,xlen);
	    len  -= xlen;
	    dest += xlen;
	}

	/* this is the maion loop. */
	destv = (vint32*) dest;
	for( i = 0; i < len / sizeof_vector; i++ ) {
  	    destv[i] = vzero;
	}
	dest += i * sizeof_vector;
	len %= sizeof_vector;
    }

    /* write remaining few bytes. */
    libc_memset((void*)dest,0,len);
}
Пример #2
0
static app_result_e mengine_play_switch(void *msg_ptr, switch_mode_e switch_mode)
{
    bool bret;
    play_mode_e play_mode;//保存是否正在播放
    switch_result_e switch_ret;//切换是否成功
 
    if (g_eg_status_p->play_status == PlaySta)//正在播放
    {
        play_mode = PLAY_NORMAL;//正在播放标志
    }
    else
    {
        play_mode = PLAY_NO_PLAY;//未在播放
        //清除断点
        libc_memset(&(g_eg_cfg_p->bk_infor), 0, sizeof(mmm_mp_bp_info_t));
    }

    switch_ret = mengine_file_switch(STOP_NORMAL, switch_mode, play_mode);

    if (switch_ret == SWITCH_NO_ERR)
    {
        bret = TRUE;
    }
    else
    {
        bret = FALSE;
    }

    mengine_reply_msg(msg_ptr, bret);

    return RESULT_IGNORE;

}
Пример #3
0
app_result_e mengine_musui_delete_file(void* msg_ptr)
{
    bool is_playing;
    bool ret_vals;
    //bool switch_ret;

    plist_location_t* cur_locat_ptr = (plist_location_t*) &(g_eg_cfg_p->location.plist_location);

    //当前播放状态
    if (g_eg_status_p->play_status == PlaySta)
    {
        is_playing = TRUE;
    }
    else
    {
        is_playing = FALSE;
    }
    ret_vals = _stop(STOP_NORMAL);//停止播放
    if (ret_vals == FALSE)
    {
        goto msg_end;
    }

    cur_locat_ptr->file_num--;

    cur_locat_ptr->file_total--;

    //设置删除当前文件标识
    g_del_curfile = 1;

    if (g_change_path_flag == 1)
    {
        ret_vals = change_locat_deal();
    }

    //清除断点
    libc_memset(&(g_eg_cfg_p->bk_infor), 0, sizeof(mmm_mp_bp_info_t));

    msg_end:
    //返回成功
    mengine_reply_msg(msg_ptr, ret_vals);

    return RESULT_IGNORE;
}
Пример #4
0
app_result_e mengine_other_delete_file(void* msg_ptr)
{
    bool ret_vals;

    //消息指针
    private_msg_t* data_ptr = (private_msg_t*) msg_ptr;

    //要删除的文件信息指针
    file_path_info_t* del_file_path = (file_path_info_t *) (data_ptr->msg.content.addr);

    //当前正在播放的文件指针
    file_location_t* cur_locat_ptr = (file_location_t*) &(g_eg_cfg_p->location.dirlocation);

    uint32 del_clustno = del_file_path->file_path.dirlocation.cluster_no;//删除文件的目录项所在的簇号

    uint32 del_direntry = del_file_path->file_path.dirlocation.dir_entry;//删除文件的目录项在所在簇号内的偏移

    //判断是否是删除当前文件,如果是则停止播放
    if ((del_clustno == cur_locat_ptr->cluster_no) && (del_direntry == cur_locat_ptr->dir_entry))
    {
        ret_vals = _stop(STOP_NORMAL);//停止播放

        cur_locat_ptr->file_num--;

        cur_locat_ptr->file_total--;

        //设置删除当前文件标识
        g_del_curfile = 1;

        if (g_change_path_flag == 1)
        {
            ret_vals = change_locat_deal();
        }

        //清除断点
        libc_memset(&(g_eg_cfg_p->bk_infor), 0, sizeof(mmm_mp_bp_info_t));
    }
    //返回成功
    mengine_reply_msg(msg_ptr, TRUE);

    return RESULT_IGNORE;
}
Пример #5
0
app_result_e mengine_play_prev(void* msg_ptr)
{
    play_status_e play_status = g_eg_status_p->play_status;

    //大于5s重头开始播歌,不向前切歌
    if (g_eg_playinfo_p->cur_time > 5000)
    {
        g_eg_playinfo_p->cur_time = 0;
        
        //清除断点
        libc_memset(&(g_eg_cfg_p->bk_infor), 0, sizeof(mmm_mp_bp_info_t));
        
        _stop(STOP_NORMAL);//停止播放
        
        if (play_status == PlaySta)
        {
            _set_file();
            _play(PLAY_NORMAL);//播放 
        }
        mengine_reply_msg(msg_ptr, TRUE);
        return RESULT_IGNORE;
    }
    return mengine_play_switch(msg_ptr, FORCE_SWITCH_PREV);
}