sample03.hsp

sample\hspycp\03_複数台仮想キャプチャデバイスを用意する\sample03.hsp » Plain Format

#include "hspycp.as"

	repeat 4
		ycp_Open "HSPDSC_CaptureSource"+cnt+"_Data", "HSPDSC_CaptureSource"+cnt+"_Write", "HSPDSC_CaptureSource"+cnt+"_Read"
		devId(cnt) = stat
	loop

	fps = 30

	avgTimePF = 1000 / fps	// fps
	font "メイリオ", 64, 16
	mref vram, 66
	repeat

		t = cnt
		
		repeat 4

			// 描画したい内容
			redraw 0
			pos 0, 0 : color
			boxf : color rnd(255), rnd(255), rnd(255)
			mes t
			mes "ID = " + devId(cnt)
			redraw 1
			
			ycp_Send devId(cnt), t, fps, 640, 480, vram
			if stat < 0{
				dialog "エラーが発生しました ID = " + devId(cnt)
				break
			}else : if 0 == stat{
				title "正常動作中"
			}else{
				title "待機中..."
			}
		loop
		
		await avgTimePF
		
	loop

	repeat 4
		ycp_Close devId(cnt)
	loop