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