Commit 57126b2f authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: implement a 'Record' menu item

parent d8937ba2
......@@ -11,14 +11,14 @@
<string key="com.binarymethod.BGHUDAppKitPlugin">1</string>
</dictionary>
<array class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<integer value="283"/>
<integer value="915"/>
<integer value="1617"/>
<integer value="2730"/>
<integer value="334"/>
<integer value="4596"/>
<integer value="21"/>
<integer value="4722"/>
<integer value="915"/>
<integer value="1617"/>
<integer value="283"/>
<integer value="235"/>
</array>
<array key="IBDocument.PluginDependencies">
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -1608,6 +1608,17 @@
<reference key="NSOnImage" ref="447396056"/>
<reference key="NSMixedImage" ref="100133332"/>
</object>
<object class="NSMenuItem" id="261314859">
<reference key="NSMenu" ref="1017583928"/>
<bool key="NSIsDisabled">YES</bool>
<bool key="NSIsAlternate">YES</bool>
<string key="NSTitle">Record</string>
<string key="NSKeyEquiv">r</string>
<int key="NSKeyEquivModMask">1572864</int>
<int key="NSMnemonicLoc">2147483647</int>
<reference key="NSOnImage" ref="447396056"/>
<reference key="NSMixedImage" ref="100133332"/>
</object>
<object class="NSMenuItem" id="823365566">
<reference key="NSMenu" ref="1017583928"/>
<string key="NSTitle">Rate (view)</string>
......@@ -6955,6 +6966,22 @@ LCAuLi4</string>
</object>
<int key="connectionID">4752</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">toggleRecord:</string>
<reference key="source" ref="651263286"/>
<reference key="destination" ref="261314859"/>
</object>
<int key="connectionID">4754</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">o_mi_record</string>
<reference key="source" ref="651263286"/>
<reference key="destination" ref="261314859"/>
</object>
<int key="connectionID">4755</int>
</object>
</array>
<object class="IBMutableOrderedSet" key="objectRecords">
<array key="orderedObjects">
......@@ -7507,6 +7534,7 @@ LCAuLi4</string>
<reference ref="938524312"/>
<reference ref="823365566"/>
<reference ref="375871953"/>
<reference ref="261314859"/>
</array>
<reference key="parent" ref="565445175"/>
</object>
......@@ -9504,6 +9532,11 @@ LCAuLi4</string>
<reference key="object" ref="869331277"/>
<reference key="parent" ref="959811945"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">4753</int>
<reference key="object" ref="261314859"/>
<reference key="parent" ref="1017583928"/>
</object>
</array>
</object>
<dictionary class="NSMutableDictionary" key="flattenedProperties">
......@@ -9539,7 +9572,7 @@ LCAuLi4</string>
<boolean value="YES" key="1055.ImportedFromIB2"/>
<string key="1056.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="1056.ImportedFromIB2"/>
<string key="1057.IBEditorWindowLastContentRect">{{725, 390}, {64, 6}}</string>
<string key="1057.IBEditorWindowLastContentRect">{{650, 356}, {64, 6}}</string>
<string key="1057.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="1057.ImportedFromIB2"/>
<string key="1058.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -9690,7 +9723,7 @@ LCAuLi4</string>
<boolean value="YES" key="202.ImportedFromIB2"/>
<string key="203.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="203.ImportedFromIB2"/>
<string key="205.IBEditorWindowLastContentRect">{{473, 633}, {137, 103}}</string>
<string key="205.IBEditorWindowLastContentRect">{{430, 565}, {137, 103}}</string>
<string key="205.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="205.ImportedFromIB2"/>
<string key="21.IBEditorWindowLastContentRect">{{329, 301}, {604, 310}}</string>
......@@ -9747,7 +9780,7 @@ LCAuLi4</string>
<boolean value="YES" key="2312.ImportedFromIB2"/>
<string key="234.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="234.ImportedFromIB2"/>
<string key="235.IBEditorWindowLastContentRect">{{517, 393}, {222, 343}}</string>
<string key="235.IBEditorWindowLastContentRect">{{428, 299}, {222, 363}}</string>
<string key="235.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="235.ImportedFromIB2"/>
<string key="238.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -9913,7 +9946,7 @@ LCAuLi4</string>
<boolean value="YES" key="2832.ImportedFromIB2"/>
<string key="2834.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="2834.ImportedFromIB2"/>
<string key="29.IBEditorWindowLastContentRect">{{330, 668}, {468, 20}}</string>
<string key="29.IBEditorWindowLastContentRect">{{284, 662}, {468, 20}}</string>
<string key="29.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="29.ImportedFromIB2"/>
<string key="3292.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -10270,6 +10303,7 @@ LCAuLi4</string>
<string key="4731.CustomClassName">VLBrushedMetalImageView</string>
<string key="4731.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="4732.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="4753.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="5.ImportedFromIB2"/>
<string key="56.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -10292,7 +10326,7 @@ LCAuLi4</string>
<boolean value="YES" key="79.ImportedFromIB2"/>
<string key="801.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="801.ImportedFromIB2"/>
<string key="81.IBEditorWindowLastContentRect">{{431, 493}, {297, 243}}</string>
<string key="81.IBEditorWindowLastContentRect">{{388, 425}, {297, 243}}</string>
<string key="81.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES" key="81.ImportedFromIB2"/>
<string key="816.IBPluginDependency">com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -10323,7 +10357,7 @@ LCAuLi4</string>
<nil key="activeLocalization"/>
<dictionary class="NSMutableDictionary" key="localizations"/>
<nil key="sourceID"/>
<int key="maxID">4752</int>
<int key="maxID">4755</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
......@@ -12560,6 +12594,7 @@ LCAuLi4</string>
<string key="showVideoEffects:">id</string>
<string key="showWizard:">id</string>
<string key="toggleFullscreen:">id</string>
<string key="toggleRecord:">id</string>
<string key="toggleVar:">id</string>
<string key="viewAbout:">id</string>
<string key="viewErrorsAndWarnings:">id</string>
......@@ -12659,6 +12694,10 @@ LCAuLi4</string>
<string key="name">toggleFullscreen:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleRecord:">
<string key="name">toggleRecord:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo" key="toggleVar:">
<string key="name">toggleVar:</string>
<string key="candidateClassName">id</string>
......@@ -12760,6 +12799,7 @@ LCAuLi4</string>
<string key="o_mi_rate_slower_lbl">id</string>
<string key="o_mi_rate_view">NSView</string>
<string key="o_mi_readme">NSMenuItem</string>
<string key="o_mi_record">NSMenuItem</string>
<string key="o_mi_repeat">NSMenuItem</string>
<string key="o_mi_screen">NSMenuItem</string>
<string key="o_mi_select_all">NSMenuItem</string>
......@@ -13136,6 +13176,10 @@ LCAuLi4</string>
<string key="name">o_mi_readme</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo" key="o_mi_record">
<string key="name">o_mi_record</string>
<string key="candidateClassName">NSMenuItem</string>
</object>
<object class="IBToOneOutletInfo" key="o_mi_repeat">
<string key="name">o_mi_repeat</string>
<string key="candidateClassName">NSMenuItem</string>
......
......@@ -36,6 +36,7 @@
- (void)faster;
- (void)slower;
- (void)normalSpeed;
- (void)toggleRecord;
- (void)setPlaybackRate:(int)i_value;
- (int)playbackRate;
- (void)next;
......
......@@ -109,6 +109,17 @@ static VLCCoreInteraction *_o_sharedInstance = nil;
var_SetInteger( VLCIntf->p_libvlc, "key-action", ACTIONID_RATE_NORMAL );
}
- (void)toggleRecord
{
input_thread_t * p_input;
p_input = pl_CurrentInput( VLCIntf );
if( p_input )
{
var_ToggleBool( p_input, "record" );
vlc_object_release( p_input );
}
}
- (void)setPlaybackRate:(int)i_value
{
playlist_t * p_playlist = pl_Get( VLCIntf );
......
......@@ -74,6 +74,7 @@
IBOutlet NSMenu * o_mu_controls;
IBOutlet NSMenuItem * o_mi_play;
IBOutlet NSMenuItem * o_mi_stop;
IBOutlet NSMenuItem * o_mi_record;
IBOutlet NSMenuItem * o_mi_rate;
IBOutlet NSView * o_mi_rate_view;
IBOutlet id o_mi_rate_lbl;
......@@ -206,6 +207,8 @@
- (IBAction)intfOpenNet:(id)sender;
- (IBAction)intfOpenCapture:(id)sender;
- (IBAction)toggleRecord:(id)sender;
- (void)updateRecordState:(BOOL)b_value;
- (IBAction)setPlaybackRate:(id)sender;
- (void)updatePlaybackRate;
......
......@@ -255,6 +255,7 @@ static VLCMainMenu *_o_sharedInstance = nil;
[o_mu_controls setTitle: _NS("Playback")];
[o_mi_play setTitle: _NS("Play")];
[o_mi_stop setTitle: _NS("Stop")];
[o_mi_record setTitle: _NS("Record")];
[o_mi_rate setView: o_mi_rate_view];
[o_mi_rate_lbl setStringValue: _NS("Playback Speed")];
[o_mi_rate_lbl_gray setStringValue: _NS("Playback Speed")];
......@@ -395,6 +396,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
input_thread_t * p_input = playlist_CurrentInput( p_playlist );
if( p_input != NULL )
{
[o_mi_record setEnabled: var_GetBool( p_input, "can-record" )];
[self setupVarMenuItem: o_mi_program target: (vlc_object_t *)p_input
var: "program" selector: @selector(toggleVar:)];
......@@ -461,6 +464,10 @@ static VLCMainMenu *_o_sharedInstance = nil;
}
vlc_object_release( p_input );
}
else
{
[o_mi_record setEnabled: NO];
}
}
- (void)refreshVoutDeviceMenu:(NSNotification *)o_notification
......@@ -544,6 +551,16 @@ static VLCMainMenu *_o_sharedInstance = nil;
#pragma mark -
#pragma mark Playback
- (IBAction)toggleRecord:(id)sender
{
[[VLCCoreInteraction sharedInstance] toggleRecord];
}
- (void)updateRecordState:(BOOL)b_value
{
[o_mi_record setState:b_value];
}
- (IBAction)setPlaybackRate:(id)sender
{
[[VLCCoreInteraction sharedInstance] setPlaybackRate: [o_mi_rate_sld intValue]];
......
......@@ -183,7 +183,9 @@ struct intf_sys_t
- (void)updatePlaybackPosition;
- (void)updateName;
- (void)playlistUpdated;
- (void)updateRecordState: (BOOL)b_value;
- (void)updateInfoandMetaPanel;
- (void)updateMainMenu;
- (void)updateMainWindow;
- (void)showFullscreenController;
- (void)updateDelays;
......
......@@ -250,6 +250,7 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var,
break;
case INPUT_EVENT_TITLE:
case INPUT_EVENT_CHAPTER:
[[VLCMain sharedInstance] updateMainMenu];
break;
case INPUT_EVENT_CACHE:
[[VLCMain sharedInstance] updateMainWindow];
......@@ -267,14 +268,17 @@ static int InputEvent( vlc_object_t *p_this, const char *psz_var,
break;
case INPUT_EVENT_ITEM_META:
case INPUT_EVENT_ITEM_INFO:
[[VLCMain sharedInstance] updateMainMenu];
[[VLCMain sharedInstance] updateName];
[[VLCMain sharedInstance] updateInfoandMetaPanel];
break;
case INPUT_EVENT_BOOKMARK:
break;
case INPUT_EVENT_RECORD:
[[VLCMain sharedInstance] updateRecordState: var_GetBool( p_this, "record" )];
break;
case INPUT_EVENT_PROGRAM:
[[VLCMain sharedInstance] updateMainMenu];
break;
case INPUT_EVENT_ITEM_EPG:
break;
......@@ -1273,7 +1277,11 @@ unsigned int CocoaKeyToVLC( unichar i_key )
[o_playlist updateRowSelection];
[o_mainwindow updateWindow];
[o_mainwindow updateName];
[self updateMainMenu];
}
- (void)updateMainMenu
{
[o_mainmenu setupMenus];
[o_mainmenu updatePlaybackRate];
}
......@@ -1324,6 +1332,12 @@ unsigned int CocoaKeyToVLC( unichar i_key )
[o_mainwindow updateWindow];
}
- (void)updateRecordState: (BOOL)b_value
{
NSLog( @"record state: %i", b_value );
[o_mainmenu updateRecordState:b_value];
}
- (void)updateInfoandMetaPanel
{
[o_playlist outlineViewSelectionDidChange:nil];
......
......@@ -60,6 +60,9 @@
IBOutlet id o_hotkeys_listbox;
IBOutlet id o_hotkeys_view;
IBOutlet id o_input_record_box;
IBOutlet id o_input_record_fld;
IBOutlet id o_input_record_btn;
IBOutlet id o_input_avi_pop;
IBOutlet id o_input_avi_txt;
IBOutlet id o_input_cachelevel_pop;
......
......@@ -212,6 +212,9 @@ create_toolbar_item( NSString * o_itemIdent, NSString * o_name, NSString * o_des
[[[o_hotkeys_listbox tableColumnWithIdentifier: @"shortcut"] headerCell] setStringValue: _NS("Shortcut")];
/* input */
[o_input_record_box setTitle: _NS("Record directory or filename")];
[o_input_record_btn setTitle: _NS("Browse...")];
[o_input_record_btn setToolTip: _NS("Directory or filename where the records will be stored")];
[o_input_avi_txt setStringValue: _NS("Repair AVI Files")];
[o_input_cachelevel_txt setStringValue: _NS("Default Caching Level")];
[o_input_caching_box setTitle: _NS("Caching")];
......@@ -525,6 +528,7 @@ static inline char * __config_GetLabel( vlc_object_t *p_this, const char *psz_na
/***************************
* input & codecs settings *
***************************/
[self setupField: o_input_record_fld forOption:"input-record-path"];
[self setupField: o_input_httpproxy_fld forOption:"http-proxy"];
[self setupField: o_input_httpproxypwd_sfld forOption:"http-proxy-pwd"];
[o_input_postproc_fld setIntValue: config_GetInt( p_intf, "postproc-q")];
......@@ -864,6 +868,7 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
***************************/
if( b_inputSettingChanged )
{
config_PutPsz( p_intf, "input-record-path", [[o_input_record_fld stringValue] UTF8String] );
config_PutPsz( p_intf, "http-proxy", [[o_input_httpproxy_fld stringValue] UTF8String] );
config_PutPsz( p_intf, "http-proxy-pwd", [[o_input_httpproxypwd_sfld stringValue] UTF8String] );
config_PutInt( p_intf, "postproc-q", [o_input_postproc_fld intValue] );
......@@ -1041,6 +1046,11 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
[o_video_snap_folder_fld setStringValue: [[o_selectFolderPanel URL] path]];
b_videoSettingChanged = YES;
}
else if( contextInfo == o_input_record_btn )
{
[o_input_record_fld setStringValue: [[o_selectFolderPanel URL] path]];
b_inputSettingChanged = YES;
}
}
[o_selectFolderPanel release];
......@@ -1098,6 +1108,22 @@ static inline void save_module_list( intf_thread_t * p_intf, id object, const ch
else
[o_input_cachelevel_custom_txt setHidden: YES];
}
else if( sender == o_input_record_btn )
{
o_selectFolderPanel = [[NSOpenPanel alloc] init];
[o_selectFolderPanel setCanChooseDirectories: YES];
[o_selectFolderPanel setCanChooseFiles: YES];
[o_selectFolderPanel setResolvesAliases: YES];
[o_selectFolderPanel setAllowsMultipleSelection: NO];
[o_selectFolderPanel setMessage: _NS("Choose the directory or filename where the records will be stored.")];
[o_selectFolderPanel setCanCreateDirectories: YES];
[o_selectFolderPanel setPrompt: _NS("Choose")];
[o_selectFolderPanel beginSheetForDirectory: nil file: nil modalForWindow: o_sprefs_win
modalDelegate: self
didEndSelector: @selector(savePanelDidEnd:returnCode:contextInfo:)
contextInfo: o_input_record_btn];
return;
}
b_inputSettingChanged = YES;
}
......
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