Skip to content

Commit 414a0a6

Browse files
authored
Merge pull request #2 from soficis/copilot/sub-pr-1
[WIP] Update build system and refactor controller based on feedback
2 parents cb118d5 + 9cf3cdf commit 414a0a6

4 files changed

Lines changed: 11 additions & 3 deletions

File tree

src/domain/JsonSerialization.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
#include <algorithm>
44

5+
#include "domain/ProjectProfile.h"
6+
57
namespace automix::domain {
68

79
void to_json(Json& j, const Stem& value) {
@@ -293,7 +295,7 @@ void from_json(const Json& j, Session& value) {
293295
value.buses = j.value("buses", std::vector<Bus>{});
294296
value.projectProfileId = j.value("projectProfileId", "default");
295297
value.safetyPolicyId = j.value("safetyPolicyId", "balanced");
296-
value.preferredStemCount = std::clamp(j.value("preferredStemCount", 4), 2, 6);
298+
value.preferredStemCount = std::clamp(j.value("preferredStemCount", 4), kMinPreferredStemCount, kMaxPreferredStemCount);
297299

298300
const auto timelineJson = j.value("timeline", Json::object());
299301
value.timeline.loopEnabled = timelineJson.value("loopEnabled", false);

src/domain/ProjectProfile.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ProjectProfile profileFromJson(const nlohmann::json& json) {
2424
profile.mixModelPackId = json.value("mixModelPackId", "none");
2525
profile.masterModelPackId = json.value("masterModelPackId", "none");
2626
profile.safetyPolicyId = json.value("safetyPolicyId", "balanced");
27-
profile.preferredStemCount = std::clamp(json.value("preferredStemCount", 4), 2, 6);
27+
profile.preferredStemCount = std::clamp(json.value("preferredStemCount", 4), kMinPreferredStemCount, kMaxPreferredStemCount);
2828
profile.metadataPolicy = json.value("metadataPolicy", "copy_common");
2929
if (profile.metadataPolicy != "copy_all" &&
3030
profile.metadataPolicy != "copy_common" &&

src/domain/ProjectProfile.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88

99
namespace automix::domain {
1010

11+
// Stem count constraints for audio separation.
12+
// Maximum of 6 stems is based on common separation models (vocals, drums, bass, guitar, keys, other)
13+
// and practical UI/performance limits for real-time mixing workflows.
14+
constexpr int kMinPreferredStemCount = 2;
15+
constexpr int kMaxPreferredStemCount = 6;
16+
1117
struct ProjectProfile {
1218
std::string id;
1319
std::string name;

tools/commands/DevToolsUtils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,7 @@ std::optional<automix::domain::ProjectProfile> projectProfileFromJson(const nloh
693693
profile.mixModelPackId = json.value("mixModelPackId", "none");
694694
profile.masterModelPackId = json.value("masterModelPackId", "none");
695695
profile.safetyPolicyId = json.value("safetyPolicyId", "balanced");
696-
profile.preferredStemCount = std::clamp(json.value("preferredStemCount", 4), 2, 6);
696+
profile.preferredStemCount = std::clamp(json.value("preferredStemCount", 4), kMinPreferredStemCount, kMaxPreferredStemCount);
697697
profile.metadataPolicy = json.value("metadataPolicy", "copy_common");
698698
if (profile.metadataPolicy != "copy_all" &&
699699
profile.metadataPolicy != "copy_common" &&

0 commit comments

Comments
 (0)