当前位置: 首页>>代码示例>>C++>>正文


C++ Beep函数代码示例

本文整理汇总了C++中Beep函数的典型用法代码示例。如果您正苦于以下问题:C++ Beep函数的具体用法?C++ Beep怎么用?C++ Beep使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Beep函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: BL_Bootloader

void BL_Bootloader(void) {
  S191_FileStatus fileStatus;
  
  DisableInterrupts;
#if PL_HAS_HW_SOUNDER
  Beep(1);
#endif
#if PL_BOOTLOADER_LCD
  if (JM_ELE_GetVal()!=0) {
    /* JM_ELE switch is off: the JM128 is controlling the LCD */
    LCD1_Init();
    LCD1_Clear();
  }
  PrintLCDText(0, "Bootloader mode: waiting for S19 file...");
#endif
  BLUSB1_InitUSB();
  
  fileStatus = S191_FILE_STATUS_NOT_STARTED;
  for(;;) {
    BLUSB1_PollAndProcessUSB(&fileStatus); /* Poll USB device for any input device */
    if(fileStatus==S191_FILE_STATUS_READING) {
    #if PL_BOOTLOADER_LCD
      PrintLCDText(1, "Loading S19 file...");
    #endif
      BL_flashErased = FALSE;
      BLUSB1_ReadAndProcessS19(&fileStatus);
      switch(fileStatus) {
        case S191_FILE_STATUS_FINISHED:
          #if PL_BOOTLOADER_LCD
          PrintLCDText(2, "Loading successful!\nYou can reset the board now.");
          #endif
          #if PL_HAS_HW_SOUNDER
          Beep(1);
          #endif
          break;
        case S191_FILE_ERASE_FAILED:
          #if PL_BOOTLOADER_LCD
          PrintLCDText(2, "*** Flash erase error! ***");
          #endif
          #if PL_HAS_HW_SOUNDER
          Beep(4);
          #endif
          break;
        case S191_FILE_FLASH_FAILED:
          #if PL_BOOTLOADER_LCD
          PrintLCDText(2, "*** Flash programming error! ***");
          #endif
          #if PL_HAS_HW_SOUNDER
          Beep(6);
          #endif
          break;
        default:
          #if PL_BOOTLOADER_LCD
          PrintLCDText(2, "*** Error processing file! ***");
          #endif
          #if PL_HAS_HW_SOUNDER
          Beep(8);
          #endif
          break;
      } /* switch */
    } /* if */    
  } /* for */
}
开发者ID:210221030,项目名称:mcuoneclipse,代码行数:63,代码来源:Bootloader.c

示例2: gopherLoop

