Ejemplo n.º 1
0
 private void ChangeTier(bool down = true)
 {
     if (down)
     {
         for (int i = 0; i < annoTiers.Count; i++)
         {
             if (annoTiers[i] == AnnoTierStatic.Selected && i + 1 < annoTiers.Count)
             {
                 AnnoTierStatic.Select(annoTiers[i + 1]);
                 AnnoTierStatic.SelectLabel(null);
                 break;
             }
         }
     }
     else
     {
         for (int i = 0; i < annoTiers.Count; i++)
         {
             if (annoTiers[i] == AnnoTierStatic.Selected && i > 0)
             {
                 AnnoTierStatic.Select(annoTiers[i - 1]);
                 AnnoTier.SelectLabel(null);
                 break;
             }
         }
     }
 }
Ejemplo n.º 2
0
        private void CopyLabelToTier(bool down = true)
        {
            if (down)
            {
                if (AnnoTierStatic.Label != null)
                {
                    AnnoListItem temp = AnnoTierStatic.Label.Item;

                    for (int i = 0; i < annoTiers.Count; i++)
                    {
                        if (annoTiers[i] == AnnoTierStatic.Selected && i + 1 < annoTiers.Count)
                        {
                            AnnoTierStatic.Select(annoTiers[i + 1]);
                            if (AnnoTierStatic.Selected.IsDiscreteOrFree)
                            {
                                AnnoTier.SelectLabel(null);
                                if (!AnnoTierStatic.Selected.AnnoList.Contains(temp))
                                {
                                    AnnoTierStatic.Selected.NewAnnoCopy(temp.Start, temp.Stop, temp.Label, temp.Color);
                                    break;
                                }
                            }
                        }
                    }
                }
            }
            else
            {
                if (AnnoTierStatic.Label != null)
                {
                    AnnoListItem temp = AnnoTierStatic.Label.Item;

                    for (int i = 0; i < annoTiers.Count; i++)
                    {
                        if (annoTiers[i] == AnnoTierStatic.Selected && i > 0)
                        {
                            AnnoTierStatic.Select(annoTiers[i - 1]);
                            if (AnnoTierStatic.Selected.IsDiscreteOrFree)
                            {
                                AnnoTierStatic.SelectLabel(null);
                                if (!AnnoTierStatic.Selected.AnnoList.Contains(temp))
                                {
                                    AnnoTierStatic.Selected.NewAnnoCopy(temp.Start, temp.Stop, temp.Label, temp.Color);
                                    break;
                                }
                            }
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        private void annoList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            ListView grid = (ListView)sender;

            if (grid.SelectedIndex >= 0 && grid.SelectedIndex < grid.Items.Count)
            {
                AnnoListItem item = (AnnoListItem)grid.SelectedItem;
                control.annoListControl.editComboBox.SelectedItem = item.Label;
                double samplerate = MainHandler.getMaxVideoSampleRate();
                double offset     = (1.0f / samplerate);
                Time.CurrentPlayPosition = item.Start;


                mediaList.Move(item.Start + offset);
                moveSignalCursor(item.Start);

                if (item.Start >= timeline.SelectionStop)
                {
                    float factor = (float)(((item.Start - Time.SelectionStart) / (Time.SelectionStop - Time.SelectionStart)));
                    control.timeLineControl.rangeSlider.MoveAndUpdate(true, factor);
                }
                else if (item.Stop <= timeline.SelectionStart)
                {
                    float factor = (float)(((Time.SelectionStart - item.Start)) / (Time.SelectionStop - Time.SelectionStart));
                    control.timeLineControl.rangeSlider.MoveAndUpdate(false, factor);
                }

                foreach (AnnoListItem a in AnnoTierStatic.Selected.AnnoList)
                {
                    if (a.Start == item.Start && a.Stop == item.Stop && item.Label == a.Label)
                    {
                        AnnoTierStatic.SelectLabel(AnnoTierStatic.Selected.GetSegment(a));
                        control.annoListControl.editComboBox.SelectedItem = item.Label;
                        break;
                    }
                }

                if (item.isGeometric)
                {
                    int position = (int)(Time.CurrentPlayPosition * AnnoTierStatic.Selected.AnnoList.Scheme.SampleRate);
                    geometricSelectItem(item, position);
                }
            }
        }