mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
More missing files.
This commit is contained in:
24
lib/fluxmap.cc
Normal file
24
lib/fluxmap.cc
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "globals.h"
|
||||
#include "fluxmap.h"
|
||||
#include "protocol.h"
|
||||
|
||||
Fluxmap& Fluxmap::appendIntervals(std::vector<uint8_t>& intervals)
|
||||
{
|
||||
return appendIntervals(&_intervals[0], _intervals.size());
|
||||
}
|
||||
|
||||
Fluxmap& Fluxmap::appendIntervals(const uint8_t* ptr, size_t len)
|
||||
{
|
||||
_intervals.reserve(_intervals.size() + len);
|
||||
|
||||
while (len--)
|
||||
{
|
||||
uint8_t interval = *ptr++;
|
||||
_ticks += interval ? interval : 0x100;
|
||||
_intervals.push_back(interval);
|
||||
}
|
||||
|
||||
_duration = _ticks * NS_PER_TICK;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user