Skip to content

Commit

Permalink
update and new col
Browse files Browse the repository at this point in the history
  • Loading branch information
MD-AZMAL committed Jul 3, 2018
1 parent cbf23b9 commit 1451a3d
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 8 deletions.
21 changes: 14 additions & 7 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ autoUpdater.logger.transports.file.level = 'info';

let MainWin, AboutWin;
let ico = nativeImage.createFromPath(path.join(__dirname, 'logo.png'));
let usr_apd = false;

function createMainWindow() {
autoUpdater.checkForUpdates();

MainWin = new BrowserWindow({
show: false,
center: true,
Expand Down Expand Up @@ -97,6 +100,7 @@ function createMainWindow() {
{
label: 'Check for Updates',
click: () => {
usr_apd = true;
autoUpdater.checkForUpdates();
}
}
Expand Down Expand Up @@ -162,13 +166,16 @@ autoUpdater.on('update-available', (info) => {
});

autoUpdater.on('update-not-available', () => {
dialog.showMessageBox(MainWin, {
title: 'Updates',
type: 'info',
message: 'Update Not Available',
detail: 'Your App is Up-todate',
buttons: ['OK']
});
if(usr_apd) {
dialog.showMessageBox(MainWin, {
title: 'Updates',
type: 'info',
message: 'Update Not Available',
detail: 'Your App is Up-todate',
buttons: ['OK']
});
usr_apd = false;
}
});

autoUpdater.on('download-progress', (progress) => {
Expand Down
2 changes: 2 additions & 0 deletions res/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ canvas {
.seek-pos {
flex: 1;
order: 1;
color: #AA021B;
}

.seek-bar {
Expand All @@ -118,6 +119,7 @@ canvas {
flex: 1;
order: 3;
text-align: right;
color: #AA021B;
}

.progress {
Expand Down
10 changes: 9 additions & 1 deletion res/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var fbc_arr;
var bar_x, bar_width, bar_height;

ipc.on('selected-folder', (event, obj) => {
reset_ui();
if (current_song) {
current_song.pause();
current_song = null;
Expand All @@ -49,7 +50,6 @@ ipc.on('selected-folder', (event, obj) => {
folder_name.html(obj.loc.split(sl)[obj.loc.split(sl).length - 1]);
playList = [];
global_loc = obj.loc;
song_list.html('');
obj.files.forEach((file) => {
if (file.endsWith('.wav') || file.endsWith('.WAV')) {
let tmp = new Audio();
Expand Down Expand Up @@ -96,6 +96,14 @@ ipc.on('update-download', (event, perc) => {
play_header.html('Download Progress : ' + parseInt(perc) + '%');
});

function reset_ui() {
current_play.html(' '); // \u00a0 is non-breakable space
song_duration.html('0:00');
seek_pos.html('0:00');
current.css('width', '0%');
song_list.html('');
}

volume_slider.mousedown(function (event) {
init_global_vol(event.pageX);
volume_slider.mousemove(function (event) {
Expand Down

0 comments on commit 1451a3d

Please sign in to comment.