gui: Add songs to favorite playlist
Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
parent
d83609bc21
commit
ff925cf573
14
gui/tabs.cpp
14
gui/tabs.cpp
|
@ -4,6 +4,7 @@
|
|||
#include <callback.h>
|
||||
#include <deck.h>
|
||||
#include <filter.h>
|
||||
#include <playlist.h>
|
||||
#include <tabs.h>
|
||||
|
||||
#include <map>
|
||||
|
@ -180,6 +181,17 @@ bool Tab :: tab_add_to_queue(unsigned int n)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Tab :: tab_favorite_selected()
|
||||
{
|
||||
std::vector<unsigned int> ids;
|
||||
|
||||
tab_selected_ids(ids);
|
||||
for (unsigned int i = 0; i < ids.size(); i++)
|
||||
playlist :: add("Favorites", ids[i]);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
|
@ -214,6 +226,8 @@ bool Tab :: on_key_press_event(const std::string &key)
|
|||
{
|
||||
if (key >= "0" && key <= "9")
|
||||
return tab_add_to_queue(atoi(key.c_str()));
|
||||
else if (key == "f")
|
||||
return tab_favorite_selected();
|
||||
else if (key == "q" || key == "r")
|
||||
return tab_queue_selected(key == "r");
|
||||
else
|
||||
|
|
|
@ -62,6 +62,7 @@ public:
|
|||
void tab_queue_add(Playqueue *);
|
||||
bool tab_queue_selected(bool);
|
||||
bool tab_add_to_queue(unsigned int);
|
||||
bool tab_favorite_selected();
|
||||
|
||||
/**
|
||||
* internal callback functions that can be overridden if necessary
|
||||
|
|
Loading…
Reference in New Issue