• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ossia / score / 30507431705

30 Jul 2026 02:04AM UTC coverage: 15.263% (-0.06%) from 15.321%
30507431705

push

github

jcelerier
audio: simplify pretty name for Default device

0 of 2 new or added lines in 1 file covered. (0.0%)

1386 existing lines in 18 files now uncovered.

30460 of 199565 relevant lines covered (15.26%)

1075.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.0
/src/plugins/score-plugin-protocols/Protocols/Joystick/JoystickSpecificSettingsSerialization.cpp
1
#include "JoystickSpecificSettings.hpp"
2

3
#include <score/serialization/DataStreamVisitor.hpp>
4
#include <score/serialization/JSONVisitor.hpp>
5

6
#include <ossia/protocols/joystick/joystick_protocol.hpp>
7

8
namespace
9
{
10
// Initializing the joystick subsystem throws where it is unavailable (SDL
11
// without joystick/haptic support, e.g. WebAssembly). Loading settings must not
12
// depend on it: leave the joystick unassigned instead.
13
std::pair<int32_t, int32_t> resolve_joystick_spec(const score::uuid_t& id) noexcept
2✔
14
{
15
  try
16
  {
17
    return ossia::net::joystick_info::get_available_id_for_uid(id.data);
2✔
UNCOV
18
  }
×
19
  catch(...)
20
  {
UNCOV
21
    return Protocols::JoystickSpecificSettings::unassigned;
×
UNCOV
22
  }
×
23
}
2✔
24
}
25

26
// Note: JoystickSpecificSettings.spec is not meant to be serialized
27
template <>
28
void DataStreamReader::read(const Protocols::JoystickSpecificSettings& n)
2✔
29
{
30
  m_stream << n.id << n.gamepad;
2✔
31
  insertDelimiter();
2✔
32
}
2✔
33

34
template <>
35
void DataStreamWriter::write(Protocols::JoystickSpecificSettings& n)
1✔
36
{
37
  m_stream >> n.id >> n.gamepad;
1✔
38
  n.spec = resolve_joystick_spec(n.id);
1✔
39
  checkDelimiter();
1✔
40
}
1✔
41

42
template <>
43
void JSONReader::read(const Protocols::JoystickSpecificSettings& n)
2✔
44
{
45
  obj["Id"] = n.id;
2✔
46
  obj["Gamepad"] = n.gamepad;
2✔
47
}
2✔
48

49
template <>
50
void JSONWriter::write(Protocols::JoystickSpecificSettings& n)
1✔
51
{
52
  n.id <<= obj["Id"];
1✔
53
  if(auto gp = obj.tryGet("Gamepad"))
1✔
54
    n.gamepad = gp->toBool();
1✔
55

56
  n.spec = resolve_joystick_spec(n.id);
1✔
57
}
1✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc