Commit 630c7048 authored by Camilo higuita's avatar Camilo higuita

clean up a little and add option to open external files

parent e825934a
......@@ -59,7 +59,6 @@ if (ANDROID)
set(TAGLIB_LIBRARIES ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/libtag.a)
target_sources(vvave PRIVATE
android/android.cpp
android/notificationclient.cpp
android/android.qrc
)
......
#include "android.h"
#include "android/notificationclient.h"
#include <QDebug>
#include <QException>
class InterfaceConnFailedException : public QException
{
public:
void raise() const { throw *this; }
InterfaceConnFailedException *clone() const { return new InterfaceConnFailedException(*this); }
};
Android::Android(QObject *parent) : QObject(parent)
{
}
void Android::handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject &data)
{
qDebug()<< "ACTIVITY RESULTS";
jint RESULT_OK = QAndroidJniObject::getStaticField<jint>("android/app/Activity", "RESULT_OK");
if (receiverRequestCode == 42 && resultCode == RESULT_OK)
{
QString url = data.callObjectMethod("getData", "()Landroid/net/Uri;").callObjectMethod("getPath", "()Ljava/lang/String;").toString();
emit folderPicked(url);
}
}
void Android::fileChooser()
{
QAndroidJniEnvironment _env;
QAndroidJniObject activity = QAndroidJniObject::callStaticObjectMethod("org/qtproject/qt5/android/QtNative", "activity", "()Landroid/app/Activity;"); //activity is valid
if (_env->ExceptionCheck()) {
_env->ExceptionClear();
throw InterfaceConnFailedException();
}
if ( activity.isValid() )
{
QAndroidJniObject::callStaticMethod<void>("com/example/android/tools/SendIntent",
"fileChooser",
"(Landroid/app/Activity;)V",
activity.object<jobject>());
if (_env->ExceptionCheck()) {
_env->ExceptionClear();
throw InterfaceConnFailedException();
}
}else
throw InterfaceConnFailedException();
}
#ifndef ANDROID_H
#define ANDROID_H
#include <QAndroidActivityResultReceiver>
#include <QObject>
#include <QAndroidJniObject>
#include <QAndroidJniEnvironment>
#include <QtAndroid>
class Android : public QObject, public QAndroidActivityResultReceiver
{
Q_OBJECT
public:
explicit Android(QObject *parent = nullptr);
Q_INVOKABLE void fileChooser();
virtual void handleActivityResult(int receiverRequestCode, int resultCode, const QAndroidJniObject & data);
private:
QAndroidActivityResultReceiver *resultReceiver;
signals:
void folderPicked(const QString &url);
public slots:
};
#endif // ANDROID_H
QT += androidextras webview
HEADERS += \
$$PWD/android.h \
$$PWD/android.h \
$$PWD/notificationclient.h
SOURCES += \
$$PWD/android.cpp \
$$PWD/notificationclient.cpp
DISTFILES += \
$$PWD/src/SendIntent.java \
$$PWD/src/NotificationClient.java \
$$PWD/src/MyService.java \
$$PWD/AndroidManifest.xml \
$$PWD/gradlew \
$$PWD/build.gradle \
$$PWD/gradlew.bat \
$$PWD/gradle.properties \
$$PWD/local.properties \
$$PWD/gradle/wrapper/gradle-wrapper.jar \
$$PWD/gradlew \
$$PWD/res/values/libs.xml \
$$PWD/gradle/wrapper/gradle-wrapper.properties
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/
RESOURCES += \
$$PWD/android.qrc \
$$PWD/../kirigami-icons.qrc \
......
assets/vvave.png

1.6 KB | W: | H:

assets/vvave.png

558 Bytes | W: | H:

assets/vvave.png
assets/vvave.png
assets/vvave.png
assets/vvave.png
  • 2-up
  • Swipe
  • Onion skin
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="48"
height="48"
viewBox="0 0 48 48.000002"
id="svg2"
version="1.1"
inkscape:version="0.92.2 2405546, 2018-03-11"
sodipodi:docname="vvave.svg"
inkscape:export-filename="/home/camilo/Coding/qml/buho/assets/buho.png"
inkscape:export-xdpi="96"
inkscape:export-ydpi="96">
<defs
id="defs4" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.0000001"
inkscape:cx="3.7895341"
inkscape:cy="14.272399"
inkscape:document-units="px"
inkscape:current-layer="g1613"
showgrid="false"
units="px"
inkscape:showpageshadow="false"
borderlayer="true"
inkscape:window-width="1280"
inkscape:window-height="1326"
inkscape:window-x="0"
inkscape:window-y="27"
inkscape:window-maximized="0"
showguides="false">
<inkscape:grid
type="xygrid"
id="grid4136" />
<sodipodi:guide
position="5,59.000069"
orientation="54,0"
id="guide4142"
inkscape:locked="false" />
<sodipodi:guide
position="5,5.0000688"
orientation="0,54"
id="guide4144"
inkscape:locked="false" />
<sodipodi:guide
position="59,5.0000688"
orientation="-54,0"
id="guide4146"
inkscape:locked="false" />
<sodipodi:guide
position="59,59.000069"
orientation="0,-54"
id="guide4148"
inkscape:locked="false" />
<sodipodi:guide
position="0,64.000069"
orientation="64,0"
id="guide4150"
inkscape:locked="false" />
<sodipodi:guide
position="0,6.875e-05"
orientation="0,64"
id="guide4152"
inkscape:locked="false" />
<sodipodi:guide
position="64,4.0000002"
orientation="-64,0"
id="guide4154"
inkscape:locked="false" />
<sodipodi:guide
position="64,64.000069"
orientation="0,-64"
id="guide4156"
inkscape:locked="false" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Capa 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-1074.5196)">
<g
id="g901"
transform="translate(147.2888,-63.331718)">
<g
transform="matrix(3.7795276,0,0,3.7795276,178.50099,966.42364)"
id="g1613">
<g
inkscape:label="Layer 1"
id="layer1-7"
transform="matrix(0.26458333,0,0,0.26458333,-86.198548,45.356906)">
<image
width="48"
height="48"
preserveAspectRatio="none"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAYAAAAGACAYAAACkx7W/AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz AAB2HAAAdhwBp8J46gAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAwZSURB VHic7dzhctu2FoVRxOn7v3Hs+yPlXBQFQLpJrEPutWY0omVZtpXp+UiQbmsAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHD4 9uof4Iul/b7A5328+gf4Kk8eiE/+3YCv9cgoPG1I7n6fp/2uwJ+zG/iPicFThuLs9xgfu/IcIM9s oI+PXXnO7dx9AO6G/JXt3WPAs50N9Svbq9e5hbsOviuD/9uwvXsukOts0H8M27Pnzj4u744DcDfM x+E/BuAsCECW1cAf78cIXD06KO1uw+/Knv7qNnvu6rWBZ1vtvc8G/ew2e+7qtcv669U/wEWrwX/c 97e3yWNnRwTjNvBsZ3v+q9t7+/cRwPi637rt0u4w9HZ7/avBv9q+cl4AyLBb758N/NX27Mhg9j3K qT74zob/2+R+9tjZkcDs+wHPdLb8MwtAfz977JYRqLwEtBv+q8E/3s6WhGbfC8gwDumzALy3/8+O 9+6+dc85tr91r99vl1I5AId++I9LO/3t++Sx2VJQawIAzANwbI/LPePtR/v/wG9/b78NX1t28B+q BmB2sna3t/99sb0LQH8/fl/guXZLQMf9LgA/2s9Zcdz3RwVHCMYIlIxBxQDsrvKZDf7v7Z+Dvw/A 1ZPAs4+B5zo7D9DvzR8DfTb8f0xe+1geOl6vbASqBWA2lGd7//2wn0VgdgRwdhkokGl3Gegx/PsZ Mhv+s1nSnxPon1cmAtUCcFhd5jnb+59FYLwiyOWfwMrZ5aDHPBmPAFavc3zNOF/KDP5DpQCsBvRu 8P/VPr/3P36P1c8BPM9s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A AAAAAAAAAAAAAAAA8Cr/A1FLviW2m7iwAAAAAElFTkSuQmCC "
id="image1206"
x="0"
y="0" />
<rect
ry="3"
y="6"
x="5"
height="38.000046"
width="38"
id="rect4272"
style="opacity:1;fill:#e91e63;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<rect
ry="2"
y="7"
x="6"
height="36"
width="36"
id="rect4213"
style="opacity:1;fill:#f06292;fill-opacity:1;stroke:none;stroke-width:2.02837014;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
<path
id="rect1209"
d="m 16,12 v 4 h 4 v -4 z m 12,0 v 4 h 4 v -4 z m -18,3 v 4 h 4 v -4 z m 24,0 v 4 h 4 v -4 z m -12,1 v 4 h 4 v -4 z m -6,2 v 4 h 4 v -4 z m 12,0 v 4 h 4 v -4 z m -18,3 v 4 h 4 v -4 z m 24,0 v 4 h 4 v -4 z m -12,1 v 4 h 4 v -4 z m -6,2 v 4 h 4 v -4 z m 12,0 v 4 h 4 v -4 z m -18,3 v 4 h 4 v -4 z m 24,0 v 4 h 4 v -4 z m -12,1 v 4 h 4 v -4 z m -6,2 v 4 h 4 v -4 z m 12,0 v 4 h 4 v -4 z m -6,4 v 4 h 4 v -4 z"
style="opacity:1;fill:#fce4ec;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:bevel;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
inkscape:connector-curvature="0" />
</g>
</g>
</g>
</g>
</svg>
This diff is collapsed.
......@@ -11,8 +11,7 @@
#if (defined (Q_OS_LINUX) && !defined (Q_OS_ANDROID))
class Notify;
#elif defined (Q_OS_ANDROID)
class NotificationClient;
class Android;
//class NotificationClient;
#endif
class CollectionDB;
......@@ -37,7 +36,6 @@ public:
// Q_INVOKABLE void runPy();
/* DATABASE INTERFACES */
Q_INVOKABLE QVariantList get(const QString &queryTxt);
Q_INVOKABLE QVariantList getList(const QStringList &urls);
......@@ -46,6 +44,7 @@ public:
Q_INVOKABLE void trackPlaylist(const QStringList &urls, const QString &playlist);
Q_INVOKABLE void trackLyrics(const QString &url);
Q_INVOKABLE bool trackBabe(const QString &path);
Q_INVOKABLE QString artistArt(const QString &artist);
Q_INVOKABLE QString albumArt(const QString &album, const QString &artist);
Q_INVOKABLE QString artistWiki(const QString &artist);
......@@ -53,9 +52,7 @@ public:
Q_INVOKABLE bool babeTrack(const QString &path, const bool &value);
/* SETTINGS */
Q_INVOKABLE void scanDir(const QString &url);
Q_INVOKABLE void brainz(const bool &on);
Q_INVOKABLE bool brainzState();
......@@ -63,7 +60,6 @@ public:
Q_INVOKABLE void getYoutubeTrack(const QString &message);
/* STATIC METHODS */
Q_INVOKABLE static void saveSetting(const QString &key, const QVariant &value, const QString &group);
Q_INVOKABLE static QVariant loadSetting(const QString &key, const QString &group, const QVariant &defaultValue);
......@@ -79,10 +75,8 @@ public:
/*COLORS*/
Q_INVOKABLE static QString babeColor();
/*UTILS*/
Q_INVOKABLE static bool isMobile();
Q_INVOKABLE static bool isAndroid();
Q_INVOKABLE void openUrls(const QStringList &urls);
Q_INVOKABLE static QString moodColor(const int &pos);
......@@ -91,8 +85,6 @@ public:
Q_INVOKABLE static QStringList defaultSources();
static void registerTypes();
/*USEFUL*/
Q_INVOKABLE QString loadCover(const QString &url);
Q_INVOKABLE QVariantList searchFor(const QStringList &queries);
......@@ -101,16 +93,7 @@ public:
Q_INVOKABLE void notify(const QString &title, const QString &body);
Q_INVOKABLE void notifySong(const QString &url);
/*ANDROID*/
Q_INVOKABLE static void sendText(const QString &text);
Q_INVOKABLE static void sendTrack(const QString &url);
Q_INVOKABLE static void openFile(const QString &url);
Q_INVOKABLE void fileChooser();
Q_INVOKABLE static void androidStatusBarColor(const QString &color, const bool &contrast);
public slots:
void debug(const QString &msg);
private:
......@@ -119,10 +102,8 @@ private:
#if (defined (Q_OS_LINUX) && !defined (Q_OS_ANDROID))
Notify *nof;
#elif defined (Q_OS_ANDROID)
NotificationClient *nof;
Android *android;
// NotificationClient *nof;
#endif
QString fetchCoverArt(DB &song);
static QVariantList transformData(const DB_LIST &dbList);
......@@ -138,6 +119,7 @@ signals:
void skipTrack();
void babeIt();
void message(QString msg);
void openFiles(QVariantList tracks);
};
......
......@@ -65,6 +65,13 @@ int main(int argc, char *argv[])
return 0;
}
const QStringList args = parser.positionalArguments();
QStringList urls;
if(!args.isEmpty())
urls = args;
Babe bae;
/* Services */
......@@ -79,6 +86,8 @@ int main(int argc, char *argv[])
{
qDebug()<<"FINISHED LOADING QML APP";
bae.refreshCollection();
if(!urls.isEmpty())
bae.openUrls(urls);
});
auto context = engine.rootContext();
......
......@@ -1086,7 +1086,6 @@ Maui.ApplicationWindow
target: bae
onRefreshTables: H.refreshCollection(size)
onRefreshTracks: H.refreshTracks()
onRefreshAlbums: H.refreshAlbums()
onRefreshArtists: H.refreshArtists()
......@@ -1099,5 +1098,7 @@ Maui.ApplicationWindow
onSkipTrack: Player.nextTrack()
onBabeIt: Player.babeTrack()
onOpenFiles: Player.playAll(tracks)
}
}
Subproject commit 7d594dd640b792ca337df09fc817f22ee9783f51
Subproject commit 631b2e386df64b4f1af64b9d86f66ef92059e7e5
#include "fileloader.h"
FileLoader::FileLoader()
: CollectionDB(nullptr)
FileLoader::FileLoader() : CollectionDB(nullptr)
{
qRegisterMetaType<BAE::DB>("BAE::DB");
qRegisterMetaType<BAE::TABLE>("BAE::TABLE");
......@@ -27,13 +26,11 @@ void FileLoader::requestPaths(const QStringList& paths)
QMetaObject::invokeMethod(this, "getTracks", Q_ARG(QStringList, paths));
}
void FileLoader::nextTrack()
{
this->wait = !this->wait;
}
void FileLoader::getTracks(const QStringList& paths)
{
qDebug()<<"GETTING TRACKS FROM SETTINGS";
......@@ -52,7 +49,9 @@ void FileLoader::getTracks(const QStringList& paths)
}
qDebug()<<"URLS SIZEW FOR:"<<paths<< urls.size();
int newTracks = 0;
if(!urls.isEmpty())
{
this->execQuery("PRAGMA synchronous=OFF");
......@@ -93,7 +92,6 @@ void FileLoader::getTracks(const QStringList& paths)
newTracks++;
}
}
}else break;
}
}
......
Qt.include("Icons.js")
function playTrack(track)
function playTrack(index)
{
if(track)
if((index < mainPlaylist.list.count) && (mainPlaylist.list.count > 0) && (index > -1))
{
currentTrack = track
currentTrack = mainPlaylist.list.model.get(index)
if(typeof(currentTrack) === "undefined") return
if(bae.fileExists(currentTrack.url))
{
......@@ -23,7 +25,7 @@ function playTrack(track)
if(!isMobile)
{
title = currentTrack.title + " - " +currentTrack.artist
root.title = currentTrack.title + " - " +currentTrack.artist
if(!root.active)
bae.notifySong(currentTrack.url)
......@@ -116,12 +118,12 @@ function shuffle()
function playAt(index)
{
if(index < mainPlaylist.list.count)
if((index < mainPlaylist.list.count) && (mainPlaylist.list.count > 0) && (index > -1))
{
currentTrackIndex = index
mainPlaylist.list.currentIndex = index
mainPlaylist.list.currentIndex = currentTrackIndex
mainPlaylist.albumsRoll.positionAlbum(currentTrackIndex)
playTrack(mainPlaylist.list.model.get(index))
playTrack(currentTrackIndex)
}
}
......@@ -129,7 +131,7 @@ function quickPlay(track)
{
// root.pageStack.currentIndex = 0
appendTrack(track)
playAt(root.mainPlaylist.list.count-1)
playAt(mainPlaylist.list.count-1)
mainPlaylist.list.positionViewAtEnd()
mainPlaylist.albumsRoll.positionViewAtEnd()
......@@ -224,7 +226,7 @@ function cleanPlaylist()
function playAll(tracks)
{
if(tracks)
if(tracks.length > 0)
{
sync = false
syncPlaylist = ""
......
......@@ -13,6 +13,7 @@
#include <QScreen>
#include <QtNetwork>
#include <QEventLoop>
#include "fmh.h"
#include <cmath>
......@@ -279,17 +280,21 @@ inline QString getNameFromLocation(const QString &str)
return ret;
}
const QString MusicPath = QStandardPaths::writableLocation(QStandardPaths::MusicLocation);
const QStringList MusicPaths = QStandardPaths::standardLocations(QStandardPaths::MusicLocation);
const QString HomePath = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
const QString SettingPath = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation)+"/vvave/";
const QString ArtworkPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)+"/vvave/artwork/";
const QString CollectionDBPath = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation)+"/vvave/";
const QString CachePath = BAE::isMobile() ? BAE::ArtworkPath : QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)+"/vvave/";
const QString YoutubeCachePath = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation)+"/vvave/youtube/";
const QString DownloadsPath = QStandardPaths::writableLocation(QStandardPaths::DownloadLocation);
const QStringList DownloadsPaths = QStandardPaths::standardLocations(QStandardPaths::DownloadLocation);
const QString NotifyDir = QStandardPaths::writableLocation(QStandardPaths::ConfigLocation);
const QStringList MusicPaths = QStandardPaths::standardLocations(QStandardPaths::MusicLocation);
const QStringList DownloadsPaths = QStandardPaths::standardLocations(QStandardPaths::DownloadLocation);
const QString MusicPath = FMH::MusicPath;
const QString HomePath = FMH::HomePath;
const QString DownloadsPath = FMH::DownloadsPath;
const QString BabePort = "8483";
const QString LinkPort = "3333";
......@@ -299,9 +304,11 @@ const QString DBName = "collection.db";
const QStringList MoodColors = {"#F0FF01","#01FF5B","#3DAEFD","#B401FF","#E91E63"};
const QStringList formats {"*.mp4","*.mp3","*.wav","*.flac","*.ogg","*.m4a"};
const QStringList defaultSources = isMobile() ?
QStringList()<<BAE::MusicPath<<BAE::DownloadsPath<<BAE::MusicPaths<<BAE::DownloadsPaths :
QStringList()<< BAE::MusicPath<<BAE::YoutubeCachePath;
const QStringList defaultSources = QStringList() << BAE::MusicPath
<< BAE::DownloadsPath
<< BAE::MusicPaths
<< BAE::DownloadsPaths
<< BAE::YoutubeCachePath;
inline QString fixTitle(const QString &title,const QString &s,const QString &e)
{
......
......@@ -62,7 +62,7 @@ Maui.Page
cellWidth: albumCoverSize + albumSpacing
cellHeight: albumCoverSize + albumSpacing*2
// interactive: isMobile
focus: true
boundsBehavior: Flickable.StopAtBounds
......
......@@ -18,7 +18,7 @@
*/
import QtQuick 2.7
import QtQuick.Controls 2
import QtQuick.Controls 2.2
/*
* The MouseArea + interactive: false + maximumFlickVelocity are required
......
vvave.png

1.6 KB | W: | H:

vvave.png

558 Bytes | W: | H:

vvave.png
vvave.png
vvave.png
vvave.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -194,14 +194,13 @@ Kirigami.PageRow
{
target: filterList.contextMenu
onRemovedClicked:
onRemoveClicked:
{
bae.removePlaylistTrack(url, playlistViewModel.model.get(playlistViewModel.currentIndex).playlist)
populate(playlistQuery)
}
}
}
}
function populateExtra(query, title)
......
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