830 |
|
|
831 |
QFile file(sInstrumentFile); |
QFile file(sInstrumentFile); |
832 |
if (file.open(QIODevice::ReadOnly)) { |
if (file.open(QIODevice::ReadOnly)) { |
833 |
char achHeader[8]; |
char achHeader[12]; |
834 |
if (file.read(achHeader, 8) > 0) { |
if (file.read(achHeader, 12) > 0) { |
835 |
bResult = (::memcmp(&achHeader[0], "RIFF", 4) == 0 |
bResult = (::memcmp(&achHeader[0], "RIFF", 4) == 0 |
836 |
&& ::memcmp(&achHeader[4], "sfbk", 4) == 0); |
&& ::memcmp(&achHeader[8], "sfbk", 4) == 0); |
837 |
} |
} |
838 |
file.close(); |
file.close(); |
839 |
} |
} |
843 |
|
|
844 |
|
|
845 |
// Retrieve the instrument list of a instrument file (.gig). |
// Retrieve the instrument list of a instrument file (.gig). |
846 |
QStringList Channel::getInstrumentList( |
QStringList Channel::getInstrumentList ( |
847 |
const QString& sInstrumentFile, bool bInstrumentNames ) |
const QString& sInstrumentFile, bool bInstrumentNames ) |
848 |
{ |
{ |
849 |
QStringList instlist; |
QStringList instlist; |
859 |
if (isDlsInstrumentFile(sInstrumentFile)) { |
if (isDlsInstrumentFile(sInstrumentFile)) { |
860 |
RIFF::File *pRiff |
RIFF::File *pRiff |
861 |
= new RIFF::File(sInstrumentFile.toUtf8().constData()); |
= new RIFF::File(sInstrumentFile.toUtf8().constData()); |
862 |
gig::File *pGig = new gig::File(pRiff); |
gig::File *pGig = new gig::File(pRiff); |
863 |
#if HAVE_LIBGIG_SETAUTOLOAD |
#if HAVE_LIBGIG_SETAUTOLOAD |
864 |
// prevent sleepy response time on large .gig files |
// prevent sleepy response time on large .gig files |
865 |
pGig->SetAutoLoad(false); |
pGig->SetAutoLoad(false); |