public IList <MediaStill> GetStills() { IList <MediaStill> list = new List <MediaStill>(); IBMDSwitcherMediaPool switcherMediaPool = (IBMDSwitcherMediaPool)this.switcher; IBMDSwitcherStills stills; switcherMediaPool.GetStills(out stills); uint count; stills.GetCount(out count); for (uint index = 0; index < count; index++) { MediaStill mediaStill = new MediaStill(stills, index); list.Add(mediaStill); } IntPtr mediaPlayerIteratorPtr; Guid mediaIteratorIID = typeof(IBMDSwitcherMediaPlayerIterator).GUID; this.switcher.CreateIterator(ref mediaIteratorIID, out mediaPlayerIteratorPtr); IBMDSwitcherMediaPlayerIterator mediaPlayerIterator = (IBMDSwitcherMediaPlayerIterator)Marshal.GetObjectForIUnknown(mediaPlayerIteratorPtr); IBMDSwitcherMediaPlayer mediaPlayer; mediaPlayerIterator.Next(out mediaPlayer); int num1 = 1; while (mediaPlayer != null) { _BMDSwitcherMediaPlayerSourceType type; uint index; mediaPlayer.GetSource(out type, out index); if (type == _BMDSwitcherMediaPlayerSourceType.bmdSwitcherMediaPlayerSourceTypeStill) { int num2 = (int)index + 1; foreach (MediaStill mediaStill in list) { if (mediaStill.Slot == num2) { mediaStill.MediaPlayer = num1; break; } } } num1++; mediaPlayerIterator.Next(out mediaPlayer); } return(list); }
public IList<MediaStill> GetStills() { IList<MediaStill> list = new List<MediaStill>(); IBMDSwitcherMediaPool switcherMediaPool = (IBMDSwitcherMediaPool)this.switcher; IBMDSwitcherStills stills; switcherMediaPool.GetStills(out stills); uint count; stills.GetCount(out count); for (uint index = 0; index < count; index++) { MediaStill mediaStill = new MediaStill(stills, index); list.Add(mediaStill); } IntPtr mediaPlayerIteratorPtr; Guid mediaIteratorIID = typeof(IBMDSwitcherMediaPlayerIterator).GUID; this.switcher.CreateIterator(ref mediaIteratorIID, out mediaPlayerIteratorPtr); IBMDSwitcherMediaPlayerIterator mediaPlayerIterator = (IBMDSwitcherMediaPlayerIterator)Marshal.GetObjectForIUnknown(mediaPlayerIteratorPtr); IBMDSwitcherMediaPlayer mediaPlayer; mediaPlayerIterator.Next(out mediaPlayer); int num1 = 1; while (mediaPlayer != null) { _BMDSwitcherMediaPlayerSourceType type; uint index; mediaPlayer.GetSource(out type, out index); if (type == _BMDSwitcherMediaPlayerSourceType.bmdSwitcherMediaPlayerSourceTypeStill) { int num2 = (int)index + 1; foreach (MediaStill mediaStill in list) { if (mediaStill.Slot == num2) { mediaStill.MediaPlayer = num1; break; } } } num1++; mediaPlayerIterator.Next(out mediaPlayer); } return list; }