RealtimePlaybackInfo

Table of contents

  1. Description
  2. Accessing the RealtimePlaybackInfo

Description

The RealtimePlaybackInfo data type contains information about the current playback state of the DAW (e.g. play, pause, stop, etc.).

This information is available in all threads in a variable called realtimePlaybackInfo.

Accessing the RealtimePlaybackInfo

To get the current playback state, follow these steps:

  1. Get the data using the get() method
    auto realtime_playback_info = realtimePlaybackInfo->get();
  1. All information are now directly available in the realtime_playback_info variable:
auto sample_rate = realtime_playback_info.sample_rate;
auto buffer_size_in_samples = realtime_playback_info.buffer_size_in_samples;
auto qpm = realtime_playback_info.qpm;
auto numerator = realtime_playback_info.numerator;
auto denominator = realtime_playback_info.denominator;
auto isPlaying = realtime_playback_info.isPlaying;
auto isRecording = realtime_playback_info.isRecording;
auto current_time_in_samples = realtime_playback_info.time_in_samples;
auto current_time_in_seconds = realtime_playback_info.time_in_seconds;
auto current_time_in_quarterNotes = realtime_playback_info.time_in_ppq;
auto isLooping = realtime_playback_info.isLooping;
auto loopStart_in_quarterNotes = realtime_playback_info.loop_start_in_ppq;
auto loopEnd_in_quarterNotes = realtime_playback_info.loop_end_in_ppq;
auto last_bar_pos_in_quarterNotes = realtime_playback_info.ppq_position_of_last_bar_start;

Not every DAW supports all of these features. If these values are not available in your DAW, they will be set to -1.

You should avoid using these values in ITP during your tokenization process. Rather, use the information available in the EventFromHost data type.

The reason for this is that the host status bundled in the EventFromHost data type corresponds to the time the event was registered, which can very well be different from the realtime playback status.