Esempio n. 1
0
        public InstrumentWindow(Registration registration, InstrObjectRec instrumentObject, IMainWindowServices mainWindow)
        {
            this.registration     = registration;
            this.instrumentObject = instrumentObject;
            this.mainWindow       = mainWindow;

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

            this.textBoxInstrumentBody.TextService = Program.Config.EnableDirectWrite ? TextEditor.TextService.DirectWrite : TextEditor.TextService.Uniscribe;
            this.textBoxInstrumentBody.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);
            instrObjectRecBindingSource.Add(instrumentObject);

            textBoxInstrumentName.TextChanged += new EventHandler(textBoxInstrumentName_TextChanged);
            GlobalNameChanged();

            registration.Register(instrumentObject, this);
        }
        /* make sure all instruments in list refer to existing samples and wave tables */
        /* all instruments should be up to date when this is called. */
        public static SynthErrorCodes CheckInstrListForUnreferencedSamples(
            IList <InstrObjectRec> InstrList,
            CheckUnrefParamRec Param)
        {
            for (int Scan = 0; Scan < InstrList.Count; Scan += 1)
            {
                InstrObjectRec  InstrObject          = InstrList[Scan];
                InstrumentRec   InstrumentDefinition = InstrObject.BuiltInstrument;
                SynthErrorCodes Error = CheckInstrumentForUnreferencedSamples(
                    InstrumentDefinition,
                    Param);
                if (Error != SynthErrorCodes.eSynthDone)
                {
                    Param.ErrorInfo.InstrumentName = InstrObject.Name;
                    return(Error);
                }
            }

            return(SynthErrorCodes.eSynthDone);
        }
 protected override object Load(BinaryReader reader, Document document)
 {
     instrument = new InstrObjectRec(reader, new LoadContext(Document.CurrentFormatVersionNumber, document, LoadContextState.Paste));
     return(instrument);
 }
 public InstrumentClipboard(InstrObjectRec instrument, Document document)
     : base(document)
 {
     this.instrument = instrument;
 }