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; }
/// <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; }
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; }
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); } }
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; } }
public Backgrounds(BackgroundTypes type) { _type = type; _sprite = new Rectangle(0, 0, 480, 800); _position = new Vector2(240, 400); }
/// <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; }
/// <summary> /// Single color background. /// </summary> /// <param name="backgroundColor">The color.</param> public ChartBackground(Color backgroundColor) { BackgroundColor = backgroundColor; BackgroundType = BackgroundTypes.BackgroundColor; }
public BackgroundObject(IFactory spriteFactory, Point positionInGame, BackgroundTypes type) : base(spriteFactory, positionInGame, new Vector2()) { this.sprite = this.spriteFactory.CreateProduct(type); }
public void SetType(BackgroundTypes type) { _type = type; }