2024-03-23 18:41:26 -07:00
|
|
|
#pragma once
|
|
|
|
#include <gtkmm.h>
|
|
|
|
#include "my_slider.hpp"
|
|
|
|
#include "options_window.hpp"
|
2024-03-26 18:39:02 -07:00
|
|
|
#include "theme.hpp"
|
|
|
|
#include "about_window.hpp"
|
2024-03-23 18:41:26 -07:00
|
|
|
#include <playback.h>
|
|
|
|
class MainWindow : public Gtk::ApplicationWindow {
|
|
|
|
Gtk::Button openBtn;
|
2024-03-26 18:39:02 -07:00
|
|
|
Gtk::MenuButton menuBtn;
|
|
|
|
Gtk::PopoverMenu menuPopover;
|
|
|
|
Glib::RefPtr<Gio::Menu> main_menu;
|
|
|
|
Glib::RefPtr<Gio::Menu> options_menu;
|
2024-03-23 18:41:26 -07:00
|
|
|
OptionsWindow optionsWindow;
|
2024-03-26 18:39:02 -07:00
|
|
|
AboutWindow aboutWindow;
|
2024-03-23 18:41:26 -07:00
|
|
|
Gtk::HeaderBar headerBar;
|
2024-04-13 12:56:39 -07:00
|
|
|
Gtk::ScrolledWindow dropSpace;
|
2024-03-26 18:39:02 -07:00
|
|
|
Gtk::Box titleBox;
|
|
|
|
Gtk::Label titleLabel;
|
|
|
|
Gtk::Label subTitleLabel;
|
|
|
|
void set_subtitle(std::optional<Glib::ustring> subtitle = {});
|
2024-03-23 18:41:26 -07:00
|
|
|
Glib::RefPtr<Gtk::DropTarget> dropTarget;
|
|
|
|
Gtk::Label dropSpaceLabel;
|
|
|
|
Gtk::Button pause_btn;
|
|
|
|
Gtk::Button restart_btn;
|
|
|
|
Gtk::Label time_label;
|
|
|
|
Gtk::Scale seek_bar;
|
|
|
|
Gtk::Label seek_indeterminate;
|
|
|
|
Gtk::Label length_label;
|
|
|
|
Gtk::Button stop_btn;
|
|
|
|
Gtk::FileChooserDialog open_dialog;
|
2024-04-13 12:56:39 -07:00
|
|
|
Gtk::ListBox stream_selection_box;
|
2024-03-23 18:41:26 -07:00
|
|
|
MySlider volume_slider;
|
|
|
|
MySlider speed_slider;
|
|
|
|
MySlider tempo_slider;
|
|
|
|
MySlider pitch_slider;
|
2024-03-26 18:39:02 -07:00
|
|
|
void update_dark_mode();
|
2024-03-23 18:41:26 -07:00
|
|
|
Gtk::Box top_box;
|
|
|
|
Gtk::Box bottom_box;
|
2024-03-26 18:39:02 -07:00
|
|
|
Gtk::Box controls_box;
|
2024-03-23 18:41:26 -07:00
|
|
|
Gtk::Box main_box;
|
|
|
|
bool paused;
|
|
|
|
std::optional<std::string> playback_file;
|
|
|
|
double length;
|
|
|
|
uint8_t length_component_count;
|
|
|
|
std::string song_name;
|
|
|
|
void update_file(optional<std::string> new_file);
|
|
|
|
bool update();
|
|
|
|
void set_song_loaded(bool loaded);
|
|
|
|
uint16_t expected_signals = PlaybackSignalNone;
|
|
|
|
void expect_signal(uint16_t signal);
|
|
|
|
public:
|
|
|
|
Playback *playback;
|
|
|
|
bool running;
|
|
|
|
bool timer_stopped;
|
|
|
|
GCond *timer_stopped_condition;
|
|
|
|
GMutex *timer_mutex;
|
2024-03-26 18:39:02 -07:00
|
|
|
MainWindow(Playback *playback, Glib::RefPtr<Gtk::Application> app);
|
2024-03-23 18:41:26 -07:00
|
|
|
~MainWindow();
|
|
|
|
};
|