Commit be801200 authored by Felix Paul Kühne's avatar Felix Paul Kühne

macosx: added a track synchronization panel

parent 0f0a2b2e
......@@ -137,6 +137,10 @@ EXTRA_DIST += \
extras/package/macosx/Resources/English.lproj/CoreDialogs.nib/keyedobjects.nib \
extras/package/macosx/Resources/English.lproj/ErrorPanel.nib/designable.nib \
extras/package/macosx/Resources/English.lproj/ErrorPanel.nib/keyedobjects.nib \
extras/package/macosx/Resources/English.lproj/AudioEffects.nib/designable.nib \
extras/package/macosx/Resources/English.lproj/AudioEffects.nib/keyedobjects.nib \
extras/package/macosx/Resources/English.lproj/SyncTracks.nib/designable.nib \
extras/package/macosx/Resources/English.lproj/SyncTracks.nib/keyedobjects.nib \
extras/package/macosx/Resources/English.lproj/InfoPlist.strings.in \
extras/package/macosx/Resources/dsa_pub.pem \
extras/package/macosx/Resources/aiff.icns \
......
......@@ -60,6 +60,7 @@ Interfaces:
and important cleanups and optimisations
* ncurses: heavy refactor of the complete interface
* Mac OS X: new Audio Effects panel adding Compressor and Spatializer filters
* Mac OS X: new Track Synchronization panel
* The rc and telnet lua interfaces were merged into a new "cli" interface
Video Output:
......
......@@ -151,6 +151,7 @@
CC62B95F0FC600E90077BB8C /* pause_big.png in Resources */ = {isa = PBXBuildFile; fileRef = CC62B9570FC600E90077BB8C /* pause_big.png */; };
CC62B9600FC600E90077BB8C /* play_big_down.png in Resources */ = {isa = PBXBuildFile; fileRef = CC62B9580FC600E90077BB8C /* play_big_down.png */; };
CC62B9610FC600E90077BB8C /* play_big.png in Resources */ = {isa = PBXBuildFile; fileRef = CC62B9590FC600E90077BB8C /* play_big.png */; };
CC707EC8137474A50003010A /* SyncTracks.nib in Resources */ = {isa = PBXBuildFile; fileRef = CC707EC6137474A50003010A /* SyncTracks.nib */; };
CC8062641021F8790021EB9A /* dsa_pub.pem in Resources */ = {isa = PBXBuildFile; fileRef = CC8062631021F8790021EB9A /* dsa_pub.pem */; };
CC84FB2D130083BB00816D38 /* BGHUDAppKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CC84FB2C130083BB00816D38 /* BGHUDAppKit.framework */; };
CC84FB481300843200816D38 /* BGHUDAppKit.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = CC84FB2C130083BB00816D38 /* BGHUDAppKit.framework */; };
......@@ -333,6 +334,9 @@
CC6D8D9D0A878DED006F2BBE /* AppleRemote.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = AppleRemote.m; path = ../../../modules/gui/macosx/AppleRemote.m; sourceTree = SOURCE_ROOT; };
CC6EDD4F0B9CA2140096068A /* eyetv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = eyetv.h; path = ../../../modules/gui/macosx/eyetv.h; sourceTree = SOURCE_ROOT; };
CC6EDD500B9CA2140096068A /* eyetv.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = eyetv.m; path = ../../../modules/gui/macosx/eyetv.m; sourceTree = SOURCE_ROOT; };
CC707EC3137464CD0003010A /* TrackSynchronization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TrackSynchronization.h; path = ../../../modules/gui/macosx/TrackSynchronization.h; sourceTree = "<group>"; };
CC707EC4137464CD0003010A /* TrackSynchronization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TrackSynchronization.m; path = ../../../modules/gui/macosx/TrackSynchronization.m; sourceTree = "<group>"; };
CC707EC7137474A50003010A /* English */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = English; path = Resources/English.lproj/SyncTracks.nib; sourceTree = "<group>"; };
CC772DAC10E621C100675C9B /* VLCProgressPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VLCProgressPanel.h; path = ../../../modules/gui/macosx_dialog_provider/VLCProgressPanel.h; sourceTree = SOURCE_ROOT; };
CC772DAD10E621C100675C9B /* VLCProgressPanel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VLCProgressPanel.m; path = ../../../modules/gui/macosx_dialog_provider/VLCProgressPanel.m; sourceTree = SOURCE_ROOT; };
CC8062631021F8790021EB9A /* dsa_pub.pem */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = dsa_pub.pem; path = Resources/dsa_pub.pem; sourceTree = "<group>"; };
......@@ -524,6 +528,8 @@
CCF0777C13659A8000AF19FD /* SPMediaKeyTap.m */,
CC5560231365CDC700D54038 /* AudioEffects.h */,
CC5560241365CDC800D54038 /* AudioEffects.m */,
CC707EC3137464CD0003010A /* TrackSynchronization.h */,
CC707EC4137464CD0003010A /* TrackSynchronization.m */,
);
name = Classes;
sourceTree = "<group>";
......@@ -798,6 +804,7 @@
DC7F46EB08A183FC0027DB24 /* Extended.nib */,
DCE7BD0308A56C8B007B10AE /* Bookmarks.nib */,
CC5560261365CE4800D54038 /* AudioEffects.nib */,
CC707EC6137474A50003010A /* SyncTracks.nib */,
);
name = nibs;
sourceTree = "<group>";
......@@ -994,6 +1001,7 @@
CC0FB34C0F8BED1100F057F7 /* CoreDialogs.nib in Resources */,
CCF11B540F8BFB520088542D /* ErrorPanel.nib in Resources */,
CC5560281365CE4800D54038 /* AudioEffects.nib in Resources */,
CC707EC8137474A50003010A /* SyncTracks.nib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -1016,6 +1024,14 @@
name = AudioEffects.nib;
sourceTree = "<group>";
};
CC707EC6137474A50003010A /* SyncTracks.nib */ = {
isa = PBXVariantGroup;
children = (
CC707EC7137474A50003010A /* English */,
);
name = SyncTracks.nib;
sourceTree = "<group>";
};
CCC896B80D9AA9E8005AE59C /* MediaInfo.nib */ = {
isa = PBXVariantGroup;
children = (
......
......@@ -45,6 +45,8 @@ SOURCES_macosx = \
extended.m \
AudioEffects.h \
AudioEffects.m \
TrackSynchronization.h \
TrackSynchronization.m \
bookmarks.h \
bookmarks.m \
embeddedwindow.h \
......
/*****************************************************************************
* TrackSynchronization.h: MacOS X interface module
*****************************************************************************
* Copyright (C) 2011 VideoLAN
* Copyright (C) 2011 Felix Paul Kühne
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import <Cocoa/Cocoa.h>
@interface VLCTrackSynchronization : NSObject {
/* generic */
IBOutlet id o_window;
intf_thread_t *p_intf;
IBOutlet id o_reset_btn;
/* Audio / Video */
IBOutlet id o_av_lbl;
IBOutlet id o_av_advance_lbl;
IBOutlet id o_av_minus_btn;
IBOutlet id o_av_plus_btn;
IBOutlet id o_av_value_fld;
/* Subtitles / Video */
IBOutlet id o_sv_lbl;
IBOutlet id o_sv_advance_lbl;
IBOutlet id o_sv_advance_minus_btn;
IBOutlet id o_sv_advance_plus_btn;
IBOutlet id o_sv_advance_value_fld;
IBOutlet id o_sv_speed_lbl;
IBOutlet id o_sv_speed_minus_btn;
IBOutlet id o_sv_speed_plus_btn;
IBOutlet id o_sv_speed_value_fld;
}
/* generic */
+ (VLCTrackSynchronization *)sharedInstance;
- (IBAction)toggleWindow:(id)sender;
- (IBAction)resetValues:(id)sender;
/* Audio / Video */
- (IBAction)avValueChanged:(id)sender;
/* Subtitles / Video */
- (IBAction)svAdvanceValueChanged:(id)sender;
- (IBAction)svSpeedValueChanged:(id)sender;
@end
/*****************************************************************************
* TrackSynchronization.m: MacOS X interface module
*****************************************************************************
* Copyright (C) 2011 VideoLAN
* Copyright (C) 2011 Felix Paul Kühne
* $Id$
*
* Authors: Felix Paul Kühne <fkuehne -at- videolan -dot- org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#import "intf.h"
#import <vlc_common.h>
#import "TrackSynchronization.h"
@implementation VLCTrackSynchronization
static VLCTrackSynchronization *_o_sharedInstance = nil;
+ (VLCTrackSynchronization *)sharedInstance
{
return _o_sharedInstance ? _o_sharedInstance : [[self alloc] init];
}
- (id)init
{
if (_o_sharedInstance) {
[self dealloc];
} else {
p_intf = VLCIntf;
_o_sharedInstance = [super init];
}
return _o_sharedInstance;
}
- (void)awakeFromNib
{
[o_window setTitle:_NS("Track Synchronization")];
[o_reset_btn setTitle:_NS("Reset")];
[o_av_lbl setStringValue:_NS("Audio/Video")];
[o_av_advance_lbl setStringValue: _NS("Advance of audio over video:")];
[[o_av_value_fld formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("s")]];
[o_av_value_fld setToolTip: _NS("A positive value means that the audio is ahead of the video")];
[o_sv_lbl setStringValue: _NS("Subtitles/Video")];
[o_sv_advance_lbl setStringValue: _NS("Advance of subtitles over video:")];
[[o_sv_advance_value_fld formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("s")]];
[o_sv_advance_value_fld setToolTip: _NS("A positive value means that the subtitles are ahead of the video" )];
[o_sv_speed_lbl setStringValue: _NS("Speed of the subtitles:")];
[[o_sv_speed_value_fld formatter] setFormat:[NSString stringWithFormat:@"#,##0.000 %@", _NS("fps")]];
[self resetValues:self];
}
- (IBAction)toggleWindow:(id)sender
{
if( [o_window isVisible] )
[o_window orderOut:sender];
else
[o_window makeKeyAndOrderFront:sender];
}
- (IBAction)resetValues:(id)sender
{
[o_av_value_fld setFloatValue:0.0];
[o_sv_advance_value_fld setFloatValue:0.0];
[o_sv_speed_value_fld setFloatValue:1.0];
input_thread_t * p_input = pl_CurrentInput( p_intf );
if( p_input )
{
var_SetTime( p_input, "audio-delay", 0.0 );
var_SetTime( p_input, "spu-delay", 0.0 );
var_SetFloat( p_input, "sub-fps", 1.0 );
vlc_object_release( p_input );
}
}
- (IBAction)avValueChanged:(id)sender
{
if( sender == o_av_minus_btn )
[o_av_value_fld setFloatValue: [o_av_value_fld floatValue] - 0.5];
if( sender == o_av_plus_btn )
[o_av_value_fld setFloatValue: [o_av_value_fld floatValue] + 0.5];
input_thread_t * p_input = pl_CurrentInput( p_intf );
if( p_input )
{
int64_t i_delay = [o_av_value_fld floatValue] * 1000000;
var_SetTime( p_input, "audio-delay", i_delay );
vlc_object_release( p_input );
}
}
- (IBAction)svAdvanceValueChanged:(id)sender
{
if( sender == o_sv_advance_minus_btn )
[o_sv_advance_value_fld setFloatValue: [o_sv_advance_value_fld floatValue] - 0.5];
if( sender == o_sv_advance_plus_btn )
[o_sv_advance_value_fld setFloatValue: [o_sv_advance_value_fld floatValue] + 0.5];
input_thread_t * p_input = pl_CurrentInput( p_intf );
if( p_input )
{
int64_t i_delay = [o_sv_advance_value_fld floatValue] * 1000000;
var_SetTime( p_input, "spu-delay", i_delay );
vlc_object_release( p_input );
}
}
- (IBAction)svSpeedValueChanged:(id)sender
{
if( sender == o_sv_speed_minus_btn )
[o_sv_speed_value_fld setFloatValue: [o_sv_speed_value_fld floatValue] - 0.5];
if( sender == o_sv_speed_plus_btn )
[o_sv_speed_value_fld setFloatValue: [o_sv_speed_value_fld floatValue] + 0.5];
input_thread_t * p_input = pl_CurrentInput( p_intf );
if( p_input )
{
var_SetFloat( p_input, "sub-fps", [o_av_value_fld floatValue] );
vlc_object_release( p_input );
}
}
- (void)controlTextDidChange:(NSNotification *)aNotification
{
if( [aNotification object] == o_av_value_fld )
[self avValueChanged:self];
else if( [aNotification object] == o_sv_advance_value_fld )
[self svAdvanceValueChanged:self];
else if( [aNotification object] == o_sv_speed_value_fld )
[self svSpeedValueChanged:self];
}
@end
......@@ -112,6 +112,7 @@ struct intf_sys_t
VLCInformation * o_info; /* VLCInformation */
id o_eyetv; /* VLCEyeTVController */
id o_audioeffects; /* VLCAudioEffects */
id o_trackSynchronization; /* VLCTrackSynchronization */
BOOL nib_main_loaded; /* main nibfile */
BOOL nib_open_loaded; /* open nibfile */
BOOL nib_about_loaded; /* about nibfile */
......@@ -122,6 +123,7 @@ struct intf_sys_t
BOOL nib_info_loaded; /* information panel nibfile */
BOOL nib_coredialogs_loaded; /* CoreDialogs nibfile */
BOOL nib_audioeffects_loaded; /* audio effects panel */
BOOL nib_tracksynchro_loaded; /* track synchro panel */
IBOutlet VLCControllerWindow * o_window; /* main window */
IBOutlet NSView * o_playlist_view; /* playlist view */
......@@ -210,6 +212,7 @@ struct intf_sys_t
IBOutlet NSMenuItem * o_mi_faster;
IBOutlet NSMenuItem * o_mi_slower;
IBOutlet NSMenuItem * o_mi_normalSpeed;
IBOutlet NSMenuItem * o_mi_trackSynchronization;
IBOutlet NSMenuItem * o_mi_previous;
IBOutlet NSMenuItem * o_mi_next;
IBOutlet NSMenuItem * o_mi_random;
......@@ -406,6 +409,7 @@ struct intf_sys_t
- (IBAction)showWizard:(id)sender;
- (IBAction)showExtended:(id)sender;
- (IBAction)showAudioEffects:(id)sender;
- (IBAction)showTrackSynchronization:(id)sender;
- (IBAction)showBookmarks:(id)sender;
- (IBAction)viewAbout:(id)sender;
......
......@@ -55,6 +55,7 @@
#import "eyetv.h"
#import "simple_prefs.h"
#import "AudioEffects.h"
#import "TrackSynchronization.h"
#import <AddressBook/AddressBook.h> /* for crashlog send mechanism */
#import <Sparkle/Sparkle.h> /* we're the update delegate */
......@@ -651,6 +652,7 @@ static VLCMain *_o_sharedMainInstance = nil;
[o_mi_faster setTitle: _NS("Faster")];
[o_mi_slower setTitle: _NS("Slower")];
[o_mi_normalSpeed setTitle: _NS("Normal rate")];
[o_mi_trackSynchronization setTitle: _NS("Track Synchronization")];
[o_mi_previous setTitle: _NS("Previous")];
[o_mi_next setTitle: _NS("Next")];
[o_mi_random setTitle: _NS("Random")];
......@@ -849,6 +851,9 @@ static VLCMain *_o_sharedMainInstance = nil;
if (nib_audioeffects_loaded)
[o_audioeffects release];
if (nib_tracksynchro_loaded)
[o_trackSynchronization release];
if( nib_bookmarks_loaded )
[o_bookmarks release];
......@@ -2250,6 +2255,17 @@ end:
[o_extended showPanel];
}
- (IBAction)showTrackSynchronization:(id)sender
{
if (!o_trackSynchronization)
o_trackSynchronization = [[VLCTrackSynchronization alloc] init];
if (!nib_tracksynchro_loaded)
nib_tracksynchro_loaded = [NSBundle loadNibNamed:@"SyncTracks" owner:NSApp];
[o_trackSynchronization toggleWindow:sender];
}
- (IBAction)showAudioEffects:(id)sender
{
if (!o_audioeffects)
......
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