summaryrefslogtreecommitdiff
path: root/device.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2005-01-02 15:11:44 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2005-01-02 15:11:44 +0100
commit0b3a801ab463186519e9e1c14ea891924c64dff5 (patch)
tree9795fd31fa77a909b5a9cd19ee89a7062d381685 /device.c
parent286af66cfb787b76ee7289c920a75a3dd21ce795 (diff)
downloadvdr-0b3a801ab463186519e9e1c14ea891924c64dff5.tar.gz
vdr-0b3a801ab463186519e9e1c14ea891924c64dff5.tar.bz2
Implemented audio track menu
Diffstat (limited to 'device.c')
-rw-r--r--device.c27
1 files changed, 8 insertions, 19 deletions
diff --git a/device.c b/device.c
index 2df50dab..20394a59 100644
--- a/device.c
+++ b/device.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: device.c 1.64 2004/12/24 15:37:11 kls Exp $
+ * $Id: device.c 1.65 2005/01/02 14:08:40 kls Exp $
*/
#include "device.h"
@@ -604,15 +604,19 @@ void cDevice::ClrAvailableTracks(void)
memset(availableTracks, 0, sizeof(availableTracks));
}
-bool cDevice::SetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language, uint32_t Flags)
+bool cDevice::SetAvailableTrack(eTrackType Type, int Index, uint16_t Id, const char *Language, const char *Description, uint32_t Flags)
{
eTrackType t = eTrackType(Type + Index);
if ((Type == ttAudio && IS_AUDIO_TRACK(t)) ||
(Type == ttDolby && IS_DOLBY_TRACK(t))) {
if (Language)
strn0cpy(availableTracks[t].language, Language, sizeof(availableTracks[t].language));
- availableTracks[t].flags = Flags;
- availableTracks[t].id = Id; // setting 'id' last to avoid the need for extensive locking
+ if (Description)
+ strn0cpy(availableTracks[t].description, Description, sizeof(availableTracks[t].description));
+ if (Id) {
+ availableTracks[t].flags = Flags;
+ availableTracks[t].id = Id; // setting 'id' last to avoid the need for extensive locking
+ }
return true;
}
else
@@ -652,21 +656,6 @@ bool cDevice::SetCurrentAudioTrack(eTrackType Type)
return false;
}
-bool cDevice::IncCurrentAudioTrack(void)
-{
- int i = currentAudioTrack + 1;
- for (;;) {
- if (i > ttDolbyLast)
- i = ttAudioFirst;
- if (i == currentAudioTrack)
- break;
- if (availableTracks[i].id)
- return SetCurrentAudioTrack(eTrackType(i));
- i++;
- }
- return false;
-}
-
bool cDevice::CanReplay(void) const
{
return HasDecoder();