Commit d5773bac authored by Leander Schulten's avatar Leander Schulten
Browse files

Small Bug fixes

parent 151c3a2b
......@@ -44,6 +44,7 @@ class AbstractHardwareInterface : public HardwareInterface{
std::chrono::milliseconds sleepTime;
private:
void loop(){
std::this_thread::yield();
while (!stopThread.load()&&isFunctioning()) {
auto lock = std::unique_lock<std::mutex>(mutex);
while (run.load()&&isFunctioning()) {
......
......@@ -8,12 +8,12 @@ ControlItem{
id:item
blockWidth: 3
blockHeight: 1
pressed: controlData.programm.running
pressed: controlData?!controlData.programm.running:false
onPressedChanged: {
if(controlData.programm.running){
play.opacity = 0;
}else{
play.opacity = 1;
}else{
play.opacity = 0;
}
}
ControlItemBlock{
......@@ -49,7 +49,7 @@ ControlItem{
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: controlData.programm.name
text: controlData?controlData.programm.name:"null"
}
}
......@@ -63,7 +63,7 @@ ControlItem{
id:speedSlider
from: 0.1
to:10
value: controlData.programm.speed
value: controlData?controlData.programm.speed:1
onValueChanged: if(controlData)controlData.programm.speed = value;
Text {
id: sliderSpeed
......
......@@ -86,7 +86,7 @@ class TimeDistortion : public QObject{
private:
bool enabled=false;
QEasingCurve distortionCurve;
double intervall=0;
double intervall=10;
public:
TimeDistortion()=default;
TimeDistortion(const QJsonObject &o);
......@@ -103,10 +103,14 @@ public:
double getIntervall()const{return intervall;}
public:
double distort(double time){
if (intervall>0,05) { // sonst division durch 0
double diff = std::fmod(time,intervall); // wie weit sind wir in aktuellen intervall
double offset = time-diff; // offset zum intervall start
diff = distortionCurve.valueForProgress(diff/intervall)*intervall;// die verzerrung für den Aktuellen fortchritt im intervall mal die intervall größe
return offset+diff; // den offset plus der verzerrte Fortschritt im intervall
}else{
return time;
}
}
signals:
void enabledChanged(bool);
......
......@@ -33,7 +33,7 @@ class ChannelProgramm : public QObject{
Q_PROPERTY(RepeatPolicy repeatPolicy MEMBER repeatPolicy NOTIFY repeatPolicyChanged)
Q_PROPERTY(Channel* channel READ getChannel CONSTANT)
private:
RepeatPolicy repeatPolicy;
RepeatPolicy repeatPolicy=Continue;
public:
ChannelProgramm(const QJsonObject &o);
ChannelProgramm(const Channel * channel):channel(channel){setParent(getChannel());}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment