diff --git a/app/pods/components/music-tab/component.js b/app/pods/components/music-tab/component.js
index fdb78ff..73ee10c 100644
--- a/app/pods/components/music-tab/component.js
+++ b/app/pods/components/music-tab/component.js
@@ -317,13 +317,25 @@ export default Em.Component.extend(musicControlMixin, visualizerMixin, {
var song = this.get('playQueue')[this.get('playQueuePointer')],
title = Em.isEmpty(song.artist) ? song.filename : song.artist + '-' + song.title,
songBeatPreferences = this.get('songBeatPreferences'),
- preference = songBeatPreferences[title];
+ preference = songBeatPreferences[title],
+ oldBeatPrefCache = this.get('oldBeatPrefCache'),
+ newOldBeatPrefCache = null;
+
+ if(!Em.isNone(preference)) { // load existing beat prefs
+ newOldBeatPrefCache = {threshold: this.get('threshold'), decay: this.get('decay'), frequency: this.get('frequency') };
- if(!Em.isNone(preference)) {
this.changePlayerControl('threshold', preference.threshold, true, true);
this.changePlayerControl('decay', preference.decay, true, true);
this.changePlayerControl('frequency', preference.frequency, true, true);
+ this.set('usingBeatPreferences', true);
+ } else if(!Em.isNone(oldBeatPrefCache)) { // revert to using beat prefs before the remembered song
+ this.changePlayerControl('threshold', oldBeatPrefCache.threshold, true, true);
+ this.changePlayerControl('decay', oldBeatPrefCache.decay, true, true);
+ this.changePlayerControl('frequency', oldBeatPrefCache.frequency, true, true);
+ this.set('usingBeatPreferences', false);
}
+
+ this.set('oldBeatPrefCache', newOldBeatPrefCache);
},
startUsingMic() {
diff --git a/app/pods/components/music-tab/mixins/music-tab.js b/app/pods/components/music-tab/mixins/music-tab.js
index f5949a2..21c1a18 100644
--- a/app/pods/components/music-tab/mixins/music-tab.js
+++ b/app/pods/components/music-tab/mixins/music-tab.js
@@ -97,8 +97,8 @@ export default Em.Mixin.create({
playQueueEmpty: Em.computed.empty('playQueue'),
playQueueNotEmpty: Em.computed.notEmpty('playQueue'),
playQueueMultiple: function(){
- return this.get('playQueue.length') > 1;
- }.property('playQueue'),
+ return this.get('playQueue').length > 1;
+ }.property('playQueue.[]'),
seekPosition: function() {
var timeTotal = this.get('timeTotal'), timeElapsed = this.get('timeElapsed');
@@ -121,6 +121,8 @@ export default Em.Mixin.create({
playing: false,
fadeOutNotification: false,
songBeatPreferences: {},
+ usingBeatPreferences: false,
+ oldBeatPrefCache: null,
storage: null,
speakerViewed: true,
diff --git a/app/pods/components/music-tab/template.hbs b/app/pods/components/music-tab/template.hbs
index 143651d..fe8974f 100644
--- a/app/pods/components/music-tab/template.hbs
+++ b/app/pods/components/music-tab/template.hbs
@@ -76,7 +76,7 @@
{{else}}
{{item.filename}}
{{/if}}
-
{{/each}}
@@ -94,6 +94,12 @@
+ {{#if usingBeatPreferences}}
+
+ {{paper-icon id="saveBeatPreferencesStar" icon="star"}}
+
+ {{/if}}
+
{{threshold}}
diff --git a/app/styles/app.scss b/app/styles/app.scss
index 1a7a714..00530fe 100644
--- a/app/styles/app.scss
+++ b/app/styles/app.scss
@@ -3,13 +3,13 @@
@import 'ember-modal-dialog/ember-modal-structure';
@import 'ember-modal-dialog/ember-modal-appearance';
-$playerBackColor: #F12B24;
$playerHeight: 400px;
$playerDefaultIconColor: #BBBBBB;
$footerHeight: 40px;
$playerBottomHeight: 340px;
+$secondaryThemeColor: #F12B24;
-// BRIDGE FINDER
+ // BRIDGE FINDER
html {
min-height: 100%;
height: auto;
@@ -67,7 +67,7 @@ md-switch[disabled=disabled], md-switch[disabled=disabled] .md-container, md-sli
.settingsItem.on md-icon.md-default-theme.group,
.settingsItem.on md-icon.md-default-theme.settings {
- color: #F12B24 !important;
+ color: $secondaryThemeColor !important;
}
.settingsItem:hover md-icon.group,
@@ -222,8 +222,8 @@ md-slider {
}
md-slider.md-default-theme .md-thumb:after {
- border-color: #F12B24;
- background-color: #F12B24;
+ border-color: $secondaryThemeColor;
+ background-color: $secondaryThemeColor;
}
.paper-sidenav {
@@ -420,7 +420,7 @@ md-switch.md-default-theme.md-checked .md-bar {
}
md-switch.md-default-theme.md-checked .md-thumb {
- background-color: #F12B24;
+ background-color: $secondaryThemeColor;
}
#playerControls {
@@ -464,7 +464,7 @@ md-switch.md-default-theme.md-checked .md-thumb {
}
.playerControllIcon.active {
- color: #F12B24 !important;
+ color: $secondaryThemeColor !important;
}
.playerControllIcon:hover {
@@ -521,7 +521,7 @@ md-switch.md-default-theme.md-checked .md-thumb {
}
#playerArea * .noUi-base {
- background-color: $playerBackColor;
+ background-color: $secondaryThemeColor;
border-radius: 5px;
}
@@ -530,7 +530,7 @@ md-switch.md-default-theme.md-checked .md-thumb {
}
.noUi-connect {
- background-color: $playerBackColor;
+ background-color: $secondaryThemeColor;
}
#volumeBar {
@@ -584,7 +584,7 @@ md-switch.md-default-theme.md-checked .md-thumb {
left: -6px;
opacity: 0;
transition-duration: 0.1s;
- background-color: $playerBackColor !important;
+ background-color: $secondaryThemeColor !important;
box-shadow: none;
}
@@ -960,5 +960,10 @@ $vibrateblurouter: 2px;
background: grey;
}
-
-
+#saveBeatPreferencesStar {
+ position: absolute;
+ top: 2px;
+ left: 3px;
+ color: #F12B24 !important;
+ font-size: 30px;
+}
diff --git a/bower.json b/bower.json
index ba3b435..bb751da 100644
--- a/bower.json
+++ b/bower.json
@@ -2,7 +2,7 @@
"name": "huegasm",
"dependencies": {
"bootstrap-sass": "~3.3.5",
- "ember": "~2.0.2",
+ "ember": "~2.1.0",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-data": "~2.1.0",
@@ -22,7 +22,7 @@
"three.js": "~0.72.0"
},
"resolutions": {
- "ember": "~2.0.2",
+ "ember": "~2.1.0",
"jquery": "~2.1.4"
}
}