示例#1
0
文件: Sound.cpp 项目: krruzic/cpp3ds
Sound& Sound::operator =(const Sound& right)
{
    // Here we don't use the copy-and-swap idiom, because it would mess up
    // the list of sound instances contained in the buffers

    // Detach the sound instance from the previous buffer (if any)
    if (m_buffer)
    {
        stop();
        m_buffer->detachSound(this);
        m_buffer = NULL;
    }

    // Copy the sound attributes
    if (right.m_buffer)
        setBuffer(*right.m_buffer);
    setLoop(right.getLoop());
    setPitch(right.getPitch());
    setVolume(right.getVolume());
    setPosition(right.getPosition());
    setRelativeToListener(right.isRelativeToListener());
    setMinDistance(right.getMinDistance());
    setAttenuation(right.getAttenuation());

    return *this;
}
SensorBrowseControl::SensorBrowseControl(bool showPoints) :
    mUi(new Ui_SensorBrowseControl()),
    mLogFilesize(0),
    mLogFilepos(0),
    mMinDistance(Converter::mMinDistance),
    mMaxDistance(Converter::mMaxDistance) {
  mUi->setupUi(this);
  mLogMenu = mMenu.addMenu("Log");
  mLogStartAction = mLogMenu->addAction("Seek start", this,
    SLOT(logStartClicked()));
  mLogStartAction->setShortcut(Qt::Key_Home);
  mLogPlayAction = mLogMenu->addAction("Play", this,
    SLOT(logPlayTriggered()));
  mLogPlayAction->setCheckable(true);
  mLogPlayAction->setShortcut(Qt::Key_Space);
  mLogSkipAction = mLogMenu->addAction("Skip scan", this,
    SLOT(logSkipClicked()));
  mLogSkipAction->setShortcut(Qt::Key_PageDown);
  mTimer.setSingleShot(true);
  connect(&mTimer, SIGNAL(timeout()), this, SLOT(timerTimeout()));
  mUi->colorChooser->setPalette(&mPalette);
  connect(&mPalette, SIGNAL(colorChanged(const QString&, const QColor&)),
    this, SLOT(colorChanged(const QString&, const QColor&)));
  connect(&View3d::getInstance().getScene(), SIGNAL(render(View3d&, Scene3d&)),
    this, SLOT(render(View3d&, Scene3d&)));
  setPointColor(Qt::gray);
  setPointSize(1.0);
  setShowPoints(showPoints);
  setSmoothPoints(true);
  setCalibrationFilename(mUi->calibrationEdit->text());
  setLogFilename(QDir::current().path());
  setMinDistance(mMinDistance);
  setMaxDistance(mMaxDistance);
}
示例#3
0
Cone::Cone( Vector2D peak,
	    float fstAngle, float sndAngle,
	    float maxDistance, float minDistance ) {
  setPeak( peak );
  setAngles( fstAngle, sndAngle );
  setMaxDistance( maxDistance );
  setMinDistance( minDistance );
}
示例#4
0
SoundSource::SoundSource(const SoundSource& copy)
: m_channel(copy.m_channel)
{
    setPitch(copy.getPitch());
    setVolume(copy.getVolume());
    setPosition(copy.getPosition());
    setRelativeToListener(copy.isRelativeToListener());
    setMinDistance(copy.getMinDistance());
    setAttenuation(copy.getAttenuation());
}
示例#5
0
SoundSource::SoundSource(const SoundSource& copy)
{
    alCheck(alGenSources(1, &m_source));
    alCheck(alSourcei(m_source, AL_BUFFER, 0));

    setPitch(copy.getPitch());
    setVolume(copy.getVolume());
    setPosition(copy.getPosition());
    setRelativeToListener(copy.isRelativeToListener());
    setMinDistance(copy.getMinDistance());
    setAttenuation(copy.getAttenuation());
}
示例#6
0
ZoomCamera::ZoomCamera(vec3f start, vec3f target, float min_distance, float max_distance) : Camera(start,target) {
    dest = start;
    up = vec3f(0.0f, -1.0f, 0.0f);

    setMinDistance(min_distance);
    setMaxDistance(max_distance);

    padding = 1.0;
    speed = 1.0;
    lockon = false;
    lockon_time = 0.0;
    reset();
}
示例#7
0
SoundSource& SoundSource::operator =(const SoundSource& right)
{
    // Leave m_source untouched -- it's not necessary to destroy and
    // recreate the OpenAL sound source, hence no copy-and-swap idiom

    // Assign the sound attributes
    setPitch(right.getPitch());
    setVolume(right.getVolume());
    setPosition(right.getPosition());
    setRelativeToListener(right.isRelativeToListener());
    setMinDistance(right.getMinDistance());
    setAttenuation(right.getAttenuation());

    return *this;
}
示例#8
0
SoundSource& SoundSource::operator =(const SoundSource& right)
{
	// Assign the sound attributes
	setPitch(right.getPitch());
	setVolume(right.getVolume());
	setPosition(right.getPosition());
	setRelativeToListener(right.isRelativeToListener());
	setMinDistance(right.getMinDistance());
	setAttenuation(right.getAttenuation());

	m_channel = right.m_channel;
	m_ndspWaveBuf = right.m_ndspWaveBuf;

	return *this;
}
示例#9
0
ZoomCamera::ZoomCamera(vec3 pos, vec3 target, float min_distance, float max_distance) :
    pos(pos), _pos(pos), target(target), _target(target),  dest(pos), fov(90.0f) {

    znear = 0.1;

    up = vec3(0.0f, -1.0f, 0.0f);

    setMinDistance(min_distance);
    setMaxDistance(max_distance);

    padding = 1.0;
    speed = 1.0;
    lockon = false;
    lockon_time = 0.0;
    reset();
}
示例#10
0
ofxArtool5::ofxArtool5(){
    curArtMode = NULL;
    nullArtPointers();
    bPattFound=false;
    selectedId=-1;
    setScaleFactor(1.0);
    setMinDistance(40.0);
    setMaxDistance(10000.0);
    gPatt_width = 80.0;
    
    threshNames.resize(6);
    threshNames[0] = "MANUAL";
    threshNames[1] = "AUTO MEDIAN";
    threshNames[2] = "AUTO OTSU";
    threshNames[3] = "AUTO ADAPTIVE";
    threshNames[4] = "AUTO BRACKETING";
    threshNames[5] = "UNKNOWN";
    
    artMode = ART_PATTERN;
    markersNFTCount = 0;
    surfaceSetCount = 0;
}
示例#11
0
void ts::scene::Engine_sound_controller::register_car(const world::Car* car)
{
    const auto& car_definition = car->car_definition();
    auto audio_buffer = engine_sound_store_.load_from_file(car_definition.engine_sample);

    engine_sounds_.push_back({ car, nullptr });
    if (audio_buffer)
    {
        Vector2<float> position = car->position();

        auto& entry = engine_sounds_.back();
        auto sound_ptr = std::make_unique<sf::Sound>();
        sound_ptr->setLoop(true);
        sound_ptr->setPitch(base_pitch);
        sound_ptr->setBuffer(*audio_buffer);
        sound_ptr->setMinDistance(200.0f);
        sound_ptr->setRelativeToListener(false);
        entry.second = std::move(sound_ptr);

        sorting_required_ = true;
    }
}
void SenseHandleModifierUI::toggleSignals(bool toggleconnections){
    if (toggleconnections){
        connect(name, SIGNAL(textEdited(QString)), this, SLOT(setName(QString)), Qt::UniqueConnection);
        connect(enable, SIGNAL(released()), this, SLOT(setEnable()), Qt::UniqueConnection);
        connect(sensorLocalOffset, SIGNAL(editingFinished()), this, SLOT(setSensorLocalOffset()), Qt::UniqueConnection);
        connect(localFrameName, SIGNAL(currentIndexChanged(int)), this, SLOT(setLocalFrameName(int)), Qt::UniqueConnection);
        connect(sensorLocalFrameName, SIGNAL(currentIndexChanged(int)), this, SLOT(setSensorLocalFrameName(int)), Qt::UniqueConnection);
        connect(minDistance, SIGNAL(editingFinished()), this, SLOT(setMinDistance()), Qt::UniqueConnection);
        connect(maxDistance, SIGNAL(editingFinished()), this, SLOT(setMaxDistance()), Qt::UniqueConnection);
        connect(distanceOut, SIGNAL(editingFinished()), this, SLOT(setDistanceOut()), Qt::UniqueConnection);
        connect(collisionFilterInfo, SIGNAL(currentIndexChanged(int)), this, SLOT(setCollisionFilterInfo(int)), Qt::UniqueConnection);
        connect(sensorRagdollBoneIndex, SIGNAL(currentIndexChanged(int)), this, SLOT(setSensorRagdollBoneIndex(int)), Qt::UniqueConnection);
        connect(sensorAnimationBoneIndex, SIGNAL(currentIndexChanged(int)), this, SLOT(setSensorAnimationBoneIndex(int)), Qt::UniqueConnection);
        connect(sensingMode, SIGNAL(currentIndexChanged(int)), this, SLOT(setSensingMode(int)), Qt::UniqueConnection);
        connect(extrapolateSensorPosition, SIGNAL(released()), this, SLOT(setExtrapolateSensorPosition()), Qt::UniqueConnection);
        connect(keepFirstSensedHandle, SIGNAL(released()), this, SLOT(setKeepFirstSensedHandle()), Qt::UniqueConnection);
        connect(foundHandleOut, SIGNAL(released()), this, SLOT(setFoundHandleOut()), Qt::UniqueConnection);
        connect(table, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(viewSelectedChild(int,int)), Qt::UniqueConnection);
        connect(rangeUI, SIGNAL(viewEvents(int,QString,QStringList)), this, SIGNAL(viewEvents(int,QString,QStringList)), Qt::UniqueConnection);
        connect(rangeUI, SIGNAL(viewVariables(int,QString,QStringList)), this, SIGNAL(viewVariables(int,QString,QStringList)), Qt::UniqueConnection);
        connect(rangeUI, SIGNAL(viewProperties(int,QString,QStringList)), this, SIGNAL(viewProperties(int,QString,QStringList)), Qt::UniqueConnection);
        connect(rangeUI, SIGNAL(returnToParent()), this, SLOT(returnToWidget()), Qt::UniqueConnection);
    }else{
示例#13
0
void SoundData::setDistanceValues(float minDistance, float maxDistance)
{
	setMinDistance(minDistance);
	setMaxDistance(maxDistance);
}
     connect(sensingMode, SIGNAL(currentIndexChanged(int)), this, SLOT(setSensingMode(int)), Qt::UniqueConnection);
     connect(extrapolateSensorPosition, SIGNAL(released()), this, SLOT(setExtrapolateSensorPosition()), Qt::UniqueConnection);
     connect(keepFirstSensedHandle, SIGNAL(released()), this, SLOT(setKeepFirstSensedHandle()), Qt::UniqueConnection);
     connect(foundHandleOut, SIGNAL(released()), this, SLOT(setFoundHandleOut()), Qt::UniqueConnection);
     connect(table, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(viewSelectedChild(int,int)), Qt::UniqueConnection);
     connect(rangeUI, SIGNAL(viewEvents(int,QString,QStringList)), this, SIGNAL(viewEvents(int,QString,QStringList)), Qt::UniqueConnection);
     connect(rangeUI, SIGNAL(viewVariables(int,QString,QStringList)), this, SIGNAL(viewVariables(int,QString,QStringList)), Qt::UniqueConnection);
     connect(rangeUI, SIGNAL(viewProperties(int,QString,QStringList)), this, SIGNAL(viewProperties(int,QString,QStringList)), Qt::UniqueConnection);
     connect(rangeUI, SIGNAL(returnToParent()), this, SLOT(returnToWidget()), Qt::UniqueConnection);
 }else{
     disconnect(name, SIGNAL(textEdited(QString)), this, SLOT(setName(QString)));
     disconnect(enable, SIGNAL(released()), this, SLOT(setEnable()));
     disconnect(sensorLocalOffset, SIGNAL(editingFinished()), this, SLOT(setSensorLocalOffset()));
     disconnect(localFrameName, SIGNAL(currentIndexChanged(int)), this, SLOT(setLocalFrameName(int)));
     disconnect(sensorLocalFrameName, SIGNAL(currentIndexChanged(int)), this, SLOT(setSensorLocalFrameName(int)));
     disconnect(minDistance, SIGNAL(editingFinished()), this, SLOT(setMinDistance()));
     disconnect(maxDistance, SIGNAL(editingFinished()), this, SLOT(setMaxDistance()));
     disconnect(distanceOut, SIGNAL(editingFinished()), this, SLOT(setDistanceOut()));
     disconnect(collisionFilterInfo, SIGNAL(currentIndexChanged(int)), this, SLOT(setCollisionFilterInfo(int)));
     disconnect(sensorRagdollBoneIndex, SIGNAL(currentIndexChanged(int)), this, SLOT(setSensorRagdollBoneIndex(int)));
     disconnect(sensorAnimationBoneIndex, SIGNAL(currentIndexChanged(int)), this, SLOT(setSensorAnimationBoneIndex(int)));
     disconnect(sensingMode, SIGNAL(currentIndexChanged(int)), this, SLOT(setSensingMode(int)));
     disconnect(extrapolateSensorPosition, SIGNAL(released()), this, SLOT(setExtrapolateSensorPosition()));
     disconnect(keepFirstSensedHandle, SIGNAL(released()), this, SLOT(setKeepFirstSensedHandle()));
     disconnect(foundHandleOut, SIGNAL(released()), this, SLOT(setFoundHandleOut()));
     disconnect(table, SIGNAL(cellDoubleClicked(int,int)), this, SLOT(viewSelectedChild(int,int)));
     disconnect(rangeUI, SIGNAL(viewEvents(int,QString,QStringList)), this, SIGNAL(viewEvents(int,QString,QStringList)));
     disconnect(rangeUI, SIGNAL(viewVariables(int,QString,QStringList)), this, SIGNAL(viewVariables(int,QString,QStringList)));
     disconnect(rangeUI, SIGNAL(viewProperties(int,QString,QStringList)), this, SIGNAL(viewProperties(int,QString,QStringList)));
     disconnect(rangeUI, SIGNAL(returnToParent()), this, SLOT(returnToWidget()));
 }
示例#15
0
void sfSoundStream_setMinDistance(sfSoundStream* soundStream, float distance)
{
    CSFML_CALL(soundStream, setMinDistance(distance));
}
示例#16
0
文件: Sound.cpp 项目: DJMaster/CSFML
void sfSound_setMinDistance(sfSound* sound, float distance)
{
    CSFML_CALL(sound, setMinDistance(distance));
}