// Assign the window styles for the tree view.
dwStyle = WS_VISIBLE | WS_CHILD | TVS_HASLINES | TVS_LINESATROOT |
- TVS_HASBUTTONS;
+ TVS_HASBUTTONS;
// Create the tree-view control.
hwndTV = CreateWindowEx( 0, WC_TREEVIEW, NULL, dwStyle, 0, MENU_HEIGHT,
- rect.right-rect.left,
- rect.bottom-rect.top-MENU_HEIGHT,
- hwnd, NULL, hInst, NULL );
+ rect.right-rect.left,
+ rect.bottom-rect.top-MENU_HEIGHT,
+ hwnd, NULL, hInst, NULL );
// Be sure that the tree view actually was created.
if( !hwndTV ) return FALSE;
info_category_t *p_cat = p_input->input.p_item->pp_categories[i];
// Set the text of the item.
- tvi.pszText = _FROMMB( p_input->input.p_item->psz_name );
- tvi.cchTextMax = _tcslen( tvi.pszText );
-
- // Save the heading level in the item's application-defined data area
- tvi.lParam = (LPARAM)2; // level 2
- tvins.item = tvi;
- tvins.hInsertAfter = hPrev;
- tvins.hParent = hPrevRootItem;
+ tvi.pszText = _FROMMB( p_input->input.p_item->psz_name );
+ tvi.cchTextMax = _tcslen( tvi.pszText );
+
+ // Save the heading level in the item's application-defined data area
+ tvi.lParam = (LPARAM)2; // level 2
+ tvins.item = tvi;
+ tvins.hInsertAfter = hPrev;
+ tvins.hParent = hPrevRootItem;
- // Add the item to the tree-view control.
- hPrev = (HTREEITEM)TreeView_InsertItem( hwnd, &tvins );
+ // Add the item to the tree-view control.
+ hPrev = (HTREEITEM)TreeView_InsertItem( hwnd, &tvins );
- hPrevLev2Item = hPrev;
+ hPrevLev2Item = hPrev;
for( int j = 0; j < p_cat->i_infos; j++ )
{
info_t *p_info = p_cat->pp_infos[j];
- // Set the text of the item.
- string szAnsi = (string)p_info->psz_name;
- szAnsi += ": ";
- szAnsi += p_info->psz_value;
- tvi.pszText = _FROMMB( szAnsi.c_str() );
- tvi.cchTextMax = _tcslen( tvi.pszText );
- tvi.lParam = (LPARAM)3; // level 3
- tvins.item = tvi;
- tvins.hInsertAfter = hPrev;
- tvins.hParent = hPrevLev2Item;
+ // Set the text of the item.
+ string szAnsi = (string)p_info->psz_name;
+ szAnsi += ": ";
+ szAnsi += p_info->psz_value;
+ tvi.pszText = (TCHAR *)_FROMMB( szAnsi.c_str() );
+ tvi.cchTextMax = _tcslen( tvi.pszText );
+ tvi.lParam = (LPARAM)3; // level 3
+ tvins.item = tvi;
+ tvins.hInsertAfter = hPrev;
+ tvins.hParent = hPrevLev2Item;
- // Add the item to the tree-view control.
- hPrev = (HTREEITEM)TreeView_InsertItem( hwnd, &tvins );
+ // Add the item to the tree-view control.
+ hPrev = (HTREEITEM)TreeView_InsertItem( hwnd, &tvins );
}
- TreeView_Expand( hwnd, hPrevLev2Item, TVE_EXPANDPARTIAL |TVE_EXPAND );
+ TreeView_Expand( hwnd, hPrevLev2Item, TVE_EXPANDPARTIAL |TVE_EXPAND );
}
vlc_mutex_unlock( &p_input->input.p_item->lock );
***********************************************************************/
LRESULT FileInfo::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
- PBOOL pbProcessed )
+ PBOOL pbProcessed )
{
SHINITDLGINFO shidi;
case WM_INITDIALOG:
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN |
- SHIDIF_FULLSCREENNOMENUBAR;//SHIDIF_SIZEDLGFULLSCREEN;
+ SHIDIF_FULLSCREENNOMENUBAR;//SHIDIF_SIZEDLGFULLSCREEN;
shidi.hDlg = hwnd;
SHInitDialog( &shidi );
- CreateTreeView( hwnd );
- UpdateWindow( hwnd );
- SHFullScreen( GetForegroundWindow(), SHFS_HIDESIPBUTTON );
- return lResult;
+ CreateTreeView( hwnd );
+ UpdateWindow( hwnd );
+ SHFullScreen( GetForegroundWindow(), SHFS_HIDESIPBUTTON );
+ return lResult;
case WM_COMMAND:
if ( LOWORD(wp) == IDOK )
// The TBBUTTON structure contains information the toolbar buttons.
static TBBUTTON tbButton[] =
{
- {0, ID_FILE_QUICKOPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {1, ID_FILE_OPENNET, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1},
- {2, StopStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {3, PlayStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1},
- {4, ID_VIEW_PLAYLIST, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1},
- {5, PrevStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {6, NextStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1},
- {7, SlowStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {8, FastStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
+ {0, ID_FILE_QUICKOPEN, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {1, ID_FILE_OPENNET, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {2, StopStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {3, PlayStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {4, ID_VIEW_PLAYLIST, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {5, PrevStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {6, NextStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {7, SlowStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {8, FastStream_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
};
// Toolbar ToolTips
dwStyle = WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS |
WS_EX_OVERLAPPEDWINDOW | CCS_NOPARENTALIGN;
- hwndTB = CreateToolbarEx( hwnd, dwStyle, NULL, NUMIMAGES,
+ hwndTB = CreateToolbarEx( hwnd, dwStyle, 0, NUMIMAGES,
hInst, IDB_BITMAP1, tbButton, sizeof(tbButton) / sizeof(TBBUTTON),
BUTTONWIDTH, BUTTONHEIGHT, IMAGEWIDTH, IMAGEHEIGHT, sizeof(TBBUTTON) );
// Registers TRACKBAR_CLASS control classes from the common control dll
InitCommonControlsEx( &iccex );
- hwndSlider = CreateWindowEx( NULL, TRACKBAR_CLASS, NULL,
+ hwndSlider = CreateWindowEx( 0, TRACKBAR_CLASS, NULL,
WS_CHILD | WS_VISIBLE | TBS_HORZ | WS_EX_OVERLAPPEDWINDOW |
TBS_BOTTOM, //|WS_CLIPSIBLINGS,
0, 0, 0, 0, hwnd, NULL, hInst, NULL );
// Registers TRACKBAR_CLASS control classes from the common control dll
InitCommonControlsEx( &iccex );
- hwndVol = CreateWindowEx( NULL, TRACKBAR_CLASS, NULL,
+ hwndVol = CreateWindowEx( 0, TRACKBAR_CLASS, NULL,
WS_CHILD | WS_VISIBLE | TBS_VERT | TBS_RIGHT | TBS_AUTOTICKS |
WS_EX_OVERLAPPEDWINDOW, //|WS_CLIPSIBLINGS,
0, 0, 0, 0, hwnd, NULL, hInst, NULL );
// Create the statusbar control
dwStyle = WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS | CCS_NOPARENTALIGN;
- hwndSB = CreateWindowEx( NULL, STATUSCLASSNAME, NULL,
+ hwndSB = CreateWindowEx( 0, STATUSCLASSNAME, NULL,
WS_CHILD | WS_VISIBLE | TBS_VERT | TBS_BOTTOM |
TBS_RIGHT |WS_CLIPSIBLINGS,
0, 0, CW_USEDEFAULT, 50, hwnd, NULL, hInst, 0 );
// call the base class first
LRESULT lResult = CBaseWindow::WndProc( hwnd, msg, wp, lp, pbProcessed );
- BOOL bWasProcessed = *pbProcessed;
*pbProcessed = TRUE;
switch( msg )
if( !SHCreateMenuBar(&mbi) )
{
- MessageBox(hwnd, L"SHCreateMenuBar Failed", L"Error", MB_OK);
+ MessageBox(hwnd, _T("SHCreateMenuBar Failed"), _T("Error"), MB_OK);
//return -1;
}
return lResult;
case WM_DESTROY:
- PostQuitMessage( 0 );
- return lResult;
+ PostQuitMessage( 0 );
+ return lResult;
}
return DefWindowProc( hwnd, msg, wp, lp );
ofn.nMaxFileTitle = 40;
ofn.lpstrInitialDir = NULL;
ofn.lpstrTitle = _T("Quick Open File");
- ofn.Flags = NULL;
+ ofn.Flags = 0;
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL;
vlc_mutex_lock( &pIntf->change_lock );
input_thread_t *p_input = pIntf->p_sys->p_input;
- DWORD dwPos = SendMessage( hwndSlider, TBM_GETPOS, 0, 0 );
+ int dwPos = SendMessage( hwndSlider, TBM_GETPOS, 0, 0 );
if( (int)LOWORD(wp) == SB_THUMBPOSITION ||
(int)LOWORD(wp) == SB_ENDSCROLL )
if( !SHCreateMenuBar(&mbi) )
{
- MessageBox( hwnd, L"SHCreateMenuBar Failed", L"Error", MB_OK );
+ MessageBox( hwnd, _T("SHCreateMenuBar Failed"), _T("Error"), MB_OK );
//return -1;
}
string szAnsi = (string)p_info->psz_name;
szAnsi += ": ";
szAnsi += p_info->psz_value;
- tvi.pszText = _FROMMB( szAnsi.c_str() );
+ tvi.pszText = (TCHAR *)_FROMMB( szAnsi.c_str() );
tvi.cchTextMax = _tcslen( tvi.pszText );
tvi.lParam = (LPARAM)3; // level 3
tvins.item = tvi;
*****************************************************************************/
void ItemInfoDialog::OnOk()
{
- int b_state, i_item;
+ int b_state = VLC_FALSE;
vlc_mutex_lock( &p_item->input.lock );
OPENFILENAME ofn;
int i_dummy;
HANDLE fichier;
- int nList=0;
-
LRESULT lResult = CBaseWindow::WndProc( hwnd, msg, wp, lp, pbProcessed );
BOOL bWasProcessed = *pbProcessed;
lv.iItem = ListView_GetItemCount( hListView );
ListView_InsertItem( hListView, &lv );
ListView_SetItemText( hListView, lv.iItem, 0,
- _FROMMB(debug.c_str()) );
+ (TCHAR *)_FROMMB(debug.c_str()) );
}
vlc_mutex_lock( p_sub->p_lock );
void OpenDialog::NetPanel( HWND hwnd )
{
INITCOMMONCONTROLSEX ic;
- LPWSTR wUnicode;
+ TCHAR psz_text[256];
struct net_type
{
- LPWSTR szAnsi;
+ TCHAR *psz_text;
int length;
};
GetWindowRect( notebook, &rc);
/* UDP/RTP row */
- net_radios[0] = CreateWindow( _T("BUTTON"), net_type_array[0].szAnsi,
+ net_radios[0] = CreateWindow( _T("BUTTON"), net_type_array[0].psz_text,
WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON,
- rc.left + 5, rc.top + 10, 15, 15,
- hwnd, NULL, hInst, NULL);
-
- net_label[0] = CreateWindow( _T("STATIC"), net_type_array[0].szAnsi,
+ rc.left + 5, rc.top + 10, 15, 15, hwnd, NULL, hInst, NULL );
+
+ net_label[0] = CreateWindow( _T("STATIC"), net_type_array[0].psz_text,
WS_CHILD | WS_VISIBLE | SS_LEFT,
- rc.left + 5 + 15 + 5, rc.top + 10, net_type_array[0].length, 15,
- hwnd, NULL, hInst, NULL);
+ rc.left + 5 + 15 + 5, rc.top + 10, net_type_array[0].length,
+ 15, hwnd, NULL, hInst, NULL );
i_net_ports[0] = config_GetInt( p_intf, "server-port" );
-
+
net_port_label[0] = CreateWindow( _T("STATIC"), _T("Port"),
WS_CHILD | WS_VISIBLE | SS_LEFT,
rc.left + 5 , rc.top + 10 + 2*(15 + 10), 30, 15,
- hwnd, NULL, hInst, NULL);
-
- wUnicode = new WCHAR[80];
- swprintf( wUnicode, _T("%d"), i_net_ports[0] );
- net_ports[0] = CreateWindow( _T("EDIT"), wUnicode,
- WS_CHILD | WS_VISIBLE | WS_BORDER | SS_LEFT | ES_AUTOHSCROLL,
- rc.left + 5 + 30 + 5, rc.top + 10 + 2*(15 + 10) - 3,
- rc.right - 5 - (rc.left + 5 + 30 + 5), 15 + 6, hwnd, NULL, hInst, NULL );
- free( wUnicode );
+ hwnd, NULL, hInst, NULL );
+
+ _stprintf( psz_text, _T("%d"), i_net_ports[0] );
+ net_ports[0] = CreateWindow( _T("EDIT"), psz_text,
+ WS_CHILD | WS_VISIBLE | WS_BORDER | SS_LEFT | ES_AUTOHSCROLL,
+ rc.left + 5 + 30 + 5, rc.top + 10 + 2*(15 + 10) - 3,
+ rc.right - 5 - (rc.left + 5 + 30 + 5), 15 + 6, hwnd, NULL, hInst, NULL );
ic.dwSize = sizeof(INITCOMMONCONTROLSEX);
ic.dwICC = ICC_UPDOWN_CLASS;
InitCommonControlsEx(&ic);
-
+
hUpdown[0] = CreateUpDownControl(
WS_CHILD | WS_VISIBLE | WS_BORDER | UDS_ALIGNRIGHT |
UDS_SETBUDDYINT | UDS_NOTHOUSANDS,
- 0, 0, 0, 0, hwnd, NULL, hInst,
+ 0, 0, 0, 0, hwnd, 0, hInst,
net_ports[0], 16000, 0, i_net_ports[0]);
/* UDP/RTP Multicast row */
- net_radios[1] = CreateWindow( _T("BUTTON"), net_type_array[1].szAnsi,
+ net_radios[1] = CreateWindow( _T("BUTTON"), net_type_array[1].psz_text,
WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON,
rc.left + 5, rc.top + 10 + 15 + 10, 15, 15,
hwnd, NULL, hInst, NULL);
- net_label[1] = CreateWindow( _T("STATIC"), net_type_array[1].szAnsi,
+ net_label[1] = CreateWindow( _T("STATIC"), net_type_array[1].psz_text,
WS_CHILD | WS_VISIBLE | SS_LEFT,
rc.left + 5 + 15 + 5, rc.top + 10 + 15 + 10,
net_type_array[1].length, 15, hwnd, NULL, hInst, NULL );
i_net_ports[1] = i_net_ports[0];
- wUnicode = new WCHAR[80];
- swprintf( wUnicode, _T("%d"), i_net_ports[1] );
- net_ports[1] = CreateWindow( _T("EDIT"), wUnicode,
+ _stprintf( psz_text, _T("%d"), i_net_ports[1] );
+ net_ports[1] = CreateWindow( _T("EDIT"), psz_text,
WS_CHILD | WS_VISIBLE | WS_BORDER | SS_LEFT | ES_AUTOHSCROLL,
rc.left + 5 + 30 + 5, rc.top + 10 + 3*(15 + 10) - 3,
rc.right - 5 -(rc.left + 5 + 30 + 5), 15 + 6,
hwnd, NULL, hInst, NULL );
- free( wUnicode );
ic.dwSize = sizeof(INITCOMMONCONTROLSEX);
ic.dwICC = ICC_UPDOWN_CLASS;
hUpdown[1] = CreateUpDownControl( WS_CHILD | WS_VISIBLE | WS_BORDER |
UDS_ALIGNRIGHT | UDS_SETBUDDYINT | UDS_NOTHOUSANDS,
- 0, 0, 0, 0, hwnd, NULL, hInst,
+ 0, 0, 0, 0, hwnd, 0, hInst,
net_ports[1], 16000, 0, i_net_ports[1] );
/* HTTP and RTSP rows */
- net_radios[2] = CreateWindow( _T("BUTTON"), net_type_array[2].szAnsi,
+ net_radios[2] = CreateWindow( _T("BUTTON"), net_type_array[2].psz_text,
WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON,
rc.left + 5 + 15 + 5 + net_type_array[0].length + 5,
rc.top + 10, 15, 15, hwnd, NULL, hInst, NULL );
- net_label[2] = CreateWindow( _T("STATIC"), net_type_array[2].szAnsi,
+ net_label[2] = CreateWindow( _T("STATIC"), net_type_array[2].psz_text,
WS_CHILD | WS_VISIBLE | SS_LEFT,
rc.left + 5 + 15 + 5 + net_type_array[0].length + 5 + 15 + 5,
rc.top + 10, net_type_array[2].length, 15,
rc.right - 5 - (rc.left + 5 + 30 + 5), 15 + 6,
hwnd, NULL, hInst, NULL);
- net_radios[3] = CreateWindow( _T("BUTTON"), net_type_array[3].szAnsi,
+ net_radios[3] = CreateWindow( _T("BUTTON"), net_type_array[3].psz_text,
WS_CHILD | WS_VISIBLE | BS_AUTORADIOBUTTON,
rc.left + 5 + 15 + 5 + net_type_array[1].length + 5,
rc.top + 10 + 15 + 10, 15, 15, hwnd, NULL, hInst, NULL );
- net_label[3] = CreateWindow( _T("STATIC"), net_type_array[3].szAnsi,
+ net_label[3] = CreateWindow( _T("STATIC"), net_type_array[3].psz_text,
WS_CHILD | WS_VISIBLE | SS_LEFT,
rc.left + 5 + 15 + 5 + net_type_array[1].length + 5 + 15 + 5,
rc.top + 10 + 15 + 10, net_type_array[3].length, 15,
void OpenDialog::UpdateMRL( int i_access_method )
{
string demux, mrltemp;
-
- int size;
- BOOL bTemp;
- LPSTR szAnsi;
- LPWSTR wUnicode;
+ TCHAR psz_text[2048];
+ char psz_tmp[256];
i_current_access_method = i_access_method;
switch( i_access_method )
{
case FILE_ACCESS:
- //mrltemp = wxT("file") + demux + wxT(":") + file_combo->GetValue();
- size = GetWindowTextLength( file_combo ) + 1;
- wUnicode = new WCHAR[ size ];
- GetWindowText( file_combo, wUnicode, size );
- mrltemp = _TOMB(wUnicode);
+ GetWindowText( file_combo, psz_text, 2048 );
+ mrltemp = _TOMB(psz_text);
break;
case NET_ACCESS:
switch( i_net_type )
if( i_net_ports[0] !=
config_GetInt( p_intf, "server-port" ) )
{
- szAnsi = new char[50];
- sprintf( szAnsi, "@:%d", i_net_ports[0] );
- mrltemp += szAnsi;
- delete [] szAnsi;
+ sprintf( psz_tmp, "@:%d", i_net_ports[0] );
+ mrltemp += psz_tmp;
}
break;
case 1:
mrltemp = "udp" + demux + "://@";
- size = Edit_GetTextLength( net_addrs[1] );
- wUnicode = new WCHAR[size + 1]; //Add 1 for the NULL
- Edit_GetText( net_addrs[1], wUnicode, size + 1);
- mrltemp += _TOMB(wUnicode);
- delete [] wUnicode;
+ Edit_GetText( net_addrs[1], psz_text, 2048 );
+ mrltemp += _TOMB(psz_text);
if( i_net_ports[1] != config_GetInt( p_intf, "server-port" ) )
{
- szAnsi = new char[50];
- sprintf( szAnsi, ":%d", i_net_ports[1] );
- mrltemp += szAnsi;
- delete [] szAnsi;
+ sprintf( psz_tmp, ":%d", i_net_ports[1] );
+ mrltemp += psz_tmp;
}
break;
case 2:
/* http access */
- size = Edit_GetTextLength( net_addrs[2] );
- wUnicode = new WCHAR[size + 1]; //Add 1 for the NULL
- Edit_GetText( net_addrs[2], wUnicode, size + 1);
- size = WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, NULL, 0, NULL, &bTemp );
- szAnsi = new char[size];
- WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, szAnsi, size, NULL, &bTemp );
- free( wUnicode );
- if( !strstr( szAnsi, "http://" ) )
+ Edit_GetText( net_addrs[2], psz_text, 2048 );
+ if( !strstr( _TOMB(psz_text), "http://" ) )
{
mrltemp = "http" + demux + "://";
}
- mrltemp += szAnsi;
- free( szAnsi );
+ mrltemp += _TOMB(psz_text);
break;
case 3:
/* RTSP access */
- size = Edit_GetTextLength( net_addrs[3] );
- wUnicode = new WCHAR[size + 1]; //Add 1 for the NULL
- Edit_GetText( net_addrs[3], wUnicode, size + 1);
- size = WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, NULL, 0, NULL, &bTemp );
- szAnsi = new char[size];
- WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, szAnsi, size, NULL, &bTemp );
- free( wUnicode );
- if( !strstr( szAnsi, "rtsp://" ) )
+ Edit_GetText( net_addrs[3], psz_text, 2048 );
+ if( !strstr( _TOMB(psz_text), "rtsp://" ) )
{
mrltemp = "rtsp" + demux + "://";
}
- mrltemp += szAnsi;
- free( szAnsi );
+ mrltemp += _TOMB(psz_text);
break;
}
break;
void OpenDialog::OnOk()
{
- int size;
- LPWSTR wUnicode;
-
- size = GetWindowTextLength( mrl_combo ) + 1;
- wUnicode = new WCHAR[ size ];
- GetWindowText( mrl_combo, wUnicode, size ); // a remplacer par ComboBox_GetText( mrl_combo, wUnicode, size )
- mrl = SeparateEntries( wUnicode );
- ComboBox_AddString( mrl_combo, wUnicode );
+ TCHAR psz_text[2048];
+
+ GetWindowText( mrl_combo, psz_text, 2048 ); // replace by ComboBox_GetText( mrl_combo, wUnicode, size )
+ mrl = SeparateEntries( psz_text );
+ ComboBox_AddString( mrl_combo, psz_text );
if( ComboBox_GetCount( mrl_combo ) > 10 )
ComboBox_DeleteString( mrl_combo, 0 );
ComboBox_SetCurSel( mrl_combo, ComboBox_GetCount( mrl_combo ) - 1 );
- delete [] wUnicode;
/* Update the playlist */
playlist_t *p_playlist =
}
}
- int i_id = playlist_AddItem( p_playlist, p_item,
- PLAYLIST_APPEND, PLAYLIST_END );
+ playlist_AddItem( p_playlist, p_item,
+ PLAYLIST_APPEND, PLAYLIST_END );
if( b_start )
{
void OpenDialog::OnFileBrowse()
{
OPENFILENAME ofn;
- TCHAR DateiName[80+1] = _T("\0");
static TCHAR szFilter[] = _T("All (*.*)\0*.*\0");
- LPSTR psz_filename;
- BOOL bTemp;
- string path;
- int size;
+ TCHAR psz_file[PATH_MAX] = _T("\0");
+ TCHAR psz_tmp[PATH_MAX+2] = _T("\0");
memset(&ofn, 0, sizeof(OPENFILENAME));
ofn.lStructSize = sizeof (OPENFILENAME);
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
ofn.nFilterIndex = 1;
- ofn.lpstrFile = (LPTSTR) DateiName;
- ofn.nMaxFile = 80;
+ ofn.lpstrFile = psz_file;
+ ofn.nMaxFile = PATH_MAX;
ofn.lpstrFileTitle = NULL;
ofn.nMaxFileTitle = 40;
ofn.lpstrInitialDir = NULL;
ofn.lpstrTitle = _T("Open File");
- ofn.Flags = NULL;
+ ofn.Flags = 0;
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL;
ofn.lpTemplateName = NULL;
if( GetOpenFileName((LPOPENFILENAME) &ofn) )
{
- size = WideCharToMultiByte( CP_ACP, 0, ofn.lpstrFile, -1, NULL,
- 0, NULL, &bTemp );
- psz_filename = ( char * )malloc( size );
- WideCharToMultiByte( CP_ACP, 0, ofn.lpstrFile, -1, psz_filename,
- size, NULL, &bTemp );
-
- if( strchr( psz_filename, ' ' ) )
+ if( _tcschr( ofn.lpstrFile, _T(' ') ) )
{
- path = "\"";
- path += psz_filename;
- path += "\"";
+ _tcscat( psz_tmp, _T("\"") );
+ _tcscat( psz_tmp, ofn.lpstrFile );
+ _tcscat( psz_tmp, _T("\"") );
}
- else
- path = psz_filename;
+ else _tcscat( psz_tmp, ofn.lpstrFile );
- SetWindowText( file_combo, _FROMMB(path.c_str()) );
- ComboBox_AddString( file_combo, _FROMMB(path.c_str()) );
+ SetWindowText( file_combo, psz_tmp );
+ ComboBox_AddString( file_combo, psz_tmp );
if( ComboBox_GetCount( file_combo ) > 10 )
ComboBox_DeleteString( file_combo, 0 );
*****************************************************************************/
void OpenDialog::OnNetPanelChange( int event )
{
+ TCHAR psz_text[2048];
int port;
- int size;
- LPWSTR wUnicode;
if( event >= NetPort1_Event && event <= NetPort2_Event )
{
- size = Edit_GetTextLength( net_ports[event - NetPort1_Event] );
- wUnicode = new WCHAR[size + 1]; //Add 1 for the NULL
- Edit_GetText( net_ports[event - NetPort1_Event], wUnicode, size + 1);
- swscanf( wUnicode, _T("%d"), &port );
+ Edit_GetText( net_ports[event - NetPort1_Event], psz_text, 2048 );
+ _stscanf( psz_text, _T("%d"), &port );
i_net_ports[event - NetPort1_Event] = port;
- delete[] wUnicode;
}
UpdateMRL( NET_ACCESS );
void OpenDialog::DisableNETCtrl()
{
- for( int i=0; i<4; i++ )
+ for( int i=0; i<4; i++ )
{
- SetWindowPos( net_port_label[i], HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
- SetWindowPos( net_ports[i], HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
- SetWindowPos( hUpdown[i], HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
-
- SetWindowPos( net_addrs_label[i], HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
- SetWindowPos( net_addrs[i], HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
+ SetWindowPos( net_port_label[i], HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE );
+ SetWindowPos( net_ports[i], HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE );
+ SetWindowPos( hUpdown[i], HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE );
+ SetWindowPos( net_addrs_label[i], HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE );
+ SetWindowPos( net_addrs[i], HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE );
}
UpdateMRL( FILE_ACCESS );
subsfile_mrl.clear();
- for( int i = 0; i < subsfile_dialog->subsfile_mrl.size(); i++ )
+ for( int i = 0; i < (int)subsfile_dialog->subsfile_mrl.size(); i++ )
subsfile_mrl.push_back( subsfile_dialog->subsfile_mrl[i] );
delete subsfile_dialog;
/*****************************************************************************
* Utility functions.
*****************************************************************************/
-vector<string> SeparateEntries( LPWSTR entries )
+vector<string> SeparateEntries( TCHAR *entries )
{
- int length;
vlc_bool_t b_quotes_mode = VLC_FALSE;
vector<string> entries_array;
- LPWSTR entry = new TCHAR[ wcslen(entries) + 1 ];
-
- LPWSTR strToken = entries;
- length = wcscspn( strToken, _T(" \t\r\n\"") );
- swprintf( entry, _T("") );
+ TCHAR *entry = new TCHAR[ _tcslen(entries) + 1 ];
+ TCHAR *strToken = entries;
+ int length = _tcscspn( strToken, _T(" \t\r\n\"") );
+ *entry = 0;
- while( strToken - entries < wcslen(entries) )
+ while( strToken - entries < _tcslen(entries) )
{
- wcsncat( entry, strToken, length );
+ _tcsncat( entry, strToken, length );
- wcsncat( entry, strToken + length, 1 );
+ _tcsncat( entry, strToken + length, 1 );
if( !b_quotes_mode && strToken[length] == _T('\"') )
{
/* Enters quotes mode */
- entry[ wcslen(entry) - 1 ] = NULL;
+ entry[ _tcslen(entry) - 1 ] = 0;
b_quotes_mode = VLC_TRUE;
}
else if( b_quotes_mode && strToken[length] == _T('\"') )
{
/* Finished the quotes mode */
- entry[ wcslen(entry) - 1 ] = NULL;
- if( wcscmp( entry, _T("") ) != 0 )
+ entry[ _tcslen(entry) - 1 ] = 0;
+ if( _tcscmp( entry, _T("") ) != 0 )
{
entries_array.push_back( _TOMB(entry) );
}
- swprintf( entry, _T("") );
+ *entry = 0;
b_quotes_mode = VLC_FALSE;
}
else if( !b_quotes_mode && strToken[length] != _T('\"') )
{
/* we found a non-quoted standalone string */
- if( strToken + length - entries < wcslen(entries) ||/*token.HasMoreTokens() ||*/ //FIX ME IF YOU CAN
+ if( strToken + length - entries < _tcslen(entries) ||/*token.HasMoreTokens() ||*/ //FIX ME IF YOU CAN
strToken[length] == _T(' ') ||
strToken[length] == _T('\t') ||
strToken[length] == _T('\r') ||
strToken[length] == _T('\n') )
- entry[ wcslen(entry) - 1 ]/*strToken[length]*/ = NULL;
- if( wcscmp( entry, _T("") ) != 0 )
+ entry[ _tcslen(entry) - 1 ]/*strToken[length]*/ = 0;
+ if( _tcscmp( entry, _T("") ) != 0 )
{
entries_array.push_back( _TOMB(entry) );
}
- swprintf( entry, _T("") );
+ *entry = 0;
}
else
{;}
strToken += length + 1;
- length = wcscspn( strToken, _T(" \t\r\n\"") );
+ length = _tcscspn( strToken, _T(" \t\r\n\"") );
}
- if( wcscmp( entry, _T("") ) != 0 )
+ if( _tcscmp( entry, _T("") ) != 0 )
{
entries_array.push_back( _TOMB(entry) );
}
+ delete [] entry;
return entries_array;
}
// The TBBUTTON structure contains information the toolbar buttons.
static TBBUTTON tbButton2[] =
{
- {0, ID_MANAGE_OPENPL, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {1, ID_MANAGE_SAVEPL, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1},
- {2, ID_MANAGE_SIMPLEADD, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {3, ID_MANAGE_ADDMRL, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {4, ID_SEL_DELETE, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1},
- {5, Infos_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1},
- {6, Up_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {7, Down_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON, 0, -1},
- {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP, 0, -1},
- {8, Random_Event, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, -1},
- {9, Loop_Event, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, -1},
- {10, Repeat_Event, TBSTATE_ENABLED, TBSTYLE_CHECK, 0, -1}
+ {0, ID_MANAGE_OPENPL, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {1, ID_MANAGE_SAVEPL, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {2, ID_MANAGE_SIMPLEADD, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {3, ID_MANAGE_ADDMRL, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {4, ID_SEL_DELETE, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {5, Infos_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {6, Up_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {7, Down_Event, TBSTATE_ENABLED, TBSTYLE_BUTTON},
+ {0, 0, TBSTATE_ENABLED, TBSTYLE_SEP},
+ {8, Random_Event, TBSTATE_ENABLED, TBSTYLE_CHECK},
+ {9, Loop_Event, TBSTATE_ENABLED, TBSTYLE_CHECK},
+ {10, Repeat_Event, TBSTATE_ENABLED, TBSTYLE_CHECK}
};
// Toolbar ToolTips
TCHAR * szToolTips2[] =
{
HELP_OPENPL,
- HELP_SAVEPL,
- HELP_SIMPLEADD,
- HELP_ADDMRL,
- HELP_DELETE,
- HELP_INFOS,
- HELP_UP,
- HELP_DOWN,
- HELP_RANDOM,
- HELP_LOOP,
- HELP_REPEAT
+ HELP_SAVEPL,
+ HELP_SIMPLEADD,
+ HELP_ADDMRL,
+ HELP_DELETE,
+ HELP_INFOS,
+ HELP_UP,
+ HELP_DOWN,
+ HELP_RANDOM,
+ HELP_LOOP,
+ HELP_REPEAT
};
/*****************************************************************************
if( !SHCreateMenuBar(&mbi) )
{
- MessageBox(hwnd, L"SHCreateMenuBar Failed", L"Error", MB_OK);
+ MessageBox(hwnd, _T("SHCreateMenuBar Failed"), _T("Error"), MB_OK);
//return -1;
}
dwStyle = WS_VISIBLE | WS_CHILD | TBSTYLE_TOOLTIPS |
WS_EX_OVERLAPPEDWINDOW | CCS_NOPARENTALIGN;
- hwndTB = CreateToolbarEx( hwnd, dwStyle, NULL, NUMIMAGES,
+ hwndTB = CreateToolbarEx( hwnd, dwStyle, 0, NUMIMAGES,
hInst, IDB_BITMAP3, tbButton2,
sizeof (tbButton2) / sizeof (TBBUTTON),
BUTTONWIDTH, BUTTONHEIGHT,
{
TCHAR szFile[NMAXFILE] = _T("\0");
OPENFILENAME ofn;
+ TCHAR psz_filters[1000];
- LPWSTR wUnicode;
- int len;
-
- struct {
- TCHAR *psz_desc;
- TCHAR *psz_filter;
+ struct
+ {
+ char *psz_desc;
+ char *psz_filter;
char *psz_module;
- } formats[] = {{ _T("M3U file"), _T("*.m3u"), "export-m3u" },
- { _T("PLS file"), _T("*.pls"), "export-pls" }};
- wUnicode = new TCHAR[100];
- wcscpy( wUnicode, _T("") );
- len = 0;
- for( unsigned int i = 0; i < sizeof(formats)/sizeof(formats[0]); i++)
+ } formats[] =
+ { { "M3U file", "*.m3u", "export-m3u" },
+ { "PLS file", "*.pls", "export-pls" }
+ };
+
+ for( int i_len = 0, i = 0; i < sizeof(formats)/sizeof(formats[0]); i++ )
{
- wcscpy( &wUnicode[len], formats[i].psz_desc );
- len = len + wcslen( formats[i].psz_desc );
- wUnicode[len] = '\0';
- len++;
- wcscpy( &wUnicode[len], formats[i].psz_filter );
- len = len + wcslen( formats[i].psz_filter );
- wUnicode[len] = '\0';
- len++;
+ _tcscpy( psz_filters + i_len, _FROMMB(formats[i].psz_desc) );
+ i_len = i_len + _tcslen( psz_filters + i_len );
+ psz_filters[i_len++] = '\0';
+ _tcscpy( psz_filters + i_len, _FROMMB(formats[i].psz_filter) );
+ i_len = i_len + _tcslen( psz_filters + i_len );
+ psz_filters[i_len++] = '\0';
+ if( i == sizeof(formats)/sizeof(formats[0]) -1 )
+ psz_filters[i_len] = '\0';
}
- wUnicode[len] = '\0';
memset( &(ofn), 0, sizeof(ofn));
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = NULL;
ofn.lpstrFile = szFile;
ofn.nMaxFile = NMAXFILE;
- ofn.lpstrFilter = wUnicode;
+ ofn.lpstrFilter = psz_filters;
ofn.lpstrTitle = _T("Save playlist");
ofn.Flags = OFN_HIDEREADONLY;
- free( wUnicode );
- if( GetSaveFileName((LPOPENFILENAME) &ofn) )
+ if( GetSaveFileName( (LPOPENFILENAME)&ofn ) )
{
playlist_t * p_playlist = (playlist_t *)
vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST, FIND_ANYWHERE );
ofn.nMaxFileTitle = 40;
ofn.lpstrInitialDir = NULL;
ofn.lpstrTitle = _T("Quick Open File");
- ofn.Flags = NULL;
+ ofn.Flags = 0;
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL;
public:
PrefsTreeCtrl() { }
- PrefsTreeCtrl( intf_thread_t *_p_intf, PrefsDialog *p_prefs_dialog, HWND hwnd, HINSTANCE _hInst );
+ PrefsTreeCtrl( intf_thread_t *_p_intf, PrefsDialog *p_prefs_dialog,
+ HWND hwnd, HINSTANCE _hInst );
virtual ~PrefsTreeCtrl();
void ApplyChanges();
PURPOSE:
Processes messages sent to the main window.
-
+
***********************************************************************/
LRESULT PrefsDialog::WndProc( HWND hwnd, UINT msg, WPARAM wp, LPARAM lp,
- PBOOL pbProcessed )
+ PBOOL pbProcessed )
{
SHINITDLGINFO shidi;
SHMENUBARINFO mbi;
switch( msg )
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
shidi.dwMask = SHIDIM_FLAGS;
shidi.dwFlags = SHIDIF_DONEBUTTON | SHIDIF_SIPDOWN |
SHIDIF_FULLSCREENNOMENUBAR;//SHIDIF_SIZEDLGFULLSCREEN;
mbi.nToolBarId = IDR_DUMMYMENU;
mbi.hInstRes = hInst;
mbi.nBmpId = 0;
- mbi.cBmpImages = 0;
+ mbi.cBmpImages = 0;
if( !SHCreateMenuBar(&mbi) )
{
- MessageBox(hwnd, L"SHCreateMenuBar Failed", L"Error", MB_OK);
+ MessageBox(hwnd, _T("SHCreateMenuBar Failed"), _T("Error"), MB_OK);
//return -1;
}
// Get the client area rect to put the panels in
GetClientRect(hwnd, &rcClient);
- /* Create the buttons */
+ /* Create the buttons */
advanced_checkbox =
CreateWindow( _T("BUTTON"), _T("Advanced options"),
WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX,
INITCOMMONCONTROLSEX iccex;
RECT rcClient;
-
- int size;
- char *szAnsi;
- LPWSTR wUnicode;
- BOOL bTemp;
TVITEM tvi = {0};
TVINSERTSTRUCT tvins = {0};
HTREEITEM hPrev;
while( capability_item != 0 )
{
TVITEM capability_tvi = {0};
-
+ TCHAR psz_text[256];
i_child_index++;
capability_tvi.mask = TVIF_TEXT;
- capability_tvi.pszText = new WCHAR[200];
- capability_tvi.cchTextMax = 200;
+ capability_tvi.pszText = psz_text;
+ capability_tvi.cchTextMax = 256;
capability_tvi.hItem = capability_item;
TreeView_GetItem( hwndTV, &capability_tvi );
- size = WideCharToMultiByte( CP_ACP, 0, capability_tvi.pszText, -1, NULL, 0, NULL, &bTemp );
- szAnsi = new char[size];
- WideCharToMultiByte( CP_ACP, 0, capability_tvi.pszText, -1, szAnsi, size, NULL, &bTemp );
- if( !strcmp( szAnsi, p_module->psz_capability ) )
- {
- free( szAnsi );
- free( capability_tvi.pszText );
- break;
- }
- free( szAnsi );
- free( capability_tvi.pszText );
-
- capability_item = TreeView_GetNextSibling( hwndTV, capability_item );
+ if( !strcmp( _TOMB(capability_tvi.pszText),
+ p_module->psz_capability ) ) break;
+
+ capability_item =
+ TreeView_GetNextSibling( hwndTV, capability_item );
}
if( i_child_index == i_capability_count &&
tvins.hParent = capability_item;// level 4
// Add the item to the tree-view control.
- TreeView_InsertItem( hwndTV, &tvins);
+ TreeView_InsertItem( hwndTV, &tvins );
}
/* Sort all this mess */
ConfigControl::ConfigControl( vlc_object_t *_p_this,
module_config_t *p_item,
HWND parent, HINSTANCE hInst )
- : parent( parent ), p_this( _p_this ),
- pf_update_callback( NULL ), p_update_data( NULL ),
- name( p_item->psz_name ), i_type( p_item->i_type ),
+ : p_this( _p_this ), pf_update_callback( NULL ), p_update_data( NULL ),
+ parent( parent ), name( p_item->psz_name ), i_type( p_item->i_type ),
b_advanced( p_item->b_advanced )
{
{
public:
ConfigControl( vlc_object_t *, module_config_t *, HWND, HINSTANCE );
- ~ConfigControl();
- /*wxSizer *Sizer();*/
+ virtual ~ConfigControl();
virtual int GetIntValue() {return 0;}
virtual float GetFloatValue() {return 0;}
INITCOMMONCONTROLSEX ic;
RECT rcClient;
- int size;
- LPWSTR wUnicode;
-
char *psz_subsfile;
-
+ module_config_t *p_item;
float f_fps;
int i_delay;
- module_config_t *p_item;
+
+ TCHAR psz_text[256];
LRESULT lResult = CBaseWindow::WndProc( hwnd, msg, wp, lp, pbProcessed );
BOOL bWasProcessed = *pbProcessed;
if (!SHCreateMenuBar(&mbi))
{
- MessageBox(hwnd, L"SHCreateMenuBar Failed", L"Error", MB_OK);
+ MessageBox(hwnd, _T("SHCreateMenuBar Failed"), _T("Error"), MB_OK);
//return -1;
}
psz_subsfile = config_GetPsz( p_intf, "sub-file" );
if( !psz_subsfile ) psz_subsfile = strdup("");
- size = MultiByteToWideChar( CP_ACP, 0, psz_subsfile, -1, NULL, 0 );
- wUnicode = new WCHAR[size];
- MultiByteToWideChar( CP_ACP, 0, psz_subsfile, -1, wUnicode, size );
- file_combo = CreateWindow( _T("COMBOBOX"), wUnicode,
+ file_combo = CreateWindow( _T("COMBOBOX"), _FROMMB(psz_subsfile),
WS_CHILD | WS_VISIBLE | CBS_AUTOHSCROLL | CBS_SORT | WS_VSCROLL,
10, 10 + 15 + 10 - 3, rcClient.right - 2*10, 5*15 + 6,
hwnd, NULL, hInst, NULL );
- free( wUnicode );
if( psz_subsfile ) free( psz_subsfile );
browse_button = CreateWindow( _T("BUTTON"), _T("Browse..."),
/* Subtitles encoding */
encoding_combo = NULL;
- p_item =
- config_FindConfig( VLC_OBJECT(p_intf), "subsdec-encoding" );
+ p_item = config_FindConfig( VLC_OBJECT(p_intf), "subsdec-encoding" );
if( p_item )
- {
- enc_box = CreateWindow( _T("STATIC"), _T("Subtitles encoding"),
+ {
+ enc_box = CreateWindow( _T("STATIC"), _T("Subtitles encoding"),
WS_CHILD | WS_VISIBLE | SS_LEFT,
5, 10 + 3*(15 + 10), rcClient.right - 2*5, 15,
hwnd, NULL, hInst, NULL );
- size = MultiByteToWideChar( CP_ACP, 0, p_item->psz_text, -1, NULL, 0 );
- wUnicode = new WCHAR[size];
- MultiByteToWideChar( CP_ACP, 0, p_item->psz_text, -1, wUnicode, size );
-
- enc_label = CreateWindow( _T("STATIC"), wUnicode,
+ enc_label = CreateWindow( _T("STATIC"), _FROMMB(p_item->psz_text),
WS_CHILD | WS_VISIBLE | SS_LEFT,
10, 10 + 4*(15 + 10), rcClient.right - 2*10, 15,
hwnd, NULL, hInst, NULL );
- free( wUnicode );
-
- size = MultiByteToWideChar( CP_ACP, 0, p_item->psz_value, -1, NULL, 0 );
- wUnicode = new WCHAR[size];
- MultiByteToWideChar( CP_ACP, 0, p_item->psz_value, -1, wUnicode, size );
-
- encoding_combo = CreateWindow( _T("COMBOBOX"), wUnicode,
- WS_CHILD | WS_VISIBLE | CBS_AUTOHSCROLL | CBS_DROPDOWNLIST | LBS_SORT | WS_VSCROLL,
+ encoding_combo = CreateWindow( _T("COMBOBOX"),
+ _FROMMB(p_item->psz_value),
+ WS_CHILD | WS_VISIBLE | CBS_AUTOHSCROLL | CBS_DROPDOWNLIST |
+ LBS_SORT | WS_VSCROLL,
rcClient.right - 150 - 10, 10 + 5*(15 + 10) - 3, 150, 5*15 + 6,
hwnd, NULL, hInst, NULL );
- free( wUnicode );
-
- /* build a list of available options */
- for( int i_index = 0; p_item->ppsz_list &&
- p_item->ppsz_list[i_index]; i_index++ )
- {
- size = MultiByteToWideChar( CP_ACP, 0, p_item->ppsz_list[i_index], -1, NULL, 0 );
- wUnicode = new WCHAR[size];
- MultiByteToWideChar( CP_ACP, 0, p_item->ppsz_list[i_index], -1, wUnicode, size );
-
- ComboBox_AddString( encoding_combo, wUnicode );
-
- free( wUnicode );
-
- if( p_item->psz_value && !strcmp( p_item->psz_value,
- p_item->ppsz_list[i_index] ) )
- ComboBox_SetCurSel( encoding_combo, i_index );
- }
+ /* build a list of available options */
+ for( int i_index = 0; p_item->ppsz_list &&
+ p_item->ppsz_list[i_index]; i_index++ )
+ {
+ ComboBox_AddString( encoding_combo,
+ _FROMMB(p_item->ppsz_list[i_index]) );
- if( p_item->psz_value )
- {
- size = MultiByteToWideChar( CP_ACP, 0, p_item->psz_value, -1, NULL, 0 );
- wUnicode = new WCHAR[size];
- MultiByteToWideChar( CP_ACP, 0, p_item->psz_value, -1, wUnicode, size );
+ if( p_item->psz_value &&
+ !strcmp( p_item->psz_value, p_item->ppsz_list[i_index] ) )
+ ComboBox_SetCurSel( encoding_combo, i_index );
+ }
- ComboBox_SelectString( encoding_combo, 0, wUnicode );
+ if( p_item->psz_value )
+ {
+ ComboBox_SelectString( encoding_combo, 0,
+ _FROMMB(p_item->psz_value) );
- free( wUnicode );
- }
- }
+ }
+ }
/* Misc Subtitles options */
misc_box = CreateWindow( _T("STATIC"), _T("Subtitles options"),
5, 10 + 6*(15 + 10), rcClient.right - 2*5, 15,
hwnd, NULL, hInst, NULL );
- delay_label = CreateWindow( _T("STATIC"), _T("Delay subtitles (in 1/10s)"),
+ delay_label = CreateWindow( _T("STATIC"),
+ _T("Delay subtitles (in 1/10s)"),
WS_CHILD | WS_VISIBLE | SS_LEFT,
10, 10 + 7*(15 + 10), rcClient.right - 70 - 2*10, 15,
hwnd, NULL, hInst, NULL );
i_delay = config_GetInt( p_intf, "sub-delay" );
- wUnicode = new WCHAR[80];
- swprintf( wUnicode, _T("%d"), i_delay );
+ _stprintf( psz_text, _T("%d"), i_delay );
- delay_edit = CreateWindow( _T("EDIT"), wUnicode,
- WS_CHILD | WS_VISIBLE | WS_BORDER | SS_LEFT | ES_AUTOHSCROLL,
- rcClient.right - 70 - 10, 10 + 7*(15 + 10) - 3, 70, 15 + 6,
- hwnd, NULL, hInst, NULL);
-
- free( wUnicode );
+ delay_edit = CreateWindow( _T("EDIT"), psz_text,
+ WS_CHILD | WS_VISIBLE | WS_BORDER | SS_LEFT | ES_AUTOHSCROLL,
+ rcClient.right - 70 - 10, 10 + 7*(15 + 10) - 3, 70, 15 + 6,
+ hwnd, NULL, hInst, NULL );
ic.dwSize = sizeof(INITCOMMONCONTROLSEX);
ic.dwICC = ICC_UPDOWN_CLASS;
InitCommonControlsEx(&ic);
- delay_spinctrl = CreateUpDownControl(
- WS_CHILD | WS_VISIBLE | WS_BORDER | UDS_ALIGNRIGHT | UDS_SETBUDDYINT | UDS_NOTHOUSANDS,
- 0, 0, 0, 0, hwnd, NULL, hInst,
- delay_edit, 650000, -650000, i_delay );
+ delay_spinctrl =
+ CreateUpDownControl( WS_CHILD | WS_VISIBLE | WS_BORDER |
+ UDS_ALIGNRIGHT | UDS_SETBUDDYINT | UDS_NOTHOUSANDS,
+ 0, 0, 0, 0, hwnd, 0, hInst,
+ delay_edit, 650000, -650000, i_delay );
fps_label = CreateWindow( _T("STATIC"), _T("Frames per second"),
WS_CHILD | WS_VISIBLE | SS_LEFT,
hwnd, NULL, hInst, NULL );
f_fps = config_GetFloat( p_intf, "sub-fps" );
- wUnicode = new WCHAR[80];
- swprintf( wUnicode, _T("%d"), (int)f_fps );
+ _stprintf( psz_text, _T("%f"), f_fps );
- fps_edit = CreateWindow( _T("EDIT"), wUnicode,
- WS_CHILD | WS_VISIBLE | WS_BORDER | SS_LEFT | ES_AUTOHSCROLL,
- rcClient.right - 70 - 10, 10 + 8*(15 + 10) - 3, 70, 15 + 6,
- hwnd, NULL, hInst, NULL);
-
- free( wUnicode );
+ fps_edit = CreateWindow( _T("EDIT"), psz_text,
+ WS_CHILD | WS_VISIBLE | WS_BORDER | SS_LEFT | ES_AUTOHSCROLL,
+ rcClient.right - 70 - 10, 10 + 8*(15 + 10) - 3, 70, 15 + 6,
+ hwnd, NULL, hInst, NULL);
ic.dwSize = sizeof(INITCOMMONCONTROLSEX);
ic.dwICC = ICC_UPDOWN_CLASS;
InitCommonControlsEx(&ic);
fps_spinctrl = CreateUpDownControl(
- WS_CHILD | WS_VISIBLE | WS_BORDER | UDS_ALIGNRIGHT | UDS_SETBUDDYINT | UDS_NOTHOUSANDS,
- 0, 0, 0, 0, hwnd, NULL, hInst,
- fps_edit, 16000, 0, (int)f_fps );
+ WS_CHILD | WS_VISIBLE | WS_BORDER | UDS_ALIGNRIGHT |
+ UDS_SETBUDDYINT | UDS_NOTHOUSANDS,
+ 0, 0, 0, 0, hwnd, 0, hInst, fps_edit, 16000, 0, (int)f_fps );
return lResult;
case WM_COMMAND:
if ( LOWORD(wp) == IDOK )
{
- int size;
- BOOL bTemp;
- LPSTR szAnsi;
- LPWSTR wUnicode;
-
subsfile_mrl.clear();
string szFileCombo = "sub-file=";
- size = GetWindowTextLength( file_combo ) + 1;
- wUnicode = new WCHAR[ size ];
- GetWindowText( file_combo, wUnicode, size );
- size = WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, NULL, 0, NULL, &bTemp );
- szAnsi = new char[size];
- WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, szAnsi, size, NULL, &bTemp );
- szFileCombo += szAnsi;
- free( wUnicode ); free( szAnsi );
+ GetWindowText( file_combo, psz_text, 256 );
+ szFileCombo += _TOMB(psz_text);
subsfile_mrl.push_back( szFileCombo );
if( GetWindowTextLength( encoding_combo ) != 0 )
{
string szEncoding = "subsdec-encoding=";
- size = GetWindowTextLength( encoding_combo ) + 1;
- wUnicode = new WCHAR[ size ];
- GetWindowText( encoding_combo, wUnicode, size );
- size = WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, NULL, 0, NULL, &bTemp );
- szAnsi = new char[size];
- WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, szAnsi, size, NULL, &bTemp );
- szEncoding += szAnsi;
- free( wUnicode ); free( szAnsi );
+ GetWindowText( encoding_combo, psz_text, 256 );
+ szEncoding += _TOMB(psz_text);
subsfile_mrl.push_back( szEncoding );
}
string szDelay = "sub-delay=";
- size = Edit_GetTextLength( delay_edit );
- wUnicode = new WCHAR[size + 1]; //Add 1 for the NULL
- Edit_GetText( delay_edit, wUnicode, size + 1);
- size = WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, NULL, 0, NULL, &bTemp );
- szAnsi = new char[size];
- WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, szAnsi, size, NULL, &bTemp );
- szDelay += szAnsi;
- free( wUnicode ); free( szAnsi );
+ Edit_GetText( delay_edit, psz_text, 256 );
+ szDelay += _TOMB(psz_text);
subsfile_mrl.push_back( szDelay );
string szFps = "sub-fps=";
- size = Edit_GetTextLength( fps_edit );
- wUnicode = new WCHAR[size + 1]; //Add 1 for the NULL
- Edit_GetText( fps_edit, wUnicode, size + 1);
- size = WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, NULL, 0, NULL, &bTemp );
- szAnsi = new char[size];
- WideCharToMultiByte( CP_ACP, 0, wUnicode, -1, szAnsi, size, NULL, &bTemp );
- szFps += szAnsi;
- free( wUnicode ); free( szAnsi );
+ Edit_GetText( fps_edit, psz_text, 256 );
+ szFps += _TOMB(psz_text);
subsfile_mrl.push_back( szFps );
EndDialog( hwnd, LOWORD( wp ) );
ofn.nMaxFileTitle = 40;
ofn.lpstrInitialDir = NULL;
ofn.lpstrTitle = _T("Open File");
- ofn.Flags = NULL;
+ ofn.Flags = 0;
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = NULL;
*****************************************************************************/
void Timer::Notify( void )
{
- int size;
vlc_value_t val;
char *shortname;
- LPWSTR wUnicode;
vlc_mutex_lock( &p_intf->change_lock );
/* Show slider */
if( p_intf->p_sys->p_input )
{
- ShowWindow( p_main_interface->hwndSlider, SW_SHOW);
- ShowWindow( p_main_interface->hwndLabel, SW_SHOW);
- ShowWindow( p_main_interface->hwndVol, SW_SHOW);
+ ShowWindow( p_main_interface->hwndSlider, SW_SHOW );
+ ShowWindow( p_main_interface->hwndLabel, SW_SHOW );
+ ShowWindow( p_main_interface->hwndVol, SW_SHOW );
// only for local file, check if works well with net url
shortname = strrchr( p_intf->p_sys->p_input->input.p_item->psz_name, '\\' );
if (! shortname)
shortname = p_intf->p_sys->p_input->input.p_item->psz_name;
- else
- shortname++;
+ else shortname++;
- size = MultiByteToWideChar (CP_ACP, 0, shortname, -1, NULL, 0);
- wUnicode = new WCHAR[size+1];
- MultiByteToWideChar (CP_ACP, 0, shortname, -1, wUnicode + 1, size) ;
- wUnicode[0] = L'\t';
-
SendMessage( p_main_interface->hwndSB, SB_SETTEXT,
- (WPARAM) 0, (LPARAM)(LPCTSTR) wUnicode);
- free( wUnicode );
+ (WPARAM) 0, (LPARAM)_FROMMB(shortname) );
p_main_interface->TogglePlayButton( PLAYING_S );
i_old_playing_status = PLAYING_S;
p_intf->p_sys->i_slider_pos =
(int)(SLIDER_MAX_POS * pos.f_float);
- SendMessage( p_main_interface->hwndSlider,TBM_SETPOS,
+ SendMessage( p_main_interface->hwndSlider, TBM_SETPOS,
1, p_intf->p_sys->i_slider_pos );
var_Get( p_intf->p_sys->p_input, "time", &time );
i_seconds = time.i_time / 1000000;
-
secstotimestr ( psz_time, i_seconds );
- size = MultiByteToWideChar (CP_ACP, 0, psz_time, -1, NULL, 0);
- wUnicode = new WCHAR[size];
- MultiByteToWideChar (CP_ACP, 0, psz_time, -1, wUnicode, size) ;
SendMessage( p_main_interface->hwndLabel, WM_SETTEXT,
- (WPARAM) 1, (LPARAM)(LPCTSTR) wUnicode );
- free( wUnicode );
+ (WPARAM)1, (LPARAM)_FROMMB(psz_time) );
}
}
}
var_Get( p_input, "rate", &val );
if( i_old_rate != val.i_int )
{
- wUnicode = new WCHAR[10];
- swprintf( wUnicode + 2, TEXT("x%.2f"), 1000.0 / val.i_int );
- wUnicode[0] = L'\t';
- wUnicode[1] = L'\t';
+ TCHAR psz_text[15];
+ _stprintf( psz_text + 2, _T("x%.2f"), 1000.0 / val.i_int );
+ psz_text[0] = psz_text[1] = _T('\t');
SendMessage( p_main_interface->hwndSB, SB_SETTEXT,
- (WPARAM) 1, (LPARAM)(LPCTSTR) wUnicode);
-
- free(wUnicode);
+ (WPARAM) 1, (LPARAM)(LPCTSTR) psz_text );
i_old_rate = val.i_int;
}
switch( i_query )
{
- case VOUT_SET_ZOOM:
- {
- double f_arg = va_arg( args, double );
-
-#if 0
- /* Update dimensions */
- wxSizeEvent event( wxSize((int)(p_vout->i_window_width * f_arg),
- (int)(p_vout->i_window_height * f_arg)),
- UpdateSize_Event );
- AddPendingEvent( event );
-#endif
-
- i_ret = VLC_SUCCESS;
- }
+ case VOUT_SET_ZOOM:
break;
- case VOUT_SET_STAY_ON_TOP:
- {
- int i_arg = va_arg( args, int );
-#if 0
- wxCommandEvent event( wxEVT_VLC_VIDEO, SetStayOnTop_Event );
- event.SetInt( i_arg );
- AddPendingEvent( event );
-#endif
-
- i_ret = VLC_SUCCESS;
- }
+ case VOUT_SET_STAY_ON_TOP:
break;
- default:
- msg_Dbg( p_intf, "control query not supported" );
- break;
+ default:
+ msg_Dbg( p_intf, "control query not supported" );
+ break;
}
vlc_mutex_unlock( &lock );
#if defined( UNDER_CE ) && defined(__MINGW32__)
/* This is a gross hack for the wince gcc cross-compiler */
- char *strerror( int );
# define _off_t long
#endif
#include <vector>
using namespace std;
-vector<string> SeparateEntries( LPWSTR entries );
+vector<string> SeparateEntries( TCHAR *entries );
class MenuItemExt;
class VideoWindow;
return psz_wtomb;
}
#else
-# define _FROMMB(a)
-# define _TOMB(a)
+# define _FROMMB(a) a
+# define _TOMB(a) a
#endif
#if defined( ENABLE_NLS ) && defined( ENABLE_UTF8 )
} NMRGINFO, *PNMRGINFO;
}
+#if defined( WIN32 ) && !defined( UNDER_CE )
+# define SHFullScreen(a,b)
+# define SHInitDialog(a)
+# define SHCreateMenuBar(a) 1
+#endif
+
#endif //WINCE_RESOURCE
#define IDD_ABOUT 101