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
Where in code the length of current track can be found?
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Re: Where in code the length of current track can be found?
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)
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)
Re: Where in code the length of current track can be found?
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:
The extra p->SkipEnd(true) line brought me the correct value for playRegionEnd;
Regards, jerome42
Code: Select all
AudacityProject *p = GetActiveProject();
if (p)
{
p->SkipEnd(true);
double playRegionStart, playRegionEnd;
p->GetPlayRegion(&playRegionStart, &playRegionEnd);
}
Regards, jerome42