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

📄 dsform.cpp

📁 强大的QT,GTK的学习Demo.包含DSP驱动以及所使用库文件资源。
💻 CPP
📖 第 1 页 / 共 5 页
字号:
    int index = CBChannelL->currentItem();

    if(index == 1)
        w_full_area->MotionAllSet(on);
    else if(index >= 2)
    {
        w_full_area->MotionSet(on);
    }

    SliderMotionSensL->setEnabled(on);
}

/*
 =======================================================================================================================
 *
 =======================================================================================================================
 */
void dsForm::dsMaskSet(bool on)
{
    int index = CBChannelL->currentItem();

    OutputDebugString("In function dsMaskSet\n");

    if(index == 1)
        w_full_area->MaskEnableAllSet(on);
    else if(index >= 2)
        w_full_area->MaskEnableSet(on);

    if(on)
    {
        CBRectangleL->setEnabled(TRUE);
        EditBoundL->setText("");
        EditBoundL->setEnabled(FALSE);
        ButtonNewL->setEnabled(TRUE);
        ButtonDeleteL->setEnabled(FALSE);
    }
    else
    {
        CBRectangleL->setEnabled(FALSE);
        EditBoundL->setEnabled(FALSE);
        ButtonNewL->setEnabled(FALSE);
        ButtonDeleteL->setEnabled(FALSE);
    }
}

/*
 =======================================================================================================================
 *
 =======================================================================================================================
 */
void dsForm::dsNewButtonClicked()
{
    EditBoundL->setText("");
    EditBoundL->setEnabled(TRUE);
}

/*
 =======================================================================================================================
 *
 =======================================================================================================================
 */
void dsForm::dsDeleteButtonClicked()
{
    int index = CBRectangleL->currentItem();
    int Channel = CBChannelL->currentItem();

    if(Channel == 1)
        w_full_area->MaskDelAllSet(index);
    else if(Channel >= 2)
        w_full_area->MaskDelSet(index);

    CBRectangleL->removeItem(index);

    EditBoundL->setText("");
    EditBoundL->setEnabled(FALSE);

    if(CBRectangleL->count() == 0)
        ButtonDeleteL->setEnabled(FALSE);
}

/*
 =======================================================================================================================
 *
 =======================================================================================================================
 */
void dsForm::dsRectangleChange(int index)
{
    EditBoundL->setText(CBRectangleL->text(index));
    EditBoundL->setEnabled(FALSE);

    if(CBRectangleL->count() > 0)
        ButtonDeleteL->setEnabled(TRUE);
}

/*
 =======================================================================================================================
 *
 =======================================================================================================================
 */
void dsForm::dsMaskEditPress()
{
    RECT    temp;
    int     i, j;
    bool    ok;

    QString qs = (EditBoundL->text()).stripWhiteSpace();
    QString qstemp;

    if(qs.contains(',', false) != 3)
    {
        EditBoundL->setText("");
        return;
    }

    i = qs.find(',', 0, false);
    qstemp = qs.mid(0, i);
    temp.RectTop = qstemp.toInt(&ok, 10);
    if((!ok) || temp.RectTop < 0)
    {
        EditBoundL->setText("");
        return;
    }

    j = i;
    i = qs.find(',', j + 1, false);
    qstemp = qs.mid(j + 1, i - j - 1);
    temp.RectBottom = qstemp.toInt(&ok, 10);
    if((!ok) || temp.RectBottom < 0)
    {
        EditBoundL->setText("");
        return;
    }

    j = i;
    i = qs.find(',', j + 1, false);
    qstemp = qs.mid(j + 1, i - j - 1);
    temp.RectLeft = qstemp.toInt(&ok, 10);
    if((!ok) || temp.RectLeft < 0)
    {
        EditBoundL->setText("");
        return;
    }

    j = i;
    i = qs.length();
    qstemp = qs.mid(j + 1, i - j - 1);
    temp.RectRight = qstemp.toInt(&ok, 10);
    if((!ok) || temp.RectRight < 0)
    {
        EditBoundL->setText("");
        return;
    }

    if((temp.RectRight <= temp.RectLeft) || (temp.RectBottom <= temp.RectTop) ||
       (temp.RectRight > 703) || (temp.RectBottom > 575))   /* NTSC */
    {
        EditBoundL->setText("");
        return;
    }

    temp.RectRight = (temp.RectRight - temp.RectLeft) / 8 * 8 + temp.RectLeft;
    temp.RectBottom = (temp.RectBottom - temp.RectTop) / 8 * 8 + temp.RectTop;

    int indexC = CBChannelL->currentItem();
    if(indexC == 1)
    {
        w_full_area->MaskAddAllSet(&temp);
    }
    else if(indexC >= 2)
    {
        w_full_area->MaskAddSet(&temp);
    }

    CBRectangleL->insertItem(qs.sprintf("%d,%d,%d,%d", temp.RectTop, temp.RectBottom, temp.RectLeft, temp.RectRight));

    if(CBRectangleL->count() == 5)
        ButtonNewL->setEnabled(FALSE);

    EditBoundL->setText("");
    EditBoundL->setEnabled(FALSE);
}

/*
 =======================================================================================================================
 *
 =======================================================================================================================
 */
void dsForm::dsLogoChangeSet(int value)
{
    int             index = CBChannelL->currentItem();

    QSlider*        Qtemp = (QSlider *) (this->sender());
    const char*     str = Qtemp->name();

    if(index == 1)
    {
        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)
    {

⌨️ 快捷键说明

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