public FunctionWindow(Registration registration, FunctionObjectRec functionObject, Document document, IMainWindowServices mainWindow)
        {
            this.registration   = registration;
            this.functionObject = functionObject;
            this.document       = document;
            this.mainWindow     = mainWindow;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            this.textBoxFunctionBody.TextService = Program.Config.EnableDirectWrite ? TextEditor.TextService.DirectWrite : TextEditor.TextService.Uniscribe;
            this.textBoxFunctionBody.AutoIndent  = Program.Config.AutoIndent;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            menuStripManager.SetGlobalHandler(mainWindow);
            menuStripManager.HookUpTextEditorWindowHelper(this.textEditorWindowHelper);
            menuStripManager.HookUpTextBoxWindowHelper(this.textBoxWindowHelper);

            documentBindingSource.Add(mainWindow.Document);
            functionObjectRecBindingSource.Add(functionObject);

            textBoxFunctionName.TextChanged += new EventHandler(textBoxFunctionName_TextChanged);
            GlobalNameChanged();

            registration.Register(functionObject, this);
        }
        public TrackAttributeDialog(TrackObjectRec track)
        {
            this.track = track;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            foreach (string item in EnumUtility.GetDescriptions(TrackObjectRec.DefaultReleasePoint1ModeFlagAllowedValues, TrackObjectRec.DefaultReleasePoint1ModeFlag_EnumCategoryName))
            {
                comboBoxDefaultReleasePoint1Flags.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(TrackObjectRec.DefaultReleasePoint2ModeFlagAllowedValues, TrackObjectRec.DefaultReleasePoint2ModeFlag_EnumCategoryName))
            {
                comboBoxDefaultReleasePoint2Flags.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(TrackObjectRec.DefaultPitchDisplacementStartPointModeFlagAllowedValues, TrackObjectRec.DefaultPitchDisplacementStartPointModeFlag_EnumCategoryName))
            {
                comboBoxDefaultPitchDisplacementStartFlags.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(TrackObjectRec.DefaultDurationModeFlagAllowedValues, TrackObjectRec.DefaultDurationModeFlag_EnumCategoryName))
            {
                comboBoxDefaultDurationAdjustModeFlags.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(TrackObjectRec.DefaultDetuneModeFlagAllowedValues, TrackObjectRec.DefaultDetuneModeFlag_EnumCategoryName))
            {
                comboBoxDefaultDetuningModeFlags.Items.Add(item);
            }

            trackObjectRecBindingSource.Add(track);
        }
Beispiel #3
0
        public CommandChooser()
        {
            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            listBoxCommands.ValueMember   = "Key";
            listBoxCommands.DisplayMember = "Value";
            foreach (NoteCommands command in CommandList)
            {
                if (command != NoteCommands.eCmd_End)
                {
                    KeyValuePair <NoteCommands, string> entry = new KeyValuePair <NoteCommands, string>(command, CommandMapping.GetCommandName(command));
                    listBoxCommands.Items.Add(entry);
                }
                else
                {
                    listBoxCommands.Items.Add(new KeyValuePair <NoteCommands, string>(NoteCommands.eCmd_End, String.Empty));
                }
            }
            if (lastSelectIndex >= 0)
            {
                listBoxCommands.SelectedIndex = lastSelectIndex;
            }
            listBoxCommands.DoubleClick += buttonOK_Click;
        }
        public DisassemblyWindow(string text, IMainWindowServices mainWindow, string functionModuleName)
        {
            this.mainWindow         = mainWindow;
            this.functionModuleName = functionModuleName;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            menuStripManager.SetGlobalHandler(mainWindow);
            menuStripManager.HookUpTextEditorWindowHelper(this.textEditorWindowHelper);

            mainWindow.AddMiscForm(this);

            textBoxDisassembly.TextService = Program.Config.EnableDirectWrite ? TextEditor.TextService.DirectWrite : TextEditor.TextService.Uniscribe;
            textBoxDisassembly.Text        = text;
            textBoxDisassembly.SetInsertionPoint(0, 0);

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom, delegate() { return(new Control[] { textBoxDisassembly }); });

            // By default make disassembly window tkae up most of the vertical screen height.
            const int Margin = 20;

            Size = new Size(Size.Width, Screen.PrimaryScreen.WorkingArea.Height - Margin);

            GlobalNameChanged();
        }
        public ImportRawSampleDialog(Import.ImportRawSettings settings, string path)
        {
            this.settings = settings;
            this.path     = path;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            foreach (string item in EnumUtility.GetDescriptions(Import.ImportRawSettings.NumBitsAllowedValues))
            {
                comboBoxBits.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(Import.ImportRawSettings.NumChannelsAllowedValues))
            {
                comboBoxChannels.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(Import.ImportRawSettings.SignModeAllowedValues))
            {
                comboBoxSignMode.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(Import.ImportRawSettings.EndiannessAllowedValues))
            {
                comboBoxEndianness.Items.Add(item);
            }

            importRawSettingsBindingSource.Add(settings);

            settings.PropertyChanged += new PropertyChangedEventHandler(settings_PropertyChanged);
            settings_PropertyChanged(this, null); // initial load

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);
        }
Beispiel #6
0
        public CmdDlgOneParam(string prompt, string boxName, string initialValue, Options options)
        {
            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            labelPrompt.Text = prompt;
            groupBox1.Text   = boxName;
            textBox.Text     = initialValue;

            if ((options & Options.Wide) != 0)
            {
                textBox.Size = new Size(366, textBox.Size.Height);
            }
            if ((options & Options.Multiline) != 0)
            {
                textBox.ScrollBars    = ScrollBars.Both;
                textBox.Multiline     = true;
                textBox.AcceptsReturn = true;
                textBox.AcceptsTab    = true;
                textBox.WordWrap      = false;
                textBox.Size          = new Size(textBox.Size.Width, 100);
            }
        }
        public SectionEditDialog(Registration registration, Document document, IMainWindowServices mainWindow)
        {
            this.registration = registration;
            this.document     = document;
            this.mainWindow   = mainWindow;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            myListBoxSections.SetUnderlying(displayList, DisplayNameOfListEntry);
            myListBoxSections.SelectionChanged += new EventHandler(delegate(object sender, EventArgs e) { OnSelectionChanged(); });
            myListBoxSections.DoubleClick2     += new MyListBox.DoubleClick2EventHandler(myListBoxSections_DoubleClick2);

            document.SectionList.ListChanged += SectionList_ListChanged;
            document.TrackList.ListChanged   += TrackList_ListChanged;

            RebuildScrollingList();
            OnSelectionChanged();

            Disposed += SectionEditDialog_Disposed;

            registration.Register(document.SectionList, this);
        }
Beispiel #8
0
        public AlgoWaveTableWindow(Registration registration, AlgoWaveTableObjectRec algoWaveTableObject, IMainWindowServices mainWindow)
        {
            this.registration        = registration;
            this.algoWaveTableObject = algoWaveTableObject;
            this.mainWindow          = mainWindow;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            this.textBoxFunction.TextService = Program.Config.EnableDirectWrite ? TextEditor.TextService.DirectWrite : TextEditor.TextService.Uniscribe;
            this.textBoxFunction.AutoIndent  = Program.Config.AutoIndent;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            menuStripManager.SetGlobalHandler(mainWindow);
            menuStripManager.HookUpTextEditorWindowHelper(this.textEditorWindowHelper);
            menuStripManager.HookUpTextBoxWindowHelper(this.textBoxWindowHelper);

            foreach (int i in AlgoWaveTableObjectRec.NumFramesAllowedValues)
            {
                comboBoxNumFrames.Items.Add(i.ToString());
            }

            documentBindingSource.Add(mainWindow.Document);
            algoWaveTableObjectRecBindingSource.Add(algoWaveTableObject);

            textBoxName.TextChanged += new EventHandler(textBoxName_TextChanged);
            GlobalNameChanged();

            registration.Register(algoWaveTableObject, this);
        }
Beispiel #9
0
        public OutputProgressWindow(
            string baseName,
            bool showClipping,
            IProgressInfo progressInfo,
            IBufferLoading bufferLoading,
            Synthesizer.IStopTask stopCallback,
            IFinished finished,
            IWaitFinished waitFinished,
            ShowCompletionMethod showError)
        {
            this.stopCallback   = stopCallback;
            this.bufferLoading  = bufferLoading;
            this.progressInfo   = progressInfo;
            this.finished       = finished;
            this.waitFinished   = waitFinished;
            this.showCompletion = showError;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            if (!showClipping)
            {
                labelTotalClippedPoints.Visible = false;
                textTotalClippedPoints.Visible  = false;
            }

            UpdateValues();
            this.Text = String.Format("{0} - {1}", baseName, "Synthesis");
        }
        public SegmentCalculatorDialog(
            InstrumentWindow owner,
            double initial,
            double delay,
            double final,
            bool exponential)
        {
            this.owner = owner;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            this.textBoxInitial.Text     = initial.ToString();
            this.textBoxDuration.Text    = delay.ToString();
            this.textBoxFinal.Text       = final.ToString();
            this.textBoxStartOffset.Text = savedNewStart.ToString();
            this.textBoxEndOffset.Text   = savedNewEnd.ToString();

            this.comboBoxFunction.Items.Add("Linear");
            this.comboBoxFunction.Items.Add("Exponential");
            this.comboBoxFunction.SelectedIndex = exponential ? 1 : 0;

            this.textBoxInitial.TextChanged            += new System.EventHandler(this.textBoxInitial_TextChanged);
            this.textBoxDuration.TextChanged           += new System.EventHandler(this.textBoxDuration_TextChanged);
            this.textBoxFinal.TextChanged              += new System.EventHandler(this.textBoxFinal_TextChanged);
            this.textBoxStartOffset.TextChanged        += new System.EventHandler(this.textBoxStartOffset_TextChanged);
            this.textBoxEndOffset.TextChanged          += new System.EventHandler(this.textBoxEndOffset_TextChanged);
            this.textBoxNewFinal.TextChanged           += new System.EventHandler(this.textBoxNewFinal_TextChanged);
            this.textBoxNewInitial.TextChanged         += new System.EventHandler(this.textBoxNewInitial_TextChanged);
            this.comboBoxFunction.SelectedIndexChanged += new System.EventHandler(this.comboBoxFunction_SelectedIndexChanged);

            Recalculate(true /*updateInitialFinal*/);
        }
Beispiel #11
0
        public TrackWindow(Registration registration, TrackObjectRec trackObject, IMainWindowServices mainWindow)
        {
            this.registration = registration;
            this.trackObject  = trackObject;
            this.mainWindow   = mainWindow;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            // By default make new tracks take up most of the horizontal screen width.
            SetDesktopBounds(DesktopBounds.X, DesktopBounds.Y, Screen.PrimaryScreen.Bounds.Width - DesktopBounds.X - 100, DesktopBounds.Height);

            menuStripManager.SetGlobalHandler(mainWindow);

            GlobalNameChanged();

            registration.Register(trackObject, this);

            backgroundToolStripMenuItem = new ToolStripMenuItem("Background", null, new EventHandler(backgroundMenuItem_Click));
            menuStripManager.ContainedMenuStrip.Items.Add(backgroundToolStripMenuItem);
            inlineEditToolStripMenuItem = new ToolStripMenuItem("Inline", null, new EventHandler(inlineEditMenuItem_Click));
            menuStripManager.ContainedMenuStrip.Items.Add(inlineEditToolStripMenuItem);

            trackEditControl.Init(trackObject, mainWindow, menuStripManager, backgroundToolStripMenuItem, inlineEditToolStripMenuItem);

            trackObject.PropertyChanged += TrackObject_PropertyChanged;

            // Change font if preferences have scale factor. Use 'force' to ensure note view and parma strip always compute the
            // correct height even if font hasn't changed to prevent layout glitch.
            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom, true /*force*/);
        }
        public LongRunningOperationWindow()
        {
            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);
        }
