Browse Source

Sequencer: Fix configuration bug causing error message "Couldn't open instrument directory".

tags/non-daw-v1.3.0
Jonathan Moore Liles 4 years ago
parent
commit
992e55bf0d
3 changed files with 4 additions and 4 deletions
  1. +0
    -1
      sequencer/src/const.h
  2. +3
    -3
      sequencer/src/instrument.C
  3. +1
    -0
      sequencer/wscript

+ 0
- 1
sequencer/src/const.h View File

@@ -38,4 +38,3 @@ const char COPYRIGHT[] = "Copyright (c) 2007-2013 Jonathan Moore Liles";
/* directories */

#define USER_CONFIG_DIR ".non/"
#define INSTRUMENT_DIR "instruments/"

+ 3
- 3
sequencer/src/instrument.C View File

@@ -160,7 +160,7 @@ Instrument::read ( const char *s )
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" ) ) )
return false;
@@ -261,7 +261,7 @@ get_listing( const char *dir )

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;
}
else
@@ -291,7 +291,7 @@ get_listing( const char *dir )
char **
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 );

if ( ! ( usr || sys ) )


+ 1
- 0
sequencer/wscript View File

@@ -32,6 +32,7 @@ def configure(conf):
conf.define('SYSTEM_PATH', '/'.join( [ conf.env.DATADIR, APPNAME ] ) )
conf.define('DOCUMENT_PATH', '/'.join( [ conf.env.DATADIR, 'doc' ] ) )
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)



Loading…
Cancel
Save