Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>

<Version>0.9.6</Version>
<AssemblyVersion>0.9.6.0</AssemblyVersion>
<FileVersion>0.9.6.0</FileVersion>
<Version>0.9.7</Version>
<AssemblyVersion>0.9.7.0</AssemblyVersion>
<FileVersion>0.9.7.0</FileVersion>
<Authors>Danielku15</Authors>
<Company>CoderLine</Company>
<Product>AlphaTab</Product>
<NeutralLanguage>en</NeutralLanguage>
<Description>alphaTab is a cross platform music notation and guitar tablature rendering library.</Description>
<Copyright>Copyright © 2019, Daniel Kuschny and Contributors</Copyright>
<Copyright>Copyright © 2020, Daniel Kuschny and Contributors</Copyright>
<PackageLicenseExpression>MPL-2.0</PackageLicenseExpression>
<PackageProjectUrl>https://www.alphatab.net</PackageProjectUrl>
<RepositoryUrl>https://github.com/CoderLine/alphaTab</RepositoryUrl>
Expand Down
102 changes: 102 additions & 0 deletions Documentation/input/reference/events/beatmousedown.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
Title: BeatMouseDown
JsName: addBeatMouseDown();removeBeatMouseDown()
DomName: alphaTab.beatMouseDown
Category: Events - Player
Description: This event is fired whenever a the user presses the mouse button on a beat.
ShowInSideBar: false
Since: 0.9.7
---

<h2>Description</h2>
<p>
@Html.Raw(Model.String(DocsKeys.Description))
</p>

<h2>Types</h2>

<table class="table table-striped table-condensed type-table">
<tbody>
<tr>
<td><code class="code-badge code-badge-net">Action&lt;Beat&gt; <span>.net</span></code></td>
</tr>
<tr>
<td><code class="code-badge code-badge-js">function(e) <span>JavaScript</span></code></td>
</tr>
</tbody>
</table>

<h2>Parameters</h2>

<table class="table table-striped table-condensed type-table">
<thead>
<tr>
<th>Parameters</th>
<th>Type</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="code-badge code-badge-all">args <span>all</span></code></td>
<td><code>AlphaTab.Model.Beat</code></td>
<td>
Beat on which the mouse was pressed.
</td>
</tr>
<tr>
<td><code class="code-badge code-badge-jquery">originalEvent <span>jQuery</span></code></td>
<td><code>MouseEvent</code></td>
<td>
The original mouse event that lead to trigger of the beat event. For the DOM event it is stored in the <code>event.originalEvent</code>
</td>
</tr>
</tbody>
</table>

<h2>Example - C#</h2>

<pre>
<code class="language-csharp line-numbers">
var api = new AlphaTabApi<MyControl>(...);
api.BeatMouseDown += beat =>
{
StartSelectionOnBeat(args);
};
</code>
</pre>


<h2>Example - JavaScript</h2>

<pre>
<code class="language-javascript line-numbers">
var api = new alphaTab.platform.javaScript.AlphaTabApi(document.querySelector('#alphaTab'));
api.addBeatMouseDown(function(beat) {
startSelectionOnBeat(beat);
});

</code>
</pre>

<h2>Example - jQuery</h2>

<pre>
<code class="language-javascript line-numbers">
$('#alphaTab').on('alphaTab.beatMouseDown', function(e, beat) {
originalEvent.preventDefault();
startSelectionOnBeat(beat);
});
</code>
</pre>

<h2>Example - HTML</h2>

<pre>
<code class="language-javaScript line-numbers">
document.querySelector('#alphaTab').addEventListener('alphaTab.beatMouseDown', function(e) {
var beat = e.detail;
e.originalEvent.preventDefault();
startSelectionOnBeat(beat);
}, false);
</code>
</pre>
102 changes: 102 additions & 0 deletions Documentation/input/reference/events/beatmousemove.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
Title: BeatMouseMove
JsName: addBeatMouseMove();removeBeatMouseMove()
DomName: alphaTab.beatMouseMove
Category: Events - Player
Description: This event is fired whenever the user moves the mouse over a beat after the user already pressed the button on a beat.
ShowInSideBar: false
Since: 0.9.7
---

<h2>Description</h2>
<p>
@Html.Raw(Model.String(DocsKeys.Description))
</p>

<h2>Types</h2>

<table class="table table-striped table-condensed type-table">
<tbody>
<tr>
<td><code class="code-badge code-badge-net">Action&lt;Beat&gt; <span>.net</span></code></td>
</tr>
<tr>
<td><code class="code-badge code-badge-js">function(e) <span>JavaScript</span></code></td>
</tr>
</tbody>
</table>

<h2>Parameters</h2>

<table class="table table-striped table-condensed type-table">
<thead>
<tr>
<th>Parameters</th>
<th>Type</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="code-badge code-badge-all">args <span>all</span></code></td>
<td><code>AlphaTab.Model.Beat</code></td>
<td>
Beat on which the mouse was hovered over during mouse down.
</td>
</tr>
<tr>
<td><code class="code-badge code-badge-jquery">originalEvent <span>jQuery</span></code></td>
<td><code>MouseEvent</code></td>
<td>
The original mouse event that lead to trigger of the beat event. For the DOM event it is stored in the <code>event.originalEvent</code>
</td>
</tr>
</tbody>
</table>

<h2>Example - C#</h2>

<pre>
<code class="language-csharp line-numbers">
var api = new AlphaTabApi<MyControl>(...);
api.BeatMouseMove += beat =>
{
ExpandSelectionToBeat(beat);
};
</code>
</pre>


<h2>Example - JavaScript</h2>

