json_t* OBSAPIMessageHandler::HandleStartStopStreaming(OBSAPIMessageHandler* handler, json_t* message)
{
    json_t* previewOnly = json_object_get(message, "preview-only");

    if(previewOnly != NULL && json_typeof(previewOnly) == JSON_TRUE)
    {
        OBSStartStopPreview();
    }
    else
    {
        OBSStartStopStream();
    }
    return GetOkResponse();
}
Exemple #2
0
INT_PTR NoiseGateSettings::MsgClicked(int controlId, int code, HWND controlHwnd)
{
    switch(controlId)
    {
    default:
        // Unknown button
        break;
    case IDC_ATTACKTIME_EDIT:
    case IDC_HOLDTIME_EDIT:
    case IDC_RELEASETIME_EDIT:
        if(code == EN_CHANGE) // Modified the text box
            SetChangedSettings(true);
        break;
    case IDC_ENABLEGATE:
        if(code == BN_CLICKED) // Changed the check box
            SetChangedSettings(true);
        break;
    case IDC_PREVIEWON:
        // Toggle stream preview
        if(OBSGetStreaming())
        {
            OBSStartStopPreview();
            parent->isDisabledFromConfig = false;
            SetWindowText(controlHwnd, Str("Plugins.NoiseGate.EnablePreview"));
        }
        else
        {
            OBSStartStopPreview();
            parent->isDisabledFromConfig = true;
            SetWindowText(controlHwnd, Str("Plugins.NoiseGate.DisablePreview"));
        }
        return TRUE;
    }

    return FALSE;
}