A class for editing music data in a Rom. More...
#include <music_editor.h>

Public Member Functions | |
| MusicEditor (Rom *rom=nullptr) | |
| void | Initialize () override |
| absl::Status | Load () override |
| absl::Status | Save () override |
| absl::Status | Update () override |
| absl::Status | Cut () override |
| absl::Status | Copy () override |
| absl::Status | Paste () override |
| absl::Status | Undo () override |
| absl::Status | Redo () override |
| absl::Status | Find () override |
| void | set_rom (Rom *rom) |
| Rom * | rom () const |
| void | set_emulator (emu::Emulator *emulator) |
| emu::Emulator * | emulator () const |
| void | PlaySong (int song_id) |
| void | StopSong () |
| void | SetVolume (float volume) |
Public Member Functions inherited from yaze::editor::Editor | |
| Editor ()=default | |
| virtual | ~Editor ()=default |
| void | SetDependencies (const EditorDependencies &deps) |
| virtual absl::Status | Clear () |
| EditorType | type () const |
| bool * | active () |
| void | set_active (bool active) |
| void | toggle_active () |
| virtual bool | IsRomLoaded () const |
| virtual std::string | GetRomStatus () const |
Private Member Functions | |
| void | DrawTrackerView () |
| void | DrawInstrumentEditor () |
| void | DrawSampleEditor () |
| void | DrawToolset () |
| void | StartPlayback () |
| void | StopPlayback () |
| void | UpdatePlayback () |
Private Attributes | |
| AssemblyEditor | assembly_editor_ |
| zelda3::music::Tracker | music_tracker_ |
| int | current_song_index_ = 0 |
| int | current_pattern_index_ = 0 |
| int | current_channel_index_ = 0 |
| bool | is_playing_ = false |
| std::vector< bool > | channel_muted_ = std::vector<bool>(8, false) |
| std::vector< bool > | channel_soloed_ = std::vector<bool>(8, false) |
| std::vector< std::string > | song_names_ |
| ImGuiTableFlags | music_editor_flags_ |
| ImGuiTableFlags | toolset_table_flags_ |
| Rom * | rom_ |
| emu::Emulator * | emulator_ = nullptr |
Additional Inherited Members | |
Protected Member Functions inherited from yaze::editor::Editor | |
| std::string | MakeCardTitle (const std::string &base_title) const |
| std::string | MakeCardId (const std::string &base_id) const |
| template<typename T > | |
| absl::StatusOr< T > | SafeRomAccess (std::function< T()> accessor, const std::string &operation="") const |
Protected Attributes inherited from yaze::editor::Editor | |
| bool | active_ = false |
| EditorType | type_ |
| EditorDependencies | dependencies_ |
A class for editing music data in a Rom.
Definition at line 65 of file music_editor.h.
|
inlineexplicit |
Definition at line 67 of file music_editor.h.
References yaze::editor::kMusic, and yaze::editor::Editor::type_.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 16 of file music_editor.cc.
References yaze::editor::EditorDependencies::card_registry, yaze::editor::Editor::dependencies_, ICON_MD_CODE, ICON_MD_MUSIC_NOTE, ICON_MD_PIANO, and yaze::editor::EditorCardRegistry::RegisterCard().

|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 34 of file music_editor.cc.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 73 of file music_editor.h.
|
overridevirtual |
Implements yaze::editor::Editor.
Definition at line 39 of file music_editor.cc.
References assembly_editor_, yaze::gui::EditorCard::Begin(), yaze::editor::EditorDependencies::card_registry, yaze::editor::Editor::dependencies_, DrawInstrumentEditor(), DrawTrackerView(), yaze::gui::EditorCard::End(), ICON_MD_CODE, ICON_MD_MUSIC_NOTE, ICON_MD_PIANO, yaze::editor::AssemblyEditor::InlineUpdate(), and yaze::gui::EditorCard::SetDefaultSize().
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 75 of file music_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 76 of file music_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 77 of file music_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 78 of file music_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 79 of file music_editor.h.
|
inlineoverridevirtual |
Implements yaze::editor::Editor.
Definition at line 80 of file music_editor.h.
|
inline |
|
inline |
Definition at line 86 of file music_editor.h.
References rom_.
Referenced by DrawToolset(), and set_rom().
|
inline |
Definition at line 89 of file music_editor.h.
References emulator(), and emulator_.

|
inline |
| void yaze::editor::MusicEditor::PlaySong | ( | int | song_id | ) |
Definition at line 271 of file music_editor.cc.
References yaze::emu::Emulator::audio_backend(), emulator_, is_playing_, LOG_ERROR, LOG_INFO, LOG_WARN, and yaze::emu::Emulator::snes().

| void yaze::editor::MusicEditor::StopSong | ( | ) |
Definition at line 304 of file music_editor.cc.
References yaze::emu::Emulator::audio_backend(), emulator_, is_playing_, LOG_ERROR, LOG_INFO, and yaze::emu::Emulator::snes().

| void yaze::editor::MusicEditor::SetVolume | ( | float | volume | ) |
Definition at line 323 of file music_editor.cc.
References yaze::emu::Emulator::audio_backend(), emulator_, LOG_DEBUG, and LOG_WARN.

|
private |
Definition at line 186 of file music_editor.cc.
References DrawToolset().
Referenced by Update().

|
private |
Definition at line 194 of file music_editor.cc.
Referenced by Update().
|
private |
|
private |
Definition at line 201 of file music_editor.cc.
References ICON_MD_ACCESS_TIME, ICON_MD_FAST_FORWARD, ICON_MD_FAST_REWIND, ICON_MD_PLAY_ARROW, ICON_MD_STOP, ICON_MD_VOLUME_UP, yaze::gui::ItemLabel(), yaze::zelda3::music::Tracker::LoadSongs(), music_tracker_, rom(), and toolset_table_flags_.
Referenced by DrawTrackerView().

|
private |
|
private |
|
private |
|
private |
Definition at line 109 of file music_editor.h.
Referenced by Update().
|
private |
Definition at line 110 of file music_editor.h.
Referenced by DrawToolset().
|
private |
Definition at line 114 of file music_editor.h.
|
private |
Definition at line 115 of file music_editor.h.
|
private |
Definition at line 116 of file music_editor.h.
|
private |
Definition at line 117 of file music_editor.h.
Referenced by PlaySong(), and StopSong().
|
private |
Definition at line 118 of file music_editor.h.
|
private |
Definition at line 119 of file music_editor.h.
|
private |
Definition at line 120 of file music_editor.h.
|
private |
Definition at line 122 of file music_editor.h.
|
private |
Definition at line 126 of file music_editor.h.
Referenced by DrawToolset().
|
private |
Definition at line 130 of file music_editor.h.
|
private |
Definition at line 131 of file music_editor.h.
Referenced by emulator(), PlaySong(), set_emulator(), SetVolume(), and StopSong().