<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using System.IO;

namespace gdd2xna
{
    /// <summary>
    /// The only instance of this should be in an instance of Game.cs, this currently loads and plays instances of SoundEffect randomly
    /// from all the instances of SoundEffect that were loaded as directed by MusicInfo.txt
    /// </summary>
    public class MusicManager
    {
        #region instance variables
        private List<Song> songList = new List<Song>();
        private String ContentMusicPath = "Music//";
        private String MusicInfoFileName = "../../../../gdd2xnaContent/Music/MusicInfo.txt";
        private Game game;
        private bool canPlay;
        private Song currentSong;
        private Random gen;
        private double secondsSinceSongStart;
        #endregion

        //relevent if you just want to start or stop the music from code outside this
        #region public methods
        /// <summary>
        /// Stops music from being played, if a song is playing, it isn't saved for when Play() is called
        /// </summary><commit_msg>Added a music toggle method. Next step is to call it when the M key is pressed.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using System.IO;

namespace gdd2xna
{
    /// <summary>
    /// The only instance of this should be in an instance of Game.cs, this currently loads and plays instances of SoundEffect randomly
    /// from all the instances of SoundEffect that were loaded as directed by MusicInfo.txt
    /// </summary>
    public class MusicManager
    {
        #region instance variables
        private List<Song> songList = new List<Song>();
        private String ContentMusicPath = "Music//";
        private String MusicInfoFileName = "../../../../gdd2xnaContent/Music/MusicInfo.txt";
        private Game game;
        private bool canPlay;
        private Song currentSong;
        private Random gen;
        private double secondsSinceSongStart;
        #endregion

        //relevent if you just want to start or stop the music from code outside this
        #region public methods
        /// <summary>
        /// Stops music from being played, if a song is playing, it isn't saved for when Play() is called
        /// </summary>
        public void Toggle()
        {
            if (canPlay == false) Play();
            else Stop();
        }

{'fraction_non_alphanumeric': 0.08682289665770265, 'fraction_numerical': 0.001536688436419516, 'mean_word_length': 2.4627659574468086, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3731020', 'n_tokens_mistral': 653, 'n_tokens_neox': 644, 'n_words': 274}