Browse Source

Clear up which symbols are exposed in utils and standalone libs

tags/v2.3.0-RC1
falkTX 4 years ago
parent
commit
f9ff6d5c0d
5 changed files with 96 additions and 108 deletions
  1. +33
    -10
      source/backend/CarlaHost.h
  2. +1
    -32
      source/backend/CarlaStandalone.cpp
  3. +54
    -52
      source/backend/CarlaUtils.h
  4. +4
    -4
      source/backend/utils/Information.cpp
  5. +4
    -10
      source/tests/carla-host-plugin.c

+ 33
- 10
source/backend/CarlaHost.h View File

@@ -1151,16 +1151,6 @@ CARLA_EXPORT const char* carla_get_host_osc_url_tcp(CarlaHostHandle handle);
*/
CARLA_EXPORT const char* carla_get_host_osc_url_udp(CarlaHostHandle handle);

/*!
* Get the absolute filename of this carla library.
*/
CARLA_EXPORT const char* carla_standalone_get_library_filename(void);

/*!
* Get the folder where this carla library resides.
*/
CARLA_EXPORT const char* carla_standalone_get_library_folder(void);

/*!
* Initialize NSM (that is, announce ourselves to it).
* Must be called as early as possible in the program's lifecycle.
@@ -1173,6 +1163,39 @@ CARLA_EXPORT bool carla_nsm_init(CarlaHostHandle handle, uint64_t pid, const cha
*/
CARLA_EXPORT void carla_nsm_ready(CarlaHostHandle handle, NsmCallbackOpcode opcode);

#ifndef CARLA_UTILS_H_INCLUDED
/*!
* Get the complete license text of used third-party code and features.
* Returned string is in basic html format.
*/
CARLA_EXPORT const char* carla_get_complete_license_text(void);

/*!
* Get the juce version used in the current Carla build.
*/
CARLA_EXPORT const char* carla_get_juce_version(void);

/*!
* Get the list of supported file extensions in carla_load_file().
*/
CARLA_EXPORT const char* const* carla_get_supported_file_extensions(void);

/*!
* Get the list of supported features in the current Carla build.
*/
CARLA_EXPORT const char* const* carla_get_supported_features(void);

/*!
* Get the absolute filename of this carla library.
*/
CARLA_EXPORT const char* carla_get_library_filename(void);

/*!
* Get the folder where this carla library resides.
*/
CARLA_EXPORT const char* carla_get_library_folder(void);
#endif

/** @} */

#endif /* CARLA_HOST_H_INCLUDED */

+ 1
- 32
source/backend/CarlaStandalone.cpp View File

@@ -2353,38 +2353,6 @@ const char* carla_get_host_osc_url_udp(CarlaHostHandle handle)
#endif
}

// -------------------------------------------------------------------------------------------------------------------

const char* carla_standalone_get_library_filename()
{
carla_debug("carla_standalone_get_library_filename()");

static CarlaString ret;

if (ret.isEmpty())
{
using water::File;
ret = File(File::getSpecialLocation(File::currentExecutableFile)).getFullPathName().toRawUTF8();
}

return ret;
}

const char* carla_standalone_get_library_folder()
{
carla_debug("carla_standalone_get_library_folder()");

static CarlaString ret;

if (ret.isEmpty())
{
using water::File;
ret = File(File::getSpecialLocation(File::currentExecutableFile).getParentDirectory()).getFullPathName().toRawUTF8();
}

return ret;
}

// --------------------------------------------------------------------------------------------------------------------

#ifndef CARLA_PLUGIN_EXPORT
@@ -2397,6 +2365,7 @@ const char* carla_standalone_get_library_folder()
# include "CarlaPipeUtils.cpp"
# include "CarlaProcessUtils.cpp"
# include "CarlaStateUtils.cpp"
# include "utils/Information.cpp"
#endif /* CARLA_PLUGIN_EXPORT */

// --------------------------------------------------------------------------------------------------------------------

+ 54
- 52
source/backend/CarlaUtils.h View File

@@ -139,7 +139,27 @@ typedef struct _CarlaCachedPluginInfo {
} CarlaCachedPluginInfo;

/* --------------------------------------------------------------------------------------------------------------------
* get stuff */
* cached plugins */

/*!
* Get how many cached plugins are available.
* Internal and LV2 plugin formats are cached and need to be discovered via this function.
* Do not call this for any other plugin formats.
*
* @note if this carla build uses JUCE, then you must call carla_juce_init beforehand
*/
CARLA_EXPORT uint carla_get_cached_plugin_count(PluginType ptype, const char* pluginPath);

/*!
* Get information about a cached plugin.
*
* @note if this carla build uses JUCE, then you must call carla_juce_init beforehand
*/
CARLA_EXPORT const CarlaCachedPluginInfo* carla_get_cached_plugin_info(PluginType ptype, uint index);

#ifndef CARLA_HOST_H_INCLUDED
/* --------------------------------------------------------------------------------------------------------------------
* information */

/*!
* Get the complete license text of used third-party code and features.
@@ -163,38 +183,39 @@ CARLA_EXPORT const char* const* carla_get_supported_file_extensions(void);
CARLA_EXPORT const char* const* carla_get_supported_features(void);

/*!
* Get how many cached plugins are available.
* Internal and LV2 plugin formats are cached and need to be discovered via this function.
* Do not call this for any other plugin formats.
*
* @note if this carla build uses JUCE, then you must call carla_juce_init beforehand
* Get the absolute filename of this carla library.
*/
CARLA_EXPORT uint carla_get_cached_plugin_count(PluginType ptype, const char* pluginPath);
CARLA_EXPORT const char* carla_get_library_filename(void);

