A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita
audio
rust
zig
deno
mpris
rockbox
mpd
1/***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
9 *
10 * Copyright (C) 2014 by Amaury Pouly
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
16 *
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
19 *
20 ****************************************************************************/
21#ifndef MAINWINDOW_H
22#define MAINWINDOW_H
23
24#include <QMainWindow>
25#include <QTabWidget>
26#include <QSettings>
27#include "backend.h"
28#include "settings.h"
29#include "utils.h"
30
31class DocumentTabWidget;
32
33class DocumentTab
34{
35public:
36 DocumentTab() { m_tab = 0; }
37 virtual bool Quit() = 0;
38 virtual QWidget *GetWidget() = 0;
39 void SetTabWidget(DocumentTabWidget *tab);
40
41protected:
42 void OnModified(bool modified);
43 void SetTabName(const QString& name);
44 DocumentTabWidget *m_tab;
45 QString m_tabname;
46};
47
48class DocumentTabWidget : public YTabWidget
49{
50 Q_OBJECT
51public:
52 DocumentTabWidget();
53 bool CloseTab(int index);
54 void SetTabModified(DocumentTab *tab, bool mod);
55 void SetTabName(DocumentTab *tab, const QString& name);
56
57private slots:
58 void OnCloseTab(int index);
59};
60
61class MainWindow : public QMainWindow
62{
63 Q_OBJECT
64
65public:
66 MainWindow(Backend *backend);
67 void center();
68 void ReadSettings();
69 void WriteSettings();
70
71private:
72 void closeEvent(QCloseEvent *event);
73
74protected:
75 void AddTab(DocumentTab *tab);
76 bool Quit();
77
78private slots:
79 void OnQuit();
80 void OnAbout();
81 void OnAboutQt();
82 void OnLoadDesc();
83 void OnNewRegTab();
84 void OnNewRegEdit();
85
86private:
87 DocumentTabWidget *m_tab;
88 Backend *m_backend;
89};
90
91#endif