Skip to content
Snippets Groups Projects
Commit d0679bb5 authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez
Browse files

Fix thread lock when updating time position in file reader

parent c33889f7
No related branches found
No related tags found
No related merge requests found
......@@ -145,7 +145,6 @@ void FileReaderEditor::setTotalTime(unsigned int ms)
void FileReaderEditor::setCurrentTime(unsigned int ms)
{
MessageManagerLock mml;
currentTime->setTimeMilliseconds(0,ms);
}
......@@ -296,10 +295,21 @@ void DualTimeComponent::setTimeMilliseconds(unsigned int index, unsigned int tim
time /= 60;
hourFrac = time;
String text = String(hourFrac).paddedLeft('0',2) + ":" + String(minFrac).paddedLeft('0',2) + ":" +
labelText[index] = String(hourFrac).paddedLeft('0',2) + ":" + String(minFrac).paddedLeft('0',2) + ":" +
String(secFrac).paddedLeft('0',2) + "." + String(msFrac).paddedLeft('0',3);
if (editor->acquisitionIsActive)
{
triggerAsyncUpdate();
}
else
{
timeLabel[index]->setText(labelText[index],dontSendNotification);
}
}
timeLabel[index]->setText(text,dontSendNotification);
void DualTimeComponent::handleAsyncUpdate()
{
timeLabel[0]->setText(labelText[0],dontSendNotification);
}
unsigned int DualTimeComponent::getTimeMilliseconds(unsigned int index)
......
......@@ -87,7 +87,7 @@ private:
};
class DualTimeComponent : public Component,
public Label::Listener
public Label::Listener, public AsyncUpdater
{
public:
DualTimeComponent(FileReaderEditor* e, bool isEditable);
......@@ -97,12 +97,14 @@ public:
void paint(Graphics& g);
void labelTextChanged(Label* label);
void setEnable(bool enable);
void handleAsyncUpdate();
private:
ScopedPointer<Label> timeLabel[2];
unsigned int msTime[2];
FileReaderEditor* editor;
bool editable;
String labelText[2];
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment