]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/sound.cpp
invalidate m_selection in DoRemovePage(), not in DeletePage() (replaces patch 998984)
[wxWidgets.git] / src / mac / carbon / sound.cpp
index 17e46752a830d6bde04716da04a55e77c5582ade..21ea8612ad2b6efb12cc5d07beda503a0a41ba5e 100644 (file)
@@ -88,6 +88,14 @@ public:
         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()
@@ -173,7 +181,7 @@ Boolean wxIsQuickTime4Installed (void)
     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
@@ -219,7 +227,6 @@ wxSound::wxSound(int size, const wxByte* data)
 
 wxSound::~wxSound()
 {
-    FreeData();
 }
 
 bool wxSound::Create(const wxString& fileName, bool isResource)
@@ -227,6 +234,8 @@ bool wxSound::Create(const wxString& fileName, bool isResource)
     if(!wxInitQT())
         return false;
 
+    FreeData();
+
     if (isResource)
     {
 #ifdef __WXMAC__
@@ -253,7 +262,8 @@ bool wxSound::Create(const wxString& fileName, bool isResource)
 
 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;
 
@@ -302,6 +312,8 @@ bool wxSound::DoPlay(unsigned flags) const
 
             SetMovieVolume(movie, kFullVolume);
             GoToBeginningOfMovie(movie);
+
+            DisposeHandle(myHandle);
         }
         break;
     case wxSound_RESOURCE:
@@ -420,13 +432,9 @@ bool wxSound::FreeData()
         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
+
+
+