示例#1
0
        public mlvplay(String file) : this()
        {
            //
            if (io.isMLV(file) || io.isRAW(file))
            {
                //if (settings.debugLogEnabled) debugging._saveDebug("[drop] -- file " + file + " will be analyzed now.");
                importRaw = new raw();
                data importData = new data();
                importData.metaData          = new metadata();
                importData.fileData          = new filedata();
                importData.fileData.tempPath = winIO.Path.GetTempPath();

                importData.threadData           = new threaddata();
                importData.lensData             = new lensdata();
                importData.audioData            = new audiodata();
                importData.metaData.errorString = "";

                importRaw.data = importData;

                if (io.isMLV(file))
                {
                    //if (settings.debugLogEnabled) debugging._saveDebug("[drop] is MLV ");
                    importRaw.data.metaData.isMLV        = true;
                    importRaw.data.metaData.errorString += io.setFileinfoData(file, importRaw.data.fileData);
                    //if (settings.debugLogEnabled) debugging._saveDebug("[drop] FileinfoData set");
                    importRaw.data.metaData.errorString += io.createMLVBlockList(file, importRaw);
                    Blocks.mlvBlockList = Blocks.mlvBlockList.OrderBy(x => x.timestamp).ToList();
                    importRaw.data.metaData.errorString += io.getMLVAttributes(file, Blocks.mlvBlockList, importRaw);
                    //if (settings.debugLogEnabled) debugging._saveDebug("[drop] MLV Attributes and Blocklist created and sorted. Blocks: "+Blocks.mlvBlockList.Count);
                    importRaw.AUDFBlocks = null;
                    if (importRaw.data.audioData.hasAudio)
                    {
                        importRaw.AUDFBlocks = Blocks.mlvBlockList.Where(x => x.blockTag == "AUDF").ToList();
                        //if (settings.debugLogEnabled) debugging._saveDebug("[drop] hasAudio. AUDF-List created. Blocks: " + importRaw.AUDFBlocks.Count);
                    }
                    importRaw.VIDFBlocks = null;
                    importRaw.VIDFBlocks = Blocks.mlvBlockList.Where(x => x.blockTag == "VIDF").ToList();
                    //if (settings.debugLogEnabled) debugging._saveDebug("[drop] VIDF-List created. Blocks: " + importRaw.VIDFBlocks.Count);
                    importRaw.data.metaData.errorString += io.readVIDFBlockData(importRaw);
                    //if (settings.debugLogEnabled) debugging._saveDebug("[drop] VIDF-Blockdata read and created.");
                    // correct frameCount
                    importRaw.data.metaData.frames = importRaw.VIDFBlocks.Count;

                    importRaw.convert = true;
                }
                if (io.isRAW(file))
                {
                    //if (settings.debugLogEnabled) debugging._saveDebug("[drop] is RAW ");
                    importRaw.data.metaData.isMLV     = false;
                    importRaw.data.audioData.hasAudio = false;
                    importRaw.RAWBlocks = null;
                    io.setFileinfoData(file, importRaw.data.fileData);
                    //if (settings.debugLogEnabled) debugging._saveDebug("[drop] FileinfoData set");
                    io.getRAWAttributes(file, importRaw);
                    //if (settings.debugLogEnabled) debugging._saveDebug("[drop] RAW Attributes read and set.");
                    io.createRAWBlockList(file, importRaw);
                    //if (settings.debugLogEnabled) debugging._saveDebug("[drop] RAW Blocklist created and sorted. Blocks: " + importRaw.RAWBlocks.Count);

                    // then Framelist
                    importRaw.convert = true;
                }
                // save file-WB values.
                originalWB        = importRaw.data.metaData.whiteBalance;
                originalFractions = importRaw.data.metaData.RGBfraction;
                originalWBText    = "(filedata) " + originalWB + "°K | " + dng.WBpreset[importRaw.data.metaData.whiteBalanceMode];

                // save all Properties as String
                importRaw.data.metaData.propertiesString = importRaw.data.metaData.xResolution + "x" + importRaw.data.metaData.yResolution + "px || " + importRaw.data.lensData.isoValue + "ISO | " + importRaw.data.lensData.shutter + " | " + importRaw.data.metaData.fpsString + "fps";

                // set properties of the window
                this.Width       = importRaw.data.metaData.xResolution + 48;
                this.Height      = importRaw.data.metaData.yResolution + 48;
                _playback.Width  = importRaw.data.metaData.xResolution;
                _playback.Height = importRaw.data.metaData.yResolution;
                _playback.Source = null;
                this.Title       = "mlvplay " + importRaw.data.fileData.fileNameOnly;
                _wbLabel.Content = originalWBText;
                playbackTimer.Start();
            }
        }
示例#2
0
        public void previewBackground(raw r)
        {
            var frame = r.data.metaData.previewFrame;

            if (frame > -1)
            {
                var maxFrames    = r.data.metaData.frames;
                var progressPosX = r.data.metaData.xResolution / 2 * frame / maxFrames;
                // read picture and show
                r.data.threadData.frame = frame;

                //_preview.Source = im;
                this.Dispatcher.Invoke((Action)(() =>
                {
                    switch (playbackQuality % 5)
                    {
                    case 0:
                        _playback.Source = io.showPicture(r, quality.high_709);
                        output = "HQ 709";
                        break;

                    case 1:
                        _playback.Source = io.showPicture(r, quality.high_gamma2);
                        output = "HQ gamma 2.0";
                        break;

                    case 2:
                        _playback.Source = io.showPicture(r, quality.low_mullim);
                        output = "LQ mul/lim";
                        break;

                    case 3:
                        _playback.Source = io.showPicture(r, quality.low_grey);
                        output = "LQ grey";
                        break;

                    case 4:
                        _playback.Source = io.showPicture(r, quality.debug_RGGB);
                        output = "RGGB pattern";
                        break;

                    default:
                        break;
                    }
                    _playbackLabel.Content = r.data.metaData.propertiesString;
                    _fpsLabel.Content = String.Format("{0:0.00}", fps) + " fps | " + String.Format("{0:d5}", frame) + " of " + maxFrames;
                    _qualityLabel.Content = output;
                    _wbLabel.Content = originalWBText;
                    //_playbackProgressBar.Margin = new Thickness(progressPosX, 0, 0, 0);
                    _playback.InvalidateVisual();
                    _playbackLabel.InvalidateVisual();
                    _fpsLabel.InvalidateVisual();
                }));
            }

            if (frame % 30 == 0)
            {
                stopwatch.Stop();
                milliseconds = stopwatch.ElapsedMilliseconds;
                fps          = 30000 / (double)milliseconds;
                stopwatch.Reset();
            }
        }