void lb302Synth::initNote( lb302Note *n) { catch_decay = 0; vco_inc = n->vco_inc; // Always reset vca on non-dead notes, and // Only reset vca on decaying(decayed) and never-played if(n->dead == 0 || (vca_mode==1 || vca_mode==3)) { //printf(" good\n"); sample_cnt = 0; vca_mode = 0; // LB303: //vca_a = 0; } else { vca_mode = 2; } initSlide(); // Slide-from note, save inc for next note if (slideToggle.value()) { vco_slideinc = vco_inc; // May need to equal vco_slidebase+vco_slide if last note slid } recalcFilter(); if(n->dead ==0){ // Swap next two blocks?? #if QT_VERSION >= 0x050000 vcf.load()->playNote(); #else vcf->playNote(); #endif // Ensure envelope is recalculated vcf_envpos = ENVINC; // Double Check //vca_mode = 0; //vca_a = 0.0; } }
LRESULT CMainDlg::OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { // set icons HICON hIcon = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXICON), ::GetSystemMetrics(SM_CYICON)); SetIcon(hIcon, TRUE); HICON hIconSmall = AtlLoadIconImage(IDR_MAINFRAME, LR_DEFAULTCOLOR, ::GetSystemMetrics(SM_CXSMICON), ::GetSystemMetrics(SM_CYSMICON)); SetIcon(hIconSmall, FALSE); // register object for message filtering and idle updates CMessageLoop* pLoop = _Module.GetMessageLoop(); ATLASSERT(pLoop != NULL); pLoop->AddMessageFilter(this); pLoop->AddIdleHandler(this); UIAddChildWindowContainer(m_hWnd); initValue(); LoadSetting(); InitDB(); initPreviewDlg(); initDH(); initBottomButton(); initTimeLabel(); initSlide(); initCradleButton(); //默认选中channel 0 FocusChannel(0); //默认布局 SetPreviewDlgLayout(PREVIEWLAYOUT4,0); //计时器 时钟 SetTimer(1,1000); //录像 SetTimer(2,1000); SetWindowPos(NULL,0,0,1000,700,SWP_SHOWWINDOW); CenterWindow(); RegisterStreamDirectReadCallback(StreamDirectReadCallback, this); updateSetting(); return TRUE; }