Skip to content

Commit b583458

Browse files
committed
v0.4.1
1 parent c1658e5 commit b583458

13 files changed

Lines changed: 651 additions & 166 deletions

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
A music player that has a UI based on the UI of the Super Smash Bros. Ultimate music interface.
33

44
# notice
5+
This issue is fixed as of v0.4.1
56
v0.3.8 added a caching feature to the song list for albums, so opening the page for an album will be faster. This may cause issues if you move folders around or add/remove tracks from a folder/album in explorer. If you have any problems, open the folder, and delete the .ssbu-music file, which should clear the cache of the song list. The next time you open that album, the song list will be re-created, which may take a second, depending on how many songs are in that album.
67

78
# Known Issues
8-
v0.3.8
9-
- Caching (see above)
9+
Last updated for: v0.4.1
1010
- Song list is not sorted by track number (its sorted by whatever order it reads files in)
1111

1212
# Current Features
1313
- Partial Twitch integration
1414
- Currently can say in chat what you are currently listening to when a user does !song
15+
- Can announce when a new song plays automatically
1516
- See planned features for more
1617
- Can shuffle music from your default music directory (on windows C:/Users/\<user\>/Music)
1718
- Automatically sorts them into albums from which they are from, as well as an album that shows songs that are not in albums and an album that lists all songs
@@ -33,24 +34,24 @@ Checked off boxes are currntly being worked on
3334
- [ ] Playlist support
3435
- [ ] Will be able to play a playlist
3536
- [ ] Play songs from YouTube
36-
- [ ] Custom Playlists
37+
- [X] Custom Playlists
3738
- [ ] Includes both local music files and youtube videos in the same playlist
3839
- [ ] Automatically skip youtube videos when you dont have internet
3940
- [ ] Option to only play local files or only youtube videos when online
4041
- [ ] Music Settings per song
4142
- [ ] Volume
4243
- [ ] Normalization
4344
- [ ] more stuff probably
44-
- [ ] Faster UI, currently its kinda slow, and bad. but it looks good
45+
- [X] Faster UI. Mostly happy with performance, but inital startup is quite slow and bad
4546

4647
# notes
4748
Currently only optimized and tested on Windows 10, should work on older versions of windows, known to at least start on Ubuntu, but not tested very much.
4849

49-
Im not creating these as gh issues for now because im not focusing on ubuntu developmenet for now
50+
Im not creating these as gh issues for now because im not focusing on ubuntu development for now
5051
Known issues on Ubuntu:
51-
Fails to install with default package setup (mainly ewc causing issues, as it only works on windows)
52-
Window icons (close, minimize, maximie) dont render correctly, as the font is windows exclusive as far as i know (Seoge UI)
53-
Title bar is rendered what appears to be 100% its height below where it should be. (it looks like there is an invisible title bar above it basically, but i dont think thats actually what the issue is)
52+
- Fails to install with default package setup (mainly ewc causing issues, as it only works on windows)
53+
- Window icons (close, minimize, maximie) dont render correctly, as the font is windows exclusive as far as i know (Seoge UI)
54+
- Title bar is rendered what appears to be 100% its height below where it should be.
5455

5556
music might not even play on ubuntu because i didnt have any music on my ubuntu install, and was too lazy to get some.
5657

changelog.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
v0.4.1
2+
Other album will no longer show up if it has no songs.
3+
Adjusted scrollbar css a bit because i still havent finalized any of the design elements yet pretty much and its all under
4+
active development
5+
Now saves settings (windows 10 acrylic, and volume slider position)
6+
Added support for .ogg files
7+
Fixed trying to open the album you just opened would not do anything.
8+
Adjusted how the sliders look, and added labels to the sliders
9+
Adjusted RPC to show version and if the music player is running in dev mode
10+
Adjusted how the title bar version is shown when in a dev build
11+
Removed the song list caching feature for now as it very much caused problems if you moved songs around, but i still fixed
12+
the issue it was fixing by re-using the parsed metadata that was loaded for all songs when the player starts
13+
Got some progress on playlists done, however they are still unusable for end-users at this time.
14+
Added a button to add a song to a playlist (doesnt work yet)
15+
Made playlists actually load and function.
16+
By function, i mean it can open a playlist similar to how it opens an album, and it can play songs if any are added
17+
It does not load playlists from anywhere currently
18+
Playlists will be fully functional for local files by v0.5 (could be sooner)
19+
Optimized a few things
20+
internal function getSongData() will attept to get song data from the All Songs album instead of reading file from disk
21+
fixes the issue that caching the song list "fixed" but better, as this will also help in other places too.
22+
this also causes less reads and writes on the disk so if you have a hard drive and not an ssd, it should be much
23+
faster
24+
made some variables that were not supposed to be global not global anymore because memory usage and possible interference
25+
Switched to electron-acrylic-window instead of ewc for the acrylic effect. This enables compatability for Vibrancy on OSX
26+
This might also improve performance on windows, but i dont know if it does or not
27+
Started working on a context menu when you right click songs. Does not work yet though, so its hidden
28+
129
v0.4.0
230
Will now load from files defined in Music/folders.ssbu-music
331
Lines in that file that start with any of the following characters will be ignored: ['#', '//', '$', '!', '-']

index.html

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
<audio id="song">ok boomer</audio>
4646
</div>
4747

48+
<div id="context-menu" style="display: none; top: 0; left: 0;">this is the context menu</div>
49+
4850
<header id="titlebar">
4951
<div id="drag-region">
5052

@@ -84,7 +86,7 @@
8486
<div id='top-settings' style='display: none'>
8587
<table>
8688
<tr>
87-
<td>Enable Windows 10 Acrylic Background</td>
89+
<td>Enable Vibrancy (Windows and OSX only)</td>
8890
<td><input id="settings-acrylic" type="checkbox" checked></td>
8991
</tr>
9092
<tr>
@@ -135,15 +137,22 @@
135137

136138
<div id="album-info-header">
137139
<img id="album-info-header-img" class="album-logo" src='./assets/other-album.png' height="100%">
138-
<div id="album-info-header-thing"><span id="album-info-header-thing-text">asdf</span></div>
140+
<div id="album-info-header-thing"><span id="album-info-header-thing-text"></span></div>
139141
</div>
140142

141143
<div id='list-container'>
142144
<input id="list-container-scrollbar" type="range" step="1">
143145
<div class="list-spacer"></div>
144-
<div id="song-list" style="display: none">
145-
<table id='song-list-t'>
146-
<tbody id='song-list-tbody'>
146+
<div id="song-list" class="song-list" style="display: none">
147+
<table id='song-list-t' class="song-list-t">
148+
<tbody id='song-list-tbody' class="song-list-tbody">
149+
<tr><td></td><td>0</td><td>Example Song</td><td>0:00</td></tr>
150+
</tbody>
151+
</table>
152+
</div>
153+
<div id="pl-song-list" class="song-list" style="display: none">
154+
<table id='pl-song-list-t' class="song-list-t">
155+
<tbody id='pl-song-list-tbody' class="song-list-tbody">
147156
<tr><td></td><td>0</td><td>Example Song</td><td>0:00</td></tr>
148157
</tbody>
149158
</table>
@@ -239,7 +248,8 @@
239248
</div>
240249
<div id='song-info'>
241250
<input type="button" onclick="toggleSongInfoModal()" value="Song Info" id="song-info-button">
242-
<div id="advanced-song-info-modal" style="display: none">
251+
<input type="button" onclick="openAddToPlaylistMenu()" value="Add To Playlist" id="song-info-atp-button">
252+
<div id="advanced-song-info-modal" style="display: none;z-index:10">
243253
<input type="button" onclick="toggleSongInfoModal(false)" value="Back" id="song-info-close">
244254
<span id="song-info-title2">title - album - artist</span><br>
245255
<span id="song-info-genre">genre - comment</span><br>
@@ -253,16 +263,16 @@
253263
</div>
254264
<div id='song-controls'>
255265
<div id='song-sliders'>
256-
<input type="range" step="0.000001" value=1 max=1 min=0 id="now-playing-volume-slider" oninput="updateVolume()" class="seek-slider"><br>
257-
<input type="range" step="0.000001" id="now-playing-seek-slider" oninput="updateSongProgressFromBar()" class="song-progress seek-slider">
266+
<span>volume</span><input type="range" step="0.000001" value=1 max=1 min=0 id="now-playing-volume-slider" oninput="updateVolume()" class="seek-slider"><br>
267+
<span>seek</span><input type="range" step="0.000001" id="now-playing-seek-slider" oninput="updateSongProgressFromBar()" class="song-progress seek-slider">
258268
</div>
259269
<div id='song-buttons'>
260270
<button id="np-prev" onclick="prevSong()"><img src="./assets/skip.png" style='transform: scaleX(-1);'></button>
261271
<button id="np-pause" onclick="pauseSong()"><img id="np-pause-img" src="./assets/play.png"></button>
262272
<button id="np=next" onclick="nextSong()"><img src="./assets/skip.png"></button>
263273
<button id="np-shuffle" onclick="shuffleSongs()"><img src="./assets/unknown.png"></button>
264274
</div>
265-
<div id='shuffle-state'>Random</div>
275+
<div id='shuffle-state'>Shuffle All</div>
266276
</div>
267277
<canvas id='visualizer-canvas'></canvas>
268278
</div>

