Esempio n. 1
0
        private void ExportNsf()
        {
            Action <string> ExportNsfAction = (filename) =>
            {
                if (filename != null)
                {
                    var props = dialog.GetPropertyPage((int)ExportFormat.Nsf);
                    var mode  = MachineType.GetValueForName(props.GetPropertyValue <string>(3));
#if DEBUG
                    var kernel = FamiToneKernel.GetValueForName(props.GetPropertyValue <string>(5));
#else
                    var kernel = FamiToneKernel.FamiStudio;
#endif

                    new NsfFile().Save(project, kernel, filename,
                                       GetSongIds(props.GetPropertyValue <bool[]>(4)),
                                       props.GetPropertyValue <string>(0),
                                       props.GetPropertyValue <string>(1),
                                       props.GetPropertyValue <string>(2),
                                       mode);

                    lastExportFilename = filename;
                }
            };

            if (PlatformUtils.IsMobile)
            {
                PlatformUtils.StartMobileSaveFileOperationAsync("*/*", $"{project.Name}.nsf", (f) =>
                {
                    ExportNsfAction(f);
                    PlatformUtils.FinishMobileSaveFileOperationAsync(true, () => { PlatformUtils.ShowToast("NSF Export Successful!"); });
                });
            }
            else
            {
                var filename = lastExportFilename != null ? lastExportFilename : PlatformUtils.ShowSaveFileDialog("Export NSF File", "Nintendo Sound Files (*.nsf)|*.nsf", ref Settings.LastExportFolder);
                ExportNsfAction(filename);
            }
        }
Esempio n. 2
0
        private void ExportNsf()
        {
            var filename = lastExportFilename != null ? lastExportFilename : PlatformUtils.ShowSaveFileDialog("Export NSF File", "Nintendo Sound Files (*.nsf)|*.nsf", ref Settings.LastExportFolder);

            if (filename != null)
            {
                var props = dialog.GetPropertyPage((int)ExportFormat.Nsf);
                var mode  = MachineType.GetValueForName(props.GetPropertyValue <string>(3));
#if DEBUG
                var kernel = FamiToneKernel.GetValueForName(props.GetPropertyValue <string>(5));
#else
                var kernel = FamiToneKernel.FamiStudio;
#endif

                new NsfFile().Save(project, kernel, filename,
                                   GetSongIds(props.GetPropertyValue <bool[]>(4)),
                                   props.GetPropertyValue <string>(0),
                                   props.GetPropertyValue <string>(1),
                                   props.GetPropertyValue <string>(2),
                                   mode);

                lastExportFilename = filename;
            }
        }
Esempio n. 3
0
 public FamitoneMusicFile(FamiToneKernel kernel)
 {
     this.kernel         = kernel;
     this.maxRepeatCount = kernel == FamiToneKernel.FamiStudio ? MaxRepeatCountFT2FS : MaxRepeatCountFT2;
 }
Esempio n. 4
0
 public FamitoneMusicFile(FamiToneKernel kernel)
 {
     this.kernel = kernel;
 }