Example #1
0
void GrooveDialog::OnCommand(WPARAM wParam, LPARAM lParam)
{
    switch(LOWORD(wParam))
    {
    case FNG_OPEN_FOLDER:
        OnGrooveFolderButton(HIWORD(wParam), lParam);
        break;
    case FNG_REFRESH:
        RefreshGrooveList();
        break;
    case IDC_GROOVELIST:
        OnGrooveList(HIWORD(wParam), lParam);
        break;
    case IDC_STRENGTH:
        OnStrengthChange(HIWORD(wParam), lParam);
        break;
    case IDC_VELSTRENGTH:
        OnVelStrengthChange(HIWORD(wParam), lParam);
        break;
    case IDC_SENS_32ND:
        setSensitivity(m_hwnd, 32);
        setGrooveTolerance(32);
        break;
    case IDC_SENS_16TH:
        setSensitivity(m_hwnd, 16);
        setGrooveTolerance(16);
        break;
    case IDC_SENS_4TH:
        setSensitivity(m_hwnd, 4);
        setGrooveTolerance(4);
        break;
    case IDC_SENS_8TH:
        setSensitivity(m_hwnd, 8);
        setGrooveTolerance(8);
        break;
    case IDC_TARG_ITEMS:
        setTarget(m_hwnd, true);
        setGrooveTarget(TARGET_ITEMS);
        break;
    case IDC_TARG_NOTES:
        setTarget(m_hwnd, false);
        setGrooveTarget(TARGET_NOTES);
        break;
    case IDC_APPLYGROOVE:
        ApplySelectedGroove();
        break;
    case IDC_STORE:
        if(IsDlgButtonChecked(m_hwnd, IDC_TARG_ITEMS) == BST_CHECKED)
            Main_OnCommandEx(NamedCommandLookup("_FNG_GET_GROOVE"), 0, 0);
        else
            Main_OnCommandEx(NamedCommandLookup("_FNG_GET_GROOVE_MIDI"), 0, 0);
        SendDlgItemMessage(m_hwnd, IDC_GROOVELIST, LB_SETCURSEL, 0, 0);
        break;
    default:
        Main_OnCommand((int)wParam, (int)lParam); // Required when you have reaper commands in the context menu
    }
}
/*!
 Sets the sensitivity of the radio buttons to top/bottom/left/right line buttons
 Call this right after contructing the widget and before dropping into the main loop.
 */
void AP_Dialog_FormatTable::setAllSensitivities(void)
{
    XAP_Frame *frame = XAP_App::getApp()->getLastFocussedFrame();
    if (frame) {
        FV_View * pView = static_cast<FV_View *>(frame->getCurrentView());
        setSensitivity(pView->isInTable());
    }
    else {
        setSensitivity(false);
    }
}
Example #3
0
/*! 
 Sets the sensitivity of the radio buttons to top/bottom/left/right line buttons
 Call this right after contructing the widget and before dropping into the main loop.
 */
void AP_Dialog_FormatFrame::setAllSensitivities(void)
{
	XAP_Frame * frame = m_pApp->getLastFocussedFrame();
	if (frame) {
		FV_View * pView = static_cast<FV_View *>(frame->getCurrentView());
		if (pView) {
			bool bInFrame = m_bSensitive; // pView->isInFrame(pView->getPoint());
			setSensitivity(bInFrame);
		}
		else {
			setSensitivity(false);
		}
	}
	else {
		setSensitivity(false);
	}
}
ShadowSlider::ShadowSlider(QWidget *parent) :
    QSlider(parent),
    m_sensitivity(1.0f),
    m_mouse_down(false)
{
    this->setTracking(false);
    this->setMouseTracking(true);
    setSensitivity(m_sensitivity);
}
Example #5
0
TSL230R::TSL230R(int16_t pOE, int16_t pS0, int16_t pS1, int16_t pS2, int16_t pS3) {
  pinOE = pOE;
  pinS0 = pS0;
  pinS1 = pS1;
  pinS2 = pS2;
  pinS3 = pS3;

  pinMode(pinOE, OUTPUT);
  pinMode(pinS0, OUTPUT);
  pinMode(pinS1, OUTPUT);
  pinMode(pinS2, OUTPUT);
  pinMode(pinS3, OUTPUT);

  setSensitivity(TSL230R_SENS_10x);
  setFreqScaling(TSL230R_SCALE_2);
  disableOut();
}
TSSSystem::TSSSystem()
{
  if (TSS_Init() != TSS_STATUS_OK)
  {
    callbackSysFaults(SYSTEM_FAULT, SYSTEM_INITIALIZATION_FAULT);
    return;
  }

  #if (TSS_USE_AUTO_SENS_CALIBRATION == 0)
    for (uint8_t i = 0u; i < TSS_N_ELECTRODES; i++)
    {
      setSensitivity(i, 0x1A);  /* Sensitivity set if AUTOCALIB is OFF */
    }
  #endif

  set(TSS_TRIGGER, TSS_TRIGGER_MODE_ALWAYS);
  enable(TSS_SYSTEM);
  enable(TSS_DC_TRACK);
}
Example #7
0
bool BH1750FVI::begin(void)
{

  Wire.begin();

  /* Make sure we're actually connected */
  Wire.beginTransmission(_BH1750FVI_Address);
  if (Wire.endTransmission() != 0)
  {
    return false;
  }

  _BH1750FVIinitialisation = true;

  setResolution(_BH1750FVI_Resolution);
  setSensitivity(_BH1750FVI_Sensitivity);

  return true;
}
Example #8
0
void GrooveDialog::OnInitDlg()
{
    GrooveTemplateHandler *me = GrooveTemplateHandler::Instance();
    currentDir = me->GetGrooveDir();

    SetWindowText(m_hwnd, __LOCALIZE("Groove tool","sws_DLG_157"));
    SetDlgItemInt(m_hwnd, IDC_STRENGTH, me->GetGrooveStrength(), true);
    SetDlgItemInt(m_hwnd, IDC_VELSTRENGTH, me->GetGrooveVelStrength(), true);

    setSensitivity(m_hwnd, me->GetGrooveTolerance());
    setTarget(m_hwnd, me->GetGrooveTarget() == TARGET_ITEMS);

    m_resize.init_item(IDC_GROOVELIST, 0.0, 0.0, 0.0, 1.0);

    SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_STRENGTH), GWLP_USERDATA, 0xdeadf00b);
    SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_VELSTRENGTH), GWLP_USERDATA, 0xdeadf00b);

    RefreshGrooveList();
}
Example #9
0
bool JoystickMapper::setValue(string name, string value)
{
    if (name == "inputDevice")
        inputDevice = value;
    else if (name == "deviceId")
        deviceId = getOEInt(value);
    else if (name.substr(0, 4) == "axis")
        setMap(JOYSTICK_AXIS1 + getOEInt(name.substr(4)), value);
    else if (name.substr(0, 6) == "button")
        setMap(JOYSTICK_BUTTON1 + getOEInt(name.substr(6)), value);
    else if (name.substr(0, 15) == "sensitivityAxis")
        setSensitivity(JOYSTICK_AXIS1 + getOEInt(name.substr(15)), getFloat(value));
    else if (name.substr(0, 11) == "reverseAxis")
        setReverse(JOYSTICK_AXIS1 + getOEInt(name.substr(11)), getOEInt(value));
    else if (name.substr(0, 3) == "map")
        inputDeviceMap[name.substr(3)] = value;
    else
        return false;
    
    return true;
}
Example #10
0
void DkCamControls::onComboActivated(int index) {
	
	if (QObject::sender() == apertureCombo) {
		MaidFacade::MaybeStringValues aperture = maidFacade->getAperture();
		if (aperture.second && index != aperture.first.currentValue) {
			setAperture(apertureCombo->currentIndex(), aperture.first.currentValue);
		}
	} else if (QObject::sender() == isoCombo) {
		MaidFacade::MaybeStringValues sensitivity = maidFacade->getSensitivity();
		if (sensitivity.second && index != sensitivity.first.currentValue) {
			setSensitivity(isoCombo->currentIndex(), sensitivity.first.currentValue);
		}
	} else if (QObject::sender() == shutterSpeedCombo) {
		MaidFacade::MaybeStringValues shutterSpeed = maidFacade->getShutterSpeed();
		if (shutterSpeed.second && index != shutterSpeed.first.currentValue) {
			setShutterSpeed(shutterSpeedCombo->currentIndex(), shutterSpeed.first.currentValue);
		}
	} else if (QObject::sender() == compressionCombo) {
		MaidFacade::MaybeStringValues compressionLevel = maidFacade->getCompressionLevel();
		if (compressionLevel.second && index != compressionLevel.first.currentValue) {
			setCompressionLevel(compressionCombo->currentIndex(), compressionLevel.first.currentValue);
		}
	}
}
Example #11
0
/// begin variables
/// - int sleepPin: number indicating to which pin the sleep port is attached. DIGITAL OUT
/// - int selfTestPin: number indicating to which pin the selftest port is attached. DIGITAL OUT
/// - int zeroGPin: number indicating to which pin the ZeroGpin is connected to. DIGITAL IN
/// - int gSelectPin: number indication to which pin the Gselect is connected to. DIGITAL OUT
/// - int xPin: number indicating to which pin the x-axis pin is connected to. ANALOG IN
/// - int yPin: number indicating to which pin the y-axis  pin is connected to. ANALOG IN
/// - int zPin: number indicating to which pin the z-axis  pin is connected to. ANALOG IN
/// - int offset: array indicating the G offset on the x,y and z-axis
/// When you use begin() without variables standard values are loaded: A0,A1,A2 as input for X,Y,Z and digital pins 13,12,11,10 for sleep, selftest, zeroG and gSelect
void AcceleroMMA7361::begin(int sleepPin, int selfTestPin, int zeroGPin, int gSelectPin, int xPin, int yPin, int zPin)
{
  pinMode(sleepPin, OUTPUT);
  pinMode(selfTestPin, OUTPUT);
  pinMode(zeroGPin, INPUT);
  pinMode(gSelectPin, OUTPUT);
  pinMode(xPin, INPUT);
  pinMode(yPin, INPUT);
  pinMode(zPin, INPUT);
  digitalWrite(sleepPin,HIGH);
  digitalWrite(selfTestPin,LOW);
  _sleepPin = sleepPin;
  _selfTestPin = selfTestPin;
  _zeroGPin = zeroGPin;
  _gSelectPin = gSelectPin;
  _xPin = xPin;
  _yPin = yPin;
  _zPin = zPin;
  _sleep = false;
  setOffSets(0,0,0);
  setARefVoltage(5);
  setAveraging(10);
  setSensitivity(HIGH);
}
/*! 
 * This method sets the sensitivity of the radio buttons to above/below/left/right merges
 * Because we can't merge to the left of column zero for example.
 *
 * Call this right after contructing the widget and before dropping into the main loop.
 */
