|
@@ -249,6 +249,10 @@ namespace components {
|
|
|
|
|
|
auto queue_button = dynamic_cast<Gtk::Button*>(play_button->get_next_sibling());
|
|
|
if (!queue_button) return;
|
|
|
+ queue_button->signal_clicked().connect(sigc::bind(
|
|
|
+ sigc::mem_fun(*this, &MainWindow::onAddToQueueButtonClicked),
|
|
|
+ AddToQueueParams {obj.ytid}
|
|
|
+ ));
|
|
|
|
|
|
// Загрузка изображения превью видео с диска
|
|
|
// TODO: ~/.cache/ytmpv/thumbnails -- брать из appcore
|
|
@@ -302,9 +306,6 @@ namespace components {
|
|
|
|
|
|
void MainWindow::playSingleVideo(std::string ytid)
|
|
|
{
|
|
|
- // Запуск mpv в заднем фоне
|
|
|
- std::string yt_url = "https://youtu.be/"+ytid;
|
|
|
-
|
|
|
Glib::spawn_async(
|
|
|
"",
|
|
|
m_appcore->getMPVLaunchParams(ytid),
|
|
@@ -312,6 +313,15 @@ namespace components {
|
|
|
);
|
|
|
}
|
|
|
|
|
|
+ void MainWindow::playQueue()
|
|
|
+ {
|
|
|
+ Glib::spawn_async(
|
|
|
+ "",
|
|
|
+ m_appcore->getMPVLaunchParams(m_appcore->getQueueYTIDs()),
|
|
|
+ Glib::SpawnFlags::DEFAULT
|
|
|
+ );
|
|
|
+ }
|
|
|
+
|
|
|
void MainWindow::searchSidebarRegularMode()
|
|
|
{
|
|
|
// Получить иконку поиска и создать надпись "Поиск"
|
|
@@ -493,4 +503,16 @@ namespace components {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ void MainWindow::onAddToQueueButtonClicked(AddToQueueParams e)
|
|
|
+ {
|
|
|
+ m_appcore->addVideoToQueue(e.ytid);
|
|
|
+ setQueueBarVisibility(true);
|
|
|
+ }
|
|
|
+
|
|
|
+ void MainWindow::setQueueBarVisibility(bool visible)
|
|
|
+ {
|
|
|
+ auto queue_container = m_builder->get_widget<Gtk::Box>("queue");
|
|
|
+ queue_container->set_visible(visible);
|
|
|
+ }
|
|
|
}
|