예제 #1
0
        public unsafe ConfigDialog()
        {
            int width  = PlatformUtils.IsWindows ? 550 : 570;
            int height = PlatformUtils.IsWindows ? 350 : 450;

            dialog = new MultiPropertyDialog("FamiStudio Configuration", width, height);
            dialog.SetVerb("Apply", true);

            // Keep a copy of QWERTY keys.
            qwertyKeys = new int[37, 2];
            Array.Copy(Settings.QwertyKeys, qwertyKeys, Settings.QwertyKeys.Length);

            // Keep a copy of mixer settings.
            Array.Copy(Settings.ExpansionMixerSettings, expansionMixer, Settings.ExpansionMixerSettings.Length);

            for (int i = 0; i < (int)ConfigSection.Max; i++)
            {
                var section = (ConfigSection)i;
                var page    = dialog.AddPropertyPage(ConfigSectionNames[i], "Config" + section.ToString());
                CreatePropertyPage(page, section);
            }

            dialog.SetPageVisible((int)ConfigSection.MacOS, PlatformUtils.IsMacOS);
            dialog.SetPageVisible((int)ConfigSection.MIDI, PlatformUtils.IsDesktop);
            dialog.SetPageVisible((int)ConfigSection.FFmpeg, PlatformUtils.IsDesktop);
            dialog.SetPageVisible((int)ConfigSection.QWERTY, PlatformUtils.IsDesktop);
            dialog.SetPageVisible((int)ConfigSection.Mobile, PlatformUtils.IsMobile);
        }
예제 #2
0
        public unsafe ExportDialog(FamiStudio famistudio)
        {
            int width  = 600;
            int height = PlatformUtils.IsLinux ? 650 : (PlatformUtils.IsMacOS ? 630 : 550);

            dialog = new MultiPropertyDialog("Export Songs", width, height, 200);
            dialog.SetVerb("Export");
            app     = famistudio;
            project = app.Project;

            for (int i = 0; i < (int)ExportFormat.Max; i++)
            {
                var format = (ExportFormat)i;
                var page   = dialog.AddPropertyPage(ExportFormatNames[i], ExportIcons[i]);
                CreatePropertyPage(page, format);
            }

            // Hide a few formats we don't care about on mobile.
            dialog.SetPageVisible((int)ExportFormat.Midi, PlatformUtils.IsDesktop);
            dialog.SetPageVisible((int)ExportFormat.Text, PlatformUtils.IsDesktop);
            dialog.SetPageVisible((int)ExportFormat.FamiTracker, PlatformUtils.IsDesktop);
            dialog.SetPageVisible((int)ExportFormat.FamiStudioMusic, PlatformUtils.IsDesktop);
            dialog.SetPageVisible((int)ExportFormat.FamiStudioSfx, PlatformUtils.IsDesktop);
            dialog.SetPageVisible((int)ExportFormat.FamiTone2Music, PlatformUtils.IsDesktop);
            dialog.SetPageVisible((int)ExportFormat.FamiTone2Sfx, PlatformUtils.IsDesktop);
            dialog.SetPageVisible((int)ExportFormat.Share, PlatformUtils.IsMobile);

            if (PlatformUtils.IsDesktop)
            {
                UpdateMidiInstrumentMapping();
            }
        }