#ifndef Main_Widget_H
#define Main_Widget_H
#include "../Global.h"
#include "Widget/base/export.h"
#include <QAudioRecorder>
#include <QMediaPlayer>
#include <QMediaRecorder>
#include <QWidget>

class Intermediate_Frequency_Widget;
class Sweep_Frequency_Widget;
class Radio_Widget;
class Base_Widget;
class Show_Time;
class Base_Widget_Menu;
class QVBoxLayout;
class Top_Menu_Bar;
class Server_Setting_Widget;
class file_explorer;
class Main_Widget : public QWidget, public renderive::Singleton_Widget<Main_Widget> {
public:
    explicit Main_Widget(QWidget *parent = nullptr);
    QVBoxLayout *main_layout;
    Radio_Widget *radio_widget;
    Sweep_Frequency_Widget *sweep_frequency_widget;
    Intermediate_Frequency_Widget *intermediate_frequency_widget;
    Top_Menu_Bar* top_menu_bar;
    Base_Widget_Menu *main_menu, *top_menu;
    Server_Setting_Widget* server_setting_widget;
    void show_intermediate_frequency_widget() const;
    void show_sweep_frequency_widget() const;
    void show_radio_widget() const;
    void show_server_setting_widget();
    [[nodiscard]] Base_Widget* get_current_base_widget() const;
    QWidget* current_hover_widget() {return current_hover_widget_value;}
    void set_current_hover_widget(QWidget* widget = nullptr);
    void hide_cur_hover_widget();


    bool select_shot_screen_dialog_first = true, select_audio_file_first = true;
    file_explorer *select_shot_screen_dialog, *select_audio_file;
    QAudioRecorder *audioRecorder;
    QMediaPlayer *mediaPlayer;
protected:
    void paintEvent(QPaintEvent *event) override;
    void resizeEvent(QResizeEvent *event) override;
    void keyPressEvent(QKeyEvent *event) override;
    void wheelEvent(QWheelEvent *event) override;
private:
    QWidget* current_hover_widget_value{};
};
#endif



