48 LOG_INFO(
"App",
"Initializing Application instance...");
63 LOG_INFO(
"App",
"Found pending ROM load: %s", start_path.c_str());
64 }
else if (!start_path.empty()) {
65 LOG_INFO(
"App",
"Using configured startup ROM: %s", start_path.c_str());
67 LOG_INFO(
"App",
"No pending ROM, starting empty.");
70 LOG_INFO(
"App",
"WASM build - ROM loading handled via wasm_bootstrap queue.");
78 LOG_ERROR(
"App",
"Failed to initialize controller: %s",
79 std::string(status.message()).c_str());
85 LOG_INFO(
"App",
"Controller initialized successfully. Active: %s",
93 if (!start_path.empty() &&
controller_->editor_manager()) {
100 LOG_INFO(
"App",
"Initializing Unified gRPC Server...");
101 canvas_automation_service_ =
102 std::make_unique<CanvasAutomationServiceImpl>();
103 grpc_server_ = std::make_unique<YazeGRPCServer>();
105 auto rom_getter = [
this]() {
108 auto rom_loader = [
this](
const std::string& path) ->
bool {
111 auto status =
controller_->editor_manager()->OpenRomOrProject(path);
118 LOG_INFO(
"App",
"Using Mesen2 backend for emulator service");
120 std::make_unique<emu::mesen::MesenEmulatorAdapter>();
121 emulator_interface = emulator_backend_.get();
125 internal_emulator = &
controller_->editor_manager()->emulator();
128 "EditorManager not ready; internal emulator services may be "
133 std::make_unique<emu::InternalEmulatorAdapter>(internal_emulator);
136 adapter->SetRomLoader([
this](
const std::string& path) ->
bool {
139 auto status =
controller_->editor_manager()->OpenRomOrProject(path);
143 adapter->SetRomGetter(
144 [
this]() {
return controller_->GetCurrentRom(); });
146 emulator_backend_ = std::move(adapter);
147 emulator_interface = emulator_backend_.get();
151 auto status = grpc_server_->Initialize(
156 canvas_automation_service_.get());
159 status = grpc_server_->StartAsync();
161 LOG_ERROR(
"App",
"Failed to start gRPC server: %s",
162 std::string(status.message()).c_str());
164 LOG_INFO(
"App",
"Unified gRPC server started on port %d",
168 LOG_ERROR(
"App",
"Failed to initialize gRPC server: %s",
169 std::string(status.message()).c_str());
173 if (canvas_automation_service_) {
175 canvas_automation_service_.get());
183 yaze::app::wasm::SetRomLoadHandler(
189 const char* runtime_dir = std::getenv(
"XDG_RUNTIME_DIR");
190 const char* status_dir = (runtime_dir && *runtime_dir) ? runtime_dir :
"/tmp";
192 absl::StrFormat(
"%s/yaze-%d.status", status_dir, pid));
194 LOG_INFO(
"App",
"Activity file created: %s",
::yaze::EventBus * event_bus()
Get the current EventBus instance.