yaze 0.3.2
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::editor::MusicPlaybackControlPanel Class Reference

WindowContent for music playback controls and status display. More...

#include <music_playback_control_panel.h>

Inheritance diagram for yaze::editor::MusicPlaybackControlPanel:

Public Member Functions

 MusicPlaybackControlPanel (zelda3::music::MusicBank *music_bank, int *current_song_index, music::MusicPlayer *music_player)
 
std::string GetId () const override
 Unique identifier for this panel.
 
std::string GetDisplayName () const override
 Human-readable name shown in menus and title bars.
 
std::string GetIcon () const override
 Material Design icon for this panel.
 
std::string GetEditorCategory () const override
 Editor category this panel belongs to.
 
int GetPriority () const override
 Get display priority for menu ordering.
 
void SetOnOpenSong (std::function< void(int)> callback)
 
void SetOnOpenPianoRoll (std::function< void(int)> callback)
 
void Draw (bool *p_open) override
 Draw the panel content.
 
- Public Member Functions inherited from yaze::editor::WindowContent
virtual ~WindowContent ()=default
 
virtual void OnFirstDraw ()
 Called once before the first Draw() in a session.
 
virtual bool RequiresLazyInit () const
 Whether this panel uses lazy initialization.
 
void InvalidateLazyInit ()
 Reset lazy init state so OnFirstDraw() runs again.
 
virtual void OnOpen ()
 Called when panel becomes visible.
 
virtual void OnClose ()
 Called when panel is hidden.
 
virtual void OnFocus ()
 Called when panel receives focus.
 
virtual WindowLifecycle GetWindowLifecycle () const
 Get the lifecycle category for this window.
 
virtual WindowContextScope GetContextScope () const
 Optional context binding for this window (room/selection/etc)
 
virtual WindowScope GetScope () const
 Get the registration scope for this window.
 
virtual bool IsEnabled () const
 Check if this panel is currently enabled.
 
virtual std::string GetDisabledTooltip () const
 Get tooltip text when panel is disabled.
 
virtual std::string GetShortcutHint () const
 Get keyboard shortcut hint for display.
 
virtual std::string GetWorkflowGroup () const
 Optional workflow group for hack-centric actions.
 
virtual std::string GetWorkflowLabel () const
 Optional workflow label for menus/command palette.
 
virtual std::string GetWorkflowDescription () const
 Optional workflow description for menus/command palette.
 
virtual int GetWorkflowPriority () const
 Optional workflow ordering priority (lower sorts first).
 
virtual float GetPreferredWidth () const
 Get preferred width for this panel (optional)
 
virtual bool PreferAutoHideTabBar () const
 Whether the dock node hosting this panel should auto-hide its tab bar.
 
virtual bool IsVisibleByDefault () const
 Whether this panel should be visible by default.
 
virtual std::string GetParentPanelId () const
 Get parent panel ID for cascade behavior.
 
virtual bool CascadeCloseChildren () const
 Whether closing this panel should close child panels.
 
void DrawWithLazyInit (bool *p_open)
 Execute lazy initialization if needed, then call Draw()
 

Private Member Functions

void DrawToolset ()
 
void DrawSongInfo ()
 
void DrawPlaybackStatus ()
 
void DrawQuickActions ()
 
void DrawDebugControls ()
 

Private Attributes

zelda3::music::MusicBankmusic_bank_ = nullptr
 
int * current_song_index_ = nullptr
 
music::MusicPlayermusic_player_ = nullptr
 
int current_volume_ = 100
 
std::function< void(int)> on_open_song_
 
std::function< void(int)> on_open_piano_roll_
 
bool debug_paused_ = false
 
music::DspDebugStatus cached_dsp_
 
music::AudioQueueStatus cached_audio_
 
music::ApuDebugStatus cached_apu_
 
std::array< music::ChannelState, 8 > cached_channels_
 
int32_t avg_queue_delta_ = 0
 
