xref: /aoo41x/main/vcl/inc/os2/salsound.hxx (revision fc9fd3f1)
10d63794cSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
30d63794cSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
40d63794cSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
50d63794cSAndrew Rist  * distributed with this work for additional information
60d63794cSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
70d63794cSAndrew Rist  * to you under the Apache License, Version 2.0 (the
80d63794cSAndrew Rist  * "License"); you may not use this file except in compliance
90d63794cSAndrew Rist  * with the License.  You may obtain a copy of the License at
100d63794cSAndrew Rist  *
110d63794cSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
120d63794cSAndrew Rist  *
130d63794cSAndrew Rist  * Unless required by applicable law or agreed to in writing,
140d63794cSAndrew Rist  * software distributed under the License is distributed on an
150d63794cSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
160d63794cSAndrew Rist  * KIND, either express or implied.  See the License for the
170d63794cSAndrew Rist  * specific language governing permissions and limitations
180d63794cSAndrew Rist  * under the License.
190d63794cSAndrew Rist  *
200d63794cSAndrew Rist  *************************************************************/
210d63794cSAndrew Rist 
220d63794cSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _SV_SALSOUND_HXX
25cdf0e10cSrcweir #define _SV_SALSOUND_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <tools/gen.hxx>
28cdf0e10cSrcweir #include <sv.h>
29cdf0e10cSrcweir #include <tools/string.hxx>
30cdf0e10cSrcweir #include <salframe.hxx>
31cdf0e10cSrcweir #ifndef _SV_SALSTYPE_HXX
32cdf0e10cSrcweir #include <salstype.hxx>
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir #include <salsound.hxx>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir // ------------
37cdf0e10cSrcweir // - SalSound -
38cdf0e10cSrcweir // ------------
39cdf0e10cSrcweir 
40cdf0e10cSrcweir class SalSound
41cdf0e10cSrcweir {
42cdf0e10cSrcweir private:
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 	static HMODULE		mhMCILib;
45cdf0e10cSrcweir 	static ULONG		mnSoundState;
46cdf0e10cSrcweir 	static void*		mpMCIFnc;
47cdf0e10cSrcweir 	SALSOUNDPROC		mpProc;
48cdf0e10cSrcweir 	void*				mpInst;
49cdf0e10cSrcweir 	ULONG				mnStartTime;
50cdf0e10cSrcweir 	ULONG				mnPlayLen;
51cdf0e10cSrcweir 	HWND				mhSoundWnd;
52cdf0e10cSrcweir     USHORT				mnDeviceId;
53cdf0e10cSrcweir 	BOOL				mbLoop;
54cdf0e10cSrcweir 	BOOL				mbPaused;
55cdf0e10cSrcweir 
56cdf0e10cSrcweir public:
57cdf0e10cSrcweir 
58cdf0e10cSrcweir     void                ImplSetError( ULONG nMciErr );
59cdf0e10cSrcweir 	void				ImplNotify( SoundNotification eNotification, ULONG nError );
60cdf0e10cSrcweir 
61cdf0e10cSrcweir public:
62cdf0e10cSrcweir 
63cdf0e10cSrcweir 						SalSound();
64cdf0e10cSrcweir 						~SalSound();
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 	BOOL				Create();
67cdf0e10cSrcweir 	static void			Release();
IsValid()68cdf0e10cSrcweir 	static BOOL			IsValid() { return( SOUND_STATE_VALID == SalSound::mnSoundState ); }
69cdf0e10cSrcweir 
70cdf0e10cSrcweir 	BOOL				Init( SalFrame* pFrame, const String& rSoundName, ULONG& rSoundLen );
71cdf0e10cSrcweir 	BOOL				Init( SalFrame* pFrame, const BYTE* pSound, ULONG nDataLen, ULONG& rSoundLen );
72cdf0e10cSrcweir 	void				Play( ULONG nStartTime, ULONG nPlayTime, BOOL bLoop );
73cdf0e10cSrcweir 	void				Stop();
74cdf0e10cSrcweir 	void				Pause();
75cdf0e10cSrcweir 
SetNotifyProc(void * pInst,SALSOUNDPROC pProc)76cdf0e10cSrcweir 	void				SetNotifyProc( void* pInst, SALSOUNDPROC pProc )
77cdf0e10cSrcweir 							{ mpInst = pInst; mpProc = pProc; }
78cdf0e10cSrcweir };
79cdf0e10cSrcweir 
80cdf0e10cSrcweir #endif // _SV_SALSOUND_HXX
81