"o_err_msg" = id;
"o_error" = id;
"o_info" = id;
+ "o_main_pgbar" = id;
"o_messages" = id;
"o_mi_about" = id;
"o_mi_add_intf" = id;
<string>777 479 187 249 0 0 1440 878 </string>
</dict>
<key>IBFramework Version</key>
- <string>439.0</string>
+ <string>446.1</string>
<key>IBLockedObjects</key>
<array/>
<key>IBOpenObjects</key>
<integer>21</integer>
</array>
<key>IBSystem Version</key>
- <string>8I127</string>
+ <string>8J135</string>
</dict>
</plist>
#define DIALOG_LOGIN_PW_OK_CANCEL 0x20
#define DIALOG_USER_PROGRESS 0x40
#define DIALOG_PSZ_INPUT_OK_CANCEL 0x80
+#define DIALOG_INTF_PROGRESS 0x100
/**
* Possible return codes
#define intf_UserProgress( a, b, c, d ) __intf_UserProgress( VLC_OBJECT(a),b,c, d )
VLC_EXPORT( int, __intf_UserProgress,( vlc_object_t*, const char*, const char*, float) );
-
#define intf_UserProgressUpdate( a, b, c, d ) __intf_UserProgressUpdate( VLC_OBJECT(a),b,c, d )
VLC_EXPORT( void, __intf_UserProgressUpdate,( vlc_object_t*, int, const char*, float) );
#define intf_UserStringInput( a, b, c, d ) __intf_UserStringInput( VLC_OBJECT(a),b,c,d )
VLC_EXPORT( int, __intf_UserStringInput,(vlc_object_t*, const char*, const char*, char **) );
+#define intf_IntfProgress( a, b, c, d ) __intf_IntfProgress( VLC_OBJECT(a),b,c, d )
+VLC_EXPORT( int, __intf_IntfProgress,( vlc_object_t*, const char*, float) );
+#define intf_IntfProgressUpdate( a, b, c, d ) __intf_IntfProgressUpdate( VLC_OBJECT(a),b,c, d )
+VLC_EXPORT( void, __intf_IntfProgressUpdate,( vlc_object_t*, int, const char*, float) );
+
#define intf_UserHide( a, b ) __intf_UserHide( VLC_OBJECT(a), b )
VLC_EXPORT( void, __intf_UserHide,( vlc_object_t *, int ));
{
if( p_dialog->i_flags & DIALOG_OK_CANCEL )
{
- msg_Dbg( p_intf, "requested flag: DIALOG_OK_CANCEL" );
+ msg_Dbg( p_intf, "OK-Cancel-dialog requested" );
NSBeginInformationalAlertSheet( o_title, _NS("OK") , _NS("Cancel"),
nil, o_window, self,
@selector(sheetDidEnd: returnCode: contextInfo:), NULL, nil,
}
else if( p_dialog->i_flags & DIALOG_YES_NO_CANCEL )
{
- msg_Dbg( p_intf, "requested flag: DIALOG_YES_NO_CANCEL" );
+ msg_Dbg( p_intf, "yes-no-cancel-dialog requested" );
NSBeginInformationalAlertSheet( o_title, _NS("Yes"), _NS("No"),
_NS("Cancel"), o_window, self,
@selector(sheetDidEnd: returnCode: contextInfo:), NULL, nil,
}
else if( p_dialog->i_flags & DIALOG_LOGIN_PW_OK_CANCEL )
{
- msg_Dbg( p_intf, "requested flag: DIALOG_LOGIN_PW_OK_CANCEL" );
+ msg_Dbg( p_intf, "dialog for login and pw requested" );
[o_auth_title setStringValue: o_title];
[o_auth_description setStringValue: o_description];
[o_auth_login_fld setStringValue: @""];
}
else if( p_dialog->i_flags & DIALOG_USER_PROGRESS )
{
- msg_Dbg( p_intf, "requested flag: DIALOG_USER_PROGRESS" );
+ msg_Dbg( p_intf, "user progress dialog requested" );
[o_prog_title setStringValue: o_title];
[o_prog_description setStringValue: o_description];
- [o_prog_bar setDoubleValue: 0];
+ [o_prog_bar setFloatValue: p_dialog->val.f_float];
[NSApp beginSheet: o_prog_win modalForWindow: o_window
modalDelegate: self didEndSelector: nil contextInfo: nil];
[o_prog_win makeKeyWindow];
}
else if( p_dialog->i_flags & DIALOG_PSZ_INPUT_OK_CANCEL )
{
- msg_Dbg( p_intf, "requested flag: DIALOG_PSZ_INPUT_OK_CANCEL" );
+ msg_Dbg( p_intf, "text input requested" );
[o_input_title setStringValue: o_title];
[o_input_description setStringValue: o_description];
[o_input_fld setStringValue: @""];
modalDelegate: self didEndSelector: nil contextInfo: nil];
[o_input_win makeKeyWindow];
}
+ else if( p_dialog->i_flags & DIALOG_INTF_PROGRESS )
+ {
+ msg_Dbg( p_intf, "progress-bar in main intf requested" );
+ [[[VLCMain sharedInstance] getMainScrollField]
+ setStringValue: o_description];
+ [[[VLCMain sharedInstance] getMainIntfPgbar]
+ setFloatValue: p_dialog->val.f_float];
+ [[[VLCMain sharedInstance] getMainIntfPgbar] setHidden: NO];
+ [[[VLCMain sharedInstance] getControllerWindow] makeKeyWindow];
+ }
else
msg_Warn( p_intf, "requested dialog type unknown" );
}
{
[o_prog_description setStringValue: \
[NSString stringWithUTF8String: p_dialog->psz_description]];
- [o_prog_bar setDoubleValue: \
- (double)(p_dialog->val.f_float)];
+ [o_prog_bar setFloatValue: p_dialog->val.f_float];
if( [o_prog_bar doubleValue] == 100.0 )
{
return;
}
}
+ if( p_dialog->i_flags & DIALOG_INTF_PROGRESS )
+ {
+ [[[VLCMain sharedInstance] getMainScrollField] setStringValue: \
+ [NSString stringWithUTF8String: p_dialog->psz_description]];
+ [[[VLCMain sharedInstance] getMainIntfPgbar] setFloatValue: \
+ p_dialog->val.f_float];
+
+ if( [[[VLCMain sharedInstance] getMainIntfPgbar] doubleValue] == 100.0 )
+ {
+ /* we are done, let's hide */
+ [self hideDialog];
+ return;
+ }
+ }
}
-(void)hideDialog
[NSApp endSheet: o_input_win];
[o_input_win close];
}
+ if( p_dialog->i_flags & DIALOG_INTF_PROGRESS )
+ {
+ [[[VLCMain sharedInstance] getMainIntfPgbar] setIndeterminate: YES];
+ [[[VLCMain sharedInstance] getMainScrollField] setStringValue: @""];
+ [[[VLCMain sharedInstance] getMainIntfPgbar] setHidden: YES];
+ }
}
-(void)destroyDialog
float f_slider_old; /* old slider val */
IBOutlet id o_volumeslider; /* volume slider */
+ IBOutlet id o_main_pgbar; /* main interface progress bar */
IBOutlet id o_btn_prev; /* btn previous */
IBOutlet id o_btn_rewind; /* btn rewind */
IBOutlet id o_btn_play; /* btn play */
- (id)getBookmarks;
- (id)getEmbeddedList;
- (id)getInteractionList;
+- (id)getMainIntfPgbar;
+- (id)getMainScrollField;
+- (id)getControllerWindow;
- (void)terminate;
- (NSString *)localizedString:(char *)psz;
- (char *)delocalizeString:(NSString *)psz;
return nil;
}
+- (id)getMainIntfPgbar
+{
+ if( o_main_pgbar )
+ return o_main_pgbar;
+
+ msg_Err( p_intf, "main interface progress bar item wasn't found" );
+ return nil;
+}
+
+- (id)getMainScrollField
+{
+ if( o_scrollfield )
+ return o_scrollfield;
+
+ msg_Err( p_intf, "main scroll field item wasn't found" );
+ return nil;
+}
+
+- (id)getControllerWindow
+{
+ if( o_window )
+ return o_window;
+ return nil;
+}
+
- (void)manage
{
playlist_t * p_playlist;
return i_ret;
}
+/** Helper function to create a progress-bar in the main interface with a
+ * single-line description
+ * \param p_this Parent vlc_object
+ * \param psz_status Current status
+ * \param f_position Current position (0.0->100.0)
+ * \return Dialog id, to give to IntfProgressUpdate
+ */
+int __intf_IntfProgress( vlc_object_t *p_this,
+ const char *psz_status,
+ float f_pos )
+{
+ int i_ret;
+ interaction_dialog_t *p_new = NULL;
+
+ INTERACT_INIT( p_new );
+
+ p_new->i_type = INTERACT_DIALOG_ONEWAY;
+ p_new->psz_description = strdup( psz_status );
+ p_new->val.f_float = f_pos;
+
+ p_new->i_flags = DIALOG_INTF_PROGRESS;
+
+ i_ret = intf_Interact( p_this, p_new );
+
+ return p_new->i_id;
+}
+
+/** Update the progress bar in the main interface
+ * \param p_this Parent vlc_object
+ * \param i_id Identifier of the dialog
+ * \param psz_status New status
+ * \param f_position New position (0.0->100.0)
+ * \return nothing
+ */
+void __intf_IntfProgressUpdate( vlc_object_t *p_this, int i_id,
+ const char *psz_status, float f_pos )
+{
+ interaction_t *p_interaction = intf_InteractionGet( p_this );
+ interaction_dialog_t *p_dialog;
+
+ if( !p_interaction ) return;
+
+ vlc_mutex_lock( &p_interaction->object_lock );
+ p_dialog = intf_InteractionGetById( p_this, i_id );
+
+ if( !p_dialog )
+ {
+ vlc_mutex_unlock( &p_interaction->object_lock ) ;
+ return;
+ }
+
+ if( p_dialog->psz_description )
+ free( p_dialog->psz_description );
+ p_dialog->psz_description = strdup( psz_status );
+
+ p_dialog->val.f_float = f_pos;
+
+ p_dialog->i_status = UPDATED_DIALOG;
+ vlc_mutex_unlock( &p_interaction->object_lock) ;
+}
+
/** Hide an interaction dialog
* \param p_this the parent vlc object
* \param i_id the id of the item to hide