Esempio n. 1
0
 public JokeProvider(BaseScreen baseActivity)
 {
     _baseActivity = baseActivity;
     if (IsJokeDay)
         try
         {
             _soundPool = new SoundPool(5, Stream.Alarm, 0);
             InitSounds();
             _loaded = true;
         }
         catch
         {
         }
 }
Esempio n. 2
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);

            // TODO: use this.Content to load your game content here
            _font = Content.Load<SpriteFont>("spriteFont1");

            _soundPool = new SoundPool(5, Stream.Music, 0);

            AssetFileDescriptor assetFileDescriptor;

            assetFileDescriptor = Activity.ApplicationContext.Assets.OpenFd("Content/boom.wav");
            _soundBoom = _soundPool.Load(assetFileDescriptor, 1);

            assetFileDescriptor = Activity.ApplicationContext.Assets.OpenFd("Content/ouch.wav");
            _soundOuch = _soundPool.Load(assetFileDescriptor, 1);

            _btnBoom = new ButtonSprite();
            _btnBoom.Initialize(_font,
                Content.Load<Texture2D>("Graphics\\ButtonActive"),
                Content.Load<Texture2D>("Graphics\\ButtonInactive"));
            _btnBoom.Position = new Vector2(150, 200);
            _btnBoom.TextureScale = new Vector2(2f, 0.5f);
            _btnBoom.Text = "Boom";
            _btnBoom.TextOffset = new Vector2(40, 20);
            _buttons.Add(_btnBoom);

            _btnOuch = new ButtonSprite();
            _btnOuch.Initialize(_font,
                Content.Load<Texture2D>("Graphics\\ButtonActive"),
                Content.Load<Texture2D>("Graphics\\ButtonInactive"));
            _btnOuch.Position = new Vector2(600, 200);
            _btnOuch.TextureScale = new Vector2(2f, 0.5f);
            _btnOuch.Text = "Ouch";
            _btnOuch.TextOffset = new Vector2(40, 20);
            _buttons.Add(_btnOuch);

            _focusManager.SelectedButton = _btnBoom;
            _focusManager.Mappings[_btnBoom] = new FocusManager.ButtonMapping()
            {
                Right = _btnOuch
            };
            _focusManager.Mappings[_btnOuch] = new FocusManager.ButtonMapping()
            {
                Left = _btnBoom,
            };
        }
Esempio n. 3
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);

            // TODO: use this.Content to load your game content here
            font = Content.Load<SpriteFont>("spriteFont1");

            m_soundPool = new SoundPool(5, Stream.Music, 0);

            AssetFileDescriptor assetFileDescriptor;

            assetFileDescriptor = Activity.ApplicationContext.Assets.OpenFd("Content/ouch.wav");
            m_soundBoom = m_soundPool.Load(assetFileDescriptor, 1);

            assetFileDescriptor = Activity.ApplicationContext.Assets.OpenFd("Content/boom.wav");
            m_soundOuch = m_soundPool.Load(assetFileDescriptor, 1);
        }
Esempio n. 4
0
 /// <summary>
 ///     Load all sounds.
 /// </summary>
 private void loadSound()
 {
     Stream st = new Stream();
     sp = new SoundPool(1, st, 0);
     SoundPushButton = sp.Load(this, Resource.Raw.clickInMenu, 1);
 }
Esempio n. 5
0
 public AndroidAudio(Activity activity)
 {
     activity.SetVolumeControlStream(AudioManager.STREAM_MUSIC);
     this.assets = activity.GetAssets();
     this.soundPool = new SoundPool(20, AudioManager.STREAM_MUSIC, 0);
 }
Esempio n. 6
0
 public AndroidSound(SoundPool soundPool, int soundId)
 {
     this.soundId = soundId;
     this.soundPool = soundPool;
 }
Esempio n. 7
0
        /// <summary>
        ///     Loads all sound variables.
        /// </summary>
        private void loadSounds()
        {
            Stream st = new Stream();
            sp = new SoundPool(1, st, 100);
            sp2 = new SoundPool(1, st, 100);
            sp3 = new SoundPool(1, st, 100);
            _soundPushButton = sp.Load(this, Resource.Raw.buttonDown, 1);
            _singleRowOrColumn = sp2.Load(this, Resource.Raw.singleRowOrColumn, 1);
            _gameOver = sp3.Load(this, Resource.Raw.gameOver, 1);

        }
Esempio n. 8
0
 public AndroidSound(SoundPool sp, int id)
 {
     this.soundID = id;
     this.sp = sp;
 }
Esempio n. 9
0
 internal static void Setup()
 {
     pool = new Android.Media.SoundPool(32, (int)Android.Media.Stream.Music, 0);
 }
Esempio n. 10
0
 public AndroidAudio(Activity act)
 {
     act.VolumeControlStream = Stream.Music;
     this.assets = act.Assets;
     this.soundPool = new SoundPool (20, Stream.Music, 0);
 }