delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/10/30/15:43:27

From: hfernandes AT geocities DOT com (Fernandes, Hilton)
Subject: Re: Multi-media Support
30 Oct 1997 15:43:27 -0800 :
Message-ID: <199710302324.PAA18868.cygnus.gnu-win32@geocities.com>
References: <00088E1F DOT 3272 AT fhssmtp DOT redstone DOT army DOT mil>
Mime-Version: 1.0
To: GBradfor <GBradfor AT fhssmtp DOT redstone DOT army DOT mil>, gnu-win32 AT cygnus DOT com

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

Ben McGunigle[SMTP:ben AT bcgrizzly DOT 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 AT bird DOT fu DOT is DOT saga-u DOT ac DOT 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 AT geocities DOT 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 AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019