00001 #ifndef LIBVISUALPLUGIN_H 00002 #define LIBVISUALPLUGIN_H 00003 00004 #include "mainvisual.h" 00005 #include "config.h" 00006 00007 #if defined(SDL_SUPPORT) && defined(LIBVISUAL_SUPPORT) 00008 extern "C" 00009 { 00010 #include <libvisual/libvisual.h> 00011 #include <SDL.h> 00012 } 00013 00014 class LibVisualPlugin : public VisualBase 00015 { 00016 public: 00017 LibVisualPlugin(MainVisual *parent, long int winid, const QString &pluginName); 00018 virtual ~LibVisualPlugin(); 00019 00020 void resize(const QSize &size); 00021 bool process(VisualNode *node = 0); 00022 bool draw(QPainter *p, const QColor &back = Qt::black); 00023 void handleKeyPress(const QString &action); 00024 00025 static uint plugins(QStringList *list); 00026 00027 private: 00028 static int AudioCallback(VisInput *input, VisAudio *audio, void *priv); 00029 void switchToPlugin(const QString &pluginName); 00030 bool createScreen(int width, int height); 00031 00032 private: 00033 MainVisual *m_parent; 00034 QStringList m_pluginList; // list of available libvisual plugins 00035 uint m_currentPlugin; 00036 VisBin *m_pVisBin; // Pointer to LibVisualPlugin representation of an application 00037 VisVideo *m_pVisVideo; // Pointer to LibVisualPlugin representation of a screen surface 00038 00039 SDL_Surface *m_pSurface; // Pointer to SDL representation of rendering surface 00040 00041 int16_t m_Audio[2][512]; // PCM audio data transfer buffer 00042 bool m_paused; 00043 }; 00044 00045 00046 #endif // SDL_SUPPORT && LIBVISUAL_SUPPORT 00047 00048 #endif // LIBVISUALPLUGIN_H
1.5.5