forked from musescore/MuseScore
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnotationerrors.h
More file actions
62 lines (55 loc) · 1.75 KB
/
Copy pathnotationerrors.h
File metadata and controls
62 lines (55 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* SPDX-License-Identifier: GPL-3.0-only
* MuseScore-Studio-CLA-applies
*
* MuseScore Studio
* Music Composition & Notation
*
* Copyright (C) 2021 MuseScore Limited and others
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3 as
* published by the Free Software Foundation.
*
* 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 <https://www.gnu.org/licenses/>.
*/
#ifndef MU_NOTATION_NOTATIONERRORS_H
#define MU_NOTATION_NOTATIONERRORS_H
#include "types/ret.h"
#include "translation.h"
namespace mu::notation {
enum class Err {
Undefined = int(muse::Ret::Code::Undefined),
NoError = int(muse::Ret::Code::Ok),
UnknownError = int(muse::Ret::Code::NotationFirst),
// selection
SelectCompleteTupletOrTremolo = 1050,
EmptySelection,
};
inline muse::Ret make_ret(Err err)
{
std::string text;
switch (err) {
case Err::UnknownError:
text = muse::trc("notation", "Unknown error");
break;
case Err::SelectCompleteTupletOrTremolo:
text = muse::trc("notation", "Please select the complete tuplet or tremolo and retry");
break;
case Err::EmptySelection:
text = muse::trc("notation", "The selection is empty");
break;
case Err::Undefined:
case Err::NoError:
break;
}
return muse::Ret(static_cast<int>(err), text);
}
}
#endif // MU_NOTATION_NOTATIONERRORS_H