• 周三. 4 月 22nd, 2026

物嫩软件资讯网

软件资讯来物嫩

基于mplayer的简易影音播放器

admin@wunen

4 月 30, 2025

快进/快退/暂停/退出/播放/播放上一个/播放下一个/音量变大/音量变小/静音….

mplayer开源的多媒体播放器。

mplayer另外的一种工作模式:从(slave)模式

在slave模式下,mplayer为后台运行其它程序,不再截获键盘事件,mplayer

会从标准输入读取一个换行符分隔开的命令。

mplayer所支持的命令可以通过:

mplayer -input cmdlist

a.头文件部分

#ifndef __HEAD_H__
#define __HEAD_H__


#include <sys/stat.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <sys/shm.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <fcntl.h>
#include <dirent.h>
#include <semaphore.h>

#endif
#include "head.h"

//Mplayer_Exitw为1表示退出当前歌曲的播放,为0表示不退出
int Mplayer_Exit = 0;

//如果为1表示自动模式,为0表示手动模式
int sta = 0;

//Quit为1表示退出整个进程,为0表示不退出
int Quit = 0;

//MP4的保存路径
#define MP4_PATH "/mnt/hgfs/code"

//有名管道的路径
#define FIFONAME "/home/china/test.fifo"

//文件的类型
typedef enum File_Type
{
	FILE_MP3,FILE_MP4,FILE_C,FILE_H,FILE_CPP,FILE_BMP,FILE_JPG,UNKOWN_TYPE = 1000
}FILE_TYPE;

//文件名最大的长度
#define MAX_LEN  256

typede

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注