Exemplo n.º 1
0
        /// <summary>
        /// Creates an alarm at hour:minute with a few options:
        /// </summary>
        ///
        /// <param name="hour">The hour of day this alarm goes off at</param>
        /// <param name="minute">The minute of day this alarm goes off at</param>
        /// <param name="repeat">Whether or not this alarm repeats</param>
        /// <param name="audioFile">The name of the audio file to play as the alarm tone</param>
        /// <param name="weekly">Indicates if this alarm runs on a weekly cycle (false is a daily cycle)</param>
        /// <param name="days">If weekly, indicates which days of the week the alarm goes off on</param>
        public Alarm(int hour, int minute, bool repeat, string audioFile, bool weekly, List <DayOfWeek> days, string alarmName)
        {
            try
            {
                alarmName = setAlarmName(alarmName);

                this.hour      = hour;
                this.minute    = minute;
                this.audioFile = audioFile;
                audio          = audioController.getAudio(audioFile);

                IsRepeating = repeat;
                IsWeekly    = weekly;

                if (weekly)
                {
                    WeeklyCtor(hour, minute, days);
                }
                else
                {
                    NonWeeklyCtor(hour, minute);
                }
            }
            catch (NullReferenceException e) { }
        }
        /// <summary>
        /// Creates and returns a new audio object for the provided filename
        /// </summary>
        /// <param name="fileName">The name of the file play</param>
        /// <returns></returns>
        public AudioI getAudio(string fileName)
        {
            AudioI audio = createAudioObject(fileName);

            audioObjects.Add(audio);
            return(audio);
        }
Exemplo n.º 3
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);
            spriteFont = Content.Load<SpriteFont>("Data\\SpriteFont1");

            root = new Core.RootDisposable(Content);
            AudioTypes audioType;
            audio = Audio.Init(AudioTypes.XNA | AudioTypes.Dumby, out audioType, root);
            sound = SoundAPI.New(audio, "Data/Explo2.wav", 1, false, null);

            while (true)
            {
                var e = Core.Loader.UpdateLoad();
                if (e != null) throw e;
                if (Core.Loader.ItemsRemainingToLoad == 0) break;
            }
        }
        public MainWindow()
        {
            InitializeComponent();

            root = new Core.RootDisposable();
            AudioTypes audioType;
            audio = Audio.Init(AudioTypes.XAudio | AudioTypes.Dumby, out audioType, root);
            sound = SoundAPI.New(audio, "Data/Explo2.wav", 1, false, null);

            while (true)
            {
                var e = Core.Loader.UpdateLoad();
                if (e != null) throw e;
                if (Core.Loader.ItemsRemainingToLoad == 0) break;
            }

            System.Windows.Media.CompositionTarget.Rendering += render;
        }