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

ossia / score / 41391215711

02 Nov 2026 04:56AM UTC coverage: 51.66% (-0.6%) from 52.268%
41391215711

push

github

jcelerier
Port probes: what goes through a port or a cable, on hover

Resting the cursor on a port or a cable opens a probe: levels and a trace
for audio, the latest decoded messages for MIDI, the latest values with a
trail for numbers, colour, position, orientation, gain and angle views for
values with a unit, a thumbnail for textures. On a cable it shows what the
source produces, near its end what the process there receives.

The data comes from Execution::PortTap: while a probe is open, a node of
the execution graph gets the port's edges and copies what arrives into a
monitor, without allocation or lock for audio; TapTicker gives taps the
token the graph needs to run them. Probes only tap with execution updates
enabled, refresh at the UI event rate, and open only when previews are
enabled. Nothing touches the document.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KdPgufUMRpkKzaYvUs9iHW

96 of 644 new or added lines in 9 files covered. (14.91%)

3455 existing lines in 31 files now uncovered.

187161 of 362292 relevant lines covered (51.66%)

305640.16 hits per line

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

76.77
/src/plugins/score-lib-process/Process/Process.cpp
1
// This is an open source non-commercial project. Dear PVS-Studio, please check
2
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
3
#include "Process.hpp"
4

5
#include <Process/Dataflow/PortVisibility.hpp>
6

7
#include <Process/Dataflow/Port.hpp>
8
#include <Process/ExpandMode.hpp>
9
#include <Process/PresetHelpers.hpp>
10
#include <Process/TimeValue.hpp>
11

12
#include <LocalTree/ProcessComponent.hpp>
13

14
#include <score/model/ComponentUtils.hpp>
15
#include <score/model/EntitySerialization.hpp>
16
#include <score/model/IdentifiedObject.hpp>
17
#include <score/model/Identifier.hpp>
18
#include <score/model/ModelMetadata.hpp>
19
#include <score/tools/Bind.hpp>
20
#include <score/widgets/SetIcons.hpp>
21

22
#include <ossia/detail/algorithms.hpp>
23
#include <ossia/detail/disable_fpe.hpp>
24
#include <ossia/detail/hash_map.hpp>
25
#include <ossia/network/base/device.hpp>
26
#include <ossia/network/base/node.hpp>
27

28
#include <QObject>
29

30
#include <wobjectimpl.h>
31

32
W_OBJECT_IMPL(Process::ProcessModel)
377,677 ✔
33

