Exemplo n.º 1
0
BOOL CLibraryAlbumTrack::LockRating()
{
	if ( m_nSetRating == 7 )
	{
		CFilePropertiesSheet dlg;
		dlg.Add( m_nIndex );
		return dlg.DoModal( 2 ) == IDOK;
	}
	else if ( m_nSetRating >= 0 && m_nSetRating <= 6 )
	{
		CQuickLock oLock( Library.m_pSection );
		CLibraryFile* pFile = Library.LookupFile( m_nIndex );
		if ( pFile == NULL ) return FALSE;
		
		pFile->m_nRating = m_nRating = ( m_nSetRating > 1 ? m_nSetRating : 0 );
		pFile->ModifyMetadata();
		
		Library.Update();
		return TRUE;
	}
	else
	{
		return FALSE;
	}
}
Exemplo n.º 2
0
void CLibraryMetaPanel::OnLButtonUp(UINT nFlags, CPoint point)
{
	point.y += GetScrollPos( SB_VERT );

	if ( m_nSelected > 0 && m_rcFolder.PtInRect( point ) )
	{
		CQuickLock oLock( Library.m_pSection );

		if ( CLibraryFolder* pFolder = LibraryFolders.GetFolder( m_sFolder ) )
		{
			if ( Settings.Library.ShowVirtual )
			{
				CLibraryFrame* pFrame = (CLibraryFrame*)GetOwner();
				ASSERT_KINDOF(CLibraryFrame, pFrame );
				pFrame->Display( pFolder );
			}
			else if ( LibraryFolders.CheckFolder( pFolder, TRUE ) )
			{
				ShellExecute( AfxGetMainWnd()->GetSafeHwnd(), NULL,
					m_sFolder, NULL, NULL, SW_SHOWNORMAL );
			}
		}
	}
	else if ( m_nSelected > 0 && m_rcRating.PtInRect( point ) )
	{
		CLibraryListPtr pList( GetViewSelection() );

		if ( pList && pList->GetCount() > 0 )
		{
			CFilePropertiesSheet dlg;
			dlg.Add( pList );
			dlg.DoModal( 2 );
		}
	}
	else if ( CMetaItem* pItem = m_pMetadata->HitTest( point, TRUE ) )
	{
		CQuickLock oLock( Library.m_pSection );

		if ( CAlbumFolder* pFolder = pItem->GetLinkTarget() )
		{
			CLibraryFrame* pFrame = (CLibraryFrame*)GetOwner();
			ASSERT_KINDOF(CLibraryFrame, pFrame );
			pFrame->Display( pFolder );
		}
	}

	CPanelCtrl::OnLButtonUp( nFlags, point );
}
void CLibraryFileView::OnLibraryProperties()
{
	CFilePropertiesSheet dlg;
	//CStringList oFiles;

	CSingleLock pLock( &Library.m_pSection, TRUE );

	POSITION posSel = StartSelectedFileLoop();
	while ( CLibraryFile* pFile = GetNextSelectedFile( posSel, FALSE, FALSE ) )
	{
		dlg.Add( pFile );
		//oFiles.AddTail( pFile->GetPath() );
	}

	pLock.Unlock();

	//HRESULT hr;
	//CComPtr< IDataObject > pDataObject;
	//{
	//	// Convert path string list to PIDL list
	//	auto_array< PIDLIST_ABSOLUTE > pShellFileAbs( new PIDLIST_ABSOLUTE [ oFiles.GetCount() ] );
	//	for ( int i = 0 ; i < oFiles.GetCount() ; ++i )
	//	  pShellFileAbs[ i ] = ILCreateFromPath( oFiles.GetHead() );
	//
	//	PIDLIST_ABSOLUTE pShellParent = ILCloneFull( pShellFileAbs[ 0 ] );
	//	ILRemoveLastID( pShellParent );
	//
	//	auto_array< LPCITEMIDLIST > pShellFiles( new LPCITEMIDLIST [ oFiles.GetCount() ] );
	//	POSITION pos = oFiles.GetHeadPosition();
	//	for ( int i = 0 ; i < oFiles.GetCount() ; ++i )
	//		pShellFiles[ i ] = ILFindChild( pShellParent, pShellFileAbs[ i ] );
	//
	//	hr = CIDLData_CreateFromIDArray( pShellParent, oFiles.GetCount(),
	//		pShellFiles.get(), &pDataObject );
	//
	//	ILFree( pShellParent );
	//
	//	for ( int i = 0 ; i < oFiles.GetCount() ; ++i )
	//		ILFree( (LPITEMIDLIST)pShellFileAbs[ i ] );
	//}
	//if ( SUCCEEDED( hr ) )
	//	hr = SHMultiFileProperties( pDataObject, 0 );

	dlg.DoModal();
}