Exemplo n.º 1
0
        public TimedTasksViewModel(Conductor <Screen> .Collection.OneActive parent, TimeInfoViewModel totalTimeInfo, List <TaskViewModel> _tasks, SetupViewModel setupViewModel, IWindowManager windowManager)
        {
            this.parent           = parent;
            this.setupViewModel   = setupViewModel;
            this.totalTimeInfo    = totalTimeInfo;
            this.windowManager    = windowManager;
            timeLeft.TotalSeconds = totalTimeInfo.TotalSeconds;
            this.timer            = new Timer(1000);
            this.timer.Elapsed   += timer_Elapsed;
            foreach (var task in _tasks)
            {
                tasks.Add(task);
            }

            //tasksView = CollectionViewSource.GetDefaultView(tasks);
            //tasksView.CurrentChanging += TasksView_CurrentChanging;

            this.settings = IoC.Get <SettingsViewModel>();
            if (settings != null)
            {
                AutomaticallySwitchTasks = settings.AutoSwitchTasks;
            }

            soundPlayer = new SoundPlayer(new Uri("pack://application:,,,/TimeManagementApp;component/Resources/threeBeep.mp3"));
            soundPlayer.Initialize();
        }
Exemplo n.º 2
0
    public void Handle(PlayMusicMessage message)
    {
        SoundPlayer soundPlayer = this.soundPlayerPool.Spawn(Resources.MusicPlayer).GetComponent <SoundPlayer>();

        soundPlayer.Initialize(message.SoundData, () =>
        {
            this.soundPlayers.Remove(soundPlayer);
            this.soundPlayerPool.Despawn(soundPlayer.transform);
        });
        soundPlayer.Play();
        this.soundPlayers.Add(soundPlayer);
    }
Exemplo n.º 3
0
    private SoundPlayer sound;           // Reference to sound player instantiated by this loader

    void Awake()
    {
        // If SoundPlayer doesn't have a reference to itself yet,
        // we know we need to instantiate a copy of it
        if (SoundPlayer.Instance == null)
        {
            sound = Instantiate(soundPrefab).GetComponent <SoundPlayer> ();
            sound.Initialize();
        }

        // If themes are different or not currently assigned, cause this theme to be played
        if (SoundPlayer.Instance.Theme == MusicTheme.Unassigned || SoundPlayer.Instance.Theme != theme)
        {
            SoundPlayer.Instance.PlayMusicOfTheme(theme, musicClips);
        }
    }
Exemplo n.º 4
0
        /// <summary>
        /// Runs initialization code required to setup the game.
        /// </summary>
        private static void Initialize()
        {
            Console.Title = "Sanmai";

            //Prevents the window from being reized, which will mess with the display
            DeleteMenu(GetSystemMenu(GetConsoleWindow(), false), SC_MAXIMIZE, MF_BYCOMMAND);
            DeleteMenu(GetSystemMenu(GetConsoleWindow(), false), SC_SIZE, MF_BYCOMMAND);

            //Runs code when the window closes with the X. Used to save the collections file
            closeHandler += new EventHandler(CloseHandler);
            SetConsoleCtrlHandler(closeHandler, true);

            Console.CursorVisible     = false;
            Console.OutputEncoding    = Encoding.UTF8;
            Painter.DefaultFrontColor = ConsoleColor.Black;

            SoundPlayer.Initialize();
            Input.Initialize();

            //Creates the data folder if it doesn't exist
            if (!Directory.Exists(DATA_FOLDER))
            {
                Directory.CreateDirectory(DATA_FOLDER);
            }

            //Loads the files
            Settings.LoadSettingsFile(SETTINGS_FILE);

            Collection.LoadCollectionFile(COLLECTION_FILE);
            for (int i = 0; i < Collection.Count; i++)
            {
                Collection.Prizes[i] = Prize.FromFile("Prizes\\Zonk\\0.prz", PrizeCategory.Zonk, 0);
            }

            Collection.LoadPrizeFolder("Prizes\\Zonk\\", PrizeCategory.Zonk);
            Collection.LoadPrizeFolder("Prizes\\Middle\\", PrizeCategory.Middle);
            Collection.LoadPrizeFolder("Prizes\\Expensive\\", PrizeCategory.Expensive);
        }
Exemplo n.º 5
0
 private void Awake()
 {
     soundAudioClips = audioClips;
     SoundPlayer.Initialize();
 }