Cross Platform Application to allow control with a MIDI controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
656 B

// Author: Gockner, Simon
// Created: 2021-04-09
// Copyright(c) 2021 SimonG. All Rights Reserved.
using System.IO;
using System.Xml;
using System.Xml.Serialization;
using Lib.Driver.Interfaces;
using Lib.Driver.Xml;
namespace Lib.Driver
{
public class DriverLoader : IDriverLoader
{
public const string DRIVER_FILE_EXTENSION = "myd";
public IDriver? Load(string driverPath)
{
XmlReader xmlReader = XmlReader.Create(File.OpenRead(driverPath));
XmlSerializer xmlSerializer = new(typeof(XmlDriver));
return (XmlDriver?) xmlSerializer.Deserialize(xmlReader);
}
}
}