-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathindex.php
139 lines (130 loc) · 5.64 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!--
(c) 2012-2021 Noora Halme et al. (see AUTHORS)
This code is licensed under the MIT license:
http://www.opensource.org/licenses/mit-license.php
Main index file
-->
<?php
///////////////////
// configuration
//
// when entering the website without a mod selected, the site will randomly pick one from
// the array below
$defmods=array(
"Necros/point_of_departure.s3m",
"Mantronix_and_Tip/mod.overload",
"Jugi/we_go.xm"
);
// absolute URL path to where the modules are located - leading and trailing slashes are required!
$modulePath="/mods/";
//
//
///////////////////
?>
<html>
<head>
<title>MOD/S3M/XM module player for Web Audio</title>
<meta name="description" content="A MOD/S3M/XM module player in Javascript using the Web Audio API.">
<link rel="stylesheet" href="/style.css" type="text/css" media="screen" />
<script src="https://code.jquery.com/jquery-2.1.1.js"></script>
<?php
$browserAsString = $_SERVER['HTTP_USER_AGENT'];
if (strstr($browserAsString, " AppleWebKit/") && strstr($browserAsString, " Mobile/"))
{
echo " <script type=\"text/javascript\">var mobileSafari=true;</script>";
} else {
echo " <script type=\"text/javascript\">var mobileSafari=false;</script>";
}
?>
<script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="/js/player.js"></script>
<script type="text/javascript" src="/js/pt.js"></script>
<script type="text/javascript" src="/js/st3.js"></script>
<script type="text/javascript" src="/js/ft2.js"></script>
<script type="text/javascript" src="/js/ui.js"></script>
<script type="text/javascript">
window.musicPath='<?php echo $modulePath; ?>';
window.musicLibrary=[];
<?php
// randomize default song
$defmod=$defmods[rand(0, count($defmods)-1)];
if (array_key_exists('mod', $_REQUEST) && $_REQUEST['mod']!="") $defmod=$_REQUEST['mod'];
if (array_key_exists('composer', $_REQUEST) && $_REQUEST['composer']!="") {
echo " window.currentModule='';\n";
echo " window.defaultComposer='".$_REQUEST['composer']."';\n";
} else {
echo " window.currentModule='".$defmod."';\n";
echo " window.defaultComposer='';\n";
}
?>
</script>
</head>
<body>
<div id="outercontainer">
<div id="headercontainer">
<div style="margin-left:8px;float:left">MOD/S3M/XM module player for Web Audio</div>
<div style="margin-right:8px;float:right">(c) 2012-2021 Firehawk/<a class="tdalink" href="http://tda.haxor.fi/" target="_blank">TDA</a></div>
<div style="clear:both;"></div>
</div>
<div id="innercontainer">
<div id="modsamples"><?php for($i=0;$i<31;$i++) echo "\n"; ?></div>
<div style="position:relative;top:8px;margin-bottom:8px;">
<span id="modtitle"><?php for($i=0;$i<28;$i++) echo " "; ?></span>
<span id="modinfo">(' ')</span>
<span id="modtimer"></span>
<br/><br/>
<a class="inactive" href="#" id="prev_track">[|<]</a>
<a href="#" id="go_back">[<<]</a>
<a href="#" id="play">[play]</a>
<a href="#" id="pause">[pause]</a>
<a href="#" id="go_fwd">[>>]</a>
<a class="inactive" href="#" id="next_track">[>|]</a>
<span style="white-space:pre;"> </span>
<a href="#" title="Repeat song" id="modrepeat">[rept]</a>
<a class="down" title="Stereo separation" href="#" id="modpaula">[)oo(]</a>
<a class="down" title="Visualization type" href="#" id="modvis">[trks]</a>
<a title="Amiga A500 lowpass filter" href="#" id="modamiga">[filt]</a>
<span style="white-space:pre;"> </span>
<a title="Load song or edit playlist" href="#" id="load_song">[load song]</a>
</div>
<div id="modchannels"><div id="even-channels"></div><div id="odd-channels"></div></div>
<div id="modpattern"></div>
<div style="clear:both"></div>
<div id="infotext">
The player has been tested on Chrome 14+, Firefox 24+, Safari 6+ and Edge 20+ so far. <span style="color:#faa">Disable AdBlock if you get cuts or stuttering!</span>
Source code available on <a style="color:#cce;" target="_blank" href="https://github.com/electronoora/webaudio-mod-player">GitHub</a>.
</div>
</div>
<div style="display:none;" id="loadercontainer">
<div id="musiclibrary">
<br/>dh0:music_library><br/><br/>
<select size="24" id="modfile"></select>
<br/><br/>
<div style="clear:left;"></div>
<div style="margin-left: 24px;">
<a href="#" id="load_cancel">[< back]</a>
<a href="#" id="load">[load song]</a>
<a href="#" id="add_playlist">[add +>]</a>
</div>
<div style="margin-left: 24px; margin-top: 12px;">
<input value="" id="loadfilter" size="48" placeholder="Filter songs" style="border: 1px solid #8f8; background-color: #181818" />
</div>
</div>
<div id="playlist">
<br/>ram:playlist><br/><br/>
<select size="24" id="playlist_box">
</select>
<div style="clear:right;"></div>
<div style="margin-left: 24px;">
<a href="#" id="playlist_up">[^^]</a>
<a href="#" id="playlist_dn">[vv]</a>
<a href="#" id="playlist_remove">[remove]</a>
<a href="#" id="playlist_clear">[clear]</a>
<a href="#" id="playlist_jumpto">[play song]</a>
</div>
</div>
<div style="clear:both"></div>
</div>
</div>
</body>
</html>