/*!
* Get information about a cached plugin.
*
* @note if this carla build uses JUCE, then you must call carla_juce_init beforehand
* Get the folder where this carla library resides.
*/
CARLA_EXPORT const CarlaCachedPluginInfo* carla_get_cached_plugin_info(PluginType ptype, uint index);
CARLA_EXPORT const char* carla_get_library_folder(void);
#endif

/* --------------------------------------------------------------------------------------------------------------------
* set stuff */
* JUCE */

/*!
* Flush stdout or stderr.
* Initialize data structures and GUI support for JUCE.
* This is only needed when carla builds use JUCE and you call cached-plugin related APIs.
*
* Idle must then be called at somewhat regular intervals, though in practice there is no reason for it yet.
*
* Make sure to call carla_juce_cleanup after you are done with APIs that need JUCE.
*/
CARLA_EXPORT void carla_fflush(bool err);
CARLA_EXPORT void carla_juce_init(void);

/*!
* Print the string @a string to stdout or stderr.
* Give idle time to JUCE stuff.
* Currently only used for Linux.
*/
CARLA_EXPORT void carla_fputs(bool err, const char* string);
CARLA_EXPORT void carla_juce_idle(void);

/*!
* Set the current process name to @a name.
* Cleanup the JUCE stuff that was initialized by carla_juce_init.
*/
CARLA_EXPORT void carla_set_process_name(const char* name);
CARLA_EXPORT void carla_juce_cleanup(void);

/* --------------------------------------------------------------------------------------------------------------------
* pipes */
@@ -263,52 +284,33 @@ CARLA_EXPORT bool carla_pipe_client_flush_and_unlock(CarlaPipeClientHandle handl
CARLA_EXPORT void carla_pipe_client_destroy(CarlaPipeClientHandle handle);

/* --------------------------------------------------------------------------------------------------------------------
* window control */

CARLA_EXPORT int carla_cocoa_get_window(void* nsViewPtr);

CARLA_EXPORT void carla_x11_reparent_window(uintptr_t winId1, uintptr_t winId2);

CARLA_EXPORT void carla_x11_move_window(uintptr_t winId, int x, int y);
* system stuff */

CARLA_EXPORT int* carla_x11_get_window_pos(uintptr_t winId);
/* --------------------------------------------------------------------------------------------------------------------
* info about current library */
/*!
* Flush stdout or stderr.
*/
CARLA_EXPORT void carla_fflush(bool err);

/*!
* Get the absolute filename of this carla library.
* Print the string @a string to stdout or stderr.
*/
CARLA_EXPORT const char* carla_utils_get_library_filename(void);
CARLA_EXPORT void carla_fputs(bool err, const char* string);

/*!
* Get the folder where this carla library resides.
* Set the current process name to @a name.
*/
CARLA_EXPORT const char* carla_utils_get_library_folder(void);
CARLA_EXPORT void carla_set_process_name(const char* name);

/* --------------------------------------------------------------------------------------------------------------------
* JUCE */
* window control */

/*!
* Initialize data structures and GUI support for JUCE.
* This is only needed when carla builds use JUCE and you call cached-plugin related APIs.
*
* Idle must then be called at somewhat regular intervals, though in practice there is no reason for it yet.
*
* Make sure to call carla_juce_cleanup after you are done with APIs that need JUCE.
*/
CARLA_EXPORT void carla_juce_init(void);
CARLA_EXPORT int carla_cocoa_get_window(void* nsViewPtr);

/*!
* Give idle time to JUCE stuff.
* Currently only used for Linux.
*/
CARLA_EXPORT void carla_juce_idle(void);
CARLA_EXPORT void carla_x11_reparent_window(uintptr_t winId1, uintptr_t winId2);

/*!
* Cleanup the JUCE stuff that was initialized by carla_juce_init.
*/
CARLA_EXPORT void carla_juce_cleanup(void);
CARLA_EXPORT void carla_x11_move_window(uintptr_t winId, int x, int y);

CARLA_EXPORT int* carla_x11_get_window_pos(uintptr_t winId);

/* ----------------------------------------------------------------------------------------------------------------- */



+ 4
- 4
source/backend/utils/Information.cpp View File

@@ -221,9 +221,9 @@ const char* const* carla_get_supported_features()

// -------------------------------------------------------------------------------------------------------------------

const char* carla_utils_get_library_filename()
const char* carla_get_library_filename()
{
carla_debug("carla_utils_get_library_filename()");
carla_debug("carla_get_library_filename()");

static CarlaString ret;

@@ -236,9 +236,9 @@ const char* carla_utils_get_library_filename()
return ret;
}

const char* carla_utils_get_library_folder()
const char* carla_get_library_folder()
{
carla_debug("carla_utils_get_library_folder()");
carla_debug("carla_get_library_folder()");

static CarlaString ret;



+ 4
- 10
source/tests/carla-host-plugin.c View File

@@ -69,17 +69,11 @@ static const NativeHostDescriptor host_descriptor = {

int main(void)
{
const char* const standalone_filename = carla_standalone_get_library_filename();
assert(standalone_filename != NULL && standalone_filename[0] != '\0');
const char* const lib_filename = carla_get_library_filename();
assert(lib_filename != NULL && lib_filename[0] != '\0');

const char* const utils_filename = carla_utils_get_library_filename();
assert(utils_filename != NULL && utils_filename[0] != '\0');

const char* const standalone_folder = carla_standalone_get_library_folder();
assert(standalone_folder != NULL && standalone_folder[0] != '\0');

const char* const utils_folder = carla_utils_get_library_folder();
assert(utils_folder != NULL && utils_folder[0] != '\0');
const char* const lib_folder = carla_get_library_folder();
assert(lib_folder != NULL && lib_folder[0] != '\0');

carla_juce_init();



Loading…
Cancel
Save