extern int w32g_add_playlist(int nfiles, char **files, int expand_flag,
int autouniq, int autorefine);
extern char *w32g_get_playlist(int idx);
+extern char *w32g_get_playlist_title(int idx);
extern int w32g_next_playlist(int skip_invalid_file);
extern int w32g_prev_playlist(int skip_invalid_file);
extern int w32g_random_playlist(int skip_invalid_file);
extern void w32g_update_playlist(void);
extern void w32g_get_playlist_index(int *selected, int *nfiles, int *cursel);
extern int w32g_goto_playlist(int num, int skip_invalid_file);
+extern void w32g_focus_playlist_index(int idx);
extern int w32g_delete_playlist(int pos);
extern int w32g_nvalid_playlist(void);
extern int w32g_ismidi_playlist(int n);
extern char *w32g_get_playlist_play(int idx);
extern void w32g_get_playlist_play_index(int *selected);
#ifdef LISTVIEW_PLAYLIST
+extern char *w32g_get_playlist_artist(int idx);
extern void w32g_copy_playlist(void);
extern void w32g_paste_playlist(int uniq, int refine);
#endif
return 0;
}
+void w32g_focus_playlist_index(int idx)
+{
+ HWND hList;
+
+ if (!(hList = playlist_box()))
+ return;
+
+#ifdef LISTVIEW_PLAYLIST
+ ListView_SetItemState(hList, -1, 0, LVIS_SELECTED | LVIS_FOCUSED);
+ ListView_SetItemState(hList, idx, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED);
+ ListView_EnsureVisible(hList, idx, FALSE);
+#else
+ ListBox_SetCurSel(hList, cur);
+#endif
+}
+
int w32g_isempty_playlist(void)
{
return playlist_ctrl->nfiles == 0;
return playlist_ctrl->list[idx].filepath;
}
+char *w32g_get_playlist_title(int idx)
+{
+ if (idx < 0 || idx >= playlist_ctrl->nfiles)
+ return NULL;
+ return playlist_ctrl->list[idx].title;
+}
+
char *w32g_get_playlist_play(int idx)
{
if (idx < 0 || idx >= playlist_play->nfiles)
}
#ifdef LISTVIEW_PLAYLIST
+
+char *w32g_get_playlist_artist(int idx)
+{
+ if (idx < 0 || idx >= playlist_ctrl->nfiles)
+ return NULL;
+ return playlist_ctrl->list[idx].artist;
+}
+
void w32g_copy_playlist(void)
{
int i, num, pos, selnum = 0;
//****************************************************************************
// List Search Dialog
-#define ListSearchStringMax 256
+#define ListSearchStringMax 1024
static char ListSearchString[ListSearchStringMax];
LRESULT CALLBACK ListSearchWndProc(HWND hwnd, UINT uMess, WPARAM wParam, LPARAM lParam);
{
int selected, nfiles, cursel;
SendDlgItemMessage(hwnd,IDC_EDIT_ONE_LINE,
- WM_GETTEXT,(WPARAM)250,(LPARAM)ListSearchString);
+ WM_GETTEXT,(WPARAM)ListSearchStringMax,(LPARAM)ListSearchString);
w32g_get_playlist_index(&selected, &nfiles, &cursel);
+ if (LOWORD(wParam) == IDC_BUTTON_1)
+ cursel = 0;
if ( LOWORD(wParam) == IDC_BUTTON_2 )
cursel++;
if ( strlen ( ListSearchString ) > 0 ) {
- char buff[ListSearchStringBuffSize];
for ( ; cursel < nfiles; cursel ++ ) {
- int result = SendDlgItemMessage(hListWnd,IDC_LISTBOX_PLAYLIST,
- LB_GETTEXTLEN,(WPARAM)cursel, 0 );
- if ( result < ListSearchStringBuffSize ) {
- result = SendDlgItemMessage(hListWnd,IDC_LISTBOX_PLAYLIST,
- LB_GETTEXT,(WPARAM)cursel,(LPARAM)buff);
- if ( result == LB_ERR ) {
- cursel = LB_ERR;
- break;
- }
- if ( strstr ( buff, ListSearchString ) != NULL ) {
- break;
- }
- } else if ( result == LB_ERR ) {
- cursel = LB_ERR;
+ const char *str = w32g_get_playlist(cursel);
+ if (str != NULL && strstr(str, ListSearchString) != NULL) {
+ break;
+ }
+
+ str = w32g_get_playlist_title(cursel);
+ if (str != NULL && strstr(str, ListSearchString) != NULL) {
+ break;
+ }
+#ifdef LISTVIEW_PLAYLIST
+ str = w32g_get_playlist_artist(cursel);
+ if (str != NULL && strstr(str, ListSearchString) != NULL) {
break;
}
+#endif
}
if ( cursel >= nfiles ) {
cursel = LB_ERR;
cursel = LB_ERR;
}
if ( cursel != LB_ERR ) {
- SendDlgItemMessage(hListWnd,IDC_LISTBOX_PLAYLIST,
- LB_SETCURSEL,(WPARAM)cursel,0);
- SetNumListWnd(cursel,nfiles);
- if ( LOWORD(wParam) == IDC_BUTTON_1 )
- HideListSearch();
+ w32g_focus_playlist_index(cursel);
+ //if ( LOWORD(wParam) == IDC_BUTTON_1 )
+ // HideListSearch();
+ } else {
+ if (PlayerLanguage == LANGUAGE_JAPANESE) {
+ MessageBox(hwnd, "\88ê\92v\82·\82é\8d\80\96Ú\82ª\8c©\82Â\82©\82è\82Ü\82¹\82ñ", "\83v\83\8c\83C\83\8a\83X\83g\82Ì\8c\9f\8dõ", MB_ICONINFORMATION);
+ } else {
+ MessageBox(hwnd, "No matches found.", "Playlist Search", MB_ICONINFORMATION);
+ }
}
}
break;