yaze 0.2.0
Link to the Past ROM Editor
 
Loading...
Searching...
No Matches
yaze::app::core::Controller Class Reference

Main controller for the application. More...

#include <controller.h>

Inheritance diagram for yaze::app::core::Controller:
Collaboration diagram for yaze::app::core::Controller:

Public Member Functions

bool IsActive () const
 
absl::Status OnEntry (std::string filename="")
 
void OnInput ()
 
absl::Status OnLoad ()
 
absl::Status OnTestLoad ()
 
void DoRender () const
 
void OnExit ()
 
absl::Status CreateWindow ()
 
absl::Status CreateRenderer ()
 
absl::Status CreateGuiContext ()
 
absl::Status LoadFontFamilies () const
 
absl::Status LoadAudioDevice ()
 
absl::Status LoadConfigFiles ()
 
void SetupScreen (std::string filename="")
 
auto editor_manager () -> editor::EditorManager &
 
auto renderer () -> SDL_Renderer *
 
auto window () -> SDL_Window *
 
void init_test_editor (editor::Editor *editor)
 
void set_active (bool active)
 
- Public Member Functions inherited from yaze::app::core::ExperimentFlags
 ExperimentFlags ()=default
 
virtual ~ExperimentFlags ()=default
 
auto flags () const
 
Flagsmutable_flags ()
 
std::string Serialize () const
 

Private Member Functions

friend int::main (int argc, char **argv)
 

Private Attributes

bool active_
 
Platform platform_
 
editor::Editortest_editor_
 
editor::EditorManager editor_manager_
 
int audio_frequency_ = 48000
 
SDL_AudioDeviceID audio_device_
 
std::shared_ptr< int16_t > audio_buffer_
 
std::shared_ptr< SDL_Window > window_
 

Detailed Description

Main controller for the application.

This class is responsible for managing the main window and the main editor. It is the main entry point for the application.

Definition at line 30 of file controller.h.

Member Function Documentation

◆ IsActive()

bool yaze::app::core::Controller::IsActive ( ) const
inline

Definition at line 32 of file controller.h.

References active_.

Referenced by main(), and yaze::test::integration::RunIntegrationTest().

◆ OnEntry()

absl::Status yaze::app::core::Controller::OnEntry ( std::string filename = "")

◆ OnInput()

void yaze::app::core::Controller::OnInput ( )

Definition at line 76 of file controller.cc.

References active_.

Referenced by main(), and yaze::test::integration::RunIntegrationTest().

◆ OnLoad()

absl::Status yaze::app::core::Controller::OnLoad ( )

Definition at line 123 of file controller.cc.

References active_, editor_manager_, yaze::app::core::kiOS, platform_, yaze::app::editor::EditorManager::quit(), RETURN_IF_ERROR, and yaze::app::editor::EditorManager::Update().

Referenced by main().

Here is the call graph for this function:

◆ OnTestLoad()

absl::Status yaze::app::core::Controller::OnTestLoad ( )

Definition at line 141 of file controller.cc.

References RETURN_IF_ERROR, test_editor_, and yaze::app::editor::Editor::Update().

Referenced by yaze::test::integration::RunIntegrationTest().

Here is the call graph for this function:

◆ DoRender()

void yaze::app::core::Controller::DoRender ( ) const

Definition at line 146 of file controller.cc.

References yaze::app::core::Renderer::GetInstance(), and renderer().

Referenced by main(), and yaze::test::integration::RunIntegrationTest().

Here is the call graph for this function:

◆ OnExit()

void yaze::app::core::Controller::OnExit ( )

Definition at line 154 of file controller.cc.

References audio_device_.

Referenced by main(), and yaze::test::integration::RunIntegrationTest().

◆ CreateWindow()

absl::Status yaze::app::core::Controller::CreateWindow ( )

Definition at line 163 of file controller.cc.

References yaze::app::core::ExperimentFlags::flags(), and window_.

Referenced by OnEntry(), and yaze::test::integration::RunIntegrationTest().

Here is the call graph for this function:

◆ CreateRenderer()

absl::Status yaze::app::core::Controller::CreateRenderer ( )

Definition at line 195 of file controller.cc.

References yaze::app::core::Renderer::CreateRenderer(), yaze::app::core::Renderer::GetInstance(), and window_.

