gui: Press "s" to create a new playqueue
This playqueue will have random enabled. Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
parent
7dc57572aa
commit
6bd02bd46b
12
gui/tabs.cpp
12
gui/tabs.cpp
|
@ -141,7 +141,7 @@ public:
|
|||
~OcarinaPage();
|
||||
bool is_current_tab();
|
||||
void check_pq_flags();
|
||||
void queue_selected();
|
||||
void queue_selected(bool);
|
||||
|
||||
void on_row_inserted(unsigned int);
|
||||
void on_row_deleted(unsigned int);
|
||||
|
@ -243,6 +243,8 @@ void OcarinaPage::check_pq_flags()
|
|||
page_random.set_active(model->queue->get_flags() & PQ_RANDOM);
|
||||
page_random.signal_toggled().connect(sigc::mem_fun(*this,
|
||||
&OcarinaPage::on_random_toggled));
|
||||
}
|
||||
if (init_flags & PQ_REPEAT) {
|
||||
page_repeat.set_active(model->queue->get_flags() & PQ_REPEAT);
|
||||
page_repeat.signal_toggled().connect(sigc::mem_fun(*this,
|
||||
&OcarinaPage::on_repeat_toggled));
|
||||
|
@ -254,7 +256,7 @@ void OcarinaPage::set_tab_size()
|
|||
tab.set_size(model->queue->size());
|
||||
}
|
||||
|
||||
void OcarinaPage::queue_selected()
|
||||
void OcarinaPage::queue_selected(bool random)
|
||||
{
|
||||
Playqueue *pq;
|
||||
unsigned int track_id;
|
||||
|
@ -264,7 +266,7 @@ void OcarinaPage::queue_selected()
|
|||
if (sel->count_selected_rows() == 0)
|
||||
return;
|
||||
|
||||
pq = deck::create();
|
||||
pq = deck::create(random);
|
||||
std::vector<Gtk::TreeModel::Path> rows = sel->get_selected_rows();
|
||||
for (it = rows.begin(); it != rows.end(); it++) {
|
||||
track_id = (*model->queue)[(*it)[0]];
|
||||
|
@ -403,12 +405,12 @@ static void on_pq_removed(Playqueue *pq)
|
|||
delete it->second;
|
||||
}
|
||||
|
||||
void queue_selected()
|
||||
void queue_selected(bool random)
|
||||
{
|
||||
std::map<Playqueue *, OcarinaPage *>::iterator it;
|
||||
for (it = tab_map.begin(); it != tab_map.end(); it++) {
|
||||
if (it->second->is_current_tab()) {
|
||||
it->second->queue_selected();
|
||||
it->second->queue_selected(random);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,9 @@ static bool on_window_key_pressed(GdkEventKey *event)
|
|||
else if (key == "N")
|
||||
audio :: previous();
|
||||
else if (key == "q")
|
||||
queue_selected();
|
||||
queue_selected(false);
|
||||
else if (key == "s")
|
||||
queue_selected(true);
|
||||
else
|
||||
return false;
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue