/usr/include/lv2dynparam1/lv2dynparam/host.h is in liblv2dynparam1-dev 2-5.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 | /* -*- Mode: C ; c-basic-offset: 2 -*- */
/*****************************************************************************
*
* This file is part of lv2dynparam host library
*
* Copyright (C) 2006,2007,2008,2009 Nedko Arnaudov <nedko@arnaudov.name>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 2 of the License
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
*****************************************************************************/
/**
* @file host.h
* @brief Interface to LV2 dynparam extension host helper library
*/
#ifndef DYNPARAM_H__5090F477_0BE7_439F_BF1D_F2EB78822760__INCLUDED
#define DYNPARAM_H__5090F477_0BE7_439F_BF1D_F2EB78822760__INCLUDED
/** handle to host helper library instance */
typedef void * lv2dynparam_host_instance;
/** handle to host helper library representation of parameter */
typedef void * lv2dynparam_host_parameter;
/** handle to host helper library representation of group */
typedef void * lv2dynparam_host_group;
/** handle to host helper library representation of command */
typedef void * lv2dynparam_host_command;
#define LV2DYNPARAM_PARAMETER_TYPE_UNKNOWN 0
#define LV2DYNPARAM_PARAMETER_TYPE_FLOAT 1
#define LV2DYNPARAM_PARAMETER_TYPE_INT 2
#define LV2DYNPARAM_PARAMETER_TYPE_NOTE 3
#define LV2DYNPARAM_PARAMETER_TYPE_STRING 4
#define LV2DYNPARAM_PARAMETER_TYPE_FILENAME 5
#define LV2DYNPARAM_PARAMETER_TYPE_BOOLEAN 6
#define LV2DYNPARAM_PARAMETER_TYPE_ENUM 7
union lv2dynparam_host_parameter_value
{
bool boolean;
float fpoint;
signed int integer;
unsigned int enum_selected_index;
char * string;
};
union lv2dynparam_host_parameter_range
{
struct
{
float min;
float max;
} fpoint;
struct
{
signed int min;
signed int max;
} integer;
struct
{
char ** values;
unsigned int values_count;
} enumeration;
};
/**
* Typedef for callback function to be called when new parameter is created.
*
* @param instance_context User context associated with instance,
* as supplied previously to lv2dynparam_host_attach()
* @param parameter_handle Handle to host helper library representation of
* parameter that was created
* @param parameter_context_ptr Pointer to variable to store the user context
* user context associated with the created parameter
*/
typedef
void
(* lv2dynparam_parameter_created)(
void * instance_context,
lv2dynparam_host_parameter parameter_handle,
unsigned int parameter_type,
const char * parameter_name,
void ** parameter_context_ptr);
typedef
void
(* lv2dynparam_parameter_value_change_context)(
void * instance_context,
void * parameter_context,
void * value_change_context);
/**
* Typedef for callback function to be called when parameter is being destroyed.
*
* @param instance_context user context associated with instance,
* as supplied previously to lv2dynparam_host_attach()
* @param parameter_context user context associated with the parameter being destroyed.
*/
typedef
void
(* lv2dynparam_parameter_destroying)(
void * instance_context,
void * parameter_context);
/**
* Call this function to attach dynparam host helper library to particular plugin.
* parameter_created_callback and parameter_destroying_callback are optional
* but if supplied at all, both must be supplied.
* Must be called from the UI thread.
* This function may sleep/lock.
*
* @param lv2descriptor LV2 descriptor of plugin to attach to.
* @param lv2instance handle to LV2 plugin instance.
* @param rtmempool_ptr pointer to rt-capable memory pool.
* @param instance_context user context to be associated with instance
* @param parameter_created_callback Callback to be called when parameter is created. Can be NULL.
* @param parameter_destroying_callback Callback to be called when parameter is being destroyed. Can be NULL.
* @param instance_ptr Pointer to variable receiving handle to
* host helper library instance.
*
* @return Success status
* @retval true - success
* @retval false - error
*/
bool
lv2dynparam_host_attach(
const LV2_Descriptor * lv2descriptor,
LV2_Handle lv2instance,
struct lv2_rtsafe_memory_pool_provider * rtmempool_ptr,
void * instance_context,
lv2dynparam_parameter_created parameter_created_callback,
lv2dynparam_parameter_destroying parameter_destroying_callback,
lv2dynparam_parameter_value_change_context parameter_value_change_context,
lv2dynparam_host_instance * instance_ptr);
/**
* Call this function to deattach dynparam host helper library from particular plugin.
* Must be called from the UI thread.
* This function may sleep/lock.
*
* @param instance Handle to instance received from lv2dynparam_host_attach()
*/
void
lv2dynparam_host_detach(
lv2dynparam_host_instance instance);
/**
* Call this function to issue pending calls to plugin.
* Must be called from from audio/midi realtime thread.
* This function will not sleep/lock.
*
* @param instance Handle to instance received from lv2dynparam_host_attach()
*/
void
lv2dynparam_host_realtime_run(
lv2dynparam_host_instance instance);
/**
* Call this function to issue pending calls to UI.
* Must be called from the UI thread.
* This function may sleep/lock.
*
* @param instance Handle to instance received from lv2dynparam_host_attach()
*/
void
lv2dynparam_host_ui_run(
lv2dynparam_host_instance instance);
/**
* Call this function to trigger dynparams appear.
* Must be called from from the UI thread.
* This function may sleep/lock.
*
* @param instance Handle to instance received from lv2dynparam_host_attach()
*/
void
lv2dynparam_host_ui_on(
lv2dynparam_host_instance instance);
/**
* Call this function to trigger dynparams disappear.
* Must be called from from the UI thread.
* This function may sleep/lock.
*
* @param instance Handle to instance received from lv2dynparam_host_attach()
*/
void
lv2dynparam_host_ui_off(
lv2dynparam_host_instance instance);
/**
* Callback called from UI thread to notify UI about group appear.
*
* @param group_handle handle to host helper library representation of
* group that appeared
* @param instance_context user context associated with instance,
* as supplied previously to lv2dynparam_host_attach()
* @param parent_group_ui_context user context of parent group, NULL for root group.
* @param group_name name of group that is appearing
* @param hints_ptr Pointer to group hints.
* @param group_ui_context Pointer to variable receiving UI context of appeared group.
*/
void
dynparam_ui_group_appeared(
lv2dynparam_host_group group_handle,
void * instance_context,
void * parent_group_ui_context,
const char * group_name,
const struct lv2dynparam_hints * hints_ptr,
void ** group_ui_context);
/**
* Callback called from UI thread to notify UI about group disappear.
*
* @param instance_context user context associated with instance,
* as supplied previously to lv2dynparam_host_attach()
* @param parent_group_ui_context user context of parent group, NULL for root group.
* @param group_ui_context user context of group that disappeared.
*/
void
dynparam_ui_group_disappeared(
void * instance_context,
void * parent_group_ui_context,
void * group_ui_context);
/**
* Callback called from UI thread to notify UI about command appear.
*
* @param command_handle handle to host helper library representation of
* command that appeared
* @param instance_context user context associated with instance,
* as supplied previously to lv2dynparam_host_attach()
* @param group_ui_context user context of parent group, NULL for root group.
* @param command_name name of command that is appearing
* @param hints_ptr Pointer to command hints.
* @param command_ui_context Pointer to variable receiving UI context of appeared command.
*/
void
dynparam_ui_command_appeared(
lv2dynparam_host_command command_handle,
void * instance_context,
void * group_ui_context,
const char * command_name,
const struct lv2dynparam_hints * hints_ptr,
void ** command_ui_context);
/**
* Callback called from UI thread to notify UI about command disappear.
*
* @param instance_context user context associated with instance,
* as supplied previously to lv2dynparam_host_attach()
* @param parent_group_ui_context user context of parent group, NULL for root group.
* @param command_ui_context user context of command that disappeared.
*/
void
dynparam_ui_command_disappeared(
void * instance_context,
void * parent_group_ui_context,
void * command_ui_context);
/**
* Callback called from UI thread to notify UI about parameter appear.
*
* @param parameter_handle Handle to host helper library representation of
* parameter that appeared
* @param instance_context user context associated with instance,
* as supplied previously to lv2dynparam_host_attach()
* @param group_ui_context User context of parent group, NULL for root group.
* @param parameter_name Name of parameter that is appearing
* @param hints_ptr Pointer to parameter hints.
* @param value Initial value of the appearing parameter
* @param parameter_ui_context Pointer to variable receiving UI context of appeared parameter.
*/
void
dynparam_ui_parameter_appeared(
lv2dynparam_host_parameter parameter_handle,
void * instance_context,
void * group_ui_context,
unsigned int parameter_type,
const char * parameter_name,
const struct lv2dynparam_hints * hints_ptr,
union lv2dynparam_host_parameter_value value,
union lv2dynparam_host_parameter_range range,
void * parameter_context,
void ** parameter_ui_context);
/**
* Callback called from UI thread to notify UI about parameter disappear.
*
* @param instance_context user context associated with instance,
* as supplied previously to lv2dynparam_host_attach()
* @param parent_group_ui_context user context of parent group, NULL for root group.
* @param parameter_ui_context user context of parameter that disappeared.
*/
void
dynparam_ui_parameter_disappeared(
void * instance_context,
void * parent_group_ui_context,
unsigned int parameter_type,
void * parameter_context,
void * parameter_ui_context);
/**
* Call this function to change parameter value.
* dynparam_parameter_value_changed() will be call will be scheduled
* Must be called from from audio/midi realtime thread.
* This function will not sleep/lock.
*
* @param instance Handle to instance received from lv2dynparam_host_attach()
* @param parameter_handle handle of parameter which value will be changed
* @param value the new value
*/
void
lv2dynparam_parameter_change_rt(
lv2dynparam_host_instance instance,
lv2dynparam_host_parameter parameter_handle,
union lv2dynparam_host_parameter_value value);
/**
* Call this function to change parameter value.
* dynparam_parameter_value_changed() will not be called
* Must be called from the UI thread.
* This function may sleep/lock.
*
* @param instance Handle to instance received from lv2dynparam_host_attach()
* @param parameter_handle handle of parameter which value will be changed
* @param value the new value
*/
void
lv2dynparam_parameter_change(
lv2dynparam_host_instance instance,
lv2dynparam_host_parameter parameter_handle,
union lv2dynparam_host_parameter_value value);
/**
* Callback called from UI thread to notify host about parameter value change.
*
*/
void
dynparam_ui_parameter_value_changed(
void * instance_context,
void * parameter_context,
void * parameter_ui_context,
union lv2dynparam_host_parameter_value value);
/**
* Typedef for callback function to be called from dynparam_get_parameters()
*
* @param context User context, as supplied as dynparam_get_parameters() parameter
* @param parameter_name Parameter name
* @param parameter_value Parameter value, as string
*/
typedef
void
(* lv2dynparam_parameter_get_callback)(
void * context,
void * parameter_context,
const char * parameter_name,
const char * parameter_value);
/**
* Call this funtion to get parameters of plugin, as pairs of parameter name and value strings.
* Must be called from the UI thread.
* This function may sleep/lock.
*
* @param instance Handle to instance received from lv2dynparam_host_attach()
* @param callback Callback to be called for each parameter
* @param context User context to be supplied as parameter when callback is called
*/
void
lv2dynparam_get_parameters(
lv2dynparam_host_instance instance,
lv2dynparam_parameter_get_callback callback,
void * context);
/**
* Call this function to set parameter of plugin, as pair of parameter name and value strings.
* Must be called from the UI thread.
* This function may sleep/lock.
*
* @param instance Handle to instance received from lv2dynparam_host_attach()
* @param parameter_name Parameter name
* @param parameter_value Parameter value, as string
*/
void
lv2dynparam_set_parameter(
lv2dynparam_host_instance instance,
const char * parameter_name,
const char * parameter_value,
void * context);
#endif /* #ifndef DYNPARAM_H__5090F477_0BE7_439F_BF1D_F2EB78822760__INCLUDED */
|