MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); ui->play->hide(); connect(ui->actionOpen_WAV_File,SIGNAL(triggered()),this,SLOT(OpenWAVFile()) ); connect(ui->actionApply_Effect,SIGNAL(triggered()),this,SLOT(ApplyEffect()) ); connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(ApplyEffect()) ); connect(ui->play,SIGNAL(clicked()),this,SLOT(playFile()) ); connect(ui->open,SIGNAL(clicked()),this,SLOT(OpenWAVFile()) ); ui->pushButton->setText(initialText); ui->fftsize->setValue(8192); ui->wsize->setValue(8192); ui->overlapf->setValue(1); lastdir = QDir::currentPath(); lastdirR = lastdir; quitAction = new QAction("Exit",this); connect(quitAction,SIGNAL(triggered()),qApp, SLOT(quit()) ); trayIconMenu = new QMenu(this); trayIconMenu->addAction(quitAction); trayIcon = new QSystemTrayIcon(this); QIcon icon = QIcon("images/Icon.png"); trayIcon->setIcon(icon); setWindowIcon(icon); trayIcon->setToolTip(qApp->applicationName()); trayIcon->setContextMenu(trayIconMenu); trayIcon->setVisible(true); setWindowTitle(qApp->applicationName()); }
//------------------------------------------------------------------------------------- LRESULT DlgEffectBase::WindowProc (UINT msg, WPARAM wParam, LPARAM lParam) { LRESULT l = DlgModalBase::WindowProc (msg, wParam, lParam) ; BOOL bUpdate = FALSE ; // update when scroll if (msg == WM_HSCROLL) { if (LOWORD(wParam) != SB_ENDSCROLL) bUpdate = TRUE ; } if (msg == WM_COMMAND) { int nID = LOWORD(wParam) ; TCHAR cls[128] = {0} ; ::GetClassName (::GetDlgItem(m_hWnd, nID), cls, 128) ; // button command if (lstrcmpi(cls, L"button") == 0) { if ((nID != IDOK) && (nID != IDCANCEL)) bUpdate = TRUE ; } } if (bUpdate) { ApplyEffect() ; } return l ; }
void CPostprocManager::ApplyPostproc() { if (!m_IsInitialised) return; // Don't do anything if we are using the default effect. if (m_PostProcEffect == L"default") { return; } pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_PongFbo); pglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, 0, 0); GLenum buffers[] = { GL_COLOR_ATTACHMENT0_EXT }; pglDrawBuffers(1, buffers); pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_PingFbo); pglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT, GL_TEXTURE_2D, 0, 0); pglDrawBuffers(1, buffers); pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_PongFbo); pglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0); pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_PingFbo); pglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, 0, 0); // First render blur textures. Note that this only happens ONLY ONCE, before any effects are applied! // (This may need to change depending on future usage, however that will have a fps hit) ApplyBlur(); for (int pass = 0; pass < m_PostProcTech->GetNumPasses(); ++pass) { ApplyEffect(m_PostProcTech, pass); } pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_PongFbo); pglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, m_DepthTex, 0); pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_PingFbo); pglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_STENCIL_ATTACHMENT, GL_TEXTURE_2D, m_DepthTex, 0); }
//------------------------------------------------------------------------------------- void DlgEffectBase::OnPostInit() { ApplyEffect() ; }
BOOL DETOUR_CEffect::DETOUR_ApplyTiming(CCreatureObject& creTarget) { if (0) IECString("DETOUR_CEffect::DETOUR_ApplyTiming"); if (creTarget.o.IsNonScript()) return FALSE; switch (effect.nTiming) { case 0x1000: //apply until expired if (g_pChitin->pGame->m_WorldTimer.nGameTime >= effect.nDuration) { bPurge = TRUE; return TRUE; } break; case 0: //apply, set expiry time (duration in sec) effect.nTiming = 0x1000; effect.nDuration = min(effect.nDuration, CEFFECT_DURATION_MAX); effect.nDuration = effect.nDuration * 15 + g_pChitin->pGame->m_WorldTimer.nGameTime; break; case 10: //apply, set expiry time (duration in ticks) effect.nTiming = 0x1000; effect.nDuration += g_pChitin->pGame->m_WorldTimer.nGameTime; break; case 3: //set expiry time (duration in sec) effect.nTiming = 6; effect.nDuration = min(effect.nDuration, CEFFECT_DURATION_MAX); effect.nDuration = effect.nDuration * 15 + g_pChitin->pGame->m_WorldTimer.nGameTime; return TRUE; break; case 4: //set expiry time (duration in sec) effect.nTiming = 7; effect.nDuration = min(effect.nDuration, CEFFECT_DURATION_MAX); effect.nDuration = effect.nDuration * 15 + g_pChitin->pGame->m_WorldTimer.nGameTime; return TRUE; break; case 5: effect.nTiming = 8; effect.nDuration = min(effect.nDuration, CEFFECT_DURATION_MAX); effect.nDuration = effect.nDuration * 15 + g_pChitin->pGame->m_WorldTimer.nGameTime; return TRUE; break; case 6: //end delay if expired, then apply, set expiry time (duration in sec) if (g_pChitin->pGame->m_WorldTimer.nGameTime >= effect.nDuration) { effect.nTiming = 0x1000; effect.nDuration = min(nDurationAfterDelay, CEFFECT_DURATION_MAX); effect.nDuration = nDurationAfterDelay * 15 + g_pChitin->pGame->m_WorldTimer.nGameTime; OnDelayFinished(creTarget); PrintEffectText(creTarget); break; } else { return TRUE; } break; case 7: //end delay if expired, then apply if (g_pChitin->pGame->m_WorldTimer.nGameTime >= effect.nDuration) { effect.nTiming = 1; OnDelayFinished(creTarget); PrintEffectText(creTarget); break; } else { return TRUE; } break; case 8: //end delay if expired, then apply if (g_pChitin->pGame->m_WorldTimer.nGameTime >= effect.nDuration) { effect.nTiming = 2; OnDelayFinished(creTarget); PrintEffectText(creTarget); break; } else { return TRUE; } break; default: break; } if (pGameOptionsEx->GetOption("Eff_StackingConfig") && (effect.nSaveType & CEFFECT_STACKING_LIMIT)) { CEffectList& listEquipped = creTarget.GetEquippedEffectsList(); CEffectList& listMain = creTarget.GetTimedEffectList(); CEffect* pFound = NULL; pFound = CEffectList_FindPrevious(listEquipped, *this, listEquipped.GetCurrentPosition(), creTarget); if (pFound == NULL) pFound = CEffectList_FindPrevious(listMain, *this, listMain.GetCurrentPosition(), creTarget); if (pFound) { effect.nSaveType |= CEFFECT_STACKING_SUSPEND; if (pGameOptionsEx->GetOption("Debug_Verbose")) { LPCTSTR lpsz = "DETOUR_CEffect::DETOUR_ApplyTiming(): Effect %X suspended (like %x)\r\n"; console.writef(lpsz, (DWORD)this, (DWORD)pFound); L.timestamp(); L.appendf(lpsz, (DWORD)this, (DWORD)pFound); } return TRUE; } else { if (effect.nSaveType & CEFFECT_STACKING_SUSPEND) { effect.nSaveType &= ~(CEFFECT_STACKING_SUSPEND); if (pGameOptionsEx->GetOption("Debug_Verbose")) { LPCTSTR lpsz = "DETOUR_CEffect::DETOUR_ApplyTiming(): Effect %X resumed\r\n"; console.writef(lpsz, (DWORD)this); L.timestamp(); L.appendf(lpsz, (DWORD)this); } } } } return ApplyEffect(creTarget); }