{
hb_list_t * list;
hb_title_t * title;
- int indxpri=0; // Used to search the longuest title (default in combobox)
- int longuestpri=0; // Used to search the longuest title (default in combobox)
-
+ int feature_title=0; // Used to store the main feature title
list = hb_get_titles( fHandle );
@"%@/Desktop/%@.mp4", NSHomeDirectory(),[browsedSourceDisplayName stringByDeletingPathExtension]]];
}
-
- if (longuestpri < title->hours*60*60 + title->minutes *60 + title->seconds)
+ /* See if this is the main feature according to libhb */
+ if (title->index == title->job->feature)
{
- longuestpri=title->hours*60*60 + title->minutes *60 + title->seconds;
- indxpri=i;
+ feature_title = i;
}
[fSrcTitlePopUp addItemWithTitle: [NSString
}
else
{
- /* if not then select the longest title (dvd) */
- [fSrcTitlePopUp selectItemAtIndex: indxpri];
+ /* if not then select the main feature title */
+ [fSrcTitlePopUp selectItemAtIndex: feature_title];
}
[self titlePopUpChanged:nil];
* by one to keep in sync with the queue array
*/
currentQueueEncodeIndex--;
- [self writeToActivityLog: "removeQueueFileItem: Removing a cancelled/finished encode, decrement currentQueueEncodeIndex to %d", currentQueueEncodeIndex];
+
}
[QueueFileArray removeObjectAtIndex:queueItemToRemove];
[self saveQueueFileItem];
/* The number of seek points equals the number of seconds announced in the title as that is our current granularity */
- int title_duration_seconds = (title->hours * 3600) + (title->minutes * 60) + (title->seconds);
+ int title_duration_seconds = (title->hours * 3600) + (title->minutes * 60) + (title->seconds);
[queueFileJob setObject:[NSNumber numberWithInt:title_duration_seconds] forKey:@"SourceTotalSeconds"];
[queueFileJob setObject:[fDstFile2Field stringValue] forKey:@"DestinationPath"];
/*Audio*/
if ([fAudLang1PopUp indexOfSelectedItem] > 0)
{
- //[queueFileJob setObject:[fAudTrack1CodecPopUp indexOfSelectedItem] forKey:@"JobAudio1Encoder"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack1CodecPopUp selectedItem] tag]] forKey:@"JobAudio1Encoder"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack1MixPopUp selectedItem] tag]] forKey:@"JobAudio1Mixdown"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack1RatePopUp selectedItem] tag]] forKey:@"JobAudio1Samplerate"];
}
if ([fAudLang2PopUp indexOfSelectedItem] > 0)
{
- //[queueFileJob setObject:[fAudTrack1CodecPopUp indexOfSelectedItem] forKey:@"JobAudio2Encoder"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack2CodecPopUp selectedItem] tag]] forKey:@"JobAudio2Encoder"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack2MixPopUp selectedItem] tag]] forKey:@"JobAudio2Mixdown"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack2RatePopUp selectedItem] tag]] forKey:@"JobAudio2Samplerate"];
}
if ([fAudLang3PopUp indexOfSelectedItem] > 0)
{
- //[queueFileJob setObject:[fAudTrack1CodecPopUp indexOfSelectedItem] forKey:@"JobAudio3Encoder"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack3CodecPopUp selectedItem] tag]] forKey:@"JobAudio3Encoder"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack3MixPopUp selectedItem] tag]] forKey:@"JobAudio3Mixdown"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack3RatePopUp selectedItem] tag]] forKey:@"JobAudio3Samplerate"];
}
if ([fAudLang4PopUp indexOfSelectedItem] > 0)
{
- //[queueFileJob setObject:[fAudTrack1CodecPopUp indexOfSelectedItem] forKey:@"JobAudio4Encoder"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack4CodecPopUp selectedItem] tag]] forKey:@"JobAudio4Encoder"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack4MixPopUp selectedItem] tag]] forKey:@"JobAudio4Mixdown"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack4RatePopUp selectedItem] tag]] forKey:@"JobAudio4Samplerate"];
[queueFileJob setObject:[NSNumber numberWithInt:[[fAudTrack4BitratePopUp selectedItem] tag]] forKey:@"JobAudio4Bitrate"];
}
-
/* we need to auto relase the queueFileJob and return it */
[queueFileJob autorelease];
return queueFileJob;
/* We save all of the Queue data here */
[self saveQueueFileItem];
- /* We Reload the New Table data for presets */
- //[fPresetsOutlineView reloadData];
/* Since we have now marked a queue item as done
* we can go ahead and increment currentQueueEncodeIndex
* so that if there is anything left in the queue we can
* go ahead and move to the next item if we want to */
currentQueueEncodeIndex++ ;
- [self writeToActivityLog: "incrementQueueItemDone currentQueueEncodeIndex is incremented to: %d", currentQueueEncodeIndex];
int queueItems = [QueueFileArray count];
/* If we still have more items in our queue, lets go to the next one */
if (currentQueueEncodeIndex < queueItems)
{
- [self writeToActivityLog: "incrementQueueItemDone currentQueueEncodeIndex is incremented to: %d", currentQueueEncodeIndex];
- [self performNewQueueScan:[[QueueFileArray objectAtIndex:currentQueueEncodeIndex] objectForKey:@"SourcePath"] scanTitleNum:[[[QueueFileArray objectAtIndex:currentQueueEncodeIndex] objectForKey:@"TitleNumber"]intValue]];
+ [self performNewQueueScan:[[QueueFileArray objectAtIndex:currentQueueEncodeIndex] objectForKey:@"SourcePath"] scanTitleNum:[[[QueueFileArray objectAtIndex:currentQueueEncodeIndex] objectForKey:@"TitleNumber"]intValue]];
}
else
{
/* Tell HB to output a new activity log file for this encode */
[outputPanel startEncodeLog:[[QueueFileArray objectAtIndex:currentQueueEncodeIndex] objectForKey:@"DestinationPath"]];
-
- /* use a bool to determine whether or not we can decrypt using vlc */
+ /* use a bool to determine whether or not we can decrypt using vlc */
BOOL cancelScanDecrypt = 0;
/* set the bool so that showNewScan knows to apply the appropriate queue
- * settings as this is a queue rescan
- */
- //applyQueueToScan = YES;
+ * settings as this is a queue rescan
+ */
NSString *path = scanPath;
HBDVDDetector *detector = [HBDVDDetector detectorForPath:path];
[self writeToActivityLog: "scanning specifically for title: %d", scanTitleNum];
}
- [self writeToActivityLog: "performNewQueueScan currentQueueEncodeIndex is: %d", currentQueueEncodeIndex];
- /* We use our advance pref to determine how many previews to scan */
+ /* We use our advance pref to determine how many previews to scan */
int hb_num_previews = [[[NSUserDefaults standardUserDefaults] objectForKey:@"PreviewsNumber"] intValue];
hb_scan( fQueueEncodeLibhb, [path UTF8String], scanTitleNum, hb_num_previews, 0 );
}
[self writeToActivityLog: "Preset: %s", [[queueToApply objectForKey:@"PresetName"] UTF8String]];
[self writeToActivityLog: "processNewQueueEncode number of passes expected is: %d", ([[queueToApply objectForKey:@"VideoTwoPass"] intValue] + 1)];
job->file = [[queueToApply objectForKey:@"DestinationPath"] UTF8String];
- //[self writeToActivityLog: "processNewQueueEncode sending to prepareJob"];
[self prepareJob];
/*
free(subtitle);
}
-
/* We should be all setup so let 'er rip */
[self doRip];
}
}
[self videoMatrixChanged:nil];
- [self writeToActivityLog: "applyQueueSettingsToMainWindow: video matrix changed"];
+
/* Video framerate */
/* For video preset video framerate, we want to make sure that Same as source does not conflict with the
detected framerate in the fVidRatePopUp so we use index 0*/
[self audioTrackPopUpChanged: fAudLang4PopUp];
}
- [self writeToActivityLog: "applyQueueSettingsToMainWindow: audio set up"];
/*Subtitles*/
/* Crashy crashy right now, working on it */
[fSubtitlesDelegate setNewSubtitles:[queueToApply objectForKey:@"SubtitleList"]];
job->anamorphic.mode = [[queueToApply objectForKey:@"PicturePAR"] intValue];
job->modulus = [[queueToApply objectForKey:@"PictureModulus"] intValue];
- [self writeToActivityLog: "applyQueueSettingsToMainWindow: picture sizing set up"];
-
-
/* Filters */
/* We only allow *either* Decomb or Deinterlace. So check for the PictureDecombDeinterlace key.
[fPictureController SetTitle:fTitle];
[self calculatePictureSizing:nil];
- [self writeToActivityLog: "applyQueueSettingsToMainWindow: picture filters set up"];
/* somehow we need to figure out a way to tie the queue item to a preset if it used one */
//[queueFileJob setObject:[fPresetSelectedDisplay stringValue] forKey:@"PresetName"];
- // [queueFileJob setObject:[NSNumber numberWithInt:[fPresetsOutlineView selectedRow]] forKey:@"PresetIndexNum"];
+ //[queueFileJob setObject:[NSNumber numberWithInt:[fPresetsOutlineView selectedRow]] forKey:@"PresetIndexNum"];
if ([queueToApply objectForKey:@"PresetIndexNum"]) // This item used a preset so insert that info
{
/* Deselect the currently selected Preset if there is one*/
*/
/* Detelecine */
+ hb_filter_detelecine.settings = NULL;
if ([fPictureController detelecine] == 1)
{
/* use a custom detelecine string */
{
/* Decomb */
/* we add the custom string if present */
+ hb_filter_decomb.settings = NULL;
if ([fPictureController decomb] == 1)
{
/* use a custom decomb string */
[self writeToActivityLog: "Start / Stop set to seconds ..."];
/* Point A to Point B. Time to time in seconds.*/
- /* get the start seconds from the start seconds field */
+ /* get the start seconds from the start seconds field */
int start_seconds = [[queueToApply objectForKey:@"StartSeconds"] intValue];
job->pts_to_start = start_seconds * 90000LL;
/* Stop seconds is actually the duration of encode, so subtract the end seconds from the start seconds */
int stop_seconds = [[queueToApply objectForKey:@"StopSeconds"] intValue];
job->pts_to_stop = stop_seconds * 90000LL;
-
- /* A bunch of verbose activity log messages to check on what should be expected */
- [self writeToActivityLog: "point a to b should start at: %d seconds", start_seconds];
- [self writeToActivityLog: "point a to b should start at (hh:mm:ss): %d:%d:%d", start_seconds / 3600, ( start_seconds / 60 ) % 60,start_seconds % 60];
- [self writeToActivityLog: "point a to b duration: %d seconds", stop_seconds];
- [self writeToActivityLog: "point a to b duration (hh:mm:ss): %d:%d:%d", stop_seconds / 3600, ( stop_seconds / 60 ) % 60,stop_seconds % 60];
- [self writeToActivityLog: "point a to b should end at: %d seconds", start_seconds + stop_seconds];
- [self writeToActivityLog: "point a to b should end at (hh:mm:ss): %d:%d:%d", (start_seconds + stop_seconds) / 3600, ( (start_seconds + stop_seconds) / 60 ) % 60,(start_seconds + stop_seconds) % 60];
+
}
else if ([[queueToApply objectForKey:@"fEncodeStartStop"] intValue] == 2)
{
[self writeToActivityLog: "Start / Stop set to frames ..."];
/* Point A to Point B. Frame to frame */
- /* get the start frame from the start frame field */
+ /* get the start frame from the start frame field */
int start_frame = [[queueToApply objectForKey:@"StartFrame"] intValue];
job->frame_to_start = start_frame;
/* get the frame to stop on from the end frame field */
int stop_frame = [[queueToApply objectForKey:@"StopFrame"] intValue];
job->frame_to_stop = stop_frame;
-
- /* A bunch of verbose activity log messages to check on what should be expected */
- [self writeToActivityLog: "point a to b should start at frame %d", start_frame];
- [self writeToActivityLog: "point a to b duration: %d frames", stop_frame];
- [self writeToActivityLog: "point a to b should end at frame %d", start_frame + stop_frame];
+
}
* The order of the filters is critical
*/
/* Detelecine */
+ hb_filter_detelecine.settings = NULL;
if ([[queueToApply objectForKey:@"PictureDetelecine"] intValue] == 1)
{
/* use a custom detelecine string */
{
/* Decomb */
/* we add the custom string if present */
+ hb_filter_decomb.settings = NULL;
if ([[queueToApply objectForKey:@"PictureDecomb"] intValue] == 1)
{
/* use a custom decomb string */
// FAAC
menuItem = [[audiocodecPopUp menu] addItemWithTitle:@"AAC (faac)" action: NULL keyEquivalent: @""];
[menuItem setTag: HB_ACODEC_FAAC];
+ // MP3
+ menuItem = [[audiocodecPopUp menu] addItemWithTitle:@"MP3 (lame)" action: NULL keyEquivalent: @""];
+ [menuItem setTag: HB_ACODEC_LAME];
// AC3 Passthru
menuItem = [[audiocodecPopUp menu] addItemWithTitle:@"AC3 Passthru" action: NULL keyEquivalent: @""];
[menuItem setTag: HB_ACODEC_AC3];
{
/* FAAC has a minimum of 192 kbps for 6-channel discrete */
minbitrate = 192;
- /* If either mixdown popup includes 6-channel discrete, then allow up to 448 kbps */
- maxbitrate = 448;
+ /* If either mixdown popup includes 6-channel discrete, then allow up to 768 kbps */
+ maxbitrate = 768;
break;
}
else
{
/* FAAC is happy using our min bitrate of 32 kbps for stereo or mono */
minbitrate = 32;
- /* FAAC won't honour anything more than 160 for stereo, so let's not offer it */
/* note: haven't dealt with mono separately here, FAAC will just use the max it can */
- maxbitrate = 160;
+ maxbitrate = 320;
break;
}