Commits

Anonymous committed 841ce59

music.play start time works

Comments (0)

Files changed (33)

 # BREAK = change breaks existing code
 # BUG	= fixed a bug that was (or could have been) crashing
 
+May 8, 2002
+	music.play() start time works
+
 May 7, 2002
 	added the sndarray module
 	added surfarray.make_surface()
 <a href=ref/Sound.html>Sound</a> || 
 <a href=ref/Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=ref/pygame_cursors.html>cursors</a> || 
-<a href=ref/pygame_sprite.html>sprite</a> || 
-<a href=ref/pygame_version.html>version</a> ||<br>
+<a href=ref/pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>
 <a href=ref/pygame_transform.html#rotate>pygame.transform.rotate</a> - rotate a Surface<br>
 <a href=ref/pygame_transform.html#rotozoom>pygame.transform.rotozoom</a> - smoothly scale and/or rotate an image<br>
 <a href=ref/pygame_transform.html#scale>pygame.transform.scale</a> - scale a Surface to an arbitrary size<br>
-<a href=ref/pygame_version.html#ver>pygame.version.ver</a> - The current pygame version info<br>
 <!--ENDINDEX-->
 </ul>
 
 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/Channel.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/Clock.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/Font.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/Joystick.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/Movie.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/Rect.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/Sound.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/Surface.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_cdrom.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_constants.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_cursors.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_display.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_draw.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_event.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_font.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_image.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_joystick.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_key.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_mixer.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_mixer_music.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>
 song starts playing. The starting position is dependent on the
 format of music playing. MP3 and OGG use the position as time
 (in seconds). MOD music it is the pattern order number. Passing
-a startpos will raise an exception if it cannot set the starting
-position (or your version of SDL_mixer is too old)
+a startpos will raise a NotImplementedError if it cannot set the
+start position (or your version of SDL_mixer is too old)
 </ul><br>&nbsp;<br>
 
 <a name=rewind><font size=+2><b>rewind

docs/ref/pygame_mouse.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_movie.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_sndarray.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_sprite.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>
 </b></font><br><font size=+1><tt>
 pygame.sprite.Group.update(...)
 </tt></font><ul>
-           calls the update method for all sprites in
-           the group. any arguments are passed to the update
-           function.
+           calls the update method for all sprites in the group.
+           passes all arguments are to the Sprite update function.
 </ul><br>&nbsp;<br>
 
 <a name=GroupSingle><font size=+2><b>GroupSingle
 </tt></font><ul>
            Clears the area of all drawn sprites. the bgd
            argument should be Surface which is the same
-           dimensions as the surface.
+           dimensions as the surface. The bgd can also be
+           a function which gets called with the passed
+           surface and the area to be cleared.
 </ul><br>&nbsp;<br>
 
 <a name=RenderClear.draw><font size=+2><b>RenderClear.draw
        given a sprite and a group of sprites, this will
        return a list of all the sprites that intersect
        the given sprite.
-       all sprites must have a "rect" method, which is a
+       all sprites must have a "rect" value, which is a
        rectangle of the sprite area. if the dokill argument
        is true, the sprites that do collide will be
        automatically removed from all groups.
        spritecollide function, this function will be a
        bit quicker.
        
-       all sprites must have a "rect" method, which is a
-       rectangle of the sprite area. if the dokill argument
-       is true, the sprites that do collide will be
-       automatically removed from all groups.
+       all sprites must have a "rect" value, which is a
+       rectangle of the sprite area.
 </ul><br>&nbsp;<br>
 
 

docs/ref/pygame_surfarray.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_time.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>

docs/ref/pygame_transform.html

 <a href=Sound.html>Sound</a> || 
 <a href=Surface.html>Surface</a> ||<br>
 &nbsp;<br>|| <a href=pygame_cursors.html>cursors</a> || 
-<a href=pygame_sprite.html>sprite</a> || 
-<a href=pygame_version.html>version</a> ||<br>
+<a href=pygame_sprite.html>sprite</a> ||<br>
 
 
 </td></tr></table></td></tr></table>
 #if MIX_MAJOR_VERSION>=1 && MIX_MINOR_VERSION>=2 && MIX_PATCHLEVEL>=3
                 /*Mix_ChannelFinished(some_callback);*/
 #endif
+                
+              	Mix_VolumeMusic(127);
 	}
 	return PyInt_FromLong(1);
 }
     /*DOC*/    "song starts playing. The starting position is dependent on the\n"
     /*DOC*/    "format of music playing. MP3 and OGG use the position as time\n"
     /*DOC*/    "(in seconds). MOD music it is the pattern order number. Passing\n"
-    /*DOC*/    "a startpos will raise an exception if it cannot set the starting\n"
-    /*DOC*/    "position (or your version of SDL_mixer is too old)\n"
+    /*DOC*/    "a startpos will raise a NotImplementedError if it cannot set the\n"
+    /*DOC*/    "start position (or your version of SDL_mixer is too old)\n"
     /*DOC*/ ;
 
 static PyObject* music_play(PyObject* self, PyObject* args)
 {
 	int loops=0;
         float startpos=0.0;
-	int val;
+	int val, volume;
 
 	if(!PyArg_ParseTuple(args, "|if", &loops, &startpos))
 		return NULL;
 	music_pos_time = SDL_GetTicks();
 
 #if MIX_MAJOR_VERSION>=1 && MIX_MINOR_VERSION>=2 && MIX_PATCHLEVEL>=3
-        val = Mix_FadeInMusicPos(current_music, loops, 1, startpos);
+        volume = Mix_VolumeMusic(-1);
+        val = Mix_FadeInMusicPos(current_music, loops, 0, startpos);
+        Mix_VolumeMusic(volume);
 #else
         if(startpos)
             return RAISE(PyExc_NotImplementedError, "music start position requires SDL_mixer-1.2.4");
 	PyObject *module;
 
 	PyMIXER_C_API[0] = PyMIXER_C_API[0]; /*clean an unused warning*/
-
-    /* create the module */
+        /* create the module */
 	module = Py_InitModule3("mixer_music", music_builtins, doc_pygame_mixer_music_MODULE);
 	PyModule_AddObject(module, "_MUSIC_POINTER", PyCObject_FromVoidPtr(&current_music, NULL));