public bool Execute()
        {
            if (OnOption.IsPresent)
            {
                TimelineView.Show();
            }

            if (OffOption.IsPresent)
            {
                TimelineView.Hide();
            }

            if (StartPlayback.IsPresent)
            {
                if (!TimelineView.Timeline.IsBusy)
                {
                    if (DoCommandWaitOnPlay)
                    {
                        DevCommandManager.Instance.StartWait();

                        TimelineView.PlayStopped += HandleTimelineViewPlayStopped;
                    }

                    TimelineView.Play();
                }
                else
                {
                    Debug.Log("Error:  Choreography already in progress");
                    return(false);
                }
            }

            // Currently this option would only work if you started choreography with the UI button (which works fine),
            // because if you start it with the dev command we set the 'wait gate' on dev commands (above)
            if (StopPlayback.IsPresent)
            {
                TimelineView.Stop();
            }

            if (InfoOption.IsPresent)
            {
                // NOTE: time does not accomodate for the eval
                var stepCount = TimelineView.Timeline.RecursiveStepCount;
                var duration  = TimelineView.Timeline.RecursiveDuration;
                var estimated = TimelineView.Timeline.RecursiveDurationIsEstimated;

                Debug.Log("Total steps: " + stepCount + "; total time: " + duration + " seconds; estimated:" + estimated);
            }

            return(true);
        }
示例#2
0
    public MainWindow()
        : base(Gtk.WindowType.Toplevel)
    {
        Build();

        Dump testDump = m_dumpLoader.Load(File.OpenRead("/home/oleavr/teststream.osd"));

        m_model = new EventTimelineModel(testDump);

        m_layout = new TimelineLayoutManager(m_model);
        m_layout.Update();

        EventNodeRenderer renderer = new EventNodeRenderer();

        m_timeline = new TimelineView(m_model, renderer);
        m_timeline.Show();
        scrolledwindow.AddWithViewport(m_timeline);

        m_dumpLoader.LoadCompleted       += dumpLoader_LoadCompleted;
        m_dumpLoader.LoadProgressChanged += dumpLoader_LoadProgressChanged;
    }