void AP_Dialog_SplitCells::setAllSensitivities(void)
{
	FV_View * pView = 0;

	if (XAP_Frame * pFrame = getApp()->getLastFocussedFrame())
	{
		pView = static_cast<FV_View *>(pFrame->getCurrentView());
	}
	if (!pView)
	{
		setSensitivity(vert_above, false);
		setSensitivity(vert_mid,   false);
		setSensitivity(vert_below, false);
		setSensitivity(hori_left,  false);
		setSensitivity(hori_mid,   false);
		setSensitivity(hori_right, false);
		return;
	}
	if (!pView->isInTable())
	{
		setSensitivity(vert_above, false);
		setSensitivity(vert_mid,   false);
		setSensitivity(vert_below, false);
		setSensitivity(hori_left,  false);
		setSensitivity(hori_mid,   false);
		setSensitivity(hori_right, false);
		return;
	}

	PT_DocPosition iCurPos = pView->getPoint();
	m_iCellSource = iCurPos;
	pView->getCellParams(iCurPos,&m_iLeft,&m_iRight,&m_iTop,&m_iBot);
//
// Now find the number of rows and columns inthis table. This is easiest to
// get from the table container
//
	fl_BlockLayout * pBL =	pView->getLayout()->findBlockAtPosition(iCurPos);
	fp_Run * pRun;
	UT_sint32 xPoint,yPoint,xPoint2,yPoint2,iPointHeight;
	bool bDirection;
	pRun = pBL->findPointCoords(iCurPos, false, xPoint,
							    yPoint, xPoint2, yPoint2,
							    iPointHeight, bDirection);

	UT_return_if_fail(pRun);

	fp_Line * pLine = pRun->getLine();
	UT_return_if_fail(pLine);

	fp_Container * pCon = pLine->getContainer();
	UT_return_if_fail(pCon);

	fp_TableContainer * pTab = static_cast<fp_TableContainer *>(pCon->getContainer());
	UT_return_if_fail(pTab);
	UT_return_if_fail(pTab->getContainerType() == FP_CONTAINER_TABLE);
	m_pTab = pTab;
	m_iNumRows = pTab->getNumRows();
	m_iNumCols = pTab->getNumCols();
	if(m_iBot > m_iTop+2)
	{
		setSensitivity(vert_above,true);
		setSensitivity(vert_below,true);
	}
	else
	{
		setSensitivity(vert_above,false);
		setSensitivity(vert_below,false);
	}
	UT_sint32 diff = m_iBot - m_iTop;
	if((m_iBot - m_iTop == 1) || (2*(diff/2) == diff))
	{
		setSensitivity(vert_mid,true);
	}
	else
	{
		setSensitivity(vert_mid,false);
	}
	if(m_iRight > m_iLeft+2)
	{
		setSensitivity(hori_left,true);
		setSensitivity(hori_right,true);
	}
	else
	{
		setSensitivity(hori_left,false);
		setSensitivity(hori_right,false);
	}
	diff = m_iRight - m_iLeft;
	if((m_iRight - m_iLeft == 1) || (2*(diff/2) == diff))
	{
		setSensitivity(hori_mid,true);
	}
	else
	{
		setSensitivity(hori_mid,false);
	}
}
Example #13
0
WeightingDeblurer::WeightingDeblurer()
{
    setSensitivity(0.1f);
}
Example #14
0
void Sensitivity_set(void* ctx, float val)
{
    SetHelp("FingerArea/ChannPressure");
    setSensitivity(val);
}
Example #15
0
AC_RotatingPot::AC_RotatingPot(byte inputPin, int sensitivity, boolean inverted) : AC_RotatingPot(inputPin)
{
  setSensitivity(sensitivity);
  rotationInverted(inverted);
}
Example #16
0
float BH1750FVI::readLightLevel(void)
{

  uint16_t  integrationTime;
  uint16_t  rawLightLevel;
  float     LightLevel;

  if (_powerDown == true)
  {
    powerOn();
  }

  setSensitivity(_BH1750FVI_Sensitivity);
  setResolution(_BH1750FVI_Resolution);

  switch(_BH1750FVI_Resolution)
  {
    case BH1750_CONTINUOUS_HIGH_RES_MODE:
      integrationTime = 120 * _BH1750FVI_Sensitivity;
    break;
    case BH1750_CONTINUOUS_HIGH_RES_MODE_2:
      integrationTime = 120 * _BH1750FVI_Sensitivity;
    break;
    case BH1750_CONTINUOUS_LOW_RES_MODE:
      integrationTime = 16 * _BH1750FVI_Sensitivity;
    break;
    case BH1750_ONE_TIME_HIGH_RES_MODE:
      integrationTime = 120 * _BH1750FVI_Sensitivity;
    break;
    case BH1750_ONE_TIME_HIGH_RES_MODE_2:
      integrationTime = 120 * _BH1750FVI_Sensitivity;
    break;
    case BH1750_ONE_TIME_LOW_RES_MODE:
      integrationTime = 16 * _BH1750FVI_Sensitivity;
    break;
  }

  delay(integrationTime);

  /* read raw Light Level */
  Wire.requestFrom(_BH1750FVI_Address, 2);
#if (ARDUINO >= 100)
  rawLightLevel = Wire.read();
  rawLightLevel <<= 8;
  rawLightLevel |= Wire.read();
#else
  rawLightLevel = Wire.receive();
  rawLightLevel <<= 8;
  rawLightLevel |= Wire.receive();
#endif

  /* calculate Light Level */
  if (_BH1750FVI_Resolution == BH1750_CONTINUOUS_HIGH_RES_MODE_2 || _BH1750FVI_Resolution == BH1750_ONE_TIME_HIGH_RES_MODE_2)
  {
    LightLevel = (0.5 * rawLightLevel * _currentMTreg) / (1.2 * (float)BH1750_MTREG_DEFAULT);
  }
  else
  {
    LightLevel = (rawLightLevel * _currentMTreg) / (1.2 * (float)BH1750_MTREG_DEFAULT);
  }

  return LightLevel;

}