private void opendev_Click(object sender, EventArgs e) { if (BriSDKLib.QNV_OpenDevice(BriSDKLib.ODT_LBRIDGE, 0, "") <= 0 || BriSDKLib.QNV_DevInfo(0, BriSDKLib.QNV_DEVINFO_GETCHANNELS) <= 0) { AppendStatus("打开设备失败"); MessageBox.Show("打开设备失败"); return; } selchannel.Items.Clear(); spkamvalue.Items.Clear(); micamvalue.Items.Clear(); for (Int16 i = 0; i < BriSDKLib.QNV_DevInfo(-1, BriSDKLib.QNV_DEVINFO_GETCHANNELS); i++) {//在windowproc处理接收到的消息 BriSDKLib.QNV_Event(i, BriSDKLib.QNV_EVENT_REGWND, (Int32)this.Handle, "", new StringBuilder(0), 0); selchannel.Items.Add(i + 1); } selchannel.SelectedIndex = 0; for (int i = 0; i < 16; i++) { spkamvalue.Items.Add(i); } spkamvalue.SelectedIndex = 0; for (int i = 0; i < 7; i++) { micamvalue.Items.Add(i); } micamvalue.SelectedIndex = 0; AppendStatus("打开设备成功"); return; }
private void opendevice_Click(object sender, EventArgs e) { if (BriSDKLib.QNV_OpenDevice(BriSDKLib.ODT_LBRIDGE, 0, "") <= 0 || BriSDKLib.QNV_DevInfo(0, BriSDKLib.QNV_DEVINFO_GETCHANNELS) <= 0) { AppendStatus("打开设备失败"); MessageBox.Show("打开设备失败"); return; } for (Int16 i = 0; i < BriSDKLib.QNV_DevInfo(-1, BriSDKLib.QNV_DEVINFO_GETCHANNELS); i++) {//在windowproc处理接收到的消息 BriSDKLib.QNV_Event(i, BriSDKLib.QNV_EVENT_REGWND, (Int32)this.Handle, "", new StringBuilder(0), 0); } //打开CC模块 if (BriSDKLib.QNV_OpenDevice(BriSDKLib.ODT_CC, 0, BriSDKLib.QNV_CC_LICENSE) <= 0)//加载CC模块 { AppendStatus("加载CC模块失败"); MessageBox.Show("加载CC模块失败"); return; } else { //注册本窗口接收CC模块的事件 //在windowproc处理接收到的消息 BriSDKLib.QNV_Event(BriSDKLib.CCCTRL_CHANNELID, BriSDKLib.QNV_EVENT_REGWND, (Int32)this.Handle, "", new StringBuilder(0), 0); AppendStatus("加载CC模块完成"); } AppendStatus("打开设备成功"); return; }
/// <summary> /// 打开设备 /// </summary> public static int OpenDevice() { return(BriSDKLib.QNV_OpenDevice(BriSDKLib.ODT_LBRIDGE, 0, "0")); }