public void InitializeGL(FamiStudioForm form) { foreach (var ctrl in controls) { ctrl.RenderInitialized(gfx); } }
public Project ShowDialog(FamiStudioForm parent) { var project = (Project)null; if (dialog != null) { // This is only ran in desktop and this isnt really async, so its ok. dialog.ShowDialogAsync(parent, (r) => { if (r == DialogResult.OK) { var songIndex = Array.IndexOf(songNames, dialog.Properties.GetPropertyValue <string>(0));; var duration = dialog.Properties.GetPropertyValue <int>(1); var patternLen = dialog.Properties.GetPropertyValue <int>(2); var startFrame = dialog.Properties.GetPropertyValue <int>(3); var removeIntro = dialog.Properties.GetPropertyValue <bool>(4); var reverseDpcmBits = dialog.Properties.GetPropertyValue <bool>(5); var preserveDpcmPadding = dialog.Properties.GetPropertyValue <bool>(6); project = new NsfFile().Load(filename, songIndex, duration, patternLen, startFrame, removeIntro, reverseDpcmBits, preserveDpcmPadding); } }); } return(project); }
public DialogResult ShowDialog(FamiStudioForm parent) { var dialogResult = dialog.ShowDialog(parent); if (dialogResult == DialogResult.OK) { var pageGeneral = pages[(int)ConfigSection.General]; var pageUI = pages[(int)ConfigSection.UserInterface]; var pageSound = pages[(int)ConfigSection.Sound]; var pageMixer = pages[(int)ConfigSection.Mixer]; // General Settings.CheckUpdates = pageGeneral.GetPropertyValue <bool>(0); Settings.TrackPadControls = pageGeneral.GetPropertyValue <bool>(1); // UI var scalingString = pageUI.GetPropertyValue <string>(0); Settings.DpiScaling = scalingString == "System" ? 0 : int.Parse(scalingString.Substring(0, 3)); Settings.TimeFormat = Array.IndexOf(TimeFormatStrings, pageUI.GetPropertyValue <string>(1)); Settings.FollowMode = Array.IndexOf(FollowModeStrings, pageUI.GetPropertyValue <string>(2)); Settings.FollowSync = Array.IndexOf(FollowSyncStrings, pageUI.GetPropertyValue <string>(3)); Settings.ShowPianoRollViewRange = pageUI.GetPropertyValue <bool>(4); Settings.ShowNoteLabels = pageUI.GetPropertyValue <bool>(5); Settings.ShowImplicitStopNotes = pageUI.GetPropertyValue <bool>(6); Settings.ShowScrollBars = pageUI.GetPropertyValue <bool>(7); Settings.ShowOscilloscope = pageUI.GetPropertyValue <bool>(8); Settings.ForceCompactSequencer = pageUI.GetPropertyValue <bool>(9); // Sound Settings.NumBufferedAudioFrames = pageSound.GetPropertyValue <int>(0); Settings.InstrumentStopTime = pageSound.GetPropertyValue <int>(1); Settings.SquareSmoothVibrato = pageSound.GetPropertyValue <bool>(2); Settings.NoDragSoungWhenPlaying = pageSound.GetPropertyValue <bool>(3); // Mixer. Array.Copy(expansionMixer, Settings.ExpansionMixerSettings, Settings.ExpansionMixerSettings.Length); // MIDI var pageMIDI = pages[(int)ConfigSection.MIDI]; Settings.MidiDevice = pageMIDI.GetPropertyValue <string>(0); // QWERTY Array.Copy(qwertyKeys, Settings.QwertyKeys, Settings.QwertyKeys.Length); Settings.UpdateKeyCodeMaps(); #if FAMISTUDIO_MACOS // Mac OS var pageMacOS = pages[(int)ConfigSection.MacOS]; Settings.ReverseTrackPad = pageMacOS.GetPropertyValue <bool>(0); Settings.TrackPadMoveSensitity = pageMacOS.GetPropertyValue <int>(1); Settings.TrackPadZoomSensitity = pageMacOS.GetPropertyValue <int>(2); #endif Settings.Save(); } return(dialogResult); }
public System.Windows.Forms.DialogResult ShowDialog(FamiStudioForm parent) { if (propertyPage.HasAdvancedProperties) { buttonAdvanced.Show(); } Show(); if (topAlign || leftAlign) { Debug.Assert(WindowPosition == WindowPosition.None); var pt = initialLocation; if (leftAlign) { pt.X -= Allocation.Width; } if (topAlign) { pt.Y -= Allocation.Height; } Move(pt.X, pt.Y); } while (result == System.Windows.Forms.DialogResult.None) { Application.RunIteration(); } Hide(); return(result); }
public System.Windows.Forms.DialogResult ShowDialog(FamiStudioForm parent = null) { Show(); if (topAlign || leftAlign) { var pt = initialLocation; if (leftAlign) { pt.X -= Allocation.Width; } if (topAlign) { pt.Y -= Allocation.Height; } Move(pt.X, pt.Y); } #if FAMISTUDIO_MACOS MacUtils.SetNSWindowAlwayOnTop(MacUtils.NSWindowFromGdkWindow(GdkWindow.Handle)); #endif while (result == System.Windows.Forms.DialogResult.None) { Application.RunIteration(); } Hide(); #if FAMISTUDIO_MACOS MacUtils.RestoreMainNSWindowFocus(); #endif return(result); }
public System.Windows.Forms.DialogResult ShowDialog(FamiStudioForm parent = null) { #if FAMISTUDIO_MACOS Show(); int x = parent.Bounds.Left + (parent.Bounds.Width - Allocation.Width) / 2; int y = parent.Bounds.Top + (parent.Bounds.Height - Allocation.Height) / 2; Move(x, y); MacUtils.SetNSWindowAlwayOnTop(MacUtils.NSWindowFromGdkWindow(GdkWindow.Handle)); while (result == System.Windows.Forms.DialogResult.None) { Application.RunIteration(); } Hide(); MacUtils.RestoreMainNSWindowFocus(); #else Run(); Hide(); #endif return(result); }
public System.Windows.Forms.DialogResult ShowDialog(FamiStudioForm parent) { #if FAMISTUDIO_LINUX Run(); Hide(); #else Show(); if (WindowPosition == WindowPosition.CenterOnParent) { var mainWinRect = parent.Bounds; int x = mainWinRect.Left + (mainWinRect.Width - Allocation.Width) / 2; int y = mainWinRect.Top + (mainWinRect.Height - Allocation.Height) / 2; Move(x, y); } MacUtils.SetNSWindowAlwayOnTop(MacUtils.NSWindowFromGdkWindow(GdkWindow.Handle)); while (result == System.Windows.Forms.DialogResult.None) { Application.RunIteration(); } Hide(); MacUtils.RestoreMainNSWindowFocus(); #endif return(result); }
public unsafe LogDialog(FamiStudioForm parentForm) { this.parentForm = parentForm; dialog = new PropertyDialog(800, false); dialog.Properties.AddMultilineString(null, ""); // 0 dialog.Properties.Build(); }
public LogDialog(FamiStudioForm parentForm) { this.parentForm = parentForm; dialog = new PropertyDialog("Log", 800, false); dialog.Properties.AddMultilineTextBox(null, ""); // 0 dialog.Properties.Build(); }
public void InitializeGL(FamiStudioForm form) { gfx = new GLGraphics(); foreach (var ctrl in controls) { ctrl.RenderInitialized(gfx); } }
public void ShowDialog(FamiStudioForm parentForm) { if (dialog.ShowDialog(parentForm) == DialogResult.OK) { dialog.Hide(); Export(parentForm, false); lastExportCrc = lastExportFilename != null?ComputeProjectCrc(project) : 0; } }
public unsafe LogProgressDialog(FamiStudioForm parentForm) { this.parentForm = parentForm; dialog = new PropertyDialog("Log", 800, false); dialog.Properties.AddMultilineTextBox(null, ""); // 0 dialog.Properties.AddProgressBar(null, 0.0f); // 1 dialog.Properties.Build(); }
public DialogResult ShowDialog(FamiStudioForm parent) { if (dialog != null) { return(dialog.ShowDialog(parent)); } else { return(DialogResult.Cancel); } }
public void Export(FamiStudioForm parentForm, bool repeatLast) { var dlgLog = new LogProgressDialog(parentForm); using (var scopedLog = new ScopedLogOutput(dlgLog, LogSeverity.Info)) { var selectedFormat = (ExportFormat)dialog.SelectedIndex; Exporting?.Invoke(); if (!repeatLast) { lastExportFilename = null; } switch (selectedFormat) { case ExportFormat.WavMp3: ExportWavMp3(); break; case ExportFormat.Video: ExportVideo(); break; case ExportFormat.Nsf: ExportNsf(); break; case ExportFormat.Rom: ExportRom(); break; case ExportFormat.Midi: ExportMidi(); break; case ExportFormat.Text: ExportText(); break; case ExportFormat.FamiTracker: ExportFamiTracker(); break; case ExportFormat.FamiTone2Music: ExportFamiTone2Music(false); break; case ExportFormat.FamiStudioMusic: ExportFamiTone2Music(true); break; case ExportFormat.FamiTone2Sfx: ExportFamiTone2Sfx(false); break; case ExportFormat.FamiStudioSfx: ExportFamiTone2Sfx(true); break; } if (dlgLog.HasMessages) { Log.LogMessage(LogSeverity.Info, "Done!"); Log.ReportProgress(1.0f); } dlgLog.StayModalUntilClosed(); } }
public Project ShowDialog(FamiStudioForm parent) { if (dialog != null && dialog.ShowDialog(parent) == DialogResult.OK) { var expansion = dialog.Properties.GetSelectedIndex(0); var polyphony = dialog.Properties.GetSelectedIndex(1); var measuresPerPattern = dialog.Properties.GetPropertyValue <int>(2); var velocityAsVolume = dialog.Properties.GetPropertyValue <bool>(3); var pal = expansion != ExpansionType.None ? false : dialog.Properties.GetPropertyValue <bool>(4); return(new MidiFileReader().Load(filename, expansion, pal, channelSources, velocityAsVolume, polyphony, measuresPerPattern)); } return(null); }
public DialogResult ShowDialog(FamiStudioForm parent) { var dialogResult = dialog.ShowDialog(parent); if (dialogResult == DialogResult.OK) { var operation = (TransformOperation)dialog.SelectedIndex; switch (operation) { case TransformOperation.Cleanup: Cleanup(); break; } } return(dialogResult); }
public void ShowModal(FamiStudioForm parent = null) { Show(); #if FAMISTUDIO_MACOS if (WindowPosition == WindowPosition.CenterOnParent) { var mainWinRect = parent.Bounds; int x = mainWinRect.Left + (mainWinRect.Width - Allocation.Width) / 2; int y = mainWinRect.Top + (mainWinRect.Height - Allocation.Height) / 2; Move(x, y); } MacUtils.SetNSWindowAlwayOnTop(MacUtils.NSWindowFromGdkWindow(GdkWindow.Handle)); #endif }
public FamiStudioControls(FamiStudioForm parent) { toolbar = new Toolbar(); sequencer = new Sequencer(); pianoRoll = new PianoRoll(); projectExplorer = new ProjectExplorer(); controls[ControlToolbar] = toolbar; controls[ControlSequencer] = sequencer; controls[ControlPianoRoll] = pianoRoll; controls[ControlProjectExplorer] = projectExplorer; foreach (var ctrl in controls) { ctrl.ParentForm = parent; } }
public System.Windows.Forms.DialogResult ShowDialog(FamiStudioForm parent) { Show(); if (topAlign || leftAlign) { Debug.Assert(WindowPosition == WindowPosition.None); var pt = initialLocation; if (leftAlign) { pt.X -= Allocation.Width; } if (topAlign) { pt.Y -= Allocation.Height; } Move(pt.X, pt.Y); } #if FAMISTUDIO_MACOS if (WindowPosition == WindowPosition.CenterOnParent) { var mainWinRect = parent.Bounds; int x = mainWinRect.Left + (mainWinRect.Width - Allocation.Width) / 2; int y = mainWinRect.Top + (mainWinRect.Height - Allocation.Height) / 2; Move(x, y); } MacUtils.SetNSWindowAlwayOnTop(MacUtils.NSWindowFromGdkWindow(GdkWindow.Handle)); #endif while (result == System.Windows.Forms.DialogResult.None) { Application.RunIteration(); } Hide(); #if FAMISTUDIO_MACOS MacUtils.RestoreMainNSWindowFocus(); #endif return(result); }
public unsafe LogProgressDialog(FamiStudioForm parentForm) { this.parentForm = parentForm; MainThread.InvokeOnMainThreadAsync(() => { // HACK : We only use this for video export on mobile. dialog = new PropertyDialog("Exporting Video", 100, false); dialog.Properties.AddProgressBar("Export progress", 0.0f, "Exporting videos may take a very long time, especially at high resolutions. " + "Make sure FamiStudio remains open, clicking BACK or closing this window will abort the operation. " + "FamiStudio is currently preventing the screen from going to sleep.\n\n" + "Also please note that for reasons outside of our control, the video encoding quality on mobile " + "is inferior to the desktop version of FamiStudio."); // 0 dialog.Properties.AddLabel("Current Step", ""); // 1 dialog.Properties.Build(); }); }
public void ShowDialog(FamiStudioForm parentForm) { if (dialog.ShowDialog(parentForm) == DialogResult.OK) { dialog.Hide(); var dlgLog = new LogProgressDialog(parentForm); using (var scopedLog = new ScopedLogOutput(dlgLog, LogSeverity.Info)) { var selectedFormat = (ExportFormat)dialog.SelectedIndex; switch (selectedFormat) { case ExportFormat.WavMp3: ExportWavMp3(); break; case ExportFormat.Video: ExportVideo(); break; case ExportFormat.Nsf: ExportNsf(); break; case ExportFormat.Rom: ExportRom(); break; case ExportFormat.Text: ExportText(); break; case ExportFormat.FamiTracker: ExportFamiTracker(); break; case ExportFormat.FamiTone2Music: ExportFamiTone2Music(false); break; case ExportFormat.FamiStudioMusic: ExportFamiTone2Music(true); break; case ExportFormat.FamiTone2Sfx: ExportFamiTone2Sfx(false); break; case ExportFormat.FamiStudioSfx: ExportFamiTone2Sfx(true); break; } if (dlgLog.HasMessages) { Log.LogMessage(LogSeverity.Info, "Done!"); Log.ReportProgress(1.0f); } dlgLog.StayModalUntilClosed(); } } }
public FamiStudioControls(FamiStudioForm parent) { toolbar = new Toolbar(); sequencer = new Sequencer(); pianoRoll = new PianoRoll(); projectExplorer = new ProjectExplorer(); quickAccessBar = new QuickAccessBar(); mobilePiano = new MobilePiano(); controls[0] = toolbar; controls[1] = sequencer; controls[2] = pianoRoll; controls[3] = projectExplorer; foreach (var ctrl in controls) { ctrl.ParentForm = parent; } }
public DialogResult ShowDialog(FamiStudioForm parent) { var dialogResult = dialog.ShowDialog(parent); if (dialogResult == DialogResult.OK) { // UI var pageUI = pages[(int)ConfigSection.UserInterface]; var pageSound = pages[(int)ConfigSection.Sound]; var scalingString = pageUI.GetPropertyValue <string>(0); var timeFormatString = pageUI.GetPropertyValue <string>(1); var followModeString = pageUI.GetPropertyValue <string>(2); var followSyncString = pageUI.GetPropertyValue <string>(3); Settings.DpiScaling = scalingString == "System" ? 0 : int.Parse(scalingString.Substring(0, 3)); Settings.TimeFormat = Array.IndexOf(TimeFormatStrings, timeFormatString); Settings.FollowMode = Array.IndexOf(FollowModeStrings, followModeString); Settings.FollowSync = Array.IndexOf(FollowSyncStrings, followSyncString); Settings.CheckUpdates = pageUI.GetPropertyValue <bool>(4); Settings.ShowPianoRollViewRange = pageUI.GetPropertyValue <bool>(5); Settings.ShowNoteLabels = pageUI.GetPropertyValue <bool>(6); Settings.TrackPadControls = pageUI.GetPropertyValue <bool>(7); #if FAMISTUDIO_MACOS Settings.ReverseTrackPad = pageUI.GetPropertyValue <bool>(8); #endif // Sound Settings.NumBufferedAudioFrames = pageSound.GetPropertyValue <int>(0); Settings.InstrumentStopTime = pageSound.GetPropertyValue <int>(1); Settings.SquareSmoothVibrato = pageSound.GetPropertyValue <bool>(2); Settings.NoDragSoungWhenPlaying = pageSound.GetPropertyValue <bool>(3); // MIDI var pageMIDI = pages[(int)ConfigSection.MIDI]; Settings.MidiDevice = pageMIDI.GetPropertyValue <string>(0); Settings.Save(); } return(dialogResult); }
public void ShowDialogAsync(FamiStudioForm parent, Action <DialogResult> callback) { dialog.ShowDialogAsync(parent, (r) => { if (r == DialogResult.OK) { var operation = (TransformOperation)dialog.SelectedIndex; switch (operation) { case TransformOperation.SongCleanup: SongCleanup(); break; case TransformOperation.ProjectCleanup: ProjectCleanup(); break; } } callback(r); }); }
public Project ShowDialog(FamiStudioForm parent) { var project = (Project)null; if (dialog != null) { // This is only ran in desktop and this isnt really async, so its ok. dialog.ShowDialogAsync(parent, (r) => { if (r == DialogResult.OK) { var expansionMask = GetExpansionMask(dialog.Properties.GetPropertyValue <bool[]>(4)); var polyphony = dialog.Properties.GetSelectedIndex(0); var measuresPerPattern = dialog.Properties.GetPropertyValue <int>(1); var velocityAsVolume = dialog.Properties.GetPropertyValue <bool>(2); var pal = expansionMask != ExpansionType.NoneMask ? false : dialog.Properties.GetPropertyValue <bool>(3); project = new MidiFileReader().Load(filename, expansionMask, pal, channelSources, velocityAsVolume, polyphony, measuresPerPattern); } }); } return(project); }
public void ShowModal(FamiStudioForm form) { form.Enabled = false; Show(form); }
public void ShowDialogAsync(FamiStudioForm parent, Action <DialogResult> callback) { dialog.ShowDialogAsync(parent, (r) => { if (r == DialogResult.OK) { var pageGeneral = pages[(int)ConfigSection.General]; var pageUI = pages[(int)ConfigSection.UserInterface]; var pageSound = pages[(int)ConfigSection.Sound]; var pageMixer = pages[(int)ConfigSection.Mixer]; // General Settings.CheckUpdates = pageGeneral.GetPropertyValue <bool>(0); Settings.ShowTutorial = pageGeneral.GetPropertyValue <bool>(1); Settings.TrackPadControls = pageGeneral.GetPropertyValue <bool>(2); Settings.ClearUndoRedoOnSave = pageGeneral.GetPropertyValue <bool>(3); Settings.OpenLastProjectOnStart = pageGeneral.GetPropertyValue <bool>(4); Settings.AutoSaveCopy = pageGeneral.GetPropertyValue <bool>(5); // UI var scalingString = pageUI.GetPropertyValue <string>(0); Settings.DpiScaling = scalingString == "System" ? 0 : Utils.ParseIntWithTrailingGarbage(scalingString); Settings.TimeFormat = pageUI.GetSelectedIndex(1); Settings.FollowMode = pageUI.GetSelectedIndex(2); Settings.FollowSync = pageUI.GetSelectedIndex(3); Settings.ScrollBars = pageUI.GetSelectedIndex(4); Settings.ShowPianoRollViewRange = pageUI.GetPropertyValue <bool>(5); Settings.ShowNoteLabels = pageUI.GetPropertyValue <bool>(6); Settings.ShowImplicitStopNotes = pageUI.GetPropertyValue <bool>(7); Settings.ShowOscilloscope = pageUI.GetPropertyValue <bool>(8); Settings.ForceCompactSequencer = pageUI.GetPropertyValue <bool>(9); // Sound Settings.NumBufferedAudioFrames = pageSound.GetPropertyValue <int>(0); Settings.InstrumentStopTime = pageSound.GetPropertyValue <int>(1); Settings.SquareSmoothVibrato = pageSound.GetPropertyValue <bool>(2); Settings.NoDragSoungWhenPlaying = pageSound.GetPropertyValue <bool>(3); Settings.MetronomeVolume = (int)pageSound.GetPropertyValue <double>(4); // Mixer. Settings.GlobalVolume = (float)pageMixer.GetPropertyValue <double>(0); Array.Copy(expansionMixer, Settings.ExpansionMixerSettings, Settings.ExpansionMixerSettings.Length); // MIDI var pageMIDI = pages[(int)ConfigSection.MIDI]; Settings.MidiDevice = pageMIDI.GetPropertyValue <string>(0); // FFmpeg var pageFFmpeg = pages[(int)ConfigSection.FFmpeg]; Settings.FFmpegExecutablePath = pageFFmpeg.GetPropertyValue <string>(1); // QWERTY Array.Copy(qwertyKeys, Settings.QwertyKeys, Settings.QwertyKeys.Length); Settings.UpdateKeyCodeMaps(); // Mac OS var pageMacOS = pages[(int)ConfigSection.MacOS]; Settings.ReverseTrackPad = pageMacOS.GetPropertyValue <bool>(0); Settings.TrackPadMoveSensitity = pageMacOS.GetPropertyValue <int>(1); Settings.TrackPadZoomSensitity = pageMacOS.GetPropertyValue <int>(2); // Mobile var pageMobile = pages[(int)ConfigSection.Mobile]; Settings.AllowVibration = pageMobile.GetPropertyValue <bool>(0); Settings.DoubleClickDelete = pageMobile.GetPropertyValue <bool>(1); Settings.Save(); } callback(r); }); }
public void ShowDialogAsync(FamiStudioForm parent, Action <System.Windows.Forms.DialogResult> callback) { callback(ShowDialog(parent)); }
public System.Windows.Forms.DialogResult ShowDialog(FamiStudioForm parent) { Run(); Hide(); return(result); }
public void ShowModal(FamiStudioForm parent = null) { Show(); }