Commit 7c811634 authored by Camilo higuita's avatar Camilo higuita

fixes

parent 65a031bc
......@@ -20,6 +20,7 @@ add_executable(vvave
qml.qrc
main.cpp
babe.cpp
vvave.cpp
# pulpo/services/geniusService.cpp
# pulpo/services/deezerService.cpp
......
......@@ -166,15 +166,13 @@ Maui.ApplicationWindow
headBar.middleContent : [
Maui.ToolButton
{
iconName: "view-media-track"
height: headBar.height
showIndicator: currentView === viewsIndex.tracks
iconColor: currentView === viewsIndex.tracks ? babeColor : altColorText
iconName: "view-media-track"
active: currentView === viewsIndex.tracks
iconColor: active ? babeColor : altColorText
onClicked: currentView = viewsIndex.tracks
text: qsTr("Tracks")
tooltipText: pageStack.wideMode ? "" : text
colorScheme.highlightColor: babeColor
Layout.fillHeight: true
},
......@@ -182,8 +180,7 @@ Maui.ApplicationWindow
Maui.ToolButton
{
text: qsTr("Albums")
height: headBar.height
showIndicator: currentView === viewsIndex.albums
active: currentView === viewsIndex.albums
iconName: /*"album"*/ "view-media-album-cover"
iconColor: currentView === viewsIndex.albums ? babeColor : altColorText
onClicked: currentView = viewsIndex.albums
......@@ -197,8 +194,7 @@ Maui.ApplicationWindow
Maui.ToolButton
{
text: qsTr("Artists")
height: headBar.height
showIndicator: currentView === viewsIndex.artists
active: currentView === viewsIndex.artists
iconName: "view-media-artist"
iconColor: currentView === viewsIndex.artists ? babeColor : altColorText
onClicked: currentView = viewsIndex.artists
......@@ -212,8 +208,7 @@ Maui.ApplicationWindow
Maui.ToolButton
{
text: qsTr("Playlists")
height: headBar.height
showIndicator: currentView === viewsIndex.playlists
active: currentView === viewsIndex.playlists
iconName: "view-media-playlist"
iconColor: currentView === viewsIndex.playlists ? babeColor : altColorText
onClicked: currentView = viewsIndex.playlists
......@@ -359,7 +354,6 @@ Maui.ApplicationWindow
leftIcon.iconColor: currentView === viewsIndex.search ? babeColor : altColorText
onSearchButtonClicked:
{
pageStack.currentIndex = 1
currentView = viewsIndex.search
searchView.searchInput.forceActiveFocus()
}
......@@ -403,11 +397,7 @@ Maui.ApplicationWindow
{
text: qsTr("Folders")
icon.name: "folder"
onTriggered:
{
pageStack.currentIndex = 1
currentView = viewsIndex.folders
}
onTriggered: currentView = viewsIndex.folders
},
// Maui.MenuItem
......@@ -426,11 +416,8 @@ Maui.ApplicationWindow
{
text: qsTr("YouTube")
icon.name: "internet-services"
onTriggered:
{
pageStack.currentIndex = 1
currentView = viewsIndex.youtube
}
onTriggered: currentView = viewsIndex.youtube
},
// Maui.MenuItem
......
......@@ -6,14 +6,15 @@ import "../../view_models/BabeTable"
import org.kde.kirigami 2.2 as Kirigami
import org.kde.mauikit 1.0 as Maui
Page
Maui.Page
{
id: youtubeViewRoot
property var searchRes : []
clip: true
margins: 0
property alias viewer : youtubeViewer
property int openVideo : 0
headBar.visible: false
Connections
{
......@@ -33,56 +34,6 @@ Page
}
}
function watchVideo(track)
{
if(track && track.url)
{
var url = track.url
if(url && url.length > 0)
{
youtubeViewer.currentYt = track
youtubeViewer.webView.url = url+"?autoplay=1"
stackView.push(youtubeViewer)
}
}
}
function playTrack(url)
{
if(url && url.length > 0)
{
var newURL = url.replace("embed/", "watch?v=")
console.log(newURL)
youtubePlayer.item.url = newURL+"?autoplay=1+&vq=tiny"
youtubePlayer.item.runJavaScript("document.title", function(result) { console.log(result); });
}
}
function runSearch(searchTxt)
{
if(searchTxt)
if(searchTxt !== youtubeTable.headBarTitle)
{
youtubeTable.headBarTitle = searchTxt
youtube.getQuery(searchTxt, Maui.FM.loadSettings("YOUTUBELIMIT", "BABE", 25))
}
}
function clearSearch()
{
searchInput.clear()
youtubeTable.clearTable()
youtubeTable.headBarTitle = ""
searchRes = []
}
function populate(tracks)
{
youtubeTable.model.clear()
for(var i in tracks)
youtubeTable.model.append(tracks[i])
}
/*this is for playing the track sin the background without showing the actual video*/
Loader
......@@ -264,20 +215,72 @@ Page
playTrack(youtubeTable.model.get(index).url)
}
footBar.middleContent: Maui.TextField
}
YoutubeViewer
{
id: youtubeViewer
}
}
footBar.middleContent: Maui.TextField
{
id: searchInput
Layout.fillWidth: true
placeholderText: qsTr("Search videos...")
wrapMode: TextEdit.Wrap
onAccepted: runSearch(searchInput.text)
}
function watchVideo(track)
{
if(track && track.url)
{
var url = track.url
if(url && url.length > 0)
{
id: searchInput
width: youtubeTable.footBar.middleLayout.width * 0.9
youtubeViewer.currentYt = track
youtubeViewer.webView.url = url+"?autoplay=1"
stackView.push(youtubeViewer)
placeholderText: qsTr("Search videos...")
wrapMode: TextEdit.Wrap
onAccepted: runSearch(searchInput.text)
}
}
}
YoutubeViewer
function playTrack(url)
{
if(url && url.length > 0)
{
id: youtubeViewer
var newURL = url.replace("embed/", "watch?v=")
console.log(newURL)
youtubePlayer.item.url = newURL+"?autoplay=1+&vq=tiny"
youtubePlayer.item.runJavaScript("document.title", function(result) { console.log(result); });
}
}
function runSearch(searchTxt)
{
if(searchTxt)
if(searchTxt !== youtubeTable.headBarTitle)
{
youtubeTable.headBarTitle = searchTxt
youtube.getQuery(searchTxt, Maui.FM.loadSettings("YOUTUBELIMIT", "BABE", 25))
}
}
function clearSearch()
{
searchInput.clear()
youtubeTable.clearTable()
youtubeTable.headBarTitle = ""
searchRes = []
}
function populate(tracks)
{
youtubeTable.model.clear()
for(var i in tracks)
youtubeTable.model.append(tracks[i])
}
}
#include "vvave.h"
#include "db/collectionDB.h"
static CollectionDB *DB = CollectionDB::getInstance();
vvave::vvave(QObject *parent) : QObject(parent)
{
}
#ifndef VVAVE_H
#define VVAVE_H
#include <QObject>
class vvave : public QObject
{
Q_OBJECT
public:
explicit vvave(QObject *parent = nullptr);
signals:
public slots:
};
#endif // VVAVE_H
......@@ -174,7 +174,7 @@ Kirigami.PageRow
onRowClicked: playlistViewRoot.rowClicked(filterList.model.get(index))
onQuickPlayTrack:
{
playlistViewRoot.quickPlayTrack(filterList.model.get(index))
playlistViewRoot.quickPlayTrack(filterList.model.get(filterList.currentIndex))
}
onPlayAll: playAll()
onAppendAll: appendAll()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment