Exemplo n.º 1
0
Sound::Sound::Sound (const ::Sound::Sound &snd)
{
  midi = snd.midi;
  Volume = snd.Volume;
  X = snd.X;
  Y = snd.Y;
  snd.midi = 0;
  SetSpeaker ();
}
Exemplo n.º 2
0
void Sound::Sound::play (int loopmode)
{
  if(!EnableSound)
    return;
  Calc ();
  if (midi)
    play_midi (midi, loopmode != 0);
  else
    sndPlaySound (fn, _volume, _balance);
  SetSpeaker ();
}
Exemplo n.º 3
0
Sound::Sound& Sound::Sound::operator= (const ::Sound::Sound &snd)
{
  destroy_me ();
  midi = snd.midi;
  Volume = snd.Volume;
  X = snd.X;
  Y = snd.Y;
  snd.midi = 0;
  SetSpeaker ();
  return *this;
}
Exemplo n.º 4
0
void
CPFWindow::ShowStatus(void)
{
	StMutex mutex(*this);
	static int ID;

	if(mDead || !mPFoneFrame)
		return;
	switch(mState)
	{
		case _cs_none:
		case _cs_uninitialized:
		case _cs_listening:
			mRemoteIDStatic.ShowWindow(SW_HIDE);
			mRemoteIDTitleStatic.ShowWindow(SW_HIDE);
			if( gHardwareIsFullDuplex )
			{
				mTalkButton.SetWindowText("Test");
				mTalkButton.ShowWindow(SW_SHOW);
			}
			mCallComboBox.ShowWindow(SW_SHOW);
			mConnectButton.ShowWindow(SW_SHOW);

			if(gPGFOpts.popt.connection == _cme_Serial)
			{
				mConnectButton.SetWindowText("Dial");
				mLocalIPStatic.ShowWindow(SW_HIDE);
				mLocalIPTitleStatic.ShowWindow(SW_HIDE);
			}
			else
			{
				mConnectButton.SetWindowText("Connect");
				mLocalIPStatic.ShowWindow(SW_SHOW);
				mLocalIPTitleStatic.ShowWindow(SW_SHOW);
			}

			mDecoderComboBox.EnableWindow(FALSE);
			mCoderComboBox.EnableWindow(FALSE);
			//SetDefID(IDC_DIAL);
			break;
		case _cs_connected:
			mConnectButton.SetWindowText("Hangup");
			mConnectButton.ShowWindow(SW_SHOW);
			if(mControlThread->GetControlState() == _con_Phone)
			{
				SetSpeaker(mTalkFlag, mFullDuplex);
				mTalkButton.ShowWindow(SW_SHOW);
				mDecoderComboBox.EnableWindow(TRUE);
				mCoderComboBox.EnableWindow(TRUE);
				//SetDefID(IDC_TALK_LISTEN);
			}
			else
			{
				if( !gHardwareIsFullDuplex )
					mTalkButton.ShowWindow(SW_HIDE);
				mDecoderComboBox.EnableWindow(FALSE);
				mCoderComboBox.EnableWindow(FALSE);
				//SetDefID(IDC_DIAL);
			}
			ShowCaller();
			break;
		case _cs_calldetected:
			mCallComboBox.ShowWindow(SW_HIDE);
			mConnectButton.SetWindowText("Answer");
			ShowCaller();
			//SetDefID(IDC_DIAL);
			break;
		case _cs_connecting:
		case _cs_disconnecting:
			mCallComboBox.ShowWindow(SW_HIDE);
			mConnectButton.ShowWindow(SW_SHOW);
			if( !gHardwareIsFullDuplex )
				mTalkButton.ShowWindow(SW_HIDE);
			mConnectButton.SetWindowText("Hangup");

			mDecoderComboBox.EnableWindow(FALSE);
			mCoderComboBox.EnableWindow(FALSE);

			//SetDefID(IDC_DIAL);
			break;
		case _cs_initializing:
			mCallComboBox.ShowWindow(SW_HIDE);
			mConnectButton.ShowWindow(SW_SHOW);
			if( !gHardwareIsFullDuplex )
				mTalkButton.ShowWindow(SW_HIDE);
			mConnectButton.SetWindowText("Cancel");

			mDecoderComboBox.EnableWindow(FALSE);
			mCoderComboBox.EnableWindow(FALSE);

			//SetDefID(IDC_DIAL);
			break;
	}
	switch(mState)
	{
		case _cs_listening:
			mStatusBar = "Waiting for call";
			mPFoneFrame->setStatusPhoneIconID(IDR_WAITING);
			break;
		case _cs_none:
		case _cs_uninitialized:
			mStatusBar = "None";
			mPFoneFrame->setStatusPhoneIconID(0);
			break;
		case _cs_connected:
			switch(mControlThread->GetControlState())
			{
				default:
				case _con_Configuring:
					mStatusBar = "Configuring";
					break;
				case _con_Phone:
					if(!memcmp(&mCryptor, "NONE", 4))
						mPFoneFrame->setStatusSecureIconID(IDR_INSECURE);
					else
						mPFoneFrame->setStatusSecureIconID(IDR_SECURE);
					break;
				case _con_Disconnecting:
					mStatusBar = "Confirming Hangup";
					break;
			}
			mPFoneFrame->setStatusPhoneIconID(IDR_CONNECTED);
			break;
		case _cs_calldetected:
			mStatusBar = "Ring";
			break;
		case _cs_connecting:
			mStatusBar = "Connecting";
			mPFoneFrame->setStatusPhoneIconID(IDR_CONNECTED);
			break;
		case _cs_disconnecting:
			mStatusBar = "Disconnecting";
			mPFoneFrame->setStatusPhoneIconID(IDR_CONNECTED);
			break;
		case _cs_initializing:
			mStatusBar = "Initializing modem";
			break;
		default:
			pgp_errstring("unknown status");
	}
	if(mState != _cs_connected)
		mPFoneFrame->setStatusSecureIconID(ID);
}
Exemplo n.º 5
0
 void WriteCommandByte(BYTE command)
 {
     switch (command) {
     case DSP_GET_VERSION:
         dprintf2(("Command - Get Version"));
         DSPReadState = FirstVersionByte;
         break;

     case DSP_CARD_IDENTIFY:
         dprintf2(("Command - Identify"));
         DSPWriteState = CardIdent;
         break;

     case DSP_SPEAKER_ON:
         dprintf2(("Command - Speaker ON"));
         SetSpeaker(TRUE);
         Pause();
         break;

     case DSP_SPEAKER_OFF:
         dprintf2(("Command - Speaker OFF"));
         SetSpeaker(FALSE);
         Pause();
         break;

     case DSP_SET_SAMPLE_RATE:
         DSPWriteState = SetTimeConstant;
         break;

     case DSP_SET_BLOCK_SIZE:
         DSPWriteState =  BlockSizeFirstByte;
         break;

     case DSP_WRITE:
         dprintf2(("Command - Write - non Auto"));
         DSPWriteState = BlockSizeFirstByteWrite;
         break;


     case DSP_DIRECT_WAVE_OUT:
         dprintf2(("Command - Direct output"));
         DSPWriteState = DirectWaveOut;
         break;

     case DSP_WRITE_AUTO:
         dprintf2(("Command - Write - Auto"));
         StartTransfer(FALSE, TRUE);
         break;

     case DSP_READ:
         dprintf2(("Command - Read - non Auto"));
         DSPWriteState = BlockSizeFirstByteRead;
         break;

     case DSP_READ_AUTO:
         dprintf2(("Command - Read - Auto"));
         StartTransfer(TRUE, TRUE);
         break;

     case DSP_HALT_DMA:
         dprintf2(("Command - Halt DMA"));
         Pause();
         break;

     case DSP_CONTINUE_DMA:
         dprintf2(("Command - Continue DMA"));
         Continue();
         break;

     case DSP_STOP_AUTO:
         dprintf2(("Command - Stop DMA"));
         StopAuto();
         break;

     case DSP_GENERATE_INT:
         dprintf2(("Command - Generate interrupt DMA"));
         GenerateInterrupt();
         break;

     default:
         dprintf2(("Unrecognized DSP command %2X", command));
     }
 }