]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/interaction.m
Custom lock for interaction
[vlc] / modules / gui / macosx / interaction.m
index 32c9bd9c063d57049bc80579c59715502f7d70c9..819a4d512e956a057e027c5fc2b27fd15d012a80 100644 (file)
 - (void)sheetDidEnd:(NSWindow *)o_sheet returnCode:(int)i_return
     contextInfo:(void *)o_context
 {
-    vlc_object_lock( (vlc_object_t *)(p_dialog->p_interaction) );
+    vlc_mutex_lock( p_dialog->p_lock );
     if( i_return == NSAlertDefaultReturn )
     {
         p_dialog->i_return = DIALOG_OK_YES;
         p_dialog->i_return = DIALOG_CANCELLED;
     }
     p_dialog->i_status = ANSWERED_DIALOG;
-    vlc_object_unlock( (vlc_object_t *)(p_dialog->p_interaction) );
+    vlc_mutex_unlock( p_dialog->p_lock );
 }
 
 -(void)updateDialog
 - (IBAction)cancelAndClose:(id)sender
 {
     /* tell the core that the dialog was cancelled in a yes/no-style dialogue */
-    vlc_object_lock( (vlc_object_t *)(p_dialog->p_interaction) );
+    vlc_mutex_lock( p_dialog->p_lock );
     p_dialog->i_return = DIALOG_CANCELLED;
     p_dialog->i_status = ANSWERED_DIALOG;
-    vlc_object_unlock( (vlc_object_t *)(p_dialog->p_interaction) );
+    vlc_mutex_unlock( p_dialog->p_lock );
     msg_Dbg( p_intf, "dialog cancelled" );
 }
 
 {
     /* tell core that the user wishes to cancel the dialogue
      * Use this function if cancelling is optionally like in the progress-dialogue */
-    vlc_object_lock( (vlc_object_t *)(p_dialog->p_interaction) );
+    vlc_mutex_lock( p_dialog->p_lock );
     p_dialog->b_cancelled = true;
-    vlc_object_unlock( (vlc_object_t *)(p_dialog->p_interaction) );
+    vlc_mutex_unlock( p_dialog->p_lock );
     msg_Dbg( p_intf, "cancelling dialog, will close it later on" );
 }
 
 - (IBAction)okayAndClose:(id)sender
 {
     msg_Dbg( p_intf, "running okayAndClose" );
-    vlc_object_lock( (vlc_object_t *)(p_dialog->p_interaction) );
+    vlc_mutex_lock( p_dialog->p_lock );
     if( p_dialog->i_flags == DIALOG_LOGIN_PW_OK_CANCEL )
     {
         p_dialog->psz_returned[0] = strdup( [[o_auth_login_fld stringValue] UTF8String] );
         p_dialog->psz_returned[0] = strdup( [[o_input_fld stringValue] UTF8String] );
     p_dialog->i_return = DIALOG_OK_YES;
     p_dialog->i_status = ANSWERED_DIALOG;
-    vlc_object_unlock( (vlc_object_t *)(p_dialog->p_interaction) );
+    vlc_mutex_unlock( p_dialog->p_lock );
     msg_Dbg( p_intf, "dialog acknowledged" );
 }