示例#1
0
    ~DelayedPublisher()
    {
        if(!bStopping)
        {
            App->EnableSceneSwitching(FALSE);
            EnableWindow (hwndMain, FALSE);

            bStreamEnding = true;
            HWND hwndProgressDialog = OBSCreateDialog(hinstMain, MAKEINTRESOURCE(IDD_ENDINGDELAY), hwndMain, (DLGPROC)EndDelayProc, (LPARAM)this);
            ProcessEvents();

            ShowWindow(hwndProgressDialog, TRUE);

            DWORD totalTimeLeft = delayTime;

            String strTimeLeftVal = Str("EndingDelay.TimeLeft");

            DWORD lastTimeLeft = -1;

            DWORD firstTime = OSGetTime();
            while(delayedPackets.Num() && !bCancelEnd)
            {
                ProcessEvents();

                DWORD timeElapsed = (OSGetTime()-firstTime);

                DWORD timeLeft = (totalTimeLeft-timeElapsed)/1000;
                DWORD timeLeftMinutes = timeLeft/60;
                DWORD timeLeftSeconds = timeLeft%60;

                if((timeLeft != lastTimeLeft) && (totalTimeLeft >= timeElapsed))
                {
                    String strTimeLeft = strTimeLeftVal;
                    strTimeLeft.FindReplace(TEXT("$1"), FormattedString(TEXT("%u:%02u"), timeLeftMinutes, timeLeftSeconds));
                    SetWindowText(GetDlgItem(hwndProgressDialog, IDC_TIMELEFT), strTimeLeft);
                    lastTimeLeft = timeLeft;
                }

                ProcessDelayedPackets(lastTimestamp+timeElapsed);
                if(bStopping)
                    bCancelEnd = true;

                Sleep(10);
            }

            EnableWindow (hwndMain, TRUE);
            App->EnableSceneSwitching(TRUE);
            DestroyWindow(hwndProgressDialog);
        }

        for(UINT i=0; i<delayedPackets.Num(); i++)
            delayedPackets[i].data.Clear();
    }
HWND SettingsEncoding::CreatePane(HWND parentHwnd)
{
    hwnd = OBSCreateDialog(hinstMain, MAKEINTRESOURCE(IDD_SETTINGS_ENCODING), parentHwnd, (DLGPROC)DialogProc, (LPARAM)this);
    return hwnd;
}
示例#3
0
HWND SettingsPublish::CreatePane(HWND parentHwnd)
{
    hwnd = OBSCreateDialog(hinstMain, MAKEINTRESOURCE(IDD_SETTINGS_PUBLISH), parentHwnd, (DLGPROC)DialogProc, (LPARAM)this);
    return hwnd;
}
示例#4
0
HWND SettingsAdvanced::CreatePane(HWND parentHwnd)
{
    hwnd = OBSCreateDialog(hinstMain, MAKEINTRESOURCE(IDD_SETTINGS_ADVANCED), parentHwnd, (DLGPROC)DialogProc, (LPARAM)this);
    return hwnd;
}
示例#5
0
HWND SettingsGeneral::CreatePane(HWND parentHwnd)
{
    hwnd = OBSCreateDialog(hinstMain, MAKEINTRESOURCE(IDD_SETTINGS_GENERAL), parentHwnd, (DLGPROC)DialogProc, (LPARAM)this);
    return hwnd;
}