Patch for MH sound playback on Mac OS X

View: New views
3 Messages — Rating Filter:   Alert me  

Patch for MH sound playback on Mac OS X

by Lieven Hollevoet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello,

I'm trying to setup misterhouse on Max OS X (10.5.8). Since the 'Leopard' version, OS X includes a command line sound player called 'afplay'.

When I try to use this player by setting the mh.ini parameter 'sound_program' to 'afplay', the sound file is played several times and finally, an error message is displayed (Telling: 'Gave up trying to play sound file: ./../sounds/sound_click1.wav').

I think the reason the play fails is because of the fact that there is a minor bug in the 'play' sub in bin/mh.

In that sub, a check is done on '$main::Info{OS_name}'. However, the code there does reference 'OSX' as a valid value for that variable. According to me, the valid value should be 'darwin' instead. In all other references to Info{OS_name} in bin/mh in OS X context, the reference value 'darwin' is used (e.g. in lines 2962 and 5960).

If I change 'OSX' to 'darwin' the sound files are played correctly.

A patch with the change is included as attachment to this mail.

And another remark: according to me there is another small bug on the same line that I fix in the patch: a check is done on $config_parms{sound_fork} eq "fork", but if you check the help for the sound_fork parameter in the ini file, it states that this parameter should be set to '1' to enable forking. If you follow the guidelines of the ini file, the check on the sound_fork parameter will not be true while it actually shoud be. To fix it, the check should be: '$config_parms{sound_fork} == 1'. This fix is not included in the diff file below, as I'm not sure if the inconsistency is in the perl code or in the help section of the ini file.

Best regards,
Lieven.




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


play_patch.diff (719 bytes) Download Attachment

Re: Patch for MH sound playback on Mac OS X

by Lieven Hollevoet :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

as nobody has remarks to the patch, could somebody with SVN access  
commit the change to fix the sound playback bug on Mac OS X?

Thanks!
  Lieven.

Op 24-aug-09, om 17:54 heeft Lieven Hollevoet het volgende geschreven:

> Hello,
>
> I'm trying to setup misterhouse on Max OS X (10.5.8). Since the  
> 'Leopard' version, OS X includes a command line sound player called  
> 'afplay'.
>
> When I try to use this player by setting the mh.ini parameter  
> 'sound_program' to 'afplay', the sound file is played several times  
> and finally, an error message is displayed (Telling: 'Gave up trying  
> to play sound file: ./../sounds/sound_click1.wav').
>
> I think the reason the play fails is because of the fact that there  
> is a minor bug in the 'play' sub in bin/mh.
>
> In that sub, a check is done on '$main::Info{OS_name}'. However, the  
> code there does reference 'OSX' as a valid value for that variable.  
> According to me, the valid value should be 'darwin' instead. In all  
> other references to Info{OS_name} in bin/mh in OS X context, the  
> reference value 'darwin' is used (e.g. in lines 2962 and 5960).
>
> If I change 'OSX' to 'darwin' the sound files are played correctly.
>
> A patch with the change is included as attachment to this mail.
>
> And another remark: according to me there is another small bug on  
> the same line that I fix in the patch: a check is done on  
> $config_parms{sound_fork} eq "fork", but if you check the help for  
> the sound_fork parameter in the ini file, it states that this  
> parameter should be set to '1' to enable forking. If you follow the  
> guidelines of the ini file, the check on the sound_fork parameter  
> will not be true while it actually shoud be. To fix it, the check  
> should be: '$config_parms{sound_fork} == 1'. This fix is not  
> included in the diff file below, as I'm not sure if the  
> inconsistency is in the perl code or in the help section of the ini  
> file.
>
> Best regards,
> Lieven.
>
> <play_patch.diff>


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365


Re: Patch for MH sound playback on Mac OS X

by Gregg Liming :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Lieven Hollevoet wrote:
> as nobody has remarks to the patch, could somebody with SVN access  
> commit the change to fix the sound playback bug on Mac OS X?

done

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365