private void FFmpegPathButtonClicked(PropertyPage props, int propertyIndex) { var dummy = ""; #if FAMISTUDIO_WINDOWS var ffmpegExeFilter = "FFmpeg Executable (ffmpeg.exe)|ffmpeg.exe"; #else var ffmpegExeFilter = "FFmpeg Executable (ffmpeg)|*.*"; #endif #if FAMISTUDIO_MACOS dialog.TemporarelyHide(); #endif string filename = PlatformUtils.ShowOpenFileDialog("Please select FFmpeg executable", ffmpegExeFilter, ref dummy, dialog); #if FAMISTUDIO_MACOS dialog.TemporarelyShow(); #endif if (filename != null) { props.SetPropertyValue(propertyIndex, filename); // Update settings right away. Settings.FFmpegExecutablePath = filename; Settings.Save(); } }
private void WavMp3_PropertyChanged(PropertyPage props, int propIdx, int rowIdx, int colIdx, object value) { if (propIdx == 1) { props.SetPropertyEnabled(3, (string)value != "WAV"); } else if (propIdx == 4) { props.SetPropertyEnabled(5, (string)value != "Duration"); props.SetPropertyEnabled(6, (string)value == "Duration"); } else if (propIdx == 7) { var separateChannels = (bool)value; props.SetPropertyEnabled(9, !separateChannels); if (separateChannels) { props.SetPropertyValue(9, false); } props.SetColumnEnabled(10, 2, props.GetPropertyValue <bool>(9)); } else if (propIdx == 9) { props.SetColumnEnabled(10, 2, (bool)value); } }
private void ProjectCleanup_PropertyChanged(PropertyPage props, int idx, object value) { // Applying processing implies deleting source data. if (idx == 5) { var applyProcessing = (bool)value; if (applyProcessing) { props.SetPropertyValue(4, true); } props.SetPropertyEnabled(4, !applyProcessing); } }
private void Properties_PropertyChanged(PropertyPage props, int idx, object value) { if (inPropertyChanged) { return; } inPropertyChanged = true; // Prevent recursion. if (idx == 1) { bool allEffects = (bool)value; foreach (var kv in propToEffect) { props.SetPropertyValue(kv.Key, allEffects); } } else if (propToEffect.ContainsKey(idx)) { bool allEffects = true; foreach (var kv in propToEffect) { if (!props.GetPropertyValue <bool>(kv.Key)) { allEffects = false; break; } } props.SetPropertyValue(1, allEffects); } inPropertyChanged = false; }
private void FFmpegPage_PropertyClicked(PropertyPage props, ClickType click, int propIdx, int rowIdx, int colIdx) { if (click == ClickType.Button) { if (propIdx == 1) { var ffmpegExeFilter = PlatformUtils.IsWindows ? "FFmpeg Executable (ffmpeg.exe)|ffmpeg.exe" : "FFmpeg Executable (ffmpeg)|*.*"; var dummy = ""; var filename = PlatformUtils.ShowOpenFileDialog("Please select FFmpeg executable", ffmpegExeFilter, ref dummy, dialog); if (filename != null) { props.SetPropertyValue(propIdx, filename); } } else if (propIdx == 2) { PlatformUtils.OpenUrl("https://famistudio.org/doc/ffmpeg/"); } } }