diff --git a/VERSIONS b/VERSIONS index f75dd3149..6a50b6e7e 100644 --- a/VERSIONS +++ b/VERSIONS @@ -2,6 +2,14 @@ ChucK VERSIONS log ------------------ +1.5.2.6 +======= +- (added, macOS and Linux) --chugin: and --chugin-path: flags now expands '~' in filepath +- (developer) updated set/getParam() key names: + was: CHUCK_PARAM_USER_CHUGINS now: CHUCK_PARAM_CHUGIN_LIST_USER + was: CHUCK_PARAM_USER_CHUGIN_DIRECTORIES now: CHUCK_PARAM_CHUGIN_LIST_USER_DIR + + 1.5.2.5 (July 2024) ======= - (updated) chugin API version from 10.1 to 10.2 diff --git a/src/core/chuck.cpp b/src/core/chuck.cpp index 7bd1d7ea7..92e6df8ac 100644 --- a/src/core/chuck.cpp +++ b/src/core/chuck.cpp @@ -87,8 +87,12 @@ #define CHUCK_PARAM_AUTO_DEPEND_DEFAULT "0" #define CHUCK_PARAM_DEPRECATE_LEVEL_DEFAULT "1" #define CHUCK_PARAM_WORKING_DIRECTORY_DEFAULT "" -#define CHUCK_PARAM_CHUGIN_ENABLE_DEFAULT "1" #define CHUCK_PARAM_IS_REALTIME_AUDIO_HINT_DEFAULT "0" +#define CHUCK_PARAM_COMPILER_HIGHLIGHT_ON_ERROR_DEFAULT "1" +#define CHUCK_PARAM_TTY_COLOR_DEFAULT "0" +#define CHUCK_PARAM_TTY_WIDTH_HINT_DEFAULT "80" +// chugin-relate param defaults +#define CHUCK_PARAM_CHUGIN_ENABLE_DEFAULT "1" #ifndef __PLATFORM_WINDOWS__ // 1.4.1.0 (ge) changed to ""; was "/usr/local/lib/chuck" // redundant with g_default_chugin_path, which already contains @@ -98,11 +102,8 @@ // redundant with g_default_chugin_path, which already contains #define CHUCK_PARAM_CHUGIN_DIRECTORY_DEFAULT "" #endif // __PLATFORM_WINDOWS__ -#define CHUCK_PARAM_USER_CHUGINS_DEFAULT std::list() -#define CHUCK_PARAM_USER_CHUGIN_DIRECTORIES_DEFAULT std::list() -#define CHUCK_PARAM_COMPILER_HIGHLIGHT_ON_ERROR_DEFAULT "1" -#define CHUCK_PARAM_TTY_COLOR_DEFAULT "0" -#define CHUCK_PARAM_TTY_WIDTH_HINT_DEFAULT "80" +#define CHUCK_PARAM_CHUGIN_LIST_USER_DEFAULT std::list() +#define CHUCK_PARAM_CHUGIN_LIST_USER_DIR_DEFAULT std::list() @@ -212,10 +213,10 @@ void ChucK::initDefaultParams() initParam( CHUCK_PARAM_TTY_WIDTH_HINT, CHUCK_PARAM_TTY_WIDTH_HINT_DEFAULT, ck_param_int ); // initialize list params manually (take care to use tolower()) - m_listParams[tolower(CHUCK_PARAM_USER_CHUGINS)] = CHUCK_PARAM_USER_CHUGINS_DEFAULT; - m_param_types[tolower(CHUCK_PARAM_USER_CHUGINS)] = ck_param_string_list; - m_listParams[tolower(CHUCK_PARAM_USER_CHUGIN_DIRECTORIES)] = CHUCK_PARAM_USER_CHUGIN_DIRECTORIES_DEFAULT; - m_param_types[tolower(CHUCK_PARAM_USER_CHUGIN_DIRECTORIES)] = ck_param_string_list; + m_listParams[tolower(CHUCK_PARAM_CHUGIN_LIST_USER)] = CHUCK_PARAM_CHUGIN_LIST_USER_DEFAULT; + m_param_types[tolower(CHUCK_PARAM_CHUGIN_LIST_USER)] = ck_param_string_list; + m_listParams[tolower(CHUCK_PARAM_CHUGIN_LIST_USER_DIR)] = CHUCK_PARAM_CHUGIN_LIST_USER_DIR_DEFAULT; + m_param_types[tolower(CHUCK_PARAM_CHUGIN_LIST_USER_DIR)] = ck_param_string_list; } @@ -704,13 +705,13 @@ t_CKBOOL ChucK::initChugins() // chugin dur std::string chuginDir = getParamString( CHUCK_PARAM_CHUGIN_DIRECTORY ); // list of search pathes (added 1.3.0.0) - std::list dl_search_path = getParamStringList( CHUCK_PARAM_USER_CHUGIN_DIRECTORIES ); + std::list dl_search_path = getParamStringList( CHUCK_PARAM_CHUGIN_LIST_USER_DIR ); if( chuginDir != std::string("") ) { dl_search_path.push_back( chuginDir ); } // list of individually named chug-ins (added 1.3.0.0) - std::list named_dls = getParamStringList( CHUCK_PARAM_USER_CHUGINS ); + std::list named_dls = getParamStringList( CHUCK_PARAM_CHUGIN_LIST_USER ); EM_pushlog(); // print host version @@ -850,14 +851,14 @@ void ChucK::probeChugins() // chugin dur std::string chuginDir = getParamString( CHUCK_PARAM_CHUGIN_DIRECTORY ); // list of search pathes (added 1.3.0.0) - std::list dl_search_path = getParamStringList( CHUCK_PARAM_USER_CHUGIN_DIRECTORIES ); + std::list dl_search_path = getParamStringList( CHUCK_PARAM_CHUGIN_LIST_USER_DIR ); if( chuginDir != "" ) { // add to search path dl_search_path.push_back( chuginDir ); } // list of individually named chug-ins (added 1.3.0.0) - std::list named_dls = getParamStringList( CHUCK_PARAM_USER_CHUGINS ); + std::list named_dls = getParamStringList( CHUCK_PARAM_CHUGIN_LIST_USER ); // log EM_log( CK_LOG_SYSTEM, "probing chugins (.chug)..." ); diff --git a/src/core/chuck.h b/src/core/chuck.h index 22f45c546..a3c60b274 100644 --- a/src/core/chuck.h +++ b/src/core/chuck.h @@ -95,17 +95,20 @@ #define CHUCK_PARAM_AUTO_DEPEND "AUTO_DEPEND" #define CHUCK_PARAM_DEPRECATE_LEVEL "DEPRECATE_LEVEL" #define CHUCK_PARAM_WORKING_DIRECTORY "WORKING_DIRECTORY" -#define CHUCK_PARAM_CHUGIN_ENABLE "CHUGIN_ENABLE" -#define CHUCK_PARAM_CHUGIN_DIRECTORY "CHUGIN_DIRECTORY" -#define CHUCK_PARAM_USER_CHUGINS "USER_CHUGINS" -#define CHUCK_PARAM_USER_CHUGIN_DIRECTORIES "USER_CHUGIN_DIRECTORIES" #define CHUCK_PARAM_IS_REALTIME_AUDIO_HINT "IS_REALTIME_AUDIO_HINT" #define CHUCK_PARAM_COMPILER_HIGHLIGHT_ON_ERROR "COMPILER_HIGHLIGHT_ON_ERROR" #define CHUCK_PARAM_TTY_COLOR "TTY_COLOR" #define CHUCK_PARAM_TTY_WIDTH_HINT "TTY_WIDTH_HINT" +// chugin-relate param names +#define CHUCK_PARAM_CHUGIN_ENABLE "CHUGIN_ENABLE" +#define CHUCK_PARAM_CHUGIN_DIRECTORY "CHUGIN_DIRECTORY" +#define CHUCK_PARAM_CHUGIN_LIST_USER "CHUGIN_LIST_USER" +#define CHUCK_PARAM_CHUGIN_LIST_USER_DIR "CHUGIN_LIST_USER_DIR" // legacy compatibiity (new code should use newer version of these, on the right) #define CHUCK_PARAM_HINT_IS_REALTIME_AUDIO CHUCK_PARAM_IS_REALTIME_AUDIO_HINT +#define CHUCK_PARAM_USER_CHUGINS CHUCK_PARAM_CHUGIN_LIST_USER +#define CHUCK_PARAM_USER_CHUGIN_DIRECTORIES CHUCK_PARAM_CHUGIN_LIST_USER_DIR diff --git a/src/core/chuck_compile.cpp b/src/core/chuck_compile.cpp index 2e2b509a8..98b5f2559 100644 --- a/src/core/chuck_compile.cpp +++ b/src/core/chuck_compile.cpp @@ -1160,6 +1160,8 @@ t_CKBOOL Chuck_Compiler::load_external_modules( const char * extension, { // get chugin name std::string & dl_path = *i_dl; + // expand the filepath (e.g., ~) | 1.5.2.6 (ge) added + dl_path = expand_filepath(dl_path); // check extension, append if no match if( !extension_matches(dl_path.c_str(), extension) ) dl_path += extension; @@ -1171,8 +1173,10 @@ t_CKBOOL Chuck_Compiler::load_external_modules( const char * extension, for( std::list::iterator i_sp = chugin_search_paths.begin(); i_sp != chugin_search_paths.end(); i_sp++ ) { + // expand the filepath (e.g., ~) | 1.5.2.6 (ge) added + string dl_path = expand_filepath(*i_sp); // search directory and load contents - load_external_modules_in_directory( this, (*i_sp).c_str(), extension, recursiveSearch ); + load_external_modules_in_directory( this, dl_path.c_str(), extension, recursiveSearch ); } // clear context @@ -1358,6 +1362,8 @@ t_CKBOOL Chuck_Compiler::probe_external_modules( const char * extension, { // get chugin name std::string & dl_path = *i_dl; + // expand the filepath (e.g., ~) | 1.5.2.6 (ge) added + dl_path = expand_filepath(dl_path); // check extension, append if no match if( !extension_matches(dl_path.c_str(), extension) ) dl_path += extension; @@ -1380,8 +1386,10 @@ t_CKBOOL Chuck_Compiler::probe_external_modules( const char * extension, for( std::list::iterator i_sp = chugin_search_paths.begin(); i_sp != chugin_search_paths.end(); i_sp++ ) { + // expand the filepath (e.g., ~) | 1.5.2.6 (ge) added + string dl_path = expand_filepath(*i_sp); // search directory and load contents - probe_external_modules_in_directory( (*i_sp).c_str(), extension, recursiveSearch, ck_libs ); + probe_external_modules_in_directory( dl_path.c_str(), extension, recursiveSearch, ck_libs ); } // pop diff --git a/src/host/chuck_main.cpp b/src/host/chuck_main.cpp index 89ead09cd..779227b4a 100644 --- a/src/host/chuck_main.cpp +++ b/src/host/chuck_main.cpp @@ -1240,8 +1240,8 @@ t_CKBOOL go( int argc, const char ** argv ) //-------------------- VIRTUAL MACHINE SETUP (PART 1) --------------------- // set chugins parameters the_chuck->setParam( CHUCK_PARAM_CHUGIN_ENABLE, chugin_load ); - the_chuck->setParam( CHUCK_PARAM_USER_CHUGINS, named_dls ); - the_chuck->setParam( CHUCK_PARAM_USER_CHUGIN_DIRECTORIES, dl_search_path ); + the_chuck->setParam( CHUCK_PARAM_CHUGIN_LIST_USER, named_dls ); + the_chuck->setParam( CHUCK_PARAM_CHUGIN_LIST_USER_DIR, dl_search_path ); //----------------------------------------------------------------- // probe chugins | 1.5.0.4 (ge) added