#import "AppleRemote.h"
#import "eyetv.h"
#import "simple_prefs.h"
-#import "vlm.h"
#import <AddressBook/AddressBook.h> /* for crashlog send mechanism */
#import <IOKit/hidsystem/ev_keymap.h> /* for the media key support */
static unichar VLCKeyToCocoa( unsigned int i_key );
static unsigned int VLCModifiersToCocoa( unsigned int i_key );
+static void updateProgressPanel (void *, const char *, float);
+static bool checkProgressPanel (void *);
+static void destroyProgressPanel (void *);
+
+static void MsgCallback( msg_cb_data_t *, msg_item_t *, unsigned );
+
#pragma mark -
#pragma mark VLC Interface Object Callbacks
vlc_restorecancel( canc );
}
-
/*****************************************************************************
* playlistChanged: Callback triggered by the intf-change playlist
* variable, to let the intf update the playlist.
NSAutoreleasePool * o_pool = [[NSAutoreleasePool alloc] init];
VLCMain *interface = (VLCMain *)data;
- const dialog_fatal_t *p_dialog = (const dialog_fatal_t *)value.p_address;
+ if( [[NSString stringWithUTF8String: type] isEqualToString: @"dialog-progress-bar"] )
+ {
+ /* the progress panel needs to update itself and therefore wants special treatment within this context */
+ dialog_progress_bar_t *p_dialog = (dialog_progress_bar_t *)value.p_address;
+
+ p_dialog->pf_update = updateProgressPanel;
+ p_dialog->pf_check = checkProgressPanel;
+ p_dialog->pf_destroy = destroyProgressPanel;
+ p_dialog->p_sys = VLCIntf->p_libvlc;
+ }
- NSValue *o_value = [NSValue valueWithPointer:p_dialog];
+ NSValue *o_value = [NSValue valueWithPointer:value.p_address];
[[NSNotificationCenter defaultCenter] postNotificationName: @"VLCNewCoreDialogEventNotification" object:[interface coreDialogProvider] userInfo:[NSDictionary dictionaryWithObjectsAndKeys: o_value, @"VLCDialogPointer", [NSString stringWithUTF8String: type], @"VLCDialogType", nil]];
[o_pool release];
return VLC_SUCCESS;
}
+void updateProgressPanel (void *priv, const char *text, float value)
+{
+ NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
+
+ NSString *o_txt;
+ if( text != NULL )
+ o_txt = [NSString stringWithUTF8String: text];
+ else
+ o_txt = @"";
+
+ [[[VLCMain sharedInstance] coreDialogProvider] updateProgressPanelWithText: o_txt andNumber: (double)(value * 1000.)];
+
+ [o_pool release];
+}
+
+void destroyProgressPanel (void *priv)
+{
+ NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
+ [[[VLCMain sharedInstance] coreDialogProvider] destroyProgressPanel];
+ [o_pool release];
+}
+
+bool checkProgressPanel (void *priv)
+{
+ NSAutoreleasePool *o_pool = [[NSAutoreleasePool alloc] init];
+ return [[[VLCMain sharedInstance] coreDialogProvider] progressCancelled];
+ [o_pool release];
+}
+
#pragma mark -
#pragma mark Private
o_prefs = nil;
o_open = [[VLCOpen alloc] init];
o_wizard = [[VLCWizard alloc] init];
- o_vlm = [[VLCVLMController alloc] init];
o_extended = nil;
o_bookmarks = [[VLCBookmarks alloc] init];
o_embedded_list = [[VLCEmbeddedList alloc] init];
[o_mu_window setTitle: _NS("Window")];
[o_mi_minimize setTitle: _NS("Minimize Window")];
[o_mi_close_window setTitle: _NS("Close Window")];
+ [o_mi_player setTitle: _NS("Player...")];
[o_mi_controller setTitle: _NS("Controller...")];
[o_mi_equalizer setTitle: _NS("Equalizer...")];
[o_mi_extended setTitle: _NS("Extended Controls...")];
unichar key = 0;
vlc_value_t val;
unsigned int i_pressed_modifiers = 0;
- struct hotkey *p_hotkeys;
+ const struct hotkey *p_hotkeys;
int i;
val.i_int = 0;
return nil;
}
-- (id)vlm
-{
- return o_vlm;
-}
-
- (id)bookmarks
{
if( o_bookmarks )
}
[o_btn_stop setEnabled: b_input];
+ [o_embedded_window setStop: b_input];
[o_btn_ff setEnabled: b_seekable];
[o_btn_rewind setEnabled: b_seekable];
[o_btn_prev setEnabled: (b_plmul || b_chapters)];
+ [o_embedded_window setPrev: (b_plmul || b_chapters)];
[o_btn_next setEnabled: (b_plmul || b_chapters)];
+ [o_embedded_window setNext: (b_plmul || b_chapters)];
[o_timeslider setFloatValue: 0.0];
[o_timeslider setEnabled: b_seekable];
[[[self controls] fspanel] setSeekable: b_seekable];
[o_embedded_window setSeekable: b_seekable];
+ [o_embedded_window setTime:@"00:00" position:0.0];
p_intf->p_sys->b_current_title_update = true;
i_volume_step = config_GetInt( p_intf->p_libvlc, "volume-step" );
[o_volumeslider setFloatValue: (float)i_lastShownVolume / i_volume_step];
[o_volumeslider setEnabled: TRUE];
+ [o_embedded_window setVolumeSlider: (float)i_lastShownVolume / i_volume_step];
+ [o_embedded_window setVolumeEnabled: TRUE];
[[[self controls] fspanel] setVolumeLevel: (float)i_lastShownVolume / i_volume_step];
p_intf->p_sys->b_mute = ( i_lastShownVolume == 0 );
p_intf->p_sys->b_volume_update = FALSE;
else
i_end_scroll = -1;
[o_scrollfield setStringValue: o_string];
+ [o_embedded_window setScrollString: o_string];
}
- (void)resetScrollField
}
}
-- (IBAction)showVLM:(id)sender
-{
- if( !nib_vlm_loaded )
- nib_vlm_loaded = [NSBundle loadNibNamed:@"VLM" owner: NSApp];
-
- [o_vlm showVLMWindow];
-}
-
- (IBAction)showExtended:(id)sender
{
if( o_extended == nil )