/// <summary> /// Start the provided media /// </summary> /// <param name="media"></param> private void StartMedia(Media media) { Trace.WriteLine(new LogMessage("Region - StartMedia", "Starting media"), LogType.Audit.ToString()); media.RenderMedia(); Controls.Add(media); }
/// <summary> /// Start the provided media /// </summary> /// <param name="media"></param> private void StartMedia(Media media) { Trace.WriteLine(new LogMessage("Region - StartMedia", "Starting media"), LogType.Audit.ToString()); media.RenderMedia(); Controls.Add(media); // Reset the audio sequence and start _audioSequence = 1; startAudio(); }
/// <summary> /// Start Audio if necessary /// </summary> private void startAudio() { // Start any associated audio if (_options.Audio.Count >= _audioSequence) { Media audio = _options.Audio[_audioSequence - 1]; // call render media and add to controls audio.RenderMedia(); Controls.Add(audio); } }
///<summary> /// Evaulates the change in options ///</summary> private void EvalOptions() { if (currentSequence == -1) { //evaluate the width, etc this.Location = new System.Drawing.Point(options.left, options.top); this.Size = new System.Drawing.Size(options.width, options.height); } int temp = currentSequence; //set the next media node for this panel if (!SetNextMediaNode()) { // For some reason we cannot set a media node... so we need this region to become invalid hasExpired = true; DurationElapsedEvent(); return; } // If the sequence hasnt been changed, OR the layout has been expired if (currentSequence == temp || layoutExpired) { //there has been no change to the sequence, therefore the media we have already created is still valid //or this media has actually been destroyed and we are working out way out the call stack return; } System.Diagnostics.Debug.WriteLine(String.Format("Creating new media: {0}, {1}", options.type, options.mediaid), "Region - EvalOptions"); try { switch (options.type) { case "image": options.uri = Properties.Settings.Default.LibraryPath + @"\" + options.uri; media = new ImagePosition(options); break; case "text": media = new Text(options); break; case "powerpoint": options.uri = Properties.Settings.Default.LibraryPath + @"\" + options.uri; media = new WebContent(options); break; case "video": options.uri = Properties.Settings.Default.LibraryPath + @"\" + options.uri; media = new Video(options); break; case "webpage": media = new WebContent(options); break; case "flash": options.uri = Properties.Settings.Default.LibraryPath + @"\" + options.uri; media = new Flash(options); break; case "ticker": media = new Rss(options); break; case "embedded": media = new Text(options); break; case "datasetview": media = new DataSetView(options); break; default: //do nothing SetNextMediaNode(); return; } //sets up the timer for this media media.Duration = options.duration; //add event handler media.DurationElapsedEvent += new Media.DurationElapsedDelegate(media_DurationElapsedEvent); //any additional media specific render options (and starts the timer) media.RenderMedia(); Controls.Add(media); } catch (Exception ex) { Trace.WriteLine(new LogMessage("EvalOptions", "Unable to start media. " + ex.Message), LogType.Error.ToString()); SetNextMediaNode(); } // This media has started and is being replaced _stat = new Stat(); _stat.type = StatType.Media; _stat.fromDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); _stat.scheduleID = options.scheduleId; _stat.layoutID = options.layoutId; _stat.mediaID = options.mediaid; System.Diagnostics.Debug.WriteLine("Showing new media", "Region - Eval Options"); }
/// <summary> /// Start the provided media /// </summary> /// <param name="media"></param> private void StartMedia(Media media) { media.RenderMedia(); Trace.WriteLine(new LogMessage("Region - StartMedia", "Starting media"), LogType.Audit.ToString()); Controls.Add(media); }