Exemplo n.º 1
0
BOOL CWinampInConfig::OnInitDialog() 
{
	CUString strLang;
	int		i = 0;

	CDialog::OnInitDialog();
	
	// translate dialog resources
	g_language.InitDialogStrings( this, IDD );


    CUStringConvert strCnv;

	strLang = g_language.GetString( IDS_MODULE_NAME );
    m_List.InsertColumn( 0, strCnv.ToT( strLang ), LVCFMT_LEFT, 100, 0 );
	strLang = g_language.GetString( IDS_MODULE_INFO );
	m_List.InsertColumn( 1, strCnv.ToT( strLang ), LVCFMT_LEFT, 500, 0 );

	for ( i=0 ; i < GetNumWinampPlugins() ; i++ )
	{
		m_List.InsertItem( i, strCnv.ToT( ( GetWinampPluginFileName( i ) ) ) );
		m_List.SetItemText( i,1, strCnv.ToT( GetWinampPluginInfo( i ) ) );

	}

	m_List.SetCurSel( 0 );

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Exemplo n.º 2
0
void CGenreEditDlg::OnInsertnew() 
{
	CUString strLang;
    CUStringConvert strCnv;

	UpdateList( m_nLastSelection );

	int i = m_nInsertPosition;

	CUString strNmbr;

	strLang = g_language.GetString( IDS_NEW_GENRE_NAME );

	m_List.InsertItem( i, strCnv.ToT( strLang ) );

    m_List.SetItemText( i, 1, strCnv.ToT( g_GenreTable.GetCDDBGenre( 0 ) ) );

	strNmbr.Format( _W( "%d" ) , 255 );

    m_List.SetItemText( i, 2, strCnv.ToT( strNmbr ) );

	m_List.SetCurSel( i );
	SetControls( i );

	m_nInsertPosition++;

}
Exemplo n.º 3
0
ConfigSheet::ConfigSheet( int nSelectTab,CWnd* pParentWnd )
	: CTreePropSheet( IDS_PROPSHEET_CDEXCONFIG, pParentWnd )
{
    CUStringConvert strCnv;

	// translate property sheet title
    SetTitle( strCnv.ToT( g_language.GetString( IDS_PROPSHEET_CDEXCONFIG ) ) );

	m_psh.dwFlags |= PSH_NOAPPLYNOW;	// Construct pages

    SetTreeViewMode( TRUE, TRUE, 0 );

    SetEmptyPageText( strCnv.ToT( g_language.GetString( IDS_PROPPAGE_SELECT_CHILD_ITEM  ) ));

	AddPage( &m_GenericPropPage );
	AddPage( &m_FilenamePropPage );
	AddPage( &m_CDPropPage );
	AddPage( &m_EncoderPropPage );
	AddPage( &m_LocalCDDBPropPage );
	AddPage( &m_RemoteCDDBPropPage );
	AddPage( &m_TagPropPage );

	ASSERT( nSelectTab>=0 && nSelectTab<4);

	m_bIsInSync = FALSE;

	// Select Active Page
	SetActivePage( nSelectTab );
}
Exemplo n.º 4
0
BOOL OSndStreamWAV::OpenStream( const CUString& strFileName )
{
	SF_INFO wfInfo;

    memset(&wfInfo,0,sizeof(SF_INFO));
	wfInfo.samplerate  = GetSampleRate();
	wfInfo.frames      = -1;
	wfInfo.sections	   = 1;
	wfInfo.channels    = GetChannels();
	wfInfo.format      = (SF_FORMAT_WAV | m_OutputFormat) ;

	// Set file name
	SetFileName(strFileName);
	
    CUStringConvert strCnv;

	// Open stream
    #ifdef _UNICODE
    if (! (m_pSndFile = sf_open(	(const tchar*)strCnv.ToT( GetFileName() + _W( "." ) + GetFileExtention() ),
									SFM_WRITE,
									&wfInfo ) ) )
    #else
	if (! (m_pSndFile = sf_open(	strCnv.ToT( GetFileName() + _W( "." ) + GetFileExtention() ),
									SFM_WRITE,
									&wfInfo ) ) )
    #endif
	{
		ASSERT( FALSE );
		return FALSE;
	}

	// return Success
	return TRUE;
}
Exemplo n.º 5
0
void TestOutputPlug( HWND hWnd )
{
	WINAMPPLUGINPROP	tmpProp;
    WIN32_FIND_DATA		sFF;
    HANDLE				hFind = NULL;
	CUString			strPluginDir( g_config.GetAppPath() + _W( "\\Plugins\\out_*.dll" ) );

	LTRACE2( _T( "Scanning for plugins using mask %s" ) , strPluginDir );

    CUStringConvert strCnv;

	hFind = FindFirstFile( strCnv.ToT( strPluginDir ), &sFF);

	g_strWinampExt = _T("");

	// setup the Output module Window Handle
	g_OutModule.hMainWindow = hWnd;

	// setup the Output Module Instance Handle
	g_OutModule.hDllInstance = NULL;

	while ( NULL != hFind &&
			hFind != INVALID_HANDLE_VALUE )
	{

		if ( ! ( sFF.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ) ) 
		{
            CUStringConvert strCnv;
            CUString strFullName( g_config.GetAppPath() + _W( "\\Plugins\\" ) + CUString( sFF.cFileName ) );


			LTRACE2( _T( "Getting plugin %s" ), strCnv.ToT( strFullName ));

			tmpProp.hDll = NULL;
		
			tmpProp.hDll = CDexLoadLibrary( strFullName );
			if ( tmpProp.hDll )
			{


				WINAMPGETOUTMODULE pGetMod = (WINAMPGETOUTMODULE)
					GetProcAddress(	tmpProp.hDll,
									"winampGetOutModule" );

				// call "winampGetInModule" DLL function
				Out_Module* pOutModule = pGetMod();
			}

			// scan for next file
            if ( NULL != hFind && !FindNextFile( hFind, &sFF) ) 
			{
                FindClose( hFind );
                hFind = NULL;
            }

		}
	}
}
Exemplo n.º 6
0
void CPlayerView::OnInitialUpdate() 
{
	CFormView::OnInitialUpdate();
    CUStringConvert strCnv;
	
	OnUpdate( NULL, WM_CDEX_INITIAL_UPDATE, NULL );

	CPaintDC dc(this);

	m_cVolumeBitmap.Create(&dc,IDB_VOLUME );


	// Allow Drag and dropping of files
	DragAcceptFiles();

	AddMultiPlayerFiles( strCnv.ToT( ((CCDexApp*)AfxGetApp())->GetCommandLineParams() ) );

	// Do we have to debug this stuff?
	m_Volume.Init(	MIXERLINE_COMPONENTTYPE_DST_SPEAKERS,
					NO_SOURCE,
					MIXERCONTROL_CONTROLTYPE_VOLUME,
					CMixerFader::MAIN);

	m_pThread = NULL;
	m_nTotalTime=0;
	m_nCurrentTime=0;

	BOOL	m_bAbortThread = FALSE;
	BOOL	m_bAbortCurrent = FALSE;

	m_nStatus = IDLE;

	SetControls();

	InitWinAmpPlugins( GetSafeHwnd() );

	// Set timer
	SetTimer(TIMERID,TIMERSLOT,NULL);

	CString strValue( g_language.GetString( IDS_CDEX_PLAYER_VERSION ) );
	AfxGetApp()->m_pMainWnd->SetWindowText( strValue + strCnv.ToT(  g_config.GetVersion() ) );


	PlaceControls();

	UpdateData( FALSE );
	Invalidate( FALSE );

	((CCDexApp*)AfxGetApp())->SetInitialized();

}
Exemplo n.º 7
0
CDEX_ERR CWAV::OpenForRead(CUString& strFileName)
{
	// Clear m_wfInfo struct
	memset(&m_wfInfo, 0, sizeof(SF_INFO));

    CUStringConvert strCnv;

	// Open stream
    #ifdef _UNICODE
    if ( ! ( m_pSndFile = sf_open((const tchar*)strCnv.ToT( strFileName ),
									SFM_READ,
									&m_wfInfo ) ) )
    #else
    if ( ! ( m_pSndFile = sf_open(	strCnv.ToT( strFileName ),
									SFM_READ,
									&m_wfInfo ) ) )
    #endif
	{
		ASSERT( FALSE );
		return CDEX_ERROR;
	}
	
	m_dwSamplesToConvert = (DWORD)( m_wfInfo.frames * m_wfInfo.channels );
	m_dwDataSize = m_dwSamplesToConvert*sizeof(SHORT);
	m_wChannels = m_wfInfo.channels;

	switch ( m_wfInfo.format & SF_FORMAT_SUBMASK )
	{
		case SF_FORMAT_PCM_S8:
			m_wBitsPerSample = 8;
		break;
		case SF_FORMAT_PCM_16:
			m_wBitsPerSample = 16;
		break;
		case SF_FORMAT_PCM_24:
			m_wBitsPerSample = 24;
		break;
		case SF_FORMAT_PCM_32:
			m_wBitsPerSample = 32;
		break;
		default:
			m_wBitsPerSample = 16;
			ASSERT( FALSE );
	}

	m_wSampleRate = m_wfInfo.samplerate;
	
	// Return success
	return CDEX_OK;
}
Exemplo n.º 8
0
BOOL CAutoDetect::OnInitDialog() 
{
	bThreadActive=FALSE;

	CDialog::OnInitDialog();
	
	// translate dialog resources
	g_language.InitDialogStrings( this, IDD );

	// No drives found yet
	nCurrentDrive=0;

	CRect rcClient;

	// Get size of list control
	m_List.GetClientRect(rcClient);

	int iColWidth=rcClient.Width() / 6;

	// Create columns of track list
    CUStringConvert strCnv;
 
    m_List.InsertColumn( 0, strCnv.ToT( g_language.GetString( IDS_READ   )), LVCFMT_LEFT,  iColWidth, 0 );
	m_List.InsertColumn( 1, strCnv.ToT( g_language.GetString( IDS_ATAPI  )), LVCFMT_RIGHT, iColWidth, 0 );
	m_List.InsertColumn( 2, strCnv.ToT( g_language.GetString( IDS_ENABLE )), LVCFMT_RIGHT, iColWidth, 0 );
	m_List.InsertColumn( 3, strCnv.ToT( g_language.GetString( IDS_DENSITY)), LVCFMT_RIGHT, iColWidth*3/4, 0 );
	m_List.InsertColumn( 4, strCnv.ToT( g_language.GetString( IDS_ENDIAN )), LVCFMT_RIGHT, iColWidth*3/4, 0 );
	m_List.InsertColumn( 5, strCnv.ToT( g_language.GetString( IDS_RESULT )), LVCFMT_RIGHT, iColWidth, 0 );

	// Construct CDROMPARAMS
	CDROMPARAMS cdParams;

	// Get cdParames of current selected CD-ROM
	CR_GetCDROMParameters(&cdParams);

	dbgFile.printf("Start Auto probing info for drive %s \n\n",cdParams.lpszCDROMID);


	UpdateData(FALSE);

	// Disable OK button
	GetDlgItem(IDOK)->EnableWindow(FALSE);

	PostMessage(WM_COMMAND,ID_INITDETECTION);

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Exemplo n.º 9
0
void LListCtrl::SetHeaderControlText( DWORD dwPos, const CUString& strValue )
{
    myLockListCtrl.Lock();
    if ( m_hWnd )
    {
        CHeaderCtrl* pHeaderCtrl = GetHeaderCtrl();

        ASSERT( (int)dwPos < pHeaderCtrl->GetItemCount() );

        HDITEM hdi;

        memset( &hdi, 0, sizeof( HDITEM ) );

        // Get header item data
        pHeaderCtrl->GetItem( dwPos, &hdi );

        // modify item data
        CUStringConvert strCnv;
        hdi.pszText = strCnv.ToT( strValue );
        hdi.mask = HDI_TEXT;

        // Set item data
        pHeaderCtrl->SetItem( dwPos, &hdi );

    }
    myLockListCtrl.Unlock();
}
Exemplo n.º 10
0
void CGenreTable::Save( CUString strFileName )
{
	FILE* pFile = NULL;
	TCHAR lpszLine[ 255 ] = { '\0',};
	int i = 0;

    CUStringConvert strCnv;
	
    pFile = CDexOpenFile( strFileName, _W( "w" ) );

	if ( NULL != pFile )
	{
		for ( i = 0 ; i < (int)v_Entries.size(); i++ )
		{
			if ( CanBeModified( i ) )
			{
				CUString strLine;
                CUStringConvert strCnv;

				GENRETABLEENTRY newEntry = v_Entries[i] ;

				strLine.Format( _W( "%d\t%s\t%s\n" ), newEntry.nID3V1ID, (LPCWSTR)newEntry.strGenre, (LPCWSTR)newEntry.strCDDBGenre );

				_fputts( strCnv.ToT( strLine ), pFile );
			}
		}

		fclose( pFile );
	}
}
Exemplo n.º 11
0
void CEncoderDosXingDlg::SetControls(CEncoder* pEncoder)
{
    CUStringConvert strCnv;
	
    // Set control items based in pEncoder information
	m_cExtEncPath.SetWindowText(  strCnv.ToT( pEncoder->GetUser1() ) );

	m_bOriginal = pEncoder->GetOriginal();
	m_bCopyright = pEncoder->GetCopyRight();
	m_bCbrOrVbr = pEncoder->GetMode();
	
	m_bDownmixToMono	=(pEncoder->GetUserN1() >>0 ) & 0x01;
	m_bFilterHighFreq	=(pEncoder->GetUserN1() >>1 ) & 0x01;
	m_bSimpleStereo		=(pEncoder->GetUserN1() >>2 ) & 0x01;
	m_bEncChoose		=(pEncoder->GetUserN1() >>3 ) & 0x01;

	m_nVbrScale=pEncoder->GetUserN2();

	// Fill Min bitrate table
	FillMinBitrateTable();

	// Set the proper bitrate
	SetMinBitrate(pEncoder->GetBitrate());

	// Set data to controls
	UpdateData( FALSE );
}
Exemplo n.º 12
0
BOOL COpenFileDlg::FillFileList() 
{
    CUStringConvert strCnv;

	// clear list
	m_ctrlRequestedFiles.DeleteAllItems();

	CFileFind fileFind;

	if ((m_strDir[m_strDir.GetLength()-1]=='\\') )
		m_strDir=m_strDir.Left(m_strDir.GetLength()-1);

	// If directory does not exist, do not waste time
	if (!fileFind.FindFile( strCnv.ToT( m_strDir )) && (m_strDir.GetLength()>3) )
	{
		m_strDir=g_config.GetAppPath();
	}

	// create the extions strings
	MakeExtString();

	// do a recursive search for all the files with the proper extention
	AddRecursiveFiles( m_strDir, 0 );

	CSortClass csc( &m_ctrlRequestedFiles, m_nSortedColumn );
	ReSortColumns( );

	// Select All Items
	m_ctrlRequestedFiles.SelectAll();

	return TRUE;
}
Exemplo n.º 13
0
BOOL CRipStatusDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

    // translate dialog resources
    g_language.InitDialogStrings( this, IDD );

    CUStringConvert strCnv;
    m_ripStatus.SetWindowText( strCnv.ToT( m_strRipStatus ) );
    return TRUE;
}
Exemplo n.º 14
0
void CLanguage::ReportChangedID( int nID, const CUString& strResource, const CUString& strEnglish, int nType ) const
{
    if ( g_nReportMissing )
    {
        BOOL		bAdd = TRUE;
        CUString    strWrite;
        CUString    strTmp;
        CString		strRead;
        CStdioFile	cFile;
        CUStringConvert strCnv;

        switch ( nType )
        {
        case 0:
            strWrite.Format( _W( "#%04X# \"%s\"" ), nID, (LPCWSTR)strEnglish );
            strTmp.Format( _W( "#    # \"%s\"" ), (LPCWSTR)strResource );
            strWrite += _W( "\n" ) + strTmp;
            break;
        case 1:
            strWrite.Format( _W( "#M%04X# \"%s\"" ), nID, (LPCWSTR)strEnglish );
            strTmp.Format( _W( "#M    # \"%s\"" ), (LPCWSTR)strResource );
            strWrite += _W( "\n" ) + strTmp;
            break;
        case 2:
            strWrite.Format( _W( "#D%08X# \"%s\"" ), nID, (LPCWSTR)strEnglish );
            strTmp.Format( _W( "#D        # \"%s\"" ), (LPCWSTR)strResource );
            strWrite += _W( "\n" ) + strTmp;
            break;
        }

        EncodeTab( strWrite );

        if ( cFile.Open(	_T( "c:\\temp\\missing.txt" ),
                            CFile::modeReadWrite | CFile::modeNoTruncate | CFile::modeCreate ) )
        {
            while ( cFile.ReadString( strRead ) )
            {
                if ( strWrite.Find( CUString( strRead ) ) >=0 )
                {
                    bAdd = FALSE;
                    break;
                }
            }
        }

        if ( bAdd )
        {
            cFile.WriteString( strCnv.ToT( strWrite + _W( "\n" ) ) );
        }

        cFile.Close();
    }
}
Exemplo n.º 15
0
BOOL CMainFrame::OnMyToolTipText(UINT, NMHDR* pNMHDR, LRESULT* pResult)
{
	ASSERT(pNMHDR->code == TTN_NEEDTEXTA || pNMHDR->code == TTN_NEEDTEXTW);

	// need to handle both ANSI and UNICODE versions of the message
	TOOLTIPTEXTA* pTTTA = (TOOLTIPTEXTA*)pNMHDR;
	TOOLTIPTEXTW* pTTTW = (TOOLTIPTEXTW*)pNMHDR;
	CString strTipText;

	UINT nID = pNMHDR->idFrom;

	if (pNMHDR->code == TTN_NEEDTEXTA && (pTTTA->uFlags & TTF_IDISHWND) ||
		pNMHDR->code == TTN_NEEDTEXTW && (pTTTW->uFlags & TTF_IDISHWND))
	{
		// idFrom is actually the HWND of the tool
		nID = ((UINT)(WORD)::GetDlgCtrlID( (HWND)nID ) );
	}

	if (nID != 0) // will be zero on a separator
	{
		// don't handle the message if no string resource found
        CUStringConvert strCnv;
        CUString strLangTipText = g_language.GetString( nID );

		if ( strLangTipText.IsEmpty() )
		{
			return FALSE;
		}	

		// this is the command id, not the button index
        AfxExtractSubString( strTipText, strCnv.ToT( strLangTipText ), 1, _T( '\n' ));
	}
#ifndef _UNICODE
	if (pNMHDR->code == TTN_NEEDTEXTA)
		lstrcpyn(pTTTA->szText, strTipText, _countof(pTTTA->szText) );
	else
		_mbstowcsz(pTTTW->szText, strTipText, _countof(pTTTW->szText) );
#else
	if (pNMHDR->code == TTN_NEEDTEXTA)
		_wcstombsz(pTTTA->szText, strTipText, _countof(pTTTA->szText));
	else
		lstrcpyn(pTTTW->szText, strTipText, _countof(pTTTW->szText));
#endif
	*pResult = 0;

	// bring the tooltip window above other popup windows
	::SetWindowPos(pNMHDR->hwndFrom, HWND_TOP, 0, 0, 0, 0,
		SWP_NOACTIVATE|SWP_NOSIZE|SWP_NOMOVE|SWP_NOOWNERZORDER);

	return TRUE;    // message was handled
}
Exemplo n.º 16
0
void CCueSheet::OnBnClickedCopytoclipboard()
{
	CreateSheet();

	if ( OpenClipboard()==0 )  
	{
		CDexMessageBox( g_language.GetString( IDS_ERROR_CANNOTOPENCLIPBOARD ) );    
		return;  
	}
	// Remove the current Clipboard contents  
	if( EmptyClipboard()==0 )  
	{
		CDexMessageBox( g_language.GetString( IDS_ERROR_CANNOTEMPTYCLIPBOARD ) );
	}  

    DWORD dwNumBytes = ( m_strCueSheet.GetLength() + 1 ) * sizeof( TCHAR );

    HANDLE hData = GlobalAlloc( GMEM_MOVEABLE | GMEM_DDESHARE, dwNumBytes );

	if ( NULL != hData )
	{
        CUStringConvert strCnv;
    
		LPSTR lpszClip= (LPSTR)GlobalLock( hData );

        // clear while buffer, just to be sure
        memset( lpszClip, 0, dwNumBytes );

        // copy the string data
        memcpy( lpszClip, strCnv.ToT( m_strCueSheet ), dwNumBytes - sizeof( TCHAR ) );  

#ifndef _UNICODE
		if ( ::SetClipboardData( CF_TEXT, hData ) == NULL )  
		{
#else
		if ( ::SetClipboardData( CF_UNICODETEXT, hData ) == NULL )  
		{
#endif
    		CDexMessageBox( g_language.GetString( IDS_UNABLE_COPYTO_CLIPBOARD ) );
        }
	}

	// Close Clipboard
	CloseClipboard();
}

void CCueSheet::OnBnClickedClose()
{
    OnCancel();
}
Exemplo n.º 17
0
// CWAV::OpenForRead Method
CDEX_ERR CWAV::OpenForWrite(const CUString& strFileName, WORD wSampleRate, WORD wBitsPerSample, WORD wChannels)
{
	// Clear m_wfInfo struct
	(void)memset( &m_wfInfo, 0, sizeof( SF_INFO ) );
	
	m_wChannels = m_wfInfo.channels = wChannels;
	m_wBitsPerSample = wBitsPerSample;
	m_wfInfo.frames = -1;
	m_wfInfo.sections = 1;
	m_wSampleRate = m_wfInfo.samplerate = wSampleRate;
	
	int nCompression = SF_FORMAT_PCM_16;
	int	nFormat = SF_FORMAT_WAV;
	
	// Set format options
	m_wfInfo.format =(nFormat | nCompression);

    CUStringConvert strCnv;

	// Open stream
    #ifdef _UNICODE
	if (!(m_pSndFile = sf_open(	(const tchar*)strCnv.ToT( strFileName ),
								SFM_WRITE,
								&m_wfInfo ) ) )
    #else
	if (!(m_pSndFile = sf_open(	strCnv.ToT( strFileName ),
								SFM_WRITE,
								&m_wfInfo ) ) )
    #endif
	{
		ASSERT(FALSE);
		return CDEX_ERROR;
	}
	
	// return success
	return CDEX_OK;
}
Exemplo n.º 18
0
void CMainFrame::GetMessageString(UINT nID, CString& rMessage) const
{
    CUStringConvert strCnv;

	// load appropriate string
	CUString strLang = g_language.GetString( nID );

	// extract first portion of string
    AfxExtractSubString( rMessage, strCnv.ToT( strLang ), 0, '\n');

	if ( rMessage.IsEmpty() )
	{
		// not found
		TRACE1("Warning: no message line prompt for ID 0x%04X.\n", nID);
	}
}
Exemplo n.º 19
0
void CGetFileControl::Edit()
{

    CUStringConvert strCnv;

	// Create file open dialog
    CFileDialog dlg( TRUE, _T( "" ) , NULL, OFN_HIDEREADONLY, strCnv.ToT( m_strFilter ) );

	if ( IDOK == dlg.DoModal() )
	{
		POSITION pos = dlg.GetStartPosition();
		SetWindowText( dlg.GetNextPathName( pos ) );
		UpdateData( FALSE );
	}

}
Exemplo n.º 20
0
void CEncoderNttVqfDllDlg::FillMinBitrateTable()
{
	// Depending on the settings, fill the bit-rate tables
	m_MinBitrate.ResetContent();

	int nItems=sizeof(nttVqfBitrates)/sizeof(nttVqfBitrates[0] );
	
	int i;

	for ( i = 0; i < nItems; i++ )
	{
		CUString strItem;
		strItem.Format( _W( "%d kbps" ), nttVqfBitrates[ i ] );
        CUStringConvert strCnv;
        m_MinBitrate.AddString( strCnv.ToT( strItem ) );
	}
}
Exemplo n.º 21
0
void CCueSheet::OnBnClickedButton1()
{
	CreateSheet();

    CUStringConvert strCnv;
    CUStringConvert strCnv1;

    CDInfo& cdInfo = m_pDoc->GetCDInfo();
    CUString cueSheetName;
    DWORD cdID = cdInfo.GetDiscID();

    cueSheetName.Format( _W( "%s%08X.cue" ), 
        (LPCWSTR)g_config.GetMP3OutputDir(),
        cdID );

    CUString strFilter = g_language.GetString( IDS_CUESHEETFILESELECTION );

    CFileDialog cueFileDlg(
        FALSE,
        _T( ".cue" ),
        strCnv.ToT( cueSheetName ),
        OFN_OVERWRITEPROMPT,
        strCnv1.ToT( strFilter ) );

    if ( IDOK == cueFileDlg.DoModal() )
    {
        CUString strFileName = CUString( cueFileDlg.GetPathName() );
        FILE* pFile = CDexOpenFile( strFileName, _W( "w" ) );

        if ( pFile )
        {
#ifdef UNICODE
            BYTE btBOM[] = { 0xEF, 0xBB, 0xBF };
            fwrite( &btBOM, sizeof( btBOM ), 1, pFile );
#endif
            LPCSTR lpszUtf = strCnv.ToUTF8( m_strCueSheet );
            fwrite( lpszUtf, 
                    strlen( lpszUtf ), 
                    1, 
                    pFile );
            fclose( pFile );
        }

    }
}
Exemplo n.º 22
0
void CRiffWavToMP3::OnTimer(UINT nIDEvent)
{
    // Obtain the number of files
    if (m_Pos!=NULL)
    {
        // Get the file name to be converted
        CUString strFileName=m_pFileDlg->GetNextPathName(m_Pos);
        CUString strOrig(strFileName);

        // Update progress bar
        m_Progress.SetPos(m_nCurFile++);

        // Set current file name
        CUStringConvert strCnv;
        m_processingFile.SetWindowText( strCnv.ToT( strFileName ) );

        // Update controls
        UpdateData(FALSE);


        CWAV myWav;

        // Strip extension
        int nPos=strFileName.ReverseFind('.');

        // Stip it
        if (nPos>0)
            strFileName=strFileName.Left(nPos);

        // Do the conversion
        if (myWav.StripRiffWavHeader(strFileName)==CDEX_OK)
        {
            // delete the original file?
            if (m_pFileDlg->m_bDeleteOriginal)
                CDexDeleteFile(strOrig);
        }
    }
    else
    {
        OnCancel();
    }

    CDialog::OnTimer(nIDEvent);

}
Exemplo n.º 23
0
BOOL CGenericPropPage::OnInitDialog() 
{
	CPropertyPage::OnInitDialog();

	// translate dialog resources
	g_language.InitDialogStrings( this, IDD );

	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN1))->SetRange( 1, 100 );
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN2))->SetRange( 0, 100 );
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN3))->SetRange( 0, 100 );
	((CSpinButtonCtrl*)GetDlgItem(IDC_SPIN4))->SetRange( 1, 100 );

    CUStringConvert strCnv;
	m_tmpDir.SetWindowText( strCnv.ToT( g_config.GetTempDir() ) );

	UpdateControls();

	return TRUE;
}
Exemplo n.º 24
0
void COpenFileDlg::DoDataExchange(CDataExchange* pDX)
{
	CUString strLang;

	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(COpenFileDlg)
	DDX_Control(pDX, IDC_LIST_REQUESTED_FILES, m_ctrlRequestedFiles);
	DDX_Check(pDX, IDC_RECURSIVE_DIR, m_bRecursiveDir);
	DDX_Check(pDX, IDC_DELETE_ORIGINAL, m_bDeleteOriginal);
	DDX_Check(pDX, IDC_NORMALIZE, m_bNormalize);
	DDX_Check(pDX, IDC_RIFF_WAV, m_bRiffWav);
	DDX_Check(pDX, IDC_KEEPDIRLAYOUT, m_bKeepDirLayout);
	//}}AFX_DATA_MAP

	strLang = g_language.GetString( IDS_PLEASE_SELECTFOLDER );
    CUStringConvert strCnv;
    DDX_GetFolderControl(pDX, IDC_EDIT_DIR,m_EditDir, 0, strCnv.ToT( strLang ) );

}
Exemplo n.º 25
0
void CRipInfoDB::SetRipInfo(CUString strRipInfo)
{
	// Open file for append
    CUStringConvert strCnv;

    m_pFile = CDexOpenFile( m_strFileName, _W( "a+" ) );

	if ( NULL != m_pFile )
	{
        CUString strOut;

        strOut.Format( _W( "[%03d][I] : %s\n" ), m_nTrack, (LPCWSTR)strRipInfo  );

		_fputts( strCnv.ToT( strOut ), m_pFile );

		fclose( m_pFile );

		m_pFile = NULL;
	}
}
Exemplo n.º 26
0
BOOL CFModifyButton::PreTranslateMessage(MSG* pMsg) 
{                     
	//create the tooltip
	if (m_bFirstCall)
	{
		CUString strLang( g_language.GetString( IDS_DDX_GETFILE_SELECTFILE ) );

		m_ToolTip.Create( this );
		m_ToolTip.Activate( TRUE );
        CUStringConvert strCnv;
		m_ToolTip.AddTool( this, strCnv.ToT( strLang ) );
		m_bFirstCall = FALSE;
	}
  

	//give the tooltip a chance to handle the message
	m_ToolTip.RelayEvent(pMsg);

	return CButton::PreTranslateMessage(pMsg);
}
Exemplo n.º 27
0
void CRipInfoDB::SetRipInfoFinshedOK(CUString strRipInfo, ULONG crc )
{
    CUStringConvert strCnv;

	// Open file for append
    m_pFile = CDexOpenFile( m_strFileName, _W( "a+" ) );

	if ( m_pFile )
	{
        CUString strOut;

        strOut.Format( _W( "[%03d][C] : %s CRC=%08X\n" ), m_nTrack, (LPCWSTR) strRipInfo, crc );

		_fputts( strCnv.ToT( strOut ), m_pFile );

		fclose( m_pFile );

		m_pFile = NULL;
	}
}
Exemplo n.º 28
0
// CONSTRUCTOR of CEncoderPropPage
CEncoderPropPage::CEncoderPropPage() : CPropertyPage(CEncoderPropPage::IDD)
{
    static CUStringConvert strCnv;

    m_strTitle  = g_language.GetString( IDS_ENCODERPROPPAGE );
	m_psp.pszTitle = strCnv.ToT( m_strTitle );
	m_psp.dwFlags |= PSP_USETITLE;

	//{{AFX_DATA_INIT(CEncoderPropPage)
	//}}AFX_DATA_INIT
	m_bRiffWav = g_config.GetRiffWav();
	m_bRetainWAVFile = g_config.GetRetainWavFile();

	for ( int i = 0; i < NUMENCODERS; i++ )
	{
		m_pEncoder[ i ] = NULL;
	}

	m_nEncoders = 0;
	m_nOldSel = -1;
}
Exemplo n.º 29
0
void CGenericPropPage::DoDataExchange(CDataExchange* pDX)
{
    CUString strLang;

    CPropertyPage::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CGenericPropPage)
    DDX_Check(pDX, IDC_NORMTRACK, m_bNormTrack);
    DDX_Text(pDX, IDC_LNORMLEVEL, m_nLNormLevel);
    DDX_Text(pDX, IDC_UNORMLEVEL, m_nUNormLevel);
    DDX_Text(pDX, IDC_LNORMVALUE, m_nLNormFactor);
    DDV_MinMaxInt(pDX, m_nLNormFactor, 1, 100);
    DDX_Text(pDX, IDC_HNORMVALUE, m_nHNormFactor);
    DDV_MinMaxInt(pDX, m_nHNormFactor, 1, 100);
    DDX_Check(pDX, IDC_AUTOSHUTDOWN, m_bAutoShutDown);
    DDX_Check(pDX, IDC_DIGITALCDPLAYBACK, m_bDigitalCDPlay);
    //}}AFX_DATA_MAP
    // Set Folder selection 
    strLang = g_language.GetString( IDS_PLEASE_SELECTFOLDER );
    CUStringConvert strCnv;
    DDX_GetFolderControl(pDX, IDC_TEMPDIR, m_tmpDir, 0, strCnv.ToT( strLang ) );
}
Exemplo n.º 30
0
void CLanguage::SearchLanguageFiles( )
{
    CUString	strSearchName;
    CFileFind	fileFind;
    BOOL		bFound = FALSE;

//    PVOID pTest = (PVOID)m_strLanguageDir;
//CString str;
//CString str1 =_T( "CSTRING1" );
//CString str2 =_T( "CSTRING2" );
//CUString str3( _W("CUSTRING" ));
//    str.Format(	_W( "%s" ),str1 );
//    str.Format(	_W( "%s" ),(LPCWSTR)str3 );
//    str.Format(	_W( "%s\\lang\\*%s" ),
//							str1,
//							str3);


//    CUString* p1 = &str3;
//    CString* p2 = &str1;

    // build the filename search string
    strSearchName.Format( _W( "%s\\lang\\*%s" ), (LPCWSTR)m_strLanguageDir, (LPCWSTR)m_strLangFileExt );

    CUStringConvert strCnv;

    bFound = fileFind.FindFile( strCnv.ToT( strSearchName ) );

    while ( bFound )
    {
        bFound = fileFind.FindNextFile();

        CUString strFileName = fileFind.GetFileName();

        CUString strLanguage = strFileName.Left( strFileName.GetLength() - m_strLangFileExt.GetLength() );

        m_vLangFiles.push_back( strLanguage );
    }
    sort( m_vLangFiles.begin(), m_vLangFiles.end() );
}