Files
tbd-station-14/Content.Shared/GameObjects/Components/Instruments/SharedInstrumentComponent.cs
Víctor Aguilera Puerto fedc0ad71c Adds playable instruments, IDropped, IHandSelected and IHandDese… (#368)
* Instrument test.

* Midi stuff

* Some more work

* This actually works now!

* update

* Midi Audio works!

* Lots of stuff, and cool interfaces for items

* Update

* Fix a few things

* It just works

* Move textures to another folder, remove placeholder description from instruments

* Fix warning

* Use renderer enum

* Instruments now use DisposeRenderer method, and send MidiEvents as they receive them. Deletes InstrumentSystem whoo.

* Fix incorrect sprite paths

* Instruments take midi file size check into account when enabling/disabling midi playback buttons

* Fix crash when pressing drop on empty hand.

* Use new renderer return values for midi/input

* Xylophones are no longer handheld instruments, fix their sprites.

* Use new API

* Remove nfluidsynth from solution

* Timing information

* Use IGameTiming.CurTime for timestamps instead
2019-11-25 00:11:47 +01:00

45 lines
1.1 KiB
C#

using System;
using Robust.Shared.Audio.Midi;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization;
namespace Content.Shared.GameObjects.Components.Instruments
{
public class SharedInstrumentComponent : Component
{
public override string Name => "Instrument";
public override uint? NetID => ContentNetIDs.INSTRUMENTS;
}
/// <summary>
/// This message is sent to the client to completely stop midi input and midi playback.
/// </summary>
[Serializable, NetSerializable]
public class InstrumentStopMidiMessage : ComponentMessage
{
}
/// <summary>
/// This message carries a MidiEvent to be played on clients.
/// </summary>
[Serializable, NetSerializable]
public class InstrumentMidiEventMessage : ComponentMessage
{
public MidiEvent MidiEvent;
public double Timestamp;
public InstrumentMidiEventMessage(MidiEvent midiEvent, double timestamp)
{
MidiEvent = midiEvent;
Timestamp = timestamp;
}
}
[NetSerializable, Serializable]
public enum InstrumentUiKey
{
Key,
}
}