volume control, schedule button, VBR decoder fix, reduced debug in decoder, added decoder source
This commit is contained in:
parent
2f8226d406
commit
7713110129
18 changed files with 1486 additions and 12 deletions
|
@ -18,8 +18,10 @@ M::Player::Player(const W::Address& address, QObject* parent):
|
|||
{
|
||||
W::Handler* get = W::Handler::create(address + W::Address({u"get"}), this, &M::Player::_h_get);
|
||||
W::Handler* hqueue = W::Handler::create(address + W::Address({u"queue"}), this, &M::Player::_h_queue);
|
||||
W::Handler* hplay = W::Handler::create(address + W::Address({u"play"}), this, &M::Player::_h_play);
|
||||
addHandler(get);
|
||||
addHandler(hqueue);
|
||||
addHandler(hplay);
|
||||
|
||||
playPauseBtn->setLabel(W::String(u"Play"));
|
||||
playPauseBtn->setEnabled(false);
|
||||
|
@ -126,7 +128,6 @@ void M::Player::h_queue(const W::Event& ev)
|
|||
_queueView->push(song->getAddress());
|
||||
|
||||
if (current == 0) {
|
||||
scheduledToplay = true;
|
||||
setActive(song);
|
||||
}
|
||||
|
||||
|
@ -293,3 +294,20 @@ void M::Player::setActive(uint64_t index)
|
|||
}
|
||||
}
|
||||
|
||||
void M::Player::h_play(const W::Event& ev)
|
||||
{
|
||||
const W::Vocabulary& data = static_cast<const W::Vocabulary&>(ev.getData());
|
||||
|
||||
const W::Uint64& id = static_cast<const W::Uint64&>(data.at(u"id"));
|
||||
ProxySong* song = new ProxySong(id, address + W::Address{W::String(W::Uint64(counter++).toString())});
|
||||
addModel(song);
|
||||
_queue.push_back(song);
|
||||
_queueView->push(song->getAddress());
|
||||
|
||||
scheduledToplay = true;
|
||||
setActive(song);
|
||||
|
||||
if (currentIndex + 1 < _queue.size()) {
|
||||
nextBtn->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ namespace M {
|
|||
|
||||
handler(get);
|
||||
handler(queue);
|
||||
handler(play);
|
||||
|
||||
private:
|
||||
typedef std::map<ItemType, W::Address> ItemMap;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue