/******************************************************** * _ENDPOINT-LIST ********************************************************/ _EndpointList::_EndpointList(BRect frame) : inherited(frame, ENDPOINT_LIST_STR, B_FOLLOW_ALL, B_WILL_DRAW, B_NO_BORDER), mLabelTarget(NULL), mDeviceTarget(NULL) { SetSelectionMode(B_SINGLE_SELECTION_LIST); SetSortingEnabled(false); AddColumn( new SeqColoredColumn(MIDI_PORT_STR, 150, 20, 350, B_TRUNCATE_MIDDLE), 0); AddColumn( new SeqColoredColumn(TYPE_STR, 50, 20, 350, B_TRUNCATE_MIDDLE), 1); AddColumn( new SeqColoredColumn(DEVICE_STR, 150, 20, 350, B_TRUNCATE_MIDDLE), 2); AddColumn( new SeqColoredColumn(LABEL_STR, 50, 20, 350, B_TRUNCATE_MIDDLE), 3); int32 id = 0; BMidiProducer* prod; while ((prod=BMidiRoster::NextProducer(&id)) != NULL) { if (prod->IsValid() ) AddEndpoint(prod); } id = 0; BMidiConsumer* cons; while ((cons=BMidiRoster::NextConsumer(&id)) != NULL) { if (cons->IsValid() ) AddEndpoint(cons); } am_studio_endpoint endpt; BString l, m, n; for (uint32 k = 0; AmGlobals().GetStudioInfoAt(k, endpt, &l, &m, &n) == B_OK; k++) { AddChildRow(endpt, &l, &m, &n); } }
status_t _EndpointList::MidiRegistered(int32 id, AmEndpointType type) { BMidiEndpoint* endpoint = BMidiRoster::FindEndpoint(id); if (!endpoint) { ArpASSERT(false); return B_ERROR; } if (!endpoint->IsValid() ) return B_ERROR; BString name = endpoint->Name(); _EndpointRow* p = ParentNamed(name, type); if (p) return B_OK; AddEndpoint(endpoint); return B_OK; }
void CMnemosynthDb::Boot (IArchonProcessCtx *pProcess) // Boot // // Initialize { ASSERT(m_Endpoints.GetCount() == 0); m_pProcess = pProcess; m_ModifiedEvent.Create(); m_dwNextID = 0; // Initialize our endpoint AddEndpoint(strPattern("%s/%s", m_pProcess->GetMachineName(), m_pProcess->GetModuleName()), ::GetCurrentProcessId()); }