当前位置: 首页>>代码示例>>C++>>正文


C++ Properties::set方法代码示例

本文整理汇总了C++中gem::Properties::set方法的典型用法代码示例。如果您正苦于以下问题:C++ Properties::set方法的具体用法?C++ Properties::set怎么用?C++ Properties::set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gem::Properties的用法示例。


在下文中一共展示了Properties::set方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addProperties

  static void addProperties(gem::Properties&props, int argc, t_atom*argv)
  {
    if(!argc)return;
    
    if(argv->a_type != A_SYMBOL) {
      ::error("no key given...");
      return;
    }
    std::string key=std::string(atom_getsymbol(argv)->s_name);
    std::vector<gem::any> values;
    argc--; argv++;
    while(argc-->0) {
      values.push_back(atom2any(argv++));
    }
    switch(values.size()) {
    default:
      props.set(key, values);
      break;
    case 1:
      props.set(key, values[0]);
      break;
    case 0: 
      {
	gem::any dummy;
	props.set(key, dummy);
      }
      break;
    }
  }
开发者ID:kmatheussen,项目名称:libpd,代码行数:29,代码来源:pix_record.cpp

示例2: setParameters

 void setParameters(gem::Properties&parms) {
   unsigned int i=0;
   for(i=0; i<m_parameterNames.size(); i++) {
     std::string key=m_parameterNames[i];
     std::string s1, s2;
     double d1, d2;
     switch(m_parameter.type(key)) {
     case gem::Properties::NONE:
       if(gem::Properties::NONE==parms.type(key)) {
         parms.erase(key);
         setParameter(i);
       }
       break;
     case gem::Properties::DOUBLE:
       if(m_parameter.get(key, d1) && parms.get(key, d2)) {
         if(d1!=d2) {
           m_parameter.set(key, d2);
           setParameter(i, d2);
         }
       }
       break;
     case gem::Properties::STRING:
       if(m_parameter.get(key, s1) && parms.get(key, s2)) {
         if(s1!=s2) {
           m_parameter.set(key, s2);
           setParameter(i, s2);
         }
       }
       break;
     default: break;
     }
   }
 }
开发者ID:ch-nry,项目名称:Gem,代码行数:33,代码来源:pix_freeframe.cpp

示例3:

void filmQT4L::getProperties(gem::Properties&props) {
  std::vector<std::string> keys=props.keys();
  gem::any value;
  double d;
  unsigned int i=0;
  for(i=0; i<keys.size(); i++) {
    std::string key=keys[i];
    props.erase(key);
    if("fps"==key) {
      d=m_fps;
      value=d; props.set(key, value);
    }
    if("frames"==key) {
      d=m_numFrames;
      value=d; props.set(key, value);
    }
    if("tracks"==key) {
      d=m_numTracks;
      value=d; props.set(key, value);
    }
    if("width"==key) {
      d=m_image.image.xsize;
      value=d; props.set(key, value);
    }
    if("height"==key) {
      d=m_image.image.ysize;
      value=d; props.set(key, value);
    }
  }
}
开发者ID:Jackovic,项目名称:Gem,代码行数:30,代码来源:filmQT4L.cpp

示例4: enumProperties

bool videoUNICAP :: enumProperties(gem::Properties&readable,
                                   gem::Properties&writeable) {
  readable.clear();
  writeable.clear();

  if(m_handle) {
    int count=0;
    unicap_status_t status= unicap_reenumerate_properties(m_handle, &count );
    if(!SUCCESS(status))
      return false;

    int id=0;
    for(id=0; id<count; id++) {
      unicap_property_t prop;
      gem::any typ;

      status = unicap_enumerate_properties(m_handle, NULL, &prop, id);
      if(!SUCCESS(status))
        continue;

      debugPost("id='%s'\tcat='%s'\tunit='%s'\tflags=%d", 
                prop.identifier,
                prop.category,
                prop.unit,
                prop.flags);


      switch(prop.type) {
      case UNICAP_PROPERTY_TYPE_RANGE: 
        debugPost("range %f-%f", prop.range.min, prop.range.min);
        typ=prop.range.max; 
        break;
      case UNICAP_PROPERTY_TYPE_VALUE_LIST: 
        debugPost("value_list %d", prop.value_list.value_count);
        typ=prop.value_list.value_count;
        break;
      case UNICAP_PROPERTY_TYPE_MENU: 
        debugPost("menu '%s' of %d", prop.menu_item, prop.menu.menu_item_count);
        typ=std::string(prop.menu_item);//prop.menu.menu_item_count;
        break;
      case UNICAP_PROPERTY_TYPE_FLAGS: 
        debugPost("flags");
        break;
      default:
        debugPost("unknown");
        // ?
        break;
      }

      readable.set(prop.identifier, typ);
      if(!(prop.flags & UNICAP_FLAGS_READ_ONLY))
        writeable.set(prop.identifier, typ);

#warning check UNICAP_FLAGS_ON_OFF & UNICAP_FLAGS_ONE_PUSH
    }
  }
  return true;
}
开发者ID:Jackovic,项目名称:Gem,代码行数:58,代码来源:videoUNICAP.cpp

示例5: getProperties

void videoOptiTrack::getProperties(gem::Properties&props)
{
  std::vector<std::string>keys=props.keys();
  double d;
  std::string s;

  props.clear();
  if(!m_camera) {
    return;
  }

  unsigned int i;
  for(i=0; i<keys.size(); i++) {
    const std::string key=keys[i];
    if("width"==key) {
      props.set(key, m_pixBlock.image.xsize);
      continue;
    }
    if("height"==key) {
      props.set(key, m_pixBlock.image.ysize);
      continue;
    }
    if("fanspeed"==key && m_camera->IsCameraFanSpeedValid()) {
      d=m_camera->CameraFanSpeed();
      props.set(key, d);
      continue;
    }
    if("temperature"==key && m_camera->IsCameraTempValid()) {
      d=m_camera->CameraTemp();
      props.set(key, d);
      continue;
    }

#define GETCAMERAPROP_BOOL(name) if(#name == key) {d=m_camera->##name(); props.set(key, d); continue; } else d=0
#define GETCAMERAPROP_INT(name)  if(#name == key) {d=m_camera->##name(); props.set(key, d); continue; } else d=0
#define GETCAMERAPROP_STR(name)  if(#name == key) {s=m_camera->##name(); props.set(key, s); continue; } else d=0
    GETCAMERAPROP_BOOL(AEC);
    GETCAMERAPROP_BOOL(AGC);
    GETCAMERAPROP_BOOL(ContinuousIR);
    GETCAMERAPROP_BOOL(HighPowerMode);
    GETCAMERAPROP_BOOL(IRFilter);
    GETCAMERAPROP_BOOL(MarkerOverlay);
    GETCAMERAPROP_BOOL(TextOverlay);
    GETCAMERAPROP_INT(Exposure);
    GETCAMERAPROP_INT(FrameDecimation);
    GETCAMERAPROP_INT(FrameRate);
    GETCAMERAPROP_INT(GrayscaleDecimation);
    GETCAMERAPROP_INT(Intensity);
    GETCAMERAPROP_INT(PrecisionCap);
    GETCAMERAPROP_INT(ShutterDelay);
    GETCAMERAPROP_INT(Threshold);
    GETCAMERAPROP_STR(Name);
#undef GETCAMERAPROP_BOOL
#undef GETCAMERAPROP_INT
#undef GETCAMERAPROP_STR
  }
}
开发者ID:megrimm,项目名称:Gem,代码行数:57,代码来源:videoOptiTrack.cpp

示例6: getProperties

void videoUNICAP :: getProperties(gem::Properties&props) {
  if(!m_handle)return;
  unicap_status_t status=0;

  std::vector<std::string> keys=props.keys();

  bool getwidth=false, getheight=false;
  int i=0;
  for(i=0; i<keys.size(); i++) {
    std::string key=keys[i];
    unicap_property_t prop;
    strncpy(prop.identifier, key.c_str(), 128);

    if("width"==key) {
      getwidth=true;
      continue;
    }
    if("height"==key) {
      getheight=true;
      continue;
    }

    status= unicap_get_property(m_handle, &prop );

    if(SUCCESS(status)) {
      switch(prop.type) {
      case UNICAP_PROPERTY_TYPE_VALUE_LIST: 
      case UNICAP_PROPERTY_TYPE_FLAGS: 
      case UNICAP_PROPERTY_TYPE_RANGE: 
        props.set(key, prop.value);
        break;
      case UNICAP_PROPERTY_TYPE_MENU:
        props.set(key, std::string(prop.menu_item));
        break;
      default:
        props.erase(key);
        // ?
        break;
      }
    }
  }


  if(getwidth||getheight) {
    unicap_format_t fmt;
    status=unicap_get_format(m_handle, &fmt);
    post("getting dimen");post_fmt(&fmt);
    if(SUCCESS(status)) {
      if(getwidth )props.set("width" , fmt.size.width);
      if(getheight)props.set("height", fmt.size.height);
    }
  }


}
开发者ID:Jackovic,项目名称:Gem,代码行数:55,代码来源:videoUNICAP.cpp

示例7: enumProperties

