DevGIS.h
gehe zur Dokumentation dieser Datei
00001 
00023 // #################################################################
00024 // Mutabor, GIS - devices
00025 // ##################################################################
00026 
00027 #ifndef DEVGIS_H
00028 #define DEVGIS_H
00029 
00030 //#include "Global.h"
00031 #include "Device.h"
00032 #include "GIS_Head.h"
00033 //#include "Interpre.h"
00034 
00035 extern mutString CurrentId;
00036 
00037 extern mutString CurrentSep;
00038 
00039 // OutGis -----------------------------------------------------------
00040 
00041 class OutGis : public OutDevice
00042 {
00043 
00044 protected:
00045         GisWriteHead *Head;
00046 public:
00047 
00048         OutGis(): OutDevice()
00049         {
00050                 Head = 0;
00051         }
00052 
00053         OutGis(mutString Id, int devId) : OutDevice(devId, Id)
00054         {
00055                 Head = new GisWriteHead(0, Id);
00056         }
00057 
00058         virtual ~OutGis()
00059         {
00060                 delete Head;
00061         }
00062         
00064 
00066         virtual void Save (tree_storage & config);
00067         
00069 
00074         virtual void Save (tree_storage & config, const Route * route);
00075         
00077 
00079         virtual void Load (tree_storage & config);
00080         
00082 
00087         virtual void Load (tree_storage & config, Route * route);
00088 
00089         
00090         virtual bool Open()
00091         {
00092                 return false;
00093         }
00094 
00095         virtual void Close()
00096         {
00097                 CloseAllSubs(Head);
00098         };
00099 
00100         virtual void NoteOn(int box, int taste, int velo,
00101                             Route *r, int channel, ChannelData *cd)
00102         {};
00103 
00104         virtual void NoteOff(int box, int taste,
00105                              int velo, Route *r, int channel)
00106         {};
00107 
00108         virtual void NotesCorrect(int box)
00109         {};
00110 
00111         virtual void Sustain(char on, int channel)
00112         {};
00113 
00114         virtual int  GetChannel(int taste)
00115         {
00116                 return -1;
00117         }
00118 
00119         virtual void Gis(GisToken *token, char turn);
00120         virtual void MidiOut(DWORD data, char n)
00121         {};
00122 
00123         virtual void MidiOut(BYTE *p, char n)
00124         {};
00125 
00126         virtual void AddTime(frac time)
00127         {
00128                 Head->AddTime(time);
00129         }
00130 
00131         virtual void Quite(Route *r)
00132         {};
00133 
00134         virtual DevType GetType() const
00135         {
00136                 return DTGis;
00137         }
00138 
00139         virtual mutString GetTypeName () const {
00140                 return _("GIS output file.");
00141         }
00142 
00143 #ifdef WX
00144         virtual wxString TowxString() const {
00145                 return OutDevice::TowxString() +
00146                 wxString::Format(_T("\n  Name = %s"),
00147                                  Name.c_str());
00148         }
00149 #endif
00150         
00151 };
00152 
00153 // InGis ------------------------------------------------------------
00154 
00155 class InGis : public InDevice
00156 {
00157 
00158 protected:
00159         wxString Id;
00160         GisToken *Data;
00161         GisReadArtHead *Head;
00162 
00163         class GisTimer : public wxTimer
00164         {
00165                 InGis * file;
00166                 
00167         public:
00168                 GisTimer(InGis * f) : wxTimer(),file(f)
00169                 {}
00170 
00171                 void Notify()
00172                 {
00173                         file->IncDelta();
00174                 }
00175         };
00176 
00177         GisTimer timer;
00178 
00179 public:
00180 
00181         InGis()
00182                 : InDevice(),Id(),timer(this)
00183         {
00184                 Head = 0;
00185                 Data = 0;
00186         }
00187 
00188         InGis(const wxString &name, const wxString &id)
00189                         : InDevice(-1,name),Id(id),timer(this)
00190         {
00191                 Head = 0;
00192                 Data = 0;
00193         }
00194         InGis(const mutString & name, int id):InDevice(id,name),Id(),timer(this)
00195         {
00196                 Head = 0;
00197                 Data = 0;
00198         }
00199         
00200         virtual ~InGis() {}
00201         
00203 
00205         virtual void Save (tree_storage & config);
00206         
00208 
00213         virtual void Save (tree_storage & config, const Route * route);
00214         
00215         
00217 
00219         virtual void Load (tree_storage & config);
00220         
00222 
00227         virtual void Load (tree_storage & config, Route * route);
00228 
00229         
00230         virtual bool Open();
00231 
00232         virtual void Close();
00233         virtual void Stop();
00234         virtual void Play();
00235         virtual void Pause();
00236         void Proceed(GisReadArtHead *h, char turn, Route *route);
00237         void ProceedRoute(GisReadArtHead *h, char turn);
00238         virtual long ReadOn(long delta);
00239         /*              {
00240         return GisReadArtHeadOn(&Head, time, Proceed);
00241         }*/
00242 
00243         virtual DevType GetType() const
00244         {
00245                 return DTGis;
00246         }
00247 
00248         void IncDelta();
00249 
00250         virtual mutString GetTypeName () const {
00251                 return _("GIS input file.");
00252         }
00253 
00254 #ifdef WX
00255         virtual wxString TowxString() const {
00256                 return InDevice::TowxString() +
00257                 wxString::Format(_T("\n  Id: %s\n  actDelta = %ld\n  minDelta = %ld\n  TimerId = %d\n  Busy = %d"),
00258                                  Id.c_str());
00259         }
00260 #endif
00261         
00262 
00263 private:
00264         long actDelta;  // in ticks
00265         long minDelta;  // in ticks
00266         UINT TimerId;
00267         BOOL Busy;
00268 //    long SpeedFactor;
00269 //    frac LastDelta;
00270 
00271 };
00272 
00273 #endif
00274 
00275 

Erzeugt am Sun Aug 21 2011 10:51:52 für Mutabor von doxygen 1.7.4