codice:
class eZapMain: public eWidget
{
friend class eEPGSelector;
public:
enum { modeTV, modeRadio, modeFile, modeEnd };
enum { stateSleeping=2, stateInTimerMode=4, stateRecording=8, recDVR=16, recVCR=32, recNgrab=64, statePaused=128 };
enum { messageGoSleep=2, messageShutdown, messageNoRecordSpaceLeft };
private:
eLabel *ChannelNumber, *ChannelName, *Clock,
*EINow, *EINext, *EINowDuration, *EINextDuration,
*EINowTime, *EINextTime, *Description, *fileinfos,
*ButtonRedEn, *ButtonRedDis,
*ButtonGreenEn, *ButtonGreenDis,
*ButtonYellowEn, *ButtonYellowDis,
*ButtonBlueEn, *ButtonBlueDis,
*DolbyOn, *DolbyOff, *CryptOn, *CryptOff, *WideOn, *WideOff, *recstatus,
mute, volume,
*DVRSpaceLeft;
eWidget *dvrInfoBar, *dvbInfoBar, *fileInfoBar;
int dvrfunctions;
int stateOSD;
// eRecordingStatus *recstatus;
#ifndef DISABLE_FILE
eProgressWithIndices *Progress;
#else
eProgress *Progress;
#endif
eProgress *VolumeBar;
eMessageBox *pMsg, *pRotorMsg;
eLock messagelock;
std::list<eZapMessage> messages;
eFixedMessagePump<int> message_notifier;
eTimer timeout, clocktimer, messagetimeout,
progresstimer, volumeTimer, recStatusBlink,
doubleklickTimer, delayedStandbyTimer;
Connection doubleklickTimerConnection;
int cur_start, cur_duration, cur_event_id;
eString cur_event_text;
eNVODSelector nvodsel;
eSubServiceSelector subservicesel;
eAudioSelector audiosel;
eVideoSelector videosel;
eEventDisplay *actual_eventDisplay;
eServiceReferenceDVB refservice;
ePlaylist *playlist; // history / current playlist entries
eServiceReference playlistref;
#ifndef DISABLE_FILE
ePlaylist *recordings;
eServiceReference recordingsref;
#endif
ePlaylist *userTVBouquets;
eServiceReference userTVBouquetsRef;
ePlaylist *userRadioBouquets;
eServiceReference userRadioBouquetsRef;
ePlaylist *userFileBouquets;
eServiceReference userFileBouquetsRef;
ePlaylist *currentSelectedUserBouquet; // in addToFavourite Mode...
eServiceReference currentSelectedUserBouquetRef;
eString eplPath; // where we store Favlists? user changeable...
ePlaylist *addUserBouquet( ePlaylist*, const eString&, const eString&, eServiceReference &, bool );
int wasSleeping;
int playlistmode; // curlist is a list controlled by the user (not just a history).
int entered_playlistmode;
int flags;
int isVT;
int isEPG;
int showOSDOnEITUpdate;
int serviceFlags;
int isSeekable() const { return serviceFlags & eServiceHandler::flagIsSeekable; }
#ifndef DISABLE_LCD
eZapLCD lcdmain;
#endif
void eraseBackground(gPainter *, const eRect &where);
void setEIT(EIT *);
void handleNVODService(SDTEntry *sdtentry);
// actions
void showServiceSelector(int dir, eServiceReference root=eServiceReference(), eServiceReference path=eServiceReference(), int newmode=-1 );
void nextService(int add=0);
void prevService();
void playlistNextService();
void volumeUp();
void volumeDown();
void hideVolumeSlider();
void toggleMute();
void showMainMenu();
timeval standbyTime;
int standby_nomenu;
void delayedStandby();
void standbyPress(int nomenu);
void standbyRepeat();
void standbyRelease();
void showSubserviceMenu();
void showAudioMenu();
void runVTXT();
void runPluginExt();
void showEPGList(eServiceReferenceDVB ref);
void showEPG();
void showEPG_Streaminfo();
void showInfobar();
void hideInfobar();
void showHelp( ePtrList<eAction>*, int );
#ifndef DISABLE_FILE
void play();
void stop();
void pause();
void record();
enum { skipForward, skipReverse };
int skipcounter;
int skipping;
void startSkip(int dir);
void repeatSkip(int dir);
void stopSkip(int dir);
#endif
void showServiceMenu(eServiceSelector*);
void addService(const eServiceReference &service);
void doPlaylistAdd(const eServiceReference &service);
void addServiceToUserBouquet(eServiceReference *s, int dontask=0);
void addServiceToCurUserBouquet(const eServiceReference &ref);
void removeServiceFromUserBouquet( eServiceSelector *s );
enum { listAll, listSatellites, listProvider, listBouquets };
eServicePath getRoot(int list);
void showServiceInfobar(int show);
static eZapMain *instance;
eServicePath modeLast[modeEnd];
int mode, // current mode .. TV, Radio, File
state;
void onRotorStart( int newPos );
void onRotorStop();
void onRotorTimeout();
protected:
int eventHandler(const eWidgetEvent &event);
private:
void ShowTimeCorrectionWindow( tsref ref );
bool CheckService(const eServiceReference &ref );
void handleServiceEvent(const eServiceEvent &event);
void startService(const eServiceReference &, int);
void gotEIT();
void gotSDT();
void gotPMT();
void timeOut();
void leaveService();
void clockUpdate();
void updateVolume(int mute_state, int vol);
void prepareDVRHelp();
void prepareNonDVRHelp();
void set16_9Logo(int aspect);
void setSmartcardLogo(bool b);
void setAC3Logo(bool b);
void setVTButton(bool b);
void setEPGButton(bool b);
void updateProgress();
void updateServiceNum( const eServiceReference& );
void getPlaylistPosition();
void setPlaylistPosition();
bool handleState(int justask=0);
#ifndef DISABLE_FILE
void blinkRecord();
void toggleIndexmark();
void indexSeek(int dir);
eZapSeekIndices indices;
void redrawIndexmarks();
#endif // DISABLE_FILE
public:
void deleteService(eServiceSelector *);
void renameBouquet(eServiceSelector *);
void renameService(eServiceSelector *);
void createMarker(eServiceSelector *);
void createEmptyBouquet(int mode);
void copyProviderToBouquets(eServiceSelector *);
void toggleScart( int state );
void postMessage(const eZapMessage &message, int clear=0);
void gotMessage(const int &);
void startMessages();
void stopMessages();
void pauseMessages();
void nextMessage();
static eZapMain *getInstance() { return instance; }
enum {
psAdd=1, // just add, to not change current
psRemove=2, // remove before add
psActivate=4, // use existing entry if available
psDontAdd=8, // just play
psSeekPos=16, //
psSetMode=32
};
void playService(const eServiceReference &service, int flags);
void playlistPrevService();
#ifndef DISABLE_FILE
int recordDVR(int onoff, int user, const char* event_name=0 ); // starts recording
const eServiceReference& getRecordingsref() { return recordingsref; }
#endif
#ifndef DISABLE_NETWORK
void startNGrabRecord();
void stopNGrabRecord();
#endif
void setMode(int mode, int user=0); // user made change?
int getMode() { return mode; }
void toggleTimerMode();
int toggleEditMode(eServiceSelector *, int mode=-1);
void toggleMoveMode(eServiceSelector *);
void handleStandby(int i=0);
void setServiceSelectorPath(eServicePath path);
void getServiceSelectorPath(eServicePath &path);
void moveService(const eServiceReference &path, const eServiceReference &ref, const eServiceReference &after);
void loadPlaylist( bool create = false );
void savePlaylist( bool destory = false );
#ifndef DISABLE_FILE
void loadRecordings( bool create = false );
void saveRecordings( bool destory = false );
void clearRecordings();
#endif
void loadUserBouquets( bool destroy=true ); // this recreate always all user bouquets...
void destroyUserBouquets( bool save=false );
void saveUserBouquets(); // only save
void reloadPaths(int reset=0);
int doHideInfobar();
eZapMain();
~eZapMain();
};