our_dick/include/audio/error.hpp

69 lines
1.5 KiB
C++

/**
This file is a part of the WyZ project
Copyright (C) 2020 rexy712
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU 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 General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OUR_DICK_AUDIO_ERROR_HPP
#define OUR_DICK_AUDIO_ERROR_HPP
namespace audio{
class error
{
public:
enum err{
NONE = 0,
UNSUPPORTED_FORMAT,
SYSTEM,
BAD_FILE,
UNSUPPORTED_ENCODING,
INVALID_CHANNEL_COUNT,
INVALID_SAMPLE_RATE,
INVALID_DEVICE,
INVALID_FLAG,
BAD_DEVICE_COMBO,
OUT_OF_MEMORY,
BUFFER_TOO_BIG,
BUFFER_TOO_SMALL,
BAD_CALLBACK,
BAD_STREAM,
TIMED_OUT,
STREAM_STOPPED,
STREAM_NOT_STOPPED,
INPUT_OVERFLOW,
OUTPUT_UNDERFLOW,
BAD_BUFFER,
};
private:
int m_actual;
int m_homog;
public:
error(int actual);
error(const error&) = default;
error(error&&) = default;
~error() = default;
error& operator=(const error&) = default;
error& operator=(error&&) = default;
operator int()const;
int get()const;
int get_raw()const;
};
}
#endif