Exemple #1
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();
            }
        }
Exemple #2
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);
        }
Exemple #3
0
        public unsafe ConfigDialog()
        {
#if FAMISTUDIO_WINDOWS
            int width  = 550;
            int height = 350;
#else
            int width  = 570;
            int height = 450;
#endif

            this.dialog = new MultiPropertyDialog(width, height);

            // 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);
            }
        }
Exemple #4
0
        public unsafe TransformDialog(FamiStudio famistudio)
        {
            app    = famistudio;
            dialog = new MultiPropertyDialog(550, 500);

            for (int i = 0; i < (int)TransformOperation.Max; i++)
            {
                var section = (TransformOperation)i;
                var page    = dialog.AddPropertyPage(ConfigSectionNames[i], "Clean");
                CreatePropertyPage(page, section);
            }
        }
Exemple #5
0
        public unsafe ConfigDialog(Rectangle mainWinRect)
        {
            int width  = 450;
            int height = 300;
            int x      = mainWinRect.Left + (mainWinRect.Width - width) / 2;
            int y      = mainWinRect.Top + (mainWinRect.Height - height) / 2;

            this.dialog = new MultiPropertyDialog(x, y, width, height);

            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);
            }
        }
Exemple #6
0
        public unsafe ExportDialog(Rectangle mainWinRect, Project project)
        {
            int width  = 450;
            int height = 375;
            int x      = mainWinRect.Left + (mainWinRect.Width - width) / 2;
            int y      = mainWinRect.Top + (mainWinRect.Height - height) / 2;

            this.dialog  = new MultiPropertyDialog(x, y, width, height);
            this.project = project;

            for (int i = 0; i < (int)ExportFormat.Max; i++)
            {
                var format = (ExportFormat)i;
                var page   = dialog.AddPropertyPage(format.ToString(), "Export" + format.ToString());
                CreatePropertyPage(page, format);
            }
        }
Exemple #7
0
        public unsafe TransformDialog(Rectangle mainWinRect, FamiStudio famistudio)
        {
            int width  = 450;
            int height = 400;
            int x      = mainWinRect.Left + (mainWinRect.Width - width) / 2;
            int y      = mainWinRect.Top + (mainWinRect.Height - height) / 2;

            app    = famistudio;
            dialog = new MultiPropertyDialog(x, y, width, height);

            for (int i = 0; i < (int)TransformOperation.Max; i++)
            {
                var section = (TransformOperation)i;
                var page    = dialog.AddPropertyPage(ConfigSectionNames[i], "Clean");
                CreatePropertyPage(page, section);
            }
        }
Exemple #8
0
        public unsafe ConfigDialog()
        {
#if FAMISTUDIO_LINUX
            int width = 570;
#else
            int width = 550;
#endif
            int height = 350;

            this.dialog = new MultiPropertyDialog(width, height);

            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);
            }
        }
Exemple #9
0
        public unsafe ExportDialog(Project project)
        {
            int width  = 600;
            int height = 550;

#if FAMISTUDIO_LINUX
            height += 30;
#endif

            this.dialog  = new MultiPropertyDialog(width, height, 200);
            this.project = 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);
            }
        }
        public unsafe ExportDialog(Rectangle mainWinRect, Project project)
        {
            int width  = 550;
            int height = 450;
            int x      = mainWinRect.Left + (mainWinRect.Width - width) / 2;
            int y      = mainWinRect.Top + (mainWinRect.Height - height) / 2;

#if FAMISTUDIO_LINUX
            height += 30;
#endif

            this.dialog  = new MultiPropertyDialog(x, y, width, height, 200);
            this.project = 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);
            }
        }
 public MultiPropertyTabFragment(MultiPropertyDialog dlg)
 {
     dialog = dlg;
 }
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            var info = FamiStudioForm.Instance != null ? FamiStudioForm.Instance.ActiveDialog as MultiPropertyDialogActivityInfo : null;

            if (savedInstanceState != null || info == null)
            {
                Finish();
                return;
            }

            dlg          = info.Dialog;
            tabsFragment = new MultiPropertyTabFragment(dlg);

            var appBarLayoutParams = new AppBarLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, DroidUtils.GetSizeAttributeInPixel(this, Android.Resource.Attribute.ActionBarSize));

            appBarLayoutParams.ScrollFlags = 0;

            toolbar = new AndroidX.AppCompat.Widget.Toolbar(new ContextThemeWrapper(this, Resource.Style.ToolbarTheme));
            toolbar.LayoutParameters = appBarLayoutParams;
            toolbar.SetTitleTextAppearance(this, Resource.Style.LightGrayTextMediumBold);
            SetSupportActionBar(toolbar);

            ActionBar actionBar = SupportActionBar;

            if (actionBar != null)
            {
                actionBar.SetDisplayHomeAsUpEnabled(true);
                actionBar.SetHomeButtonEnabled(true);
                actionBar.SetHomeAsUpIndicator(Android.Resource.Drawable.IcMenuCloseClearCancel);
                actionBar.Title = dlg.Title;
            }

            appBarLayout = new AppBarLayout(this);
            appBarLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent);
            appBarLayout.AddView(toolbar);

            var fragmentViewLayoutParams = new NestedScrollView.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            fragmentViewLayoutParams.Gravity = GravityFlags.Fill;

            fragmentView = new FragmentContainerView(this);
            fragmentView.LayoutParameters = fragmentViewLayoutParams;
            fragmentView.Id = FragmentViewId;

            var scrollViewLayoutParams = new CoordinatorLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);

            scrollViewLayoutParams.Behavior = new AppBarLayout.ScrollingViewBehavior(this, null);

            scrollView = new NestedScrollView(new ContextThemeWrapper(this, Resource.Style.DarkBackgroundStyle));
            scrollView.LayoutParameters = scrollViewLayoutParams;
            scrollView.FillViewport     = true;
            scrollView.AddView(fragmentView);

            coordLayout = new CoordinatorLayout(this);
            coordLayout.LayoutParameters = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent);
            coordLayout.AddView(appBarLayout);
            coordLayout.AddView(scrollView);

            SetContentView(coordLayout);

            SupportFragmentManager.BeginTransaction()
            .Add(fragmentView.Id, tabsFragment, "MultiPropertyDialogTabs")
            .Commit();
        }