Ejemplo n.º 1
0
void CDialogSound::OnDblclkTreeSounds(NMHDR* pNMHDR, LRESULT* pResult)
{
	*pResult = 0;
	CPoint pt;
	GetCursorPos( &pt );
	treeSounds.ScreenToClient( &pt );
	HTREEITEM item = treeSounds.HitTest( pt );

	if (item) {
		DWORD dw = treeSounds.GetItemData( item );
		if ( dw == SOUNDS || dw == INUSESOUNDS ) {
			if ( !treeSounds.ItemHasChildren( item ) ) {
				strShader = treeSounds.GetItemText( item );
				UpdateData( FALSE );
				ApplyChanges( false, ( dw == SOUNDS ) );
			}
		} else if ( dw == WAVES ) {
			strShader = RebuildItemName( "Wave Files", item );
			UpdateData( FALSE );
			OnBtnApply();
		}
	}
	*pResult = 0;
}
Ejemplo n.º 2
0
void CDialogSound::OnSelchangedTreeSounds(NMHDR* pNMHDR, LRESULT* pResult)
{
	NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
	HTREEITEM	item = treeSounds.GetSelectedItem();
	SetWaveSize();
	if (item) {
		DWORD	dw = treeSounds.GetItemData(item);
		if ( dw == SOUNDS || dw == INUSESOUNDS ) {
			playSound = treeSounds.GetItemText(item);
			if (bPlay){
				OnBtnPlaysound();
			}
		} else if (dw == WAVES) {
			playSound = RebuildItemName("Wave Files", item);
			float size = fileSystem->ReadFile( playSound, NULL );
			SetWaveSize( va( "%0.2f mb", size / ( 1024 * 1024)  ) );
			if (bPlay){
				OnBtnPlaysound();
			}
		}
	}

	*pResult = 0;
}