Merge branch 'ciderapp:upcoming' into upcoming
This commit is contained in:
commit
0cb341986e
5 changed files with 37 additions and 37 deletions
|
@ -1,4 +1,11 @@
|
|||
{ // Base File
|
||||
{ // Base File
|
||||
|
||||
// i18n Info
|
||||
"i18n.languageName": "English", // name of language in native language
|
||||
"i18n.languageNameEnglish": "English", // name of language in English
|
||||
"i18n.category": "main", // main = real language, fun = fun community languages
|
||||
"i18n.authors": "", // Authors, if you contribute to this file feel free to add your name seperated with a space
|
||||
|
||||
// App info
|
||||
"app.name": "Cider",
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ export default class sendSongToTitlebar {
|
|||
* @param attributes Music Attributes (attributes.state = current state)
|
||||
*/
|
||||
onPlaybackStateDidChange(attributes: any): void {
|
||||
this._win.win.setTitle(`${(attributes != null && attributes.name != null && attributes.name.length > 0) ? (attributes.name + " - ") : ''}Cider`)
|
||||
this._win.setTitle(`${(attributes != null && attributes.name != null && attributes.name.length > 0) ? (attributes.name + " - ") : ''}Cider`)
|
||||
}
|
||||
/**
|
||||
* Runs on song change
|
||||
|
|
|
@ -191,7 +191,7 @@ export default class LastFMPlugin {
|
|||
this._store.lastfm.enabled = true;
|
||||
this._store.lastfm.auth_token = authKey;
|
||||
console.log(authKey);
|
||||
this._win.win.webContents.send('LastfmAuthenticated', authKey);
|
||||
this._win.webContents.send('LastfmAuthenticated', authKey);
|
||||
this.authenticate();
|
||||
}
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ export default class LastFMPlugin {
|
|||
const authKey = authURI.split('lastfm?token=')[1];
|
||||
this._store.lastfm.enabled = true;
|
||||
this._store.lastfm.auth_token = authKey;
|
||||
this._win.win.webContents.send('LastfmAuthenticated', authKey);
|
||||
this._win.webContents.send('LastfmAuthenticated', authKey);
|
||||
console.log(authKey);
|
||||
this.authenticate();
|
||||
}
|
||||
|
|
|
@ -22,8 +22,13 @@ var CiderAudio = {
|
|||
},
|
||||
off: function(){
|
||||
try{
|
||||
CiderAudio.audioNodes.gainNode.disconnect();
|
||||
CiderAudio.audioNodes.spatialNode.disconnect();
|
||||
try{
|
||||
CiderAudio.audioNodes.gainNode.disconnect(); } catch(e){}
|
||||
try{ CiderAudio.audioNodes.spatialNode.disconnect();} catch(e){}
|
||||
try{
|
||||
CiderAudio.audioNodes.audioBands[0].disconnect();
|
||||
CiderAudio.audioNodes.audioBands[9].disconnect();
|
||||
} catch(e){}
|
||||
CiderAudio.source.connect(CiderAudio.context.destination);} catch(e){}
|
||||
},
|
||||
connectContext: function (mediaElem){
|
||||
|
@ -97,41 +102,29 @@ var CiderAudio = {
|
|||
let BANDS = app.cfg.audio.equalizer.frequencies;
|
||||
let GAIN = app.cfg.audio.equalizer.gain;
|
||||
let Q = app.cfg.audio.equalizer.Q;
|
||||
CiderAudio.audioNodes.audioBands = {};
|
||||
CiderAudio.audioNodes.audioBands = [];
|
||||
|
||||
BANDS.forEach((band, i) => {
|
||||
const filter = CiderAudio.context.createBiquadFilter();
|
||||
|
||||
CiderAudio.audioNodes.audioBands[i] = filter;
|
||||
|
||||
if (i === 0) {
|
||||
// The first filter, includes all lower frequencies
|
||||
filter.type = "lowshelf";
|
||||
} else if (i === BANDS.length - 1) {
|
||||
// The last filter, includes all higher frequencies
|
||||
filter.type = "highshelf";
|
||||
} else {
|
||||
filter.type = "peaking";
|
||||
for (i = 0; i < BANDS.length; i++) {
|
||||
CiderAudio.audioNodes.audioBands[i] = CiderAudio.context.createBiquadFilter();
|
||||
CiderAudio.audioNodes.audioBands[i].type = 'peaking'; // 'peaking';
|
||||
CiderAudio.audioNodes.audioBands[i].frequency.value = BANDS[i];
|
||||
CiderAudio.audioNodes.audioBands[i].Q.value = Q[i];
|
||||
CiderAudio.audioNodes.audioBands[i].gain.value = GAIN[i];
|
||||
}
|
||||
filter.frequency.value = BANDS[i];
|
||||
filter.gain.value = GAIN[i];
|
||||
filter.Q.value = Q[i];
|
||||
if (i == 0){
|
||||
if (app.cfg.audio.spatial) {
|
||||
CiderAudio.audioNodes.spatialNode.output.disconnect(CiderAudio.context.destination);
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(filter);
|
||||
} else {
|
||||
CiderAudio.audioNodes.gainNode.disconnect(CiderAudio.context.destination);
|
||||
CiderAudio.audioNodes.gainNode.connect(filter);
|
||||
}
|
||||
} else if (i === BANDS.length - 1) {
|
||||
CiderAudio.audioNodes.audioBands[i - 1].connect(filter);
|
||||
if (app.cfg.audio.spatial) {
|
||||
try{
|
||||
CiderAudio.audioNodes.spatialNode.output.disconnect(CiderAudio.context.destination); } catch(e){}
|
||||
CiderAudio.audioNodes.spatialNode.output.connect(CiderAudio.audioNodes.audioBands[0]);
|
||||
} else {
|
||||
CiderAudio.audioNodes.audioBands[i - 1].connect(filter);
|
||||
filter.connect(CiderAudio.context.destination);
|
||||
try{
|
||||
CiderAudio.audioNodes.gainNode.disconnect(CiderAudio.context.destination);} catch(e){}
|
||||
CiderAudio.audioNodes.gainNode.connect(CiderAudio.audioNodes.audioBands[0]);
|
||||
}
|
||||
|
||||
});
|
||||
for (i = 1; i < BANDS.length; i ++) {
|
||||
CiderAudio.audioNodes.audioBands[i-1].connect(CiderAudio.audioNodes.audioBands[i]);
|
||||
}
|
||||
CiderAudio.audioNodes.audioBands[ BANDS.length-1].connect(CiderAudio.context.destination);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
resetGain(){
|
||||
this.app.cfg.audio.equalizer = {'frequencies': [32, 63, 125, 250, 500, 1000, 2000, 4000, 8000, 16000],
|
||||
'gain': [0,0,0,0,0,0,0,0,0,0],
|
||||
'Q' : [1,1,1,1,1,1,1,1,1,1] }
|
||||
'Q' : [1,1,1,1,1,1,1,1,1,1] }
|
||||
for (var i = 0; i < 10; i++){
|
||||
this.changeGain(i)
|
||||
this.changeFreq(i)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue