forked from westlicht/performer
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from mebitek/feature_47
Feature 47
- Loading branch information
Showing
40 changed files
with
792 additions
and
312 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#pragma once | ||
|
||
#include "Config.h" | ||
#include "Types.h" | ||
#include "NoteSequence.h" | ||
#include "Serialize.h" | ||
#include "Routing.h" | ||
#include "FileDefs.h" | ||
#include "core/utils/StringUtils.h" | ||
|
||
|
||
class BaseTrack { | ||
public: | ||
static constexpr size_t NameLength = FileHeader::NameLength; | ||
|
||
// trackName | ||
const char *name() const { return _name; } | ||
void setName(const char *name) { | ||
StringUtils::copy(_name, name, sizeof(_name)); | ||
} | ||
|
||
protected: | ||
char _name[NameLength + 1]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
#pragma once | ||
|
||
#include "Config.h" | ||
#include "Types.h" | ||
#include "NoteSequence.h" | ||
#include "Serialize.h" | ||
#include "Routing.h" | ||
#include "FileDefs.h" | ||
#include "core/utils/StringUtils.h" | ||
|
||
|
||
class BaseTrackPatternFollow { | ||
public: | ||
|
||
// patternFollow | ||
Types::PatternFollow patternFollow() const { return _patternFollow; } | ||
void setPatternFollow(const Types::PatternFollow patternFollow) { | ||
_patternFollow = ModelUtils::clampedEnum(patternFollow); | ||
} | ||
|
||
void setPatternFollow(bool trackDisplay, bool trackLP) { | ||
|
||
if (trackDisplay && trackLP) { | ||
setPatternFollow(Types::PatternFollow::DispAndLP); | ||
return; | ||
} | ||
|
||
else if (trackDisplay) { | ||
setPatternFollow(Types::PatternFollow::Display); | ||
return; | ||
} | ||
|
||
else if (trackLP) { | ||
setPatternFollow(Types::PatternFollow::LaunchPad); | ||
return; | ||
} | ||
|
||
setPatternFollow(Types::PatternFollow::Off); | ||
|
||
return; | ||
} | ||
|
||
void setPatternFollowDisplay(bool trackDisplay) { | ||
const auto pattern_follow = patternFollow(); | ||
|
||
const bool lp_tracking = | ||
(pattern_follow == Types::PatternFollow::LaunchPad || | ||
pattern_follow == Types::PatternFollow::DispAndLP); | ||
|
||
setPatternFollow(trackDisplay, lp_tracking); | ||
} | ||
|
||
bool isPatternFollowDisplayOn() { | ||
const auto pattern_follow = patternFollow(); | ||
|
||
return (pattern_follow == Types::PatternFollow::Display || | ||
pattern_follow == Types::PatternFollow::DispAndLP); | ||
} | ||
|
||
|
||
void togglePatternFollowDisplay() { | ||
const auto pattern_follow = patternFollow(); | ||
|
||
const bool disp_tracking = isPatternFollowDisplayOn(); | ||
|
||
const bool lp_tracking = | ||
(pattern_follow == Types::PatternFollow::LaunchPad || | ||
pattern_follow == Types::PatternFollow::DispAndLP); | ||
|
||
setPatternFollow(not disp_tracking, lp_tracking); | ||
} | ||
|
||
void editPatternFollow(int value, bool shift) { | ||
setPatternFollow(ModelUtils::adjustedEnum(patternFollow(), value)); | ||
} | ||
|
||
void printPatternFollow(StringBuilder &str) const { | ||
str(Types::patternFollowName(patternFollow())); | ||
} | ||
|
||
protected: | ||
Types::PatternFollow _patternFollow; | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.