Exemplo n.º 1
0
void CVideoPane::OnClose()
{
	// TODO: Add your message handler code here and/or call default
	
	if (NULL != m_pCeLTE_PlayerCtrl)
	{
		// 停止播放视频
		m_pCeLTE_PlayerCtrl->PostMessage(WM_ELTE_VIDEO_EXIT, 0, NULL);

		// 播放器窗体隐藏事件
		m_pCeLTE_PlayerCtrl->PostMessage(WM_ELTE_POST_PLAYER_EVENT, (WPARAM)eLTE_PLAYER_HIDE, NULL);
	}

	// 禁用工具栏按钮
	EnableAudio(FALSE);
	EnableImageButton(FALSE);

	// 隐藏播放窗口
	ShowWindow(SW_HIDE);

	m_bEnableAudio = FALSE;
	m_bHaveSound = FALSE;

	//CDialog::OnClose();
}
Exemplo n.º 2
0
void MPEG::Init(SDL_RWops *mpeg_source, int mpeg_freesrc, bool SDLaudio)
{
    source = mpeg_source;
    freesrc = mpeg_freesrc;
    sdlaudio = SDLaudio;

    /* Create the system that will parse the MPEG stream */
    system = new MPEGsystem(source);

    /* Initialize everything to invalid values for cleanup */
    error = NULL;

    audiostream = videostream = NULL;
    audioaction = NULL;
    videoaction = NULL;
    audio = NULL;
    video = NULL;
    audioaction_enabled = SDLaudio;
    videoaction_enabled = false;
    loop = false;
    pause = false;

    parse_stream_list();

    EnableAudio(audioaction_enabled);
    EnableVideo(videoaction_enabled);

    if ( ! audiostream && ! videostream ) {
      SetError("No audio/video stream found in MPEG");
    }

    if ( system && system->WasError() ) {
      SetError(system->TheError());
    }

    if ( audio && audio->WasError() ) {
      SetError(audio->TheError());
    }

    if ( video && video->WasError() ) {
      SetError(video->TheError());
    }

    if ( WasError() ) {
      SetError(TheError());
    }
}