Exemplo n.º 1
0
bool TTAVData::CanCutWith( TTAVData* pOther )
{
  // frame rate, horizontal and vertical size, aspect ratio must fit for both videos
  TTMpeg2VideoStream* vid1 = (TTMpeg2VideoStream*) videoStream();
  TTMpeg2VideoStream* vid2 = (TTMpeg2VideoStream*) pOther->videoStream();
  if ( vid1->frameRate() != vid2->frameRate() )
    return false;
  if ( vid1->currentSequenceHeader()->horizontalSize() != vid2->currentSequenceHeader()->horizontalSize() )
    return false;
  if ( vid1->currentSequenceHeader()->verticalSize() != vid2->currentSequenceHeader()->verticalSize() )
    return false;
  if ( vid1->currentSequenceHeader()->aspectRatioText() != vid2->currentSequenceHeader()->aspectRatioText() )
    return false;

  // audio lists must be the same, ie. same number of tracks, and tracks have to fit each other
  if ( pOther->audioCount() != audioCount() )
    return false;
  for ( int i=0; i<audioCount(); ++i ) {
    TTAudioListDataItem& aud1 = audioItem(i);
    TTAudioListDataItem& aud2 = pOther->audioItem(i);
//     if ( aud1.getVersion() != aud2.getVersion() )
//       return false;
    if ( aud1.getBitrate() != aud2.getBitrate() )
      return false;
    if ( aud1.getSamplerate() != aud2.getSamplerate() )
      return false;
    if ( aud1.getMode() != aud2.getMode() )
      return false;
  }
  return true;
}
Exemplo n.º 2
0
NodeListItem*
MediaWindow::_FindNodeListItem(dormant_node_info* info)
{
	NodeListItem audioItem(info, MediaListItem::AUDIO_TYPE);
	NodeListItem videoItem(info, MediaListItem::VIDEO_TYPE);

	NodeListItem::Comparator audioComparator(&audioItem);
	NodeListItem::Comparator videoComparator(&videoItem);

	for (int32 i = 0; i < fListView->CountItems(); i++) {
		MediaListItem* item = static_cast<MediaListItem*>(fListView->ItemAt(i));
		item->Accept(audioComparator);
		if (audioComparator.result == 0)
			return static_cast<NodeListItem*>(item);

		item->Accept(videoComparator);
		if (videoComparator.result == 0)
			return static_cast<NodeListItem*>(item);
	}
	return NULL;
}