at the moment im working on a playlist, like in pro-tools, where the user can import sound files and play them/move them on the timeline by dragging with the mouse.
when i run the plugin in standalone-mode, i need a timecode to let my playbackEngine know the actuall playtime. My first approach was to use atomic doubles and calculate the passed time in the process block by adding 1/f every cycle, but if a high blocksize is choosen, the time leaps are to high(e.g. 46ms for blocksize 2048/44100)
So i changed it and made a timer class with the chrono high_resolution_clock, wich works like a stopwatch. this works fine to get the current position, but strictly speaking, my stopwatch and the processBlock are not synced now.
Since the high_resolution_clock is very accurate, my question now is, how accurate gets the processBlock called time-wise? In my understanding, in the first place it gets called through the soundcard, wich has an own clock for this and should be very precise.
Another option would be making a hybrid between both methods and sync the stopwatch after every block, but is this relly necessery?
Sorry, if this is a really basic question, but I am new to audio-programming.