/* * engine.h * * Copyright (C) 2007 Christophe Thommeret * * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA */ #ifndef ENGINE_H #define ENGINE_H #include #include "mrl.h" class Engine : public QObject { Q_OBJECT public: enum EngineState{ Unknown=0, Ready, Playing, Paused, Stopped, Error }; Engine( QWidget *parent ); virtual ~Engine(); virtual bool isPlaying() { return false; } virtual bool isPaused() { return false; } // Should look like "*.mp3 *.MP3 *.avi *.AVI", used as file filter for directory import virtual QString supportedExtensions() { return QString::null; } // Current volume. In percent. virtual uint volume() const { return 0; } // Current position. In percent. virtual uint position() const { return 0; } virtual bool hasChapters() { return false; } virtual void setDVDChapter(uint) {} virtual bool hasVideo() { return false; } virtual QWidget *videoWidget() { return NULL; } public slots: virtual void play( const MRL& ) {} virtual bool playNextChapter() { return false; } virtual bool playPreviousChapter() { return false; } virtual void togglePause() {} virtual void stop() {} // Sets Volume. In percent. virtual void setVolume(uint) {} virtual void mute() {} // Sets Position. In percent. virtual void setPosition(uint) {} virtual void seekRelative(int) {} virtual void setSubOffset(int) {} virtual void setSubtitle(int) {} virtual void setAudioChannel(int) {} signals: void stateChanged( int ); // Frame size of video changed void newFrameSize(const QSize& frame); // New meta information available void newMeta(const MRL &mrl); // Playback of current track finished void trackFinished(); // Playback failed void playbackFailed(); void newCutPoint( int, int ); void undoPoint( int ); }; #endif /* ENGINE_H */