- sequence_id = job->sequence_id;
-
- chapter_start = job->chapter_start;
- chapter_end = job->chapter_end;
- chapter_markers = job->chapter_markers;
- memcpy(crop, job->crop, sizeof(crop));
- deinterlace = job->deinterlace;
- width = job->width;
- height = job->height;
- keep_ratio = job->keep_ratio;
- grayscale = job->grayscale;
- pixel_ratio = job->pixel_ratio;
- pixel_aspect_width = job->pixel_aspect_width;
- pixel_aspect_height = job->pixel_aspect_height;
- vcodec = job->vcodec;
- vquality = job->vquality;
- vbitrate = job->vbitrate;
- vrate = job->vrate;
- vrate_base = job->vrate_base;
- pass = job->pass;
- h264_level = job->h264_level;
- crf = job->crf;
- if (job->x264opts)
- x264opts = [[NSString stringWithUTF8String:job->x264opts] retain];
- /* So, with the advent of job->list_audio's I decided why not just use an NSString and concatanate
- all of the info we need for all of the audio values to display right into an NSString here ? So I
- did. I have no idea why we are reading libhb stuff just to display it in the queue gui. So here we
- are with a huge string. But its easy to change and saves alot of messing about. Maybe we move a bunch
- of other display stuff into strings for display for each job. It's not like they have to actually do
- anything.*/
- hb_audio_config_t * audio;
- NSString * thisJobAudioCodecs = [NSString stringWithFormat:@""];
- NSString * thisJobAudioInfo = [NSString stringWithFormat:@""];
- for( int i = 0; i < hb_list_count(job->list_audio); i++ )
- {
- audio = (hb_audio_config_t *) hb_list_audio_config_item( job->list_audio, i );
- /* Output Codec */
- NSString *outputCodec;
- if (audio->out.codec == HB_ACODEC_AC3)
- outputCodec = @"AC3";
- else if (audio->out.codec == HB_ACODEC_FAAC)
- outputCodec = @"AAC";
- else if (audio->out.codec == HB_ACODEC_LAME)
- outputCodec = @"MP3";
- else if (audio->out.codec == HB_ACODEC_VORBIS)
- outputCodec = @"Vorbis";
- else
- outputCodec = @"Unknown Codec";
- /* Add the codec to the audio codecs list ( We should check against dupes)*/
- thisJobAudioCodecs = [thisJobAudioCodecs stringByAppendingString:[NSString stringWithFormat:@" %@,",outputCodec]];
- if (i > 0)
- {
- /* Insert a line break so that we get each track on a separate line */
- /* Wicked HACK alert!!, use 18 whitespaces to align offset in display for list > 2 to offset "Audio" in the queue display
- Please Fix Me because this is embarrassing (but it works) */
- thisJobAudioInfo = [thisJobAudioInfo stringByAppendingString:@"\n "];
- }
- /* Detailed Job audio track info*/
- /* Track Number and Mixdown Info */
- if (audio->out.mixdown == HB_ACODEC_AC3)// Remember for ac3 passthru the mixdown uses the source codec
- thisJobAudioInfo = [thisJobAudioInfo stringByAppendingString:[NSString stringWithFormat:@"Track %d: Source: %@ Output: %@, Pass-Thru", i + 1, [NSString stringWithUTF8String:audio->lang.description], outputCodec]];
- else if (audio->out.mixdown == HB_AMIXDOWN_MONO)
- thisJobAudioInfo = [thisJobAudioInfo stringByAppendingString:[NSString stringWithFormat:@"Track %d: Source: %@ Output: %@, Mono", i + 1, [NSString stringWithUTF8String:audio->lang.description], outputCodec]];
- else if (audio->out.mixdown == HB_AMIXDOWN_STEREO)
- thisJobAudioInfo = [thisJobAudioInfo stringByAppendingString:[NSString stringWithFormat:@"Track %d: Source: %@ Output: %@, Stereo", i + 1, [NSString stringWithUTF8String:audio->lang.description], outputCodec]];
- else if (audio->out.mixdown == HB_AMIXDOWN_DOLBY)
- thisJobAudioInfo = [thisJobAudioInfo stringByAppendingString:[NSString stringWithFormat:@"Track %d: Source: %@ Output: %@, Dolby Surround", i + 1, [NSString stringWithUTF8String:audio->lang.description], outputCodec]];
- else if (audio->out.mixdown == HB_AMIXDOWN_DOLBYPLII)
- thisJobAudioInfo = [thisJobAudioInfo stringByAppendingString:[NSString stringWithFormat:@"Track %d: Source: %@ Output: %@, Dolby Pro Logic II", i + 1, [NSString stringWithUTF8String:audio->lang.description], outputCodec]];
- else if (audio->out.mixdown == HB_AMIXDOWN_6CH)
- thisJobAudioInfo = [thisJobAudioInfo stringByAppendingString:[NSString stringWithFormat:@"Track %d: Source: %@ Output: %@, 6 Channel Discreet", i + 1, [NSString stringWithUTF8String:audio->lang.description], outputCodec]];
- else
- thisJobAudioInfo = [thisJobAudioInfo stringByAppendingString:[NSString stringWithFormat:@"Track %d: Source: %@ Output: Unknown Codec Info", i + 1, [NSString stringWithUTF8String:audio->lang.description]]];
-
- thisJobAudioInfo = [thisJobAudioInfo stringByAppendingString:[NSString stringWithFormat:@", %d kbps, %d Hz", audio->out.bitrate, audio->out.samplerate]];
-
- }
- audioinfo_summary = [[NSString stringWithFormat:@"%@",thisJobAudioInfo]retain];
- audioinfo_codecs = [[NSString stringWithFormat:@"%@",thisJobAudioCodecs]retain];
-
- subtitle = job->subtitle;
- mux = job->mux;
- if (job->file)
- file = [[NSString stringWithUTF8String:job->file] retain];
- if (job->title->name)
- titleName = [[NSString stringWithUTF8String:job->title->name] retain];
- titleIndex = job->title->index;
- titleWidth = job->title->width;
- titleHeight = job->title->height;
- if (job->subtitle >= 0)
- {
- hb_subtitle_t * aSubtitle = (hb_subtitle_t *) hb_list_item(job->title->list_subtitle, job->subtitle);
- if (aSubtitle)
- subtitleLang = [[NSString stringWithUTF8String:aSubtitle->lang] retain];
- }
-
- // Calculate and store output dimensions and anamorphic dimensions
- if (pixel_ratio == 1) // Original PAR Implementation, now called Strict Anamorphic
- {
- output_width = titleWidth - crop[2] - crop[3];
- output_height = titleHeight - crop[0] - crop[1];
- anamorphic_width = output_width * pixel_aspect_width / pixel_aspect_height;
- anamorphic_height = output_height;
- }
- else if (pixel_ratio == 2) // Loose Anamorphic
- {
- // call hb_set_anamorphic_size to do a "dry run" to get the values to be
- // used by libhb for loose anamorphic.
- int par_width, par_height;
- hb_set_anamorphic_size(job, &output_width, &output_height, &par_width, &par_height);
- anamorphic_width = output_width * par_width / par_height;
- anamorphic_height = output_height;
- }
- else // No Anamorphic
- {
- output_width = width;
- output_height = height;
- anamorphic_width = 0; // not needed for this case
- anamorphic_height = 0; // not needed for this case
- }
-
- }
- return self;
-}
-
-- (void) dealloc
-{
- // jobGroup is a weak reference and does not need to be deleted
- [x264opts release];
- [file release];
- [titleName release];
- [subtitleLang release];
- [audioinfo_summary release];
- [audioinfo_codecs release];
- [super dealloc];
-}