backward = id;
faster = id;
forward = id;
+ goToSpecificTime = id;
loop = id;
mute = id;
next = id;
};
CLASS = VLCControls;
LANGUAGE = ObjC;
- OUTLETS = {"o_main" = id; "o_volumeslider" = id; };
+ OUTLETS = {
+ "o_main" = id;
+ "o_specificTime_cancel_btn" = id;
+ "o_specificTime_enter_fld" = id;
+ "o_specificTime_goTo_lbl" = id;
+ "o_specificTime_mi" = id;
+ "o_specificTime_ok_btn" = id;
+ "o_specificTime_sec_lbl" = id;
+ "o_specificTime_stepper" = id;
+ "o_specificTime_win" = id;
+ "o_volumeslider" = id;
+ };
SUPERCLASS = NSObject;
},
{
SUPERCLASS = NSObject;
},
{CLASS = VLCPlaylistView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
+ {CLASS = VLCTimeField; LANGUAGE = ObjC; SUPERCLASS = NSTextField; },
{CLASS = VLCVoutView; LANGUAGE = ObjC; SUPERCLASS = NSView; }
);
IBVersion = 1;
IBOutlet id o_btn_fullscreen;
IBOutlet id o_volumeslider;
+
+ IBOutlet id o_specificTime_cancel_btn;
+ IBOutlet id o_specificTime_enter_fld;
+ IBOutlet id o_specificTime_goTo_lbl;
+ IBOutlet id o_specificTime_ok_btn;
+ IBOutlet id o_specificTime_win;
+ IBOutlet id o_specificTime_sec_lbl;
+ IBOutlet id o_specificTime_stepper;
+ IBOutlet id o_specificTime_mi;
}
- (IBAction)play:(id)sender;
- (IBAction)toggleVar:(id)sender;
- (int)toggleVarThread:(id)_o_data;
+- (IBAction)goToSpecificTime:(id)sender;
+
@end
/*****************************************************************************
- (int)type;
@end
+
+/*****************************************************************************
+ * VLCTimeField interface
+ *****************************************************************************
+ * we need the implementation to catch our click-event in the controller window
+ *****************************************************************************/
+
+@interface VLCTimeField : NSTextField
+{
+}
+@end
+
*****************************************************************************/
@implementation VLCControls
+- (void)awakeFromNib
+{
+ [o_specificTime_mi setTitle: _NS("Go To Position")];
+ [o_specificTime_cancel_btn setTitle: _NS("Cancel")];
+ [o_specificTime_ok_btn setTitle: _NS("OK")];
+ [o_specificTime_sec_lbl setStringValue: _NS("sec.")];
+ [o_specificTime_goTo_lbl setStringValue: _NS("Go to specific position")];
+}
+
- (IBAction)play:(id)sender
{
vlc_value_t val;
return VLC_EGENERIC;
}
+- (IBAction)goToSpecificTime:(id)sender
+{
+ if( sender == o_specificTime_cancel_btn )
+ {
+ [NSApp endSheet: o_specificTime_win];
+ [o_specificTime_win close];
+ }
+ else if( sender == o_specificTime_ok_btn )
+ {
+ input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
+ VLC_OBJECT_INPUT, FIND_ANYWHERE );
+ if( p_input )
+ {
+ input_Control( p_input, INPUT_SET_TIME, \
+ (int64_t)([o_specificTime_enter_fld intValue] * 1000000));
+ vlc_object_release( p_input );
+ }
+
+ [NSApp endSheet: o_specificTime_win];
+ [o_specificTime_win close];
+ }
+ else
+ {
+ input_thread_t * p_input = (input_thread_t *)vlc_object_find( VLCIntf, \
+ VLC_OBJECT_INPUT, FIND_ANYWHERE );
+ if( p_input )
+ {
+ /* we can obviously only do that if an input is available */
+ vlc_value_t pos, length;
+ var_Get( p_input, "time", &pos );
+ [o_specificTime_enter_fld setIntValue: (pos.i_time / 1000000)];
+ var_Get( p_input, "length", &length );
+ [o_specificTime_stepper setMaxValue: (length.i_time / 1000000)];
+
+ [NSApp beginSheet: o_specificTime_win modalForWindow: \
+ [NSApp mainWindow] modalDelegate: self didEndSelector: nil \
+ contextInfo: nil];
+ [o_specificTime_win makeKeyWindow];
+ vlc_object_release( p_input );
+ }
+ }
+}
+
@end
@implementation VLCControls (NSMenuValidation)
}
@end
+
+
+/*****************************************************************************
+ * VLCTimeField implementation
+ *****************************************************************************
+ * we need this to catch our click-event in the controller window
+ *****************************************************************************/
+
+@implementation VLCTimeField
+- (void)mouseDown: (NSEvent *)ourEvent
+{
+ if( [ourEvent clickCount] > 1 )
+ [[[VLCMain sharedInstance] getControls] goToSpecificTime: nil];
+}
+@end