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
9 changes: 4 additions & 5 deletions Documentation/input/examples/render-customization/size.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Order: 1

<div class="description">
Normally the page layout scales automatically to the available width. If you
want to have a fixed width (e.g. for printing) the size can be specified via <code>width: 800</code> or <code>data-width="800"</code>
want to have a fixed width (e.g. for printing) the size of the parent container should be set accordingly.
</div>

<div>
Expand All @@ -15,20 +15,19 @@ Order: 1
<div class="tab-content">
<div class="tab-pane active example" id="scriptInit">
<div class="html">
<div id="alphaTabScriptInit"></div>
<div id="alphaTabScriptInit" style="width: 800px"></div>
</div>
<div class="js">
<script type="text/x-alphatab">
$('#alphaTabScriptInit').alphaTab({
file: '@Context.GetLink("/assets/files/player/Canon.gp5")',
width: 800
file: '@Context.GetLink("/assets/files/player/Canon.gp5")'
})
</script>
</div>
</div>
<div class="tab-pane example" id="dataInit">
<div class="html">
<div id="alphaTabDataInit" data-file="@Context.GetLink("/assets/files/player/Canon.gp5")" data-width="800"></div>
<div id="alphaTabDataInit" data-file="@Context.GetLink("/assets/files/player/Canon.gp5")" style="width: 800px"></div>
</div>
<div class="js">
<script type="text/x-alphatab">
Expand Down
32 changes: 32 additions & 0 deletions Documentation/input/reference/api/load.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,57 @@ Since: 0.9.4
<tr>
<td><code>bool Load(Score score) <span class="code-badge">.net</span></code> - Load the given score object</td>
</tr>
<tr>
<td><code>bool Load(Score score, int[] trackIndexes) <span class="code-badge">.net</span></code> - Load the given score object</td>
</tr>
<tr>
<td><code>bool Load(byte[] raw) <span class="code-badge">.net</span></code> - Load the score from the given raw bytes using the available score loaders</td>
</tr>
<tr>
<td><code>bool Load(byte[] raw, int[] trackIndexes) <span class="code-badge">.net</span></code> - Load the score from the given raw bytes using the available score loaders</td>
</tr>
<tr>
<td><code>void Load(Stream[] raw) <span class="code-badge">.net</span></code> - Load the score from the given stream using the available score loaders</td>
</tr>
<tr>
<td><code>void Load(Stream[] raw, int[] trackIndexes) <span class="code-badge">.net</span></code> - Load the score from the given stream using the available score loaders</td>
</tr>
<tr>
<td><code>function load(arraybuffer, trackIndexes) <span class="code-badge">JavaScript</span></code> - Load the score from the given raw bytes using the available score loaders</td>
</tr>
<tr>
<td><code>function load(arraybuffer) <span class="code-badge">JavaScript</span></code> - Load the score from the given raw bytes using the available score loaders</td>
</tr>
<tr>
<td><code>function load(uint8array) <span class="code-badge">JavaScript</span></code> - Load the score from the given raw bytes using the available score loaders</td>
</tr>
<tr>
<td><code>function load(uint8array, trackIndexes) <span class="code-badge">JavaScript</span></code> - Load the score from the given raw bytes using the available score loaders</td>
</tr>
<tr>
<td><code>function load(url) <span class="code-badge">JavaScript</span></code> - Load the score from the given URL via Ajax using the available score loaders</td>
</tr>
<tr>
<td><code>function load(url, trackIndexes) <span class="code-badge">JavaScript</span></code> - Load the score from the given URL via Ajax using the available score loaders</td>
</tr>
<tr>
<td><code>alphaTab('load', arraybuffer) <span class="code-badge">jQuery</span></code> - Load the score from the given raw bytes using the available score loaders</td>
</tr>
<tr>
<td><code>alphaTab('load', arraybuffer, trackIndexes) <span class="code-badge">jQuery</span></code> - Load the score from the given raw bytes using the available score loaders</td>
</tr>
<tr>
<td><code>alphaTab('load', uint8array) <span class="code-badge">jQuery</span></code> - Load the score from the given raw bytes using the available score loaders</td>
</tr>
<tr>
<td><code>alphaTab('load', uint8array, trackIndexes) <span class="code-badge">jQuery</span></code> - Load the score from the given raw bytes using the available score loaders</td>
</tr>
<tr>
<td><code>alphaTab('load', url) <span class="code-badge">jQuery</span></code> - Load the score from the given URL via Ajax using the available score loaders</td>
</tr>
<tr>
<td><code>alphaTab('load', url, trackIndexes) <span class="code-badge">jQuery</span></code> - Load the score from the given URL via Ajax using the available score loaders</td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -86,6 +113,11 @@ Since: 0.9.4
<td><code>string</code></td>
<td>A URL that should be loaded via AJAX and the passed on to the supported score loaders for importing.</td>
</tr>
<tr>
<td><code>trackIndexes <span class="code-badge">all</span></td>
<td><code>int[]</code></td>
<td>A indexes of the tracks that should be rendered after the track is loaded. If not supplied, the first song will be rendered.</td>
</tr>
</tbody>
</table>

Expand Down
95 changes: 95 additions & 0 deletions Documentation/input/reference/api/renderscore.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
Title: RenderScore()
JsName: renderScore()
jQueryName: alphaTab('renderScore')
Category: Methods - Core
Description: Initiates a rendering of the given score.
ShowInSideBar: false
Since: 0.9.4
---

<h2>Description</h2>
<p>
Initiates a rendering of the score.
</p>

<h2>Signatures</h2>

<table class="table table-striped table-condensed type-table">
<tbody>
<tr>
<td><code>bool RenderScore(Score score) <span class="code-badge">.net</span></td>
</tr>
<tr>
<td><code>bool RenderScore(Score score, int[] tracks) <span class="code-badge">.net</span></td>
</tr>
<tr>
<td><code>function renderScore(score, tracks) <span class="code-badge">JavaScript</span></td>
</tr>
<tr>
<td><code>function renderScore(tracks) <span class="code-badge">JavaScript</span></td>
</tr>
<tr>
<td><code>alphaTab('renderScore', tracks) <span class="code-badge">jQuery</span></td>
</tr>
<tr>
<td><code>alphaTab('renderScore', score, tracks) <span class="code-badge">jQuery</span></td>
</tr>
</tbody>
</table>

<h3>Parameters</h3>
<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>score <span class="code-badge">all</span></td>
<td><code>AlphaTab.Model.Score</code></td>
<td>The score that contains the tracks to be rendered.</td>
</tr>
<tr>
<td><code>tracks <span class="code-badge">all</span></td>
<td><code>AlphaTab.Model.Track[]</code></td>
<td>The indexes of the tracks that should be rendered. If not provided, the first track of the song will be rendered.</td>
</tr>
</tbody>
</table>


<h3>Returns</h3>
Nothing

<h2>Example - C#</h2>

<pre>
<code class="language-csharp line-numbers">
var api = new AlphaTabApi<MyControl>(...);
api.RenderScore(GenerateScore(), new [] { 2, 3 });
</code>
</pre>


<h2>Example - JavaScript</h2>

<pre>
<code class="language-javascript line-numbers">
var api = new alphaTab.platform.javaScript.AlphaTabApi(document.querySelector('#alphaTab'));
api.RenderScore(generateScore(),[ 2, 3 ]);
</code>
</pre>


<h2>Example - jQuery</h2>

<pre>
<code class="language-javascript line-numbers">
var at = $('#alphaTab');
var score = at.alphaTab('score');
at.alphaTab('renderScore', generateScore(), [ 2, 3 ]);
</code>
</pre>
41 changes: 20 additions & 21 deletions Documentation/input/reference/api/rendertracks.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,23 @@ ShowInSideBar: false
Since: 0.9.4
---


<h2>Description</h2>
<p>
Initiates a rendering of the given score and tracks.
Initiates a rendering of the tracks. All tracks must be from the same score, otherwise an error is raised.
</p>

<h2>Signatures</h2>

