qmplayer.h
来自「可以播放MP3,wma等文件格式的播放器」· C头文件 代码 · 共 168 行
H
168 行
/* ;-*-c++-*- * qmplayer.h * * $Id: qmplayer.h,v 1.16 2002/03/16 19:53:19 kyllingstad Exp $ * * Apollo sound player: http://www.apolloplayer.org * Copyright(C) 2000-2002 Apollo Team. See CREDITS file. * * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * The GNU General Public License is also available online at: * * http://www.gnu.org/copyleft/gpl.html */#ifndef QMPLAYER_H_INCLUDED#define QMPLAYER_H_INCLUDED#include <qobject.h>class QString;/*! \file qmplayer.h Definition of QmPlayer class which provides the interface for all players.*//*! \class QmPlayer qmplayer.h \brief The player interface. This class is the base class of all players. It provides functionality to control the playing of a song. Note that it does not control traversing songs, as that is left to the QmPlayList. The QmMainWindow controls the player through the interface provided by this class. \todo Implement a QmPlayerFactory to create various player instances depending on the song format. \todo Implement a QmSongInfo abstract class. Derive from it according to the format of the song. Information will be extracted from the QmSongInfo class to be used in QmMainWindow.*/class QmPlayer : public QObject{ Q_OBJECTpublic: /*! Standard QObject initialization. */ QmPlayer(QObject *parent = 0, const char *name = 0) : QObject(parent, name) {}; virtual ~QmPlayer() {}; /*! \return True if playing, false otherwise. */ virtual bool isPlaying() const = 0; /*! \return True if paused, false otherwise. */ virtual bool isPaused() const = 0; signals: /*! Emitted when the song has stopped. */ void playingStopped(); /*! Emitted whenever the second counter changes, this can be used to update a graphical display with the current play time. \sa secondsLeft(), secondsCount() */ void secondsPlaying(int s); /*! Emitted whenever the second counter changes, this can be used to update a graphical display with the current play time remaining. \sa secondsPlaying(), secondsCount() */ void secondsLeft(int s); /*! Emitted when the total time of the song has been calculated. \sa secondsPlaying(), secondsLeft() */ void secondsCount(int s); /*! Emitted when the total frame count of the song has been calculated. \sa framesLeft() */ void frameCount(int f); /*! Emitted whenever the frame counter changes, this can be used to update a graphical display with the current position in the song. \sa frameCount() */ void framesLeft(int f); /*! Emitted when the song title has been calculated for the current song. */ void songTitle( const QString &title ); /*! Emitted when song is loaded. */ void bitrate( int b ); /*! Emitted when the player produced output that was not parsed, e.g. error messages. */ void playerMessage( const QString &info );public slots: /*! Plays the song \a Filename. */ virtual void play(const QString &Filename) = 0; /*! Plays the current song from the beginning. */ virtual void play() = 0; /*! Stops the player. */ virtual void stop() = 0; /*! Toggles pause / play */ virtual void pause() = 0; /*! Restarts the song. */ virtual void restart() = 0; /*! Jumps to pos seconds into the song. */ virtual void jump( int pos ) = 0;};#endif // QMPLAYER_H_INCLUDED
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?