1
0
mirror of https://github.com/VDR4Arch/vdr.git synced 2023-10-10 13:36:52 +02:00

Switched handling 'Transfer Mode' to the new cPlayer/cControl structures

This commit is contained in:
Klaus Schmidinger 2002-06-23 12:59:58 +02:00
parent bd26fdf362
commit 26981fd7b1
7 changed files with 47 additions and 23 deletions

View File

@ -724,7 +724,7 @@ Video Disk Recorder Revision History
"next timer event at..." messages in that case). "next timer event at..." messages in that case).
- Reduced the default value for MinEventTimeout to 30 minutes. - Reduced the default value for MinEventTimeout to 30 minutes.
- Fixed detecting manual start in shutdown feature. - Fixed detecting manual start in shutdown feature.
- An error message is now displayed in case the Transfer Mode can't be - An error message is now displayed in case the 'Transfer Mode' can't be
started because the necessary DVB card is currently recording (or there started because the necessary DVB card is currently recording (or there
is no DVB card that can access this channel). is no DVB card that can access this channel).
- Fixed toggling channels with the '0' key in case the "Ok" button has been - Fixed toggling channels with the '0' key in case the "Ok" button has been
@ -1108,7 +1108,7 @@ Video Disk Recorder Revision History
- The "Left" and "Right" keys are now used to page up and down in text displays - The "Left" and "Right" keys are now used to page up and down in text displays
(like the EPG descriptions or the results of commands executed from the (like the EPG descriptions or the results of commands executed from the
"Commands" menu). "Commands" menu).
- Fixed high CPU usage in transfer mode. - Fixed high CPU usage in 'Transfer Mode'.
- Replaced 'killproc' with 'killall' in 'runvdr', since apparently 'killproc' - Replaced 'killproc' with 'killall' in 'runvdr', since apparently 'killproc'
is not available by default on some Linux distributions, whereas 'killall' is. is not available by default on some Linux distributions, whereas 'killall' is.
Please check if your system provides 'killall' - if it doesn't, please change Please check if your system provides 'killall' - if it doesn't, please change
@ -1343,7 +1343,7 @@ Video Disk Recorder Revision History
will use the same DVB card. During the time where both timers record the data will use the same DVB card. During the time where both timers record the data
is simply saved to both files. is simply saved to both files.
- The following limitations apply to this version: - The following limitations apply to this version:
+ Transfer mode doesn't work yet. + 'Transfer Mode' doesn't work yet.
+ The '-a' option (for Dolby Digital audio) doesn't work yet. + The '-a' option (for Dolby Digital audio) doesn't work yet.
+ Switching between different language tracks doesn't work yet. + Switching between different language tracks doesn't work yet.
+ Cutting doesn't work yet. + Cutting doesn't work yet.
@ -1352,6 +1352,7 @@ Video Disk Recorder Revision History
- Added Hungarian language texts (thanks to Istvan Koenigsberger and Guido Josten). - Added Hungarian language texts (thanks to Istvan Koenigsberger and Guido Josten).
- Activated cutting. - Activated cutting.
- Activated transfer mode. - Activated 'Transfer Mode'.
- Moved handling of the Menu key entirely into vdr.c. - Moved handling of the Menu key entirely into vdr.c.
- Switched VDR's own player to the new cPlayer/cControl structures. - Switched VDR's own player to the new cPlayer/cControl structures.
- Switched handling 'Transfer Mode' to the new cPlayer/cControl structures.

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: device.c 1.4 2002/06/23 11:16:21 kls Exp $ * $Id: device.c 1.5 2002/06/23 12:51:24 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -106,7 +106,6 @@ cDevice::cDevice(int n)
currentChannel = 0; currentChannel = 0;
frequency = 0; frequency = 0;
transfer = NULL;
mute = false; mute = false;
volume = Setup.CurrentVolume; volume = Setup.CurrentVolume;
@ -120,7 +119,6 @@ cDevice::cDevice(int n)
cDevice::~cDevice() cDevice::~cDevice()
{ {
delete transfer;
delete dvrFileName; delete dvrFileName;
delete siProcessor; delete siProcessor;
Detach(player); Detach(player);
@ -459,7 +457,6 @@ bool cDevice::SetPid(int fd, dmxPesType_t PesType, int Pid, dmxOutput_t Output)
eSetChannelResult cDevice::SetChannel(int ChannelNumber, int Frequency, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Tpid, int Ca, int Pnr) eSetChannelResult cDevice::SetChannel(int ChannelNumber, int Frequency, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Tpid, int Ca, int Pnr)
{ {
DELETENULL(transfer);
StopReplay(); StopReplay();
cStatus::MsgChannelSwitch(this, 0); cStatus::MsgChannelSwitch(this, 0);
@ -623,11 +620,8 @@ eSetChannelResult cDevice::SetChannel(int ChannelNumber, int Frequency, char Pol
if (NeedsTransferMode) { if (NeedsTransferMode) {
cDevice *CaDevice = GetDevice(Ca, 0); cDevice *CaDevice = GetDevice(Ca, 0);
if (CaDevice && !CaDevice->Receiving()) { if (CaDevice && !CaDevice->Receiving()) {
if ((Result = CaDevice->SetChannel(ChannelNumber, Frequency, Polarization, Diseqc, Srate, Vpid, Apid, Tpid, Ca, Pnr)) == scrOk) { if ((Result = CaDevice->SetChannel(ChannelNumber, Frequency, Polarization, Diseqc, Srate, Vpid, Apid, Tpid, Ca, Pnr)) == scrOk)
transfer = new cTransfer(Vpid, Apid, 0, 0, 0);//XXX+ cControl::Launch(new cTransferControl(CaDevice, Vpid, Apid, 0, 0, 0));//XXX+
AttachPlayer(transfer);
CaDevice->AttachReceiver(transfer);
}
} }
else else
Result = scrNoTransfer; Result = scrNoTransfer;
@ -791,6 +785,8 @@ void cDevice::StopReplay(void)
{ {
if (player) { if (player) {
Detach(player); Detach(player);
if (IsPrimaryDevice())
cControl::Shutdown();
/*XXX+ /*XXX+
if (IsPrimaryDevice()) { if (IsPrimaryDevice()) {
// let's explicitly switch the channel back in case it was in Transfer Mode: // let's explicitly switch the channel back in case it was in Transfer Mode:

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: device.h 1.2 2002/06/22 13:34:55 kls Exp $ * $Id: device.h 1.3 2002/06/23 11:50:24 kls Exp $
*/ */
#ifndef __DEVICE_H #ifndef __DEVICE_H
@ -33,7 +33,6 @@ enum eSetChannelResult { scrOk, scrNoTransfer, scrFailed };
class cPlayer; class cPlayer;
class cReceiver; class cReceiver;
class cTransfer;
class cDevice : cThread { class cDevice : cThread {
friend class cOsd;//XXX friend class cOsd;//XXX
@ -107,7 +106,6 @@ public:
private: private:
int currentChannel; int currentChannel;
int frequency; int frequency;
cTransfer *transfer;
public: public:
eSetChannelResult SetChannel(int ChannelNumber, int Frequency, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Tpid, int Ca, int Pnr); eSetChannelResult SetChannel(int ChannelNumber, int Frequency, char Polarization, int Diseqc, int Srate, int Vpid, int Apid, int Tpid, int Ca, int Pnr);
static int CurrentChannel(void) { return primaryDevice ? primaryDevice->currentChannel : 0; } static int CurrentChannel(void) { return primaryDevice ? primaryDevice->currentChannel : 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: player.c 1.2 2002/06/23 11:23:17 kls Exp $ * $Id: player.c 1.3 2002/06/23 12:56:25 kls Exp $
*/ */
#include "player.h" #include "player.h"
@ -49,9 +49,10 @@ void cPlayer::Detach(void)
cControl *cControl::control = NULL; cControl *cControl::control = NULL;
cControl::cControl(cPlayer *Player) cControl::cControl(cPlayer *Player, bool Hidden)
{ {
attached = false; attached = false;
hidden = Hidden;
player = Player; player = Player;
} }
@ -61,6 +62,11 @@ cControl::~cControl()
control = NULL; control = NULL;
} }
cControl *cControl::Control(void)
{
return (control && !control->hidden) ? control : NULL;
}
void cControl::Launch(cControl *Control) void cControl::Launch(cControl *Control)
{ {
delete control; delete control;

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: player.h 1.3 2002/06/23 11:20:23 kls Exp $ * $Id: player.h 1.4 2002/06/23 12:56:38 kls Exp $
*/ */
#ifndef __PLAYER_H #ifndef __PLAYER_H
@ -47,16 +47,17 @@ class cControl : public cOsdObject {
private: private:
static cControl *control; static cControl *control;
bool attached; bool attached;
bool hidden;
protected: protected:
cPlayer *player; cPlayer *player;
public: public:
cControl(cPlayer *Player); cControl(cPlayer *Player, bool Hidden = false);
virtual ~cControl(); virtual ~cControl();
virtual void Hide(void) = 0; virtual void Hide(void) = 0;
static void Launch(cControl *Control); static void Launch(cControl *Control);
static void Attach(void); static void Attach(void);
static void Shutdown(void); static void Shutdown(void);
static cControl *Control(void) { return control; } static cControl *Control(void);
}; };
#endif //__PLAYER_H #endif //__PLAYER_H

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: transfer.c 1.1 2002/06/22 13:39:23 kls Exp $ * $Id: transfer.c 1.2 2002/06/23 12:56:49 kls Exp $
*/ */
#include "transfer.h" #include "transfer.h"
@ -120,3 +120,16 @@ void cTransfer::SetAudioPid(int APid)
remux.SetAudioPid(APid); remux.SetAudioPid(APid);
XXX*/ XXX*/
} }
// --- cTransferControl ------------------------------------------------------
cTransferControl::cTransferControl(cDevice *ReceiverDevice, int VPid, int APid1, int APid2, int DPid1, int DPid2)
:cControl(transfer = new cTransfer(VPid, APid1, APid2, DPid1, DPid2), true)
{
ReceiverDevice->AttachReceiver(transfer);
}
cTransferControl::~cTransferControl()
{
delete transfer;
}

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: transfer.h 1.1 2002/06/22 13:38:23 kls Exp $ * $Id: transfer.h 1.2 2002/06/23 12:26:24 kls Exp $
*/ */
#ifndef __TRANSFER_H #ifndef __TRANSFER_H
@ -32,4 +32,13 @@ public:
void SetAudioPid(int APid); void SetAudioPid(int APid);
}; };
class cTransferControl : public cControl {
private:
cTransfer *transfer;
public:
cTransferControl(cDevice *ReceiverDevice, int VPid, int APid1, int APid2, int DPid1, int DPid2);
~cTransferControl();
virtual void Hide(void) {}
};
#endif //__TRANSFER_H #endif //__TRANSFER_H