[Scummvm-cvs-logs] CVS: scummvm/morphos morphos.cpp,1.9,1.10 morphos.h,1.2,1.3

Ruediger Hanke tomjoad at users.sourceforge.net
Tue Apr 16 13:29:09 CEST 2002


Update of /cvsroot/scummvm/scummvm/morphos
In directory usw-pr-cvs1:/tmp/cvs-serv7755/morphos

Modified Files:
	morphos.cpp morphos.h 
Log Message:
MorphOS CD audio reenableeSystem()

Index: morphos.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/morphos/morphos.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** morphos.cpp	16 Apr 2002 12:07:18 -0000	1.9
--- morphos.cpp	16 Apr 2002 20:28:56 -0000	1.10
***************
*** 289,295 ****
  }
  
! void cd_play( Scumm *s, int track, int num_loops, int start_frame, int length )
  {
! /*	  if( CDrive && start_frame >= 0 )
  	{
  		struct CDS_TrackInfo ti;
--- 289,295 ----
  }
  
! void OSystem_MorphOS::play_cdrom( int track, int num_loops, int start_frame, int length )
  {
! 	if( CDrive && start_frame >= 0 )
  	{
  		struct CDS_TrackInfo ti;
***************
*** 310,342 ****
  		
  		CDDA_GetTrackInfo( CDrive, track, 0, &ti );
! 		cd_end_time = GetTicks() + ti.ti_TrackLength.tm_Format.tm_Frame * 1000 / 75;
! 	}*/
  }
  
  // Schedule the music to be stopped after 1/10 sec, unless another
  // track is started in the meantime.
! void cd_stop()
  {
! /*	  cd_stop_time = GetTicks() + 100;
! 	cd_num_loops = 0;*/
  }
  
! int cd_is_running()
  {
! /*	  ULONG status;
  
  	if( CDrive == NULL )
! 		return 0;
  
  	CDDA_GetAttr( CDDA_Status, CDrive, &status );
! 	return (cd_num_loops != 0 && (GetTicks() < cd_end_time || status != CDDA_Status_Ready));*/
! 	return FALSE;
  }
  
! void cd_music_loop()
  {
! /*	  if( CDrive )
  	{
! 		if( cd_stop_time != 0 && GetTicks() >= cd_stop_time )
  		{
  			CDDA_Stop( CDrive );
--- 310,341 ----
  		
  		CDDA_GetTrackInfo( CDrive, track, 0, &ti );
! 		cd_end_time = get_msecs() + ti.ti_TrackLength.tm_Format.tm_Frame * 1000 / 75;
! 	}
  }
  
  // Schedule the music to be stopped after 1/10 sec, unless another
  // track is started in the meantime.
! void OSystem_MorphOS::stop_cdrom()
  {
! 	cd_stop_time = get_msecs() + 100;
! 	cd_num_loops = 0;
  }
  
! bool OSystem_MorphOS::poll_cdrom()
  {
! 	ULONG status;
  
  	if( CDrive == NULL )
! 		return false;
  
  	CDDA_GetAttr( CDDA_Status, CDrive, &status );
! 	return (cd_num_loops != 0 && (get_msecs() < cd_end_time || status != CDDA_Status_Ready));
  }
  
! void OSystem_MorphOS::update_cdrom()
  {
! 	if( CDrive )
  	{
! 		if( cd_stop_time != 0 && get_msecs() >= cd_stop_time )
  		{
  			CDDA_Stop( CDrive );
***************
*** 345,349 ****
  			return;
  		}
! 		if( cd_num_loops == 0 || GetTicks() < cd_end_time )
  			return;
  
--- 344,348 ----
  			return;
  		}
! 		if( cd_num_loops == 0 || get_msecs() < cd_end_time )
  			return;
  
***************
*** 369,375 ****
  		
  			CDDA_GetTrackInfo( CDrive, cd_track, 0, &ti );
! 			cd_end_time = GetTicks() + ti.ti_TrackLength.tm_Format.tm_Frame * 1000 / 75;
  		}
! 	}*/
  }
  
--- 368,374 ----
  		
  			CDDA_GetTrackInfo( CDrive, cd_track, 0, &ti );
! 			cd_end_time = get_msecs() + ti.ti_TrackLength.tm_Format.tm_Frame * 1000 / 75;
  		}
! 	}
  }
  

Index: morphos.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/morphos/morphos.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** morphos.h	16 Apr 2002 12:07:18 -0000	1.2
--- morphos.h	16 Apr 2002 20:28:56 -0000	1.3
***************
*** 78,81 ****
--- 78,94 ----
  		virtual uint32 property(int param, uint32 value);
  
+ 		// Poll cdrom status
+ 		// Returns true if cd audio is playing
+ 		virtual bool poll_cdrom();
+ 
+ 		// Play cdrom audio track
+ 		virtual void play_cdrom(int track, int num_loops, int start_frame, int length);
+ 
+ 		// Stop cdrom audio track
+ 		virtual void stop_cdrom();
+ 
+ 		// Update cdrom audio status
+ 		virtual void update_cdrom();
+ 
  		// Quit
  		virtual void quit();
***************
*** 150,153 ****
--- 163,168 ----
  		CDRIVEPTR 		 CDrive;
  		ULONG 			 CDDATrackOffset;
+ 		int 				 cd_track, cd_num_loops, cd_start_frame, cd_end_frame;
+ 		uint32 			 cd_end_time, cd_stop_time, cd_next_second;
  
  		/* Scaling-related attributes */





More information about the Scummvm-git-logs mailing list