Exemplo n.º 1
0
static void readheader(void) /* read a header chunk */
{
    int format, ntrks, division;

    if (readmt("MThd") == EOF)
        return;

    Mf_toberead = read32bit();
    format = read16bit();
    ntrks = read16bit();
    division = read16bit();

    if (Mf_header)
        (*Mf_header)(format,ntrks,division);

    /* flush any extra stuff, in case the length of header is not 6 */
    while (Mf_toberead > 0)
        (void) egetc();
}
Exemplo n.º 2
0
void Riff::processPHDR(int size)
{
    int i, pc, bank;
    char name[21];
    int npresets = size / 38 - 1;
    for (i = 0; i < npresets; i++) {
        if (m_IOStream->atEnd()) return;
        m_IOStream->readRawData(name, 20);
        name[20] = 0;
        pc = read16bit();
        bank = read16bit();
        skip(14);
	if (bank < 128)
            emit signalInstrument(bank, pc, QString(name));
	else
    	    emit signalPercussion(bank, pc, QString(name));
        //qDebug() << "Instrument: " << bank << pc << name;
    }
    skip(38);
}
Exemplo n.º 3
0
QString Riff::readDLSVersion()
{
    quint16 v[4];
    for(int i=0; i<4; ++i) v[i] = read16bit();
    return QString("%1.%2.%3.%4").arg(v[0]).arg(v[1]).arg(v[2]).arg(v[3]);
}
Exemplo n.º 4
0
QString Riff::readSFVersion()
{
    int sfVersion = read16bit();
    int sfMinor = read16bit();
    return QString("%1.%2").arg(sfVersion).arg(sfMinor);
}