~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpeglib/example/yaf/yafxplayer/inputDecoderXPlayer.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  generic Implementation of a cd-player
 
3
  Copyright (C) 1998  Martin Vogt
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
 
 
15
 
 
16
#ifndef __INPUTDECODERXPLAYER_H
 
17
#define __INPUTDECODERXPLAYER_H
 
18
 
 
19
 
 
20
#include "../yafcore/inputDecoder.h"
 
21
#include "yafOutputStream.h"
 
22
 
 
23
 
 
24
 
 
25
/** 
 
26
    major modes . it should be not necessary to define
 
27
    new modes.
 
28
    What are "major modes"?
 
29
    <p>
 
30
    The idea of the major modes, is that this is a very
 
31
    general description of an abstract cd player.
 
32
    When the decoder works yaf send these
 
33
    major modes to the frontend.
 
34
    <p>
 
35
    These Major modes describes the basic commands which
 
36
    every yaf-decoder implementation should support:
 
37
    <pre>
 
38
    on/off
 
39
    open/close
 
40
    pause/play
 
41
    </pre>
 
42
    Thus it is possible that a frontend works with
 
43
    a decoder even if the frontend  does not fully support all
 
44
    the commands (e.g: switch to mono etc...)
 
45
 
 
46
 <pre>
 
47
 If you think you have a new "mode" its almost a "feature"
 
48
 eg:  You have a command "jump" but this is not a "mode"
 
49
      because you can press "jump" on your cd player even
 
50
      if the cd player is off OR on OR playing OR paused
 
51
      In all these cases the command does not affect the
 
52
      state of your cd-player. Or do you have a player
 
53
      which switches itself on if you press e.g. "Track 1" ?
 
54
 </pre>     
 
55
*/
 
56
 
 
57
#define _PLAYER_MAJOR_MODE_OFF               1
 
58
#define _PLAYER_MAJOR_MODE_ON                2
 
59
#define _PLAYER_MAJOR_MODE_OPEN_TRACK        3
 
60
#define _PLAYER_MAJOR_MODE_CLOSE_TRACK       4
 
61
#define _PLAYER_MAJOR_MODE_PLAYING           5   
 
62
#define _PLAYER_MAJOR_MODE_PAUSE             6
 
63
 
 
64
 
 
65
/*    
 
66
 off: the cd player is switched off  (/dev/dsp is unlocked)
 
67
 
 
68
 
 
69
 on : (you may play the inserte cd) (/dev/dsp is locked) 
 
70
 
 
71
 playing: cd player plays something  (player is switched on)
 
72
 pause: does not play                        "
 
73
 
 
74
 open track : think of it that you "select a track" you
 
75
              can only open a track if the player is "ON"
 
76
 
 
77
 close track: eject the cd from player. 
 
78
              (This does not necessarily mean that /dev/dsp is unlocked)
 
79
*/
 
80
 
 
81
 
 
82
class CommandTableXPlayer;
 
83
 
 
84
class InputDecoderXPlayer : public InputDecoder {
 
85
 
 
86
  
 
87
 public:
 
88
  InputDecoderXPlayer(YafOutputStream* yafOutput);
 
89
  ~InputDecoderXPlayer();
 
90
 
 
91
  const char* processCommand(int command,const char* args);
 
92
  void doSomething();
 
93
 
 
94
  void setMajorMode(int mode);
 
95
  int getMajorMode();
 
96
 
 
97
  void setMajorModeInfo(int lDisplayMajorMode);
 
98
  int getMajorModeInfo();
 
99
 
 
100
  int getOn();
 
101
  void setOn(int lOn);
 
102
 
 
103
 private:
 
104
 
 
105
  int majorMode;
 
106
  CommandTableXPlayer* ct;
 
107
  int lDisplayMajorMode;
 
108
  OutputInterface* output;
 
109
  YafOutputStream* yafOutput;
 
110
  
 
111
  int isOn;
 
112
};
 
113
 
 
114
 
 
115
#endif
 
116
 
 
117