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