Beispiel #1
0
void open_output_streams ( void )
{
     int i;
     char *fn;
     char *basename;

     basename = get_parameter ( "output.basename" );
     
     fn = (char *)malloc ( strlen(basename)+50 );

     for ( i = 0; i < output_stream_count; ++i )
     {
          strcpy ( fn, basename );
          strcat ( fn, streams[i].ext );
          streams[i].f = fopen ( fn, streams[i].mode );
          if ( streams[i].f == NULL )
          {
	       error ( E_ERROR, "can't open output file \"%s\".", fn );
          }
          else
          {
               streams[i].valid = 1;
	       if ( streams[i].buffer )
		    fputs ( streams[i].buffer, streams[i].f );
	       FREE ( streams[i].buffer );
	       streams[i].buffer = NULL;
          }
     }

     global_basename = (char *)malloc ( strlen(basename)+1 );
     strcpy ( global_basename, basename );

     set_detail_level ( atoi ( get_parameter ( "output.detail" ) ) );
}
Beispiel #2
0
void Fade::process(float** input, float** output, int frameSize, int channels) { 
  
  SamplePosition samplesRead;
   
  fsom::Session& sess = fsom::Engine::get_instance().get_active_session();
  
  if(sess.get_preview_state() == false){
      samplesRead = get_creation_struct().attatchedRegion->get_sample_position();
      
  }else{
      samplesRead = sess.get_previed_playhead_value(); 
  }
 // fsom::DebugStream << samplesRead <<std::endl;
  if(!bypass_active()){
       m_fadeUnit.get_pair(1).t_ = get_parameter("Fade In Time(ms)")->get_value()*44.1;
       m_fadeUnit.get_pair(2).t_ = m_duration - (get_parameter("Fade Out Time(ms)")->get_value()*44.1);
      for(int n = 0; n < frameSize; ++n){ 
	
	    m_currentAmp = m_fadeUnit.get_value(samplesRead);
	    
	    output[0][n] = input[0][n] * m_currentAmp;     
	    output[1][n] = input[1][n] * m_currentAmp;
	    
	    samplesRead++;
      }
      
  }else{
    output[0] = input[0];
    output[1] = input[1];
  }
  
}
Beispiel #3
0
void Reverb::process(float** input, float** output, int frameSize, int channels) {
// 	    m_revUnit.

    SamplePosition samplesRead;

    Session& sess = fsom::Engine::get_instance().get_active_session();

    if(sess.get_preview_state() == false) {
        samplesRead = get_creation_struct().attatchedRegion->get_sample_position();

    } else {
        samplesRead = sess.get_previed_playhead_value();
    }

    if(!bypass_active()) {
        m_revUnit.setdamp(get_parameter("Damping")->get_value());
        m_revUnit.setdry(1.0f -  get_parameter("Reverb Amount")->get_value());
        m_revUnit.setwet(get_parameter("Reverb Amount")->get_value());
        m_revUnit.setroomsize(get_parameter("Roomsize")->get_value());

        //  m_revUnit.setmode(get_parameter("Freeze Amount")->get_value());

        m_revUnit.processreplace(input[0],input[1],output[0],output[1],frameSize,1);

        for(ParameterList::const_iterator it = get_parameter_list().begin(); it != get_parameter_list().end(); ++it) {
            (*it).second->tick(samplesRead);
        }

        samplesRead++;

    } else {
        output[0] = input[0];
        output[1] = input[1];
    }
}
Beispiel #4
0
/***********************************************************************
 *             DelNodeRunDLL32W   (ADVPACK.@)
 *
 * Deletes a file or directory, WinMain style.
 *
 * PARAMS
 *   hWnd    [I] Handle to the window used for the display.
 *   hInst   [I] Instance of the process.
 *   cmdline [I] Contains parameters in the order FileOrDirName,Flags.
 *   show    [I] How the window should be shown.
 *
 * RETURNS
 *   Success: S_OK.
 *   Failure: E_FAIL.
 */
HRESULT WINAPI DelNodeRunDLL32W(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT show)
{
    LPWSTR szFilename, szFlags;
    LPWSTR cmdline_copy, cmdline_ptr;
    DWORD dwFlags = 0;
    HRESULT res;

    TRACE("(%p, %p, %s, %i)\n", hWnd, hInst, debugstr_w(cmdline), show);

    cmdline_copy = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(cmdline) + 1) * sizeof(WCHAR));
    cmdline_ptr = cmdline_copy;
    lstrcpyW(cmdline_copy, cmdline);

    /* get the parameters at indexes 0 and 1 respectively */
    szFilename = get_parameter(&cmdline_ptr, ',', TRUE);
    szFlags = get_parameter(&cmdline_ptr, ',', TRUE);

    if (szFlags)
        dwFlags = atolW(szFlags);

    res = DelNodeW(szFilename, dwFlags);

    HeapFree(GetProcessHeap(), 0, cmdline_copy);

    return res;
}
Beispiel #5
0
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();
    


}
Beispiel #6
0
void Chorus::process(float** input, float** output, int frameSize, int channels){
  
    SamplePosition samplesRead;
    
    Session& sess = fsom::Engine::get_instance().get_active_session();
    
    if(sess.get_preview_state() == false){
	samplesRead = get_creation_struct().attatchedRegion->get_sample_position();
	
    }else{
	samplesRead = sess.get_previed_playhead_value(); 
    }  
    
	  
  if(!bypass_active()){
      float depth(0);
      float mix(0);
      float invmix(0);
      float frequency(0);

      m_modPhasor.set_frequency( frequency );
      for(int n = 0; n < frameSize; ++n){
	
	  depth = get_parameter("Depth")->get_value() * 100.0f;
	  mix = get_parameter("Chorus Amount")->get_value();
	  invmix = 1.0f - mix;
	  frequency = get_parameter("Frequency")->get_value() *0.8 ;
	
	  float dt = m_modTable.linear_lookup( m_modPhasor.get_phase()* m_modTable.get_size()) * depth + depth + 1.0f;

	  output[0][n] = input[0][n] * invmix + m_delayUnitL.read_sample(dt) * mix;     
	  output[1][n] = input[1][n] * invmix + m_delayUnitR.read_sample(dt) * mix;
	  
	  m_delayUnitL.write_sample(input[0][n]);
	  m_delayUnitR.write_sample(input[1][n]);
	  
	  
	  m_modPhasor.tick();
	  m_delayUnitL.tick();
	  m_delayUnitR.tick();
	  
	  for(ParameterList::const_iterator it = get_parameter_list().begin(); it != get_parameter_list().end();++it){
	      (*it).second->tick(samplesRead);
	  }
	  
	  samplesRead++;
      }
  }else{
    output[0] = input[0];
    output[1] = input[1];
  }
}
Beispiel #7
0
static
int
parameters_present(IF_NOT_X64(bool x64_in_wow64))
{
    char path[MAX_PATH];
    int retval;

    /* We should do some sanity checking on our parameters,
       to make sure we can really inject in applications.
       War story: When renaming the product from DynamoRIO to SecureCore
       we'd start injecting and then failing to load a dll for all apps.
    */
#ifndef X64
    if (x64_in_wow64) {
        ASSERT(is_wow64_process(NT_CURRENT_PROCESS));
        retval = get_parameter_64(PARAM_STR(DYNAMORIO_VAR_AUTOINJECT), path, MAX_PATH);
    } else
#endif
        retval = get_parameter(PARAM_STR(DYNAMORIO_VAR_AUTOINJECT), path, MAX_PATH);
    if (IS_GET_PARAMETER_SUCCESS(retval)) {
        return 1;
    } else {
        return 0;
    }
}
Beispiel #8
0
static void get_info_refs(char *arg)
{
	const char *service_name = get_parameter("service");
	struct strbuf buf = STRBUF_INIT;

	hdr_nocache();

	if (service_name) {
		const char *argv[] = {NULL /* service name */,
			"--stateless-rpc", "--advertise-refs",
			".", NULL};
		struct rpc_service *svc = select_service(service_name);

		strbuf_addf(&buf, "application/x-git-%s-advertisement",
			svc->name);
		hdr_str(content_type, buf.buf);
		end_headers();

		packet_write(1, "# service=git-%s\n", svc->name);
		packet_flush(1);

		argv[0] = svc->name;
		run_service(argv);

	} else {
		select_getanyfile();
		for_each_namespaced_ref(show_text_ref, &buf);
		send_strbuf("text/plain", &buf);
	}
	strbuf_release(&buf);
}
Beispiel #9
0
void get_file_name (char *name, char *extension)
{
  get_parameter (name);
  add_extension (name, extension);
  if (echo_name)
    printf ("File name : %s.\n", name);
}
Beispiel #10
0
/**
 * Handles a single instruction within the sub-routine
 */
void handle_instruction() {
	// Write out the opcode
	WRITE_SUB_BYTE(opcode);
	INC_SUB_PTR;

	get_token();

	if (OpcodeList[opcode].paramType == OP_IMM_PARAM) {
		get_parameter();

		if (token != NUMBER) {
			printf("Incorrect opcode parameter encountered\n");
			token = ERROR;
			return;
		} 

		// Apply the correct opcode size to the previously stored opcode and save the byte(s)
		if (literal.value.integer <= 0xff) {
			subroutineData[subroutineSize - 1] |= OPSIZE8;
			WRITE_SUB_BYTE(literal.value.integer);
			INC_SUB_PTR;
		} else if (literal.value.integer <= 0xffff) {
			subroutineData[subroutineSize - 1] |= OPSIZE16;
			WRITE_SUB_BYTE(literal.value.integer);
			INC_SUB_PTR;
			WRITE_SUB_BYTE(literal.value.integer >> 8);
			INC_SUB_PTR;

		} else {
Beispiel #11
0
int get_boolean()
{
  char s [80];
  char *pos;

  /* return FALSE if there is no parameter */

  if (! get_parameter (s))
    return (FALSE);

  /* convert string to lower case */

  for (pos = s; *pos != '\0'; pos++)
    *pos = tolower (*pos);

  /* now see what it matches */

  if (! strcmp (s, "0"))
    return (FALSE);
  else if (! strcmp (s, "off"))
    return (FALSE);
  else if (! strcmp (s, "false"))
    return (FALSE);
  else if (! strcmp (s, "no"))
    return (FALSE);
  else
    return (TRUE);
}
Beispiel #12
0
void Pan::process(float** input, float** output, int frameSize, int channels) {
  
    SamplePosition samplesRead;
      
    Session& sess = fsom::Engine::get_instance().get_active_session();
      
    if(sess.get_preview_state() == false){
	  samplesRead = get_creation_struct().attatchedRegion->get_sample_position();
    }else{
	  samplesRead = sess.get_previed_playhead_value(); 
    }
  
    if(!bypass_active()){
	

	assert(channels == 2);

	for(int n = 0; n < frameSize; ++n){
		float val = (get_parameter("Pan")->get_value() +1)*0.5f ;
		output[0][n] = input[0][n] * cos( val * PI/2.0f);
		output[1][n] = input[1][n] * sin( val * PI/2.0f);
		
		for(ParameterList::const_iterator it = get_parameter_list().begin(); it != get_parameter_list().end();++it){
			    (*it).second->tick(samplesRead);
		}
		      
		samplesRead++;
	}
    }else{
	    output[0] = input[0];
	    output[1] = input[1];
    }	  
}
Beispiel #13
0
/***********************************************************************
 *      LaunchINFSectionExW (ADVPACK.@)
 *
 * Installs an INF section with BACKUP/ROLLBACK capabilities.
 *
 * PARAMS
 *   hWnd    [I] Handle to parent window, NULL for desktop.
 *   hInst   [I] Instance of the process.
 *   cmdline [I] Contains parameters in the order INF,section,CAB,flags,reboot.
 *   show    [I] How the window should be shown.
 *
 * RETURNS
 *  Success: ADV_SUCCESS.
 *  Failure: ADV_FAILURE.
 *
 * NOTES
 *  INF - Filename of the INF to launch.
 *  section - INF section to install.
 *  flags - see advpub.h.
 *  reboot - smart reboot behavior
 *    'A' Always reboot.
 *    'I' Reboot if needed (default).
 *    'N' No reboot.
 *
 * BUGS
 *  Doesn't handle the reboot flag.
 */
HRESULT WINAPI LaunchINFSectionExW(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT show)
{
    LPWSTR cmdline_copy, cmdline_ptr;
    LPWSTR flags, ptr;
    CABINFOW cabinfo;
    HRESULT hr;

    TRACE("(%p, %p, %s, %d)\n", hWnd, hInst, debugstr_w(cmdline), show);

    if (!cmdline)
        return ADV_FAILURE;

    cmdline_copy = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(cmdline) + 1) * sizeof(WCHAR));
    cmdline_ptr = cmdline_copy;
    lstrcpyW(cmdline_copy, cmdline);

    cabinfo.pszInf = get_parameter(&cmdline_ptr, ',', TRUE);
    cabinfo.pszSection = get_parameter(&cmdline_ptr, ',', TRUE);
    cabinfo.pszCab = get_parameter(&cmdline_ptr, ',', TRUE);
    *cabinfo.szSrcPath = '\0';

    flags = get_parameter(&cmdline_ptr, ',', TRUE);
    if (flags)
        cabinfo.dwFlags = atolW(flags);

    if (!is_full_path(cabinfo.pszCab) && !is_full_path(cabinfo.pszInf))
    {
        HeapFree(GetProcessHeap(), 0, cmdline_copy);
        return E_INVALIDARG;
    }

    /* get the source path from the cab filename */
    if (cabinfo.pszCab && *cabinfo.pszCab)
    {
        if (!is_full_path(cabinfo.pszCab))
            lstrcpyW(cabinfo.szSrcPath, cabinfo.pszInf);
        else
            lstrcpyW(cabinfo.szSrcPath, cabinfo.pszCab);

        ptr = strrchrW(cabinfo.szSrcPath, '\\');
        *(++ptr) = '\0';
    }

    hr = ExecuteCabW(hWnd, &cabinfo, NULL);
    HeapFree(GetProcessHeap(), 0, cmdline_copy);
    return SUCCEEDED(hr) ? ADV_SUCCESS : ADV_FAILURE;
}
Beispiel #14
0
communication::SubmitTaskResponse
task_manager::submit_task(std::string client_id, int64_t request_id, communication::Task args, int64_t n)
{
    // тут вроде хватать мьютекс не надо
    size_t cur_tasks_size = tasks.size();

    int64_t a = get_parameter(args.a(), cur_tasks_size);
    int64_t b = get_parameter(args.b(), cur_tasks_size);
    int64_t p = get_parameter(args.p(), cur_tasks_size);
    int64_t m = get_parameter(args.m(), cur_tasks_size);

    // если параметр - ошибочный
    communication::SubmitTaskResponse subm_resp;
    if (a == -1 || b == -1 || p == -1 || m == -1)
    {
        subm_resp.set_status(communication::Status::ERROR);
        return subm_resp;
    }

    int64_t task_id = -1;
    {
        std::unique_lock<std::mutex> lock_(task_mutex_);

        tasks.push_back(task(a, b, p, m, n, request_id, client_id));

        task_id = tasks.size() - 1;
    }

//
//     потоки - через  unord map, пока не работает
//    auto it_thr = threads.find(false);
//    if (it_thr != threads.end()) {
//
//        it_thr->second(&task::calculate, &tasks[task_id],
//                       a, b, p, m, n, std::ref(task_mutex_));
//    }
//
//
//     по идее, поток отсоединили, он полетел что-то считать,
//     а мы, не дожидаясь его, отправляем ответ - статус и id.
    std::thread(&task::calculate, &tasks[task_id], std::ref(task_mutex_)).detach();

    // возвращаемый статус и идентификатор - номер позиции в векторе задач
    subm_resp.set_status(communication::Status::OK);
    subm_resp.set_submittedtaskid(task_id);
    return subm_resp;
}
void test_query_string() {
  void* ctx;
  parse_query_string(&ctx, "width=640&height=360&video=bigbunny.ogg");
  const char* width = get_parameter(ctx, "width");
  const char* height = get_parameter(ctx, "height");
  const char* video = get_parameter(ctx, "video");
  if(!strcmp(width,"640")) {
      printf("Querystring width esperado:%s - recebido:%s\n", "640", width);
  }
  if(!strcmp(height,"360")) {
      printf("Querystring height esperado:%s - recebido:%s\n", "360", height);
  }
  if(!strcmp(video,"bigbunny.ogg")) {
      printf("Querystring video esperado:%s - recebido:%s\n", "bigbunny.ogg", video);
  }
  release_context(ctx);
}
Beispiel #16
0
EFFECT_LV2* EFFECT_LV2::clone(void) const
{
  EFFECT_LV2* result = new EFFECT_LV2(plugin_desc);
  for(int n = 0; n < number_of_params(); n++) {
    result->set_parameter(n + 1, get_parameter(n + 1));
  }
  return result;
}
Beispiel #17
0
static VALUE rb_ool_conmin_minimizer_set(int argc, VALUE *argv, VALUE obj)
{
	ool_conmin_minimizer *m;
	ool_conmin_function *F;
	ool_conmin_constraint *C;
	gsl_vector *v;
	ool_conmin_pgrad_parameters Pp;
	ool_conmin_spg_parameters Ps;
  ool_conmin_gencan_parameters Pg;
  void *P;
	Data_Get_Struct(obj, ool_conmin_minimizer, m);
	switch (argc) {
	case 3:
		if (CLASS_OF(argv[0]) != cool_conmin_function) 
			rb_raise(rb_eTypeError, "Wrong argument type 0 (OOL::Conmin::Function expected)");
		if (CLASS_OF(argv[1]) != cool_conmin_constraint) 
			rb_raise(rb_eTypeError, "Wrong argument type 1 (OOL::Conmin::Constraint expected)");
		if (!VECTOR_P(argv[2]))
			rb_raise(rb_eTypeError, "Wrong argument type 2 (GSL::Vector expected)");	
		Data_Get_Struct(argv[0], ool_conmin_function, F);
		Data_Get_Struct(argv[1], ool_conmin_constraint, C);
		Data_Get_Struct(argv[2], gsl_vector, v);
		P = get_parameter(m->type, &Pp, &Ps, &Pg, Qnil);			
		ool_conmin_minimizer_set(m, F, C, v, P);						
		break;
	case 4:
		if (CLASS_OF(argv[0]) != cool_conmin_function) 
			rb_raise(rb_eTypeError, "Wrong argument type 0 (OOL::Conmin::Function expected)");
		if (CLASS_OF(argv[1]) != cool_conmin_constraint) 
			rb_raise(rb_eTypeError, "Wrong argument type 1 (OOL::Conmin::Constraint expected)");
		if (!VECTOR_P(argv[2]))
			rb_raise(rb_eTypeError, "Wrong argument type 2 (GSL::Vector expected)");	
		if (!rb_obj_is_kind_of(argv[3], rb_cArray) && argv[3] != Qnil)
			rb_raise(rb_eTypeError, "Wrong argument type 3 (Array expected)");	
		Data_Get_Struct(argv[0], ool_conmin_function, F);
		Data_Get_Struct(argv[1], ool_conmin_constraint, C);
		Data_Get_Struct(argv[2], gsl_vector, v);
		P = get_parameter(m->type, &Pp, &Ps, &Pg, argv[3]);			
		ool_conmin_minimizer_set(m, F, C, v, P);					
		break;
	default:
		rb_raise(rb_eArgError, "Wrong number of arguments (%d for 3 or 4)", argc);
	}
	return obj;	
}
char *get_breed_parameter ( char *prefix, char *format, ... )
{
     char *param;
     static char pnamebuf[200];
     int len = strlen(prefix);
     va_list ap;

     strcpy ( pnamebuf, prefix );
     va_start ( ap, format );
     vsprintf ( pnamebuf+len, format, ap );
     va_end ( ap );
     
     param = get_parameter ( pnamebuf );
     if ( param == NULL )
          return get_parameter ( pnamebuf+len );
     else
          return param;
}
Beispiel #19
0
/***********************************************************************
 *      LaunchINFSectionW   (ADVPACK.@)
 *
 * Installs an INF section without BACKUP/ROLLBACK capabilities.
 *
 * PARAMS
 *   hWnd    [I] Handle to parent window, NULL for desktop.
 *   hInst   [I] Instance of the process.
 *   cmdline [I] Contains parameters in the order INF,section,flags,reboot.
 *   show    [I] How the window should be shown.
 *
 * RETURNS
 *  Success: ADV_SUCCESS.
 *  Failure: ADV_FAILURE.
 *
 * NOTES
 *  INF - Filename of the INF to launch.
 *  section - INF section to install.
 *  flags - see advpub.h.
 *  reboot - smart reboot behavior
 *    'A' Always reboot.
 *    'I' Reboot if needed (default).
 *    'N' No reboot.
 */
INT WINAPI LaunchINFSectionW(HWND hWnd, HINSTANCE hInst, LPWSTR cmdline, INT show)
{
    ADVInfo info;
    LPWSTR cmdline_copy, cmdline_ptr;
    LPWSTR inf_filename, install_sec;
    LPWSTR str_flags;
    DWORD flags = 0;
    HRESULT hr = S_OK;

    TRACE("(%p, %p, %s, %d)\n", hWnd, hInst, debugstr_w(cmdline), show);

    if (!cmdline)
        return ADV_FAILURE;

    cmdline_copy = HeapAlloc(GetProcessHeap(), 0, (lstrlenW(cmdline) + 1) * sizeof(WCHAR));
    cmdline_ptr = cmdline_copy;
    lstrcpyW(cmdline_copy, cmdline);

    inf_filename = get_parameter(&cmdline_ptr, ',', TRUE);
    install_sec = get_parameter(&cmdline_ptr, ',', TRUE);

    str_flags = get_parameter(&cmdline_ptr, ',', TRUE);
    if (str_flags)
        flags = atolW(str_flags);

    ZeroMemory(&info, sizeof(ADVInfo));

    hr = install_init(inf_filename, install_sec, NULL, flags, &info);
    if (hr != S_OK)
        goto done;

    hr = spapi_install(&info);
    if (hr != S_OK)
        goto done;

    hr = adv_install(&info);

done:
    install_release(&info);
    HeapFree(GetProcessHeap(), 0, cmdline_copy);

    return SUCCEEDED(hr) ? ADV_SUCCESS : ADV_FAILURE;
}
Beispiel #20
0
void Delay::process(float** input, float** output, int frameSize, int channels){
  
	
	SamplePosition samplesRead;
	
	Session& sess = fsom::Engine::get_instance().get_active_session();
	
	if(sess.get_preview_state() == false){
	    samplesRead = get_creation_struct().attatchedRegion->get_sample_position();
	    
	}else{
	    samplesRead = sess.get_previed_playhead_value(); 
	}  
	  
  
	if(!bypass_active()){
  
	  float a,b;
	  for(int n = 0; n < frameSize; ++n){
		  m_delayUnitL.write_sample(input[0][n]);
		  m_delayUnitR.write_sample(input[1][n]);
		  a = input[0][n] + m_delayUnitL.read_sample(get_parameter("Delay Time")->get_value() * 44100);
		  b = input[1][n] + m_delayUnitR.read_sample(get_parameter("Delay Time")->get_value() * 44100);
		  output[0][n]= a;
		  output[1][n]= b;
		  m_delayUnitL.write_sample(b * get_parameter("Delay Volume")->get_value());
		  m_delayUnitR.write_sample(a * get_parameter("Delay Volume")->get_value());
		  m_delayUnitL.tick();
		  m_delayUnitR.tick();
		  
		  for(ParameterList::const_iterator it = get_parameter_list().begin(); it != get_parameter_list().end();++it){
		      (*it).second->tick(samplesRead);
		  }
		  
		  samplesRead++;
	  }
	}else{
	    output[0] = input[0];
	    output[1] = input[1];
	}
	
}
Beispiel #21
0
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);

}
Beispiel #22
0
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();

}
Beispiel #23
0
static VALUE rb_ool_conmin_minimizer_parameters_set(VALUE obj, VALUE params)
{
	ool_conmin_minimizer *m;
	ool_conmin_pgrad_parameters *Pp;
	ool_conmin_spg_parameters *Ps;
	ool_conmin_gencan_parameters *Pg;
	void *P;
	Data_Get_Struct(obj, ool_conmin_minimizer, m);
	P = get_parameter(m->type, Pp, Ps, Pg, params);
	ool_conmin_parameters_set(m, P);
	return params;
}
Beispiel #24
0
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();
}
Beispiel #25
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();
  
}
Beispiel #26
0
int get_integer (int *n)
{
  String s;
  int got_one;     /* did we get a parameter? */

  got_one = get_parameter (s);

  *n = 0;
  if (got_one)
    sscanf (s, "%d", n);

  return (got_one);
}
Beispiel #27
0
int get_real (float *r)
{
  String s;
  int got_one;     /* did we get a parameter? */

  got_one = get_parameter (s);

  *r = 0.0;
  if (got_one)
    sscanf (s, "%f", r);

  return (got_one);
}
Beispiel #28
0
int get_double (double *r)
{
  String s;
  int got_one;     /* did we get a parameter? */

  got_one = get_parameter (s);

  *r = 0.0;
  if (got_one)
    sscanf (s, "%lf", r);

  return (got_one);
}
Beispiel #29
0
/***********************************************************************
 *             RegisterOCX    (ADVPACK.@)
 *
 * Registers an OCX.
 *
 * PARAMS
 *   hWnd    [I] Handle to the window used for the display.
 *   hInst   [I] Instance of the process.
 *   cmdline [I] Contains parameters in the order OCX,flags,param.
 *   show    [I] How the window should be shown.
 *
 * RETURNS
 *   Success: S_OK.
 *   Failure: E_FAIL.
 *
 * NOTES
 *   OCX - Filename of the OCX to register.
 *   flags - Controls the operation of RegisterOCX.
 *    'I' Call DllRegisterServer and DllInstall.
 *    'N' Only call DllInstall.
 *   param - Command line passed to DllInstall.
 */
HRESULT WINAPI RegisterOCX(HWND hWnd, HINSTANCE hInst, LPCSTR cmdline, INT show)
{
    LPWSTR ocx_filename, str_flags, param;
    LPWSTR cmdline_copy, cmdline_ptr;
    UNICODE_STRING cmdlineW;
    HRESULT hr = E_FAIL;
    HMODULE hm = NULL;
    DWORD size;

    TRACE("(%s)\n", debugstr_a(cmdline));

    RtlCreateUnicodeStringFromAsciiz(&cmdlineW, cmdline);

    size = (lstrlenW(cmdlineW.Buffer) + 1) * sizeof(WCHAR);
    cmdline_copy = HeapAlloc(GetProcessHeap(), 0, size);
    cmdline_ptr = cmdline_copy;
    lstrcpyW(cmdline_copy, cmdlineW.Buffer);

    ocx_filename = get_parameter(&cmdline_ptr, ',', TRUE);
    if (!ocx_filename || !*ocx_filename)
        goto done;

    str_flags = get_parameter(&cmdline_ptr, ',', TRUE);
    param = get_parameter(&cmdline_ptr, ',', TRUE);

    hm = LoadLibraryExW(ocx_filename, NULL, LOAD_WITH_ALTERED_SEARCH_PATH);
    if (!hm)
        goto done;

    hr = do_ocx_reg(hm, TRUE, str_flags, param);

done:
    FreeLibrary(hm);
    HeapFree(GetProcessHeap(), 0, cmdline_copy);
    RtlFreeUnicodeString(&cmdlineW);

    return hr;
}
  void reset(){
    const int num_parameters = COMP_EFF_BYPASS; // Warning, reset() doesn't quite work if bypass is handled by faust. (this only happens in the standalone jack version though, which doesn't use reset())
    float parms[num_parameters];

    // Must store parameter values before calling init, since init overwrites them.
    for(int i=0;i<num_parameters;i++)
      parms[i] = get_parameter(i);

    init(fSamplingFreq);

    // Set back.
    for(int i=0;i<num_parameters;i++)
      set_parameter(i,parms[i]);    
  }