void OnSize(UINT, CSize s) {
			auto DPI = QueryScreenDPIEx(*this);

			pfc::string_formatter msg;
			msg << "Current size: ";
			if ( DPI.cx > 0 && DPI.cy > 0 ) {
				msg << MulDiv( s.cx, 96, DPI.cx ) << "x" << MulDiv( s.cy, 96, DPI.cy ) << " units, ";
			} 
			msg << s.cx << "x" << s.cy << " pixels";
			
			uSetDlgItemText( *this, IDC_STATIC_SIZE, msg );
		}
Beispiel #2
0
void spectrum_extension::enable( const ui_extension::visualisation_host_ptr & p_vis_host)
{
	p_host = p_vis_host;
	b_active = true;

	const unsigned cx_dpi = QueryScreenDPIEx().cx;
	m_bar_width = MulDiv(cx_dpi, 3, 96);
	m_bar_gap = MulDiv(cx_dpi, 1, 96);
	
	if (list_vis.add_item(this) == 0)
		static_api_ptr_t<visualisation_manager>()->create_stream(g_stream, NULL);

	static_api_ptr_t<play_callback_manager>()->register_callback(this, play_callback::flag_on_playback_new_track|play_callback::flag_on_playback_stop|play_callback::flag_on_playback_pause, false);
	if (static_api_ptr_t<play_control>()->is_playing())
		g_register_stream(this);
}
Beispiel #3
0
void spectrum_extension::enable( const ui_extension::visualisation_host_ptr & p_vis_host)
{
	p_host = p_vis_host;
	b_active = true;

	const unsigned cx_dpi = QueryScreenDPIEx().cx;
	m_bar_width = MulDiv(cx_dpi, 3, 96);
	m_bar_gap = MulDiv(cx_dpi, 1, 96);
	
	if (list_vis.add_item(this) == 0)
	{
		static_api_ptr_t<visualisation_manager>()->create_stream(g_stream, visualisation_manager::KStreamFlagNewFFT);
		visualisation_stream_v2::ptr p_stream_v2;
		if (g_stream->service_query_t(p_stream_v2))
			p_stream_v2->set_channel_mode(visualisation_stream_v2::channel_mode_mono);
	}

	static_api_ptr_t<play_callback_manager>()->register_callback(this, play_callback::flag_on_playback_new_track|play_callback::flag_on_playback_stop|play_callback::flag_on_playback_pause, false);
	if (static_api_ptr_t<play_control>()->is_playing())
		g_register_stream(this);
}