Changed the save path for the currentVolumn value
This commit is contained in:
@@ -6,6 +6,8 @@
|
||||
#include"AudioInformation.h"
|
||||
#include"AudioDump.h"
|
||||
|
||||
string AudioInformation::audioConfigPath = "/usr/lib/AudioControl/";
|
||||
|
||||
AudioInformation::AudioInformation()
|
||||
{
|
||||
AudioDump ad;
|
||||
@@ -17,6 +19,7 @@ AudioInformation::AudioInformation()
|
||||
void AudioInformation::stripInformation()
|
||||
{
|
||||
std::fstream readAudio;
|
||||
audioInfoPath.assign(audioConfigPath + "audio.txt");
|
||||
readAudio.open(audioInfoPath, std::ios::in);
|
||||
|
||||
while (!readAudio.eof())
|
||||
@@ -34,7 +37,8 @@ void AudioInformation::stripInformation()
|
||||
}
|
||||
}
|
||||
readAudio.close();
|
||||
readAudio.open("currentVolume.txt", std::ios::out);
|
||||
currentVolumnPath = audioConfigPath + "currentVolume.txt";
|
||||
readAudio.open(currentVolumnPath, std::ios::out);
|
||||
|
||||
readAudio << volume;
|
||||
|
||||
|
||||
+6
-1
@@ -3,6 +3,8 @@
|
||||
|
||||
#include<string>
|
||||
|
||||
using std::string;
|
||||
|
||||
class AudioInformation
|
||||
{
|
||||
public:
|
||||
@@ -10,10 +12,13 @@ public:
|
||||
|
||||
unsigned short getVolume() const;
|
||||
|
||||
|
||||
static string audioConfigPath;
|
||||
private:
|
||||
void stripInformation();
|
||||
|
||||
std::string audioInfoPath{"/usr/lib/AudioControl/audio.txt"};
|
||||
string audioInfoPath;
|
||||
string currentVolumnPath;
|
||||
unsigned short volume = 0;
|
||||
unsigned short count = 0;
|
||||
const unsigned short MAXCOUNTS = 3;
|
||||
|
||||
Reference in New Issue
Block a user