Sequencer: Fix configuration bug causing error message "Couldn't open instrument directory".
This commit is contained in:
parent
81e24f4239
commit
992e55bf0d
|
@ -38,4 +38,3 @@ const char COPYRIGHT[] = "Copyright (c) 2007-2013 Jonathan Moore Liles";
|
||||||
/* directories */
|
/* directories */
|
||||||
|
|
||||||
#define USER_CONFIG_DIR ".non/"
|
#define USER_CONFIG_DIR ".non/"
|
||||||
#define INSTRUMENT_DIR "instruments/"
|
|
||||||
|
|
|
@ -160,7 +160,7 @@ Instrument::read ( const char *s )
|
||||||
if ( ! ( fp = fopen( pat, "r" ) ) )
|
if ( ! ( fp = fopen( pat, "r" ) ) )
|
||||||
{
|
{
|
||||||
|
|
||||||
sprintf( pat, "%s/%s/%s.inst", SYSTEM_PATH, INSTRUMENT_DIR, s );
|
sprintf( pat, "%s/%s.inst", INSTRUMENTS_PATH, s );
|
||||||
|
|
||||||
if ( ! ( fp = fopen( pat, "r" ) ) )
|
if ( ! ( fp = fopen( pat, "r" ) ) )
|
||||||
return false;
|
return false;
|
||||||
|
@ -261,7 +261,7 @@ get_listing( const char *dir )
|
||||||
|
|
||||||
if ( 0 > ( n = scandir( dir, &names, instrument_filter, alphasort ) ) )
|
if ( 0 > ( n = scandir( dir, &names, instrument_filter, alphasort ) ) )
|
||||||
{
|
{
|
||||||
WARNING( "couldn't open instrument directory" );
|
WARNING( "couldn't open instrument directory: %s", dir );
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -291,7 +291,7 @@ get_listing( const char *dir )
|
||||||
char **
|
char **
|
||||||
Instrument::listing ( void )
|
Instrument::listing ( void )
|
||||||
{
|
{
|
||||||
list <string> *sys = get_listing( SYSTEM_PATH "/" INSTRUMENT_DIR );
|
list <string> *sys = get_listing( INSTRUMENTS_PATH );
|
||||||
list <string> *usr = get_listing( config.user_config_dir );
|
list <string> *usr = get_listing( config.user_config_dir );
|
||||||
|
|
||||||
if ( ! ( usr || sys ) )
|
if ( ! ( usr || sys ) )
|
||||||
|
|
|
@ -32,6 +32,7 @@ def configure(conf):
|
||||||
conf.define('SYSTEM_PATH', '/'.join( [ conf.env.DATADIR, APPNAME ] ) )
|
conf.define('SYSTEM_PATH', '/'.join( [ conf.env.DATADIR, APPNAME ] ) )
|
||||||
conf.define('DOCUMENT_PATH', '/'.join( [ conf.env.DATADIR, 'doc' ] ) )
|
conf.define('DOCUMENT_PATH', '/'.join( [ conf.env.DATADIR, 'doc' ] ) )
|
||||||
conf.define('PIXMAP_PATH', '/'.join( [ conf.env.DATADIR, 'pixmaps' ] ) )
|
conf.define('PIXMAP_PATH', '/'.join( [ conf.env.DATADIR, 'pixmaps' ] ) )
|
||||||
|
conf.define('INSTRUMENTS_PATH', '/'.join( [ conf.env.DATADIR, APPNAME, 'instruments' ] ) )
|
||||||
|
|
||||||
conf.write_config_header('config.h', remove=False)
|
conf.write_config_header('config.h', remove=False)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue