当前位置: 首页>>代码示例>>C#>>正文


C# IMedia类代码示例

本文整理汇总了C#中IMedia的典型用法代码示例。如果您正苦于以下问题:C# IMedia类的具体用法?C# IMedia怎么用?C# IMedia使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IMedia类属于命名空间,在下文中一共展示了IMedia类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Play

        public void Play(string filename)
        {
            if (InvokeRequired)
                Invoke(new PlayDelegate(Play), filename);
            else
            {
                _needsSize = _filename != filename;
                _filename = filename;
                _mMedia = _mFactory.CreateMedia<IMedia>(filename);
                _mMedia.Events.DurationChanged += EventsDurationChanged;
                _mMedia.Events.StateChanged += EventsStateChanged;
                _mMedia.Events.ParsedChanged += Events_ParsedChanged;
                _mPlayer.Open(_mMedia);
                _mMedia.Parse(true);

                _mPlayer.Play();

                string[] parts = filename.Split('\\');
                string fn = parts[parts.Length - 1];
                FilesFile ff =
                    ((MainForm) Owner).GetCameraWindow(ObjectID).FileList.FirstOrDefault(p => p.Filename.EndsWith(fn));
                if (ff!=null)
                    vNav.Render(ff);
            }
        }
开发者ID:vmail,项目名称:main,代码行数:25,代码来源:PlayerForm.cs

示例2: ImportInfo

        public ImportInfo(IMedia media, IEntity entity)
        {
            if (media == null)
                throw new ArgumentNullException("media");

            this.media = media;
            this.entity = entity;
        }
开发者ID:bossaia,项目名称:alexandrialibrary,代码行数:8,代码来源:ImportInfo.cs

示例3: UploadToAzure

 public void UploadToAzure(IMedia mediaItem)
 {
     if(!IsValidMediaItem(mediaItem))
         return;
     
     var files = GetMediaFilePaths(mediaItem);
     files.ForEach(UploadToAzure);
 }
开发者ID:franhoey,项目名称:Umbraco.AzureMediaFtpSync,代码行数:8,代码来源:Uploader.cs

示例4: CloneWithoutMediaInfo

 public IMedia CloneWithoutMediaInfo(IMedia source)
 {
     return new Media
     {
         Name = source.Name,
         Data = source.Data
     };
 }
开发者ID:Murtaza-libs,项目名称:tweetinvi,代码行数:8,代码来源:Media.cs

示例5: Organise

        public void Organise(IMedia media, DirectoryInfoBase outputDirectory, OrganiserConversionOptions conversionOption, bool strictSeason)
        {
            // Create working directory.
            WorkingDirectory = _fileSystem.DirectoryInfo.FromDirectoryName(_fileSystem.Path.Combine(_fileSystem.Path.GetTempPath(), "WorkingArea"));

            // Create working directory if it does not exist.
            if(!WorkingDirectory.Exists)
            {
                WorkingDirectory.Create();
            }

            // Copy to working area.
            CopyMediaToWorkingArea(media);

            // Convert if required.
            if(conversionOption == OrganiserConversionOptions.Force)
            {
                Logger.Log("Organiser").StdOut.WriteLine("Conversion set to \"force\". Will convert. {0}", media.MediaFile.FullName);
                ConvertMedia(media);
            }
            else if(media.RequiresConversion)
            {
                if(conversionOption == OrganiserConversionOptions.Skip)
                {
                    Logger.Log("Organiser").StdOut.WriteLine("Media requires conversion. Conversion set to \"skip\", skipping conversion. {0}", media.MediaFile.FullName);
                }
                else
                {
                    Logger.Log("Organiser").StdOut.WriteLine("Media requires conversion. Will convert. {0}", media.MediaFile.FullName);
                    ConvertMedia(media);
                }
            }

            // Extract media details exhaustivly.
            ExtractExhaustiveMediaDetails(media, strictSeason);

            // Save media meta data.
            var saveResponse = SaveMediaMetaData(media);
            if(!saveResponse)
            {
                if(conversionOption == OrganiserConversionOptions.Skip)
                {
                    Logger.Log("Organiser").StdOut.WriteLine("Unable to save metadata. Conversion set to \"skip\", skipping conversion. {0}", media.MediaFile.FullName);
                }
                else
                {
                    Logger.Log("Organiser").StdOut.WriteLine("Unable to save metadata. Will convert. {0}", media.MediaFile.FullName);
                    ConvertMedia(media);
                    SaveMediaMetaData(media);
                }
            }

            // Rename media.
            RenameMediaToCleanFileName(media);

            // If output directory not provided, delete file. Otherwise move to output directory.
            MoveMediaToOutputDirectory(media, outputDirectory);
        }
开发者ID:dipeshc,项目名称:MediaOrganiser,代码行数:58,代码来源:Organiser.cs

示例6: Prepare

        //Creates directories
        public virtual void Prepare(IMedia stream)
        {
            if (!System.IO.Directory.Exists(BaseDirectory + '/' + stream.Id))
            {
                System.IO.Directory.CreateDirectory(BaseDirectory + '/' + stream.Id);
            }

            //Create Toc file?
        }
开发者ID:qinpengit,项目名称:net7mma-111212,代码行数:10,代码来源:RtspStreamArchiver.cs

示例7: BreakDownTest

 public override ElectricStatus BreakDownTest(IMedia media, ElectricStatus elecStatus, WireStatus status, double voltage, out double current)
 {
     if (media.GetId() == _id)
     {
         switch (elecStatus)
         {
             case ElectricStatus.Resistence:
                 current = Defines.Clamp(voltage, 1e4);
                 return elecStatus;
             default:
                 break;
         }
     }
     else if (media.GetId() == MediaId.M_AIR)
     {
         voltage *= 0.01;
         switch (elecStatus)
         {
             case ElectricStatus.Resistence:
                 current = Defines.Clamp(voltage, 0.01);
                 if (Math.Abs(voltage) > 200)
                 {
                     return ElectricStatus.Ionization;
                 }
                 else
                 {
                     return elecStatus;
                 }
             case ElectricStatus.Ionization:
                 if (Math.Abs(voltage) > 500)
                 {
                     current = Defines.Clamp(voltage, 1e6);
                     return ElectricStatus.Conduction;
                 }
                 if (Math.Abs(voltage) > 200)
                 {
                     current = Defines.Clamp(voltage, 1e4);
                     return ElectricStatus.Ionization;
                 }
                 break;
             case ElectricStatus.Conduction:
                 if (Math.Abs(voltage) > 60)
                 {
                     current = Defines.Clamp(voltage, 1e6);
                     return ElectricStatus.Conduction;
                 }
                 else
                 {
                     current = Defines.Clamp(voltage, 1e6);
                     return ElectricStatus.Ionization;
                 }
             default:
                 break;
         }
     }
     return base.BreakDownTest(media, elecStatus, status, voltage, out current);
 }
开发者ID:bajdcc,项目名称:SimuCircult,代码行数:57,代码来源:GroundMedia.cs

示例8: SaveMediaFile

        public static bool SaveMediaFile(string path, IMedia media, XElement element)
        {
            LogHelper.Debug<FileHelper>("SaveMedia File {0} {1}", () => path, () => media.Name);

            string filename = string.Format("{0}.media", CleanFileName(media.Name));
            string fullpath = Path.Combine(string.Format("{0}{1}", _mappedMediaRoot, path), filename);

            return SaveContentBaseFile(fullpath, element); 

        }
开发者ID:pbevis,项目名称:jumoo.usync,代码行数:10,代码来源:FileHelper.cs

示例9: SetInfo

        public void SetInfo(IMedia media)
        {
            int value;

            media.Path = _path;
            media.Filename = _mediaInfo.Get(0, 0, "FileName");
            media.Title = media.Filename;
            media.FileSize = (Int32.TryParse(_mediaInfo.Get(0, 0, "FileSize"), out value)) ? value : 0;
            media.Extension = _mediaInfo.Get(0, 0, "FileExtension");
        }
开发者ID:Pamilator,项目名称:mywindowmediaplayer-epitech2013,代码行数:10,代码来源:InfoMedia.cs

示例10: afficheDetails

        /// <summary>
        ///     Affichage du détail d'un média
        /// </summary>
        /// <param name="media"></param>
        /// <param name="format"></param>
        /// <returns></returns>
        protected string afficheDetails(IMedia media, IFormatProvider format)
        {
            AbstractMediaDetailDisplay mycontrol = null;
            TextWriter txt = new StringWriter();
            HtmlTextWriter html = new HtmlTextWriter(txt);

            mycontrol = LoadControl(string.Format("~/Controls/Display/{0}WUC.ascx", media.GetType().Name)) as AbstractMediaDetailDisplay;
            mycontrol.afficheMedia(media);

            mycontrol.RenderControl(html);
            return txt.ToString();
        }
开发者ID:zorky,项目名称:mymedias,代码行数:18,代码来源:ListeMediaWUC.ascx.cs

示例11: Export

        public void Export(string path, IMedia item, IMediaService _mediaService)
        {
            LogHelper.Info<MediaExporter>("Exporting {0}", () => FileHelper.CleanFileName(item.Name));
            SaveMedia(item, path);

            path = String.Format("{0}\\{1}", path, FileHelper.CleanFileName(item.Name));
            foreach (var childItem in _mediaService.GetChildren(item.Id))
            {
                Export(path, childItem, _mediaService);
            }


        }
开发者ID:KevinJump,项目名称:jumoo.usync,代码行数:13,代码来源:MediaExporter.cs

示例12: CheckForRefresh

        bool CheckForRefresh(IMedia sender, CancellableEventArgs e)
        {
            // As of Umbraco 6.2.4 if you try to access e.Cancel for an event that isn't cancellable you'll get an exception
            if (sender.Name.Equals(PPC_2010.Data.Constants.RefreshIndicatorTitle, StringComparison.CurrentCultureIgnoreCase))
            {
                ServiceLocator.Instance.Locate<ISermonRepository>().RefreshSermons();
                if (e.CanCancel)
                    e.Cancel = true;
                return true;
            }

            return false;
        }
开发者ID:shferguson,项目名称:ppc2010,代码行数:13,代码来源:SermonEvents.cs

示例13: Stop

        //Stop recoding a stream
        public virtual void Stop(IMedia stream)
        {
            if (stream is RtpSource)
            {
                RtpTools.RtpDump.Program program;
                if (!Attached.TryGetValue(stream, out program)) return;

                program.Dispose();
                Attached.Remove(stream);

                (stream as RtpSource).RtpClient.RtpPacketReceieved -= RtpClientPacketReceieved;
                (stream as RtpSource).RtpClient.RtcpPacketReceieved -= RtpClientPacketReceieved;
            }
        }
开发者ID:qinpengit,项目名称:net7mma-111212,代码行数:15,代码来源:RtspStreamArchiver.cs

示例14: button1_Click

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog ofd = new OpenFileDialog();
            if (ofd.ShowDialog() == true)
            {
                textBlock1.Text = ofd.FileName;
                m_media = m_factory.CreateMedia<IMediaFromFile>(ofd.FileName);
                m_media.Events.DurationChanged += new EventHandler<MediaDurationChange>(Events_DurationChanged);
                m_media.Events.StateChanged += new EventHandler<MediaStateChange>(Events_StateChanged);

                m_player.Open(m_media);
                m_media.Parse(true);
            }
        }
开发者ID:GoshaDE,项目名称:nVLC,代码行数:14,代码来源:MainWindow.xaml.cs

示例15: GenerateMultipartElement

        private IMultipartElement GenerateMultipartElement(IMedia media, string contentId, IMultipartRequestConfiguration configuration)
        {
            var additionalParameters = new Dictionary<string, string>();

            var element = new MultipartElement
            {
                Boundary = configuration.Boundary,
                ContentId = contentId,
                ContentDispositionType = "form-data",
                ContentType = "application/octet-stream",
                AdditionalParameters = additionalParameters,
                Data = configuration.EncodingAlgorithm.GetString(media.Data, 0, media.Data.Length),
            };

            return element;
        }
开发者ID:Murtaza-libs,项目名称:tweetinvi,代码行数:16,代码来源:TwitterRequestGenerator.cs


注:本文中的IMedia类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。