[futurebasic] Re: [FB] ON TIMER event handling

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 2002 : Group Archive : Group : All Groups

From: Ian Mann <i.mann@...>
Date: Fri, 21 Jun 2002 10:59:31 +0100
Alain Pastor wrote:

> Ian Mann wrote:
>
> > I believe that SndStartFilePlay and SndStopFilePlay have been canned in carbon.
> > To keep going you will need to develop QuickTime work rounds.
> >
>
> I was about to post on that topic since I had to do tech support a few
> days ago about SndStartFilePlay not working in Carbon, but I think
> that Richard's problem is to play the sound synchronously. As far as I
> can see in the definition of the function there's an async parameter
> for that purpose I guess.
> As to Carbon, I came up with the following example for a workaround
> (not tested under OS X):
>
> Include "Tlbx QuickTime.Incl"
>
> Clear Local Mode
> Local Fn SndFilePlay ( fSpec As .FSSpec )
> '~'9
> Dim As OSErr   err
> Dim As Movie @ theSound
> Dim As short @ fileRefNum
>
> Long If Fn OpenMovieFile( #fSpec, fileRefNum, _fsRdPerm ) = _noErr
>
> Long If Fn NewMovieFromFile( theSound, ¬
>                         fileRefNum, ¬
>                              #_nil, ¬
>                               _nil, ¬
>                    _newMovieActive, ¬
>                               #_nil ) = _noErr
> err = Fn CloseMovieFile( fileRefNum )
> GoToBeginningOfMovie( theSound )
> StartMovie(theSound)
> Do
> MoviesTask( theSound, 0 )
> Until Fn IsMovieDone( theSound )
>
> End If
> End If
>
> End Fn
>
> // test
> Window 1
>
> Dim theSpec As FSSpec
>
> Long If Fn EnterMovies = _noErr
> Long If Len( Files$( _FSSpecOpen, "","Choisir un fichier son", theSpec
> ) )
> Fn SndFilePlay( theSpec )
> End if
> ExitMovies
> End If
>
> Do
> Handleevents
> Until Fn Button
>
> --

Thanks Alain, that has gone straight into my useful bag.

Painting boat at moment, programming again in autumn.

Regards

Ian