bool videoVFW :: enumProperties(gem::Properties&readable, gem::Properties&writeable) {
    readable.clear();
    writeable.clear();

    gem::any type=0;

    writeable.set("width", type);
    writeable.set("height", type);


    return true;
}
开发者ID:rfabbri,项目名称:Gem,代码行数:12,代码来源:videoVFW.cpp

示例8: enumProperties

bool videoTEST::enumProperties(gem::Properties&readable,
			       gem::Properties&writeable) {
  readable.clear();
  writeable.clear();


  writeable.set("width", 64);  readable.set("width", 64);
  writeable.set("height", 64); readable.set("height", 64);

  writeable.set("type", std::string("noise"));
  return true;
}
开发者ID:rfabbri,项目名称:Gem,代码行数:12,代码来源:videoTEST.cpp

示例9: enumProperties

bool videoVLC::enumProperties(gem::Properties&readable,
                              gem::Properties&writeable)
{
  readable.clear();
  writeable.clear();

  writeable.set("width",  m_pixBlock.image.xsize);
  readable.set("width",  m_pixBlock.image.xsize);
  writeable.set("height",  m_pixBlock.image.ysize);
  readable.set("height",  m_pixBlock.image.ysize);
  return false;
}
开发者ID:umlaeute,项目名称:Gem,代码行数:12,代码来源:videoVLC.cpp

示例10: getProperties

void videoDECKLINK::getProperties(gem::Properties&props)
{
  std::vector<std::string>keys=props.keys();
  unsigned int i;
  for(i=0; i<keys.size(); i++) {
    if("width"==keys[i]) {
      props.set(keys[i], m_pixBlock.image.xsize);
    }
    if("height"==keys[i]) {
      props.set(keys[i], m_pixBlock.image.ysize);
    }
  }
}
开发者ID:umlaeute,项目名称:Gem,代码行数:13,代码来源:videoDECKLINK.cpp

示例11: enumProperties

bool filmTEST::enumProperties(gem::Properties&readprops, gem::Properties&writeprops) {
  readprops.clear();
  writeprops.clear();

  double d=0;

  readprops.set("width", d);
  readprops.set("height", d);
  readprops.set("fps", d);
  readprops.set("frames", d);

  return true;
}
开发者ID:Jackovic,项目名称:Gem,代码行数:13,代码来源:filmTEST.cpp

示例12: enumProperties

///////////////////////////////
// Properties
bool filmAVIPLAY::enumProperties(gem::Properties&readable,
                                 gem::Properties&writeable) {
    readable.clear();
    writeable.clear();

    gem::any value;
    value=0.;
    readable.set("fps", value);
    readable.set("frames", value);
    readable.set("width", value);
    readable.set("height", value);

    return false;
}
开发者ID:jptrkz,项目名称:Gem,代码行数:16,代码来源:filmAVIPLAY.cpp

示例13: initParameters_

  bool initParameters_(void) {
    m_parameterNames.clear();
    m_parameter.clear();
    unsigned int count=getNumParameters_();
    unsigned int i;

    m_parameterNames.push_back(""); // dummy parameter
    for(i=0; i<count; i++) {
      std::string name=getParameterName_(i);
      FFUInt32 type = getParameterType_ (i);
      FFMixed def = getParameterDefault_(i);

      gem::any val;
      switch(type) {
      case FF_TYPE_EVENT:
        //?
        break;
      case FF_TYPE_TEXT:
        val = std::string(reinterpret_cast<const char*>(def.PointerValue));
        break;
      default:
        val = def.FloatValue;
      }
      std::cout << "param#"<<i<<": "<<name<<std::endl;
      m_parameterNames.push_back(name);
      m_parameter.set(name, val);
    }
    return true;
  }
开发者ID:ch-nry,项目名称:Gem,代码行数:29,代码来源:pix_freeframe.cpp

示例14: enumProperties

bool videoDECKLINK::enumProperties(gem::Properties&readable,
                                   gem::Properties&writeable)
{
  std::string dummy_s;
  int dummy_i=0;
  readable.clear();
  writeable.clear();

  readable.set("width", m_pixBlock.image.xsize);
  readable.set("height", m_pixBlock.image.ysize);

  dummy_s="auto";
  writeable.set("format", dummy_s);
  writeable.set("connection", dummy_s);

  return true;
}
开发者ID:umlaeute,项目名称:Gem,代码行数:17,代码来源:videoDECKLINK.cpp

示例15: getProperties

void imageBase :: getProperties(gem::Properties&props) {
    // nada
    std::vector<std::string>keys=props.keys();
    unsigned int i=0;
    for(i=0; i<keys.size(); i++) {
        gem::any unset;
        props.set(keys[i], unset);
    }
}
开发者ID:jptrkz,项目名称:Gem,代码行数:9,代码来源:imageBase.cpp


注:本文中的gem::Properties::set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。