Example #1
0
size_t PlayListStep::GetPosition() const
{
    int msPerFrame = 1000;
    PlayListItem* timesource = GetTimeSource(msPerFrame);

    size_t frameMS;
    if (timesource != nullptr)
    {
        frameMS = timesource->GetPositionMS();
    }
    else
    {
        auto now = wxGetUTCTimeMillis();
        if (_pause == 0)
        {
            frameMS = (now - _startTime).ToLong();
        }
        else
        {
            frameMS = (now - _startTime - (now - _pause)).ToLong();
        }
    }

    return frameMS;
}
Example #2
0
bool PlayListStep::Frame(wxByte* buffer, size_t size)
{
    int msPerFrame = 1000;
    PlayListItem* timesource = GetTimeSource(msPerFrame);

    if (msPerFrame == 0)
    {
        msPerFrame = 50;
    }

    size_t frameMS;
    if (timesource != nullptr)
    {
        frameMS = timesource->GetPositionMS();
    }
    else
    {
        frameMS = (wxGetUTCTimeMillis() - _startTime).ToLong();
    }

    for (auto it = _items.begin(); it != _items.end(); ++it)
    {
        (*it)->Frame(buffer, size, frameMS, msPerFrame);
    }

    if (timesource != nullptr)
    {
        return timesource->Done();
    }
    else
    {
        return frameMS >= GetLengthMS();
    }
}