2
generic Implementation of a cd-player
3
Copyright (C) 1998 Martin Vogt
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.
9
For more information look at the file COPYRIGHT in this package
16
#ifndef __INPUTDECODERXPLAYER_H
17
#define __INPUTDECODERXPLAYER_H
20
#include "../yafcore/inputDecoder.h"
21
#include "yafOutputStream.h"
26
major modes . it should be not necessary to define
28
What are "major modes"?
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.
35
These Major modes describes the basic commands which
36
every yaf-decoder implementation should support:
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...)
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" ?
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
66
off: the cd player is switched off (/dev/dsp is unlocked)
69
on : (you may play the inserte cd) (/dev/dsp is locked)
71
playing: cd player plays something (player is switched on)
72
pause: does not play "
74
open track : think of it that you "select a track" you
75
can only open a track if the player is "ON"
77
close track: eject the cd from player.
78
(This does not necessarily mean that /dev/dsp is unlocked)
82
class CommandTableXPlayer;
84
class InputDecoderXPlayer : public InputDecoder {
88
InputDecoderXPlayer(YafOutputStream* yafOutput);
89
~InputDecoderXPlayer();
91
const char* processCommand(int command,const char* args);
94
void setMajorMode(int mode);
97
void setMajorModeInfo(int lDisplayMajorMode);
98
int getMajorModeInfo();
106
CommandTableXPlayer* ct;
107
int lDisplayMajorMode;
108
OutputInterface* output;
109
YafOutputStream* yafOutput;