- (IBAction)openUserGuide:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL
- URLWithString:@"https://handbrake.fr/docs/en/1.1.0/advanced/custom-presets.html"]];
+ [[NSWorkspace sharedWorkspace] openURL:[HBUtilities.documentationURL URLByAppendingPathComponent:@"advanced/custom-presets.html"]];
}
@end
}
- (IBAction)openUserGuide:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL
- URLWithString:@"https://handbrake.fr/docs/en/1.1.0/"]];
+ [[NSWorkspace sharedWorkspace] openURL:HBUtilities.documentationURL];
}
@end
- (IBAction)openUserGuide:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL
- URLWithString:@"https://handbrake.fr/docs/en/1.1.0/advanced/audio-subtitle-defaults.html"]];
+ [[NSWorkspace sharedWorkspace] openURL:[HBUtilities.documentationURL URLByAppendingPathComponent:@"advanced/audio-subtitle-defaults.html"]];
}
- (void)dealloc
#include "hb.h"
// Text Styles
-static NSMutableParagraphStyle *ps;
static NSDictionary *detailAttr;
static NSDictionary *detailBoldAttr;
static NSDictionary *titleAttr;
- (void)initStyles
{
- if (!ps)
+ if (!detailAttr)
{
// Attributes
- ps = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
+ NSMutableParagraphStyle *ps = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
ps.headIndent = 88.0;
ps.paragraphSpacing = 1.0;
ps.tabStops = @[[[NSTextTab alloc] initWithType:
}
@end
-
return NO;
}
- NSURL *destURL = nil;
// Generate the file url and directories.
- if (self.job.container & 0x030000 /*HB_MUX_MASK_MP4*/)
- {
- // we use .m4v for our mp4 files so that ac3 and chapters in mp4 will play properly.
- destURL = [HBPreviewGenerator generateFileURLForType:@"m4v"];
- }
- else if (self.job.container & 0x300000 /*HB_MUX_MASK_MKV*/)
- {
- destURL = [HBPreviewGenerator generateFileURLForType:@"mkv"];
- }
- else if (self.job.container & 0x400000 /*HB_MUX_MASK_WEBM*/)
- {
- destURL = [HBPreviewGenerator generateFileURLForType:@"webm"];
- }
+ NSString *extension = [HBUtilities automaticExtForJob:self.job];
+ NSURL *destURL = [HBPreviewGenerator generateFileURLForType:extension];
// return if we couldn't get the fileURL.
if (!destURL)
@property (nonatomic, readonly) NSURL *fileURL;
/// The file URL at which the new file will be created.
-@property (nonatomic, readwrite, copy, nullable) NSURL *outputURL;
+@property (nonatomic, readonly, copy) NSURL *outputURL;
/// The name of the new file that will be created.
-@property (nonatomic, readwrite, copy, nullable) NSString *outputFileName;
+@property (nonatomic, readonly, copy) NSString *outputFileName;
/// The file URL at which the new file will be created.
-@property (nonatomic, readwrite, copy, nullable) NSURL *completeOutputURL;
+@property (nonatomic, readonly, copy) NSURL *completeOutputURL;
@property (nonatomic, readonly) NSAttributedString *attributedTitleDescription;
@property (nonatomic, readonly) NSAttributedString *attributedDescription;
- (IBAction)openUserGuide:(id)sender
{
- [[NSWorkspace sharedWorkspace] openURL:[NSURL
- URLWithString:@"https://handbrake.fr/docs/en/1.1.0/advanced/audio-subtitle-defaults.html"]];
+ [[NSWorkspace sharedWorkspace] openURL:[HBUtilities.documentationURL URLByAppendingPathComponent:@"advanced/audio-subtitle-defaults.html"]];
}
- (void)dealloc
*/
+ (nullable NSURL *)appSupportURL;
+/**
+ * Returns the url of the current version documentation.
+ */
+@property (nonatomic, readonly, class) NSURL *documentationURL;
+
/**
* Writes a message to standard error.
* The message will show up in the output panel and in the activity log.
return appSupportURL;
}
++ (NSURL *)documentationURL
+{
+ return [NSURL URLWithString:@"https://handbrake.fr/docs/en/1.2.0/"];
+}
+
+ (void)writeToActivityLog:(const char *)format, ...
{
va_list args;