[Scummvm-cvs-logs] CVS: scummvm/sound mixer.cpp,1.16,1.17 mixer.h,1.10,1.11

Lionel Ulmer bbrox at users.sourceforge.net
Sun Apr 28 12:50:30 CEST 2002


Update of /cvsroot/scummvm/scummvm/sound
In directory usw-pr-cvs1:/tmp/cvs-serv29816/sound

Modified Files:
	mixer.cpp mixer.h 
Log Message:
MI1 CD audio should work better now. Still a bit flaky but should be
better than before :-)



Index: mixer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** mixer.cpp	27 Apr 2002 07:42:14 -0000	1.16
--- mixer.cpp	28 Apr 2002 14:01:40 -0000	1.17
***************
*** 65,71 ****
  	return insert(handle, new Channel_MP3(this, sound, size, flags));
  }
! int SoundMixer::play_mp3_cdtrack(PlayingSoundHandle *handle, int index, FILE* file, mad_timer_t duration) {
  	/* Stop the previously playing CD track (if any) */
- 	stop(index);
  	return insert(handle, new Channel_MP3_CDMUSIC(this, file, duration));
  }
--- 65,70 ----
  	return insert(handle, new Channel_MP3(this, sound, size, flags));
  }
! int SoundMixer::play_mp3_cdtrack(PlayingSoundHandle *handle, FILE* file, mad_timer_t duration) {
  	/* Stop the previously playing CD track (if any) */
  	return insert(handle, new Channel_MP3_CDMUSIC(this, file, duration));
  }
***************
*** 136,139 ****
--- 135,144 ----
  }
  
+ #ifdef COMPRESSED_SOUND_FILE
+ bool SoundMixer::Channel::sound_finished() {
+ 	warning("Should never be called on a non-MP3 mixer ");
+ 	return false;
+ }
+ #endif
  
  /* RAW mixer */
***************
*** 419,426 ****
  		mad_timer_negate(&frame_duration);
  		mad_timer_add(&_duration, frame_duration);
- 		if (mad_timer_compare(_duration, mad_timer_zero) < 0) {					
- 			real_destroy();
- 			return;
- 		}		
  		if (mad_frame_decode(&_frame, &_stream) == -1) {
  			if (_stream.error == MAD_ERROR_BUFLEN) {
--- 424,427 ----
***************
*** 449,452 ****
--- 450,457 ----
  		_pos_in_frame = 0;
  	}
+ }
+ 
+ bool SoundMixer::Channel_MP3_CDMUSIC::sound_finished() {
+ 	return mad_timer_compare(_duration, mad_timer_zero) <= 0;
  }
  

Index: mixer.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/mixer.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** mixer.h	27 Apr 2002 07:42:14 -0000	1.10
--- mixer.h	28 Apr 2002 14:01:40 -0000	1.11
***************
*** 37,40 ****
--- 37,43 ----
  		void destroy() { _to_be_destroyed = true; }
  		virtual void real_destroy() = 0;
+ #ifdef COMPRESSED_SOUND_FILE
+ 		virtual bool sound_finished();
+ #endif
  	};
  
***************
*** 92,95 ****
--- 95,99 ----
  		Channel_MP3_CDMUSIC(SoundMixer *mixer, FILE* file, mad_timer_t duration);
  		void real_destroy();		
+ 		bool sound_finished();
  	};
  
***************
*** 127,131 ****
  #ifdef COMPRESSED_SOUND_FILE
  	int play_mp3(PlayingSoundHandle *handle, void *sound, uint32 size, byte flags);
! 	int play_mp3_cdtrack(PlayingSoundHandle *handle, int index, FILE* file, mad_timer_t duration);
  #endif
  
--- 131,135 ----
  #ifdef COMPRESSED_SOUND_FILE
  	int play_mp3(PlayingSoundHandle *handle, void *sound, uint32 size, byte flags);
! 	int play_mp3_cdtrack(PlayingSoundHandle *handle, FILE* file, mad_timer_t duration);
  #endif
  





More information about the Scummvm-git-logs mailing list