Beispiel #13
0
        private bool suppressTableOrFrameChange = true; // suppress until after form is loaded - since init fires notifications

        public WaveTableWindow(Registration registration, WaveTableObjectRec waveTableObject, IMainWindowServices mainWindow)
        {
            this.registration = registration;
            this.waveTableObject = waveTableObject;
            this.mainWindow = mainWindow;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            this.textBoxFormula.TextService = Program.Config.EnableDirectWrite ? TextEditor.TextService.DirectWrite : TextEditor.TextService.Uniscribe;
            this.textBoxFormula.AutoIndent = Program.Config.AutoIndent;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            menuStripManager.SetGlobalHandler(mainWindow);
            menuStripManager.HookUpTextEditorWindowHelper(this.textEditorWindowHelper);
            menuStripManager.HookUpTextBoxWindowHelper(this.textBoxWindowHelper);

            waveTableControl.WaveTableObject = waveTableObject;
            hScrollBarWaveTable.Scroll += new ScrollEventHandler(waveTableControl.OnIndexChanged);

            foreach (int i in WaveTableObjectRec.NumFramesAllowedValues)
            {
                comboBoxNumFrames.Items.Add(i.ToString());
            }

            foreach (string item in EnumUtility.GetDescriptions(WaveTableObjectRec.NumBitsAllowedValues))
            {
                comboBoxNumBits.Items.Add(item);
            }

            documentBindingSource.Add(mainWindow.Document);
            waveTableObjectRecBindingSource.Add(waveTableObject);
            waveTableObject.PropertyChanged += WaveTableObject_PropertyChanged;

            textBoxName.TextChanged += new EventHandler(textBoxName_TextChanged);
            GlobalNameChanged();

            buttonTest.MouseDown += new MouseEventHandler(buttonTest_MouseDown);
            buttonTest.MouseUp += new MouseEventHandler(buttonTest_MouseUp);

            textBoxNumTables.Validated += new EventHandler(textBoxNumTables_TextChanged);
            comboBoxNumFrames.TextChanged += new EventHandler(comboBoxNumFrames_TextChanged);
            comboBoxNumBits.TextChanged += new EventHandler(ComboBoxNumBits_TextChanged);

            tabControlWave.SelectedIndexChanged += TabControlWave_SelectedIndexChanged;
            //
            dataGridViewWave.CellValueNeeded += DataGridViewWave_CellValueNeeded;
            dataGridViewWave.CellValuePushed += DataGridViewWave_CellValuePushed;
            RebuildDataGrid();
            //
            labelScale.Visible = false;
            comboBoxScale.Visible = false;
            comboBoxScale.SelectedIndex = 0;

            registration.Register(waveTableObject, this);
        }
Beispiel #14
0
        public GlobalPrefsDialog(GlobalPrefs primaryPrefs)
        {
            this.primaryPrefs = primaryPrefs;
            localPrefs        = new GlobalPrefs();
            primaryPrefs.CopyTo(localPrefs);

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            devices = OutputDeviceEnumerator.EnumerateAudioOutputDeviceIdentifiers();
            for (int i = 0; i < devices.Length; i++)
            {
                comboBoxOutputDevice.Items.Add(devices[i].Value);
                if (String.Equals(devices[i].Key, localPrefs.OutputDevice))
                {
                    comboBoxOutputDevice.SelectedIndex = i;
                }
            }

            for (int i = 0; i < Priorities.Length; i++)
            {
                comboBoxPriority.Items.Add(Priorities[i].Key);
                if (Priorities[i].Value == localPrefs.PriorityMode)
                {
                    comboBoxPriority.SelectedIndex = i;
                }
            }

            concurrency = localPrefs.Concurrency;
            UpdateConcurrencyEnables();

            bool zoomSet = false;

            for (int i = 0; i < ZoomLevels.Length; i++)
            {
                comboBoxZoom.Items.Add(ZoomLevels[i]);
                if (!zoomSet && (primaryPrefs.AdditionalUIZoom <= ZoomLevels[i]))
                {
                    zoomSet = true;
                    comboBoxZoom.SelectedIndex = i;
                }
            }
            if (!zoomSet)
            {
                comboBoxZoom.SelectedIndex = ZoomLevels.Length - 1;
            }

            globalPrefsBindingSource.Add(localPrefs);
        }
Beispiel #15
0
        public PlayAudioFileWithEffects(IMainWindowServices mainWindow)
        {
            this.mainWindow = mainWindow;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            this.textBoxEffectBody.TextService = Program.Config.EnableDirectWrite ? TextEditor.TextService.DirectWrite : TextEditor.TextService.Uniscribe;
            this.textBoxEffectBody.AutoIndent  = Program.Config.AutoIndent;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            textBoxAudioFilePath.Text = filePath;

            textBoxEffectBody.TabSize = Program.Config.TabSize;
            textBoxEffectBody.Text    = effectBody;
        }
        public CmdDlgOneBinaryChoice(string prompt, string trueButtonName, string falseButtonName, bool initialValue)
        {
            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            labelPrompt.Text      = prompt;
            radioButtonTrue.Text  = trueButtonName;
            radioButtonFalse.Text = falseButtonName;
            if (initialValue)
            {
                radioButtonTrue.Checked = true;
            }
            else
            {
                radioButtonFalse.Checked = true;
            }
        }
Beispiel #17
0
        public AboutBox()
        {
            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            richTextBox1.Rtf  = OutOfPhase._Resources.AboutBoxContent.License;
            pictureBox1.Image = OutOfPhase._Resources.AboutBoxContent.Icon2.ToBitmap();
            pictureBox2.Image = OutOfPhase._Resources.AboutBoxContent.Icon1.ToBitmap();

            AssemblyFileVersionAttribute versionAttribute = (AssemblyFileVersionAttribute)Assembly.GetExecutingAssembly().GetCustomAttribute(typeof(AssemblyFileVersionAttribute));
            string version = versionAttribute.Version;

            version           = version.Substring(0, version.LastIndexOf('.'));
            labelVersion.Text = String.Format("{0} {1}", labelVersion.Text, version);

            richTextBox1.LinkClicked += new LinkClickedEventHandler(richTextBox1_LinkClicked);
        }
Beispiel #18
0
        public SectionChooseDialog(MyBindingList <SectionObjectRec> sections, SectionObjectRec defaultSection)
        {
            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            string nullSection = "(None)";

            displayList.Add(nullSection);
            foreach (SectionObjectRec section in sections)
            {
                displayList.Add(section);
            }

            myListBoxSections.SetUnderlying(displayList, GetDisplayText);
            myListBoxSections.SelectItem(defaultSection != null ? (object)defaultSection : (object)nullSection, true /*clearOtherSelections*/);
            myListBoxSections.DoubleClick2 += MyListBoxSections_DoubleClick;
        }
