Copyto() public method

public Copyto ( MediaInfo mInfo, bool videoOnly ) : void
mInfo MediaInfo
videoOnly bool
return void
        public void FillFrom(MediaInfo sourceInfo)
        {
            if (sourceInfo != null)
            {
                sourceInfo.Copyto(_sourceMovieInfo,false);
            } else
            {
                SourceMovieInfo.Clear();
            }

            Fill();
        }
Example #2
0
        public void FillFrom(MediaInfo mInfo)
        {
            if (mInfo != null)
            {
                mInfo.Copyto(_movieInfo, false);
            }
            else
            {
                _movieInfo.ClearTracks();
            }

            Fill();
        }
        public void FillFrom(MediaInfo sourceInfo)
        {
            if (sourceInfo != null)
            {
                sourceInfo.Copyto(_sourceMovieInfo, false);
            }
            else
            {
                SourceMovieInfo.Clear();
            }

            Fill();
        }
Example #4
0
        public void FillFrom(MediaInfo mInfo)
        {
            if (mInfo != null)
            {
                mInfo.Copyto(_info, false);
            }
            else
            {
                _info.ClearTracks();
            }

            Fill();
            SelectFirstAudioTrack();
        }
Example #5
0
        public void FillFrom(MediaInfo mInfo)
        {
            if (mInfo != null)
            {
                mInfo.Copyto(_info,false);
            } else
                _info.ClearTracks();

            Fill();
        }
Example #6
0
    public void AddMediaInfo(string fName)
    {
        var sourceMovie = new MediaInfo();
        if (sourceMovie.OpenFromFile (fName))
        {
            var firstVideoTrack =  sourceMovie.FirstVideoTrack;

            if (sourceMovie.AudioTracks.Count > 0 || firstVideoTrack != null)
            {

                var targetMovie = new MediaInfo ();
                sourceMovie.Copyto (targetMovie, false);

                if (firstVideoTrack!=null)
                {
                    targetMovie.TargetContainer = ContainerEnum.avi;
                    targetMovie.TargetVideoCodec = VideoCodecEnum.xvid;
                }

                // leaving only first audio track
                while (targetMovie.AudioTracks.Count>1)
                {
                    TrackInfo lastAudioTrack =  null;
                    foreach (var track in targetMovie.Tracks)
                    {
                        if (track.TrackType == "Audio")
                        {
                            lastAudioTrack = track;
                        }
                    }
                    if (targetMovie.Tracks.Contains(lastAudioTrack))
                    {
                        targetMovie.Tracks.Remove(lastAudioTrack);
                    } else
                    {
                        break;
                    }
                }

                if (targetMovie.AudioTracks.Count>0)
                {
                    if (firstVideoTrack!=null)
                    {
                        targetMovie.FirstAudioTrack.TargetAudioCodec = AudioCodecEnum.copy;
                    } else
                    {
                        targetMovie.FirstAudioTrack.TargetAudioCodec = AudioCodecEnum.mp3;
                    }
                }

                MoviesInfo.Add (sourceMovie, targetMovie);

                FillTree ();
            }
        }
    }