Commits

illume committed 798b1e3

Tests pass on win. Changed version check for loading file likes in
mixer.music.load To > sdl_mixer 1.2.8

  • Participants
  • Parent commits 083254a

Comments (0)

Files changed (2)

         return NULL;
 
     MIXER_INIT_CHECK ();
+/*
+    #if (MIX_MAJOR_VERSION*100*100 + MIX_MINOR_VERSION*100 + MIX_PATCHLEVEL) > 010207
+*/
+#if MIX_MAJOR_VERSION>=1 && MIX_MINOR_VERSION>=2 && MIX_PATCHLEVEL>8
 
-    #if MIX_MAJOR_VERSION*100*100 + MIX_MINOR_VERSION*100 + MIX_PATCHLEVEL >= 010207
+/* this is for loading music from file likes..
+*/
     if(!PyString_Check(file) && !PyUnicode_Check(file))
     {
         rw = RWopsFromPythonThreaded(file);

test/mixer_music_test.py

         
           # pygame.mixer.music.load(filename): return None
           # Load a music file for playback
-        
+
+
         data_fname = os.path.join('examples', 'data')
-        pygame.init()
-        #note, I just added house_lo.mus to svn.
-        #formats = ['ogg', 'wav', 'mp3']
-        formats = ['mp3']
+        pygame.mixer.init()
+
+        formats = ['mp3', 'ogg', 'wav']
+
         for f in formats:
             musfn = os.path.join(data_fname, 'house_lo.%s' % f)
     
             pygame.mixer.music.load(musfn)
-            pygame.mixer.music.load(open(musfn))
-            musf = open(musfn)
-            pygame.mixer.music.load(musf)
+
+            #NOTE: TODO: loading from filelikes are disabled...
+            # because as of writing it only works in SDL_mixer svn.
+            #pygame.mixer.music.load(open(musfn))
+            #musf = open(musfn)
+            #pygame.mixer.music.load(musf)
+        pygame.mixer.quit()
     
     
     def test_queue(self):
         self.assert_(test_not_implemented())
         
 if __name__ == '__main__':
-    unittest.main()
+    unittest.main()