2002-11-01 16:13:08 +00:00
|
|
|
/**
|
|
|
|
|
* @file MidiServerApp.cpp
|
|
|
|
|
*
|
|
|
|
|
* @author Matthijs Hollemans
|
2002-11-05 09:17:50 +00:00
|
|
|
* @author Jerome Leveque
|
2002-11-01 16:13:08 +00:00
|
|
|
*/
|
2002-10-30 15:37:29 +00:00
|
|
|
|
|
|
|
|
#include <Alert.h>
|
|
|
|
|
|
|
|
|
|
#include "MidiServerApp.h"
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2002-11-05 17:39:20 +00:00
|
|
|
|
2002-10-30 15:37:29 +00:00
|
|
|
MidiServerApp::MidiServerApp()
|
2002-11-05 17:39:20 +00:00
|
|
|
: BApplication(MIDI_SERVER_SIGNATURE)
|
2002-10-30 15:37:29 +00:00
|
|
|
{
|
2002-11-05 17:39:20 +00:00
|
|
|
//roster = new BMidiRoster();
|
2002-11-05 09:17:50 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2002-11-05 17:39:20 +00:00
|
|
|
|
|
|
|
|
MidiServerApp::~MidiServerApp(void)
|
|
|
|
|
{
|
|
|
|
|
//delete endpoints;
|
2002-10-30 15:37:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
void MidiServerApp::AboutRequested()
|
|
|
|
|
{
|
|
|
|
|
(new BAlert(0,
|
|
|
|
|
"-write something funny here-",
|
|
|
|
|
"Okay", 0, 0, B_WIDTH_AS_USUAL,
|
|
|
|
|
B_INFO_ALERT))->Go();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
2002-11-05 17:39:20 +00:00
|
|
|
void MidiServerApp::MessageReceived(BMessage* msg)
|
|
|
|
|
{
|
2002-11-05 09:17:50 +00:00
|
|
|
switch (msg->what)
|
|
|
|
|
{
|
2002-11-05 17:39:20 +00:00
|
|
|
default: super::MessageReceived(msg); break;
|
2002-11-05 09:17:50 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
2002-11-05 17:39:20 +00:00
|
|
|
/*int32 MidiServerApp::GetNextFreeID()
|
|
|
|
|
{
|
|
|
|
|
return nextFreeID++;
|
|
|
|
|
}*/
|
2002-11-05 09:17:50 +00:00
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
2002-11-05 17:39:20 +00:00
|
|
|
/*BMidiEndpoint* MidiServerApp::NextEndPoint(int32* id)
|
|
|
|
|
{
|
|
|
|
|
int32 item = 0;
|
|
|
|
|
BMidiEndpoint *endpoint;
|
|
|
|
|
|
|
|
|
|
while ((endpoint = (BMidiEndpoint*) endpoints->ItemAt(item)) != NULL)
|
2002-11-05 09:17:50 +00:00
|
|
|
{
|
|
|
|
|
if (endpoint->ID() > *id)
|
|
|
|
|
{
|
|
|
|
|
endpoint->Acquire();
|
|
|
|
|
*id = endpoint->ID();
|
|
|
|
|
return endpoint;
|
|
|
|
|
}
|
|
|
|
|
item++;
|
|
|
|
|
}
|
2002-11-05 17:39:20 +00:00
|
|
|
return NULL;
|
|
|
|
|
}*/
|
2002-11-05 09:17:50 +00:00
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
2002-11-05 17:39:20 +00:00
|
|
|
/*BMidiRoster* MidiServerApp::GetRoster()
|
2002-11-05 09:17:50 +00:00
|
|
|
{
|
|
|
|
|
return roster;
|
2002-11-05 17:39:20 +00:00
|
|
|
}*/
|
2002-11-05 09:17:50 +00:00
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|
2002-10-30 15:37:29 +00:00
|
|
|
int main()
|
|
|
|
|
{
|
|
|
|
|
MidiServerApp app;
|
|
|
|
|
app.Run();
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
|
|
|
|
|