Copyright © 2001-2019 MultiMedia Soft

Fader.Display object

Previous pageReturn to chapter overviewNext page

The Display object, accessible through the control's Fader.Display property, is internally implemented as a COM interface called IDisplay and contains information needed to operate the Display used by the embedded Automatic Fader.

 

For details about using the Automatic Fader refer to the How to use the Automatic Fader section.

 

The Fader Display object is implemented through the following methods and properties:

 

Methods

 

Create

Show

SetHwnd

SetBackPictureFromFile

SetBackPictureFromHandle

 

Properties

 

ColorSongFadingOut

ColorSongFadingIn

ColorLineMixPoint

ColorLineSongEnd

ColorBackground

WidthSongLines

WidthReferenceLines

 

The following code snippets show how to initialise and change settings for this object in your code. These examples assume that you have placed a control named MyPlayer on a form or dialog and that you want to change a couple of settings for the Automatic Fader Display (the color of the lines representing the fading songs).

Microsoft Visual C++ (4.0, 5.0 and 6.0)

Microsoft Visual Basic (5.0 and 6.0)

Microsoft Visual Basic.NET

Microsoft Visual C#.NET

Microsoft Visual J#.NET

 

Microsoft Visual C++ (4.0, 5.0 and 6.0)

 

Properties and methods of the control are accessible through the control wrapper class CAmp3dj contained inside the amp3dj.cpp and amp3dj.h files: these wrapper files are automatically generated when you insert the control inside your project so, in order to access the wrapper functions, you will have to insert the following line of code somewhere in your code.

 

#include "amp3dj.h"

 

The Fader object and its relative Display object are respectively defined by the control wrapper classes CFader (contained inside the fader.cpp and fader.h files) and CDisplay (contained inside the display.cpp and display.h files) : also these wrapper files are automatically generated when you insert the control inside your project so, in order to access these objects, you will have to insert the following lines of code somewhere in your code.

 

#include "fader.h"

#include "display.h"

 

Here follows the code needed to perform the requested operation of initialising the Fader object and changing some of its properties.

 

// declare a Fader object and initialize it with the control's Fader reference

CFader fader = MyPlayer.GetFader ();

 

// initialise the Fader on player 0 and player 1

fader.Init (FADE_SINGLE, 0, 1);

 

// declare and obtain the Display object for the Fader

CDisplay display = fader.GetDisplay ();

 

// create the Display over an existing control identified by the IDC_GRAPHIC id

display.Create ((OLE_HANDLE) GetDlgItem (IDC_PICTURE)->GetSafeHwnd ());

 

// set the Blue color for the line representing the song fading-out

display.SetColorSongFadingOut (RGB (0, 0, 255));

 

// set the Yellow color for the line representing the song fading-in

display.SetColorSongFadingIn (RGB (255, 255, 0));

 

As you can see the access to the Fader properties FadeInLength and FadeOutLength are wrapped by the SetFadeInLength and SetFadeOutLength functions declared inside the wrapper class CFader.

Note that the use of the FADE_SINGLE enumerated type requires to add the following include to your code:

#include "AdjMmsEngDef.h"

 

Microsoft Visual Basic (5.0 and 6.0)

 

Here follows the code needed to perform the requested operations

 

' initialise the Fader

MyPlayer.Fader.Init FADE_SINGLE, 0, 1

 

' create the Display and show it over an existing Picture control

MyPlayer.Fader.Display.Create Picture1.hWnd

MyPlayer.Fader.Display.Show BOOL_TRUE

 

' set the Blue color for the line representing the song fading-out

MyPlayer.Fader.Display.ColorSongFadingOut = RGB(0, 0, 255)

 

' set the Yellow color for the line representing the song fading-in

MyPlayer.Fader.Display.ColorSongFadingIn = RGB(255, 255, 0)

 

 

Microsoft Visual Basic.NET

 

Here follows the code needed to perform the requested operations

 

' initialise the Fader

MyPlayer.Fader.Init(AMP3DJLib.enumFadeTypes.FADE_SINGLE, 0, 1)

 

' create the Display and show it over an existing Picture control

MyPlayer.Fader.Display.Create(PictureBox1.Handle.ToInt32())

MyPlayer.Fader.Display.Show(AMP3DJLib.enumBoolean.BOOL_TRUE)

 

' set the Blue color for the line representing the song fading-out

MyPlayer.Fader.Display.ColorSongFadingOut = Convert.ToUInt32(RGB(0, 0, 255))

 

' set the Yellow color for the line representing the song fading-in

MyPlayer.Fader.Display.ColorSongFadingIn = Convert.ToUInt32(RGB(255, 255, 0))

 

 

Microsoft Visual C#.NET

 

Here follows the code needed to perform the requested operations

 

// initialise the Fader

MyPlayer.Fader.Init(AMP3DJLib.enumFadeTypes.FADE_SINGLE, 0, 1);

 

// create the Display and show it over an existing Picture control

MyPlayer.Fader.Display.Create(pictureBox1.Handle.ToInt32());

MyPlayer.Fader.Display.Show (enumBoolean.BOOL_TRUE);

 

// set the Blue color for the line representing the song fading-out

MyPlayer.Fader.Display.ColorSongFadingOut = Convert.ToUInt32 (ColorTranslator.ToWin32(Color.Blue));

 

// set the Yellow color for the line representing the song fading-in

MyPlayer.Fader.Display.ColorSongFadingIn = Convert.ToUInt32 (ColorTranslator.ToWin32(Color.Yellow));

 

 

Microsoft Visual J#.NET

 

Here follows the code needed to perform the requested operations

 

// initialise the Fader

MyPlayer.get_Fader().Init(AMP3DJLib.enumFadeTypes.FADE_SINGLE, (short) 0, (short) 1);

 

// create the Display and show it over an existing Picture control

MyPlayer.get_Fader().get_Display().Create(pictureBox1.get_Handle().ToInt32());

MyPlayer.get_Fader().get_Display().Show (AMP3DJLib.enumBoolean.BOOL_TRUE);

 

// set the Blue color for the line representing the song fading-out

System.UInt32 colorBlue = (System.UInt32) ColorTranslator.ToWin32 (Color.get_Blue ());

MyPlayer.get_Fader().get_Display().set_ColorSongFadingOut (colorBlue);

 

// set the Yellow color for the line representing the song fading-in

System.UInt32 colorYellow = (System.UInt32) ColorTranslator.ToWin32 (Color.get_Yellow ());

MyPlayer.get_Fader().get_Display().set_ColorSongFadingIn (colorYellow);      

 

As you can see, in J#.NET the access to the control properties is made through the use of wrapper functions (automatically generated when you insert the control inside your project) with the "get_" and "set_" prefixes. Intellisense will help you finding the right wrapper function.