Пример #1
0
INT_PTR CALLBACK dlgproc1(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
  switch( msg ) {
    case WM_INITDIALOG:
      CheckDlgButton( hwnd, IDC_RADIO1, BST_CHECKED );
      return TRUE;

    case WM_CLOSE:
      DestroyWindow( hwnd );
      PostQuitMessage( 0 );
      break;

    case WM_HSCROLL:
      if( LOWORD( wparam ) == SB_THUMBPOSITION
            || LOWORD( wparam ) == SB_THUMBTRACK ) {
              SetDlgItemInt( hwnd, IDC_EDIT1, HIWORD( wparam ), FALSE);
              int freq;
              freq = GetDlgItemInt( hwnd, IDC_EDIT1, NULL, FALSE );
              dsound_play( freq );
      }
    break;

    case WM_COMMAND: {
      if( LOWORD(wparam) == IDC_BUTTON1 ) {
        play_flag = play_flag ^ 1;
        if( play_flag ) SetWindowText( (HWND) lparam, "Playing" );
        else SetWindowText( (HWND) lparam, "Stopped" );
      }
      if( LOWORD(wparam) == IDC_RADIO1 ) if( IsDlgButtonChecked( hwnd, IDC_RADIO1 ) == BST_CHECKED ) wave_type = 0;
      if( LOWORD(wparam) == IDC_RADIO2 ) if( IsDlgButtonChecked( hwnd, IDC_RADIO2 ) == BST_CHECKED )  wave_type = 1;
      if( LOWORD(wparam) == IDC_RADIO3 ) if( IsDlgButtonChecked( hwnd, IDC_RADIO3 ) == BST_CHECKED )  wave_type = 2;

      int freq;
      freq = GetDlgItemInt( hwnd, IDC_EDIT1, NULL, FALSE );
      HWND tb1 = GetDlgItem( hwnd, IDC_SLIDER1 );
      SendMessage( tb1, TBM_SETPOS, TRUE, freq );

      dsound_play( freq );
    }
    break;

    default:;
  }
return 0;
}
Пример #2
0
int main(int argc, char **argv) {
  int i, pp=0;

  for (i=24; i>0; ) {
    void *p = malloc(i*1024);
    cputc_4(i/10+'0');
    cputc_3(i%10+'0');
    if (p) {
      ps[pp++] = p;
      cputc_2('-');
      dsound_play(ok);
    } else {
      cputc_2(' ');
      dsound_play(ng);
      i--;
    }
    wait_event(dsound_finished,0);
  }
  while (pp>0)
    free(ps[--pp]);
  return 0;
}
Пример #3
0
int main(int argc,char *argv[]) {
  
  /*The default makes this a really, really slow song*/
  /*So, we speed it up a little bit.*/
  dsound_set_duration(40);

  /*now, we play it*/
  while (!shutdown_requested()) {
    dsound_play(devil);
    dsound_wait();
  }

  return 0;
}
void debugBeep() {
dsound_set_duration(40);

	dsound_play(devil);

}
Пример #5
0
int main(int argc,char *argv[]) {
  dsound_set_duration(10);
  dsound_play(music);
  return 0;
}