예제 #1
0
void SettingsPanel::setLaserPreview3d( LaserPreview3D* laserPreview3D ){
    mLaserPreview3D = laserPreview3D;

    Gwen::Controls::Base* pSlider;
    Gwen::Controls::Base* pCheckBox;
//    Gwen::Controls::Base* pLabel;

    pSlider = addSlider(mLaserCat, getBounds(mLaserCatElements), "Laser Angle", mLaserPreview3D->getLaserAngle(), 0, 90 );
    mLaserCatElements.push_back(pSlider);
    
    
    pCheckBox = addCheckBox(mLaserPreviewCat, getBounds(mLaserPreviewCatElements), "Show Frame", mLaserPreview3D->paramsView.showFrame );
    mLaserPreviewCatElements.push_back(pCheckBox);
    
    pCheckBox = addCheckBox(mLaserPreviewCat, getBounds(mLaserPreviewCatElements), "Show Dots on Gauze", mLaserPreview3D->paramsView.showDotsOnGauze );
    mLaserPreviewCatElements.push_back(pCheckBox);

    pCheckBox = addCheckBox(mLaserPreviewCat, getBounds(mLaserPreviewCatElements), "Show Lines on Gauze", mLaserPreview3D->paramsView.showLinesOnGauze );
    mLaserPreviewCatElements.push_back(pCheckBox);

    pCheckBox = addCheckBox(mLaserPreviewCat, getBounds(mLaserPreviewCatElements), "Show Rays", mLaserPreview3D->paramsView.showRays );
    mLaserPreviewCatElements.push_back(pCheckBox);

    pCheckBox = addCheckBox(mLaserPreviewCat, getBounds(mLaserPreviewCatElements), "Show Fans", mLaserPreview3D->paramsView.showFans );
    mLaserPreviewCatElements.push_back(pCheckBox);
    
    pSlider = addSlider(mLaserPreviewCat, getBounds(mLaserPreviewCatElements), "Fans Intensity", mLaserPreview3D->paramsView.fansIntensity*100.0f, 0, 100 );
    mLaserPreviewCatElements.push_back(pSlider);


    
}
예제 #2
0
DelaySection::DelaySection(String name) : SynthSection(name) {
  static const int TEMPO_DRAG_SENSITIVITY = 150;
  addSlider(frequency_ = new SynthSlider("delay_frequency"));
  frequency_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
  frequency_->setLookAndFeel(TextLookAndFeel::instance());

  addSlider(tempo_ = new SynthSlider("delay_tempo"));
  tempo_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
  tempo_->setStringLookup(mopo::strings::synced_frequencies);
  tempo_->setLookAndFeel(TextLookAndFeel::instance());
  tempo_->setMouseDragSensitivity(TEMPO_DRAG_SENSITIVITY);

  addSlider(sync_ = new TempoSelector("delay_sync"));
  sync_->setSliderStyle(Slider::LinearBar);
  sync_->setTempoSlider(tempo_);
  sync_->setFreeSlider(frequency_);
  sync_->setStringLookup(mopo::strings::freq_sync_styles);

  addSlider(feedback_ = new SynthSlider("delay_feedback"));
  feedback_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
  feedback_->setBipolar();

  addSlider(dry_wet_ = new SynthSlider("delay_dry_wet"));
  dry_wet_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);

  addButton(on_ = new ToggleButton("delay_on"));
  setActivator(on_);
}
예제 #3
0
void ofxSimpleGuiToo::addColorPicker2(string name, float *values, bool useFloat, bool displayInteger){
	if(!config) setup();
	float max = useFloat ? 1 : 255;
	addSlider(name+" r",*values,0,max);
	addSlider(name+" g",*(values+1),0,max);
	addSlider(name+" b",*(values+2),0,max);
	addSlider(name+" a",*(values+3),0,max);
}
예제 #4
0
void ThresholdingFilter::setup() 
{
	GrayscaleFilter::setup();

	addContent("Output", output);
	addSlider("Threshold", settings.threshold, 0, 255);
	addSlider("Max Value", settings.max_value, 0, 255);
	addSlider("Mode", settings.mode, 0, 4);
	addToggle("Use Otsu", settings.use_otsu);
}
예제 #5
0
파일: GuiApp.cpp 프로젝트: nventuro/boids
void GuiApp::setup(void)
{
    ofSetWindowTitle("Controls");

    gui = new ofxDatGui(ofxDatGuiAnchor::TOP_LEFT);

    auto theme = new GuiTheme();
    gui->setTheme(theme);

    gui->addHeader("boids");
    gui->getHeader()->setDraggable(false);

    gui->addFRM(0.1);
    auto fps_toggle = gui->addToggle("cap to 30 FPS");
    fps_toggle->toggleEventCallback = std::bind(&GuiApp::fpsCapToggleEvent, this, std::placeholders::_1);

    gui->addBreak();
    gui->addLabel("boid controls");
    for (const auto &type_boid_pair : Config::boids_by_type) {
        const auto &boid_type = type_boid_pair.first;
        const auto &boid_type_config = type_boid_pair.second;

        auto boid_type_folder = gui->addFolder(BoidMisc::typeToTypename(boid_type));

        auto amount_slider = boid_type_folder->addSlider("amount", 1, 1200);
        amount_slider->sliderEventCallback = std::bind(&GuiApp::boidTypeAmountChanged, this, std::placeholders::_1, boid_type);
        amount_slider->setPrecision(0);
        amount_slider->setValue(boid_type_config.amount);

        auto infl_max_dist_slider = boid_type_folder->addSlider("infl max dist", 1, 120, boid_type_config.infl_max_dist);
        infl_max_dist_slider->sliderEventCallback = std::bind(&GuiApp::boidTypeInflMaxDistChanged, this, std::placeholders::_1, boid_type);

        auto angle_of_view_slider = boid_type_folder->addSlider("angle of view", 10, 180, boid_type_config.angle_of_view);
        angle_of_view_slider->sliderEventCallback = std::bind(&GuiApp::boidTypeAngleOfViewChanged, this, std::placeholders::_1, boid_type);

        auto max_speed_slider = boid_type_folder->addSlider("max speed", 0.5, 10, boid_type_config.max_speed);
        max_speed_slider->sliderEventCallback = std::bind(&GuiApp::boidTypeMaxSpeedChanged, this, std::placeholders::_1, boid_type);

        auto color_picker = boid_type_folder->addColorPicker("color", boid_type_config.graphics.color);
        color_picker->colorPickerEventCallback = std::bind(&GuiApp::boidTypeColorChanged, this, std::placeholders::_1, boid_type);

        auto size_slider = boid_type_folder->addSlider("size", 1, 4);
        size_slider->sliderEventCallback = std::bind(&GuiApp::boidTypeSizeChanged, this, std::placeholders::_1, boid_type);
        size_slider->setPrecision(0);
        size_slider->setValue(boid_type_config.graphics.size); // We need to set this after the precision so that the proper precision is applied

        auto draw_head_toggle = boid_type_folder->addToggle("draw head", boid_type_config.graphics.draw_head);
        draw_head_toggle->toggleEventCallback = std::bind(&GuiApp::boidTypeDrawHeadChanged, this, std::placeholders::_1, boid_type);
    }

    ofBackground(theme->color.guiBackground);

    ofSetFrameRate(60);
}
예제 #6
0
void DkGradient::init() {

	clearAllSliders();

	addSlider(0, Qt::black);
	addSlider(1, Qt::white);
	
	updateGradient();


};
예제 #7
0
DynamicSection::DynamicSection(String name) : SynthSection(name) {
  addSlider(portamento_ = new SynthSlider("portamento"));
  portamento_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);

  addSlider(portamento_type_ = new SynthSlider("portamento_type"));
  portamento_type_->setSliderStyle(Slider::LinearBar);
  portamento_type_->setStringLookup(mopo::strings::off_auto_on);

  addButton(legato_ = new ToggleButton("legato"));
  legato_->setLookAndFeel(TextLookAndFeel::instance());
  legato_->setButtonText("");
}
예제 #8
0
void DkGradient::init() {

    isActiveSliderExisting = false;

    clearAllSliders();

    addSlider(0, Qt::black);
    addSlider(1, Qt::white);

    updateGradient();


};
void PMUICanvasRibbonRenderer::init(int posX, int posY, bool autosize, int width, int height)
{
    PMUICanvasBaseRenderer::init(posX, posY, autosize, width, height);

    gradientImage.load("./gradients/gradient4x_512x160.png");
    numGradients = 4;

    setGlobalSliderHeight(10);
    setGlobalButtonDimension(14);

    { // Brush (basic)
        addSpacer();
        addLabel(STR_BRUSH_BASIC);
        addIntSlider(STR_BRUSH_BASIC_NUMPAINTERS, 1, 100, &numPainters);
        addIntSlider(STR_BRUSH_BASIC_WIDTH, 1, 10, &strokeWidth);
        addSlider(STR_BRUSH_BASIC_SPEED, 1.01f, 100, &speed);
        addToggle(STR_BRUSH_BASIC_ENABLEBOUNCE, &enableBounce);
    }

    { // Brush (advanced)
        addSpacer();
        addLabel(STR_BRUSH_ADVANCED);
        addSlider(STR_BRUSH_ADVANCED_DIVISIONS, 0.001, 4.5, &divisions);
//        addSlider(STR_BRUSH_ADVANCED_EASE, -1.0, 10.0, &ease);
//        addSlider("Ease Randomness",0.0,1.0,&easeRandomness);
//        addIntSlider(STR_BRUSH_ADVANCED_MAXVERT,3, 4000, &pathMaxVertices);
        addSlider("Next Position Delta",0.0,1.0,&nextPositionDelta);
    }

    { // Color mode
        addSpacer();
        addLabel(STR_BRUSH_COLORMODE);

        vector<string> colorModesNames;
        colorModesNames.push_back(STR_BRUSH_COLORMODE_MFIXEDCOLOR);
        colorModesNames.push_back(STR_BRUSH_COLORMODE_MGRSPEED);
        colorModesNames.push_back(STR_BRUSH_COLORMODE_MGREDGES);
        addRadio(STR_BRUSH_COLORMODE_RADIO, colorModesNames, OFX_UI_ORIENTATION_VERTICAL);

        addImageSampler(STR_BRUSH_COLORMODE_GRIMAGE, &gradientImage);
        addIntSlider(STR_BRUSH_COLORMODE_GRID, 1, 4, &gradientId);
        addIntSlider(STR_BRUSH_COLORMODE_GRSPEED, 1, 500, &gradientSpeed);
        addIntSlider(STR_BRUSH_COLORMODE_R, 0, 255, &colorR);
        addIntSlider(STR_BRUSH_COLORMODE_G, 0, 255, &colorG);
        addIntSlider(STR_BRUSH_COLORMODE_B, 0, 255, &colorB);
    }

    if (autosize) autoSizeToFitWidgets();

    loadPreset(selectedPreset);
}
예제 #10
0
파일: vcframe.cpp 프로젝트: speakman/qlc
void VCFrame::slotMenuCallback(int item)
{
	switch (item)
	{
	case KVCMenuAddButton:
		addButton();
		break;
	case KVCMenuAddSlider:
		addSlider();
		break;
	case KVCMenuAddFrame:
		addFrame();
		break;
	case KVCMenuAddXYPad:
		addXYPad();
		break;
	case KVCMenuAddLabel:
		addLabel();
		break;

	default:
		VCWidget::slotMenuCallback(item);
		break;
	}
}
예제 #11
0
FeedbackSection::FeedbackSection(String name) : SynthSection(name) {
    addSlider(transpose_ = new SynthSlider("osc_feedback_transpose"));
    transpose_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
    transpose_->setBipolar();

    addSlider(amount_ = new SynthSlider("osc_feedback_amount"));
    amount_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
    amount_->setBipolar();

    addSlider(tune_ = new SynthSlider("osc_feedback_tune"));
    tune_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
    tune_->setBipolar();

    addSlider(saturation_ = new SynthSlider("filter_saturation"));
    saturation_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
}
void FiducialTrackingFilter::setup() 
{
	GrayscaleFilter::setup();
	fidFinder.detectFinger		= true;
	fidFinder.maxFingerSize		= 25;
	fidFinder.minFingerSize		= 5;
	fidFinder.fingerSensitivity	= 0.05f; //from 0 to 2.0f

	addContent("Output", output);
	addToggle("Detect Fingers", fidFinder.detectFinger);
	addSlider("Min Finger Size", fidFinder.minFingerSize, 0, 50);
	addSlider("Max Finger Size", fidFinder.maxFingerSize, 0, 50);
	addSlider("Finger Sensitivity", fidFinder.fingerSensitivity, 0.0, 2.0);
	
	output.set(0);
}
예제 #13
0
ECPotentiometer::ECPotentiometer(ICNDocument *icnDocument, bool newItem, const char *id)
	: Component(icnDocument, newItem, id ? id : "potentiometer")
{
	m_name = i18n("Potentiometer");
	setSize(-16, -16, 40, 32);

	ECNode *m_p1 = createPin(32, 0, 180, "p1");

	m_sliderProp = 0.0;
	m_resistance = 5000.;

	setup2pinElement(m_r1, createPin(-8, -24, 90, "n1")->pin(), m_p1->pin());
	setup2pinElement(m_r2, createPin(-8, 24, 270, "n2")->pin(), m_p1->pin());

	Slider * s = addSlider("slider", 0, 100, 5, 50, Qt::Vertical, QRect(0, -16, 16, 32));
	m_pSlider = static_cast<QSlider*>(s->widget());

	createProperty("resistance", Variant::Type::Double);
	property("resistance")->setCaption(i18n("Resistance"));
	property("resistance")->setUnit(QChar(0x3a9));
	property("resistance")->setMinValue(1e-6);
	property("resistance")->setValue(1e5);

	addDisplayText("res", QRect(-56, -8, 40, 16), "");
}
예제 #14
0
void SliderDialog::editSlider()
{
  SliderSettingsDialog* pSettingsDialog = new SliderSettingsDialog(this);
  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
  pSettingsDialog->setModel((*CCopasiRootContainer::getDatamodelList())[0]->getModel());
  // set the list of sliders that is already known
  CCopasiObject* object = (CCopasiObject*)getTaskForFolderId(mCurrentFolderId);

  if (!object) return;

  std::vector<CSlider*>* pVector = getCSlidersForCurrentFolderId();
  pSettingsDialog->setDefinedSliders(*pVector);

  //pSettingsDialog->disableObjectChoosing(true);

  pSettingsDialog->setSlider(mpCurrSlider->getCSlider());

  if (pSettingsDialog->exec() == QDialog::Accepted)
    {
      addSlider(pSettingsDialog->getSlider());
      mpCurrSlider->updateSliderData();
      /*
      if ((!mpCurrSlider->isEnabled()) && mpCurrSlider->getCSlider()->compile())
        {
          mpCurrSlider->setEnabled(true);
        }
        */
    }

  delete pSettingsDialog;
  delete pVector;
}
예제 #15
0
FullInterface::FullInterface(mopo::control_map controls, mopo::output_map modulation_sources,
                             mopo::output_map mono_modulations,
                             mopo::output_map poly_modulations,
                             MidiKeyboardState* keyboard_state) : SynthSection("full_interface") {
  addSubSection(synthesis_interface_ = new SynthesisInterface(controls, keyboard_state));
  addSubSection(arp_section_ = new ArpSection("ARP"));

  addSlider(beats_per_minute_ = new SynthSlider("beats_per_minute"));
  beats_per_minute_->setSliderStyle(Slider::LinearBar);
  beats_per_minute_->setTextBoxStyle(Slider::TextBoxAbove, false, 150, 20);
  beats_per_minute_->setColour(Slider::textBoxTextColourId, Colours::white);

  addAndMakeVisible(global_tool_tip_ = new GlobalToolTip());

  addAndMakeVisible(patch_selector_ = new PatchSelector());
  addAndMakeVisible(oscilloscope_ = new Oscilloscope());

  setAllValues(controls);
  createModulationSliders(modulation_sources, mono_modulations, poly_modulations);

  logo_button_ = new ImageButton("logo_button");
  const Desktop::Displays::Display& display = Desktop::getInstance().getDisplays().getMainDisplay();
  if (display.scale > 1.5) {
    Image helm = ImageCache::getFromMemory(BinaryData::helm_icon_128_2x_png,
                                           BinaryData::helm_icon_128_2x_pngSize);
    logo_button_->setImages(false, true, false,
                            helm, 1.0, Colours::transparentBlack,
                            helm, 1.0, Colour(0x11ffffff),
                            helm, 1.0, Colour(0x11000000));
  }
  else {
    Image helm_small = ImageCache::getFromMemory(BinaryData::helm_icon_32_2x_png,
                                                 BinaryData::helm_icon_32_2x_pngSize);
    logo_button_->setImages(false, true, false,
                            helm_small, 1.0, Colours::transparentBlack,
                            helm_small, 1.0, Colour(0x11ffffff),
                            helm_small, 1.0, Colour(0x11000000));
  }
  addAndMakeVisible(logo_button_);
  logo_button_->addListener(this);

  addChildComponent(patch_browser_ = new PatchBrowser());
  patch_selector_->setBrowser(patch_browser_);

  addChildComponent(save_section_ = new SaveSection("save_section"));
  patch_browser_->setSaveSection(save_section_);
  patch_selector_->setSaveSection(save_section_);

  addChildComponent(delete_section_ = new DeleteSection("delete_section"));
  patch_browser_->setDeleteSection(delete_section_);

  about_section_ = new AboutSection("about");
  addChildComponent(about_section_);

  update_check_section_ = new UpdateCheckSection("update_check");
  addChildComponent(update_check_section_);

  setOpaque(true);
}
예제 #16
0
void ContourFindingFilter::setup() 
{
	GrayscaleFilter::setup();

	addContent("Output", output);
	addSlider("Blobs", settings.num_blobs, 1, 10);
	addToggle("Find Holes", settings.find_holes);
}
예제 #17
0
void See::addHidden(Board* board, int startIndex) {
	int pieceType = ATTACK_ARRAY[moveTo - startIndex + 128];

	switch (pieceType) {
	case ATTACK_KQR:
	case ATTACK_QR:
		addSlider(board, startIndex, DELTA_ARRAY[startIndex - moveTo + 128],
				W_ROOK);
		break;
	case ATTACK_KQBwP:
	case ATTACK_KQBbP:
	case ATTACK_QB:
		addSlider(board, startIndex, DELTA_ARRAY[startIndex - moveTo + 128],
				W_BISHOP);
		break;
	}

}
예제 #18
0
LLMultiSlider::LLMultiSlider(const LLMultiSlider::Params& p)
:	LLF32UICtrl(p),
	mMouseOffset( 0 ),
	mDragStartThumbRect( 0, getRect().getHeight(), p.thumb_width, 0 ),
	mMaxNumSliders(p.max_sliders),
	mAllowOverlap(p.allow_overlap),
	mDrawTrack(p.draw_track),
	mUseTriangle(p.use_triangle),
	mTrackColor(p.track_color()),
	mThumbOutlineColor(p.thumb_outline_color()),
	mThumbCenterColor(p.thumb_center_color()),
	mThumbCenterSelectedColor(p.thumb_center_selected_color()),
	mDisabledThumbColor(p.thumb_disabled_color()),
	mTriangleColor(p.triangle_color()),
	mThumbWidth(p.thumb_width),
	mMouseDownSignal(NULL),
	mMouseUpSignal(NULL)
{
	mValue.emptyMap();
	mCurSlider = LLStringUtil::null;
	
	if (p.mouse_down_callback.isProvided())
	{
		setMouseDownCallback(initCommitCallback(p.mouse_down_callback));
	}
	if (p.mouse_up_callback.isProvided())
	{
		setMouseUpCallback(initCommitCallback(p.mouse_up_callback));
	}

	for (LLInitParam::ParamIterator<SliderParams>::const_iterator it = p.sliders.begin();
		it != p.sliders.end();
		++it)
	{
		if (it->name.isProvided())
		{
			addSlider(it->value, it->name);
		}
		else
		{
			addSlider(it->value);
		}
	}
}
예제 #19
0
void VoxelBufferFilter::setup()
{
	GrayscaleFilter::setup();

	numCaptureFrames = 90;
	frameOffsetBytes = 0;
	capturedFrames = 0;

	volumeSize[0] = videoSize.x;
	volumeSize[1] = videoSize.y;
	volumeSize[2] = numCaptureFrames;

	addToggle("Capture", settings.do_capture);
	addSlider("Num. Capture Frames", numCaptureFrames, 1, 512);

	captureProgressSlider = &addSlider("Capture Progress", capturedFrames, 0, numCaptureFrames);

	h_volume = (unsigned char*)malloc(videoSize.x*videoSize.y*numCaptureFrames);

	enableKeyEvents();
}
예제 #20
0
void AdaptiveSkinFilter::setup() 
{
	ColorFilter::setup();

	bgrInput.allocate(videoSize.x, videoSize.y);
	grayOutput.allocate(videoSize.x, videoSize.y);

	addContent("Output", &output);
	addContent("BGR Input", &bgrInput);
	addSlider("Morphing Method",
			  &settings.morphing_mode, 0, 3);
}
예제 #21
0
VariableCapacitor::VariableCapacitor(ICNDocument* icnDocument, bool newItem, const QString& id)
		: SimpleComponent(icnDocument, newItem, id ? id : "variable capacitor"),
		m_pCapacitance(m_currCapacitance, LINEAR_UPDATE_PERIOD) {
	m_name = i18n("Variable Capacitor");

	// Top Left(x,y) from centre point, width, height.
	setSize(-16, -8, 32, 16);

	// william - you might want to change this value. I added this line as it
	// was being used unitialized (in the sliderValueChanged function when
	// addSlider is called later on), and causing a crash - david.
	m_tickValue = 1;

	m_maxCapacitance = 0.0001;
	m_minCapacitance = 0.00005;

	m_currCapacitance = m_minCapacitance + ((m_maxCapacitance - m_minCapacitance) / 2);

	init1PinLeft();
	init1PinRight();

	m_pNNode[0]->setLength(15);
	m_pPNode[0]->setLength(15);

	setup2pinElement(m_pCapacitance, m_pNNode[0]->pin(), m_pPNode[0]->pin());

	addDisplayText("capacitance", QRect(-8, -26, 16, 16), "", false);

	createProperty("currcapacitance", Variant::Type::Double);
	property("currcapacitance")->setCaption(i18n("Capacitance"));
	property("currcapacitance")->setUnit("F");
	property("currcapacitance")->setMinValue(1e-12);
	property("currcapacitance")->setMaxValue(1e12);
	property("currcapacitance")->setValue(m_currCapacitance);

	createProperty("maximum capacitance", Variant::Type::Double);
	property("maximum capacitance")->setCaption(i18n("Max"));
	property("maximum capacitance")->setUnit("F");
	property("maximum capacitance")->setMinValue(1e-12);
	property("maximum capacitance")->setMaxValue(1e12);
	property("maximum capacitance")->setValue(m_maxCapacitance);

	createProperty("minimum capacitance", Variant::Type::Double);
	property("minimum capacitance")->setCaption(i18n("Min"));
	property("minimum capacitance")->setUnit("F");
	property("minimum capacitance")->setMinValue(1e-12);
	property("minimum capacitance")->setMaxValue(1e12);
	property("minimum capacitance")->setValue(m_minCapacitance);

	Slider * s = addSlider("slider", 0, 100, 1, 50, Qt::Horizontal, QRect(-16, 10, 32, 16));
	m_pSlider = static_cast<QSlider*>(s->widget());
}
예제 #22
0
void SettingsPanel::setOutputOptions(MainController* mc){
    
    mMainController = mc;
    
    Gwen::Controls::Base* pSlider;
    Gwen::Controls::Base* pCheckBox;
    Gwen::Controls::Base* pLabel;
    
    
//    pLabel = addProperty(mLaserCat, getBounds(mLaserCatElements), "Main speed", mMainController->getDataManager()->getMainSpeed());
//    mLaserCatElements.push_back(pLabel);
    pSlider = addSlider(mLaserCat, getBounds(mLaserCatElements), "Main speed", mMainController->getDataManager()->getMainSpeed()*100, 50, 1000 );
    mLaserCatElements.push_back(pSlider);
    
}
예제 #23
0
void SobelFilterOcl::setup()
{
	ColorFilter::setup();

	rgbaInput.allocate(videoSize.x, videoSize.y);
	grayOutput.allocate(videoSize.x, videoSize.y);

	oclSobelFilter.input = rgbaInput.getCvImage()->imageData;
	oclSobelFilter.output = grayOutput.getCvImage()->imageData;

	addContent("RGBA", rgbaInput);
	addContent("Output", output);
	addSlider("Threshold", oclSobelFilter.threshold, 0.0, 255.0);

	oclSobelFilter.loadFromFile("sobelFilter.cl");
	clScheduler->initKernel(oclSobelFilter);
}
예제 #24
0
VariableResistor::VariableResistor( ICNDocument* icnDocument, bool newItem, const QString& id )
    : Component( icnDocument, newItem, (!id.isEmpty()) ? id : "variable resistor" )
{
    m_name = i18n("Resistor");

    // Top Left(x,y) from centre point, width, height.
    setSize( -16, -16, 32, 32 );

    init1PinLeft();
    init1PinRight();

    // (see comment in variablecapacitor.cpp) - david
    m_tickValue = 1;

    m_minResistance = 0.5;
    m_maxResistance = 1.0;

    m_currResistance = m_minResistance + ( ( m_maxResistance - m_minResistance ) / 2 ) ;

    m_pResistance = createResistance( m_pPNode[0], m_pNNode[0], m_currResistance );

    createProperty( "resistance", Variant::Type::Double );
    property("resistance")->setCaption( i18n("Resistance") );
    property("resistance")->setUnit( QChar( 0x3a9 ) );
    property("resistance")->setMinValue( 1e-6 );
    property("resistance")->setValue( m_currResistance );

    createProperty( "minimum resistance", Variant::Type::Double );
    property("minimum resistance")->setCaption( i18n("Min") );
    property("minimum resistance")->setUnit( QChar( 0x3a9 ) );
    property("minimum resistance")->setMinValue( 1e-6 );
    property("minimum resistance")->setValue( m_minResistance );

    createProperty( "maximum resistance", Variant::Type::Double );
    property("maximum resistance")->setCaption( i18n("Max") );
    property("maximum resistance")->setUnit( QChar( 0x3a9 ) );
    property("maximum resistance")->setMinValue( 1e-6 );
    property("maximum resistance")->setValue( m_maxResistance );

    addDisplayText( "res", QRect( -16, -26, 32, 12 ), "", false );

    Slider * s = addSlider( "slider", 0, 100, 1, 50, Qt::Horizontal, QRect( -16, 14, width(), 16 ) );
    m_pSlider = static_cast<QSlider*>( s->widget() );

}
예제 #25
0
void DkGradient::setGradient(const QLinearGradient& gradient) {

    reset();
    clearAllSliders();	// reset adds a slider at the start and end

    this->gradient.setStops(gradient.stops());

    QVector<QGradientStop> stops = gradient.stops();

    for (int idx = 0; idx < stops.size(); idx++) {
        addSlider(stops.at(idx).first, stops.at(idx).second);
    }

    updateGradient();
    update();
    emit gradientChanged();

}
예제 #26
0
void CalibrationFilter::setup() 
{
	ColorFilter::setup();

	grayInput.allocate(videoSize.x, videoSize.y);
	tempImage.allocate(videoSize.x, videoSize.y);
	shownCapture.allocate(videoSize.x, videoSize.y);
	
	addContent("Output", &output);
	showCapturesSlider = addSlider("Previous Captures", &settings.show_capture, 0, settings.min_captures);
	addContent("Selected Capture", &shownCapture);
	addButton("Capture", &settings.capture);
//	addToggle("Once", &settings.once);
//	addSlider2d("Chessboard Corners", &targetCorners, 2.0, 7.0, 2.0, 7.0);
	addToggle("Interpolate", &settings.do_interpolate);
	addButton("Calculate", &settings.calc_undistort);
	addToggle("Undistort Stream", &settings.do_undistort);
	addToggle("Guess Lens Intrinsics", &settings.guess_intrinsics);
}
예제 #27
0
StutterSection::StutterSection(String name) : SynthSection(name) {
  static const int TEMPO_DRAG_SENSITIVITY = 150;

  addSlider(stutter_frequency_ = new SynthSlider("stutter_frequency"));
  stutter_frequency_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
  stutter_frequency_->setLookAndFeel(TextLookAndFeel::instance());

  addSlider(stutter_tempo_ = new SynthSlider("stutter_tempo"));
  stutter_tempo_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
  stutter_tempo_->setStringLookup(mopo::strings::synced_frequencies);
  stutter_tempo_->setLookAndFeel(TextLookAndFeel::instance());
  stutter_tempo_->setMouseDragSensitivity(TEMPO_DRAG_SENSITIVITY);

  addSlider(stutter_sync_ = new TempoSelector("stutter_sync"));
  stutter_sync_->setSliderStyle(Slider::LinearBar);
  stutter_sync_->setTempoSlider(stutter_tempo_);
  stutter_sync_->setFreeSlider(stutter_frequency_);
  stutter_sync_->setStringLookup(mopo::strings::freq_sync_styles);

  addSlider(resample_frequency_ = new SynthSlider("stutter_resample_frequency"));
  resample_frequency_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
  resample_frequency_->setLookAndFeel(TextLookAndFeel::instance());

  addSlider(resample_tempo_ = new SynthSlider("stutter_resample_tempo"));
  resample_tempo_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
  resample_tempo_->setStringLookup(mopo::strings::synced_frequencies);
  resample_tempo_->setLookAndFeel(TextLookAndFeel::instance());
  resample_tempo_->setMouseDragSensitivity(TEMPO_DRAG_SENSITIVITY);

  addSlider(resample_sync_ = new TempoSelector("stutter_resample_sync"));
  resample_sync_->setSliderStyle(Slider::LinearBar);
  resample_sync_->setTempoSlider(resample_tempo_);
  resample_sync_->setFreeSlider(resample_frequency_);
  resample_sync_->setStringLookup(mopo::strings::freq_sync_styles);

  addSlider(stutter_softness_ = new SynthSlider("stutter_softness"));
  stutter_softness_->setSliderStyle(Slider::LinearBar);

  addButton(on_ = new ToggleButton("stutter_on"));
  setActivator(on_);
}
예제 #28
0
//==============================================================================
sBMP4AudioProcessorEditor::sBMP4AudioProcessorEditor(sBMP4AudioProcessor& processor)
    : AudioProcessorEditor(processor)
    , m_oMidiKeyboard(processor.m_oKeyboardState, MidiKeyboardComponent::horizontalKeyboard)
    , m_oWaveSlider("wave")
	, m_oWaveLabel("", "wave")
	, m_oFilterSlider("Filter")
    , m_oFilterLabel("", "LP filter")
	, m_oQSlider("Resonance")
    , m_oQLabel("", "Resonance")
	, m_oLfoSlider("LFO")
	, m_oDelaySlider("delay")
    , m_oDelayLabel("", "delay")
    , m_oGainSlider("gain")
    , m_oGainLabel("", "gain")
    , m_oSineImage("sine")
    , m_oSawImage("saw")
    , m_oTriangleImage("triangle")
	, m_oSLogoLabel("", "s")
    , m_oLogoLabel("", "BMP4")
    , m_oLogoImage("sBMP4")
{
    addSlider(&m_oWaveSlider,	1.f/3);
	addSlider(&m_oLfoSlider,	.01);
	addSlider(&m_oFilterSlider, .01);
	addSlider(&m_oQSlider,		.01);
 	addSlider(&m_oDelaySlider,	.01);
	addSlider(&m_oGainSlider,	.01);

	addToggleButton(&m_oLfoTogBut); 
	m_oLfoTogBut.setButtonText("LFO");
	addToggleButton(&m_oSubOscTogBut); 
	m_oSubOscTogBut.setButtonText("Sub Osc");

	m_oSineImage.setImage(ImageFileFormat::loadFrom (BinaryData::sine_png, (size_t) BinaryData::sine_pngSize));
	m_oSawImage.setImage(ImageFileFormat::loadFrom (BinaryData::saw_png, (size_t) BinaryData::saw_pngSize));
	m_oSquareImage.setImage(ImageFileFormat::loadFrom (BinaryData::square_png, (size_t) BinaryData::square_pngSize));
	m_oTriangleImage.setImage(ImageFileFormat::loadFrom (BinaryData::triangle_png, (size_t) BinaryData::triangle_pngSize));
	m_oLogoImage.setImage(ImageFileFormat::loadFrom (BinaryData::main_png, (size_t) BinaryData::main_pngSize));
	
	addAndMakeVisible(m_oSineImage);
	addAndMakeVisible(m_oSawImage);
	addAndMakeVisible(m_oSquareImage);
	addAndMakeVisible(m_oTriangleImage);
    
#if USE_LOGO_LBL
	addLabel(&m_oSLogoLabel);

    Font logoFont = mLookAndFeel.getFont();
    logoFont.setHeight(20.f);
    m_oLogoLabel.setFont(logoFont);
    m_oLogoLabel.setColour(Label::textColourId, mLookAndFeel.getFontColour());
    m_oLogoLabel.setJustificationType(Justification::centred);
    addAndMakeVisible(m_oLogoLabel);
    
#else
	addAndMakeVisible(m_oLogoImage);
#endif

    // add some labels for the sliders
	addLabel(&m_oWaveLabel);
	addLabel(&m_oFilterLabel);
	addLabel(&m_oQLabel);
	addLabel(&m_oGainLabel);
	addLabel(&m_oDelayLabel);

    addAndMakeVisible (m_oMidiKeyboard);

    // add the triangular m_pResizer component for the bottom-right of the UI
    addAndMakeVisible (m_pResizer = new ResizableCornerComponent (this, &m_oResizeLimits));
    m_oResizeLimits.setSizeLimits (processor.getDimensions().first, processor.getDimensions().second, 
								 2*processor.getDimensions().first, 2*processor.getDimensions().second);

    // set our component's initial size to be the last one that was stored in the filter's settings
    setSize (processor.getDimensions().first, processor.getDimensions().second);

    startTimer (50);
}
예제 #29
0
NoiseSection::NoiseSection(String name) : SynthSection(name) {
  addSlider(volume_ = new SynthSlider("noise_volume"));
  volume_->setSliderStyle(Slider::RotaryHorizontalVerticalDrag);
}
예제 #30
0
void SliderDialog::createNewSlider()
{
  // allow the user to create more than one slider
  std::vector<const CCopasiObject*> objects = CCopasiSelectionDialog::getObjectVector(this,
      CQSimpleSelectionTree::InitialTime |
      CQSimpleSelectionTree::Parameters);
  std::vector<CSlider*>* pVector = getCSlidersForCurrentFolderId();
  std::vector<const CCopasiObject*>::const_iterator it = objects.begin(), endit = objects.end();
  bool yesToAll = false;
  bool noToAll = false;
  // create the sliders for all the selected objects

  // first we need the task object because we need it later to associate the
  // later with the correct task
  CCopasiObject* object = (CCopasiObject*)getTaskForFolderId(mCurrentFolderId);

  if (!object) return;

  CCopasiObject* pTmpObject = NULL;

  while (it != endit)
    {
      // create a new slider
      assert((*it) != NULL);
      pTmpObject = const_cast<CCopasiObject*>(determineCorrectObjectForSlider(*it));

      CSlider* pCSlider = new CSlider("slider", (*CCopasiRootContainer::getDatamodelList())[0]);

      if (pCSlider)
        {
          pCSlider->setSliderObject(pTmpObject);
          pCSlider->setAssociatedEntityKey(object->getKey());
          // check if a slider for that object already exists and if so, prompt
          // the user what to do
          CSlider* pEquivalentSlider = equivalentSliderExists(pCSlider);

          if (pEquivalentSlider != NULL)
            {
              CopasiSlider* pCopasiSlider = NULL;

              // if the user has specified yesToAll, we reset the ranges of all
              // duplicate sliders
              if (yesToAll)
                {
                  pEquivalentSlider->resetRange();
                  // update the slider widget
                  pCopasiSlider = findCopasiSliderForCSlider(pEquivalentSlider);
                  assert(pCopasiSlider != NULL);

                  if (pCopasiSlider != NULL)
                    {
                      pCopasiSlider->updateSliderData();
                    }
                }
              // if the user has not specified noToAll, we need to prompt
              else if (!noToAll)
                {
                  QMessageBox::StandardButton result = CQMessageBox::information(NULL, "Slider Exists",
                                                       "A slider for this object already exists.\n\nDo you want to reset the range of the slider?",
                                                       QMessageBox::Yes | QMessageBox::No | QMessageBox::YesToAll | QMessageBox::NoToAll, QMessageBox::No);

                  // check the answer and maybe set some flags
                  switch (result)
                    {
                      case QMessageBox::YesToAll:
                        // set the flag
                        yesToAll = true;

                      case QMessageBox::Yes:
                        // reset the range
                        pEquivalentSlider->resetRange();
                        // update the slider widget
                        pCopasiSlider = findCopasiSliderForCSlider(pEquivalentSlider);
                        assert(pCopasiSlider != NULL);

                        if (pCopasiSlider != NULL)
                          {
                            pCopasiSlider->updateSliderData();
                          }

                        break;

                      case QMessageBox::NoToAll:
                        // set the flag
                        noToAll = true;
                        break;

                      case QMessageBox::No:
                        // do nothing else
                        break;

                      default:
                        // do nothing
                        break;
                    }
                }

              delete pCSlider;
            }
          else
            {
              std::vector<CCopasiContainer*> listOfContainers;
              assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
              listOfContainers.push_back((*CCopasiRootContainer::getDatamodelList())[0]->getModel());
              pCSlider->compile(listOfContainers);
              pCSlider->resetRange();
              addSlider(pCSlider);
              mChanged = true;
            }
        }

      ++it;
    }

  delete pVector;
}