⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qmmpg123player.h

📁 可以播放MP3,wma等文件格式的播放器
💻 H
字号:
/* ;-*-c++-*- * qmmpg123player.h * * $Id: qmmpg123player.h,v 1.31 2002/03/30 11:49:06 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 QMMPG123PLAYER_H_INCLUDED#define QMMPG123PLAYER_H_INCLUDED#include "qmplayer.h"#include <sys/types.h>/*! \file qmmpg123player.h  Definition of QmMpg123Player class which provides functionality for communicating with mpg123.*/class QSocketNotifier;class QTimer;class QmMpg123Player : public QmPlayer{	Q_OBJECTpublic:    QmMpg123Player();    virtual ~QmMpg123Player();    int				init();	bool			isPlaying() const;	bool			isPaused() const;	static void		setFailFlag(bool b);	public slots:    virtual void 	play(const QString &filename);    virtual void 	play();    virtual void 	stop();    virtual void 	pause();	virtual void	restart();    virtual void	jump( int pos );private slots:	void			dataReceived();    void			releaseTimingInformation();	private:    void 			parseCodes( char *read_buffer );	void 			parseFrameInfo( char *read_buffer );	void 			parseInformation( char *read_buffer );	void 			parseStatus( char *read_buffer );	void 			parsePlayStatus( char *read_buffer );	void 			parseError( char *read_buffer );    QString 		resolveTags();	bool 			sendCommand( char *write_buffer );    void 			startTimer();	void 			terminate();	static void		childHandler(int sig);	static void		failHandler(int sig);	    int fd_send[2];    int fd_recv[2];    /*!      READ_BUF_SIZE is the size of the read buffer used for communicating with mpg123.      WRITE_BUF_SIZE is the size of the write buffer used for communicating with mpg123.    */#ifdef _WS_WIN_	#define READ_BUF_SIZE 1024	#define WRITE_BUF_SIZE 1024#else	static const int READ_BUF_SIZE = 1024;	static const int WRITE_BUF_SIZE = 1024;#endif		char m_ReadBuffer[READ_BUF_SIZE+1];	char m_WriteBuffer[WRITE_BUF_SIZE];	QSocketNotifier *m_pReadNotifier;    QTimer          *m_pTimer;    QString m_ID3Format;    QString m_Filename;    QString m_FilePath;    QString m_FileExtension;    QString m_Artist;    QString m_Album;    QString m_Title;    QString m_Year;    QString m_Comment;    QString m_Genre;	QString m_Message;//  	int m_OldTime;	bool 		m_Playing;	bool 		m_Paused;    bool 		m_NewSong;    bool 		m_GotNewSong;    int         m_BufferLeftovers;	int 		m_SendFd;  		// send commands to mpg123	int 		m_RecvFd;	int			m_PlayerPid;    int         m_BufferPid;	static bool	s_OurTermSignal;	static bool s_FailFlag;    int 		m_FrameCount;    int         m_TotalFrames;    int 		m_Seconds;    int         m_TotalSeconds;	fd_set 		mpg123_fdset;	bool        m_NeedNewline;};#endif // QMMPG123PLAYER_H_INCLUDED

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -