Skip to content

Commit

Permalink
Updated beat counter options.
Browse files Browse the repository at this point in the history
  • Loading branch information
kokernutz committed Sep 5, 2018
1 parent 8a0d831 commit 0d150c5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
**Changes from default screens:**

- Preferences: Edit Screens/Views/Definitions/Prefs.qml
- Global: **NEW** Toggle between Open and Camelot key (toggle in prefs)
- Global: Toggle between Open and Camelot key (toggle in prefs)
- Browser: Display 7 or 9 items on screen (toggle in prefs)
- Browser: Key offset to right of key (when potential match)
- Browser: Added color to key offset (green = up, yellow = down, blue = neighbor, red = maybe)
Expand All @@ -24,7 +24,7 @@
- Deck: Display original BPM
- Deck: Added minute markers
- Deck: Added track comment (toggle in prefs)
- Deck: Added beat countdown (toggle in prefs)
- Deck: **UPDATED** Toggle between beat countdown and beats from grid start (toggle in prefs)
- Deck: Always displays tempo offset
- Deck: Darkened portion of stripe already played
- Deck: Time remaining to right of stripe (toggle in prefs)
Expand Down
2 changes: 1 addition & 1 deletion Screens/Views/Deck/DeckHeader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ Item {
id: top_middle_text
explicitName: ""
deckId: deck_Id
visible: isLoaded && prefs.displayBeatCountdown
visible: isLoaded && (prefs.displayBeatCounter > 0)
width: fieldWidthWide
height: _intSetInState
anchors.top: parent.top
Expand Down
20 changes: 16 additions & 4 deletions Screens/Views/Deck/DeckHeaderText.qml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ Text {
State {
name: "remainingTime";
PropertyChanges { target: header_text; font.family: fontForNumber;
text: (!isLoaded)?"":computeBeatsToCueString(); }
text: (!isLoaded)?"":computeBeatCounter(); }
// text: (!isLoaded)?"":utils.computeRemainingTimeString(propTrackLength.value, propElapsedTime.value); }
},
//--------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -312,11 +312,23 @@ Text {
else return "SYNC";
}

function computeBeatsToCueString()
function computeBeatCounter()
{
if (propNextCuePoint.value == -1) return " ";

var beats = parseInt(((propNextCuePoint.value - propElapsedTime.value * 1000) * propMixerBpm.value) / 60000.0);
var beats;

switch (prefs.displayBeatCounter)
{
case 1:
beats = parseInt(((propNextCuePoint.value - propElapsedTime.value * 1000) * propMixerBpm.value) / 60000.0);
break;
case 2:
beats = parseInt(((propElapsedTime.value * 1000 - propGridOffset.value) * propMixerBpm.value) / 60000.0);
break;
default:
break;
}

var phraseLen = 4;
var phrase = parseInt(((beats / 4) / phraseLen) + 1);
Expand All @@ -325,7 +337,7 @@ Text {
if (bar < 0) bar = 0;
if (beat < 1) beat = 1;

return "-" + phrase.toString() + "." + bar.toString() + "." + beat.toString();
return (prefs.displayBeatCounter == 1 ? "-" : "") + phrase.toString() + "." + bar.toString() + "." + beat.toString();
}

}
2 changes: 1 addition & 1 deletion Screens/Views/Definitions/Prefs.qml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ readonly property bool displayMoreItems: true // toggle between 7 and 9 items o

// deck preferences
readonly property bool displayAlbumCover: true
readonly property bool displayBeatCountdown: true
readonly property int displayBeatCounter: 1 // 0 = off, 1 = Count Down To Next Cue Point, 2 = Count From Grid Start
readonly property bool displayPhaseMeter: true
readonly property bool displayTimeLeft: true
readonly property bool displayTrackComment: true
Expand Down

0 comments on commit 0d150c5

Please sign in to comment.