MCPcopy Create free account
hub / github.com/SFML/SFML / Tone

Method Tone

examples/sound_effects/SoundEffects.cpp:367–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365{
366public:
367 Tone() :
368 Effect("Tone Generator"),
369 m_instruction(getFont(), "Press up and down arrows to change the current wave type"),
370 m_currentType(getFont(), "Wave Type: Triangle"),
371 m_currentAmplitude(getFont(), "Amplitude: 0.05"),
372 m_currentFrequency(getFont(), "Frequency: 200 Hz")
373 {
374 m_instruction.setPosition({windowWidth / 2.f - 370.f, windowHeight / 2.f - 200.f});
375 m_currentType.setPosition({windowWidth / 2.f - 150.f, windowHeight / 2.f - 100.f});
376 m_currentAmplitude.setPosition({windowWidth / 2.f - 150.f, windowHeight / 2.f - 50.f});
377 m_currentFrequency.setPosition({windowWidth / 2.f - 150.f, windowHeight / 2.f});
378
379 sf::SoundStream::initialize(1, sampleRate, {sf::SoundChannel::Mono});
380 }
381
382 void onUpdate(float /*time*/, float x, float y) override
383 {

Callers

nothing calls this directly

Calls 2

initializeFunction · 0.85
setPositionMethod · 0.45

Tested by

no test coverage detected