cleanup tracker class and move helper functions
This commit is contained in:
@@ -106,6 +106,7 @@ void MasterEditor::DrawFileDialog() {
|
||||
overworld_editor_.SetupROM(rom_);
|
||||
screen_editor_.SetupROM(rom_);
|
||||
palette_editor_.SetupROM(rom_);
|
||||
music_editor_.SetupROM(rom_);
|
||||
}
|
||||
ImGuiFileDialog::Instance()->Close();
|
||||
}
|
||||
|
||||
@@ -252,11 +252,13 @@ void MusicEditor::DrawToolset() {
|
||||
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", 6, toolset_table_flags_, ImVec2(0, 0))) {
|
||||
ImGui::TableSetupColumn("#play");
|
||||
ImGui::TableSetupColumn("#rewind");
|
||||
ImGui::TableSetupColumn("#fastforward");
|
||||
ImGui::TableSetupColumn("#volume");
|
||||
ImGui::TableSetupColumn("#debug");
|
||||
|
||||
ImGui::TableSetupColumn("#slider");
|
||||
|
||||
ImGui::TableNextColumn();
|
||||
@@ -271,6 +273,9 @@ void MusicEditor::DrawToolset() {
|
||||
BUTTON_COLUMN(ICON_MD_FAST_REWIND)
|
||||
BUTTON_COLUMN(ICON_MD_FAST_FORWARD)
|
||||
BUTTON_COLUMN(ICON_MD_VOLUME_UP)
|
||||
if (ImGui::Button(ICON_MD_ACCESS_TIME)) {
|
||||
music_tracker_.LoadSongs(rom_);
|
||||
}
|
||||
ImGui::TableNextColumn();
|
||||
ImGui::SliderInt("Volume", ¤t_volume, 0, 100);
|
||||
ImGui::EndTable();
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "app/editor/assembly_editor.h"
|
||||
#include "app/rom.h"
|
||||
#include "app/zelda3/tracker.h"
|
||||
#include "gui/canvas.h"
|
||||
#include "gui/icons.h"
|
||||
#include "gui/input.h"
|
||||
@@ -55,6 +57,7 @@ static constexpr absl::string_view kSongNotes[] = {
|
||||
class MusicEditor {
|
||||
public:
|
||||
void Update();
|
||||
void SetupROM(ROM& rom) { rom_ = rom; }
|
||||
|
||||
private:
|
||||
void DrawChannels();
|
||||
@@ -63,6 +66,9 @@ class MusicEditor {
|
||||
void DrawSongToolset();
|
||||
void DrawToolset();
|
||||
|
||||
zelda3::Tracker music_tracker_;
|
||||
ROM rom_;
|
||||
|
||||
Mix_Music* current_song_ = NULL;
|
||||
|
||||
AssemblyEditor assembly_editor_;
|
||||
|
||||
Reference in New Issue
Block a user