js/albums.js

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
async function openAlbum(albumName) {
2-
console.log(nowPlaying['openedAlbum'])
32
var path = "null";
43
for (song in songs[albumName]['songs']) {
54
path = songs[albumName]['songs'][song][0]['folder']
@@ -16,21 +15,15 @@ async function openAlbum(albumName) {
1615
}
1716

1817
if (nowPlaying['openedAlbum'] != albumName) {
19-
let attemptedLoad = loadAlbumHtmlFromFile(path, albumName);
20-
if (attemptedLoad != false) {
21-
document.getElementById('song-list-tbody').innerHTML = attemptedLoad;
22-
hideAlbumLayer()
23-
}
2418
let updatedHTML = "";
2519
for (song in songs[albumName]["songs"]) {
2620
updatedHTML += await createSongListEntryFromSongData(songs[albumName]['songs'][song][0]['fileLocation']);
2721
}
28-
saveAlbumHtmlToFile(path, albumName, updatedHTML)
2922

30-
if (attemptedLoad === false) {
31-
document.getElementById('song-list-tbody').innerHTML = updatedHTML;
32-
hideAlbumLayer()
33-
}
23+
document.getElementById('song-list-tbody').innerHTML = updatedHTML;
24+
hideAlbumLayer()
25+
} else {
26+
hideAlbumLayer()
3427
}
3528

3629

@@ -43,7 +36,6 @@ async function openAlbum(albumName) {
4336
async function loadAlbums() {
4437
var albList = document.getElementById('album-list');
4538
albList.innerHTML = ""
46-
//console.log(JSON.stringify(songs))
4739
for (var alb in songs) {
4840
if (songs[alb]["extraText"]) {
4941
var extraText = songs[alb]["extraText"]
@@ -52,10 +44,12 @@ async function loadAlbums() {
5244
var extraText = ""
5345
var classes = "album select-hover-anim hide-text"
5446
}
55-
//console.log(alb)
56-
//console.log("<div class='album select-hover-anim' style='background-image:" + songs[alb]['albumArt'] + "></div>");
57-
albList.innerHTML += "<button type='button' value='" + extraText + "' class='" + classes + "' onclick='openAlbum(\"" + alb + "\")' style='background-image:url(" + songs[alb]['albumArt'] + ")'>" + extraText + "</button>";
58-
//console.log(albList.innerHTML);
47+
albList.innerHTML += "<button type='button' id='album-list-album-" + alb.toLowerCase() + "' value='" + extraText + "' class='" + classes + "' onclick='openAlbum(\"" + alb + "\")' style='background-image:url(" + songs[alb]['albumArt'] + ")'>" + extraText + "</button>";
48+
}
49+
if (songs['Other']['songCount'] === 0) {
50+
document.getElementById("album-list-album-other").style.display = "none";
51+
} else {
52+
document.getElementById("album-list-album-other").style.display = "block";
5953
}
6054
return true;
6155
}

js/folder-data.js

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ function parseFolderData(dir) {
3333
return parseFolderDataFile(folderFile);
3434
}
3535

36-
function saveAlbumHtmlToFile(path, album, html) {
37-
console.log(path + ", " + album)
36+
/*function saveAlbumHtmlToFile(path, album, html) {
37+
//console.log(path + ", " + album)
3838
if (album == "All Songs" || album == "Other") path = platFolders.getMusicFolder();
3939
let f = parseFolderDataFile(path + "/" + getDataFileName());
4040
if (!f['albums'][album]) {
@@ -52,7 +52,7 @@ function loadAlbumHtmlFromFile(path, album) {
5252
} else {
5353
return f['albums'][album]['html']
5454
}
55-
}
55+
}*/
5656

5757
function parseFolderDataFile(path) {
5858
if (fs.existsSync(path)) {
@@ -67,4 +67,21 @@ function parseFolderDataFile(path) {
6767

6868
function saveFolderDataFile(path, data) {
6969
fs.writeFileSync(path + "/" + getDataFileName(), JSON.stringify(data))
70+
}
71+
72+
function readSettingsFile() {
73+
if (fs.existsSync(platFolders.getMusicFolder() + "/settings.ssbu-music")) {
74+
return JSON.parse(fs.readFileSync(platFolders.getMusicFolder() + "/settings.ssbu-music"))
75+
} else {
76+
fs.writeFileSync(platFolders.getMusicFolder() + "/settings.ssbu-music", JSON.stringify(userSettings))
77+
return userSettings
78+
}
79+
}
80+
81+
function saveSettingsFile() {
82+
fs.writeFileSync(platFolders.getMusicFolder() + "/settings.ssbu-music", JSON.stringify(userSettings))
83+
}
84+
85+
function loadSettings() {
86+
userSettings = readSettingsFile()
7087
}

0 commit comments

Comments
 (0)