diff --git a/mauplay/CMakeLists.txt b/mauplay/CMakeLists.txt index 23f362b..819fa47 100644 --- a/mauplay/CMakeLists.txt +++ b/mauplay/CMakeLists.txt @@ -3,11 +3,10 @@ include(MDEPkgConfig) setup_project(mauplay ${CMAKE_INSTALL_BINDIR}) pkg_config_add(mauplay sqlite3) +pkg_config_add(mauplay sndfile) target_link_libraries( mauplay PRIVATE MDEAudio ) - -find_package(PkgConfig) diff --git a/mauplay/main.c b/mauplay/main.c index 19482f0..164997c 100644 --- a/mauplay/main.c +++ b/mauplay/main.c @@ -1,3 +1,177 @@ #include "mauplay.h" -int main() {} +#include "skipback.xpm" +#include "play.xpm" +#include "pause.xpm" +#include "stop.xpm" +#include "skipfwd.xpm" + +#include "repeat.xpm" +#include "shuffle.xpm" + +MwWidget window; +MwWidget menu, album, infoframe, infosep, bskipback, bplay, bpause, bstop, bskipfwd, modesep, brepeat, bshuffle, mainsep; +MwLLPixmap pxalbum, pxskipback, pxplay, pxpause, pxstop, pxskipfwd, pxrepeat, pxshuffle; + +static void resize(MwWidget handle, void* user, void* client){ + int ww = MwGetInteger(window, MwNwidth); + int wh = MwGetInteger(window, MwNheight) - MwGetInteger(menu, MwNheight); + int y = MwGetInteger(menu, MwNheight); + + MwVaApply(album, + MwNx, 5, + MwNy, y + 5, + MwNwidth, 32, + MwNheight, 32, + NULL); + + MwVaApply(infoframe, + MwNx, 5 + 32 + 5, + MwNy, y + 5, + MwNwidth, ww - 5 - 32 - 5 - 5 - 10 - 10 - 32 * 7, + MwNheight, 32, + NULL); + + MwVaApply(infosep, + MwNx, 5 + 32 + 5 + MwGetInteger(infoframe, MwNwidth), + MwNy, y + 5, + MwNwidth, 10, + MwNheight, 32, + NULL); + + MwVaApply(bskipback, + MwNx, 5 + 32 + 5 + MwGetInteger(infoframe, MwNwidth) + 10, + MwNy, y + 5, + MwNwidth, 32, + MwNheight, 32, + NULL); + + MwVaApply(bplay, + MwNx, 5 + 32 + 5 + MwGetInteger(infoframe, MwNwidth) + 10 + 32, + MwNy, y + 5, + MwNwidth, 32, + MwNheight, 32, + NULL); + + MwVaApply(bpause, + MwNx, 5 + 32 + 5 + MwGetInteger(infoframe, MwNwidth) + 10 + 32 + 32, + MwNy, y + 5, + MwNwidth, 32, + MwNheight, 32, + NULL); + + MwVaApply(bstop, + MwNx, 5 + 32 + 5 + MwGetInteger(infoframe, MwNwidth) + 10 + 32 + 32 + 32, + MwNy, y + 5, + MwNwidth, 32, + MwNheight, 32, + NULL); + + MwVaApply(bskipfwd, + MwNx, 5 + 32 + 5 + MwGetInteger(infoframe, MwNwidth) + 10 + 32 + 32 + 32 + 32, + MwNy, y + 5, + MwNwidth, 32, + MwNheight, 32, + NULL); + + MwVaApply(modesep, + MwNx, 5 + 32 + 5 + MwGetInteger(infoframe, MwNwidth) + 10 + 32 * 5, + MwNy, y + 5, + MwNwidth, 10, + MwNheight, 32, + NULL); + + MwVaApply(brepeat, + MwNx, 5 + 32 + 5 + MwGetInteger(infoframe, MwNwidth) + 10 + 32 * 5 + 10, + MwNy, y + 5, + MwNwidth, 32, + MwNheight, 32, + NULL); + + MwVaApply(bshuffle, + MwNx, 5 + 32 + 5 + MwGetInteger(infoframe, MwNwidth) + 10 + 32 * 5 + 10 + 32, + MwNy, y + 5, + MwNwidth, 32, + MwNheight, 32, + NULL); + + MwVaApply(mainsep, + MwNx, 5, + MwNy, y + 5 + 32, + MwNwidth, ww - 5 - 5, + MwNheight, 10, + NULL); +} + +int main() { + MwLibraryInit(); + + window = MwVaCreateWidget(MwWindowClass, "main", NULL, MwDEFAULT, MwDEFAULT, 640, 400, + MwNtitle, "mauplay", + NULL); + menu = MwCreateWidget(MwMenuClass, "menu", window, 0, 0, 0, 0); + album = MwCreateWidget(MwImageClass, "album", window, 0, 0, 0, 0); + infoframe = MwVaCreateWidget(MwFrameClass, "info", window, 0, 0, 0, 0, + MwNbackground, "#000", + MwNforeground, "#0f0", + MwNhasBorder, 1, + MwNinverted, 1, + NULL); + infosep = MwVaCreateWidget(MwSeparatorClass, "infosep", window, 0, 0, 0, 0, + MwNorientation, MwVERTICAL, + NULL); + bskipback = MwVaCreateWidget(MwButtonClass, "skipback", window, 0, 0, 0, 0, + MwNflat, 1, + NULL); + bplay = MwVaCreateWidget(MwButtonClass, "play", window, 0, 0, 0, 0, + MwNflat, 1, + NULL); + bpause = MwVaCreateWidget(MwButtonClass, "pause", window, 0, 0, 0, 0, + MwNflat, 1, + NULL); + bstop = MwVaCreateWidget(MwButtonClass, "stop", window, 0, 0, 0, 0, + MwNflat, 1, + NULL); + bskipfwd = MwVaCreateWidget(MwButtonClass, "skipfwd", window, 0, 0, 0, 0, + MwNflat, 1, + NULL); + modesep = MwVaCreateWidget(MwSeparatorClass, "modesep", window, 0, 0, 0, 0, + MwNorientation, MwVERTICAL, + NULL); + brepeat = MwVaCreateWidget(MwButtonClass, "repeat", window, 0, 0, 0, 0, + MwNflat, 1, + NULL); + bshuffle = MwVaCreateWidget(MwButtonClass, "shuffle", window, 0, 0, 0, 0, + MwNflat, 1, + NULL); + mainsep = MwVaCreateWidget(MwSeparatorClass, "mainsep", window, 0, 0, 0, 0, + MwNorientation, MwHORIZONTAL, + NULL); + + pxalbum = MwLoadIcon(window, MwIconError); + pxskipback = MwLoadXPM(window, skipback_xpm); + pxplay = MwLoadXPM(window, play_xpm); + pxpause = MwLoadXPM(window, pause_xpm); + pxstop = MwLoadXPM(window, stop_xpm); + pxskipfwd = MwLoadXPM(window, skipfwd_xpm); + + pxrepeat = MwLoadXPM(window, repeat_xpm); + pxshuffle = MwLoadXPM(window, shuffle_xpm); + + MwSetVoid(album, MwNpixmap, pxalbum); + + MwSetVoid(bskipback, MwNpixmap, pxskipback); + MwSetVoid(bplay, MwNpixmap, pxplay); + MwSetVoid(bpause, MwNpixmap, pxpause); + MwSetVoid(bstop, MwNpixmap, pxstop); + MwSetVoid(bskipfwd, MwNpixmap, pxskipfwd); + + MwSetVoid(brepeat, MwNpixmap, pxrepeat); + MwSetVoid(bshuffle, MwNpixmap, pxshuffle); + + MwAddUserHandler(window, MwNresizeHandler, resize, NULL); + + resize(window, NULL, NULL); + + MwLoop(window); +} diff --git a/mauplay/mauplay.h b/mauplay/mauplay.h index 2ddff7b..62fc327 100644 --- a/mauplay/mauplay.h +++ b/mauplay/mauplay.h @@ -15,4 +15,7 @@ #include #include +/* main.c */ +extern MwWidget window; + #endif diff --git a/mauplay/pause.xpm b/mauplay/pause.xpm new file mode 100644 index 0000000..27a3213 --- /dev/null +++ b/mauplay/pause.xpm @@ -0,0 +1,36 @@ +/* XPM */ +static char *pause_xpm[] = { +/* columns rows colors chars-per-pixel */ +"28 28 2 1 ", +" c None", +". c black", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" .... .... ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" " +}; diff --git a/mauplay/play.xpm b/mauplay/play.xpm new file mode 100644 index 0000000..002c152 --- /dev/null +++ b/mauplay/play.xpm @@ -0,0 +1,36 @@ +/* XPM */ +static char *play_xpm[] = { +/* columns rows colors chars-per-pixel */ +"28 28 2 1 ", +" c None", +". c black", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" .. ", +" .... ", +" ...... ", +" ........ ", +" .......... ", +" ............ ", +" ............ ", +" .......... ", +" ........ ", +" ...... ", +" .... ", +" .. ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" " +}; diff --git a/mauplay/repeat.xpm b/mauplay/repeat.xpm new file mode 100644 index 0000000..21b62c1 --- /dev/null +++ b/mauplay/repeat.xpm @@ -0,0 +1,36 @@ +/* XPM */ +static char *repeat_xpm[] = { +/* columns rows colors chars-per-pixel */ +"28 28 2 1 ", +" c None", +". c black", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" .......... ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . ", +" . . . ", +" . .. . ", +" .. ....... ", +" .. ", +" . ", +" ", +" ", +" ", +" ", +" ", +" ", +" " +}; diff --git a/mauplay/shuffle.xpm b/mauplay/shuffle.xpm new file mode 100644 index 0000000..5388805 --- /dev/null +++ b/mauplay/shuffle.xpm @@ -0,0 +1,36 @@ +/* XPM */ +static char *shuffle_xpm[] = { +/* columns rows colors chars-per-pixel */ +"28 28 2 1 ", +" c None", +". c black", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ... . ", +" . .. ", +" . .... ", +" . . .. ", +" . . . ", +" . ", +" . ", +" . . . ", +" . . .. ", +" . .... ", +" . .. ", +" ... . ", +" ", +" ", +" ", +" ", +" ", +" ", +" " +}; diff --git a/mauplay/skipback.xpm b/mauplay/skipback.xpm new file mode 100644 index 0000000..633fe11 --- /dev/null +++ b/mauplay/skipback.xpm @@ -0,0 +1,36 @@ +/* XPM */ +static char *skipback_xpm[] = { +/* columns rows colors chars-per-pixel */ +"28 28 2 1 ", +" c None", +". c black", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" .. .. ", +" .. .... ", +" .. ...... ", +" .. ........ ", +" .. .......... ", +" .............. ", +" .............. ", +" .. .......... ", +" .. ........ ", +" .. ...... ", +" .. .... ", +" .. .. ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" " +}; diff --git a/mauplay/skipfwd.xpm b/mauplay/skipfwd.xpm new file mode 100644 index 0000000..e2f25f5 --- /dev/null +++ b/mauplay/skipfwd.xpm @@ -0,0 +1,36 @@ +/* XPM */ +static char *skipfwd_xpm[] = { +/* columns rows colors chars-per-pixel */ +"28 28 2 1 ", +" c None", +". c black", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" .. .. ", +" .... .. ", +" ...... .. ", +" ........ .. ", +" .......... .. ", +" .............. ", +" .............. ", +" .......... .. ", +" ........ .. ", +" ...... .. ", +" .... .. ", +" .. .. ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" " +}; diff --git a/mauplay/stop.xpm b/mauplay/stop.xpm new file mode 100644 index 0000000..88c3e8f --- /dev/null +++ b/mauplay/stop.xpm @@ -0,0 +1,36 @@ +/* XPM */ +static char *stop_xpm[] = { +/* columns rows colors chars-per-pixel */ +"28 28 2 1 ", +" c None", +". c black", +/* pixels */ +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" ............ ", +" ............ ", +" ............ ", +" ............ ", +" ............ ", +" ............ ", +" ............ ", +" ............ ", +" ............ ", +" ............ ", +" ............ ", +" ............ ", +" ", +" ", +" ", +" ", +" ", +" ", +" ", +" " +}; diff --git a/mbiff/main.c b/mbiff/main.c index 2dbb656..eb6241d 100644 --- a/mbiff/main.c +++ b/mbiff/main.c @@ -55,9 +55,9 @@ int main() { MwNtitle, "mbiff", NULL); - empty = MwLoadImage(window, DATADIR "/mde/icons/128x128/mailempty.png"); - full = MwLoadImage(window, DATADIR "/mde/icons/128x128/mailfull.png"); - mail = MwLoadImage(window, DATADIR "/mde/icons/128x128/mail.png"); + empty = MwLoadImage(window, ICON128DIR "/mailempty.png"); + full = MwLoadImage(window, ICON128DIR "/mailfull.png"); + mail = MwLoadImage(window, ICON128DIR "/mail.png"); if(empty == NULL) empty = MwLoadXPM(window, mailempty); if(full == NULL) full = MwLoadXPM(window, mailfull); if(mail == NULL) mail = MwLoadXPM(window, mailempty);