OSDN Git Service

[VM][SOUND][Qt] Remove USE_MULTIPLE_SPEAKER, using upstream's APIs.
[csp-qt/common_source_project-fm7.git] / source / src / qt / common / emu_thread.h
index 4b18141..e5e0633 100644 (file)
@@ -11,6 +11,7 @@
 #define _CSP_QT_EMU_THREAD_H
 
 #include <QThread>
+#include <QElapsedTimer>
 
 #include "common.h"
 #include "commonclasses.h"
 class META_MainWindow;
 class EMU;
 class QString;
+class QWaitCondition;
 
 #ifndef MAX_HISTORY
 #define MAX_HISTORY 8
 #endif
 
 QT_BEGIN_NAMESPACE
+#define MAX_COMMAND_LEN        64
 
 class EmuThreadClass : public QThread {
        Q_OBJECT
@@ -39,10 +42,16 @@ private:
        bool tape_rec_flag;
        int tape_pos;
        bool mouse_flag;
+       char dbg_prev_command[MAX_COMMAND_LEN];
+
        int get_interval(void);
+       
  protected:
        EMU *p_emu;
+       QWaitCondition *drawCond;
        class META_MainWindow *MainWindow;
+       QElapsedTimer tick_timer;
+       
        bool bRunThread;
        bool bResetReq;
        bool bSpecialResetReq;
@@ -52,9 +61,15 @@ private:
        bool bStartRecordSoundReq;
        bool bStopRecordSoundReq;
        bool draw_timing;
+       bool doing_debug_command;
+#if defined(USE_SOUND_VOLUME)
+       bool bUpdateVolumeReq[USE_SOUND_VOLUME];
+       int volume_balance[USE_SOUND_VOLUME];
+       int volume_avg[USE_SOUND_VOLUME];
+#endif
        
-       uint32 next_time;
-       uint32 update_fps_time;
+       qint64 next_time;
+       qint64 update_fps_time;
        bool prev_skip;
        int total_frames;
        int draw_frames;
@@ -72,6 +87,8 @@ private:
        QString clipBoardText;
 #endif
        void sample_access_drv(void);
+       void EmuThreadClass::calc_volume_from_balance(int num, int balance);
+       void EmuThreadClass::calc_volume_from_level(int num, int level);
 public:
        EmuThreadClass(META_MainWindow *rootWindow, EMU *pp_emu, QObject *parent = 0);
        ~EmuThreadClass();
@@ -82,6 +99,7 @@ public:
        void run() { doWork("");}
        EmuThreadClass *currentHandler();
        void resize_screen(int sw, int sh, int stw, int sth);
+       bool now_debugging();
 public slots:
        void doWork(const QString &param);
        void doExit(void);
@@ -93,8 +111,10 @@ public slots:
        void doUpdateConfig();
        void doStartRecordSound();
        void doStopRecordSound();
-       void doSetDisplaySize(int w, int h, bool flag);
-       
+       void doSetDisplaySize(int w, int h, int ww, int wh);
+       void doUpdateVolumeLevel(int num, int level);
+       void doUpdateVolumeBalance(int num, int level);
+
        void moved_mouse(int, int);
        void button_pressed_mouse(Qt::MouseButton);
        void button_released_mouse(Qt::MouseButton);
@@ -137,9 +157,12 @@ public slots:
        void do_start_auto_key(QString text);
        void do_stop_auto_key(void);
        void do_draw_timing(bool);
+       void do_call_debugger_command(QString s);
+       void do_close_debugger(void);
+       
 signals:
        int message_changed(QString);
-       int sig_draw_thread(void);
+       int sig_draw_thread(bool);
        int quit_draw_thread(void);
        int sig_screen_aspect(int);
        int sig_screen_size(int, int);
@@ -165,8 +188,12 @@ signals:
 #ifdef SUPPORT_DUMMY_DEVICE_LED
        int sig_send_data_led(quint32);
 #endif
+
        int sig_resize_screen(int, int);
        int sig_resize_uibar(int, int);
+       int sig_auto_key_string(QByteArray);
+       int sig_debugger_input(QString);
+       int sig_quit_debugger();
 };
 
 QT_END_NAMESPACE