|
Toshihiro Shimizu |
890ddd |
#ifndef PLUGIN_PARAM_INTERFACE
|
|
Toshihiro Shimizu |
890ddd |
#define PLUGIN_PARAM_INTERFACE
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz_hostif.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tparam.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tfx.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tfxparam.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "toonz_params.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
/* ひとつのパラメータに対応 */
|
|
Toshihiro Shimizu |
890ddd |
class Param
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
TFx *fx_;
|
|
Toshihiro Shimizu |
890ddd |
std::string name_;
|
|
Toshihiro Shimizu |
890ddd |
toonz_param_type_enum type_;
|
|
Toshihiro Shimizu |
890ddd |
//std::shared_ptr< toonz_param_desc_t > desc_;
|
|
Toshihiro Shimizu |
890ddd |
toonz_param_desc_t *desc_;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
//inline Param(TFx* fx, const std::string& name, toonz_param_type_enum type, std::shared_ptr< toonz_param_desc_t >&& desc)
|
|
Toshihiro Shimizu |
890ddd |
// : fx_(fx), name_(name), type_(type), desc_(std::move(desc)) {
|
|
Toshihiro Shimizu |
890ddd |
inline Param(TFx *fx, const std::string &name, toonz_param_type_enum type, const toonz_param_desc_t *desc)
|
|
Toshihiro Shimizu |
890ddd |
: fx_(fx), name_(name), type_(type), desc_(const_cast<toonz_param_desc_t *="">(desc))</toonz_param_desc_t>
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
inline const std::string &name() const
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
return name_;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
inline toonz_param_type_enum type() const
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
return type_;
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
inline TParamP param() const
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
return fx_->getParams()->getParam(name_);
|
|
Toshihiro Shimizu |
890ddd |
}
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
inline const toonz_param_desc_t *desc() const { return desc_; }
|
|
Toshihiro Shimizu |
890ddd |
inline toonz_param_desc_t *desc() { return desc_; }
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int hint_default_value(toonz_param_handle_t param, int size_in_bytes, const void *default_value);
|
|
Toshihiro Shimizu |
890ddd |
int hint_value_range(toonz_param_handle_t param, const void *minvalue, const void *maxvalue);
|
|
Toshihiro Shimizu |
890ddd |
int hint_unit(toonz_param_handle_t param, int unit);
|
|
Toshihiro Shimizu |
890ddd |
int hint_item(toonz_param_handle_t param, int item, const char *caption);
|
|
Toshihiro Shimizu |
890ddd |
int set_description(toonz_param_handle_t param, const char *description);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int get_type(toonz_param_handle_t param, double, int *, int *);
|
|
Toshihiro Shimizu |
890ddd |
int get_value_type(toonz_param_handle_t param, int *pvalue_type);
|
|
Toshihiro Shimizu |
890ddd |
int get_value(toonz_param_handle_t param, double frame, int *psize_in_bytes, void *pvalue);
|
|
Toshihiro Shimizu |
890ddd |
int set_value(toonz_param_handle_t param, double frame, int size_in_bytes, const void *pvalue);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
int get_string_value(toonz_param_handle_t param, int *wholesize, int rcvbufsize, char *pvalue);
|
|
Toshihiro Shimizu |
890ddd |
int get_spectrum_value(toonz_param_handle_t param, double frame, double x, toonz_param_spectrum_t *pvalue);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif
|