media_server: Add notifications
This commit is contained in:
@@ -7,6 +7,19 @@
|
|||||||
#ifndef _MEDIA_MISC_H_
|
#ifndef _MEDIA_MISC_H_
|
||||||
#define _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_NODE(_node) ((_node).node <= 0 || (_node).port <= 0)
|
||||||
#define IS_INVALID_NODEID(_id) ((_id) <= 0)
|
#define IS_INVALID_NODEID(_id) ((_id) <= 0)
|
||||||
#define IS_INVALID_SOURCE(_src) ((_src).port <= 0)
|
#define IS_INVALID_SOURCE(_src) ((_src).port <= 0)
|
||||||
|
|||||||
@@ -143,6 +143,8 @@ ServerApp::ReadyToRun()
|
|||||||
{
|
{
|
||||||
gNodeManager->LoadState();
|
gNodeManager->LoadState();
|
||||||
|
|
||||||
|
progress_startup(50, NULL, NULL);
|
||||||
|
|
||||||
// make sure any previous media_addon_server is gone
|
// make sure any previous media_addon_server is gone
|
||||||
_QuitAddOnServer();
|
_QuitAddOnServer();
|
||||||
// and start a new one
|
// and start a new one
|
||||||
@@ -941,6 +943,7 @@ ServerApp::MessageReceived(BMessage* msg)
|
|||||||
case MEDIA_SERVER_RESCAN_COMPLETED:
|
case MEDIA_SERVER_RESCAN_COMPLETED:
|
||||||
{
|
{
|
||||||
gAppManager->UnlockGlobalSynchro();
|
gAppManager->UnlockGlobalSynchro();
|
||||||
|
progress_startup(100, NULL, NULL);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user