<pre>
<code class="language-javascript line-numbers">
var api = new alphaTab.platform.javaScript.AlphaTabApi(document.querySelector('#alphaTab'));
api.addBeatMouseMove(function(beat) {
expandSelectionToBeat(beat);
});

</code>
</pre>

<h2>Example - jQuery</h2>

<pre>
<code class="language-javascript line-numbers">
$('#alphaTab').on('alphaTab.beatMouseMove', function(e, beat) {
originalEvent.preventDefault();
expandSelectionToBeat(beat);
});
</code>
</pre>

<h2>Example - HTML</h2>

<pre>
<code class="language-javaScript line-numbers">
document.querySelector('#alphaTab').addEventListener('alphaTab.beatMouseMove', function(e) {
var beat = e.detail;
e.originalEvent.preventDefault();
expandSelectionToBeat(beat);
}, false);
</code>
</pre>
106 changes: 106 additions & 0 deletions Documentation/input/reference/events/beatmouseup.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
Title: BeatMouseUp
JsName: addBeatMouseUp();removeBeatMouseUp()
DomName: alphaTab.beatMouseUp
Category: Events - Player
Description: This event is fired whenever the user releases the mouse after a mouse press on a beat.

ShowInSideBar: false
Since: 0.9.7
---

<h2>Description</h2>
<p>
@Html.Raw(Model.String(DocsKeys.Description))
This event is fired regardless of whether the mouse was released on a beat.
The parameter is null if the mouse was released somewhere beside the beat.
</p>

<h2>Types</h2>

<table class="table table-striped table-condensed type-table">
<tbody>
<tr>
<td><code class="code-badge code-badge-net">Action&lt;Beat&gt; <span>.net</span></code></td>
</tr>
<tr>
<td><code class="code-badge code-badge-js">function(e) <span>JavaScript</span></code></td>
</tr>
</tbody>
</table>

<h2>Parameters</h2>

<table class="table table-striped table-condensed type-table">
<thead>
<tr>
<th>Parameters</th>
<th>Type</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
<tr>
<td><code class="code-badge code-badge-all">args <span>all</span></code></td>
<td><code>AlphaTab.Model.Beat</code></td>
<td>
Beat on which the mouse was released over after mouse down.
Might be null if no beat could be found in near location.
</td>
</tr>
<tr>
<td><code class="code-badge code-badge-jquery">originalEvent <span>jQuery</span></code></td>
<td><code>MouseEvent</code></td>
<td>
The original mouse event that lead to trigger of the beat event. For the DOM event it is stored in the <code>event.originalEvent</code>
</td>
</tr>
</tbody>
</table>

<h2>Example - C#</h2>

<pre>
<code class="language-csharp line-numbers">
var api = new AlphaTabApi<MyControl>(...);
api.BeatMouseUp += beat =>
{
HideSelection(beat);
};
</code>
</pre>


<h2>Example - JavaScript</h2>

<pre>
<code class="language-javascript line-numbers">
var api = new alphaTab.platform.javaScript.AlphaTabApi(document.querySelector('#alphaTab'));
api.addBeatMouseUp(function(beat) {
hideSelection(beat);
});

</code>
</pre>

<h2>Example - jQuery</h2>

<pre>
<code class="language-javascript line-numbers">
$('#alphaTab').on('alphaTab.beatMouseUp', function(e, beat) {
originalEvent.preventDefault();
hideSelection(beat);
});
</code>
</pre>

<h2>Example - HTML</h2>

<pre>
<code class="language-javaScript line-numbers">
document.querySelector('#alphaTab').addEventListener('alphaTab.beatMouseUp', function(e) {
var beat = e.detail;
e.originalEvent.preventDefault();
hideSelection(beat);
}, false);
</code>
</pre>
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Title: Player.EnableUserInteraction
JsName: player.enableUserInteraction
JsonName: player.enableUserInteraction
DataAttribute: data-player-enableuserinteraction
Category: Player
Description: Gets or sets whether the player should be enabled.
ShowInSideBar: false
Since: 0.9.6
---

<h2>Description</h2>
<p>
This setting configures whether alphaTab provides the default user interaction features like selection of the playback range and "seek on click".
By default users can select the desired playback range with the mouse and also jump to individual beats by click. This behavior can be contolled w1ith this setting.
</p>

@Html.Partial("_PropertyDescription", Model)

<h2>Types</h2>

<table class="table table-striped table-condensed type-table">
<tbody>
<tr>
<td><code>bool</code></td>
</tr>
</tbody>
</table>

<h2>Default Value</h2>

<code>true</code>
2 changes: 1 addition & 1 deletion Source/AlphaTab.CSharp/Platform/CSharp/ManagedUiFacade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public IAlphaSynth CreateWorkerPlayer()
public abstract event Action RootContainerBecameVisible;
public abstract void Destroy();
public abstract IContainer CreateCanvasElement();
public abstract void TriggerEvent(IContainer container, string eventName, object details = null);
public abstract void TriggerEvent(IContainer container, string eventName, object details = null, IMouseEventArgs originalEvent = null);

public virtual void InitialRender()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public override IContainer CreateCanvasElement()
return new ControlContainer(_layoutPanel);
}

public override void TriggerEvent(IContainer container, string eventName, object details = null)
public override void TriggerEvent(IContainer container, string eventName, object details = null, IMouseEventArgs originalEvent = null)
{
}

Expand Down
2 changes: 1 addition & 1 deletion Source/AlphaTab.CSharp/Platform/CSharp/Wpf/WpfUiFacade.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public override IContainer CreateCanvasElement()
return new FrameworkElementContainer(canvas);
}

public override void TriggerEvent(IContainer container, string eventName, object details = null)
public override void TriggerEvent(IContainer container, string eventName, object details = null, IMouseEventArgs originalEvent = null)
{
}

Expand Down
Loading