SMF: fix breakage when instrument names contain spaces.
This commit is contained in:
parent
047a003df1
commit
4f186d9acb
12
smf.C
12
smf.C
|
@ -805,24 +805,28 @@ smf::read_pattern_info ( pattern *p )
|
||||||
name_set = true;
|
name_set = true;
|
||||||
break;
|
break;
|
||||||
case smf::INSTRUMENT:
|
case smf::INSTRUMENT:
|
||||||
// FIXME: decode mapping;
|
|
||||||
{
|
{
|
||||||
char *s = read_text();
|
char *s = read_text();
|
||||||
|
|
||||||
|
|
||||||
char pat[256];
|
char pat[256];
|
||||||
|
|
||||||
if ( 1 == sscanf( s, "Instrument: %s", pat ) )
|
if ( 1 == sscanf( s, "Instrument: %[^\n]", pat ) )
|
||||||
{
|
{
|
||||||
if ( ! p->mapping.open( Mapping::INSTRUMENT, pat ) )
|
if ( ! p->mapping.open( Mapping::INSTRUMENT, pat ) )
|
||||||
|
{
|
||||||
|
p->mapping.open( Mapping::SCALE, "Chromatic" );
|
||||||
WARNING( "could not find instrument \"%s\"", pat );
|
WARNING( "could not find instrument \"%s\"", pat );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if ( 1 == sscanf( s, "Scale: %s", pat ) )
|
if ( 1 == sscanf( s, "Scale: %[^\n]", pat ) )
|
||||||
{
|
{
|
||||||
if ( ! p->mapping.open( Mapping::SCALE, pat ) )
|
if ( ! p->mapping.open( Mapping::SCALE, pat ) )
|
||||||
|
{
|
||||||
|
p->mapping.open( Mapping::SCALE, "Chromatic" );
|
||||||
WARNING( "could not find scale \"%s\"", pat );
|
WARNING( "could not find scale \"%s\"", pat );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case smf::PORT:
|
case smf::PORT:
|
||||||
|
|
Loading…
Reference in New Issue