1 /*
2     MIDI Sequencer C++ library
3     Copyright (C) 2006-2021, Pedro Lopez-Cabanillas <plcl@users.sf.net>
4 
5     This library is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 3 of the License, or
8     (at your option) any later version.
9 
10     This library is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14 
15     You should have received a copy of the GNU General Public License
16     along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 extern "C" {
20     #include <alsa/asoundlib.h>
21 }
22 #include <drumstick/sequencererror.h>
23 
24 /**
25  * @file sequencererror.cpp
26  * SequencerError Exception class implementation
27  */
28 
29 namespace drumstick { namespace ALSA {
30 
31 /**
32 * @addtogroup ALSAError
33 * @{
34 */
35 
SequencerError(QString const & s,int rc)36 SequencerError::SequencerError(QString const& s, int rc):
37     m_location(s), m_errCode(rc) { }
38 
what() const39 const char *SequencerError::what() const noexcept
40 {
41     return snd_strerror(m_errCode);
42 }
43 
qstrError() const44 QString SequencerError::qstrError() const
45 {
46     return QString(what());
47 }
48 
code() const49 int SequencerError::code() const
50 {
51     return m_errCode;
52 }
53 
location() const54 const QString &SequencerError::location() const
55 {
56     return m_location;
57 }
58 
59 /** @} */
60 
61 } // namespace ALSA
62 } // namespace drumstick
63