예제 #1
0
        private void Import_Click(object sender, RoutedEventArgs e)
        {
            ProdjectClip item = new ProdjectClip();

            Microsoft.Win32.OpenFileDialog openFileDialog = new Microsoft.Win32.OpenFileDialog();
            openFileDialog.Filter = "All Files (*.*)|*.*|mpg (*.mpg*.vob) | *.mpg;*.vob|avi (*.avi) | *.avi|Divx (*.divx) | *.divx|wmv (*.wmv)| *.wmv|QuickTime (*.mov)| *.mov|MP4 (*.mp4) | *.mp4|AVCHD (*.m2ts*.ts*.mts*m2t)|*.m2ts;*.ts;*.mts;*.m2t|wav (*.wav)|*.wav|MP3 (*.mp3)|*.mp3|WMA (*.wma)|*.wma||";
            if (openFileDialog.ShowDialog() == true)
            {
                string strFile = openFileDialog.FileName;

                FileInfo F = new FileInfo(strFile);

                item.Path   = strFile;
                item.Name   = openFileDialog.SafeFileName;
                item.Format = strFile.Substring(strFile.LastIndexOf("."), strFile.Length - strFile.LastIndexOf("."));
                item.Size   = (F.Length / 1024).ToString();
            }
            Name.Binding   = new Binding("Name");
            Format.Binding = new Binding("Format");
            Size.Binding   = new Binding("Size");
            Path.Binding   = new Binding("Path");



            FileList.Items.Add(item);
        }
예제 #2
0
        private void FileList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            ProdjectClip row = (ProdjectClip)FileList.Items[FileList.SelectedIndex];

            switch (row.Format)
            {
            case ".mp4":
            case ".mpg":
            case ".avi":
            case ".mov":
            {
                axTimeLine.GetMediaInfo(row.Path, out iduration, out iwidth, out iheight, out framerate, out videobitrate, out iaudiobitrate, out iaudiochannel, out audiosamplerate, out ivideostreamcount, out iaudiostreamcouunt, out strmediacontainer, out strvideostreamformat, out straudiostreamformat);
                axTimeLine.SetVideoTrackResolution(iwidth, iheight);
                axTimeLine.AddVideoClip(1, row.Path, 0, axTimeLine.GetMediaDuration(row.Path), 0);
                axTimeLine.AddAudioClip(5, row.Path, 0, axTimeLine.GetMediaDuration(row.Path), 0, (float)1.0);

                break;
            }

            case ".png":
            case ".jpg":
            case ".jpeg":
            {
                axTimeLine.AddImageClip(4, row.Path, axTimeLine.GetMediaDuration(row.Path), 2);
                break;
            }

            case ".WAV":
            case ".mp3":
            {
                axTimeLine.AddAudioClip(5, row.Path, 0, axTimeLine.GetMediaDuration(row.Path), 0, (float)1.0);

                break;
            }
            }
        }