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

ossia / score / 30754311710

02 Aug 2026 03:25PM UTC coverage: 15.222% (-0.04%) from 15.263%
30754311710

Pull #2163

github

web-flow
Merge 8b7bf0aad into e99b6a5da
Pull Request #2163: Fix backwards playback for audio plug-ins (VST, VST3, LV2, JSFX)

0 of 57 new or added lines in 5 files covered. (0.0%)

343 existing lines in 16 files now uncovered.

30381 of 199582 relevant lines covered (15.22%)

1075.26 hits per line

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

50.0
/src/plugins/score-plugin-scenario/Scenario/Document/TimeSync/TimeSyncModel.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 "TimeSyncModel.hpp"
4

5
#include <Process/Style/ScenarioStyle.hpp>
6
#include <Process/TimeValue.hpp>
7

8
#include <Scenario/Document/Event/EventModel.hpp>
9
#include <Scenario/Process/ScenarioInterface.hpp>
10

11
#include <score/document/DocumentInterface.hpp>
12
#include <score/model/IdentifiedObject.hpp>
13
#include <score/model/Identifier.hpp>
14
#include <score/model/ModelMetadata.hpp>
15

16
#include <wobjectimpl.h>
17
W_OBJECT_IMPL(Scenario::TimeSyncModel)
863✔
18
namespace Scenario
19
{
20
TimeSyncModel::TimeSyncModel(
57✔
21
    const Id<TimeSyncModel>& id, const TimeVal& date, QObject* parent)
22
    : Entity{id, Metadata<ObjectKey_k, TimeSyncModel>::get(), parent}
57✔
23
    , m_date{date}
24
{
57✔
25
  m_expression = State::defaultFalseExpression();
57✔
26
  metadata().setInstanceName(*this);
57✔
27
  metadata().setColor(&score::Skin::Gray);
57✔
28
}
×
29

30
void TimeSyncModel::addEvent(const Id<EventModel>& eventId)
57✔
31
{
32
  m_events.push_back(eventId);
57✔
33

34
  auto scenar = dynamic_cast<ScenarioInterface*>(parent());
57✔
35
  if(scenar)
57✔
36
  {
37
    // There may be no scenario when we are cloning without a parent.
38
    // TODO this addEvent should be in an outside algorithm.
39
    auto& theEvent = scenar->event(eventId);
57✔
40
    theEvent.changeTimeSync(this->id());
57✔
41
  }
57✔
42

43
  newEvent(eventId);
57✔
44
}
57✔
45

46
bool TimeSyncModel::removeEvent(const Id<EventModel>& eventId)
1✔
47
{
48
  auto it = ossia::find(m_events, eventId);
1✔
49
  if(it != m_events.end())
1✔
50
  {
51
    m_events.erase(it);
1✔
52
    eventRemoved(eventId);
1✔
53
    return true;
1✔
54
  }
55

56
  return false;
×
57
}
1✔
58

59
void TimeSyncModel::clearEvents()
×
60
{
61
  auto ev = m_events;
×
62
  m_events.clear();
×
63
  for(const auto& e : ev)
×
64
    eventRemoved(e);
×
65
}
×
66

67
const TimeVal& TimeSyncModel::date() const noexcept
246✔
68
{
69
  return m_date;
246✔
70
}
71

72
void TimeSyncModel::setDate(const TimeVal& date)
18✔
73
{
74
  m_date = date;
18✔
75
  dateChanged(m_date);
18✔
76
}
18✔
77

78
const TimeSyncModel::EventIdVec& TimeSyncModel::events() const noexcept
341✔
79
{
80
  return m_events;
341✔
81
}
82

83
void TimeSyncModel::setEvents(const TimeSyncModel::EventIdVec& events)
×
84
{
85
  m_events = events;
×
86
}
×
87

88
void TimeSyncModel::setExpression(const State::Expression& expression)
×
89
{
90
  if(m_expression == expression)
×
91
    return;
×
92
  m_expression = expression;
×
93
  triggerChanged(m_expression);
×
94
}
×
95

96
bool TimeSyncModel::active() const noexcept
67✔
97
{
98
  return m_active;
67✔
99
}
100

101
void TimeSyncModel::setActive(bool active)
18✔
102
{
103
  if(active == m_active)
18✔
104
    return;
×
105
  m_active = active;
18✔
106
  activeChanged();
18✔
107
}
18✔
108

109
bool TimeSyncModel::autotrigger() const noexcept
×
110
{
111
  return m_autotrigger;
×
112
}
113
void TimeSyncModel::setAutotrigger(bool a)
×
114
{
115
  if(a == m_autotrigger)
×
116
    return;
×
117
  m_autotrigger = a;
×
118
  autotriggerChanged(a);
×
119
}
×
120

121
bool TimeSyncModel::isStartPoint() const noexcept
×
122
{
123
  return m_startPoint;
×
124
}
125
void TimeSyncModel::setStartPoint(bool a)
37✔
126
{
127
  if(a == m_startPoint)
37✔
128
    return;
×
129
  m_startPoint = a;
37✔
130
  startPointChanged(a);
37✔
131
}
37✔
132

133
ossia::musical_sync TimeSyncModel::musicalSync() const noexcept
×
134
{
135
  return m_musicalSync;
×
136
}
137

138
void TimeSyncModel::setMusicalSync(ossia::musical_sync s)
×
139
{
140
  if(m_musicalSync != s)
×
141
  {
142
    m_musicalSync = s;
×
143
    musicalSyncChanged(s);
×
144
  }
×
145
}
×
146

UNCOV
147
void TimeSyncModel::setWaiting(bool b)
×
148
{
UNCOV
149
  m_waiting = b;
×
UNCOV
150
  waitingChanged(b);
×
UNCOV
151
}
×
152

153
bool TimeSyncModel::waiting() const noexcept
×
154
{
155
  return m_waiting;
×
156
}
157

158
}
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