Skip to content

Commit

Permalink
media_server: Add notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
Numerio committed Apr 3, 2016
1 parent 53c3fa5 commit c131229
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions headers/private/media/MediaMisc.h
Expand Up @@ -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)
Expand Down
3 changes: 3 additions & 0 deletions src/servers/media/media_server.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -941,6 +943,7 @@ ServerApp::MessageReceived(BMessage* msg)
case MEDIA_SERVER_RESCAN_COMPLETED:
{
gAppManager->UnlockGlobalSynchro();
progress_startup(100, NULL, NULL);
break;
}

Expand Down

0 comments on commit c131229

Please sign in to comment.