-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
315 lines (280 loc) · 17.5 KB
/
index.html
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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title id="_title">Music Player</title>
<link rel="stylesheet" href="./css/albums.css">
<link rel="stylesheet" href="./css/listcontainer.css">
<link rel="stylesheet" href="./css/misc.css">
<link rel="stylesheet" href="./css/nowplaying.css">
<link rel="stylesheet" href="./css/services.css">
<link rel="stylesheet" href="./css/songlist.css">
<link rel="stylesheet" href="./css/topmenu.css">
<link rel="stylesheet" href="./css/plugins.css">
<script>
function hasCustomTitleBar() {return process.platform === "windows"}
document.write(`<link rel="stylesheet" href="./css/titlebar${hasCustomTitleBar()?"":"-linux"}.css">`)
//var audioCtx = new AudioContext();
//var audioElem;
//var src;
//var gainNode;
// http://wiki.hydrogenaud.io/index.php?title=ReplayGain_specification
// TODO: do the loudness filtering (Butterworth, Yulewalk) IIR filters
function normalizedAudioElement(name) {
//audioElem = document.getElementById(name);
//src = audioCtx.createMediaElementSource(audioElem);
//gainNode = audioCtx.createGain();
//gainNode.gain.value = 1;
//connectAudioNormalizer();
}
function connectAudioNormalizer() {
//src.connect(gainNode);
//gainNode.connect(audioCtx.destination);
}
function disconnectAudioNormalizer() {
//src.disconnect(gainNode);
//gainNode.disconnect(audioCtx.destination);
}
</script>
<script defer src="./js/plugin-manager.r.js"></script>
<script defer src="./js/music-player.js"></script>
<script defer src="./js/playlists.js"></script>
<script defer src="./js/songs-ui.js"></script>
<script defer src="./js/albums.js"></script>
<script defer src="./js/folder-data.js"></script>
<script defer src="./js/twitch.js"></script>
<script defer src="./js/discord-presence.js"></script>
<script defer src="./js/ui.js"></script>
</head>
<body id="body" data-currentLevel="top-menu" data-prevLevel="top-menu" data-musicInfoOpen="false" data-settingsOpen="false">
<div id='hidden-stuff' style='display: none'>
<audio id="song">ok boomer</audio>
</div>
<div id="context-menu" style="top: 0; left: 0; z-index: 100;">
<span onclick="cm_openATPMenu()">Add to Playlist</span><br><hr>
<span onclick="cm_playSong()">Play</span><br>
</div>
<header id="titlebar">
<div id="drag-region">
<div id="window-title">
[v<span id='version-display'>0.0.0</span>] <span id="window-title-text">Vault > Sounds</span>
</div>
<div id="window-controls">
<div class="button" id="min-button" title="Minimize">
<span></span>
</div>
<div class="button" id="max-button" title="Maximize">
<span></span>
</div>
<div class="button" id="restore-button" title="Restore">
<span></span>
</div>
<div class="button" id="close-button" title="Close">
<span></span>
</div>
<div class="button" id="settings-button" title="Settings">
<span></span>
</div>
<div class="button" id="back-button" title="Back" style='display:none'>
<span></span>
</div>
</div>
</div>
</header>
<div id='main'>
<!--<div id='top-updater' style='display:block'>
</div>-->
<div id='top-settings' style='display: none'>
<table>
<tr>
<td>Enable Vibrancy (Windows and OSX only)</td>
<td><input id="settings-acrylic" type="checkbox" checked></td>
</tr>
<tr>
<td>Enable System Notifications On Song Change (Disabled)</td>
<td><input id="settings-notifs" type="checkbox" disabled></td>
</tr>
<tr title="When enabling again, will take effect when the next song starts playing">
<td>Enable Volume Normalization (Temporarily Disabled)</td>
<td><input id="settings-normalization" type="checkbox" disabled onclick="updateNormalizationState(this.checked)"></td>
</tr>
<tr>
<td>
<input id='settings-refresh-albums' value="Reload Songs and Albums" type="button" onclick="refreshSongsAndAlbums()">
<input id='settings-update' value="Check for updates" type="button">
<input value="Open Music Folder File" type="button" onclick="openFoldersFile()">
</td>
</tr>
<tr>
<td>idk, more settings soon probably</td>
</tr>
<!--<tr>
<td>
<iframe width="560" height="315" src="https://www.youtube.com/embed/eKC2ykkYWDY?controls=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</td>
</tr>-->
</table>
<span><a href="https://discord.gg/WfFe3Ss">Discord</a><br>Art by Minity</span>
<div id='settings-info'>TheDerpyMemeSquad</div>
</div>
<div id='top-menu'>
<div id="top-music-button" onclick="openMusicMenu();" class="top-button select-hover-anim">
Music
</div>
<div id="top-playlist-button" onclick="openPlaylistMenu()" class="top-button select-hover-anim">
Playlists
</div>
<div id="top-services-button" onclick="openServicesMenu()" class="top-button select-hover-anim">
Services
</div>
<div id='top-footer-bar'>
</div>
</div>
<div id="normal" hidden>
<!--<div class="now-playing-spacer"></div>-->
<div id="album-info-header">
<img id="album-info-header-img" class="album-logo" src='./assets/other-album.png' height="100%">
<div id="album-info-header-thing"><span id="album-info-header-thing-text"></span></div>
</div>
<div id='list-container'>
<input id="list-container-scrollbar" type="range" step="1">
<div class="list-spacer"></div>
<div id="song-list" class="song-list" style="display: none"><table id='song-list-t' class="song-list-t"><tbody id='song-list-tbody' class="song-list-tbody"></tbody></table></div>
<div id="pl-song-list" class="song-list" style="display: none"><table id='pl-song-list-t' class="song-list-t"><tbody id='pl-song-list-tbody' class="song-list-tbody"></tbody></table></div>
<div id='album-list' style="display: none"></div>
<div id="playlist-list" style="display: none"></div>
<div id='no-songs-notice' style="display: none"><span>Hey! We couldn't find any of your music! Make sure your music is in your user Music folder, or <a onclick="openFoldersFile()">click here to open the music folder file</a> to add music directories that we should check in.</span></div>
<div id='no-pl-notice' style="display: none"><span>Hey! It looks like you haven't created any playlists yet. Go back to Music to make some! (In the future, you may be able to import playlists from other sources)</span></div>
<div id="services" style="display: none">
<div id="s-plugins">
<h1>Plugins</h1>
<table class="plugin-list">
<thead>
<td>Plugin Name</td><td>Version</td><td>Author</td><td>Enabled</td>
</thead>
<tbody id="plugin-list-body">
</tbody>
</table>
</div>
<div id="s-twitch-div">
<h1>Twitch Integration</h1>
<h2>Initial Setup</h2>
<h3>Do each line <b>in order</b></h3>
Sign into your <b>bot's</b> twitch account: <input id="s-t-login" type="button" value="Sign in with Twitch" onclick="beginTwitchOauthFlow()"><br>
Before closing the popup window, click this button: <input id="s-t-getoauth" type="button" value="Get oauth from popup" onclick="getTwitchOauthFromPopup()" disabled><br>
What is the name of the channel you want to connect to: <input type="text" id="s-t-channel"><br>
Click this button to actually connect to chat: <input id="s-t-connect" type="button" value="connect to chat" onclick="startTwitchIntegration()" disabled><br><hr>
<h2>Options</h2>
Send chat message when a new song plays: <input type="checkbox" id="s-t-o-newsongmessage" checkd><br>
Enable Songrequest (doesnt work yet): <input id="sto-enablesr" type="checkbox"><br>
Who can request songs: <select id="sto-mr-sr">
<option value="mod">Moderators</option>
<option value="vip">VIPs</option>
<option value="sub">Subscribers</option>
<option value="all" selected>Anyone</option>
</select><br>
Maximum song length (seconds): <input id="sto-maxlength" type="number" min="0" max="43200" value="900"><br>
Mimimum song views: <input id="sto-minviews" type="number" min="0" value="0"><br>
<div id="s-t-chatbox">
Chat Log
</div>
</div>
<div id="s-discord-rpc-opts">
<h1>Discord RPC Settings</h1>
coming soon... (hopefully maybe)
</div>
<div id="s-yt-test-area">
<div id="player"></div>
<!--<script>
// 2. This code loads the IFrame Player API code asynchronously.
var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);
// 3. This function creates an <iframe> (and YouTube player)
// after the API code downloads.
var player;
function onYouTubeIframeAPIReady() {
player = new YT.Player('player', {
height: '390',
width: '640',
videoId: 'eKC2ykkYWDY',
events: {
'onReady': onPlayerReady,
'onStateChange': onPlayerStateChange
}
});
}
// 4. The API will call this function when the video player is ready.
function onPlayerReady(event) {
event.target.playVideo();
}
// 5. The API calls this function when the player's state changes.
// The function indicates that when playing a video (state=1),
// the player should play for six seconds and then stop.
var done = false;
function onPlayerStateChange(event) {
if (event.data == YT.PlayerState.PLAYING && !done) {
setTimeout(stopVideo, 6000);
done = true;
}
}
function stopVideo() {
player.stopVideo();
}
</script>-->
</div>
</div>
</div>
</div>
<div id='now-playing' class='no-song' hidden>
<div id='song-alb-img'>
<img id='song-info-art' class="album-logo" src='./assets/other-album.png' height="100%">
<span>Local Files</span>
</div>
<div id='song-info'>
<input type="button" onclick="toggleSongInfoModal()" value="Song Info" id="song-info-button">
<input type="button" onclick="openAddToPlaylistMenu()" value="Add To Playlist" id="song-info-atp-button">
<div id="advanced-song-info-modal" style="display: none;z-index:10">
<input type="button" onclick="toggleSongInfoModal(false)" value="Back" id="song-info-close">
<span id="song-info-title2">title - album - artist</span><br>
<span id="song-info-genre">genre - comment</span><br>
<span id="song-info-line1">year - mm:ss - disk/total - track/total</span><br>
Format: <span id="song-info-line2">MP3 - MPEG - lossless</span><br>
Normalization Gain: <span id='song-info-normalization'>{null}</span>
</div>
<div id="song-info-addtopl" style="display: none;z-index:10">
<input type="button" onclick="openAddToPlaylistMenu(false)" value="Cancel" id="atp-menu-close">
Song to add: <span id="atp-song">?</span><br>
Playlist: <select id="atp-select-pl" oninput="updateAddToPlaylistMenu()"><option value="%new">New Playlist</option></select><br>
Playlist to create: <input type="text" id="atp-new-pl-name" placeholder="name of playlist"><br>
<input type="button" onclick="addSongToPlaylistButton()" value="Add to Playlist" id="atp-menu-add-button">
</div>
<div id="song-info-title"></div>
<div id="song-info-album"></div>
<div id="song-info-artist"></div>
</div>
<div id='song-controls'>
<div id='song-sliders'>
<span id="np-slider-volu"></span><input type="range" step="0.000001" value=1 max=1 min=0 id="now-playing-volume-slider" oninput="updateVolume()" class="seek-slider"><br>
<span id="np-slider-time"></span><input type="range" step="0.000001" id="now-playing-seek-slider" oninput="updateSongProgressFromBar()" class="song-progress seek-slider">
</div>
<div id='song-buttons'>
<button id="np-prev" onclick="prevSong()"><img src="./assets/skip.png" style='transform: scaleX(-1);'></button>
<button id="np-pause" onclick="pauseSong()"><img id="np-pause-img" src="./assets/play.png"></button>
<button id="np=next" onclick="nextSong()"><img src="./assets/skip.png"></button>
<button id="np-shuffle" onclick="shuffleSongs()"><img id="np-shuffle-img" src="./assets/shuffle.png"></button>
</div>
<div id='shuffle-state'>Shuffle All</div>
</div>
<canvas id='visualizer-canvas'></canvas>
</div>
</div>
</div>
<script>
// You can also require other files to run in this process
require('./renderer.js');
//normalizedAudioElement("song");
</script>
</body>
</html>