From 6a07e9416478e0039f42b651035ab84cc1a70936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Fri, 1 Aug 2014 23:18:08 +0200 Subject: [PATCH] mpd: update patch - fix dependencies issue due to copying incorrect win32 stuff - fix warnings --- .../mpd/patches/mpd-0.18.12_git.patchset | 242 ++++++++++-------- 1 file changed, 134 insertions(+), 108 deletions(-) diff --git a/media-sound/mpd/patches/mpd-0.18.12_git.patchset b/media-sound/mpd/patches/mpd-0.18.12_git.patchset index 518221c73..f0f312b3b 100644 --- a/media-sound/mpd/patches/mpd-0.18.12_git.patchset +++ b/media-sound/mpd/patches/mpd-0.18.12_git.patchset @@ -1,7 +1,7 @@ -From ca3ef35c9a07ad4774f31f28ba9ea9fc6b246bbc Mon Sep 17 00:00:00 2001 +From ef779aef81d2463f7ace973849b7308b51397b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 13 Jul 2014 01:29:05 +0200 -Subject: [PATCH 01/10] configure.ac: check for socket() in libnetwork for +Subject: [PATCH 01/11] configure.ac: check for socket() in libnetwork for Haiku --- @@ -25,10 +25,10 @@ index dbbb5a5..5ff995f 100644 1.8.3.4 -From afbcf41abb168f3d950cbe285a6cc994e1142aa2 Mon Sep 17 00:00:00 2001 +From 538cc30e408668dc81299137b3771c5e7999ab81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 13 Jul 2014 01:29:39 +0200 -Subject: [PATCH 02/10] output: make sure AudioOutput::mixer is initialized +Subject: [PATCH 02/11] output: make sure AudioOutput::mixer is initialized Avoids crashing when libao fails to initialize. --- @@ -51,10 +51,10 @@ index eafcec4..79ef4f9 100644 1.8.3.4 -From 7aee15bbe5d6ef3ddc99ac6284da880d00dc1708 Mon Sep 17 00:00:00 2001 +From 4ed5e354d778792ed4a0dbc647655865e13de59a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 14 Jul 2014 23:10:02 +0200 -Subject: [PATCH 03/10] unix: define WCOREDUMP() for platforms that don't +Subject: [PATCH 03/11] unix: define WCOREDUMP() for platforms that don't support it Haiku does not dump core, it just starts the debugger. @@ -81,10 +81,10 @@ index 490b2de..49ad394 100644 1.8.3.4 -From 7f45df7c44c496f434c1193b1b051cd9290e3788 Mon Sep 17 00:00:00 2001 +From aabca27705ed851d637b5a16c913f056983ba3ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 14 Jul 2014 23:12:03 +0200 -Subject: [PATCH 04/10] system/SocketUtil: guard usage of SO_PASSCRED +Subject: [PATCH 04/11] system/SocketUtil: guard usage of SO_PASSCRED Haiku has struct ucred but no SO_PASSCRED (yet). --- @@ -108,10 +108,10 @@ index b9df0d5..5a88dd1 100644 1.8.3.4 -From f41add1bf7990cc97e260ccee5ccfdf5131965be Mon Sep 17 00:00:00 2001 +From 7daa8a861af79f0d70db13367dfdec27dfdcd4d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Mon, 14 Jul 2014 23:16:20 +0200 -Subject: [PATCH 05/10] output: add native Haiku audio output and mixer support +Subject: [PATCH 05/11] output: add native Haiku audio output and mixer support Also uses the notification system to display tags. --- @@ -120,9 +120,9 @@ Also uses the notification system to display tags. src/mixer/MixerList.hxx | 1 + src/mixer/plugins/HaikuMixerPlugin.cxx | 73 +++++ src/output/Registry.cxx | 4 + - src/output/plugins/HaikuOutputPlugin.cxx | 440 +++++++++++++++++++++++++++++++ + src/output/plugins/HaikuOutputPlugin.cxx | 453 +++++++++++++++++++++++++++++++ src/output/plugins/HaikuOutputPlugin.hxx | 34 +++ - 7 files changed, 580 insertions(+) + 7 files changed, 593 insertions(+) create mode 100644 src/mixer/plugins/HaikuMixerPlugin.cxx create mode 100644 src/output/plugins/HaikuOutputPlugin.cxx create mode 100644 src/output/plugins/HaikuOutputPlugin.hxx @@ -313,10 +313,10 @@ index 566f6b6..4d80ff5 100644 #endif diff --git a/src/output/plugins/HaikuOutputPlugin.cxx b/src/output/plugins/HaikuOutputPlugin.cxx new file mode 100644 -index 0000000..cfebe79 +index 0000000..fe933cc --- /dev/null +++ b/src/output/plugins/HaikuOutputPlugin.cxx -@@ -0,0 +1,440 @@ +@@ -0,0 +1,453 @@ +/* + * Copyright (C) 2003-2014 The Music Player Daemon Project + * http://www.musicpd.org @@ -469,15 +469,22 @@ index 0000000..cfebe79 + ad->buffer = (uint8*)buffer; + ad->buffer_size = size; + ad->buffer_filled = 0; -+ bigtime_t st = system_time(); ++ bigtime_t start = system_time(); + release_sem(ad->new_buffer); + acquire_sem(ad->buffer_done); ++ bigtime_t w = system_time() - start; ++ ++ if (w > 5000LL) { ++ FormatDebug(haiku_output_domain, ++ "haiku:fill_buffer waited %Ldus\n", w); ++ } ++ + if (ad->buffer_filled < ad->buffer_size) { + memset(ad->buffer + ad->buffer_filled, 0, + ad->buffer_size - ad->buffer_filled); + FormatDebug(haiku_output_domain, + "haiku:fill_buffer filled %d size %d clearing remainder\n", -+ ad->buffer_filled, ad->buffer_size); ++ (int)ad->buffer_filled, (int)ad->buffer_size); + + } +} @@ -530,9 +537,9 @@ index 0000000..cfebe79 + FormatDebug(haiku_output_domain, + "using haiku driver ad: bs: %d ws: %d " + "channels %d rate %f fmt %08lx bs %d\n", -+ ad->buffer_size, ad->write_size, -+ ad->format->channel_count, ad->format->frame_rate, -+ ad->format->format, ad->format->buffer_size); ++ (int)ad->buffer_size, (int)ad->write_size, ++ (int)ad->format->channel_count, ad->format->frame_rate, ++ ad->format->format, (int)ad->format->buffer_size); + + ad->sound_player = new BSoundPlayer(ad->format, "MPD Output", + fill_buffer, NULL, ad); @@ -620,7 +627,13 @@ index 0000000..cfebe79 + + unsigned delay = ad->buffer_filled ? 0 : ad->buffer_delay; + -+ return 0;//delay / 2; ++ //FormatDebug(haiku_output_domain, ++ // "delay=%d\n", delay / 2); ++ // XXX: doesn't work ++ //return (delay / 2) ? 1 : 0; ++ (void)delay; ++ ++ return 0; +} + +static void @@ -801,10 +814,10 @@ index 0000000..f3f224d 1.8.3.4 -From 238d3fec953ef638de2c7a1f5ab5cb590b3c09d0 Mon Sep 17 00:00:00 2001 +From e91b2b7299d4f337549713ec9ef3a347d280a8ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 31 Jul 2014 23:03:07 +0200 -Subject: [PATCH 06/10] Add an Haiku HVIF icon +Subject: [PATCH 06/11] Haiku: add an HVIF icon 3D version reinterpreted from the official 2D design, reusing existing Haiku icons. @@ -947,10 +960,10 @@ HcmV?d00001 1.8.3.4 -From 6a4a251730bf2b40dcc68a79ea92c6e18219d860 Mon Sep 17 00:00:00 2001 +From 255425c7fe9cc6ce6ae5e1cf7ec30ff637549723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 31 Jul 2014 23:09:29 +0200 -Subject: [PATCH 07/10] Add Haiku icon as resource definition file +Subject: [PATCH 07/11] Haiku: add icon as resource definition file --- src/haiku/mpd.rdef | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1031,10 +1044,10 @@ index 0000000..30fcfe4 1.8.3.4 -From 831be08addd2c6fd6375bdaa4273ae92cb7638fb Mon Sep 17 00:00:00 2001 +From aa6e9cc1fbe13da18685efb28122462b55c57fa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 31 Jul 2014 23:12:56 +0200 -Subject: [PATCH 08/10] Add Haiku resources: application signature and flags +Subject: [PATCH 08/11] Haiku: add resources: application signature and flags Since we do not handle B_QUIT_REQUESTED because the BApplication does not Run(), use the background flag to avoid showing up in Deskbar. @@ -1059,17 +1072,98 @@ index 30fcfe4..6f1aca2 100644 1.8.3.4 -From ed69f94394937e90f9547cfd68c96b2cc4d6303f Mon Sep 17 00:00:00 2001 +From 913cc76583cd70d3cf6b0d12ba716699039180de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Thu, 31 Jul 2014 23:18:06 +0200 -Subject: [PATCH 09/10] Use the icon for notifications on Haiku +Date: Fri, 1 Aug 2014 19:03:32 +0200 +Subject: [PATCH 09/11] configure: add tests for Haiku tools (rc, xres) --- - src/output/plugins/HaikuOutputPlugin.cxx | 56 ++++++++++++++++++++++++++++++++ - 1 file changed, 56 insertions(+) + configure.ac | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/configure.ac b/configure.ac +index 81dec53..83b5ecf 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -114,6 +114,10 @@ darwin*) + solaris*) + host_is_solaris=yes + ;; ++haiku*) ++ AC_CHECK_TOOL(RC, rc) ++ AC_CHECK_TOOL(XRES, xres) ++ ;; + esac + + AM_CONDITIONAL([ANDROID], [test x$host_is_android = xyes]) +-- +1.8.3.4 + + +From e8dfa37617e7c83798ecf2e548ce3dff444df7b7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= +Date: Fri, 1 Aug 2014 19:03:54 +0200 +Subject: [PATCH 10/11] Makefile.am: add the Haiku resources to the mpd binary + +--- + Makefile.am | 25 ++++++++++++++++++++++++- + 1 file changed, 24 insertions(+), 1 deletion(-) + +diff --git a/Makefile.am b/Makefile.am +index 7c87573..fefc746 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -333,6 +333,28 @@ src_mpd_DEPENDENCIES = src/win32/mpd_win32_rc.$(OBJEXT) + src_mpd_LDFLAGS = -Wl,src/win32/mpd_win32_rc.$(OBJEXT) + endif + ++# ++# Haiku resource file ++# ++ ++src/haiku/mpd.rsrc: src/haiku/mpd.rdef ++ $(RC) -o $@ $< ++ ++if HAVE_HAIKU ++noinst_DATA = src/haiku/mpd.rdef ++ ++EXTRA_src_mpd_DEPENDENCIES = src/haiku/mpd.rsrc ++ ++src/mpd.haiku-rsrc-done: src/mpd src/haiku/mpd.rsrc ++ $(XRES) -o src/mpd src/haiku/mpd.rsrc ++ @touch src/mpd.haiku-rsrc-done ++ ++all-local: src/mpd.haiku-rsrc-done ++ ++clean-local: ++ rm -rf src/haiku/mpd.rsrc src/mpd.haiku-rsrc-done ++endif ++ + if ENABLE_DATABASE + if ENABLE_INOTIFY + libmpd_a_SOURCES += \ +@@ -2079,4 +2101,5 @@ EXTRA_DIST = $(doc_DATA) autogen.sh \ + test/test_archive_zzip.sh \ + $(wildcard scripts/*.sh) \ + $(man_MANS) $(DOCBOOK_FILES) doc/mpdconf.example doc/doxygen.conf \ +- src/win32/mpd_win32_rc.rc.in src/win32/mpd.ico ++ src/win32/mpd_win32_rc.rc.in src/win32/mpd.ico \ ++ src/haiku/App_MusicPD +-- +1.8.3.4 + + +From fd01e80a754f8c180fc5638df509502fa6a80768 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= +Date: Thu, 31 Jul 2014 23:18:06 +0200 +Subject: [PATCH 11/11] output/haiku: use the icon for notifications + +--- + src/output/plugins/HaikuOutputPlugin.cxx | 53 +++++++++++++++++++++++++++++++- + 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/src/output/plugins/HaikuOutputPlugin.cxx b/src/output/plugins/HaikuOutputPlugin.cxx -index cfebe79..a937bbe 100644 +index fe933cc..0f111c6 100644 --- a/src/output/plugins/HaikuOutputPlugin.cxx +++ b/src/output/plugins/HaikuOutputPlugin.cxx @@ -26,11 +26,15 @@ @@ -1109,7 +1203,7 @@ index cfebe79..a937bbe 100644 +{ + // TODO: use some locking? + delete be_app; -+ be_app == NULL; ++ be_app = NULL; + FormatDebug(haiku_output_domain, "deleting be_app\n"); +} + @@ -1134,9 +1228,13 @@ index cfebe79..a937bbe 100644 } static void -@@ -309,6 +338,29 @@ haiku_send_tag(AudioOutput *ao, const Tag *meta) +@@ -320,8 +349,28 @@ haiku_output_delay(AudioOutput *ao) + static void + haiku_send_tag(AudioOutput *ao, const Tag *meta) { - HaikuOutput *ad = (HaikuOutput *)ao; +- HaikuOutput *ad = (HaikuOutput *)ao; ++ //HaikuOutput *ad = (HaikuOutput *)ao; ++ (void)ao; const Tag &tag = *meta; + status_t err; + @@ -1151,11 +1249,7 @@ index cfebe79..a937bbe 100644 + err = info.SetTo(&file); + icon = new BBitmap(BRect(0, 0, (float)B_LARGE_ICON - 1, + (float)B_LARGE_ICON - 1), B_BITMAP_NO_SERVER_LINK, B_RGBA32); -+ FormatDebug(haiku_output_domain, -+ "icon=%p\n", icon); + err = info.GetIcon(icon, B_LARGE_ICON); -+ FormatDebug(haiku_output_domain, -+ "err=0x%08lx\n", err); + if (err != B_OK) { + delete icon; + icon = NULL; @@ -1164,13 +1258,11 @@ index cfebe79..a937bbe 100644 BNotification notification(B_INFORMATION_NOTIFICATION); -@@ -394,6 +446,10 @@ haiku_send_tag(AudioOutput *ao, const Tag *meta) +@@ -407,6 +456,8 @@ haiku_send_tag(AudioOutput *ao, const Tag *meta) notification.SetContent(full); + err = notification.SetIcon(icon); -+ FormatDebug(haiku_output_domain, -+ "SetIcon: err=0x%08lx\n", err); + notification.Send(); } @@ -1178,69 +1270,3 @@ index cfebe79..a937bbe 100644 -- 1.8.3.4 - -From a9022a970f14fc0953c393820d7902d87a636ef2 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= -Date: Fri, 1 Aug 2014 00:40:13 +0200 -Subject: [PATCH 10/10] Add the Haiku resources to the mpd binary - ---- - Makefile.am | 22 +++++++++++++++++++++- - configure.ac | 4 ++++ - 2 files changed, 25 insertions(+), 1 deletion(-) - -diff --git a/Makefile.am b/Makefile.am -index 7c87573..0a5bca3 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -333,6 +333,25 @@ src_mpd_DEPENDENCIES = src/win32/mpd_win32_rc.$(OBJEXT) - src_mpd_LDFLAGS = -Wl,src/win32/mpd_win32_rc.$(OBJEXT) - endif - -+# -+# Haiku resource file -+# -+ -+src/haiku/mpd.rsrc: src/haiku/mpd.rdef -+ $(RC) -o $@ $< -+ -+if HAVE_HAIKU -+noinst_DATA = src/haiku/mpd.rdef -+ -+src_mpd_DEPENDENCIES = src/haiku/mpd.rsrc -+ -+all-local: -+ $(XRES) -o src/mpd src/haiku/mpd.rsrc -+ -+clean-local: -+ rm -rf src/haiku/mpd.rsrc -+endif -+ - if ENABLE_DATABASE - if ENABLE_INOTIFY - libmpd_a_SOURCES += \ -@@ -2079,4 +2098,5 @@ EXTRA_DIST = $(doc_DATA) autogen.sh \ - test/test_archive_zzip.sh \ - $(wildcard scripts/*.sh) \ - $(man_MANS) $(DOCBOOK_FILES) doc/mpdconf.example doc/doxygen.conf \ -- src/win32/mpd_win32_rc.rc.in src/win32/mpd.ico -+ src/win32/mpd_win32_rc.rc.in src/win32/mpd.ico \ -+ src/haiku/App_MusicPD -diff --git a/configure.ac b/configure.ac -index 81dec53..83b5ecf 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -114,6 +114,10 @@ darwin*) - solaris*) - host_is_solaris=yes - ;; -+haiku*) -+ AC_CHECK_TOOL(RC, rc) -+ AC_CHECK_TOOL(XRES, xres) -+ ;; - esac - - AM_CONDITIONAL([ANDROID], [test x$host_is_android = xyes]) --- -1.8.3.4 -