コード例 #1
0
ファイル: JokeProvider.cs プロジェクト: Fedorm/core-master
 public JokeProvider(BaseScreen baseActivity)
 {
     _baseActivity = baseActivity;
     if (IsJokeDay)
         try
         {
             _soundPool = new SoundPool(5, Stream.Alarm, 0);
             InitSounds();
             _loaded = true;
         }
         catch
         {
         }
 }
コード例 #2
0
ファイル: Game1.cs プロジェクト: thoniorf/ouya-sdk-examples
        /// <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,
            };
        }
コード例 #3
0
ファイル: Game1.cs プロジェクト: raptorx81/ouya-sdk-examples
        /// <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);
        }
コード例 #4
0
ファイル: TopScore.cs プロジェクト: iDesireJustice/Leonardo
 /// <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);
 }
コード例 #5
0
 public AndroidAudio(Activity activity)
 {
     activity.SetVolumeControlStream(AudioManager.STREAM_MUSIC);
     this.assets = activity.GetAssets();
     this.soundPool = new SoundPool(20, AudioManager.STREAM_MUSIC, 0);
 }
コード例 #6
0
 public AndroidSound(SoundPool soundPool, int soundId)
 {
     this.soundId = soundId;
     this.soundPool = soundPool;
 }
コード例 #7
0
ファイル: Game.cs プロジェクト: iDesireJustice/Leonardo
        /// <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);

        }
コード例 #8
0
ファイル: AndroidSound.cs プロジェクト: Paludan/BeerRun
 public AndroidSound(SoundPool sp, int id)
 {
     this.soundID = id;
     this.sp = sp;
 }
コード例 #9
0
ファイル: SoundEffect.cs プロジェクト: jlyonsmith/ExEnCopy
 internal static void Setup()
 {
     pool = new Android.Media.SoundPool(32, (int)Android.Media.Stream.Music, 0);
 }
コード例 #10
0
ファイル: AndroidAudio.cs プロジェクト: Paludan/BeerRun
 public AndroidAudio(Activity act)
 {
     act.VolumeControlStream = Stream.Music;
     this.assets = act.Assets;
     this.soundPool = new SoundPool (20, Stream.Music, 0);
 }