ladybird/Userland/Applications/Piano/ExportProgressWindow.h
kleines Filmröllchen e127c4acdc Piano: Show a progress window when exporting WAV
This exposes that the export is pretty slow, but it's much nicer than
having the GUI lock up for 20s :^)
2023-02-08 20:07:37 -05:00

34 lines
778 B
C++

/*
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibCore/Event.h>
#include <LibGUI/Dialog.h>
#include <LibGUI/Label.h>
#include <LibGUI/Progressbar.h>
class ExportProgressWindow : public GUI::Dialog {
C_OBJECT(ExportProgressWindow);
public:
virtual ~ExportProgressWindow() override = default;
ErrorOr<void> initialize_fallibles();
virtual void timer_event(Core::TimerEvent&) override;
void set_filename(StringView filename);
private:
ExportProgressWindow(Window& parent_window, Atomic<int>& wav_percent_written);
Atomic<int>& m_wav_percent_written;
RefPtr<GUI::HorizontalProgressbar> m_progress_bar;
RefPtr<GUI::Label> m_label;
};