public static extern int fnRegisterDiskSpaceExceededCallback(DISKFILLEDCALLBACK pFnCallBack);
public static extern int fnRegisterDiskSpaceExceededCallback(DISKFILLEDCALLBACK pFnCallBack);
private void cpUpdateProgress() { byte[] timeInfo = new byte[3]; uint currPlayedBytes = 0; int currPlayedStatus = 0; lock (this.cpLockUpdate) { this.cpCtrl.UnregisterCallbacks(this.cpCtrl.CAPTURE); this.elapsedT[0] = 0; this.elapsedT[1] = 0; this.elapsedT[2] = 0; this.currPlayedBytes = 0; this.currPlayedStatus = 1; } PROGRESSCALLBACK pFnCallBack = new PROGRESSCALLBACK(this.cpDisplayProgress); fnRegisterProgressCallback(pFnCallBack, this.cpCtrl.CAPTURE); DISKFILLEDCALLBACK diskfilledcallback = new DISKFILLEDCALLBACK(this.cpDiskFilled); fnRegisterDiskSpaceExceededCallback(diskfilledcallback); ERRORCALLBACK pFnErrorCallBack = new ERRORCALLBACK(this.cpErrorLog); fnRegisterErrorCallback(pFnErrorCallBack); ERRORCALLBACK pFnExacqErrorCallBack = new ERRORCALLBACK(this.cpExacqErrorLog); fnRegisterExacqErrorCallback(pFnExacqErrorCallBack); GCHandle handle = GCHandle.Alloc(pFnCallBack); GCHandle handle2 = GCHandle.Alloc(diskfilledcallback); GCHandle handle3 = GCHandle.Alloc(pFnErrorCallBack); GCHandle handle4 = GCHandle.Alloc(pFnExacqErrorCallBack); while (true) { lock (this.cpLockUpdate) { timeInfo[0] = this.elapsedT[0]; timeInfo[1] = this.elapsedT[1]; timeInfo[2] = this.elapsedT[2]; currPlayedBytes = this.currPlayedBytes; currPlayedStatus = this.currPlayedStatus; } string text = string.Format("{0}:{1}:{2}", Convert.ToString(timeInfo[0]), Convert.ToString(timeInfo[1]), Convert.ToString(timeInfo[2])); this.cpGuiCtrl.SetLabelText(this.cpElapsedTimeVal, text); this.cpGuiCtrl.SetLabelText(this.cpCaptureBytesVal, Convert.ToString(currPlayedBytes)); if ((this.cpCtrl.TotalFileTime != 0) && (this.cpCtrl.GetTotalTimeInSec(timeInfo) > this.cpCtrl.TotalFileTime)) { this.cpCtrl.Stop(this.cpCtrl.CAPTURE); currPlayedStatus = 5; } if ((this.cpCtrl.TotalPlaySize != 0) && (currPlayedBytes >= this.cpCtrl.TotalPlaySize)) { this.cpCtrl.Stop(this.cpCtrl.CAPTURE); currPlayedStatus = 5; } if ((currPlayedStatus == 5) | (currPlayedStatus == 3)) { this.cpReInitWindow(); this.cpCtrl.TotalPlaySize = 0; this.cpCtrl.TotalFileTime = 0; this.cpCtrl.IsFinished = true; break; } this.cpGuiCtrl.SetButtonState(this.cpStartBut, false); this.cpCtrl.IsFinished = false; Thread.Sleep(500); } handle.Free(); handle2.Free(); handle3.Free(); handle4.Free(); new Thread(new ThreadStart(this.cpDoneEvent.SiRFLiveEventSet)).Start(); }
private void cpUpdateProgress() { byte[] timeInfo = new byte[3]; uint currPlayedBytes = 0; int currPlayedStatus = 0; lock (this.cpLockUpdate) { this.cpCtrl.UnregisterCallbacks(this.cpCtrl.CAPTURE); this.elapsedT[0] = 0; this.elapsedT[1] = 0; this.elapsedT[2] = 0; this.currPlayedBytes = 0; this.currPlayedStatus = 1; } PROGRESSCALLBACK pFnCallBack = new PROGRESSCALLBACK(this.cpDisplayProgress); fnRegisterProgressCallback(pFnCallBack, this.cpCtrl.CAPTURE); DISKFILLEDCALLBACK diskfilledcallback = new DISKFILLEDCALLBACK(this.cpDiskFilled); fnRegisterDiskSpaceExceededCallback(diskfilledcallback); ERRORCALLBACK pFnErrorCallBack = new ERRORCALLBACK(this.cpErrorLog); fnRegisterErrorCallback(pFnErrorCallBack); ERRORCALLBACK pFnExacqErrorCallBack = new ERRORCALLBACK(this.cpExacqErrorLog); fnRegisterExacqErrorCallback(pFnExacqErrorCallBack); GCHandle handle = GCHandle.Alloc(pFnCallBack); GCHandle handle2 = GCHandle.Alloc(diskfilledcallback); GCHandle handle3 = GCHandle.Alloc(pFnErrorCallBack); GCHandle handle4 = GCHandle.Alloc(pFnExacqErrorCallBack); while (true) { lock (this.cpLockUpdate) { timeInfo[0] = this.elapsedT[0]; timeInfo[1] = this.elapsedT[1]; timeInfo[2] = this.elapsedT[2]; currPlayedBytes = this.currPlayedBytes; currPlayedStatus = this.currPlayedStatus; } string text = string.Format("{0}:{1}:{2}", Convert.ToString(timeInfo[0]), Convert.ToString(timeInfo[1]), Convert.ToString(timeInfo[2])); this.cpGuiCtrl.SetLabelText(this.cpElapsedTimeVal, text); this.cpGuiCtrl.SetLabelText(this.cpCaptureBytesVal, Convert.ToString(currPlayedBytes)); if ((this.cpCtrl.TotalFileTime != 0) && (this.cpCtrl.GetTotalTimeInSec(timeInfo) > this.cpCtrl.TotalFileTime)) { this.cpCtrl.Stop(this.cpCtrl.CAPTURE); currPlayedStatus = 5; } if ((this.cpCtrl.TotalPlaySize != 0) && (currPlayedBytes >= this.cpCtrl.TotalPlaySize)) { this.cpCtrl.Stop(this.cpCtrl.CAPTURE); currPlayedStatus = 5; } if ((currPlayedStatus == 5) | (currPlayedStatus == 3)) { this.cpReInitWindow(); this.cpCtrl.TotalPlaySize = 0; this.cpCtrl.TotalFileTime = 0; this.cpCtrl.IsFinished = true; break; } this.cpGuiCtrl.SetButtonState(this.cpStartBut, false); this.cpCtrl.IsFinished = false; Thread.Sleep(500); } handle.Free(); handle2.Free(); handle3.Free(); handle4.Free(); new Thread(new ThreadStart(this.cpDoneEvent.SiRFLiveEventSet)).Start(); }