Subversion Repositories Kolibri OS

Rev

Rev 298 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 298 Rev 333
Line 22... Line 22...
22
//-----------------------------------------------------------------------------
22
//-----------------------------------------------------------------------------
Line 23... Line 23...
23
 
23
 
24
static const char
24
static const char
Line 25... Line -...
25
rcsid[] = "$Id: i_unix.c,v 1.5 1997/02/03 22:45:10 b1 Exp $";
-
 
26
 
-
 
27
#include 
25
rcsid[] = "$Id: i_unix.c,v 1.5 1997/02/03 22:45:10 b1 Exp $";
Line 28... Line 26...
28
#include 
26
 
29
#include "sounds.h"
27
#include "sounds.h"
Line 65... Line 63...
65
  WAVEFORMATEX   wfx;
63
  WAVEFORMATEX   wfx;
Line 66... Line 64...
66
 
64
 
67
  hret = DirectSoundCreate8(NULL, &lpDS, NULL);
65
  hret = DirectSoundCreate8(NULL, &lpDS, NULL);
68
  if (hret != DS_OK)
66
  if (hret != DS_OK)
69
  {
67
  {
70
     printf("failed DirectSoundCreate");
68
     //printf("failed DirectSoundCreate");
71
     return;
69
     return;
Line 72... Line 70...
72
  }
70
  }
73
 
71
 
74
  hret = lpDS->lpVtbl->SetCooperativeLevel(lpDS, win, DSSCL_PRIORITY);
72
  hret = lpDS->lpVtbl->SetCooperativeLevel(lpDS, win, DSSCL_PRIORITY);
Line 75... Line 73...
75
  if (hret != DS_OK)
73
  if (hret != DS_OK)
76
       printf("failled DirectSound.SetCooperativeLevel");
74
       //printf("failled DirectSound.SetCooperativeLevel");
77
 
75
 
78
  memset( &wfx,0, sizeof(WAVEFORMATEX) ); 
76
  memset( &wfx,0, sizeof(WAVEFORMATEX) ); 
Line 117... Line 115...
117
  hret = lpMix[mixbuff]->lpVtbl->SetCurrentPosition(lpMix[mixbuff],0);
115
  hret = lpMix[mixbuff]->lpVtbl->SetCurrentPosition(lpMix[mixbuff],0);
Line 118... Line 116...
118
 
116
 
119
  hret=lpMix[mixbuff]->lpVtbl->Lock(lpMix[mixbuff],0,MIXBUFFERSIZE,&pPtr1,
117
  hret=lpMix[mixbuff]->lpVtbl->Lock(lpMix[mixbuff],0,MIXBUFFERSIZE,&pPtr1,
120
                           &dwSize1,&pPtr2,&dwSize2,0);
118
                           &dwSize1,&pPtr2,&dwSize2,0);
121
  if (hret!=DS_OK)
119
  if (hret!=DS_OK)
122
  {	printf("Error locking on play start");
120
  {	//printf("Error locking on play start");
123
 	return ;
121
 	return ;
124
  }
122
  }
125
  memcpy(pPtr1, (void*)mixbuffer, MIXBUFFERSIZE);
123
  memcpy(pPtr1, (void*)mixbuffer, MIXBUFFERSIZE);
126
  hret-lpMix[mixbuff]->lpVtbl->Unlock(lpMix[mixbuff],pPtr1, dwSize1, pPtr2, dwSize2);
124
  hret-lpMix[mixbuff]->lpVtbl->Unlock(lpMix[mixbuff],pPtr1, dwSize1, pPtr2, dwSize2);