void pawsButton::SetText(const char* text)
{
    buttonLabel = text;

    if(buttonLabel == "ok")
        SetSound("gui.ok");
    else if(buttonLabel == "quit")
        SetSound("gui.quit");
    else if(buttonLabel == "cancel")
        SetSound("gui.cancel");
    else
        SetSound("sound.standardButtonClick");
}
bool CGUIDialogKaiToast::DoWork()
{
  CSingleLock lock(m_critical);

  if (!m_notifications.empty() &&
      CTimeUtils::GetFrameTime() - m_timer > m_toastMessageTime)
  {
    Notification toast = m_notifications.front();
    m_notifications.pop();
    lock.Leave();

    m_toastDisplayTime = toast.displayTime;
    m_toastMessageTime = toast.messageTime;

    CSingleLock lock2(g_graphicsContext);

    if(!Initialize())
      return false;

    SET_CONTROL_LABEL(POPUP_CAPTION_TEXT, toast.caption);

    SET_CONTROL_LABEL(POPUP_NOTIFICATION_BUTTON, toast.description);

    // set the appropriate icon
    {
      std::string strTypeImage = toast.imagefile;

      if (strTypeImage.empty())
      {
        if (toast.eType == Default)
          strTypeImage = m_defaultIcon;
        else
        {
          int imageControl = -1;
          if (toast.eType == Info)
            imageControl = POPUP_ICON_INFO;
          else if (toast.eType == Warning)
            imageControl = POPUP_ICON_WARNING;
          else if (toast.eType == Error)
            imageControl = POPUP_ICON_ERROR;

          CGUIMessage msg(GUI_MSG_GET_FILENAME, GetID(), imageControl);
          if (OnMessage(msg))
            strTypeImage = msg.GetLabel();
        }
      }

      SET_CONTROL_FILENAME(POPUP_ICON, strTypeImage);
    }

    //  Play the window specific init sound for each notification queued
    SetSound(toast.withSound);

    ResetTimer();
    return true;
  }

  return false;
}
Exemple #3
0
void Reset76489(SN76489 *D,int First)
{
  register int J;

  for(J=0;J<SN76489_CHANNELS;J++) D->Volume[J]=D->Freq[J]=0;

  D->NoiseMode = 0x00;
  D->Buf       = 0x00;
  D->Changed   = (1<<SN76489_CHANNELS)-1;
  D->Sync      = SN76489_ASYNC;
  D->First     = First;

  /* Set instruments */
  SetSound(0+First,SND_MELODIC);
  SetSound(1+First,SND_MELODIC);
  SetSound(2+First,SND_MELODIC);
  SetSound(3+First,SND_NOISE);
}
bool CGUIDialogKaiToast::DoWork()
{
  CSingleLock lock(m_critical);

  if (m_notifications.size() > 0 &&
      CTimeUtils::GetFrameTime() - m_timer > m_toastMessageTime)
  {
    Notification toast = m_notifications.front();
    m_notifications.pop();
    lock.Leave();

    m_toastDisplayTime = toast.displayTime;
    m_toastMessageTime = toast.messageTime;

    CSingleLock lock2(g_graphicsContext);

    if(!Initialize())
      return false;

    SET_CONTROL_LABEL(POPUP_CAPTION_TEXT, toast.caption);

    SET_CONTROL_LABEL(POPUP_NOTIFICATION_BUTTON, toast.description);

    CGUIImage *image = (CGUIImage *)GetControl(POPUP_ICON);
    if (image)
    {
      CStdString strTypeImage = toast.imagefile;

      if (strTypeImage.IsEmpty())
      {
        CGUIImage *typeImage = NULL;

        if (toast.eType == Info)
          typeImage = (CGUIImage *)GetControl(POPUP_ICON_INFO);
        else if (toast.eType == Warning)
          typeImage = (CGUIImage *)GetControl(POPUP_ICON_WARNING);
        else if (toast.eType == Error)
          typeImage = (CGUIImage *)GetControl(POPUP_ICON_ERROR);
        else
          typeImage = image;

        strTypeImage = typeImage->GetFileName();
      }

      image->SetFileName(strTypeImage);
    }

    //  Play the window specific init sound for each notification queued
    SetSound(toast.withSound);

    ResetTimer();
    return true;
  }

  return false;
}
Exemple #5
0
ULONG ASMCALL
gw_SetSound( REG(d0, UWORD                    channel),
             REG(d1, UWORD                    sound),
             REG(d2, ULONG                    offset),
             REG(d3, LONG                     length),
             REG(a2, struct AHIPrivAudioCtrl* audioctrl),
             REG(d4, ULONG                    flags),
             REG(a6, struct AHIBase*          AHIBase) )
{
  return SetSound( channel, sound, offset, length, audioctrl, flags, AHIBase );
}
Exemple #6
0
void Reset8910(register AY8910 *D,int ClockHz,int First)
{
  static byte RegInit[16] =
  {
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFD,
    0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00
  };
  int J;

  /* Reset state */
  memcpy(D->R,RegInit,sizeof(D->R));
  D->Phase[0]=D->Phase[1]=D->Phase[2]=0;
  D->Clock   = ClockHz>>4;
  D->First   = First;
  D->Sync    = AY8910_ASYNC;
  D->Changed = 0x00;
  D->EPeriod = 0;
  D->ECount  = 0;
  D->Latch   = 0x00;

  /* Set sound types */
  SetSound(0+First,SND_MELODIC);
  SetSound(1+First,SND_MELODIC);
  SetSound(2+First,SND_MELODIC);
  SetSound(3+First,SND_NOISE);
  SetSound(4+First,SND_NOISE);
  SetSound(5+First,SND_NOISE);

  /* Silence all channels */
  for(J=0;J<AY8910_CHANNELS;J++)
  {
    D->Freq[J]=D->Volume[J]=0;
    Sound(J+First,0,0);
  }
}
CCrossBow::CCrossBow()
{
	//Load the Animation
	CBaseCharacter::LoadAnimations("resource/aeonaAirCrossBow.xml");
	SetAttacking(false);
	m_pArrow = NULL;
	//m_fTime = 0;
	m_imgArrow = TEX_MNG->LoadTexture("resource/BlueArrow.png", D3DCOLOR_XRGB(0,0,0));
	SetSound(new Sound("resource/sound/AtkBowShoot.wav"));
	m_sndCharged = AUDIO->SFXLoadSound("resource/sound/AtkBowLaser.wav");

	m_fSlashTimer = 0.0f;
}
Exemple #8
0
BOOL CSndThread::Play(UINT snd)
{
	// Save sound
	SetSound( snd );

	// Set thread
	if ( !IsRunning() ) StartThread();

	// Play the sound
	SetEvent( m_hPlay );

	return TRUE;
}
Exemple #9
0
ULONG 
gw_SetSound( struct _Regs* regs )
{
  UWORD                    channel   = (UWORD)                    GET_LONG( regs->d0 );
  UWORD                    sound     = (UWORD)                    GET_LONG( regs->d1 );
  ULONG                    offset    = (ULONG)                    GET_LONG( regs->d2 );
  LONG                     length    = (LONG)                     GET_LONG( regs->d3 );
  struct AHIPrivAudioCtrl* audioctrl = (struct AHIPrivAudioCtrl*) GET_LONG( regs->a2 );
  ULONG                    flags     = (ULONG)                    GET_LONG( regs->d4 );
  struct AHIBase*          AHIBase   = (struct AHIBase*)          GET_LONG( regs->a6 );

  return SetSound( channel, sound, offset, length, audioctrl, flags, AHIBase );
}
Exemple #10
0
ULONG 
gw_SetSound( void )
{
  UWORD                    channel   = (UWORD)                    REG_D0;
  UWORD                    sound     = (UWORD)                    REG_D1;
  ULONG                    offset    = (ULONG)                    REG_D2;
  LONG                     length    = (LONG)                     REG_D3;
  struct AHIPrivAudioCtrl* audioctrl = (struct AHIPrivAudioCtrl*) REG_A2;
  ULONG                    flags     = (ULONG)                    REG_D4;
  struct AHIBase*          AHIBase   = (struct AHIBase*)          REG_A6;

  return SetSound( channel, sound, offset, length, audioctrl, flags, AHIBase );
}
Exemple #11
0
bool CGUIDialogKaiToast::DoWork()
{
  CSingleLock lock(m_critical);

  if (!m_notifications.empty() &&
      CTimeUtils::GetFrameTime() - m_timer > m_toastMessageTime)
  {
    Notification toast = m_notifications.front();
    m_notifications.pop();
    lock.Leave();

    m_toastDisplayTime = toast.displayTime;
    m_toastMessageTime = toast.messageTime;

    CSingleLock lock2(g_graphicsContext);

    if(!Initialize())
      return false;

    SET_CONTROL_LABEL(POPUP_CAPTION_TEXT, toast.caption);

    SET_CONTROL_LABEL(POPUP_NOTIFICATION_BUTTON, toast.description);

    // set the appropriate icon
    {
      std::string icon = toast.imagefile;
      if (icon.empty())
      {
        if (toast.eType == Warning)
          icon = "DefaultIconWarning.png";
        else if (toast.eType == Error)
          icon = "DefaultIconError.png";
        else
          icon = "DefaultIconInfo.png";
      }
      SET_CONTROL_FILENAME(POPUP_ICON, icon);
    }

    //  Play the window specific init sound for each notification queued
    SetSound(toast.withSound);

    // Activate haptics for this notification
    CServiceBroker::GetPeripherals().OnUserNotification();

    ResetTimer();
    return true;
  }

  return false;
}
Exemple #12
0
	void OnUnloadingResource(Effekseer::Effect* effect)
	{
		auto textureLoader = effect->GetSetting()->GetTextureLoader();
		auto soundLoader = effect->GetSetting()->GetSoundLoader();
		auto modelLoader = effect->GetSetting()->GetModelLoader();

		if (textureLoader != nullptr)
		{
			for (auto i = 0; i < effect->GetColorImageCount(); i++)
			{
				textureLoader->Unload(effect->GetColorImage(i));
				SetTexture(effect, i, Effekseer::TextureType::Color, nullptr);
			}

			for (auto i = 0; i < effect->GetNormalImageCount(); i++)
			{
				textureLoader->Unload(effect->GetNormalImage(i));
				SetTexture(effect, i, Effekseer::TextureType::Normal, nullptr);
			}

			for (auto i = 0; i < effect->GetDistortionImageCount(); i++)
			{
				textureLoader->Unload(effect->GetDistortionImage(i));
				SetTexture(effect, i, Effekseer::TextureType::Distortion, nullptr);
			}
		}

		if (soundLoader != nullptr)
		{
			for (auto i = 0; i < effect->GetWaveCount(); i++)
			{
				soundLoader->Unload(effect->GetWave(i));
				SetSound(effect, i, nullptr);
			}
		}

		if (modelLoader != nullptr)
		{
			for (auto i = 0; i < effect->GetModelCount(); i++)
			{
				modelLoader->Unload(effect->GetModel(i));
				SetModel(effect, i, nullptr);
			}
		}
	}
Exemple #13
0
void ResetSCC(register SCC *D,int First)
{
  int J;

  /* Reset registers */
  memset(D->R,0x00,sizeof(D->R));

  /* Set instruments, frequencies, volumes */
  for(J=0;J<SCC_CHANNELS;J++)
  {
    SetSound(0+First,SND_MELODIC);
    D->Freq[J]=D->Volume[J]=0;
  }

  D->First    = First;
  D->Sync     = SCC_ASYNC;
  D->Changed  = 0x00;
  D->WChanged = 0x00;
}
Exemple #14
0
bool CGUIDialogKaiToast::DoWork()
{
  CSingleLock lock(m_critical);

  if (m_notifications.size() > 0 &&
      CTimeUtils::GetFrameTime() - m_timer > m_toastMessageTime)
  {
    Notification toast = m_notifications.front();
    m_notifications.pop();
    lock.Leave();

    m_toastDisplayTime = toast.displayTime;
    m_toastMessageTime = toast.messageTime;

    CSingleLock lock2(g_graphicsContext);

    if(!Initialize())
      return false;

    SET_CONTROL_LABEL(POPUP_CAPTION_TEXT, toast.caption);

    SET_CONTROL_LABEL(POPUP_NOTIFICATION_BUTTON, toast.description);

    CGUIImage *image = (CGUIImage *)GetControl(POPUP_ICON);
    if (image)
    {
      if (!toast.imagefile.IsEmpty())
        image->SetFileName(toast.imagefile);
      else
        image->SetFileName(m_defaultIcon);
    }

    //  Play the window specific init sound for each notification queued
    SetSound(toast.withSound);

    ResetTimer();
    return true;
  }

  return false;
}
Exemple #15
0
void Reset2413(register YM2413 *D,int First)
{
    int J;

    /* All registers filled with 0x00 by default */
    memset(D->R,0x00,sizeof(D->R));

    /* Set initial frequencies, volumes, and instruments */
    for(J=0; J<YM2413_CHANNELS; J++)
    {
        SetSound(J+First,SND_MELODIC);
        D->Freq[J]   = 0;
        D->Volume[J] = 0;
        D->R[J+0x30] = 0x0F;
    }

    D->First    = First;
    D->Sync     = YM2413_ASYNC;
    D->Changed  = 0x000;
    D->PChanged = 0x000;
    D->DChanged = 0x000;
    D->Latch    = 0;
}
bool pawsButton::Setup( iDocumentNode* node )
{    
    // Check for toggle 
    csRef<iDocumentAttribute> toggleAttribute = node->GetAttribute("toggle");
    if ( toggleAttribute )
    {
        csString value( toggleAttribute->GetValue() );
        if ( value == "yes" )  toggle = true;
        else                   toggle = false;

    }

    // Check for keyboard shortcut for this button
    const char *key = node->GetAttributeValue("key");
    if (key)
    {
        if (!strcasecmp(key,"Enter"))
            keybinding = 10;
        else
            keybinding = *key;
    }
    // Check for sound to be associated to Buttondown
    csRef<iDocumentAttribute> soundAttribute = node->GetAttribute( "sound" );
    if ( soundAttribute )
    {
        csString soundName = node->GetAttributeValue("sound");
        SetSound(soundName);
    }
    else
    {
        csString name2;

        csRef<iDocumentNode> buttonLabelNode = node->GetNode( "label" );
        if ( buttonLabelNode )
            name2 = buttonLabelNode->GetAttributeValue("text");

        name2.Downcase();

        if(name2 == "ok")
            SetSound("gui.ok");
        else if(name2 == "quit")
            SetSound("gui.quit");
        else if(name2 == "cancel")
            SetSound("gui.cancel");
        else
            SetSound("sound.standardButtonClick");
    }

    // Check for notify widget
    csRef<iDocumentAttribute> notifyAttribute = node->GetAttribute( "notify" );
    if ( notifyAttribute )
        notify = PawsManager::GetSingleton().FindWidget(notifyAttribute->GetValue());

    // Check for mouse over
    changeOnMouseOver = node->GetAttributeValueAsBool("changeonmouseover", false);

    // Get the down button image name.
    csRef<iDocumentNode> buttonDownImage = node->GetNode( "buttondown" );
    if ( buttonDownImage )
    {
        csString downImageName = buttonDownImage->GetAttributeValue("resource");
        SetDownImage(downImageName);
        downTextOffsetX = buttonDownImage->GetAttributeValueAsInt("textoffsetx");
        downTextOffsetY = buttonDownImage->GetAttributeValueAsInt("textoffsety");
    }

    // Get the up button image name.
    csRef<iDocumentNode> buttonUpImage = node->GetNode( "buttonup" );
    if ( buttonUpImage )
    {
        csString upImageName = buttonUpImage->GetAttributeValue("resource");
        SetUpImage(upImageName);
        upTextOffsetX = buttonUpImage->GetAttributeValueAsInt("textoffsetx");
        upTextOffsetY = buttonUpImage->GetAttributeValueAsInt("textoffsety");
    }
    
    // Get the down button image name.
    csRef<iDocumentNode> buttonGreyDownImage = node->GetNode( "buttongraydown" );
    if ( buttonGreyDownImage )
    {
        csString greyDownImageName = buttonGreyDownImage->GetAttributeValue("resource");
        SetGreyUpImage(greyDownImageName);
    }

    // Get the up button image name.
    csRef<iDocumentNode> buttonGreyUpImage = node->GetNode( "buttongrayup" );
    if ( buttonGreyUpImage )
    {
        csString greyUpImageName = buttonGreyDownImage->GetAttributeValue("resource");
        SetGreyUpImage(greyUpImageName);
    }

    // Get the "on char name flash" button image name.
    csRef<iDocumentNode> buttonSpecialImage = node->GetNode( "buttonspecial" );
    if ( buttonSpecialImage )
    {
        csString onSpecialImageName = buttonSpecialImage->GetAttributeValue("resource");
        SetOnSpecialImage(onSpecialImageName);
    }


    // Get the button label
    csRef<iDocumentNode> buttonLabelNode = node->GetNode( "label" );
    if ( buttonLabelNode )
    {
        buttonLabel = PawsManager::GetSingleton().Translate(buttonLabelNode->GetAttributeValue("text"));
    }

    originalFontColour = GetFontColour();
    
    return true;
}
FMODSoundInstance::FMODSoundInstance( ISound* const pSound )
:	m_Channel( NULL )
{
	SetSound( pSound );
}
	bool SPSoundTrack::SetSound( SPString setSound )
	{
		bool result = SetSound(SPSoundManager::GetSingleton().GetSound(setSound));
		soundName = setSound;
		return result;
	}
Exemple #19
0
void ResourceManager::LoadSound(int ID, std::string filename)
{
	SoundBufferHold.acquire(ID, thor::Resources::fromFile<sf::SoundBuffer>(filename));
	std::cout << ID << " " << filename << " soundbuffer file loaded successfully." << std::endl;
	SetSound(1);
}
Exemple #20
0
//--------------------------------------------------------------------------------
//  JS NOTE:  Add sound as buffer to audiao manager
//--------------------------------------------------------------------------------
int CVehicleSound::Read (SStream *stream, Tag tag)
{ CAudioManager *snd = globals->snd;
  int rc = TAG_IGNORED;
  SMessage fmsg;
  char fint[64];
  char fext[64];
  switch (tag) {
  case 'cach':
    //---  pre-cache sfx files- ---------------------
    cach = true;;
    return TAG_READ;
    //---  Engine sounds ----------------------------
    //--- Crash sounds ------------------------------
  case 'crsh':
    ReadCrashSounds(stream);
    return TAG_READ;
  //--- Volume for next sound -----------------------
  case 'volu':
    ReadFloat(&volu,stream);
    return TAG_READ;
  //--- Loop back sample for next engine sound  -----
  case 'back':
    ReadInt(&sample,stream);
    return TAG_READ;
  //--- Cranking sound ----------------------------
	case 'crkE':
    // Engine Crank 
		ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
    SetEngineSound('crkE',fext);
	  sample  = 0;
    return TAG_READ;
	//--- Catching sound ----------------------------
  case 'catE':
    // internal engine catching 
		ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
		SetEngineSound('catE',fext);
	  sample  = 0;
    return TAG_READ;
	//--- Running sound -----------------------------
	case 'runE':
    // internal engine runing 
		ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
		SetEngineSound('runE',fext);
	  sample  = 0;
    return TAG_READ;
	//--- short stop sound --------------------------
  case 'hltE':
    // internal engine idle-stop
		ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
    SetEngineSound('hltE',fext);
	  sample  = 0;
    return TAG_READ;
	//--- Failing at start up -----------------------
  case 'falE':
    // internal engine stop 
		ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
    SetEngineSound('falE',fext);
	  sample  = 0;
    return TAG_READ;
  //--- Miss fire sound ---------------------------
	case 'misE':
    // internal engine miss fire
		ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
		SetEngineSound('misE',fext);
	  sample  = 0;
    return TAG_READ;

  case 'prsi':
    // Propeller start->idle
    ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('prsi',fext);
    return TAG_READ;
  case 'pris':
    // Propeller idle->stop
    ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('pris',fext);
    return TAG_READ;

    //--- Wind------------------------------------ 
  case 'wind':
    // internal wind 
    ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('wind',fext);
    return TAG_READ;
    //--- Tires------------------------------------ 
  case 'tire':
    ReadTireSound(stream);
    return TAG_READ;
    //--- Stall horn------------------------------- 
  case 'stal':
    // internal stall horn 
    ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('stal',fext);
    return TAG_READ;
    //--- FLAPS ------------------------------- 
  case 'flap':
    ReadFlapSound(stream);
    return TAG_READ;
  case 'fmsg':
    // flaps message 
    ReadMessage (&fmsg, stream);
    rc = TAG_READ;
    break;
    //--- Ground------------------------------- 
  case 'grnd':
    ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('grnd',fext);
    return TAG_READ;
    //--- Gear UP------------------------------- 
  case 'geru':
    ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('geru',fext);
    return TAG_READ;
  case 'gerd':
    //--- Gear Down --------------------------------- 
    ReadString (fint, sizeof (fint) - 1, stream);
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('gerd',fext);
    return TAG_READ;
    //----Outter marker-------------------------------
  case 'outr':
    // outer marker 
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('outr',fext);
    return TAG_READ;
    //----middle marker-------------------------------
  case 'midl':
    // middle marker 
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('midl',fext);
    return TAG_READ;
    //--- Inner marker ------------------------------- 
  case 'innr':
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('innr',fext);
    return TAG_READ;

  case 'gyro':
    //--- gyro sounds ---------------------------------
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('gyrl',fext);
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('gyrs',fext);
    return TAG_READ;
  case 'gmsg':
    //---- gyro message ------------------------------
    ReadMessage (&fmsg, stream);
    return TAG_READ;
  case 'elt_':
    // elt warning sound 
    ReadString (fext, sizeof (fext) - 1, stream);
    SetSound('elts',fext);
    //snd->ReserveSoundBUF('elts',fext,sample); // lc 052310 -
    return TAG_READ;
  case 'bend':
    // 
    ReadFloat (&pMin, stream);
    ReadFloat (&pMax, stream);
    return TAG_READ;
  }

  if (rc != TAG_READ) {
    // Tag was not processed by this object, it is unrecognized
    WARNINGLOG ("CVehicleSound::Read : Unrecognized tag <%s>", TagToString(tag));
  }

  return rc;
}
Exemple #21
0
int c3DSound::SetSound(c2DSound* pSound, D3DXVECTOR3 Pos)
{
	return SetSound(pSound, &Pos);
}