comp.lang.ada
 help / color / mirror / Atom feed
* playsound
@ 2005-06-24 13:58 Sylvain
  2005-06-24 14:39 ` playsound Adrien Plisson
  2005-06-24 19:16 ` playsound Bernd Specht
  0 siblings, 2 replies; 3+ messages in thread
From: Sylvain @ 2005-06-24 13:58 UTC (permalink / raw)


Can you give me a piece of code which explain me how to use the
Playsound API please ?

Thx, Bye !



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: playsound
  2005-06-24 13:58 playsound Sylvain
@ 2005-06-24 14:39 ` Adrien Plisson
  2005-06-24 19:16 ` playsound Bernd Specht
  1 sibling, 0 replies; 3+ messages in thread
From: Adrien Plisson @ 2005-06-24 14:39 UTC (permalink / raw)


Sylvain wrote:

> Can you give me a piece of code which explain me how to use the
> Playsound API please ?

are you talking about the PlaySound function in the Microsoft Windows 
API ?

<http://msdn.microsoft.com/library/en-us/multimed/htm/_win32_playsound.asp>

the use of this function is pretty straightforward and described in 
the MSDN. using it from Ada using Win32Ada (i take all those 
informations from your previous post...) is just a matter of 
Ada.Interfaces.C.

heu... well, i see that PlaySound is not in the Win32Ada 
documentation, you may have to import the one in winmm.lib.

> Thx, Bye !

-- 
rien



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: playsound
  2005-06-24 13:58 playsound Sylvain
  2005-06-24 14:39 ` playsound Adrien Plisson
@ 2005-06-24 19:16 ` Bernd Specht
  1 sibling, 0 replies; 3+ messages in thread
From: Bernd Specht @ 2005-06-24 19:16 UTC (permalink / raw)


sisi.ard@laposte.net (Sylvain) wrote in news:e465bcf0.0506240558.5f62f511
@posting.google.com:

> Can you give me a piece of code which explain me how to use the
> Playsound API please ?
> 
> Thx, Bye !
> 

First do a with for the bindings:

with Win32.Mmsystem;


Then call PlaySound like this:

...
    xBool  : Win32.BOOL;
    SoundFName : String := "ringin.wav" & Ascii.Nul;
    function AdrToLpcstr is new Unchecked_Conversion (System.Address, 
Win32.LPCSTR);
  begin
      Conn := Get_Router_State;
      
        if Conn = Is_Connected
        then
          xBool := Win32.Mmsystem.PlaySound (AdrToLpcstr 
(SoundFName'Address), System.Null_Address, Win32.Mmsystem.SND_FILENAME);
        end if;
...



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-06-24 19:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-24 13:58 playsound Sylvain
2005-06-24 14:39 ` playsound Adrien Plisson
2005-06-24 19:16 ` playsound Bernd Specht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox