Skip to content

Commit 51d6254

Browse files
committed
Add total time labels
1 parent bc87117 commit 51d6254

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

Source/Processors/FileReader/ScrubberInterface.cpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,16 +318,29 @@ ScrubberInterface::ScrubberInterface (FileReader* fileReader_)
318318
fullStartTimeLabel->setTooltip ("Start time of the recording");
319319
addAndMakeVisible (fullStartTimeLabel.get());
320320

321+
minStartTimeLabel = std::make_unique<Label> ("MinStartTime", "00:00:00.000");
322+
minStartTimeLabel->setBounds (0, 115, 100, 10);
323+
minStartTimeLabel->setTooltip ("Minimum start time of the recording");
324+
minStartTimeLabel->setAlpha (0.5f);
325+
addAndMakeVisible (minStartTimeLabel.get());
326+
321327
fullMiddleTimeLabel = std::make_unique<Label> ("FullMidTime", "");
322328
fullMiddleTimeLabel->setBounds (0.39 * scrubInterfaceWidth, 108, 100, 10);
323329
fullMiddleTimeLabel->setTooltip ("Current playback position");
330+
fullMiddleTimeLabel->setAlpha (0.5f);
324331
addAndMakeVisible (fullMiddleTimeLabel.get());
325332

326333
fullEndTimeLabel = std::make_unique<Label> ("FullEndTime", "");
327334
fullEndTimeLabel->setBounds (0.75 * scrubInterfaceWidth, 100, 100, 10);
328335
fullEndTimeLabel->setTooltip ("End time of the recording");
329336
addAndMakeVisible (fullEndTimeLabel.get());
330337

338+
maxEndTimeLabel = std::make_unique<Label> ("MaxEndTime", "00:00:00.000");
339+
maxEndTimeLabel->setBounds (0.75 * scrubInterfaceWidth, 115, 100, 10);
340+
maxEndTimeLabel->setTooltip ("Maximum end time of the recording");
341+
maxEndTimeLabel->setAlpha (0.5f);
342+
addAndMakeVisible (maxEndTimeLabel.get());
343+
331344
int padding = 30;
332345
zoomTimeline = std::make_unique<ZoomTimeline> (fileReader);
333346
zoomTimeline->setBounds (padding, 46, scrubInterfaceWidth - 2 * padding, 20);
@@ -397,9 +410,13 @@ void ScrubberInterface::update()
397410
{
398411
TimeParameter* start = static_cast<TimeParameter*> (fileReader->getParameter ("start_time"));
399412
fullStartTimeLabel->setText (start->getTimeValue()->toString(), juce::sendNotificationAsync);
413+
int minStartTime = start->getTimeValue()->getMinTimeInMilliseconds();
414+
minStartTimeLabel->setText (TimeParameter::TimeValue (minStartTime).toString(), juce::sendNotificationAsync);
400415

401416
TimeParameter* stop = static_cast<TimeParameter*> (fileReader->getParameter ("end_time"));
402417
fullEndTimeLabel->setText (stop->getTimeValue()->toString(), juce::sendNotificationAsync);
418+
int maxEndTime = stop->getTimeValue()->getMaxTimeInMilliseconds();
419+
maxEndTimeLabel->setText (TimeParameter::TimeValue (maxEndTime).toString(), juce::sendNotificationAsync);
403420

404421
int startMs = start->getTimeValue()->getTimeInMilliseconds();
405422
int stopMs = stop->getTimeValue()->getTimeInMilliseconds();

Source/Processors/FileReader/ScrubberInterface.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ class ScrubberInterface : public Component, public Button::Listener
139139
std::unique_ptr<Timeline> fullTimeline;
140140
std::unique_ptr<Timeline> zoomTimeline;
141141

142+
std::unique_ptr<Label> minStartTimeLabel;
143+
std::unique_ptr<Label> maxEndTimeLabel;
144+
142145
void buttonClicked (Button* button) override;
143146
void paintOverChildren (Graphics& g) override;
144147
void setCurrentSample (int zoomTimelinePos);

0 commit comments

Comments
 (0)