示例#1
0
文件: Chorus.cpp 项目: spearse/FSOM
Chorus::Chorus(dspCreationStruct data):
	DSPEffect(data),
	m_delayUnitL(2048),
	m_delayUnitR(2048),
	m_modTable(512),
	m_modPhasor(44100,1)
{
    set_effect_name("Chorus");
    set_meta(get_tutId(),"link to html");
    
    m_modTable.fill_sine();
    add_parameter("Chorus Amount",0.0,1.0,0.5);
    get_parameter("Chorus Amount")->set_meta("GuiHint","soCustomFader");
    
    add_parameter("Depth",0.0,1.0,0.5);
    get_parameter("Depth")->set_meta("GuiHint","soCustomFader");
    
    add_parameter("Frequency",0.01,5.0,1.0);
    get_parameter("Frequency")->set_meta("GuiHint","soCustomFader");

    set_implementation();
    


}
	void Get_image::inizialize_parameters (string path) {
		(*this).path = path;
		add_parameter (IN, String);
		add_parameter (OUT, Buffer);
		
		string command = "mkdir -p " + path;
		if (system(command.c_str())) cerr << "ERROR - Can't create the service directory" << endl;
	}
示例#3
0
文件: t4c.c 项目: alphaKAI/t4c
void stream(T4C* t4c, sds url, Parameters* paramsArgument, size_t (*callback)(void*, size_t, size_t, void*)) {
  Parameters* oauthParams = new_parameters();
  genOAuthParams(t4c, oauthParams);
  Parameters* params = new_parameters();
  buildParams(params, oauthParams, paramsArgument);

  sds oauthSignature   = signature(t4c->consumerSecret, t4c->accessTokenSecret, GET, url, params);
  sds encodedSignature = url_encode(oauthSignature);

  add_parameter(oauthParams, sdsnew("oauth_signature"), encodedSignature);
  add_parameter(params,      sdsnew("oauth_signature"), encodedSignature);

  sds authorizeChild = join_parameters(oauthParams, ",");
  sds authorize      = sdscatprintf(sdsempty(), "Authorization: OAuth %s", authorizeChild);

  sds path = join_parameters(params, "&");

  if (DEBUG) {
    printf("----------------------------\n");
    printf("STREAMING API");
    printf("URL: %s\n", url);
    printf("path: %s\n", path);
    printf("authorize: %s\n", authorize);
    printf("----------------------------\n");
  }

  CURL* curl;
  curl = curl_easy_init();

  sds reqURL = sdscatprintf(sdsempty(), "%s?%s", url, path);

  curl_easy_setopt(curl, CURLOPT_URL, reqURL);

  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, authorize);

  curl_easy_setopt(curl, CURLOPT_HEADER, headers);
  curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0);
  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, callback);
  curl_easy_setopt(curl, CURLOPT_TIMEOUT, 0);

  curl_easy_perform(curl);
  curl_easy_cleanup(curl);

  sdsfree(oauthSignature);
  sdsfree(encodedSignature);
  sdsfree(reqURL);
  sdsfree(url);
  sdsfree(path);
  sdsfree(authorize);
  sdsfree(authorizeChild);

  free_parameters(oauthParams);
}
示例#4
0
文件: t4c.c 项目: alphaKAI/t4c
static void buildParams(Parameters* params, Parameters* oauthParams, Parameters* additionalParam) {
  for (Node* thisNode = oauthParams->firstNode; thisNode != NULL; thisNode = thisNode->next) {
    add_parameter(params, thisNode->value->key, thisNode->value->value);
  }

  if (additionalParam != NULL && !is_parameters_empty(additionalParam)) {
    Parameters* adParams = additionalParam;

    for (Node* thisNode = adParams->firstNode; thisNode != NULL; thisNode = thisNode->next) {
      add_parameter(params, thisNode->value->key, url_encode(thisNode->value->value));
    }
  }
}
示例#5
0
文件: Delay.cpp 项目: spearse/FSOM
Delay::Delay(dspCreationStruct data):
	DSPEffect(data),
	m_delayUnitL(44100*10),
	m_delayUnitR(44100*10)
{
	set_effect_name("Delay");
	set_meta(get_tutId(),"link to html");
	add_parameter("Delay Time",0.01,10.0,1.0);
// 	get_parameter("Delay Time")->set_meta("GuiHint","soCustomFader");
	add_parameter("Delay Volume",0.01,1,0.9);
// 	get_parameter("Delay Volume")->set_meta("GuiHint","soCustomFader");
	set_meta(get_tutId(),"learning/gaintree.xml");
	set_implementation();

	data.attatchedRegion->set_extension(44100*15);
}
示例#6
0
文件: Model.hpp 项目: greatlse/ecell4
 void add_parameters(const std::vector<Species>& params)
 {
     for (std::vector<Species>::const_iterator i(params.begin());
         i != params.end(); ++i)
     {
         add_parameter(*i);
     }
 }
示例#7
0
void dds::sub::TQuery<DELEGATE>::parameters(
    const FWIterator& begin,
    const FWIterator end)
{
    ISOCPP_REPORT_STACK_DDS_BEGIN(*this);

    for (FWIterator it = begin; it != end; ++it) {
        add_parameter(*it);
    }
}
示例#8
0
	// Argument parsing
	void add_all_parameters(ParamSource& args) {
		// first parameter is the graph
		graph = args.get_matrix_argument();
		// then come the optional parameters
		while (!args.end()) {
			string key = args.get_parameter_name();
			normalize_key(key);
			add_parameter(key, args);
		}
	}
void Sip_Header_Value_Proxy_Authenticate::init(const std::string& build_from, const bool &authMethodPresent)
{
    if( authMethodPresent )
    {
        size_t pos = build_from.find_first_not_of(" \t\r\n");
        size_t last = build_from.find_first_of(" \t\r\n", pos);

        if( last != std::string::npos )
        {
            _auth_method = build_from.substr( pos, last - pos );
            add_parameter( new Sip_Header_Parameter( build_from.substr( last )));
        }
    }
    else
    {
        if(!build_from.empty())
            add_parameter(new Sip_Header_Parameter(build_from));
    }
}
示例#10
0
文件: Pan.cpp 项目: spearse/FSOM
Pan::Pan(dspCreationStruct data):

	DSPEffect(data)
{
	set_effect_name("Pan");
	add_parameter("Pan",-1.0f,1.0,0); 
	set_meta(get_tutId(),"learning/pantree.xml");
	get_parameter("Pan")->set_meta("GuiHint","soCustomFader");
	set_implementation();

}
示例#11
0
void ParameterSet::add_parameters(ParameterSet &params, bool replace_existing)
{
    for (unsigned int i = 0; i < params.size(); i++)
    {
        EParameter *param = params.get_parameter(i);
        if (param != nullptr)
            add_parameter(*param, replace_existing);
        else
            LOG(WARNING) << __FILE__ << "(" << __LINE__ << ") : Null pointer";
    }
}
示例#12
0
文件: Reverb.cpp 项目: spearse/FSOM
Reverb::Reverb(dspCreationStruct data):
    DSPEffect(data)
{
    set_effect_name("Reverb");

    add_parameter("Roomsize",0,1,0.5);
    get_parameter("Roomsize")->set_meta("GuiHint","soCustomFader");

    add_parameter("Damping",0,1,0.5);
    get_parameter("Damping")->set_meta("GuiHint","soCustomFader");

    add_parameter("Reverb Amount",0,1,0.8);
    get_parameter("Reverb Amount")->set_meta("GuiHint","soCustomFader");

//  add_parameter("Freeze Amount",0,1,0.1);
    set_implementation();

    data.attatchedRegion->set_extension(44100*10);

}
示例#13
0
文件: Fade.cpp 项目: spearse/FSOM
Fade::Fade(dspCreationStruct data):
	DSPEffect(data), m_currentAmp(0.0)
{
  m_duration = data.attatchedRegion->get_duration();
  set_effect_name("Fade");

  set_meta(get_tutId(),"link to html");
  
  add_parameter("Fade In Time(ms)",10,m_duration/44.1,1000.0);
  get_parameter("Fade In Time(ms)")->set_meta("GuiHint","soCustomFader");
  
  add_parameter("Fade Out Time(ms)",10,m_duration/44.1,1000.0);
  get_parameter("Fade Out Time(ms)")->set_meta("GuiHint","soCustomFader");
    
   m_fadeUnit.add_breakpoint(TVPair(0, 0));
   m_fadeUnit.add_breakpoint(TVPair(get_parameter("Fade In Time(ms)")->get_value()*44.1, 1.0));
   m_fadeUnit.add_breakpoint(TVPair(get_parameter("Fade Out Time(ms)")->get_value()*44.10, 1.0));
   m_fadeUnit.add_breakpoint(TVPair(m_duration, 0));
   
   set_implementation();
}
示例#14
0
ParameterSet::ParameterSet(ParameterSet &params)
{
    for (unsigned int i = 0; i<params.size(); i++)
    {
        EParameter *p = params.get_parameter(i);
        if (p != nullptr)
            add_parameter(*p, true);
        else
            LOG(WARNING) << __FILE__ << "(" << __LINE__ << ") : Null pointer";
        delete p;
    }
}
示例#15
0
文件: program.c 项目: basecq/q2dos
/**
 * Add a new unnamed constant to the parameter list.
 * \param paramList - the parameter list
 * \param values - four float values
 * \return index of the new parameter.
 */
GLint
_mesa_add_unnamed_constant(struct program_parameter_list *paramList,
                           const GLfloat values[4])
{
   /* generate a new dummy name */
   static GLuint n = 0;
   char name[20];
   _mesa_sprintf(name, "constant%d", n);
   n++;
   /* store it */
   return add_parameter(paramList, name, values, CONSTANT);
}
示例#16
0
AsymmetricDelay::AsymmetricDelay(dspCreationStruct data):
  DSPEffect(data),
  m_delayUnitL(44100*10),
  m_delayUnitR(44100*10)
  {
    set_effect_name("AsymmetricDelay");
    set_meta(get_tutId(),"link to html");
    
    add_parameter("First Delay Time",0,10,1);
    get_parameter("First Delay Time")->set_meta("GuiHint","soCustomFader");
    
    add_parameter("First Delay Volume",0,1,0.5);
    get_parameter("First Delay Volume")->set_meta("GuiHint","soCustomFader");
    
    add_parameter("Second Delay Time",0,10,3);
    get_parameter("Second Delay Time")->set_meta("GuiHint","soCustomFader");
    
    add_parameter("Second Delay Volume",0,1,0.5);
    get_parameter("Second Delay Volume")->set_meta("GuiHint","soCustomFader");
    
    add_parameter("Third Delay Time",0,10,5);
    get_parameter("Third Delay Time")->set_meta("GuiHint","soCustomFader");
    
    add_parameter("Third Delay Volume",0,1,0.5);
    get_parameter("Third Delay Volume")->set_meta("GuiHint","soCustomFader");
    data.attatchedRegion->set_extension(44100*15);
    
 
    
  
    set_implementation();
    set_implementation();
  
}
示例#17
0
dds::sub::TQuery<DELEGATE>::TQuery(
    const dds::sub::AnyDataReader& dr,
    const std::string& expression,
    const FWIterator& params_begin,
    const FWIterator& params_end) :
        dds::core::Reference<DELEGATE>(new DELEGATE(AnyDataReader(dr), expression))
{
    ISOCPP_REPORT_STACK_DDS_BEGIN(dr);

    for (FWIterator it = params_begin; it != params_end; ++it) {
        add_parameter(*it);
    }
}
示例#18
0
void
TopologyModule::Add_P_PFunction::execute( SLIInterpreter* i ) const
{
  i->assert_stack_load( 2 );

  ParameterDatum param1 = getValue< ParameterDatum >( i->OStack.pick( 1 ) );
  ParameterDatum param2 = getValue< ParameterDatum >( i->OStack.pick( 0 ) );

  ParameterDatum newparam = add_parameter( param1, param2 );

  i->OStack.pop( 2 );
  i->OStack.push( newparam );
  i->EStack.pop();
}
示例#19
0
文件: Reverb.cpp 项目: spearse/FSOM
SimpleReverb::SimpleReverb(dspCreationStruct data):
    DSPEffect(data)
{
    set_effect_name("SimpleReverb");
    add_parameter("Roomsize",0,1,0.5);

    set_meta(get_tutId(),"link to html");
    get_parameter("Roomsize")->set_meta("GuiHint","soCustomFader");

    set_implementation();

    data.attatchedRegion->set_extension(44100*10);

}
示例#20
0
文件: program.c 项目: basecq/q2dos
/**
 * Add a new state reference to the parameter list.
 * \param paramList - the parameter list
 * \param state     - an array of 6 state tokens
 *
 * \return index of the new parameter.
 */
GLint
_mesa_add_state_reference(struct program_parameter_list *paramList,
                          GLint *stateTokens)
{
   /* XXX Should we parse <stateString> here and produce the parameter's
    * list of STATE_* tokens here, or in the parser?
    */
   GLint a, idx;

   idx = add_parameter(paramList, "Some State", NULL, STATE);
	
   for (a=0; a<6; a++)
      paramList->Parameters[idx].StateIndexes[a] = (enum state_index) stateTokens[a];

   return idx;
}
示例#21
0
int parse_one_parameter ( char *buffer)
{
     char name[MAXPARAMLINELENGTH+1];
     char data[MAXPARAMLINELENGTH+1];
     int i, j, k, l;
     int n, d;

     k = -1;
     j = 0;
     l = strlen ( buffer );
     /** scan for a equals sign. **/
     for ( i = 0; i < l; ++i )
     {
	  /* j records whether or not we have found a nonwhitespace
	    character. */
	  j += (buffer[i] != ' ' && buffer[i] != '\t' && buffer[i] != '\n');
	  if ( buffer[i] == '=' )
	  {
	       k = i;
	       /* copy the name part. */
	       strncpy ( name, buffer, k );
	       name[k] = 0;
	       /* copy the value part. */
	       strcpy ( data, buffer+k+1 );
	       break;
	  }
     }

     /* if we found no '=', return an error unless the line was
	completely blank. */
     if ( k == -1 )
	  return !!j;

     /* trim leading and trailing whitespace. */
     n = trim_string ( name );
     d = trim_string ( data );

     /** if either section is blank, return an error, otherwise add
       the pair as a parameter. **/
     if ( n == 0 || d == 0 )
	  return 1;
     else
	  add_parameter ( name, data, PARAM_COPY_NAME|PARAM_COPY_VALUE );
     return 0;
}
示例#22
0
文件: t4c.c 项目: alphaKAI/t4c
static void genOAuthParams(T4C* t4c, Parameters* params) {
  time_t now = time(NULL);
  char*  now_str = MALLOC_TS(char, sizeof(now));
  sprintf(now_str, "%d", (int)now);

  add_parameter(params, sdsnew("oauth_consumer_key"),     t4c->consumerKey);
  add_parameter(params, sdsnew("oauth_nonce"),            sdsnew(now_str));
  add_parameter(params, sdsnew("oauth_signature_method"), sdsnew("HMAC-SHA1"));
  add_parameter(params, sdsnew("oauth_timestamp"),        sdsnew(now_str));
  add_parameter(params, sdsnew("oauth_token"),            t4c->accessToken);
  add_parameter(params, sdsnew("oauth_version"),          sdsnew("1.0"));

  free(now_str);
}
示例#23
0
void *
ys_load_properties(const char *name)
{
    FILE *file;
    parameters_t *p;
    char buf[BUFSIZ];

    p = (parameters_t*) calloc(1, sizeof(parameters_t));
    if (p == 0) {
        perror("calloc");
        fprintf(stderr, "Failed to allocate memory\n");
        return 0;
    }
    p->n = p->allocated = 0;
    p->names = p->values = 0;

    file = fopen(name, "r");
    if (file == 0) {
        perror("fopen");
        fprintf(stderr, "Unable to open file %s\n", name);
        return p;
    }
    if (Ys_debug) {
        printf("opened parameter file %s\n", name);
    }

    while (fgets(buf, sizeof buf, file) != 0) {
        char *n, *v;
        if (*buf == '#')
            continue;
        n = strtok(buf, "=");
        v = strtok(0, "\n");
        if (n == 0 || v == 0)
            continue;
        add_parameter(p, n, v);
    }
    fclose(file);
    return p;
}
_XShaderWaterParameterHandler::_XShaderWaterParameterHandler()
{
	id = 0;
	add_parameter(p_fStrength,		"Noise strength",			dtFloat);
	add_parameter(p_bDisplace,		"Toggle displacement",		dtBool);		
	add_parameter(p_bSmooth,		"Smooth heightmap",			dtBool);	
	add_parameter(p_bReflRefrStrength,"Reflection/Refraction strength",		dtFloat);
	add_parameter(p_iOctaves,		"Octaves",					dtInt);
	add_parameter(p_fScale,			"Noise scale",				dtFloat);
	add_parameter(p_fFalloff,		"Noise falloff",			dtFloat);
	add_parameter(p_fAnimspeed,		"Animation speed",			dtFloat);
	add_parameter(p_fTimemulti,		"Animation multi",			dtFloat);
	add_parameter(p_bPaused,		"Pause animation",			dtBool);	
	add_parameter(p_bDisplayTargets,"Display rendertargets(D)",	dtBool);		
	add_parameter(p_fSunPosAlpha,	"Sun location horizontal",	dtFloat);
	add_parameter(p_fSunPosTheta,	"Sun location vertical",	dtFloat);		
	add_parameter(p_fSunShininess,	"Sun shininess",			dtFloat);
	add_parameter(p_fSunStrength,	"Sun strength",				dtFloat);		
	add_parameter(p_bAsPoints,		"Render as points",			dtBool);	
	add_parameter(p_fLODbias,		"Mipmap LOD Bias",			dtFloat);		
	add_parameter(p_fElevation,		"Projector elevation",		dtFloat);
	add_parameter(p_fWaterColourR,	"water colour Red",			dtFloat);
	add_parameter(p_fWaterColourG,	"water colour Green",		dtFloat);
	add_parameter(p_fWaterColourB,	"water colour Blue",		dtFloat);
	add_parameter(p_bDrawDuckie,	"Render Duckie",		dtBool);		
	add_parameter(p_bDrawIsland,	"Render Island",		dtBool);		
	add_parameter(p_bDiffuseRefl,	"Diffuse sky reflection",	dtBool);
}
示例#25
0
文件: program.c 项目: basecq/q2dos
/**
 * Add a new unnamed constant to the parameter list.
 * \param paramList - the parameter list
 * \param values - four float values
 * \return index of the new parameter.
 */
GLint
_mesa_add_named_constant(struct program_parameter_list *paramList,
                         const char *name, const GLfloat values[4])
{
   return add_parameter(paramList, name, values, CONSTANT);
}
示例#26
0
文件: program.c 项目: basecq/q2dos
/**
 * Add a new named program parameter (Ex: NV_fragment_program DEFINE statement)
 * \return index of the new entry in the parameter list
 */
GLint
_mesa_add_named_parameter(struct program_parameter_list *paramList,
                          const char *name, const GLfloat values[4])
{
   return add_parameter(paramList, name, values, NAMED_PARAMETER);
}
示例#27
0
文件: t4c.c 项目: alphaKAI/t4c
sds request(T4C* t4c, METHOD method, sds endPoint, Parameters* paramsArgument) {
  sds result;

  Parameters* oauthParams = new_parameters();
  genOAuthParams(t4c, oauthParams);
  Parameters* params = new_parameters();
  buildParams(params, oauthParams, paramsArgument);

  sds url = sdscatprintf(sdsempty(), "%s%s", baseUrl, endPoint);
  sds oauthSignature   = signature(t4c->consumerSecret, t4c->accessTokenSecret, method, url, params);
  sds encodedSignature = url_encode(oauthSignature);

  add_parameter(oauthParams, sdsnew("oauth_signature"), encodedSignature);
  add_parameter(params,     sdsnew("oauth_signature"),  encodedSignature);

  sds authorizeChild = join_parameters(oauthParams, ",");
  sds authorize      = sdscatprintf(sdsempty(), "Authorization: OAuth %s", authorizeChild);

  sds path = join_parameters(params, "&");

  if (DEBUG) {
    printf("----------------------------\n");
    printf("URL: %s\n", url);
    printf("endPoint: %s\n", endPoint);
    printf("path: %s\n", path);
    printf("authorize: %s\n", authorize);
    printf("----------------------------\n");
  }

  CURL* curl;
  curl = curl_easy_init();

  sds reqURL;

  if (method == GET) {
    reqURL = sdscatprintf(sdsempty(), "%s?%s", url, path);
    curl_easy_setopt(curl, CURLOPT_URL, reqURL);
  } else if (method == POST) {
    curl_easy_setopt(curl, CURLOPT_POST, 1);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDS, path);
    curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, sdslen(path));
    curl_easy_setopt(curl, CURLOPT_URL, url);
  }

  struct curl_slist *headers = NULL;
  headers = curl_slist_append(headers, authorize);

  curl_easy_setopt(curl, CURLOPT_HEADER, headers);
  curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_result_stringlize_callback);
  curl_easy_setopt(curl, CURLOPT_WRITEDATA, (void*)&result);

  curl_easy_perform(curl);
  curl_easy_cleanup(curl);

  sdsfree(oauthSignature);
  sdsfree(encodedSignature);
  sdsfree(reqURL);
  sdsfree(url);
  sdsfree(path);
  sdsfree(authorize);
  sdsfree(authorizeChild);
  free_parameters(oauthParams);

  return result;
}