From e03709fa1173ed357672583b0eb554eda77c2d5f Mon Sep 17 00:00:00 2001 From: Cerys Date: Sat, 8 Mar 2025 21:56:02 +0000 Subject: [PATCH] hgffghfrghertyherhytdtyhj --- Pages/profile.php | 3 +++ Public/API/V1/GetMIDIFile.php | 22 ++++++++++++++++++++++ Public/Static/CSS/Elements/Rating.css | 2 -- Public/Static/JS/ThirdParty/midijs.js | 2 ++ Templates/Pages/tune/uuid.html.twig | 10 ++++------ 5 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 Public/API/V1/GetMIDIFile.php create mode 100644 Public/Static/JS/ThirdParty/midijs.js diff --git a/Pages/profile.php b/Pages/profile.php index 1c140da..f7aac43 100644 --- a/Pages/profile.php +++ b/Pages/profile.php @@ -16,6 +16,9 @@ $yourTunes = $db->RunSelect( table: 'Tunes' ) ->where(cond: 'T.CreatedBy LIKE :__user_id__') + ->orderBy(spec: [ + 'T.Title ASC', + ]) ->bindValue(name: '__user_id__', value: SessionWrapper::Get(target: SessionElement::USER_ID)) ); diff --git a/Public/API/V1/GetMIDIFile.php b/Public/API/V1/GetMIDIFile.php new file mode 100644 index 0000000..3fb0f02 --- /dev/null +++ b/Public/API/V1/GetMIDIFile.php @@ -0,0 +1,22 @@ +RunOneSelect( + queryBuilder: SQLQueryBuilderWrapper::SELECT_ONE( + table: 'Tunes', + id: $targetTuneID + ) +); + +header(header: "Content-type: audio/midi"); +echo $tuneDetails['MIDIData']; +die(); diff --git a/Public/Static/CSS/Elements/Rating.css b/Public/Static/CSS/Elements/Rating.css index 8cc3bdc..b9578f5 100644 --- a/Public/Static/CSS/Elements/Rating.css +++ b/Public/Static/CSS/Elements/Rating.css @@ -1,6 +1,4 @@ #RatingContainer { - text-align: center; - font-family: Arial, sans-serif; } .RatingButtons { diff --git a/Public/Static/JS/ThirdParty/midijs.js b/Public/Static/JS/ThirdParty/midijs.js new file mode 100644 index 0000000..5b440d6 --- /dev/null +++ b/Public/Static/JS/ThirdParty/midijs.js @@ -0,0 +1,2 @@ +!function(t){try{t.MIDIjs=new Object,t.MIDIjs.initError="initializing ...";var n,s,l,u,r,d,c=6,m=null,p=0,o=32768,f=8192,g=0,a=0,I=0,b=!1,M="",w=-1,j="",y=!1,v=0,h=!1,_=100,D=null,A=null,k="libtimidity-for-worklet.js?v="+c,x=null,O=new Array,C=440,E=new Int32Array(128),T=Math.pow(2,1/12);function R(e){var t=0;return void 0!==e&&(!0===e?t=-1:!isNaN(e)&&0',document.body&&document.body.appendChild(e)),d=setInterval(z,_),w=-1,p=e,Y("Playing "+url+" ...")}function J(){p&&(p.lastChild.setAttribute("src",G(M)+"../midi/silence.mid"),clearInterval(d),p=0),Y(j)}function K(){var e;p&&((e=p).parentNode.removeChild(e),clearInterval(d),p=0),Y(j)}function Q(e,t,n){var r=Module._malloc(t.length);Module.writeArrayToMemory(t,r);Module.ccall("mid_init","number",[],[]);var o=Module.ccall("mid_istream_open_mem","number",["number","number","number"],[r,t.length,!1]),t=Module.ccall("mid_create_options","number",["number","number","number","number"],[44100,32784,1,2*f]),t=Module.ccall("mid_song_load","number",["number","number"],[o,t]),o=(Module.ccall("mid_istream_close","number",["number"],[o]),Module.ccall("mid_song_get_total_time","number",["number"],[t])/1e3);Module.ccall("mid_song_free","void",["number"],[t]),Module._free(r),n&&n(o)}function Y(){if(h){for(var e=new Array("[midijs] "),t=0;t>4?V(M+"../midi/init.midi?v="+c,function(e,t,n){Y("Got MIDI data from URL: "+e),t[43]=a;var r=new Object;r.type="prepare-player",r.url=e,r.midiDataArray=t,r.sampleRate=m.sampleRate,r.isEndless=!0,r.looping=!1,A.port.postMessage(r),(r=new Object).type="midi-message",r.status=o,r.a=a,r.b=i,A.port.postMessage(r)},function(){}):((e=new Object).type="midi-message",e.status=o,e.a=a,e.b=i,A.port.postMessage(e))}function te(e,t,n){A||ne(),"suspended"===m.state?m.resume().then(function(){x.then(function(){ee(e,t,n)})}):x.then(function(){ee(e,t,n)})}function ne(e){var a;A||(m||(window.AudioContext=window.AudioContext||window.webkitAudioContext,m=new AudioContext),a=null,x=new Promise(function(e){a=e}),m.audioWorklet.addModule(M+k).then(function(){A=new AudioWorkletNode(m,"midijs-audio-worklet");var e=new Object;e.type="set-logging",e.logging=h,A.port.postMessage(e),A.connect(m.destination),A.port.onmessage=function(e){var t=e.data;if(Y("Request from worklet: ",t),"get-patches"==t.type){var n=t.patches;if(0==(g=n.length)){e=new Object;e.type="start-player",e.url=M+"../midi/init-expander.midi?v="+c,A.port.postMessage(e)}else for(var r=0;r',document.body&&document.body.appendChild(t)),d=setInterval(z,_),w=-1,p=t,Y("Playing "+e+" ...")},t.MIDIjs.stop=K,"audioMethod: <object>"):(t.MIDIjs.play=function(e){},t.MIDIjs.stop=function(e){},"audioMethod: No method found"),"Microsoft Internet Explorer"==me.browserName&&"https:"==location.protocol.toLowerCase()&&setTimeout(function(){X(G(M)+"../midi/silence.mid"),clearInterval(d)},1),-1==location.href.indexOf("scorio.com")&&-1==location.href.indexOf("weblily.net")&&-1==location.href.indexOf("local")||"WebAudioWorklet"==n&&ne(),t.MIDIjs.initError=null}catch(ve){t.MIDIjs=new Object,t.MIDIjs.initError=ve}var fe,ge,Ie,be,Me,we}(this); +//# sourceMappingURL=https://midijs.intern.scorio.com/lib/midi.js.map \ No newline at end of file diff --git a/Templates/Pages/tune/uuid.html.twig b/Templates/Pages/tune/uuid.html.twig index ee1c903..fbb0c2e 100644 --- a/Templates/Pages/tune/uuid.html.twig +++ b/Templates/Pages/tune/uuid.html.twig @@ -3,6 +3,9 @@ {% block content %} + + + @@ -43,18 +46,13 @@

{{ "Audio"|translate }}

-
+

{{ "Tune Overview"|translate }}

-
{{ "Time Signature"|translate }}
-
{{ TuneDetails.TimeSignature }}
- -
{{ "Key Signature"|translate }}
-
{{ TuneDetails.KeySignature }}
{{ "Copyright"|translate }}
{{ TuneDetails.Copyright }}