File: control-dvd.c

package info (click to toggle)
vdr-plugin-dvd 0.3.6~b03+cvs20090426.0013-3
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 480 kB
  • ctags: 619
  • sloc: ansic: 4,866; sh: 624; makefile: 89
file content (785 lines) | stat: -rwxr-xr-x 21,591 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
/*
 * DVD Player plugin for VDR
 *
 * Copyright (C) 2001.2002 Andreas Schultz <aschultz@warp10.net>
 *
 * This code is distributed under the terms and conditions of the
 * GNU GENERAL PUBLIC LICENSE. See the file COPYING for details.
 *
 */

#include <assert.h>
#include <vdr/i18n.h>
#include <vdr/thread.h>
#include <vdr/skins.h>

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include "tools-dvd.h"
#include "player-dvd.h"
#include "control-dvd.h"

#define MENUTIMEOUT     120 // seconds
#define MAXWAIT4EPGINFO  10 // seconds
#define MODETIMEOUT       3 // seconds

bool cDvdPlayerControl::dvd_active = false;

#define DVDDEBUG

#define DEBUG_KEY(format, args...)
#define DEBUG_SHOW(format, args...)
#define DEBUG_OSDCTRL(format, args...)
//#define DEBUG_KEY(format, args...) printf (format, ## args); fflush(NULL)
//#define DEBUG_SHOW(format, args...) printf (format, ## args); fflush(NULL)
//#define DEBUG_OSDCTRL(format, args...) printf (format, ## args); fflush(NULL)

// --- cDvdPlayerControl -----------------------------------------------------

cDvdPlayerControl::cDvdPlayerControl(void) : cControl(player = new cDvdPlayer()) {
    assert(dvd_active == false);
    dvd_active = true;
    visible = modeOnly = shown = displayFrames = false;
    osdTaker = NULL;
    lastCurrent = lastTotal = -1;
    lastPlay = lastForward = false;
    lastSpeed = -1;
    displayReplay = NULL;
    timeoutShow = 0;
    inputActive = NoneInput;
    inputHide = true;
    forceDvdNavigation = false;
    player->setController(this);
    cStatus::MsgReplaying(this, "DVD", NULL, true);
}

cDvdPlayerControl::~cDvdPlayerControl()
{
    Hide();
    cStatus::MsgReplaying(this, NULL, NULL, false);
    Stop();
    assert(dvd_active == true);
    dvd_active = false;
    delete player;
}

bool cDvdPlayerControl::Active(void)
{
    return player && player->Active();
}

void cDvdPlayerControl::Stop(void)
{
    if (player)
        player->Stop();
}

void cDvdPlayerControl::Pause(void)
{
    if (player)
        player->Pause();
}

void cDvdPlayerControl::Play(void)
{
    if (player)
        player->Play();
}

void cDvdPlayerControl::Forward(void)
{
    if (player)
        player->Forward();
}

void cDvdPlayerControl::Backward(void)
{
    if (player)
        player->Backward();
}

void cDvdPlayerControl::SkipSeconds(int Seconds)
{
    if (player)
        player->SkipSeconds(Seconds);
}

int cDvdPlayerControl::SkipFrames(int Frames)
{
    return player ? player->SkipFrames(Frames) : -1;
}

bool cDvdPlayerControl::GetIndex(int &Current, int &Total, bool SnapToIFrame)
{
    return player ? player->GetIndex(Current, Total, SnapToIFrame) : false;
}

bool cDvdPlayerControl::GetReplayMode(bool &Play, bool &Forward, int &Speed)
{
    return player && player->GetReplayMode(Play, Forward, Speed);
}

void cDvdPlayerControl::Goto(int Seconds, bool Still)
{
    if (player)
        player->Goto(Seconds, Still);
}

void cDvdPlayerControl::OsdClose()
{
    DELETENULL(displayReplay);
}

void cDvdPlayerControl::OsdOpen(void)
{
    if (visible) {
        DEBUG_OSDCTRL("DVD-Ctrl: OsdOpen: allready visible\n");
        return;
    }

    if (OsdTaken(this)) {
        if (player) {
            DEBUG_OSDCTRL("DVD-Ctrl: OsdOpen: AllreadyOpen -> HideSPU ... \n");
            player->HideSPU();
        }
    }
    if (!TakeOsd((void *)this)) {
        DEBUG_OSDCTRL("DVD-Ctrl: OsdOpen: AllreadyOpen -> !visible, osdTaken=%d\n", OsdTaken(this));
        visible = false;
    } else {
        DEBUG_OSDCTRL("DVD-Ctrl: OsdOpen: visible\n");
        visible = true;
        displayReplay = Skins.Current()->DisplayReplay(modeOnly);
    }
}

