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