update music editor and style colors
This commit is contained in:
3
.gitmodules
vendored
3
.gitmodules
vendored
@@ -22,3 +22,6 @@
|
|||||||
[submodule "src/lib/asar"]
|
[submodule "src/lib/asar"]
|
||||||
path = src/lib/asar
|
path = src/lib/asar
|
||||||
url = https://github.com/RPGHacker/asar.git
|
url = https://github.com/RPGHacker/asar.git
|
||||||
|
[submodule "src/lib/snes-spc-arm"]
|
||||||
|
path = src/lib/snes-spc-arm
|
||||||
|
url = https://github.com/nathancassano/snes-spc-arm.git
|
||||||
|
|||||||
@@ -9,36 +9,46 @@ namespace app {
|
|||||||
namespace editor {
|
namespace editor {
|
||||||
|
|
||||||
void MusicEditor::Update() {
|
void MusicEditor::Update() {
|
||||||
ImGui::Separator();
|
|
||||||
if (ImGui::BeginTable("MusicEditorColumns", 2, music_editor_flags_,
|
if (ImGui::BeginTable("MusicEditorColumns", 2, music_editor_flags_,
|
||||||
ImVec2(0, 0))) {
|
ImVec2(0, 0))) {
|
||||||
ImGui::TableSetupColumn("Assembly");
|
ImGui::TableSetupColumn("Assembly");
|
||||||
ImGui::TableSetupColumn("Composition");
|
ImGui::TableSetupColumn("Composition");
|
||||||
ImGui::TableHeadersRow();
|
ImGui::TableHeadersRow();
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
assembly_editor_.InlineUpdate();
|
assembly_editor_.InlineUpdate();
|
||||||
|
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
DrawToolset();
|
DrawToolset();
|
||||||
if (ImGuiID child_id = ImGui::GetID((void*)(intptr_t)9);
|
DrawChannels();
|
||||||
ImGui::BeginChild(child_id, ImVec2(0, 250), false)) {
|
|
||||||
DrawPianoStaff();
|
|
||||||
}
|
|
||||||
ImGui::EndChild();
|
|
||||||
DrawPianoRoll();
|
DrawPianoRoll();
|
||||||
|
|
||||||
ImGui::EndTable();
|
ImGui::EndTable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MusicEditor::DrawChannels() {
|
||||||
|
if (ImGui::BeginTabBar("MyTabBar", ImGuiTabBarFlags_None)) {
|
||||||
|
for (int i = 1; i <= 8; ++i) {
|
||||||
|
if (ImGui::BeginTabItem(absl::StrFormat("%d", i).data())) {
|
||||||
|
DrawPianoStaff();
|
||||||
|
ImGui::EndTabItem();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGui::EndTabBar();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static const int NUM_KEYS = 25;
|
static const int NUM_KEYS = 25;
|
||||||
static bool keys[NUM_KEYS];
|
static bool keys[NUM_KEYS];
|
||||||
|
|
||||||
void MusicEditor::DrawPianoStaff() {
|
void MusicEditor::DrawPianoStaff() {
|
||||||
|
if (ImGuiID child_id = ImGui::GetID((void*)(intptr_t)9);
|
||||||
|
ImGui::BeginChild(child_id, ImVec2(0, 170), false)) {
|
||||||
const int NUM_LINES = 5;
|
const int NUM_LINES = 5;
|
||||||
const int LINE_THICKNESS = 2;
|
const int LINE_THICKNESS = 2;
|
||||||
const int LINE_SPACING = 50;
|
const int LINE_SPACING = 40;
|
||||||
|
|
||||||
// Get the draw list for the current window
|
// Get the draw list for the current window
|
||||||
ImDrawList* draw_list = ImGui::GetWindowDrawList();
|
ImDrawList* draw_list = ImGui::GetWindowDrawList();
|
||||||
@@ -68,6 +78,8 @@ void MusicEditor::DrawPianoStaff() {
|
|||||||
LINE_THICKNESS);
|
LINE_THICKNESS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ImGui::EndChild();
|
||||||
|
}
|
||||||
|
|
||||||
void MusicEditor::DrawPianoRoll() {
|
void MusicEditor::DrawPianoRoll() {
|
||||||
// Render the piano roll
|
// Render the piano roll
|
||||||
@@ -151,7 +163,9 @@ void MusicEditor::DrawToolset() {
|
|||||||
static int current_volume = 0;
|
static int current_volume = 0;
|
||||||
const int MAX_VOLUME = 100;
|
const int MAX_VOLUME = 100;
|
||||||
gui::ItemLabel("Select a song to edit: ", gui::ItemLabelFlags::Left);
|
gui::ItemLabel("Select a song to edit: ", gui::ItemLabelFlags::Left);
|
||||||
ImGui::Combo("#controls", &selected_option, kGameSongs, 30);
|
ImGui::Combo("#songs_in_game", &selected_option, kGameSongs, 30);
|
||||||
|
|
||||||
|
gui::ItemLabel("Controls: ", gui::ItemLabelFlags::Left);
|
||||||
if (ImGui::BeginTable("SongToolset", 5, toolset_table_flags_, ImVec2(0, 0))) {
|
if (ImGui::BeginTable("SongToolset", 5, toolset_table_flags_, ImVec2(0, 0))) {
|
||||||
ImGui::TableSetupColumn("#play");
|
ImGui::TableSetupColumn("#play");
|
||||||
ImGui::TableSetupColumn("#rewind");
|
ImGui::TableSetupColumn("#rewind");
|
||||||
@@ -176,28 +190,11 @@ void MusicEditor::DrawToolset() {
|
|||||||
static int current_time = 0; // current time in the song in seconds
|
static int current_time = 0; // current time in the song in seconds
|
||||||
|
|
||||||
// Display the current time in the song
|
// Display the current time in the song
|
||||||
ImGui::Text("Current Time: %d:%02d", current_time / 60, current_time % 60);
|
gui::ItemLabel("Current Time: ", gui::ItemLabelFlags::Left);
|
||||||
|
ImGui::Text("%d:%02d", current_time / 60, current_time % 60);
|
||||||
|
ImGui::SameLine();
|
||||||
// Display the song duration/progress using a progress bar
|
// Display the song duration/progress using a progress bar
|
||||||
ImGui::ProgressBar((float)current_time / SONG_DURATION);
|
ImGui::ProgressBar((float)current_time / SONG_DURATION);
|
||||||
|
|
||||||
// Allow the user to seek to a specific time in the song using a slider
|
|
||||||
ImGui::SliderInt("Seek Time", ¤t_time, 0, SONG_DURATION);
|
|
||||||
|
|
||||||
if (ImGui::BeginTable("ChannelToolset", 9, toolset_table_flags_,
|
|
||||||
ImVec2(0, 0))) {
|
|
||||||
ImGui::TableSetupColumn("#Channels");
|
|
||||||
for (int i = 0; i < 3; i++) {
|
|
||||||
ImGui::TableSetupColumn(absl::StrFormat("#%d", i).data());
|
|
||||||
}
|
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++) {
|
|
||||||
ImGui::TableNextColumn();
|
|
||||||
ImGui::Button(absl::StrFormat("%d", i).data());
|
|
||||||
}
|
|
||||||
|
|
||||||
ImGui::EndTable();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ class MusicEditor {
|
|||||||
void Update();
|
void Update();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void DrawChannels();
|
||||||
void DrawPianoStaff();
|
void DrawPianoStaff();
|
||||||
void DrawPianoRoll();
|
void DrawPianoRoll();
|
||||||
void DrawSongToolset();
|
void DrawSongToolset();
|
||||||
@@ -63,6 +64,13 @@ class MusicEditor {
|
|||||||
ImGuiTableFlags music_editor_flags_ = ImGuiTableFlags_SizingFixedFit |
|
ImGuiTableFlags music_editor_flags_ = ImGuiTableFlags_SizingFixedFit |
|
||||||
ImGuiTableFlags_Resizable |
|
ImGuiTableFlags_Resizable |
|
||||||
ImGuiTableFlags_Reorderable;
|
ImGuiTableFlags_Reorderable;
|
||||||
|
|
||||||
|
ImGuiTableFlags channel_table_flags_ =
|
||||||
|
ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable |
|
||||||
|
ImGuiTableFlags_Hideable | ImGuiTableFlags_Sortable |
|
||||||
|
ImGuiTableFlags_SortMulti | ImGuiTableFlags_RowBg |
|
||||||
|
ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV |
|
||||||
|
ImGuiTableFlags_NoBordersInBody | ImGuiTableFlags_ScrollY;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace editor
|
} // namespace editor
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ void ColorsYaze() {
|
|||||||
|
|
||||||
colors[ImGuiCol_Tab] = alttpDarkGreen;
|
colors[ImGuiCol_Tab] = alttpDarkGreen;
|
||||||
colors[ImGuiCol_TabHovered] = alttpMidGreen;
|
colors[ImGuiCol_TabHovered] = alttpMidGreen;
|
||||||
colors[ImGuiCol_TabActive] = ImLerp(colors[ImGuiCol_HeaderActive],
|
colors[ImGuiCol_TabActive] = ImVec4(0.347f, 0.466f, 0.347f, 1.000f);
|
||||||
colors[ImGuiCol_TitleBgActive], 0.60f);
|
|
||||||
|
|
||||||
colors[ImGuiCol_Button] = alttpMidGreen;
|
colors[ImGuiCol_Button] = alttpMidGreen;
|
||||||
colors[ImGuiCol_ButtonHovered] = allttpLightestGreen;
|
colors[ImGuiCol_ButtonHovered] = allttpLightestGreen;
|
||||||
|
|||||||
1
src/lib/snes-spc-arm
Submodule
1
src/lib/snes-spc-arm
Submodule
Submodule src/lib/snes-spc-arm added at 609c02b008
Reference in New Issue
Block a user