@@ -361,43 +361,43 @@ class YUP_API AudioPlayHead
361361 {
362362 public:
363363 /* * Returns the number of samples that have elapsed. */
364- Optional <int64_t > getTimeInSamples () const { return getOptional (flagTimeSamples, timeInSamples); }
364+ std::optional <int64_t > getTimeInSamples () const { return getOptional (flagTimeSamples, timeInSamples); }
365365
366366 /* * @see getTimeInSamples() */
367- void setTimeInSamples (Optional <int64_t > timeInSamplesIn) { setOptional (flagTimeSamples, timeInSamples, timeInSamplesIn); }
367+ void setTimeInSamples (std::optional <int64_t > timeInSamplesIn) { setOptional (flagTimeSamples, timeInSamples, timeInSamplesIn); }
368368
369369 /* * Returns the number of seconds that have elapsed. */
370- Optional <double > getTimeInSeconds () const { return getOptional (flagTimeSeconds, timeInSeconds); }
370+ std::optional <double > getTimeInSeconds () const { return getOptional (flagTimeSeconds, timeInSeconds); }
371371
372372 /* * @see getTimeInSamples() */
373- void setTimeInSeconds (Optional <double > timeInSecondsIn) { setOptional (flagTimeSeconds, timeInSeconds, timeInSecondsIn); }
373+ void setTimeInSeconds (std::optional <double > timeInSecondsIn) { setOptional (flagTimeSeconds, timeInSeconds, timeInSecondsIn); }
374374
375375 /* * Returns the bpm, if available. */
376- Optional <double > getBpm () const { return getOptional (flagTempo, tempoBpm); }
376+ std::optional <double > getBpm () const { return getOptional (flagTempo, tempoBpm); }
377377
378378 /* * @see getBpm() */
379- void setBpm (Optional <double > bpmIn) { setOptional (flagTempo, tempoBpm, bpmIn); }
379+ void setBpm (std::optional <double > bpmIn) { setOptional (flagTempo, tempoBpm, bpmIn); }
380380
381381 /* * Returns the time signature, if available. */
382- Optional <TimeSignature> getTimeSignature () const { return getOptional (flagTimeSignature, timeSignature); }
382+ std::optional <TimeSignature> getTimeSignature () const { return getOptional (flagTimeSignature, timeSignature); }
383383
384384 /* * @see getTimeSignature() */
385- void setTimeSignature (Optional <TimeSignature> timeSignatureIn) { setOptional (flagTimeSignature, timeSignature, timeSignatureIn); }
385+ void setTimeSignature (std::optional <TimeSignature> timeSignatureIn) { setOptional (flagTimeSignature, timeSignature, timeSignatureIn); }
386386
387387 /* * Returns host loop points, if available. */
388- Optional <LoopPoints> getLoopPoints () const { return getOptional (flagLoopPoints, loopPoints); }
388+ std::optional <LoopPoints> getLoopPoints () const { return getOptional (flagLoopPoints, loopPoints); }
389389
390390 /* * @see getLoopPoints() */
391- void setLoopPoints (Optional <LoopPoints> loopPointsIn) { setOptional (flagLoopPoints, loopPoints, loopPointsIn); }
391+ void setLoopPoints (std::optional <LoopPoints> loopPointsIn) { setOptional (flagLoopPoints, loopPoints, loopPointsIn); }
392392
393393 /* * The number of bars since the beginning of the timeline.
394394
395395 This value isn't available in all hosts or in all plugin formats.
396396 */
397- Optional <int64_t > getBarCount () const { return getOptional (flagBarCount, barCount); }
397+ std::optional <int64_t > getBarCount () const { return getOptional (flagBarCount, barCount); }
398398
399399 /* * @see getBarCount() */
400- void setBarCount (Optional <int64_t > barCountIn) { setOptional (flagBarCount, barCount, barCountIn); }
400+ void setBarCount (std::optional <int64_t > barCountIn) { setOptional (flagBarCount, barCount, barCountIn); }
401401
402402 /* * The position of the start of the last bar, in units of quarter-notes.
403403
@@ -406,40 +406,40 @@ class YUP_API AudioPlayHead
406406
407407 Note - this value may be unavailable on some hosts, e.g. Pro-Tools.
408408 */
409- Optional <double > getPpqPositionOfLastBarStart () const { return getOptional (flagLastBarStartPpq, lastBarStartPpq); }
409+ std::optional <double > getPpqPositionOfLastBarStart () const { return getOptional (flagLastBarStartPpq, lastBarStartPpq); }
410410
411411 /* * @see getPpqPositionOfLastBarStart() */
412- void setPpqPositionOfLastBarStart (Optional <double > positionIn) { setOptional (flagLastBarStartPpq, lastBarStartPpq, positionIn); }
412+ void setPpqPositionOfLastBarStart (std::optional <double > positionIn) { setOptional (flagLastBarStartPpq, lastBarStartPpq, positionIn); }
413413
414414 /* * The video frame rate, if available. */
415- Optional <FrameRate> getFrameRate () const { return getOptional (flagFrameRate, frame); }
415+ std::optional <FrameRate> getFrameRate () const { return getOptional (flagFrameRate, frame); }
416416
417417 /* * @see getFrameRate() */
418- void setFrameRate (Optional <FrameRate> frameRateIn) { setOptional (flagFrameRate, frame, frameRateIn); }
418+ void setFrameRate (std::optional <FrameRate> frameRateIn) { setOptional (flagFrameRate, frame, frameRateIn); }
419419
420420 /* * The current play position, in units of quarter-notes. */
421- Optional <double > getPpqPosition () const { return getOptional (flagPpqPosition, positionPpq); }
421+ std::optional <double > getPpqPosition () const { return getOptional (flagPpqPosition, positionPpq); }
422422
423423 /* * @see getPpqPosition() */
424- void setPpqPosition (Optional <double > ppqPositionIn) { setOptional (flagPpqPosition, positionPpq, ppqPositionIn); }
424+ void setPpqPosition (std::optional <double > ppqPositionIn) { setOptional (flagPpqPosition, positionPpq, ppqPositionIn); }
425425
426426 /* * For timecode, the position of the start of the timeline, in seconds from 00:00:00:00. */
427- Optional <double > getEditOriginTime () const { return getOptional (flagOriginTime, originTime); }
427+ std::optional <double > getEditOriginTime () const { return getOptional (flagOriginTime, originTime); }
428428
429429 /* * @see getEditOriginTime() */
430- void setEditOriginTime (Optional <double > editOriginTimeIn) { setOptional (flagOriginTime, originTime, editOriginTimeIn); }
430+ void setEditOriginTime (std::optional <double > editOriginTimeIn) { setOptional (flagOriginTime, originTime, editOriginTimeIn); }
431431
432432 /* * Get the host's callback time in nanoseconds, if available. */
433- Optional <uint64_t > getHostTimeNs () const { return getOptional (flagHostTimeNs, hostTimeNs); }
433+ std::optional <uint64_t > getHostTimeNs () const { return getOptional (flagHostTimeNs, hostTimeNs); }
434434
435435 /* * @see getHostTimeNs() */
436- void setHostTimeNs (Optional <uint64_t > hostTimeNsIn) { setOptional (flagHostTimeNs, hostTimeNs, hostTimeNsIn); }
436+ void setHostTimeNs (std::optional <uint64_t > hostTimeNsIn) { setOptional (flagHostTimeNs, hostTimeNs, hostTimeNsIn); }
437437
438438 /* * The current play position, in samples from the start of processing, without looping, if available. */
439- Optional <int64_t > getContinuousTimeInSamples () const { return getOptional (flagContinuousTime, continuousTimeInSamples); }
439+ std::optional <int64_t > getContinuousTimeInSamples () const { return getOptional (flagContinuousTime, continuousTimeInSamples); }
440440
441441 /* * @see getContinuousTimeInSamples() */
442- void setContinuousTimeInSamples (Optional <int64_t > cont) { setOptional (flagContinuousTime, continuousTimeInSamples, cont); }
442+ void setContinuousTimeInSamples (std::optional <int64_t > cont) { setOptional (flagContinuousTime, continuousTimeInSamples, cont); }
443443
444444 /* * True if the transport is currently playing. */
445445 bool getIsPlaying () const { return getFlag (flagIsPlaying); }
@@ -502,18 +502,18 @@ class YUP_API AudioPlayHead
502502 }
503503
504504 template <typename Value>
505- Optional <Value> getOptional (int64_t flagToCheck, Value value) const
505+ std::optional <Value> getOptional (int64_t flagToCheck, Value value) const
506506 {
507- return getFlag (flagToCheck) ? makeOptional (std::move (value)) : nullopt ;
507+ return getFlag (flagToCheck) ? std::make_optional (std::move (value)) : std:: nullopt ;
508508 }
509509
510510 template <typename Value>
511- void setOptional (int64_t flagToCheck, Value& value, Optional <Value> opt)
511+ void setOptional (int64_t flagToCheck, Value& value, std::optional <Value> opt)
512512 {
513- if (opt.hasValue ())
513+ if (opt.has_value ())
514514 value = *opt;
515515
516- setFlag (flagToCheck, opt.hasValue ());
516+ setFlag (flagToCheck, opt.has_value ());
517517 }
518518
519519 enum
@@ -564,7 +564,7 @@ class YUP_API AudioPlayHead
564564 in which a time would make sense, and some hosts will almost certainly have
565565 multithreading issues if it's not called on the audio thread.
566566 */
567- virtual Optional <PositionInfo> getPosition () const = 0;
567+ virtual std::optional <PositionInfo> getPosition () const = 0;
568568
569569 /* * Returns true if this object can control the transport. */
570570 virtual bool canControlTransport ();
0 commit comments