コード例 #1
0
        public static void StopBackgroundMode()
        {
            BackgroundTypes mode = (BackgroundTypes)(int)NSUserDefaults.StandardUserDefaults.IntForKey(UserDefaultsKeys.BackgroundModeType);

            switch (mode)
            {
            case BackgroundTypes.Microphone:
                if (audioRecorder != null && audioRecorder.Recording)
                {
                    audioRecorder.Stop();
                }

                if (File.Exists(Manager.AudioFile))
                {
                    File.Delete(Manager.AudioFile);
                }
                break;

            case BackgroundTypes.Music:
                if (audioObserver != null)
                {
                    NSNotificationCenter.DefaultCenter.RemoveObserver(audioObserver);
                    audioObserver = null;
                    audioPlayer.Stop();
                }
                break;
            }
            backgroundRunning = false;
        }
コード例 #2
0
ファイル: ChartBackground.cs プロジェクト: webgrid/WebGrid
 /// <summary>
 /// Creates a Shade background
 /// </summary>
 /// <param name="topRight">Shade alignment.</param>
 /// <param name="topLeft">Shade alignment.</param>
 /// <param name="bottomRight">Shade alignment.</param>
 /// <param name="bottomLeft">Shade alignment.</param>
 public ChartBackground(Color topRight, Color topLeft, Color bottomRight, Color bottomLeft)
 {
     BackgroundColorShade = new Color[4];
     BackgroundColorShade[0] = topRight;
     BackgroundColorShade[1] = topLeft;
     BackgroundColorShade[2] = bottomRight;
     BackgroundColorShade[3] = bottomLeft;
     BackgroundType = BackgroundTypes.BackgroundColorShade;
 }
コード例 #3
0
 /// <summary>
 /// Creates a Shade background
 /// </summary>
 /// <param name="topRight">Shade alignment.</param>
 /// <param name="topLeft">Shade alignment.</param>
 /// <param name="bottomRight">Shade alignment.</param>
 /// <param name="bottomLeft">Shade alignment.</param>
 public ChartBackground(Color topRight, Color topLeft, Color bottomRight, Color bottomLeft)
 {
     BackgroundColorShade    = new Color[4];
     BackgroundColorShade[0] = topRight;
     BackgroundColorShade[1] = topLeft;
     BackgroundColorShade[2] = bottomRight;
     BackgroundColorShade[3] = bottomLeft;
     BackgroundType          = BackgroundTypes.BackgroundColorShade;
 }
コード例 #4
0
 public MapleBackground(int i, MapleAnimation ani, Vector2 loc, int type, bool isBack = false)
 {
     Width = ani.Frames[0].Canvas.Texture.Width;
     Height = ani.Frames[0].Canvas.Texture.Height;
     Index = i;
     Type = (BackgroundTypes)Enum.ToObject(typeof(BackgroundTypes), type);
     IsBack = isBack;
     Animation = ani;
     Location = loc;
 }
コード例 #5
0
        public static String GetBackgroundTypeTitle(BackgroundTypes type)
        {
            switch (type)
            {
            case BackgroundTypes.Music:
                return("Play empty music");

            case BackgroundTypes.Microphone:
                return("Record on microphone");

            default:
                return(null);
            }
        }
コード例 #6
0
        static void RunBackground()
        {
            BackgroundTypes mode = (BackgroundTypes)(int)NSUserDefaults.StandardUserDefaults.IntForKey(UserDefaultsKeys.BackgroundModeType);

            switch (mode)
            {
            case BackgroundTypes.Microphone:
                if (!audioRecorder.Recording)
                {
                    audioRecorder.Record();
                }
                backgroundRunning = true;
                break;

            case BackgroundTypes.Music:
                audioObserver = NSNotificationCenter.DefaultCenter.AddObserver(AVAudioSession.InterruptionNotification, InteruptedAudio, AVAudioSession.SharedInstance());
                PlayAudio();
                backgroundRunning = true;
                break;
            }
        }
コード例 #7
0
ファイル: Backgrounds.cs プロジェクト: VincentViet/FlappyBird
 public Backgrounds(BackgroundTypes type)
 {
     _type     = type;
     _sprite   = new Rectangle(0, 0, 480, 800);
     _position = new Vector2(240, 400);
 }
コード例 #8
0
 /// <summary>
 /// Uses an image at the given url as background and scales it to fit the generated graphics.
 /// </summary>
 /// <param name="backgroundImageUrl">URL to the image.</param>
 public ChartBackground(string backgroundImageUrl)
 {
     BackgroundImageUrl = backgroundImageUrl;
     BackgroundType     = BackgroundTypes.BackgroundImageUrl;
 }
コード例 #9
0
 /// <summary>
 /// Single color background.
 /// </summary>
 /// <param name="backgroundColor">The color.</param>
 public ChartBackground(Color backgroundColor)
 {
     BackgroundColor = backgroundColor;
     BackgroundType  = BackgroundTypes.BackgroundColor;
 }
コード例 #10
0
 public BackgroundObject(IFactory spriteFactory, Point positionInGame, BackgroundTypes type) : base(spriteFactory, positionInGame, new Vector2())
 {
     this.sprite = this.spriteFactory.CreateProduct(type);
 }
コード例 #11
0
 public void SetType(BackgroundTypes type)
 {
     _type = type;
 }
コード例 #12
0
ファイル: ChartBackground.cs プロジェクト: webgrid/WebGrid
 /// <summary>
 /// Uses an image at the given url as background and scales it to fit the generated graphics.
 /// </summary>
 /// <param name="backgroundImageUrl">URL to the image.</param>
 public ChartBackground(string backgroundImageUrl)
 {
     BackgroundImageUrl = backgroundImageUrl;
     BackgroundType = BackgroundTypes.BackgroundImageUrl;
 }
コード例 #13
0
ファイル: ChartBackground.cs プロジェクト: webgrid/WebGrid
 /// <summary>
 /// Single color background.
 /// </summary>
 /// <param name="backgroundColor">The color.</param>
 public ChartBackground(Color backgroundColor)
 {
     BackgroundColor = backgroundColor;
     BackgroundType = BackgroundTypes.BackgroundColor;
 }