The right format (SOLVED)

Just starting out? Need help? Post your questions and find answers here.
codeit
User
User
Posts: 62
Joined: Sat Apr 15, 2017 5:53 pm
Location: Leicestershire

The right format (SOLVED)

Post by codeit »

Hi,
Just wondering if anyone knows the right format for these two commands

Code: Select all

CocoaMessage(@duration.d, mp3Object, "duration")
CocoaMessage(@currentTime.d, mp3Object, "currentTime")
I can't work out how to produce the duration in a readable format.

Thanks
Last edited by codeit on Thu Jul 20, 2017 9:54 am, edited 1 time in total.
wilbert
PureBasic Expert
PureBasic Expert
Posts: 3870
Joined: Sun Aug 08, 2004 5:21 am
Location: Netherlands

Re: The right format

Post by wilbert »

Both duration and currentTime are the time in seconds.
You can use FormatDate to split it into hours, minutes and seconds.

Code: Select all

CocoaMessage(@duration.d, mp3Object, "duration")
Debug FormatDate("%hh:%ii:%ss", duration)
By the way, you might want to consider posting Mac specific questions in the Mac OSX forum
http://www.purebasic.fr/english/viewforum.php?f=19
Windows (x64)
Raspberry Pi OS (Arm64)
codeit
User
User
Posts: 62
Joined: Sat Apr 15, 2017 5:53 pm
Location: Leicestershire

Re: The right format

Post by codeit »

Thanks for the help
Post Reply