plugin api in common template and plugin_parameter enum
This commit is contained in:
parent
3dd1a83501
commit
ed187c94dd
@ -21,14 +21,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
} plugin_callbacks;
|
||||
|
||||
#include "data.h"
|
||||
#include "plugin_api.h"
|
||||
#include "plugin.h"
|
||||
|
||||
#include <string.h>
|
||||
|
@ -21,14 +21,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
} plugin_callbacks;
|
||||
|
||||
#include "data.h"
|
||||
#include "plugin_api.h"
|
||||
#include "plugin.h"
|
||||
|
||||
#include <stdio.h>
|
||||
|
49
templates/common/src/plugin_api.h
Normal file
49
templates/common/src/plugin_api.h
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Tibia
|
||||
*
|
||||
* Copyright (C) 2024 Orastron Srl unipersonale
|
||||
*
|
||||
* Tibia 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 3 of the License.
|
||||
*
|
||||
* Tibia 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 Tibia. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
#ifndef PLUGIN_API_H
|
||||
#define PLUGIN_API_H
|
||||
|
||||
typedef struct {
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
} plugin_callbacks;
|
||||
|
||||
typedef struct {
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
void (*set_parameter_begin)(void *handle, size_t index);
|
||||
void (*set_parameter)(void *handle, size_t index, float value);
|
||||
void (*set_parameter_end)(void *handle, size_t index);
|
||||
} plugin_ui_callbacks;
|
||||
|
||||
{{?it.product.parameters.length > 0}}
|
||||
enum {
|
||||
{{~it.product.parameters :p}}
|
||||
plugin_parameter_{{=p.id}},
|
||||
{{~}}
|
||||
};
|
||||
{{?}}
|
||||
|
||||
#endif
|
26
templates/common/tibia-index.js
Normal file
26
templates/common/tibia-index.js
Normal file
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* Tibia
|
||||
*
|
||||
* Copyright (C) 2024 Orastron Srl unipersonale
|
||||
*
|
||||
* Tibia 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 3 of the License.
|
||||
*
|
||||
* Tibia 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 Tibia. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* File author: Stefano D'Angelo
|
||||
*/
|
||||
|
||||
var path = require("path");
|
||||
var sep = path.sep;
|
||||
|
||||
module.exports = function (data, api) {
|
||||
api.generateFileFromTemplateFile(`src${sep}plugin_api.h`, `src${sep}plugin_api.h`, data);
|
||||
};
|
@ -21,14 +21,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
} plugin_callbacks;
|
||||
|
||||
#include "data.h"
|
||||
#include "plugin_api.h"
|
||||
#include "plugin.h"
|
||||
|
||||
#include <string.h>
|
||||
|
@ -21,14 +21,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
} plugin_callbacks;
|
||||
|
||||
#include "data.h"
|
||||
#include "plugin_api.h"
|
||||
#include "plugin.h"
|
||||
#if PARAMETERS_N > 0
|
||||
#include <algorithm>
|
||||
|
@ -21,24 +21,8 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
} plugin_callbacks;
|
||||
|
||||
typedef struct {
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
void (*set_parameter_begin)(void *handle, size_t index);
|
||||
void (*set_parameter)(void *handle, size_t index, float value);
|
||||
void (*set_parameter_end)(void *handle, size_t index);
|
||||
} plugin_ui_callbacks;
|
||||
|
||||
#include "data.h"
|
||||
#include "plugin_api.h"
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wunused-function"
|
||||
#include "plugin.h"
|
||||
|
@ -21,29 +21,13 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
} plugin_callbacks;
|
||||
|
||||
typedef struct {
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
void (*set_parameter_begin)(void *handle, size_t index);
|
||||
void (*set_parameter)(void *handle, size_t index, float value);
|
||||
void (*set_parameter_end)(void *handle, size_t index);
|
||||
} plugin_ui_callbacks;
|
||||
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wpedantic"
|
||||
#include "vst3_c_api.h"
|
||||
#pragma GCC diagnostic pop
|
||||
|
||||
#include "data.h"
|
||||
#include "plugin_api.h"
|
||||
#include "plugin.h"
|
||||
#ifdef DATA_UI
|
||||
# include "plugin_ui.h"
|
||||
|
@ -21,14 +21,8 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
void * handle;
|
||||
const char * format;
|
||||
const char * (*get_bindir)(void *handle);
|
||||
const char * (*get_datadir)(void *handle);
|
||||
} plugin_callbacks;
|
||||
|
||||
#include "data.h"
|
||||
#include "plugin_api.h"
|
||||
#include "plugin.h"
|
||||
|
||||
#include "string.h"
|
||||
|
@ -68,17 +68,17 @@ static void plugin_reset(plugin *instance) {
|
||||
|
||||
static void plugin_set_parameter(plugin *instance, size_t index, float value) {
|
||||
switch (index) {
|
||||
case 0:
|
||||
case plugin_parameter_gain:
|
||||
//approx instance->gain = powf(10.f, 0.05f * value);
|
||||
instance->gain = ((2.6039890429412597e-4f * value + 0.032131027163547855f) * value + 1.f) / ((0.0012705124328080768f * value - 0.0666763481312185f) * value + 1.f);
|
||||
break;
|
||||
case 1:
|
||||
case plugin_parameter_delay:
|
||||
instance->delay = 0.001f * value;
|
||||
break;
|
||||
case 2:
|
||||
case plugin_parameter_cutoff:
|
||||
instance->cutoff = value;
|
||||
break;
|
||||
case 3:
|
||||
case plugin_parameter_bypass:
|
||||
instance->bypass = value >= 0.5f;
|
||||
break;
|
||||
}
|
||||
|
@ -1,32 +1,39 @@
|
||||
#!/bin/sh
|
||||
|
||||
dir=`dirname $0`
|
||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/common $dir/../out/vst3
|
||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/vst3.json $dir/../templates/vst3 $dir/../out/vst3
|
||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/vst3.json,$dir/vst3-make.json $dir/../templates/vst3-make $dir/../out/vst3
|
||||
cp $dir/plugin.h $dir/plugin_ui.h $dir/../out/vst3/src
|
||||
|
||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/common $dir/../out/lv2
|
||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/lv2.json $dir/../templates/lv2 $dir/../out/lv2
|
||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/lv2.json,$dir/lv2-make.json $dir/../templates/lv2-make $dir/../out/lv2
|
||||
cp $dir/plugin.h $dir/plugin_ui.h $dir/../out/lv2/src
|
||||
|
||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/common $dir/../out/web
|
||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/web $dir/../out/web
|
||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/web-make $dir/../out/web
|
||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/web-demo $dir/../out/web
|
||||
cp $dir/plugin.h $dir/../out/web/src
|
||||
|
||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/common $dir/../out/android
|
||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/android.json $dir/../templates/android $dir/../out/android
|
||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/android.json,$dir/android-make.json $dir/../templates/android-make $dir/../out/android
|
||||
cp $dir/keystore.jks $dir/../out/android
|
||||
cp $dir/plugin.h $dir/../out/android/src
|
||||
|
||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/common $dir/../out/ios
|
||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/ios.json $dir/../templates/ios $dir/../out/ios
|
||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/ios.json,$dir/ios-make.json $dir/../templates/ios-make $dir/../out/ios
|
||||
cp $dir/plugin.h $dir/../out/ios/src
|
||||
|
||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/common $dir/../out/cmd
|
||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/cmd $dir/../out/cmd
|
||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/cmd-make.json $dir/../templates/cmd-make $dir/../out/cmd
|
||||
cp $dir/plugin.h $dir/../out/cmd/src
|
||||
|
||||
$dir/../tibia $dir/product.json,$dir/company.json $dir/../templates/common $dir/../out/daisy-seed
|
||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/daisy-seed.json $dir/../templates/daisy-seed $dir/../out/daisy-seed
|
||||
$dir/../tibia $dir/product.json,$dir/company.json,$dir/daisy-seed.json,$dir/daisy-seed-make.json $dir/../templates/daisy-seed-make $dir/../out/daisy-seed
|
||||
cp $dir/plugin.h $dir/../out/daisy-seed/src
|
||||
|
Loading…
Reference in New Issue
Block a user