void gopherLoop(){

	//initialize variables ------------------------------------------------------------------------------------------------------------------

	int leftX;
	int leftY;
	//int rightx; //disabled to avoid 'unused' compiler warning
	//int righty;
	float addXLeft;
	float addYLeft;
	//float addXRight;
	//float addYRight;
	int deadZone = 3000; //X and Y minimum, below this is ignored since all controllers have some stick to them
	int scrollDeadZone = 7000; // Right thumbstick should be less sensitive.
	int scrollSpeed = 20; // Speed at which you scroll page.
	float range = 4.0f; //4 gives a decent range. Raising this requires a lowering of speed as well.
	int truncZone = 3; //anything below this is ignored and the mouse sits still, similar to a deadzone
	int sleepAmount = 16; //ideally 16, refreshes 60 times per second (1000/16 = ~60)
	POINT cursor; //ehh


//read input ---------------------------------------------------------------------------------------------------------------------------------
//read input ---------------------------------------------------------------------------------------------------------------------------------
//read input ---------------------------------------------------------------------------------------------------------------------------------


		//XINPUT_GAMEPAD_BACK
	if(Controller->GetState().Gamepad.wButtons == XINPUT_GAMEPAD_BACK)
	{
		holdBack = true;
	}
	else if (Controller->GetState().Gamepad.wButtons != XINPUT_GAMEPAD_BACK)
	{
		holdBack = false;
	}


	//XINPUT_GAMEPAD_BACK - disable/enable
	if(holdBack == true && holdingBack == false){ // && holdingLeftMouseButton == false

		holdingBack = true;
		printf("---------------BACK-DOWN\n");
	}
	else if(holdBack == false && holdingBack == true){
		holdingBack = false;
		if(disabled == false){
				printf("---------------BACK-UP - Toggled off, ignoring all input but 'Back'.\n");
				disabled = true;
				Beep(1800,200);
				Beep(1600,200);
				Beep(1400,200);
				Beep(1200,200);
				Beep(1000,200);
				//Sleep(1000);
		}
		else if(disabled == true){
				printf("---------------BACK-UP - Toggled on, taking all input.\n");
				disabled = false;
				Beep(1000,200);
				Beep(1200,200);
				Beep(1400,200);
				Beep(1600,200);
				Beep(1800,200);
				//Sleep(1000);
		}
	}


	if(disabled == false){



	//get LX info
	if(abs(Controller->GetState().Gamepad.sThumbLX) > deadZone)
	{
		addXLeft = (speed * (Controller->GetState().Gamepad.sThumbLX*range));
	}

	//zero check
	else
	{
		addXLeft = 0.0f;
	}



	//get LY info
	if(abs(Controller->GetState().Gamepad.sThumbLY) > deadZone)
	{
		addYLeft = -(speed * (Controller->GetState().Gamepad.sThumbLY*range));
	}

	//zero check
	else
	{
		addYLeft = 0.0f;
	}

	//Get RY info
	holdScrollUp = (Controller->GetState().Gamepad.sThumbRY > scrollDeadZone);
//.........这里部分代码省略.........
开发者ID:miguelmig,项目名称:Gopher,代码行数:101,代码来源:main.cpp

示例3: main

/*****************************************************************
 函数原型:main()
 功能描述:主函数
 参数描述:

 返回值:   无

 作  者:   许岩/刘及华
 日  期:   2012-11-24
 修改历史:
		日期        修改人      修改描述
		------      ---------   -------------
*****************************************************************/
int main(void)
{	
	INT8U   ret = 0;
	char    mainflag = 1;
	INT8S   buf[30];
	uchar   uckey;
	uint 	uikey;
	BUS_TIME ltime;

	(void)EA_ucSetStopFlag( EM_DISABLE_STOP );  //不允许系统进入睡眠状态;

reboot:
	ret = System_Init();     //系统初始化,包括PSAM,参数表,GPRS初始化
	if( ret != ok )		 
	{
		lcddisperr("系统初始化失败!");
		goto reboot;
	}

	Beep(1000);

	for ( ;; )
	{
		Get_Time(&ltime);
		sprintf((void *)buf, "  %02X%02X-%02X-%02X %02X:%02X",
				ltime.century, ltime.year, ltime.month, ltime.day, ltime.hour, ltime.minute);
//  	EA_vTextOut(0, 0, EM_key_FONT8X16, 0, 1, 1, (char *)buf);
		EA_vDisplay(3, (void *)buf);
		if( mainflag == 1 )
		{
			DisplayWelcomeMenu();
			mainflag = 0;
		}

		uckey = EA_ucKBHit();
		if(uckey == EM_key_HIT)       //有按键
		{
			uikey = EA_uiInkey(0);    //读取按键键值
			switch ( uikey )
			{
				case EM_key_EXIT:     //关机
				{
					mainflag = 1;
					goto shutdown;
					break;
				}

				case EM_key_F3:
				{
					Login();                  //登录界面                    	
					mainflag = 1;
					break;
				}
				case EM_key_F1:	
				{
					Parm_Setting();          //参数配置
					mainflag = 1;
					break;
				}
				case EM_key_1:
				{
					GPRS_TEST();             //无线连接测试
					mainflag = 1;
					break;
				}
				case EM_key_F2:
				{
//  				QUERY_NOTE_RECORD();
					Gprs_Upload_data();      //数据上传
					mainflag = 1;
					break;
				}
				default:
					break;
			}
		}
	}
shutdown:
	Power_Down();
}
开发者ID:12019,项目名称:zibogas,代码行数:93,代码来源:main.c

示例4: gdk_display_beep

void
gdk_display_beep (GdkDisplay *display)
{
  g_return_if_fail (display == gdk_display_get_default());
  Beep(1000, 50);
}
开发者ID:batman52,项目名称:dingux-code,代码行数:6,代码来源:gdkmain-win32.c

示例5: checklala

void checklala(int i,int j,int *arr[3][3],int player,int *arr2[9][8],int *a)
{
    if(player==shortcut2(i,arr))// player 2 1 a zete parbena & player 1 2 te zete parbena.
    {



        i=i-1;

        if(i>8||i<0)
        {
            printf("Error..! You have range between 1 to 9\n");
            Beep(250,250);

        }
        else if(i==4)
        {
            if(j==arr2[i][0]||j==arr2[i][1]||j==arr2[i][2]||j==arr2[i][3]||j==arr2[i][4]||j==arr2[i][5]||j==arr2[i][6]||j==arr2[i][7])
            {
                if(shortcut2(j,arr)==0)
                {
                    move(arr,i+1,j,player);
                    printf("A=%d\n",++*a);
                }
                else
                {
                    printf("Error\n");
                    Beep(250,250);
                }
            }
            else
            {
                printf("Error\n");
                Beep(250,250);
            }
        } else {

            if(j==arr2[i][0]||j==arr2[i][1]||j==arr2[i][2]) {


                if(shortcut2(j,arr)==0)
                {
                    move(arr,i+1,j,player);
                    printf("A=%d\n",++*a);


                }
                else
                {
                    printf("Error\n");
                    Beep(250,250);
                }

            }   else
            {
                printf("Error\n");
                Beep(250,250);

            }
        }

    }
    system("cls");
}
开发者ID:mostasimbillah,项目名称:Tin_guti,代码行数:64,代码来源:Latest.c

示例6: key_SetAddresses

void    key_SetAddresses(void)
{
static uchar ibCan;

  if (bKey == bKEY_ENTER)
  {                                           
    if (enKeyboard == KBD_ENTER)
    {
      enKeyboard = KBD_INPUT1;
      Number();

      ShowHi(szAddresses);
    } 
    else if (enKeyboard == KBD_INPUT1)
    {
      enKeyboard = KBD_POSTENTER;

      ibCan = 0;
      Show(ibCan);
    }
    else if (enKeyboard == KBD_POSTINPUT1)
    {
      if ((ibCan = GetCharLo(10,11) - 1) < bCANALS)
      {
        enKeyboard = KBD_POSTENTER;
        Show(ibCan);
      }
      else Beep();
    }
    else if (enKeyboard == KBD_POSTENTER)
    {
      if (++ibCan >= bCANALS) ibCan = 0;
      Show(ibCan);
    }
    else if (enKeyboard == KBD_POSTINPUT3)
    {
      ulong dw;
      if ((dw = GetLongLo(8,15)) <= 100000000)
      {
        enKeyboard = KBD_POSTENTER;

        ibRecordCan = ibCan;
        AddSysRecordReprogram(EVE_EDIT_ADDRESS20);
        mpdwAddress2[ibCan] = dw;
        SaveCache(&chAddress2);
        AddSysRecordReprogram(EVE_EDIT_ADDRESS21);

        if (++ibCan >= bCANALS) ibCan = 0;
        Show(ibCan);
      }
      else Beep();
    }
    else Beep();
  }


  else if (bKey == bKEY_POINT)
  {        
    if (enKeyboard == KBD_POSTENTER)
    {
      if (ibCan > 0) ibCan--; else ibCan = bCANALS-1;

      Show(ibCan);
    } 
    else if (enKeyboard == KBD_POSTINPUT2)
    {
      ulong dw;
      if ((dw = GetLongHi(8,15)) <= 100000000)
      {
        enKeyboard = KBD_INPUT3;
        sprintf(szLo+8,szMaskAddresses);

        ibRecordCan = ibCan;
        AddSysRecordReprogram(EVE_EDIT_ADDRESS10);
        mpdwAddress1[ibCan] = dw;
        SaveCache(&chAddress1);
        AddSysRecordReprogram(EVE_EDIT_ADDRESS11);
      }
      else Beep();
    }
    else Beep();
  } 


  else if (bKey < 10)
  {        
    if (enKeyboard == KBD_POSTENTER)
    {
      if ((enGlobal == GLB_PROGRAM) || (enGlobal == GLB_REPROGRAM))
      {
        enKeyboard = KBD_INPUT2;
        sprintf(szHi+8,szMaskAddresses);
        sprintf(szLo+8,szNullAddresses);
      }
      else Beep();
    }

    if ((enKeyboard == KBD_INPUT1) || (enKeyboard == KBD_POSTINPUT1))
    {
      enKeyboard = KBD_POSTINPUT1;
//.........这里部分代码省略.........
开发者ID:feilongfl,项目名称:tm4c1294ncpdt,代码行数:101,代码来源:key_addresses.c

示例7: bstrConnString

void CADOUtil::RunSP_ReturnRS(_bstr_t SP_Name, _RecordsetPtr& out_pRs, CParamArray *ParamArray)
{
	if(!CheckCurrentProcess())
		throw ERR_NEW_PROCESS_DETECTED;

	_ConnectionPtr	pConn	= NULL;
	_ParameterPtr	pPrm	= NULL;
	_ParameterPtr	pprm	= NULL;
	ErrorPtr		pErr	= NULL;
	_CommandPtr		pComm	= NULL;
	CParam*			pr		= NULL;
	LONG			ErrSQLState = 0;
	LONG			count = 0;
	LONG			ErrorCode = 0;
	_variant_t		vIndex;
	_bstr_t			bsEmpty;

	//********************************************************************
	//Connectin to Pool
	try 
	{
		_bstr_t bstrConnString(szConnectionString);
		pConn.CreateInstance(__uuidof(Connection));
		if(pConn == NULL)
		{
			throw(ErrorCode = ERR_UNABLE_CREATE_CONN);
		}
		pConn->ConnectionTimeout = 7;
		pConn->Open(bstrConnString, L"", L"", adConnectUnspecified);
	}
	catch(...)
	{
		Beep(2000, 100);
		//m_ExternalLink.Add2Log(WL_ERROR_LEVEL1,"Unable set connection to SQL Error = Unknown");
		ErrorCode = ERR_UNABLE_CREATE_CONN;
	}

	if(ErrorCode)
		throw ErrorCode;

	//*******************************************************************	
	//Execut command
	try
	{
		pComm.CreateInstance(__uuidof(Command));
		if(pComm == NULL)
		{
			throw(ErrorCode = ERR_UNABLE_CREATE_COMM);
		}
		out_pRs.CreateInstance(__uuidof(Recordset));
		if(out_pRs == NULL)
		{
			throw(ErrorCode = ERR_UNABLE_CREATE_RECSET);
		}
		pComm->ActiveConnection = pConn;
		pComm->CommandText = SP_Name;
		pComm->CommandType = adCmdStoredProc;

		if(ParamArray != NULL)
		{
			DWORD Count = ParamArray->GetSize();
			for (DWORD i=0; i < Count; i++)
			{
				pr = (*ParamArray)[i];
				pprm = pComm->CreateParameter(bsEmpty, pr->Type, pr->Direction, pr->Size, pr->Value);
				pComm->Parameters->Append(pprm);
			}
		}
		out_pRs->CursorLocation = adUseClient;
		out_pRs->Open(_variant_t((IDispatch *)pComm, true), vtMissing, adOpenForwardOnly, adLockReadOnly, NULL);
		out_pRs->PutRefActiveConnection(NULL);
		pConn->Close();
		return;
	}

	//Handle Execut error
	catch(_com_error)
	{
		try
		{
			count = pConn->Errors->Count;
			if(count)
			{
				vIndex = _variant_t((LONG)0);
				pErr = pConn->Errors->GetItem(vIndex);
				ErrSQLState = atol((LPCSTR)pErr->SQLState);
				/*
				//m_ExternalLink.Add2Log(WL_ERROR_LEVEL3,
				"SQL (RS) Error %d [Error #%d Description \"%s\" (Source: %s)"
				"(SQL State: %s)](NativeError: %s)",
				e.Error(),
				pErr->Number,
				(LPCSTR)pErr->Description,
				(LPCSTR)pErr->Source,
				(LPCSTR)pErr->SQLState,
				(LPCSTR)pErr->NativeError);*/

			}
			pConn->Close();
			if (pComm->ActiveConnection != NULL)
//.........这里部分代码省略.........
开发者ID:0anion0,项目名称:IBN,代码行数:101,代码来源:ADOUtil.cpp

示例8: from_file

void from_file(){

    ///\fn void from_file()
    ///\brief Corectarea unui sir de caractere.
    ///
    ///Implementarea corectarii a unui sir de caractere citit din fisier.


    char fileName[100];
    char buff[2255];
    char *p;

    FILE * f_corected = fopen("from file corected.txt","w");
    FILE * file;
    char ch[2],word[150],wordINIT[150];
    ch[1]='\0';
    List sim_words ;
    POINT curs, cursBack;// cursor position


    tryAgain:
    system("cls");
    printf("\n\tPlease enter the name of the file (e.g. : file.txt):  ");
    gets(fileName);
    if(fileName[strlen(fileName)-1]=='\n')
        fileName[strlen(fileName)-1]='\0';
    if(strlen(fileName)<=2)
        goto tryAgain;

    file = fopen(fileName,"r");
    if( file == NULL ){
        printf("\n\t This file doesn't exist!");
        Sleep(2000);
        goto tryAgain;
    }


    GotoXY(3,3);
    printf(" Here you will see all the informations you need about your text!");

    GotoXY(3,9);
    printf("Your text:");

    // complex flush
    fflush(stdin);
    while ((ch[0] = getchar()) != '\n' && ch[0] != EOF)
        continue;

    GotoXY(3,10);// typing

     while(1){

        word[0]='\0';
        ch[0]='\0';
            if(kbhit()){
                ch[0] = getch();
                if(is_letter(ch[0]) == true){
                    strcat(word,ch );
                    printf("%c",ch[0]);
                }
            }
        save_curs(&curs);
        if(!fgets(ch,2,file)){
                getchar();
                fclose(f_corected);
                fclose(file);
                return;
            }
        //add a word
        while( is_letter(ch[0])==true  ){


            strcat(word,ch);
            printf("%c",ch[0]);

            if(GetAsyncKeyState( VK_ESCAPE )& 0x8000){
                fclose(f_corected);
                return;
            }
            if(!fgets(ch,2,file)){
                getchar();
                fclose(f_corected);
                return;
            }
        }

        strcpy(wordINIT,word);
        strcpy(word,strlwr(word));

        // if an word was typed
        if(word[0]>='A' && word[0]<='z' && strlen(word)>=2){
            if(word[strlen(word)-1]<'A' || word[strlen(word)-1]>'z')
                word[strlen(word)-1]='\0';

            // if the word is incorrect
            if(list_search(&dict_lex, strlwr(word))==NULL){

                Beep(20,200);
                    GotoXY(3,3);
                    printf("The word \"%s\" is incorrect!",word);
//.........这里部分代码省略.........
开发者ID:dumitrubogdanmihai,项目名称:levenshtein-project,代码行数:101,代码来源:main-menu.c

示例9: live_input

void live_input(){

    ///\fn void live_input()
    ///\brief Corectare in timp real.
    ///
    ///Implementarea corectarii in timp real ale cuvintelor introduse de la tastatura.


    FILE * f_corected = fopen("live_input f_corected.txt","w");
    FILE * f_inserted = fopen("live_input f_inserted.txt","w");
    char ch[2],word[50],wordINIT[50];
    ch[1]='\0';
    List sim_words ;
    POINT curs, cursBack;// cursor position

    ClearSelectAreea();
    GotoXY(3,3);
    printf(" Here you will see all the informations you need about your text ");

    GotoXY(3,9);
    printf("Your text:");

    // complex flush
    fflush(stdin);
    while ((ch[0] = getchar()) != '\n' && ch[0] != EOF)
        continue;

    GotoXY(3,10);// typing
    while(1){

        word[0]='\0';
        ch[0]='\0';

        save_curs(&curs);
        //add a word
        while( is_letter(ch[0])==true ){
            if(kbhit()){
                ch[0] = getch();
                if(is_letter(ch[0]) == true){
                    strcat(word,ch);
                    printf("%c",ch[0]);
                }
            }

            if(GetAsyncKeyState( VK_BACK )& 0x8000){
                if( strlen(word) != 0){
                    save_curs(&cursBack);
                    GotoXY( cursBack.x-1, cursBack.y);
                    printf(" ");
                    word[strlen(word)-1]='\0';
                    GotoXY(curs.x,curs.y);
                    printf("%s",word);
                    GotoXY(cursBack.x-1, cursBack.y);
                    Sleep(100);
                }
            }
            if(GetAsyncKeyState( VK_ESCAPE )& 0x8000){
                return;
                fclose(f_inserted);
                fclose(f_corected);
            }
            if(GetAsyncKeyState( VK_RETURN )& 0x8000) break;
        }


        strcpy(wordINIT,word);
        strcpy(word,strlwr(word));

        // if an word was typed
        if(word[0]>='A' && word[0]<='z' && strlen(word)>=2){
            if(word[strlen(word)-1]<'A' || word[strlen(word)-1]>'z')
                word[strlen(word)-1]='\0';

            fprintf(f_inserted,"%s",word);
            fprintf(f_inserted,"%c",ch[0]);

            // if the word is incorrect
            if(list_search(&dict_lex, word)==NULL){

                Beep(20,200);
                find_sim_words(&sim_words, word, strlen(word), dict_lex.head, dict_lex.tail);

                if(sim_words.head==NULL){
                    ClearSelectAreea();
                    Beep(90,200);

                    ClearSelectAreea();
                    GotoXY(3,3);
                    printf("The word \"%s\" is incorrect and there are no word like him!\n",word);
                    Sleep(650);
                    getchar();
                }
                else{
                    Beep(70,200);
                    List_Node * newTail = malloc(sizeof(List_Node));
                    newTail->word = malloc(sizeof(char)*strlen(wordINIT)+1);
                    strcpy(newTail->word,wordINIT);
                    list_insert(&sim_words,newTail);
                    Select_correct_word(word, &sim_words);

//.........这里部分代码省略.........
开发者ID:dumitrubogdanmihai,项目名称:levenshtein-project,代码行数:101,代码来源:main-menu.c

示例10: Beep

//---------------------------------------------------------------------------
void __fastcall TForm1::BewegingstimerTimer(TObject *Sender)
{

//Neerzetten met double buffering:
   //achtergrond
   ImageCanvas->Picture=BackgroundImage->Picture;

   //musica
   Beep(random(500),500);

   //staff laten bewegen als barman
   if (b==0)
        {
           StaffImage->Left=StaffImage->Left+random(50)-25;
                if (StaffImage->Left<600) StaffImage->Left=600;
                if (StaffImage->Left>700) StaffImage->Left=700;
                ImageCanvas->Canvas->Draw(StaffImage->Left,StaffImage->Top,StaffImage->Picture->Graphic);
                ImageCanvas->Canvas->Draw(ItemImage->Left,ItemImage->Top,ItemImage->Picture->Graphic);
        }
   else   //het dwijlorkest
        {
           switch (dwijlorkest)
                {
                case 0:
                  ImageCanvas->Canvas->Draw(524,100,OrkestImage1->Picture->Graphic);
                  dwijlorkest=1;
                  break;
                case 1:
                  ImageCanvas->Canvas->Draw(525,100,OrkestImage2->Picture->Graphic);
                  dwijlorkest=0;
                  break;
                }
        }

   //dienblad:
   ImageCanvas->Canvas->Draw(10,140,ArrowImage->Picture->Graphic);
   ImageCanvas->Canvas->Draw(8,80,DienbladImage->Picture->Graphic);
   for (int t=0; t<aantalglazen+1; t++)
        {
         switch (t)
                {
                 case 0:
                   break;
                 case 1:
                   ImageCanvas->Canvas->Draw(48,80,GlasImage->Picture->Graphic);
                   break;
                 case 2:
                   ImageCanvas->Canvas->Draw(63,82,GlasImage->Picture->Graphic);
                   break;
                 case 3:
                   ImageCanvas->Canvas->Draw(28,84,GlasImage->Picture->Graphic);
                   break;
                 case 4:
                   ImageCanvas->Canvas->Draw(14,94,GlasImage->Picture->Graphic);
                   break;
                 case 5:
                   ImageCanvas->Canvas->Draw(30,94,GlasImage->Picture->Graphic);
                   break;
                 case 6:
                   ImageCanvas->Canvas->Draw(47,89,GlasImage->Picture->Graphic);
                   break;
                 case 7:
                   ImageCanvas->Canvas->Draw(61,90,GlasImage->Picture->Graphic);
                   break;
                 case 8:
                   ImageCanvas->Canvas->Draw(56,96,GlasImage->Picture->Graphic);
                   break;
                 case 9:
                   ImageCanvas->Canvas->Draw(88,88,GlasImage->Picture->Graphic);
                   break;
                 case 10:
                   ImageCanvas->Canvas->Draw(90,95,GlasImage->Picture->Graphic);
                   break;
                 case 11:
                   ImageCanvas->Canvas->Draw(74,95,GlasImage->Picture->Graphic);
                   break;
                }
        }


   //de glazen vullen:
   if(random(3)==1) c[random(10)][1]=1;     //kans 1op30;

   //de glazen tekenen als de bar er is:
   if (b==0)
        {
           for (int we=0; we<10; we++)
                {
                switch (c[we][1])
                        {
                        case 0:
                           break;
                        case 1:
                           ImageCanvas->Canvas->Draw(c[we][0],360,GlasImage->Picture->Graphic);
                           break;
                        }
                }
        }//end glazenifstatement

//.........这里部分代码省略.........
开发者ID:RLED,项目名称:ProjectRichelBilderbeek,代码行数:101,代码来源:MCT1.cpp

示例11: export_cb

/* export_cb : Export Callback
   Export to file the entry highlighted in the browser. */
void export_cb(FL_OBJECT *a, long l)
{
  Int4 index;
  int RetVal;
  unsigned char *pImgBuf;
  short Width;
  short Height;
  const char *format;

  RetVal = fl_get_browser(wad_brow);
  if ( RetVal == 1 )           /* first line is the legend */
    return;
  index = LinearMap[RetVal];
  
  switch (pEntryTag[index])
    {
    case TAG_MUS  : 
      GenFileName(pDirEnt[index].name, ".mus", TmpNameStr);
      RetVal = Gen_MUS_File(WADfp, pDirEnt[index], TmpNameStr);
      break;
    case TAG_SFX  :
      GenFileName(pDirEnt[index].name, ".wav", TmpNameStr);
      RetVal = Gen_WAV_File(WADfp, pDirEnt[index], TmpNameStr);
      break;
    case TAG_FLAT :
    case TAG_FULL :
    case TAG_IMG  :
      pImgBuf = ParseImgBlock(pDirEnt[index], pEntryTag[index], 
			      &Width, &Height, NULL, NULL, WADfp);
      if (pImgBuf == NULL) {
	RetVal = 4;
	break;
      }
      format = fl_get_choice_text( exp_img_fmt_cho );
      if ( !strcmp(format, PCX_STR ) ) {           /* pcx */
	GenFileName(pDirEnt[index].name, ".pcx", TmpNameStr);
	RetVal = PCX_WriteImage(pDirEnt[index], WADfp, Width, Height, 
				pImgBuf, 1, TmpNameStr);
      }
      else {  /* xpm */
	char **xpm;
	GenFileName(pDirEnt[index].name, ".xpm", TmpNameStr);
	/* don't just redraw, we don't know what's in the xpm: */
	xpm = CreateXpmImage( pImgBuf, Width, Height, 0, NULL ); 
	if ( xpm && CreateXpmFile( xpm, TmpNameStr ) ) 
	  RetVal = 0;
	else
	  RetVal = 666; /* why not? */
      }
      break;
    case TAG_HIRES:
      GenFileName(pDirEnt[index].name, ".pcx", TmpNameStr);
      RetVal = PCX_WriteImage(pDirEnt[index], WADfp, 640, 480, 
			      pBitMap, 4, TmpNameStr);
      break;
    default:
      RetVal = 1;
      break;
    }
  
  if (RetVal != 0) {
    Beep();
    Message("error generating external file \"%s\" (%d)\n", 
	   TmpNameStr, RetVal);
  }
  else
    Message("External file \"%s\" created OK\n", TmpNameStr); 
}
开发者ID:Doom-Utils,项目名称:xwadtools,代码行数:70,代码来源:xew_m.c

示例12: UpdateData

void CWipeFree::OnDmWipe() 
{
	LVITEM				lvitem;
	int					nSel;
	int					i;
	YG_PARTITION_INFO	*pTargetParInfo = NULL;
	CWipeProc			WipeProcDlg;
	BOOL				bSel = FALSE;
	CString				cstr,csCaption;
	TCHAR				szCurDir[MAX_PATH];
	TCHAR				szDir[32];

	UpdateData(TRUE);
	g_bBeepOff = m_BeepOff.GetCheck();

	nSel = m_SelMothed.GetCurSel ();
	g_nWipeMothed = nSel;

	csCaption.LoadString (IDS_DM_ERROR);

	lvitem.mask = LVIF_IMAGE;
	lvitem.iSubItem = 0;
	
	for(i = 0; i < m_WipeParList.GetItemCount (); i++) 
	{
		lvitem.iItem = i;
		m_WipeParList.GetItem(&lvitem);
		if(lvitem.iImage == IMG_LIST_SELECT) 
		{
			pTargetParInfo		= (YG_PARTITION_INFO*)m_WipeParList.GetItemData (i);
			g_pTargetParInfo	= pTargetParInfo;
			bSel				= TRUE;
			break;
		}
	}
	if(bSel)
	{
		if(g_pTargetParInfo->DriveLetter == _T('*'))
		{
			cstr.LoadString (IDS_Q_FORMAT_PARTITION);
			csCaption.LoadString (IDS_DM_INFO);
			MessageBox(cstr,csCaption,MB_OK);
			return ;
		}
		ZeroMemory(szDir, 32  * sizeof(TCHAR));
		_tcscpy(szDir,_T("C:\\"));
		szDir[0] = g_pTargetParInfo->DriveLetter;
		GetCurrentDirectory(MAX_PATH,szCurDir);
		if(!SetCurrentDirectory(szDir))
		{
			cstr.LoadString (IDS_Q_FORMAT_PARTITION);
			csCaption.LoadString (IDS_DM_INFO);
			MessageBox(cstr,csCaption,MB_OK);
			return ;
		}
		SetCurrentDirectory(szCurDir);
		cstr.Format (IDS_CONFIRM_WIPE_FREE,g_pTargetParInfo->DriveLetter);
		csCaption.LoadString (IDS_DM_CONFIRM_CAPTITION);
		if(IDYES == MessageBox (cstr,csCaption,MB_YESNO))
		{
			WipeProcDlg.m_DriveLetter = g_pTargetParInfo->DriveLetter;
			if (!g_bBeepOff) Beep(1000,100);
			WipeProcDlg.DoModal ();
		}

	}
}
开发者ID:xfxf123444,项目名称:japan,代码行数:67,代码来源:WipeFree.cpp

示例13: main

int main(int argc, void **argv)
{
	char *pszdir;
	char *pszWadName;
	char *pszScriptName;
	char szBuf[1024];
	HANDLE hFile, hScriptFile;
	WIN32_FIND_DATA FindData;
	BOOL fWrite;
	BOOL fContinue = TRUE;
	DWORD dwWritten;

	printf("makels Copyright (c) 1998 Valve L.L.C., %s\n", __DATE__ );

	pszdir = (char *)argv[1];

	if ((argc != 4) || (pszdir[0] == '/') || (pszdir[0] == '-'))
	{
		PrintUsage((char *)argv[0]);
		exit(1);
	}

	pszdir = (char *)malloc(strlen((char *)argv[1]) + 7);
	strcpy(pszdir, (char *)argv[1]);
	strcat(pszdir, "\\*.bmp");

	pszWadName = (char *)malloc(strlen((char *)argv[2]) + 5);
	strcpy(pszWadName, (char *)argv[2]);
	strcat(pszWadName, ".WAD");

	pszScriptName = (char *)malloc(strlen((char *)argv[3]));
	strcpy(pszScriptName, (char *)argv[3]);
	hScriptFile = CreateFile(pszScriptName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, 
			FILE_ATTRIBUTE_NORMAL, NULL);

	if (hScriptFile == INVALID_HANDLE_VALUE)
	{
		printf("\n---------- ERROR ------------------\n");
		printf(" Could not open the script file: %s\n", pszScriptName);
		Beep(800,500);
		exit(EXIT_FAILURE);
	}

	sprintf(szBuf, "$DEST    \"%s\"\r\n\r\n", pszWadName);
	fWrite = WriteFile(hScriptFile, szBuf, strlen(szBuf), &dwWritten, NULL);
	if (!fWrite || (dwWritten != strlen(szBuf)))
	{
write_error:
		printf("\n---------- ERROR ------------------\n");
		printf(" Could not write to the script file: %s\n", pszScriptName);
		Beep(800,500);
		CloseHandle(hScriptFile);
		exit(EXIT_FAILURE);
	}
	
	
	hFile = FindFirstFile(pszdir, &FindData);

	if (hFile != INVALID_HANDLE_VALUE)
	{
		while (fContinue)
		{
			if (!(FindData.dwFileAttributes &
					(FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_HIDDEN)))
			{
				char szShort[MAX_PATH];

				// ignore N_ and F_ files
				strcpy(szShort, FindData.cFileName);
				strupr(szShort);

				if ((szShort[1] == '_') && ((szShort[0] == 'N') || (szShort[0] == 'F')))
				{

					printf("Skipping %s.\n", FindData.cFileName);

				} else {
				
					if ( nFiles >= nMaxFiles )
					{
						nMaxFiles += 1000;
						ppszFiles = (char **)realloc( ppszFiles, nMaxFiles * sizeof(*ppszFiles) );
						if ( !ppszFiles )
						{
							printf("\n---------- ERROR ------------------\n");
							printf(" Could not realloc more filename pointer storage\n");
							Beep(800,500);
							exit(EXIT_FAILURE);
						}
					}
					ppszFiles[nFiles++] = strdup( szShort );
				}
			}
			fContinue = FindNextFile(hFile, &FindData);
		}	
	}


	if (nFiles > 0)
	{
//.........这里部分代码省略.........
开发者ID:jlecorre,项目名称:hlinvasion,代码行数:101,代码来源:makels.cpp

示例14: WindowProcedure

LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    static struct
    {
        int nota;
        int lugar;
        //int largo;
    }notas[NOTA_MAX];

    static int largo=100;
    static int pos=0;

    switch (message)                  /* handle the messages */
    {
        case WM_KEYDOWN:
            if(pos<NOTA_MAX-1)
            switch(wParam)
            {
                case 96:
                    Beep(SIg, largo);
                    notas[pos].nota=SIg;
                    notas[pos].lugar=72;
                    pos++;
                    break;
                case 97:
                    Beep(DO, largo);
                    notas[pos].nota=DO;
                    notas[pos].lugar=66;
                    pos++;
                    break;
                case 98:
                    Beep(RE, largo);
                    notas[pos].nota=RE;
                    notas[pos].lugar=60;
                    pos++;
                    break;
                case 99:
                    Beep(MI, largo);
                    notas[pos].nota=MI;
                    notas[pos].lugar=54;
                    pos++;
                    break;
                case 100:
                    Beep(FA, largo);
                    notas[pos].nota=FA;
                    notas[pos].lugar=48;
                    pos++;
                    break;
                case 101:
                    Beep(SOL, largo);
                    notas[pos].nota=SOL;
                    notas[pos].lugar=42;
                    pos++;
                    break;
                case 102:
                    Beep(LA, largo);
                    notas[pos].nota=LA;
                    notas[pos].lugar=36;
                    pos++;
                    break;
                case 103:
                    Beep(SI, largo);
                    notas[pos].nota=SI;
                    notas[pos].lugar=30;
                    pos++;
                    break;
                case 104:
                    Beep(DOa, largo);
                    notas[pos].nota=DOa;
                    notas[pos].lugar=24;
                    pos++;
                    break;
                case 105:
                    Beep(REa, largo);
                    notas[pos].nota=REa;
                    notas[pos].lugar=18;
                    pos++;
                    break;
            }

            //MessageBox(0,0,0,0);
            //UpdateWindow(hwnd);
            break;
        case WM_PAINT:
            PAINTSTRUCT ps;
            HDC hDC;
            hDC = BeginPaint(hwnd, &ps);


            for(int i=0;i<pos;i++)
                Ellipse(hDC, 25+i*15, notas[i].lugar, 37+i*15, notas[i].lugar+12);

            hacerlinea(hDC, 0, 12, 625, 12);
            hacerlinea(hDC, 0, 24, 625, 24);
            hacerlinea(hDC, 0, 36, 625, 36);
            hacerlinea(hDC, 0, 48, 625, 48);
            hacerlinea(hDC, 0, 60, 625, 60);
            hacerlinea(hDC, 10, 10, 10, 62);

            EndPaint(hwnd, &ps);
//.........这里部分代码省略.........
开发者ID:0aps,项目名称:Legacy-Code,代码行数:101,代码来源:void+piano+notas.cpp

示例15: setCDKFselect

/*
 * This function sets the information inside the file selector.
 */
void setCDKFselect (CDKFSELECT *fselect, char *directory, chtype fieldAttrib, chtype filler, chtype highlight, char *dirAttribute, char *fileAttribute, char *linkAttribute, char *sockAttribute, boolean Box GCC_UNUSED)
{
   /* Declare local variables. */
   CDKSCROLL *fscroll	= fselect->scrollField;
   CDKENTRY *fentry	= fselect->entryField;
   char *tempDir	= 0;
   char *mesg[10], newDirectory[2000], temp[100];
   int ret;

   /* Keep the info sent to us. */
   fselect->fieldAttribute	= fieldAttrib;
   fselect->fillerCharacter	= filler;
   fselect->highlight		= highlight;
   strcpy (newDirectory, directory);

   /* Set the attributes of the entry field/scrolling list. */
   setCDKEntryFillerChar (fentry, filler);
   setCDKScrollHighlight (fscroll, highlight);

   /* Only do the directory stuff if the directory is not null. */
   if (directory != 0)
   {
      /* Try to expand the directory if it starts with a ~ */
      if (directory[0] == '~')
      {
	 tempDir = expandFilename (directory);
	 if (tempDir != 0)
	 {
	    strcpy (newDirectory, tempDir);
	    freeChar (tempDir);
	 }
      }

      /* Change directories. */
      ret = chdir (newDirectory);
      if (ret != 0)
      {
	 /* Beep at them. */
	 Beep();

	 /* Couldn't get into the directory, pop up a little message. */
	 sprintf (temp, "<C>Could not change into %s", newDirectory);
	 mesg[0] = copyChar (temp);

#ifdef HAVE_STRERROR
	 sprintf (temp, "<C></U>%s", strerror(errno));
	 mesg[1] = copyChar (temp);
#else
	 sprintf (temp, "<C></U>Unknown reason.");
	 mesg[1] = copyChar (temp);
#endif

	 mesg[2] = " ";
	 mesg[3] = "<C>Press Any Key To Continue.";

	 /* Pop Up a message. */
	 popupLabel (ScreenOf(fselect), mesg, 4);

	 /* Clean up some memory. */
	 freeCharList (mesg, 4);

	 /* Get out of here. */
	 eraseCDKFselect (fselect);
	 drawCDKFselect (fselect, ObjOf(fselect)->box);
	 return;
      }
   }

   /*
    * If the information coming in is the same as the information
    * that is already there, there is no need to destroy it.
    */
   if (fselect->pwd != directory)
   {
      setPWD(fselect);
   }
   if (fselect->fileAttribute != fileAttribute)
   {
      /* Remove the old pointer and set the new value. */
      freeChar (fselect->fileAttribute);
      fselect->fileAttribute = copyChar (fileAttribute);
   }
   if (fselect->dirAttribute != dirAttribute)
   {
      /* Remove the old pointer and set the new value. */
      freeChar (fselect->dirAttribute);
      fselect->dirAttribute = copyChar (dirAttribute);
   }
   if (fselect->linkAttribute != linkAttribute)
   {
      /* Remove the old pointer and set the new value. */
      freeChar (fselect->linkAttribute);
      fselect->linkAttribute = copyChar (linkAttribute);
   }
   if (fselect->sockAttribute != sockAttribute)
   {
      /* Remove the old pointer and set the new value. */
//.........这里部分代码省略.........
开发者ID:dyne,项目名称:MuSE,代码行数:101,代码来源:fselect.c


注:本文中的Beep函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。