summaryrefslogtreecommitdiffstats
path: root/macosx/HBJob+HBJobConversion.m
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2020-09-24 20:19:58 +0200
committerDamiano Galassi <[email protected]>2020-09-24 20:19:58 +0200
commit918177ac8fda9d0f59ec0cdb3b0e7c3cc06241a8 (patch)
tree964a32ee5e0fc05b48e9be54132b4fe18c63c324 /macosx/HBJob+HBJobConversion.m
parent320d80114ae49e48acf5ee8ce73c714d2451564a (diff)
MacGui: add pad filter ui, move rotate filter to the dimensions tab.
Diffstat (limited to 'macosx/HBJob+HBJobConversion.m')
-rw-r--r--macosx/HBJob+HBJobConversion.m34
1 files changed, 32 insertions, 2 deletions
diff --git a/macosx/HBJob+HBJobConversion.m b/macosx/HBJob+HBJobConversion.m
index f6c09b9a5..e2cc973c9 100644
--- a/macosx/HBJob+HBJobConversion.m
+++ b/macosx/HBJob+HBJobConversion.m
@@ -23,6 +23,8 @@
#import "HBAudio.h"
#import "HBSubtitles.h"
+#import "NSDictionary+HBAdditions.h"
+
@implementation HBJob (HBJobConversion)
- (NSDictionary *)jobDict
@@ -526,12 +528,40 @@
}
// Add rotate filter
- if (self.filters.rotate || self.filters.flip)
+ if (self.picture.rotate || self.picture.flip)
{
int filter_id = HB_FILTER_ROTATE;
hb_dict_t *filter_dict = hb_generate_filter_settings(filter_id,
NULL, NULL,
- [NSString stringWithFormat:@"angle=%d:hflip=%d", self.filters.rotate, self.filters.flip].UTF8String);
+ [NSString stringWithFormat:@"angle=%d:hflip=%d", self.picture.rotate, self.picture.flip].UTF8String);
+
+ filter = hb_filter_init(filter_id);
+ hb_add_filter_dict(job, filter, filter_dict);
+ hb_dict_free(&filter_dict);
+ }
+
+ if (self.picture.paddingMode != HBPicturePaddingModeNone)
+ {
+ int filter_id = HB_FILTER_PAD;
+ NSString *color;
+ switch (self.picture.paddingColorMode) {
+ case HBPicturePaddingColorModeBlack:
+ color = @"black";
+ break;
+ case HBPicturePaddingColorModeWhite:
+ color = @"white";
+ break;
+ case HBPicturePaddingColorModeCustom:
+ color = self.picture.paddingColorCustom;
+ break;
+ }
+ NSString *settings = [NSString stringWithFormat:@"width=%d:height=%d:color=%@:x=%d:y=%d",
+ self.picture.width + self.picture.paddingLeft + self.picture.paddingRight,
+ self.picture.height + self.picture.paddingTop + self.picture.paddingBottom,
+ color,
+ self.picture.paddingRight,
+ self.picture.paddingTop];
+ hb_dict_t *filter_dict = hb_generate_filter_settings(filter_id, NULL, NULL, settings.UTF8String);
filter = hb_filter_init(filter_id);
hb_add_filter_dict(job, filter, filter_dict);