예제 #1
0
        private void SetVariables()
        {
            var deserializedObject = _configMgr.DeserializeConfig(_path);

            _outputPath = deserializedObject.OutputPath;
            _maxEntries = Convert.ToInt16(deserializedObject.MaxEntries);
        }
        // The CLI Commands to be Sent to FFMPEG
        public string FfmpegArguments(string trackInput, string titleInput)
        {


            ConfigMgr configMgrRead = new ConfigMgr();
            string tempPath = _workingDirectory + @"config.xml";


            var deseralizedObject = configMgrRead.DeserializeConfig(tempPath);

            var ColorScheme = deseralizedObject.ColorScheme;
            var Saturation = deseralizedObject.Saturation;
            var Gain = deseralizedObject.Gain;
            var WindowFunction = deseralizedObject.WindowFunction;
            var ChannelMode = deseralizedObject.ChannelMode;
            var Scale = deseralizedObject.Scale;
            var ShowLegend = (deseralizedObject.ShowLegend) ? "enabled" : "disabled";

            var arguments = (@"-i " + trackInput + " -lavfi showspectrumpic=s=" + _spectWidth + "x" + _spectHeight + ":"
                             + ChannelMode + ":legend=" + ShowLegend + ":saturation=" + Saturation +
                            ":color=" + ColorScheme + ":scale=" + Scale + ":win_func=" + WindowFunction +
                            ":gain=" + Gain + " " + @"""" + _imageDirectory + titleInput + _hash + @"""" + ".png");

            LogMessageToFile("FFMPEG Arguments: " + arguments);

            return arguments;
        }
예제 #3
0
        public void SetText()
        {
            var deserializedObject = configMgr.DeserializeConfig(_path);

            //MessageBox.Show("Retrieving settings.");

            outputPathBox.Text = deserializedObject.OutputPath;
            entriesBox.Text    = deserializedObject.MaxEntries;
        }
        // Check if Spectrogram legend and debugging mode are enabled.
        public void InitializeSettings()
        {

            ConfigMgr configMgrLeg = new ConfigMgr();
            string tempPath = mbApiInterface.Setting_GetPersistentStoragePath() + @"Dependencies\config.xml";
            var deserializedObject = configMgrLeg.DeserializeConfig(tempPath);
            _legend = deserializedObject.ShowLegend;
            _debugMode = deserializedObject.EnableDebugging;
            _fileDeletion = deserializedObject.ClearImages;
            _workingDirectory = mbApiInterface.Setting_GetPersistentStoragePath() + @"Dependencies\";
            _imageDirectory = mbApiInterface.Setting_GetPersistentStoragePath() + @"Dependencies\Spectrogram_Images\";
        }
예제 #5
0
        // Reads the pre-existing config.xml file and sets the text in each field based on that data.
        private void setDefaultText()
        {
            var deserializedObject = configMgr.DeserializeConfig(configPath());

            ILbox.SelectedItem   = deserializedObject.ILCP;
            ILTbox.SelectedItem  = deserializedObject.ILThresholdCP;
            DRbox.SelectedItem   = deserializedObject.LRACP;
            LRTbox.SelectedItem  = deserializedObject.LRThresholdCP;
            LRALbox.SelectedItem = deserializedObject.LRALowCP;
            LRAHbox.SelectedItem = deserializedObject.LRAHighCP;
            Pbox.SelectedItem    = deserializedObject.PeakCP;
            ALbox.SelectedItem   = deserializedObject.AverageCP;
            CLbox.SelectedItem   = deserializedObject.CurrentCP;
        }
예제 #6
0
        // Reads the pre-existing config.xml file and sets the text in each field based on that data.
        private void setDefaultText()
        {
            var deserializedObject = configMgr.DeserializeConfig(configPath());

            colorSchemeBox.Text      = deserializedObject.ColorScheme;
            saturationBox.Text       = deserializedObject.Saturation;
            gainBox.Text             = deserializedObject.Gain;
            windowFunctionBox.Text   = deserializedObject.WindowFunction;
            channelModeBox.Text      = deserializedObject.ChannelMode;
            scaleBox.Text            = deserializedObject.Scale;
            showFrequencyBox.Checked = deserializedObject.ShowLegend;
            clearImagesBox.Checked   = deserializedObject.ClearImages;
            debugModeBox.Checked     = deserializedObject.EnableDebugging;

            // Sets the default text for the Ffmpeg path box if one has been set.
            if (File.Exists(ffmpegPath()))
            {
                string path = File.ReadAllText(ffmpegPath());
                pathBox.Text = path;
            }

            if (File.Exists(seekbarPath()))
            {
                enableSeekbarBox.Checked = true;
            }
            else
            {
                enableSeekbarBox.Checked = false;
            }

            if (File.Exists(headerPath()))
            {
                disableHeaderBox.Checked = true;
            }
            else
            {
                disableHeaderBox.Checked = false;
            }
        }