コード例 #1
0
        //public readonly CollectionSettings CollectionSettings;
        //public readonly DiscussionSettings DiscussionSettings;

        public ReplaySettingsOverlay()
        {
            AlwaysPresent    = true;
            RelativeSizeAxes = Axes.Both;

            Child = new FillFlowContainer <ReplayGroup>
            {
                Anchor       = Anchor.TopRight,
                Origin       = Anchor.TopRight,
                AutoSizeAxes = Axes.Both,
                Direction    = FillDirection.Vertical,
                Spacing      = new Vector2(0, 20),
                Margin       = new MarginPadding {
                    Top = 100, Right = 10
                },
                Children = new[]
                {
                    //CollectionSettings = new CollectionSettings(),
                    //DiscussionSettings = new DiscussionSettings(),
                    PlaybackSettings = new PlaybackSettings(),
                }
            };

            State = Visibility.Visible;
        }
コード例 #2
0
            public void ShouldMapXmlToTargetWhenFileExists()
            {
                var expectedPlaybackSettings = new PlaybackSettings
                {
                    SpeedModifier = 1.0,
                    LeaveLightsOn = false
                };
                var expectedColorSettings = new ColorSettings
                {
                    PrimaryColor   = Color.Blue,
                    SecondaryColor = Color.Red,
                    StandbyColor   = Color.Red
                };

                var result = _objectMapper.ReadValue <RazerPoliceLights.Settings.Settings>(GetResourceFile("RazerPoliceLights.xml"));

                Assert.NotNull(result);
                Assert.Equal(expectedPlaybackSettings, result.PlaybackSettings);
                Assert.Equal(expectedColorSettings, result.ColorSettings);
                Assert.True(result.DeviceSettings.KeyboardSettings.IsEnabled);
                Assert.True(result.DeviceSettings.KeyboardSettings.IsScanEnabled);
                Assert.Equal(11, result.DeviceSettings.KeyboardSettings.Patterns.Count);
                Assert.True(result.DeviceSettings.MouseSettings.IsEnabled);
                Assert.True(result.DeviceSettings.MouseSettings.IsScanEnabled);
                Assert.Equal(6, result.DeviceSettings.MouseSettings.Patterns.Count);
                Assert.Equal(11, result.EffectPatterns[DeviceType.Keyboard].Count);
                Assert.Equal(6, result.EffectPatterns[DeviceType.Mouse].Count);
            }
コード例 #3
0
 protected override void CreateModel()
 {
     _GeneralSettings  = new GeneralSettings();
     _PrivacySettings  = new PrivacySettings();
     _PlaybackSettings = new PlaybackSettings();
     _SubtitleSettings = new SubtitleSettings();
     _FontSettings     = new FontSettings();
     _AppInformation   = new AppInformation();
 }
コード例 #4
0
ファイル: AudioPlayer.cs プロジェクト: Makzz90/VKClient_re
        protected override void OnPlayStateChanged(BackgroundAudioPlayer player, AudioTrack track, PlayState playState)
        {
            bool flag = true;

            try
            {
                switch (playState)
                {
                case PlayState.TrackReady:
                    if (player.PlayerState != PlayState.Playing)
                    {
                        flag = false;
                        AudioTrackHelper.PlayCurrentTrack(player, (Action <bool>)(res => this.NotifyComplete()), false);
                        break;
                    }
                    break;

                case PlayState.TrackEnded:
                    PlaybackSettings settings = PlaylistManager.ReadPlaybackSettings(false);
                    if (settings.Repeat)
                    {
                        player.Stop();
                        player.Position = TimeSpan.FromSeconds(0.0);
                        flag            = false;
                        AudioTrackHelper.PlayCurrentTrack(player, (Action <bool>)(res => this.NotifyComplete()), false);
                        break;
                    }
                    bool       startedNewCycle;
                    AudioTrack nextTrack = this.GetNextTrack(player, out startedNewCycle, settings);
                    if (nextTrack != null)
                    {
                        if (!startedNewCycle)
                        {
                            player.Track = nextTrack;
                            AudioTrackHelper.PlayCurrentTrack(player, (Action <bool>)(res => this.NotifyComplete()), false);
                            flag = false;
                            break;
                        }
                        this.NotifyComplete();
                        break;
                    }
                    break;
                }
                AudioTrackHelper.BroadcastTrackIfNeeded(player, null, null, false, false);
                if (!flag)
                {
                    return;
                }
                this.NotifyComplete();
            }
            catch
            {
                this.NotifyComplete();
            }
        }
コード例 #5
0
ファイル: Animation.cs プロジェクト: sahwar/Pixelaria
        // Override object.Equals
        public override bool Equals(object obj)
        {
            //
            // See the full list of guidelines at
            //   http://go.microsoft.com/fwlink/?LinkID=85237
            // and also the guidance for operator== at
            //   http://go.microsoft.com/fwlink/?LinkId=85238
            //

            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            if (ReferenceEquals(this, obj))
            {
                return(true);
            }

            Animation other = (Animation)obj;

            if (Name != other.Name || _frames == null || other._frames == null || _frames.Count != other._frames.Count || Width != other.Width || Height != other.Height ||
                !ExportSettings.Equals(other.ExportSettings) || !PlaybackSettings.Equals(other.PlaybackSettings) || ID != other.ID)
            {
                return(false);
            }

            // Check frame-by-frame for an innequality
            // Disable LINQ suggestion because it'd actually be considerably slower
            // ReSharper disable once LoopCanBeConvertedToQuery
            for (int i = 0; i < _frames.Count; i++)
            {
                if (!_frames[i].Equals(other._frames[i]))
                {
                    return(false);
                }
            }

            return(true);
        }
コード例 #6
0
ファイル: AudioPlayer.cs プロジェクト: Makzz90/VKClient_re
 private AudioTrack GetRequiredTrack(BackgroundAudioPlayer player, AudioPlayer.NextTrackType trackType, out bool startedNewCycle, PlaybackSettings settings = null)
 {
     return(AudioTrackHelper.GetNextTrack(player, trackType == AudioPlayer.NextTrackType.Next, out startedNewCycle, settings, false));
 }
コード例 #7
0
ファイル: AudioPlayer.cs プロジェクト: Makzz90/VKClient_re
 private AudioTrack GetPreviousTrack(BackgroundAudioPlayer player, out bool startedNewCycle, PlaybackSettings settings = null)
 {
     return(this.GetRequiredTrack(player, AudioPlayer.NextTrackType.Previous, out startedNewCycle, settings));
 }
コード例 #8
0
        public static AudioObj GetNextAudio(BackgroundAudioPlayer player, bool next, out bool startedNewCycle, PlaybackSettings settings = null, bool allowCache = false)
        {
            startedNewCycle = false;
            Playlist        playlist = PlaylistManager.LoadTracksFromIsolatedStorage(allowCache);
            List <AudioObj> tracks   = playlist.Tracks;

            if (tracks.Count == 1)
            {
                startedNewCycle = true;
            }
            if (settings == null)
            {
                settings = PlaylistManager.ReadPlaybackSettings(allowCache);
            }
            tracks.FirstOrDefault <AudioObj>();
            int        num1  = 0;
            AudioTrack track = player.Track;

            if (track != null)
            {
                AudioObj audioObj = tracks.FirstOrDefault <AudioObj>((Func <AudioObj, bool>)(t => t.UniqueId == track.GetTagId()));
                num1 = tracks.IndexOf(audioObj);
                if (settings.Shuffle)
                {
                    num1 = playlist.ShuffledIndexes.IndexOf(num1);
                }
            }
            int num2  = num1;
            int index = !next ? num2 - 1 : num2 + 1;

            if (index < 0)
            {
                startedNewCycle = true;
                index           = tracks.Count <AudioObj>() - 1;
            }
            if (index >= tracks.Count)
            {
                startedNewCycle = true;
                index           = 0;
            }
            if (tracks.Count <= 0 || index >= tracks.Count)
            {
                return(null);
            }
            if (settings.Shuffle)
            {
                index = playlist.ShuffledIndexes[index];
            }
            return(tracks[index]);
        }
コード例 #9
0
 public static AudioTrack GetNextTrack(BackgroundAudioPlayer player, bool next, out bool startedNewCycle, PlaybackSettings settings = null, bool allowCache = false)
 {
     startedNewCycle = false;
     return(AudioTrackHelper.CreateTrack(AudioTrackHelper.GetNextAudio(player, next, out startedNewCycle, settings, allowCache)));
 }
コード例 #10
0
 public static void BroadcastTrackIfNeeded(BackgroundAudioPlayer player, List <AudioObj> playlist = null, PlaybackSettings settings = null, bool allowCache = false, bool bypassChecks = false)
 {
     try
     {
         if (!bypassChecks && (player.PlayerState != Microsoft.Phone.BackgroundAudio.PlayState.Playing || (DateTime.Now - AudioTrackHelper._lastTimeBroadcastAttempt).TotalSeconds < 3.0))
         {
             return;
         }
         AudioTrackHelper._lastTimeBroadcastAttempt = DateTime.Now;
         if (settings == null)
         {
             settings = PlaylistManager.ReadPlaybackSettings(allowCache);
             if (!settings.Broadcast)
             {
                 return;
             }
         }
         AudioTrack track = player.Track;
         if (track == null || track.GetTagId() == null)
         {
             return;
         }
         AudioTrackHelper.EnsureAppGlobalStateInitialized();
         AudioService.Instance.StatusSet("", track.GetTagId(), (Action <BackendResult <long, ResultCode> >)(res => {}));
     }
     catch (Exception ex)
     {
         Logger.Instance.Error("Broadcast track failed", ex);
     }
 }
コード例 #11
0
        public void Play(string waveFile)
        {
            PlaybackSettings settings = _plugin.Settings.PlaybackSettings;

            CurrentPlayer?.Play(waveFile, settings.MasterVolume, settings.Device);
        }