<table class="table table-striped table-condensed type-table">
<tbody>
<tr>
<td><code>bool RenderTracks(Score score, int[] tracks, bool invalidate = true) <span class="code-badge">.net</span></td>
<td><code>bool RenderTracks(Tracks[] track) <span class="code-badge">.net</span></td>
</tr>
<tr>
<td><code>function renderTracks(score, tracks, invalidate) <span class="code-badge">JavaScript</span></td>
<td><code>function renderTracks(tracks) <span class="code-badge">JavaScript</span></td>
</tr>
<tr>
<td><code>alphaTab('renderTracks', score, tracks, invalidate) <span class="code-badge">jQuery</span></td>
<td><code>alphaTab('renderTracks', tracks) <span class="code-badge">jQuery</span></td>
</tr>
</tbody>
</table>
Expand All @@ -39,21 +38,11 @@ Since: 0.9.4
</tr>
</thead>
<tbody>
<tr>
<td><code>score <span class="code-badge">all</span></td>
<td><code>AlphaTab.Model.Score</code></td>
<td>The score containing the tracks to be rendered.</td>
</tr>
<tr>
<td><code>tracks <span class="code-badge">all</span></td>
<td><code>int[]</code></td>
<td>The indexes of the tracks that should be rendered.</td>
</tr>
<tr>
<td><code>invalidate <span class="code-badge">all</span></td>
<td><code>bool</code></td>
<td>An optional value whether the rendering of the tracks should be initiated immediately or not.</td>
</tr>
<td><code>AlphaTab.Model.Track[]</code></td>
<td>The tracks that should be rendered.</td>
</tr>
</tbody>
</table>

Expand All @@ -66,7 +55,10 @@ Nothing
<pre>
<code class="language-csharp line-numbers">
var api = new AlphaTabApi<MyControl>(...);
api.RenderTracks(api.Score, new int[]{2,3}, true);
api.RenderTracks(new []{
api.Score.Tracks[2],
api.Score.Tracks[3]
});
</code>
</pre>

Expand All @@ -76,7 +68,10 @@ api.RenderTracks(api.Score, new int[]{2,3}, true);
<pre>
<code class="language-javascript line-numbers">
var api = new alphaTab.platform.javaScript.AlphaTabApi(document.querySelector('#alphaTab'));
api.renderTracks(api.Score, [2,3], true);
api.renderTracks([
api.score.tracks[2],
api.score.tracks[3]
]);
</code>
</pre>

Expand All @@ -86,6 +81,10 @@ api.renderTracks(api.Score, [2,3], true);
<pre>
<code class="language-javascript line-numbers">
var at = $('#alphaTab');
at.alphaTab('renderTracks', at.alphaTab('score'), [2,3], true);
var score = at.alphaTab('score');
at.alphaTab('renderTracks', [
api.score.tracks[2],
api.score.tracks[3]
]);
</code>
</pre>
2 changes: 1 addition & 1 deletion Documentation/input/reference/api/tracks.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Title: Tracks
JsName: get_Tracks
JsName: tracks
jQueryName: alphaTab('tracks')
Category: Properties - Core
Description: A list of the tracks that should be rendered based on the Score and TrackIndexes properties
Expand Down
68 changes: 0 additions & 68 deletions Documentation/input/reference/property/width.cshtml

This file was deleted.

4 changes: 2 additions & 2 deletions Samples/CSharp/AlphaTab.Samples.PngDump/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ private static void Main(string[] args)
// render score with svg engine and desired rendering width
var settings = Settings.Defaults;
settings.Engine = "skia";
settings.Width = 970;
var renderer = new ScoreRenderer(settings);
renderer.Width = 970;

// iterate tracks
for (int i = 0, j = score.Tracks.Count; i < j; i++)
Expand All @@ -46,7 +46,7 @@ private static void Main(string[] args)
totalWidth = (int)r.TotalWidth;
totalHeight = (int)r.TotalHeight;
};
renderer.Render(score, new[] { track.Index });
renderer.RenderScore(score, new[] { track.Index });

// write png
var info = new FileInfo(args[0]);
Expand Down
Loading