Qprocess Not working for MAC OSX
-
Hello,
I am trying to run lastfm fingerprint commandline tool with my qt application using qprocess. I download two different tool one for windows(lastfmfpclient.exe) and other for MAC (lastfmfpclient.app with libs). Window tool is working on windows CMD as well as in Qt but MAC tool only working in Terminal but not working in Qt. can anyone have any idea about this.
Terminal Code.@MachMachine-iMac:~ tech$ cd /Users/tech/Downloads/lastfm.fpclient.beta2.OSX-intel\ 2/
MachMachine-iMac:lastfm.fpclient.beta2.OSX-intel 2 tech$ ./lastfmfpclient -url /Users/tech/ffmpegcommandline/a.mp3
TagLib: String::prepare() - Invalid UTF16 string.
http://ws.audioscrobbler.com/fingerprint/144953361.xml
This code give me the path of a xml file which i need.@Qt Code :
I want same result in Qt by using qprocess but this is not working.@QString lastfmHandler::getFingerprintURL(QString trackPath)
{
QProcess getURL;
QString ToolName;#ifdef Q_OS_MAC
ToolName="/Users/tech/Downloads/lastfm.fpclient.beta2.OSX-intel 2/lastfmfpclient.app";
QStringList passArgument;
passArgument<<"-url"<<"/Users/tech/ffmpegcommandline/a.mp3";
getURL.start(ToolName,passArgument);
getURL.waitForFinished();
QString output=getURL.readAllStandardOutput();
getURL.kill();
qDebug()<<"url"<<output;
return output;#endif
}@
Take lastfm client code from "here":http://rapidlibrary.com/files/lastfm-fpclient-beta2-1-osx-intel-zip_ulc89cyc8ni89on.html
Can some one have any idea how to work this code.
Thanks in advance -
Try it with this change:
@
passArgument<<"-url /Users/tech/ffmpegcommandline/a.mp3";
@Or even put the whole line (invocation + all arguments) into the ToolName variable.
-
Hello Sierdzio
I try this but this also not working any other way. -
You can try using QDesktopServices or running "open" through QProcess.
But, to get it working in QProcess like you are trying to, you need to get into the app bundle ("/Users/tech/Downloads/lastfm.fpclient.beta2.OSX-intel 2/lastfmfpclient.app/Contents/MacOS/lastfmfpclient").