Ejemplo n.º 1
0
snd_pcm_sframes_t Sender::Impl::_estimate_frames() const {
    if ((m_status & Sender::usRunning) == 0 || m_status == Sender::usPaused ||
            m_status == Sender::usUnderrun)
        return m_nLastFrames;

    // Wasn't started.
    if (m_startTime == TimePoint())
        return m_nLastFrames;

    if (m_wakeup.check()) {
        m_pPlug->log.info("Woken up from suspend");
        m_nLastFrames = m_pPlug->appl_ptr;
        m_startTime = Clock::now();
        m_wakeup.reset();
        return m_nLastFrames;
    }

    Duration ms(std::chrono::duration_cast<Duration>(Clock::now() - m_startTime));

    return m_nLastFrames + ms.count()*(m_pPlug->get_rate()/1000.0);
}
Ejemplo n.º 2
0
typename MonoClock<Subclass>::TimePoint MonoClock<Subclass>::now()
{
    return TimePoint(std::chrono::steady_clock::now().time_since_epoch().count());
}
Ejemplo n.º 3
0
typename SystemClock<Subclass>::TimePoint SystemClock<Subclass>::now()
{
    return TimePoint(std::chrono::system_clock::now().time_since_epoch().count());
}
Ejemplo n.º 4
0
HighResolutionClock::TimePoint HighResolutionClock::Now() {
  LARGE_INTEGER large_integer;
  VERIFY_TRUE(QueryPerformanceCounter(&large_integer), "QueryPerformanceCounter failed");
  int64 nanosecond_count = (1000 * 1000 * 1000 * (large_integer.QuadPart - g_start_time_)) / g_frequency_;
  return TimePoint(HighResolutionClock::Duration(nanosecond_count));
}
Ejemplo n.º 5
0
typename MonoClock<Subclass>::TimePoint MonoClock<Subclass>::now()
{
    LARGE_INTEGER now;
    verify(QueryPerformanceCounter(&now));
    return TimePoint(TimePoint::Duration((now.QuadPart - _start.QuadPart) * _toNano));
}
Ejemplo n.º 6
0
 inline TimePoint getAnimationTime() const {
     // We're casting the TimePoint to and from a Duration because libstdc++
     // has a bug that doesn't allow TimePoints to be atomic.
     return mode == MapMode::Continuous ? TimePoint(animationTime) : Clock::now();
 }
Ejemplo n.º 7
0
CRankDlg::CRankDlg(CString str, CString m, CString s, CString c, UINT cnt, CString lev, CString rank, UINT point, CWnd* pParent /*=NULL*/)
	: CDialogEx(CRankDlg::IDD, pParent)
{
	member =str ; nMin =m ; nSec =s, nCsec =c, nCnt =cnt ; strLev =lev ; rankName =rank ; nPoint =point ;
	TimePoint () ;	// 생성자로 초기화 함과 동시에 시간계산
}