public Template()
        {
            InitializeComponent();

            //Remember the current dispatcher thread as the constructor is always called by the GUI thread
            m_Dispatcher = this.Dispatcher;

            //Create template with the template dataset parameters that this template uses and its default values.
            m_Template = new API.Template(new API.TemplateDataSet("Default template dataset", "",
                                                                  new API.TemplateDataSetItem(API.TemplateDataSetItemType.Text, StatsKeyNameKey1, "Key name of statistics property", "StatTest1")));

            //Register events

            //Loaded is emitted once when control is created and API is available.
            m_Template.TemplateLoaded += new API.LoadedEventHandler(Template_Loaded);

            //Playing is emitted when control is visible and template should show content.
            m_Template.TemplatePlaying += new API.PlayingEventHandler(Template_Playing);

            //TemplateDataSetChanged is emitted at any time when one or more parameters has changed value.
            //Handle parameter changes gracefully. Keep used parameters in explicit private variables and compare with new values to avoid unnecessary restart of content that is not affected.
            m_Template.TemplateDataSet.TemplateDataSetChanged += new API.TemplateDataSetEventHandler(TemplateDataSet_TemplateDataSetChanged);

            //Unload is emitted once when control will be disposed.
            m_Template.TemplateUnload += new API.UnloadEventHandler(Template_Unload);

            buttonBegin.Click += new RoutedEventHandler(buttonBegin_Click);
            buttonEnd.Click   += new RoutedEventHandler(buttonEnd_Click);

            //Do not do initialization here that is dependent on the context API. Do that when the template is loaded.
        }
Example #2
0
        public Template()
        {
            InitializeComponent();

            //Remember the current dispatcher thread as the constructor is always called by the GUI thread
            m_Dispatcher = this.Dispatcher;

            //Create template with the template dataset parameters that this template uses and its default values.
            m_Template = new API.Template(new API.TemplateDataSet("Default template dataset", "",
                    new API.TemplateDataSetItem(API.TemplateDataSetItemType.Text, PropertyKeyNameKey, "Key name of property", "Test1"),
                    new API.TemplateDataSetItem(API.TemplateDataSetItemType.Text, PropertySharedNameKey, "Shared name of property", "")));

            //Register events

            //Loaded is emitted once when control is created and API is available.
            m_Template.TemplateLoaded += new API.LoadedEventHandler(Template_Loaded);

            //Playing is emitted when control is visible and template should show content.
            m_Template.TemplatePlaying += new API.PlayingEventHandler(Template_Playing);

            //TemplateDataSetChanged is emitted at any time when one or more parameters has changed value.
            //Handle parameter changes gracefully. Keep used parameters in explicit private variables and compare with new values to avoid unnecessary restart of content that is not affected.
            m_Template.TemplateDataSet.TemplateDataSetChanged += new API.TemplateDataSetEventHandler(TemplateDataSet_TemplateDataSetChanged);

            //Unload is emitted once when control will be disposed.
            m_Template.TemplateUnload += new API.UnloadEventHandler(Template_Unload);

            buttonInc.Click += new RoutedEventHandler(buttonInc_Click);

            //Do not do initialization here that is dependent on the context API. Do that when the template is loaded.
        }
Example #3
0
        public NoGUITemplate()
        {
            //Define the default template parameters and their default vaules
            API.TemplateDataSet defaultTemplateDataSet = new API.TemplateDataSet("Default template dataset", "",
                                                                                 new API.TemplateDataSetItem(API.TemplateDataSetItemType.MediaFile, MediaFileKey, "Media file", ""));

            //Define the template capabilities
            API.TemplateCapabilities capabilities = new API.TemplateCapabilities()
            {
                TransitionMode = API.TransitionMode.NoTransition
            };

            //Create template with the template dataset parameters that this template uses and its default values.
            m_Template = new INSM.Template.Framework.v1.Template(defaultTemplateDataSet, capabilities);

            //Register events

            //Loaded is emitted once when control is created and API is available.
            m_Template.TemplateLoaded += new API.LoadedEventHandler(Template_Loaded);

            //Prepare is optionally emitted at any time to let template prepare its resources.
            m_Template.Prepare += new API.PrepareEventHandler(Template_Prepare);

            //Playing is emitted when control is visible and template should show content.
            m_Template.TemplatePlaying += new API.PlayingEventHandler(Template_Playing);

            //Paused is emitted when playback should stop. Control might still be visible.
            m_Template.TemplatePaused += new API.PausedEventHandler(Template_Paused);

            //Stopping is emitted when control will be hidden and template is expecting transition to stop showing content.
            m_Template.TemplateStopping += new API.StoppingEventHandler(Template_Stopping);

            //Stopped is emitted when control is hidden and template is expecting to stop showing content.
            m_Template.TemplateStopped += new API.StoppedEventHandler(Template_Stopped);

            //Release is optionally emitted to request the template to release additional resources.
            m_Template.Release += new API.ReleaseEventHandler(Template_Release);

            //PreviewRequested is emitted when preview content should be rendered in the control for a snapshot to be generated. Control will not be visible and playing.
            //m_Template.TemplatePreviewRequested += new API.PreviewRequestEventHandler(Template_PreviewRequested);

            //TemplateDataSetChanged is emitted at any time when one or more parameters has changed value.
            //Handle parameter changes gracefully. Keep used parameters in explicit private variables and compare with new values to avoid unnecessary restart of content that is not affected.
            m_Template.TemplateDataSet.TemplateDataSetChanged2 += new API.TemplateDataSetEventHandler2(TemplateDataSet_TemplateDataSetChanged);

            //Unload is emitted once when control will be disposed.
            m_Template.TemplateUnload += new API.UnloadEventHandler(Template_Unload);

            //New file is available
            m_Template.TemplateFileAdded += new API.TemplateFileEventHandler(Template_TemplateFileAdded);

            //File is no longer available
            m_Template.TemplateFileDeleted += new API.TemplateFileEventHandler(Template_TemplateFileDeleted);

            //Do not do more initialization here. Do that in Initialize() instead when the context API is available.
        }
Example #4
0
        public NoGUITemplate()
        {
            //Define the default template parameters and their default vaules
            API.TemplateDataSet defaultTemplateDataSet = new API.TemplateDataSet("Default template dataset", "",
                    new API.TemplateDataSetItem(API.TemplateDataSetItemType.MediaFile, MediaFileKey, "Media file", ""));

            //Define the template capabilities
            API.TemplateCapabilities capabilities = new API.TemplateCapabilities()
            {
                TransitionMode = API.TransitionMode.NoTransition
            };

            //Create template with the template dataset parameters that this template uses and its default values.
            m_Template = new INSM.Template.Framework.v1.Template(defaultTemplateDataSet, capabilities);

            //Register events

            //Loaded is emitted once when control is created and API is available.
            m_Template.TemplateLoaded += new API.LoadedEventHandler(Template_Loaded);

            //Prepare is optionally emitted at any time to let template prepare its resources.
            m_Template.Prepare += new API.PrepareEventHandler(Template_Prepare);

            //Playing is emitted when control is visible and template should show content.
            m_Template.TemplatePlaying += new API.PlayingEventHandler(Template_Playing);

            //Paused is emitted when playback should stop. Control might still be visible.
            m_Template.TemplatePaused += new API.PausedEventHandler(Template_Paused);

            //Stopping is emitted when control will be hidden and template is expecting transition to stop showing content.
            m_Template.TemplateStopping += new API.StoppingEventHandler(Template_Stopping);

            //Stopped is emitted when control is hidden and template is expecting to stop showing content.
            m_Template.TemplateStopped += new API.StoppedEventHandler(Template_Stopped);

            //Release is optionally emitted to request the template to release additional resources.
            m_Template.Release += new API.ReleaseEventHandler(Template_Release);

            //PreviewRequested is emitted when preview content should be rendered in the control for a snapshot to be generated. Control will not be visible and playing.
            //m_Template.TemplatePreviewRequested += new API.PreviewRequestEventHandler(Template_PreviewRequested);

            //TemplateDataSetChanged is emitted at any time when one or more parameters has changed value.
            //Handle parameter changes gracefully. Keep used parameters in explicit private variables and compare with new values to avoid unnecessary restart of content that is not affected.
            m_Template.TemplateDataSet.TemplateDataSetChanged2 += new API.TemplateDataSetEventHandler2(TemplateDataSet_TemplateDataSetChanged);

            //Unload is emitted once when control will be disposed.
            m_Template.TemplateUnload += new API.UnloadEventHandler(Template_Unload);

            //New file is available
            m_Template.TemplateFileAdded += new API.TemplateFileEventHandler(Template_TemplateFileAdded);

            //File is no longer available
            m_Template.TemplateFileDeleted += new API.TemplateFileEventHandler(Template_TemplateFileDeleted);

            //Do not do more initialization here. Do that in Initialize() instead when the context API is available.
        }
Example #5
0
        public RedTemplate()
        {
            InitializeComponent();

            m_Template = new INSM.Template.Framework.v1.Template(new INSM.Template.Framework.v1.TemplateDataSet());
        }
        public GreenTemplate()
        {
            InitializeComponent();

            m_Template = new INSM.Template.Framework.v1.Template(new INSM.Template.Framework.v1.TemplateDataSet());
        }