Add new version of launch_media_server

* Due to the needs to provide a peaceful UX, i moved out the
  notifications mechanism from the Media preflet and i have
  integrated it with the launch and shutdown functions of MediaDefs.h.
* This implied to introduce a new launch_media_server function
  similar to the shutdown_media_server allowing to specify a custom
  notification function too.
* Both functions then are reworked to send by default notifications
  to the Deskbar, this was needed because in a lot of situations
  the mechanism failed without correctly noticing the user.
* The one argument launch_media_server is considered to be deprecated,
  the default argument is removed to mantain binary compatibility but
  make new apps to automatically use the new one with just the default
  arguments. This is needed due to conflicts in overloading.
* Improve notifications by indirectly extending localization
  to old BeOS apps.
This commit is contained in:
Dario Casalinuovo
2015-07-29 18:03:32 +02:00
parent e716f48778
commit 8acd164f8c
3 changed files with 150 additions and 16 deletions
+12 -2
View File
@@ -787,11 +787,21 @@ struct buffer_clone_info;
// media_server and it's friends. You can provide a call back hook which
// will be called during various steps of the process. This callback should
// currently always return TRUE. A 'stage' value of 100 means the process is
// completely finished.
// completely finished. Differently from BeOS the functions automatically
// send notifications to the Deskbar if not differently specified.
// It's also provided a new version of launch_media_server allowing
// to specify a custom callback for notifications.
// Deprecated
status_t launch_media_server(uint32 flags);
status_t launch_media_server(bigtime_t timeout = B_INFINITE_TIMEOUT,
bool (*progress)(int stage, const char* message, void* cookie) = NULL,
void* cookie = NULL, uint32 flags = 0);
status_t shutdown_media_server(bigtime_t timeout = B_INFINITE_TIMEOUT,
bool (*progress)(int stage, const char* message, void* cookie) = NULL,
void* cookie = NULL);
status_t launch_media_server(uint32 flags = 0);
// Given an image_id, prepare that image_id for realtime media