Commits

Anonymous committed 26a1644

ready for 1.5.3

Comments (0)

Files changed (7)

 # BREAK = change breaks existing code
 # BUG	= fixed a bug that was (or could have been) crashing
 
+September 3, 2002
+	passing None as the end time to CD.play() plays to cd end
+	added pygame.vernum, a tuple of python version values
+
 September 2, 2002
 	add Movie.render_frame, thanks James Mazer
 	cursors.load_xbm skips comments, thanks Herve
 
 configcommand = os.environ.get('SDL_CONFIG')
 if not configcommand:
-	hardcoded = '/usr/local/bin/sdl-config'
-	if os.path.isfile(hardcoded)
-	configcommand = hardcoded
+    hardcoded = '/usr/local/bin/sdl-config'
+    if os.path.isfile(hardcoded):
+       configcommand = hardcoded
 else:
-	configcommand = 'sdl-config'
+    configcommand = 'sdl-config'
 configcommand = configcommand + ' --version --cflags --libs'
 
 
 end time in seconds, only that portion of the audio
 track will be played. If you only provide a start time
 and no end time, this will play to the end of the track.
+You can also pass 'None' as the ending time, and it will
+play to the end of the cd.
 </ul><br>&nbsp;<br>
 
 <a name=quit><font size=+2><b>quit
 releases. (hmm, until we get to versions > 10)
 """
 
-ver = '1.5.3'
-
+ver =   '1.5.3'
+vernum = 1,5,3
 <font size=+5><b>Pygame Readme</b></font>
 </td></tr><tr><td align=left width=33%><big>
 
-Version 1.5.2 <br>August 15, 2002
+Version 1.5.3 <br>September 4, 2002
 
 
 </td><td align=center width=34%><big>
-                        Pygame Readme
-   Version 1.5.2
-   August 15, 2002 Python Game Development
+                         Pygame Readme
+   Version 1.5.3
+   September 4, 2002 Python Game Development
    by Pete Shinners http://www.pygame.org
    pete@shinners.org
 
 
      Thanks to those sending in patches and fixes: Niki Spahiev, Gordon
    Tyler, Nathaniel Pryce, Dave Wallace, John Popplewell, Michael Urman,
-   Andrew Straw, Michael Hudson, Ole Martin Bjoerndalen, Herv� Cauwelier
+   Andrew Straw, Michael Hudson, Ole Martin Bjoerndalen, Herv� Cauwelier,
+   James Mazer
 
      And our bug hunters above and beyond: Angus, Guillaume Proux, Frank
    Raiser, Austin Henry, Kaweh Kazemi, Arturo Aldama, Mike Mulcheck, Rene
     /*DOC*/    "end time in seconds, only that portion of the audio\n"
     /*DOC*/    "track will be played. If you only provide a start time\n"
     /*DOC*/    "and no end time, this will play to the end of the track.\n"
+    /*DOC*/    "You can also pass 'None' as the ending time, and it will\n"
+    /*DOC*/    "play to the end of the cd.\n"
     /*DOC*/ ;
 
 static PyObject* cd_play(PyObject* self, PyObject* args)
 {
 	int cd_id = PyCD_AsID(self);
 	SDL_CD* cdrom = cdrom_drivedata[cd_id];
-	int result, track, startframe, numframes;
+	int result, track, startframe, numframes, playforever=0;
 	float start=0.0f, end=0.0f;
+	PyObject *endobject=NULL;
 
-	if(!PyArg_ParseTuple(args, "i|ff", &track, &start, &end))
-		return NULL;
+	if(!PyArg_ParseTuple(args, "i|fO", &track, &start, &endobject))
+	    return NULL;
+	if(endobject == Py_None)
+	    playforever = 1;
+	else if(!PyArg_ParseTuple(args, "i|ff", &track, &start, &end))
+	    return NULL;
 
 	CDROM_INIT_CHECK();
 	if(!cdrom)
 		return RAISE(PyExc_IndexError, "Invalid track number");
 	if(cdrom->track[track].type != SDL_AUDIO_TRACK)
 		return RAISE(PyExc_SDLError, "CD track type is not audio");
-
+	
 	/*validate times*/
+	if(playforever)
+	    end = start;
+	else if(start == end && start != 0.0f)
+	    RETURN_NONE;
+	
 	startframe = (int)(start * CD_FPS);
 	numframes = 0;
 	if(startframe < 0)