uint64_t avg_cycle_rate_ = 0
 
std::chrono::steady_clock::time_point last_stats_time_
 
uint64_t last_cycles_for_rate_ = 0
 
uint32_t last_queued_for_rate_ = 0
 

Additional Inherited Members

- Protected Member Functions inherited from yaze::editor::WindowContent
void InvalidateCache ()
 Invalidate all cached computations.
 
template<typename T >
T & GetCached (const std::string &key, std::function< T()> compute)
 Get or compute a cached value.
 
bool IsCacheValid () const
 Check if cache has been invalidated.
 
void ClearCache ()
 Clear all cached values (more aggressive than InvalidateCache)
 

Detailed Description

WindowContent for music playback controls and status display.

Definition at line 29 of file music_playback_control_panel.h.

Constructor & Destructor Documentation

◆ MusicPlaybackControlPanel()

yaze::editor::MusicPlaybackControlPanel::MusicPlaybackControlPanel ( zelda3::music::MusicBank * music_bank,
int * current_song_index,
music::MusicPlayer * music_player )
inline

Definition at line 31 of file music_playback_control_panel.h.

Member Function Documentation

◆ GetId()

std::string yaze::editor::MusicPlaybackControlPanel::GetId ( ) const
inlineoverridevirtual

Unique identifier for this panel.

Returns
Panel ID in format "{category}.{name}" (e.g., "dungeon.room_selector")

IDs should be:

  • Lowercase with underscores
  • Prefixed with editor category
  • Unique across all panels

Implements yaze::editor::WindowContent.

Definition at line 42 of file music_playback_control_panel.h.

◆ GetDisplayName()

std::string yaze::editor::MusicPlaybackControlPanel::GetDisplayName ( ) const
inlineoverridevirtual

Human-readable name shown in menus and title bars.

Returns
Display name (e.g., "Room Selector")

Implements yaze::editor::WindowContent.

Definition at line 43 of file music_playback_control_panel.h.

◆ GetIcon()

std::string yaze::editor::MusicPlaybackControlPanel::GetIcon ( ) const
inlineoverridevirtual

Material Design icon for this panel.

Returns
Icon constant (e.g., ICON_MD_LIST)

Implements yaze::editor::WindowContent.

Definition at line 44 of file music_playback_control_panel.h.

References ICON_MD_PLAY_CIRCLE.

◆ GetEditorCategory()

std::string yaze::editor::MusicPlaybackControlPanel::GetEditorCategory ( ) const
inlineoverridevirtual

Editor category this panel belongs to.

Returns
Category name matching EditorType (e.g., "Dungeon", "Overworld")

Implements yaze::editor::WindowContent.

Definition at line 45 of file music_playback_control_panel.h.

◆ GetPriority()

int yaze::editor::MusicPlaybackControlPanel::GetPriority ( ) const
inlineoverridevirtual

Get display priority for menu ordering.

Returns
Priority value (lower = higher in list, default 50)

Reimplemented from yaze::editor::WindowContent.

Definition at line 46 of file music_playback_control_panel.h.

◆ SetOnOpenSong()

void yaze::editor::MusicPlaybackControlPanel::SetOnOpenSong ( std::function< void(int)> callback)
inline

Definition at line 52 of file music_playback_control_panel.h.

References on_open_song_.

◆ SetOnOpenPianoRoll()

void yaze::editor::MusicPlaybackControlPanel::SetOnOpenPianoRoll ( std::function< void(int)> callback)
inline

Definition at line 56 of file music_playback_control_panel.h.

References on_open_piano_roll_.

◆ Draw()

void yaze::editor::MusicPlaybackControlPanel::Draw ( bool * p_open)
inlineoverridevirtual

Draw the panel content.

Parameters
p_openPointer to visibility flag (nullptr if not closable)

Called by WorkspaceWindowManager when the panel is visible. Do NOT call ImGui::Begin/End - the PanelWindow wrapper handles that. Just draw your content directly.

