Example #1
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 #2
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.
        }