Beispiel #1
0
        //private SoundTrack _SoundTrack;

        public SoundTrackBar(SoundTrack track)
            : base(track)
        {
            this.Height = BaseHeight * 2;
            //_SoundTrack = track;
            this.ContextMenu = SoundTrackBarContextMenu.Instance;
        }
Beispiel #2
0
 public SoundTrackControl(double y, double w, SoundTrack track)
 {
     Track = track;
     CreateHeader(y);
     CreateContent(y, w, Header.Height);
     AddParts(Track.Parts);
 }
Beispiel #3
0
 /// <summary>
 /// Plays AudioClip in SoundTrack
 /// </summary>
 /// <param name="track">SoundTrack containing sound effect and settings</param>
 public void PlaySoundEffect(SoundTrack track)
 {
     if (track != null)
     {
         audioSource.PlayOneShot(track.clip, track.volume);
     }
 }
Beispiel #4
0
 /////////////////////////////////////////////////////
 // track methods
 /////////////////////////////////////////////////////
 public void addTrack(String name, Delegate onCompleteHandler=null)
 {
     if(_tracks.ContainsKey(name) == false){
         _tracks[name] = new SoundTrack( new Sound( name ), gameObject, onCompleteHandler );
         _tracks[name].volume = _trackVolume;
     }
 }
Beispiel #5
0
        public static void Update(GameTime gameTime)
        {
            SoundTrack.Update(gameTime);

            if (isWaiting)
            {
                elapsedTime += (int)gameTime.ElapsedGameTime.TotalMilliseconds;

                if (elapsedTime < waitingTime)
                {
                    return;
                }
                else
                {
                    StopWaiting();
                }

                // It's possible to begin waiting again after invoke 'onStopWaiting'
                if (isWaiting)
                {
                    return;
                }
            }

            CurrentScene.Update(gameTime);
        }
    /////////////////////////////////////////////////////
    // track methods
    /////////////////////////////////////////////////////

    public void addTrack(String name, Delegate onCompleteHandler = null)
    {
        if (_tracks.ContainsKey(name) == false)
        {
            _tracks[name]        = new SoundTrack(new Sound(name), gameObject, onCompleteHandler);
            _tracks[name].volume = _trackVolume;
        }
    }
 public StickerRegister_Finished(Sticker sticker)
 {
     InitializeComponent();
     StickerNewSticker.StickerFrame.Source = sticker.StickerFrame.Source;
     StickerNewSticker.StickerImage.Source = sticker.StickerImage.Source;
     StickerNewSticker.StickerName.Content = sticker.StickerName.Content;
     SoundPlayer.Instance.Play(SoundTrack.Get("sfx_forge"));
 }
Beispiel #8
0
        public void AddSoundTrack(SoundTrack soundTrack)
        {
            var trackControll = new SoundTrackControl(lastHeigth, minWidth, soundTrack);

            lastHeigth += 80 + 5.0;
            HeaderCanvas.Children.Add(trackControll.Header);
            ContentCanvas.Children.Add(trackControll.Content);
            Resize();
        }
Beispiel #9
0
    public void PlaySoundEffectLooping(SoundType type)
    {
        // //Debug.Log("Playing looping sound effect: " + type);
        SoundTrack  track       = GetSoundEffect(type);
        AudioSource audioSource = GetAudioSource(track);

        // Play sound effect
        audioSource.Play();
    }
Beispiel #10
0
 private void ButtonSave_Click(object sender, RoutedEventArgs e)
 {
     GameMaster.Settings.Volume       = CheckBoxMuted.IsChecked.Value ? 0 : (float)volume;
     GameMaster.Settings.AntiAliasing = CheckBoxAA.IsChecked.Value;
     GameMaster.SaveAll();
     ButtonSave.IsEnabled = false;
     SoundPlayer.StopAll();
     SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true);
 }
        public void Spin()
        {
            Spins = 0;
            var t = 1000;

            Slot0.Spin(t);
            Slot1.Spin(t * 2);
            Slot2.Spin(t * 3);
            SoundPlayer.Instance.Play(SoundTrack.Get("sfx_slot" + RNG.Next(0, 3)));
        }
Beispiel #12
0
        public Homepage()
        {
            InitializeComponent();

            if (!SoundTrack.Get("st_main").IsPlaying)
            {
                SoundPlayer.StopAll("st_blacksmith");
                SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true);
            }
        }
Beispiel #13
0
 private void GiftButton_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (DateTime.Today > GameMaster.Player.LastGift)
     {
         ChangeState(ControlState.Compact);
         GiftButton.Visibility      = Visibility.Hidden;
         GameMaster.Player.LastGift = DateTime.Today;
         GameMaster.Player.Coins   += 10;
         SoundPlayer.Instance.Play(SoundTrack.Get("sfx_coins"));
     }
 }
Beispiel #14
0
        public Album()
        {
            InitializeComponent();
            FilterPanel.FilterChanged += InteractionBar_FilterChanged;

            if (!SoundTrack.Get("st_main").IsPlaying)
            {
                SoundPlayer.StopAll("st_blacksmith");
                SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true);
            }
        }
Beispiel #15
0
 public Boolean SetPage(AlbumPage page)
 {
     if (page == null)
     {
         return(false);
     }
     this.CurrentPage = page;
     this.AlbumArea.Children.Clear();
     this.AlbumArea.Children.Add(page);
     SoundPlayer.Instance.Play(SoundTrack.Get("sfx_pageturn"));
     return(true);
 }
Beispiel #16
0
    /// <summary>
    /// Plays sound effect associated with SoundType
    /// </summary>
    /// <param name="type">SoundType corresponding to desired sound effect (if multiple sound effects found, will choose one at random)</param>
    public void PlaySoundEffect(SoundType type)
    {
        // Ignore request if passed NONE
        if (type.Equals(SoundType.NONE))
        {
            return;
        }

        // Play sound effect if exists
        SoundTrack track = GetSoundEffect(type);

        PlaySoundEffect(track);
    }
Beispiel #17
0
    public void StopSoundEffectLooping(SoundType type)
    {
        // //Debug.Log("Stopping looping sound effect: " + type);
        AudioSource audioSource;
        SoundTrack  track = GetSoundEffect(type);

        if (!soundEffectToAudioSourceMap.TryGetValue(track, out audioSource))
        {
            //Debug.LogWarningFormat("AudioSource not found for {0} effect", type);
            return;
        }
        audioSource.Stop();
    }
Beispiel #18
0
    private AudioSource InitializeAudioSource(SoundTrack track)
    {
        // Instantiate AudioSource as child
        AudioSource audioSource = Instantiate(new GameObject().AddComponent <AudioSource>(), transform);

        audioSource.name = track.type.ToString() + "_AudioSource";

        // Configure with track's properties
        audioSource.clip   = track.clip;
        audioSource.loop   = track.loop; // This should always be true, but just in case...
        audioSource.volume = track.volume;

        return(audioSource);
    }
 public Client()
 {
     GameMaster.LoadAll();
     Cache.Load();
     //Cache.DumpLog();
     InitializeComponent();
     App.ClientWindow.SetCurrentPage(new Homepage());
     this.Background = new ImageBrush(Sprite.Get("bg_oldpaper").Source);
     if (!SoundTrack.Get("st_main").IsPlaying)
     {
         SoundPlayer.StopAll("st_blacksmith");
         SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true);
     }
     //TestUtil.RunAllTests();
 }
Beispiel #20
0
 void Awake()
 {
     // init the game music
     if (mpInstance != null)
     {
         // we already have a soundtrack; don't need another
         Destroy(gameObject);
     }
     else
     {
         // we don't have a soundtrack yet; get set up!
         mpInstance = this;
         // keep the music going between scenes
         GameObject.DontDestroyOnLoad(gameObject);
     }
 }
Beispiel #21
0
    private void Awake()
    {
        if (soundTrack == null)
        {
            soundTrack = this;
        }
        else
        {
            Destroy(gameObject);
        }
        // grabs the current scene's index
        m_currentSceneIndex       = SceneManager.GetActiveScene().buildIndex;
        SceneManager.sceneLoaded += sceneChanged;

        soundTrackSource = GetComponent <AudioSource>();
    }
Beispiel #22
0
    private AudioSource GetAudioSource(SoundTrack track)
    {
        AudioSource audioSource;

        // Instantiate AudioSource if not found for this track
        if (!soundEffectToAudioSourceMap.TryGetValue(track, out audioSource))
        {
            // //Debug.LogFormat("AudioSource not found for {0} effect; creating one now", type);
            audioSource = InitializeAudioSource(track);

            // Add to mapping
            soundEffectToAudioSourceMap.Add(track, audioSource);
        }

        return(audioSource);
    }
Beispiel #23
0
        public Configs()
        {
            InitializeComponent();
            ButtonSave.IsEnabled = false;
            Console.WriteLine(GameMaster.Settings.Volume);
            CheckBoxAA.IsChecked = GameMaster.Settings.AntiAliasing;
            autoContext          = true;
            volume                  = SliderVolume.Value = GameMaster.Settings.Volume;
            autoContext             = false;
            CheckBoxMuted.IsChecked = volume == 0;

            if (!SoundTrack.Get("st_main").IsPlaying)
            {
                SoundPlayer.StopAll();
                SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true);
            }
        }
    /// <summary>
    /// Plays background music associated with given MusicType
    /// </summary>
    /// <param name="newMusic"></param>
    public void SetMusic(SoundType newMusic)
    {
        // Ignore if passed NONE or if given music already playing
        if (newMusic.Equals(SoundType.NONE) || newMusic.Equals(currentlyPlayingMusic))
        {
            return;
        }

        // Hook up & play music
        SoundTrack musicTrack = backgroundMusic.Find(s => s.type == newMusic);

        audioSource.clip   = musicTrack.clip;
        audioSource.volume = musicTrack.volume;
        audioSource.Play();

        currentlyPlayingMusic = newMusic;
    }
        public StickerRegister_TypeChoosing()
        {
            InitializeComponent();
            ComboBoxType.ItemsSource = new Generics.LinkedList <String>()
            {
                "Criatura",
                "Semideus",
                "Deus",
                "Titã"
            };

            if (!SoundTrack.Get("st_blacksmith").IsPlaying)
            {
                SoundPlayer.StopAll("st_main");
                SoundPlayer.Instance.Play(SoundTrack.Get("st_blacksmith"), loop: true);
            }
            ComboBoxType.SelectedIndex = 0;
        }
Beispiel #26
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);

            SuperGraphics = GraphicsDevice;

            Global.EntityAtlas = Content.Load <Texture2D>("Graphics\\entity_atlas");
            Global.MapAtlas    = Content.Load <Texture2D>("Graphics\\gonzalo_map");

            if (settings.PlaySound)
            {
                SoundEffect soundTrack = Content.Load <SoundEffect>("SoundTracks\\chaesd_by_teh_rievr");
                SoundTrack.Load(soundTrack, play: true);
            }

            match = GetMatch();
        }
        public SlotMinigame()
        {
            InitializeComponent();
            Spins = 0;
            Slot0.FinishedSpin += Slot_FinishedSpin;
            Slot1.FinishedSpin += Slot_FinishedSpin;
            Slot2.FinishedSpin += Slot_FinishedSpin;
            if (!DesignerProperties.GetIsInDesignMode(this))
            {
                this.SpinButton.Source = Sprite.Get("redbutton_released").Source;
                this.CoinIcon.Source   = Sprite.Get("coin").Source;
                Refresh();
            }

            if (!SoundTrack.Get("st_main").IsPlaying)
            {
                SoundPlayer.StopAll("st_blacksmith");
                SoundPlayer.Instance.Play(SoundTrack.Get("st_main"), loop: true);
            }
        }
Beispiel #28
0
    private void Awake()
    {
        instance = this;

        List <string[]> trackDataList = InstanceLoad.GetInstanceData("Texts/TrackData");

        foreach (string[] insDataArr in trackDataList)
        {
            SoundTrack oneTrack = new SoundTrack(int.Parse(insDataArr[0]), insDataArr[1], insDataArr[2], insDataArr[3]);
            trackList.Add(oneTrack);
        }
        List <string[]> musicDataList = InstanceLoad.GetInstanceData("Texts/MusicData");

        foreach (string[] insDataArr in musicDataList)
        {
            OneMusic oneMusic = new OneMusic(int.Parse(insDataArr[0]), int.Parse(insDataArr[1]), insDataArr[2], insDataArr[3], insDataArr[4]);
            musicList.Add(oneMusic);
            trackList[oneMusic.trackId].musicList.Add(oneMusic);
        }
    }
    public void updateVolumeOnCurrentTracks()
    {
        SoundTrack tempTrack = null;

        if (_tracks != null)
        {
            // set to level
            foreach (var kname in _tracks)
            {
                if (_tracks.ContainsKey(kname.Key))
                {
                    tempTrack = _tracks[kname.Key];
                    if (tempTrack != null)
                    {
                        //tempTrack.volume = 0.0;
                        //tempTrack.volume = 1.0;
                        tempTrack.volume = _trackVolume * tempTrack.volumeRatio;
                    }
                }
            }
        }
    }
Beispiel #30
0
        public void Initialize()
        {
            if (!SoundTrack.IsPlaying)
            {
                SoundTrack.Load(Loader.LoadSound("Soundtrack\\timbu_beat"));
                SoundTrack.Play();
            }
            Sfx.Load("pulo", Loader.LoadSound("SFX\\pulando"));
            Sfx.Load("pegar_ar", Loader.LoadSound("SFX\\pegando_ar"));
            Sfx.Load("afulibar_escada", Loader.LoadSound("SFX\\afulibando_escada"));
            Sfx.Load("rodada", Loader.LoadSound("SFX\\rodando"));

            Platforms = new List <Platform>();
            Platforms.Add(new Platform());
            AddPlatforms();
            Player = new Timbu(Vector2.Zero);
            Player.MoveTo(new Vector2(50, Player.Position.Y));
            StepPlayerOnPlatform(Platforms.First());
            Score       = 0;
            ElapsedTime = 0;
            deathText   = "";
        }
Beispiel #31
0
        public void LoadContent(ContentManager Content)
        {
            // TODO: use this.Content to load your game content here
            // Load the player resources
            Vector2 playerPosition = new Vector2(Game1.GAME.GraphicsDevice.Viewport.TitleSafeArea.X, Game1.GAME.GraphicsDevice.Viewport.TitleSafeArea.Y + Game1.GAME.GraphicsDevice.Viewport.TitleSafeArea.Height / 2);

            player.Initialize(Content.Load <Texture2D>("Assets\\isaacSS"), playerPosition, Content.Load <SpriteFont>("Assets\\Font\\CurrentSong"), 8, 8);
            TearsCount = 2;

            //Loads the item in
            ItemT  = Content.Load <Texture2D>("Assets\\item1");
            Item2T = Content.Load <Texture2D>("Assets\\item2");
            Item3T = Content.Load <Texture2D>("Assets\\item3");


            RockT  = Content.Load <Texture2D>("Assets\\Rock");
            EnemyT = Content.Load <Texture2D>("Assets\\isaac");

            //Loads each enemy in the enemy list
            foreach (Entity e in entities)
            {
                e.Initialize(Content.Load <Texture2D>(e.TexturePath));
            }

            //Loads the background image
            BG          = Content.Load <Texture2D>("Assets\\Room");
            TransitionT = Content.Load <Texture2D>("Assets\\transition");
            transition  = new Transition(2, 2, TransitionT);


            //Loads the song
            Mayhem     = Content.Load <Song>("Audio\\Soundtrack\\Mayhem");
            Marduk     = Content.Load <Song>("Audio\\Soundtrack\\Marduk");
            DarkThrone = Content.Load <Song>("Audio\\Soundtrack\\DarkThrone");
            Burzum     = Content.Load <Song>("Audio\\Soundtrack\\Burzum");
            OM         = Content.Load <Song>("Audio\\Soundtrack\\OceanMan");
            soundTrack = new SoundTrack(Marduk, DarkThrone, Burzum, Mayhem);
        }
Beispiel #32
0
 /// <summary>
 /// plays the sound by index.
 /// </summary>
 /// <param name="index">an index of game sound</param>
 /// <returns>playing sound cue</returns>
 public static Cue Play(SoundTrack index)
 {
     return SoundManager.PlaySound( szSoundName[(int)index]);
 }
Beispiel #33
0
 /// <summary>
 /// plays back the 3D positional sound
 /// </summary>
 /// <param name="index">an index of game sound</param>
 /// <param name="owner">
 /// the object to which the 3D position will be applied.
 /// </param>
 /// <returns></returns>
 public static Cue Play3D(SoundTrack index, GameUnit owner)
 {
     return FrameworkCore.SoundManager.PlaySound3D(szSoundName[(int)index], 
                                                   owner.Emitter);
 }
Beispiel #34
0
 /// <summary>
 /// plays back the 3D positional sound
 /// </summary>
 /// <param name="index">an index of game sound</param>
 /// <param name="emitter">
 /// the emitter to which the 3D position will be applied.
 /// </param>
 /// <returns></returns>
 public static Cue Play3D(SoundTrack index, AudioEmitter emitter)
 {
     return FrameworkCore.SoundManager.PlaySound3D(szSoundName[(int)index],
                                                   emitter);
 }