Subject: Re: Multi-media Support
From: [email-masked] (Fernandes, Hilton)

30 Oct 1997 15:43:27 -0800
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7BIT
To: GBradfor <[email-masked]>, [email-masked]

On 28 Oct 97 at 15:36, GBradfor <[email-masked]>  wrote:

>      YANQ ("Yet Another Newbie Question"):
>      
>      Is the playing of .WAV files supported within the cygwin32 libraries?  
>      Specifically, is there the equivalent of PlaySound?  If so, where is 
>      this documented?  What .h files should be included, and what libraries 
>      should be linked in?
>      

Hi!

Please read the following message of Colin Peters, that answered a quest like
yours.  It is a sure candidate for a FAQ, don't you think?

Best regards,
++Hilton

-------------------------------------------------------------------------------
From:             Colin Peters <[email-masked]>
To:               "'Ben McGunigle'" <[email-masked]>
Copies to:        "'GNU-Win32'" <[email-masked]>
Subject:          RE: Problems with Petzold programs
Date sent:        Wed, 8 Oct 1997 11:27:32 +0900

Ben McGunigle[SMTP:[email-masked]] wrote:
>I am learning Win95 programming using the Petzold book and the
>minimalist compiler. I have had trouble with the PlaySound()
>function and the SND_* defines being nonexistent (Example
>program hellowin.c). The SM_RESERVED1 - 4 defines (sysmets.h)
>are likewise absent from the header files. I assume they are
>present by default in the MS compiler recommended by the book

As for the mmsystem.h stuff, it is, as far as I know, completely
missing from the current GNU Win32 API include files. Here is a
short replacement which contains only enough to get that
particular Petzold example to compile:

/*
 * Temporary mmsystem.h because GNU-Win32 doesn't have one yet.
 */

#ifndef _MMSYSTEM_H_
#define _MMSYSTEM_H_

#ifdef	__cplusplus
extern "C" {
#endif

/* Flags for PlaySound */
#define SND_SYNC        0x00000000
#define SND_ASYNC       0x00000001
#define SND_NODEFAULT   0x00000002
#define SND_MEMORY      0x00000004
#define SND_LOOP        0x00000008
#define SND_NOSTOP      0x00000010
#define SND_PURGE       0x00000040
#define SND_APPLICATION 0x00000080
#define SND_NOWAIT      0x00002000
#define SND_ALIAS       0x00010000
#define SND_FILENAME    0x00020000
#define SND_RESOURCE    0x00040004
#define SND_ALIAS_ID    0x00110000

BOOL WINAPI PlaySoundA (LPCSTR pszSound, HMODULE hmod, DWORD
fdwSound); BOOL WINAPI PlaySoundW (LPCWSTR pszSound, HMODULE
hmod, DWORD fdwSound);

#ifdef UNICODE
#define PlaySound PlaySoundW
#else
#define PlaySound PlaySoundA
#endif

#ifdef __cplusplus
}
#endif

#endif /* Not defined _MMSYSTEM_H_ */

The defintions of SM_RESERVED1 - 4 are also not included
(probably since nobody would ever use them normally) but here
they are so that you can add them to Defines.h:

#define SM_RESERVED1 (24)
#define SM_RESERVED2 (25)
#define SM_RESERVED3 (26)
#define SM_RESERVED4 (27)

I don't know if Scott Christley is the maintainer of the GNU
Win32 API header files, but his name and email address are at
the top of them, so he might be someone to talk to about fixing
bugs and ommissions.

Good luck,
Colin.

-- Colin Peters - Saga Univ. Dept. of Information Science
-- [email-masked] - finger for PGP public key --
http://www.fu.is.saga-u.ac.jp/~colin/index.html --
http://www.geocities.com/Tokyo/Towers/6162/

----
Hilton Fernandes
[email-masked]
http://www.geocities.com/SiliconValley/Lakes/5657
URLs and help on C++ programming and Object-Oriented Design
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".