嵌入式音乐相册

1.操作环境
Ubuntu 18.04
WMware
嵌入式开发板

2.功能描述:
1)相册:点击”相册“按钮,循环展示相册里的图片,每个图片之间间隔5s,播放图片的过程中伴随着音乐的播放,图片展示完毕自动返回主菜单;
2)音乐:点击”音乐“按钮,展示分菜单,上面有”从头播放“、”结束播放“、”暂停“、”播放“、”上一首“、”下一首“,”返回上一级菜单“几个按钮,按下的对应按钮做出相关反应。

3.实物展示
在这里插入图片描述
在这里插入图片描述

4.代码
head.h

#ifndef _HEAD_H_  
#define _HEAD_H_  

//头文件

#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <linux/input.h>
#include <strings.h>
#include <sys/mman.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <linux/fb.h>
#include <stdbool.h>
#include <stdio.h>
//全局变量
#define BMP_SIZE 800*480*3 //图片像素大小
#define LCD_SIZE 800*480*4 //LCD像素大小

#define TS_PATH   "/dev/input/event0"
#define LCD_WIDTH  			800
#define LCD_HEIGHT 			480
#define FB_SIZE				(LCD_WIDTH * LCD_HEIGHT * 4)
#define Music_count      	sizeof(musics)/sizeof(musics[0])


int x;
int y;
int wy;

static int Cur_Idx=0;
static int bIsPlaying=0;

//结构体
enum
{
   
   ACTION_START,
   ACTION_STOP,
   ACTION_PAUSE,
   ACTION_PLAY,
   ACTION_NEXT,
   ACTION_PREV,
   ACTION_EXIT,
};


//函数声明 
int Get_Action();
void Music_Start(const char* Music);
void Music_Pause();
void Music_Play();
void Music_Stop();
void Action_handler();
int show_bmp();
int touch();
int color();
void Music_criclePlay();


#endif   

main.c

#include "head.h"

int main(){
   
   //color();
	while(1){
   
		wy=1;
		show_bmp("./menu0.bmp");
		touch();
		if(x>89 &&x<373  &&y>31  &&y<205){
   //相册
			Music_criclePlay();
			show_bmp("./1.bmp");
			sleep(5);
			show_bmp("./2.bmp");
			sleep(5);
			show_bmp("./3.bmp"
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值