void cDvdPlayerControl::ShowTimed(int Seconds) {
    if (modeOnly)
        Hide();
    if (!visible) {
        shown = ShowProgress(true);
        timeoutShow = (shown && Seconds > 0) ? time(NULL) + Seconds : 0;
    }
}

void cDvdPlayerControl::Show(void) {
    ShowTimed();
}

void cDvdPlayerControl::Hide(void)
{
    DEBUG_SHOW("DVD-Ctrl: Hide\n");

    TakeOsd((void *)(-1)); // somebody else (external) might take the osd ..
    if (player)
        player->HideSPU();
    HideOwnOsd();
}

void cDvdPlayerControl::HideOwnOsd(void)
{
    DEBUG_SHOW("DVD-Ctrl: HideOwnOsd: visible=%d\n", visible);

    if (visible) {
        OsdClose();
#if VDRVERSNUM >= 10500
        SetNeedsFastResponse(false);
#else
        needsFastResponse = false;
#endif
        visible = modeOnly = false;
        lastPlay = lastForward = false;
        lastSpeed = -1;
    }
}

bool cDvdPlayerControl::TakeOsd(void * owner)
{
    if (owner == (void *)-1 || !OsdTaken(owner)) {
        DEBUG_OSDCTRL("DVD-Ctrl: TakeOsd(%p) new owner!\n", owner);
        osdTaker = owner; // not taken by other: new owner
        return true;
    } else {
        DEBUG_OSDCTRL("DVD-Ctrl: TakeOsd(%p) not taken!\n", owner);
    }
    return false;
}

bool cDvdPlayerControl::OsdTaken(void *me)
{
    if (osdTaker && !cOsd::IsOpen()) {
        DEBUG_OSDCTRL("DVD-Ctrl: OsdTaken(%p) !IsOpen->taker:=NULL\n", me);
        osdTaker = NULL; // update info ..
    }
    DEBUG_OSDCTRL("DVD-Ctrl: OsdTaken(%p) != %p := %d \n", me, osdTaker, osdTaker!=me);
    return osdTaker != NULL && osdTaker != me;
}

bool cDvdPlayerControl::OsdVisible(void *me)
{
    return visible || OsdTaken(me) ;
}

void cDvdPlayerControl::ShowMode(void)
{
    if (Setup.ShowReplayMode && inputActive == NoneInput) {
        bool Play, Forward;
        int Speed;
        if (GetReplayMode(Play, Forward, Speed) && (!visible || Play != lastPlay || Forward != lastForward || Speed != lastSpeed)) {
            bool NormalPlay = (Play && Speed == -1);
            if (!visible) {
                if (NormalPlay)
                    return; // no need to do indicate ">" unless there was a different mode displayed before
                modeOnly = true;
                // open small display
                OsdOpen();
            }
            if (!visible)
                return;
            if (modeOnly && !timeoutShow && NormalPlay)
                timeoutShow = time(NULL) + MODETIMEOUT;
            displayReplay->SetMode(Play, Forward, Speed);
            lastPlay = Play;
            lastForward = Forward;
            lastSpeed = Speed;
        }
    }
}

const char *cDvdPlayerControl::GetDisplayHeaderLine()
{
    char *titleinfo_str = NULL;
    char *title_str = NULL;
    char *aspect_str = NULL;

    const char *audiolang_str = NULL;
    const char *spulang_str = NULL;

    static char title_buffer[256];

    title_buffer[0] = 0;
    if (!player)
        return title_buffer;

    titleinfo_str = player->GetTitleInfoString();
    title_str = player->GetTitleString();
    aspect_str = player->GetAspectString();

    player->GetAudioLanguageStr(&audiolang_str);
    player->GetSubtitleLanguageStr(&spulang_str);

    snprintf(title_buffer, sizeof(title_buffer), "%s, %s, %s, %s, %s    ", titleinfo_str, audiolang_str, spulang_str, aspect_str, title_str);

    free(titleinfo_str);
    free(title_str);
    free(aspect_str);
    return title_buffer;
}

bool cDvdPlayerControl::ShowProgress(bool Initial)
{
    int Current, Total;
    const char *title_buffer = NULL;
    static char last_title_buffer[256];

    if (GetIndex(Current, Total) && Total > 0) {
        DEBUG_SHOW("DVD-Ctrl: ShowProgress: ... \n");
        if (!visible) {
#if VDRVERSNUM >= 10500
            SetNeedsFastResponse(true);
#else
            needsFastResponse = true;
#endif
            OsdOpen();
        }
        if (!visible)
            return false;

        if (Initial) {
            lastCurrent = lastTotal = -1;
            last_title_buffer[0] = 0;
            displayReplay->SetTitle("unknown title");
            cStatus::MsgReplaying(this, "unknown title", NULL, true);
        }

        if (player) {
            title_buffer = GetDisplayHeaderLine();
            if (strcmp(title_buffer, last_title_buffer)) {
                displayReplay->SetTitle(title_buffer);
                if (!Initial)
                    displayReplay->Flush();
                cStatus::MsgReplaying(this, title_buffer, NULL, true);
                strcpy(last_title_buffer, title_buffer);
            }
        }

        if (Current != lastCurrent || Total != lastTotal) {
            displayReplay->SetProgress(Current, Total);
            displayReplay->SetTotal(IndexToHMSF(Total));
            displayReplay->SetCurrent(IndexToHMSF(Current, displayFrames));
            lastCurrent = Current;
            if (!Initial)
                displayReplay->Flush();
        }
        lastTotal = Total;
        ShowMode();
        return true;
    } else {
        DEBUG_SHOW("DVD-Ctrl: ShowProgress: nope \n");
    }
    return false;
}

void cDvdPlayerControl::InputIntDisplay(const char *msg, int val)
{
    char buf[120];
    snprintf(buf, sizeof(buf), "%s %d", msg, val);
    displayReplay->SetJump(buf);
}

void cDvdPlayerControl::InputIntProcess(eKeys Key, const char *msg, int &val)
{
    switch (Key) {
        case k0 ... k9:
            val = val * 10 + Key - k0;
            InputIntDisplay(msg, val);
            break;
        case kOk:
        case kLeft:
        case kRight:
        case kUp:
        case kDown:
            switch (inputActive) {
                case TimeSearchInput:
                    break;
                case TrackSearchInput:
                    if (player)
                        player->GotoTitle(val);
                    break;
                default:
                    break;
            }
            inputActive = NoneInput;
            break;
        default:
            inputActive = NoneInput;
            break;
    }
    if (inputActive == NoneInput) {
        if (inputHide)
            Hide();
        else
            displayReplay->SetJump(NULL);
        ShowMode();
    }
}

void cDvdPlayerControl::TrackSearch(void)
{
    inputIntVal = 0;
    inputIntMsg = "Track: ";
    inputHide = false;
    Show();
    if (visible)
        inputHide = true;
    else
        return;
    timeoutShow = 0;
    InputIntDisplay(inputIntMsg, inputIntVal);
    inputActive = TrackSearchInput;
}

void cDvdPlayerControl::TimeSearchDisplay(void)
{
    char buf[64];
    strcpy(buf, trVDR("Jump: "));
    int len = strlen(buf);
    char h10 = '0' + (timeSearchTime >> 24);
    char h1  = '0' + ((timeSearchTime & 0x00FF0000) >> 16);
    char m10 = '0' + ((timeSearchTime & 0x0000FF00) >> 8);
    char m1  = '0' + (timeSearchTime & 0x000000FF);
    char ch10 = timeSearchPos > 3 ? h10 : '-';
    char ch1  = timeSearchPos > 2 ? h1  : '-';
    char cm10 = timeSearchPos > 1 ? m10 : '-';
    char cm1  = timeSearchPos > 0 ? m1  : '-';
    sprintf(buf + len, "%c%c:%c%c", ch10, ch1, cm10, cm1);
    displayReplay->SetJump(buf);
}

void cDvdPlayerControl::TimeSearchProcess(eKeys Key)
{
    #define STAY_SECONDS_OFF_END 10
    int Seconds = (timeSearchTime >> 24) * 36000 + ((timeSearchTime & 0x00FF0000) >> 16) * 3600 + ((timeSearchTime & 0x0000FF00) >> 8) * 600 + (timeSearchTime & 0x000000FF) * 60;
#if VDRVERSNUM >= 10703
    int Current = int(lastCurrent / FramesPerSecond());
    int Total = int(lastTotal / FramesPerSecond());
#else
    int Current = (lastCurrent / FRAMESPERSEC);
    int Total = (lastTotal / FRAMESPERSEC);
#endif
    switch (Key) {
        case k0 ... k9:
            if (timeSearchPos < 4) {
                timeSearchTime <<= 8;
                timeSearchTime |= Key - k0;
                timeSearchPos++;
                TimeSearchDisplay();
            }
            break;
        case kLeft:
        case kRight: {
            int dir = (Key == kRight ? 1 : -1);
            if (dir > 0)
                Seconds = min(Total - Current - STAY_SECONDS_OFF_END, Seconds);
            switch ( inputActive ) {
                case TimeSearchInput:
                    SkipSeconds(Seconds * dir);
                    break;
                case TrackSearchInput:
                    break;
                default:
                    break;
            }
            inputActive = NoneInput;
            break;
        }
        case kPlay:
        case kUp:
        case kPause:
        case kDown:
        case kOk:
            Seconds = min(Total - STAY_SECONDS_OFF_END, Seconds);
            switch (inputActive) {
                case TimeSearchInput:
                    Goto(Seconds, Key == kDown);
                    break;
                case TrackSearchInput:
                    break;
                default:
                    break;
            }
            inputActive = NoneInput;
            break;
        default:
            inputActive = NoneInput;
            break;
    }
    if (inputActive == NoneInput) {
        if (inputHide)
            Hide();
        else
            displayReplay->SetJump(NULL);
        ShowMode();
    }
}

void cDvdPlayerControl::TimeSearch(void)
{
    timeSearchTime = timeSearchPos = 0;
    inputHide = false;
    Show();
    if (visible)
        inputHide = true;
    else
        return;
    timeoutShow = 0;
    TimeSearchDisplay();
    inputActive = TimeSearchInput;
}

bool cDvdPlayerControl::DvdNavigation(eKeys Key)
{
    if (!player)
        return false;

    HideOwnOsd();
    if(player)
        player->DrawSPU();

    switch (Key) {
        case kUp:
        case k2:
            player->selectUpButton();
            break;
        case kDown:
        case k8:
            player->selectDownButton();
            break;
        case kLeft:
        case k4:
            player->selectLeftButton();
            break;
        case kRight:
        case k6:
            player->selectRightButton();
            break;
        case kOk:
        case k5:
            player->activateButton();
            break;
        case k1:
            player->callRootMenu();
            break;
        case k3:
            player->callTitleMenu();
            break;
        case k7:
            player->callSubpMenu();
            break;
        case k9:
            player->callAudioMenu();
            break;
        default:
            return false;
    }
    return true;
}

void cDvdPlayerControl::UpdateShow(bool force)
{
    DEBUG_SHOW("DVD-Ctrl: updateShow: force=%d, visible=%d, modeOnly=%d\n",
        force, visible, modeOnly);
    if (visible || force) {
        if (timeoutShow && time(NULL) > timeoutShow) {
            Hide();
            ShowMode();
            timeoutShow = 0;
            return;
        }
        if (modeOnly)
            ShowMode();
        else
            shown = ShowProgress(!shown) || shown;
    } else {
        const char *title_buffer = NULL;
        static char last_title_buffer[256];
        if (player) {
            title_buffer = GetDisplayHeaderLine();
            if (strcmp(title_buffer, last_title_buffer)) {
                strcpy(last_title_buffer, title_buffer);
                cStatus::MsgReplaying(this, title_buffer, NULL, true);
            }
        }
    }
}

eOSState cDvdPlayerControl::ProcessKey(eKeys Key)
{
    DEBUG_KEY("DVD-Ctrl: ProcessKey BEGIN\n");

    eOSState state = cOsdObject::ProcessKey(Key);

    if (state != osUnknown) {
        Hide();
        DEBUG_KEY("cDvdPlayerControl::ProcessKey key: %d 0x%X, state=%d 0x%X FIN!\n",
            Key, Key, state, state);
        DEBUG_KEY("DVD-Ctrl: ProcessKey END\n");
        return state;
    }

    DEBUG_KEY("cDvdPlayerControl::ProcessKey key: %d 0x%X, state=unknown\n", Key, Key);

    if (player && player->DVDRemoveable()) {
        DEBUG_KEY("cDvdPlayerControl::ProcessKey DVDRemoveable -> Stop\n");
        Hide();
        DEBUG_KEY("DVD-Ctrl: ProcessKey END\n");
        return osEnd;
    }
    if (!Active()) {
       DEBUG_KEY("cDvdPlayerControl::ProcessKey !Active -> Stop\n");
       Hide();
       Stop();
       DEBUG_KEY("DVD-Ctrl: ProcessKey END\n");
       return osEnd;
    }

    UpdateShow();

    bool DisplayedFrames = displayFrames;
    displayFrames = false;
    if (inputActive != NoneInput && Key != kNone) {
        switch (inputActive) {
            case TimeSearchInput:
                TimeSearchProcess(Key);
                break;
            case TrackSearchInput:
                InputIntProcess(Key, inputIntMsg, inputIntVal);
                break;
            default:
                break;
        }
        DEBUG_KEY("DVD-Ctrl: ProcessKey END\n");
        return osContinue;
    }
    bool DoShowMode = true;

    state = osContinue;

    if ((player && player->IsInMenuDomain()) || forceDvdNavigation) {

        switch (Key) {
            case kRed:
                forceDvdNavigation = false;
                break;
            case kGreen|k_Repeat:
            case kGreen:
                player->PreviousTitle();
                break;
            case kYellow|k_Repeat:
            case kYellow:
                player->NextTitle();
                break;
            case kUp:
            case kDown:
            case kLeft:
            case kRight:
            case kOk:
            case k0 ... k9:
                DoShowMode = false;
                displayFrames = DisplayedFrames;
                if (DvdNavigation(Key))
                    break;
            default:
                state = osUnknown;
                break;
        }
    } else {
        switch (Key) {
            // Positioning:
            case kPlay:
            case kUp:
                Play();
                break;
            case kPause:
            case kDown:
                Pause();
                break;
            case kFastRew|k_Release:
            case kLeft|k_Release:
                if (Setup.MultiSpeedMode)
                    break;
            case kFastRew:
            case kLeft:
                Backward();
                break;
            case kFastFwd|k_Release:
            case kRight|k_Release:
                if (Setup.MultiSpeedMode)
                    break;
            case kFastFwd:
            case kRight:
                Forward();
                break;
            default:
                state = osUnknown;
                break;
            }
    }

    if (state == osUnknown) {
        state = osContinue;

        switch (Key) {
            // Positioning:
            case kRed:
                TimeSearch();
                break;
            case kGreen | k_Repeat:
            case kGreen:
                SkipSeconds(-60);
                break;
            case kYellow | k_Repeat:
            case kYellow:
                SkipSeconds(60);
                break;
            case kBlue:
                TrackSearch();
                break;
            default: {
                DoShowMode = false;
                displayFrames = DisplayedFrames;
                switch (Key) {
                    // Menu control:
                    case kOk:
                        if (visible && !modeOnly) {
                            Hide();
                            DoShowMode = true;
                        } else
                            Show();
                        break;
                    case kStop:
                    case kBack:
                        Hide();
                        Stop();
                        state = osEnd;
                        break;
                    case k2:
                        if (player) {
                            if (player->NextSubpStream() == -1)
                                Skins.Message(mtError, tr("Error.DVD$Current subp stream not seen!"));
                            if (player->GetCurrentNavSubpStream() == -1) {
                                Hide();
                                Show();
                            }
                        }
                        break;
                    case k3:
                        if (player)
                            player->NextAngle();
                        break;
                    case kPrev:
                    case k4:
                        if (player)
                            player->PreviousPart();
                        break;
                    case kNext:
                    case k6:
                        if (player)
                            player->NextPart();
                        break;
                    case kChanDn:
                    case k7:
                        if (player)
                            player->PreviousTitle();
                        break;
                    case kChanUp:
                    case k9:
                        if (player)
                            player->NextTitle();
                        break;
                    case k5:
                        if (visible && !modeOnly) {
                            Hide();
                            player->callRootMenu();
                        } else {
                            Hide();
                            forceDvdNavigation = true;
                        }
                        break;
                    case k8:
                        if (player) {
                            Hide();
                            player->callTitleMenu();
                        }
                        break;
                    case k0:
                        if (player) {
                            Hide();
                            player->callAudioMenu();
                        }
                        break;
                    default:
                        state = osUnknown;
                }
            }
        }
    }
    if (DoShowMode && state != osEnd) {
        DEBUG_SHOW("cDvdPlayerControl::ProcessKey ShowMode\n");
        ShowMode();
    }
    DEBUG_KEY("DVD-Ctrl: ProcessKey END\n");
    return state;
}