media_server: Add notifications

This commit is contained in:
Dario Casalinuovo 2016-04-04 01:07:01 +02:00
parent 53c3fa5137
commit c131229f08
2 changed files with 16 additions and 0 deletions

View File

@ -7,6 +7,19 @@
#ifndef _MEDIA_MISC_H_
#define _MEDIA_MISC_H_
// Used by Haiku apps to make media services notifications
void
progress_startup(int stage,
bool (*progress)(int stage, const char* message, void* cookie),
void* cookie);
void
progress_shutdown(int stage,
bool (*progress)(int stage, const char* message, void* cookie),
void* cookie);
#define IS_INVALID_NODE(_node) ((_node).node <= 0 || (_node).port <= 0)
#define IS_INVALID_NODEID(_id) ((_id) <= 0)
#define IS_INVALID_SOURCE(_src) ((_src).port <= 0)

View File

@ -143,6 +143,8 @@ ServerApp::ReadyToRun()
{
gNodeManager->LoadState();
progress_startup(50, NULL, NULL);
// make sure any previous media_addon_server is gone
_QuitAddOnServer();
// and start a new one
@ -941,6 +943,7 @@ ServerApp::MessageReceived(BMessage* msg)
case MEDIA_SERVER_RESCAN_COMPLETED:
{
gAppManager->UnlockGlobalSynchro();
progress_startup(100, NULL, NULL);
break;
}