Exemplo n.º 1
0
        void SyncStart(object sender, RoutedEventArgs e)
        {
            try { DeckA.Play(); }
            catch { }

            try { DeckB.Play(); }
            catch { }
        }
Exemplo n.º 2
0
        public MainViewModel()
        {
            _ofd = new OpenFileDialog
            {
                CheckFileExists = true,
                CheckPathExists = true,
                Filter          = "Audio Files|*.mp3;*.wav;*.wma;*.aac;*.m4a",
                Title           = "Select Audio File",
                ValidateNames   = true,
                Multiselect     = true
            };

            OpenCommand = new DelegateCommand(() =>
            {
                if (!_ofd.ShowDialog().Value)
                {
                    return;
                }

                foreach (var fileName in _ofd.FileNames)
                {
                    PlaylistItems.Add(new PlaylistLabel(fileName));
                }
            });

            SyncStartCommand = new DelegateCommand(() =>
            {
                try { DeckA.Play(); }
                catch { }

                try { DeckB.Play(); }
                catch { }
            });

            DeleteCommand = new DelegateCommand <IList>(list =>
            {
                var items = new PlaylistLabel[list.Count];

                list.CopyTo(items, 0);

                foreach (var item in items)
                {
                    PlaylistItems.Remove(item);
                }
            });

            AutoCrossfadeCommand = new DelegateCommand <string>(Param =>
            {
                _autoCrossfadeTarget = double.Parse(Param.ToString());

                _autoCrossfadeDelta = (_autoCrossfadeTarget - Crossfade) / 200;

                StartAutoCrossfade();
            });
        }
Exemplo n.º 3
0
        public AvaliaProbabilidadeMao(IList <Carta> mao, IList <Carta> maoSecundaria, IList <Carta> mesa, uint numeroRodadas = 100000)
        {
            Deck = new DeckA();
            Deck.CriaDeckAvaliacao();

            MaoPrincipal  = new CartaA[LIMITE_MAO_P];
            MaoSecundaria = new CartaA[LIMITE_MAO_S];
            Mesa          = new CartaA[LIMITE_MESA];

            ToCartaA(mao, MaoPrincipal);
            ToCartaA(maoSecundaria, MaoSecundaria);
            ToCartaA(mesa, Mesa);

            NumCartasMao    = mao?.Count(p => p != null) ?? 0;
            NumCartasMaoSec = maoSecundaria?.Count(p => p != null) ?? 0;
            NumCartasMesa   = mesa?.Count(p => p != null) ?? 0;

            NumeroRodadas = numeroRodadas;
        }