00001 /* 00002 * Copyright (C) 2009, Edmundo Albuquerque de Souza e Silva. 00003 * 00004 * This file may be distributed under the terms of the Q Public License 00005 * as defined by Trolltech AS of Norway and appearing in the file 00006 * LICENSE.QPL included in the packaging of this file. 00007 * 00008 * THIS FILE IS PROVIDED AS IS WITH NO WARRANTY OF ANY KIND, INCLUDING 00009 * THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00010 * PURPOSE. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, 00011 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING 00012 * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, 00013 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 00014 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 00015 * 00016 */ 00017 00018 #ifndef __RIOMMSLIDESHOW_H__ 00019 #define __RIOMMSLIDESHOW_H__ 00020 00021 #include "RioInterfaceTypes.h" 00022 #include "RioInterface.h" 00023 #include "RioMMObject.h" 00024 #include "RioFile.h" 00025 #include "RioMMIndex.h" 00026 #include "RioMMIndexParser.h" 00027 00028 #include "tstring.h" 00029 00030 class CRioMMSlideShow : public CRioMMObject 00031 { 00032 private: 00033 FILE * LocalCommandFile; /* Handle to the local command file name */ 00034 RioFile * CommandFile; /* class that will download the comand file */ 00035 00036 protected: 00037 TString Command; /* The next command to be executed */ 00038 TString TempDirectory; /* The temporary storage for slides */ 00039 TString TempFileName; /* The temporary downloaded file containing slides */ 00040 00041 /* Current context information */ 00042 CRioMMIndex * Index; 00043 TString CurrentFileName; 00044 int CurrentSlideNumber; 00045 00046 RioBlock LastIndex; 00047 RioBlock NextIndex; 00048 int NextCommandOffset; 00049 00050 /* Commands information */ 00051 RioMMCommand * CommandsList; 00052 int NumberOfCommands; 00053 00054 /* Version control */ 00055 int Major; 00056 int Minor; 00057 00058 bool InterpretNextCommand( void ); 00059 00060 virtual void SyncSpecific( void ) = 0; 00061 public: 00062 CRioMMSlideShow( char *, unsigned int, RioBlock , struct timeval RTT_average ); 00063 virtual ~CRioMMSlideShow( void ); 00064 00065 /* This routine should initialize things for the slide show */ 00066 virtual int init( void ); 00067 00068 /* This routine should cleanup things after the slide show */ 00069 virtual int Cleanup( void ) = 0; 00070 00071 /* This routine should set the current file and slide and return status */ 00072 virtual bool ChangeContext( const char *, int ); 00073 00074 int GetCommands ( RioAccess, CRioStream * ); 00075 int GetSlides ( RioAccess, CRioStream * ); 00076 void RemoveSlides( void ); 00077 void CreateFakeSlide( void ); 00078 00079 RioBlock GetCurrentPosition( void ){ return 1; } 00080 RioBlock GetTotalPositions( void ) { return 1; } 00081 00082 void Play ( void ); 00083 void Pause ( void ); 00084 void Stop ( void ); 00085 void FastForward( void ); 00086 void FastRewind ( void ); 00087 void GoTo ( RioBlock ); 00088 void SyncMedia ( void * ); 00089 }; 00090 00091 #endif