コード例 #1
0
ファイル: ToneProducer.cpp プロジェクト: ModeenF/haiku
// utility - build the ToneProducer's parameter web
static BParameterWeb* make_parameter_web()
{
	FPRINTF(stderr, "make_parameter_web() called\n");

	BParameterWeb* web = new BParameterWeb;
	BParameterGroup* mainGroup = web->MakeGroup("Tone Generator Parameters");

	BParameterGroup* group = mainGroup->MakeGroup("Frequency");
	BParameter* nullParam = group->MakeNullParameter(FREQUENCY_NULL_PARAM, B_MEDIA_NO_TYPE, "Frequency", B_GENERIC);
	BContinuousParameter* param = group->MakeContinuousParameter(FREQUENCY_PARAM, B_MEDIA_NO_TYPE, "", B_GAIN, "Hz", 0, 2500, 0.1);
	nullParam->AddOutput(param);
	param->AddInput(nullParam);

	group = mainGroup->MakeGroup("Amplitude");
	nullParam = group->MakeNullParameter(GAIN_NULL_PARAM, B_MEDIA_NO_TYPE, "Amplitude", B_GENERIC);
	param = group->MakeContinuousParameter(GAIN_PARAM, B_MEDIA_NO_TYPE, "", B_GAIN, "", 0, 1, 0.01);
	nullParam->AddOutput(param);
	param->AddInput(nullParam);

	group = mainGroup->MakeGroup("Waveform");
	nullParam = group->MakeNullParameter(WAVEFORM_NULL_PARAM, B_MEDIA_NO_TYPE, "Waveform", B_GENERIC);
	BDiscreteParameter* waveParam = group->MakeDiscreteParameter(WAVEFORM_PARAM, B_MEDIA_NO_TYPE, "", B_GENERIC);
	waveParam->AddItem(SINE_WAVE, "Sine wave");
	waveParam->AddItem(TRIANGLE_WAVE, "Triangle");
	waveParam->AddItem(SAWTOOTH_WAVE, "Sawtooth");
	nullParam->AddOutput(waveParam);
	waveParam->AddInput(nullParam);

	return web;
}
コード例 #2
0
ファイル: LoggingConsumer.cpp プロジェクト: mariuz/haiku
// build the LoggingConsumer's BParameterWeb
static BParameterWeb* build_parameter_web()
{
	BParameterWeb* web = new BParameterWeb;

	BParameterGroup* mainGroup = web->MakeGroup("LoggingConsumer Parameters");
	BParameterGroup* group = mainGroup->MakeGroup("Latency control");
	BParameter* nullParam = group->MakeNullParameter(INPUT_NULL_PARAM, B_MEDIA_NO_TYPE, "Latency", B_GENERIC);
	BParameter* latencyParam = group->MakeContinuousParameter(LATENCY_PARAM, B_MEDIA_NO_TYPE, "",
		B_GAIN, "ms", 5, 100, 5);
	nullParam->AddOutput(latencyParam);
	latencyParam->AddInput(nullParam);

	group = mainGroup->MakeGroup("CPU percentage");
	nullParam = group->MakeNullParameter(CPU_NULL_PARAM, B_MEDIA_NO_TYPE, "CPU spin percentage", B_GENERIC);
	BContinuousParameter* cpuParam = group->MakeContinuousParameter(CPU_SPIN_PARAM, B_MEDIA_NO_TYPE, "",
		B_GAIN, "percent", 5, 80, 5);
	nullParam->AddOutput(cpuParam);
	cpuParam->AddInput(nullParam);

	group = mainGroup->MakeGroup("Priority");
	nullParam = group->MakeNullParameter(PRIO_NULL_PARAM, B_MEDIA_NO_TYPE, "Thread priority", B_GENERIC);
	BDiscreteParameter* prioParam = group->MakeDiscreteParameter(PRIORITY_PARAM, B_MEDIA_NO_TYPE, "", B_GENERIC);
	prioParam->AddItem(5, "B_LOW_PRIORITY");
	prioParam->AddItem(10, "B_NORMAL_PRIORITY");
	prioParam->AddItem(15, "B_DISPLAY_PRIORITY");
	prioParam->AddItem(20, "B_URGENT_DISPLAY_PRIORITY");
	prioParam->AddItem(100, "B_REAL_TIME_DISPLAY_PRIORITY");
	prioParam->AddItem(110, "B_URGENT_PRIORITY");
	prioParam->AddItem(120, "B_REAL_TIME_PRIORITY");

	return web;
}
コード例 #3
0
void
EqualizerNode::InitParameterWeb(void)
{
    fWeb = new BParameterWeb();

    BParameterGroup* fParamGroup = fWeb->MakeGroup("EqualizerNode Parameters");
    BParameterGroup* fFControlGroup = fParamGroup->MakeGroup("FilterControl");

    fFControlGroup->MakeDiscreteParameter(P_MUTE,B_MEDIA_NO_TYPE,"Mute",
                                          B_ENABLE);
    fFControlGroup->MakeDiscreteParameter(P_BYPASS,B_MEDIA_NO_TYPE,"ByPass",
                                          B_ENABLE);

    BNullParameter* label;
    BParameterGroup* group;
    BContinuousParameter* value;

    group = fParamGroup->MakeGroup("Pre Amp");
    label = group->MakeNullParameter(P_PREAMP_LABEL, B_MEDIA_NO_TYPE, "Pre Amp",
                                     B_GENERIC);
    value = group->MakeContinuousParameter(P_PREAMP, B_MEDIA_NO_TYPE, "",
                                           B_GAIN, "dB", -8.0, 8.0, 0.1);
    label->AddOutput(value);
    value->AddInput(label);

    for (int i = 0; i < fEqualizer.BandCount(); i++) {
        char freq[32];
        sprintf(freq,"%gHz",fEqualizer.BandFrequency(i));
        group = fParamGroup->MakeGroup(freq);
        label = group->MakeNullParameter(P_BAND_LABELS + i, B_MEDIA_NO_TYPE,
                                         freq, B_GENERIC);
        value = group->MakeContinuousParameter(P_BANDS + i, B_MEDIA_NO_TYPE,
                                               "", B_GAIN, "dB", -16.0, 16.0, 0.1);
        label->AddOutput(value);
        value->AddInput(label);
    }

    SetParameterWeb(fWeb);
}
コード例 #4
0
// protected:
BParameterWeb * AbstractFileInterfaceNode::MakeParameterWeb(void)
{
	CALLED();
	
	BParameterWeb * web = new BParameterWeb();
	BParameterGroup * mainGroup = web->MakeGroup("AbstractFileInterfaceNode Parameters");

	// these three are related:
	// DEFAULT_CHUNK_SIZE_PARAM = 
	// DEFAULT_BIT_RATE_PARAM / 1024 * DEFAULT_BUFFER_PERIOD_PARAM * 1000
	BParameterGroup * chunkSizeGroup = mainGroup->MakeGroup("Chunk Size Group");
	BContinuousParameter * chunkSizeParameter
	   = chunkSizeGroup->MakeContinuousParameter(
	     DEFAULT_CHUNK_SIZE_PARAM, B_MEDIA_MULTISTREAM,
		 "Chunk Size", B_GAIN, "bytes", 1024, 32*1024, 512);
	chunkSizeParameter->SetResponse(BContinuousParameter::B_LINEAR,1,0);
	chunkSizeParameter->SetValue(&fDefaultChunkSizeParam,sizeof(fDefaultChunkSizeParam),0);
	
	BParameterGroup * bitRateGroup = mainGroup->MakeGroup("Bit Rate Group");
	BContinuousParameter * bitRateParameter
	   = bitRateGroup->MakeContinuousParameter(
	     DEFAULT_BIT_RATE_PARAM, B_MEDIA_MULTISTREAM,
	     "Bit Rate", B_GAIN, "kbits/sec", 1, 320000, 1);
	bitRateParameter->SetResponse(BContinuousParameter::B_LINEAR,.001,0);
	bitRateParameter->SetValue(&fDefaultBitRateParam,sizeof(fDefaultBitRateParam),0);
	
	BParameterGroup * bufferPeriodGroup = mainGroup->MakeGroup("Buffer Period Group");
	BContinuousParameter * bufferPeriodParameter
	   = bufferPeriodGroup->MakeContinuousParameter(
	     DEFAULT_BUFFER_PERIOD_PARAM, B_MEDIA_MULTISTREAM,
	     "Buffer Period", B_GAIN, "ms", 1, 10000, 1);
	bufferPeriodParameter->SetResponse(BContinuousParameter::B_LINEAR,1,0);
	bufferPeriodParameter->SetValue(&fDefaultBufferPeriodParam,sizeof(fDefaultBufferPeriodParam),0);
	
	return web;
}
コード例 #5
0
ファイル: FlangerNode.cpp プロジェクト: DonCN/haiku
// create and register a parameter web
void FlangerNode::initParameterWeb() {
	BParameterWeb* pWeb = new BParameterWeb();
	BParameterGroup* pTopGroup = pWeb->MakeGroup("FlangerNode Parameters");

	BNullParameter* label;
	BContinuousParameter* value;
	BParameterGroup* g;

	// mix ratio
	g = pTopGroup->MakeGroup("Mix ratio");
	label = g->MakeNullParameter(
		P_MIX_RATIO_LABEL,
		B_MEDIA_NO_TYPE,
		"Mix ratio",
		B_GENERIC);

	value = g->MakeContinuousParameter(
		P_MIX_RATIO,
		B_MEDIA_NO_TYPE,
		"",
		B_GAIN, "", 0.0, 1.0, 0.05);
	label->AddOutput(value);
	value->AddInput(label);

	// sweep rate
	g = pTopGroup->MakeGroup("Sweep rate");
	label = g->MakeNullParameter(
		P_SWEEP_RATE_LABEL,
		B_MEDIA_NO_TYPE,
		"Sweep rate",
		B_GENERIC);

	value = g->MakeContinuousParameter(
		P_SWEEP_RATE,
		B_MEDIA_NO_TYPE,
		"",
		B_GAIN, "Hz", 0.01, 10.0, 0.01);
	label->AddOutput(value);
	value->AddInput(label);

	// sweep range: minimum delay
	g = pTopGroup->MakeGroup("Delay");
	label = g->MakeNullParameter(
		P_DELAY_LABEL,
		B_MEDIA_NO_TYPE,
		"Delay",
		B_GENERIC);

	value = g->MakeContinuousParameter(
		P_DELAY,
		B_MEDIA_NO_TYPE,
		"",
		B_GAIN, "ms", 0.1, s_fMaxDelay/2.0, 0.1);
	label->AddOutput(value);
	value->AddInput(label);

	// sweep range: maximum
	g = pTopGroup->MakeGroup("Depth");
	label = g->MakeNullParameter(
		P_DEPTH_LABEL,
		B_MEDIA_NO_TYPE,
		"Depth",
		B_GENERIC);

	value = g->MakeContinuousParameter(
		P_DEPTH,
		B_MEDIA_NO_TYPE,
		"",
		B_GAIN, "ms", 1.0, s_fMaxDelay/4.0, 0.1);
	label->AddOutput(value);
	value->AddInput(label);

	// feedback
	g = pTopGroup->MakeGroup("Feedback");
	label = g->MakeNullParameter(
		P_FEEDBACK_LABEL,
		B_MEDIA_NO_TYPE,
		"Feedback",
		B_GENERIC);

	value = g->MakeContinuousParameter(
		P_FEEDBACK,
		B_MEDIA_NO_TYPE,
		"",
		B_GAIN, "", 0.0, 1.0, 0.01);
	label->AddOutput(value);
	value->AddInput(label);

	// * Install parameter web
	SetParameterWeb(pWeb);
}