Implements yaze::editor::WindowContent.

Definition at line 64 of file music_playback_control_panel.h.

References current_song_index_, DrawDebugControls(), DrawPlaybackStatus(), DrawQuickActions(), DrawSongInfo(), DrawToolset(), ICON_MD_KEYBOARD, and music_bank_.

◆ DrawToolset()

◆ DrawSongInfo()

void yaze::editor::MusicPlaybackControlPanel::DrawSongInfo ( )
inlineprivate

◆ DrawPlaybackStatus()

void yaze::editor::MusicPlaybackControlPanel::DrawPlaybackStatus ( )
inlineprivate

Definition at line 212 of file music_playback_control_panel.h.

References current_song_index_, yaze::zelda3::music::MusicBank::GetSong(), yaze::editor::music::MusicPlayer::GetState(), music_bank_, and music_player_.

Referenced by Draw().

Here is the call graph for this function:

◆ DrawQuickActions()

void yaze::editor::MusicPlaybackControlPanel::DrawQuickActions ( )
inlineprivate

◆ DrawDebugControls()

Member Data Documentation

◆ music_bank_

zelda3::music::MusicBank* yaze::editor::MusicPlaybackControlPanel::music_bank_ = nullptr
private

◆ current_song_index_

int* yaze::editor::MusicPlaybackControlPanel::current_song_index_ = nullptr
private

◆ music_player_

music::MusicPlayer* yaze::editor::MusicPlaybackControlPanel::music_player_ = nullptr
private

◆ current_volume_

int yaze::editor::MusicPlaybackControlPanel::current_volume_ = 100
private

Definition at line 604 of file music_playback_control_panel.h.

Referenced by DrawToolset().

◆ on_open_song_

std::function<void(int)> yaze::editor::MusicPlaybackControlPanel::on_open_song_
private

Definition at line 606 of file music_playback_control_panel.h.

Referenced by DrawQuickActions(), and SetOnOpenSong().

◆ on_open_piano_roll_

std::function<void(int)> yaze::editor::MusicPlaybackControlPanel::on_open_piano_roll_
private

Definition at line 607 of file music_playback_control_panel.h.

Referenced by DrawQuickActions(), and SetOnOpenPianoRoll().

◆ debug_paused_

bool yaze::editor::MusicPlaybackControlPanel::debug_paused_ = false
private

Definition at line 610 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ cached_dsp_

music::DspDebugStatus yaze::editor::MusicPlaybackControlPanel::cached_dsp_
private

Definition at line 611 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ cached_audio_

music::AudioQueueStatus yaze::editor::MusicPlaybackControlPanel::cached_audio_
private

Definition at line 612 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ cached_apu_

music::ApuDebugStatus yaze::editor::MusicPlaybackControlPanel::cached_apu_
private

Definition at line 613 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ cached_channels_

std::array<music::ChannelState, 8> yaze::editor::MusicPlaybackControlPanel::cached_channels_
private

Definition at line 614 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ avg_queue_delta_

int32_t yaze::editor::MusicPlaybackControlPanel::avg_queue_delta_ = 0
private

Definition at line 615 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ avg_cycle_rate_

uint64_t yaze::editor::MusicPlaybackControlPanel::avg_cycle_rate_ = 0
private

Definition at line 616 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ last_stats_time_

std::chrono::steady_clock::time_point yaze::editor::MusicPlaybackControlPanel::last_stats_time_
private

Definition at line 619 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ last_cycles_for_rate_

uint64_t yaze::editor::MusicPlaybackControlPanel::last_cycles_for_rate_ = 0
private

Definition at line 620 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().

◆ last_queued_for_rate_

uint32_t yaze::editor::MusicPlaybackControlPanel::last_queued_for_rate_ = 0
private

Definition at line 621 of file music_playback_control_panel.h.

Referenced by DrawDebugControls().


The documentation for this class was generated from the following file: