Shinya Kitaoka 810553
#pragma once
Shinya Kitaoka 810553
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
/* ひとつのパラメータに対応 */
Shinya Kitaoka 120a6e
class Param {
Shinya Kitaoka 120a6e
  TFx *fx_;
Shinya Kitaoka 120a6e
  std::string name_;
Shinya Kitaoka 120a6e
  toonz_param_type_enum type_;
Shinya Kitaoka 120a6e
  // std::shared_ptr< toonz_param_desc_t > desc_;
Shinya Kitaoka 120a6e
  toonz_param_desc_t *desc_;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Shinya Kitaoka 120a6e
  // inline Param(TFx* fx, const std::string& name, toonz_param_type_enum type,
Shinya Kitaoka 120a6e
  // std::shared_ptr< toonz_param_desc_t >&& desc)
Shinya Kitaoka 120a6e
  //	: fx_(fx), name_(name), type_(type), desc_(std::move(desc)) {
Shinya Kitaoka 120a6e
  inline Param(TFx *fx, const std::string &name, toonz_param_type_enum type,
Shinya Kitaoka 120a6e
               const toonz_param_desc_t *desc)
Shinya Kitaoka 120a6e
      : fx_(fx)
Shinya Kitaoka 120a6e
      , name_(name)
Shinya Kitaoka 120a6e
      , type_(type)
Shinya Kitaoka 120a6e
      , desc_(const_cast<toonz_param_desc_t *="">(desc)) {}</toonz_param_desc_t>
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  inline const std::string &name() const { return name_; }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  inline toonz_param_type_enum type() const { return type_; }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  inline TParamP param() const { return fx_->getParams()->getParam(name_); }
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
  inline const toonz_param_desc_t *desc() const { return desc_; }
Shinya Kitaoka 120a6e
  inline toonz_param_desc_t *desc() { return desc_; }
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Shinya Kitaoka 120a6e
int hint_default_value(toonz_param_handle_t param, int size_in_bytes,
Shinya Kitaoka 120a6e
                       const void *default_value);
Shinya Kitaoka 120a6e
int hint_value_range(toonz_param_handle_t param, const void *minvalue,
Shinya Kitaoka 120a6e
                     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);
Shinya Kitaoka 120a6e
int get_value(toonz_param_handle_t param, double frame, int *psize_in_bytes,
Shinya Kitaoka 120a6e
              void *pvalue);
Shinya Kitaoka 120a6e
int set_value(toonz_param_handle_t param, double frame, int size_in_bytes,
Shinya Kitaoka 120a6e
              const void *pvalue);
Shinya Kitaoka 120a6e
Shinya Kitaoka 120a6e
int get_string_value(toonz_param_handle_t param, int *wholesize, int rcvbufsize,
Shinya Kitaoka 120a6e
                     char *pvalue);
Shinya Kitaoka 120a6e
int get_spectrum_value(toonz_param_handle_t param, double frame, double x,
Shinya Kitaoka 120a6e
                       toonz_param_spectrum_t *pvalue);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif