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 manipulating an editing mark at the very end of a recording.
- Fixed starting a new replay immediately after stopping a previous one (had - Fixed starting a new replay immediately after stopping a previous one (had
caused a mix between live video and replay). 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' Red, Green, Yellow, Blue 'F1'..'F4'
0..9 '0'..'9' in top row 0..9 '0'..'9' in top row
Power 'P' Power 'P'
Volume+/- '+', '-'
Mute 'm'
If you prefer different key assignments, or if the default doesn't work for 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 your keyboard, simply delete the file 'keys-pc.conf' and restart 'vdr' to get

5
MANUAL
View File

@ -8,7 +8,7 @@ Video Disk Recorder User's Manual
possible, several keys have different meanings in the various possible, several keys have different meanings in the various
modes: modes:
Key Normal Main Channels Timers Edit/New Recordings Replay Key Normal Main Channels Timers Edit/New Recordings Replay
Up Ch up Crsr up Crsr up Crsr up Crsr up Crsr up Play Up Ch up Crsr up Crsr up Crsr up Crsr up Crsr up Play
Down Ch down Crsr down Crsr down Crsr down Crsr down Crsr down Pause Down Ch down Crsr down Crsr down Crsr down Crsr down Crsr down Pause
@ -23,6 +23,9 @@ Video Disk Recorder User's Manual
Blue - Resume Mark Mark(1) - Summary Stop Blue - Resume Mark Mark(1) - Summary Stop
0..9 Ch select - - - Numeric inp. - Editing 0..9 Ch select - - - Numeric inp. - Editing
Power Shutdown - - - - - - Power Shutdown - - - - - -
Volume+ Volume up - - - - - -
Volume- Volume down - - - - - -
Mute Mute - - - - - -
(1) The "Mark" button in the "Timers" menu only works if sorting the timers (1) The "Mark" button in the "Timers" menu only works if sorting the timers
has been disabled in the "Setup" menu. has been disabled in the "Setup" menu.

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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" #include "config.h"
@ -39,6 +39,9 @@ tKey keyTable[] = { // "Up" and "Down" must be the first two keys!
{ k8, "8", 0 }, { k8, "8", 0 },
{ k9, "9", 0 }, { k9, "9", 0 },
{ kPower, "Power", 0 }, { kPower, "Power", 0 },
{ kVolUp, "Volume+", 0 },
{ kVolDn, "Volume-", 0 },
{ kMute, "Mute", 0 },
{ kNone, "", 0 }, { kNone, "", 0 },
}; };

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __CONFIG_H
@ -43,6 +43,9 @@ enum eKeys { // "Up" and "Down" must be the first two keys!
kBlue, kBlue,
k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, k0, k1, k2, k3, k4, k5, k6, k7, k8, k9,
kPower, kPower,
kVolUp,
kVolDn,
kMute,
kNone, kNone,
// The following flags are OR'd with the above codes: // The following flags are OR'd with the above codes:
k_Repeat = 0x8000, k_Repeat = 0x8000,

View File

@ -7,7 +7,7 @@
* DVD support initially written by Andreas Schultz <aschultz@warp10.net> * DVD support initially written by Andreas Schultz <aschultz@warp10.net>
* based on dvdplayer-0.5 by Matjaz Thaler <matjaz.thaler@guest.arnes.si> * 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 //#define DVDDEBUG 1
@ -2539,6 +2539,8 @@ cDvbApi::cDvbApi(int n)
osd = NULL; osd = NULL;
#endif #endif
currentChannel = 1; currentChannel = 1;
mute = false;
volume = 255;
} }
cDvbApi::~cDvbApi() cDvbApi::~cDvbApi()
@ -3622,6 +3624,24 @@ bool cDvbApi::ToggleAudioTrack(void)
return false; 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) void cDvbApi::SetAudioCommand(const char *Command)
{ {
delete audioCommand; delete audioCommand;

View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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 #ifndef __DVBAPI_H
@ -315,6 +315,18 @@ private:
public: public:
static void SetAudioCommand(const char *Command); static void SetAudioCommand(const char *Command);
static const char *AudioCommand(void) { return audioCommand; } 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 { class cEITScanner {

29
i18n.c
View File

@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and * See the main source file 'vdr.c' for copyright information and
* how to reach the author. * 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> * Slovenian translations provided by Miha Setina <mihasetina@softhome.net>
* Italian translations provided by Alberto Carraro <bertocar@tin.it> * Italian translations provided by Alberto Carraro <bertocar@tin.it>
@ -1211,6 +1211,33 @@ const tPhrase Phrases[] = {
"", // TODO "", // TODO
"", // 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: // Miscellaneous:
{ "yes", { "yes",
"ja", "ja",

View File

@ -22,3 +22,6 @@ Blue 0000010C
8 00000038 8 00000038
9 00000039 9 00000039
Power 00000050 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 * 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 #define _GNU_SOURCE
@ -52,6 +52,8 @@
#define SHUTDOWNWAIT 300 // seconds to wait in user prompt before automatic shutdown #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 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 int Interrupted = 0;
static void SignalHandler(int signum) static void SignalHandler(int signum)
@ -424,6 +426,16 @@ int main(int argc, char *argv[])
case kMenu: Menu = new cMenuMain(ReplayControl); break; case kMenu: Menu = new cMenuMain(ReplayControl); break;
// Viewing Control: // Viewing Control:
case kOk: LastChannel = -1; break; // forces channel display 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: // Power off:
case kPower: isyslog(LOG_INFO, "Power button pressed"); case kPower: isyslog(LOG_INFO, "Power button pressed");
DELETENULL(*Interact); DELETENULL(*Interact);