示例#1
0
// Sets pulse width in seconds
bool RfSensor::setSlotPulseWidth(const Basic::Number* const msg)
{
    bool ok = false;

    if (msg != 0) {
        ok = setPulseWidth( msg->getReal() );
        if (!ok) {
            std::cerr << "RfSensor::setPulseWidth: Error setting pulse width!" << std::endl;
        }
    }

    return ok;
}
示例#2
0
// Sets pulse width using Basic::Time
bool RfSensor::setSlotPulseWidth(const Basic::Time* const msg)
{
    bool ok = false;

    if (msg != 0) {
        LCreal x = Basic::Seconds::convertStatic( *msg );
        ok = setPulseWidth( x );
        if (!ok) {
            std::cerr << "RfSensor::setPulseWidth: Error setting pulse width!" << std::endl;
        }
    }

    return ok;
}
示例#3
0
// Sets pulse width using base::Time
bool RfSensor::setSlotPulseWidth(const base::Time* const msg)
{
   bool ok = false;

   if (msg != nullptr) {
      const double x = base::Seconds::convertStatic( *msg );
      ok = setPulseWidth( x );
      if (!ok) {
         std::cerr << "RfSensor::setPulseWidth: Error setting pulse width!" << std::endl;
      }
   }

   return ok;
}
示例#4
0
文件: osc.cpp 项目: eriser/audio-1
void Oscillator::reset() {
	
	parameters.amp = 0.5f;
	parameters.wave = OSC_SAWTOOTH;
	counter = 0.0f;
	sqp = 1.0f;
	sqc = 0;
	parameters.pulsewidth = 0.0f;
	parameters.detune = 0;
	setAmp(1.0f);
	setWave(OSC_SAWTOOTH);
	setPulseWidth(0.0f);
	setNote(12);
	setDetune(0);
}