Problem with function Tone FWH 8.04

Postby Antonio Linares » Thu May 22, 2008 8:17 am

Roger,

Thanks for your feedback,

Yes, that function uses the internal speaker
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41476
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Roger Seiler » Thu May 22, 2008 1:53 pm

Confirmed: this "PRAGMA" solution works here on both internal and external speakers, and on XP Pro and Vista Home Premium.
User avatar
Roger Seiler
 
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA

Postby Antonio Linares » Thu May 22, 2008 4:25 pm

Roger,

Thanks for the info,

Could you please post a sample with the parameters that you supply to the function ? Thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41476
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Roger Seiler » Thu May 22, 2008 9:07 pm

Code: Select all  Expand view
// The following procs provide various sounds which can be requested from
// anywhere in the app...


PROCEDURE Correct()
tunes({ {392,2}, {523,2}, {880,2}, {1046,8} } )
RETURN

PROCEDURE Wrong()
tunes( { {164,10} } )
RETURN

PROCEDURE TheFifth()
tunes( { {392,2}, {392,2}, {392,2}, {311,8} } )
RETURN

PROCEDURE NannyBoo()
tunes( { {196,4}, {196,4}, {164,4}, {220,4}, {196,8}, {164,8} } )
RETURN

PROCEDURE tunes(aSong)
aeval(aSong, { | a | MYTONE(a[1], a[2]) } )
RETURN

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

HB_FUNC( MYTONE )
{
   Beep( hb_parnl( 1 ), hb_parnl( 2 ) * 70 );
}

#pragma ENDDUMP

User avatar
Roger Seiler
 
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA

Postby Roger Seiler » Thu May 22, 2008 9:15 pm

Here it is again with a little explanation...

Code: Select all  Expand view
// The following procs provide various sounds which can be
// requested from anywhere in the app...

// Here are 4 "songs", each of which can be requested...

PROCEDURE Correct()
tunes({ {392,2}, {523,2}, {880,2}, {1046,8} } )
RETURN

PROCEDURE Wrong()
tunes( { {164,10} } )
RETURN

PROCEDURE TheFifth()
tunes( { {392,2}, {392,2}, {392,2}, {311,8} } )
RETURN

PROCEDURE NannyBoo()
tunes( { {196,4}, {196,4}, {164,4}, {220,4}, {196,8}, {164,8} } )
RETURN

// Now here is where a song gets initially processed...

PROCEDURE tunes(aSong)
aeval(aSong, { | a | MYTONE(a[1], a[2]) } )
RETURN

// And here is where the C code takes over to finish the job...

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>

HB_FUNC( MYTONE )
{
   Beep( hb_parnl( 1 ), hb_parnl( 2 ) * 70 );
}

#pragma ENDDUMP

User avatar
Roger Seiler
 
Posts: 223
Joined: Thu Dec 01, 2005 3:34 pm
Location: Nyack, New York, USA

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 46 guests