feat: initial qobuz-qt source
Lightweight Qt6 desktop client for Qobuz with a Rust audio backend (Symphonia/CPAL via staticlib FFI). Mirrors the spotify-qt layout: toolbar with playback controls, library/context docks on the left, tabbed search side panel on the right, queue panel, now-playing dock. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
#include "maincontent.hpp"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
#include <QJsonArray>
|
||||
|
||||
MainContent::MainContent(QobuzBackend *backend, QWidget *parent)
|
||||
MainContent::MainContent(QobuzBackend *backend, PlayQueue *queue, QWidget *parent)
|
||||
: QWidget(parent)
|
||||
, m_backend(backend)
|
||||
{
|
||||
@@ -15,22 +14,20 @@ MainContent::MainContent(QobuzBackend *backend, QWidget *parent)
|
||||
|
||||
m_welcome = new QLabel(
|
||||
tr("<h2>Welcome to Qobuz</h2>"
|
||||
"<p>Select something from the library on the left to get started.</p>"),
|
||||
"<p>Select something from the library on the left to get started,<br>"
|
||||
"or use the search panel (🔍) to find music.</p>"),
|
||||
this);
|
||||
m_welcome->setAlignment(Qt::AlignCenter);
|
||||
|
||||
m_tracks = new List::Tracks(m_backend, this);
|
||||
m_tracks = new List::Tracks(m_backend, queue, this);
|
||||
|
||||
m_stack->addWidget(m_welcome); // index 0
|
||||
m_stack->addWidget(m_tracks); // index 1
|
||||
m_stack->addWidget(m_welcome); // 0
|
||||
m_stack->addWidget(m_tracks); // 1
|
||||
|
||||
m_stack->setCurrentIndex(0);
|
||||
}
|
||||
|
||||
void MainContent::showWelcome()
|
||||
{
|
||||
m_stack->setCurrentIndex(0);
|
||||
}
|
||||
void MainContent::showWelcome() { m_stack->setCurrentIndex(0); }
|
||||
|
||||
void MainContent::showAlbum(const QJsonObject &album)
|
||||
{
|
||||
@@ -46,8 +43,7 @@ void MainContent::showPlaylist(const QJsonObject &playlist)
|
||||
|
||||
void MainContent::showFavTracks(const QJsonObject &result)
|
||||
{
|
||||
const QJsonArray items = result["items"].toArray();
|
||||
m_tracks->loadTracks(items);
|
||||
m_tracks->loadTracks(result["items"].toArray());
|
||||
m_stack->setCurrentIndex(1);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user