//////////////////////////////////////////////////////////////////////// // This file is part of the mp3car-0.1.1 package // Linux LCD-client for the mp3 server box // http://www.igalaxie.com/ltt/mp3 //////////////////////////////////////////////////////////////////////// // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published // by the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. // See the GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// // File: appbase.h ////////////////////////////////////////////////////////////////////////// // Description: Basic application object ////////////////////////////////////////////////////////////////////////// // History: created 05.01.2000 ////////////////////////////////////////////////////////////////////////// // Copyright: 2000 Sebastian Poetschke ////////////////////////////////////////////////////////////////////////// #ifndef APPBASE_H_INCLUDED #define APPBASE_H_INCLUDED #include #include #include class ADisplay; class AControl; class mysqlClient; class mp3sbClient; class appWin; class appBase { public: appBase(ADisplay *, AControl *, mysqlClient *, mp3sbClient *); ~appBase(); void Execute( void ); // Execution loop. mysqlClient * GetDB( void ); // Retrieve db pointer. mp3sbClient * GetSB( void ); // Retrieve sb pointer. ADisplay * GetDisplay( void ); // Retrieve display driver. bool Initialize(void); // Initialise object. bool CreateApp(unsigned int AppID); // Creates new application. bool CreateApp(unsigned int AppID, char * Data); bool SpoolMessage(unsigned int msg ); // Inserts a new message // into application message queue. protected: unsigned int GetMessage( void ); // Retrieve msg from queue. void ScheduleStatus( void ); // Schedule starting of status app. protected: mysqlClient *pDB; // Pointer to database object. mp3sbClient *pSB; // Pointer to server box object. ADisplay *pDisplay; // Display driver. AControl *pControl; // Control unit driver. vector AppStack; // Application stack. vector MessageQueue; // Message queue. pthread_mutex_t m_pThreadMutex; // Controlling thread access. time_t m_tControlMsg; // Time of last received control message. }; #endif