1*24f6443dSAndrew Rist /************************************************************** 2fc9fd3f1SPedro Giffuni * 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 10fc9fd3f1SPedro Giffuni * 11*24f6443dSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12fc9fd3f1SPedro Giffuni * 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. 19fc9fd3f1SPedro Giffuni * 20*24f6443dSAndrew Rist *************************************************************/ 21*24f6443dSAndrew Rist 22*24f6443dSAndrew Rist 23fc9fd3f1SPedro Giffuni 24fc9fd3f1SPedro Giffuni #ifndef _SV_SALSOUND_H 25fc9fd3f1SPedro Giffuni #define _SV_SALSOUND_H 26fc9fd3f1SPedro Giffuni 27fc9fd3f1SPedro Giffuni #include <tools/gen.hxx> 28fc9fd3f1SPedro Giffuni #include <sv.h> 29fc9fd3f1SPedro Giffuni #include <tools/string.hxx> 30fc9fd3f1SPedro Giffuni #include <vcl/salframe.hxx> 31fc9fd3f1SPedro Giffuni #ifndef _SV_SALSTYPE_HXX 32fc9fd3f1SPedro Giffuni #include <vcl/salstype.hxx> 33fc9fd3f1SPedro Giffuni #endif 34fc9fd3f1SPedro Giffuni #include <vcl/salsound.hxx> 35fc9fd3f1SPedro Giffuni 36fc9fd3f1SPedro Giffuni // ------------ 37fc9fd3f1SPedro Giffuni // - SalSound - 38fc9fd3f1SPedro Giffuni // ------------ 39fc9fd3f1SPedro Giffuni 40fc9fd3f1SPedro Giffuni //class SalSound 41fc9fd3f1SPedro Giffuni class Os2SalSound : public SalSound 42fc9fd3f1SPedro Giffuni { 43fc9fd3f1SPedro Giffuni private: 44fc9fd3f1SPedro Giffuni 45fc9fd3f1SPedro Giffuni static HMODULE mhMCILib; 46fc9fd3f1SPedro Giffuni static ULONG mnSoundState; 47fc9fd3f1SPedro Giffuni static void* mpMCIFnc; 48fc9fd3f1SPedro Giffuni SALSOUNDPROC mpProc; 49fc9fd3f1SPedro Giffuni void* mpInst; 50fc9fd3f1SPedro Giffuni ULONG mnStartTime; 51fc9fd3f1SPedro Giffuni ULONG mnPlayLen; 52fc9fd3f1SPedro Giffuni HWND mhSoundWnd; 53fc9fd3f1SPedro Giffuni USHORT mnDeviceId; 54fc9fd3f1SPedro Giffuni BOOL mbLoop; 55fc9fd3f1SPedro Giffuni BOOL mbPaused; 56fc9fd3f1SPedro Giffuni 57fc9fd3f1SPedro Giffuni public: 58fc9fd3f1SPedro Giffuni 59fc9fd3f1SPedro Giffuni void ImplSetError( ULONG nMciErr ); 60fc9fd3f1SPedro Giffuni void ImplNotify( SoundNotification eNotification, ULONG nError ); 61fc9fd3f1SPedro Giffuni 62fc9fd3f1SPedro Giffuni public: 63fc9fd3f1SPedro Giffuni 64fc9fd3f1SPedro Giffuni BOOL Create(); 65fc9fd3f1SPedro Giffuni //static BOOL IsValid() { return( SOUND_STATE_VALID == Os2SalSound::mnSoundState ); } 66fc9fd3f1SPedro Giffuni //BOOL Init( SalFrame* pFrame, const String& rSoundName, ULONG& rSoundLen ); 67fc9fd3f1SPedro Giffuni //BOOL Init( SalFrame* pFrame, const BYTE* pSound, ULONG nDataLen, ULONG& rSoundLen ); 68fc9fd3f1SPedro Giffuni SetNotifyProc(void * pInst,SALSOUNDPROC pProc)69fc9fd3f1SPedro Giffuni void SetNotifyProc( void* pInst, SALSOUNDPROC pProc ) 70fc9fd3f1SPedro Giffuni { mpInst = pInst; mpProc = pProc; } 71fc9fd3f1SPedro Giffuni public: 72fc9fd3f1SPedro Giffuni Os2SalSound(); 73fc9fd3f1SPedro Giffuni virtual ~Os2SalSound(); 74fc9fd3f1SPedro Giffuni 75fc9fd3f1SPedro Giffuni virtual bool IsValid(); 76fc9fd3f1SPedro Giffuni virtual bool Init( const String& rSoundName, ULONG& rSoundLen ); 77fc9fd3f1SPedro Giffuni virtual void Play( ULONG nStartTime, ULONG nPlayTime, bool bLoop ); 78fc9fd3f1SPedro Giffuni virtual void Stop(); 79fc9fd3f1SPedro Giffuni virtual void Pause(); 80fc9fd3f1SPedro Giffuni virtual void Continue(); 81fc9fd3f1SPedro Giffuni virtual bool IsLoopMode() const; 82fc9fd3f1SPedro Giffuni virtual bool IsPlaying() const; 83fc9fd3f1SPedro Giffuni virtual bool IsPaused() const; 84fc9fd3f1SPedro Giffuni 85fc9fd3f1SPedro Giffuni bool ImplCreate(); 86fc9fd3f1SPedro Giffuni void ImplDestroy(); 87fc9fd3f1SPedro Giffuni static void Release(); 88fc9fd3f1SPedro Giffuni }; 89fc9fd3f1SPedro Giffuni 90fc9fd3f1SPedro Giffuni #endif // _SV_SALSOUND_H 91