1.基于linux的音乐播放器的简单快进,后退,暂停播放歌曲实现学习;
实验环境:基于ubutu系统的开发;系统环境已经配置好了;
#include <gtk/gtk.h>
#include <string.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include "./sungtk_interface/sungtk_interface.h"
#define LOGIN_W 800
#define LOGIN_H 480
/*************************************************
函数功能:快退
函数参数:widget:控件,data:传过来的结构体变量地址
函数返回值:无
**************************************************/
void deal_backward(GtkWidget *widget,gpointer data)
{
int fd = open("./fifo_cmd",O_RDWR);
write(fd,"seek -5\n",strlen("seek -5\n"));
printf("cmd is seek -5\n");
close(fd);
}
/*************************************************
函数功能:暂停
函数参数:widget:控件,data:传过来的结构体变量地址
函数返回值:无
**************************************************/
void deal_pause(GtkWidget *widget,gpointer data)
{
int fd = open("./fifo_cmd",

本文记录了在Ubuntu系统中使用GTK+库开发一个简单音乐播放器的过程,包括如何实现快进、后退和暂停播放功能。通过调用mplayer命令行工具,结合GTK+的按钮事件处理,实现了基本的音乐控制操作。
最低0.47元/天 解锁文章
1492

被折叠的 条评论
为什么被折叠?