Referenced by OnEntry(), and yaze::test::integration::RunIntegrationTest().

Here is the call graph for this function:

◆ CreateGuiContext()

absl::Status yaze::app::core::Controller::CreateGuiContext ( )

◆ LoadFontFamilies()

absl::Status yaze::app::core::Controller::LoadFontFamilies ( ) const

Definition at line 226 of file controller.cc.

References yaze::app::core::LoadPackageFonts().

Referenced by CreateGuiContext().

Here is the call graph for this function:

◆ LoadAudioDevice()

absl::Status yaze::app::core::Controller::LoadAudioDevice ( )

Definition at line 231 of file controller.cc.

References audio_buffer_, audio_device_, audio_frequency_, editor_manager_, and yaze::app::editor::EditorManager::emulator().

Referenced by OnEntry().

Here is the call graph for this function:

◆ LoadConfigFiles()

absl::Status yaze::app::core::Controller::LoadConfigFiles ( )

Definition at line 252 of file controller.cc.

References yaze::app::core::GetConfigDirectory(), and platform_.

Here is the call graph for this function:

◆ SetupScreen()

void yaze::app::core::Controller::SetupScreen ( std::string filename = "")
inline

Definition at line 47 of file controller.h.

References editor_manager_, and yaze::app::editor::EditorManager::SetupScreen().

Here is the call graph for this function:

◆ editor_manager()

auto yaze::app::core::Controller::editor_manager ( ) -> editor::EditorManager &
inline

Definition at line 50 of file controller.h.

References editor_manager_.

◆ renderer()

auto yaze::app::core::Controller::renderer ( ) -> SDL_Renderer *
inline

Definition at line 51 of file controller.h.

References yaze::app::core::Renderer::GetInstance(), and yaze::app::core::Renderer::renderer().

Referenced by CreateGuiContext(), and DoRender().

Here is the call graph for this function:

◆ window()

auto yaze::app::core::Controller::window ( ) -> SDL_Window *
inline

Definition at line 54 of file controller.h.

References window_.

Referenced by yaze::test::integration::RunIntegrationTest().

◆ init_test_editor()

void yaze::app::core::Controller::init_test_editor ( editor::Editor * editor)
inline

Definition at line 55 of file controller.h.

References test_editor_.

Referenced by yaze::test::integration::RunIntegrationTest().

◆ set_active()

void yaze::app::core::Controller::set_active ( bool active)
inline

Definition at line 56 of file controller.h.

References active_.

Referenced by yaze::test::integration::RunIntegrationTest().

◆ int::main()

yaze::app::core::Controller::int::main ( int argc,
char ** argv )
private

Member Data Documentation

◆ active_

bool yaze::app::core::Controller::active_
private

Definition at line 61 of file controller.h.

Referenced by IsActive(), OnEntry(), OnInput(), OnLoad(), and set_active().

◆ platform_

Platform yaze::app::core::Controller::platform_
private

Definition at line 62 of file controller.h.

Referenced by LoadConfigFiles(), OnEntry(), and OnLoad().

◆ test_editor_

editor::Editor* yaze::app::core::Controller::test_editor_
private

Definition at line 63 of file controller.h.

Referenced by init_test_editor(), and OnTestLoad().

◆ editor_manager_

editor::EditorManager yaze::app::core::Controller::editor_manager_
private

Definition at line 64 of file controller.h.

Referenced by editor_manager(), LoadAudioDevice(), OnEntry(), OnLoad(), and SetupScreen().

◆ audio_frequency_

int yaze::app::core::Controller::audio_frequency_ = 48000
private

Definition at line 66 of file controller.h.

Referenced by LoadAudioDevice().

◆ audio_device_

SDL_AudioDeviceID yaze::app::core::Controller::audio_device_
private

Definition at line 67 of file controller.h.

Referenced by LoadAudioDevice(), and OnExit().

◆ audio_buffer_

std::shared_ptr<int16_t> yaze::app::core::Controller::audio_buffer_
private

Definition at line 68 of file controller.h.

Referenced by LoadAudioDevice().

◆ window_

std::shared_ptr<SDL_Window> yaze::app::core::Controller::window_
private

Definition at line 69 of file controller.h.

Referenced by CreateGuiContext(), CreateRenderer(), CreateWindow(), and window().


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