📄 dsform.cpp
字号:
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 0
/*
=======================================================================================================================
*
=======================================================================================================================
*/
void 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);
}
}
#endif
/*
=======================================================================================================================
*
=======================================================================================================================
*/
void 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"));
}
}
/*
=======================================================================================================================
*
=======================================================================================================================
*/
void dsForm::dsMinorRecordSet(bool on)
{
int ChannelNum = CBChannelL->currentItem();
int index = CBMinorEncoderL->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;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -