diff --git a/include/ReMixer/SoundSubsystem.h b/include/ReMixer/SoundSubsystem.h index 37862ff..015d1b4 100644 --- a/include/ReMixer/SoundSubsystem.h +++ b/include/ReMixer/SoundSubsystem.h @@ -2,46 +2,9 @@ #include -namespace ReMixer -{ +namespace ReMixer { class Stream; - /// A managed sound handler object. - class NuSound - { - public: - virtual bool IsPlaying() = 0; - virtual bool IsPaused() = 0; - virtual bool IsFinished() = 0; - float PlaybackLoudness(); - int ChannelCount(); - bool Looped(); - float PlaybackSpeed(); - float TimeLength(); - float TimePosition(); - float Volume(); - - - void SetTimePosition(float timePos); - void SetVolume(float vol); - void SetPlaybackSpeed(float speed); - - - virtual void Pause() = 0; - virtual void Play() = 0; - void Resume(); - void Stop(); - - Event DidLoop; - Event<> Ended; - Event<> Paused; - Event<> Played; - Event<> Resumed; - protected: - private: - }; - - /// TODO: Equalizer Effect /// TODO: Compressor Effect /// TODO: Reverb Effect @@ -54,10 +17,7 @@ namespace ReMixer /// TODO: Positional Sound Object? /// Physical representation of Pulse-Code-Modulated sound data. - class PCM - { - - }; + class PCM { }; class Decibels { }; @@ -94,7 +54,6 @@ namespace ReMixer void SetPlaybackDevice(); void SetRecordingDevice(); - void SetMasterVolume(Decibels db); protected: diff --git a/include/ReMixer/sound.h b/include/ReMixer/sound.h index ac4b9fd..81f0826 100644 --- a/include/ReMixer/sound.h +++ b/include/ReMixer/sound.h @@ -59,12 +59,10 @@ namespace ReMixer { static Sound FromPCMBuffer(std::vector buffer, uint sampleRate = 44.1_kHz, StreamMode streamMode = StreamMode::STEREO); - /// Returns a single-channel sound object generated from a trigonometric sine function. /// @see https://en.wikipedia.org/wiki/Sine_wave static Sound FromSineWave(float length, float wavelength, float amplitude, float phase); - /// Returns a single-channel sound object generated from a sawtooth wave function. /// Sawtooth waves of constant period contain odd and even harmonics that decrease at -6 dB / octave. /// @see https://en.wikipedia.org/wiki/Sawtooth_wave @@ -144,8 +142,6 @@ namespace ReMixer { uint sample_rate; std::vector audio_data; StreamMode stream_mode; - - }; /// Class that holds a short sound that can fit in memory and requires no latency. (i.e. footsteps or gun shots). diff --git a/main.cpp b/main.cpp index 30d0db9..dc27b5d 100644 --- a/main.cpp +++ b/main.cpp @@ -52,25 +52,10 @@ server.Play(test_stream, square_sound); server.Play(test_stream, test_sound); - - //test_sound = test_sound + ogg_test_sound; - - //std::cout << "Sound Playback Length: " << wave_test.PlaybackLength() << " seconds." << std::endl; - - //std::thread playback_thread([](PulseAudioSubsystem system, PulseStream stream, Sound sound){ - //system.Play(stream, sound); - //}, test, test_stream, wave_test); - - - while (true) { std::this_thread::sleep_for(25ms); } - //test.Play(test_stream2, ogg_test_sound); - - std::cout << "This text will print after the sound plays." << std::endl; - return 0; } diff --git a/src/linux/stream.cpp b/src/linux/stream.cpp index 786e04b..711ec06 100644 --- a/src/linux/stream.cpp +++ b/src/linux/stream.cpp @@ -3,7 +3,6 @@ #include #include - void ReMixer::Stream::SetName(const std::string& name) { this->name = name; @@ -25,7 +24,6 @@ void ReMixer::PulseStream::SetSampleRate(uint sampleRate) Stream::SetSampleRate(sampleRate); pa_operation* op; - op = pa_stream_update_sample_rate(this->stream, sampleRate, OnStreamSuccess, this); pa_operation_unref(op);