示例#1
0
extern "C" __declspec(dllexport) void sikou_ini( int* c ){
/**************************************************************
初期化 (cは中断フラグへのポインタ)
**************************************************************/
	while( bWindowCreated == FALSE ){
		Sleep( 10 );
	}

	chudan_flag = c;
	Hash::SetSize( HashSize::MBytesToPow2( hash_mbytes, thread_num ) );
	if( pshogi == NULL )
		pshogi = new ShogiEval();
	if( pthink == NULL )
		pthink = new Match();
	if( pbook == NULL )
		pbook = new Book();
	if( presign == NULL )
		presign = new ResignController();
	SetPlayMode( FALSE );
	pthink->SetNumberOfThreads( thread_num );
	presign->set_limit( resign_value );
#if USE_QUICKCOPY
	pthink->PresetTrees( pshogi );
#endif
}
示例#2
0
void XDlgBarTimeline::OnCbnSelchangeCombo1()
{
	// TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다.
	auto spAction = SPROBJ->GetspAction();
	if( !spAction ) return;
	spAction->SetPlayMode( (xRPT_TYPE)m_comboPlayMode.GetCurSel() );
	SPROBJ->SetPlayType( spAction->GetPlayMode() );

}
示例#3
0
文件: mp3.cpp 项目: trdenton/bongr
bool Mp3Player::init()
{

	begin(9600);
//	delay(100);
	if (SetPlayMode(PLAYMODE_SINGLE)!=true)
	{

		return false;

	}
	delay(10);
//	return PauseResume();
	return true;

}
示例#4
0
bool cDvbDevice::SetPid(cPidHandle *Handle, int Type, bool On)
{
  if (Handle->pid) {
     dmx_pes_filter_params pesFilterParams;
     memset(&pesFilterParams, 0, sizeof(pesFilterParams));
     if (On) {
        if (Handle->handle < 0) {
           Handle->handle = DvbOpen(DEV_DVB_DEMUX, CardIndex(), O_RDWR | O_NONBLOCK, true);
           if (Handle->handle < 0) {
              LOG_ERROR;
              return false;
              }
           }
        pesFilterParams.pid     = Handle->pid;
        pesFilterParams.input   = DMX_IN_FRONTEND;
        pesFilterParams.output  = (Type <= ptTeletext && Handle->used <= 1) ? DMX_OUT_DECODER : DMX_OUT_TS_TAP;
        pesFilterParams.pes_type= PesTypes[Type < ptOther ? Type : ptOther];
        pesFilterParams.flags   = DMX_IMMEDIATE_START;
        if (ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams) < 0) {
           LOG_ERROR;
           return false;
           }
        }
     else if (!Handle->used) {
        CHECK(ioctl(Handle->handle, DMX_STOP));
        if (Type <= ptTeletext) {
           pesFilterParams.pid     = 0x1FFF;
           pesFilterParams.input   = DMX_IN_FRONTEND;
           pesFilterParams.output  = DMX_OUT_DECODER;
           pesFilterParams.pes_type= PesTypes[Type];
           pesFilterParams.flags   = DMX_IMMEDIATE_START;
           CHECK(ioctl(Handle->handle, DMX_SET_PES_FILTER, &pesFilterParams));
           if (PesTypes[Type] == DMX_PES_VIDEO) // let's only do this once
              SetPlayMode(pmNone); // necessary to switch a PID from DMX_PES_VIDEO/AUDIO to DMX_PES_OTHER
           }
        close(Handle->handle);
        Handle->handle = -1;
        }
     }
  return true;
}
示例#5
0
extern "C" __declspec(dllexport) void sikou_end(){
/**************************************************************
終了
**************************************************************/
	chudan_flag = NULL;

	// 思考の終了を待つ
	chudan = 1;
	chudanDfPn = 1;
	while( sikou_flag ){
		dispatch();
		Sleep( 10 );
	}

	// 相手番思考スレッドの終了を待つ。
	if( g_hPonder != INVALID_HANDLE_VALUE ){
		chudanPonder = 1;
		WaitForSingleObject( g_hPonder, INFINITE );
		CloseHandle( g_hPonder );
		g_hPonder = INVALID_HANDLE_VALUE;
	}

	SetPlayMode( TRUE );
}