Line | Branch | Exec | Source |
---|---|---|---|
1 | #include "interpreter.h" | ||
2 | #include "exceptions.h" | ||
3 | #include "line6pod2/line6pod2.h" | ||
4 | |||
5 | #include <QMap> | ||
6 | #include <QDebug> | ||
7 | |||
8 | using namespace interpreter; | ||
9 | |||
10 | 5 | Manager::Manager() | |
11 | 5 | : m_registeredInterpreter() | |
12 | { | ||
13 |
2/4✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 5 times.
✗ Branch 5 not taken.
|
5 | m_registeredInterpreter["Line6 Pod 2.0"] = Line6Pod2::factory; |
14 | 5 | } | |
15 | |||
16 | 5 | Manager::~Manager() | |
17 | { | ||
18 | 5 | } | |
19 | |||
20 | 1 | const QMap<QString, interpreter_factory_t> &Manager::getInterpreterList() const | |
21 | { | ||
22 | 1 | return m_registeredInterpreter; | |
23 | } | ||
24 | |||
25 | 8 | BaseInterpreter::BaseInterpreter() | |
26 | { | ||
27 | 8 | } | |
28 | |||
29 | 16 | BaseInterpreter::~BaseInterpreter() | |
30 | { | ||
31 | } | ||
32 | |||
33 | 6 | QString BaseInterpreter::stringFromMidiMessage(const QByteArray &message) | |
34 | { | ||
35 | 6 | QString output; | |
36 | MidiMessage *msg; | ||
37 | try { | ||
38 |
2/2✓ Branch 1 taken 5 times.
✓ Branch 2 taken 1 times.
|
6 | msg = buildMessage(message); |
39 |
1/2✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
|
1 | } catch (Exceptions &exc) { |
40 |
2/4✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
|
1 | qWarning() << exc.what(); |
41 | 1 | msg = nullptr; | |
42 | 1 | } | |
43 |
2/2✓ Branch 0 taken 1 times.
✓ Branch 1 taken 5 times.
|
6 | if (msg != nullptr) { |
44 |
1/2✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
|
1 | output = msg->toString(); |
45 |
1/2✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
|
1 | delete msg; |
46 | } else { | ||
47 |
1/2✓ Branch 1 taken 5 times.
✗ Branch 2 not taken.
|
5 | output = QObject::tr("Unknown message"); |
48 | } | ||
49 | |||
50 | 6 | return output; | |
51 | } | ||
52 |