defuze.me  Client
Public Slots | Signals | Public Member Functions | Friends
Queue::PlayQueue Class Reference

This is play queue, it stores all the pending tracks ordered and organized. More...

#include <playqueue.hpp>

Inheritance diagram for Queue::PlayQueue:
Inheritance graph
[legend]
Collaboration diagram for Queue::PlayQueue:
Collaboration graph
[legend]

List of all members.

Public Slots

void updateTimes (int shift=0)
 Give all elements their play time.
void removeAll (Library::AudioTrack *)
 Remove all matching instances from queue.
void removeSelected ()
 Remove all selected elements.
void updateFocus (const QModelIndex &current, const QModelIndex &previous)
void closeControls ()
void removeOne (Queueable *elem)
void newEvent (Scheduler::EventModel *event)
void updateEvent (Scheduler::EventModel *event)
void removeEvent (Scheduler::EventModel *event)

Signals

void popQueue ()
void initialized ()
void altered ()
void removeQueueElem (Queue::Queueable *)
void addQueueElem (Queue::Queueable *)

Public Member Functions

 PlayQueue (QObject *parent=0)
void aboutToQuit ()
 Called just before to quit, when CORES and PLUGINS are still loaded.
void init ()
 Called once, after all CORES and PLUGINS are loaded.
void add (Queueable *, int position=-1)
void add (Container *, int position=-1)
void remove (int position)
void remove (QList< int > positions)
void bulkMove (QList< int > positions, int destination)
QWidget * getWidget ()
Queueablehead () const
 Return the currently playing element.
Queueablenext () const
 Return the next element.
QueueablenextNext () const
 Return the next next (third) element.
void pop ()
 Pop the head of the queue.
const QueueableDeque & getQueue () const
void updatePositions ()
 Give all elements their right position.
QList< int > findByEvent (Scheduler::EventModel *event)
 Get all elements associated to given event.
Scheduler::SchedulerPlugingetSchedulerPlugin () const
int rowCount (const QModelIndex &parent=QModelIndex()) const
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const
Qt::ItemFlags flags (const QModelIndex &index) const
bool isBeingAlteredALot () const
void emitAltered ()
QStringList mimeTypes () const
QMimeData * mimeData (const QModelIndexList &indexes) const
bool dropMimeData (const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent)

Friends

class PlayQueueDelegate

Detailed Description

This is play queue, it stores all the pending tracks ordered and organized.

It's implemented using a double ended queue (deque) providing O(1) insertions and removal at begin and end, along with an indexed access.

Each queuable elements must inherit Queueable class.

Here is how to use the list from the player:

 Queueable* elem = play_queue.head(); // Fetch the top element
 if (elem->isAudioTrack()) // check if it's an audio track
        path = elem->toAudioTrack->getAttribute("path")
 else if (elem->isQueueBreak()) // if it's a break
        pause_playing;

 play_queue.pop() // when playing is over

Definition at line 50 of file playqueue.hpp.


The documentation for this class was generated from the following files: