+
+- (IBAction)searchItem:(id)sender
+{
+ int i_current = -1;
+ NSString *o_current_name;
+ NSString *o_current_author;
+
+ intf_thread_t * p_intf = VLCIntf;
+ playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+
+ if( p_playlist == NULL )
+ {
+ return;
+ }
+ if( [o_table_view numberOfRows] < 1 )
+ {
+ return;
+ }
+
+ if( [o_table_view selectedRow] == [o_table_view numberOfRows]-1 )
+ {
+ i_current = -1;
+ }
+ else
+ {
+ i_current = [o_table_view selectedRow];
+ }
+
+ do
+ {
+ char *psz_temp;
+ i_current++;
+
+ vlc_mutex_lock( &p_playlist->object_lock );
+ o_current_name = [NSString stringWithUTF8String:
+ p_playlist->pp_items[i_current]->input.psz_name];
+ psz_temp = playlist_GetInfo(p_playlist, i_current ,_("General"),_("Author") );
+ o_current_author = [NSString stringWithUTF8String: psz_temp];
+ free( psz_temp);
+ vlc_mutex_unlock( &p_playlist->object_lock );
+
+
+ if( [o_current_name rangeOfString:[o_search_keyword stringValue] options:NSCaseInsensitiveSearch ].length ||
+ [o_current_author rangeOfString:[o_search_keyword stringValue] options:NSCaseInsensitiveSearch ].length )
+ {
+ [o_table_view selectRow: i_current byExtendingSelection: NO];
+ [o_table_view scrollRowToVisible: i_current];
+ break;
+ }
+ if( i_current == [o_table_view numberOfRows] - 1 )
+ {
+ i_current = -1;
+ }
+ }
+ while (i_current != [o_table_view selectedRow]);
+ vlc_object_release( p_playlist );
+}
+
+
+- (IBAction)handlePopUp:(id)sender
+
+{
+ intf_thread_t * p_intf = VLCIntf;
+ vlc_value_t val1,val2;
+ playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
+ FIND_ANYWHERE );
+ if( p_playlist == NULL )
+ {
+ return;
+ }
+
+ switch ([o_loop_popup indexOfSelectedItem])
+ {
+ case 1:
+
+ val1.b_bool = 0;
+ var_Set( p_playlist, "loop", val1 );
+ val1.b_bool = 1;
+ var_Set( p_playlist, "repeat", val1 );
+ vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat One" ) );
+ break;
+
+ case 2:
+ val1.b_bool = 0;
+ var_Set( p_playlist, "repeat", val1 );
+ val1.b_bool = 1;
+ var_Set( p_playlist, "loop", val1 );
+ vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat All" ) );
+ break;
+
+ default:
+ var_Get( p_playlist, "repeat", &val1 );
+ var_Get( p_playlist, "loop", &val2 );
+ if (val1.b_bool || val2.b_bool)
+ {
+ val1.b_bool = 0;
+ var_Set( p_playlist, "repeat", val1 );
+ var_Set( p_playlist, "loop", val1 );
+ vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat Off" ) );
+ }
+ break;
+ }
+ vlc_object_release( p_playlist );
+ [self playlistUpdated];
+}
+
+