MoviePlayer: offer "help"
[enigma2.git] / lib / dvb / volume.cpp
index bc3d657..c3fc291 100644 (file)
@@ -68,8 +68,8 @@ void eDVBVolumecontrol::setVolume(int left, int right)
        leftVol = checkVolume(left);
        rightVol = checkVolume(right);
        
        leftVol = checkVolume(left);
        rightVol = checkVolume(right);
        
-       left = 63 - leftVol / 100.0 * 63.0;
-       right = 63 - rightVol / 100.0 * 63.0;
+       left = 63 - leftVol * 63 / 100;
+       right = 63 - rightVol * 63 / 100;
        
 #if HAVE_DVB_API_VERSION < 3   
                audioMixer_t mixer;
        
 #if HAVE_DVB_API_VERSION < 3   
                audioMixer_t mixer;
@@ -90,6 +90,17 @@ void eDVBVolumecontrol::setVolume(int left, int right)
                
                printf("Setvolume: %d %d\n", leftVol, rightVol);
                printf("Setvolume: %d %d\n", left, right);              
                
                printf("Setvolume: %d %d\n", leftVol, rightVol);
                printf("Setvolume: %d %d\n", left, right);              
+               
+       //HACK?
+       FILE *f;
+       if((f = fopen("/proc/stb/avs/0/volume", "wb")) == NULL) {
+               printf("cannot open /proc/stb/avs/0/volume\n");
+               return;
+       }
+       
+       fprintf(f, "%d", left);
+
+       fclose(f);
 }
 
 int eDVBVolumecontrol::getVolume()
 }
 
 int eDVBVolumecontrol::getVolume()
@@ -113,6 +124,17 @@ void eDVBVolumecontrol::volumeMute()
 #endif
        closeMixer(fd);
        muted = true;
 #endif
        closeMixer(fd);
        muted = true;
+
+       //HACK?
+       FILE *f;
+       if((f = fopen("/proc/stb/adc/j1_mute", "wb")) == NULL) {
+               printf("cannot open /proc/stb/adc/j1_mute\n");
+               return;
+       }
+       
+       fprintf(f, "%d", 1);
+
+       fclose(f);
 }
 
 void eDVBVolumecontrol::volumeUnMute()
 }
 
 void eDVBVolumecontrol::volumeUnMute()
@@ -123,14 +145,23 @@ void eDVBVolumecontrol::volumeUnMute()
 #endif
        closeMixer(fd);
        muted = false;
 #endif
        closeMixer(fd);
        muted = false;
+
+       //HACK?
+       FILE *f;
+       if((f = fopen("/proc/stb/adc/j1_mute", "wb")) == NULL) {
+               printf("cannot open /proc/stb/adc/j1_mute\n");
+               return;
+       }
+       
+       fprintf(f, "%d", 0);
+
+       fclose(f);
 }
 
 void eDVBVolumecontrol::volumeToggleMute()
 {
 }
 
 void eDVBVolumecontrol::volumeToggleMute()
 {
-       printf("Mute\n");
        if (isMuted())
                volumeUnMute();
        else
                volumeMute();
        if (isMuted())
                volumeUnMute();
        else
                volumeMute();
-               
-}
\ No newline at end of file
+}