Freya  0.0.1
A Gtk3 MPD Client
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions
Browser::QueueMerger Class Reference

This class manages the updating and merging of the Queue. More...

#include <QueueMerger.hh>

Inheritance diagram for Browser::QueueMerger:
[legend]
Collaboration diagram for Browser::QueueMerger:
[legend]

Public Member Functions

 QueueMerger (MPD::Client &client, Glib::RefPtr< Gtk::ListStore > &queue_model, QueueModelColumns &queue_columns)
void add_item (MPD::AbstractComposite *pSong)
 Implemented from AbstractItemlist.
void disable_merge_once ()
 Disables automatic updating 1x.
void recalculate_positions (unsigned pos=0)
 Recalculate the position row of the Queue.

Detailed Description

This class manages the updating and merging of the Queue.

When an update needs to be done, and it's not the first start, or a serverchange, then fill_queue_changes() of MPD::Client is called, and the changes are merged in.

fill_queue_changes() delivers the correct list since the first position that changed.

Definition at line 53 of file QueueMerger.hh.


Constructor & Destructor Documentation

Browser::QueueMerger::QueueMerger ( MPD::Client &  client,
Glib::RefPtr< Gtk::ListStore > &  queue_model,
QueueModelColumns &  queue_columns 
)

Member Function Documentation

Implemented from AbstractItemlist.

Parameters:
pSonga MPD::Song

Implements MPD::AbstractItemlist.

Disables automatic updating 1x.

This is useful when for example some rows need to be deleted from the Queue. Then, the rows are deleted from the model and the view, MPD is notified, but the next update is disabled with this method. Also positions in the row are calculated manually via recalculate_positions()

void Browser::QueueMerger::recalculate_positions ( unsigned  pos = 0)

Recalculate the position row of the Queue.

In order for merging to work all rows need to be in subsequent order. This method rearranges the rows starting by pos or 0 if not given

Parameters:
posWhere to start or 0 if not given

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