Barely working basic playback

This commit is contained in:
Blue 2018-12-17 20:15:58 +03:00
parent 98a443e298
commit 9b5198a6ce
19 changed files with 406 additions and 24 deletions

View file

@ -144,3 +144,17 @@ const QByteArray & W::Blob::byteArray() const
return qDataView;
}
const unsigned char * W::Blob::uchar() const
{
return (unsigned char*) data;
}
W::Blob* W::Blob::slice(uint64_t start, uint64_t length) const
{
char* n_data = new char[length];
for (int i = 0; i < length; ++i) {
n_data[i] = data[start + i];
}
return new W::Blob(length, n_data);
}

View file

@ -22,6 +22,7 @@ namespace W
size_type size() const override;
objectType getType() const override;
Blob* slice(uint64_t start, uint64_t length = 0) const;
bool operator==(const W::Object & other) const override;
@ -33,6 +34,7 @@ namespace W
static const objectType type = blob;
const QByteArray& byteArray() const;
const unsigned char* uchar() const;
protected:
bool hasData;