9 changed files with 102 additions and 4 deletions
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
use App\Wrappers\DatabaseInteractions; |
|||
use App\Wrappers\SQLQueryBuilderWrapper; |
|||
|
|||
$tuneDir = __DIR__ . '/../../../LocalStorage/Tunes'; |
|||
$targetTuneID = $_GET['tune-id']; |
|||
|
|||
|
|||
$data = (new DatabaseInteractions())->RunOneSelect( |
|||
queryBuilder: SQLQueryBuilderWrapper::SELECT_ONE( |
|||
table: 'Tunes', |
|||
id: $targetTuneID |
|||
) |
|||
->cols(cols: [ |
|||
'T.ABC', |
|||
]) |
|||
); |
|||
|
|||
/* |
|||
$filePath = "$tuneDir/$targetTuneID/primary.abc"; |
|||
$temp = file_get_contents(filename: $filePath); |
|||
*/ |
|||
|
|||
header(header: "Content-type: text/xml"); |
|||
echo $data['ABC']; |
|||
die(); |
@ -0,0 +1,32 @@ |
|||
|
|||
function RenderABC(containerID, targetTuneID) |
|||
{ |
|||
|
|||
API_GET("/V1/GetABCFile.php?tune-id=" + targetTuneID).then(payload => { |
|||
|
|||
ABCJS.renderAbc( |
|||
containerID, |
|||
payload, |
|||
{ |
|||
add_classes: true, |
|||
format: { |
|||
gchordfont: "Atkinson Hyperlegible", |
|||
annotationfont: "Atkinson Hyperlegible", |
|||
headerfont: "Atkinson Hyperlegible", |
|||
infofont: "Atkinson Hyperlegible", |
|||
repeatfont: "Atkinson Hyperlegible", |
|||
tempofont: "Atkinson Hyperlegible", |
|||
titlefont: "Atkinson Hyperlegible", |
|||
voicefont: "Atkinson Hyperlegible", |
|||
wordsfont: "Atkinson Hyperlegible", |
|||
} |
|||
} |
|||
); |
|||
|
|||
|
|||
|
|||
}) |
|||
.catch(error => { |
|||
console.log(error) |
|||
}); |
|||
} |
@ -0,0 +1,18 @@ |
|||
|
|||
|
|||
const API_SERVER = "http://localhost:1234/API"; |
|||
|
|||
|
|||
async function API_GET(target) { |
|||
try { |
|||
const response = await fetch(API_SERVER + target, { |
|||
method: 'GET', |
|||
headers: { |
|||
}, |
|||
credentials: 'include', |
|||
}); |
|||
return await response.text(); |
|||
} catch (error) { |
|||
return {error: error.message}; |
|||
} |
|||
} |
File diff suppressed because one or more lines are too long
@ -1,7 +1,11 @@ |
|||
{% extends "/Bases/StandardWebPage.html.twig" %} |
|||
|
|||
{% block content %} |
|||
<div class="InnerContent"> |
|||
<h1>{{ TuneDetails.Title }}</h1> |
|||
</div> |
|||
|
|||
<h1>{{ TuneDetails.Title }}</h1> |
|||
<div id="music-container"></div> |
|||
|
|||
<script> |
|||
RenderABC("music-container", '45e8cdc9-da6f-11ef-985c-00bf21dc3191'); |
|||
</script> |
|||
{% endblock %} |
Loading…
Reference in new issue