added VlcMediaPlayer, still trouble with pulseAudio
This commit is contained in:
parent
6f5c9138a8
commit
a4006ea015
7 changed files with 51 additions and 8 deletions
|
|
@ -1,16 +1,30 @@
|
|||
#include "MusicController.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <models/MusicModel.h>
|
||||
|
||||
MusicController::MusicController(QObject *parent) : QObject(parent),
|
||||
mModel(new MusicModel(this))
|
||||
MusicController::MusicController(QObject *parent) : QObject(parent)
|
||||
{
|
||||
mVlc = new VlcInstance(VlcCommon::args(), this);
|
||||
mModel = new MusicModel(mVlc, this);
|
||||
mPlayer = new VlcMediaPlayer(mVlc);
|
||||
|
||||
connect(mPlayer, &VlcMediaPlayer::error, [this](){
|
||||
qDebug() << "playerError";
|
||||
});
|
||||
|
||||
connect(mModel, &MusicModel::navigateTo, this, &MusicController::navigateTo);
|
||||
}
|
||||
|
||||
MusicController::~MusicController()
|
||||
{
|
||||
mPlayer->deleteLater();
|
||||
}
|
||||
|
||||
void MusicController::initPlayer(NavigationItemModel *item)
|
||||
{
|
||||
mModel->init(item);
|
||||
mPlayer->open(mModel->getMedia());
|
||||
}
|
||||
|
||||
void MusicController::setContext(QQmlContext *context)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue