⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dsform.cpp

📁 海康威视视频采集卡linux开发包4.22版
💻 CPP
📖 第 1 页 / 共 5 页
字号:
		if(!strcmp(str, "SliderLogoPosXL"))			w_full_area -> LogoPosXAllSet(value);		else if(!strcmp(str, "SliderLogoPosYL"))			w_full_area -> LogoPosYAllSet(value);	}	else if(index >= 2)	{		if(!strcmp(str, "SliderLogoPosXL"))			w_full_area -> LogoPosXSet(value);		else if(!strcmp(str, "SliderLogoPosYL"))			w_full_area -> LogoPosYSet(value);		}	}void dsForm::dsLogoTransSet(bool on){	int index = CBChannelL -> currentItem();	if (index == 1)	{		w_full_area -> LogoTranslucentAllSet(on);	}	else if(index >= 2)	{		w_full_area -> LogoTranslucentSet(on);	}	}void dsForm::dsLogoSet(bool on){	int index = CBChannelL -> currentItem();	if (index == 1)		w_full_area -> LogoEnabledAllSet(on);	else if(index >= 2)		w_full_area -> LogoEnabledSet(on);	CheckLogoTransL -> setEnabled(on);	SliderLogoPosXL -> setEnabled(on);	SliderLogoPosYL -> setEnabled(on);}void dsForm::dsOsdChangeSet(int value){	int index = CBChannelL -> currentItem();	QSlider* Qtemp = (QSlider*)(this->sender());	const char *str = Qtemp->name();	if (index == 1)	{		if(!strcmp(str, "SliderOsdBrightnessL"))			w_full_area -> OsdBrightnessAllSet(value);		else if(!strcmp(str, "SliderOsdPosXL"))			w_full_area -> OsdPosXAllSet(value);		else if(!strcmp(str, "SliderOsdPosYL"))			w_full_area -> OsdPosYAllSet(value);	}	else if(index >= 2)	{		if(!strcmp(str, "SliderOsdBrightnessL"))			w_full_area -> OsdBrightnessSet(value);		else if(!strcmp(str, "SliderOsdPosXL"))			w_full_area -> OsdPosXSet(value);		else if(!strcmp(str, "SliderOsdPosYL"))			w_full_area -> OsdPosYSet(value);		}}void dsForm::dsOsdTransSet(bool on){	int index = CBChannelL -> currentItem();	if (index == 1)	{		//DSDEMO *dstemp = w_full_area -> GetDsinfo(0);		w_full_area -> OsdTranslucentAllSet(on);	}	else if(index >= 2)	{		w_full_area -> OsdTranslucentSet(on);	}	}void dsForm::dsOsdSet(bool on){	int index = CBChannelL -> currentItem();	if (index == 1)	{		//DSDEMO *dstemp = w_full_area -> GetDsinfo(0);		w_full_area -> OsdEnableAllSet(on);	}	else if(index >= 2)	{		w_full_area -> OsdEnableSet(on);	}}void dsForm::dsRestoreSet(){	int index = CBChannelL -> currentItem();	video_info *tempvideo;	if(index == 1)	{		w_full_area -> VideoRestoreAllSet();		tempvideo = w_full_area -> GetVideoDefault(0);				SliderBrightnessL -> setValue(tempvideo->Brightness);		SliderContrastL -> setValue(tempvideo->Contrast);		SliderSaturationL -> setValue(tempvideo->Saturation);		SliderHueL -> setValue(tempvideo->Hue);	}	else if (index >= 2)	{		w_full_area -> VideoRestoreSet();		tempvideo = w_full_area -> GetVideoDefault(index - 2);				SliderBrightnessL -> setValue(tempvideo->Brightness);		SliderContrastL -> setValue(tempvideo->Contrast);		SliderSaturationL -> setValue(tempvideo->Saturation);		SliderHueL -> setValue(tempvideo->Hue);			}}void dsForm::dsVideoSet(int value){	int index = CBChannelL -> currentItem();		QSlider* Qtemp = (QSlider*)(this->sender());	const char *str = Qtemp->name();	if (index == 1)	{		if(!strcmp(str, "SliderBrightnessL"))			w_full_area -> BrightnessAllSet(value);		else if(!strcmp(str, "SliderContrastL"))			w_full_area -> ContrastAllSet(value);		else if(!strcmp(str, "SliderSaturationL"))			w_full_area -> SaturationAllSet(value);		else if(!strcmp(str, "SliderHueL"))			w_full_area -> HueAllSet(value);	}	else if (index >= 2)	{		if(!strcmp(str, "SliderBrightnessL"))			w_full_area -> BrightnessSet(value);		else if(!strcmp(str, "SliderContrastL"))			w_full_area -> ContrastSet(value);		else if(!strcmp(str, "SliderSaturationL"))			w_full_area -> SaturationSet(value);		else if(!strcmp(str, "SliderHueL"))			w_full_area -> HueSet(value);	}}void dsForm::dsFrameinfo(){	bool ok;	int Qstemp;		QLineEdit* Qtemp = (QLineEdit*)(this->sender());	int index = CBChannelL -> currentItem();			const char *str = Qtemp->name();		if (index == 1)	{		DSDEMO *temp = w_full_area -> GetDsinfo(0);		QString Qs;				if (!strcmp(str, "EditIQuantL"))		{			Qstemp = (EditIQuantL -> text()).toInt(&ok, 10);						if ( (!ok) || Qstemp < 12 || Qstemp > 30 )			{				EditIQuantL->setText(Qs.sprintf("%9d", (temp->frameinfo).IQuantVal));			}			else 				w_full_area -> IQuantAllSet(Qstemp);		}		else if (!strcmp(str, "EditBQuantL"))		{			Qstemp = (EditBQuantL -> text()).toInt(&ok, 10);			if ( (!ok) || Qstemp < 12 || Qstemp > 30 )			{				EditBQuantL->setText(Qs.sprintf("%9d", (temp->frameinfo).BQuantVal));			}			else 			w_full_area -> BQuantAllSet(Qstemp);		}		else if (!strcmp(str, "EditPQuantL"))		{			Qstemp = (EditPQuantL -> text()).toInt(&ok, 10);			if ( (!ok) || Qstemp < 12 || Qstemp > 30 )			{				EditPQuantL->setText(Qs.sprintf("%9d", (temp->frameinfo).PQuantVal));			}			else 				w_full_area -> PQuantAllSet(Qstemp);		}		else if (!strcmp(str, "EditKeyFrameL"))		{			Qstemp = (EditKeyFrameL -> text()).toInt(&ok, 10);			if ( (!ok) || Qstemp < 12 )			{				EditKeyFrameL->setText(Qs.sprintf("%9d", (temp->frameinfo).KeyFrameIntervals));			}			else 				w_full_area -> KeyFrameIAllSet(Qstemp);		}		else if (!strcmp(str, "EditBFramesL"))		{				Qstemp = (EditBFramesL -> text()).toInt(&ok, 10);			if ( (!ok) || Qstemp < 0 || Qstemp > 2 )			{				EditBFramesL->setText(Qs.sprintf("%9d", (temp->frameinfo).BFrames));			}			else 				w_full_area -> BFramesAllSet(Qstemp);		}				else if (!strcmp(str, "EditFramesRL"))		{			Qstemp = (EditFramesRL -> text()).toInt(&ok, 10);			if ( (!ok) || Qstemp < 1 || Qstemp > 30 )			{				EditFramesRL->setText(Qs.sprintf("%9d", (temp->frameinfo).FrameRate));			}			else 				w_full_area -> FrameRateAllSet(Qstemp);		}	}	else if (index >= 2)	{		DSDEMO *temp = w_full_area -> GetDsinfo(index - 2);		QString Qs;				if (!strcmp(str, "EditIQuantL"))		{			Qstemp = (EditIQuantL -> text()).toInt(&ok, 10);						if ( (!ok) || Qstemp < 12 || Qstemp > 30 )			{				EditIQuantL->setText(Qs.sprintf("%9d", (temp->frameinfo).IQuantVal));			}			else 				w_full_area -> IQuantSet(Qstemp);		}		else if (!strcmp(str, "EditBQuantL"))		{			Qstemp = (EditBQuantL -> text()).toInt(&ok, 10);			if ( (!ok) || Qstemp < 12 || Qstemp > 30 )			{				EditBQuantL->setText(Qs.sprintf("%9d", (temp->frameinfo).BQuantVal));			}			else 			w_full_area -> BQuantSet(Qstemp);		}		else if (!strcmp(str, "EditPQuantL"))		{			Qstemp = (EditPQuantL -> text()).toInt(&ok, 10);			if ( (!ok) || Qstemp < 12 || Qstemp > 30 )			{				EditPQuantL->setText(Qs.sprintf("%9d", (temp->frameinfo).PQuantVal));			}			else 				w_full_area -> PQuantSet(Qstemp);		}		else if (!strcmp(str, "EditKeyFrameL"))		{			Qstemp = (EditKeyFrameL -> text()).toInt(&ok, 10);			if ( (!ok) || Qstemp < 12 )			{				EditKeyFrameL->setText(Qs.sprintf("%9d", (temp->frameinfo).KeyFrameIntervals));			}			else 				w_full_area -> KeyFrameISet(Qstemp);		}		else if (!strcmp(str, "EditBFramesL"))		{				Qstemp = (EditBFramesL -> text()).toInt(&ok, 10);			if ( (!ok) || Qstemp < 0 || Qstemp > 2 )			{				EditBFramesL->setText(Qs.sprintf("%9d", (temp->frameinfo).BFrames));			}			else 				w_full_area -> BFramesSet(Qstemp);		}				else if (!strcmp(str, "EditFramesRL"))		{			Qstemp = (EditFramesRL -> text()).toInt(&ok, 10);			if ( (!ok) || Qstemp < 1 || Qstemp > 30 )			{				EditFramesRL->setText(Qs.sprintf("%9d", (temp->frameinfo).FrameRate));			}			else 				w_full_area -> FrameRateSet(Qstemp);		}	}}/* tyu add at 2007.02.08 */	void dsForm::dsMajorStream(int index){	int ChannelNum = CBChannelL -> currentItem();	if (ChannelNum == 1)	   w_full_area -> StreamTypeAllSet(index + 1);	else if(ChannelNum >= 2)	   w_full_area -> StreamTypeSet(index + 1);	}void dsForm::dsMinorStream(int index){	int ChannelNum = CBChannelL -> currentItem();	if (ChannelNum == 1)	   w_full_area -> StreamTypeSubAllSet(index + 1);	else if(ChannelNum >= 2)	   w_full_area -> StreamTypeSubSet(index + 1);	}void dsForm::dsMajorEncoder(int index){	int ChannelNum = CBChannelL -> currentItem();	PictureFormat_t pictureFormat = ENC_CIF_FORMAT;	if (index == 0)	 pictureFormat = ENC_4CIF_FORMAT;	else if (index == 1) pictureFormat = ENC_2CIF_FORMAT;	else if (index == 2) pictureFormat = ENC_DCIF_FORMAT;	else if (index == 3) pictureFormat = ENC_CIF_FORMAT;	else if (index == 4) pictureFormat = ENC_QCIF_FORMAT;	if (ChannelNum == 1)	   w_full_area -> EncoderAllSet(pictureFormat);	else if(ChannelNum >= 2)	   w_full_area -> EncoderSet(pictureFormat);}void dsForm::dsMinorEncoder(int index){	int ChannelNum = CBChannelL -> currentItem();	PictureFormat_t pictureFormat = ENC_CIF_FORMAT;	if (index == 0)	 pictureFormat = ENC_4CIF_FORMAT;	else if (index == 1) pictureFormat = ENC_2CIF_FORMAT;	else if (index == 2) pictureFormat = ENC_DCIF_FORMAT;	else if (index == 3) pictureFormat = ENC_CIF_FORMAT;	else if (index == 4) pictureFormat = ENC_QCIF_FORMAT;	if (ChannelNum == 1)	   w_full_area -> EncoderSubAllSet(pictureFormat);	else if(ChannelNum >= 2)	   w_full_area -> EncoderSubSet(pictureFormat);}#if 0void dsForm::dsDCodingSet(bool on){	if( on )	{		CheckMinorRecordL->setEnabled(TRUE);		//CBMajorStreamL->setEnabled(TRUE);		//CBMinorStreamL->setEnabled(TRUE);		CBMinorEncoderL->setEnabled(TRUE);		CBMinorEncoderL->setCurrentItem(3);	}	else	{		CheckMinorRecordL->setEnabled(FALSE);		CBMinorEncoderL->setCurrentItem(3);		CBMinorEncoderL->setEnabled(FALSE);	}}#endifvoid dsForm::dsBpsModeSet(int index){	int ChannelNum = CBChannelL -> currentItem();	if (ChannelNum == 1)	   w_full_area -> BitRateAllSet(atoi(EditMaxBpsL -> text()), BitrateControlType_t(index));	else if(ChannelNum >= 2)		w_full_area -> BitRateSet(atoi(EditMaxBpsL -> text()), BitrateControlType_t(index));}void dsForm::dsMaxBpsSet(){		bool ok;	QString Qs;	int Qstemp;		int index = CBChannelL -> currentItem();		Qstemp = (EditMaxBpsL -> text()).toInt(&ok, 10);	if (index == 1)	{		DSDEMO *temp = w_full_area -> GetDsinfo(0);		if ( (!ok) || Qstemp < 0 )		{			EditMaxBpsL->setText(Qs.sprintf("%9d", temp -> MaxBps));		}		else		{			w_full_area -> BitRateAllSet(Qstemp, BitrateControlType_t(CBModeL -> currentItem()));		}			}	else if(index >= 2)	{		DSDEMO *temp = w_full_area -> GetDsinfo(index - 2);		if ( (!ok) || Qstemp < 0 )		{			EditMaxBpsL->setText(Qs.sprintf("%9d", temp -> MaxBps));		}		else		{						w_full_area -> BitRateSet(Qstemp, BitrateControlType_t(CBModeL -> currentItem()));					}		}	}void dsForm::dsChannel(const QString &Qstxt){	int port = atoi(Qstxt);	DSDEMO *temp = w_full_area -> GetDsinfo(port);	if(!temp->record_flag)	{		w_audio_frame ->setText(QString("        0"));		w_totalframe->setText(QString("        0"));		w_bit_rate->setText(QString("        0"));		w_video_frame->setText(QString("        0"));			}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -