Visualizzazione dei risultati da 1 a 7 su 7

Discussione: [C++] Codice Enigma

  1. #1
    Utente di HTML.it
    Registrato dal
    Nov 2002
    Messaggi
    249

    [C++] Codice Enigma

    Ciao a tutti, mi sto avvicinando alla programmazione in c++ e sto tentando di modificare i sorgenti di enigma, un'applicazione linux per il ricevitore satellitare dreambox.
    Volevo chiedere se qualc'un gentilmente mi spiega la funzionalita di questo blocco di codice:

    void eZapMain::runPluginExt()
    {
    hide();
    eZapPlugins plugins(2);
    plugins.exec();
    if (!doHideInfobar())
    showInfobar();
    }

    Il mio dubbio è nato dal fatto che mi aspettavo da qualche parte una funzione exec, solo che non l'ho trovata
    Grazie!!

  2. #2
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,465
    exec e' un metodo dell'oggetto plugins di classe eZapPlugins ...

    E' nella definizione di quella classe che devi controllare ...

  3. #3
    Utente di HTML.it
    Registrato dal
    Nov 2002
    Messaggi
    249
    be mi conforta il fatto che almeno avevo pensato una cosa corretta!! purtroppo non sono riuscito a trovarlo...se me lo permettete posso postare l'intera classe altrimenti se possibile te la posso inviare in pm?

    Che funzione ha l'istruzione

    eZapPlugins plugins(2);

    Grazie

  4. #4
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,465
    Tra i primi argomenti di C++ avrai imparato come si istanzia un oggetto di una determinata classe e cosa e' un costruttore.

    Quella riga serve ad istanziare un oggetto (chiamato plugins) e chiama (un) costruttore passando il valore 2 come parametro (che non ho la minima idea di cosa indichi).

    Posta la classe ... ma non ho capito cosa vuoi che veda ...

  5. #5
    Utente di HTML.it
    Registrato dal
    Nov 2002
    Messaggi
    249
    Ecco qui la classe, vorrei che mi spiegassi dove dovrebbere essere la funzione exec() e se si capisce a cosa puo riferirsi il due passato come parametro dal costruttore.
    Grazie

    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();
    };

  6. #6
    Utente di HTML.it L'avatar di oregon
    Registrato dal
    Jul 2005
    residenza
    Roma
    Messaggi
    36,465
    Veramente questa e' la classe class eZapMain, come mostra la linea

    class eZapMain: public eWidget

    mentre quello di cui parlavamo era la classe eZapPlugins ...

  7. #7
    Utente di HTML.it
    Registrato dal
    Nov 2002
    Messaggi
    249
    scusami...mi sono confuso!!
    ecco qua

    class eZapPlugins: public eListBoxWindow<ePlugin>
    {
    private:
    eString PluginPath[3];
    void selected(ePlugin *);
    int type;
    public:
    eZapPlugins(int type, eWidget* lcdTitle=0, eWidget* lcdElement=0);
    eString execPluginByName(const char* name, bool onlySearch=false);
    void execPlugin(ePlugin* plugin);
    int exec();
    int find(bool ignore_requires=false);
    };

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved.