Skip to content

Commit

Permalink
added grand master, fixed save/load bug
Browse files Browse the repository at this point in the history
  • Loading branch information
martin31821 committed Mar 22, 2015
1 parent a143181 commit 73a79ed
Show file tree
Hide file tree
Showing 10 changed files with 244 additions and 279 deletions.
104 changes: 104 additions & 0 deletions MidiKernelHelper/GrandMasterPatch.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using org.dmxc.lumos.Kernel.Resource;
using org.dmxc.lumos.Kernel.Run;
using org.dmxc.lumos.Kernel.Master;
using LumosLIB.Tools;
using System.Collections.ObjectModel;
using org.dmxc.lumos.Kernel.Messaging;
using org.dmxc.lumos.Kernel.Messaging.Producer;
using org.dmxc.lumos.Kernel.Messaging.Message;

namespace MidiKernelHelper
{
public sealed class MasterManagerPatch : AbstractManagerAndService, IMasterManager, IIntensityMaster, ILumosProjectManager, ILumosManager, IManager, IMessageProducer
{
private static readonly MasterManagerPatch instance = new MasterManagerPatch();
private double _intensity = 1.0;
public string Name
{
get
{
return "Grand Master Patch";
}
set
{
}
}
public event LumosMessageEvent IntensityChanged;
public double MasterIntensity
{
get
{
return this._intensity;
}
set
{
this._intensity = value.Limit(0.0, 1.0);
var message = new GenericMessage("MasterIntensityChanged",this._intensity);
if (IntensityChanged != null) IntensityChanged(message);
}
}
ELoadTime ILumosProjectManager.LoadTime
{
get
{
return ELoadTime.AFTER_CONTAINERS;
}
}
bool ILumosProjectManager.Dirty
{
get
{
return false;
}
}
ReadOnlyCollection<Type> IManager.ManagerDependencies
{
get
{
List<Type> t = new List<Type>();
return t.AsReadOnly();
}
}
public MasterManagerPatch()
{
}

void ILumosProjectManager.closeProject(LumosIOContext context)
{
}
void ILumosProjectManager.loadProject(LumosIOContext context)
{
}
void ILumosProjectManager.saveProject(LumosIOContext context)
{
}
void IManager.initialize()
{
this.initializeManager();
}
void IManager.shutdown()
{
this.shutdownManager();
}
bool IManager.IsInitialized
{
get
{
return base.IsInitialized;
}
}

string IMessageProducer.ProducerID
{
get
{
return "GrandMaster";
}
}
}

}
70 changes: 70 additions & 0 deletions MidiKernelHelper/MidiKernelHelper.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{FC2A4D0D-94E9-4634-8C0D-26B71EE7938B}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MidiKernelHelper</RootNamespace>
<AssemblyName>MidiKernelHelper</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="Lumos">
<HintPath>..\..\..\..\..\..\Program Files (x86)\DMXControl3\Kernel\Lumos.exe</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="LumosLIB">
<HintPath>..\..\..\..\..\..\Program Files (x86)\DMXControl3\Kernel\LumosLIB.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="GrandMasterPatch.cs" />
<Compile Include="MidiKernelPlugin.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PostBuildEvent>copy /Y "$(TargetDir)$(TargetFileName)" "C:\Program Files (x86)\DMXControl3\Kernel\Plugins"</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
36 changes: 36 additions & 0 deletions MidiKernelHelper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("MidiKernelHelper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MidiKernelHelper")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("fc2a4d0d-94e9-4634-8c0d-26b71ee7938b")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
5 changes: 3 additions & 2 deletions MidiPlugin.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<RunPostBuildEvent>Always</RunPostBuildEvent>
</PropertyGroup>
<ItemGroup>
<Reference Include="LumosGUI">
<HintPath>..\..\..\..\..\Program Files (x86)\DMXControl3\GUI\LumosGUI.exe</HintPath>
Expand Down Expand Up @@ -84,8 +87,6 @@
<Compile Include="MidiPlugin\ToolStripDeviceRuleButton.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="MidiPlugin\Utilities\CLRInjector.cs" />
<Compile Include="MidiPlugin\Utilities\ExecutorHelper.cs" />
<Compile Include="MidiPlugin\Utilities\ExecutorWindowHelper.cs" />
<Compile Include="MidiPlugin\Utilities\Extensions.cs" />
<Compile Include="MidiPlugin\Utilities\InputLayerManagementHelper.cs" />
Expand Down
4 changes: 2 additions & 2 deletions MidiPlugin.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
# Visual Studio 14
VisualStudioVersion = 14.0.22310.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MidiPlugin", "MidiPlugin.csproj", "{96081B63-3B59-4F0F-9754-77042768B7C2}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion MidiPlugin/DeviceRule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace MidiPlugin
{
public abstract class DeviceRule : ILearnable, IProcessable, ISave, IBacktrack
{
private string name;
private string name = ""; //set name to "" to ensure it won't get null
public event EventHandler NameChanged;
public event EventHandler<ValueChangedEventArgs> ValueChanged;
public event EventHandler<MidiEventArgs> MidiMessageSend;
Expand Down
20 changes: 8 additions & 12 deletions MidiPlugin/MidiPlugin.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
using Lumos.GUI;
using Lumos.GUI.Connection;
using Lumos.GUI.Plugin;
using Lumos.GUI.Resource;
using Lumos.GUI.Run;
using Lumos.GUI.Settings;
using Lumos.GUI.Settings.PE;
using Lumos.GUI.Windows;
using LumosLIB.Kernel.Log;
using org.dmxc.lumos.Kernel.Messaging.Listener;
using org.dmxc.lumos.Kernel.Messaging.Message;
using org.dmxc.lumos.Kernel.Resource;
using System;
using System.Collections.Generic;
using org.dmxc.lumos.Kernel.Input;
using org.dmxc.lumos.Kernel.Messaging.Listener;
using Lumos.GUI.Connection;
using org.dmxc.lumos.Kernel.Messaging.Message;
using org.dmxc.lumos.Kernel.Executor;
using System.Xml.Linq;
using System.Windows.Forms;
using System.Reflection;
using System.Linq;
using Lumos.GUI.Windows;
using Lumos.GUI.Settings;
using Lumos.GUI.Settings.PE;
using System.Xml.Linq;
namespace MidiPlugin
{
public class MidiPlugin : GuiPluginBase, IMessageListener
public class MidiPlugin : GuiPluginBase, IMessageListener
{
public org.dmxc.lumos.Kernel.Input.IInputLayerManager interfacedILM;
public Type interfacedILMType;
Expand Down
Loading

0 comments on commit 73a79ed

Please sign in to comment.