CString CtrfIndex::GetDisplayedItem(int nMode) { CaDisplayInfo* pDisplayInfo = GetDisplayInfo(); // // pDisplayInfo must be accessible, it must be in the root parent of // the three hierarchy ! ASSERT(pDisplayInfo); if (!pDisplayInfo) return m_object.GetName(); CString strOWNERxITEM = pDisplayInfo->GetOwnerPrefixedFormat(); if (!strOWNERxITEM.IsEmpty() && !m_object.GetOwner().IsEmpty()) { CString strDisplay; switch (nMode) { case 0: strDisplay.Format (strOWNERxITEM, (LPCTSTR)m_object.GetOwner(), (LPCTSTR)m_object.GetName()); break; case 1: strDisplay.Format (strOWNERxITEM, (LPCTSTR)m_object.GetName(), (LPCTSTR)m_object.GetOwner()); break; default: ASSERT(FALSE); break; } return strDisplay; } return m_object.GetName(); }
LONG CuDlgIpmPageProcesses::OnUpdateData (WPARAM wParam, LPARAM lParam) { BOOL bOK = FALSE; CPtrList listInfoStruct; LOGPROCESSDATAMIN* pData; LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam; CString strID; CString strPID; CString strType; CString strOpenDB; CString strWrite; CString strForce; CString strWait; CString strBegin; CString strEnd; ASSERT (pUps); switch (pUps->nIpmHint) { case 0: break; default: return 0L; } try { LOGPROCESSDATAMIN structData; CdIpmDoc* pDoc = (CdIpmDoc*)wParam; ResetDisplay(); CaIpmQueryInfo queryInfo(pDoc, OT_MON_LOGPROCESS, pUps, (LPVOID)&structData, sizeof(structData)); bOK = IPM_QueryInfo (&queryInfo, listInfoStruct); if (bOK) { while (!listInfoStruct.IsEmpty()) { pData = (LOGPROCESSDATAMIN*)listInfoStruct.RemoveHead(); GetDisplayInfo (pData, strID, strPID, strType, strOpenDB, strWrite, strForce, strWait, strBegin, strEnd); AddProcess (strID, strPID, strType, strOpenDB, strWrite, strForce, strWait, strBegin, strEnd, pData); } } return 0L; } catch (CMemoryException* e) { theApp.OutOfMemoryMessage(); e->Delete(); } catch (CeIpmException e) { AfxMessageBox (e.GetReason(), MB_ICONEXCLAMATION|MB_OK); } while (!listInfoStruct.IsEmpty()) delete (LOGPROCESSDATAMIN*)listInfoStruct.RemoveHead(); return 0L; }
LONG CuDlgIpmPageLockLists::OnUpdateData (WPARAM wParam, LPARAM lParam) { BOOL bOK = FALSE; CPtrList listInfoStruct; LOCKLISTDATAMIN* pData; LPIPMUPDATEPARAMS pUps = (LPIPMUPDATEPARAMS)lParam; CString strID; CString strSession; CString strCount; CString strLogical; CString strMaxL; CString strStatus; ASSERT (pUps); switch (pUps->nIpmHint) { case 0: case FILTER_SYSTEM_LOCK_LISTS: break; default: return 0L; } try { LOCKLISTDATAMIN structData; CdIpmDoc* pDoc = (CdIpmDoc*)wParam; ResetDisplay(); CaIpmQueryInfo queryInfo(pDoc, OT_MON_LOCKLIST, pUps, (LPVOID)&structData, sizeof(structData)); bOK = IPM_QueryInfo (&queryInfo, listInfoStruct); if (bOK) { while (!listInfoStruct.IsEmpty()) { pData = (LOCKLISTDATAMIN*)listInfoStruct.RemoveHead(); GetDisplayInfo (pData, strID, strSession, strCount, strLogical, strMaxL, strStatus); AddLockList (strID, strSession, strCount, strLogical, strMaxL, strStatus, pData); } } return 0L; } catch (CMemoryException* e) { MessageBeep (-1); theApp.OutOfMemoryMessage (); e->Delete(); } catch (CeIpmException e) { AfxMessageBox (e.GetReason(), MB_ICONEXCLAMATION|MB_OK); } while (!listInfoStruct.IsEmpty()) delete (LOCKLISTDATAMIN*)listInfoStruct.RemoveHead(); return 0L; }
//{{{ GetManifestor //{{{ doxynote /// \brief access a manifestor - or create a new one if it doesn't exist /// \return Havana status code, HavanaNoError indicates success. //}}} HavanaStatus_t HavanaDisplay_c::GetManifestor(class HavanaPlayer_c *HavanaPlayer, char *Media, char *Encoding, unsigned int SurfaceId, class Manifestor_c **Manifestor) { HavanaStatus_t Status = HavanaNoError; //DISPLAY_DEBUG("%p\n", this->Manifestor); if (strcmp(Media, BACKEND_AUDIO_ID) == 0) { PlayerStreamType = StreamTypeAudio; if (this->Manifestor == NULL) Status = HavanaPlayer->CallFactory(Media, FACTORY_ANY_ID, StreamTypeAudio, ComponentManifestor, (void **)&this->Manifestor); if (Status == HavanaNoError) //{{{ Init audio manifestor { class Manifestor_Audio_c *AudioManifestor = (class Manifestor_Audio_c *)this->Manifestor; const char *BackendMixer; ManifestorStatus_t ManifestorStatus; ManifestorParameterBlock_t DecodeBufferParameters; ManifestorAudioParameterBlock_t ManifestorParameters; class Mixer_Mme_c *AudioMixer; // // find a mixer instance and register it with the manifestor // #ifndef CONFIG_DUAL_DISPLAY // we must unconditionally use mixer0 until SurfaceId has been split into a Stream and Substream // (e.g. /dev/dvb/adapter<Stream>/audio<Substream> )... BackendMixer = BACKEND_MIXER0_ID; #else // ... unless we are running with the (temporary) dual display hacks BackendMixer = (DISPLAY_ID_REMOTE != SurfaceId ? BACKEND_MIXER0_ID : BACKEND_MIXER1_ID); #endif Status = HavanaPlayer->CallFactory(Media, BackendMixer, StreamTypeAudio, ComponentExternal, (void **)&AudioMixer); if (Status != HavanaNoError) return Status; ManifestorParameters.ParameterType = ManifestorAudioMixerConfiguration; ManifestorParameters.Mixer = AudioMixer; ManifestorStatus = AudioManifestor->SetModuleParameters(sizeof(ManifestorParameters), &ManifestorParameters); if (ManifestorStatus != ManifestorNoError) { HAVANA_ERROR("Failed to set manifestor mixer parameters (%08x)\n", ManifestorStatus); return HavanaNoMemory; } // // provide the rest of the manifestors configuration // DecodeBufferParameters.ParameterType = ManifestorBufferConfiguration; DecodeBufferParameters.BufferConfiguration.DecodedBufferFormat = FormatAudio; DecodeBufferParameters.BufferConfiguration.MaxBufferCount = 32; DecodeBufferParameters.BufferConfiguration.TotalBufferMemory = AUDIO_BUFFER_MEMORY; strcpy(DecodeBufferParameters.BufferConfiguration.PartitionName, "BPA2_Region1"); ManifestorStatus = AudioManifestor->SetModuleParameters(sizeof(DecodeBufferParameters), &DecodeBufferParameters); if (ManifestorStatus != ManifestorNoError) { HAVANA_ERROR("Failed to set manifestor parameters (%08x)\n", ManifestorStatus); return HavanaNoMemory; } ManifestorStatus = AudioManifestor->OpenOutputSurface(); if (ManifestorStatus != ManifestorNoError) { HAVANA_ERROR("Failed to create audio output surface\n"); return HavanaNoMemory; } } //}}} } else if (strcmp(Media, BACKEND_VIDEO_ID) == 0) { class Manifestor_Video_c *VideoManifestor; ManifestorStatus_t ManifestorStatus; ManifestorParameterBlock_t DecodeBufferParameters; BufferLocation_t BufferLocation; const char *Partition; unsigned int PlaneId; unsigned int OutputId; PlayerStreamType = StreamTypeVideo; if (GetDisplayInfo(SurfaceId, &DisplayDevice, &PlaneId, &OutputId, &BufferLocation) != 0) { HAVANA_ERROR("Failed to access display info\n"); return HavanaError; } if (this->Manifestor == NULL) { Status = HavanaPlayer->CallFactory(Media, FACTORY_ANY_ID, StreamTypeVideo, ComponentManifestor, (void **)&this->Manifestor); VideoManifestor = (class Manifestor_Video_c *)this->Manifestor; if (Status == HavanaNoError) //{{{ Open display surface { ManifestorStatus = VideoManifestor->OpenOutputSurface(DisplayDevice, PlaneId, OutputId); if (ManifestorStatus != ManifestorNoError) { HAVANA_ERROR("Failed to create video output surface\n"); return HavanaNoMemory; } } //}}} else { HAVANA_ERROR("Failed to create video Manifestor\n"); return HavanaNoMemory; } } VideoManifestor = (class Manifestor_Video_c *)this->Manifestor; //{{{ Init video manifestor // // Configure the manifestor buffers // DecodeBufferParameters.ParameterType = ManifestorBufferConfiguration; DecodeBufferParameters.BufferConfiguration.MaxBufferCount = MAX_VIDEO_DECODE_BUFFERS; if (strcmp(Encoding, "dvp") == 0) DecodeBufferParameters.BufferConfiguration.DecodedBufferFormat = FormatVideo422_Raster; if (strcmp(Encoding, "cap") == 0) DecodeBufferParameters.BufferConfiguration.DecodedBufferFormat = FormatVideo565_RGB; else if (strcmp(Encoding, "mpeg4p2") == 0) // Divx DecodeBufferParameters.BufferConfiguration.DecodedBufferFormat = FormatVideo420_PairedMacroBlock; else DecodeBufferParameters.BufferConfiguration.DecodedBufferFormat = FormatVideo420_MacroBlock; #if defined(UFS922) \ || defined(UFC960) \ || defined(TF7700) \ || defined(CUBEREVO) \ || defined(CUBEREVO_MINI2) \ || defined(CUBEREVO_MINI) \ || defined(CUBEREVO_250HD) \ || defined(CUBEREVO_2000HD) \ || defined(CUBEREVO_9500HD) \ || defined(CUBEREVO_MINI_FTA) \ || defined(CUBEREVO_3000HD) \ || defined(IPBOX9900) \ || defined(IPBOX99) \ || defined(IPBOX55) //Dagobert: lmi_vid isn't available for pip :( if (SurfaceId != DISPLAY_ID_MAIN) Partition = "BPA2_Region0"; else if (BufferLocation == BufferLocationVideoMemory) Partition = "BPA2_Region1"; else if (BufferLocation == BufferLocationSystemMemory) Partition = "BPA2_Region0"; else Partition = (SurfaceId == DISPLAY_ID_MAIN) ? "BPA2_Region1" : "BPA2_Region0"; #else Partition = "BPA2_Region1"; #endif DecodeBufferParameters.BufferConfiguration.TotalBufferMemory = (SurfaceId == DISPLAY_ID_MAIN) ? PRIMARY_VIDEO_BUFFER_MEMORY : SECONDARY_VIDEO_BUFFER_MEMORY; if (strcmp(Encoding, "dvp") == 0) { DecodeBufferParameters.BufferConfiguration.TotalBufferMemory = AVR_VIDEO_BUFFER_MEMORY; } if (strcmp(Encoding, "cap") == 0) { Partition = "BPA2_Region1"; DecodeBufferParameters.BufferConfiguration.TotalBufferMemory = AVR_VIDEO_BUFFER_MEMORY; } strcpy(DecodeBufferParameters.BufferConfiguration.PartitionName, Partition); if (strcmp(Encoding, "mpeg4p2") == 0) // Divx { // // Nick fudge, because divx currently doubles up the buffers, // and allocates full size raster buffers, we halve the memory, // and restrict them to 12 buffers. This stays in effect until the // manifestor handles their native format. DecodeBufferParameters.BufferConfiguration.MaxBufferCount /= 2; DecodeBufferParameters.BufferConfiguration.TotalBufferMemory /= 2; } HAVANA_DEBUG("Will allocate upto %d buffers of type %d out of %08x bytes from the %s partition\n", DecodeBufferParameters.BufferConfiguration.MaxBufferCount, DecodeBufferParameters.BufferConfiguration.DecodedBufferFormat, DecodeBufferParameters.BufferConfiguration.TotalBufferMemory, Partition); ManifestorStatus = VideoManifestor->SetModuleParameters(sizeof(ManifestorParameterBlock_t), &DecodeBufferParameters); if (ManifestorStatus != ManifestorNoError) { HAVANA_ERROR("Failed to set manifestor parameters (%08x)\n", ManifestorStatus); return HavanaNoMemory; } ManifestorStatus = VideoManifestor->Enable(); if (ManifestorStatus != ManifestorNoError) { HAVANA_ERROR("Failed to enable video output\n"); return HavanaError; } //}}} } else PlayerStreamType = StreamTypeOther; if (this->Manifestor == NULL) Status = HavanaPlayer->CallFactory(Media, FACTORY_ANY_ID, StreamTypeOther, ComponentManifestor, (void **)&this->Manifestor); *Manifestor = this->Manifestor; return Status; }