BeatGrid::BeatGrid( const Track& track, SINT iSampleRate, const QByteArray& byteArray) : BeatGrid(track, iSampleRate) { readByteArray(byteArray); }
static TACommandVerdict adler32_cmd(TAThread thread,TAInputStream stream) { char* buf; uLong adler, res; uInt len; size_t size; int bufIsNull; // Prepare adler = readULong(&stream); readByteArray(&stream, &buf, &size); len = readUInt(&stream); bufIsNull = readInt(&stream); START_TARGET_OPERATION(thread); if(!bufIsNull) res = adler32(adler, (Bytef*)buf, len); else res = adler32(adler, Z_NULL, len); END_TARGET_OPERATION(thread); // Response writeULong(thread, res); sendResponse(thread); return taDefaultVerdict; }
void GSParser::mtdeParser() { u32 size = read<u32>() - 2; std::string methodName = readStringFromTable(); std::cout << "Method " << methodName << " of size " << size << "\n"; u8 *data = readByteArray(size); GSDecompiler decompiler(data, size, stringTable); //std::cout << decompiler.decompile() << "\n"; decompiler.decompile(); }
BeatGrid::BeatGrid(TrackInfoObject* pTrack, const QByteArray* pByteArray) : QObject(), m_mutex(QMutex::Recursive), m_iSampleRate(pTrack->getSampleRate()), m_dBeatLength(0.0) { qDebug() << "New BeatGrid"; if (pByteArray != NULL) { readByteArray(pByteArray); } }
BeatGrid::BeatGrid(TrackInfoObject* pTrack, int iSampleRate, const QByteArray* pByteArray) : QObject(), m_mutex(QMutex::Recursive), m_iSampleRate(iSampleRate > 0 ? iSampleRate : pTrack->getSampleRate()), m_dBeatLength(0.0) { if (pByteArray != NULL) { readByteArray(pByteArray); } }
/*** * Function: readUInt(byte address, unsigned short *value) * Description: Read 16-bit unsigned integer from device * Params: address - Register address * value - Variable to save the value in * Returns: 0 if the value was read successfully, 1 if not ***/ byte Si7020::readUInt(byte address, unsigned short *value) { byte result; byte byteCount = 0; byte data[2] = { 0, 0}; if(readByteArray(address,data,2) == 0) { *value = (((unsigned short) data[0]) << 8) | data[1]; } return result; }
/*** * Function: readInt(byte address, signed short *value) * Description: Read 16-bit signed integer from device * Params: address - Register address * value - Variable to save the value in * Returns: 0 if the value was read successfully, 1 if not ***/ byte Si7020::readInt(byte address, signed short *value) { byte result; byte byteCount = 0; byte data[2] = { 0, 0}; Wire.beginTransmission(SI7020_I2C_ADDRESS); Wire.write(address); result = Wire.endTransmission(); if(readByteArray(address,data,2) == 0) { *value = (((unsigned short) data[0]) << 8) | data[1]; } return result; }