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

Implemented cDevice::Transferring()

This commit is contained in:
Klaus Schmidinger 2006-02-04 14:58:24 +01:00
parent 8831fe304f
commit d5c739790b
6 changed files with 18 additions and 7 deletions

View File

@ -1044,6 +1044,7 @@ Reinhard Nissl <rnissl@gmx.de>
DiSEqC data) if the lock is lost DiSEqC data) if the lock is lost
for fixing handling TS packets in cTS2PES for fixing handling TS packets in cTS2PES
for adding a mutex to synchronize cDevice::PlayPesPacket() and SetCurrentAudioTrack() for adding a mutex to synchronize cDevice::PlayPesPacket() and SetCurrentAudioTrack()
for a suggestion that lead to implementing cDevice::Transferring()
Richard Robson <richard_robson@beeb.net> Richard Robson <richard_robson@beeb.net>
for reporting freezing replay if a timer starts while in Transfer Mode from the for reporting freezing replay if a timer starts while in Transfer Mode from the

View File

@ -4297,3 +4297,6 @@ Video Disk Recorder Revision History
if you don't want to use "fadvise" you need to comment out that line (thanks to if you don't want to use "fadvise" you need to comment out that line (thanks to
Artur Skawina). Artur Skawina).
- Fixed a missing ',' in the Swedish OSD texts (thanks to Arthur Konovalov). - Fixed a missing ',' in the Swedish OSD texts (thanks to Arthur Konovalov).
- cDevice::Transferring() can now be used to determine whether the (primary)
device is currently playing in Transfer Mode (based on a suggestion by
Reinhard Nissl).

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.122 2006/02/04 10:21:51 kls Exp $ * $Id: device.c 1.123 2006/02/04 14:58:24 kls Exp $
*/ */
#include "device.h" #include "device.h"
@ -924,12 +924,17 @@ bool cDevice::Replaying(void) const
return player != NULL; return player != NULL;
} }
bool cDevice::Transferring(void) const
{
return dynamic_cast<cTransfer *>(player) != NULL;
}
bool cDevice::AttachPlayer(cPlayer *Player) bool cDevice::AttachPlayer(cPlayer *Player)
{ {
if (CanReplay()) { if (CanReplay()) {
if (player) if (player)
Detach(player); Detach(player);
if (!dynamic_cast<cTransfer *>(Player)) if (!Transferring())
ClrAvailableTracks(); ClrAvailableTracks();
pesAssembler->Reset(); pesAssembler->Reset();
player = Player; player = Player;

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.71 2006/02/04 10:22:54 kls Exp $ * $Id: device.h 1.72 2006/02/04 14:22:08 kls Exp $
*/ */
#ifndef __DEVICE_H #ifndef __DEVICE_H
@ -484,6 +484,8 @@ public:
///< guaranteed to always receive complete PES packets. ///< guaranteed to always receive complete PES packets.
bool Replaying(void) const; bool Replaying(void) const;
///< Returns true if we are currently replaying. ///< Returns true if we are currently replaying.
bool Transferring(void) const;
///< Returns true if we are currently in Transfer Mode.
void StopReplay(void); void StopReplay(void);
///< Stops the current replay session (if any). ///< Stops the current replay session (if any).
bool AttachPlayer(cPlayer *Player); bool AttachPlayer(cPlayer *Player);

4
menu.c
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: menu.c 1.408 2006/02/03 13:24:53 kls Exp $ * $Id: menu.c 1.409 2006/02/04 14:47:27 kls Exp $
*/ */
#include "menu.h" #include "menu.h"
@ -3326,7 +3326,7 @@ cDisplayTracks::cDisplayTracks(void)
:cOsdObject(true) :cOsdObject(true)
{ {
cDevice::PrimaryDevice()->EnsureAudioTrack(); cDevice::PrimaryDevice()->EnsureAudioTrack();
SetTrackDescriptions(!cDevice::PrimaryDevice()->Replaying() || cTransferControl::ReceiverDevice() ? cDevice::CurrentChannel() : 0); SetTrackDescriptions(!cDevice::PrimaryDevice()->Replaying() || cDevice::PrimaryDevice()->Transferring() ? cDevice::CurrentChannel() : 0);
currentDisplayTracks = this; currentDisplayTracks = this;
numTracks = track = 0; numTracks = track = 0;
audioChannel = cDevice::PrimaryDevice()->GetAudioChannel(); audioChannel = cDevice::PrimaryDevice()->GetAudioChannel();

4
vdr.c
View File

@ -22,7 +22,7 @@
* *
* The project's page is at http://www.cadsoft.de/vdr * The project's page is at http://www.cadsoft.de/vdr
* *
* $Id: vdr.c 1.247 2006/02/04 12:57:03 kls Exp $ * $Id: vdr.c 1.248 2006/02/04 14:49:12 kls Exp $
*/ */
#include <getopt.h> #include <getopt.h>
@ -709,7 +709,7 @@ int main(int argc, char *argv[])
if (Channel->Modification(CHANNELMOD_RETUNE)) { if (Channel->Modification(CHANNELMOD_RETUNE)) {
cRecordControls::ChannelDataModified(Channel); cRecordControls::ChannelDataModified(Channel);
if (Channel->Number() == cDevice::CurrentChannel()) { if (Channel->Number() == cDevice::CurrentChannel()) {
if (!cDevice::PrimaryDevice()->Replaying() || cTransferControl::ReceiverDevice()) { if (!cDevice::PrimaryDevice()->Replaying() || cDevice::PrimaryDevice()->Transferring()) {
if (cDevice::ActualDevice()->ProvidesTransponder(Channel)) { // avoids retune on devices that don't really access the transponder if (cDevice::ActualDevice()->ProvidesTransponder(Channel)) { // avoids retune on devices that don't really access the transponder
isyslog("retuning due to modification of channel %d", Channel->Number()); isyslog("retuning due to modification of channel %d", Channel->Number());
Channels.SwitchTo(Channel->Number()); Channels.SwitchTo(Channel->Number());