Beispiel #19
0
        public PlayPrefsDialog(Registration registration, object identity, IMainWindowServices mainWindow, Document document)
        {
            this.registration = registration;
            this.identity     = identity;
            this.mainWindow   = mainWindow;
            this.document     = document;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            foreach (string item in EnumUtility.GetDescriptions(Source.OutputNumBitsAllowedValues))
            {
                comboBoxBitDepth.Items.Add(item);
            }

            foreach (string item in EnumUtility.GetDescriptions(Source.NumChannelsAllowedValues))
            {
                comboBoxNumChannels.Items.Add(item);
            }

            source = new Source(document);
            sourceBindingSource.Add(source);

            listBoxIncludedTracks.SetUnderlying(source.IncludedTracks, delegate(object obj) { return(((Source.TrackInclusionRec)obj).Name); });
            for (int i = 0; i < source.IncludedTracks.Count; i++)
            {
                if (source.IncludedTracks[i].Included)
                {
                    listBoxIncludedTracks.SelectItem(i, false /*clear other selections*/);
                }
            }
            listBoxIncludedTracks.SelectionChanged += new EventHandler(delegate(object sender, EventArgs e) { PropagateTrackInclusion(); });
            source.OnIncludedTracksAdded           += Source_OnIncludedTracksAdded;

            checkBoxDeterministic.CheckedChanged += new EventHandler(delegate(object sender, EventArgs e) { textBoxSeed.Enabled = checkBoxDeterministic.Checked; });

            this.Text = String.Format("{0} - {1}", mainWindow.DisplayName, "Play");

            registration.Register(identity, this);
        }
        public NoteAttributeDialog(NoteNoteObjectRec note)
        {
            this.note = note;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            foreach (string item in EnumUtility.GetDescriptions(NoteNoteObjectRec.ReleasePoint1OriginAllowedValues, NoteNoteObjectRec.ReleasePoint1Origin_EnumCategoryName))
            {
                comboBoxRelease1Origin.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(NoteNoteObjectRec.ReleasePoint2OriginAllowedValues, NoteNoteObjectRec.ReleasePoint2Origin_EnumCategoryName))
            {
                comboBoxRelease2Origin.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(NoteNoteObjectRec.ReleasePoint3OriginAllowedValues, NoteNoteObjectRec.ReleasePoint3Origin_EnumCategoryName))
            {
                comboBoxRelease3Origin.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(NoteNoteObjectRec.PitchDisplacementOriginAllowedValues, NoteNoteObjectRec.PitchDisplacementOrigin_EnumCategoryName))
            {
                comboBoxPitchDisplacementOrigin.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(NoteNoteObjectRec.PortamentoUnitsAllowedValues, NoteNoteObjectRec.PortamentoUnits_EnumCategoryName))
            {
                comboBoxPortamentoUnits.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(NoteNoteObjectRec.DurationAdjustModeAllowedValues, NoteNoteObjectRec.DurationAdjustMode_EnumCategoryName))
            {
                comboBoxDurationAdjustMode.Items.Add(item);
            }
            foreach (string item in EnumUtility.GetDescriptions(NoteNoteObjectRec.DetuningModeAllowedValues, NoteNoteObjectRec.DetuningMode_EnumCategoryName))
            {
                comboBoxDetuningMode.Items.Add(item);
            }

            noteNoteObjectRecBindingSource.Add(this.note);
        }
        public CalculatorWindow(Document document, IMainWindowServices mainWindow)
        {
            this.document   = document;
            this.mainWindow = mainWindow;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            this.textBox.TextService = Program.Config.EnableDirectWrite ? TextEditor.TextService.DirectWrite : TextEditor.TextService.Uniscribe;
            this.textBox.AutoIndent  = Program.Config.AutoIndent;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            menuStripManager.SetGlobalHandler(mainWindow);
            menuStripManager.HookUpTextEditorWindowHelper(this.textEditorWindowHelper);

            documentBindingSource.Add(mainWindow.Document);

            mainWindow.AddMiscForm(this);

            GlobalNameChanged();
        }
