Where in code the length of current track can be found?

In SelectionBar.cpp I need the length of the current track, thus the ‘Audio Position’ resulting from the ‘Skip to End’ knob being pressed.
Where can I find that info and how can I make that info available in the SelectionBar class?

Thanks for any suggestions!
jerome42

Look for a variable:
t1
t0 is the beginning of the selection and t1 is the end of the selection; if the entire track is selected then
t0 = 0
(time zero) and
t1 = ( the timestamp of the final sample)

Thanks Edgar for showing me the way to this code fragment which I could copy to and use in SelectionBar.cpp without any compiler problems:

         AudacityProject *p = GetActiveProject();
         if (p)
         {
            p->SkipEnd(true);
            double playRegionStart, playRegionEnd;
            p->GetPlayRegion(&playRegionStart, &playRegionEnd);
         }

The extra p->SkipEnd(true) line brought me the correct value for playRegionEnd;
Regards, jerome42