- bool ret = false;
- m_sndname = fileName;
- m_isResource = isResource;
-
- if (m_isResource)
- ret = true;
- else
- { /*
- if (sndChan)
- { // we're playing
- FSClose(SndRefNum);
- SndRefNum = 0;
- SndDisposeChannel(sndChan, TRUE);
- free(sndChan);
- sndChan = 0;
- KillTimer(0,timerID);
- }
-
- if (!lpSnd)
- return true;
-
- if (_access(lpSnd,0)) // no file, no service
- return false;
-
- // Allocate SndChannel
- sndChan = (SndChannelPtr) malloc (sizeof(SndChannel));
-
- if (!sndChan)
- return false;
-
- sndChan->qLength = 128;
-
- if (noErr != SndNewChannel (&sndChan, sampledSynth, initMono | initNoInterp, 0))
- {
- free(sndChan);
- sndChan = 0;
- return false;
- }
-
- if (!(SndRefNum = MacOpenSndFile ((char *)lpSnd)))
- {
- SndDisposeChannel(sndChan, TRUE);
- free(sndChan);
- sndChan = 0;
-
- return false;
- }
-
- bool async = false;
-
- if (fdwSound & SND_ASYNC)
- async = true;
-
- if (SndStartFilePlay(sndChan, SndRefNum, 0, 81920, 0, 0, 0, async) != noErr)
- {
- FSClose (SndRefNum);
- SndRefNum = 0;
- SndDisposeChannel (sndChan, TRUE);
- free (sndChan);
- sndChan = 0;
- return false;
- }
-
- if (async)
- { // haven't finish yet
- timerID = SetTimer(0, 0, 250, TimerCallBack);
- }
- else
- {
- FSClose (SndRefNum);
- SndRefNum = 0;
- SndDisposeChannel (sndChan, TRUE);
- free (sndChan);
- sndChan = 0;
- }*/
- }
-
- return ret;
+ bool ret = false;
+ m_sndname = fileName;
+ m_isResource = isResource;
+
+ if (m_isResource)
+ ret = true;
+ else
+ { /*
+ if (sndChan)
+ { // we're playing
+ FSClose(SndRefNum);
+ SndRefNum = 0;
+ SndDisposeChannel(sndChan, TRUE);
+ free(sndChan);
+ sndChan = 0;
+ KillTimer(0,timerID);
+ }
+
+ if (!lpSnd)
+ return true;
+
+ if (_access(lpSnd,0)) // no file, no service
+ return false;
+
+ // Allocate SndChannel
+ sndChan = (SndChannelPtr) malloc (sizeof(SndChannel));
+
+ if (!sndChan)
+ return false;
+
+ sndChan->qLength = 128;
+
+ if (noErr != SndNewChannel (&sndChan, sampledSynth, initMono | initNoInterp, 0))
+ {
+ free(sndChan);
+ sndChan = 0;
+ return false;
+ }
+
+ if (!(SndRefNum = MacOpenSndFile ((char *)lpSnd)))
+ {
+ SndDisposeChannel(sndChan, TRUE);
+ free(sndChan);
+ sndChan = 0;
+
+ return false;
+ }
+
+ bool async = false;
+
+ if (fdwSound & SND_ASYNC)
+ async = true;
+
+ if (SndStartFilePlay(sndChan, SndRefNum, 0, 81920, 0, 0, 0, async) != noErr)
+ {
+ FSClose (SndRefNum);
+ SndRefNum = 0;
+ SndDisposeChannel (sndChan, TRUE);
+ free (sndChan);
+ sndChan = 0;
+ return false;
+ }
+
+ if (async)
+ { // haven't finish yet
+ timerID = SetTimer(0, 0, 250, TimerCallBack);
+ }
+ else
+ {
+ FSClose (SndRefNum);
+ SndRefNum = 0;
+ SndDisposeChannel (sndChan, TRUE);
+ free (sndChan);
+ sndChan = 0;
+ }*/
+ }
+
+ return ret;