private PropertyPage CreatePropertyPage(PropertyPage page, TransformOperation section) { switch (section) { case TransformOperation.SongCleanup: page.AddCheckBox("Merge identical patterns:", true); // 0 page.AddCheckBox("Delete empty patterns:", true); // 1 page.AddCheckBox("Adjust maximum note lengths:", true); // 2 page.AddCheckBoxList(null, GetSongNames(), null); // 3 break; case TransformOperation.ProjectCleanup: page.AddCheckBox("Delete unused instruments:", true); // 0 page.AddCheckBox("Merge identical instruments:", true); // 1 page.AddCheckBox("Unassign unused DPCM instrument keys:", true); // 2 page.AddCheckBox("Delete unassigned samples:", true); // 3 page.AddCheckBox("Permanently apply all DPCM samples processing:", false); // 4 page.AddCheckBox("Delete unused arpeggios:", true); // 5 page.PropertyChanged += ProjectCleanup_PropertyChanged; break; } page.Build(); pages[(int)section] = page; return(page); }
private PropertyPage CreatePropertyPage(PropertyPage page, TransformOperation section) { switch (section) { case TransformOperation.SongCleanup: page.AddCheckBox("Merge identical patterns:", true, MergePatternsTooltip); // 0 page.AddCheckBox("Delete empty patterns:", true, DeleteEmptyPatternsTooltip); // 1 page.AddCheckBox("Adjust maximum note lengths:", true, AdjustMaximumNoteLengthsTooltip); // 2 page.AddCheckBoxList(PlatformUtils.IsMobile ? "Songs to process:" : null, GetSongNames(), null, SongsTooltips); // 3 break; case TransformOperation.ProjectCleanup: page.AddCheckBox("Delete unused instruments:", true, DeleteUnusedInstrumentsTooltip); // 0 page.AddCheckBox("Merge identical instruments:", true, MergeIdenticalInstrumentsTooltip); // 1 page.AddCheckBox("Unassign unused DPCM instrument keys:", true, UnassignUnusedSamplesTooltip); // 2 page.AddCheckBox("Delete unassigned samples:", true, DeleteUnassignedSamplesTooltip); // 3 page.AddCheckBox("Permanently apply all DPCM samples processing:", false, PermanentlyApplyProcessingTooltip); // 4 page.AddCheckBox("Delete unused arpeggios:", true, DeleteUnusedArpeggiosTooltip); // 5 page.PropertyChanged += ProjectCleanup_PropertyChanged; break; } page.Build(); pages[(int)section] = page; return(page); }
private PropertyPage CreatePropertyPage(PropertyPage page, ExportFormat format) { var songNames = GetSongNames(); switch (format) { case ExportFormat.WavMp3: page.AddDropDownList("Song :", songNames, songNames[0]); // 0 page.AddDropDownList("Format :", AudioFormatType.Names, AudioFormatType.Names[0]); // 1 page.AddDropDownList("Sample Rate :", new[] { "11025", "22050", "44100", "48000" }, "44100"); // 2 page.AddDropDownList("Bit Rate :", new[] { "96", "112", "128", "160", "192", "224", "256" }, "128"); // 3 page.AddDropDownList("Mode :", new[] { "Loop N times", "Duration" }, "Loop N times"); // 4 page.AddNumericUpDown("Loop count:", 1, 1, 10); // 5 page.AddNumericUpDown("Duration (sec):", 120, 1, 1000); // 6 page.AddCheckBox("Separate channel files", false); // 7 page.AddCheckBox("Separate intro file", false); // 8 page.AddCheckBox("Stereo", false); // 9 if (PlatformUtils.IsDesktop) { page.AddMultiColumnList(new[] { new ColumnDesc("", 0.0f, ColumnType.CheckBox), new ColumnDesc("Channel", 0.4f), new ColumnDesc("Pan (% L/R)", 0.6f, ColumnType.Slider, "{0} %") }, GetDefaultChannelsGridData(), 200); // 10 } else { page.AddCheckBoxList("Channels", GetChannelNames(), GetDefaultActiveChannels()); // 10 } page.SetPropertyEnabled(3, false); page.SetPropertyEnabled(6, false); page.SetPropertyVisible(7, PlatformUtils.IsDesktop); // No separate files on mobile. page.SetPropertyVisible(8, PlatformUtils.IsDesktop); // No separate files on mobile. page.SetPropertyVisible(9, PlatformUtils.IsDesktop); // No stereo on mobile. page.SetColumnEnabled(10, 2, false); page.PropertyChanged += WavMp3_PropertyChanged; page.PropertyClicked += WavMp3_PropertyClicked; break; case ExportFormat.VideoPianoRoll: if (AddCommonVideoProperties(page, songNames)) // 0-5 { page.AddDropDownList("Piano Roll Zoom :", new[] { "12.5%", "25%", "50%", "100%", "200%", "400%", "800%" }, project.UsesFamiTrackerTempo ? "100%" : "25%", "Higher zoom values scrolls faster and shows less far ahead."); // 6 page.AddCheckBox("Stereo", false); // 7 if (PlatformUtils.IsDesktop) { page.AddMultiColumnList(new[] { new ColumnDesc("", 0.0f, ColumnType.CheckBox), new ColumnDesc("Channel", 0.4f), new ColumnDesc("Pan (% L/R)", 0.6f, ColumnType.Slider, "{0} %") }, GetDefaultChannelsGridData(), 200); // 8 } else { page.AddCheckBoxList("Channels", GetChannelNames(), GetDefaultActiveChannels()); // 8 } page.SetColumnEnabled(8, 2, false); page.SetPropertyVisible(7, PlatformUtils.IsDesktop); // Stereo on mobile. page.PropertyChanged += VideoPage_PropertyChanged; } break; case ExportFormat.VideoOscilloscope: if (AddCommonVideoProperties(page, songNames)) // 0-5 { page.AddNumericUpDown("Oscilloscope Columns :", 1, 1, 5); // 6 page.AddNumericUpDown("Oscilloscope Thickness :", 1, 1, 4); // 7 page.AddDropDownList("Oscilloscope Color :", OscilloscopeColorType.Names, OscilloscopeColorType.Names[OscilloscopeColorType.InstrumentsAndSamples]); // 8 page.AddCheckBox("Stereo", false); // 9 if (PlatformUtils.IsDesktop) { page.AddMultiColumnList(new[] { new ColumnDesc("", 0.0f, ColumnType.CheckBox), new ColumnDesc("Channel", 0.4f), new ColumnDesc("Pan (% L/R)", 0.6f, ColumnType.Slider, "{0} %") }, GetDefaultChannelsGridData(), 200); // 10 } else { page.AddCheckBoxList("Channels", GetChannelNames(), GetDefaultActiveChannels()); // 10 } page.SetColumnEnabled(10, 2, false); page.SetPropertyVisible(9, PlatformUtils.IsDesktop); // Stereo on mobile. page.PropertyChanged += VideoPage_PropertyChanged; } break; case ExportFormat.Nsf: page.AddTextBox("Name :", project.Name, 31); // 0 page.AddTextBox("Artist :", project.Author, 31); // 1 page.AddTextBox("Copyright :", project.Copyright, 31); // 2 page.AddDropDownList("Mode :", MachineType.Names, MachineType.Names[project.PalMode ? MachineType.PAL : MachineType.NTSC]); // 3 page.AddCheckBoxList(PlatformUtils.IsDesktop ? null : "Songs", songNames, null); // 4 #if DEBUG page.AddDropDownList("Engine :", FamiToneKernel.Names, FamiToneKernel.Names[FamiToneKernel.FamiStudio]); // 5 #endif page.SetPropertyEnabled(3, !project.UsesAnyExpansionAudio); break; case ExportFormat.Rom: page.AddDropDownList("Type :", new[] { "NES ROM", "FDS Disk" }, project.UsesFdsExpansion ? "FDS Disk" : "NES ROM"); // 0 page.AddTextBox("Name :", project.Name.Substring(0, Math.Min(28, project.Name.Length)), 28); // 1 page.AddTextBox("Artist :", project.Author.Substring(0, Math.Min(28, project.Author.Length)), 28); // 2 page.AddDropDownList("Mode :", new[] { "NTSC", "PAL" }, project.PalMode ? "PAL" : "NTSC"); // 3 page.AddCheckBoxList(PlatformUtils.IsDesktop ? null : "Songs", songNames, null); // 4 if (project.UsesAnyExpansionAudio) { page.AddLabel(PlatformUtils.IsDesktop ? null : "Note", "ROM export does not support audio expansions. FDS disk export only supports the FDS expansion. Any incompatible expansion channel(s) will be ignored during the export.", true); } page.SetPropertyEnabled(0, project.UsesFdsExpansion); page.SetPropertyEnabled(3, !project.UsesAnyExpansionAudio); break; case ExportFormat.Midi: page.AddDropDownList("Song :", songNames, songNames[0]); // 0 page.AddCheckBox("Export volume as velocity :", true); // 1 page.AddCheckBox("Export slide notes as pitch wheel :", true); // 2 page.AddNumericUpDown("Pitch wheel range :", 24, 1, 24); // 3 page.AddDropDownList("Instrument Mode :", MidiExportInstrumentMode.Names, MidiExportInstrumentMode.Names[0]); // 4 page.AddMultiColumnList(new[] { new ColumnDesc("", 0.4f), new ColumnDesc("", 0.6f, MidiFileReader.MidiInstrumentNames) }, null); // 5 page.PropertyChanged += Midi_PropertyChanged; break; case ExportFormat.Text: page.AddCheckBoxList(null, songNames, null); // 0 page.AddCheckBox("Delete unused data :", false); // 1 break; case ExportFormat.FamiTracker: if (!project.UsesMultipleExpansionAudios) { page.AddCheckBoxList(null, songNames, null); // 0 canExportToFamiTracker = true; } else { page.AddLabel(null, "The original FamiTracker does not support multiple audio expansions. Limit yourself to a single expansion to enable export.", true); canExportToFamiTracker = false; } break; case ExportFormat.FamiTone2Music: case ExportFormat.FamiStudioMusic: if (format == ExportFormat.FamiTone2Music && project.UsesAnyExpansionAudio) { page.AddLabel(null, "FamiTone2 does not support audio expansions.", true); canExportToSoundEngine = false; } else if (format == ExportFormat.FamiStudioMusic && project.UsesMultipleExpansionAudios) { page.AddLabel(null, "The FamiStudio Sound Engine only supports a single expansion at a time. Limit yourself to a single expansion to enable export.", true); canExportToSoundEngine = false; } else { page.AddDropDownList("Format :", AssemblyFormat.Names, AssemblyFormat.Names[0]); // 0 page.AddCheckBox("Separate Files :", false); // 1 page.AddTextBox("Song Name Pattern :", "{project}_{song}"); // 2 page.AddTextBox("DMC Name Pattern :", "{project}"); // 3 page.AddCheckBox("Generate song list include :", false); // 4 page.AddCheckBoxList(null, songNames, null); // 5 page.SetPropertyEnabled(2, false); page.SetPropertyEnabled(3, false); page.PropertyChanged += SoundEngine_PropertyChanged; canExportToSoundEngine = true; } break; case ExportFormat.FamiTone2Sfx: case ExportFormat.FamiStudioSfx: page.AddDropDownList("Format :", AssemblyFormat.Names, AssemblyFormat.Names[0]); // 0 page.AddDropDownList("Mode :", MachineType.Names, MachineType.Names[project.PalMode ? MachineType.PAL : MachineType.NTSC]); // 1 page.AddCheckBox("Generate SFX list include :", false); // 2 page.AddCheckBoxList(null, songNames, null); // 3 break; case ExportFormat.Share: page.AddRadioButtonList("Sharing mode", new[] { "Copy to Storage", "Share" }, 0, "Copy the FamiStudio project to your phone's storage, or share it to another application."); break; } page.Build(); return(page); }
private PropertyPage CreatePropertyPage(PropertyPage page, ExportFormat format) { var songNames = GetSongNames(); switch (format) { case ExportFormat.WavMp3: page.AddDropDownList("Song :", songNames, songNames[0]); // 0 page.AddDropDownList("Format :", new[] { "WAV", "MP3" }, "WAV"); // 1 page.AddDropDownList("Sample Rate :", new[] { "11025", "22050", "44100", "48000" }, "44100"); // 2 page.AddDropDownList("Bit Rate :", new[] { "96", "112", "128", "160", "192", "224", "256" }, "128"); // 3 page.AddDropDownList("Mode :", new[] { "Loop N times", "Duration" }, "Loop N times"); // 4 page.AddIntegerRange("Loop count:", 1, 1, 10); // 5 page.AddIntegerRange("Duration (sec):", 120, 1, 1000); // 6 page.AddCheckBox("Separate channel files", false); // 7 page.AddCheckBox("Separate intro file", false); // 8 page.AddCheckBoxList("Channels :", GetChannelNames(), GetDefaultSelectedChannels()); // 9 page.SetPropertyEnabled(3, false); page.SetPropertyEnabled(6, false); page.PropertyChanged += WavMp3_PropertyChanged; break; case ExportFormat.Video: page.AddButton("Path To FFmpeg:", Settings.FFmpegExecutablePath, FFmpegPathButtonClicked, "Path to FFmpeg executable. On Windows this is ffmpeg.exe. To download and install ffpmeg, check the link below."); // 0 #if FAMISTUDIO_MACOS // GTK LinkButtons dont work on MacOS, use a button (https://github.com/quodlibet/quodlibet/issues/2306) page.AddButton(" ", "Download FFmpeg here", FFmpegDownloadButtonClicked); // 1 #else page.AddLinkLabel(" ", "Download FFmpeg here", "https://famistudio.org/doc/ffmpeg/"); // 1 #endif page.AddDropDownList("Song :", songNames, songNames[0]); // 2 page.AddDropDownList("Resolution :", VideoResolution.Names, VideoResolution.Names[0]); // 3 page.AddDropDownList("Frame Rate :", new[] { "50/60 FPS", "25/30 FPS" }, "50/60 FPS"); // 4 page.AddDropDownList("Audio Bit Rate (Kb/s) :", new[] { "64", "96", "112", "128", "160", "192", "224", "256" }, "128"); // 5 page.AddDropDownList("Video Bit Rate (Kb/s):", new[] { "250", "500", "1000", "2000", "4000", "8000", "10000", "12000", "14000", "16000", "18000", "20000" }, "12000"); // 6 page.AddDropDownList("Piano Roll Zoom :", new[] { "12.5%", "25%", "50%", "100%", "200%", "400%", "800%" }, project.UsesFamiTrackerTempo ? "100%" : "25%", "Higher zoom values scrolls faster and shows less far ahead."); // 7 page.AddIntegerRange("Loop Count :", 1, 1, 8); // 8 page.AddCheckBoxList("Channels :", GetChannelNames(), GetDefaultSelectedChannels()); // 9 break; case ExportFormat.Nsf: page.AddString("Name :", project.Name, 31); // 0 page.AddString("Artist :", project.Author, 31); // 1 page.AddString("Copyright :", project.Copyright, 31); // 2 page.AddDropDownList("Mode :", MachineType.Names, MachineType.Names[project.PalMode ? MachineType.PAL : MachineType.NTSC]); // 3 page.AddCheckBoxList(null, songNames, null); // 4 #if DEBUG page.AddDropDownList("Engine :", FamiToneKernel.Names, FamiToneKernel.Names[FamiToneKernel.FamiStudio]); // 5 #endif page.SetPropertyEnabled(3, !project.UsesExpansionAudio); break; case ExportFormat.Rom: page.AddDropDownList("Type :", new[] { "NES ROM", "FDS Disk" }, project.ExpansionAudio == ExpansionType.Fds ? "FDS Disk" : "NES ROM"); // 0 page.AddString("Name :", project.Name.Substring(0, Math.Min(28, project.Name.Length)), 28); // 1 page.AddString("Artist :", project.Author.Substring(0, Math.Min(28, project.Author.Length)), 28); // 2 page.AddDropDownList("Mode :", new[] { "NTSC", "PAL" }, project.PalMode ? "PAL" : "NTSC"); // 3 page.AddCheckBoxList(null, songNames, null); // 2 page.SetPropertyEnabled(0, project.ExpansionAudio == ExpansionType.Fds); page.SetPropertyEnabled(3, !project.UsesExpansionAudio); break; case ExportFormat.Midi: page.AddDropDownList("Song :", songNames, songNames[0]); // 0 page.AddCheckBox("Export volume as velocity :", true); // 1 page.AddCheckBox("Export slide notes as pitch wheel :", true); // 2 page.AddIntegerRange("Pitch wheel range :", 24, 1, 24); // 3 page.AddDropDownList("Instrument Mode :", MidiExportInstrumentMode.Names, MidiExportInstrumentMode.Names[0]); // 4 page.AddLabel(null, "Double-click on a row to change."); // 5 page.AddMultiColumnList(new[] { "", "" }, null, MidiInstrumentDoubleClick, null); // 6 page.PropertyChanged += Midi_PropertyChanged; break; case ExportFormat.Text: page.AddCheckBoxList(null, songNames, null); // 0 page.AddCheckBox("Delete unused data :", false); // 1 break; case ExportFormat.FamiTracker: page.AddCheckBoxList(null, songNames, null); // 0 break; case ExportFormat.FamiTone2Music: case ExportFormat.FamiStudioMusic: page.AddDropDownList("Format :", AssemblyFormat.Names, AssemblyFormat.Names[0]); // 0 page.AddCheckBox("Separate Files :", false); // 1 page.AddString("Song Name Pattern :", "{project}_{song}"); // 2 page.AddString("DMC Name Pattern :", "{project}"); // 3 page.AddCheckBox("Generate song list include :", false); // 4 page.AddCheckBoxList(null, songNames, null); // 5 page.SetPropertyEnabled(2, false); page.SetPropertyEnabled(3, false); page.PropertyChanged += SoundEngine_PropertyChanged; break; case ExportFormat.FamiTone2Sfx: case ExportFormat.FamiStudioSfx: page.AddDropDownList("Format :", AssemblyFormat.Names, AssemblyFormat.Names[0]); // 0 page.AddDropDownList("Mode :", MachineType.Names, MachineType.Names[project.PalMode ? MachineType.PAL : MachineType.NTSC]); // 1 page.AddCheckBox("Generate SFX list include :", false); // 2 page.AddCheckBoxList(null, songNames, null); // 3 break; } page.Build(); if (format == ExportFormat.Midi) { UpdateMidiInstrumentMapping(); } return(page); }