| 365 | { |
| 366 | public: |
| 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 | { |
nothing calls this directly
no test coverage detected