1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

New keys 'Volume+', 'Volume-' and 'Mute'

This commit is contained in:
Klaus Schmidinger 2001-09-16 15:06:54 +02:00
parent 987a0e931c
commit a4e97d871e
10 changed files with 94 additions and 7 deletions

View File

@ -755,3 +755,5 @@ Video Disk Recorder Revision History
- Fixed manipulating an editing mark at the very end of a recording.
- Fixed starting a new replay immediately after stopping a previous one (had
caused a mix between live video and replay).
- Three new keys ("Volume+", Volume-" and "Mute") to control the DVB card's
audio output volume.

View File

@ -294,6 +294,8 @@ The default PC key assignments are:
Red, Green, Yellow, Blue 'F1'..'F4'
0..9 '0'..'9' in top row
Power 'P'
Volume+/- '+', '-'
Mute 'm'
If you prefer different key assignments, or if the default doesn't work for
your keyboard, simply delete the file 'keys-pc.conf' and restart 'vdr' to get

3
MANUAL
View File

@ -23,6 +23,9 @@ Video Disk Recorder User's Manual
Blue - Resume Mark Mark(1) - Summary Stop
0..9 Ch select - - - Numeric inp. - Editing
Power Shutdown - - - - - -
Volume+ Volume up - - - - - -
Volume- Volume down - - - - - -
Mute Mute - - - - - -
(1) The "Mark" button in the "Timers" menu only works if sorting the timers
has been disabled in the "Setup" menu.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.c 1.71 2001/09/16 08:57:58 kls Exp $
* $Id: config.c 1.72 2001/09/16 14:54:32 kls Exp $
*/
#include "config.h"
@ -39,6 +39,9 @@ tKey keyTable[] = { // "Up" and "Down" must be the first two keys!
{ k8, "8", 0 },
{ k9, "9", 0 },
{ kPower, "Power", 0 },
{ kVolUp, "Volume+", 0 },
{ kVolDn, "Volume-", 0 },
{ kMute, "Mute", 0 },
{ kNone, "", 0 },
};

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: config.h 1.78 2001/09/15 15:38:40 kls Exp $
* $Id: config.h 1.79 2001/09/16 14:54:36 kls Exp $
*/
#ifndef __CONFIG_H
@ -43,6 +43,9 @@ enum eKeys { // "Up" and "Down" must be the first two keys!
kBlue,
k0, k1, k2, k3, k4, k5, k6, k7, k8, k9,
kPower,
kVolUp,
kVolDn,
kMute,
kNone,
// The following flags are OR'd with the above codes:
k_Repeat = 0x8000,

View File

@ -7,7 +7,7 @@
* DVD support initially written by Andreas Schultz <aschultz@warp10.net>
* based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si>
*
* $Id: dvbapi.c 1.124 2001/09/16 10:10:28 kls Exp $
* $Id: dvbapi.c 1.125 2001/09/16 13:55:03 kls Exp $
*/
//#define DVDDEBUG 1
@ -2539,6 +2539,8 @@ cDvbApi::cDvbApi(int n)
osd = NULL;
#endif
currentChannel = 1;
mute = false;
volume = 255;
}
cDvbApi::~cDvbApi()
@ -3622,6 +3624,24 @@ bool cDvbApi::ToggleAudioTrack(void)
return false;
}
void cDvbApi::ToggleMute(void)
{
int OldVolume = volume;
mute = !mute;
SetVolume(0, mute);
volume = OldVolume;
}
void cDvbApi::SetVolume(int Volume, bool Absolute)
{
if (fd_audio >= 0) {
volume = min(max(Absolute ? Volume : volume + Volume, 0), 255);
audioMixer_t am;
am.volume_left = am.volume_right = volume;
CHECK(ioctl(fd_audio, AUDIO_SET_MIXER, &am));
}
}
void cDvbApi::SetAudioCommand(const char *Command)
{
delete audioCommand;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: dvbapi.h 1.50 2001/09/15 13:46:00 kls Exp $
* $Id: dvbapi.h 1.51 2001/09/16 13:54:23 kls Exp $
*/
#ifndef __DVBAPI_H
@ -315,6 +315,18 @@ private:
public:
static void SetAudioCommand(const char *Command);
static const char *AudioCommand(void) { return audioCommand; }
// Volume facilities:
private:
bool mute;
int volume;
public:
void ToggleMute(void);
// Turns the volume off or on.
void SetVolume(int Volume, bool Absolute = false);
// Sets the volume to the given value, either absolutely or relative to
// the current volume.
};
class cEITScanner {

29
i18n.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
* $Id: i18n.c 1.42 2001/09/09 13:54:35 kls Exp $
* $Id: i18n.c 1.43 2001/09/16 14:43:05 kls Exp $
*
* Slovenian translations provided by Miha Setina <mihasetina@softhome.net>
* Italian translations provided by Alberto Carraro <bertocar@tin.it>
@ -1211,6 +1211,33 @@ const tPhrase Phrases[] = {
"", // TODO
"", // TODO
},
{ "Volume+",
"Lautstärke+",
"", // TODO
"", // TODO
"", // TODO
"", // TODO
"", // TODO
"", // TODO
},
{ "Volume-",
"Lautstärke-",
"", // TODO
"", // TODO
"", // TODO
"", // TODO
"", // TODO
"", // TODO
},
{ "Mute",
"Stumm",
"", // TODO
"", // TODO
"", // TODO
"", // TODO
"", // TODO
"", // TODO
},
// Miscellaneous:
{ "yes",
"ja",

View File

@ -22,3 +22,6 @@ Blue 0000010C
8 00000038
9 00000039
Power 00000050
Volume+ 0000002B
Volume- 0000002D
Mute 0000006D

14
vdr.c
View File

@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/people/kls/vdr
*
* $Id: vdr.c 1.72 2001/09/08 14:34:29 kls Exp $
* $Id: vdr.c 1.73 2001/09/16 14:54:45 kls Exp $
*/
#define _GNU_SOURCE
@ -52,6 +52,8 @@
#define SHUTDOWNWAIT 300 // seconds to wait in user prompt before automatic shutdown
#define MANUALSTART 600 // seconds the next timer must be in the future to assume manual start
#define VOLUMEDELTA 5 // used to increase/decrease the volume
static int Interrupted = 0;
static void SignalHandler(int signum)
@ -424,6 +426,16 @@ int main(int argc, char *argv[])
case kMenu: Menu = new cMenuMain(ReplayControl); break;
// Viewing Control:
case kOk: LastChannel = -1; break; // forces channel display
// Volume Control:
case kVolUp|k_Repeat:
case kVolUp:
case kVolDn|k_Repeat:
case kVolDn:
cDvbApi::PrimaryDvbApi->SetVolume(NORMALKEY(key) == kVolDn ? -VOLUMEDELTA : VOLUMEDELTA);
break;
case kMute:
cDvbApi::PrimaryDvbApi->ToggleMute();
break;
// Power off:
case kPower: isyslog(LOG_INFO, "Power button pressed");
DELETENULL(*Interact);