Exemplo n.º 1
0
BeatGrid::BeatGrid(
        const Track& track,
        SINT iSampleRate,
        const QByteArray& byteArray)
        : BeatGrid(track, iSampleRate) {
    readByteArray(byteArray);
}
Exemplo n.º 2
0
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;
}
Exemplo n.º 3
0
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();
}
Exemplo n.º 4
0
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);
    }
}
Exemplo n.º 5
0
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);
    }
}
Exemplo n.º 6
0
/***
* 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;
}
Exemplo n.º 7
0
/***
* 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;
}