mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 17:45:45 -04:00
Android: It builds again, but needs a lot more work
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
#include "YBaseLib/Event.h"
|
||||
#include "YBaseLib/Timer.h"
|
||||
#include "common/event.h"
|
||||
#include "core/host_interface.h"
|
||||
#include <array>
|
||||
#include <atomic>
|
||||
@ -19,42 +18,48 @@ public:
|
||||
AndroidHostInterface(jobject java_object);
|
||||
~AndroidHostInterface() override;
|
||||
|
||||
bool Initialize() override;
|
||||
void Shutdown() override;
|
||||
|
||||
void ReportError(const char* message) override;
|
||||
void ReportMessage(const char* message) override;
|
||||
|
||||
bool IsEmulationThreadRunning() const { return m_emulation_thread.joinable(); }
|
||||
bool StartEmulationThread(ANativeWindow* initial_surface, std::string initial_filename,
|
||||
std::string initial_state_filename);
|
||||
bool StartEmulationThread(ANativeWindow* initial_surface, SystemBootParameters boot_params);
|
||||
void RunOnEmulationThread(std::function<void()> function, bool blocking = false);
|
||||
void StopEmulationThread();
|
||||
|
||||
void SurfaceChanged(ANativeWindow* window, int format, int width, int height);
|
||||
void SurfaceChanged(ANativeWindow* surface, int format, int width, int height);
|
||||
|
||||
void SetControllerType(u32 index, std::string_view type_name);
|
||||
void SetControllerButtonState(u32 index, s32 button_code, bool pressed);
|
||||
|
||||
protected:
|
||||
void SetUserDirectory() override;
|
||||
bool AcquireHostDisplay() override;
|
||||
void ReleaseHostDisplay() override;
|
||||
std::unique_ptr<AudioStream> CreateAudioStream(AudioBackend backend) override;
|
||||
|
||||
private:
|
||||
enum : u32
|
||||
{
|
||||
NUM_CONTROLLERS = 2
|
||||
};
|
||||
|
||||
void EmulationThreadEntryPoint(ANativeWindow* initial_surface, std::string initial_filename,
|
||||
std::string initial_state_filename);
|
||||
void EmulationThreadEntryPoint(ANativeWindow* initial_surface, SystemBootParameters boot_params);
|
||||
|
||||
void CreateImGuiContext();
|
||||
void DestroyImGuiContext();
|
||||
void DrawImGui();
|
||||
|
||||
void DrawFPSWindow();
|
||||
|
||||
jobject m_java_object = {};
|
||||
|
||||
ANativeWindow* m_surface = nullptr;
|
||||
|
||||
std::mutex m_callback_mutex;
|
||||
std::deque<std::function<void()>> m_callback_queue;
|
||||
|
||||
std::thread m_emulation_thread;
|
||||
std::atomic_bool m_emulation_thread_stop_request{false};
|
||||
std::atomic_bool m_emulation_thread_start_result{false};
|
||||
Event m_emulation_thread_started;
|
||||
Common::Event m_emulation_thread_started;
|
||||
};
|
||||
|
Reference in New Issue
Block a user