DisposeMovie(m_movie);
m_movie = NULL ;
Stop();
+
+ //Note that ExitMovies() is not neccessary, but
+ //the docs are fuzzy on whether or not TerminateQTML is
+ ExitMovies();
+
+ #ifndef __WXMAC__
+ TerminateQTML();
+ #endif
}
void Notify()
long result;
error = Gestalt (gestaltQuickTime, &result);
- return (error == noErr) && (result >= 4); //result >= 4 correct?
+ return (error == noErr) && (((result >> 16) & 0xffff) >= 0x0400);
#else
return true;
#endif
wxSound::~wxSound()
{
- FreeData();
}
bool wxSound::Create(const wxString& fileName, bool isResource)
if(!wxInitQT())
return false;
+ FreeData();
+
if (isResource)
{
#ifdef __WXMAC__
bool wxSound::DoPlay(unsigned flags) const
{
- wxASSERT(m_pTimer == NULL || !((wxTimer*)m_pTimer)->IsRunning() );
+// wxASSERT(m_pTimer == NULL || !((wxTimer*)m_pTimer)->IsRunning() );
+ FreeData();
Movie movie;
SetMovieVolume(movie, kFullVolume);
GoToBeginningOfMovie(movie);
+
+ DisposeHandle(myHandle);
}
break;
case wxSound_RESOURCE:
//Start the movie!
StartMovie(movie);
- if (flags & wxSOUND_SYNC)
+ if (flags & wxSOUND_ASYNC)
+ {
+ //Start timer and play movie asyncronously
+ ((wxQTTimer*&)m_pTimer) = new wxQTTimer(movie, flags & wxSOUND_LOOP ? 1 : 0);
+ ((wxQTTimer*)m_pTimer)->Start(MOVIE_DELAY, wxTIMER_CONTINUOUS);
+ }
+ else
{
wxASSERT_MSG(!(flags & wxSOUND_LOOP), "Can't loop and play syncronously at the same time");
DisposeMovie(movie);
}
- else
- {
- //Start timer and play movie asyncronously
- ((wxQTTimer*&)m_pTimer) = new wxQTTimer(movie, flags & wxSOUND_LOOP ? 1 : 0);
- ((wxQTTimer*)m_pTimer)->Start(MOVIE_DELAY, wxTIMER_CONTINUOUS);
- }
return true;
}
m_pTimer = NULL;
}
- //Note that ExitMovies() is not neccessary, but
- //the docs are fuzzy on whether or not TerminateQTML is
- ExitMovies();
-
-#ifndef __WXMAC__
- TerminateQTML();
-#endif
return true;
}
#endif //wxUSE_SOUND
+
+
+