Example #1
0
json_t* OBSAPIMessageHandler::HandleGetStreamingStatus(OBSAPIMessageHandler* handler, json_t* message)
{
    json_t* ret = GetOkResponse();
    json_object_set_new(ret, "streaming", json_boolean(OBSGetStreaming()));
    json_object_set_new(ret, "preview-only", json_boolean(OBSGetPreviewOnly()));

    return ret;
}
Example #2
0
void NoiseGateSettings::MsgInitDialog()
{
    HWND ctrlHwnd;

    // Disable the filter if we are currently streaming
    if(OBSGetStreaming())
        parent->isDisabledFromConfig = true;

    LocalizeWindow(hwnd);

    // Load settings from parent object
    RefreshConfig();

    // Volume preview
    // Custom drawn progress bar, beware, static member
    ctrlHwnd = GetDlgItem(hwnd, IDC_CURVOL);
    SetWindowSubclass(ctrlHwnd, PBSubclassProc, 0, 0);

    SendMessage(ctrlHwnd, PBM_SETRANGE32, 0, CURVOL_RESOLUTION); // Bottom = 0, top = CURVOL_RESOLUTION
    RepaintVolume(); // Repaint immediately
    SetTimer(hwnd, REPAINT_TIMER_ID, 16, NULL); // Repaint every 16ms (~60fps)

    // Enable/disable stream button
    ctrlHwnd = GetDlgItem(hwnd, IDC_PREVIEWON);
    if(OBSGetStreaming())
    {
        SetWindowText(ctrlHwnd, Str("Plugins.NoiseGate.DisablePreview"));

        // If not in preview mode then prevent the user from stopping the stream from this window
        if(OBSGetPreviewOnly())
            EnableWindow(ctrlHwnd, TRUE);
        else
            EnableWindow(ctrlHwnd, FALSE);
    }
    else
    {
        SetWindowText(ctrlHwnd, Str("Plugins.NoiseGate.EnablePreview"));
        EnableWindow(ctrlHwnd, TRUE);
    }

    SetChangedSettings(false);
}
Example #3
0
void OnStopStream()
{
    if(triggerHandler)
        triggerHandler->StreamStopping(OBSGetPreviewOnly());
}