status_t TElementsSorter::HandleFile(entry_ref &theRef, struct stat &st) { { BFile theFile; if ( theFile.SetTo(&theRef, B_READ_WRITE) == B_OK ) { BNodeInfo nodeInfo(&theFile); if (nodeInfo.InitCheck() == B_NO_ERROR) { if ( IsSupportedType(nodeInfo) ) { // Pass the node info to all of our sorters. They will // know what to do with it. BMessage* refMessage = new BMessage(SORTER_REFS_MSG); refMessage->AddRef("FileRef", &theRef); for (int32 index = 0; index < fSorterList->CountItems(); index++) { TSorterContainer* sorter = static_cast<TSorterContainer*>(fSorterList->ItemAt(index)); if (sorter) sorter->MessageReceived(refMessage); } delete refMessage; // Get active list, sort and sync for (int32 sortIndex = 0; sortIndex < fSorterList->CountItems(); sortIndex++) { TSorterContainer* theContainer = static_cast<TSorterContainer*>(fSorterList->ItemAt(sortIndex)); if (theContainer) { if (theContainer->IsActive()) { theContainer->Sort(); SynchronizeLists(theContainer); break; } } } return B_NO_ERROR; } return B_ERROR; } } } return B_ERROR; }
/* static */ bool MP4Decoder::IsSupportedTypeWithoutDiagnostics( const MediaContainerType& aContainerType) { return IsSupportedType(aContainerType, nullptr); }
status_t TQueueDialog::HandleFile(entry_ref &theRef, struct stat &st) { //FUNCTION("TQueueDialog::HandleFile() - ENTER -\n"); BFile theFile; if ( theFile.SetTo(&theRef, B_READ_WRITE) == B_OK ) { // Create BEntry BEntry *theEntry = new BEntry(&theRef, true); // Create node BNodeInfo nodeInfo(&theFile); if (nodeInfo.InitCheck() == B_NO_ERROR) { if ( IsSupportedType(nodeInfo) && !AlreadyInList(theRef) ) { // Replace with MEdiaFile checks... /* // One more check. For now we only handle 16-bit, 44.1k // Stereo AIFF files BSoundFile *soundFile = new BSoundFile(&theRef, B_READ_ONLY); if (soundFile->InitCheck() != B_OK) { ERROR("TQueueDialog::HandleFile() - BSoundFile Error: %s -\n", strerror(soundFile->InitCheck())); return B_ERROR; } // Make sure we are AIFF if (soundFile->FileFormat() != B_AIFF_FILE) { ERROR("TQueueDialog::HandleFile() - File not AIFF. -\n"); return B_ERROR; } // Make sure we are stereo if (soundFile->CountChannels() != 2) { ERROR("TQueueDialog::HandleFile() - File not stereo. Has %ld channels. -\n", soundFile->CountChannels()); return B_ERROR; } // Check bit depth if (soundFile->SamplingRate() != 44100) { ERROR("TQueueDialog::HandleFile() - Invalid sampling rate: %ld -\n", soundFile->SamplingRate()); return B_ERROR; } // Check sampling rate if (soundFile->SampleSize() != 2) { ERROR("TQueueDialog::HandleFile() - File not 16bit -\n"); return B_ERROR; } // Must be good! delete soundFile; */ // Add item to list AddItemToDataList(theEntry, nodeInfo); return B_NO_ERROR; } ERROR("TQueueDialog::HandleFile() - Not supported type -\n"); return B_ERROR; } } ERROR("TQueueDialog::HandleFile() - BFile SetTo failure -\n"); return B_ERROR; }