34
#if !defined(SCORE_ALL_UNITY)
35
template class IdentifiedObject<Process::ProcessModel>;
36
template class score::SerializableInterface<Process::ProcessModelFactory>;
37
#endif
38
namespace Process
39
{
40

41
const QIcon& getCategoryIcon(const QString& category) noexcept
206,360 ✔
42
{
43
  static const ossia::flat_map<QString, QIcon> categoryIcon{
212,216 ✔
44
      {"AI", makeIcon(QStringLiteral(":/icons/ai.png"))},
366 ✔
45
      {"Analysis", makeIcon(QStringLiteral(":/icons/analysis.png"))},
366 ✔
46
      {"Audio", makeIcon(QStringLiteral(":/icons/audio.png"))},
366 ✔
47
      {"Plugins", makeIcon(QStringLiteral(":/icons/filter.png"))},
366 ✔
48
      {"Midi", makeIcon(QStringLiteral(":/icons/midi.png"))},
366 ✔
49
      {"Control", makeIcon(QStringLiteral(":/icons/controls.png"))},
366 ✔
50
      {"Visuals", makeIcon(QStringLiteral(":/icons/gfx.png"))},
366 ✔
51
      {"Automations", makeIcon(QStringLiteral(":/icons/automation.png"))},
366 ✔
52
      {"Impro", makeIcon(QStringLiteral(":/icons/controls.png"))},
366 ✔
53
      {"Script", makeIcon(QStringLiteral(":/icons/script.png"))},
366 ✔
54
      {"Structure", makeIcon(QStringLiteral(":/icons/structure.png"))},
366 ✔
55
      {"Network", makeIcon(QStringLiteral(":/icons/sync.png"))},
366 ✔
56
      {"Monitoring", makeIcon(QStringLiteral(":/icons/ui.png"))},
366 ✔
57
      {"Spatial", makeIcon(QStringLiteral(":/icons/spatial.png"))},
366 ✔
58
      {"Synths", makeIcon(QStringLiteral(":/icons/synths.png"))},
366 ✔
59
      {"Timing", makeIcon(QStringLiteral(":/icons/timing.png"))},
366 ✔
60
  };
61
  static const QIcon invalid;
206,360 ✔
62
  if(auto it = categoryIcon.find(category); it != categoryIcon.end())
206,360 ✔
63
  {
64
    return it->second;
206,360 ✔
65
  }
66
  if(auto slash_it = category.indexOf("/"); slash_it != -1)
×
67
  {
68
    if(auto it = categoryIcon.find(category.mid(0, slash_it)); it != categoryIcon.end())
×
69
    {
70
      return it->second;
×
71
    }
72
  }
×
73
  return invalid;
×
74
}
206,360 ✔
75
ProcessModel::ProcessModel(
9,626 ✔
76
    TimeVal duration, const Id<ProcessModel>& id, const QString& name, QObject* parent)
77
    : Entity{id, name, parent}
4,813 ✔
78
    , m_duration{std::move(duration)}
79
    , m_slotHeight{300}
80
    , m_loopDuration{m_duration}
81
    , m_size{200, 100}
82
    , m_loops{false}
83
{
9,626 ✔
84
  ossia::disable_fpe();
4,813 ✔
85
  con(metadata(), &score::ModelMetadata::NameChanged, this,
9,626 ✔
86
      [this] { prettyNameChanged(); });
9,920 ✔
87
  connect(this, &Process::ProcessModel::resetExecution, this, [this] {
8,386 ✔
88
    for(auto& p : this->m_inlets)
29,182 ✔
89
      p->executionReset();
25,609 ✔
90
    for(auto& p : this->m_outlets)
9,286 ✔
91
      p->executionReset();
5,713 ✔
92
  });
3,573 ✔
93
  // metadata().setInstanceName(*this);
94
}
×
95

96
ProcessModel::~ProcessModel()
6,298 ✔
97
{
6,298 ✔
98
  identified_object_destroying(this);
6,298 ✔
99
}
6,298 ✔
100

101
QString ProcessModel::effect() const noexcept
3,072 ✔
102
{
103
  return {};
3,072 ✔
104
}
105

106
void ProcessModel::setDurationAndScale(const TimeVal& newDuration) noexcept
2 ✔
107
{
108
  setDuration(newDuration);
2 ✔
109
}
2 ✔
110

111
void ProcessModel::setDurationAndGrow(const TimeVal& newDuration) noexcept
×
112
{
113
  setDuration(newDuration);
×
114
}
×
115

116
void ProcessModel::setDurationAndShrink(const TimeVal& newDuration) noexcept
×
117
{
118
  setDuration(newDuration);
×
119
}
×
120

121
ProcessModel::ProcessModel(DataStream::Deserializer& vis, QObject* parent)
1,652 ✔
122
    : Entity(vis, parent)
826 ✔
123
{
1,652 ✔
124
  ossia::disable_fpe();
826 ✔
125
  vis.writeTo(*this);
826 ✔
126
  con(metadata(), &score::ModelMetadata::NameChanged, this,
1,652 ✔
127
      [this] { prettyNameChanged(); });
852 ✔
128
}
×
129

130
ProcessModel::ProcessModel(JSONObject::Deserializer& vis, QObject* parent)
1,318 ✔
131
    : Entity(vis, parent)
659 ✔
132
{
1,318 ✔
133
  ossia::disable_fpe();
659 ✔
134
  vis.writeTo(*this);
659 ✔
135
  con(metadata(), &score::ModelMetadata::NameChanged, this,
1,318 ✔
136
      [this] { prettyNameChanged(); });
662 ✔
137
}
×
138

139
QString ProcessModel::prettyName() const noexcept
10,239 ✔
140
{
141
  return metadata().getName();
10,239 ✔
142
}
143

144
void ProcessModel::setParentDuration(ExpandMode mode, const TimeVal& t) noexcept
2,027 ✔
145
{
146
  switch(mode)
2,027 ✔
147
  {
148
    case ExpandMode::Scale:
149
      setDurationAndScale(t);
2,006 ✔
150
      break;
2,006 ✔
151
    case ExpandMode::GrowShrink: {
152
      if(duration() < t)
13 ✔
153
        setDurationAndGrow(t);
12 ✔
154
      else
155
        setDurationAndShrink(t);
1 ✔
156
      break;
13 ✔
157
    }
158
    case ExpandMode::ForceGrow: {
159
      if(duration() < t)
8 ✔
160
        setDurationAndGrow(t);
×
161
      break;
8 ✔
162
    }
163
    case ExpandMode::CannotExpand:
×
164
    default:
165
      break;
×
166
  }
167
}
2,027 ✔
168

169
TimeVal ProcessModel::contentDuration() const noexcept
×
170
{
171
  return TimeVal::zero();
×
172
}
173

174
void ProcessModel::setDuration(const TimeVal& other) noexcept
2,054 ✔
175
{
176
  m_duration = other;
2,054 ✔
177
  durationChanged(m_duration);
2,054 ✔
178
}
2,054 ✔
179

180
const TimeVal& ProcessModel::duration() const noexcept
9,849 ✔
181
{
182
  return m_duration;
9,849 ✔
183
}
184

185
ProcessStateDataInterface* ProcessModel::startStateData() const noexcept
4,883 ✔
186
{
187
  return nullptr;
4,883 ✔
188
}
189

190
ProcessStateDataInterface* ProcessModel::endStateData() const noexcept
3,618 ✔
191
{
192
  return nullptr;
3,618 ✔
193
}
194

195
Selection ProcessModel::selectableChildren() const noexcept
×
196
{
197
  return {};
×
198
}
199

200
Selection ProcessModel::selectedChildren() const noexcept
×
201
{
202
  return {};
×
203
}
204

205
void ProcessModel::setSelection(const Selection& s) const noexcept
31 ✔
206
{
207
  ossia::hash_set<const QObject*> selected;
31 ✔
208
  selected.reserve(s.size());
31 ✔
209
  for(const auto& obj : s)
1,230,032 ✔
210
    selected.insert(obj.data());
1,230,001 ✔
211

212
  for(Selectable* child : this->findChildren<Selectable*>())
1,380,101 ✔
213
    child->set(selected.contains(child->parent()));
1,380,070 ✔
214
}
31 ✔
215

216
Process::Inlet* ProcessModel::inlet(const Id<Process::Port>& p) const noexcept
6,522 ✔
217
{
218
  for(auto e : m_inlets)
137,533 ✔
219
    if(e->id() == p)
137,532 ✔
220
      return e;
6,521 ✔
221
  return nullptr;
1 ✔
222
}
6,522 ✔
223

224
Process::Outlet* ProcessModel::outlet(const Id<Process::Port>& p) const noexcept
1 ✔
225
{
226
  for(auto e : m_outlets)
1 ✔
227
    if(e->id() == p)
1 ✔
228
      return e;
1 ✔
229
  return nullptr;
×
230
}
1 ✔
231

232
void ProcessModel::loadPreset(const Preset& preset)
×
233
{
234
  const rapidjson::Document doc = readJson(preset.data);
×
235
  loadFixedControls(doc.GetArray(), *this);
×
236
}
×
237

238
Preset ProcessModel::savePreset() const noexcept
×
239
{
240
  Preset p;
×
241
  p.name = this->metadata().getName();
×
242
  p.key.key = this->concreteKey();
×
243

244
  JSONReader r;
×
245
  saveFixedControls(r, *this);
×
246
  p.data = r.toByteArray();
×
247
  return p;
×
248
}
×
249

250
std::vector<Preset> ProcessModel::builtinPresets() const noexcept
12 ✔
251
{
252
  return {};
12 ✔
253
}
254

255
bool ProcessModel::presetMatches(const Preset& preset) const noexcept
434 ✔
256
{
257
  return preset.key.key == concreteKey() && preset.key.effect == effect();
434 ✔
258
}
259

260
void ProcessModel::ancestorStartDateChanged() { }
5 ✔
261

262
void ProcessModel::ancestorTempoChanged() { }
×
263

264
void ProcessModel::forEachControl(
85 ✔
265
    smallfun::function<void(ControlInlet&, const ossia::value&)> f) const
266
{
267
  for(const auto& inlet : m_inlets)
771 ✔
268
  {
269
    if(auto ctrl = qobject_cast<Process::ControlInlet*>(inlet))
686 ✔
270
    {
271
      f(*ctrl, ctrl->value());
649 ✔
272
    }
649 ✔
273
  }
274
}
85 ✔
275

276
void ProcessModel::setCreatingControls(bool ok) { }
296 ✔
277

278
bool ProcessModel::creatingControls() const noexcept
×
279
{
280
  return this->flags() & ProcessFlags::CreateControls;
×
281
}
282

283
void ProcessModel::setScriptable(bool b)
128 ✔
284
{
285
  if(b != m_scriptable)
128 ✔
286
  {
287
    m_scriptable = b;
128 ✔
288
    scriptableChanged(b);
128 ✔
289
  }
128 ✔
290
}
128 ✔
291

292
void ProcessModel::setLoops(bool b)
29 ✔
293
{
294
  if(b != m_loops)
29 ✔
295
  {
296
    m_loops = b;
26 ✔
297
    loopsChanged(b);
26 ✔
298
  }
26 ✔
299
}
29 ✔
300

301
void ProcessModel::setStartOffset(TimeVal b)
11 ✔
302
{
303
  if(b != m_startOffset)
11 ✔
304
  {
305
    m_startOffset = b;
10 ✔
306
    startOffsetChanged(b);
10 ✔
307
  }
10 ✔
308
}
11 ✔
309

310
void ProcessModel::setLoopDuration(TimeVal b)
12 ✔
311
{
312
  if(b.msec() < 0.1)
12 ✔
313
    b = TimeVal::fromMsecs(0.1);
×
314

315
  if(b != m_loopDuration)
12 ✔
316
  {
317
    m_loopDuration = b;
12 ✔
318
    loopDurationChanged(b);
12 ✔
319
  }
12 ✔
320
}
12 ✔
321

322
QPointF ProcessModel::position() const noexcept
168,257,068 ✔
323
{
324
  return m_position;
168,257,068 ✔
325
}
326

327
QSizeF ProcessModel::size() const noexcept
167,759,314 ✔
328
{
329
  return m_size;
167,759,314 ✔
330
}
331

332
void ProcessModel::setPosition(const QPointF& v)
3,735 ✔
333
{
334
  if(v != m_position)
3,735 ✔
335
  {
336
    m_position = v;
3,732 ✔
337
    positionChanged(v);
3,732 ✔
338
  }
3,732 ✔
339
}
3,735 ✔
340

341
void ProcessModel::setSize(const QSizeF& v)
1,783 ✔
342
{
343
  if(v != m_size)
1,783 ✔
344
  {
345
    m_size = v;
1,782 ✔
346
    sizeChanged(v);
1,782 ✔
347
  }
1,782 ✔
348
}
1,783 ✔
349

350
FoldMode ProcessModel::foldMode() const noexcept
1,165 ✔
351
{
352
  return m_foldMode;
1,165 ✔
353
}
354

355
void ProcessModel::setFoldMode(FoldMode v)
8 ✔
356
{
357
  if(v != m_foldMode)
8 ✔
358
  {
359
    m_foldMode = v;
8 ✔
360
    foldModeChanged(v);
8 ✔
361
  }
8 ✔
362
}
8 ✔
363

364
bool ProcessModel::folded() const noexcept
1,660 ✔
365
{
366
  switch(m_foldMode)
1,660 ✔
367
  {
368
    case FoldMode::Folded:
369
      return true;
8 ✔
370
    case FoldMode::Unfolded:
371
      return false;
4 ✔
372
    case FoldMode::Auto:
1,648 ✔
373
    default:
374
      return std::ssize(m_inlets) > MaxUnpaginatedControls;
1,648 ✔
375
  }
376
}
1,660 ✔
377

378
double ProcessModel::getSlotHeight() const noexcept
27,804 ✔
379
{
380
  return m_slotHeight;
27,804 ✔
381
}
382

383
void ProcessModel::setSlotHeight(double v) noexcept
1,428 ✔
384
{
385
  m_slotHeight = v;
1,428 ✔
386
  slotHeightChanged(v);
1,428 ✔
387
}
1,428 ✔
388

389
void ProcessModel::setExecuting(bool e)
12,256 ✔
390
{
391
  m_executing = e;
12,256 ✔
392
}
12,256 ✔
393

UNCOV
394
void ProcessModel::setMonitor(std::shared_ptr<Monitor> m)
×
395
{
UNCOV
396
  if(m == m_monitor)
×
397
    return;
×
UNCOV
398
  m_monitor = std::move(m);
×
UNCOV
399
  monitorChanged();
×
400
}
×
401

402
std::optional<Process::MagneticInfo>
UNCOV
403
ProcessModel::magneticPosition(const QObject* o, const TimeVal t) const noexcept
×
404
{
UNCOV
405
  return {};
×
406
}
407

408
bool ProcessModel::externalSourceOutOfDate() const noexcept
×
409
{
UNCOV
410
  return false;
×
411
}
412

413
score::Command*
UNCOV
414
ProcessModel::refreshFromExternalSource(const score::DocumentContext& ctx) const
×
415
{
UNCOV
416
  return nullptr;
×
417
}
418

419
ProcessModel* parentProcess(QObject* obj) noexcept
19,232 ✔
420
{
421
  if(obj)
19,232 ✔
422
    obj = obj->parent();
19,232 ✔
423

424
  while(obj && !qobject_cast<ProcessModel*>(obj))
37,032 ✔
425
  {
426
    obj = obj->parent();
17,800 ✔
427
  }
428

429
  if(obj)
19,232 ✔
430
    return static_cast<ProcessModel*>(obj);
17,288 ✔
431
  return nullptr;
1,944 ✔
432
}
19,232 ✔
433

434
const ProcessModel* parentProcess(const QObject* obj) noexcept
93,352 ✔
435
{
436
  if(obj)
93,352 ✔
437
    obj = obj->parent();
93,352 ✔
438

439
  while(obj && !qobject_cast<const ProcessModel*>(obj))
107,262 ✔
440
  {
441
    obj = obj->parent();
13,910 ✔
442
  }
443

444
  if(obj)
93,352 ✔
445
    return static_cast<const ProcessModel*>(obj);
91,894 ✔
446
  return nullptr;
1,458 ✔
447
}
93,352 ✔
448

449
QString processLocalTreeAddress(const ProcessModel& proc)
×
450
{
UNCOV
451
  if(auto lt = findComponent<LocalTree::ProcessComponent>(proc.components()))
×
452
  {
UNCOV
453
    return QString::fromStdString(
×
UNCOV
454
        lt->node().get_device().get_name() + ":" + lt->node().osc_address());
×
455
  }
UNCOV
456
  return {};
×
UNCOV
457
}
×
458
}
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