-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #196 from calibx/develop
2.3.0
- Loading branch information
Showing
15 changed files
with
353 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
namespace Loupedeck.MsfsPlugin | ||
{ | ||
using System; | ||
|
||
using Loupedeck.MsfsPlugin.encoder; | ||
using Loupedeck.MsfsPlugin.tools; | ||
|
||
class SimRateEncoder : DefaultEncoder | ||
{ | ||
public SimRateEncoder() : base("Sim Rate", "Simulation rate encoder", "Misc", true, 0, 128, 1) => this._bindings.Add(MsfsData.Instance.Register(new Binding(BindingKeys.SIM_RATE))); | ||
protected override void RunCommand(String actionParameter) => this.SetValue(0); | ||
protected override Int64 GetValue() => this._bindings[0].ControllerValue; | ||
protected override String GetDisplayValue() => this._bindings[0].ControllerValue.ToString(); | ||
protected override void SetValue(Int64 newValue) => this._bindings[0].SetControllerValue(newValue); | ||
protected override void ApplyAdjustment(String actionParameter, Int32 ticks) | ||
{ | ||
if (ticks > 0) | ||
{ | ||
var newValue = this.GetValue() * 2; | ||
this.SetValue(newValue > 128 ? 128 : newValue); | ||
} else | ||
{ | ||
this.SetValue(this.GetValue() / 2); | ||
} | ||
this.ActionImageChanged(); | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.