Beispiel #22
0
        public AlgoSampWindow(Registration registration, AlgoSampObjectRec algoSampObject, IMainWindowServices mainWindow)
        {
            this.registration   = registration;
            this.algoSampObject = algoSampObject;
            this.mainWindow     = mainWindow;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            this.textBoxFormula.TextService = Program.Config.EnableDirectWrite ? TextEditor.TextService.DirectWrite : TextEditor.TextService.Uniscribe;
            this.textBoxFormula.AutoIndent  = Program.Config.AutoIndent;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            menuStripManager.SetGlobalHandler(mainWindow);
            menuStripManager.HookUpTextEditorWindowHelper(this.textEditorWindowHelper);
            menuStripManager.HookUpTextBoxWindowHelper(this.textBoxWindowHelper);

            foreach (string item in EnumUtility.GetDescriptions(AlgoSampObjectRec.NumChannelsAllowedValues))
            {
                comboBoxChannels.Items.Add(item);
            }

            foreach (string item in EnumUtility.GetDescriptions(AlgoSampObjectRec.LoopBidirectionalAllowedValues))
            {
                comboBoxLoop1Bidirectional.Items.Add(item);
                comboBoxLoop2Bidirectional.Items.Add(item);
                comboBoxLoop3Bidirectional.Items.Add(item);
            }

            documentBindingSource.Add(mainWindow.Document);
            algoSampObjectRecBindingSource.Add(algoSampObject);

            textBoxName.TextChanged += new EventHandler(textBoxName_TextChanged);
            GlobalNameChanged();

            registration.Register(algoSampObject, this);
        }
        public InteractionWindow(IMainWindowServices mainWindow)
        {
            this.mainWindow = mainWindow;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            this.textBox.TextService = Program.Config.EnableDirectWrite ? TextEditor.TextService.DirectWrite : TextEditor.TextService.Uniscribe;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom, delegate() { return(new Control[] { textBox }); });

            // Place interaction window across bottom of screen.
            const int Margin = 50;
            int       width  = Screen.PrimaryScreen.Bounds.Width - 2 * Margin;

            Size     = new Size(width, Height);
            Location = new Point(Margin, Screen.PrimaryScreen.Bounds.Height - Height - Margin);

            menuStripManager.SetGlobalHandler(mainWindow);
            menuStripManager.HookUpTextEditorWindowHelper(this.textEditorWindowHelper);

            GlobalNameChanged();
        }
        public ScoreEffectWindow(Registration registration, ScoreEffectsRec scoreEffectsObject, IMainWindowServices mainWindow)
        {
            this.registration       = registration;
            this.scoreEffectsObject = scoreEffectsObject;
            this.mainWindow         = mainWindow;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            this.textBoxScoreEffectsText.TextService = Program.Config.EnableDirectWrite ? TextEditor.TextService.DirectWrite : TextEditor.TextService.Uniscribe;
            this.textBoxScoreEffectsText.AutoIndent  = Program.Config.AutoIndent;

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            menuStripManager.SetGlobalHandler(mainWindow);
            menuStripManager.HookUpTextEditorWindowHelper(this.textEditorWindowHelper);

            documentBindingSource.Add(mainWindow.Document);
            scoreEffectsRecBindingSource.Add(scoreEffectsObject);

            GlobalNameChanged();

            registration.Register(scoreEffectsObject, this);
        }
        public CmdDlgLoadPitchTable(
            string initialStringArgument1,
            double initialArgument1)
        {
            int  tonicOffset       = (int)Math.Abs(initialArgument1) % 12;
            bool relativeToCurrent = initialArgument1 < 0;

            InitializeComponent();
            this.Icon = OutOfPhase.Properties.Resources.Icon2;

            textEditControl1.TextService = Program.Config.EnableDirectWrite ? TextEditor.TextService.DirectWrite : TextEditor.TextService.Uniscribe;
            textEditControl1.Text        =
                "If unchecked, tonic in new table will" + Environment.NewLine +
                "have same pitch as previous entry. If" + Environment.NewLine +
                "checked, tonic will reset to concert" + Environment.NewLine +
                "pitch equal-temperament reference.";

            DpiChangeHelper.ScaleFont(this, Program.Config.AdditionalUIZoom);

            bool   builtIn;
            string tableName = initialStringArgument1;

            if (!(initialStringArgument1.StartsWith("!") || initialStringArgument1.StartsWith("+!")))
            {
                // built-in
                builtIn = true;
            }
            else
            {
                // user-provided
                builtIn = false;
                if (tableName.StartsWith("+"))
                {
                    checkBoxRelativeCents.Checked = true;
                    tableName = tableName.Substring(1);
                }
                Debug.Assert(tableName.StartsWith("!"));
                tableName = tableName.Substring(1);
            }

            bool found = false;

            comboBoxPitchTable.DisplayMember = "Key";
            comboBoxPitchTable.ValueMember   = "Value";
            comboBoxPitchTable.Items.Add(new KeyValuePair <string, int>("User Function", -1));
            for (int i = 0; i < Synthesizer.PitchTables.Length; i++)
            {
                Synthesizer.PitchEntry table = Synthesizer.PitchTables[i];
                comboBoxPitchTable.Items.Add(new KeyValuePair <string, int>(table.Name, i));
                if (builtIn && String.Equals(tableName, table.Name))
                {
                    comboBoxPitchTable.SelectedIndex = i + 1;
                    found = true;
                }
            }
            if (!found)
            {
                // unknown built-in specification is converted to user function
                comboBoxPitchTable.SelectedIndex    = 0;
                textBoxCustomTableFunctionName.Text = tableName;
            }

            checkBoxReset.Checked = !relativeToCurrent;

            UpdateUserFunctionEnables();

            comboBoxTonic.DisplayMember = "Key";
            comboBoxTonic.ValueMember   = "Value";
            for (int i = 0; i < Tonics.Length; i++)
            {
                KeyValuePair <string, int> tonic = Tonics[i];
                comboBoxTonic.Items.Add(tonic);
                if (tonicOffset % 12 == tonic.Value % 12)
                {
                    comboBoxTonic.SelectedIndex = i;
                }
            }

            comboBoxPitchTable.SelectedIndexChanged += ComboBoxPitchTable_SelectedIndexChanged;
        }