void MenuTimer::Stop() { /* Don't call SetSeconds if we're already at 0: let the existing tweens finish. */ if( m_fSecondsLeft >= 1 ) SetSeconds( 0 ); Pause(); }
void CCrossDlg::SetInfo(const INFO& Info) { SetPos(Info.Pos); SetSeconds(Info.Seconds); Loop(Info.Loop); SetWaveform(Info.Waveform); }
// constructor, specifying stream and buffer size in seconds pablioBuffer( unsigned int framesPerSecond, unsigned char bytesPerSample, unsigned char samplesPerFrame, double seconds) : _buffer(0),PCMsound(framesPerSecond, bytesPerSample, samplesPerFrame) { SetSeconds(seconds); _reallocateBuffer(); }
MenuTimer::MenuTimer() : WARNING_COMMAND("MenuTimer", WARNING_COMMAND_NAME, WARNING_START+1) { m_fStallSeconds = 0; m_fStallSecondsLeft = MAX_STALL_SECONDS; m_bPaused = false; for( int i=0; i<NUM_MENU_TIMER_TEXTS; i++ ) { m_text[i].LoadFromFont( THEME->GetPathF("MenuTimer","numbers") ); m_text[i].SetName( ssprintf("Text%d",i+1) ); ActorUtil::OnCommand( m_text[i], "MenuTimer" ); this->AddChild( &m_text[i] ); m_exprFormatText[i].SetFromExpression( i==0 ? TEXT1_FORMAT_FUNCTION : TEXT2_FORMAT_FUNCTION ); } SetSeconds( TIMER_PAUSE_SECONDS ); m_soundBeep.Load( THEME->GetPathS("MenuTimer","tick") ); }
bool CCrossDlg::FadeTo(const CPatch& Patch, LPCTSTR Name, double Secs, bool RandPhase) { if (!m_Frm->IsVeejay() && !SaveCheck()) return(FALSE); m_Play = FALSE; // halt fader first, without updating UI double Pos = GetPos(); bool Fwd = Pos <= .5; // set fade direction int Src = SEL_A + !Fwd; // index of source int Dst = SEL_A + Fwd; // index of destination if (Pos > 0 && Pos < 1) { // if fader is between A and B SetInfo(Src, GetInfo(SEL_MIX)); // copy mix to source SetName(Src, m_MixName); // set source name to mix m_Frm->OnNewParms(Src); // update parameters dialog } SetPos(!Fwd); // move fader to source SetInfo(Dst, Patch); // copy arg to destination SetName(Dst, Name); // set destination file name SetSeconds(Secs); if (Secs) Play(TRUE); // start fading to new patch else { Play(FALSE); SetPos(Fwd); // jump to new patch m_Frm->GetView()->FlushHistory(); // prevent glitch } if (RandPhase) { TimerHook(); // make mod freqs non-zero so randomize phase works for (int i = 0; i < ROWS; i++) { // if modulator is unused in source, but active in destination if (!m_Info[Src].m_Row[i].Freq && m_Info[Dst].m_Row[i].Freq) m_Frm->GetView()->SetPhase(i, double(rand()) / RAND_MAX); // randomize phase } } if (m_Frm->GetPatchMode() == CMainFrame::PM_FULL) m_Frm->SetPatch(Patch); // restore master and main settings m_Frm->OnNewParms(Dst); // update parameters dialog return(TRUE); }
void MenuTimer::Disable() { SetSeconds( TIMER_PAUSE_SECONDS ); Pause(); }
void CCrossDlg::OnChangedSecsEdit(NMHDR* pNMHDR, LRESULT* pResult) { SetSeconds(m_SecsEdit.GetVal()); }