Ejemplo n.º 1
0
void CWMPADialog::OnDblclkPlaylist()
{
	// TODO: Add your control notification handler code here
   long index;

   // Get the playlist name
   index = m_PlaylistBox.GetCurSel();
   CString playlistName;
   m_PlaylistBox.GetText(index, playlistName);

   // Get the playlist
   CWMPPlaylistCollection pc = m_WMP.GetPlaylistCollection();
   CWMPPlaylistArray pa = pc.getByName((LPCTSTR) playlistName);
   CWMPPlaylist playlist = pa.Item(0);
   m_WMP.SetCurrentPlaylist(playlist);

   // Set the song list
   UpdateSongList();

   m_WMP.GetControls().play();
   if (autoAnnounce) {
      hexchat_commandf(ph, "me is playing %s", (LPCTSTR) wmpaGetSongTitle());
   }
   else {
      hexchat_printf(ph, "WMPA: Playing %s", (LPCTSTR) wmpaGetSongTitle());
   }
}
Ejemplo n.º 2
0
void EditCoursesSongMenu::SetGroupByName( CString sGroup )
{
	unsigned i;
	for( i = 0; i < m_aGroups.size(); ++i )
		if( !sGroup.CompareNoCase( m_aGroups[i] ) )
			break;
	ASSERT_M( i < m_aGroups.size(), ssprintf("%s", sGroup.c_str() ) );
	m_iSelection[ROW_GROUP] = i;

	UpdateSongList();
}
Ejemplo n.º 3
0
void EditCoursesSongMenu::OnRowValueChanged( Row row )
{
	LOG->Trace( "EditCoursesSongMenu::OnRowValueChanged(%i)", row );

	m_sprArrows[0].SetDiffuse( CanGoLeft()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
	m_sprArrows[1].SetDiffuse( CanGoRight()?RageColor(1,1,1,1):RageColor(0.2f,0.2f,0.2f,1) );
	m_sprArrows[0].EnableAnimation( CanGoLeft() );
	m_sprArrows[1].EnableAnimation( CanGoRight() );

	CString sGroup = GetSelectedGroup();
	Song *pSong = GetSelectedSong();
	
	switch( row )
	{
	case ROW_GROUP:
	{
		CHECKPOINT;
		m_textValue[ROW_GROUP].SetText( sGroup );

		UpdateSongList();

		pSong = GetSelectedSong();
	}
		// fall through
	case ROW_SONG:
		CHECKPOINT;
		m_textValue[ROW_SONG].SetText( pSong? pSong->GetTranslitMainTitle():CString("") );
		// fall through

	case ROW_TYPE:
		CHECKPOINT;
		m_textValue[ROW_TYPE].SetText( CourseEntryTypeToString(GetSelectedType()) );
		for( int i = 0; i < NUM_ROWS; ++i )
			m_textValue[i].SetDiffuse( 
				g_bRowEnabledForType[GetSelectedType()][i]?
					RageColor(1,1,1,1):RageColor(0.4f,0.4f,0.4f,1) );
		// fall through

	case ROW_DIFFICULTY:
	{
		CHECKPOINT;
		Difficulty dc = GetSelectedDifficulty();
		if( dc == DIFFICULTY_INVALID )
			m_textValue[ROW_DIFFICULTY].SetText( "(any)" );
		else
			m_textValue[ROW_DIFFICULTY].SetText( DifficultyToString(dc) );
		// fall through
	}
	case ROW_LOW_METER:
		CHECKPOINT;
		if( GetLowMeter() == -1 )
			m_textValue[ROW_LOW_METER].SetText( "(any)" );
		else
			m_textValue[ROW_LOW_METER].SetText( ssprintf("%d",GetLowMeter()) );
		// fall through

	case ROW_HIGH_METER:
		CHECKPOINT;
		if( GetHighMeter() == -1 )
			m_textValue[ROW_HIGH_METER].SetText( "(any)" );
		else
			m_textValue[ROW_HIGH_METER].SetText( ssprintf("%d",GetHighMeter()) );
		// fall through

	case ROW_BEST_WORST_VALUE:
		CHECKPOINT;
		m_textValue[ROW_BEST_WORST_VALUE].SetText( ssprintf("%d",GetBestWorst()+1) );
		break;

	default:
		ASSERT(0);	// invalid row
	}
}