/*

	$VER: SampleTime.rexx 1.3 (03.02.98)
	Copyright © 1998 by Kenny Nilsen/Digital Surface

	USAGE: rx SampleTime [samplefile]

	This program let you select a Studio 16 sample file and then
	dumps the length in SMPTE time in both PAL and NTSC.
	If you don't provide a filename as arg it will pop up an requester.

	DEMOPURPOSE ONLY - PUBLIC DOMAIN

 */

options results
address command "LoadQM";if (rc~=0) then exit
address qmaster

parse arg file

	if file="" then do
		GetFile "'Pick a samplefile:'"
		if (rc~=0) then exit;file=result
		end

	GetSamplePrefs "'"file"'" SAMP
	if (rc~=0) then do;say QMASTER.LASTERROR;exit 5;end

	sec=SAMP.SIZE/SAMP.SAMPLERATE

	Video
	vsys=result

	SecondsToSMPTE vsys sec

	say '0a'x||file" - SMPTE "result" ("vsys")"||'0a'x
