Powerbasic Museum 2020-B

IT-Consultant: Patrice Terrier => C# Programming => Topic started by: Patrice Terrier on August 17, 2007, 10:47:21 PM

Title: VS2010 - BlackBox (OpenGL + Audio + XP AERO like)
Post by: Patrice Terrier on August 17, 2007, 10:47:21 PM
The project uses exclusively the features found in VISUAL C# 2005 Express Edition.

The ZIP file content

- Project source code for DotNET 2.0+
- Skinned form in 9-image mode using variable opacity on NT platforms.
- Visual effects based on OpenGL.
- Playing MP3 audio using BASS.DLL.
- PNG graphic components specificaly designed for the project.
- One free MP3 audio file.

Apart of the MAIN_Form class, the project uses 4 specific classes:
1 - Audio.cs (BASS.dll interface).
2 - OpenGL.cs (OpenGL interface).
3 - Win32.cs (Flat API encapsulation).
4 - SkinEngine (properties and methods of the Skin Engine).

Note: The mp3 file and BASS.dll are located into the project folder named "\bin\debug".
BASS.dll from Ian Luck (www.un4seen.com) is a prerequisite for playing audio.

Very important:
The code must take over the WinProc, to handle the very important WM_NCHITTEST message,
to mimic the behavior of a standard window.

Drag & drop:
You can use it between Explorer and BlackBox to play any mp3 files !

SETUP parameters:
private void SETUP_parameters()
{
    // Setup default Skin colors
    SK.ColorLayerBackground = Color.FromArgb(255, 64, 64, 64);
    SK.ColorCaptionEnabled = Color.FromArgb(255, 220, 220, 220);
    SK.ColorCaptionDisabled = Color.FromArgb(255, 92, 92, 92);

    // Skin opacity in the range 0-255
    SK.Alpha = 204; // 80 % default transparency level

    // OpenGL
    InitOpenGL(OPENGL_Container.Handle);
    StartAnimation();
    // Try playing with these parameters
    Pulsating = true; // Rem this out to disable pulsating effect
    Velocity = true;  // Rem this out to disable velocity effect

    // BASS.dll
    BASS.Init(hFORM_Main);
    // Default audio file (Edit to use yours)
    BASS.FileToPlay = @"BlackBox.mp3";

    // Drag & drop
    // It accepts only mp3 files dragged from Windows Explorer
    Api.DragAcceptFiles(hFORM_Main, true);

}


Last, but not the least:
For those who may wonder why I am not using exclusively managed code.
Suffice to say that because I am working with different languages, it is easier for me (when writting demo) to use the only common denominator to all of them, the Flat Win32 API.

Screen shot:

(http://www.zapsolution.com/preview/blackbox.jpg)


Patrice Terrier
www.zapsolution.com
Title: Re: BlackBox [OpenGL + Audio + XP AERO like]
Post by: Patrice Terrier on August 17, 2007, 10:56:03 PM
Free music to try with BlackBox

bossa01.mp3 (http://www.zapsolution.com/music/bossa01.mp3)
cool01.mp3 (http://www.zapsolution.com/music/cool01.mp3)
drums01.mp3 (http://www.zapsolution.com/music/drums01.mp3)
drums02.mp3 (http://www.zapsolution.com/music/drums02.mp3)
guitar01.mp3 (http://www.zapsolution.com/music/guitar01.mp3)
organ01.mp3 (http://www.zapsolution.com/music/organ01.mp3)
organ02.mp3 (http://www.zapsolution.com/music/organ02.mp3)
piano01.mp3 (http://www.zapsolution.com/music/piano01.mp3)
piano02.mp3 (http://www.zapsolution.com/music/piano02.mp3)
synth01.mp3 (http://www.zapsolution.com/music/synth01.mp3)
synth02.mp3 (http://www.zapsolution.com/music/synth02.mp3)

Title: Re: VS2010 - BlackBox (OpenGL + Audio + XP AERO like)
Post by: Patrice Terrier on August 11, 2011, 02:21:23 PM
The first post of this thread has been updated, to fix the ZIP file corruption caused by the "Server Collapse".

...