This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Multi-media Support


On 28 Oct 97 at 15:36, GBradfor <GBradfor@fhssmtp.redstone.army.mil>  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 <colin@bird.fu.is.saga-u.ac.jp>
To:               "'Ben McGunigle'" <ben@bcgrizzly.com>
Copies to:        "'GNU-Win32'" <gnu-win32@cygnus.com>
Subject:          RE: Problems with Petzold programs
Date sent:        Wed, 8 Oct 1997 11:27:32 +0900

Ben McGunigle[SMTP:ben@bcgrizzly.com] 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
-- colin@bird.fu.is.saga-u.ac.jp - 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
hfernandes@geocities.com
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
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]