our_dick/include/audio/mixer.hpp

64 lines
1.4 KiB
C++

/**
This file is a part of our_dick
Copyright (C) 2020 rexy712
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUR_DICK_AUDIO_MIXER_HPP
#define OUR_DICK_AUDIO_MIXER_HPP
#include <cstdlib> //size_t
#include "channel.hpp"
namespace audio{
namespace impl{
class mixer;
}
class mixer
{
public:
enum class mode : int{
MONO = 1,
STEREO = 2,
};
private:
impl::mixer* m_mix;
public:
mixer(mode m, size_t channel_count);
mixer(const mixer&) = delete;
mixer(mixer&&) = delete;
~mixer();
mixer& operator=(const mixer&) = delete;
mixer& operator=(mixer&&) = delete;
void reserve_channels(size_t count);
channel get_channel(size_t index);
channel get_channel();
bool is_paused()const;
bool is_terminated()const;
void pause();
void resume();
void terminate();
};
}
#endif