Commit dc7a2831 authored by David Fuhrmann's avatar David Fuhrmann

macosx: modernize CAS panel and code

parent b7167cb3
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -24,106 +24,117 @@
#import <Cocoa/Cocoa.h>
#import "SharedDialogs.h"
@class VLCDropDisabledImageView;
@class VLCDragDropView;
@interface VLCConvertAndSave : NSObject
{
IBOutlet id _window;
IBOutlet id _ok_btn;
IBOutlet id _drop_lbl;
IBOutlet id _drop_image_view;
IBOutlet id _drop_btn;
IBOutlet id _drop_box;
IBOutlet id _profile_lbl;
IBOutlet id _profile_pop;
IBOutlet id _profile_btn;
IBOutlet id _destination_box;
IBOutlet id _destination_lbl;
IBOutlet id _destination_browse_btn;
IBOutlet id _destination_icon_view;
IBOutlet id _destination_filename_lbl;
IBOutlet id _destination_filename_stub_lbl;
IBOutlet id _destination_stream_btn;
IBOutlet id _destination_stream_lbl;
IBOutlet id _destination_itwantafile_btn;
IBOutlet id _destination_itwantastream_btn;
IBOutlet id _destination_itwantafile_view;
IBOutlet id _destination_itwantastream_view;
IBOutlet id _destination_cancel_btn;
IBOutlet id _dropin_view;
IBOutlet id _dropin_icon_view;
IBOutlet id _dropin_media_lbl;
IBOutlet id _customize_panel;
IBOutlet id _customize_ok_btn;
IBOutlet id _customize_cancel_btn;
IBOutlet id _customize_newProfile_btn;
IBOutlet id _customize_tabview;
IBOutlet id _customize_encap_matrix;
IBOutlet id _customize_vid_settings_box;
IBOutlet id _customize_vid_ckb;
IBOutlet id _customize_vid_keep_ckb;
IBOutlet id _customize_vid_codec_lbl;
IBOutlet id _customize_vid_codec_pop;
IBOutlet id _customize_vid_bitrate_lbl;
IBOutlet id _customize_vid_bitrate_fld;
IBOutlet id _customize_vid_framerate_lbl;
IBOutlet id _customize_vid_framerate_fld;
IBOutlet id _customize_vid_res_box;
IBOutlet id _customize_vid_res_lbl;
IBOutlet id _customize_vid_width_lbl;
IBOutlet id _customize_vid_width_fld;
IBOutlet id _customize_vid_height_lbl;
IBOutlet id _customize_vid_height_fld;
IBOutlet id _customize_vid_scale_lbl;
IBOutlet id _customize_vid_scale_pop;
IBOutlet id _customize_aud_settings_box;
IBOutlet id _customize_aud_ckb;
IBOutlet id _customize_aud_keep_ckb;
IBOutlet id _customize_aud_codec_lbl;
IBOutlet id _customize_aud_codec_pop;
IBOutlet id _customize_aud_bitrate_lbl;
IBOutlet id _customize_aud_bitrate_fld;
IBOutlet id _customize_aud_channels_lbl;
IBOutlet id _customize_aud_channels_fld;
IBOutlet id _customize_aud_samplerate_lbl;
IBOutlet id _customize_aud_samplerate_pop;
IBOutlet id _customize_subs_ckb;
IBOutlet id _customize_subs_pop;
IBOutlet id _customize_subs_overlay_ckb;
IBOutlet id _stream_panel;
IBOutlet id _stream_cancel_btn;
IBOutlet id _stream_ok_btn;
IBOutlet id _stream_destination_lbl;
IBOutlet id _stream_announcement_lbl;
IBOutlet id _stream_type_lbl;
IBOutlet id _stream_type_pop;
IBOutlet id _stream_address_lbl;
IBOutlet id _stream_address_fld;
IBOutlet id _stream_ttl_lbl;
IBOutlet id _stream_ttl_fld;
IBOutlet id _stream_ttl_stepper;
IBOutlet id _stream_port_lbl;
IBOutlet id _stream_port_fld;
IBOutlet id _stream_sap_ckb;
IBOutlet id _stream_channel_fld;
IBOutlet id _stream_sdp_matrix;
IBOutlet id _stream_sdp_fld;
IBOutlet id _stream_sdp_browsefile_btn;
}
// main panel
@property (weak) IBOutlet NSWindow *window;
@property (weak) IBOutlet VLCDragDropView *dropBox;
@property (weak) IBOutlet NSTextField *dropLabel;
@property (weak) IBOutlet VLCDropDisabledImageView *dropImage;
@property (weak) IBOutlet NSButton *dropButton;
@property (weak) IBOutlet NSTextField *profileLabel;
@property (weak) IBOutlet NSPopUpButton *profilePopup;
@property (weak) IBOutlet NSButton *customizeButton;
@property (weak) IBOutlet NSTextField *destinationLabel;
@property (weak) IBOutlet NSBox *destinationBox;
@property (weak) IBOutlet NSButton *destinationCancelBtn;
@property (weak) IBOutlet NSButton *destinationStreamButton;
@property (weak) IBOutlet NSButton *destinationFileButton;
@property (weak) IBOutlet NSButton *okButton;
@property (weak) IBOutlet NSView *dropinView;
@property (weak) IBOutlet VLCDropDisabledImageView *dropinIcon;
@property (weak) IBOutlet NSTextField *dropinMediaLabel;
@property (weak) IBOutlet NSView *fileDestinationView;
@property (weak) IBOutlet NSImageView *fileDestinationIcon;
@property (weak) IBOutlet NSTextField *fileDestinationFileName;
@property (weak) IBOutlet NSTextField *fileDestinationFileNameStub;
@property (weak) IBOutlet NSButton *fileDestinationBrowseButton;
@property (weak) IBOutlet NSView *streamDestinationView;
@property (weak) IBOutlet NSTextField *streamDestinationURLLabel;
@property (weak) IBOutlet NSButton *streamDestinationButton;
// customize panel
@property (weak) IBOutlet NSWindow *customizePanel;
@property (weak) IBOutlet NSButton *customizeNewProfileButton;
@property (weak) IBOutlet NSButton *customizeCancelButton;
@property (weak) IBOutlet NSButton *customizeOkButton;
@property (weak) IBOutlet NSTabView *customizeTabView;
@property (weak) IBOutlet NSMatrix *customizeEncapMatrix;
// customize panel: video
@property (weak) IBOutlet NSButton *customizeVidCheckbox;
@property (weak) IBOutlet NSButton *customizeVidKeepCheckbox;
@property (weak) IBOutlet NSBox *customizeVidSettingsBox;
@property (weak) IBOutlet NSTextField *customizeVidCodecLabel;
@property (weak) IBOutlet NSTextField *customizeVidBitrateLabel;
@property (weak) IBOutlet NSTextField *customizeVidFramerateLabel;
@property (weak) IBOutlet NSBox *customizeVidResolutionBox;
@property (weak) IBOutlet NSTextField *customizeVidWidthLabel;
@property (weak) IBOutlet NSTextField *customizeVidHeightLabel;
@property (weak) IBOutlet NSTextField *customizeVidScaleLabel;
@property (weak) IBOutlet NSTextField *customizeVidResLabel;
@property (weak) IBOutlet NSPopUpButton *customizeVidCodecPopup;
@property (weak) IBOutlet NSTextField *customizeVidBitrateField;
@property (weak) IBOutlet NSTextField *customizeVidFramerateField;
@property (weak) IBOutlet NSTextField *customizeVidWidthField;
@property (weak) IBOutlet NSTextField *customizeVidHeightField;
@property (weak) IBOutlet NSPopUpButton *customizeVidScalePopup;
// customize panel: audio
@property (weak) IBOutlet NSButton *customizeAudCheckbox;
@property (weak) IBOutlet NSButton *customizeAudKeepCheckbox;
@property (weak) IBOutlet NSBox *customizeAudSettingsBox;
@property (weak) IBOutlet NSTextField *customizeAudCodecLabel;
@property (weak) IBOutlet NSTextField *customizeAudBitrateLabel;
@property (weak) IBOutlet NSTextField *customizeAudChannelsLabel;
@property (weak) IBOutlet NSTextField *customizeAudSamplerateLabel;
@property (weak) IBOutlet NSPopUpButton *customizeAudCodecPopup;
@property (weak) IBOutlet NSTextField *customizeAudBitrateField;
@property (weak) IBOutlet NSTextField *customizeAudChannelsField;
@property (weak) IBOutlet NSPopUpButton *customizeAudSampleratePopup;
// customize panel: subs
@property (weak) IBOutlet NSButton *customizeSubsCheckbox;
@property (weak) IBOutlet NSButton *customizeSubsOverlayCheckbox;
@property (weak) IBOutlet NSPopUpButton *customizeSubsPopup;
// stream panel
@property (weak) IBOutlet NSWindow *streamPanel;
@property (weak) IBOutlet NSTextField *streamDestinationLabel;
@property (weak) IBOutlet NSTextField *streamTypeLabel;
@property (weak) IBOutlet NSTextField *streamAddressLabel;
@property (weak) IBOutlet NSPopUpButton *streamTypePopup;
@property (weak) IBOutlet NSTextField *streamAddressField;
@property (weak) IBOutlet NSTextField *streamTTLLabel;
@property (weak) IBOutlet NSTextField *streamTTLField;
@property (weak) IBOutlet NSStepper *streamTTLStepper;
@property (weak) IBOutlet NSTextField *streamPortLabel;
@property (weak) IBOutlet NSTextField *streamPortField;
@property (weak) IBOutlet NSTextField *streamAnnouncementLabel;
@property (weak) IBOutlet NSButton *streamSAPCheckbox;
@property (weak) IBOutlet NSTextField *streamChannelField;
@property (weak) IBOutlet NSMatrix *streamSDPMatrix;
@property (weak) IBOutlet NSButton *streamSDPFileBrowseButton;
@property (weak) IBOutlet NSTextField *streamSDPField;
@property (weak) IBOutlet NSButton *streamCancelButton;
@property (weak) IBOutlet NSButton *streamOkButton;
// other properties
@property (readwrite, nonatomic, retain) NSString * MRL;
@property (readwrite, nonatomic, retain) NSString * outputDestination;
@property (readwrite, retain) NSArray * profileNames;
@property (readwrite, retain) NSArray * profileValueList;
@property (readwrite, retain) NSMutableArray * currentProfile;
/* Bindings for field / stepper combis */
// Bindings for field / stepper combis
@property (nonatomic) int vidBitrate;
@property (nonatomic) int vidFramerate;
@property (nonatomic) int audBitrate;
......
......@@ -24,6 +24,8 @@
#import "ConvertAndSave.h"
#import "intf.h"
#import "playlist.h"
#import "misc.h"
#import <vlc_common.h>
#import <vlc_url.h>
......@@ -131,70 +133,73 @@
- (void)awakeFromNib
{
[_window setTitle: _NS("Convert & Stream")];
[_ok_btn setTitle: _NS("Go!")];
[_drop_lbl setStringValue: _NS("Drop media here")];
[_drop_btn setTitle: _NS("Open media...")];
[_profile_lbl setStringValue: _NS("Choose Profile")];
[_profile_btn setTitle: _NS("Customize...")];
[_destination_lbl setStringValue: _NS("Choose Destination")];
[_destination_filename_stub_lbl setStringValue: _NS("Choose an output location")];
[_destination_filename_lbl setHidden: YES];
[_destination_browse_btn setTitle:_NS("Browse...")];
[_destination_stream_btn setTitle:_NS("Setup Streaming...")];
[_destination_stream_lbl setStringValue:@"Select Streaming Method"];
[_destination_itwantafile_btn setTitle:_NS("Save as File")];
[_destination_itwantastream_btn setTitle:_NS("Stream")];
[_destination_cancel_btn setHidden:YES];
[_customize_ok_btn setTitle: _NS("Apply")];
[_customize_cancel_btn setTitle: _NS("Cancel")];
[_customize_newProfile_btn setTitle: _NS("Save as new Profile...")];
[[_customize_tabview tabViewItemAtIndex:0] setLabel: _NS("Encapsulation")];
[[_customize_tabview tabViewItemAtIndex:1] setLabel: _NS("Video codec")];
[[_customize_tabview tabViewItemAtIndex:2] setLabel: _NS("Audio codec")];
[[_customize_tabview tabViewItemAtIndex:3] setLabel: _NS("Subtitles")];
[_customize_tabview selectTabViewItemAtIndex: 0];
[_customize_vid_ckb setTitle: _NS("Video")];
[_customize_vid_keep_ckb setTitle: _NS("Keep original video track")];
[_customize_vid_codec_lbl setStringValue: _NS("Codec")];
[_customize_vid_bitrate_lbl setStringValue: _NS("Bitrate")];
[_customize_vid_framerate_lbl setStringValue: _NS("Frame rate")];
[_customize_vid_res_box setTitle: _NS("Resolution")];
[_customize_vid_res_lbl setStringValue: _NS("You just need to fill one of the three following parameters, VLC will autodetect the other using the original aspect ratio")];
[_customize_vid_width_lbl setStringValue: _NS("Width")];
[_customize_vid_height_lbl setStringValue: _NS("Height")];
[_customize_vid_scale_lbl setStringValue: _NS("Scale")];
[_customize_aud_ckb setTitle: _NS("Audio")];
[_customize_aud_keep_ckb setTitle: _NS("Keep original audio track")];
[_customize_aud_codec_lbl setStringValue: _NS("Codec")];
[_customize_aud_bitrate_lbl setStringValue: _NS("Bitrate")];
[_customize_aud_channels_lbl setStringValue: _NS("Channels")];
[_customize_aud_samplerate_lbl setStringValue: _NS("Samplerate")];
[_customize_subs_ckb setTitle: _NS("Subtitles")];
[_customize_subs_overlay_ckb setTitle: _NS("Overlay subtitles on the video")];
[_stream_ok_btn setTitle: _NS("Apply")];
[_stream_cancel_btn setTitle: _NS("Cancel")];
[_stream_destination_lbl setStringValue:_NS("Stream Destination")];
[_stream_announcement_lbl setStringValue:_NS("Stream Announcement")];
[_stream_type_lbl setStringValue:_NS("Type")];
[_stream_address_lbl setStringValue:_NS("Address")];
[_stream_ttl_lbl setStringValue:_NS("TTL")];
[_stream_ttl_fld setEnabled:NO];
[_stream_ttl_stepper setEnabled:NO];
[_stream_port_lbl setStringValue:_NS("Port")];
[_stream_sap_ckb setStringValue:_NS("SAP Announcement")];
[[_stream_sdp_matrix cellWithTag:0] setTitle:_NS("None")];
[[_stream_sdp_matrix cellWithTag:1] setTitle:_NS("HTTP Announcement")];
[[_stream_sdp_matrix cellWithTag:2] setTitle:_NS("RTSP Announcement")];
[[_stream_sdp_matrix cellWithTag:3] setTitle:_NS("Export SDP as file")];
[_stream_sap_ckb setState:NSOffState];
[_stream_sdp_matrix setEnabled:NO];
[_okButton setTitle: _NS("Go!")];
[_dropLabel setStringValue: _NS("Drop media here")];
[_dropButton setTitle: _NS("Open media...")];
[_profileLabel setStringValue: _NS("Choose Profile")];
[_customizeButton setTitle: _NS("Customize...")];
[_destinationLabel setStringValue: _NS("Choose Destination")];
[_fileDestinationFileNameStub setStringValue: _NS("Choose an output location")];
[_fileDestinationFileName setHidden: YES];
[_fileDestinationBrowseButton setTitle:_NS("Browse...")];
[_streamDestinationButton setTitle:_NS("Setup Streaming...")];
[_streamDestinationURLLabel setStringValue:@"Select Streaming Method"];
[_destinationFileButton setTitle:_NS("Save as File")];
[_destinationStreamButton setTitle:_NS("Stream")];
[_destinationCancelBtn setHidden:YES];
[_customizeOkButton setTitle: _NS("Apply")];
[_customizeCancelButton setTitle: _NS("Cancel")];
[_customizeNewProfileButton setTitle: _NS("Save as new Profile...")];
[[_customizeTabView tabViewItemAtIndex:0] setLabel: _NS("Encapsulation")];
[[_customizeTabView tabViewItemAtIndex:1] setLabel: _NS("Video codec")];
[[_customizeTabView tabViewItemAtIndex:2] setLabel: _NS("Audio codec")];
[[_customizeTabView tabViewItemAtIndex:3] setLabel: _NS("Subtitles")];
[_customizeTabView selectTabViewItemAtIndex: 0];
[_customizeVidCheckbox setTitle: _NS("Video")];
[_customizeVidKeepCheckbox setTitle: _NS("Keep original video track")];
[_customizeVidCodecLabel setStringValue: _NS("Codec")];
[_customizeVidBitrateLabel setStringValue: _NS("Bitrate")];
[_customizeVidFramerateLabel setStringValue: _NS("Frame rate")];
[_customizeVidResolutionBox setTitle: _NS("Resolution")];
[_customizeVidResLabel setStringValue: _NS("You just need to fill one of the three following parameters, VLC will autodetect the other using the original aspect ratio")];
[_customizeVidWidthLabel setStringValue: _NS("Width")];
[_customizeVidHeightLabel setStringValue: _NS("Height")];
[_customizeVidScaleLabel setStringValue: _NS("Scale")];
[_customizeAudCheckbox setTitle: _NS("Audio")];
[_customizeAudKeepCheckbox setTitle: _NS("Keep original audio track")];
[_customizeAudCodecLabel setStringValue: _NS("Codec")];
[_customizeAudBitrateLabel setStringValue: _NS("Bitrate")];
[_customizeAudChannelsLabel setStringValue: _NS("Channels")];
[_customizeAudSamplerateLabel setStringValue: _NS("Samplerate")];
[_customizeSubsCheckbox setTitle: _NS("Subtitles")];
[_customizeSubsOverlayCheckbox setTitle: _NS("Overlay subtitles on the video")];
[_streamOkButton setTitle: _NS("Apply")];
[_streamCancelButton setTitle: _NS("Cancel")];
[_streamDestinationLabel setStringValue:_NS("Stream Destination")];
[_streamAnnouncementLabel setStringValue:_NS("Stream Announcement")];
[_streamTypeLabel setStringValue:_NS("Type")];
[_streamAddressLabel setStringValue:_NS("Address")];
[_streamTTLLabel setStringValue:_NS("TTL")];
[_streamTTLStepper setEnabled:NO];
[_streamPortLabel setStringValue:_NS("Port")];
[_streamSAPCheckbox setStringValue:_NS("SAP Announcement")];
[[_streamSDPMatrix cellWithTag:0] setTitle:_NS("None")];
[[_streamSDPMatrix cellWithTag:1] setTitle:_NS("HTTP Announcement")];
[[_streamSDPMatrix cellWithTag:2] setTitle:_NS("RTSP Announcement")];
[[_streamSDPMatrix cellWithTag:3] setTitle:_NS("Export SDP as file")];
[_streamSAPCheckbox setState:NSOffState];
[_streamSDPMatrix setEnabled:NO];
/* there is no way to hide single cells, so replace the existing ones with empty cells.. */
id blankCell = [[NSCell alloc] init];
[blankCell setEnabled:NO];
[_customize_encap_matrix putCell:blankCell atRow:3 column:1];
[_customize_encap_matrix putCell:blankCell atRow:3 column:2];
[_customize_encap_matrix putCell:blankCell atRow:3 column:3];
[_customizeEncapMatrix putCell:blankCell atRow:3 column:1];
[_customizeEncapMatrix putCell:blankCell atRow:3 column:2];
[_customizeEncapMatrix putCell:blankCell atRow:3 column:3];
/* fetch profiles from defaults */
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
......@@ -215,36 +220,36 @@
[NSArray arrayWithObjects:@"dvbs", @"t140", nil],
nil];
[_customize_vid_codec_pop removeAllItems];
[_customize_vid_scale_pop removeAllItems];
[_customize_aud_codec_pop removeAllItems];
[_customize_aud_samplerate_pop removeAllItems];
[_customize_subs_pop removeAllItems];
[_customize_vid_codec_pop addItemsWithTitles:[_videoCodecs firstObject]];
[_customize_aud_codec_pop addItemsWithTitles:[_audioCodecs firstObject]];
[_customize_subs_pop addItemsWithTitles:[_subsCodecs firstObject]];
[_customize_aud_samplerate_pop addItemWithTitle:@"8000"];
[_customize_aud_samplerate_pop addItemWithTitle:@"11025"];
[_customize_aud_samplerate_pop addItemWithTitle:@"22050"];
[_customize_aud_samplerate_pop addItemWithTitle:@"44100"];
[_customize_aud_samplerate_pop addItemWithTitle:@"48000"];
[_customize_vid_scale_pop addItemWithTitle:@"1"];
[_customize_vid_scale_pop addItemWithTitle:@"0.25"];
[_customize_vid_scale_pop addItemWithTitle:@"0.5"];
[_customize_vid_scale_pop addItemWithTitle:@"0.75"];
[_customize_vid_scale_pop addItemWithTitle:@"1.25"];
[_customize_vid_scale_pop addItemWithTitle:@"1.5"];
[_customize_vid_scale_pop addItemWithTitle:@"1.75"];
[_customize_vid_scale_pop addItemWithTitle:@"2"];
[_ok_btn setEnabled: NO];
[_customizeVidCodecPopup removeAllItems];
[_customizeVidScalePopup removeAllItems];
[_customizeAudCodecPopup removeAllItems];
[_customizeAudSampleratePopup removeAllItems];
[_customizeSubsPopup removeAllItems];
[_customizeVidCodecPopup addItemsWithTitles:[_videoCodecs firstObject]];
[_customizeAudCodecPopup addItemsWithTitles:[_audioCodecs firstObject]];
[_customizeSubsPopup addItemsWithTitles:[_subsCodecs firstObject]];
[_customizeAudSampleratePopup addItemWithTitle:@"8000"];
[_customizeAudSampleratePopup addItemWithTitle:@"11025"];
[_customizeAudSampleratePopup addItemWithTitle:@"22050"];
[_customizeAudSampleratePopup addItemWithTitle:@"44100"];
[_customizeAudSampleratePopup addItemWithTitle:@"48000"];
[_customizeVidScalePopup addItemWithTitle:@"1"];
[_customizeVidScalePopup addItemWithTitle:@"0.25"];
[_customizeVidScalePopup addItemWithTitle:@"0.5"];
[_customizeVidScalePopup addItemWithTitle:@"0.75"];
[_customizeVidScalePopup addItemWithTitle:@"1.25"];
[_customizeVidScalePopup addItemWithTitle:@"1.5"];
[_customizeVidScalePopup addItemWithTitle:@"1.75"];
[_customizeVidScalePopup addItemWithTitle:@"2"];
[_okButton setEnabled: NO];
// setup drop view
[_drop_box enablePlaylistItems];
[_drop_box setDropHandler: self];
[_dropBox enablePlaylistItems];
[_dropBox setDropHandler: self];
[self resetCustomizationSheetBasedOnProfile:[self.profileValueList firstObject]];
}
......@@ -263,7 +268,7 @@
- (IBAction)finalizePanel:(id)sender
{
if (b_streaming) {
if ([[[_stream_type_pop selectedItem] title] isEqualToString:@"HTTP"]) {
if ([[[_streamTypePopup selectedItem] title] isEqualToString:@"HTTP"]) {
NSString *muxformat = [self.currentProfile firstObject];
if ([muxformat isEqualToString:@"wav"] || [muxformat isEqualToString:@"mov"] || [muxformat isEqualToString:@"mp4"] || [muxformat isEqualToString:@"mkv"]) {
NSBeginInformationalAlertSheet(_NS("Invalid container format for HTTP streaming"), _NS("OK"), @"", @"", _window,
......@@ -277,13 +282,13 @@
playlist_t * p_playlist = pl_Get(VLCIntf);
input_item_t *p_input = input_item_New([_MRL UTF8String], [[_dropin_media_lbl stringValue] UTF8String]);
input_item_t *p_input = input_item_New([_MRL UTF8String], [[_dropinMediaLabel stringValue] UTF8String]);
if (!p_input)
return;
input_item_AddOption(p_input, [[self composedOptions] UTF8String], VLC_INPUT_OPTION_TRUSTED);
if (b_streaming)
input_item_AddOption(p_input, [[NSString stringWithFormat:@"ttl=%@", [_stream_ttl_fld stringValue]] UTF8String], VLC_INPUT_OPTION_TRUSTED);
input_item_AddOption(p_input, [[NSString stringWithFormat:@"ttl=%@", [_streamTTLField stringValue]] UTF8String], VLC_INPUT_OPTION_TRUSTED);
int returnValue;
returnValue = playlist_AddInput(p_playlist, p_input, PLAYLIST_STOP, PLAYLIST_END, true, pl_Unlocked);
......@@ -324,7 +329,7 @@
- (IBAction)switchProfile:(id)sender
{
NSUInteger index = [_profile_pop indexOfSelectedItem];
NSUInteger index = [_profilePopup indexOfSelectedItem];
// last index is "custom"
if (index <= ([self.profileValueList count] - 1))
[self resetCustomizationSheetBasedOnProfile:[self.profileValueList objectAtIndex:index]];
......@@ -332,15 +337,15 @@
- (IBAction)customizeProfile:(id)sender
{
[NSApp beginSheet:_customize_panel modalForWindow:_window modalDelegate:self didEndSelector:NULL contextInfo:nil];
[NSApp beginSheet:_customizePanel modalForWindow:_window modalDelegate:self didEndSelector:NULL contextInfo:nil];
}
- (IBAction)closeCustomizationSheet:(id)sender
{
[_customize_panel orderOut:sender];
[NSApp endSheet: _customize_panel];
[_customizePanel orderOut:sender];
[NSApp endSheet: _customizePanel];
if (sender == _customize_ok_btn)
if (sender == _customizeOkButton)
[self updateCurrentProfile];
}
......@@ -354,7 +359,7 @@
[panel setOKButtonLabel: _NS("Save")];
[panel setTarget:self];
[panel runModalForWindow:_customize_panel];
[panel runModalForWindow:_customizePanel];
}
- (IBAction)deleteProfileAction:(id)sender
......@@ -373,44 +378,44 @@
- (IBAction)iWantAFile:(id)sender
{
NSRect boxFrame = [_destination_box frame];
NSRect subViewFrame = [_destination_itwantafile_view frame];
NSRect boxFrame = [_destinationBox frame];
NSRect subViewFrame = [_fileDestinationView frame];
subViewFrame.origin.x = (boxFrame.size.width - subViewFrame.size.width) / 2;
subViewFrame.origin.y = ((boxFrame.size.height - subViewFrame.size.height) / 2) - 15.;
[_destination_itwantafile_view setFrame: subViewFrame];
[[_destination_itwantafile_btn animator] setHidden: YES];
[[_destination_itwantastream_btn animator] setHidden: YES];
[_destination_box performSelector:@selector(addSubview:) withObject:_destination_itwantafile_view afterDelay:0.2];
[[_destination_cancel_btn animator] setHidden:NO];
[_fileDestinationView setFrame: subViewFrame];
[[_destinationFileButton animator] setHidden: YES];
[[_destinationStreamButton animator] setHidden: YES];
[_destinationBox performSelector:@selector(addSubview:) withObject:_fileDestinationView afterDelay:0.2];
[[_destinationCancelBtn animator] setHidden:NO];
b_streaming = NO;
[_ok_btn setTitle:_NS("Save")];
[_okButton setTitle:_NS("Save")];
}
- (IBAction)iWantAStream:(id)sender
{
NSRect boxFrame = [_destination_box frame];
NSRect subViewFrame = [_destination_itwantastream_view frame];
NSRect boxFrame = [_destinationBox frame];
NSRect subViewFrame = [_streamDestinationView frame];
subViewFrame.origin.x = (boxFrame.size.width - subViewFrame.size.width) / 2;
subViewFrame.origin.y = ((boxFrame.size.height - subViewFrame.size.height) / 2) - 15.;
[_destination_itwantastream_view setFrame: subViewFrame];
[[_destination_itwantafile_btn animator] setHidden: YES];
[[_destination_itwantastream_btn animator] setHidden: YES];
[_destination_box performSelector:@selector(addSubview:) withObject:_destination_itwantastream_view afterDelay:0.2];
[[_destination_cancel_btn animator] setHidden:NO];
[_streamDestinationView setFrame: subViewFrame];
[[_destinationFileButton animator] setHidden: YES];
[[_destinationStreamButton animator] setHidden: YES];
[_destinationBox performSelector:@selector(addSubview:) withObject:_streamDestinationView afterDelay:0.2];
[[_destinationCancelBtn animator] setHidden:NO];
b_streaming = YES;
[_ok_btn setTitle:_NS("Stream")];
[_okButton setTitle:_NS("Stream")];
}
- (IBAction)cancelDestination:(id)sender
{
if ([_destination_itwantastream_view superview] != nil)
[_destination_itwantastream_view removeFromSuperview];
if ([_destination_itwantafile_view superview] != nil)
[_destination_itwantafile_view removeFromSuperview];
[_destination_cancel_btn setHidden:YES];
[[_destination_itwantafile_btn animator] setHidden: NO];
[[_destination_itwantastream_btn animator] setHidden: NO];
if ([_streamDestinationView superview] != nil)
[_streamDestinationView removeFromSuperview];
if ([_fileDestinationView superview] != nil)
[_fileDestinationView removeFromSuperview];
[_destinationCancelBtn setHidden:YES];
[[_destinationFileButton animator] setHidden: NO];
[[_destinationStreamButton animator] setHidden: NO];
b_streaming = NO;
}
......@@ -419,18 +424,18 @@
NSSavePanel * saveFilePanel = [NSSavePanel savePanel];
[saveFilePanel setCanSelectHiddenExtension: YES];
[saveFilePanel setCanCreateDirectories: YES];
if ([[_customize_encap_matrix selectedCell] tag] != RAW) // there is no clever guess for this
if ([[_customizeEncapMatrix selectedCell] tag] != RAW) // there is no clever guess for this
[saveFilePanel setAllowedFileTypes:[NSArray arrayWithObject:[self currentEncapsulationFormatAsFileExtension:YES]]];
[saveFilePanel beginSheetModalForWindow:_window completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton) {
[self setOutputDestination:[[saveFilePanel URL] path]];
[_destination_filename_lbl setStringValue: [[NSFileManager defaultManager] displayNameAtPath:_outputDestination]];
[[_destination_filename_stub_lbl animator] setHidden: YES];
[[_destination_filename_lbl animator] setHidden: NO];
[_fileDestinationFileName setStringValue: [[NSFileManager defaultManager] displayNameAtPath:_outputDestination]];
[[_fileDestinationFileNameStub animator] setHidden: YES];
[[_fileDestinationFileName animator] setHidden: NO];
} else {
[self setOutputDestination:@""];
[[_destination_filename_lbl animator] setHidden: YES];
[[_destination_filename_stub_lbl animator] setHidden: NO];
[[_fileDestinationFileName animator] setHidden: YES];
[[_fileDestinationFileNameStub animator] setHidden: NO];
}
[self updateOKButton];
}];
......@@ -438,83 +443,83 @@
- (IBAction)showStreamPanel:(id)sender
{
[NSApp beginSheet:_stream_panel modalForWindow:_window modalDelegate:self didEndSelector:NULL contextInfo:nil];
[NSApp beginSheet:_streamPanel modalForWindow:_window modalDelegate:self didEndSelector:NULL contextInfo:nil];
}
- (IBAction)closeStreamPanel:(id)sender
{
[_stream_panel orderOut:sender];
[NSApp endSheet: _stream_panel];
[_streamPanel orderOut:sender];
[NSApp endSheet: _streamPanel];
if (sender == _stream_cancel_btn)
if (sender == _streamCancelButton)
return;
/* provide a summary of the user selections */
NSMutableString * labelContent = [[NSMutableString alloc] initWithFormat:_NS("%@ stream to %@:%@"), [_stream_type_pop titleOfSelectedItem], [_stream_address_fld stringValue], [_stream_port_fld stringValue]];
NSMutableString * labelContent = [[NSMutableString alloc] initWithFormat:_NS("%@ stream to %@:%@"), [_streamTypePopup titleOfSelectedItem], [_streamAddressField stringValue], [_streamPortField stringValue]];
if ([_stream_type_pop indexOfSelectedItem] > 1)
[labelContent appendFormat:@" (\"%@\")", [_stream_channel_fld stringValue]];
if ([_streamTypePopup indexOfSelectedItem] > 1)
[labelContent appendFormat:@" (\"%@\")", [_streamChannelField stringValue]];
[_destination_stream_lbl setStringValue:labelContent];
[_streamDestinationURLLabel setStringValue:labelContent];
/* catch obvious errors */
if (![[_stream_address_fld stringValue] length] > 0) {
if (![[_streamAddressField stringValue] length] > 0) {
NSBeginInformationalAlertSheet(_NS("No Address given"),
_NS("OK"), @"", @"", _stream_panel, nil, nil, nil, nil,
_NS("OK"), @"", @"", _streamPanel, nil, nil, nil, nil,
@"%@", _NS("In order to stream, a valid destination address is required."));
return;
}
if ([_stream_sap_ckb state] && ![[_stream_channel_fld stringValue] length] > 0) {
if ([_streamSAPCheckbox state] && ![[_streamChannelField stringValue] length] > 0) {
NSBeginInformationalAlertSheet(_NS("No Channel Name given"),
_NS("OK"), @"", @"", _stream_panel, nil, nil, nil, nil,
_NS("OK"), @"", @"", _streamPanel, nil, nil, nil, nil,
@"%@", _NS("SAP stream announcement is enabled. However, no channel name is provided."));
return;
}
if ([_stream_sdp_matrix isEnabled] && [_stream_sdp_matrix selectedCell] != [_stream_sdp_matrix cellWithTag:0] && ![[_stream_sdp_fld stringValue] length] > 0) {
if ([_streamSDPMatrix isEnabled] && [_streamSDPMatrix selectedCell] != [_streamSDPMatrix cellWithTag:0] && ![[_streamSDPField stringValue] length] > 0) {
NSBeginInformationalAlertSheet(_NS("No SDP URL given"),
_NS("OK"), @"", @"", _stream_panel, nil, nil, nil, nil,
_NS("OK"), @"", @"", _streamPanel, nil, nil, nil, nil,
@"%@", _NS("A SDP export is requested, but no URL is provided."));
return;
}
/* store destination for further reference and update UI */
[self setOutputDestination: [_stream_address_fld stringValue]];
[self setOutputDestination: [_streamAddressField stringValue]];
[self updateOKButton];
}
- (IBAction)streamTypeToggle:(id)sender
{
NSUInteger index = [_stream_type_pop indexOfSelectedItem];
NSUInteger index = [_streamTypePopup indexOfSelectedItem];
if (index <= 1) { // HTTP, MMSH
[_stream_ttl_fld setEnabled:NO];
[_stream_ttl_stepper setEnabled:NO];
[_stream_sap_ckb setEnabled:NO];
[_stream_sdp_matrix setEnabled:NO];
[_streamTTLField setEnabled:NO];
[_streamTTLStepper setEnabled:NO];
[_streamSAPCheckbox setEnabled:NO];
[_streamSDPMatrix setEnabled:NO];
} else if (index == 2) { // RTP
[_stream_ttl_fld setEnabled:YES];
[_stream_ttl_stepper setEnabled:YES];
[_stream_sap_ckb setEnabled:YES];
[_stream_sdp_matrix setEnabled:YES];
[_streamTTLField setEnabled:YES];
[_streamTTLStepper setEnabled:YES];
[_streamSAPCheckbox setEnabled:YES];
[_streamSDPMatrix setEnabled:YES];
} else { // UDP
[_stream_ttl_fld setEnabled:YES];
[_stream_ttl_stepper setEnabled:YES];
[_stream_sap_ckb setEnabled:YES];
[_stream_sdp_matrix setEnabled:NO];
[_streamTTLField setEnabled:YES];
[_streamTTLStepper setEnabled:YES];
[_streamSAPCheckbox setEnabled:YES];
[_streamSDPMatrix setEnabled:NO];
}
[self streamAnnouncementToggle:sender];
}
- (IBAction)streamAnnouncementToggle:(id)sender
{
[_stream_channel_fld setEnabled:[_stream_sap_ckb state] && [_stream_sap_ckb isEnabled]];
[_stream_sdp_fld setEnabled:[_stream_sdp_matrix isEnabled] && ([_stream_sdp_matrix selectedCell] != [_stream_sdp_matrix cellWithTag:0])];
[_streamChannelField setEnabled:[_streamSAPCheckbox state] && [_streamSAPCheckbox isEnabled]];
[_streamSDPField setEnabled:[_streamSDPMatrix isEnabled] && ([_streamSDPMatrix selectedCell] != [_streamSDPMatrix cellWithTag:0])];
if ([[_stream_sdp_matrix selectedCell] tag] == 3)
[_stream_sdp_browsefile_btn setEnabled: YES];
if ([[_streamSDPMatrix selectedCell] tag] == 3)
[_streamSDPFileBrowseButton setEnabled: YES];
else
[_stream_sdp_browsefile_btn setEnabled: NO];
[_streamSDPFileBrowseButton setEnabled: NO];
}
- (IBAction)sdpFileLocationSelector:(id)sender
......@@ -523,9 +528,9 @@
[saveFilePanel setCanSelectHiddenExtension: YES];
[saveFilePanel setCanCreateDirectories: YES];
[saveFilePanel setAllowedFileTypes:[NSArray arrayWithObject:@"sdp"]];
[saveFilePanel beginSheetModalForWindow:_stream_panel completionHandler:^(NSInteger returnCode) {
[saveFilePanel beginSheetModalForWindow:_streamPanel completionHandler:^(NSInteger returnCode) {
if (returnCode == NSOKButton)
[_stream_sdp_fld setStringValue:[[saveFilePanel URL] path]];
[_streamSDPField setStringValue:[[saveFilePanel URL] path]];
}];
}
......@@ -596,7 +601,7 @@
/* update UI */
[self recreateProfilePopup];
[_profile_pop selectItemWithTitle:text];
[_profilePopup selectItemWithTitle:text];
/* update internals */
[self switchProfile:self];
......@@ -627,23 +632,23 @@
- (IBAction)videoSettingsChanged:(id)sender
{
bool enableSettings = [_customize_vid_ckb state] == NSOnState && [_customize_vid_keep_ckb state] == NSOffState;
[_customize_vid_settings_box enableSubviews:enableSettings];
[_customize_vid_keep_ckb setEnabled:[_customize_vid_ckb state] == NSOnState];
bool enableSettings = [_customizeVidCheckbox state] == NSOnState && [_customizeVidKeepCheckbox state] == NSOffState;
[_customizeVidSettingsBox enableSubviews:enableSettings];
[_customizeVidKeepCheckbox setEnabled:[_customizeVidCheckbox state] == NSOnState];
}
- (IBAction)audioSettingsChanged:(id)sender
{
bool enableSettings = [_customize_aud_ckb state] == NSOnState && [_customize_aud_keep_ckb state] == NSOffState;
[_customize_aud_settings_box enableSubviews:enableSettings];
[_customize_aud_keep_ckb setEnabled:[_customize_aud_ckb state] == NSOnState];
bool enableSettings = [_customizeAudCheckbox state] == NSOnState && [_customizeAudKeepCheckbox state] == NSOffState;
[_customizeAudSettingsBox enableSubviews:enableSettings];
[_customizeAudKeepCheckbox setEnabled:[_customizeAudCheckbox state] == NSOnState];
}
- (IBAction)subSettingsChanged:(id)sender
{
bool enableSettings = [_customize_subs_ckb state] == NSOnState;
[_customize_subs_overlay_ckb setEnabled:enableSettings];
[_customize_subs_pop setEnabled:enableSettings];
bool enableSettings = [_customizeSubsCheckbox state] == NSOnState;
[_customizeSubsOverlayCheckbox setEnabled:enableSettings];
[_customizeSubsPopup setEnabled:enableSettings];
}
# pragma mark -
......@@ -652,32 +657,32 @@
{
if ([_MRL length] > 0) {
NSString * path = [[NSURL URLWithString:_MRL] path];
[_dropin_media_lbl setStringValue: [[NSFileManager defaultManager] displayNameAtPath: path]];
[_dropinMediaLabel setStringValue: [[NSFileManager defaultManager] displayNameAtPath: path]];
NSImage * image = [[NSWorkspace sharedWorkspace] iconForFile: path];
[image setSize:NSMakeSize(128,128)];
[_dropin_icon_view setImage: image];
[_dropinIcon setImage: image];
if (![_dropin_view superview]) {
NSRect boxFrame = [_drop_box frame];
NSRect subViewFrame = [_dropin_view frame];
if (![_dropinView superview]) {
NSRect boxFrame = [_dropBox frame];
NSRect subViewFrame = [_dropinView frame];
subViewFrame.origin.x = (boxFrame.size.width - subViewFrame.size.width) / 2;
subViewFrame.origin.y = (boxFrame.size.height - subViewFrame.size.height) / 2;
[_dropin_view setFrame: subViewFrame];
[[_drop_image_view animator] setHidden: YES];
[_drop_box performSelector:@selector(addSubview:) withObject:_dropin_view afterDelay:0.6];
[_dropinView setFrame: subViewFrame];
[[_dropImage animator] setHidden: YES];
[_dropBox performSelector:@selector(addSubview:) withObject:_dropinView afterDelay:0.6];
}
} else {
[_dropin_view removeFromSuperview];
[[_drop_image_view animator] setHidden: NO];
[_dropinView removeFromSuperview];
[[_dropImage animator] setHidden: NO];
}
}
- (void)updateOKButton
{
if ([_outputDestination length] > 0 && [_MRL length] > 0)
[_ok_btn setEnabled: YES];
[_okButton setEnabled: YES];
else
[_ok_btn setEnabled: NO];
[_okButton setEnabled: NO];
}
- (void)resetCustomizationSheetBasedOnProfile:(NSString *)profileString
......@@ -695,31 +700,31 @@
}
[self selectCellByEncapsulationFormat:[components firstObject]];
[_customize_vid_ckb setState:[[components objectAtIndex:1] intValue]];
[_customize_aud_ckb setState:[[components objectAtIndex:2] intValue]];
[_customize_subs_ckb setState:[[components objectAtIndex:3] intValue]];
[_customizeVidCheckbox setState:[[components objectAtIndex:1] intValue]];
[_customizeAudCheckbox setState:[[components objectAtIndex:2] intValue]];
[_customizeSubsCheckbox setState:[[components objectAtIndex:3] intValue]];
[self setVidBitrate:[[components objectAtIndex:5] intValue]];
[_customize_vid_scale_pop selectItemWithTitle:[components objectAtIndex:6]];
[_customizeVidScalePopup selectItemWithTitle:[components objectAtIndex:6]];
[self setVidFramerate:[[components objectAtIndex:7] intValue]];
[_customize_vid_width_fld setStringValue:[components objectAtIndex:8]];
[_customize_vid_height_fld setStringValue:[components objectAtIndex:9]];
[_customizeVidWidthField setStringValue:[components objectAtIndex:8]];
[_customizeVidHeightField setStringValue:[components objectAtIndex:9]];
[self setAudBitrate:[[components objectAtIndex:11] intValue]];
[self setAudChannels:[[components objectAtIndex:12] intValue]];
[_customize_aud_samplerate_pop selectItemWithTitle:[components objectAtIndex:13]];
[_customize_subs_overlay_ckb setState:[[components objectAtIndex:15] intValue]];
[_customizeAudSampleratePopup selectItemWithTitle:[components objectAtIndex:13]];
[_customizeSubsOverlayCheckbox setState:[[components objectAtIndex:15] intValue]];
/* since there is no proper lookup mechanism in arrays, we need to implement a string specific one ourselves */
NSArray * tempArray = [_videoCodecs objectAtIndex:1];
NSUInteger count = [tempArray count];
NSString * searchString = [components objectAtIndex:4];
int videoKeep = [searchString isEqualToString:@"copy"];
[_customize_vid_keep_ckb setState:videoKeep];
[_customizeVidKeepCheckbox setState:videoKeep];
if ([searchString isEqualToString:@"none"] || [searchString isEqualToString:@"0"] || videoKeep) {
[_customize_vid_codec_pop selectItemAtIndex:-1];
[_customizeVidCodecPopup selectItemAtIndex:-1];
} else {
for (NSUInteger x = 0; x < count; x++) {
if ([[tempArray objectAtIndex:x] isEqualToString: searchString]) {
[_customize_vid_codec_pop selectItemAtIndex:x];
[_customizeVidCodecPopup selectItemAtIndex:x];
break;
}
}
......@@ -729,13 +734,13 @@
count = [tempArray count];
searchString = [components objectAtIndex:10];
int audioKeep = [searchString isEqualToString:@"copy"];
[_customize_aud_keep_ckb setState:audioKeep];
[_customizeAudKeepCheckbox setState:audioKeep];
if ([searchString isEqualToString:@"none"] || [searchString isEqualToString:@"0"] || audioKeep) {
[_customize_aud_codec_pop selectItemAtIndex:-1];
[_customizeAudCodecPopup selectItemAtIndex:-1];
} else {
for (NSUInteger x = 0; x < count; x++) {
if ([[tempArray objectAtIndex:x] isEqualToString: searchString]) {
[_customize_aud_codec_pop selectItemAtIndex:x];
[_customizeAudCodecPopup selectItemAtIndex:x];
break;
}
}
......@@ -745,11 +750,11 @@
count = [tempArray count];
searchString = [components objectAtIndex:14];
if ([searchString isEqualToString:@"none"] || [searchString isEqualToString:@"0"]) {
[_customize_subs_pop selectItemAtIndex:-1];
[_customizeSubsPopup selectItemAtIndex:-1];
} else {
for (NSUInteger x = 0; x < count; x++) {
if ([[tempArray objectAtIndex:x] isEqualToString: searchString]) {
[_customize_subs_pop selectItemAtIndex:x];
[_customizeSubsPopup selectItemAtIndex:x];
break;
}
}
......@@ -765,44 +770,44 @@
- (void)selectCellByEncapsulationFormat:(NSString *)format
{
if ([format isEqualToString:@"ts"])
[_customize_encap_matrix selectCellWithTag:MPEGTS];
[_customizeEncapMatrix selectCellWithTag:MPEGTS];
else if ([format isEqualToString:@"webm"])
[_customize_encap_matrix selectCellWithTag:WEBM];
[_customizeEncapMatrix selectCellWithTag:WEBM];
else if ([format isEqualToString:@"ogg"])
[_customize_encap_matrix selectCellWithTag:OGG];
[_customizeEncapMatrix selectCellWithTag:OGG];
else if ([format isEqualToString:@"ogm"])
[_customize_encap_matrix selectCellWithTag:OGG];
[_customizeEncapMatrix selectCellWithTag:OGG];
else if ([format isEqualToString:@"mp4"])
[_customize_encap_matrix selectCellWithTag:MP4];
[_customizeEncapMatrix selectCellWithTag:MP4];
else if ([format isEqualToString:@"mov"])
[_customize_encap_matrix selectCellWithTag:MP4];
[_customizeEncapMatrix selectCellWithTag:MP4];
else if ([format isEqualToString:@"ps"])
[_customize_encap_matrix selectCellWithTag:MPEGPS];
[_customizeEncapMatrix selectCellWithTag:MPEGPS];
else if ([format isEqualToString:@"mpjpeg"])
[_customize_encap_matrix selectCellWithTag:MJPEG];
[_customizeEncapMatrix selectCellWithTag:MJPEG];
else if ([format isEqualToString:@"wav"])
[_customize_encap_matrix selectCellWithTag:WAV];
[_customizeEncapMatrix selectCellWithTag:WAV];
else if ([format isEqualToString:@"flv"])
[_customize_encap_matrix selectCellWithTag:FLV];
[_customizeEncapMatrix selectCellWithTag:FLV];
else if ([format isEqualToString:@"mpeg1"])
[_customize_encap_matrix selectCellWithTag:MPEG1];
[_customizeEncapMatrix selectCellWithTag:MPEG1];
else if ([format isEqualToString:@"mkv"])
[_customize_encap_matrix selectCellWithTag:MKV];
[_customizeEncapMatrix selectCellWithTag:MKV];
else if ([format isEqualToString:@"raw"])
[_customize_encap_matrix selectCellWithTag:RAW];
[_customizeEncapMatrix selectCellWithTag:RAW];
else if ([format isEqualToString:@"avi"])
[_customize_encap_matrix selectCellWithTag:AVI];
[_customizeEncapMatrix selectCellWithTag:AVI];
else if ([format isEqualToString:@"asf"])
[_customize_encap_matrix selectCellWithTag:ASF];
[_customizeEncapMatrix selectCellWithTag:ASF];
else if ([format isEqualToString:@"wmv"])
[_customize_encap_matrix selectCellWithTag:ASF];
[_customizeEncapMatrix selectCellWithTag:ASF];
else
msg_Err(VLCIntf, "CAS: unknown encap format requested for customization");
}
- (NSString *)currentEncapsulationFormatAsFileExtension:(BOOL)b_extension
{
NSUInteger cellTag = (NSUInteger) [[_customize_encap_matrix selectedCell] tag];
NSUInteger cellTag = (NSUInteger) [[_customizeEncapMatrix selectedCell] tag];
NSString * returnValue;
switch (cellTag) {
case MPEGTS:
......@@ -926,32 +931,33 @@
// add muxer
[composedOptions appendFormat:@"}:standard{mux=%@", [self.currentProfile firstObject]];
// add output destination
[composedOptions appendFormat:@",access=file{no-overwrite},dst=%@}", _outputDestination];
} else {
/* streaming */
if ([[[_stream_type_pop selectedItem] title] isEqualToString:@"RTP"])
[composedOptions appendFormat:@":rtp{mux=ts,dst=%@,port=%@", _outputDestination, [_stream_port_fld stringValue]];
else if ([[[_stream_type_pop selectedItem] title] isEqualToString:@"UDP"])
[composedOptions appendFormat:@":standard{mux=ts,dst=%@,port=%@,access=udp", _outputDestination, [_stream_port_fld stringValue]];
else if ([[[_stream_type_pop selectedItem] title] isEqualToString:@"MMSH"])
[composedOptions appendFormat:@":standard{mux=asfh,dst=%@,port=%@,access=mmsh", _outputDestination, [_stream_port_fld stringValue]];
if ([[[_streamTypePopup selectedItem] title] isEqualToString:@"RTP"])
[composedOptions appendFormat:@":rtp{mux=ts,dst=%@,port=%@", _outputDestination, [_streamPortField stringValue]];
else if ([[[_streamTypePopup selectedItem] title] isEqualToString:@"UDP"])
[composedOptions appendFormat:@":standard{mux=ts,dst=%@,port=%@,access=udp", _outputDestination, [_streamPortField stringValue]];
else if ([[[_streamTypePopup selectedItem] title] isEqualToString:@"MMSH"])
[composedOptions appendFormat:@":standard{mux=asfh,dst=%@,port=%@,access=mmsh", _outputDestination, [_streamPortField stringValue]];
else
[composedOptions appendFormat:@":standard{mux=%@,dst=%@,port=%@,access=http", [self.currentProfile firstObject], [_stream_port_fld stringValue], _outputDestination];
[composedOptions appendFormat:@":standard{mux=%@,dst=%@,port=%@,access=http", [self.currentProfile firstObject], [_streamPortField stringValue], _outputDestination];
if ([_stream_sap_ckb state])
[composedOptions appendFormat:@",sap,name=\"%@\"", [_stream_channel_fld stringValue]];
if ([_stream_sdp_matrix selectedCell] != [_stream_sdp_matrix cellWithTag:0]) {
NSInteger tag = [[_stream_sdp_matrix selectedCell] tag];
if ([_streamSAPCheckbox state])
[composedOptions appendFormat:@",sap,name=\"%@\"", [_streamChannelField stringValue]];
if ([_streamSDPMatrix selectedCell] != [_streamSDPMatrix cellWithTag:0]) {
NSInteger tag = [[_streamSDPMatrix selectedCell] tag];
switch (tag) {
case 1:
[composedOptions appendFormat:@",sdp=\"http://%@\"", [_stream_sdp_fld stringValue]];
[composedOptions appendFormat:@",sdp=\"http://%@\"", [_streamSDPField stringValue]];
break;
case 2:
[composedOptions appendFormat:@",sdp=\"rtsp://%@\"", [_stream_sdp_fld stringValue]];
[composedOptions appendFormat:@",sdp=\"rtsp://%@\"", [_streamSDPField stringValue]];
break;
case 3:
[composedOptions appendFormat:@",sdp=\"file://%s\"", vlc_path2uri([[_stream_sdp_fld stringValue] UTF8String], NULL)];
[composedOptions appendFormat:@",sdp=\"file://%s\"", vlc_path2uri([[_streamSDPField stringValue] UTF8String], NULL)];
default:
break;
}
......@@ -969,15 +975,15 @@
NSInteger i;
[self.currentProfile addObject: [self currentEncapsulationFormatAsFileExtension:NO]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%li", [_customize_vid_ckb state]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%li", [_customize_aud_ckb state]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%li", [_customize_subs_ckb state]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%li", [_customizeVidCheckbox state]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%li", [_customizeAudCheckbox state]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%li", [_customizeSubsCheckbox state]]];
NSString *videoCodec;
if([_customize_vid_keep_ckb state] == NSOnState)
if([_customizeVidKeepCheckbox state] == NSOnState)
videoCodec = @"copy";
else {
i = [_customize_vid_codec_pop indexOfSelectedItem];
i = [_customizeVidCodecPopup indexOfSelectedItem];
if (i >= 0)
videoCodec = [[_videoCodecs objectAtIndex:1] objectAtIndex:i];
else
......@@ -986,16 +992,16 @@
[self.currentProfile addObject: videoCodec];
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [self vidBitrate]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [[[_customize_vid_scale_pop selectedItem] title] intValue]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [[[_customizeVidScalePopup selectedItem] title] intValue]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [self vidFramerate]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [_customize_vid_width_fld intValue]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [_customize_vid_height_fld intValue]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [_customizeVidWidthField intValue]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [_customizeVidHeightField intValue]]];
NSString *audioCodec;
if([_customize_aud_keep_ckb state] == NSOnState)
if([_customizeAudKeepCheckbox state] == NSOnState)
audioCodec = @"copy";
else {
i = [_customize_aud_codec_pop indexOfSelectedItem];
i = [_customizeAudCodecPopup indexOfSelectedItem];
if (i >= 0)
audioCodec = [[_audioCodecs objectAtIndex:1] objectAtIndex:i];
else
......@@ -1005,13 +1011,13 @@
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [self audBitrate]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%i", [self audChannels]]];
[self.currentProfile addObject: [[_customize_aud_samplerate_pop selectedItem] title]];
i = [_customize_subs_pop indexOfSelectedItem];
[self.currentProfile addObject: [[_customizeAudSampleratePopup selectedItem] title]];
i = [_customizeSubsPopup indexOfSelectedItem];
if (i >= 0)
[self.currentProfile addObject: [[_subsCodecs objectAtIndex:1] objectAtIndex:i]];
else
[self.currentProfile addObject: @"none"];
[self.currentProfile addObject: [NSString stringWithFormat:@"%li", [_customize_subs_overlay_ckb state]]];
[self.currentProfile addObject: [NSString stringWithFormat:@"%li", [_customizeSubsOverlayCheckbox state]]];
}
- (void)storeProfilesOnDisk
......@@ -1024,13 +1030,15 @@
- (void)recreateProfilePopup
{
[_profile_pop removeAllItems];
[_profile_pop addItemsWithTitles:self.profileNames];
[_profile_pop addItemWithTitle:_NS("Custom")];
[[_profile_pop menu] addItem:[NSMenuItem separatorItem]];
[_profile_pop addItemWithTitle:_NS("Organize Profiles...")];
[[_profile_pop lastItem] setTarget: self];
[[_profile_pop lastItem] setAction: @selector(deleteProfileAction:)];
[_profilePopup removeAllItems];
[_profilePopup addItemsWithTitles:self.profileNames];
[_profilePopup addItemWithTitle:_NS("Custom")];
[[_profilePopup menu] addItem:[NSMenuItem separatorItem]];
[_profilePopup addItemWithTitle:_NS("Organize Profiles...")];
[[_profilePopup lastItem] setTarget: self];
[[_profilePopup lastItem] setAction: @selector(deleteProfileAction:)];
}
- (IBAction)customizeSubsCheckbox:(id)sender {
}
@end
......@@ -1270,7 +1270,7 @@
_convertAndSaveWindowController = [[VLCConvertAndSave alloc] init];
if (!b_nib_convertandsave_loaded)
b_nib_convertandsave_loaded = [NSBundle loadNibNamed:@"ConvertAndSave" owner: NSApp];
b_nib_convertandsave_loaded = [NSBundle loadNibNamed:@"ConvertAndSave" owner: _convertAndSaveWindowController];
[_convertAndSaveWindowController toggleWindow];
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment