LRESULT CALLBACK WndProc (HWND hWnd, UINT message,
                          WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {
    case WM_CREATE:
        return 0;
    case WM_CLOSE:
    PostQuitMessage (0);
    // wind the frequency down...
	BASS_ChannelSlideAttribute(chan,BASS_ATTRIB_FREQ,1000,500);
	Sleep(300);
	// ...and fade-out to avoid a "click"
	BASS_ChannelSlideAttribute(chan,BASS_ATTRIB_VOL,-1,200);
	while (BASS_ChannelIsSliding(chan,0)) Sleep(1);
	BASS_Free();
	FreeBASS();
    return 0;
    case WM_DESTROY:
        return 0;

    default:
        return DefWindowProc (hWnd, message, wParam, lParam);
    }
}
BOOL APIENTRY TestDlgProc (HWND hDlg, UINT message, UINT wParam, LONG lParam) 
        { 
    switch (message) 
        { 
    case WM_CLOSE:
		// wind the frequency down...
	BASS_ChannelSlideAttribute(chan,BASS_ATTRIB_FREQ,1000,500);
	Sleep(300);
	// ...and fade-out to avoid a "click"
	BASS_ChannelSlideAttribute(chan,BASS_ATTRIB_VOL,-1,200);
	while (BASS_ChannelIsSliding(chan,0)) Sleep(1);
	BASS_Free();
	FreeBASS();
   	EndDialog(hDlg,TRUE); 
   	break;
	case WM_INITDIALOG:
	CheckExtensionsProc(hDlg);
		 break;
	case WM_COMMAND:
   			switch(LOWORD(wParam))
   			{
   			case IDC_DUMPINFO:
			DumpOGLDriverInformation();
			break;
			case IDC_CREDITS:
			MessageBox(hDlg,"Programming and Core Design: Brad 'mudlord' Miller\nGFX:   Brad 'mudlord' Miller\nSFX:   Dubmood/Razor 1911\n\nSound system by Ian Luck\n\n(C) 2007-2008 Brad Miller ([email protected])\nhttp://vba-m.ngemu.com\nAll rights reserved\n\nThis tool is written only for Glide64 and the 'Glitch64' wrapper. Nothing else.\nThis is NOT to be distributed out of the Glide64 package without the proper written consent of the author.", "Credits",MB_TASKMODAL|MB_ICONINFORMATION);
			break;
			case IDC_TEXTUREBUTTON:
			MessageBox(hDlg,"Multitexturing is a vital feature required for the wrapper.\nMultitexturing is a video card feature that allows for two or more textures to be mapped to one 2D/3D object in one rendering pass.", "Multitexturing Information",MB_TASKMODAL|MB_ICONINFORMATION);
			break;
			case IDC_GLSLBUTTON:
			MessageBox(hDlg,"GLSL (pixel and vertex shader) support is a highly recommended feature, to be supported.\nGLSL support allows for the advanced GLSL shader-based combiner used in the wrapper. This is needed for advanced blending features and special effects such as dithered alpha rendering.\nIt is highly recommended that this is supported for optimal wrapper rendering and support.\n\nA modern video card (such as a ATI Radeon 9600 or a GeForce FX5200) is needed for GLSL combiner support.", "Pixel and Vertex Shader (GLSL) Information",MB_TASKMODAL|MB_ICONINFORMATION);
			break;
			case IDC_FBOBUTTON:
			MessageBox(hDlg,"Framebuffer object support is a recommended feature to be supported by the video card, for use in Glitch64.\n\nFramebuffer object support allows for hardware framebuffer emulation to be supported,\ndue to framebuffer objects being used to allow for hardware-accelerated render to texture, as well as for auxiliary video rendering buffer allocation.\nHowever, framebuffer object usage in the wrapper can be disabled, and glCopyTexImage2D-based render to texture can be used instead, which is supported on all OpenGL compliant video cards.\n\nA modern video card with OpenGL 1.5 support (such as a ATI Radeon 9600 or a GeForce FX5200) is needed for framebuffer object utilization.", "Framebuffer Object Information",MB_TASKMODAL|MB_ICONINFORMATION);
			break;
			case IDC_NPOTBUTTON:
			MessageBox(hDlg,"Non power of two texture support is a completely optional feature.\n\nTextures that are not in a power of two often use less space than textures that are scaled in powers of 2.\nNon-power of two texture support, allows for textures that are not in a power of two, to be used in rendering. Thus, due to the absence of texture scaling to powers of two, VRAM can be saved as textures do not need to be scaled up to a power of two.\n\nA modern video card with OpenGL 2.0 (such as a GeForce 6 6600GT)  support is needed for non power of two texture support.", "Non Power of Two Texture Information",MB_TASKMODAL|MB_ICONINFORMATION);
			break;
			case IDC_S3TCBUTTON:
			MessageBox(hDlg,"S3TC texture compression support is a optional (but recommended) feature.\n\nS3TC texture compression allows for more efficient use of video memory, due to support for textures that are being compressed. This has a quality tradeoff however, when S3TC texture compression is enabled in the texture enhancement module, 'GlideHQ'.", "S3TC Texture Compression Information",MB_TASKMODAL|MB_ICONINFORMATION);
			break;
			case IDC_FXT1BUTTON:
			MessageBox(hDlg,"FXT1 texture compression support is a completely optional feature.\n\nFXT1 texture compression is a proprietary 3dfx compression method. It is currently only supported on 3dfx and Intel-based video cards and chipsets. FXT1 texture compression is used as a alternative to S3TC texture compression.", "FXT1 Texture Compression Information",MB_TASKMODAL|MB_ICONINFORMATION);
			break;
			case IDC_PACKEDPIXELS:
			MessageBox(hDlg,"Packed pixel support is a strongly recommended feature used in Glitch64\n\nPacked pixel support is used in Glitch64 for correct texture format conversions, to assist with image quality.", "Packed Pixel Information",MB_TASKMODAL|MB_ICONINFORMATION);
			break;
   			}
 		default:
   			return FALSE;
   }   
   return TRUE;
}
Example #3
0
void Fader::run()
{
    BASS_ChannelSlideAttribute(stream, BASS_ATTRIB_VOL, -1, Tiempo);
    this->msleep(Tiempo);
    BASS_ChannelStop(stream);
    BASS_StreamFree(stream); //lo liberamos
    // this->terminate();


}
/// <summary>
/// FadeIn de la música que está por sonar (LShift + S).
/// </summary>
/// <param name="&MusicName">Nueva música a reproducir.</param>
void CSoundManager::FadeIn(const std::string &MusicName, DWORD _ulTime)
{
	try
	{
		bool pass = true;
		std::map<std::string, SSoundData>::iterator iter = m_Resources.find(MusicName);
  
		if(iter == m_Resources.end())
		{
			// Guarda mensaje de error en el log
      std::string msg_error = "CSoundManager::FadeIn->No se encontró el identificador de la música: ";
			msg_error.append(MusicName.c_str());
			LOGGER->AddNewLog(ELL_ERROR, msg_error.c_str());
			return;
		}

		SSoundData sData = iter->second;
	 
		// En caso de que los dos canales de música ya estén asignados
		if (m_iMusicChannels == 1)
		{
			m_iMusicChannels = 0;
		}
		else
		{
			// Asignar esta música al canal 1
			m_iMusicChannels = m_iMusicChannels + 1;
		}
	 
		//Agregarlo a canal de música en el vector m_Channels; 
		m_Channels[m_iMusicChannels].m_dwSource = sData.m_Id;
		m_Channels[m_iMusicChannels].m_fVolumen = 1;
	   
		if (pass)
		{
			// Reproducción del canal 
			BASS_ChannelSetAttribute(sData.m_Id, BASS_ATTRIB_VOL, 0);
 
			BASS_ChannelSlideAttribute(sData.m_Id, BASS_ATTRIB_VOL, sData.m_Volume, _ulTime);

			pass = BASS_ChannelPlay(sData.m_Id, FALSE)?true:false;
 
			if (pass)
			{
				std::string msg_debug = "Sonido reproducido con éxito";
			}
		}	
	}
	catch(CException e)
  {
		// Guarda mensaje de error en el log
		std::string msg_error = "CSoundManager::FadeIn-> El proceso no se llevó a cabo exitosamente.";
  }
}
/// <summary>
/// Fadeout de la música que esté sonando (LShift + D).
/// </summary>
void CSoundManager::FadeOut(DWORD _ulTime)
{
	try
	{
		//Obtener Id de la música
		DWORD MusicId =  m_Channels[m_iMusicChannels].m_dwSource;
		BASS_ChannelSlideAttribute(MusicId, BASS_ATTRIB_VOL, -1, _ulTime);
	}
	catch(CException e)
  {
		// Guarda mensaje de error en el log
		std::string msg_error = "CSoundManager::FadeOut-> El proceso no se llevó a cabo exitosamente: ";
  }
}
Example #6
0
void CFusicCartsDlg::OnBnClickedBtnLogout()
{
	//ensure we want to logout:
	int res = MessageBox("Are you sure you want to log out?\nNOTE: All user carts will be "
		"halted when you logout.",
		"Fusic", MB_YESNO | MB_ICONQUESTION);

	if(res == IDNO)
	{
		//don't logout:
		return;
	}


	//stop all user carts:
	//(stop all nav buttons):
	for(std::vector<SNavigationStreams>::iterator i = m_vecNavStreamsBottom.begin();
		i != m_vecNavStreamsBottom.end(); i++)
	{
		//fade out the cart (500 ms):
		BASS_ChannelSlideAttribute(i->stream, BASS_ATTRIB_VOL, 0, 500);
		//also remove from the map:
		for(T_mapCallback::iterator j = g_mapCartCallbacks.end(); j != g_mapCartCallbacks.end();
			j++)
		{
			if(j->first == i->syncHandle)
			{
				g_mapCartCallbacks.erase(j);
				break;
			}
		}

		//remove old end sync:
		BASS_ChannelRemoveSync(i->stream, i->syncHandle);

		//create a new sync at the end of the slide:
		//NOTE: We should be safe to call this callback function, it is a part of a class
		//that will be destroyed when the window is, however, it is a static function and 
		//therefore
		//does not need a class to be created in order to use the function:
		BASS_ChannelSetSync(i->stream, BASS_SYNC_SLIDE, 0, &CCallbackButton::fnSlideCallback,
			NULL);
	}

	//(stop page buttons):
	for(mapCart::iterator i = m_mapBtnCartBottom.begin(); i != m_mapBtnCartBottom.end();
		i++)
	{
		i->second->fnStop(true);
	}

	//add all the currently playing fuse carts:
	//(current wall):
	for(mapCart::iterator i = m_mapBtnCartTop.begin(); i != m_mapBtnCartTop.end(); i++)
	{
		if(i->second->fnGetCurrentStream() != 0)
		{
			CString strTitle;
			SCartsList lst;
			HSYNC callbackSync;

			//remove the callback from the global map:
			for(T_mapCallback::iterator j = g_mapCartCallbacks.begin(); j != g_mapCartCallbacks.end();
				j++)
			{
				if(j->first == i->second->fnGetCurrentSync())
				{
					g_mapCartCallbacks.erase(j);
					break;
				}
			}

			//reset the callback:
			BASS_ChannelRemoveSync(i->second->fnGetCurrentStream(), 
				i->second->fnGetCurrentSync());
			callbackSync = BASS_ChannelSetSync(i->second->fnGetCurrentStream(), 
				BASS_SYNC_END, 0, CFusicLoginDlg::fnLoginDialogCartCallback, m_pLoginDlg);
			//create a new cart list element:

			i->second->GetWindowTextA(strTitle);
			lst.hstCartsStream = i->second->fnGetCurrentStream();
			lst.hsyCartsSync = 0;
			lst.strTitle = strTitle;
			lst.hsyCartsSync = callbackSync;
			lst.intPageNumber = m_intCurrnetDialogPageTop;
			lst.strCartPosistion = i->first;
			m_pLoginDlg->fnAddCartToList(lst);
		}//if
	}//for

	//(nav walls):
	for(std::vector<SNavigationStreams>::iterator ii = m_vecNavStreamsTop.begin();
		ii != m_vecNavStreamsTop.end(); ii++)
	{
		CString strTitle;
		SCartsList lst;
		HSYNC callbackSync;
		lst.hstCartsStream = ii->stream;

		lst.intPageNumber = ii->intPageNumber;
		lst.strCartPosistion = ii->btnIterator->first;

		//remove the callback from the global map:
		for(T_mapCallback::iterator j = g_mapCartCallbacks.begin(); j != g_mapCartCallbacks.end();
			j++)
		{
			if(j->first == ii->syncHandle)
			{
				g_mapCartCallbacks.erase(j);
				break;
			}
		}

		//change the callbacks:
		BASS_ChannelRemoveSync(ii->stream, 
			ii->syncHandle);
		callbackSync = BASS_ChannelSetSync(ii->stream, 
			BASS_SYNC_END, 0, CFusicLoginDlg::fnLoginDialogCartCallback, m_pLoginDlg);
		lst.hsyCartsSync = callbackSync;

		//to get the title we will need to do an SQL query :-(
		CString strQuery;
		CString strPageNumber;
		strPageNumber.Format("%d", ii->intPageNumber);
		strQuery = "SELECT Cart_Title FROM tbl_carts WHERE Show_ID = 0 AND Cart_ID = ";
		strQuery += strPageNumber;
		strQuery += ii->btnIterator->first;

		//do the query:
		mysqlpp::StoreQueryResult res = fnGetResultSetForQuery(strQuery);
		lst.strTitle = res[0]["Cart_Title"];
		m_pLoginDlg->fnAddCartToList(lst);
	}

	//kill the main dialog:
	m_pMainDlg->doOk();

	//logout of the fusic carts screen:
	OnOK();
}
Example #7
0
		void BassSound3D::SetFading(float value, unsigned int time)
		{
			// value: 0 (silent) to 1 (full)
			// time: in milliseconds
			BASS_ChannelSlideAttribute(m_channel, BASS_ATTRIB_VOL, value, time);
		}