diff options
author | Ken Moore <ken@ixsystems.com> | 2017-04-05 08:10:03 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-04-05 08:10:03 -0400 |
commit | 5855b4d67cc392950d72c65003534f3fd9bba506 (patch) | |
tree | c5cb5a2d261cc0ced28ec56b13419c1480c91e87 /src-qt5/desktop-utils/lumina-mediaplayer | |
parent | Merge pull request #407 from denmu/master (diff) | |
download | lumina-5855b4d67cc392950d72c65003534f3fd9bba506.tar.gz lumina-5855b4d67cc392950d72c65003534f3fd9bba506.tar.bz2 lumina-5855b4d67cc392950d72c65003534f3fd9bba506.zip |
Couple tweaks for the Pandora process.
Found out that changing the /usr/local/etc/libau.conf to have "default_driver=oss" was required for non-distorted audio output on my laptop.
Diffstat (limited to 'src-qt5/desktop-utils/lumina-mediaplayer')
-rw-r--r-- | src-qt5/desktop-utils/lumina-mediaplayer/PianoBarProcess.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src-qt5/desktop-utils/lumina-mediaplayer/PianoBarProcess.cpp b/src-qt5/desktop-utils/lumina-mediaplayer/PianoBarProcess.cpp index 88abce82..6799f25b 100644 --- a/src-qt5/desktop-utils/lumina-mediaplayer/PianoBarProcess.cpp +++ b/src-qt5/desktop-utils/lumina-mediaplayer/PianoBarProcess.cpp @@ -170,9 +170,13 @@ QString PianoBarProcess::settingValue(QString var){ void PianoBarProcess::setSettingValue(QString var,QString val){ bool changed = false; for(int i=0; i<currentSettings.length() && !changed; i++){ - if(currentSettings[i].startsWith(var+" = ")){ currentSettings[i] = var+" = "+val; changed = true; } + if(currentSettings[i].startsWith(var+" = ")){ + if(val.isEmpty()){ currentSettings.removeAt(i); i--; } + else{ currentSettings[i] = var+" = "+val; } + changed = true; + } } - if(!changed){ currentSettings << var+" = "+val; } + if(!changed && !val.isEmpty()){ currentSettings << var+" = "+val; } saveTimer->start(); //save this to disk in a moment } @@ -195,16 +199,16 @@ void PianoBarProcess::setupProcess(){ QString configdir = getenv("XDG_CONFIG_HOME"); if(configdir.isEmpty()){ configdir = QDir::homePath()+"/.config/lumina-desktop"; } else{ configdir.append("/lumina-desktop"); } - QProcessEnvironment penv; + QProcessEnvironment penv = QProcessEnvironment::systemEnvironment(); penv.insert("XDG_CONFIG_HOME",configdir); settingsPath = configdir+"/pianobar/config"; PROC->setProcessEnvironment(penv); //Now setup the rest of the process - PROC->setProcessChannelMode(QProcess::MergedChannels); + //PROC->setProcessChannelMode(QProcess::MergedChannels); QString bin = "pianobar"; LUtils::isValidBinary(bin); //will change "bin" to the full path PROC->setProgram(bin); - connect(PROC, SIGNAL(readyRead()), this, SLOT(ProcUpdate()) ); + connect(PROC, SIGNAL(readyReadStandardOutput()), this, SLOT(ProcUpdate()) ); connect(PROC, SIGNAL(stateChanged(QProcess::ProcessState)), this, SLOT(ProcStateChanged(QProcess::ProcessState)) ); cState = PianoBarProcess::Stopped; } |