Ejemplo n.º 1
0
        private void DButtonFurther_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            // r
            int c_id = cur_list_sound.FindString(soundEngine.file_) + 1;


            soundEngine.Sound(cur_list_sound.GetStrID(c_id));
            Time.Content             = soundEngine.TimeToString();
            DTimeSliderPanel.Maximum = soundEngine.GetTotalTimeMs;
            ButtonPlayPause.SetIconPause();
            if (soundEngine.IS_PLAY == true)
            {
                soundEngine.HardPlay();
                ButtonPlayPause.SetIconPlay();
            }
            CurnameSound.Content = soundEngine.Name;
            ButtonPlayPause.SetIconPause();
        }
Ejemplo n.º 2
0
        private void Window_Drop(object sender, DragEventArgs e)
        {
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
                foreach (string item in files)
                {
                    if (!item.isFormats(StaticFormatsSound.FormatsSound))
                    {
                        continue;
                    }
                    SoundEngine se = new SoundEngine();
                    se.Sound(item);

                    DPanelSound dPanelSound = new DPanelSound()
                    {
                        NameSound = se.Name,
                        Path      = item,
                        TotalTime = se.TotalTime(),
                        INDEX     = StakPanelListSound.Children.Count
                    };

                    dPanelSound.EventMouseButtonHandler += (oo, ee) =>
                    {
                        SetCurSound(dPanelSound);
                    };
                    dPanelSound.REventMouseButtonHandler += (oo, ee) =>
                    {
                        StakPanelListSound.Children.RemoveAt(dPanelSound.INDEX);
                        cur_list_sound.RemoveID(dPanelSound.INDEX);
                    };
                    dPanelSound.Update();
                    StakPanelListSound.Children.Add(dPanelSound);
                    cur_list_sound.AddStr(item);
                }
                SystemIO.Write(SOUND_LIST_ALL.path, SOUND_LIST_ALL_serializer.Serialize(cur_list_sound));
            }
        }
Ejemplo n.º 3
0
        public void UpdateSoundList()
        {
            StakPanelListSound.Children.Clear();
            for (int i = 0; i < cur_list_sound.Count(); i++)
            {
                string item = cur_list_sound.GetStrID(i);
                if (!item.isFormats(StaticFormatsSound.FormatsSound))
                {
                    continue;
                }
                SoundEngine se = new SoundEngine();
                se.Sound(item);

                DPanelSound dPanelSound = new DPanelSound()
                {
                    NameSound = se.Name,
                    Path      = item,
                    TotalTime = se.TotalTime(),
                    INDEX     = StakPanelListSound.Children.Count
                };

                dPanelSound.EventMouseButtonHandler += (oo, ee) =>
                {
                    SetCurSound(dPanelSound);
                };
                dPanelSound.REventMouseButtonHandler += (oo, ee) =>
                {
                    cur_list_sound.RemoveSteing(dPanelSound.Path);

                    UpdateSoundList();
                    SystemIO.Write(SOUND_LIST_ALL.path, SOUND_LIST_ALL_serializer.Serialize(cur_list_sound));
                };
                dPanelSound.Update();
                StakPanelListSound.Children.Add(dPanelSound);
            }
        }