aa
This commit is contained in:
parent
8706626129
commit
d8cec5cc3d
3 changed files with 18 additions and 18 deletions
|
|
@ -1,9 +1,9 @@
|
|||
#include "mauplay.h"
|
||||
|
||||
unsigned char* id3_findimage(const char* path, size_t* size) {
|
||||
size_t fsz;
|
||||
size_t fsz;
|
||||
unsigned char* buffer = MDEID3GetTag(path, "APIC", &fsz);
|
||||
unsigned char* d = NULL;
|
||||
unsigned char* d = NULL;
|
||||
int i;
|
||||
if(buffer == NULL) return NULL;
|
||||
for(i = 1; i < fsz; i++) {
|
||||
|
|
|
|||
|
|
@ -37,13 +37,13 @@ typedef struct queue {
|
|||
} queue_t;
|
||||
|
||||
/* main.c */
|
||||
extern MwWidget window;
|
||||
extern MwWidget album, info;
|
||||
extern MwWidget bskipback, bplay, bpause, bstop, bskipfwd, brepeat, bshuffle;
|
||||
extern MwWidget eltime, seekbar, rmtime;
|
||||
extern MwWidget tree, list;
|
||||
extern MwWidget window;
|
||||
extern MwWidget album, info;
|
||||
extern MwWidget bskipback, bplay, bpause, bstop, bskipfwd, brepeat, bshuffle;
|
||||
extern MwWidget eltime, seekbar, rmtime;
|
||||
extern MwWidget tree, list;
|
||||
extern unsigned char* pxalbumdata;
|
||||
extern MwLLPixmap pxalbum;
|
||||
extern MwLLPixmap pxalbum;
|
||||
|
||||
/* db.c */
|
||||
extern numkv_t* db_musics;
|
||||
|
|
|
|||
20
mauplay/ui.c
20
mauplay/ui.c
|
|
@ -203,21 +203,21 @@ int queue_last = -1;
|
|||
static void window_tick(MwWidget handle, void* user, void* client) {
|
||||
pthread_mutex_lock(&audio_mutex);
|
||||
if(queue_last != queue_seek && queue_seek != -1) {
|
||||
int ind;
|
||||
char* buf;
|
||||
size_t sz;
|
||||
int ind;
|
||||
char* buf;
|
||||
size_t sz;
|
||||
unsigned char* img;
|
||||
|
||||
img = id3_findimage(queue[queue_seek].path, &sz);
|
||||
if(img != NULL){
|
||||
int iw, ih, ic;
|
||||
if(img != NULL) {
|
||||
int iw, ih, ic;
|
||||
unsigned char* data = stbi_load_from_memory(img, sz, &iw, &ih, &ic, 4);
|
||||
if(data != NULL){
|
||||
if(data != NULL) {
|
||||
int y, x;
|
||||
for(y = 0; y < ALBUMWIDTH; y++){
|
||||
for(x = 0; x < ALBUMWIDTH; x++){
|
||||
int ix = x * iw / ALBUMWIDTH;
|
||||
int iy = y * ih / ALBUMWIDTH;
|
||||
for(y = 0; y < ALBUMWIDTH; y++) {
|
||||
for(x = 0; x < ALBUMWIDTH; x++) {
|
||||
int ix = x * iw / ALBUMWIDTH;
|
||||
int iy = y * ih / ALBUMWIDTH;
|
||||
unsigned char* ipx = &data[(iy * iw + ix) * 4];
|
||||
unsigned char* opx = &((MwLLCommonPixmap)pxalbum)->raw[(y * ALBUMWIDTH + x) * 4];
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue