Skip to content

Commit

Permalink
Added project metadata UI
Browse files Browse the repository at this point in the history
  • Loading branch information
SwadicalRag committed Jan 3, 2021
1 parent 3335dbd commit 146dcf6
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/controllers/muonproject.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class MuonProjectController extends GetxController {
}

int getLabelMillisecondOffset() {
return (this.beatsPerMeasure / (this.bpm.value / 60) * 1000).round();
return (this.beatsPerMeasure / (this.bpm.value / 60) * 1000 * (4 / this.beatValue.value)).round();
}

void updateWith(MuonProjectController controller) {
Expand Down
6 changes: 5 additions & 1 deletion lib/controllers/muonvoice.dart
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ class MuonVoiceController extends GetxController {
Directory(project.getProjectFilePath("neutrino/")).createSync();
}

print(getRawProgramPath("model/" + (modelName.value) + "/"));
if(!Directory(project.getProjectFilePath("label/timing/")).existsSync()) {
Directory(project.getProjectFilePath("label/timing/")).createSync();
}

print(getRawProgramPath("label/timing/" + voiceFileName + ".lab"));
await Process.run(getProgramPath("NEUTRINO"), [
project.getProjectFilePath("label/full/" + voiceFileName + ".lab"),
project.getProjectFilePath("label/timing/" + voiceFileName + ".lab"),
Expand Down
60 changes: 55 additions & 5 deletions lib/editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -788,14 +788,64 @@ class _MuonEditorState extends State<MuonEditor> {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: Container(

Container(
child: Column(
children: [
SizedBox(height: 10),
Align(
alignment: Alignment.center,
child: Text("Project Settings",style: TextStyle(fontSize: 26),)
),
SizedBox(height: 10),
Align(
alignment: Alignment.center,
child: Obx(() => Text(currentProject.bpm.value.toString() + " BPM",style: TextStyle(fontSize: 16),))
),
Obx(() => Slider(
value: currentProject.bpm.value,
min: 40,
max: 240,
divisions: 200,
label: currentProject.bpm.value.toString() + " bpm",
onChanged: (double value) {
currentProject.bpm.value = value.floorToDouble();
},
)),
SizedBox(height: 10),
Align(
alignment: Alignment.center,
child: Obx(() => Text(currentProject.beatsPerMeasure.value.toString() + " Beats per Measure",style: TextStyle(fontSize: 16),))
),
Obx(() => Slider(
value: currentProject.beatsPerMeasure.value.toDouble(),
min: 1,
max: 32,
divisions: 32,
label: currentProject.beatsPerMeasure.value.toString() + " beats",
onChanged: (double value) {
currentProject.beatsPerMeasure.value = value.round();
},
)),
SizedBox(height: 10),
Align(
alignment: Alignment.center,
child: Obx(() => Text("Beat Value of 1 / " + currentProject.beatValue.value.toString(),style: TextStyle(fontSize: 16),))
),
Obx(() => Slider(
value: log(currentProject.beatValue.value) / log(2),
min: 1,
max: 5,
divisions: 4,
label: "1 / " + currentProject.beatValue.value.toString(),
onChanged: (double value) {
currentProject.beatValue.value = pow(2,value.round());
},
)),
],
)
),
const SizedBox(height: 10),
Container(
height: 230,
Expanded(
child: Container(
child: Column(
verticalDirection: VerticalDirection.up,
Expand Down

0 comments on commit 146dcf6

Please sign in to comment.