Esempio n. 1
0
        public static MidiThruConnection Create(string persistentOwnerID, MidiThruConnectionParams connectionParams, out MidiError error)
        {
            MidiThruConnectionRef ret;

            using (var data = connectionParams.WriteStruct ()) {
                var retStr = NSString.CreateNative (persistentOwnerID);
                error = MIDIThruConnectionCreate (retStr, data.Handle, out ret);
                NSString.ReleaseNative (retStr);
            }

            if (error != MidiError.Ok)
                return null;

            return new MidiThruConnection (ret);
        }
Esempio n. 2
0
        public MidiError SetParams(MidiThruConnectionParams connectionParams)
        {
            if (Handle == InvalidRef)
            {
                throw new ObjectDisposedException("MidiThruConnection");
            }
            if (connectionParams == null)
            {
                throw new ArgumentNullException(nameof(connectionParams));
            }

            using (var data = connectionParams.WriteStruct()) {
                var error = MIDIThruConnectionSetParams(Handle, data.Handle);
                return(error);
            }
        }
Esempio n. 3
0
        public static MidiThruConnection Create(string persistentOwnerID, MidiThruConnectionParams connectionParams, out MidiError error)
        {
            MidiThruConnectionRef ret;

            using (var data = connectionParams.WriteStruct()) {
                var retStr = NSString.CreateNative(persistentOwnerID);
                error = MIDIThruConnectionCreate(retStr, data.Handle, out ret);
                NSString.ReleaseNative(retStr);
            }

            if (error != MidiError.Ok)
            {
                return(null);
            }

            return(new MidiThruConnection(ret));
        }
Esempio n. 4
0
        public MidiError SetParams(MidiThruConnectionParams connectionParams)
        {
            if (Handle == InvalidRef)
                throw new ObjectDisposedException ("MidiThruConnection");
            if (connectionParams == null)
                throw new ArgumentNullException (nameof (connectionParams));

            using (var data = connectionParams.WriteStruct ()) {
                var error = MIDIThruConnectionSetParams (Handle, data.Handle);
                return error;
            }
        }